Comparing version 0.3.0 to 0.4.0
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.VueIntl=e()}(this,function(){"use strict";function t(t){var e,r,n,o,a=Array.prototype.slice.call(arguments,1);for(e=0,r=a.length;r>e;e+=1)if(n=a[e])for(o in n)x.call(n,o)&&(t[o]=n[o]);return t}function e(t,e,r){this.locales=t,this.formats=e,this.pluralFn=r}function r(t){this.id=t}function n(t,e,r,n,o){this.id=t,this.useOrdinal=e,this.offset=r,this.options=n,this.pluralFn=o}function o(t,e,r,n){this.id=t,this.offset=e,this.numberFormat=r,this.string=n}function a(t,e){this.id=t,this.options=e}function i(t,e,r){var n="string"==typeof t?i.__parse(t):t;if(!n||"messageFormatPattern"!==n.type)throw new TypeError("A message must be provided as a String or AST.");r=this._mergeFormats(i.formats,r),E(this,"_locale",{value:this._resolveLocale(e)});var o=this._findPluralRuleFunction(this._locale),a=this._compilePattern(n,e,r,o),l=this;this.format=function(t){return l._format(a,t)}}function l(t){return 400*t/146097}function u(t,e){t=+t,e=+e;var r=I(e-t),n=I(r/1e3),o=I(n/60),a=I(o/60),i=I(a/24),u=I(i/7),s=l(i),c=I(12*s),f=I(s);return{millisecond:r,second:n,minute:o,hour:a,day:i,week:u,month:c,year:f}}function s(t,e){e=e||{},B(t)&&(t=t.concat()),$(this,"_locale",{value:this._resolveLocale(t)}),$(this,"_options",{value:{style:this._resolveStyle(e.style),units:this._isValidUnits(e.units)&&e.units}}),$(this,"_locales",{value:t}),$(this,"_fields",{value:this._findFields(this._locale)}),$(this,"_messages",{value:V(null)});var r=this;this.format=function(t,e){return r._format(t,e)}}function c(){var t=arguments.length<=0||void 0===arguments[0]?[]:arguments[0],e=Array.isArray(t)?t:[t];e.forEach(function(t){t&&t.locale&&(i.__addLocaleData(t),s.__addLocaleData(t))})}function f(t,e,r){t.__allMessages=t.__allMessages||{},t.__allMessages[e]=t.__allMessages[e]||{},Object.assign(t.__allMessages[e],r)}function p(t,e,r){t.__allFormats=t.__allFormats||{},t.__allFormats[e]=t.__allFormats[e]||{},Object.assign(t.__allFormats[e],r)}function m(t,e){t.$set("locale",e);var r=Object.getOwnPropertyNames((t.__allFormats||{})[e]||{}).length>0;t.__format_config.formats=r?t.__allFormats[e]:t.__format_config.defaultFormats,t.__format_config.messages=(t.__allMessages||{})[e]||{}}function h(t){return i.prototype._resolveLocale(t)}function d(t){return i.prototype._findPluralRuleFunction(t)}function y(t){var e=tt(null);return function(){var r=Array.prototype.slice.call(arguments),n=v(r),o=n&&e[n];return o||(o=new(K.apply(t,[null].concat(r))),n&&(e[n]=o)),o}}function v(t){if("undefined"!=typeof JSON){var e,r,n,o=[];for(e=0,r=t.length;r>e;e+=1)n=t[e],n&&"object"===("undefined"==typeof n?"undefined":M["typeof"](n))?o.push(g(n)):o.push(n);return JSON.stringify(o)}}function g(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;n>r;r+=1)e=l[r],o={},o[e]=t[e],a[r]=o;return a}function _(t){return(""+t).replace(ft,function(t){return ct[t]})}function b(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 w(t){var e=s.thresholds;e.second=t.second,e.minute=t.minute,e.hour=t.hour,e.day=t.day,e.month=t.month}function F(t,e,r){var n=t&&t[e]&&t[e][r];return n?n:void 0}function O(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&&F(a,"date",i),s=b(n,pt,u);try{return e.getDateTimeFormat(o,s).format(l)}catch(c){}return String(l)}function A(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&&F(a,"time",i),s=b(n,pt,u);0===Object.keys(s).length&&(s={hour:"numeric",minute:"numeric"});try{return e.getDateTimeFormat(o,s).format(l)}catch(c){}return String(l)}function j(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),c=i&&F(a,"relative",i),f=b(n,ht,c),p=Object.assign({},s.thresholds);w(yt);try{return e.getRelativeFormat(o,f).format(l,{now:isFinite(u)?u:e.now()})}catch(m){}finally{w(p)}return String(l)}function L(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&&F(a,"number",i),u=b(n,mt,l);try{return e.getNumberFormat(o,u).format(r)}catch(s){}return String(r)}function D(t,e,r){var n=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],o=t.locale,a=b(n,dt);try{return e.getPluralFormat(o,a).format(r)}catch(i){}return"other"}function P(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;if(!s)throw new TypeError("[Vue Intl] An `id` must be provided to format a message.");var f=i&&i[s],p=Object.keys(n).length>0;if(!p)return f||c||s;var m=void 0;if(f)try{var h=e.getMessageFormat(f,o,a);m=h.format(n)}catch(d){}if(!m&&c)try{var y=e.getMessageFormat(c,l,u);m=y.format(n)}catch(d){}return m||f||c||s}function C(t,e,r){var n=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],o=Object.keys(n).reduce(function(t,e){var r=n[e];return t[e]="string"==typeof r?_(r):r,t},{});return P(t,e,r,o)}var M={};M["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},M.classCallCheck=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};var x=Object.prototype.hasOwnProperty,R=function(){try{return!!Object.defineProperty({},"a",{})}catch(t){return!1}}(),E=(!R&&!Object.prototype.__defineGetter__,R?Object.defineProperty:function(t,e,r){"get"in r&&t.__defineGetter__?t.__defineGetter__(e,r.get):(!x.call(t,e)||"value"in r)&&(t[e]=r.value)}),S=Object.create||function(t,e){function r(){}var n,o;r.prototype=t,n=new r;for(o in e)x.call(e,o)&&E(n,o,e[o]);return n};e.prototype.compile=function(t){return this.pluralStack=[],this.currentPlural=null,this.pluralNumberFormat=null,this.compileMessage(t)},e.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;r>e;e+=1)switch(n=o[e],n.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},e.prototype.compileMessageText=function(t){return this.currentPlural&&/(^|[^\\])#/g.test(t.value)?(this.pluralNumberFormat||(this.pluralNumberFormat=new Intl.NumberFormat(this.locales)),new o(this.currentPlural.id,this.currentPlural.format.offset,this.pluralNumberFormat,t.value)):t.value.replace(/\\#/g,"#")},e.prototype.compileArgument=function(t){var e=t.format;if(!e)return new r(t.id);var o,i=this.formats,l=this.locales,u=this.pluralFn;switch(e.type){case"numberFormat":return o=i.number[e.style],{id:t.id,format:new Intl.NumberFormat(l,o).format};case"dateFormat":return o=i.date[e.style],{id:t.id,format:new Intl.DateTimeFormat(l,o).format};case"timeFormat":return o=i.time[e.style],{id:t.id,format:new Intl.DateTimeFormat(l,o).format};case"pluralFormat":return o=this.compileOptions(t),new n(t.id,e.ordinal,e.offset,o,u);case"selectFormat":return o=this.compileOptions(t),new a(t.id,o);default:throw new Error("Message element does not have a valid format type")}},e.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;a>o;o+=1)i=r[o],n[i.selector]=this.compileMessage(i.value);return this.currentPlural=this.pluralStack.pop(),n},r.prototype.format=function(t){return t?"string"==typeof t?t:String(t):""},n.prototype.getOption=function(t){var e=this.options,r=e["="+t]||e[this.pluralFn(t-this.offset,this.useOrdinal)];return r||e.other},o.prototype.format=function(t){var e=this.numberFormat.format(t-this.offset);return this.string.replace(/(^|[^\\])#/g,"$1"+e).replace(/\\#/g,"#")},a.prototype.getOption=function(t){var e=this.options;return e[t]||e.other};var N=function(){function t(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function e(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"}function r(t){function r(e){function r(e,r,n){var o,a;for(o=r;n>o;o++)a=t.charAt(o),"\n"===a?(e.seenCR||e.line++,e.column=1,e.seenCR=!1):"\r"===a||"\u2028"===a||"\u2029"===a?(e.line++,e.column=1,e.seenCR=!0):(e.column++,e.seenCR=!1)}return Wt!==e&&(Wt>e&&(Wt=0,Kt={line:1,column:1,seenCR:!1}),r(Kt,Wt,e),Wt=e),Kt}function n(t){Qt>zt||(zt>Qt&&(Qt=zt,Xt=[]),Xt.push(t))}function o(n,o,a){function i(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++}function l(t,e){function r(t){function e(t){return t.charCodeAt(0).toString(16).toUpperCase()}return t.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"+e(t)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(t){return"\\x"+e(t)}).replace(/[\u0180-\u0FFF]/g,function(t){return"\\u0"+e(t)}).replace(/[\u1080-\uFFFF]/g,function(t){return"\\u"+e(t)})}var n,o,a,i=new Array(t.length);for(a=0;a<t.length;a++)i[a]=t[a].description;return n=t.length>1?i.slice(0,-1).join(", ")+" or "+i[t.length-1]:i[0],o=e?'"'+r(e)+'"':"end of input","Expected "+n+" but "+o+" found."}var u=r(a),s=a<t.length?t.charAt(a):null;return null!==o&&i(o),new e(null!==n?n:l(o,s),o,s,a,u.line,u.column)}function a(){var t;return t=i()}function i(){var t,e,r;for(t=zt,e=[],r=l();r!==M;)e.push(r),r=l();return e!==M&&(Ht=t,e=E(e)),t=e}function l(){var t;return t=s(),t===M&&(t=f()),t}function u(){var e,r,n,o,a,i;if(e=zt,r=[],n=zt,o=F(),o!==M?(a=D(),a!==M?(i=F(),i!==M?(o=[o,a,i],n=o):(zt=n,n=S)):(zt=n,n=S)):(zt=n,n=S),n!==M)for(;n!==M;)r.push(n),n=zt,o=F(),o!==M?(a=D(),a!==M?(i=F(),i!==M?(o=[o,a,i],n=o):(zt=n,n=S)):(zt=n,n=S)):(zt=n,n=S);else r=S;return r!==M&&(Ht=e,r=N(r)),e=r,e===M&&(e=zt,r=w(),r!==M&&(r=t.substring(e,zt)),e=r),e}function s(){var t,e;return t=zt,e=u(),e!==M&&(Ht=t,e=T(e)),t=e}function c(){var e,r,o;if(e=j(),e===M){if(e=zt,r=[],I.test(t.charAt(zt))?(o=t.charAt(zt),zt++):(o=M,0===Yt&&n(k)),o!==M)for(;o!==M;)r.push(o),I.test(t.charAt(zt))?(o=t.charAt(zt),zt++):(o=M,0===Yt&&n(k));else r=S;r!==M&&(r=t.substring(e,zt)),e=r}return e}function f(){var e,r,o,a,i,l,u,s,f;return e=zt,123===t.charCodeAt(zt)?(r=G,zt++):(r=M,0===Yt&&n(U)),r!==M?(o=F(),o!==M?(a=c(),a!==M?(i=F(),i!==M?(l=zt,44===t.charCodeAt(zt)?(u=V,zt++):(u=M,0===Yt&&n(Z)),u!==M?(s=F(),s!==M?(f=p(),f!==M?(u=[u,s,f],l=u):(zt=l,l=S)):(zt=l,l=S)):(zt=l,l=S),l===M&&(l=$),l!==M?(u=F(),u!==M?(125===t.charCodeAt(zt)?(s=B,zt++):(s=M,0===Yt&&n(J)),s!==M?(Ht=e,r=q(a,l),e=r):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S),e}function p(){var t;return t=m(),t===M&&(t=h(),t===M&&(t=d(),t===M&&(t=y()))),t}function m(){var e,r,o,a,i,l,u;return e=zt,t.substr(zt,6)===z?(r=z,zt+=6):(r=M,0===Yt&&n(H)),r===M&&(t.substr(zt,4)===W?(r=W,zt+=4):(r=M,0===Yt&&n(K)),r===M&&(t.substr(zt,4)===Q?(r=Q,zt+=4):(r=M,0===Yt&&n(X)))),r!==M?(o=F(),o!==M?(a=zt,44===t.charCodeAt(zt)?(i=V,zt++):(i=M,0===Yt&&n(Z)),i!==M?(l=F(),l!==M?(u=D(),u!==M?(i=[i,l,u],a=i):(zt=a,a=S)):(zt=a,a=S)):(zt=a,a=S),a===M&&(a=$),a!==M?(Ht=e,r=Y(r,a),e=r):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S),e}function h(){var e,r,o,a,i,l;return e=zt,t.substr(zt,6)===tt?(r=tt,zt+=6):(r=M,0===Yt&&n(et)),r!==M?(o=F(),o!==M?(44===t.charCodeAt(zt)?(a=V,zt++):(a=M,0===Yt&&n(Z)),a!==M?(i=F(),i!==M?(l=b(),l!==M?(Ht=e,r=rt(l),e=r):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S),e}function d(){var e,r,o,a,i,l;return e=zt,t.substr(zt,13)===nt?(r=nt,zt+=13):(r=M,0===Yt&&n(ot)),r!==M?(o=F(),o!==M?(44===t.charCodeAt(zt)?(a=V,zt++):(a=M,0===Yt&&n(Z)),a!==M?(i=F(),i!==M?(l=b(),l!==M?(Ht=e,r=at(l),e=r):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S),e}function y(){var e,r,o,a,i,l,u;if(e=zt,t.substr(zt,6)===it?(r=it,zt+=6):(r=M,0===Yt&&n(lt)),r!==M)if(o=F(),o!==M)if(44===t.charCodeAt(zt)?(a=V,zt++):(a=M,0===Yt&&n(Z)),a!==M)if(i=F(),i!==M){if(l=[],u=g(),u!==M)for(;u!==M;)l.push(u),u=g();else l=S;l!==M?(Ht=e,r=ut(l),e=r):(zt=e,e=S)}else zt=e,e=S;else zt=e,e=S;else zt=e,e=S;else zt=e,e=S;return e}function v(){var e,r,o,a;return e=zt,r=zt,61===t.charCodeAt(zt)?(o=st,zt++):(o=M,0===Yt&&n(ct)),o!==M?(a=j(),a!==M?(o=[o,a],r=o):(zt=r,r=S)):(zt=r,r=S),r!==M&&(r=t.substring(e,zt)),e=r,e===M&&(e=D()),e}function g(){var e,r,o,a,l,u,s,c,f;return e=zt,r=F(),r!==M?(o=v(),o!==M?(a=F(),a!==M?(123===t.charCodeAt(zt)?(l=G,zt++):(l=M,0===Yt&&n(U)),l!==M?(u=F(),u!==M?(s=i(),s!==M?(c=F(),c!==M?(125===t.charCodeAt(zt)?(f=B,zt++):(f=M,0===Yt&&n(J)),f!==M?(Ht=e,r=ft(o,s),e=r):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S),e}function _(){var e,r,o,a;return e=zt,t.substr(zt,7)===pt?(r=pt,zt+=7):(r=M,0===Yt&&n(mt)),r!==M?(o=F(),o!==M?(a=j(),a!==M?(Ht=e,r=ht(a),e=r):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S),e}function b(){var t,e,r,n,o;if(t=zt,e=_(),e===M&&(e=$),e!==M)if(r=F(),r!==M){if(n=[],o=g(),o!==M)for(;o!==M;)n.push(o),o=g();else n=S;n!==M?(Ht=t,e=dt(e,n),t=e):(zt=t,t=S)}else zt=t,t=S;else zt=t,t=S;return t}function w(){var e,r;if(Yt++,e=[],vt.test(t.charAt(zt))?(r=t.charAt(zt),zt++):(r=M,0===Yt&&n(gt)),r!==M)for(;r!==M;)e.push(r),vt.test(t.charAt(zt))?(r=t.charAt(zt),zt++):(r=M,0===Yt&&n(gt));else e=S;return Yt--,e===M&&(r=M,0===Yt&&n(yt)),e}function F(){var e,r,o;for(Yt++,e=zt,r=[],o=w();o!==M;)r.push(o),o=w();return r!==M&&(r=t.substring(e,zt)),e=r,Yt--,e===M&&(r=M,0===Yt&&n(_t)),e}function O(){var e;return bt.test(t.charAt(zt))?(e=t.charAt(zt),zt++):(e=M,0===Yt&&n(wt)),e}function A(){var e;return Ft.test(t.charAt(zt))?(e=t.charAt(zt),zt++):(e=M,0===Yt&&n(Ot)),e}function j(){var e,r,o,a,i,l;if(e=zt,48===t.charCodeAt(zt)?(r=At,zt++):(r=M,0===Yt&&n(jt)),r===M){if(r=zt,o=zt,Lt.test(t.charAt(zt))?(a=t.charAt(zt),zt++):(a=M,0===Yt&&n(Dt)),a!==M){for(i=[],l=O();l!==M;)i.push(l),l=O();i!==M?(a=[a,i],o=a):(zt=o,o=S)}else zt=o,o=S;o!==M&&(o=t.substring(r,zt)),r=o}return r!==M&&(Ht=e,r=Pt(r)),e=r}function L(){var e,r,o,a,i,l,u,s;return Ct.test(t.charAt(zt))?(e=t.charAt(zt),zt++):(e=M,0===Yt&&n(Mt)),e===M&&(e=zt,t.substr(zt,2)===xt?(r=xt,zt+=2):(r=M,0===Yt&&n(Rt)),r!==M&&(Ht=e,r=Et()),e=r,e===M&&(e=zt,t.substr(zt,2)===St?(r=St,zt+=2):(r=M,0===Yt&&n(Nt)),r!==M&&(Ht=e,r=Tt()),e=r,e===M&&(e=zt,t.substr(zt,2)===It?(r=It,zt+=2):(r=M,0===Yt&&n(kt)),r!==M&&(Ht=e,r=Gt()),e=r,e===M&&(e=zt,t.substr(zt,2)===Ut?(r=Ut,zt+=2):(r=M,0===Yt&&n($t)),r!==M&&(Ht=e,r=Vt()),e=r,e===M&&(e=zt,t.substr(zt,2)===Zt?(r=Zt,zt+=2):(r=M,0===Yt&&n(Bt)),r!==M?(o=zt,a=zt,i=A(),i!==M?(l=A(),l!==M?(u=A(),u!==M?(s=A(),s!==M?(i=[i,l,u,s],a=i):(zt=a,a=S)):(zt=a,a=S)):(zt=a,a=S)):(zt=a,a=S),a!==M&&(a=t.substring(o,zt)),o=a,o!==M?(Ht=e,r=Jt(o),e=r):(zt=e,e=S)):(zt=e,e=S)))))),e}function D(){var t,e,r;if(t=zt,e=[],r=L(),r!==M)for(;r!==M;)e.push(r),r=L();else e=S;return e!==M&&(Ht=t,e=qt(e)),t=e}var P,C=arguments.length>1?arguments[1]:{},M={},x={start:a},R=a,E=function(t){return{type:"messageFormatPattern",elements:t}},S=M,N=function(t){var e,r,n,o,a,i="";for(e=0,n=t.length;n>e;e+=1)for(o=t[e],r=0,a=o.length;a>r;r+=1)i+=o[r];return i},T=function(t){return{type:"messageTextElement",value:t}},I=/^[^ \t\n\r,.+={}#]/,k={type:"class",value:"[^ \\t\\n\\r,.+={}#]",description:"[^ \\t\\n\\r,.+={}#]"},G="{",U={type:"literal",value:"{",description:'"{"'},$=null,V=",",Z={type:"literal",value:",",description:'","'},B="}",J={type:"literal",value:"}",description:'"}"'},q=function(t,e){return{type:"argumentElement",id:t,format:e&&e[2]}},z="number",H={type:"literal",value:"number",description:'"number"'},W="date",K={type:"literal",value:"date",description:'"date"'},Q="time",X={type:"literal",value:"time",description:'"time"'},Y=function(t,e){return{type:t+"Format",style:e&&e[2]}},tt="plural",et={type:"literal",value:"plural",description:'"plural"'},rt=function(t){return{type:t.type,ordinal:!1,offset:t.offset||0,options:t.options}},nt="selectordinal",ot={type:"literal",value:"selectordinal",description:'"selectordinal"'},at=function(t){return{type:t.type,ordinal:!0,offset:t.offset||0,options:t.options}},it="select",lt={type:"literal",value:"select",description:'"select"'},ut=function(t){return{type:"selectFormat",options:t}},st="=",ct={type:"literal",value:"=",description:'"="'},ft=function(t,e){return{type:"optionalFormatPattern",selector:t,value:e}},pt="offset:",mt={type:"literal",value:"offset:",description:'"offset:"'},ht=function(t){return t},dt=function(t,e){return{type:"pluralFormat",offset:t,options:e}},yt={type:"other",description:"whitespace"},vt=/^[ \t\n\r]/,gt={type:"class",value:"[ \\t\\n\\r]",description:"[ \\t\\n\\r]"},_t={type:"other",description:"optionalWhitespace"},bt=/^[0-9]/,wt={type:"class",value:"[0-9]",description:"[0-9]"},Ft=/^[0-9a-f]/i,Ot={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},At="0",jt={type:"literal",value:"0",description:'"0"'},Lt=/^[1-9]/,Dt={type:"class",value:"[1-9]",description:"[1-9]"},Pt=function(t){return parseInt(t,10)},Ct=/^[^{}\\\0-\x1F \t\n\r]/,Mt={type:"class",value:"[^{}\\\\\\0-\\x1F \\t\\n\\r]",description:"[^{}\\\\\\0-\\x1F \\t\\n\\r]"},xt="\\\\",Rt={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},Et=function(){return"\\"},St="\\#",Nt={type:"literal",value:"\\#",description:'"\\\\#"'},Tt=function(){return"\\#"},It="\\{",kt={type:"literal",value:"\\{",description:'"\\\\{"'},Gt=function(){return"{"},Ut="\\}",$t={type:"literal",value:"\\}",description:'"\\\\}"'},Vt=function(){return"}"},Zt="\\u",Bt={type:"literal",value:"\\u",description:'"\\\\u"'},Jt=function(t){return String.fromCharCode(parseInt(t,16))},qt=function(t){return t.join("")},zt=0,Ht=0,Wt=0,Kt={line:1,column:1,seenCR:!1},Qt=0,Xt=[],Yt=0;if("startRule"in C){if(!(C.startRule in x))throw new Error("Can't start parsing from rule \""+C.startRule+'".');R=x[C.startRule]}if(P=R(),P!==M&&zt===t.length)return P;throw P!==M&&zt<t.length&&n({type:"end",description:"end of input"}),o(null,Xt,Qt)}return t(e,Error),{SyntaxError:e,parse:r}}();E(i,"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(i,"__localeData__",{value:S(null)}),E(i,"__addLocaleData",{value:function(t){if(!t||!t.locale)throw new Error("Locale data provided to IntlMessageFormat is missing a `locale` property");i.__localeData__[t.locale.toLowerCase()]=t}}),E(i,"__parse",{value:N.parse}),E(i,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),i.prototype.resolvedOptions=function(){return{locale:this._locale}},i.prototype._compilePattern=function(t,r,n,o){var a=new e(r,n,o);return a.compile(t)},i.prototype._findPluralRuleFunction=function(t){for(var e=i.__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)},i.prototype._format=function(t,e){var r,n,o,a,i,l="";for(r=0,n=t.length;n>r;r+=1)if(o=t[r],"string"!=typeof o){if(a=o.id,!e||!x.call(e,a))throw new Error("A value must be provided for: "+a);i=e[a],l+=o.options?this._format(o.getOption(i),e):o.format(i)}else l+=o;return l},i.prototype._mergeFormats=function(e,r){var n,o,a={};for(n in e)x.call(e,n)&&(a[n]=o=S(e[n]),r&&x.call(r,n)&&t(o,r[n]));return a},i.prototype._resolveLocale=function(t){"string"==typeof t&&(t=[t]),t=(t||[]).concat(i.defaultLocale);var e,r,n,o,a=i.__localeData__;for(e=0,r=t.length;r>e;e+=1)for(n=t[e].toLowerCase().split("-");n.length;){if(o=a[n.join("-")])return o.locale;n.pop()}var l=t.pop();throw new Error("No locale data has been added to IntlMessageFormat for: "+t.join(", ")+", or the default locale: "+l)};var T={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"}};i.__addLocaleData(T),i.defaultLocale="en";var I=Math.round,k=Object.prototype.hasOwnProperty,G=Object.prototype.toString,U=function(){try{return!!Object.defineProperty({},"a",{})}catch(t){return!1}}(),$=(!U&&!Object.prototype.__defineGetter__,U?Object.defineProperty:function(t,e,r){"get"in r&&t.__defineGetter__?t.__defineGetter__(e,r.get):(!k.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)k.call(e,o)&&$(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;o>n;n++)if(r[n]===t)return n;return-1},B=Array.isArray||function(t){return"[object Array]"===G.call(t)},J=Date.now||function(){return(new Date).getTime()},q=["second","minute","hour","day","month","year"],z=["best fit","numeric"];$(s,"__localeData__",{value:V(null)}),$(s,"__addLocaleData",{value:function(t){if(!t||!t.locale)throw new Error("Locale data provided to IntlRelativeFormat is missing a `locale` property value");s.__localeData__[t.locale.toLowerCase()]=t,i.__addLocaleData(t)}}),$(s,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),$(s,"thresholds",{enumerable:!0,value:{second:45,minute:45,hour:22,day:26,month:11}}),s.prototype.resolvedOptions=function(){return{locale:this._locale,style:this._options.style,units:this._options.units}},s.prototype._compileMessage=function(t){var e,r=this._locales,n=(this._locale,this._fields[t]),o=n.relativeTime,a="",l="";for(e in o.future)o.future.hasOwnProperty(e)&&(a+=" "+e+" {"+o.future[e].replace("{0}","#")+"}");for(e in o.past)o.past.hasOwnProperty(e)&&(l+=" "+e+" {"+o.past[e].replace("{0}","#")+"}");var u="{when, select, future {{0, plural, "+a+"}}past {{0, plural, "+l+"}}}";return new i(u,r)},s.prototype._getMessage=function(t){var e=this._messages;return e[t]||(e[t]=this._compileMessage(t)),e[t]},s.prototype._getRelativeUnits=function(t,e){var r=this._fields[e];return r.relative?r.relative[t]:void 0},s.prototype._findFields=function(t){for(var e=s.__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)},s.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=u(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:0>a?"past":"future"})},s.prototype._isValidUnits=function(t){if(!t||Z.call(q,t)>=0)return!0;if("string"==typeof t){var e=/s$/.test(t)&&t.substr(0,t.length-1);if(e&&Z.call(q,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: "'+q.join('", "')+'"')},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;r>e;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)},s.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('", "')+'"')},s.prototype._selectUnits=function(t){var e,r,n;for(e=0,r=q.length;r>e&&(n=q[e],!(Math.abs(t[n])<s.thresholds[n]));e+=1);return n};var H={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"}}}}};s.__addLocaleData(H),s.defaultLocale="en";var W=function _t(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];M.classCallCheck(this,_t);var r="ordinal"===e.style,n=d(h(t));this.format=function(t){return n(t,r)}},K=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},Q=Object.prototype.hasOwnProperty,X=function(){try{return!!Object.defineProperty({},"a",{})}catch(t){return!1}}(),Y=(!X&&!Object.prototype.__defineGetter__,X?Object.defineProperty:function(t,e,r){"get"in r&&t.__defineGetter__?t.__defineGetter__(e,r.get):(!Q.call(t,e)||"value"in r)&&(t[e]=r.value)}),tt=Object.create||function(t,e){function r(){}var n,o;r.prototype=t,n=new r;for(o in e)Q.call(e,o)&&Y(n,o,e[o]);return n},et={getDateTimeFormat:y(Intl.DateTimeFormat),getNumberFormat:y(Intl.NumberFormat),getMessageFormat:y(i),getRelativeFormat:y(s),getPluralFormat:y(W),now:Date.now()},rt={type:Boolean},nt={type:Number},ot={type:String},at=function(t){return{validator:function(e){return t.indexOf(e)>-1}}},it={localeMatcher:at(["best fit","lookup"]),formatMatcher:at(["basic","best fit"]),timeZone:ot,hour12:rt,weekday:at(["narrow","short","long"]),era:at(["narrow","short","long"]),year:at(["numeric","2-digit"]),month:at(["numeric","2-digit","narrow","short","long"]),day:at(["numeric","2-digit"]),hour:at(["numeric","2-digit"]),minute:at(["numeric","2-digit"]),second:at(["numeric","2-digit"]),timeZoneName:at(["short","long"])},lt={localeMatcher:at(["best fit","lookup"]),style:at(["decimal","currency","percent"]),currency:ot,currencyDisplay:at(["symbol","code","name"]),useGrouping:rt,minimumIntegerDigits:nt,minimumFractionDigits:nt,maximumFractionDigits:nt,minimumSignificantDigits:nt,maximumSignificantDigits:nt},ut={style:at(["best fit","numeric"]),units:at(["second","minute","hour","day","month","year"])},st={style:at(["cardinal","ordinal"])},ct={"&":"&",">":">","<":"<",'"':""","'":"'"},ft=/[&><"']/g,pt=Object.keys(it),mt=Object.keys(lt),ht=Object.keys(ut),dt=Object.keys(st),yt={second:60,minute:60,hour:24,day:30,month:12},vt=Object.freeze({formatDate:O,formatTime:A,formatRelative:j,formatNumber:L,formatPlural:D,formatMessage:P,formatHTMLMessage:C}),gt={install:function(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];t.addLocaleData=c,t.registerMessages=f.bind(null,t),t.registerFormats=p.bind(null,t),t.setLocale=m.bind(null,t),t.__format_state=et,t.__format_config={formats:e.defaultFormats||{},messages:{},defaultLocale:e.defaultLocale||"en",defaultFormats:e.defaultFormats||{}};var r=!0,n=!1,o=void 0;try{for(var a,i=function(){var e=a.value;t.prototype["$"+e]=function(){var r={locale:t.$get("locale")};Object.assign(r,t.__format_config);for(var n=t.__format_state,o=arguments.length,a=Array(o),i=0;o>i;i++)a[i]=arguments[i];return vt[e].apply(vt,[r,n].concat(a))}},l=Object.getOwnPropertyNames(vt).filter(function(t){return vt[t]instanceof Function})[Symbol.iterator]();!(r=(a=l.next()).done);r=!0)i()}catch(u){n=!0,o=u}finally{try{!r&&l["return"]&&l["return"]()}finally{if(n)throw o}}}};return gt}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.VueIntl=e()}(this,function(){"use strict";function t(t){var e,r,n,o,a=Array.prototype.slice.call(arguments,1);for(e=0,r=a.length;r>e;e+=1)if(n=a[e])for(o in n)x.call(n,o)&&(t[o]=n[o]);return t}function e(t,e,r){this.locales=t,this.formats=e,this.pluralFn=r}function r(t){this.id=t}function n(t,e,r,n,o){this.id=t,this.useOrdinal=e,this.offset=r,this.options=n,this.pluralFn=o}function o(t,e,r,n){this.id=t,this.offset=e,this.numberFormat=r,this.string=n}function a(t,e){this.id=t,this.options=e}function i(t,e,r){var n="string"==typeof t?i.__parse(t):t;if(!n||"messageFormatPattern"!==n.type)throw new TypeError("A message must be provided as a String or AST.");r=this._mergeFormats(i.formats,r),E(this,"_locale",{value:this._resolveLocale(e)});var o=this._findPluralRuleFunction(this._locale),a=this._compilePattern(n,e,r,o),l=this;this.format=function(t){return l._format(a,t)}}function l(t){return 400*t/146097}function u(t,e){t=+t,e=+e;var r=I(e-t),n=I(r/1e3),o=I(n/60),a=I(o/60),i=I(a/24),u=I(i/7),s=l(i),c=I(12*s),f=I(s);return{millisecond:r,second:n,minute:o,hour:a,day:i,week:u,month:c,year:f}}function s(t,e){e=e||{},B(t)&&(t=t.concat()),V(this,"_locale",{value:this._resolveLocale(t)}),V(this,"_options",{value:{style:this._resolveStyle(e.style),units:this._isValidUnits(e.units)&&e.units}}),V(this,"_locales",{value:t}),V(this,"_fields",{value:this._findFields(this._locale)}),V(this,"_messages",{value:Z(null)});var r=this;this.format=function(t,e){return r._format(t,e)}}function c(){var t=arguments.length<=0||void 0===arguments[0]?[]:arguments[0],e=Array.isArray(t)?t:[t];e.forEach(function(t){t&&t.locale&&(i.__addLocaleData(t),s.__addLocaleData(t))})}function f(t,e,r){t.__allMessages=t.__allMessages||{},t.__allMessages[e]=t.__allMessages[e]||{},Object.assign(t.__allMessages[e],r)}function p(t,e,r){t.__allFormats=t.__allFormats||{},t.__allFormats[e]=t.__allFormats[e]||{},Object.assign(t.__allFormats[e],r)}function m(t,e){t.set(t,"locale",e);var r=Object.getOwnPropertyNames((t.__allFormats||{})[e]||{}).length>0;t.__format_config.formats=r?t.__allFormats[e]:t.__format_config.defaultFormats,t.__format_config.messages=(t.__allMessages||{})[e]||{}}function h(t){return i.prototype._resolveLocale(t)}function d(t){return i.prototype._findPluralRuleFunction(t)}function y(t){var e=tt(null);return function(){var r=Array.prototype.slice.call(arguments),n=v(r),o=n&&e[n];return o||(o=new(K.apply(t,[null].concat(r))),n&&(e[n]=o)),o}}function v(t){if("undefined"!=typeof JSON){var e,r,n,o=[];for(e=0,r=t.length;r>e;e+=1)n=t[e],n&&"object"===("undefined"==typeof n?"undefined":M["typeof"](n))?o.push(g(n)):o.push(n);return JSON.stringify(o)}}function g(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;n>r;r+=1)e=l[r],o={},o[e]=t[e],a[r]=o;return a}function _(t){return(""+t).replace(ft,function(t){return ct[t]})}function b(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 w(t){var e=s.thresholds;e.second=t.second,e.minute=t.minute,e.hour=t.hour,e.day=t.day,e.month=t.month}function F(t,e,r){var n=t&&t[e]&&t[e][r];return n?n:void 0}function O(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&&F(a,"date",i),s=b(n,pt,u);try{return e.getDateTimeFormat(o,s).format(l)}catch(c){}return String(l)}function A(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&&F(a,"time",i),s=b(n,pt,u);0===Object.keys(s).length&&(s={hour:"numeric",minute:"numeric"});try{return e.getDateTimeFormat(o,s).format(l)}catch(c){}return String(l)}function j(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),c=i&&F(a,"relative",i),f=b(n,ht,c),p=Object.assign({},s.thresholds);w(yt);try{return e.getRelativeFormat(o,f).format(l,{now:isFinite(u)?u:e.now()})}catch(m){}finally{w(p)}return String(l)}function L(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&&F(a,"number",i),u=b(n,mt,l);try{return e.getNumberFormat(o,u).format(r)}catch(s){}return String(r)}function D(t,e,r){var n=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],o=t.locale,a=b(n,dt);try{return e.getPluralFormat(o,a).format(r)}catch(i){}return"other"}function P(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;if(!s)throw new TypeError("[Vue Intl] An `id` must be provided to format a message.");var f=i&&i[s],p=Object.keys(n).length>0;if(!p)return f||c||s;var m=void 0;if(f)try{var h=e.getMessageFormat(f,o,a);m=h.format(n)}catch(d){}if(!m&&c)try{var y=e.getMessageFormat(c,l,u);m=y.format(n)}catch(d){}return m||f||c||s}function C(t,e,r){var n=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],o=Object.keys(n).reduce(function(t,e){var r=n[e];return t[e]="string"==typeof r?_(r):r,t},{});return P(t,e,r,o)}var M={};M["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},M.classCallCheck=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};var x=Object.prototype.hasOwnProperty,R=function(){try{return!!Object.defineProperty({},"a",{})}catch(t){return!1}}(),E=(!R&&!Object.prototype.__defineGetter__,R?Object.defineProperty:function(t,e,r){"get"in r&&t.__defineGetter__?t.__defineGetter__(e,r.get):(!x.call(t,e)||"value"in r)&&(t[e]=r.value)}),S=Object.create||function(t,e){function r(){}var n,o;r.prototype=t,n=new r;for(o in e)x.call(e,o)&&E(n,o,e[o]);return n};e.prototype.compile=function(t){return this.pluralStack=[],this.currentPlural=null,this.pluralNumberFormat=null,this.compileMessage(t)},e.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;r>e;e+=1)switch(n=o[e],n.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},e.prototype.compileMessageText=function(t){return this.currentPlural&&/(^|[^\\])#/g.test(t.value)?(this.pluralNumberFormat||(this.pluralNumberFormat=new Intl.NumberFormat(this.locales)),new o(this.currentPlural.id,this.currentPlural.format.offset,this.pluralNumberFormat,t.value)):t.value.replace(/\\#/g,"#")},e.prototype.compileArgument=function(t){var e=t.format;if(!e)return new r(t.id);var o,i=this.formats,l=this.locales,u=this.pluralFn;switch(e.type){case"numberFormat":return o=i.number[e.style],{id:t.id,format:new Intl.NumberFormat(l,o).format};case"dateFormat":return o=i.date[e.style],{id:t.id,format:new Intl.DateTimeFormat(l,o).format};case"timeFormat":return o=i.time[e.style],{id:t.id,format:new Intl.DateTimeFormat(l,o).format};case"pluralFormat":return o=this.compileOptions(t),new n(t.id,e.ordinal,e.offset,o,u);case"selectFormat":return o=this.compileOptions(t),new a(t.id,o);default:throw new Error("Message element does not have a valid format type")}},e.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;a>o;o+=1)i=r[o],n[i.selector]=this.compileMessage(i.value);return this.currentPlural=this.pluralStack.pop(),n},r.prototype.format=function(t){return t?"string"==typeof t?t:String(t):""},n.prototype.getOption=function(t){var e=this.options,r=e["="+t]||e[this.pluralFn(t-this.offset,this.useOrdinal)];return r||e.other},o.prototype.format=function(t){var e=this.numberFormat.format(t-this.offset);return this.string.replace(/(^|[^\\])#/g,"$1"+e).replace(/\\#/g,"#")},a.prototype.getOption=function(t){var e=this.options;return e[t]||e.other};var N=function(){function t(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function e(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"}function r(t){function r(e){function r(e,r,n){var o,a;for(o=r;n>o;o++)a=t.charAt(o),"\n"===a?(e.seenCR||e.line++,e.column=1,e.seenCR=!1):"\r"===a||"\u2028"===a||"\u2029"===a?(e.line++,e.column=1,e.seenCR=!0):(e.column++,e.seenCR=!1)}return Wt!==e&&(Wt>e&&(Wt=0,Kt={line:1,column:1,seenCR:!1}),r(Kt,Wt,e),Wt=e),Kt}function n(t){Qt>zt||(zt>Qt&&(Qt=zt,Xt=[]),Xt.push(t))}function o(n,o,a){function i(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++}function l(t,e){function r(t){function e(t){return t.charCodeAt(0).toString(16).toUpperCase()}return t.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"+e(t)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(t){return"\\x"+e(t)}).replace(/[\u0180-\u0FFF]/g,function(t){return"\\u0"+e(t)}).replace(/[\u1080-\uFFFF]/g,function(t){return"\\u"+e(t)})}var n,o,a,i=new Array(t.length);for(a=0;a<t.length;a++)i[a]=t[a].description;return n=t.length>1?i.slice(0,-1).join(", ")+" or "+i[t.length-1]:i[0],o=e?'"'+r(e)+'"':"end of input","Expected "+n+" but "+o+" found."}var u=r(a),s=a<t.length?t.charAt(a):null;return null!==o&&i(o),new e(null!==n?n:l(o,s),o,s,a,u.line,u.column)}function a(){var t;return t=i()}function i(){var t,e,r;for(t=zt,e=[],r=l();r!==M;)e.push(r),r=l();return e!==M&&(Ht=t,e=E(e)),t=e}function l(){var t;return t=s(),t===M&&(t=f()),t}function u(){var e,r,n,o,a,i;if(e=zt,r=[],n=zt,o=F(),o!==M?(a=D(),a!==M?(i=F(),i!==M?(o=[o,a,i],n=o):(zt=n,n=S)):(zt=n,n=S)):(zt=n,n=S),n!==M)for(;n!==M;)r.push(n),n=zt,o=F(),o!==M?(a=D(),a!==M?(i=F(),i!==M?(o=[o,a,i],n=o):(zt=n,n=S)):(zt=n,n=S)):(zt=n,n=S);else r=S;return r!==M&&(Ht=e,r=N(r)),e=r,e===M&&(e=zt,r=w(),r!==M&&(r=t.substring(e,zt)),e=r),e}function s(){var t,e;return t=zt,e=u(),e!==M&&(Ht=t,e=T(e)),t=e}function c(){var e,r,o;if(e=j(),e===M){if(e=zt,r=[],I.test(t.charAt(zt))?(o=t.charAt(zt),zt++):(o=M,0===Yt&&n(k)),o!==M)for(;o!==M;)r.push(o),I.test(t.charAt(zt))?(o=t.charAt(zt),zt++):(o=M,0===Yt&&n(k));else r=S;r!==M&&(r=t.substring(e,zt)),e=r}return e}function f(){var e,r,o,a,i,l,u,s,f;return e=zt,123===t.charCodeAt(zt)?(r=G,zt++):(r=M,0===Yt&&n(U)),r!==M?(o=F(),o!==M?(a=c(),a!==M?(i=F(),i!==M?(l=zt,44===t.charCodeAt(zt)?(u=Z,zt++):(u=M,0===Yt&&n($)),u!==M?(s=F(),s!==M?(f=p(),f!==M?(u=[u,s,f],l=u):(zt=l,l=S)):(zt=l,l=S)):(zt=l,l=S),l===M&&(l=V),l!==M?(u=F(),u!==M?(125===t.charCodeAt(zt)?(s=B,zt++):(s=M,0===Yt&&n(J)),s!==M?(Ht=e,r=q(a,l),e=r):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S),e}function p(){var t;return t=m(),t===M&&(t=h(),t===M&&(t=d(),t===M&&(t=y()))),t}function m(){var e,r,o,a,i,l,u;return e=zt,t.substr(zt,6)===z?(r=z,zt+=6):(r=M,0===Yt&&n(H)),r===M&&(t.substr(zt,4)===W?(r=W,zt+=4):(r=M,0===Yt&&n(K)),r===M&&(t.substr(zt,4)===Q?(r=Q,zt+=4):(r=M,0===Yt&&n(X)))),r!==M?(o=F(),o!==M?(a=zt,44===t.charCodeAt(zt)?(i=Z,zt++):(i=M,0===Yt&&n($)),i!==M?(l=F(),l!==M?(u=D(),u!==M?(i=[i,l,u],a=i):(zt=a,a=S)):(zt=a,a=S)):(zt=a,a=S),a===M&&(a=V),a!==M?(Ht=e,r=Y(r,a),e=r):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S),e}function h(){var e,r,o,a,i,l;return e=zt,t.substr(zt,6)===tt?(r=tt,zt+=6):(r=M,0===Yt&&n(et)),r!==M?(o=F(),o!==M?(44===t.charCodeAt(zt)?(a=Z,zt++):(a=M,0===Yt&&n($)),a!==M?(i=F(),i!==M?(l=b(),l!==M?(Ht=e,r=rt(l),e=r):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S),e}function d(){var e,r,o,a,i,l;return e=zt,t.substr(zt,13)===nt?(r=nt,zt+=13):(r=M,0===Yt&&n(ot)),r!==M?(o=F(),o!==M?(44===t.charCodeAt(zt)?(a=Z,zt++):(a=M,0===Yt&&n($)),a!==M?(i=F(),i!==M?(l=b(),l!==M?(Ht=e,r=at(l),e=r):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S),e}function y(){var e,r,o,a,i,l,u;if(e=zt,t.substr(zt,6)===it?(r=it,zt+=6):(r=M,0===Yt&&n(lt)),r!==M)if(o=F(),o!==M)if(44===t.charCodeAt(zt)?(a=Z,zt++):(a=M,0===Yt&&n($)),a!==M)if(i=F(),i!==M){if(l=[],u=g(),u!==M)for(;u!==M;)l.push(u),u=g();else l=S;l!==M?(Ht=e,r=ut(l),e=r):(zt=e,e=S)}else zt=e,e=S;else zt=e,e=S;else zt=e,e=S;else zt=e,e=S;return e}function v(){var e,r,o,a;return e=zt,r=zt,61===t.charCodeAt(zt)?(o=st,zt++):(o=M,0===Yt&&n(ct)),o!==M?(a=j(),a!==M?(o=[o,a],r=o):(zt=r,r=S)):(zt=r,r=S),r!==M&&(r=t.substring(e,zt)),e=r,e===M&&(e=D()),e}function g(){var e,r,o,a,l,u,s,c,f;return e=zt,r=F(),r!==M?(o=v(),o!==M?(a=F(),a!==M?(123===t.charCodeAt(zt)?(l=G,zt++):(l=M,0===Yt&&n(U)),l!==M?(u=F(),u!==M?(s=i(),s!==M?(c=F(),c!==M?(125===t.charCodeAt(zt)?(f=B,zt++):(f=M,0===Yt&&n(J)),f!==M?(Ht=e,r=ft(o,s),e=r):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S),e}function _(){var e,r,o,a;return e=zt,t.substr(zt,7)===pt?(r=pt,zt+=7):(r=M,0===Yt&&n(mt)),r!==M?(o=F(),o!==M?(a=j(),a!==M?(Ht=e,r=ht(a),e=r):(zt=e,e=S)):(zt=e,e=S)):(zt=e,e=S),e}function b(){var t,e,r,n,o;if(t=zt,e=_(),e===M&&(e=V),e!==M)if(r=F(),r!==M){if(n=[],o=g(),o!==M)for(;o!==M;)n.push(o),o=g();else n=S;n!==M?(Ht=t,e=dt(e,n),t=e):(zt=t,t=S)}else zt=t,t=S;else zt=t,t=S;return t}function w(){var e,r;if(Yt++,e=[],vt.test(t.charAt(zt))?(r=t.charAt(zt),zt++):(r=M,0===Yt&&n(gt)),r!==M)for(;r!==M;)e.push(r),vt.test(t.charAt(zt))?(r=t.charAt(zt),zt++):(r=M,0===Yt&&n(gt));else e=S;return Yt--,e===M&&(r=M,0===Yt&&n(yt)),e}function F(){var e,r,o;for(Yt++,e=zt,r=[],o=w();o!==M;)r.push(o),o=w();return r!==M&&(r=t.substring(e,zt)),e=r,Yt--,e===M&&(r=M,0===Yt&&n(_t)),e}function O(){var e;return bt.test(t.charAt(zt))?(e=t.charAt(zt),zt++):(e=M,0===Yt&&n(wt)),e}function A(){var e;return Ft.test(t.charAt(zt))?(e=t.charAt(zt),zt++):(e=M,0===Yt&&n(Ot)),e}function j(){var e,r,o,a,i,l;if(e=zt,48===t.charCodeAt(zt)?(r=At,zt++):(r=M,0===Yt&&n(jt)),r===M){if(r=zt,o=zt,Lt.test(t.charAt(zt))?(a=t.charAt(zt),zt++):(a=M,0===Yt&&n(Dt)),a!==M){for(i=[],l=O();l!==M;)i.push(l),l=O();i!==M?(a=[a,i],o=a):(zt=o,o=S)}else zt=o,o=S;o!==M&&(o=t.substring(r,zt)),r=o}return r!==M&&(Ht=e,r=Pt(r)),e=r}function L(){var e,r,o,a,i,l,u,s;return Ct.test(t.charAt(zt))?(e=t.charAt(zt),zt++):(e=M,0===Yt&&n(Mt)),e===M&&(e=zt,t.substr(zt,2)===xt?(r=xt,zt+=2):(r=M,0===Yt&&n(Rt)),r!==M&&(Ht=e,r=Et()),e=r,e===M&&(e=zt,t.substr(zt,2)===St?(r=St,zt+=2):(r=M,0===Yt&&n(Nt)),r!==M&&(Ht=e,r=Tt()),e=r,e===M&&(e=zt,t.substr(zt,2)===It?(r=It,zt+=2):(r=M,0===Yt&&n(kt)),r!==M&&(Ht=e,r=Gt()),e=r,e===M&&(e=zt,t.substr(zt,2)===Ut?(r=Ut,zt+=2):(r=M,0===Yt&&n(Vt)),r!==M&&(Ht=e,r=Zt()),e=r,e===M&&(e=zt,t.substr(zt,2)===$t?(r=$t,zt+=2):(r=M,0===Yt&&n(Bt)),r!==M?(o=zt,a=zt,i=A(),i!==M?(l=A(),l!==M?(u=A(),u!==M?(s=A(),s!==M?(i=[i,l,u,s],a=i):(zt=a,a=S)):(zt=a,a=S)):(zt=a,a=S)):(zt=a,a=S),a!==M&&(a=t.substring(o,zt)),o=a,o!==M?(Ht=e,r=Jt(o),e=r):(zt=e,e=S)):(zt=e,e=S)))))),e}function D(){var t,e,r;if(t=zt,e=[],r=L(),r!==M)for(;r!==M;)e.push(r),r=L();else e=S;return e!==M&&(Ht=t,e=qt(e)),t=e}var P,C=arguments.length>1?arguments[1]:{},M={},x={start:a},R=a,E=function(t){return{type:"messageFormatPattern",elements:t}},S=M,N=function(t){var e,r,n,o,a,i="";for(e=0,n=t.length;n>e;e+=1)for(o=t[e],r=0,a=o.length;a>r;r+=1)i+=o[r];return i},T=function(t){return{type:"messageTextElement",value:t}},I=/^[^ \t\n\r,.+={}#]/,k={type:"class",value:"[^ \\t\\n\\r,.+={}#]",description:"[^ \\t\\n\\r,.+={}#]"},G="{",U={type:"literal",value:"{",description:'"{"'},V=null,Z=",",$={type:"literal",value:",",description:'","'},B="}",J={type:"literal",value:"}",description:'"}"'},q=function(t,e){return{type:"argumentElement",id:t,format:e&&e[2]}},z="number",H={type:"literal",value:"number",description:'"number"'},W="date",K={type:"literal",value:"date",description:'"date"'},Q="time",X={type:"literal",value:"time",description:'"time"'},Y=function(t,e){return{type:t+"Format",style:e&&e[2]}},tt="plural",et={type:"literal",value:"plural",description:'"plural"'},rt=function(t){return{type:t.type,ordinal:!1,offset:t.offset||0,options:t.options}},nt="selectordinal",ot={type:"literal",value:"selectordinal",description:'"selectordinal"'},at=function(t){return{type:t.type,ordinal:!0,offset:t.offset||0,options:t.options}},it="select",lt={type:"literal",value:"select",description:'"select"'},ut=function(t){return{type:"selectFormat",options:t}},st="=",ct={type:"literal",value:"=",description:'"="'},ft=function(t,e){return{type:"optionalFormatPattern",selector:t,value:e}},pt="offset:",mt={type:"literal",value:"offset:",description:'"offset:"'},ht=function(t){return t},dt=function(t,e){return{type:"pluralFormat",offset:t,options:e}},yt={type:"other",description:"whitespace"},vt=/^[ \t\n\r]/,gt={type:"class",value:"[ \\t\\n\\r]",description:"[ \\t\\n\\r]"},_t={type:"other",description:"optionalWhitespace"},bt=/^[0-9]/,wt={type:"class",value:"[0-9]",description:"[0-9]"},Ft=/^[0-9a-f]/i,Ot={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},At="0",jt={type:"literal",value:"0",description:'"0"'},Lt=/^[1-9]/,Dt={type:"class",value:"[1-9]",description:"[1-9]"},Pt=function(t){return parseInt(t,10)},Ct=/^[^{}\\\0-\x1F \t\n\r]/,Mt={type:"class",value:"[^{}\\\\\\0-\\x1F \\t\\n\\r]",description:"[^{}\\\\\\0-\\x1F \\t\\n\\r]"},xt="\\\\",Rt={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},Et=function(){return"\\"},St="\\#",Nt={type:"literal",value:"\\#",description:'"\\\\#"'},Tt=function(){return"\\#"},It="\\{",kt={type:"literal",value:"\\{",description:'"\\\\{"'},Gt=function(){return"{"},Ut="\\}",Vt={type:"literal",value:"\\}",description:'"\\\\}"'},Zt=function(){return"}"},$t="\\u",Bt={type:"literal",value:"\\u",description:'"\\\\u"'},Jt=function(t){return String.fromCharCode(parseInt(t,16))},qt=function(t){return t.join("")},zt=0,Ht=0,Wt=0,Kt={line:1,column:1,seenCR:!1},Qt=0,Xt=[],Yt=0;if("startRule"in C){if(!(C.startRule in x))throw new Error("Can't start parsing from rule \""+C.startRule+'".');R=x[C.startRule]}if(P=R(),P!==M&&zt===t.length)return P;throw P!==M&&zt<t.length&&n({type:"end",description:"end of input"}),o(null,Xt,Qt)}return t(e,Error),{SyntaxError:e,parse:r}}();E(i,"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(i,"__localeData__",{value:S(null)}),E(i,"__addLocaleData",{value:function(t){if(!t||!t.locale)throw new Error("Locale data provided to IntlMessageFormat is missing a `locale` property");i.__localeData__[t.locale.toLowerCase()]=t}}),E(i,"__parse",{value:N.parse}),E(i,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),i.prototype.resolvedOptions=function(){return{locale:this._locale}},i.prototype._compilePattern=function(t,r,n,o){var a=new e(r,n,o);return a.compile(t)},i.prototype._findPluralRuleFunction=function(t){for(var e=i.__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)},i.prototype._format=function(t,e){var r,n,o,a,i,l="";for(r=0,n=t.length;n>r;r+=1)if(o=t[r],"string"!=typeof o){if(a=o.id,!e||!x.call(e,a))throw new Error("A value must be provided for: "+a);i=e[a],l+=o.options?this._format(o.getOption(i),e):o.format(i)}else l+=o;return l},i.prototype._mergeFormats=function(e,r){var n,o,a={};for(n in e)x.call(e,n)&&(a[n]=o=S(e[n]),r&&x.call(r,n)&&t(o,r[n]));return a},i.prototype._resolveLocale=function(t){"string"==typeof t&&(t=[t]),t=(t||[]).concat(i.defaultLocale);var e,r,n,o,a=i.__localeData__;for(e=0,r=t.length;r>e;e+=1)for(n=t[e].toLowerCase().split("-");n.length;){if(o=a[n.join("-")])return o.locale;n.pop()}var l=t.pop();throw new Error("No locale data has been added to IntlMessageFormat for: "+t.join(", ")+", or the default locale: "+l)};var T={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"}};i.__addLocaleData(T),i.defaultLocale="en";var I=Math.round,k=Object.prototype.hasOwnProperty,G=Object.prototype.toString,U=function(){try{return!!Object.defineProperty({},"a",{})}catch(t){return!1}}(),V=(!U&&!Object.prototype.__defineGetter__,U?Object.defineProperty:function(t,e,r){"get"in r&&t.__defineGetter__?t.__defineGetter__(e,r.get):(!k.call(t,e)||"value"in r)&&(t[e]=r.value)}),Z=Object.create||function(t,e){function r(){}var n,o;r.prototype=t,n=new r;for(o in e)k.call(e,o)&&V(n,o,e[o]);return n},$=Array.prototype.indexOf||function(t,e){var r=this;if(!r.length)return-1;for(var n=e||0,o=r.length;o>n;n++)if(r[n]===t)return n;return-1},B=Array.isArray||function(t){return"[object Array]"===G.call(t)},J=Date.now||function(){return(new Date).getTime()},q=["second","minute","hour","day","month","year"],z=["best fit","numeric"];V(s,"__localeData__",{value:Z(null)}),V(s,"__addLocaleData",{value:function(t){if(!t||!t.locale)throw new Error("Locale data provided to IntlRelativeFormat is missing a `locale` property value");s.__localeData__[t.locale.toLowerCase()]=t,i.__addLocaleData(t)}}),V(s,"defaultLocale",{enumerable:!0,writable:!0,value:void 0}),V(s,"thresholds",{enumerable:!0,value:{second:45,minute:45,hour:22,day:26,month:11}}),s.prototype.resolvedOptions=function(){return{locale:this._locale,style:this._options.style,units:this._options.units}},s.prototype._compileMessage=function(t){var e,r=this._locales,n=(this._locale,this._fields[t]),o=n.relativeTime,a="",l="";for(e in o.future)o.future.hasOwnProperty(e)&&(a+=" "+e+" {"+o.future[e].replace("{0}","#")+"}");for(e in o.past)o.past.hasOwnProperty(e)&&(l+=" "+e+" {"+o.past[e].replace("{0}","#")+"}");var u="{when, select, future {{0, plural, "+a+"}}past {{0, plural, "+l+"}}}";return new i(u,r)},s.prototype._getMessage=function(t){var e=this._messages;return e[t]||(e[t]=this._compileMessage(t)),e[t]},s.prototype._getRelativeUnits=function(t,e){var r=this._fields[e];return r.relative?r.relative[t]:void 0},s.prototype._findFields=function(t){for(var e=s.__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)},s.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=u(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:0>a?"past":"future"})},s.prototype._isValidUnits=function(t){if(!t||$.call(q,t)>=0)return!0;if("string"==typeof t){var e=/s$/.test(t)&&t.substr(0,t.length-1);if(e&&$.call(q,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: "'+q.join('", "')+'"')},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;r>e;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)},s.prototype._resolveStyle=function(t){if(!t)return z[0];if($.call(z,t)>=0)return t;throw new Error('"'+t+'" is not a valid IntlRelativeFormat `style` value, it must be one of: "'+z.join('", "')+'"')},s.prototype._selectUnits=function(t){var e,r,n;for(e=0,r=q.length;r>e&&(n=q[e],!(Math.abs(t[n])<s.thresholds[n]));e+=1);return n};var H={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"}}}}};s.__addLocaleData(H),s.defaultLocale="en";var W=function _t(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];M.classCallCheck(this,_t);var r="ordinal"===e.style,n=d(h(t));this.format=function(t){return n(t,r)}},K=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},Q=Object.prototype.hasOwnProperty,X=function(){try{return!!Object.defineProperty({},"a",{})}catch(t){return!1}}(),Y=(!X&&!Object.prototype.__defineGetter__,X?Object.defineProperty:function(t,e,r){"get"in r&&t.__defineGetter__?t.__defineGetter__(e,r.get):(!Q.call(t,e)||"value"in r)&&(t[e]=r.value)}),tt=Object.create||function(t,e){function r(){}var n,o;r.prototype=t,n=new r;for(o in e)Q.call(e,o)&&Y(n,o,e[o]);return n},et={getDateTimeFormat:y(Intl.DateTimeFormat),getNumberFormat:y(Intl.NumberFormat),getMessageFormat:y(i),getRelativeFormat:y(s),getPluralFormat:y(W),now:Date.now()},rt={type:Boolean},nt={type:Number},ot={type:String},at=function(t){return{validator:function(e){return t.indexOf(e)>-1}}},it={localeMatcher:at(["best fit","lookup"]),formatMatcher:at(["basic","best fit"]),timeZone:ot,hour12:rt,weekday:at(["narrow","short","long"]),era:at(["narrow","short","long"]),year:at(["numeric","2-digit"]),month:at(["numeric","2-digit","narrow","short","long"]),day:at(["numeric","2-digit"]),hour:at(["numeric","2-digit"]),minute:at(["numeric","2-digit"]),second:at(["numeric","2-digit"]),timeZoneName:at(["short","long"])},lt={localeMatcher:at(["best fit","lookup"]),style:at(["decimal","currency","percent"]),currency:ot,currencyDisplay:at(["symbol","code","name"]),useGrouping:rt,minimumIntegerDigits:nt,minimumFractionDigits:nt,maximumFractionDigits:nt,minimumSignificantDigits:nt,maximumSignificantDigits:nt},ut={style:at(["best fit","numeric"]),units:at(["second","minute","hour","day","month","year"])},st={style:at(["cardinal","ordinal"])},ct={"&":"&",">":">","<":"<",'"':""","'":"'"},ft=/[&><"']/g,pt=Object.keys(it),mt=Object.keys(lt),ht=Object.keys(ut),dt=Object.keys(st),yt={second:60,minute:60,hour:24,day:30,month:12},vt=Object.freeze({formatDate:O,formatTime:A,formatRelative:j,formatNumber:L,formatPlural:D,formatMessage:P,formatHTMLMessage:C}),gt={install:function(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];t.addLocaleData=c,t.registerMessages=f.bind(null,t),t.registerFormats=p.bind(null,t),t.setLocale=m.bind(null,t),t.__format_state=et,t.__format_config={formats:e.defaultFormats||{},messages:{},defaultLocale:e.defaultLocale||"en",defaultFormats:e.defaultFormats||{}};var r=!0,n=!1,o=void 0;try{for(var a,i=function(){var e=a.value;t.prototype["$"+e]=function(){var r={locale:t.locale};Object.assign(r,t.__format_config);for(var n=t.__format_state,o=arguments.length,a=Array(o),i=0;o>i;i++)a[i]=arguments[i];return vt[e].apply(vt,[r,n].concat(a))}},l=Object.getOwnPropertyNames(vt).filter(function(t){return vt[t]instanceof Function})[Symbol.iterator]();!(r=(a=l.next()).done);r=!0)i()}catch(u){n=!0,o=u}finally{try{!r&&l["return"]&&l["return"]()}finally{if(n)throw o}}}};return gt}); | ||
//# sourceMappingURL=vue-intl.min.js.map |
{ | ||
"name": "vue-intl", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "Vue Plugin for FormatJS Internalization and Localization", | ||
@@ -5,0 +5,0 @@ "main": "dist/vue-intl.js", |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
439609