import{a as $}from"./chunk-7H2VSKCE.js";import{c as W}from"./chunk-IEDTWYT7.js";import{a as E,b as A}from"./chunk-T3IGDRM7.js";import{a as D}from"./chunk-AG5UR6GS.js";import{A as F,g as P,l as N}from"./chunk-RYV2RH4B.js";import{j as O}from"./chunk-HKLJ6VPZ.js";import{a as j}from"./chunk-MQ46LYK7.js";import{b as V,c as k}from"./chunk-PQ5Q7HJL.js";import{d}from"./chunk-72CHOCZD.js";import{Eb as L,Fb as x,Gb as w,Kb as y,Mc as B,O as f,Pb as T,Qb as s,Y as i,ea as r,ec as b,f as g,fa as p,fc as M,gb as h,gc as v,mb as C,ta as c,tb as m,vc as S,wc as I,xa as u,zb as _}from"./chunk-56X5LYJH.js";function U(n,e){n&1&&w(0,"ngx-skeleton-loader",0)}function q(n,e){if(n&1){let t=y();L(0,"app-select",2),S(1,"translate"),v("ngModelChange",function(o){r(t);let a=s();return M(a.selectedLang,o)||(a.selectedLang=o),p(o)}),T("selectedValueChange",function(o){r(t);let a=s();return p(a.onChangeLanguage(o))}),x()}if(n&2){let t=s();m("items",t.languages),b("ngModel",t.selectedLang),m("placeholder",I(1,4,"shared.selectLanguage"))("showClear",!1)}}var R=class n{translateConfig=i(D);translateLoader=i(j);_isLoading=c(!0);destroy$=new g;platformId=i(u);loading=B(()=>this._isLoading()||this._translateLoading());_translateLoading=c(!1);languages=[{label:"\u0639\u0631\u0628\u064A",value:"ar",image:"assets/images/ar.svg"},{label:"English",value:"en",image:"assets/images/en.svg"}];selectedLang="ar";ngOnInit(){if(this.translateConfig.loading$.pipe(f(this.destroy$)).subscribe({next:e=>{this._translateLoading.set(e),e||setTimeout(()=>this._isLoading.set(!1),100)},error:()=>this._isLoading.set(!1)}),d(this.platformId)){let e=localStorage.getItem("lang");this.selectedLang=e&&this.languages.some(t=>t.value===e)?e:"ar"}else this.selectedLang="ar";this.translateConfig.useLanguage(this.selectedLang),this.translateLoader.loadFeature("shared")}onChangeLanguage(e){this.selectedLang=e,this.translateConfig.useLanguage(e),d(this.platformId)&&(localStorage.setItem("lang",e),location.reload())}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=h({type:n,selectors:[["app-translation-btn"]],decls:2,vars:1,consts:[["count","1","appearance","line"],[3,"items","ngModel","placeholder","showClear"],[3,"ngModelChange","selectedValueChange","items","ngModel","placeholder","showClear"]],template:function(t,l){t&1&&C(0,U,1,0,"ngx-skeleton-loader",0)(1,q,2,6,"app-select",1),t&2&&_(l.loading()?0:1)},dependencies:[O,W,F,P,N,$,k,V,A,E],styles:[".p-select:not(.p-disabled).p-focus{border-color:#171d23!important}  .p-select{background-color:#fff!important}  .p-select .p-select-overlay,   .p-select .p-select-option.p-select-option-selected.p-focus,   .p-select .p-select-option{background-color:#fff;color:#171d23;font-weight:700}  .p-select .p-select-label{color:#171d23;font-weight:700}[_nghost-%COMP%]     .p-select{border:0;box-shadow:none;width:auto!important}[_nghost-%COMP%]     .selected-item{color:#171d23!important}"]})};export{R as a};
