@whoz-oss/coday-client 0.222.0 → 0.223.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.
- package/browser/{chunk-VURRJ77W.js → chunk-3CMKQDJD.js} +1 -1
- package/browser/{chunk-QA6XH3LQ.js → chunk-3MIJJDXL.js} +1 -1
- package/browser/{chunk-ZKS4VKDZ.js → chunk-3OWOEY5M.js} +1 -1
- package/browser/chunk-56ZJETOZ.js +6 -0
- package/browser/{chunk-OK32ENYP.js → chunk-6BVQYZZJ.js} +1 -1
- package/browser/{chunk-4LLQHQ72.js → chunk-6QV7QLHP.js} +1 -1
- package/browser/{chunk-JM5SK7RJ.js → chunk-C7Y56WDM.js} +1 -1
- package/browser/{chunk-BOKUHMXQ.js → chunk-CCWYFJZD.js} +1 -1
- package/browser/{chunk-6QVHTXNY.js → chunk-CUMGGWQ7.js} +1 -1
- package/browser/{chunk-2JFW66QF.js → chunk-DLM7MUO5.js} +1 -1
- package/browser/{chunk-UTUTCLZV.js → chunk-GXBIFFTK.js} +1 -1
- package/browser/{chunk-O4EHMHGS.js → chunk-IAB4GU4A.js} +1 -1
- package/browser/{chunk-S5GYRWWO.js → chunk-IFCMGNTL.js} +1 -1
- package/browser/{chunk-XLY3EKFY.js → chunk-J4RCBELS.js} +1 -1
- package/browser/{chunk-NPW3WIRW.js → chunk-KT6YZNOC.js} +1 -1
- package/browser/{chunk-YC3HFWKP.js → chunk-LPJG7HDA.js} +1 -1
- package/browser/{chunk-IZLOFLQI.js → chunk-M2ZQ6RPO.js} +1 -1
- package/browser/{chunk-PBFPI55X.js → chunk-MEZUHBEH.js} +1 -1
- package/browser/{chunk-F2SDHNCX.js → chunk-N347WQAU.js} +6 -6
- package/browser/{chunk-FYW22VB6.js → chunk-NEIKVLFC.js} +1 -1
- package/browser/{chunk-FLOWHF2Q.js → chunk-O6KL6T76.js} +1 -1
- package/browser/{chunk-PIVEZFIL.js → chunk-O7ZDJZQW.js} +1 -1
- package/browser/{chunk-AE2KD4A7.js → chunk-PMBWUQPI.js} +1 -1
- package/browser/{chunk-S2AP7DX6.js → chunk-Q3ITJ7SM.js} +1 -1
- package/browser/{chunk-JMGIKNHE.js → chunk-QCPXHP56.js} +1 -1
- package/browser/{chunk-5YICJPG4.js → chunk-QS5AU6X7.js} +1 -1
- package/browser/{chunk-AE74H57T.js → chunk-QV2MVWJJ.js} +1 -1
- package/browser/{chunk-K5ALWDTN.js → chunk-S2DDRVZC.js} +1 -1
- package/browser/{chunk-NCHQXF4S.js → chunk-S4UXUKNG.js} +1 -1
- package/browser/{chunk-37R4PWRM.js → chunk-SC2IRNRE.js} +1 -1
- package/browser/{chunk-WO2Z5JMW.js → chunk-T2HMC47U.js} +1 -1
- package/browser/{chunk-LVMHNPNL.js → chunk-V7G5TYBH.js} +1 -1
- package/browser/{chunk-VKFTA4MX.js → chunk-VDQ7VRBP.js} +1 -1
- package/browser/{chunk-ZB3LDCY3.js → chunk-VURHEL5U.js} +1 -1
- package/browser/{chunk-GE5IABDA.js → chunk-WEFHBDOC.js} +1 -1
- package/browser/{chunk-LQXAXQDW.js → chunk-WGIDIO7O.js} +1 -1
- package/browser/{chunk-DJW5YEVF.js → chunk-WLBH76W3.js} +1 -1
- package/browser/{chunk-PJ3HC56D.js → chunk-WTSDGIW6.js} +1 -1
- package/browser/{chunk-HEO22D4L.js → chunk-XTHD557L.js} +1 -1
- package/browser/{chunk-7ZT4AOIS.js → chunk-YHKKJQPZ.js} +1 -1
- package/browser/{chunk-2MSURPPU.js → chunk-ZD5EXS3I.js} +1 -1
- package/browser/index.html +1 -1
- package/browser/{main-AXQXT3DL.js → main-JHUIVPZ4.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-4ZQC632F.js +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as H,c as J}from"./chunk-VURRJ77W.js";import{a as W}from"./chunk-WIVM4HFF.js";import{i as G,j as V}from"./chunk-BCOH5IGB.js";import{a as q,c as I}from"./chunk-MZT6I3S3.js";import{r as j,x as K,y as $}from"./chunk-F2SDHNCX.js";import{a as T,b as F,c as z}from"./chunk-3ZLLFAXF.js";import{Bb as C,D as E,Db as m,Fb as l,Ka as d,Pb as L,Rb as D,S as B,Tb as u,Ub as A,Wa as y,ab as P,ca as p,ga as g,ha as _,jb as N,jc as O,lb as b,m as S,ma as w,mb as f,mc as U,pc as x,qc as h,rb as c,sb as a,t as R,ta as v,tb as r}from"./chunk-KJ5SIUGY.js";function Z(s,t){if(s&1&&(a(0,"span",3),u(1),r()),s&2){let e=l();d(),A(e.subtitle)}}var M=class s{user=h.required();editRequested=x();deleteRequested=x();menuItems=[{key:"edit",label:"Edit user",icon:"edit"},{key:"delete",label:"Delete user",icon:"delete",variant:"danger"}];get displayName(){let{firstname:t,lastname:e,email:n}=this.user();return[t,e].filter(Boolean).join(" ")||n||"\u2014"}get subtitle(){return this.user().email??this.user().externalId??""}onMenuAction(t){switch(t){case"edit":this.editRequested.emit(this.user());break;case"delete":confirm(`Delete user "${this.displayName}"?`)&&this.deleteRequested.emit(this.user());break}}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=y({type:s,selectors:[["agentos-user-item"]],inputs:{user:[1,"user"]},outputs:{editRequested:"editRequested",deleteRequested:"deleteRequested"},decls:7,vars:3,consts:[["role","listitem",1,"user-item"],[1,"user-item__body"],[1,"user-item__name"],[1,"user-item__subtitle"],[1,"user-item__actions"],[3,"itemSelected","items"]],template:function(e,n){e&1&&(a(0,"div",0)(1,"div",1)(2,"span",2),u(3),r(),b(4,Z,2,1,"span",3),r(),a(5,"div",4)(6,"ds-kebab-menu",5),m("itemSelected",function(o){return n.onMenuAction(o)}),r()()()),e&2&&(d(3),A(n.displayName),d(),f(n.subtitle?4:-1),d(2),c("items",n.menuItems))},dependencies:[$],styles:[".user-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;width:100%;padding:1rem 1.25rem;background:var(--color-bg-secondary, rgba(255, 255, 255, .7));border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:12px;box-sizing:border-box;overflow:hidden;position:relative}.user-item__body[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column;gap:.25rem}.user-item__name[_ngcontent-%COMP%]{font-size:.9375rem;font-weight:600;color:var(--color-text, #1d1d1f);line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-item__subtitle[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-item__actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem;flex-shrink:0}"],changeDetection:0})};function ee(s,t){if(s&1){let e=C();a(0,"agentos-namespace-select",4),m("valueChange",function(i){g(e);let o=l();return _(o.onNamespaceChange(i))}),r()}if(s&2){let e=l();c("namespaces",t)("value",e.selectedNamespaceId())("includeAllOption",!0)}}function te(s,t){if(s&1){let e=C();a(0,"ds-icon-button",5),m("action",function(){g(e);let i=l();return _(i.goBack())}),r()}}function ne(s,t){if(s&1){let e=C();a(0,"agentos-user-item",7),m("editRequested",function(i){g(e);let o=l(2);return _(o.navigateToEdit(i))})("deleteRequested",function(i){g(e);let o=l(2);return _(o.deleteUser(i))}),r()}s&2&&c("user",t)}function se(s,t){if(s&1&&b(0,ne,1,1,"agentos-user-item",6),s&2){let e,n=t.$implicit,i=l();f((e=i.resolveUser(n.id))?0:-1,e)}}var k=class s{router=p(I);destroyRef=p(w);userAdminState=p(W);namespacePermissions=p(V);showBackButton=h(!0);namespaces=h(void 0);selectedNamespaceId=h(null);hideTitle=h(!1);namespaceFilterChange=x();isLoading=this.userAdminState.isLoading;namespaceUserIds=z(F(this.selectedNamespaceId).pipe(B(t=>t?this.namespacePermissions.listNamespaceUsers(t).pipe(R(e=>new Set(e.map(n=>n.id))),E(e=>(console.error("[UserList] Failed to load namespace users",e),S(null)))):S(null))),{initialValue:null});userItems=U(()=>{let t=this.namespaceUserIds();return this.userAdminState.users().filter(e=>t===null||t.has(e.id??"")).map(e=>({id:e.id??"",name:[e.firstname,e.lastname].filter(Boolean).join(" ")||e.email||"\u2014",description:e.email}))});get usersById(){return new Map(this.userAdminState.users().map(t=>[t.id??"",t]))}ngOnInit(){this.userAdminState.loadAll().pipe(T(this.destroyRef)).subscribe()}onNamespaceChange(t){this.namespaceFilterChange.emit(t)}goBack(){this.router.navigate(["/agentos","admin"])}navigateToCreate(){this.router.navigate(["/agentos/admin/users/new"])}navigateToEdit(t){this.router.navigate(["/agentos/admin/users",t.id??"","edit"])}deleteUser(t){this.userAdminState.deleteUser(t.id??"").pipe(T(this.destroyRef)).subscribe()}resolveUser(t){return this.usersById.get(t)??null}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=y({type:s,selectors:[["agentos-user-list"]],inputs:{showBackButton:[1,"showBackButton"],namespaces:[1,"namespaces"],selectedNamespaceId:[1,"selectedNamespaceId"],hideTitle:[1,"hideTitle"]},outputs:{namespaceFilterChange:"namespaceFilterChange"},decls:5,vars:5,consts:[["userItemTpl",""],["title","Users","emptyMessage","No users found.","cardMinWidth","320px",3,"createRequested","hideTitle","items","showCreate","itemTemplate"],["toolbar-start","",3,"namespaces","value","includeAllOption"],["toolbar-start","","icon","arrow_back","title","Back"],["toolbar-start","",3,"valueChange","namespaces","value","includeAllOption"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"user"],[3,"editRequested","deleteRequested","user"]],template:function(e,n){if(e&1&&(a(0,"ds-entity-list",1),m("createRequested",function(){return n.navigateToCreate()}),b(1,ee,1,3,"agentos-namespace-select",2)(2,te,1,0,"ds-icon-button",3),r(),P(3,se,1,1,"ng-template",null,0,O)),e&2){let i,o=L(4);c("hideTitle",n.hideTitle())("items",n.userItems())("showCreate",!0)("itemTemplate",o),d(),f((i=n.namespaces())?1:n.showBackButton()?2:-1,i)}},dependencies:[K,M,j,H],encapsulation:2,changeDetection:0})};function ie(s,t){if(s&1){let e=C();a(0,"agentos-user-list",9),m("namespaceFilterChange",function(i){g(e);let o=l();return _(o.onUsersNamespaceChange(i))}),r()}if(s&2){let e=l();c("showBackButton",!1)("hideTitle",!0)("namespaces",e.namespaces())("selectedNamespaceId",e.usersNamespaceFilter())}}function re(s,t){s&1&&(a(0,"p",10),u(1,"No namespaces yet. Create one before managing groups."),r())}function ae(s,t){if(s&1){let e=C();a(0,"agentos-user-group-list",12),m("namespaceChange",function(i){g(e);let o=l(2);return _(o.onGroupsNamespaceChange(i))}),r()}if(s&2){let e=l(2);c("namespaceId",t)("hideTitle",!0)("namespaces",e.namespaces())("returnTo",e.returnTo())}}function oe(s,t){if(s&1&&b(0,re,2,0,"p",10)(1,ae,1,4,"agentos-user-group-list",11),s&2){let e,n=l();f(n.namespaces().length===0?0:(e=n.groupsNamespaceId())?1:-1,e)}}var Y=class s{router=p(I);route=p(q);destroyRef=p(w);namespaceController=p(G);activeTab=v(this.route.snapshot.queryParamMap.get("tab")==="groups"?"groups":"users");namespaces=v([]);usersNamespaceFilter=v(null);groupsNamespaceId=v(null);returnTo=U(()=>{let t=this.groupsNamespaceId();return t?`/agentos/admin/users?tab=groups&ns=${t}`:"/agentos/admin/users?tab=groups"});constructor(){let t=this.route.snapshot.queryParamMap.get("ns");this.namespaceController.listAllNamespace().pipe(T(this.destroyRef)).subscribe(e=>{let n=e.filter(o=>o.role!=="MEMBER");this.namespaces.set(n);let i=t&&n.some(o=>o.id===t)?t:n[0]?.id??null;this.groupsNamespaceId.set(i)})}setTab(t){this.activeTab.set(t)}onUsersNamespaceChange(t){this.usersNamespaceFilter.set(t)}onGroupsNamespaceChange(t){this.groupsNamespaceId.set(t)}goBack(){this.router.navigate(["/agentos","admin"])}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=y({type:s,selectors:[["agentos-admin-users-groups"]],decls:14,vars:8,consts:[[1,"admin-users-groups"],[1,"admin-users-groups__header"],["type","button",1,"admin-users-groups__back",3,"click"],[1,"admin-users-groups__title"],["role","tablist","aria-label","Users and Groups",1,"admin-users-groups__tabs"],["id","admin-tab-users","type","button","role","tab","aria-controls","admin-users-groups-panel",1,"admin-users-groups__tab",3,"click"],["id","admin-tab-groups","type","button","role","tab","aria-controls","admin-users-groups-panel",1,"admin-users-groups__tab",3,"click"],["id","admin-users-groups-panel","role","tabpanel","tabindex","0",1,"admin-users-groups__panel"],[3,"showBackButton","hideTitle","namespaces","selectedNamespaceId"],[3,"namespaceFilterChange","showBackButton","hideTitle","namespaces","selectedNamespaceId"],[1,"admin-users-groups__empty"],[3,"namespaceId","hideTitle","namespaces","returnTo"],[3,"namespaceChange","namespaceId","hideTitle","namespaces","returnTo"]],template:function(e,n){e&1&&(a(0,"div",0)(1,"header",1)(2,"button",2),m("click",function(){return n.goBack()}),u(3,"\u2190 Admin"),r(),a(4,"h1",3),u(5,"Users & Groups"),r()(),a(6,"div",4)(7,"button",5),m("click",function(){return n.setTab("users")}),u(8," Users "),r(),a(9,"button",6),m("click",function(){return n.setTab("groups")}),u(10," Groups "),r()(),a(11,"div",7),b(12,ie,1,4,"agentos-user-list",8)(13,oe,2,1),r()()),e&2&&(d(7),D("admin-users-groups__tab--active",n.activeTab()==="users"),N("aria-selected",n.activeTab()==="users"),d(2),D("admin-users-groups__tab--active",n.activeTab()==="groups"),N("aria-selected",n.activeTab()==="groups"),d(2),N("aria-labelledby",n.activeTab()==="users"?"admin-tab-users":"admin-tab-groups"),d(),f(n.activeTab()==="users"?12:13))},dependencies:[k,J],styles:[".admin-users-groups[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:1.5rem 1rem 0;--entity-list-toolbar-max-width: 900px}.admin-users-groups__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;max-width:900px;margin:0 auto;width:100%}.admin-users-groups__back[_ngcontent-%COMP%]{align-self:flex-start;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.admin-users-groups__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.admin-users-groups__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.admin-users-groups__tabs[_ngcontent-%COMP%]{display:inline-flex;gap:.25rem;padding:.25rem;border-radius:10px;background:var(--color-surface-hover, rgba(0, 0, 0, .05));border:1px solid var(--color-border, rgba(0, 0, 0, .08));max-width:900px;margin:0 auto;width:fit-content;align-self:center}.admin-users-groups__tab[_ngcontent-%COMP%]{padding:.4rem 1.25rem;border-radius:8px;border:none;background:transparent;color:var(--color-text-secondary, #6e6e73);font-size:.9rem;font-family:inherit;font-weight:500;cursor:pointer;transition:background .15s ease,color .15s ease}.admin-users-groups__tab[_ngcontent-%COMP%]:hover{color:var(--color-text, #1d1d1f)}.admin-users-groups__tab--active[_ngcontent-%COMP%]{background:var(--color-bg-surface, #fff);color:var(--color-text, #1d1d1f);box-shadow:0 1px 2px #00000014}.admin-users-groups__empty[_ngcontent-%COMP%]{max-width:900px;margin:1rem auto;width:100%;color:var(--color-text-secondary, #6e6e73);font-size:.9rem}"],changeDetection:0})};export{M as a,k as b,Y as c};
|
|
1
|
+
import{a as H,c as J}from"./chunk-3CMKQDJD.js";import{a as W}from"./chunk-WIVM4HFF.js";import{i as G,j as V}from"./chunk-BCOH5IGB.js";import{a as q,c as I}from"./chunk-MZT6I3S3.js";import{r as j,y as K,z as $}from"./chunk-N347WQAU.js";import{a as T,b as F,c as z}from"./chunk-3ZLLFAXF.js";import{Bb as C,D as E,Db as m,Fb as l,Ka as d,Pb as L,Rb as D,S as B,Tb as u,Ub as A,Wa as y,ab as P,ca as p,ga as g,ha as _,jb as N,jc as O,lb as b,m as S,ma as w,mb as f,mc as U,pc as x,qc as h,rb as c,sb as a,t as R,ta as v,tb as r}from"./chunk-KJ5SIUGY.js";function Z(s,t){if(s&1&&(a(0,"span",3),u(1),r()),s&2){let e=l();d(),A(e.subtitle)}}var M=class s{user=h.required();editRequested=x();deleteRequested=x();menuItems=[{key:"edit",label:"Edit user",icon:"edit"},{key:"delete",label:"Delete user",icon:"delete",variant:"danger"}];get displayName(){let{firstname:t,lastname:e,email:n}=this.user();return[t,e].filter(Boolean).join(" ")||n||"\u2014"}get subtitle(){return this.user().email??this.user().externalId??""}onMenuAction(t){switch(t){case"edit":this.editRequested.emit(this.user());break;case"delete":confirm(`Delete user "${this.displayName}"?`)&&this.deleteRequested.emit(this.user());break}}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=y({type:s,selectors:[["agentos-user-item"]],inputs:{user:[1,"user"]},outputs:{editRequested:"editRequested",deleteRequested:"deleteRequested"},decls:7,vars:3,consts:[["role","listitem",1,"user-item"],[1,"user-item__body"],[1,"user-item__name"],[1,"user-item__subtitle"],[1,"user-item__actions"],[3,"itemSelected","items"]],template:function(e,n){e&1&&(a(0,"div",0)(1,"div",1)(2,"span",2),u(3),r(),b(4,Z,2,1,"span",3),r(),a(5,"div",4)(6,"ds-kebab-menu",5),m("itemSelected",function(o){return n.onMenuAction(o)}),r()()()),e&2&&(d(3),A(n.displayName),d(),f(n.subtitle?4:-1),d(2),c("items",n.menuItems))},dependencies:[$],styles:[".user-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;width:100%;padding:1rem 1.25rem;background:var(--color-bg-secondary, rgba(255, 255, 255, .7));border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:12px;box-sizing:border-box;overflow:hidden;position:relative}.user-item__body[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column;gap:.25rem}.user-item__name[_ngcontent-%COMP%]{font-size:.9375rem;font-weight:600;color:var(--color-text, #1d1d1f);line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-item__subtitle[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-item__actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem;flex-shrink:0}"],changeDetection:0})};function ee(s,t){if(s&1){let e=C();a(0,"agentos-namespace-select",4),m("valueChange",function(i){g(e);let o=l();return _(o.onNamespaceChange(i))}),r()}if(s&2){let e=l();c("namespaces",t)("value",e.selectedNamespaceId())("includeAllOption",!0)}}function te(s,t){if(s&1){let e=C();a(0,"ds-icon-button",5),m("action",function(){g(e);let i=l();return _(i.goBack())}),r()}}function ne(s,t){if(s&1){let e=C();a(0,"agentos-user-item",7),m("editRequested",function(i){g(e);let o=l(2);return _(o.navigateToEdit(i))})("deleteRequested",function(i){g(e);let o=l(2);return _(o.deleteUser(i))}),r()}s&2&&c("user",t)}function se(s,t){if(s&1&&b(0,ne,1,1,"agentos-user-item",6),s&2){let e,n=t.$implicit,i=l();f((e=i.resolveUser(n.id))?0:-1,e)}}var k=class s{router=p(I);destroyRef=p(w);userAdminState=p(W);namespacePermissions=p(V);showBackButton=h(!0);namespaces=h(void 0);selectedNamespaceId=h(null);hideTitle=h(!1);namespaceFilterChange=x();isLoading=this.userAdminState.isLoading;namespaceUserIds=z(F(this.selectedNamespaceId).pipe(B(t=>t?this.namespacePermissions.listNamespaceUsers(t).pipe(R(e=>new Set(e.map(n=>n.id))),E(e=>(console.error("[UserList] Failed to load namespace users",e),S(null)))):S(null))),{initialValue:null});userItems=U(()=>{let t=this.namespaceUserIds();return this.userAdminState.users().filter(e=>t===null||t.has(e.id??"")).map(e=>({id:e.id??"",name:[e.firstname,e.lastname].filter(Boolean).join(" ")||e.email||"\u2014",description:e.email}))});get usersById(){return new Map(this.userAdminState.users().map(t=>[t.id??"",t]))}ngOnInit(){this.userAdminState.loadAll().pipe(T(this.destroyRef)).subscribe()}onNamespaceChange(t){this.namespaceFilterChange.emit(t)}goBack(){this.router.navigate(["/agentos","admin"])}navigateToCreate(){this.router.navigate(["/agentos/admin/users/new"])}navigateToEdit(t){this.router.navigate(["/agentos/admin/users",t.id??"","edit"])}deleteUser(t){this.userAdminState.deleteUser(t.id??"").pipe(T(this.destroyRef)).subscribe()}resolveUser(t){return this.usersById.get(t)??null}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=y({type:s,selectors:[["agentos-user-list"]],inputs:{showBackButton:[1,"showBackButton"],namespaces:[1,"namespaces"],selectedNamespaceId:[1,"selectedNamespaceId"],hideTitle:[1,"hideTitle"]},outputs:{namespaceFilterChange:"namespaceFilterChange"},decls:5,vars:5,consts:[["userItemTpl",""],["title","Users","emptyMessage","No users found.","cardMinWidth","320px",3,"createRequested","hideTitle","items","showCreate","itemTemplate"],["toolbar-start","",3,"namespaces","value","includeAllOption"],["toolbar-start","","icon","arrow_back","title","Back"],["toolbar-start","",3,"valueChange","namespaces","value","includeAllOption"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"user"],[3,"editRequested","deleteRequested","user"]],template:function(e,n){if(e&1&&(a(0,"ds-entity-list",1),m("createRequested",function(){return n.navigateToCreate()}),b(1,ee,1,3,"agentos-namespace-select",2)(2,te,1,0,"ds-icon-button",3),r(),P(3,se,1,1,"ng-template",null,0,O)),e&2){let i,o=L(4);c("hideTitle",n.hideTitle())("items",n.userItems())("showCreate",!0)("itemTemplate",o),d(),f((i=n.namespaces())?1:n.showBackButton()?2:-1,i)}},dependencies:[K,M,j,H],encapsulation:2,changeDetection:0})};function ie(s,t){if(s&1){let e=C();a(0,"agentos-user-list",9),m("namespaceFilterChange",function(i){g(e);let o=l();return _(o.onUsersNamespaceChange(i))}),r()}if(s&2){let e=l();c("showBackButton",!1)("hideTitle",!0)("namespaces",e.namespaces())("selectedNamespaceId",e.usersNamespaceFilter())}}function re(s,t){s&1&&(a(0,"p",10),u(1,"No namespaces yet. Create one before managing groups."),r())}function ae(s,t){if(s&1){let e=C();a(0,"agentos-user-group-list",12),m("namespaceChange",function(i){g(e);let o=l(2);return _(o.onGroupsNamespaceChange(i))}),r()}if(s&2){let e=l(2);c("namespaceId",t)("hideTitle",!0)("namespaces",e.namespaces())("returnTo",e.returnTo())}}function oe(s,t){if(s&1&&b(0,re,2,0,"p",10)(1,ae,1,4,"agentos-user-group-list",11),s&2){let e,n=l();f(n.namespaces().length===0?0:(e=n.groupsNamespaceId())?1:-1,e)}}var Y=class s{router=p(I);route=p(q);destroyRef=p(w);namespaceController=p(G);activeTab=v(this.route.snapshot.queryParamMap.get("tab")==="groups"?"groups":"users");namespaces=v([]);usersNamespaceFilter=v(null);groupsNamespaceId=v(null);returnTo=U(()=>{let t=this.groupsNamespaceId();return t?`/agentos/admin/users?tab=groups&ns=${t}`:"/agentos/admin/users?tab=groups"});constructor(){let t=this.route.snapshot.queryParamMap.get("ns");this.namespaceController.listAllNamespace().pipe(T(this.destroyRef)).subscribe(e=>{let n=e.filter(o=>o.role!=="MEMBER");this.namespaces.set(n);let i=t&&n.some(o=>o.id===t)?t:n[0]?.id??null;this.groupsNamespaceId.set(i)})}setTab(t){this.activeTab.set(t)}onUsersNamespaceChange(t){this.usersNamespaceFilter.set(t)}onGroupsNamespaceChange(t){this.groupsNamespaceId.set(t)}goBack(){this.router.navigate(["/agentos","admin"])}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=y({type:s,selectors:[["agentos-admin-users-groups"]],decls:14,vars:8,consts:[[1,"admin-users-groups"],[1,"admin-users-groups__header"],["type","button",1,"admin-users-groups__back",3,"click"],[1,"admin-users-groups__title"],["role","tablist","aria-label","Users and Groups",1,"admin-users-groups__tabs"],["id","admin-tab-users","type","button","role","tab","aria-controls","admin-users-groups-panel",1,"admin-users-groups__tab",3,"click"],["id","admin-tab-groups","type","button","role","tab","aria-controls","admin-users-groups-panel",1,"admin-users-groups__tab",3,"click"],["id","admin-users-groups-panel","role","tabpanel","tabindex","0",1,"admin-users-groups__panel"],[3,"showBackButton","hideTitle","namespaces","selectedNamespaceId"],[3,"namespaceFilterChange","showBackButton","hideTitle","namespaces","selectedNamespaceId"],[1,"admin-users-groups__empty"],[3,"namespaceId","hideTitle","namespaces","returnTo"],[3,"namespaceChange","namespaceId","hideTitle","namespaces","returnTo"]],template:function(e,n){e&1&&(a(0,"div",0)(1,"header",1)(2,"button",2),m("click",function(){return n.goBack()}),u(3,"\u2190 Admin"),r(),a(4,"h1",3),u(5,"Users & Groups"),r()(),a(6,"div",4)(7,"button",5),m("click",function(){return n.setTab("users")}),u(8," Users "),r(),a(9,"button",6),m("click",function(){return n.setTab("groups")}),u(10," Groups "),r()(),a(11,"div",7),b(12,ie,1,4,"agentos-user-list",8)(13,oe,2,1),r()()),e&2&&(d(7),D("admin-users-groups__tab--active",n.activeTab()==="users"),N("aria-selected",n.activeTab()==="users"),d(2),D("admin-users-groups__tab--active",n.activeTab()==="groups"),N("aria-selected",n.activeTab()==="groups"),d(2),N("aria-labelledby",n.activeTab()==="users"?"admin-tab-users":"admin-tab-groups"),d(),f(n.activeTab()==="users"?12:13))},dependencies:[k,J],styles:[".admin-users-groups[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:1.5rem 1rem 0;--entity-list-toolbar-max-width: 900px}.admin-users-groups__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;max-width:900px;margin:0 auto;width:100%}.admin-users-groups__back[_ngcontent-%COMP%]{align-self:flex-start;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.admin-users-groups__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.admin-users-groups__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.admin-users-groups__tabs[_ngcontent-%COMP%]{display:inline-flex;gap:.25rem;padding:.25rem;border-radius:10px;background:var(--color-surface-hover, rgba(0, 0, 0, .05));border:1px solid var(--color-border, rgba(0, 0, 0, .08));max-width:900px;margin:0 auto;width:fit-content;align-self:center}.admin-users-groups__tab[_ngcontent-%COMP%]{padding:.4rem 1.25rem;border-radius:8px;border:none;background:transparent;color:var(--color-text-secondary, #6e6e73);font-size:.9rem;font-family:inherit;font-weight:500;cursor:pointer;transition:background .15s ease,color .15s ease}.admin-users-groups__tab[_ngcontent-%COMP%]:hover{color:var(--color-text, #1d1d1f)}.admin-users-groups__tab--active[_ngcontent-%COMP%]{background:var(--color-bg-surface, #fff);color:var(--color-text, #1d1d1f);box-shadow:0 1px 2px #00000014}.admin-users-groups__empty[_ngcontent-%COMP%]{max-width:900px;margin:1rem auto;width:100%;color:var(--color-text-secondary, #6e6e73);font-size:.9rem}"],changeDetection:0})};export{M as a,k as b,Y as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as N}from"./chunk-6L7NNQJK.js";import{a as U}from"./chunk-R7YB3V2E.js";import{c as F,d as $}from"./chunk-MZT6I3S3.js";import"./chunk-RX6XVTR7.js";import"./chunk-JFRIGSWA.js";import{
|
|
1
|
+
import{a as N}from"./chunk-6L7NNQJK.js";import{a as U}from"./chunk-R7YB3V2E.js";import{c as F,d as $}from"./chunk-MZT6I3S3.js";import"./chunk-RX6XVTR7.js";import"./chunk-JFRIGSWA.js";import{x as z,y as J}from"./chunk-N347WQAU.js";import"./chunk-MWPKXBXJ.js";import{d as K}from"./chunk-OX7PDXEA.js";import"./chunk-7EDSHFWH.js";import{a as L,c as S}from"./chunk-3ZLLFAXF.js";import{a as W,b as A}from"./chunk-Q2M4W42M.js";import"./chunk-DDWYQORF.js";import{b as B}from"./chunk-JF3TWRKD.js";import{O as V}from"./chunk-B46LXCLF.js";import{B as x,Bb as k,Db as h,Fb as b,Ka as v,Pb as E,Tb as O,Wa as D,a as c,ab as I,b as p,ca as m,cc as T,ga as C,ha as j,jc as q,ma as R,mc as w,rb as P,sb as d,tb as _,ub as M}from"./chunk-KJ5SIUGY.js";var ee=()=>[];function te(u,t){if(u&1){let o=k();d(0,"div",5)(1,"ds-entity-card",6),h("selected",function(r){C(o);let n=b();return j(n.onItemSelected(r))}),_(),d(2,"button",7),h("click",function(r){let n=C(o).$implicit,f=b();return r.stopPropagation(),j(f.onDeleteRequested(n.id))}),d(3,"mat-icon"),O(4,"close"),_()()()}if(u&2){let o=t.$implicit;v(),P("id",o.id)("name",o.name)("description",o.description)("badges",o.badges??T(4,ee))}}var g="__",Y=class u{router=m(F);projectStateService=m(B);dialog=m(K);destroyRef=m(R);notification=m(U);projects=S(this.projectStateService.projectList$);forcedProject=S(this.projectStateService.forcedProject$,{initialValue:null});projectItems=w(()=>{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(s=>s.name===e);l.push(p(c({},this.toEntityListItem(i)),{groupKey:e,groupLabel:e}));let Z=a.filter(s=>n(s.name)===e).sort((s,y)=>s.name.localeCompare(y.name));for(let s of Z){let y=s.name.slice(e.length+g.length);l.push(p(c({},this.toEntityListItem(s)),{name:y,description:s.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(p(c({},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(p(c({},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(p(c({},this.toEntityListItem(e)),{groupKey:"__orphaned__",groupLabel:"Orphaned worktrees"}));return l});showCreateButton=w(()=>!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(N,{width:"400px",panelClass:"confirm-dialog-panel",data:c({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:!0},o?{checkboxLabel:"Also remove git worktree from disk"}:{})}).afterClosed().pipe(x(r=>r?.confirmed===!0),L(this.destroyRef)).subscribe(r=>{this.notification.info("Deleting project\u2026"),this.projectStateService.deleteProject(t,r.checkboxChecked).pipe(L(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=D({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&&(d(0,"div",1)(1,"ds-entity-list",2),h("itemSelected",function(n){return a.onItemSelected(n)})("createRequested",function(){return a.onCreateRequested()}),d(2,"a",3),M(3,"img",4),_()()(),I(4,te,5,5,"ng-template",null,0,q)),o&2){let r=E(5);v(),P("items",a.projectItems())("itemTemplate",r)("showCreate",a.showCreateButton())("autoFocusSearch",!0)}},dependencies:[J,z,A,W,V,$],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}"]})};export{Y as ProjectListComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Cn}from"./chunk-S5XVTDPO.js";import{a as Ue,b as Be,c as _n,e as ce}from"./chunk-L2CXQ5ZG.js";import{a as yn,b as wn,c as Tn}from"./chunk-VR3I4RKJ.js";import{a as Ke}from"./chunk-I2FVKUBH.js";import{a as je,b as X,c as ln,d as se,i as mn,j as pn,k as un,o as gn,p as hn,r as fn,t as Qe,v as bn,x as vn,y as Xe}from"./chunk-AEGHERYH.js";import{a as xn}from"./chunk-R7YB3V2E.js";import{c as Kt}from"./chunk-MZT6I3S3.js";import{a as In}from"./chunk-A7WS3RLV.js";import{r as On,u as kn}from"./chunk-F2SDHNCX.js";import{b as dn,h as Sn,i as Mn,j as En,n as Pn}from"./chunk-MWPKXBXJ.js";import{a as cn,c as $e}from"./chunk-3ZLLFAXF.js";import{a as R,b as L}from"./chunk-Q2M4W42M.js";import{E as Ge,c as We,g as qe,m as Ye}from"./chunk-DDWYQORF.js";import{b as Q}from"./chunk-JF3TWRKD.js";import{E as rn,K as an,O as re,Q as sn,R as Ne,S as ae,i as Jt,j as Zt,p as en,s as tn,t as nn,z as on}from"./chunk-B46LXCLF.js";import{$b as He,B as W,Bb as _,D as De,Db as h,Fb as l,G as Ft,Ga as z,Ha as Lt,Ic as ze,Ja as zt,Jb as ge,Ka as c,Kb as J,Kc as Xt,Lb as Z,Lc as St,Oc as j,Pa as Nt,Rb as N,T as F,Tb as p,Ub as S,Vb as he,Wa as T,Wb as Ae,Wc as Y,Xa as $t,Ya as jt,Z as k,Za as Ut,Zb as Fe,Zc as G,_ as Rt,_b as Re,a as de,ac as Wt,b as Oe,bc as qt,ca as m,cc as Yt,d as P,dc as Gt,fc as Ee,g as ke,ga as f,gc as Qt,h as B,ha as b,hc as Tt,i as Ie,jb as oe,la as Ht,lb as u,m as xt,mb as g,mc as Ve,n as Dt,oa as M,pa as Vt,pb as H,qb as V,rb as C,sb as a,t as ne,ta as ie,tb as s,u as At,ub as y,va as q,vb as yt,wb as wt,xb as Bt,xc as Le,ya as ue}from"./chunk-KJ5SIUGY.js";var Je=class i{sanitizer=m(G);transform(e,t){if(!t||!e)return e;let n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`(${n})`,"gi"),r=e.replace(o,"<strong>$1</strong>");return this.sanitizer.bypassSecurityTrustHtml(r)}static \u0275fac=function(t){return new(t||i)};static \u0275pipe=Ut({name:"highlight",type:i,pure:!0})};var fe=class i{http=m(Y);projectState=m(Q);threadState=m(X);transcribeAudio(e,t,n){let o=this.projectState.getSelectedProjectIdOrThrow();return this.http.post(`/api/projects/${o}/transcribe`,de({audio:e,mimeType:t},n?{language:n}:{}))}sendVoiceMessage(e,t,n){let o=this.projectState.getSelectedProjectIdOrThrow(),r=this.threadState.getSelectedThreadIdOrThrow();return this.http.post(`/api/projects/${o}/threads/${r}/voice-message`,de({audio:e,mimeType:t},n?{language:n}:{}))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=k({token:i,factory:i.\u0275fac,providedIn:"root"})};var hi=["messageInput"],fi=["fileInput"],bi=(i,e)=>e.name;function vi(i,e){i&1&&(a(0,"div",3),y(1,"span",8),p(2," Recording... Click mic to stop "),s())}function Ci(i,e){i&1&&(a(0,"div",3),y(1,"span",9),p(2," Transcribing... "),s())}function _i(i,e){if(i&1&&(a(0,"span",14),p(1),s()),i&2){let t=l().$implicit,n=l(2);c(),S(" "+(n.getParameterFormat(t)||""))}}function xi(i,e){if(i&1){let t=_();a(0,"div",11),h("click",function(){let o=f(t).$index,r=l(2);return b(r.selectAutocompleteItemByClick(o))})("keydown.enter",function(){let o=f(t).$index,r=l(2);return b(r.selectAutocompleteItemByClick(o))})("keydown.space",function(){let o=f(t).$index,r=l(2);return b(r.selectAutocompleteItemByClick(o))})("mouseenter",function(){let o=f(t).$index,r=l(2);return b(r.selectedAutocompleteIndex=o)}),a(1,"div",12),y(2,"span",13),Ee(3,"highlight"),u(4,_i,2,1,"span",14),s(),y(5,"div",15),Ee(6,"highlight"),s()}if(i&2){let t=e.$implicit,n=e.$index,o=l(2);N("selected",n===o.selectedAutocompleteIndex),oe("aria-selected",n===o.selectedAutocompleteIndex),c(2),C("innerHTML",Tt(3,6,o.autocompleteTrigger+t.name,o.getAutocompleteQuery()),z),c(2),g(o.hasParameterFormat(t)?4:-1),c(),C("innerHTML",Tt(6,9,t.description,o.getAutocompleteQuery()),z)}}function yi(i,e){if(i&1&&(a(0,"div",4),H(1,xi,7,12,"div",10,bi),s()),i&2){let t=l();c(),V(t.autocompleteItems)}}function wi(i,e){if(i&1){let t=_();a(0,"ds-icon-button",18),h("action",function(){f(t);let o=l(2);return b(o.onStopClick())}),s()}}function Ti(i,e){if(i&1){let t=_();a(0,"ds-icon-button",19),h("action",function(){f(t);let o=l(2);return b(o.sendMessage())}),s()}if(i&2){let t=l(2);N("hidden",t.isDisabled||!t.message.trim())("active",!!t.message.trim()&&!t.isDisabled),C("title",t.getSendButtonTooltip())("disabled",t.isDisabled||!t.message.trim())}}function Si(i,e){if(i&1){let t=_();a(0,"ds-icon-button",21),h("action",function(){f(t);let o=l(3);return b(o.triggerFileUpload())}),s(),a(1,"input",22,1),h("change",function(o){f(t);let r=l(3);return b(r.onFileInputChange(o))}),s()}if(i&2){let t=l(3);C("disabled",t.isDisabled)}}function Mi(i,e){if(i&1){let t=_();u(0,Si,3,1),a(1,"ds-icon-button",20),h("action",function(){f(t);let o=l(2);return b(o.toggleRecording())}),s()}if(i&2){let t=l(2);g(!t.showWelcome&&!(t.isVoiceMessageMode&&(t.isRecording||t.isTranscribing))?0:-1),c(),N("hidden",t.message.trim()&&!t.isRecording&&!t.isTranscribing),C("variant",t.isVoiceMessageMode&&(t.isRecording||t.isTranscribing)?"danger":"default")("disabled",t.isVoiceMessageMode&&t.isTranscribing)("title",t.isRecording?"Click to stop recording":t.isTranscribing?"Uploading...":"Click to start recording")}}function Ei(i,e){if(i&1&&(a(0,"div",7),u(1,wi,1,0,"ds-icon-button",16),u(2,Ti,1,6,"ds-icon-button",17),u(3,Mi,2,6),s()),i&2){let t=l();c(),g(t.isThinking?1:-1),c(),g((!t.isThinking||t.message.trim())&&!(t.isVoiceMessageMode&&(t.isRecording||t.isTranscribing))?2:-1),c(),g(t.isThinking?-1:3)}}var Ze=class i{isDisabled=!1;showWelcome=!1;isThinking=!1;isStarting=!1;isSessionInitializing=!1;isStopping=!1;filesPasted=new M;messageSubmitted=new M;voiceMessageReady=new M;voiceRecordingToggled=new M;heightChanged=new M;stopRequested=new M;textareaFocused=new M;messageInput;fileInput;message="";isRecording=!1;isTranscribing=!1;isFocused=!1;recognition=null;mediaRecorder=null;audioChunks=[];voiceInputMode="browser";get isVoiceMessageMode(){return this.voiceInputMode==="voice-message"}sessionHadTranscript=!1;pendingLineBreaksTimeout=null;lastProcessedResultIndex=0;useEnterToSend=!1;currentInvite="";subscriptions=[];thinkingPhrases=["Processing request...","Thinking...","Working on it..."];currentThinkingPhrase="Processing request...";thinkingPhraseIndex=0;thinkingInterval=null;autocompleteVisible=!1;autocompleteTrigger=null;autocompleteItems=[];selectedAutocompleteIndex=0;preferencesService=m(se);codayService=m(ce);agentApiService=m(Cn);promptApiService=m(In);projectStateService=m(Q);audioApiService=m(fe);threadStateService=m(X);ngOnInit(){this.initializeVoiceInput(),this.useEnterToSend=this.preferencesService.getEnterToSend(),this.subscriptions.push(this.preferencesService.voiceLanguage$.subscribe(()=>this.updateRecognitionLanguage())),this.subscriptions.push(this.preferencesService.voiceInputMode$.subscribe(e=>{this.voiceInputMode=e})),this.subscriptions.push(this.preferencesService.enterToSend$.subscribe(e=>{this.useEnterToSend=e})),this.subscribeToInviteEvents(),this.subscribeToMessageRestore()}ngAfterViewInit(){this.adjustTextareaHeight(),requestAnimationFrame(()=>{setTimeout(()=>this.focusTextarea(),200)})}ngOnChanges(e){e.isThinking&&(e.isThinking.currentValue?this.startThinkingAnimation():(this.stopThinkingAnimation(),this.isStopping=!1,e.isThinking.previousValue&&(console.log("[CHAT-TEXTAREA] Thinking ended, scheduling focus"),requestAnimationFrame(()=>{setTimeout(()=>this.focusTextarea(),100)})))),e.isSessionInitializing&&!e.isSessionInitializing.currentValue&&e.isSessionInitializing.previousValue&&(console.log("[CHAT-TEXTAREA] Session initialization completed, scheduling focus"),requestAnimationFrame(()=>{setTimeout(()=>this.focusTextarea(),100)})),e.isStarting&&!e.isStarting.currentValue&&e.isStarting.previousValue&&this.isThinking&&(this.thinkingPhraseIndex===0?(console.log("[CHAT-TEXTAREA] Transitioning from Starting to Thinking at index 0 - restarting animation"),this.stopThinkingAnimation(),this.startThinkingAnimation()):console.log("[CHAT-TEXTAREA] Transitioning from Starting to Thinking at index",this.thinkingPhraseIndex,"- continuing without restart"))}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe()),this.subscriptions=[],this.clearPendingLineBreaks(),this.stopThinkingAnimation()}onKeyDown(e){if(this.autocompleteVisible)switch(e.key){case"ArrowDown":e.preventDefault(),this.selectedAutocompleteIndex=Math.min(this.selectedAutocompleteIndex+1,this.autocompleteItems.length-1),this.scrollSelectedItemIntoView();return;case"ArrowUp":e.preventDefault(),this.selectedAutocompleteIndex=Math.max(this.selectedAutocompleteIndex-1,0),this.scrollSelectedItemIntoView();return;case"Tab":case"Enter":if(!this.message.includes(" ")){e.preventDefault(),this.selectAutocompleteItem();return}break;case"Escape":e.preventDefault(),this.hideAutocomplete();return}e.key==="Enter"&&(this.useEnterToSend?!e.shiftKey&&!e.metaKey&&!e.ctrlKey&&(e.preventDefault(),this.sendMessage(!0)):(navigator.platform.toLowerCase().includes("mac")?e.metaKey:e.ctrlKey)&&!e.shiftKey&&(e.preventDefault(),this.sendMessage(!0)))}onInput(){this.adjustTextareaHeight(),this.checkForAutocomplete()}onPaste(e){let t=e.clipboardData?.items;if(!t)return;let n=Array.from(t).filter(r=>r.kind==="file");if(!n.length)return;e.preventDefault();let o=n.reduce((r,d)=>{let v=d.getAsFile();return v?[...r,v]:r},[]);o.length&&this.filesPasted.emit(o)}triggerFileUpload(){console.log("[CHAT-TEXTAREA] Triggering file upload"),this.fileInput?.nativeElement?.click()}onFileInputChange(e){let t=e.target,n=t.files;if(!n||n.length===0){console.log("[CHAT-TEXTAREA] No files selected");return}console.log("[CHAT-TEXTAREA] Files selected:",n.length);let o=Array.from(n);this.filesPasted.emit(o),t.value=""}onDocumentClick(e){if(!this.autocompleteVisible)return;let t=e.target,n=document.querySelector(".autocomplete-popup"),o=this.messageInput?.nativeElement;n&&!n.contains(t)&&o&&!o.contains(t)&&this.hideAutocomplete()}sendMessage(e=!1){let t=this.message.trim();!this.isDisabled&&(e||t)&&(this.isRecording&&this.recognition&&(this.clearPendingLineBreaks(),this.recognition.stop()),this.messageSubmitted.emit(t),this.message="",setTimeout(()=>this.adjustTextareaHeight(),0))}onStopClick(){this.isStopping=!0,this.stopRequested.emit()}toggleRecording(){this.isRecording?this.voiceInputMode==="whisper"||this.voiceInputMode==="voice-message"?this.stopWhisperRecording():this.stopRecording():this.voiceInputMode==="whisper"||this.voiceInputMode==="voice-message"?this.startWhisperRecording():this.startRecording()}startWhisperRecording(){return P(this,null,function*(){if(!this.isRecording)try{let e=yield navigator.mediaDevices.getUserMedia({audio:!0});this.audioChunks=[],this.mediaRecorder=new MediaRecorder(e),this.mediaRecorder.ondataavailable=t=>{t.data.size>0&&this.audioChunks.push(t.data)},this.mediaRecorder.onstop=()=>{e.getTracks().forEach(t=>t.stop()),this.processWhisperAudio()},this.mediaRecorder.onerror=t=>{console.error("[WHISPER] MediaRecorder error:",t),e.getTracks().forEach(n=>n.stop()),this.isRecording=!1,this.voiceRecordingToggled.emit(!1)},this.mediaRecorder.start(),this.isRecording=!0,this.voiceRecordingToggled.emit(!0),console.log("[WHISPER] Started recording")}catch(e){console.error("[WHISPER] Failed to start recording:",e),this.isRecording=!1,this.voiceRecordingToggled.emit(!1)}})}stopWhisperRecording(){if(!(!this.mediaRecorder||!this.isRecording))try{this.mediaRecorder.stop(),this.isRecording=!1,this.voiceRecordingToggled.emit(!1),console.log("[WHISPER] Stopped recording")}catch(e){console.error("[WHISPER] Failed to stop recording:",e),this.isRecording=!1,this.voiceRecordingToggled.emit(!1)}}processWhisperAudio(){if(this.audioChunks.length===0)return;let e=new Blob(this.audioChunks,{type:this.mediaRecorder?.mimeType||"audio/webm"}),t=e.type.split(";")[0]||"audio/webm";this.audioChunks=[],this.isTranscribing=!0;let n=new FileReader;n.onloadend=()=>{let o=n.result.split(",")[1];if(!o){console.error("[WHISPER] Failed to read audio as base64"),this.isTranscribing=!1;return}let d=this.preferencesService.getVoiceLanguage().split("-")[0];if(this.voiceInputMode==="voice-message"){if(!this.threadStateService.getSelectedThreadId()){console.log("[WHISPER] No thread selected \u2014 emitting voiceMessageReady for thread creation"),this.isTranscribing=!1,this.voiceMessageReady.emit({base64:o,mimeType:t,language:d});return}this.audioApiService.sendVoiceMessage(o,t,d).subscribe({next:v=>{this.isTranscribing=!1,console.log("[WHISPER] Voice message sent, transcription:",v.transcription?.substring(0,50))},error:v=>{console.error("[WHISPER] Voice message error:",v),this.isTranscribing=!1,this.fallbackToTranscription(o,t,d)}})}else this.audioApiService.transcribeAudio(o,t,d).subscribe({next:v=>{this.isTranscribing=!1,v.text&&this.appendToTextarea(v.text+" ")},error:v=>{console.error("[WHISPER] Transcription error:",v),this.isTranscribing=!1}})},n.readAsDataURL(e)}fallbackToTranscription(e,t,n){this.audioApiService.transcribeAudio(e,t,n).subscribe({next:o=>{this.isTranscribing=!1,o.text&&this.appendToTextarea(o.text+" ")},error:o=>{console.error("[WHISPER] Fallback transcription also failed:",o),this.isTranscribing=!1}})}initializeVoiceInput(){let e=window.SpeechRecognition??window.webkitSpeechRecognition;if(console.log("[SPEECH] speechRecognition",e),!e){console.warn("[SPEECH] Speech Recognition API not available");return}this.recognition=new e,this.recognition.continuous=!0,this.recognition.interimResults=!0,this.recognition.maxAlternatives=1,this.recognition.lang=this.getSelectedLanguage();try{"grammars"in this.recognition&&(this.recognition.serviceURI=void 0)}catch(t){console.log("[SPEECH] Advanced speech recognition parameters not supported")}this.recognition.onresult=t=>{let n="",o=Math.max(t.resultIndex,this.lastProcessedResultIndex);for(let r=o;r<t.results.length;r++)t.results[r].isFinal&&(n+=t.results[r][0].transcript,this.lastProcessedResultIndex=r+1);if(n){let r=this.improveTranscriptPunctuation(n.trim());this.sessionHadTranscript=!0,console.log("[SPEECH] onresult ending, appending to textarea",this.isRecording),this.appendToTextarea(r)}},this.recognition.onend=()=>{console.log("[SPEECH] Recognition ended. Was recording:",this.isRecording),this.isRecording=!1,this.lastProcessedResultIndex=0,this.voiceRecordingToggled.emit(this.isRecording)},this.recognition.onerror=t=>{console.error("[SPEECH] Speech recognition error:",t.error),console.log("[SPEECH] Error details:",{error:t.error,message:t.message,timeStamp:t.timeStamp}),this.isRecording=!1,this.lastProcessedResultIndex=0,this.clearPendingLineBreaks(),this.voiceRecordingToggled.emit(this.isRecording)},this.recognition.onstart=()=>{console.log("[SPEECH] Recognition started successfully")},this.recognition.onspeechstart=()=>{console.log("[SPEECH] Speech detected")},this.recognition.onspeechend=()=>{console.log("[SPEECH] Speech ended")}}startRecording(){return P(this,null,function*(){if(!(!this.recognition||this.isRecording))try{this.isRecording=!0,this.sessionHadTranscript=!1,this.lastProcessedResultIndex=0,this.clearPendingLineBreaks(),this.voiceRecordingToggled.emit(this.isRecording),this.recognition.start(),console.log("[SPEECH] Started recording")}catch(e){console.error("[SPEECH] Failed to start recording:",e),this.isRecording=!1,this.voiceRecordingToggled.emit(this.isRecording)}})}stopRecording(){if(!this.recognition||!this.isRecording){console.log("[SPEECH] stopRecording not recording");return}try{console.log("[SPEECH] stopRecording recognition stop"),this.recognition.stop(),this.schedulePendingLineBreaks()}catch(e){console.error("[SPEECH] Failed to stop recording:",e)}}getSelectedLanguage(){return this.preferencesService.getVoiceLanguage()}updateRecognitionLanguage(){if(this.recognition){let e=this.getSelectedLanguage();this.recognition.lang=e,console.log("[SPEECH] Language changed to:",e)}}improveTranscriptPunctuation(e){let t=e;return/[.!?]$/.test(t.trim())||(t=t.trim()+"."),t=t.charAt(0).toUpperCase()+t.slice(1),t=t.replace(/\s+/g," "),t=t+" ",t}appendToTextarea(e){let t=this.message;if(this.message=t?`${t}${e}`:e,this.messageInput?.nativeElement){this.messageInput.nativeElement.focus();let n=this.message.length;this.messageInput.nativeElement.setSelectionRange(n,n)}setTimeout(()=>this.adjustTextareaHeight(),0)}schedulePendingLineBreaks(){this.clearPendingLineBreaks(),this.pendingLineBreaksTimeout=window.setTimeout(()=>{this.sessionHadTranscript&&(console.log("[SPEECH] Adding line breaks after transcript session"),this.appendToTextarea(`
|
|
1
|
+
import{a as Cn}from"./chunk-S5XVTDPO.js";import{a as Ue,b as Be,c as _n,e as ce}from"./chunk-L2CXQ5ZG.js";import{a as yn,b as wn,c as Tn}from"./chunk-VR3I4RKJ.js";import{a as Ke}from"./chunk-I2FVKUBH.js";import{a as je,b as X,c as ln,d as se,i as mn,j as pn,k as un,o as gn,p as hn,r as fn,t as Qe,v as bn,x as vn,y as Xe}from"./chunk-AEGHERYH.js";import{a as xn}from"./chunk-R7YB3V2E.js";import{c as Kt}from"./chunk-MZT6I3S3.js";import{a as In}from"./chunk-A7WS3RLV.js";import{r as On,v as kn}from"./chunk-N347WQAU.js";import{b as dn,h as Sn,i as Mn,j as En,n as Pn}from"./chunk-MWPKXBXJ.js";import{a as cn,c as $e}from"./chunk-3ZLLFAXF.js";import{a as R,b as L}from"./chunk-Q2M4W42M.js";import{E as Ge,c as We,g as qe,m as Ye}from"./chunk-DDWYQORF.js";import{b as Q}from"./chunk-JF3TWRKD.js";import{E as rn,K as an,O as re,Q as sn,R as Ne,S as ae,i as Jt,j as Zt,p as en,s as tn,t as nn,z as on}from"./chunk-B46LXCLF.js";import{$b as He,B as W,Bb as _,D as De,Db as h,Fb as l,G as Ft,Ga as z,Ha as Lt,Ic as ze,Ja as zt,Jb as ge,Ka as c,Kb as J,Kc as Xt,Lb as Z,Lc as St,Oc as j,Pa as Nt,Rb as N,T as F,Tb as p,Ub as S,Vb as he,Wa as T,Wb as Ae,Wc as Y,Xa as $t,Ya as jt,Z as k,Za as Ut,Zb as Fe,Zc as G,_ as Rt,_b as Re,a as de,ac as Wt,b as Oe,bc as qt,ca as m,cc as Yt,d as P,dc as Gt,fc as Ee,g as ke,ga as f,gc as Qt,h as B,ha as b,hc as Tt,i as Ie,jb as oe,la as Ht,lb as u,m as xt,mb as g,mc as Ve,n as Dt,oa as M,pa as Vt,pb as H,qb as V,rb as C,sb as a,t as ne,ta as ie,tb as s,u as At,ub as y,va as q,vb as yt,wb as wt,xb as Bt,xc as Le,ya as ue}from"./chunk-KJ5SIUGY.js";var Je=class i{sanitizer=m(G);transform(e,t){if(!t||!e)return e;let n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`(${n})`,"gi"),r=e.replace(o,"<strong>$1</strong>");return this.sanitizer.bypassSecurityTrustHtml(r)}static \u0275fac=function(t){return new(t||i)};static \u0275pipe=Ut({name:"highlight",type:i,pure:!0})};var fe=class i{http=m(Y);projectState=m(Q);threadState=m(X);transcribeAudio(e,t,n){let o=this.projectState.getSelectedProjectIdOrThrow();return this.http.post(`/api/projects/${o}/transcribe`,de({audio:e,mimeType:t},n?{language:n}:{}))}sendVoiceMessage(e,t,n){let o=this.projectState.getSelectedProjectIdOrThrow(),r=this.threadState.getSelectedThreadIdOrThrow();return this.http.post(`/api/projects/${o}/threads/${r}/voice-message`,de({audio:e,mimeType:t},n?{language:n}:{}))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=k({token:i,factory:i.\u0275fac,providedIn:"root"})};var hi=["messageInput"],fi=["fileInput"],bi=(i,e)=>e.name;function vi(i,e){i&1&&(a(0,"div",3),y(1,"span",8),p(2," Recording... Click mic to stop "),s())}function Ci(i,e){i&1&&(a(0,"div",3),y(1,"span",9),p(2," Transcribing... "),s())}function _i(i,e){if(i&1&&(a(0,"span",14),p(1),s()),i&2){let t=l().$implicit,n=l(2);c(),S(" "+(n.getParameterFormat(t)||""))}}function xi(i,e){if(i&1){let t=_();a(0,"div",11),h("click",function(){let o=f(t).$index,r=l(2);return b(r.selectAutocompleteItemByClick(o))})("keydown.enter",function(){let o=f(t).$index,r=l(2);return b(r.selectAutocompleteItemByClick(o))})("keydown.space",function(){let o=f(t).$index,r=l(2);return b(r.selectAutocompleteItemByClick(o))})("mouseenter",function(){let o=f(t).$index,r=l(2);return b(r.selectedAutocompleteIndex=o)}),a(1,"div",12),y(2,"span",13),Ee(3,"highlight"),u(4,_i,2,1,"span",14),s(),y(5,"div",15),Ee(6,"highlight"),s()}if(i&2){let t=e.$implicit,n=e.$index,o=l(2);N("selected",n===o.selectedAutocompleteIndex),oe("aria-selected",n===o.selectedAutocompleteIndex),c(2),C("innerHTML",Tt(3,6,o.autocompleteTrigger+t.name,o.getAutocompleteQuery()),z),c(2),g(o.hasParameterFormat(t)?4:-1),c(),C("innerHTML",Tt(6,9,t.description,o.getAutocompleteQuery()),z)}}function yi(i,e){if(i&1&&(a(0,"div",4),H(1,xi,7,12,"div",10,bi),s()),i&2){let t=l();c(),V(t.autocompleteItems)}}function wi(i,e){if(i&1){let t=_();a(0,"ds-icon-button",18),h("action",function(){f(t);let o=l(2);return b(o.onStopClick())}),s()}}function Ti(i,e){if(i&1){let t=_();a(0,"ds-icon-button",19),h("action",function(){f(t);let o=l(2);return b(o.sendMessage())}),s()}if(i&2){let t=l(2);N("hidden",t.isDisabled||!t.message.trim())("active",!!t.message.trim()&&!t.isDisabled),C("title",t.getSendButtonTooltip())("disabled",t.isDisabled||!t.message.trim())}}function Si(i,e){if(i&1){let t=_();a(0,"ds-icon-button",21),h("action",function(){f(t);let o=l(3);return b(o.triggerFileUpload())}),s(),a(1,"input",22,1),h("change",function(o){f(t);let r=l(3);return b(r.onFileInputChange(o))}),s()}if(i&2){let t=l(3);C("disabled",t.isDisabled)}}function Mi(i,e){if(i&1){let t=_();u(0,Si,3,1),a(1,"ds-icon-button",20),h("action",function(){f(t);let o=l(2);return b(o.toggleRecording())}),s()}if(i&2){let t=l(2);g(!t.showWelcome&&!(t.isVoiceMessageMode&&(t.isRecording||t.isTranscribing))?0:-1),c(),N("hidden",t.message.trim()&&!t.isRecording&&!t.isTranscribing),C("variant",t.isVoiceMessageMode&&(t.isRecording||t.isTranscribing)?"danger":"default")("disabled",t.isVoiceMessageMode&&t.isTranscribing)("title",t.isRecording?"Click to stop recording":t.isTranscribing?"Uploading...":"Click to start recording")}}function Ei(i,e){if(i&1&&(a(0,"div",7),u(1,wi,1,0,"ds-icon-button",16),u(2,Ti,1,6,"ds-icon-button",17),u(3,Mi,2,6),s()),i&2){let t=l();c(),g(t.isThinking?1:-1),c(),g((!t.isThinking||t.message.trim())&&!(t.isVoiceMessageMode&&(t.isRecording||t.isTranscribing))?2:-1),c(),g(t.isThinking?-1:3)}}var Ze=class i{isDisabled=!1;showWelcome=!1;isThinking=!1;isStarting=!1;isSessionInitializing=!1;isStopping=!1;filesPasted=new M;messageSubmitted=new M;voiceMessageReady=new M;voiceRecordingToggled=new M;heightChanged=new M;stopRequested=new M;textareaFocused=new M;messageInput;fileInput;message="";isRecording=!1;isTranscribing=!1;isFocused=!1;recognition=null;mediaRecorder=null;audioChunks=[];voiceInputMode="browser";get isVoiceMessageMode(){return this.voiceInputMode==="voice-message"}sessionHadTranscript=!1;pendingLineBreaksTimeout=null;lastProcessedResultIndex=0;useEnterToSend=!1;currentInvite="";subscriptions=[];thinkingPhrases=["Processing request...","Thinking...","Working on it..."];currentThinkingPhrase="Processing request...";thinkingPhraseIndex=0;thinkingInterval=null;autocompleteVisible=!1;autocompleteTrigger=null;autocompleteItems=[];selectedAutocompleteIndex=0;preferencesService=m(se);codayService=m(ce);agentApiService=m(Cn);promptApiService=m(In);projectStateService=m(Q);audioApiService=m(fe);threadStateService=m(X);ngOnInit(){this.initializeVoiceInput(),this.useEnterToSend=this.preferencesService.getEnterToSend(),this.subscriptions.push(this.preferencesService.voiceLanguage$.subscribe(()=>this.updateRecognitionLanguage())),this.subscriptions.push(this.preferencesService.voiceInputMode$.subscribe(e=>{this.voiceInputMode=e})),this.subscriptions.push(this.preferencesService.enterToSend$.subscribe(e=>{this.useEnterToSend=e})),this.subscribeToInviteEvents(),this.subscribeToMessageRestore()}ngAfterViewInit(){this.adjustTextareaHeight(),requestAnimationFrame(()=>{setTimeout(()=>this.focusTextarea(),200)})}ngOnChanges(e){e.isThinking&&(e.isThinking.currentValue?this.startThinkingAnimation():(this.stopThinkingAnimation(),this.isStopping=!1,e.isThinking.previousValue&&(console.log("[CHAT-TEXTAREA] Thinking ended, scheduling focus"),requestAnimationFrame(()=>{setTimeout(()=>this.focusTextarea(),100)})))),e.isSessionInitializing&&!e.isSessionInitializing.currentValue&&e.isSessionInitializing.previousValue&&(console.log("[CHAT-TEXTAREA] Session initialization completed, scheduling focus"),requestAnimationFrame(()=>{setTimeout(()=>this.focusTextarea(),100)})),e.isStarting&&!e.isStarting.currentValue&&e.isStarting.previousValue&&this.isThinking&&(this.thinkingPhraseIndex===0?(console.log("[CHAT-TEXTAREA] Transitioning from Starting to Thinking at index 0 - restarting animation"),this.stopThinkingAnimation(),this.startThinkingAnimation()):console.log("[CHAT-TEXTAREA] Transitioning from Starting to Thinking at index",this.thinkingPhraseIndex,"- continuing without restart"))}ngOnDestroy(){this.subscriptions.forEach(e=>e.unsubscribe()),this.subscriptions=[],this.clearPendingLineBreaks(),this.stopThinkingAnimation()}onKeyDown(e){if(this.autocompleteVisible)switch(e.key){case"ArrowDown":e.preventDefault(),this.selectedAutocompleteIndex=Math.min(this.selectedAutocompleteIndex+1,this.autocompleteItems.length-1),this.scrollSelectedItemIntoView();return;case"ArrowUp":e.preventDefault(),this.selectedAutocompleteIndex=Math.max(this.selectedAutocompleteIndex-1,0),this.scrollSelectedItemIntoView();return;case"Tab":case"Enter":if(!this.message.includes(" ")){e.preventDefault(),this.selectAutocompleteItem();return}break;case"Escape":e.preventDefault(),this.hideAutocomplete();return}e.key==="Enter"&&(this.useEnterToSend?!e.shiftKey&&!e.metaKey&&!e.ctrlKey&&(e.preventDefault(),this.sendMessage(!0)):(navigator.platform.toLowerCase().includes("mac")?e.metaKey:e.ctrlKey)&&!e.shiftKey&&(e.preventDefault(),this.sendMessage(!0)))}onInput(){this.adjustTextareaHeight(),this.checkForAutocomplete()}onPaste(e){let t=e.clipboardData?.items;if(!t)return;let n=Array.from(t).filter(r=>r.kind==="file");if(!n.length)return;e.preventDefault();let o=n.reduce((r,d)=>{let v=d.getAsFile();return v?[...r,v]:r},[]);o.length&&this.filesPasted.emit(o)}triggerFileUpload(){console.log("[CHAT-TEXTAREA] Triggering file upload"),this.fileInput?.nativeElement?.click()}onFileInputChange(e){let t=e.target,n=t.files;if(!n||n.length===0){console.log("[CHAT-TEXTAREA] No files selected");return}console.log("[CHAT-TEXTAREA] Files selected:",n.length);let o=Array.from(n);this.filesPasted.emit(o),t.value=""}onDocumentClick(e){if(!this.autocompleteVisible)return;let t=e.target,n=document.querySelector(".autocomplete-popup"),o=this.messageInput?.nativeElement;n&&!n.contains(t)&&o&&!o.contains(t)&&this.hideAutocomplete()}sendMessage(e=!1){let t=this.message.trim();!this.isDisabled&&(e||t)&&(this.isRecording&&this.recognition&&(this.clearPendingLineBreaks(),this.recognition.stop()),this.messageSubmitted.emit(t),this.message="",setTimeout(()=>this.adjustTextareaHeight(),0))}onStopClick(){this.isStopping=!0,this.stopRequested.emit()}toggleRecording(){this.isRecording?this.voiceInputMode==="whisper"||this.voiceInputMode==="voice-message"?this.stopWhisperRecording():this.stopRecording():this.voiceInputMode==="whisper"||this.voiceInputMode==="voice-message"?this.startWhisperRecording():this.startRecording()}startWhisperRecording(){return P(this,null,function*(){if(!this.isRecording)try{let e=yield navigator.mediaDevices.getUserMedia({audio:!0});this.audioChunks=[],this.mediaRecorder=new MediaRecorder(e),this.mediaRecorder.ondataavailable=t=>{t.data.size>0&&this.audioChunks.push(t.data)},this.mediaRecorder.onstop=()=>{e.getTracks().forEach(t=>t.stop()),this.processWhisperAudio()},this.mediaRecorder.onerror=t=>{console.error("[WHISPER] MediaRecorder error:",t),e.getTracks().forEach(n=>n.stop()),this.isRecording=!1,this.voiceRecordingToggled.emit(!1)},this.mediaRecorder.start(),this.isRecording=!0,this.voiceRecordingToggled.emit(!0),console.log("[WHISPER] Started recording")}catch(e){console.error("[WHISPER] Failed to start recording:",e),this.isRecording=!1,this.voiceRecordingToggled.emit(!1)}})}stopWhisperRecording(){if(!(!this.mediaRecorder||!this.isRecording))try{this.mediaRecorder.stop(),this.isRecording=!1,this.voiceRecordingToggled.emit(!1),console.log("[WHISPER] Stopped recording")}catch(e){console.error("[WHISPER] Failed to stop recording:",e),this.isRecording=!1,this.voiceRecordingToggled.emit(!1)}}processWhisperAudio(){if(this.audioChunks.length===0)return;let e=new Blob(this.audioChunks,{type:this.mediaRecorder?.mimeType||"audio/webm"}),t=e.type.split(";")[0]||"audio/webm";this.audioChunks=[],this.isTranscribing=!0;let n=new FileReader;n.onloadend=()=>{let o=n.result.split(",")[1];if(!o){console.error("[WHISPER] Failed to read audio as base64"),this.isTranscribing=!1;return}let d=this.preferencesService.getVoiceLanguage().split("-")[0];if(this.voiceInputMode==="voice-message"){if(!this.threadStateService.getSelectedThreadId()){console.log("[WHISPER] No thread selected \u2014 emitting voiceMessageReady for thread creation"),this.isTranscribing=!1,this.voiceMessageReady.emit({base64:o,mimeType:t,language:d});return}this.audioApiService.sendVoiceMessage(o,t,d).subscribe({next:v=>{this.isTranscribing=!1,console.log("[WHISPER] Voice message sent, transcription:",v.transcription?.substring(0,50))},error:v=>{console.error("[WHISPER] Voice message error:",v),this.isTranscribing=!1,this.fallbackToTranscription(o,t,d)}})}else this.audioApiService.transcribeAudio(o,t,d).subscribe({next:v=>{this.isTranscribing=!1,v.text&&this.appendToTextarea(v.text+" ")},error:v=>{console.error("[WHISPER] Transcription error:",v),this.isTranscribing=!1}})},n.readAsDataURL(e)}fallbackToTranscription(e,t,n){this.audioApiService.transcribeAudio(e,t,n).subscribe({next:o=>{this.isTranscribing=!1,o.text&&this.appendToTextarea(o.text+" ")},error:o=>{console.error("[WHISPER] Fallback transcription also failed:",o),this.isTranscribing=!1}})}initializeVoiceInput(){let e=window.SpeechRecognition??window.webkitSpeechRecognition;if(console.log("[SPEECH] speechRecognition",e),!e){console.warn("[SPEECH] Speech Recognition API not available");return}this.recognition=new e,this.recognition.continuous=!0,this.recognition.interimResults=!0,this.recognition.maxAlternatives=1,this.recognition.lang=this.getSelectedLanguage();try{"grammars"in this.recognition&&(this.recognition.serviceURI=void 0)}catch(t){console.log("[SPEECH] Advanced speech recognition parameters not supported")}this.recognition.onresult=t=>{let n="",o=Math.max(t.resultIndex,this.lastProcessedResultIndex);for(let r=o;r<t.results.length;r++)t.results[r].isFinal&&(n+=t.results[r][0].transcript,this.lastProcessedResultIndex=r+1);if(n){let r=this.improveTranscriptPunctuation(n.trim());this.sessionHadTranscript=!0,console.log("[SPEECH] onresult ending, appending to textarea",this.isRecording),this.appendToTextarea(r)}},this.recognition.onend=()=>{console.log("[SPEECH] Recognition ended. Was recording:",this.isRecording),this.isRecording=!1,this.lastProcessedResultIndex=0,this.voiceRecordingToggled.emit(this.isRecording)},this.recognition.onerror=t=>{console.error("[SPEECH] Speech recognition error:",t.error),console.log("[SPEECH] Error details:",{error:t.error,message:t.message,timeStamp:t.timeStamp}),this.isRecording=!1,this.lastProcessedResultIndex=0,this.clearPendingLineBreaks(),this.voiceRecordingToggled.emit(this.isRecording)},this.recognition.onstart=()=>{console.log("[SPEECH] Recognition started successfully")},this.recognition.onspeechstart=()=>{console.log("[SPEECH] Speech detected")},this.recognition.onspeechend=()=>{console.log("[SPEECH] Speech ended")}}startRecording(){return P(this,null,function*(){if(!(!this.recognition||this.isRecording))try{this.isRecording=!0,this.sessionHadTranscript=!1,this.lastProcessedResultIndex=0,this.clearPendingLineBreaks(),this.voiceRecordingToggled.emit(this.isRecording),this.recognition.start(),console.log("[SPEECH] Started recording")}catch(e){console.error("[SPEECH] Failed to start recording:",e),this.isRecording=!1,this.voiceRecordingToggled.emit(this.isRecording)}})}stopRecording(){if(!this.recognition||!this.isRecording){console.log("[SPEECH] stopRecording not recording");return}try{console.log("[SPEECH] stopRecording recognition stop"),this.recognition.stop(),this.schedulePendingLineBreaks()}catch(e){console.error("[SPEECH] Failed to stop recording:",e)}}getSelectedLanguage(){return this.preferencesService.getVoiceLanguage()}updateRecognitionLanguage(){if(this.recognition){let e=this.getSelectedLanguage();this.recognition.lang=e,console.log("[SPEECH] Language changed to:",e)}}improveTranscriptPunctuation(e){let t=e;return/[.!?]$/.test(t.trim())||(t=t.trim()+"."),t=t.charAt(0).toUpperCase()+t.slice(1),t=t.replace(/\s+/g," "),t=t+" ",t}appendToTextarea(e){let t=this.message;if(this.message=t?`${t}${e}`:e,this.messageInput?.nativeElement){this.messageInput.nativeElement.focus();let n=this.message.length;this.messageInput.nativeElement.setSelectionRange(n,n)}setTimeout(()=>this.adjustTextareaHeight(),0)}schedulePendingLineBreaks(){this.clearPendingLineBreaks(),this.pendingLineBreaksTimeout=window.setTimeout(()=>{this.sessionHadTranscript&&(console.log("[SPEECH] Adding line breaks after transcript session"),this.appendToTextarea(`
|
|
2
2
|
|
|
3
3
|
`),this.sessionHadTranscript=!1),this.pendingLineBreaksTimeout=null},500)}clearPendingLineBreaks(){this.pendingLineBreaksTimeout&&(clearTimeout(this.pendingLineBreaksTimeout),this.pendingLineBreaksTimeout=null)}adjustTextareaHeight(){let e=this.messageInput?.nativeElement;if(!e)return;let t=e.parentElement?.offsetHeight??e.offsetHeight+32;this.heightChanged.emit(t)}getSendButtonShortcut(){return this.useEnterToSend?"Enter":navigator.platform.toLowerCase().includes("mac")?"\u2318+Enter":"Ctrl+Enter"}getSendButtonTooltip(){return this.useEnterToSend?"Send message (Enter) - Shift+Enter for new line":`Send message (${navigator.platform.toLowerCase().includes("mac")?"Cmd+Enter":"Ctrl+Enter"}) - Enter for new line`}getPlaceholder(){return this.isSessionInitializing?"Initializing session...":this.isThinking?this.isStopping?"Stopping...":this.isStarting?"Processing request...":this.currentThinkingPhrase:this.isVoiceMessageMode&&this.isTranscribing?"Uploading...":this.isVoiceMessageMode&&this.isRecording?"Listening...":this.showWelcome?"How can I help you today?":"Type '@' for agents, '/' for commands, or just your message..."}startThinkingAnimation(){this.thinkingPhraseIndex=0,this.currentThinkingPhrase=this.thinkingPhrases[0]??"Thinking...",this.thinkingInterval=window.setInterval(()=>{this.thinkingPhraseIndex<this.thinkingPhrases.length-1&&(this.thinkingPhraseIndex++,this.currentThinkingPhrase=this.thinkingPhrases[this.thinkingPhraseIndex]??"Thinking...")},2e3)}stopThinkingAnimation(){this.thinkingInterval&&(clearInterval(this.thinkingInterval),this.thinkingInterval=null),this.thinkingPhraseIndex=0,this.currentThinkingPhrase="Thinking..."}subscribeToInviteEvents(){this.subscriptions.push(this.codayService.currentInviteEvent$.subscribe(e=>{e?this.handleInviteEvent(e.invite,e.defaultValue):this.currentInvite=""}))}handleInviteEvent(e,t){this.currentInvite=e,t&&(this.message=t,setTimeout(()=>this.adjustTextareaHeight(),0)),setTimeout(()=>{this.messageInput?.nativeElement&&this.messageInput.nativeElement.focus()},50)}subscribeToMessageRestore(){this.subscriptions.push(this.codayService.messageToRestore$.subscribe(e=>{e.trim()&&(console.log("[CHAT-TEXTAREA] Restoring message content:",e.substring(0,50)+"..."),this.restoreMessageContent(e))}))}restoreMessageContent(e){this.message=e,this.messageInput?.nativeElement&&(this.messageInput.nativeElement.focus(),setTimeout(()=>{let t=this.messageInput.nativeElement,n=this.message.length;t.setSelectionRange(n,n)},0)),setTimeout(()=>this.adjustTextareaHeight(),10)}focusTextarea(){let e=this.messageInput?.nativeElement;console.log("[CHAT-TEXTAREA] focusTextarea called",{hasElement:!!e,isDisabled:this.isDisabled,isThinking:this.isThinking,elementDisabled:e?.disabled,isSessionInitializing:this.isSessionInitializing}),e&&!e.disabled?(e.focus(),console.log("[CHAT-TEXTAREA] Textarea focused successfully")):console.log("[CHAT-TEXTAREA] Focus blocked - element disabled or not available")}checkForAutocomplete(){let e=this.message;if(e.startsWith("@")){let t=e.substring(1);if(t.includes(" ")){this.hideAutocomplete();return}this.showAgentAutocomplete(t);return}if(e.startsWith("/")){let t=e.substring(1);if(t.includes(" ")){this.hideAutocomplete();return}this.showPromptAutocomplete(t);return}this.hideAutocomplete()}showAgentAutocomplete(e){this.autocompleteTrigger="@";try{let t=this.projectStateService.getSelectedProjectIdOrThrow();this.agentApiService.getAgentsAutocomplete(t,e).subscribe({next:n=>{this.autocompleteItems=n,this.autocompleteVisible=n.length>0,this.selectedAutocompleteIndex=0},error:n=>{console.error("[AUTOCOMPLETE] Error loading agents:",n),this.hideAutocomplete()}})}catch(t){console.warn("[AUTOCOMPLETE] No project selected, cannot load agents"),this.hideAutocomplete()}}showPromptAutocomplete(e){this.autocompleteTrigger="/";try{let t=this.projectStateService.getSelectedProjectIdOrThrow();this.promptApiService.getPromptsAutocomplete(t,e).subscribe({next:n=>{this.autocompleteItems=n,this.autocompleteVisible=n.length>0,this.selectedAutocompleteIndex=0},error:n=>{console.error("[AUTOCOMPLETE] Error loading prompts:",n),this.hideAutocomplete()}})}catch(t){console.warn("[AUTOCOMPLETE] No project selected, cannot load prompts"),this.hideAutocomplete()}}hideAutocomplete(){this.autocompleteVisible=!1,this.autocompleteItems=[],this.selectedAutocompleteIndex=0}selectAutocompleteItem(){let e=this.autocompleteItems[this.selectedAutocompleteIndex];if(!e)return;let t=null;if(this.autocompleteTrigger==="/"){let n=e,o=n.parameterFormat;if(console.log(n),o===void 0)this.message=`/${e.name}`;else if(o==="")this.message=`/${e.name} `;else{this.message=`/${e.name} ${o}`;let r=this.message.indexOf('=""');r!==-1&&(t=r+2)}}else this.message=`@${e.name} `;this.hideAutocomplete(),setTimeout(()=>{if(this.messageInput?.nativeElement)if(this.messageInput.nativeElement.focus(),t!==null)this.messageInput.nativeElement.setSelectionRange(t,t);else{let n=this.message.length;this.messageInput.nativeElement.setSelectionRange(n,n)}},0)}selectAutocompleteItemByClick(e){this.selectedAutocompleteIndex=e,this.selectAutocompleteItem()}getAutocompleteQuery(){return this.message.substring(1).split(" ")[0]??""}getParameterFormat(e){return e.parameterFormat}hasParameterFormat(e){return this.autocompleteTrigger==="/"&&e.parameterFormat!==void 0}scrollSelectedItemIntoView(){setTimeout(()=>{let e=document.querySelector(".autocomplete-popup");if(!e)return;let t=e.querySelector(".autocomplete-item.selected");t&&t.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},0)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=T({type:i,selectors:[["app-chat-textarea"]],viewQuery:function(t,n){if(t&1&&ge(hi,7)(fi,5),t&2){let o;J(o=Z())&&(n.messageInput=o.first),J(o=Z())&&(n.fileInput=o.first)}},hostBindings:function(t,n){t&1&&h("paste",function(r){return n.onPaste(r)})("click",function(r){return n.onDocumentClick(r)},zt)},inputs:{isDisabled:"isDisabled",showWelcome:"showWelcome",isThinking:"isThinking",isStarting:"isStarting",isSessionInitializing:"isSessionInitializing"},outputs:{filesPasted:"filesPasted",messageSubmitted:"messageSubmitted",voiceMessageReady:"voiceMessageReady",voiceRecordingToggled:"voiceRecordingToggled",heightChanged:"heightChanged",stopRequested:"stopRequested",textareaFocused:"textareaFocused"},features:[q],decls:8,vars:15,consts:[["messageInput",""],["fileInput",""],[1,"chat-input-container"],[1,"recording-indicator"],[1,"autocomplete-popup"],[1,"input-row","grouped-input"],[1,"message-input",3,"ngModelChange","keydown","input","focus","blur","ngModel","placeholder","disabled"],[1,"actions"],[1,"recording-dot"],[1,"transcribing-dot"],["role","option","tabindex","0",1,"autocomplete-item",3,"selected"],["role","option","tabindex","0",1,"autocomplete-item",3,"click","keydown.enter","keydown.space","mouseenter"],[1,"item-name"],[3,"innerHTML"],[1,"parameter-format"],[1,"item-description",3,"innerHTML"],["icon","stop","variant","danger","title","Stop generation",1,"action-btn"],["icon","send","variant","primary",1,"send-btn",3,"title","disabled","hidden","active"],["icon","stop","variant","danger","title","Stop generation",1,"action-btn",3,"action"],["icon","send","variant","primary",1,"send-btn",3,"action","title","disabled"],["icon","mic",1,"voice-btn",3,"action","variant","disabled","title"],["icon","attach_file","variant","default","title","Upload files (images or documents)",1,"upload-btn",3,"action","disabled"],["type","file","multiple","","accept","image/*,application/pdf,.pdf,.doc,.docx,.txt,.md,.json,.yaml,.yml,.csv,.xml,.html",2,"display","none",3,"change"]],template:function(t,n){if(t&1){let o=_();a(0,"div",2),u(1,vi,3,0,"div",3),u(2,Ci,3,0,"div",3),u(3,yi,3,0,"div",4),a(4,"div",5)(5,"textarea",6,0),He("ngModelChange",function(d){return f(o),Re(n.message,d)||(n.message=d),b(d)}),h("keydown",function(d){return n.onKeyDown(d)})("input",function(){return n.onInput()})("focus",function(){return f(o),n.isFocused=!0,b(n.textareaFocused.emit())})("blur",function(){return n.isFocused=!1}),s(),u(7,Ei,4,3,"div",7),s()()}t&2&&(c(),g(!n.isVoiceMessageMode&&n.isRecording?1:-1),c(),g(!n.isVoiceMessageMode&&n.isTranscribing?2:-1),c(),g(n.autocompleteVisible?3:-1),c(),N("focused",n.isFocused)("welcome-mode",n.showWelcome)("is-thinking",n.isThinking)("is-listening",n.isVoiceMessageMode&&(n.isRecording||n.isTranscribing)),c(),Fe("ngModel",n.message),C("placeholder",n.getPlaceholder())("disabled",n.isDisabled||n.isVoiceMessageMode&&(n.isRecording||n.isTranscribing)),c(2),g(n.isSessionInitializing?-1:7))},dependencies:[Ge,We,qe,Ye,On,Je],styles:['@keyframes _ngcontent-%COMP%_gradientBorderShift{0%{background-position:0 0}50%{background-position:100% 0}to{background-position:0 0}}.chat-input-container[_ngcontent-%COMP%]{flex-shrink:0;width:100%;position:relative}.thinking-progress[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0;height:3px;z-index:1}.thinking-progress[_ngcontent-%COMP%] .mdc-linear-progress__bar-inner{border-top-width:3px}.input-row.grouped-input[_ngcontent-%COMP%]{display:flex;align-items:stretch;background:var(--glass-bg);border-radius:16px;padding:0 .15rem 0 1.25rem;position:relative;transition:border-color .2s,box-shadow .2s,background .3s}.input-row[_ngcontent-%COMP%]{position:relative;background:var(--glass-bg, #1e1e1e)!important;background-clip:padding-box}.input-row[_ngcontent-%COMP%]:before{content:"";position:absolute;inset:-2px;border-radius:inherit;background-size:200% 100%;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);-webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;padding:1px;pointer-events:none;z-index:-1;animation:_ngcontent-%COMP%_gradientBorderShift 3s ease-in-out infinite}.input-row.is-listening[_ngcontent-%COMP%]:before{inset:0;-webkit-mask:none;mask:none;padding:0;opacity:.15;z-index:0;background:linear-gradient(90deg,var(--color-error, #ef4444) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-error, #ef4444) 100%);background-size:200% 100%;animation:_ngcontent-%COMP%_gradientBorderShift 2s ease-in-out infinite}.input-row.is-listening[_ngcontent-%COMP%] .message-input[_ngcontent-%COMP%], .input-row.is-listening[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%]{position:relative;z-index:1}.input-row.is-thinking[_ngcontent-%COMP%]:before{inset:0;-webkit-mask:none;mask:none;padding:0;opacity:.15;z-index:0;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 100%);background-size:200% 100%;animation:_ngcontent-%COMP%_gradientBorderShift 3s ease-in-out infinite}.input-row.is-thinking[_ngcontent-%COMP%] .message-input[_ngcontent-%COMP%], .input-row.is-thinking[_ngcontent-%COMP%] .action-btn[_ngcontent-%COMP%]{position:relative;z-index:1}.input-row.grouped-input.focused[_ngcontent-%COMP%]:not(.is-thinking):before{background:var(--color-primary);animation:none}.input-row.grouped-input.focused[_ngcontent-%COMP%]:not(.is-thinking){box-shadow:0 0 0 4px #007aff1a}.message-input[_ngcontent-%COMP%]{flex:1;border:none;outline:none;background:transparent!important;box-shadow:none;font-size:1rem;padding:1rem 0;color:var(--color-text);resize:none;field-sizing:content;min-height:36px;max-height:70vh;overflow-y:auto;font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,system-ui,sans-serif;line-height:1.5}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-border);border-radius:4px}.message-input[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text-secondary)}.message-input[_ngcontent-%COMP%]:focus{outline:none;border:none;box-shadow:none}.message-input[_ngcontent-%COMP%]:disabled{background-color:var(--color-bg-secondary);color:var(--color-text-secondary);cursor:not-allowed;opacity:.6}.message-input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);transition:opacity .3s ease-in-out}.message-input[_ngcontent-%COMP%]:disabled::placeholder{animation:_ngcontent-%COMP%_thinkingPulsate 2s ease-in-out infinite}@keyframes _ngcontent-%COMP%_thinkingPulsate{0%,to{opacity:.6}50%{opacity:1}}.voice-btn[_ngcontent-%COMP%], .send-btn[_ngcontent-%COMP%], .action-btn[_ngcontent-%COMP%], .upload-btn[_ngcontent-%COMP%]{margin:0}.actions[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex-wrap:wrap;justify-content:center}.send-btn[_ngcontent-%COMP%]{transition:opacity .4s,margin-left .4s}.send-btn.active[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{opacity:1}.send-btn[_ngcontent-%COMP%]:not(.active) button[_ngcontent-%COMP%]{opacity:0;margin-left:calc(-.5rem - 36px)}.send-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover:not(:disabled){color:#fff;background:linear-gradient(90deg,var(--color-primary, #3b82f6) 0%,var(--color-primary, #3b82f6) 20%,var(--color-accent, #8b5cf6) 50%,var(--color-primary, #3b82f6) 80%,var(--color-primary, #3b82f6) 100%);background-size:300% auto;animation:sendButtonGradientShift 6s ease-in-out infinite;box-shadow:0 4px 14px #007aff30;transform:scale(1.2)}.send-btn[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:active:not(:disabled){transform:scale(1.3);box-shadow:0 4px 24px #007aff30}.recording-indicator[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-top:.2rem;margin-bottom:.2rem;color:var(--color-error, #ff5555);font-size:.9rem;position:absolute;top:-1.5rem}@keyframes _ngcontent-%COMP%_pulse{0%,to{opacity:1}50%{opacity:.5}}.autocomplete-popup[_ngcontent-%COMP%]{position:absolute;bottom:100%;left:0;right:0;margin-bottom:.5rem;background:var(--glass-bg);-webkit-backdrop-filter:var(--glass-backdrop-blur);backdrop-filter:var(--glass-backdrop-blur);border-radius:12px;box-shadow:0 8px 32px #00000026;border:1px solid var(--color-border);max-height:400px;max-width:500px;overflow-y:auto;z-index:100}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:transparent}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:var(--color-border);border-radius:4px}.autocomplete-popup[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:var(--color-text-secondary)}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%]{padding:.75rem 1rem;cursor:pointer;transition:background .2s;border-left:3px solid transparent}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%]:hover, .autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item.selected[_ngcontent-%COMP%]{background:var(--color-bg-hover)}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item.selected[_ngcontent-%COMP%]{border-left-color:var(--color-primary)}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%]{font-weight:600;color:var(--color-text);margin-bottom:.25rem;font-family:SF Mono,Monaco,Menlo,Cascadia Code,Consolas,monospace;font-size:.95rem}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%] strong{font-weight:700;color:var(--color-primary);background:var(--color-primary-light, rgba(99, 102, 241, .1));padding:0 2px;border-radius:2px}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-name[_ngcontent-%COMP%] .parameter-format[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-weight:400;opacity:.7}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-description[_ngcontent-%COMP%]{font-size:.85rem;color:var(--color-text-secondary);line-height:1.3}.autocomplete-popup[_ngcontent-%COMP%] .autocomplete-item[_ngcontent-%COMP%] .item-description[_ngcontent-%COMP%] strong{font-weight:700;color:var(--color-primary);background:var(--color-primary-light, rgba(99, 102, 241, .1))}@media print{.thinking-progress[_ngcontent-%COMP%], .action-btn[_ngcontent-%COMP%], .voice-btn[_ngcontent-%COMP%], .send-btn[_ngcontent-%COMP%], .upload-btn[_ngcontent-%COMP%], .recording-indicator[_ngcontent-%COMP%], .autocomplete-popup[_ngcontent-%COMP%]{display:none!important}}']})};var be=class i{unreadCountSubject=new Ie(0);unreadCount$=this.unreadCountSubject.asObservable();constructor(){console.log("[UNREAD] Service initialized")}addUnread(){let t=this.unreadCountSubject.value+1;this.unreadCountSubject.next(t),console.log("[UNREAD] Added unread message, total:",t)}markAllAsRead(){this.unreadCountSubject.value>0&&(this.unreadCountSubject.next(0),console.log("[UNREAD] Marked all messages as read"))}getCurrentCount(){return this.unreadCountSubject.value}reset(){this.unreadCountSubject.next(0),console.log("[UNREAD] Counter reset")}static \u0275fac=function(t){return new(t||i)};static \u0275prov=k({token:i,factory:i.\u0275fac,providedIn:"root"})};var et=class i{ATTENTION_EMOJI="\u{1F534}";isSystemActive=!1;systemActiveTimer=null;SYSTEM_ACTIVE_TIMEOUT=4e3;unreadService=m(be);project=m(Q);constructor(){this.initializeTitleUpdates()}initializeTitleUpdates(){At([this.project.selectedProject$,this.unreadService.unreadCount$]).subscribe(([e,t])=>{this.updateTitle(e?.name??"...",t)})}updateTitle(e,t){let n;this.isSystemActive?n=`\u23F3${t>0?` (${t}) `:" "}${e}`:t>0?n=`${this.ATTENTION_EMOJI} (${t}) ${e}`:n=e,document.title=n,console.log("[TAB-TITLE] Updated to:",n)}setSystemActive(){console.log("[TAB-TITLE] System active - showing hourglass"),this.isSystemActive=!0,this.systemActiveTimer&&clearTimeout(this.systemActiveTimer),this.systemActiveTimer=setTimeout(()=>{console.log("[TAB-TITLE] System active timeout - hiding hourglass"),this.isSystemActive=!1,this.forceUpdateTitle()},this.SYSTEM_ACTIVE_TIMEOUT),this.forceUpdateTitle()}setSystemInactive(){console.log("[TAB-TITLE] System inactive - hiding hourglass"),this.isSystemActive=!1,this.systemActiveTimer&&(clearTimeout(this.systemActiveTimer),this.systemActiveTimer=null),this.forceUpdateTitle()}forceUpdateTitle(){let e=this.project.getSelectedProjectId()??"...",t=this.unreadService.getCurrentCount();this.updateTitle(e,t)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=k({token:i,factory:i.\u0275fac,providedIn:"root"})};var tt=class i{pendingFirstMessage=null;pendingVoiceMessage=null;setPendingFirstMessage(e){console.log("[FIRST-MESSAGE-STATE] Storing pending first message:",e.substring(0,50)+"..."),this.pendingFirstMessage=e}consumePendingFirstMessage(){let e=this.pendingFirstMessage;return e?(console.log("[FIRST-MESSAGE-STATE] Consuming pending first message:",e.substring(0,50)+"..."),this.pendingFirstMessage=null):console.log("[FIRST-MESSAGE-STATE] No pending first message to consume"),e}setPendingVoiceMessage(e){console.log("[FIRST-MESSAGE-STATE] Storing pending voice message"),this.pendingVoiceMessage=e}consumePendingVoiceMessage(){let e=this.pendingVoiceMessage;return e&&(console.log("[FIRST-MESSAGE-STATE] Consuming pending voice message"),this.pendingVoiceMessage=null),e}hasPendingFirstMessage(){return this.pendingFirstMessage!==null||this.pendingVoiceMessage!==null}clear(){this.pendingFirstMessage&&(console.log("[FIRST-MESSAGE-STATE] Clearing pending first message"),this.pendingFirstMessage=null),this.pendingVoiceMessage=null}static \u0275fac=function(t){return new(t||i)};static \u0275prov=k({token:i,factory:i.\u0275fac,providedIn:"root"})};var Pi=(i,e)=>e.label;function Oi(i,e){if(i&1){let t=_();a(0,"button",2),h("click",function(o){let r=f(t).$implicit,d=l();return b(d.executeAction(r,o))}),a(1,"mat-icon"),p(2),s()()}if(i&2){let t=e.$implicit;oe("title",t.tooltip||t.label),c(),oe("aria-label",t.label),c(),S(t.icon)}}var nt=class i{actions=[];executeAction(e,t){t.stopPropagation(),e.action()}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=T({type:i,selectors:[["app-message-context-menu"]],inputs:{actions:"actions"},decls:3,vars:0,consts:[[1,"context-menu-wrapper"],["mat-icon-button",""],["mat-icon-button","",3,"click"]],template:function(t,n){t&1&&(a(0,"div",0),H(1,Oi,3,3,"button",1,Pi),s()),t&2&&(c(),V(n.actions))},dependencies:[j,re,R],styles:[".context-menu-wrapper[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center}.context-menu-wrapper[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{transform:scale(.75)}"]})};var K=class i{renderer;constructor(){this.renderer=new yn,this.configureRenderer()}configureRenderer(){let e=this.renderer.link.bind(this.renderer);this.renderer.link=t=>{let n=this.isExternalLink(t.href),o=e(t);if(n){o=o.replace("<a ",'<a target="_blank" rel="noopener noreferrer" ');let r=t.title?`${t.text} - ${t.title} (opens in new tab)`:`${t.text} (opens in new tab)`;o=o.replace("<a ",`<a aria-label="${this.escapeHtml(r)}" `),o=o.replace("</a>",'<span class="external-link-icon" aria-hidden="true">\u2197</span></a>')}return o}}isExternalLink(e){if(!e||e.startsWith("/")||e.startsWith("#")||e.startsWith("?"))return!1;if(e.startsWith("//"))return!0;try{return new URL(e,window.location.href).hostname!==window.location.hostname}catch(t){return!1}}escapeHtml(e){let t={"&":"&","<":"<",">":">",'"':""","'":"'"};return e.replace(/[&<>"']/g,n=>t[n]||n)}parse(e){return P(this,null,function*(){let t=yield wn.parse(e,{renderer:this.renderer,breaks:!0,gfm:!0});return Tn.sanitize(t,{ADD_TAGS:["span"],ADD_ATTR:["aria-hidden","aria-label","target","rel"],ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))/i})})}static \u0275fac=function(t){return new(t||i)};static \u0275prov=k({token:i,factory:i.\u0275fac,providedIn:"root"})};var ki=i=>({"user-message-wrapper":i});function Ii(i,e){if(i&1&&(a(0,"div",5)(1,"div",9),p(2),s()()),i&2){let t=l(2);c(2),he(" ",t.message.speaker," ")}}function Di(i,e){if(i&1&&(a(0,"time",7),p(1),s()),i&2){let t=l(2);c(),S(t.formattedTimestamp)}}function Ai(i,e){if(i&1&&(a(0,"div",8),y(1,"app-message-context-menu",10),s()),i&2){let t=l(2);c(),C("actions",t.actions)}}function Fi(i,e){if(i&1&&(u(0,Ii,3,1,"div",5),y(1,"div",6),u(2,Di,2,1,"time",7),u(3,Ai,2,1,"div",8)),i&2){let t=l();g(t.shouldShowSpeaker?0:-1),c(),C("innerHTML",t.renderedContent,z),c(),g(t.formattedTimestamp?2:-1),c(),g(t.isLongMessage&&t.shouldShowActions&&t.message.role==="assistant"?3:-1)}}function Ri(i,e){if(i&1&&(a(0,"a",12),p(1,"view"),s()),i&2){let t=l(2);C("href",t.eventLink,Lt)}}function Hi(i,e){if(i&1&&(a(0,"div",2),y(1,"span",11),u(2,Ri,2,1,"a",12),s()),i&2){let t=l();c(),C("innerHTML",t.renderedContent,z),c(),g(t.eventLink?2:-1)}}function Vi(i,e){if(i&1&&(a(0,"div",3),y(1,"app-message-context-menu",10),s()),i&2){let t=l();c(),C("actions",t.actions)}}function Li(i,e){if(i&1&&(a(0,"div",4),y(1,"app-message-context-menu",10),s()),i&2){let t=l();c(),C("actions",t.actions)}}var ve=class i{destroy$=new B;message;canDelete=!0;isOtherUser=!1;copyRequested=new M;deleteRequested=new M;renderedContent="";shouldHideTechnical=!1;shouldHideWarning=!1;sanitizer=m(G);notificationService=m(xn);preferencesService=m(se);projectState=m(Q);threadState=m(X);markdownService=m(K);get messageClasses(){return{[this.message.role]:!0,[this.message.type]:!0,"hidden-technical":this.shouldHideTechnical&&this.message.type==="technical","hidden-warning":this.shouldHideWarning&&this.message.type==="warning","other-user":this.isOtherUser}}ngOnInit(){return P(this,null,function*(){yield this.renderMarkdown(),this.preferencesService.hideTechnicalMessages$.pipe(F(this.destroy$)).subscribe(e=>{this.shouldHideTechnical=e}),this.preferencesService.hideWarningMessages$.pipe(F(this.destroy$)).subscribe(e=>{this.shouldHideWarning=e}),this.shouldHideTechnical=this.preferencesService.getHideTechnicalMessages(),this.shouldHideWarning=this.preferencesService.getHideWarningMessages()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get shouldShowSpeaker(){return this.message.role==="user"?this.isOtherUser||this.message.speaker.startsWith("@"):this.message.role==="assistant"}get shouldShowActions(){return this.message.role==="user"||this.message.role==="assistant"}get isSimplified(){return this.message.role!=="user"&&this.message.role!=="assistant"}datePipe=m(St);get formattedTimestamp(){if(this.message.role!=="user"||!this.message.timestamp)return null;let e=new Date().toDateString()===this.message.timestamp.toDateString();return this.datePipe.transform(this.message.timestamp,e?"HH:mm":"dd/MM HH:mm")}get isLongMessage(){let e=this.extractTextContent();return e.length>1e3||e.split(`
|
|
4
4
|
`).length>20}get actions(){let e=[];return this.message.role==="user"&&this.canDelete&&e.push({icon:"delete",label:"Delete from here",tooltip:"Delete this message and all following messages",action:()=>this.onDelete(),destructive:!0}),e.push({icon:"content_copy",label:"Copy message",tooltip:"Copy message content to clipboard",action:()=>this.onCopy()}),e}get eventLink(){if(!this.message.eventId)return null;let e=this.projectState.getSelectedProjectId(),t=this.threadState.getSelectedThreadId();return!e||!t?null:`/api/projects/${e}/threads/${t}/messages/${encodeURIComponent(this.message.eventId)}/formatted`}renderMarkdown(){return P(this,null,function*(){try{let e=yield this.renderRichContent(this.message.content);this.renderedContent=this.sanitizer.bypassSecurityTrustHtml(e)}catch(e){console.error("Error parsing rich content:",e);let t=this.extractTextContent();this.renderedContent=this.sanitizer.bypassSecurityTrustHtml(t)}})}renderRichContent(e){return P(this,null,function*(){let t=[];for(let n of e)if(n.type==="text"){let o=yield this.markdownService.parse(n.content);t.push(`<div class="text-part">${o}</div>`)}else if(n.type==="image"){let o=`data:${n.mimeType};base64,${n.content}`,r=n.source||"Image",d=`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as M,
|
|
1
|
+
import{r as M,z as D}from"./chunk-N347WQAU.js";import{Bb as v,Db as g,Fb as a,Ka as r,Tb as c,Ub as b,Vb as P,Wa as y,ga as s,ha as m,jb as h,lb as p,mb as _,mc as C,pc as f,qc as u,rb as w,sb as n,ta as x,tb as i}from"./chunk-KJ5SIUGY.js";function A(t,d){if(t&1&&(n(0,"span",4),c(1),i()),t&2){let e=a();h("data-variant",e.badge().variant)("aria-label",e.badge().ariaLabel),r(),P(" ",e.badge().label," ")}}function I(t,d){if(t&1&&(n(0,"span",6),c(1),i()),t&2){let e=a();r(),b(e.config().baseUrl)}}function k(t,d){if(t&1){let e=v();n(0,"span",8),c(1,"Delete?"),i(),n(2,"ds-icon-button",9),g("action",function(){s(e);let l=a();return m(l.onDeleteConfirmed())}),i(),n(3,"ds-icon-button",10),g("action",function(){s(e);let l=a();return m(l.onDeleteCancelled())}),i()}}function E(t,d){if(t&1){let e=v();n(0,"ds-kebab-menu",13),g("itemSelected",function(l){s(e);let S=a(2);return m(S.onMenuAction(l))}),i()}if(t&2){let e=a(2);w("items",e.menuItems())}}function R(t,d){if(t&1){let e=v();n(0,"ds-icon-button",11),g("action",function(){s(e);let l=a();return m(l.onDuplicate())}),i(),p(1,E,1,1,"ds-kebab-menu",12)}if(t&2){let e=a();r(),_(e.readOnly()?-1:1)}}var q=Object.freeze({platform:{label:"PLATFORM",ariaLabel:"Configuration de niveau plateforme (lecture seule)",variant:"neutral"},namespace:{label:"NS",ariaLabel:"Configuration partag\xE9e du namespace",variant:"neutral"},userOnNs:{label:"USER \xD7 NS",ariaLabel:"Configuration utilisateur sur ce namespace",variant:"info"},userGlobal:{label:"USER GLOBAL",ariaLabel:"Configuration utilisateur globale",variant:"warning"}}),O=class t{config=u.required();scope=u.required();readOnly=u(!1);showBadge=u(!0);editRequested=f();deleteRequested=f();duplicateRequested=f();pendingDelete=x(!1);badge=C(()=>q[this.scope()]);menuItems=C(()=>[{key:"edit",label:"Edit provider",icon:"edit"},{key:"delete",label:"Delete provider",icon:"delete",variant:"danger"}]);onMenuAction(d){switch(d){case"edit":this.editRequested.emit(this.config());break;case"delete":this.pendingDelete.set(!0);break}}onDuplicate(){this.duplicateRequested.emit(this.config())}onDeleteConfirmed(){this.pendingDelete.set(!1),this.deleteRequested.emit(this.config())}onDeleteCancelled(){this.pendingDelete.set(!1)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=y({type:t,selectors:[["agentos-ai-provider-item"]],inputs:{config:[1,"config"],scope:[1,"scope"],readOnly:[1,"readOnly"],showBadge:[1,"showBadge"]},outputs:{editRequested:"editRequested",deleteRequested:"deleteRequested",duplicateRequested:"duplicateRequested"},decls:12,vars:5,consts:[["role","listitem",1,"ai-provider-item"],[1,"ai-provider-item__body"],[1,"ai-provider-item__heading"],[1,"ai-provider-item__name"],[1,"ai-provider-item__badge"],[1,"ai-provider-item__type"],[1,"ai-provider-item__url"],[1,"ai-provider-item__actions"],[1,"ai-provider-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],["icon","content_copy","title","Duplicate this provider",3,"action"],[3,"items"],[3,"itemSelected","items"]],template:function(e,o){e&1&&(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),c(4),i(),p(5,A,2,3,"span",4),i(),n(6,"span",5),c(7),i(),p(8,I,2,1,"span",6),i(),n(9,"div",7),p(10,k,4,0)(11,R,2,1),i()()),e&2&&(r(4),b(o.config().name),r(),_(o.showBadge()?5:-1),r(2),b(o.config().apiType),r(),_(o.config().baseUrl?8:-1),r(2),_(o.pendingDelete()?10:11))},dependencies:[D,M],styles:[".ai-provider-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;border-radius:10px;border:1px solid var(--color-border);background:var(--glass-bg);-webkit-backdrop-filter:var(--glass-backdrop-blur);backdrop-filter:var(--glass-backdrop-blur);transition:background .15s ease,border-color .15s ease}.ai-provider-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);border-color:var(--color-primary)}.ai-provider-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.ai-provider-item__heading[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;min-width:0}.ai-provider-item__name[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}.ai-provider-item__badge[_ngcontent-%COMP%]{flex-shrink:0;font-size:.65rem;font-weight:600;letter-spacing:.04em;text-transform:uppercase;padding:.1rem .4rem;border-radius:4px;line-height:1.2}.ai-provider-item__badge[data-variant=neutral][_ngcontent-%COMP%]{background:var(--color-bg-secondary);color:var(--color-text-secondary)}.ai-provider-item__badge[data-variant=info][_ngcontent-%COMP%]{background:color-mix(in srgb,var(--color-info) 15%,transparent);color:var(--color-info)}.ai-provider-item__badge[data-variant=warning][_ngcontent-%COMP%]{background:color-mix(in srgb,var(--color-warning) 15%,transparent);color:var(--color-warning)}.ai-provider-item__type[_ngcontent-%COMP%]{font-size:.78rem;color:var(--color-text-secondary);font-family:monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-provider-item__url[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-provider-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.ai-provider-item[_ngcontent-%COMP%]:hover .ai-provider-item__actions[_ngcontent-%COMP%], .ai-provider-item[_ngcontent-%COMP%]:focus-within .ai-provider-item__actions[_ngcontent-%COMP%]{opacity:1}.ai-provider-item__confirm-label[_ngcontent-%COMP%]{font-size:.8rem;font-weight:500;color:var(--color-error);margin-right:.25rem;white-space:nowrap}"],changeDetection:0})};export{O as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as Re}from"./chunk-DVUB4DDV.js";import{g as Te,h as Fe,i as De,j as Le,k as je,l as xe,m as R}from"./chunk-
|
|
1
|
+
import{f as Re}from"./chunk-DVUB4DDV.js";import{g as Te,h as Fe,i as De,j as Le,k as je,l as xe,m as R}from"./chunk-N347WQAU.js";import{c as ye,d as Oe,f as Se,l as Ae,m as we,p as Pe,s as Ce,v as ke}from"./chunk-7EDSHFWH.js";import{a as Ee}from"./chunk-DDWYQORF.js";import{b as Ie}from"./chunk-JF3TWRKD.js";import{A as ve,E as be,I as Me,K as I,c as ue,d as de,e as he,l as me,n as _e,t as ge,u as g,v as fe,x as M,y as f}from"./chunk-B46LXCLF.js";import{A as m,B as O,Cb as te,Db as ie,Fb as oe,G as L,Gb as ne,Hb as se,I as j,Ib as ae,Jb as re,Kb as u,Lb as d,Ma as U,Na as q,Pa as Y,R as x,Rb as le,S as _,Sa as G,Sb as ce,V as B,Wa as z,Wc as pe,Xa as Q,Y as V,Ya as X,Z as N,_ as $,aa as S,bb as Z,bc as C,ca as r,e as h,ea as W,g as v,h as b,jb as P,ka as A,m as y,oa as p,pa as H,t as F,va as K,vb as J,wb as ee,wc as k,xc as c,y as D,ya as w}from"./chunk-KJ5SIUGY.js";var Be=class a{http=r(pe);projectState=r(Ie);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/schedulers`}listSchedulers(){return this.http.get(this.getBaseUrl())}getScheduler(n){return this.http.get(`${this.getBaseUrl()}/${n}`)}createScheduler(n){return this.http.post(this.getBaseUrl(),n)}listSchedulersForProject(n){return this.http.get(`/api/projects/${n}/schedulers`)}enableSchedulerForProject(n,e){return this.http.post(`/api/projects/${n}/schedulers/${e}/enable`,{})}disableSchedulerForProject(n,e){return this.http.post(`/api/projects/${n}/schedulers/${e}/disable`,{})}runSchedulerNowForProject(n,e){return this.http.post(`/api/projects/${n}/schedulers/${e}/run-now`,{})}deleteSchedulerForProject(n,e){return this.http.delete(`/api/projects/${n}/schedulers/${e}`)}updateSchedulerForProject(n,e,t){return this.http.put(`/api/projects/${n}/schedulers/${e}`,t)}createSchedulerForProject(n,e){return this.http.post(`/api/projects/${n}/schedulers`,e)}updateScheduler(n,e){return this.http.put(`${this.getBaseUrl()}/${n}`,e)}deleteScheduler(n){return this.http.delete(`${this.getBaseUrl()}/${n}`)}enableScheduler(n){return this.http.post(`${this.getBaseUrl()}/${n}/enable`,{})}disableScheduler(n){return this.http.post(`${this.getBaseUrl()}/${n}/disable`,{})}runSchedulerNow(n){return this.http.post(`${this.getBaseUrl()}/${n}/run-now`,{})}static \u0275fac=function(e){return new(e||a)};static \u0275prov=N({token:a,factory:a.\u0275fac,providedIn:"root"})};var qe=["panel"],Ye=["*"];function Ge(a,n){if(a&1&&(J(0,"div",1,0),se(2),ee()),a&2){let e=n.id,t=oe();ce(t._classList),le("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"),te("id",t.id),P("aria-label",t.ariaLabel||null)("aria-labelledby",t._getPanelAriaLabelledby(e))}}var E=class{source;option;constructor(n,e){this.source=n,this.option=e}},$e=new S("mat-autocomplete-default-options",{providedIn:"root",factory:()=>({autoActiveFirstOption:!1,autoSelectActiveOption:!1,hideSingleSelectionIndicator:!1,requireSelection:!1,hasBackdrop:!1})}),It=(()=>{class a{_changeDetectorRef=r(k);_elementRef=r(w);_defaults=r($e);_animationsDisabled=I();_activeOptionChanges=h.EMPTY;_keyManager;showPanel=!1;get isOpen(){return this._isOpen&&this.showPanel}_isOpen=!1;_latestOpeningTrigger;_setColor(e){this._color=e,this._changeDetectorRef.markForCheck()}_color;template;panel;options;optionGroups;ariaLabel;ariaLabelledby;displayWith=null;autoActiveFirstOption;autoSelectActiveOption;requireSelection;panelWidth;disableRipple=!1;optionSelected=new p;opened=new p;closed=new p;optionActivated=new p;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=r(ge).getId("mat-autocomplete-");inertGroups;constructor(){let e=r(he);this.inertGroups=e?.SAFARI||!1,this.autoActiveFirstOption=!!this._defaults.autoActiveFirstOption,this.autoSelectActiveOption=!!this._defaults.autoSelectActiveOption,this.requireSelection=!!this._defaults.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??!1}ngAfterContentInit(){this._keyManager=new fe(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 E(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!1}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=z({type:a,selectors:[["mat-autocomplete"]],contentQueries:function(t,i,o){if(t&1&&ae(o,Le,5)(o,Fe,5),t&2){let s;u(s=d())&&(i.options=s),u(s=d())&&(i.optionGroups=s)}},viewQuery:function(t,i){if(t&1&&re(q,7)(qe,5),t&2){let o;u(o=d())&&(i.template=o.first),u(o=d())&&(i.panel=o.first)}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",c],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",c],requireSelection:[2,"requireSelection","requireSelection",c],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",c],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",c]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],features:[C([{provide:Te,useExisting:a}])],ngContentSelectors:Ye,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&&(ne(),Z(0,Ge,3,17,"ng-template"))},styles:[`div.mat-mdc-autocomplete-panel{width:100%;max-height:256px;visibility:hidden;transform-origin:center top;overflow:auto;padding:8px 0;box-sizing:border-box;position:relative;border-radius:var(--mat-autocomplete-container-shape, var(--mat-sys-corner-extra-small));box-shadow:var(--mat-autocomplete-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));background-color:var(--mat-autocomplete-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-autocomplete-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-autocomplete-panel-above) div.mat-mdc-autocomplete-panel{border-top-left-radius:0;border-top-right-radius:0}.mat-mdc-autocomplete-panel-above div.mat-mdc-autocomplete-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:center bottom}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-visible{visibility:visible}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-hidden,.cdk-overlay-pane:has(>.mat-mdc-autocomplete-hidden){visibility:hidden;pointer-events:none}@keyframes _mat-autocomplete-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}.mat-autocomplete-panel-animations-enabled{animation:_mat-autocomplete-enter 120ms cubic-bezier(0, 0, 0.2, 1)}mat-autocomplete{display:none}
|
|
2
2
|
`],encapsulation:2,changeDetection:0})}return a})();var ze={provide:Ee,useExisting:V(()=>Xe),multi:!0};var Qe=new S("mat-autocomplete-scroll-strategy",{providedIn:"root",factory:()=>{let a=r(A);return()=>Ae(a)}}),Xe=(()=>{class a{_environmentInjector=r(W);_element=r(w);_injector=r(A);_viewContainerRef=r(G);_zone=r(H);_changeDetectorRef=r(k);_dir=r(ve,{optional:!0});_formField=r(Re,{optional:!0,host:!0});_viewportRuler=r(ye);_scrollStrategy=r(Qe);_renderer=r(Y);_animationsDisabled=I();_defaults=r($e,{optional:!0});_overlayRef=null;_portal;_componentDestroyed=!1;_initialized=new b;_keydownSubscription;_outsideClickSubscription;_cleanupWindowBlur;_previousValue=null;_valueOnAttach=null;_valueOnLastKeydown=null;_positionStrategy;_manuallyFloatingLabel=!1;_closingActionsSubscription;_viewportSubscription=h.EMPTY;_breakpointObserver=r(_e);_handsetLandscapeSubscription=h.EMPTY;_canOpenOnNextFocus=!0;_valueBeforeAutoSelection;_pendingAutoselectedOption=null;_closeKeyEventStream=new b;_overlayPanelClass=me(this._defaults?.overlayPanelClass||[]);_windowBlurHandler=()=>{this._canOpenOnNextFocus=this.panelOpen||!this._hasFocus()};_onChange=()=>{};_onTouched=()=>{};autocomplete;position="auto";connectedTo;autocompleteAttribute="off";autocompleteDisabled=!1;constructor(){}_aboveClass="mat-mdc-autocomplete-panel-above";ngAfterViewInit(){this._initialized.next(),this._initialized.complete(),this._cleanupWindowBlur=this._renderer.listen("window","blur",this._windowBlurHandler)}ngOnChanges(e){e.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition())}ngOnDestroy(){this._cleanupWindowBlur?.(),this._handsetLandscapeSubscription.unsubscribe(),this._viewportSubscription.unsubscribe(),this._componentDestroyed=!0,this._destroyPanel(),this._closeKeyEventStream.complete(),this._clearFromModal()}get panelOpen(){return this._overlayAttached&&this.autocomplete.showPanel}_overlayAttached=!1;openPanel(){this._openPanelInternal()}closePanel(){this._resetLabel(),this._overlayAttached&&(this.panelOpen&&this._zone.run(()=>{this.autocomplete.closed.emit()}),this.autocomplete._latestOpeningTrigger===this&&(this.autocomplete._isOpen=!1,this.autocomplete._latestOpeningTrigger=null),this._overlayAttached=!1,this._pendingAutoselectedOption=null,this._overlayRef&&this._overlayRef.hasAttached()&&(this._overlayRef.detach(),this._closingActionsSubscription.unsubscribe()),this._updatePanelState(),this._componentDestroyed||this._changeDetectorRef.detectChanges(),this._trackedModal&&f(this._trackedModal,"aria-owns",this.autocomplete.id))}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition()}get panelClosingActions(){return m(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(O(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(O(()=>this._overlayAttached)):y()).pipe(F(e=>e instanceof De?e:null))}optionSelections=D(()=>{let e=this.autocomplete?this.autocomplete.options:null;return e?e.changes.pipe(x(e),_(()=>m(...e.map(t=>t.onSelectionChange)))):this._initialized.pipe(_(()=>this.optionSelections))});get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return new v(e=>{let t=o=>{let s=de(o),l=this._formField?this._formField.getConnectedOverlayOrigin().nativeElement:null,T=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;this._overlayAttached&&s!==this._element.nativeElement&&!this._hasFocus()&&(!l||!l.contains(s))&&(!T||!T.contains(s))&&this._overlayRef&&!this._overlayRef.overlayElement.contains(s)&&e.next(o)},i=[this._renderer.listen("document","click",t),this._renderer.listen("document","auxclick",t),this._renderer.listen("document","touchend",t)];return()=>{i.forEach(o=>o())}})}writeValue(e){Promise.resolve(null).then(()=>this._assignOptionValue(e))}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this._element.nativeElement.disabled=e}_handleKeydown(e){let t=e,i=t.keyCode,o=g(t);if(i===27&&!o&&t.preventDefault(),this._valueOnLastKeydown=this._element.nativeElement.value,this.activeOption&&i===13&&this.panelOpen&&!o)this.activeOption._selectViaInteraction(),this._resetActiveItem(),t.preventDefault();else if(this.autocomplete){let s=this.autocomplete._keyManager.activeItem,l=i===38||i===40;i===9||l&&!o&&this.panelOpen?this.autocomplete._keyManager.onKeydown(t):l&&this._canOpen()&&this._openPanelInternal(this._valueOnLastKeydown),(l||this.autocomplete._keyManager.activeItem!==s)&&(this._scrollToOption(this.autocomplete._keyManager.activeItemIndex||0),this.autocomplete.autoSelectActiveOption&&this.activeOption&&(this._pendingAutoselectedOption||(this._valueBeforeAutoSelection=this._valueOnLastKeydown),this._pendingAutoselectedOption=this.activeOption,this._assignOptionValue(this.activeOption.value)))}}_handleInput(e){let t=e.target,i=t.value;if(t.type==="number"&&(i=i==""?null:parseFloat(i)),this._previousValue!==i){if(this._previousValue=i,this._pendingAutoselectedOption=null,(!this.autocomplete||!this.autocomplete.requireSelection)&&this._onChange(i),!i)this._clearPreviousSelectedOption(null,!1);else if(this.panelOpen&&!this.autocomplete.requireSelection){let o=this.autocomplete.options?.find(s=>s.selected);if(o){let s=this._getDisplayValue(o.value);i!==s&&o.deselect(!1)}}if(this._canOpen()&&this._hasFocus()){let o=this._valueOnLastKeydown??this._element.nativeElement.value;this._valueOnLastKeydown=null,this._openPanelInternal(o)}}}_handleFocus(){this._canOpenOnNextFocus?this._canOpen()&&(this._previousValue=this._element.nativeElement.value,this._attachOverlay(this._previousValue),this._floatLabel(!0)):this._canOpenOnNextFocus=!0}_handleClick(){this._canOpen()&&!this.panelOpen&&this._openPanelInternal()}_hasFocus(){return ue()===this._element.nativeElement}_floatLabel(e=!1){this._formField&&this._formField.floatLabel==="auto"&&(e?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=!0)}_resetLabel(){this._manuallyFloatingLabel&&(this._formField&&(this._formField.floatLabel="auto"),this._manuallyFloatingLabel=!1)}_subscribeToClosingActions(){let e=new v(i=>{U(()=>{i.next()},{injector:this._environmentInjector})}),t=this.autocomplete.options?.changes.pipe(B(()=>this._positionStrategy.reapplyLastPosition()),j(0))??y();return m(e,t).pipe(_(()=>this._zone.run(()=>{let i=this.panelOpen;return this._resetActiveItem(),this._updatePanelState(),this._changeDetectorRef.detectChanges(),this.panelOpen&&this._overlayRef.updatePosition(),i!==this.panelOpen&&(this.panelOpen?this._emitOpened():this.autocomplete.closed.emit()),this.panelClosingActions})),L(1)).subscribe(i=>this._setValueAndClose(i))}_emitOpened(){this.autocomplete.opened.emit()}_destroyPanel(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null)}_getDisplayValue(e){let t=this.autocomplete;return t&&t.displayWith?t.displayWith(e):e}_assignOptionValue(e){let t=this._getDisplayValue(e);e==null&&this._clearPreviousSelectedOption(null,!1),this._updateNativeInputValue(t??"")}_updateNativeInputValue(e){this._formField?this._formField._control.value=e:this._element.nativeElement.value=e,this._previousValue=e}_setValueAndClose(e){let t=this.autocomplete,i=e?e.source:this._pendingAutoselectedOption;i?(this._clearPreviousSelectedOption(i),this._assignOptionValue(i.value),this._onChange(i.value),t._emitSelectEvent(i),this._element.nativeElement.focus()):t.requireSelection&&this._element.nativeElement.value!==this._valueOnAttach&&(this._clearPreviousSelectedOption(null),this._assignOptionValue(null),this._onChange(null)),this.closePanel()}_clearPreviousSelectedOption(e,t){this.autocomplete?.options?.forEach(i=>{i!==e&&i.selected&&i.deselect(t)})}_openPanelInternal(e=this._element.nativeElement.value){if(this._attachOverlay(e),this._floatLabel(),this._trackedModal){let t=this.autocomplete.id;M(this._trackedModal,"aria-owns",t)}}_attachOverlay(e){if(!this.autocomplete)return;let t=this._overlayRef;t?(this._positionStrategy.setOrigin(this._getConnectedElement()),t.updateSize({width:this._getPanelWidth()})):(this._portal=new Se(this.autocomplete.template,this._viewContainerRef,{id:this._formField?.getLabelId()}),t=Ce(this._injector,this._getOverlayConfig()),this._overlayRef=t,this._viewportSubscription=this._viewportRuler.change().subscribe(()=>{this.panelOpen&&t&&t.updateSize({width:this._getPanelWidth()})}),this._handsetLandscapeSubscription=this._breakpointObserver.observe(Me.HandsetLandscape).subscribe(o=>{o.matches?this._positionStrategy.withFlexibleDimensions(!0).withGrowAfterOpen(!0).withViewportMargin(8):this._positionStrategy.withFlexibleDimensions(!1).withGrowAfterOpen(!1).withViewportMargin(0)})),t&&!t.hasAttached()&&(t.attach(this._portal),this._valueOnAttach=e,this._valueOnLastKeydown=null,this._closingActionsSubscription=this._subscribeToClosingActions());let i=this.panelOpen;this.autocomplete._isOpen=this._overlayAttached=!0,this.autocomplete._latestOpeningTrigger=this,this.autocomplete._setColor(this._formField?.color),this._updatePanelState(),this._applyModalPanelOwnership(),this.panelOpen&&i!==this.panelOpen&&this._emitOpened()}_handlePanelKeydown=e=>{(e.keyCode===27&&!g(e)||e.keyCode===38&&g(e,"altKey"))&&(this._pendingAutoselectedOption&&(this._updateNativeInputValue(this._valueBeforeAutoSelection??""),this._pendingAutoselectedOption=null),this._closeKeyEventStream.next(),this._resetActiveItem(),e.stopPropagation(),e.preventDefault())};_updatePanelState(){if(this.autocomplete._setVisibility(),this.panelOpen){let e=this._overlayRef;this._keydownSubscription||(this._keydownSubscription=e.keydownEvents().subscribe(this._handlePanelKeydown)),this._outsideClickSubscription||(this._outsideClickSubscription=e.outsidePointerEvents().subscribe())}else this._keydownSubscription?.unsubscribe(),this._outsideClickSubscription?.unsubscribe(),this._keydownSubscription=this._outsideClickSubscription=void 0}_getOverlayConfig(){return new we({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir??void 0,hasBackdrop:this._defaults?.hasBackdrop,backdropClass:this._defaults?.backdropClass||"cdk-overlay-transparent-backdrop",panelClass:this._overlayPanelClass,disableAnimations:this._animationsDisabled})}_getOverlayPosition(){let e=Pe(this._injector,this._getConnectedElement()).withFlexibleDimensions(!1).withPush(!1).withPopoverLocation("inline");return this._setStrategyPositions(e),this._positionStrategy=e,e}_setStrategyPositions(e){let t=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],i=this._aboveClass,o=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:i},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:i}],s;this.position==="above"?s=o:this.position==="below"?s=t:s=[...t,...o],e.withPositions(s)}_getConnectedElement(){return this.connectedTo?this.connectedTo.elementRef:this._formField?this._formField.getConnectedOverlayOrigin():this._element}_getPanelWidth(){return this.autocomplete.panelWidth||this._getHostWidth()}_getHostWidth(){return this._getConnectedElement().nativeElement.getBoundingClientRect().width}_resetActiveItem(){let e=this.autocomplete;if(e.autoActiveFirstOption){let t=-1;for(let i=0;i<e.options.length;i++)if(!e.options.get(i).disabled){t=i;break}e._keyManager.setActiveItem(t)}else e._keyManager.setActiveItem(-1)}_canOpen(){let e=this._element.nativeElement;return!e.readOnly&&!e.disabled&&!this.autocompleteDisabled}_scrollToOption(e){let t=this.autocomplete,i=je(e,t.options,t.optionGroups);if(e===0&&i===1)t._setScrollTop(0);else if(t.panel){let o=t.options.toArray()[e];if(o){let s=o._getHostElement(),l=xe(s.offsetTop,s.offsetHeight,t._getScrollTop(),t.panel.nativeElement.offsetHeight);t._setScrollTop(l)}}}_trackedModal=null;_applyModalPanelOwnership(){let e=this._element.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!e)return;let t=this.autocomplete.id;this._trackedModal&&f(this._trackedModal,"aria-owns",t),M(e,"aria-owns",t),this._trackedModal=e}_clearFromModal(){if(this._trackedModal){let e=this.autocomplete.id;f(this._trackedModal,"aria-owns",e),this._trackedModal=null}}static \u0275fac=function(t){return new(t||a)};static \u0275dir=X({type:a,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-mdc-autocomplete-trigger"],hostVars:7,hostBindings:function(t,i){t&1&&ie("focusin",function(){return i._handleFocus()})("blur",function(){return i._onTouched()})("input",function(s){return i._handleInput(s)})("keydown",function(s){return i._handleKeydown(s)})("click",function(){return i._handleClick()}),t&2&&P("autocomplete",i.autocompleteAttribute)("role",i.autocompleteDisabled?null:"combobox")("aria-autocomplete",i.autocompleteDisabled?null:"list")("aria-activedescendant",i.panelOpen&&i.activeOption?i.activeOption.id:null)("aria-expanded",i.autocompleteDisabled?null:i.panelOpen.toString())("aria-controls",i.autocompleteDisabled||!i.panelOpen||i.autocomplete==null?null:i.autocomplete.id)("aria-haspopup",i.autocompleteDisabled?null:"listbox")},inputs:{autocomplete:[0,"matAutocomplete","autocomplete"],position:[0,"matAutocompletePosition","position"],connectedTo:[0,"matAutocompleteConnectedTo","connectedTo"],autocompleteAttribute:[0,"autocomplete","autocompleteAttribute"],autocompleteDisabled:[2,"matAutocompleteDisabled","autocompleteDisabled",c]},exportAs:["matAutocompleteTrigger"],features:[C([ze]),K]})}return a})(),Rt=(()=>{class a{static \u0275fac=function(t){return new(t||a)};static \u0275mod=Q({type:a});static \u0275inj=$({imports:[ke,R,Oe,R,be]})}return a})();export{It as a,Xe as b,Rt as c,Be as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{z as V}from"./chunk-N347WQAU.js";import{Ab as v,Bb as C,Db as f,Fb as a,Gb as A,Ha as M,Hb as I,Jc as N,Ka as o,Mb as S,Ob as T,Pb as k,Rb as E,Tb as _,Ub as g,Wa as w,Ya as O,ab as x,ga as b,ha as u,jc as D,lb as d,mb as s,pc as y,qc as c,rb as p,sb as i,sc as j,tb as r,ub as P}from"./chunk-KJ5SIUGY.js";var Q=[[["","agentosCardChips",""]]],q=["[agentosCardChips]"];function F(n,t){n&1&&v(0)}function U(n,t){if(n&1){let e=C();i(0,"button",3),f("click",function(){b(e);let l=a();return u(l.nameClicked.emit())}),x(1,F,1,0,"ng-container",4),r()}if(n&2){a();let e=k(3);o(),p("ngTemplateOutlet",e)}}function Y(n,t){n&1&&v(0)}function R(n,t){if(n&1&&(i(0,"div",2),x(1,Y,1,0,"ng-container",4),r()),n&2){a();let e=k(3);o(),p("ngTemplateOutlet",e)}}function B(n,t){if(n&1&&(i(0,"div",7),P(1,"img",15),r()),n&2){let e=a(2);o(),p("src",e.logo(),M)("alt",e.name())}}function G(n,t){if(n&1&&(i(0,"div",16),_(1),r()),n&2){let e=a(2);E("ac__mark--emoji",e.markIsEmoji()),o(),g(e.resolvedMark)}}function H(n,t){if(n&1&&(i(0,"span",10),_(1),r()),n&2){let e=a(2);o(),g(e.name())}}function J(n,t){if(n&1){let e=C();i(0,"button",17),f("click",function(){b(e);let l=a(2);return u(l.nameClicked.emit())}),_(1),r()}if(n&2){let e=a(2);o(),g(e.name())}}function L(n,t){if(n&1&&(i(0,"p",12),_(1),r()),n&2){let e=a(2);o(),g(e.description())}}function W(n,t){if(n&1){let e=C();i(0,"ds-kebab-menu",18),f("itemSelected",function(l){b(e);let K=a(2);return u(K.menuAction.emit(l))}),r()}if(n&2){let e=a(2);p("items",e.menuItems())}}function X(n,t){n&1&&(i(0,"div",14),I(1),r())}function Z(n,t){if(n&1&&(i(0,"div",5)(1,"div",6),d(2,B,2,2,"div",7)(3,G,2,3,"div",8),i(4,"div",9),d(5,H,2,1,"span",10)(6,J,2,1,"button",11),d(7,L,2,1,"p",12),r()(),d(8,W,1,1,"ds-kebab-menu",13),r(),d(9,X,2,0,"div",14)),n&2){let e=a();o(2),s(e.logo()?2:3),o(3),s(e.clickable()?5:6),o(2),s(e.description()?7:-1),o(),s(e.hasMenu?8:-1),o(),s(e.hasChips?9:-1)}}var h=class n{static \u0275fac=function(e){return new(e||n)};static \u0275dir=O({type:n,selectors:[["","agentosCardChips",""]]})},z=class n{name=c.required();description=c(null);mark=c(null);markIsEmoji=c(!1);logo=c(null);menuItems=c([]);clickable=c(!1);nameClicked=y();menuAction=y();chipsSlot=j(h);get resolvedMark(){return this.mark()??(this.name().charAt(0).toUpperCase()||"?")}get hasChips(){return this.chipsSlot()!==void 0}get hasMenu(){return this.menuItems().length>0}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=w({type:n,selectors:[["agentos-action-card"]],contentQueries:function(e,m,l){e&1&&S(l,m.chipsSlot,h,5),e&2&&T()},inputs:{name:[1,"name"],description:[1,"description"],mark:[1,"mark"],markIsEmoji:[1,"markIsEmoji"],logo:[1,"logo"],menuItems:[1,"menuItems"],clickable:[1,"clickable"]},outputs:{nameClicked:"nameClicked",menuAction:"menuAction"},ngContentSelectors:q,decls:4,vars:1,consts:[["cardContent",""],["type","button",1,"ac","ac--clickable"],[1,"ac"],["type","button",1,"ac","ac--clickable",3,"click"],[4,"ngTemplateOutlet"],[1,"ac__header"],[1,"ac__id"],["aria-hidden","true",1,"ac__mark","ac__mark--logo"],["aria-hidden","true",1,"ac__mark",3,"ac__mark--emoji"],[1,"ac__meta"],[1,"ac__name"],["type","button",1,"ac__name"],[1,"ac__description"],[3,"items"],[1,"ac__chips"],[1,"ac__logo-img",3,"src","alt"],["aria-hidden","true",1,"ac__mark"],["type","button",1,"ac__name",3,"click"],[3,"itemSelected","items"]],template:function(e,m){e&1&&(A(Q),d(0,U,2,1,"button",1)(1,R,2,1,"div",2),x(2,Z,10,5,"ng-template",null,0,D)),e&2&&s(m.clickable()?0:1)},dependencies:[V,N],styles:["[_nghost-%COMP%]{display:block;height:var(--ac-height, auto)}.ac[_ngcontent-%COMP%]{background:var(--color-bg-secondary, rgba(255, 255, 255, .7));border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:12px;box-shadow:0 1px 3px var(--color-shadow, rgba(0, 0, 0, .05));overflow:hidden;transition:background .15s ease,border-color .15s ease,box-shadow .15s ease}.ac[_ngcontent-%COMP%]:hover{box-shadow:0 2px 8px var(--color-shadow, rgba(0, 0, 0, .08));border-color:var(--color-border, rgba(0, 0, 0, .15))}.ac[_ngcontent-%COMP%]{overflow:visible}.ac--clickable[_ngcontent-%COMP%]{appearance:none;background:transparent;border:none;padding:0;margin:0;font:inherit;cursor:pointer;text-align:left;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;background:var(--color-bg-secondary, rgba(255, 255, 255, .7));border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:12px;box-shadow:0 1px 3px var(--color-shadow, rgba(0, 0, 0, .05));overflow:hidden;transition:background .15s ease,border-color .15s ease,box-shadow .15s ease}.ac--clickable[_ngcontent-%COMP%]{background:var(--color-bg-secondary, rgba(255, 255, 255, .7));border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:12px;box-shadow:0 1px 3px var(--color-shadow, rgba(0, 0, 0, .05));overflow:hidden;transition:background .15s ease,border-color .15s ease,box-shadow .15s ease}.ac--clickable[_ngcontent-%COMP%]:hover{box-shadow:0 2px 8px var(--color-shadow, rgba(0, 0, 0, .08));border-color:var(--color-border, rgba(0, 0, 0, .15))}.ac--clickable[_ngcontent-%COMP%]{cursor:pointer;transition:background .15s ease,border-color .15s ease,box-shadow .15s ease,transform .12s ease}.ac--clickable[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-color:var(--color-primary, #007aff);box-shadow:0 2px 12px var(--color-shadow, rgba(0, 0, 0, .08));transform:translateY(-1px)}.ac--clickable[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary, #007aff);outline-offset:2px}.ac--clickable[_ngcontent-%COMP%]:active{transform:translateY(0)}.ac--clickable[_ngcontent-%COMP%]{overflow:visible;width:100%;height:100%;text-align:left}.ac--clickable[_ngcontent-%COMP%] .ac__name[_ngcontent-%COMP%]{cursor:inherit}.ac--clickable[_ngcontent-%COMP%] .ac__name[_ngcontent-%COMP%]:hover{text-decoration:none}.ac__header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;padding:16px 18px 14px}.ac__id[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;min-width:0;flex:1}.ac__mark[_ngcontent-%COMP%]{width:32px;height:32px;border-radius:8px;background:#161616;color:#fff;border:none;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-family:Inter,sans-serif;font-size:13px;font-weight:700;line-height:1;align-self:flex-start}.ac__mark--logo[_ngcontent-%COMP%]{background:var(--color-bg-secondary);border:1px solid var(--color-border);padding:4px}[data-theme=dark][_ngcontent-%COMP%] .ac__mark--logo[_ngcontent-%COMP%]{background:transparent}.ac__mark--emoji[_ngcontent-%COMP%]{font-size:18px;line-height:32px;background:var(--color-bg-secondary);border:1px solid var(--color-border);color:inherit}[data-theme=dark][_ngcontent-%COMP%] .ac__mark--emoji[_ngcontent-%COMP%]{background:transparent}.ac__logo-img[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:contain;border-radius:4px;display:block}.ac__meta[_ngcontent-%COMP%]{min-width:0}.ac__description[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-size:.8125rem;font-weight:400;line-height:1.4;color:var(--color-text-secondary, #6e6e73);margin:2px 0 0}.ac__name[_ngcontent-%COMP%]{appearance:none;background:transparent;border:none;padding:0;margin:0;font:inherit;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;font-family:Inter,sans-serif;font-size:14px;font-weight:600;line-height:1.3;color:var(--color-text, #1d1d1f);display:block;word-break:break-word;text-align:left}.ac__name[_ngcontent-%COMP%]:hover{text-decoration:underline}.ac__name[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--color-primary, #007aff);outline-offset:2px;border-radius:2px}.ac__chips[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:6px;padding:0 14px 16px}[_nghost-%COMP%] .ac-chip{display:inline-flex;align-items:center;gap:5px;height:28px;padding:0 12px 0 10px;border-radius:999px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--color-surface-secondary, rgba(0, 0, 0, .03));color:var(--color-text, #1d1d1f);font-family:Inter,sans-serif;font-size:11.5px;font-weight:500;line-height:1;cursor:pointer;white-space:nowrap;transition:background .12s ease,border-color .12s ease}[_nghost-%COMP%] .ac-chip:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .06));border-color:var(--color-border, rgba(0, 0, 0, .16))}[_nghost-%COMP%] .ac-chip svg{flex-shrink:0}"],changeDetection:0})};export{h as a,z as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as I}from"./chunk-
|
|
1
|
+
import{r as I}from"./chunk-N347WQAU.js";import{Bb as p,Db as d,Fb as c,Ka as r,Tb as s,Ub as C,Vb as w,Wa as x,ga as l,ha as g,jb as y,lb as u,mb as b,mc as h,pc as f,qc as _,sb as n,ta as v,tb as i}from"./chunk-KJ5SIUGY.js";function O(o,m){if(o&1){let e=p();n(0,"span",7),s(1,"Delete?"),i(),n(2,"ds-icon-button",8),d("action",function(){l(e);let a=c();return g(a.onDeleteConfirmed())}),i(),n(3,"ds-icon-button",9),d("action",function(){l(e);let a=c();return g(a.onDeleteCancelled())}),i()}}function M(o,m){if(o&1){let e=p();n(0,"ds-icon-button",11),d("action",function(){l(e);let a=c(2);return g(a.onEdit())}),i(),n(1,"ds-icon-button",12),d("action",function(){l(e);let a=c(2);return g(a.onDeleteArmed())}),i()}}function S(o,m){if(o&1){let e=p();n(0,"ds-icon-button",10),d("action",function(){l(e);let a=c();return g(a.onDuplicate())}),i(),u(1,M,2,0)}if(o&2){let e=c();r(),b(e.readOnly()?-1:1)}}var P=Object.freeze({platform:{label:"PLATFORM",ariaLabel:"Configuration partag\xE9e plateforme",variant:"neutral"},namespace:{label:"NS",ariaLabel:"Configuration partag\xE9e du namespace",variant:"neutral"},userOnNs:{label:"USER \xD7 NS",ariaLabel:"Configuration utilisateur sur ce namespace",variant:"info"},userGlobal:{label:"USER GLOBAL",ariaLabel:"Configuration utilisateur globale",variant:"warning"}}),D=class o{config=_.required();scope=_.required();readOnly=_(!1);editRequested=f();deleteRequested=f();duplicateRequested=f();pendingDelete=v(!1);badge=h(()=>P[this.scope()]);onEdit(){this.editRequested.emit(this.config())}onDuplicate(){this.duplicateRequested.emit(this.config())}onDeleteArmed(){this.pendingDelete.set(!0)}onDeleteConfirmed(){this.pendingDelete.set(!1),this.deleteRequested.emit(this.config())}onDeleteCancelled(){this.pendingDelete.set(!1)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=x({type:o,selectors:[["agentos-integration-config-item"]],inputs:{config:[1,"config"],scope:[1,"scope"],readOnly:[1,"readOnly"]},outputs:{editRequested:"editRequested",deleteRequested:"deleteRequested",duplicateRequested:"duplicateRequested"},decls:12,vars:6,consts:[["role","listitem",1,"integration-config-item"],[1,"integration-config-item__body"],[1,"integration-config-item__heading"],[1,"integration-config-item__name"],[1,"integration-config-item__badge"],[1,"integration-config-item__type"],[1,"integration-config-item__actions"],[1,"integration-config-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],["icon","content_copy","title","Duplicate this configuration",3,"action"],["icon","edit","title","Edit integration",3,"action"],["icon","delete","variant","danger","title","Delete integration",3,"action"]],template:function(e,t){e&1&&(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),s(4),i(),n(5,"span",4),s(6),i()(),n(7,"span",5),s(8),i()(),n(9,"div",6),u(10,O,4,0)(11,S,2,1),i()()),e&2&&(r(4),C(t.config().name),r(),y("data-variant",t.badge().variant)("aria-label",t.badge().ariaLabel),r(),w(" ",t.badge().label," "),r(2),C(t.config().integrationType),r(2),b(t.pendingDelete()?10:11))},dependencies:[I],styles:[".integration-config-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem 1rem;border-radius:10px;border:1px solid var(--color-border);background:var(--glass-bg);-webkit-backdrop-filter:var(--glass-backdrop-blur);backdrop-filter:var(--glass-backdrop-blur);transition:background .15s ease,border-color .15s ease}.integration-config-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);border-color:var(--color-primary)}.integration-config-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.integration-config-item__heading[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;min-width:0}.integration-config-item__name[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}.integration-config-item__badge[_ngcontent-%COMP%]{flex-shrink:0;font-size:.65rem;font-weight:600;letter-spacing:.04em;padding:.15rem .5rem;border-radius:999px;border:1px solid transparent;text-transform:uppercase;white-space:nowrap}.integration-config-item__badge[data-variant=neutral][_ngcontent-%COMP%]{background:var(--color-bg-secondary);color:var(--color-text-secondary);border-color:var(--color-border)}.integration-config-item__badge[data-variant=info][_ngcontent-%COMP%]{background:color-mix(in srgb,var(--color-info) 12%,transparent);color:var(--color-info);border-color:color-mix(in srgb,var(--color-info) 30%,transparent)}.integration-config-item__badge[data-variant=warning][_ngcontent-%COMP%]{background:color-mix(in srgb,var(--color-warning) 12%,transparent);color:var(--color-warning);border-color:color-mix(in srgb,var(--color-warning) 30%,transparent)}.integration-config-item__type[_ngcontent-%COMP%]{font-size:.78rem;color:var(--color-text-secondary);font-family:monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.integration-config-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.integration-config-item[_ngcontent-%COMP%]:hover .integration-config-item__actions[_ngcontent-%COMP%], .integration-config-item[_ngcontent-%COMP%]:focus-within .integration-config-item__actions[_ngcontent-%COMP%]{opacity:1}.integration-config-item__confirm-label[_ngcontent-%COMP%]{font-size:.8rem;font-weight:500;color:var(--color-error);margin-right:.25rem;white-space:nowrap}"],changeDetection:0})};export{D as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Ue}from"./chunk-XLY3EKFY.js";import{a as Ne}from"./chunk-PJ3HC56D.js";import{a as Oe}from"./chunk-73TUA3JE.js";import{a as Ee,b as Te,c as He}from"./chunk-FYW22VB6.js";import{a as Ie,b as we,c as Fe}from"./chunk-VURRJ77W.js";import{a as Se}from"./chunk-CG7JPH7I.js";import{a as ke}from"./chunk-WIVM4HFF.js";import{a as K}from"./chunk-NCQPF2YO.js";import{a as $,b as ee,c as te,d as ne,e as oe,f as ae,g as re,h as ie,i as me,j as pe,k as de,l as se,m as le,n as ge,o as fe,p as ue,q as he,r as Ce,s as be,t as _e,u as ve}from"./chunk-4ZQC632F.js";import{a as ce}from"./chunk-32WVX5ZP.js";import{a as Q,b as X,c as Z}from"./chunk-H2FHPYWP.js";import"./chunk-MLVWHS7Q.js";import{a as xe}from"./chunk-QHD6RKEP.js";import"./chunk-XEXRIFJE.js";import{a as H}from"./chunk-7WF5A3H7.js";import{a as Y,b as q,c as J}from"./chunk-JQYJDI3L.js";import{a as Pe,b as Me}from"./chunk-ZB3LDCY3.js";import{a as Ae,b as ye}from"./chunk-JMGIKNHE.js";import{k as F}from"./chunk-BCOH5IGB.js";import"./chunk-VR3I4RKJ.js";import{c as w}from"./chunk-MZT6I3S3.js";import{r as T}from"./chunk-F2SDHNCX.js";import"./chunk-MWPKXBXJ.js";import"./chunk-7EDSHFWH.js";import{a as E}from"./chunk-3ZLLFAXF.js";import"./chunk-Q2M4W42M.js";import"./chunk-DDWYQORF.js";import"./chunk-B46LXCLF.js";import{Bb as O,Db as c,Fb as C,Ka as p,Rb as S,Tb as r,Ub as x,Wa as f,ca as g,ga as A,ha as y,lb as s,ma as P,mb as l,mc as I,rb as _,sb as n,ta as b,tb as o,ub as h,vb as M,wb as k,xb as v}from"./chunk-KJ5SIUGY.js";var t=()=>!0;var Be=[{path:"",loadComponent:()=>import("./chunk-26FFFP6M.js").then(e=>e.AgentosShellComponent),children:[{path:"home",canActivate:[t],loadComponent:()=>import("./chunk-2JFW66QF.js").then(e=>e.CaseShellComponent)},{path:"",loadComponent:()=>import("./chunk-SFK3JOTF.js").then(e=>e.LayoutComponent),children:[{path:"namespaces/new",canActivate:[t],loadComponent:()=>import("./chunk-6JGMDWHO.js").then(e=>e.NamespaceFormComponent)},{path:"namespaces/:namespaceId/edit",canActivate:[t],loadComponent:()=>import("./chunk-6JGMDWHO.js").then(e=>e.NamespaceFormComponent)},{path:"namespaces",canActivate:[t],loadComponent:()=>import("./chunk-WO2Z5JMW.js").then(e=>e.NamespaceListComponent)},{path:"admin",canActivate:[t],loadComponent:()=>import("./chunk-NPW3WIRW.js").then(e=>e.AdminHomeComponent)},{path:"admin/users/new",canActivate:[t],loadComponent:()=>import("./chunk-6WGVBQKC.js").then(e=>e.UserFormComponent)},{path:"admin/users/:userId/edit",canActivate:[t],loadComponent:()=>import("./chunk-6WGVBQKC.js").then(e=>e.UserFormComponent)},{path:"admin/users",canActivate:[t],loadComponent:()=>import("./chunk-HEO22D4L.js").then(e=>e.AdminUsersGroupsComponent)},{path:"admin/integration-configs/new",canActivate:[t],loadComponent:()=>import("./chunk-LVMHNPNL.js").then(e=>e.IntegrationFormComponent)},{path:"admin/integration-configs/:integrationId/edit",canActivate:[t],loadComponent:()=>import("./chunk-LVMHNPNL.js").then(e=>e.IntegrationFormComponent)},{path:"admin/integration-configs",canActivate:[t],loadComponent:()=>import("./chunk-O4EHMHGS.js").then(e=>e.PlatformIntegrationConfigsComponent)},{path:"admin/prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-BLH76GUG.js").then(e=>e.PromptFormComponent)},{path:"admin/prompts/:promptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-BLH76GUG.js").then(e=>e.PromptFormComponent)},{path:"admin/prompts",canActivate:[t],loadComponent:()=>import("./chunk-BOKUHMXQ.js").then(e=>e.PlatformPromptsComponent)},{path:"admin/ai-providers/new",canActivate:[t],loadComponent:()=>import("./chunk-KYYUJJ6W.js").then(e=>e.AiProviderFormComponent)},{path:"admin/ai-providers/:aiProviderId/edit",canActivate:[t],loadComponent:()=>import("./chunk-KYYUJJ6W.js").then(e=>e.AiProviderFormComponent)},{path:"admin/ai-providers",canActivate:[t],loadComponent:()=>import("./chunk-7ZT4AOIS.js").then(e=>e.PlatformAiProvidersComponent)},{path:"admin/ai-models/new",canActivate:[t],loadComponent:()=>import("./chunk-QV6OOSC2.js").then(e=>e.AiModelFormComponent)},{path:"admin/ai-models/:modelId/edit",canActivate:[t],loadComponent:()=>import("./chunk-QV6OOSC2.js").then(e=>e.AiModelFormComponent)},{path:"admin/ai-models",canActivate:[t],loadComponent:()=>import("./chunk-GE5IABDA.js").then(e=>e.PlatformAiModelsComponent)},{path:"admin/agent-configs/new",canActivate:[t],loadComponent:()=>import("./chunk-QINOZGE3.js").then(e=>e.AgentConfigFormComponent)},{path:"admin/agent-configs/:agentConfigId/edit",canActivate:[t],loadComponent:()=>import("./chunk-QINOZGE3.js").then(e=>e.AgentConfigFormComponent)},{path:"admin/agent-configs/:agentConfigId/inspect",canActivate:[t],loadComponent:()=>import("./chunk-245FSNUP.js").then(e=>e.AgentConfigInspectComponent)},{path:"admin/agent-configs",canActivate:[t],loadComponent:()=>import("./chunk-QA6XH3LQ.js").then(e=>e.PlatformAgentConfigsComponent)},{path:"me",canActivate:[t],loadComponent:()=>import("./chunk-2MSURPPU.js").then(e=>e.UserProfileComponent)},{path:"user",canActivate:[t],loadComponent:()=>import("./chunk-2MSURPPU.js").then(e=>e.UserProfileComponent)},{path:":namespaceId/integrations/new",canActivate:[t],loadComponent:()=>import("./chunk-LVMHNPNL.js").then(e=>e.IntegrationFormComponent)},{path:":namespaceId/integrations/:integrationId/edit",canActivate:[t],loadComponent:()=>import("./chunk-LVMHNPNL.js").then(e=>e.IntegrationFormComponent)},{path:":namespaceId/integrations",canActivate:[t],loadComponent:()=>import("./chunk-OK32ENYP.js").then(e=>e.IntegrationsAllScopesComponent)},{path:":namespaceId/ai-providers/new",canActivate:[t],loadComponent:()=>import("./chunk-KYYUJJ6W.js").then(e=>e.AiProviderFormComponent)},{path:":namespaceId/ai-providers/:aiProviderId/edit",canActivate:[t],loadComponent:()=>import("./chunk-KYYUJJ6W.js").then(e=>e.AiProviderFormComponent)},{path:":namespaceId/ai-providers",canActivate:[t],loadComponent:()=>import("./chunk-IZLOFLQI.js").then(e=>e.AiProvidersAllScopesComponent)},{path:":namespaceId/ai-models/new",canActivate:[t],loadComponent:()=>import("./chunk-QV6OOSC2.js").then(e=>e.AiModelFormComponent)},{path:":namespaceId/ai-models/:modelId/edit",canActivate:[t],loadComponent:()=>import("./chunk-QV6OOSC2.js").then(e=>e.AiModelFormComponent)},{path:":namespaceId/ai-models",canActivate:[t],loadComponent:()=>import("./chunk-JM5SK7RJ.js").then(e=>e.NamespaceAiModelsComponent)},{path:":namespaceId/prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-BLH76GUG.js").then(e=>e.PromptFormComponent)},{path:":namespaceId/prompts/:promptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-BLH76GUG.js").then(e=>e.PromptFormComponent)},{path:":namespaceId/prompts",canActivate:[t],loadComponent:()=>import("./chunk-UTUTCLZV.js").then(e=>e.NamespacePromptsComponent)},{path:":namespaceId/agent-configs/new",canActivate:[t],loadComponent:()=>import("./chunk-QINOZGE3.js").then(e=>e.AgentConfigFormComponent)},{path:":namespaceId/agent-configs/:agentConfigId/edit",canActivate:[t],loadComponent:()=>import("./chunk-QINOZGE3.js").then(e=>e.AgentConfigFormComponent)},{path:":namespaceId/agent-configs/:agentConfigId/inspect",canActivate:[t],loadComponent:()=>import("./chunk-245FSNUP.js").then(e=>e.AgentConfigInspectComponent)},{path:":namespaceId/agent-configs",canActivate:[t],loadComponent:()=>import("./chunk-37R4PWRM.js").then(e=>e.NamespaceAgentConfigsComponent)},{path:":namespaceId/user-groups/new",canActivate:[t],loadComponent:()=>import("./chunk-DJW5YEVF.js").then(e=>e.UserGroupFormComponent)},{path:":namespaceId/user-groups/:userGroupId/edit",canActivate:[t],loadComponent:()=>import("./chunk-DJW5YEVF.js").then(e=>e.UserGroupFormComponent)},{path:":namespaceId/user-groups",canActivate:[t],loadComponent:()=>import("./chunk-S5GYRWWO.js").then(e=>e.NamespaceUserGroupsComponent)},{path:"",redirectTo:"namespaces",pathMatch:"full"}]}]}];function B(e,i){e&1&&v(0,"span",1)}function R(e,i){e&1&&v(0,"span",2)}function j(e,i){e&1&&v(0,"span",3)}var u=class e{pluginService=g(F);online=b(null);ngOnInit(){this.pluginService.getAllPlugins().subscribe({next:()=>this.online.set(!0),error:()=>this.online.set(!1)})}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=f({type:e,selectors:[["agentos-backend-status"]],decls:4,vars:1,consts:[[1,"backend-status"],["title","AgentOS online",1,"dot","dot--online"],["title","AgentOS offline",1,"dot","dot--offline"],["title","Checking\u2026",1,"dot","dot--checking"]],template:function(a,m){if(a&1&&(M(0,"div",0),s(1,B,1,0,"span",1)(2,R,1,0,"span",2)(3,j,1,0,"span",3),k()),a&2){let d;p(),l((d=m.online())===!0?1:d===!1?2:3)}},styles:[".backend-status[_ngcontent-%COMP%]{display:flex;align-items:center}.dot[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;flex-shrink:0}.dot--online[_ngcontent-%COMP%]{background:var(--color-success, #34c759)}.dot--offline[_ngcontent-%COMP%]{background:var(--color-error, #ff3b30)}.dot--checking[_ngcontent-%COMP%]{background:var(--color-text-secondary, #6e6e73);opacity:.5;animation:_ngcontent-%COMP%_pulse 1.2s ease-in-out infinite}@keyframes _ngcontent-%COMP%_pulse{0%,to{opacity:.5}50%{opacity:1}}"]})};function G(e,i){if(e&1){let a=O();n(0,"button",9),c("click",function(){A(a);let d=C();return y(d.navigateToAdmin())}),n(1,"span",10),r(2,"\u2699\uFE0F"),o()()}}function L(e,i){if(e&1&&(n(0,"span",7),r(1),o()),e&2){let a=C();p(),x(a.userInitials)}}function V(e,i){e&1&&(n(0,"span",8),r(1,"\u25EF"),o())}var z=class e{router=g(w);userState=g(H);destroyRef=g(P);currentUser=this.userState.currentUser;navigateHome(){this.router.navigate(["/agentos/home"])}isAdmin=I(()=>this.userState.currentUser()?.isAdmin===!0);navigateToAdmin(){this.router.navigate(["/agentos/admin"])}ngOnInit(){this.currentUser()||this.userState.loadMe().pipe(E(this.destroyRef)).subscribe()}get userInitials(){let i=this.currentUser();if(!i)return"";let a=i.firstname?.[0]??"",m=i.lastname?.[0]??"";return(a+m).toUpperCase()||i.email?.[0]?.toUpperCase()||"?"}get isOnProfilePage(){return this.router.url.startsWith("/agentos/me")}toggleProfile(){this.isOnProfilePage?window.history.length>1?window.history.back():this.router.navigate(["/agentos"]):this.router.navigate(["/agentos/me"])}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=f({type:e,selectors:[["agentos-header"]],decls:11,vars:5,consts:[[1,"header"],["type","button","title","Home",1,"header__brand",3,"click"],["src","CODAY-Logo.png","alt","Coday",1,"header__logo-img"],[1,"header__logo-text"],[1,"header__nav"],["type","button","title","Admin",1,"header__admin-btn"],["type","button",1,"header__user-btn",3,"click","title"],[1,"header__user-initials"],[1,"header__user-icon"],["type","button","title","Admin",1,"header__admin-btn",3,"click"],[1,"header__admin-icon"]],template:function(a,m){a&1&&(n(0,"header",0)(1,"button",1),c("click",function(){return m.navigateHome()}),h(2,"img",2),n(3,"span",3),r(4,"Coday"),o()(),n(5,"nav",4),h(6,"agentos-backend-status"),s(7,G,3,0,"button",5),n(8,"button",6),c("click",function(){return m.toggleProfile()}),s(9,L,2,1,"span",7)(10,V,2,0,"span",8),o()()()),a&2&&(p(7),l(m.isAdmin()?7:-1),p(),S("header__user-btn--active",m.isOnProfilePage),_("title",m.isOnProfilePage?"Back":"My profile"),p(),l(m.userInitials?9:10))},dependencies:[u],styles:[".header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:0 1.5rem;height:56px;background:var(--glass-bg, rgba(255, 255, 255, .72));border-bottom:1px solid var(--glass-border, rgba(255, 255, 255, .18));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));position:sticky;top:0;z-index:100}.header__brand[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;background:none;border:none;padding:0;cursor:pointer;border-radius:6px;transition:opacity .15s ease}.header__brand[_ngcontent-%COMP%]:hover{opacity:.7}.header__logo-img[_ngcontent-%COMP%]{width:32px;height:32px;object-fit:contain}.header__logo-text[_ngcontent-%COMP%]{font-size:1rem;font-weight:700;letter-spacing:-.01em;color:var(--color-text, #1d1d1f)}.header__nav[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.header__admin-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;border:1.5px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--color-bg-secondary, rgba(0, 0, 0, .04));cursor:pointer;transition:background .15s ease,border-color .15s ease;padding:0;font-family:inherit;font-size:1rem;line-height:1}.header__admin-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .08));border-color:var(--color-primary, #007aff)}.header__admin-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.header__user-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;border:1.5px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--color-bg-secondary, rgba(0, 0, 0, .04));cursor:pointer;transition:background .15s ease,border-color .15s ease;padding:0;font-family:inherit}.header__user-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .08));border-color:var(--color-primary, #007aff)}.header__user-btn--active[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff)}.header__user-btn--active[_ngcontent-%COMP%] .header__user-initials[_ngcontent-%COMP%], .header__user-btn--active[_ngcontent-%COMP%] .header__user-icon[_ngcontent-%COMP%]{color:#fff}.header__user-initials[_ngcontent-%COMP%]{font-size:.75rem;font-weight:600;color:var(--color-text, #1d1d1f);line-height:1;letter-spacing:.02em}.header__user-icon[_ngcontent-%COMP%]{font-size:1rem;color:var(--color-text-secondary, #6e6e73);line-height:1}"]})};function W(e,i){if(e&1&&(n(0,"p",11),r(1," Last action: "),n(2,"strong"),r(3),o()()),e&2){let a=C();p(3),x(a.lastAction())}}var D=class e{lastAction=b(null);onSend(){this.lastAction.set("send")}onStop(){this.lastAction.set("stop")}onAttach(){this.lastAction.set("attach")}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=f({type:e,selectors:[["agentos-hello"]],decls:35,vars:2,consts:[[1,"hello-agentos"],[1,"card"],[1,"badge"],[1,"principles"],[1,"demo"],[1,"demo-label"],[1,"demo-buttons"],["icon","send","variant","primary","title","Send",3,"action"],["icon","stop","variant","danger","title","Stop",3,"action"],["icon","attach_file","variant","default","title","Attach",3,"action"],["icon","mic","variant","default","title","Record",3,"action","disabled"],[1,"demo-feedback"]],template:function(a,m){a&1&&(n(0,"div",0)(1,"div",1)(2,"div",2),r(3,"AgentOS UI"),o(),n(4,"h1"),r(5,"Hello AgentOS"),o(),n(6,"p"),r(7," This component lives in "),n(8,"code"),r(9,"libs/agentos-ui"),o(),r(10," \u2014 isolated from Coday internals, ready to be published as "),n(11,"code"),r(12,"@whoz-oss/agentos-ui"),o(),r(13,". "),o(),h(14,"agentos-backend-status"),n(15,"ul",3)(16,"li"),r(17,"\u2726 No imports from Coday app"),o(),n(18,"li"),r(19,"\u2726 CSS custom properties as host contract"),o(),n(20,"li"),r(21,"\u2726 Standalone Angular components"),o(),n(22,"li"),r(23,"\u2726 Signals-first reactive state"),o()(),n(24,"div",4)(25,"p",5),r(26,"ds-icon-button from "),n(27,"code"),r(28,"@whoz-oss/design-system"),o()(),n(29,"div",6)(30,"ds-icon-button",7),c("action",function(){return m.onSend()}),o(),n(31,"ds-icon-button",8),c("action",function(){return m.onStop()}),o(),n(32,"ds-icon-button",9),c("action",function(){return m.onAttach()}),o(),n(33,"ds-icon-button",10),c("action",function(){return m.onAttach()}),o()(),s(34,W,4,1,"p",11),o()()()),a&2&&(p(33),_("disabled",!0),p(),l(m.lastAction()?34:-1))},dependencies:[T,u],styles:['@charset "UTF-8";.hello-agentos[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;min-height:100vh;padding:2rem}.card[_ngcontent-%COMP%]{background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));box-shadow:var(--glass-shadow, 0 8px 32px 0 rgba(31, 38, 135, .15));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));border-radius:20px;padding:3rem;max-width:480px;width:100%;text-align:center}.badge[_ngcontent-%COMP%]{display:inline-block;background:var(--color-primary, #007aff);color:var(--color-text-inverse, #ffffff);font-size:.75rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;padding:.25rem .75rem;border-radius:100px;margin-bottom:1.5rem}h1[_ngcontent-%COMP%]{color:var(--color-text, #1d1d1f);font-size:2rem;font-weight:700;margin:0 0 1rem;letter-spacing:-.02em}p[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);line-height:1.6;margin:0 0 1.5rem}p[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--color-code-bg, rgba(142, 142, 147, .12));color:var(--color-code-text, #ff375f);padding:.125rem .375rem;border-radius:6px;font-size:.875em;border:1px solid var(--color-border, rgba(0, 0, 0, .1))}.principles[_ngcontent-%COMP%]{list-style:none;margin:0 0 1.5rem;padding:0;text-align:left;display:flex;flex-direction:column;gap:.5rem}.principles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;padding:.5rem .75rem;background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-radius:8px;border:1px solid var(--color-border-light, rgba(40, 40, 40, .08))}.demo[_ngcontent-%COMP%]{border-top:1px solid var(--color-border-light, rgba(40, 40, 40, .08));padding-top:1.25rem}.demo[_ngcontent-%COMP%] .demo-label[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.8rem;margin:0 0 .75rem}.demo[_ngcontent-%COMP%] .demo-label[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--color-code-bg, rgba(142, 142, 147, .12));color:var(--color-code-text, #ff375f);padding:.125rem .375rem;border-radius:6px;font-size:.875em;border:1px solid var(--color-border, rgba(0, 0, 0, .1))}.demo[_ngcontent-%COMP%] .demo-buttons[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center;justify-content:center;padding:.75rem;background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-radius:12px;border:1px solid var(--color-border-light, rgba(40, 40, 40, .08))}.demo[_ngcontent-%COMP%] .demo-feedback[_ngcontent-%COMP%]{margin:.75rem 0 0;font-size:.85rem;color:var(--color-text-secondary, #6e6e73)}.demo[_ngcontent-%COMP%] .demo-feedback[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--color-primary, #007aff)}']})};export{Be as AGENTOS_ROUTES,Ae as ActionCardChipsDirective,ye as ActionCardComponent,He as AdminUsersGroupsComponent,K as AgentosShellComponent,q as AgentosThemeService,X as AgentosUserPreferencesService,u as BackendStatusComponent,he as CaseChatComponent,_e as CaseDrawerComponent,Ce as CaseHomeComponent,be as CaseItemComponent,ve as CaseShellComponent,Q as ENTER_KEY_BEHAVIORS,se as ExchangeContentViewerComponent,fe as ExchangeDrawerComponent,ge as ExchangeFileListComponent,le as ExchangeItemComponent,ue as ExchangeShellComponent,$ as ExchangeStateService,z as HeaderComponent,D as HelloAgentosComponent,xe as LayoutComponent,ee as MAX_VIEWABLE_SIZE,ce as MarkdownPipe,Pe as NamespaceItemComponent,Me as NamespaceListComponent,Ie as NamespaceSelectComponent,Ne as NamespaceUserGroupsComponent,Y as THEME_MODES,J as THEME_PORT,Z as USER_PREFERENCES_PORT,ke as UserAdminStateService,Oe as UserFormComponent,Ue as UserGroupFormComponent,we as UserGroupItemComponent,Fe as UserGroupListComponent,Se as UserGroupStateService,Ee as UserItemComponent,Te as UserListComponent,H as UserStateService,t as agentosReadyGuard,me as canViewFile,ae as detectFormat,de as exchangeMutationScope,oe as formatDate,ne as formatSize,te as getFileIcon,re as isFormatViewable,ie as isViewable,pe as reindentJson};
|
|
1
|
+
import{a as Ue}from"./chunk-J4RCBELS.js";import{a as Ne}from"./chunk-WTSDGIW6.js";import{a as Oe}from"./chunk-73TUA3JE.js";import{a as Ee,b as Te,c as He}from"./chunk-NEIKVLFC.js";import{a as Ie,b as we,c as Fe}from"./chunk-3CMKQDJD.js";import{a as Se}from"./chunk-CG7JPH7I.js";import{a as ke}from"./chunk-WIVM4HFF.js";import{a as K}from"./chunk-NCQPF2YO.js";import{a as $,b as ee,c as te,d as ne,e as oe,f as ae,g as re,h as ie,i as me,j as pe,k as de,l as se,m as le,n as ge,o as fe,p as ue,q as he,r as Ce,s as be,t as _e,u as ve}from"./chunk-56ZJETOZ.js";import{a as ce}from"./chunk-32WVX5ZP.js";import{a as Q,b as X,c as Z}from"./chunk-H2FHPYWP.js";import"./chunk-MLVWHS7Q.js";import{a as xe}from"./chunk-QHD6RKEP.js";import"./chunk-XEXRIFJE.js";import{a as H}from"./chunk-7WF5A3H7.js";import{a as Y,b as q,c as J}from"./chunk-JQYJDI3L.js";import{a as Pe,b as Me}from"./chunk-VURHEL5U.js";import{a as Ae,b as ye}from"./chunk-QCPXHP56.js";import{k as F}from"./chunk-BCOH5IGB.js";import"./chunk-VR3I4RKJ.js";import{c as w}from"./chunk-MZT6I3S3.js";import{r as T}from"./chunk-N347WQAU.js";import"./chunk-MWPKXBXJ.js";import"./chunk-7EDSHFWH.js";import{a as E}from"./chunk-3ZLLFAXF.js";import"./chunk-Q2M4W42M.js";import"./chunk-DDWYQORF.js";import"./chunk-B46LXCLF.js";import{Bb as O,Db as c,Fb as C,Ka as p,Rb as S,Tb as r,Ub as x,Wa as f,ca as g,ga as A,ha as y,lb as s,ma as P,mb as l,mc as I,rb as _,sb as n,ta as b,tb as o,ub as h,vb as M,wb as k,xb as v}from"./chunk-KJ5SIUGY.js";var t=()=>!0;var Be=[{path:"",loadComponent:()=>import("./chunk-26FFFP6M.js").then(e=>e.AgentosShellComponent),children:[{path:"home",canActivate:[t],loadComponent:()=>import("./chunk-DLM7MUO5.js").then(e=>e.CaseShellComponent)},{path:"",loadComponent:()=>import("./chunk-SFK3JOTF.js").then(e=>e.LayoutComponent),children:[{path:"namespaces/new",canActivate:[t],loadComponent:()=>import("./chunk-6JGMDWHO.js").then(e=>e.NamespaceFormComponent)},{path:"namespaces/:namespaceId/edit",canActivate:[t],loadComponent:()=>import("./chunk-6JGMDWHO.js").then(e=>e.NamespaceFormComponent)},{path:"namespaces",canActivate:[t],loadComponent:()=>import("./chunk-T2HMC47U.js").then(e=>e.NamespaceListComponent)},{path:"admin",canActivate:[t],loadComponent:()=>import("./chunk-KT6YZNOC.js").then(e=>e.AdminHomeComponent)},{path:"admin/users/new",canActivate:[t],loadComponent:()=>import("./chunk-6WGVBQKC.js").then(e=>e.UserFormComponent)},{path:"admin/users/:userId/edit",canActivate:[t],loadComponent:()=>import("./chunk-6WGVBQKC.js").then(e=>e.UserFormComponent)},{path:"admin/users",canActivate:[t],loadComponent:()=>import("./chunk-XTHD557L.js").then(e=>e.AdminUsersGroupsComponent)},{path:"admin/integration-configs/new",canActivate:[t],loadComponent:()=>import("./chunk-V7G5TYBH.js").then(e=>e.IntegrationFormComponent)},{path:"admin/integration-configs/:integrationId/edit",canActivate:[t],loadComponent:()=>import("./chunk-V7G5TYBH.js").then(e=>e.IntegrationFormComponent)},{path:"admin/integration-configs",canActivate:[t],loadComponent:()=>import("./chunk-IAB4GU4A.js").then(e=>e.PlatformIntegrationConfigsComponent)},{path:"admin/prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-BLH76GUG.js").then(e=>e.PromptFormComponent)},{path:"admin/prompts/:promptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-BLH76GUG.js").then(e=>e.PromptFormComponent)},{path:"admin/prompts",canActivate:[t],loadComponent:()=>import("./chunk-CCWYFJZD.js").then(e=>e.PlatformPromptsComponent)},{path:"admin/ai-providers/new",canActivate:[t],loadComponent:()=>import("./chunk-KYYUJJ6W.js").then(e=>e.AiProviderFormComponent)},{path:"admin/ai-providers/:aiProviderId/edit",canActivate:[t],loadComponent:()=>import("./chunk-KYYUJJ6W.js").then(e=>e.AiProviderFormComponent)},{path:"admin/ai-providers",canActivate:[t],loadComponent:()=>import("./chunk-YHKKJQPZ.js").then(e=>e.PlatformAiProvidersComponent)},{path:"admin/ai-models/new",canActivate:[t],loadComponent:()=>import("./chunk-QV6OOSC2.js").then(e=>e.AiModelFormComponent)},{path:"admin/ai-models/:modelId/edit",canActivate:[t],loadComponent:()=>import("./chunk-QV6OOSC2.js").then(e=>e.AiModelFormComponent)},{path:"admin/ai-models",canActivate:[t],loadComponent:()=>import("./chunk-WEFHBDOC.js").then(e=>e.PlatformAiModelsComponent)},{path:"admin/agent-configs/new",canActivate:[t],loadComponent:()=>import("./chunk-QINOZGE3.js").then(e=>e.AgentConfigFormComponent)},{path:"admin/agent-configs/:agentConfigId/edit",canActivate:[t],loadComponent:()=>import("./chunk-QINOZGE3.js").then(e=>e.AgentConfigFormComponent)},{path:"admin/agent-configs/:agentConfigId/inspect",canActivate:[t],loadComponent:()=>import("./chunk-245FSNUP.js").then(e=>e.AgentConfigInspectComponent)},{path:"admin/agent-configs",canActivate:[t],loadComponent:()=>import("./chunk-3MIJJDXL.js").then(e=>e.PlatformAgentConfigsComponent)},{path:"me",canActivate:[t],loadComponent:()=>import("./chunk-ZD5EXS3I.js").then(e=>e.UserProfileComponent)},{path:"user",canActivate:[t],loadComponent:()=>import("./chunk-ZD5EXS3I.js").then(e=>e.UserProfileComponent)},{path:":namespaceId/integrations/new",canActivate:[t],loadComponent:()=>import("./chunk-V7G5TYBH.js").then(e=>e.IntegrationFormComponent)},{path:":namespaceId/integrations/:integrationId/edit",canActivate:[t],loadComponent:()=>import("./chunk-V7G5TYBH.js").then(e=>e.IntegrationFormComponent)},{path:":namespaceId/integrations",canActivate:[t],loadComponent:()=>import("./chunk-6BVQYZZJ.js").then(e=>e.IntegrationsAllScopesComponent)},{path:":namespaceId/ai-providers/new",canActivate:[t],loadComponent:()=>import("./chunk-KYYUJJ6W.js").then(e=>e.AiProviderFormComponent)},{path:":namespaceId/ai-providers/:aiProviderId/edit",canActivate:[t],loadComponent:()=>import("./chunk-KYYUJJ6W.js").then(e=>e.AiProviderFormComponent)},{path:":namespaceId/ai-providers",canActivate:[t],loadComponent:()=>import("./chunk-M2ZQ6RPO.js").then(e=>e.AiProvidersAllScopesComponent)},{path:":namespaceId/ai-models/new",canActivate:[t],loadComponent:()=>import("./chunk-QV6OOSC2.js").then(e=>e.AiModelFormComponent)},{path:":namespaceId/ai-models/:modelId/edit",canActivate:[t],loadComponent:()=>import("./chunk-QV6OOSC2.js").then(e=>e.AiModelFormComponent)},{path:":namespaceId/ai-models",canActivate:[t],loadComponent:()=>import("./chunk-C7Y56WDM.js").then(e=>e.NamespaceAiModelsComponent)},{path:":namespaceId/prompts/new",canActivate:[t],loadComponent:()=>import("./chunk-BLH76GUG.js").then(e=>e.PromptFormComponent)},{path:":namespaceId/prompts/:promptId/edit",canActivate:[t],loadComponent:()=>import("./chunk-BLH76GUG.js").then(e=>e.PromptFormComponent)},{path:":namespaceId/prompts",canActivate:[t],loadComponent:()=>import("./chunk-GXBIFFTK.js").then(e=>e.NamespacePromptsComponent)},{path:":namespaceId/agent-configs/new",canActivate:[t],loadComponent:()=>import("./chunk-QINOZGE3.js").then(e=>e.AgentConfigFormComponent)},{path:":namespaceId/agent-configs/:agentConfigId/edit",canActivate:[t],loadComponent:()=>import("./chunk-QINOZGE3.js").then(e=>e.AgentConfigFormComponent)},{path:":namespaceId/agent-configs/:agentConfigId/inspect",canActivate:[t],loadComponent:()=>import("./chunk-245FSNUP.js").then(e=>e.AgentConfigInspectComponent)},{path:":namespaceId/agent-configs",canActivate:[t],loadComponent:()=>import("./chunk-SC2IRNRE.js").then(e=>e.NamespaceAgentConfigsComponent)},{path:":namespaceId/user-groups/new",canActivate:[t],loadComponent:()=>import("./chunk-WLBH76W3.js").then(e=>e.UserGroupFormComponent)},{path:":namespaceId/user-groups/:userGroupId/edit",canActivate:[t],loadComponent:()=>import("./chunk-WLBH76W3.js").then(e=>e.UserGroupFormComponent)},{path:":namespaceId/user-groups",canActivate:[t],loadComponent:()=>import("./chunk-IFCMGNTL.js").then(e=>e.NamespaceUserGroupsComponent)},{path:"",redirectTo:"namespaces",pathMatch:"full"}]}]}];function B(e,i){e&1&&v(0,"span",1)}function R(e,i){e&1&&v(0,"span",2)}function j(e,i){e&1&&v(0,"span",3)}var u=class e{pluginService=g(F);online=b(null);ngOnInit(){this.pluginService.getAllPlugins().subscribe({next:()=>this.online.set(!0),error:()=>this.online.set(!1)})}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=f({type:e,selectors:[["agentos-backend-status"]],decls:4,vars:1,consts:[[1,"backend-status"],["title","AgentOS online",1,"dot","dot--online"],["title","AgentOS offline",1,"dot","dot--offline"],["title","Checking\u2026",1,"dot","dot--checking"]],template:function(a,m){if(a&1&&(M(0,"div",0),s(1,B,1,0,"span",1)(2,R,1,0,"span",2)(3,j,1,0,"span",3),k()),a&2){let d;p(),l((d=m.online())===!0?1:d===!1?2:3)}},styles:[".backend-status[_ngcontent-%COMP%]{display:flex;align-items:center}.dot[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;flex-shrink:0}.dot--online[_ngcontent-%COMP%]{background:var(--color-success, #34c759)}.dot--offline[_ngcontent-%COMP%]{background:var(--color-error, #ff3b30)}.dot--checking[_ngcontent-%COMP%]{background:var(--color-text-secondary, #6e6e73);opacity:.5;animation:_ngcontent-%COMP%_pulse 1.2s ease-in-out infinite}@keyframes _ngcontent-%COMP%_pulse{0%,to{opacity:.5}50%{opacity:1}}"]})};function G(e,i){if(e&1){let a=O();n(0,"button",9),c("click",function(){A(a);let d=C();return y(d.navigateToAdmin())}),n(1,"span",10),r(2,"\u2699\uFE0F"),o()()}}function L(e,i){if(e&1&&(n(0,"span",7),r(1),o()),e&2){let a=C();p(),x(a.userInitials)}}function V(e,i){e&1&&(n(0,"span",8),r(1,"\u25EF"),o())}var z=class e{router=g(w);userState=g(H);destroyRef=g(P);currentUser=this.userState.currentUser;navigateHome(){this.router.navigate(["/agentos/home"])}isAdmin=I(()=>this.userState.currentUser()?.isAdmin===!0);navigateToAdmin(){this.router.navigate(["/agentos/admin"])}ngOnInit(){this.currentUser()||this.userState.loadMe().pipe(E(this.destroyRef)).subscribe()}get userInitials(){let i=this.currentUser();if(!i)return"";let a=i.firstname?.[0]??"",m=i.lastname?.[0]??"";return(a+m).toUpperCase()||i.email?.[0]?.toUpperCase()||"?"}get isOnProfilePage(){return this.router.url.startsWith("/agentos/me")}toggleProfile(){this.isOnProfilePage?window.history.length>1?window.history.back():this.router.navigate(["/agentos"]):this.router.navigate(["/agentos/me"])}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=f({type:e,selectors:[["agentos-header"]],decls:11,vars:5,consts:[[1,"header"],["type","button","title","Home",1,"header__brand",3,"click"],["src","CODAY-Logo.png","alt","Coday",1,"header__logo-img"],[1,"header__logo-text"],[1,"header__nav"],["type","button","title","Admin",1,"header__admin-btn"],["type","button",1,"header__user-btn",3,"click","title"],[1,"header__user-initials"],[1,"header__user-icon"],["type","button","title","Admin",1,"header__admin-btn",3,"click"],[1,"header__admin-icon"]],template:function(a,m){a&1&&(n(0,"header",0)(1,"button",1),c("click",function(){return m.navigateHome()}),h(2,"img",2),n(3,"span",3),r(4,"Coday"),o()(),n(5,"nav",4),h(6,"agentos-backend-status"),s(7,G,3,0,"button",5),n(8,"button",6),c("click",function(){return m.toggleProfile()}),s(9,L,2,1,"span",7)(10,V,2,0,"span",8),o()()()),a&2&&(p(7),l(m.isAdmin()?7:-1),p(),S("header__user-btn--active",m.isOnProfilePage),_("title",m.isOnProfilePage?"Back":"My profile"),p(),l(m.userInitials?9:10))},dependencies:[u],styles:[".header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:0 1.5rem;height:56px;background:var(--glass-bg, rgba(255, 255, 255, .72));border-bottom:1px solid var(--glass-border, rgba(255, 255, 255, .18));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));position:sticky;top:0;z-index:100}.header__brand[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;background:none;border:none;padding:0;cursor:pointer;border-radius:6px;transition:opacity .15s ease}.header__brand[_ngcontent-%COMP%]:hover{opacity:.7}.header__logo-img[_ngcontent-%COMP%]{width:32px;height:32px;object-fit:contain}.header__logo-text[_ngcontent-%COMP%]{font-size:1rem;font-weight:700;letter-spacing:-.01em;color:var(--color-text, #1d1d1f)}.header__nav[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.header__admin-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;border:1.5px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--color-bg-secondary, rgba(0, 0, 0, .04));cursor:pointer;transition:background .15s ease,border-color .15s ease;padding:0;font-family:inherit;font-size:1rem;line-height:1}.header__admin-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .08));border-color:var(--color-primary, #007aff)}.header__admin-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.header__user-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;border:1.5px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--color-bg-secondary, rgba(0, 0, 0, .04));cursor:pointer;transition:background .15s ease,border-color .15s ease;padding:0;font-family:inherit}.header__user-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .08));border-color:var(--color-primary, #007aff)}.header__user-btn--active[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff)}.header__user-btn--active[_ngcontent-%COMP%] .header__user-initials[_ngcontent-%COMP%], .header__user-btn--active[_ngcontent-%COMP%] .header__user-icon[_ngcontent-%COMP%]{color:#fff}.header__user-initials[_ngcontent-%COMP%]{font-size:.75rem;font-weight:600;color:var(--color-text, #1d1d1f);line-height:1;letter-spacing:.02em}.header__user-icon[_ngcontent-%COMP%]{font-size:1rem;color:var(--color-text-secondary, #6e6e73);line-height:1}"]})};function W(e,i){if(e&1&&(n(0,"p",11),r(1," Last action: "),n(2,"strong"),r(3),o()()),e&2){let a=C();p(3),x(a.lastAction())}}var D=class e{lastAction=b(null);onSend(){this.lastAction.set("send")}onStop(){this.lastAction.set("stop")}onAttach(){this.lastAction.set("attach")}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=f({type:e,selectors:[["agentos-hello"]],decls:35,vars:2,consts:[[1,"hello-agentos"],[1,"card"],[1,"badge"],[1,"principles"],[1,"demo"],[1,"demo-label"],[1,"demo-buttons"],["icon","send","variant","primary","title","Send",3,"action"],["icon","stop","variant","danger","title","Stop",3,"action"],["icon","attach_file","variant","default","title","Attach",3,"action"],["icon","mic","variant","default","title","Record",3,"action","disabled"],[1,"demo-feedback"]],template:function(a,m){a&1&&(n(0,"div",0)(1,"div",1)(2,"div",2),r(3,"AgentOS UI"),o(),n(4,"h1"),r(5,"Hello AgentOS"),o(),n(6,"p"),r(7," This component lives in "),n(8,"code"),r(9,"libs/agentos-ui"),o(),r(10," \u2014 isolated from Coday internals, ready to be published as "),n(11,"code"),r(12,"@whoz-oss/agentos-ui"),o(),r(13,". "),o(),h(14,"agentos-backend-status"),n(15,"ul",3)(16,"li"),r(17,"\u2726 No imports from Coday app"),o(),n(18,"li"),r(19,"\u2726 CSS custom properties as host contract"),o(),n(20,"li"),r(21,"\u2726 Standalone Angular components"),o(),n(22,"li"),r(23,"\u2726 Signals-first reactive state"),o()(),n(24,"div",4)(25,"p",5),r(26,"ds-icon-button from "),n(27,"code"),r(28,"@whoz-oss/design-system"),o()(),n(29,"div",6)(30,"ds-icon-button",7),c("action",function(){return m.onSend()}),o(),n(31,"ds-icon-button",8),c("action",function(){return m.onStop()}),o(),n(32,"ds-icon-button",9),c("action",function(){return m.onAttach()}),o(),n(33,"ds-icon-button",10),c("action",function(){return m.onAttach()}),o()(),s(34,W,4,1,"p",11),o()()()),a&2&&(p(33),_("disabled",!0),p(),l(m.lastAction()?34:-1))},dependencies:[T,u],styles:['@charset "UTF-8";.hello-agentos[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;min-height:100vh;padding:2rem}.card[_ngcontent-%COMP%]{background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));box-shadow:var(--glass-shadow, 0 8px 32px 0 rgba(31, 38, 135, .15));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));border-radius:20px;padding:3rem;max-width:480px;width:100%;text-align:center}.badge[_ngcontent-%COMP%]{display:inline-block;background:var(--color-primary, #007aff);color:var(--color-text-inverse, #ffffff);font-size:.75rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;padding:.25rem .75rem;border-radius:100px;margin-bottom:1.5rem}h1[_ngcontent-%COMP%]{color:var(--color-text, #1d1d1f);font-size:2rem;font-weight:700;margin:0 0 1rem;letter-spacing:-.02em}p[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);line-height:1.6;margin:0 0 1.5rem}p[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--color-code-bg, rgba(142, 142, 147, .12));color:var(--color-code-text, #ff375f);padding:.125rem .375rem;border-radius:6px;font-size:.875em;border:1px solid var(--color-border, rgba(0, 0, 0, .1))}.principles[_ngcontent-%COMP%]{list-style:none;margin:0 0 1.5rem;padding:0;text-align:left;display:flex;flex-direction:column;gap:.5rem}.principles[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;padding:.5rem .75rem;background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-radius:8px;border:1px solid var(--color-border-light, rgba(40, 40, 40, .08))}.demo[_ngcontent-%COMP%]{border-top:1px solid var(--color-border-light, rgba(40, 40, 40, .08));padding-top:1.25rem}.demo[_ngcontent-%COMP%] .demo-label[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.8rem;margin:0 0 .75rem}.demo[_ngcontent-%COMP%] .demo-label[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:var(--color-code-bg, rgba(142, 142, 147, .12));color:var(--color-code-text, #ff375f);padding:.125rem .375rem;border-radius:6px;font-size:.875em;border:1px solid var(--color-border, rgba(0, 0, 0, .1))}.demo[_ngcontent-%COMP%] .demo-buttons[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center;justify-content:center;padding:.75rem;background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-radius:12px;border:1px solid var(--color-border-light, rgba(40, 40, 40, .08))}.demo[_ngcontent-%COMP%] .demo-feedback[_ngcontent-%COMP%]{margin:.75rem 0 0;font-size:.85rem;color:var(--color-text-secondary, #6e6e73)}.demo[_ngcontent-%COMP%] .demo-feedback[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:var(--color-primary, #007aff)}']})};export{Be as AGENTOS_ROUTES,Ae as ActionCardChipsDirective,ye as ActionCardComponent,He as AdminUsersGroupsComponent,K as AgentosShellComponent,q as AgentosThemeService,X as AgentosUserPreferencesService,u as BackendStatusComponent,he as CaseChatComponent,_e as CaseDrawerComponent,Ce as CaseHomeComponent,be as CaseItemComponent,ve as CaseShellComponent,Q as ENTER_KEY_BEHAVIORS,se as ExchangeContentViewerComponent,fe as ExchangeDrawerComponent,ge as ExchangeFileListComponent,le as ExchangeItemComponent,ue as ExchangeShellComponent,$ as ExchangeStateService,z as HeaderComponent,D as HelloAgentosComponent,xe as LayoutComponent,ee as MAX_VIEWABLE_SIZE,ce as MarkdownPipe,Pe as NamespaceItemComponent,Me as NamespaceListComponent,Ie as NamespaceSelectComponent,Ne as NamespaceUserGroupsComponent,Y as THEME_MODES,J as THEME_PORT,Z as USER_PREFERENCES_PORT,ke as UserAdminStateService,Oe as UserFormComponent,Ue as UserGroupFormComponent,we as UserGroupItemComponent,Fe as UserGroupListComponent,Se as UserGroupStateService,Ee as UserItemComponent,Te as UserListComponent,H as UserStateService,t as agentosReadyGuard,me as canViewFile,ae as detectFormat,de as exchangeMutationScope,oe as formatDate,ne as formatSize,te as getFileIcon,re as isFormatViewable,ie as isViewable,pe as reindentJson};
|