PageSourceSearch

https://vogsy.io/chunk-PFFOXKZG.js

js vogsy.io collected 2026-09-24 14:03:32 UTC 84,005 bytes, 1 lines download raw bytes

1import{a as Ye,b as Je}from"./chunk-GDKMH3FV.js";import{a as Zt}from"./chunk-HCTYKDEU.js";import"./chunk-NI42O7QN.js";import{c as Jt}from"./chunk-5LMVHGU2.js";import{a as ti,b as qe}from"./chunk-AH7ZDCWD.js";import{a as V}from"./chunk-ZRT5G4SK.js";import{b as te}from"./chunk-FEOLTPW5.js";import{a as Qt}from"./chunk-53JQAJDS.js";import{a as Ge}from"./chunk-2T56KDEP.js";import"./chunk-5RQYVCTH.js";import{a as $e}from"./chunk-XMUZZX6O.js";import{c as qt,d as Yt}from"./chunk-YCYC46YN.js";import{a as ze}from"./chunk-7NPBDJLE.js";import{a as He}from"./chunk-CSGAFPB6.js";import"./chunk-G3ZY5E4O.js";import{a as Xt}from"./chunk-XDUEBF4K.js";import{a as ee}from"./chunk-BGTJYPVE.js";import{a as H}from"./chunk-MRNJACY4.js";import{a as be}from"./chunk-ER42TLKK.js";import{a as Z}from"./chunk-346IYELC.js";import{a as Kt}from"./chunk-L3KO3TD3.js";import"./chunk-5T5RNAUF.js";import{b as ei}from"./chunk-EDSZRM7A.js";import"./chunk-5Z7KTPG2.js";import{a as L}from"./chunk-GXWST4HK.js";import{a as St}from"./chunk-VEQMWE2X.js";import"./chunk-SMM55DX6.js";import"./chunk-TOL5YAT4.js";import{b as ke}from"./chunk-LSMZGR2R.js";import"./chunk-7VQDCOHM.js";import{c as F}from"./chunk-R5HE3Q4F.js";import{a as Ce}from"./chunk-7OSRK7JP.js";import{a as Be}from"./chunk-ALCMZTRP.js";import"./chunk-Y7LJYNRK.js";import{b as E,c as q}from"./chunk-W7CQW3BV.js";import{a as N}from"./chunk-OPR6L4PC.js";import{$ as Ot,A as Se,Ab as zt,B as Te,C as Y,Da as je,E as Me,F as Tt,Ga as Re,H as J,Ha as X,I as Ee,Jb as Gt,K as Mt,Ka as Ut,Ma as Ne,O as Oe,P as Ie,Pa as We,Q as Pe,Sa as Ht,T as Ae,U as K,V as we,W as Q,Y as kt,aa as It,ba as De,c as Ct,ca as Fe,da as Pt,f as z,g as xt,ga as At,ha as wt,i as _e,ia as Le,j as fe,ja as Ve,k as bt,ka as Dt,l as rt,la as Ft,ma as Lt,n as xe,na as Vt,oa as jt,pa as Rt,qa as Nt,qb as Ue,rb as Bt,ua as Wt,zb as $t}from"./chunk-VSZTDTRQ.js";import{$ as ut,Ac as yt,Ba as ae,Cc as M,Db as p,Dc as $,Ec as P,Fb as h,Gb as w,Ib as b,J as de,Jb as S,Kb as m,Lb as a,Mb as r,Nb as u,O as pt,S as ht,Td as j,Ub as T,Vd as A,Wb as g,Wd as R,Yb as c,Za as o,a as mt,ad as _t,b as dt,ca as oe,db as v,dd as U,de as Et,gc as D,ic as G,jb as k,kb as he,kc as l,la as pe,lc as y,mb as vt,mc as C,n as ce,nc as B,oc as gt,pc as ue,qc as ve,qd as ft,rc as ge,ta as _,tc as ye,ua as f,x as me,yc as I,zb as re,zc as at}from"./chunk-VTX3EZ75.js";function Si(t,s){if(t&1&&(a(0,"div",9),u(1,"mat-icon",11),l(2),r()),t&2){let e=c();o(),m("inline",!0),o(),C(" ",e.timesheetActivity.task.title," ")}}function Ti(t,s){if(t&1&&(a(0,"div",12)(1,"h4",13)(2,"div",14),l(3),r(),a(4,"div",15),l(5),r(),a(6,"div",16),l(7),M(8,"vyDate"),r()(),a(9,"h3",17),l(10),a(11,"span",18),l(12,"h."),r()(),a(13,"div",5),l(14),r()()),t&2){let e=c().$implicit;o(3),y(e.name.substr(0,3)),o(2),y(e.name),o(2),y(P(8,5,e.date,"dd/MM")),o(3),C(" ",e.hours),o(4),y(e.reference)}}function Mi(t,s){if(t&1&&(a(0,"li"),p(1,Ti,15,8,"div",12),r()),t&2){let e=s.$implicit;o(),h(e.reference?1:-1)}}var ii=(()=>{class t{constructor(e,i){this.dialogRef=e,this.data=i}ngOnInit(){this.timesheetActivity=this.data.timesheetActivity}closeDialog(){this.dialogRef.close()}static{this.\u0275fac=function(i){return new(i||t)(v(Se),v(Te))}}static{this.\u0275cmp=k({type:t,selectors:[["vy-timesheet-notes-overview-dialog"]],standalone:!1,decls:21,vars:7,consts:[[1,"vy-layout-row","vy-layout-align-space-between-center","vy-dialog-toolbar"],["mat-icon-button","","tabindex","-1",3,"click"],["svgIcon","close"],[1,"vy-layout-row","vy-layout-gap-l"],[3,"size","entity"],[1,"vy-flex"],[1,"vy-one-line","mat-caption","tc-gray-500"],[1,"vy-one-line"],[1,"vy-one-line","vy-strong"],[1,"vy-one-line","mat-caption","tc-accent"],["ngClass.xs","phone",1,"list"],["svgIcon","checkbox-marked-circle-outline",1,"icon-small",3,"inline"],[1,"vy-layout-row","vy-layout-align-start-start","vy-layout-gap-l"],[1,"day-date"],["fxHide.gt-xs",""],["fxHide.xs",""],[1,"mat-caption","tc-gray-500"],[1,"hours"],[1,"mat-body-2","tc-gray-500"]],template:function(i,n){i&1&&(a(0,"div",0)(1,"h2"),l(2,"Notes per day"),r(),a(3,"button",1),g("click",function(){return n.closeDialog()}),u(4,"mat-icon",2),r()(),a(5,"mat-dialog-content")(6,"div",3),u(7,"vy-avatar-image",4),a(8,"div",5)(9,"div",6),l(10),r(),a(11,"div",7),l(12),r(),a(13,"div",7),l(14),r(),a(15,"div",8),l(16),r(),p(17,Si,3,2,"div",9),r()(),a(18,"ul",10),b(19,Mi,2,1,"li",null,w),r()()),i&2&&(o(7),m("size",64)("entity",n.timesheetActivity.project),o(3),y(n.timesheetActivity.project.organizationName),o(2),y(n.timesheetActivity.project.name),o(2),y(n.timesheetActivity.deliverable.name),o(2),y(n.timesheetActivity.resourceAllocation.activity.name),o(),h(n.timesheetActivity.task?17:-1),o(2),S(n.timesheetActivity.days))},dependencies:[R,A,J,j,Me,F,L],styles:[".list[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]{margin-top:8px!important;margin-bottom:8px!important}.list[_ngcontent-%COMP%]{margin-top:16px!important}
1h3[_ngcontent-%COMP%], h4[_ngcontent-%COMP%]{margin-bottom:0!important}.list[_ngcontent-%COMP%]{margin:0;padding:0;list-style:none}.day-date[_ngcontent-%COMP%]{width:76px}.phone[_ngcontent-%COMP%]   .day-date[_ngcontent-%COMP%]{width:36px}.hours[_ngcontent-%COMP%]{width:48px;text-align:right}"]})}}return t})();var Ai=["timesheetActivity",""],wi=t=>({clickable:t}),ri=t=>["/task",t],Di=(t,s)=>({"vy-layout-wrap":t,"vy-clickable":s}),Fi=(t,s)=>({"tc-gray-500":t,"tc-accent":s}),Li=t=>({"text-holiday":t}),Vi=(t,s,e)=>({"vy-status-draft":t,"vy-status-submitted":s,"vy-status-approved":e});function ji(t,s){if(t&1&&(a(0,"div",23)(1,"a",25),u(2,"mat-icon",26),l(3),r()()),t&2){let e=c(3);o(),m("routerLink",I(3,ri,e.timesheetActivity.task.id)),o(),m("inline",!0),o(),C(" ",e.timesheetActivity.task.title," ")}}function Ri(t,s){if(t&1&&(p(0,ji,4,5,"div",23),a(1,"div",24),l(2),r()),t&2){let e=c(2);h(e.timesheetActivity.task?0:-1),o(2),y(e.timesheetActivity.resourceAllocation.activity.name)}}function Ni(t,s){if(t&1&&(a(0,"div",23)(1,"a",25),u(2,"mat-icon",26),l(3),r()()),t&2){let e=c(3);o(),m("routerLink",I(3,ri,e.timesheetActivity.task.id)),o(),m("inline",!0),o(),C(" ",e.timesheetActivity.task.title," ")}}function Wi(t,s){if(t&1&&(a(0,"div",24),l(1),r(),p(2,Ni,4,5,"div",23)),t&2){let e=c(2);o(),y(e.timesheetActivity.resourceAllocation.activity.name),o(),h(e.timesheetActivity.task?2:-1)}}function Ui(t,s){if(t&1&&l(0),t&2){let e=c(3);C(" PO #",e.timesheetActivity.purchaseOrder.purchaseOrderNumber," ")}}function Hi(t,s){t&1&&l(0," PO ")}function Bi(t,s){if(t&1&&(l(0),M(1,"vyNumber"),M(2,"vyNumber")),t&2){let e=c(3);B(" \xB7 ",P(1,2,e.timesheetActivity.purchaseOrder.totalTimeEntryHours||0,"1.2-2"),"h / ",P(2,5,e.timesheetActivity.purchaseOrder.hours||0,"1.2-2"),"h ")}}function $i(t,s){if(t&1&&(a(0,"div",19),u(1,"mat-icon",27),p(2,Ui,1,1)(3,Hi,1,0),p(4,Bi,3,8),r()),t&2){let e=c(2);o(),m("inline",!0),o(),h(e.timesheetActivity.purchaseOrder.purchaseOrderNumber?2:3),o(2),h(e.timesheetActivity.purchaseOrder.type==="hours"?4:-1)}}function zi(t,s){if(t&1){let e=T();a(0,"button",33),g("click",function(){_(e);let n=c(3);return f(n.startTimer(!1))}),u(1,"mat-icon",34),r()}if(t&2){let e=c(3);m("disabled",e.timesheetActivity.timer&&e.timesheetActivity.timer.maxHours>=0&&e.timesheetActivity.timer.maxHours-e.newHours===0||e.isTimerDisabled||e.isInEditingMode),o(),m("svgIcon",e.timesheetActivity.days[e.todayIndex].hours===0||e.timesheetActivity.days[e.todayIndex].isFromPlanning?"play":"play-pause")}}function Gi(t,s){if(t&1&&(a(0,"div",30),l(1),M(2,"vyNumber"),r()),t&2){let e=c(3);o(),C(" Limited to ",P(2,1,e.timesheetActivity.timer.maxHours-e.newHours,"1.2-2"),"h. ")}}function qi(t,s){if(t&1&&(a(0,"div",31),l(1),r()),t&2){let e=c(3);o(),y(e.timerValue)}}function Yi(t,s){if(t&1){let e=T();a(0,"button",35),g("click",function(){_(e);let n=c(3);return f(n.stopTimer())}),u(1,"mat-icon",36),r()}if(t&2){let e=c(3);m("disabled",e.isTimerDisabled)}}function Ji(t,s){if(t&1&&(a(0,"div",28),p(1,zi,2,2,"button",29),p(2,Gi,3,4,"div",30),p(3,qi,2,1,"div",31),r(),p(4,Yi,2,1,"button",32)),t&2){let e=c(2);o(),h(e.isTimerActive?-1:1),o(),h(e.isTimerActive&&e.timesheetActivity.timer&&e.timesheetActivity.timer.maxHours>=0&&e.timesheetActivity.timer.maxHours<=24?2:-1),o(),h(!e.isTimerActive&&e.timerValue?3:-1),o(),h(e.isTimerActive?4:-1)}}function Ki(t,s){if(t&1){let e=T();a(0,"div",2)(1,"vy-avatar-image",15),g("click",function(){_(e);let n=c();return f(n.goToProject())}),r(),a(2,"div",16)(3,"div",17),l(4),r(),a(5,"h3",18),l(6),r(),a(7,"div",18),l(8),r(),p(9,Ri,3,2)(10,Wi,3,2),p(11,$i,5,3,"div",19),r(),a(12,"div",20),p(13,Ji,5,4),a(14,"button",21),u(15,"mat-icon",22),r()()()}if(t&2){let e=c(),i=D(2);o(),m("size",56)("entity",e.timesheetActivity.project)("ngClass",I(11,wi,e.currentUser.isFullUser)),o(3),y(e.timesheetActivity.project.organizationName),o(2),y(e.timesheetActivity.project.name),o(2),y(e.deliverable==null?null:e.deliverable.name),o(),h(e.isBudgetsByTasksEnabled?9:10),o(2),h(e.timesheetActivity.purchaseOrder?11:-1),o(2),h(e.canUseTimer&&!e.timesheetActivity.project.isClosed?13:-1),o(),m("matMenuTriggerFor",i)("disabled",e.isInEditingMode)}}function Qi(t,s){if(t&1){let e=T();a(0,"a",37),g("click",function(){_(e);let n=c();return f(n.editEntryOrOpenNotes(n.timesheetActivity))}),u(1,"mat-icon",38),a(2,"span"),l(3,"View time entry notes"),r()()}}function Xi(t,s){if(t&1&&(a(0,"div",9),u(1,"div",39),a(2,"div",16)(3,"div",40),l(4,"Time-off/non-billable"),r(),a(5,"h3",41),l(6),r()(),a(7,"button",42),u(8,"mat-icon",22),r()()),t&2){let e=c(),i=D(14);o(6),y(e.timesheetActivity.absenceType.name),o(),m("disabled",e.isInEditingMode)("matMenuTriggerFor",i)}}function Zi(t,s){if(t&1&&(a(0,"div",11),u(1,"div",43),a(2,"div",16)(3,"small",18),l(4),r()()()),t&2){let e=c();o(4),C("\u2014",e.timesheetActivity.reference)}}function en(t,s){t&1&&u(0,"div",46)}function tn(t,s){if(t&1&&(a(0,"small"),l(1),r()),t&2){let e=c(4);o(),y(e.timerValue)}}function nn(t,s){if(t&1&&(a(0,"h3"),l(1),r()),t&2){let e=c(3).$implicit;o(),y(e.hours)}}function on(t,s){if(t&1&&(p(0,nn,2,1,"h3"),u(1,"div",49)),t&2){let e=c(2).$implicit,i=c(2);h(e.status.id>i.timesheetStatuses.NO_TIME_ENTRIES.id?0:-1),o(),m("ngClass",yt(2,Vi,e.status.id===i.timesheetStatuses.DRAFT.id,e.status.id===i.timesheetStatuses.SUBMITTED.id,e.status.id===i.timesheetStatuses.APPROVED.id))}}function an(t,s){if(t&1&&(a(0,"div",47)(1,"div",48),l(2),r(),p(3,tn,2,1,"small"),p(4,on,2,6),r()),t&2){let e=c(),i=e.$implicit,n=e.$index,d=c(2);m("ngClass",at(5,Fi,d.timesheetService.checkDayIsLockedForUser(i.date,d.timesheet.timesheetsLockedUntil,d.currentUser),d.isTimerActive&&n===d.todayIndex)),o(),m("ngClass",I(8,Li,i.isPublicHoliday)),o(),y(i.name),o(),h(d.isTimerActive&&n===d.todayIndex?3:-1),o(),h(!d.isTimerActive||n!==d.todayIndex?4:-1)}}function rn(t,s){if(t&1&&(p(0,en,1,0,"div",46),p(1,an,5,10,"div",47)),t&2){let e=s.$index,i=c(2);h(e===5&&i.hasWeekendEntries?0:-1),o(),h(e<5||i.hasWeekendEntries?1:-1)}}function sn(t,s){if(t&1){let e=T();a(0,"div",12),u(1,"div",44),a(2,"div",45),g("click",function(){_(e);let n=c();return f(n.editEntryOrOpenNotes(n.timesheetActivity))}),b(3,rn,2,2,null,null,w),r()()}if(t&2){let e=c();m("hasSpotlight",e.spotlight.editTimeEntry&&(e.timesheetActivity.resourceAllocation.activity==null?null:e.timesheetActivity.resourceAllocation.activity.id)===e.introductionActivityId),o(2),m("ngClass",at(3,Di,e.hasWeekendEntries,!e.isInEditingMode&&e.canEdit&&!e.isClosed||!e.canEdit&&e.timesheetActivity.useReferencePerDay))("title",e.canEdit&&!e.isClosed?"Edit time entry":!e.canEdit&&e.timesheetActivity.useReferencePerDay?"View time entry notes":""),o(),S(e.timesheetActivity.days)}}function ln(t,s){if(t&1){let e=T();a(0,"div",13)(1,"vy-time-entry-form",50),g("cancelled",function(){_(e);let n=c();return f(n.toggleEditingMode(null))})("saved",function(n){_(e);let d=c();return f(d.saveForm(n))}),r()()}if(t&2){let e=c();o(),m("timeEntrySetId",e.timesheetActivity==null?null:e.timesheetActivity.setId)("timesheetId",e.timesheet.id)("isInline",!0)("resourceAllocationId",e.timesheetActivity==null||e.timesheetActivity.resourceAllocation==null?null:e.timesheetActivity.resourceAllocation.id)("personId",e.timesheet.employee.id)("taskId",e.isBudgetsByTasksEnabled&&(e.deliverable!=null&&e.deliverable.hasTasks)?e.timesheetActivity.task==null?null:e.timesheetActivity.task.id:"")("purchaseOrder",e.timesheetActivity.purchaseOrder)}}function cn(t,s){if(t&1&&(a(0,"mat-error",51),l(1),M(2,"vyNumber"),M(3,"vyNumber"),r()),t&2){let e=c(2);o(),B(" By clocking ",P(2,2,e.newHours,"1.2-2")," hours. You passed the limit of ",P(3,5,e.timesheetActivity.timer.maxHours,"1.2-2")," hours. Please adjust your time manually. ")}}function mn(t,s){t&1&&(a(0,"div",52),u(1,"mat-icon",53),l(2," You're tracking more time on this project than you have working hours in this week. "),r())}function dn(t,s){if(t&1&&(a(0,"div",14),u(1,"div",44),p(2,cn,4,8,"mat-error",51),p(3,mn,3,0,"div",52),r()),t&2){let e=c();o(2),h(e.timesheetActivity.deliverable!=null&&e.timesheetActivity.deliverable.hasCalculationLimit&&e.newHours&&!e.isTimerActive&&e.newHours>e.timesheetActivity.timer.maxHours?2:-1),o(),h(e.context!=null&&e.context.useWorkingHoursCheck&&(e.timesheetActivity.availableWorkingHours<0||e.newHours>e.timesheetActivity.availableWorkingHours)?3:-1)}}var si=(()=>{class t{set activityInEditingMode(e){this.isInEditingMode=!!e,this.isCurrentActivityInEditingMode=e?.setId===this.timesheetActivity.setId}get canEdit(){return this._canEdit}set canEdit(e){this._canEdit=e}get isClosed(){return this._isClosed}set isClosed(e){this._isClosed=e}get canUseTimer(){return this._canUseTimer}set canUseTimer(e){this._canUseTimer=e}get deliverable(){return this.timesheetActivity?.deliverable}get introductionActivityId(){return this._introductionActivityId}set introductionActivityId(e){this._introductionActivityId=e,this.setActivitySpotlight()}constructor(e,i,n,d,x,O,it,nt,ot){this.timesheetService=e,this.sessionDataService=i,this.timerService=n,this.introductionService=d,this.dialog=x,this.router=O,this.responsiveService=it,this.globalSettingsService=nt,this.analyticsService=ot,this.timesheetUpd
1ated=new ae,this.editingModeChanged=new ae,this.spotlight={editTimeEntry:!1},this.newHours=0,this.ONBOARDING_PROJECT_NR=1}ngOnInit(){this.currentUser=this.sessionDataService.currentSessionData.getCurrentPerson(),this.timesheetStatuses=this.timesheetService.getTimesheetStatuses(),this.isBudgetsByTasksEnabled=this.globalSettingsService.isBudgetsByTaskEnabled(),this.restrictTimeToScheduledPeriods=this.globalSettingsService.isRestrictTimeToScheduledPeriodsEnabled(),this.todayIndex=Yt(),this.hasWeekendEntries=this.timesheetService.getHasWeekendEntries(this.timesheetActivity.days),this.timesheetActivity.timer?.isActive?this.startTimer(!0):this.setTimerValue(this.timesheetActivity.timer?.elapsedSeconds||0),this.introductionStepSubscription=this.introductionService.currentIntroductionStep$.subscribe({next:e=>{this.currentStepId=e,this.setActivitySpotlight()}})}setActivitySpotlight(){this.spotlight.editTimeEntry=this.currentStepId==="editTimeEntry"&&this.ONBOARDING_PROJECT_NR===this.timesheetActivity.project.projectNumber&&this.timesheetActivity.resourceAllocation.activity.id===this.introductionActivityId}goToProject(){this.currentUser.isFullUser&&this.router.navigate(["/project",this.timesheetActivity.project.id])}startTimer(e){this.analyticsService.trackUserAction({eventLabel:"StartTimer",eventCategory:this.analyticsService.CATEGORIES.TIMESHEETS});let i={timesheetEntrySetId:this.timesheetActivity.setId,isActive:this.timesheetActivity.timer?.isActive||!1,elapsedSeconds:this.clockedSecondsNotYetOnTimesheetActivity||this.timesheetActivity.timer?.elapsedSeconds||0,onUpdate:n=>this.updateTimerValue(n)};this.timerService.activateTimer(i,e)}stopTimer(){this.timerService.deactivateTimer()}copyTimeEntry(){this.dialog.open(Je,{width:this.responsiveService.getDialogWidth({xs:"95vw"}),maxWidth:this.responsiveService.getDialogWidth({xs:"95vw",gtxs:"600px"}),data:{timesheetId:this.timesheet.id,personId:this.timesheet.employee.id,resourceAllocationId:this.timesheetActivity.resourceAllocation?.id,absenceTypeId:this.timesheetActivity.absenceType?.id,isCopy:!0,spotlight:this.spotlight},autoFocus:!1}).afterClosed().subscribe(i=>{i&&this.timesheetUpdated.emit(i)})}editEntryOrOpenNotes(e){!this.canEdit&&e.useReferencePerDay?this.openNotesOverviewDialog(e):this.toggleEditingMode(e)}toggleEditingMode(e){this.isInEditingMode&&e||!this.canEdit||this.isClosed||this.editingModeChanged.emit(e)}openNotesOverviewDialog(e){this.dialog.open(ii,{width:this.responsiveService.getDialogWidth({xs:"95vw"}),maxWidth:this.responsiveService.getDialogWidth({xs:"95vw",gtxs:"600px"}),data:{timesheetActivity:e},autoFocus:!1})}saveForm(e){this.toggleEditingMode(null),e&&(this.introductionService.markIntroductionStepAsDone("editTimeEntry"),this.timesheetUpdated.emit(e))}ngOnDestroy(){this.introductionStepSubscription?.unsubscribe()}updateTimerValue(e){this.setTimerValue(e.elapsedSeconds),this.isTimerActive=e.isActive,e.hours&&(this.newHours+=e.hours-this.timesheetActivity.days[this.todayIndex].hours,this.timesheetActivity.days[this.todayIndex].hours=e.hours)}setTimerValue(e){if(this.timerValue=qt(e),this.clockedSecondsNotYetOnTimesheetActivity=e,this.restrictTimeToScheduledPeriods){let i=E.now();this.isBudgetsByTasksEnabled&&this.timesheetActivity.task?(i>E.fromISO(this.timesheetActivity.task.dueDate)||i<E.fromISO(this.timesheetActivity.task.startDate))&&(this.isTimerDisabled=!0):this.timesheetActivity.calculationLine&&(i>E.fromISO(this.timesheetActivity.calculationLine.finishDate)||i<E.fromISO(this.timesheetActivity.calculationLine.startDate))&&(this.isTimerDisabled=!0)}}static{this.\u0275fac=function(i){return new(i||t)(v(V),v(xe),v(qe),v(te),v(Y),v(_e),v(H),v(q),v(be))}}static{this.\u0275cmp=k({type:t,selectors:[["vy-timesheet-activity-summary","timesheetActivity",""]],inputs:{timesheetActivity:"timesheetActivity",timesheet:"timesheet",context:"context",isTimerDisabled:"isTimerDisabled",activityInEditingMode:"activityInEditingMode",canEdit:"canEdit",isClosed:"isClosed",canUseTimer:"canUseTimer",introductionActivityId:"introductionActivityId"}
1,outputs:{timesheetUpdated:"timesheetUpdated",editingModeChanged:"editingModeChanged"},standalone:!1,attrs:Ai,decls:27,vars:12,consts:[["moreMenuActivity","matMenu"],["moreMenuNonBillable","matMenu"],[1,"project-container","vy-layout-row","vy-layout-align-start-start","vy-layout-gap-l"],["xPosition","before"],["mat-menu-item","","testing-id","edit-time-entry","vySpotlight","",3,"click","disabled","hasSpotlight"],["svgIcon","pencil"],["mat-menu-item","","testing-id","copy-time-entry","title","Copy this entry to a new time entry",3,"click","disabled"],["svgIcon","content-copy"],["mat-menu-item","","testing-id","view-time-entry"],[1,"time-off-container","vy-layout-row","vy-layout-align-start-start","vy-layout-gap-l"],["mat-menu-item","","testing-id","edit-time-entry",3,"click","disabled"],[1,"notes-container","vy-layout-row","vy-layout-align-start-start"],["vySpotlight","",1,"vy-layout-row","vy-layout-align-start-start",3,"hasSpotlight"],[1,"time-entry-form-container"],[1,"vy-layout-row","vy-layout-align-start-start"],[3,"click","size","entity","ngClass"],[1,"vy-flex"],[1,"vy-one-line","mat-caption","tc-gray-500"],[1,"vy-one-line"],[1,"vy-one-line","mat-caption","po-indicator"],[1,"vy-layout-row","vy-layout-align-start-start","vy-layout-gap"],["mat-icon-button","","color","gray",1,"round-button",3,"matMenuTriggerFor","disabled"],["svgIcon","dots-vertical"],[1,"vy-one-line","mat-caption","tc-accent"],[1,"vy-one-line","vy-strong"],[3,"routerLink"],["svgIcon","checkbox-marked-circle-outline",1,"icon-small",3,"inline"],["svgIcon","file-document-outline",1,"icon-small",3,"inline"],[1,"vy-pos-rel"],["mat-icon-button","","color","gray","title","Start timer","testing-id","toggle-timer",1,"round-button",3,"disabled"],[1,"clocked-time-warning","mat-caption","tc-accent"],[1,"clocked-time","mat-caption","tc-gray-500"],["mat-icon-button","","color","accent","title","Pause timer","testing-id","toggle-timer",1,"round-button",3,"disabled"],["mat-icon-button","","color","gray","title","Start timer","testing-id","toggle-timer",1,"round-button",3,"click","disabled"],[3,"svgIcon"],["mat-icon-button","","color","accent","title","Pause timer","testing-id","toggle-timer",1,"round-button",3,"click","disabled"],["svgIcon","pause"],["mat-menu-item","","testing-id","view-time-entry",3,"click"],["svgIcon","eye"],[2,"width","56px"],[1,"mat-caption","tc-gray-500"],[1,"vy-flex","vy-one-line"],["mat-icon-button","","color","gray",1,"round-button",3,"disabled","matMenuTriggerFor"],[1,"spacer"],["fxHide.xs","true",1,"spacer"],["role","button",1,"hours-container","vy-layout-row","vy-layout-align-start-start","vy-layout-gap-l",3,"click","ngClass","title"],["ngClass.lt-lg","break"],[1,"day-cell",3,"ngClass"],[3,"ngClass"],[1,"vy-status",3,"ngClass"],[3,"cancelled","saved","timeEntrySetId","timesheetId","isInline","resourceAllocationId","personId","taskId","purchaseOrder"],[1,"vy-flex","mat-caption"],[1,"tc-accent","vy-flex","mat-caption"],["svgIcon","information-outline",1,"small-icon"]],template:function(i,n){i&1&&(p(0,Ki,16,13,"div",2),a(1,"mat-menu",3,0)(3,"a",4),g("click",function(){return n.toggleEditingMode(n.timesheetActivity)}),u(4,"mat-icon",5),a(5,"span"),l(6,"Edit time entry"),r()(),a(7,"a",6),g("click",function(){return n.copyTimeEntry()}),u(8,"mat-icon",7),a(9,"span"),l(10,"Duplicate time entry"),r()(),p(11,Qi,4,0,"a",8),r(),p(12,Xi,9,3,"div",9),a(13,"mat-menu",3,1)(15,"a",10),g("click",function(){return n.toggleEditingMode(n.timesheetActivity)}),u(16,"mat-icon",5),a(17,"span"),l(18,"Edit time entry"),r()(),a(19,"a",6),g("click",function(){return n.copyTimeEntry()}),u(20,"mat-icon",7),a(21,"span"),l(22,"Duplicate time entry"),r()()(),p(23,Zi,5,1,"div",11),p(24,sn,5,6,"div",12),p(25,ln,2,7,"div",13),p(26,dn,4,2,"div",14)),i&2&&(h(n.timesheetActivity.project?0:-1),o(3),m("disabled",!n.canEdit||n.isClosed)("hasSpotlight",n.spotlight.editTimeEntry),o(4),m("disabled",!n.canEdit),o(4),h(!n.canEdit&&n.timesheetActivity.useReferencePerDay?11:-1),o(),h(n.timesheetActivity.project?-1:12),o(3),m("disabled",!n.canEdit||n.isClosed),o(4),m("disabled",!n.canEdit),o(4),h(n.timesheetActivity.reference&&!n.timesheetActivity.useReferencePerDay?23:-1),o(),h(n.isCurrentActivityInEditingMode?-1:24),o(),h(n.isCurrentActivityInEditingMode?25:-1),o(),h(n.isCurrentActivityInEditingMode?-1:26))},dependencies:[U,fe,R,A,J,j,X,Ie,Oe,Pe,F,Ye,ze,Kt],styles:['vy-avatar-image[_ngcontent-%COMP%], .project-container[_ngcontent-%COMP%]   .mat-mdc-icon-button[_ngcontent-%COMP%], .hours-container[_ngcontent-%COMP%]   .day-cell[_ngcontent-%COMP%], .mat-mdc-form-field-error[_ngcontent-%COMP%]{margin-top:8px!important}.hours-container[_ngcontent-%COMP%]{margin-bottom:8px!important}a.mat-mdc-menu-item[_ngcontent-%COMP%] > .mat-icon[_ngcontent-%COMP%], .mat-mdc-form-field-error[_ngcontent-%COMP%]{margin-bottom:4px!important}.time-entry-form-container[_ngcontent-%COMP%]{margin-top:16px!important}.text-holiday[_ngcontent-%COMP%]{padding-right:8px!important;padding-left:8px!important}.vy-status[_ngcontent-%COMP%]{--diagonals-rotation: 135deg;background-image:linear-gradient(var(--diagonals-rotation),rgba(255,255,255,.35) 12.5%,rgba(0,0,0,0) 12.5%,rgba(0,0,0,0) 50%,rgba(255,255,255,.45) 50%,rgba(255,255,255,.45) 62.5%,rgba(0,0,0,0) 62.5%,rgba(0,0,0,0) 100%);background-size:6.6667px 6.6667px;background-repeat:repeat}[_nghost-%COMP%]{display:block}.vy-pos-rel[_ngcontent-%COMP%]{position:relative}.clickable[_ngcontent-%COMP%]{cursor:pointer}.spacer[_ngcontent-%COMP%]{width:72px;flex-shrink:0}.mat-headline-6[_ngcontent-%COMP%], h2[_ngcontent-%COMP%], h3[_ngcontent-%COMP%]{margin-bottom:0}.tc-primary-darker[_ngcontent-%COMP%]{color:var(--clr-primary-darker)}.tc-black[_ngcontent-%COMP%]{color:var(--clr-black)}.vy-status[_ngcontent-%COMP%]{height:4px;width:40px;margin:2px auto 0}.vy-status-draft[_ngcontent-%COMP%]{--diagonals-rotation: 45deg;background-color:var(--clr-accent-lighter)}.vy-status-submitted[_ngcontent-%COMP%]{background-color:#c5e1a5}.vy-status-approved[_ngcontent-%COMP%]{background-color:#689f38}.text-holiday[_ngcontent-%COMP%]{background-color:var(--clr-gray-300);color:var(--clr-gray-700);border-radius:4px}.icon-small[_ngcontent-%COMP%]{font-size:18px;height:18px;width:18px;line-height:18px}.icon-small[_ngcontent-%COMP%]   .mat-mdc-icon[_ngcontent-%COMP%], .icon-small[_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{height:18px;width:18px;transform:translate(-50%,-50%)}.icon-small[_ngcontent-%COMP%]     mat-icon svg{height:18px!important;width:18px!important}.icon-small[_ngcontent-%COMP%]{vertical-align:middle}.po-indicator[_ngcontent-%COMP%]{color:var(--clr-gray-500)}.po-indicator[_ngcontent-%COMP%]   .icon-small[_ngcontent-%COMP%]{vertical-align:text-bottom}.round-button[color=gray][_ngcontent-%COMP%]{color:#757575;box-shadow:inset 0 0 0 1px #bdbdbd}.round-button[color=accent][_ngcontent-%COMP%]{box-shadow:inset 0 0 0 1px var(--clr-accent)}.round-button[disabled][_ngcontent-%COMP%]{box-shadow:inset 0 0 0 1px #bdbdbd!important}.round-button[disabled][_ngcontent-%COMP%]   .mat-icon[_ngcontent-%COMP%]{color:#bdbdbd!important}.vy-one-line[_ngcontent-%COMP%]{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal}
1.clocked-time[_ngcontent-%COMP%]{position:absolute;bottom:-20px;left:50%;transform:translate(-50%)}.clocked-time-warning[_ngcontent-%COMP%]{position:absolute;top:48px;left:0;white-space:nowrap}.hours-container[_ngcontent-%COMP%]   .day-cell[_ngcontent-%COMP%]{text-align:center}.hours-container[_ngcontent-%COMP%]   .break[_ngcontent-%COMP%]{flex-basis:100%;height:0}.vy-clickable[_ngcontent-%COMP%]{position:relative;cursor:pointer}.vy-clickable[_ngcontent-%COMP%]:after{content:"";position:absolute;inset:0;background-color:#00bcd4;border-radius:inherit;opacity:0;transition:opacity .7s .01s cubic-bezier(.19,1,.22,1);pointer-events:none}.vy-clickable[_ngcontent-%COMP%]:hover:after{opacity:.05}.small-icon[_ngcontent-%COMP%]{position:relative;top:2px;width:14px;height:14px}.small-icon[_ngcontent-%COMP%]   svg[_ngcontent-%COMP%]{width:14px!important;height:14px!important}']})}}return t})();var un=(t,s)=>s.id;function vn(t,s){t&1&&(a(0,"mat-dialog-content"),u(1,"vy-loading-spinner"),r())}function gn(t,s){if(t&1&&(a(0,"div"),l(1),r()),t&2){let e=c(2);o(),C(" ",e.hoursAlreadyApproved,"h. overtime already approved ")}}function yn(t,s){if(t&1&&(a(0,"mat-option",14)(1,"div",11)(2,"div",7),l(3),r(),a(4,"small"),l(5),r()()()),t&2){let e=s.$implicit;m("value",e.id),o(3),y(e.name),o(2),C("",e.budgetLeftHours,"h. remaining")}}function _n(t,s){if(t&1&&(a(0,"mat-error",18),l(1),r()),t&2){let e=c(4);o(),C(" Enter a valid number of hours and round to ",e.stepSize==="0.25"?"a quarter":"2 decimals"," ")}}function fn(t,s){if(t&1){let e=T();a(0,"div",11)(1,"div",7)(2,"mat-form-field",12)(3,"mat-label"),l(4,"Overtime category"),r(),a(5,"mat-select",13),ge("ngModelChange",function(n){_(e);let d=c().$implicit;return ve(d.overtimeCategoryId,n)||(d.overtimeCategoryId=n),f(n)}),g("ngModelChange",function(){_(e);let n=c().$index,d=c(2);return f(d.onChangeModel(n))}),a(6,"mat-select-trigger"),l(7),r(),b(8,yn,6,3,"mat-option",14,un),r()()(),a(10,"div",15)(11,"mat-form-field",16)(12,"mat-label"),l(13,"Hours"),r(),a(14,"input",17),ge("ngModelChange",function(n){_(e);let d=c().$implicit;return ve(d.hours,n)||(d.hours=n),f(n)}),g("ngModelChange",function(){_(e);let n=c().$index,d=c(2);return f(d.onChangeModel(n))}),r()()()(),p(15,_n,2,1,"mat-error",18),a(16,"mat-form-field",12)(17,"mat-label"),l(18,"Note"),r(),a(19,"input",19),ge("ngModelChange",function(n){_(e);let d=c().$implicit;return ve(d.reference,n)||(d.reference=n),f(n)}),r()()}if(t&2){let e=c(),i=e.$implicit,n=e.$index,d=D(1),x=c(2);o(5),ue("ngModel",i.overtimeCategoryId),m("required",!0),o(2),C(" ",x.selectedCategoryNames[n]," "),o(),S(x.overtimeCategoryOptions),o(6),ue("ngModel",i.hours),m("step",x.stepSize)("pattern",x.hoursValidationPattern),o(),h(d.control!=null&&d.control.controls&&d.control.controls.hours.hasError("pattern")?15:-1),o(4),ue("ngModel",i.reference)}}function Cn(t,s){if(t&1&&(a(0,"section",10,1),p(2,fn,20,8),r()),t&2){let e=s.$implicit,i=s.$index;m("ngModelGroup",ye("overtimeEntry-",i)),o(2),h(e.status!=="a"?2:-1)}}function xn(t,s){if(t&1&&(a(0,"mat-dialog-content")(1,"div"),l(2),M(3,"vyDate"),r(),p(4,gn,2,1,"div"),a(5,"div"),l(6),r(),u(7,"br"),b(8,Cn,3,3,"section",10,w),r()),t&2){let e=c();o(2),B("",e.day.totalOvertimeHours,"h. overtime on ",P(3,6,e.day.date,"longDate")),o(2),h(e.hoursAlreadyApproved?4:-1),o(),G("tc-accent",e.hoursLeftToSpecify!==0),o(),C("",e.hoursLeftToSpecify,"h. left to specify"),o(2),S(e.vm.overtimeEntries)}}var ci=(()=>{class t{constructor(e,i,n,d){this.dialogRef=e,this.data=i,this.globalSettingsService=n,this.timesheetService=d,this.day=this.data.day,this.stepSize="0.25",this.timesheetId=this.data.timesheetId,this.dayIndex=new Date(this.day.date).getDay()}ngOnInit(){this.fetchForm(),this.setHoursValidationPatternAndStepSize()}closeDialog(){this.dialogRef.close()}save(){let e={overtimeEntries:this.vm.overtimeEntries};this.timesheetService.saveOvertimeForDayForm(this.timesheetId,this.dayIndex,e).subscribe({next:()=>{let i=dt(mt({},this.day),{isOvertimeFullySpecified:this.hoursLeftToSpecify===0});this.dialogRef.close(i)}})}onChangeModel(e){this.updateHoursLeftToSpecify(),this.setCategoryNames()}addOvertimeCategory(){if(!this.vm||!this.vm.overtimeEntries)return;let e=this.vm.overtimeEntries.length===0?this.day.totalOvertimeHours:this.hoursLeftToSpecify;this.vm.overtimeEntries.push({hours:e})}setHoursValidationPatternAndStepSize(){this.globalSettingsService.isTimeEntryRoundingEnabled()?(this.hoursValidationPattern=/^-?[0-9]+((.|,)(0|00|25|5|50|75))?$/,this.stepSize="0.25"):(this.hoursValidationPattern=/^-?[0-9]+(\.[0-9]{1,2})?$/,this.stepSize="1")}updateHoursAlreadyApproved(){this.hoursAlreadyApproved=this.vm.overtimeEntries.reduce((i,n)=>n.status==="a"?i+n.hours:i,0)}updateHoursLeftToSpecify(){let e=this.day.totalOvertimeHours;this.hoursLeftToSpecify=this.vm.overtimeEntries.reduce((i,n)=>
1n.overtimeCategoryId?i-n.hours:i,e)}setCategoryNames(){if(!this.vm.overtimeEntries.length)return;let e=new Map(this.vm.overtimeCategoryOptions.map(i=>[i.id,i.name]));this.selectedCategoryNames=this.vm.overtimeEntries.map(i=>e.get(i.overtimeCategoryId)||"")}fetchForm(){this.isLoading=!0,this.timesheetService.getOvertimeForDayForm(this.timesheetId,this.dayIndex).subscribe({next:e=>{this.overtimeCategoryOptions=e.overtimeCategoryOptions,e.overtimeEntries.length===0&&(e.overtimeEntries=[{hours:this.day.totalOvertimeHours}]),this.vm=e,this.setCategoryNames(),this.updateHoursLeftToSpecify(),this.updateHoursAlreadyApproved();let i=this.vm.overtimeEntries.every(n=>n.status==="a");this.hoursLeftToSpecify!==0&&(this.vm.overtimeEntries.length===0||i)&&this.addOvertimeCategory(),this.isLoading=!1},error:e=>this.isLoading=!1})}static{this.\u0275fac=function(i){return new(i||t)(v(Se),v(Te),v(q),v(V))}}static{this.\u0275cmp=k({type:t,selectors:[["vy-timesheet-overtime-specification-dialog"]],standalone:!1,decls:17,vars:5,consts:[["vyForm","ngForm"],["overtimeCategorySpecificationGroup","ngModelGroup"],["xmlns","http://www.w3.org/1999/html",1,"vy-layout-row","vy-layout-align-space-between-center","vy-dialog-toolbar"],["mat-icon-button","","tabindex","-1",3,"click"],["svgIcon","close"],[3,"ngSubmit"],["type","button","mat-stroked-button","","color","primary",3,"click","disabled"],[1,"vy-flex"],["type","button","mat-stroked-button","","color","primary",3,"click"],["type","submit","mat-raised-button","","color","primary",3,"disabled"],[1,"overtime-spec-item",3,"ngModelGroup"],[1,"vy-layout-row","vy-layout-align-start-center","vy-layout-gap-l"],["appearance","outline",1,"vy-flex"],["name","overtimeCategoryId",3,"ngModelChange","ngModel","required"],[3,"value"],[1,"vy-flex-25"],["appearance","outline"],["matInput","","type","number","max","24","name","hours","autocomplete","off","required","",3,"ngModelChange","ngModel","step","pattern"],[1,"error-message"],["matInput","","type","text","name","note","autocomplete","off",3,"ngModelChange","ngModel"]],template:function(i,n){if(i&1&&(a(0,"div",2)(1,"h2"),l(2),r(),a(3,"button",3),g("click",function(){return n.closeDialog()}),u(4,"mat-icon",4),r()(),p(5,vn,2,0,"mat-dialog-content"),a(6,"form",5,0),g("ngSubmit",function(){return n.save()}),p(8,xn,10,9,"mat-dialog-content"),a(9,"mat-dialog-actions")(10,"button",6),g("click",function(){return n.addOvertimeCategory()}),l(11," Add overtime category "),r(),u(12,"div",7),a(13,"button",8),g("click",function(){return n.closeDialog()}),l(14," Cancel "),r(),a(15,"button",9),l(16," Save "),r()()()),i&2){let d=D(7);o(2),C("Specify overtime ",n.day.name),o(3),h(n.isLoading?5:-1),o(3),h(!n.isLoading&&n.vm?8:-1),o(2),m("disabled",n.hoursLeftToSpecify===0),o(5),m("disabled",d.invalid)}},dependencies:[De,Ae,Fe,we,Q,Ft,Lt,Ve,It,Ot,kt,Ee,J,j,We,Ne,Re,X,Tt,Me,Ue,Bt,je,N,L],styles:[".overtime-spec-item[_ngcontent-%COMP%]{margin-top:16px!important;margin-bottom:16px!important}.error-message[_ngcontent-%COMP%]{position:relative;top:-1rem}"]})}}return t})();var bn=t=>({"vy-layout-wrap":t});function Sn(t,s){t&1&&u(0,"div",4)}function Tn(t,s){t&1&&(a(0,"span",7),l(1,"!"),r())}function Mn(t,s){if(t&1){let e=T();a(0,"button",6),g("click",function(n){_(e);let d=c(2).$implicit,x=c();return f(x.specifyOvertime(d,n))}),l(1),p(2,Tn,2,0,"span",7),r(),u(3,"div",8)}if(t&2){let e=c(2).$implicit,i=c();m("title",ye("Tap to specify overtime for ",e.name)),o(),C(" ",e.totalOvertimeHours," "),o(),h(e.isOvertimeFullySpecified?-1:2),o(),G("vy-status--draft",e.statusOvertime.id===i.timesheetStatuses.DRAFT.id)("vy-status--submitted",e.statusOvertime.id===i.timesheetStatuses.SUBMITTED.id)}}function En(t,s){if(t&1&&(a(0,"div",5),p(1,Mn,4,8),r()),t&2){let e=c().$implicit;o(),h(e.totalOvertimeHours>0?1:-1)}}function kn(t,s){if(t&1&&(p(0,Sn,1,0,"div",4),p(1,En,2,1,"div",5)),t&2){let e=s.$index,i=c();h(e===5&&i.hasWeekendEntries?0:-1),o(),h(e<5||i.hasWeekendEntries?1:-1)}}var mi=(()=>{class t{constructor(e,i,n){this.timesheetService=e,this.dialog=i,this.responsiveService=n,this.hasWeekendEntries=!1,this.overtimeSpecificationChanged=new ae,this.timesheetStatuses=this.timesheetService.getTimesheetStatuses()}ngOnInit(){this.timesheetStatuses=this.timesheetService.getTimesheetStatuses()}specifyOvertime(e,i){this.dialog.open(ci,{width:this.responsiveService.getDialogWidth({xs:"95vw"}),maxWidth:this.responsiveService.getDialogWidth({xs:"95vw",gtxs:"600px"}),data:{day:e,timesheetId:this.timesheet.id}}).afterClosed().subscribe({next:d=>{d&&this.overtimeSpecificationChanged.emit(d)}})}static{this.\u0275fac=function(i){return new(i||t)(v(V),v(Y),v(H))}}static{this.\u0275cmp=k({type:t,selectors:[["vy-timesheet-overtime-section"]],inputs:{hasWeekendEntries:"hasWeekendEntries",timesheet:"timesheet"},outputs:{overtimeSpecificationChanged:"overtimeSpecificationChanged"},standalone:!1,decls:7,vars:3,consts:[[1,"vy-layout-row","vy-layout-align-start-start"],["fxHide.xs","true",1,"spacer","vy-pos-rel"],[1,"mat-body-2","overtime-label"],[1,"days-table","vy-layout-row","vy-layout-align-start-start","vy-layout-gap-l",3,"ngClass"],["ngClass.lt-lg","break"],[1,"day-cell"],["mat-mini-fab","","color","white",1,"overtime-hours-button","mat-elevation-z0",3,"click","title"],[1,"badge"],[1,"vy-status"]],template:function(i,n){i&1&&(a(0,"div",0)(1,"div",1)(2,"div",2),l(3,"OVERTIME"),r()(),a(4,"div",3),b(5,kn,2,2,null,null,w),r()()),i&2&&(o(4),m("ngClass",I(1,bn,n.hasWeekendEntries)),o(),S(n.timesheet.days))},dependencies:[U,R,A,Mt],styles:[".vy-status[_ngcontent-%COMP%]{--diagonals-rotation: 135deg;background-image:linear-gradient(var(--diagonals-rotation),rgba(255,255,255,.35) 12.5%,rgba(0,0,0,0) 12.5%,rgba(0,0,0,0) 50%,rgba(255,255,255,.45) 50%,rgba(255,255,255,.45) 62.5%,rgba(0,0,0,0) 62.5%,rgba(0,0,0,0) 100%);background-size:6.6667px 6.6667px;background-repeat:repeat}.spacer[_ngcontent-%COMP%]{width:72px;flex-shrink:0}.line-height-condensed[_ngcontent-%COMP%]{line-height:14px}.vy-status[_ngcontent-%COMP%]{height:4px;width:40px;margin:2px auto 0}.vy-status--draft[_ngcontent-%COMP%]{--diagonals-rotation: 45deg;background-color:var(--clr-accent-lighter)}.vy-status--submitted[_ngcontent-%COMP%]{background-color:#aed581}.vy-status--approved[_ngcontent-%COMP%]{background-color:#689f38}.vy-status--holiday[_ngcontent-%COMP%]{background-color:var(--clr-gray-300);background-image:none}.days-table[_ngcontent-%COMP%]{--table-margin-block: 0 1rem;--cell-margin-block: 1rem 0;margin-block:var(--table-margin-block)}.days-table[_ngcontent-%COMP%]   .day-cell[_ngcontent-%COMP%]{margin-block:var(--cell-margin-block);min-width:60px;text-align:center}.days-table[_ngcontent-%COMP%]   .day-cell--holiday[_ngcontent-%COMP%]{background-color:var(--clr-gray-300);color:var(--clr-gray-700);min-height:50px;border-radius:4px}.days-table[_ngcontent-%COMP%]   .break[_ngcontent-%COMP%]{flex-basis:100%;height:0}","[_nghost-%COMP%]{display:block;box-sizing:border-box;font-size:1rem}.days-table[_ngcontent-%COMP%]{--table-margin-block: 0;--cell-margin-block: .5rem 0}.spacer[_ngcontent-%COMP%]{height:50px;padding-top:.5rem;display:flex;flex-direction:column;align-items:center;justify-content:center}.mat-icon[color=gray][_ngcontent-%COMP%], .spacer[_ngcontent-%COMP%]{color:var(--clr-gray-400)}.vy-pos-rel[_ngcontent-%COMP%]{position:relative}.overtime-label[_ngcontent-%COMP%]{position:absolute;top:1.25rem;right:.125rem;letter-spacing:.1em}.overtime-hours-button[_ngcontent-%COMP%]{position:relative;color:var(--clr-primary-darker);font:400 20px/22px Montserrat,Roboto,sans-serif;background-color:#ffffff80}.overtime-hours-button[_ngcontent-%COMP%]:not([disabled]):hover{box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f}.overtime-hours-button[disabled][_ngcontent-%COMP%]{background-color:transparent}.overtime-hours-button[_ngcontent-%COMP%]   .badge[_ngcontent-%COMP%]{--size: 14px;--bg-color: #ff6e40;--text-color: white;position:relative;white-space:nowrap;text-overflow:ellipsis;max-width:100%;display:inline-block;overflow:hidden;font-size:11px;line-height:20px;padding-inline:6px;margin-bottom:2px;background-color:var(--bg-color);color:var(--text-color);border-radius:32px;text-transform:uppercase;letter-spacing:.1em;vertical-align:bottom;position:absolute;width:var(--size);height:var(--size);line-height:var(--size);padding:1px;font-size:12px;font-weight:500;top:-2px;right:-2px}"]})}}return t})();var di=(()=>{class t{transform(e,i){if(!e||!i)return e;let n=E.fromISO(e[0].days[0].date).hasSame(E.now(),"week");if(i==="hasEntriesOnToday"&&n){let d=E.now();return e.filter(x=>x.days.find(O=>d.hasSame(E.fromISO(O.date),"day")&&O.status.id!==1))}return e}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275pipe=vt({name:"vyFilterTimeEntries",type:t,pure:!0,standalone:!1})}}return t})();var Fn=t=>({"vy-layout-wrap":t}),Ln=t=>({"vy-status--draft":t}),Vn=(t,s)=>s.key,jn=(t,s)=>s.setId;function Rn(t,s){t&1&&(a(0,"vy-skeleton-loader",1),re("vy-fade-in"),r())}function Nn(t,s){if(t&1){let e=T();a(0,"div",2)(1,"mat-slide-toggle",5),g("change",function(n){_(e);let d=c();return f(d.onChangeAutoSubmit(n))}),l(2," Auto submit time entries at the end of the day "),r()()}if(t&2){let e=c();o(),m("checked",e.isAutoSubmitActive)("disabled",e.isUpdatingAutoSubmit)}}function Wn(t,s){t&1&&(a(0,"vy-empty-state",3)(1,"h3"),l(2,"Timesheet not found."),r()())}function Un(t,s){if(t&1&&(u(0,"mat-icon",9),M(1,"vyDate")),t&2){let e=c(2);m("title","Time entries before "+$(1,1,e.timesheet.timesheetsLockedUntil)+" are locked by your admin")}}function Hn(t,s){if(t&1&&(a(0,"div",26),u(1,"div",27),a(2,"div"),l(3),r()()),t&2){let e=c().$implicit;o(),m("ngClass","vy-status--"+e.value.name.toLowerCase()),o(2),y(e.value.name)}}function Bn(t,s){if(t&1&&p(0,Hn,4,2,"div",26),t&2){let e=s.$implicit;h(e.key!=="NO_TIME_ENTRIES"?0:-1)}}function $n(t,s){t&1&&u(0,"div",28)}function zn(t,s){if(t&1&&u(0,"div",27),t&2){let e=c(2).$implicit,i=c(2);m("ngClass",I(1,Ln,e.status.id===i.timesheetStatuses.DRAFT.id))}}function Gn(t,s){if(t&1&&(a(0,"div",30)(1,"div",31),l(2),a(3,"span",32),l(4),r()(),a(5,"h2"),l(6),r(),p(7,zn,1,3,"div",27),r()),t&2){let e=c(),i=e.$implicit,n=e.$index,d=c(2);G("day-cell--holiday",i.isPublicHoliday),o(2),C(" ",i.name.substring(0,2)," "),o(2),y(d.dayLabels[n]),o(2),y(i.totalHours),o(),h(i.status.id!==d.timesheetStatuses.NO_TIME_ENTRIES.id?7:-1)}}function qn(t,s){if(t&1&&(p(0,$n,1,0,"div",28),p(1,Gn,8,6,"div",29)),t&2){let e=s.$index,i=c(2);h(e===5&&i.hasWeekendEntries?0:-1),o(),h(e<5||i.hasWeekendEntries?1:-1)}}function Yn(t,s){if(t&1){let e=T();a(0,"vy-timesheet-overtime-section",33),g("overtimeSpecificationChanged",function(n){_(e);let d=c(2);return f(d.updateOvertimeDay(n))}),r()}if(t&2){let e=c(2);m("hasWeekendEntries",e.hasWeekendEntries)("timesheet",e.timesheet)}}function Jn(t,s){t&1&&u(0,"hr")}function Kn(t,s){if(t&1){let e=T();u(0,"vy-square-icon-button",34)(1,"div",16),a(2,"vy-square-icon-button",35),g("click",function(){_(e);let n=c(2);return f(n.toggleFilterToday())}),r()}if(t&2){c();let e=D(33),i=c();m("matMenuTriggerFor",e)("disabled",!i.canSubmitWeek||i.isSubmitting||!!i.currentActivityInEditingMode)("hasSpotlight",i.spotlight.submitWeek),o(2),m("color",i.isFilteredForToday?"accent":"primary")("disabled",!!i.currentActivityInEditingMode)}}function Qn(t,s){if(t&1){let e=T();
1a(0,"vy-square-icon-button",36),g("click",function(){_(e);let n=c(2);return f(n.submitTimeSheet())}),r()}if(t&2){let e=c(2);m("disabled",!e.canSubmitWeek||e.isSubmitting||!!e.currentActivityInEditingMode)("hasSpotlight",e.spotlight.submitWeek)}}function Xn(t,s){if(t&1){let e=T();a(0,"li")(1,"vy-timesheet-activity-summary",38),g("timesheetUpdated",function(n){_(e);let d=c(3);return f(d.updateTimesheet(n))})("editingModeChanged",function(n){_(e);let d=c(3);return f(d.setActivityInEditingMode(n))}),r()()}if(t&2){let e=s.$implicit,i=c(3);o(),m("timesheetActivity",e)("timesheet",i.timesheet)("context",i.context)("isTimerDisabled",i.isTimerDisabled||i.isSubmitting)("activityInEditingMode",i.currentActivityInEditingMode)("canUseTimer",i.canUseTimer)("introductionActivityId",i.introductionActivityId)("isClosed",e.deliverable==null?null:e.deliverable.isClosed)("canEdit",e.canEdit&&!i.isSubmitting)}}function Zn(t,s){if(t&1&&(u(0,"hr"),a(1,"ul",37),b(2,Xn,2,9,"li",null,jn),M(4,"vyFilterTimeEntries"),r()),t&2){let e=c(2);
1o(2),S(e.isFilteredForToday?P(4,0,e.timesheet.activities,"hasEntriesOnToday"):e.timesheet.activities)}}function eo(t,s){if(t&1){let e=T();a(0,"mat-card",4)(1,"div",6),u(2,"vy-avatar-image",7),a(3,"div",8),l(4),p(5,Un,2,3,"mat-icon",9),a(6,"div",10),l(7),M(8,"vyDate"),M(9,"vyDate"),r()(),a(10,"div",11),l(11),a(12,"span",12),l(13,"h."),r()()(),a(14,"div",13),u(15,"div",14),a(16,"div",15),b(17,Bn,1,1,null,null,Vn),M(19,"vyOrderedKeyValue"),r(),u(20,"div",16),r(),a(21,"div",17),u(22,"div",18),a(23,"div",19),b(24,qn,2,2,null,null,w),r()(),p(26,Yn,1,2,"vy-timesheet-overtime-section",20),p(27,Jn,1,0,"hr"),a(28,"div",21)(29,"vy-square-icon-button",22),g("click",function(){_(e);let n=c();return f(n.openTimesheetEntryDialog())}),r(),p(30,Kn,3,5)(31,Qn,1,2,"vy-square-icon-button",23),r(),a(32,"mat-menu",null,0)(34,"button",24),g("click",function(){_(e);let n=c();return f(n.submitTimeSheet("upUntilYesterday"))}),l(35,"...up to today"),r(),a(36,"button",24),g("click",function(){_(e);let n=c();return f(n.submitTimeSheet("upUntilToday"))}),l(37,"...up to and including today"),r(),a(38,"button",25),g("click",function(){_(e);let n=c();return f(n.submitTimeSheet())}),l(39,"...this entire week"),r()(),p(40,Zn,5,3),r()}if(t&2){let e=c();o(2),m("entity",e.timesheet.employee)("showFlag",!0)("size",56)("title",e.timesheet.employee.name),o(2),C(" WEEK ",e.timesheet.week," "),o(),h(e.isPartOfTimesheetLocked?5:-1),o(2),B("",P(8,16,e.timesheet.startDate,e.dayAndMonthFormat),"\u2013",$(9,19,e.timesheet.finishDate)),o(4),C(" ",e.timesheet.totalHours),o(6),S($(19,21,e.timesheetStatuses)),o(6),m("ngClass",I(23,Fn,e.hasWeekendEntries)),o(),S(e.timesheet.days),o(2),h(e.timesheet.hasOvertime?26:-1),o(),h(e.timesheet.hasOvertime?-1:27),o(2),m("disabled",!e.canEdit||!!e.currentActivityInEditingMode||e.isSubmitting),o(),h(e.isCurrentWeek?30:31),o(8),m("hasSpotlight",e.spotlight.submitWeek),o(2),h(e.timesheet.activities.length?40:-1)}}var tt=(()=>{class t{constructor(e,i,n,d,x,O,it,nt,ot,yi,_i,fi,Ci,xi,bi){this.activatedRoute=e,this.sessionDataService=i,this.analyticsService=n,this.responsiveService=d,this.dynamicLocaleService=x,this.timerService=O,this.datePipe=it,this.dialog=nt,this.personService=ot,this.timesheetService=yi,this.searchService=_i,this.deliverableService=fi,this.snackbarService=Ci,this.introductionService=xi,this.aiAgentService=bi,this.isLoading=!0,this.isUpdatingAutoSubmit=!1,this.canEdit=!1,this.canSubmitWeek=!1,this.canUseTimer=!1,this.isSubmitting=!1,this.hasWeekendEntries=!1,this.isFilteredForToday=!1,this.spotlight={submitWeek:!1},this.ONBOARDING_PROJECT_NR=1}ngOnInit(){this.currentUser=this.sessionDataService.currentSessionData?.getCurrentPerson(),this.dayAndMonthFormat=this.dynamicLocaleService.getDayAndMonthMediumFormat(),this.timesheetStatuses=this.timesheetService.getTimesheetStatuses(),this.activatedRoute.params.subscribe(()=>{this.timesheetId=this.activatedRoute.snapshot.params.id,this.getTimesheet()}),this.timerActiveSubscription=this.timerService.isTimerActiveSubject.subscribe(()=>{setTimeout(()=>{this.initializeTimesheet()},0)}),this.timesheetUpdatedSubscription=this.timesheetService.timesheetUpdated.subscribe(e=>{e.id===this.timesheet.id&&(this.timesheet=e,this.initializeTimesheet())}),this.timerService.isTimerDisabledSubject.subscribe(e=>{this.isTimerDisabled=e}),this.introductionStepSubscription=this.introductionService.currentIntroductionStep$.subscribe({next:e=>{e==="submitTimeEntry"&&this.getAndSetIntroductionActivityId().subscribe(i=>{this.timesheet.activities.find(d=>d.resourceAllocation.activity.id===i)&&!this.canSubmitWeek?this.introductionService.markIntroductionStepAsDone("submitTimeEntry"):this.spotlight.submitWeek=e==="submitTimeEntry"}),e==="editTimeEntry"&&this.getAndSetIntroductionActivityId()}})}getAndSetIntroductionActivityId(){let e=new ce;return this.searchService.suggestProjects(this.ONBOARDING_PROJECT_NR.toString()).subscribe({next:i=>{let n=i.find(d=>d.projectNumber===this.ONBOARDING_PROJECT_NR);this.deliverableService.getDeliverables(n.id).subscribe({next:d=>{d.length>0&&this.deliverableService.getDeliverableCalculatedActivities(d[0].id,this.currentUser.id).subscribe({next:x=>{x.length>0&&(this.introductionActivityId=x[0].activity?.id,e.next(this.introductionActivityId))}})}})}}),e}updateTimesheet(e){this.timesheetService.updateTimesheet(e)}getTimesheet(){this.isLoading=!0,this.timesheetSubscription?.unsubscribe(),this.timesheetSubscription=this.timesheetService.getTimesheet(this.timesheetId).subscribe({next:e=>{this.timesheet=e.timesheet,this.context=e.context,this.isCurrentWeek=E.fromISO(this.timesheet.startDate).hasSame(E.now(),"week"),this.initializeTimesheet(),this.aiAgentService.updateActiveContext(this.timesheet),this.isCurrentWeek&&this.fetchAutoSubmitSetting()},error:()=>{this.isLoading=!1,this.timesheet=null,this.context=null},complete:()=>{this.isLoading=!1}})}openTimesheetEntryDialog(e){this.dialog.open(Je,{width:this.responsiveService.getDialogWidth({xs:"95vw"}),maxWidth:this.responsiveService.getDialogWidth({xs:"95vw",gtxs:"600px"}
1),data:{timeEntrySetId:e?.setId,timesheetId:this.timesheetId,resourceAllocationId:e?.resourceAllocation?.id,personId:this.timesheet.employee.id}}).afterClosed().subscribe(n=>{n&&(this.timesheet=n),this.initializeTimesheet()})}getCanEdit(e){let i={isSelf:this.currentUser.id===this.timesheet.employee.id,isPlaceholder:this.timesheet.employee.isPlaceholder,hasBackOfficePermission:this.currentUser.hasBackOfficePermission,canManageTimesheetsOthers:!!this.currentUser.canInsertAndSubmitTimeFromOtherUsers,isTimesheetLocked:this.timesheet.timesheetsLockedUntil?E.fromISO(this.timesheet.startDate).startOf("week")<E.fromISO(this.timesheet.timesheetsLockedUntil).startOf("week"):!1,isTimerActive:this.timerService.isTimerActive};return e&&e.project?.isClosed||i.isPlaceholder||this.isCurrentWeek&&i.isSelf&&i.isTimerActive||i.isTimesheetLocked&&!i.hasBackOfficePermission?!1:i.isSelf||i.canManageTimesheetsOthers}updateOvertimeDay(e){e&&this.getTimesheet()}prepareSubmitPayload(e){let i=[],n=E.now().startOf("day");return this.timesheet.days.forEach(d=>{let x={date:d.date,isSubmitted:!1},O=E.fromISO(d.date).startOf("day");(e==="upUntilYesterday"&&O<n||e==="upUntilToday"&&O<=n)&&(x.isSubmitted=!0),i.push(x)}),i}submitTimeSheet(e){let i;e==="upUntilYesterday"||e==="upUntilToday"?(i={days:this.prepareSubmitPayload(e)},this.analyticsService.trackUserAction({eventLabel:"SubmitDay",eventCategory:this.analyticsService.CATEGORIES.TIMESHEETS})):this.analyticsService.trackUserAction({eventLabel:"SubmitWeek",eventCategory:this.analyticsService.CATEGORIES.TIMESHEETS}),this.isSubmitting=!0,this.timesheetService.submitTimesheet(this.timesheet.id,i,this.hasWeekendEntries).subscribe({next:n=>{this.timesheet=n,this.initializeTimesheet(),this.introductionService.markIntroductionStepAsDone("submitTimeEntry"),this.snackbarService.showSnackbar("Timesheet submitted")},error:()=>{this.isSubmitting=!1,this.snackbarService.showSnackbar("Failed to submit the timesheet")},complete:()=>{this.isSubmitting=!1}})}ngOnDestroy(){this.timerActiveSubscription?.unsubscribe(),this.timesheetUpdatedSubscription?.unsubscribe(),this.activatedRouteStateSubscription?.unsubscribe(),this.introductionStepSubscription?.unsubscribe(),this.timesheetSubscription?.unsubscribe()}toggleFilterToday(){this.isFilteredForToday=!this.isFilteredForToday}setActivityInEditingMode(e){this.currentActivityInEditingMode=e}onChangeAutoSubmit(e){this.isAutoSubmitActive=e.checked,!this.isUpdatingAutoSubmit&&(this.isUpdatingAutoSubmit=!0,this.personService.setPersonAutoSubmitSetting(this.timesheet.employee.id,this.isAutoSubmitActive).subscribe({complete:()=>this.isUpdatingAutoSubmit=!1}))}fetchAutoSubmitSetting(){let e=this.timesheet.employee.id;this.personService.getPersonAutoSubmitSetting(e).subscribe(i=>{this.isAutoSubmitActive=!!i.isAutoSubmitTimeEntriesActive})}initializeTimesheet(){this.currentActivityInEditingMode=null,this.canEdit=this.getCanEdit(),this.canSubmitWeek=this.getCanSubmitWeek(),this.canUseTimer=this.isCurrentWeek&&this.currentUser.id===this.timesheet.employee.id,this.hasWeekendEntries=this.timesheetService.getHasWeekendEntries(this.timesheet.days),this.dayLabels=this.getDayLabels(),this.isPartOfTimesheetLocked=this.timesheetService.checkDayIsLockedForUser(this.timesheet.startDate,this.timesheet.timesheetsLockedUntil,this.currentUser),this.timesheet.activities.forEach(e=>{e.canEdit=this.getCanEdit(e)})}getDayLabels(){return this.timesheetService.getWeekdayLabels().map((i,n)=>this.datePipe.transform(this.timesheet.days[n].date,"dd/MM"))}getCanSubmitWeek(){return!this.getCanEdit()||this.isCurrentWeek&&this.timerService.isTimerActive?!1:this.timesheet.days.some(i=>i.status.id===this.timesheetStatuses.NO_TIME_ENTRIES.id&&!i.isSubmitted)?!0:this.timesheet.days.some(i=>i.status.id===this.timesheetStatuses.DRAFT.id||i.statusOvertime.id===this.timesheetStatuses.DRAFT.id)}static{this.\u0275fac=function(i){return new(i||t)(v(z),v(xe),v(be),v(H),v(Ce),v(qe),v(L),v(Y),v(Qt),v(V),v(ke),v(Ge),v(Z),v(te),v(St))}}static{this.\u0275cmp=k({type:t,selectors:[["vy-timesheet-page"]],standalone:!1,decls:4,vars:4,consts:[["submitMenu","matMenu"],["component","timesheet","ngClass.xs","phone"],[1,"config-toolbar"],["entityKind","timesheet"],["appearance","outlined","ngClass.xs","phone",1,"p-l"],[3,"change","checked","disabled"],[1,"vy-layout-row","vy-layout-align-start-center","vy-layout-gap-l"],[3,"entity","showFlag","size","title"],[1,"vy-flex","mat-headline-6","vy-pos-rel"],["svgIcon","lock",1,"lock-icon",3,"title"],[1,"mat-caption"],[1,"push-right","mat-headline-3"],[1,"mat-headline-5"],[1,"vy-layout-row","vy-layout-align-start-center"],[1,"spacer"],[1,"status-legend","tc-gray-500","mat-caption","vy-layout-row","vy-layout-align-start-center","vy-layout-gap-l"],[1,"vy-flex"],[1,"vy-layout-row","vy-layout-align-start-start"],["fxHide.xs","true",1,"spacer"],[1,"days-table","vy-layout-row","vy-layout-align-start-start","vy-layout-gap-l",3,"ngClass"],[3,"hasWeekendEntries","timesheet"],[1,"vy-header-actions","vy-layout-row","vy-layout-align-start-center","vy-layout-gap"],["color","primary","caption","Add time entry","svgIcon","plus-circle",3,"click","disabled"],["color","primary","caption","Submit week","svgIcon","check-circle","vySpotlight","",3,"disabled","hasSpotlight"],["mat-menu-item","",3,"click"],["mat-menu-item","","vySpotlight","",3,"click","hasSpotlight"],[1,"vy-layout-column","vy-layout-align-center-center"],[1,"vy-status",3,"ngClass"],["ngClass.lt-lg","break"],[1,"day-cell",3,"day-cell--holiday"],[1,"day-cell"],[1,"line-height-condensed"],[1,"mat-caption","tc-gray-500"],[3,"overtimeSpecificationChanged","hasWeekendEntries","timesheet"],["color","primary","caption","Submit...","svgIcon","check-circle","vySpotlight","",3,"matMenuTriggerFor","disabled","hasSpotlight"],["caption","Today","tooltip","Only show time entries with time on today","svgIcon","filter-variant",3,"click","color","disabled"],["color","primary","caption","Submit week","svgIcon","check-circle","vySpotlight","",3,"click","disabled","hasSpotlight"],[1,"list"],[3,"timesheetUpd
1ated","editingModeChanged","timesheetActivity","timesheet","context","isTimerDisabled","activityInEditingMode","canUseTimer","introductionActivityId","isClosed","canEdit"]],template:function(i,n){i&1&&(p(0,Rn,1,0,"vy-skeleton-loader",1),p(1,Nn,3,2,"div",2),p(2,Wn,3,0,"vy-empty-state",3),p(3,eo,41,25,"mat-card",4)),i&2&&(h(n.isLoading?0:-1),o(),h(!n.isLoading&&n.timesheet&&n.isCurrentWeek?1:-1),o(),h(!n.isLoading&&!n.timesheet?2:-1),o(),h(!n.isLoading&&n.timesheet?3:-1))},dependencies:[U,R,A,j,Wt,Ht,Ie,Oe,Pe,F,Be,ee,He,ze,si,mi,L,Zt,di],styles:[".vy-status[_ngcontent-%COMP%]{--diagonals-rotation: 135deg;background-image:linear-gradient(var(--diagonals-rotation),rgba(255,255,255,.35) 12.5%,rgba(0,0,0,0) 12.5%,rgba(0,0,0,0) 50%,rgba(255,255,255,.45) 50%,rgba(255,255,255,.45) 62.5%,rgba(0,0,0,0) 62.5%,rgba(0,0,0,0) 100%);background-size:6.6667px 6.6667px;background-repeat:repeat}.spacer[_ngcontent-%COMP%]{width:72px;flex-shrink:0}.line-height-condensed[_ngcontent-%COMP%]{line-height:14px}.vy-status[_ngcontent-%COMP%]{height:4px;width:40px;margin:2px auto 0}.vy-status--draft[_ngcontent-%COMP%]{--diagonals-rotation: 45deg;background-color:var(--clr-accent-lighter)}.vy-status--submitted[_ngcontent-%COMP%]{background-color:#aed581}.vy-status--approved[_ngcontent-%COMP%]{background-color:#689f38}.vy-status--holiday[_ngcontent-%COMP%]{background-color:var(--clr-gray-300);background-image:none}.days-table[_ngcontent-%COMP%]{--table-margin-block: 0 1rem;--cell-margin-block: 1rem 0;margin-block:var(--table-margin-block)}.days-table[_ngcontent-%COMP%]   .day-cell[_ngcontent-%COMP%]{margin-block:var(--cell-margin-block);min-width:60px;text-align:center}.days-table[_ngcontent-%COMP%]   .day-cell--holiday[_ngcontent-%COMP%]{background-color:var(--clr-gray-300);color:var(--clr-gray-700);min-height:50px;border-radius:4px}.days-table[_ngcontent-%COMP%]   .break[_ngcontent-%COMP%]{flex-basis:100%;height:0}",".config-toolbar[_ngcontent-%COMP%]{margin:16px!important}.list[_ngcontent-%COMP%]{margin-top:16px!important}vy-skeleton-loader[_ngcontent-%COMP%], .mat-mdc-card[_ngcontent-%COMP%]{margin-right:16px!important;margin-left:16px!important}vy-skeleton-loader.phone[_ngcontent-%COMP%], .mat-mdc-card.phone[_ngcontent-%COMP%]{margin-right:0!important;margin-left:0!important}.status-legend[_ngcontent-%COMP%]{padding-right:8px!important}.config-toolbar[_ngcontent-%COMP%]{padding-bottom:8px!important}.list[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]{padding-top:8px!important;padding-bottom:8px!important}.status-legend[_ngcontent-%COMP%]{padding-top:4px!important}.p-l[_ngcontent-%COMP%]{padding:16px!important}vy-timesheet-overtime-section[_ngcontent-%COMP%]{padding-right:16px!important;padding-left:16px!important}[_nghost-%COMP%]{padding-top:16px!important;padding-bottom:16px!important}.mat-mdc-card[_ngcontent-%COMP%]   .mat-headline-3[_ngcontent-%COMP%]{margin-top:-8px!important}.mat-mdc-card[_ngcontent-%COMP%]   hr[_ngcontent-%COMP%]{margin-right:-8px!important;margin-left:-8px!important}vy-timesheet-overtime-section[_ngcontent-%COMP%]{margin-right:-16px!important;margin-left:-16px!important}[_nghost-%COMP%]{display:block}vy-skeleton-loader[_ngcontent-%COMP%]{max-width:600px}.mat-mdc-card[_ngcontent-%COMP%]{box-sizing:border-box;max-width:600px}.mat-mdc-card.phone[_ngcontent-%COMP%]{max-width:100%}.mat-mdc-card[_ngcontent-%COMP%]   .mat-headline-6[_ngcontent-%COMP%], .mat-mdc-card[_ngcontent-%COMP%]   h2[_ngcontent-%COMP%], .mat-mdc-card[_ngcontent-%COMP%]   h3[_ngcontent-%COMP%], .mat-mdc-card[_ngcontent-%COMP%]   .mat-headline-3[_ngcontent-%COMP%]{margin-bottom:0}.mat-mdc-card[_ngcontent-%COMP%]   hr[_ngcontent-%COMP%]{opacity:.25}.vy-pos-rel[_ngcontent-%COMP%]{position:relative}.lock-icon[_ngcontent-%COMP%]{position:absolute;right:32px;top:8px;color:var(--clr-gray-400);transform:scale(1.5)}.push-right[_ngcontent-%COMP%]{margin-right:-7px}.list[_ngcontent-%COMP%]{margin:0;padding:0;list-style:none}.list[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]:last-child{margin-bottom:0!important}.tc-black[_ngcontent-%COMP%]{color:var(--clr-black)}vy-timesheet-overtime-section[_ngcontent-%COMP%]{border-width:1px 0;border-style:solid;border-color:var(--clr-gray-300);background-color:var(--clr-gray-100)}.vy-one-line[_ngcontent-%COMP%]{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal}"]})}}return t})();var to=t=>[t],io=t=>[t,"navigate"],no=(t,s)=>s.id;function oo(t,s){t&1&&(a(0,"vy-skeleton-loader",3),re("vy-fade-in"),r()),t&2&&m("count",8)}function ao(t,s){if(t&1&&(a(0,"li"),u(1,"vy-timesheet-card",7)(2,"vy-timesheet-card",8),r()),t&2){let e=s.$implicit;o(),m("timesheet",e)("routerLink",I(4,to,e.id)),o(),m("timesheet",e)("routerLink",I(6,io,e.id))}}function ro(t,s){if(t&1&&(a(0,"ul",4),re("vy-fade-in"),b(1,ao,3,8,"li",null,no),r()),t&2){let e=c();o(),S(e.timesheets)}}function so(t,s){t&1&&u(0,"vy-loading-spinner",10),t&2&&m("diameter",30)}function lo(t,s){if(t&1){let e=T();a(0,"div",9),g("inViewport",function(){_(e);let n=c();return f(n.loadMore())}),p(1,so,1,1,"vy-loading-spinner",10),r()}if(t&2){let e=c(),i=D(2);m("scrollContainer",i),o(),h(e.timesheets.length?1:-1)}}var hi=(()=>{class t{constructor(e,i,n,d,x,O){this.router=e,this.currentRoute=i,this.responsiveService=n,this.timesheetService=d,this.introductionService=x,this.activatedRoute=O,this.isLoading=!1,this.hasMore=!0,this.initialTimesheetIndex=0}ngOnInit(){let e=history.state;this.personId=e?.personId,this.timesheets=[],this.router.events.pipe(de(i=>i instanceof Ct)).subscribe({next:()=>{this.setFullScreen()}}),this.introductionServiceSubscription=this.introductionService.currentIntroductionStep$.subscribe({next:i=>{this.currentIntroductionStep=i}}
1),this.loadMore(),this.timesheetUpdatedSubscription=this.timesheetService.timesheetUpdated.subscribe(i=>{let n=this.timesheets.findIndex(d=>d.id===i.id);n!==-1&&(this.timesheets[n]=i)})}ngOnDestroy(){this.timesheetUpdatedSubscription?.unsubscribe(),this.activatedRouteStateSubscription?.unsubscribe(),this.introductionServiceSubscription?.unsubscribe()}loadMore(){if(this.isLoading||!this.hasMore)return;let e={maxResults:14,personId:this.personId?this.personId:""};this.nextCursor&&(e.cursor=this.nextCursor),this.isLoading=!0,this.timesheetService.getTimesheetList(e).subscribe({next:i=>{this.hasMore=i.more,this.nextCursor=i.nextCursor,this.timesheets.push(...i.timesheets);let n=this.initialTimesheet;!this.shouldShowTimesheetFullscreen&&n.id===i.timesheets[this.initialTimesheetIndex].id&&(this.activatedRouteStateSubscription=this.activatedRoute.paramMap.pipe(me(()=>window.history.state)).subscribe({next:d=>{this.responsiveService.isHandset()?this.router.navigate([n.id,"navigate"],{relativeTo:this.currentRoute,state:d}):this.router.navigate([n.id],{relativeTo:this.currentRoute,state:d})}}))},error:()=>{this.isLoading=!1,this.hasMore=!1},complete:()=>this.isLoading=!1})}get initialTimesheet(){return this.timesheets[this.initialTimesheetIndex]}setFullScreen(){let e=this.currentRoute.firstChild;e&&e.snapshot.data?this.shouldShowTimesheetFullscreen=typeof e.snapshot.data.inNavigation=="string":this.shouldShowTimesheetFullscreen=!1}static{this.\u0275fac=function(i){return new(i||t)(v(_e),v(z),v(H),v(V),v(te),v(z))}}static{this.\u0275cmp=k({type:t,selectors:[["vy-timesheets"]],standalone:!1,decls:8,vars:5,consts:[["lazyloadScrollContainer",""],["ngClass.gt-sm","vy-layout-gap-l",1,"vy-layout-row","vy-layout-align-start-start",2,"height","100%"],["ngClass.lt-md","vy-flex phone","ngClass.gt-sm","small-scrollbars",1,"overflow-container",3,"fxHide"],["component","card","layout","list",3,"count"],[1,"list"],["vyInViewport","",3,"scrollContainer"],[1,"vy-flex","overflow-container","single-timesheet",3,"fxShow.lt-md"],["fxHide.lt-md","true","routerLinkActive","active",3,"timesheet","routerLink"],["fxHide.gt-sm","true",3,"timesheet","routerLink"],["vyInViewport","",3,"inViewport","scrollContainer"],[3,"diameter"]],template:function(i,n){i&1&&(a(0,"div",1)(1,"div",2,0),p(3,oo,1,1,"vy-skeleton-loader",3),p(4,ro,3,0,"ul",4),p(5,lo,2,2,"div",5),r(),a(6,"div",6),u(7,"router-outlet"),r()()),i&2&&(o(),m("fxHide",n.shouldShowTimesheetFullscreen),o(2),h(!n.timesheets.length&&n.isLoading?3:-1),o(),h(n.timesheets.length?4:-1),o(),h(n.hasMore?5:-1),o(),m("fxShow.lt-md",n.shouldShowTimesheetFullscreen))},dependencies:[xt,fe,bt,R,A,N,ee,$e,Xt],styles:['.list[_ngcontent-%COMP%]   vy-timesheet-card[_ngcontent-%COMP%]{margin-top:16px!important;margin-bottom:16px!important}vy-loading-spinner[_ngcontent-%COMP%]{margin:24px!important}.single-timesheet[_ngcontent-%COMP%]   .mat-mdc-card[_ngcontent-%COMP%]{margin-right:24px!important;margin-left:24px!important}.phone[_ngcontent-%COMP%]   vy-skeleton-loader[_ngcontent-%COMP%], .phone[_ngcontent-%COMP%]   .list[_ngcontent-%COMP%]{padding-right:8px!important;padding-left:8px!important}vy-skeleton-loader[_ngcontent-%COMP%], .list[_ngcontent-%COMP%]{padding-right:24px!important;padding-left:24px!important}.list[_ngcontent-%COMP%]   vy-timesheet-card.active[_ngcontent-%COMP%]{margin-bottom:-8px!important}.list[_ngcontent-%COMP%]   vy-timesheet-card.active[_ngcontent-%COMP%]{margin-right:-8px!important;margin-left:-8px!important}[_nghost-%COMP%]{display:block;box-sizing:border-box;overflow:hidden;height:100%;padding:2px 0}.small-scrollbars[_ngcontent-%COMP%]{--track-width: .5rem}.small-scrollbars[_ngcontent-%COMP%]::-webkit-scrollbar{width:var(--track-width);height:var(--track-width)}.small-scrollbars[_ngcontent-%COMP%]::-webkit-scrollbar-track{background-color:#00000008;border-radius:var(--track-width)}.small-scrollbars[_ngcontent-%COMP%]:hover::-webkit-scrollbar-track{background-color:#0000000d}.small-scrollbars[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{border-radius:var(--track-width);background-color:#0000001f}.small-scrollbars[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background-color:#00000042}.overflow-container[_ngcontent-%COMP%]{overflow-x:hidden;overflow-y:scroll;height:100%;border-right:1px solid rgba(0,0,0,.1)}.overflow-container.phone[_ngcontent-%COMP%]{border-color:transparent}vy-skeleton-loader[_ngcontent-%COMP%]{min-width:360px}.phone[_ngcontent-%COMP%]   vy-skeleton-loader[_ngcontent-%COMP%]{min-width:auto;max-width:360px;margin:0 auto}.list[_ngcontent-%COMP%]{margin:0;padding:0;list-style:none;min-width:360px}.phone[_ngcontent-%COMP%]   .list[_ngcontent-%COMP%]{min-width:auto;max-width:360px;margin:0 auto}.list[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]{min-width:360px}.phone[_ngcontent-%COMP%]   .list[_ngcontent-%COMP%] > li[_ngcontent-%COMP%]{min-width:auto;width:100%}.list[_ngcontent-%COMP%]   vy-timesheet-card[_ngcontent-%COMP%]{position:relative;transition:all .2s ease-in-out}.list[_ngcontent-%COMP%]   vy-timesheet-card.active[_ngcontent-%COMP%]{box-shadow:0 3px 5px -1px #0003,0 6px 10px #00000024,0 1px 18px #0000001f}.list[_ngcontent-%COMP%]   vy-timesheet-card.active[_ngcontent-%COMP%]:after{content:"";position:absolute;inset:0;border-radius:6px;border:2px solid var(--clr-primary-lighter)}']})}}return t})();var co=t=>({"two-columns":t}),ne=(t,s)=>s.id;function mo(t,s){t&1&&(a(0,"mat-option",6),u(1,"vy-loading-spinner",16),r()),t&2&&m("disabled",!0)}function po(t,s){t&1&&(a(0,"mat-option",7),l(1," No results! "),r()),t&2&&m("disabled",!0)}function ho(t,s){if(t&1&&(a(0,"mat-option",10)(1,"div",17),u(2,"vy-avatar-image",18),a(3,"div",19)(4,"div",20),l(5),r(),a(6,"div",21),l(7),r()()()()),t&2){let e=s.$implicit;m("value",e),o(2),m("entity",e),o(3),y(e.name),o(2),y(e.organizationName)}}function uo(t,s){if(t&1&&b(0,ho,8,4,"mat-option",10,ne),t&2){let e=c();S(e.projectOptions)}}function vo(t,s){if(t&1&&(a(0,"mat-option",10),l(1),r()),t&2){let e=s.$implicit;m("value",e.id),o(),C(" ",e.name," ")}}function go(t,s){t&1&&(a(0,"mat-option",6),l(1," No deliverables, please select a different project. "),r()),t&2&&m("disabled",!0)}function yo(t,s){t&1&&(a(0,"mat-option",6),u(1,"vy-loading-spinner",16),r()),t&2&&m("disabled",!0)}function _o(t,s){t&1&&(a(0,"mat-error"),l(1," Please select a deliverable. "),r())}function fo(t,s){if(t&1&&(a(0,"mat-option",10),l(1),r()),t&2){let e=s.$implicit;m("value",e.id),o(),C(" ",e.title," ")}}function Co(t,s){t&1&&(a(0,"mat-option",6),u(1,"vy-loading-spinner",16),r()),t&2&&m("disabled",!0)}function xo(t,s){t&1&&(a(0,"mat-option",6),l(1," No tasks, please select a different deliverable. "),r()),t&2&&m("disabled",!0)}function bo(t,s){if(t&1&&(a(0,"mat-option",10),l(1),r()),t&2){let e=s.$implicit;m("value",e.id),o(),C(" ",e.name," ")}}function So(t,s){t&1&&(a(0,"mat-option",6),l(1," No activities, please select a different task. "),r()),t&2&&m("disabled",!0)}function To(t,s){t&1&&(a(0,"mat-option",6),u(1,"vy-loading-spinner",16),r()),t&2&&m("disabled",!0)}function Mo(t,s){if(t&1&&(a(0,"mat-form-field",22)(1,"mat-label"),l(2,"Task *"),r(),a(3,"mat-select",23),b(4,fo,2,2,"mat-option",10,ne),p(6,Co,2,1,"mat-option",6),p(7,xo,2,1,"mat-option",6),r()(),a(8,"mat-form-field",3)(9,"mat-label"),l(10,"Activity"),r(),a(11,"mat-select",24),b(12,bo,2,2,"mat-option",10,ne),p(14,So,2,1,"mat-option",6),p(15,To,2,1,"mat-option",6),r()()),t&2){let e=c();o(4),S(e.taskOptions),o(2),h(e.isLoadingTasks?6:-1),o(),h(!e.taskOptions.length&&!e.isLoadingTasks?7:-1),o(5),S(e.activityOptions),o(2),h(!e.activityOptions.length&&!e.isLoadingCalculationLine
1s?14:-1),o(),h(e.isLoadingCalculationLines?15:-1)}}function Eo(t,s){if(t&1&&(a(0,"mat-option",10),l(1),r()),t&2){let e=s.$implicit;m("value",e.id),o(),C(" ",e.name," ")}}function ko(t,s){t&1&&(a(0,"mat-option",6),l(1," No activities, please select a different deliverable. "),r()),t&2&&m("disabled",!0)}function Oo(t,s){t&1&&(a(0,"mat-option",6),u(1,"vy-loading-spinner",16),r()),t&2&&m("disabled",!0)}function Io(t,s){if(t&1&&(a(0,"mat-option",10),l(1),r()),t&2){let e=s.$implicit;m("value",e.id),o(),C(" ",e.title," ")}}function Po(t,s){t&1&&(a(0,"mat-option",6),l(1," No tasks, please select a different activity. "),r()),t&2&&m("disabled",!0)}function Ao(t,s){t&1&&(a(0,"mat-option",6),u(1,"vy-loading-spinner",25),r()),t&2&&(m("disabled",!0),o(),m("diameter",20))}function wo(t,s){if(t&1&&(a(0,"mat-form-field",3)(1,"mat-label"),l(2,"Task"),r(),a(3,"mat-select",23),b(4,Io,2,2,"mat-option",10,ne),p(6,Po,2,1,"mat-option",6),p(7,Ao,2,2,"mat-option",6),r()()),t&2){let e=c(2);o(4),S(e.taskOptions),o(2),h(!e.taskOptions.length&&!e.isLoadingTasks?6:-1),o(),h(e.isLoadingTasks?7:-1)}}function Do(t,s){if(t&1&&(a(0,"mat-form-field",3)(1,"mat-label"),l(2,"Activity"),r(),a(3,"mat-select",24),b(4,Eo,2,2,"mat-option",10,ne),p(6,ko,2,1,"mat-option",6),p(7,Oo,2,1,"mat-option",6),r()(),p(8,wo,8,2,"mat-form-field",3)),t&2){let e=c();o(4),S(e.calculationLineOptions),o(2),h(!e.calculationLineOptions.length&&!e.isLoadingCalculationLines?6:-1),o(),h(e.isLoadingCalculationLines?7:-1),o(),h(e.taskOptions.length>0?8:-1)}}var ui=(()=>{class t{constructor(e,i,n,d,x,O){this.searchService=e,this.taskService=i,this.deliverableService=n,this.snackbarService=d,this.dynamicLocaleService=x,this.globalSettingsService=O,this.dateFormat=this.dynamicLocaleService.getDayAndMonthLargeFormat(),this.projectOptions=[],this.deliverableOptions=[],this.calculationLineOptions=[],this.activityOptions=[],this.taskOptions=[],this.destroyed$=new ce}
1ngOnInit(){if(this.deliverableOptions=this.timesheetSubmitSetResponse.deliverableOptions,this.calculationLineOptions=this.timesheetSubmitSetResponse.calculationLineOptions,this.taskOptions=this.timesheetSubmitSetResponse.taskOptions,this.isDeliverableTask=this.timeEntryForm.get("isDeliverableTask").value,this.isDeliverableTask){let e=this.taskOptions.find(i=>i.id===this.timeEntryForm.get("taskId").value);this.activityOptions=e.taskCalculationLines.map(i=>({id:i.calculationLine.id,name:i.activity.name}))}this.setHoursValidationPattern(),this.initForm()}initForm(){this.timeEntryForm.get("project").valueChanges.pipe(oe(this.destroyed$),ut(""),de(e=>e?.length>1),pt(150),ht()).subscribe(e=>{this.fetchSuggestedProjects(e)}),this.timeEntryForm.get("deliverableId").valueChanges.pipe(oe(this.destroyed$)).subscribe(e=>this.onDeliverableSelected(e)),this.timeEntryForm.get("calculatedActivityId").valueChanges.pipe(oe(this.destroyed$)).subscribe(e=>this.onCalculatedActivitySelected(e)),this.timeEntryForm.get("taskId").valueChanges.pipe(oe(this.destroyed$)).subscribe(e=>{this.isDeliverableTask&&this.onTaskSelected(e)})}fetchSuggestedProjects(e){this.isLoadingProjects=!0,this.searchService.suggestProjects(e).subscribe({next:i=>{this.projectOptions=i},complete:()=>this.isLoadingProjects=!1})}onProjectSelected(){let e=this.timeEntryForm.get("project").value.id;this.clearFormAndErrors(),this.fetchDeliverables(e)}clearFormAndErrors(){this.deliverableOptions=[],this.timeEntryForm.get("deliverableId")?.setValue(null),this.calculationLineOptions=[],this.activityOptions=[],this.timeEntryForm.get("calculatedActivityId")?.setValue(null),this.taskOptions=[],this.timeEntryForm.get("taskId")?.setValue(null)}fetchDeliverables(e){this.isLoadingDeliverables||!e||(this.isLoadingDeliverables=!0,this.deliverableService.getDeliverables(e).pipe(me(i=>i.filter(n=>!n.isClosed))).subscribe({next:i=>{this.deliverableOptions=i,this.deliverableOptions.length===1&&(this.timeEntryForm.get("deliverableId").patchValue(this.deliverableOptions[0].id),this.onDeliverableSelected(this.deliverableOptions[0].id))},error:i=>{this.showToastWithServerMessage(i,"Something went wrong getting a deliverable"),this.isLoadingDeliverables=!1},complete:()=>{this.isLoadingDeliverables=!1}}))}onTaskSelected(e){e&&(this.isLoadingCalculationLines=!0,this.taskService.getTask(e).subscribe({next:i=>{this.activityOptions=i.task.taskCalculationLines.map(n=>
1({id:n.calculationLine.id,name:n.activity.name})),this.activityOptions.length===1&&this.timeEntryForm.get("calculatedActivityId").patchValue(this.calculationLineOptions[0].id)},error:()=>this.isLoadingCalculationLines=!1,complete:()=>this.isLoadingCalculationLines=!1}))}onCalculatedActivitySelected(e){if(!e||this.isDeliverableTask||this.isLoadingTasks)return;this.taskOptions=[];let i=this.isDeliverableTask?null:this.timesheetSubmitSetResponse.employee.id;this.isLoadingTasks=!0,this.taskService.getTasksForCalculationLine(e,i).subscribe({next:n=>{this.taskOptions=n,this.taskOptions.length>0&&this.taskOptions.unshift({id:"-",title:"-"}),this.isLoadingTasks=!1},error:()=>{this.snackbarService.showSnackbar("Something went wrong getting a task"),this.isLoadingTasks=!1}})}onDeliverableSelected(e){if(!e||this.isLoadingCalculationLines)return;this.isLoadingCalculationLines=!0;let i=this.deliverableOptions.find(n=>n.id===e);if(this.isDeliverableTask=i.hasTasks,this.timeEntryForm.get("calculatedActivityId").reset(),this.timeEntryForm.get("taskId").reset(),this.isDeliverableTask){this.isLoadingCalculationLines=!1,this.getTasksForDeliverableAndEmployee(e,this.timesheetSubmitSetResponse.employee.id);return}this.fetchCalculationLineOptions(e)}fetchCalculationLineOptions(e){this.deliverableService.getDeliverableCalculatedActivities(e,this.timesheetSubmitSetResponse.employee.id).subscribe({next:i=>{this.calculationLineOptions=i,this.calculationLineOptions.length===1&&(this.timeEntryForm.get("calculatedActivityId").patchValue(this.calculationLineOptions[0].id),this.onCalculatedActivitySelected(this.calculationLineOptions[0].id))},error:()=>{this.snackbarService.showSnackbar("Something went wrong getting an activity"),this.isLoadingCalculationLines=!1},complete:()=>{this.isLoadingCalculationLines=!1}})}getTasksForDeliverableAndEmployee(e,i){this.isLoadingTasks=!0,this.taskService.getTasksForDeliverableAndEmployee(e,i).subscribe({next:n=>{this.taskOptions=n},error:()=>this.isLoadingTasks=!1,complete:()=>this.isLoadingTasks=!1})}setHoursValidationPattern(){this.globalSettingsService.isTimeEntryRoundingEnabled()?(this.hoursValidationPattern=/^[0-9]+((.|,)(0|00|25|5|50|75))?$/,this.steps="0.25"):(this.hoursValidationPattern=/^[0-9]+(\.[0-9]{1,2})?$/,this.steps="1")}ngOnDestroy(){this.destroyed$.next(!0)}getObjectName(e){return e?e.name:""}showToastWithServerMessage(e,i="Something went wrong, please try again later"){e?.error?.error?.message?this.snackbarService.showSnackbar(e.error.error.message):this.snackbarService.showSnackbar(i)}static{this.\u0275fac=function(i){return new(i||t)(v(ke),v(ti),v(Ge),v(Z),v(Ce),v(q))}}static{this.\u0275cmp=k({type:t,selectors:[["vy-modify-time-entry-form"]],inputs:{timeEntryForm:"timeEntryForm",timesheetSubmitSetResponse:"timesheetSubmitSetResponse"},standalone:!1,decls:37,vars:18,consts:[["auto","matAutocomplete"],[3,"formGroup"],[1,"field-grid-layout",3,"ngClass"],["appearance","outline",1,"vy-flex"],["type","text","matInput","","formControlName","project",3,"matAutocomplete"],[3,"optionSelected","displayWith"],[3,"disabled"],[1,"mat-body-2",3,"disabled"],["matSuffix","","svgIcon","magnify","color","gray-500"],["formControlName","deliverableId"],[3,"value"],[1,"field-grid-layout"],["appearance","outline",1,"vy-small-60","vy-flex"],["matInput","","type","number","min","0","max","24","formControlName","hours","autocomplete","off",1,"vy-no-spinner",3,"step"],["appearance","outline",1,"col-span-2","vy-flex"],["matInput","","formControlName","reference","autocomplete","off"],["diameter","20"],[1,"vy-layout-row","vy-layout-align-start-center","vy-layout-gap"],["size","32",3,"entity"],[1,"vy-flex"],[1,"mat-body-2"],[1,"mat-caption"],["appearance","outline"],["formControlName","taskId"],["formControlName","calculatedActivityId"],[3,"diameter"]],template:function(i,n){if(i&1&&(a(0,"div",1),u(1,"br"),a(2,"h3"),l(3),M(4,"vyDate"),r(),a(5,"div",2)(6,"mat-form-field",3)(7,"mat-label"),l(8,"Project"),r(),u(9,"input",4),a(10,"mat-autocomplete",5,0),g("optionSelected",function(){return n.onProjectSelected()}),p(12,mo,2,1,"mat-option",6),p(13,po,2,1,"mat-option",7),p(14,uo,2,0),u(15,"mat-divider"),r(),u(16,"mat-icon",8),r(),a(17,"mat-form-field",3)(18,"mat-label"),l(19,"Deliverable"),r(),a(20,"mat-select",9),b(21,vo,2,2,"mat-option",10,ne),p(23,go,2,1,"mat-option",6),p(24,yo,2,1,"mat-option",6),r(),p(25,_o,2,0,"mat-error"),r(),p(26,Mo,16,4)(27,Do,9,3),r(),a(28,"div",11)(29,"mat-form-field",12)(30,"mat-label"),l(31,"Hours"),r(),u(32,"input",13),r(),a(33,"mat-form-field",14)(34,"mat-label"),l(35,"Note"),r(),u(36,"input",15),r()()()),i&2){let d=D(11);m("formGroup",n.timeEntryForm),o(3),y(P(4,13,n.timeEntryForm.get("date").value,
1n.dateFormat)),o(2),m("ngClass",I(16,co,n.isDeliverableTask)),o(4),m("matAutocomplete",d),o(),m("displayWith",n.getObjectName),o(2),h(n.isLoadingProjects?12:-1),o(),h(n.projectOptions.length===0&&!n.isLoadingProjects?13:-1),o(),h(n.projectOptions.length>0&&!n.isLoadingProjects?14:-1),o(7),S(n.deliverableOptions),o(2),h(!n.deliverableOptions.length&&!n.isLoadingDeliverables?23:-1),o(),h(n.isLoadingDeliverables?24:-1),o(),h(n.timeEntryForm.get("deliverableId").hasError("requiredForActivity")?25:-1),o(),h(n.isDeliverableTask?26:27),o(6),m("step",n.steps)}},dependencies:[U,Ae,Fe,we,Q,Dt,Ve,Le,wt,A,Nt,j,We,Ne,Re,X,Ut,Ue,je,$t,zt,F,N,L],styles:["footer[_ngcontent-%COMP%]{padding:16px!important}[_nghost-%COMP%]{display:block;height:100%}.field-grid-layout[_ngcontent-%COMP%]{--columns-template: 1fr 1fr 1fr;display:grid;grid-template-columns:var(--columns-template);column-gap:16px}.field-grid-layout.two-columns[_ngcontent-%COMP%]{--columns-template: 1fr 1fr}.field-grid-layout[_ngcontent-%COMP%]   .col-span-2[_ngcontent-%COMP%]{grid-column:2/-1}@media screen and (max-width:599.9px){.field-grid-layout[_ngcontent-%COMP%], .field-grid-layout.two-columns[_ngcontent-%COMP%]{--columns-template: 1fr}.field-grid-layout[_ngcontent-%COMP%]   .col-span-2[_ngcontent-%COMP%]{grid-column:auto}}.mat-icon[color=gray-500][_ngcontent-%COMP%]{color:var(--clr-gray-500)}.vy-sticky-mask[_ngcontent-%COMP%]{margin-bottom:-2px;background-color:var(--clr-white);z-index:11;height:10px}footer[_ngcontent-%COMP%]{box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f;position:sticky;bottom:0;z-index:10;background-color:var(--clr-white)}"]})}}return t})();function Lo(t,s){t&1&&u(0,"vy-loading-spinner")}function Vo(t,s){if(t&1&&(a(0,"div"),u(1,"vy-modify-time-entry-form",15),r()),t&2){let e=s.$implicit,i=c(2);o(),m("timesheetSubmitSetResponse",i.timesheetSubmitSetResponse)("timeEntryForm",i.asFormGroup(e))}}function jo(t,s){if(t&1){let e=T();a(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),u(5,"vy-avatar-image",5),a(6,"div",6)(7,"div",7),l(8),M(9,"vyDate"),M(10,"vyDate"),r(),a(11,"span"),l(12),r()()(),a(13,"div",4),u(14,"vy-avatar-image",5),a(15,"div",6)(16,"div",7),l(17),r(),a(18,"span"),l(19),r()()()()(),a(20,"form",8)(21,"div",9),b(22,Vo,2,2,"div",null,w),r()()(),u(24,"div",10),a(25,"footer")(26,"div",11)(27,"div",12)(28,"button",13),g("click",function(){_(e);let n=c();return f(n.cancel())}),l(29,"Cancel"),r(),a(30,"button",14),g("click",function(){_(e);let n=c();return f(n.save())}),l(31," Approve "),r()()()(),u(32,"div",10),r()}if(t&2){let e=c();o(5),m("entity",e.timesheetSubmitSetResponse.employee)("size",48),o(3),gt(" Week ",e.timesheetSubmitSetResponse.week,": ",$(9,12,e.timesheetSubmitSetResponse.startDate)," - ",$(10,14,e.timesheetSubmitSetResponse.finishDate)," "),o(4),y(e.timesheetSubmitSetResponse.employee.name),o(2),m("entity",e.timesheetSubmitSetResponse.project)("size",48),o(3),y(e.timesheetSubmitSetResponse.project.name),o(2),y(e.timesheetSubmitSetResponse.project.organizationName),o(),m("formGroup",e.modifyTimeEntriesForm),o(2),S(e.timesheetEntryForms.controls),o(8),m("disabled",e.isLoading||!e.modifyTimeEntriesForm.valid)}}var vi=(()=>{class t{get timesheetEntryForms(){return this.modifyTimeEntriesForm.controls.timeEntries}constructor(e,i,n,d,x,O){this.activatedRoute=e,this.location=i,this.snackbarService=n,this.feedItemService=d,this.fb=x,this.timesheetService=O,this.isLoading=!0}ngOnInit(){this.timeEntrySetId=this.activatedRoute.snapshot.paramMap.get("id"),this.eventPerSubscriptionId=this.activatedRoute.snapshot.queryParams.eventPerSubscriptionId,this.timesheetService.getTimeEntrySubmitSetForm(this.timeEntrySetId).subscribe({next:e=>{this.timesheetSubmitSetResponse=e,this.initForm()},complete:()=>this.isLoading=!1})}initForm(){this.modifyTimeEntriesForm=this.fb.group({timeEntries:new Pt([])}),this.timesheetSubmitSetResponse.timesheetEntries.forEach(e=>{let i=this.fb.group({id:[e.id],hours:[e.hours,[K.required,K.pattern(this.hoursValidationPattern)]],date:[e.date],reference:[e.reference],project:[this.timesheetSubmitSetResponse.project,K.required],deliverableId:[e.deliverableId,K.required],calculatedActivityId:[e.calculatedActivityId,K.required],taskId:[e.taskId],isDeliverableTask:[e.isDeliverableTask]});e.hours<0&&(i.get("hours").disable(),i.get("project").disable(),i.get("deliverableId").disable(),i.get("calculatedActivityId").disable(),i.get("taskId").disable()),this.timesheetEntryForms.push(i)})}save(){let e=this.getPayload();this.isLoading=!0,this.timesheetService.modifySubmittedTimeEntries(this.timeEntrySetId,e).subscribe({next:()=>{this.isLoading=!1,this.snackbarService.showSnackbar("Timesheet approved")},error:i=>{this.showToastWithServerMessage(i),this.isLoading=!1},complete:()=>
1{this.feedItemService.notifyStoresAndFeedOfRemoval(this.eventPerSubscriptionId),this.location.back()}})}getPayload(){let e={timesheetEntrySubmitSetId:this.timeEntrySetId,eventPerSubscriptionId:this.eventPerSubscriptionId,timesheetEntries:this.modifyTimeEntriesForm.getRawValue().timeEntries};return e.timesheetEntries.forEach(i=>{i.projectId=i.project.id}),e}cancel(){this.location.back()}showToastWithServerMessage(e,i="Something went wrong, please try again later"){e?.error?.error?.message?this.snackbarService.showSnackbar(e.error.error.message):this.snackbarService.showSnackbar(i)}asFormGroup(e){return e}static{this.\u0275fac=function(i){return new(i||t)(v(z),v(_t),v(Z),v(Jt),v(Vt),v(V))}}static{this.\u0275cmp=k({type:t,selectors:[["vy-modify-time-entries"]],standalone:!1,decls:2,vars:2,consts:[[1,"vy-layout-column","vy-layout-fill"],["ngClass.gt-xs","vy-layout-centered-compact","ngClass.xs","p-l"],[1,"vy-layout-column","pt-l"],["ngClass.gt-xs","vy-layout-row",1,"vy-layout-column","vy-layout-gap-l"],[1,"vy-layout-row","vy-layout-align-start-center","vy-layout-gap-l","vy-flex"],[3,"entity","size"],[1,"vy-flex"],[1,"mat-body-1","vy-strong","mb0"],[1,"pt-l",3,"formGroup"],["formArrayName","timeEntries"],[1,"vy-sticky-mask"],[1,"vy-layout-centered-compact"],[1,"vy-layout-row","vy-layout-align-end-center","vy-layout-gap"],["mat-button","","color","primary",3,"click"],["mat-raised-button","","color","primary",3,"click","disabled"],[3,"timesheetSubmitSetResponse","timeEntryForm"]],template:function(i,n){i&1&&(p(0,Lo,1,0,"vy-loading-spinner"),p(1,jo,33,16,"div",0)),i&2&&(h(n.isLoading?0:-1),o(),h(n.isLoading?-1:1))},dependencies:[De,Q,Le,At,A,Ee,F,N,ui,L],styles:["vy-loading-spinner[_ngcontent-%COMP%]{margin-top:32px!important;margin-bottom:32px!important}.p-l[_ngcontent-%COMP%], footer[_ngcontent-%COMP%]{padding:16px!important}.pt-l[_ngcontent-%COMP%]{padding-top:16px!important}[_nghost-%COMP%]{display:block;height:100%}.vy-sticky-mask[_ngcontent-%COMP%]{margin-bottom:-2px;background-color:#fff;z-index:11;height:10px}footer[_ngcontent-%COMP%]{box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f;position:sticky;bottom:0;z-index:10;background-color:#fff}"]})}}return t})();var Ro=[{path:"list",component:hi,data:{title:"Timesheets"},children:[{path:":id/navigate",pathMatch:"full",component:tt,data:{title:"Timesheet",inNavigation:"mobile"}},{path:":id",pathMatch:"full",component:tt,data:{title:"Timesheets"}}]},{path:":id",component:tt,data:{title:"Timesheet"}},{path:"modify-time-entries/:id",component:vi,data:{title:"Modify Time entries",inNavigation:!0}},{path:"",pathMatch:"full",redirectTo:"list",data:{title:"Timesheets"}}],gi=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=he({type:t})}static{this.\u0275inj=pe({imports:[rt.forChild(Ro),rt]})}}return t})();var br=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=he({type:t})}static{this.\u0275inj=pe({imports:[ft,gi,ei,jt,Rt,Et,Gt,F,Be,N,ee,He,Ye,$e]})}}return t})();export{br as TimesheetModule};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.