{"version":3,"sources":["webpack:///./src/views/academics/Attendance.vue?fb4d","webpack:///./src/views/academics/Attendance.vue","webpack:///./src/views/academics/modals/UpdateAttendanceModal.vue","webpack:///./src/views/academics/modals/UpdateAttendanceModal.vue?f0c8","webpack:///./src/views/academics/modals/UpdateAttendanceModal.vue?2d6a","webpack:///./src/views/academics/Attendance.vue?ba1e","webpack:///./src/views/academics/Attendance.vue?74e4","webpack:///./src/views/academics/modals/UpdateAttendanceModal.vue?6073","webpack:///./src/views/academics/modals/UpdateAttendanceModal.vue?3e39","webpack:///./src/core/helpers/breadcrumb.ts"],"names":["class","style","placeholder","semesterId","updateClasses","semesters","semester","label","name","code","moment","start_date","format","end_date","value","id","key","subjectId","filterable","changeSubject","subjects","subject","href","data-bs-toggle","data-bs-target","openUpdateModal","type","plain","setCurrentDateRange","icon","setPrevWeekDateRange","setNextWeekDateRange","data","attendanceData","filter","attendSearch","toLowerCase","includes","header-cell-style","textAlign","header-cell-class-name","getCellClass","cell-class-name","prop","width","align","header","size","dateRange","classDays","attend_statuses","date1","status","length","getAttendanceButtonClass","scope","row","changeAttendType","$index","date2","date3","date4","date5","date6","date7","targetDate","students","getAttendance","tabindex","aria-hidden","data-bs-dismiss","src","attendanceDate","range-separator","start-placeholder","end-placeholder","statusInfo","selectedStatus","default-first-option","statusList","isSelectAll","multiple","selectedStudents","student","student_id","loading","updateAttendances","components","props","Date","Number","Function","default","cur","prev","e","map","item","resetData","fire","text","buttonsStyling","confirmButtonText","customClass","confirmButton","formData","subject_id","attendance_status","student_ids","x","ApiService","setHeader","post","then","editCloseButton","document","getElementById","click","catch","response","console","log","errors","render","__scopeId","AttendanceData","this","UpdateAttendance","methods","getSubjects","Promise","resolve","reject","get","forEach","program","levels","level","sessions","session","push","setClassDays","error","Error","getStudents","attendance","studentName","first_name","last_name","resetAttendance","startDate","endDate","setHours","attendances","groupBy","Object","entries","attendanceIndex","findIndex","sAttendance","attendanceDateString","attendance_date","utc","attData","class_days","split","setDateRange","date","startOfWeek","startOf","toDate","endOfWeek","endOf","emptyArray","d","setDate","getDate","prevWeek","nextWeek","arr","obj","column","isSame","clone","index","propName","currentStatus","newStatus","update","updateButton","getSemesters","sortedData","sort","a","b","parse","keys","today","currentSemester","setCurrentPageBreadcrumbs","pageTitle","breadcrumbs","dispatch","SET_BREADCRUMB_ACTION","title","pageBreadcrumbPath","setCurrentPageTitle"],"mappings":"kHAAA,W,mHCCKA,MAAM,2BAA2BC,MAAA,mB,GAC7BA,MAAA,yBAA8BD,MAAM,Y,GAiBpCC,MAAA,yBAA8BD,MAAM,Y,GAkBxCA,MAAM,oBAAoBC,MAAA,2B,GACxBD,MAAM,yE,GAaNA,MAAM,kC,ijBAlDb,gCAmCQ,MAnCR,EAmCQ,CAlCJ,gCAgBM,MAhBN,EAgBM,C,cAfJ,gCAA2E,QAArEA,MAAM,OAAOC,MAAA,uCAAyC,YAAQ,IACpE,yBAaY,GAZRD,MAAM,+BACNE,YAAY,kB,WACH,EAAAC,W,qCAAA,EAAU,cAClB,SAAQ,EAAAC,e,8BAGT,IAA6B,E,2BAD/B,gCAMY,2CALS,EAAAC,UAAZC,I,yBADT,yBAMY,GAJTC,MAAOD,EAASE,KAAK,IAAIF,EAASG,KAAK,OAAO,EAAAC,OAAOJ,EAASK,YAAYC,OAAO,cAAc,IAAI,EAAAF,OAAOJ,EAASO,UAAUD,OAAO,cACpIE,MAAOR,EAASS,GAChBC,IAAKV,G,8BACN,IAA8I,C,0DAA5IA,EAASE,KAAK,IAAIF,EAASG,KAAK,OAAO,EAAAC,OAAOJ,EAASK,YAAYC,OAAO,cAAc,IAAI,EAAAF,OAAOJ,EAASO,UAAUD,OAAO,eAAD,K,2EAIpI,gCAgBM,MAhBN,EAgBM,C,cAfJ,gCAA0E,QAApEZ,MAAM,OAAOC,MAAA,uCAAyC,WAAO,IACnE,yBAaY,GAZRD,MAAM,+BACNE,YAAY,iB,WACH,EAAAe,U,qCAAA,EAAS,aAClBC,WAAA,GACC,SAAQ,EAA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BA,2BAAc,IAAW,+CACvB0I,IAAe7E,KAAYjF,GAAS,+CAClC,GAAGA,EAAK,CACN,IAAIqK,EAAQ,IAAI5G,KACZ6G,EAAkBtK,EAAKE,OAAO5B,GAAaA,EAASK,YAAc0L,GAAS/L,EAASO,UAAYwL,GAEjGC,EAAgBjJ,OAAS,EAC1BlD,EAAWW,MAAQwL,EAAgB,GAAGvL,GAGtCZ,EAAWW,MAAQkB,EAAK,GAAGjB,SAGvBkH,IAAchB,KAAK,IAAS,qDAC1BrF,UACAT,iBAMd,uBAAU,KACR,eAA0B,aAAc,CAAC,gBAGrC,CACJC,WACAH,YACAgB,iBACAe,YACAS,mBACAhB,eACAb,sBACAG,uBACAD,uBACAK,eACAhB,gBACA8C,aACAxC,kBACAyC,WACAC,gBACAlB,YACA5C,YACAF,aACAC,gBACAM,OAAA,IACAwC,kBACAI,+B,UC7VN,EAAOqE,OAASA,EAChB,EAAOC,UAAY,kBAEJ,gB,kCCRf,W,2DCAA,W,gFCAA,gGAQO,MAAM2E,EAA4B,CACvCC,EACAC,KAEA,OAAMC,SAAS,OAAQC,sBAAuB,CAC5CC,MAAOJ,EACPK,mBAAoBJ,KAQXK,EAAuBF,IAClC,OAAMF,SAAS,OAAQC,sBAAuB,CAC5CC,MAAOA","file":"js/chunk-4fa00220.0c62c141.js","sourcesContent":["export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader-v16/dist/index.js??ref--0-1!./Attendance.vue?vue&type=style&index=0&id=33f7fcea&scoped=true&lang=css\"","\r\n\r\n\r\n\r\n\r\n\r\n","\r\n\r\n\r\n\r\n\r\n\r\n","\r\nimport ApiService from \"@/core/services/ApiService\";\r\nimport { defineComponent, ref, reactive, watch } from \"vue\";\r\nimport Swal from \"sweetalert2/dist/sweetalert2.js\";\r\n\r\nexport default defineComponent({\r\n name: \"update-attendance-modal\",\r\n components: {\r\n },\r\n props:{\r\n targetDate: Date || null,\r\n students:[] as any,\r\n subjectId : Number,\r\n getAttendance : {\r\n type:Function,\r\n default: () => ({}),\r\n },\r\n },\r\n setup(props) {\r\n const loading = ref(false);\r\n const attendanceDate = ref([]);\r\n\r\n watch(() => props.targetDate, (cur, prev)=>{\r\n attendanceDate.value[0] = props.targetDate;\r\n attendanceDate.value[1] = props.targetDate;\r\n })\r\n\r\n const statusInfo = reactive({\r\n selectedStatus:'Present',\r\n statusList :['Select','Present','Late','Absent','Early','LOA']\r\n });\r\n\r\n const selectedStudents = ref([]);\r\n selectedStudents.value= [];\r\n\r\n const isSelectAll = (e) => {\r\n if(e.includes('all')){\r\n selectedStudents.value = props.students.map(item => item.student_id);\r\n }\r\n if(e.includes('unall')){\r\n selectedStudents.value = [];\r\n }\r\n }\r\n\r\n const resetData = () =>{\r\n statusInfo.selectedStatus = \"Present\";\r\n selectedStudents.value=[];\r\n attendanceDate.value[0] = '';\r\n attendanceDate.value[1] = '';\r\n }\r\n\r\n const updateAttendances = async() =>{\r\n if(!attendanceDate.value[0] || !attendanceDate.value[1] || selectedStudents.value.length ==0 || !statusInfo.selectedStatus ){\r\n Swal.fire({\r\n text: \"Please fill out all required fields\",\r\n icon: \"error\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn btn-primary\",\r\n },\r\n });\r\n return false;\r\n }\r\n\r\n const formData :any = { subject_id: props.subjectId, attendance_status: statusInfo.selectedStatus, student_ids: selectedStudents.value.map(x=> x), start_date : attendanceDate.value[0], end_date: attendanceDate.value[1]};\r\n \r\n ApiService.setHeader();\r\n await ApiService.post(\"attendance/bulk\", formData)\r\n .then(() => {\r\n props.getAttendance();\r\n resetData();\r\n let editCloseButton = document.getElementById('edit_class_close_button');\r\n editCloseButton?.click();\r\n })\r\n .catch(({ response }) => {\r\n console.log('bulk attendance create error => '+response.data.errors);\r\n });\r\n }\r\n\r\n return {\r\n statusInfo,\r\n isSelectAll,\r\n selectedStudents,\r\n attendanceDate,\r\n loading,\r\n updateAttendances\r\n };\r\n },\r\n});\r\n","import { render } from \"./UpdateAttendanceModal.vue?vue&type=template&id=74783bd0&scoped=true\"\nimport script from \"./UpdateAttendanceModal.vue?vue&type=script&lang=ts\"\nexport * from \"./UpdateAttendanceModal.vue?vue&type=script&lang=ts\"\n\nimport \"./UpdateAttendanceModal.vue?vue&type=style&index=0&id=74783bd0&lang=scss&scoped=true\"\nimport \"./UpdateAttendanceModal.vue?vue&type=style&index=1&id=74783bd0&scoped=true&lang=css\"\nscript.render = render\nscript.__scopeId = \"data-v-74783bd0\"\n\nexport default script"," \r\nimport { defineComponent, onBeforeMount, onMounted, reactive, ref } from \"vue\";\r\nimport { setCurrentPageBreadcrumbs } from \"@/core/helpers/breadcrumb\";\r\nimport UpdateAttendance from \"@/views/academics/modals/UpdateAttendanceModal.vue\";\r\nimport moment from 'moment'\r\nimport ApiService from \"@/core/services/ApiService\";\r\nimport _ from \"lodash\";\r\n\r\nexport class AttendanceData{\r\n name: string;\r\n student_id : number;\r\n date1 : { id: number | null, status: string };\r\n date2 : { id: number | null, status: string };\r\n date3 : { id: number | null, status: string };\r\n date4 : { id: number | null, status: string };\r\n date5 : { id: number | null, status: string };\r\n date6 : { id: number | null, status: string };\r\n date7 : { id: number | null, status: string };\r\n\r\n constructor(){\r\n this.date1 = {id: null, status :'Select'};\r\n this.date2 = {id: null, status :'Select'};\r\n this.date3 = {id: null, status :'Select'};\r\n this.date4 = {id: null, status :'Select'};\r\n this.date5 = {id: null, status :'Select'};\r\n this.date6 = {id: null, status :'Select'};\r\n this.date7 = {id: null, status :'Select'};\r\n }\r\n}\r\n\r\nexport default defineComponent({\r\n name: \"attendance\",\r\n components: {\r\n UpdateAttendance\r\n },\r\n methods:{\r\n },\r\n setup() {\r\n const targetDate = ref(null);\r\n const dateRange = reactive([]);\r\n const semesters = ref([] as any);\r\n const subjects = ref([] as any);\r\n const semesterId = ref(0 as any);\r\n const subjectId = ref(0 as any);\r\n const attendSearch = ref('');\r\n const students= ref([]);\r\n const attendanceData = reactive([]);\r\n const classDays = ref('');\r\n\r\n attendanceData.value = [];\r\n \r\n const getSubjects = async() => {\r\n subjects.value = [];\r\n await new Promise((resolve, reject) => { \r\n ApiService.setHeader(); \r\n ApiService.get(\"class/\"+semesterId.value)\r\n .then(async({ data }) => {\r\n data.data.forEach(program => {\r\n program.levels.forEach(level => {\r\n level.sessions.forEach(session => {\r\n session.subjects.forEach(subject =>{\r\n subjects.value.push(subject);\r\n })\r\n })\r\n })\r\n });\r\n\r\n subjectId.value = subjects.value[0].id;\r\n setClassDays();\r\n resolve(data.data);\r\n })\r\n .catch((error) => {\r\n reject(new Error ('getClasses error => '+error));\r\n });\r\n });\r\n }\r\n\r\n const getStudents = () : any => {\r\n return new Promise((resolve, reject) => { \r\n ApiService.setHeader(); \r\n ApiService.get(\"class-student/students/\"+subjectId.value)\r\n .then(({ data }) => {\r\n attendanceData.value = [];\r\n students.value=[]; \r\n data.data.forEach(student => {\r\n let attendance = new AttendanceData();\r\n let studentName = student.student.first_name + \" \" + student.student.last_name+\"(\"+student.student.student_id+\")\";\r\n attendance.student_id = student.student.id;\r\n attendance.name = studentName;\r\n attendanceData.value.push(attendance);\r\n students.value.push({student_id : student.student.id, name : studentName})\r\n });\r\n\r\n resolve(data.data);\r\n })\r\n .catch((error) => {\r\n reject(new Error ('getSemesters error => '+error));\r\n });\r\n });\r\n }\r\n\r\n const resetAttendance = () => {\r\n attendanceData.value.map(attendance => {\r\n attendance.date1 = {id: null, status :'Select'};\r\n attendance.date2 = {id: null, status :'Select'};\r\n attendance.date3 = {id: null, status :'Select'};\r\n attendance.date4 = {id: null, status :'Select'};\r\n attendance.date5 = {id: null, status :'Select'};\r\n attendance.date6 = {id: null, status :'Select'};\r\n attendance.date7 = {id: null, status :'Select'};\r\n });\r\n }\r\n\r\n const getAttendance = async() =>{\r\n let startDate = new Date(dateRange[0]);\r\n let endDate = new Date(dateRange[6]);\r\n endDate.setHours(23,59,59,0)\r\n ApiService.setHeader();\r\n return ApiService.get(\"attendance/\"+subjectId.value+\"/\"+startDate+\"/\"+endDate)\r\n .then(({ data }) => {\r\n let attendances = _.groupBy(data.data, data => data.student_id);\r\n for (const [key, value] of Object.entries(attendances)) {\r\n let attendanceIndex = attendanceData.value.findIndex(x=> x.student_id == +key);\r\n if(attendanceIndex>=0){\r\n for(const sAttendance of value){\r\n let attendanceDateString = moment(sAttendance.attendance_date).utc().format('M/DD/YYYY');\r\n let attData = { id: sAttendance.id , status:sAttendance.attendance_status};\r\n switch(attendanceDateString){\r\n case dateRange[0] :\r\n attendanceData.value[attendanceIndex].date1 = attData;\r\n break;\r\n case dateRange[1] :\r\n attendanceData.value[attendanceIndex].date2 = attData;\r\n break;\r\n case dateRange[2] :\r\n attendanceData.value[attendanceIndex].date3 = attData;\r\n break;\r\n case dateRange[3] :\r\n attendanceData.value[attendanceIndex].date4 = attData;\r\n break;\r\n case dateRange[4] :\r\n attendanceData.value[attendanceIndex].date5 = attData;\r\n break;\r\n case dateRange[5] :\r\n attendanceData.value[attendanceIndex].date6 = attData;\r\n break;\r\n case dateRange[6] :\r\n attendanceData.value[attendanceIndex].date7 = attData;\r\n break;\r\n }\r\n }\r\n }\r\n };\r\n })\r\n .catch((error) => {\r\n console.log('getSemesters error => '+error);\r\n });\r\n }\r\n\r\n const changeSubject = async() => {\r\n setClassDays();\r\n await getStudents().then(async() =>{\r\n await getAttendance();\r\n })\r\n }\r\n\r\n const setClassDays = () =>{\r\n classDays.value = subjects.value.filter(x=>x.id == subjectId.value)[0]?.class_days.split(';');\r\n }\r\n\r\n function setDateRange(date){\r\n var startOfWeek = moment(date).startOf('week').toDate();\r\n var endOfWeek = moment(date).endOf('week').toDate();\r\n emptyArray(dateRange);\r\n for (var d = startOfWeek; d <= endOfWeek; d.setDate(d.getDate() + 1)) {\r\n dateRange.push(moment(d).format('M/DD/YYYY'));\r\n }\r\n }\r\n\r\n const setPrevWeekDateRange = async() => {\r\n var prevWeek = moment(dateRange[0]).toDate();\r\n setDateRange(prevWeek.setDate(prevWeek.getDate()-1));\r\n resetAttendance();\r\n await getAttendance();\r\n }\r\n\r\n const setNextWeekDateRange = async() => {\r\n var nextWeek = moment(dateRange[6]).toDate();\r\n setDateRange(nextWeek.setDate(nextWeek.getDate()+1));\r\n resetAttendance();\r\n await getAttendance();\r\n }\r\n\r\n const setCurrentDateRange = async() => {\r\n setDateRange(moment());\r\n resetAttendance();\r\n await getAttendance();\r\n }\r\n\r\n const emptyArray = arr => arr.length = 0;\r\n\r\n const getCellClass = (obj) => {\r\n if(moment(obj.column.label).isSame(moment().clone().startOf('day'), 'd')){\r\n return 'dateToday';\r\n }\r\n };\r\n\r\n const attend_statuses = ['Present','Late','Early'];\r\n const changeAttendType = (index, row, date, propName) => {\r\n let currentStatus = row[propName].status;\r\n let id = row[propName].id;\r\n let newStatus = '';\r\n switch(currentStatus) {\r\n case 'Select':\r\n newStatus = 'Present';\r\n break;\r\n case 'Present':\r\n newStatus = 'Late';\r\n break;\r\n case 'Late':\r\n newStatus = 'Absent';\r\n break;\r\n case 'Absent':\r\n newStatus = 'Early';\r\n break;\r\n case 'Early':\r\n newStatus = 'LOA';\r\n break;\r\n default:\r\n newStatus = 'Select';\r\n }\r\n\r\n if(id == null ){\r\n const formData : any = { subject_id : subjectId.value, student_id: row.student_id, attendance_date : date, attendance_status : newStatus };\r\n ApiService.setHeader();\r\n ApiService.post(\"attendance\", formData)\r\n .then((data) => {\r\n row[propName].status = newStatus;\r\n row[propName].id = data.data.data.id;\r\n })\r\n .catch(({ response }) => {\r\n console.log('create attendance error => '+response.data.errors);\r\n });\r\n }\r\n else{\r\n const formData : any = { attendance_status : newStatus, student_id: row.student_id, subject_id:subjectId.value };\r\n ApiService.setHeader();\r\n ApiService.update(\"attendance\", id, formData)\r\n .then(() => {\r\n row[propName].status = newStatus;\r\n })\r\n .catch(({ response }) => {\r\n console.log('update attendance error => '+response.data.errors);\r\n });\r\n }\r\n };\r\n\r\n const openUpdateModal = (date) =>{\r\n targetDate.value = date;\r\n let updateButton = document.getElementById('update_attendance');\r\n updateButton?.click();\r\n }\r\n\r\n const getSemesters = () : any => {\r\n return new Promise((resolve, reject) => { \r\n ApiService.setHeader();\r\n ApiService.get(\"class/semesters\")\r\n .then(({ data }) => {\r\n let sortedData = data.data.sort(function(a,b) { \r\n if(a.id == b.id) return 0;\r\n\r\n if (Date.parse(a.start_date!) < Date.parse(b.start_date!))\r\n return 1;\r\n if (Date.parse(a.start_date!) > Date.parse(b.start_date!))\r\n return -1;\r\n return 0;\r\n });\r\n semesters.value = sortedData;\r\n resolve(sortedData);\r\n })\r\n .catch((error) => {\r\n reject(new Error ('getSemesters error => '+error));\r\n });\r\n });\r\n }\r\n\r\n const updateClasses = async() => {\r\n await getSubjects().then(async()=>{\r\n await changeSubject();\r\n });\r\n }\r\n\r\n \r\n const getAttendanceButtonClass = (row, propName) : string =>{\r\n if(Object.keys(row).length > 0){\r\n let status = row[propName].status;\r\n if(status == \"Present\"){\r\n return \"bg-light-success text-success\";\r\n }\r\n if(status == \"Absent\"){\r\n return \"bg-light-danger text-danger\";\r\n }\r\n }\r\n\r\n return \"\";\r\n }\r\n\r\n onBeforeMount(async() => {\r\n getSemesters().then(async (data) => {\r\n if(data){\r\n let today = new Date();\r\n let currentSemester = data.filter(semester => (semester.start_date <= today && semester.end_date >= today));\r\n\r\n if(currentSemester.length > 0){\r\n semesterId.value = currentSemester[0].id;\r\n }\r\n else{\r\n semesterId.value = data[0].id;\r\n }\r\n\r\n await getSubjects().then(async()=>{\r\n await setCurrentDateRange();\r\n await changeSubject();\r\n });\r\n }\r\n });\r\n });\r\n\r\n onMounted(() => {\r\n setCurrentPageBreadcrumbs(\"Attendance\", [\"Academics\"]);\r\n });\r\n\r\n return{\r\n subjects,\r\n subjectId,\r\n attendanceData,\r\n dateRange,\r\n changeAttendType,\r\n getCellClass, \r\n setCurrentDateRange,\r\n setNextWeekDateRange,\r\n setPrevWeekDateRange,\r\n attendSearch,\r\n changeSubject,\r\n targetDate,\r\n openUpdateModal,\r\n students,\r\n getAttendance,\r\n classDays,\r\n semesters,\r\n semesterId,\r\n updateClasses,\r\n moment,\r\n attend_statuses,\r\n getAttendanceButtonClass\r\n }\r\n },\r\n});\r\n","import { render } from \"./Attendance.vue?vue&type=template&id=33f7fcea&scoped=true\"\nimport script from \"./Attendance.vue?vue&type=script&lang=ts\"\nexport * from \"./Attendance.vue?vue&type=script&lang=ts\"\n\nimport \"./Attendance.vue?vue&type=style&index=0&id=33f7fcea&scoped=true&lang=css\"\nscript.render = render\nscript.__scopeId = \"data-v-33f7fcea\"\n\nexport default script","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader-v16/dist/index.js??ref--0-1!./UpdateAttendanceModal.vue?vue&type=style&index=1&id=74783bd0&scoped=true&lang=css\"","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader-v16/dist/index.js??ref--0-1!./UpdateAttendanceModal.vue?vue&type=style&index=0&id=74783bd0&lang=scss&scoped=true\"","import store from \"@/store\";\r\nimport { Actions } from \"@/store/enums/StoreEnums\";\r\n\r\n/**\r\n * Sets current page breadcrumbs\r\n * @param {string} pageTitle Current page title\r\n * @param {Array} breadcrumbs Current page breadcrumbs\r\n */\r\nexport const setCurrentPageBreadcrumbs = (\r\n pageTitle: string,\r\n breadcrumbs: Array\r\n): void => {\r\n store.dispatch(Actions.SET_BREADCRUMB_ACTION, {\r\n title: pageTitle,\r\n pageBreadcrumbPath: breadcrumbs,\r\n });\r\n};\r\n\r\n/**\r\n * Sets current page breadcrumbs\r\n * @param {string} title Current page title name\r\n */\r\nexport const setCurrentPageTitle = (title: string): void => {\r\n store.dispatch(Actions.SET_BREADCRUMB_ACTION, {\r\n title: title,\r\n });\r\n};\r\n"],"sourceRoot":""}