import{C as o,Fe as d,Yc as E,Z as g,ba as p,dg as b,if as m,jf as h,n as u,qe as v,s as l,ug as S,vg as L}from"./chunk-XD25PYOU.js";import{i as c,j as f}from"./chunk-FPVLB6PA.js";var e=class e{authHttp=p(E);restExtractor=p(b);markdownService=p(S);serverService=p(L);getAbout(){return this.authHttp.get(e.BASE_CONFIG_URL+"/about").pipe(o(r=>this.restExtractor.handleError(r)))}updateInstanceBanner(r){let t=e.BASE_CONFIG_URL+"/instance-banner/pick";return this.authHttp.post(t,r).pipe(o(a=>this.restExtractor.handleError(a)))}deleteInstanceBanner(){let r=e.BASE_CONFIG_URL+"/instance-banner";return this.authHttp.delete(r).pipe(o(t=>this.restExtractor.handleError(t)))}updateInstanceAvatar(r){let t=e.BASE_CONFIG_URL+"/instance-avatar/pick";return this.authHttp.post(t,r).pipe(o(a=>this.restExtractor.handleError(a)))}deleteInstanceAvatar(){let r=e.BASE_CONFIG_URL+"/instance-avatar";return this.authHttp.delete(r).pipe(o(t=>this.restExtractor.handleError(t)))}contactAdministrator(r,t,a,n){let i={fromEmail:r,fromName:t,subject:a,body:n};return this.authHttp.post(e.BASE_SERVER_URL+"/contact",i).pipe(o(s=>this.restExtractor.handleError(s)))}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 l([this.serverService.getVideoLanguages(),this.serverService.getServerLocale()]).pipe(u(([t,a])=>r.instance.languages.map(n=>{let i=t.find(s=>s.id===n);return i?d(i.label,a):(m.error(`Cannot find language ${n} in available languages`),"")})))}buildTranslatedCategories(r){return l([this.serverService.getVideoCategories(),this.serverService.getServerLocale()]).pipe(u(([t,a])=>r.instance.categories.map(n=>{let i=t.find(s=>s.id===n);return i?d(i.label,a):(m.error(`Cannot find instance category ${n} in available categories`),"")})))}};c(e,"BASE_CONFIG_URL",h.apiUrl+"/api/v1/config"),c(e,"BASE_SERVER_URL",h.apiUrl+"/api/v1/server"),c(e,"\u0275fac",function(t){return new(t||e)}),c(e,"\u0275prov",g({token:e,factory:e.\u0275fac}));var R=e;export{R as a};
/**i18n:fc817608a00477e18624cf8be5badc6c9afae12f0946c7c1548c95cf79bd0e7b*/
//# sourceMappingURL=chunk-SSCWXEWB.js.map
