text: !function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t():e.Cldr=t()}(this,function(){var r,a=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},o=function(e,t){if(a(e)&&(e=e.join("/")),"string"!=typeof e)throw new Error('invalid path "'+e+'"');return(e=(e=e.replace(/^\//,"").replace(/^cldr\//,"")).replace(/{[a-zA-Z]+}/g,function(e){return e=e.replace(/^{([^}]*)}$/,"$1"),t[e]})).split("/")},f=function(e,t){var n,r;if(e.some)return e.some(t);for(n=0,r=e.length;n<r;n++)if(t(e[n],n,e))return!0;return!1},_=function(e,t,n,r){var a,o=n[0],i=n[1],l=e.localeSep,u=n[2],c=n.slice(3,4);return r=r||{},"und"!==o&&"Zzzz"!==i&&"ZZ"!==u?[o,i,u].concat(c):void 0!==t.get("supplemental/likelySubtags")?f([[o,i,u],[o,u],[o,i],[o],["und",i]],function(e){return a=!/\b(Zzzz|ZZ)\b/.test(e.join(l))&&t.get(["supplemental/likelySubtags",e.join(l)])})?(a=a.split(l),["und"!==o?o:a[0],"Zzzz"!==i?i:a[1],"ZZ"!==u?u:a[2]].concat(c)):r.force?t.get("supplemental/likelySubtags/und").split(l):void 0:void 0},b=function(n,r,a){var o,e=a[0],t=a[1],i=a[2],l=a[3];return f([[[e,"Zzzz","ZZ"],[e]],[[e,"Zzzz",i],[e,i]],[[e,t,"ZZ"],[e,t]]],function(e){var t=_(n,r,e[0]);return o=e[1],t&&t[0]===a[0]&&t[1]===a[1]&&t[2]===a[2]})?(l&&o.push(l),o):a},y=function(e){var t,n=[];return(t=(e=e.replace(/_/,"-")).split("-u-"))[1]&&(t[1]=t[1].split("-t-"),e=t[0]+(t[1][1]?"-t-"+t[1][1]:""),n[4]=t[1][0]),null===(t=e.split("-t-")[0].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)$/))?["und","Zzzz","ZZ"]:(n[0]=t[10]||t[2]||"und",n[1]=t[4]||"Zzzz",n[2]=t[6]||"ZZ",t[7]&&t[7].length&&(n[3]=t[7].slice(1)),n)},Z=function(e,t){var n,r;if(e.forEach)return e.forEach(t);for(n=0,r=e.length;n<r;n++)t(e[n],n,e)},i=function(e,t){var n,r;return r=e+(t&&JSON?": "+JSON.stringify(t):""),(n=new Error(r)).code=e,Z(function(e){var t,n=[];if(Object.keys)return Object.keys(e);for(t in e)n.push(t);return n}(t),function(e){n[e]=t[e]}),n},l=function(e,t,n){if(!t)throw i(e,n)},j=function(e,t){l("E_MISSING_PARAMETER",void 0!==e,{name:t})},m=function(e,t,n,r){l("E_INVALID_PAR_TYPE",n,{expected:r,name:t,value:e})},t=function(e,t){m(e,t,"string"==typeof e||a(e),"String or Array")},u=function(e,t){var n;m(e,t,void 0===e||null!==(n=e)&&""+n=="[object Object]","Plain Object")},c=function(e,t){var n,r=e,a=t.length;for(n=0;n<a-1;n++)if(!(r=r[t[n]]))return;return r[t[n]]},p=function(e,t){var n,r=e._availableBundleMapQueue,a=c(t,["main"]);if(a)for(n in a)a.hasOwnProperty(n)&&"root"!==n&&-1===r.indexOf(n)&&r.push(n)},s=function(e){return a(e)?e:[e]},d=r=function(){var n={},e=[].slice.call(arguments,0);return Z(e,function(e){var t;for(t in e)t in n&&"object"==typeof n[t]&&!a(n[t])?n[t]=r(n[t],e[t]):n[t]=e[t]}),n},e=function(e,t,n){var r,a,o;for(j(n[0],"json"),r=0;r<n.length;r++)for(o=s(n[r]),a=0;a<o.length;a++)u(o[a],"json"),t=d(t,o[a]),p(e,o[a]);return t},n=function(e,t,n){var r=o(t,n);return c(e._resolved,r)},S=function(e){this.init(e)};return S._alwaysArray=s,S._coreLoad=e,S._createError=i,S._itemGetResolved=n,S._jsonMerge=d,S._pathNormalize=o,S._resourceGet=c,S._validatePresence=j,S._validateType=m,S._validateTypePath=t,S._validateTypePlainObject=u,S._availableBundleMap={},S._availableBundleMapQueue=[],S._resolved={},S.localeSep="-",S.load=function(){S._resolved=e(S,S._resolved,arguments)},S.prototype.init=function(e){var r,t,n,a,o,i,l,u,c,f,p,s,d,v,h,g=S.localeSep,z="";j(e,"locale"),m(f=e,"locale","string"==typeof f,"a string"),5===(i=y(e)).length&&(z=g+"u"+g+(u=i.pop()),i[3]||i.pop()),c=i[3],t=(n=_(S,this,i,{force:!0})||i)[0],o=n[1],l=n[2],a=b(S,this,n).join(g),this.attributes=r={bundle:(p=S,s=this,d=a,v=p._availableBundleMap,h=p._availableBundleMapQueue,h.length&&(Z(h,function(e){var t,n,r,a;a=y(e),n=_(p,s,a),r=(r=b(p,s,n)).join(p.localeSep),(t=v[r])&&t.length<e.length||(v[r]=e)}),p._availableBundleMapQueue=[]),v[d]||null),minLanguageId:a+z,maxLanguageId:n.join(g)+z,language:t,script:o,territory:l,region:l,variant:c},u&&("-"+u).replace(/-[a-z]{3,8}|(-[a-z]{2})-([a-z]{3,8})/g,function(e,t,n){t?r["u"+t]=n:r["u"+e]=!0}),this.locale=e},S.prototype.get=function(e){return j(e,"path"),t(e,"path"),n(S,e,this.attributes)},S.prototype.main=function(e){return j(e,"path"),t(e,"path"),l("E_MISSING_BUNDLE",null!==this.attributes.bundle,{locale:this.locale}),e=s(e),this.get(["main/{bundle}"].concat(e))},S});