import{B as o,Ie as d,Ph as L,Xc as E,Y as g,aa as p,mg as m,mh as b,n as u,ng as h,r as l,se as v,yh as S}from"./chunk-IDYB4NXF.js";import{i as c,j as f}from"./chunk-AI7IVZV2.js";var e=class e{authHttp=p(E);restExtractor=p(b);markdownService=p(L);serverService=p(S);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:1cf7c077143c4c267fdafbe5508f191afcef21bad6aba22a3a8dc180e1003753*/
//# sourceMappingURL=chunk-SECBKQGS.js.map
