@whoz-oss/coday-client 0.125.3 → 0.126.0

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.
@@ -1,4 +1,4 @@
1
- import{b as k}from"./chunk-XIQ3L6H6.js";import{Rc as A,Z as S,ca as C}from"./chunk-3JGMGRXW.js";var P=class t{http=C(A);projectState=C(k);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads`}listThreads(){return this.http.get(this.getBaseUrl())}listAllThreads(){return this.http.get("/api/threads")}getThread(e){return this.http.get(`${this.getBaseUrl()}/${e}`)}createThread(e){let s=e?{name:e}:{};return this.http.post(this.getBaseUrl(),s)}updateThread(e,s){return this.http.put(`${this.getBaseUrl()}/${e}`,{name:s})}updateThreadUsers(e,s){return this.http.put(`${this.getBaseUrl()}/${e}`,{users:s})}starThread(e){return this.http.post(`${this.getBaseUrl()}/${e}/star`,{})}unstarThread(e){return this.http.delete(`${this.getBaseUrl()}/${e}/star`)}deleteThread(e){return this.http.delete(`${this.getBaseUrl()}/${e}`)}stopThread(e){return this.http.post(`${this.getBaseUrl()}/${e}/stop`,{})}getThreadMessages(e){return this.http.get(`${this.getBaseUrl()}/${e}/messages`)}static \u0275fac=function(s){return new(s||t)};static \u0275prov=S({token:t,factory:t.\u0275fac,providedIn:"root"})};function R(t,e=80){if(t.length<=e)return t;try{if(t.trim().startsWith("{")||t.trim().startsWith("[")){let s=JSON.parse(t),n=JSON.stringify(s);return n.length<=e?n:n.substring(0,e)+`...(${n.length} chars)`}}catch(s){}return t.substring(0,e)+"..."}var r=class{constructor(e,s){this.type=s;if(e.timestamp)this.timestamp=e.timestamp;else{let n=Math.random().toString(36).substring(2,7);this.timestamp=`${new Date().toISOString()}-${n}`}this.parentKey=e.parentKey,this.threadId=e.threadId,this.length=0}timestamp;parentKey;static type;length;threadId;get date(){let e=this.timestamp.lastIndexOf("-");if(e>0){let s=this.timestamp.substring(e+1);if(s.length===5&&/^[a-z0-9]+$/.test(s))return new Date(this.timestamp.substring(0,e))}return new Date(this.timestamp)}},v=class extends r{invite;constructor(e,s){super(e,s),this.invite=e.invite}buildAnswer(e){return new i({answer:e,parentKey:this.timestamp,invite:this.invite})}},T=class t extends r{static type="heartbeat";constructor(e){super(e,t.type)}},a=class t extends v{defaultValue;static type="invite";constructor(e){super(e,t.type),this.defaultValue=e.defaultValue}},W="InviteEventDefault",i=class t extends r{answer;invite;name;static type="answer";constructor(e){super(e,t.type),this.answer=e.answer??"No answer",this.invite=e.invite,this.name=e.name}},p=class t extends r{speaker;text;static type="text";constructor(e){super(e,t.type),this.speaker=e.speaker,this.text=e.text}},b=class t extends r{chunk;static type="text_chunk";constructor(e){super(e,t.type),this.chunk=e.chunk,this.length=this.chunk.length}},g=class t extends r{warning;static type="warn";constructor(e){super(e,t.type),this.warning=e.warning}},h=class t extends r{error;static type="error";constructor(e){super(e,t.type),this.error=e.error}},c=class t extends v{options;optionalQuestion;allowFreeText;static type="choice";constructor(e){super(e,t.type),this.options=Array.isArray(e.options)?e.options:[],this.optionalQuestion=e.optionalQuestion,this.allowFreeText=e.allowFreeText??!1}},d=class t extends r{toolRequestId;name;args;static type="tool_request";constructor(e){super(e,t.type),this.toolRequestId=e.toolRequestId??this.timestamp,this.name=e.name,this.args=e.args,this.length=this.args.length+this.name.length+this.toolRequestId.length+20}buildResponse(e){return new o({output:e,toolRequestId:this.toolRequestId,parentKey:this.timestamp})}toSingleLineString(e=50){let s=R(this.args,e);return`\u{1F527} ${this.name}(${s})`}},o=class t extends r{toolRequestId;output;static type="tool_response";constructor(e){if(super(e,t.type),this.toolRequestId=e.toolRequestId||this.timestamp||new Date().toISOString(),this.output=e.output,typeof this.output=="string")this.length=this.output.length+this.toolRequestId.length+20;else if(this.output.type==="text")this.length=this.output.content.length+this.toolRequestId.length+20;else if(this.output.type==="image"){let s=(this.output.width??0)*(this.output.height??0)/750;this.length=(s?s*3.5:this.output.content.length)+this.toolRequestId.length+20}else this.length=this.toolRequestId.length+20}getTextOutput(){return typeof this.output=="string"?this.output:this.output.type==="text"?this.output.content:this.output.type==="image"?`[Image: ${this.output.mimeType}]`:""}toSingleLineString(e=50){let s=this.getTextOutput(),n=R(s,e),$=typeof this.output!="string"&&this.output.type==="image"?" [image]":"";return`\u2B91 ${n}${$}`}},f=class t extends r{static type="thinking";static debounce=5e3;constructor(e){super(e,t.type)}},l=class t extends r{summary;static type="summary";constructor(e){super(e,t.type),this.summary=e.summary,this.length=this.summary.length}toSingleLineString(e=80){return`\u{1F4CB} Summary: ${R(this.summary,e)}`}},u=class t extends r{role;name;content;static type="message";constructor(e){super(e,t.type),this.role=e.role,this.name=e.name,this.content=e.content,this.length=this.content.map(s=>{if(s.type==="text")return s.content.length;if(s.type==="image"){let n=(s.width||0)*(s.height||0)/750;return n?n*3.5:s.content.length}return 0}).reduce((s,n)=>s+n,0)}getTextContent(){return this.content.filter(e=>e.type==="text").map(e=>e.content).join(`
1
+ import{b as k}from"./chunk-XIQ3L6H6.js";import{Rc as A,Z as S,ca as C}from"./chunk-3JGMGRXW.js";var P=class t{http=C(A);projectState=C(k);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads`}listThreads(){return this.http.get(this.getBaseUrl())}listAllThreads(){return this.http.get("/api/threads")}getThread(e){return this.http.get(`${this.getBaseUrl()}/${e}`)}createThread(e){let s=e?{name:e}:{};return this.http.post(this.getBaseUrl(),s)}updateThread(e,s){return this.http.put(`${this.getBaseUrl()}/${e}`,{name:s})}updateThreadUsers(e,s){return this.http.put(`${this.getBaseUrl()}/${e}`,{users:s})}starThread(e){return this.http.post(`${this.getBaseUrl()}/${e}/star`,{})}unstarThread(e){return this.http.delete(`${this.getBaseUrl()}/${e}/star`)}deleteThread(e){return this.http.delete(`${this.getBaseUrl()}/${e}`)}stopThread(e){return this.http.post(`${this.getBaseUrl()}/${e}/stop`,{})}getThreadMessages(e){return this.http.get(`${this.getBaseUrl()}/${e}/messages`)}static \u0275fac=function(s){return new(s||t)};static \u0275prov=S({token:t,factory:t.\u0275fac,providedIn:"root"})};function R(t,e=80){if(t.length<=e)return t;try{if(t.trim().startsWith("{")||t.trim().startsWith("[")){let s=JSON.parse(t),n=JSON.stringify(s);return n.length<=e?n:n.substring(0,e)+`...(${n.length} chars)`}}catch(s){}return t.substring(0,e)+"..."}var r=class{constructor(e,s){this.type=s;if(e.timestamp)this.timestamp=e.timestamp;else{let n=Math.random().toString(36).substring(2,7);this.timestamp=`${new Date().toISOString()}-${n}`}this.parentKey=e.parentKey,this.threadId=e.threadId,this.length=0}timestamp;parentKey;static type;length;threadId;get date(){let e=this.timestamp.lastIndexOf("-");if(e>0){let s=this.timestamp.substring(e+1);if(s.length===5&&/^[a-z0-9]+$/.test(s))return new Date(this.timestamp.substring(0,e))}return new Date(this.timestamp)}},v=class extends r{invite;constructor(e,s){super(e,s),this.invite=e.invite}buildAnswer(e){return new i({answer:e,parentKey:this.timestamp,invite:this.invite})}},T=class t extends r{static type="heartbeat";constructor(e){super(e,t.type)}},a=class t extends v{defaultValue;static type="invite";constructor(e){super(e,t.type),this.defaultValue=e.defaultValue}},K="InviteEventDefault",i=class t extends r{answer;invite;name;silent;static type="answer";constructor(e){super(e,t.type),this.answer=e.answer??"No answer",this.invite=e.invite,this.name=e.name,this.silent=e.silent}},p=class t extends r{speaker;text;static type="text";constructor(e){super(e,t.type),this.speaker=e.speaker,this.text=e.text}},b=class t extends r{chunk;static type="text_chunk";constructor(e){super(e,t.type),this.chunk=e.chunk,this.length=this.chunk.length}},g=class t extends r{warning;static type="warn";constructor(e){super(e,t.type),this.warning=e.warning}},h=class t extends r{error;static type="error";constructor(e){super(e,t.type),this.error=e.error}},c=class t extends v{options;optionalQuestion;allowFreeText;static type="choice";constructor(e){super(e,t.type),this.options=Array.isArray(e.options)?e.options:[],this.optionalQuestion=e.optionalQuestion,this.allowFreeText=e.allowFreeText??!1}},d=class t extends r{toolRequestId;name;args;static type="tool_request";constructor(e){super(e,t.type),this.toolRequestId=e.toolRequestId??this.timestamp,this.name=e.name,this.args=e.args,this.length=this.args.length+this.name.length+this.toolRequestId.length+20}buildResponse(e){return new o({output:e,toolRequestId:this.toolRequestId,parentKey:this.timestamp})}toSingleLineString(e=50){let s=R(this.args,e);return`\u{1F527} ${this.name}(${s})`}},o=class t extends r{toolRequestId;output;static type="tool_response";constructor(e){if(super(e,t.type),this.toolRequestId=e.toolRequestId||this.timestamp||new Date().toISOString(),this.output=e.output,typeof this.output=="string")this.length=this.output.length+this.toolRequestId.length+20;else if(this.output.type==="text")this.length=this.output.content.length+this.toolRequestId.length+20;else if(this.output.type==="image"){let s=(this.output.width??0)*(this.output.height??0)/750;this.length=(s?s*3.5:this.output.content.length)+this.toolRequestId.length+20}else this.length=this.toolRequestId.length+20}getTextOutput(){return typeof this.output=="string"?this.output:this.output.type==="text"?this.output.content:this.output.type==="image"?`[Image: ${this.output.mimeType}]`:""}toSingleLineString(e=50){let s=this.getTextOutput(),n=R(s,e),$=typeof this.output!="string"&&this.output.type==="image"?" [image]":"";return`\u2B91 ${n}${$}`}},f=class t extends r{static type="thinking";static debounce=5e3;constructor(e){super(e,t.type)}},l=class t extends r{summary;static type="summary";constructor(e){super(e,t.type),this.summary=e.summary,this.length=this.summary.length}toSingleLineString(e=80){return`\u{1F4CB} Summary: ${R(this.summary,e)}`}},u=class t extends r{role;name;content;static type="message";constructor(e){super(e,t.type),this.role=e.role,this.name=e.name,this.content=e.content,this.length=this.content.map(s=>{if(s.type==="text")return s.content.length;if(s.type==="image"){let n=(s.width||0)*(s.height||0)/750;return n?n*3.5:s.content.length}return s.type==="audio"?s.transcription?.length??100:0}).reduce((s,n)=>s+n,0)}getTextContent(){return this.content.filter(e=>e.type==="text").map(e=>e.content).join(`
2
2
  `)}},x=class t extends r{threadId;name;summary;users;static type="thread_update";constructor(e){super(e,t.type),this.threadId=e.threadId,this.name=e.name,this.summary=e.summary,this.users=e.users}},w=class t extends r{filename;operation;size;mimeType;static type="file";constructor(e){super(e,t.type),this.filename=e.filename,this.operation=e.operation,this.size=e.size,this.mimeType=e.mimeType}toSingleLineString(){let e=this.operation==="created"?"\u{1F4C4}":this.operation==="updated"?"\u{1F4DD}":"\u{1F5D1}\uFE0F",s=this.size?` (${(this.size/1024).toFixed(1)} KB)`:"";return`${e} ${this.operation}: ${this.filename}${s}`}},E=class t extends r{authUrl;state;integrationName;static type="oauth_request";constructor(e){super(e,t.type),this.authUrl=e.authUrl,this.state=e.state,this.integrationName=e.integrationName}},m=class t extends r{subThreadId;agentName;static type="delegation";constructor(e){super(e,t.type),this.subThreadId=e.subThreadId,this.agentName=e.agentName}},I=class t extends r{code;state;integrationName;error;errorDescription;static type="oauth_callback";constructor(e){super(e,t.type),this.code=e.code,this.state=e.state,this.integrationName=e.integrationName,this.error=e.error,this.errorDescription=e.errorDescription}},O={[u.type]:u,[i.type]:i,[c.type]:c,[m.type]:m,[h.type]:h,[T.type]:T,[a.type]:a,[d.type]:d,[o.type]:o,[p.type]:p,[b.type]:b,[f.type]:f,[g.type]:g,[x.type]:x,[l.type]:l,[w.type]:w,[E.type]:E,[I.type]:I};function q(t){let e=O[t.type];return e?new e(t):void 0}var Y=[{id:"builtin-plan",name:"plan",description:"Build a plan to complete the given task",source:"builtin",commands:[`@ We start a 3 phase process to build a comprehensive execution plan for the following task:
3
3
 
4
4
  <task>
@@ -267,4 +267,4 @@ Verify the memory system's overall health:
267
267
  - List any remaining issues or concerns
268
268
  - Provide recommendations for maintaining memory quality
269
269
 
270
- This ensures the memory system stays efficient and valuable.`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""}];var ue=[u.type,d.type,o.type,l.type,a.type,c.type,i.type,m.type];var M={CONFLUENCE:[],GIT:[],GIT_WORKTREE:[],GITLAB:[],JIRA:[],SLACK:[],ZENDESK:[],BASECAMP:[]},ke=Object.keys(M).filter(t=>M[t]?.length===0);export{P as a,T as b,a as c,W as d,i as e,p as f,b as g,g as h,h as i,c as j,d as k,o as l,f as m,u as n,x as o,w as p,E as q,m as r,I as s,q as t};
270
+ This ensures the memory system stays efficient and valuable.`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""}];var ue=[u.type,d.type,o.type,l.type,a.type,c.type,i.type,m.type];var M={CONFLUENCE:[],GIT:[],GIT_WORKTREE:[],GITLAB:[],JIRA:[],SLACK:[],ZENDESK:[],BASECAMP:[]},ke=Object.keys(M).filter(t=>M[t]?.length===0);export{P as a,T as b,a as c,K as d,i as e,p as f,b as g,g as h,h as i,c as j,d as k,o as l,f as m,u as n,x as o,w as p,E as q,m as r,I as s,q as t};
@@ -1 +1 @@
1
- import{a as re,b as ne,c as D}from"./chunk-7MXZXY4I.js";import{a as oe,c as ie}from"./chunk-23SYUINW.js";import{a as C,b as B}from"./chunk-ESGUJDS6.js";import{a as Q,b as X}from"./chunk-HCG45H7O.js";import{a as G,d as Z,o as ee,t as te}from"./chunk-EWEA7F46.js";import{d as K}from"./chunk-QWMDAFBN.js";import"./chunk-UKAN3Y3I.js";import"./chunk-ZAM3WGZM.js";import"./chunk-AK6F2DC7.js";import{a as _,b as f}from"./chunk-AJOXSD6I.js";import"./chunk-DRBOHCTP.js";import"./chunk-IXD43YQI.js";import{a as H,b as W}from"./chunk-WPC6XC7P.js";import"./chunk-XJUBZLY2.js";import{a as Y,b as P}from"./chunk-XIQ3L6H6.js";import{Q as U,S as J}from"./chunk-B2QA6UZX.js";import{Bb as S,Db as h,Fb as l,Ka as p,Rb as N,T as A,Tb as c,Ub as v,Vb as z,Wa as L,Z as w,ca as d,ga as m,h as V,ha as u,jb as $,kc as k,lb as b,ma as I,mb as x,pb as y,qb as T,rb as O,sb as s,t as q,ta as F,tb as a,ub as E}from"./chunk-3JGMGRXW.js";var M=class r{threadState=d(C);codayService=d(oe);threadList=f(this.threadState.threadList$,{initialValue:[]});selectedThread=f(this.threadState.selectedThread$,{initialValue:null});isThinking=f(this.codayService.isThinking$,{initialValue:!1});inviteEvent=f(this.codayService.currentInviteEvent$.pipe(q(t=>t?.invite===Z?null:t)),{initialValue:null});tasks=k(()=>{let t=this.threadList(),e=this.selectedThread(),n=this.isThinking(),i=this.inviteEvent();return t.filter(o=>!o.parentThreadId).map(o=>{let g=!!e&&o.id===e.id;return{id:o.id,name:o.name,summary:o.summary,modifiedDate:o.modifiedDate,starring:o.starring??[],users:o.users??[],status:this.deriveStatus(o,g,n,!!i),isActive:g,worktreeProject:o.worktreeProject}}).sort((o,g)=>{let j=D[o.status]-D[g.status];return j!==0?j:o.modifiedDate>g.modifiedDate?-1:1})});deriveStatus(t,e,n,i){let o=Date.now()-new Date(t.modifiedDate).getTime();return t.closedByUser?"done":t.pendingInvite?"waiting-you":e?n?"in-progress":"paused":o<ne?"in-progress":"paused"}static \u0275fac=function(e){return new(e||r)};static \u0275prov=w({token:r,factory:r.\u0275fac,providedIn:"root"})};var R=class r{projectState=d(P);threadState=d(C);destroy$=new V;eventSource=null;currentProject=null;constructor(){this.projectState.selectedProject$.pipe(A(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 n=`/api/projects/${encodeURIComponent(t)}/event-stream`;console.log(`[PROJECT_SSE] Connecting to ${n}`),this.eventSource=new EventSource(n),this.eventSource.onmessage=i=>{try{let o=JSON.parse(i.data),g=te(o);if(!g)return;g instanceof ee&&(console.log("[PROJECT_SSE] ThreadUpdateEvent \u2014 refreshing thread list"),this.threadState.refreshThreadList())}catch(o){console.warn("[PROJECT_SSE] Failed to parse event:",o)}},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||r)};static \u0275prov=w({token:r,factory:r.\u0275fac,providedIn:"root"})};var ce=(r,t)=>t.key,de=(r,t)=>t.status,le=(r,t)=>t.id;function pe(r,t){r&1&&E(0,"mat-spinner",6)}function me(r,t){r&1&&(s(0,"mat-icon"),c(1,"add"),a())}function ue(r,t){if(r&1&&(s(0,"span",15),c(1),a()),r&2){let e=l().$implicit,n=l();p(),v(n.filterCounts()[e.key])}}function ge(r,t){if(r&1){let e=S();s(0,"button",13),h("click",function(){let i=m(e).$implicit,o=l();return u(o.setFilter(i.key))}),s(1,"mat-icon",14),c(2),a(),s(3,"span"),c(4),a(),b(5,ue,2,1,"span",15),a()}if(r&2){let e=t.$implicit,n=l();N("active",n.activeFilter()===e.key),$("aria-selected",n.activeFilter()===e.key),p(2),v(e.icon),p(2),v(e.label),p(),x(n.filterCounts()[e.key]>0?5:-1)}}function _e(r,t){r&1&&(s(0,"div",10),E(1,"mat-spinner",16),s(2,"p"),c(3,"Loading tasks\u2026"),a()())}function fe(r,t){if(r&1){let e=S();s(0,"p"),c(1,"No tasks yet. Start your first one!"),a(),s(2,"button",18),h("click",function(){m(e);let i=l(2);return u(i.createTask())}),s(3,"mat-icon"),c(4,"add"),a(),c(5," New Task "),a()}}function he(r,t){r&1&&(s(0,"p"),c(1,"No tasks in this category."),a())}function ve(r,t){if(r&1&&(s(0,"div",11)(1,"mat-icon",17),c(2,"rocket_launch"),a(),b(3,fe,6,0)(4,he,2,0,"p"),a()),r&2){let e=l();p(3),x(e.activeFilter()==="all"?3:4)}}function ke(r,t){if(r&1){let e=S();s(0,"app-task-card",24),h("stopRequested",function(i){m(e);let o=l(3);return u(o.onStopRequested(i))})("deleteRequested",function(i){m(e);let o=l(3);return u(o.onDeleteRequested(i))})("starToggled",function(i){m(e);let o=l(3);return u(o.onStarToggled(i))})("markDoneRequested",function(i){m(e);let o=l(3);return u(o.onMarkDoneRequested(i))})("markActiveRequested",function(i){m(e);let o=l(3);return u(o.onMarkActiveRequested(i))}),a()}if(r&2){let e=t.$implicit;O("task",e)}}function Ce(r,t){if(r&1&&(s(0,"section",19)(1,"h2",20)(2,"mat-icon",21),c(3),a(),c(4),s(5,"span",22),c(6),a()(),s(7,"div",12),y(8,ke,1,1,"app-task-card",23,le),a()()),r&2){let e=t.$implicit;p(3),v(e.icon),p(),z(" ",e.label," "),p(2),v(e.tasks.length),p(2),T(e.tasks)}}function be(r,t){if(r&1&&y(0,Ce,10,3,"section",19,de),r&2){let e=l();T(e.taskGroups())}}function xe(r,t){if(r&1){let e=S();s(0,"app-task-card",24),h("stopRequested",function(i){m(e);let o=l(2);return u(o.onStopRequested(i))})("deleteRequested",function(i){m(e);let o=l(2);return u(o.onDeleteRequested(i))})("starToggled",function(i){m(e);let o=l(2);return u(o.onStarToggled(i))})("markDoneRequested",function(i){m(e);let o=l(2);return u(o.onMarkDoneRequested(i))})("markActiveRequested",function(i){m(e);let o=l(2);return u(o.onMarkActiveRequested(i))}),a()}if(r&2){let e=t.$implicit;O("task",e)}}function ye(r,t){if(r&1&&(s(0,"div",12),y(1,xe,1,1,"app-task-card",23,le),a()),r&2){let e=l();p(),T(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 r{router=d(K);projectState=d(P);threadState=d(C);threadApi=d(G);taskStatus=d(M);userService=d(B);projectApi=d(Y);destroyRef=d(I);_projectEventStream=d(R);filters=Te;activeFilter=F("all");isCreating=F(!1);isLoadingList=f(this.threadState.isLoadingThreadList$,{initialValue:!1});username=f(this.userService.username$,{initialValue:null});allTasks=this.taskStatus.tasks;filteredTasks=k(()=>{let t=this.activeFilter(),e=this.allTasks();return t==="all"?e:e.filter(n=>n.status===t)});filterCounts=k(()=>{let t=this.allTasks();return{all:t.length,"waiting-you":t.filter(e=>e.status==="waiting-you").length,"in-progress":t.filter(e=>e.status==="in-progress").length,paused:t.filter(e=>e.status==="paused").length,done:t.filter(e=>e.status==="done").length}});taskGroups=k(()=>{let t=this.allTasks(),e=[{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 n of t){let i=e.find(o=>o.status===n.status);i&&i.tasks.push(n)}return e.filter(n=>n.tasks.length>0)});ngOnInit(){this.userService.fetchCurrentUser().pipe(_(this.destroyRef)).subscribe({error:t=>console.warn("[TASK-CONTROL] Could not fetch user:",t)})}setFilter(t){this.activeFilter.set(t)}createTask(){let t=this.projectState.getSelectedProjectId();!t||this.isCreating()||(this.isCreating.set(!0),this.threadApi.createThread().pipe(_(this.destroyRef)).subscribe({next:e=>{this.isCreating.set(!1),this.router.navigate(["project",t,"thread",e.thread.id])},error:e=>{console.error("[TASK-CONTROL] Failed to create thread:",e),this.isCreating.set(!1)}}))}onStopRequested(t){this.threadApi.stopThread(t).pipe(_(this.destroyRef)).subscribe({error:e=>console.error("[TASK-CONTROL] Failed to stop thread:",e)})}onDeleteRequested(t){this.threadApi.deleteThread(t).pipe(_(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 n=this.allTasks().find(g=>g.id===t);if(!n)return;let i=n.starring.includes(e),o=i?this.threadApi.unstarThread(t):this.threadApi.starThread(t);this.threadState.updateStarLocal(t,!i,e),o.pipe(_(this.destroyRef)).subscribe({error:g=>{console.error("[TASK-CONTROL] Failed to toggle star:",g),this.threadState.refreshThreadList()}})}onMarkDoneRequested(t){let e=this.projectState.getSelectedProjectId();e&&this.projectApi.markThreadDone(e,t).pipe(_(this.destroyRef)).subscribe({next:()=>this.threadState.refreshThreadList(),error:n=>console.error("[TASK-CONTROL] Failed to mark task as done:",n)})}onMarkActiveRequested(t){let e=this.projectState.getSelectedProjectId();e&&this.projectApi.markThreadActive(e,t).pipe(_(this.destroyRef)).subscribe({next:()=>this.threadState.refreshThreadList(),error:n=>console.error("[TASK-CONTROL] Failed to mark task as active:",n)})}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=L({type:r,selectors:[["app-task-control"]],decls:20,vars:3,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"],[1,"tc-grid-wrapper"],[1,"tc-loading"],[1,"tc-empty"],[1,"tc-grid"],["role","tab",1,"filter-chip",3,"click"],[1,"filter-icon"],[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,n){e&1&&(s(0,"app-sidenav")(1,"div",0)(2,"header",1)(3,"div",2)(4,"h1",3)(5,"mat-icon",4),c(6,"rocket_launch"),a(),c(7," Task Control "),a(),s(8,"button",5),h("click",function(){return n.createTask()}),b(9,pe,1,0,"mat-spinner",6)(10,me,2,0,"mat-icon"),c(11," New Task "),a()(),s(12,"nav",7),y(13,ge,6,6,"button",8,ce),a()(),s(15,"main",9),b(16,_e,4,0,"div",10)(17,ve,5,1,"div",11)(18,be,2,0)(19,ye,3,0,"div",12),a()()()),e&2&&(p(8),O("disabled",n.isCreating()),p(),x(n.isCreating()?9:10),p(4),T(n.filters),p(3),x(n.isLoadingList()?16:n.filteredTasks().length===0?17:n.activeFilter()==="all"?18:19))},dependencies:[re,ie,W,H,J,U,X,Q],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)}.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}"],changeDetection:0})};export{se as TaskControlComponent};
1
+ import{a as re,b as ne,c as D}from"./chunk-7MXZXY4I.js";import{a as oe,c as ie}from"./chunk-EZOSEC5V.js";import{a as C,b as B}from"./chunk-EKBLXJOJ.js";import{a as Q,b as X}from"./chunk-HCG45H7O.js";import{a as G,d as Z,o as ee,t as te}from"./chunk-JG37UR26.js";import{d as K}from"./chunk-QWMDAFBN.js";import"./chunk-UKAN3Y3I.js";import"./chunk-ZAM3WGZM.js";import"./chunk-AK6F2DC7.js";import{a as _,b as f}from"./chunk-AJOXSD6I.js";import"./chunk-DRBOHCTP.js";import"./chunk-IXD43YQI.js";import{a as H,b as W}from"./chunk-WPC6XC7P.js";import"./chunk-XJUBZLY2.js";import{a as Y,b as P}from"./chunk-XIQ3L6H6.js";import{Q as U,S as J}from"./chunk-B2QA6UZX.js";import{Bb as S,Db as h,Fb as l,Ka as p,Rb as N,T as A,Tb as c,Ub as v,Vb as z,Wa as L,Z as w,ca as d,ga as m,h as V,ha as u,jb as $,kc as k,lb as b,ma as I,mb as x,pb as y,qb as T,rb as O,sb as s,t as q,ta as F,tb as a,ub as E}from"./chunk-3JGMGRXW.js";var M=class r{threadState=d(C);codayService=d(oe);threadList=f(this.threadState.threadList$,{initialValue:[]});selectedThread=f(this.threadState.selectedThread$,{initialValue:null});isThinking=f(this.codayService.isThinking$,{initialValue:!1});inviteEvent=f(this.codayService.currentInviteEvent$.pipe(q(t=>t?.invite===Z?null:t)),{initialValue:null});tasks=k(()=>{let t=this.threadList(),e=this.selectedThread(),n=this.isThinking(),i=this.inviteEvent();return t.filter(o=>!o.parentThreadId).map(o=>{let g=!!e&&o.id===e.id;return{id:o.id,name:o.name,summary:o.summary,modifiedDate:o.modifiedDate,starring:o.starring??[],users:o.users??[],status:this.deriveStatus(o,g,n,!!i),isActive:g,worktreeProject:o.worktreeProject}}).sort((o,g)=>{let j=D[o.status]-D[g.status];return j!==0?j:o.modifiedDate>g.modifiedDate?-1:1})});deriveStatus(t,e,n,i){let o=Date.now()-new Date(t.modifiedDate).getTime();return t.closedByUser?"done":t.pendingInvite?"waiting-you":e?n?"in-progress":"paused":o<ne?"in-progress":"paused"}static \u0275fac=function(e){return new(e||r)};static \u0275prov=w({token:r,factory:r.\u0275fac,providedIn:"root"})};var R=class r{projectState=d(P);threadState=d(C);destroy$=new V;eventSource=null;currentProject=null;constructor(){this.projectState.selectedProject$.pipe(A(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 n=`/api/projects/${encodeURIComponent(t)}/event-stream`;console.log(`[PROJECT_SSE] Connecting to ${n}`),this.eventSource=new EventSource(n),this.eventSource.onmessage=i=>{try{let o=JSON.parse(i.data),g=te(o);if(!g)return;g instanceof ee&&(console.log("[PROJECT_SSE] ThreadUpdateEvent \u2014 refreshing thread list"),this.threadState.refreshThreadList())}catch(o){console.warn("[PROJECT_SSE] Failed to parse event:",o)}},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||r)};static \u0275prov=w({token:r,factory:r.\u0275fac,providedIn:"root"})};var ce=(r,t)=>t.key,de=(r,t)=>t.status,le=(r,t)=>t.id;function pe(r,t){r&1&&E(0,"mat-spinner",6)}function me(r,t){r&1&&(s(0,"mat-icon"),c(1,"add"),a())}function ue(r,t){if(r&1&&(s(0,"span",15),c(1),a()),r&2){let e=l().$implicit,n=l();p(),v(n.filterCounts()[e.key])}}function ge(r,t){if(r&1){let e=S();s(0,"button",13),h("click",function(){let i=m(e).$implicit,o=l();return u(o.setFilter(i.key))}),s(1,"mat-icon",14),c(2),a(),s(3,"span"),c(4),a(),b(5,ue,2,1,"span",15),a()}if(r&2){let e=t.$implicit,n=l();N("active",n.activeFilter()===e.key),$("aria-selected",n.activeFilter()===e.key),p(2),v(e.icon),p(2),v(e.label),p(),x(n.filterCounts()[e.key]>0?5:-1)}}function _e(r,t){r&1&&(s(0,"div",10),E(1,"mat-spinner",16),s(2,"p"),c(3,"Loading tasks\u2026"),a()())}function fe(r,t){if(r&1){let e=S();s(0,"p"),c(1,"No tasks yet. Start your first one!"),a(),s(2,"button",18),h("click",function(){m(e);let i=l(2);return u(i.createTask())}),s(3,"mat-icon"),c(4,"add"),a(),c(5," New Task "),a()}}function he(r,t){r&1&&(s(0,"p"),c(1,"No tasks in this category."),a())}function ve(r,t){if(r&1&&(s(0,"div",11)(1,"mat-icon",17),c(2,"rocket_launch"),a(),b(3,fe,6,0)(4,he,2,0,"p"),a()),r&2){let e=l();p(3),x(e.activeFilter()==="all"?3:4)}}function ke(r,t){if(r&1){let e=S();s(0,"app-task-card",24),h("stopRequested",function(i){m(e);let o=l(3);return u(o.onStopRequested(i))})("deleteRequested",function(i){m(e);let o=l(3);return u(o.onDeleteRequested(i))})("starToggled",function(i){m(e);let o=l(3);return u(o.onStarToggled(i))})("markDoneRequested",function(i){m(e);let o=l(3);return u(o.onMarkDoneRequested(i))})("markActiveRequested",function(i){m(e);let o=l(3);return u(o.onMarkActiveRequested(i))}),a()}if(r&2){let e=t.$implicit;O("task",e)}}function Ce(r,t){if(r&1&&(s(0,"section",19)(1,"h2",20)(2,"mat-icon",21),c(3),a(),c(4),s(5,"span",22),c(6),a()(),s(7,"div",12),y(8,ke,1,1,"app-task-card",23,le),a()()),r&2){let e=t.$implicit;p(3),v(e.icon),p(),z(" ",e.label," "),p(2),v(e.tasks.length),p(2),T(e.tasks)}}function be(r,t){if(r&1&&y(0,Ce,10,3,"section",19,de),r&2){let e=l();T(e.taskGroups())}}function xe(r,t){if(r&1){let e=S();s(0,"app-task-card",24),h("stopRequested",function(i){m(e);let o=l(2);return u(o.onStopRequested(i))})("deleteRequested",function(i){m(e);let o=l(2);return u(o.onDeleteRequested(i))})("starToggled",function(i){m(e);let o=l(2);return u(o.onStarToggled(i))})("markDoneRequested",function(i){m(e);let o=l(2);return u(o.onMarkDoneRequested(i))})("markActiveRequested",function(i){m(e);let o=l(2);return u(o.onMarkActiveRequested(i))}),a()}if(r&2){let e=t.$implicit;O("task",e)}}function ye(r,t){if(r&1&&(s(0,"div",12),y(1,xe,1,1,"app-task-card",23,le),a()),r&2){let e=l();p(),T(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 r{router=d(K);projectState=d(P);threadState=d(C);threadApi=d(G);taskStatus=d(M);userService=d(B);projectApi=d(Y);destroyRef=d(I);_projectEventStream=d(R);filters=Te;activeFilter=F("all");isCreating=F(!1);isLoadingList=f(this.threadState.isLoadingThreadList$,{initialValue:!1});username=f(this.userService.username$,{initialValue:null});allTasks=this.taskStatus.tasks;filteredTasks=k(()=>{let t=this.activeFilter(),e=this.allTasks();return t==="all"?e:e.filter(n=>n.status===t)});filterCounts=k(()=>{let t=this.allTasks();return{all:t.length,"waiting-you":t.filter(e=>e.status==="waiting-you").length,"in-progress":t.filter(e=>e.status==="in-progress").length,paused:t.filter(e=>e.status==="paused").length,done:t.filter(e=>e.status==="done").length}});taskGroups=k(()=>{let t=this.allTasks(),e=[{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 n of t){let i=e.find(o=>o.status===n.status);i&&i.tasks.push(n)}return e.filter(n=>n.tasks.length>0)});ngOnInit(){this.userService.fetchCurrentUser().pipe(_(this.destroyRef)).subscribe({error:t=>console.warn("[TASK-CONTROL] Could not fetch user:",t)})}setFilter(t){this.activeFilter.set(t)}createTask(){let t=this.projectState.getSelectedProjectId();!t||this.isCreating()||(this.isCreating.set(!0),this.threadApi.createThread().pipe(_(this.destroyRef)).subscribe({next:e=>{this.isCreating.set(!1),this.router.navigate(["project",t,"thread",e.thread.id])},error:e=>{console.error("[TASK-CONTROL] Failed to create thread:",e),this.isCreating.set(!1)}}))}onStopRequested(t){this.threadApi.stopThread(t).pipe(_(this.destroyRef)).subscribe({error:e=>console.error("[TASK-CONTROL] Failed to stop thread:",e)})}onDeleteRequested(t){this.threadApi.deleteThread(t).pipe(_(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 n=this.allTasks().find(g=>g.id===t);if(!n)return;let i=n.starring.includes(e),o=i?this.threadApi.unstarThread(t):this.threadApi.starThread(t);this.threadState.updateStarLocal(t,!i,e),o.pipe(_(this.destroyRef)).subscribe({error:g=>{console.error("[TASK-CONTROL] Failed to toggle star:",g),this.threadState.refreshThreadList()}})}onMarkDoneRequested(t){let e=this.projectState.getSelectedProjectId();e&&this.projectApi.markThreadDone(e,t).pipe(_(this.destroyRef)).subscribe({next:()=>this.threadState.refreshThreadList(),error:n=>console.error("[TASK-CONTROL] Failed to mark task as done:",n)})}onMarkActiveRequested(t){let e=this.projectState.getSelectedProjectId();e&&this.projectApi.markThreadActive(e,t).pipe(_(this.destroyRef)).subscribe({next:()=>this.threadState.refreshThreadList(),error:n=>console.error("[TASK-CONTROL] Failed to mark task as active:",n)})}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=L({type:r,selectors:[["app-task-control"]],decls:20,vars:3,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"],[1,"tc-grid-wrapper"],[1,"tc-loading"],[1,"tc-empty"],[1,"tc-grid"],["role","tab",1,"filter-chip",3,"click"],[1,"filter-icon"],[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,n){e&1&&(s(0,"app-sidenav")(1,"div",0)(2,"header",1)(3,"div",2)(4,"h1",3)(5,"mat-icon",4),c(6,"rocket_launch"),a(),c(7," Task Control "),a(),s(8,"button",5),h("click",function(){return n.createTask()}),b(9,pe,1,0,"mat-spinner",6)(10,me,2,0,"mat-icon"),c(11," New Task "),a()(),s(12,"nav",7),y(13,ge,6,6,"button",8,ce),a()(),s(15,"main",9),b(16,_e,4,0,"div",10)(17,ve,5,1,"div",11)(18,be,2,0)(19,ye,3,0,"div",12),a()()()),e&2&&(p(8),O("disabled",n.isCreating()),p(),x(n.isCreating()?9:10),p(4),T(n.filters),p(3),x(n.isLoadingList()?16:n.filteredTasks().length===0?17:n.activeFilter()==="all"?18:19))},dependencies:[re,ie,W,H,J,U,X,Q],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)}.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}"],changeDetection:0})};export{se as TaskControlComponent};