import{i as H}from"./chunk-UWHJVWMC.js";import{f as S,g as v,i as u,j as g}from"./chunk-TDIPI4U5.js";import{b as F}from"./chunk-DKYFV7F2.js";import{E as A,Z as p,ba as a,ga as n,k as s,m as h}from"./chunk-SBSTEEKM.js";import{a as m,b as f}from"./chunk-FBSYYVFF.js";var d=(()=>{class r{static{this.type="[Hall of Fame] Get scores"}}return r})(),y=(()=>{class r{static{this.type="[Hall of Fame] Get site scores"}}return r})();var G=(()=>{class r{constructor(e){this.http=e}getHallOfFame(){return this.http.get(`${g.baseUrl}/hof/users`)}getSiteHallOfFame(){return this.http.get(`${g.baseUrl}/admin/hof/sites`).pipe(A(e=>(e.status===403?console.error("Access Denied: 403"):console.error("An error occurred:",e.message),h([]))))}static{this.\u0275fac=function(c){return new(c||r)(n(F))}}static{this.\u0275prov=a({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var i=class l{constructor(t){this.service=t}static selectScores(t){return t.scores}static selectScoresSite(t){return t.scoresSite}getHofAction(t){return this.service.getHallOfFame().pipe(p(e=>{let c=t.getState();t.setState(f(m({},c),{scores:e.map(o=>(o.name=new H().transform(o.email,"name"),o.surname=new H().transform(o.email,"surname"),o))}))}))}getSiteHofAction(t){return this.service.getSiteHallOfFame().pipe(p(e=>{let c=t.getState(),o=e??[];t.setState(f(m({},c),{scoresSite:o.sort((b,j)=>j.avg_score-b.avg_score)}))}))}static{this.\u0275fac=function(e){return new(e||l)(n(G))}}static{this.\u0275prov=a({token:l,factory:l.\u0275fac})}};s([S(d)],i.prototype,"getHofAction",null);s([S(y)],i.prototype,"getSiteHofAction",null);s([u()],i,"selectScores",null);s([u()],i,"selectScoresSite",null);i=s([v({name:"HofStore",defaults:{scores:[],scoresSite:[]}})],i);export{d as a,y as b,i as c}; //# sourceMappingURL=chunk-PUGQPNUK.js.map