!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).IntlMessageFormat={})}(this,function(e){"use strict";var Xt,t,r,n;function C(e){return e.type===Xt.literal}function E(e){return e.type===Xt.select}function D(e){return e.type===Xt.plural}function F(e){return e&&"object"==typeof e&&1===e.type}(t=Xt=Xt||{})[t.literal=0]="literal",t[t.argument=1]="argument",t[t.number=2]="number",t[t.date=3]="date",t[t.time=4]="time",t[t.select=5]="select",t[t.plural=6]="plural",t[t.pound=7]="pound",t[t.tag=8]="tag",(n=r=r||{})[n.number=0]="number",n[n.dateTime=1]="dateTime";var a,o,u=(a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),er=function(){return(er=Object.assign||function(e){for(var t,r=1,n=arguments.length;r",m=yt("/>",!1),d=function(e){return er({type:Xt.literal,value:e.join("")},Qt())},y=function(e,t,r){return e!==r&&dt('Mismatch tag "'+e+'" !== "'+r+'"',mt()),er({type:Xt.tag,value:e,children:t},Qt())},v=function(){return qt.push("openingTag"),!0},A=">",b=yt(">",!1),w=function(e){return qt.pop(),!0},x=function(e){return e},C=""===e)},Ye="\n",$e=yt("\n",!1),qe=function(e){return"<"===e||">"===e||"{"===e||"}"===e||Kt()&&"#"===e},Je=At("argNameOrNumber"),Ke=At("validTag"),Qe=At("argNumber"),We="0",Xe=yt("0",!1),et=function(){return 0},tt=/^[1-9]/,rt=vt([["1","9"]],!1,!1),nt=/^[0-9]/,at=vt([["0","9"]],!1,!1),ot=function(e){return parseInt(e.join(""),10)},ut=At("argName"),it=At("tagName"),ct=0,st=0,lt=[{line:1,column:1}],ft=0,pt=[],ht=0;if(void 0!==(e=void 0!==e?e:{}).startRule){if(!(e.startRule in r))throw new Error("Can't start parsing from rule \""+e.startRule+'".');n=r[e.startRule]}function gt(){return f.substring(st,ct)}function mt(){return wt(st,ct)}function dt(e,t){throw t=void 0!==t?t:wt(st,ct),new tr(e,[],"",t)}function yt(e,t){return{type:"literal",text:e,ignoreCase:t}}function vt(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function At(e){return{type:"other",description:e}}function bt(e){var t,r=lt[e];if(r)return r;for(t=e-1;!lt[t];)t--;for(r={line:(r=lt[t]).line,column:r.column};tct?(a=f.charAt(ct),ct++):(a=p,0===ht&&xt(P)),a!==p?n=[n,a]:(ct=r,p)):(ct=r,p))!==p)for(;r!==p;)t.push(r),n=r=ct,ht++,(a=Nt())===p&&(j.test(f.charAt(ct))?(a=f.charAt(ct),ct++):(a=p,0===ht&&xt(N))),ht--,r=(n=a===p?void 0:(ct=n,p))!==p?(f.length>ct?(a=f.charAt(ct),ct++):(a=p,0===ht&&xt(P)),a!==p?n=[n,a]:(ct=r,p)):(ct=r,p);else t=p;return e=t!==p?f.substring(e,ct):t,ht--,e===p&&(t=p,0===ht&&xt(O)),e}function kt(){var e,t,r;return ht++,e=ct,47===f.charCodeAt(ct)?(t=L,ct++):(t=p,0===ht&&xt(V)),e=t!==p&&(r=It())!==p?(st=e,t=M(r)):(ct=e,p),ht--,e===p&&(t=p,0===ht&&xt(R)),e}function _t(){var e,t,r,n;if(ht++,e=ct,Rt()!==p)if((t=It())!==p){for(r=[],n=kt();n!==p;)r.push(n),n=kt();e=r!==p?(st=e,Z(t,r)):(ct=e,p)}else ct=e,e=p;else ct=e,e=p;return ht--,e===p&&(0===ht&&xt(z)),e}function St(){var e,t,r,n=ct;if(39===f.charCodeAt(ct)?(e=X,ct++):(e=p,0===ht&&xt(ee)),e!==p){if(t=[],(r=Vt())===p&&(te.test(f.charAt(ct))?(r=f.charAt(ct),ct++):(r=p,0===ht&&xt(re))),r!==p)for(;r!==p;)t.push(r),(r=Vt())===p&&(te.test(f.charAt(ct))?(r=f.charAt(ct),ct++):(r=p,0===ht&&xt(re)));else t=p;n=t!==p?(39===f.charCodeAt(ct)?(r=X,ct++):(r=p,0===ht&&xt(ee)),r!==p?e=[e,t,r]:(ct=n,p)):(ct=n,p)}else ct=n,n=p;if(n===p)if(n=[],(e=Vt())===p&&(ne.test(f.charAt(ct))?(e=f.charAt(ct),ct++):(e=p,0===ht&&xt(ae))),e!==p)for(;e!==p;)n.push(e),(e=Vt())===p&&(ne.test(f.charAt(ct))?(e=f.charAt(ct),ct++):(e=p,0===ht&&xt(ae)));else n=p;return n}function Tt(){var e,t=[];if(oe.test(f.charAt(ct))?(e=f.charAt(ct),ct++):(e=p,0===ht&&xt(ue)),e!==p)for(;e!==p;)t.push(e),oe.test(f.charAt(ct))?(e=f.charAt(ct),ct++):(e=p,0===ht&&xt(ue));else t=p;return t}function Ot(){var e,t,r,n,a=ct,o=Rt();return a=o!==p&&(e=Gt())!==p&&Rt()!==p?(123===f.charCodeAt(ct)?(t=I,ct++):(t=p,0===ht&&xt(k)),t!==p?(st=ct,(De()?void 0:p)!==p&&(r=Et())!==p?(125===f.charCodeAt(ct)?(n=_,ct++):(n=p,0===ht&&xt(S)),n!==p?(st=a,o=Fe(e,r)):(ct=a,p)):(ct=a,p)):(ct=a,p)):(ct=a,p)}function jt(){var e,t,r,n,a,o,u,i,c=ct,s=Rt();return c=s!==p?(i=u=ct,61===f.charCodeAt(ct)?(a=Ce,ct++):(a=p,0===ht&&xt(Ee)),(u=(i=a!==p&&(o=Lt())!==p?a=[a,o]:(ct=i,p))!==p?f.substring(u,ct):i)===p&&(u=Gt()),(e=u)!==p&&Rt()!==p?(123===f.charCodeAt(ct)?(t=I,ct++):(t=p,0===ht&&xt(k)),t!==p?(st=ct,(Ie()?void 0:p)!==p&&(r=Et())!==p?(125===f.charCodeAt(ct)?(n=_,ct++):(n=p,0===ht&&xt(S)),n!==p?(st=c,s=ke(e,r)):(ct=c,p)):(ct=c,p)):(ct=c,p)):(ct=c,p)):(ct=c,p)}function Nt(){var e;return ht++,Se.test(f.charAt(ct))?(e=f.charAt(ct),ct++):(e=p,0===ht&&xt(Te)),ht--,e===p&&0===ht&&xt(_e),e}function Pt(){var e;return ht++,je.test(f.charAt(ct))?(e=f.charAt(ct),ct++):(e=p,0===ht&&xt(Ne)),ht--,e===p&&0===ht&&xt(Oe),e}function Rt(){var e,t,r;for(ht++,e=ct,t=[],r=Nt();r!==p;)t.push(r),r=Nt();return e=t!==p?f.substring(e,ct):t,ht--,e===p&&(t=p,0===ht&&xt(Pe)),e}function Lt(){var e,t,r;return ht++,e=ct,45===f.charCodeAt(ct)?(t=Le,ct++):(t=p,0===ht&&xt(Ve)),t===p&&(t=null),e=t!==p&&(r=Ut())!==p?(st=e,t=Me(t,r)):(ct=e,p),ht--,e===p&&(t=p,0===ht&&xt(Re)),e}function Vt(){var e,t;return ht++,e=ct,f.substr(ct,2)===Ze?(t=Ze,ct+=2):(t=p,0===ht&&xt(Be)),t!==p&&(st=e,t=Ue()),ht--,(e=t)===p&&(t=p,0===ht&&xt(ze)),e}function Mt(){var e,t,r,n,a,o=ct;if(39===f.charCodeAt(ct)?(e=X,ct++):(e=p,0===ht&&xt(ee)),e!==p)if((t=function(){var e,t,r,n;t=e=ct,f.length>ct?(r=f.charAt(ct),ct++):(r=p,0===ht&&xt(P));t=r!==p?(st=ct,n=qe(r),(n=n?void 0:p)!==p?r=[r,n]:(ct=t,p)):(ct=t,p);e=t!==p?f.substring(e,ct):t;return e}())!==p){for(r=ct,n=[],f.substr(ct,2)===Ze?(a=Ze,ct+=2):(a=p,0===ht&&xt(Be)),a===p&&(te.test(f.charAt(ct))?(a=f.charAt(ct),ct++):(a=p,0===ht&&xt(re)));a!==p;)n.push(a),f.substr(ct,2)===Ze?(a=Ze,ct+=2):(a=p,0===ht&&xt(Be)),a===p&&(te.test(f.charAt(ct))?(a=f.charAt(ct),ct++):(a=p,0===ht&&xt(re)));o=(r=n!==p?f.substring(r,ct):n)!==p?(39===f.charCodeAt(ct)?(n=X,ct++):(n=p,0===ht&&xt(ee)),n===p&&(n=null),n!==p?(st=o,e=Ge(t,r)):(ct=o,p)):(ct=o,p)}else ct=o,o=p;else ct=o,o=p;return o}function zt(){var e,t,r=ct,n=ct;return f.length>ct?(e=f.charAt(ct),ct++):(e=p,0===ht&&xt(P)),(n=e!==p?(st=ct,(t=(t=He(e))?void 0:p)!==p?e=[e,t]:(ct=n,p)):(ct=n,p))===p&&(10===f.charCodeAt(ct)?(n=Ye,ct++):(n=p,0===ht&&xt($e))),r=n!==p?f.substring(r,ct):n}function Zt(){var e,t;return ht++,e=ct,(t=Ut())===p&&(t=Gt()),e=t!==p?f.substring(e,ct):t,ht--,e===p&&(t=p,0===ht&&xt(Je)),e}function Bt(){var e,t;return ht++,e=ct,(t=Ut())===p&&(t=function(){var e,t,r,n,a;ht++,e=ct,t=[],45===f.charCodeAt(ct)?(r=Le,ct++):(r=p,0===ht&&xt(Ve));r===p&&(n=r=ct,ht++,(a=Nt())===p&&(a=Pt()),ht--,n=a===p?void 0:(ct=n,p),r=n!==p?(f.length>ct?(a=f.charAt(ct),ct++):(a=p,0===ht&&xt(P)),a!==p?n=[n,a]:(ct=r,p)):(ct=r,p));if(r!==p)for(;r!==p;)t.push(r),45===f.charCodeAt(ct)?(r=Le,ct++):(r=p,0===ht&&xt(Ve)),r===p&&(n=r=ct,ht++,(a=Nt())===p&&(a=Pt()),ht--,n=a===p?void 0:(ct=n,p),r=n!==p?(f.length>ct?(a=f.charAt(ct),ct++):(a=p,0===ht&&xt(P)),a!==p?n=[n,a]:(ct=r,p)):(ct=r,p));else t=p;e=t!==p?f.substring(e,ct):t;ht--,e===p&&(t=p,0===ht&&xt(it));return e}()),e=t!==p?f.substring(e,ct):t,ht--,e===p&&(t=p,0===ht&&xt(Ke)),e}function Ut(){var e,t,r,n,a;if(ht++,e=ct,48===f.charCodeAt(ct)?(t=We,ct++):(t=p,0===ht&&xt(Xe)),t!==p&&(st=e,t=et()),(e=t)===p){if(t=e=ct,tt.test(f.charAt(ct))?(r=f.charAt(ct),ct++):(r=p,0===ht&&xt(rt)),r!==p){for(n=[],nt.test(f.charAt(ct))?(a=f.charAt(ct),ct++):(a=p,0===ht&&xt(at));a!==p;)n.push(a),nt.test(f.charAt(ct))?(a=f.charAt(ct),ct++):(a=p,0===ht&&xt(at));t=n!==p?r=[r,n]:(ct=t,p)}else ct=t,t=p;t!==p&&(st=e,t=ot(t)),e=t}return ht--,e===p&&(t=p,0===ht&&xt(Qe)),e}function Gt(){var e,t,r,n,a;if(ht++,t=[],n=r=e=ct,ht++,(a=Nt())===p&&(a=Pt()),ht--,(r=(n=a===p?void 0:(ct=n,p))!==p?(f.length>ct?(a=f.charAt(ct),ct++):(a=p,0===ht&&xt(P)),a!==p?n=[n,a]:(ct=r,p)):(ct=r,p))!==p)for(;r!==p;)t.push(r),n=r=ct,ht++,(a=Nt())===p&&(a=Pt()),ht--,r=(n=a===p?void 0:(ct=n,p))!==p?(f.length>ct?(a=f.charAt(ct),ct++):(a=p,0===ht&&xt(P)),a!==p?n=[n,a]:(ct=r,p)):(ct=r,p);else t=p;return e=t!==p?f.substring(e,ct):t,ht--,e===p&&(t=p,0===ht&&xt(ut)),e}var Ht,Yt,$t,qt=["root"];function Jt(){return 1