import{c as e,H as a}from"./p-68c1261b.js";const{state:t,onChange:s,reset:r}=e({user:{FirstName:"",LastName:"",ProfileText:"",ProfileImage:"",IsVerified:!1,Roles:[]},loaded:!1,enrollmentList:[]}),n={state:t,onChange:s,reset:r};class i{constructor(){}static getInstance(){return i.instance||(i.instance=new i),i.instance}async enrollClass(e){let t=await a.http.post("api/v1/Student/EnrollClass",e);return t&&(n.state.enrollmentList=[...n.state.enrollmentList,t.Data]),t}async leaveClass(e){let t=await a.http.post("api/v1/Student/LeaveClass",e);return t&&(n.state.enrollmentList=n.state.enrollmentList.filter((e=>e.Id!=t.Data))),t}async fetchUserConfiguration(){let e=await a.http.get("api/v1/Student/UserConfiguration");return e&&(n.state.enrollmentList=e.Data.EnrollmentList,n.state.user.FirstName=e.Data.FirstName,n.state.user.LastName=e.Data.LastName,n.state.user.ProfileText=e.Data.ProfileText,n.state.user.ProfileImage=e.Data.ProfileImage,n.state.user.IsVerified=e.Data.IsVerified,n.state.user.Roles=e.Data.Roles),e}async updateProfile(e){return await a.http.post("api/Account/UpdateProfile",e)}async submitFeedback(e){return await a.http.post("api/v1/Feedback",e)}}export{i as S,n as u}