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.

9 lines 37.1 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactIntl={},e.React)}(this,(function(e,t){"use strict";function r(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var n=r(t);function o(e,t,r){if(void 0===r&&(r=Error),!e)throw new r(t)}var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function r(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},r.exports),r.exports}var u=i((function(e,t){var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.createNumberElement=t.createLiteralElement=t.isDateTimeSkeleton=t.isNumberSkeleton=t.isTagElement=t.isPoundElement=t.isPluralElement=t.isSelectElement=t.isTimeElement=t.isDateElement=t.isNumberElement=t.isArgumentElement=t.isLiteralElement=t.SKELETON_TYPE=t.TYPE=void 0,function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"}(r=t.TYPE||(t.TYPE={})),(n=t.SKELETON_TYPE||(t.SKELETON_TYPE={}))[n.number=0]="number",n[n.dateTime=1]="dateTime",t.isLiteralElement=function o(e){return e.type===r.literal},t.isArgumentElement=function a(e){return e.type===r.argument},t.isNumberElement=function i(e){return e.type===r.number},t.isDateElement=function u(e){return e.type===r.date},t.isTimeElement=function l(e){return e.type===r.time},t.isSelectElement=function s(e){return e.type===r.select},t.isPluralElement=function c(e){return e.type===r.plural},t.isPoundElement=function f(e){return e.type===r.pound},t.isTagElement=function m(e){return e.type===r.tag},t.isNumberSkeleton=function p(e){return!(!e||"object"!=typeof e||0!==e.type)},t.isDateTimeSkeleton=function d(e){return!(!e||"object"!=typeof e||1!==e.type)},t.createLiteralElement=function y(e){return{type:r.literal,value:e}},t.createNumberElement=function v(e,t){return{type:r.number,value:e,style:t}}})),l=i((function(e,t){var r=a&&a.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=a&&a.__exportStar||function(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.parse=void 0,n(u,t),t.parse=function o(){throw new Error("You're trying to format an uncompiled message with react-intl without parser, please import from 'react-int' instead")}}));function s(e,t,r,n){var o=function a(e){return null==e||"number"==typeof e||"boolean"==typeof e}(n)?n:r(n),i=t.get(o);return void 0===i&&(i=e.call(this,n),t.set(o,i)),i}function c(e,t,r){var n=Array.prototype.slice.call(arguments,3),o=r(n),a=t.get(o);return void 0===a&&(a=e.apply(this,n),t.set(o,a)),a}function f(e,t,r,n,o){return r.bind(t,e,n,o)}function m(e,t){return f(e,this,1===e.length?s:c,t.cache.create(),t.serializer)}function p(){return JSON.stringify(arguments)}function d(){this.cache=Object.create(null)}d.prototype.has=function(e){return e in this.cache},d.prototype.get=function(e){return this.cache[e]},d.prototype.set=function(e,t){this.cache[e]=t};var y={create:function e(){return new d}},v=function g(e,t){return(t&&t.strategy?t.strategy:m)(e,{cache:t&&t.cache?t.cache:y,serializer:t&&t.serializer?t.serializer:p})},h={variadic:function b(e,t){return f(e,this,c,t.cache.create(),t.serializer)},monadic:function O(e,t){return f(e,this,s,t.cache.create(),t.serializer)}};v.strategies=h;var T,E,I=Object.freeze(Object.assign(Object.create(null),v,{default:v,strategies:h})),P=(T=function(e,t){return(T=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}T(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});!function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"}(E||(E={}));var w,S=function(e){function t(t,r,n){var o=e.call(this,t)||this;return o.code=r,o.originalMessage=n,o}return P(t,e),t.prototype.toString=function(){return"[formatjs Error: "+this.code+"] "+this.message},t}(Error),_=function(e){function t(t,r,n,o){return e.call(this,'Invalid values for "'+t+'": "'+r+'". Options are "'+Object.keys(n).join('", "')+'"',"INVALID_VALUE",o)||this}return P(t,e),t}(S),N=function(e){function t(t,r,n){return e.call(this,'Value for "'+t+'" must be of type '+r,"INVALID_VALUE",n)||this}return P(t,e),t}(S),F=function(e){function t(t,r){return e.call(this,'The intl string context variable "'+t+'" was not provided to the string "'+r+'"',"MISSING_VALUE",r)||this}return P(t,e),t}(S);function R(e){return"function"==typeof e}!function(e){e[e.literal=0]="literal",e[e.object=1]="object"}(w||(w={}));var j=function(){return(j=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},D=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var a=arguments[t],i=0,u=a.length;i<u;i++,o++)n[o]=a[i];return n};function M(e){return{create:function(){return{has:function(t){return t in e},get:function(t){return e[t]},set:function(t,r){e[t]=r}}}}}var A,L=v||I,C=function(){function e(t,r,n,o){var a=this;if(void 0===r&&(r=e.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){var t=a.formatToParts(e);if(1===t.length)return t[0].value;var r=t.reduce((function(e,t){return e.length&&0===t.type&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e}),[]);return r.length<=1?r[0]||"":r},this.formatToParts=function(e){return function e(t,r,n,o,a,i,u){if(1===t.length&&l.isLiteralElement(t[0]))return[{type:0,value:t[0].value}];for(var s=[],c=0,f=t;c<f.length;c++){var m=f[c];if(l.isLiteralElement(m))s.push({type:0,value:m.value});else if(l.isPoundElement(m))"number"==typeof i&&s.push({type:0,value:n.getNumberFormat(r).format(i)});else{var p=m.value;if(!a||!(p in a))throw new F(p,u);var d=a[p];if(l.isArgumentElement(m))d&&"string"!=typeof d&&"number"!=typeof d||(d="string"==typeof d||"number"==typeof d?String(d):""),s.push({type:"string"==typeof d?0:1,value:d});else if(l.isDateElement(m)){var y="string"==typeof m.style?o.date[m.style]:l.isDateTimeSkeleton(m.style)?m.style.parsedOptions:void 0;s.push({type:0,value:n.getDateTimeFormat(r,y).format(d)})}else if(l.isTimeElement(m))y="string"==typeof m.style?o.time[m.style]:l.isDateTimeSkeleton(m.style)?m.style.parsedOptions:void 0,s.push({type:0,value:n.getDateTimeFormat(r,y).format(d)});else if(l.isNumberElement(m))y="string"==typeof m.style?o.number[m.style]:l.isNumberSkeleton(m.style)?m.style.parsedOptions:void 0,s.push({type:0,value:n.getNumberFormat(r,y).format(d)});else{if(l.isTagElement(m)){var v=m.children,g=m.value,h=a[g];if(!R(h))throw new N(g,"function",u);var b=h(e(v,r,n,o,a,i).map((function(e){return e.value})));Array.isArray(b)||(b=[b]),s.push.apply(s,b.map((function(e){return{type:"string"==typeof e?0:1,value:e}})))}if(l.isSelectElement(m)){if(!(O=m.options[d]||m.options.other))throw new _(m.value,d,Object.keys(m.options),u);s.push.apply(s,e(O.value,r,n,o,a))}else if(l.isPluralElement(m)){var O;if(!(O=m.options["="+d])){if(!Intl.PluralRules)throw new S('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',"MISSING_INTL_API",u);var T=n.getPluralRules(r,{type:m.pluralType}).select(d-(m.offset||0));O=m.options[T]||m.options.other}if(!O)throw new _(m.value,d,Object.keys(m.options),u);s.push.apply(s,e(O.value,r,n,o,a,d-(m.offset||0)))}}}}return function E(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)}(a.ast,a.locales,a.formatters,a.formats,e,void 0,a.message)},this.resolvedOptions=function(){return{locale:Intl.NumberFormat.supportedLocalesOf(a.locales)[0]}},this.getAst=function(){return a.ast},"string"==typeof t){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");this.ast=e.__parse(t,{normalizeHashtagInPlural:!1,ignoreTag:null==o?void 0:o.ignoreTag})}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=function i(e,t){return t?Object.keys(e).reduce((function(r,n){return r[n]=function o(e,t){return t?j(j(j({},e||{}),t||{}),Object.keys(e).reduce((function(r,n){return r[n]=j(j({},e[n]),t[n]||{}),r}),{})):e}(e[n],t[n]),r}),j({},e)):e}(e.formats,n),this.locales=r,this.formatters=o&&o.formatters||function u(e){return void 0===e&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:L((function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.NumberFormat).bind.apply(e,D([void 0],t)))}),{cache:M(e.number),strategy:L.strategies.variadic}),getDateTimeFormat:L((function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.DateTimeFormat).bind.apply(e,D([void 0],t)))}),{cache:M(e.dateTime),strategy:L.strategies.variadic}),getPluralRules:L((function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.PluralRules).bind.apply(e,D([void 0],t)))}),{cache:M(e.pluralRules),strategy:L.strategies.variadic})}}(this.formatterCache)}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.__parse=l.parse,e.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"}}},e}(),x=function(){var e=function(t,r){return(e=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])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();(A=e.ReactIntlErrorCode||(e.ReactIntlErrorCode={})).FORMAT_ERROR="FORMAT_ERROR",A.UNSUPPORTED_FORMATTER="UNSUPPORTED_FORMATTER",A.INVALID_CONFIG="INVALID_CONFIG",A.MISSING_DATA="MISSING_DATA",A.MISSING_TRANSLATION="MISSING_TRANSLATION";var k=function(e){function t(r,n,o){var a=e.call(this,"[@formatjs/intl Error "+r+"] "+n+" \n"+(o?"\n"+o.message+"\n"+o.stack:""))||this;return a.code=r,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(a,t),a}return x(t,e),t}(Error),$=function(e){function t(t,r){return e.call(this,"UNSUPPORTED_FORMATTER",t,r)||this}return x(t,e),t}(k),U=function(e){function t(t,r){return e.call(this,"INVALID_CONFIG",t,r)||this}return x(t,e),t}(k),V=function(e){function t(t,r){return e.call(this,"MISSING_DATA",t,r)||this}return x(t,e),t}(k),G=function(e){function t(t,r,n,o){var a=e.call(this,"FORMAT_ERROR",t+" \nLocale: "+r+"\nMessageID: "+(null==n?void 0:n.id)+"\nDefault Message: "+(null==n?void 0:n.defaultMessage)+"\nDescription: "+(null==n?void 0:n.description)+" \n",o)||this;return a.descriptor=n,a}return x(t,e),t}(k),z=function(e){function t(t,r){var n=e.call(this,"MISSING_TRANSLATION",'Missing message: "'+t.id+'" for locale "'+r+'", using '+(t.defaultMessage?"default message":"id")+" as fallback.")||this;return n.descriptor=t,n}return x(t,e),t}(k),Z=function(){return(Z=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Y=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var a=arguments[t],i=0,u=a.length;i<u;i++,o++)n[o]=a[i];return n};function q(e,t,r){return void 0===r&&(r={}),t.reduce((function(t,n){return n in e?t[n]=e[n]:n in r&&(t[n]=r[n]),t}),{})}var K={formats:{},messages:{},timeZone:void 0,defaultLocale:"en",defaultFormats:{},onError:function(e){}};function W(e){return{create:function(){return{has:function(t){return t in e},get:function(t){return e[t]},set:function(t,r){e[t]=r}}}}}var B=v||I;function H(e,t,r,n){var o,a=e&&e[t];if(a&&(o=a[r]),o)return o;n(new $("No "+t+" format named: "+r))}var J=function(){return(J=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Q(e,t){return Object.keys(e).reduce((function(r,n){return r[n]=J({timeZone:t},e[n]),r}),{})}function X(e,t){return Object.keys(J(J({},e),t)).reduce((function(r,n){return r[n]=J(J({},e[n]||{}),t[n]||{}),r}),{})}function ee(e,t){if(!t)return e;var r=C.formats;return J(J(J({},r),e),{date:X(Q(r.date,t),Q(e.date||{},t)),time:X(Q(r.time,t),Q(e.time||{},t))})}function te(e,t,r,n){var a=e.locale,i=e.formats,u=e.messages,s=e.defaultLocale,c=e.defaultFormats,f=e.onError,m=e.timeZone,p=e.defaultRichTextElements;void 0===r&&(r={id:""});var d=r.id,y=r.defaultMessage;o(!!d,"[@formatjs/intl] An `id` must be provided to format a message.");var v=String(d),g=u&&Object.prototype.hasOwnProperty.call(u,v)&&u[v];if(Array.isArray(g)&&1===g.length&&g[0].type===l.TYPE.literal)return g[0].value;if(!n&&g&&"string"==typeof g&&p&&console.error('[@formatjs/intl] "defaultRichTextElements" was specified but "message" was not pre-compiled. \nPlease consider using "@formatjs/cli" to pre-compile your messages for performance.\nFor more details see https://formatjs.io/docs/getting-started/message-distribution'),!n&&g&&"string"==typeof g&&!p)return g.replace(/'\{(.*?)\}'/gi,"{$1}");if(n=J(J({},p),n||{}),i=ee(i,m),c=ee(c,m),!g){if((!y||a&&a.toLowerCase()!==s.toLowerCase())&&f(new z(r,a)),y)try{return t.getMessageFormat(y,s,c).format(n)}catch(e){return f(new G('Error formatting default message for: "'+v+'", rendering default message verbatim',a,r,e)),"string"==typeof y?y:v}return v}try{return t.getMessageFormat(g,a,i,{formatters:t}).format(n)}catch(e){f(new G('Error formatting message: "'+v+'", using '+(y?"default message":"id")+" as fallback.",a,r,e))}if(y)try{return t.getMessageFormat(y,s,c).format(n)}catch(e){f(new G('Error formatting the default message for: "'+v+'", rendering message verbatim',a,r,e))}return"string"==typeof g?g:"string"==typeof y?y:v}var re=function(){return(re=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},ne=["localeMatcher","formatMatcher","timeZone","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName","hourCycle","dateStyle","timeStyle","fractionalSecondDigits","calendar","numberingSystem"];function oe(e,t,r,n){var o=e.locale,a=e.formats,i=e.onError,u=e.timeZone;void 0===n&&(n={});var l=n.format,s=re(re({},u&&{timeZone:u}),l&&H(a,t,l,i)),c=q(n,ne,s);return"time"!==t||c.hour||c.minute||c.second||(c=re(re({},c),{hour:"numeric",minute:"numeric"})),r(o,c)}function ae(e,t,r,n){void 0===n&&(n={});var o="string"==typeof r?new Date(r||0):r;try{return oe(e,"date",t,n).format(o)}catch(t){e.onError(new k("FORMAT_ERROR","Error formatting date.",t))}return String(o)}function ie(e,t,r,n){void 0===n&&(n={});var o="string"==typeof r?new Date(r||0):r;try{return oe(e,"time",t,n).format(o)}catch(t){e.onError(new k("FORMAT_ERROR","Error formatting time.",t))}return String(o)}function ue(e,t,r,n){void 0===n&&(n={});var o="string"==typeof r?new Date(r||0):r;try{return oe(e,"date",t,n).formatToParts(o)}catch(t){e.onError(new k("FORMAT_ERROR","Error formatting date.",t))}return[]}function le(e,t,r,n){void 0===n&&(n={});var o="string"==typeof r?new Date(r||0):r;try{return oe(e,"time",t,n).formatToParts(o)}catch(t){e.onError(new k("FORMAT_ERROR","Error formatting time.",t))}return[]}var se=["localeMatcher","style","type","fallback"];function ce(e,t,r,n){var o=e.locale,a=e.onError;void 0===n&&(n={}),Intl.DisplayNames||a(new S('Intl.DisplayNames is not available in this environment.\nTry polyfilling it using "@formatjs/intl-displaynames"\n',"MISSING_INTL_API"));var i=q(n,se);try{return t(o,i).of(r)}catch(e){a(new k("FORMAT_ERROR","Error formatting display name.",e))}}var fe=["localeMatcher","type","style"],me=Date.now();function pe(e,t,r,n){var o=e.locale,a=e.onError;void 0===n&&(n={}),Intl.ListFormat||a(new S('Intl.ListFormat is not available in this environment.\nTry polyfilling it using "@formatjs/intl-listformat"\n',"MISSING_INTL_API"));var i=q(n,fe);try{var u={},l=r.map((function(e,t){if("object"==typeof e){var r=function n(e){return me+"_"+e+"_"+me}(t);return u[r]=e,r}return String(e)}));return Object.keys(u).length?t(o,i).formatToParts(l).reduce((function(e,t){var r=t.value;return u[r]?e.push(u[r]):"string"==typeof e[e.length-1]?e[e.length-1]+=r:e.push(r),e}),[]):t(o,i).format(l)}catch(e){a(new k("FORMAT_ERROR","Error formatting list.",e))}return r}var de=["localeMatcher","type"];function ye(e,t,r,n){var o=e.locale,a=e.onError;void 0===n&&(n={}),Intl.PluralRules||a(new S('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',"MISSING_INTL_API"));var i=q(n,de);try{return t(o,i).select(r)}catch(e){a(new G("Error formatting plural.",e))}return"other"}var ve=["numeric","style"];function ge(e,t,r,n,o){void 0===o&&(o={}),n||(n="second"),Intl.RelativeTimeFormat||e.onError(new S('Intl.RelativeTimeFormat is not available in this environment.\nTry polyfilling it using "@formatjs/intl-relativetimeformat"\n',"MISSING_INTL_API"));try{return function a(e,t,r){var n=e.locale;void 0===r&&(r={});var o=r.format,a=!!o&&H(e.formats,"relative",o,e.onError)||{};return t(n,q(r,ve,a))}(e,t,o).format(r,n)}catch(t){e.onError(new G("Error formatting relative time.",t))}return String(r)}var he=["localeMatcher","style","currency","currencyDisplay","unit","unitDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","currencyDisplay","currencySign","notation","signDisplay","unit","unitDisplay"];function be(e,t,r){var n=e.locale;void 0===r&&(r={});var o=r.format,a=o&&H(e.formats,"number",o,e.onError)||{};return t(n,q(r,he,a))}function Oe(e,t,r,n){void 0===n&&(n={});try{return be(e,t,n).format(r)}catch(t){e.onError(new k("FORMAT_ERROR","Error formatting number.",t))}return String(r)}function Te(e,t,r,n){void 0===n&&(n={});try{return be(e,t,n).formatToParts(r)}catch(t){e.onError(new k("FORMAT_ERROR","Error formatting number.",t))}return[]}var Ee=function(){return(Ee=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Ie=function(){return(Ie=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Pe(e){o(e,"[React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry.")}var we=Ie(Ie({},K),{textComponent:t.Fragment}),Se="function"==typeof Symbol&&Symbol.for,_e=Se?Symbol.for("react.element"):60103,Ne=Se?Symbol.for("react.portal"):60106,Fe=Se?Symbol.for("react.fragment"):60107,Re=Se?Symbol.for("react.strict_mode"):60108,je=Se?Symbol.for("react.profiler"):60114,De=Se?Symbol.for("react.provider"):60109,Me=Se?Symbol.for("react.context"):60110,Ae=Se?Symbol.for("react.async_mode"):60111,Le=Se?Symbol.for("react.concurrent_mode"):60111,Ce=Se?Symbol.for("react.forward_ref"):60112,xe=Se?Symbol.for("react.suspense"):60113,ke=Se?Symbol.for("react.suspense_list"):60120,$e=Se?Symbol.for("react.memo"):60115,Ue=Se?Symbol.for("react.lazy"):60116,Ve=Se?Symbol.for("react.block"):60121,Ge=Se?Symbol.for("react.fundamental"):60117,ze=Se?Symbol.for("react.responder"):60118,Ze=Se?Symbol.for("react.scope"):60119;function Ye(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case _e:switch(e=e.type){case Ae:case Le:case Fe:case je:case Re:case xe:return e;default:switch(e=e&&e.$$typeof){case Me:case Ce:case Ue:case $e:case De:return e;default:return t}}case Ne:return t}}}function qe(e){return Ye(e)===Le}var Ke={AsyncMode:Ae,ConcurrentMode:Le,ContextConsumer:Me,ContextProvider:De,Element:_e,ForwardRef:Ce,Fragment:Fe,Lazy:Ue,Memo:$e,Portal:Ne,Profiler:je,StrictMode:Re,Suspense:xe,isAsyncMode:function(e){return qe(e)||Ye(e)===Ae},isConcurrentMode:qe,isContextConsumer:function(e){return Ye(e)===Me},isContextProvider:function(e){return Ye(e)===De},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===_e},isForwardRef:function(e){return Ye(e)===Ce},isFragment:function(e){return Ye(e)===Fe},isLazy:function(e){return Ye(e)===Ue},isMemo:function(e){return Ye(e)===$e},isPortal:function(e){return Ye(e)===Ne},isProfiler:function(e){return Ye(e)===je},isStrictMode:function(e){return Ye(e)===Re},isSuspense:function(e){return Ye(e)===xe},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===Fe||e===Le||e===je||e===Re||e===xe||e===ke||"object"==typeof e&&null!==e&&(e.$$typeof===Ue||e.$$typeof===$e||e.$$typeof===De||e.$$typeof===Me||e.$$typeof===Ce||e.$$typeof===Ge||e.$$typeof===ze||e.$$typeof===Ze||e.$$typeof===Ve)},typeOf:Ye},We=i((function(e){e.exports=Ke})),Be={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},He={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Je={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Qe={};function Xe(e){return We.isMemo(e)?Je:Qe[e.$$typeof]||Be}Qe[We.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Qe[We.Memo]=Je;var et=Object.defineProperty,tt=Object.getOwnPropertyNames,rt=Object.getOwnPropertySymbols,nt=Object.getOwnPropertyDescriptor,ot=Object.getPrototypeOf,at=Object.prototype,it=function e(t,r,n){if("string"!=typeof r){if(at){var o=ot(r);o&&o!==at&&e(t,o,n)}var a=tt(r);rt&&(a=a.concat(rt(r)));for(var i=Xe(t),u=Xe(r),l=0;l<a.length;++l){var s=a[l];if(!(He[s]||n&&n[s]||u&&u[s]||i&&i[s])){var c=nt(r,s);try{et(t,s,c)}catch(e){}}}}return t},ut=function(){return(ut=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},lt=it.default||it,st=t.createContext(null),ct=st.Consumer,ft=st.Provider,mt=st;function pt(e,r){var n=r||{},o=n.intlPropName,a=void 0===o?"intl":o,i=n.forwardRef,u=void 0!==i&&i,l=n.enforceContext,s=void 0===l||l,c=function(r){return t.createElement(ct,null,(function(n){var o;s&&Pe(n);var i=((o={})[a]=n,o);return t.createElement(e,ut({},r,i,{ref:u?r.forwardedRef:null}))}))};return c.displayName="injectIntl("+function f(e){return e.displayName||e.name||"Component"}(e)+")",c.WrappedComponent=e,lt(u?t.forwardRef((function(e,r){return t.createElement(c,ut({},e,{forwardedRef:r}))})):c,e)}var dt,yt,vt=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r};!function(e){e.formatDate="FormattedDate",e.formatTime="FormattedTime",e.formatNumber="FormattedNumber",e.formatList="FormattedList",e.formatDisplayName="FormattedDisplayName"}(dt||(dt={})),function(e){e.formatDate="FormattedDateParts",e.formatTime="FormattedTimeParts",e.formatNumber="FormattedNumberParts",e.formatList="FormattedListParts"}(yt||(yt={}));var gt=function(e){return t.createElement(mt.Consumer,null,(function(t){Pe(t);var r=e.value,n=e.children,o=vt(e,["value","children"]);return n(t.formatNumberToParts(r,o))}))};function ht(e){var r=function(r){return t.createElement(mt.Consumer,null,(function(t){Pe(t);var n=r.value,o=r.children,a=vt(r,["value","children"]),i="string"==typeof n?new Date(n||0):n;return o("formatDate"===e?t.formatDateToParts(i,a):t.formatTimeToParts(i,a))}))};return r.displayName=yt[e],r}function bt(e){var r=function(r){return t.createElement(mt.Consumer,null,(function(n){Pe(n);var o=r.value,a=r.children,i=vt(r,["value","children"]),u=n[e](o,i);return"function"==typeof a?a(u):t.createElement(n.textComponent||t.Fragment,null,u)}))};return r.displayName=dt[e],r}gt.displayName="FormattedNumberParts";var Ot=function Tt(e,t){if(e===t)return!0;if(!e||!t)return!1;var r=Object.keys(e),n=Object.keys(t),o=r.length;if(n.length!==o)return!1;for(var a=0;a<o;a++){var i=r[a];if(e[i]!==t[i]||!Object.prototype.hasOwnProperty.call(t,i))return!1}return!0},Et=Object.freeze(Object.assign(Object.create(null),Ot,{default:Ot})),It=function(){var e=function(t,r){return(e=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])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Pt=function(){return(Pt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},wt=Ot||Et;function St(e){return{locale:e.locale,timeZone:e.timeZone,formats:e.formats,textComponent:e.textComponent,messages:e.messages,defaultLocale:e.defaultLocale,defaultFormats:e.defaultFormats,onError:e.onError,wrapRichTextChunksInFragment:e.wrapRichTextChunksInFragment,defaultRichTextElements:e.defaultRichTextElements}}function _t(e){return e?Object.keys(e).reduce((function(r,n){var o=e[n];return r[n]=R(o)?function a(e){return function(r){return e(t.Children.toArray(r))}} /** @license React v16.13.1 * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */(o):o,r}),{}):e}var Nt=function(e,r,n,o){var a=te(e,r,n,_t(o));return Array.isArray(a)?t.Children.toArray(a):a},Ft=function(e,t){var r=e.defaultRichTextElements,n=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["defaultRichTextElements"]),o=_t(r),a=function i(e,t){var r=function n(e){void 0===e&&(e={dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}});var t=Intl.RelativeTimeFormat,r=Intl.ListFormat,n=Intl.DisplayNames,o=B((function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.DateTimeFormat).bind.apply(e,Y([void 0],t)))}),{cache:W(e.dateTime),strategy:B.strategies.variadic}),a=B((function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.NumberFormat).bind.apply(e,Y([void 0],t)))}),{cache:W(e.number),strategy:B.strategies.variadic}),i=B((function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return new((e=Intl.PluralRules).bind.apply(e,Y([void 0],t)))}),{cache:W(e.pluralRules),strategy:B.strategies.variadic});return{getDateTimeFormat:o,getNumberFormat:a,getMessageFormat:B((function(e,t,r,n){return new C(e,t,r,Z({formatters:{getNumberFormat:a,getDateTimeFormat:o,getPluralRules:i}},n||{}))}),{cache:W(e.message),strategy:B.strategies.variadic}),getRelativeTimeFormat:B((function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return new(t.bind.apply(t,Y([void 0],e)))}),{cache:W(e.relativeTime),strategy:B.strategies.variadic}),getPluralRules:i,getListFormat:B((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new(r.bind.apply(r,Y([void 0],e)))}),{cache:W(e.list),strategy:B.strategies.variadic}),getDisplayNames:B((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new(n.bind.apply(n,Y([void 0],e)))}),{cache:W(e.displayNames),strategy:B.strategies.variadic})}}(t),o=Ee(Ee({},K),e),a=o.locale,i=o.defaultLocale,u=o.onError;return a?!Intl.NumberFormat.supportedLocalesOf(a).length&&u?u(new V('Missing locale data for locale: "'+a+'" in Intl.NumberFormat. Using default locale: "'+i+'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details')):!Intl.DateTimeFormat.supportedLocalesOf(a).length&&u&&u(new V('Missing locale data for locale: "'+a+'" in Intl.DateTimeFormat. Using default locale: "'+i+'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details')):(u&&u(new U('"locale" was not configured, using "'+i+'" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details')),o.locale=o.defaultLocale||"en"),Ee(Ee({},o),{formatters:r,formatNumber:Oe.bind(null,o,r.getNumberFormat),formatNumberToParts:Te.bind(null,o,r.getNumberFormat),formatRelativeTime:ge.bind(null,o,r.getRelativeTimeFormat),formatDate:ae.bind(null,o,r.getDateTimeFormat),formatDateToParts:ue.bind(null,o,r.getDateTimeFormat),formatTime:ie.bind(null,o,r.getDateTimeFormat),formatTimeToParts:le.bind(null,o,r.getDateTimeFormat),formatPlural:ye.bind(null,o,r.getPluralRules),formatMessage:te.bind(null,o,r),formatList:pe.bind(null,o,r.getListFormat),formatDisplayName:ce.bind(null,o,r.getDisplayNames)})}(Pt(Pt({},we),n),t);return Pt(Pt({},a),{formatMessage:Nt.bind(null,{locale:a.locale,timeZone:a.timeZone,formats:a.formats,defaultLocale:a.defaultLocale,defaultFormats:a.defaultFormats,messages:a.messages,onError:a.onError,defaultRichTextElements:o},a.formatters)})},Rt=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.cache={dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}},t.state={cache:t.cache,intl:Ft(St(t.props),t.cache),prevConfig:St(t.props)},t}return It(r,e),r.getDerivedStateFromProps=function(e,t){var r=t.prevConfig,n=t.cache,o=St(e);return wt(r,o)?null:{intl:Ft(o,n),prevConfig:o}},r.prototype.render=function(){return Pe(this.state.intl),t.createElement(ft,{value:this.state.intl},this.props.children)},r.displayName="IntlProvider",r.defaultProps=we,r}(t.PureComponent),jt=function(){var e=function(t,r){return(e=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])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Dt=function(){return(Dt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Mt(e){var t=Math.abs(e);return t<60?"second":t<3600?"minute":t<86400?"hour":"day"}function At(e){switch(e){case"second":return 1;case"minute":return 60;case"hour":return 3600;default:return 86400}}function Lt(e,t){if(!e)return 0;switch(t){case"second":return e;case"minute":return 60*e;default:return 3600*e}}var Ct=["second","minute","hour"];function xt(e){return void 0===e&&(e="second"),Ct.includes(e)}var kt=function(e){function r(t){var r=e.call(this,t)||this;return r._updateTimer=null,r.state={prevUnit:r.props.unit,prevValue:r.props.value,currentValueInSeconds:xt(r.props.unit)?Lt(r.props.value,r.props.unit):0},o(!t.updateIntervalInSeconds||!(!t.updateIntervalInSeconds||!xt(t.unit)),"Cannot schedule update with unit longer than hour"),r}return jt(r,e),r.prototype.scheduleNextUpdate=function(e,t){var r=this,n=e.updateIntervalInSeconds,o=e.unit,a=t.currentValueInSeconds;if(clearTimeout(this._updateTimer),this._updateTimer=null,n&&xt(o)){var i=a-n,u=Mt(i);if("day"!==u){var l=At(u),s=i-i%l,c=s>=a?s-l:s,f=Math.abs(c-a);this._updateTimer=setTimeout((function(){return r.setState({currentValueInSeconds:c})}),1e3*f)}}},r.prototype.componentDidMount=function(){this.scheduleNextUpdate(this.props,this.state)},r.prototype.componentDidUpdate=function(){this.scheduleNextUpdate(this.props,this.state)},r.prototype.componentWillUnmount=function(){clearTimeout(this._updateTimer),this._updateTimer=null},r.getDerivedStateFromProps=function(e,t){return e.unit!==t.prevUnit||e.value!==t.prevValue?{prevValue:e.value,prevUnit:e.unit,currentValueInSeconds:xt(e.unit)?Lt(e.value,e.unit):0}:null},r.prototype.render=function(){var e=this;return t.createElement(mt.Consumer,null,(function(r){Pe(r);var n=r.formatRelativeTime,o=r.textComponent,a=e.props,i=a.children,u=a.unit,l=a.updateIntervalInSeconds,s=e.state.currentValueInSeconds,c=a.value||0,f=u;if(xt(u)&&"number"==typeof s&&l){var m=At(f=Mt(s));c=Math.round(s/m)}var p=n(c,f,Dt({},e.props));return"function"==typeof i?i(p):o?t.createElement(o,null,p):p}))},r.displayName="FormattedRelativeTime",r.defaultProps={value:0,unit:"second"},r}(t.PureComponent),$t=function(e){var r=e.other,n=e.children,o=e.intl,a=o.textComponent,i=e[(0,o.formatPlural)(e.value,e)]||r;return"function"==typeof n?n(i):a?t.createElement(a,null,i):i};$t.defaultProps={type:"cardinal"},$t.displayName="FormattedPlural";var Ut=pt($t),Vt=function(){var e=function(t,r){return(e=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])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Gt=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r},zt=Ot||Et,Zt=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return Vt(r,e),r.prototype.shouldComponentUpdate=function(e){var t=this.props,r=t.values,n=Gt(t,["values"]),o=e.values,a=Gt(e,["values"]);return!zt(o,r)||!zt(n,a)},r.prototype.render=function(){var e=this;return t.createElement(mt.Consumer,null,(function(r){Pe(r);var o=r.textComponent,a=e.props,i=a.children,u=a.tagName,l=void 0===u?void 0===o?t.Fragment:o:u,s=(0,r.formatMessage)({id:a.id,description:a.description,defaultMessage:a.defaultMessage},a.values);return Array.isArray(s)||(s=[s]),"function"==typeof i?i(s):l?t.createElement.apply(n,function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var a=arguments[t],i=0,u=a.length;i<u;i++,o++)n[o]=a[i];return n}([l,null],s)):s}))},r.displayName="FormattedMessage",r}(t.Component),Yt=bt("formatDate"),qt=bt("formatTime"),Kt=bt("formatNumber"),Wt=bt("formatList"),Bt=bt("formatDisplayName"),Ht=ht("formatDate"),Jt=ht("formatTime");e.FormattedDate=Yt,e.FormattedDateParts=Ht,e.FormattedDisplayName=Bt,e.FormattedList=Wt,e.FormattedMessage=Zt,e.FormattedNumber=Kt,e.FormattedNumberParts=gt,e.FormattedPlural=Ut,e.FormattedRelativeTime=kt,e.FormattedTime=qt,e.FormattedTimeParts=Jt,e.IntlContext=mt,e.IntlProvider=Rt,e.InvalidConfigError=U,e.MessageFormatError=G,e.MissingDataError=V,e.MissingTranslationError=z,e.RawIntlProvider=ft,e.ReactIntlError=k,e.UnsupportedFormatterError=$,e.createIntl=Ft,e.createIntlCache=function Qt(){return{dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}}},e.defineMessage=function Xt(e){return e},e.defineMessages=function er(e){return e},e.injectIntl=pt,e.useIntl=function tr(){var e=t.useContext(mt);return Pe(e),e},Object.defineProperty(e,"__esModule",{value:!0})}));