import{b as a,H as e}from"./p-6bf07a28.js";const{state:t,onChange:s}=a({pageNotes:[],allPageNotes:[],onlineStudents:[],dashboardData:null,isConnected:!1,loading:!1,dashboardDataLoading:!1,notesLoading:!1,classes:[],classesLoading:!1}),n={state:t,onChange:s};class o{constructor(){}static getInstance(){return o.instance||(o.instance=new o),o.instance}async fetchClasses(){n.state.classesLoading=!0;let a=await e.http.get("api/v1/Teacher/Classes");return a&&(n.state.classes=a.Data,n.state.classesLoading=!1),a}async fetchDashboardData(a){n.state.dashboardDataLoading=!0;let t=await e.http.get(`api/v1/Teacher/Dashboard/${a.ClassId}`);return t&&(n.state.dashboardData=t.Data,n.state.dashboardDataLoading=!1),t}async fetchNotes(a){n.state.notesLoading=!0;let t=await e.http.get(`api/v1/Teacher/Notes/${a.showAllNotes}`);return t&&(a.showAllNotes?n.state.allPageNotes=t.Data:n.state.pageNotes=t.Data,n.state.notesLoading=!1),t}async addFacilitatorNote(a){n.state.notesLoading=!0;let t=await e.http.post("api/v1/Teacher/Notes",a);return t&&(n.state.pageNotes=[...n.state.pageNotes,t.Data]),n.state.notesLoading=!1,t}async updateFacilitatorNote(a){n.state.notesLoading=!0;let t=await e.http.put(`api/v1/Teacher/Notes/${a.Id}`,a);return t&&(n.state.pageNotes=n.state.pageNotes.map((a=>a.Id==t.Data.Id?t.Data:a))),n.state.notesLoading=!1,t}async deleteFacilitatorNote(a){n.state.notesLoading=!0;let t=await e.http.delete(`api/v1/Teacher/Notes/${a}`);return t&&(n.state.pageNotes=n.state.pageNotes.filter((e=>e.Id!=a))),n.state.notesLoading=!1,t}}export{o as F,n as f}