@whoz-oss/coday-client 0.226.0 → 0.227.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/browser/{chunk-IFCMGNTL.js → chunk-2EC3VX77.js} +1 -1
  2. package/browser/{chunk-OWANJEQU.js → chunk-2OC3IQX4.js} +1 -1
  3. package/browser/chunk-3B27XA6H.js +1 -0
  4. package/browser/{chunk-6WGVBQKC.js → chunk-3FIVKNVQ.js} +1 -1
  5. package/browser/{chunk-3MIJJDXL.js → chunk-3QNGI2KL.js} +1 -1
  6. package/browser/chunk-4224C2BE.js +1 -0
  7. package/browser/{chunk-QV6OOSC2.js → chunk-44OQZAMB.js} +1 -1
  8. package/browser/chunk-4NGK3AH3.js +1 -0
  9. package/browser/{chunk-CCWYFJZD.js → chunk-5KM666YK.js} +1 -1
  10. package/browser/chunk-5NIQZOIU.js +1 -0
  11. package/browser/{chunk-WTSDGIW6.js → chunk-5RGU7B74.js} +1 -1
  12. package/browser/chunk-6LNXGAHM.js +1 -0
  13. package/browser/{chunk-YHKKJQPZ.js → chunk-7BBT4E5E.js} +1 -1
  14. package/browser/chunk-7DZ6K6CC.js +6 -0
  15. package/browser/{chunk-MLVWHS7Q.js → chunk-7N4XUYW4.js} +1 -1
  16. package/browser/{chunk-6BVQYZZJ.js → chunk-AKTPF6RS.js} +1 -1
  17. package/browser/{chunk-V7G5TYBH.js → chunk-AVN3J4SW.js} +1 -1
  18. package/browser/{chunk-WGIDIO7O.js → chunk-BHI42QOO.js} +1 -1
  19. package/browser/{chunk-M2ZQ6RPO.js → chunk-BPTQDERH.js} +1 -1
  20. package/browser/{chunk-N347WQAU.js → chunk-C2J4TQ7V.js} +6 -6
  21. package/browser/chunk-CLXIHGI5.js +1 -0
  22. package/browser/{chunk-Y3VADJFG.js → chunk-CPIJPSK3.js} +1 -1
  23. package/browser/{chunk-7WF5A3H7.js → chunk-DEI4EULW.js} +1 -1
  24. package/browser/{chunk-KT6YZNOC.js → chunk-DXS7ET5V.js} +1 -1
  25. package/browser/chunk-DXSUJXKW.js +1 -0
  26. package/browser/{chunk-WEFHBDOC.js → chunk-E2PTKMR3.js} +1 -1
  27. package/browser/chunk-EBGVWTDP.js +1 -0
  28. package/browser/chunk-ETVJIECM.js +1 -0
  29. package/browser/{chunk-O2RHZQBE.js → chunk-FW4JCZNG.js} +1 -1
  30. package/browser/{chunk-T2HMC47U.js → chunk-GH2VWCFB.js} +1 -1
  31. package/browser/{chunk-BLH76GUG.js → chunk-HJCJ2A5U.js} +1 -1
  32. package/browser/{chunk-J4RCBELS.js → chunk-JC3UT7FL.js} +1 -1
  33. package/browser/{chunk-VDQ7VRBP.js → chunk-JW4JKLFN.js} +1 -1
  34. package/browser/{chunk-GXBIFFTK.js → chunk-KRRTNACV.js} +1 -1
  35. package/browser/chunk-L7EWDR3X.js +1 -0
  36. package/browser/{chunk-CC2JFA5X.js → chunk-LTFSHOKE.js} +1 -1
  37. package/browser/chunk-MDC6KYTF.js +1 -0
  38. package/browser/chunk-MGVK4WNW.js +1 -0
  39. package/browser/{chunk-S4UXUKNG.js → chunk-MQ6C2B4Z.js} +1 -1
  40. package/browser/{chunk-VFKWKYIG.js → chunk-MTXOV52Z.js} +1 -1
  41. package/browser/{chunk-IAB4GU4A.js → chunk-MZIRWGY7.js} +1 -1
  42. package/browser/{chunk-WIVM4HFF.js → chunk-NA5F32JD.js} +1 -1
  43. package/browser/chunk-NOMEOUXJ.js +1 -0
  44. package/browser/{chunk-NCQPF2YO.js → chunk-O77FDCNG.js} +1 -1
  45. package/browser/{chunk-C7Y56WDM.js → chunk-OK4EJOSI.js} +1 -1
  46. package/browser/{chunk-3SKJ5SNK.js → chunk-PFBYB2QD.js} +1 -1
  47. package/browser/{chunk-QINOZGE3.js → chunk-PTXZUITK.js} +1 -1
  48. package/browser/chunk-PW6KVUDR.js +1 -0
  49. package/browser/{chunk-MEZUHBEH.js → chunk-QDN2FP73.js} +1 -1
  50. package/browser/{chunk-KGJBI3SN.js → chunk-QUHNQ4OB.js} +1 -1
  51. package/browser/{chunk-26FFFP6M.js → chunk-RFBE4F6Q.js} +1 -1
  52. package/browser/chunk-RK2UBI5O.js +1 -0
  53. package/browser/{chunk-KRZMF2CT.js → chunk-SW3MVXR5.js} +1 -1
  54. package/browser/{chunk-6JGMDWHO.js → chunk-SWOMF3ZR.js} +1 -1
  55. package/browser/{chunk-CG7JPH7I.js → chunk-TBYJS5N4.js} +1 -1
  56. package/browser/{chunk-73TUA3JE.js → chunk-TGJ3LPLG.js} +1 -1
  57. package/browser/{chunk-245FSNUP.js → chunk-TML7WQTK.js} +1 -1
  58. package/browser/{chunk-3CMKQDJD.js → chunk-UBMWSFAZ.js} +1 -1
  59. package/browser/{chunk-O6KL6T76.js → chunk-UHZ4KKE5.js} +1 -1
  60. package/browser/{chunk-SC2IRNRE.js → chunk-UK3RUU4S.js} +1 -1
  61. package/browser/chunk-UR4PDGNP.js +6 -0
  62. package/browser/{chunk-2HCJBDRI.js → chunk-VO5LQION.js} +1 -1
  63. package/browser/{chunk-Q3ITJ7SM.js → chunk-W3ORO7W5.js} +1 -1
  64. package/browser/{chunk-KYYUJJ6W.js → chunk-WFLBQLIR.js} +1 -1
  65. package/browser/{chunk-IFHVRSTC.js → chunk-XPBP7UEM.js} +1 -1
  66. package/browser/chunk-XPCRFTEI.js +1 -0
  67. package/browser/{chunk-BCOH5IGB.js → chunk-ZAMAK546.js} +1 -1
  68. package/browser/{chunk-S2DDRVZC.js → chunk-ZHT32KNQ.js} +1 -1
  69. package/browser/index.html +13 -3
  70. package/browser/{main-TMN4EWBV.js → main-6VAJ4HYC.js} +1 -1
  71. package/browser/styles-2FWMUG56.css +1 -0
  72. package/package.json +1 -1
  73. package/browser/chunk-3OWOEY5M.js +0 -1
  74. package/browser/chunk-3XRWFLI7.js +0 -6
  75. package/browser/chunk-56ZJETOZ.js +0 -6
  76. package/browser/chunk-DLM7MUO5.js +0 -1
  77. package/browser/chunk-JQYJDI3L.js +0 -1
  78. package/browser/chunk-LPJG7HDA.js +0 -1
  79. package/browser/chunk-NEIKVLFC.js +0 -1
  80. package/browser/chunk-PMBWUQPI.js +0 -1
  81. package/browser/chunk-QCPXHP56.js +0 -1
  82. package/browser/chunk-QHD6RKEP.js +0 -1
  83. package/browser/chunk-QS5AU6X7.js +0 -1
  84. package/browser/chunk-QV2MVWJJ.js +0 -1
  85. package/browser/chunk-SFK3JOTF.js +0 -1
  86. package/browser/chunk-VURHEL5U.js +0 -1
  87. package/browser/chunk-WLBH76W3.js +0 -1
  88. package/browser/chunk-XEXRIFJE.js +0 -1
  89. package/browser/chunk-XTHD557L.js +0 -1
  90. package/browser/chunk-ZD5EXS3I.js +0 -1
  91. package/browser/styles-UY3RDTVV.css +0 -1
@@ -1 +1 @@
1
- import{a}from"./chunk-WTSDGIW6.js";import"./chunk-3CMKQDJD.js";import"./chunk-CG7JPH7I.js";import"./chunk-BCOH5IGB.js";import"./chunk-MZT6I3S3.js";import"./chunk-N347WQAU.js";import"./chunk-MWPKXBXJ.js";import"./chunk-7EDSHFWH.js";import"./chunk-3ZLLFAXF.js";import"./chunk-Q2M4W42M.js";import"./chunk-DDWYQORF.js";import"./chunk-B46LXCLF.js";import"./chunk-KJ5SIUGY.js";export{a as NamespaceUserGroupsComponent};
1
+ import{a}from"./chunk-5RGU7B74.js";import"./chunk-UBMWSFAZ.js";import"./chunk-TBYJS5N4.js";import"./chunk-ZAMAK546.js";import"./chunk-MZT6I3S3.js";import"./chunk-C2J4TQ7V.js";import"./chunk-MWPKXBXJ.js";import"./chunk-7EDSHFWH.js";import"./chunk-3ZLLFAXF.js";import"./chunk-Q2M4W42M.js";import"./chunk-DDWYQORF.js";import"./chunk-B46LXCLF.js";import"./chunk-KJ5SIUGY.js";export{a as NamespaceUserGroupsComponent};
@@ -1 +1 @@
1
- import{a as h}from"./chunk-7WF5A3H7.js";import{j as b}from"./chunk-BCOH5IGB.js";import{b as u}from"./chunk-3ZLLFAXF.js";import{D as p,P as f,S as m,Z as l,ca as a,m as r,t as c}from"./chunk-KJ5SIUGY.js";var v=class i{userState=a(h);permissions=a(b);currentUser$=u(this.userState.currentUser);cache=new Map;isAdminOfNamespace$(e){if(!e)return r(!1);let t=this.cache.get(e);if(t)return t;let o=this.currentUser$.pipe(m(s=>s?s.isAdmin?r(!0):this.permissions.listNamespaceUsers(e).pipe(c(d=>d.some(n=>n.id===s.id&&n.role==="ADMIN")),p(()=>r(!1))):r(!1)),f({bufferSize:1,refCount:!1}));return this.cache.set(e,o),o}static \u0275fac=function(t){return new(t||i)};static \u0275prov=l({token:i,factory:i.\u0275fac,providedIn:"root"})};export{v as a};
1
+ import{a as h}from"./chunk-DEI4EULW.js";import{j as b}from"./chunk-ZAMAK546.js";import{b as u}from"./chunk-3ZLLFAXF.js";import{D as p,P as f,S as m,Z as l,ca as a,m as r,t as c}from"./chunk-KJ5SIUGY.js";var v=class i{userState=a(h);permissions=a(b);currentUser$=u(this.userState.currentUser);cache=new Map;isAdminOfNamespace$(e){if(!e)return r(!1);let t=this.cache.get(e);if(t)return t;let o=this.currentUser$.pipe(m(s=>s?s.isAdmin?r(!0):this.permissions.listNamespaceUsers(e).pipe(c(d=>d.some(n=>n.id===s.id&&n.role==="ADMIN")),p(()=>r(!1))):r(!1)),f({bufferSize:1,refCount:!1}));return this.cache.set(e,o),o}static \u0275fac=function(t){return new(t||i)};static \u0275prov=l({token:i,factory:i.\u0275fac,providedIn:"root"})};export{v as a};
@@ -0,0 +1 @@
1
+ import{a as P,b as O}from"./chunk-MGVK4WNW.js";import{a as x}from"./chunk-DEI4EULW.js";import{d as S}from"./chunk-DXSUJXKW.js";import{b as C,c as M}from"./chunk-MZT6I3S3.js";import{Db as d,Fb as y,Ka as _,Tb as u,Vb as T,Wa as c,ca as s,lb as b,mb as f,mc as p,rb as v,sb as a,ta as g,tb as l,ub as m}from"./chunk-KJ5SIUGY.js";function N(o,e){if(o&1&&u(0),o&2){let t=y();T(" ",t.userInitials()," ")}}function V(o,e){o&1&&u(0," \u2022\u2022\u2022 ")}var h=class o{router=s(M);userState=s(x);themePort=s(S);namespaceState=s(P);menuOpen=g(!1);isAdmin=p(()=>this.userState.currentUser()?.isAdmin===!0);isDark=p(()=>{let{mode:e}=this.themePort.theme();return e==="dark"?!0:e==="light"?!1:typeof document<"u"&&document.documentElement.getAttribute("data-theme")?.includes("dark")===!0});themeVariant=p(()=>this.themePort.theme().variant);userInitials=p(()=>{let e=this.userState.currentUser();if(!e)return"";let t=e.firstname?.[0]??"",n=e.lastname?.[0]??"";return(t+n).toUpperCase()||e.email?.[0]?.toUpperCase()||""});showTechnical=g(!1);navigateHome(){let e=this.namespaceState.activeNamespaceId();this.router.navigate(["/agentos/home"],e?{queryParams:{ns:e}}:{})}toggleMenu(e){e.stopPropagation(),this.menuOpen.update(t=>!t)}closeMenu(e){e.stopPropagation(),this.menuOpen.set(!1)}onNavigate(e){this.menuOpen.set(!1),this.router.navigate([e])}onThemeToggle(){this.menuOpen.set(!1);let e=this.isDark()?"light":"dark";this.themePort.setTheme({variant:this.themePort.theme().variant,mode:e})}onThemeVariantChanged(e){this.menuOpen.set(!1);let t=this.themePort.theme();this.themePort.setTheme({variant:e,mode:t.mode})}onLogsToggle(){this.menuOpen.set(!1)}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=c({type:o,selectors:[["agentos-shell-topbar"]],decls:10,vars:6,consts:[[1,"shell-topbar"],["type","button","title","Home",1,"shell-topbar__brand",3,"click"],["src","CODAY-Logo.png","alt","Coday",1,"shell-topbar__logo-img"],[1,"shell-topbar__logo-text"],[1,"shell-topbar__user-menu"],["type","button","title","Menu",1,"shell-topbar__user-btn",3,"click"],["variant","topbar",3,"navigateTo","themeToggled","themeVariantChanged","logsToggled","closed","open","isAdmin","isDark","themeVariant","showTechnical"]],template:function(t,n){t&1&&(a(0,"div",0)(1,"button",1),d("click",function(){return n.navigateHome()}),m(2,"img",2),a(3,"span",3),u(4,"Coday"),l()(),a(5,"div",4)(6,"button",5),d("click",function(r){return n.toggleMenu(r)}),b(7,N,1,1)(8,V,1,0),l(),a(9,"agentos-shell-user-menu",6),d("navigateTo",function(r){return n.onNavigate(r)})("themeToggled",function(){return n.onThemeToggle()})("themeVariantChanged",function(r){return n.onThemeVariantChanged(r)})("logsToggled",function(){return n.onLogsToggle()})("closed",function(r){return n.closeMenu(r)}),l()()()),t&2&&(_(7),f(n.userInitials()?7:8),_(2),v("open",n.menuOpen())("isAdmin",n.isAdmin())("isDark",n.isDark())("themeVariant",n.themeVariant())("showTechnical",n.showTechnical()))},dependencies:[O],styles:[".shell-topbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:14px 12px;border-bottom:1px solid var(--color-divider);background:var(--color-bg);flex-shrink:0}.shell-topbar__brand[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:0;border:none;background:transparent;cursor:pointer;transition:opacity .14s ease}.shell-topbar__brand[_ngcontent-%COMP%]:hover{opacity:.8}.shell-topbar__logo-img[_ngcontent-%COMP%]{height:28px;width:auto;object-fit:contain;display:block;flex:none}.shell-topbar__logo-text[_ngcontent-%COMP%]{font-weight:700;font-size:18px;color:var(--color-text);letter-spacing:-.02em;white-space:nowrap}.shell-topbar__user-menu[_ngcontent-%COMP%]{position:relative;flex-shrink:0}.shell-topbar__user-btn[_ngcontent-%COMP%]{width:32px;height:32px;flex:none;display:grid;place-items:center;border:1px solid var(--color-divider);background:var(--color-surface);font-family:var(--font-heading);font-weight:600;font-size:13px;color:var(--color-accent-700);cursor:pointer;transition:border-color .14s;border-radius:0}.shell-topbar__user-btn[_ngcontent-%COMP%]:hover{border-color:var(--color-accent)}"],changeDetection:0})};var k=class o{static \u0275fac=function(t){return new(t||o)};static \u0275cmp=c({type:o,selectors:[["agentos-layout"]],decls:4,vars:0,consts:[[1,"layout"],[1,"layout__content"]],template:function(t,n){t&1&&(a(0,"div",0),m(1,"agentos-shell-topbar"),a(2,"main",1),m(3,"router-outlet"),l()())},dependencies:[C,h],styles:[".layout[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-height:100vh}.layout__content[_ngcontent-%COMP%]{flex:1;overflow-y:auto}"]})};export{k as a};
@@ -1 +1 @@
1
- import{a}from"./chunk-73TUA3JE.js";import"./chunk-WIVM4HFF.js";import"./chunk-7WF5A3H7.js";import"./chunk-BCOH5IGB.js";import"./chunk-MZT6I3S3.js";import"./chunk-3ZLLFAXF.js";import"./chunk-DDWYQORF.js";import"./chunk-KJ5SIUGY.js";export{a as UserFormComponent};
1
+ import{a}from"./chunk-TGJ3LPLG.js";import"./chunk-NA5F32JD.js";import"./chunk-DEI4EULW.js";import"./chunk-ZAMAK546.js";import"./chunk-MZT6I3S3.js";import"./chunk-3ZLLFAXF.js";import"./chunk-DDWYQORF.js";import"./chunk-KJ5SIUGY.js";export{a as UserFormComponent};
@@ -1 +1 @@
1
- import{a as D}from"./chunk-LPJG7HDA.js";import{b as B}from"./chunk-BCOH5IGB.js";import{c as x}from"./chunk-MZT6I3S3.js";import{r as $,y as k}from"./chunk-N347WQAU.js";import"./chunk-MWPKXBXJ.js";import"./chunk-7EDSHFWH.js";import{a as l}from"./chunk-3ZLLFAXF.js";import"./chunk-Q2M4W42M.js";import"./chunk-DDWYQORF.js";import"./chunk-B46LXCLF.js";import{Bb as b,Db as s,Fb as m,Kc as T,Pb as P,S as d,Wa as y,ab as h,ca as r,cc as w,fc as I,ga as C,gc as M,ha as _,i as p,jc as R,lb as v,ma as u,mb as A,rb as g,sb as a,t as c,tb as f}from"./chunk-KJ5SIUGY.js";var S=()=>[];function F(n,t){if(n&1){let e=b();a(0,"agentos-agent-config-item",4),s("deleteRequested",function(o){C(e);let E=m(2);return _(E.deleteConfig(o))}),f()}n&2&&g("config",t)("platformMode",!0)}function L(n,t){if(n&1&&v(0,F,1,2,"agentos-agent-config-item",3),n&2){let e,i=t.$implicit,o=m();A((e=o.resolveConfig(i.id))?0:-1,e)}}var q=class n{router=r(x);destroyRef=r(u);agentConfigController=r(B);refresh$=new p(void 0);configs$=this.refresh$.pipe(d(()=>this.agentConfigController.listPlatformAgentsAgentConfig(!0)));configItems$=this.configs$.pipe(c(t=>t.map(e=>({id:e.id??"",name:e.name,description:e.description}))));configsById=new Map;constructor(){this.configs$.pipe(l(this.destroyRef)).subscribe(t=>{this.configsById=new Map(t.map(e=>[e.id??"",e]))})}goBack(){this.router.navigate(["/agentos","admin"])}openCreateForm(){this.router.navigate(["/agentos","admin","agent-configs","new"])}deleteConfig(t){this.agentConfigController.deleteAgentConfig(t.id??"").pipe(l(this.destroyRef)).subscribe(()=>this.refresh$.next())}resolveConfig(t){return this.configsById.get(t)??null}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=y({type:n,selectors:[["agentos-platform-agent-configs"]],decls:5,vars:6,consts:[["agentConfigItemTpl",""],["title","Platform Agent Configs","emptyMessage","No platform agent configs defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"config","platformMode"],[3,"deleteRequested","config","platformMode"]],template:function(e,i){if(e&1&&(a(0,"ds-entity-list",1),I(1,"async"),s("createRequested",function(){return i.openCreateForm()}),a(2,"ds-icon-button",2),s("action",function(){return i.goBack()}),f()(),h(3,L,1,1,"ng-template",null,0,R)),e&2){let o=P(4);g("items",M(1,3,i.configItems$)??w(5,S))("showCreate",!0)("itemTemplate",o)}},dependencies:[k,D,$,T],styles:[".platform-agent-configs__back[_ngcontent-%COMP%]{background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.platform-agent-configs__back[_ngcontent-%COMP%]:hover{text-decoration:underline}"],changeDetection:0})};export{q as PlatformAgentConfigsComponent};
1
+ import{a as D}from"./chunk-MDC6KYTF.js";import{b as B}from"./chunk-ZAMAK546.js";import{c as x}from"./chunk-MZT6I3S3.js";import{s as $,z as k}from"./chunk-C2J4TQ7V.js";import"./chunk-MWPKXBXJ.js";import"./chunk-7EDSHFWH.js";import{a as l}from"./chunk-3ZLLFAXF.js";import"./chunk-Q2M4W42M.js";import"./chunk-DDWYQORF.js";import"./chunk-B46LXCLF.js";import{Bb as b,Db as s,Fb as m,Kc as T,Pb as P,S as d,Wa as y,ab as h,ca as r,cc as w,fc as I,ga as C,gc as M,ha as _,i as p,jc as R,lb as v,ma as u,mb as A,rb as g,sb as a,t as c,tb as f}from"./chunk-KJ5SIUGY.js";var S=()=>[];function F(n,t){if(n&1){let e=b();a(0,"agentos-agent-config-item",4),s("deleteRequested",function(o){C(e);let E=m(2);return _(E.deleteConfig(o))}),f()}n&2&&g("config",t)("platformMode",!0)}function L(n,t){if(n&1&&v(0,F,1,2,"agentos-agent-config-item",3),n&2){let e,i=t.$implicit,o=m();A((e=o.resolveConfig(i.id))?0:-1,e)}}var q=class n{router=r(x);destroyRef=r(u);agentConfigController=r(B);refresh$=new p(void 0);configs$=this.refresh$.pipe(d(()=>this.agentConfigController.listPlatformAgentsAgentConfig(!0)));configItems$=this.configs$.pipe(c(t=>t.map(e=>({id:e.id??"",name:e.name,description:e.description}))));configsById=new Map;constructor(){this.configs$.pipe(l(this.destroyRef)).subscribe(t=>{this.configsById=new Map(t.map(e=>[e.id??"",e]))})}goBack(){this.router.navigate(["/agentos","admin"])}openCreateForm(){this.router.navigate(["/agentos","admin","agent-configs","new"])}deleteConfig(t){this.agentConfigController.deleteAgentConfig(t.id??"").pipe(l(this.destroyRef)).subscribe(()=>this.refresh$.next())}resolveConfig(t){return this.configsById.get(t)??null}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=y({type:n,selectors:[["agentos-platform-agent-configs"]],decls:5,vars:6,consts:[["agentConfigItemTpl",""],["title","Platform Agent Configs","emptyMessage","No platform agent configs defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"config","platformMode"],[3,"deleteRequested","config","platformMode"]],template:function(e,i){if(e&1&&(a(0,"ds-entity-list",1),I(1,"async"),s("createRequested",function(){return i.openCreateForm()}),a(2,"ds-icon-button",2),s("action",function(){return i.goBack()}),f()(),h(3,L,1,1,"ng-template",null,0,R)),e&2){let o=P(4);g("items",M(1,3,i.configItems$)??w(5,S))("showCreate",!0)("itemTemplate",o)}},dependencies:[k,D,$,T],styles:[".platform-agent-configs__back[_ngcontent-%COMP%]{background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.platform-agent-configs__back[_ngcontent-%COMP%]:hover{text-decoration:underline}"],changeDetection:0})};export{q as PlatformAgentConfigsComponent};
@@ -0,0 +1 @@
1
+ import{a as U,b as F}from"./chunk-XPCRFTEI.js";import{i as B}from"./chunk-ZAMAK546.js";import{c as $}from"./chunk-MZT6I3S3.js";import{s as j,z}from"./chunk-C2J4TQ7V.js";import{a as q}from"./chunk-3ZLLFAXF.js";import{Bb as f,Db as d,Fb as r,Ka as P,Kc as H,Pb as A,S as T,Tb as _,Wa as y,ab as D,ca as v,cc as M,fc as L,ga as c,gc as E,ha as m,i as V,ia as u,ja as C,jc as G,lb as w,ma as S,mb as k,pc as l,qc as O,rb as h,sb as a,t as I,ta as x,tb as s,ub as g,yb as R,zb as b}from"./chunk-KJ5SIUGY.js";var Q=()=>[];function X(p,n){if(p&1){let e=f();R(0,1),a(1,"span",2),_(2,"Delete?"),s(),a(3,"ds-icon-button",3),d("action",function(){c(e);let t=r();return m(t.onDeleteConfirmed())}),s(),a(4,"ds-icon-button",4),d("action",function(){c(e);let t=r();return m(t.onDeleteCancelled())}),s(),b()}}function Y(p,n){if(p&1){let e=f();R(0,1),a(1,"button",5),d("click",function(){c(e);let t=r();return m(t.onIntegrations())}),u(),a(2,"svg",6),g(3,"path",7)(4,"path",8),s(),_(5," Integrations "),s(),C(),a(6,"button",5),d("click",function(){c(e);let t=r();return m(t.onAiProviders())}),u(),a(7,"svg",6),g(8,"rect",9)(9,"rect",10)(10,"path",11),s(),_(11," AI Providers "),s(),C(),a(12,"button",5),d("click",function(){c(e);let t=r();return m(t.onAiModels())}),u(),a(13,"svg",6),g(14,"path",12),s(),_(15," AI Models "),s(),C(),a(16,"button",5),d("click",function(){c(e);let t=r();return m(t.onAgentConfigs())}),u(),a(17,"svg",6),g(18,"path",13)(19,"circle",14)(20,"circle",15),s(),_(21," Agent Configs "),s(),C(),a(22,"button",5),d("click",function(){c(e);let t=r();return m(t.onPrompts())}),u(),a(23,"svg",6),g(24,"path",16)(25,"path",17)(26,"path",18),s(),_(27," Prompts "),s(),C(),a(28,"button",5),d("click",function(){c(e);let t=r();return m(t.onUserGroups())}),u(),a(29,"svg",6),g(30,"circle",19)(31,"path",20)(32,"path",21),s(),_(33," User Groups "),s(),b()}}var N=class p{namespace=O.required();selected=l();editRequested=l();integrationsRequested=l();aiProvidersRequested=l();aiModelsRequested=l();agentConfigsRequested=l();promptsRequested=l();userGroupsRequested=l();deleteRequested=l();pendingDelete=x(!1);menuItems=[{key:"edit",label:"Edit namespace"},{key:"separator",label:"",variant:"separator"},{key:"delete",label:"Delete namespace",variant:"danger"}];onSelect(){this.selected.emit(this.namespace())}onIntegrations(){this.integrationsRequested.emit(this.namespace())}onAiProviders(){this.aiProvidersRequested.emit(this.namespace())}onAiModels(){this.aiModelsRequested.emit(this.namespace())}onAgentConfigs(){this.agentConfigsRequested.emit(this.namespace())}onPrompts(){this.promptsRequested.emit(this.namespace())}onUserGroups(){this.userGroupsRequested.emit(this.namespace())}onMenuAction(n){switch(n){case"edit":this.editRequested.emit(this.namespace());break;case"delete":this.pendingDelete.set(!0);break}}onDeleteConfirmed(){this.pendingDelete.set(!1),this.deleteRequested.emit(this.namespace())}onDeleteCancelled(){this.pendingDelete.set(!1)}static \u0275fac=function(e){return new(e||p)};static \u0275cmp=y({type:p,selectors:[["agentos-namespace-item"]],inputs:{namespace:[1,"namespace"]},outputs:{selected:"selected",editRequested:"editRequested",integrationsRequested:"integrationsRequested",aiProvidersRequested:"aiProvidersRequested",aiModelsRequested:"aiModelsRequested",agentConfigsRequested:"agentConfigsRequested",promptsRequested:"promptsRequested",userGroupsRequested:"userGroupsRequested",deleteRequested:"deleteRequested"},decls:3,vars:4,consts:[[3,"nameClicked","menuAction","name","menuItems"],["agentosCardChips",""],[1,"ns-confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel",3,"action"],["type","button",1,"ac-chip",3,"click"],["width","13","height","13","viewBox","0 0 24 24","fill","none","aria-hidden","true"],["d","M8 2v4M16 2v4M6 8h12v3a6 6 0 01-12 0V8z","stroke","currentColor","stroke-width","1.6","stroke-linecap","round","stroke-linejoin","round"],["d","M12 17v3","stroke","currentColor","stroke-width","1.6","stroke-linecap","round"],["x","7","y","7","width","10","height","10","rx","1.5","stroke","currentColor","stroke-width","1.6"],["x","10","y","10","width","4","height","4","rx","0.5","stroke","currentColor","stroke-width","1.4"],["d","M9 2v3M12 2v3M15 2v3M9 19v3M12 19v3M15 19v3M2 9h3M2 12h3M2 15h3M19 9h3M19 12h3M19 15h3","stroke","currentColor","stroke-width","1.4","stroke-linecap","round"],["d","M12 3l1.8 5.6L19 10l-5.2 1.6L12 17l-1.8-5.4L5 10l5.2-1.4L12 3z","stroke","currentColor","stroke-width","1.5","stroke-linejoin","round"],["d","M4 7h9M17 7h3M4 17h3M11 17h9","stroke","currentColor","stroke-width","1.6","stroke-linecap","round"],["cx","13","cy","7","r","2.2","stroke","currentColor","stroke-width","1.6"],["cx","8","cy","17","r","2.2","stroke","currentColor","stroke-width","1.6"],["d","M7 3h7l4 4v14a1 1 0 01-1 1H7a1 1 0 01-1-1V4a1 1 0 011-1z","stroke","currentColor","stroke-width","1.6","stroke-linejoin","round"],["d","M14 3v4h4","stroke","currentColor","stroke-width","1.6","stroke-linejoin","round"],["d","M9 13h6M9 17h6","stroke","currentColor","stroke-width","1.4","stroke-linecap","round"],["cx","9","cy","8","r","3","stroke","currentColor","stroke-width","1.6"],["d","M3 20a6 6 0 0112 0","stroke","currentColor","stroke-width","1.6","stroke-linecap","round"],["d","M16 5.5a3 3 0 010 5.5M18 20a6 6 0 00-3-5.2","stroke","currentColor","stroke-width","1.5","stroke-linecap","round"]],template:function(e,i){e&1&&(a(0,"agentos-action-card",0),d("nameClicked",function(){return i.onSelect()})("menuAction",function(o){return i.onMenuAction(o)}),w(1,X,5,0,"ng-container",1)(2,Y,34,0,"ng-container",1),s()),e&2&&(h("name",i.namespace().name)("menuItems",i.pendingDelete()?M(3,Q):i.menuItems),P(),k(i.pendingDelete()?1:2))},dependencies:[F,U,j],styles:[".ns-confirm-label[_ngcontent-%COMP%]{font:500 12px Inter,sans-serif;color:var(--color-error, #a5140a);white-space:nowrap;align-self:center}"],changeDetection:0})};var Z=()=>[];function ee(p,n){if(p&1){let e=f();a(0,"agentos-namespace-item",3),d("selected",function(t){c(e);let o=r(2);return m(o.navigateToHome(t.id??""))})("editRequested",function(t){c(e);let o=r(2);return m(o.navigateToEdit(t))})("deleteRequested",function(t){c(e);let o=r(2);return m(o.deleteNamespace(t))})("integrationsRequested",function(t){c(e);let o=r(2);return m(o.openIntegrations(t))})("aiProvidersRequested",function(t){c(e);let o=r(2);return m(o.openAiProviders(t))})("aiModelsRequested",function(t){c(e);let o=r(2);return m(o.openAiModels(t))})("agentConfigsRequested",function(t){c(e);let o=r(2);return m(o.openAgentConfigs(t))})("promptsRequested",function(t){c(e);let o=r(2);return m(o.openPrompts(t))})("userGroupsRequested",function(t){c(e);let o=r(2);return m(o.openUserGroups(t))}),s()}p&2&&h("namespace",n)}function te(p,n){if(p&1&&w(0,ee,1,1,"agentos-namespace-item",2),p&2){let e,i=n.$implicit,t=r();k((e=t.namespacesById().get(i.id))?0:-1,e)}}var W=class p{router=v($);namespaceController=v(B);destroyRef=v(S);refresh$=new V(void 0);namespaces$=this.refresh$.pipe(T(()=>this.namespaceController.listAllNamespace()));namespaceItems$=this.namespaces$.pipe(I(n=>n.map(e=>({id:e.id??"",name:e.name,description:e.description,badges:e.defaultAgentName?[{label:e.defaultAgentName,variant:"info"}]:void 0}))));namespacesById=x(new Map);constructor(){this.namespaces$.pipe(q(this.destroyRef)).subscribe(n=>{this.namespacesById.set(new Map(n.map(e=>[e.id??"",e])))})}navigateToHome(n){this.router.navigate(["/agentos/home"],{queryParams:{ns:n}})}navigateToCreate(){this.router.navigate(["/agentos/namespaces/new"])}navigateToEdit(n){this.router.navigate(["/agentos/namespaces",n.id??"","edit"])}openIntegrations(n){this.router.navigate(["/agentos",n.id,"integrations"])}openAiProviders(n){this.router.navigate(["/agentos",n.id,"ai-providers"])}openAiModels(n){this.router.navigate(["/agentos",n.id,"ai-models"])}openAgentConfigs(n){this.router.navigate(["/agentos",n.id,"agent-configs"])}openPrompts(n){this.router.navigate(["/agentos",n.id,"prompts"])}openUserGroups(n){this.router.navigate(["/agentos",n.id,"user-groups"])}deleteNamespace(n){this.namespaceController.deleteNamespace(n.id??"").pipe(q(this.destroyRef)).subscribe(()=>this.refresh$.next())}static \u0275fac=function(e){return new(e||p)};static \u0275cmp=y({type:p,selectors:[["agentos-namespace-list"]],decls:4,vars:6,consts:[["namespaceItemTpl",""],["title","Namespaces","emptyMessage","No namespaces yet. Create one to get started.","cardMinWidth","400px",3,"itemSelected","createRequested","items","showCreate","itemTemplate"],[3,"namespace"],[3,"selected","editRequested","deleteRequested","integrationsRequested","aiProvidersRequested","aiModelsRequested","agentConfigsRequested","promptsRequested","userGroupsRequested","namespace"]],template:function(e,i){if(e&1&&(a(0,"ds-entity-list",1),L(1,"async"),d("itemSelected",function(o){return i.navigateToHome(o)})("createRequested",function(){return i.navigateToCreate()}),s(),D(2,te,1,1,"ng-template",null,0,G)),e&2){let t=A(3);h("items",E(1,3,i.namespaceItems$)??M(5,Z))("showCreate",!0)("itemTemplate",t)}},dependencies:[N,z,H],styles:["[_nghost-%COMP%] .ac, [_nghost-%COMP%] .ac--clickable{background:var(--color-bg);border:1px solid var(--color-divider);box-shadow:none}[_nghost-%COMP%] .ac:hover, [_nghost-%COMP%] .ac--clickable:hover{border-color:var(--color-accent);box-shadow:none}[_nghost-%COMP%] .ac__mark{width:28px;height:28px;border-radius:0;background:var(--color-accent-900);color:var(--color-accent-100);font-family:var(--font-heading);font-weight:600;font-size:13px}[_nghost-%COMP%] .ac__name{font-family:var(--font-heading);font-weight:600;font-size:16.5px;line-height:1.15;overflow-wrap:anywhere;color:var(--color-text)}[_nghost-%COMP%] .ac__chips{gap:6px;padding:0 16px 16px}[_nghost-%COMP%] .ac-chip{border:1px solid var(--color-divider);color:var(--color-neutral-600);background:transparent;font-family:var(--font-heading);font-weight:600;font-size:11px;letter-spacing:.08em;text-transform:uppercase}[_nghost-%COMP%] .ac-chip:hover{background:var(--color-accent-100);border-color:var(--color-accent-300);color:var(--color-accent-700)}"],changeDetection:0})};export{N as a,W as b};
@@ -1 +1 @@
1
- import{c as z,d as B}from"./chunk-BCOH5IGB.js";import{a as D,c as L}from"./chunk-MZT6I3S3.js";import{a as y,c as R}from"./chunk-3ZLLFAXF.js";import{A as Y,B as Z,F as ee,c as G,e as g,g as $,h as q,i as j,l as s,n as U,o as H,s as J,w as K,x as Q,y as W,z as X}from"./chunk-DDWYQORF.js";import{Bb as w,D as k,Db as _,Fb as p,Ka as a,Tb as r,Ub as N,Vb as V,Wa as A,Wb as T,a as x,b as M,ca as c,ga as v,ha as b,kb as I,lb as C,m as P,ma as S,mb as h,mc as F,pb as E,qb as O,rb as l,sb as i,ta as u,tb as o,ub as m}from"./chunk-KJ5SIUGY.js";function te(n,t){n&1&&(i(0,"p",5),r(1,"Loading\u2026"),o())}function ie(n,t){if(n&1&&m(0,"input",11),n&2){let e=p(2);l("value",e.selectedProviderLabel())}}function re(n,t){if(n&1&&(i(0,"option",30),r(1),o()),n&2){let e=t.$implicit;l("value",e.id),a(),T("",e.name," (",e.apiType,")")}}function ne(n,t){if(n&1&&(i(0,"select",12)(1,"option",29),r(2,"Select provider"),o(),E(3,re,2,3,"option",30,I().trackByProvider,!0),o()),n&2){let e=p(2);l("formControl",e.aiProviderIdControl),a(3),O(e.providers())}}function ae(n,t){if(n&1){let e=w();i(0,"form",7),_("ngSubmit",function(){v(e);let f=p();return b(f.submit())}),i(1,"div",8)(2,"label",9),r(3," Provider "),i(4,"span",10),r(5,"*"),o()(),C(6,ie,1,1,"input",11)(7,ne,5,1,"select",12),o(),i(8,"div",8)(9,"label",13),r(10," API name "),i(11,"span",10),r(12,"*"),o()(),m(13,"input",14),o(),i(14,"div",8)(15,"label",15),r(16,"Description"),o(),m(17,"input",16),o(),i(18,"div",8)(19,"label",17),r(20,"Alias"),o(),m(21,"input",18),o(),i(22,"div",8)(23,"label",19),r(24,"Priority"),o(),m(25,"input",20),o(),i(26,"div",21)(27,"div",8)(28,"label",22),r(29,"Temperature"),o(),m(30,"input",23),o(),i(31,"div",8)(32,"label",24),r(33,"Max tokens"),o(),m(34,"input",25),o()(),i(35,"div",26)(36,"button",27),r(37),o(),i(38,"button",28),_("click",function(){v(e);let f=p();return b(f.cancel())}),r(39,"Cancel"),o()()()}if(n&2){let e=p();l("formGroup",e.form),a(6),h(e.isEditMode()?6:7),a(7),l("formControl",e.apiModelNameControl),a(4),l("formControl",e.descriptionControl),a(4),l("formControl",e.aliasControl),a(4),l("formControl",e.priorityControl),a(5),l("formControl",e.temperatureControl),a(4),l("formControl",e.maxTokensControl),a(2),l("disabled",e.form.invalid||e.isSubmitting()),a(),V(" ",e.isEditMode()?"Save changes":"Create"," ")}}var oe=class n{route=c(D);router=c(L);destroyRef=c(S);aiModelController=c(z);aiProviderController=c(B);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;providers=R(this.aiProviderController.listAiProvider(this.isPlatformMode?"none":this.namespaceId).pipe(k(()=>P([]))),{initialValue:[]});form=new j({aiProviderId:new s("",{nonNullable:!0,validators:[g.required]}),apiModelName:new s("",{nonNullable:!0,validators:[g.required,g.minLength(1)]}),description:new s(null),alias:new s("",{nonNullable:!0}),priority:new s(0,{nonNullable:!0}),temperature:new s(null),maxTokens:new s(null)});get aiProviderIdControl(){return this.form.controls.aiProviderId}get apiModelNameControl(){return this.form.controls.apiModelName}get descriptionControl(){return this.form.controls.description}get aliasControl(){return this.form.controls.alias}get priorityControl(){return this.form.controls.priority}get temperatureControl(){return this.form.controls.temperature}get maxTokensControl(){return this.form.controls.maxTokens}isEditMode=u(!1);isSubmitting=u(!1);isLoading=u(!1);selectedProviderLabel=F(()=>{let t=this.aiProviderIdControl.value,e=this.providers().find(d=>d.id===t);return e?`${e.name} (${e.apiType})`:t});existingModel=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("modelId");t&&(this.isEditMode.set(!0),this.loadModel(t))}loadModel(t){this.isLoading.set(!0),this.aiModelController.getByIdAiModel(t).pipe(y(this.destroyRef)).subscribe({next:e=>{this.existingModel=e,this.aiProviderIdControl.setValue(e.aiProviderId),this.aiProviderIdControl.disable(),this.apiModelNameControl.setValue(e.apiModelName),this.descriptionControl.setValue(e.description??null),this.aliasControl.setValue(e.alias??""),this.priorityControl.setValue(e.priority??0),this.temperatureControl.setValue(e.temperature??null),this.maxTokensControl.setValue(e.maxTokens??null),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),this.navigateBack()}})}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(!0);let t=this.form.getRawValue(),e=M(x({},this.existingModel??{}),{aiProviderId:t.aiProviderId,namespaceId:this.isPlatformMode?void 0:this.existingModel?.namespaceId??this.namespaceId,apiModelName:t.apiModelName.trim(),description:t.description?.trim()||void 0,alias:t.alias.trim()||void 0,priority:t.priority,temperature:t.temperature??void 0,maxTokens:t.maxTokens??void 0});(this.isEditMode()?this.aiModelController.updateAiModel(this.existingModel.id??"",e):this.aiModelController.createAiModel(e)).pipe(y(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(!1)})}cancel(){this.navigateBack()}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-models"]):this.router.navigate(["/agentos",this.namespaceId,"ai-models"])}trackByProvider(t,e){return e.id??""}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=A({type:n,selectors:[["agentos-ai-model-form"]],decls:10,vars:2,consts:[[1,"ai-model-form"],[1,"ai-model-form__header"],["type","button","title","Back to AI models",1,"ai-model-form__back",3,"click"],[1,"ai-model-form__back-icon"],[1,"ai-model-form__title"],[1,"ai-model-form__loading"],[1,"ai-model-form__form",3,"formGroup"],[1,"ai-model-form__form",3,"ngSubmit","formGroup"],[1,"ai-model-form__field"],["for","model-provider",1,"ai-model-form__label"],["aria-hidden","true"],["id","model-provider","type","text","readonly","","tabindex","-1",1,"ai-model-form__input","ai-model-form__input--readonly",3,"value"],["id","model-provider",1,"ai-model-form__select",3,"formControl"],["for","model-api-name",1,"ai-model-form__label"],["id","model-api-name","type","text","placeholder","e.g. gpt-4o, claude-3-5-sonnet-20241022","autocomplete","off",1,"ai-model-form__input","ai-model-form__input--mono",3,"formControl"],["for","model-description",1,"ai-model-form__label"],["id","model-description","type","text","placeholder","Optional \u2014 short description of this model config","autocomplete","off",1,"ai-model-form__input",3,"formControl"],["for","model-alias",1,"ai-model-form__label"],["id","model-alias","type","text","placeholder","e.g. fast, smart \u2014 short identifier used internally","autocomplete","off",1,"ai-model-form__input",3,"formControl"],["for","model-priority",1,"ai-model-form__label"],["id","model-priority","type","number","placeholder","0 \u2014 higher wins when multiple configs share the same alias","min","0","step","1",1,"ai-model-form__input",3,"formControl"],[1,"ai-model-form__row"],["for","model-temperature",1,"ai-model-form__label"],["id","model-temperature","type","number","placeholder","0 \u2013 2","min","0","max","2","step","0.1",1,"ai-model-form__input",3,"formControl"],["for","model-max-tokens",1,"ai-model-form__label"],["id","model-max-tokens","type","number","placeholder","e.g. 4096","min","1","step","1",1,"ai-model-form__input",3,"formControl"],[1,"ai-model-form__actions"],["type","submit",1,"ai-model-form__btn","ai-model-form__btn--primary",3,"disabled"],["type","button",1,"ai-model-form__btn",3,"click"],["value","","disabled",""],[3,"value"]],template:function(e,d){e&1&&(i(0,"div",0)(1,"header",1)(2,"button",2),_("click",function(){return d.cancel()}),i(3,"span",3),r(4,"\u2190"),o(),r(5," AI models "),o(),i(6,"h1",4),r(7),o()(),C(8,te,2,0,"p",5)(9,ae,40,10,"form",6),o()),e&2&&(a(7),N(d.isEditMode()?"Edit AI model":"New AI model"),a(),h(d.isLoading()?8:9))},dependencies:[ee,U,W,X,G,H,Q,$,q,Z,Y,J,K],styles:[".ai-model-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:480px;margin:0 auto;padding:2rem 1rem}.ai-model-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.ai-model-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.ai-model-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.ai-model-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.ai-model-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.ai-model-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.ai-model-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.ai-model-form__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.ai-model-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.ai-model-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.ai-model-form__input[_ngcontent-%COMP%], .ai-model-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.ai-model-form__input[_ngcontent-%COMP%]:focus, .ai-model-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.ai-model-form__input[_ngcontent-%COMP%]::placeholder, .ai-model-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.ai-model-form__input--mono[_ngcontent-%COMP%]{font-family:monospace}.ai-model-form__input--readonly[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);cursor:default;background:var(--color-surface-muted, rgba(0, 0, 0, .03))}.ai-model-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.ai-model-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.ai-model-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.ai-model-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.ai-model-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.ai-model-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};export{oe as AiModelFormComponent};
1
+ import{c as z,d as B}from"./chunk-ZAMAK546.js";import{a as D,c as L}from"./chunk-MZT6I3S3.js";import{a as x,c as R}from"./chunk-3ZLLFAXF.js";import{A as Y,B as Z,F as ee,c as G,e as g,g as $,h as q,i as j,l as s,n as U,o as H,s as J,w as K,x as Q,y as W,z as X}from"./chunk-DDWYQORF.js";import{Bb as w,D as k,Db as _,Fb as p,Ka as a,Tb as r,Ub as N,Vb as V,Wa as A,Wb as T,a as y,b as M,ca as c,ga as v,ha as b,kb as I,lb as C,m as P,ma as S,mb as h,mc as F,pb as E,qb as O,rb as l,sb as i,ta as f,tb as o,ub as m}from"./chunk-KJ5SIUGY.js";function te(n,t){n&1&&(i(0,"p",5),r(1,"Loading\u2026"),o())}function ie(n,t){if(n&1&&m(0,"input",11),n&2){let e=p(2);l("value",e.selectedProviderLabel())}}function re(n,t){if(n&1&&(i(0,"option",30),r(1),o()),n&2){let e=t.$implicit;l("value",e.id),a(),T("",e.name," (",e.apiType,")")}}function ne(n,t){if(n&1&&(i(0,"select",12)(1,"option",29),r(2,"Select provider"),o(),E(3,re,2,3,"option",30,I().trackByProvider,!0),o()),n&2){let e=p(2);l("formControl",e.aiProviderIdControl),a(3),O(e.providers())}}function ae(n,t){if(n&1){let e=w();i(0,"form",7),_("ngSubmit",function(){v(e);let u=p();return b(u.submit())}),i(1,"div",8)(2,"label",9),r(3," Provider "),i(4,"span",10),r(5,"*"),o()(),C(6,ie,1,1,"input",11)(7,ne,5,1,"select",12),o(),i(8,"div",8)(9,"label",13),r(10," API name "),i(11,"span",10),r(12,"*"),o()(),m(13,"input",14),o(),i(14,"div",8)(15,"label",15),r(16,"Description"),o(),m(17,"input",16),o(),i(18,"div",8)(19,"label",17),r(20,"Alias"),o(),m(21,"input",18),o(),i(22,"div",8)(23,"label",19),r(24,"Priority"),o(),m(25,"input",20),o(),i(26,"div",21)(27,"div",8)(28,"label",22),r(29,"Temperature"),o(),m(30,"input",23),o(),i(31,"div",8)(32,"label",24),r(33,"Max tokens"),o(),m(34,"input",25),o()(),i(35,"div",26)(36,"button",27),r(37),o(),i(38,"button",28),_("click",function(){v(e);let u=p();return b(u.cancel())}),r(39,"Cancel"),o()()()}if(n&2){let e=p();l("formGroup",e.form),a(6),h(e.isEditMode()?6:7),a(7),l("formControl",e.apiModelNameControl),a(4),l("formControl",e.descriptionControl),a(4),l("formControl",e.aliasControl),a(4),l("formControl",e.priorityControl),a(5),l("formControl",e.temperatureControl),a(4),l("formControl",e.maxTokensControl),a(2),l("disabled",e.form.invalid||e.isSubmitting()),a(),V(" ",e.isEditMode()?"Save changes":"Create"," ")}}var oe=class n{route=c(D);router=c(L);destroyRef=c(S);aiModelController=c(z);aiProviderController=c(B);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=this.namespaceId===void 0;providers=R(this.aiProviderController.listAiProvider(this.isPlatformMode?"none":this.namespaceId).pipe(k(()=>P([]))),{initialValue:[]});form=new j({aiProviderId:new s("",{nonNullable:!0,validators:[g.required]}),apiModelName:new s("",{nonNullable:!0,validators:[g.required,g.minLength(1)]}),description:new s(null),alias:new s("",{nonNullable:!0}),priority:new s(0,{nonNullable:!0}),temperature:new s(null),maxTokens:new s(null)});get aiProviderIdControl(){return this.form.controls.aiProviderId}get apiModelNameControl(){return this.form.controls.apiModelName}get descriptionControl(){return this.form.controls.description}get aliasControl(){return this.form.controls.alias}get priorityControl(){return this.form.controls.priority}get temperatureControl(){return this.form.controls.temperature}get maxTokensControl(){return this.form.controls.maxTokens}isEditMode=f(!1);isSubmitting=f(!1);isLoading=f(!1);selectedProviderLabel=F(()=>{let t=this.aiProviderIdControl.value,e=this.providers().find(d=>d.id===t);return e?`${e.name} (${e.apiType})`:t});existingModel=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("modelId");t&&(this.isEditMode.set(!0),this.loadModel(t))}loadModel(t){this.isLoading.set(!0),this.aiModelController.getByIdAiModel(t).pipe(x(this.destroyRef)).subscribe({next:e=>{this.existingModel=e,this.aiProviderIdControl.setValue(e.aiProviderId),this.aiProviderIdControl.disable(),this.apiModelNameControl.setValue(e.apiModelName),this.descriptionControl.setValue(e.description??null),this.aliasControl.setValue(e.alias??""),this.priorityControl.setValue(e.priority??0),this.temperatureControl.setValue(e.temperature??null),this.maxTokensControl.setValue(e.maxTokens??null),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),this.navigateBack()}})}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(!0);let t=this.form.getRawValue(),e=M(y({},this.existingModel??{}),{aiProviderId:t.aiProviderId,namespaceId:this.isPlatformMode?void 0:this.existingModel?.namespaceId??this.namespaceId,apiModelName:t.apiModelName.trim(),description:t.description?.trim()||void 0,alias:t.alias.trim()||void 0,priority:t.priority,temperature:t.temperature??void 0,maxTokens:t.maxTokens??void 0});(this.isEditMode()?this.aiModelController.updateAiModel(this.existingModel.id??"",e):this.aiModelController.createAiModel(e)).pipe(x(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(!1)})}cancel(){this.navigateBack()}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","ai-models"]):this.router.navigate(["/agentos",this.namespaceId,"ai-models"])}trackByProvider(t,e){return e.id??""}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=A({type:n,selectors:[["agentos-ai-model-form"]],decls:10,vars:2,consts:[[1,"ai-model-form"],[1,"ai-model-form__header"],["type","button","title","Back to AI models",1,"ai-model-form__back",3,"click"],[1,"ai-model-form__back-icon"],[1,"ai-model-form__title"],[1,"ai-model-form__loading"],[1,"ai-model-form__form",3,"formGroup"],[1,"ai-model-form__form",3,"ngSubmit","formGroup"],[1,"ai-model-form__field"],["for","model-provider",1,"ai-model-form__label"],["aria-hidden","true"],["id","model-provider","type","text","readonly","","tabindex","-1",1,"ai-model-form__input","ai-model-form__input--readonly",3,"value"],["id","model-provider",1,"ai-model-form__select",3,"formControl"],["for","model-api-name",1,"ai-model-form__label"],["id","model-api-name","type","text","placeholder","e.g. gpt-4o, claude-3-5-sonnet-20241022","autocomplete","off",1,"ai-model-form__input","ai-model-form__input--mono",3,"formControl"],["for","model-description",1,"ai-model-form__label"],["id","model-description","type","text","placeholder","Optional \u2014 short description of this model config","autocomplete","off",1,"ai-model-form__input",3,"formControl"],["for","model-alias",1,"ai-model-form__label"],["id","model-alias","type","text","placeholder","e.g. fast, smart \u2014 short identifier used internally","autocomplete","off",1,"ai-model-form__input",3,"formControl"],["for","model-priority",1,"ai-model-form__label"],["id","model-priority","type","number","placeholder","0 \u2014 higher wins when multiple configs share the same alias","min","0","step","1",1,"ai-model-form__input",3,"formControl"],[1,"ai-model-form__row"],["for","model-temperature",1,"ai-model-form__label"],["id","model-temperature","type","number","placeholder","0 \u2013 2","min","0","max","2","step","0.1",1,"ai-model-form__input",3,"formControl"],["for","model-max-tokens",1,"ai-model-form__label"],["id","model-max-tokens","type","number","placeholder","e.g. 4096","min","1","step","1",1,"ai-model-form__input",3,"formControl"],[1,"ai-model-form__actions"],["type","submit",1,"ai-model-form__btn","ai-model-form__btn--primary",3,"disabled"],["type","button",1,"ai-model-form__btn",3,"click"],["value","","disabled",""],[3,"value"]],template:function(e,d){e&1&&(i(0,"div",0)(1,"header",1)(2,"button",2),_("click",function(){return d.cancel()}),i(3,"span",3),r(4,"\u2190"),o(),r(5," AI models "),o(),i(6,"h1",4),r(7),o()(),C(8,te,2,0,"p",5)(9,ae,40,10,"form",6),o()),e&2&&(a(7),N(d.isEditMode()?"Edit AI model":"New AI model"),a(),h(d.isLoading()?8:9))},dependencies:[ee,U,W,X,G,H,Q,$,q,Z,Y,J,K],styles:[".ai-model-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:480px;margin:0 auto;padding:2rem 1rem}.ai-model-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.ai-model-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.ai-model-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.ai-model-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.ai-model-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.ai-model-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.ai-model-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.ai-model-form__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.ai-model-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.ai-model-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.ai-model-form__input[_ngcontent-%COMP%], .ai-model-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.ai-model-form__input[_ngcontent-%COMP%]:focus, .ai-model-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.ai-model-form__input[_ngcontent-%COMP%]::placeholder, .ai-model-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.ai-model-form__input--mono[_ngcontent-%COMP%]{font-family:monospace}.ai-model-form__input--readonly[_ngcontent-%COMP%]{color:var(--color-text-secondary);cursor:default;background:var(--color-surface-muted, rgba(0, 0, 0, .03))}.ai-model-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.ai-model-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.ai-model-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.ai-model-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.ai-model-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.ai-model-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}"],changeDetection:0})};export{oe as AiModelFormComponent};
@@ -0,0 +1 @@
1
+ import{a as J,c as Q}from"./chunk-UBMWSFAZ.js";import{a as H}from"./chunk-NA5F32JD.js";import{i as G,j as V}from"./chunk-ZAMAK546.js";import{a as q,c as I}from"./chunk-MZT6I3S3.js";import{A as W,o as j,s as K,z as $}from"./chunk-C2J4TQ7V.js";import{a as T,b as F,c as z}from"./chunk-3ZLLFAXF.js";import{Bb as C,D as P,Db as m,Fb as l,Ka as d,Pb as O,Rb as D,S as R,Tb as u,Ub as A,Wa as v,ab as E,ca as c,ga as g,ha as _,jb as N,jc as L,lb as b,m as S,ma as w,mb as f,mc as U,pc as x,qc as h,rb as p,sb as o,t as B,ta as y,tb as r}from"./chunk-KJ5SIUGY.js";function ee(s,t){if(s&1&&(o(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=v({type:s,selectors:[["agentos-user-item"]],inputs:{user:[1,"user"]},outputs:{editRequested:"editRequested",deleteRequested:"deleteRequested"},decls:7,vars:3,consts:[["role","listitem","dsBlueprint","",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&&(o(0,"div",0)(1,"div",1)(2,"span",2),u(3),r(),b(4,ee,2,1,"span",3),r(),o(5,"div",4)(6,"ds-kebab-menu",5),m("itemSelected",function(a){return n.onMenuAction(a)}),r()()()),e&2&&(d(3),A(n.displayName),d(),f(n.subtitle?4:-1),d(2),p("items",n.menuItems))},dependencies:[j,W],styles:[".user-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;width:100%;padding:14px 16px;position:relative;border-radius:0;border:1px solid var(--color-divider);background:var(--color-bg);box-shadow:var(--shadow-sm);box-sizing:border-box;overflow:visible;transition:border-color .15s ease}.user-item[_ngcontent-%COMP%]:hover{border-color:var(--color-accent)}.user-item__body[_ngcontent-%COMP%]{flex:1;min-width:0;display:flex;flex-direction:column;gap:.25rem}.user-item__name[_ngcontent-%COMP%]{font-size:15px;font-weight:600;color:var(--color-text);line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-item__subtitle[_ngcontent-%COMP%]{font-size:13px;color:var(--color-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-item__actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem;flex-shrink:0;opacity:0;transition:opacity .15s ease}.user-item[_ngcontent-%COMP%]:hover .user-item__actions[_ngcontent-%COMP%], .user-item[_ngcontent-%COMP%]:focus-within .user-item__actions[_ngcontent-%COMP%]{opacity:1}"],changeDetection:0})};function te(s,t){if(s&1){let e=C();o(0,"agentos-namespace-select",4),m("valueChange",function(i){g(e);let a=l();return _(a.onNamespaceChange(i))}),r()}if(s&2){let e=l();p("namespaces",t)("value",e.selectedNamespaceId())("includeAllOption",!0)}}function ne(s,t){if(s&1){let e=C();o(0,"ds-icon-button",5),m("action",function(){g(e);let i=l();return _(i.goBack())}),r()}}function se(s,t){if(s&1){let e=C();o(0,"agentos-user-item",7),m("editRequested",function(i){g(e);let a=l(2);return _(a.navigateToEdit(i))})("deleteRequested",function(i){g(e);let a=l(2);return _(a.deleteUser(i))}),r()}s&2&&p("user",t)}function ie(s,t){if(s&1&&b(0,se,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=c(I);destroyRef=c(w);userAdminState=c(H);namespacePermissions=c(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(R(t=>t?this.namespacePermissions.listNamespaceUsers(t).pipe(B(e=>new Set(e.map(n=>n.id))),P(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=v({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&&(o(0,"ds-entity-list",1),m("createRequested",function(){return n.navigateToCreate()}),b(1,te,1,3,"agentos-namespace-select",2)(2,ne,1,0,"ds-icon-button",3),r(),E(3,ie,1,1,"ng-template",null,0,L)),e&2){let i,a=O(4);p("hideTitle",n.hideTitle())("items",n.userItems())("showCreate",!0)("itemTemplate",a),d(),f((i=n.namespaces())?1:n.showBackButton()?2:-1,i)}},dependencies:[$,M,K,J],encapsulation:2,changeDetection:0})};function re(s,t){if(s&1){let e=C();o(0,"agentos-user-list",9),m("namespaceFilterChange",function(i){g(e);let a=l();return _(a.onUsersNamespaceChange(i))}),r()}if(s&2){let e=l();p("showBackButton",!1)("hideTitle",!0)("namespaces",e.namespaces())("selectedNamespaceId",e.usersNamespaceFilter())}}function oe(s,t){s&1&&(o(0,"p",10),u(1,"No namespaces yet. Create one before managing groups."),r())}function ae(s,t){if(s&1){let e=C();o(0,"agentos-user-group-list",12),m("namespaceChange",function(i){g(e);let a=l(2);return _(a.onGroupsNamespaceChange(i))}),r()}if(s&2){let e=l(2);p("namespaceId",t)("hideTitle",!0)("namespaces",e.namespaces())("returnTo",e.returnTo())}}function le(s,t){if(s&1&&b(0,oe,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 Z=class s{router=c(I);route=c(q);destroyRef=c(w);namespaceController=c(G);activeTab=y(this.route.snapshot.queryParamMap.get("tab")==="groups"?"groups":"users");namespaces=y([]);usersNamespaceFilter=y(null);groupsNamespaceId=y(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(a=>a.role!=="MEMBER");this.namespaces.set(n);let i=t&&n.some(a=>a.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=v({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&&(o(0,"div",0)(1,"header",1)(2,"button",2),m("click",function(){return n.goBack()}),u(3,"\u2190 Admin"),r(),o(4,"h1",3),u(5,"Users & Groups"),r()(),o(6,"div",4)(7,"button",5),m("click",function(){return n.setTab("users")}),u(8," Users "),r(),o(9,"button",6),m("click",function(){return n.setTab("groups")}),u(10," Groups "),r()(),o(11,"div",7),b(12,re,1,4,"agentos-user-list",8)(13,le,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,Q],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,Z as c};
@@ -1 +1 @@
1
- import{a as D}from"./chunk-VDQ7VRBP.js";import{a as k}from"./chunk-MLVWHS7Q.js";import"./chunk-BCOH5IGB.js";import{c as x}from"./chunk-MZT6I3S3.js";import{r as B,y as $}from"./chunk-N347WQAU.js";import"./chunk-MWPKXBXJ.js";import"./chunk-7EDSHFWH.js";import{a as d}from"./chunk-3ZLLFAXF.js";import"./chunk-Q2M4W42M.js";import"./chunk-DDWYQORF.js";import"./chunk-B46LXCLF.js";import{Bb as b,Db as m,Fb as l,Kc as T,Pb as w,S as _,Wa as g,ab as C,ca as i,cc as I,fc as M,ga as u,gc as R,ha as y,i as c,jc as S,lb as h,ma as P,mb as v,rb as a,sb as p,t as f,tb as s}from"./chunk-KJ5SIUGY.js";var F=()=>[];function L(o,e){if(o&1){let t=b();p(0,"agentos-prompt-item",4),m("deleteRequested",function(r){u(t);let E=l(2);return y(E.deletePrompt(r))}),s()}o&2&&a("prompt",e)("platformMode",!0)}function N(o,e){if(o&1&&h(0,L,1,2,"agentos-prompt-item",3),o&2){let t,n=e.$implicit,r=l();v((t=r.resolvePrompt(n.id))?0:-1,t)}}var q=class o{router=i(x);destroyRef=i(P);promptState=i(k);refresh$=new c(void 0);prompts$=this.refresh$.pipe(_(()=>this.promptState.listPlatform()));promptItems$=this.prompts$.pipe(f(e=>e.map(t=>({id:t.id??"",name:t.name,description:t.description}))));promptsById=new Map;constructor(){this.prompts$.pipe(d(this.destroyRef)).subscribe(e=>{this.promptsById=new Map(e.map(t=>[t.id??"",t]))})}goBack(){this.router.navigate(["/agentos","admin"])}openCreateForm(){this.router.navigate(["/agentos","admin","prompts","new"])}deletePrompt(e){this.promptState.delete(e.id??"").pipe(d(this.destroyRef)).subscribe(()=>this.refresh$.next())}resolvePrompt(e){return this.promptsById.get(e)??null}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=g({type:o,selectors:[["agentos-platform-prompts"]],decls:5,vars:6,consts:[["promptItemTpl",""],["title","Platform Prompts","emptyMessage","No platform prompts defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"prompt","platformMode"],[3,"deleteRequested","prompt","platformMode"]],template:function(t,n){if(t&1&&(p(0,"ds-entity-list",1),M(1,"async"),m("createRequested",function(){return n.openCreateForm()}),p(2,"ds-icon-button",2),m("action",function(){return n.goBack()}),s()(),C(3,N,1,1,"ng-template",null,0,S)),t&2){let r=w(4);a("items",R(1,3,n.promptItems$)??I(5,F))("showCreate",!0)("itemTemplate",r)}},dependencies:[$,D,B,T],styles:[".platform-prompts__back[_ngcontent-%COMP%]{background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.platform-prompts__back[_ngcontent-%COMP%]:hover{text-decoration:underline}"],changeDetection:0})};export{q as PlatformPromptsComponent};
1
+ import{a as D}from"./chunk-JW4JKLFN.js";import{a as k}from"./chunk-7N4XUYW4.js";import"./chunk-ZAMAK546.js";import{c as x}from"./chunk-MZT6I3S3.js";import{s as B,z as $}from"./chunk-C2J4TQ7V.js";import"./chunk-MWPKXBXJ.js";import"./chunk-7EDSHFWH.js";import{a as d}from"./chunk-3ZLLFAXF.js";import"./chunk-Q2M4W42M.js";import"./chunk-DDWYQORF.js";import"./chunk-B46LXCLF.js";import{Bb as b,Db as m,Fb as l,Kc as T,Pb as w,S as _,Wa as g,ab as C,ca as i,cc as I,fc as M,ga as u,gc as R,ha as y,i as c,jc as S,lb as h,ma as P,mb as v,rb as a,sb as p,t as f,tb as s}from"./chunk-KJ5SIUGY.js";var F=()=>[];function L(o,e){if(o&1){let t=b();p(0,"agentos-prompt-item",4),m("deleteRequested",function(r){u(t);let E=l(2);return y(E.deletePrompt(r))}),s()}o&2&&a("prompt",e)("platformMode",!0)}function N(o,e){if(o&1&&h(0,L,1,2,"agentos-prompt-item",3),o&2){let t,n=e.$implicit,r=l();v((t=r.resolvePrompt(n.id))?0:-1,t)}}var q=class o{router=i(x);destroyRef=i(P);promptState=i(k);refresh$=new c(void 0);prompts$=this.refresh$.pipe(_(()=>this.promptState.listPlatform()));promptItems$=this.prompts$.pipe(f(e=>e.map(t=>({id:t.id??"",name:t.name,description:t.description}))));promptsById=new Map;constructor(){this.prompts$.pipe(d(this.destroyRef)).subscribe(e=>{this.promptsById=new Map(e.map(t=>[t.id??"",t]))})}goBack(){this.router.navigate(["/agentos","admin"])}openCreateForm(){this.router.navigate(["/agentos","admin","prompts","new"])}deletePrompt(e){this.promptState.delete(e.id??"").pipe(d(this.destroyRef)).subscribe(()=>this.refresh$.next())}resolvePrompt(e){return this.promptsById.get(e)??null}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=g({type:o,selectors:[["agentos-platform-prompts"]],decls:5,vars:6,consts:[["promptItemTpl",""],["title","Platform Prompts","emptyMessage","No platform prompts defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"prompt","platformMode"],[3,"deleteRequested","prompt","platformMode"]],template:function(t,n){if(t&1&&(p(0,"ds-entity-list",1),M(1,"async"),m("createRequested",function(){return n.openCreateForm()}),p(2,"ds-icon-button",2),m("action",function(){return n.goBack()}),s()(),C(3,N,1,1,"ng-template",null,0,S)),t&2){let r=w(4);a("items",R(1,3,n.promptItems$)??I(5,F))("showCreate",!0)("itemTemplate",r)}},dependencies:[$,D,B,T],styles:[".platform-prompts__back[_ngcontent-%COMP%]{background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.platform-prompts__back[_ngcontent-%COMP%]:hover{text-decoration:underline}"],changeDetection:0})};export{q as PlatformPromptsComponent};
@@ -0,0 +1 @@
1
+ import{A as D,o as h,s as w}from"./chunk-C2J4TQ7V.js";import{Bb as u,Db as p,Fb as r,Ka as d,Tb as m,Ub as g,Vb as M,Wa as b,ga as s,ha as c,lb as y,mb as v,pc as f,qc as _,rb as x,sb as t,ta as C,tb as n}from"./chunk-KJ5SIUGY.js";function A(o,a){if(o&1){let e=u();t(0,"span",7),m(1,"Delete?"),n(),t(2,"ds-icon-button",8),p("action",function(){s(e);let l=r();return c(l.onDeleteConfirmed())}),n(),t(3,"ds-icon-button",9),p("action",function(){s(e);let l=r();return c(l.onDeleteCancelled())}),n()}}function P(o,a){if(o&1){let e=u();t(0,"ds-kebab-menu",10),p("itemSelected",function(l){s(e);let O=r();return c(O.onMenuAction(l))}),n()}if(o&2){let e=r();x("items",e.menuItems)}}var I=class o{model=_.required();namespaceId=_(void 0);readOnly=_(!1);deleteRequested=f();editRequested=f();pendingDelete=C(!1);menuItems=[{key:"edit",label:"Edit model",icon:"edit"},{key:"delete",label:"Delete model",icon:"delete",variant:"danger"}];get displayTitle(){return this.model().alias??this.model().apiModelName}onMenuAction(a){switch(a){case"edit":this.editRequested.emit(this.model());break;case"delete":this.pendingDelete.set(!0);break}}onDeleteConfirmed(){this.pendingDelete.set(!1),this.deleteRequested.emit(this.model())}onDeleteCancelled(){this.pendingDelete.set(!1)}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=b({type:o,selectors:[["agentos-ai-model-item"]],inputs:{model:[1,"model"],namespaceId:[1,"namespaceId"],readOnly:[1,"readOnly"]},outputs:{deleteRequested:"deleteRequested",editRequested:"editRequested"},decls:12,vars:4,consts:[["role","listitem","dsBlueprint","",1,"ai-model-item"],[1,"ai-model-item__body"],[1,"ai-model-item__name"],[1,"ai-model-item__api-name"],[1,"ai-model-item__params"],[1,"ai-model-item__actions"],[3,"items"],[1,"ai-model-item__confirm-label"],["icon","check","variant","danger","title","Confirm deletion",3,"action"],["icon","close","title","Cancel deletion",3,"action"],[3,"itemSelected","items"]],template:function(e,i){e&1&&(t(0,"div",0)(1,"div",1)(2,"span",2),m(3),n(),t(4,"span",3),m(5),n(),t(6,"span",4)(7,"span"),m(8),n()()(),t(9,"div",5),y(10,A,4,0)(11,P,1,1,"ds-kebab-menu",6),n()()),e&2&&(d(3),g(i.displayTitle),d(2),g(i.model().apiModelName),d(3),M("priority: ",i.model().priority),d(2),v(i.pendingDelete()?10:i.readOnly()?-1:11))},dependencies:[h,D,w],styles:[".ai-model-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:14px 16px;position:relative;border-radius:0;border:1px solid var(--color-divider);background:var(--color-bg);box-shadow:var(--shadow-sm);overflow:visible;transition:border-color .15s ease}.ai-model-item[_ngcontent-%COMP%]:hover{border-color:var(--color-accent)}.ai-model-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.2rem;min-width:0}.ai-model-item__name[_ngcontent-%COMP%]{font-size:15px;font-weight:600;color:var(--color-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-model-item__api-name[_ngcontent-%COMP%]{font-size:13px;color:var(--color-text-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-model-item__params[_ngcontent-%COMP%]{display:flex;gap:.75rem;font-size:13px;color:var(--color-text-secondary)}.ai-model-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.ai-model-item[_ngcontent-%COMP%]:hover .ai-model-item__actions[_ngcontent-%COMP%], .ai-model-item[_ngcontent-%COMP%]:focus-within .ai-model-item__actions[_ngcontent-%COMP%]{opacity:1}.ai-model-item__confirm-label[_ngcontent-%COMP%]{font-family:var(--font-heading);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--red-deep);margin-right:.25rem;white-space:nowrap}"],changeDetection:0})};export{I as a};
@@ -1 +1 @@
1
- import{c as u}from"./chunk-3CMKQDJD.js";import{a as i,c as m}from"./chunk-MZT6I3S3.js";import{Db as c,Wa as n,ca as t,rb as o,sb as r,tb as p}from"./chunk-KJ5SIUGY.js";var d=class s{route=t(i);router=t(m);namespaceId=this.route.snapshot.params.namespaceId;goBack(){this.router.navigate(["/agentos","namespaces"])}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=n({type:s,selectors:[["agentos-namespace-user-groups"]],decls:1,vars:1,consts:[["backLabel","Namespaces",3,"backRequested","namespaceId"]],template:function(e,a){e&1&&(r(0,"agentos-user-group-list",0),c("backRequested",function(){return a.goBack()}),p()),e&2&&o("namespaceId",a.namespaceId)},dependencies:[u],encapsulation:2,changeDetection:0})};export{d as a};
1
+ import{c as u}from"./chunk-UBMWSFAZ.js";import{a as i,c as m}from"./chunk-MZT6I3S3.js";import{Db as c,Wa as n,ca as t,rb as o,sb as r,tb as p}from"./chunk-KJ5SIUGY.js";var d=class s{route=t(i);router=t(m);namespaceId=this.route.snapshot.params.namespaceId;goBack(){this.router.navigate(["/agentos","namespaces"])}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=n({type:s,selectors:[["agentos-namespace-user-groups"]],decls:1,vars:1,consts:[["backLabel","Namespaces",3,"backRequested","namespaceId"]],template:function(e,a){e&1&&(r(0,"agentos-user-group-list",0),c("backRequested",function(){return a.goBack()}),p()),e&2&&o("namespaceId",a.namespaceId)},dependencies:[u],encapsulation:2,changeDetection:0})};export{d as a};
@@ -0,0 +1 @@
1
+ import{A as O,o as M,s as D}from"./chunk-C2J4TQ7V.js";import{Bb as u,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 v,rb as w,sb as n,ta as x,tb as i}from"./chunk-KJ5SIUGY.js";function I(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 E(t,d){if(t&1&&(n(0,"span",6),c(1),i()),t&2){let e=a();r(),b(e.config().baseUrl)}}function R(t,d){if(t&1){let e=u();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 k(t,d){if(t&1){let e=u();n(0,"ds-kebab-menu",13),g("itemSelected",function(l){s(e);let A=a(2);return m(A.onMenuAction(l))}),i()}if(t&2){let e=a(2);w("items",e.menuItems())}}function q(t,d){if(t&1){let e=u();n(0,"ds-icon-button",11),g("action",function(){s(e);let l=a();return m(l.onDuplicate())}),i(),p(1,k,1,1,"ds-kebab-menu",12)}if(t&2){let e=a();r(),_(e.readOnly()?-1:1)}}var B=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"}}),S=class t{config=v.required();scope=v.required();readOnly=v(!1);showBadge=v(!0);editRequested=f();deleteRequested=f();duplicateRequested=f();pendingDelete=x(!1);badge=C(()=>B[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","dsBlueprint","",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,I,2,3,"span",4),i(),n(6,"span",5),c(7),i(),p(8,E,2,1,"span",6),i(),n(9,"div",7),p(10,R,4,0)(11,q,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:[M,O,D],styles:[".ai-provider-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:14px 16px;position:relative;border-radius:0;border:1px solid var(--color-divider);background:var(--color-bg);box-shadow:var(--shadow-sm);overflow:visible;transition:border-color .15s ease}.ai-provider-item[_ngcontent-%COMP%]:hover{border-color:var(--color-accent)}.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:15px;font-weight:600;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-family:var(--font-heading);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;border-radius:0;padding:.1rem .4rem;line-height:1.2;white-space:nowrap}.ai-provider-item__badge[data-variant=neutral][_ngcontent-%COMP%]{border:1px solid var(--color-divider);color:var(--color-neutral-600);background:transparent}.ai-provider-item__badge[data-variant=info][_ngcontent-%COMP%]{border:1px solid color-mix(in srgb,var(--color-info) 40%,transparent);color:var(--color-info);background:color-mix(in srgb,var(--color-info) 10%,transparent)}.ai-provider-item__badge[data-variant=warning][_ngcontent-%COMP%]{border:1px solid color-mix(in srgb,var(--color-warning) 40%,transparent);color:var(--color-warning);background:color-mix(in srgb,var(--color-warning) 10%,transparent)}.ai-provider-item__type[_ngcontent-%COMP%], .ai-provider-item__url[_ngcontent-%COMP%]{font-size:13px;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-family:var(--font-heading);font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--red-deep);margin-right:.25rem;white-space:nowrap}"],changeDetection:0})};export{S as a};
@@ -1 +1 @@
1
- import{a as k}from"./chunk-PMBWUQPI.js";import{d as D}from"./chunk-BCOH5IGB.js";import{c as q}from"./chunk-MZT6I3S3.js";import{r as M,y as $}from"./chunk-N347WQAU.js";import"./chunk-MWPKXBXJ.js";import"./chunk-7EDSHFWH.js";import{a as _}from"./chunk-3ZLLFAXF.js";import"./chunk-Q2M4W42M.js";import"./chunk-DDWYQORF.js";import"./chunk-B46LXCLF.js";import{Bb as b,Db as s,Fb as d,Kc as T,Pb as w,S as P,Wa as y,ab as C,ca as n,cc as R,fc as I,ga as m,gc as x,ha as l,i as f,jc as B,lb as h,ma as g,mb as A,rb as c,sb as a,t as u,tb as v}from"./chunk-KJ5SIUGY.js";var S=()=>[];function V(r,e){if(r&1){let t=b();a(0,"agentos-ai-provider-item",4),s("editRequested",function(i){m(t);let p=d(2);return l(p.onEdit(i))})("deleteRequested",function(i){m(t);let p=d(2);return l(p.onDelete(i))}),v()}r&2&&c("config",e)("showBadge",!1)}function F(r,e){if(r&1&&h(0,V,1,2,"agentos-ai-provider-item",3),r&2){let t,o=e.$implicit,i=d();A((t=i.resolveProvider(o.id))?0:-1,t)}}var E=class r{router=n(q);destroyRef=n(g);aiProviderController=n(D);refresh$=new f(void 0);providers$=this.refresh$.pipe(P(()=>this.aiProviderController.listAiProvider("none")));providerItems$=this.providers$.pipe(u(e=>e.map(t=>({id:t.id??"",name:t.name,description:t.apiType}))));providersById=new Map;constructor(){this.providers$.pipe(_(this.destroyRef)).subscribe(e=>{this.providersById=new Map(e.map(t=>[t.id??"",t]))})}goBack(){this.router.navigate(["/agentos","admin"])}openCreateForm(){this.router.navigate(["/agentos","admin","ai-providers","new"])}onEdit(e){e.id&&this.router.navigate(["/agentos","admin","ai-providers",e.id,"edit"])}onDelete(e){e.id&&this.aiProviderController.deleteAiProvider(e.id).pipe(_(this.destroyRef)).subscribe(()=>this.refresh$.next())}resolveProvider(e){return this.providersById.get(e)??null}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=y({type:r,selectors:[["agentos-platform-ai-providers"]],decls:5,vars:6,consts:[["aiProviderItemTpl",""],["title","Platform AI Providers","emptyMessage","No platform AI providers defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],["scope","namespace",3,"config","showBadge"],["scope","namespace",3,"editRequested","deleteRequested","config","showBadge"]],template:function(t,o){if(t&1&&(a(0,"ds-entity-list",1),I(1,"async"),s("createRequested",function(){return o.openCreateForm()}),a(2,"ds-icon-button",2),s("action",function(){return o.goBack()}),v()(),C(3,F,1,1,"ng-template",null,0,B)),t&2){let i=w(4);c("items",x(1,3,o.providerItems$)??R(5,S))("showCreate",!0)("itemTemplate",i)}},dependencies:[$,k,M,T],styles:[".platform-ai-providers__back[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;font-family:inherit;font-size:.875rem;color:var(--color-text-secondary, #6e6e73);padding:.25rem .5rem;border-radius:4px;transition:color .15s ease}.platform-ai-providers__back[_ngcontent-%COMP%]:hover{color:var(--color-primary, #007aff)}"],changeDetection:0})};export{E as PlatformAiProvidersComponent};
1
+ import{a as k}from"./chunk-6LNXGAHM.js";import{d as D}from"./chunk-ZAMAK546.js";import{c as q}from"./chunk-MZT6I3S3.js";import{s as M,z as $}from"./chunk-C2J4TQ7V.js";import"./chunk-MWPKXBXJ.js";import"./chunk-7EDSHFWH.js";import{a as _}from"./chunk-3ZLLFAXF.js";import"./chunk-Q2M4W42M.js";import"./chunk-DDWYQORF.js";import"./chunk-B46LXCLF.js";import{Bb as b,Db as s,Fb as d,Kc as T,Pb as w,S as P,Wa as y,ab as C,ca as n,cc as R,fc as I,ga as m,gc as x,ha as l,i as f,jc as B,lb as h,ma as g,mb as A,rb as c,sb as a,t as u,tb as v}from"./chunk-KJ5SIUGY.js";var S=()=>[];function V(r,e){if(r&1){let t=b();a(0,"agentos-ai-provider-item",4),s("editRequested",function(i){m(t);let p=d(2);return l(p.onEdit(i))})("deleteRequested",function(i){m(t);let p=d(2);return l(p.onDelete(i))}),v()}r&2&&c("config",e)("showBadge",!1)}function F(r,e){if(r&1&&h(0,V,1,2,"agentos-ai-provider-item",3),r&2){let t,o=e.$implicit,i=d();A((t=i.resolveProvider(o.id))?0:-1,t)}}var E=class r{router=n(q);destroyRef=n(g);aiProviderController=n(D);refresh$=new f(void 0);providers$=this.refresh$.pipe(P(()=>this.aiProviderController.listAiProvider("none")));providerItems$=this.providers$.pipe(u(e=>e.map(t=>({id:t.id??"",name:t.name,description:t.apiType}))));providersById=new Map;constructor(){this.providers$.pipe(_(this.destroyRef)).subscribe(e=>{this.providersById=new Map(e.map(t=>[t.id??"",t]))})}goBack(){this.router.navigate(["/agentos","admin"])}openCreateForm(){this.router.navigate(["/agentos","admin","ai-providers","new"])}onEdit(e){e.id&&this.router.navigate(["/agentos","admin","ai-providers",e.id,"edit"])}onDelete(e){e.id&&this.aiProviderController.deleteAiProvider(e.id).pipe(_(this.destroyRef)).subscribe(()=>this.refresh$.next())}resolveProvider(e){return this.providersById.get(e)??null}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=y({type:r,selectors:[["agentos-platform-ai-providers"]],decls:5,vars:6,consts:[["aiProviderItemTpl",""],["title","Platform AI Providers","emptyMessage","No platform AI providers defined yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],["scope","namespace",3,"config","showBadge"],["scope","namespace",3,"editRequested","deleteRequested","config","showBadge"]],template:function(t,o){if(t&1&&(a(0,"ds-entity-list",1),I(1,"async"),s("createRequested",function(){return o.openCreateForm()}),a(2,"ds-icon-button",2),s("action",function(){return o.goBack()}),v()(),C(3,F,1,1,"ng-template",null,0,B)),t&2){let i=w(4);c("items",x(1,3,o.providerItems$)??R(5,S))("showCreate",!0)("itemTemplate",i)}},dependencies:[$,k,M,T],styles:[".platform-ai-providers__back[_ngcontent-%COMP%]{background:none;border:none;cursor:pointer;font-family:inherit;font-size:.875rem;color:var(--color-text-secondary, #6e6e73);padding:.25rem .5rem;border-radius:4px;transition:color .15s ease}.platform-ai-providers__back[_ngcontent-%COMP%]:hover{color:var(--color-primary, #007aff)}"],changeDetection:0})};export{E as PlatformAiProvidersComponent};
@@ -0,0 +1,6 @@
1
+ import{c as be,d as N,e as _e,f as Te,g as we,h as Oe,i as Pe,j as xe,k as ke,l as Ve,m as Ie,n as Ne,o as je,p as We,q as U,r as Re,s as Ae,u as De,v as Fe,w as Le,x as Be,y as ze,z as Ue}from"./chunk-PFBYB2QD.js";import{a as $e}from"./chunk-WUU4G5YQ.js";import{a as pe,b as ge,e as me,f as he,g as ue}from"./chunk-OX7PDXEA.js";import{a as j}from"./chunk-Q2M4W42M.js";import{E as D,c as W,g as R,m as A,p as Se,q as Ce,x as ye,y as Ee,z as Me}from"./chunk-DDWYQORF.js";import{E as le,J as de,O as ve,Q as fe}from"./chunk-B46LXCLF.js";import{$b as h,Ab as x,Db as d,Fb as k,Jb as X,Jc as se,Ka as c,Kb as ee,Lb as te,Oc as ce,Pb as ne,Qb as V,Rb as ie,Sb as oe,T as p,Tb as s,V as J,Vb as y,Wa as E,Wb as re,Xa as Q,Z as P,Zb as g,_ as Y,_b as m,aa as K,ab as Z,ca as v,d as S,h as C,i as b,ia as B,ja as q,jb as M,jc as ae,lb as T,mb as w,pb as $,qb as z,rb as u,sb as a,tb as r,ub as f,ya as G,yc as I}from"./chunk-KJ5SIUGY.js";var qe=["determinateSpinner"];function Ge(l,e){if(l&1&&(B(),a(0,"svg",11),f(1,"circle",12),r()),l&2){let t=k();M("viewBox",t._viewBox()),c(),V("stroke-dasharray",t._strokeCircumference(),"px")("stroke-dashoffset",t._strokeCircumference()/2,"px")("stroke-width",t._circleStrokeWidth(),"%"),M("r",t._circleRadius())}}var Qe=new K("mat-progress-spinner-default-options",{providedIn:"root",factory:()=>({diameter:He})}),He=100,Ze=10,St=(()=>{class l{_elementRef=v(G);_noopAnimations;get color(){return this._color||this._defaultColor}set color(t){this._color=t}_color;_defaultColor="primary";_determinateCircle;constructor(){let t=v(Qe),n=de(),i=this._elementRef.nativeElement;this._noopAnimations=n==="di-disabled"&&!!t&&!t._forceAnimations,this.mode=i.nodeName.toLowerCase()==="mat-spinner"?"indeterminate":"determinate",!this._noopAnimations&&n==="reduced-motion"&&i.classList.add("mat-progress-spinner-reduced-motion"),t&&(t.color&&(this.color=this._defaultColor=t.color),t.diameter&&(this.diameter=t.diameter),t.strokeWidth&&(this.strokeWidth=t.strokeWidth))}mode;get value(){return this.mode==="determinate"?this._value:0}set value(t){this._value=Math.max(0,Math.min(100,t||0))}_value=0;get diameter(){return this._diameter}set diameter(t){this._diameter=t||0}_diameter=He;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(t){this._strokeWidth=t||0}_strokeWidth;_circleRadius(){return(this.diameter-Ze)/2}_viewBox(){let t=this._circleRadius()*2+this.strokeWidth;return`0 0 ${t} ${t}`}_strokeCircumference(){return 2*Math.PI*this._circleRadius()}_strokeDashOffset(){return this.mode==="determinate"?this._strokeCircumference()*(100-this._value)/100:null}_circleStrokeWidth(){return this.strokeWidth/this.diameter*100}static \u0275fac=function(n){return new(n||l)};static \u0275cmp=E({type:l,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(n,i){if(n&1&&X(qe,5),n&2){let o;ee(o=te())&&(i._determinateCircle=o.first)}},hostAttrs:["role","progressbar","tabindex","-1",1,"mat-mdc-progress-spinner","mdc-circular-progress"],hostVars:18,hostBindings:function(n,i){n&2&&(M("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",i.mode==="determinate"?i.value:null)("mode",i.mode),oe("mat-"+i.color),V("width",i.diameter,"px")("height",i.diameter,"px")("--mat-progress-spinner-size",i.diameter+"px")("--mat-progress-spinner-active-indicator-width",i.diameter+"px"),ie("_mat-animation-noopable",i._noopAnimations)("mdc-circular-progress--indeterminate",i.mode==="indeterminate"))},inputs:{color:"color",mode:"mode",value:[2,"value","value",I],diameter:[2,"diameter","diameter",I],strokeWidth:[2,"strokeWidth","strokeWidth",I]},exportAs:["matProgressSpinner"],decls:14,vars:11,consts:[["circle",""],["determinateSpinner",""],["aria-hidden","true",1,"mdc-circular-progress__determinate-container"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__determinate-circle-graphic"],["cx","50%","cy","50%",1,"mdc-circular-progress__determinate-circle"],["aria-hidden","true",1,"mdc-circular-progress__indeterminate-container"],[1,"mdc-circular-progress__spinner-layer"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-left"],[3,"ngTemplateOutlet"],[1,"mdc-circular-progress__gap-patch"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-right"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__indeterminate-circle-graphic"],["cx","50%","cy","50%"]],template:function(n,i){if(n&1&&(Z(0,Ge,2,8,"ng-template",null,0,ae),a(2,"div",2,1),B(),a(4,"svg",3),f(5,"circle",4),r()(),q(),a(6,"div",5)(7,"div",6)(8,"div",7),x(9,8),r(),a(10,"div",9),x(11,8),r(),a(12,"div",10),x(13,8),r()()()),n&2){let o=ne(1);c(4),M("viewBox",i._viewBox()),c(),V("stroke-dasharray",i._strokeCircumference(),"px")("stroke-dashoffset",i._strokeDashOffset(),"px")("stroke-width",i._circleStrokeWidth(),"%"),M("r",i._circleRadius()),c(4),u("ngTemplateOutlet",o),c(2),u("ngTemplateOutlet",o),c(2),u("ngTemplateOutlet",o)}},dependencies:[se],styles:[`.mat-mdc-progress-spinner{--mat-progress-spinner-animation-multiplier: 1;display:block;overflow:hidden;line-height:0;position:relative;direction:ltr;transition:opacity 250ms cubic-bezier(0.4, 0, 0.6, 1)}.mat-mdc-progress-spinner circle{stroke-width:var(--mat-progress-spinner-active-indicator-width, 4px)}.mat-mdc-progress-spinner._mat-animation-noopable,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__determinate-circle{transition:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__spinner-layer,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container{animation:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container circle{stroke-dasharray:0 !important}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle{stroke:currentColor;stroke:CanvasText}}.mat-progress-spinner-reduced-motion{--mat-progress-spinner-animation-multiplier: 1.25}.mdc-circular-progress__determinate-container,.mdc-circular-progress__indeterminate-circle-graphic,.mdc-circular-progress__indeterminate-container,.mdc-circular-progress__spinner-layer{position:absolute;width:100%;height:100%}.mdc-circular-progress__determinate-container{transform:rotate(-90deg)}.mdc-circular-progress--indeterminate .mdc-circular-progress__determinate-container{opacity:0}.mdc-circular-progress__indeterminate-container{font-size:0;letter-spacing:0;white-space:nowrap;opacity:0}.mdc-circular-progress--indeterminate .mdc-circular-progress__indeterminate-container{opacity:1;animation:mdc-circular-progress-container-rotate calc(1568.2352941176ms*var(--mat-progress-spinner-animation-multiplier)) linear infinite}.mdc-circular-progress__determinate-circle-graphic,.mdc-circular-progress__indeterminate-circle-graphic{fill:rgba(0,0,0,0)}.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:var(--mat-progress-spinner-active-indicator-color, var(--mat-sys-primary))}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:CanvasText}}.mdc-circular-progress__determinate-circle{transition:stroke-dashoffset 500ms cubic-bezier(0, 0, 0.2, 1)}.mdc-circular-progress__gap-patch{position:absolute;top:0;left:47.5%;box-sizing:border-box;width:5%;height:100%;overflow:hidden}.mdc-circular-progress__gap-patch .mdc-circular-progress__indeterminate-circle-graphic{left:-900%;width:2000%;transform:rotate(180deg)}.mdc-circular-progress__circle-clipper .mdc-circular-progress__indeterminate-circle-graphic{width:200%}.mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{left:-100%}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-left .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-left-spin calc(1333ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-right-spin calc(1333ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress__circle-clipper{display:inline-flex;position:relative;width:50%;height:100%;overflow:hidden}.mdc-circular-progress--indeterminate .mdc-circular-progress__spinner-layer{animation:mdc-circular-progress-spinner-layer-rotate calc(5332ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}@keyframes mdc-circular-progress-container-rotate{to{transform:rotate(360deg)}}@keyframes mdc-circular-progress-spinner-layer-rotate{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}@keyframes mdc-circular-progress-left-spin{from{transform:rotate(265deg)}50%{transform:rotate(130deg)}to{transform:rotate(265deg)}}@keyframes mdc-circular-progress-right-spin{from{transform:rotate(-265deg)}50%{transform:rotate(-130deg)}to{transform:rotate(-265deg)}}
2
+ `],encapsulation:2,changeDetection:0})}return l})();var Ct=(()=>{class l{static \u0275fac=function(n){return new(n||l)};static \u0275mod=Q({type:l});static \u0275inj=Y({imports:[le]})}return l})();var L=class l{destroy$=new C;voices;currentUtterance=null;currentOnEndCallback=null;speakingSubject=new b(!1);speaking$=this.speakingSubject.asObservable();volume=.8;rate=1.2;language="en-US";selectedVoice;preferencesService=v(N);constructor(){this.initializeSpeechSynthesis(),this.subscribeToPreferences()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.stopSpeech()}initializeSpeechSynthesis(){if(!("speechSynthesis"in window)){console.warn("[VOICE-SERVICE] Speech synthesis not available"),this.voices=new Promise(e=>e([]));return}this.voices=new Promise((e,t)=>{let n=speechSynthesis.getVoices();if(n.length)e(n);else{let i=setTimeout(()=>{t("no voices found")},2e3);speechSynthesis.addEventListener("voiceschanged",()=>{let o=speechSynthesis.getVoices();o.length&&(clearTimeout(i),e(o))})}}),console.log("[VOICE-SERVICE] Speech synthesis initialized")}subscribeToPreferences(){this.preferencesService.voiceVolume$.pipe(p(this.destroy$)).subscribe(e=>{this.volume=e,console.log("[VOICE-SERVICE] Volume updated to:",e)}),this.preferencesService.voiceRate$.pipe(p(this.destroy$)).subscribe(e=>{this.rate=e,console.log("[VOICE-SERVICE] Rate updated to:",e)}),this.preferencesService.voiceLanguage$.pipe(p(this.destroy$)).subscribe(e=>{this.language=e,console.log("[VOICE-SERVICE] Language updated to:",e),this.updateSelectedVoiceForLanguage()}),this.preferencesService.selectedVoice$.pipe(p(this.destroy$)).subscribe(e=>{this.setSelectedVoice(e)}),this.volume=this.preferencesService.getVoiceVolume(),this.rate=this.preferencesService.getVoiceRate(),this.language=this.preferencesService.getVoiceLanguage(),this.setSelectedVoice(this.preferencesService.getSelectedVoice())}isReady(){return"speechSynthesis"in window&&this.selectedVoice!==void 0}isSpeaking(){return speechSynthesis.speaking}speak(e,t){return S(this,null,function*(){if(!this.selectedVoice)return console.warn("[VOICE-SERVICE] No voice selected"),!1;if(!e.trim())return console.warn("[VOICE-SERVICE] No text to speak"),!1;let n=this.extractPlainText(e);if(!n.trim())return console.warn("[VOICE-SERVICE] No text to speak after markdown cleaning"),!1;this.stopSpeech();try{let i=new SpeechSynthesisUtterance(n);i.voice=this.selectedVoice,i.lang=this.selectedVoice.lang,i.volume=this.volume,i.rate=this.rate,this.currentOnEndCallback=t||null,t&&(i.onend=()=>{this.currentOnEndCallback===t&&(this.currentOnEndCallback=null,t())},i.onerror=()=>{this.currentOnEndCallback===t&&(this.currentOnEndCallback=null,t())}),this.currentUtterance=i,this.speakingSubject.next(!0);let o=i.onend,_=i.onerror;return i.onend=O=>{this.speakingSubject.next(!1),o&&o.call(i,O)},i.onerror=O=>{this.speakingSubject.next(!1),_&&_.call(i,O)},speechSynthesis.speak(i),console.log("[VOICE-SERVICE] Started speaking:",e.substring(0,50)+"..."),!0}catch(i){return console.error("[VOICE-SERVICE] Error speaking:",i),!1}})}stopSpeech(){if(this.currentUtterance||speechSynthesis.speaking){if(speechSynthesis.cancel(),this.currentUtterance=null,this.currentOnEndCallback){let e=this.currentOnEndCallback;this.currentOnEndCallback=null,e()}this.speakingSubject.next(!1),console.log("[VOICE-SERVICE] Speech stopped")}}ding(){try{let e=new(window.AudioContext||window.webkitAudioContext),t=e.createOscillator(),n=e.createGain();t.connect(n),n.connect(e.destination),t.frequency.setValueAtTime(800,e.currentTime),n.gain.setValueAtTime(.1,e.currentTime),n.gain.exponentialRampToValueAtTime(.01,e.currentTime+.1),t.start(e.currentTime),t.stop(e.currentTime+.1),console.log("[VOICE-SERVICE] Notification sound played")}catch(e){console.error("[VOICE-SERVICE] Notification sound failed:",e)}}getVoicesForLanguage(){return S(this,null,function*(){try{let e=this.language.slice(0,2),t=yield this.voices;if(!t||t.length===0)return console.warn("[VOICE-SERVICE] No voices available on system"),[];let n=t.filter(i=>i.lang.toLowerCase().startsWith(e)).sort((i,o)=>i.localService&&!o.localService?-1:!i.localService&&o.localService?1:i.name.localeCompare(o.name));return console.log("[VOICE-SERVICE] Found matching voices:",n.length,"for language:",e),n.map(i=>({name:i.name,lang:i.lang,localService:i.localService,default:i.default,displayName:this.formatVoiceDisplayName(i)}))}catch(e){return console.error("[VOICE-SERVICE] Error getting voices for language:",e),[]}})}formatVoiceDisplayName(e){let t=e.localService?"\u{1F3E0}":"\u2601\uFE0F",n=e.default?" \u2B50":"";return`${t} ${e.name} (${e.lang})${n}`}setSelectedVoice(e){return S(this,null,function*(){if(!e){this.selectedVoice=void 0;return}let[t,n]=e.split("|");if(!t||!n){this.selectedVoice=void 0;return}let i=(yield this.voices)?.find(o=>o.name===t&&o.lang===n);i?(this.selectedVoice=i,console.log("[VOICE-SERVICE] Selected voice:",i.name,i.lang)):(this.selectedVoice=void 0,console.warn("[VOICE-SERVICE] Voice not found:",t,n))})}updateSelectedVoiceForLanguage(){return S(this,null,function*(){let e=yield this.getVoicesForLanguage();if(e.length===0){console.warn("[VOICE-SERVICE] No voices available for language:",this.language),this.selectedVoice=void 0,this.preferencesService.setSelectedVoice(null);return}let t=this.preferencesService.getSelectedVoice();if(t){let[i,o]=t.split("|"),_=o?.slice(0,2),O=this.language.slice(0,2);if(_===O&&e.some(H=>H.name===i&&H.lang===o)){console.log("[VOICE-SERVICE] Keeping current voice for language:",t);return}}let n=e[0];if(n){let i=`${n.name}|${n.lang}`;this.preferencesService.setSelectedVoice(i),console.log("[VOICE-SERVICE] Auto-selected voice for language change:",n.displayName)}})}testSelectedVoice(){setTimeout(()=>{if(!this.selectedVoice){console.log("[VOICE-SERVICE] No voice selected for test");return}this.stopSpeech();let e=this.getTestText();e&&this.speak(e)},100)}getTestText(){let e=this.language.slice(0,2),t={fr:"Bonjour, ceci est un test de la voix s\xE9lectionn\xE9e.",en:"Hello, this is a test of the selected voice.",es:"Hola, esta es una prueba de la voz seleccionada.",de:"Hallo, dies ist ein Test der ausgew\xE4hlten Stimme.",it:"Ciao, questo \xE8 un test della voce selezionata.",pt:"Ol\xE1, este \xE9 um teste da voz selecionada.",ja:"\u3053\u3093\u306B\u3061\u306F\u3001\u3053\u308C\u306F\u9078\u629E\u3055\u308C\u305F\u97F3\u58F0\u306E\u30C6\u30B9\u30C8\u3067\u3059\u3002",ko:"\uC548\uB155\uD558\uC138\uC694, \uC774\uAC83\uC740 \uC120\uD0DD\uB41C \uC74C\uC131\uC758 \uD14C\uC2A4\uD2B8\uC785\uB2C8\uB2E4.",zh:"\u4F60\u597D\uFF0C\u8FD9\u662F\u6240\u9009\u8BED\u97F3\u7684\u6D4B\u8BD5\u3002",ru:"\u041F\u0440\u0438\u0432\u0435\u0442, \u044D\u0442\u043E \u0442\u0435\u0441\u0442 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0433\u043E\u043B\u043E\u0441\u0430.",ar:"\u0645\u0631\u062D\u0628\u0627\u060C \u0647\u0630\u0627 \u0627\u062E\u062A\u0628\u0627\u0631 \u0644\u0644\u0635\u0648\u062A \u0627\u0644\u0645\u062D\u062F\u062F."};return t[e]||t.en||"Hello, this is a test."}extractPlainText(e){let t=e.replace(/[\u{1F600}-\u{1F64F}]|[\u{1F300}-\u{1F5FF}]|[\u{1F680}-\u{1F6FF}]|[\u{1F1E0}-\u{1F1FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]|⭐/gu,"").replace(/```[\s\S]*?```/g,"code block").replace(/`([^`]+)`/g,"$1").replace(/\*\*\*(.*?)\*\*\*/g,"$1").replace(/\*\*(.*?)\*\*/g,"$1").replace(/\*(.*?)\*/g,"$1").replace(/~~(.*?)~~/g,"$1").replace(/#{1,6}\s*(.*)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/https?:\/\/[^\s]+/g,"link").replace(/&nbsp;/g," ").replace(/&amp;/g,"and").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"');return t=this.addNaturalPunctuation(t),t.replace(/\s+/g," ").trim()}addNaturalPunctuation(e){return e.replace(/\n+/g,`
3
+ `).split(`
4
+ `).map(t=>this.addPeriodIfNeeded(t.trim())).filter(t=>t.length>0).join(" ")}addPeriodIfNeeded(e){return e?/[.!?;:]$/.test(e)?e:e+".":""}static \u0275fac=function(t){return new(t||l)};static \u0275prov=P({token:l,factory:l.\u0275fac,providedIn:"root"})};var tt=(l,e)=>e.code,nt=(l,e)=>e.name+e.lang;function it(l,e){l&1&&(a(0,"div",17)(1,"mat-icon",39),s(2,"warning"),r(),a(3,"span",40),s(4," Browser notifications have been blocked. To enable them, please reset the site permissions in your browser settings. "),r()())}function ot(l,e){if(l&1&&(a(0,"option",25),s(1),r()),l&2){let t=e.$implicit;u("value",t.code),c(),re("",t.flag," ",t.label)}}function rt(l,e){l&1&&(a(0,"option",32),s(1,"Loading voices..."),r())}function at(l,e){l&1&&(a(0,"option",32),s(1,"No voice available"),r())}function st(l,e){if(l&1&&(a(0,"option",25),s(1),r()),l&2){let t=e.$implicit;u("value",t.name+"|"+t.lang),c(),y(" ",t.displayName," ")}}var Je=class l{destroy$=new C;selectedTheme="light";selectedThemeVariant="industry";selectedVoiceLanguage="en-US";useEnterToSend=!1;printTechnicalMessages=!1;showTechnicalMessages=!0;showWarningMessages=!0;voiceInputMode="browser";voiceAnnounceEnabled=!1;voiceMode="speech";voiceReadFullText=!1;voiceVolume=80;voiceRate=120;agentNotificationEnabled=!1;notificationSoundEnabled=!0;browserNotificationEnabled=!1;browserNotificationDenied=!1;missionPreviewEnabled=!1;availableVoices=[];selectedVoiceId=null;loadingVoices=!1;voiceLanguageOptions=[{code:"fr-FR",label:"Fran\xE7ais",flag:"\u{1F1EB}\u{1F1F7}"},{code:"en-US",label:"English (US)",flag:"\u{1F1FA}\u{1F1F8}"},{code:"en-GB",label:"English (UK)",flag:"\u{1F1EC}\u{1F1E7}"},{code:"es-ES",label:"Espa\xF1ol",flag:"\u{1F1EA}\u{1F1F8}"},{code:"de-DE",label:"Deutsch",flag:"\u{1F1E9}\u{1F1EA}"},{code:"it-IT",label:"Italiano",flag:"\u{1F1EE}\u{1F1F9}"},{code:"pt-BR",label:"Portugu\xEAs",flag:"\u{1F1E7}\u{1F1F7}"},{code:"ja-JP",label:"\u65E5\u672C\u8A9E",flag:"\u{1F1EF}\u{1F1F5}"},{code:"ko-KR",label:"\uD55C\uAD6D\uC5B4",flag:"\u{1F1F0}\u{1F1F7}"},{code:"zh-CN",label:"\u4E2D\u6587 (\u7B80\u4F53)",flag:"\u{1F1E8}\u{1F1F3}"},{code:"ru-RU",label:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",flag:"\u{1F1F7}\u{1F1FA}"},{code:"ar-SA",label:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",flag:"\u{1F1F8}\u{1F1E6}"}];preferencesService=v(N);voiceSynthesisService=v(L);themeService=v(_e);ngOnInit(){let e=this.themeService.getCurrentTheme();this.selectedTheme=e.mode,this.selectedThemeVariant=e.variant,this.selectedVoiceLanguage=this.preferencesService.getVoiceLanguage(),this.useEnterToSend=this.preferencesService.getEnterToSend(),this.printTechnicalMessages=this.preferencesService.getPrintTechnicalMessages(),this.showTechnicalMessages=!this.preferencesService.getHideTechnicalMessages(),this.showWarningMessages=!this.preferencesService.getHideWarningMessages(),this.voiceInputMode=this.preferencesService.getVoiceInputMode(),this.voiceAnnounceEnabled=this.preferencesService.getVoiceAnnounceEnabled(),this.voiceMode=this.preferencesService.getVoiceMode(),this.voiceReadFullText=this.preferencesService.getVoiceReadFullText(),this.voiceVolume=Math.round(this.preferencesService.getVoiceVolume()*100),this.voiceRate=Math.round(this.preferencesService.getVoiceRate()*100),this.selectedVoiceId=this.preferencesService.getSelectedVoice(),this.agentNotificationEnabled=this.preferencesService.getAgentNotificationEnabled(),this.notificationSoundEnabled=this.preferencesService.getNotificationSoundEnabled(),this.browserNotificationEnabled=this.preferencesService.getBrowserNotificationEnabled(),this.missionPreviewEnabled=this.preferencesService.getMissionPreviewEnabled(),this.loadAvailableVoices(),this.themeService.currentTheme$.pipe(p(this.destroy$)).subscribe(t=>{this.selectedTheme=t.mode,this.selectedThemeVariant=t.variant}),this.preferencesService.voiceLanguage$.pipe(p(this.destroy$)).subscribe(t=>{this.selectedVoiceLanguage=t}),this.preferencesService.enterToSend$.pipe(p(this.destroy$)).subscribe(t=>{this.useEnterToSend=t}),this.preferencesService.printTechnicalMessages$.pipe(p(this.destroy$)).subscribe(t=>{this.printTechnicalMessages=t}),this.preferencesService.hideTechnicalMessages$.pipe(p(this.destroy$)).subscribe(t=>{this.showTechnicalMessages=!t}),this.preferencesService.hideWarningMessages$.pipe(p(this.destroy$)).subscribe(t=>{this.showWarningMessages=!t}),this.preferencesService.voiceInputMode$.pipe(p(this.destroy$)).subscribe(t=>{this.voiceInputMode=t}),this.preferencesService.voiceAnnounceEnabled$.pipe(p(this.destroy$)).subscribe(t=>{this.voiceAnnounceEnabled=t}),this.preferencesService.voiceMode$.pipe(p(this.destroy$)).subscribe(t=>{this.voiceMode=t}),this.preferencesService.voiceReadFullText$.pipe(p(this.destroy$)).subscribe(t=>{this.voiceReadFullText=t}),this.preferencesService.voiceVolume$.pipe(p(this.destroy$)).subscribe(t=>{this.voiceVolume=Math.round(t*100)}),this.preferencesService.voiceRate$.pipe(p(this.destroy$)).subscribe(t=>{this.voiceRate=Math.round(t*100)}),this.preferencesService.selectedVoice$.pipe(p(this.destroy$)).subscribe(t=>{this.selectedVoiceId=t}),this.preferencesService.voiceLanguage$.pipe(p(this.destroy$)).subscribe(()=>{this.loadAvailableVoices()}),this.preferencesService.agentNotificationEnabled$.pipe(p(this.destroy$)).subscribe(t=>{this.agentNotificationEnabled=t}),this.preferencesService.notificationSoundEnabled$.pipe(p(this.destroy$)).subscribe(t=>{this.notificationSoundEnabled=t}),this.preferencesService.browserNotificationEnabled$.pipe(p(this.destroy$)).subscribe(t=>{this.browserNotificationEnabled=t,this.checkNotificationPermission()}),this.preferencesService.missionPreviewEnabled$.pipe(p(this.destroy$)).subscribe(t=>{this.missionPreviewEnabled=t})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}onThemeChange(){console.log("[OPTIONS] Theme changed to:",this.selectedTheme),this.themeService.setTheme({variant:this.selectedThemeVariant,mode:this.selectedTheme})}onVoiceLanguageChange(){console.log("[OPTIONS] Voice language changed to:",this.selectedVoiceLanguage),this.preferencesService.setVoiceLanguage(this.selectedVoiceLanguage)}onEnterToSendChange(){console.log("[OPTIONS] Enter to send changed to:",this.useEnterToSend),this.preferencesService.setEnterToSend(this.useEnterToSend)}onPrintTechnicalMessagesChange(){console.log("[OPTIONS] Print technical messages changed to:",this.printTechnicalMessages),this.preferencesService.setPrintTechnicalMessages(this.printTechnicalMessages)}onShowTechnicalMessagesChange(){let e=!this.showTechnicalMessages;console.log("[OPTIONS] Show technical messages changed to:",this.showTechnicalMessages,"(hide:",e,")"),this.preferencesService.setHideTechnicalMessages(e)}onShowWarningMessagesChange(){let e=!this.showWarningMessages;console.log("[OPTIONS] Show warning messages changed to:",this.showWarningMessages,"(hide:",e,")"),this.preferencesService.setHideWarningMessages(e)}onVoiceInputModeChange(e){let t=e.target.value;console.log("[OPTIONS] Voice input mode changed to:",t),this.preferencesService.setVoiceInputMode(t)}onVoiceAnnounceEnabledChange(){console.log("[OPTIONS] Voice announce enabled changed to:",this.voiceAnnounceEnabled),this.preferencesService.setVoiceAnnounceEnabled(this.voiceAnnounceEnabled)}onVoiceModeChange(){console.log("[OPTIONS] Voice mode changed to:",this.voiceMode),this.preferencesService.setVoiceMode(this.voiceMode)}onVoiceReadFullTextChange(){console.log("[OPTIONS] Voice read full text changed to:",this.voiceReadFullText),this.preferencesService.setVoiceReadFullText(this.voiceReadFullText)}onVoiceVolumeChange(){let e=this.voiceVolume/100;console.log("[OPTIONS] Voice volume changed to:",e),this.preferencesService.setVoiceVolume(e)}onVoiceRateChange(){let e=this.voiceRate/100;console.log("[OPTIONS] Voice rate changed to:",e),this.preferencesService.setVoiceRate(e)}loadAvailableVoices(){return S(this,null,function*(){this.loadingVoices=!0;try{this.availableVoices=yield this.voiceSynthesisService.getVoicesForLanguage(),console.log("[OPTIONS] Loaded",this.availableVoices.length,"voices for current language")}catch(e){console.error("[OPTIONS] Error loading voices:",e),this.availableVoices=[]}finally{this.loadingVoices=!1}})}onSelectedVoiceChange(){console.log("[OPTIONS] Selected voice changed to:",this.selectedVoiceId),this.preferencesService.setSelectedVoice(this.selectedVoiceId)}testVoice(){console.log("[OPTIONS] Testing voice with current settings"),this.voiceSynthesisService.testSelectedVoice()}onAgentNotificationEnabledChange(){console.log("[OPTIONS] Agent notification enabled changed to:",this.agentNotificationEnabled),this.preferencesService.setAgentNotificationEnabled(this.agentNotificationEnabled)}onNotificationSoundEnabledChange(){console.log("[OPTIONS] Notification sound enabled changed to:",this.notificationSoundEnabled),this.preferencesService.setNotificationSoundEnabled(this.notificationSoundEnabled)}onBrowserNotificationEnabledChange(){console.log("[OPTIONS] Browser notification enabled changed to:",this.browserNotificationEnabled),this.preferencesService.setBrowserNotificationEnabled(this.browserNotificationEnabled)}onMissionPreviewEnabledChange(){console.log("[OPTIONS] Mission preview panel enabled changed to:",this.missionPreviewEnabled),this.preferencesService.setMissionPreviewEnabled(this.missionPreviewEnabled)}checkNotificationPermission(){"Notification"in window&&(this.browserNotificationDenied=Notification.permission==="denied",console.log("[OPTIONS] Notification permission status:",Notification.permission))}static \u0275fac=function(t){return new(t||l)};static \u0275cmp=E({type:l,selectors:[["app-options-panel"]],decls:168,vars:37,consts:[[1,"options-content"],[1,"option-section"],[1,"section-title"],[1,"option-group"],[1,"radio-group"],[1,"option-radio"],["type","radio","name","theme","value","light",3,"ngModelChange","change","ngModel"],[1,"radio-mark"],["type","radio","name","theme","value","dark",3,"ngModelChange","change","ngModel"],["type","radio","name","theme","value","system",3,"ngModelChange","change","ngModel"],[1,"option-label"],["type","radio","name","enterBehavior",3,"ngModelChange","change","value","ngModel"],[1,"toggle-option"],["color","primary",3,"ngModelChange","change","ngModel"],[1,"option-label-with-hint"],[1,"option-hint"],["color","primary",3,"ngModelChange","change","ngModel","disabled"],[1,"notification-error"],["for","voice-input-mode-select",1,"option-label"],["id","voice-input-mode-select",1,"option-select",3,"change","value"],["value","browser"],["value","whisper"],["value","voice-message"],["for","voice-language-select",1,"option-label"],["id","voice-language-select",1,"option-select",3,"ngModelChange","change","ngModel"],[3,"value"],["type","radio","name","voiceAnnounce",3,"ngModelChange","change","value","ngModel"],["type","radio","name","voiceMode","value","speech",3,"ngModelChange","change","ngModel"],["type","radio","name","voiceMode","value","notification",3,"ngModelChange","change","ngModel"],["type","radio","name","voiceReadFull",3,"ngModelChange","change","value","ngModel"],["for","voice-select",1,"option-label"],["id","voice-select",1,"option-select",3,"ngModelChange","change","ngModel","disabled"],["value",""],["role","button","tabindex","0","title","Test voice with current settings",1,"test-voice-link",3,"click"],[1,"thread-name"],["for","voice-volume-slider",1,"option-label"],["id","voice-volume-slider","type","range","min","0","max","100","step","5",1,"option-slider",3,"ngModelChange","input","ngModel"],["for","voice-rate-slider",1,"option-label"],["id","voice-rate-slider","type","range","min","50","max","200","step","10",1,"option-slider",3,"ngModelChange","input","ngModel"],[1,"error-icon"],[1,"error-message"]],template:function(t,n){t&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"mat-icon"),s(4,"palette"),r(),a(5,"span"),s(6,"Appearance"),r()(),a(7,"div",3)(8,"div",4)(9,"label",5)(10,"input",6),h("ngModelChange",function(o){return m(n.selectedTheme,o)||(n.selectedTheme=o),o}),d("change",function(){return n.onThemeChange()}),r(),f(11,"span",7),s(12," Light "),r(),a(13,"label",5)(14,"input",8),h("ngModelChange",function(o){return m(n.selectedTheme,o)||(n.selectedTheme=o),o}),d("change",function(){return n.onThemeChange()}),r(),f(15,"span",7),s(16," Dark "),r(),a(17,"label",5)(18,"input",9),h("ngModelChange",function(o){return m(n.selectedTheme,o)||(n.selectedTheme=o),o}),d("change",function(){return n.onThemeChange()}),r(),f(19,"span",7),s(20," System "),r()()()(),a(21,"div",1)(22,"div",2)(23,"mat-icon"),s(24,"chat_bubble_outline"),r(),a(25,"span"),s(26,"Messaging"),r()(),a(27,"div",3)(28,"span",10),s(29,"Send message behavior:"),r(),a(30,"div",4)(31,"label",5)(32,"input",11),h("ngModelChange",function(o){return m(n.useEnterToSend,o)||(n.useEnterToSend=o),o}),d("change",function(){return n.onEnterToSendChange()}),r(),f(33,"span",7),s(34," Enter to send "),r(),a(35,"label",5)(36,"input",11),h("ngModelChange",function(o){return m(n.useEnterToSend,o)||(n.useEnterToSend=o),o}),d("change",function(){return n.onEnterToSendChange()}),r(),f(37,"span",7),s(38," Enter for new line "),r()()(),a(39,"div",3)(40,"div",12)(41,"span",10),s(42,"Show technical messages"),r(),a(43,"mat-slide-toggle",13),h("ngModelChange",function(o){return m(n.showTechnicalMessages,o)||(n.showTechnicalMessages=o),o}),d("change",function(){return n.onShowTechnicalMessagesChange()}),r()()(),a(44,"div",3)(45,"div",12)(46,"span",10),s(47,"Show warning messages"),r(),a(48,"mat-slide-toggle",13),h("ngModelChange",function(o){return m(n.showWarningMessages,o)||(n.showWarningMessages=o),o}),d("change",function(){return n.onShowWarningMessagesChange()}),r()()(),a(49,"div",3)(50,"div",12)(51,"span",10),s(52,"Include technical messages in print"),r(),a(53,"mat-slide-toggle",13),h("ngModelChange",function(o){return m(n.printTechnicalMessages,o)||(n.printTechnicalMessages=o),o}),d("change",function(){return n.onPrintTechnicalMessagesChange()}),r()()()(),a(54,"div",1)(55,"div",2)(56,"mat-icon"),s(57,"rocket_launch"),r(),a(58,"span"),s(59,"Mission Control"),r()(),a(60,"div",3)(61,"div",12)(62,"div",14)(63,"span",10),s(64,"Side-by-side thread preview"),r(),a(65,"span",15),s(66,"Click a mission card to open a preview panel. Recommended for large screens."),r()(),a(67,"mat-slide-toggle",13),h("ngModelChange",function(o){return m(n.missionPreviewEnabled,o)||(n.missionPreviewEnabled=o),o}),d("change",function(){return n.onMissionPreviewEnabledChange()}),r()()()(),a(68,"div",1)(69,"div",2)(70,"mat-icon"),s(71,"notifications"),r(),a(72,"span"),s(73,"Notifications"),r()(),a(74,"div",3)(75,"div",12)(76,"span",10),s(77,"Notify when the agent answers or requests input"),r(),a(78,"mat-slide-toggle",13),h("ngModelChange",function(o){return m(n.agentNotificationEnabled,o)||(n.agentNotificationEnabled=o),o}),d("change",function(){return n.onAgentNotificationEnabledChange()}),r()()(),a(79,"div",3)(80,"div",12)(81,"span",10),s(82,"Notification sound"),r(),a(83,"mat-slide-toggle",16),h("ngModelChange",function(o){return m(n.notificationSoundEnabled,o)||(n.notificationSoundEnabled=o),o}),d("change",function(){return n.onNotificationSoundEnabledChange()}),r()()(),a(84,"div",3)(85,"div",12)(86,"span",10),s(87,"Browser notification"),r(),a(88,"mat-slide-toggle",16),h("ngModelChange",function(o){return m(n.browserNotificationEnabled,o)||(n.browserNotificationEnabled=o),o}),d("change",function(){return n.onBrowserNotificationEnabledChange()}),r()(),T(89,it,5,0,"div",17),r()(),a(90,"div",1)(91,"div",2)(92,"mat-icon"),s(93,"record_voice_over"),r(),a(94,"span"),s(95,"Voice & Speech"),r()(),a(96,"div",3)(97,"label",18),s(98,"Voice input method:"),r(),a(99,"select",19),d("change",function(o){return n.onVoiceInputModeChange(o)}),a(100,"option",20),s(101,"Browser (real-time)"),r(),a(102,"option",21),s(103,"Whisper (higher accuracy)"),r(),a(104,"option",22),s(105,"Voice message (send audio)"),r()()(),a(106,"div",3)(107,"label",23),s(108,"Voice recognition language:"),r(),a(109,"select",24),h("ngModelChange",function(o){return m(n.selectedVoiceLanguage,o)||(n.selectedVoiceLanguage=o),o}),d("change",function(){return n.onVoiceLanguageChange()}),$(110,ot,2,3,"option",25,tt),r()(),a(112,"div",3)(113,"span",10),s(114,"Automatic announcement:"),r(),a(115,"div",4)(116,"label",5)(117,"input",26),h("ngModelChange",function(o){return m(n.voiceAnnounceEnabled,o)||(n.voiceAnnounceEnabled=o),o}),d("change",function(){return n.onVoiceAnnounceEnabledChange()}),r(),f(118,"span",7),s(119," Enabled "),r(),a(120,"label",5)(121,"input",26),h("ngModelChange",function(o){return m(n.voiceAnnounceEnabled,o)||(n.voiceAnnounceEnabled=o),o}),d("change",function(){return n.onVoiceAnnounceEnabledChange()}),r(),f(122,"span",7),s(123," Disabled "),r()()(),a(124,"div",3)(125,"span",10),s(126,"Voice mode:"),r(),a(127,"div",4)(128,"label",5)(129,"input",27),h("ngModelChange",function(o){return m(n.voiceMode,o)||(n.voiceMode=o),o}),d("change",function(){return n.onVoiceModeChange()}),r(),f(130,"span",7),s(131," Voice synthesis "),r(),a(132,"label",5)(133,"input",28),h("ngModelChange",function(o){return m(n.voiceMode,o)||(n.voiceMode=o),o}),d("change",function(){return n.onVoiceModeChange()}),r(),f(134,"span",7),s(135," Sound notification "),r()()(),a(136,"div",3)(137,"span",10),s(138,"Message reading:"),r(),a(139,"div",4)(140,"label",5)(141,"input",29),h("ngModelChange",function(o){return m(n.voiceReadFullText,o)||(n.voiceReadFullText=o),o}),d("change",function(){return n.onVoiceReadFullTextChange()}),r(),f(142,"span",7),s(143," Full message "),r(),a(144,"label",5)(145,"input",29),h("ngModelChange",function(o){return m(n.voiceReadFullText,o)||(n.voiceReadFullText=o),o}),d("change",function(){return n.onVoiceReadFullTextChange()}),r(),f(146,"span",7),s(147," First paragraphs only "),r()()(),a(148,"div",3)(149,"label",30),s(150,"Selected voice:"),r(),a(151,"select",31),h("ngModelChange",function(o){return m(n.selectedVoiceId,o)||(n.selectedVoiceId=o),o}),d("change",function(){return n.onSelectedVoiceChange()}),T(152,rt,2,0,"option",32),T(153,at,2,0,"option",32),$(154,st,2,2,"option",25,nt),r(),f(156,"div",10),a(157,"a",33),d("click",function(){return n.testVoice()}),a(158,"span",34),s(159,"Test voice"),r()()(),a(160,"div",3)(161,"label",35),s(162),r(),a(163,"input",36),h("ngModelChange",function(o){return m(n.voiceVolume,o)||(n.voiceVolume=o),o}),d("input",function(){return n.onVoiceVolumeChange()}),r()(),a(164,"div",3)(165,"label",37),s(166),r(),a(167,"input",38),h("ngModelChange",function(o){return m(n.voiceRate,o)||(n.voiceRate=o),o}),d("input",function(){return n.onVoiceRateChange()}),r()()()()),t&2&&(c(10),g("ngModel",n.selectedTheme),c(4),g("ngModel",n.selectedTheme),c(4),g("ngModel",n.selectedTheme),c(14),u("value",!0),g("ngModel",n.useEnterToSend),c(4),u("value",!1),g("ngModel",n.useEnterToSend),c(7),g("ngModel",n.showTechnicalMessages),c(5),g("ngModel",n.showWarningMessages),c(5),g("ngModel",n.printTechnicalMessages),c(14),g("ngModel",n.missionPreviewEnabled),c(11),g("ngModel",n.agentNotificationEnabled),c(5),g("ngModel",n.notificationSoundEnabled),u("disabled",!n.agentNotificationEnabled),c(5),g("ngModel",n.browserNotificationEnabled),u("disabled",!n.agentNotificationEnabled||n.browserNotificationDenied),c(),w(n.browserNotificationDenied?89:-1),c(10),u("value",n.voiceInputMode),c(10),g("ngModel",n.selectedVoiceLanguage),c(),z(n.voiceLanguageOptions),c(7),u("value",!0),g("ngModel",n.voiceAnnounceEnabled),c(4),u("value",!1),g("ngModel",n.voiceAnnounceEnabled),c(8),g("ngModel",n.voiceMode),c(4),g("ngModel",n.voiceMode),c(8),u("value",!0),g("ngModel",n.voiceReadFullText),c(4),u("value",!1),g("ngModel",n.voiceReadFullText),c(6),g("ngModel",n.selectedVoiceId),u("disabled",n.loadingVoices||n.availableVoices.length===0),c(),w(n.loadingVoices?152:-1),c(),w(!n.loadingVoices&&n.availableVoices.length===0?153:-1),c(),z(n.availableVoices),c(8),y("Volume: ",n.voiceVolume,"%"),c(),g("ngModel",n.voiceVolume),c(3),y("Speed: ",n.voiceRate,"%"),c(),g("ngModel",n.voiceRate))},dependencies:[D,Ee,Me,W,Ce,ye,Se,R,A,j,$e],styles:['.options-content[_ngcontent-%COMP%]{padding:0;width:100%}.option-group[_ngcontent-%COMP%]{padding:0 1rem 1rem;margin-bottom:1rem;border-bottom:1px solid var(--color-border-light)}.option-group[_ngcontent-%COMP%]:last-child{margin-bottom:0;padding-bottom:0;border-bottom:none}.option-label[_ngcontent-%COMP%]{display:block;margin-bottom:.5rem;font-weight:500;color:var(--color-text);font-size:.875rem}.toggle-option[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:1rem}.toggle-option[_ngcontent-%COMP%] .option-label[_ngcontent-%COMP%]{margin-bottom:0;flex:1}.toggle-option[_ngcontent-%COMP%] mat-slide-toggle[_ngcontent-%COMP%]{flex-shrink:0}.option-label-with-hint[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;flex:1}.option-label-with-hint[_ngcontent-%COMP%] .option-label[_ngcontent-%COMP%]{margin-bottom:0}.option-label-with-hint[_ngcontent-%COMP%] .option-hint[_ngcontent-%COMP%]{font-size:.775rem;color:var(--color-text-secondary);line-height:1.4}.option-select[_ngcontent-%COMP%]{width:100%;padding:.5rem;border:1px solid var(--color-border);border-radius:4px;background:var(--color-input-bg);color:var(--color-text);font-size:.875rem;cursor:pointer}.option-select[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary);box-shadow:0 0 0 3px #7064fb1a}.option-select[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.option-select[_ngcontent-%COMP%] option[_ngcontent-%COMP%]{padding:.5rem}.option-checkbox[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;font-size:.875rem;color:var(--color-text);-webkit-user-select:none;user-select:none}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{display:none}.option-checkbox[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]{width:18px;height:18px;border:2px solid var(--color-border);border-radius:3px;margin-right:.75rem;display:flex;align-items:center;justify-content:center;transition:all .2s ease;flex-shrink:0}.option-checkbox[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]:after{content:"";width:10px;height:6px;border-left:2px solid transparent;border-bottom:2px solid transparent;transform:rotate(-45deg);transition:all .2s ease;opacity:0}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + .checkmark[_ngcontent-%COMP%]{background-color:var(--color-primary);border-color:var(--color-primary)}.option-checkbox[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + .checkmark[_ngcontent-%COMP%]:after{border-left-color:#fff;border-bottom-color:#fff;opacity:1}.option-checkbox[_ngcontent-%COMP%]:hover .checkmark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-checkbox[_ngcontent-%COMP%]:focus-within .checkmark[_ngcontent-%COMP%]{box-shadow:0 0 0 3px #7064fb1a}.option-section[_ngcontent-%COMP%]{padding-top:1rem;margin-top:1rem;border-top:2px solid var(--color-border)}.option-section[_ngcontent-%COMP%]:first-child{border-top:none;padding-top:0;margin-top:0}.section-title[_ngcontent-%COMP%]{margin:0 0 1rem;padding:0 1rem;font-size:.9rem;font-weight:600;color:var(--color-text);display:flex;align-items:center;gap:.5rem}.section-title[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.option-radio[_ngcontent-%COMP%]{display:flex;align-items:center;cursor:pointer;font-size:.875rem;color:var(--color-text);-webkit-user-select:none;user-select:none}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{display:none}.option-radio[_ngcontent-%COMP%] .radio-mark[_ngcontent-%COMP%]{width:16px;height:16px;border:2px solid var(--color-border);border-radius:50%;margin-right:.5rem;display:flex;align-items:center;justify-content:center;transition:all .2s ease;flex-shrink:0;position:relative}.option-radio[_ngcontent-%COMP%] .radio-mark[_ngcontent-%COMP%]:after{content:"";width:8px;height:8px;border-radius:50%;background-color:var(--color-primary);transition:all .2s ease;opacity:0;transform:scale(0)}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + .radio-mark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-radio[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + .radio-mark[_ngcontent-%COMP%]:after{opacity:1;transform:scale(1)}.option-radio[_ngcontent-%COMP%]:hover .radio-mark[_ngcontent-%COMP%]{border-color:var(--color-primary)}.option-radio[_ngcontent-%COMP%]:focus-within .radio-mark[_ngcontent-%COMP%]{box-shadow:0 0 0 3px #7064fb1a}.option-slider[_ngcontent-%COMP%]{width:100%;height:6px;border-radius:3px;background:var(--color-bg-solid);outline:none;cursor:pointer;-webkit-appearance:none;appearance:none}.option-slider[_ngcontent-%COMP%]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;border-radius:50%;background:var(--color-primary);cursor:pointer;border:2px solid white;box-shadow:0 2px 6px #0003;transition:all .2s ease}.option-slider[_ngcontent-%COMP%]::-webkit-slider-thumb:hover{transform:scale(1.1);box-shadow:0 2px 8px #0000004d}.option-slider[_ngcontent-%COMP%]::-moz-range-thumb{width:20px;height:20px;border-radius:50%;background:var(--color-primary);cursor:pointer;border:2px solid white;box-shadow:0 2px 6px #0003;transition:all .2s ease}.option-slider[_ngcontent-%COMP%]::-moz-range-thumb:hover{transform:scale(1.1);box-shadow:0 2px 8px #0000004d}.option-slider[_ngcontent-%COMP%]::-webkit-slider-track{height:6px;border-radius:3px;background:var(--color-bg-secondary)}.option-slider[_ngcontent-%COMP%]::-moz-range-track{height:6px;border-radius:3px;background:var(--color-bg-secondary);border:none}.option-slider[_ngcontent-%COMP%]:focus{outline:none}.option-slider[_ngcontent-%COMP%]:focus::-webkit-slider-thumb{box-shadow:0 0 0 3px #7064fb4d,0 2px 6px #0003}.option-slider[_ngcontent-%COMP%]:focus::-moz-range-thumb{box-shadow:0 0 0 3px #7064fb4d,0 2px 6px #0003}.test-voice-btn[_ngcontent-%COMP%]{width:100%;padding:.75rem 1rem;background:var(--color-primary);color:#fff;border:none;border-radius:6px;font-size:.875rem;font-weight:500;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;justify-content:center;gap:.5rem}.test-voice-btn[_ngcontent-%COMP%]:hover{background:var(--color-primary-hover);transform:translateY(-1px);box-shadow:0 2px 8px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:active{transform:translateY(0);box-shadow:0 1px 4px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:focus{outline:none;box-shadow:0 0 0 3px #7064fb4d}.test-voice-btn[_ngcontent-%COMP%]:disabled{background:var(--color-bg-secondary);color:var(--color-text-secondary);cursor:not-allowed;transform:none;box-shadow:none}.test-voice-link[_ngcontent-%COMP%]{text-decoration-thickness:1.5px;text-underline-offset:3px;background:transparent;border:none;padding:0;font-size:.775rem;font-weight:400;cursor:pointer;transition:all .2s ease;display:inline-flex;align-items:center;justify-content:center;gap:.5rem;text-decoration:underline}.test-voice-link[_ngcontent-%COMP%]:hover{color:var(--color-primary-hover, var(--color-primary));text-decoration-thickness:2px}.test-voice-link[_ngcontent-%COMP%]:active{opacity:.8}.test-voice-link[_ngcontent-%COMP%]:focus{outline:2px solid var(--color-primary);outline-offset:2px}.test-voice-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.notification-error[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem;padding:.75rem;margin-top:.75rem;background-color:#d32f2f1a;border:1px solid rgba(211,47,47,.3);border-radius:6px;font-size:.8125rem;line-height:1.5}.notification-error[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{color:#d32f2f;font-size:20px;width:20px;height:20px;flex-shrink:0;margin-top:2px}.notification-error[_ngcontent-%COMP%] .error-message[_ngcontent-%COMP%]{color:var(--color-text);flex:1}.notification-error[_ngcontent-%COMP%]{margin-top:.75rem;padding:.75rem;background-color:#f443361a;border:1px solid rgba(244,67,54,.3);border-radius:6px;display:flex;align-items:flex-start;gap:.5rem}.notification-error[_ngcontent-%COMP%] .error-icon[_ngcontent-%COMP%]{color:#f44336;font-size:20px;width:20px;height:20px;flex-shrink:0;margin-top:2px}.notification-error[_ngcontent-%COMP%] .error-message[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-text);line-height:1.5;flex:1}']})};var Ye=class l{destroy$=new C;currentProject=null;currentThread=null;messagesSubject=new b([]);isThinkingSubject=new b(!1);currentChoiceSubject=new b(null);projectTitleSubject=new b("Coday");currentInviteEventSubject=new b(null);messageToRestoreSubject=new b("");threadUpdateEventSubject=new b(null);currentChoiceEvent=null;thinkingTimeout=null;accumulatedChunks="";streamingTextSubject=new b("");subThreadEventsSubject=new C;subThreadEvents$=this.subThreadEventsSubject.asObservable();subThreadEventBuffers=new Map;getBufferedSubThreadEvents(e){return this.subThreadEventBuffers.get(e)??[]}messages$=this.messagesSubject.asObservable();streamingText$=this.streamingTextSubject.asObservable();isThinking$=this.isThinkingSubject.asObservable();currentChoice$=this.currentChoiceSubject.asObservable();currentInviteEvent$=this.currentInviteEventSubject.asObservable();messageToRestore$=this.messageToRestoreSubject.asObservable();threadUpdateEvent$=this.threadUpdateEventSubject.asObservable();connectionStatus$;tabTitleService=null;eventStream=v(ze);messageApi=v(Ue);userService=v(be);constructor(){this.connectionStatus$=this.eventStream.connectionStatus$,this.initializeEventHandling()}setTabTitleService(e){this.tabTitleService=e}connectToThread(e,t){this.currentProject=e,this.currentThread=t,this.eventStream.connectToThread(e,t)}loadHistoryFromRest(e){for(let t of e){let n=Be(t);n&&this.handleEvent(n)}}resetMessages(){this.messagesSubject.next([]),this.currentChoiceSubject.next(null),this.currentInviteEventSubject.next(null),this.currentChoiceEvent=null,this.accumulatedChunks="",this.streamingTextSubject.next(""),this.subThreadEventBuffers.clear(),this.stopThinking()}sendMessage(e){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send message: no project or thread selected");return}let t=this.currentInviteEventSubject.value;if(t){this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive(),this.currentInviteEventSubject.next(null);let n=t.buildAnswer(e);this.messageApi.sendMessage(n).subscribe({error:i=>{console.error("[CODAY] Send invite answer error:",i),this.currentInviteEventSubject.next(t),this.stopThinking()}})}else this.messageApi.sendFreeMessage(e).subscribe({error:n=>{console.error("[CODAY] Send error:",n)}})}sendChoice(e){if(!this.currentProject||!this.currentThread){console.error("[CODAY] Cannot send choice: no project or thread selected");return}if(this.currentChoiceEvent){this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive();let t=this.currentChoiceEvent.buildAnswer(e);this.currentChoiceSubject.next(null),this.currentChoiceEvent=null,this.messageApi.sendMessage(t).subscribe({next:()=>{},error:n=>{console.error("[CODAY-CHOICE] Choice error:",n),this.stopThinking()}})}else console.error("[CODAY-CHOICE] No choice event available for choice:",e)}deleteMessage(e){let t=this.messagesSubject.value.find(i=>i.id===e),n=this.extractTextContentFromMessage(t);return this.messageApi.deleteMessage(e).pipe(J(i=>{i.success&&(this.removeMessagesFromIndex(e),n.trim()&&this.messageToRestoreSubject.next(n))}))}getCurrentProjectTitle(){return this.projectTitleSubject.value}getCurrentInviteEvent(){return this.currentInviteEventSubject.value}setThinkingForPendingMessage(){this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive()}initializeEventHandling(){this.eventStream.events$.pipe(p(this.destroy$)).subscribe({next:e=>this.handleEvent(e),error:e=>console.error("[CODAY] Event stream error:",e),complete:()=>console.log("[CODAY] Event stream completed")})}handleEvent(e){if(e.threadId&&e.threadId!==this.currentThread){let t=this.subThreadEventBuffers.get(e.threadId);t?t.push(e):this.subThreadEventBuffers.set(e.threadId,[e]),this.subThreadEventsSubject.next(e);return}e instanceof Re?this.handleMessageEvent(e):e instanceof ke?this.handleTextChunkEvent(e):e instanceof xe?this.handleTextEvent(e):e instanceof Pe?this.handleAnswerEvent(e):e instanceof Ie?this.handleErrorEvent(e):e instanceof Ve?this.handleWarnEvent(e):e instanceof U?this.handleThinkingEvent(e):e instanceof je?this.handleToolRequestEvent(e):e instanceof We?this.handleToolResponseEvent(e):e instanceof Ne?this.handleChoiceEvent(e):e instanceof Te?this.handleHeartBeatEvent(e):e instanceof we?this.handleInviteEvent(e):e instanceof Ae?this.handleThreadUpdateEvent(e):e instanceof Fe?this.handleDelegationEvent(e):e instanceof De||e instanceof Le||console.warn("[CODAY] Unhandled event type:",e.type)}handleDelegationEvent(e){if(console.log("[CODAY] DelegationEvent received:",e.subThreadId,e.agentName),this.messagesSubject.value.findIndex(i=>i.subThreadId===e.subThreadId)===-1){let i={id:e.timestamp,role:"system",speaker:e.agentName,content:[{type:"text",content:""}],timestamp:new Date,type:"delegation",subThreadId:e.subThreadId,delegationAgentName:e.agentName};this.addMessage(i)}}handleThreadUpdateEvent(e){this.threadUpdateEventSubject.next(e)}handleMessageEvent(e){e.role==="assistant"&&this.accumulatedChunks&&(this.accumulatedChunks="",this.streamingTextSubject.next(""));let t={id:e.timestamp,role:e.role,speaker:e.name,content:e.content,timestamp:e.date,type:"text"};this.addMessage(t)}handleTextChunkEvent(e){this.accumulatedChunks+=e.chunk,this.streamingTextSubject.next(this.accumulatedChunks)}handleTextEvent(e){let t={id:e.timestamp,role:e.speaker?"assistant":"system",speaker:e.speaker??"System",content:[{type:"text",content:e.text}],timestamp:e.date,type:e.speaker?"text":"technical"};this.addMessage(t)}handleAnswerEvent(e){let t=this.currentInviteEventSubject.value;if(t){let i=!!e.parentKey&&e.parentKey===t.timestamp,o=!e.parentKey&&e.date>=t.date;(i||o)&&this.currentInviteEventSubject.next(null)}if(e.silent)return;let n={id:e.timestamp,role:"user",speaker:e.name??this.userService.getUsername()??"User",content:[{type:"text",content:e.answer}],timestamp:e.date,type:"text",parentKey:e.parentKey,invite:e.invite};this.addMessage(n)}handleErrorEvent(e){let t={id:e.timestamp,role:"system",speaker:"System",content:[{type:"text",content:`Error: ${JSON.stringify(e.error)}`}],timestamp:e.date,type:"error"};this.addMessage(t)}handleWarnEvent(e){let t={id:e.timestamp,role:"system",speaker:"System",content:[{type:"text",content:`Warning: ${JSON.stringify(e.warning)}`}],timestamp:e.date,type:"warning"};this.addMessage(t)}handleThinkingEvent(e){this.currentInviteEventSubject.value||this.currentChoiceEvent||(this.clearThinkingTimeout(),this.isThinkingSubject.next(!0),this.tabTitleService?.setSystemActive(),this.thinkingTimeout=setTimeout(()=>{this.isThinkingSubject.next(!1),this.thinkingTimeout=null,this.tabTitleService?.setSystemInactive()},U.debounce+1e3))}handleToolRequestEvent(e){let t={id:e.timestamp,role:"system",speaker:"System",content:[{type:"text",content:e.toSingleLineString()}],timestamp:e.date,type:"technical",eventId:e.timestamp};this.addMessage(t)}handleToolResponseEvent(e){let t={id:e.timestamp,role:"system",speaker:"System",content:[{type:"text",content:e.toSingleLineString()}],timestamp:e.date,type:"technical",eventId:e.timestamp};this.addMessage(t)}handleChoiceEvent(e){this.stopThinking(),this.currentChoiceEvent=e,this.tabTitleService?.setSystemInactive();let t=e.options.map(i=>({value:i,label:i})),n=e.optionalQuestion?`${e.optionalQuestion} ${e.invite}`:e.invite;this.currentChoiceSubject.next({options:t,label:n,allowFreeText:e.allowFreeText})}handleHeartBeatEvent(e){}handleInviteEvent(e){if(this.stopThinking(),e.invite===Oe)this.currentInviteEventSubject.next(e),this.tabTitleService?.setSystemInactive();else{let n={id:e.timestamp,role:"assistant",speaker:"Assistant",content:[{type:"text",content:e.invite}],timestamp:e.date,type:"text"};this.addMessage(n),this.messagesSubject.value.some(_=>_.parentKey===e.timestamp||_.role==="user"&&_.timestamp>e.date||_.role==="assistant"&&_.timestamp>e.date)||(this.currentInviteEventSubject.next(e),this.tabTitleService?.setSystemInactive())}}addMessage(e){let t=this.messagesSubject.value;t.some(n=>n.id===e.id)||this.messagesSubject.next([...t,e])}removeMessagesFromIndex(e){let t=this.messagesSubject.value,n=t.findIndex(o=>o.id===e);if(n===-1||n===0)return;let i=t.slice(0,n);this.messagesSubject.next(i),this.stopThinking()}extractTextContentFromMessage(e){return e?e.content.filter(t=>t.type==="text").map(t=>t.content).join(`
5
+
6
+ `):""}clearThinkingTimeout(){this.thinkingTimeout&&(clearTimeout(this.thinkingTimeout),this.thinkingTimeout=null)}stopThinking(){this.clearThinkingTimeout(),this.isThinkingSubject.next(!1),this.tabTitleService&&this.tabTitleService.setSystemInactive()}ngOnDestroy(){this.clearThinkingTimeout(),this.destroy$.next(),this.destroy$.complete(),this.currentInviteEventSubject.complete(),this.messageToRestoreSubject.complete(),this.threadUpdateEventSubject.complete(),this.streamingTextSubject.complete(),this.eventStream.disconnect()}static \u0275fac=function(t){return new(t||l)};static \u0275prov=P({token:l,factory:l.\u0275fac,providedIn:"root"})};function ct(l,e){if(l&1&&(a(0,"div",3),s(1),r()),l&2){let t=k();c(),y("\u274C ",t.errorMessage)}}var Ke=class l{dialogRef=v(pe);data=v(ge);jsonContent;errorMessage="";title;constructor(){this.jsonContent=this.data.initialContent,this.title=this.data.title||this.getDefaultTitle(this.data.configType,this.data.projectName)}getDefaultTitle(e,t){return e==="user"?"User Configuration":`Project Configuration: ${t||"Unknown"}`}onSave(){this.errorMessage="";let e;try{e=JSON.parse(this.jsonContent)}catch(t){this.errorMessage=`Invalid JSON syntax: ${t instanceof Error?t.message:"Unknown error"}`;return}this.dialogRef.close(e)}onCancel(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||l)};static \u0275cmp=E({type:l,selectors:[["app-json-editor"]],decls:13,vars:3,consts:[["mat-dialog-title",""],["mat-icon-button","","title","Close",1,"close-button",3,"click"],["spellcheck","false","placeholder","Enter JSON configuration...",1,"json-textarea",3,"ngModelChange","ngModel"],[1,"error-message"],["align","end"],["matButton","",3,"click"],["matButton","filled","color","primary",3,"click"]],template:function(t,n){t&1&&(a(0,"div",0),s(1),a(2,"button",1),d("click",function(){return n.onCancel()}),a(3,"mat-icon"),s(4,"close"),r()()(),a(5,"mat-dialog-content")(6,"textarea",2),h("ngModelChange",function(o){return m(n.jsonContent,o)||(n.jsonContent=o),o}),r(),T(7,ct,2,1,"div",3),r(),a(8,"mat-dialog-actions",4)(9,"button",5),d("click",function(){return n.onCancel()}),s(10,"Cancel"),r(),a(11,"button",6),d("click",function(){return n.onSave()}),s(12,"Save"),r()()),t&2&&(c(),y(" ",n.title," "),c(5),g("ngModel",n.jsonContent),c(),w(n.errorMessage?7:-1))},dependencies:[ce,D,W,R,A,j,ve,fe,me,he,ue],styles:["[mat-dialog-title][_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}[mat-dialog-title][_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]{margin-left:auto}mat-dialog-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;min-height:400px}.json-textarea[_ngcontent-%COMP%]{flex:1;min-height:300px;max-height:80vh;padding:1rem;font-family:Monaco,Menlo,Ubuntu Mono,Consolas,monospace;font-size:.875rem;line-height:1.5;background:var(--color-code-bg);color:var(--color-text);border:1px solid var(--color-border);border-radius:4px;resize:vertical;outline:none;transition:border-color .2s}.json-textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary)}.json-textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);opacity:.6}.error-message[_ngcontent-%COMP%]{padding:.75rem 1rem;border-radius:4px;font-size:.875rem;line-height:1.4;background:#dc26261a;color:#dc2626;border:1px solid rgba(220,38,38,.3)}"]})};export{St as a,Ct as b,L as c,Je as d,Ye as e,Ke as f};
@@ -1 +1 @@
1
- import{l as m}from"./chunk-BCOH5IGB.js";import{Z as l,a as p,ca as n}from"./chunk-KJ5SIUGY.js";var s=class e{promptController=n(m);getById(r){return this.promptController.getByIdPrompt(r)}listPlatform(){return this.promptController.searchPrompt({namespaceId:null,userId:null})}listByNamespace(r){return this.promptController.searchPrompt({namespaceId:r,userId:null})}create(r){return this.promptController.createPrompt(r)}update(r,t){return this.promptController.updatePrompt(r,t)}delete(r){return this.promptController.deletePrompt(r)}listEffective(r,t,o){return this.promptController.effectivePrompt(p({namespaceId:r,userId:t},o?{agentConfigId:o}:{}))}static \u0275fac=function(t){return new(t||e)};static \u0275prov=l({token:e,factory:e.\u0275fac,providedIn:"root"})};export{s as a};
1
+ import{l as m}from"./chunk-ZAMAK546.js";import{Z as l,a as p,ca as n}from"./chunk-KJ5SIUGY.js";var s=class e{promptController=n(m);getById(r){return this.promptController.getByIdPrompt(r)}listPlatform(){return this.promptController.searchPrompt({namespaceId:null,userId:null})}listByNamespace(r){return this.promptController.searchPrompt({namespaceId:r,userId:null})}create(r){return this.promptController.createPrompt(r)}update(r,t){return this.promptController.updatePrompt(r,t)}delete(r){return this.promptController.deletePrompt(r)}listEffective(r,t,o){return this.promptController.effectivePrompt(p({namespaceId:r,userId:t},o?{agentConfigId:o}:{}))}static \u0275fac=function(t){return new(t||e)};static \u0275prov=l({token:e,factory:e.\u0275fac,providedIn:"root"})};export{s as a};
@@ -1 +1 @@
1
- import{a as G}from"./chunk-AIC4U2MU.js";import{a as V}from"./chunk-KRZMF2CT.js";import{a as B}from"./chunk-QS5AU6X7.js";import{a as K}from"./chunk-OWANJEQU.js";import"./chunk-F4DLZWDY.js";import"./chunk-7WF5A3H7.js";import"./chunk-BCOH5IGB.js";import{a as D,c as $}from"./chunk-MZT6I3S3.js";import{r as P,y as L}from"./chunk-N347WQAU.js";import"./chunk-MWPKXBXJ.js";import"./chunk-7EDSHFWH.js";import{a as c}from"./chunk-3ZLLFAXF.js";import"./chunk-Q2M4W42M.js";import"./chunk-DDWYQORF.js";import"./chunk-B46LXCLF.js";import{Bb as A,Db as g,Fb as s,Ka as C,Kc as N,Pb as x,S as y,Tb as E,Ub as w,Wa as v,ab as R,ca as r,cc as O,fc as M,ga as l,gc as T,ha as m,jc as q,lb as b,m as _,ma as I,mb as S,rb as f,sb as p,t as u,ta as h,tb as d}from"./chunk-KJ5SIUGY.js";var z=()=>[];function W(o,e){if(o&1&&(p(0,"p",3),E(1),d()),o&2){let t=s().$implicit;C(),w(t.name)}}function U(o,e){if(o&1){let t=A();p(0,"agentos-integration-config-item",5),g("editRequested",function(){let i=l(t),a=s(2);return m(a.onEdit(i))})("deleteRequested",function(){let i=l(t),a=s(2);return m(a.onDelete(i))})("duplicateRequested",function(){let i=l(t),a=s(2);return m(a.onDuplicate(i))}),d()}if(o&2){let t=e,n=s(2);f("config",t.config)("scope",t.scope)("readOnly",t.scope==="platform"||t.scope==="namespace"&&!n.isAdmin())}}function X(o,e){if(o&1&&b(0,W,2,1,"p",3)(1,U,1,3,"agentos-integration-config-item",4),o&2){let t,n=e.$implicit,i=s();S(i.isEmptyPlaceholder(n.id)?0:(t=i.resolve(n.id))?1:-1,t)}}var k=Object.freeze({platform:"Configurations plateforme",namespace:"Configurations du namespace",userOnNs:"Mes overrides sur ce namespace",userGlobal:"Mes overrides globaux"}),F="__empty__",j=class o{route=r(D);router=r($);destroyRef=r(I);state=r(V);namespaceRole=r(K);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=h(!1);listItems$=this.state.vm$.pipe(u(e=>this.toListItems(e)));resolved=new Map;ngOnInit(){this.route.paramMap.pipe(c(this.destroyRef)).subscribe(e=>{let t=e.get("namespaceId")??"";t&&t!==this.namespaceId&&(this.namespaceId=t),this.state.setNamespace(t)}),this.route.paramMap.pipe(u(e=>e.get("namespaceId")??""),y(e=>e?this.namespaceRole.isAdminOfNamespace$(e):_(!1)),c(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(c(this.destroyRef)).subscribe(e=>{let t=new Map;e.platform.forEach(n=>{n.id&&t.set(this.itemKey("platform",n.id),{config:n,scope:"platform"})}),e.namespace.forEach(n=>{n.id&&t.set(this.itemKey("namespace",n.id),{config:n,scope:"namespace"})}),e.userOnNs.forEach(n=>{n.id&&t.set(this.itemKey("userOnNs",n.id),{config:n,scope:"userOnNs"})}),e.userGlobal.forEach(n=>{n.id&&t.set(this.itemKey("userGlobal",n.id),{config:n,scope:"userGlobal"})}),this.resolved=t})}isEmptyPlaceholder(e){return e.startsWith(F)}resolve(e){return this.resolved.get(e)??null}itemKey(e,t){return`${e}:${t}`}goBack(){this.router.navigate(["/agentos","namespaces"])}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"integrations","new"],{queryParams:{scope:G(this.isAdmin())}})}onEdit(e){let t=e.config.id??"";this.router.navigate(["/agentos",this.namespaceId,"integrations",t,"edit"],{queryParams:{scope:e.scope}})}onDelete(e){let t=e.config.id;t&&this.state.delete(t,e.scope).pipe(c(this.destroyRef)).subscribe({error:n=>{console.error(`[IntegrationsAllScopes] Delete failed for ${e.scope}:${t}:`,n)}})}onDuplicate(e){if(!e.config.id)return;let n=(e.scope==="namespace"||e.scope==="platform")&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"integrations","new"],{queryParams:{scope:n,template:e.config.id,templateScope:e.scope}})}toListItems(e){let t=[];return t.push(...this.sectionItems("platform",e.platform)),t.push(...this.sectionItems("namespace",e.namespace)),t.push(...this.sectionItems("userOnNs",e.userOnNs)),t.push(...this.sectionItems("userGlobal",e.userGlobal)),t}sectionItems(e,t){return t.length===0?[{id:`${F}${e}`,name:"Aucune configuration",groupKey:e,groupLabel:k[e]}]:t.filter(n=>!!n.id).map(n=>({id:this.itemKey(e,n.id),name:n.name,description:n.integrationType,groupKey:e,groupLabel:k[e]}))}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=v({type:o,selectors:[["agentos-integrations-all-scopes"]],decls:5,vars:6,consts:[["integrationItemTpl",""],["title","Integrations","emptyMessage","No integrations available.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[1,"integrations-all-scopes__empty"],[3,"config","scope","readOnly"],[3,"editRequested","deleteRequested","duplicateRequested","config","scope","readOnly"]],template:function(t,n){if(t&1&&(p(0,"ds-entity-list",1),M(1,"async"),g("createRequested",function(){return n.openCreateForm()}),p(2,"ds-icon-button",2),g("action",function(){return n.goBack()}),d()(),R(3,X,2,1,"ng-template",null,0,q)),t&2){let i=x(4);f("items",T(1,3,n.listItems$)??O(5,z))("showCreate",!0)("itemTemplate",i)}},dependencies:[L,B,P,N],styles:[".integrations-all-scopes__empty[_ngcontent-%COMP%]{margin:0;padding:.65rem 1rem;font-size:.85rem;font-style:italic;color:var(--color-text-secondary)}"],changeDetection:0})};export{j as IntegrationsAllScopesComponent};
1
+ import{a as G}from"./chunk-AIC4U2MU.js";import{a as V}from"./chunk-SW3MVXR5.js";import{a as B}from"./chunk-L7EWDR3X.js";import{a as K}from"./chunk-2OC3IQX4.js";import"./chunk-F4DLZWDY.js";import"./chunk-DEI4EULW.js";import"./chunk-ZAMAK546.js";import{a as D,c as $}from"./chunk-MZT6I3S3.js";import{s as P,z as L}from"./chunk-C2J4TQ7V.js";import"./chunk-MWPKXBXJ.js";import"./chunk-7EDSHFWH.js";import{a as c}from"./chunk-3ZLLFAXF.js";import"./chunk-Q2M4W42M.js";import"./chunk-DDWYQORF.js";import"./chunk-B46LXCLF.js";import{Bb as A,Db as g,Fb as s,Ka as C,Kc as N,Pb as x,S as y,Tb as E,Ub as w,Wa as v,ab as R,ca as r,cc as O,fc as M,ga as l,gc as T,ha as m,jc as q,lb as b,m as _,ma as I,mb as S,rb as f,sb as p,t as u,ta as h,tb as d}from"./chunk-KJ5SIUGY.js";var z=()=>[];function W(o,e){if(o&1&&(p(0,"p",3),E(1),d()),o&2){let t=s().$implicit;C(),w(t.name)}}function U(o,e){if(o&1){let t=A();p(0,"agentos-integration-config-item",5),g("editRequested",function(){let i=l(t),a=s(2);return m(a.onEdit(i))})("deleteRequested",function(){let i=l(t),a=s(2);return m(a.onDelete(i))})("duplicateRequested",function(){let i=l(t),a=s(2);return m(a.onDuplicate(i))}),d()}if(o&2){let t=e,n=s(2);f("config",t.config)("scope",t.scope)("readOnly",t.scope==="platform"||t.scope==="namespace"&&!n.isAdmin())}}function X(o,e){if(o&1&&b(0,W,2,1,"p",3)(1,U,1,3,"agentos-integration-config-item",4),o&2){let t,n=e.$implicit,i=s();S(i.isEmptyPlaceholder(n.id)?0:(t=i.resolve(n.id))?1:-1,t)}}var k=Object.freeze({platform:"Configurations plateforme",namespace:"Configurations du namespace",userOnNs:"Mes overrides sur ce namespace",userGlobal:"Mes overrides globaux"}),F="__empty__",j=class o{route=r(D);router=r($);destroyRef=r(I);state=r(V);namespaceRole=r(K);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=h(!1);listItems$=this.state.vm$.pipe(u(e=>this.toListItems(e)));resolved=new Map;ngOnInit(){this.route.paramMap.pipe(c(this.destroyRef)).subscribe(e=>{let t=e.get("namespaceId")??"";t&&t!==this.namespaceId&&(this.namespaceId=t),this.state.setNamespace(t)}),this.route.paramMap.pipe(u(e=>e.get("namespaceId")??""),y(e=>e?this.namespaceRole.isAdminOfNamespace$(e):_(!1)),c(this.destroyRef)).subscribe(e=>this.isAdmin.set(e)),this.state.vm$.pipe(c(this.destroyRef)).subscribe(e=>{let t=new Map;e.platform.forEach(n=>{n.id&&t.set(this.itemKey("platform",n.id),{config:n,scope:"platform"})}),e.namespace.forEach(n=>{n.id&&t.set(this.itemKey("namespace",n.id),{config:n,scope:"namespace"})}),e.userOnNs.forEach(n=>{n.id&&t.set(this.itemKey("userOnNs",n.id),{config:n,scope:"userOnNs"})}),e.userGlobal.forEach(n=>{n.id&&t.set(this.itemKey("userGlobal",n.id),{config:n,scope:"userGlobal"})}),this.resolved=t})}isEmptyPlaceholder(e){return e.startsWith(F)}resolve(e){return this.resolved.get(e)??null}itemKey(e,t){return`${e}:${t}`}goBack(){this.router.navigate(["/agentos","namespaces"])}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"integrations","new"],{queryParams:{scope:G(this.isAdmin())}})}onEdit(e){let t=e.config.id??"";this.router.navigate(["/agentos",this.namespaceId,"integrations",t,"edit"],{queryParams:{scope:e.scope}})}onDelete(e){let t=e.config.id;t&&this.state.delete(t,e.scope).pipe(c(this.destroyRef)).subscribe({error:n=>{console.error(`[IntegrationsAllScopes] Delete failed for ${e.scope}:${t}:`,n)}})}onDuplicate(e){if(!e.config.id)return;let n=(e.scope==="namespace"||e.scope==="platform")&&!this.isAdmin()?"userOnNs":e.scope;this.router.navigate(["/agentos",this.namespaceId,"integrations","new"],{queryParams:{scope:n,template:e.config.id,templateScope:e.scope}})}toListItems(e){let t=[];return t.push(...this.sectionItems("platform",e.platform)),t.push(...this.sectionItems("namespace",e.namespace)),t.push(...this.sectionItems("userOnNs",e.userOnNs)),t.push(...this.sectionItems("userGlobal",e.userGlobal)),t}sectionItems(e,t){return t.length===0?[{id:`${F}${e}`,name:"Aucune configuration",groupKey:e,groupLabel:k[e]}]:t.filter(n=>!!n.id).map(n=>({id:this.itemKey(e,n.id),name:n.name,description:n.integrationType,groupKey:e,groupLabel:k[e]}))}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=v({type:o,selectors:[["agentos-integrations-all-scopes"]],decls:5,vars:6,consts:[["integrationItemTpl",""],["title","Integrations","emptyMessage","No integrations available.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[1,"integrations-all-scopes__empty"],[3,"config","scope","readOnly"],[3,"editRequested","deleteRequested","duplicateRequested","config","scope","readOnly"]],template:function(t,n){if(t&1&&(p(0,"ds-entity-list",1),M(1,"async"),g("createRequested",function(){return n.openCreateForm()}),p(2,"ds-icon-button",2),g("action",function(){return n.goBack()}),d()(),R(3,X,2,1,"ng-template",null,0,q)),t&2){let i=x(4);f("items",T(1,3,n.listItems$)??O(5,z))("showCreate",!0)("itemTemplate",i)}},dependencies:[L,B,P,N],styles:[".integrations-all-scopes__empty[_ngcontent-%COMP%]{margin:0;padding:.65rem 1rem;font-size:.85rem;font-style:italic;color:var(--color-text-secondary)}"],changeDetection:0})};export{j as IntegrationsAllScopesComponent};
@@ -1 +1 @@
1
- import{a as X}from"./chunk-KRZMF2CT.js";import{a as Z}from"./chunk-OWANJEQU.js";import"./chunk-F4DLZWDY.js";import"./chunk-7WF5A3H7.js";import{h as B}from"./chunk-BCOH5IGB.js";import{a as D,c as L}from"./chunk-MZT6I3S3.js";import{u as W}from"./chunk-N347WQAU.js";import"./chunk-MWPKXBXJ.js";import"./chunk-7EDSHFWH.js";import{a as b,c as I}from"./chunk-3ZLLFAXF.js";import"./chunk-Q2M4W42M.js";import{F as Q,c as A,e as M,g as z,h as G,i as j,l as C,n as q,p as $,s as U,w as J,x as Y,y as H,z as K}from"./chunk-DDWYQORF.js";import"./chunk-B46LXCLF.js";import{Bb as x,Db as u,Fb as m,Ka as a,Tb as l,Ub as S,Vb as T,Wa as N,ca as d,ga as f,ha as _,kb as P,lb as h,m as w,ma as V,mb as y,mc as R,pb as k,qb as E,rb as c,sb as i,ta as g,tb as o,ua as F,ub as v}from"./chunk-KJ5SIUGY.js";function te(r,t){r&1&&(i(0,"p",5),l(1,"Loading\u2026"),o())}function ne(r,t){if(r&1&&(i(0,"label",10),v(1,"input",26),i(2,"span"),l(3),o()()),r&2){let e=t.$implicit,n=m(2);a(),c("value",e.value)("formControl",n.scopeControl)("disabled",e.value==="namespace"&&!n.isAdmin()),a(2),S(e.label)}}function oe(r,t){if(r&1&&(i(0,"option",16),l(1),o()),r&2){let e=t.$implicit;c("value",e.type),a(),S(e.displayName)}}function ie(r,t){if(r&1){let e=x();i(0,"div",21)(1,"ds-json-schema-form",27),u("valueChange",function(s){f(e);let p=m(2);return _(p.onParamsChange(s))}),o()()}if(r&2){let e=m(2);a(),c("schema",t)("value",e.initialParams())}}function re(r,t){if(r&1){let e=x();i(0,"button",28),u("click",function(){f(e);let s=m(2);return _(s.exportYaml())}),l(1),o()}if(r&2){let e=m(2);c("disabled",e.isExporting()),a(),T(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ")}}function ae(r,t){if(r&1){let e=x();i(0,"form",7),u("ngSubmit",function(){f(e);let s=m();return _(s.submit())}),i(1,"fieldset",8)(2,"legend",9),l(3,"Scope"),o(),k(4,ne,4,4,"label",10,P().trackByScope,!0),o(),i(6,"div",11)(7,"label",12),l(8,"Type "),i(9,"span",13),l(10,"*"),o()(),i(11,"select",14)(12,"option",15),l(13,"Select type"),o(),k(14,oe,2,2,"option",16,P().trackByType,!0),o()(),i(16,"div",11)(17,"label",17),l(18,"Name "),i(19,"span",13),l(20,"*"),o()(),v(21,"input",18),o(),i(22,"div",11)(23,"label",19),l(24,"Description"),o(),v(25,"textarea",20),o(),h(26,ie,2,2,"div",21),i(27,"div",22)(28,"button",23),l(29),o(),h(30,re,2,2,"button",24),i(31,"button",25),u("click",function(){f(e);let s=m();return _(s.cancel())}),l(32,"Cancel"),o()()()}if(r&2){let e,n=m();c("formGroup",n.form),a(),c("disabled",n.isEditMode()),a(3),E(n.scopeOptions),a(7),c("formControl",n.typeControl),a(3),E(n.integrationTypes()),a(7),c("formControl",n.nameControl),a(4),c("formControl",n.descriptionControl),a(),y((e=n.schema())?26:-1,e),a(2),c("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),a(),T(" ",n.isEditMode()?"Save changes":"Create"," "),a(),y(n.isEditMode()?30:-1)}}var le=new Set(["platform","namespace","userOnNs","userGlobal"]),O=Object.freeze({platform:"Configuration plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),ee=class r{route=d(D);router=d(L);destroyRef=d(V);state=d(X);integrationTypeController=d(B);namespaceRole=d(Z);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isAdmin=I(this.isPlatformMode?w(!0):this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:this.isPlatformMode});form=new j({name:new C("",{nonNullable:!0,validators:[M.required,M.minLength(1)]}),description:new C(null),type:new C("",{nonNullable:!0,validators:[M.required]}),scope:new C("namespace",{nonNullable:!0})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get typeControl(){return this.form.controls.type}get scopeControl(){return this.form.controls.scope}isEditMode=g(!1);isSubmitting=g(!1);isLoading=g(!1);isExporting=g(!1);scopeOptions=[{value:"platform",label:O.platform},{value:"namespace",label:O.namespace},{value:"userOnNs",label:O.userOnNs},{value:"userGlobal",label:O.userGlobal}];paramsValue=g(null);initialParams=g(null);integrationTypes=I(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=I(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});schema=R(()=>{let t=this.selectedType();return t?this.integrationTypes().find(n=>n.type===t)?.configSchema??null:null});existingConfig=null;constructor(){F(()=>{if(this.isAdmin()||this.isEditMode())return;["platform","namespace"].includes(this.scopeControl.value)&&this.scopeControl.setValue("userOnNs")})}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,n=t.get("integrationId");if(n){this.isEditMode.set(!0),this.scopeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let s=this.parseScope(e.get("scope"));this.scopeControl.setValue(s);let p=e.get("template");p&&this.hydrateFromTemplate(p)}parseScope(t){return t&&le.has(t)?t:"namespace"}deriveScopeFromConfig(t){return!t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(!0),this.state.getById(t).pipe(b(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),console.warn(`[IntegrationForm] Could not load config '${t}' \u2014 navigating back`),this.navigateBack()}})}hydrateFromTemplate(t){this.isLoading.set(!0),this.state.getById(t).pipe(b(this.destroyRef)).subscribe({next:e=>{this.applyConfigToForm(e),this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})},error:e=>{console.warn(`[IntegrationForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})}})}applyConfigToForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.typeControl.setValue(t.integrationType),this.initialParams.set(t.parameters),this.paramsValue.set(t.parameters)}onParamsChange(t){this.paramsValue.set(t)}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(!0);let t=this.descriptionControl.value?.trim(),e={name:this.nameControl.value.trim(),description:t||null,integrationType:this.typeControl.value,parameters:this.paramsValue()},n=this.form.getRawValue().scope;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,e,n,this.existingConfig):this.state.create(e,n,this.namespaceId??null)).pipe(b(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(!1)})}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(!0),this.state.exportAsYaml(t).pipe(b(this.destroyRef)).subscribe({next:e=>{let n=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(n),p=document.createElement("a");p.href=s,p.download=`${this.existingConfig?.name??"integration"}.yaml`,p.click(),URL.revokeObjectURL(s),this.isExporting.set(!1)},error:()=>this.isExporting.set(!1)}))}cancel(){this.navigateBack()}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","integration-configs"]):this.router.navigate(["/agentos",this.namespaceId,"integrations"])}trackByType(t,e){return e.type}trackByScope(t,e){return e.value}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=N({type:r,selectors:[["agentos-integration-form"]],decls:10,vars:2,consts:[[1,"integration-form"],[1,"integration-form__header"],["type","button","title","Back to integrations",1,"integration-form__back",3,"click"],[1,"integration-form__back-icon"],[1,"integration-form__title"],[1,"integration-form__loading"],[1,"integration-form__form",3,"formGroup"],[1,"integration-form__form",3,"ngSubmit","formGroup"],[1,"integration-form__field","integration-form__scope",3,"disabled"],[1,"integration-form__label"],[1,"integration-form__scope-option"],[1,"integration-form__field"],["for","integration-type",1,"integration-form__label"],["aria-hidden","true"],["id","integration-type",1,"integration-form__select",3,"formControl"],["value","","disabled",""],[3,"value"],["for","integration-name",1,"integration-form__label"],["id","integration-name","type","text","placeholder","Integration name","autocomplete","off",1,"integration-form__input",3,"formControl"],["for","integration-description",1,"integration-form__label"],["id","integration-description","placeholder","Optional description","rows","3",1,"integration-form__textarea",3,"formControl"],[1,"integration-form__schema-form"],[1,"integration-form__actions"],["type","submit",1,"integration-form__btn","integration-form__btn--primary",3,"disabled"],["type","button",1,"integration-form__btn","integration-form__btn--export",3,"disabled"],["type","button",1,"integration-form__btn",3,"click"],["type","radio",3,"value","formControl","disabled"],[3,"valueChange","schema","value"],["type","button",1,"integration-form__btn","integration-form__btn--export",3,"click","disabled"]],template:function(e,n){e&1&&(i(0,"div",0)(1,"header",1)(2,"button",2),u("click",function(){return n.cancel()}),i(3,"span",3),l(4,"\u2190"),o(),l(5," Integrations "),o(),i(6,"h1",4),l(7),o()(),h(8,te,2,0,"p",5)(9,ae,33,9,"form",6),o()),e&2&&(a(7),S(n.isEditMode()?"Edit integration":"New integration"),a(),y(n.isLoading()?8:9))},dependencies:[Q,q,H,K,A,Y,$,z,G,U,J,W],styles:[".integration-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.integration-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.integration-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.integration-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.integration-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.integration-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.integration-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.integration-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.integration-form__scope[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;border:1px solid var(--color-border-light, rgba(0, 0, 0, .06));border-radius:10px;padding:.75rem 1rem;background:transparent;margin:0}.integration-form__scope[disabled][_ngcontent-%COMP%]{opacity:.6}.integration-form__scope-option[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;color:var(--color-text, #1d1d1f);cursor:pointer}.integration-form__scope-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin:0}.integration-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.integration-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.integration-form__input[_ngcontent-%COMP%], .integration-form__textarea[_ngcontent-%COMP%], .integration-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.integration-form__input[_ngcontent-%COMP%]:focus, .integration-form__textarea[_ngcontent-%COMP%]:focus, .integration-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.integration-form__input[_ngcontent-%COMP%]::placeholder, .integration-form__textarea[_ngcontent-%COMP%]::placeholder, .integration-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.integration-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:4.5rem;line-height:1.5}.integration-form__select[_ngcontent-%COMP%]{cursor:pointer}.integration-form__select[_ngcontent-%COMP%] option[disabled][_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73)}.integration-form__schema-form[_ngcontent-%COMP%]{padding:1rem;border-radius:10px;border:1px solid var(--color-border-light, rgba(0, 0, 0, .06));background:var(--glass-bg, rgba(255, 255, 255, .5));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px))}.integration-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.integration-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.integration-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.integration-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.integration-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.integration-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}.integration-form__btn--export[_ngcontent-%COMP%]{border-color:var(--color-border, rgba(0, 0, 0, .1));color:var(--color-text-secondary, #6e6e73)}.integration-form__btn--export[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--color-primary, #007aff);color:var(--color-primary, #007aff)}"],changeDetection:0})};export{ee as IntegrationFormComponent};
1
+ import{a as X}from"./chunk-SW3MVXR5.js";import{a as Z}from"./chunk-2OC3IQX4.js";import"./chunk-F4DLZWDY.js";import"./chunk-DEI4EULW.js";import{h as B}from"./chunk-ZAMAK546.js";import{a as D,c as L}from"./chunk-MZT6I3S3.js";import{v as W}from"./chunk-C2J4TQ7V.js";import"./chunk-MWPKXBXJ.js";import"./chunk-7EDSHFWH.js";import{a as C,c as I}from"./chunk-3ZLLFAXF.js";import"./chunk-Q2M4W42M.js";import{F as Q,c as A,e as M,g as z,h as G,i as j,l as h,n as q,p as $,s as U,w as J,x as Y,y as H,z as K}from"./chunk-DDWYQORF.js";import"./chunk-B46LXCLF.js";import{Bb as x,Db as u,Fb as m,Ka as a,Tb as l,Ub as S,Vb as T,Wa as N,ca as p,ga as f,ha as _,kb as P,lb as b,m as w,ma as V,mb as v,mc as R,pb as E,qb as k,rb as c,sb as i,ta as g,tb as o,ua as F,ub as y}from"./chunk-KJ5SIUGY.js";function te(r,t){r&1&&(i(0,"p",5),l(1,"Loading\u2026"),o())}function ne(r,t){if(r&1&&(i(0,"label",10),y(1,"input",26),i(2,"span"),l(3),o()()),r&2){let e=t.$implicit,n=m(2);a(),c("value",e.value)("formControl",n.scopeControl)("disabled",e.value==="namespace"&&!n.isAdmin()),a(2),S(e.label)}}function oe(r,t){if(r&1&&(i(0,"option",16),l(1),o()),r&2){let e=t.$implicit;c("value",e.type),a(),S(e.displayName)}}function ie(r,t){if(r&1){let e=x();i(0,"div",21)(1,"ds-json-schema-form",27),u("valueChange",function(s){f(e);let d=m(2);return _(d.onParamsChange(s))}),o()()}if(r&2){let e=m(2);a(),c("schema",t)("value",e.initialParams())}}function re(r,t){if(r&1){let e=x();i(0,"button",28),u("click",function(){f(e);let s=m(2);return _(s.exportYaml())}),l(1),o()}if(r&2){let e=m(2);c("disabled",e.isExporting()),a(),T(" ",e.isExporting()?"Exporting\u2026":"Export as YAML"," ")}}function ae(r,t){if(r&1){let e=x();i(0,"form",7),u("ngSubmit",function(){f(e);let s=m();return _(s.submit())}),i(1,"fieldset",8)(2,"legend",9),l(3,"Scope"),o(),E(4,ne,4,4,"label",10,P().trackByScope,!0),o(),i(6,"div",11)(7,"label",12),l(8,"Type "),i(9,"span",13),l(10,"*"),o()(),i(11,"select",14)(12,"option",15),l(13,"Select type"),o(),E(14,oe,2,2,"option",16,P().trackByType,!0),o()(),i(16,"div",11)(17,"label",17),l(18,"Name "),i(19,"span",13),l(20,"*"),o()(),y(21,"input",18),o(),i(22,"div",11)(23,"label",19),l(24,"Description"),o(),y(25,"textarea",20),o(),b(26,ie,2,2,"div",21),i(27,"div",22)(28,"button",23),l(29),o(),b(30,re,2,2,"button",24),i(31,"button",25),u("click",function(){f(e);let s=m();return _(s.cancel())}),l(32,"Cancel"),o()()()}if(r&2){let e,n=m();c("formGroup",n.form),a(),c("disabled",n.isEditMode()),a(3),k(n.scopeOptions),a(7),c("formControl",n.typeControl),a(3),k(n.integrationTypes()),a(7),c("formControl",n.nameControl),a(4),c("formControl",n.descriptionControl),a(),v((e=n.schema())?26:-1,e),a(2),c("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),a(),T(" ",n.isEditMode()?"Save changes":"Create"," "),a(),v(n.isEditMode()?30:-1)}}var le=new Set(["platform","namespace","userOnNs","userGlobal"]),O=Object.freeze({platform:"Configuration plateforme",namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),ee=class r{route=p(D);router=p(L);destroyRef=p(V);state=p(X);integrationTypeController=p(B);namespaceRole=p(Z);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;isAdmin=I(this.isPlatformMode?w(!0):this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:this.isPlatformMode});form=new j({name:new h("",{nonNullable:!0,validators:[M.required,M.minLength(1)]}),description:new h(null),type:new h("",{nonNullable:!0,validators:[M.required]}),scope:new h("namespace",{nonNullable:!0})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get typeControl(){return this.form.controls.type}get scopeControl(){return this.form.controls.scope}isEditMode=g(!1);isSubmitting=g(!1);isLoading=g(!1);isExporting=g(!1);scopeOptions=[{value:"platform",label:O.platform},{value:"namespace",label:O.namespace},{value:"userOnNs",label:O.userOnNs},{value:"userGlobal",label:O.userGlobal}];paramsValue=g(null);initialParams=g(null);integrationTypes=I(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=I(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});schema=R(()=>{let t=this.selectedType();return t?this.integrationTypes().find(n=>n.type===t)?.configSchema??null:null});existingConfig=null;constructor(){F(()=>{if(this.isAdmin()||this.isEditMode())return;["platform","namespace"].includes(this.scopeControl.value)&&this.scopeControl.setValue("userOnNs")})}ngOnInit(){this.namespaceId&&this.state.setNamespace(this.namespaceId);let t=this.route.snapshot.paramMap,e=this.route.snapshot.queryParamMap,n=t.get("integrationId");if(n){this.isEditMode.set(!0),this.scopeControl.disable(),this.loadConfig(n);return}if(this.isPlatformMode){this.scopeControl.setValue("platform"),this.scopeControl.disable();return}let s=this.parseScope(e.get("scope"));this.scopeControl.setValue(s);let d=e.get("template");d&&this.hydrateFromTemplate(d)}parseScope(t){return t&&le.has(t)?t:"namespace"}deriveScopeFromConfig(t){return!t.userId&&!t.namespaceId?"platform":t.userId?t.namespaceId?"userOnNs":"userGlobal":"namespace"}loadConfig(t){this.isLoading.set(!0),this.state.getById(t).pipe(C(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.scopeControl.setValue(this.deriveScopeFromConfig(e)),this.applyConfigToForm(e),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),console.warn(`[IntegrationForm] Could not load config '${t}' \u2014 navigating back`),this.navigateBack()}})}hydrateFromTemplate(t){this.isLoading.set(!0),this.state.getById(t).pipe(C(this.destroyRef)).subscribe({next:e=>{this.applyConfigToForm(e),this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})},error:e=>{console.warn(`[IntegrationForm] Could not hydrate from template ${t}:`,e),this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})}})}applyConfigToForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.typeControl.setValue(t.integrationType),this.initialParams.set(t.parameters),this.paramsValue.set(t.parameters)}onParamsChange(t){this.paramsValue.set(t)}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(!0);let t=this.descriptionControl.value?.trim(),e={name:this.nameControl.value.trim(),description:t||null,integrationType:this.typeControl.value,parameters:this.paramsValue()},n=this.form.getRawValue().scope;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,e,n,this.existingConfig):this.state.create(e,n,this.namespaceId??null)).pipe(C(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(!1)})}exportYaml(){let t=this.existingConfig?.id;!t||this.isExporting()||(this.isExporting.set(!0),this.state.exportAsYaml(t).pipe(C(this.destroyRef)).subscribe({next:e=>{let n=new Blob([e],{type:"application/yaml"}),s=URL.createObjectURL(n),d=document.createElement("a");d.href=s,d.download=`${this.existingConfig?.name??"integration"}.yaml`,d.click(),URL.revokeObjectURL(s),this.isExporting.set(!1)},error:()=>this.isExporting.set(!1)}))}cancel(){this.navigateBack()}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","integration-configs"]):this.router.navigate(["/agentos",this.namespaceId,"integrations"])}trackByType(t,e){return e.type}trackByScope(t,e){return e.value}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=N({type:r,selectors:[["agentos-integration-form"]],decls:10,vars:2,consts:[[1,"integration-form"],[1,"integration-form__header"],["type","button","title","Back to integrations",1,"integration-form__back",3,"click"],[1,"integration-form__back-icon"],[1,"integration-form__title"],[1,"integration-form__loading"],[1,"integration-form__form",3,"formGroup"],[1,"integration-form__form",3,"ngSubmit","formGroup"],[1,"integration-form__field","integration-form__scope",3,"disabled"],[1,"integration-form__label"],[1,"integration-form__scope-option"],[1,"integration-form__field"],["for","integration-type",1,"integration-form__label"],["aria-hidden","true"],["id","integration-type",1,"integration-form__select",3,"formControl"],["value","","disabled",""],[3,"value"],["for","integration-name",1,"integration-form__label"],["id","integration-name","type","text","placeholder","Integration name","autocomplete","off",1,"integration-form__input",3,"formControl"],["for","integration-description",1,"integration-form__label"],["id","integration-description","placeholder","Optional description","rows","3",1,"integration-form__textarea",3,"formControl"],[1,"integration-form__schema-form"],[1,"integration-form__actions"],["type","submit",1,"integration-form__btn","integration-form__btn--primary",3,"disabled"],["type","button",1,"integration-form__btn","integration-form__btn--export",3,"disabled"],["type","button",1,"integration-form__btn",3,"click"],["type","radio",3,"value","formControl","disabled"],[3,"valueChange","schema","value"],["type","button",1,"integration-form__btn","integration-form__btn--export",3,"click","disabled"]],template:function(e,n){e&1&&(i(0,"div",0)(1,"header",1)(2,"button",2),u("click",function(){return n.cancel()}),i(3,"span",3),l(4,"\u2190"),o(),l(5," Integrations "),o(),i(6,"h1",4),l(7),o()(),b(8,te,2,0,"p",5)(9,ae,33,9,"form",6),o()),e&2&&(a(7),S(n.isEditMode()?"Edit integration":"New integration"),a(),v(n.isLoading()?8:9))},dependencies:[Q,q,H,K,A,Y,$,z,G,U,J,W],styles:[".integration-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.integration-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.integration-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-accent)}.integration-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.integration-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.integration-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:700;color:var(--color-text);letter-spacing:-.02em}.integration-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary);font-size:.9rem;margin:0}.integration-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.integration-form__scope[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;border:1px solid var(--color-divider);border-radius:0;padding:.75rem 1rem;background:transparent;margin:0}.integration-form__scope[disabled][_ngcontent-%COMP%]{opacity:.6}.integration-form__scope-option[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;color:var(--color-text);cursor:pointer}.integration-form__scope-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin:0}.integration-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.integration-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text)}.integration-form__input[_ngcontent-%COMP%], .integration-form__textarea[_ngcontent-%COMP%], .integration-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface);color:var(--color-text);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.integration-form__input[_ngcontent-%COMP%]:focus, .integration-form__textarea[_ngcontent-%COMP%]:focus, .integration-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-accent)}.integration-form__input[_ngcontent-%COMP%]::placeholder, .integration-form__textarea[_ngcontent-%COMP%]::placeholder, .integration-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-neutral-500)}.integration-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:4.5rem;line-height:1.5}.integration-form__select[_ngcontent-%COMP%]{cursor:pointer}.integration-form__select[_ngcontent-%COMP%] option[disabled][_ngcontent-%COMP%]{color:var(--color-text-secondary)}.integration-form__schema-form[_ngcontent-%COMP%]{padding:1rem;border-radius:0;border:1px solid var(--color-divider);background:var(--color-surface)}.integration-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.integration-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:0;border:1px solid var(--color-divider);background:transparent;color:var(--color-text);font-size:13px;font-family:var(--font-heading);font-weight:600;cursor:pointer;transition:background .15s ease,border-color .15s ease}.integration-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-bg-hover);border-color:var(--color-neutral-500)}.integration-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.integration-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-accent);border-color:var(--color-accent);color:#fff}.integration-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-accent-700);border-color:var(--color-accent-700)}.integration-form__btn--export[_ngcontent-%COMP%]{border-color:var(--color-divider);color:var(--color-text-secondary)}.integration-form__btn--export[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--color-accent);color:var(--color-accent)}"],changeDetection:0})};export{ee as IntegrationFormComponent};