(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];return(r=r||{},u!=="und"&&f!=="Zzzz"&&o!=="ZZ")?[u,f,o]: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]]):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];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?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[9]||t[2]||"und",i[1]=t[4]||"Zzzz",i[2]=t[6]||"ZZ",i[3]=t[7],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 e=n._availableBundleMap,r=n._availableBundleMapQueue;return r.length&&(f(r,function(i){var o,h,f,s;(s=v(i),h=u(n,t,s,{force:!0})||s,f=a(n,t,h),f=f.join(n.localeSep),o=r[f],o&&o.length<i.length)||(e[f]=i)}),n._availableBundleMapQueue=[]),e[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.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&&i(t[u])?t[u].concat(r[u]):u in t&&typeof t[u]=="object"?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 e,c,r,o,l,f,s,h,y,p=n.localeSep;t(i,"locale");tt(i,"locale");f=v(i);h=f[4];y=f[3];r=u(n,this,f,{force:!0})||f;c=r[0];l=r[1];s=r[2];o=a(n,this,r).join(p);this.attributes=e={bundle:d(n,this,o),minlanguageId:o,maxLanguageId:r.join(p),language:c,script:l,territory:s,region:s,variant:y};h&&("-"+h).replace(/-[a-z]{3,8}|(-[a-z]{2})-([a-z]{3,8})/g,function(n,t,i){t?e["u"+t]=i:e["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("cldrjs")):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 u(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,r=this,f=r.EventEmitter;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 r in i)i.hasOwnProperty(r)&&u(i[r],t)===-1&&i[r].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),r;for(var f in i)i.hasOwnProperty(f)&&(r=u(i[f],t),r!==-1&&i[f].splice(r,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 r.EventEmitter=f,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("cldrjs")):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("cldrjs")):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&&typeof l!="object")?l:(l=t(r._raw,a),l||(v=o(r,f),l=n(r,v,e,u(h,{bundle:v}),f)),l&&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})