import{f as y,g as A,i as p,j as g}from"./chunk-TDIPI4U5.js";import{b as E}from"./chunk-DKYFV7F2.js";import{Uc as v,Z as d,ba as a,ga as c,k as s}from"./chunk-SBSTEEKM.js";import{a as f,b as u}from"./chunk-FBSYYVFF.js";var h=(()=>{class r{static{this.type="[Actualites] Get Events"}}return r})();var S=(()=>{class r{constructor(e){this.httpClient=e}getAllEvents(){return this.httpClient.get(g.baseUrl+"/events")}static{this.\u0275fac=function(i){return new(i||r)(c(E))}}static{this.\u0275prov=a({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var o=class l{constructor(t){this.service=t}static selectPastEvents(t){let e=v(new Date,"yyyy-MM-dd","en");return t.events.sort((n,m)=>new Date(m.date).getTime()-new Date(n.date).getTime()).filter(n=>n.date.toString()new Date(m.date).getTime()-new Date(n.date).getTime()).filter(n=>n.date.toString()>e)}getEventsAction(t){return this.service.getAllEvents().pipe(d(e=>{let i=t.getState();t.setState(u(f({},i),{events:e}))}))}static{this.\u0275fac=function(e){return new(e||l)(c(S))}}static{this.\u0275prov=a({token:l,factory:l.\u0275fac})}};s([y(h)],o.prototype,"getEventsAction",null);s([p()],o,"selectPastEvents",null);s([p()],o,"selectFutureEvents",null);o=s([A({name:"ActualitesStore",defaults:{events:[]}})],o);export{h as a,o as b}; //# sourceMappingURL=chunk-Y5KX3OPL.js.map