@whoz-oss/coday-client 1.2.2 → 1.3.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.
Files changed (88) hide show
  1. package/browser/{chunk-B_IHIoXy.js → chunk-20v-HoGw.js} +1 -1
  2. package/browser/chunk-B4CKPT8-.js +1 -0
  3. package/browser/chunk-B4iDNUj6.js +1 -0
  4. package/browser/chunk-B9gLRfDm.js +1 -0
  5. package/browser/{chunk-DeUJR8VL.js → chunk-BBJc_ez4.js} +1 -1
  6. package/browser/{chunk-COuPnuWl.js → chunk-BGeY6TJl.js} +1 -1
  7. package/browser/{chunk-D8NRH963.js → chunk-BIEjPnD4.js} +1 -1
  8. package/browser/{chunk-Dnh87Bnp.js → chunk-BPJe1_uM.js} +1 -1
  9. package/browser/{chunk-CwcjLl23.js → chunk-BQ2Vio1f.js} +1 -1
  10. package/browser/chunk-BUhtdVBd.js +1 -0
  11. package/browser/{chunk-Bt9wZSAw.js → chunk-BWc0GaFw.js} +1 -1
  12. package/browser/{chunk-DfY4WxHh.js → chunk-BXQCdGUa.js} +1 -1
  13. package/browser/{chunk-SRb3rnAs.js → chunk-BXiOP6ZW.js} +1 -1
  14. package/browser/{chunk-BHIMjX2L.js → chunk-Balbg-lh.js} +1 -1
  15. package/browser/{chunk-CLjMzM1F.js → chunk-BdWvjltK.js} +1 -1
  16. package/browser/chunk-BemBoNs5.js +1 -0
  17. package/browser/chunk-Bh7gCjj4.js +1 -0
  18. package/browser/{chunk-_mwMNDBZ.js → chunk-Bh_9bCDZ.js} +1 -1
  19. package/browser/{chunk-SZxCBMtv.js → chunk-Bi1D1MPS.js} +1 -1
  20. package/browser/{chunk-CThawlq-.js → chunk-BjDDtMsE.js} +1 -1
  21. package/browser/{chunk-DNuI5ZLP.js → chunk-BmjhXCgH.js} +1 -1
  22. package/browser/{chunk-UcdLpjjz.js → chunk-BovznIFZ.js} +2 -2
  23. package/browser/chunk-BpA60NxS.js +1 -0
  24. package/browser/{chunk-r9UpFUCU.js → chunk-BptxX0h6.js} +1 -1
  25. package/browser/{chunk-Bc_IY1Pz.js → chunk-BtYN6RGw.js} +1 -1
  26. package/browser/{chunk-oqnP7rKK.js → chunk-C2TRQfu4.js} +1 -1
  27. package/browser/{chunk-Di7fNC0o.js → chunk-C7-Gy0Uz.js} +1 -1
  28. package/browser/{chunk-BaG8ayeQ.js → chunk-CFvRU8Pw.js} +1 -1
  29. package/browser/{chunk-BwAT4jgv.js → chunk-CNMTF87H.js} +1 -1
  30. package/browser/chunk-CRuFXEnP.js +1 -0
  31. package/browser/chunk-CW742eC7.js +9 -0
  32. package/browser/{chunk-D5Wauxj3.js → chunk-CZ6ILxDX.js} +1 -1
  33. package/browser/chunk-C_7QzTv7.js +1 -0
  34. package/browser/{chunk-CbeOpZJP.js → chunk-CaxOrx5M.js} +1 -1
  35. package/browser/{chunk-BqpYQimE.js → chunk-CcTN_TUb.js} +1 -1
  36. package/browser/chunk-Cdu5JsaS.js +1 -0
  37. package/browser/{chunk-Li4hBsDL.js → chunk-CeRWUb5g.js} +1 -1
  38. package/browser/{chunk-BLyTJSkT.js → chunk-CiWRvj1N.js} +1 -1
  39. package/browser/{chunk-BIOUDJ0F.js → chunk-Ckk6G7IP.js} +1 -1
  40. package/browser/chunk-CmmK8635.js +1 -0
  41. package/browser/{chunk-kVgSKSo7.js → chunk-CteHmI07.js} +1 -1
  42. package/browser/{chunk-BN30pivM.js → chunk-CyEZHdnA.js} +1 -1
  43. package/browser/chunk-D0tFEYpV.js +1 -0
  44. package/browser/{chunk-D5yEKva-.js → chunk-D5NtIZG6.js} +1 -1
  45. package/browser/{chunk-pPKjcmZw.js → chunk-DEhf9VBD.js} +2 -2
  46. package/browser/{chunk-DXCUsjC1.js → chunk-DGa4-UJW.js} +1 -1
  47. package/browser/chunk-DJOhzAbC.js +1 -0
  48. package/browser/{chunk-BPZiEPAR.js → chunk-DUczAw5C.js} +2 -2
  49. package/browser/chunk-DeVzkEKK.js +1 -0
  50. package/browser/{chunk-BJZWmRHp.js → chunk-DlFFzFSe.js} +1 -1
  51. package/browser/{chunk-_c2NJLKH.js → chunk-DvC7mEoN.js} +1 -1
  52. package/browser/{chunk-DDAJWWdu.js → chunk-DwB1vH9w.js} +1 -1
  53. package/browser/{chunk-Dt8jPmaF.js → chunk-DzuMSf1O.js} +1 -1
  54. package/browser/{chunk-Cr3JLHIQ.js → chunk-E8b2_4uB.js} +1 -1
  55. package/browser/chunk-G4MCwSm-.js +1 -0
  56. package/browser/chunk-RbE7PtJh.js +675 -0
  57. package/browser/{chunk-WLJnnpyn.js → chunk-SiAnBXor.js} +1 -1
  58. package/browser/chunk-SlWicxh3.js +1 -0
  59. package/browser/{chunk-R3xzoDPf.js → chunk-TBsNfd0k.js} +1 -1
  60. package/browser/{chunk-ChVyBWZx.js → chunk-ZTE9Vro-.js} +1 -1
  61. package/browser/{chunk-FwtCmWET.js → chunk-_PndMs0h.js} +1 -1
  62. package/browser/{chunk-DQd46-bX.js → chunk-eTAQJYle.js} +1 -1
  63. package/browser/{chunk-BQlMqtrZ.js → chunk-nSxfGVc8.js} +1 -1
  64. package/browser/chunk-n_Kgbuh3.js +1 -0
  65. package/browser/{chunk-D8t3UIqI.js → chunk-spTKcuel.js} +1 -1
  66. package/browser/{chunk-C3d0WplP.js → chunk-x7Suyrio.js} +1 -1
  67. package/browser/index.html +1 -1
  68. package/browser/{main-SESULK5A.js → main-DXWHG4XK.js} +1 -1
  69. package/package.json +1 -1
  70. package/browser/chunk-8pAL3TTw.js +0 -1
  71. package/browser/chunk-B7cU3-SJ.js +0 -1
  72. package/browser/chunk-BT1y4-QA.js +0 -1
  73. package/browser/chunk-BvkvQ5HD.js +0 -1
  74. package/browser/chunk-CWywI4c2.js +0 -1
  75. package/browser/chunk-CWzYMkED.js +0 -1
  76. package/browser/chunk-CXrwBUrc.js +0 -1
  77. package/browser/chunk-CY_VVARD.js +0 -1
  78. package/browser/chunk-CYotDxgg.js +0 -1
  79. package/browser/chunk-CzQWzZ8j.js +0 -1
  80. package/browser/chunk-D0hisJ4J.js +0 -1
  81. package/browser/chunk-DQkoGfMI.js +0 -1
  82. package/browser/chunk-DmT3W6Cu.js +0 -1
  83. package/browser/chunk-Dp9-5_qE.js +0 -1
  84. package/browser/chunk-EV20uCJe.js +0 -1
  85. package/browser/chunk-iBjrbq39.js +0 -7
  86. package/browser/chunk-irfXtcc2.js +0 -1
  87. package/browser/chunk-tdsKNlom.js +0 -1
  88. package/browser/chunk-wt1fF7Ba.js +0 -675
@@ -1 +0,0 @@
1
- import {I}from'./chunk-BwAT4jgv.js';import {g,ao as V$1,G as G$1,w as we,de as B,dd as $,aI as Tr,bR as ma,Q as By,a7 as ga,S as ha,u as ue,b as U$1,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,a9 as dC,aa as If,ab as wf,ag as fT}from'./main-SESULK5A.js';import {W as Wn,S as Se}from'./chunk-wt1fF7Ba.js';import'./chunk-BIOUDJ0F.js';import'./chunk-DeUJR8VL.js';var V=()=>[];function K(n,t){if(n&1){let i=dC();vs(0,"agentos-ai-model-item",4),Ag("deleteRequested",function(a){If(i);let e=mC(2);return wf(e.deleteModel(a))})("editRequested",function(a){If(i);let e=mC(2);return wf(e.editModel(a))}),fl();}if(n&2){let i=mC().$implicit,o=mC();Tg("model",t)("namespaceId",o.namespaceId)("readOnly",o.isPlatformModel(i.id));}}function U(n,t){if(n&1&&eC(0,K,1,3,"agentos-ai-model-item",3),n&2){let i,o=t.$implicit,a=mC();tC((i=a.resolveModel(o.id))?0:-1,i);}}var j="__platform__",G="Platform (read-only)",F=class n{route=g(V$1);router=g(G$1);destroyRef=g(we);aiModelController=g(B);aiProviderController=g($);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new Tr(void 0);data$=this.refresh$.pipe(ma(()=>By({namespace:this.aiModelController.listByNamespaceIdAiModel(this.namespaceId),platform:this.aiModelController.listPlatformLevelAiModel().pipe(ga(()=>ha([]))),providers:this.aiProviderController.listAiProvider(this.namespaceId)})));modelItems$=this.data$.pipe(ue(({namespace:t,platform:i,providers:o})=>{let a=new Map(o.map(e=>[e.id??"",e.name]));return [...i.map(e=>({id:e.id??"",name:e.alias??e.apiModelName,description:e.apiModelName,groupKey:j,groupLabel:G})),...t.map(e=>({id:e.id??"",name:e.alias??e.apiModelName,description:e.apiModelName,groupKey:e.aiProviderId,groupLabel:a.get(e.aiProviderId)??e.aiProviderId}))]}));namespaceModelsById=new Map;platformModelsById=new Map;constructor(){this.data$.pipe(U$1(this.destroyRef)).subscribe(({namespace:t,platform:i})=>{this.namespaceModelsById=new Map(t.map(o=>[o.id??"",o])),this.platformModelsById=new Map(i.map(o=>[o.id??"",o]));});}goBack(){this.router.navigate(["/agentos","namespaces"]);}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-models","new"]);}editModel(t){this.router.navigate(["/agentos",this.namespaceId,"ai-models",t.id,"edit"]);}deleteModel(t){this.aiModelController.deleteAiModel(t.id??"").pipe(U$1(this.destroyRef)).subscribe(()=>this.refresh$.next());}resolveModel(t){return this.namespaceModelsById.get(t)??this.platformModelsById.get(t)??null}isPlatformModel(t){return this.platformModelsById.has(t)}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=Aw({type:n,selectors:[["agentos-namespace-ai-models"]],decls:5,vars:6,consts:[["aiModelItemTpl",""],["title","AI models","emptyMessage","No AI models configured yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"model","namespaceId","readOnly"],[3,"deleteRequested","editRequested","model","namespaceId","readOnly"]],template:function(i,o){if(i&1&&(vs(0,"ds-entity-list",1),aT(1,"async"),Ag("createRequested",function(){return o.openCreateForm()}),vs(2,"ds-icon-button",2),Ag("action",function(){return o.goBack()}),fl()(),Dg(3,U,1,1,"ng-template",null,0,fT)),i&2){let a=TC(4);Tg("items",uT(1,3,o.modelItems$)??rT(5,V))("showCreate",true)("itemTemplate",a);}},dependencies:[Wn,I,Se,Nb],encapsulation:2})};export{F as NamespaceAiModelsComponent};
@@ -1 +0,0 @@
1
- import {R}from'./chunk-DXCUsjC1.js';import {c}from'./chunk-_mwMNDBZ.js';import {g,ao as V$1,G,w as we,H as Hi,m as mT,Q as By,a7 as ga,S as ha,b as U,A as Aw,v as vs,l as Ag,k as fl,af as Dg,T as TC,r as Tg,n as eC,ac as mC,t as tC,a9 as dC,aa as If,ab as wf,ag as fT}from'./main-SESULK5A.js';import {W as Wn,S as Se}from'./chunk-wt1fF7Ba.js';import'./chunk-BIOUDJ0F.js';import'./chunk-DeUJR8VL.js';function V(i,e){if(i&1){let t=dC();vs(0,"agentos-scheduled-prompt-item",4),Ag("enableRequested",function(n){If(t);let s=mC(2);return wf(s.enablePrompt(n))})("disableRequested",function(n){If(t);let s=mC(2);return wf(s.disablePrompt(n))})("deleteRequested",function(n){If(t);let s=mC(2);return wf(s.deletePrompt(n))}),fl();}if(i&2){let t=mC().$implicit,o=mC();Tg("definition",e)("namespaceId",o.namespaceId)("readOnly",o.isPlatformPrompt(t.id));}}function k(i,e){if(i&1&&eC(0,V,1,3,"agentos-scheduled-prompt-item",3),i&2){let t,o=e.$implicit,n=mC();tC((t=n.resolvePrompt(o.id))?0:-1,t);}}var O="platform",B="namespace",M=class i{route=g(V$1);router=g(G);destroyRef=g(we);state=g(c);namespaceId=this.route.snapshot.params.namespaceId;platformPrompts=Hi([]);namespacePrompts=Hi([]);promptItems=mT(()=>[...this.platformPrompts().map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:O,groupLabel:"Platform (read-only)",badges:[{label:e.enabled?"Enabled":"Disabled",variant:e.enabled?"success":"warning"}]})),...this.namespacePrompts().map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:B,groupLabel:"Namespace",badges:[{label:e.enabled?"Enabled":"Disabled",variant:e.enabled?"success":"warning"}]}))]);constructor(){By({platform:this.state.listPlatform().pipe(ga(()=>ha([]))),namespace:this.state.listByNamespace(this.namespaceId)}).pipe(U(this.destroyRef)).subscribe(({platform:e,namespace:t})=>{this.platformPrompts.set(e),this.namespacePrompts.set(t);});}goBack(){this.router.navigate(["/agentos","namespaces"]);}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts","new"]);}enablePrompt(e){this.state.enable(e.id??"").pipe(U(this.destroyRef)).subscribe(t=>this.patchNamespacePrompt(t));}disablePrompt(e){this.state.disable(e.id??"").pipe(U(this.destroyRef)).subscribe(t=>this.patchNamespacePrompt(t));}deletePrompt(e){let t=e.id??"";this.state.delete(t).pipe(U(this.destroyRef)).subscribe(()=>this.namespacePrompts.update(o=>o.filter(n=>n.id!==t)));}resolvePrompt(e){return this.platformPrompts().find(t=>t.id===e)??this.namespacePrompts().find(t=>t.id===e)??null}isPlatformPrompt(e){return this.platformPrompts().some(t=>t.id===e)}patchNamespacePrompt(e){this.namespacePrompts.update(t=>t.map(o=>o.id===e.id?e:o));}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=Aw({type:i,selectors:[["agentos-scheduled-prompt-list"]],decls:4,vars:3,consts:[["scheduledPromptItemTpl",""],["title","Scheduled Prompts","emptyMessage","No scheduled prompts yet. Create one to get started.","cardMinWidth","420px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"definition","namespaceId","readOnly"],[3,"enableRequested","disableRequested","deleteRequested","definition","namespaceId","readOnly"]],template:function(t,o){if(t&1&&(vs(0,"ds-entity-list",1),Ag("createRequested",function(){return o.openCreateForm()}),vs(1,"ds-icon-button",2),Ag("action",function(){return o.goBack()}),fl()(),Dg(2,k,1,1,"ng-template",null,0,fT)),t&2){let n=TC(3);Tg("items",o.promptItems())("showCreate",true)("itemTemplate",n);}},dependencies:[Wn,R,Se],encapsulation:2})};export{M as ScheduledPromptListComponent};
@@ -1 +0,0 @@
1
- import {n}from'./chunk-CfgXrte_.js';import {O}from'./chunk-DQd46-bX.js';import {S}from'./chunk-Dt8jPmaF.js';import {v}from'./chunk-B_IHIoXy.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-SESULK5A.js';import'./chunk-iBjrbq39.js';import {W as Wn,S as Se}from'./chunk-wt1fF7Ba.js';import'./chunk-BIOUDJ0F.js';import'./chunk-DeUJR8VL.js';import'./chunk-CWzYMkED.js';import'./chunk-FwtCmWET.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)));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=>{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:6,consts:[["aiProviderItemTpl",""],["title","AI Providers","emptyMessage","No AI providers available.","cardMinWidth","400px",3,"createRequested","items","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,3,i.listItems$)??rT(5,z))("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 +0,0 @@
1
- import {z}from'./chunk-Di7fNC0o.js';import {s}from'./chunk-C3d0WplP.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-SESULK5A.js';import'./chunk-Bc_IY1Pz.js';import {W as Wn,i as it}from'./chunk-wt1fF7Ba.js';import'./chunk-BIOUDJ0F.js';import {y as yt,w as wt}from'./chunk-DeUJR8VL.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 n=mC();return wf(n.onItemSelected(r))}),fl(),vs(2,"button",7),Ag("click",function(r){let n=If(o).$implicit,f=mC();return r.stopPropagation(),wf(f.onDeleteRequested(n.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});projectItems=mT(()=>{let t=this.projects();if(!t)return [];let o=t.filter(e=>!e.name.includes(g)),a=t.filter(e=>e.name.includes(g)),r=new Set(o.map(e=>e.name)),n=e=>e.split(g)[0]??null,f=new Set(a.map(e=>n(e.name)).filter(e=>e!==null&&r.has(e))),l=[],G=[...f].sort((e,i)=>e.localeCompare(i));for(let e of G){let i=o.find(c=>c.name===e);l.push(z$1(P$1({},this.toEntityListItem(i)),{groupKey:e,groupLabel:e}));let Z=a.filter(c=>n(c.name)===e).sort((c,y)=>c.name.localeCompare(y.name));for(let c of Z){let y=c.name.slice(e.length+g.length);l.push(z$1(P$1({},this.toEntityListItem(c)),{name:y,description:c.name,groupKey:e,groupLabel:e}));}}let H=[...o].filter(e=>!f.has(e.name)&&!e.volatile).sort((e,i)=>e.name.localeCompare(i.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,i)=>e.name.localeCompare(i.name));for(let e of Q)l.push(z$1(P$1({},this.toEntityListItem(e)),{groupKey:"__volatile__",groupLabel:"Temporary"}));let X=a.filter(e=>{let i=n(e.name);return i!==null&&!r.has(i)}).sort((e,i)=>e.name.localeCompare(i.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:n=>{console.error("[PROJECT-LIST] Failed to delete project:",n),this.notification.error(n?.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:4,consts:[["projectCard",""],[1,"project-page-layout"],["title","Projects","contentMaxWidth","1400px","searchPlaceholder","Filter projects\u2026","emptyMessage","No projects found.",3,"itemSelected","createRequested","items","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,a){if(o&1&&(vs(0,"div",1)(1,"ds-entity-list",2),Ag("itemSelected",function(n){return a.onItemSelected(n)})("createRequested",function(){return a.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",a.projectItems())("itemTemplate",r)("showCreate",a.showCreateButton())("autoFocusSearch",true);}},dependencies:[Wn,it,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};