import{a as c}from"./chunk-A6GDLS4J.js";import{Yc as g,ka as i,pa as n,re as s}from"./chunk-UNHECMG2.js";var o=["de-CH","fr-CH"],r=o[0];function f(){return[{provide:g,useFactory:t=>t.detectLanguage(),deps:[u]}]}var u=(()=>{class t{constructor(){this.translate=n(s),this.storage=n(c)}initialize(){this.translate.setFallbackLang(r);let e=this.detectLanguage();this.translate.use(e),document.documentElement.lang=e}detectLanguage(){return this.detectedLanguage||(this.detectedLanguage=this.getDocumentLanguage()||this.getStoredLanguage()||this.getBrowserLanguage()||r),this.detectedLanguage}getLocalizedLanguage(e){return e=o.find(a=>a===`${(e||"").toLowerCase()}-CH`),e||r}getDocumentLanguage(){let e=document.querySelector("[lang]");return this.normalizeLanguage(e&&e.lang)}getStoredLanguage(){return this.normalizeLanguage(this.storage.getLanguage())}getBrowserLanguage(){return this.normalizeLanguage(this.translate.getBrowserLang())}normalizeLanguage(e){return e=(e||"").split("-")[0],e&&o.find(a=>e===a.split("-")[0])||null}static{this.\u0275fac=function(a){return new(a||t)}}static{this.\u0275prov=i({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();export{f as a,u as b};
