{"version":3,"sources":["webpack:///./src/views/management/modals/EditEvent.vue?23fe","webpack:///./src/views/management/Calendar.vue","webpack:///./src/views/management/modals/EditEvent.vue","webpack:///./src/views/management/modals/EditEvent.vue?1ea7","webpack:///./src/views/management/modals/EditEvent.vue?4b6a","webpack:///./src/views/management/Calendar.vue?ff98","webpack:///./src/views/management/Calendar.vue?86b9","webpack:///./src/views/management/modals/EditEvent.vue?ad37"],"names":["class","style","align","href","data-bs-toggle","data-bs-target","id","type","openEditModal","ref","event","selectedEvent","eventTypes","getEvents","tabindex","aria-hidden","data-bs-dismiss","src","model","eventData","rules","prop","key","label","value","title","period","range-separator","start-placeholder","end-placeholder","format","description","submit","loading","deleteEvent","name","components","props","Function","default","emits","emit","store","formRef","user","getters","currentUser","required","message","trigger","start_date","end_date","editEvent","formData","ApiService","setHeader","update","catch","response","console","log","data","errors","fire","text","icon","buttonsStyling","confirmButtonText","customClass","confirmButton","post","validate","valid","user_id","start","end","then","closeEditBtn","document","getElementById","click","confirm","delete","moment","render","__scopeId","Calendar","EditEvent","calendarWidget","getTypes","get","editBtn"],"mappings":"oKAAA,W,oECCSA,MAAM,oBAAoBC,MAAA,2B,GAGtBD,MAAM,WAAWE,MAAM,S,GACvBF,MAAM,Q,GAcVA,MAAM,2B,8MAlBX,gCAiBM,MAjBN,EAiBM,C,YAhBF,gCACM,OADDA,MAAM,yEAAuE,UAElF,gCAaM,MAbN,EAaM,CAZN,gCAWM,MAXN,EAWM,C,YAVF,gCAME,KALEG,KAAK,IACLF,MAAA,iBACAG,iBAAe,QACfC,iBAAe,oBACfC,GAAG,qB,UAEP,gCAES,UAFDN,MAAM,yBAAyBO,KAAK,SAAU,QAAK,eAAE,EAAAC,cAAc,MAAK,kBAMxF,gCAIM,MAJN,EAIM,CAHF,yBAE0B,GADfA,cAAe,EAAAA,cACtBC,IAAI,kB,4BAEZ,yBAIY,GAHDC,MAAO,EAAAC,cACPC,WAAY,EAAAA,WAClB,YAAW,EAAAC,W,mGCzBhB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UAAY,kBAEJ,QCDA,+BAAgB,CAC3BlD,KAAM,WACNC,WAAY,CACRkD,WAAA,KACAC,aAEJ,QACI,MAAM5E,EAAgB,iBAAI,IACpBC,EAAa,iBAAI,IACjB4E,EAAiB,mBACjBC,EAAW,IAAU,+CACvBnC,EAAA,KAAWC,kBACLD,EAAA,KAAWoC,IAAI,eACZd,KAAK,EAAGf,WACLjD,EAAWY,MAAQqC,EAAKjD,aAE3B6C,MAAM,EAAGC,eACVC,QAAQC,IAAI,qBAAqBF,EAASG,KAAKC,aAIrDtD,EAAiBE,IACnBC,EAAca,MAAQd,EACtB,IAAIiF,EAAUb,SAASC,eAAe,qBAC/B,OAAPY,QAAO,IAAPA,KAASX,SAGPnE,EAAY,K,MACM,QAApB,EAAA2E,EAAehE,aAAK,SAAEX,aAQ1B,OALA,uBAAU,KACN4E,IACA,eAA0B,WAAY,CAAC,iBAGpC,CACH9E,gBACAC,aACAJ,gBACAgF,iBACA3E,gBC9CZ,EAAOuE,OAASA,EAED,gB,oCCLf","file":"js/chunk-7b7fb645.fd117e63.js","sourcesContent":["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!./EditEvent.vue?vue&type=style&index=0&id=58120395&lang=scss&scoped=true\"","\r\n\r\n","\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n","\r\nimport { defineComponent, ref, watch } from \"vue\";\r\nimport Swal from \"sweetalert2/dist/sweetalert2.js\";\r\nimport ApiService from \"@/core/services/ApiService\";\r\nimport { useStore } from \"vuex\";\r\nimport moment from \"moment\";\r\nimport { useFieldValue } from \"vee-validate\";\r\nimport { ElMessageBox } from \"element-plus\";\r\n\r\nexport default defineComponent({\r\n name: \"edit-event-modal\",\r\n components: {\r\n },\r\n props: {\r\n event: {} as any,\r\n eventTypes:[],\r\n getEvents : {\r\n type:Function,\r\n default: () => ({}),\r\n },\r\n },\r\n emits: ['getEvents'],\r\n setup(props, {emit}) {\r\n const store = useStore();\r\n const formRef = ref(null);\r\n const loading = ref(false);\r\n const user = store.getters.currentUser;\r\n const eventData = ref({});\r\n\r\n const rules = ref({ \r\n type: [\r\n {\r\n required: true,\r\n message: \"Please select event type\",\r\n trigger: \"blur\",\r\n },\r\n ],\r\n title: [\r\n {\r\n required: true,\r\n message: \"Please enter the event title\",\r\n trigger: \"change\",\r\n },\r\n ],\r\n });\r\n\r\n watch(() => props.event, ()=>{\r\n eventData.value = props.event;\r\n if(props.event.start_date){\r\n eventData.value.period = [];\r\n eventData.value.period[0] = props.event.start_date;\r\n eventData.value.period[1] = props.event.end_date;\r\n }\r\n })\r\n\r\n const editEvent = async (formData) => {\r\n ApiService.setHeader();\r\n if(eventData.value.id && eventData.value.id !==0)\r\n {\r\n ApiService.update(\"event\", eventData.value.id, formData)\r\n .catch(({ response }) => {\r\n loading.value = false;\r\n console.log('edit event error => '+response.data.errors);\r\n Swal.fire({\r\n text: \"Failed to edit event\",\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 });\r\n }\r\n else\r\n {\r\n ApiService.post(\"event\", formData)\r\n .catch(({ response }) => {\r\n loading.value = false;\r\n console.log('create event error => '+response.data.errors);\r\n Swal.fire({\r\n text: \"Failed to create the new event\",\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 });\r\n }\r\n }\r\n\r\n const submit = () => {\r\n if (!formRef.value) {\r\n return;\r\n }\r\n\r\n formRef.value.validate((valid) => {\r\n if (valid){\r\n loading.value = true;\r\n eventData.value.start_date = eventData.value.period[0];\r\n eventData.value.end_date = eventData.value.period[1];\r\n eventData.value.user_id = user.id;\r\n delete eventData.value.start;\r\n delete eventData.value.end;\r\n delete eventData.value.period;\r\n editEvent(eventData.value).then(() => {\r\n Swal.fire({\r\n text: \"Form has been successfully submitted!\",\r\n icon: \"success\",\r\n buttonsStyling: false,\r\n confirmButtonText: \"Ok, got it!\",\r\n customClass: {\r\n confirmButton: \"btn btn-primary\",\r\n },\r\n }).then(() => {\r\n loading.value = false;\r\n let closeEditBtn = document.getElementById('close_event_button');\r\n closeEditBtn?.click();\r\n emit('getEvents');\r\n });\r\n });\r\n } else {\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 };\r\n\r\n const deleteEvent = () => {\r\n ElMessageBox.confirm('Are you sure to delete this class?').then(() => {\r\n ApiService.setHeader();\r\n ApiService.delete(\"event/\"+eventData.value.id)\r\n .then(() => {\r\n Swal.fire({\r\n text: \"The event is deleted successfully\",\r\n icon: \"success\",\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 .then(() => {\r\n let closeEditBtn = document.getElementById('close_event_button');\r\n closeEditBtn?.click();\r\n emit('getEvents');\r\n });\r\n })\r\n .catch(({ response }) => {\r\n console.log('delete event error => '+response.data.errors);\r\n Swal.fire({\r\n text: \"Failed to delete event\",\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 });\r\n });\r\n };\r\n\r\n return {\r\n loading,\r\n formRef,\r\n moment,\r\n submit,\r\n eventData,\r\n rules,\r\n deleteEvent\r\n };\r\n },\r\n});\r\n","import { render } from \"./EditEvent.vue?vue&type=template&id=58120395&scoped=true\"\nimport script from \"./EditEvent.vue?vue&type=script&lang=ts\"\nexport * from \"./EditEvent.vue?vue&type=script&lang=ts\"\n\nimport \"./EditEvent.vue?vue&type=style&index=0&id=58120395&lang=scss&scoped=true\"\nimport \"./EditEvent.vue?vue&type=style&index=1&id=58120395&scoped=true&lang=css\"\nscript.render = render\nscript.__scopeId = \"data-v-58120395\"\n\nexport default script","\r\nimport { defineComponent, onMounted, ref } from \"vue\";\r\nimport { setCurrentPageBreadcrumbs } from \"@/core/helpers/breadcrumb\";\r\nimport Calendar from \"@/views/widgets/Calendar.vue\"\r\nimport EditEvent from \"@/views/management/modals/EditEvent.vue\"\r\nimport ApiService from \"@/core/services/ApiService\";\r\nimport moment from \"moment\";\r\n\r\nexport default defineComponent({\r\n name: \"calendar\",\r\n components: {\r\n Calendar,\r\n EditEvent\r\n },\r\n setup() {\r\n const selectedEvent = ref({});\r\n const eventTypes = ref([]);\r\n const calendarWidget = ref>()\r\n const getTypes = async() =>{\r\n ApiService.setHeader();\r\n await ApiService.get(\"event/types\")\r\n .then(({ data }) => {\r\n eventTypes.value = data.eventTypes;\r\n })\r\n .catch(({ response }) => {\r\n console.log('getTypes error => '+response.data.errors);\r\n });\r\n }\r\n\r\n const openEditModal = (event) =>{\r\n selectedEvent.value = event;\r\n let editBtn = document.getElementById('event_edit_button');\r\n editBtn?.click();\r\n }\r\n\r\n const getEvents = () =>{\r\n calendarWidget.value?.getEvents();\r\n }\r\n\r\n onMounted(() => {\r\n getTypes();\r\n setCurrentPageBreadcrumbs(\"Calendar\", [\"Management\"]);\r\n });\r\n\r\n return {\r\n selectedEvent,\r\n eventTypes,\r\n openEditModal,\r\n calendarWidget,\r\n getEvents\r\n }\r\n },\r\n});\r\n","import { render } from \"./Calendar.vue?vue&type=template&id=333a95fb\"\nimport script from \"./Calendar.vue?vue&type=script&lang=ts\"\nexport * from \"./Calendar.vue?vue&type=script&lang=ts\"\nscript.render = render\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!./EditEvent.vue?vue&type=style&index=1&id=58120395&scoped=true&lang=css\""],"sourceRoot":""}