1import{d as m}from"./chunk-3FBDY7R7.js";import{Bc as s,G as l,J as a,Z as h,_b as r,g as n,hc as f,n as c}from"./chunk-46AOTNJ2.js";var y=(()=>{class o{constructor(t,i,e){this.http=t,this.authService=i,this.platformId=e,this.userChanged=new n,this.notificationsUpdated=new n,this.notificaciones=[]}setUser(t){this.usuario=t,this.authService.setUser(this.usuario),this.userChanged.next(this.usuario)}readUser(){return this.usuario=this.authService.getUser(),this.http.get(s.apiUrl+"/rest/usuario/"+this.usuario.email).pipe(c(t=>(this.usuario=t,this.usuario)))}saveUser(t){let i="",e="";typeof t.fechaNacimiento=="string"?(i=t.fechaNacimiento.split("-")[2]+"/"+t.fechaNacimiento.split("-")[1]+"/"+t.fechaNacimiento.split("-")[0],e=new Date(i).getTime().toString()):e=t.fechaNacimiento;let p={nombre:t.nombre,apellidoPaterno:t.apellidoPaterno,apellidoMaterno:t.apellidoMaterno,email:t.email,segundoNombre:t.segundoNombre,movil:t.movil,fechaNacimiento:e,recibeGangas:t.recibeGangas,id:t.id};return this.http.post(s.apiUrl+"/rest/usuario/actualizausr",p,{responseType:"text"})}readUserFromLocalStorage(){return this.usuario=this.authService.getUser(),this.usuario===null?(console.log("Usuario no esta logeado, usuario debe volver a autenticarse"),null):this.usuario}readNotifications(t){return this.http.get(s.apiUrl+"/rest/usuario/notificaciones/"+t)}deleteNotification(t){return this.http.delete(s.apiUrl+"/rest/usuario/notificaciones/"+t)}removeNotification(t){console.log("Elimina notificacion "+t+" de la lista");let i=this.notificaciones.findIndex(e=>e.id===t);this.notificaciones.splice(i,1),r(this.platformId)&&localStorage.setItem("notificaciones",JSON.stringify(this.notificaciones)),this.notificationsUpdated.next(this.notificaciones.slice())}getNotifications(){return this.notificaciones.slice()}setNotifications(t){this.notificaciones=t,this.notificationsUpdated.next(this.notificaciones.slice()),r(this.platformId)&&localStorage.setItem("notificaciones",JSON.stringify(t))}static{this.\u0275fac=function(i){return new(i||o)(a(f),a(m),a(h))}}static{this.\u0275prov=l({token:o,factory:o.\u0275fac,providedIn:"root"})}}return o})();export{y as a};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.