Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

intl-messageformat

Package Overview
Dependencies
Maintainers
10
Versions
268
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

intl-messageformat - npm Package Compare versions

Comparing version 7.3.2 to 7.3.3

core.d.ts

12

CHANGELOG.md

@@ -6,2 +6,14 @@ # Change Log

## [7.3.3](https://github.com/formatjs/formatjs/compare/intl-messageformat@7.3.2...intl-messageformat@7.3.3) (2019-10-23)
### Bug Fixes
* **intl-messageformat:** fix formatHTMLMessage @ regex ([d1b7c8c](https://github.com/formatjs/formatjs/commit/d1b7c8c14a0b90f8d059a8dc3e12ce7976192975)), closes [#217](https://github.com/formatjs/formatjs/issues/217)
* **intl-messageformat:** handle nested # in plural correctly, fix [#202](https://github.com/formatjs/formatjs/issues/202) ([22121b2](https://github.com/formatjs/formatjs/commit/22121b210b566ad3dd509e4cbf47d3c245742928))
## [7.3.2](https://github.com/formatjs/formatjs/compare/intl-messageformat@7.3.1...intl-messageformat@7.3.2) (2019-10-01)

@@ -8,0 +20,0 @@

6

dist/core.js

@@ -94,3 +94,3 @@ "use strict";

this.formatToParts = function (values) {
return formatters_1.formatToParts(_this.ast, _this.locale, _this.formatters, _this.formats, values, _this.message);
return formatters_1.formatToParts(_this.ast, _this.locale, _this.formatters, _this.formats, values, undefined, _this.message);
};

@@ -108,3 +108,5 @@ this.formatHTMLMessage = function (values) {

// Parse string messages into an AST.
this.ast = IntlMessageFormat.__parse(message);
this.ast = IntlMessageFormat.__parse(message, {
normalizeHashtagInPlural: false,
});
}

@@ -111,0 +113,0 @@ else {

@@ -31,5 +31,5 @@ import { MessageFormatElement } from 'intl-messageformat-parser';

export declare type PrimitiveType = string | number | boolean | null | undefined | Date;
export declare function formatToParts(els: MessageFormatElement[], locales: string | string[], formatters: Formatters, formats: Formats, values?: Record<string, any>, originalMessage?: string): MessageFormatPart[];
export declare function formatToParts(els: MessageFormatElement[], locales: string | string[], formatters: Formatters, formats: Formats, values?: Record<string, any>, currentPluralValue?: number, originalMessage?: string): MessageFormatPart[];
export declare function formatToString(els: MessageFormatElement[], locales: string | string[], formatters: Formatters, formats: Formats, values?: Record<string, PrimitiveType>, originalMessage?: string): string;
export declare type FormatXMLElementFn = (...args: any[]) => string | object;
export declare function formatHTMLMessage(els: MessageFormatElement[], locales: string | string[], formatters: Formatters, formats: Formats, values?: Record<string, PrimitiveType | object | FormatXMLElementFn>, originalMessage?: string): Array<string | object>;

@@ -25,2 +25,3 @@ "use strict";

var ESCAPE_HASH_REGEX = /\\#/g;
var PLURAL_HASH = /(^|[^\\])#/g;
var FormatError = /** @class */ (function (_super) {

@@ -53,3 +54,3 @@ __extends(FormatError, _super);

// TODO(skeleton): add skeleton support
function formatToParts(els, locales, formatters, formats, values,
function formatToParts(els, locales, formatters, formats, values, currentPluralValue,
// For debugging

@@ -59,6 +60,10 @@ originalMessage) {

if (els.length === 1 && intl_messageformat_parser_1.isLiteralElement(els[0])) {
var value = els[0].value;
if (typeof currentPluralValue === 'number') {
value = value.replace(PLURAL_HASH, '$1' + formatters.getNumberFormat(locales).format(currentPluralValue));
}
return [
{
type: 0 /* literal */,
value: els[0].value.replace(ESCAPE_HASH_REGEX, '#'),
value: value.replace(ESCAPE_HASH_REGEX, '#'),
},

@@ -72,5 +77,9 @@ ];

if (intl_messageformat_parser_1.isLiteralElement(el)) {
var value_1 = el.value;
if (typeof currentPluralValue === 'number') {
value_1 = value_1.replace(PLURAL_HASH, '$1' + formatters.getNumberFormat(locales).format(currentPluralValue));
}
result.push({
type: 0 /* literal */,
value: el.value.replace(ESCAPE_HASH_REGEX, '#'),
value: value_1.replace(ESCAPE_HASH_REGEX, '#'),
});

@@ -153,3 +162,3 @@ continue;

}
result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values));
result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values, value - (el.offset || 0)));
continue;

@@ -164,3 +173,3 @@ }

originalMessage) {
var parts = formatToParts(els, locales, formatters, formats, values, originalMessage);
var parts = formatToParts(els, locales, formatters, formats, values, undefined, originalMessage);
// Hot path for straight simple msg translations

@@ -176,3 +185,3 @@ if (parts.length === 1) {

var TOKEN_DELIMITER = '@@';
var TOKEN_REGEX = /@@(.*?)@@/g;
var TOKEN_REGEX = /@@(\d+_\d+)@@/g;
var counter = 0;

@@ -253,3 +262,3 @@ function generateId() {

originalMessage) {
var parts = formatToParts(els, locales, formatters, formats, values, originalMessage);
var parts = formatToParts(els, locales, formatters, formats, values, undefined, originalMessage);
var objectParts = {};

@@ -256,0 +265,0 @@ var formattedMessage = parts.reduce(function (all, part) {

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).IntlMessageFormat={})}(this,function(e){"use strict";var Ot,t;function v(e){return e.type===Ot.literal}function g(e){return e.type===Ot.select}function d(e){return e.type===Ot.plural}(t=Ot||(Ot={}))[t.literal=0]="literal",t[t.argument=1]="argument",t[t.number=2]="number",t[t.date=3]="date",t[t.time=4]="time",t[t.select=5]="select",t[t.plural=6]="plural";var n,a,r=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Ft=function(){return(Ft=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var u in t=arguments[r])Object.prototype.hasOwnProperty.call(t,u)&&(e[u]=t[u]);return e}).apply(this,arguments)},_t=(a=Error,r(o,a),o.buildMessage=function(e,t){function r(e){return e.charCodeAt(0).toString(16).toUpperCase()}function n(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+r(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+r(e)})}function u(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+r(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+r(e)})}function a(e){switch(e.type){case"literal":return'"'+n(e.text)+'"';case"class":var t=e.parts.map(function(e){return Array.isArray(e)?u(e[0])+"-"+u(e[1]):u(e)});return"["+(e.inverted?"^":"")+t+"]";case"any":return"any character";case"end":return"end of input";case"other":return e.description}}return"Expected "+function(e){var t,r,n=e.map(a);if(n.sort(),0<n.length){for(r=t=1;t<n.length;t++)n[t-1]!==n[t]&&(n[r]=n[t],r++);n.length=r}switch(n.length){case 1:return n[0];case 2:return n[0]+" or "+n[1];default:return n.slice(0,-1).join(", ")+", or "+n[n.length-1]}}(e)+" but "+((o=t)?'"'+n(o)+'"':"end of input")+" found.";var o},o);function o(e,t,r,n){var u=a.call(this)||this;return u.message=e,u.expected=t,u.found=r,u.location=n,u.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(u,o),u}var f=function(f,e){e=void 0!==e?e:{};var t,r,n,u,p={},a={start:rt},o=rt,i=function(e){return e.join("")},s=function(e){return Ft({type:Ot.literal,value:e},Ct())},c=We("argumentElement"),h="{",m=Qe("{",!1),v="}",g=Qe("}",!1),l=function(e){return Ft({type:Ot.argument,value:e},Ct())},d=We("numberSkeletonId"),y=/^['\/{}]/,A=Ve(["'","/","{","}"],!1,!1),b={type:"any"},w=We("numberSkeletonTokenOption"),x="/",C=Qe("/",!1),O=function(e){return e},F=We("numberSkeletonToken"),_=function(e,t){return{stem:e,options:t}},T=function(e){return Ft({type:0,tokens:e},Ct())},j="::",E=Qe("::",!1),M=function(e){return e},k=function(e){return e.replace(/\s*$/,"")},P=",",I=Qe(",",!1),D="number",L=Qe("number",!1),N=function(e,t,r){return Ft({type:"number"===t?Ot.number:"date"===t?Ot.date:Ot.time,style:r&&r[2],value:e},Ct())},R="'",S=Qe("'",!1),B=/^[^']/,Z=Ve(["'"],!0,!1),z=/^[^a-zA-Z'{}]/,H=Ve([["a","z"],["A","Z"],"'","{","}"],!0,!1),$=/^[a-zA-Z]/,J=Ve([["a","z"],["A","Z"]],!1,!1),U=function(e){return Ft({type:1,pattern:e},Ct())},X="date",q=Qe("date",!1),G="time",K=Qe("time",!1),Q="plural",V=Qe("plural",!1),W="selectordinal",Y=Qe("selectordinal",!1),ee="offset:",te=Qe("offset:",!1),re=function(e,t,r,n){return Ft({type:Ot.plural,pluralType:"plural"===t?"cardinal":"ordinal",value:e,offset:r?r[2]:0,options:n.reduce(function(e,t){var r=t.id,n=t.value,u=t.location;return r in e&&Ke('Duplicate option "'+r+'" in plural element: "'+qe()+'"',Ge()),e[r]={value:n,location:u},e},{})},Ct())},ne="select",ue=Qe("select",!1),ae=function(e,t){return Ft({type:Ot.select,value:e,options:t.reduce(function(e,t){var r=t.id,n=t.value,u=t.location;return r in e&&Ke('Duplicate option "'+r+'" in select element: "'+qe()+'"',Ge()),e[r]={value:n,location:u},e},{})},Ct())},oe="=",ie=Qe("=",!1),se=function(e,t){return Ft({id:e,value:t},Ct())},ce=function(e,t){return Ft({id:e,value:t},Ct())},le=We("whitespace pattern"),fe=/^[\t-\r \x85\u200E\u200F\u2028\u2029]/,pe=Ve([["\t","\r"]," ","…","‎","‏","\u2028","\u2029"],!1,!1),he=We("syntax pattern"),me=/^[!-\/:-@[-\^`{-~\xA1-\xA7\xA9\xAB\xAC\xAE\xB0\xB1\xB6\xBB\xBF\xD7\xF7\u2010-\u2027\u2030-\u203E\u2041-\u2053\u2055-\u205E\u2190-\u245F\u2500-\u2775\u2794-\u2BFF\u2E00-\u2E7F\u3001-\u3003\u3008-\u3020\u3030\uFD3E\uFD3F\uFE45\uFE46]/,ve=Ve([["!","/"],[":","@"],["[","^"],"`",["{","~"],["¡","§"],"©","«","¬","®","°","±","¶","»","¿","×","÷",["‐","‧"],["‰","‾"],["⁁","⁓"],["⁕","⁞"],["←","⑟"],["─","❵"],["➔","⯿"],["⸀","⹿"],["、","〃"],["〈","〠"],"〰","﴾","﴿","﹅","﹆"],!1,!1),ge=We("optional whitespace"),de=We("number"),ye="-",Ae=Qe("-",!1),be=function(e,t){return t?e?-t:t:0},we=We("double apostrophes"),xe="''",Ce=Qe("''",!1),Oe=function(){return"'"},Fe=/^[{}]/,_e=Ve(["{","}"],!1,!1),Te=function(e,t){return e+t.replace("''","'")},je=/^[^{}]/,Ee=Ve(["{","}"],!0,!1),Me=We("argNameOrNumber"),ke=We("argNumber"),Pe="0",Ie=Qe("0",!1),De=function(){return 0},Le=/^[1-9]/,Ne=Ve([["1","9"]],!1,!1),Re=/^[0-9]/,Se=Ve([["0","9"]],!1,!1),Be=function(e){return parseInt(e.join(""),10)},Ze=We("argName"),ze=0,He=0,$e=[{line:1,column:1}],Je=0,Ue=[],Xe=0;if(void 0!==e.startRule){if(!(e.startRule in a))throw new Error("Can't start parsing from rule \""+e.startRule+'".');o=a[e.startRule]}function qe(){return f.substring(He,ze)}function Ge(){return et(He,ze)}function Ke(e,t){throw function(e,t){return new _t(e,[],"",t)}(e,t=void 0!==t?t:et(He,ze))}function Qe(e,t){return{type:"literal",text:e,ignoreCase:t}}function Ve(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function We(e){return{type:"other",description:e}}function Ye(e){var t,r=$e[e];if(r)return r;for(t=e-1;!$e[t];)t--;for(r={line:(r=$e[t]).line,column:r.column};t<e;)10===f.charCodeAt(t)?(r.line++,r.column=1):r.column++,t++;return $e[e]=r}function et(e,t){var r=Ye(e),n=Ye(t);return{start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:n.line,column:n.column}}}function tt(e){ze<Je||(Je<ze&&(Je=ze,Ue=[]),Ue.push(e))}function rt(){return nt()}function nt(){var e,t;for(e=[],t=ut();t!==p;)e.push(t),t=ut();return e}function ut(){var e;return(e=function(){var e,t;e=ze,(t=at())!==p&&(He=e,t=s(t));return e=t}())===p&&(e=function(){var e,t,r,n,u;Xe++,e=ze,123===f.charCodeAt(ze)?(t=h,ze++):(t=p,0===Xe&&tt(m));e=t!==p?(r=vt(),r!==p?(n=bt())!==p?vt()!==p?(125===f.charCodeAt(ze)?(u=v,ze++):(u=p,0===Xe&&tt(g)),u!==p?(He=e,t=l(n)):(ze=e,p)):(ze=e,p):(ze=e,p):(ze=e,p)):(ze=e,p);Xe--,e===p&&(t=p,0===Xe&&tt(c));return e}())===p&&(e=function(){var e;(e=function(){var e,t,r,n,u,a,o,i,s,c;e=ze,123===f.charCodeAt(ze)?(t=h,ze++):(t=p,0===Xe&&tt(m));e=t!==p?(r=vt(),r!==p?(n=bt())!==p?vt()!==p?(44===f.charCodeAt(ze)?(u=P,ze++):(u=p,0===Xe&&tt(I)),u!==p?vt()!==p?(f.substr(ze,6)===D?(a=D,ze+=6):(a=p,0===Xe&&tt(L)),a!==p?vt()!==p?(o=ze,44===f.charCodeAt(ze)?(i=P,ze++):(i=p,0===Xe&&tt(I)),(o=i!==p?(s=vt())!==p?(c=function(){var e,t,r;e=ze,f.substr(ze,2)===j?(t=j,ze+=2):(t=p,0===Xe&&tt(E));e=t!==p?(r=function(){var e,t,r;if(e=ze,t=[],(r=st())!==p)for(;r!==p;)t.push(r),r=st();else t=p;t!==p&&(He=e,t=T(t));return e=t}(),r!==p?(He=e,t=M(r)):(ze=e,p)):(ze=e,p);e===p&&(e=ze,(t=at())!==p&&(He=e,t=k(t)),e=t);return e}())!==p?i=[i,s,c]:(ze=o,p):(ze=o,p):(ze=o,p))===p&&(o=null),o!==p?(i=vt())!==p?(125===f.charCodeAt(ze)?(s=v,ze++):(s=p,0===Xe&&tt(g)),s!==p?(He=e,t=N(n,a,o)):(ze=e,p)):(ze=e,p):(ze=e,p)):(ze=e,p):(ze=e,p)):(ze=e,p):(ze=e,p)):(ze=e,p):(ze=e,p):(ze=e,p)):(ze=e,p);return e}())===p&&(e=function(){var e,t,r,n,u,a,o,i,s,c;e=ze,123===f.charCodeAt(ze)?(t=h,ze++):(t=p,0===Xe&&tt(m));e=t!==p?(r=vt(),r!==p?(n=bt())!==p?vt()!==p?(44===f.charCodeAt(ze)?(u=P,ze++):(u=p,0===Xe&&tt(I)),u!==p?vt()!==p?(f.substr(ze,4)===X?(a=X,ze+=4):(a=p,0===Xe&&tt(q)),a===p&&(f.substr(ze,4)===G?(a=G,ze+=4):(a=p,0===Xe&&tt(K))),a!==p?vt()!==p?(o=ze,44===f.charCodeAt(ze)?(i=P,ze++):(i=p,0===Xe&&tt(I)),(o=i!==p?(s=vt())!==p?(c=function(){var e,t,r;e=ze,f.substr(ze,2)===j?(t=j,ze+=2):(t=p,0===Xe&&tt(E));e=t!==p?(r=function(){var e,t,r,n;t=e=ze,r=[],(n=ct())===p&&(n=lt());if(n!==p)for(;n!==p;)r.push(n),(n=ct())===p&&(n=lt());else r=p;t=r!==p?f.substring(t,ze):r;t!==p&&(He=e,t=U(t));return e=t}(),r!==p?(He=e,t=M(r)):(ze=e,p)):(ze=e,p);e===p&&(e=ze,(t=at())!==p&&(He=e,t=k(t)),e=t);return e}())!==p?i=[i,s,c]:(ze=o,p):(ze=o,p):(ze=o,p))===p&&(o=null),o!==p?(i=vt())!==p?(125===f.charCodeAt(ze)?(s=v,ze++):(s=p,0===Xe&&tt(g)),s!==p?(He=e,t=N(n,a,o)):(ze=e,p)):(ze=e,p):(ze=e,p)):(ze=e,p):(ze=e,p)):(ze=e,p):(ze=e,p)):(ze=e,p):(ze=e,p):(ze=e,p)):(ze=e,p);return e}());return e}())===p&&(e=function(){var e,t,r,n,u,a,o,i,s,c,l;e=ze,123===f.charCodeAt(ze)?(t=h,ze++):(t=p,0===Xe&&tt(m));if(t!==p)if(vt()!==p)if((r=bt())!==p)if(vt()!==p)if(44===f.charCodeAt(ze)?(n=P,ze++):(n=p,0===Xe&&tt(I)),n!==p)if(vt()!==p)if(f.substr(ze,6)===Q?(u=Q,ze+=6):(u=p,0===Xe&&tt(V)),u===p&&(f.substr(ze,13)===W?(u=W,ze+=13):(u=p,0===Xe&&tt(Y))),u!==p)if(vt()!==p)if(44===f.charCodeAt(ze)?(a=P,ze++):(a=p,0===Xe&&tt(I)),a!==p)if(vt()!==p)if(o=ze,f.substr(ze,7)===ee?(i=ee,ze+=7):(i=p,0===Xe&&tt(te)),(o=i!==p?(s=vt())!==p?(c=gt())!==p?i=[i,s,c]:(ze=o,p):(ze=o,p):(ze=o,p))===p&&(o=null),o!==p)if((i=vt())!==p){if(s=[],(c=pt())!==p)for(;c!==p;)s.push(c),c=pt();else s=p;e=s!==p?(c=vt())!==p?(125===f.charCodeAt(ze)?(l=v,ze++):(l=p,0===Xe&&tt(g)),l!==p?(He=e,t=re(r,u,o,s)):(ze=e,p)):(ze=e,p):(ze=e,p)}else ze=e,e=p;else ze=e,e=p;else ze=e,e=p;else ze=e,e=p;else ze=e,e=p;else ze=e,e=p;else ze=e,e=p;else ze=e,e=p;else ze=e,e=p;else ze=e,e=p;else ze=e,e=p;else ze=e,e=p;return e}())===p&&(e=function(){var e,t,r,n,u,a,o,i,s;e=ze,123===f.charCodeAt(ze)?(t=h,ze++):(t=p,0===Xe&&tt(m));if(t!==p)if(vt()!==p)if((r=bt())!==p)if(vt()!==p)if(44===f.charCodeAt(ze)?(n=P,ze++):(n=p,0===Xe&&tt(I)),n!==p)if(vt()!==p)if(f.substr(ze,6)===ne?(u=ne,ze+=6):(u=p,0===Xe&&tt(ue)),u!==p)if(vt()!==p)if(44===f.charCodeAt(ze)?(a=P,ze++):(a=p,0===Xe&&tt(I)),a!==p)if(vt()!==p){if(o=[],(i=ft())!==p)for(;i!==p;)o.push(i),i=ft();else o=p;e=o!==p?(i=vt())!==p?(125===f.charCodeAt(ze)?(s=v,ze++):(s=p,0===Xe&&tt(g)),s!==p?(He=e,t=ae(r,o)):(ze=e,p)):(ze=e,p):(ze=e,p)}else ze=e,e=p;else ze=e,e=p;else ze=e,e=p;else ze=e,e=p;else ze=e,e=p;else ze=e,e=p;else ze=e,e=p;else ze=e,e=p;else ze=e,e=p;else ze=e,e=p;return e}()),e}function at(){var e,t,r;if(e=ze,t=[],(r=dt())===p&&(r=yt())===p&&(r=At()),r!==p)for(;r!==p;)t.push(r),(r=dt())===p&&(r=yt())===p&&(r=At());else t=p;return t!==p&&(He=e,t=i(t)),e=t}function ot(){var e,t,r,n,u;if(Xe++,t=[],n=r=e=ze,Xe++,(u=ht())===p&&(y.test(f.charAt(ze))?(u=f.charAt(ze),ze++):(u=p,0===Xe&&tt(A))),Xe--,(r=(n=u===p?void 0:(ze=n,p))!==p?(f.length>ze?(u=f.charAt(ze),ze++):(u=p,0===Xe&&tt(b)),u!==p?n=[n,u]:(ze=r,p)):(ze=r,p))!==p)for(;r!==p;)t.push(r),n=r=ze,Xe++,(u=ht())===p&&(y.test(f.charAt(ze))?(u=f.charAt(ze),ze++):(u=p,0===Xe&&tt(A))),Xe--,r=(n=u===p?void 0:(ze=n,p))!==p?(f.length>ze?(u=f.charAt(ze),ze++):(u=p,0===Xe&&tt(b)),u!==p?n=[n,u]:(ze=r,p)):(ze=r,p);else t=p;return e=t!==p?f.substring(e,ze):t,Xe--,e===p&&(t=p,0===Xe&&tt(d)),e}function it(){var e,t,r;return Xe++,e=ze,47===f.charCodeAt(ze)?(t=x,ze++):(t=p,0===Xe&&tt(C)),e=t!==p&&(r=ot())!==p?(He=e,t=O(r)):(ze=e,p),Xe--,e===p&&(t=p,0===Xe&&tt(w)),e}function st(){var e,t,r,n;if(Xe++,e=ze,vt()!==p)if((t=ot())!==p){for(r=[],n=it();n!==p;)r.push(n),n=it();e=r!==p?(He=e,_(t,r)):(ze=e,p)}else ze=e,e=p;else ze=e,e=p;return Xe--,e===p&&(p,0===Xe&&tt(F)),e}function ct(){var e,t,r,n;if(e=ze,39===f.charCodeAt(ze)?(t=R,ze++):(t=p,0===Xe&&tt(S)),t!==p){if(r=[],(n=dt())===p&&(B.test(f.charAt(ze))?(n=f.charAt(ze),ze++):(n=p,0===Xe&&tt(Z))),n!==p)for(;n!==p;)r.push(n),(n=dt())===p&&(B.test(f.charAt(ze))?(n=f.charAt(ze),ze++):(n=p,0===Xe&&tt(Z)));else r=p;e=r!==p?(39===f.charCodeAt(ze)?(n=R,ze++):(n=p,0===Xe&&tt(S)),n!==p?t=[t,r,n]:(ze=e,p)):(ze=e,p)}else ze=e,e=p;if(e===p)if(e=[],(t=dt())===p&&(z.test(f.charAt(ze))?(t=f.charAt(ze),ze++):(t=p,0===Xe&&tt(H))),t!==p)for(;t!==p;)e.push(t),(t=dt())===p&&(z.test(f.charAt(ze))?(t=f.charAt(ze),ze++):(t=p,0===Xe&&tt(H)));else e=p;return e}function lt(){var e,t;if(e=[],$.test(f.charAt(ze))?(t=f.charAt(ze),ze++):(t=p,0===Xe&&tt(J)),t!==p)for(;t!==p;)e.push(t),$.test(f.charAt(ze))?(t=f.charAt(ze),ze++):(t=p,0===Xe&&tt(J));else e=p;return e}function ft(){var e,t,r,n,u;return e=ze,e=vt()!==p&&(t=xt())!==p&&vt()!==p?(123===f.charCodeAt(ze)?(r=h,ze++):(r=p,0===Xe&&tt(m)),r!==p&&(n=nt())!==p?(125===f.charCodeAt(ze)?(u=v,ze++):(u=p,0===Xe&&tt(g)),u!==p?(He=e,se(t,n)):(ze=e,p)):(ze=e,p)):(ze=e,p)}function pt(){var e,t,r,n,u;return e=ze,e=vt()!==p&&(t=function(){var e,t,r,n;return t=e=ze,61===f.charCodeAt(ze)?(r=oe,ze++):(r=p,0===Xe&&tt(ie)),(e=(t=r!==p&&(n=gt())!==p?r=[r,n]:(ze=t,p))!==p?f.substring(e,ze):t)===p&&(e=xt()),e}())!==p&&vt()!==p?(123===f.charCodeAt(ze)?(r=h,ze++):(r=p,0===Xe&&tt(m)),r!==p&&(n=nt())!==p?(125===f.charCodeAt(ze)?(u=v,ze++):(u=p,0===Xe&&tt(g)),u!==p?(He=e,ce(t,n)):(ze=e,p)):(ze=e,p)):(ze=e,p)}function ht(){var e;return Xe++,fe.test(f.charAt(ze))?(e=f.charAt(ze),ze++):(e=p,0===Xe&&tt(pe)),Xe--,e===p&&0===Xe&&tt(le),e}function mt(){var e;return Xe++,me.test(f.charAt(ze))?(e=f.charAt(ze),ze++):(e=p,0===Xe&&tt(ve)),Xe--,e===p&&0===Xe&&tt(he),e}function vt(){var e,t,r;for(Xe++,e=ze,t=[],r=ht();r!==p;)t.push(r),r=ht();return e=t!==p?f.substring(e,ze):t,Xe--,e===p&&(t=p,0===Xe&&tt(ge)),e}function gt(){var e,t,r;return Xe++,e=ze,45===f.charCodeAt(ze)?(t=ye,ze++):(t=p,0===Xe&&tt(Ae)),t===p&&(t=null),e=t!==p&&(r=wt())!==p?(He=e,t=be(t,r)):(ze=e,p),Xe--,e===p&&(t=p,0===Xe&&tt(de)),e}function dt(){var e,t;return Xe++,e=ze,f.substr(ze,2)===xe?(t=xe,ze+=2):(t=p,0===Xe&&tt(Ce)),t!==p&&(He=e,t=Oe()),Xe--,(e=t)===p&&(t=p,0===Xe&&tt(we)),e}function yt(){var e,t,r,n,u,a;if(e=ze,39===f.charCodeAt(ze)?(t=R,ze++):(t=p,0===Xe&&tt(S)),t!==p)if(Fe.test(f.charAt(ze))?(r=f.charAt(ze),ze++):(r=p,0===Xe&&tt(_e)),r!==p){for(n=ze,u=[],f.substr(ze,2)===xe?(a=xe,ze+=2):(a=p,0===Xe&&tt(Ce)),a===p&&(B.test(f.charAt(ze))?(a=f.charAt(ze),ze++):(a=p,0===Xe&&tt(Z)));a!==p;)u.push(a),f.substr(ze,2)===xe?(a=xe,ze+=2):(a=p,0===Xe&&tt(Ce)),a===p&&(B.test(f.charAt(ze))?(a=f.charAt(ze),ze++):(a=p,0===Xe&&tt(Z)));e=(n=u!==p?f.substring(n,ze):u)!==p?(39===f.charCodeAt(ze)?(u=R,ze++):(u=p,0===Xe&&tt(S)),u!==p?(He=e,t=Te(r,n)):(ze=e,p)):(ze=e,p)}else ze=e,e=p;else ze=e,e=p;return e}function At(){var e,t;return e=ze,je.test(f.charAt(ze))?(t=f.charAt(ze),ze++):(t=p,0===Xe&&tt(Ee)),e=t!==p?f.substring(e,ze):t}function bt(){var e,t;return Xe++,e=ze,(t=wt())===p&&(t=xt()),e=t!==p?f.substring(e,ze):t,Xe--,e===p&&(t=p,0===Xe&&tt(Me)),e}function wt(){var e,t,r,n,u;if(Xe++,e=ze,48===f.charCodeAt(ze)?(t=Pe,ze++):(t=p,0===Xe&&tt(Ie)),t!==p&&(He=e,t=De()),(e=t)===p){if(t=e=ze,Le.test(f.charAt(ze))?(r=f.charAt(ze),ze++):(r=p,0===Xe&&tt(Ne)),r!==p){for(n=[],Re.test(f.charAt(ze))?(u=f.charAt(ze),ze++):(u=p,0===Xe&&tt(Se));u!==p;)n.push(u),Re.test(f.charAt(ze))?(u=f.charAt(ze),ze++):(u=p,0===Xe&&tt(Se));t=n!==p?r=[r,n]:(ze=t,p)}else ze=t,t=p;t!==p&&(He=e,t=Be(t)),e=t}return Xe--,e===p&&(t=p,0===Xe&&tt(ke)),e}function xt(){var e,t,r,n,u;if(Xe++,t=[],n=r=e=ze,Xe++,(u=ht())===p&&(u=mt()),Xe--,(r=(n=u===p?void 0:(ze=n,p))!==p?(f.length>ze?(u=f.charAt(ze),ze++):(u=p,0===Xe&&tt(b)),u!==p?n=[n,u]:(ze=r,p)):(ze=r,p))!==p)for(;r!==p;)t.push(r),n=r=ze,Xe++,(u=ht())===p&&(u=mt()),Xe--,r=(n=u===p?void 0:(ze=n,p))!==p?(f.length>ze?(u=f.charAt(ze),ze++):(u=p,0===Xe&&tt(b)),u!==p?n=[n,u]:(ze=r,p)):(ze=r,p);else t=p;return e=t!==p?f.substring(e,ze):t,Xe--,e===p&&(t=p,0===Xe&&tt(Ze)),e}function Ct(){return e&&e.captureLocation?{location:Ge()}:{}}if((t=o())!==p&&ze===f.length)return t;throw t!==p&&ze<f.length&&tt({type:"end"}),r=Ue,n=Je<f.length?f.charAt(Je):null,u=Je<f.length?et(Je,Je+1):et(Je,Je),new _t(_t.buildMessage(r,n),r,n,u)},p=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),u=0;for(t=0;t<r;t++)for(var a=arguments[t],o=0,i=a.length;o<i;o++,u++)n[u]=a[o];return n},h=/(^|[^\\])#/g;function u(e,t){var r=f(e,t);return t&&!1===t.normalizeHashtagInPlural||function l(e){e.forEach(function(c){(d(c)||g(c))&&Object.keys(c.options).forEach(function(e){for(var t,r=c.options[e],n=-1,u=void 0,a=0;a<r.value.length;a++){var o=r.value[a];if(v(o)&&h.test(o.value)){n=a,u=o;break}}if(u){var i=u.value.replace(h,"$1{"+c.value+", number}"),s=f(i);(t=r.value).splice.apply(t,p([n,1],s))}l(r.value)})})}(r),r}var i=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),u=0;for(t=0;t<r;t++)for(var a=arguments[t],o=0,i=a.length;o<i;o++,u++)n[u]=a[o];return n};function s(e){return JSON.stringify(e.map(function(e){return e&&"object"==typeof e?function(r){return Object.keys(r).sort().map(function(e){var t;return(t={})[e]=r[e],t})}(e):e}))}var c,l,m,y=function(a,o){return void 0===o&&(o={}),function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=s(t),u=n&&o[n];return u||(u=new((e=a).bind.apply(e,i([void 0],t))),n&&(o[n]=u)),u}},A=(c=function(e,t){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}c(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),b=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),u=0;for(t=0;t<r;t++)for(var a=arguments[t],o=0,i=a.length;o<i;o++,u++)n[u]=a[o];return n},w=/\\#/g,x=(l=Error,A(C,l),C);function C(e,t){var r=l.call(this,e)||this;return r.variableId=t,r}function O(e,t,r,n,u,a){if(1===e.length&&v(e[0]))return[{type:0,value:e[0].value.replace(w,"#")}];for(var o=[],i=0,s=e;i<s.length;i++){var c=s[i];if(v(c))o.push({type:0,value:c.value.replace(w,"#")});else{var l=c.value;if(!(u&&l in u))throw new x('The intl string context variable "'+l+'" was not provided to the string "'+a+'"');var f=u[l];if(c.type!==Ot.argument)if(c.type!==Ot.date)if(c.type!==Ot.time)if(c.type!==Ot.number)if(g(c)){if(!(p=c.options[f]||c.options.other))throw new RangeError('Invalid values for "'+c.value+'": "'+f+'". Options are "'+Object.keys(c.options).join('", "')+'"');o.push.apply(o,O(p.value,t,r,n,u))}else if(d(c)){var p;if(!(p=c.options["="+f])){if(!Intl.PluralRules)throw new x('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n');var h=r.getPluralRules(t,{type:c.pluralType}).select(f-(c.offset||0));p=c.options[h]||c.options.other}if(!p)throw new RangeError('Invalid values for "'+c.value+'": "'+f+'". Options are "'+Object.keys(c.options).join('", "')+'"');o.push.apply(o,O(p.value,t,r,n,u))}else;else{m="string"==typeof c.style?n.number[c.style]:void 0;o.push({type:0,value:r.getNumberFormat(t,m).format(f)})}else{var m="string"==typeof c.style?n.time[c.style]:void 0;o.push({type:0,value:r.getDateTimeFormat(t,m).format(f)})}else{var m="string"==typeof c.style?n.date[c.style]:void 0;o.push({type:0,value:r.getDateTimeFormat(t,m).format(f)})}else f&&"string"!=typeof f&&"number"!=typeof f||(f="string"==typeof f||"number"==typeof f?String(f):""),o.push({type:1,value:f})}}return function(e){return e.length<2?e:e.reduce(function(e,t){var r=e[e.length-1];return r&&0===r.type&&0===t.type?r.value+=t.value:e.push(t),e},[])}(o)}function F(e,t,r,n,u,a){var o=O(e,t,r,n,u,a);return 1===o.length?o[0].value:o.reduce(function(e,t){return e+t.value},"")}var _="@@",T=/@@(.*?)@@/g,j=0;function E(e,t){return e.split(T).filter(Boolean).map(function(e){return null!=t[e]?t[e]:e}).reduce(function(e,t){return e.length&&"string"==typeof t&&"string"==typeof e[e.length-1]?e[e.length-1]+=t:e.push(t),e},[])}var M=/(<([0-9a-zA-Z-_]*?)>(.*?)<\/([0-9a-zA-Z-_]*?)>)|(<[0-9a-zA-Z-_]*?\/>)/,k=Date.now()+"@@",P=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"];function I(e,t,r,n,u,a){var o=O(e,t,r,n,u,a),i={},s=o.reduce(function(e,t){if(0===t.type)return e+t.value;var r=Date.now()+"_"+ ++j;return i[r]=t.value,e+(_+r)+_},"");if(!M.test(s))return E(s,i);if(!u)throw new x("Message has placeholders but no values was given");if("undefined"==typeof DOMParser)throw new x("Cannot format XML message without DOMParser");m||(m=new DOMParser);var c=m.parseFromString('<formatted-message id="'+k+'">'+s+"</formatted-message>","text/html").getElementById(k);if(!c)throw new x("Malformed HTML message "+s);var l=Object.keys(u).filter(function(e){return!!c.getElementsByTagName(e).length});if(!l.length)return E(s,i);var f=l.filter(function(e){return e!==e.toLowerCase()});if(f.length)throw new x("HTML tag must be lowercased but the following tags are not: "+f.join(", "));return Array.prototype.slice.call(c.childNodes).reduce(function(e,t){return e.concat(function r(e,n,u){var t=e.tagName,a=e.outerHTML,o=e.textContent,i=e.childNodes;if(!t)return E(o||"",n);t=t.toLowerCase();var s=~P.indexOf(t),c=u[t];if(c&&s)throw new x(t+" is a self-closing tag and can not be used, please use another tag name.");if(!i.length)return[a];var l=Array.prototype.slice.call(i).reduce(function(e,t){return e.concat(r(t,n,u))},[]);return c?"function"==typeof c?[c.apply(void 0,l)]:[c]:b(["<"+t+">"],l,["</"+t+">"])}(t,i,u))},[])}var D=function(){return(D=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var u in t=arguments[r])Object.prototype.hasOwnProperty.call(t,u)&&(e[u]=t[u]);return e}).apply(this,arguments)},L=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),u=0;for(t=0;t<r;t++)for(var a=arguments[t],o=0,i=a.length;o<i;o++,u++)n[u]=a[o];return n};function N(r,n){return n?Object.keys(r).reduce(function(e,t){return e[t]=function(r,n){return n?D(D(D({},r||{}),n||{}),Object.keys(r).reduce(function(e,t){return e[t]=D(D({},r[t]),n[t]||{}),e},{})):r}(r[t],n[t]),e},D({},r)):r}function R(e){return void 0===e&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:y(Intl.NumberFormat,e.number),getDateTimeFormat:y(Intl.DateTimeFormat,e.dateTime),getPluralRules:y(Intl.PluralRules,e.pluralRules)}}var S=(B.defaultLocale="en",B.__parse=u,B.formats={number:{currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},B);function B(e,t,r,n){var u=this;if(void 0===t&&(t=B.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){return F(u.ast,u.locale,u.formatters,u.formats,e,u.message)},this.formatToParts=function(e){return O(u.ast,u.locale,u.formatters,u.formats,e,u.message)},this.formatHTMLMessage=function(e){return I(u.ast,u.locale,u.formatters,u.formats,e,u.message)},this.resolvedOptions=function(){return{locale:u.locale}},this.getAst=function(){return u.ast},"string"==typeof e){if(this.message=e,!B.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");this.ast=B.__parse(e)}else this.ast=e;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=N(B.formats,r),this.locale=function(e){try{return L(Intl.NumberFormat.supportedLocalesOf(e,{localeMatcher:"best fit"}),Intl.DateTimeFormat.supportedLocalesOf(e,{localeMatcher:"best fit"}),Intl.PluralRules.supportedLocalesOf(e,{localeMatcher:"best fit"}))[0]}catch(e){return S.defaultLocale}}(t||[]),this.formatters=n&&n.formatters||R(this.formatterCache)}e.IntlMessageFormat=S,e.createDefaultFormatters=R,e.default=S,e.formatHTMLMessage=I,e.formatToParts=O,e.formatToString=F,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).IntlMessageFormat={})}(this,function(e){"use strict";var Ft,t;function d(e){return e.type===Ft.literal}function y(e){return e.type===Ft.select}function A(e){return e.type===Ft.plural}(t=Ft||(Ft={}))[t.literal=0]="literal",t[t.argument=1]="argument",t[t.number=2]="number",t[t.date=3]="date",t[t.time=4]="time",t[t.select=5]="select",t[t.plural=6]="plural";var n,u,r=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Ot=function(){return(Ot=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},_t=(u=Error,r(o,u),o.buildMessage=function(e,t){function r(e){return e.charCodeAt(0).toString(16).toUpperCase()}function n(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+r(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+r(e)})}function a(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+r(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+r(e)})}function u(e){switch(e.type){case"literal":return'"'+n(e.text)+'"';case"class":var t=e.parts.map(function(e){return Array.isArray(e)?a(e[0])+"-"+a(e[1]):a(e)});return"["+(e.inverted?"^":"")+t+"]";case"any":return"any character";case"end":return"end of input";case"other":return e.description}}return"Expected "+function(e){var t,r,n=e.map(u);if(n.sort(),0<n.length){for(r=t=1;t<n.length;t++)n[t-1]!==n[t]&&(n[r]=n[t],r++);n.length=r}switch(n.length){case 1:return n[0];case 2:return n[0]+" or "+n[1];default:return n.slice(0,-1).join(", ")+", or "+n[n.length-1]}}(e)+" but "+((o=t)?'"'+n(o)+'"':"end of input")+" found.";var o},o);function o(e,t,r,n){var a=u.call(this)||this;return a.message=e,a.expected=t,a.found=r,a.location=n,a.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(a,o),a}var f=function(f,e){e=void 0!==e?e:{};var t,r,n,a,p={},u={start:rt},o=rt,i=function(e){return e.join("")},s=function(e){return Ot({type:Ft.literal,value:e},Ct())},l=We("argumentElement"),h="{",m=Qe("{",!1),v="}",g=Qe("}",!1),c=function(e){return Ot({type:Ft.argument,value:e},Ct())},d=We("numberSkeletonId"),y=/^['\/{}]/,A=Ve(["'","/","{","}"],!1,!1),b={type:"any"},w=We("numberSkeletonTokenOption"),x="/",C=Qe("/",!1),F=function(e){return e},O=We("numberSkeletonToken"),_=function(e,t){return{stem:e,options:t}},T=function(e){return Ot({type:0,tokens:e},Ct())},j="::",E=Qe("::",!1),M=function(e){return e},P=function(e){return e.replace(/\s*$/,"")},k=",",I=Qe(",",!1),N="number",D=Qe("number",!1),L=function(e,t,r){return Ot({type:"number"===t?Ft.number:"date"===t?Ft.date:Ft.time,style:r&&r[2],value:e},Ct())},R="'",S=Qe("'",!1),B=/^[^']/,z=Ve(["'"],!0,!1),Z=/^[^a-zA-Z'{}]/,H=Ve([["a","z"],["A","Z"],"'","{","}"],!0,!1),$=/^[a-zA-Z]/,J=Ve([["a","z"],["A","Z"]],!1,!1),U=function(e){return Ot({type:1,pattern:e},Ct())},X="date",q=Qe("date",!1),G="time",K=Qe("time",!1),Q="plural",V=Qe("plural",!1),W="selectordinal",Y=Qe("selectordinal",!1),ee="offset:",te=Qe("offset:",!1),re=function(e,t,r,n){return Ot({type:Ft.plural,pluralType:"plural"===t?"cardinal":"ordinal",value:e,offset:r?r[2]:0,options:n.reduce(function(e,t){var r=t.id,n=t.value,a=t.location;return r in e&&Ke('Duplicate option "'+r+'" in plural element: "'+qe()+'"',Ge()),e[r]={value:n,location:a},e},{})},Ct())},ne="select",ae=Qe("select",!1),ue=function(e,t){return Ot({type:Ft.select,value:e,options:t.reduce(function(e,t){var r=t.id,n=t.value,a=t.location;return r in e&&Ke('Duplicate option "'+r+'" in select element: "'+qe()+'"',Ge()),e[r]={value:n,location:a},e},{})},Ct())},oe="=",ie=Qe("=",!1),se=function(e,t){return Ot({id:e,value:t},Ct())},le=function(e,t){return Ot({id:e,value:t},Ct())},ce=We("whitespace pattern"),fe=/^[\t-\r \x85\u200E\u200F\u2028\u2029]/,pe=Ve([["\t","\r"]," ","…","‎","‏","\u2028","\u2029"],!1,!1),he=We("syntax pattern"),me=/^[!-\/:-@[-\^`{-~\xA1-\xA7\xA9\xAB\xAC\xAE\xB0\xB1\xB6\xBB\xBF\xD7\xF7\u2010-\u2027\u2030-\u203E\u2041-\u2053\u2055-\u205E\u2190-\u245F\u2500-\u2775\u2794-\u2BFF\u2E00-\u2E7F\u3001-\u3003\u3008-\u3020\u3030\uFD3E\uFD3F\uFE45\uFE46]/,ve=Ve([["!","/"],[":","@"],["[","^"],"`",["{","~"],["¡","§"],"©","«","¬","®","°","±","¶","»","¿","×","÷",["‐","‧"],["‰","‾"],["⁁","⁓"],["⁕","⁞"],["←","⑟"],["─","❵"],["➔","⯿"],["⸀","⹿"],["、","〃"],["〈","〠"],"〰","﴾","﴿","﹅","﹆"],!1,!1),ge=We("optional whitespace"),de=We("number"),ye="-",Ae=Qe("-",!1),be=function(e,t){return t?e?-t:t:0},we=We("double apostrophes"),xe="''",Ce=Qe("''",!1),Fe=function(){return"'"},Oe=/^[{}]/,_e=Ve(["{","}"],!1,!1),Te=function(e,t){return e+t.replace("''","'")},je=/^[^{}]/,Ee=Ve(["{","}"],!0,!1),Me=We("argNameOrNumber"),Pe=We("argNumber"),ke="0",Ie=Qe("0",!1),Ne=function(){return 0},De=/^[1-9]/,Le=Ve([["1","9"]],!1,!1),Re=/^[0-9]/,Se=Ve([["0","9"]],!1,!1),Be=function(e){return parseInt(e.join(""),10)},ze=We("argName"),Ze=0,He=0,$e=[{line:1,column:1}],Je=0,Ue=[],Xe=0;if(void 0!==e.startRule){if(!(e.startRule in u))throw new Error("Can't start parsing from rule \""+e.startRule+'".');o=u[e.startRule]}function qe(){return f.substring(He,Ze)}function Ge(){return et(He,Ze)}function Ke(e,t){throw function(e,t){return new _t(e,[],"",t)}(e,t=void 0!==t?t:et(He,Ze))}function Qe(e,t){return{type:"literal",text:e,ignoreCase:t}}function Ve(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function We(e){return{type:"other",description:e}}function Ye(e){var t,r=$e[e];if(r)return r;for(t=e-1;!$e[t];)t--;for(r={line:(r=$e[t]).line,column:r.column};t<e;)10===f.charCodeAt(t)?(r.line++,r.column=1):r.column++,t++;return $e[e]=r}function et(e,t){var r=Ye(e),n=Ye(t);return{start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:n.line,column:n.column}}}function tt(e){Ze<Je||(Je<Ze&&(Je=Ze,Ue=[]),Ue.push(e))}function rt(){return nt()}function nt(){var e,t;for(e=[],t=at();t!==p;)e.push(t),t=at();return e}function at(){var e;return(e=function(){var e,t;e=Ze,(t=ut())!==p&&(He=e,t=s(t));return e=t}())===p&&(e=function(){var e,t,r,n,a;Xe++,e=Ze,123===f.charCodeAt(Ze)?(t=h,Ze++):(t=p,0===Xe&&tt(m));e=t!==p?(r=vt(),r!==p?(n=bt())!==p?vt()!==p?(125===f.charCodeAt(Ze)?(a=v,Ze++):(a=p,0===Xe&&tt(g)),a!==p?(He=e,t=c(n)):(Ze=e,p)):(Ze=e,p):(Ze=e,p):(Ze=e,p)):(Ze=e,p);Xe--,e===p&&(t=p,0===Xe&&tt(l));return e}())===p&&(e=function(){var e;(e=function(){var e,t,r,n,a,u,o,i,s,l;e=Ze,123===f.charCodeAt(Ze)?(t=h,Ze++):(t=p,0===Xe&&tt(m));e=t!==p?(r=vt(),r!==p?(n=bt())!==p?vt()!==p?(44===f.charCodeAt(Ze)?(a=k,Ze++):(a=p,0===Xe&&tt(I)),a!==p?vt()!==p?(f.substr(Ze,6)===N?(u=N,Ze+=6):(u=p,0===Xe&&tt(D)),u!==p?vt()!==p?(o=Ze,44===f.charCodeAt(Ze)?(i=k,Ze++):(i=p,0===Xe&&tt(I)),(o=i!==p?(s=vt())!==p?(l=function(){var e,t,r;e=Ze,f.substr(Ze,2)===j?(t=j,Ze+=2):(t=p,0===Xe&&tt(E));e=t!==p?(r=function(){var e,t,r;if(e=Ze,t=[],(r=st())!==p)for(;r!==p;)t.push(r),r=st();else t=p;t!==p&&(He=e,t=T(t));return e=t}(),r!==p?(He=e,t=M(r)):(Ze=e,p)):(Ze=e,p);e===p&&(e=Ze,(t=ut())!==p&&(He=e,t=P(t)),e=t);return e}())!==p?i=[i,s,l]:(Ze=o,p):(Ze=o,p):(Ze=o,p))===p&&(o=null),o!==p?(i=vt())!==p?(125===f.charCodeAt(Ze)?(s=v,Ze++):(s=p,0===Xe&&tt(g)),s!==p?(He=e,t=L(n,u,o)):(Ze=e,p)):(Ze=e,p):(Ze=e,p)):(Ze=e,p):(Ze=e,p)):(Ze=e,p):(Ze=e,p)):(Ze=e,p):(Ze=e,p):(Ze=e,p)):(Ze=e,p);return e}())===p&&(e=function(){var e,t,r,n,a,u,o,i,s,l;e=Ze,123===f.charCodeAt(Ze)?(t=h,Ze++):(t=p,0===Xe&&tt(m));e=t!==p?(r=vt(),r!==p?(n=bt())!==p?vt()!==p?(44===f.charCodeAt(Ze)?(a=k,Ze++):(a=p,0===Xe&&tt(I)),a!==p?vt()!==p?(f.substr(Ze,4)===X?(u=X,Ze+=4):(u=p,0===Xe&&tt(q)),u===p&&(f.substr(Ze,4)===G?(u=G,Ze+=4):(u=p,0===Xe&&tt(K))),u!==p?vt()!==p?(o=Ze,44===f.charCodeAt(Ze)?(i=k,Ze++):(i=p,0===Xe&&tt(I)),(o=i!==p?(s=vt())!==p?(l=function(){var e,t,r;e=Ze,f.substr(Ze,2)===j?(t=j,Ze+=2):(t=p,0===Xe&&tt(E));e=t!==p?(r=function(){var e,t,r,n;t=e=Ze,r=[],(n=lt())===p&&(n=ct());if(n!==p)for(;n!==p;)r.push(n),(n=lt())===p&&(n=ct());else r=p;t=r!==p?f.substring(t,Ze):r;t!==p&&(He=e,t=U(t));return e=t}(),r!==p?(He=e,t=M(r)):(Ze=e,p)):(Ze=e,p);e===p&&(e=Ze,(t=ut())!==p&&(He=e,t=P(t)),e=t);return e}())!==p?i=[i,s,l]:(Ze=o,p):(Ze=o,p):(Ze=o,p))===p&&(o=null),o!==p?(i=vt())!==p?(125===f.charCodeAt(Ze)?(s=v,Ze++):(s=p,0===Xe&&tt(g)),s!==p?(He=e,t=L(n,u,o)):(Ze=e,p)):(Ze=e,p):(Ze=e,p)):(Ze=e,p):(Ze=e,p)):(Ze=e,p):(Ze=e,p)):(Ze=e,p):(Ze=e,p):(Ze=e,p)):(Ze=e,p);return e}());return e}())===p&&(e=function(){var e,t,r,n,a,u,o,i,s,l,c;e=Ze,123===f.charCodeAt(Ze)?(t=h,Ze++):(t=p,0===Xe&&tt(m));if(t!==p)if(vt()!==p)if((r=bt())!==p)if(vt()!==p)if(44===f.charCodeAt(Ze)?(n=k,Ze++):(n=p,0===Xe&&tt(I)),n!==p)if(vt()!==p)if(f.substr(Ze,6)===Q?(a=Q,Ze+=6):(a=p,0===Xe&&tt(V)),a===p&&(f.substr(Ze,13)===W?(a=W,Ze+=13):(a=p,0===Xe&&tt(Y))),a!==p)if(vt()!==p)if(44===f.charCodeAt(Ze)?(u=k,Ze++):(u=p,0===Xe&&tt(I)),u!==p)if(vt()!==p)if(o=Ze,f.substr(Ze,7)===ee?(i=ee,Ze+=7):(i=p,0===Xe&&tt(te)),(o=i!==p?(s=vt())!==p?(l=gt())!==p?i=[i,s,l]:(Ze=o,p):(Ze=o,p):(Ze=o,p))===p&&(o=null),o!==p)if((i=vt())!==p){if(s=[],(l=pt())!==p)for(;l!==p;)s.push(l),l=pt();else s=p;e=s!==p?(l=vt())!==p?(125===f.charCodeAt(Ze)?(c=v,Ze++):(c=p,0===Xe&&tt(g)),c!==p?(He=e,t=re(r,a,o,s)):(Ze=e,p)):(Ze=e,p):(Ze=e,p)}else Ze=e,e=p;else Ze=e,e=p;else Ze=e,e=p;else Ze=e,e=p;else Ze=e,e=p;else Ze=e,e=p;else Ze=e,e=p;else Ze=e,e=p;else Ze=e,e=p;else Ze=e,e=p;else Ze=e,e=p;else Ze=e,e=p;return e}())===p&&(e=function(){var e,t,r,n,a,u,o,i,s;e=Ze,123===f.charCodeAt(Ze)?(t=h,Ze++):(t=p,0===Xe&&tt(m));if(t!==p)if(vt()!==p)if((r=bt())!==p)if(vt()!==p)if(44===f.charCodeAt(Ze)?(n=k,Ze++):(n=p,0===Xe&&tt(I)),n!==p)if(vt()!==p)if(f.substr(Ze,6)===ne?(a=ne,Ze+=6):(a=p,0===Xe&&tt(ae)),a!==p)if(vt()!==p)if(44===f.charCodeAt(Ze)?(u=k,Ze++):(u=p,0===Xe&&tt(I)),u!==p)if(vt()!==p){if(o=[],(i=ft())!==p)for(;i!==p;)o.push(i),i=ft();else o=p;e=o!==p?(i=vt())!==p?(125===f.charCodeAt(Ze)?(s=v,Ze++):(s=p,0===Xe&&tt(g)),s!==p?(He=e,t=ue(r,o)):(Ze=e,p)):(Ze=e,p):(Ze=e,p)}else Ze=e,e=p;else Ze=e,e=p;else Ze=e,e=p;else Ze=e,e=p;else Ze=e,e=p;else Ze=e,e=p;else Ze=e,e=p;else Ze=e,e=p;else Ze=e,e=p;else Ze=e,e=p;return e}()),e}function ut(){var e,t,r;if(e=Ze,t=[],(r=dt())===p&&(r=yt())===p&&(r=At()),r!==p)for(;r!==p;)t.push(r),(r=dt())===p&&(r=yt())===p&&(r=At());else t=p;return t!==p&&(He=e,t=i(t)),e=t}function ot(){var e,t,r,n,a;if(Xe++,t=[],n=r=e=Ze,Xe++,(a=ht())===p&&(y.test(f.charAt(Ze))?(a=f.charAt(Ze),Ze++):(a=p,0===Xe&&tt(A))),Xe--,(r=(n=a===p?void 0:(Ze=n,p))!==p?(f.length>Ze?(a=f.charAt(Ze),Ze++):(a=p,0===Xe&&tt(b)),a!==p?n=[n,a]:(Ze=r,p)):(Ze=r,p))!==p)for(;r!==p;)t.push(r),n=r=Ze,Xe++,(a=ht())===p&&(y.test(f.charAt(Ze))?(a=f.charAt(Ze),Ze++):(a=p,0===Xe&&tt(A))),Xe--,r=(n=a===p?void 0:(Ze=n,p))!==p?(f.length>Ze?(a=f.charAt(Ze),Ze++):(a=p,0===Xe&&tt(b)),a!==p?n=[n,a]:(Ze=r,p)):(Ze=r,p);else t=p;return e=t!==p?f.substring(e,Ze):t,Xe--,e===p&&(t=p,0===Xe&&tt(d)),e}function it(){var e,t,r;return Xe++,e=Ze,47===f.charCodeAt(Ze)?(t=x,Ze++):(t=p,0===Xe&&tt(C)),e=t!==p&&(r=ot())!==p?(He=e,t=F(r)):(Ze=e,p),Xe--,e===p&&(t=p,0===Xe&&tt(w)),e}function st(){var e,t,r,n;if(Xe++,e=Ze,vt()!==p)if((t=ot())!==p){for(r=[],n=it();n!==p;)r.push(n),n=it();e=r!==p?(He=e,_(t,r)):(Ze=e,p)}else Ze=e,e=p;else Ze=e,e=p;return Xe--,e===p&&(p,0===Xe&&tt(O)),e}function lt(){var e,t,r,n;if(e=Ze,39===f.charCodeAt(Ze)?(t=R,Ze++):(t=p,0===Xe&&tt(S)),t!==p){if(r=[],(n=dt())===p&&(B.test(f.charAt(Ze))?(n=f.charAt(Ze),Ze++):(n=p,0===Xe&&tt(z))),n!==p)for(;n!==p;)r.push(n),(n=dt())===p&&(B.test(f.charAt(Ze))?(n=f.charAt(Ze),Ze++):(n=p,0===Xe&&tt(z)));else r=p;e=r!==p?(39===f.charCodeAt(Ze)?(n=R,Ze++):(n=p,0===Xe&&tt(S)),n!==p?t=[t,r,n]:(Ze=e,p)):(Ze=e,p)}else Ze=e,e=p;if(e===p)if(e=[],(t=dt())===p&&(Z.test(f.charAt(Ze))?(t=f.charAt(Ze),Ze++):(t=p,0===Xe&&tt(H))),t!==p)for(;t!==p;)e.push(t),(t=dt())===p&&(Z.test(f.charAt(Ze))?(t=f.charAt(Ze),Ze++):(t=p,0===Xe&&tt(H)));else e=p;return e}function ct(){var e,t;if(e=[],$.test(f.charAt(Ze))?(t=f.charAt(Ze),Ze++):(t=p,0===Xe&&tt(J)),t!==p)for(;t!==p;)e.push(t),$.test(f.charAt(Ze))?(t=f.charAt(Ze),Ze++):(t=p,0===Xe&&tt(J));else e=p;return e}function ft(){var e,t,r,n,a;return e=Ze,e=vt()!==p&&(t=xt())!==p&&vt()!==p?(123===f.charCodeAt(Ze)?(r=h,Ze++):(r=p,0===Xe&&tt(m)),r!==p&&(n=nt())!==p?(125===f.charCodeAt(Ze)?(a=v,Ze++):(a=p,0===Xe&&tt(g)),a!==p?(He=e,se(t,n)):(Ze=e,p)):(Ze=e,p)):(Ze=e,p)}function pt(){var e,t,r,n,a;return e=Ze,e=vt()!==p&&(t=function(){var e,t,r,n;return t=e=Ze,61===f.charCodeAt(Ze)?(r=oe,Ze++):(r=p,0===Xe&&tt(ie)),(e=(t=r!==p&&(n=gt())!==p?r=[r,n]:(Ze=t,p))!==p?f.substring(e,Ze):t)===p&&(e=xt()),e}())!==p&&vt()!==p?(123===f.charCodeAt(Ze)?(r=h,Ze++):(r=p,0===Xe&&tt(m)),r!==p&&(n=nt())!==p?(125===f.charCodeAt(Ze)?(a=v,Ze++):(a=p,0===Xe&&tt(g)),a!==p?(He=e,le(t,n)):(Ze=e,p)):(Ze=e,p)):(Ze=e,p)}function ht(){var e;return Xe++,fe.test(f.charAt(Ze))?(e=f.charAt(Ze),Ze++):(e=p,0===Xe&&tt(pe)),Xe--,e===p&&0===Xe&&tt(ce),e}function mt(){var e;return Xe++,me.test(f.charAt(Ze))?(e=f.charAt(Ze),Ze++):(e=p,0===Xe&&tt(ve)),Xe--,e===p&&0===Xe&&tt(he),e}function vt(){var e,t,r;for(Xe++,e=Ze,t=[],r=ht();r!==p;)t.push(r),r=ht();return e=t!==p?f.substring(e,Ze):t,Xe--,e===p&&(t=p,0===Xe&&tt(ge)),e}function gt(){var e,t,r;return Xe++,e=Ze,45===f.charCodeAt(Ze)?(t=ye,Ze++):(t=p,0===Xe&&tt(Ae)),t===p&&(t=null),e=t!==p&&(r=wt())!==p?(He=e,t=be(t,r)):(Ze=e,p),Xe--,e===p&&(t=p,0===Xe&&tt(de)),e}function dt(){var e,t;return Xe++,e=Ze,f.substr(Ze,2)===xe?(t=xe,Ze+=2):(t=p,0===Xe&&tt(Ce)),t!==p&&(He=e,t=Fe()),Xe--,(e=t)===p&&(t=p,0===Xe&&tt(we)),e}function yt(){var e,t,r,n,a,u;if(e=Ze,39===f.charCodeAt(Ze)?(t=R,Ze++):(t=p,0===Xe&&tt(S)),t!==p)if(Oe.test(f.charAt(Ze))?(r=f.charAt(Ze),Ze++):(r=p,0===Xe&&tt(_e)),r!==p){for(n=Ze,a=[],f.substr(Ze,2)===xe?(u=xe,Ze+=2):(u=p,0===Xe&&tt(Ce)),u===p&&(B.test(f.charAt(Ze))?(u=f.charAt(Ze),Ze++):(u=p,0===Xe&&tt(z)));u!==p;)a.push(u),f.substr(Ze,2)===xe?(u=xe,Ze+=2):(u=p,0===Xe&&tt(Ce)),u===p&&(B.test(f.charAt(Ze))?(u=f.charAt(Ze),Ze++):(u=p,0===Xe&&tt(z)));e=(n=a!==p?f.substring(n,Ze):a)!==p?(39===f.charCodeAt(Ze)?(a=R,Ze++):(a=p,0===Xe&&tt(S)),a!==p?(He=e,t=Te(r,n)):(Ze=e,p)):(Ze=e,p)}else Ze=e,e=p;else Ze=e,e=p;return e}function At(){var e,t;return e=Ze,je.test(f.charAt(Ze))?(t=f.charAt(Ze),Ze++):(t=p,0===Xe&&tt(Ee)),e=t!==p?f.substring(e,Ze):t}function bt(){var e,t;return Xe++,e=Ze,(t=wt())===p&&(t=xt()),e=t!==p?f.substring(e,Ze):t,Xe--,e===p&&(t=p,0===Xe&&tt(Me)),e}function wt(){var e,t,r,n,a;if(Xe++,e=Ze,48===f.charCodeAt(Ze)?(t=ke,Ze++):(t=p,0===Xe&&tt(Ie)),t!==p&&(He=e,t=Ne()),(e=t)===p){if(t=e=Ze,De.test(f.charAt(Ze))?(r=f.charAt(Ze),Ze++):(r=p,0===Xe&&tt(Le)),r!==p){for(n=[],Re.test(f.charAt(Ze))?(a=f.charAt(Ze),Ze++):(a=p,0===Xe&&tt(Se));a!==p;)n.push(a),Re.test(f.charAt(Ze))?(a=f.charAt(Ze),Ze++):(a=p,0===Xe&&tt(Se));t=n!==p?r=[r,n]:(Ze=t,p)}else Ze=t,t=p;t!==p&&(He=e,t=Be(t)),e=t}return Xe--,e===p&&(t=p,0===Xe&&tt(Pe)),e}function xt(){var e,t,r,n,a;if(Xe++,t=[],n=r=e=Ze,Xe++,(a=ht())===p&&(a=mt()),Xe--,(r=(n=a===p?void 0:(Ze=n,p))!==p?(f.length>Ze?(a=f.charAt(Ze),Ze++):(a=p,0===Xe&&tt(b)),a!==p?n=[n,a]:(Ze=r,p)):(Ze=r,p))!==p)for(;r!==p;)t.push(r),n=r=Ze,Xe++,(a=ht())===p&&(a=mt()),Xe--,r=(n=a===p?void 0:(Ze=n,p))!==p?(f.length>Ze?(a=f.charAt(Ze),Ze++):(a=p,0===Xe&&tt(b)),a!==p?n=[n,a]:(Ze=r,p)):(Ze=r,p);else t=p;return e=t!==p?f.substring(e,Ze):t,Xe--,e===p&&(t=p,0===Xe&&tt(ze)),e}function Ct(){return e&&e.captureLocation?{location:Ge()}:{}}if((t=o())!==p&&Ze===f.length)return t;throw t!==p&&Ze<f.length&&tt({type:"end"}),r=Ue,n=Je<f.length?f.charAt(Je):null,a=Je<f.length?et(Je,Je+1):et(Je,Je),new _t(_t.buildMessage(r,n),r,n,a)},p=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),a=0;for(t=0;t<r;t++)for(var u=arguments[t],o=0,i=u.length;o<i;o++,a++)n[a]=u[o];return n},h=/(^|[^\\])#/g;function a(e,t){var r=f(e,t);return t&&!1===t.normalizeHashtagInPlural||function c(e){e.forEach(function(l){(A(l)||y(l))&&Object.keys(l.options).forEach(function(e){for(var t,r=l.options[e],n=-1,a=void 0,u=0;u<r.value.length;u++){var o=r.value[u];if(d(o)&&h.test(o.value)){n=u,a=o;break}}if(a){var i=a.value.replace(h,"$1{"+l.value+", number}"),s=f(i);(t=r.value).splice.apply(t,p([n,1],s))}c(r.value)})})}(r),r}var i=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),a=0;for(t=0;t<r;t++)for(var u=arguments[t],o=0,i=u.length;o<i;o++,a++)n[a]=u[o];return n};function s(e){return JSON.stringify(e.map(function(e){return e&&"object"==typeof e?function(r){return Object.keys(r).sort().map(function(e){var t;return(t={})[e]=r[e],t})}(e):e}))}var l,c,m,v=function(u,o){return void 0===o&&(o={}),function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=s(t),a=n&&o[n];return a||(a=new((e=u).bind.apply(e,i([void 0],t))),n&&(o[n]=a)),a}},g=(l=function(e,t){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),b=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),a=0;for(t=0;t<r;t++)for(var u=arguments[t],o=0,i=u.length;o<i;o++,a++)n[a]=u[o];return n},w=/\\#/g,x=/(^|[^\\])#/g,C=(c=Error,g(F,c),F);function F(e,t){var r=c.call(this,e)||this;return r.variableId=t,r}function O(e,t,r,n,a,u,o){if(1===e.length&&d(e[0])){var i=e[0].value;return"number"==typeof u&&(i=i.replace(x,"$1"+r.getNumberFormat(t).format(u))),[{type:0,value:i.replace(w,"#")}]}for(var s=[],l=0,c=e;l<c.length;l++){var f=c[l];if(d(f)){var p=f.value;"number"==typeof u&&(p=p.replace(x,"$1"+r.getNumberFormat(t).format(u))),s.push({type:0,value:p.replace(w,"#")})}else{var h=f.value;if(!(a&&h in a))throw new C('The intl string context variable "'+h+'" was not provided to the string "'+o+'"');i=a[h];if(f.type!==Ft.argument)if(f.type!==Ft.date)if(f.type!==Ft.time)if(f.type!==Ft.number)if(y(f)){if(!(m=f.options[i]||f.options.other))throw new RangeError('Invalid values for "'+f.value+'": "'+i+'". Options are "'+Object.keys(f.options).join('", "')+'"');s.push.apply(s,O(m.value,t,r,n,a))}else if(A(f)){var m;if(!(m=f.options["="+i])){if(!Intl.PluralRules)throw new C('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n');var v=r.getPluralRules(t,{type:f.pluralType}).select(i-(f.offset||0));m=f.options[v]||f.options.other}if(!m)throw new RangeError('Invalid values for "'+f.value+'": "'+i+'". Options are "'+Object.keys(f.options).join('", "')+'"');s.push.apply(s,O(m.value,t,r,n,a,i-(f.offset||0)))}else;else{g="string"==typeof f.style?n.number[f.style]:void 0;s.push({type:0,value:r.getNumberFormat(t,g).format(i)})}else{var g="string"==typeof f.style?n.time[f.style]:void 0;s.push({type:0,value:r.getDateTimeFormat(t,g).format(i)})}else{var g="string"==typeof f.style?n.date[f.style]:void 0;s.push({type:0,value:r.getDateTimeFormat(t,g).format(i)})}else i&&"string"!=typeof i&&"number"!=typeof i||(i="string"==typeof i||"number"==typeof i?String(i):""),s.push({type:1,value:i})}}return function(e){return e.length<2?e:e.reduce(function(e,t){var r=e[e.length-1];return r&&0===r.type&&0===t.type?r.value+=t.value:e.push(t),e},[])}(s)}function _(e,t,r,n,a,u){var o=O(e,t,r,n,a,void 0,u);return 1===o.length?o[0].value:o.reduce(function(e,t){return e+t.value},"")}var T="@@",j=/@@(\d+_\d+)@@/g,E=0;function M(e,t){return e.split(j).filter(Boolean).map(function(e){return null!=t[e]?t[e]:e}).reduce(function(e,t){return e.length&&"string"==typeof t&&"string"==typeof e[e.length-1]?e[e.length-1]+=t:e.push(t),e},[])}var P=/(<([0-9a-zA-Z-_]*?)>(.*?)<\/([0-9a-zA-Z-_]*?)>)|(<[0-9a-zA-Z-_]*?\/>)/,k=Date.now()+"@@",I=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"];function N(e,t,r,n,a,u){var o=O(e,t,r,n,a,void 0,u),i={},s=o.reduce(function(e,t){if(0===t.type)return e+t.value;var r=Date.now()+"_"+ ++E;return i[r]=t.value,e+(T+r)+T},"");if(!P.test(s))return M(s,i);if(!a)throw new C("Message has placeholders but no values was given");if("undefined"==typeof DOMParser)throw new C("Cannot format XML message without DOMParser");m||(m=new DOMParser);var l=m.parseFromString('<formatted-message id="'+k+'">'+s+"</formatted-message>","text/html").getElementById(k);if(!l)throw new C("Malformed HTML message "+s);var c=Object.keys(a).filter(function(e){return!!l.getElementsByTagName(e).length});if(!c.length)return M(s,i);var f=c.filter(function(e){return e!==e.toLowerCase()});if(f.length)throw new C("HTML tag must be lowercased but the following tags are not: "+f.join(", "));return Array.prototype.slice.call(l.childNodes).reduce(function(e,t){return e.concat(function r(e,n,a){var t=e.tagName,u=e.outerHTML,o=e.textContent,i=e.childNodes;if(!t)return M(o||"",n);t=t.toLowerCase();var s=~I.indexOf(t),l=a[t];if(l&&s)throw new C(t+" is a self-closing tag and can not be used, please use another tag name.");if(!i.length)return[u];var c=Array.prototype.slice.call(i).reduce(function(e,t){return e.concat(r(t,n,a))},[]);return l?"function"==typeof l?[l.apply(void 0,c)]:[l]:b(["<"+t+">"],c,["</"+t+">"])}(t,i,a))},[])}var D=function(){return(D=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},L=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),a=0;for(t=0;t<r;t++)for(var u=arguments[t],o=0,i=u.length;o<i;o++,a++)n[a]=u[o];return n};function R(r,n){return n?Object.keys(r).reduce(function(e,t){return e[t]=function(r,n){return n?D(D(D({},r||{}),n||{}),Object.keys(r).reduce(function(e,t){return e[t]=D(D({},r[t]),n[t]||{}),e},{})):r}(r[t],n[t]),e},D({},r)):r}function S(e){return void 0===e&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:v(Intl.NumberFormat,e.number),getDateTimeFormat:v(Intl.DateTimeFormat,e.dateTime),getPluralRules:v(Intl.PluralRules,e.pluralRules)}}var B=(z.defaultLocale="en",z.__parse=a,z.formats={number:{currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},z);function z(e,t,r,n){var a=this;if(void 0===t&&(t=z.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){return _(a.ast,a.locale,a.formatters,a.formats,e,a.message)},this.formatToParts=function(e){return O(a.ast,a.locale,a.formatters,a.formats,e,void 0,a.message)},this.formatHTMLMessage=function(e){return N(a.ast,a.locale,a.formatters,a.formats,e,a.message)},this.resolvedOptions=function(){return{locale:a.locale}},this.getAst=function(){return a.ast},"string"==typeof e){if(this.message=e,!z.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");this.ast=z.__parse(e,{normalizeHashtagInPlural:!1})}else this.ast=e;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=R(z.formats,r),this.locale=function(e){try{return L(Intl.NumberFormat.supportedLocalesOf(e,{localeMatcher:"best fit"}),Intl.DateTimeFormat.supportedLocalesOf(e,{localeMatcher:"best fit"}),Intl.PluralRules.supportedLocalesOf(e,{localeMatcher:"best fit"}))[0]}catch(e){return B.defaultLocale}}(t||[]),this.formatters=n&&n.formatters||S(this.formatterCache)}e.IntlMessageFormat=B,e.createDefaultFormatters=S,e.default=B,e.formatHTMLMessage=N,e.formatToParts=O,e.formatToString=_,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=intl-messageformat.min.js.map

@@ -91,3 +91,3 @@ /*

this.formatToParts = function (values) {
return formatToParts(_this.ast, _this.locale, _this.formatters, _this.formats, values, _this.message);
return formatToParts(_this.ast, _this.locale, _this.formatters, _this.formats, values, undefined, _this.message);
};

@@ -105,3 +105,5 @@ this.formatHTMLMessage = function (values) {

// Parse string messages into an AST.
this.ast = IntlMessageFormat.__parse(message);
this.ast = IntlMessageFormat.__parse(message, {
normalizeHashtagInPlural: false,
});
}

@@ -108,0 +110,0 @@ else {

@@ -31,5 +31,5 @@ import { MessageFormatElement } from 'intl-messageformat-parser';

export declare type PrimitiveType = string | number | boolean | null | undefined | Date;
export declare function formatToParts(els: MessageFormatElement[], locales: string | string[], formatters: Formatters, formats: Formats, values?: Record<string, any>, originalMessage?: string): MessageFormatPart[];
export declare function formatToParts(els: MessageFormatElement[], locales: string | string[], formatters: Formatters, formats: Formats, values?: Record<string, any>, currentPluralValue?: number, originalMessage?: string): MessageFormatPart[];
export declare function formatToString(els: MessageFormatElement[], locales: string | string[], formatters: Formatters, formats: Formats, values?: Record<string, PrimitiveType>, originalMessage?: string): string;
export declare type FormatXMLElementFn = (...args: any[]) => string | object;
export declare function formatHTMLMessage(els: MessageFormatElement[], locales: string | string[], formatters: Formatters, formats: Formats, values?: Record<string, PrimitiveType | object | FormatXMLElementFn>, originalMessage?: string): Array<string | object>;

@@ -23,2 +23,3 @@ var __extends = (this && this.__extends) || (function () {

var ESCAPE_HASH_REGEX = /\\#/g;
var PLURAL_HASH = /(^|[^\\])#/g;
var FormatError = /** @class */ (function (_super) {

@@ -51,3 +52,3 @@ __extends(FormatError, _super);

// TODO(skeleton): add skeleton support
export function formatToParts(els, locales, formatters, formats, values,
export function formatToParts(els, locales, formatters, formats, values, currentPluralValue,
// For debugging

@@ -57,6 +58,10 @@ originalMessage) {

if (els.length === 1 && isLiteralElement(els[0])) {
var value = els[0].value;
if (typeof currentPluralValue === 'number') {
value = value.replace(PLURAL_HASH, '$1' + formatters.getNumberFormat(locales).format(currentPluralValue));
}
return [
{
type: 0 /* literal */,
value: els[0].value.replace(ESCAPE_HASH_REGEX, '#'),
value: value.replace(ESCAPE_HASH_REGEX, '#'),
},

@@ -70,5 +75,9 @@ ];

if (isLiteralElement(el)) {
var value_1 = el.value;
if (typeof currentPluralValue === 'number') {
value_1 = value_1.replace(PLURAL_HASH, '$1' + formatters.getNumberFormat(locales).format(currentPluralValue));
}
result.push({
type: 0 /* literal */,
value: el.value.replace(ESCAPE_HASH_REGEX, '#'),
value: value_1.replace(ESCAPE_HASH_REGEX, '#'),
});

@@ -151,3 +160,3 @@ continue;

}
result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values));
result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values, value - (el.offset || 0)));
continue;

@@ -161,3 +170,3 @@ }

originalMessage) {
var parts = formatToParts(els, locales, formatters, formats, values, originalMessage);
var parts = formatToParts(els, locales, formatters, formats, values, undefined, originalMessage);
// Hot path for straight simple msg translations

@@ -172,3 +181,3 @@ if (parts.length === 1) {

var TOKEN_DELIMITER = '@@';
var TOKEN_REGEX = /@@(.*?)@@/g;
var TOKEN_REGEX = /@@(\d+_\d+)@@/g;
var counter = 0;

@@ -249,3 +258,3 @@ function generateId() {

originalMessage) {
var parts = formatToParts(els, locales, formatters, formats, values, originalMessage);
var parts = formatToParts(els, locales, formatters, formats, values, undefined, originalMessage);
var objectParts = {};

@@ -252,0 +261,0 @@ var formattedMessage = parts.reduce(function (all, part) {

{
"name": "intl-messageformat",
"version": "7.3.2",
"version": "7.3.3",
"description": "Formats ICU Message strings with number, date, plural, and select placeholders to create localized messages.",

@@ -34,7 +34,7 @@ "keywords": [

"dependencies": {
"intl-format-cache": "^4.2.2",
"intl-messageformat-parser": "^3.2.1"
"intl-format-cache": "^4.2.3",
"intl-messageformat-parser": "^3.2.2"
},
"devDependencies": {
"@formatjs/intl-pluralrules": "^1.3.0"
"@formatjs/intl-pluralrules": "^1.3.1"
},

@@ -57,3 +57,3 @@ "sideEffects": false,

"license": "BSD-3-Clause",
"gitHead": "b68be70a01a39456f8de89076178f23820af4e3d"
"gitHead": "cd9ad1f8d260e314b6cdb380a91ce58969b62f97"
}

@@ -24,4 +24,4 @@ # Intl MessageFormat

```js
var msg = new IntlMessageFormat(message, locales, [formats], [opts]);
```tsx
const msg = new IntlMessageFormat(message, locales, [formats], [opts]);
```

@@ -31,4 +31,4 @@

```js
var output = msg.format(values);
```tsx
const output = msg.format(values);
```

@@ -40,4 +40,4 @@

```js
var MESSAGES = {
```tsx
const MESSAGES = {
'en-US': {

@@ -60,9 +60,9 @@ NUM_PHOTOS:

var output;
const output;
var enNumPhotos = new IntlMessageFormat(MESSAGES['en-US'].NUM_PHOTOS, 'en-US');
const enNumPhotos = new IntlMessageFormat(MESSAGES['en-US'].NUM_PHOTOS, 'en-US');
output = enNumPhotos.format({numPhotos: 1000});
console.log(output); // => "You have 1,000 photos."
var esNumPhotos = new IntlMessageFormat(MESSAGES['es-MX'].NUM_PHOTOS, 'es-MX');
const esNumPhotos = new IntlMessageFormat(MESSAGES['es-MX'].NUM_PHOTOS, 'es-MX');
output = esNumPhotos.format({numPhotos: 1000});

@@ -108,8 +108,12 @@ console.log(output); // => "Usted tiene 1,000 fotos."

Simply `require()` this package:
Either do:
```js
var IntlMessageFormat = require('intl-messageformat');
```tsx
import IntlMessageFormat from 'intl-messageformat';
```
```tsx
const IntlMessageFormat = require('intl-messageformat').default;
```
**NOTE: Your Node has to include [full ICU](https://nodejs.org/api/intl.html)**

@@ -132,4 +136,4 @@

```js
var msg = new IntlMessageFormat('My name is {name}.', 'en-US');
```tsx
const msg = new IntlMessageFormat('My name is {name}.', 'en-US');
```

@@ -145,4 +149,4 @@

```js
var msg = new IntlMessageFormat('', 'en-us');
```tsx
const msg = new IntlMessageFormat('', 'en-us');
console.log(msg.resolvedOptions().locale); // => "en-US"

@@ -157,4 +161,4 @@ ```

```js
var output = msg.format({name: 'Eric'});
```tsx
const output = msg.format({name: 'Eric'});
console.log(output); // => "My name is Eric."

@@ -174,3 +178,3 @@ ```

```tsx
var mf = new IntlMessageFormat('hello <b>world</b>', 'en');
const mf = new IntlMessageFormat('hello <b>world</b>', 'en');
mf.formatHTMLMessage({b: str => <span>{str}</span>});

@@ -195,4 +199,4 @@ // returns ['hello ', React element rendered as <span>world</span>]

```js
var msg = new IntlMessageFormat('The price is: {price, number, USD}', 'en-US', {
```tsx
const msg = new IntlMessageFormat('The price is: {price, number, USD}', 'en-US', {
number: {

@@ -206,3 +210,3 @@ USD: {

var output = msg.format({price: 100});
const output = msg.format({price: 100});
console.log(output); // => "The price is: $100.00"

@@ -267,4 +271,4 @@ ```

```js
var MESSAGES = {
```tsx
const MESSAGES = {
photos: '...', // String from code block above.

@@ -274,3 +278,3 @@ ...

var msg = new IntlMessageFormat(MESSAGES.photos, 'en-US');
const msg = new IntlMessageFormat(MESSAGES.photos, 'en-US');

@@ -277,0 +281,0 @@ console.log(msg.format({numPhotos: 0})); // => "You have no photos."

@@ -126,3 +126,5 @@ /*

// Parse string messages into an AST.
this.ast = IntlMessageFormat.__parse(message);
this.ast = IntlMessageFormat.__parse(message, {
normalizeHashtagInPlural: false,
});
} else {

@@ -164,2 +166,3 @@ this.ast = message;

values,
undefined,
this.message

@@ -166,0 +169,0 @@ );

@@ -56,3 +56,3 @@ import {

const ESCAPE_HASH_REGEX = /\\#/g;
const PLURAL_HASH = /(^|[^\\])#/g;
class FormatError extends Error {

@@ -95,2 +95,3 @@ public readonly variableId?: string;

values?: Record<string, any>,
currentPluralValue?: number,
// For debugging

@@ -101,6 +102,13 @@ originalMessage?: string

if (els.length === 1 && isLiteralElement(els[0])) {
let value = els[0].value;
if (typeof currentPluralValue === 'number') {
value = value.replace(
PLURAL_HASH,
'$1' + formatters.getNumberFormat(locales).format(currentPluralValue)
);
}
return [
{
type: PART_TYPE.literal,
value: els[0].value.replace(ESCAPE_HASH_REGEX, '#'),
value: value.replace(ESCAPE_HASH_REGEX, '#'),
},

@@ -113,5 +121,12 @@ ];

if (isLiteralElement(el)) {
let value = el.value;
if (typeof currentPluralValue === 'number') {
value = value.replace(
PLURAL_HASH,
'$1' + formatters.getNumberFormat(locales).format(currentPluralValue)
);
}
result.push({
type: PART_TYPE.literal,
value: el.value.replace(ESCAPE_HASH_REGEX, '#'),
value: value.replace(ESCAPE_HASH_REGEX, '#'),
});

@@ -215,3 +230,10 @@ continue;

result.push(
...formatToParts(opt.value, locales, formatters, formats, values)
...formatToParts(
opt.value,
locales,
formatters,
formats,
values,
value - (el.offset || 0)
)
);

@@ -239,2 +261,3 @@ continue;

values,
undefined,
originalMessage

@@ -254,3 +277,3 @@ );

const TOKEN_DELIMITER = '@@';
const TOKEN_REGEX = /@@(.*?)@@/g;
const TOKEN_REGEX = /@@(\d+_\d+)@@/g;
let counter = 0;

@@ -367,2 +390,3 @@ function generateId() {

values,
undefined,
originalMessage

@@ -369,0 +393,0 @@ );

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc