1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/common-DdYwb9D_.js","assets/rolldown-runtime-BEU_UCik.js","assets/common-D1oDIdhb.css","assets/move-modal-C8qyGoEy.js","assets/change-parent-modal-hHqoi_2G.js","assets/duplicate-modal-OQlmVN-P.js","assets/duplicate-modal-B3fcDvGK.css","assets/template-modal-GEqa5Mx2.js","assets/context-COtBVUVZ.js"])))=>i.map(i=>d[i]); 2import{r as t}from"./rolldown-runtime-BEU_UCik.js";import{$D as e,BJ as s,BT as a,Bz as i,CD as o,CJ as r,CW as n,Cd as l,DG as c,DW as d,EE as u,EW as h,Ei as p,FW as m,HJ as k,ID as v,IW as g,JJ as y,JL as f,KD as T,LC as b,MD as M,MJ as w,M_ as F,NG as S,OJ as A,Oi as P,Pi as W,Pq as j,QG as C,QJ as _,RJ as D,Rt as R,SJ as E,SW as O,Vd as I,Vz as L,WL as B,XJ as x,YD as N,YJ as z,_C as U,_k as H,aw as J,cD as V,cG as K,cK as q,ck as G,dY as Y,dv as Q,fW as Z,gC as $,gU as X,gY as tt,hR as et,hb as st,iU as at,jJ as it,jW as ot,kg as rt,lR as nt,oM as lt,pG as ct,pR as dt,qJ as ut,rY as ht,ra as pt,sG as mt,sv as kt,uR as vt,vJ as gt,vv as yt,wJ as ft,xW as Tt,xg as bt,yW as Mt,yY as wt,zJ as Ft}from"./common-DdYwb9D_.js";var St;function At(t){t.close()}var Pt,Wt=new WeakMap,jt=new WeakMap,Ct=new WeakMap,_t=new WeakMap,Dt=new WeakMap,Rt=new WeakMap,Et=class{constructor(t){ht(this,Wt,void ft(this,"formsHandler")),ht(this,jt,void ft(this,"metrics")),ht(this,Ct,void ft(this,"ui")),ht(this,_t,void ft(this,"routing")),ht(this,Dt,void ft(this,"intl")),ht(this,Rt,void ft(this,"form")),wt(this,"afterSubmit",void 0),Y(this,t),A(this,At)}show(t,e={}){this.form=this.formsHandler.createForm(R,[null,{task:t,disableAfterSubmitTransition:e.disableAfterSubmitTransition,isSaveAsTemplate:e.isSaveAsTemplate,isUseTemplate:e.isUseTemplate,trigger:e.trigger}]),this.afterSubmit=e.afterSubmit,e.templateTask&&(this.form.templateTask=e.templateTask)}close(){this.form&&(this.form.destroy(),this.form=null)}async submit(){const t=this.form;if(t)try{var e;const s=await this.formsHandler.submitForm(t);let a,i;null===(e=this.afterSubmit)||void 0===e||e.call(this),this.close(),t.args.isSaveAsTemplate?(a="task-save-as-template",i=this.intl.t("utils.task.actions.duplicate.successSaveTemplate")):t.args.isUseTemplate?(a="task-use-template",i=this.intl.t("utils.task.actions.duplicate.successUseTemplate")):(a="task-duplicate",i=this.intl.t("utils.task.actions.duplicate.success")),this.metrics.trackEventWithTrigger(a,t.args.trigger),this.ui.showSaveSuccessFlash(i,{id:s.id});const o=s&&s.id;o&&!t.args.disableAfterSubmitTransition&&this.routing.transitionTo("organization.task",o)}catch(s){if(s instanceof et)return;K(s)}}};function Ot(t){t.close()}E((St=Et).prototype,"formsHandler",[k]),E(St.prototype,"metrics",[k]),E(St.prototype,"ui",[k]),E(St.prototype,"routing",[k]),E(St.prototype,"intl",[k]),E(St.prototype,"form",[w],function(){return null}),r(St.prototype,"show",[z]),r(St.prototype,"close",[z]),r(St.prototype,"submit",[z]);var It,Lt=new WeakMap,Bt=new WeakMap,xt=new WeakMap,Nt=new WeakMap,zt=new WeakMap,Ut=new WeakMap,Ht=class{constructor(t){ht(this,Lt,void ft(this,"formsHandler")),ht(this,Bt,void ft(this,"metrics")),ht(this,xt,void ft(this,"ui")),ht(this,Nt,void ft(this,"store")),ht(this,zt,void ft(this,"dataSync")),ht(this,Ut,void ft(this,"form")),Y(this,t),A(this,Ot)}show(t,e){this.form=this.formsHandler.createForm(kt,[null,{bulkSaveTasks:t=>this.store.bulkUpdate(t),tasks:[t],afterSubmit:()=>{this.metrics.event("task-move").trigger(e).track()}}])}close(){this.form&&(this.form.destroy(),this.form=null)}async submit(){const t=this.form;if(!t)return;const e=t.project;t.args.tasks.forEach(t=>{var e,s;null===(e=t.taskDependencies)||void 0===e||e.forEach(t=>t.unloadRecord()),null===(s=t.subtasks)||void 0===s||s.slice().forEach(t=>{var e;return null===(e=t.taskDependencies)||void 0===e?void 0:e.forEach(t=>t.unloadRecord())})}),await this.formsHandler.submitForm(t),this.close(),this.ui.buildFlash().withComponent(Q,{project:e,taskCount:1}).closeAfter(5e3).showInfo(),this.dataSync.eventBus.trigger("task:move",e)}};function Jt(t){t.close()}E((Pt=Ht).prototype,"formsHandler",[k]),E(Pt.prototype,"metrics",[k]),E(Pt.prototype,"ui",[k]),E(Pt.prototype,"store",[k]),E(Pt.prototype,"dataSync",[k]),E(Pt.prototype,"form",[w],function(){return null}),r(Pt.prototype,"show",[z]),r(Pt.prototype,"close",[z]),r(Pt.prototype,"submit",[z]);var Vt,Kt=new WeakMap,qt=new WeakMap,Gt=new WeakMap,Yt=class{constructor(t){ht(this,Kt,void ft(this,"formsHandler")),ht(this,qt,void ft(this,"metrics")),ht(this,Gt,void ft(this,"form")),Y(this,t),A(this,Jt)}
2show(t){t.templateObject&&(this.form=this.formsHandler.createForm(I,[t.templateObject]))}close(){this.form&&(this.form.destroy(),this.form=null)}async submit(){const t=this.form;if(t){try{await this.formsHandler.submitForm(t,{include:"task"})}catch(e){if(e instanceof et)return;K(e)}this.close(),this.metrics.trackEvent("task-template-edit-details")}}};function Qt(t){t.togglePrivateTask.cancelAll(),t.toggleSubscriptionTask.cancelAll(),t.loadSubscribersTask.cancelAll()}E((It=Yt).prototype,"formsHandler",[k]),E(It.prototype,"metrics",[k]),E(It.prototype,"form",[w],function(){return null}),r(It.prototype,"show",[z]),r(It.prototype,"close",[z]),r(It.prototype,"submit",[z]);var Zt,$t=new WeakMap,Xt=new WeakMap,te=new WeakMap,ee=new WeakMap,se=new WeakMap,ae=new WeakMap,ie=new WeakMap,oe=new WeakMap,re=new WeakMap,ne=new WeakMap,le=new WeakMap,ce=new WeakMap,de=class{constructor(t,e){ht(this,$t,void ft(this,"store")),ht(this,Xt,void ft(this,"can")),ht(this,te,void ft(this,"ui")),ht(this,ee,void ft(this,"metrics")),ht(this,se,void ft(this,"notifications")),ht(this,ae,void ft(this,"dataSync")),ht(this,ie,void ft(this,"session")),ht(this,oe,void ft(this,"formsHandler")),ht(this,re,void ft(this,"intl")),wt(this,"delegate",void 0),wt(this,"toggleTaskSubscriptionFlash",void 0),wt(this,"togglePrivateTask",gt(()=>({context:this,generator:function*(t){var e,s;const a=this.can.abilityFor("project",t.project).canTrackTimeOnTasks,i=this.session.addons.isBookingsOnTasksEnabled;(t.private||!a||(yield this.ui.buildModal().title(this.intl.t("utils.task.actions-manager.togglePrivateWarningModalTitle",{hasBookings:i})).description(D(this.intl.t("utils.task.actions-manager.togglePrivateWarningModalDescription",{hasBookings:i}))).primaryActionText(this.intl.t("utils.task.actions-manager.togglePrivateWarningModalConfirm")).confirm({returnResult:!0})))&&(t.private=!t.private,yield this.store.patchSave(t,["private"],[]),null===(e=t.bookings)||void 0===e||e.forEach(t=>{this.store.unloadRecord(t)}),null===(s=t.timeEntries)||void 0===s||s.forEach(t=>{this.store.unloadRecord(t)}),this.metrics.event("task-update").withData({taskPrivacy:t.private?"private":"public"}).track(),t.private&&(yield this.loadSubscribers(t)))}}),null,"togglePrivateTask","keepLatest")),wt(this,"toggleSubscriptionTask",gt(()=>({context:this,generator:function*(t){var e,s,a;const i=t.model,o=this.session.currentPerson;if(!o)return;const r=(null!==(e=i.subscribers)&&void 0!==e?e:[]).includes(o),n=(null!==(s=t.subscribers)&&void 0!==s?s:[]).includes(o),l=i.private&&r;if(l&&!(yield this.ui.buildModal().title(this.intl.t("utils.task.actions-manager.unsubscribeFromPrivateTaskModalTitle")).description(this.intl.t("utils.task.actions-manager.unsubscribeFromPrivateTaskModalDescription")).primaryActionText(this.intl.t("utils.task.actions-manager.unsubscribeFromPrivateTaskModalConfirm")).confirm({returnResult:!0})))return;const c=null!==(a=t.subscribers)&&void 0!==a?a:[],d=t.subscribers;r?(t.subscribers=vt(c.slice().filter(t=>t!==o),t.assignee),yield t.save().catch(e=>{throw t.subscribers=d,this.ui.showSaveErrorFlash(this.intl.t("utils.task.actions-manager.unsubscribeError",{hasParent:Boolean(i.parentTask)})),e}),this.metrics.trackEvent("task-unsubscribe")):(n||(t.subscribers=vt(c.slice().concat(o),t.assignee),yield t.save().catch(e=>{throw t.subscribers=d,this.ui.showSaveErrorFlash(this.intl.t("utils.task.actions-manager.subscribeError",{hasParent:Boolean(i.parentTask)})),e})),this.metrics.trackEvent("task-subscribe")),yield this.loadSubscribers(i),this.toggleTaskSubscriptionFlash&&this.toggleTaskSubscriptionFlash.close();const u=r?this.intl.t("utils.task.actions-manager.unsubscribeSuccess",{hasParent:Boolean(i.parentTask)}):this.intl.t("utils.task.actions-manager.subscribeSuccess",{hasParent:Boolean(i.parentTask)});this.toggleTaskSubscriptionFlash=this.ui.buildFlash().message(u).icon(v).showInfo(),l&&(this.notifications.removeNotificationsForType("task",i.id),this.delegate.closeTask())}}),null,"toggleSubscriptionTask","keepLatest")),wt(this,"loadSubscribersTask",gt(()=>({context:this,generator:function*(t){return yield at.on(this).loadSubscribers(t)}}),null,"loadSubscribersTask","restartable")),ht(this,ne,void ft(this,"taskMove")),ht(this,le,void ft(this,"taskDuplicate")),ht(this,ce,void ft(this,"taskTemplate")),Y(this,t),this.delegate=e,A(this,Qt)}togglePrivate(t){return this.togglePrivateTask.perform(t).catch(mt)}toggleTaskSubscription(t){return this.toggleSubscriptionTask.perform(t).catch(mt)}loadSubscribers(t){return this.loadSubscribersTask.perform(t).catch(mt)}get isLoadingSubscribers(){return this.loadSubscribersTask.isRunning}async deleteTask(t){const e=t.id;if(await this.confirmTaskDelete(t))if(Z(t,"routes/organization/project/tasks/task:deleteTask")){this.delegate.closeTask();try{await t.destroyRecord()}catch(s){return void this.ui.showSaveErrorFlash(this.intl.t("utils.task.actions-manager.deleteTaskError"))}this.notifications.removeNotificationsForType("task",e),this.dataSync.notifyForModelSync("task","deleted",e,t),this.ui.showDeleteSuccessFlash("Task",t)}else this.ui.showSaveErrorFlash(this.intl.t("utils.task.actions-manager.deleteTaskError"))}async confirmTaskDelete(t){var e;const s=this.intl.t("utils.task.actions-manager.taskDeleteModalTitle",{taskName:t.title});let a="";return t.subtaskCount&&(a=a.concat(this.intl.t("utils.task.actions-manager.taskWithSubtasks"))),(null!==(e=t.timeEntries)&&void 0!==e?e:[]).slice().some(t=>!t.isNew)&&(a=a.concat(this.intl.t("utils.task.actions-manager.taskWithTimeEntries"))),await this.ui.buildModal().title(s).description(a).primaryActionText(this.intl.t("utils.task.actions-manager.taskDeleteModalConfirm")).confirm({returnResult:!0})}};function ue(t){t.debouncedLoadActivities.cancelAll(),t.dataSync.eventBus.off("todo:created",t),t.dataSync.eventBus.off("todo:updated",t),t.dataSync.eventBus.off("comment:deleted",t)}E((Vt=de).prototype,"store",[k]),E(Vt.prototype,"can",[k]),E(Vt.prototype,"ui",[k]),E(Vt.prototype,"metrics",[k]),E(Vt.prototype,"notifications",[k]),E(Vt.prototype,"dataSync",[k]),E(Vt.prototype,"session",[k]),E(Vt.prototype,"formsHandler",[k]),E(Vt.prototype,"intl",[k]),r(Vt.prototype,"togglePrivate",[z]),r(Vt.prototype,"toggleTaskSubscription",[z]),r(Vt.prototype,"loadSubscribers",[z]),r(Vt.prototype,"deleteTask",[z]),E(Vt.prototype,"taskMove",[Tt],function(){return Mt(({on:t})=>{const e=new Ht(_(this));return t.cleanup(()=>tt(e)),e})}),E(Vt.prototype,"taskDuplicate",[Tt],function(){return Mt(({on:t})=>{const e=new Et(_(this));return t.cleanup(()=>tt(e)),e})}),E(Vt.prototype,"taskTemplate",[Tt],function(){return Mt(({on:t})=>{const e=new Yt(_(this));return t.cleanup(()=>tt(e)),e})});var he,pe=class extends bt{constructor(t,e,s){super(t,e,{...s,reloadOnDataSyncEvent:"task:updated",markReadOnCommentSubmit:!0}),this.dataSync.eventBus.on("todo:created",this,this.reloadActivityOnTodoAction),this.dataSync.eventBus.on("todo:updated",this,this.reloadActivityOnTodoAction),this.dataSync.eventBus.on("comment:deleted",this,this.reloadActivityOnCommentDeleted),A(this,ue)}get firstUnreadActivityId(){var t;return null===(t=this.notifications.activeNotificationForRoute)||void 0===t?void 0:t.firstUnreadActivityId}get visibleUnreadActivities(){const t=this.firstUnreadActivityId;return t?this.getActivities().filter(e=>Number(e.id)>=Number(t)&&e.creator!==this.session.currentPerson):[]}get visibleUnreadCount(){return this.visibleUnreadActivities.length}get oldestVisibleUnreadActivityId(){var t;return null===(t=this.visibleUnreadActivities.reduce((t,e)=>!t||Number(e.id)<Number(t.id)?e:t,void 0))||void 0===t?void 0:t.id}isNotificationForModel(t,e){return"task"===t.targetType&&t.targetId===e.id}generateActivitiesQuery(t,e,s){const a=lt.on(this).fromApiAction("activity:task",[this.model]).includes(t=>t.add("creator.{company,customRole}","comment.attachments","email")).filter(this.activityFilter.params).withoutEditEvent().perPageForSearch().withContext("task-activities");return t&&a.before(t),e&&a.after(e),s&&a.withOpts(s),a}queryPinnedActivities(){return lt.on(this).fromApiAction("activity:task",[this.model]).includes(t=>t.add("creator.{company,customRole}","comment.attachments")).pinned().withoutEditEvent().depaginate().withContext("task-pinned-activities").run()}reloadActivityOnTodoAction(t,e){e&&e.task===this.model&&this.debouncedLoadActivities.perform()}reloadActivityOnCommentDeleted(t,e){const s=this.getActivities().find(t=>t.comment===e);s&&(s.itemDeletedAt=new Date,s.comment=void 0)}};r((Zt=pe).prototype,"reloadActivityOnTodoAction",[z]),r(Zt.prototype,"reloadActivityOnCommentDeleted",[z]);var me=new WeakMap,ke=new WeakMap,ve=new WeakMap,ge=new WeakMap,ye=new WeakMap,fe=new WeakMap,Te=class{constructor(t,e){ht(this,me,void ft(this,"store")),ht(this,ke,void ft(this,"ui")),ht(this,ve,void ft(this,"formsHandler")),ht(this,ge,void ft(this,"metrics")),ht(this,ye,void ft(this,"intl")),ht(this,fe,void ft(this,"flags")),wt(this,"task",void 0),wt
2(this,"todoFormsCache",{}),wt(this,"setupTodosTask",gt(()=>({context:this,generator:function*(){var t,e,s;this.store.createRecord("todo",{task:this.task,description:"",closed:!1}),this.task.todoCount>50&&(yield o.on(this).forTask(this.task).withContext("todos-manager").includes(t=>t.add("task","assignee")).depaginate().run());const a=null!==(s=null===(t=this.task.todos)||void 0===t?void 0:t.filter(t=>!t.isNew))&&void 0!==s?s:[];this.flags.relativePeopleAndDates&&(null===(e=this.task.project)||void 0===e?void 0:e.isTemplate)&&a.length&&(yield H.on(this).forTodos(a).depaginate().includes(t=>t.add("placeholder","todo")).withContext("todos-manager").run())}}),null,"setupTodosTask","keepLatest")),wt(this,"submitTodoFormTask",gt(()=>({context:this,generator:function*(t,e,s){const a=t.isNew,i=this.task;if(t.isDirtyMap.assignee&&t.assignee&&!e.subscribers.includes(t.assignee)){if(e.private&&!(yield this.confirmUnsubscribedTodoAssigneeOnPrivateTask(t)))return;e.subscribers=vt([...e.subscribers,t.assignee],e.assignee);try{yield s(e)}catch(o){return this.ui.showSaveErrorFlash(this.intl.t("utils.todos-manager.errorUpdatingSubscribers")),void ct(o)}}try{yield this.formsHandler.submitForm(t,{trigger:"task-todo-list"})}catch(o){ct(o)}a&&this.store.createRecord("todo",{task:i,description:"",closed:!1}
2)}}),null,"submitTodoFormTask","restartable")),Y(this,t),this.task=e}destroy(){const t=Object.values(this.todoFormsCache);this.todoFormsCache={},t.forEach(t=>{null==t||t.destroy()}),this.submitTodoFormTask.cancelAll()}get todoForms(){var t;return(null!==(t=this.task.todos)&&void 0!==t?t:[]).map(t=>this.getFormForTodo(t))}getFormForTodo(t){const e=x(t),s=this.todoFormsCache[e];if(s)return s;const a=this.formsHandler.createForm(l,[t,{preventFormLoss:!0}]);return this.todoFormsCache[e]=a,a}async confirmUnsubscribedTodoAssigneeOnPrivateTask(t){const e=t.assignee;if(!e)return!0;const s=await this.ui.buildModal().title(this.intl.t("utils.todos-manager.assigneeConfirmation",{assigneeName:e.name})).description(this.intl.t("utils.todos-manager.assigneeConfirmationDescription",{assigneeName:e.name})).confirm({returnResult:!0});return s||t.resetField("assignee"),Boolean(s)}};E((he=Te).prototype,"store",[k]),E(he.prototype,"ui",[k]),E(he.prototype,"formsHandler",[k]),E(he.prototype,"metrics",[k]),E(he.prototype,"intl",[k]),E(he.prototype,"flags",[k]),r(he.prototype,"todoForms",[it]);var be,Me={modal:"_modal_nlzb0_1",isPrivate:"_isPrivate_nlzb0_1"},we=new WeakMap,Fe=new WeakMap,Se=new WeakMap,Ae=new WeakMap,Pe=new WeakMap,We=new WeakMap,je=new WeakMap,Ce=new WeakMap,_e=new WeakMap,De=new WeakMap,Re=new WeakMap,Ee=new WeakMap,Oe=new WeakMap,Ie=new WeakMap,Le=new WeakMap,Be=new WeakMap,xe=new WeakMap,Ne=new WeakMap,ze=new WeakMap,Ue=new WeakMap,He=new WeakMap,Je=new WeakMap,Ve=new WeakMap,Ke=new WeakMap,qe=new WeakMap,Ge=new WeakMap,Ye=new WeakMap,Qe=new WeakMap,Ze=new WeakMap,$e=new WeakMap,Xe=new WeakMap,ts=class extends L{constructor(t,e){super(t,e),ht(this,we,void ft(this,"can")),ht(this,Fe,void ft(this,"dataSync")),ht(this,Se,void ft(this,"notifications")),ht(this,Ae,void ft(this,"flags")),ht(this,Pe,void ft(this,"formLossPreventer")),ht(this,We,void ft(this,"formsHandler")),ht(this,je,void ft(this,"recentData")),ht(this,Ce,void ft(this,"routing")),ht(this,_e,void ft(this,"session")),ht(this,De,void ft(this,"metrics")),ht(this,Re,void ft(this,"settings")),ht(this,Ee,void ft(this,"store")),ht(this,Oe,void ft(this,"ui")),ht(this,Ie,void ft(this,"intl")),wt(this,"taskActionsManager",void 0),ht(this,Le,void ft(this,"activityManager")),ht(this,Be,void ft(this,"changeParentModal")),ht(this,xe,void ft(this,"customFieldsForm")),ht(this,Ne,void ft(this,"projectPreference")),ht(this,ze,void ft(this,"_activeTab")),ht(this,Ue,void ft(this,"shouldOpenBookingForm")),ht(this,He,void ft(this,"isTaskSaveSuccess")),ht(this,Je,void ft(this,"lazyTemplateBanner")),ht(this,Ve,void ft(this,"lazyActivityCommentEdit")),ht(this,Ke,void ft(this,"lazyMoveModal")),ht(this,qe,void ft(this,"lazyChangeParentModal")),ht(this,Ge,void ft(this,"lazyDuplicateModal")),ht(this,Ye,void ft(this,"lazyTemplateModal")),ht(this,Qe,void ft(this,"taskForm")),ht(this,Ze,void ft(this,"taskDescriptionForm")),ht(this,$e,void ft(this,"taskAttachmentsForm")),ht(this,Xe,void ft(this,"todosManager")),wt(this,"loadCustomFieldsTask",gt(()=>({context:this,generator:function*(t){var e;null===(e=this.customFieldsForm)||void 0===e||e.destroy(),this.customFieldsForm=void 0;const s=t.project;yield B.on(this).nonArchived().forCustomizableType(X.TASKS).forProject(s).withContext("task-modal-custom-fields").includes(t=>t.add("options","project","organization")).depaginate().run();const a=s.taskCustomFields;if(s.taskCustomFieldsPositions){const t=s.taskCustomFieldsPositions;a.sort((e,s)=>y(t[e.id],t[s.id]))}if(a.length){const e=dt({customFields:a});this.customFieldsForm=this.formsHandler.createForm(e,[t])}}}),null,"loadCustomFieldsTask","restartable")),wt(this,"loadProjectPreferenceTask",gt(()=>({context:this,generator:function*(){const t=this.args.task.project,e=this.session.currentPerson;if(!t||!e)return;const s=yield G.on(this).forProject(t).forPerson(e).includes(t=>t.add("person","project")).withContext("task-modal").cacheOn(t).run();1===s.length&&(this.projectPreference=s[0])}}),null,"loadProjectPreferenceTask","keepLatest")),wt(this,"loadCurrentPersonToProjectMembersTask",gt(()=>({context:this,generator:function*(){const t=this.session.currentPerson,e=this.args.task.project;if(t&&0===(null==e?void 0:e.members.length)){const[s]=yield at.on(this).inProject(e).withId([t.id]).cacheOn(e,36e5).withContext("task-modal").includes(t=>t).depaginate().run();s&&e.addPersonToMembers(s)}}}),null,"loadCurrentPersonToProjectMembersTask","restartable")),wt(this,"loadTaskListsTask",gt(()=>({context:this,generator:function*(){const t=this.args.task.project;t&&(yield N.on(this).active().forProject(t).includes(t=>t.add("project","folder.project")).withContext("task-modal").depaginate().cacheOn(t,36e5).run())}}),null,"loadTaskListsTask","restartable")),wt(this,"showTaskSubmitSuccessTask",gt(()=>({context:this,generator:function*(){this.isTaskSaveSuccess=!0,yield q(3e3),this.isTaskSaveSuccess=!1}}),null,"showTaskSubmitSuccessTask","restartable")),wt(this,"queueFormSaveTask",gt(()=>({context:this,generator:function*(t,e){yield this.formsHandler.submitForm(t,e)}}),null,"queueFormSaveTask","enqueue")),wt(this,"submitTaskFormTask",gt(()=>({context:this,generator:function*(t=this.taskForm){var e,s,a,i,o;const r=!t.isNew&&!t.model.closed&&(t.closed||(null===(e=t.workflowStatus)||void 0===e?void 0:e.isClosedStatus))&&t.repeatScheduleId,n=null===(s=t.model.subscribers)||void 0===s?void 0:s.slice(),l=null!==(o=t.model.tagList)&&void 0!==o?o:[];if(!t.isDirty||t.private&&!(yield this.confirmSubscriberRemovalIfNeeded(t))||t.confirmBookingDateSync&&!(yield t.confirmBookingDateSync()))return;const c=t.isNew||t.isDirtyMap.taskList;
2yield this.queueFormSaveTask.perform(t,{trigger:"task-details"});const d=t.model;c&&!d.taskList&&this.metrics.event("task-without-list-save").trigger("task-details").track(),this.showTaskSubmitSuccessTask.perform(),this.updateTaskSubscribersIfNeeded(t,null!=n?n:[]),this.updateTagsOnProjectIfNeeded(t,l),r&&this.showRepeatingTaskFlash(d),d.private&&(null===(a=d.timeEntries)||void 0===a?void 0:a.length)&&M.on(this).includes(t=>t.add("approver.company","rejecter.company","person.company","service.{section,serviceType}","service.deal.{company,contract}","service.deal.project.{company,workflow,projectManager}","service.deal.dealStatus.pipeline","task.{taskList,assignee,creator,parentTask,workflowStatus}","task.project.company","task.project.workflow.workflowStatuses","task.project.projectManager.{company,subsidiary,teams}","updater.company","creator.company")).withId(d.timeEntries.map(t=>t.id)).depaginate().withContext("task-modal").run(),d.private&&!(null===(i=d.subscribers)||void 0===i?void 0:i.includes(this.session.currentPerson))&&(this.notifications.removeNotificationsForType("task",d.id),this.args.close())}}),null,"submitTaskFormTask","keepLatest")),wt(this,"routeWillChangeHandler",async t=>{if(this.args.task&&!this.args.task.isDestroyed&&!this.args.task.isDestroying)if(this.submitTaskFormTask.lastRunning)t.abort(),await this.submitTaskFormTask.lastRunning,t.retry();else if(this.taskForm.isDirty)t.abort(),await this.submitTaskFormTask.perform().catch(mt),t.retry();else{var e;const s=null===(e=this.todosManager)||void 0===e?void 0:e.todoForms.find(t=>t.isDirty&&!t.isNew);s&&(t.abort(),await this.submitTodoForm(s),t.retry())}}),wt(this,"reloadSubscribersForNewMentions",(t,e)=>{var s;const a=t,i=null!==(s=a.subscribers)&&void 0!==s?s:[];if(!i.length||!e.length)return;const o=new Set(i.map(t=>t.id));var r;e.some(t=>"person"===t.type&&!o.has(t.id))&&(null===(r=this.taskActionsManager)||void 0===r||r.loadSubscribers(a))}),wt(this,"loadPlaceholderUsageTask",gt(()=>({context:this,generator:function*(){const t=this.args.task,e=t.project;this.flags.relativePeopleAndDates&&(null==e?void 0:e.isTemplate)&&(yield H.on(this).forTask(t).includes(t=>t.add("placeholder","task")).withContext("task-modal").run())}}),null,"loadPlaceholderUsageTask","restartable")),this.taskActionsManager=new de(t,{closeTask:()=>{const t=S(this.routing.currentRouteName);this.formLossPreventer.registeredForms.filter(e=>{if(!e.registeredOnRouteName)return!1;const s=S(e.registeredOnRouteName);return t===s||t.startsWith(`${s}.`)}).forEach(t=>t.destroy()),e.close()}}),["task","task-list","folder","todo"].forEach(t=>this.dataSync.toggleRealtimeSyncFor(t,!0)),this.routing.on("routeWillChange",this,this.routeWillChangeHandler),this.search.pushResourceScope(this,e.task.project);const s=()=>{this.search.pushResourceScope(this,this.args.task.project),this.loadCustomFieldsTask.perform(this.args.task).catch(mt)};this.dataSync.eventBus.on("task:move",s),A(this,()=>{var t;this.destroyActivityManager(),tt(this.taskActionsManager),["task","task-list","folder"].forEach(t=>this.dataSync.toggleRealtimeSyncFor(t,!1)),this.routing.off("routeWillChange",this,this.routeWillChangeHandler),this.dataSync.eventBus.off("task:move",s),this.search.popResourceScope(this),null===(t=this.customFieldsForm)||void 0===t||t.destroy()})}get search(){return new st(_(this))}get activeTab(){var t;const e=this._activeTab,s=this.args.task;return"bookings"===e&&(!this.can.app.canViewOwnServiceBookings||s.private)||"time"===e&&(!(null===(t=this.projectAbility)||void 0===t?void 0:t.canViewTimeOnTasks)||s.isTemplate||s.private)?"activity":e}get projectAbility(){var t;return null===(t=this.args.task.project)||void 0===t?void 0:t.ability}get isSubmitting(){var t,e;return this.taskForm.isSubmitting||!this.taskForm.isLoaded||this.taskDescriptionForm.isSubmitting||!this.taskDescriptionForm.isLoaded||this.taskAttachmentsForm.isSubmitting||!this.taskAttachmentsForm.isLoaded||null!==(e=null===(t=this.customFieldsForm)||void 0===t?void 0:t.isSubmitting)&&void 0!==e&&e}createActivityManager(){this.destroyActivityManager(),this.activityManager=new pe(_(this),this.args.task,{activityFilterId:"task",isPinnedActivitiesEnabled:!0,isDraftCommentsEnabled:!0,scrollToActivityId:this.args.controller.taskActivityId,reloadSubscribersForNewMentions:this.reloadSubscribersForNewMentions})}destroyActivityManager(){this.activityManager&&(tt(this.activityManager),this.activityManager=void 0)}updateTaskSubscribersIfNeeded(t,e){var s;const a=null!==(s=t.model.subscribers)&&void 0!==s?s:[],i=new Set(e.map(t=>
2t.id)),o=new Set(a.map(t=>t.id));var r;(a.some(t=>!i.has(t.id))||e.some(t=>!o.has(t.id)))&&(null===(r=this.taskActionsManager)||void 0===r||r.loadSubscribers(t.model))}updateTagsOnProjectIfNeeded(t,s){var a;const i=t.model.project;i&&c(i.tags,null!==(a=t.tagList)&&void 0!==a?a:[],s)&&e.on(this).loadTagsForModel(i,{cache:0})}showRepeatingTaskFlash(t){var e;if(!(null===(e=t.repeatedTask)||void 0===e?void 0:e.dueDate))return;const s=t.repeatedTask,a=j(s.dueDate,"MMM d, yyyy"),i=this.routing.modalRouteParams(["organization.task",s.id]);this.ui.buildFlash().withComponent(yt,{routeParams:i,formattedDate:a}).icon(v).closeAfter(5e3).showInfo()}async submitTaskForm(t){try{await this.submitTaskFormTask.perform(t)}catch(e){mt(e)}}submitTodoForm(t){return this.todosManager.submitTodoFormTask.perform(t,this.taskForm,async()=>{await this.submitTaskFormTask.perform().catch(mt)}).catch(mt)}onActiveTabChange(){"activity"===this.activeTab?this.createActivityManager():this.destroyActivityManager()}setActiveTab(t){t!==this._activeTab&&(this._activeTab=t)}openBookingForm(){this.shouldOpenBookingForm=!0,this.setActiveTab("bookings")}onBookingFormOpened(){this.shouldOpenBookingForm=!1}trackRecentObject(){const t=this.args.task;t.isTemplate||t.parentTask&&t.parentTask.isTemplate||this.recentData.addRecentObject("task",t)}get firstUnreadActivityId(){var t;return null===(t=this.activityManager)||void 0===t?void 0:t.oldestVisibleUnreadActivityId}mentionSearch(t,e,s){const a=this.args.task.project;return this.search.mentionQuickSearch(t,e,{...s,project:a})}showFirstUnreadActivity(){const t=this.firstUnreadActivityId;var e;if(t)return null===(e=this.activityManager)||void 0===e?void 0:e.showFirstUnreadActivity(t)}markTaskReadWhenNoVisibleUnread(){var t,e;const s=this.notifications.activeNotificationForRoute;var a;"activity"!==this.activeTab||!s||s.isRead||(null===(t=this.activityManager)||void 0===t?void 0:t.isLoadingActivities)||0!==(null===(e=this.activityManager)||void 0===e?void 0:e.visibleUnreadCount)||null===(a=this.activityManager)||void 0===a||a.markActiveNotificationAsRead()}saveTaskAsTemplate(t){this.taskActionsManager.taskDuplicate.show(this.args.task,{isSaveAsTemplate:!0,trigger:t})}duplicateTask(t,e){var s;(null===(s=this.activityManager)||void 0===s||null===(s=s.form)||void 0===s?void 0:s.isDirty)?this.ui.buildModal().title(this.intl.t("components.task.modal.unsavedChanges")).description(this.intl.t("components.task.modal.unsavedChangesDescription")).alert():this.taskActionsManager.taskDuplicate.show(t,e)}async createTaskFromSubtask(t,e){t.parentTask=void 0;try{await this.store.patchSave(t,[],["parent_task"]),this.metrics.trackEventWithTrigger("subtask-convert-to-task",e)}catch(s){t.rollbackAttributes(),this.ui.displayError(s),ct(s)}}async close(){this.taskForm.isDirty&&!this.taskForm.model.isDestroyed&&await this.submitTaskFormTask.perform().catch(mt),this.args.close()}openSetParentTaskModal(t,e){this.changeParentModal={task:t,trigger:e}}async createKeyTaskFromTask(t,e){const s=t.isSubtask;s&&(t.parentTask=void 0),t.typeId=t.isKeyTask?f.TASK:f.KEY_TASK,await this.store.patchSave(t,["typeId"],s?["parent_task"]:[]),this.metrics.trackEventWithTrigger(t.isKeyTask?"task-convert-to-milestone":"milestone-convert-to-task",e),this.ui.buildFlash().withComponent(P,{task:t,convertedTo:t.isKeyTask?"key task":"task"}).closeAfter(5e3).showInfo()}closeSetParentTaskModal(){this.changeParentModal=null}async confirmSubscriberRemovalIfNeeded(t){var e,s,a,i;if(!t.isDirtyMap.subscribers)return!0;const o=new Set((null!==(s=t.subscribers)&&void 0!==s?s:[]).map(t=>t.id)),r=(null!==(a=t.model.subscribers)&&void 0!==a?a:[]).filter(t=>!o.has(t.id));if(!r.length)return!0;const n=new Set(r.map(t=>t.id)),l=null===(e=(null!==(i=t.model.todos)&&void 0!==i?i:[]).find(t=>t.assignee&&n.has(t.assignee.id)))||void 0===e?void 0:e.assignee;return!l||this.confirmSubscriptionRemovalOfTodoAssigneeOnPrivateTask(t,l)}async confirmSubscriptionRemovalOfTodoAssigneeOnPrivateTask(t,e){const s=await this.ui.buildModal().title(this.intl.t("components.task.modal.unsubscribePerson",{personName:e.n
2ame})).description(this.intl.t("components.task.modal.unsubscribePersonDescription",{personName:e.name})).confirm({returnResult:!0});return s||t.fieldsMap.subscribers.reset(),Boolean(s)}};E((be=ts).prototype,"can",[k]),E(be.prototype,"dataSync",[k]),E(be.prototype,"notifications",[k]),E(be.prototype,"flags",[k]),E(be.prototype,"formLossPreventer",[k]),E(be.prototype,"formsHandler",[k]),E(be.prototype,"recentData",[k]),E(be.prototype,"routing",[k]),E(be.prototype,"session",[k]),E(be.prototype,"metrics",[k]),E(be.prototype,"settings",[k]),E(be.prototype,"store",[k]),E(be.prototype,"ui",[k]),E(be.prototype,"intl",[k]),E(be.prototype,"activityManager",[w]),E(be.prototype,"changeParentModal",[w],function(){return null}),E(be.prototype,"customFieldsForm",[w]),E(be.prototype,"projectPreference",[w]),E(be.prototype,"_activeTab",[w],function(){return"activity"}),E(be.prototype,"shouldOpenBookingForm",[w],function(){return!1}),E(be.prototype,"isTaskSaveSuccess",[w],function(){return!1}),E(be.prototype,"lazyTemplateBanner",[Tt],function(){return $(async()=>(await a(async()=>{const{default:t}=await import("./common-DdYwb9D_.js").then(t=>t.Ki);return{default:t}},__vite__mapDeps([0,1,2]))).default)}),E(be.prototype,"lazyActivityCommentEdit",[Tt],function(){return $(async()=>(await a(async()=>{const{default:t}=await import("./common-DdYwb9D_.js").then(t=>t.Zg);return{default:t}},__vite__mapDeps([0,1,2]))).default)}),E(be.prototype,"lazyMoveModal",[Tt],function(){return $(async()=>(await a(async()=>{const{default:t}=await import("./move-modal-C8qyGoEy.js");return{default:t}},__vite__mapDeps([3,0,1,2]))).default)}),E(be.prototype,"lazyChangeParentModal",[Tt],function(){return $(async()=>(await a(async()=>{const{default:t}=await import("./change-parent-modal-hHqoi_2G.js");return{default:t}},__vite__mapDeps([4,0,1,2]))).default)}),E(be.prototype,"lazyDuplicateModal",[Tt],function(){return $(async()=>(await a(async()=>{const{default:t}=await import("./duplicate-modal-OQlmVN-P.js");return{default:t}},__vite__mapDeps([5,0,1,2,6]))).default)}),E(be.prototype,"lazyTemplateModal",[Tt],function(){return $(async()=>(await a(async()=>{const{default:t}=await import("./template-modal-GEqa5Mx2.js");return{default:t}},__vite__mapDeps([7,0,1,2]))).default)}),r(be.prototype,"search",[it]),E(be.prototype,"taskForm",[Tt],function(){return Mt(({on:t})=>{const e=new nt(_(this),this.args.task);return t.cleanup(()=>e.destroy()),e})}),E(be.prototype,"taskDescriptionForm",[Tt],function(){return Mt(({on:t})=>{const e=new nt(_(this),this.args.task);return t.cleanup(()=>e.destroy()),e})}),E(be.prototype,"taskAttachmentsForm",[Tt],function(){return Mt(({on:t})=>{const e=new nt(_(this),this.args.task);return t.cleanup(()=>e.destroy()),e})}),E(be.prototype,"todosManager",[Tt],function(){return Mt(({on:t})=>{const e=new Te(_(this),this.args.task);return t.cleanup(()=>e.destroy()),e})}),r(be.prototype,"submitTaskForm",[z]),r(be.prototype,"submitTodoForm",[z]),r(be.prototype,"onActiveTabChange",[z]),r(be.prototype,"setActiveTab",[z]),r(be.prototype,"openBookingForm",[z]),r(be.prototype,"onBookingFormOpened",[z]),r(be.prototype,"trackRecentObject",[z]),r(be.prototype,"mentionSearch",[z]),r(be.prototype,"showFirstUnreadActivity",[z]),r(be.prototype,"markTaskReadWhenNoVisibleUnread",[z]),r(be.prototype,"saveTaskAsTemplate",[z]),r(be.prototype,"duplicateTask",[z]),r(be.prototype,"createTaskFromSubtask",[z]),r(be.prototype,"close",[z]),r(be.prototype,"openSetParentTaskModal",[z]),r(be.prototype,"createKeyTaskFromTask",[z]),r(be.prototype,"closeSetParentTaskModal",[z]),r(be.prototype,"confirmSubscriptionRemovalOfTodoAssigneeOnPrivateTask",[z]),s(Ft({id:null,block:'[[[1,[28,[32,0],[[30,0,["onActiveTabChange"]],[30,0,["activeTab"]],[30,1]],null]],[1,"\\n"],[1,[28,[32,0],[[30,0,["taskActionsManager","loadSubscribers"]],[30,1]],null]],[1,"\\n"],[1,[28,[32,0],[[30,0,["loadCustomFieldsTask","perform"]],[30,1]],null]],[1,"\\n"],[1,[28,[32,0],[[30,0,["todosManager","setupTodosTask","perform"]],[30,1]],[["runSync"],[true]]]],[1,"\\n"],[1,[28,[32,0],[[30,0,["loadProjectPreferenceTask","perform"]],[30,1,["project"]]],[["runSync"],[true]]]],[1,"\\n"],[1,[28,[32,0],[[30,0,["loadCurrentPersonToProjectMembersTask","perform"]],[30,1,["project"]]],[["runSync"],[true]]]],[1,"\\n"],[1,[28,[32,0],[[30,0,["loadTaskListsTask","perform"]],[30,1,["project"]]],[["runSync"],[true]]]],[1,"\\n"],[1,[28,[32,0],[[30,0,["loadPlaceholderUsageTask","perform"]],[30,1]],[["runSync"],[true]]]],[1,"\\n"],[1,[28,[32,0],[[30,0,["trackRecentObject"]],[30,1]],null]],[1,"\\n\\n"],[8,[32,1],[[16,0,[29,[[32,2,["modal"]]," ",[52,[30,0,["taskForm","private"]],[32,2,["isPrivate"]]]]]]],[["@ariaLabel","@isFlat","@isWhiteBody","@isSidebar","@close","@isBodyForActivity","@isHeaderInContainer","@isHeaderShrinked","@isBelowBanner","@isCloseButtonHidden"],[[28,[32,3],["components.task.modal.task"],null],true,true,[30,0,["settings","taskInSidebarLayout"]],[30,0,["close"]],[28,[32,4],[[30,0,["activeTab"]],"activity"],null],false,true,[30,1,["project","isTemplate"]],[30,1,["isTemplate"]]]],[["header","default","outer"],[[[[1,"\\n"],[41,[30,1,["isTemplate"]],[[[1," "],[8,[30,0,["lazyTemplateBanner","component"]],null,[["@label","@openTemplateModal","@doneAction"],[[28,[32,3],["templates.organization.task.taskTemplate"],null],[28,[32,5],[[30,0,["taskActionsManager","taskTemplate","show"]],[30,1]],null],[30,0,["close"]]]],null],[1,"\\n"]],[]],null],[1,"\\n "],[8,[32,6],null,[["@project","@task","@isSaveSuccess","@isSubmitting","@scrollable","@isPrivate","@isLoadingSubscribers","@toggleTaskSubscription","@togglePrivate","@setActiveTab","@openBookingForm","@deleteTask","@moveTask","@duplicateTask","@saveTaskAsTemplate","@openSetParentTaskModal","@createTaskFromSubtask","@createKeyTaskFromTask","@closeTask"],[[30,1,["project"]],[30,1],[30,0,["isTaskSaveSuccess"]],[30,0,["isSubmitting"]],[30,2,["scrollable"]],[30,0,["taskForm","private"]],[30,0,["taskActionsManager","isLoadingSubscribers"]],[28,[32,5],[[30,0,["taskActionsManager","toggleTaskSubscription"]],[30,0,["taskForm"]]],null],[28,[32,5],[[30,0,["taskActionsManager","togglePrivate"]],[30,1]],null],[30,0,["setActiveTab"]],[30,0,["openBookingForm"]],[30,0,["taskActionsManager","deleteTask"]],[30,0,["taskActionsManager","taskMove","show"]],[30,0,["duplicateTask"]],[30,0,["saveTaskAsTemplate"]],[30,0,["openSetParentTaskModal"]],[30,0,["createTaskFromSubtask"]],[30,0,["createKeyTaskFromTask"]],[30,3,["route","closeModal"]]]],null],[1,"\\n "]],[2]],[[[1,"\\n "],[8,[32,7],null,[["@scrollable","@scrollToTop","@scrollToElement","@taskForm","@activityManager","@activeTab","@shouldOpenBookingForm","@onBookingFormOpened","@hiddenFields","@submitTaskForm","@setActiveTab","@openSetParentTaskModal","@createKeyTaskFromTask","@createTaskFromSubtask","@duplicateSubtask","@customFieldsForm","@isLoadingCustomFields","@projectPreference","@taskDescriptionForm","@taskAttachmentsForm","@todosManager","@submitTodoForm"],[[30,4,["
2scrollable"]],[30,4,["scrollToTop"]],[30,4,["scrollToElement"]],[30,0,["taskForm"]],[30,0,["activityManager"]],[30,0,["activeTab"]],[30,0,["shouldOpenBookingForm"]],[30,0,["onBookingFormOpened"]],[28,[32,8],[[30,0,["projectPreference","hiddenFields"]],[28,[32,9],null,null]],null],[30,0,["submitTaskForm"]],[30,0,["setActiveTab"]],[30,0,["openSetParentTaskModal"]],[30,0,["createKeyTaskFromTask"]],[30,0,["createTaskFromSubtask"]],[30,0,["duplicateTask"]],[30,0,["customFieldsForm"]],[30,0,["loadCustomFieldsTask","isRunning"]],[30,0,["projectPreference"]],[30,0,["taskDescriptionForm"]],[30,0,["taskAttachmentsForm"]],[30,0,["todosManager"]],[30,0,["submitTodoForm"]]]],null],[1,"\\n "]],[4]],[[[1,"\\n"],[41,[30,1,["project"]],[[[1," "],[8,[32,10],null,[["@project","@isLoading"],[[30,1,["project"]],[30,0,["loadCurrentPersonToProjectMembersTask","isRunning"]]]],null],[1,"\\n"]],[]],null],[1,"\\n "],[1,[28,[32,0],[[30,0,["markTaskReadWhenNoVisibleUnread"]],[30,0,["activeTab"]],[30,0,["activityManager","isLoadingActivities"]],[30,0,["activityManager","visibleUnreadCount"]]],null]],[1,"\\n\\n"],[41,[28,[32,11],[[28,[32,12],[[30,0,["notifications","activeNotificationForRoute","isRead"]]],null],[30,0,["firstUnreadActivityId"]],[28,[32,12],[[30,0,["activityManager","isLoadingActivities"]]],null],[28,[32,4],[[30,0,["activeTab"]],"activity"],null]],null],[[[1," "],[8,[32,13],null,[["@observable"],[[30,1]]],[["default"],[[[[1,"\\n "],[8,[32,14],null,[["@unseenActivityCount","@firstUnreadActivityId","@activityDivider","@activate","@onReadUnseen"],[[28,[32,8],[[30,0,["activityManager","visibleUnreadCount"]],0],null],[30,0,["firstUnreadActivityId"]],[28,[32,8],[[30,0,["activityManager","activityDivider"]],[27]],null],[30,0,["showFirstUnreadActivity"]],[30,0,["activityManager","didReadFirstUnreadActivityId"]]]],null],[1,"\\n "]],[]]]]],[1,"\\n"]],[]],null],[1,"\\n"],[41,[30,0,["activityManager","editCommentForm"]],[[[1," "],[8,[30,0,["lazyActivityCommentEdit","component"]],null,[["@form","@submitForm","@cancel","@mentionSearch","@openAttachmentsGallery","@isPrivateCommentingEnabled"],[[30,0,["activityManager","editCommentForm"]],[30,0,["activityManager","saveEditCommentForm"]],[30,0,["activityManager","closeEditCommentForm"]],[30,0,["mentionSearch"]],[30,0,["ui","openAttachmentsGallery"]],[30,0,["projectAbility","canCreatePrivateCommentsOnTasks"]]]],null],[1,"\\n"]],[]],null],[1,"\\n"],[41,[30,0,["taskActionsManager","taskMove","form"]],[[[1," "],[8,[30,0,["lazyMoveModal","component"]],null,[["@form","@submit","@close"],[[30,0,["taskActionsManager","taskMove","form"]],[30,0,["taskActionsManager","taskMove","submit"]],[30,0,["taskActionsManager","taskMove","close"]]]],null],[1,"\\n"]],[]],null],[1,"\\n"],[41,[30,0,["changeParentModal"]],[[[1," "],[8,[30,0,["lazyChangeParentModal","component"]],null,[["@task","@trigger","@close"],[[30,0,["changeParentModal","task"]],[30,0,["changeParentModal","trigger"]],[30,0,["closeSetParentTaskModal"]]]],null],[1,"\\n"]],[]],null],[1,"\\n"],[41,[30,0,["taskActionsManager","taskDuplicate","form"]],[[[1," "],[8,[30,0,["lazyDuplicateModal","component"]],null,[["@form","@submit","@close"],[[30,0,["taskActionsManager","taskDuplicate","form"]],[30,0,["taskActionsManager","taskDuplicate","submit"]],[30,0,["taskActionsManager","taskDuplicate","close"]]]],null],[1,"\\n"]],[]],null],[1,"\\n"],[41,[30,0,["taskActionsManager","taskTemplate","form"]],[[[1," "],[8,[30,0,["lazyTemplateModal","component"]],null,[["@form","@submit","@close"],[[30,0,["taskActionsManager","taskTemplate","form"]],[30,0,["taskActionsManager","taskTemplate","submit"]],[30,0,["taskActionsManager","taskTemplate","close"]]]],null],[1,"\\n"]],[]],null],[1," "]],[]]]]]],["@task","fullscreenModalAPI","@controller","fullscreenModalAPI"],["if"]]',moduleName:"(unknown template module)",scope:()=>({effect:u,FullscreenModal:F,styles:Me,t:i,__keyword__eq:h,__keyword__fn:d,Header:W,TaskLayout:p,__keyword__or:g,__keyword__array:n,ProjectAssignIndicator:pt,__keyword__and:O,__keyword__not:m,RerenderOn:b,UnseenActivitiesPopup:rt}),isStrictMode:!0}),be);var es,ss=t({default:()=>rs}),as=new WeakMap,is=class extends L{constructor(...t){super(...t),ht(this,as,void ft(this,"lazyAiContext"))}};E((es=is).prototype,"lazyAiContext",[Tt],function(){return $(async()=>(await a(async()=>{const{default:t}=await import("./context-COtBVUVZ.js");return{default:t}},__vite__mapDeps([8,0,1,2]))).default)}),s(Ft({id:null,block:'[[[1,[28,[32,0],["#",[30,1,["number"]]," ",[30,1,["title"]]],null]],[1,"\\n\\n"],[8,[30,0,["lazyAiContext","component"]],null,[["@contextItem"],[[28,[32,1],null,[["type","title","task"],["task",[28,[32,2],[[30,1,["title"]],""],null],[28,[32,1],null,[["id","title"],[[30,1,["id"]],[28,[32,2],[[30,1,["title"]],""],null]]]]]]]]],null],[1,"\\n\\n"],[8,[32,3],null,[["@controller","@task","@close"],[[30,2],[30,1],[30,2,["route","closeModal"]]]],null]],["@model","@controller"],[]]',moduleName:"(unknown template module)",scope:()=>({pageTitle:U,__keyword__hash:ot,__keyword__or:g,TaskModal:ts}),isStrictMode:!0}),es);var os,rs=J(is),ns=t({default:()=>ds}
2),ls=new WeakMap,cs=new WeakMap,ds=class extends ut{constructor(...t){super(...t),ht(this,ls,void ft(this,"taskActivityId")),ht(this,cs,void ft(this,"route"))}};E((os=ds).prototype,"taskActivityId",[w]),E(os.prototype,"route",[w]);var us,hs=t({default:()=>vs}),ps=new WeakMap,ms=new WeakMap,ks=new WeakMap,vs=class extends V{constructor(...t){super(...t),ht(this,ps,void ft(this,"ui")),ht(this,ms,void ft(this,"settings")),ht(this,ks,void ft(this,"can")),wt(this,"queryParams",{taskActivityId:{}}),wt(this,"isModalEngineRoot",!0),wt(this,"isModalRoute",!0),wt(this,"isReloadingModelRoute",!0)}model(t){const e=setTimeout(()=>this.ui.addLoader("task-route-model"),1e3);return T.on(this).findRecord(t.task_id,{reload:!0}).includes(t=>t.add("workflowStatus","assignee","parentTask","repeatedTask","taskList.folder","attachments","templateObject").add("project.templateObject").add("project.company").add("project.workflow.workflowStatuses").add("todos.{task,assignee}").add("subtasks.{workflowStatus,assignee,parentTask,project,taskList,service}").add("taskDependencies.dependentTask.{project,workflowStatus,assignee,taskList}","taskDependencies.task").add(...this.can.app.canViewLinkTaskToServiceFeature?["service.deal.{contract,project}"]:[])).withContext("organization-task-route-model").run().finally(()=>{clearTimeout(e),this.ui.removeLoader("task-route-model")})}afterModel(t,e){var s;if(super.afterModel(t,e),this.settings.taskInSidebarLayout&&"organization.task"===(null===(s=e.to)||void 0===s?void 0:s.name))return this.routing.transitionTo("organization.project.tasks.task",t.project,t);t.project||(C({name:"Invalid task route enter",message:"Tried to enter a task route with nullish task.project relationship"}),e.abort())}setupController(t,e,s){super.setupController(t,e,s),t.set("route",this)}getBackTransition(){const t=super.getBackTransition();if("organization"===t[0]){var e;const t=this.currentModel;return["organization.project.tasks",t.project,{queryParams:{board:null===(e=t.folder)||void 0===e?void 0:e.id}}]}return t}};E((us=vs).prototype,"ui",[k]),E(us.prototype,"settings",[k]),E(us.prototype,"can",[k]);var gs={};gs["productive/templates/organization/task"]=ss,gs["productive/controllers/organization/task"]=ns,gs["productive/routes/organization/task"]=hs;export{gs as default};
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.