(function(n,t){typeof define=="function"&&define.amd?define(t):typeof module=="object"&&typeof module.exports=="object"?module.exports=t():n.Cldr=t()})(this,function(){var i=Array.isArray||function(n){return Object.prototype.toString.call(n)==="[object Array]"},c=function(n,t){if(i(n)&&(n=n.join("/")),typeof n!="string")throw new Error('invalid path "'+n+'"');return n=n.replace(/^\//,"").replace(/^cldr\//,""),n=n.replace(/{[a-zA-Z]+}/g,function(n){return n=n.replace(/^{([^}]*)}$/,"$1"),t[n]}),n.split("/")},l=function(n,t){var i,r;if(n.some)return n.some(t);for(i=0,r=n.length;i<r;i++)if(t(n[i],i,n))return!0;return!1},u=function(n,t,i,r){var e,h,u=i[0],f=i[1],s=n.localeSep,o=i[2],c=i.slice(3,4);return(r=r||{},u!=="und"&&f!=="Zzzz"&&o!=="ZZ")?[u,f,o].concat(c):typeof t.get("supplemental/likelySubtags")=="undefined"?void 0:(h=l([[u,f,o],[u,o],[u,f],[u],["und",f]],function(n){return e=!/\b(Zzzz|ZZ)\b/.test(n.join(s))&&t.get(["supplemental/likelySubtags",n.join(s)])}),h?(e=e.split(s),[u!=="und"?u:e[0],f!=="Zzzz"?f:e[1],o!=="ZZ"?o:e[2]].concat(c)):r.force?t.get("supplemental/likelySubtags/und").split(s):void 0)},a=function(n,t,i){var f,e,r=i[0],o=i[1],s=i[2],h=i[3];return(e=l([[[r,"Zzzz","ZZ"],[r]],[[r,"Zzzz",s],[r,s]],[[r,o,"ZZ"],[r,o]]],function(r){var e=u(n,t,r[0]);return f=r[1],e&&e[0]===i[0]&&e[1]===i[1]&&e[2]===i[2]}),e)?(h&&f.push(h),f):i},v=function(n){var t,r,i=[];return(n=n.replace(/_/,"-"),t=n.split("-u-"),t[1]&&(t[1]=t[1].split("-t-"),n=t[0]+(t[1][1]?"-t-"+t[1][1]:""),i[4]=t[1][0]),r=n.split("-t-")[0],t=r.match(/^(([a-z]{2,3})(-([A-Z][a-z]{3}))?(-([A-Z]{2}|[0-9]{3}))?)((-([a-zA-Z0-9]{5,8}|[0-9][a-zA-Z0-9]{3}))*)$|^(root)$/),t===null)?["und","Zzzz","ZZ"]:(i[0]=t[10]||t[2]||"und",i[1]=t[4]||"Zzzz",i[2]=t[6]||"ZZ",t[7]&&t[7].length&&(i[3]=t[7].slice(1)),i)},f=function(n,t){var i,r;if(n.forEach)return n.forEach(t);for(i=0,r=n.length;i<r;i++)t(n[i],i,n)},d=function(n,t,i){var r=n._availableBundleMap,e=n._availableBundleMapQueue;return e.length&&(f(e,function(i){var e,o,f,s;(s=v(i),o=u(n,t,s),f=a(n,t,o),f=f.join(n.localeSep),e=r[f],e&&e.length<i.length)||(r[f]=i)}),n._availableBundleMapQueue=[]),r[i]||null},g=function(n){var t,i=[];if(Object.keys)return Object.keys(n);for(t in n)i.push(t);return i},y=function(n,t){var i,r;return r=n+(t&&JSON?": "+JSON.stringify(t):""),i=new Error(r),i.code=n,f(g(t),function(n){i[n]=t[n]}),i},e=function(n,t,i){if(!t)throw y(n,i);},t=function(n,t){e("E_MISSING_PARAMETER",typeof n!="undefined",{name:t})},r=function(n,t,i,r){e("E_INVALID_PAR_TYPE",i,{expected:r,name:t,value:n})},o=function(n,t){r(n,t,typeof n=="string"||i(n),"String or Array")},nt=function(n){return n!==null&&""+n=="[object Object]"},p=function(n,t){r(n,t,typeof n=="undefined"||nt(n),"Plain Object")},tt=function(n,t){r(n,t,typeof n=="string","a string")},s=function(n,t){for(var r=n,u=t.length,i=0;i<u-1;i++)if(r=r[t[i]],!r)return undefined;return r[t[i]]},it=function(n,t){var i,u=n._availableBundleMapQueue,r=s(t,["main"]);if(r)for(i in r)r.hasOwnProperty(i)&&i!=="root"&&u.indexOf(i)===-1&&u.push(i)},h=function(n){return i(n)?n:[n]},w=function(){var n=function(){var t={},r=[].slice.call(arguments,0);return f(r,function(r){for(var u in r)t[u]=u in t&&typeof t[u]=="object"&&!i(t[u])?n(t[u],r[u]):r[u]}),t};return n}(),b=function(n,i,r){var e,u,f;for(t(r[0],"json"),e=0;e<r.length;e++)for(f=h(r[e]),u=0;u<f.length;u++)p(f[u],"json"),i=w(i,f[u]),it(n,f[u]);return i},k=function(n,t,i){var r=c(t,i);return s(n._resolved,r)},n=function(n){this.init(n)};return n._alwaysArray=h,n._coreLoad=b,n._createError=y,n._itemGetResolved=k,n._jsonMerge=w,n._pathNormalize=c,n._resourceGet=s,n._validatePresence=t,n._validateType=r,n._validateTypePath=o,n._validateTypePlainObject=p,n._availableBundleMap={},n._availableBundleMapQueue=[],n._resolved={},n.localeSep="-",n.load=function(){n._resolved=b(n,n._resolved,arguments)},n.prototype.init=function(i){var s,y,f,h,p,r,c,e,w,o=n.localeSep,l="";t(i,"locale");tt(i,"locale");r=v(i);r.length===5&&(e=r.pop(),l=o+"u"+o+e,r[3]||r.pop());w=r[3];f=u(n,this,r,{force:!0})||r;y=f[0];p=f[1];c=f[2];h=a(n,this,f).join(o);this.attributes=s={bundle:d(n,this,h),minLanguageId:h+l,maxLanguageId:f.join(o)+l,language:y,script:p,territory:c,region:c,variant:w};e&&("-"+e).replace(/-[a-z]{3,8}|(-[a-z]{2})-([a-z]{3,8})/g,function(n,t,i){t?s["u"+t]=i:s["u"+n]=!0});this.locale=i},n.prototype.get=function(i){return t(i,"path"),o(i,"path"),k(n,i,this.attributes)},n.prototype.main=function(n){return t(n,"path"),o(n,"path"),e("E_MISSING_BUNDLE",this.attributes.bundle!==null,{locale:this.locale}),n=h(n),this.get(["main/{bundle}"].concat(n))},n}),function(n){typeof define=="function"&&define.amd?define(["../cldr"],n):typeof module=="object"&&typeof module.exports=="object"?module.exports=n(require("../cldr")):n(Cldr)}(function(n){function y(n,t){f(n,t,typeof n=="string"||n instanceof RegExp,"String or RegExp")}function r(n,t){return function(i,r){return u(i,"event"),y(i,"event"),u(r,"listener"),e(r,"listener"),t[n].apply(t,arguments)}}function h(n){return r("off",n)}function c(n){return r("on",n)}function l(n){return r("once",n)}function a(){o=n.prototype.get;n.prototype.get=function(n){var i=o.apply(this,arguments);return n=v(n,this.attributes).join("/"),t.trigger("get",[n,i]),this.ee.trigger("get",[n,i]),i}}var v=n._pathNormalize,u=n._validatePresence,f=n._validateType,i,e,o,s,t;return i=function(){function i(){}function r(n,t){for(var i=n.length;i--;)if(n[i].listener===t)return i;return-1}function t(n){return function(){return this[n].apply(this,arguments)}}var n=i.prototype,u={};return n.getListeners=function(n){var t=this._getEvents(),r,i;if(n instanceof RegExp){r={};for(i in t)t.hasOwnProperty(i)&&n.test(i)&&(r[i]=t[i])}else r=t[n]||(t[n]=[]);return r},n.flattenListeners=function(n){for(var i=[],t=0;t<n.length;t+=1)i.push(n[t].listener);return i},n.getListenersAsObject=function(n){var t=this.getListeners(n),i;return t instanceof Array&&(i={},i[n]=t),i||t},n.addListener=function(n,t){var i=this.getListenersAsObject(n),f=typeof t=="object";for(var u in i)i.hasOwnProperty(u)&&r(i[u],t)===-1&&i[u].push(f?t:{listener:t,once:!1});return this},n.on=t("addListener"),n.addOnceListener=function(n,t){return this.addListener(n,{listener:t,once:!0})},n.once=t("addOnceListener"),n.defineEvent=function(n){return this.getListeners(n),this},n.defineEvents=function(n){for(var t=0;t<n.length;t+=1)this.defineEvent(n[t]);return this},n.removeListener=function(n,t){var i=this.getListenersAsObject(n),u;for(var f in i)i.hasOwnProperty(f)&&(u=r(i[f],t),u!==-1&&i[f].splice(u,1));return this},n.off=t("removeListener"),n.addListeners=function(n,t){return this.manipulateListeners(!1,n,t)},n.removeListeners=function(n,t){return this.manipulateListeners(!0,n,t)},n.manipulateListeners=function(n,t,i){var r,u,f=n?this.removeListener:this.addListener,e=n?this.removeListeners:this.addListeners;if(typeof t!="object"||t instanceof RegExp)for(r=i.length;r--;)f.call(this,t,i[r]);else for(r in t)t.hasOwnProperty(r)&&(u=t[r])&&(typeof u=="function"?f.call(this,r,u):e.call(this,r,u));return this},n.removeEvent=function(n){var r=typeof n,t=this._getEvents(),i;if(r==="string")delete t[n];else if(n instanceof RegExp)for(i in t)t.hasOwnProperty(i)&&n.test(i)&&delete t[i];else delete this._events;return this},n.removeAllListeners=t("removeEvent"),n.emitEvent=function(n,t){var r=this.getListenersAsObject(n),i,f,u,e;for(u in r)if(r.hasOwnProperty(u))for(f=r[u].length;f--;)i=r[u][f],i.once===!0&&this.removeListener(n,i.listener),e=i.listener.apply(this,t||[]),e===this._getOnceReturnValue()&&this.removeListener(n,i.listener);return this},n.trigger=t("emitEvent"),n.emit=function(n){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(n,t)},n.setOnceReturnValue=function(n){return this._onceReturnValue=n,this},n._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},n._getEvents=function(){return this._events||(this._events={})},i.noConflict=function(){return u.EventEmitter=originalGlobalValue,i},i}(),e=function(n,t){f(n,t,typeof n=="undefined"||typeof n=="function","Function")},t=new i,n.off=h(t),n.on=c(t),n.once=l(t),s=n.prototype.init,n.prototype.init=function(){var n;this.ee=n=new i;this.off=h(n);this.on=c(n);this.once=l(n);s.apply(this,arguments)},n._eventInit=a,a(),n}),function(n){typeof define=="function"&&define.amd?define(["../cldr"],n):typeof module=="object"&&typeof module.exports=="object"?module.exports=n(require("../cldr")):n(Cldr)}(function(n){var t=n._alwaysArray,i=function(n){var r,i;return r=function(i){return function(r){return r=t(r),n.get([i].concat(r))}},i=r("supplemental"),i.weekData=r("supplemental/weekData"),i.weekData.firstDay=function(){return n.get("supplemental/weekData/firstDay/{territory}")||n.get("supplemental/weekData/firstDay/001")},i.weekData.minDays=function(){var t=n.get("supplemental/weekData/minDays/{territory}")||n.get("supplemental/weekData/minDays/001");return parseInt(t,10)},i.timeData=r("supplemental/timeData"),i.timeData.allowed=function(){return n.get("supplemental/timeData/{territory}/_allowed")||n.get("supplemental/timeData/001/_allowed")},i.timeData.preferred=function(){return n.get("supplemental/timeData/{territory}/_preferred")||n.get("supplemental/timeData/001/_preferred")},i},r=n.prototype.init;return n.prototype.init=function(){r.apply(this,arguments);this.supplemental=i(this)},n}),function(n){typeof define=="function"&&define.amd?define(["../cldr"],n):typeof module=="object"&&typeof module.exports=="object"?module.exports=n(require("../cldr")):n(Cldr)}(function(n){var r=n._coreLoad,u=n._jsonMerge,i=n._pathNormalize,t=n._resourceGet,f=n._validatePresence,e=n._validateTypePath,o=function(n,r){var f,u;if(r!=="root")return(f=i(["supplemental/parentLocales/parentLocale",r]),u=t(n._resolved,f)||t(n._raw,f),u)?u:(u=r.substr(0,r.lastIndexOf(n.localeSep)),!u)?"root":u},s=function(n,t,i){for(var u=n,f=t.length,r=0;r<f-1;r++)u[t[r]]||(u[t[r]]={}),u=u[t[r]];u[t[r]]=i},h=function(){var n;return n=function(r,f,e,h,c){var a,v,l;if(typeof f!="undefined"&&f!==c)return(a=i(e,h),l=t(r._resolved,a),l!==undefined&&typeof l!="object")?l:(l=t(r._raw,a),l===undefined&&(v=o(r,f),l=n(r,v,e,u(h,{bundle:v}),f)),l!==undefined&&s(r._resolved,a,l),l)}}();return n._raw={},n.load=function(){n._raw=r(n,n._raw,arguments)},n.prototype.get=function(t){return f(t,"path"),e(t,"path"),h(n,this.attributes&&this.attributes.bundle||"",t,this.attributes)},n._eventInit&&n._eventInit(),n}),function(n,t){typeof define=="function"&&define.amd?define(["cldr","cldr/event"],t):typeof exports=="object"?module.exports=t(require("cldrjs")):n.Globalize=t(n.Cldr)}(this,function(n){function y(n){n.once("get",h);n.get("supplemental/likelySubtags")}function t(n){if(!(this instanceof t))return new t(n);c(n,"locale");l(n,"locale");this.cldr=v(n);y(this.cldr)}var p=function(n){return typeof n=="string"?n:typeof n=="number"?""+n:JSON.stringify(n)},u=function(n,t){return n.replace(/{[0-9a-zA-Z-_. ]+}/g,function(n){return n=n.replace(/^{([^}]*)}$/,"$1"),p(t[n])})},f=function(){var n=arguments[0],t=[].slice.call(arguments,1);return t.forEach(function(t){for(var i in t)n[i]=t[i]}),n},e=function(n,t,i){var r;return t=n+(t?": "+u(t,i):""),r=new Error(t),r.code=n,f(r,i),r},o=function(n){return JSON.stringify(n,function(n,t){return t&&t.runtimeKey?t.runtimeKey:t})},w=function(n){return[].reduce.call(n,function(n,t){var i=t.charCodeAt(0);return n=(n<<5)-n+i,n|0},0)},b=function(n,t,i,r){var u;return r=r||o(i),u=w(n+t+r),u>0?"a"+u:"b"+Math.abs(u)},k=function(n){if(n.name!==undefined)return n.name;var t=/^function\s+([\w\$]+)\s*\(/.exec(n.toString());if(t&&t.length>0)return t[1]},d=function(n,t,i,r){var f=o(n),u=k(i),e=t.locale;return u?(i.runtimeKey=b(u,e,null,f),i.generatorString=function(){return'Globalize("'+e+'").'+u+"("+f.slice(1,-1)+")"},i.runtimeArgs=r,i):i},i=function(n,t,i,r){if(!i)throw e(n,t,r);},s=function(n){return Array.isArray(n)?n:n?[n]:[]},h=function(n,t,r){var u;r=r||{};u=s(r.skip).some(function(t){return t.test(n)});i("E_MISSING_CLDR","Missing required CLDR content `{path}`.",t||u,{path:n})},g=function(n){i("E_DEFAULT_LOCALE_NOT_DEFINED","Default locale has not been defined.",n!==undefined,{})},c=function(n,t){i("E_MISSING_PARAMETER","Missing required parameter `{name}`.",n!==undefined,{name:t})},nt=function(n,t,r,u){i("E_PAR_OUT_OF_RANGE","Parameter `{name}` has value `{value}` out of range [{minimum}, {maximum}].",n===undefined||n>=r&&n<=u,{maximum:u,minimum:r,name:t,value:n})},r=function(n,t,r,u){i("E_INVALID_PAR_TYPE","Invalid `{name}` parameter ({value}). {expected} expected.",r,{expected:u,name:t,value:n})},l=function(t,i){r(t,i,t===undefined||typeof t=="string"||t instanceof n,"String or Cldr instance")},a=function(n){return n!==null&&""+n=="[object Object]"},tt=function(n,t){r(n,t,n===undefined||a(n),"Plain Object")},v=function(t){return t instanceof n?t:new n(t)},it=function(n){return n.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")},rt=function(n,t,i){var r;for(typeof n!="string"&&(n=String(n)),r=n.length;r<t;r+=1)n=i?n+"0":"0"+n;return n};return t.load=function(){n.load.apply(n,arguments)},t.locale=function(n){return l(n,"locale"),arguments.length&&(this.cldr=v(n),y(this.cldr)),this.cldr},t._alwaysArray=s,t._createError=e,t._formatMessage=u,t._isPlainObject=a,t._objectExtend=f,t._regexpEscape=it,t._runtimeBind=d,t._stringPad=rt,t._validate=i,t._validateCldr=h,t._validateDefaultLocale=g,t._validateParameterPresence=c,t._validateParameterRange=nt,t._validateParameterTypePlainObject=tt,t._validateParameterType=r,t}),function(n,t){typeof define=="function"&&define.amd?define(["cldr","../globalize","cldr/event","cldr/supplemental"],t):typeof exports=="object"?module.exports=t(require("cldrjs"),require("../globalize")):t(n.Cldr,n.Globalize)}(this,function(n,t){function ii(n){var u=n[2],r=n[3],e=n[4],t=n[5],i=n[6];if(isNaN(t*i))if(isNaN(t)&&isNaN(i))f(u,"minimumIntegerDigits",1,21),f(r,"minimumFractionDigits",0,20),f(e,"maximumFractionDigits",r,20);else throw new Error("Neither or both the minimum and maximum significant digits must be present");else f(t,"minimumSignificantDigits",1,21),f(i,"maximumSignificantDigits",t,21)}var ut=t._createError,r=t._regexpEscape,w=t._runtimeBind,s=t._stringPad,h=t._validateCldr,b=t._validateDefaultLocale,c=t._validateParameterPresence,f=t._validateParameterRange,k=t._validateParameterType,d=t._validateParameterTypePlainObject,u=function(n){return ut("E_UNSUPPORTED","Unsupported {feature}.",{feature:n})},a=function(n,t){k(n,t,n===undefined||typeof n=="number","Number")},v=function(n,t){k(n,t,n===undefined||typeof n=="string","a string")},ft=/^([^0]*)(0+)([^0]*)$/,et=function(n,t,i){var r,f=t,u="",e=",",o=i?!0:!1;for(n=String(n).split("."),r=n[0].length;r>f;)u=n[0].slice(r-f,r)+(u.length?e:"")+u,r-=f,o&&(f=i,o=!1);return n[0]=n[0].slice(0,r)+(u.length?e:"")+u,n.join(".")},ot=function(n,t,i,r,u,f){return n=r?f?u(n,f):u(n,{exponent:-r}):u(n),n=String(n),r&&/e-/.test(n)&&(n=(+n).toFixed(r).replace(/0+$/,"").replace(/\.$/,"")),i&&(n=n.split("."),n[1]=s(n[1]||"",i,!0),n=n.join(".")),t&&(n=n.split("."),n[0]=s(n[0],t),n=n.join(".")),n},g=function(n,t,i){var r;return r=Math.ceil(Math.log(Math.abs(n))/Math.log(10)),r-=t,i(n,{exponent:r})},st=function(n,t,i,r){var f,e;if(t>i&&(i=t),f=g(n,t,r),e=g(n,i,r),n=+f==+e?f:e,n=(+n).toString(10),/e/.test(n))throw u({feature:"integers out of (1e21, 1e-7)"});return t-n.replace(/^0+|\./g,"").length>0&&(n=n.split("."),n[1]=s(n[1]||"",t-n[0].replace(/^0+/,"").length,!0),n=n.join(".")),n},ht=/^(('([^']|'')*'|[^*#@0,.E])*)(\*.)?((([#,]*[0,]*0+)(\.0*[0-9]*#*)?)|([#,]*@+#*))(E\+?0+)?(('[^']+'|''|[^*#@0,.E])*)$/,y=function(n){return n[0]+n[n.length-1]!=="''"?n:n==="''"?"":n.replace(/''/g,"'").slice(1,-1)},ct=function(n,t,i){var f,b,k,c,d,g,l,nt,a,lt,o,v,s,h,p,tt,it,e,rt,r,ut,w,ht,u,ct;return(lt=t[1],g=t[2],d=t[3],k=t[4],l=t[5],c=t[6],tt=t[7],v=t[8],it=t[9],p=t[15],b=t[16],nt=t[17],rt=t[18],a=t[19],f=t[20],isNaN(n))?nt:(n<0?(s=t[12],o=t[13],e=t[14]):(s=t[11],o=t[0],e=t[10]),!isFinite(n))?o+b+e:(s.indexOf("%")!==-1?n*=100:s.indexOf("‰")!==-1&&(n*=1e3),f&&(u=Math.abs(Math.floor(n)).toString().length-1,u=Math.min(u,f.maxExponent),u>=3&&(r=f[u]&&f[u].other),r==="0"?r=null:r&&(ut=r.split("0").length-1,ht=u-(ut-1),n=n/Math.pow(10,ht))),n=isNaN(l*c)?ot(n,g,d,k,p,tt):st(n,l,c,p),f&&r&&(ct=i?i(+n):"other",r=f[u][ct]||r,w=r.match(ft),o+=w[1],e=w[3]+e),n=n.replace(/^-/,""),v&&(n=et(n,v,it)),h=o,h+=n,h+=e,h.replace(/('([^']|'')+'|'')|./g,function(n,t){return t?y(t):(n=n.replace(/[.,\-+E%\u2030]/,function(n){return rt[n]}),a&&(n=n.replace(/[0-9]/,function(n){return a[+n]})),n)}))},lt=function(n,t){return function(i){return c(i,"value"),a(i,"value"),ct(i,n,t)}},e=function(n){var t=n.attributes["u-nu"];return t?(t==="traditio"&&(t="traditional"),["native","traditional","finance"].indexOf(t)!==-1)?n.main(["numbers/otherNumberingSystems",t]):t:n.main("numbers/defaultNumberingSystem")},at=function(n,t){var r=0,i=t.main(["numbers/decimalFormats-numberSystem-"+e(t),n,"decimalFormat"]);return i=Object.keys(i).reduce(function(n,t){var u=t.split("0").length-1,f=t.split("-")[2];return n[u]=n[u]||{},n[u][f]=i[t],r=Math.max(u,r),n},{}),i.maxExponent=r,i},nt=function(n){var t,i=e(n);if(i!=="latn"){if(t=n.supplemental(["numberingSystems",i]),t._type!=="numeric")throw u("`"+t._type+"` numbering system");return t._digits}},tt=function(n){var i,r,f,e,l,o,a,t,v,s,h,y,p,w,b,k,c,d;if(n=n.match(ht),!n)throw new Error("Invalid pattern: "+n);if(y=n[1],h=n[4],e=n[5],c=n[9],b=n[10],d=n[11],c?c.replace(/(@+)(#*)/,function(n,t,i){s=t.length;a=s+i.length}):(f=n[8],l=n[7],f?(f.replace(/[0-9]+/,function(n){t=n}),t?(w=+("0."+t),t=t.length):t=0,o=f.length-1):(t=0,o=0),l.replace(/0+$/,function(n){v=n.length})),b)throw u({feature:"scientific notation (not implemented)"});if(h)throw u({feature:"padding (not implemented)"});return(i=e.lastIndexOf(","))!==-1&&(r=e.split(".")[0],p=r.length-i-1,(r=e.lastIndexOf(",",i-1))!==-1&&(k=i-1-r)),[y,h,v,t,o,s,a,w,p,k,d]},o=function(n,t){return t.main(["numbers/symbols-numberSystem-"+e(t),n])},l={".":"decimal",",":"group","%":"percentSign","+":"plusSign","-":"minusSign",E:"exponential","‰":"perMille"},vt=function(n){var t,i={};for(t in l)i[t]=o(l[t],n);return i},yt=function(n){return isNaN(n)?NaN:Math[n<0?"ceil":"floor"](n)},pt=function(n){return n=n||"round",n=n==="truncate"?yt:Math[n],function(t,i){var u,r;if(t=+t,isNaN(t))return NaN;if(typeof i=="object"&&i.exponent){if(u=+i.exponent,r=1,u===0)return n(t);if(!(typeof u=="number"&&u%1==0))return NaN}else{if(r=+i||1,r===1)return n(t);if(isNaN(r))return NaN;r=r.toExponential().split("e");u=+r[1];r=+r[0]}return t=t.toString().split("e"),t[0]=+t[0]/r,t[1]=t[1]?+t[1]-u:-u,t=n(+(t[0]+"e"+t[1])),t=t.toString().split("e"),t[0]=+t[0]*r,t[1]=t[1]?+t[1]+u:u,+(t[0]+"e"+t[1])}},it=function(n,t,i){function f(n,t){n in i&&(r[t]=i[n])}var l,e,s,h,u,c,r;return i=i||{},n=n.split(";"),u=n[0],l=n[1]||"-"+u,s=tt(l),e=s[0],h=s[10],c=pt(i.round),c.generatorString=function(){return"numberRound("+(i.round?'"'+i.round+'"':"")+")"},r=tt(u).concat([u,e+u+h,e,h,c,o("infinity",t),o("nan",t),vt(t),nt(t)]),i.compact&&(r[2]=1,r[3]=0,r[4]=0,r[5]=r[6]=undefined,r[20]=at(i.compact,t)),f("minimumIntegerDigits",2),f("minimumFractionDigits",3),f("maximumFractionDigits",4),f("minimumSignificantDigits",5),f("maximumSignificantDigits",6),i.useGrouping===!1&&(r[8]=null),"minimumFractionDigits"in i&&!("maximumFractionDigits"in i)?r[4]=Math.max(r[3],r[4]):!("minimumFractionDigits"in i)&&"maximumFractionDigits"in i&&(r[3]=Math.min(r[3],r[4])),r},wt=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804\uDCBD|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/g,bt=/[\-\u058A\u05BE\u1400\u1806\u2010-\u2015\u2E17\u2E1A\u2E3A\u2E3B\u2E40\u301C\u3030\u30A0\uFE31\uFE32\uFE58\uFE63\uFF0D\u2212]/g,kt=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/g,i=function(n){return n.replace(wt,"").replace(bt,"-").replace(kt," ")},dt=function(n,t){function v(n){return function(t){t=t.split("").map(function(n){return h[n]||s[n]||n}).join("");switch(n){case"infinity":r=Infinity;break;case"nan":r=NaN;break;case"number":t=t.replace(/,/g,"");r=+t;break;case"prefix":case"negativePrefix":l=t;break;case"suffix":f=t;break;case"negativeSuffix":f=t;c=!0;break;default:throw new Error("Internal error");}return""}}function y(n,t){return t.some(function(t){var i=n;return t.every(function(n){return i.match(e[n])===null?!1:(i=i.replace(e[n],v(n)),!0)})&&!i.length})}var o,s,h,c,r,l,u,f,e,a;return(o=[["nan"],["prefix","infinity","suffix"],["prefix","number","suffix"],["negativePrefix","infinity","negativeSuffix"],["negativePrefix","number","negativeSuffix"]],h=t[0],s=t[1]||{},e=t[2],n=i(n),a=y(n,o),!a||isNaN(r))?NaN:(u=""+l+f,u.indexOf("%")!==-1?r/=100:u.indexOf("‰")!==-1&&(r/=1e3),c&&(r*=-1),r)},gt=function(n){return function(t){return c(t,"value"),v(t,"value"),dt(t,n)}},ni=function(n){var t,i={};for(t in l)i[o(l[t],n)]=t;return i},rt=function(n,t){return Object.keys(n).map(function(i){return t([i,n[i]])}).reduce(function(n,t){return n[t[0]]=t[1],n},{})},ti=function(n,t,u){var e,d,s,l,g,nt,tt,ut,ft,et,ot,a,v,h,o,p,c,w,b,k,f=it(n,t,u);return p=i(f[0]),ut=f[4],et=f[5],ft=f[6],c=f[8],w=f[9],b=i(f[10]),a=i(f[13]),v=i(f[14]),g=i(f[16]),ot=i(f[17]),k=rt(f[18],function(n){return[n[0],i(n[1])]}),h=f[19],tt=rt(ni(t),function(n){return[i(n[0]),n[1]]}),s=h?"["+h+"]":"\\d",l=r(k[","]),d=r(k["."]),h&&(nt=h.split("").reduce(function(n,t,i){return n[t]=String(i),n},{})),e=[p,b,a,v].map(function(n){return n.replace(/('([^']|'')+'|'')|./g,function(n,t){return t?y(t):n.replace(/[\-+E%\u2030]/,function(n){return k[n]})})}),p=e[0],b=e[1],a=e[2],v=e[3],o=s+"+",c&&(e=w?s+"{1,"+w+"}(("+l+s+"{"+w+"})*("+l+s+"{"+c+"}))":s+"{1,"+c+"}("+l+s+"{"+c+"})+",o="("+e+"|"+o+")"),(!isNaN(et*ft)||ut)&&(e=d+s+"+",o=o+"("+e+"|"+d+")?|("+o+")?"+e,o="("+o+")"),[tt,nt,{infinity:new RegExp("^"+r(g)),nan:new RegExp("^"+r(ot)),negativePrefix:new RegExp("^"+r(a)),negativeSuffix:new RegExp("^"+r(v)),number:new RegExp("^"+o),prefix:new RegExp("^"+r(p)),suffix:new RegExp("^"+r(b))}]},p=function(n,t){if(n!=="decimal"&&n!=="percent")throw new Error("Invalid style");return t.main(["numbers",n+"Formats-numberSystem-"+e(t),"standard"])};return t.numberFormatter=t.prototype.numberFormatter=function(n){var f,t,i,e,r,u;d(n,"options");n=n||{};t=this.cldr;f=[n];b(t);t.on("get",h);return e=n.raw?n.raw:p(n.style||"decimal",t),r=it(e,t,n),i=[r],t.off("get",h),ii(r),n.compact&&i.push(this.pluralGenerator()),u=lt.apply(null,i),w(f,t,u,i),u},t.numberParser=t.prototype.numberParser=function(n){var f,t,e,i,r;if(d(n,"options"),n=n||{},t=this.cldr,f=[n],b(t),n.compact)throw u({feature:"compact number parsing (not implemented)"});t.on("get",h);return e=n.raw?n.raw:p(n.style||"decimal",t),i=ti(e,t,n),t.off("get",h),r=gt(i),w(f,t,r,[i]),r},t.formatNumber=t.prototype.formatNumber=function(n,t){return c(n,"value"),a(n,"value"),this.numberFormatter(t)(n)},t.parseNumber=t.prototype.parseNumber=function(n,t){return c(n,"value"),v(n,"value"),this.numberParser(t)(n)},t._createErrorUnsupportedFeature=u,t._numberNumberingSystem=e,t._numberNumberingSystemDigitsMap=nt,t._numberPattern=p,t._numberSymbol=o,t._looseMatching=i,t._removeLiteralQuotes=y,t._stringPad=s,t._validateParameterTypeNumber=a,t._validateParameterTypeString=v,t}),function(n,t){typeof define=="function"&&define.amd?define(["cldr","../globalize","./number","cldr/event","cldr/supplemental"],t):typeof exports=="object"?module.exports=t(require("cldrjs"),require("../globalize")):t(n.Cldr,n.Globalize)}(this,function(n,t){function ei(n,t){var i,u,r,o,h,c,s,f,l=ht;for(f=n.match(e),r=t.match(e),i=0;i<r.length;i++)for(o=r[i].charAt(0),h=r[i].length,u=0;u<f.length;u++)c=f[u].charAt(0),s=f[u].length,l(o)===l(c)&&h<s&&(r[i]=ct(o,s));return r.join("")}function rt(n){return n.skeleton!==undefined||n.date!==undefined||n.time!==undefined||n.datetime!==undefined||n.raw!==undefined}function p(n,t){ni(n,t,{skip:[/dates\/calendars\/gregorian\/dateTimeFormats\/availableFormats/,/dates\/calendars\/gregorian\/days\/.*\/short/,/dates\/timeZoneNames\/zone/,/dates\/timeZoneNames\/metazone/,/globalize-iana/,/supplemental\/metaZones/,/supplemental\/timeData\/(?!001)/,/supplemental\/weekData\/(?!001)/]})}function bt(n){ut("date",n);ut("time",n);ut("datetime",n)}function ut(n,t){var i=t[n];nt("E_INVALID_OPTIONS",'Invalid `{{type}: "{value}"}`.',i===undefined||["short","medium","long","full"].indexOf(i)!==-1,{type:n,value:i})}function kt(n,t){nt("E_INVALID_OPTIONS",'Invalid `{skeleton: "{value}"}` based on provided CLDR.',t===undefined||typeof n=="string"&&n,{type:"skeleton",value:t})}function ft(n){return function(t,i){/globalize-iana/.test(t)&&nt("E_MISSING_IANA_TZ","Missing required IANA timezone content for `{timeZone}`: `{path}`.",i,{path:t.replace(/globalize-iana\//,""),timeZone:n})}}var w=t._createError,r=t._createErrorUnsupportedFeature,b=t._formatMessage,dt=t._isPlainObject,f=t._looseMatching,gt=t._numberNumberingSystemDigitsMap,k=t._numberSymbol,u=t._regexpEscape,et=t._removeLiteralQuotes,d=t._runtimeBind,g=t._stringPad,nt=t._validate,ni=t._validateCldr,ot=t._validateDefaultLocale,o=t._validateParameterPresence,ti=t._validateParameterType,c=t._validateParameterTypePlainObject,l=t._validateParameterTypeString,tt=function(n,t){ti(n,t,n===undefined||n instanceof Date,"Date")},ii=function(n,t){return w("E_INVALID_PAR_VALUE","Invalid `{name}` value ({value}).",{name:n,value:t})},ri="GyYuUrQqMLlwWEecdDFghHKkmsSAzZOvVXx".split("").reduce(function(n,t,i){return n[t]=i,n},{}),ui=function(n){var t,i=ri;n.replace(/[^GyYuUrQqMLlwWEecdDFghHKkmsSAzZOvVXx]/,function(t){throw w("E_INVALID_OPTIONS","Invalid field `{invalidField}` of skeleton `{value}`",{invalidField:t,type:"skeleton",value:n});});n.split("").every(function(r){if(i[r]<t)throw w("E_INVALID_OPTIONS","Invalid order `{invalidField}` of skeleton `{value}`",{invalidField:r,type:"skeleton",value:n});return t=i[r],!0})},st=function(n,t){return t=t||function(n,t,i){return n[i]=t,n},Object.keys(n).reduce(function(i,r){return t(i,r,n[r])},{})},fi=st({e:"eEc",L:"ML"},function(n,t,i){return i.split("").forEach(function(i){n[i]=t}),n}),ht=function(n){return fi[n]||n},e=/([a-z])\1*|'([^']|'')+'|''|./ig,ct=function(n,t){for(var r="",i=0;i<t;i++)r=r+n;return r},oi=function(n,t,i){var u,f,r,e;return f=n.match(/S/g),u=f?f.length:0,e=n.replace(/S/g,""),t=ei(e,t),r=t.lastIndexOf("s"),r!==-1&&u!==0&&(t=t.slice(0,r+1)+i+ct("S",u)+t.slice(r+1)),t},si=function(n,t){var h,c,i,o,s,l,r,u,f,a=ht;if(n===t)return 0;if(n=n.match(e),t=t.match(e),n.length!==t.length)return-1;for(i=1,u=0;u<n.length;u++){for(h=n[u].charAt(0),l=a(h),r=null,f=0;f<t.length;f++)if(c=t[f].charAt(0),r=a(c),l===r)break;else r=null;if(r===null)return-1;o=n[u].length;s=t[f].length;i=i+Math.abs(o-s);h!==c&&(i+=1);(o<3&&s>=3||o>=3&&s<3)&&(i+=20)}return i},hi=function(n,t){var f,e,r,i,u,o="dates/calendars/gregorian/dateTimeFormats/availableFormats",s=oi,h=si;if(r=n.main([o,t]),t&&!r){f=n.main([o]);i=[];for(u in f)i.push({skeleton:u,pattern:f[u],rate:h(t,u)});i=i.filter(function(n){return n.rate>-1}).sort(function(n,t){return n.rate-t.rate});i.length&&(e=k("decimal",n),r=s(t,i[0].pattern,e))}return r},lt=function(n,t){function s(n,i,r){return b(t.main(["dates/calendars/gregorian/dateTimeFormats",n]),[r,i])}var i,r,u,f,o,e=hi;switch(!0){case"skeleton"in n:if(u=n.skeleton,u=u.replace(/j/g,function(){return t.supplemental.timeData.preferred()}),ui(u),r=e(t,u),r)break;f=u.split(/[^hHKkmsSAzZOvVXx]/).slice(-1)[0];i=u.split(/[^GyYuUrQqMLlwWdDFgEec]/)[0];i=e(t,i);f=e(t,f);o=/(MMMM|LLLL).*[Ec]/.test(i)?"full":/MMMM|LLLL/.test(i)?"long":/MMM|LLL/.test(i)?"medium":"short";r=i&&f?s(o,i,f):i||f;break;case"date"in n:case"time"in n:r=t.main(["dates/calendars/gregorian","date"in n?"dateFormats":"timeFormats",n.date||n.time]);break;case"datetime"in n:r=s(n.datetime,t.main(["dates/calendars/gregorian/dateFormats",n.datetime]),t.main(["dates/calendars/gregorian/timeFormats",n.datetime]));break;case"raw"in n:r=n.raw;break;default:throw ii({name:"options",value:n});}return r},at=["sun","mon","tue","wed","thu","fri","sat"],it=function(n){return at.indexOf(n.supplemental.weekData.firstDay())},s=function(n,t,i,r){var f,u;if(i)return(u=r.main(["dates/timeZoneNames/zone",i,n<4?"short":"long",t]),u)?u:(f=r.supplemental(["metaZones/metazoneInfo/timezone",i,0,"usesMetazone/_mzone"]),r.main(["dates/timeZoneNames/metazone",f,n<4?"short":"long",t]))},vt=function(n){return n.split(";").map(function(n){return n.slice(0,n.indexOf("H")+1)}).join(";")},a=function(n,t){return n.split(";").map(function(n){var i=n.split(/H+/);return i.splice(1,0,t),i.join("")}).join(";")},yt=function(n,t){var i=function(){return t};return i.dataCacheKey=n,i},ci=function(n,t,i){function o(n){u.numberFormatters[n]=g("",n)}var u={numberFormatters:{},pattern:n,timeSeparator:k("timeSeparator",t)},f=["abbreviated","wide","narrow"];return i&&(u.timeZoneData=yt("iana/"+i,{offsets:t.get(["globalize-iana/zoneData",i,"offsets"]),untils:t.get(["globalize-iana/zoneData",i,"untils"]),isdsts:t.get(["globalize-iana/zoneData",i,"isdsts"])})),n.replace(e,function(e){var y,c,p,l,d,h,w,k,v;c=e.charAt(0);h=e.length;c==="j"&&(u.preferredTime=c=t.supplemental.timeData.preferred());c==="Z"&&h===4&&(c="O",h=4);c==="z"&&(w=s(h,"standard",i,t),p=s(h,"daylight",i,t),w&&(u.standardTzName=w),p&&(u.daylightTzName=p),w&&p||(c="O",h<4&&(h=1)));c==="v"&&(d=s(h,"generic",i,t),d||(c="V",h=4));switch(c){case"G":u.eras=t.main(["dates/calendars/gregorian/eras",h<=3?"eraAbbr":h===4?"eraNames":"eraNarrow"]);break;case"y":l=!0;break;case"Y":u.firstDay=it(t);u.minDays=t.supplemental.weekData.minDays();l=!0;break;case"u":case"U":throw r({feature:"year pattern `"+c+"`"});case"Q":case"q":h>2?(u.quarters||(u.quarters={}),u.quarters[c]||(u.quarters[c]={}),u.quarters[c][h]=t.main(["dates/calendars/gregorian/quarters",c==="Q"?"format":"stand-alone",f[h-3]])):l=!0;break;case"M":case"L":h>2?(u.months||(u.months={}),u.months[c]||(u.months[c]={}),u.months[c][h]=t.main(["dates/calendars/gregorian/months",c==="M"?"format":"stand-alone",f[h-3]])):l=!0;break;case"w":case"W":u.firstDay=it(t);u.minDays=t.supplemental.weekData.minDays();l=!0;break;case"d":case"D":case"F":l=!0;break;case"g":throw r({feature:"Julian day pattern `g`"});case"e":case"c":if(h<=2){u.firstDay=it(t);l=!0;break}case"E":u.days||(u.days={});u.days[c]||(u.days[c]={});u.days[c][h]=h===6?t.main(["dates/calendars/gregorian/days",c==="c"?"stand-alone":"format","short"])||t.main(["dates/calendars/gregorian/days",c==="c"?"stand-alone":"format","abbreviated"]):t.main(["dates/calendars/gregorian/days",c==="c"?"stand-alone":"format",f[h<3?0:h-3]]);break;case"a":u.dayPeriods={am:t.main("dates/calendars/gregorian/dayPeriods/format/wide/am"),pm:t.main("dates/calendars/gregorian/dayPeriods/format/wide/pm")};break;case"h":case"H":case"K":case"k":case"m":case"s":case"S":case"A":l=!0;break;case"v":if(h!==1&&h!==4)throw r({feature:"timezone pattern `"+n+"`"});u.genericTzName=d;break;case"V":if(h===1)throw r({feature:"timezone pattern `"+n+"`"});if(i){if(h===2){u.timeZoneName=i;break}if(v=t.main(["dates/timeZoneNames/zone",i,"exemplarCity"]),h===3&&(v||(v=t.main(["dates/timeZoneNames/zone/Etc/Unknown/exemplarCity"])),k=v),v&&h===4&&(k=b(t.main("dates/timeZoneNames/regionFormat"),[v])),k){u.timeZoneName=k;break}}e==="v"&&(h=1);case"O":u.gmtFormat=t.main("dates/timeZoneNames/gmtFormat");u.gmtZeroFormat=t.main("dates/timeZoneNames/gmtZeroFormat");y=t.main("dates/timeZoneNames/hourFormat");u.hourFormat=h<4?[vt(y),a(y,"H")]:a(y,"HH");case"Z":case"X":case"x":o(1);o(2)}l&&o(h)}),u},li=function(n){return function(t){return n(t).map(function(n){return n.value}).join("")}},ai=function(n,t){var i={preferredTimeData:n.supplemental.timeData.preferred()};return t&&(i.timeZoneData=yt("iana/"+t,{offsets:n.get(["globalize-iana/zoneData",t,"offsets"]),untils:n.get(["globalize-iana/zoneData",t,"untils"]),isdsts:n.get(["globalize-iana/zoneData",t,"isdsts"])})),i},v=function(){function t(n,t,i){Object.defineProperty(n,t,{value:i})}function i(n,t){for(var i=0,r=n.getTime();i<t.length-1&&r>=t[i];)i++;return i}function r(n){var i=this.getTimezoneOffset(),r=n(),t;return this.original.setTime(new Date(this.getTime())),t=this.getTimezoneOffset(),t-i&&this.original.setMinutes(this.original.getMinutes()+t-i),r}var n=function(n,i){if(t(this,"original",new Date(n.getTime())),t(this,"local",new Date(n.getTime())),t(this,"timeZoneData",i),t(this,"setWrap",r),!(i.untils&&i.offsets&&i.isdsts))throw new Error("Invalid IANA data");this.setTime(this.local.getTime()-this.getTimezoneOffset()*6e4)};return n.prototype.clone=function(){return new n(this.original,this.timeZoneData)},["getFullYear","getMonth","getDate","getDay","getHours","getMinutes","getSeconds","getMilliseconds"].forEach(function(t){var i="getUTC"+t.substr(3);n.prototype[t]=function(){return this.local[i]()}}),n.prototype.valueOf=n.prototype.getTime=function(){return this.local.getTime()+this.getTimezoneOffset()*6e4},n.prototype.getTimezoneOffset=function(){var n=i(this.original,this.timeZoneData.untils);return this.timeZoneData.offsets[n]},["setFullYear","setMonth","setDate","setHours","setMinutes","setSeconds","setMilliseconds"].forEach(function(t){var i="setUTC"+t.substr(3);n.prototype[t]=function(n){var t=this.local;return this.setWrap(function(){return t[i](n)})}}),n.prototype.setTime=function(n){return this.local.setTime(n)},n.prototype.isDST=function(){var n=i(this.original,this.timeZoneData.untils);return Boolean(this.timeZoneData.isdsts[n])},n.prototype.inspect=function(){var t=i(this.original,this.timeZoneData.untils),n=this.timeZoneData.abbrs;return this.local.toISOString().replace(/Z$/,"")+" "+(n&&n[t]+" "||this.getTimezoneOffset()*-1+" ")+(this.isDST()?"(daylight savings)":"")},n.prototype.toDate=function(){return new Date(this.getTime())},["toISOString","toJSON","toUTCString"].forEach(function(t){n.prototype[t]=function(){return this.toDate()[t]()}}),n}(),vi=function(n){return new Date(n,1,29).getMonth()===1},yi=function(n){return new Date(n.getFullYear(),n.getMonth()+1,0).getDate()},h=function(n,t){n=n instanceof v?n.clone():new Date(n.getTime());switch(t){case"year":n.setMonth(0);case"month":n.setDate(1);case"day":n.setHours(0);case"hour":n.setMinutes(0);case"minute":n.setSeconds(0);case"second":n.setMilliseconds(0)}return n},pi=function(n,t){var i=new Date(n.getFullYear(),n.getMonth()+1,0).getDate();n.setDate(t<1?1:t<i?t:i)},wi=function(n,t){var i=n.getDate();n.setDate(1);n.setMonth(t);pi(n,i)},i=function(n,t,i){return n<t||n>i},bi=function(n,t,u){var y,s,c,p,b,o,l,w,k,d=0,nt=1,g=2,a=3,tt=4,it=5,rt=6,f=new Date,e=[];if((u.timeZoneData&&(f=new v(f,u.timeZoneData())),!t.length)||(k=t.every(function(n){var k,h,t,v;if(n.type==="literal")return!0;h=n.type.charAt(0);v=n.type.length;h==="j"&&(h=u.preferredTimeData);switch(h){case"G":e.push(d);b=+n.value;break;case"y":if(t=n.value,v===2){if(i(t,0,99))return!1;k=Math.floor(f.getFullYear()/100)*100;t+=k;t>f.getFullYear()+20&&(t-=100)}f.setFullYear(t);e.push(d);break;case"Y":throw r({feature:"year pattern `"+h+"`"});case"M":case"L":if(t=v<=2?n.value:+n.value,i(t,1,12))return!1;p=t;e.push(nt);break;case"d":s=n.value;e.push(g);break;case"D":c=n.value;e.push(g);break;case"a":y=n.value;break;case"h":if(t=n.value,i(t,1,12))return!1;o=l=!0;f.setHours(t===12?0:t);e.push(a);break;case"K":if(t=n.value,i(t,0,11))return!1;o=l=!0;f.setHours(t);e.push(a);break;case"k":if(t=n.value,i(t,1,24))return!1;o=!0;f.setHours(t===24?0:t);e.push(a);break;case"H":if(t=n.value,i(t,0,23))return!1;o=!0;f.setHours(t);e.push(a);break;case"m":if(t=n.value,i(t,0,59))return!1;f.setMinutes(t);e.push(tt);break;case"s":if(t=n.value,i(t,0,59))return!1;f.setSeconds(t);e.push(it);break;case"A":f.setHours(0);f.setMinutes(0);f.setSeconds(0);case"S":t=Math.round(n.value*Math.pow(10,3-v));f.setMilliseconds(t);e.push(rt);break;case"z":case"Z":case"O":case"v":case"V":case"X":case"x":typeof n.value=="number"&&(w=n.value)}return!0}),!k)||o&&!(!y^l))return null;if(b===0&&f.setFullYear(f.getFullYear()*-1+1),p!==undefined&&wi(f,p-1),s!==undefined){if(i(s,1,yi(f)))return null;f.setDate(s)}else if(c!==undefined){if(i(c,1,vi(f.getFullYear())?366:365))return null;f.setMonth(0);f.setDate(c)}return l&&y==="pm"&&f.setHours(f.getHours()+12),w!==undefined&&f.setMinutes(f.getMinutes()+w-f.getTimezoneOffset()),e=Math.max.apply(null,e),f=h(f,["year","month","day","hour","minute","second","milliseconds"][e]),f instanceof v&&(f=f.toDate()),f},ki=function(n,t,i){var r,o,h=[],s=["abbreviated","wide","narrow"];return r=i.digitsRe,n=f(n),o=i.pattern.match(e).every(function(f){function b(t,i){var u,f,r=n.match(t);return(i=i||function(n){return+n},!r)?!1:(f=r[1],r.length<6?(u=f?1:3,c.value=i(r[u])*60):r.length<10?(u=f?[1,3]:[5,7],c.value=i(r[u[0]])*60+i(r[u[1]])):(u=f?[1,3,5]:[7,9,11],c.value=i(r[u[0]])*60+i(r[u[1]])+i(r[u[2]])/60),f&&(c.value*=-1),!0)}function p(){if(e===1)return a=!0,o=r}function d(){if(e===1)return a=!0,o=new RegExp("^("+r.source+"){1,2}")}function k(){if(e===1||e===2)return a=!0,o=new RegExp("^("+r.source+"){1,2}")}function w(){if(e===2)return a=!0,o=new RegExp("^("+r.source+"){2}")}function v(t){var r=i[t.join("/")];return r?(r.some(function(t){var i=t[1];if(i.test(n))return c.value=t[0],o=t[1],!0}),null):null}var y,l,e,a,o,c={};c.type=f;l=f.charAt(0);e=f.length;l==="Z"&&(e<4?(l="x",e=4):e<5?(l="O",e=4):(l="X",e=5));l==="z"&&i.standardOrDaylightTzName&&(c.value=null,o=i.standardOrDaylightTzName);l==="v"&&(i.genericTzName?(c.value=null,o=i.genericTzName):(l="V",e=4));l==="V"&&i.timeZoneName&&(c.value=e===2?i.timeZoneName:null,o=i.timeZoneNameRe);switch(l){case"G":v(["gregorian/eras",e<=3?"eraAbbr":e===4?"eraNames":"eraNarrow"]);break;case"y":case"Y":a=!0;o=e===1?new RegExp("^("+r.source+")+"):e===2?new RegExp("^("+r.source+"){1,2}"):new RegExp("^("+r.source+"){"+e+",}");break;case"Q":case"q":p()||w()||v(["gregorian/quarters",l==="Q"?"format":"stand-alone",s[e-3]]);break;case"M":case"L":k()||v(["gregorian/months",l==="M"?"format":"stand-alone",s[e-3]]);break;case"D":e<=3&&(a=!0,o=new RegExp("^("+r.source+"){"+e+",3}"));break;case"W":case"F":p();break;case"e":case"c":if(e<=2){p()||w();break}case"E":e===6?v(["gregorian/days",[l==="c"?"stand-alone":"format"],"short"])||v(["gregorian/days",[l==="c"?"stand-alone":"format"],"abbreviated"]):v(["gregorian/days",[l==="c"?"stand-alone":"format"],s[e<3?0:e-3]]);break;case"a":v(["gregorian/dayPeriods/format/wide"]);break;case"w":d()||w();break;case"d":case"h":case"H":case"K":case"k":case"j":case"m":case"s":k();break;case"S":a=!0;o=new RegExp("^("+r.source+"){"+e+"}");break;case"A":a=!0;o=new RegExp("^("+r.source+"){"+(e+5)+"}");break;case"v":case"V":case"z":if(o&&o.test(n))break;if(l==="V"&&e===2)break;case"O":if(n===i["timeZoneNames/gmtZeroFormat"])c.value=0,o=i["timeZoneNames/gmtZeroFormatRe"];else if(y=i["timeZoneNames/hourFormat"].some(function(n){if(b(n,t))return o=n,!0}),!y)return null;break;case"X":if(n==="Z"){c.value=0;o=/^Z/;break}case"x":if(y=i.x.some(function(n){if(b(n))return o=n,!0}),!y)return null;break;case"'":c.type="literal";o=new RegExp("^"+u(et(f)));break;default:c.type="literal";o=new RegExp("^"+u(f))}return o?(n=n.replace(o,function(n){return c.lexeme=n,a&&(c.value=t(n)),""}),!c.lexeme)?!1:a&&isNaN(c.value)?!1:(h.push(c),!0):!1}),n!==""&&(o=!1),o?h:[]},di=function(n,t,i){return function(r){var u;return o(r,"value"),l(r,"value"),u=ki(r,n,i),bi(r,u,t)||null}},gi=function(n,t){var i,r={};for(i in n)t.test(i)&&(r[i]=n[i]);return r},nr=function(n,t,i){function l(n,t,i,r){var u;return i||(i="\\d"),t||(t="{0}"),u=n.replace("+","\\+").replace(/HH|mm|ss/g,"(("+i+"){2})").replace(/H|m/g,"(("+i+"){1,2})"),r&&(u=u.replace(/:/g,r)),u=u.split(";").map(function(n){return t.replace("{0}",n)}).join("|"),new RegExp("^"+u)}function v(n,t){/(timeZoneNames\/zone|supplemental\/metaZones|timeZoneNames\/metazone|timeZoneNames\/regionFormat|timeZoneNames\/gmtFormat)/.test(n)||t&&(n=n.replace(/^.*\/dates\//,"").replace(/calendars\//,""),n==="gregorian/dayPeriods/format/wide"&&(t=gi(t,/^am|^pm/)),t=dt(t)?Object.keys(t).map(function(n){return[n,new RegExp("^"+u(f(t[n])))]}).sort(function(n,t){return t[1].source.length-n[1].source.length}):f(t),o[n]=t)}function p(n){return"("+n.filter(function(n){return n}).reduce(function(n,t){return n+"|"+t})+")"}var h,o={pattern:f(n)},y=k("timeSeparator",t),c=["abbreviated","wide","narrow"];h=gt(t);h=h?"["+h+"]":"\\d";o.digitsRe=new RegExp(h);t.on("get",v);return n.match(e).forEach(function(e){var tt,w,k,rt,v,d,it,g,nt;if(w=e.charAt(0),v=e.length,w==="Z"&&(v<5?(w="O",v=4):(w="X",v=5)),w==="z"&&(d=s(v,"standard",i,t),k=s(v,"daylight",i,t),d&&(d=u(f(d))),k&&(k=u(f(k))),(d||k)&&(o.standardOrDaylightTzName=new RegExp("^"+p([d,k]))),d&&k||(w="O",v<4&&(v=1))),w==="v"){if(v!==1&&v!==4)throw r({feature:"timezone pattern `"+n+"`"});it=s(v,"generic",i,t);it?(o.genericTzName=new RegExp("^"+u(f(it))),w="O"):(w="V",v=4)}switch(w){case"G":t.main(["dates/calendars/gregorian/eras",v<=3?"eraAbbr":v===4?"eraNames":"eraNarrow"]);break;case"u":case"U":throw r({feature:"year pattern `"+w+"`"});case"Q":case"q":v>2&&t.main(["dates/calendars/gregorian/quarters",w==="Q"?"format":"stand-alone",c[v-3]]);break;case"M":case"L":v>2&&t.main(["dates/calendars/gregorian/months",w==="M"?"format":"stand-alone",c[v-3]]);break;case"g":throw r({feature:"Julian day pattern `g`"});case"e":case"c":if(v<=2)break;case"E":v===6?t.main(["dates/calendars/gregorian/days",[w==="c"?"stand-alone":"format"],"short"])||t.main(["dates/calendars/gregorian/days",[w==="c"?"stand-alone":"format"],"abbreviated"]):t.main(["dates/calendars/gregorian/days",[w==="c"?"stand-alone":"format"],c[v<3?0:v-3]]);break;case"a":t.main("dates/calendars/gregorian/dayPeriods/format/wide");break;case"V":if(v===1)throw r({feature:"timezone pattern `"+n+"`"});if(i){if(v===2){o.timeZoneName=i;o.timeZoneNameRe=new RegExp("^"+u(i));break}nt=t.main(["dates/timeZoneNames/zone",i,"exemplarCity"]);v===3&&(nt||(nt=t.main(["dates/timeZoneNames/zone/Etc/Unknown/exemplarCity"])),g=nt);nt&&v===4&&(g=b(t.main("dates/timeZoneNames/regionFormat"),[nt]));g&&(g=f(g),o.timeZoneName=g,o.timeZoneNameRe=new RegExp("^"+u(g)))}e==="v"&&(v=1);case"z":case"O":rt=t.main("dates/timeZoneNames/gmtFormat");t.main("dates/timeZoneNames/gmtZeroFormat");t.main("dates/timeZoneNames/hourFormat");o["timeZoneNames/gmtZeroFormatRe"]=new RegExp("^"+u(o["timeZoneNames/gmtZeroFormat"]));tt=o["timeZoneNames/hourFormat"];o["timeZoneNames/hourFormat"]=(v<4?[a(tt,"H"),vt(tt)]:[a(tt,"HH")]).map(function(n){return l(n,rt,h,y)});case"X":case"x":o.x=[["+HHmm;-HHmm","+HH;-HH"],["+HHmm;-HHmm"],["+HH:mm;-HH:mm"],["+HHmmss;-HHmmss","+HHmm;-HHmm"],["+HH:mm:ss;-HH:mm:ss","+HH:mm;-HH:mm"]][v-1].map(function(n){return l(n)})}}),t.off("get",v),o},y=function(n,t){return(n.getDay()-t+7)%7},tr=function(n,t){return(t.getTime()-n.getTime())/864e5},pt=function(n){return Math.floor(tr(h(n,"year"),n))},ir=st({era:"G",year:"yY",quarter:"qQ",month:"ML",week:"wW",day:"dDF",weekday:"ecE",dayperiod:"a",hour:"hHkK",minute:"m",second:"sSA",zone:"zvVOxX"},function(n,t,i){return i.split("").forEach(function(i){n[i]=t}),n}),rr=function(n){return n-h(n,"day")},wt=function(n,t,i,r){var u,f=n.getTimezoneOffset();return u=Math.abs(f),r=r||{1:function(n){return g(n,1)},2:function(n){return g(n,2)}},t.split(";")[f>0?1:0].replace(":",i).replace(/HH?/,function(n){return r[n.length](Math.floor(u/60))}).replace(/mm/,function(){return r[2](Math.floor(u%60))}).replace(/ss/,function(){return r[2](Math.floor(u%1*60))})},ur=function(n,t,i){var r=[],u=i.timeSeparator;return i.timeZoneData&&(n=new v(n,i.timeZoneData())),i.pattern.replace(e,function(f){var c,l,a,e,s=f.charAt(0),o=f.length;s==="j"&&(s=i.preferredTime);s==="Z"&&(o<4?(s="x",o=4):o<5?(s="O",o=4):(s="X",o=5));s==="z"&&(n.isDST&&(e=n.isDST()?i.daylightTzName:i.standardTzName),e||(s="O",o<4&&(o=1)));switch(s){case"G":e=i.eras[n.getFullYear()<0?0:1];break;case"y":e=n.getFullYear();o===2&&(e=String(e),e=+e.substr(e.length-2));break;case"Y":e=new Date(n.getTime());e.setDate(e.getDate()+7-y(n,i.firstDay)-i.firstDay-i.minDays);e=e.getFullYear();o===2&&(e=String(e),e=+e.substr(e.length-2));break;case"Q":case"q":e=Math.ceil((n.getMonth()+1)/3);o>2&&(e=i.quarters[s][o][e]);break;case"M":case"L":e=n.getMonth()+1;o>2&&(e=i.months[s][o][e]);break;case"w":e=y(h(n,"year"),i.firstDay);e=Math.ceil((pt(n)+e)/7)-(7-e>=i.minDays?0:1);break;case"W":e=y(h(n,"month"),i.firstDay);e=Math.ceil((n.getDate()+e)/7)-(7-e>=i.minDays?0:1);break;case"d":e=n.getDate();break;case"D":e=pt(n)+1;break;case"F":e=Math.floor(n.getDate()/7)+1;break;case"e":case"c":if(o<=2){e=y(n,i.firstDay)+1;break}case"E":e=at[n.getDay()];e=i.days[s][o][e];break;case"a":e=i.dayPeriods[n.getHours()<12?"am":"pm"];break;case"h":e=n.getHours()%12||12;break;case"H":e=n.getHours();break;case"K":e=n.getHours()%12;break;case"k":e=n.getHours()||24;break;case"m":e=n.getMinutes();break;case"s":e=n.getSeconds();break;case"S":e=Math.round(n.getMilliseconds()*Math.pow(10,o-3));break;case"A":e=Math.round(rr(n)*Math.pow(10,o-3));break;case"z":break;case"v":if(i.genericTzName){e=i.genericTzName;break}case"V":if(i.timeZoneName){e=i.timeZoneName;break}f==="v"&&(o=1);case"O":n.getTimezoneOffset()===0?e=i.gmtZeroFormat:(o<4?(c=n.getTimezoneOffset(),c=i.hourFormat[c%60-c%1==0?0:1]):c=i.hourFormat,e=wt(n,c,u,t),e=i.gmtFormat.replace(/\{0\}/,e));break;case"X":if(n.getTimezoneOffset()===0){e="Z";break}case"x":c=n.getTimezoneOffset();o===1&&c%60-c%1!=0&&(o+=1);(o===4||o===5)&&c%1==0&&(o-=2);e=["+HH;-HH","+HHmm;-HHmm","+HH:mm;-HH:mm","+HHmmss;-HHmmss","+HH:mm:ss;-HH:mm:ss"][o-1];e=wt(n,e,":");break;case":":e=u;break;case"'":e=et(f);break;default:e=f}if(typeof e=="number"&&(e=t[o](e)),l=ir[s],a=l?l:"literal",a==="literal"&&r.length&&r[r.length-1].type==="literal"){r[r.length-1].value+=e;return}r.push({type:a,value:e})}),r},fr=function(n,t){return function(i){return o(i,"value"),tt(i,"value"),ur(i,n,t)}};return t.loadTimeZone=function(t){var i={"globalize-iana":t};o(t,"json");c(t,"json");n.load(i)},t.dateFormatter=t.prototype.dateFormatter=function(n){var r,t,i;return c(n,"options"),n=n||{},rt(n)||(n.skeleton="yMd"),r=[n],t=this.dateToPartsFormatter(n),i=li(t),d(r,this.cldr,i,[t]),i},t.dateToPartsFormatter=t.prototype.dateToPartsFormatter=function(n){var h,t,i,e,o,r,s,u,f;c(n,"options");t=this.cldr;n=n||{};rt(n)||(n.skeleton="yMd");bt(n);ot(t);u=n.timeZone;l(u,"options.timeZone");h=[n];t.on("get",p);if(u){f=ft(u);t.on("get",f)}o=lt(n,t);kt(o,n.skeleton);r=ci(o,t,u);t.off("get",p);f&&t.off("get",f);i=r.numberFormatters;delete r.numberFormatters;for(e in i)i[e]=this.numberFormatter({raw:i[e]});return s=fr(i,r),d(h,t,s,[i,r]),s},t.dateParser=t.prototype.dateParser=function(n){var s,t,r,u,f,e,i,o;c(n,"options");t=this.cldr;n=n||{};rt(n)||(n.skeleton="yMd");bt(n);ot(t);i=n.timeZone;l(i,"options.timeZone");s=[n];t.on("get",p);if(i)t.on("get",ft(i));return f=lt(n,t),kt(f,n.skeleton),o=nr(f,t,i),u=ai(t,i),t.off("get",p),i&&t.off("get",ft(i)),r=this.numberParser({raw:"0"}),e=di(r,u,o),d(s,t,e,[r,u,o]),e},t.formatDate=t.prototype.formatDate=function(n,t){return o(n,"value"),tt(n,"value"),this.dateFormatter(t)(n)},t.formatDateToParts=t.prototype.formatDateToParts=function(n,t){return o(n,"value"),tt(n,"value"),this.dateToPartsFormatter(t)(n)},t.parseDate=t.prototype.parseDate=function(n,t){return o(n,"value"),l(n,"value"),this.dateParser(t)(n)},t})