Files
jandl-taskmanager-app/app/dist/js/index.281a5bc0.js
T
2023-10-18 23:53:57 +02:00

2 lines
205 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(function(){var e={41993:function(e){function t(e){return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}))}t.keys=function(){return[]},t.resolve=t,t.id=41993,e.exports=t},46700:function(e,t,s){var a={"./af":63906,"./af.js":63906,"./ar":40902,"./ar-dz":3853,"./ar-dz.js":3853,"./ar-kw":20299,"./ar-kw.js":20299,"./ar-ly":96825,"./ar-ly.js":96825,"./ar-ma":66379,"./ar-ma.js":66379,"./ar-sa":87700,"./ar-sa.js":87700,"./ar-tn":2059,"./ar-tn.js":2059,"./ar.js":40902,"./az":76043,"./az.js":76043,"./be":7936,"./be.js":7936,"./bg":34078,"./bg.js":34078,"./bm":14014,"./bm.js":14014,"./bn":29554,"./bn-bd":17114,"./bn-bd.js":17114,"./bn.js":29554,"./bo":6529,"./bo.js":6529,"./br":65437,"./br.js":65437,"./bs":19647,"./bs.js":19647,"./ca":59951,"./ca.js":59951,"./cs":26113,"./cs.js":26113,"./cv":37965,"./cv.js":37965,"./cy":35858,"./cy.js":35858,"./da":33515,"./da.js":33515,"./de":62831,"./de-at":6263,"./de-at.js":6263,"./de-ch":51127,"./de-ch.js":51127,"./de.js":62831,"./dv":4510,"./dv.js":4510,"./el":68616,"./el.js":68616,"./en-au":24595,"./en-au.js":24595,"./en-ca":73545,"./en-ca.js":73545,"./en-gb":79609,"./en-gb.js":79609,"./en-ie":43727,"./en-ie.js":43727,"./en-il":93302,"./en-il.js":93302,"./en-in":46305,"./en-in.js":46305,"./en-nz":39128,"./en-nz.js":39128,"./en-sg":84569,"./en-sg.js":84569,"./eo":50650,"./eo.js":50650,"./es":26358,"./es-do":64214,"./es-do.js":64214,"./es-mx":38639,"./es-mx.js":38639,"./es-us":30232,"./es-us.js":30232,"./es.js":26358,"./et":47279,"./et.js":47279,"./eu":15515,"./eu.js":15515,"./fa":27981,"./fa.js":27981,"./fi":37090,"./fi.js":37090,"./fil":79208,"./fil.js":79208,"./fo":2799,"./fo.js":2799,"./fr":23463,"./fr-ca":2213,"./fr-ca.js":2213,"./fr-ch":52848,"./fr-ch.js":52848,"./fr.js":23463,"./fy":41468,"./fy.js":41468,"./ga":88163,"./ga.js":88163,"./gd":2898,"./gd.js":2898,"./gl":76312,"./gl.js":76312,"./gom-deva":20682,"./gom-deva.js":20682,"./gom-latn":49178,"./gom-latn.js":49178,"./gu":31400,"./gu.js":31400,"./he":52795,"./he.js":52795,"./hi":17009,"./hi.js":17009,"./hr":46506,"./hr.js":46506,"./hu":69565,"./hu.js":69565,"./hy-am":93864,"./hy-am.js":93864,"./id":5626,"./id.js":5626,"./is":36649,"./is.js":36649,"./it":90151,"./it-ch":95348,"./it-ch.js":95348,"./it.js":90151,"./ja":79830,"./ja.js":79830,"./jv":33751,"./jv.js":33751,"./ka":63365,"./ka.js":63365,"./kk":85980,"./kk.js":85980,"./km":99571,"./km.js":99571,"./kn":25880,"./kn.js":25880,"./ko":16809,"./ko.js":16809,"./ku":96773,"./ku.js":96773,"./ky":65505,"./ky.js":65505,"./lb":50553,"./lb.js":50553,"./lo":51237,"./lo.js":51237,"./lt":91563,"./lt.js":91563,"./lv":61057,"./lv.js":61057,"./me":96495,"./me.js":96495,"./mi":83096,"./mi.js":83096,"./mk":43874,"./mk.js":43874,"./ml":46055,"./ml.js":46055,"./mn":87747,"./mn.js":87747,"./mr":17113,"./mr.js":17113,"./ms":8687,"./ms-my":7948,"./ms-my.js":7948,"./ms.js":8687,"./mt":14532,"./mt.js":14532,"./my":4655,"./my.js":4655,"./nb":56961,"./nb.js":56961,"./ne":2512,"./ne.js":2512,"./nl":48448,"./nl-be":72936,"./nl-be.js":72936,"./nl.js":48448,"./nn":49031,"./nn.js":49031,"./oc-lnc":5174,"./oc-lnc.js":5174,"./pa-in":30118,"./pa-in.js":30118,"./pl":93448,"./pl.js":93448,"./pt":33518,"./pt-br":62447,"./pt-br.js":62447,"./pt.js":33518,"./ro":70817,"./ro.js":70817,"./ru":10262,"./ru.js":10262,"./sd":58990,"./sd.js":58990,"./se":43842,"./se.js":43842,"./si":37711,"./si.js":37711,"./sk":80756,"./sk.js":80756,"./sl":3772,"./sl.js":3772,"./sq":6187,"./sq.js":6187,"./sr":40732,"./sr-cyrl":75713,"./sr-cyrl.js":75713,"./sr.js":40732,"./ss":99455,"./ss.js":99455,"./sv":69770,"./sv.js":69770,"./sw":80959,"./sw.js":80959,"./ta":36459,"./ta.js":36459,"./te":25302,"./te.js":25302,"./tet":67975,"./tet.js":67975,"./tg":71294,"./tg.js":71294,"./th":2385,"./th.js":2385,"./tk":24613,"./tk.js":24613,"./tl-ph":58668,"./tl-ph.js":58668,"./tlh":58190,"./tlh.js":58190,"./tr":74506,"./tr.js":74506,"./tzl":63440,"./tzl.js":63440,"./tzm":69852,"./tzm-latn":42350,"./tzm-latn.js":42350,"./tzm.js":69852,"./ug-cn":70730,"./ug-cn.js":70730,"./uk":40099,"./uk.js":40099,"./ur":72100,"./ur.js":72100,"./uz":96002,"./uz-latn":26322,"./uz-latn.js":26322,"./uz.js":96002,"./vi":14207,"./vi.js":14207,"./x-pseudo":24674,"./x-pseudo.js":24674,"./yo":10570,"./yo.js":10570,"./zh-cn":73644,"./zh-cn.js":73644,"./zh-hk":22591,"./zh-hk.js":22591,"./zh-mo":89503,"./zh-mo.js":89503,"./zh-tw":88080,"./zh-tw.js":88080};function i(e){var t=l(e);return s(t)}function l(e){if(!s.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}i.keys=function(){return Object.keys(a)},i.resolve=l,e.exports=i,i.id=46700},79456:function(e,t,s){"use strict";s.d(t,{$t:function(){return ir}});var a=s(49242),i=s(74973);async function l(){const e=await s.e(3657).then(s.t.bind(s,33657,23));e.load({google:{families:["Roboto:100,300,400,500,700,900&display=swap"]}})}var n=s(38685),o=(s(29773),(0,n.Rd)()),r=s(73752),d=s.n(r),u=s(73396),c=s(97718),m=s(29271);function h(e,t,s,a,i,l){const n=(0,u.up)("router-view"),o=(0,u.up)("Z-team-modal"),r=(0,u.up)("Z-delete-team-modal"),d=(0,u.up)("Z-task-modal"),h=(0,u.up)("Z-delete-task-modal"),p=(0,u.up)("Z-delete-timeBlock-modal"),v=(0,u.up)("Z-delete-blocker-modal"),k=(0,u.up)("Z-delete-master-task-modal"),f=(0,u.up)("Z-complete-task-modal"),g=(0,u.up)("Z-complete-master-task-modal"),w=(0,u.up)("Z-task-add-time-modal"),_=(0,u.up)("Z-blocker-modal"),y=(0,u.up)("Z-master-task-modal"),b=(0,u.up)("Z-delete-team-member-modal"),D=(0,u.up)("Z-show-menu-modal");return(0,u.wg)(),(0,u.iD)(u.HY,null,[(0,u.Wm)(c.q,null,{default:(0,u.w5)((()=>[(0,u.Wm)(m.O,null,{default:(0,u.w5)((()=>[(0,u.Wm)(n)])),_:1})])),_:1}),(0,u.Wm)(o,{ref:"z-team-modal",onUpdate:l.onTeamUpdate},null,8,["onUpdate"]),(0,u.Wm)(r,{ref:"z-delete-team-modal",onUpdate:l.onTeamUpdate},null,8,["onUpdate"]),(0,u.Wm)(d,{ref:"z-task-modal",onOnSubtaskEdited:l.onTaskEdited},null,8,["onOnSubtaskEdited"]),(0,u.Wm)(h,{ref:"z-delete-task-modal",onOnSubtaskDeleted:l.onTaskDeleted},null,8,["onOnSubtaskDeleted"]),(0,u.Wm)(p,{ref:"z-delete-timeblock-modal",onOnSubtaskEdited:l.onTaskEdited},null,8,["onOnSubtaskEdited"]),(0,u.Wm)(v,{ref:"z-delete-blocker-modal",onOnBlockerDeleted:l.onBlockerDeleted},null,8,["onOnBlockerDeleted"]),(0,u.Wm)(k,{ref:"z-delete-master-task-modal",onOnMastertaskDeleted:l.onMasterTaskDeleted},null,8,["onOnMastertaskDeleted"]),(0,u.Wm)(f,{ref:"z-complete-task-modal",onOnSubtaskEdited:l.onTaskEdited},null,8,["onOnSubtaskEdited"]),(0,u.Wm)(g,{ref:"z-complete-master-task-modal",onMasterTaskEdited:l.onMasterTaskEdited},null,8,["onMasterTaskEdited"]),(0,u.Wm)(w,{ref:"z-task-add-time-modal"},null,512),(0,u.Wm)(_,{ref:"z-blocker-modal"},null,512),(0,u.Wm)(y,{ref:"z-master-task-modal",onMasterTaskEdited:l.onMasterTaskEdited},null,8,["onMasterTaskEdited"]),(0,u.Wm)(b,{ref:"z-delete-team-member-modal"},null,512),(0,u.Wm)(D,{ref:"z-show-menu-modal"},null,512)],64)}s(57658);var p=s(87139),v=s(67312),k=s(75039),f=s(91334),g=s(33601),w=s(53289);const _={class:"d-flex justify-space-between align-center"};function y(e,t,s,i,l,n){return(0,u.wg)(),(0,u.j4)(g.B,{modelValue:l.visible,"onUpdate:modelValue":t[3]||(t[3]=e=>l.visible=e),"max-width":"750",persistent:""},{default:(0,u.w5)((()=>[(0,u.Wm)(k._,null,{default:(0,u.w5)((()=>[(0,u._)("div",_,[(0,u._)("h1",null,[(0,u.Uk)(" Ste si istý, že chcete zmazať tím "),(0,u._)("b",null,(0,p.zw)(l.team.name),1),(0,u.Uk)("? ")]),(0,u.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>n.closeModal()),["stop"])),icon:"mdi-close",size:"large"})]),(0,u.Wm)(f.h,{class:"mt-10 d-flex justify-start align-center mobile-view"},{default:(0,u.w5)((()=>[(0,u.Wm)(v.T,{class:"button primary half",variant:"flat",onClick:t[1]||(t[1]=e=>n.deleteTeam()),disabled:l.isDeleting},{default:(0,u.w5)((()=>[(0,u.Uk)("ÁNO")])),_:1},8,["disabled"]),(0,u.Wm)(v.T,{class:"button primary half outline",onClick:t[2]||(t[2]=(0,a.iM)((e=>n.closeModal()),["stop"]))},{default:(0,u.w5)((()=>[(0,u.Uk)("ZRUŠIŤ")])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"])}var b={mounted(){window.addEventListener("keydown",this.handleKeyDown)},methods:{handleKeyDown(e){27===e.keyCode&&(this.visible=!1)}}},D={mixins:[b],emits:["update"],data(){return{visible:!1,team:null,isDeleting:!1}},methods:{async showModal({team:e}){this.team=e,this.visible=!0},closeModal(){this.visible=!1},async deleteTeam(){if(!this.isDeleting){this.isDeleting=!0;try{await this.$axios.delete_auth(`v1/teams/${this.team.id}`),this.visible=!1,this.$emit("update",this.team),this.$store.commit("tm/delete_team",this.team)}catch(e){this.$toast.error(e)}finally{this.isDeleting=!1}}}}},M=s(40089);const T=(0,M.Z)(D,[["render",y]]);var C=T,$=s(60988),j=s(45869);const E={class:"d-flex justify-space-between align-center modal-header"};function x(e,t,s,i,l,n){const o=(0,u.up)("W-loadable");return(0,u.wg)(),(0,u.j4)(g.B,{modelValue:l.visible,"onUpdate:modelValue":t[4]||(t[4]=e=>l.visible=e),"max-width":"750","max-height":"90%",height:"700px",persistent:""},{default:(0,u.w5)((()=>[(0,u.Wm)(o,{content:l.team,class:"h-100"},{default:(0,u.w5)((()=>[(0,u.Wm)(k._,{height:"100%",class:"d-flex flex-column"},{default:(0,u.w5)((()=>[(0,u._)("div",E,[(0,u._)("h1",null,(0,p.zw)(l.team.id?"Upraviť tím":"Vytvoriť tím"),1),(0,u.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>n.closeModal()),["stop"])),icon:"mdi-close",size:"large"})]),(0,u.Wm)(f.h,{class:"d-flex flex-column modal-content"},{default:(0,u.w5)((()=>[(0,u.Wm)(j.hw,{class:(0,p.C_)(["modal-input",{error:l.v$.team.name.$errors.length}]),label:"Názov tímu",variant:"solo",hint:l.v$.team.name.$errors?l.errorUtils.parseErrors(l.v$.team.name.$errors):null,modelValue:l.team.name,"onUpdate:modelValue":t[1]||(t[1]=e=>l.team.name=e)},null,8,["class","hint","modelValue"]),((0,u.wg)(!0),(0,u.iD)(u.HY,null,(0,u.Ko)(l.team.employees,((e,t)=>((0,u.wg)(),(0,u.iD)("div",{class:"relative w-100",key:e.id},[(0,u.Wm)(j.hw,{class:"modal-input",disabled:"",label:"Zamestanec",variant:"solo",modelValue:l.team.employees[t]._fullName,"onUpdate:modelValue":e=>l.team.employees[t]._fullName=e},null,8,["modelValue","onUpdate:modelValue"]),(0,u.Wm)(w.t,{class:"remove-input",onClick:(0,a.iM)((e=>l.team.employees.splice(t,1)),["stop"]),icon:"mdi-close",size:"small"},null,8,["onClick"])])))),128)),(0,u.Wm)($.f,{"custom-filter":e.customFilter,"match-any":!0,modelValue:l.employeeSelect,"onUpdate:modelValue":t[2]||(t[2]=e=>l.employeeSelect=e),label:"Priradený",class:(0,p.C_)([{error:l.v$.team.employees.$errors.length},"modal-input"]),items:n.employeesOptions,"item-title":"_fullName","item-value":"id",variant:"solo",clearable:"",ref:"autocomplete"},null,8,["custom-filter","modelValue","class","items"])])),_:1}),(0,u.Wm)(v.T,{class:"button primary block",onClick:t[3]||(t[3]=e=>n.save())},{default:(0,u.w5)((()=>[(0,u.Uk)((0,p.zw)(l.team.id?"UPRAVIŤ":"VYTVORIŤ"),1)])),_:1})])),_:1})])),_:1},8,["content"])])),_:1},8,["modelValue"])}var W=s(33053),S=s(69117),V=s(7648),O=s(34407),z=s(20065),A=s(83299);const U=e=>e.length;var Z={mixins:[A.Z,b],emits:["close","update"],data(){return{visible:!1,v$:(0,W.ZP)(),errorUtils:V.Z,employeeSelect:null,team:null}},computed:{...(0,z.Se)("tm",["enrichedEmployees"]),employeesOptions(){const e=this.team.employees.map((e=>e.id));return this.enrichedEmployees.filter((t=>!e.includes(t.id)))}},validations(){return{team:{name:{required:S.C1},employees:{atLeastOne:U}}}},methods:{async showModal({team:e=null}){this.visible=!0,this.team=null,this.$nextTick((()=>this.v$.$reset()));try{if(e?.id){const t=await this.$axios.get_auth_data(`v1/teams/${e.id}`);this.team=this._enrichTeam(t)}else this.team={employees:[]}}catch(t){this.$toast.error(t)}},closeModal(){this.visible=!1,this.$emit("close",this.team)},async save(){if(await this.v$.$validate())try{if(this.team.id){const{team:e}=await this.$axios.put_auth(`v1/teams/${this.team.id}`,this.team),t=await this.$axios.get_auth_data(`v1/teams/${e.id}`);this.$store.commit("tm/update_team",t)}else{const{team:e}=await this.$axios.post_auth("v1/teams",this.team),t=await this.$axios.get_auth_data(`v1/teams/${e.id}`);this.$store.commit("tm/save_team",t)}this.closeModal()}catch(e){this.$toast.error(e)}},_enrichTeam(e){return e.employees=O.Z.enrichEmployees(e.employees),e}},watch:{employeeSelect(e){if(!e)return;const t=this.enrichedEmployees.find((t=>t.id==e));this.team.employees.push(t),this.employeeSelect=null,this.$refs.autocomplete.search=""}}};const H=(0,M.Z)(Z,[["render",x]]);var F=H;const I={class:"d-flex justify-space-between align-center"};function P(e,t,s,i,l,n){return(0,u.wg)(),(0,u.j4)(g.B,{modelValue:l.visible,"onUpdate:modelValue":t[3]||(t[3]=e=>l.visible=e),"max-width":"750",persistent:""},{default:(0,u.w5)((()=>[(0,u.Wm)(k._,null,{default:(0,u.w5)((()=>[(0,u._)("div",I,[(0,u._)("h1",null,[(0,u.Uk)("Ste si istý, že chcete zmazať sub task z mastertasku "),(0,u._)("b",null,(0,p.zw)(l.subtask.project_code),1),(0,u.Uk)("?")]),(0,u.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>n.closeModal()),["stop"])),icon:"mdi-close",size:"large",class:"mb-15"})]),(0,u.Wm)(f.h,{class:"mt-10 d-flex justify-start align-center mobile-view"},{default:(0,u.w5)((()=>[(0,u.Wm)(v.T,{class:"button primary half",variant:"flat",onClick:t[1]||(t[1]=e=>n.deleteTask()),disabled:l.isDeleting},{default:(0,u.w5)((()=>[(0,u.Uk)("ÁNO")])),_:1},8,["disabled"]),(0,u.Wm)(v.T,{class:"button primary half outline",onClick:t[2]||(t[2]=(0,a.iM)((e=>n.closeModal()),["stop"]))},{default:(0,u.w5)((()=>[(0,u.Uk)("ZRUŠIŤ")])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"])}var L={mixins:[b],emits:["on-subtask-deleted"],data(){return{visible:!1,subtask:null,isDeleting:!1}},methods:{async showModal({subtask:e}){this.subtask=e,this.visible=!0},closeModal(){this.visible=!1},async deleteTask(){if(!this.isDeleting){this.isDeleting=!0;try{await this.$axios.delete_auth(`v1/subtasks/${this.subtask.id}`),this.$store.commit("tm/delete_subtask",this.subtask),this.closeModal(),this.$emit("on-subtask-deleted",this.subtask)}catch(e){this.$toast.error(e)}finally{this.isDeleting=!1}}}}};const N=(0,M.Z)(L,[["render",P]]);var Y=N;const q=e=>((0,u.dD)("data-v-d2c490ee"),e=e(),(0,u.Cn)(),e),B={class:"d-flex justify-space-between align-center"},R=q((()=>(0,u._)("h4",{class:"mt-3"},"Vyberte časový úsek, ktorý chcete odstrániť",-1)));function K(e,t,s,i,l,n){return(0,u.wg)(),(0,u.j4)(g.B,{modelValue:l.visible,"onUpdate:modelValue":t[1]||(t[1]=e=>l.visible=e),"max-width":"500",persistent:""},{default:(0,u.w5)((()=>[(0,u.Wm)(k._,null,{default:(0,u.w5)((()=>[(0,u._)("div",B,[R,(0,u.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>n.closeModal()),["stop"])),icon:"mdi-close",size:"large"})]),((0,u.wg)(!0),(0,u.iD)(u.HY,null,(0,u.Ko)(l.subtask.timeblocks,((e,t)=>((0,u.wg)(),(0,u.iD)("div",{key:e.id,class:"d-flex align-center justify-center mb-3 mt-3"},[(0,u._)("p",{class:(0,p.C_)(["task-badge rounded-pill",{"strike-through":e.is_finished}])},(0,p.zw)(l.tmUtils.formatDateTime(e.start))+" - "+(0,p.zw)(l.tmUtils.formatDateTime(e.end)),3),(0,u.Wm)(w.t,{onClick:(0,a.iM)((s=>l.subtask.id?n.deleteTimeblock(e):n.deleteTimeblockWithoutId(t)),["stop"]),class:"close-icon circle-border cursor-pointer ml-3 text-red",icon:"mdi-close",size:"medium"},null,8,["onClick"])])))),128))])),_:1})])),_:1},8,["modelValue"])}var J={mixins:[b],emits:["on-subtask-edited"],data(){return{visible:!1,subtask:null,isDeleting:!1,tmUtils:O.Z}},methods:{async showModal({subtask:e}){this.subtask=e,this.visible=!0},closeModal(){this.visible=!1},async deleteTimeblock({id:e}){const t=JSON.parse(JSON.stringify(this.subtask));t.timeblocks=t.timeblocks.filter((t=>t.id!=e)),t.deadline&&(t.deadline=O.Z.formatDateTimeForBackend(t.deadline)),this._update(t)},deleteTimeblockWithoutId(e){this.$emit("delete-timeblock")},async _update(e){try{const t=e.timesheets.map((e=>(delete e.employee_name,e))),{subtask:s}=await this.$axios.put_auth(`v1/subtasks/${e.id}`,{...e,timesheets:t});this.closeModal(),this.$events.emit("on-subtask-edited",s)}catch(t){this.$toast.error(t.message||t)}}}};const G=(0,M.Z)(J,[["render",K],["__scopeId","data-v-d2c490ee"]]);var X=G;const Q=e=>((0,u.dD)("data-v-d5edb19e"),e=e(),(0,u.Cn)(),e),ee={class:"d-flex justify-space-between align-center modal-header"},te={class:"splitted-inputs"},se=Q((()=>(0,u._)("path",{d:"M23.057 7.057l-16 16c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l16-16c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0z"},null,-1))),ae=Q((()=>(0,u._)("path",{d:"M7.057 8.943l16 16c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885l-16-16c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"},null,-1))),ie=[se,ae],le=["onClick"],ne=Q((()=>(0,u._)("path",{d:"M23.057 7.057l-16 16c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l16-16c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0z"},null,-1))),oe=Q((()=>(0,u._)("path",{d:"M7.057 8.943l16 16c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885l-16-16c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"},null,-1))),re=[ne,oe],de={class:"w-100 modal-input"},ue={class:"d-flex justify-space-between align-center"},ce={class:"d-flex justify-space-between align-center modal-header border-bottom pb-4"},me={class:"d-flex justify-start"},he=["src"],pe=["src"],ve={class:"w-100"},ke={class:"d-flex justify-start align-center mt-8"};function fe(e,t,i,l,n,o){const r=(0,u.up)("Datepicker"),d=(0,u.up)("QuillEditor"),c=(0,u.up)("Z-files-upload"),m=(0,u.up)("Z-task-readonly-info"),h=(0,u.up)("W-loadable");return(0,u.wg)(),(0,u.j4)(g.B,{modelValue:n.visible,"onUpdate:modelValue":t[20]||(t[20]=e=>n.visible=e),"max-width":"750","max-height":"90%",height:"700px",persistent:""},{default:(0,u.w5)((()=>[(0,u.Wm)(h,{content:n.subtask,class:"h-100"},{default:(0,u.w5)((()=>[n.editMode?((0,u.wg)(),(0,u.j4)(k._,{key:0,height:"100%",class:"d-flex flex-column scrolling"},{default:(0,u.w5)((()=>[(0,u._)("div",ee,[(0,u._)("h1",null,(0,p.zw)(n.subtask?.id?"Upraviť sub task":"Vytvoriť sub task"),1),(0,u.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>o.closeModal()),["stop"])),icon:"mdi-close",size:"large"})]),(0,u.Wm)(f.h,{class:"d-flex flex-column modal-content"},{default:(0,u.w5)((()=>[(0,u.Wm)(j.hw,{modelValue:n.subtask.project_code,"onUpdate:modelValue":t[1]||(t[1]=e=>n.subtask.project_code=e),label:"Kód projektu",value:n.subtask.project_code,onFocus:e.onInputFocus,class:"modal-input",variant:"solo",disabled:""},null,8,["modelValue","value","onFocus"]),(0,u.Wm)($.f,{"custom-filter":e.customFilter,"match-any":!0,modelValue:n.subtask.master_task_id,"onUpdate:modelValue":t[2]||(t[2]=e=>n.subtask.master_task_id=e),label:"Master task",class:(0,p.C_)([{error:n.v$.subtask.master_task_id.$errors.length},"modal-input"]),items:e.mastertasks,"item-title":"name","item-value":"id",variant:"solo",clearable:""},null,8,["custom-filter","modelValue","class","items"]),(0,u.Wm)(j.hw,{modelValue:n.subtask.title,"onUpdate:modelValue":t[3]||(t[3]=e=>n.subtask.title=e),onFocus:e.onInputFocus,class:"modal-input",label:"Názov subtasku",variant:"solo"},null,8,["modelValue","onFocus"]),(0,u._)("div",te,[(0,u.Wm)(r,{modelValue:n.subtask.deadline,"onUpdate:modelValue":t[4]||(t[4]=e=>n.subtask.deadline=e),"auto-apply":!0,onFocus:e.onDateFocus,"min-date":new Date,class:(0,p.C_)(["modal-input left",{error:n.v$.subtask.deadline.$errors?.length}]),format:"dd.MM.yyyy",locale:"sk","select-text":"Vybrať","cancel-text":"Zrušiť",placeholder:"Dátum",validations:n.v$.subtask.deadline},null,8,["modelValue","onFocus","min-date","class","validations"]),(0,u.Wm)(j.hw,{class:(0,p.C_)(["modal-input right",{error:n.v$.subtask._deadline_time.$errors.length}]),variant:"solo",modelValue:n.subtask._deadline_time,"onUpdate:modelValue":t[5]||(t[5]=e=>n.subtask._deadline_time=e),label:"Čas","append-inner-icon":"mdi-clock-outline",type:"time",onFocus:e.onInputFocus,hint:n.v$.subtask._deadline_time.$errors?n.errorUtils.parseErrors(n.v$.subtask._deadline_time.$errors):null},null,8,["modelValue","onFocus","class","hint"])]),n.subtask.id?((0,u.wg)(),(0,u.iD)(u.HY,{key:0},[(0,u._)("div",{class:(0,p.C_)(["employee-wrapper",{"hide-arrow":n.subtask.employee_id}])},[n.subtask.employee_id?((0,u.wg)(),(0,u.iD)("svg",{key:0,version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",class:"dp__icon dp__clear_icon dp__input_icons","data-test":"clear-icon",onClick:t[6]||(t[6]=(0,a.iM)((e=>{n.subtask.employee_id=null,n.subtask.employee=null}),["prevent"]))},ie)):(0,u.kq)("",!0),(0,u.Wm)($.f,{"custom-filter":e.customFilter,"match-any":!0,modelValue:n.subtask.employee_id,"onUpdate:modelValue":[t[7]||(t[7]=e=>n.subtask.employee_id=e),t[8]||(t[8]=e=>n.employeeValidations[0]?n.employeeValidations[0].employee=!1:null)],label:"Priradený",items:e.enrichedEmployees,"item-title":"_fullName","item-value":"id",variant:"solo",class:(0,p.C_)(["modal-input",{error:n.employeeValidations[0]?.employee}])},null,8,["custom-filter","modelValue","items","class"])],2),(0,u.Wm)(j.hw,{modelValue:n.subtask.duration,"onUpdate:modelValue":[t[9]||(t[9]=e=>n.subtask.duration=e),t[10]||(t[10]=e=>n.employeeValidations[0]?n.employeeValidations[0].duration=!1:null)],class:(0,p.C_)(["modal-input",{error:n.employeeValidations[0]?.duration}]),variant:"solo",type:"number",label:"Časový odhad","append-inner-icon":"mdi-clock-outline",onFocus:e.onInputFocus},null,8,["modelValue","class","onFocus"])],64)):((0,u.wg)(!0),(0,u.iD)(u.HY,{key:1},(0,u.Ko)(n.subtask.employees,((t,s)=>((0,u.wg)(),(0,u.iD)("div",{key:`employee-${s}`,class:(0,p.C_)(["splitted-inputs remove-employee",{"hide-arrow":t.id}])},[(0,u.Wm)($.f,{"custom-filter":e.customFilter,"match-any":!0,modelValue:t.id,"onUpdate:modelValue":[e=>t.id=e,e=>n.employeeValidations[s]?n.employeeValidations[s].employee=!1:null],label:"Priradený",items:e.enrichedEmployees,"item-title":"_fullName","item-value":"id",variant:"solo",class:(0,p.C_)(["modal-input left",{error:n.employeeValidations[s]?.employee}])},null,8,["custom-filter","modelValue","onUpdate:modelValue","items","class"]),t.id?((0,u.wg)(),(0,u.iD)("svg",{key:0,version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",class:"dp__icon dp__clear_icon dp__input_icons","data-test":"clear-icon",onClick:(0,a.iM)((e=>t.id=null),["prevent"])},re,8,le)):(0,u.kq)("",!0),(0,u.Wm)(j.hw,{modelValue:t.duration,"onUpdate:modelValue":[e=>t.duration=e,e=>n.employeeValidations[s]?n.employeeValidations[s].duration=!1:null],class:(0,p.C_)(["modal-input right",{error:n.employeeValidations[s]?.duration}]),variant:"solo",type:"number",label:"Časový odhad","append-inner-icon":"mdi-clock-outline",onFocus:e.onInputFocus},null,8,["modelValue","onUpdate:modelValue","class","onFocus"])],2)))),128)),(0,u._)("div",de,[(0,u.Wm)(d,{ref:"description",modelValue:n.subtask.description,"onUpdate:modelValue":t[11]||(t[11]=e=>n.subtask.description=e),placeholder:"Popis",theme:"snow",class:"rich-text-editor",onInput:t[12]||(t[12]=e=>n.subtask.description=e.srcElement.innerHTML)},null,8,["modelValue"])]),(0,u.Wm)(c,{class:"mt-15 files",files:n.subtask.files,onFilesUploaded:o.filesUploaded,"is-saving":n.isSaving},null,8,["files","onFilesUploaded","is-saving"])])),_:1}),n.isSaving?((0,u.wg)(),(0,u.j4)(v.T,{key:1,class:"button primary disabled",disabled:""},{default:(0,u.w5)((()=>[(0,u.Uk)((0,p.zw)(e.$t("Ukladám...")),1)])),_:1})):((0,u.wg)(),(0,u.j4)(v.T,{key:0,class:"button primary",onClick:t[13]||(t[13]=e=>o.save())},{default:(0,u.w5)((()=>[(0,u.Uk)((0,p.zw)(n.subtask.id?"UPRAVIŤ":"VYTVORIŤ"),1)])),_:1}))])),_:1})):((0,u.wg)(),(0,u.j4)(k._,{key:1,height:"100%",class:"d-flex flex-column scrolling"},{default:(0,u.w5)((()=>[(0,u._)("div",ue,[(0,u._)("div",null,[(0,u._)("p",null,(0,p.zw)(n.subtask._master_task.project_code),1),(0,u._)("h1",null,(0,p.zw)(n.subtask._master_task.name),1)]),(0,u.Wm)(w.t,{onClick:t[14]||(t[14]=(0,a.iM)((e=>o.closeModal()),["stop"])),icon:"mdi-close",size:"large",class:"pb-5"})]),(0,u._)("div",ce,[(0,u._)("h1",null,(0,p.zw)(n.subtask.title),1),(0,u._)("div",me,[(0,u._)("img",{class:"icon",src:s(60666),alt:"pencil-icon",onClick:t[15]||(t[15]=(0,a.iM)((e=>n.editMode=!n.editMode),["stop"]))},null,8,he),(0,u._)("img",{class:"icon trash",src:s(27484),alt:"trash-icon",onClick:t[16]||(t[16]=(0,a.iM)((e=>o.openDeleteTaskModal(n.subtask)),["stop"]))},null,8,pe)])]),(0,u.Wm)(f.h,{class:"d-flex flex-column modal-content"},{default:(0,u.w5)((()=>[(0,u._)("div",ve,[(0,u.Wm)(m,{subtask:n.subtask,onCloseModal:o.closeModal,onUpdateSubtask:o.updateSubtask},null,8,["subtask","onCloseModal","onUpdateSubtask"]),(0,u._)("div",ke,[n.subtask.is_finished?((0,u.wg)(),(0,u.j4)(v.T,{key:1,class:"button secondary",onClick:t[18]||(t[18]=(0,a.iM)((e=>o.showCompleteTaskModal()),["stop"]))},{default:(0,u.w5)((()=>[(0,u.Uk)("Znovu otvoriť")])),_:1})):((0,u.wg)(),(0,u.j4)(v.T,{key:0,class:"done-btn",onClick:t[17]||(t[17]=(0,a.iM)((e=>o.showCompleteTaskModal()),["stop"]))},{default:(0,u.w5)((()=>[(0,u.Uk)("Dokončiť")])),_:1})),(0,u.Wm)(v.T,{class:"button secondary",onClick:t[19]||(t[19]=e=>o.closeModal())},{default:(0,u.w5)((()=>[(0,u.Uk)("Uložiť zmeny")])),_:1})])])])),_:1})])),_:1}))])),_:1},8,["content"])])),_:1},8,["modelValue"])}var ge=s(63972),we=s(87103);const _e={class:"w-100 d-flex align-center"},ye={key:0,class:"m-2 d-flex align-center flex-wrap"},be={key:0,class:"d-flex align-center"},De=["src"];function Me(e,t,i,l,n,o){return(0,u.wg)(),(0,u.iD)("div",_e,[(0,u._)("input",{type:"file",multiple:"",name:"file",id:"fileInput",class:"hidden-input",accept:"*",onChange:t[0]||(t[0]=(...e)=>o.onChange&&o.onChange(...e)),ref:"fileUpload"},null,544),(0,u.Wm)(v.T,{class:"upload-btn",onClick:t[1]||(t[1]=t=>e.$refs.fileUpload.click())},{default:(0,u.w5)((()=>[(0,u.Wm)(w.t,{class:"mx-1",icon:"mdi-cloud-upload-outline"}),(0,u.Uk)("NAHRAŤ ")])),_:1}),n.uploadedFiles?((0,u.wg)(),(0,u.iD)("div",ye,[((0,u.wg)(!0),(0,u.iD)(u.HY,null,(0,u.Ko)(n.uploadedFiles,(e=>((0,u.wg)(),(0,u.iD)("div",{key:e.name,class:"mx-2"},[(0,u.Wm)(we.v,{class:"mt-2"},{default:(0,u.w5)((()=>[(0,u.Uk)((0,p.zw)(e.name)+" ",1),(0,u.Wm)(w.t,{class:"mx-1",icon:"mdi-paperclip"}),(0,u._)("p",null,(0,p.zw)((e.size/1048576).toFixed(2))+" MB",1),(0,u.Wm)(w.t,{size:"small",icon:"mdi-close",onClick:(0,a.iM)((t=>o.remove(n.uploadedFiles.indexOf(e))),["stop"])},null,8,["onClick"])])),_:2},1024)])))),128)),i.isSaving?((0,u.wg)(),(0,u.iD)("div",be,[i.isSaving?((0,u.wg)(),(0,u.iD)("img",{key:0,class:"gif-loader",src:s(14214),alt:"Loading..."},null,8,De)):(0,u.kq)("",!0)])):(0,u.kq)("",!0)])):(0,u.kq)("",!0)])}var Te={emit:["files-uploaded"],props:{files:{type:Array,default:()=>[]},isSaving:{type:Boolean,required:!1}},data(){return{uploadedFiles:[]}},created(){this.uploadedFiles=this.files},methods:{onChange(){const e=[...this.$refs.fileUpload.files],t=52428800,s=e.filter((e=>e.size>t));s.length>0?this.$toast.error("File is too large. Maximum file size is 50 MB."):(this.uploadedFiles=[...this.uploadedFiles,...e],this.$emit("files-uploaded",this.uploadedFiles),this.$refs.fileUpload.value="")},remove(e){this.uploadedFiles.splice(e,1)}}};const Ce=(0,M.Z)(Te,[["render",Me],["__scopeId","data-v-29172155"]]);var $e=Ce,je=s(16824),Ee=s(68521),xe=s(74286);const We={class:"d-flex align-center"},Se=(0,u._)("p",{class:"mx-3"},"Trvanie",-1),Ve={class:"d-flex align-center mb-3"},Oe=(0,u._)("p",{class:"task-badge rounded-pill"},"Pridať záznam",-1),ze={class:"d-flex justify-space-between align-center"},Ae=(0,u._)("h1",null,"Pridať dátum",-1),Ue={class:"d-flex justify-space-between align-center"},Ze={class:"text-red"},He=(0,u._)("br",null,null,-1),Fe={class:"text-black"};function Ie(e,t,s,i,l,n){const o=(0,u.up)("Datepicker");return(0,u.wg)(),(0,u.iD)(u.HY,null,[(0,u.Wm)(je.o,{"no-gutters":""},{default:(0,u.w5)((()=>[(0,u.Wm)(Ee.D,{cols:"5"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[(0,u._)("div",We,[(0,u.Wm)(w.t,{icon:"mdi-calendar-week",size:"large"}),Se])])),_:1})])),_:1}),(0,u.Wm)(Ee.D,{cols:"7"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[(0,u._)("div",Ve,[(0,u.Wm)(w.t,{onClick:t[0]||(t[0]=e=>l.showModal=!0),class:"add-date cursor-pointer mr-2",icon:"mdi-plus",size:"medium"}),Oe]),((0,u.wg)(!0),(0,u.iD)(u.HY,null,(0,u.Ko)(s.timeblocks,((e,t)=>((0,u.wg)(),(0,u.iD)("div",{key:e.id,class:"d-flex align-center mb-3"},[(0,u.Wm)(w.t,{onClick:(0,a.iM)((a=>s.subtask.id?n.deleteTimeblock(e):n.deleteTimeblockWithoutId(t)),["stop"]),class:"circle-border cursor-pointer mr-2",icon:"mdi-minus",size:"medium"},null,8,["onClick"]),(0,u._)("p",{class:(0,p.C_)(["task-badge rounded-pill",{"strike-through":e.is_finished}])},(0,p.zw)(l.tmUtils.formatDateTime(e.start))+" - "+(0,p.zw)(l.tmUtils.formatDateTime(e.end)),3),(0,u.wy)((0,u.Wm)(w.t,{onClick:(0,a.iM)((t=>n.toggleTimeblockIsFinished(e)),["stop"]),class:(0,p.C_)(["circle-border cursor-pointer ml-2",{completed:e.is_finished}]),icon:"mdi-check",size:"medium"},null,8,["onClick","class"]),[[a.F8,s.subtask.id]])])))),128))])),_:1})])),_:1})])),_:1}),(0,u.Wm)(g.B,{"max-width":"750",modelValue:l.showModal,"onUpdate:modelValue":t[6]||(t[6]=e=>l.showModal=e),persistent:""},{default:(0,u.w5)((()=>[(0,u.Wm)(k._,null,{default:(0,u.w5)((()=>[(0,u._)("div",ze,[Ae,(0,u.Wm)(w.t,{onClick:t[1]||(t[1]=(0,a.iM)((e=>n.closeModal()),["stop"])),icon:"mdi-close",size:"large"})]),(0,u.Wm)(f.h,{class:"mt-10 d-flex flex-column modal-content"},{default:(0,u.w5)((()=>[(0,u.Wm)(o,{modelValue:l.form.date,"onUpdate:modelValue":t[2]||(t[2]=e=>l.form.date=e),format:"dd.MM.yyyy",locale:"sk","select-text":"Vybrať","cancel-text":"Zrušiť",placeholder:"Dátum","auto-apply":!0,"enable-time-picker":!1,class:(0,p.C_)(["mb-5 modal-input",{error:l.v$.form.date.$errors.length}])},null,8,["modelValue","class"]),(0,u.Wm)(j.hw,{modelValue:l.form.starts_at_time,"onUpdate:modelValue":t[3]||(t[3]=e=>l.form.starts_at_time=e),type:"time",variant:"solo","bg-color":"white",hint:l.v$.form.starts_at_time.$errors?l.errorUtils.parseErrors(l.v$.form.starts_at_time.$errors):null,class:(0,p.C_)([{error:l.v$.form.starts_at_time.$errors.length},"mb-1 modal-input"]),label:"Začiatok"},null,8,["modelValue","hint","class"]),(0,u.Wm)(j.hw,{modelValue:l.form.ends_at_time,"onUpdate:modelValue":t[4]||(t[4]=e=>l.form.ends_at_time=e),type:"time",variant:"solo","bg-color":"white",hint:l.v$.form.ends_at_time.$errors?l.errorUtils.parseErrors(l.v$.form.ends_at_time.$errors):null,class:(0,p.C_)([{error:l.v$.form.ends_at_time.$errors.length},"modal-input"]),label:"Koniec"},null,8,["modelValue","hint","class"])])),_:1}),(0,u.Wm)(v.T,{onClick:t[5]||(t[5]=e=>n.submit()),class:"button primary mt-5"},{default:(0,u.w5)((()=>[(0,u.Uk)("Potvrdiť")])),_:1})])),_:1})])),_:1},8,["modelValue"]),(0,u.Wm)(g.B,{modelValue:l.visible,"onUpdate:modelValue":t[10]||(t[10]=e=>l.visible=e),"max-width":"750",persistent:""},{default:(0,u.w5)((()=>[(0,u.Wm)(k._,null,{default:(0,u.w5)((()=>[(0,u._)("div",Ue,[(0,u._)("h1",Ze,[(0,u.Uk)("Ste si istý, že chcete pridať timeblock po deadline "),He,(0,u.Uk)(),(0,u._)("b",Fe,"z mastertasku "+(0,p.zw)(s.subtask?.project_code)+" ?",1)]),(0,u.Wm)(w.t,{onClick:t[7]||(t[7]=(0,a.iM)((e=>l.visible=!1),["stop"])),icon:"mdi-close",size:"large",class:"mb-15"})]),(0,u.Wm)(f.h,{class:"mt-10 d-flex justify-start align-center mobile-view"},{default:(0,u.w5)((()=>[(0,u.Wm)(v.T,{class:"button primary half",variant:"flat",onClick:t[8]||(t[8]=(0,a.iM)((e=>n.confirmSubmit()),["stop"]))},{default:(0,u.w5)((()=>[(0,u.Uk)("ÁNO")])),_:1}),(0,u.Wm)(v.T,{class:"button primary half outline",onClick:t[9]||(t[9]=(0,a.iM)((e=>l.visible=!1),["stop"]))},{default:(0,u.w5)((()=>[(0,u.Uk)("ZRUŠIŤ")])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"])],64)}var Pe=s(36797),Le=s.n(Pe),Ne={mixins:[b],emits:["update-subtask"],components:{Datepicker:ge.Z},props:{timeblocks:{type:Array,required:!0},subtask:{type:Object,required:!0}},data(){return{v$:(0,W.ZP)(),errorUtils:V.Z,tmUtils:O.Z,showModal:!1,visible:!1,form:{date:null,starts_at_time:"09:00",ends_at_time:"16:00"}}},validations(){return{form:{date:{required:S.C1},starts_at_time:{required:S.C1},ends_at_time:{required:S.C1}}}},computed:{...(0,z.Se)("tm",["mastertasks"])},methods:{async submit(){if(!await this.v$.$validate())return;const e=JSON.parse(JSON.stringify(this.subtask)),t=this.form.starts_at_time.split(":"),s=this.form.ends_at_time.split(":"),a=Le()(this.form.date).hours(parseInt(t[0])).minutes(parseInt(t[1])).toISOString(),i=Le()(this.form.date).hours(parseInt(s[0])).minutes(parseInt(s[1])).toISOString();e?.timeblocks||(e.timeblocks=[]),e?.timesheets||(e.timesheets=[]),e?.is_finished||(e.is_finished=0),e.timeblocks.push({end:O.Z.formatDateTimeForBackend(i),id:null,is_finished:0,start:O.Z.formatDateTimeForBackend(a)}),e.deadline&&(e.deadline=O.Z.formatDateTimeForBackend(e.deadline));const l=this.isAfterDeadline();l?this.visible=!0:e.id?this._update(e):this.$emit("update-unfinished-subtask",e)},async confirmSubmit(){const e=JSON.parse(JSON.stringify(this.subtask)),t=this.form.starts_at_time.split(":"),s=this.form.ends_at_time.split(":"),a=Le()(this.form.date).hours(parseInt(t[0])).minutes(parseInt(t[1])).toISOString(),i=Le()(this.form.date).hours(parseInt(s[0])).minutes(parseInt(s[1])).toISOString();if(e?.timeblocks||(e.timeblocks=[]),e?.timesheets||(e.timesheets=[]),e?.is_finished||(e.is_finished=0),e.timeblocks.push({end:O.Z.formatDateTimeForBackend(i),id:null,is_finished:0,start:O.Z.formatDateTimeForBackend(a)}),e.deadline&&(e.deadline=O.Z.formatDateTimeForBackend(e.deadline)),!e.id)return this.$emit("update-unfinished-subtask",e),void this.closeModal();this.visible=!1,this._update(e)},async toggleTimeblockIsFinished(e){const t=JSON.parse(JSON.stringify(this.subtask)),s=JSON.parse(JSON.stringify(e));s.is_finished=1==s.is_finished?0:1;try{const{data:e}=await this.$axios.put_auth(`v1/timeblocks/${s.id}`,s);t.timeblocks=t.timeblocks.map((t=>t.id==e.id?e:t)),this.$events.emit("on-subtask-edited",t),this.$emit("update-subtask",t),s.is_finished&&this.$events.emit("show-task-add-time-modal",{subtask:t})}catch(a){this.$toast.error(a.message||a)}},async deleteTimeblock({id:e}){const t=JSON.parse(JSON.stringify(this.subtask));t.timeblocks=t.timeblocks.filter((t=>t.id!=e)),t.deadline&&(t.deadline=O.Z.formatDateTimeForBackend(t.deadline)),this._update(t)},deleteTimeblockWithoutId(e){this.$emit("delete-timeblock")},async _update(e){try{const t=e.timesheets.map((e=>(delete e.employee_name,e))),{subtask:s}=await this.$axios.put_auth(`v1/subtasks/${e.id}`,{...e,timesheets:t});this.closeModal(),this.$events.emit("on-subtask-edited",s)}catch(t){this.$toast.error(t.message||t)}},isAfterDeadline(){const e=this.getDeadline(this.subtask);return!!e&&this.tmUtils.isAfter(this.form.date,Le()(e,"DD.MM.yyyy"))},getDeadline(e){if(e.deadline)return Le()(e.deadline).format("DD.MM.yyyy");if(!this.mastertasks)return"";const t=this.mastertasks.find((t=>t.id===e.master_task_id));return Le()(t).format("DD.MM.yyyy")?Le()(t.deadline).format("DD.MM.yyyy"):""},closeModal(){this.form={date:null,starts_at_time:"09:00",ends_at_time:"16:00"},this.showModal=!1,this.$nextTick((()=>this.v$.$reset()))}}};const Ye=(0,M.Z)(Ne,[["render",Ie]]);var qe=Ye,Be=s(96149),Re={data(){return{preventInputFocus:!1}},methods:{onDateFocus(e){void 0==e&&(this.preventInputFocus=!0)},onInputFocus(e){this.preventInputFocus&&(e.target.blur(),this.preventInputFocus=!1)}}},Ke=s(15941),Je={computed:{employeesOptions(){const e=[...this.mastertask.employees].map((e=>e.id));return this.enrichedEmployees.filter((t=>!e.includes(t.id)))||[]},projectsOptions(){const e=/[^a-zA-Z0-9 ]/g,t=this.projectCodeSearch?this.projectCodeSearch.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(e,""):"",s=this.projects.filter((s=>{const a=s.code.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(e,"");return a.toLowerCase().includes(t.toLowerCase())}));let a=s?.length?s.slice(0,10):this.projects.slice(0,10);if(!this.mastertask?.project_id)return a;const i=this.projects.find((e=>e.id==this.mastertask?.project_id));return a=a.filter((e=>e.id!=i.id)),[...a,i]}},methods:{onEmployeeSelected(e){const t=this.enrichedEmployees.find((t=>t.id==e));Ke.log("add employee",t),this.mastertask.employees.push(t),this.showAddEmployeeInput=!1},onEmployeeDurationChanged(){let e=0;this.mastertask.employees=this.mastertask.employees.map((t=>("string"==typeof t.duration?(e+=parseFloat(t.duration),t.duration=parseFloat(t.duration),t.invalid=!1):"number"==typeof t.duration&&(e+=t.duration,t.invalid=!1),t))),this.mastertask.duration=e}},watch:{"mastertask.team_id"(e){if(!e)return;const t=this.teams.find((t=>t.id==e));t&&(this.mastertask.team=JSON.parse(JSON.stringify(t)),this.mastertask.employees=[...this.mastertask.team.employees])}}},Ge=s(66154);function Xe(e,t,s,a,i,l){const n=(0,u.up)("A-mastertask-name"),o=(0,u.up)("A-mastertask-status"),r=(0,u.up)("A-task-deadline"),d=(0,u.up)("A-task-timeblocks"),c=(0,u.up)("Z-created-by"),m=(0,u.up)("A-task-assigned-employee"),h=(0,u.up)("A-task-planned-time"),p=(0,u.up)("A-task-remaining-time"),v=(0,u.up)("A-task-spent-time"),k=(0,u.up)("A-task-description"),f=(0,u.up)("Z-files");return(0,u.wg)(),(0,u.iD)(u.HY,null,[(0,u.Wm)(n,{name:s.subtask._master_task.name,id:s.subtask.master_task_id,color:s.subtask._master_task.color,onCloseModal:t[0]||(t[0]=t=>e.$emit("close-modal"))},null,8,["name","id","color"]),(0,u.Wm)(o,{isFinished:s.subtask.is_finished},null,8,["isFinished"]),(0,u.Wm)(r,{subtask:s.subtask},null,8,["subtask"]),(0,u.Wm)(d,{timeblocks:s.subtask.timeblocks,subtask:s.subtask,onUpdateSubtask:t[1]||(t[1]=t=>e.$emit("update-subtask",t))},null,8,["timeblocks","subtask"]),(0,u.Wm)(c,{"employee-id":s.subtask.created_by},null,8,["employee-id"]),(0,u.Wm)(m,{employee:s.subtask._employee},null,8,["employee"]),(0,u.Wm)(h,{hours:s.subtask.duration},null,8,["hours"]),(0,u.Wm)(p,{hours:s.subtask.duration-s.subtask.spent_time},null,8,["hours"]),(0,u.Wm)(v,{hours:s.subtask.spent_time,subtask:s.subtask},null,8,["hours","subtask"]),(0,u.Wm)(k,{description:s.subtask.description,"mastertask-description":s.subtask.master_task_description},null,8,["description","mastertask-description"]),(0,u.Wm)(f,{files:s.subtask.files},null,8,["files"])],64)}const Qe={class:"d-flex align-center"},et=(0,u._)("p",{class:"mx-3"},"Mastertask",-1);function tt(e,t,s,a,i,l){return(0,u.wg)(),(0,u.j4)(je.o,{"no-gutters":"",class:"align-center"},{default:(0,u.w5)((()=>[(0,u.Wm)(Ee.D,{cols:"5"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[(0,u._)("div",Qe,[(0,u.Wm)(w.t,{icon:"mdi-link",size:"large"}),et])])),_:1})])),_:1}),(0,u.Wm)(Ee.D,{cols:"7"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[(0,u._)("p",{class:"task-badge px-4 py-2 rounded-pill hover",onClick:t[0]||(t[0]=e=>l.openMastertask()),style:(0,p.j5)({backgroundColor:s.color})},(0,p.zw)(s.name),5)])),_:1})])),_:1})])),_:1})}var st={emits:["close-modal"],props:{name:{type:String,required:!0},id:{type:Number,required:!0},color:{type:String,required:!0}},methods:{openMastertask(){this.$emit("close-modal"),this.$events.emit("show-mastertask-modal",{mastertask:{id:this.id},editMode:!1})}}};const at=(0,M.Z)(st,[["render",tt]]);var it=at;const lt={class:"d-flex align-center"},nt=(0,u._)("p",{class:"mx-3"},"Status",-1),ot={key:0,class:"status-badge px-4 py-2 rounded-pill"},rt={key:1,class:"status-badge px-4 py-2 rounded-pill"};function dt(e,t,s,a,i,l){return(0,u.wg)(),(0,u.j4)(je.o,{"no-gutters":"",class:"align-center"},{default:(0,u.w5)((()=>[(0,u.Wm)(Ee.D,{cols:"5"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[(0,u._)("div",lt,[(0,u.Wm)(w.t,{icon:"mdi-drag-vertical",size:"large"}),nt])])),_:1})])),_:1}),(0,u.Wm)(Ee.D,{cols:"7"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[s.isFinished?((0,u.wg)(),(0,u.iD)("p",ot,"Ukončený")):((0,u.wg)(),(0,u.iD)("p",rt,"Neukončený"))])),_:1})])),_:1})])),_:1})}var ut={props:{isFinished:{type:Number,default:()=>0}}};const ct=(0,M.Z)(ut,[["render",dt]]);var mt=ct;const ht={class:"d-flex align-center"},pt=(0,u._)("p",{class:"mx-3"},"Vytvoril",-1),vt={class:"employee-selected-avatar d-flex justify-center align-center"},kt={class:"ml-2"};function ft(e,t,s,a,i,l){return(0,u.wg)(),(0,u.j4)(je.o,{"no-gutters":"",class:"align-center"},{default:(0,u.w5)((()=>[(0,u.Wm)(Ee.D,{cols:"5"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[(0,u._)("div",ht,[(0,u.Wm)(w.t,{icon:"mdi-account-star-outline",size:"large"}),pt])])),_:1})])),_:1}),(0,u.Wm)(Ee.D,{cols:"7"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3 d-flex align-center"},{default:(0,u.w5)((()=>[(0,u._)("p",vt,(0,p.zw)(l.employee?l.employee._initials:"?"),1),(0,u._)("p",kt,(0,p.zw)(l.employee?l.employee._fullName:e.$t("Unasigned")),1)])),_:1})])),_:1})])),_:1})}var gt={props:{employeeId:{type:[Number],required:!1}},computed:{...(0,z.Se)("tm",["enrichedEmployees"]),employee(){return this.enrichedEmployees.find((e=>e.id==this.employeeId))}}};const wt=(0,M.Z)(gt,[["render",ft]]);var _t=wt;const yt={class:"d-flex align-center"},bt=(0,u._)("p",{class:"mx-3"},"Priradený",-1),Dt={class:"employee-selected-avatar d-flex justify-center align-center"},Mt=["innerHTML"];function Tt(e,t,s,a,i,l){return(0,u.wg)(),(0,u.j4)(je.o,{"no-gutters":"",class:"align-center"},{default:(0,u.w5)((()=>[(0,u.Wm)(Ee.D,{cols:"5"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[(0,u._)("div",yt,[(0,u.Wm)(w.t,{icon:"mdi-account-outline",size:"large"}),bt])])),_:1})])),_:1}),(0,u.Wm)(Ee.D,{cols:"7"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3 d-flex align-center"},{default:(0,u.w5)((()=>[(0,u._)("p",Dt,(0,p.zw)(s.employee.name.charAt(0)+s.employee.surname.charAt(0)),1),(0,u._)("p",{class:"ml-2",innerHTML:`${s.employee.name} ${s.employee.surname}`},null,8,Mt)])),_:1})])),_:1})])),_:1})}var Ct={props:{employee:{type:Object,required:!0}}};const $t=(0,M.Z)(Ct,[["render",Tt]]);var jt=$t;const Et={class:"d-flex align-center"},xt=(0,u._)("p",{class:"mx-3"},"Naplánovaný čas",-1);function Wt(e,t,s,a,i,l){return(0,u.wg)(),(0,u.j4)(je.o,{"no-gutters":"",class:"align-center"},{default:(0,u.w5)((()=>[(0,u.Wm)(Ee.D,{cols:"5"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[(0,u._)("div",Et,[(0,u.Wm)(w.t,{icon:"mdi-clock-time-three-outline",size:"large"}),xt])])),_:1})])),_:1}),(0,u.Wm)(Ee.D,{cols:"7"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[(0,u._)("p",null,(0,p.zw)(s.hours)+" h",1)])),_:1})])),_:1})])),_:1})}var St={props:{hours:{type:Number,required:!0}}};const Vt=(0,M.Z)(St,[["render",Wt]]);var Ot=Vt;const zt=e=>((0,u.dD)("data-v-c9f868dc"),e=e(),(0,u.Cn)(),e),At={class:"d-flex align-center"},Ut=zt((()=>(0,u._)("p",{class:"mx-3"},"Odpracovaný čas",-1))),Zt={class:"d-flex align-center mb-3"},Ht=zt((()=>(0,u._)("p",{class:"task-badge rounded-pill"},"Pridať záznam",-1))),Ft={class:"d-flex align-center flex-start width-100"},It={class:"task-badge rounded-pill"},Pt={class:"ml-5"},Lt={class:"d-flex justify-space-between align-center"},Nt=zt((()=>(0,u._)("h1",null,"Pridať odpracovaný čas",-1)));function Yt(e,t,s,i,l,n){return(0,u.wg)(),(0,u.iD)(u.HY,null,[(0,u.Wm)(je.o,{"no-gutters":""},{default:(0,u.w5)((()=>[(0,u.Wm)(Ee.D,{cols:"5"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[(0,u._)("div",At,[(0,u.Wm)(w.t,{icon:"mdi-clock-time-three-outline",size:"large"}),Ut])])),_:1})])),_:1}),(0,u.Wm)(Ee.D,{cols:"7"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[(0,u._)("p",null,(0,p.zw)(s.hours)+" h",1)])),_:1}),(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[(0,u._)("div",Zt,[(0,u.Wm)(w.t,{onClick:t[0]||(t[0]=e=>l.showModal=!0),class:"add-date cursor-pointer mr-2",icon:"mdi-plus",size:"medium"}),Ht]),s.subtask.timesheets.length?((0,u.wg)(!0),(0,u.iD)(u.HY,{key:0},(0,u.Ko)(s.subtask.timesheets,(e=>((0,u.wg)(),(0,u.iD)("div",{key:e.id,class:"d-flex align-center mb-3"},[(0,u.Wm)(w.t,{onClick:(0,a.iM)((t=>n.deleteTimesheet(e)),["stop"]),class:"circle-border cursor-pointer mr-2",icon:"mdi-minus",size:"medium"},null,8,["onClick"]),(0,u._)("div",Ft,[(0,u._)("p",It,(0,p.zw)(e.time),1),(0,u._)("p",Pt,(0,p.zw)(e.employee_name)+" ("+(0,p.zw)(e.timestamp)+")",1)])])))),128)):(0,u.kq)("",!0)])),_:1})])),_:1})])),_:1}),(0,u.Wm)(g.B,{"max-width":"750",modelValue:l.showModal,"onUpdate:modelValue":t[4]||(t[4]=e=>l.showModal=e),persistent:""},{default:(0,u.w5)((()=>[(0,u.Wm)(k._,null,{default:(0,u.w5)((()=>[(0,u._)("div",Lt,[Nt,(0,u.Wm)(w.t,{onClick:t[1]||(t[1]=(0,a.iM)((e=>n.closeModal()),["stop"])),icon:"mdi-close",size:"large"})]),(0,u.Wm)(f.h,{class:"mt-10 d-flex justify-start align-center"},{default:(0,u.w5)((()=>[(0,u.Wm)(j.hw,{modelValue:l.form.hours,"onUpdate:modelValue":t[2]||(t[2]=e=>l.form.hours=e),variant:"solo","bg-color":"white",type:"number",hint:l.v$.form.hours.$errors?l.errorUtils.parseErrors(l.v$.form.hours.$errors):null,class:(0,p.C_)([{error:l.v$.form.hours.$errors.length},"mb-2"]),label:"Odpracovaný čas"},null,8,["modelValue","hint","class"])])),_:1}),(0,u.Wm)(v.T,{onClick:t[3]||(t[3]=e=>n.submit()),class:"button primary mt-5"},{default:(0,u.w5)((()=>[(0,u.Uk)("Potvrdiť")])),_:1})])),_:1})])),_:1},8,["modelValue"])],64)}var qt={mixins:[b],props:{hours:{type:Number,required:!0},subtask:{type:Object,required:!0}},data(){return{moment:Le(),v$:(0,W.ZP)(),errorUtils:V.Z,showModal:!1,form:{hours:null}}},validations(){return{form:{hours:{required:S.C1,numeric:S.uR,minValue:(0,S.uv)(.1)}}}},computed:{...(0,z.Se)("auth",["user"])},methods:{async submit(){if(!await this.v$.$validate())return;const e=JSON.parse(JSON.stringify(this.subtask));e.timesheets.push({id:null,employee_id:this.user.id,time:"string"==typeof this.form.hours?parseFloat(this.form.hours):this.form.hours}),e.deadline&&(e.deadline=O.Z.formatDateTimeForBackend(e.deadline)),this._update(e)},async deleteTimesheet({id:e}){const t=JSON.parse(JSON.stringify(this.subtask));t.timesheets=t.timesheets.filter((t=>t.id!=e)),t.deadline&&(t.deadline=O.Z.formatDateTimeForBackend(t.deadline)),this._update(t)},closeModal(){this.form={hours:null},this.showModal=!1,this.$nextTick((()=>this.v$.$reset()))},async _update(e){try{e.timesheets=e.timesheets.map((e=>(delete e.employee_name,e)));const{subtask:t}=await this.$axios.put_auth(`v1/subtasks/${e.id}`,e);this.closeModal(),this.$events.emit("on-subtask-edited",t)}catch(t){this.$toast.error(t.message||t)}}}};const Bt=(0,M.Z)(qt,[["render",Yt],["__scopeId","data-v-c9f868dc"]]);var Rt=Bt;const Kt={class:"d-flex align-center"},Jt=(0,u._)("p",{class:"mx-3"},"Zostávajúci čas",-1);function Gt(e,t,s,a,i,l){return(0,u.wg)(),(0,u.j4)(je.o,{"no-gutters":"",class:"align-center border-bottom"},{default:(0,u.w5)((()=>[(0,u.Wm)(Ee.D,{cols:"5"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[(0,u._)("div",Kt,[(0,u.Wm)(w.t,{icon:"mdi-clock-time-three-outline",size:"large"}),Jt])])),_:1})])),_:1}),(0,u.Wm)(Ee.D,{cols:"7"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[(0,u._)("p",null,(0,p.zw)(s.hours.toFixed(2))+" h",1)])),_:1})])),_:1})])),_:1})}var Xt={props:{hours:{type:Number,required:!0}}};const Qt=(0,M.Z)(Xt,[["render",Gt]]);var es=Qt,ts=s(80678);const ss={class:"d-flex align-center"},as=(0,u._)("p",{class:"mx-3"},"Deadline",-1);function is(e,t,s,a,i,l){return(0,u.wg)(),(0,u.j4)(je.o,{"no-gutters":"",class:"align-center"},{default:(0,u.w5)((()=>[(0,u.Wm)(Ee.D,{cols:"5"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[(0,u._)("div",ss,[(0,u.Wm)(w.t,{icon:"mdi-calendar-week",size:"large"}),as])])),_:1})])),_:1}),(0,u.Wm)(Ee.D,{cols:"7"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[s.subtask.deadline?((0,u.wg)(),(0,u.iD)("p",{key:0,class:(0,p.C_)(""+(i.tmUtils.isAfter(s.subtask.deadline)?"text-black":"text-red-darken-4"))},(0,p.zw)(i.tmUtils.formatDate(s.subtask.deadline)),3)):((0,u.wg)(),(0,u.j4)(ts.N,{key:1,text:"Deadline z Mastertasku",location:"end"},{activator:(0,u.w5)((({props:e})=>[(0,u._)("span",(0,u.dG)({class:"cursor-pointer"},e),(0,p.zw)(l.getMasterTaskDeadline(s.subtask))+"*",17)])),_:1}))])),_:1})])),_:1})])),_:1})}var ls={props:{subtask:{type:[String,Object,null],required:!0}},computed:{...(0,z.Se)("tm",["mastertasks"])},data(){return{tmUtils:O.Z}},methods:{getMasterTaskDeadline(e){if(!this.mastertasks)return"";const t=this.mastertasks.find((t=>t.id===e.master_task_id));return Le()(t).format("DD.MM.yyyy")?Le()(t.deadline).format("DD.MM.yyyy"):""}}};const ns=(0,M.Z)(ls,[["render",is]]);var os=ns;const rs={key:0,class:"px-5 py-5 border-bottom"},ds=(0,u._)("p",null,"Popis zadania",-1),us=["innerHTML"],cs={key:1,class:"px-5 py-5 border-bottom"},ms=(0,u._)("p",null,"Popis mastertasku",-1),hs=["innerHTML"];function ps(e,t,s,a,i,l){return(0,u.wg)(),(0,u.iD)(u.HY,null,[s.description?((0,u.wg)(),(0,u.iD)("div",rs,[ds,(0,u._)("section",{innerHTML:s.description,class:"description-detail px-2 py-2 w-100 rounded mt-2"},null,8,us)])):(0,u.kq)("",!0),s.mastertaskDescription?((0,u.wg)(),(0,u.iD)("div",cs,[ms,(0,u._)("section",{innerHTML:s.mastertaskDescription,class:"description-detail px-2 py-2 w-100 rounded mt-2"},null,8,hs)])):(0,u.kq)("",!0)],64)}var vs={props:{description:{type:String||null,default:()=>null},mastertaskDescription:{type:String||null,default:()=>null}}};const ks=(0,M.Z)(vs,[["render",ps]]);var fs=ks;const gs=e=>((0,u.dD)("data-v-439e5395"),e=e(),(0,u.Cn)(),e),ws=gs((()=>(0,u._)("p",{class:"mt-5"},"Prílohy",-1))),_s={class:"w-100 d-flex align-center"},ys=["onClick"],bs={key:0,class:"d-flex align-center"},Ds=["src"],Ms=gs((()=>(0,u._)("p",{class:"ml-2"},"Súbor sa sťahuje, počkajte prosím",-1)));function Ts(e,t,a,i,l,n){const o=(0,u.up)("W-loadable");return(0,u.wg)(),(0,u.iD)(u.HY,null,[ws,(0,u._)("div",_s,[(0,u.Wm)(o,{content:a.files,emptyMessage:"Žiadne prílohy neboli nahraté"},{default:(0,u.w5)((()=>[((0,u.wg)(!0),(0,u.iD)(u.HY,null,(0,u.Ko)(a.files,((e,t)=>((0,u.wg)(),(0,u.iD)("div",{key:e.id,class:(0,p.C_)(["d-flex align-center flex-wrap",[0===t?"ml-0":"ml-2"]])},[(0,u.Wm)(we.v,{class:"mt-2"},{default:(0,u.w5)((()=>[(0,u._)("p",{onClick:t=>n.downloadFile(e),class:"cursor-pointer"},(0,p.zw)(e.name),9,ys),(0,u.Wm)(w.t,{class:"mx-1",icon:"mdi-paperclip"}),(0,u._)("p",null,(0,p.zw)((e.file_size/1048576).toFixed(2))+" MB",1)])),_:2},1024),e.isLoading?((0,u.wg)(),(0,u.iD)("div",bs,[(0,u._)("img",{class:"gif-loader",src:s(14214),alt:"Loading..."},null,8,Ds),Ms])):(0,u.kq)("",!0)],2)))),128))])),_:1},8,["content"])])],64)}var Cs={props:{files:{type:Array,default:()=>[]}},data(){return{isLoading:!1}},methods:{async downloadFile(e){e.isLoading=!0;try{const t=await fetch(e.path),s=await t.blob();Ge.saveAs(s,e.name)}catch(t){this.$toast.error(t)}finally{e.isLoading=!1}}}};const $s=(0,M.Z)(Cs,[["render",Ts],["__scopeId","data-v-439e5395"]]);var js=$s,Es={emits:["close-modal","update-subtask"],components:{ZFiles:js,AMastertaskName:it,AMastertaskStatus:mt,ATaskTimeblocks:qe,ZCreatedBy:_t,ATaskAssignedEmployee:jt,ATaskPlannedTime:Ot,ATaskSpentTime:Rt,ATaskRemainingTime:es,ATaskDescription:fs,ATaskDeadline:os},props:{subtask:{type:Object,required:!0}}};const xs=(0,M.Z)(Es,[["render",Xe]]);var Ws=xs,Ss=s(15941),Vs={emits:["close","refresh"],mixins:[Re,Je,A.Z,b],components:{ZTaskReadonlyInfo:Ws,ZFilesUpload:$e,Datepicker:ge.Z,QuillEditor:Be.Bn},data(){return{tmUtils:O.Z,editMode:!1,visible:!1,subtask:null,isSaving:!1,errorUtils:V.Z,v$:(0,W.ZP)(),employeeValidations:[],preventInputFocus:!1,showDatePicker:!1,selectedNewDate:[]}},computed:{...(0,z.Se)("tm",["mastertasks","enrichedEmployees"])},validations(){return{subtask:{master_task_id:{required:S.C1},deadline:{required:S.C1},_deadline_time:{required:S.C1}}}},mounted(){this.$events.on("add-timeblock",(e=>{this.subtask?.timeblocks||(this.subtask.timeblocks=[]),this.subtask?.timesheets||(this.subtask.timesheets=[]),this.subtask?.is_finished||(this.subtask.is_finished=0),this.subtask.timeblocks.push(e)})),this.$events.on("on-subtask-edited",(e=>{e?.id==this.subtask?.id&&(this.subtask=this._enrichTask(e)),this.$forceUpdate()})),this.$events.on("on-subtask-deleted",(e=>{e?.id==this.subtask?.id&&this.closeModal()}))},methods:{async showModal({subtask:e,editMode:t=!1,mastertask:s={}}){this.isSaving=!1,this.subtask=null,this.visible=!0,this.$nextTick((()=>this.v$.$reset()));try{if(e?.id){const s=await this.$axios.get_auth_data(`v1/subtasks/${e.id}`);if(!s.deadline)return this.editMode=t||!s.id,this.subtask=this._enrichTask(s);const a=s.deadline.split(" ");s.deadline=Le()(a[0]),s._deadline_time=a[1],this.subtask=this._enrichTask(s)}else this.subtask={master_task:s,employees:[{}],_deadline_time:"17:00"},e?.deadline&&e._deadline_time&&e.employee_id&&(this.subtask.employee_id=e.employee_id,this.subtask.deadline=e.deadline,this.subtask._deadline_time=e._deadline_time),e?.master_task_id&&e?.project_code&&(this.subtask.master_task_id=e.master_task_id,this.subtask.project_code=e.project_code);this.editMode=t||!this.subtask.id}catch(a){Ss.error("ERROR",a),this.$toast.error(a)}},deleteTimeblock(e){this.subtask.timeblocks.splice(e,1)},closeModal(){this.visible=!1,this.$router.replace({name:this.$route.name})},async save(){const e=await this._validateEmployees();if(await this.v$.$validate()&&e){this.subtask.description=this.$refs["description"].getHTML(),this._mergeDeadlineTimeDate();try{if(this.isSaving=!0,this.subtask.deadline=Le()(this.subtask.deadline).format("YYYY-MM-DD HH:mm:SS"),this.subtask?.id){const e=this.subtask.timesheets.map((e=>(delete e.employee_name,e))),{subtask:t}=await this.$axios.put_auth(`v1/subtasks/${this.subtask.id}`,{...this.subtask,timesheets:e});this.$store.commit("tm/update_subtask",t),this.$events.emit("on-subtask-edited",this.subtask)}else{const{subtasks:e}=await this.$axios.post_auth(`v1/mastertasks/${this.subtask.master_task_id}/subtasks`,this.subtask);this.subtask.id=e[0].id,e.forEach((e=>{this.$store.commit("tm/update_subtask",e),this.$events.emit("on-subtask-edited",this.subtask)})),this.$events.emit("task-created"),this.$events.emit("close-both-modals")}this.closeModal()}catch(t){this.$toast.error(t)}finally{this.isSaving=!1}}},openDeleteTaskModal(e){this.$events.emit("show-delete-task-modal",{subtask:e})},showCompleteTaskModal(){this.$events.emit("show-complete-task-modal",{subtask:this.subtask}),this.subtask.deadline&&(this.subtask.deadline=O.Z.formatDateTimeForBackend(this.subtask.deadline))},filesUploaded(e){this.subtask.files=e},updateSubtask(e){Ss.log("UPDATE SUBTASK: ",e.timeblocks[0]),this.subtask=e},_mergeDeadlineTimeDate(){const e=new Date(this.subtask.deadline),t=this.subtask._deadline_time.split(":");e.setHours(parseInt(t[0])),e.setMinutes(parseInt(t[1])),this.subtask.deadline=e},_validateEmployees(){return new Promise((e=>{if(this.employeeValidations=[],this.subtask.id){if(this.subtask.employee&&this.subtask.duration)return;this.employeeValidations[0]={},this.subtask.employee_id||(this.employeeValidations[0].employee=!0),this.subtask.duration||(this.employeeValidations[0].duration=!0)}else this.subtask.employees.forEach(((e,t)=>{t==this.subtask.employees.length-1&&t>0||e.id&&e.duration||(this.employeeValidations[t]={},e.id||(this.employeeValidations[t].employee=!0),e.duration||(this.employeeValidations[t].duration=!0))}));const t=this.employeeValidations.some((e=>e.duration||e.employee));e(!t)}))},_enrichTask(e){return{...e,_created_by:this.enrichedEmployees.find((t=>t.id==e.created_by)),_employee:this.enrichedEmployees.find((t=>t.id==e.employee_id)),_master_task:this.mastertasks.find((t=>t.id==e.master_task_id))}}},watch:{"subtask.employee_id"(e,t){e&&t&&(this.subtask.timeblocks=[],this.subtask._employee=this.enrichedEmployees.find((e=>e.id==this.subtask.employee_id)))},"subtask.employees":{handler(){if(!this.subtask?.employees)return;const e=this.subtask.employees[this.subtask.employees.length-1];(e.id||e.duration)&&this.subtask.employees.push({})},deep:!0},"subtask.master_task_id"(e){e&&(this.subtask._master_task=this.mastertasks.find((e=>e.id==this.subtask.master_task_id)),this.subtask.project_code=this.subtask._master_task?.project_code||null)},editMode(){this.$nextTick((()=>{this.$refs["description"]?.setHTML(this.subtask.description||"")}))}}};const Os=(0,M.Z)(Vs,[["render",fe],["__scopeId","data-v-d5edb19e"]]);var zs=Os;const As={class:"d-flex justify-space-between align-center"};function Us(e,t,s,i,l,n){return(0,u.wg)(),(0,u.j4)(g.B,{modelValue:l.visible,"onUpdate:modelValue":t[3]||(t[3]=e=>l.visible=e),"max-width":"750",persistent:""},{default:(0,u.w5)((()=>[(0,u.Wm)(k._,null,{default:(0,u.w5)((()=>[(0,u._)("div",As,[(0,u._)("h1",null,[(0,u.Uk)("Ste si istý, že chcete zmazať "),(0,u._)("b",null,(0,p.zw)(l.blocker.name),1),(0,u.Uk)("?")]),(0,u.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>n.closeModal()),["stop"])),icon:"mdi-close",size:"large",class:"mb-15"})]),(0,u.Wm)(f.h,{class:"mt-10 d-flex justify-start align-center mobile-view"},{default:(0,u.w5)((()=>[(0,u.Wm)(v.T,{class:"button primary half",variant:"flat",onClick:t[1]||(t[1]=e=>n.deleteBlocker()),disabled:l.isDeleting},{default:(0,u.w5)((()=>[(0,u.Uk)("ÁNO")])),_:1},8,["disabled"]),(0,u.Wm)(v.T,{class:"button primary half outline",onClick:t[2]||(t[2]=(0,a.iM)((e=>n.closeModal()),["stop"]))},{default:(0,u.w5)((()=>[(0,u.Uk)("ZRUŠIŤ")])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"])}var Zs={mixins:[b],emits:["on-blocker-deleted"],data(){return{visible:!1,blocker:null,isDeleting:!1}},methods:{async showModal({blocker:e}){this.blocker=e,this.visible=!0},closeModal(){this.visible=!1},async deleteBlocker(){if(!this.isDeleting){this.isDeleting=!0;try{await this.$axios.delete_auth(`v1/blockers/${this.blocker.id}`),this.$emit("on-blocker-deleted",this.blocker),this.closeModal()}catch(e){this.$toast.error(e)}finally{this.isDeleting=!1}}}}};const Hs=(0,M.Z)(Zs,[["render",Us]]);var Fs=Hs;const Is={class:"d-flex justify-space-between align-center"};function Ps(e,t,s,i,l,n){return(0,u.wg)(),(0,u.j4)(g.B,{modelValue:l.visible,"onUpdate:modelValue":t[3]||(t[3]=e=>l.visible=e),"max-width":"750",persistent:""},{default:(0,u.w5)((()=>[(0,u.Wm)(k._,null,{default:(0,u.w5)((()=>[(0,u._)("div",Is,[(0,u._)("h1",null,[(0,u.Uk)("Ste si istý, že chcete "+(0,p.zw)(l.subtask.is_finished?"znovu otvoriť":"dokončiť")+" sub task, z mastertasku ",1),(0,u._)("b",null,(0,p.zw)(l.subtask?.master_task?.name||l.subtask.master_task),1),(0,u.Uk)("?")]),(0,u.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>n.closeModal()),["stop"])),icon:"mdi-close",size:"large"})]),(0,u.Wm)(f.h,{class:"mt-10 d-flex justify-start align-center mobile-view"},{default:(0,u.w5)((()=>[(0,u.Wm)(v.T,{class:"button primary half",variant:"flat",onClick:t[1]||(t[1]=e=>n.complete())},{default:(0,u.w5)((()=>[(0,u.Uk)("ÁNO")])),_:1}),(0,u.Wm)(v.T,{class:"button primary half outline",onClick:t[2]||(t[2]=(0,a.iM)((e=>l.visible=!1),["stop"]))},{default:(0,u.w5)((()=>[(0,u.Uk)("ZRUŠIŤ")])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"])}var Ls={mixins:[b],emits:["close","on-subtask-edited"],data(){return{visible:!1,subtask:null}},methods:{async showModal({subtask:e}){this.subtask=e,this.visible=!0},async complete(){try{const e={...this.subtask,is_finished:this.subtask.is_finished?0:1,timesheets:this.subtask.timesheets.map((e=>(delete e.employee_name,e)))},{subtask:t}=await this.$axios.put_auth(`v1/subtasks/${e.id}`,e);this.visible=!1,this.$emit("on-subtask-edited",t)}catch(e){this.$toast.error(e)}},closeModal(){this.visible=!1}}};const Ns=(0,M.Z)(Ls,[["render",Ps]]);var Ys=Ns;const qs={class:"d-flex justify-space-between align-center"};function Bs(e,t,s,i,l,n){return(0,u.wg)(),(0,u.j4)(g.B,{modelValue:l.visible,"onUpdate:modelValue":t[3]||(t[3]=e=>l.visible=e),"max-width":"750",persistent:""},{default:(0,u.w5)((()=>[(0,u.Wm)(k._,null,{default:(0,u.w5)((()=>[(0,u._)("div",qs,[(0,u._)("h1",null,[(0,u.Uk)("Ste si istý, že chcete "+(0,p.zw)(l.mastertask.is_finished?"znovu otvoriť":"dokončiť")+" ",1),(0,u._)("b",null,(0,p.zw)(l.mastertask?.name),1),(0,u.Uk)("?")]),(0,u.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>l.visible=!1),["stop"])),icon:"mdi-close",size:"large"})]),(0,u.Wm)(f.h,{class:"mt-10 d-flex justify-start align-center mobile-view"},{default:(0,u.w5)((()=>[(0,u.Wm)(v.T,{class:"button primary half",variant:"flat",onClick:t[1]||(t[1]=e=>n.complete())},{default:(0,u.w5)((()=>[(0,u.Uk)("ÁNO")])),_:1}),(0,u.Wm)(v.T,{class:"button primary half outline",onClick:t[2]||(t[2]=(0,a.iM)((e=>l.visible=!1),["stop"]))},{default:(0,u.w5)((()=>[(0,u.Uk)("ZRUŠIŤ")])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"])}var Rs={mixins:[b],emits:["close","master-task-edited"],data(){return{visible:!1,mastertask:null}},methods:{async showModal({mastertask:e}){this.mastertask=e,this.visible=!0},async complete(){try{const e={...this.mastertask,is_finished:this.mastertask.is_finished?0:1},{mastertask:t}=await this.$axios.put_auth(`v1/mastertasks/${e.id}`,e);this.visible=!1,this.$emit("master-task-edited",t),this.$events.emit("close-both-modals")}catch(e){this.$toast.error(e)}}}};const Ks=(0,M.Z)(Rs,[["render",Bs]]);var Js=Ks;const Gs={class:"d-flex justify-space-between align-center"},Xs=(0,u._)("h1",null,"Pridať odpracovaný čas",-1);function Qs(e,t,s,i,l,n){return(0,u.wg)(),(0,u.j4)(g.B,{"max-width":"750",modelValue:l.visible,"onUpdate:modelValue":t[3]||(t[3]=e=>l.visible=e),persistent:""},{default:(0,u.w5)((()=>[(0,u.Wm)(k._,null,{default:(0,u.w5)((()=>[(0,u._)("div",Gs,[Xs,(0,u.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>n.closeModal()),["stop"])),icon:"mdi-close",size:"large"})]),(0,u.Wm)(f.h,{class:"mt-10 d-flex justify-start align-center"},{default:(0,u.w5)((()=>[(0,u.Wm)(j.hw,{modelValue:l.form.hours,"onUpdate:modelValue":t[1]||(t[1]=e=>l.form.hours=e),variant:"solo","bg-color":"white",type:"number",hint:l.v$.form.hours.$errors?l.errorUtils.parseErrors(l.v$.form.hours.$errors):null,class:(0,p.C_)([{error:l.v$.form.hours.$errors.length},"mb-2"]),label:"Odpracovaný čas"},null,8,["modelValue","hint","class"])])),_:1}),(0,u.Wm)(v.T,{onClick:t[2]||(t[2]=e=>n.submit()),class:"button primary mt-5"},{default:(0,u.w5)((()=>[(0,u.Uk)("Potvrdiť")])),_:1})])),_:1})])),_:1},8,["modelValue"])}var ea={mixins:[b],emits:["close","on-subtask-edited"],data(){return{v$:(0,W.ZP)(),errorUtils:V.Z,visible:!1,subtask:null,form:{hours:null}}},validations(){return{form:{hours:{required:S.C1,numeric:S.uR,minValue:(0,S.uv)(.1)}}}},methods:{async showModal({subtask:e}){this.subtask=e,this.visible=!0,this.form.hours=null,this.$nextTick((()=>this.v$.$reset()))},async submit(){if(!await this.v$.$validate())return;this.subtask.deadline&&(this.subtask.deadline=O.Z.formatDateTimeForBackend(this.subtask.deadline)),this.subtask.timesheets.push({id:null,employee_id:this.subtask.employee_id,time:"string"==typeof this.form.hours?parseFloat(this.form.hours):this.form.hours});const e={...this.subtask,timesheets:this.subtask.timesheets.map((e=>(delete e.employee_name,e)))};try{const{subtask:t}=await this.$axios.put_auth(`v1/subtasks/${this.subtask.id}`,e);this.closeModal(),this.$events.emit("on-subtask-edited",t)}catch(t){this.$toast.error(t.message||t)}},closeModal(){this.visible=!1,this.v$.$reset()}}};const ta=(0,M.Z)(ea,[["render",Qs]]);var sa=ta;const aa={class:"d-flex justify-space-between align-center modal-header"};function ia(e,t,s,i,l,n){const o=(0,u.up)("Datepicker"),r=(0,u.up)("W-loadable");return(0,u.wg)(),(0,u.j4)(g.B,{modelValue:l.visible,"onUpdate:modelValue":t[7]||(t[7]=e=>l.visible=e),"max-width":"750","max-height":"90%",height:"700px",persistent:""},{default:(0,u.w5)((()=>[(0,u.Wm)(r,{content:l.blocker,class:"h-100"},{default:(0,u.w5)((()=>[(0,u.Wm)(k._,{height:"100%",class:"d-flex flex-column"},{default:(0,u.w5)((()=>[(0,u._)("div",aa,[(0,u._)("h1",null,(0,p.zw)(l.blocker.id?"Upraviť":"Vytvoriť")+" blocker",1),(0,u.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>n.closeModal()),["stop"])),icon:"mdi-close",size:"large"})]),(0,u.Wm)(f.h,{class:"d-flex flex-column modal-content"},{default:(0,u.w5)((()=>[(0,u.Wm)(j.hw,{onFocus:e.onInputFocus,class:(0,p.C_)(["modal-input",{error:l.v$.blocker.name.$errors.length}]),label:"Názov blockeru",hint:l.v$.blocker.name.$errors?l.errorUtils.parseErrors(l.v$.blocker.name.$errors):null,modelValue:l.blocker.name,"onUpdate:modelValue":t[1]||(t[1]=e=>l.blocker.name=e),variant:"solo"},null,8,["onFocus","class","hint","modelValue"]),(0,u.Wm)($.f,{"custom-filter":e.customFilter,"match-any":!0,clearable:"",label:"Vyhľadať zamestnanca",items:[...e.enrichedEmployees],"item-title":"_fullName","item-value":"id",variant:"solo",class:"modal-input",modelValue:l.blocker.employee_id,"onUpdate:modelValue":t[2]||(t[2]=e=>l.blocker.employee_id=e)},null,8,["custom-filter","items","modelValue"]),(0,u.Wm)(o,{class:(0,p.C_)(["modal-input mb-5",{error:l.v$.datepicker.$errors?.length}]),modelValue:l.datepicker,"onUpdate:modelValue":t[3]||(t[3]=e=>l.datepicker=e),"auto-apply":!0,format:"dd.MM.yyyy",locale:"sk",validations:l.v$.datepicker,"select-text":"Vybrať","cancel-text":"Zrušiť",placeholder:"Dátum","enable-time-picker":!1,ref:"datepicker"},null,8,["modelValue","class","validations"]),(0,u.Wm)(j.hw,{modelValue:l.starts_at_time,"onUpdate:modelValue":t[4]||(t[4]=e=>l.starts_at_time=e),type:"time",variant:"solo","bg-color":"white",hint:l.v$.starts_at_time.$errors?l.errorUtils.parseErrors(l.v$.starts_at_time.$errors):null,class:(0,p.C_)([{error:l.v$.starts_at_time.$errors.length},"mb-1 modal-input"]),label:"Začiatok"},null,8,["modelValue","hint","class"]),(0,u.Wm)(j.hw,{modelValue:l.ends_at_time,"onUpdate:modelValue":t[5]||(t[5]=e=>l.ends_at_time=e),type:"time",variant:"solo","bg-color":"white",hint:l.v$.ends_at_time.$errors?l.errorUtils.parseErrors(l.v$.ends_at_time.$errors):null,class:(0,p.C_)([{error:l.v$.ends_at_time.$errors.length},"modal-input"]),label:"Koniec"},null,8,["modelValue","hint","class"])])),_:1}),(0,u.Wm)(v.T,{class:"button primary",onClick:t[6]||(t[6]=e=>n.save())},{default:(0,u.w5)((()=>[(0,u.Uk)((0,p.zw)(l.blocker.id?"UPRAVIŤ":"VYTVORIŤ"),1)])),_:1})])),_:1})])),_:1},8,["content"])])),_:1},8,["modelValue"])}var la={mixins:[Re,A.Z,b],emits:["close"],components:{Datepicker:ge.Z},data(){return{visible:!1,v$:(0,W.ZP)(),errorUtils:V.Z,blocker:null,datepicker:null,starts_at_time:null,ends_at_time:null,employee:null}},computed:{...(0,z.Se)("tm",["enrichedEmployees"]),...(0,z.Se)("auth",["user"])},validations(){return{blocker:{name:{required:S.C1},start:{required:S.C1},end:{required:S.C1}},starts_at_time:{required:S.C1},ends_at_time:{required:S.C1},datepicker:{required:S.C1}}},methods:{async showModal({blocker:e}){this.visible=!0,this.blocker=null,this.datepicker=null,this.starts_at_time=null,this.ends_at_time=null,this.$nextTick((()=>this.v$.$reset()));try{e?.id?(e=await this.$axios.get_auth_data(`v1/blockers/${e.id}`),this.starts_at_time=Le()(e.start).format("HH:mm"),this.ends_at_time=Le()(e.end).format("HH:mm"),this.datepicker=new Date(e.start),e.employee_id=e.employee.id,this.blocker=e):(this.blocker={start:null,employee_id:this.user.id},e.starts_at_time&&e.datepicker&&e.employee_id&&(this.datepicker=e.datepicker,this.starts_at_time=e.starts_at_time,this.blocker.employee_id=e.employee_id))}catch(t){this.$toast.error(t)}},async save(){if(await this.v$.$validate())try{if(this.blocker.id){const{blocker:e}=await this.$axios.put_auth(`v1/blockers/${this.blocker.id}`,this.blocker);this.blocker=e}else{const{blocker:e}=await this.$axios.post_auth("v1/blockers",this.blocker);this.blocker=e}this.$events.emit("on-blocker-edited",this.blocker),this.$events.emit("blocker-created"),this.closeModal()}catch(e){this.$toast.error(e)}},closeModal(){this.$refs["datepicker"].clearValue(),this.visible=!1,this.$emit("close",this.blocker)},onEmployeeSelected({key:e}){this.blocker.employee=this.enrichedEmployees.find((t=>t.id==e))},_syncDatesTimes(){if(!this.starts_at_time||!this.ends_at_time||!this.datepicker)return;const e=this.starts_at_time.split(":"),t=this.ends_at_time.split(":");this.blocker.start=Le()(this.datepicker).set({hours:parseInt(e[0]),minutes:parseInt(e[1])}).format("YYYY-MM-DD HH:mm"),this.blocker.end=Le()(this.datepicker).set({hours:parseInt(t[0]),minutes:parseInt(t[1])}).format("YYYY-MM-DD HH:mm")}},watch:{ends_at_time(){this._syncDatesTimes()},starts_at_time(){this._syncDatesTimes()},datepicker(){this._syncDatesTimes()}}};const na=(0,M.Z)(la,[["render",ia]]);var oa=na;const ra={class:"d-flex justify-space-between align-center"};function da(e,t,s,i,l,n){return(0,u.wg)(),(0,u.j4)(g.B,{modelValue:l.visible,"onUpdate:modelValue":t[3]||(t[3]=e=>l.visible=e),"max-width":"750",persistent:""},{default:(0,u.w5)((()=>[(0,u.Wm)(k._,null,{default:(0,u.w5)((()=>[(0,u._)("div",ra,[(0,u._)("h1",null,[(0,u.Uk)("Ste si istý, že chcete zmazať "),(0,u._)("b",null,(0,p.zw)(l.mastertask.name),1),(0,u.Uk)("?")]),(0,u.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>n.closeModal()),["stop"])),icon:"mdi-close",size:"large",class:"mb-15"})]),(0,u.Wm)(f.h,{class:"mt-10 d-flex justify-start align-center mobile-view"},{default:(0,u.w5)((()=>[(0,u.Wm)(v.T,{class:"button primary half",variant:"flat",onClick:t[1]||(t[1]=e=>n.deleteMasterTask()),disabled:l.isDeleting},{default:(0,u.w5)((()=>[(0,u.Uk)("ÁNO")])),_:1},8,["disabled"]),(0,u.Wm)(v.T,{class:"button primary half outline",onClick:t[2]||(t[2]=(0,a.iM)((e=>n.closeModal()),["stop"]))},{default:(0,u.w5)((()=>[(0,u.Uk)("ZRUŠIŤ")])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"])}var ua={mixins:[b],emits:["on-mastertask-deleted"],data(){return{visible:!1,mastertask:null,isDeleting:!1}},methods:{async showModal({mastertask:e}){this.mastertask=e,this.visible=!0},closeModal(){this.visible=!1},async deleteMasterTask(){if(!this.isDeleting){this.isDeleting=!0;try{await this.$axios.delete_auth(`v1/mastertasks/${this.mastertask.id}`),this.$emit("on-mastertask-deleted",this.mastertask),this.closeModal()}catch(e){this.$toast.error(e)}finally{this.isDeleting=!1}}}}};const ca=(0,M.Z)(ua,[["render",da]]);var ma=ca,ha=s(10240);const pa={class:"d-flex justify-space-between align-center modal-header"},va={class:"splitted-inputs"},ka={class:"employee-select-avatar d-flex justify-center align-center"},fa={class:"employee-select-avatar d-flex justify-center align-center"},ga={class:"d-flex justify-space-between align-center"},wa={class:"d-flex justify-space-between align-center modal-header border-bottom pb-4"},_a={class:"d-flex justify-start"},ya=["src"],ba=["src"],Da={class:"w-100"},Ma={class:"d-flex justify-start align-center mt-8"},Ta={class:"d-flex align-center"};function Ca(e,t,i,l,n,o){const r=(0,u.up)("Datepicker"),d=(0,u.up)("QuillEditor"),c=(0,u.up)("Z-files-upload"),m=(0,u.up)("A-mastertask-description"),h=(0,u.up)("A-tasks-table"),_=(0,u.up)("W-loadable");return(0,u.wg)(),(0,u.j4)(g.B,{modelValue:n.visible,"onUpdate:modelValue":t[16]||(t[16]=e=>n.visible=e),"max-width":"750","max-height":"90%",height:"700px",persistent:""},{default:(0,u.w5)((()=>[(0,u.Wm)(_,{content:n.mastertask,class:"h-100"},{default:(0,u.w5)((()=>[n.editMode?((0,u.wg)(),(0,u.j4)(k._,{key:0,height:"100%",class:"d-flex flex-column scrolling"},{default:(0,u.w5)((()=>[(0,u._)("div",pa,[(0,u._)("h1",null,(0,p.zw)(n.mastertask?.id?"Upraviť master task":"Vytvoriť master task"),1),(0,u.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>o.closeModal()),["stop"])),icon:"mdi-close",size:"large"})]),(0,u.Wm)(f.h,{class:"d-flex flex-column modal-content"},{default:(0,u.w5)((()=>[(0,u.Wm)($.f,{"custom-filter":e.customFilter,"match-any":!0,modelValue:n.mastertask.project_id,"onUpdate:modelValue":t[1]||(t[1]=e=>n.mastertask.project_id=e),label:e.$t("Project code"),class:(0,p.C_)([{error:n.v$.mastertask.project_id.$errors.length},"modal-input"]),items:e.projectsOptions,"item-title":"code","item-value":"id",variant:"solo",clearable:"","onUpdate:search":t[2]||(t[2]=e=>n.projectCodeSearch=e)},null,8,["custom-filter","modelValue","label","class","items"]),(0,u.Wm)(j.hw,{modelValue:n.mastertask.name,"onUpdate:modelValue":t[3]||(t[3]=e=>n.mastertask.name=e),onFocus:e.onInputFocus,class:(0,p.C_)(["modal-input",{error:n.v$.mastertask.name.$errors.length}]),label:"Názov mastertasku",variant:"solo",hint:n.v$.mastertask.name.$errors?n.errorUtils.parseErrors(n.v$.mastertask.name.$errors):null},null,8,["modelValue","onFocus","class","hint"]),(0,u._)("div",va,[(0,u.Wm)(r,{modelValue:n.mastertask.deadline,"onUpdate:modelValue":t[4]||(t[4]=e=>n.mastertask.deadline=e),"auto-apply":!0,onFocus:e.onDateFocus,"min-date":new Date,class:(0,p.C_)(["modal-input left",{error:n.v$.mastertask.deadline.$errors?.length}]),format:"dd.MM.yyyy",locale:"sk","select-text":"Vybrať","cancel-text":"Zrušiť",placeholder:"Dátum",validations:n.v$.mastertask.deadline},null,8,["modelValue","onFocus","min-date","class","validations"]),(0,u.Wm)(j.hw,{class:(0,p.C_)(["modal-input right",{error:n.v$.mastertask._deadline_time.$errors.length}]),variant:"solo",modelValue:n.mastertask._deadline_time,"onUpdate:modelValue":t[5]||(t[5]=e=>n.mastertask._deadline_time=e),label:"Čas","append-inner-icon":"mdi-clock-outline",type:"time",onFocus:e.onInputFocus,hint:n.v$.mastertask._deadline_time.$errors?n.errorUtils.parseErrors(n.v$.mastertask._deadline_time.$errors):null},null,8,["modelValue","onFocus","class","hint"])]),(0,u.Wm)(j.hw,{modelValue:n.mastertask.duration,"onUpdate:modelValue":t[6]||(t[6]=e=>n.mastertask.duration=e),onFocus:e.onInputFocus,class:"modal-input",variant:"solo",type:"number",label:`${n.mastertask.duration} h`,disabled:!0},null,8,["modelValue","onFocus","label"]),(0,u.Wm)(ha.r,{modelValue:n.mastertask.team_id,"onUpdate:modelValue":t[7]||(t[7]=e=>n.mastertask.team_id=e),onFocus:e.onInputFocus,class:(0,p.C_)(["modal-input border-select",{error:n.v$.mastertask.employees.$errors.length}]),label:"Tím",variant:"solo",items:e.teams,"item-value":"id","item-title":"name",disabled:n.mastertask.id},null,8,["modelValue","onFocus","class","items","disabled"]),n.mastertask.id?((0,u.wg)(!0),(0,u.iD)(u.HY,{key:1},(0,u.Ko)(n.mastertask._allEmployees,(e=>((0,u.wg)(),(0,u.j4)(j.hw,{key:e.id,class:"modal-input",label:`${e.name} ${e.surname}`,variant:"solo",placeholder:"h",modelValue:e.duration,"onUpdate:modelValue":t=>e.duration=t,type:"number",disabled:!0},{default:(0,u.w5)((()=>[(0,u._)("p",fa,(0,p.zw)(e?.name.charAt(0)+e?.surname.charAt(0)),1),(0,u.Wm)(w.t,{onClick:(0,a.iM)((t=>o.removeEmployee(e)),["stop"]),class:"remove-input",icon:"mdi-close",size:"small"},null,8,["onClick"])])),_:2},1032,["label","modelValue","onUpdate:modelValue"])))),128)):((0,u.wg)(!0),(0,u.iD)(u.HY,{key:0},(0,u.Ko)(n.mastertask.employees,((t,s)=>((0,u.wg)(),(0,u.j4)(j.hw,{key:t.id,onFocus:e.onInputFocus,class:(0,p.C_)(["modal-input",{error:t.invalid}]),label:`${t.name} ${t.surname}`,variant:"solo",placeholder:"h",modelValue:n.mastertask.employees[s].duration,"onUpdate:modelValue":e=>n.mastertask.employees[s].duration=e,type:"number",min:"1",onInput:e.onEmployeeDurationChanged},{default:(0,u.w5)((()=>[(0,u._)("p",ka,(0,p.zw)(t?.name.charAt(0)+t?.surname.charAt(0)),1),(0,u.Wm)(w.t,{onClick:(0,a.iM)((e=>o.removeEmployee(t)),["stop"]),class:"remove-input",icon:"mdi-close",size:"small"},null,8,["onClick"])])),_:2},1032,["onFocus","class","label","modelValue","onUpdate:modelValue","onInput"])))),128)),n.showAddEmployeeInput?((0,u.wg)(),(0,u.j4)($.f,{key:2,"custom-filter":e.customFilter,"match-any":!0,label:e.$t("Search for employee"),class:(0,p.C_)([{error:n.v$.mastertask.project_id.$errors.length},"modal-input"]),items:e.employeesOptions,"item-title":"_fullName","item-value":"id",variant:"solo",clearable:"","onUpdate:modelValue":e.onEmployeeSelected},null,8,["custom-filter","label","class","items","onUpdate:modelValue"])):(0,u.kq)("",!0),(0,u.Wm)(v.T,{disabled:n.mastertask.id,class:(0,p.C_)(["w-100 mb-5 button secondary",{error:n.v$.mastertask.project_id.$errors.length}]),onClick:t[8]||(t[8]=e=>n.showAddEmployeeInput=!0)},{default:(0,u.w5)((()=>[(0,u.Wm)(w.t,{class:"mx-1",icon:"mdi-plus"}),(0,u.Uk)("Pridať zamestnanca ")])),_:1},8,["disabled","class"]),(0,u._)("div",{class:(0,p.C_)(["w-100 modal-input",{error:n.v$.mastertask.description.$errors.length}])},[(0,u.Wm)(d,{ref:"description",modelValue:n.mastertask.description,"onUpdate:modelValue":t[9]||(t[9]=e=>n.mastertask.description=e),placeholder:"Popis",theme:"snow",class:"rich-text-editor",onKeyup:o.onQuillEditorInput},null,8,["modelValue","onKeyup"])],2),(0,u.Wm)(c,{class:"mt-15 files",files:n.mastertask.files,onFilesUploaded:o.filesUploaded,"is-saving":n.isSaving},null,8,["files","onFilesUploaded","is-saving"])])),_:1}),n.isSaving?((0,u.wg)(),(0,u.j4)(v.T,{key:1,class:"button primary disabled",disabled:""},{default:(0,u.w5)((()=>[(0,u.Uk)((0,p.zw)(e.$t("Ukladám...")),1)])),_:1})):((0,u.wg)(),(0,u.j4)(v.T,{key:0,class:"button primary",onClick:t[10]||(t[10]=e=>o.save())},{default:(0,u.w5)((()=>[(0,u.Uk)((0,p.zw)(n.mastertask.id?"ULOŽIŤ":"VYTVORIŤ"),1)])),_:1}))])),_:1})):((0,u.wg)(),(0,u.j4)(k._,{key:1,height:"100%",class:"d-flex flex-column scrolling"},{default:(0,u.w5)((()=>[(0,u._)("div",ga,[(0,u._)("p",null,(0,p.zw)(n.mastertask.project_code),1),(0,u.Wm)(w.t,{onClick:t[11]||(t[11]=(0,a.iM)((e=>o.closeModal()),["stop"])),icon:"mdi-close",size:"large",class:"pb-5"})]),(0,u._)("div",wa,[(0,u._)("h1",null,(0,p.zw)(n.mastertask.name),1),(0,u._)("div",_a,[n.mastertask.is_finished?(0,u.kq)("",!0):((0,u.wg)(),(0,u.iD)("img",{key:0,class:"icon",src:s(60666),alt:"pencil-icon",onClick:t[12]||(t[12]=(0,a.iM)((e=>n.editMode=!n.editMode),["stop"]))},null,8,ya)),(0,u._)("img",{class:"icon trash",src:s(27484),alt:"trash-icon",onClick:t[13]||(t[13]=(0,a.iM)((e=>o.openDeleteMasterTaskModal(n.mastertask)),["stop"]))},null,8,ba)])]),(0,u.Wm)(f.h,{class:"d-flex flex-column modal-content"},{default:(0,u.w5)((()=>[(0,u._)("div",Da,[(0,u.Wm)(m,{mastertask:n.mastertask},null,8,["mastertask"]),(0,u._)("div",Ma,[(0,u.Wm)(v.T,{class:"button primary",onClick:t[14]||(t[14]=e=>o.toggleIsFinished(n.mastertask))},{default:(0,u.w5)((()=>[(0,u.Uk)((0,p.zw)(n.mastertask.is_finished?"Otvoriť mastertask":"Ukončiť mastertask"),1)])),_:1})]),(0,u.Wm)(h,{subtasks:n.mastertask.subtasks},null,8,["subtasks"]),(0,u._)("div",Ta,[(0,u.Wm)(v.T,{class:"subtask-btn w-100",onClick:t[15]||(t[15]=e=>o.addTask())},{default:(0,u.w5)((()=>[(0,u.Wm)(w.t,{class:"mx-1",icon:"mdi-plus"}),(0,u.Uk)("Pridať sub task")])),_:1})])])])),_:1})])),_:1}))])),_:1},8,["content"])])),_:1},8,["modelValue"])}var $a=s(4413);const ja={class:"px-5 py-5"},Ea={key:0,class:"w-25"},xa={key:1,class:"w-50"},Wa={class:"d-flex align-center"},Sa={class:"employee-selected-avatar d-flex justify-center align-center"},Va={class:"ml-2 line-clamp"},Oa={key:0,class:"text-light-green"},za={key:1},Aa={class:"task-action"},Ua={class:"d-flex justify-start"},Za=["src","onClick"],Ha=["src","onClick"],Fa=["src","onClick"],Ia=["src","onClick"];function Pa(e,t,i,l,n,o){return(0,u.wg)(),(0,u.j4)($a.Y,{class:"mt-7 mb-5"},{default:(0,u.w5)((()=>[(0,u._)("tbody",ja,[((0,u.wg)(!0),(0,u.iD)(u.HY,null,(0,u.Ko)(o.enrichedtasks,(e=>((0,u.wg)(),(0,u.iD)("tr",{key:e.id},[e?.title?((0,u.wg)(),(0,u.iD)("td",Ea,(0,p.zw)(e.title),1)):((0,u.wg)(),(0,u.iD)("td",xa,(0,p.zw)(e?.master_task),1)),(0,u._)("td",Wa,[(0,u._)("p",Sa,(0,p.zw)(e._employeeInitials),1),(0,u._)("p",Va,(0,p.zw)(e._employeeFullName),1)]),(0,u._)("td",null,[e.is_finished?((0,u.wg)(),(0,u.iD)("p",Oa,"Ukončený")):(0,u.kq)("",!0),e.is_finished?(0,u.kq)("",!0):((0,u.wg)(),(0,u.iD)("p",za,"Neukončený"))]),(0,u._)("td",Aa,[(0,u._)("div",Ua,[e.is_finished?((0,u.wg)(),(0,u.iD)("img",{key:0,class:"pencil-icon is-finished",src:s(53830),alt:"checkmark-icon",onClick:(0,a.iM)((t=>o.clickCompleteTask(e)),["stop"])},null,8,Za)):(0,u.kq)("",!0),e.is_finished?(0,u.kq)("",!0):((0,u.wg)(),(0,u.iD)("img",{key:1,class:"pencil-icon",src:s(53830),alt:"checkmark-icon",onClick:(0,a.iM)((t=>o.clickCompleteTask(e)),["stop"])},null,8,Ha)),(0,u._)("img",{class:"pencil-icon ml-2",src:s(34413),alt:"pencil-icon",onClick:(0,a.iM)((t=>o.openTaskModal(e)),["stop"])},null,8,Fa),(0,u._)("img",{class:"trash-icon",src:s(27484),alt:"trash-icon",onClick:(0,a.iM)((t=>o.openDeleteTaskModal(e)),["stop"])},null,8,Ia)])])])))),128))])])),_:1})}var La={props:{subtasks:{type:Array,required:!0}},computed:{...(0,z.Se)("tm",["enrichedEmployees"]),enrichedtasks(){return this.subtasks.map((e=>{const t=this.enrichedEmployees.find((t=>t.id==e.employee_id));return{...e,_employeeInitials:t._initials,_employeeFullName:t._fullName}}))}},methods:{openDeleteTaskModal(e){this.$events.emit("show-delete-task-modal",{subtask:e})},openTaskModal(e){this.$events.emit("show-subtask-modal",{subtask:e,editMode:!1})},async clickCompleteTask(e){this.$events.emit("show-complete-task-modal",{subtask:e})}}};const Na=(0,M.Z)(La,[["render",Pa],["__scopeId","data-v-6a5e57ec"]]);var Ya=Na;function qa(e,t,s,a,i,l){const n=(0,u.up)("Z-status"),o=(0,u.up)("Z-deadline"),r=(0,u.up)("Z-created-by"),d=(0,u.up)("Z-team"),c=(0,u.up)("Z-planned-time"),m=(0,u.up)("Z-remaining-time"),h=(0,u.up)("Z-spent-time"),p=(0,u.up)("Z-description"),v=(0,u.up)("Z-files");return(0,u.wg)(),(0,u.iD)(u.HY,null,[(0,u.Wm)(n,{status:s.mastertask.is_finished},null,8,["status"]),(0,u.Wm)(o,{deadline:s.mastertask.deadline},null,8,["deadline"]),(0,u.Wm)(r,{"employee-id":s.mastertask.created_by},null,8,["employee-id"]),(0,u.Wm)(d,{team:s.mastertask.team,employees:s.mastertask._allEmployees||s.mastertask.employees},null,8,["team","employees"]),(0,u.Wm)(c,{hours:s.mastertask.duration},null,8,["hours"]),(0,u.Wm)(m,{hours:s.mastertask.duration-s.mastertask.time_worked},null,8,["hours"]),(0,u.Wm)(h,{hours:s.mastertask.time_worked,"is-exceeded":s.mastertask.time_worked>s.mastertask.duration},null,8,["hours","is-exceeded"]),(0,u.Wm)(p,{description:s.mastertask.description},null,8,["description"]),(0,u.Wm)(v,{files:s.mastertask.files},null,8,["files"])],64)}const Ba={class:"d-flex align-center"},Ra=(0,u._)("p",{class:"mx-3"},"Deadline",-1);function Ka(e,t,s,a,i,l){return(0,u.wg)(),(0,u.j4)(je.o,{"no-gutters":"",class:"align-center"},{default:(0,u.w5)((()=>[(0,u.Wm)(Ee.D,{cols:"5"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[(0,u._)("div",Ba,[(0,u.Wm)(w.t,{icon:"mdi-calendar-week",size:"large"}),Ra])])),_:1})])),_:1}),(0,u.Wm)(Ee.D,{cols:"7"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[(0,u._)("p",{class:(0,p.C_)(""+(i.tmUtils.isAfter(s.deadline)?"text-black":"text-red-darken-4"))},(0,p.zw)(i.tmUtils.formatDateTime(s.deadline)),3)])),_:1})])),_:1})])),_:1})}var Ja={props:{deadline:{type:String,required:!0}},data(){return{tmUtils:O.Z}}};const Ga=(0,M.Z)(Ja,[["render",Ka]]);var Xa=Ga;const Qa={key:0,class:"px-5 py-5 border-bottom"},ei=(0,u._)("p",null,"Popis zadania",-1),ti=["innerHTML"],si={key:1,class:"px-5 py-5 border-bottom"},ai=(0,u._)("p",null,"Popis mastertasku",-1),ii=["innerHTML"];function li(e,t,s,a,i,l){return(0,u.wg)(),(0,u.iD)(u.HY,null,[s.description?((0,u.wg)(),(0,u.iD)("div",Qa,[ei,(0,u._)("section",{innerHTML:s.description,class:"description-detail px-2 py-2 w-100 rounded mt-2"},null,8,ti)])):(0,u.kq)("",!0),s.inheritedDescription?((0,u.wg)(),(0,u.iD)("div",si,[ai,(0,u._)("section",{innerHTML:s.inheritedDescription,class:"description-detail px-2 py-2 w-100 rounded mt-2"},null,8,ii)])):(0,u.kq)("",!0)],64)}var ni={props:{description:{type:String||null,default:()=>null},inheritedDescription:{type:String||null,default:()=>null}}};const oi=(0,M.Z)(ni,[["render",li]]);var ri=oi;const di={class:"d-flex align-center"},ui=(0,u._)("p",{class:"mx-3"},"Naplánovaný čas",-1);function ci(e,t,s,a,i,l){return(0,u.wg)(),(0,u.j4)(je.o,{"no-gutters":"",class:"align-center"},{default:(0,u.w5)((()=>[(0,u.Wm)(Ee.D,{cols:"5"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[(0,u._)("div",di,[(0,u.Wm)(w.t,{icon:"mdi-clock-time-three-outline",size:"large"}),ui])])),_:1})])),_:1}),(0,u.Wm)(Ee.D,{cols:"7"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[(0,u._)("p",null,(0,p.zw)(s.hours)+" h",1)])),_:1})])),_:1})])),_:1})}var mi={props:{hours:{type:Number,required:!0}}};const hi=(0,M.Z)(mi,[["render",ci]]);var pi=hi;const vi={class:"d-flex align-center"},ki=(0,u._)("p",{class:"mx-3"},"Zostávajúci čas",-1);function fi(e,t,s,a,i,l){return(0,u.wg)(),(0,u.j4)(je.o,{"no-gutters":"",class:"align-center border-bottom"},{default:(0,u.w5)((()=>[(0,u.Wm)(Ee.D,{cols:"5"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[(0,u._)("div",vi,[(0,u.Wm)(w.t,{icon:"mdi-clock-time-three-outline",size:"large"}),ki])])),_:1})])),_:1}),(0,u.Wm)(Ee.D,{cols:"7"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[(0,u._)("p",null,(0,p.zw)(s.hours)+" h",1)])),_:1})])),_:1})])),_:1})}var gi={props:{hours:{type:Number,required:!0}}};const wi=(0,M.Z)(gi,[["render",fi]]);var _i=wi;const yi={class:"d-flex align-center"},bi=(0,u._)("p",{class:"mx-3"},"Odpracovaný čas",-1);function Di(e,t,s,a,i,l){return(0,u.wg)(),(0,u.j4)(je.o,{"no-gutters":""},{default:(0,u.w5)((()=>[(0,u.Wm)(Ee.D,{cols:"5"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[(0,u._)("div",yi,[(0,u.Wm)(w.t,{icon:"mdi-clock-time-three-outline",size:"large"}),bi])])),_:1})])),_:1}),(0,u.Wm)(Ee.D,{cols:"7"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[(0,u._)("p",{class:(0,p.C_)(s.isExceeded?"text-red-darken-4":"text-black")},(0,p.zw)(s.hours)+" h",3)])),_:1})])),_:1})])),_:1})}var Mi={props:{hours:{type:Number,required:!0},isExceeded:{type:Boolean,required:!0}}};const Ti=(0,M.Z)(Mi,[["render",Di]]);var Ci=Ti;const $i={class:"d-flex align-center"},ji=(0,u._)("p",{class:"mx-3"},"Status",-1),Ei={key:0,class:"status-badge px-4 py-2 rounded-pill"},xi={key:1,class:"status-badge px-4 py-2 rounded-pill"};function Wi(e,t,s,a,i,l){return(0,u.wg)(),(0,u.j4)(je.o,{"no-gutters":"",class:"align-center"},{default:(0,u.w5)((()=>[(0,u.Wm)(Ee.D,{cols:"5"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[(0,u._)("div",$i,[(0,u.Wm)(w.t,{icon:"mdi-drag-vertical",size:"large"}),ji])])),_:1})])),_:1}),(0,u.Wm)(Ee.D,{cols:"7"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[1==s.status?((0,u.wg)(),(0,u.iD)("p",Ei,"Ukončený")):0==s.status?((0,u.wg)(),(0,u.iD)("p",xi,"Neukončený")):(0,u.kq)("",!0)])),_:1})])),_:1})])),_:1})}var Si={props:{status:{type:Number,required:!0}}};const Vi=(0,M.Z)(Si,[["render",Wi]]);var Oi=Vi;const zi={class:"d-flex align-center"},Ai=(0,u._)("p",{class:"mx-3"},"Tím",-1),Ui={class:"task-badge px-4 py-2 rounded-pill flex-shrink-0"},Zi={class:"employee-selected-avatar d-flex justify-center align-center"},Hi={class:"ml-2"},Fi=(0,u._)("div",{class:"mb-4"},null,-1),Ii=(0,u._)("p",{class:"task-badge px-4 py-2 rounded-pill flex-shrink-0"},"Nepriradený",-1),Pi={class:"employee-selected-avatar d-flex justify-center align-center"},Li={class:"ml-2"};function Ni(e,t,s,a,i,l){return(0,u.wg)(),(0,u.j4)(je.o,{"no-gutters":""},{default:(0,u.w5)((()=>[(0,u.Wm)(Ee.D,{cols:"5"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3"},{default:(0,u.w5)((()=>[(0,u._)("div",zi,[(0,u.Wm)(w.t,{icon:"mdi-account-multiple-outline",size:"large"}),Ai])])),_:1})])),_:1}),(0,u.Wm)(Ee.D,{cols:"7"},{default:(0,u.w5)((()=>[(0,u.Wm)(xe.C,{class:"py-3 d-flex flex-wrap flex-column"},{default:(0,u.w5)((()=>[s.team?((0,u.wg)(),(0,u.iD)(u.HY,{key:0},[(0,u._)("p",Ui,(0,p.zw)(s.team.name),1),((0,u.wg)(!0),(0,u.iD)(u.HY,null,(0,u.Ko)(l.enrichedEmployeesInTeam,(e=>((0,u.wg)(),(0,u.iD)("div",{class:"d-flex align-center flex-shrink-0 mt-2 task-badge px-4 py-2 rounded-pill",key:e.id},[(0,u._)("p",Zi,(0,p.zw)(e._initials),1),(0,u._)("p",Hi,(0,p.zw)(e._fullName),1)])))),128)),Fi],64)):(0,u.kq)("",!0),Ii,((0,u.wg)(!0),(0,u.iD)(u.HY,null,(0,u.Ko)(l.enrichedEmployeesOutsideTeam,(e=>((0,u.wg)(),(0,u.iD)("div",{class:"d-flex align-center flex-shrink-0 mt-2 task-badge px-4 py-2 rounded-pill",key:e.id},[(0,u._)("p",Pi,(0,p.zw)(e._initials),1),(0,u._)("p",Li,(0,p.zw)(e._fullName),1)])))),128))])),_:1})])),_:1})])),_:1})}var Yi={props:{team:{type:Object,required:!1},employees:{type:Array,required:!0}},computed:{enrichedEmployeesInTeam(){return this.team?.employees?O.Z.enrichEmployees(this.team.employees):[]},enrichedEmployeesOutsideTeam(){if(!this.team)return O.Z.enrichEmployees(this.employees);const e=this.employees.filter((e=>!this.team.employees.find((t=>t.id==e.id))));return O.Z.enrichEmployees(e)}}};const qi=(0,M.Z)(Yi,[["render",Ni]]);var Bi=qi,Ri={components:{ZCreatedBy:_t,ZDeadline:Xa,ZDescription:ri,ZFiles:js,ZPlannedTime:pi,ZRemainingTime:_i,ZSpentTime:Ci,ZStatus:Oi,ZTeam:Bi},props:{mastertask:{type:Object,required:!0}}};const Ki=(0,M.Z)(Ri,[["render",qa]]);var Ji=Ki,Gi=s(15941),Xi={emits:["master-task-edited","close"],mixins:[Re,Je,A.Z,b],components:{AMastertaskDescription:Ji,ATasksTable:Ya,Datepicker:ge.Z,ZFilesUpload:$e,QuillEditor:Be.Bn},data(){return{deadline:null,editMode:!1,visible:!1,errorUtils:V.Z,v$:(0,W.ZP)(),mastertask:null,isSaving:!1,showAddEmployeeInput:!1,date:null,projectCodeSearch:null}},computed:{...(0,z.Se)("tm",["teams","projects","enrichedEmployees"]),enrichedSubtasks(){return this.mastertask?.subtasks?this.mastertask.subtasks.map((e=>{const t=this.enrichedEmployees.find((t=>t.id==e.employee_id));return{...e,_initials:t?t.name.charAt(0)+t.surname.charAt(0):"?",_fullName:t?`${t.name} ${t.surname}`:""}})):null}},validations(){const e=e=>!!(e&&e.length&&e.replace(/<[^>]*>/g,"").length);return{mastertask:{employees:{required:S.C1,minLength:(0,S.Ei)(1),$each:{duration:{required:S.C1}}},project_id:{required:S.C1},name:{required:S.C1},description:{quillEditorRequired:e},deadline:{required:S.C1},_deadline_time:{required:S.C1}}}},mounted(){this.$events.on("close-both-modals",this.closeBothModals),this.$events.on("master-task:team-member-deleted",(({teamId:e,memberId:t})=>{this.mastertask.team_id==e&&(this.mastertask.employees=this.mastertask.employees.filter((e=>e.id!=t)))})),this.$events.on("on-mastertask-deleted",(e=>{e?.id==this.mastertask?.id&&this.closeModal()})),this.$events.on("on-subtask-deleted",(e=>{this.mastertask&&(this.mastertask.subtasks=this.mastertask.subtasks.filter((t=>t.id!=e.id)))})),this.$events.on("on-subtask-edited",(e=>{this.mastertask?.subtasks&&(this.mastertask.subtasks.find((t=>t.id==e.id))?this.mastertask.subtasks=this.mastertask.subtasks.map((t=>t.id==e.id?e:t)):this.mastertask.subtasks.push(e))}))},beforeUnmount(){this.$events.off("on-mastertask-deleted"),this.$events.off("on-subtask-deleted"),this.$events.off("on-subtask-edited"),this.$events.off("master-task:team-member-deleted"),this.$events.off("close-both-modals",this.closeBothModals)},methods:{closeBothModals(){this.$emit("close"),this.visible=!1},removeEmployee({id:e}){this.mastertask.employees=this.mastertask.employees.filter((t=>t.id!=e))},removeMemberAlert(e){const t=this.mastertask.team;this.$events.emit("show-delete-team-member-modal",{member:e,team:t})},async showModal({mastertask:e,editMode:t=!1}){this.isSaving=!1,this.editMode=null,this.visible=!0,this.mastertask=null,this.$nextTick((()=>{this.v$.$reset()}));try{if(e?.id){this.mastertask=await this.$axios.get_auth_data(`v1/mastertasks/${e.id}`);const t=this.projects.find((e=>e.code==this.mastertask.project_code));this.mastertask.project_id=t?.id||null,this.mastertask.team_id=this.mastertask.team?.id||null,this.mastertask._allEmployees=this.mastertask.subtasks.map((({employee_id:e,duration:t})=>{const s=this.enrichedEmployees.find((({id:t})=>t==e));return s.duration=t,s})),Gi.log("NEW",this.mastertask)}else this.mastertask={employees:[],duration:0,_deadline_time:"17:00"};this.editMode=t||!this.mastertask.id}catch(s){this.$toast.error(s.message||s)}},toggleIsFinished(){this.$events.emit("show-complete-master-task-modal",{mastertask:this.mastertask})},async save(){this.mastertask.id&&(this.mastertask.employees=this.mastertask.employees.map((e=>{const{duration:t}=this.mastertask.subtasks.find((({employee_id:t})=>t==e.id));return e.duration=t,e})));const e=await this.v$.$validate(),t=await this._validateEmployees();if(e&&t){this.$refs["description"]&&(this.mastertask.description=this.$refs["description"].getHTML()),this._mergeDeadlineTimeDate();try{this.isSaving=!0,this.mastertask.deadline=Le()(this.mastertask.deadline).format("YYYY-MM-DD HH:MM:SS"),this.mastertask.id?await this.$axios.put_auth_data(`v1/mastertasks/${this.mastertask.id}`,this.mastertask):await this.$axios.post_auth_data("v1/mastertasks",this.mastertask),this.$emit("master-task-edited",this.mastertask),this.closeModal()}catch(s){this.$toast.error(s)}finally{this.isSaving=!1}}},filesUploaded(e){this.mastertask.files=e},closeModal(){this.visible=!1},openDeleteMasterTaskModal(e){this.$events.emit("show-delete-master-task-modal",{mastertask:e})},addTask(){this.$events.emit("show-subtask-modal",{subtask:{master_task_id:this.mastertask.id,project_code:this.mastertask.project_code}})},onQuillEditorInput(){this.mastertask.description=this.$refs["description"].getHTML()},_mergeDeadlineTimeDate(){const e=new Date(this.mastertask.deadline),t=this.mastertask._deadline_time.split(":");e.setHours(parseInt(t[0])),e.setMinutes(parseInt(t[1])),this.mastertask.deadline=e},_validateEmployees(){let e=!0;return this.mastertask.employees=this.mastertask.employees.map((t=>(t.duration||(t.invalid=!0,e=!1),t))),e}},watch:{editMode(){this.$nextTick((()=>{if(this.$refs["description"]?.setHTML(this.mastertask.description||""),!this.mastertask?.id)return;const e=new Date(this.mastertask.deadline),t=e.getHours(),s=e.getMinutes();this.mastertask._deadline_time=`${t.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`}))}}};const Qi=(0,M.Z)(Xi,[["render",Ca],["__scopeId","data-v-5d776569"]]);var el=Qi,tl=s(41888),sl=s(89234);const al=(0,u._)("h1",{class:"text-h5"}," Chcete túto osobu odstrániť z tímu? ",-1);function il(e,t,s,a,i,l){return(0,u.wg)(),(0,u.j4)(g.B,{modelValue:i.visible,"onUpdate:modelValue":t[2]||(t[2]=e=>i.visible=e),"max-width":"500",persistent:""},{default:(0,u.w5)((()=>[(0,u.Wm)(k._,null,{default:(0,u.w5)((()=>[al,(0,u.Wm)(tl.Z,null,{default:(0,u.w5)((()=>[(0,u.Uk)((0,p.zw)(i.member.name+" "+i.member.surname)+" bude odstránený/á z teamu.",1)])),_:1}),(0,u.Wm)(f.h,null,{default:(0,u.w5)((()=>[(0,u.Wm)(v.T,{class:"button secondary",variant:"text",onClick:t[0]||(t[0]=e=>l.closeModal())},{default:(0,u.w5)((()=>[(0,u.Uk)(" Zrušiť ")])),_:1}),(0,u.Wm)(sl.C),(0,u.Wm)(v.T,{class:"button primary",variant:"text",onClick:t[1]||(t[1]=e=>l.deleteMember())},{default:(0,u.w5)((()=>[(0,u.Uk)(" Áno ")])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"])}var ll={mixins:[b],data(){return{visible:!1,member:null,team:null}},methods:{async showModal({member:e,team:t}){this.member=e,this.team=t,this.visible=!0},closeModal(){this.visible=!1},async deleteMember(){this.team.employees=[...this.team.employees].filter((e=>e.id!==this.member.id));try{if(this.team.id){const{team:e}=await this.$axios.put_auth(`v1/teams/${this.team.id}`,this.team);this.$store.commit("tm/update_team",e)}else{const{team:e}=await this.$axios.post_auth("v1/teams",this.team);this.$store.commit("tm/save_team",e)}this.$events.emit("master-task:team-member-deleted",{teamId:this.team.id,memberId:this.member.id}),this.closeModal()}catch(e){this.$toast.error(e)}},_enrichTeam(e){return e.employees=O.Z.enrichEmployees(e.employees),e}}};const nl=(0,M.Z)(ll,[["render",il]]);var ol=nl;const rl={class:"d-flex justify-space-between align-center"},dl=(0,u._)("h1",null,"Vytvoriť",-1);function ul(e,t,s,i,l,n){return(0,u.wg)(),(0,u.j4)(g.B,{modelValue:l.visible,"onUpdate:modelValue":t[3]||(t[3]=e=>l.visible=e),"max-width":"750",persistent:""},{default:(0,u.w5)((()=>[(0,u.Wm)(k._,null,{default:(0,u.w5)((()=>[(0,u._)("div",rl,[dl,(0,u.Wm)(w.t,{onClick:t[0]||(t[0]=(0,a.iM)((e=>n.closeModal()),["stop"])),icon:"mdi-close",size:"large"})]),(0,u.Wm)(f.h,{class:"mt-10 d-flex justify-start align-center mobile-view"},{default:(0,u.w5)((()=>[(0,u.Wm)(v.T,{class:"button primary half outline",onClick:t[1]||(t[1]=(0,a.iM)((e=>n.createTask()),["stop"]))},{default:(0,u.w5)((()=>[(0,u.Uk)("SUB TASK")])),_:1}),(0,u.Wm)(v.T,{class:"button primary half outline",onClick:t[2]||(t[2]=(0,a.iM)((e=>n.createBlocker()),["stop"]))},{default:(0,u.w5)((()=>[(0,u.Uk)("BLOCKER")])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue"])}var cl={emits:["update","data"],props:["data"],mixins:[b],data(){return{visible:!1,localData:null}},mounted(){this.$events.on("blocker-created",(()=>{this.closeModal()})),this.$events.on("task-created",(()=>{this.closeModal()}))},methods:{async showModal(e){this.localData=e,this.visible=!0},closeModal(){this.visible=!1},createTask(){this.$events.emit("show-subtask-modal",{subtask:{deadline:this.localData.date,_deadline_time:this.localData.time,employee_id:this.localData.employee},onTaskCreated:()=>{this.closeModal()}})},createBlocker(){this.$events.emit("show-blocker-modal",{blocker:{starts_at_time:this.localData.time,datepicker:this.localData.date,employee_id:this.localData.employee},onBlockerCreated:()=>{this.closeModal()}})}}};const ml=(0,M.Z)(cl,[["render",ul]]);var hl=ml,pl={components:{ZDeleteTeamModal:C,ZTeamModal:F,ZDeleteTaskModal:Y,ZDeleteBlockerModal:Fs,ZTaskModal:zs,ZMasterTaskModal:el,ZCompleteTaskModal:Ys,ZTaskAddTimeModal:sa,ZBlockerModal:oa,ZDeleteMasterTaskModal:ma,ZDeleteTeamMemberModal:ol,ZShowMenuModal:hl,ZCompleteMasterTaskModal:Js,ZDeleteTimeBlockModal:X},mounted(){this.$events.on("show-menu-modal",(e=>{this.$refs["z-show-menu-modal"].showModal(e)})),this.$events.on("show-delete-team-modal",(({team:e})=>{this.$refs["z-delete-team-modal"].showModal({team:e})})),this.$events.on("show-team-modal",(({team:e})=>{this.$refs["z-team-modal"].showModal({team:e})})),this.$events.on("show-delete-task-modal",(({subtask:e})=>{this.$refs["z-delete-task-modal"].showModal({subtask:e})})),this.$events.on("show-delete-timeblock-modal",(({subtask:e})=>{this.$refs["z-delete-timeblock-modal"].showModal({subtask:e})})),this.$events.on("show-delete-blocker-modal",(({blocker:e})=>{this.$refs["z-delete-blocker-modal"].showModal({blocker:e})})),this.$events.on("show-delete-master-task-modal",(({mastertask:e})=>{this.$refs["z-delete-master-task-modal"].showModal({mastertask:e})})),this.$events.on("show-delete-team-member-modal",(({member:e,team:t})=>{this.$refs["z-delete-team-member-modal"].showModal({member:e,team:t})})),this.$events.on("show-subtask-modal",(({subtask:e,editMode:t,mastertask:s})=>{if(e&&e.id){const t=e.id;this.$router.push({query:{subtask:t}})}this.$refs["z-task-modal"].showModal({subtask:e,editMode:t,mastertask:s})})),this.$events.on("show-mastertask-modal",(({mastertask:e,editMode:t})=>{if(e&&e.id){const t=e.id;this.$router.push({query:{mastertask:t}})}this.$refs["z-master-task-modal"].showModal({mastertask:e,editMode:t})})),this.$events.on("show-complete-task-modal",(({subtask:e})=>{this.$refs["z-complete-task-modal"].showModal({subtask:e})})),this.$events.on("show-complete-master-task-modal",(({mastertask:e})=>{this.$refs["z-complete-master-task-modal"].showModal({mastertask:e})})),this.$events.on("show-blocker-modal",(({blocker:e={}})=>{this.$refs["z-blocker-modal"].showModal({blocker:e})})),this.$events.on("show-task-add-time-modal",(({subtask:e})=>{this.$refs["z-task-add-time-modal"].showModal({subtask:e})})),this.$events.on("on-subtask-edited",(()=>{this.$store.dispatch("tm/reloadSubtasks")})),this.$events.on("on-mastertask-edited",(()=>{this.$store.dispatch("tm/reloadMastertasks")})),this.$events.on("on-mastertask-deleted",(()=>{this.$store.dispatch("tm/reloadMastertasks")})),this._showModalsAfterInicialization()},methods:{onTeamUpdate(e){this.$events.emit("on-team-update",e)},onTaskDeleted(e){this.$events.emit("on-subtask-deleted",e)},onBlockerDeleted(e){this.$events.emit("on-blocker-deleted",e)},onTaskEdited(e){this.$events.emit("on-subtask-edited",e)},onMasterTaskDeleted(e){this.$events.emit("on-mastertask-deleted",e)},onMasterTaskEdited(e){this.$events.emit("on-mastertask-edited",e)},_showModalsAfterInicialization(e=0){setTimeout((()=>e>50?this.$router.push({name:this.$route.name}):this.$store.getters["tm/isInitialized"]?this.$route.query["mastertask"]?this.$events.emit("show-mastertask-modal",{mastertask:{id:this.$route.query["mastertask"]},editMode:!1}):this.$route.query["subtask"]?this.$events.emit("show-subtask-modal",{subtask:{id:this.$route.query["subtask"]},editMode:!1}):void 0:this._showModalsAfterInicialization(e+1)),300)}}};const vl=(0,M.Z)(pl,[["render",h]]);var kl=vl,fl=s(22483),gl=(0,z.MT)({state:{},getters:{},mutations:{},actions:{},modules:{}});const wl=[{path:"",redirect:"/auth"},{path:"/auth/",component:()=>s.e(9983).then(s.bind(s,79983)),children:[{path:"",redirect:"/auth/login"},{path:"/auth/login",name:"Login",component:()=>s.e(702).then(s.bind(s,40702)),meta:{requiresAuth:!1}},{path:"/auth/forgot-password",name:"Forgot password",component:()=>s.e(5728).then(s.bind(s,5728)),meta:{requiresAuth:!1}},{path:"/auth/forgot-success",name:"Forgot success",component:()=>s.e(8731).then(s.bind(s,28731)),meta:{requiresAuth:!1}},{path:"/auth/reset-password",name:"Reset password",component:()=>s.e(5867).then(s.bind(s,5867)),meta:{requiresAuth:null}}]},{path:"/app",component:()=>s.e(2891).then(s.bind(s,52891)),children:[{path:"",redirect:"/app/dashboard"},{path:"/app/dashboard",redirect:"/app/dashboard/tasks",children:[{path:"/app/dashboard/tasks",name:"Dashboard - Tasks",meta:{title:"Sub Tasks",requiresAuth:!0},component:()=>Promise.all([s.e(7637),s.e(8724)]).then(s.bind(s,22650))},{path:"/app/dashboard/teams",name:"Dashboard - Teams",meta:{title:"Teams Overview",requiresAuth:!0},component:()=>Promise.all([s.e(7637),s.e(9229)]).then(s.bind(s,58311))},{path:"/app/dashboard/projects",name:"Dashboard - Projects",meta:{title:"Projects overview",requiresAuth:!0},component:()=>s.e(6811).then(s.bind(s,56811))},{path:"/app/overview/unscheduled",name:"Overview - Unscheduled tasks",meta:{title:"Unscheduled Sub Tasks",requiresAuth:!0},component:()=>s.e(4481).then(s.bind(s,24481))},{path:"/app/overview/ongoing",name:"Overview - Ongoing tasks",meta:{title:"Ongoing Sub Tasks",requiresAuth:!0},component:()=>s.e(2682).then(s.bind(s,32682))},{path:"/app/overview/teams",name:"Overview - Teams",meta:{title:"Teams",requiresAuth:!0},component:()=>s.e(7073).then(s.bind(s,97073))},{path:"/app/dashboard/user",name:"Dashboard - User",meta:{title:"Profile",requiresAuth:!0},component:()=>s.e(4060).then(s.bind(s,44060))},{path:"/app/search",name:"Search",meta:{title:"Search Results",requiresAuth:!0},component:()=>s.e(1474).then(s.bind(s,81474))}]}]},{path:"/:catchAll(.*)",name:"404",component:()=>s.e(188).then(s.bind(s,60188)),meta:{requiresAuth:null}}],_l=(0,fl.p7)({history:(0,fl.r5)("/"),routes:wl});_l.beforeEach(((e,t,s)=>{const a=gl.getters["auth/isLoggedIn"];return!0===e.meta.requiresAuth?a?s():s({name:"Login"}):!1===e.meta.requiresAuth&&a?s({name:"Dashboard - Tasks"}):s()}));var yl=_l,bl=s(34311),Dl=s(15941);bl.Z.defaults.baseURL="https://tm.jandl.sk/api/";var Ml={async get(e,t){return bl.Z.get(e,t).then((e=>e.data)).catch((e=>Promise.reject(e)))},async get_auth(e,t){return t=this._config(t),bl.Z.get(e,t).then((e=>e.data)).catch((e=>Promise.reject(e)))},async get_data(e,t){return bl.Z.get(e,t).then((e=>e.data.data)).catch((e=>Promise.reject(e.response||e)))},async get_auth_data(e,t){return t=this._config(t),bl.Z.get(e,t).then((e=>Promise.resolve(e.data.data))).catch((e=>Promise.reject(e.response||e)))},async post(e,t=null,s){return bl.Z.post(e,t,s).then((e=>e.data)).catch((e=>Promise.reject(e)))},async post_auth(e,t=null,s){return s=this._config(s),bl.Z.post(e,t,s).then((e=>e.data)).catch((e=>Promise.reject(e)))},async post_data(e,t=null,s){return bl.Z.post(e,t,s).then((e=>e.data.data)).catch((e=>Promise.reject(e.response||e)))},async post_auth_data(e,t=null,s){return s=this._config(s),bl.Z.post(e,t,s).then((e=>e.data.data)).catch((e=>Promise.reject(e.response||e)))},async delete(e,t){return bl.Z["delete"](e,t).then((e=>e.data)).catch((e=>Promise.reject(e)))},async delete_auth(e,t){return t=this._config(t),bl.Z["delete"](e,t).then((e=>e.data)).catch((e=>Promise.reject(e)))},async delete_data(e,t){return bl.Z["delete"](e,t).then((e=>e.data.data)).catch((e=>Promise.reject(e.response||e)))},async delete_auth_data(e,t){return t=this._config(t),bl.Z["delete"](e,t).then((e=>e.data.data)).catch((e=>Promise.reject(e.response||e)))},async patch(e,t=null,s){return bl.Z.patch(e,t,s).then((e=>e.data)).catch((e=>Promise.reject(e)))},async patch_auth(e,t=null,s){return s=this._config(s),bl.Z.patch(e,t,s).then((e=>e.data)).catch((e=>Promise.reject(e)))},async patch_data(e,t=null,s){return bl.Z.patch(e,t,s).then((e=>e.data.data)).catch((e=>Promise.reject(e.response||e)))},async patch_auth_data(e,t=null,s){return s=this._config(s),bl.Z.patch(e,t,s).then((e=>e.data.data)).catch((e=>Promise.reject(e.response||e)))},async put(e,t=null,s){return bl.Z.put(e,t,s).then((e=>e.data)).catch((e=>Promise.reject(e)))},async put_auth(e,t=null,s){return s=this._config(s),bl.Z.put(e,t,s).then((e=>e.data)).catch((e=>Promise.reject(e)))},async put_data(e,t=null,s){return bl.Z.put(e,t,s).then((e=>e.data.data)).catch((e=>Promise.reject(e.response||e)))},async put_auth_data(e,t=null,s){return s=this._config(s),bl.Z.put(e,t,s).then((e=>e.data.data)).catch((e=>Promise.reject(e.response||e)))},_config(e){return e&&Dl.error("NOT IMPLEMENTED"),gl.getters["auth/token"]?{headers:{Authorization:`Bearer ${gl.getters["auth/token"]}`}}:{headers:{}}}},Tl={install:(e,t)=>{t&&!0===t.disabled||(e.config.globalProperties.$axios=Ml)}},Cl=s(82482);const $l=e=>Object.entries(e).map((e=>e.map(encodeURIComponent).join("="))).join("&");function jl(e){let t=e;return t=t.replace(/\//g,"\\/"),t=t.replace(/\./g,"\\."),t=t.replace(/\([^)]+\)/g,"[^/]+"),t}var El=s(15941);class xl{constructor(){(0,Cl.Z)(this,"_mocks",{}),bl.Z.interceptors.request.use(this._redirectRequestToMock.bind(this)),this._mocks={}}mock(e){for(const t in e){let s=e[t];!1!==s&&(s={},s.name=t,s.url=t.split(" ")[1],s.reUrl||(s.reUrl=jl(s.url)),s.matchMethod||(s.matchMethod=t.split(" ")[0].toLowerCase()),this._mocks[t]=s)}}_redirectRequestToMock(e){const t=e.url.replace(/https?:\/\/[^/?]+/,"");let s;for(const a in this._mocks){const i=this._mocks[a];if(e.method==i.matchMethod&&t.match(i.reUrl)){s=i;break}}if(s){s.fname||(s.fname={VUE_APP_WAXIOS_URL:"https://tm.jandl.sk/api/",NODE_ENV:"production",BASE_URL:"/"}.VUE_APP_PLATFORM?`/mock/${{VUE_APP_WAXIOS_URL:"https://tm.jandl.sk/api/",NODE_ENV:"production",BASE_URL:"/"}.VUE_APP_PLATFORM}/${s.url}.${e.method.toUpperCase()}.json`:`/mock/${s.url}.${e.method.toUpperCase()}.json`),El.log(s.fname=`/mock/${s.url}.${e.method.toUpperCase()}.json`);const t={method:"get",url:window.location.origin+s.fname+"?___MOCK___&"+$l(e.data||{})};e={...e,...t}}return e}}var Wl={install:(e,t)=>{const s=new xl;t&&t.routes&&Object.values(t.routes).length&&!0!==t.disabled&&s.mock(t.routes)}},Sl=s(8069),Vl={install:(e,t)=>{if(t&&!0===t.disabled)return;const s=(0,Sl.Z)();e.config.globalProperties.$events=s}},Ol=s(44870),zl=s(5658),Al=s(31310),Ul=s(15941);class Zl{constructor(e){(0,Cl.Z)(this,"currentLanguage",(0,Ol.iH)()),(0,Cl.Z)(this,"availableLanguages",void 0),(0,Cl.Z)(this,"vendorI18n",void 0),(0,Cl.Z)(this,"defaultLanguage",void 0),(0,Cl.Z)(this,"languageKey",void 0),(0,Cl.Z)(this,"_missingTranslation",((e,t,s,a)=>t)),(0,Cl.Z)(this,"_postTranslation",(e=>e)),this.availableLanguages=e.languages||[],this.defaultLanguage=e.languages.find((t=>t.value==e.defaultLanguage)),this.languageKey=e.languageKey||{VUE_APP_WAXIOS_URL:"https://tm.jandl.sk/api/",NODE_ENV:"production",BASE_URL:"/"}.VUE_APP_PLATFORM+"_language"||0,this.vendorI18n=(0,zl.o)({legacy:!0,fallbackLocale:this.defaultLanguage.value,messages:this._loadLocaleMessages(),missing:this._missingTranslation,postTranslation:this._postTranslation}),this.changeLanguage({title:"Slovenský",flag:"sk",value:"sk"}),this.initCurrentLanguage()}async initCurrentLanguage(){const{value:e}=await Al.u.get({key:this.languageKey});if(e)this.currentLanguage.value=JSON.parse(e);else if(this.defaultLanguage)this.currentLanguage.value=this.defaultLanguage;else{if(!this.availableLanguages[0])return Ul.error("[w18n] Could not init current language");this.currentLanguage.value=this.availableLanguages[0]}const t={};this.availableLanguages.forEach((e=>{t[e.value]=e.title})),this.changeLanguage(this.currentLanguage.value),this._addAxiosHeaders()}changeLanguage(e){this.currentLanguage.value=e,this._addAxiosHeaders(),Al.u.set({key:this.languageKey,value:JSON.stringify(e)}),this.vendorI18n.global.locale=e.value}_addAxiosHeaders(){bl.Z.interceptors.request.use((e=>(this.currentLanguage.value&&this.currentLanguage.value.value&&(e.headers["Accept-Language"]=this.currentLanguage.value.value),e))),bl.Z.interceptors.response.use((e=>e),(e=>(e.response&&bl.Z.post("https://logger.wezeo.dev/cms/api/data/new",{data:JSON.stringify(e)}),Promise.reject(e.response))))}_loadLocaleMessages(e="@/locales"){let t;try{t=s(8973)}catch(i){return Ul.warn("[@wezeo/i18n] Could not initialize i18n. Missing folder /src/locales."),{}}const a={};return t.keys().forEach((e=>{const s=e.match(/([A-Za-z0-9-_]+)\./i);if(s&&s.length>1){const i=s[1];a[i]=t(e)}})),a}}var Hl=s(15941),Fl={install:(e,t)=>{if(t&&!0===t.disabled)return;if(!t||!t.languages||!t.defaultLanguage)return Hl.warn("[@wezeo/i18n] Could not initialize i18n. Missing configuration options.");e.config.globalProperties.$events||e.use(Vl);const s=new Zl(t);e.use(s.vendorI18n),e.config.globalProperties.$w18n=s}},Il={install:(e,t)=>{t&&!0===t.disabled||(e.component("ion-content",i.W2),e.component("ion-page",i._i),e.component("ion-label",i.Q$),e.component("ion-back-button",i.oU),e.component("ion-checkbox",i.nz),e.component("ion-text",i.yW),e.component("ion-button",i.YG),e.component("ion-item",i.Ie),e.component("ion-item-group",i.Ub),e.component("ion-item-sliding",i.td),e.component("ion-item-option",i.u8),e.component("ion-item-options",i.IK),e.component("ion-toolbar",i.sr),e.component("ion-header",i.Gu),e.component("ion-footer",i.fr),e.component("ion-slides",i.Hr),e.component("ion-slide",i.A$),e.component("ion-spinner",i.PQ),e.component("ion-row",i.Nd),e.component("ion-col",i.wI),e.component("ion-grid",i.jY),e.component("ion-input",i.pK),e.component("ion-buttons",i.Sm),e.component("ion-icon",i.gu),e.component("ion-img",i.Xz),e.component("ion-list",i.q_),e.component("ion-skeleton-text",i.CK),e.component("ion-title",i.wd),e.component("ion-menu",i.z0),e.component("ion-split-pane",i.jI),e.component("ion-menu-button",i.fG),e.component("ion-router-outlet",i.jP),e.component("ion-segment",i.cJ),e.component("ion-segment-button",i.GO),e.component("ion-virtual-scroll",i.aJ),e.component("ion-textarea",i.g2),e.component("ion-searchbar",i.VI),e.component("ion-refresher-content",i.Wo),e.component("ion-refresher",i.nJ),e.component("ion-infinite-scroll-content",i.MB),e.component("ion-infinite-scroll",i.ju),e.component("ion-avatar",i.BJ),e.component("ion-thumbnail",i.Bs),e.component("ion-modal",i.ki),e.component("ion-radio-group",i.se),e.component("ion-radio",i.B7),e.component("ion-note",i.uN),e.component("ion-card",i.PM),e.component("ion-card-content",i.FN),e.component("ion-tab-bar",i.yq),e.component("ion-tab-button",i.ZU),e.component("ion-menu-toggle",i.zc),e.component("ion-fab",i.IJ),e.component("ion-fab-button",i.W4),e.component("ion-fab-list",i.zq),e.component("ion-reorder-group",i.oz),e.component("ion-reorder",i.Nh),e.component("ion-select",i.t9),e.component("ion-select-option",i.n0),e.component("ion-toggle",i.ho),e.component("ion-badge",i.yp),e.component("ion-chip",i.hM),e.component("ion-tabs",i.UN))}};async function Pl(e){return"Unauthenticated."==e?.response?.data?.message?gl.dispatch("auth/logout"):Promise.reject(e)}bl.Z.interceptors.response.use((e=>e),(e=>Pl(e)));var Ll=s(15941),Nl={namespaced:!0,state:{token:localStorage.getItem("wzo_vue_user_token")||"",user:JSON.parse(localStorage.getItem("wzo_vue_user_user")||"{}")},mutations:{auth_success(e,t){t.token&&(e.token=t.token,localStorage.setItem("wzo_vue_user_token",t.token)),t.user&&(e.user=t.user,localStorage.setItem("wzo_vue_user_user",JSON.stringify(t.user)))},auth_error(e){e.token="",localStorage.removeItem("wzo_vue_user_token"),localStorage.removeItem("wzo_vue_user_user")},logout(e){e.token="",e.user=null,localStorage.removeItem("wzo_vue_user_token"),localStorage.removeItem("wzo_vue_user_user"),window.open(location.origin,"_self")}},actions:{login({commit:e},t){return new Promise(((s,a)=>{Ml.post("v1/tokens/create",{data:t}).then((t=>{const a=t.token,i=t.user;e("auth_success",{token:a,user:i}),s(t)})).catch((t=>{e("auth_error"),a(t)}))}))},signup({commit:e},t){return new Promise(((s,a)=>{e("auth_request"),Ml.post_data("v1/auth/signup",t).then((t=>{const a=t.token,i=t.user;e("auth_success",{token:a,user:i}),s(t)})).catch((t=>{e("auth_error"),a(t)}))}))},logout({commit:e}){return new Promise((t=>{Ml.post_auth_data("v1/auth/invalidate").finally((()=>{e("logout"),t(null)}))}))},forgotPassword({commit:e},t){return new Promise(((e,s)=>{Ml.post("v1/users/forgot",{data:t}).then((t=>e(t))).catch((e=>s(e)))}))},resetPassword({commit:e},t){return e("auth_success",{token:t.token}),new Promise(((s,a)=>{Ml.post_auth_data("v1/users/reset",{data:t}).then((t=>{e("logout"),s(t)})).catch((e=>a(e)))}))},async refreshToken({commit:e}){try{const t=await Ml.post_auth_data("v1/auth/refresh"),s=t.token,a=t.user;return e("auth_success",{token:s,user:a}),s}catch(t){e("auth_error"),Ll.error(t)}},async userInfo({commit:e}){return new Promise(((t,s)=>{Ml.get_auth_data("v1/auth/info").then((s=>{const a=s.user;e("auth_success",{user:a}),t(a)})).catch((e=>{s(e)}))}))},updateUserInfo({commit:e},t){return new Promise(((s,a)=>{Ml.put_auth(`v1/users/${t.id}`,{data:t}).then((t=>{const a=t.user;e("auth_success",{user:a}),s(a)})).catch((e=>{a(e)}))}))}},getters:{isLoggedIn:e=>!!e.token,user:e=>e.user,token:e=>e.token&&void 0!=e.token?e.token:null}},Yl=s(15941),ql={install:(e,t)=>{if(!t||1!=t.disabled)return e.config.globalProperties.$store?void e.config.globalProperties.$store.registerModule("auth",Nl):Yl.warn("[w/auth] Could not initialize. App does not have vuex store added.")}},Bl=s(46215),Rl=s.n(Bl),Kl={install:(e,t)=>{t&&!0===t.disabled||e.use(Rl())}};const Jl={ref:"loadingContainer"},Gl={key:0},Xl={key:1},Ql={key:2};function en(e,t,s,a,i,l){return(0,u.wg)(),(0,u.iD)("div",Jl,[s.content?s.content.error?((0,u.wg)(),(0,u.iD)("div",Xl,(0,p.zw)(s.content.error),1)):"array"==typeof s.content&&!e.array.length||"object"==typeof s.content&&!Object.values(s.content).length?((0,u.wg)(),(0,u.iD)("div",Ql,(0,p.zw)(s.emptyMessage),1)):(0,u.WI)(e.$slots,"default",{key:3},void 0,!0):((0,u.wg)(),(0,u.iD)("div",Gl))],512)}var tn={props:{content:{type:[Object,Array,Boolean],default:()=>null},emptyMessage:{type:String,default:"No items"}},data(){return{loader:null}},async mounted(){this.content||await this._startLoading()},methods:{async _startLoading(){},_stopLoading(){}},watch:{}};const sn=(0,M.Z)(tn,[["render",en],["__scopeId","data-v-a2444234"]]);var an=sn,ln={install:(e,t)=>{t&&!0===t.disabled||e.component("W-loadable",an)}},nn={install:(e,t={})=>{Vl.install(e,t.events),Tl.install(e,t.axios),Fl.install(e,t.i18n),Wl.install(e,t.moxios),Il.install(e,t.ionic),ql.install(e,t.auth),Kl.install(e,t.toast),ln.install(e,t.loadable)}},on={parseAndTranslate(e){const t=this._parseToArrayOfStrings(e);return t.join(", ")},_parseToArrayOfStrings(e){return e?.data?.message?[ir(e.data.message)]:"string"==typeof e?[ir(e)]:e?.response?.data?Object.values(e?.response?.data):e&&e.error&&"string"==typeof e.error?[ir(e.error)]:e&&e.error&&"object"==typeof e.error?Object.values(ir(e.error)):e.data&&e.data.error&&"string"==typeof e.data.error?[ir(e.data.error)]:e&&e.data&&e.data.error&&"object"==typeof e.data.error?Object.values(e.data.error).map((e=>ir(e[0])+" ")):e.statusText?[ir(e.statusText)]:[e]}},rn=s(15941);bl.Z.defaults.baseURL="https://tm.jandl.sk/api/";var dn={async get(e,t){return bl.Z.get(e,t).then((e=>e.data)).catch((e=>Promise.reject(on.parseAndTranslate(e))))},async get_auth(e,t){return t=this._config(t),bl.Z.get(e,t).then((e=>e.data)).catch((e=>Promise.reject(on.parseAndTranslate(e))))},async get_data(e,t){return bl.Z.get(e,t).then((e=>e.data.data)).catch((e=>Promise.reject(on.parseAndTranslate(e.response||e))))},async get_auth_data(e,t){return t=this._config(t),bl.Z.get(e,t).then((e=>Promise.resolve(e.data.data))).catch((e=>Promise.reject(on.parseAndTranslate(e.response||e))))},async post(e,t=null,s){return bl.Z.post(e,this._objectToFormData(t),s).then((e=>e.data)).catch((e=>Promise.reject(on.parseAndTranslate(e))))},async post_auth(e,t=null,s){return s=this._config(s),bl.Z.post(e,this._objectToFormData(t),s).then((e=>e.data)).catch((e=>Promise.reject(on.parseAndTranslate(e))))},async post_data(e,t=null,s){return bl.Z.post(e,this._objectToFormData(t),s).then((e=>e.data.data)).catch((e=>Promise.reject(on.parseAndTranslate(e.response||e))))},async post_auth_data(e,t=null,s){return s=this._config(s),bl.Z.post(e,this._objectToFormData(t),s).then((e=>e.data.data)).catch((e=>Promise.reject(on.parseAndTranslate(e.response||e))))},async delete(e,t){return bl.Z["delete"](e,t).then((e=>e.data)).catch((e=>Promise.reject(on.parseAndTranslate(e))))},async delete_auth(e,t){return t=this._config(t),bl.Z["delete"](e,t).then((e=>e.data)).catch((e=>Promise.reject(on.parseAndTranslate(e))))},async delete_data(e,t){return bl.Z["delete"](e,t).then((e=>e.data.data)).catch((e=>Promise.reject(on.parseAndTranslate(e.response||e))))},async delete_auth_data(e,t){return t=this._config(t),bl.Z["delete"](e,t).then((e=>e.data.data)).catch((e=>Promise.reject(on.parseAndTranslate(e.response||e))))},async patch(e,t=null,s){return bl.Z.patch(e,this._objectToFormData(t),s).then((e=>e.data)).catch((e=>Promise.reject(on.parseAndTranslate(e))))},async patch_auth(e,t=null,s){return s=this._config(s),bl.Z.patch(e,this._objectToFormData(t),s).then((e=>e.data)).catch((e=>Promise.reject(on.parseAndTranslate(e))))},async patch_data(e,t=null,s){return bl.Z.patch(e,this._objectToFormData(t),s).then((e=>e.data.data)).catch((e=>Promise.reject(on.parseAndTranslate(e.response||e))))},async patch_auth_data(e,t=null,s){return s=this._config(s),bl.Z.patch(e,this._objectToFormData(t),s).then((e=>e.data.data)).catch((e=>Promise.reject(on.parseAndTranslate(e.response||e))))},async put(e,t=null,s){return bl.Z.put(e,this._objectToFormData(t),s).then((e=>e.data)).catch((e=>Promise.reject(on.parseAndTranslate(e))))},async put_auth(e,t=null,s){return s=this._config(s),bl.Z.put(e,{data:t},s).then((e=>e.data)).catch((e=>Promise.reject(on.parseAndTranslate(e))))},async put_data(e,t=null,s){return bl.Z.put(e,this._objectToFormData(t),s).then((e=>e.data.data)).catch((e=>Promise.reject(on.parseAndTranslate(e.response||e))))},async put_auth_data(e,t=null,s){return s=this._config(s),bl.Z.put(e,{data:t},s).then((e=>e.data.data)).catch((e=>Promise.reject(on.parseAndTranslate(e.response||e))))},_config(e){return e&&rn.error("NOT IMPLEMENTED"),gl.getters["auth/token"]?{headers:{Authorization:`Bearer ${gl.getters["auth/token"]}`}}:{headers:{}}},_buildFormData(e,t,s){!t||"object"!==typeof t||t instanceof Date||t instanceof File?e.append(s,null==t?"":t):Object.keys(t).forEach((a=>this._buildFormData(e,t[a],s?`${s}[${a}]`:a)))},_objectToFormData(e){const t=new FormData;return this._buildFormData(t,{data:e}),t}},un={install:(e,t)=>{t&&!0===t.disabled||(e.config.globalProperties.$axios=dn)}},cn={namespaced:!0,state:{mastertasks:null,employees:null,teams:null,projects:null,unscheduledSubtasks:null,ongoingSubtasks:null,initialized:!1},mutations:{set_mastertasks(e,t){e.mastertasks=t},set_employees(e,t){e.employees=t},set_teams(e,t){e.teams=t},set_projects(e,t){e.projects=t},set_unscheduled_subtasks(e,t){e.unscheduledSubtasks=t},set_ongoing_subtasks(e,t){e.ongoingSubtasks=t},update_team(e,t){e.teams=e.teams.map((e=>e.id==t.id?t:e))},save_team(e,t){e.teams.push(t)},delete_team(e,t){e.teams=e.teams.filter((e=>e.id!=t.id))},update_subtask(e,t){e.unscheduledSubtasks=e.unscheduledSubtasks.map((e=>e.id==t.id?t:e)),e.ongoingSubtasks=e.ongoingSubtasks.map((e=>e.id==t.id?t:e)),e.mastertasks=e.mastertasks.map((e=>(e.subtasks=e.subtasks.map((e=>e.id==t.id?t:e)),e)))},delete_subtask(e,t){e.unscheduledSubtasks=e.unscheduledSubtasks.filter((e=>e.id!=t.id)),e.ongoingSubtasks=e.ongoingSubtasks.filter((e=>e.id!=t.id)),e.mastertasks=e.mastertasks.map((e=>(e.subtasks=e.subtasks.filter((e=>e.id!=t.id)),e)))},initialized(e){e.initialized=!0}},actions:{initialize({dispatch:e,commit:t}){return Promise.all([e("loadMastertasks"),e("loadEmployees"),e("loadTeams"),e("loadProjects"),e("loadUnscheduledSubtasks"),e("loadOngoingSubtasks")]).then((()=>t("initialized")))},reloadSubtasks({dispatch:e}){return Promise.all([e("loadMastertasks"),e("loadProjects"),e("loadUnscheduledSubtasks"),e("loadOngoingSubtasks")])},reloadMastertasks({dispatch:e}){return Promise.all([e("loadMastertasks")])},loadMastertasks({commit:e}){return new Promise(((t,s)=>{dn.get_auth("v1/mastertasks").then((({mastertasks:s})=>{e("set_mastertasks",s),t(s)})).catch((t=>{e("set_mastertasks",{error:t}),s(t)}))}))},loadEmployees({commit:e}){return new Promise(((t,s)=>{dn.get_auth_data("v1/employees").then((s=>{e("set_employees",s),t(s)})).catch((t=>{e("set_employees",{error:t}),s(t)}))}))},loadTeams({commit:e}){return new Promise(((t,s)=>{dn.get_auth_data("v1/teams").then((s=>{e("set_teams",s),t(s)})).catch((t=>{e("set_teams",{error:t}),s(t)}))}))},loadProjects({commit:e}){return new Promise(((t,s)=>{dn.get_auth_data("v1/projects").then((s=>{e("set_projects",s),t(s)})).catch((t=>{e("set_projects",{error:t}),s(t)}))}))},loadUnscheduledSubtasks({commit:e},t=gl.getters["auth/user"]?.id){return new Promise(((s,a)=>{dn.get_auth(`v1/subtasks?type=unscheduled&employee_id=${t}`).then((({subtasks:t})=>{e("set_unscheduled_subtasks",t),s(t)})).catch((t=>{e("set_unscheduled_subtasks",{error:t}),a(t)}))}))},loadOngoingSubtasks({commit:e},t=gl.getters["auth/user"]?.id){return new Promise(((s,a)=>{dn.get_auth(`v1/subtasks?type=ongoing&employee_id=${t}`).then((({subtasks:t})=>{e("set_ongoing_subtasks",t),s(t)})).catch((t=>{e("set_ongoing_subtasks",{error:t}),a(t)}))}))}},getters:{mastertasks:e=>e.mastertasks,employees:e=>e.employees,enrichedEmployees:e=>e.employees?e.employees.map((e=>({...e,_fullName:`${e.name} ${e.surname}`,_initials:e.name.charAt(0)+e.surname.charAt(0)}))).sort(((e,t)=>e.name<t.name?-1:1)):[],teams:e=>e.teams,projects:e=>e.projects,unscheduledSubtasks:e=>e.unscheduledSubtasks,ongoingSubtasks:e=>e.ongoingSubtasks,isInitialized:e=>e.initialized}},mn={install:e=>{e.config.globalProperties.$store.registerModule("tm",cn)}};const hn=["lang"],pn={key:0,class:"vuecal__flex vuecal__body",grow:"grow"},vn=["onBlur","innerHTML"],kn=["innerHTML"],fn=["innerHTML"],gn={class:"vuecal__flex",row:"row",grow:"grow"},wn={key:0,class:"vuecal__time-column"},_n=(0,u._)("span",{class:"vuecal__time-cell-line"},null,-1),yn={class:"vuecal__time-cell-label"},bn={key:1,class:"vuecal__flex vuecal__week-numbers",column:"column"},Dn=["wrap","column"],Mn=["onBlur","innerHTML"],Tn=["innerHTML"],Cn=["innerHTML"],$n=["wrap"],jn=["innerHTML"],En=["innerHTML"],xn={key:2,class:"vuecal__cell-events-count"},Wn={key:3,class:"vuecal__no-event"},Sn=["onBlur","innerHTML"],Vn=["innerHTML"],On={key:2,class:"vuecal__event-time"},zn={key:0},An={key:1,class:"days-to-end"},Un=["innerHTML"],Zn={key:0,class:"vuecal__scrollbar-check"},Hn=(0,u._)("div",null,null,-1),Fn=[Hn];function In(e,t,s,i,l,n){const o=(0,u.up)("vuecal-header"),r=(0,u.up)("all-day-bar"),d=(0,u.up)("weekdays-headings"),c=(0,u.up)("vuecal-cell");return(0,u.wg)(),(0,u.iD)("div",{class:(0,p.C_)(["vuecal__flex vuecal",n.cssClasses]),column:"column",ref:"vuecal",lang:s.locale},[(0,u.Wm)(o,{options:e.$props,"edit-events":n.editEvents,"view-props":{views:n.views,weekDaysInHeader:n.weekDaysInHeader},"week-days":n.weekDays,"has-splits":n.hasSplits,"day-splits":n.daySplits,"switch-to-narrower-view":n.switchToNarrowerView},(0,u.Nv)({_:2},[e.$slots["weekday-heading"]?{name:"weekday-heading",fn:(0,u.w5)((({heading:t,view:s})=>[(0,u.WI)(e.$slots,"weekday-heading",{heading:t,view:s})])),key:"0"}:void 0,e.$slots["split-label"]?{name:"split-label",fn:(0,u.w5)((({split:t,view:s})=>[(0,u.WI)(e.$slots,"split-label",{split:t,view:s.id})])),key:"1"}:void 0]),1032,["options","edit-events","view-props","week-days","has-splits","day-splits","switch-to-narrower-view"]),s.hideBody?(0,u.kq)("",!0):((0,u.wg)(),(0,u.iD)("div",pn,[(0,u.Wm)(a.uT,{name:`slide-fade--${l.transitionDirection}`,appear:s.transitions},{default:(0,u.w5)((()=>[((0,u.wg)(),(0,u.iD)("div",{class:"vuecal__flex",style:{"min-width":"100%"},key:!!s.transitions&&l.view.id,column:"column"},[s.showAllDayEvents&&n.hasTimeColumn&&(!n.cellOrSplitMinWidth||n.isDayView&&!s.minSplitWidth)?((0,u.wg)(),(0,u.j4)(r,(0,p.vs)((0,u.dG)({key:0},n.allDayBar)),{event:(0,u.w5)((({event:t,view:s})=>[(0,u.WI)(e.$slots,"event",{view:s,event:t},(()=>[n.editEvents.title&&t.titleEditable?((0,u.wg)(),(0,u.iD)("div",{key:0,class:"vuecal__event-title vuecal__event-title--edit",contenteditable:"contenteditable",onBlur:e=>n.onEventTitleBlur(e,t),innerHTML:t.title},null,40,vn)):t.title?((0,u.wg)(),(0,u.iD)("div",{key:1,class:"vuecal__event-title",innerHTML:t.title},null,8,kn)):(0,u.kq)("",!0),!t.content||n.hasShortEvents||n.isShortMonthView?(0,u.kq)("",!0):((0,u.wg)(),(0,u.iD)("div",{key:2,class:"vuecal__event-content",innerHTML:t.content},null,8,fn))]))])),_:3},16)):(0,u.kq)("",!0),(0,u._)("div",{class:(0,p.C_)(["vuecal__bg",{vuecal__flex:!n.hasTimeColumn}]),column:"column",ref:"vuecal_scroll"},[(0,u._)("div",gn,[n.hasTimeColumn?((0,u.wg)(),(0,u.iD)("div",wn,[s.showAllDayEvents&&n.cellOrSplitMinWidth&&(!n.isDayView||s.minSplitWidth)?((0,u.wg)(),(0,u.iD)("div",{key:0,class:"vuecal__all-day-text",style:(0,p.j5)({height:n.allDayBar.height})},[(0,u._)("span",null,(0,p.zw)(l.texts.allDay),1)],4)):(0,u.kq)("",!0),((0,u.wg)(!0),(0,u.iD)(u.HY,null,(0,u.Ko)(n.timeCells,((t,a)=>((0,u.wg)(),(0,u.iD)("div",{class:"vuecal__time-cell",key:a,style:(0,p.j5)(`height: ${s.timeCellHeight}px`)},[(0,u.WI)(e.$slots,"time-cell",{hours:t.hours,minutes:t.minutes},(()=>[_n,(0,u._)("span",yn,(0,p.zw)(t.label),1)]))],4)))),128))])):(0,u.kq)("",!0),s.showWeekNumbers&&n.isMonthView?((0,u.wg)(),(0,u.iD)("div",bn,[((0,u.wg)(),(0,u.iD)(u.HY,null,(0,u.Ko)(6,(t=>(0,u._)("div",{class:"vuecal__flex vuecal__week-number-cell",key:t,grow:"grow"},[(0,u.WI)(e.$slots,"week-number-cell",{week:n.getWeekNumber(t-1)},(()=>[(0,u.Uk)((0,p.zw)(n.getWeekNumber(t-1)),1)]))]))),64))])):(0,u.kq)("",!0),(0,u._)("div",{class:(0,p.C_)(["vuecal__flex vuecal__cells vuecal__scrollable-body",`${l.view.id}-view`]),grow:"grow",wrap:!n.cellOrSplitMinWidth||!n.isWeekView,column:!!n.cellOrSplitMinWidth},[n.cellOrSplitMinWidth&&n.isWeekView?((0,u.wg)(),(0,u.j4)(d,{key:0,"transition-direction":l.transitionDirection,"week-days":n.weekDays,"switch-to-narrower-view":n.switchToNarrowerView,style:(0,p.j5)(n.cellOrSplitMinWidth?`min-width: ${n.cellOrSplitMinWidth}px`:""),unscheduledTime:s.unscheduledTime,ref:"vuecal_weekday_heading"},(0,u.Nv)({_:2},[e.$slots["weekday-heading"]?{name:"weekday-heading",fn:(0,u.w5)((({heading:t,view:s})=>[(0,u.WI)(e.$slots,"weekday-heading",{heading:t,view:s})])),key:"0"}:void 0,e.$slots["split-label"]?{name:"split-label",fn:(0,u.w5)((({split:t})=>[(0,u.WI)(e.$slots,"split-label",{split:t,view:l.view.id})])),key:"1"}:void 0]),1032,["transition-direction","week-days","switch-to-narrower-view","style","unscheduledTime"])):n.hasSplits&&s.stickySplitLabels&&s.minSplitWidth?((0,u.wg)(),(0,u.iD)("div",{key:1,class:"vuecal__flex vuecal__split-days-headers",ref:"vuecal_splits_heading",style:(0,p.j5)(n.cellOrSplitMinWidth?`min-width: ${n.cellOrSplitMinWidth}px`:"")},[((0,u.wg)(!0),(0,u.iD)(u.HY,null,(0,u.Ko)(n.daySplits,((t,s)=>((0,u.wg)(),(0,u.iD)("div",{class:(0,p.C_)(["day-split-header",t.class||!1]),key:s},[(0,u.WI)(e.$slots,"split-label",{split:t,view:l.view.id},(()=>[(0,u.Uk)((0,p.zw)(t.label),1)]))],2)))),128))],4)):(0,u.kq)("",!0),s.showAllDayEvents&&n.hasTimeColumn&&(n.isWeekView&&n.cellOrSplitMinWidth||n.isDayView&&n.hasSplits&&s.minSplitWidth)?((0,u.wg)(),(0,u.j4)(r,(0,p.vs)((0,u.dG)({key:2},n.allDayBar)),{event:(0,u.w5)((({event:t,view:s})=>[(0,u.WI)(e.$slots,"event",{view:s,event:t},(()=>[n.editEvents.title&&t.titleEditable?((0,u.wg)(),(0,u.iD)("div",{key:0,class:"vuecal__event-title vuecal__event-title--edit",contenteditable:"contenteditable",onBlur:e=>n.onEventTitleBlur(e,t),innerHTML:t.title},null,40,Mn)):t.title?((0,u.wg)(),(0,u.iD)("div",{key:1,class:"vuecal__event-title",innerHTML:t.title},null,8,Tn)):(0,u.kq)("",!0),!t.content||n.hasShortEvents||n.isShortMonthView?(0,u.kq)("",!0):((0,u.wg)(),(0,u.iD)("div",{key:2,class:"vuecal__event-content",innerHTML:t.content},null,8,Cn))]))])),_:3},16)):(0,u.kq)("",!0),(0,u._)("div",{class:"vuecal__flex vuecal__cells-body",ref:e=>l.cellsEl=e,grow:"grow",wrap:!n.cellOrSplitMinWidth||!n.isWeekView,style:(0,p.j5)(n.cellOrSplitMinWidth?`min-width: ${n.cellOrSplitMinWidth}px`:"")},[((0,u.wg)(!0),(0,u.iD)(u.HY,null,(0,u.Ko)(n.viewCells,((t,a)=>((0,u.wg)(),(0,u.j4)(c,{key:a,options:e.$props,"edit-events":n.editEvents,data:t,"cell-width":s.hideWeekdays.length&&(n.isWeekView||n.isMonthView)&&n.cellWidth,"min-timestamp":n.minTimestamp,"max-timestamp":n.maxTimestamp,"cell-splits":n.hasSplits&&n.daySplits||[]},{"cell-content":(0,u.w5)((({events:a,split:i,selectCell:o})=>[(0,u.WI)(e.$slots,"cell-content",{cell:t,view:l.view,goNarrower:o,events:a},(()=>[i&&!s.stickySplitLabels?((0,u.wg)(),(0,u.iD)("div",{key:0,class:"split-label",innerHTML:i.label},null,8,jn)):(0,u.kq)("",!0),t.content?((0,u.wg)(),(0,u.iD)("div",{key:1,class:"vuecal__cell-date",innerHTML:t.content},null,8,En)):(0,u.kq)("",!0),(n.isMonthView&&!s.eventsOnMonthView||n.isYearsOrYearView&&s.eventsCountOnYearView)&&a.length?((0,u.wg)(),(0,u.iD)("div",xn,[(0,u.WI)(e.$slots,"events-count",{view:l.view,events:a},(()=>[(0,u.Uk)((0,p.zw)(a.length),1)]))])):(0,u.kq)("",!0),!n.cellOrSplitHasEvents(a,i)&&n.isWeekOrDayView?((0,u.wg)(),(0,u.iD)("div",Wn,[(0,u.WI)(e.$slots,"no-event",{},(()=>[(0,u.Uk)((0,p.zw)(l.texts.noEvent),1)]))])):(0,u.kq)("",!0)]))])),event:(0,u.w5)((({event:a,view:i})=>[(0,u.WI)(e.$slots,"event",{view:i,event:a},(()=>[n.editEvents.title&&a.titleEditable?((0,u.wg)(),(0,u.iD)("div",{key:0,class:"vuecal__event-title vuecal__event-title--edit",contenteditable:"contenteditable",onBlur:e=>n.onEventTitleBlur(e,a),innerHTML:a.title},null,40,Sn)):a.title?((0,u.wg)(),(0,u.iD)("div",{key:1,class:"vuecal__event-title",innerHTML:a.title},null,8,Vn)):(0,u.kq)("",!0),!s.time||a.allDay||n.isMonthView&&(a.allDay||"short"===s.showAllDayEvents)||n.isShortMonthView?(0,u.kq)("",!0):((0,u.wg)(),(0,u.iD)("div",On,[(0,u.Uk)((0,p.zw)(l.utils.date.formatTime(a.start,n.TimeFormat)),1),a.endTimeMinutes?((0,u.wg)(),(0,u.iD)("span",zn," - "+(0,p.zw)(l.utils.date.formatTime(a.end,n.TimeFormat,null,!0)),1)):(0,u.kq)("",!0),a.daysCount>1&&(a.segments[t.formattedDate]||{}).isFirstDay?((0,u.wg)(),(0,u.iD)("small",An," +"+(0,p.zw)(a.daysCount-1)+(0,p.zw)((l.texts.day[0]||"").toLowerCase()),1)):(0,u.kq)("",!0)])),!a.content||n.isMonthView&&a.allDay&&"short"===s.showAllDayEvents||n.isShortMonthView?(0,u.kq)("",!0):((0,u.wg)(),(0,u.iD)("div",{key:3,class:"vuecal__event-content",innerHTML:a.content},null,8,Un))]))])),_:2},1032,["options","edit-events","data","cell-width","min-timestamp","max-timestamp","cell-splits"])))),128))],12,$n)],10,Dn)])],2)]))])),_:3},8,["name","appear"]),l.ready?(0,u.kq)("",!0):((0,u.wg)(),(0,u.iD)("div",Zn,Fn))]))],10,hn)}s(30541);let Pn,Ln,Nn,Yn,qn={},Bn={};class Rn{constructor(e,t=!1){(0,Cl.Z)(this,"texts",{}),(0,Cl.Z)(this,"dateToMinutes",(e=>60*e.getHours()+e.getMinutes())),Yn=this,this._texts=e,t||!Date||Date.prototype.addDays||this._initDatePrototypes()}_initDatePrototypes(){Date.prototype.addDays=function(e){return Yn.addDays(this,e)},Date.prototype.subtractDays=function(e){return Yn.subtractDays(this,e)},Date.prototype.addHours=function(e){return Yn.addHours(this,e)},Date.prototype.subtractHours=function(e){return Yn.subtractHours(this,e)},Date.prototype.addMinutes=function(e){return Yn.addMinutes(this,e)},Date.prototype.subtractMinutes=function(e){return Yn.subtractMinutes(this,e)},Date.prototype.getWeek=function(){return Yn.getWeek(this)},Date.prototype.isToday=function(){return Yn.isToday(this)},Date.prototype.isLeapYear=function(){return Yn.isLeapYear(this)},Date.prototype.format=function(e="YYYY-MM-DD"){return Yn.formatDate(this,e)},Date.prototype.formatTime=function(e="HH:mm"){return Yn.formatTime(this,e)}}removePrototypes(){delete Date.prototype.addDays,delete Date.prototype.subtractDays,delete Date.prototype.addHours,delete Date.prototype.subtractHours,delete Date.prototype.addMinutes,delete Date.prototype.subtractMinutes,delete Date.prototype.getWeek,delete Date.prototype.isToday,delete Date.prototype.isLeapYear,delete Date.prototype.format,delete Date.prototype.formatTime}updateTexts(e){this._texts=e}_todayFormatted(){return Ln!==(new Date).getDate()&&(Pn=new Date,Ln=Pn.getDate(),Nn=`${Pn.getFullYear()}-${Pn.getMonth()}-${Pn.getDate()}`),Nn}addDays(e,t){const s=new Date(e.valueOf());return s.setDate(s.getDate()+t),s}subtractDays(e,t){const s=new Date(e.valueOf());return s.setDate(s.getDate()-t),s}addHours(e,t){const s=new Date(e.valueOf());return s.setHours(s.getHours()+t),s}subtractHours(e,t){const s=new Date(e.valueOf());return s.setHours(s.getHours()-t),s}addMinutes(e,t){const s=new Date(e.valueOf());return s.setMinutes(s.getMinutes()+t),s}subtractMinutes(e,t){const s=new Date(e.valueOf());return s.setMinutes(s.getMinutes()-t),s}getWeek(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())),s=t.getUTCDay()||7;t.setUTCDate(t.getUTCDate()+4-s);const a=new Date(Date.UTC(t.getUTCFullYear(),0,1));return Math.ceil(((t-a)/864e5+1)/7)}isToday(e){return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`===this._todayFormatted()}isLeapYear(e){const t=e.getFullYear();return!(t%400)||t%100&&!(t%4)}getPreviousFirstDayOfWeek(e=null,t){const s=e&&new Date(e.valueOf())||new Date,a=t?7:6;return s.setDate(s.getDate()-(s.getDay()+a)%7),s}stringToDate(e){return e instanceof Date?e:(10===e.length&&(e+=" 00:00"),new Date(e.replace(/-/g,"/")))}countDays(e,t){"string"===typeof e&&(e=e.replace(/-/g,"/")),"string"===typeof t&&(t=t.replace(/-/g,"/")),e=new Date(e).setHours(0,0,0,0),t=new Date(t).setHours(0,0,1,0);const s=60*(new Date(t).getTimezoneOffset()-new Date(e).getTimezoneOffset())*1e3;return Math.ceil((t-e-s)/864e5)}datesInSameTimeStep(e,t,s){return Math.abs(e.getTime()-t.getTime())<=60*s*1e3}formatDate(e,t="YYYY-MM-DD",s=null){if(s||(s=this._texts),t||(t="YYYY-MM-DD"),"YYYY-MM-DD"===t)return this.formatDateLite(e);qn={},Bn={};const a={YYYY:()=>this._hydrateDateObject(e,s).YYYY,YY:()=>this._hydrateDateObject(e,s).YY(),M:()=>this._hydrateDateObject(e,s).M,MM:()=>this._hydrateDateObject(e,s).MM(),MMM:()=>this._hydrateDateObject(e,s).MMM(),MMMM:()=>this._hydrateDateObject(e,s).MMMM(),MMMMG:()=>this._hydrateDateObject(e,s).MMMMG(),D:()=>this._hydrateDateObject(e,s).D,DD:()=>this._hydrateDateObject(e,s).DD(),S:()=>this._hydrateDateObject(e,s).S(),d:()=>this._hydrateDateObject(e,s).d,dd:()=>this._hydrateDateObject(e,s).dd(),ddd:()=>this._hydrateDateObject(e,s).ddd(),dddd:()=>this._hydrateDateObject(e,s).dddd(),HH:()=>this._hydrateTimeObject(e,s).HH,H:()=>this._hydrateTimeObject(e,s).H,hh:()=>this._hydrateTimeObject(e,s).hh,h:()=>this._hydrateTimeObject(e,s).h,am:()=>this._hydrateTimeObject(e,s).am,AM:()=>this._hydrateTimeObject(e,s).AM,mm:()=>this._hydrateTimeObject(e,s).mm,m:()=>this._hydrateTimeObject(e,s).m};return t.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g,((e,t)=>{const s=a[t.replace(/\{|\}/g,"")];return void 0!==s?s():t}))}formatDateLite(e){const t=e.getMonth()+1,s=e.getDate();return`${e.getFullYear()}-${t<10?"0":""}${t}-${s<10?"0":""}${s}`}formatTime(e,t="HH:mm",s=null,a=!1){let i=!1;if(a){const[t,s,a]=[e.getHours(),e.getMinutes(),e.getSeconds()];t+s+a===141&&(i=!0)}if(e instanceof Date&&"HH:mm"===t)return i?"24:00":this.formatTimeLite(e);Bn={},s||(s=this._texts);const l=this._hydrateTimeObject(e,s),n=t.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g,((e,t)=>{const s=l[t.replace(/\{|\}/g,"")];return void 0!==s?s:t}));return i?n.replace("23:59","24:00"):n}formatTimeLite(e){const t=e.getHours(),s=e.getMinutes();return`${(t<10?"0":"")+t}:${(s<10?"0":"")+s}`}_nth(e){if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}_hydrateDateObject(e,t){if(qn.D)return qn;const s=e.getFullYear(),a=e.getMonth()+1,i=e.getDate(),l=e.getDay(),n=(l-1+7)%7;return qn={YYYY:s,YY:()=>s.toString().substring(2),M:a,MM:()=>(a<10?"0":"")+a,MMM:()=>t.months[a-1].substring(0,3),MMMM:()=>t.months[a-1],MMMMG:()=>(t.monthsGenitive||t.months)[a-1],D:i,DD:()=>(i<10?"0":"")+i,S:()=>this._nth(i),d:n+1,dd:()=>t.weekDays[n][0],ddd:()=>t.weekDays[n].substr(0,3),dddd:()=>t.weekDays[n]},qn}_hydrateTimeObject(e,t){if(Bn.am)return Bn;let s,a;e instanceof Date?(s=e.getHours(),a=e.getMinutes()):(s=Math.floor(e/60),a=Math.floor(e%60));const i=s%12?s%12:12,l=(t||{am:"am",pm:"pm"})[24===s||s<12?"am":"pm"];return Bn={H:s,h:i,HH:(s<10?"0":"")+s,hh:(i<10?"0":"")+i,am:l,AM:l.toUpperCase(),m:a,mm:(a<10?"0":"")+a},Bn}}const Kn=1440;class Jn{constructor(e){(0,Cl.Z)(this,"_vuecal",null),(0,Cl.Z)(this,"selectCell",((e=!1,t,s)=>{this._vuecal.$emit("cell-click",s?{date:t,split:s}:t),this._vuecal.clickToNavigate||e?this._vuecal.switchToNarrowerView():this._vuecal.dblclickToNavigate&&"ontouchstart"in window&&(this._vuecal.domEvents.dblTapACell.taps++,setTimeout((()=>this._vuecal.domEvents.dblTapACell.taps=0),this._vuecal.domEvents.dblTapACell.timeout),this._vuecal.domEvents.dblTapACell.taps>=2&&(this._vuecal.domEvents.dblTapACell.taps=0,this._vuecal.switchToNarrowerView(),this._vuecal.$emit("cell-dblclick",s?{date:t,split:s}:t)))})),(0,Cl.Z)(this,"keyPressEnterCell",((e,t)=>{this._vuecal.$emit("cell-keypress-enter",t?{date:e,split:t}:e),this._vuecal.switchToNarrowerView()})),(0,Cl.Z)(this,"getPosition",(e=>{const{left:t,top:s}=this._vuecal.cellsEl.getBoundingClientRect(),{clientX:a,clientY:i}="ontouchstart"in window&&e.touches?e.touches[0]:e;return{x:a-t,y:i-s}})),(0,Cl.Z)(this,"minutesAtCursor",(e=>{let t=0,s={x:0,y:0};const{timeStep:a,timeCellHeight:i,timeFrom:l}=this._vuecal.$props;return"number"===typeof e?t=e:"object"===typeof e&&(s=this.getPosition(e),t=Math.round(s.y*a/parseInt(i)+l)),{minutes:Math.max(Math.min(t,Kn),0),cursorCoords:s}})),this._vuecal=e}}const Gn=2,Xn=1440;let Qn,eo,to;class so{constructor(e,t){(0,Cl.Z)(this,"_vuecal",null),(0,Cl.Z)(this,"eventDefaults",{_eid:null,start:"",startTimeMinutes:0,end:"",endTimeMinutes:0,title:"",content:"",background:!1,allDay:!1,segments:null,repeat:null,daysCount:1,deletable:!0,deleting:!1,titleEditable:!0,resizable:!0,resizing:!1,draggable:!0,dragging:!1,draggingStatic:!1,focused:!1,class:""}),this._vuecal=e,Qn=t}createAnEvent(e,t,s){if("string"===typeof e&&(e=Qn.stringToDate(e)),!(e instanceof Date))return!1;const a=Qn.dateToMinutes(e);t=1*t||60*Gn;const i=a+t,l=Qn.addMinutes(new Date(e),t);s.end&&("string"===typeof s.end&&(s.end=Qn.stringToDate(s.end)),s.endTimeMinutes=Qn.dateToMinutes(s.end));const n={...this.eventDefaults,_eid:`${this._vuecal._.uid}_${this._vuecal.eventIdIncrement++}`,start:e,startTimeMinutes:a,end:l,endTimeMinutes:i,segments:null,...s};return"function"!==typeof this._vuecal.onEventCreate||this._vuecal.onEventCreate(n,(()=>this.deleteAnEvent(n)))?(n.startDateF!==n.endDateF&&(n.daysCount=Qn.countDays(n.start,n.end)),this._vuecal.mutableEvents.push(n),this._vuecal.addEventsToView([n]),this._vuecal.emitWithEvent("event-create",n),this._vuecal.$emit("event-change",{event:this._vuecal.cleanupEvent(n),originalEvent:null}),n):void 0}addEventSegment(e){e.segments||(e.segments={},e.segments[Qn.formatDateLite(e.start)]={start:e.start,startTimeMinutes:e.startTimeMinutes,endTimeMinutes:Xn,isFirstDay:!0,isLastDay:!1});const t=e.segments[Qn.formatDateLite(e.end)];t&&(t.isLastDay=!1,t.endTimeMinutes=Xn);const s=Qn.addDays(e.end,1),a=Qn.formatDateLite(s);return s.setHours(0,0,0,0),e.segments[a]={start:s,startTimeMinutes:0,endTimeMinutes:e.endTimeMinutes,isFirstDay:!1,isLastDay:!0},e.end=Qn.addMinutes(s,e.endTimeMinutes),e.daysCount=Object.keys(e.segments).length,a}removeEventSegment(e){let t=Object.keys(e.segments).length;if(t<=1)return Qn.formatDateLite(e.end);delete e.segments[Qn.formatDateLite(e.end)],t--;const s=Qn.subtractDays(e.end,1),a=Qn.formatDateLite(s),i=e.segments[a];return t?i&&(i.isLastDay=!0,i.endTimeMinutes=e.endTimeMinutes):e.segments=null,e.daysCount=t||1,e.end=s,a}createEventSegments(e,t,s){const a=t.getTime(),i=s.getTime();let l,n,o,r=e.start.getTime(),d=e.end.getTime(),u=!1;e.end.getHours()||e.end.getMinutes()||(d-=1e3),e.segments={},e.repeat?(l=a,n=Math.min(i,e.repeat.until?Qn.stringToDate(e.repeat.until).getTime():i)):(l=Math.max(a,r),n=Math.min(i,d));while(l<=n){let t=!1;const s=Qn.addDays(new Date(l),1).setHours(0,0,0,0);let a,i,c,m;if(e.repeat){const s=new Date(l),n=Qn.formatDateLite(s);(u||e.occurrences&&e.occurrences[n])&&(u||(r=e.occurrences[n].start,o=new Date(r).setHours(0,0,0,0),d=e.occurrences[n].end),u=!0,t=!0),a=l===o,i=n===Qn.formatDateLite(new Date(d)),c=new Date(a?r:l),m=Qn.formatDateLite(c),i&&(u=!1)}else t=!0,a=l===r,i=n===d&&s>n,c=a?e.start:new Date(l),m=Qn.formatDateLite(a?e.start:c);t&&(e.segments[m]={start:c,startTimeMinutes:a?e.startTimeMinutes:0,endTimeMinutes:i?e.endTimeMinutes:Xn,isFirstDay:a,isLastDay:i}),l=s}return e}deleteAnEvent(e){this._vuecal.emitWithEvent("event-delete",e),this._vuecal.mutableEvents=this._vuecal.mutableEvents.filter((t=>t._eid!==e._eid)),this._vuecal.view.events=this._vuecal.view.events.filter((t=>t._eid!==e._eid))}checkCellOverlappingEvents(e,t){to=e.slice(0),eo={},e.forEach((e=>{to.shift(),eo[e._eid]||(eo[e._eid]={overlaps:[],start:e.start,position:0,sameOverlaps:[]}),eo[e._eid].position=0,to.forEach((s=>{eo[s._eid]||(eo[s._eid]={overlaps:[],start:s.start,position:0,sameOverlaps:[]});const a=this.eventInRange(s,e.start,e.end),i=this.eventSameRange(s,e),l=t.overlapsPerTimeStep?Qn.datesInSameTimeStep(e.start,s.start,t.timeStep):1;if(e.background||e.allDay||s.background||s.allDay||!a||!l){let t,a;(t=(eo[e._eid]||{overlaps:[]}).overlaps.indexOf(s._eid))>-1&&eo[e._eid].overlaps.splice(t,1),(a=(eo[s._eid]||{overlaps:[]}).overlaps.indexOf(e._eid))>-1&&eo[s._eid].overlaps.splice(a,1),eo[s._eid].position--}else eo[e._eid].overlaps.push(s._eid),eo[e._eid].overlaps=[...new Set(eo[e._eid].overlaps)],eo[s._eid].overlaps.push(e._eid),eo[s._eid].overlaps=[...new Set(eo[s._eid].overlaps)],eo[s._eid].position++,i&&(eo[e._eid].sameOverlaps.push(s._eid),eo[e._eid].sameOverlaps=[...new Set(eo[e._eid].sameOverlaps)],eo[s._eid].sameOverlaps.push(e._eid),eo[s._eid].sameOverlaps=[...new Set(eo[s._eid].sameOverlaps)])}))}));let s=0;for(const a in eo){const e=eo[a],t=e.overlaps.map((e=>({id:e,start:eo[e].start})));t.push({id:a,start:e.start}),t.sort(((e,t)=>e.start<t.start?-1:e.start>t.start?1:e.id>t.id?-1:1)),e.position=t.findIndex((e=>e.id===a)),s=Math.max(this.getOverlapsStreak(e,eo),s)}return[eo,s]}getOverlapsStreak(e,t={}){let s=e.overlaps.length+1,a=[];return e.overlaps.forEach((s=>{if(!a.includes(s)){const i=e.overlaps.filter((e=>e!==s));i.forEach((e=>{t[e].overlaps.includes(s)||a.push(e)}))}})),a=[...new Set(a)],s-=a.length,s}eventInRange(e,t,s){if(e.allDay||!this._vuecal.time){const a=new Date(e.start).setHours(0,0,0,0),i=new Date(e.end).setHours(23,59,0,0);return i>=new Date(t).setHours(0,0,0,0)&&a<=new Date(s).setHours(0,0,0,0)}const a=e.start.getTime(),i=e.end.getTime();return a<s.getTime()&&i>t.getTime()}eventSameRange(e,t){const s=e.start.getTime()==t.start.getTime(),a=e.end.getTime()==t.end.getTime();return s&&a}}const ao={class:"vuecal__header"},io={key:0,class:"vuecal__flex vuecal__menu",role:"tablist","aria-label":"Calendar views navigation"},lo=["onDragenter","onDragleave","onClick","aria-label"],no={key:1,class:"vuecal__title-bar"},oo=["aria-label"],ro={class:"vuecal__flex vuecal__title",grow:""},uo=["aria-label"],co={key:0,class:"vuecal__flex vuecal__split-days-headers"};function mo(e,t,s,i,l,n){const o=(0,u.up)("weekdays-headings");return(0,u.wg)(),(0,u.iD)("div",ao,[s.options.hideViewSelector?(0,u.kq)("",!0):((0,u.wg)(),(0,u.iD)("div",io,[((0,u.wg)(!0),(0,u.iD)(u.HY,null,(0,u.Ko)(s.viewProps.views,((t,a)=>((0,u.wg)(),(0,u.iD)(u.HY,{key:a},[t.enabled?((0,u.wg)(),(0,u.iD)("button",{key:0,class:(0,p.C_)(["vuecal__view-btn",{"vuecal__view-btn--active":n.view.id===a,"vuecal__view-btn--highlighted":e.highlightedControl===a}]),type:"button",onDragenter:t=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragEnter(t,a,e.$data),onDragleave:t=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragLeave(t,a,e.$data),onClick:e=>n.switchView(a,null,!0),"aria-label":`${t.label} view`},(0,p.zw)(t.label),43,lo)):(0,u.kq)("",!0)],64)))),128))])),s.options.hideTitleBar?(0,u.kq)("",!0):((0,u.wg)(),(0,u.iD)("div",no,[(0,u._)("button",{class:(0,p.C_)(["vuecal__arrow vuecal__arrow--prev",{"vuecal__arrow--highlighted":"previous"===e.highlightedControl}]),type:"button",onClick:t[0]||(t[0]=(...e)=>n.previous&&n.previous(...e)),onDragenter:t[1]||(t[1]=t=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragEnter(t,"previous",e.$data)),onDragleave:t[2]||(t[2]=t=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragLeave(t,"previous",e.$data)),"aria-label":`Previous ${n.view.id}`},[(0,u.WI)(e.$slots,"arrow-prev")],42,oo),(0,u._)("div",ro,[(0,u.Wm)(a.uT,{name:s.options.transitions?`slide-fade--${n.transitionDirection}`:""},{default:(0,u.w5)((()=>[((0,u.wg)(),(0,u.j4)((0,u.LL)(n.broaderView?"button":"span"),{type:!!n.broaderView&&"button",key:`${n.view.id}${n.view.startDate.toString()}`,onClick:t[3]||(t[3]=e=>!!n.broaderView&&n.switchToBroaderView()),"aria-label":!!n.broaderView&&`Go to ${n.broaderView} view`},{default:(0,u.w5)((()=>[(0,u.WI)(e.$slots,"title")])),_:3},8,["type","aria-label"]))])),_:3},8,["name"])]),s.options.todayButton?((0,u.wg)(),(0,u.iD)("button",{key:0,class:(0,p.C_)(["vuecal__today-btn",{"vuecal__today-btn--highlighted":"today"===e.highlightedControl}]),type:"button",onClick:t[4]||(t[4]=(...e)=>n.goToToday&&n.goToToday(...e)),onDragenter:t[5]||(t[5]=t=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragEnter(t,"today",e.$data)),onDragleave:t[6]||(t[6]=t=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragLeave(t,"today",e.$data)),"aria-label":"Today"},[(0,u.WI)(e.$slots,"today-button")],34)):(0,u.kq)("",!0),(0,u._)("button",{class:(0,p.C_)(["vuecal__arrow vuecal__arrow--next",{"vuecal__arrow--highlighted":"next"===e.highlightedControl}]),type:"button",onClick:t[7]||(t[7]=(...e)=>n.next&&n.next(...e)),onDragenter:t[8]||(t[8]=t=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragEnter(t,"next",e.$data)),onDragleave:t[9]||(t[9]=t=>s.editEvents.drag&&n.dnd&&n.dnd.viewSelectorDragLeave(t,"next",e.$data)),"aria-label":`Next ${n.view.id}`},[(0,u.WI)(e.$slots,"arrow-next")],42,uo)])),s.viewProps.weekDaysInHeader?((0,u.wg)(),(0,u.j4)(o,{key:2,"week-days":s.weekDays,"transition-direction":n.transitionDirection,"switch-to-narrower-view":s.switchToNarrowerView},(0,u.Nv)({_:2},[e.$slots["weekday-heading"]?{name:"weekday-heading",fn:(0,u.w5)((({heading:t,view:s})=>[(0,u.WI)(e.$slots,"weekday-heading",{heading:t,view:s})])),key:"0"}:void 0,e.$slots["split-label"]?{name:"split-label",fn:(0,u.w5)((({split:t})=>[(0,u.WI)(e.$slots,"split-label",{split:t,view:n.view})])),key:"1"}:void 0]),1032,["week-days","transition-direction","switch-to-narrower-view"])):(0,u.kq)("",!0),(0,u.Wm)(a.uT,{name:`slide-fade--${n.transitionDirection}`},{default:(0,u.w5)((()=>[n.showDaySplits?((0,u.wg)(),(0,u.iD)("div",co,[((0,u.wg)(!0),(0,u.iD)(u.HY,null,(0,u.Ko)(s.daySplits,((t,s)=>((0,u.wg)(),(0,u.iD)("div",{class:(0,p.C_)(["day-split-header",t.class||!1]),key:s},[(0,u.WI)(e.$slots,"split-label",{split:t,view:n.view.id},(()=>[(0,u.Uk)((0,p.zw)(t.label),1)]))],2)))),128))])):(0,u.kq)("",!0)])),_:3},8,["name"])])}const ho={class:"vuecal__flex vuecal__weekdays-headings",ref:"vuecal_weekday_heading"},po=["onClick"],vo={class:"vuecal__flex weekday-label",grow:""},ko={class:"full"},fo={class:"small"},go={class:"xsmall"},wo={key:0},_o={key:0,class:"vuecal__flex vuecal__split-days-headers",grow:""};function yo(e,t,s,i,l,n){return(0,u.wg)(),(0,u.iD)("div",ho,[((0,u.wg)(!0),(0,u.iD)(u.HY,null,(0,u.Ko)(n.headings,((i,l)=>((0,u.wg)(),(0,u.iD)(u.HY,{key:l},[i.hide?(0,u.kq)("",!0):((0,u.wg)(),(0,u.iD)("div",{key:0,class:(0,p.C_)(["vuecal__flex vuecal__heading",{today:i.today,"today-cell":i.today,clickable:n.cellHeadingsClickable,"yesterday-cell":new Date(i.date).toLocaleDateString("sk-SK")==new Date((new Date).setDate((new Date).getDate()-1)).toLocaleDateString("sk-SK")}]),style:(0,p.j5)(n.weekdayCellStyles),onClick:e=>"week"===n.view.id&&n.selectCell(i.date,e),onDblclick:t[0]||(t[0]=e=>"week"===n.view.id&&n.vuecal.dblclickToNavigate&&s.switchToNarrowerView())},[(0,u.Wm)(a.uT,{name:`slide-fade--${s.transitionDirection}`,appear:n.vuecal.transitions},{default:(0,u.w5)((()=>[((0,u.wg)(),(0,u.iD)("div",{class:"vuecal__flex",column:"",key:!!n.vuecal.transitions&&`${l}-${i.dayOfMonth}`},[(0,u._)("div",vo,[(0,u.WI)(e.$slots,"weekday-heading",{heading:n.cleanupHeading(i),view:n.view},(()=>[(0,u._)("span",ko,(0,p.zw)(i.full),1),(0,u._)("span",fo,(0,p.zw)(i.small),1),(0,u._)("span",go,(0,p.zw)(i.xsmall),1),i.dayOfMonth?((0,u.wg)(),(0,u.iD)("span",wo," "+(0,p.zw)(i.dayOfMonth),1)):(0,u.kq)("",!0)]))]),n.vuecal.hasSplits&&n.vuecal.stickySplitLabels?((0,u.wg)(),(0,u.iD)("div",_o,[((0,u.wg)(!0),(0,u.iD)(u.HY,null,(0,u.Ko)(n.vuecal.daySplits,((t,s)=>((0,u.wg)(),(0,u.iD)("div",{class:(0,p.C_)(["day-split-header",t.class||!1]),key:s},[(0,u.WI)(e.$slots,"split-label",{split:t,view:n.view},(()=>[(0,u.Uk)((0,p.zw)(t.label),1)]))],2)))),128))])):(0,u.kq)("",!0)]))])),_:2},1032,["name","appear"])],46,po))],64)))),128))],512)}var bo={inject:["vuecal","utils","view"],props:{transitionDirection:{type:String,default:"right"},weekDays:{type:Array,default:()=>[]},switchToNarrowerView:{type:Function,default:()=>{}},unscheduledTime:{type:Array,default:[]}},methods:{selectCell(e,t){e.getTime()!==this.view.selectedDate.getTime()&&(this.view.selectedDate=e),this.utils.cell.selectCell(!1,e,t)},cleanupHeading:e=>({label:e.full,date:e.date,unscheduledTime:e.unscheduledTime,name:e.name,initials:e.initials,...e.today?{today:e.today}:{}}),onTimelineScroll(e){this.$refs["vuecal_weekday_heading"].style.top=`${e}px`}},computed:{headings(){if(!["month","week"].includes(this.view.id))return[];let e=!1;const t=this.weekDays.map(((t,s)=>{const a=this.utils.date.addDays(this.view.startDate,this.vuecal.startWeekOnSunday?s-1:s);let i=null,l=null,n=null;return this.unscheduledTime[s]?.time&&(i=Math.floor(this.unscheduledTime[s].time/60)+","+String(this.unscheduledTime[s].time%60)[0]),this.unscheduledTime[s]?.name&&this.unscheduledTime[s]?.name&&(l=this.unscheduledTime[s].name+" "+this.unscheduledTime[s].surname,n=this.unscheduledTime[s].name.charAt(0).toUpperCase()+this.unscheduledTime[s].surname.charAt(0).toUpperCase()),{hide:t.hide,full:t.label,small:t.short||t.label.substr(0,3),xsmall:t.short||t.label.substr(0,1),unscheduledTime:i,name:l,initials:n,..."week"===this.view.id?{dayOfMonth:a.getDate(),date:a,today:!e&&this.utils.date.isToday(a)&&!e++}:{}}}));return t},cellWidth(){return 100/(7-this.weekDays.reduce(((e,t)=>e+t.hide),0))},weekdayCellStyles(){return{...this.vuecal.hideWeekdays.length?{width:`${this.cellWidth}%`}:{}}},cellHeadingsClickable(){return"week"===this.view.id&&(this.vuecal.clickToNavigate||this.vuecal.dblclickToNavigate)}}};const Do=(0,M.Z)(bo,[["render",yo]]);var Mo=Do,To={inject:["vuecal","previous","next","switchView","updateSelectedDate","modules","view"],components:{WeekdaysHeadings:Mo},props:{options:{type:Object,default:()=>({})},editEvents:{type:Object,required:!0},hasSplits:{type:[Boolean,Number],default:!1},daySplits:{type:Array,default:()=>[]},viewProps:{type:Object,default:()=>({})},weekDays:{type:Array,default:()=>[]},switchToNarrowerView:{type:Function,default:()=>{}}},data:()=>({highlightedControl:null}),methods:{goToToday(){this.updateSelectedDate(new Date((new Date).setHours(0,0,0,0)))},switchToBroaderView(){this.transitionDirection="left",this.broaderView&&this.switchView(this.broaderView)}},computed:{transitionDirection:{get(){return this.vuecal.transitionDirection},set(e){this.vuecal.transitionDirection=e}},broaderView(){const{enabledViews:e}=this.vuecal;return e[e.indexOf(this.view.id)-1]},showDaySplits(){return"day"===this.view.id&&this.hasSplits&&this.options.stickySplitLabels&&!this.options.minSplitWidth},dnd(){return this.modules.dnd}}};const Co=(0,M.Z)(To,[["render",mo]]);var $o=Co;const jo={key:0,class:"vuecal__all-day-text",style:{width:"3em"}};function Eo(e,t,s,a,i,l){const n=(0,u.up)("vuecal-cell");return(0,u.wg)(),(0,u.iD)("div",{class:"vuecal__flex vuecal__all-day",style:(0,p.j5)(s.cellOrSplitMinWidth&&{height:s.height})},[s.cellOrSplitMinWidth?(0,u.kq)("",!0):((0,u.wg)(),(0,u.iD)("div",jo,[(0,u._)("span",null,(0,p.zw)(s.label),1)])),(0,u._)("div",{class:(0,p.C_)(["vuecal__flex vuecal__cells",`${l.view.id}-view`]),grow:"",style:(0,p.j5)(s.cellOrSplitMinWidth?`min-width: ${s.cellOrSplitMinWidth}px`:"")},[((0,u.wg)(!0),(0,u.iD)(u.HY,null,(0,u.Ko)(s.cells,((t,a)=>((0,u.wg)(),(0,u.j4)(n,{key:a,options:s.options,"edit-events":l.editEvents,data:t,"all-day":!0,"cell-width":s.options.hideWeekdays.length&&(l.vuecal.isWeekView||l.vuecal.isMonthView)&&l.vuecal.cellWidth,"min-timestamp":s.options.minTimestamp,"max-timestamp":s.options.maxTimestamp,"cell-splits":s.daySplits},{event:(0,u.w5)((({event:t,view:s})=>[(0,u.WI)(e.$slots,"event",{view:s,event:t})])),_:2},1032,["options","edit-events","data","cell-width","min-timestamp","max-timestamp","cell-splits"])))),128))],6)],4)}const xo=["data-split","aria-label","onTouchstart","onMousedown","onClick","onDragover","onDrop"],Wo={key:0,class:"cell-time-labels"},So=["innerHTML"],Vo={key:2,class:"vuecal__cell-events"},Oo=["title"];function zo(e,t,s,i,l,n){const o=(0,u.up)("event");return(0,u.wg)(),(0,u.j4)(a.W3,{class:(0,p.C_)(["vuecal__cell",n.cellClasses]),name:`slide-fade--${n.transitionDirection}`,tag:"div",appear:s.options.transitions,style:(0,p.j5)(n.cellStyles)},{default:(0,u.w5)((()=>[((0,u.wg)(!0),(0,u.iD)(u.HY,null,(0,u.Ko)(n.splitsCount?n.splits:1,((i,l)=>((0,u.wg)(),(0,u.iD)("div",{class:(0,p.C_)(["vuecal__flex vuecal__cell-content",n.splitsCount&&n.splitClasses(i)]),key:s.options.transitions?`${n.view.id}-${s.data.content}-${l}`:l,"data-split":!!n.splitsCount&&i.id,column:"",tabindex:"0","aria-label":s.data.content,onFocus:t[0]||(t[0]=e=>n.onCellFocus(e)),onKeypress:t[1]||(t[1]=(0,a.D2)((e=>n.onCellkeyPressEnter(e)),["enter"])),onTouchstart:e=>!n.isDisabled&&n.onCellTouchStart(e,n.splitsCount?i.id:null),onMousedown:e=>!n.isDisabled&&n.onCellMouseDown(e,n.splitsCount?i.id:null),onClick:e=>!n.isDisabled&&n.onCellClick(e,i),onDblclick:t[2]||(t[2]=e=>!n.isDisabled&&n.onCellDblClick(e)),onContextmenu:t[3]||(t[3]=e=>!n.isDisabled&&s.options.cellContextmenu&&n.onCellContextMenu(e)),onDragenter:t[4]||(t[4]=t=>!n.isDisabled&&s.editEvents.drag&&n.dnd&&n.dnd.cellDragEnter(t,e.$data,s.data.startDate)),onDragover:t=>!n.isDisabled&&s.editEvents.drag&&n.dnd&&n.dnd.cellDragOver(t,e.$data,s.data.startDate,n.splitsCount?i.id:null),onDragleave:t[5]||(t[5]=t=>!n.isDisabled&&s.editEvents.drag&&n.dnd&&n.dnd.cellDragLeave(t,e.$data,s.data.startDate)),onDrop:t=>!n.isDisabled&&s.editEvents.drag&&n.dnd&&n.dnd.cellDragDrop(t,e.$data,s.data.startDate,n.splitsCount?i.id:null)},[s.options.showTimeInCells&&s.options.time&&n.isWeekOrDayView&&!s.allDay?((0,u.wg)(),(0,u.iD)("div",Wo,[((0,u.wg)(!0),(0,u.iD)(u.HY,null,(0,u.Ko)(n.vuecal.timeCells,((e,t)=>((0,u.wg)(),(0,u.iD)("span",{class:"cell-time-label",key:t},(0,p.zw)(e.label),1)))),128))])):(0,u.kq)("",!0),n.isWeekOrDayView&&!s.allDay&&n.specialHours.length?((0,u.wg)(!0),(0,u.iD)(u.HY,{key:1},(0,u.Ko)(n.specialHours,((e,t)=>((0,u.wg)(),(0,u.iD)("div",{class:(0,p.C_)(["vuecal__special-hours",`vuecal__special-hours--day${e.day} ${e.class}`]),style:(0,p.j5)(`height: ${e.height}px;top: ${e.top}px`)},[e.label?((0,u.wg)(),(0,u.iD)("div",{key:0,class:"special-hours-label",innerHTML:e.label},null,8,So)):(0,u.kq)("",!0)],6)))),256)):(0,u.kq)("",!0),(0,u.WI)(e.$slots,"cell-content",{events:n.events,selectCell:e=>n.selectCell(e,!0),split:!!n.splitsCount&&i}),n.eventsCount&&(n.isWeekOrDayView||"month"===n.view.id&&s.options.eventsOnMonthView)?((0,u.wg)(),(0,u.iD)("div",Vo,[((0,u.wg)(!0),(0,u.iD)(u.HY,null,(0,u.Ko)(n.splitsCount?i.events:n.events,((t,a)=>((0,u.wg)(),(0,u.j4)(o,{key:a,"cell-formatted-date":s.data.formattedDate,event:t,"all-day":s.allDay,"cell-events":n.splitsCount?i.events:n.events,cellOverlaps:(n.splitsCount?i.overlaps[t._eid]:e.cellOverlaps[t._eid])||[],allOverlaps:(n.splitsCount?i.overlaps:e.cellOverlaps)||[],"event-position":((n.splitsCount?i.overlaps[t._eid]:e.cellOverlaps[t._eid])||[]).position,"overlaps-streak":n.splitsCount?i.overlapsStreak:e.cellOverlapsStreak},{event:(0,u.w5)((({event:t,view:s})=>[(0,u.WI)(e.$slots,"event",{view:s,event:t})])),_:2},1032,["cell-formatted-date","event","all-day","cell-events","cellOverlaps","allOverlaps","event-position","overlaps-streak"])))),128))])):(0,u.kq)("",!0)],42,xo)))),128)),n.timelineVisible?((0,u.wg)(),(0,u.iD)("div",{class:"vuecal__now-line",style:(0,p.j5)(`top: ${n.todaysTimePosition}px`),key:s.options.transitions?`${n.view.id}-now-line`:"now-line",title:n.utils.date.formatTime(n.vuecal.now)},null,12,Oo)):(0,u.kq)("",!0)])),_:3},8,["class","name","appear","style"])}const Ao=["eventId","draggable"];function Uo(e,t,s,i,l,n){return(0,u.wg)(),(0,u.iD)("div",{class:(0,p.C_)(["vuecal__event",n.eventClasses]),style:(0,p.j5)(n.eventStyles),eventId:`event-id-${s.event.id}`,tabindex:"0",onFocus:t[4]||(t[4]=(...e)=>n.focusEvent&&n.focusEvent(...e)),onKeypress:t[5]||(t[5]=(0,a.D2)((0,a.iM)(((...e)=>n.onEnterKeypress&&n.onEnterKeypress(...e)),["stop"]),["enter"])),onMouseenter:t[6]||(t[6]=(...e)=>n.onMouseEnter&&n.onMouseEnter(...e)),onMouseleave:t[7]||(t[7]=(...e)=>n.onMouseLeave&&n.onMouseLeave(...e)),onTouchstart:t[8]||(t[8]=(0,a.iM)(((...e)=>n.onTouchStart&&n.onTouchStart(...e)),["stop"])),onMousedown:t[9]||(t[9]=e=>n.onMouseDown(e)),onMouseup:t[10]||(t[10]=(...e)=>n.onMouseUp&&n.onMouseUp(...e)),onTouchend:t[11]||(t[11]=(...e)=>n.onMouseUp&&n.onMouseUp(...e)),onTouchmove:t[12]||(t[12]=(...e)=>n.onTouchMove&&n.onTouchMove(...e)),onDblclick:t[13]||(t[13]=(...e)=>n.onDblClick&&n.onDblClick(...e)),draggable:n.draggable,onDragstart:t[14]||(t[14]=e=>n.draggable&&n.onDragStart(e)),onDragend:t[15]||(t[15]=e=>n.draggable&&n.onDragEnd())},[n.vuecal.editEvents.delete&&s.event.deletable?((0,u.wg)(),(0,u.iD)("div",{key:0,class:"vuecal__event-delete",onClick:t[0]||(t[0]=(0,a.iM)(((...e)=>n.deleteEvent&&n.deleteEvent(...e)),["stop"])),onTouchstart:t[1]||(t[1]=(0,a.iM)(((...e)=>n.touchDeleteEvent&&n.touchDeleteEvent(...e)),["stop"]))},(0,p.zw)(n.vuecal.texts.deleteEvent),33)):(0,u.kq)("",!0),(0,u.WI)(e.$slots,"event",{event:s.event,view:n.view.id}),n.resizable?((0,u.wg)(),(0,u.iD)("div",{key:1,class:"vuecal__event-resize-handle",contenteditable:"false",onMousedown:t[2]||(t[2]=(0,a.iM)(((...e)=>n.onResizeHandleMouseDown&&n.onResizeHandleMouseDown(...e)),["stop","prevent"])),onTouchstart:t[3]||(t[3]=(0,a.iM)(((...e)=>n.onResizeHandleMouseDown&&n.onResizeHandleMouseDown(...e)),["stop","prevent"]))},null,32)):(0,u.kq)("",!0)],46,Ao)}var Zo={inject:["vuecal","utils","modules","view","domEvents","editEvents"],props:{cellFormattedDate:{type:String,default:""},event:{type:Object,default:()=>({})},cellEvents:{type:Array,default:()=>[]},cellOverlaps:{type:Object,default:()=>({})},allOverlaps:{type:Object,default:()=>({})},eventPosition:{type:Number,default:0},overlapsStreak:{type:Number,default:0},allDay:{type:Boolean,default:!1}},data:()=>({touch:{dragThreshold:30,startX:0,startY:0,dragged:!1}}),methods:{onMouseDown(e,t=!1){if("ontouchstart"in window&&!t)return!1;const{clickHoldAnEvent:s,focusAnEvent:a,resizeAnEvent:i,dragAnEvent:l}=this.domEvents;if(a._eid===this.event._eid&&s._eid===this.event._eid)return!0;this.focusEvent(),s._eid=null,this.vuecal.editEvents.delete&&this.event.deletable&&(s.timeoutId=setTimeout((()=>{i._eid||l._eid||(s._eid=this.event._eid,this.event.deleting=!0)}),s.timeout))},onMouseUp(e){this.domEvents.focusAnEvent._eid!==this.event._eid||this.touch.dragged||(this.domEvents.focusAnEvent.mousedUp=!0),this.touch.dragged=!1},onMouseEnter(e){e.preventDefault(),this.vuecal.emitWithEvent("event-mouse-enter",this.event)},onMouseLeave(e){e.preventDefault(),this.vuecal.emitWithEvent("event-mouse-leave",this.event)},onTouchMove(e){if("function"!==typeof this.vuecal.onEventClick)return;const{clientX:t,clientY:s}=e.touches[0],{startX:a,startY:i,dragThreshold:l}=this.touch;(Math.abs(t-a)>l||Math.abs(s-i)>l)&&(this.touch.dragged=!0)},onTouchStart(e){this.touch.startX=e.touches[0].clientX,this.touch.startY=e.touches[0].clientY,this.onMouseDown(e,!0)},onEnterKeypress(e){if("function"===typeof this.vuecal.onEventClick)return this.vuecal.onEventClick(this.event,e)},onDblClick(e){if("function"===typeof this.vuecal.onEventDblclick)return this.vuecal.onEventDblclick(this.event,e)},onDragStart(e){"blocker"!=this.event.type&&"non-working-hours"!=this.event.type&&(this.event.draggingStatic=!1,this.dnd&&this.dnd.eventDragStart(e,this.event))},onDragEnd(){this.dnd&&this.dnd.eventDragEnd(this.event)},onResizeHandleMouseDown(){this.focusEvent(),this.domEvents.dragAnEvent._eid=null,this.domEvents.resizeAnEvent=Object.assign(this.domEvents.resizeAnEvent,{_eid:this.event._eid,start:(this.segment||this.event).start,split:this.event.split||null,segment:!!this.segment&&this.utils.date.formatDateLite(this.segment.start),originalEnd:new Date((this.segment||this.event).end),originalEndTimeMinutes:this.event.endTimeMinutes}),this.event.resizing=!0},deleteEvent(e=!1){if("ontouchstart"in window&&!e)return!1;this.utils.event.deleteAnEvent(this.event)},touchDeleteEvent(e){this.deleteEvent(!0)},cancelDeleteEvent(){this.event.deleting=!1},focusEvent(){const{focusAnEvent:e}=this.domEvents,t=e._eid;if(t!==this.event._eid){if(t){const e=this.view.events.find((e=>e._eid===t));e&&(e.focused=!1)}this.vuecal.cancelDelete(),this.vuecal.emitWithEvent("event-focus",this.event),e._eid=this.event._eid,this.event.focused=!0}}},computed:{eventDimensions(){const{startTimeMinutes:e,endTimeMinutes:t}=this.segment||this.event;let s=e-this.vuecal.timeFrom;const a=Math.max(Math.round(s*this.vuecal.timeCellHeight/this.vuecal.timeStep),0);s=Math.min(t,this.vuecal.timeTo)-this.vuecal.timeFrom;const i=Math.round(s*this.vuecal.timeCellHeight/this.vuecal.timeStep),l=Math.max(i-a,5);return{top:a,height:l}},eventStyles(){if(this.event.allDay||!this.vuecal.time||!this.event.endTimeMinutes||"month"===this.view.id||this.allDay)return{};let e=100-10*this.eventPosition,t=5*this.eventPosition,s=10*(this.eventPosition+1),a=this.event.master_task_color;if(Array.isArray(this.cellOverlaps.sameOverlaps)&&this.cellOverlaps.sameOverlaps.length){const s=this.cellOverlaps.sameOverlaps.length+1,a=this.cellOverlaps.overlaps.filter((e=>{if(!this.cellOverlaps.sameOverlaps.includes(e)&&this.allOverlaps[this.event._eid].position>this.allOverlaps[e].position)return e}));e=100/s-5,t=100/s*(this.eventPosition-a.length)+5*(this.eventPosition-a.length)/s,a.length&&(e-=a.length*(10/s),t+=5*a.length-10*a.length/s*(this.eventPosition-a.length))}this.vuecal.minEventWidth&&e<this.vuecal.minEventWidth&&(e=this.vuecal.minEventWidth,t=(100-this.vuecal.minEventWidth)/this.cellOverlaps.overlaps.length*this.eventPosition);const{top:i,height:l}=this.eventDimensions;return{background:a,"z-index":`${s}`,top:`${i}px`,height:`${l}px`,width:`${e}%`,left:this.event.left&&`${this.event.left}px`||`${t}%`}},eventClasses(){const{isFirstDay:e,isLastDay:t}=this.segment||{};return{[this.event.class]:!!this.event.class,"event-blocker":this.event.is_blocker,"vuecal__event--focus":this.event.focused,"vuecal__event--resizing":this.event.resizing,"vuecal__event--background":this.event.background,"vuecal__event--deletable":this.event.deleting,"vuecal__event--all-day":this.event.allDay,"vuecal__event--dragging":!this.event.draggingStatic&&this.event.dragging,"vuecal__event--static":this.event.dragging&&this.event.draggingStatic,"vuecal__event--multiple-days":!!this.segment,"event-start":this.segment&&e&&!t,"event-middle":this.segment&&!e&&!t,"event-end":this.segment&&t&&!e}},segment(){return this.event.segments&&this.event.segments[this.cellFormattedDate]||null},draggable(){const{draggable:e,background:t,daysCount:s}=this.event;return this.vuecal.editEvents.drag&&e&&!t&&1===s},resizable(){const{editEvents:e,time:t}=this.vuecal;return e.resize&&this.event.resizable&&t&&!this.allDay&&(!this.segment||this.segment&&this.segment.isLastDay)&&"month"!==this.view.id},dnd(){return this.modules.dnd}}};const Ho=(0,M.Z)(Zo,[["render",Uo]]);var Fo=Ho,Io={inject:["vuecal","utils","modules","view","domEvents"],components:{Event:Fo},props:{options:{type:Object,default:()=>({})},editEvents:{type:Object,required:!0},data:{type:Object,required:!0},cellSplits:{type:Array,default:()=>[]},minTimestamp:{type:[Number,null],default:null},maxTimestamp:{type:[Number,null],default:null},cellWidth:{type:[Number,Boolean],default:!1},allDay:{type:Boolean,default:!1}},data:()=>({tmUtils:O.Z,cellOverlaps:{},cellOverlapsStreak:1,timeAtCursor:null,highlighted:!1,highlightedSplit:null}),methods:{getSplitAtCursor({target:e}){const t=e.classList.contains("vuecal__cell-split");let s=t?e:this.vuecal.findAncestor(e,"vuecal__cell-split");return s&&(s=s.attributes["data-split"].value,parseInt(s).toString()===s.toString()&&(s=parseInt(s))),s||null},splitClasses(e){return{"vuecal__cell-split":!0,"vuecal__cell-split--highlighted":this.highlightedSplit===e.id,"vuecal__cell-split--weekend":e.isWeekend,[e.class]:!!e.class}},checkCellOverlappingEvents(){this.options.time&&this.eventsCount&&!this.splitsCount&&(1===this.eventsCount?(this.cellOverlaps=[],this.cellOverlapsStreak=1):[this.cellOverlaps,this.cellOverlapsStreak]=this.utils.event.checkCellOverlappingEvents(this.events,this.options))},isDOMElementAnEvent(e){return this.vuecal.isDOMElementAnEvent(e)},selectCell(e,t=!1){const s=this.splitsCount?this.getSplitAtCursor(e):null;this.utils.cell.selectCell(t,this.timeAtCursor,s),this.timeAtCursor=null},onCellkeyPressEnter(e){this.isSelected||this.onCellFocus(e);const t=this.splitsCount?this.getSplitAtCursor(e):null;this.utils.cell.keyPressEnterCell(this.timeAtCursor,t),this.timeAtCursor=null},onCellFocus(e){if(!this.isSelected&&!this.isDisabled){this.isSelected=this.data.startDate;const t=this.splitsCount?this.getSplitAtCursor(e):null,s=this.timeAtCursor||this.data.startDate;this.vuecal.$emit("cell-focus",t?{date:s,split:t}:s)}},onCellMouseDown(e,t=null,s=!1){if("ontouchstart"in window&&!s)return!1;this.isSelected||this.onCellFocus(e);const{clickHoldACell:a,focusAnEvent:i}=this.domEvents;this.domEvents.cancelClickEventCreation=!1,a.eventCreated=!1,this.timeAtCursor=new Date(this.data.startDate);const{minutes:l,cursorCoords:{y:n}}=this.vuecal.minutesAtCursor(e);this.timeAtCursor.setMinutes(l);const o=this.isDOMElementAnEvent(e.target);!o&&i._eid&&((this.view.events.find((e=>e._eid===i._eid))||{}).focused=!1),this.editEvents.create&&!o&&this.setUpEventCreation(e,n)},setUpEventCreation(e,t){if(this.options.dragToCreateEvent&&["week","day"].includes(this.view.id)){const{dragCreateAnEvent:s}=this.domEvents;if(s.startCursorY=t,s.split=this.splitsCount?this.getSplitAtCursor(e):null,s.start=this.timeAtCursor,this.options.snapToTime){let e=60*this.timeAtCursor.getHours()+this.timeAtCursor.getMinutes();const t=e+this.options.snapToTime/2;e=t-t%this.options.snapToTime,s.start.setHours(0,e,0,0)}}else this.options.cellClickHold&&["month","week","day"].includes(this.view.id)&&this.setUpCellHoldTimer(e)},setUpCellHoldTimer(e){const{clickHoldACell:t}=this.domEvents;t.cellId=`${this.vuecal._.uid}_${this.data.formattedDate}`,t.split=this.splitsCount?this.getSplitAtCursor(e):null,t.timeoutId=setTimeout((()=>{if(t.cellId&&!this.domEvents.cancelClickEventCreation){const{_eid:e}=this.utils.event.createAnEvent(this.timeAtCursor,null,t.split?{split:t.split}:{});t.eventCreated=e}}),t.timeout)},onCellTouchStart(e,t=null){this.onCellMouseDown(e,t,!0)},onCellClick(e,t){if(e.offsetY>950&&e.offsetY<1700){const s=t.date;s.setHours(Math.floor(e.offsetY/100),0,0,0);const a=new Date(s);a.setHours(s.getHours()+1);const i=Le()(s).format("HH:mm");this.$events.emit("show-menu-modal",{time:i,date:O.Z.formatDateTimeForBackend(s),employee:this.user.id}),setTimeout((()=>{this.$events.emit("add-timeblock",{id:null,start:O.Z.formatDateTimeForBackend(s),end:O.Z.formatDateTimeForBackend(a)})}),150)}this.isDOMElementAnEvent(e.target)||this.selectCell(e)},onCellDblClick(e){const t=new Date(this.data.startDate);t.setMinutes(this.vuecal.minutesAtCursor(e).minutes);const s=this.splitsCount?this.getSplitAtCursor(e):null;this.vuecal.$emit("cell-dblclick",s?{date:t,split:s}:t),this.options.dblclickToNavigate&&this.vuecal.switchToNarrowerView()},onCellContextMenu(e){e.stopPropagation(),e.preventDefault();const t=new Date(this.data.startDate),{cursorCoords:s,minutes:a}=this.vuecal.minutesAtCursor(e);t.setMinutes(a);const i=this.splitsCount?this.getSplitAtCursor(e):null;this.vuecal.$emit("cell-contextmenu",{date:t,...s,...i||{},e:e})}},computed:{...(0,z.Se)("auth",["user"]),dnd(){return this.modules.dnd},nowInMinutes(){return this.utils.date.dateToMinutes(this.vuecal.now)},isBeforeMinDate(){return null!==this.minTimestamp&&this.minTimestamp>this.data.endDate.getTime()},isAfterMaxDate(){return this.maxTimestamp&&this.maxTimestamp<this.data.startDate.getTime()},isDisabled(){const{disableDays:e}=this.options,{isYearsOrYearView:t}=this.vuecal;return!(!e.length||!e.includes(this.data.formattedDate)||t)||(this.isBeforeMinDate||this.isAfterMaxDate)},isSelected:{get(){let e=!1;const{selectedDate:t}=this.view;return e="years"===this.view.id?t.getFullYear()===this.data.startDate.getFullYear():"year"===this.view.id?t.getFullYear()===this.data.startDate.getFullYear()&&t.getMonth()===this.data.startDate.getMonth():t.getTime()===this.data.startDate.getTime(),e},set(e){this.view.selectedDate=e,this.vuecal.$emit("update:selected-date",this.view.selectedDate)}},isWeekOrDayView(){return["week","day"].includes(this.view.id)},transitionDirection(){return this.vuecal.transitionDirection},specialHours(){return this.data.specialHours.map((e=>{let{from:t,to:s}=e;return t=Math.max(t,this.options.timeFrom),s=Math.min(s,this.options.timeTo),{...e,height:(s-t)*this.timeScale,top:(t-this.options.timeFrom)*this.timeScale}}))},events(){const{startDate:e,endDate:t}=this.data;let s=[];if(!["years","year"].includes(this.view.id)||this.options.eventsCountOnYearView){if(s=this.view.events.slice(0),"month"===this.view.id&&s.push(...this.view.outOfScopeEvents),s=s.filter((s=>this.utils.event.eventInRange(s,e,t))),this.options.showAllDayEvents&&"month"!==this.view.id&&(s=s.filter((e=>!!e.allDay===this.allDay))),this.options.time&&this.isWeekOrDayView&&!this.allDay){const{timeFrom:e,timeTo:t}=this.options;s=s.filter((s=>{const a=s.daysCount>1&&s.segments[this.data.formattedDate]||{},i=1===s.daysCount&&s.startTimeMinutes<t&&s.endTimeMinutes>e,l=s.daysCount>1&&a.startTimeMinutes<t&&a.endTimeMinutes>e,n=!1;return s.allDay||i||l||n}))}!this.options.time||!this.isWeekOrDayView||this.options.showAllDayEvents&&this.allDay||s.sort(((e,t)=>e.start<t.start?-1:1)),this.cellSplits.length||this.$nextTick(this.checkCellOverlappingEvents)}return s},eventsCount(){return this.events.length},splits(){return this.cellSplits.map(((e,t)=>{const s=this.events.filter((t=>t.split===e.id)),[a,i]=this.utils.event.checkCellOverlappingEvents(s.filter((e=>!e.background&&!e.allDay)),this.options);return{...e,overlaps:a,overlapsStreak:i,events:s}}))},splitsCount(){return this.splits.length},cellClasses(){return{[this.data.class]:!!this.data.class,"vuecal__cell--current":this.data.current,"vuecal__cell--today":this.data.today,"vuecal__cell--out-of-scope":this.data.outOfScope,"vuecal__cell--before-min":this.isDisabled&&this.isBeforeMinDate,"vuecal__cell--after-max":this.isDisabled&&this.isAfterMaxDate,"vuecal__cell--disabled":this.isDisabled,"vuecal__cell--selected":this.isSelected,"vuecal__cell--highlighted":this.highlighted,"vuecal__cell--has-splits":this.splitsCount,"vuecal__cell--has-events":this.eventsCount}},cellStyles(){return{...this.cellWidth?{width:`${this.cellWidth}%`}:{}}},timelineVisible(){const{time:e,timeTo:t}=this.options;return this.data.today&&this.isWeekOrDayView&&e&&!this.allDay&&this.nowInMinutes<=t},todaysTimePosition(){if(!this.data.today||!this.options.time)return;const e=this.nowInMinutes-this.options.timeFrom;return Math.round(e*this.timeScale)},timeScale(){return this.options.timeCellHeight/this.options.timeStep}}};const Po=(0,M.Z)(Io,[["render",zo]]);var Lo=Po,No={inject:["vuecal","view","editEvents"],components:{"vuecal-cell":Lo},props:{options:{type:Object,required:!0},cells:{type:Array,required:!0},label:{type:String,required:!0},daySplits:{type:Array,default:()=>[]},shortEvents:{type:Boolean,default:!0},height:{type:String,default:""},cellOrSplitMinWidth:{type:Number,default:null}},computed:{hasCellOrSplitWidth(){return!!(this.options.minCellWidth||this.daySplits.length&&this.options.minSplitWidth)}}};const Yo=(0,M.Z)(No,[["render",Eo]]);var qo=Yo,Bo=s(15941);const Ro=1440,Ko={weekDays:Array(7).fill(""),weekDaysShort:[],months:Array(12).fill(""),years:"",year:"",month:"",week:"",day:"",today:"",noEvent:"",allDay:"",deleteEvent:"",createEvent:"",dateFormat:"dddd MMMM D, YYYY",am:"am",pm:"pm"},Jo=["years","year","month","week","day"],Go=new Rn(Ko);var Xo={name:"vue-cal",components:{"vuecal-cell":Lo,"vuecal-header":$o,WeekdaysHeadings:Mo,AllDayBar:qo},provide(){return{vuecal:this,utils:this.utils,modules:this.modules,previous:this.previous,next:this.next,switchView:this.switchView,updateSelectedDate:this.updateSelectedDate,editEvents:this.editEvents,view:this.view,domEvents:this.domEvents}},props:{activeView:{type:String,default:"week"},scrollToHour:{type:Number,default:0},allDayBarHeight:{type:[String,Number],default:"25px"},cellClickHold:{type:Boolean,default:!0},cellContextmenu:{type:Boolean,default:!1},clickToNavigate:{type:Boolean,default:!1},dblclickToNavigate:{type:Boolean,default:!0},disableDatePrototypes:{type:Boolean,default:!1},disableDays:{type:Array,default:()=>[]},disableViews:{type:Array,default:()=>[]},dragToCreateEvent:{type:Boolean,default:!0},dragToCreateThreshold:{type:Number,default:15},editableEvents:{type:[Boolean,Object],default:!1},unscheduledTime:{type:Array,default:[]},events:{type:Array,default:()=>[]},eventsCountOnYearView:{type:Boolean,default:!1},eventsOnMonthView:{type:[Boolean,String],default:!1},hideBody:{type:Boolean,default:!1},hideTitleBar:{type:Boolean,default:!1},hideViewSelector:{type:Boolean,default:!1},hideWeekdays:{type:Array,default:()=>[]},hideWeekends:{type:Boolean,default:!1},locale:{type:[String,Object],default:"en"},maxDate:{type:[String,Date],default:""},minCellWidth:{type:Number,default:0},minDate:{type:[String,Date],default:""},minEventWidth:{type:Number,default:0},minSplitWidth:{type:Number,default:0},onEventClick:{type:[Function,null],default:null},onEventCreate:{type:[Function,null],default:null},onEventDblclick:{type:[Function,null],default:null},overlapsPerTimeStep:{type:Boolean,default:!1},resizeX:{type:Boolean,default:!1},selectedDate:{type:[String,Date],default:""},showAllDayEvents:{type:[Boolean,String],default:!1},showTimeInCells:{type:Boolean,default:!1},showWeekNumbers:{type:[Boolean,String],default:!1},snapToTime:{type:Number,default:0},small:{type:Boolean,default:!1},specialHours:{type:Object,default:()=>({})},splitDays:{type:Array,default:()=>[]},startWeekOnSunday:{type:Boolean,default:!1},stickySplitLabels:{type:Boolean,default:!1},time:{type:Boolean,default:!0},timeCellHeight:{type:Number,default:40},timeFormat:{type:String,default:""},timeFrom:{type:Number,default:0},timeStep:{type:Number,default:60},timeTo:{type:Number,default:Ro},todayButton:{type:Boolean,default:!1},transitions:{type:Boolean,default:!0},twelveHour:{type:Boolean,default:!1},watchRealTime:{type:Boolean,default:!1},xsmall:{type:Boolean,default:!1}},data(){return{ready:!1,texts:{...Ko},utils:{date:!!this.disableDatePrototypes&&Go.removePrototypes()||Go,cell:null,event:null},modules:{dnd:null},cellsEl:null,view:{id:"",title:"",startDate:null,endDate:null,firstCellDate:null,lastCellDate:null,selectedDate:null,events:[]},eventIdIncrement:1,now:new Date,timeTickerIds:[null,null],domEvents:{resizeAnEvent:{_eid:null,start:null,split:null,segment:null,originalEndTimeMinutes:0,originalEnd:null,end:null,startCell:null,endCell:null},dragAnEvent:{_eid:null},dragCreateAnEvent:{startCursorY:null,start:null,split:null,event:null},focusAnEvent:{_eid:null,mousedUp:!1},clickHoldAnEvent:{_eid:null,timeout:1200,timeoutId:null},dblTapACell:{taps:0,timeout:500},clickHoldACell:{cellId:null,split:null,timeout:1200,timeoutId:null,eventCreated:!1},cancelClickEventCreation:!1},mutableEvents:[],transitionDirection:"right"}},methods:{async loadLocale(e){if("object"===typeof this.locale)return this.texts=Object.assign({},Ko,e),void this.utils.date.updateTexts(this.texts);if("en"===this.locale){const e=await s.e(3320).then(s.t.bind(s,3320,19));this.texts=Object.assign({},Ko,e)}else s(66667)(`./${e}.json`).then((e=>{this.texts=Object.assign({},Ko,e.default),this.utils.date.updateTexts(this.texts)}))},loadDragAndDrop(){s.e(1466).then(s.bind(s,91466)).then((e=>{const{DragAndDrop:t}=e;this.modules.dnd=new t(this)})).catch((()=>Bo.warn("Vue Cal: Missing drag & drop module.")))},validateView(e){return Jo.includes(e)||(Bo.error(`Vue Cal: invalid active-view parameter provided: "${e}".\nA valid view must be one of: ${Jo.join(", ")}.`),e="week"),this.enabledViews.includes(e)||(Bo.warn(`Vue Cal: the provided active-view "${e}" is disabled. Using the "${this.enabledViews[0]}" view instead.`),e=this.enabledViews[0]),e},switchToNarrowerView(e=null){this.transitionDirection="right";const t=this.enabledViews[this.enabledViews.indexOf(this.view.id)+1];t&&this.switchView(t,e)},switchView(e,t=null,s=!1){e=this.validateView(e);const a=this.utils.date,i=this.view.startDate&&this.view.startDate.getTime();if(this.transitions&&s){if(this.view.id===e)return;const t=this.enabledViews;this.transitionDirection=t.indexOf(this.view.id)>t.indexOf(e)?"left":"right"}const l=this.view.id;switch(this.view.events=[],this.view.id=e,this.view.firstCellDate=null,this.view.lastCellDate=null,t||(t=this.view.selectedDate||this.view.startDate),e){case"years":this.view.startDate=new Date(25*Math.floor(t.getFullYear()/25)||2e3,0,1),this.view.endDate=new Date(this.view.startDate.getFullYear()+25,0,1),this.view.endDate.setSeconds(-1);break;case"year":this.view.startDate=new Date(t.getFullYear(),0,1),this.view.endDate=new Date(t.getFullYear()+1,0,1),this.view.endDate.setSeconds(-1);break;case"month":{this.view.startDate=new Date(t.getFullYear(),t.getMonth(),1),this.view.endDate=new Date(t.getFullYear(),t.getMonth()+1,1),this.view.endDate.setSeconds(-1);let e=new Date(this.view.startDate);if(e.getDay()!==(this.startWeekOnSunday?0:1)&&(e=a.getPreviousFirstDayOfWeek(e,this.startWeekOnSunday)),this.view.firstCellDate=e,this.view.lastCellDate=a.addDays(e,41),this.view.lastCellDate.setHours(23,59,59,0),this.hideWeekends){if([0,6].includes(this.view.firstCellDate.getDay())){const e=6!==this.view.firstCellDate.getDay()||this.startWeekOnSunday?1:2;this.view.firstCellDate=a.addDays(this.view.firstCellDate,e)}if([0,6].includes(this.view.startDate.getDay())){const e=6===this.view.startDate.getDay()?2:1;this.view.startDate=a.addDays(this.view.startDate,e)}if([0,6].includes(this.view.lastCellDate.getDay())){const e=0!==this.view.lastCellDate.getDay()||this.startWeekOnSunday?1:2;this.view.lastCellDate=a.subtractDays(this.view.lastCellDate,e)}if([0,6].includes(this.view.endDate.getDay())){const e=0===this.view.endDate.getDay()?2:1;this.view.endDate=a.subtractDays(this.view.endDate,e)}}break}case"week":{t=a.getPreviousFirstDayOfWeek(t,this.startWeekOnSunday);const e=this.hideWeekends?5:7;this.view.startDate=this.hideWeekends&&this.startWeekOnSunday?a.addDays(t,1):t,this.view.startDate.setHours(0,0,0,0),this.view.endDate=a.addDays(t,e),this.view.endDate.setSeconds(-1);break}case"day":this.view.startDate=t,this.view.startDate.setHours(0,0,0,0),this.view.endDate=new Date(t),this.view.endDate.setHours(23,59,59,0);break}this.addEventsToView();const n=this.view.startDate&&this.view.startDate.getTime();if((l!==e||n!==i)&&(this.$emit("update:activeView",e),this.ready)){const t=this.view.startDate,s={view:e,startDate:t,endDate:this.view.endDate,...this.isMonthView?{firstCellDate:this.view.firstCellDate,lastCellDate:this.view.lastCellDate,outOfScopeEvents:this.view.outOfScopeEvents.map(this.cleanupEvent)}:{},events:this.view.events.map(this.cleanupEvent),...this.isWeekView?{week:a.getWeek(this.startWeekOnSunday?a.addDays(t,1):t)}:{}};this.$refs["vuecal_scroll"].scrollTop=this.scrollToHour*this.timeCellHeight,this.$emit("view-change",s)}},previous(){this.previousNext(!1)},next(){this.previousNext()},previousNext(e=!0){const t=this.utils.date;this.transitionDirection=e?"right":"left";const s=e?1:-1;let a=null;const{startDate:i,id:l}=this.view;switch(l){case"years":a=new Date(i.getFullYear()+25*s,0,1);break;case"year":a=new Date(i.getFullYear()+1*s,1,1);break;case"month":a=new Date(i.getFullYear(),i.getMonth()+1*s,1);break;case"week":a=t[e?"addDays":"subtractDays"](t.getPreviousFirstDayOfWeek(i,this.startWeekOnSunday),7);break;case"day":a=t[e?"addDays":"subtractDays"](i,1);const l=a.getDay(),n=this.startWeekOnSunday?l:(l||7)-1,o=this.weekDays[n].hide;if(o){const s=this.weekDays.map(((e,t)=>({...e,i:t})));let i=null,l=0;e?(i=[...s.slice(n),...s].find((e=>(l++,!e.hide))).i,l--):i=[...s,...s.slice(0,n)].reverse().find((e=>(l++,!e.hide))).i,a=t[e?"addDays":"subtractDays"](a,l)}break}a&&this.switchView(l,a)},addEventsToView(e=[]){const t=this.utils.event,{startDate:s,endDate:a,firstCellDate:i,lastCellDate:l}=this.view;if(e.length||(this.view.events=[]),e=e.length?e:[...this.mutableEvents],!e||this.isYearsOrYearView&&!this.eventsCountOnYearView)return;let n=e.filter((e=>t.eventInRange(e,s,a)));this.isYearsOrYearView||this.isMonthView&&!this.eventsOnMonthView||(n=n.map((e=>e.daysCount>1?t.createEventSegments(e,i||s,l||a):e))),this.view.events.push(...n),this.isMonthView&&(this.view.outOfScopeEvents=[],e.forEach((e=>{(t.eventInRange(e,i,s)||t.eventInRange(e,a,l))&&(this.view.events.some((t=>t._eid===e._eid))||this.view.outOfScopeEvents.push(e))})))},findAncestor(e,t){while((e=e.parentElement)&&!e.classList.contains(t));return e},isDOMElementAnEvent(e){return e.classList.contains("vuecal__event")||this.findAncestor(e,"vuecal__event")},onMouseMove(e){const{resizeAnEvent:t,dragAnEvent:s,dragCreateAnEvent:a}=this.domEvents;(null!==t._eid||null!==s._eid||a.start)&&(e.preventDefault(),t._eid?this.eventResizing(e):this.dragToCreateEvent&&a.start&&this.eventDragCreation(e))},onMouseUp(e){const{focusAnEvent:t,resizeAnEvent:s,clickHoldAnEvent:a,clickHoldACell:i,dragCreateAnEvent:l}=this.domEvents,{_eid:n}=a,{_eid:o}=s;let r=!1;const{event:d,start:u}=l,c=this.isDOMElementAnEvent(e.target),m=t.mousedUp;if(t.mousedUp=!1,c&&(this.domEvents.cancelClickEventCreation=!0),i.eventCreated)return;if(o){const{originalEnd:e,originalEndTimeMinutes:t,endTimeMinutes:a}=s,i=this.view.events.find((e=>e._eid===s._eid));if(r=a&&a!==t,i&&i.end.getTime()!==e.getTime()){const t=this.mutableEvents.find((e=>e._eid===s._eid));t.endTimeMinutes=i.endTimeMinutes,t.end=i.end;const a=this.cleanupEvent(i),l={...this.cleanupEvent(i),end:e,endTimeMinutes:i.originalEndTimeMinutes};this.$emit("event-duration-change",{event:a,oldDate:s.originalEnd,originalEvent:l}),this.$emit("event-change",{event:a,originalEvent:l})}i&&(i.resizing=!1),s._eid=null,s.start=null,s.split=null,s.segment=null,s.originalEndTimeMinutes=null,s.originalEnd=null,s.endTimeMinutes=null,s.startCell=null,s.endCell=null}else u&&(d&&(this.emitWithEvent("event-drag-create",d),l.event.resizing=!1),l.start=null,l.split=null,l.event=null);c||o||this.unfocusEvent(),a.timeoutId&&!n&&(clearTimeout(a.timeoutId),a.timeoutId=null),i.timeoutId&&(clearTimeout(i.timeoutId),i.timeoutId=null);const h="function"===typeof this.onEventClick;if(m&&!r&&!n&&!d&&h){let s=this.view.events.find((e=>e._eid===t._eid));return!s&&this.isMonthView&&(s=this.view.outOfScopeEvents.find((e=>e._eid===t._eid))),s&&this.onEventClick(s,e)}},onKeyUp(e){27===e.keyCode&&this.cancelDelete()},eventResizing(e){const{resizeAnEvent:t}=this.domEvents,s=this.view.events.find((e=>e._eid===t._eid))||{segments:{}},{minutes:a,cursorCoords:i}=this.minutesAtCursor(e),l=s.segments&&s.segments[t.segment],{date:n,event:o}=this.utils,r=Math.max(a,this.timeFrom+1,(l||s).startTimeMinutes+1);if(s.endTimeMinutes=t.endTimeMinutes=r,this.snapToTime){const e=s.endTimeMinutes+this.snapToTime/2;s.endTimeMinutes=e-e%this.snapToTime}if(l&&(l.endTimeMinutes=s.endTimeMinutes),s.end.setHours(0,s.endTimeMinutes,s.endTimeMinutes===Ro?-1:0,0),this.resizeX&&this.isWeekView){s.daysCount=n.countDays(s.start,s.end);const e=this.cellsEl,a=e.offsetWidth/e.childElementCount,l=Math.floor(i.x/a);if(null===t.startCell&&(t.startCell=l-(s.daysCount-1)),t.endCell!==l){t.endCell=l;const e=n.addDays(s.start,l-t.startCell),a=Math.max(n.countDays(s.start,e),1);if(a!==s.daysCount){let e=null;e=a>s.daysCount?o.addEventSegment(s):o.removeEventSegment(s),t.segment=e,s.endTimeMinutes+=.001}}}this.$emit("event-resizing",{_eid:s._eid,end:s.end,endTimeMinutes:s.endTimeMinutes})},eventDragCreation(e){const{dragCreateAnEvent:t}=this.domEvents,{start:s,startCursorY:a,split:i}=t,l=new Date(s),{minutes:n,cursorCoords:{y:o}}=this.minutesAtCursor(e);if(t.event||!(Math.abs(a-o)<this.dragToCreateThreshold))if(t.event){if(l.setHours(0,n,n===Ro?-1:0,0),this.snapToTime){let e=60*l.getHours()+l.getMinutes();const t=e+this.snapToTime/2;e=t-t%this.snapToTime,l.setHours(0,e,0,0)}const e=s<l,{event:a}=t;a.start=e?s:l,a.end=e?l:s,a.startTimeMinutes=60*a.start.getHours()+a.start.getMinutes(),a.endTimeMinutes=60*a.end.getHours()+a.end.getMinutes()}else{if(t.event=this.utils.event.createAnEvent(s,1,{split:i}),!t.event)return t.start=null,t.split=null,void(t.event=null);t.event.resizing=!0}},unfocusEvent(){const{focusAnEvent:e,clickHoldAnEvent:t}=this.domEvents,s=this.view.events.find((s=>s._eid===(e._eid||t._eid)));e._eid=null,t._eid=null,s&&(s.focused=!1,s.deleting=!1)},cancelDelete(){const{clickHoldAnEvent:e}=this.domEvents;if(e._eid){const t=this.view.events.find((t=>t._eid===e._eid));t&&(t.deleting=!1),e._eid=null,e.timeoutId=null}},onEventTitleBlur(e,t){if(t.title===e.target.innerHTML)return;const s=t.title;t.title=e.target.innerHTML;const a=this.cleanupEvent(t);this.$emit("event-title-change",{event:a,oldTitle:s}),this.$emit("event-change",{event:a,originalEvent:{...a,title:s}})},updateMutableEvents(){const e=this.utils.date;this.mutableEvents=[],this.events.forEach((t=>{const s="string"===typeof t.start?e.stringToDate(t.start):t.start,a=e.formatDateLite(s),i=e.dateToMinutes(s);let l=null;"string"===typeof t.end&&t.end.includes("24:00")?(l=new Date(t.end.replace(" 24:00","")),l.setHours(23,59,59,0)):l="string"===typeof t.end?e.stringToDate(t.end):t.end;let n=e.formatDateLite(l),o=e.dateToMinutes(l);o&&o!==Ro||(!this.time||"string"===typeof t.end&&10===t.end.length?l.setHours(23,59,59,0):l.setSeconds(l.getSeconds()-1),n=e.formatDateLite(l),o=Ro);const r=a!==n;t=Object.assign({...this.utils.event.eventDefaults},t,{_eid:`${this._.uid}_${this.eventIdIncrement++}`,segments:r?{}:null,start:s,startTimeMinutes:i,end:l,endTimeMinutes:o,daysCount:r?e.countDays(s,l):1,class:t.class}),this.mutableEvents.push(t)}))},minutesAtCursor(e){return this.utils.cell.minutesAtCursor(e)},createEvent(e,t,s={}){return this.utils.event.createAnEvent(e,t,s)},cleanupEvent(e){e={...e};const t=["segments","deletable","deleting","titleEditable","resizable","resizing","draggable","dragging","draggingStatic","focused"];return t.forEach((t=>{t in e&&delete e[t]})),e.repeat||delete e.repeat,e},emitWithEvent(e,t){this.$emit(e,this.cleanupEvent(t))},updateSelectedDate(e){if(e=e&&"string"===typeof e?this.utils.date.stringToDate(e):new Date(e),e&&e instanceof Date){const{selectedDate:t}=this.view;t&&(this.transitionDirection=t.getTime()>e.getTime()?"left":"right"),e.setHours(0,0,0,0),t&&t.getTime()===e.getTime()||(this.view.selectedDate=e),this.switchView(this.view.id)}this.$emit("update:selected-date",this.view.selectedDate)},getWeekNumber(e){const t=this.utils.date,s=this.firstCellDateWeekNumber,a=s+e,i=this.startWeekOnSunday?1:0;return a>52?t.getWeek(t.addDays(this.view.firstCellDate,7*e+i)):a},timeTick(){this.now=new Date,this.timeTickerIds[1]=setTimeout(this.timeTick,6e4)},updateDateTexts(){this.utils.date.updateTexts(this.texts)},alignWithScrollbar(){},cellOrSplitHasEvents(e,t=null){return e.length&&(!t&&e.length||t&&e.some((e=>e.split===t.id)))}},created(){this.utils.cell=new Jn(this),this.utils.event=new so(this,this.utils.date),this.loadLocale(this.locale),this.editEvents.drag&&this.loadDragAndDrop(),this.updateMutableEvents(this.events),this.view.id=this.currentView,this.selectedDate?this.updateSelectedDate(this.selectedDate):(this.view.selectedDate=new Date,this.switchView(this.currentView)),this.time&&this.watchRealTime&&(this.timeTickerIds[0]=setTimeout(this.timeTick,1e3*(60-this.now.getSeconds())))},mounted(){const e=this.utils.date,t="ontouchstart"in window,{resize:s,drag:a,create:i,delete:l,title:n}=this.editEvents,o=this.onEventClick&&"function"===typeof this.onEventClick;(s||a||i||l||n||o)&&window.addEventListener(t?"touchend":"mouseup",this.onMouseUp),(s||a||i&&this.dragToCreateEvent)&&window.addEventListener(t?"touchmove":"mousemove",this.onMouseMove,{passive:!1}),n&&window.addEventListener("keyup",this.onKeyUp),t&&(this.$refs.vuecal.oncontextmenu=function(e){e.preventDefault(),e.stopPropagation()});const r=this.view.startDate,d={view:this.view.id,startDate:r,endDate:this.view.endDate,...this.isMonthView?{firstCellDate:this.view.firstCellDate,lastCellDate:this.view.lastCellDate}:{},events:this.view.events.map(this.cleanupEvent),...this.isWeekView?{week:e.getWeek(this.startWeekOnSunday?e.addDays(r,1):r)}:{}};this.$refs["vuecal_scroll"].addEventListener("scroll",(()=>{this.$refs["vuecal_splits_heading"].style.top=`${this.$refs["vuecal_scroll"].scrollTop}px`})),this.viewportTimelineOffset=this.$refs["vuecal_scroll"].getBoundingClientRect().top,this.$refs["vuecal_scroll"].scrollTop=this.scrollToHour*this.timeCellHeight,this.$emit("ready",d),this.ready=!0},beforeUnmount(){const e="ontouchstart"in window;window.removeEventListener(e?"touchmove":"mousemove",this.onMouseMove,{passive:!1}),window.removeEventListener(e?"touchend":"mouseup",this.onMouseUp),window.removeEventListener("keyup",this.onKeyUp),this.timeTickerIds[0]&&clearTimeout(this.timeTickerIds[0]),this.timeTickerIds[1]&&clearTimeout(this.timeTickerIds[1]),this.timeTickerIds=[null,null]},computed:{editEvents(){return this.editableEvents&&"object"===typeof this.editableEvents?{title:!!this.editableEvents.title,drag:!!this.editableEvents.drag,resize:!!this.editableEvents.resize,create:!!this.editableEvents.create,delete:!!this.editableEvents.delete}:{title:!!this.editableEvents,drag:!!this.editableEvents,resize:!!this.editableEvents,create:!!this.editableEvents,delete:!!this.editableEvents}},views(){return{years:{label:this.texts.years,enabled:!this.disableViews.includes("years")},year:{label:this.texts.year,enabled:!this.disableViews.includes("year")},month:{label:this.texts.month,enabled:!this.disableViews.includes("month")},week:{label:this.texts.week,enabled:!this.disableViews.includes("week")},day:{label:this.texts.day,enabled:!this.disableViews.includes("day")}}},currentView(){return this.validateView(this.activeView)},enabledViews(){return Object.keys(this.views).filter((e=>this.views[e].enabled))},hasTimeColumn(){return this.time&&this.isWeekOrDayView},isShortMonthView(){return this.isMonthView&&"short"===this.eventsOnMonthView},firstCellDateWeekNumber(){const e=this.utils.date,t=this.view.firstCellDate;return e.getWeek(this.startWeekOnSunday?e.addDays(t,1):t)},timeCells(){const e=[];for(let t=this.timeFrom,s=this.timeTo;t<s;t+=this.timeStep)e.push({hours:Math.floor(t/60),minutes:t%60,label:this.utils.date.formatTime(t,this.TimeFormat),value:t});return e},TimeFormat(){return this.timeFormat||(this.twelveHour?"h:mm{am}":"HH:mm")},daySplits(){return(this.splitDays.filter((e=>!e.hide))||[]).map(((e,t)=>({...e,id:e.id||t+1})))},hasSplits(){return this.daySplits.length&&this.isWeekOrDayView},hasShortEvents(){return"short"===this.showAllDayEvents},cellOrSplitMinWidth(){let e=null;return this.hasSplits&&this.minSplitWidth?e=this.visibleDaysCount*this.minSplitWidth*this.daySplits.length:this.minCellWidth&&this.isWeekView&&(e=this.visibleDaysCount*this.minCellWidth),e},allDayBar(){let e=this.allDayBarHeight||null;return e&&!isNaN(e)&&(e+="px"),{cells:this.viewCells,options:this.$props,label:this.texts.allDay,shortEvents:this.hasShortEvents,daySplits:this.hasSplits&&this.daySplits||[],cellOrSplitMinWidth:this.cellOrSplitMinWidth,height:e}},minTimestamp(){let e=null;return this.minDate&&"string"===typeof this.minDate?e=this.utils.date.stringToDate(this.minDate):this.minDate&&this.minDate instanceof Date&&(e=this.minDate),e?e.getTime():null},maxTimestamp(){let e=null;return this.maxDate&&"string"===typeof this.maxDate?e=this.utils.date.stringToDate(this.maxDate):this.maxDate&&this.minDate instanceof Date&&(e=this.maxDate),e?e.getTime():null},weekDays(){let{weekDays:e,weekDaysShort:t=[]}=this.texts;return e=e.slice(0).map(((e,s)=>({label:e,...t.length?{short:t[s]}:{},hide:this.hideWeekends&&s>=5||this.hideWeekdays.length&&this.hideWeekdays.includes(s+1)}))),this.startWeekOnSunday&&e.unshift(e.pop()),e},weekDaysInHeader(){return this.isMonthView||this.isWeekView&&!this.minCellWidth&&!(this.hasSplits&&this.minSplitWidth)},months(){return this.texts.months.map((e=>({label:e})))},specialDayHours(){return this.specialHours&&Object.keys(this.specialHours).length?Array(7).fill("").map(((e,t)=>{let s=this.specialHours[t+1]||[];return Array.isArray(s)||(s=[s]),e=[],s.forEach((({from:s,to:a,class:i,label:l},n)=>{e[n]={day:t+1,from:[null,void 0].includes(s)?null:1*s,to:[null,void 0].includes(a)?null:1*a,class:i||"",label:l||""}})),e})):{}},viewTitle(){const e=this.utils.date;let t="";const s=this.view.startDate,a=s.getFullYear(),i=s.getMonth();switch(this.view.id){case"years":t=this.texts.years;break;case"year":t=a;break;case"month":t=`${this.months[i].label} ${a}`;break;case"week":{const a=this.view.endDate,i=s.getFullYear();let l=this.texts.months[s.getMonth()];this.xsmall&&(l=l.substring(0,3));let n=`${l} ${i}`;if(a.getMonth()!==s.getMonth()){const e=a.getFullYear();let t=this.texts.months[a.getMonth()];this.xsmall&&(t=t.substring(0,3)),n=i===e?`${l} - ${t} ${i}`:this.small?`${l.substring(0,3)} ${i} - ${t.substring(0,3)} ${e}`:`${l} ${i} - ${t} ${e}`}t=`${this.texts.week} ${e.getWeek(this.startWeekOnSunday?e.addDays(s,1):s)} (${n})`;break}case"day":t=this.utils.date.formatDate(s,this.texts.dateFormat,this.texts);break}return t},viewCells(){const e=this.utils.date;let t=[],s=null,a=!1;this.watchRealTime||(this.now=new Date);const i=this.now;switch(this.view.id){case"years":s=this.view.startDate.getFullYear(),t=Array.apply(null,Array(25)).map(((t,a)=>{const l=new Date(s+a,0,1),n=new Date(s+a+1,0,1);return n.setSeconds(-1),{startDate:l,formattedDate:e.formatDateLite(l),endDate:n,content:s+a,current:s+a===i.getFullYear()}}));break;case"year":s=this.view.startDate.getFullYear(),t=Array.apply(null,Array(12)).map(((t,a)=>{const l=new Date(s,a,1),n=new Date(s,a+1,1);return n.setSeconds(-1),{startDate:l,formattedDate:e.formatDateLite(l),endDate:n,content:this.xsmall?this.months[a].label.substr(0,3):this.months[a].label,current:a===i.getMonth()&&s===i.getFullYear()}}));break;case"month":{const s=this.view.startDate.getMonth(),i=new Date(this.view.firstCellDate);a=!1,t=Array.apply(null,Array(42)).map(((t,l)=>{const n=e.addDays(i,l),o=new Date(n);o.setHours(23,59,59,0);const r=!a&&e.isToday(n)&&!a++;return{startDate:n,formattedDate:e.formatDateLite(n),endDate:o,content:n.getDate(),today:r,outOfScope:n.getMonth()!==s,class:`vuecal__cell--day${n.getDay()||7}`}})),(this.hideWeekends||this.hideWeekdays.length)&&(t=t.filter((e=>{const t=e.startDate.getDay()||7;return!(this.hideWeekends&&t>=6||this.hideWeekdays.length&&this.hideWeekdays.includes(t))})));break}case"week":{a=!1;let s=this.view.startDate;const i=this.weekDays;t=i.map(((t,i)=>{const l=e.addDays(s,this.startWeekOnSunday?i-1:i),n=new Date(l);n.setHours(23,59,59,0);const o=(l.getDay()||7)-1;return{startDate:l,formattedDate:e.formatDateLite(l),endDate:n,today:!a&&e.isToday(l)&&!a++,specialHours:this.specialDayHours[o]||[]}})).filter(((e,t)=>!i[t].hide));break}case"day":{const s=this.view.startDate,a=new Date(this.view.startDate);a.setHours(23,59,59,0);const i=(s.getDay()||7)-1;t=[{startDate:s,formattedDate:e.formatDateLite(s),endDate:a,today:e.isToday(s),specialHours:this.specialDayHours[i]||[]}];break}}return t},visibleDaysCount(){return this.isDayView?1:7-this.weekDays.reduce(((e,t)=>e+t.hide),0)},cellWidth(){return 100/this.visibleDaysCount},cssClasses(){const{resizeAnEvent:e,dragAnEvent:t,dragCreateAnEvent:s}=this.domEvents;return{[`vuecal--${this.view.id}-view`]:!0,[`vuecal--${this.locale}`]:this.locale,"vuecal--no-time":!this.time,"vuecal--view-with-time":this.hasTimeColumn,"vuecal--week-numbers":this.showWeekNumbers&&this.isMonthView,"vuecal--twelve-hour":this.twelveHour,"vuecal--click-to-navigate":this.clickToNavigate,"vuecal--hide-weekends":this.hideWeekends,"vuecal--split-days":this.hasSplits,"vuecal--sticky-split-labels":this.hasSplits&&this.stickySplitLabels,"vuecal--overflow-x":this.minCellWidth&&this.isWeekView||this.hasSplits&&this.minSplitWidth,"vuecal--small":this.small,"vuecal--xsmall":this.xsmall,"vuecal--resizing-event":e._eid,"vuecal--drag-creating-event":s.event,"vuecal--dragging-event":t._eid,"vuecal--events-on-month-view":this.eventsOnMonthView,"vuecal--short-events":this.isMonthView&&"short"===this.eventsOnMonthView,"vuecal--has-touch":"undefined"!==typeof window&&"ontouchstart"in window}},isYearsOrYearView(){return["years","year"].includes(this.view.id)},isYearsView(){return"years"===this.view.id},isYearView(){return"year"===this.view.id},isMonthView(){return"month"===this.view.id},isWeekOrDayView(){return["week","day"].includes(this.view.id)},isWeekView(){return"week"===this.view.id},isDayView(){return"day"===this.view.id}},watch:{events:{handler(e,t){this.updateMutableEvents(e),this.addEventsToView()},deep:!0},locale(e){this.loadLocale(e)},selectedDate(e){this.updateSelectedDate(e)},activeView(e){this.switchView(e)}}};const Qo=(0,M.Z)(Xo,[["render",In]]);var er=Qo,tr={install:e=>{e.component("Vue-cal",er)}};s(48851),s(1292),s(81633),s(51045),s(46187),s(22299),s(93423),s(54687),s(49147),s(6250);l();const sr={axios:{disabled:!0},i18n:{languages:[{title:"Slovenský",flag:"sk",value:"sk"}],defaultLanguage:"sk"},moxios:{routes:{"GET v1/overview/teams":!0,"GET v1/overview/tasks":!0}}},ar=(0,a.ri)(kl).use(yl).use(gl).use(un).use(nn,sr).use(i.oX).use(o).use(tr).use(mn).use(d(),{color:"#6200EE"}).mount("#app"),ir=ar.$i18n.t},7648:function(e,t,s){"use strict";var a=s(79456);t["Z"]={parseErrors(e){return Object.values(e).map((e=>(0,a.$t)(e?.$message))).join(". ")}}},83299:function(e,t){"use strict";t["Z"]={methods:{customFilter(e,t){const s=e.normalize("NFD").replace(/[\u0300-\u036f]/g,""),a=t.normalize("NFD").replace(/[\u0300-\u036f]/g,""),i=/[^a-zA-Z0-9 ]/g,l=s.replace(i,""),n=a.replace(i,"");return l.toLowerCase().includes(n.toLowerCase())||""===e}}}},34407:function(e,t,s){"use strict";var a=s(36797),i=s.n(a);t["Z"]={enrichEmployees(e){return e.map((e=>({...e,_fullName:`${e.name} ${e.surname}`,_initials:e.name.charAt(0)+e.surname.charAt(0)})))},formatDateTime(e){return i()(e),i()(e).format("DD.MM.yyyy, HH:mm")},formatDateTimeForBackend(e){return i()(e).format("YYYY-MM-DD HH:mm:ss")},formatDate(e){return i()(e).format("DD.MM.yyyy")},isBefore(e,t=null){return i()(e).isBefore(i()(t))},isAfter(e,t=i()()){return i()(e).isAfter(i()(t))}}},8973:function(e,t,s){var a={"./en.json":20790,"./sk.json":71941};function i(e){var t=l(e);return s(t)}function l(e){if(!s.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}i.keys=function(){return Object.keys(a)},i.resolve=l,e.exports=i,i.id=8973},66667:function(e,t,s){var a={"./ar.json":[68568,8568],"./bg.json":[20684,684],"./bn.json":[61170,1170],"./bs.json":[41161,1161],"./ca.json":[40612,612],"./cs.json":[50213,213],"./da.json":[98542,8542],"./de.json":[4701,4701],"./el.json":[20453,453],"./en.json":[3320,3320],"./es.json":[60076,76],"./et.json":[44075,4075],"./fa.json":[69004,9004],"./fr.json":[60007,7],"./he.json":[23746,3746],"./hr.json":[92921,2921],"./hu.json":[75723,5723],"./id.json":[12502,2502],"./is.json":[13214,3214],"./it.json":[51380,1380],"./ja.json":[72484,2484],"./ka.json":[60285,285],"./ko.json":[79249,9249],"./lt.json":[42838,2838],"./mn.json":[6177,6177],"./nl.json":[99729,9729],"./no.json":[49409,9409],"./pl.json":[25409,5409],"./pt-br.json":[74529,4529],"./ro.json":[29715,9715],"./ru.json":[32113,2113],"./sk.json":[30229,229],"./sl.json":[28636,8636],"./sq.json":[204,204],"./sr.json":[55553,5553],"./sv.json":[75979,5979],"./tr.json":[5268,5268],"./uk.json":[14057,4057],"./vi.json":[88929,8929],"./zh-cn.json":[56730,6730],"./zh-hk.json":[30841,841]};function i(e){if(!s.o(a,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=a[e],i=t[0];return s.e(t[1]).then((function(){return s.t(i,19)}))}i.keys=function(){return Object.keys(a)},i.id=66667,e.exports=i},27484:function(e,t,s){"use strict";e.exports=s.p+"img/bin.8778f5be.svg"},53830:function(e,t,s){"use strict";e.exports=s.p+"img/checkmark.76754510.svg"},34413:function(e,t,s){"use strict";e.exports=s.p+"img/eye.6d5fa7d3.svg"},60666:function(e,t,s){"use strict";e.exports=s.p+"img/pencil.b9009162.svg"},14214:function(e,t,s){"use strict";e.exports=s.p+"img/spinner.34fd3cb2.gif"},20790:function(e){"use strict";e.exports=JSON.parse('{"Value is not a valid email address":"Value is not a valid email address","error":"chyba","Value is required":"Pole je povinné","This field should be at least 8 characters long":"Pole musí obsahovať aspoň 8 znakov","This field should be at least 6 characters long":"Pole musí obsahovať aspoň 6 znakov","This maximum length allowed is 6":"Pole musí obsahovať 6 znakov","The value must be equal to the other value":"Heslá sa nezhodujú"}')},71941:function(e){"use strict";e.exports=JSON.parse('{"Value is not a valid email address":"Zadali ste neplatný email","error":"chyba","Value is required":"Pole je povinné","This field should be at least 8 characters long":"Pole musí obsahovať aspoň 8 znakov","This field should be at least 6 characters long":"Pole musí obsahovať aspoň 6 znakov","This maximum length allowed is 6":"Pole musí obsahovať 6 znakov","The value must be equal to the other value":"Heslá sa nezhodujú"}')}},t={};function s(a){var i=t[a];if(void 0!==i)return i.exports;var l=t[a]={id:a,loaded:!1,exports:{}};return e[a].call(l.exports,l,l.exports,s),l.loaded=!0,l.exports}s.m=e,function(){var e=[];s.O=function(t,a,i,l){if(!a){var n=1/0;for(u=0;u<e.length;u++){a=e[u][0],i=e[u][1],l=e[u][2];for(var o=!0,r=0;r<a.length;r++)(!1&l||n>=l)&&Object.keys(s.O).every((function(e){return s.O[e](a[r])}))?a.splice(r--,1):(o=!1,l<n&&(n=l));if(o){e.splice(u--,1);var d=i();void 0!==d&&(t=d)}}return t}l=l||0;for(var u=e.length;u>0&&e[u-1][2]>l;u--)e[u]=e[u-1];e[u]=[a,i,l]}}(),function(){s.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return s.d(t,{a:t}),t}}(),function(){var e,t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__};s.t=function(a,i){if(1&i&&(a=this(a)),8&i)return a;if("object"===typeof a&&a){if(4&i&&a.__esModule)return a;if(16&i&&"function"===typeof a.then)return a}var l=Object.create(null);s.r(l);var n={};e=e||[null,t({}),t([]),t(t)];for(var o=2&i&&a;"object"==typeof o&&!~e.indexOf(o);o=t(o))Object.getOwnPropertyNames(o).forEach((function(e){n[e]=function(){return a[e]}}));return n["default"]=function(){return a},s.d(l,n),l}}(),function(){s.d=function(e,t){for(var a in t)s.o(t,a)&&!s.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})}}(),function(){s.f={},s.e=function(e){return Promise.all(Object.keys(s.f).reduce((function(t,a){return s.f[a](e,t),t}),[]))}}(),function(){s.u=function(e){return"js/"+e+"."+{7:"7cef58a7",76:"9977e9df",188:"5e35d228",204:"4dd3d03d",213:"c9ed5252",229:"b09f2145",285:"6a0985b5",453:"04d72c77",612:"4ea201aa",684:"017ebeb8",702:"a81b006f",841:"65cae984",1161:"59a7c68b",1170:"16217940",1380:"fc40de11",1466:"92176aab",1474:"298559eb",2113:"2a1bcdfa",2484:"6def3002",2502:"66addef9",2682:"450e8cc1",2838:"aa69ee5c",2891:"34d8f387",2921:"b5aad8e9",3214:"72d306e7",3311:"bcab8a66",3320:"fe7033d0",3657:"e558064c",3728:"3e558208",3746:"09ee0424",4057:"4b3b38fd",4060:"57ab5ec4",4075:"2d83f71e",4481:"578b8c0f",4529:"6ff3334b",4701:"e34c277a",5268:"5d463fbd",5409:"4ce439c3",5553:"032fcbe7",5723:"09853a5d",5728:"07cf4ea4",5867:"61e23b49",5979:"385e1b41",6177:"12db94aa",6730:"61289e01",6811:"83d9b8d2",7073:"dc374d33",7343:"1e290ed5",7637:"fdf639b1",8024:"bb377405",8520:"cb7009ea",8542:"09badcc3",8568:"7f0dfd32",8636:"2a90cf11",8724:"6e52feba",8731:"8acb20fc",8929:"ea6da50f",8990:"6dd37151",9004:"ffe04245",9229:"e0c6161a",9249:"d2b0f88c",9409:"339f5afb",9715:"21ca1afa",9729:"812aea5b",9983:"657ab52d"}[e]+".js"}}(),function(){s.miniCssF=function(e){return"css/"+e+"."+{188:"37c2c58b",1474:"bc127aa4",2682:"c32340b5",2891:"e49646e6",4060:"75a1fa96",4481:"8c582369",6811:"7fe02c8d",7073:"3978ef96",8724:"fcc39938",9229:"811d346c",9983:"8667b7b1"}[e]+".css"}}(),function(){s.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()}(),function(){s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){var e={},t="jandl:";s.l=function(a,i,l,n){if(e[a])e[a].push(i);else{var o,r;if(void 0!==l)for(var d=document.getElementsByTagName("script"),u=0;u<d.length;u++){var c=d[u];if(c.getAttribute("src")==a||c.getAttribute("data-webpack")==t+l){o=c;break}}o||(r=!0,o=document.createElement("script"),o.charset="utf-8",o.timeout=120,s.nc&&o.setAttribute("nonce",s.nc),o.setAttribute("data-webpack",t+l),o.src=a),e[a]=[i];var m=function(t,s){o.onerror=o.onload=null,clearTimeout(h);var i=e[a];if(delete e[a],o.parentNode&&o.parentNode.removeChild(o),i&&i.forEach((function(e){return e(s)})),t)return t(s)},h=setTimeout(m.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=m.bind(null,o.onerror),o.onload=m.bind(null,o.onload),r&&document.head.appendChild(o)}}}(),function(){s.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}}(),function(){s.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e}}(),function(){s.p="/"}(),function(){var e=function(e,t,s,a){var i=document.createElement("link");i.rel="stylesheet",i.type="text/css";var l=function(l){if(i.onerror=i.onload=null,"load"===l.type)s();else{var n=l&&("load"===l.type?"missing":l.type),o=l&&l.target&&l.target.href||t,r=new Error("Loading CSS chunk "+e+" failed.\n("+o+")");r.code="CSS_CHUNK_LOAD_FAILED",r.type=n,r.request=o,i.parentNode.removeChild(i),a(r)}};return i.onerror=i.onload=l,i.href=t,document.head.appendChild(i),i},t=function(e,t){for(var s=document.getElementsByTagName("link"),a=0;a<s.length;a++){var i=s[a],l=i.getAttribute("data-href")||i.getAttribute("href");if("stylesheet"===i.rel&&(l===e||l===t))return i}var n=document.getElementsByTagName("style");for(a=0;a<n.length;a++){i=n[a],l=i.getAttribute("data-href");if(l===e||l===t)return i}},a=function(a){return new Promise((function(i,l){var n=s.miniCssF(a),o=s.p+n;if(t(n,o))return i();e(a,o,i,l)}))},i={4826:0};s.f.miniCss=function(e,t){var s={188:1,1474:1,2682:1,2891:1,4060:1,4481:1,6811:1,7073:1,8724:1,9229:1,9983:1};i[e]?t.push(i[e]):0!==i[e]&&s[e]&&t.push(i[e]=a(e).then((function(){i[e]=0}),(function(t){throw delete i[e],t})))}}(),function(){var e={4826:0};s.f.j=function(t,a){var i=s.o(e,t)?e[t]:void 0;if(0!==i)if(i)a.push(i[2]);else{var l=new Promise((function(s,a){i=e[t]=[s,a]}));a.push(i[2]=l);var n=s.p+s.u(t),o=new Error,r=function(a){if(s.o(e,t)&&(i=e[t],0!==i&&(e[t]=void 0),i)){var l=a&&("load"===a.type?"missing":a.type),n=a&&a.target&&a.target.src;o.message="Loading chunk "+t+" failed.\n("+l+": "+n+")",o.name="ChunkLoadError",o.type=l,o.request=n,i[1](o)}};s.l(n,r,"chunk-"+t,t)}},s.O.j=function(t){return 0===e[t]};var t=function(t,a){var i,l,n=a[0],o=a[1],r=a[2],d=0;if(n.some((function(t){return 0!==e[t]}))){for(i in o)s.o(o,i)&&(s.m[i]=o[i]);if(r)var u=r(s)}for(t&&t(a);d<n.length;d++)l=n[d],s.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return s.O(u)},a=self["webpackChunkjandl"]=self["webpackChunkjandl"]||[];a.forEach(t.bind(null,0)),a.push=t.bind(null,a.push.bind(a))}();var a=s.O(void 0,[4998],(function(){return s(79456)}));a=s.O(a)})();
//# sourceMappingURL=index.281a5bc0.js.map