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.
3 lines (2 loc) • 41 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("prop-types"),require("react")):"function"==typeof define&&define.amd?define(["exports","prop-types","react"],e):e(t.ReactIntl=t.ReactIntl||{},t.PropTypes,t.React)}(this,function(t,e,r){"use strict";function n(t){var e,r,n,o,a=Array.prototype.slice.call(arguments,1);for(e=0,r=a.length;e<r;e+=1)if(n=a[e])for(o in n)D.call(n,o)&&(t[o]=n[o]);return t}function o(t,e,r){this.locales=t,this.formats=e,this.pluralFn=r}function a(t){this.id=t}function i(t,e,r,n,o){this.id=t,this.useOrdinal=e,this.offset=r,this.options=n,this.pluralFn=o}function l(t,e,r,n){this.id=t,this.offset=e,this.numberFormat=r,this.string=n}function u(t,e){this.id=t,this.options=e}function s(t,e,r){var n="string"==typeof t?s.__parse(t):t;if(!n||"messageFormatPattern"!==n.type)throw new TypeError("A message must be provided as a String or AST.");r=this._mergeFormats(s.formats,r),E(this,"_locale",{value:this._resolveLocale(e)});var o=this._findPluralRuleFunction(this._locale),a=this._compilePattern(n,e,r,o),i=this;this.format=function(e){try{return i._format(a,e)}catch(e){throw e.variableId?new Error("The intl string context variable '"+e.variableId+"' was not provided to the string '"+t+"'"):e}}}function c(t){return 400*t/146097}function f(t,e){e=e||{},B(t)&&(t=t.concat()),W(this,"_locale",{value:this._resolveLocale(t)}),W(this,"_options",{value:{style:this._resolveStyle(e.style),units:this._isValidUnits(e.units)&&e.units}}),W(this,"_locales",{value:t}),W(this,"_fields",{value:this._findFields(this._locale)}),W(this,"_messages",{value:V(null)});var r=this;this.format=function(t,e){return r._format(t,e)}}function p(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];(Array.isArray(t)?t:[t]).forEach(function(t){t&&t.locale&&(s.__addLocaleData(t),f.__addLocaleData(t))})}function h(t){for(var e=(t||"").split("-");e.length>0;){if(m(e.join("-")))return!0;e.pop()}return!1}function m(t){var e=t&&t.toLowerCase();return!(!s.__localeData__[e]||!f.__localeData__[e])}function d(t){return(""+t).replace(At,function(t){return Tt[t]})}function v(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.reduce(function(e,n){return t.hasOwnProperty(n)?e[n]=t[n]:r.hasOwnProperty(n)&&(e[n]=r[n]),e},{})}function y(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).intl;Ct(t,"[React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry.")}function g(t,e){if(t===e)return!0;if("object"!==(void 0===t?"undefined":Q(t))||null===t||"object"!==(void 0===e?"undefined":Q(e))||null===e)return!1;var r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(var o=Object.prototype.hasOwnProperty.bind(e),a=0;a<r.length;a++)if(!o(r[a])||t[r[a]]!==e[r[a]])return!1;return!0}function _(t,e,r){var n=t.props,o=t.state,a=t.context,i=void 0===a?{}:a,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},u=i.intl,s=void 0===u?{}:u,c=l.intl,f=void 0===c?{}:c;return!g(e,n)||!g(r,o)||!(f===s||g(v(f,Pt),v(s,Pt)))}function b(t){return t.displayName||t.name||"Component"}function w(t){return s.prototype._resolveLocale(t)}function F(t){return s.prototype._findPluralRuleFunction(t)}function O(t){var e=Dt(null);return function(){var r=Array.prototype.slice.call(arguments),n=x(r),o=n&&e[n];return o||(o=new(Mt.apply(t,[null].concat(r))),n&&(e[n]=o)),o}}function x(t){if("undefined"!=typeof JSON){var e,r,n,o=[];for(e=0,r=t.length;e<r;e+=1)(n=t[e])&&"object"==typeof n?o.push(j(n)):o.push(n);return JSON.stringify(o)}}function j(t){var e,r,n,o,a=[],i=[];for(e in t)t.hasOwnProperty(e)&&i.push(e);var l=i.sort();for(r=0,n=l.length;r<n;r+=1)(o={})[e=l[r]]=t[e],a[r]=o;return a}function C(t){var e=f.thresholds;e.second=t.second,e.minute=t.minute,e.hour=t.hour,e.day=t.day,e.month=t.month}function P(t,e,r){var n=t&&t[e]&&t[e][r];if(n)return n}function T(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.locale,a=t.formats,i=t.messages,l=t.defaultLocale,u=t.defaultFormats,s=r.id,c=r.defaultMessage;Ct(s,"[React Intl] An `id` must be provided to format a message.");var f=i&&i[s];if(!(Object.keys(n).length>0))return f||c||s;var p=void 0;if(f)try{p=e.getMessageFormat(f,o,a).format(n)}catch(t){}if(!p&&c)try{p=e.getMessageFormat(c,l,u).format(n)}catch(t){}return p||f||c||s}function A(t){var e=Math.abs(t);return e<$t?"second":e<zt?"minute":e<Kt?"hour":"day"}function N(t){switch(t){case"second":return Jt;case"minute":return $t;case"hour":return zt;case"day":return Kt;default:return Qt}}function M(t,e){if(t===e)return!0;var r=new Date(t).getTime(),n=new Date(e).getTime();return isFinite(r)&&isFinite(n)&&r===n}if(void 0===r)throw new ReferenceError("React must be loaded before ReactIntl.");e="default"in e?e.default:e;var R="default"in r?r.default:r,k={locale:"en",pluralRuleFunction:function(t,e){var r=String(t).split("."),n=!r[1],o=Number(r[0])==t,a=o&&r[0].slice(-1),i=o&&r[0].slice(-2);return e?1==a&&11!=i?"one":2==a&&12!=i?"two":3==a&&13!=i?"few":"other":1==t&&n?"one":"other"},fields:{year:{displayName:"year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"in {0} year",other:"in {0} years"},past:{one:"{0} year ago",other:"{0} years ago"}}},month:{displayName:"month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"in {0} month",other:"in {0} months"},past:{one:"{0} month ago",other:"{0} months ago"}}},day:{displayName:"day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{one:"in {0} day",other:"in {0} days"},past:{one:"{0} day ago",other:"{0} days ago"}}},hour:{displayName:"hour",relative:{0:"this hour"},relativeTime:{future:{one:"in {0} hour",other:"in {0} hours"},past:{one:"{0} hour ago",other:"{0} hours ago"}}},minute:{displayName:"minute",relative:{0:"this minute"},relativeTime:{future:{one:"in {0} minute",other:"in {0} minutes"},past:{one:"{0} minute ago",other:"{0} minutes ago"}}},second:{displayName:"second",relative:{0:"now"},relativeTime:{future:{one:"in {0} second",other:"in {0} seconds"},past:{one:"{0} second ago",other:"{0} seconds ago"}}}}},D=Object.prototype.hasOwnProperty,E=function(){try{return!!Object.defineProperty({},"a",{})}catch(t){return!1}}()?Object.defineProperty:function(t,e,r){"get"in r&&t.__defineGetter__?t.__defineGetter__(e,r.get):(!D.call(t,e)||"value"in r)&&(t[e]=r.value)},I=Object.create||function(t,e){function r(){}var n,o;r.prototype=t,n=new r;for(o in e)D.call(e,o)&&E(n,o,e[o]);return n};o.prototype.compile=function(t){return this.pluralStack=[],this.currentPlural=null,this.pluralNumberFormat=null,this.compileMessage(t)},o.prototype.compileMessage=function(t){if(!t||"messageFormatPattern"!==t.type)throw new Error('Message AST is not of type: "messageFormatPattern"');var e,r,n,o=t.elements,a=[];for(e=0,r=o.length;e<r;e+=1)switch((n=o[e]).type){case"messageTextElement":a.push(this.compileMessageText(n));break;case"argumentElement":a.push(this.compileArgument(n));break;default:throw new Error("Message element does not have a valid type")}return a},o.prototype.compileMessageText=function(t){return this.currentPlural&&/(^|[^\\])#/g.test(t.value)?(this.pluralNumberFormat||(this.pluralNumberFormat=new Intl.NumberFormat(this.locales)),new l(this.currentPlural.id,this.currentPlural.format.offset,this.pluralNumberFormat,t.value)):t.value.replace(/\\#/g,"#")},o.prototype.compileArgument=function(t){var e=t.format;if(!e)return new a(t.id);var r,n=this.formats,o=this.locales,l=this.pluralFn;switch(e.type){case"numberFormat":return r=n.number[e.style],{id:t.id,format:new Intl.NumberFormat(o,r).format};case"dateFormat":return r=n.date[e.style],{id:t.id,format:new Intl.DateTimeFormat(o,r).format};case"timeFormat":return r=n.time[e.style],{id:t.id,format:new Intl.DateTimeFormat(o,r).format};case"pluralFormat":return r=this.compileOptions(t),new i(t.id,e.ordinal,e.offset,r,l);case"selectFormat":return r=this.compileOptions(t),new u(t.id,r);default:throw new Error("Message element does not have a valid format type")}},o.prototype.compileOptions=function(t){var e=t.format,r=e.options,n={};this.pluralStack.push(this.currentPlural),this.currentPlural="pluralFormat"===e.type?t:null;var o,a,i;for(o=0,a=r.length;o<a;o+=1)n[(i=r[o]).selector]=this.compileMessage(i.value);return this.currentPlural=this.pluralStack.pop(),n},a.prototype.format=function(t){return t||"number"==typeof t?"string"==typeof t?t:String(t):""},i.prototype.getOption=function(t){var e=this.options;return e["="+t]||e[this.pluralFn(t-this.offset,this.useOrdinal)]||e.other},l.prototype.format=function(t){var e=this.numberFormat.format(t-this.offset);return this.string.replace(/(^|[^\\])#/g,"$1"+e).replace(/\\#/g,"#")},u.prototype.getOption=function(t){var e=this.options;return e[t]||e.other};var L=function(){function t(t,e,r,n,o,a){this.message=t,this.expected=e,this.found=r,this.offset=n,this.line=o,this.column=a,this.name="SyntaxError"}return function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(t,Error),{SyntaxError:t,parse:function(e){function r(t){return $t!==t&&($t>t&&($t=0,zt={line:1,column:1,seenCR:!1}),function(t,r,n){var o,a;for(o=$t;o<n;o++)"\n"===(a=e.charAt(o))?(t.seenCR||t.line++,t.column=1,t.seenCR=!1):"\r"===a||"\u2028"===a||"\u2029"===a?(t.line++,t.column=1,t.seenCR=!0):(t.column++,t.seenCR=!1)}(zt,0,t),$t=t),zt}function n(t){Bt<Kt||(Bt>Kt&&(Kt=Bt,Qt=[]),Qt.push(t))}function o(){return a()}function a(){var t,e,r;for(t=Bt,e=[],r=i();r!==A;)e.push(r),r=i();return e!==A&&(Jt=t,e=R(e)),t=e}function i(){var t;return(t=u())===A&&(t=c()),t}function l(){var t,r,n,o,a,i;if(t=Bt,r=[],n=Bt,(o=w())!==A&&(a=C())!==A&&(i=w())!==A?n=o=[o,a,i]:(Bt=n,n=k),n!==A)for(;n!==A;)r.push(n),n=Bt,(o=w())!==A&&(a=C())!==A&&(i=w())!==A?n=o=[o,a,i]:(Bt=n,n=k);else r=k;return r!==A&&(Jt=t,r=D(r)),(t=r)===A&&(t=Bt,(r=b())!==A&&(r=e.substring(t,Bt)),t=r),t}function u(){var t,e;return t=Bt,(e=l())!==A&&(Jt=t,e=E(e)),t=e}function s(){var t,r,o;if((t=x())===A){if(t=Bt,r=[],I.test(e.charAt(Bt))?(o=e.charAt(Bt),Bt++):(o=A,0===Xt&&n(L)),o!==A)for(;o!==A;)r.push(o),I.test(e.charAt(Bt))?(o=e.charAt(Bt),Bt++):(o=A,0===Xt&&n(L));else r=k;r!==A&&(r=e.substring(t,Bt)),t=r}return t}function c(){var t,r,o,a,i,l,u;return t=Bt,123===e.charCodeAt(Bt)?(r=S,Bt++):(r=A,0===Xt&&n(U)),r!==A&&w()!==A&&(o=s())!==A&&w()!==A?(a=Bt,44===e.charCodeAt(Bt)?(i=G,Bt++):(i=A,0===Xt&&n(H)),i!==A&&(l=w())!==A&&(u=f())!==A?a=i=[i,l,u]:(Bt=a,a=k),a===A&&(a=q),a!==A&&(i=w())!==A?(125===e.charCodeAt(Bt)?(l=W,Bt++):(l=A,0===Xt&&n(V)),l!==A?(Jt=t,t=r=Z(o,a)):(Bt=t,t=k)):(Bt=t,t=k)):(Bt=t,t=k),t}function f(){var t;return(t=p())===A&&(t=h())===A&&(t=m())===A&&(t=d()),t}function p(){var t,r,o,a,i,l;return t=Bt,e.substr(Bt,6)===B?(r=B,Bt+=6):(r=A,0===Xt&&n(J)),r===A&&(e.substr(Bt,4)===$?(r=$,Bt+=4):(r=A,0===Xt&&n(z)),r===A&&(e.substr(Bt,4)===K?(r=K,Bt+=4):(r=A,0===Xt&&n(Q)))),r!==A&&w()!==A?(o=Bt,44===e.charCodeAt(Bt)?(a=G,Bt++):(a=A,0===Xt&&n(H)),a!==A&&(i=w())!==A&&(l=C())!==A?o=a=[a,i,l]:(Bt=o,o=k),o===A&&(o=q),o!==A?(Jt=t,t=r=X(r,o)):(Bt=t,t=k)):(Bt=t,t=k),t}function h(){var t,r,o,a;return t=Bt,e.substr(Bt,6)===Y?(r=Y,Bt+=6):(r=A,0===Xt&&n(tt)),r!==A&&w()!==A?(44===e.charCodeAt(Bt)?(o=G,Bt++):(o=A,0===Xt&&n(H)),o!==A&&w()!==A&&(a=_())!==A?(Jt=t,t=r=et(a)):(Bt=t,t=k)):(Bt=t,t=k),t}function m(){var t,r,o,a;return t=Bt,e.substr(Bt,13)===rt?(r=rt,Bt+=13):(r=A,0===Xt&&n(nt)),r!==A&&w()!==A?(44===e.charCodeAt(Bt)?(o=G,Bt++):(o=A,0===Xt&&n(H)),o!==A&&w()!==A&&(a=_())!==A?(Jt=t,t=r=ot(a)):(Bt=t,t=k)):(Bt=t,t=k),t}function d(){var t,r,o,a,i;if(t=Bt,e.substr(Bt,6)===at?(r=at,Bt+=6):(r=A,0===Xt&&n(it)),r!==A)if(w()!==A)if(44===e.charCodeAt(Bt)?(o=G,Bt++):(o=A,0===Xt&&n(H)),o!==A)if(w()!==A){if(a=[],(i=y())!==A)for(;i!==A;)a.push(i),i=y();else a=k;a!==A?(Jt=t,t=r=lt(a)):(Bt=t,t=k)}else Bt=t,t=k;else Bt=t,t=k;else Bt=t,t=k;else Bt=t,t=k;return t}function v(){var t,r,o,a;return t=Bt,r=Bt,61===e.charCodeAt(Bt)?(o=ut,Bt++):(o=A,0===Xt&&n(st)),o!==A&&(a=x())!==A?r=o=[o,a]:(Bt=r,r=k),r!==A&&(r=e.substring(t,Bt)),(t=r)===A&&(t=C()),t}function y(){var t,r,o,i,l;return t=Bt,w()!==A&&(r=v())!==A&&w()!==A?(123===e.charCodeAt(Bt)?(o=S,Bt++):(o=A,0===Xt&&n(U)),o!==A&&w()!==A&&(i=a())!==A&&w()!==A?(125===e.charCodeAt(Bt)?(l=W,Bt++):(l=A,0===Xt&&n(V)),l!==A?(Jt=t,t=ct(r,i)):(Bt=t,t=k)):(Bt=t,t=k)):(Bt=t,t=k),t}function g(){var t,r,o;return t=Bt,e.substr(Bt,7)===ft?(r=ft,Bt+=7):(r=A,0===Xt&&n(pt)),r!==A&&w()!==A&&(o=x())!==A?(Jt=t,t=r=ht(o)):(Bt=t,t=k),t}function _(){var t,e,r,n;if(t=Bt,(e=g())===A&&(e=q),e!==A)if(w()!==A){if(r=[],(n=y())!==A)for(;n!==A;)r.push(n),n=y();else r=k;r!==A?(Jt=t,t=e=mt(e,r)):(Bt=t,t=k)}else Bt=t,t=k;else Bt=t,t=k;return t}function b(){var t,r;if(Xt++,t=[],vt.test(e.charAt(Bt))?(r=e.charAt(Bt),Bt++):(r=A,0===Xt&&n(yt)),r!==A)for(;r!==A;)t.push(r),vt.test(e.charAt(Bt))?(r=e.charAt(Bt),Bt++):(r=A,0===Xt&&n(yt));else t=k;return Xt--,t===A&&(r=A,0===Xt&&n(dt)),t}function w(){var t,r,o;for(Xt++,t=Bt,r=[],o=b();o!==A;)r.push(o),o=b();return r!==A&&(r=e.substring(t,Bt)),t=r,Xt--,t===A&&(r=A,0===Xt&&n(gt)),t}function F(){var t;return _t.test(e.charAt(Bt))?(t=e.charAt(Bt),Bt++):(t=A,0===Xt&&n(bt)),t}function O(){var t;return wt.test(e.charAt(Bt))?(t=e.charAt(Bt),Bt++):(t=A,0===Xt&&n(Ft)),t}function x(){var t,r,o,a,i,l;if(t=Bt,48===e.charCodeAt(Bt)?(r=Ot,Bt++):(r=A,0===Xt&&n(xt)),r===A){if(r=Bt,o=Bt,jt.test(e.charAt(Bt))?(a=e.charAt(Bt),Bt++):(a=A,0===Xt&&n(Ct)),a!==A){for(i=[],l=F();l!==A;)i.push(l),l=F();i!==A?o=a=[a,i]:(Bt=o,o=k)}else Bt=o,o=k;o!==A&&(o=e.substring(r,Bt)),r=o}return r!==A&&(Jt=t,r=Pt(r)),t=r}function j(){var t,r,o,a,i,l,u,s;return Tt.test(e.charAt(Bt))?(t=e.charAt(Bt),Bt++):(t=A,0===Xt&&n(At)),t===A&&(t=Bt,e.substr(Bt,2)===Nt?(r=Nt,Bt+=2):(r=A,0===Xt&&n(Mt)),r!==A&&(Jt=t,r=Rt()),(t=r)===A&&(t=Bt,e.substr(Bt,2)===kt?(r=kt,Bt+=2):(r=A,0===Xt&&n(Dt)),r!==A&&(Jt=t,r=Et()),(t=r)===A&&(t=Bt,e.substr(Bt,2)===It?(r=It,Bt+=2):(r=A,0===Xt&&n(Lt)),r!==A&&(Jt=t,r=St()),(t=r)===A&&(t=Bt,e.substr(Bt,2)===Ut?(r=Ut,Bt+=2):(r=A,0===Xt&&n(qt)),r!==A&&(Jt=t,r=Gt()),(t=r)===A&&(t=Bt,e.substr(Bt,2)===Ht?(r=Ht,Bt+=2):(r=A,0===Xt&&n(Wt)),r!==A?(o=Bt,a=Bt,(i=O())!==A&&(l=O())!==A&&(u=O())!==A&&(s=O())!==A?a=i=[i,l,u,s]:(Bt=a,a=k),a!==A&&(a=e.substring(o,Bt)),(o=a)!==A?(Jt=t,t=r=Vt(o)):(Bt=t,t=k)):(Bt=t,t=k)))))),t}function C(){var t,e,r;if(t=Bt,e=[],(r=j())!==A)for(;r!==A;)e.push(r),r=j();else e=k;return e!==A&&(Jt=t,e=Zt(e)),t=e}var P,T=arguments.length>1?arguments[1]:{},A={},N={start:o},M=o,R=function(t){return{type:"messageFormatPattern",elements:t}},k=A,D=function(t){var e,r,n,o,a,i="";for(e=0,n=t.length;e<n;e+=1)for(r=0,a=(o=t[e]).length;r<a;r+=1)i+=o[r];return i},E=function(t){return{type:"messageTextElement",value:t}},I=/^[^ \t\n\r,.+={}#]/,L={type:"class",value:"[^ \\t\\n\\r,.+={}#]",description:"[^ \\t\\n\\r,.+={}#]"},S="{",U={type:"literal",value:"{",description:'"{"'},q=null,G=",",H={type:"literal",value:",",description:'","'},W="}",V={type:"literal",value:"}",description:'"}"'},Z=function(t,e){return{type:"argumentElement",id:t,format:e&&e[2]}},B="number",J={type:"literal",value:"number",description:'"number"'},$="date",z={type:"literal",value:"date",description:'"date"'},K="time",Q={type:"literal",value:"time",description:'"time"'},X=function(t,e){return{type:t+"Format",style:e&&e[2]}},Y="plural",tt={type:"literal",value:"plural",description:'"plural"'},et=function(t){return{type:t.type,ordinal:!1,offset:t.offset||0,options:t.options}},rt="selectordinal",nt={type:"literal",value:"selectordinal",description:'"selectordinal"'},ot=function(t){return{type:t.type,ordinal:!0,offset:t.offset||0,options:t.options}},at="select",it={type:"literal",value:"select",description:'"select"'},lt=function(t){return{type:"selectFormat",options:t}},ut="=",st={type:"literal",value:"=",description:'"="'},ct=function(t,e){return{type:"optionalFormatPattern",selector:t,value:e}},ft="offset:",pt={type:"literal",value:"offset:",description:'"offset:"'},ht=function(t){return t},mt=function(t,e){return{type:"pluralFormat",offset:t,options:e}},dt={type:"other",description:"whitespace"},vt=/^[ \t\n\r]/,yt={type:"class",value:"[ \\t\\n\\r]",description:"[ \\t\\n\\r]"},gt={type:"other",description:"optionalWhitespace"},_t=/^[0-9]/,bt={type:"class",value:"[0-9]",description:"[0-9]"},wt=/^[0-9a-f]/i,Ft={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},Ot="0",xt={type:"literal",value:"0",description:'"0"'},jt=/^[1-9]/,Ct={type:"class",value:"[1-9]",description:"[1-9]"},Pt=function(t){return parseInt(t,10)},Tt=/^[^{}\\\0-\x1F \t\n\r]/,At={type:"class",value:"[^{}\\\\\\0-\\x1F \\t\\n\\r]",description:"[^{}\\\\\\0-\\x1F \\t\\n\\r]"},Nt="\\\\",Mt={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},Rt=function(){return"\\"},kt="\\#",Dt={type:"literal",value:"\\#",description:'"\\\\#"'},Et=function(){return"\\#"},It="\\{",Lt={type:"literal",value:"\\{",description:'"\\\\{"'},St=function(){return"{"},Ut="\\}",qt={type:"literal",value:"\\}",description:'"\\\\}"'},Gt=function(){return"}"},Ht="\\u",Wt={type:"literal",value:"\\u",description:'"\\\\u"'},Vt=function(t){return String.fromCharCode(parseInt(t,16))},Zt=function(t){return t.join("")},Bt=0,Jt=0,$t=0,zt={line:1,column:1,seenCR:!1},Kt=0,Qt=[],Xt=0;if("startRule"in T){if(!(T.startRule in N))throw new Error("Can't start parsing from rule \""+T.startRule+'".');M=N[T.startRule]}if((P=M())!==A&&Bt===e.length)return P;throw P!==A&&Bt<e.length&&n({type:"end",description:"end of input"}),function(n,o,a){var i=r(a),l=a<e.length?e.charAt(a):null;return null!==o&&function(t){var e=1;for(t.sort(function(t,e){return t.description<e.description?-1:t.description>e.description?1:0});e<t.length;)t[e-1]===t[e]?t.splice(e,1):e++}(o),new t(null!==n?n:function(t,e){var r,n,o,a=new Array(t.length);for(o=0;o<t.length;o++)a[o]=t[o].description;return r=t.length>1?a.slice(0,-1).join(", ")+" or "+a[t.length-1]:a[0],n=e?'"'+function(t){function r(t){return t.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(t){return"\\x0"+r(t)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(t){return"\\x"+r(t)}).replace(/[\u0180-\u0FFF]/g,function(t){return"\\u0"+r(t)}).replace(/[\u1080-\uFFFF]/g,function(t){return"\\u"+r(t)})}()+'"':"end of input","Expected "+r+" but "+n+" found."}(o,l),o,l,a,i.line,i.column)}(null,Qt,Kt)}}}();E(s,"formats",{enumerable:!0,value:{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(s,"__localeData__",{value:I(null)}),E(s,"__addLocaleData",{value:function(t){if(!t||!t.locale)throw new Error("Locale data provided to IntlMessageFormat is missing a `locale` property");s.__localeData__[t.locale.toLowerCase()]=t}}),E(s,"__parse",{value:L.parse}),E(s,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),s.prototype.resolvedOptions=function(){return{locale:this._locale}},s.prototype._compilePattern=function(t,e,r,n){return new o(e,r,n).compile(t)},s.prototype._findPluralRuleFunction=function(t){for(var e=s.__localeData__,r=e[t.toLowerCase()];r;){if(r.pluralRuleFunction)return r.pluralRuleFunction;r=r.parentLocale&&e[r.parentLocale.toLowerCase()]}throw new Error("Locale data added to IntlMessageFormat is missing a `pluralRuleFunction` for :"+t)},s.prototype._format=function(t,e){var r,n,o,a,i,l,u="";for(r=0,n=t.length;r<n;r+=1)if("string"!=typeof(o=t[r])){if(a=o.id,!e||!D.call(e,a))throw l=new Error("A value must be provided for: "+a),l.variableId=a,l;i=e[a],o.options?u+=this._format(o.getOption(i),e):u+=o.format(i)}else u+=o;return u},s.prototype._mergeFormats=function(t,e){var r,o,a={};for(r in t)D.call(t,r)&&(a[r]=o=I(t[r]),e&&D.call(e,r)&&n(o,e[r]));return a},s.prototype._resolveLocale=function(t){"string"==typeof t&&(t=[t]),t=(t||[]).concat(s.defaultLocale);var e,r,n,o,a=s.__localeData__;for(e=0,r=t.length;e<r;e+=1)for(n=t[e].toLowerCase().split("-");n.length;){if(o=a[n.join("-")])return o.locale;n.pop()}var i=t.pop();throw new Error("No locale data has been added to IntlMessageFormat for: "+t.join(", ")+", or the default locale: "+i)};var S={locale:"en",pluralRuleFunction:function(t,e){var r=String(t).split("."),n=!r[1],o=Number(r[0])==t,a=o&&r[0].slice(-1),i=o&&r[0].slice(-2);return e?1==a&&11!=i?"one":2==a&&12!=i?"two":3==a&&13!=i?"few":"other":1==t&&n?"one":"other"}};s.__addLocaleData(S),s.defaultLocale="en";var U=Math.round,q=function(t,e){var r=U((e=+e)-(t=+t)),n=U(r/1e3),o=U(n/60),a=U(o/60),i=U(a/24),l=U(i/7),u=c(i);return{millisecond:r,second:n,minute:o,hour:a,day:i,week:l,month:U(12*u),year:U(u)}},G=Object.prototype.hasOwnProperty,H=Object.prototype.toString,W=function(){try{return!!Object.defineProperty({},"a",{})}catch(t){return!1}}()?Object.defineProperty:function(t,e,r){"get"in r&&t.__defineGetter__?t.__defineGetter__(e,r.get):(!G.call(t,e)||"value"in r)&&(t[e]=r.value)},V=Object.create||function(t,e){function r(){}var n,o;r.prototype=t,n=new r;for(o in e)G.call(e,o)&&W(n,o,e[o]);return n},Z=Array.prototype.indexOf||function(t,e){var r=this;if(!r.length)return-1;for(var n=e||0,o=r.length;n<o;n++)if(r[n]===t)return n;return-1},B=Array.isArray||function(t){return"[object Array]"===H.call(t)},J=Date.now||function(){return(new Date).getTime()},$=["second","minute","hour","day","month","year"],z=["best fit","numeric"];W(f,"__localeData__",{value:V(null)}),W(f,"__addLocaleData",{value:function(t){if(!t||!t.locale)throw new Error("Locale data provided to IntlRelativeFormat is missing a `locale` property value");f.__localeData__[t.locale.toLowerCase()]=t,s.__addLocaleData(t)}}),W(f,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),W(f,"thresholds",{enumerable:!0,value:{second:45,minute:45,hour:22,day:26,month:11}}),f.prototype.resolvedOptions=function(){return{locale:this._locale,style:this._options.style,units:this._options.units}},f.prototype._compileMessage=function(t){var e,r=this._locales,n=(this._locale,this._fields[t].relativeTime),o="",a="";for(e in n.future)n.future.hasOwnProperty(e)&&(o+=" "+e+" {"+n.future[e].replace("{0}","#")+"}");for(e in n.past)n.past.hasOwnProperty(e)&&(a+=" "+e+" {"+n.past[e].replace("{0}","#")+"}");return new s("{when, select, future {{0, plural, "+o+"}}past {{0, plural, "+a+"}}}",r)},f.prototype._getMessage=function(t){var e=this._messages;return e[t]||(e[t]=this._compileMessage(t)),e[t]},f.prototype._getRelativeUnits=function(t,e){var r=this._fields[e];if(r.relative)return r.relative[t]},f.prototype._findFields=function(t){for(var e=f.__localeData__,r=e[t.toLowerCase()];r;){if(r.fields)return r.fields;r=r.parentLocale&&e[r.parentLocale.toLowerCase()]}throw new Error("Locale data added to IntlRelativeFormat is missing `fields` for :"+t)},f.prototype._format=function(t,e){var r=e&&void 0!==e.now?e.now:J();if(void 0===t&&(t=r),!isFinite(r))throw new RangeError("The `now` option provided to IntlRelativeFormat#format() is not in valid range.");if(!isFinite(t))throw new RangeError("The date value provided to IntlRelativeFormat#format() is not in valid range.");var n=q(r,t),o=this._options.units||this._selectUnits(n),a=n[o];if("numeric"!==this._options.style){var i=this._getRelativeUnits(a,o);if(i)return i}return this._getMessage(o).format({0:Math.abs(a),when:a<0?"past":"future"})},f.prototype._isValidUnits=function(t){if(!t||Z.call($,t)>=0)return!0;if("string"==typeof t){var e=/s$/.test(t)&&t.substr(0,t.length-1);if(e&&Z.call($,e)>=0)throw new Error('"'+t+'" is not a valid IntlRelativeFormat `units` value, did you mean: '+e)}throw new Error('"'+t+'" is not a valid IntlRelativeFormat `units` value, it must be one of: "'+$.join('", "')+'"')},f.prototype._resolveLocale=function(t){"string"==typeof t&&(t=[t]),t=(t||[]).concat(f.defaultLocale);var e,r,n,o,a=f.__localeData__;for(e=0,r=t.length;e<r;e+=1)for(n=t[e].toLowerCase().split("-");n.length;){if(o=a[n.join("-")])return o.locale;n.pop()}var i=t.pop();throw new Error("No locale data has been added to IntlRelativeFormat for: "+t.join(", ")+", or the default locale: "+i)},f.prototype._resolveStyle=function(t){if(!t)return z[0];if(Z.call(z,t)>=0)return t;throw new Error('"'+t+'" is not a valid IntlRelativeFormat `style` value, it must be one of: "'+z.join('", "')+'"')},f.prototype._selectUnits=function(t){var e,r,n;for(e=0,r=$.length;e<r&&(n=$[e],!(Math.abs(t[n])<f.thresholds[n]));e+=1);return n};var K={locale:"en",pluralRuleFunction:function(t,e){var r=String(t).split("."),n=!r[1],o=Number(r[0])==t,a=o&&r[0].slice(-1),i=o&&r[0].slice(-2);return e?1==a&&11!=i?"one":2==a&&12!=i?"two":3==a&&13!=i?"few":"other":1==t&&n?"one":"other"},fields:{year:{displayName:"year",relative:{0:"this year",1:"next year","-1":"last year"},relativeTime:{future:{one:"in {0} year",other:"in {0} years"},past:{one:"{0} year ago",other:"{0} years ago"}}},month:{displayName:"month",relative:{0:"this month",1:"next month","-1":"last month"},relativeTime:{future:{one:"in {0} month",other:"in {0} months"},past:{one:"{0} month ago",other:"{0} months ago"}}},day:{displayName:"day",relative:{0:"today",1:"tomorrow","-1":"yesterday"},relativeTime:{future:{one:"in {0} day",other:"in {0} days"},past:{one:"{0} day ago",other:"{0} days ago"}}},hour:{displayName:"hour",relativeTime:{future:{one:"in {0} hour",other:"in {0} hours"},past:{one:"{0} hour ago",other:"{0} hours ago"}}},minute:{displayName:"minute",relativeTime:{future:{one:"in {0} minute",other:"in {0} minutes"},past:{one:"{0} minute ago",other:"{0} minutes ago"}}},second:{displayName:"second",relative:{0:"now"},relativeTime:{future:{one:"in {0} second",other:"in {0} seconds"},past:{one:"{0} second ago",other:"{0} seconds ago"}}}}};f.__addLocaleData(K),f.defaultLocale="en";var Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},X=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Y=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),tt=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},et=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},rt=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},nt=function(t,e){var r={};for(var n in t)e.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r},ot=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},at=function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)},it=e.bool,lt=e.number,ut=e.string,st=e.func,ct=e.object,ft=e.oneOf,pt=e.shape,ht=e.any,mt=e.oneOfType,dt=ft(["best fit","lookup"]),vt=ft(["narrow","short","long"]),yt=ft(["numeric","2-digit"]),gt=st.isRequired,_t={locale:ut,formats:ct,messages:ct,textComponent:ht,defaultLocale:ut,defaultFormats:ct},bt={formatDate:gt,formatTime:gt,formatRelative:gt,formatNumber:gt,formatPlural:gt,formatMessage:gt,formatHTMLMessage:gt},wt=pt(et({},_t,bt,{formatters:ct,now:gt})),Ft=(ut.isRequired,mt([ut,ct]),{localeMatcher:dt,formatMatcher:ft(["basic","best fit"]),timeZone:ut,hour12:it,weekday:vt,era:vt,year:yt,month:ft(["numeric","2-digit","narrow","short","long"]),day:yt,hour:yt,minute:yt,second:yt,timeZoneName:ft(["short","long"])}),Ot={localeMatcher:dt,style:ft(["decimal","currency","percent"]),currency:ut,currencyDisplay:ft(["symbol","code","name"]),useGrouping:it,minimumIntegerDigits:lt,minimumFractionDigits:lt,maximumFractionDigits:lt,minimumSignificantDigits:lt,maximumSignificantDigits:lt},xt={style:ft(["best fit","numeric"]),units:ft(["second","minute","hour","day","month","year"])},jt={style:ft(["cardinal","ordinal"])},Ct=function(t,e,r,n,o,a,i,l){if(!t){var u;if(void 0===e)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[r,n,o,a,i,l],c=0;(u=new Error(e.replace(/%s/g,function(){return s[c++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}},Pt=Object.keys(_t),Tt={"&":"&",">":">","<":"<",'"':""","'":"'"},At=/[&><"']/g,Nt=function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};X(this,t);var n="ordinal"===r.style,o=F(w(e));this.format=function(t){return o(t,n)}},Mt=Function.prototype.bind||function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),r=this,n=function(){},o=function(){return r.apply(this instanceof n?this:t,e.concat(Array.prototype.slice.call(arguments)))};return this.prototype&&(n.prototype=this.prototype),o.prototype=new n,o},Rt=Object.prototype.hasOwnProperty,kt=function(){try{return!!Object.defineProperty({},"a",{})}catch(t){return!1}}()?Object.defineProperty:function(t,e,r){"get"in r&&t.__defineGetter__?t.__defineGetter__(e,r.get):(!Rt.call(t,e)||"value"in r)&&(t[e]=r.value)},Dt=Object.create||function(t,e){function r(){}var n,o;r.prototype=t,n=new r;for(o in e)Rt.call(e,o)&&kt(n,o,e[o]);return n},Et=Object.keys(Ft),It=Object.keys(Ot),Lt=Object.keys(xt),St=Object.keys(jt),Ut={second:60,minute:60,hour:24,day:30,month:12},qt=Object.freeze({formatDate:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.locale,a=t.formats,i=n.format,l=new Date(r),u=i&&P(a,"date",i),s=v(n,Et,u);try{return e.getDateTimeFormat(o,s).format(l)}catch(t){}return String(l)},formatTime:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.locale,a=t.formats,i=n.format,l=new Date(r),u=i&&P(a,"time",i),s=v(n,Et,u);s.hour||s.minute||s.second||(s=et({},s,{hour:"numeric",minute:"numeric"}));try{return e.getDateTimeFormat(o,s).format(l)}catch(t){}return String(l)},formatRelative:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.locale,a=t.formats,i=n.format,l=new Date(r),u=new Date(n.now),s=i&&P(a,"relative",i),c=v(n,Lt,s),p=et({},f.thresholds);C(Ut);try{return e.getRelativeFormat(o,c).format(l,{now:isFinite(u)?u:e.now()})}catch(t){}finally{C(p)}return String(l)},formatNumber:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.locale,a=t.formats,i=n.format,l=i&&P(a,"number",i),u=v(n,It,l);try{return e.getNumberFormat(o,u).format(r)}catch(t){}return String(r)},formatPlural:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.locale,a=v(n,St);try{return e.getPluralFormat(o,a).format(r)}catch(t){}return"other"},formatMessage:T,formatHTMLMessage:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return T(t,e,r,Object.keys(n).reduce(function(t,e){var r=n[e];return t[e]="string"==typeof r?d(r):r,t},{}))}}),Gt=Object.keys(_t),Ht=Object.keys(bt),Wt={formats:{},messages:{},textComponent:"span",defaultLocale:"en",defaultFormats:{}},Vt=function(t){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};X(this,e);var n=ot(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));Ct("undefined"!=typeof Intl,"[React Intl] The `Intl` APIs must be available in the runtime, and do not appear to be built-in. An `Intl` polyfill should be loaded.\nSee: http://formatjs.io/guides/runtime-environments/");var o=r.intl,a=void 0;a=isFinite(t.initialNow)?Number(t.initialNow):o?o.now():Date.now();var i=(o||{}).formatters,l=void 0===i?{getDateTimeFormat:O(Intl.DateTimeFormat),getNumberFormat:O(Intl.NumberFormat),getMessageFormat:O(s),getRelativeFormat:O(f),getPluralFormat:O(Nt)}:i;return n.state=et({},l,{now:function(){return n._didDisplay?Date.now():a}}),n}return rt(e,t),Y(e,[{key:"getConfig",value:function(){var t=this.context.intl,e=v(this.props,Gt,t);for(var r in Wt)void 0===e[r]&&(e[r]=Wt[r]);if(!h(e.locale)){var n=e,o=(n.locale,n.defaultLocale),a=n.defaultFormats;e=et({},e,{locale:o,formats:a,messages:Wt.messages})}return e}},{key:"getBoundFormatFns",value:function(t,e){return Ht.reduce(function(r,n){return r[n]=qt[n].bind(null,t,e),r},{})}},{key:"getChildContext",value:function(){var t=this.getConfig(),e=this.getBoundFormatFns(t,this.state),r=this.state,n=r.now,o=nt(r,["now"]);return{intl:et({},t,e,{formatters:o,now:n})}}},{key:"shouldComponentUpdate",value:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return _.apply(void 0,[this].concat(e))}},{key:"componentDidMount",value:function(){this._didDisplay=!0}},{key:"render",value:function(){return r.Children.only(this.props.children)}}]),e}(r.Component);Vt.displayName="IntlProvider",Vt.contextTypes={intl:wt},Vt.childContextTypes={intl:wt.isRequired};var Zt=function(t){function e(t,r){X(this,e);var n=ot(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return y(r),n}return rt(e,t),Y(e,[{key:"shouldComponentUpdate",value:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return _.apply(void 0,[this].concat(e))}},{key:"render",value:function(){var t=this.context.intl,e=t.formatDate,r=t.textComponent,n=this.props,o=n.value,a=n.children,i=e(o,this.props);return"function"==typeof a?a(i):R.createElement(r,null,i)}}]),e}(r.Component);Zt.displayName="FormattedDate",Zt.contextTypes={intl:wt};var Bt=function(t){function e(t,r){X(this,e);var n=ot(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return y(r),n}return rt(e,t),Y(e,[{key:"shouldComponentUpdate",value:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return _.apply(void 0,[this].concat(e))}},{key:"render",value:function(){var t=this.context.intl,e=t.formatTime,r=t.textComponent,n=this.props,o=n.value,a=n.children,i=e(o,this.props);return"function"==typeof a?a(i):R.createElement(r,null,i)}}]),e}(r.Component);Bt.displayName="FormattedTime",Bt.contextTypes={intl:wt};var Jt=1e3,$t=6e4,zt=36e5,Kt=864e5,Qt=2147483647,Xt=function(t){function e(t,r){X(this,e);var n=ot(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));y(r);var o=isFinite(t.initialNow)?Number(t.initialNow):r.intl.now();return n.state={now:o},n}return rt(e,t),Y(e,[{key:"scheduleNextUpdate",value:function(t,e){var r=this;clearTimeout(this._timer);var n=t.value,o=t.units,a=t.updateInterval,i=new Date(n).getTime();if(a&&isFinite(i)){var l=i-e.now,u=N(o||A(l)),s=Math.abs(l%u),c=l<0?Math.max(a,u-s):Math.max(a,s);this._timer=setTimeout(function(){r.setState({now:r.context.intl.now()})},c)}}},{key:"componentDidMount",value:function(){this.scheduleNextUpdate(this.props,this.state)}},{key:"componentWillReceiveProps",value:function(t){M(t.value,this.props.value)||this.setState({now:this.context.intl.now()})}},{key:"shouldComponentUpdate",value:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return _.apply(void 0,[this].concat(e))}},{key:"componentWillUpdate",value:function(t,e){this.scheduleNextUpdate(t,e)}},{key:"componentWillUnmount",value:function(){clearTimeout(this._timer)}},{key:"render",value:function(){var t=this.context.intl,e=t.formatRelative,r=t.textComponent,n=this.props,o=n.value,a=n.children,i=e(o,et({},this.props,this.state));return"function"==typeof a?a(i):R.createElement(r,null,i)}}]),e}(r.Component);Xt.displayName="FormattedRelative",Xt.contextTypes={intl:wt},Xt.defaultProps={updateInterval:1e4};var Yt=function(t){function e(t,r){X(this,e);var n=ot(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return y(r),n}return rt(e,t),Y(e,[{key:"shouldComponentUpdate",value:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return _.apply(void 0,[this].concat(e))}},{key:"render",value:function(){var t=this.context.intl,e=t.formatNumber,r=t.textComponent,n=this.props,o=n.value,a=n.children,i=e(o,this.props);return"function"==typeof a?a(i):R.createElement(r,null,i)}}]),e}(r.Component);Yt.displayName="FormattedNumber",Yt.contextTypes={intl:wt};var te=function(t){function e(t,r){X(this,e);var n=ot(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return y(r),n}return rt(e,t),Y(e,[{key:"shouldComponentUpdate",value:function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];return _.apply(void 0,[this].concat(e))}},{key:"render",value:function(){var t=this.context.intl,e=t.formatPlural,r=t.textComponent,n=this.props,o=n.value,a=n.other,i=n.children,l=e(o,this.props),u=this.props[l]||a;return"function"==typeof i?i(u):R.createElement(r,null,u)}}]),e}(r.Component);te.displayName="FormattedPlural",te.contextTypes={intl:wt},te.defaultProps={style:"cardinal"};var ee=function(t){function e(t,r){X(this,e);var n=ot(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return y(r),n}return rt(e,t),Y(e,[{key:"shouldComponentUpdate",value:function(t){var e=this.props.values;if(!g(t.values,e))return!0;for(var r=et({},t,{values:e}),n=arguments.length,o=Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return _.apply(void 0,[this,r].concat(o))}},{key:"render",value:function(){var t=this.context.intl,e=t.formatMessage,n=t.textComponent,o=this.props,a=o.id,i=o.description,l=o.defaultMessage,u=o.values,s=o.tagName,c=void 0===s?n:s,f=o.children,p=void 0,h=void 0,m=void 0;if(u&&Object.keys(u).length>0){var d=Math.floor(1099511627776*Math.random()).toString(16),v=function(){var t=0;return function(){return"ELEMENT-"+d+"-"+(t+=1)}}();p="@__"+d+"__@",h={},m={},Object.keys(u).forEach(function(t){var e=u[t];if(r.isValidElement(e)){var n=v();h[t]=p+n+p,m[n]=e}else h[t]=e})}var y=e({id:a,description:i,defaultMessage:l},h||u),g=void 0;return g=m&&Object.keys(m).length>0?y.split(p).filter(function(t){return!!t}).map(function(t){return m[t]||t}):[y],"function"==typeof f?f.apply(void 0,at(g)):r.createElement.apply(void 0,[c,null].concat(at(g)))}}]),e}(r.Component);ee.displayName="FormattedMessage",ee.contextTypes={intl:wt},ee.defaultProps={values:{}};var re=function(t){function e(t,r){X(this,e);var n=ot(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,r));return y(r),n}return rt(e,t),Y(e,[{key:"shouldComponentUpdate",value:function(t){var e=this.props.values;if(!g(t.values,e))return!0;for(var r=et({},t,{values:e}),n=arguments.length,o=Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return _.apply(void 0,[this,r].concat(o))}},{key:"render",value:function(){var t=this.context.intl,e=t.formatHTMLMessage,r=t.textComponent,n=this.props,o=n.id,a=n.description,i=n.defaultMessage,l=n.values,u=n.tagName,s=void 0===u?r:u,c=n.children,f=e({id:o,description:a,defaultMessage:i},l);if("function"==typeof c)return c(f);var p={__html:f};return R.createElement(s,{dangerouslySetInnerHTML:p})}}]),e}(r.Component);re.displayName="FormattedHTMLMessage",re.contextTypes={intl:wt},re.defaultProps={values:{}},p(k),t.addLocaleData=p,t.intlShape=wt,t.injectIntl=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.intlPropName,o=void 0===n?"intl":n,a=e.withRef,i=void 0!==a&&a,l=function(e){function r(t,e){X(this,r);var n=ot(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,t,e));return y(e),n}return rt(r,e),Y(r,[{key:"getWrappedInstance",value:function(){return Ct(i,"[React Intl] To access the wrapped instance, the `{withRef: true}` option must be set when calling: `injectIntl()`"),this.refs.wrappedInstance}},{key:"render",value:function(){return R.createElement(t,et({},this.props,tt({},o,this.context.intl),{ref:i?"wrappedInstance":null}))}}]),r}(r.Component);return l.displayName="InjectIntl("+b(t)+")",l.contextTypes={intl:wt},l.WrappedComponent=t,l},t.defineMessages=function(t){return t},t.IntlProvider=Vt,t.FormattedDate=Zt,t.FormattedTime=Bt,t.FormattedRelative=Xt,t.FormattedNumber=Yt,t.FormattedPlural=te,t.FormattedMessage=ee,t.FormattedHTMLMessage=re,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=react-intl.min.js.map