import{b as c,f as r}from"./chunk-S3ADKFO2.js";import{n as l}from"./chunk-I5MYHHJE.js";import{Z as i,_ as o,ba as s,f as n,mb as g}from"./chunk-CKLXM6EG.js";var u=class a{static \u0275fac=function(e){return new(e||a)};static \u0275mod=g({type:a});static \u0275inj=o({imports:[l,r,r]})};var m=class a{constructor(t){this.translate=t;this.translate.addLangs(["en","ar"]);let e=localStorage.getItem("direction")||"ltr";localStorage.setItem("direction",e),this.translate.setDefaultLang(localStorage.getItem("lang")||"ar"),this.translate.use(this.getSelectedLanguage())}langIds=[];CurrentLangInfo={Currentlang:"ar",CurrentLangImage:""};subject=new n;myObservable=this.subject.asObservable();loadTranslations(...t){t.forEach(e=>{this.translate.setTranslation(e.lang,e.data,!0),this.langIds.push(e.lang)}),this.translate.addLangs(this.langIds),this.translate.use(this.getSelectedLanguage())}changeLang(t){this.setLanguage(t),this.translate.use(t),location.reload()}getCurrentLangInfo(){let t=this.getSelectedLanguage();return this.CurrentLangInfo.Currentlang=t==="ar"?"\u0627\u0644\u0639\u0631\u0628\u064A\u0629":"English",this.CurrentLangInfo.CurrentLangImage=t==="ar"?"https://upload.wikimedia.org/wikipedia/commons/f/fe/Flag_of_Egypt.svg":"https://upload.wikimedia.org/wikipedia/en/a/a4/Flag_of_the_United_States.svg",this.CurrentLangInfo}getHtmlDirection(){let e=this.getSelectedLanguage()==="ar"?"rtl":"ltr";return localStorage.setItem("direction",e),this.subject.next(e),e}getPosition(){return this.getHtmlDirection()==="rtl"?"right":"left"}setLanguage(t){localStorage.setItem("lang",t)}getSelectedLanguage=()=>localStorage.getItem("lang")||"ar";static \u0275fac=function(e){return new(e||a)(s(c))};static \u0275prov=i({token:a,factory:a.\u0275fac,providedIn:"root"})};export{u as a,m as b};
