UNPKG

react-intl

Version:

Internationalize React apps. This library provides React components and an API to format dates, numbers, and strings, including pluralization and handling translations.

1,979 lines (1,962 loc) 146 kB
var ReactIntl = (() => { var __create = Object.create; var __defProp = Object.defineProperty; var __defProps = Object.defineProperties; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropDescs = Object.getOwnPropertyDescriptors; var __getOwnPropNames = Object.getOwnPropertyNames; var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __propIsEnum = Object.prototype.propertyIsEnumerable; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __spreadValues = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]); if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) { if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]); } return a; }; var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) { if (typeof require !== "undefined") return require.apply(this, arguments); throw Error('Dynamic require of "' + x + '" is not supported'); }); var __objRest = (source, exclude) => { var target = {}; for (var prop in source) if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop]; if (source != null && __getOwnPropSymbols) for (var prop of __getOwnPropSymbols(source)) { if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) target[prop] = source[prop]; } return target; }; var __commonJS = (cb, mod) => function __require2() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var __publicField = (obj, key, value) => { __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); return value; }; // node_modules/.aspect_rules_js/react-is@16.13.1/node_modules/react-is/cjs/react-is.development.js var require_react_is_development = __commonJS({ "node_modules/.aspect_rules_js/react-is@16.13.1/node_modules/react-is/cjs/react-is.development.js"(exports) { "use strict"; if (true) { (function() { "use strict"; var hasSymbol = typeof Symbol === "function" && Symbol.for; var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103; var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106; var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107; var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108; var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114; var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109; var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110; var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111; var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111; var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112; var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113; var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120; var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115; var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116; var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121; var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117; var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118; var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119; function isValidElementType(type) { return typeof type === "string" || typeof type === "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); } function typeOf(object) { if (typeof object === "object" && object !== null) { var $$typeof = object.$$typeof; switch ($$typeof) { case REACT_ELEMENT_TYPE: var type = object.type; switch (type) { case REACT_ASYNC_MODE_TYPE: case REACT_CONCURRENT_MODE_TYPE: case REACT_FRAGMENT_TYPE: case REACT_PROFILER_TYPE: case REACT_STRICT_MODE_TYPE: case REACT_SUSPENSE_TYPE: return type; default: var $$typeofType = type && type.$$typeof; switch ($$typeofType) { case REACT_CONTEXT_TYPE: case REACT_FORWARD_REF_TYPE: case REACT_LAZY_TYPE: case REACT_MEMO_TYPE: case REACT_PROVIDER_TYPE: return $$typeofType; default: return $$typeof; } } case REACT_PORTAL_TYPE: return $$typeof; } } return void 0; } var AsyncMode = REACT_ASYNC_MODE_TYPE; var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; var ContextConsumer = REACT_CONTEXT_TYPE; var ContextProvider = REACT_PROVIDER_TYPE; var Element = REACT_ELEMENT_TYPE; var ForwardRef = REACT_FORWARD_REF_TYPE; var Fragment6 = REACT_FRAGMENT_TYPE; var Lazy = REACT_LAZY_TYPE; var Memo = REACT_MEMO_TYPE; var Portal = REACT_PORTAL_TYPE; var Profiler = REACT_PROFILER_TYPE; var StrictMode = REACT_STRICT_MODE_TYPE; var Suspense = REACT_SUSPENSE_TYPE; var hasWarnedAboutDeprecatedIsAsyncMode = false; function isAsyncMode(object) { { if (!hasWarnedAboutDeprecatedIsAsyncMode) { hasWarnedAboutDeprecatedIsAsyncMode = true; console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API."); } } return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; } function isConcurrentMode(object) { return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; } function isContextConsumer(object) { return typeOf(object) === REACT_CONTEXT_TYPE; } function isContextProvider(object) { return typeOf(object) === REACT_PROVIDER_TYPE; } function isElement(object) { return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; } function isForwardRef(object) { return typeOf(object) === REACT_FORWARD_REF_TYPE; } function isFragment(object) { return typeOf(object) === REACT_FRAGMENT_TYPE; } function isLazy(object) { return typeOf(object) === REACT_LAZY_TYPE; } function isMemo(object) { return typeOf(object) === REACT_MEMO_TYPE; } function isPortal(object) { return typeOf(object) === REACT_PORTAL_TYPE; } function isProfiler(object) { return typeOf(object) === REACT_PROFILER_TYPE; } function isStrictMode(object) { return typeOf(object) === REACT_STRICT_MODE_TYPE; } function isSuspense(object) { return typeOf(object) === REACT_SUSPENSE_TYPE; } exports.AsyncMode = AsyncMode; exports.ConcurrentMode = ConcurrentMode; exports.ContextConsumer = ContextConsumer; exports.ContextProvider = ContextProvider; exports.Element = Element; exports.ForwardRef = ForwardRef; exports.Fragment = Fragment6; exports.Lazy = Lazy; exports.Memo = Memo; exports.Portal = Portal; exports.Profiler = Profiler; exports.StrictMode = StrictMode; exports.Suspense = Suspense; exports.isAsyncMode = isAsyncMode; exports.isConcurrentMode = isConcurrentMode; exports.isContextConsumer = isContextConsumer; exports.isContextProvider = isContextProvider; exports.isElement = isElement; exports.isForwardRef = isForwardRef; exports.isFragment = isFragment; exports.isLazy = isLazy; exports.isMemo = isMemo; exports.isPortal = isPortal; exports.isProfiler = isProfiler; exports.isStrictMode = isStrictMode; exports.isSuspense = isSuspense; exports.isValidElementType = isValidElementType; exports.typeOf = typeOf; })(); } } }); // node_modules/.aspect_rules_js/react-is@16.13.1/node_modules/react-is/index.js var require_react_is = __commonJS({ "node_modules/.aspect_rules_js/react-is@16.13.1/node_modules/react-is/index.js"(exports, module) { "use strict"; if (false) { module.exports = null; } else { module.exports = require_react_is_development(); } } }); // node_modules/.aspect_rules_js/hoist-non-react-statics@3.3.2/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js var require_hoist_non_react_statics_cjs = __commonJS({ "node_modules/.aspect_rules_js/hoist-non-react-statics@3.3.2/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js"(exports, module) { "use strict"; var reactIs = require_react_is(); var REACT_STATICS = { childContextTypes: true, contextType: true, contextTypes: true, defaultProps: true, displayName: true, getDefaultProps: true, getDerivedStateFromError: true, getDerivedStateFromProps: true, mixins: true, propTypes: true, type: true }; var KNOWN_STATICS = { name: true, length: true, prototype: true, caller: true, callee: true, arguments: true, arity: true }; var FORWARD_REF_STATICS = { "$$typeof": true, render: true, defaultProps: true, displayName: true, propTypes: true }; var MEMO_STATICS = { "$$typeof": true, compare: true, defaultProps: true, displayName: true, propTypes: true, type: true }; var TYPE_STATICS = {}; TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS; TYPE_STATICS[reactIs.Memo] = MEMO_STATICS; function getStatics(component) { if (reactIs.isMemo(component)) { return MEMO_STATICS; } return TYPE_STATICS[component["$$typeof"]] || REACT_STATICS; } var defineProperty = Object.defineProperty; var getOwnPropertyNames = Object.getOwnPropertyNames; var getOwnPropertySymbols = Object.getOwnPropertySymbols; var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var getPrototypeOf = Object.getPrototypeOf; var objectPrototype = Object.prototype; function hoistNonReactStatics2(targetComponent, sourceComponent, blacklist) { if (typeof sourceComponent !== "string") { if (objectPrototype) { var inheritedComponent = getPrototypeOf(sourceComponent); if (inheritedComponent && inheritedComponent !== objectPrototype) { hoistNonReactStatics2(targetComponent, inheritedComponent, blacklist); } } var keys = getOwnPropertyNames(sourceComponent); if (getOwnPropertySymbols) { keys = keys.concat(getOwnPropertySymbols(sourceComponent)); } var targetStatics = getStatics(targetComponent); var sourceStatics = getStatics(sourceComponent); for (var i = 0; i < keys.length; ++i) { var key = keys[i]; if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { var descriptor = getOwnPropertyDescriptor(sourceComponent, key); try { defineProperty(targetComponent, key, descriptor); } catch (e) { } } } } return targetComponent; } module.exports = hoistNonReactStatics2; } }); // packages/react-intl/index.ts var react_intl_exports = {}; __export(react_intl_exports, { FormattedDate: () => FormattedDate, FormattedDateParts: () => FormattedDateParts, FormattedDateTimeRange: () => dateTimeRange_default, FormattedDisplayName: () => FormattedDisplayName, FormattedList: () => FormattedList, FormattedListParts: () => FormattedListParts, FormattedMessage: () => message_default, FormattedNumber: () => FormattedNumber, FormattedNumberParts: () => FormattedNumberParts, FormattedPlural: () => plural_default, FormattedRelativeTime: () => relative_default, FormattedTime: () => FormattedTime, FormattedTimeParts: () => FormattedTimeParts, IntlContext: () => Context, IntlProvider: () => IntlProvider2, InvalidConfigError: () => InvalidConfigError, MessageFormatError: () => MessageFormatError, MissingDataError: () => MissingDataError, MissingTranslationError: () => MissingTranslationError, RawIntlProvider: () => Provider, ReactIntlError: () => IntlError, ReactIntlErrorCode: () => IntlErrorCode, UnsupportedFormatterError: () => UnsupportedFormatterError, createIntl: () => createIntl2, createIntlCache: () => createIntlCache, defineMessage: () => defineMessage, defineMessages: () => defineMessages, injectIntl: () => injectIntl, useIntl: () => useIntl }); // packages/react-intl/src/components/createFormattedComponent.tsx var React4 = __toESM(window.React); // packages/react-intl/src/components/useIntl.ts var React3 = __toESM(window.React); // packages/react-intl/src/utils.tsx var React = __toESM(window.React); // node_modules/.aspect_rules_js/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) { d2.__proto__ = b2; } || function(d2, b2) { for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p]; }; return extendStatics(d, b); }; function __extends(d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var __assign = function() { __assign = Object.assign || function __assign2(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; function __rest(s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; } function __spreadArray(to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); } // node_modules/.aspect_rules_js/@formatjs+fast-memoize@0.0.0/node_modules/@formatjs/fast-memoize/index.js function memoize(fn, options) { var cache = options && options.cache ? options.cache : cacheDefault; var serializer = options && options.serializer ? options.serializer : serializerDefault; var strategy = options && options.strategy ? options.strategy : strategyDefault; return strategy(fn, { cache, serializer }); } function isPrimitive(value) { return value == null || typeof value === "number" || typeof value === "boolean"; } function monadic(fn, cache, serializer, arg) { var cacheKey = isPrimitive(arg) ? arg : serializer(arg); var computedValue = cache.get(cacheKey); if (typeof computedValue === "undefined") { computedValue = fn.call(this, arg); cache.set(cacheKey, computedValue); } return computedValue; } function variadic(fn, cache, serializer) { var args = Array.prototype.slice.call(arguments, 3); var cacheKey = serializer(args); var computedValue = cache.get(cacheKey); if (typeof computedValue === "undefined") { computedValue = fn.apply(this, args); cache.set(cacheKey, computedValue); } return computedValue; } function assemble(fn, context, strategy, cache, serialize) { return strategy.bind(context, fn, cache, serialize); } function strategyDefault(fn, options) { var strategy = fn.length === 1 ? monadic : variadic; return assemble(fn, this, strategy, options.cache.create(), options.serializer); } function strategyVariadic(fn, options) { return assemble(fn, this, variadic, options.cache.create(), options.serializer); } function strategyMonadic(fn, options) { return assemble(fn, this, monadic, options.cache.create(), options.serializer); } var serializerDefault = function() { return JSON.stringify(arguments); }; var ObjectWithoutPrototypeCache = ( /** @class */ function() { function ObjectWithoutPrototypeCache2() { this.cache = /* @__PURE__ */ Object.create(null); } ObjectWithoutPrototypeCache2.prototype.get = function(key) { return this.cache[key]; }; ObjectWithoutPrototypeCache2.prototype.set = function(key, value) { this.cache[key] = value; }; return ObjectWithoutPrototypeCache2; }() ); var cacheDefault = { create: function create() { return new ObjectWithoutPrototypeCache(); } }; var strategies = { variadic: strategyVariadic, monadic: strategyMonadic }; // node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/error.js var ErrorKind; (function(ErrorKind2) { ErrorKind2[ErrorKind2["EXPECT_ARGUMENT_CLOSING_BRACE"] = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE"; ErrorKind2[ErrorKind2["EMPTY_ARGUMENT"] = 2] = "EMPTY_ARGUMENT"; ErrorKind2[ErrorKind2["MALFORMED_ARGUMENT"] = 3] = "MALFORMED_ARGUMENT"; ErrorKind2[ErrorKind2["EXPECT_ARGUMENT_TYPE"] = 4] = "EXPECT_ARGUMENT_TYPE"; ErrorKind2[ErrorKind2["INVALID_ARGUMENT_TYPE"] = 5] = "INVALID_ARGUMENT_TYPE"; ErrorKind2[ErrorKind2["EXPECT_ARGUMENT_STYLE"] = 6] = "EXPECT_ARGUMENT_STYLE"; ErrorKind2[ErrorKind2["INVALID_NUMBER_SKELETON"] = 7] = "INVALID_NUMBER_SKELETON"; ErrorKind2[ErrorKind2["INVALID_DATE_TIME_SKELETON"] = 8] = "INVALID_DATE_TIME_SKELETON"; ErrorKind2[ErrorKind2["EXPECT_NUMBER_SKELETON"] = 9] = "EXPECT_NUMBER_SKELETON"; ErrorKind2[ErrorKind2["EXPECT_DATE_TIME_SKELETON"] = 10] = "EXPECT_DATE_TIME_SKELETON"; ErrorKind2[ErrorKind2["UNCLOSED_QUOTE_IN_ARGUMENT_STYLE"] = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE"; ErrorKind2[ErrorKind2["EXPECT_SELECT_ARGUMENT_OPTIONS"] = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS"; ErrorKind2[ErrorKind2["EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE"] = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE"; ErrorKind2[ErrorKind2["INVALID_PLURAL_ARGUMENT_OFFSET_VALUE"] = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE"; ErrorKind2[ErrorKind2["EXPECT_SELECT_ARGUMENT_SELECTOR"] = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR"; ErrorKind2[ErrorKind2["EXPECT_PLURAL_ARGUMENT_SELECTOR"] = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR"; ErrorKind2[ErrorKind2["EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT"] = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT"; ErrorKind2[ErrorKind2["EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT"] = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT"; ErrorKind2[ErrorKind2["INVALID_PLURAL_ARGUMENT_SELECTOR"] = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR"; ErrorKind2[ErrorKind2["DUPLICATE_PLURAL_ARGUMENT_SELECTOR"] = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR"; ErrorKind2[ErrorKind2["DUPLICATE_SELECT_ARGUMENT_SELECTOR"] = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR"; ErrorKind2[ErrorKind2["MISSING_OTHER_CLAUSE"] = 22] = "MISSING_OTHER_CLAUSE"; ErrorKind2[ErrorKind2["INVALID_TAG"] = 23] = "INVALID_TAG"; ErrorKind2[ErrorKind2["INVALID_TAG_NAME"] = 25] = "INVALID_TAG_NAME"; ErrorKind2[ErrorKind2["UNMATCHED_CLOSING_TAG"] = 26] = "UNMATCHED_CLOSING_TAG"; ErrorKind2[ErrorKind2["UNCLOSED_TAG"] = 27] = "UNCLOSED_TAG"; })(ErrorKind || (ErrorKind = {})); // node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/types.js var TYPE; (function(TYPE2) { TYPE2[TYPE2["literal"] = 0] = "literal"; TYPE2[TYPE2["argument"] = 1] = "argument"; TYPE2[TYPE2["number"] = 2] = "number"; TYPE2[TYPE2["date"] = 3] = "date"; TYPE2[TYPE2["time"] = 4] = "time"; TYPE2[TYPE2["select"] = 5] = "select"; TYPE2[TYPE2["plural"] = 6] = "plural"; TYPE2[TYPE2["pound"] = 7] = "pound"; TYPE2[TYPE2["tag"] = 8] = "tag"; })(TYPE || (TYPE = {})); var SKELETON_TYPE; (function(SKELETON_TYPE2) { SKELETON_TYPE2[SKELETON_TYPE2["number"] = 0] = "number"; SKELETON_TYPE2[SKELETON_TYPE2["dateTime"] = 1] = "dateTime"; })(SKELETON_TYPE || (SKELETON_TYPE = {})); function isLiteralElement(el) { return el.type === TYPE.literal; } function isArgumentElement(el) { return el.type === TYPE.argument; } function isNumberElement(el) { return el.type === TYPE.number; } function isDateElement(el) { return el.type === TYPE.date; } function isTimeElement(el) { return el.type === TYPE.time; } function isSelectElement(el) { return el.type === TYPE.select; } function isPluralElement(el) { return el.type === TYPE.plural; } function isPoundElement(el) { return el.type === TYPE.pound; } function isTagElement(el) { return el.type === TYPE.tag; } function isNumberSkeleton(el) { return !!(el && typeof el === "object" && el.type === SKELETON_TYPE.number); } function isDateTimeSkeleton(el) { return !!(el && typeof el === "object" && el.type === SKELETON_TYPE.dateTime); } // node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/regex.generated.js var SPACE_SEPARATOR_REGEX = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/; // node_modules/.aspect_rules_js/@formatjs+icu-skeleton-parser@0.0.0/node_modules/@formatjs/icu-skeleton-parser/date-time.js var DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g; function parseDateTimeSkeleton(skeleton) { var result = {}; skeleton.replace(DATE_TIME_REGEX, function(match) { var len = match.length; switch (match[0]) { case "G": result.era = len === 4 ? "long" : len === 5 ? "narrow" : "short"; break; case "y": result.year = len === 2 ? "2-digit" : "numeric"; break; case "Y": case "u": case "U": case "r": throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead"); case "q": case "Q": throw new RangeError("`q/Q` (quarter) patterns are not supported"); case "M": case "L": result.month = ["numeric", "2-digit", "short", "long", "narrow"][len - 1]; break; case "w": case "W": throw new RangeError("`w/W` (week) patterns are not supported"); case "d": result.day = ["numeric", "2-digit"][len - 1]; break; case "D": case "F": case "g": throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead"); case "E": result.weekday = len === 4 ? "long" : len === 5 ? "narrow" : "short"; break; case "e": if (len < 4) { throw new RangeError("`e..eee` (weekday) patterns are not supported"); } result.weekday = ["short", "long", "narrow", "short"][len - 4]; break; case "c": if (len < 4) { throw new RangeError("`c..ccc` (weekday) patterns are not supported"); } result.weekday = ["short", "long", "narrow", "short"][len - 4]; break; case "a": result.hour12 = true; break; case "b": case "B": throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead"); case "h": result.hourCycle = "h12"; result.hour = ["numeric", "2-digit"][len - 1]; break; case "H": result.hourCycle = "h23"; result.hour = ["numeric", "2-digit"][len - 1]; break; case "K": result.hourCycle = "h11"; result.hour = ["numeric", "2-digit"][len - 1]; break; case "k": result.hourCycle = "h24"; result.hour = ["numeric", "2-digit"][len - 1]; break; case "j": case "J": case "C": throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead"); case "m": result.minute = ["numeric", "2-digit"][len - 1]; break; case "s": result.second = ["numeric", "2-digit"][len - 1]; break; case "S": case "A": throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead"); case "z": result.timeZoneName = len < 4 ? "short" : "long"; break; case "Z": case "O": case "v": case "V": case "X": case "x": throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead"); } return ""; }); return result; } // node_modules/.aspect_rules_js/@formatjs+icu-skeleton-parser@0.0.0/node_modules/@formatjs/icu-skeleton-parser/regex.generated.js var WHITE_SPACE_REGEX = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i; // node_modules/.aspect_rules_js/@formatjs+icu-skeleton-parser@0.0.0/node_modules/@formatjs/icu-skeleton-parser/number.js function parseNumberSkeletonFromString(skeleton) { if (skeleton.length === 0) { throw new Error("Number skeleton cannot be empty"); } var stringTokens = skeleton.split(WHITE_SPACE_REGEX).filter(function(x) { return x.length > 0; }); var tokens = []; for (var _i = 0, stringTokens_1 = stringTokens; _i < stringTokens_1.length; _i++) { var stringToken = stringTokens_1[_i]; var stemAndOptions = stringToken.split("/"); if (stemAndOptions.length === 0) { throw new Error("Invalid number skeleton"); } var stem = stemAndOptions[0], options = stemAndOptions.slice(1); for (var _a2 = 0, options_1 = options; _a2 < options_1.length; _a2++) { var option = options_1[_a2]; if (option.length === 0) { throw new Error("Invalid number skeleton"); } } tokens.push({ stem, options }); } return tokens; } function icuUnitToEcma(unit) { return unit.replace(/^(.*?)-/, ""); } var FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g; var SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?[rs]?$/g; var INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g; var CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/; function parseSignificantPrecision(str) { var result = {}; if (str[str.length - 1] === "r") { result.roundingPriority = "morePrecision"; } else if (str[str.length - 1] === "s") { result.roundingPriority = "lessPrecision"; } str.replace(SIGNIFICANT_PRECISION_REGEX, function(_, g1, g2) { if (typeof g2 !== "string") { result.minimumSignificantDigits = g1.length; result.maximumSignificantDigits = g1.length; } else if (g2 === "+") { result.minimumSignificantDigits = g1.length; } else if (g1[0] === "#") { result.maximumSignificantDigits = g1.length; } else { result.minimumSignificantDigits = g1.length; result.maximumSignificantDigits = g1.length + (typeof g2 === "string" ? g2.length : 0); } return ""; }); return result; } function parseSign(str) { switch (str) { case "sign-auto": return { signDisplay: "auto" }; case "sign-accounting": case "()": return { currencySign: "accounting" }; case "sign-always": case "+!": return { signDisplay: "always" }; case "sign-accounting-always": case "()!": return { signDisplay: "always", currencySign: "accounting" }; case "sign-except-zero": case "+?": return { signDisplay: "exceptZero" }; case "sign-accounting-except-zero": case "()?": return { signDisplay: "exceptZero", currencySign: "accounting" }; case "sign-never": case "+_": return { signDisplay: "never" }; } } function parseConciseScientificAndEngineeringStem(stem) { var result; if (stem[0] === "E" && stem[1] === "E") { result = { notation: "engineering" }; stem = stem.slice(2); } else if (stem[0] === "E") { result = { notation: "scientific" }; stem = stem.slice(1); } if (result) { var signDisplay = stem.slice(0, 2); if (signDisplay === "+!") { result.signDisplay = "always"; stem = stem.slice(2); } else if (signDisplay === "+?") { result.signDisplay = "exceptZero"; stem = stem.slice(2); } if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) { throw new Error("Malformed concise eng/scientific notation"); } result.minimumIntegerDigits = stem.length; } return result; } function parseNotationOptions(opt) { var result = {}; var signOpts = parseSign(opt); if (signOpts) { return signOpts; } return result; } function parseNumberSkeleton(tokens) { var result = {}; for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) { var token = tokens_1[_i]; switch (token.stem) { case "percent": case "%": result.style = "percent"; continue; case "%x100": result.style = "percent"; result.scale = 100; continue; case "currency": result.style = "currency"; result.currency = token.options[0]; continue; case "group-off": case ",_": result.useGrouping = false; continue; case "precision-integer": case ".": result.maximumFractionDigits = 0; continue; case "measure-unit": case "unit": result.style = "unit"; result.unit = icuUnitToEcma(token.options[0]); continue; case "compact-short": case "K": result.notation = "compact"; result.compactDisplay = "short"; continue; case "compact-long": case "KK": result.notation = "compact"; result.compactDisplay = "long"; continue; case "scientific": result = __assign(__assign(__assign({}, result), { notation: "scientific" }), token.options.reduce(function(all, opt2) { return __assign(__assign({}, all), parseNotationOptions(opt2)); }, {})); continue; case "engineering": result = __assign(__assign(__assign({}, result), { notation: "engineering" }), token.options.reduce(function(all, opt2) { return __assign(__assign({}, all), parseNotationOptions(opt2)); }, {})); continue; case "notation-simple": result.notation = "standard"; continue; case "unit-width-narrow": result.currencyDisplay = "narrowSymbol"; result.unitDisplay = "narrow"; continue; case "unit-width-short": result.currencyDisplay = "code"; result.unitDisplay = "short"; continue; case "unit-width-full-name": result.currencyDisplay = "name"; result.unitDisplay = "long"; continue; case "unit-width-iso-code": result.currencyDisplay = "symbol"; continue; case "scale": result.scale = parseFloat(token.options[0]); continue; case "rounding-mode-floor": result.roundingMode = "floor"; continue; case "rounding-mode-ceiling": result.roundingMode = "ceil"; continue; case "rounding-mode-down": result.roundingMode = "trunc"; continue; case "rounding-mode-up": result.roundingMode = "expand"; continue; case "rounding-mode-half-even": result.roundingMode = "halfEven"; continue; case "rounding-mode-half-down": result.roundingMode = "halfTrunc"; continue; case "rounding-mode-half-up": result.roundingMode = "halfExpand"; continue; case "integer-width": if (token.options.length > 1) { throw new RangeError("integer-width stems only accept a single optional option"); } token.options[0].replace(INTEGER_WIDTH_REGEX, function(_, g1, g2, g3, g4, g5) { if (g1) { result.minimumIntegerDigits = g2.length; } else if (g3 && g4) { throw new Error("We currently do not support maximum integer digits"); } else if (g5) { throw new Error("We currently do not support exact integer digits"); } return ""; }); continue; } if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) { result.minimumIntegerDigits = token.stem.length; continue; } if (FRACTION_PRECISION_REGEX.test(token.stem)) { if (token.options.length > 1) { throw new RangeError("Fraction-precision stems only accept a single optional option"); } token.stem.replace(FRACTION_PRECISION_REGEX, function(_, g1, g2, g3, g4, g5) { if (g2 === "*") { result.minimumFractionDigits = g1.length; } else if (g3 && g3[0] === "#") { result.maximumFractionDigits = g3.length; } else if (g4 && g5) { result.minimumFractionDigits = g4.length; result.maximumFractionDigits = g4.length + g5.length; } else { result.minimumFractionDigits = g1.length; result.maximumFractionDigits = g1.length; } return ""; }); var opt = token.options[0]; if (opt === "w") { result = __assign(__assign({}, result), { trailingZeroDisplay: "stripIfInteger" }); } else if (opt) { result = __assign(__assign({}, result), parseSignificantPrecision(opt)); } continue; } if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) { result = __assign(__assign({}, result), parseSignificantPrecision(token.stem)); continue; } var signOpts = parseSign(token.stem); if (signOpts) { result = __assign(__assign({}, result), signOpts); } var conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem); if (conciseScientificAndEngineeringOpts) { result = __assign(__assign({}, result), conciseScientificAndEngineeringOpts); } } return result; } // node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/time-data.generated.js var timeData = { "001": [ "H", "h" ], "419": [ "h", "H", "hB", "hb" ], "AC": [ "H", "h", "hb", "hB" ], "AD": [ "H", "hB" ], "AE": [ "h", "hB", "hb", "H" ], "AF": [ "H", "hb", "hB", "h" ], "AG": [ "h", "hb", "H", "hB" ], "AI": [ "H", "h", "hb", "hB" ], "AL": [ "h", "H", "hB" ], "AM": [ "H", "hB" ], "AO": [ "H", "hB" ], "AR": [ "h", "H", "hB", "hb" ], "AS": [ "h", "H" ], "AT": [ "H", "hB" ], "AU": [ "h", "hb", "H", "hB" ], "AW": [ "H", "hB" ], "AX": [ "H" ], "AZ": [ "H", "hB", "h" ], "BA": [ "H", "hB", "h" ], "BB": [ "h", "hb", "H", "hB" ], "BD": [ "h", "hB", "H" ], "BE": [ "H", "hB" ], "BF": [ "H", "hB" ], "BG": [ "H", "hB", "h" ], "BH": [ "h", "hB", "hb", "H" ], "BI": [ "H", "h" ], "BJ": [ "H", "hB" ], "BL": [ "H", "hB" ], "BM": [ "h", "hb", "H", "hB" ], "BN": [ "hb", "hB", "h", "H" ], "BO": [ "h", "H", "hB", "hb" ], "BQ": [ "H" ], "BR": [ "H", "hB" ], "BS": [ "h", "hb", "H", "hB" ], "BT": [ "h", "H" ], "BW": [ "H", "h", "hb", "hB" ], "BY": [ "H", "h" ], "BZ": [ "H", "h", "hb", "hB" ], "CA": [ "h", "hb", "H", "hB" ], "CC": [ "H", "h", "hb", "hB" ], "CD": [ "hB", "H" ], "CF": [ "H", "h", "hB" ], "CG": [ "H", "hB" ], "CH": [ "H", "hB", "h" ], "CI": [ "H", "hB" ], "CK": [ "H", "h", "hb", "hB" ], "CL": [ "h", "H", "hB", "hb" ], "CM": [ "H", "h", "hB" ], "CN": [ "H", "hB", "hb", "h" ], "CO": [ "h", "H", "hB", "hb" ], "CP": [ "H" ], "CR": [ "h", "H", "hB", "hb" ], "CU": [ "h", "H", "hB", "hb" ], "CV": [ "H", "hB" ], "CW": [ "H", "hB" ], "CX": [ "H", "h", "hb", "hB" ], "CY": [ "h", "H", "hb", "hB" ], "CZ": [ "H" ], "DE": [ "H", "hB" ], "DG": [ "H", "h", "hb", "hB" ], "DJ": [ "h", "H" ], "DK": [ "H" ], "DM": [ "h", "hb", "H", "hB" ], "DO": [ "h", "H", "hB", "hb" ], "DZ": [ "h", "hB", "hb", "H" ], "EA": [ "H", "h", "hB", "hb" ], "EC": [ "h", "H", "hB", "hb" ], "EE": [ "H", "hB" ], "EG": [ "h", "hB", "hb", "H" ], "EH": [ "h", "hB", "hb", "H" ], "ER": [ "h", "H" ], "ES": [ "H", "hB", "h", "hb" ], "ET": [ "hB", "hb", "h", "H" ], "FI": [ "H" ], "FJ": [ "h", "hb", "H", "hB" ], "FK": [ "H", "h", "hb", "hB" ], "FM": [ "h", "hb", "H", "hB" ], "FO": [ "H", "h" ], "FR": [ "H", "hB" ], "GA": [ "H", "hB" ], "GB": [ "H", "h", "hb", "hB" ], "GD": [ "h", "hb", "H", "hB" ], "GE": [ "H", "hB", "h" ], "GF": [ "H", "hB" ], "GG": [ "H", "h", "hb", "hB" ], "GH": [ "h", "H" ], "GI": [ "H", "h", "hb", "hB" ], "GL": [ "H", "h" ], "GM": [ "h", "hb", "H", "hB" ], "GN": [ "H", "hB" ], "GP": [ "H", "hB" ], "GQ": [ "H", "hB", "h", "hb" ], "GR": [ "h", "H", "hb", "hB" ], "GT": [ "h", "H", "hB", "hb" ], "GU": [ "h", "hb", "H", "hB" ], "GW": [ "H", "hB" ], "GY": [ "h", "hb", "H", "hB" ], "HK": [ "h", "hB", "hb", "H" ], "HN": [ "h", "H", "hB", "hb" ], "HR": [ "H", "hB" ], "HU": [ "H", "h" ], "IC": [ "H", "h", "hB", "hb" ], "ID": [ "H" ], "IE": [ "H", "h", "hb", "hB" ], "IL": [ "H", "hB" ], "IM": [ "H", "h", "hb", "hB" ], "IN": [ "h", "H" ], "IO": [ "H", "h", "hb", "hB" ], "IQ": [ "h", "hB", "hb", "H" ], "IR": [ "hB", "H" ], "IS": [ "H" ], "IT": [ "H", "hB" ], "JE": [ "H", "h", "hb", "hB" ], "JM": [ "h", "hb", "H", "hB" ], "JO": [ "h", "hB", "hb", "H" ], "JP": [ "H", "K", "h" ], "KE": [ "hB", "hb", "H", "h" ], "KG": [ "H", "h", "hB", "hb" ], "KH": [ "hB", "h", "H", "hb" ], "KI": [ "h", "hb", "H", "hB" ], "KM": [ "H", "h", "hB", "hb" ], "KN": [ "h", "hb", "H", "hB" ], "KP": [ "h", "H", "hB", "hb" ], "KR": [ "h", "H", "hB", "hb" ], "KW": [ "h", "hB", "hb", "H" ], "KY": [ "h", "hb", "H", "hB" ], "KZ": [ "H", "hB" ], "LA": [ "H", "hb", "hB", "h" ], "LB": [ "h", "hB", "hb", "H" ], "LC": [ "h", "hb", "H", "hB" ], "LI": [ "H", "hB", "h" ], "LK": [ "H", "h", "hB", "hb" ], "LR": [ "h", "hb", "H", "hB" ], "LS": [ "h", "H" ], "LT": [ "H", "h", "hb", "hB" ], "LU": [ "H", "h", "hB" ], "LV": [ "H", "hB", "hb", "h" ], "LY": [ "h", "hB", "hb", "H" ], "MA": [ "H", "h", "hB", "hb" ], "MC": [ "H", "hB" ], "MD": [ "H", "hB" ], "ME": [ "H", "hB", "h" ], "MF": [ "H", "hB" ], "MG": [ "H", "h" ], "MH": [ "h", "hb", "H", "hB" ], "MK": [ "H", "h", "hb", "hB" ], "ML": [ "H" ], "MM": [ "hB", "hb", "H", "h" ], "MN": [ "H", "h", "hb", "hB" ], "MO": [ "h", "hB", "hb", "H" ], "MP": [ "h", "hb", "H", "hB" ], "MQ": [ "H", "hB" ], "MR": [ "h", "hB", "hb", "H" ], "MS": [ "H", "h", "hb", "hB" ], "MT": [ "H", "h" ], "MU": [ "H", "h" ], "MV": [ "H", "h" ], "MW": [ "h", "hb", "H", "hB" ], "MX": [ "h", "H", "hB", "hb" ], "MY": [ "hb", "hB", "h", "H" ], "MZ": [ "H", "hB" ], "NA": [ "h", "H", "hB", "hb" ], "NC": [ "H", "hB" ], "NE": [ "H" ], "NF": [ "H", "h", "hb", "hB" ], "NG": [ "H", "h", "hb", "hB" ], "NI": [ "h", "H", "hB", "hb" ], "NL": [ "H", "hB" ], "NO": [ "H", "h" ], "NP": [ "H", "h", "hB" ], "NR": [ "H", "h", "hb", "hB" ], "NU": [ "H", "h", "hb", "hB" ], "NZ": [ "h", "hb", "H", "hB" ], "OM": [ "h", "hB", "hb", "H" ], "PA": [ "h", "H", "hB", "hb" ], "PE": [ "h", "H", "hB", "hb" ], "PF": [ "H", "h", "hB" ], "PG": [ "h", "H" ], "PH": [ "h", "hB", "hb", "H" ], "PK": [ "h", "hB", "H" ], "PL": [ "H", "h" ], "PM": [ "H", "hB" ], "PN": [ "H", "h", "hb", "hB" ], "PR": [ "h", "H", "hB", "hb" ], "PS": [ "h", "hB", "hb", "H" ], "PT": [ "H", "hB" ], "PW": [ "h", "H" ], "PY": [ "h", "H", "hB", "hb" ], "QA": [ "h", "hB", "hb", "H" ], "RE": [ "H", "hB" ], "RO": [ "H", "hB" ], "RS": [ "H", "hB", "h" ], "RU": [ "H" ], "RW": [ "H", "h" ], "SA": [ "h", "hB", "hb", "H" ], "SB": [ "h",