import{c as e,u as n}from"./c.743a15a1.js";import"./c.2610e8cd.js";import{t as a}from"./c.a0946910.js";var r=/-u(?:-[0-9a-z]{2,8})+/gi;function t(e,n,a){if(void 0===a&&(a=Error),!e)throw new a(n)}function o(e,n){for(var a=n;;){if(e.has(a))return a;var r=a.lastIndexOf("-");if(!~r)return;r>=2&&"-"===a[r-2]&&(r-=2),a=a.slice(0,r)}}function s(e,n){t(2===n.length,"key must have 2 elements");var a=e.length,r="-".concat(n,"-"),o=e.indexOf(r);if(-1!==o){for(var s=o+4,l=s,i=s,f=!1;!f;){var c=e.indexOf("-",i);2===(-1===c?a-i:c-i)?f=!0:-1===c?(l=a,f=!0):(l=c,i=c+1)}return e.slice(s,l)}if(r="-".concat(n),-1!==(o=e.indexOf(r))&&o+3===a)return""}function l(e,n,a,l,i,f){var c;c="lookup"===a.localeMatcher?function(e,n,a){for(var t={locale:""},s=0,l=n;s2){var S=u.indexOf("-x-");if(-1===S)u+=m;else{var C=u.slice(0,S),y=u.slice(S,u.length);u=C+m+y}u=Intl.getCanonicalLocales(u)[0]}return d.locale=u,d}function i(e,n,a,r){return l(n.reduce((function(e,n){return e.add(n),e}),new Set),function(e){return Intl.getCanonicalLocales(e)}(e),{localeMatcher:(null==r?void 0:r.algorithm)||"best fit"},[],{},(function(){return a})).locale}var f=Object.freeze({__proto__:null,match:i,LookupSupportedLocales:function(e,n){for(var a=[],t=0,s=n;t=2&&"-"===a[r-2]&&(r-=2),a=a.slice(0,r)}}}));n(m),m.BestAvailableLocale;var h=e((function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.LookupMatcher=void 0,n.LookupMatcher=function(e,n,a){for(var r={locale:""},t=0,o=n;t2){var S=l.indexOf("-x-");if(-1===S)l+=f;else{var C=l.slice(0,S),y=l.slice(S,l.length);l=C+f+y}l=Intl.getCanonicalLocales(l)[0]}return i.locale=l,i}}));n(g),g.ResolveLocale;var p=e((function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.LookupSupportedLocales=void 0,n.LookupSupportedLocales=function(e,n){for(var a=[],r=0,t=n;re.toLowerCase()===n));return r||(e.includes("-")?I(e.split("-")[0]):void 0)}const G=new Set,N=[];"Locale"in Intl&&!function(){try{return"x-private"===new Intl.Locale("und-x-private").toString()}catch(e){return!0}}()||N.push(import("./c.146bd8ba.js")),function(e){if(void 0===e&&(e="en"),!("PluralRules"in Intl)||"one"===new Intl.PluralRules("en",{minimumFractionDigits:2}).select(1)||!function(e){if(!e)return!0;var n=Array.isArray(e)?e:[e];return Intl.PluralRules.supportedLocalesOf(n).length===n.length}(e))return e?i([e],c,"en"):void 0}()&&(N.push(import("./c.d3a1c985.js")),N.push(import("./c.e23b0d0b.js"))),function(e){if(void 0===e&&(e="en"),!("RelativeTimeFormat"in Intl)||!function(e){if(!e)return!0;var n=Array.isArray(e)?e:[e];return Intl.RelativeTimeFormat.supportedLocalesOf(n).length===n.length}(e)||!function(e){try{return"numberingSystem"in new Intl.RelativeTimeFormat(e||"en",{numeric:"auto"}).resolvedOptions()}catch(e){return!1}}(e))return M([e],S,"en")}()&&N.push(import("./c.7606b61b.js")),function(e){if(void 0===e&&(e="en"),!("DateTimeFormat"in Intl)||!("formatToParts"in Intl.DateTimeFormat.prototype)||!("formatRange"in Intl.DateTimeFormat.prototype)||function(){try{return"dayPeriod"!==new Intl.DateTimeFormat("en",{hourCycle:"h11",hour:"numeric"}).formatToParts(0)[2].type}catch(e){return!1}}()||function(){try{return!!new Intl.DateTimeFormat("en",{dateStyle:"short",hour:"numeric"}).format(new Date(0))}catch(e){return!1}}()||!function(){try{return!!new Intl.DateTimeFormat(void 0,{dateStyle:"short"}).resolvedOptions().dateStyle}catch(e){return!1}}()||!function(e){if(!e)return!0;var n=Array.isArray(e)?e:[e];return Intl.DateTimeFormat.supportedLocalesOf(n).length===n.length}(e))return e?M([e],C,"en"):void 0}()&&(N.push(import("./c.b02ad375.js")),N.push(import("./c.ad739743.js")));const O=0===N.length?void 0:Promise.all(N).then((()=>T(function(){let e=null;if(y.selectedLanguage)try{const n=JSON.parse(y.selectedLanguage);if(n&&(e=I(n),e))return e}catch(e){}if(navigator.languages)for(const n of navigator.languages)if(e=I(n),e)return e;return e=I(navigator.language),e||"en"}()))),T=async e=>{if(!G.has(e)){G.add(e);try{if(Intl.NumberFormat&&"function"==typeof Intl.NumberFormat.__addLocaleData){const n=await fetch(`/static/locale-data/intl-numberformat/${e}.json`);Intl.NumberFormat.__addLocaleData(await n.json())}if(Intl.RelativeTimeFormat&&"function"==typeof Intl.RelativeTimeFormat.__addLocaleData){const n=await fetch(`/static/locale-data/intl-relativetimeformat/${e}.json`);Intl.RelativeTimeFormat.__addLocaleData(await n.json())}if(Intl.DateTimeFormat&&"function"==typeof Intl.DateTimeFormat.__addLocaleData){const n=await fetch(`/static/locale-data/intl-datetimeformat/${e}.json`);Intl.DateTimeFormat.__addLocaleData(await n.json())}}catch(e){}}};export{E as a,b,k as i,f as l,O as p};