@whoz-oss/coday-client 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/{chunk-RbE7PtJh.js → chunk--Cv5Auvq.js} +1 -1
- package/browser/{chunk-ZTE9Vro-.js → chunk--wHR1I8D.js} +1 -1
- package/browser/{chunk-E8b2_4uB.js → chunk-5I4m0Psa.js} +1 -1
- package/browser/chunk-BFBXLzHo.js +1 -0
- package/browser/chunk-BGlC5myX.js +2 -0
- package/browser/{chunk-CZ6ILxDX.js → chunk-BMSbS6nO.js} +1 -1
- package/browser/{chunk-BXQCdGUa.js → chunk-BRf9jAIf.js} +1 -1
- package/browser/{chunk-BovznIFZ.js → chunk-BXWpkOo5.js} +1 -1
- package/browser/{chunk-CteHmI07.js → chunk-B_DNrrfb.js} +1 -1
- package/browser/{chunk-BptxX0h6.js → chunk-Bd0IiMsO.js} +1 -1
- package/browser/{chunk-eTAQJYle.js → chunk-BhfTutz7.js} +1 -1
- package/browser/{chunk-D0tFEYpV.js → chunk-BoBOhDYi.js} +1 -1
- package/browser/{chunk-CeRWUb5g.js → chunk-BuK7YbXS.js} +1 -1
- package/browser/{chunk-SiAnBXor.js → chunk-BvhdH1Xv.js} +1 -1
- package/browser/{chunk-B4iDNUj6.js → chunk-C0QR-AJM.js} +1 -1
- package/browser/{chunk-Bi1D1MPS.js → chunk-C26xMDFo.js} +1 -1
- package/browser/{chunk-BQ2Vio1f.js → chunk-C4iGhgYI.js} +1 -1
- package/browser/{chunk-_PndMs0h.js → chunk-C87Bh3Ov.js} +1 -1
- package/browser/{chunk-DzuMSf1O.js → chunk-CASGcP8y.js} +1 -1
- package/browser/chunk-CCN3DpLY.js +1 -0
- package/browser/{chunk-BWc0GaFw.js → chunk-CIOzO35E.js} +1 -1
- package/browser/{chunk-BGeY6TJl.js → chunk-CIQjlvza.js} +1 -1
- package/browser/{chunk-DUczAw5C.js → chunk-CNPdPW3v.js} +1 -1
- package/browser/chunk-COcavU_q.js +1 -0
- package/browser/{chunk-C7-Gy0Uz.js → chunk-CV4cx-V6.js} +1 -1
- package/browser/{chunk-Bh_9bCDZ.js → chunk-C_Vj6FE_.js} +1 -1
- package/browser/{chunk-CyEZHdnA.js → chunk-CjhnozeY.js} +1 -1
- package/browser/{chunk-BpA60NxS.js → chunk-CoQcKJau.js} +1 -1
- package/browser/{chunk-Cdu5JsaS.js → chunk-Cq8feM71.js} +1 -1
- package/browser/{chunk-CaxOrx5M.js → chunk-Cx9yTdUm.js} +1 -1
- package/browser/{chunk-n_Kgbuh3.js → chunk-D-K9FhYH.js} +1 -1
- package/browser/{chunk-x7Suyrio.js → chunk-D4D8VOP2.js} +1 -1
- package/browser/{chunk-C_7QzTv7.js → chunk-D9wQSJ4q.js} +1 -1
- package/browser/{chunk-CW742eC7.js → chunk-DHse9w28.js} +4 -4
- package/browser/{chunk-D5NtIZG6.js → chunk-DJSzQBCH.js} +1 -1
- package/browser/{chunk-BBJc_ez4.js → chunk-DL6rhSDN.js} +1 -1
- package/browser/{chunk-DJOhzAbC.js → chunk-DRAFMqKn.js} +1 -1
- package/browser/{chunk-DeVzkEKK.js → chunk-DW33OOxm.js} +1 -1
- package/browser/{chunk-DwB1vH9w.js → chunk-DWo8Yipj.js} +1 -1
- package/browser/{chunk-TBsNfd0k.js → chunk-DZuiUHX9.js} +1 -1
- package/browser/{chunk-20v-HoGw.js → chunk-DaJf2IFW.js} +1 -1
- package/browser/{chunk-nSxfGVc8.js → chunk-DaK9SdKA.js} +1 -1
- package/browser/{chunk-DvC7mEoN.js → chunk-DlKQ1Cys.js} +1 -1
- package/browser/{chunk-BemBoNs5.js → chunk-DmZR81FM.js} +1 -1
- package/browser/chunk-DmbSsVzR.js +1 -0
- package/browser/{chunk-BtYN6RGw.js → chunk-DtHFNV_5.js} +1 -1
- package/browser/{chunk-BXiOP6ZW.js → chunk-DxenqkEz.js} +1 -1
- package/browser/{chunk-B4CKPT8-.js → chunk-DyKPeAU4.js} +1 -1
- package/browser/{chunk-DlFFzFSe.js → chunk-GU0OGBZz.js} +1 -1
- package/browser/{chunk-BPJe1_uM.js → chunk-LNTSOB-k.js} +1 -1
- package/browser/{chunk-C2TRQfu4.js → chunk-PH-PuPg1.js} +1 -1
- package/browser/{chunk-CRuFXEnP.js → chunk-S33m0v63.js} +1 -1
- package/browser/chunk-SitBftU1.js +1 -0
- package/browser/{chunk-CiWRvj1N.js → chunk-TwL6unik.js} +1 -1
- package/browser/{chunk-BjDDtMsE.js → chunk-XynH5Ted.js} +1 -1
- package/browser/{chunk-G4MCwSm-.js → chunk-Y4Oxet3L.js} +1 -1
- package/browser/{chunk-Ckk6G7IP.js → chunk-drd9oaGN.js} +1 -1
- package/browser/{chunk-CNMTF87H.js → chunk-dwDdFGUB.js} +1 -1
- package/browser/{chunk-BmjhXCgH.js → chunk-fxaq06d7.js} +1 -1
- package/browser/{chunk-BdWvjltK.js → chunk-j7t2mSd6.js} +1 -1
- package/browser/{chunk-DEhf9VBD.js → chunk-jki7cP90.js} +1 -1
- package/browser/chunk-mHggS-i6.js +1 -0
- package/browser/{chunk-B9gLRfDm.js → chunk-okzlJmPZ.js} +1 -1
- package/browser/{chunk-DGa4-UJW.js → chunk-pySUFhL3.js} +1 -1
- package/browser/{chunk-Bh7gCjj4.js → chunk-vdkNDukI.js} +1 -1
- package/browser/{chunk-CcTN_TUb.js → chunk-z6x1ROGz.js} +1 -1
- package/browser/index.html +1 -1
- package/browser/{main-DXWHG4XK.js → main-XVJVH4GF.js} +2 -2
- package/package.json +1 -1
- package/browser/chunk-BIEjPnD4.js +0 -2
- package/browser/chunk-BUhtdVBd.js +0 -1
- package/browser/chunk-Balbg-lh.js +0 -1
- package/browser/chunk-CFvRU8Pw.js +0 -1
- package/browser/chunk-CmmK8635.js +0 -1
- package/browser/chunk-SlWicxh3.js +0 -1
- package/browser/chunk-spTKcuel.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import {A,k as kt,b as bt}from'./chunk-nSxfGVc8.js';import {S as St}from'./chunk-DwB1vH9w.js';import {E as Et,y as yt$1,G as Ge}from'./chunk-BXiOP6ZW.js';import {g,G,P,U,N,h as he$1,K as c,w as we,H as Hi,F as F$1,m as mT,b as U$1,A as Aw,i as hr,p as pr,v as vs,W as WC,k as fl,l as Ag,n as eC,q as oC,X as XE,r as Tg,t as tC,x as iC,y as Hg,C as Cg,u as ue$1,c9 as We,Y as x,an as ce$1,ap as Vy,c as ce$2,V,o as bg,a9 as dC,aa as If,ac as mC,ab as wf,a8 as Zg,a5 as yl}from'./main-DXWHG4XK.js';import'./chunk-BtYN6RGw.js';import'./chunk-CyEZHdnA.js';import'./chunk-DlFFzFSe.js';import'./chunk-Ckk6G7IP.js';import {y as yt,w as wt}from'./chunk-BBJc_ez4.js';var R=class n{threadState=g(U);codayService=g(Ge);threadList=F$1(this.threadState.threadList$,{initialValue:[]});selectedThread=F$1(this.threadState.selectedThread$,{initialValue:null});isThinking=F$1(this.codayService.isThinking$,{initialValue:false});inviteEvent=F$1(this.codayService.currentInviteEvent$.pipe(ue$1(t=>t?.invite===We?null:t)),{initialValue:null});tasks=mT(()=>{let t=this.threadList(),e=this.selectedThread(),r=this.isThinking(),o=this.inviteEvent();return t.filter(i=>!i.parentThreadId).map(i=>{let m=!!e&&i.id===e.id;return {id:i.id,name:i.name,summary:i.summary,modifiedDate:i.modifiedDate,starring:i.starring??[],users:i.users??[],status:this.deriveStatus(i,m,r,!!o),isActive:m,worktreeProject:i.worktreeProject}}).sort((i,m)=>{let q=kt[i.status]-kt[m.status];return q!==0?q:i.modifiedDate>m.modifiedDate?-1:1})});deriveStatus(t,e,r,o){let i=Date.now()-new Date(t.modifiedDate).getTime();return t.closedByUser?"done":t.pendingInvite?"waiting-you":e?r?"in-progress":"paused":i<bt?"in-progress":"paused"}static \u0275fac=function(e){return new(e||n)};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var F=class n{projectState=g(P);threadState=g(U);destroy$=new ce$1;eventSource=null;currentProject=null;constructor(){this.projectState.selectedProject$.pipe(Vy(this.destroy$)).subscribe(t=>{let e=t?.name??null;e!==this.currentProject&&(this.disconnect(),e&&this.connect(e));});}connect(t,e=5e3){this.currentProject=t;let r=`/api/projects/${encodeURIComponent(t)}/event-stream`;console.log(`[PROJECT_SSE] Connecting to ${r}`),this.eventSource=new EventSource(r),this.eventSource.onmessage=o=>{try{let i=JSON.parse(o.data),m=ce$2(i);if(!m)return;m instanceof V&&(console.log("[PROJECT_SSE] ThreadUpdateEvent \u2014 refreshing thread list"),this.threadState.refreshThreadList());}catch(i){console.warn("[PROJECT_SSE] Failed to parse event:",i);}},this.eventSource.onerror=()=>{this.eventSource?.readyState===EventSource.CLOSED&&(console.warn(`[PROJECT_SSE] Connection closed for ${t}, reconnecting in ${e}ms`),this.eventSource=null,setTimeout(()=>{this.currentProject===t&&this.connect(t,Math.min(e*2,6e4));},e));};}disconnect(){this.eventSource&&(this.eventSource.close(),this.eventSource=null,console.log(`[PROJECT_SSE] Disconnected from project ${this.currentProject}`)),this.currentProject=null;}ngOnDestroy(){this.disconnect(),this.destroy$.next(),this.destroy$.complete();}static \u0275fac=function(e){return new(e||n)};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var ce=(n,t)=>t.key,de=(n,t)=>t.status,le=(n,t)=>t.id;function pe(n,t){n&1&&bg(0,"mat-spinner",6);}function me(n,t){n&1&&(vs(0,"mat-icon"),WC(1,"add"),fl());}function ue(n,t){if(n&1&&(vs(0,"span",16),WC(1),fl()),n&2){let e=mC().$implicit,r=mC();XE(),Zg(r.filterCounts()[e.key]);}}function ge(n,t){if(n&1){let e=dC();vs(0,"button",15),Ag("click",function(){let o=If(e).$implicit,i=mC();return wf(i.setFilter(o.key))}),vs(1,"mat-icon",10),WC(2),fl(),vs(3,"span"),WC(4),fl(),eC(5,ue,2,1,"span",16),fl();}if(n&2){let e=t.$implicit,r=mC();Hg("active",r.activeFilter()===e.key),Cg("aria-selected",r.activeFilter()===e.key),XE(2),Zg(e.icon),XE(2),Zg(e.label),XE(),tC(r.filterCounts()[e.key]>0?5:-1);}}function _e(n,t){n&1&&(vs(0,"div",12),bg(1,"mat-spinner",17),vs(2,"p"),WC(3,"Loading tasks\u2026"),fl()());}function fe(n,t){if(n&1){let e=dC();vs(0,"p"),WC(1,"No tasks yet. Start your first one!"),fl(),vs(2,"button",19),Ag("click",function(){If(e);let o=mC(2);return wf(o.createTask())}),vs(3,"mat-icon"),WC(4,"add"),fl(),WC(5," New Task "),fl();}}function he(n,t){n&1&&(vs(0,"p"),WC(1,"No tasks in this category."),fl());}function ke(n,t){if(n&1&&(vs(0,"div",13)(1,"mat-icon",18),WC(2,"rocket_launch"),fl(),eC(3,fe,6,0)(4,he,2,0,"p"),fl()),n&2){let e=mC();XE(3),tC(e.activeFilter()==="all"?3:4);}}function ve(n,t){if(n&1){let e=dC();vs(0,"app-task-card",25),Ag("stopRequested",function(o){If(e);let i=mC(3);return wf(i.onStopRequested(o))})("deleteRequested",function(o){If(e);let i=mC(3);return wf(i.onDeleteRequested(o))})("starToggled",function(o){If(e);let i=mC(3);return wf(i.onStarToggled(o))})("markDoneRequested",function(o){If(e);let i=mC(3);return wf(i.onMarkDoneRequested(o))})("markActiveRequested",function(o){If(e);let i=mC(3);return wf(i.onMarkActiveRequested(o))}),fl();}if(n&2){let e=t.$implicit;Tg("task",e);}}function Ce(n,t){if(n&1&&(vs(0,"section",20)(1,"h2",21)(2,"mat-icon",22),WC(3),fl(),WC(4),vs(5,"span",23),WC(6),fl()(),vs(7,"div",14),oC(8,ve,1,1,"app-task-card",24,le),fl()()),n&2){let e=t.$implicit;XE(3),Zg(e.icon),XE(),yl(" ",e.label," "),XE(2),Zg(e.tasks.length),XE(2),iC(e.tasks);}}function be(n,t){if(n&1&&oC(0,Ce,10,3,"section",20,de),n&2){let e=mC();iC(e.taskGroups());}}function ye(n,t){if(n&1){let e=dC();vs(0,"app-task-card",25),Ag("stopRequested",function(o){If(e);let i=mC(2);return wf(i.onStopRequested(o))})("deleteRequested",function(o){If(e);let i=mC(2);return wf(i.onDeleteRequested(o))})("starToggled",function(o){If(e);let i=mC(2);return wf(i.onStarToggled(o))})("markDoneRequested",function(o){If(e);let i=mC(2);return wf(i.onMarkDoneRequested(o))})("markActiveRequested",function(o){If(e);let i=mC(2);return wf(i.onMarkActiveRequested(o))}),fl();}if(n&2){let e=t.$implicit;Tg("task",e);}}function xe(n,t){if(n&1&&(vs(0,"div",14),oC(1,ye,1,1,"app-task-card",24,le),fl()),n&2){let e=mC();XE(),iC(e.filteredTasks());}}var Te=[{key:"all",label:"All",icon:"grid_view"},{key:"waiting-you",label:"Waiting for you",icon:"mark_unread_chat_alt"},{key:"in-progress",label:"In progress",icon:"pending"},{key:"paused",label:"Paused",icon:"pause_circle"},{key:"done",label:"Done",icon:"check_circle"}],se=class n{router=g(G);projectState=g(P);threadState=g(U);threadApi=g(N);taskStatus=g(R);userService=g(he$1);projectApi=g(c);destroyRef=g(we);_projectEventStream=g(F);filters=Te;activeFilter=Hi("all");starredOnly=Hi(false);isCreating=Hi(false);isLoadingList=F$1(this.threadState.isLoadingThreadList$,{initialValue:false});username=F$1(this.userService.username$,{initialValue:null});allTasks=this.taskStatus.tasks;filteredTasks=mT(()=>{let t=this.activeFilter(),e=this.username(),r=this.allTasks();return this.starredOnly()&&e&&(r=r.filter(o=>o.starring.includes(e))),t==="all"?r:r.filter(o=>o.status===t)});filterCounts=mT(()=>{let t=this.username(),e=this.allTasks();return this.starredOnly()&&t&&(e=e.filter(r=>r.starring.includes(t))),{all:e.length,"waiting-you":e.filter(r=>r.status==="waiting-you").length,"in-progress":e.filter(r=>r.status==="in-progress").length,paused:e.filter(r=>r.status==="paused").length,done:e.filter(r=>r.status==="done").length}});taskGroups=mT(()=>{let t=this.username(),e=this.allTasks();this.starredOnly()&&t&&(e=e.filter(o=>o.starring.includes(t)));let r=[{status:"waiting-you",label:"Waiting for you",icon:"mark_unread_chat_alt",tasks:[]},{status:"in-progress",label:"In progress",icon:"pending",tasks:[]},{status:"done",label:"Done",icon:"check_circle",tasks:[]},{status:"paused",label:"Paused",icon:"pause_circle",tasks:[]},{status:"error",label:"Error",icon:"error",tasks:[]}];for(let o of e){let i=r.find(m=>m.status===o.status);i&&i.tasks.push(o);}return r.filter(o=>o.tasks.length>0)});ngOnInit(){this.userService.fetchCurrentUser().pipe(U$1(this.destroyRef)).subscribe({error:t=>console.warn("[TASK-CONTROL] Could not fetch user:",t)});}setFilter(t){this.activeFilter.set(t);}toggleStarredFilter(){this.starredOnly.update(t=>!t);}createTask(){let t=this.projectState.getSelectedProjectId();!t||this.isCreating()||(this.isCreating.set(true),this.threadApi.createThread().pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.isCreating.set(false),this.router.navigate(["project",t,"thread",e.thread.id]);},error:e=>{console.error("[TASK-CONTROL] Failed to create thread:",e),this.isCreating.set(false);}}));}onStopRequested(t){this.threadApi.stopThread(t).pipe(U$1(this.destroyRef)).subscribe({error:e=>console.error("[TASK-CONTROL] Failed to stop thread:",e)});}onDeleteRequested(t){this.threadApi.deleteThread(t).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.threadState.refreshThreadList(),error:e=>console.error("[TASK-CONTROL] Failed to delete thread:",e)});}onStarToggled(t){let e=this.username();if(!e)return;let r=this.allTasks().find(m=>m.id===t);if(!r)return;let o=r.starring.includes(e),i=o?this.threadApi.unstarThread(t):this.threadApi.starThread(t);this.threadState.updateStarLocal(t,!o,e),i.pipe(U$1(this.destroyRef)).subscribe({error:m=>{console.error("[TASK-CONTROL] Failed to toggle star:",m),this.threadState.refreshThreadList();}});}onMarkDoneRequested(t){let e=this.projectState.getSelectedProjectId();e&&this.projectApi.markThreadDone(e,t).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.threadState.refreshThreadList(),error:r=>console.error("[TASK-CONTROL] Failed to mark task as done:",r)});}onMarkActiveRequested(t){let e=this.projectState.getSelectedProjectId();e&&this.projectApi.markThreadActive(e,t).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.threadState.refreshThreadList(),error:r=>console.error("[TASK-CONTROL] Failed to mark task as active:",r)});}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Aw({type:n,selectors:[["app-task-control"]],decls:25,vars:6,consts:[[1,"task-control"],[1,"tc-header"],[1,"tc-title-row"],[1,"tc-title"],[1,"title-icon"],["mat-flat-button","","aria-label","Start a new task",1,"new-task-btn",3,"click","disabled"],["diameter","16"],["role","tablist","aria-label","Filter tasks",1,"tc-filters"],["role","tab",1,"filter-chip",3,"active"],["role","switch","aria-label","Show starred tasks only",1,"filter-chip","starred-filter",3,"click"],[1,"filter-icon"],[1,"tc-grid-wrapper"],[1,"tc-loading"],[1,"tc-empty"],[1,"tc-grid"],["role","tab",1,"filter-chip",3,"click"],[1,"filter-badge"],["diameter","40"],[1,"empty-icon"],["mat-flat-button","",1,"new-task-btn",3,"click"],[1,"tc-group"],[1,"tc-group-title"],[1,"group-icon"],[1,"group-count"],[3,"task"],[3,"stopRequested","deleteRequested","starToggled","markDoneRequested","markActiveRequested","task"]],template:function(e,r){e&1&&(vs(0,"app-sidenav")(1,"div",0)(2,"header",1)(3,"div",2)(4,"h1",3)(5,"mat-icon",4),WC(6,"rocket_launch"),fl(),WC(7," Task Control "),fl(),vs(8,"button",5),Ag("click",function(){return r.createTask()}),eC(9,pe,1,0,"mat-spinner",6)(10,me,2,0,"mat-icon"),WC(11," New Task "),fl()(),vs(12,"nav",7),oC(13,ge,6,6,"button",8,ce),vs(15,"button",9),Ag("click",function(){return r.toggleStarredFilter()}),vs(16,"mat-icon",10),WC(17,"star"),fl(),vs(18,"span"),WC(19,"Starred"),fl()()()(),vs(20,"main",11),eC(21,_e,4,0,"div",12)(22,ke,5,1,"div",13)(23,be,2,0)(24,xe,3,0,"div",14),fl()()()),e&2&&(XE(8),Tg("disabled",r.isCreating()),XE(),tC(r.isCreating()?9:10),XE(4),iC(r.filters),XE(2),Hg("active",r.starredOnly()),Cg("aria-checked",r.starredOnly()),XE(6),tC(r.isLoadingList()?21:r.filteredTasks().length===0?22:r.activeFilter()==="all"?23:24));},dependencies:[A,St,yt,wt,hr,pr,Et,yt$1],styles:[".glass-panel[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow)}.glass-interactive[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-interactive[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-interactive[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-card[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);border-radius:20px;padding:1.5rem}.glass-button[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-button[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-button[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-button[_ngcontent-%COMP%]{border-radius:12px;padding:.75rem 1.5rem;font-weight:600;cursor:pointer}.glass-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed;transform:none}.glass-button[_ngcontent-%COMP%]:disabled:hover{transform:none}.smooth-theme-transition[_ngcontent-%COMP%]{transition:background .3s ease,color .3s ease,border-color .3s ease,box-shadow .3s ease}[_nghost-%COMP%]{display:flex;height:100vh;width:100%;overflow:hidden}.task-control[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;padding:1.5rem;gap:1.25rem;box-sizing:border-box}.tc-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;flex-shrink:0}.tc-title-row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1rem}.tc-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text)}.tc-title[_ngcontent-%COMP%] .title-icon[_ngcontent-%COMP%]{font-size:1.5rem;width:1.5rem;height:1.5rem;color:var(--color-primary)}.new-task-btn[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;background:var(--color-primary);color:var(--color-text-inverse);border-radius:12px;font-weight:600;padding:0 1rem;height:36px;flex-shrink:0}.new-task-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.1rem;width:1.1rem;height:1.1rem}.new-task-btn[_ngcontent-%COMP%] mat-spinner[_ngcontent-%COMP%]{display:inline-block}.tc-filters[_ngcontent-%COMP%]{display:flex;gap:.5rem;flex-wrap:wrap}.filter-chip[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);display:flex;align-items:center;gap:.375rem;padding:.375rem .875rem;border-radius:100px;font-size:.8rem;font-weight:500;color:var(--color-text-secondary);cursor:pointer;border:1px solid var(--color-border);transition:background .15s ease,color .15s ease,border-color .15s ease;white-space:nowrap}.filter-chip[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{font-size:.9rem;width:.9rem;height:.9rem}.filter-chip[_ngcontent-%COMP%] .filter-badge[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-radius:100px;padding:0 .375rem;font-size:.7rem;font-weight:700;min-width:18px;text-align:center;line-height:18px}.filter-chip.active[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-color:var(--color-primary)}.filter-chip.active[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{color:var(--color-text-inverse)}.filter-chip.active[_ngcontent-%COMP%] .filter-badge[_ngcontent-%COMP%]{background:#ffffff4d;color:var(--color-text-inverse)}.filter-chip[_ngcontent-%COMP%]:hover:not(.active){background:var(--color-bg-hover);color:var(--color-text)}.starred-filter.active[_ngcontent-%COMP%]{background:#f5a62326;border-color:#f5a623;color:#f5a623}.starred-filter.active[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{color:#f5a623}.tc-group[_ngcontent-%COMP%]{margin-bottom:1.5rem}.tc-group[_ngcontent-%COMP%]:last-child{margin-bottom:0}.tc-group-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin:0 0 .75rem;font-size:.85rem;font-weight:600;color:var(--color-text-secondary);text-transform:uppercase;letter-spacing:.05em}.tc-group-title[_ngcontent-%COMP%] .group-icon[_ngcontent-%COMP%]{font-size:1rem;width:1rem;height:1rem}.tc-group-title[_ngcontent-%COMP%] .group-count[_ngcontent-%COMP%]{background:var(--color-bg-hover);border-radius:100px;padding:0 .375rem;font-size:.75rem;font-weight:700;min-width:18px;text-align:center;line-height:18px}.tc-grid-wrapper[_ngcontent-%COMP%]{flex:1;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--color-border) transparent}.tc-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1rem;padding-bottom:1rem}@media(max-width:600px){.tc-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.tc-loading[_ngcontent-%COMP%], .tc-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;height:100%;min-height:240px;color:var(--color-text-secondary);text-align:center}.tc-loading[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .tc-empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:.95rem}.empty-icon[_ngcontent-%COMP%]{font-size:3rem;width:3rem;height:3rem;opacity:.3}"]})};export{se as TaskControlComponent};
|
|
1
|
+
import {A,k as kt,b as bt}from'./chunk-DaK9SdKA.js';import {S as St}from'./chunk-DWo8Yipj.js';import {E as Et,y as yt$1,G as Ge}from'./chunk-DxenqkEz.js';import {g,G,P,U,N,h as he$1,K as c,w as we,H as Hi,F as F$1,m as mT,b as U$1,A as Aw,i as hr,p as pr,v as vs,W as WC,k as fl,l as Ag,n as eC,q as oC,X as XE,r as Tg,t as tC,x as iC,y as Hg,C as Cg,u as ue$1,c9 as We,Y as x,an as ce$1,ap as Vy,c as ce$2,V,o as bg,a9 as dC,aa as If,ac as mC,ab as wf,a8 as Zg,a5 as yl}from'./main-XVJVH4GF.js';import'./chunk-DtHFNV_5.js';import'./chunk-CjhnozeY.js';import'./chunk-GU0OGBZz.js';import'./chunk-drd9oaGN.js';import {y as yt,w as wt}from'./chunk-DL6rhSDN.js';var R=class n{threadState=g(U);codayService=g(Ge);threadList=F$1(this.threadState.threadList$,{initialValue:[]});selectedThread=F$1(this.threadState.selectedThread$,{initialValue:null});isThinking=F$1(this.codayService.isThinking$,{initialValue:false});inviteEvent=F$1(this.codayService.currentInviteEvent$.pipe(ue$1(t=>t?.invite===We?null:t)),{initialValue:null});tasks=mT(()=>{let t=this.threadList(),e=this.selectedThread(),r=this.isThinking(),o=this.inviteEvent();return t.filter(i=>!i.parentThreadId).map(i=>{let m=!!e&&i.id===e.id;return {id:i.id,name:i.name,summary:i.summary,modifiedDate:i.modifiedDate,starring:i.starring??[],users:i.users??[],status:this.deriveStatus(i,m,r,!!o),isActive:m,worktreeProject:i.worktreeProject}}).sort((i,m)=>{let q=kt[i.status]-kt[m.status];return q!==0?q:i.modifiedDate>m.modifiedDate?-1:1})});deriveStatus(t,e,r,o){let i=Date.now()-new Date(t.modifiedDate).getTime();return t.closedByUser?"done":t.pendingInvite?"waiting-you":e?r?"in-progress":"paused":i<bt?"in-progress":"paused"}static \u0275fac=function(e){return new(e||n)};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var F=class n{projectState=g(P);threadState=g(U);destroy$=new ce$1;eventSource=null;currentProject=null;constructor(){this.projectState.selectedProject$.pipe(Vy(this.destroy$)).subscribe(t=>{let e=t?.name??null;e!==this.currentProject&&(this.disconnect(),e&&this.connect(e));});}connect(t,e=5e3){this.currentProject=t;let r=`/api/projects/${encodeURIComponent(t)}/event-stream`;console.log(`[PROJECT_SSE] Connecting to ${r}`),this.eventSource=new EventSource(r),this.eventSource.onmessage=o=>{try{let i=JSON.parse(o.data),m=ce$2(i);if(!m)return;m instanceof V&&(console.log("[PROJECT_SSE] ThreadUpdateEvent \u2014 refreshing thread list"),this.threadState.refreshThreadList());}catch(i){console.warn("[PROJECT_SSE] Failed to parse event:",i);}},this.eventSource.onerror=()=>{this.eventSource?.readyState===EventSource.CLOSED&&(console.warn(`[PROJECT_SSE] Connection closed for ${t}, reconnecting in ${e}ms`),this.eventSource=null,setTimeout(()=>{this.currentProject===t&&this.connect(t,Math.min(e*2,6e4));},e));};}disconnect(){this.eventSource&&(this.eventSource.close(),this.eventSource=null,console.log(`[PROJECT_SSE] Disconnected from project ${this.currentProject}`)),this.currentProject=null;}ngOnDestroy(){this.disconnect(),this.destroy$.next(),this.destroy$.complete();}static \u0275fac=function(e){return new(e||n)};static \u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"})};var ce=(n,t)=>t.key,de=(n,t)=>t.status,le=(n,t)=>t.id;function pe(n,t){n&1&&bg(0,"mat-spinner",6);}function me(n,t){n&1&&(vs(0,"mat-icon"),WC(1,"add"),fl());}function ue(n,t){if(n&1&&(vs(0,"span",16),WC(1),fl()),n&2){let e=mC().$implicit,r=mC();XE(),Zg(r.filterCounts()[e.key]);}}function ge(n,t){if(n&1){let e=dC();vs(0,"button",15),Ag("click",function(){let o=If(e).$implicit,i=mC();return wf(i.setFilter(o.key))}),vs(1,"mat-icon",10),WC(2),fl(),vs(3,"span"),WC(4),fl(),eC(5,ue,2,1,"span",16),fl();}if(n&2){let e=t.$implicit,r=mC();Hg("active",r.activeFilter()===e.key),Cg("aria-selected",r.activeFilter()===e.key),XE(2),Zg(e.icon),XE(2),Zg(e.label),XE(),tC(r.filterCounts()[e.key]>0?5:-1);}}function _e(n,t){n&1&&(vs(0,"div",12),bg(1,"mat-spinner",17),vs(2,"p"),WC(3,"Loading tasks\u2026"),fl()());}function fe(n,t){if(n&1){let e=dC();vs(0,"p"),WC(1,"No tasks yet. Start your first one!"),fl(),vs(2,"button",19),Ag("click",function(){If(e);let o=mC(2);return wf(o.createTask())}),vs(3,"mat-icon"),WC(4,"add"),fl(),WC(5," New Task "),fl();}}function he(n,t){n&1&&(vs(0,"p"),WC(1,"No tasks in this category."),fl());}function ke(n,t){if(n&1&&(vs(0,"div",13)(1,"mat-icon",18),WC(2,"rocket_launch"),fl(),eC(3,fe,6,0)(4,he,2,0,"p"),fl()),n&2){let e=mC();XE(3),tC(e.activeFilter()==="all"?3:4);}}function ve(n,t){if(n&1){let e=dC();vs(0,"app-task-card",25),Ag("stopRequested",function(o){If(e);let i=mC(3);return wf(i.onStopRequested(o))})("deleteRequested",function(o){If(e);let i=mC(3);return wf(i.onDeleteRequested(o))})("starToggled",function(o){If(e);let i=mC(3);return wf(i.onStarToggled(o))})("markDoneRequested",function(o){If(e);let i=mC(3);return wf(i.onMarkDoneRequested(o))})("markActiveRequested",function(o){If(e);let i=mC(3);return wf(i.onMarkActiveRequested(o))}),fl();}if(n&2){let e=t.$implicit;Tg("task",e);}}function Ce(n,t){if(n&1&&(vs(0,"section",20)(1,"h2",21)(2,"mat-icon",22),WC(3),fl(),WC(4),vs(5,"span",23),WC(6),fl()(),vs(7,"div",14),oC(8,ve,1,1,"app-task-card",24,le),fl()()),n&2){let e=t.$implicit;XE(3),Zg(e.icon),XE(),yl(" ",e.label," "),XE(2),Zg(e.tasks.length),XE(2),iC(e.tasks);}}function be(n,t){if(n&1&&oC(0,Ce,10,3,"section",20,de),n&2){let e=mC();iC(e.taskGroups());}}function ye(n,t){if(n&1){let e=dC();vs(0,"app-task-card",25),Ag("stopRequested",function(o){If(e);let i=mC(2);return wf(i.onStopRequested(o))})("deleteRequested",function(o){If(e);let i=mC(2);return wf(i.onDeleteRequested(o))})("starToggled",function(o){If(e);let i=mC(2);return wf(i.onStarToggled(o))})("markDoneRequested",function(o){If(e);let i=mC(2);return wf(i.onMarkDoneRequested(o))})("markActiveRequested",function(o){If(e);let i=mC(2);return wf(i.onMarkActiveRequested(o))}),fl();}if(n&2){let e=t.$implicit;Tg("task",e);}}function xe(n,t){if(n&1&&(vs(0,"div",14),oC(1,ye,1,1,"app-task-card",24,le),fl()),n&2){let e=mC();XE(),iC(e.filteredTasks());}}var Te=[{key:"all",label:"All",icon:"grid_view"},{key:"waiting-you",label:"Waiting for you",icon:"mark_unread_chat_alt"},{key:"in-progress",label:"In progress",icon:"pending"},{key:"paused",label:"Paused",icon:"pause_circle"},{key:"done",label:"Done",icon:"check_circle"}],se=class n{router=g(G);projectState=g(P);threadState=g(U);threadApi=g(N);taskStatus=g(R);userService=g(he$1);projectApi=g(c);destroyRef=g(we);_projectEventStream=g(F);filters=Te;activeFilter=Hi("all");starredOnly=Hi(false);isCreating=Hi(false);isLoadingList=F$1(this.threadState.isLoadingThreadList$,{initialValue:false});username=F$1(this.userService.username$,{initialValue:null});allTasks=this.taskStatus.tasks;filteredTasks=mT(()=>{let t=this.activeFilter(),e=this.username(),r=this.allTasks();return this.starredOnly()&&e&&(r=r.filter(o=>o.starring.includes(e))),t==="all"?r:r.filter(o=>o.status===t)});filterCounts=mT(()=>{let t=this.username(),e=this.allTasks();return this.starredOnly()&&t&&(e=e.filter(r=>r.starring.includes(t))),{all:e.length,"waiting-you":e.filter(r=>r.status==="waiting-you").length,"in-progress":e.filter(r=>r.status==="in-progress").length,paused:e.filter(r=>r.status==="paused").length,done:e.filter(r=>r.status==="done").length}});taskGroups=mT(()=>{let t=this.username(),e=this.allTasks();this.starredOnly()&&t&&(e=e.filter(o=>o.starring.includes(t)));let r=[{status:"waiting-you",label:"Waiting for you",icon:"mark_unread_chat_alt",tasks:[]},{status:"in-progress",label:"In progress",icon:"pending",tasks:[]},{status:"done",label:"Done",icon:"check_circle",tasks:[]},{status:"paused",label:"Paused",icon:"pause_circle",tasks:[]},{status:"error",label:"Error",icon:"error",tasks:[]}];for(let o of e){let i=r.find(m=>m.status===o.status);i&&i.tasks.push(o);}return r.filter(o=>o.tasks.length>0)});ngOnInit(){this.userService.fetchCurrentUser().pipe(U$1(this.destroyRef)).subscribe({error:t=>console.warn("[TASK-CONTROL] Could not fetch user:",t)});}setFilter(t){this.activeFilter.set(t);}toggleStarredFilter(){this.starredOnly.update(t=>!t);}createTask(){let t=this.projectState.getSelectedProjectId();!t||this.isCreating()||(this.isCreating.set(true),this.threadApi.createThread().pipe(U$1(this.destroyRef)).subscribe({next:e=>{this.isCreating.set(false),this.router.navigate(["project",t,"thread",e.thread.id]);},error:e=>{console.error("[TASK-CONTROL] Failed to create thread:",e),this.isCreating.set(false);}}));}onStopRequested(t){this.threadApi.stopThread(t).pipe(U$1(this.destroyRef)).subscribe({error:e=>console.error("[TASK-CONTROL] Failed to stop thread:",e)});}onDeleteRequested(t){this.threadApi.deleteThread(t).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.threadState.refreshThreadList(),error:e=>console.error("[TASK-CONTROL] Failed to delete thread:",e)});}onStarToggled(t){let e=this.username();if(!e)return;let r=this.allTasks().find(m=>m.id===t);if(!r)return;let o=r.starring.includes(e),i=o?this.threadApi.unstarThread(t):this.threadApi.starThread(t);this.threadState.updateStarLocal(t,!o,e),i.pipe(U$1(this.destroyRef)).subscribe({error:m=>{console.error("[TASK-CONTROL] Failed to toggle star:",m),this.threadState.refreshThreadList();}});}onMarkDoneRequested(t){let e=this.projectState.getSelectedProjectId();e&&this.projectApi.markThreadDone(e,t).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.threadState.refreshThreadList(),error:r=>console.error("[TASK-CONTROL] Failed to mark task as done:",r)});}onMarkActiveRequested(t){let e=this.projectState.getSelectedProjectId();e&&this.projectApi.markThreadActive(e,t).pipe(U$1(this.destroyRef)).subscribe({next:()=>this.threadState.refreshThreadList(),error:r=>console.error("[TASK-CONTROL] Failed to mark task as active:",r)});}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Aw({type:n,selectors:[["app-task-control"]],decls:25,vars:6,consts:[[1,"task-control"],[1,"tc-header"],[1,"tc-title-row"],[1,"tc-title"],[1,"title-icon"],["mat-flat-button","","aria-label","Start a new task",1,"new-task-btn",3,"click","disabled"],["diameter","16"],["role","tablist","aria-label","Filter tasks",1,"tc-filters"],["role","tab",1,"filter-chip",3,"active"],["role","switch","aria-label","Show starred tasks only",1,"filter-chip","starred-filter",3,"click"],[1,"filter-icon"],[1,"tc-grid-wrapper"],[1,"tc-loading"],[1,"tc-empty"],[1,"tc-grid"],["role","tab",1,"filter-chip",3,"click"],[1,"filter-badge"],["diameter","40"],[1,"empty-icon"],["mat-flat-button","",1,"new-task-btn",3,"click"],[1,"tc-group"],[1,"tc-group-title"],[1,"group-icon"],[1,"group-count"],[3,"task"],[3,"stopRequested","deleteRequested","starToggled","markDoneRequested","markActiveRequested","task"]],template:function(e,r){e&1&&(vs(0,"app-sidenav")(1,"div",0)(2,"header",1)(3,"div",2)(4,"h1",3)(5,"mat-icon",4),WC(6,"rocket_launch"),fl(),WC(7," Task Control "),fl(),vs(8,"button",5),Ag("click",function(){return r.createTask()}),eC(9,pe,1,0,"mat-spinner",6)(10,me,2,0,"mat-icon"),WC(11," New Task "),fl()(),vs(12,"nav",7),oC(13,ge,6,6,"button",8,ce),vs(15,"button",9),Ag("click",function(){return r.toggleStarredFilter()}),vs(16,"mat-icon",10),WC(17,"star"),fl(),vs(18,"span"),WC(19,"Starred"),fl()()()(),vs(20,"main",11),eC(21,_e,4,0,"div",12)(22,ke,5,1,"div",13)(23,be,2,0)(24,xe,3,0,"div",14),fl()()()),e&2&&(XE(8),Tg("disabled",r.isCreating()),XE(),tC(r.isCreating()?9:10),XE(4),iC(r.filters),XE(2),Hg("active",r.starredOnly()),Cg("aria-checked",r.starredOnly()),XE(6),tC(r.isLoadingList()?21:r.filteredTasks().length===0?22:r.activeFilter()==="all"?23:24));},dependencies:[A,St,yt,wt,hr,pr,Et,yt$1],styles:[".glass-panel[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow)}.glass-interactive[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-interactive[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-interactive[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-card[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);border-radius:20px;padding:1.5rem}.glass-button[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);transition:all .3s cubic-bezier(.4,0,.2,1)}.glass-button[_ngcontent-%COMP%]:hover{transform:translateY(-2px);box-shadow:0 12px 40px #00000026}.glass-button[_ngcontent-%COMP%]:active{transform:translateY(0)}.glass-button[_ngcontent-%COMP%]{border-radius:12px;padding:.75rem 1.5rem;font-weight:600;cursor:pointer}.glass-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed;transform:none}.glass-button[_ngcontent-%COMP%]:disabled:hover{transform:none}.smooth-theme-transition[_ngcontent-%COMP%]{transition:background .3s ease,color .3s ease,border-color .3s ease,box-shadow .3s ease}[_nghost-%COMP%]{display:flex;height:100vh;width:100%;overflow:hidden}.task-control[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;overflow:hidden;padding:1.5rem;gap:1.25rem;box-sizing:border-box}.tc-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;flex-shrink:0}.tc-title-row[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1rem}.tc-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text)}.tc-title[_ngcontent-%COMP%] .title-icon[_ngcontent-%COMP%]{font-size:1.5rem;width:1.5rem;height:1.5rem;color:var(--color-primary)}.new-task-btn[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;background:var(--color-primary);color:var(--color-text-inverse);border-radius:12px;font-weight:600;padding:0 1rem;height:36px;flex-shrink:0}.new-task-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.1rem;width:1.1rem;height:1.1rem}.new-task-btn[_ngcontent-%COMP%] mat-spinner[_ngcontent-%COMP%]{display:inline-block}.tc-filters[_ngcontent-%COMP%]{display:flex;gap:.5rem;flex-wrap:wrap}.filter-chip[_ngcontent-%COMP%]{background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);box-shadow:var(--glass-shadow);display:flex;align-items:center;gap:.375rem;padding:.375rem .875rem;border-radius:100px;font-size:.8rem;font-weight:500;color:var(--color-text-secondary);cursor:pointer;border:1px solid var(--color-border);transition:background .15s ease,color .15s ease,border-color .15s ease;white-space:nowrap}.filter-chip[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{font-size:.9rem;width:.9rem;height:.9rem}.filter-chip[_ngcontent-%COMP%] .filter-badge[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-radius:100px;padding:0 .375rem;font-size:.7rem;font-weight:700;min-width:18px;text-align:center;line-height:18px}.filter-chip.active[_ngcontent-%COMP%]{background:var(--color-primary);color:var(--color-text-inverse);border-color:var(--color-primary)}.filter-chip.active[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{color:var(--color-text-inverse)}.filter-chip.active[_ngcontent-%COMP%] .filter-badge[_ngcontent-%COMP%]{background:#ffffff4d;color:var(--color-text-inverse)}.filter-chip[_ngcontent-%COMP%]:hover:not(.active){background:var(--color-bg-hover);color:var(--color-text)}.starred-filter.active[_ngcontent-%COMP%]{background:#f5a62326;border-color:#f5a623;color:#f5a623}.starred-filter.active[_ngcontent-%COMP%] .filter-icon[_ngcontent-%COMP%]{color:#f5a623}.tc-group[_ngcontent-%COMP%]{margin-bottom:1.5rem}.tc-group[_ngcontent-%COMP%]:last-child{margin-bottom:0}.tc-group-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin:0 0 .75rem;font-size:.85rem;font-weight:600;color:var(--color-text-secondary);text-transform:uppercase;letter-spacing:.05em}.tc-group-title[_ngcontent-%COMP%] .group-icon[_ngcontent-%COMP%]{font-size:1rem;width:1rem;height:1rem}.tc-group-title[_ngcontent-%COMP%] .group-count[_ngcontent-%COMP%]{background:var(--color-bg-hover);border-radius:100px;padding:0 .375rem;font-size:.75rem;font-weight:700;min-width:18px;text-align:center;line-height:18px}.tc-grid-wrapper[_ngcontent-%COMP%]{flex:1;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--color-border) transparent}.tc-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:1rem;padding-bottom:1rem}@media(max-width:600px){.tc-grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.tc-loading[_ngcontent-%COMP%], .tc-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;height:100%;min-height:240px;color:var(--color-text-secondary);text-align:center}.tc-loading[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .tc-empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;font-size:.95rem}.empty-icon[_ngcontent-%COMP%]{font-size:3rem;width:3rem;height:3rem;opacity:.3}"]})};export{se as TaskControlComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {g,J as dy,P,S as ha,u as ue,Y as x}from'./main-
|
|
1
|
+
import {g,J as dy,P,S as ha,u as ue,Y as x}from'./main-XVJVH4GF.js';var d=class i{http=g(dy);projectState=g(P);promptsCache=new Map;getBaseUrl(){return `/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/prompts`}listPrompts(){return this.http.get(this.getBaseUrl())}getPromptsAutocomplete(t,e){let r=this.promptsCache.get(t);return r?ha(this.filterPromptsForAutocomplete(r,e)):this.http.get(`/api/projects/${t}/prompts`).pipe(ue(p=>(this.promptsCache.set(t,p),this.filterPromptsForAutocomplete(p,e))))}filterPromptsForAutocomplete(t,e){let r=e.toLowerCase();return t.filter(o=>o.name.toLowerCase().includes(r)||o.description.toLowerCase().includes(r)).map(o=>({name:o.name,description:o.description,parameterFormat:o.parameterFormat}))}clearCache(t){t?this.promptsCache.delete(t):this.promptsCache.clear();}getPrompt(t){return this.http.get(`${this.getBaseUrl()}/${t}`)}createPrompt(t){return this.http.post(this.getBaseUrl(),t).pipe(ue(e=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),e)))}updatePrompt(t,e){return this.http.put(`${this.getBaseUrl()}/${t}`,e).pipe(ue(r=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),r)))}deletePrompt(t){return this.http.delete(`${this.getBaseUrl()}/${t}`).pipe(ue(e=>(this.clearCache(this.projectState.getSelectedProjectId()??void 0),e)))}enableWebhook(t){return this.http.post(`${this.getBaseUrl()}/${t}/webhook`,{})}disableWebhook(t){return this.http.delete(`${this.getBaseUrl()}/${t}/webhook`)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=x({token:i,factory:i.\u0275fac,providedIn:"root"})};export{d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {n}from'./chunk-CfgXrte_.js';import {O}from'./chunk-
|
|
1
|
+
import {n}from'./chunk-CfgXrte_.js';import {O}from'./chunk-BhfTutz7.js';import {S}from'./chunk-CASGcP8y.js';import {v}from'./chunk-DaJf2IFW.js';import {g,ao as V,G,w as we,H as Hi,u as ue,b as U$1,bR as ma,S as ha,A as Aw,aJ as Nb,v as vs,be as aT,l as Ag,k as fl,af as Dg,T as TC,r as Tg,bf as uT,ah as rT,n as eC,ac as mC,t as tC,W as WC,X as XE,a8 as Zg,a9 as dC,aa as If,ab as wf,ag as fT}from'./main-XVJVH4GF.js';import'./chunk-DHse9w28.js';import {W as Wn,S as Se}from'./chunk--Cv5Auvq.js';import'./chunk-drd9oaGN.js';import'./chunk-DL6rhSDN.js';import'./chunk-SitBftU1.js';import'./chunk-C87Bh3Ov.js';var z=()=>[];function W(r,e){if(r&1&&(vs(0,"p",3),WC(1),fl()),r&2){let t=mC().$implicit;XE(),Zg(t.name);}}function U(r,e){if(r&1){let t=dC();vs(0,"agentos-ai-provider-item",5),Ag("editRequested",function(){let o=If(t),a=mC(2);return wf(a.onEdit(o))})("deleteRequested",function(){let o=If(t),a=mC(2);return wf(a.onDelete(o))})("duplicateRequested",function(){let o=If(t),a=mC(2);return wf(a.onDuplicate(o))}),fl();}if(r&2){let t=e,i=mC(2);Tg("config",t.config)("scope",t.scope)("readOnly",t.scope==="platform"||t.scope==="namespace"&&!i.isAdmin());}}function X(r,e){if(r&1&&eC(0,W,2,1,"p",3)(1,U,1,3,"agentos-ai-provider-item",4),r&2){let t,i=e.$implicit,o=mC();tC(o.isEmptyPlaceholder(i.id)?0:(t=o.resolve(i.id))?1:-1,t);}}var k=Object.freeze({platform:"Platform (read-only)",namespace:"AI Providers du namespace",userOnNs:"Mes overrides sur ce namespace",userGlobal:"Mes overrides globaux"}),F="__empty__",j=class r{route=g(V);router=g(G);destroyRef=g(we);state=g(O);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=Hi(false);listItems$=this.state.vm$.pipe(ue(e=>this.toListItems(e)));isLoading=Hi(true);resolved=new Map;ngOnInit(){this.route.paramMap.pipe(U$1(this.destroyRef)).subscribe(e=>{let t=e.get("namespaceId")??"";t&&t!==this.namespaceId&&(this.namespaceId=t),this.state.setNamespace(t);}),this.route.paramMap.pipe(ue(e=>e.get("namespaceId")??""),ma(e=>e?this.namespaceRole.isAdminOfNamespace$(e):ha(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe(e=>{this.isLoading.set(false);let t=new Map;e.platform.forEach(i=>{i.id&&t.set(this.itemKey("platform",i.id),{config:i,scope:"platform"});}),e.namespace.forEach(i=>{i.id&&t.set(this.itemKey("namespace",i.id),{config:i,scope:"namespace"});}),e.userOnNs.forEach(i=>{i.id&&t.set(this.itemKey("userOnNs",i.id),{config:i,scope:"userOnNs"});}),e.userGlobal.forEach(i=>{i.id&&t.set(this.itemKey("userGlobal",i.id),{config:i,scope:"userGlobal"});}),this.resolved=t;});}isEmptyPlaceholder(e){return e.startsWith(F)}resolve(e){return this.resolved.get(e)??null}itemKey(e,t){return `${e}:${t}`}goBack(){this.router.navigate(["/agentos","namespaces"]);}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-providers","new"],{queryParams:{scope:n(this.isAdmin())}});}onEdit(e){let t=e.config.id;t&&this.router.navigate(["/agentos",this.namespaceId,"ai-providers",t,"edit"],{queryParams:{scope:e.scope}});}onDelete(e){let t=e.config.id;t&&this.state.delete(t,e.scope).pipe(U$1(this.destroyRef)).subscribe({error:i=>{console.error(`[AiProvidersAllScopes] Delete failed for ${e.scope}:${t}:`,i);}});}onDuplicate(e){if(!e.config.id)return;let t=e.scope==="namespace"&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"ai-providers","new"],{queryParams:{scope:t,template:e.config.id,templateScope:e.scope}});}toListItems(e){let t=[];return t.push(...this.sectionItems("platform",e.platform)),t.push(...this.sectionItems("namespace",e.namespace)),t.push(...this.sectionItems("userOnNs",e.userOnNs)),t.push(...this.sectionItems("userGlobal",e.userGlobal)),t}sectionItems(e,t){return t.length===0?[{id:`${F}${e}`,name:"Aucun AI Provider",groupKey:e,groupLabel:k[e]}]:t.filter(i=>!!i.id).map(i=>({id:this.itemKey(e,i.id),name:i.name,description:i.apiType,groupKey:e,groupLabel:k[e]}))}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=Aw({type:r,selectors:[["agentos-ai-providers-all-scopes"]],decls:5,vars:7,consts:[["aiProviderItemTpl",""],["title","AI Providers","emptyMessage","No AI providers available.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[1,"ai-providers-all-scopes__empty"],[3,"config","scope","readOnly"],[3,"editRequested","deleteRequested","duplicateRequested","config","scope","readOnly"]],template:function(t,i){if(t&1&&(vs(0,"ds-entity-list",1),aT(1,"async"),Ag("createRequested",function(){return i.openCreateForm()}),vs(2,"ds-icon-button",2),Ag("action",function(){return i.goBack()}),fl()(),Dg(3,X,2,1,"ng-template",null,0,fT)),t&2){let o=TC(4);Tg("items",uT(1,4,i.listItems$)??rT(6,z))("loading",i.isLoading())("showCreate",true)("itemTemplate",o);}},dependencies:[Wn,S,Se,Nb],styles:[".ai-providers-all-scopes__empty[_ngcontent-%COMP%]{font-size:.85rem;color:var(--color-text-secondary);padding:.5rem .25rem;margin:0;font-style:italic}"]})};export{j as AiProvidersAllScopesComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {cs as vi,A as Aw,C as Cg,y as Hg,aK as Do,aL as qn,bD as vt,aN as wt,cY as fn,cS as Gp,cZ as he$1,cU as yg,bz as vC,v as vs,bA as DC,k as fl,b4 as nT,ad as Vg,n as eC,t as tC,X as XE,aV as w,bu as kg,I as IC,E as wC,g,az as Qt$1,c_ as kn,bv as St,bF as p,aO as G,aQ as As,aT as Ue,aU as U,H as Hi,an as ce$1,al as yt,ae as Ot,u as ue,c$ as va,bK as pe,br as Cl,ap as Vy,bt as Ve$1,c1 as ME,aA as sn,D as Fg,bs as Qn,aR as K,cN as is,bM as F,bQ as bd,cK as Id,bO as Yy,a9 as dC,l as Ag,ac as mC,bU as Ky,aM as Nn,bC as ge,aP as $a,bL as mr,d0 as lt,d1 as wt$1,d2 as I,bZ as xt,bW as Pt,a as P,aY as ks,aw as pl,cI as Rg,W as WC,ax as hl,b_ as FC,a8 as Zg,c2 as kt,cC as Ce,cy as Xr,aa as If,ab as wf}from'./main-DXWHG4XK.js';var Xt=["tooltip"],Ut=20;var qt=new w("mat-tooltip-scroll-strategy",{providedIn:"root",factory:()=>{let n=g(pe);return ()=>kt(n,{scrollThrottle:Ut})}}),$t=new w("mat-tooltip-default-options",{providedIn:"root",factory:()=>({showDelay:0,hideDelay:0,touchendHideDelay:1500})});var Ht="tooltip-panel",Kt={passive:true},Jt=8,te=8,ee=24,ie=200,ne=(()=>{class n{_elementRef=g(Qt$1);_ngZone=g(G);_platform=g(p);_ariaDescriber=g($a);_focusMonitor=g(St);_dir=g(Qn);_injector=g(pe);_viewContainerRef=g(mr);_mediaMatcher=g(lt);_document=g(U);_renderer=g(As);_animationsDisabled=K();_defaultOptions=g($t,{optional:true});_overlayRef=null;_tooltipInstance=null;_overlayPanelClass;_portal;_position="below";_positionAtOrigin=false;_disabled=false;_tooltipClass;_viewInitialized=false;_pointerExitEventsInitialized=false;_tooltipComponent=Gt;_viewportMargin=8;_currentPosition;_cssClassPrefix="mat-mdc";_ariaDescriptionPending=false;_dirSubscribed=false;get position(){return this._position}set position(t){t!==this._position&&(this._position=t,this._overlayRef&&(this._updatePosition(this._overlayRef),this._tooltipInstance?.show(0),this._overlayRef.updatePosition()));}get positionAtOrigin(){return this._positionAtOrigin}set positionAtOrigin(t){this._positionAtOrigin=vi(t),this._detach(),this._overlayRef=null;}get disabled(){return this._disabled}set disabled(t){let e=vi(t);this._disabled!==e&&(this._disabled=e,e?this.hide(0):this._setupPointerEnterEventsIfNeeded(),this._syncAriaDescription(this.message));}get showDelay(){return this._showDelay}set showDelay(t){this._showDelay=fn(t);}_showDelay;get hideDelay(){return this._hideDelay}set hideDelay(t){this._hideDelay=fn(t),this._tooltipInstance&&(this._tooltipInstance._mouseLeaveHideDelay=this._hideDelay);}_hideDelay;touchGestures="auto";get message(){return this._message}set message(t){let e=this._message;this._message=t!=null?String(t).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage()),this._syncAriaDescription(e);}_message="";get tooltipClass(){return this._tooltipClass}set tooltipClass(t){this._tooltipClass=t,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass);}_eventCleanups=[];_touchstartTimeout=null;_destroyed=new ce$1;_isDestroyed=false;constructor(){let t=this._defaultOptions;t&&(this._showDelay=t.showDelay,this._hideDelay=t.hideDelay,t.position&&(this.position=t.position),t.positionAtOrigin&&(this.positionAtOrigin=t.positionAtOrigin),t.touchGestures&&(this.touchGestures=t.touchGestures),t.tooltipClass&&(this.tooltipClass=t.tooltipClass)),this._viewportMargin=Jt;}ngAfterViewInit(){this._viewInitialized=true,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(Vy(this._destroyed)).subscribe(t=>{t?t==="keyboard"&&this._ngZone.run(()=>this.show()):this._ngZone.run(()=>this.hide(0));});}ngOnDestroy(){let t=this._elementRef.nativeElement;this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),this._eventCleanups.forEach(e=>e()),this._eventCleanups.length=0,this._destroyed.next(),this._destroyed.complete(),this._isDestroyed=true,this._ariaDescriber.removeDescription(t,this.message,"tooltip"),this._focusMonitor.stopMonitoring(t);}show(t=this.showDelay,e){if(this.disabled||!this.message||this._isTooltipVisible()){this._tooltipInstance?._cancelPendingAnimations();return}let i=this._createOverlay(e);this._detach(),this._portal=this._portal||new wt$1(this._tooltipComponent,this._viewContainerRef);let r=this._tooltipInstance=i.attach(this._portal).instance;r._triggerElement=this._elementRef.nativeElement,r._mouseLeaveHideDelay=this._hideDelay,r.afterHidden().pipe(Vy(this._destroyed)).subscribe(()=>this._detach()),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),r.show(t);}hide(t=this.hideDelay){let e=this._tooltipInstance;e&&(e.isVisible()?e.hide(t):(e._cancelPendingAnimations(),this._detach()));}toggle(t){this._isTooltipVisible()?this.hide():this.show(void 0,t);}_isTooltipVisible(){return !!this._tooltipInstance&&this._tooltipInstance.isVisible()}_createOverlay(t){if(this._overlayRef){let a=this._overlayRef.getConfig().positionStrategy;if((!this.positionAtOrigin||!t)&&a._origin instanceof Qt$1)return this._overlayRef;this._detach();}let e=this._injector.get(I).getAncestorScrollContainers(this._elementRef),i=`${this._cssClassPrefix}-${Ht}`,r=xt(this._injector,this.positionAtOrigin?t||this._elementRef:this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(false).withViewportMargin(this._viewportMargin).withScrollableContainers(e).withPopoverLocation("global");return r.positionChanges.pipe(Vy(this._destroyed)).subscribe(a=>{this._updateCurrentPositionClass(a.connectionPair),this._tooltipInstance&&a.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0));}),this._overlayRef=Pt(this._injector,{direction:this._dir,positionStrategy:r,panelClass:this._overlayPanelClass?[...this._overlayPanelClass,i]:i,scrollStrategy:this._injector.get(qt)(),disableAnimations:this._animationsDisabled,eventPredicate:this._overlayEventPredicate}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(Vy(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(Vy(this._destroyed)).subscribe(()=>this._tooltipInstance?._handleBodyInteraction()),this._overlayRef.keydownEvents().pipe(Vy(this._destroyed)).subscribe(a=>{a.preventDefault(),a.stopPropagation(),this._ngZone.run(()=>this.hide(0));}),this._defaultOptions?.disableTooltipInteractivity&&this._overlayRef.addPanelClass(`${this._cssClassPrefix}-tooltip-panel-non-interactive`),this._dirSubscribed||(this._dirSubscribed=true,this._dir.change.pipe(Vy(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef);})),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null;}_updatePosition(t){let e=t.getConfig().positionStrategy,i=this._getOrigin(),r=this._getOverlayPosition();e.withPositions([this._addOffset(P(P({},i.main),r.main)),this._addOffset(P(P({},i.fallback),r.fallback))]);}_addOffset(t){let e=te,i=!this._dir||this._dir.value=="ltr";return t.originY==="top"?t.offsetY=-e:t.originY==="bottom"?t.offsetY=e:t.originX==="start"?t.offsetX=i?-e:e:t.originX==="end"&&(t.offsetX=i?e:-e),t}_getOrigin(){let t=!this._dir||this._dir.value=="ltr",e=this.position,i;e=="above"||e=="below"?i={originX:"center",originY:e=="above"?"top":"bottom"}:e=="before"||e=="left"&&t||e=="right"&&!t?i={originX:"start",originY:"center"}:(e=="after"||e=="right"&&t||e=="left"&&!t)&&(i={originX:"end",originY:"center"});let{x:r,y:a}=this._invertPosition(i.originX,i.originY);return {main:i,fallback:{originX:r,originY:a}}}_getOverlayPosition(){let t=!this._dir||this._dir.value=="ltr",e=this.position,i;e=="above"?i={overlayX:"center",overlayY:"bottom"}:e=="below"?i={overlayX:"center",overlayY:"top"}:e=="before"||e=="left"&&t||e=="right"&&!t?i={overlayX:"end",overlayY:"center"}:(e=="after"||e=="right"&&t||e=="left"&&!t)&&(i={overlayX:"start",overlayY:"center"});let{x:r,y:a}=this._invertPosition(i.overlayX,i.overlayY);return {main:i,fallback:{overlayX:r,overlayY:a}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),ME(()=>{this._tooltipInstance&&this._overlayRef.updatePosition();},{injector:this._injector}));}_setTooltipClass(t){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=t instanceof Set?Array.from(t):t,this._tooltipInstance._markForCheck());}_invertPosition(t,e){return this.position==="above"||this.position==="below"?e==="top"?e="bottom":e==="bottom"&&(e="top"):t==="end"?t="start":t==="start"&&(t="end"),{x:t,y:e}}_updateCurrentPositionClass(t){let{overlayY:e,originX:i,originY:r}=t,a;if(e==="center"?this._dir&&this._dir.value==="rtl"?a=i==="end"?"left":"right":a=i==="start"?"left":"right":a=e==="bottom"&&r==="top"?"above":"below",a!==this._currentPosition){let A=this._overlayRef;if(A){let ut=`${this._cssClassPrefix}-${Ht}-`;A.removePanelClass(ut+this._currentPosition),A.addPanelClass(ut+a);}this._currentPosition=a;}}_setupPointerEnterEventsIfNeeded(){this._disabled||!this.message||!this._viewInitialized||this._eventCleanups.length||(this._isTouchPlatform()?this.touchGestures!=="off"&&(this._disableNativeGesturesIfNecessary(),this._addListener("touchstart",t=>{let e=t.targetTouches?.[0],i=e?{x:e.clientX,y:e.clientY}:void 0;this._setupPointerExitEventsIfNeeded(),this._touchstartTimeout&&clearTimeout(this._touchstartTimeout);let r=500;this._touchstartTimeout=setTimeout(()=>{this._touchstartTimeout=null,this.show(void 0,i);},this._defaultOptions?.touchLongPressShowDelay??r);})):this._addListener("mouseenter",t=>{this._setupPointerExitEventsIfNeeded();let e;t.x!==void 0&&t.y!==void 0&&(e=t),this.show(void 0,e);}));}_setupPointerExitEventsIfNeeded(){if(!this._pointerExitEventsInitialized){if(this._pointerExitEventsInitialized=true,!this._isTouchPlatform())this._addListener("mouseleave",t=>{let e=t.relatedTarget;(!e||!this._overlayRef?.overlayElement.contains(e))&&this.hide();}),this._addListener("wheel",t=>{if(this._isTooltipVisible()){let e=this._document.elementFromPoint(t.clientX,t.clientY),i=this._elementRef.nativeElement;e!==i&&!i.contains(e)&&this.hide();}});else if(this.touchGestures!=="off"){this._disableNativeGesturesIfNecessary();let t=()=>{this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions?.touchendHideDelay);};this._addListener("touchend",t),this._addListener("touchcancel",t);}}}_addListener(t,e){this._eventCleanups.push(this._renderer.listen(this._elementRef.nativeElement,t,e,Kt));}_isTouchPlatform(){let t=this._defaultOptions?.detectHoverCapability;return typeof t=="function"?!t():this._platform.IOS||this._platform.ANDROID?true:this._platform.isBrowser?!!t&&this._mediaMatcher.matchMedia("(any-hover: none)").matches:false}_disableNativeGesturesIfNecessary(){let t=this.touchGestures;if(t!=="off"){let e=this._elementRef.nativeElement,i=e.style;(t==="on"||e.nodeName!=="INPUT"&&e.nodeName!=="TEXTAREA")&&(i.userSelect=i.msUserSelect=i.webkitUserSelect=i.MozUserSelect="none"),(t==="on"||!e.draggable)&&(i.webkitUserDrag="none"),i.touchAction="none",i.webkitTapHighlightColor="transparent";}}_syncAriaDescription(t){this._ariaDescriptionPending||(this._ariaDescriptionPending=true,this._ariaDescriber.removeDescription(this._elementRef.nativeElement,t,"tooltip"),this._isDestroyed||ME({write:()=>{this._ariaDescriptionPending=false,this.message&&!this.disabled&&this._ariaDescriber.describe(this._elementRef.nativeElement,this.message,"tooltip");}},{injector:this._injector}));}_overlayEventPredicate=t=>t.type==="keydown"?this._isTooltipVisible()&&t.keyCode===27&&!Ve$1(t):true;static \u0275fac=function(e){return new(e||n)};static \u0275dir=ks({type:n,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-mdc-tooltip-trigger"],hostVars:2,hostBindings:function(e,i){e&2&&Hg("mat-mdc-tooltip-disabled",i.disabled);},inputs:{position:[0,"matTooltipPosition","position"],positionAtOrigin:[0,"matTooltipPositionAtOrigin","positionAtOrigin"],disabled:[0,"matTooltipDisabled","disabled"],showDelay:[0,"matTooltipShowDelay","showDelay"],hideDelay:[0,"matTooltipHideDelay","hideDelay"],touchGestures:[0,"matTooltipTouchGestures","touchGestures"],message:[0,"matTooltip","message"],tooltipClass:[0,"matTooltipClass","tooltipClass"]},exportAs:["matTooltip"]})}return n})(),Gt=(()=>{class n{_changeDetectorRef=g(Cl);_elementRef=g(Qt$1);_isMultiline=false;message;tooltipClass;_showTimeoutId;_hideTimeoutId;_triggerElement;_mouseLeaveHideDelay;_animationsDisabled=K();_tooltip;_closeOnInteraction=false;_isVisible=false;_onHide=new ce$1;_showAnimation="mat-mdc-tooltip-show";_hideAnimation="mat-mdc-tooltip-hide";show(t){this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=setTimeout(()=>{this._toggleVisibility(true),this._showTimeoutId=void 0;},t);}hide(t){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(()=>{this._toggleVisibility(false),this._hideTimeoutId=void 0;},t);}afterHidden(){return this._onHide}isVisible(){return this._isVisible}ngOnDestroy(){this._cancelPendingAnimations(),this._onHide.complete(),this._triggerElement=null;}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0);}_markForCheck(){this._changeDetectorRef.markForCheck();}_handleMouseLeave({relatedTarget:t}){(!t||!this._triggerElement.contains(t))&&(this.isVisible()?this.hide(this._mouseLeaveHideDelay):this._finalizeAnimation(false));}_onShow(){this._isMultiline=this._isTooltipMultiline(),this._markForCheck();}_isTooltipMultiline(){let t=this._elementRef.nativeElement.getBoundingClientRect();return t.height>ee&&t.width>=ie}_handleAnimationEnd({animationName:t}){(t===this._showAnimation||t===this._hideAnimation)&&this._finalizeAnimation(t===this._showAnimation);}_cancelPendingAnimations(){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=this._hideTimeoutId=void 0;}_finalizeAnimation(t){t?this._closeOnInteraction=true:this.isVisible()||this._onHide.next();}_toggleVisibility(t){let e=this._tooltip.nativeElement,i=this._showAnimation,r=this._hideAnimation;if(e.classList.remove(t?r:i),e.classList.add(t?i:r),this._isVisible!==t&&(this._isVisible=t,this._changeDetectorRef.markForCheck()),t&&!this._animationsDisabled&&typeof getComputedStyle=="function"){let a=getComputedStyle(e);(a.getPropertyValue("animation-duration")==="0s"||a.getPropertyValue("animation-name")==="none")&&(this._animationsDisabled=true);}t&&this._onShow(),this._animationsDisabled&&(e.classList.add("_mat-animation-noopable"),this._finalizeAnimation(t));}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Aw({type:n,selectors:[["mat-tooltip-component"]],viewQuery:function(e,i){if(e&1&&Fg(Xt,7),e&2){let r;IC(r=wC())&&(i._tooltip=r.first);}},hostAttrs:["aria-hidden","true"],hostBindings:function(e,i){e&1&&Ag("mouseleave",function(a){return i._handleMouseLeave(a)});},decls:4,vars:5,consts:[["tooltip",""],[1,"mdc-tooltip","mat-mdc-tooltip",3,"animationend"],[1,"mat-mdc-tooltip-surface","mdc-tooltip__surface"]],template:function(e,i){e&1&&(pl(0,"div",1,0),Rg("animationend",function(a){return i._handleAnimationEnd(a)}),pl(2,"div",2),WC(3),hl()()),e&2&&(FC(i.tooltipClass),Hg("mdc-tooltip--multiline",i._isMultiline),XE(3),Zg(i.message));},styles:[`.mat-mdc-tooltip {
|
|
1
|
+
import {cs as vi,A as Aw,C as Cg,y as Hg,aK as Do,aL as qn,bD as vt,aN as wt,cY as fn,cS as Gp,cZ as he$1,cU as yg,bz as vC,v as vs,bA as DC,k as fl,b4 as nT,ad as Vg,n as eC,t as tC,X as XE,aV as w,bu as kg,I as IC,E as wC,g,az as Qt$1,c_ as kn,bv as St,bF as p,aO as G,aQ as As,aT as Ue,aU as U,H as Hi,an as ce$1,al as yt,ae as Ot,u as ue,c$ as va,bK as pe,br as Cl,ap as Vy,bt as Ve$1,c1 as ME,aA as sn,D as Fg,bs as Qn,aR as K,cN as is,bM as F,bQ as bd,cK as Id,bO as Yy,a9 as dC,l as Ag,ac as mC,bU as Ky,aM as Nn,bC as ge,aP as $a,bL as mr,d0 as lt,d1 as wt$1,d2 as I,bZ as xt,bW as Pt,a as P,aY as ks,aw as pl,cI as Rg,W as WC,ax as hl,b_ as FC,a8 as Zg,c2 as kt,cC as Ce,cy as Xr,aa as If,ab as wf}from'./main-XVJVH4GF.js';var Xt=["tooltip"],Ut=20;var qt=new w("mat-tooltip-scroll-strategy",{providedIn:"root",factory:()=>{let n=g(pe);return ()=>kt(n,{scrollThrottle:Ut})}}),$t=new w("mat-tooltip-default-options",{providedIn:"root",factory:()=>({showDelay:0,hideDelay:0,touchendHideDelay:1500})});var Ht="tooltip-panel",Kt={passive:true},Jt=8,te=8,ee=24,ie=200,ne=(()=>{class n{_elementRef=g(Qt$1);_ngZone=g(G);_platform=g(p);_ariaDescriber=g($a);_focusMonitor=g(St);_dir=g(Qn);_injector=g(pe);_viewContainerRef=g(mr);_mediaMatcher=g(lt);_document=g(U);_renderer=g(As);_animationsDisabled=K();_defaultOptions=g($t,{optional:true});_overlayRef=null;_tooltipInstance=null;_overlayPanelClass;_portal;_position="below";_positionAtOrigin=false;_disabled=false;_tooltipClass;_viewInitialized=false;_pointerExitEventsInitialized=false;_tooltipComponent=Gt;_viewportMargin=8;_currentPosition;_cssClassPrefix="mat-mdc";_ariaDescriptionPending=false;_dirSubscribed=false;get position(){return this._position}set position(t){t!==this._position&&(this._position=t,this._overlayRef&&(this._updatePosition(this._overlayRef),this._tooltipInstance?.show(0),this._overlayRef.updatePosition()));}get positionAtOrigin(){return this._positionAtOrigin}set positionAtOrigin(t){this._positionAtOrigin=vi(t),this._detach(),this._overlayRef=null;}get disabled(){return this._disabled}set disabled(t){let e=vi(t);this._disabled!==e&&(this._disabled=e,e?this.hide(0):this._setupPointerEnterEventsIfNeeded(),this._syncAriaDescription(this.message));}get showDelay(){return this._showDelay}set showDelay(t){this._showDelay=fn(t);}_showDelay;get hideDelay(){return this._hideDelay}set hideDelay(t){this._hideDelay=fn(t),this._tooltipInstance&&(this._tooltipInstance._mouseLeaveHideDelay=this._hideDelay);}_hideDelay;touchGestures="auto";get message(){return this._message}set message(t){let e=this._message;this._message=t!=null?String(t).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage()),this._syncAriaDescription(e);}_message="";get tooltipClass(){return this._tooltipClass}set tooltipClass(t){this._tooltipClass=t,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass);}_eventCleanups=[];_touchstartTimeout=null;_destroyed=new ce$1;_isDestroyed=false;constructor(){let t=this._defaultOptions;t&&(this._showDelay=t.showDelay,this._hideDelay=t.hideDelay,t.position&&(this.position=t.position),t.positionAtOrigin&&(this.positionAtOrigin=t.positionAtOrigin),t.touchGestures&&(this.touchGestures=t.touchGestures),t.tooltipClass&&(this.tooltipClass=t.tooltipClass)),this._viewportMargin=Jt;}ngAfterViewInit(){this._viewInitialized=true,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(Vy(this._destroyed)).subscribe(t=>{t?t==="keyboard"&&this._ngZone.run(()=>this.show()):this._ngZone.run(()=>this.hide(0));});}ngOnDestroy(){let t=this._elementRef.nativeElement;this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),this._eventCleanups.forEach(e=>e()),this._eventCleanups.length=0,this._destroyed.next(),this._destroyed.complete(),this._isDestroyed=true,this._ariaDescriber.removeDescription(t,this.message,"tooltip"),this._focusMonitor.stopMonitoring(t);}show(t=this.showDelay,e){if(this.disabled||!this.message||this._isTooltipVisible()){this._tooltipInstance?._cancelPendingAnimations();return}let i=this._createOverlay(e);this._detach(),this._portal=this._portal||new wt$1(this._tooltipComponent,this._viewContainerRef);let r=this._tooltipInstance=i.attach(this._portal).instance;r._triggerElement=this._elementRef.nativeElement,r._mouseLeaveHideDelay=this._hideDelay,r.afterHidden().pipe(Vy(this._destroyed)).subscribe(()=>this._detach()),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),r.show(t);}hide(t=this.hideDelay){let e=this._tooltipInstance;e&&(e.isVisible()?e.hide(t):(e._cancelPendingAnimations(),this._detach()));}toggle(t){this._isTooltipVisible()?this.hide():this.show(void 0,t);}_isTooltipVisible(){return !!this._tooltipInstance&&this._tooltipInstance.isVisible()}_createOverlay(t){if(this._overlayRef){let a=this._overlayRef.getConfig().positionStrategy;if((!this.positionAtOrigin||!t)&&a._origin instanceof Qt$1)return this._overlayRef;this._detach();}let e=this._injector.get(I).getAncestorScrollContainers(this._elementRef),i=`${this._cssClassPrefix}-${Ht}`,r=xt(this._injector,this.positionAtOrigin?t||this._elementRef:this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(false).withViewportMargin(this._viewportMargin).withScrollableContainers(e).withPopoverLocation("global");return r.positionChanges.pipe(Vy(this._destroyed)).subscribe(a=>{this._updateCurrentPositionClass(a.connectionPair),this._tooltipInstance&&a.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0));}),this._overlayRef=Pt(this._injector,{direction:this._dir,positionStrategy:r,panelClass:this._overlayPanelClass?[...this._overlayPanelClass,i]:i,scrollStrategy:this._injector.get(qt)(),disableAnimations:this._animationsDisabled,eventPredicate:this._overlayEventPredicate}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(Vy(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(Vy(this._destroyed)).subscribe(()=>this._tooltipInstance?._handleBodyInteraction()),this._overlayRef.keydownEvents().pipe(Vy(this._destroyed)).subscribe(a=>{a.preventDefault(),a.stopPropagation(),this._ngZone.run(()=>this.hide(0));}),this._defaultOptions?.disableTooltipInteractivity&&this._overlayRef.addPanelClass(`${this._cssClassPrefix}-tooltip-panel-non-interactive`),this._dirSubscribed||(this._dirSubscribed=true,this._dir.change.pipe(Vy(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef);})),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null;}_updatePosition(t){let e=t.getConfig().positionStrategy,i=this._getOrigin(),r=this._getOverlayPosition();e.withPositions([this._addOffset(P(P({},i.main),r.main)),this._addOffset(P(P({},i.fallback),r.fallback))]);}_addOffset(t){let e=te,i=!this._dir||this._dir.value=="ltr";return t.originY==="top"?t.offsetY=-e:t.originY==="bottom"?t.offsetY=e:t.originX==="start"?t.offsetX=i?-e:e:t.originX==="end"&&(t.offsetX=i?e:-e),t}_getOrigin(){let t=!this._dir||this._dir.value=="ltr",e=this.position,i;e=="above"||e=="below"?i={originX:"center",originY:e=="above"?"top":"bottom"}:e=="before"||e=="left"&&t||e=="right"&&!t?i={originX:"start",originY:"center"}:(e=="after"||e=="right"&&t||e=="left"&&!t)&&(i={originX:"end",originY:"center"});let{x:r,y:a}=this._invertPosition(i.originX,i.originY);return {main:i,fallback:{originX:r,originY:a}}}_getOverlayPosition(){let t=!this._dir||this._dir.value=="ltr",e=this.position,i;e=="above"?i={overlayX:"center",overlayY:"bottom"}:e=="below"?i={overlayX:"center",overlayY:"top"}:e=="before"||e=="left"&&t||e=="right"&&!t?i={overlayX:"end",overlayY:"center"}:(e=="after"||e=="right"&&t||e=="left"&&!t)&&(i={overlayX:"start",overlayY:"center"});let{x:r,y:a}=this._invertPosition(i.overlayX,i.overlayY);return {main:i,fallback:{overlayX:r,overlayY:a}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),ME(()=>{this._tooltipInstance&&this._overlayRef.updatePosition();},{injector:this._injector}));}_setTooltipClass(t){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=t instanceof Set?Array.from(t):t,this._tooltipInstance._markForCheck());}_invertPosition(t,e){return this.position==="above"||this.position==="below"?e==="top"?e="bottom":e==="bottom"&&(e="top"):t==="end"?t="start":t==="start"&&(t="end"),{x:t,y:e}}_updateCurrentPositionClass(t){let{overlayY:e,originX:i,originY:r}=t,a;if(e==="center"?this._dir&&this._dir.value==="rtl"?a=i==="end"?"left":"right":a=i==="start"?"left":"right":a=e==="bottom"&&r==="top"?"above":"below",a!==this._currentPosition){let A=this._overlayRef;if(A){let ut=`${this._cssClassPrefix}-${Ht}-`;A.removePanelClass(ut+this._currentPosition),A.addPanelClass(ut+a);}this._currentPosition=a;}}_setupPointerEnterEventsIfNeeded(){this._disabled||!this.message||!this._viewInitialized||this._eventCleanups.length||(this._isTouchPlatform()?this.touchGestures!=="off"&&(this._disableNativeGesturesIfNecessary(),this._addListener("touchstart",t=>{let e=t.targetTouches?.[0],i=e?{x:e.clientX,y:e.clientY}:void 0;this._setupPointerExitEventsIfNeeded(),this._touchstartTimeout&&clearTimeout(this._touchstartTimeout);let r=500;this._touchstartTimeout=setTimeout(()=>{this._touchstartTimeout=null,this.show(void 0,i);},this._defaultOptions?.touchLongPressShowDelay??r);})):this._addListener("mouseenter",t=>{this._setupPointerExitEventsIfNeeded();let e;t.x!==void 0&&t.y!==void 0&&(e=t),this.show(void 0,e);}));}_setupPointerExitEventsIfNeeded(){if(!this._pointerExitEventsInitialized){if(this._pointerExitEventsInitialized=true,!this._isTouchPlatform())this._addListener("mouseleave",t=>{let e=t.relatedTarget;(!e||!this._overlayRef?.overlayElement.contains(e))&&this.hide();}),this._addListener("wheel",t=>{if(this._isTooltipVisible()){let e=this._document.elementFromPoint(t.clientX,t.clientY),i=this._elementRef.nativeElement;e!==i&&!i.contains(e)&&this.hide();}});else if(this.touchGestures!=="off"){this._disableNativeGesturesIfNecessary();let t=()=>{this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions?.touchendHideDelay);};this._addListener("touchend",t),this._addListener("touchcancel",t);}}}_addListener(t,e){this._eventCleanups.push(this._renderer.listen(this._elementRef.nativeElement,t,e,Kt));}_isTouchPlatform(){let t=this._defaultOptions?.detectHoverCapability;return typeof t=="function"?!t():this._platform.IOS||this._platform.ANDROID?true:this._platform.isBrowser?!!t&&this._mediaMatcher.matchMedia("(any-hover: none)").matches:false}_disableNativeGesturesIfNecessary(){let t=this.touchGestures;if(t!=="off"){let e=this._elementRef.nativeElement,i=e.style;(t==="on"||e.nodeName!=="INPUT"&&e.nodeName!=="TEXTAREA")&&(i.userSelect=i.msUserSelect=i.webkitUserSelect=i.MozUserSelect="none"),(t==="on"||!e.draggable)&&(i.webkitUserDrag="none"),i.touchAction="none",i.webkitTapHighlightColor="transparent";}}_syncAriaDescription(t){this._ariaDescriptionPending||(this._ariaDescriptionPending=true,this._ariaDescriber.removeDescription(this._elementRef.nativeElement,t,"tooltip"),this._isDestroyed||ME({write:()=>{this._ariaDescriptionPending=false,this.message&&!this.disabled&&this._ariaDescriber.describe(this._elementRef.nativeElement,this.message,"tooltip");}},{injector:this._injector}));}_overlayEventPredicate=t=>t.type==="keydown"?this._isTooltipVisible()&&t.keyCode===27&&!Ve$1(t):true;static \u0275fac=function(e){return new(e||n)};static \u0275dir=ks({type:n,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-mdc-tooltip-trigger"],hostVars:2,hostBindings:function(e,i){e&2&&Hg("mat-mdc-tooltip-disabled",i.disabled);},inputs:{position:[0,"matTooltipPosition","position"],positionAtOrigin:[0,"matTooltipPositionAtOrigin","positionAtOrigin"],disabled:[0,"matTooltipDisabled","disabled"],showDelay:[0,"matTooltipShowDelay","showDelay"],hideDelay:[0,"matTooltipHideDelay","hideDelay"],touchGestures:[0,"matTooltipTouchGestures","touchGestures"],message:[0,"matTooltip","message"],tooltipClass:[0,"matTooltipClass","tooltipClass"]},exportAs:["matTooltip"]})}return n})(),Gt=(()=>{class n{_changeDetectorRef=g(Cl);_elementRef=g(Qt$1);_isMultiline=false;message;tooltipClass;_showTimeoutId;_hideTimeoutId;_triggerElement;_mouseLeaveHideDelay;_animationsDisabled=K();_tooltip;_closeOnInteraction=false;_isVisible=false;_onHide=new ce$1;_showAnimation="mat-mdc-tooltip-show";_hideAnimation="mat-mdc-tooltip-hide";show(t){this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=setTimeout(()=>{this._toggleVisibility(true),this._showTimeoutId=void 0;},t);}hide(t){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(()=>{this._toggleVisibility(false),this._hideTimeoutId=void 0;},t);}afterHidden(){return this._onHide}isVisible(){return this._isVisible}ngOnDestroy(){this._cancelPendingAnimations(),this._onHide.complete(),this._triggerElement=null;}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0);}_markForCheck(){this._changeDetectorRef.markForCheck();}_handleMouseLeave({relatedTarget:t}){(!t||!this._triggerElement.contains(t))&&(this.isVisible()?this.hide(this._mouseLeaveHideDelay):this._finalizeAnimation(false));}_onShow(){this._isMultiline=this._isTooltipMultiline(),this._markForCheck();}_isTooltipMultiline(){let t=this._elementRef.nativeElement.getBoundingClientRect();return t.height>ee&&t.width>=ie}_handleAnimationEnd({animationName:t}){(t===this._showAnimation||t===this._hideAnimation)&&this._finalizeAnimation(t===this._showAnimation);}_cancelPendingAnimations(){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=this._hideTimeoutId=void 0;}_finalizeAnimation(t){t?this._closeOnInteraction=true:this.isVisible()||this._onHide.next();}_toggleVisibility(t){let e=this._tooltip.nativeElement,i=this._showAnimation,r=this._hideAnimation;if(e.classList.remove(t?r:i),e.classList.add(t?i:r),this._isVisible!==t&&(this._isVisible=t,this._changeDetectorRef.markForCheck()),t&&!this._animationsDisabled&&typeof getComputedStyle=="function"){let a=getComputedStyle(e);(a.getPropertyValue("animation-duration")==="0s"||a.getPropertyValue("animation-name")==="none")&&(this._animationsDisabled=true);}t&&this._onShow(),this._animationsDisabled&&(e.classList.add("_mat-animation-noopable"),this._finalizeAnimation(t));}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Aw({type:n,selectors:[["mat-tooltip-component"]],viewQuery:function(e,i){if(e&1&&Fg(Xt,7),e&2){let r;IC(r=wC())&&(i._tooltip=r.first);}},hostAttrs:["aria-hidden","true"],hostBindings:function(e,i){e&1&&Ag("mouseleave",function(a){return i._handleMouseLeave(a)});},decls:4,vars:5,consts:[["tooltip",""],[1,"mdc-tooltip","mat-mdc-tooltip",3,"animationend"],[1,"mat-mdc-tooltip-surface","mdc-tooltip__surface"]],template:function(e,i){e&1&&(pl(0,"div",1,0),Rg("animationend",function(a){return i._handleAnimationEnd(a)}),pl(2,"div",2),WC(3),hl()()),e&2&&(FC(i.tooltipClass),Hg("mdc-tooltip--multiline",i._isMultiline),XE(3),Zg(i.message));},styles:[`.mat-mdc-tooltip {
|
|
2
2
|
position: relative;
|
|
3
3
|
transform: scale(0);
|
|
4
4
|
display: inline-flex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {K as Kn,Z as Zn,S as Se}from'./chunk
|
|
1
|
+
import {K as Kn,Z as Zn,S as Se}from'./chunk--Cv5Auvq.js';import {ca as mB,cb as gB,H as Hi,A as Aw,v as vs,W as WC,k as fl,n as eC,X as XE,a8 as Zg,a5 as yl,t as tC,a9 as dC,l as Ag,ac as mC,r as Tg,aa as If,ab as wf}from'./main-XVJVH4GF.js';function A(o,a){if(o&1){let e=dC();vs(0,"span",7),WC(1,"Delete?"),fl(),vs(2,"ds-icon-button",8),Ag("action",function(){If(e);let l=mC();return wf(l.onDeleteConfirmed())}),fl(),vs(3,"ds-icon-button",9),Ag("action",function(){If(e);let l=mC();return wf(l.onDeleteCancelled())}),fl();}}function P(o,a){if(o&1){let e=dC();vs(0,"ds-kebab-menu",10),Ag("itemSelected",function(l){If(e);let O=mC();return wf(O.onMenuAction(l))}),fl();}if(o&2){let e=mC();Tg("items",e.menuItems);}}var I=class o{model=mB.required();namespaceId=mB(void 0);readOnly=mB(false);deleteRequested=gB();editRequested=gB();pendingDelete=Hi(false);menuItems=[{key:"edit",label:"Edit model",icon:"edit"},{key:"delete",label:"Delete model",icon:"delete",variant:"danger"}];get displayTitle(){return this.model().alias??this.model().apiModelName}onMenuAction(a){switch(a){case "edit":this.editRequested.emit(this.model());break;case "delete":this.pendingDelete.set(true);break}}onDeleteConfirmed(){this.pendingDelete.set(false),this.deleteRequested.emit(this.model());}onDeleteCancelled(){this.pendingDelete.set(false);}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=Aw({type:o,selectors:[["agentos-ai-model-item"]],inputs:{model:[1,"model"],namespaceId:[1,"namespaceId"],readOnly:[1,"readOnly"]},outputs:{deleteRequested:"deleteRequested",editRequested:"editRequested"},decls:12,vars:4,consts:[["role","listitem","dsBlueprint","",1,"ai-model-item"],[1,"ai-model-item__body"],[1,"ai-model-item__name"],[1,"ai-model-item__api-name"],[1,"ai-model-item__params"],[1,"ai-model-item__actions"],[3,"items"],[1,"ai-model-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],[3,"itemSelected","items"]],template:function(e,i){e&1&&(vs(0,"div",0)(1,"div",1)(2,"span",2),WC(3),fl(),vs(4,"span",3),WC(5),fl(),vs(6,"span",4)(7,"span"),WC(8),fl()()(),vs(9,"div",5),eC(10,A,4,0)(11,P,1,1,"ds-kebab-menu",6),fl()()),e&2&&(XE(3),Zg(i.displayTitle),XE(2),Zg(i.model().apiModelName),XE(3),yl("priority: ",i.model().priority),XE(2),tC(i.pendingDelete()?10:i.readOnly()?-1:11));},dependencies:[Kn,Zn,Se],styles:[".ai-model-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:14px 16px;position:relative;border-radius:0;border:1px solid var(--color-divider);background:var(--color-bg);box-shadow:var(--shadow-sm);overflow:visible;transition:border-color .15s ease}.ai-model-item[_ngcontent-%COMP%]:hover{border-color:var(--color-accent)}.ai-model-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.ai-model-item__name[_ngcontent-%COMP%]{font-size:15px;font-weight:600;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-model-item__api-name[_ngcontent-%COMP%]{font-size:13px;color:var(--color-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-model-item__params[_ngcontent-%COMP%]{display:flex;gap:.75rem;font-size:13px;color:var(--color-text-secondary)}.ai-model-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.ai-model-item[_ngcontent-%COMP%]:hover .ai-model-item__actions[_ngcontent-%COMP%], .ai-model-item[_ngcontent-%COMP%]:focus-within .ai-model-item__actions[_ngcontent-%COMP%]{opacity:1}.ai-model-item__confirm-label[_ngcontent-%COMP%]{font-family:var(--font-heading);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--red-deep);margin-right:.25rem;white-space:nowrap}"]})};export{I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {S as St}from'./chunk-DwB1vH9w.js';import {an as ce,g,L,ao as V,G,N as N$1,ap as Vy,A as Aw,aq as a,ar as S,as as F,at as c,v as vs,l as Ag,n as eC,k as fl,r as Tg,X as XE,t as tC,D as Fg,I as IC,E as wC,au as tv,ae as Ot,av as dt,Y as x,aw as pl,W as WC,ax as hl,a8 as Zg,a9 as dC,aa as If,ac as mC,ab as wf,o as bg}from'./main-DXWHG4XK.js';import {n as nt,i as it,t as tt,C as Ci}from'./chunk-CZ6ILxDX.js';import'./chunk-E8b2_4uB.js';import {G as Ge}from'./chunk-BXiOP6ZW.js';import'./chunk-_PndMs0h.js';import'./chunk-x7Suyrio.js';import'./chunk-BjDDtMsE.js';import'./chunk-CyEZHdnA.js';import'./chunk-DlFFzFSe.js';import'./chunk-RbE7PtJh.js';import'./chunk-Ckk6G7IP.js';import'./chunk-BBJc_ez4.js';var T=class o{welcomeMessages=["Welcome to Coday","Bienvenue sur Coday","Bienvenido a Coday","Willkommen bei Coday","Benvenuto su Coday","Bem-vindo ao Coday","Welkom bij Coday","\u0414\u043E\u0431\u0440\u043E \u043F\u043E\u0436\u0430\u043B\u043E\u0432\u0430\u0442\u044C \u0432 Coday","Coday \u3078\u3088\u3046\u3053\u305D","\u6B22\u8FCE\u6765\u5230 Coday","Coday \uC5D0 \uC624\uC2E0 \uAC83\uC744 \uD658\uC601\uD569\uB2C8\uB2E4","\u0645\u0631\u062D\u0628\u064B\u0627 \u0628\u0643 \u0641\u064A Coday"];currentWelcomeIndex=0;currentWelcomeMessage=this.welcomeMessages[0];welcomeRotationInterval;ngOnInit(){this.startWelcomeRotation();}ngOnDestroy(){this.stopWelcomeRotation();}startWelcomeRotation(){this.welcomeRotationInterval=window.setInterval(()=>{this.currentWelcomeIndex=(this.currentWelcomeIndex+1)%this.welcomeMessages.length,this.currentWelcomeMessage=this.welcomeMessages[this.currentWelcomeIndex];},3e3);}stopWelcomeRotation(){this.welcomeRotationInterval&&(clearInterval(this.welcomeRotationInterval),this.welcomeRotationInterval=void 0);}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=Aw({type:o,selectors:[["app-welcome-message"]],decls:2,vars:1,consts:[[1,"welcome-title"]],template:function(t,i){t&1&&(pl(0,"h1",0),WC(1),hl()),t&2&&(XE(),Zg(i.currentWelcomeMessage));},styles:[".welcome-title[_ngcontent-%COMP%]{font-size:clamp(1.5rem,4vw,4rem);font-weight:700;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% auto;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:_ngcontent-%COMP%_gradientShift 3s ease-in-out infinite;margin:0;padding:0;line-height:1.2;transition:opacity .5s ease-in-out;display:block;min-height:1.2em;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0% center}50%{background-position:100% center}to{background-position:0% center}}"],changeDetection:1})};var N=class o{destroy$=new ce;isSetup=false;codayService=g(Ge);preferencesService=g(L);setup(){if(this.isSetup){console.warn("[AGENT-NOTIFICATION] Service already set up");return}console.log("[AGENT-NOTIFICATION] Setting up agent notification service"),this.codayService.isThinking$.pipe(Vy(this.destroy$),tv(),Ot(([e,t])=>e===true&&t===false)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Agent stopped thinking, notifying task finished"),this.notifyTaskFinishedIfEnabled();}),this.preferencesService.browserNotificationEnabled$.pipe(Vy(this.destroy$),tv(),Ot(([e,t])=>e===false&&t===true)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Browser notifications enabled, checking permission"),this.handleBrowserNotificationEnabled();}),this.isSetup=true;}notifyTaskFinishedIfEnabled(){this.preferencesService.getAgentNotificationEnabled()&&(this.preferencesService.getNotificationSoundEnabled()&&this.playCompletionSound(),this.preferencesService.getBrowserNotificationEnabled()&&this.sendBrowserNotification());}playCompletionSound(){try{let e=new(window.AudioContext||window.webkitAudioContext),t=e.createOscillator(),i=e.createGain();t.connect(i),i.connect(e.destination),t.frequency.setValueAtTime(700,e.currentTime),i.gain.setValueAtTime(.1,e.currentTime),i.gain.exponentialRampToValueAtTime(.01,e.currentTime+.08),t.start(e.currentTime),t.stop(e.currentTime+.08);let n=e.createOscillator(),r=e.createGain();n.connect(r),r.connect(e.destination);let l=e.currentTime+.11;n.frequency.setValueAtTime(950,l),r.gain.setValueAtTime(.1,l),r.gain.exponentialRampToValueAtTime(.01,l+.09),n.start(l),n.stop(l+.09),console.log("[AGENT-NOTIFICATION] Completion sound played");}catch(e){console.error("[AGENT-NOTIFICATION] Failed to play completion sound:",e);}}handleBrowserNotificationEnabled(){return dt(this,null,function*(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications"),this.preferencesService.setBrowserNotificationEnabled(false);return}if(Notification.permission==="denied"){console.warn("[AGENT-NOTIFICATION] Permission denied, disabling browser notifications"),this.preferencesService.setBrowserNotificationEnabled(false);return}if(Notification.permission==="granted"){console.log("[AGENT-NOTIFICATION] Permission already granted, showing confirmation"),this.createConfirmationNotification();return}try{(yield Notification.requestPermission())==="granted"?(console.log("[AGENT-NOTIFICATION] Permission granted, showing confirmation"),this.createConfirmationNotification()):(console.log("[AGENT-NOTIFICATION] Permission denied or dismissed"),this.preferencesService.setBrowserNotificationEnabled(!1));}catch(e){console.error("[AGENT-NOTIFICATION] Error requesting permission:",e),this.preferencesService.setBrowserNotificationEnabled(false);}})}sendBrowserNotification(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications");return}if(document.hasFocus()){console.warn("[AGENT-NOTIFICATION] Document is focused, skipping browser notification");return}Notification.permission==="granted"?this.createTaskCompleteNotification():console.warn("[AGENT-NOTIFICATION] Permission not granted, cannot send notification");}createConfirmationNotification(){let e=new Notification("Coday - Notifications Enabled",{body:"You will be notified when the agent completes tasks",icon:"/favicon.ico",tag:"coday-notifications-enabled",requireInteraction:false});setTimeout(()=>e.close(),4e3),e.onclick=()=>{window.focus(),e.close();},console.log("[AGENT-NOTIFICATION] Confirmation notification sent");}createTaskCompleteNotification(){let e=new Notification("Coday - Task Complete",{body:"The agent has finished and is waiting for your input",icon:"/favicon.ico",tag:"coday-task-complete",requireInteraction:false});setTimeout(()=>e.close(),5e3),e.onclick=()=>{window.focus(),e.close();},console.log("[AGENT-NOTIFICATION] Task complete notification sent");}ngOnDestroy(){console.log("[AGENT-NOTIFICATION] Service destroyed"),this.destroy$.next(),this.destroy$.complete();}static \u0275fac=function(t){return new(t||o)};static \u0275prov=x({token:o,factory:o.\u0275fac,providedIn:"root"})};var Z=["inputSection"];function ee(o,e){if(o&1){let t=dC();vs(0,"app-thread",4),Ag("chatFocused",function(){If(t);let n=mC();return wf(n.onChatFocusedOnMobile())})("drawerStateChange",function(n){If(t);let r=mC();return wf(r.onDrawerStateChange(n))}),fl();}if(o&2){let t=mC();Tg("projectName",t.projectName)("threadId",t.threadId);}}function te(o,e){if(o&1){let t=dC();vs(0,"div",5),bg(1,"app-welcome-message"),fl(),vs(2,"div",6,0)(4,"div",7)(5,"div",8)(6,"app-chat-textarea",9),Ag("messageSubmitted",function(n){If(t);let r=mC();return wf(r.onMessageSubmitted(n))})("voiceMessageReady",function(n){If(t);let r=mC();return wf(r.onVoiceMessageReady(n))})("voiceRecordingToggled",function(n){If(t);let r=mC();return wf(r.onVoiceToggled(n))})("heightChanged",function(n){If(t);let r=mC();return wf(r.onInputHeightChanged(n))})("textareaFocused",function(){If(t);let n=mC();return wf(n.onChatFocusedOnMobile())}),fl()()()();}if(o&2){let t=mC();XE(6),Tg("isDisabled",t.isSessionInitializing)("isSessionInitializing",t.isSessionInitializing)("showWelcome",true)("isThinking",false)("isStarting",t.isStartingFirstMessage);}}var K=class o{destroy$=new ce;inputSection;sidenav;projectName="";threadId=null;isSessionInitializing=false;isStartingFirstMessage=false;inputSectionHeight=80;codayService=g(Ge);titleService=g(nt);preferencesService=g(L);route=g(V);router=g(G);threadApiService=g(N$1);agentNotificationService=g(N);firstMessageState=g(it);constructor(){console.log("[MAIN-APP] Using new thread-based architecture (no clientId needed)");}ngOnInit(){this.agentNotificationService.setup(),this.setupPrintHandlers(),this.route.params.pipe(Vy(this.destroy$)).subscribe(e=>{let t=e.projectName,i=e.threadId||null;console.log("[MAIN-APP] Route params updated:",{project:t,thread:i,previousProject:this.projectName,previousThread:this.threadId}),this.projectName=t,this.threadId=i,this.threadId?console.log("[MAIN-APP] Thread selected - ThreadComponent will display"):(console.log("[MAIN-APP] No thread selected - showing welcome view"),this.initializeWelcomeView());});}initializeWelcomeView(){this.codayService.setTabTitleService(this.titleService);}ngAfterViewInit(){setTimeout(()=>this.updateInputSectionHeight(),100);}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),window.removeEventListener("beforeprint",this.handleBeforePrint),window.removeEventListener("afterprint",this.handleAfterPrint);}onMessageSubmitted(e){console.log("[MAIN-APP] First message submitted from welcome view:",e),this.isSessionInitializing=true,this.isStartingFirstMessage=true,this.threadApiService.createThread().subscribe({next:t=>{console.log("[MAIN-APP] Thread created:",t.thread.id),this.firstMessageState.setPendingFirstMessage(e),this.router.navigate(["project",this.projectName,"thread",t.thread.id]);},error:t=>{console.error("[MAIN-APP] Failed to create thread:",t),this.isSessionInitializing=false,this.isStartingFirstMessage=false,alert("Failed to create conversation: "+(t.message||"Unknown error"));}});}onVoiceToggled(e){console.log("[VOICE] Recording in welcome view:",e);}onVoiceMessageReady(e){console.log("[MAIN-APP] Voice message ready from welcome view"),this.isSessionInitializing=true,this.isStartingFirstMessage=true,this.threadApiService.createThread().subscribe({next:t=>{console.log("[MAIN-APP] Thread created for voice message:",t.thread.id),this.firstMessageState.setPendingVoiceMessage(e),this.router.navigate(["project",this.projectName,"thread",t.thread.id]);},error:t=>{console.error("[MAIN-APP] Failed to create thread for voice message:",t),this.isSessionInitializing=false,this.isStartingFirstMessage=false,alert("Failed to create conversation: "+(t.message||"Unknown error"));}});}isDrawerOpen=false;onDrawerStateChange(e){this.isDrawerOpen=e;}onChatFocusedOnMobile(){window.innerWidth<1024&&this.sidenav?.close();}onInputHeightChanged(e){console.log("[MAIN-APP] Input height changed:",e),this.inputSectionHeight=e;}updateInputSectionHeight(){if(this.inputSection?.nativeElement){let e=this.inputSection.nativeElement.offsetHeight;e!==this.inputSectionHeight&&(console.log("[MAIN-APP] Input section height updated:",e),this.inputSectionHeight=e);}}setupPrintHandlers(){window.addEventListener("beforeprint",this.handleBeforePrint),window.addEventListener("afterprint",this.handleAfterPrint);}handleBeforePrint=()=>{console.log("[PRINT] Before print event triggered");let e=this.preferencesService.getPrintTechnicalMessages();console.log("[PRINT] Print technical messages:",e),e?document.body.classList.add("print-include-technical"):document.body.classList.remove("print-include-technical");};handleAfterPrint=()=>{console.log("[PRINT] After print event triggered"),document.body.classList.remove("print-include-technical");};static \u0275fac=function(t){return new(t||o)};static \u0275cmp=Aw({type:o,selectors:[["app-main"]],viewQuery:function(t,i){if(t&1&&Fg(Z,5)(St,5),t&2){let n;IC(n=wC())&&(i.inputSection=n.first),IC(n=wC())&&(i.sidenav=n.first);}},decls:4,vars:2,consts:[["inputSection",""],[3,"drawerOpen"],[1,"app",3,"mousedown","touchstart"],[3,"projectName","threadId"],[3,"chatFocused","drawerStateChange","projectName","threadId"],[1,"welcome-section"],[1,"input-section"],[1,"input-center"],[1,"input-glass"],[3,"messageSubmitted","voiceMessageReady","voiceRecordingToggled","heightChanged","textareaFocused","isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"]],template:function(t,i){t&1&&(vs(0,"app-sidenav",1)(1,"div",2),Ag("mousedown",function(){return i.onChatFocusedOnMobile()})("touchstart",function(){return i.onChatFocusedOnMobile()}),eC(2,ee,1,2,"app-thread",3)(3,te,7,5),fl()()),t&2&&(Tg("drawerOpen",i.isDrawerOpen),XE(2),tC(i.threadId?2:3));},dependencies:[tt,Ci,T,St],styles:["[_nghost-%COMP%]{display:flex;height:100vh;width:100%;overflow:hidden;justify-content:center}.app[_ngcontent-%COMP%]{width:100%;max-width:100%;min-width:0;height:100%;display:flex;flex-direction:column;background:var(--color-bg);color:var(--color-text);transition:all .3s ease;position:relative;justify-content:center;overflow:hidden}.chat-wrapper[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;background:transparent;width:100%;padding:2.5rem 0 1.5rem;display:flex;justify-content:center}.chat-wrapper[_ngcontent-%COMP%] .chat-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 2rem}@media(max-width:768px){.chat-wrapper[_ngcontent-%COMP%] .chat-center[_ngcontent-%COMP%]{padding:0 1rem}}.welcome-section[_ngcontent-%COMP%]{flex-shrink:0;text-align:center;padding:2rem 1rem;animation:_ngcontent-%COMP%_fadeInUp .8s ease-out;display:flex;justify-content:center;align-items:center;width:100%;min-width:0;overflow:hidden}@keyframes _ngcontent-%COMP%_fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.input-section[_ngcontent-%COMP%]{flex-shrink:0;position:relative;border-top:none;background:transparent;box-shadow:none;padding:2.5rem 0 2rem;overflow-y:visible;max-height:none;width:100%;z-index:10;pointer-events:none;display:flex;justify-content:center}.input-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 2rem;display:flex;justify-content:center;align-items:end;position:relative;pointer-events:auto}@media(max-width:768px){.input-center[_ngcontent-%COMP%]{padding:0 1rem}}.input-glass[_ngcontent-%COMP%]{background:none;box-shadow:none;width:100%;min-height:64px;display:flex;align-items:stretch;gap:0;pointer-events:auto;position:relative;overflow:visible}.input-glass[_ngcontent-%COMP%] app-chat-textarea[_ngcontent-%COMP%]{width:100%;min-width:0;flex:1 1 auto;align-self:stretch;display:flex}body.dark[_nghost-%COMP%], body.dark [_nghost-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .input-glass[_ngcontent-%COMP%]{background:#24283073;border-color:#b4c8ff17;box-shadow:0 8px 32px #0000002b,0 1.5px 8px #00000012}.choice-overlay[_ngcontent-%COMP%]{z-index:10;width:100%;display:flex;justify-content:center;align-items:center}.upload-status[_ngcontent-%COMP%]{position:fixed;bottom:100px;left:50%;transform:translate(-50%);z-index:1000;display:flex;align-items:center;padding:12px 20px;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);border-radius:16px;font-size:.9em;color:var(--color-text);box-shadow:var(--glass-shadow);max-width:300px;text-align:center}.upload-status.error[_ngcontent-%COMP%]{background:#ff3b3026;color:var(--color-error);border-color:#ff3b304d}@media(max-width:768px){.welcome-section[_ngcontent-%COMP%]{padding:1.5rem 1rem}.input-section[_ngcontent-%COMP%]{padding:1.5rem .75rem 1rem}.input-center[_ngcontent-%COMP%]{padding:0 .5rem}}@media print{[_nghost-%COMP%]{display:block!important;height:auto!important;overflow:visible!important}.app[_ngcontent-%COMP%]{height:auto!important;overflow:visible!important;display:block!important}.input-section[_ngcontent-%COMP%], .welcome-section[_ngcontent-%COMP%]{display:none!important}}"],data:{animation:[a("slideIn",[S(":enter",[F({transform:"translateY(100%)",opacity:0}),c("300ms ease-out",F({transform:"translateY(0)",opacity:1}))]),S(":leave",[c("200ms ease-in",F({transform:"translateY(100%)",opacity:0}))])])]},changeDetection:1})};export{K as MainAppComponent};
|
|
1
|
+
import {S as St}from'./chunk-DWo8Yipj.js';import {an as ce,g,L,ao as V,G,N as N$1,ap as Vy,A as Aw,aq as a,ar as S,as as F,at as c,v as vs,l as Ag,n as eC,k as fl,r as Tg,X as XE,t as tC,D as Fg,I as IC,E as wC,au as tv,ae as Ot,av as dt,Y as x,aw as pl,W as WC,ax as hl,a8 as Zg,a9 as dC,aa as If,ac as mC,ab as wf,o as bg}from'./main-XVJVH4GF.js';import {n as nt,i as it,t as tt,C as Ci}from'./chunk-BMSbS6nO.js';import'./chunk-5I4m0Psa.js';import {G as Ge}from'./chunk-DxenqkEz.js';import'./chunk-C87Bh3Ov.js';import'./chunk-D4D8VOP2.js';import'./chunk-XynH5Ted.js';import'./chunk-CjhnozeY.js';import'./chunk-GU0OGBZz.js';import'./chunk--Cv5Auvq.js';import'./chunk-drd9oaGN.js';import'./chunk-DL6rhSDN.js';var T=class o{welcomeMessages=["Welcome to Coday","Bienvenue sur Coday","Bienvenido a Coday","Willkommen bei Coday","Benvenuto su Coday","Bem-vindo ao Coday","Welkom bij Coday","\u0414\u043E\u0431\u0440\u043E \u043F\u043E\u0436\u0430\u043B\u043E\u0432\u0430\u0442\u044C \u0432 Coday","Coday \u3078\u3088\u3046\u3053\u305D","\u6B22\u8FCE\u6765\u5230 Coday","Coday \uC5D0 \uC624\uC2E0 \uAC83\uC744 \uD658\uC601\uD569\uB2C8\uB2E4","\u0645\u0631\u062D\u0628\u064B\u0627 \u0628\u0643 \u0641\u064A Coday"];currentWelcomeIndex=0;currentWelcomeMessage=this.welcomeMessages[0];welcomeRotationInterval;ngOnInit(){this.startWelcomeRotation();}ngOnDestroy(){this.stopWelcomeRotation();}startWelcomeRotation(){this.welcomeRotationInterval=window.setInterval(()=>{this.currentWelcomeIndex=(this.currentWelcomeIndex+1)%this.welcomeMessages.length,this.currentWelcomeMessage=this.welcomeMessages[this.currentWelcomeIndex];},3e3);}stopWelcomeRotation(){this.welcomeRotationInterval&&(clearInterval(this.welcomeRotationInterval),this.welcomeRotationInterval=void 0);}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=Aw({type:o,selectors:[["app-welcome-message"]],decls:2,vars:1,consts:[[1,"welcome-title"]],template:function(t,i){t&1&&(pl(0,"h1",0),WC(1),hl()),t&2&&(XE(),Zg(i.currentWelcomeMessage));},styles:[".welcome-title[_ngcontent-%COMP%]{font-size:clamp(1.5rem,4vw,4rem);font-weight:700;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% auto;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;animation:_ngcontent-%COMP%_gradientShift 3s ease-in-out infinite;margin:0;padding:0;line-height:1.2;transition:opacity .5s ease-in-out;display:block;min-height:1.2em;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@keyframes _ngcontent-%COMP%_gradientShift{0%{background-position:0% center}50%{background-position:100% center}to{background-position:0% center}}"],changeDetection:1})};var N=class o{destroy$=new ce;isSetup=false;codayService=g(Ge);preferencesService=g(L);setup(){if(this.isSetup){console.warn("[AGENT-NOTIFICATION] Service already set up");return}console.log("[AGENT-NOTIFICATION] Setting up agent notification service"),this.codayService.isThinking$.pipe(Vy(this.destroy$),tv(),Ot(([e,t])=>e===true&&t===false)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Agent stopped thinking, notifying task finished"),this.notifyTaskFinishedIfEnabled();}),this.preferencesService.browserNotificationEnabled$.pipe(Vy(this.destroy$),tv(),Ot(([e,t])=>e===false&&t===true)).subscribe(()=>{console.log("[AGENT-NOTIFICATION] Browser notifications enabled, checking permission"),this.handleBrowserNotificationEnabled();}),this.isSetup=true;}notifyTaskFinishedIfEnabled(){this.preferencesService.getAgentNotificationEnabled()&&(this.preferencesService.getNotificationSoundEnabled()&&this.playCompletionSound(),this.preferencesService.getBrowserNotificationEnabled()&&this.sendBrowserNotification());}playCompletionSound(){try{let e=new(window.AudioContext||window.webkitAudioContext),t=e.createOscillator(),i=e.createGain();t.connect(i),i.connect(e.destination),t.frequency.setValueAtTime(700,e.currentTime),i.gain.setValueAtTime(.1,e.currentTime),i.gain.exponentialRampToValueAtTime(.01,e.currentTime+.08),t.start(e.currentTime),t.stop(e.currentTime+.08);let n=e.createOscillator(),r=e.createGain();n.connect(r),r.connect(e.destination);let l=e.currentTime+.11;n.frequency.setValueAtTime(950,l),r.gain.setValueAtTime(.1,l),r.gain.exponentialRampToValueAtTime(.01,l+.09),n.start(l),n.stop(l+.09),console.log("[AGENT-NOTIFICATION] Completion sound played");}catch(e){console.error("[AGENT-NOTIFICATION] Failed to play completion sound:",e);}}handleBrowserNotificationEnabled(){return dt(this,null,function*(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications"),this.preferencesService.setBrowserNotificationEnabled(false);return}if(Notification.permission==="denied"){console.warn("[AGENT-NOTIFICATION] Permission denied, disabling browser notifications"),this.preferencesService.setBrowserNotificationEnabled(false);return}if(Notification.permission==="granted"){console.log("[AGENT-NOTIFICATION] Permission already granted, showing confirmation"),this.createConfirmationNotification();return}try{(yield Notification.requestPermission())==="granted"?(console.log("[AGENT-NOTIFICATION] Permission granted, showing confirmation"),this.createConfirmationNotification()):(console.log("[AGENT-NOTIFICATION] Permission denied or dismissed"),this.preferencesService.setBrowserNotificationEnabled(!1));}catch(e){console.error("[AGENT-NOTIFICATION] Error requesting permission:",e),this.preferencesService.setBrowserNotificationEnabled(false);}})}sendBrowserNotification(){if(!("Notification"in window)){console.warn("[AGENT-NOTIFICATION] Browser does not support notifications");return}if(document.hasFocus()){console.warn("[AGENT-NOTIFICATION] Document is focused, skipping browser notification");return}Notification.permission==="granted"?this.createTaskCompleteNotification():console.warn("[AGENT-NOTIFICATION] Permission not granted, cannot send notification");}createConfirmationNotification(){let e=new Notification("Coday - Notifications Enabled",{body:"You will be notified when the agent completes tasks",icon:"/favicon.ico",tag:"coday-notifications-enabled",requireInteraction:false});setTimeout(()=>e.close(),4e3),e.onclick=()=>{window.focus(),e.close();},console.log("[AGENT-NOTIFICATION] Confirmation notification sent");}createTaskCompleteNotification(){let e=new Notification("Coday - Task Complete",{body:"The agent has finished and is waiting for your input",icon:"/favicon.ico",tag:"coday-task-complete",requireInteraction:false});setTimeout(()=>e.close(),5e3),e.onclick=()=>{window.focus(),e.close();},console.log("[AGENT-NOTIFICATION] Task complete notification sent");}ngOnDestroy(){console.log("[AGENT-NOTIFICATION] Service destroyed"),this.destroy$.next(),this.destroy$.complete();}static \u0275fac=function(t){return new(t||o)};static \u0275prov=x({token:o,factory:o.\u0275fac,providedIn:"root"})};var Z=["inputSection"];function ee(o,e){if(o&1){let t=dC();vs(0,"app-thread",4),Ag("chatFocused",function(){If(t);let n=mC();return wf(n.onChatFocusedOnMobile())})("drawerStateChange",function(n){If(t);let r=mC();return wf(r.onDrawerStateChange(n))}),fl();}if(o&2){let t=mC();Tg("projectName",t.projectName)("threadId",t.threadId);}}function te(o,e){if(o&1){let t=dC();vs(0,"div",5),bg(1,"app-welcome-message"),fl(),vs(2,"div",6,0)(4,"div",7)(5,"div",8)(6,"app-chat-textarea",9),Ag("messageSubmitted",function(n){If(t);let r=mC();return wf(r.onMessageSubmitted(n))})("voiceMessageReady",function(n){If(t);let r=mC();return wf(r.onVoiceMessageReady(n))})("voiceRecordingToggled",function(n){If(t);let r=mC();return wf(r.onVoiceToggled(n))})("heightChanged",function(n){If(t);let r=mC();return wf(r.onInputHeightChanged(n))})("textareaFocused",function(){If(t);let n=mC();return wf(n.onChatFocusedOnMobile())}),fl()()()();}if(o&2){let t=mC();XE(6),Tg("isDisabled",t.isSessionInitializing)("isSessionInitializing",t.isSessionInitializing)("showWelcome",true)("isThinking",false)("isStarting",t.isStartingFirstMessage);}}var K=class o{destroy$=new ce;inputSection;sidenav;projectName="";threadId=null;isSessionInitializing=false;isStartingFirstMessage=false;inputSectionHeight=80;codayService=g(Ge);titleService=g(nt);preferencesService=g(L);route=g(V);router=g(G);threadApiService=g(N$1);agentNotificationService=g(N);firstMessageState=g(it);constructor(){console.log("[MAIN-APP] Using new thread-based architecture (no clientId needed)");}ngOnInit(){this.agentNotificationService.setup(),this.setupPrintHandlers(),this.route.params.pipe(Vy(this.destroy$)).subscribe(e=>{let t=e.projectName,i=e.threadId||null;console.log("[MAIN-APP] Route params updated:",{project:t,thread:i,previousProject:this.projectName,previousThread:this.threadId}),this.projectName=t,this.threadId=i,this.threadId?console.log("[MAIN-APP] Thread selected - ThreadComponent will display"):(console.log("[MAIN-APP] No thread selected - showing welcome view"),this.initializeWelcomeView());});}initializeWelcomeView(){this.codayService.setTabTitleService(this.titleService);}ngAfterViewInit(){setTimeout(()=>this.updateInputSectionHeight(),100);}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),window.removeEventListener("beforeprint",this.handleBeforePrint),window.removeEventListener("afterprint",this.handleAfterPrint);}onMessageSubmitted(e){console.log("[MAIN-APP] First message submitted from welcome view:",e),this.isSessionInitializing=true,this.isStartingFirstMessage=true,this.threadApiService.createThread().subscribe({next:t=>{console.log("[MAIN-APP] Thread created:",t.thread.id),this.firstMessageState.setPendingFirstMessage(e),this.router.navigate(["project",this.projectName,"thread",t.thread.id]);},error:t=>{console.error("[MAIN-APP] Failed to create thread:",t),this.isSessionInitializing=false,this.isStartingFirstMessage=false,alert("Failed to create conversation: "+(t.message||"Unknown error"));}});}onVoiceToggled(e){console.log("[VOICE] Recording in welcome view:",e);}onVoiceMessageReady(e){console.log("[MAIN-APP] Voice message ready from welcome view"),this.isSessionInitializing=true,this.isStartingFirstMessage=true,this.threadApiService.createThread().subscribe({next:t=>{console.log("[MAIN-APP] Thread created for voice message:",t.thread.id),this.firstMessageState.setPendingVoiceMessage(e),this.router.navigate(["project",this.projectName,"thread",t.thread.id]);},error:t=>{console.error("[MAIN-APP] Failed to create thread for voice message:",t),this.isSessionInitializing=false,this.isStartingFirstMessage=false,alert("Failed to create conversation: "+(t.message||"Unknown error"));}});}isDrawerOpen=false;onDrawerStateChange(e){this.isDrawerOpen=e;}onChatFocusedOnMobile(){window.innerWidth<1024&&this.sidenav?.close();}onInputHeightChanged(e){console.log("[MAIN-APP] Input height changed:",e),this.inputSectionHeight=e;}updateInputSectionHeight(){if(this.inputSection?.nativeElement){let e=this.inputSection.nativeElement.offsetHeight;e!==this.inputSectionHeight&&(console.log("[MAIN-APP] Input section height updated:",e),this.inputSectionHeight=e);}}setupPrintHandlers(){window.addEventListener("beforeprint",this.handleBeforePrint),window.addEventListener("afterprint",this.handleAfterPrint);}handleBeforePrint=()=>{console.log("[PRINT] Before print event triggered");let e=this.preferencesService.getPrintTechnicalMessages();console.log("[PRINT] Print technical messages:",e),e?document.body.classList.add("print-include-technical"):document.body.classList.remove("print-include-technical");};handleAfterPrint=()=>{console.log("[PRINT] After print event triggered"),document.body.classList.remove("print-include-technical");};static \u0275fac=function(t){return new(t||o)};static \u0275cmp=Aw({type:o,selectors:[["app-main"]],viewQuery:function(t,i){if(t&1&&Fg(Z,5)(St,5),t&2){let n;IC(n=wC())&&(i.inputSection=n.first),IC(n=wC())&&(i.sidenav=n.first);}},decls:4,vars:2,consts:[["inputSection",""],[3,"drawerOpen"],[1,"app",3,"mousedown","touchstart"],[3,"projectName","threadId"],[3,"chatFocused","drawerStateChange","projectName","threadId"],[1,"welcome-section"],[1,"input-section"],[1,"input-center"],[1,"input-glass"],[3,"messageSubmitted","voiceMessageReady","voiceRecordingToggled","heightChanged","textareaFocused","isDisabled","isSessionInitializing","showWelcome","isThinking","isStarting"]],template:function(t,i){t&1&&(vs(0,"app-sidenav",1)(1,"div",2),Ag("mousedown",function(){return i.onChatFocusedOnMobile()})("touchstart",function(){return i.onChatFocusedOnMobile()}),eC(2,ee,1,2,"app-thread",3)(3,te,7,5),fl()()),t&2&&(Tg("drawerOpen",i.isDrawerOpen),XE(2),tC(i.threadId?2:3));},dependencies:[tt,Ci,T,St],styles:["[_nghost-%COMP%]{display:flex;height:100vh;width:100%;overflow:hidden;justify-content:center}.app[_ngcontent-%COMP%]{width:100%;max-width:100%;min-width:0;height:100%;display:flex;flex-direction:column;background:var(--color-bg);color:var(--color-text);transition:all .3s ease;position:relative;justify-content:center;overflow:hidden}.chat-wrapper[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;background:transparent;width:100%;padding:2.5rem 0 1.5rem;display:flex;justify-content:center}.chat-wrapper[_ngcontent-%COMP%] .chat-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 2rem}@media(max-width:768px){.chat-wrapper[_ngcontent-%COMP%] .chat-center[_ngcontent-%COMP%]{padding:0 1rem}}.welcome-section[_ngcontent-%COMP%]{flex-shrink:0;text-align:center;padding:2rem 1rem;animation:_ngcontent-%COMP%_fadeInUp .8s ease-out;display:flex;justify-content:center;align-items:center;width:100%;min-width:0;overflow:hidden}@keyframes _ngcontent-%COMP%_fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.input-section[_ngcontent-%COMP%]{flex-shrink:0;position:relative;border-top:none;background:transparent;box-shadow:none;padding:2.5rem 0 2rem;overflow-y:visible;max-height:none;width:100%;z-index:10;pointer-events:none;display:flex;justify-content:center}.input-center[_ngcontent-%COMP%]{max-width:760px;width:100%;margin:0;padding:0 2rem;display:flex;justify-content:center;align-items:end;position:relative;pointer-events:auto}@media(max-width:768px){.input-center[_ngcontent-%COMP%]{padding:0 1rem}}.input-glass[_ngcontent-%COMP%]{background:none;box-shadow:none;width:100%;min-height:64px;display:flex;align-items:stretch;gap:0;pointer-events:auto;position:relative;overflow:visible}.input-glass[_ngcontent-%COMP%] app-chat-textarea[_ngcontent-%COMP%]{width:100%;min-width:0;flex:1 1 auto;align-self:stretch;display:flex}body.dark[_nghost-%COMP%], body.dark [_nghost-%COMP%], [_ngcontent-%COMP%]:root[data-theme=dark] .input-glass[_ngcontent-%COMP%]{background:#24283073;border-color:#b4c8ff17;box-shadow:0 8px 32px #0000002b,0 1.5px 8px #00000012}.choice-overlay[_ngcontent-%COMP%]{z-index:10;width:100%;display:flex;justify-content:center;align-items:center}.upload-status[_ngcontent-%COMP%]{position:fixed;bottom:100px;left:50%;transform:translate(-50%);z-index:1000;display:flex;align-items:center;padding:12px 20px;background:var(--glass-bg);backdrop-filter:var(--glass-backdrop-blur);-webkit-backdrop-filter:var(--glass-backdrop-blur);border:1px solid var(--glass-border);border-radius:16px;font-size:.9em;color:var(--color-text);box-shadow:var(--glass-shadow);max-width:300px;text-align:center}.upload-status.error[_ngcontent-%COMP%]{background:#ff3b3026;color:var(--color-error);border-color:#ff3b304d}@media(max-width:768px){.welcome-section[_ngcontent-%COMP%]{padding:1.5rem 1rem}.input-section[_ngcontent-%COMP%]{padding:1.5rem .75rem 1rem}.input-center[_ngcontent-%COMP%]{padding:0 .5rem}}@media print{[_nghost-%COMP%]{display:block!important;height:auto!important;overflow:visible!important}.app[_ngcontent-%COMP%]{height:auto!important;overflow:visible!important;display:block!important}.input-section[_ngcontent-%COMP%], .welcome-section[_ngcontent-%COMP%]{display:none!important}}"],data:{animation:[a("slideIn",[S(":enter",[F({transform:"translateY(100%)",opacity:0}),c("300ms ease-out",F({transform:"translateY(0)",opacity:1}))]),S(":leave",[c("200ms ease-in",F({transform:"translateY(100%)",opacity:0}))])])]},changeDetection:1})};export{K as MainAppComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {O}from'./chunk-eTAQJYle.js';import {v}from'./chunk-Bi1D1MPS.js';import {y}from'./chunk-DvC7mEoN.js';import {g,G,bl as Sm,w as we$1,H as Hi,m as mT,F as F$1,aD as Ly,u as ue$1,b as U,A as Aw,v as vs,l as Ag,k as fl,W as WC,n as eC,X as XE,t as tC,q as oC,ac as mC,x as iC,a9 as dC,y as Hg,C as Cg,a8 as Zg,a5 as yl,o as bg,a3 as HI,r as Tg,a6 as $I,aa as If,ab as wf,cG as Xw}from'./main-DXWHG4XK.js';import {u,I,f}from'./chunk-CW742eC7.js';import {S as Se$1}from'./chunk-RbE7PtJh.js';import'./chunk-Ckk6G7IP.js';import {o as z,k as _t,n as ni,J as Jn,Y as Ye,Z as Zn,l as Xn,E as En,p as An}from'./chunk-BBJc_ez4.js';import'./chunk-CmmK8635.js';import'./chunk-_PndMs0h.js';var F=(o,i)=>i.value;function re(o,i){o&1&&(vs(0,"p",4),WC(1,"Loading\u2026"),fl());}function ae(o,i){if(o&1){let e=dC();vs(0,"button",18),Ag("click",function(){let _=If(e).$implicit,d=mC(2);return wf(d.setThemeVariant(_.value))}),vs(1,"span",19),WC(2),fl(),vs(3,"span",20),WC(4),fl()();}if(o&2){let e=i.$implicit,a=mC(2);Hg("user-profile__theme-variant--active",a.themeVariant()===e.value),Cg("aria-pressed",a.themeVariant()===e.value),XE(2),Zg(e.label),XE(2),Zg(e.description);}}function le(o,i){if(o&1){let e=dC();vs(0,"button",21),Ag("click",function(){let _=If(e).$implicit,d=mC(2);return wf(d.setTheme(_.value))}),WC(1),fl();}if(o&2){let e=i.$implicit,a=mC(2);Hg("user-profile__segmented-option--active",a.themeMode()===e.value),Cg("aria-pressed",a.themeMode()===e.value),XE(),yl(" ",e.label," ");}}function se(o,i){if(o&1){let e=dC();vs(0,"button",21),Ag("click",function(){let _=If(e).$implicit,d=mC(2);return wf(d.setEnterKeyBehavior(_.value))}),WC(1),fl();}if(o&2){let e=i.$implicit,a=mC(2);Hg("user-profile__segmented-option--active",a.enterKeyBehavior()===e.value),Cg("aria-pressed",a.enterKeyBehavior()===e.value),XE(),yl(" ",e.label," ");}}function _e(o,i){if(o&1){let e=dC();vs(0,"form",22),Ag("ngSubmit",function(){If(e);let _=mC(2);return wf(_.save())}),vs(1,"div",5)(2,"h2",6),WC(3,"Identity"),fl(),vs(4,"div",7)(5,"span",8),WC(6,"Email"),fl(),vs(7,"span",23),WC(8),fl()(),vs(9,"div",7)(10,"span",8),WC(11,"External ID"),fl(),vs(12,"span",23),WC(13),fl()()(),vs(14,"div",5)(15,"h2",6),WC(16,"Profile"),fl(),vs(17,"div",7)(18,"label",24),WC(19,"First name"),fl(),bg(20,"input",25),HI(),fl(),vs(21,"div",7)(22,"label",26),WC(23,"Last name"),fl(),bg(24,"input",27),HI(),fl(),vs(25,"div",7)(26,"label",28),WC(27,"Bio"),fl(),bg(28,"textarea",29),HI(),fl()(),vs(29,"div",30)(30,"button",31),WC(31),fl(),vs(32,"button",32),Ag("click",function(){If(e);let _=mC(2);return wf(_.cancelEditing())}),WC(33,"Cancel"),fl()()();}if(o&2){let e=mC(),a=mC();Tg("formGroup",a.form),XE(8),Zg(e.email),XE(5),Zg(e.externalId),XE(7),$I(),XE(4),$I(),XE(4),$I(),XE(2),Tg("disabled",a.isSaving()),XE(),yl(" ",a.isSaving()?"Saving\u2026":"Save changes"," ");}}function de(o,i){o&1&&(vs(0,"p",40),WC(1," No global configuration yet. Create one from the Integrations / AI Providers / Auth Settings pages of your namespaces. "),fl());}function ce(o,i){if(o&1){let e=dC();vs(0,"span",47),WC(1,"Delete?"),fl(),vs(2,"button",48),Ag("click",function(){If(e);let _=mC().$implicit,d=mC(6);return wf(d.confirmDelete(_))}),WC(3," Confirm "),fl(),vs(4,"button",49),Ag("click",function(){If(e);let _=mC(7);return wf(_.cancelDelete())}),WC(5," Cancel "),fl();}}function pe(o,i){if(o&1){let e=dC();vs(0,"button",49),Ag("click",function(){If(e);let _=mC().$implicit,d=mC(6);return wf(d.armDelete(_))}),WC(1," Delete "),fl();}}function me(o,i){if(o&1&&(vs(0,"li",43)(1,"span",44),WC(2),fl(),vs(3,"span",45),WC(4),fl(),eC(5,ce,6,0)(6,pe,2,0,"button",46),fl()),o&2){let e=i.$implicit,a=mC(6);XE(2),Zg(e.name),XE(2),Zg(e.subtitle),XE(),tC(a.isPendingDelete(e)?5:6);}}function ue(o,i){if(o&1&&(vs(0,"h3",41),WC(1,"Integrations"),fl(),vs(2,"ul",42),oC(3,me,7,3,"li",43,Xw().trackEntry,true),fl()),o&2){let e=mC(5);XE(3),iC(e.recap().integrations);}}function fe(o,i){if(o&1){let e=dC();vs(0,"span",47),WC(1,"Delete?"),fl(),vs(2,"button",48),Ag("click",function(){If(e);let _=mC().$implicit,d=mC(6);return wf(d.confirmDelete(_))}),WC(3," Confirm "),fl(),vs(4,"button",49),Ag("click",function(){If(e);let _=mC(7);return wf(_.cancelDelete())}),WC(5," Cancel "),fl();}}function Ce(o,i){if(o&1){let e=dC();vs(0,"button",49),Ag("click",function(){If(e);let _=mC().$implicit,d=mC(6);return wf(d.armDelete(_))}),WC(1," Delete "),fl();}}function ge(o,i){if(o&1&&(vs(0,"li",43)(1,"span",44),WC(2),fl(),vs(3,"span",45),WC(4),fl(),eC(5,fe,6,0)(6,Ce,2,0,"button",46),fl()),o&2){let e=i.$implicit,a=mC(6);XE(2),Zg(e.name),XE(2),Zg(e.subtitle),XE(),tC(a.isPendingDelete(e)?5:6);}}function ve(o,i){if(o&1&&(vs(0,"h3",41),WC(1,"AI Providers"),fl(),vs(2,"ul",42),oC(3,ge,7,3,"li",43,Xw().trackEntry,true),fl()),o&2){let e=mC(5);XE(3),iC(e.recap().aiProviders);}}function xe(o,i){if(o&1){let e=dC();vs(0,"span",47),WC(1,"Delete?"),fl(),vs(2,"button",48),Ag("click",function(){If(e);let _=mC().$implicit,d=mC(6);return wf(d.confirmDelete(_))}),WC(3," Confirm "),fl(),vs(4,"button",49),Ag("click",function(){If(e);let _=mC(7);return wf(_.cancelDelete())}),WC(5," Cancel "),fl();}}function be(o,i){if(o&1){let e=dC();vs(0,"button",49),Ag("click",function(){If(e);let _=mC().$implicit,d=mC(6);return wf(d.armDelete(_))}),WC(1," Delete "),fl();}}function ye(o,i){if(o&1&&(vs(0,"li",43)(1,"span",44),WC(2),fl(),vs(3,"span",45),WC(4),fl(),eC(5,xe,6,0)(6,be,2,0,"button",46),fl()),o&2){let e=i.$implicit,a=mC(6);XE(2),Zg(e.name),XE(2),Zg(e.subtitle),XE(),tC(a.isPendingDelete(e)?5:6);}}function he(o,i){if(o&1&&(vs(0,"h3",41),WC(1,"My global auth settings"),fl(),vs(2,"ul",42),oC(3,ye,7,3,"li",43,Xw().trackEntry,true),fl()),o&2){let e=mC(5);XE(3),iC(e.recap().authSettings);}}function Pe(o,i){if(o&1&&(eC(0,ue,5,0),eC(1,ve,5,0),eC(2,he,5,0)),o&2){let e=mC(4);tC(e.recap().integrations.length>0?0:-1),XE(),tC(e.recap().aiProviders.length>0?1:-1),XE(),tC(e.recap().authSettings.length>0?2:-1);}}function Ee(o,i){if(o&1&&eC(0,de,2,0,"p",40)(1,Pe,3,3),o&2){let e=mC(3);tC(e.recap().total===0?0:1);}}function Se(o,i){if(o&1){let e=dC();vs(0,"div",17)(1,"div",5)(2,"h2",6),WC(3,"Identity"),fl(),vs(4,"div",7)(5,"span",8),WC(6,"Email"),fl(),vs(7,"span",33),WC(8),fl()(),vs(9,"div",7)(10,"span",8),WC(11,"External ID"),fl(),vs(12,"span",33),WC(13),fl()()(),vs(14,"div",5)(15,"h2",6),WC(16,"Profile"),fl(),vs(17,"div",7)(18,"span",8),WC(19,"First name"),fl(),vs(20,"span",33),WC(21),fl()(),vs(22,"div",7)(23,"span",8),WC(24,"Last name"),fl(),vs(25,"span",33),WC(26),fl()(),vs(27,"div",34)(28,"span",8),WC(29,"Bio"),fl(),vs(30,"span",33),WC(31),fl()()(),vs(32,"div",30)(33,"button",35),Ag("click",function(){If(e);let _=mC(2);return wf(_.startEditing())}),WC(34," Edit profile "),fl()(),vs(35,"div",36)(36,"button",37),Ag("click",function(){If(e);let _=mC(2);return wf(_.toggleOverrides())}),vs(37,"span",38),WC(38,"\u25B6"),fl(),WC(39," My global user configurations "),vs(40,"span",39),WC(41),fl()(),eC(42,Ee,2,1),fl()();}if(o&2){let e=mC(),a=mC();XE(8),Zg(e.email),XE(5),Zg(e.externalId),XE(8),Zg(e.firstname||"\u2014"),XE(5),Zg(e.lastname||"\u2014"),XE(5),Zg(e.bio||"\u2014"),XE(5),Cg("aria-expanded",a.isOverridesExpanded()),XE(),Hg("user-profile__overrides-arrow--open",a.isOverridesExpanded()),XE(4),yl("(",a.recap().total,")"),XE(),tC(a.isOverridesExpanded()?42:-1);}}function we(o,i){if(o&1&&(vs(0,"div",5)(1,"h2",6),WC(2,"Appearance"),fl(),vs(3,"div",7)(4,"span",8),WC(5,"Skin"),fl(),vs(6,"div",9),oC(7,ae,5,5,"button",10,F),fl()(),vs(9,"div",7)(10,"span",8),WC(11,"Mode"),fl(),vs(12,"div",11),oC(13,le,2,4,"button",12,F),fl()()(),vs(15,"div",5)(16,"h2",6),WC(17,"Composer"),fl(),vs(18,"div",7)(19,"span",8),WC(20,"Enter key"),fl(),vs(21,"div",13)(22,"div",14),oC(23,se,2,4,"button",12,F),fl(),vs(25,"p",15),WC(26,'In "New line" mode, press Ctrl or Cmd + Enter to send.'),fl()()()(),eC(27,_e,34,5,"form",16)(28,Se,43,10,"div",17)),o&2){let e=mC();XE(7),iC(e.themeVariantOptions),XE(6),iC(e.themeOptions),XE(10),iC(e.enterKeyOptions),XE(4),tC(e.isEditing()?27:28);}}function Me(o,i){o&1&&(vs(0,"p",4),WC(1,"Unable to load profile."),fl());}var oe=class o{userState=g(u);router=g(G);location=g(Sm);destroyRef=g(we$1);integrationState=g(y);providerState=g(O);authSettingState=g(v);themePort=g(I);preferencesPort=g(f);isEditing=Hi(false);isLoading=Hi(false);isSaving=Hi(false);isOverridesExpanded=Hi(false);currentUser=this.userState.currentUser;theme=this.themePort.theme;themeMode=mT(()=>this.themePort.theme().mode);themeOptions=[{value:"light",label:"Light"},{value:"dark",label:"Dark"},{value:"system",label:"System"}];themeVariant=mT(()=>this.themePort.theme().variant);themeVariantOptions=[{value:"industry",label:"Industry",description:"Bleu acier, Barlow"},{value:"terminal",label:"Terminal",description:"Ambre CRT, JetBrains Mono"}];enterKeyBehavior=this.preferencesPort.enterKeyBehavior;enterKeyOptions=[{value:"send",label:"Send"},{value:"newline",label:"New line"}];form=new z({firstname:new _t("",{nonNullable:true}),lastname:new _t("",{nonNullable:true}),bio:new _t("",{nonNullable:true})});recap=F$1(Ly([this.integrationState.userGlobal$,this.providerState.userGlobal$,this.authSettingState.userGlobal$]).pipe(ue$1(([i,e,a])=>{let _=i.map(C=>({category:"integration",id:C.id??"",name:C.name,subtitle:C.integrationType})),d=e.map(C=>({category:"aiProvider",id:C.id??"",name:C.name,subtitle:C.apiType})),I=a.map(C=>({category:"authSetting",id:C.id??"",name:C.name,subtitle:C.authType}));return {integrations:_,aiProviders:d,authSettings:I,total:_.length+d.length+I.length}})),{initialValue:{integrations:[],aiProviders:[],authSettings:[],total:0}});ngOnInit(){if(this.currentUser()){this.syncFormFromState();return}this.isLoading.set(true),this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:()=>{this.syncFormFromState(),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}startEditing(){this.syncFormFromState(),this.isEditing.set(true);}cancelEditing(){this.isEditing.set(false);}setTheme(i){this.themePort.setTheme({variant:this.themePort.theme().variant,mode:i});}setThemeVariant(i){this.themePort.setTheme({variant:i,mode:this.themePort.theme().mode});}setEnterKeyBehavior(i){this.preferencesPort.setEnterKeyBehavior(i);}save(){this.isSaving()||(this.isSaving.set(true),this.userState.updateMe({firstname:this.form.controls.firstname.value.trim()||void 0,lastname:this.form.controls.lastname.value.trim()||void 0,bio:this.form.controls.bio.value.trim()||void 0}).pipe(U(this.destroyRef)).subscribe({next:()=>{this.isSaving.set(false),this.isEditing.set(false);},error:()=>this.isSaving.set(false)}));}toggleOverrides(){this.isOverridesExpanded.update(i=>!i),this.pendingDeleteKey.set(null);}pendingDeleteKey=Hi(null);isPendingDelete(i){return this.pendingDeleteKey()===this.entryKey(i)}armDelete(i){i.id&&this.pendingDeleteKey.set(this.entryKey(i));}cancelDelete(){this.pendingDeleteKey.set(null);}confirmDelete(i){if(!i.id)return;this.pendingDeleteKey.set(null),(i.category==="integration"?this.integrationState.delete(i.id,"userGlobal"):i.category==="authSetting"?this.authSettingState.delete(i.id,"userGlobal"):this.providerState.delete(i.id,"userGlobal")).pipe(U(this.destroyRef)).subscribe({error:a=>{console.error(`[UserProfile] Delete failed for ${i.category}:${i.id}:`,a);}});}entryKey(i){return `${i.category}:${i.id}`}goBack(){window.history.length>1?this.location.back():this.router.navigate(["/agentos"]);}trackEntry(i,e){return this.entryKey(e)}syncFormFromState(){let i=this.currentUser();i&&this.form.setValue({firstname:i.firstname??"",lastname:i.lastname??"",bio:i.bio??""});}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=Aw({type:o,selectors:[["agentos-user-profile"]],decls:8,vars:1,consts:[[1,"user-profile"],[1,"user-profile__header"],["icon","arrow_back","title","Back",3,"action"],[1,"user-profile__title"],[1,"user-profile__loading"],[1,"user-profile__section"],[1,"user-profile__section-title"],[1,"user-profile__field"],[1,"user-profile__label"],[1,"user-profile__theme-variants"],["type","button",1,"user-profile__theme-variant",3,"user-profile__theme-variant--active"],["role","group","aria-label","Color mode",1,"user-profile__segmented"],["type","button",1,"user-profile__segmented-option",3,"user-profile__segmented-option--active"],[1,"user-profile__field-control"],["role","group","aria-label","Enter key behavior",1,"user-profile__segmented"],[1,"user-profile__hint"],[1,"user-profile__form",3,"formGroup"],[1,"user-profile__view"],["type","button",1,"user-profile__theme-variant",3,"click"],[1,"user-profile__theme-variant-name"],[1,"user-profile__theme-variant-desc"],["type","button",1,"user-profile__segmented-option",3,"click"],[1,"user-profile__form",3,"ngSubmit","formGroup"],[1,"user-profile__value","user-profile__value--readonly"],["for","up-firstname",1,"user-profile__label"],["id","up-firstname","type","text","placeholder","Your first name","formControlName","firstname","autocomplete","given-name",1,"user-profile__input"],["for","up-lastname",1,"user-profile__label"],["id","up-lastname","type","text","placeholder","Your last name","formControlName","lastname","autocomplete","family-name",1,"user-profile__input"],["for","up-bio",1,"user-profile__label"],["id","up-bio","placeholder","A short description about yourself","formControlName","bio","rows","4",1,"user-profile__input","user-profile__input--textarea"],[1,"user-profile__actions"],["type","submit",1,"user-profile__btn","user-profile__btn--primary",3,"disabled"],["type","button",1,"user-profile__btn",3,"click"],[1,"user-profile__value"],[1,"user-profile__field","user-profile__field--bio"],["type","button",1,"user-profile__btn","user-profile__btn--primary",3,"click"],[1,"user-profile__overrides"],["type","button",1,"user-profile__overrides-toggle",3,"click"],[1,"user-profile__overrides-arrow"],[1,"user-profile__overrides-count"],[1,"user-profile__overrides-empty"],[1,"user-profile__overrides-subtitle"],[1,"user-profile__overrides-list"],[1,"user-profile__overrides-row"],[1,"user-profile__overrides-name"],[1,"user-profile__overrides-subtitle-text"],["type","button",1,"user-profile__overrides-delete"],[1,"user-profile__overrides-confirm-label"],["type","button",1,"user-profile__overrides-delete","user-profile__overrides-delete--confirm",3,"click"],["type","button",1,"user-profile__overrides-delete",3,"click"]],template:function(e,a){if(e&1&&(vs(0,"div",0)(1,"header",1)(2,"ds-icon-button",2),Ag("action",function(){return a.goBack()}),fl(),vs(3,"h1",3),WC(4,"My profile"),fl()(),eC(5,re,2,0,"p",4)(6,we,29,1)(7,Me,2,0,"p",4),fl()),e&2){let _;XE(5),tC(a.isLoading()?5:(_=a.currentUser())?6:7,_);}},dependencies:[ni,Jn,Ye,Zn,Xn,En,An,Se$1],styles:[".user-profile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.user-profile__header[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:.5rem}.user-profile__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.user-profile__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.user-profile__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.user-profile__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.user-profile__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.user-profile__view[_ngcontent-%COMP%], .user-profile__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem}.user-profile__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.user-profile__section-title[_ngcontent-%COMP%]{margin:0;font-family:var(--font-heading);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--color-neutral-500);border-bottom:1px solid var(--color-divider);padding-bottom:.5rem}.user-profile__field[_ngcontent-%COMP%]{display:grid;grid-template-columns:140px 1fr;align-items:baseline;gap:.75rem}.user-profile__field--bio[_ngcontent-%COMP%]{align-items:start}.user-profile__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text-secondary);white-space:nowrap}.user-profile__value[_ngcontent-%COMP%]{font-size:.9375rem;color:var(--color-text);word-break:break-word;white-space:pre-wrap}.user-profile__value--readonly[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.875rem}.user-profile__segmented[_ngcontent-%COMP%]{display:inline-flex;justify-self:start;border:1px solid var(--color-divider);overflow:hidden}.user-profile__segmented-option[_ngcontent-%COMP%]{padding:.4rem .85rem;background:transparent;border:none;border-right:1px solid var(--color-divider);color:var(--color-text-secondary);font-size:.875rem;cursor:pointer;transition:background .15s ease,color .15s ease}.user-profile__segmented-option[_ngcontent-%COMP%]:last-child{border-right:none}.user-profile__segmented-option[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.user-profile__segmented-option--active[_ngcontent-%COMP%]{background:var(--color-accent);color:#fff}.user-profile__segmented-option--active[_ngcontent-%COMP%]:hover{background:var(--color-accent-700)}.user-profile__field-control[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:.4rem}.user-profile__hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary)}.user-profile__input[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;border-radius:0;transition:border-color .15s ease;resize:none}.user-profile__input[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.user-profile__input[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.user-profile__input--textarea[_ngcontent-%COMP%]{line-height:1.5;resize:vertical}.user-profile__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.user-profile__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;border-radius:0;transition:background .15s ease,border-color .15s ease}.user-profile__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.user-profile__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.user-profile__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.user-profile__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}.user-profile__theme-variants[_ngcontent-%COMP%]{display:flex;gap:8px;justify-self:start}.user-profile__theme-variant[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:3px;padding:10px 16px;border:1px solid var(--color-divider);background:transparent;cursor:pointer;min-width:120px;transition:background .12s,border-color .12s}.user-profile__theme-variant[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.user-profile__theme-variant--active[_ngcontent-%COMP%]{border-color:var(--color-accent);background:color-mix(in srgb,var(--color-accent) 8%,transparent)}.user-profile__theme-variant-name[_ngcontent-%COMP%]{font-family:var(--font-heading);font-size:13px;font-weight:600;color:var(--color-text)}.user-profile__theme-variant-desc[_ngcontent-%COMP%]{font-size:11px;color:var(--color-text-secondary);font-family:var(--font-body)}.user-profile__overrides[_ngcontent-%COMP%]{margin-top:1rem;padding-top:1rem;border-top:1px solid var(--color-divider)}.user-profile__overrides-toggle[_ngcontent-%COMP%]{background:transparent;border:none;padding:.25rem 0;font-size:.85rem;color:var(--color-text-secondary);cursor:pointer;display:flex;align-items:center;gap:.4rem}.user-profile__overrides-toggle[_ngcontent-%COMP%]:hover{color:var(--color-text)}.user-profile__overrides-arrow[_ngcontent-%COMP%]{display:inline-block;font-size:.65rem;transition:transform .15s ease}.user-profile__overrides-arrow--open[_ngcontent-%COMP%]{transform:rotate(90deg)}.user-profile__overrides-count[_ngcontent-%COMP%]{color:var(--color-text-tertiary)}.user-profile__overrides-empty[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary);font-style:italic;padding:.5rem 0 0;margin:0}.user-profile__overrides-subtitle[_ngcontent-%COMP%]{font-family:var(--font-heading);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--color-neutral-500);margin:.75rem 0 .25rem}.user-profile__overrides-list[_ngcontent-%COMP%]{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:.25rem}.user-profile__overrides-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.4rem .5rem;font-size:.85rem;border-radius:0}.user-profile__overrides-row[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.user-profile__overrides-name[_ngcontent-%COMP%]{flex:1;color:var(--color-text);font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-profile__overrides-subtitle-text[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);font-family:var(--font-heading)}.user-profile__overrides-confirm-label[_ngcontent-%COMP%]{font-size:11px;font-family:var(--font-heading);font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--red-deep);white-space:nowrap}.user-profile__overrides-delete[_ngcontent-%COMP%]{background:transparent;border:1px solid transparent;font-size:11px;font-family:var(--font-heading);font-weight:600;color:var(--color-neutral-500);cursor:pointer;padding:3px 8px;border-radius:0;transition:color .12s,background .12s,border-color .12s}.user-profile__overrides-delete[_ngcontent-%COMP%]:hover{color:var(--red);background:color-mix(in srgb,var(--red) 10%,transparent);border-color:var(--red)}.user-profile__overrides-delete--confirm[_ngcontent-%COMP%]{border-color:var(--red);background:var(--red);color:#fff}.user-profile__overrides-delete--confirm[_ngcontent-%COMP%]:hover{background:var(--red-deep);border-color:var(--red-deep)}"]})};export{oe as UserProfileComponent};
|
|
1
|
+
import {O}from'./chunk-BhfTutz7.js';import {y}from'./chunk-DlKQ1Cys.js';import {R}from'./chunk-C26xMDFo.js';import {g,G,bl as Sm,w as we$1,H as Hi,m as mT,F as F$1,aD as Ly,u as ue$1,b as U,A as Aw,v as vs,l as Ag,k as fl,W as WC,n as eC,X as XE,t as tC,q as oC,ac as mC,x as iC,a9 as dC,y as Hg,C as Cg,a8 as Zg,a5 as yl,o as bg,a3 as HI,r as Tg,a6 as $I,aa as If,ab as wf,cG as Xw}from'./main-XVJVH4GF.js';import {u,I,f}from'./chunk-DHse9w28.js';import {S as Se$1}from'./chunk--Cv5Auvq.js';import'./chunk-drd9oaGN.js';import {o as z,k as _t,n as ni,J as Jn,Y as Ye,Z as Zn,l as Xn,E as En,p as An}from'./chunk-DL6rhSDN.js';import'./chunk-SitBftU1.js';import'./chunk-C87Bh3Ov.js';var F=(o,i)=>i.value;function re(o,i){o&1&&(vs(0,"p",4),WC(1,"Loading\u2026"),fl());}function ae(o,i){if(o&1){let e=dC();vs(0,"button",18),Ag("click",function(){let _=If(e).$implicit,d=mC(2);return wf(d.setThemeVariant(_.value))}),vs(1,"span",19),WC(2),fl(),vs(3,"span",20),WC(4),fl()();}if(o&2){let e=i.$implicit,a=mC(2);Hg("user-profile__theme-variant--active",a.themeVariant()===e.value),Cg("aria-pressed",a.themeVariant()===e.value),XE(2),Zg(e.label),XE(2),Zg(e.description);}}function le(o,i){if(o&1){let e=dC();vs(0,"button",21),Ag("click",function(){let _=If(e).$implicit,d=mC(2);return wf(d.setTheme(_.value))}),WC(1),fl();}if(o&2){let e=i.$implicit,a=mC(2);Hg("user-profile__segmented-option--active",a.themeMode()===e.value),Cg("aria-pressed",a.themeMode()===e.value),XE(),yl(" ",e.label," ");}}function se(o,i){if(o&1){let e=dC();vs(0,"button",21),Ag("click",function(){let _=If(e).$implicit,d=mC(2);return wf(d.setEnterKeyBehavior(_.value))}),WC(1),fl();}if(o&2){let e=i.$implicit,a=mC(2);Hg("user-profile__segmented-option--active",a.enterKeyBehavior()===e.value),Cg("aria-pressed",a.enterKeyBehavior()===e.value),XE(),yl(" ",e.label," ");}}function _e(o,i){if(o&1){let e=dC();vs(0,"form",22),Ag("ngSubmit",function(){If(e);let _=mC(2);return wf(_.save())}),vs(1,"div",5)(2,"h2",6),WC(3,"Identity"),fl(),vs(4,"div",7)(5,"span",8),WC(6,"Email"),fl(),vs(7,"span",23),WC(8),fl()(),vs(9,"div",7)(10,"span",8),WC(11,"External ID"),fl(),vs(12,"span",23),WC(13),fl()()(),vs(14,"div",5)(15,"h2",6),WC(16,"Profile"),fl(),vs(17,"div",7)(18,"label",24),WC(19,"First name"),fl(),bg(20,"input",25),HI(),fl(),vs(21,"div",7)(22,"label",26),WC(23,"Last name"),fl(),bg(24,"input",27),HI(),fl(),vs(25,"div",7)(26,"label",28),WC(27,"Bio"),fl(),bg(28,"textarea",29),HI(),fl()(),vs(29,"div",30)(30,"button",31),WC(31),fl(),vs(32,"button",32),Ag("click",function(){If(e);let _=mC(2);return wf(_.cancelEditing())}),WC(33,"Cancel"),fl()()();}if(o&2){let e=mC(),a=mC();Tg("formGroup",a.form),XE(8),Zg(e.email),XE(5),Zg(e.externalId),XE(7),$I(),XE(4),$I(),XE(4),$I(),XE(2),Tg("disabled",a.isSaving()),XE(),yl(" ",a.isSaving()?"Saving\u2026":"Save changes"," ");}}function de(o,i){o&1&&(vs(0,"p",40),WC(1," No global configuration yet. Create one from the Integrations / AI Providers / Auth Settings pages of your namespaces. "),fl());}function ce(o,i){if(o&1){let e=dC();vs(0,"span",47),WC(1,"Delete?"),fl(),vs(2,"button",48),Ag("click",function(){If(e);let _=mC().$implicit,d=mC(6);return wf(d.confirmDelete(_))}),WC(3," Confirm "),fl(),vs(4,"button",49),Ag("click",function(){If(e);let _=mC(7);return wf(_.cancelDelete())}),WC(5," Cancel "),fl();}}function pe(o,i){if(o&1){let e=dC();vs(0,"button",49),Ag("click",function(){If(e);let _=mC().$implicit,d=mC(6);return wf(d.armDelete(_))}),WC(1," Delete "),fl();}}function me(o,i){if(o&1&&(vs(0,"li",43)(1,"span",44),WC(2),fl(),vs(3,"span",45),WC(4),fl(),eC(5,ce,6,0)(6,pe,2,0,"button",46),fl()),o&2){let e=i.$implicit,a=mC(6);XE(2),Zg(e.name),XE(2),Zg(e.subtitle),XE(),tC(a.isPendingDelete(e)?5:6);}}function ue(o,i){if(o&1&&(vs(0,"h3",41),WC(1,"Integrations"),fl(),vs(2,"ul",42),oC(3,me,7,3,"li",43,Xw().trackEntry,true),fl()),o&2){let e=mC(5);XE(3),iC(e.recap().integrations);}}function fe(o,i){if(o&1){let e=dC();vs(0,"span",47),WC(1,"Delete?"),fl(),vs(2,"button",48),Ag("click",function(){If(e);let _=mC().$implicit,d=mC(6);return wf(d.confirmDelete(_))}),WC(3," Confirm "),fl(),vs(4,"button",49),Ag("click",function(){If(e);let _=mC(7);return wf(_.cancelDelete())}),WC(5," Cancel "),fl();}}function Ce(o,i){if(o&1){let e=dC();vs(0,"button",49),Ag("click",function(){If(e);let _=mC().$implicit,d=mC(6);return wf(d.armDelete(_))}),WC(1," Delete "),fl();}}function ge(o,i){if(o&1&&(vs(0,"li",43)(1,"span",44),WC(2),fl(),vs(3,"span",45),WC(4),fl(),eC(5,fe,6,0)(6,Ce,2,0,"button",46),fl()),o&2){let e=i.$implicit,a=mC(6);XE(2),Zg(e.name),XE(2),Zg(e.subtitle),XE(),tC(a.isPendingDelete(e)?5:6);}}function ve(o,i){if(o&1&&(vs(0,"h3",41),WC(1,"AI Providers"),fl(),vs(2,"ul",42),oC(3,ge,7,3,"li",43,Xw().trackEntry,true),fl()),o&2){let e=mC(5);XE(3),iC(e.recap().aiProviders);}}function xe(o,i){if(o&1){let e=dC();vs(0,"span",47),WC(1,"Delete?"),fl(),vs(2,"button",48),Ag("click",function(){If(e);let _=mC().$implicit,d=mC(6);return wf(d.confirmDelete(_))}),WC(3," Confirm "),fl(),vs(4,"button",49),Ag("click",function(){If(e);let _=mC(7);return wf(_.cancelDelete())}),WC(5," Cancel "),fl();}}function be(o,i){if(o&1){let e=dC();vs(0,"button",49),Ag("click",function(){If(e);let _=mC().$implicit,d=mC(6);return wf(d.armDelete(_))}),WC(1," Delete "),fl();}}function ye(o,i){if(o&1&&(vs(0,"li",43)(1,"span",44),WC(2),fl(),vs(3,"span",45),WC(4),fl(),eC(5,xe,6,0)(6,be,2,0,"button",46),fl()),o&2){let e=i.$implicit,a=mC(6);XE(2),Zg(e.name),XE(2),Zg(e.subtitle),XE(),tC(a.isPendingDelete(e)?5:6);}}function he(o,i){if(o&1&&(vs(0,"h3",41),WC(1,"My global auth settings"),fl(),vs(2,"ul",42),oC(3,ye,7,3,"li",43,Xw().trackEntry,true),fl()),o&2){let e=mC(5);XE(3),iC(e.recap().authSettings);}}function Pe(o,i){if(o&1&&(eC(0,ue,5,0),eC(1,ve,5,0),eC(2,he,5,0)),o&2){let e=mC(4);tC(e.recap().integrations.length>0?0:-1),XE(),tC(e.recap().aiProviders.length>0?1:-1),XE(),tC(e.recap().authSettings.length>0?2:-1);}}function Ee(o,i){if(o&1&&eC(0,de,2,0,"p",40)(1,Pe,3,3),o&2){let e=mC(3);tC(e.recap().total===0?0:1);}}function Se(o,i){if(o&1){let e=dC();vs(0,"div",17)(1,"div",5)(2,"h2",6),WC(3,"Identity"),fl(),vs(4,"div",7)(5,"span",8),WC(6,"Email"),fl(),vs(7,"span",33),WC(8),fl()(),vs(9,"div",7)(10,"span",8),WC(11,"External ID"),fl(),vs(12,"span",33),WC(13),fl()()(),vs(14,"div",5)(15,"h2",6),WC(16,"Profile"),fl(),vs(17,"div",7)(18,"span",8),WC(19,"First name"),fl(),vs(20,"span",33),WC(21),fl()(),vs(22,"div",7)(23,"span",8),WC(24,"Last name"),fl(),vs(25,"span",33),WC(26),fl()(),vs(27,"div",34)(28,"span",8),WC(29,"Bio"),fl(),vs(30,"span",33),WC(31),fl()()(),vs(32,"div",30)(33,"button",35),Ag("click",function(){If(e);let _=mC(2);return wf(_.startEditing())}),WC(34," Edit profile "),fl()(),vs(35,"div",36)(36,"button",37),Ag("click",function(){If(e);let _=mC(2);return wf(_.toggleOverrides())}),vs(37,"span",38),WC(38,"\u25B6"),fl(),WC(39," My global user configurations "),vs(40,"span",39),WC(41),fl()(),eC(42,Ee,2,1),fl()();}if(o&2){let e=mC(),a=mC();XE(8),Zg(e.email),XE(5),Zg(e.externalId),XE(8),Zg(e.firstname||"\u2014"),XE(5),Zg(e.lastname||"\u2014"),XE(5),Zg(e.bio||"\u2014"),XE(5),Cg("aria-expanded",a.isOverridesExpanded()),XE(),Hg("user-profile__overrides-arrow--open",a.isOverridesExpanded()),XE(4),yl("(",a.recap().total,")"),XE(),tC(a.isOverridesExpanded()?42:-1);}}function we(o,i){if(o&1&&(vs(0,"div",5)(1,"h2",6),WC(2,"Appearance"),fl(),vs(3,"div",7)(4,"span",8),WC(5,"Skin"),fl(),vs(6,"div",9),oC(7,ae,5,5,"button",10,F),fl()(),vs(9,"div",7)(10,"span",8),WC(11,"Mode"),fl(),vs(12,"div",11),oC(13,le,2,4,"button",12,F),fl()()(),vs(15,"div",5)(16,"h2",6),WC(17,"Composer"),fl(),vs(18,"div",7)(19,"span",8),WC(20,"Enter key"),fl(),vs(21,"div",13)(22,"div",14),oC(23,se,2,4,"button",12,F),fl(),vs(25,"p",15),WC(26,'In "New line" mode, press Ctrl or Cmd + Enter to send.'),fl()()()(),eC(27,_e,34,5,"form",16)(28,Se,43,10,"div",17)),o&2){let e=mC();XE(7),iC(e.themeVariantOptions),XE(6),iC(e.themeOptions),XE(10),iC(e.enterKeyOptions),XE(4),tC(e.isEditing()?27:28);}}function Me(o,i){o&1&&(vs(0,"p",4),WC(1,"Unable to load profile."),fl());}var oe=class o{userState=g(u);router=g(G);location=g(Sm);destroyRef=g(we$1);integrationState=g(y);providerState=g(O);authSettingState=g(R);themePort=g(I);preferencesPort=g(f);isEditing=Hi(false);isLoading=Hi(false);isSaving=Hi(false);isOverridesExpanded=Hi(false);currentUser=this.userState.currentUser;theme=this.themePort.theme;themeMode=mT(()=>this.themePort.theme().mode);themeOptions=[{value:"light",label:"Light"},{value:"dark",label:"Dark"},{value:"system",label:"System"}];themeVariant=mT(()=>this.themePort.theme().variant);themeVariantOptions=[{value:"industry",label:"Industry",description:"Bleu acier, Barlow"},{value:"terminal",label:"Terminal",description:"Ambre CRT, JetBrains Mono"}];enterKeyBehavior=this.preferencesPort.enterKeyBehavior;enterKeyOptions=[{value:"send",label:"Send"},{value:"newline",label:"New line"}];form=new z({firstname:new _t("",{nonNullable:true}),lastname:new _t("",{nonNullable:true}),bio:new _t("",{nonNullable:true})});recap=F$1(Ly([this.integrationState.userGlobal$,this.providerState.userGlobal$,this.authSettingState.userGlobal$]).pipe(ue$1(([i,e,a])=>{let _=i.map(C=>({category:"integration",id:C.id??"",name:C.name,subtitle:C.integrationType})),d=e.map(C=>({category:"aiProvider",id:C.id??"",name:C.name,subtitle:C.apiType})),I=a.map(C=>({category:"authSetting",id:C.id??"",name:C.name,subtitle:C.authType}));return {integrations:_,aiProviders:d,authSettings:I,total:_.length+d.length+I.length}})),{initialValue:{integrations:[],aiProviders:[],authSettings:[],total:0}});ngOnInit(){if(this.currentUser()){this.syncFormFromState();return}this.isLoading.set(true),this.userState.loadMe().pipe(U(this.destroyRef)).subscribe({next:()=>{this.syncFormFromState(),this.isLoading.set(false);},error:()=>this.isLoading.set(false)});}startEditing(){this.syncFormFromState(),this.isEditing.set(true);}cancelEditing(){this.isEditing.set(false);}setTheme(i){this.themePort.setTheme({variant:this.themePort.theme().variant,mode:i});}setThemeVariant(i){this.themePort.setTheme({variant:i,mode:this.themePort.theme().mode});}setEnterKeyBehavior(i){this.preferencesPort.setEnterKeyBehavior(i);}save(){this.isSaving()||(this.isSaving.set(true),this.userState.updateMe({firstname:this.form.controls.firstname.value.trim()||void 0,lastname:this.form.controls.lastname.value.trim()||void 0,bio:this.form.controls.bio.value.trim()||void 0}).pipe(U(this.destroyRef)).subscribe({next:()=>{this.isSaving.set(false),this.isEditing.set(false);},error:()=>this.isSaving.set(false)}));}toggleOverrides(){this.isOverridesExpanded.update(i=>!i),this.pendingDeleteKey.set(null);}pendingDeleteKey=Hi(null);isPendingDelete(i){return this.pendingDeleteKey()===this.entryKey(i)}armDelete(i){i.id&&this.pendingDeleteKey.set(this.entryKey(i));}cancelDelete(){this.pendingDeleteKey.set(null);}confirmDelete(i){if(!i.id)return;this.pendingDeleteKey.set(null),(i.category==="integration"?this.integrationState.delete(i.id,"userGlobal"):i.category==="authSetting"?this.authSettingState.delete(i.id,"userGlobal"):this.providerState.delete(i.id,"userGlobal")).pipe(U(this.destroyRef)).subscribe({error:a=>{console.error(`[UserProfile] Delete failed for ${i.category}:${i.id}:`,a);}});}entryKey(i){return `${i.category}:${i.id}`}goBack(){window.history.length>1?this.location.back():this.router.navigate(["/agentos"]);}trackEntry(i,e){return this.entryKey(e)}syncFormFromState(){let i=this.currentUser();i&&this.form.setValue({firstname:i.firstname??"",lastname:i.lastname??"",bio:i.bio??""});}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=Aw({type:o,selectors:[["agentos-user-profile"]],decls:8,vars:1,consts:[[1,"user-profile"],[1,"user-profile__header"],["icon","arrow_back","title","Back",3,"action"],[1,"user-profile__title"],[1,"user-profile__loading"],[1,"user-profile__section"],[1,"user-profile__section-title"],[1,"user-profile__field"],[1,"user-profile__label"],[1,"user-profile__theme-variants"],["type","button",1,"user-profile__theme-variant",3,"user-profile__theme-variant--active"],["role","group","aria-label","Color mode",1,"user-profile__segmented"],["type","button",1,"user-profile__segmented-option",3,"user-profile__segmented-option--active"],[1,"user-profile__field-control"],["role","group","aria-label","Enter key behavior",1,"user-profile__segmented"],[1,"user-profile__hint"],[1,"user-profile__form",3,"formGroup"],[1,"user-profile__view"],["type","button",1,"user-profile__theme-variant",3,"click"],[1,"user-profile__theme-variant-name"],[1,"user-profile__theme-variant-desc"],["type","button",1,"user-profile__segmented-option",3,"click"],[1,"user-profile__form",3,"ngSubmit","formGroup"],[1,"user-profile__value","user-profile__value--readonly"],["for","up-firstname",1,"user-profile__label"],["id","up-firstname","type","text","placeholder","Your first name","formControlName","firstname","autocomplete","given-name",1,"user-profile__input"],["for","up-lastname",1,"user-profile__label"],["id","up-lastname","type","text","placeholder","Your last name","formControlName","lastname","autocomplete","family-name",1,"user-profile__input"],["for","up-bio",1,"user-profile__label"],["id","up-bio","placeholder","A short description about yourself","formControlName","bio","rows","4",1,"user-profile__input","user-profile__input--textarea"],[1,"user-profile__actions"],["type","submit",1,"user-profile__btn","user-profile__btn--primary",3,"disabled"],["type","button",1,"user-profile__btn",3,"click"],[1,"user-profile__value"],[1,"user-profile__field","user-profile__field--bio"],["type","button",1,"user-profile__btn","user-profile__btn--primary",3,"click"],[1,"user-profile__overrides"],["type","button",1,"user-profile__overrides-toggle",3,"click"],[1,"user-profile__overrides-arrow"],[1,"user-profile__overrides-count"],[1,"user-profile__overrides-empty"],[1,"user-profile__overrides-subtitle"],[1,"user-profile__overrides-list"],[1,"user-profile__overrides-row"],[1,"user-profile__overrides-name"],[1,"user-profile__overrides-subtitle-text"],["type","button",1,"user-profile__overrides-delete"],[1,"user-profile__overrides-confirm-label"],["type","button",1,"user-profile__overrides-delete","user-profile__overrides-delete--confirm",3,"click"],["type","button",1,"user-profile__overrides-delete",3,"click"]],template:function(e,a){if(e&1&&(vs(0,"div",0)(1,"header",1)(2,"ds-icon-button",2),Ag("action",function(){return a.goBack()}),fl(),vs(3,"h1",3),WC(4,"My profile"),fl()(),eC(5,re,2,0,"p",4)(6,we,29,1)(7,Me,2,0,"p",4),fl()),e&2){let _;XE(5),tC(a.isLoading()?5:(_=a.currentUser())?6:7,_);}},dependencies:[ni,Jn,Ye,Zn,Xn,En,An,Se$1],styles:[".user-profile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.user-profile__header[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:.5rem}.user-profile__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.user-profile__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.user-profile__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.user-profile__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.user-profile__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.user-profile__view[_ngcontent-%COMP%], .user-profile__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem}.user-profile__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.user-profile__section-title[_ngcontent-%COMP%]{margin:0;font-family:var(--font-heading);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--color-neutral-500);border-bottom:1px solid var(--color-divider);padding-bottom:.5rem}.user-profile__field[_ngcontent-%COMP%]{display:grid;grid-template-columns:140px 1fr;align-items:baseline;gap:.75rem}.user-profile__field--bio[_ngcontent-%COMP%]{align-items:start}.user-profile__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text-secondary);white-space:nowrap}.user-profile__value[_ngcontent-%COMP%]{font-size:.9375rem;color:var(--color-text);word-break:break-word;white-space:pre-wrap}.user-profile__value--readonly[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.875rem}.user-profile__segmented[_ngcontent-%COMP%]{display:inline-flex;justify-self:start;border:1px solid var(--color-divider);overflow:hidden}.user-profile__segmented-option[_ngcontent-%COMP%]{padding:.4rem .85rem;background:transparent;border:none;border-right:1px solid var(--color-divider);color:var(--color-text-secondary);font-size:.875rem;cursor:pointer;transition:background .15s ease,color .15s ease}.user-profile__segmented-option[_ngcontent-%COMP%]:last-child{border-right:none}.user-profile__segmented-option[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.user-profile__segmented-option--active[_ngcontent-%COMP%]{background:var(--color-accent);color:#fff}.user-profile__segmented-option--active[_ngcontent-%COMP%]:hover{background:var(--color-accent-700)}.user-profile__field-control[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:.4rem}.user-profile__hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary)}.user-profile__input[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;border-radius:0;transition:border-color .15s ease;resize:none}.user-profile__input[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.user-profile__input[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.user-profile__input--textarea[_ngcontent-%COMP%]{line-height:1.5;resize:vertical}.user-profile__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.user-profile__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;border-radius:0;transition:background .15s ease,border-color .15s ease}.user-profile__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.user-profile__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.user-profile__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.user-profile__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}.user-profile__theme-variants[_ngcontent-%COMP%]{display:flex;gap:8px;justify-self:start}.user-profile__theme-variant[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:3px;padding:10px 16px;border:1px solid var(--color-divider);background:transparent;cursor:pointer;min-width:120px;transition:background .12s,border-color .12s}.user-profile__theme-variant[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.user-profile__theme-variant--active[_ngcontent-%COMP%]{border-color:var(--color-accent);background:color-mix(in srgb,var(--color-accent) 8%,transparent)}.user-profile__theme-variant-name[_ngcontent-%COMP%]{font-family:var(--font-heading);font-size:13px;font-weight:600;color:var(--color-text)}.user-profile__theme-variant-desc[_ngcontent-%COMP%]{font-size:11px;color:var(--color-text-secondary);font-family:var(--font-body)}.user-profile__overrides[_ngcontent-%COMP%]{margin-top:1rem;padding-top:1rem;border-top:1px solid var(--color-divider)}.user-profile__overrides-toggle[_ngcontent-%COMP%]{background:transparent;border:none;padding:.25rem 0;font-size:.85rem;color:var(--color-text-secondary);cursor:pointer;display:flex;align-items:center;gap:.4rem}.user-profile__overrides-toggle[_ngcontent-%COMP%]:hover{color:var(--color-text)}.user-profile__overrides-arrow[_ngcontent-%COMP%]{display:inline-block;font-size:.65rem;transition:transform .15s ease}.user-profile__overrides-arrow--open[_ngcontent-%COMP%]{transform:rotate(90deg)}.user-profile__overrides-count[_ngcontent-%COMP%]{color:var(--color-text-tertiary)}.user-profile__overrides-empty[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary);font-style:italic;padding:.5rem 0 0;margin:0}.user-profile__overrides-subtitle[_ngcontent-%COMP%]{font-family:var(--font-heading);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--color-neutral-500);margin:.75rem 0 .25rem}.user-profile__overrides-list[_ngcontent-%COMP%]{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:.25rem}.user-profile__overrides-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.4rem .5rem;font-size:.85rem;border-radius:0}.user-profile__overrides-row[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.user-profile__overrides-name[_ngcontent-%COMP%]{flex:1;color:var(--color-text);font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-profile__overrides-subtitle-text[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);font-family:var(--font-heading)}.user-profile__overrides-confirm-label[_ngcontent-%COMP%]{font-size:11px;font-family:var(--font-heading);font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--red-deep);white-space:nowrap}.user-profile__overrides-delete[_ngcontent-%COMP%]{background:transparent;border:1px solid transparent;font-size:11px;font-family:var(--font-heading);font-weight:600;color:var(--color-neutral-500);cursor:pointer;padding:3px 8px;border-radius:0;transition:color .12s,background .12s,border-color .12s}.user-profile__overrides-delete[_ngcontent-%COMP%]:hover{color:var(--red);background:color-mix(in srgb,var(--red) 10%,transparent);border-color:var(--red)}.user-profile__overrides-delete--confirm[_ngcontent-%COMP%]{border-color:var(--red);background:var(--red);color:#fff}.user-profile__overrides-delete--confirm[_ngcontent-%COMP%]:hover{background:var(--red-deep);border-color:var(--red-deep)}"]})};export{oe as UserProfileComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {s as se}from'./chunk-
|
|
1
|
+
import {s as se}from'./chunk-GU0OGBZz.js';import {a as Dr,z as zi,F as Fn,H as Hi,h as ht,b as gr,_ as _r}from'./chunk--Cv5Auvq.js';import {g,J as dy,P,Y as x,aK as Do,aL as qn,bC as ge,bD as vt,aN as wt,br as Cl,az as Qt,aV as w,aR as K,bE as X,al as yt,aS as Ut,bF as p,bG as Pt,A as Aw,aZ as YT,bz as vC,bH as Eg,b4 as nT,D as Fg,bI as dr,I as IC,E as wC,bu as kg,bJ as fe,bK as pe,bL as mr,aO as G,bs as Qn,bM as F,aQ as As,an as ce,O as Ot,bN as mt,bO as Yy,ae as Ot$1,S as ha,u as ue,bP as Zy,bQ as bd,bR as ma,aE as A,bt as Ve$1,bS as pn,bT as Od,bU as Ky,aA as sn,bV as Y,bW as Pt$1,bX as po,bY as X$1,bZ as xt,aY as ks,aC as Cu,l as Ag,C as Cg,aw as pl,bA as DC,ax as hl,ac as mC,b_ as FC,y as Hg,b$ as Ng,c0 as E,c1 as ME,c2 as kt$1,bB as Ii}from'./main-XVJVH4GF.js';import {D}from'./chunk-DL6rhSDN.js';var xe=class a{http=g(dy);projectState=g(P);getBaseUrl(){return `/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/schedulers`}listSchedulers(){return this.http.get(this.getBaseUrl())}getScheduler(o){return this.http.get(`${this.getBaseUrl()}/${o}`)}createScheduler(o){return this.http.post(this.getBaseUrl(),o)}listSchedulersForProject(o){return this.http.get(`/api/projects/${o}/schedulers`)}enableSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/enable`,{})}disableSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/disable`,{})}runSchedulerNowForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers/${e}/run-now`,{})}deleteSchedulerForProject(o,e){return this.http.delete(`/api/projects/${o}/schedulers/${e}`)}updateSchedulerForProject(o,e,t){return this.http.put(`/api/projects/${o}/schedulers/${e}`,t)}createSchedulerForProject(o,e){return this.http.post(`/api/projects/${o}/schedulers`,e)}updateScheduler(o,e){return this.http.put(`${this.getBaseUrl()}/${o}`,e)}deleteScheduler(o){return this.http.delete(`${this.getBaseUrl()}/${o}`)}enableScheduler(o){return this.http.post(`${this.getBaseUrl()}/${o}/enable`,{})}disableScheduler(o){return this.http.post(`${this.getBaseUrl()}/${o}/disable`,{})}runSchedulerNow(o){return this.http.post(`${this.getBaseUrl()}/${o}/run-now`,{})}static \u0275fac=function(e){return new(e||a)};static \u0275prov=x({token:a,factory:a.\u0275fac,providedIn:"root"})};var Ke=["panel"],Ue=["*"];function qe(a,o){if(a&1&&(pl(0,"div",1,0),DC(2),hl()),a&2){let e=o.id,t=mC();FC(t._classList),Hg("mat-mdc-autocomplete-visible",t.showPanel)("mat-mdc-autocomplete-hidden",!t.showPanel)("mat-autocomplete-panel-animations-enabled",!t._animationsDisabled)("mat-primary",t._color==="primary")("mat-accent",t._color==="accent")("mat-warn",t._color==="warn"),Ng("id",t.id),Cg("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby(e));}}var R=class{source;option;constructor(o,e){this.source=o,this.option=e;}},Ve=new w("mat-autocomplete-default-options",{providedIn:"root",factory:()=>({autoActiveFirstOption:false,autoSelectActiveOption:false,hideSingleSelectionIndicator:false,requireSelection:false,hasBackdrop:false})}),Ct=(()=>{class a{_changeDetectorRef=g(Cl);_elementRef=g(Qt);_defaults=g(Ve);_animationsDisabled=K();_activeOptionChanges=X.EMPTY;_keyManager;showPanel=false;get isOpen(){return this._isOpen&&this.showPanel}_isOpen=false;_latestOpeningTrigger;_setColor(e){this._color=e,this._changeDetectorRef.markForCheck();}_color;template;panel;options;optionGroups;ariaLabel;ariaLabelledby;displayWith=null;autoActiveFirstOption;autoSelectActiveOption;requireSelection;panelWidth;disableRipple=false;optionSelected=new yt;opened=new yt;closed=new yt;optionActivated=new yt;set classList(e){this._classList=e,this._elementRef.nativeElement.className="";}_classList;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties();}_hideSingleSelectionIndicator;_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck();}id=g(Ut).getId("mat-autocomplete-");inertGroups;constructor(){let e=g(p);this.inertGroups=e?.SAFARI||false,this.autoActiveFirstOption=!!this._defaults.autoActiveFirstOption,this.autoSelectActiveOption=!!this._defaults.autoSelectActiveOption,this.requireSelection=!!this._defaults.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??false;}ngAfterContentInit(){this._keyManager=new Pt(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(e=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[e]||null});}),this._setVisibility();}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe();}_setScrollTop(e){this.panel&&(this.panel.nativeElement.scrollTop=e);}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options?.length,this._changeDetectorRef.markForCheck();}_emitSelectEvent(e){let t=new R(this,e);this.optionSelected.emit(t);}_getPanelAriaLabelledby(e){if(this.ariaLabel)return null;let t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_skipPredicate(){return false}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=Aw({type:a,selectors:[["mat-autocomplete"]],contentQueries:function(t,i,n){if(t&1&&kg(n,Fn,5)(n,Hi,5),t&2){let s;IC(s=wC())&&(i.options=s),IC(s=wC())&&(i.optionGroups=s);}},viewQuery:function(t,i){if(t&1&&Fg(dr,7)(Ke,5),t&2){let n;IC(n=wC())&&(i.template=n.first),IC(n=wC())&&(i.panel=n.first);}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",YT],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",YT],requireSelection:[2,"requireSelection","requireSelection",YT],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",YT],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",YT]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],features:[nT([{provide:zi,useExisting:a}])],ngContentSelectors:Ue,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(t,i){t&1&&(vC(),Eg(0,qe,3,17,"ng-template"));},styles:[`div.mat-mdc-autocomplete-panel {
|
|
2
2
|
width: 100%;
|
|
3
3
|
max-height: 256px;
|
|
4
4
|
visibility: hidden;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {n}from'./chunk-CfgXrte_.js';import {O}from'./chunk-DZuiUHX9.js';import {v}from'./chunk-DaJf2IFW.js';import {R}from'./chunk-C26xMDFo.js';import {g,ao as V,G,w as we,H as Hi,u as ue,b as U$1,bR as ma,S as ha,A as Aw,aJ as Nb,v as vs,be as aT,l as Ag,k as fl,af as Dg,T as TC,r as Tg,bf as uT,ah as rT,n as eC,ac as mC,t as tC,W as WC,X as XE,a8 as Zg,a9 as dC,aa as If,ab as wf,ag as fT}from'./main-XVJVH4GF.js';import'./chunk-DHse9w28.js';import {W as Wn,S as Se}from'./chunk--Cv5Auvq.js';import'./chunk-drd9oaGN.js';import'./chunk-DL6rhSDN.js';import'./chunk-SitBftU1.js';import'./chunk-C87Bh3Ov.js';var W=()=>[];function z(s,e){if(s&1&&(vs(0,"p",3),WC(1),fl()),s&2){let t=mC().$implicit;XE(),Zg(t.name);}}function U(s,e){if(s&1){let t=dC();vs(0,"agentos-auth-setting-item",5),Ag("editRequested",function(){let i=If(t),r=mC(2);return wf(r.onEdit(i))})("deleteRequested",function(){let i=If(t),r=mC(2);return wf(r.onDelete(i))})("duplicateRequested",function(){let i=If(t),r=mC(2);return wf(r.onDuplicate(i))}),fl();}if(s&2){let t=e,n=mC(2);Tg("config",t.config)("scope",t.scope)("readOnly",t.scope==="platform"||t.scope==="namespace"&&!n.isAdmin());}}function X(s,e){if(s&1&&eC(0,z,2,1,"p",3)(1,U,1,3,"agentos-auth-setting-item",4),s&2){let t,n=e.$implicit,i=mC();tC(i.isEmptyPlaceholder(n.id)?0:(t=i.resolve(n.id))?1:-1,t);}}var k=Object.freeze({platform:"Platform (read-only)",namespace:"Auth Settings du namespace",userOnNs:"Mes overrides sur ce namespace",userGlobal:"Mes overrides globaux"}),F="__empty__",j=class s{route=g(V);router=g(G);destroyRef=g(we);state=g(R);namespaceRole=g(v);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=Hi(false);listItems$=this.state.vm$.pipe(ue(e=>this.toListItems(e)));isLoading=Hi(true);resolved=new Map;ngOnInit(){this.route.paramMap.pipe(U$1(this.destroyRef)).subscribe(e=>{let t=e.get("namespaceId")??"";t&&t!==this.namespaceId&&(this.namespaceId=t),this.state.setNamespace(t);}),this.route.paramMap.pipe(ue(e=>e.get("namespaceId")??""),ma(e=>e?this.namespaceRole.isAdminOfNamespace$(e):ha(false)),U$1(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(U$1(this.destroyRef)).subscribe(e=>{this.isLoading.set(false);let t=new Map;e.platform.forEach(n=>{n.id&&t.set(this.itemKey("platform",n.id),{config:n,scope:"platform"});}),e.namespace.forEach(n=>{n.id&&t.set(this.itemKey("namespace",n.id),{config:n,scope:"namespace"});}),e.userOnNs.forEach(n=>{n.id&&t.set(this.itemKey("userOnNs",n.id),{config:n,scope:"userOnNs"});}),e.userGlobal.forEach(n=>{n.id&&t.set(this.itemKey("userGlobal",n.id),{config:n,scope:"userGlobal"});}),this.resolved=t;});}isEmptyPlaceholder(e){return e.startsWith(F)}resolve(e){return this.resolved.get(e)??null}itemKey(e,t){return `${e}:${t}`}goBack(){this.router.navigate(["/agentos","namespaces"]);}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:n(this.isAdmin())}});}onEdit(e){let t=e.config.id;t&&this.router.navigate(["/agentos",this.namespaceId,"auth-settings",t,"edit"],{queryParams:{scope:e.scope}});}onDelete(e){let t=e.config.id;t&&this.state.delete(t,e.scope).pipe(U$1(this.destroyRef)).subscribe({error:n=>{console.error(`[AuthSettingsAllScopes] Delete failed for ${e.scope}:${t}:`,n);}});}onDuplicate(e){if(!e.config.id)return;let t=e.scope==="platform"||e.scope==="namespace"&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"auth-settings","new"],{queryParams:{scope:t,template:e.config.id,templateScope:e.scope}});}toListItems(e){let t=[];return t.push(...this.sectionItems("platform",e.platform)),t.push(...this.sectionItems("namespace",e.namespace)),t.push(...this.sectionItems("userOnNs",e.userOnNs)),t.push(...this.sectionItems("userGlobal",e.userGlobal)),t}sectionItems(e,t){return t.length===0?[{id:`${F}${e}`,name:"Aucun Auth Setting",groupKey:e,groupLabel:k[e]}]:t.filter(n=>!!n.id).map(n=>({id:this.itemKey(e,n.id),name:n.name,description:n.authType,groupKey:e,groupLabel:k[e]}))}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=Aw({type:s,selectors:[["agentos-auth-settings-all-scopes"]],decls:5,vars:7,consts:[["authSettingItemTpl",""],["title","Auth Settings","emptyMessage","No auth settings available.","cardMinWidth","400px",3,"createRequested","items","loading","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[1,"auth-settings-all-scopes__empty"],[3,"config","scope","readOnly"],[3,"editRequested","deleteRequested","duplicateRequested","config","scope","readOnly"]],template:function(t,n){if(t&1&&(vs(0,"ds-entity-list",1),aT(1,"async"),Ag("createRequested",function(){return n.openCreateForm()}),vs(2,"ds-icon-button",2),Ag("action",function(){return n.goBack()}),fl()(),Dg(3,X,2,1,"ng-template",null,0,fT)),t&2){let i=TC(4);Tg("items",uT(1,4,n.listItems$)??rT(6,W))("loading",n.isLoading())("showCreate",true)("itemTemplate",i);}},dependencies:[Wn,O,Se,Nb],encapsulation:2})};export{j as AuthSettingsAllScopesComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {z}from'./chunk-
|
|
1
|
+
import {z}from'./chunk-CV4cx-V6.js';import {s}from'./chunk-D4D8VOP2.js';import {g as g$1,G,P,R as Re,w as we,F,m as mT,z as z$1,a as P$1,ae as Ot,b as U,A as Aw,j as Gn,s as si,v as vs,l as Ag,o as bg,k as fl,af as Dg,ag as fT,T as TC,X as XE,r as Tg,a9 as dC,aa as If,ac as mC,ab as wf,W as WC,ah as rT}from'./main-XVJVH4GF.js';import'./chunk-DtHFNV_5.js';import {W as Wn,o as ot}from'./chunk--Cv5Auvq.js';import'./chunk-drd9oaGN.js';import {y as yt,w as wt}from'./chunk-DL6rhSDN.js';var ee=()=>[];function te(u,t){if(u&1){let o=dC();vs(0,"div",5)(1,"ds-entity-card",6),Ag("selected",function(r){If(o);let i=mC();return wf(i.onItemSelected(r))}),fl(),vs(2,"button",7),Ag("click",function(r){let i=If(o).$implicit,f=mC();return r.stopPropagation(),wf(f.onDeleteRequested(i.id))}),vs(3,"mat-icon"),WC(4,"close"),fl()()();}if(u&2){let o=t.$implicit;XE(),Tg("id",o.id)("name",o.name)("description",o.description)("badges",o.badges??rT(4,ee));}}var g="__",Y=class u{router=g$1(G);projectStateService=g$1(P);dialog=g$1(Re);destroyRef=g$1(we);notification=g$1(s);projects=F(this.projectStateService.projectList$);forcedProject=F(this.projectStateService.forcedProject$,{initialValue:null});isLoading=F(this.projectStateService.isLoading$,{initialValue:false});projectItems=mT(()=>{let t=this.projects();if(!t)return [];let o=t.filter(e=>!e.name.includes(g)),n=t.filter(e=>e.name.includes(g)),r=new Set(o.map(e=>e.name)),i=e=>e.split(g)[0]??null,f=new Set(n.map(e=>i(e.name)).filter(e=>e!==null&&r.has(e))),l=[],G=[...f].sort((e,a)=>e.localeCompare(a));for(let e of G){let a=o.find(s=>s.name===e);l.push(z$1(P$1({},this.toEntityListItem(a)),{groupKey:e,groupLabel:e}));let Z=n.filter(s=>i(s.name)===e).sort((s,C)=>s.name.localeCompare(C.name));for(let s of Z){let C=s.name.slice(e.length+g.length);l.push(z$1(P$1({},this.toEntityListItem(s)),{name:C,description:s.name,groupKey:e,groupLabel:e}));}}let H=[...o].filter(e=>!f.has(e.name)&&!e.volatile).sort((e,a)=>e.name.localeCompare(a.name));for(let e of H)l.push(z$1(P$1({},this.toEntityListItem(e)),{groupKey:"__standalone__",groupLabel:"Projects"}));let Q=[...o].filter(e=>!f.has(e.name)&&e.volatile).sort((e,a)=>e.name.localeCompare(a.name));for(let e of Q)l.push(z$1(P$1({},this.toEntityListItem(e)),{groupKey:"__volatile__",groupLabel:"Temporary"}));let X=n.filter(e=>{let a=i(e.name);return a!==null&&!r.has(a)}).sort((e,a)=>e.name.localeCompare(a.name));for(let e of X)l.push(z$1(P$1({},this.toEntityListItem(e)),{groupKey:"__orphaned__",groupLabel:"Orphaned worktrees"}));return l});showCreateButton=mT(()=>!this.forcedProject());constructor(){}onItemSelected(t){this.projectStateService.selectProject(t),this.router.navigate(["project",t]);}onCreateRequested(){this.router.navigate(["project","new"]);}onDeleteRequested(t){let o=t.includes(g);this.dialog.open(z,{width:"400px",panelClass:"confirm-dialog-panel",data:P$1({title:"Delete project",message:`This will remove the project "${t}" from Coday and archive its configuration. The project source code on disk is not affected.`,confirmLabel:"Delete",cancelLabel:"Cancel",isDestructive:true},o?{checkboxLabel:"Also remove git worktree from disk"}:{})}).afterClosed().pipe(Ot(r=>r?.confirmed===true),U(this.destroyRef)).subscribe(r=>{this.notification.info("Deleting project\u2026"),this.projectStateService.deleteProject(t,r.checkboxChecked).pipe(U(this.destroyRef)).subscribe({next:()=>{this.notification.success(`Project "${t}" deleted`),this.router.url.includes(`/project/${encodeURIComponent(t)}`)&&this.router.navigate(["/"]);},error:i=>{console.error("[PROJECT-LIST] Failed to delete project:",i),this.notification.error(i?.error?.error??"Failed to delete project");}});});}toEntityListItem(t){return {id:t.name,name:t.name,badges:t.volatile?[{label:"temp",variant:"warning"}]:[]}}static \u0275fac=function(o){return new(o||u)};static \u0275cmp=Aw({type:u,selectors:[["app-project-selection"]],decls:6,vars:5,consts:[["projectCard",""],[1,"project-page-layout"],["title","Projects","contentMaxWidth","1400px","searchPlaceholder","Filter projects\u2026","emptyMessage","No projects found.",3,"itemSelected","createRequested","items","loading","itemTemplate","showCreate","autoFocusSearch"],["toolbar-start","","routerLink","/","title","Back to tasks",1,"project-list__logo"],["src","CODAY-Logo.png","alt","Coday"],[1,"project-card-wrapper"],[3,"selected","id","name","description","badges"],["mat-icon-button","","title","Delete project",1,"project-card-wrapper__delete",3,"click"]],template:function(o,n){if(o&1&&(vs(0,"div",1)(1,"ds-entity-list",2),Ag("itemSelected",function(i){return n.onItemSelected(i)})("createRequested",function(){return n.onCreateRequested()}),vs(2,"a",3),bg(3,"img",4),fl()()(),Dg(4,te,5,5,"ng-template",null,0,fT)),o&2){let r=TC(5);XE(),Tg("items",n.projectItems())("loading",n.isLoading())("itemTemplate",r)("showCreate",n.showCreateButton())("autoFocusSearch",true);}},dependencies:[Wn,ot,yt,wt,Gn,si],styles:["[_nghost-%COMP%]{display:block;width:100%;min-height:100vh;background:var(--color-bg);overflow-y:auto}.project-page-layout[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%}.project-list__logo[_ngcontent-%COMP%]{display:flex;align-items:center;flex-shrink:0;border-radius:4px;opacity:.85;transition:opacity .15s ease;cursor:pointer}.project-list__logo[_ngcontent-%COMP%]:hover{opacity:1}.project-list__logo[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:40px;height:40px;object-fit:contain;border-radius:4px}.project-card-wrapper[_ngcontent-%COMP%]{position:relative}.project-card-wrapper__delete[_ngcontent-%COMP%]{position:absolute;top:4px;right:4px;width:28px;height:28px;line-height:28px;padding:0;opacity:0;transition:opacity .15s ease;color:var(--color-text-secondary, #6e6e73)}.project-card-wrapper__delete[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px}.project-card-wrapper__delete[_ngcontent-%COMP%]:hover{color:var(--color-error, #ff3b30)}.project-card-wrapper[_ngcontent-%COMP%]:hover .project-card-wrapper__delete[_ngcontent-%COMP%]{opacity:1}"],changeDetection:1})};export{Y as ProjectListComponent};
|