import{$ as p,B as s,Nc as g,Xf as b,Y as E,af as h,bf as m,ge as v,m as u,mg as S,ng as L,r as d,xe as l}from"./chunk-QXV2GR6R.js";import{i as n,j as f}from"./chunk-JJ4RDTEF.js";var e=class e{constructor(r,t,a,i){n(this,"authHttp");n(this,"restExtractor");n(this,"markdownService");n(this,"serverService");this.authHttp=r,this.restExtractor=t,this.markdownService=a,this.serverService=i}getAbout(){return this.authHttp.get(e.BASE_CONFIG_URL+"/about").pipe(s(r=>this.restExtractor.handleError(r)))}updateInstanceBanner(r){let t=e.BASE_CONFIG_URL+"/instance-banner/pick";return this.authHttp.post(t,r).pipe(s(a=>this.restExtractor.handleError(a)))}deleteInstanceBanner(){let r=e.BASE_CONFIG_URL+"/instance-banner";return this.authHttp.delete(r).pipe(s(t=>this.restExtractor.handleError(t)))}updateInstanceAvatar(r){let t=e.BASE_CONFIG_URL+"/instance-avatar/pick";return this.authHttp.post(t,r).pipe(s(a=>this.restExtractor.handleError(a)))}deleteInstanceAvatar(){let r=e.BASE_CONFIG_URL+"/instance-avatar";return this.authHttp.delete(r).pipe(s(t=>this.restExtractor.handleError(t)))}contactAdministrator(r,t,a,i){let o={fromEmail:r,fromName:t,subject:a,body:i};return this.authHttp.post(e.BASE_SERVER_URL+"/contact",o).pipe(s(c=>this.restExtractor.handleError(c)))}buildHtml(r){return f(this,null,function*(){let t={terms:"",codeOfConduct:"",moderationInformation:"",administrator:"",creationReason:"",maintenanceLifetime:"",businessModel:"",hardwareInformation:""};for(let a of v(t))t[a]=yield this.markdownService.enhancedMarkdownToHTML({markdown:r.instance[a]});return t})}buildTranslatedLanguages(r){return d([this.serverService.getVideoLanguages(),this.serverService.getServerLocale()]).pipe(u(([t,a])=>r.instance.languages.map(i=>{let o=t.find(c=>c.id===i);return o?l(o.label,a):(h.error(`Cannot find language ${i} in available languages`),"")})))}buildTranslatedCategories(r){return d([this.serverService.getVideoCategories(),this.serverService.getServerLocale()]).pipe(u(([t,a])=>r.instance.categories.map(i=>{let o=t.find(c=>c.id===i);return o?l(o.label,a):(h.error(`Cannot find instance category ${i} in available categories`),"")})))}};n(e,"BASE_CONFIG_URL",m.apiUrl+"/api/v1/config"),n(e,"BASE_SERVER_URL",m.apiUrl+"/api/v1/server"),n(e,"\u0275fac",function(t){return new(t||e)(p(g),p(b),p(S),p(L))}),n(e,"\u0275prov",E({token:e,factory:e.\u0275fac}));var R=e;export{R as a};
/**i18n:224bcada6943fe8b17ea60808c2d370cec9507c3bd670ebe71692d099a3befa1*/
//# sourceMappingURL=chunk-4E4MIMF5.js.map
