@whoz-oss/coday-client 0.205.0 → 0.207.2

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 (114) hide show
  1. package/browser/chunk-22RX22JY.js +1 -0
  2. package/browser/{chunk-IZMOVLXM.js → chunk-243E2GWV.js} +1 -1
  3. package/browser/chunk-26MGIRJF.js +1 -0
  4. package/browser/{chunk-E5MP3JT3.js → chunk-2O4IDVFE.js} +1 -1
  5. package/browser/chunk-2P74VZU4.js +1 -0
  6. package/browser/chunk-3AOPEZPX.js +1 -0
  7. package/browser/{chunk-T7LK5WIK.js → chunk-3IOIMTCZ.js} +1 -1
  8. package/browser/{chunk-IZ232KSX.js → chunk-3NE2UZIY.js} +1 -1
  9. package/browser/{chunk-BM7HTRD4.js → chunk-3NOI65IY.js} +1 -1
  10. package/browser/{chunk-ZFLT2KNY.js → chunk-43DMEMMQ.js} +1 -1
  11. package/browser/{chunk-TIPIHEBG.js → chunk-4F2LQOD7.js} +1 -1
  12. package/browser/{chunk-OCT6NWLB.js → chunk-4JBCVOGN.js} +1 -1
  13. package/browser/{chunk-DIAV5ZVT.js → chunk-4KEHW6KL.js} +1 -1
  14. package/browser/{chunk-MLSIHZ2T.js → chunk-4NGQR26Q.js} +1 -1
  15. package/browser/{chunk-W2DFJLOU.js → chunk-5CBZIB6D.js} +1 -1
  16. package/browser/chunk-5J7BTB5J.js +5 -0
  17. package/browser/{chunk-CREVHCXF.js → chunk-5K5EFCNT.js} +1 -1
  18. package/browser/chunk-5OPQ2IC6.js +1 -0
  19. package/browser/{chunk-2KD6MSFI.js → chunk-5VKJNF6W.js} +1 -1
  20. package/browser/{chunk-PN75DG7I.js → chunk-6RZUBD7A.js} +1 -1
  21. package/browser/chunk-6VCRRGXF.js +1 -0
  22. package/browser/{chunk-H7A4LOFH.js → chunk-7MQRVE7E.js} +1 -1
  23. package/browser/{chunk-H2NKOG3U.js → chunk-7V5RIRTC.js} +1 -1
  24. package/browser/{chunk-T6U3WDDW.js → chunk-A2R5GVPT.js} +1 -1
  25. package/browser/{chunk-AV7DTXWS.js → chunk-ATKHLJJ3.js} +1 -1
  26. package/browser/{chunk-GN7KRTUQ.js → chunk-BGEXT3EN.js} +1 -1
  27. package/browser/chunk-BMUZTI7K.js +1 -0
  28. package/browser/{chunk-WRTC44LF.js → chunk-BQHUHW7P.js} +1 -1
  29. package/browser/chunk-CCPU2LL3.js +1 -0
  30. package/browser/{chunk-TANV4K2Q.js → chunk-CRMVKTOY.js} +1 -1
  31. package/browser/chunk-CU4C25HM.js +1 -0
  32. package/browser/{chunk-YQAOEJN2.js → chunk-DVSVPID7.js} +1 -1
  33. package/browser/{chunk-TZKO65ML.js → chunk-E3XC4CVU.js} +1 -1
  34. package/browser/{chunk-Q7GPLEGX.js → chunk-EQXGFCI5.js} +1 -1
  35. package/browser/{chunk-BWBXJSAF.js → chunk-F42BGKID.js} +1 -1
  36. package/browser/{chunk-QJ3OBGZZ.js → chunk-FAM7HWYV.js} +1 -1
  37. package/browser/{chunk-ZH3XQHLJ.js → chunk-FEJVBWEX.js} +1 -1
  38. package/browser/{chunk-UFOTGZBF.js → chunk-FMAU2O5I.js} +1 -1
  39. package/browser/{chunk-X4OBCZKS.js → chunk-FOAW6HUH.js} +1 -1
  40. package/browser/{chunk-JEGJL4TT.js → chunk-FTVXDMJT.js} +1 -1
  41. package/browser/chunk-G2BRVRGR.js +1 -0
  42. package/browser/{chunk-24EMVCMJ.js → chunk-GUB4VYOT.js} +1 -1
  43. package/browser/{chunk-XIWUSJ3U.js → chunk-H27HCS4L.js} +1 -1
  44. package/browser/{chunk-EJH5VPZT.js → chunk-HE2ON544.js} +1 -1
  45. package/browser/{chunk-7UX5UET4.js → chunk-HO4VUFE6.js} +1 -1
  46. package/browser/{chunk-MQIE2KBB.js → chunk-HQZLHG3V.js} +1 -1
  47. package/browser/{chunk-7DUVQCGC.js → chunk-IOREZEED.js} +1 -1
  48. package/browser/{chunk-RI2JQRSB.js → chunk-IRZNRZ5Q.js} +1 -1
  49. package/browser/{chunk-4OZZANXO.js → chunk-JIHPEYRG.js} +1 -1
  50. package/browser/{chunk-SUCGKO3W.js → chunk-K4C36S6V.js} +1 -1
  51. package/browser/{chunk-2XIUD7DV.js → chunk-KZJRQ6RN.js} +1 -1
  52. package/browser/{chunk-7BYLIOKV.js → chunk-LBMJRBEQ.js} +1 -1
  53. package/browser/{chunk-ETLSYFBB.js → chunk-LH4ATU27.js} +1 -1
  54. package/browser/{chunk-EMS3MOSZ.js → chunk-LM2BKZRF.js} +1 -1
  55. package/browser/chunk-LMFI6Y77.js +1 -0
  56. package/browser/{chunk-ATOA52OV.js → chunk-LRKPIL3B.js} +1 -1
  57. package/browser/chunk-LX5DYIMF.js +1 -0
  58. package/browser/chunk-M6ORKUDA.js +1 -0
  59. package/browser/{chunk-JLGR5C43.js → chunk-M7LNEVHA.js} +1 -1
  60. package/browser/{chunk-O4JNY3IM.js → chunk-ND3PB3FA.js} +1 -1
  61. package/browser/{chunk-POQ6PK6P.js → chunk-NIWF7LLH.js} +1 -1
  62. package/browser/{chunk-RBAVAHXW.js → chunk-OBV4LQBZ.js} +1 -1
  63. package/browser/chunk-OSQQAYJZ.js +1 -0
  64. package/browser/{chunk-4URCDOMP.js → chunk-PKBNMAQJ.js} +1 -1
  65. package/browser/{chunk-JHMFWXB4.js → chunk-PNFA7PN2.js} +1 -1
  66. package/browser/{chunk-YTTJDHQV.js → chunk-PRFGHN7L.js} +1 -1
  67. package/browser/{chunk-4RQXBHNU.js → chunk-RJBF3TIH.js} +1 -1
  68. package/browser/chunk-RRBTVPFV.js +1 -0
  69. package/browser/{chunk-PZWORCU2.js → chunk-S7MAZ5PQ.js} +1 -1
  70. package/browser/chunk-SCK76QV6.js +1 -0
  71. package/browser/chunk-SF7PCURW.js +1 -0
  72. package/browser/{chunk-SR3JKZ3U.js → chunk-TG75SVZ4.js} +1 -1
  73. package/browser/{chunk-IWORAUIR.js → chunk-TS6GGNWA.js} +1 -1
  74. package/browser/{chunk-5RSIAFID.js → chunk-TZMTC2HL.js} +1 -1
  75. package/browser/chunk-UAHCUD67.js +1 -0
  76. package/browser/chunk-UDA26TV3.js +1 -0
  77. package/browser/chunk-URX4BP67.js +1 -0
  78. package/browser/chunk-VHC775VZ.js +1 -0
  79. package/browser/chunk-VIDPCJ3F.js +1 -0
  80. package/browser/{chunk-RFEQZZ65.js → chunk-VYU454KQ.js} +1 -1
  81. package/browser/{chunk-J6XN2QQO.js → chunk-W6TYWCQH.js} +1 -1
  82. package/browser/{chunk-XG3WOI3P.js → chunk-WLSXA23B.js} +1 -1
  83. package/browser/{chunk-34XXAW4B.js → chunk-WN6IHVRI.js} +1 -1
  84. package/browser/{chunk-5ZZOXT2B.js → chunk-WQ5AIKDC.js} +1 -1
  85. package/browser/{chunk-FPE2L5B6.js → chunk-XBPK63K2.js} +1 -1
  86. package/browser/chunk-Y6K6VJYJ.js +1 -0
  87. package/browser/{chunk-6J2HD2IJ.js → chunk-ZU7FZEK3.js} +1 -1
  88. package/browser/index.html +1 -1
  89. package/browser/{main-INQHHK2Q.js → main-VRT323QR.js} +1 -1
  90. package/package.json +1 -1
  91. package/browser/chunk-5YY3K2H4.js +0 -1
  92. package/browser/chunk-EU6MUKDF.js +0 -1
  93. package/browser/chunk-FUVTYKQF.js +0 -1
  94. package/browser/chunk-GTY23DMS.js +0 -1
  95. package/browser/chunk-HMFECYUP.js +0 -1
  96. package/browser/chunk-HNNYFORJ.js +0 -1
  97. package/browser/chunk-IGOUE2XE.js +0 -1
  98. package/browser/chunk-J3CZ3MOZ.js +0 -1
  99. package/browser/chunk-JTM5UHB2.js +0 -1
  100. package/browser/chunk-KO4MDPCD.js +0 -1
  101. package/browser/chunk-KP7JXEQ6.js +0 -1
  102. package/browser/chunk-LN6ED2HF.js +0 -1
  103. package/browser/chunk-LT6BGRWZ.js +0 -1
  104. package/browser/chunk-OQBPCHYW.js +0 -1
  105. package/browser/chunk-P6D3VN2I.js +0 -1
  106. package/browser/chunk-PCPMONQV.js +0 -1
  107. package/browser/chunk-QWADOF7R.js +0 -1
  108. package/browser/chunk-RYEX2DR7.js +0 -5
  109. package/browser/chunk-S4E4KZRV.js +0 -1
  110. package/browser/chunk-SK7JAK5K.js +0 -1
  111. package/browser/chunk-TJUGTTPT.js +0 -1
  112. package/browser/chunk-TPZGV5NA.js +0 -1
  113. package/browser/chunk-YJA5A4XF.js +0 -1
  114. package/browser/chunk-ZTCAFSDX.js +0 -1
@@ -1 +1 @@
1
- import{a as L}from"./chunk-EMS3MOSZ.js";import{b as z}from"./chunk-J3CZ3MOZ.js";import"./chunk-TIPIHEBG.js";import{a as T,c as A,d as D}from"./chunk-H7A4LOFH.js";import{a as N}from"./chunk-RI2JQRSB.js";import{Bb as b,Db as f,Fb as l,Ga as M,Ka as r,Rb as u,Tb as a,Ub as p,Vb as h,Wa as I,ca as _,dc as O,ec as w,ga as C,ha as x,jb as v,lb as d,ma as P,mb as s,pb as S,qb as E,rb as y,sb as i,ta as m,tb as t,ub as k}from"./chunk-RYEX2DR7.js";var F=(n,o)=>o.name;function B(n,o){n&1&&(i(0,"p",6),a(1,"Loading\u2026"),t())}function $(n,o){n&1&&(i(0,"p",7),a(1,"Failed to load agent definition."),t())}function j(n,o){if(n&1&&(i(0,"dt",12),a(1,"User context"),t(),i(2,"dd",14),a(3),t()),n&2){let e=l();r(3),p(e.userId)}}function H(n,o){if(n&1&&(i(0,"pre",21),a(1),t()),n&2){let e=l(2);r(),p(e.systemPrompt)}}function J(n,o){if(n&1){let e=b();i(0,"section",9)(1,"button",19),f("click",function(){C(e);let g=l(2);return x(g.toggleSystemPrompt())}),i(2,"h2",10),a(3,"System Prompt"),t(),i(4,"span",20),a(5," \u25BC "),t()(),d(6,H,2,1,"pre",21),t()}if(n&2){let e=l(2);r(),v("aria-expanded",!e.systemPromptCollapsed()),r(3),u("agent-config-inspect__chevron--open",!e.systemPromptCollapsed()),r(2),s(e.systemPromptCollapsed()?-1:6)}}function U(n,o){if(n&1&&(i(0,"pre",21),a(1),t()),n&2){let e=l(2);r(),p(e.instructions)}}function G(n,o){if(n&1){let e=b();i(0,"section",9)(1,"button",19),f("click",function(){C(e);let g=l(2);return x(g.toggleInstructions())}),i(2,"h2",10),a(3,"Instructions"),t(),i(4,"span",20),a(5," \u25BC "),t()(),d(6,U,2,1,"pre",21),t()}if(n&2){let e=l(2);r(),v("aria-expanded",!e.instructionsCollapsed()),r(3),u("agent-config-inspect__chevron--open",!e.instructionsCollapsed()),r(2),s(e.instructionsCollapsed()?-1:6)}}function q(n,o){n&1&&(i(0,"p",17),a(1,"No tools available for this agent."),t())}function K(n,o){if(n&1&&(k(0,"div",26),O(1,"agentosMarkdown")),n&2){let e=l(2).$implicit;y("innerHTML",w(1,1,e.description),M)}}function Q(n,o){if(n&1&&(i(0,"div",25),d(1,K,2,3,"div",26),i(2,"pre",27),a(3),t()()),n&2){let e=l().$implicit,c=l(3);r(),s(e.description?1:-1),r(2),p(c.formatSchema(e.inputSchema))}}function W(n,o){if(n&1){let e=b();i(0,"li",22)(1,"button",23),f("click",function(){let g=C(e).$implicit,V=l(3);return x(V.toggleTool(g))}),i(2,"span",24),a(3),t(),i(4,"span",20),a(5," \u25BC "),t()(),d(6,Q,4,2,"div",25),t()}if(n&2){let e=o.$implicit,c=l(3);r(),v("aria-expanded",c.isToolExpanded(e)),r(2),p(e.name),r(),u("agent-config-inspect__chevron--open",c.isToolExpanded(e)),r(2),s(c.isToolExpanded(e)?6:-1)}}function X(n,o){if(n&1&&(i(0,"ul",18),S(1,W,7,5,"li",22,F),t()),n&2){let e=l();r(),E(e.tools)}}function Y(n,o){if(n&1&&(i(0,"div",8)(1,"section",9)(2,"h2",10),a(3,"General"),t(),i(4,"dl",11)(5,"dt",12),a(6,"Name"),t(),i(7,"dd",13),a(8),t(),i(9,"dt",12),a(10,"Resolved model"),t(),i(11,"dd",14),a(12),t(),i(13,"dt",12),a(14,"Provider"),t(),i(15,"dd",13),a(16),t(),i(17,"dt",12),a(18,"Advanced execution"),t(),i(19,"dd",13)(20,"span",15),a(21),t()(),d(22,j,4,1),t()(),d(23,J,7,4,"section",9),d(24,G,7,4,"section",9),i(25,"section",9)(26,"h2",10),a(27," Tools "),i(28,"span",16),a(29),t()(),d(30,q,2,0,"p",17)(31,X,3,0,"ul",18),t()()),n&2){let e=o;r(8),p(e.name),r(4),p(e.resolvedModelApiName),r(4),p(e.resolvedProviderName),r(4),u("agent-config-inspect__badge--active",e.advancedExecution),r(),h(" ",e.advancedExecution?"Enabled":"Disabled"," "),r(),s(e.userId?22:-1),r(),s(e.systemPrompt?23:-1),r(),s(e.instructions?24:-1),r(5),h("(",e.tools.length,")"),r(),s(e.tools.length===0?30:31)}}var R=class n{route=_(T);router=_(A);destroyRef=_(P);agentConfigController=_(z);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=m(!0);hasError=m(!1);definition=m(null);expandedTools=m(new Set);systemPromptCollapsed=m(!0);instructionsCollapsed=m(!0);ngOnInit(){this.agentConfigController.getDefinitionAgentConfig(this.agentConfigId).pipe(N(this.destroyRef)).subscribe({next:o=>{this.definition.set(o),this.isLoading.set(!1)},error:()=>{this.hasError.set(!0),this.isLoading.set(!1)}})}toggleTool(o){this.expandedTools.update(e=>{let c=new Set(e);return c.has(o.name)?c.delete(o.name):c.add(o.name),c})}isToolExpanded(o){return this.expandedTools().has(o.name)}toggleSystemPrompt(){this.systemPromptCollapsed.update(o=>!o)}toggleInstructions(){this.instructionsCollapsed.update(o=>!o)}formatSchema(o){try{return JSON.stringify(JSON.parse(o),null,2)}catch(e){return o}}editRoute(){return this.isPlatformMode?["/agentos","admin","agent-configs",this.agentConfigId,"edit"]:["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"])}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=I({type:n,selectors:[["agentos-agent-config-inspect"]],decls:13,vars:2,consts:[[1,"agent-config-inspect"],[1,"agent-config-inspect__header"],["type","button","title","Back to agent configs",1,"agent-config-inspect__back",3,"click"],[1,"agent-config-inspect__back-icon"],[1,"agent-config-inspect__title"],[1,"agent-config-inspect__sibling-link",3,"routerLink"],[1,"agent-config-inspect__loading"],[1,"agent-config-inspect__error"],[1,"agent-config-inspect__content"],[1,"agent-config-inspect__section"],[1,"agent-config-inspect__section-title"],[1,"agent-config-inspect__dl"],[1,"agent-config-inspect__dt"],[1,"agent-config-inspect__dd"],[1,"agent-config-inspect__dd","agent-config-inspect__dd--mono"],[1,"agent-config-inspect__badge"],[1,"agent-config-inspect__count"],[1,"agent-config-inspect__empty"],[1,"agent-config-inspect__tools"],["type","button",1,"agent-config-inspect__collapsible",3,"click"],[1,"agent-config-inspect__chevron"],[1,"agent-config-inspect__instructions"],[1,"agent-config-inspect__tool"],["type","button",1,"agent-config-inspect__tool-header",3,"click"],[1,"agent-config-inspect__tool-name"],[1,"agent-config-inspect__tool-body"],[1,"agent-config-inspect__tool-description",3,"innerHTML"],[1,"agent-config-inspect__schema"]],template:function(e,c){if(e&1&&(i(0,"div",0)(1,"header",1)(2,"button",2),f("click",function(){return c.back()}),i(3,"span",3),a(4,"\u2190"),t(),a(5," Agent Configs "),t(),i(6,"h1",4),a(7,"Agent definition"),t(),i(8,"a",5),a(9,"Edit config \u2192"),t()(),d(10,B,2,0,"p",6)(11,$,2,0,"p",7)(12,Y,32,11,"div",8),t()),e&2){let g;r(8),y("routerLink",c.editRoute()),r(2),s(c.isLoading()?10:c.hasError()?11:(g=c.definition())?12:-1,g)}},dependencies:[D,L],styles:[".agent-config-inspect[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:720px;margin:0 auto;padding:2rem 1rem}.agent-config-inspect__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__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}.agent-config-inspect__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.agent-config-inspect__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-primary, #007aff);text-decoration:none}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__loading[_ngcontent-%COMP%], .agent-config-inspect__error[_ngcontent-%COMP%], .agent-config-inspect__empty[_ngcontent-%COMP%]{margin:0;font-size:.9rem;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__error[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.agent-config-inspect__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.agent-config-inspect__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:1.25rem;border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:10px}.agent-config-inspect__section-title[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;font-weight:600;color:var(--color-text, #1d1d1f)}.agent-config-inspect__count[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);font-size:.875rem;margin-left:.25rem}.agent-config-inspect__dl[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;gap:.5rem 1.25rem;margin:0}.agent-config-inspect__dt[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);align-self:center}.agent-config-inspect__dd[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);align-self:center;word-break:break-word}.agent-config-inspect__dd--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:.875rem}.agent-config-inspect__badge[_ngcontent-%COMP%]{display:inline-block;padding:.2em .6em;border-radius:4px;font-size:.75rem;font-weight:500;background:var(--color-surface-muted, rgba(0, 0, 0, .06));color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__badge--active[_ngcontent-%COMP%]{background:var(--color-success-bg, #e3f5e1);color:var(--color-success, #34c759)}.agent-config-inspect__collapsible[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;width:100%;background:none;border:none;padding:0;cursor:pointer;font-family:inherit;text-align:left}.agent-config-inspect__chevron[_ngcontent-%COMP%]{font-size:.7rem;color:var(--color-text-secondary, #6e6e73);transition:transform .15s ease;flex-shrink:0}.agent-config-inspect__chevron--open[_ngcontent-%COMP%]{transform:rotate(180deg)}.agent-config-inspect__instructions[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;border-radius:6px;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.875rem;font-family:inherit;color:var(--color-text, #1d1d1f);white-space:pre-wrap;word-break:break-word;line-height:1.6;max-height:400px;overflow-y:auto}.agent-config-inspect__tools[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__tool[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .08));border-radius:6px;overflow:hidden}.agent-config-inspect__tool-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.75rem;width:100%;padding:.75rem 1rem;background:none;border:none;cursor:pointer;font-family:inherit;text-align:left;transition:background .1s ease}.agent-config-inspect__tool-header[_ngcontent-%COMP%]:hover{background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.agent-config-inspect__tool-name[_ngcontent-%COMP%]{font-size:.875rem;font-weight:600;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-config-inspect__tool-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:0 1rem .75rem;border-top:1px solid var(--color-border, rgba(0, 0, 0, .08))}.agent-config-inspect__tool-description[_ngcontent-%COMP%]{margin:0;padding-top:.75rem;font-size:.8125rem;line-height:1.5;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 .25rem}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:last-child{margin-bottom:0}.agent-config-inspect__tool-description[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:monospace;font-size:.8em;background:var(--color-surface-muted, rgba(0, 0, 0, .06));padding:.1em .3em;border-radius:3px}.agent-config-inspect__schema[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.8125rem;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:pre;overflow-x:auto;line-height:1.5;max-height:360px;overflow-y:auto}"],changeDetection:0})};export{R as AgentConfigInspectComponent};
1
+ import{a as L}from"./chunk-LM2BKZRF.js";import{b as z}from"./chunk-G2BRVRGR.js";import"./chunk-4F2LQOD7.js";import{a as T,c as A,d as D}from"./chunk-7MQRVE7E.js";import{a as N}from"./chunk-IRZNRZ5Q.js";import{Bb as b,Db as f,Fb as l,Ga as M,Ka as r,Rb as u,Tb as a,Ub as p,Vb as h,Wa as I,ca as _,ec as O,fc as w,ga as C,ha as x,jb as v,lb as d,ma as P,mb as s,pb as S,qb as E,rb as y,sb as i,ta as m,tb as t,ub as k}from"./chunk-5J7BTB5J.js";var F=(n,o)=>o.name;function B(n,o){n&1&&(i(0,"p",6),a(1,"Loading\u2026"),t())}function $(n,o){n&1&&(i(0,"p",7),a(1,"Failed to load agent definition."),t())}function j(n,o){if(n&1&&(i(0,"dt",12),a(1,"User context"),t(),i(2,"dd",14),a(3),t()),n&2){let e=l();r(3),p(e.userId)}}function H(n,o){if(n&1&&(i(0,"pre",21),a(1),t()),n&2){let e=l(2);r(),p(e.systemPrompt)}}function J(n,o){if(n&1){let e=b();i(0,"section",9)(1,"button",19),f("click",function(){C(e);let g=l(2);return x(g.toggleSystemPrompt())}),i(2,"h2",10),a(3,"System Prompt"),t(),i(4,"span",20),a(5," \u25BC "),t()(),d(6,H,2,1,"pre",21),t()}if(n&2){let e=l(2);r(),v("aria-expanded",!e.systemPromptCollapsed()),r(3),u("agent-config-inspect__chevron--open",!e.systemPromptCollapsed()),r(2),s(e.systemPromptCollapsed()?-1:6)}}function U(n,o){if(n&1&&(i(0,"pre",21),a(1),t()),n&2){let e=l(2);r(),p(e.instructions)}}function G(n,o){if(n&1){let e=b();i(0,"section",9)(1,"button",19),f("click",function(){C(e);let g=l(2);return x(g.toggleInstructions())}),i(2,"h2",10),a(3,"Instructions"),t(),i(4,"span",20),a(5," \u25BC "),t()(),d(6,U,2,1,"pre",21),t()}if(n&2){let e=l(2);r(),v("aria-expanded",!e.instructionsCollapsed()),r(3),u("agent-config-inspect__chevron--open",!e.instructionsCollapsed()),r(2),s(e.instructionsCollapsed()?-1:6)}}function q(n,o){n&1&&(i(0,"p",17),a(1,"No tools available for this agent."),t())}function K(n,o){if(n&1&&(k(0,"div",26),O(1,"agentosMarkdown")),n&2){let e=l(2).$implicit;y("innerHTML",w(1,1,e.description),M)}}function Q(n,o){if(n&1&&(i(0,"div",25),d(1,K,2,3,"div",26),i(2,"pre",27),a(3),t()()),n&2){let e=l().$implicit,c=l(3);r(),s(e.description?1:-1),r(2),p(c.formatSchema(e.inputSchema))}}function W(n,o){if(n&1){let e=b();i(0,"li",22)(1,"button",23),f("click",function(){let g=C(e).$implicit,V=l(3);return x(V.toggleTool(g))}),i(2,"span",24),a(3),t(),i(4,"span",20),a(5," \u25BC "),t()(),d(6,Q,4,2,"div",25),t()}if(n&2){let e=o.$implicit,c=l(3);r(),v("aria-expanded",c.isToolExpanded(e)),r(2),p(e.name),r(),u("agent-config-inspect__chevron--open",c.isToolExpanded(e)),r(2),s(c.isToolExpanded(e)?6:-1)}}function X(n,o){if(n&1&&(i(0,"ul",18),S(1,W,7,5,"li",22,F),t()),n&2){let e=l();r(),E(e.tools)}}function Y(n,o){if(n&1&&(i(0,"div",8)(1,"section",9)(2,"h2",10),a(3,"General"),t(),i(4,"dl",11)(5,"dt",12),a(6,"Name"),t(),i(7,"dd",13),a(8),t(),i(9,"dt",12),a(10,"Resolved model"),t(),i(11,"dd",14),a(12),t(),i(13,"dt",12),a(14,"Provider"),t(),i(15,"dd",13),a(16),t(),i(17,"dt",12),a(18,"Advanced execution"),t(),i(19,"dd",13)(20,"span",15),a(21),t()(),d(22,j,4,1),t()(),d(23,J,7,4,"section",9),d(24,G,7,4,"section",9),i(25,"section",9)(26,"h2",10),a(27," Tools "),i(28,"span",16),a(29),t()(),d(30,q,2,0,"p",17)(31,X,3,0,"ul",18),t()()),n&2){let e=o;r(8),p(e.name),r(4),p(e.resolvedModelApiName),r(4),p(e.resolvedProviderName),r(4),u("agent-config-inspect__badge--active",e.advancedExecution),r(),h(" ",e.advancedExecution?"Enabled":"Disabled"," "),r(),s(e.userId?22:-1),r(),s(e.systemPrompt?23:-1),r(),s(e.instructions?24:-1),r(5),h("(",e.tools.length,")"),r(),s(e.tools.length===0?30:31)}}var R=class n{route=_(T);router=_(A);destroyRef=_(P);agentConfigController=_(z);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=m(!0);hasError=m(!1);definition=m(null);expandedTools=m(new Set);systemPromptCollapsed=m(!0);instructionsCollapsed=m(!0);ngOnInit(){this.agentConfigController.getDefinitionAgentConfig(this.agentConfigId).pipe(N(this.destroyRef)).subscribe({next:o=>{this.definition.set(o),this.isLoading.set(!1)},error:()=>{this.hasError.set(!0),this.isLoading.set(!1)}})}toggleTool(o){this.expandedTools.update(e=>{let c=new Set(e);return c.has(o.name)?c.delete(o.name):c.add(o.name),c})}isToolExpanded(o){return this.expandedTools().has(o.name)}toggleSystemPrompt(){this.systemPromptCollapsed.update(o=>!o)}toggleInstructions(){this.instructionsCollapsed.update(o=>!o)}formatSchema(o){try{return JSON.stringify(JSON.parse(o),null,2)}catch(e){return o}}editRoute(){return this.isPlatformMode?["/agentos","admin","agent-configs",this.agentConfigId,"edit"]:["/agentos",this.namespaceId,"agent-configs",this.agentConfigId,"edit"]}back(){this.isPlatformMode?this.router.navigate(["/agentos","admin","agent-configs"]):this.router.navigate(["/agentos",this.namespaceId,"agent-configs"])}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=I({type:n,selectors:[["agentos-agent-config-inspect"]],decls:13,vars:2,consts:[[1,"agent-config-inspect"],[1,"agent-config-inspect__header"],["type","button","title","Back to agent configs",1,"agent-config-inspect__back",3,"click"],[1,"agent-config-inspect__back-icon"],[1,"agent-config-inspect__title"],[1,"agent-config-inspect__sibling-link",3,"routerLink"],[1,"agent-config-inspect__loading"],[1,"agent-config-inspect__error"],[1,"agent-config-inspect__content"],[1,"agent-config-inspect__section"],[1,"agent-config-inspect__section-title"],[1,"agent-config-inspect__dl"],[1,"agent-config-inspect__dt"],[1,"agent-config-inspect__dd"],[1,"agent-config-inspect__dd","agent-config-inspect__dd--mono"],[1,"agent-config-inspect__badge"],[1,"agent-config-inspect__count"],[1,"agent-config-inspect__empty"],[1,"agent-config-inspect__tools"],["type","button",1,"agent-config-inspect__collapsible",3,"click"],[1,"agent-config-inspect__chevron"],[1,"agent-config-inspect__instructions"],[1,"agent-config-inspect__tool"],["type","button",1,"agent-config-inspect__tool-header",3,"click"],[1,"agent-config-inspect__tool-name"],[1,"agent-config-inspect__tool-body"],[1,"agent-config-inspect__tool-description",3,"innerHTML"],[1,"agent-config-inspect__schema"]],template:function(e,c){if(e&1&&(i(0,"div",0)(1,"header",1)(2,"button",2),f("click",function(){return c.back()}),i(3,"span",3),a(4,"\u2190"),t(),a(5," Agent Configs "),t(),i(6,"h1",4),a(7,"Agent definition"),t(),i(8,"a",5),a(9,"Edit config \u2192"),t()(),d(10,B,2,0,"p",6)(11,$,2,0,"p",7)(12,Y,32,11,"div",8),t()),e&2){let g;r(8),y("routerLink",c.editRoute()),r(2),s(c.isLoading()?10:c.hasError()?11:(g=c.definition())?12:-1,g)}},dependencies:[D,L],styles:[".agent-config-inspect[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:720px;margin:0 auto;padding:2rem 1rem}.agent-config-inspect__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__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}.agent-config-inspect__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.agent-config-inspect__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]{font-size:.8125rem;color:var(--color-primary, #007aff);text-decoration:none}.agent-config-inspect__sibling-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.agent-config-inspect__loading[_ngcontent-%COMP%], .agent-config-inspect__error[_ngcontent-%COMP%], .agent-config-inspect__empty[_ngcontent-%COMP%]{margin:0;font-size:.9rem;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__error[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.agent-config-inspect__content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.agent-config-inspect__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;padding:1.25rem;border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:10px}.agent-config-inspect__section-title[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;font-weight:600;color:var(--color-text, #1d1d1f)}.agent-config-inspect__count[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);font-size:.875rem;margin-left:.25rem}.agent-config-inspect__dl[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;gap:.5rem 1.25rem;margin:0}.agent-config-inspect__dt[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);align-self:center}.agent-config-inspect__dd[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);align-self:center;word-break:break-word}.agent-config-inspect__dd--mono[_ngcontent-%COMP%]{font-family:monospace;font-size:.875rem}.agent-config-inspect__badge[_ngcontent-%COMP%]{display:inline-block;padding:.2em .6em;border-radius:4px;font-size:.75rem;font-weight:500;background:var(--color-surface-muted, rgba(0, 0, 0, .06));color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__badge--active[_ngcontent-%COMP%]{background:var(--color-success-bg, #e3f5e1);color:var(--color-success, #34c759)}.agent-config-inspect__collapsible[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;width:100%;background:none;border:none;padding:0;cursor:pointer;font-family:inherit;text-align:left}.agent-config-inspect__chevron[_ngcontent-%COMP%]{font-size:.7rem;color:var(--color-text-secondary, #6e6e73);transition:transform .15s ease;flex-shrink:0}.agent-config-inspect__chevron--open[_ngcontent-%COMP%]{transform:rotate(180deg)}.agent-config-inspect__instructions[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;border-radius:6px;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.875rem;font-family:inherit;color:var(--color-text, #1d1d1f);white-space:pre-wrap;word-break:break-word;line-height:1.6;max-height:400px;overflow-y:auto}.agent-config-inspect__tools[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.agent-config-inspect__tool[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .08));border-radius:6px;overflow:hidden}.agent-config-inspect__tool-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.75rem;width:100%;padding:.75rem 1rem;background:none;border:none;cursor:pointer;font-family:inherit;text-align:left;transition:background .1s ease}.agent-config-inspect__tool-header[_ngcontent-%COMP%]:hover{background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.agent-config-inspect__tool-name[_ngcontent-%COMP%]{font-size:.875rem;font-weight:600;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-config-inspect__tool-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:0 1rem .75rem;border-top:1px solid var(--color-border, rgba(0, 0, 0, .08))}.agent-config-inspect__tool-description[_ngcontent-%COMP%]{margin:0;padding-top:.75rem;font-size:.8125rem;line-height:1.5;color:var(--color-text-secondary, #6e6e73)}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 .25rem}.agent-config-inspect__tool-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:last-child{margin-bottom:0}.agent-config-inspect__tool-description[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:monospace;font-size:.8em;background:var(--color-surface-muted, rgba(0, 0, 0, .06));padding:.1em .3em;border-radius:3px}.agent-config-inspect__schema[_ngcontent-%COMP%]{margin:0;padding:.875rem 1rem;background:var(--color-surface-muted, rgba(0, 0, 0, .04));font-size:.8125rem;font-family:monospace;color:var(--color-text, #1d1d1f);white-space:pre;overflow-x:auto;line-height:1.5;max-height:360px;overflow-y:auto}"],changeDetection:0})};export{R as AgentConfigInspectComponent};
@@ -1,2 +1,2 @@
1
- import{e as Se,f as we,h as xe}from"./chunk-EJH5VPZT.js";import{g as Re,h as Le,j as Pe,k as Ve,l as We,m as B,n as Be}from"./chunk-GN7KRTUQ.js";import{c as Ee,d as Fe}from"./chunk-4URCDOMP.js";import{c as ve,d as be,l as Ce,r as Oe,t as V,u as W,v as Me}from"./chunk-RBAVAHXW.js";import{e as De,f as Ie,k as Ae,w as Te}from"./chunk-XG3WOI3P.js";import{A as ge,E as ye,K as ke,d as pe,r as me,t as ue,u as k,v as _e,x as fe,y as P}from"./chunk-TZKO65ML.js";import{$b as ce,A as b,B as w,Bb as ae,Db as y,Fb as f,G as z,Gb as re,Hb as T,Ib as ne,Jb as le,Ka as d,Kb as p,Lb as m,Pa as $,Pb as oe,R as x,Rb as E,S as D,Sb as se,T as _,Tb as F,Ub as R,Wa as J,Xa as Z,_ as G,aa as C,ab as ee,ca as l,ga as q,h as v,ha as H,ia as j,jb as M,ka as Q,lb as I,mb as A,mc as de,oa as O,rb as te,sb as s,t as S,ta as Y,tb as h,tc as he,ub as ie,uc as c,va as U,vc as L,y as K,ya as X}from"./chunk-RYEX2DR7.js";var Ye=["trigger"],Ue=["panel"],Xe=[[["mat-select-trigger"]],"*"],$e=["mat-select-trigger","*"];function Je(r,u){if(r&1&&(s(0,"span",4),F(1),h()),r&2){let e=f();d(),R(e.placeholder)}}function Ze(r,u){r&1&&T(0)}function et(r,u){if(r&1&&(s(0,"span",11),F(1),h()),r&2){let e=f(2);d(),R(e.triggerValue)}}function tt(r,u){if(r&1&&(s(0,"span",5),I(1,Ze,1,0)(2,et,2,1,"span",11),h()),r&2){let e=f();d(),A(e.customTrigger?1:2)}}function it(r,u){if(r&1){let e=ae();s(0,"div",12,1),y("keydown",function(i){q(e);let a=f();return H(a._handleKeydown(i))}),T(2,1),h()}if(r&2){let e=f();se(e.panelClass),E("mat-select-panel-animations-enabled",!e._animationsDisabled)("mat-primary",(e._parentFormField==null?null:e._parentFormField.color)==="primary")("mat-accent",(e._parentFormField==null?null:e._parentFormField.color)==="accent")("mat-warn",(e._parentFormField==null?null:e._parentFormField.color)==="warn")("mat-undefined",!(e._parentFormField!=null&&e._parentFormField.color)),M("id",e.id+"-panel")("aria-multiselectable",e.multiple)("aria-label",e.ariaLabel||null)("aria-labelledby",e._getPanelAriaLabelledby())}}var at=new C("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let r=l(Q);return()=>Ce(r)}}),rt=new C("MAT_SELECT_CONFIG"),nt=new C("MatSelectTrigger"),N=class{source;value;constructor(u,e){this.source=u,this.value=e}},Pt=(()=>{class r{_viewportRuler=l(ve);_changeDetectorRef=l(he);_elementRef=l(X);_dir=l(ge,{optional:!0});_idGenerator=l(ue);_renderer=l($);_parentFormField=l(we,{optional:!0});ngControl=l(Ie,{self:!0,optional:!0});_liveAnnouncer=l(me);_defaultOptions=l(rt,{optional:!0});_animationsDisabled=ke();_popoverLocation;_initialized=new v;_cleanupDetach;options;optionGroups;customTrigger;_positions=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"}];_scrollOptionIntoView(e){let t=this.options.toArray()[e];if(t){let i=this.panel.nativeElement,a=Ve(e,this.options,this.optionGroups),n=t._getHostElement();e===0&&a===1?i.scrollTop=0:i.scrollTop=We(n.offsetTop,n.offsetHeight,i.scrollTop,i.offsetHeight)}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0)}_getChangeEvent(e){return new N(this,e)}_scrollStrategyFactory=l(at);_panelOpen=!1;_compareWith=(e,t)=>e===t;_uid=this._idGenerator.getId("mat-select-");_triggerAriaLabelledBy=null;_previousControl;_destroy=new v;_errorStateTracker;stateChanges=new v;disableAutomaticLabeling=!0;userAriaDescribedBy;_selectionModel;_keyManager;_preferredOverlayOrigin;_overlayWidth;_onChange=()=>{};_onTouched=()=>{};_valueId=this._idGenerator.getId("mat-select-value-");_scrollStrategy;_overlayPanelClass=this._defaultOptions?.overlayPanelClass||"";get focused(){return this._focused||this._panelOpen}_focused=!1;controlType="mat-select";trigger;panel;_overlayDir;panelClass;disabled=!1;get disableRipple(){return this._disableRipple()}set disableRipple(e){this._disableRipple.set(e)}_disableRipple=Y(!1);tabIndex=0;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties()}_hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??!1;get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.stateChanges.next()}_placeholder;get required(){return this._required??this.ngControl?.control?.hasValidator(De.required)??!1}set required(e){this._required=e,this.stateChanges.next()}_required;get multiple(){return this._multiple}set multiple(e){this._selectionModel,this._multiple=e}_multiple=!1;disableOptionCentering=this._defaultOptions?.disableOptionCentering??!1;get compareWith(){return this._compareWith}set compareWith(e){this._compareWith=e,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(e){this._assignValue(e)&&this._onChange(e)}_value;ariaLabel="";ariaLabelledby;get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}typeaheadDebounceInterval;sortComparator;get id(){return this._id}set id(e){this._id=e||this._uid,this.stateChanges.next()}_id;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}panelWidth=this._defaultOptions&&typeof this._defaultOptions.panelWidth<"u"?this._defaultOptions.panelWidth:"auto";canSelectNullableOptions=this._defaultOptions?.canSelectNullableOptions??!1;optionSelectionChanges=K(()=>{let e=this.options;return e?e.changes.pipe(x(e),D(()=>b(...e.map(t=>t.onSelectionChange)))):this._initialized.pipe(D(()=>this.optionSelectionChanges))});openedChange=new O;_openedStream=this.openedChange.pipe(w(e=>e),S(()=>{}));_closedStream=this.openedChange.pipe(w(e=>!e),S(()=>{}));selectionChange=new O;valueChange=new O;constructor(){let e=l(Ee),t=l(Ae,{optional:!0}),i=l(Te,{optional:!0}),a=l(new de("tabindex"),{optional:!0}),n=l(Oe,{optional:!0});this.ngControl&&(this.ngControl.valueAccessor=this),this._defaultOptions?.typeaheadDebounceInterval!=null&&(this.typeaheadDebounceInterval=this._defaultOptions.typeaheadDebounceInterval),this._errorStateTracker=new Fe(e,this.ngControl,i,t,this.stateChanges),this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=a==null?0:parseInt(a)||0,this._popoverLocation=n?.usePopover===!1?null:"inline",this.id=this.id}ngOnInit(){this._selectionModel=new Be(this.multiple),this.stateChanges.next(),this._viewportRuler.change().pipe(_(this._destroy)).subscribe(()=>{this.panelOpen&&(this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._changeDetectorRef.detectChanges())})}ngAfterContentInit(){this._initialized.next(),this._initialized.complete(),this._initKeyManager(),this._selectionModel.changed.pipe(_(this._destroy)).subscribe(e=>{e.added.forEach(t=>t.select()),e.removed.forEach(t=>t.deselect())}),this.options.changes.pipe(x(null),_(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){let e=this._getTriggerAriaLabelledby(),t=this.ngControl;if(e!==this._triggerAriaLabelledBy){let i=this._elementRef.nativeElement;this._triggerAriaLabelledBy=e,e?i.setAttribute("aria-labelledby",e):i.removeAttribute("aria-labelledby")}t&&(this._previousControl!==t.control&&(this._previousControl!==void 0&&t.disabled!==null&&t.disabled!==this.disabled&&(this.disabled=t.disabled),this._previousControl=t.control),this.updateErrorState())}ngOnChanges(e){(e.disabled||e.userAriaDescribedBy)&&this.stateChanges.next(),e.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this.typeaheadDebounceInterval),e.panelClass&&this.panelClass instanceof Set&&(this.panelClass=Array.from(this.panelClass))}ngOnDestroy(){this._cleanupDetach?.(),this._keyManager?.destroy(),this._destroy.next(),this._destroy.complete(),this.stateChanges.complete(),this._clearFromModal()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._parentFormField&&(this._preferredOverlayOrigin=this._parentFormField.getConnectedOverlayOrigin()),this._cleanupDetach?.(),this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._applyModalPanelOwnership(),this._panelOpen=!0,this._overlayDir.positionChange.pipe(z(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()}),this._overlayDir.attachOverlay(),this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!0)))}_trackedModal=null;_applyModalPanelOwnership(){let e=this._elementRef.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!e)return;let t=`${this.id}-panel`;this._trackedModal&&P(this._trackedModal,"aria-owns",t),fe(e,"aria-owns",t),this._trackedModal=e}_clearFromModal(){if(!this._trackedModal)return;let e=`${this.id}-panel`;P(this._trackedModal,"aria-owns",e),this._trackedModal=null}close(){this._panelOpen&&(this._panelOpen=!1,this._exitAndDetach(),this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!1)))}_exitAndDetach(){if(this._animationsDisabled||!this.panel){this._detachOverlay();return}this._cleanupDetach?.(),this._cleanupDetach=()=>{t(),clearTimeout(i),this._cleanupDetach=void 0};let e=this.panel.nativeElement,t=this._renderer.listen(e,"animationend",a=>{a.animationName==="_mat-select-exit"&&(this._cleanupDetach?.(),this._detachOverlay())}),i=setTimeout(()=>{this._cleanupDetach?.(),this._detachOverlay()},200);e.classList.add("mat-select-panel-exit")}_detachOverlay(){this._overlayDir.detachOverlay(),this._changeDetectorRef.markForCheck()}writeValue(e){this._assignValue(e)}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel?.selected||[]:this._selectionModel?.selected[0]}get triggerValue(){if(this.empty)return"";if(this._multiple){let e=this._selectionModel.selected.map(t=>t.viewValue);return this._isRtl()&&e.reverse(),e.join(", ")}return this._selectionModel.selected[0].viewValue}updateErrorState(){this._errorStateTracker.updateErrorState()}_isRtl(){return this._dir?this._dir.value==="rtl":!1}_handleKeydown(e){this.disabled||(this.panelOpen?this._handleOpenKeydown(e):this._handleClosedKeydown(e))}_handleClosedKeydown(e){let t=e.keyCode,i=t===40||t===38||t===37||t===39,a=t===13||t===32,n=this._keyManager;if(!n.isTyping()&&a&&!k(e)||(this.multiple||e.altKey)&&i)e.preventDefault(),this.open();else if(!this.multiple){let g=this.selected;n.onKeydown(e);let o=this.selected;o&&g!==o&&this._liveAnnouncer.announce(o.viewValue,1e4)}}_handleOpenKeydown(e){let t=this._keyManager,i=e.keyCode,a=i===40||i===38,n=t.isTyping();if(a&&e.altKey)e.preventDefault(),this.close();else if(!n&&(i===13||i===32)&&t.activeItem&&!k(e))e.preventDefault(),t.activeItem._selectViaInteraction();else if(!n&&this._multiple&&i===65&&e.ctrlKey){e.preventDefault();let g=this.options.some(o=>!o.disabled&&!o.selected);this.options.forEach(o=>{o.disabled||(g?o.select():o.deselect())})}else{let g=t.activeItemIndex;t.onKeydown(e),this._multiple&&a&&e.shiftKey&&t.activeItem&&t.activeItemIndex!==g&&t.activeItem._selectViaInteraction()}}_handleOverlayKeydown(e){e.keyCode===27&&!k(e)&&(e.preventDefault(),this.close())}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,this._keyManager?.cancelTypeahead(),!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}get empty(){return!this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this.ngControl&&(this._value=this.ngControl.value),this._setSelectionByValue(this._value),this.stateChanges.next()})}_setSelectionByValue(e){if(this.options.forEach(t=>t.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&e)Array.isArray(e),e.forEach(t=>this._selectOptionByValue(t)),this._sortValues();else{let t=this._selectOptionByValue(e);t?this._keyManager.updateActiveItem(t):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectOptionByValue(e){let t=this.options.find(i=>{if(this._selectionModel.isSelected(i))return!1;try{return(i.value!=null||this.canSelectNullableOptions)&&this._compareWith(i.value,e)}catch(a){return!1}});return t&&this._selectionModel.select(t),t}_assignValue(e){return e!==this._value||this._multiple&&Array.isArray(e)?(this.options&&this._setSelectionByValue(e),this._value=e,!0):!1}_skipPredicate=e=>this.panelOpen?!1:e.disabled;_getOverlayWidth(e){return this.panelWidth==="auto"?(e instanceof V?e.elementRef:e||this._elementRef).nativeElement.getBoundingClientRect().width:this.panelWidth===null?"":this.panelWidth}_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck()}_initKeyManager(){this._keyManager=new _e(this.options).withTypeAhead(this.typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withPageUpDown().withAllowedModifierKeys(["shiftKey"]).skipPredicate(this._skipPredicate),this._keyManager.tabOut.subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction()})}_resetOptions(){let e=b(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(_(e)).subscribe(t=>{this._onSelect(t.source,t.isUserInput),t.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),b(...this.options.map(t=>t._stateChanges)).pipe(_(e)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this.stateChanges.next()})}_onSelect(e,t){let i=this._selectionModel.isSelected(e);!this.canSelectNullableOptions&&e.value==null&&!this._multiple?(e.deselect(),this._selectionModel.clear(),this.value!=null&&this._propagateChanges(e.value)):(i!==e.selected&&(e.selected?this._selectionModel.select(e):this._selectionModel.deselect(e)),t&&this._keyManager.setActiveItem(e),this.multiple&&(this._sortValues(),t&&this.focus())),i!==this._selectionModel.isSelected(e)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){let e=this.options.toArray();this._selectionModel.sort((t,i)=>this.sortComparator?this.sortComparator(t,i,e):e.indexOf(t)-e.indexOf(i)),this.stateChanges.next()}}_propagateChanges(e){let t;this.multiple?t=this.selected.map(i=>i.value):t=this.selected?this.selected.value:e,this._value=t,this.valueChange.emit(t),this._onChange(t),this.selectionChange.emit(this._getChangeEvent(t)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){if(this._keyManager)if(this.empty){let e=-1;for(let t=0;t<this.options.length;t++)if(!this.options.get(t).disabled){e=t;break}this._keyManager.setActiveItem(e)}else this._keyManager.setActiveItem(this._selectionModel.selected[0])}_canOpen(){return!this._panelOpen&&!this.disabled&&this.options?.length>0&&!!this._overlayDir}focus(e){this._elementRef.nativeElement.focus(e)}_getPanelAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||null,t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||"";return this.ariaLabelledby&&(e+=" "+this.ariaLabelledby),e||(e=this._valueId),e}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){let t=this._elementRef.nativeElement;e.length?t.setAttribute("aria-describedby",e.join(" ")):t.removeAttribute("aria-describedby")}onContainerClick(e){let t=pe(e);t&&(t.tagName==="MAT-OPTION"||t.classList.contains("cdk-overlay-backdrop")||t.closest(".mat-mdc-select-panel"))||(this.focus(),this.open())}get shouldLabelFloat(){return this.panelOpen||!this.empty||this.focused&&!!this.placeholder}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=J({type:r,selectors:[["mat-select"]],contentQueries:function(t,i,a){if(t&1&&ne(a,nt,5)(a,Pe,5)(a,Le,5),t&2){let n;p(n=m())&&(i.customTrigger=n.first),p(n=m())&&(i.options=n),p(n=m())&&(i.optionGroups=n)}},viewQuery:function(t,i){if(t&1&&le(Ye,5)(Ue,5)(W,5),t&2){let a;p(a=m())&&(i.trigger=a.first),p(a=m())&&(i.panel=a.first),p(a=m())&&(i._overlayDir=a.first)}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:21,hostBindings:function(t,i){t&1&&y("keydown",function(n){return i._handleKeydown(n)})("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()}),t&2&&(M("id",i.id)("tabindex",i.disabled?-1:i.tabIndex)("aria-controls",i.panelOpen?i.id+"-panel":null)("aria-expanded",i.panelOpen)("aria-label",i.ariaLabel||null)("aria-required",i.required.toString())("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-activedescendant",i._getAriaActiveDescendant()),E("mat-mdc-select-disabled",i.disabled)("mat-mdc-select-invalid",i.errorState)("mat-mdc-select-required",i.required)("mat-mdc-select-empty",i.empty)("mat-mdc-select-multiple",i.multiple)("mat-select-open",i.panelOpen))},inputs:{userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],panelClass:"panelClass",disabled:[2,"disabled","disabled",c],disableRipple:[2,"disableRipple","disableRipple",c],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:L(e)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",c],placeholder:"placeholder",required:[2,"required","required",c],multiple:[2,"multiple","multiple",c],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",c],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",L],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth",canSelectNullableOptions:[2,"canSelectNullableOptions","canSelectNullableOptions",c]},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],features:[ce([{provide:Se,useExisting:r},{provide:Re,useExisting:r}]),U],ngContentSelectors:$e,decls:11,vars:10,consts:[["fallbackOverlayOrigin","cdkOverlayOrigin","trigger",""],["panel",""],["cdk-overlay-origin","",1,"mat-mdc-select-trigger",3,"click"],[1,"mat-mdc-select-value"],[1,"mat-mdc-select-placeholder","mat-mdc-select-min-line"],[1,"mat-mdc-select-value-text"],[1,"mat-mdc-select-arrow-wrapper"],[1,"mat-mdc-select-arrow"],["viewBox","0 0 24 24","width","24px","height","24px","focusable","false","aria-hidden","true"],["d","M7 10l5 5 5-5z"],["cdk-connected-overlay","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"detach","backdropClick","overlayKeydown","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayWidth","cdkConnectedOverlayFlexibleDimensions","cdkConnectedOverlayUsePopover"],[1,"mat-mdc-select-min-line"],["role","listbox","tabindex","-1",1,"mat-mdc-select-panel","mdc-menu-surface","mdc-menu-surface--open",3,"keydown"]],template:function(t,i){if(t&1&&(re(Xe),s(0,"div",2,0),y("click",function(){return i.open()}),s(3,"div",3),I(4,Je,2,1,"span",4)(5,tt,3,1,"span",5),h(),s(6,"div",6)(7,"div",7),j(),s(8,"svg",8),ie(9,"path",9),h()()()(),ee(10,it,3,16,"ng-template",10),y("detach",function(){return i.close()})("backdropClick",function(){return i.close()})("overlayKeydown",function(n){return i._handleOverlayKeydown(n)})),t&2){let a=oe(1);d(3),M("id",i._valueId),d(),A(i.empty?4:5),d(6),te("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",i._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",i._scrollStrategy)("cdkConnectedOverlayOrigin",i._preferredOverlayOrigin||a)("cdkConnectedOverlayPositions",i._positions)("cdkConnectedOverlayWidth",i._overlayWidth)("cdkConnectedOverlayFlexibleDimensions",!0)("cdkConnectedOverlayUsePopover",i._popoverLocation)}},dependencies:[V,W],styles:[`@keyframes _mat-select-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}@keyframes _mat-select-exit{from{opacity:1}to{opacity:0}}.mat-mdc-select{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-sys-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-sys-body-large-tracking))}div.mat-mdc-select-panel{box-shadow:var(--mat-select-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12))}.mat-mdc-select-disabled{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-disabled .mat-mdc-select-placeholder{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-trigger{display:inline-flex;align-items:center;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.mat-mdc-select-disabled .mat-mdc-select-trigger{-webkit-user-select:none;user-select:none;cursor:default}.mat-mdc-select-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-mdc-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-mdc-select-arrow-wrapper{height:24px;flex-shrink:0;display:inline-flex;align-items:center}.mat-form-field-appearance-fill .mdc-text-field--no-label .mat-mdc-select-arrow-wrapper{transform:none}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-invalid .mat-mdc-select-arrow,.mat-form-field-invalid:not(.mat-form-field-disabled) .mat-mdc-form-field-infix::after{color:var(--mat-select-invalid-arrow-color, var(--mat-sys-error))}.mat-mdc-select-arrow{width:10px;height:5px;position:relative;color:var(--mat-select-enabled-arrow-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--mat-select-focused-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-disabled .mat-mdc-select-arrow{color:var(--mat-select-disabled-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-select-open .mat-mdc-select-arrow{transform:rotate(180deg)}.mat-form-field-animations-enabled .mat-mdc-select-arrow{transition:transform 80ms linear}.mat-mdc-select-arrow svg{fill:currentColor;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}@media(forced-colors: active){.mat-mdc-select-arrow svg{fill:CanvasText}.mat-mdc-select-disabled .mat-mdc-select-arrow svg{fill:GrayText}}div.mat-mdc-select-panel{width:100%;max-height:275px;outline:0;overflow:auto;padding:8px 0;border-radius:4px;box-sizing:border-box;position:relative;background-color:var(--mat-select-panel-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-select-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-select-panel-above) div.mat-mdc-select-panel{border-top-left-radius:0;border-top-right-radius:0;transform-origin:top center}.mat-mdc-select-panel-above div.mat-mdc-select-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:bottom center}.mat-select-panel-animations-enabled{animation:_mat-select-enter 120ms cubic-bezier(0, 0, 0.2, 1)}.mat-select-panel-animations-enabled.mat-select-panel-exit{animation:_mat-select-exit 100ms linear}.mat-mdc-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1);color:var(--mat-select-placeholder-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field:not(.mat-form-field-animations-enabled) .mat-mdc-select-placeholder,._mat-animation-noopable .mat-mdc-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-mdc-select-placeholder{color:rgba(0,0,0,0);-webkit-text-fill-color:rgba(0,0,0,0);transition:none;display:block}.mat-mdc-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mat-mdc-floating-label{max-width:calc(100% - 18px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 24px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-text-field--label-floating .mdc-notched-outline__notch{max-width:calc(100% - 24px)}.mat-mdc-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;visibility:hidden}.mat-form-field-appearance-fill .mat-mdc-select-arrow-wrapper{transform:var(--mat-select-arrow-transform, translateY(-8px))}
1
+ import{e as Se,f as we,h as xe}from"./chunk-HE2ON544.js";import{g as Re,h as Le,j as Pe,k as Ve,l as We,m as B,n as Be}from"./chunk-BGEXT3EN.js";import{c as Ee,d as Fe}from"./chunk-PKBNMAQJ.js";import{c as ve,d as be,l as Ce,r as Oe,t as V,u as W,v as Me}from"./chunk-OBV4LQBZ.js";import{e as De,f as Ie,k as Ae,w as Te}from"./chunk-WLSXA23B.js";import{A as ge,E as ye,K as ke,d as pe,r as me,t as ue,u as k,v as _e,x as fe,y as P}from"./chunk-E3XC4CVU.js";import{A as b,B as w,Bb as ae,Db as y,Fb as f,G as z,Gb as re,Hb as T,Ib as ne,Jb as le,Ka as d,Kb as p,Lb as m,Pa as $,Pb as oe,R as x,Rb as E,S as D,Sb as se,T as _,Tb as F,Ub as R,Wa as J,Xa as Z,_ as G,aa as C,ab as ee,ac as ce,ca as l,ga as q,h as v,ha as H,ia as j,jb as M,ka as Q,lb as I,mb as A,nc as de,oa as O,rb as te,sb as s,t as S,ta as Y,tb as h,ub as ie,uc as he,va as U,vc as c,wc as L,y as K,ya as X}from"./chunk-5J7BTB5J.js";var Ye=["trigger"],Ue=["panel"],Xe=[[["mat-select-trigger"]],"*"],$e=["mat-select-trigger","*"];function Je(r,u){if(r&1&&(s(0,"span",4),F(1),h()),r&2){let e=f();d(),R(e.placeholder)}}function Ze(r,u){r&1&&T(0)}function et(r,u){if(r&1&&(s(0,"span",11),F(1),h()),r&2){let e=f(2);d(),R(e.triggerValue)}}function tt(r,u){if(r&1&&(s(0,"span",5),I(1,Ze,1,0)(2,et,2,1,"span",11),h()),r&2){let e=f();d(),A(e.customTrigger?1:2)}}function it(r,u){if(r&1){let e=ae();s(0,"div",12,1),y("keydown",function(i){q(e);let a=f();return H(a._handleKeydown(i))}),T(2,1),h()}if(r&2){let e=f();se(e.panelClass),E("mat-select-panel-animations-enabled",!e._animationsDisabled)("mat-primary",(e._parentFormField==null?null:e._parentFormField.color)==="primary")("mat-accent",(e._parentFormField==null?null:e._parentFormField.color)==="accent")("mat-warn",(e._parentFormField==null?null:e._parentFormField.color)==="warn")("mat-undefined",!(e._parentFormField!=null&&e._parentFormField.color)),M("id",e.id+"-panel")("aria-multiselectable",e.multiple)("aria-label",e.ariaLabel||null)("aria-labelledby",e._getPanelAriaLabelledby())}}var at=new C("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let r=l(Q);return()=>Ce(r)}}),rt=new C("MAT_SELECT_CONFIG"),nt=new C("MatSelectTrigger"),N=class{source;value;constructor(u,e){this.source=u,this.value=e}},Pt=(()=>{class r{_viewportRuler=l(ve);_changeDetectorRef=l(he);_elementRef=l(X);_dir=l(ge,{optional:!0});_idGenerator=l(ue);_renderer=l($);_parentFormField=l(we,{optional:!0});ngControl=l(Ie,{self:!0,optional:!0});_liveAnnouncer=l(me);_defaultOptions=l(rt,{optional:!0});_animationsDisabled=ke();_popoverLocation;_initialized=new v;_cleanupDetach;options;optionGroups;customTrigger;_positions=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"}];_scrollOptionIntoView(e){let t=this.options.toArray()[e];if(t){let i=this.panel.nativeElement,a=Ve(e,this.options,this.optionGroups),n=t._getHostElement();e===0&&a===1?i.scrollTop=0:i.scrollTop=We(n.offsetTop,n.offsetHeight,i.scrollTop,i.offsetHeight)}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0)}_getChangeEvent(e){return new N(this,e)}_scrollStrategyFactory=l(at);_panelOpen=!1;_compareWith=(e,t)=>e===t;_uid=this._idGenerator.getId("mat-select-");_triggerAriaLabelledBy=null;_previousControl;_destroy=new v;_errorStateTracker;stateChanges=new v;disableAutomaticLabeling=!0;userAriaDescribedBy;_selectionModel;_keyManager;_preferredOverlayOrigin;_overlayWidth;_onChange=()=>{};_onTouched=()=>{};_valueId=this._idGenerator.getId("mat-select-value-");_scrollStrategy;_overlayPanelClass=this._defaultOptions?.overlayPanelClass||"";get focused(){return this._focused||this._panelOpen}_focused=!1;controlType="mat-select";trigger;panel;_overlayDir;panelClass;disabled=!1;get disableRipple(){return this._disableRipple()}set disableRipple(e){this._disableRipple.set(e)}_disableRipple=Y(!1);tabIndex=0;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties()}_hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??!1;get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.stateChanges.next()}_placeholder;get required(){return this._required??this.ngControl?.control?.hasValidator(De.required)??!1}set required(e){this._required=e,this.stateChanges.next()}_required;get multiple(){return this._multiple}set multiple(e){this._selectionModel,this._multiple=e}_multiple=!1;disableOptionCentering=this._defaultOptions?.disableOptionCentering??!1;get compareWith(){return this._compareWith}set compareWith(e){this._compareWith=e,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(e){this._assignValue(e)&&this._onChange(e)}_value;ariaLabel="";ariaLabelledby;get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}typeaheadDebounceInterval;sortComparator;get id(){return this._id}set id(e){this._id=e||this._uid,this.stateChanges.next()}_id;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}panelWidth=this._defaultOptions&&typeof this._defaultOptions.panelWidth<"u"?this._defaultOptions.panelWidth:"auto";canSelectNullableOptions=this._defaultOptions?.canSelectNullableOptions??!1;optionSelectionChanges=K(()=>{let e=this.options;return e?e.changes.pipe(x(e),D(()=>b(...e.map(t=>t.onSelectionChange)))):this._initialized.pipe(D(()=>this.optionSelectionChanges))});openedChange=new O;_openedStream=this.openedChange.pipe(w(e=>e),S(()=>{}));_closedStream=this.openedChange.pipe(w(e=>!e),S(()=>{}));selectionChange=new O;valueChange=new O;constructor(){let e=l(Ee),t=l(Ae,{optional:!0}),i=l(Te,{optional:!0}),a=l(new de("tabindex"),{optional:!0}),n=l(Oe,{optional:!0});this.ngControl&&(this.ngControl.valueAccessor=this),this._defaultOptions?.typeaheadDebounceInterval!=null&&(this.typeaheadDebounceInterval=this._defaultOptions.typeaheadDebounceInterval),this._errorStateTracker=new Fe(e,this.ngControl,i,t,this.stateChanges),this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=a==null?0:parseInt(a)||0,this._popoverLocation=n?.usePopover===!1?null:"inline",this.id=this.id}ngOnInit(){this._selectionModel=new Be(this.multiple),this.stateChanges.next(),this._viewportRuler.change().pipe(_(this._destroy)).subscribe(()=>{this.panelOpen&&(this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._changeDetectorRef.detectChanges())})}ngAfterContentInit(){this._initialized.next(),this._initialized.complete(),this._initKeyManager(),this._selectionModel.changed.pipe(_(this._destroy)).subscribe(e=>{e.added.forEach(t=>t.select()),e.removed.forEach(t=>t.deselect())}),this.options.changes.pipe(x(null),_(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){let e=this._getTriggerAriaLabelledby(),t=this.ngControl;if(e!==this._triggerAriaLabelledBy){let i=this._elementRef.nativeElement;this._triggerAriaLabelledBy=e,e?i.setAttribute("aria-labelledby",e):i.removeAttribute("aria-labelledby")}t&&(this._previousControl!==t.control&&(this._previousControl!==void 0&&t.disabled!==null&&t.disabled!==this.disabled&&(this.disabled=t.disabled),this._previousControl=t.control),this.updateErrorState())}ngOnChanges(e){(e.disabled||e.userAriaDescribedBy)&&this.stateChanges.next(),e.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this.typeaheadDebounceInterval),e.panelClass&&this.panelClass instanceof Set&&(this.panelClass=Array.from(this.panelClass))}ngOnDestroy(){this._cleanupDetach?.(),this._keyManager?.destroy(),this._destroy.next(),this._destroy.complete(),this.stateChanges.complete(),this._clearFromModal()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._parentFormField&&(this._preferredOverlayOrigin=this._parentFormField.getConnectedOverlayOrigin()),this._cleanupDetach?.(),this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._applyModalPanelOwnership(),this._panelOpen=!0,this._overlayDir.positionChange.pipe(z(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()}),this._overlayDir.attachOverlay(),this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!0)))}_trackedModal=null;_applyModalPanelOwnership(){let e=this._elementRef.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!e)return;let t=`${this.id}-panel`;this._trackedModal&&P(this._trackedModal,"aria-owns",t),fe(e,"aria-owns",t),this._trackedModal=e}_clearFromModal(){if(!this._trackedModal)return;let e=`${this.id}-panel`;P(this._trackedModal,"aria-owns",e),this._trackedModal=null}close(){this._panelOpen&&(this._panelOpen=!1,this._exitAndDetach(),this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!1)))}_exitAndDetach(){if(this._animationsDisabled||!this.panel){this._detachOverlay();return}this._cleanupDetach?.(),this._cleanupDetach=()=>{t(),clearTimeout(i),this._cleanupDetach=void 0};let e=this.panel.nativeElement,t=this._renderer.listen(e,"animationend",a=>{a.animationName==="_mat-select-exit"&&(this._cleanupDetach?.(),this._detachOverlay())}),i=setTimeout(()=>{this._cleanupDetach?.(),this._detachOverlay()},200);e.classList.add("mat-select-panel-exit")}_detachOverlay(){this._overlayDir.detachOverlay(),this._changeDetectorRef.markForCheck()}writeValue(e){this._assignValue(e)}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel?.selected||[]:this._selectionModel?.selected[0]}get triggerValue(){if(this.empty)return"";if(this._multiple){let e=this._selectionModel.selected.map(t=>t.viewValue);return this._isRtl()&&e.reverse(),e.join(", ")}return this._selectionModel.selected[0].viewValue}updateErrorState(){this._errorStateTracker.updateErrorState()}_isRtl(){return this._dir?this._dir.value==="rtl":!1}_handleKeydown(e){this.disabled||(this.panelOpen?this._handleOpenKeydown(e):this._handleClosedKeydown(e))}_handleClosedKeydown(e){let t=e.keyCode,i=t===40||t===38||t===37||t===39,a=t===13||t===32,n=this._keyManager;if(!n.isTyping()&&a&&!k(e)||(this.multiple||e.altKey)&&i)e.preventDefault(),this.open();else if(!this.multiple){let g=this.selected;n.onKeydown(e);let o=this.selected;o&&g!==o&&this._liveAnnouncer.announce(o.viewValue,1e4)}}_handleOpenKeydown(e){let t=this._keyManager,i=e.keyCode,a=i===40||i===38,n=t.isTyping();if(a&&e.altKey)e.preventDefault(),this.close();else if(!n&&(i===13||i===32)&&t.activeItem&&!k(e))e.preventDefault(),t.activeItem._selectViaInteraction();else if(!n&&this._multiple&&i===65&&e.ctrlKey){e.preventDefault();let g=this.options.some(o=>!o.disabled&&!o.selected);this.options.forEach(o=>{o.disabled||(g?o.select():o.deselect())})}else{let g=t.activeItemIndex;t.onKeydown(e),this._multiple&&a&&e.shiftKey&&t.activeItem&&t.activeItemIndex!==g&&t.activeItem._selectViaInteraction()}}_handleOverlayKeydown(e){e.keyCode===27&&!k(e)&&(e.preventDefault(),this.close())}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,this._keyManager?.cancelTypeahead(),!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}get empty(){return!this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this.ngControl&&(this._value=this.ngControl.value),this._setSelectionByValue(this._value),this.stateChanges.next()})}_setSelectionByValue(e){if(this.options.forEach(t=>t.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&e)Array.isArray(e),e.forEach(t=>this._selectOptionByValue(t)),this._sortValues();else{let t=this._selectOptionByValue(e);t?this._keyManager.updateActiveItem(t):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectOptionByValue(e){let t=this.options.find(i=>{if(this._selectionModel.isSelected(i))return!1;try{return(i.value!=null||this.canSelectNullableOptions)&&this._compareWith(i.value,e)}catch(a){return!1}});return t&&this._selectionModel.select(t),t}_assignValue(e){return e!==this._value||this._multiple&&Array.isArray(e)?(this.options&&this._setSelectionByValue(e),this._value=e,!0):!1}_skipPredicate=e=>this.panelOpen?!1:e.disabled;_getOverlayWidth(e){return this.panelWidth==="auto"?(e instanceof V?e.elementRef:e||this._elementRef).nativeElement.getBoundingClientRect().width:this.panelWidth===null?"":this.panelWidth}_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck()}_initKeyManager(){this._keyManager=new _e(this.options).withTypeAhead(this.typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withPageUpDown().withAllowedModifierKeys(["shiftKey"]).skipPredicate(this._skipPredicate),this._keyManager.tabOut.subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction()})}_resetOptions(){let e=b(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(_(e)).subscribe(t=>{this._onSelect(t.source,t.isUserInput),t.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),b(...this.options.map(t=>t._stateChanges)).pipe(_(e)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this.stateChanges.next()})}_onSelect(e,t){let i=this._selectionModel.isSelected(e);!this.canSelectNullableOptions&&e.value==null&&!this._multiple?(e.deselect(),this._selectionModel.clear(),this.value!=null&&this._propagateChanges(e.value)):(i!==e.selected&&(e.selected?this._selectionModel.select(e):this._selectionModel.deselect(e)),t&&this._keyManager.setActiveItem(e),this.multiple&&(this._sortValues(),t&&this.focus())),i!==this._selectionModel.isSelected(e)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){let e=this.options.toArray();this._selectionModel.sort((t,i)=>this.sortComparator?this.sortComparator(t,i,e):e.indexOf(t)-e.indexOf(i)),this.stateChanges.next()}}_propagateChanges(e){let t;this.multiple?t=this.selected.map(i=>i.value):t=this.selected?this.selected.value:e,this._value=t,this.valueChange.emit(t),this._onChange(t),this.selectionChange.emit(this._getChangeEvent(t)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){if(this._keyManager)if(this.empty){let e=-1;for(let t=0;t<this.options.length;t++)if(!this.options.get(t).disabled){e=t;break}this._keyManager.setActiveItem(e)}else this._keyManager.setActiveItem(this._selectionModel.selected[0])}_canOpen(){return!this._panelOpen&&!this.disabled&&this.options?.length>0&&!!this._overlayDir}focus(e){this._elementRef.nativeElement.focus(e)}_getPanelAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||null,t=e?e+" ":"";return this.ariaLabelledby?t+this.ariaLabelledby:e}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||"";return this.ariaLabelledby&&(e+=" "+this.ariaLabelledby),e||(e=this._valueId),e}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){let t=this._elementRef.nativeElement;e.length?t.setAttribute("aria-describedby",e.join(" ")):t.removeAttribute("aria-describedby")}onContainerClick(e){let t=pe(e);t&&(t.tagName==="MAT-OPTION"||t.classList.contains("cdk-overlay-backdrop")||t.closest(".mat-mdc-select-panel"))||(this.focus(),this.open())}get shouldLabelFloat(){return this.panelOpen||!this.empty||this.focused&&!!this.placeholder}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=J({type:r,selectors:[["mat-select"]],contentQueries:function(t,i,a){if(t&1&&ne(a,nt,5)(a,Pe,5)(a,Le,5),t&2){let n;p(n=m())&&(i.customTrigger=n.first),p(n=m())&&(i.options=n),p(n=m())&&(i.optionGroups=n)}},viewQuery:function(t,i){if(t&1&&le(Ye,5)(Ue,5)(W,5),t&2){let a;p(a=m())&&(i.trigger=a.first),p(a=m())&&(i.panel=a.first),p(a=m())&&(i._overlayDir=a.first)}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:21,hostBindings:function(t,i){t&1&&y("keydown",function(n){return i._handleKeydown(n)})("focus",function(){return i._onFocus()})("blur",function(){return i._onBlur()}),t&2&&(M("id",i.id)("tabindex",i.disabled?-1:i.tabIndex)("aria-controls",i.panelOpen?i.id+"-panel":null)("aria-expanded",i.panelOpen)("aria-label",i.ariaLabel||null)("aria-required",i.required.toString())("aria-disabled",i.disabled.toString())("aria-invalid",i.errorState)("aria-activedescendant",i._getAriaActiveDescendant()),E("mat-mdc-select-disabled",i.disabled)("mat-mdc-select-invalid",i.errorState)("mat-mdc-select-required",i.required)("mat-mdc-select-empty",i.empty)("mat-mdc-select-multiple",i.multiple)("mat-select-open",i.panelOpen))},inputs:{userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],panelClass:"panelClass",disabled:[2,"disabled","disabled",c],disableRipple:[2,"disableRipple","disableRipple",c],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:L(e)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",c],placeholder:"placeholder",required:[2,"required","required",c],multiple:[2,"multiple","multiple",c],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",c],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",L],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth",canSelectNullableOptions:[2,"canSelectNullableOptions","canSelectNullableOptions",c]},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],features:[ce([{provide:Se,useExisting:r},{provide:Re,useExisting:r}]),U],ngContentSelectors:$e,decls:11,vars:10,consts:[["fallbackOverlayOrigin","cdkOverlayOrigin","trigger",""],["panel",""],["cdk-overlay-origin","",1,"mat-mdc-select-trigger",3,"click"],[1,"mat-mdc-select-value"],[1,"mat-mdc-select-placeholder","mat-mdc-select-min-line"],[1,"mat-mdc-select-value-text"],[1,"mat-mdc-select-arrow-wrapper"],[1,"mat-mdc-select-arrow"],["viewBox","0 0 24 24","width","24px","height","24px","focusable","false","aria-hidden","true"],["d","M7 10l5 5 5-5z"],["cdk-connected-overlay","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"detach","backdropClick","overlayKeydown","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayWidth","cdkConnectedOverlayFlexibleDimensions","cdkConnectedOverlayUsePopover"],[1,"mat-mdc-select-min-line"],["role","listbox","tabindex","-1",1,"mat-mdc-select-panel","mdc-menu-surface","mdc-menu-surface--open",3,"keydown"]],template:function(t,i){if(t&1&&(re(Xe),s(0,"div",2,0),y("click",function(){return i.open()}),s(3,"div",3),I(4,Je,2,1,"span",4)(5,tt,3,1,"span",5),h(),s(6,"div",6)(7,"div",7),j(),s(8,"svg",8),ie(9,"path",9),h()()()(),ee(10,it,3,16,"ng-template",10),y("detach",function(){return i.close()})("backdropClick",function(){return i.close()})("overlayKeydown",function(n){return i._handleOverlayKeydown(n)})),t&2){let a=oe(1);d(3),M("id",i._valueId),d(),A(i.empty?4:5),d(6),te("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",i._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",i._scrollStrategy)("cdkConnectedOverlayOrigin",i._preferredOverlayOrigin||a)("cdkConnectedOverlayPositions",i._positions)("cdkConnectedOverlayWidth",i._overlayWidth)("cdkConnectedOverlayFlexibleDimensions",!0)("cdkConnectedOverlayUsePopover",i._popoverLocation)}},dependencies:[V,W],styles:[`@keyframes _mat-select-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}@keyframes _mat-select-exit{from{opacity:1}to{opacity:0}}.mat-mdc-select{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-sys-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-sys-body-large-tracking))}div.mat-mdc-select-panel{box-shadow:var(--mat-select-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12))}.mat-mdc-select-disabled{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-disabled .mat-mdc-select-placeholder{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-trigger{display:inline-flex;align-items:center;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.mat-mdc-select-disabled .mat-mdc-select-trigger{-webkit-user-select:none;user-select:none;cursor:default}.mat-mdc-select-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-mdc-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-mdc-select-arrow-wrapper{height:24px;flex-shrink:0;display:inline-flex;align-items:center}.mat-form-field-appearance-fill .mdc-text-field--no-label .mat-mdc-select-arrow-wrapper{transform:none}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-invalid .mat-mdc-select-arrow,.mat-form-field-invalid:not(.mat-form-field-disabled) .mat-mdc-form-field-infix::after{color:var(--mat-select-invalid-arrow-color, var(--mat-sys-error))}.mat-mdc-select-arrow{width:10px;height:5px;position:relative;color:var(--mat-select-enabled-arrow-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--mat-select-focused-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-disabled .mat-mdc-select-arrow{color:var(--mat-select-disabled-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-select-open .mat-mdc-select-arrow{transform:rotate(180deg)}.mat-form-field-animations-enabled .mat-mdc-select-arrow{transition:transform 80ms linear}.mat-mdc-select-arrow svg{fill:currentColor;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}@media(forced-colors: active){.mat-mdc-select-arrow svg{fill:CanvasText}.mat-mdc-select-disabled .mat-mdc-select-arrow svg{fill:GrayText}}div.mat-mdc-select-panel{width:100%;max-height:275px;outline:0;overflow:auto;padding:8px 0;border-radius:4px;box-sizing:border-box;position:relative;background-color:var(--mat-select-panel-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-select-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-select-panel-above) div.mat-mdc-select-panel{border-top-left-radius:0;border-top-right-radius:0;transform-origin:top center}.mat-mdc-select-panel-above div.mat-mdc-select-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:bottom center}.mat-select-panel-animations-enabled{animation:_mat-select-enter 120ms cubic-bezier(0, 0, 0.2, 1)}.mat-select-panel-animations-enabled.mat-select-panel-exit{animation:_mat-select-exit 100ms linear}.mat-mdc-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1);color:var(--mat-select-placeholder-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field:not(.mat-form-field-animations-enabled) .mat-mdc-select-placeholder,._mat-animation-noopable .mat-mdc-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-mdc-select-placeholder{color:rgba(0,0,0,0);-webkit-text-fill-color:rgba(0,0,0,0);transition:none;display:block}.mat-mdc-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mat-mdc-floating-label{max-width:calc(100% - 18px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 24px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-text-field--label-floating .mdc-notched-outline__notch{max-width:calc(100% - 24px)}.mat-mdc-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;visibility:hidden}.mat-form-field-appearance-fill .mat-mdc-select-arrow-wrapper{transform:var(--mat-select-arrow-transform, translateY(-8px))}
2
2
  `],encapsulation:2,changeDetection:0})}return r})();var Vt=(()=>{class r{static \u0275fac=function(t){return new(t||r)};static \u0275mod=Z({type:r});static \u0275inj=G({imports:[Me,B,ye,be,xe,B]})}return r})();export{Pt as a,Vt as b};
@@ -1 +1 @@
1
- import{a as K}from"./chunk-JTM5UHB2.js";import"./chunk-J3CZ3MOZ.js";import{a as T,c as G}from"./chunk-H7A4LOFH.js";import{a as w}from"./chunk-RI2JQRSB.js";import{F as J,c as z,e as c,g as $,h as R,i as F,l as v,n as L,r as N,s as B,t as q,u as U,v as j,w as H}from"./chunk-XG3WOI3P.js";import{Bb as y,Db as s,Fb as d,Ka as a,Rb as P,Tb as r,Ub as b,Vb as k,Wa as D,a as A,b as V,ca as h,ga as f,ha as _,lb as u,ma as I,mb as g,nb as S,pb as E,qb as O,rb as p,sb as n,ta as C,tb as o,ub as x}from"./chunk-RYEX2DR7.js";function W(m,t){m&1&&(n(0,"p",5),r(1,"Loading\u2026"),o())}function X(m,t){m&1&&(n(0,"span",12),r(1,"Name is required."),o())}function Y(m,t){m&1&&(n(0,"p",19),r(1,"No parameters defined."),o())}function Z(m,t){m&1&&(n(0,"span",12),r(1,"Parameter name is required."),o())}function ee(m,t){if(m&1){let e=y();n(0,"div",20)(1,"div",27)(2,"div",28)(3,"label",29),r(4,"Name "),n(5,"span",10),r(6,"*"),o()(),x(7,"input",30),u(8,Z,2,0,"span",12),o(),n(9,"div",28)(10,"label",29),r(11,"Description"),o(),x(12,"input",31),o(),n(13,"div",28)(14,"label",29),r(15,"Default value"),o(),x(16,"input",32),o()(),n(17,"button",33),s("click",function(){let l=f(e).$index,M=d(2);return _(M.removeParameter(l))}),r(18," \xD7 "),o()()}if(m&2){let e=t.$implicit,i=t.$index;p("formGroupName",i),a(3),p("for","param-name-"+i),a(4),P("prompt-form__input--invalid",e.controls.name.invalid&&e.controls.name.touched),p("id","param-name-"+i),a(),g(e.controls.name.invalid&&e.controls.name.touched?8:-1),a(2),p("for","param-desc-"+i),a(2),p("id","param-desc-"+i),a(2),p("for","param-default-"+i),a(2),p("id","param-default-"+i)}}function te(m,t){m&1&&(n(0,"span",12),r(1,"Content entry must not be blank."),o())}function re(m,t){if(m&1){let e=y();n(0,"div",22)(1,"span",34),r(2),o(),n(3,"div",35),x(4,"textarea",36),u(5,te,2,0,"span",12),o(),n(6,"button",37),s("click",function(){let l=f(e).$index,M=d(2);return _(M.removeContentEntry(l))}),r(7," \xD7 "),o()()}if(m&2){let e=t.$implicit,i=t.$index,l=d(2);a(2),b(i+1),a(2),P("prompt-form__textarea--invalid",e.invalid&&e.touched),p("formControlName",i),a(),g(e.invalid&&e.touched?5:-1),a(),p("disabled",l.contentArray.length===1)}}function oe(m,t){if(m&1&&(n(0,"p",23),r(1),o()),m&2){let e=d(2);a(),b(e.errorMessage())}}function ne(m,t){if(m&1){let e=y();n(0,"form",7),s("ngSubmit",function(){f(e);let l=d();return _(l.submit())}),n(1,"div",8)(2,"label",9),r(3,"Name "),n(4,"span",10),r(5,"*"),o()(),x(6,"input",11),u(7,X,2,0,"span",12),o(),n(8,"div",8)(9,"label",13),r(10,"Description"),o(),x(11,"input",14),o(),n(12,"fieldset",15)(13,"legend",16),r(14," Parameters "),n(15,"span",17),r(16,"Named placeholders used in content"),o()(),n(17,"p",18),r(18," Each parameter must have a name and a default value. Use "),n(19,"code"),r(20),o(),r(21," in content entries to reference them. "),o(),u(22,Y,2,0,"p",19),E(23,ee,19,10,"div",20,S),n(25,"button",21),s("click",function(){f(e);let l=d();return _(l.addParameter())}),r(26,"+ Add parameter"),o()(),n(27,"fieldset",15)(28,"legend",16),r(29," Content "),n(30,"span",10),r(31,"*"),o(),n(32,"span",17),r(33,"Ordered list of text commands"),o()(),n(34,"p",18),r(35," Each content entry is a command. Use "),n(36,"code"),r(37,"@AgentName"),o(),r(38," to target an agent, "),n(39,"code"),r(40,"/promptName param1 param2"),o(),r(41," to call another prompt, and "),n(42,"code"),r(43),o(),r(44," for parameter placeholders. "),o(),E(45,re,8,6,"div",22,S),n(47,"button",21),s("click",function(){f(e);let l=d();return _(l.addContentEntry())}),r(48,"+ Add content entry"),o()(),u(49,oe,2,1,"p",23),n(50,"div",24)(51,"button",25),r(52),o(),n(53,"button",26),s("click",function(){f(e);let l=d();return _(l.cancel())}),r(54,"Cancel"),o()()()}if(m&2){let e=d();p("formGroup",e.form),a(6),P("prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),p("formControl",e.nameControl),a(),g(e.nameControl.invalid&&e.nameControl.touched?7:-1),a(4),p("formControl",e.descriptionControl),a(),p("formArrayName","parameters"),a(8),b(e.paramPlaceholderSyntax),a(2),g(e.parametersArray.length===0?22:-1),a(),O(e.parametersArray.controls),a(4),p("formArrayName","content"),a(16),b(e.paramPlaceholderSyntax),a(2),O(e.contentArray.controls),a(4),g(e.errorMessage()?49:-1),a(2),p("disabled",e.form.invalid||e.isSubmitting()),a(),k(" ",e.isEditMode()?"Save changes":"Create"," ")}}var Q=class m{route=h(T);router=h(G);destroyRef=h(I);promptState=h(K);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new F({name:new v("",{nonNullable:!0,validators:[c.required,c.minLength(1)]}),description:new v(null),content:new N([this.createContentControl()],{validators:[c.required]}),parameters:new N([])});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get contentArray(){return this.form.controls.content}get parametersArray(){return this.form.controls.parameters}isEditMode=C(!1);isSubmitting=C(!1);isLoading=C(!1);errorMessage=C(null);paramPlaceholderSyntax="{{paramName}}";existingPrompt=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("promptId");t&&(this.isEditMode.set(!0),this.loadPrompt(t))}loadPrompt(t){this.isLoading.set(!0),this.promptState.getById(t).pipe(w(this.destroyRef)).subscribe({next:e=>{this.existingPrompt=e,this.hydrateForm(e),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),this.navigateBack()}})}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.contentArray.clear(),(t.content.length>0?t.content:[""]).forEach(i=>this.contentArray.push(this.createContentControl(i))),this.parametersArray.clear(),(t.parameters??[]).forEach(i=>this.parametersArray.push(this.createParameterGroup(i)))}createContentControl(t=""){return new v(t,{nonNullable:!0,validators:[c.required,c.pattern(/\S/)]})}addContentEntry(){this.contentArray.push(this.createContentControl())}removeContentEntry(t){this.contentArray.length>1&&this.contentArray.removeAt(t)}createParameterGroup(t){return new F({name:new v(t?.name??"",{nonNullable:!0,validators:[c.required,c.minLength(1)]}),description:new v(t?.description??null),defaultValue:new v(t?.defaultValue??"",{nonNullable:!0,validators:[c.required]})})}addParameter(){this.parametersArray.push(this.createParameterGroup())}removeParameter(t){this.parametersArray.removeAt(t)}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(!0);let t=V(A({},this.existingPrompt??{}),{namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,content:this.contentArray.controls.map(i=>i.value.trim()),parameters:this.parametersArray.controls.map(i=>({name:i.controls.name.value.trim(),description:i.controls.description.value?.trim()||void 0,defaultValue:i.controls.defaultValue.value.trim()}))}),e=this.isEditMode()&&this.existingPrompt?.id?this.promptState.update(this.existingPrompt.id,t):this.promptState.create(t);this.errorMessage.set(null),e.pipe(w(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:i=>{this.isSubmitting.set(!1),i.status===409?this.errorMessage.set(`A prompt named "${t.name}" already exists in this scope.`):i.status===400?this.errorMessage.set(i.error?.message??"Invalid prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.")}})}cancel(){this.navigateBack()}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","prompts"]):this.router.navigate(["/agentos",this.namespaceId,"prompts"])}static \u0275fac=function(e){return new(e||m)};static \u0275cmp=D({type:m,selectors:[["agentos-prompt-form"]],decls:10,vars:3,consts:[[1,"prompt-form"],[1,"prompt-form__header"],["type","button","title","Back to prompts",1,"prompt-form__back",3,"click"],[1,"prompt-form__back-icon"],[1,"prompt-form__title"],[1,"prompt-form__loading"],[1,"prompt-form__form",3,"formGroup"],[1,"prompt-form__form",3,"ngSubmit","formGroup"],[1,"prompt-form__field"],["for","prompt-name",1,"prompt-form__label"],["aria-hidden","true"],["id","prompt-name","type","text","placeholder","e.g. Summarise meeting notes","autocomplete","off",1,"prompt-form__input",3,"formControl"],[1,"prompt-form__field-error"],["for","prompt-description",1,"prompt-form__label"],["id","prompt-description","type","text","placeholder","Optional \u2014 short description of this prompt","autocomplete","off",1,"prompt-form__input",3,"formControl"],[1,"prompt-form__section",3,"formArrayName"],[1,"prompt-form__label"],[1,"prompt-form__label-hint"],[1,"prompt-form__section-hint"],[1,"prompt-form__empty-hint"],[1,"prompt-form__param-row",3,"formGroupName"],["type","button",1,"prompt-form__add-btn",3,"click"],[1,"prompt-form__content-row"],[1,"prompt-form__error"],[1,"prompt-form__actions"],["type","submit",1,"prompt-form__btn","prompt-form__btn--primary",3,"disabled"],["type","button",1,"prompt-form__btn",3,"click"],[1,"prompt-form__param-fields"],[1,"prompt-form__field","prompt-form__field--inline"],[1,"prompt-form__label",3,"for"],["type","text","placeholder","e.g. language","formControlName","name","autocomplete","off",1,"prompt-form__input",3,"id"],["type","text","placeholder","Optional","formControlName","description","autocomplete","off",1,"prompt-form__input",3,"id"],["type","text","placeholder","e.g. English","formControlName","defaultValue","autocomplete","off",1,"prompt-form__input",3,"id"],["type","button","title","Remove this parameter",1,"prompt-form__remove-btn",3,"click"],[1,"prompt-form__content-index"],[1,"prompt-form__content-field"],["rows","4","placeholder","Enter a command\u2026",1,"prompt-form__textarea",3,"formControlName"],["type","button","title","Remove this entry",1,"prompt-form__remove-btn",3,"click","disabled"]],template:function(e,i){e&1&&(n(0,"div",0)(1,"header",1)(2,"button",2),s("click",function(){return i.cancel()}),n(3,"span",3),r(4,"\u2190"),o(),r(5),o(),n(6,"h1",4),r(7),o()(),u(8,W,2,0,"p",5)(9,ne,55,14,"form",6),o()),e&2&&(a(5),k(" ",i.isPlatformMode?"Platform prompts":"Prompts"," "),a(2),b(i.isEditMode()?"Edit prompt":"New prompt"),a(),g(i.isLoading()?8:9))},dependencies:[J,L,z,$,R,B,H,j,q,U],styles:[".prompt-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.prompt-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.prompt-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}.prompt-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.prompt-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.prompt-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.prompt-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.prompt-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.prompt-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.prompt-form__field--inline[_ngcontent-%COMP%]{flex:1}.prompt-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.prompt-form__label-hint[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);margin-left:.375rem}.prompt-form__input[_ngcontent-%COMP%], .prompt-form__textarea[_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}.prompt-form__input[_ngcontent-%COMP%]:focus, .prompt-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.prompt-form__input[_ngcontent-%COMP%]::placeholder, .prompt-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.prompt-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px;line-height:1.5}.prompt-form__section[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:8px;padding:1rem;margin:0;display:flex;flex-direction:column;gap:.75rem}.prompt-form__section-hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.prompt-form__empty-hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary, #6e6e73);font-style:italic}.prompt-form__content-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:flex-start}.prompt-form__content-field[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.25rem}.prompt-form__content-index[_ngcontent-%COMP%]{flex-shrink:0;width:1.5rem;padding-top:.6rem;font-size:.8rem;font-weight:600;color:var(--color-text-secondary, #6e6e73);text-align:right;-webkit-user-select:none;user-select:none}.prompt-form__param-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:flex-end;padding:.75rem;border-radius:6px;background:var(--color-surface-hover, rgba(0, 0, 0, .03))}.prompt-form__param-fields[_ngcontent-%COMP%]{flex:1;display:flex;gap:.75rem;flex-wrap:wrap}.prompt-form__add-btn[_ngcontent-%COMP%]{align-self:flex-start;padding:.4rem .875rem;border-radius:6px;border:1px dashed var(--color-border, rgba(0, 0, 0, .15));background:transparent;color:var(--color-primary, #007aff);font-size:.875rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.prompt-form__add-btn[_ngcontent-%COMP%]:hover{background:var(--color-surface-hover, rgba(0, 0, 0, .04));border-color:var(--color-primary, #007aff)}.prompt-form__remove-btn[_ngcontent-%COMP%]{flex-shrink:0;width:1.75rem;height:1.75rem;display:flex;align-items:center;justify-content:center;border-radius:50%;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text-secondary, #6e6e73);font-size:1rem;line-height:1;cursor:pointer;transition:background .15s ease,color .15s ease,border-color .15s ease}.prompt-form__remove-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-error-light, rgba(255, 59, 48, .08));color:var(--color-error, #ff3b30);border-color:var(--color-error, #ff3b30)}.prompt-form__remove-btn[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:not-allowed}.prompt-form__error[_ngcontent-%COMP%]{margin:0;padding:.625rem .875rem;border-radius:8px;background:var(--color-error-light, rgba(255, 59, 48, .08));border:1px solid var(--color-error, #ff3b30);color:var(--color-error, #ff3b30);font-size:.875rem;line-height:1.4}.prompt-form__field-error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30);line-height:1.3}.prompt-form__input--invalid[_ngcontent-%COMP%], .prompt-form__textarea--invalid[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.prompt-form__input--invalid[_ngcontent-%COMP%]:focus, .prompt-form__textarea--invalid[_ngcontent-%COMP%]:focus{border-color:var(--color-error, #ff3b30)}.prompt-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.prompt-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}.prompt-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.prompt-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.prompt-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.prompt-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};export{Q as PromptFormComponent};
1
+ import{a as K}from"./chunk-BMUZTI7K.js";import"./chunk-G2BRVRGR.js";import{a as T,c as G}from"./chunk-7MQRVE7E.js";import{a as w}from"./chunk-IRZNRZ5Q.js";import{F as J,c as z,e as c,g as $,h as R,i as F,l as v,n as L,r as N,s as B,t as q,u as U,v as j,w as H}from"./chunk-WLSXA23B.js";import{Bb as y,Db as s,Fb as d,Ka as a,Rb as P,Tb as r,Ub as b,Vb as k,Wa as D,a as A,b as V,ca as h,ga as f,ha as _,lb as u,ma as I,mb as g,nb as S,pb as E,qb as O,rb as p,sb as n,ta as C,tb as o,ub as x}from"./chunk-5J7BTB5J.js";function W(m,t){m&1&&(n(0,"p",5),r(1,"Loading\u2026"),o())}function X(m,t){m&1&&(n(0,"span",12),r(1,"Name is required."),o())}function Y(m,t){m&1&&(n(0,"p",19),r(1,"No parameters defined."),o())}function Z(m,t){m&1&&(n(0,"span",12),r(1,"Parameter name is required."),o())}function ee(m,t){if(m&1){let e=y();n(0,"div",20)(1,"div",27)(2,"div",28)(3,"label",29),r(4,"Name "),n(5,"span",10),r(6,"*"),o()(),x(7,"input",30),u(8,Z,2,0,"span",12),o(),n(9,"div",28)(10,"label",29),r(11,"Description"),o(),x(12,"input",31),o(),n(13,"div",28)(14,"label",29),r(15,"Default value"),o(),x(16,"input",32),o()(),n(17,"button",33),s("click",function(){let l=f(e).$index,M=d(2);return _(M.removeParameter(l))}),r(18," \xD7 "),o()()}if(m&2){let e=t.$implicit,i=t.$index;p("formGroupName",i),a(3),p("for","param-name-"+i),a(4),P("prompt-form__input--invalid",e.controls.name.invalid&&e.controls.name.touched),p("id","param-name-"+i),a(),g(e.controls.name.invalid&&e.controls.name.touched?8:-1),a(2),p("for","param-desc-"+i),a(2),p("id","param-desc-"+i),a(2),p("for","param-default-"+i),a(2),p("id","param-default-"+i)}}function te(m,t){m&1&&(n(0,"span",12),r(1,"Content entry must not be blank."),o())}function re(m,t){if(m&1){let e=y();n(0,"div",22)(1,"span",34),r(2),o(),n(3,"div",35),x(4,"textarea",36),u(5,te,2,0,"span",12),o(),n(6,"button",37),s("click",function(){let l=f(e).$index,M=d(2);return _(M.removeContentEntry(l))}),r(7," \xD7 "),o()()}if(m&2){let e=t.$implicit,i=t.$index,l=d(2);a(2),b(i+1),a(2),P("prompt-form__textarea--invalid",e.invalid&&e.touched),p("formControlName",i),a(),g(e.invalid&&e.touched?5:-1),a(),p("disabled",l.contentArray.length===1)}}function oe(m,t){if(m&1&&(n(0,"p",23),r(1),o()),m&2){let e=d(2);a(),b(e.errorMessage())}}function ne(m,t){if(m&1){let e=y();n(0,"form",7),s("ngSubmit",function(){f(e);let l=d();return _(l.submit())}),n(1,"div",8)(2,"label",9),r(3,"Name "),n(4,"span",10),r(5,"*"),o()(),x(6,"input",11),u(7,X,2,0,"span",12),o(),n(8,"div",8)(9,"label",13),r(10,"Description"),o(),x(11,"input",14),o(),n(12,"fieldset",15)(13,"legend",16),r(14," Parameters "),n(15,"span",17),r(16,"Named placeholders used in content"),o()(),n(17,"p",18),r(18," Each parameter must have a name and a default value. Use "),n(19,"code"),r(20),o(),r(21," in content entries to reference them. "),o(),u(22,Y,2,0,"p",19),E(23,ee,19,10,"div",20,S),n(25,"button",21),s("click",function(){f(e);let l=d();return _(l.addParameter())}),r(26,"+ Add parameter"),o()(),n(27,"fieldset",15)(28,"legend",16),r(29," Content "),n(30,"span",10),r(31,"*"),o(),n(32,"span",17),r(33,"Ordered list of text commands"),o()(),n(34,"p",18),r(35," Each content entry is a command. Use "),n(36,"code"),r(37,"@AgentName"),o(),r(38," to target an agent, "),n(39,"code"),r(40,"/promptName param1 param2"),o(),r(41," to call another prompt, and "),n(42,"code"),r(43),o(),r(44," for parameter placeholders. "),o(),E(45,re,8,6,"div",22,S),n(47,"button",21),s("click",function(){f(e);let l=d();return _(l.addContentEntry())}),r(48,"+ Add content entry"),o()(),u(49,oe,2,1,"p",23),n(50,"div",24)(51,"button",25),r(52),o(),n(53,"button",26),s("click",function(){f(e);let l=d();return _(l.cancel())}),r(54,"Cancel"),o()()()}if(m&2){let e=d();p("formGroup",e.form),a(6),P("prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),p("formControl",e.nameControl),a(),g(e.nameControl.invalid&&e.nameControl.touched?7:-1),a(4),p("formControl",e.descriptionControl),a(),p("formArrayName","parameters"),a(8),b(e.paramPlaceholderSyntax),a(2),g(e.parametersArray.length===0?22:-1),a(),O(e.parametersArray.controls),a(4),p("formArrayName","content"),a(16),b(e.paramPlaceholderSyntax),a(2),O(e.contentArray.controls),a(4),g(e.errorMessage()?49:-1),a(2),p("disabled",e.form.invalid||e.isSubmitting()),a(),k(" ",e.isEditMode()?"Save changes":"Create"," ")}}var Q=class m{route=h(T);router=h(G);destroyRef=h(I);promptState=h(K);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new F({name:new v("",{nonNullable:!0,validators:[c.required,c.minLength(1)]}),description:new v(null),content:new N([this.createContentControl()],{validators:[c.required]}),parameters:new N([])});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get contentArray(){return this.form.controls.content}get parametersArray(){return this.form.controls.parameters}isEditMode=C(!1);isSubmitting=C(!1);isLoading=C(!1);errorMessage=C(null);paramPlaceholderSyntax="{{paramName}}";existingPrompt=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("promptId");t&&(this.isEditMode.set(!0),this.loadPrompt(t))}loadPrompt(t){this.isLoading.set(!0),this.promptState.getById(t).pipe(w(this.destroyRef)).subscribe({next:e=>{this.existingPrompt=e,this.hydrateForm(e),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),this.navigateBack()}})}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.contentArray.clear(),(t.content.length>0?t.content:[""]).forEach(i=>this.contentArray.push(this.createContentControl(i))),this.parametersArray.clear(),(t.parameters??[]).forEach(i=>this.parametersArray.push(this.createParameterGroup(i)))}createContentControl(t=""){return new v(t,{nonNullable:!0,validators:[c.required,c.pattern(/\S/)]})}addContentEntry(){this.contentArray.push(this.createContentControl())}removeContentEntry(t){this.contentArray.length>1&&this.contentArray.removeAt(t)}createParameterGroup(t){return new F({name:new v(t?.name??"",{nonNullable:!0,validators:[c.required,c.minLength(1)]}),description:new v(t?.description??null),defaultValue:new v(t?.defaultValue??"",{nonNullable:!0,validators:[c.required]})})}addParameter(){this.parametersArray.push(this.createParameterGroup())}removeParameter(t){this.parametersArray.removeAt(t)}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(!0);let t=V(A({},this.existingPrompt??{}),{namespaceId:this.namespaceId,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,content:this.contentArray.controls.map(i=>i.value.trim()),parameters:this.parametersArray.controls.map(i=>({name:i.controls.name.value.trim(),description:i.controls.description.value?.trim()||void 0,defaultValue:i.controls.defaultValue.value.trim()}))}),e=this.isEditMode()&&this.existingPrompt?.id?this.promptState.update(this.existingPrompt.id,t):this.promptState.create(t);this.errorMessage.set(null),e.pipe(w(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:i=>{this.isSubmitting.set(!1),i.status===409?this.errorMessage.set(`A prompt named "${t.name}" already exists in this scope.`):i.status===400?this.errorMessage.set(i.error?.message??"Invalid prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.")}})}cancel(){this.navigateBack()}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","prompts"]):this.router.navigate(["/agentos",this.namespaceId,"prompts"])}static \u0275fac=function(e){return new(e||m)};static \u0275cmp=D({type:m,selectors:[["agentos-prompt-form"]],decls:10,vars:3,consts:[[1,"prompt-form"],[1,"prompt-form__header"],["type","button","title","Back to prompts",1,"prompt-form__back",3,"click"],[1,"prompt-form__back-icon"],[1,"prompt-form__title"],[1,"prompt-form__loading"],[1,"prompt-form__form",3,"formGroup"],[1,"prompt-form__form",3,"ngSubmit","formGroup"],[1,"prompt-form__field"],["for","prompt-name",1,"prompt-form__label"],["aria-hidden","true"],["id","prompt-name","type","text","placeholder","e.g. Summarise meeting notes","autocomplete","off",1,"prompt-form__input",3,"formControl"],[1,"prompt-form__field-error"],["for","prompt-description",1,"prompt-form__label"],["id","prompt-description","type","text","placeholder","Optional \u2014 short description of this prompt","autocomplete","off",1,"prompt-form__input",3,"formControl"],[1,"prompt-form__section",3,"formArrayName"],[1,"prompt-form__label"],[1,"prompt-form__label-hint"],[1,"prompt-form__section-hint"],[1,"prompt-form__empty-hint"],[1,"prompt-form__param-row",3,"formGroupName"],["type","button",1,"prompt-form__add-btn",3,"click"],[1,"prompt-form__content-row"],[1,"prompt-form__error"],[1,"prompt-form__actions"],["type","submit",1,"prompt-form__btn","prompt-form__btn--primary",3,"disabled"],["type","button",1,"prompt-form__btn",3,"click"],[1,"prompt-form__param-fields"],[1,"prompt-form__field","prompt-form__field--inline"],[1,"prompt-form__label",3,"for"],["type","text","placeholder","e.g. language","formControlName","name","autocomplete","off",1,"prompt-form__input",3,"id"],["type","text","placeholder","Optional","formControlName","description","autocomplete","off",1,"prompt-form__input",3,"id"],["type","text","placeholder","e.g. English","formControlName","defaultValue","autocomplete","off",1,"prompt-form__input",3,"id"],["type","button","title","Remove this parameter",1,"prompt-form__remove-btn",3,"click"],[1,"prompt-form__content-index"],[1,"prompt-form__content-field"],["rows","4","placeholder","Enter a command\u2026",1,"prompt-form__textarea",3,"formControlName"],["type","button","title","Remove this entry",1,"prompt-form__remove-btn",3,"click","disabled"]],template:function(e,i){e&1&&(n(0,"div",0)(1,"header",1)(2,"button",2),s("click",function(){return i.cancel()}),n(3,"span",3),r(4,"\u2190"),o(),r(5),o(),n(6,"h1",4),r(7),o()(),u(8,W,2,0,"p",5)(9,ne,55,14,"form",6),o()),e&2&&(a(5),k(" ",i.isPlatformMode?"Platform prompts":"Prompts"," "),a(2),b(i.isEditMode()?"Edit prompt":"New prompt"),a(),g(i.isLoading()?8:9))},dependencies:[J,L,z,$,R,B,H,j,q,U],styles:[".prompt-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.prompt-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.prompt-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}.prompt-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.prompt-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.prompt-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.prompt-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.prompt-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.prompt-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.prompt-form__field--inline[_ngcontent-%COMP%]{flex:1}.prompt-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.prompt-form__label-hint[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);margin-left:.375rem}.prompt-form__input[_ngcontent-%COMP%], .prompt-form__textarea[_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}.prompt-form__input[_ngcontent-%COMP%]:focus, .prompt-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.prompt-form__input[_ngcontent-%COMP%]::placeholder, .prompt-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.prompt-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px;line-height:1.5}.prompt-form__section[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:8px;padding:1rem;margin:0;display:flex;flex-direction:column;gap:.75rem}.prompt-form__section-hint[_ngcontent-%COMP%]{margin:0;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.prompt-form__empty-hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary, #6e6e73);font-style:italic}.prompt-form__content-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:flex-start}.prompt-form__content-field[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.25rem}.prompt-form__content-index[_ngcontent-%COMP%]{flex-shrink:0;width:1.5rem;padding-top:.6rem;font-size:.8rem;font-weight:600;color:var(--color-text-secondary, #6e6e73);text-align:right;-webkit-user-select:none;user-select:none}.prompt-form__param-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:flex-end;padding:.75rem;border-radius:6px;background:var(--color-surface-hover, rgba(0, 0, 0, .03))}.prompt-form__param-fields[_ngcontent-%COMP%]{flex:1;display:flex;gap:.75rem;flex-wrap:wrap}.prompt-form__add-btn[_ngcontent-%COMP%]{align-self:flex-start;padding:.4rem .875rem;border-radius:6px;border:1px dashed var(--color-border, rgba(0, 0, 0, .15));background:transparent;color:var(--color-primary, #007aff);font-size:.875rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.prompt-form__add-btn[_ngcontent-%COMP%]:hover{background:var(--color-surface-hover, rgba(0, 0, 0, .04));border-color:var(--color-primary, #007aff)}.prompt-form__remove-btn[_ngcontent-%COMP%]{flex-shrink:0;width:1.75rem;height:1.75rem;display:flex;align-items:center;justify-content:center;border-radius:50%;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text-secondary, #6e6e73);font-size:1rem;line-height:1;cursor:pointer;transition:background .15s ease,color .15s ease,border-color .15s ease}.prompt-form__remove-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-error-light, rgba(255, 59, 48, .08));color:var(--color-error, #ff3b30);border-color:var(--color-error, #ff3b30)}.prompt-form__remove-btn[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:not-allowed}.prompt-form__error[_ngcontent-%COMP%]{margin:0;padding:.625rem .875rem;border-radius:8px;background:var(--color-error-light, rgba(255, 59, 48, .08));border:1px solid var(--color-error, #ff3b30);color:var(--color-error, #ff3b30);font-size:.875rem;line-height:1.4}.prompt-form__field-error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30);line-height:1.3}.prompt-form__input--invalid[_ngcontent-%COMP%], .prompt-form__textarea--invalid[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.prompt-form__input--invalid[_ngcontent-%COMP%]:focus, .prompt-form__textarea--invalid[_ngcontent-%COMP%]:focus{border-color:var(--color-error, #ff3b30)}.prompt-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.prompt-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}.prompt-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.prompt-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.prompt-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.prompt-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};export{Q as PromptFormComponent};
@@ -1,3 +1,3 @@
1
- import{b as De,e as Y,f as Ce,g as Ae,i as v,j as D,k as M,m as Te,n as Oe,o as xe,q as B,s as we,v as j}from"./chunk-RBAVAHXW.js";import{A as U,E as ve,K as Z,c as R,e as pe,f as q,h as fe,p as _e,q as ye,s as be,t as b,u as P}from"./chunk-TZKO65ML.js";import{$a as f,A as te,B as _,Cb as W,G as p,Jb as he,Kb as me,Lb as ue,Ma as ne,Na as se,Pa as re,R as T,Rb as Q,Wa as E,Xa as S,Ya as y,Z as O,_ as x,_a as le,a as c,aa as u,ab as F,b as ee,ca as s,h as m,j as G,jb as L,ka as h,la as ie,oa as w,pa as ae,sb as de,ta as oe,tb as ce,tc as ge,wa as k,y as A,ya as I}from"./chunk-RYEX2DR7.js";function Be(i,o){}var g=class{viewContainerRef;injector;id;role="dialog";panelClass="";hasBackdrop=!0;backdropClass="";disableClose=!1;closePredicate;width="";height="";minWidth;minHeight;maxWidth;maxHeight;positionStrategy;data=null;direction;ariaDescribedBy=null;ariaLabelledBy=null;ariaLabel=null;ariaModal=!1;autoFocus="first-tabbable";restoreFocus=!0;scrollStrategy;closeOnNavigation=!0;closeOnDestroy=!0;closeOnOverlayDetachments=!0;disableAnimations=!1;providers;container;templateContext};var K=(()=>{class i extends Ae{_elementRef=s(I);_focusTrapFactory=s(ye);_config;_interactivityChecker=s(_e);_ngZone=s(ae);_focusMonitor=s(fe);_renderer=s(re);_changeDetectorRef=s(ge);_injector=s(h);_platform=s(pe);_document=s(ie);_portalOutlet;_focusTrapped=new m;_focusTrap=null;_elementFocusedBeforeDialogWasOpened=null;_closeInteractionType=null;_ariaLabelledByQueue=[];_isDestroyed=!1;constructor(){super(),this._config=s(g,{optional:!0})||new g,this._config.ariaLabelledBy&&this._ariaLabelledByQueue.push(this._config.ariaLabelledBy)}_addAriaLabelledBy(e){this._ariaLabelledByQueue.push(e),this._changeDetectorRef.markForCheck()}_removeAriaLabelledBy(e){let t=this._ariaLabelledByQueue.indexOf(e);t>-1&&(this._ariaLabelledByQueue.splice(t,1),this._changeDetectorRef.markForCheck())}_contentAttached(){this._initializeFocusTrap(),this._captureInitialFocus()}_captureInitialFocus(){this._trapFocus()}ngOnDestroy(){this._focusTrapped.complete(),this._isDestroyed=!0,this._restoreFocus()}attachComponentPortal(e){this._portalOutlet.hasAttached();let t=this._portalOutlet.attachComponentPortal(e);return this._contentAttached(),t}attachTemplatePortal(e){this._portalOutlet.hasAttached();let t=this._portalOutlet.attachTemplatePortal(e);return this._contentAttached(),t}attachDomPortal=e=>{this._portalOutlet.hasAttached();let t=this._portalOutlet.attachDomPortal(e);return this._contentAttached(),t};_recaptureFocus(){this._containsFocus()||this._trapFocus()}_forceFocus(e,t){this._interactivityChecker.isFocusable(e)||(e.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{let a=()=>{n(),l(),e.removeAttribute("tabindex")},n=this._renderer.listen(e,"blur",a),l=this._renderer.listen(e,"mousedown",a)})),e.focus(t)}_focusByCssSelector(e,t){let a=this._elementRef.nativeElement.querySelector(e);a&&this._forceFocus(a,t)}_trapFocus(e){this._isDestroyed||ne(()=>{let t=this._elementRef.nativeElement;switch(this._config.autoFocus){case!1:case"dialog":this._containsFocus()||t.focus(e);break;case!0:case"first-tabbable":this._focusTrap?.focusInitialElement(e)||this._focusDialogContainer(e);break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]',e);break;default:this._focusByCssSelector(this._config.autoFocus,e);break}this._focusTrapped.next()},{injector:this._injector})}_restoreFocus(){let e=this._config.restoreFocus,t=null;if(typeof e=="string"?t=this._document.querySelector(e):typeof e=="boolean"?t=e?this._elementFocusedBeforeDialogWasOpened:null:e&&(t=e),this._config.restoreFocus&&t&&typeof t.focus=="function"){let a=R(),n=this._elementRef.nativeElement;(!a||a===this._document.body||a===n||n.contains(a))&&(this._focusMonitor?(this._focusMonitor.focusVia(t,this._closeInteractionType),this._closeInteractionType=null):t.focus())}this._focusTrap&&this._focusTrap.destroy()}_focusDialogContainer(e){this._elementRef.nativeElement.focus?.(e)}_containsFocus(){let e=this._elementRef.nativeElement,t=R();return e===t||e.contains(t)}_initializeFocusTrap(){this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._document&&(this._elementFocusedBeforeDialogWasOpened=R()))}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=E({type:i,selectors:[["cdk-dialog-container"]],viewQuery:function(t,a){if(t&1&&he(v,7),t&2){let n;me(n=ue())&&(a._portalOutlet=n.first)}},hostAttrs:["tabindex","-1",1,"cdk-dialog-container"],hostVars:6,hostBindings:function(t,a){t&2&&L("id",a._config.id||null)("role",a._config.role)("aria-modal",a._config.ariaModal)("aria-labelledby",a._config.ariaLabel?null:a._ariaLabelledByQueue[0])("aria-label",a._config.ariaLabel)("aria-describedby",a._config.ariaDescribedBy||null)},features:[f],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,a){t&1&&F(0,Be,0,0,"ng-template",0)},dependencies:[v],styles:[`.cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit}
1
+ import{b as De,e as Y,f as Ce,g as Ae,i as v,j as D,k as M,m as Te,n as Oe,o as xe,q as B,s as we,v as j}from"./chunk-OBV4LQBZ.js";import{A as U,E as ve,K as Z,c as R,e as pe,f as q,h as fe,p as _e,q as ye,s as be,t as b,u as P}from"./chunk-E3XC4CVU.js";import{$a as f,A as te,B as _,Cb as W,G as p,Jb as he,Kb as me,Lb as ue,Ma as ne,Na as se,Pa as re,R as T,Rb as Q,Wa as E,Xa as S,Ya as y,Z as O,_ as x,_a as le,a as c,aa as u,ab as F,b as ee,ca as s,h as m,j as G,jb as L,ka as h,la as ie,oa as w,pa as ae,sb as de,ta as oe,tb as ce,uc as ge,wa as k,y as A,ya as I}from"./chunk-5J7BTB5J.js";function Be(i,o){}var g=class{viewContainerRef;injector;id;role="dialog";panelClass="";hasBackdrop=!0;backdropClass="";disableClose=!1;closePredicate;width="";height="";minWidth;minHeight;maxWidth;maxHeight;positionStrategy;data=null;direction;ariaDescribedBy=null;ariaLabelledBy=null;ariaLabel=null;ariaModal=!1;autoFocus="first-tabbable";restoreFocus=!0;scrollStrategy;closeOnNavigation=!0;closeOnDestroy=!0;closeOnOverlayDetachments=!0;disableAnimations=!1;providers;container;templateContext};var K=(()=>{class i extends Ae{_elementRef=s(I);_focusTrapFactory=s(ye);_config;_interactivityChecker=s(_e);_ngZone=s(ae);_focusMonitor=s(fe);_renderer=s(re);_changeDetectorRef=s(ge);_injector=s(h);_platform=s(pe);_document=s(ie);_portalOutlet;_focusTrapped=new m;_focusTrap=null;_elementFocusedBeforeDialogWasOpened=null;_closeInteractionType=null;_ariaLabelledByQueue=[];_isDestroyed=!1;constructor(){super(),this._config=s(g,{optional:!0})||new g,this._config.ariaLabelledBy&&this._ariaLabelledByQueue.push(this._config.ariaLabelledBy)}_addAriaLabelledBy(e){this._ariaLabelledByQueue.push(e),this._changeDetectorRef.markForCheck()}_removeAriaLabelledBy(e){let t=this._ariaLabelledByQueue.indexOf(e);t>-1&&(this._ariaLabelledByQueue.splice(t,1),this._changeDetectorRef.markForCheck())}_contentAttached(){this._initializeFocusTrap(),this._captureInitialFocus()}_captureInitialFocus(){this._trapFocus()}ngOnDestroy(){this._focusTrapped.complete(),this._isDestroyed=!0,this._restoreFocus()}attachComponentPortal(e){this._portalOutlet.hasAttached();let t=this._portalOutlet.attachComponentPortal(e);return this._contentAttached(),t}attachTemplatePortal(e){this._portalOutlet.hasAttached();let t=this._portalOutlet.attachTemplatePortal(e);return this._contentAttached(),t}attachDomPortal=e=>{this._portalOutlet.hasAttached();let t=this._portalOutlet.attachDomPortal(e);return this._contentAttached(),t};_recaptureFocus(){this._containsFocus()||this._trapFocus()}_forceFocus(e,t){this._interactivityChecker.isFocusable(e)||(e.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{let a=()=>{n(),l(),e.removeAttribute("tabindex")},n=this._renderer.listen(e,"blur",a),l=this._renderer.listen(e,"mousedown",a)})),e.focus(t)}_focusByCssSelector(e,t){let a=this._elementRef.nativeElement.querySelector(e);a&&this._forceFocus(a,t)}_trapFocus(e){this._isDestroyed||ne(()=>{let t=this._elementRef.nativeElement;switch(this._config.autoFocus){case!1:case"dialog":this._containsFocus()||t.focus(e);break;case!0:case"first-tabbable":this._focusTrap?.focusInitialElement(e)||this._focusDialogContainer(e);break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]',e);break;default:this._focusByCssSelector(this._config.autoFocus,e);break}this._focusTrapped.next()},{injector:this._injector})}_restoreFocus(){let e=this._config.restoreFocus,t=null;if(typeof e=="string"?t=this._document.querySelector(e):typeof e=="boolean"?t=e?this._elementFocusedBeforeDialogWasOpened:null:e&&(t=e),this._config.restoreFocus&&t&&typeof t.focus=="function"){let a=R(),n=this._elementRef.nativeElement;(!a||a===this._document.body||a===n||n.contains(a))&&(this._focusMonitor?(this._focusMonitor.focusVia(t,this._closeInteractionType),this._closeInteractionType=null):t.focus())}this._focusTrap&&this._focusTrap.destroy()}_focusDialogContainer(e){this._elementRef.nativeElement.focus?.(e)}_containsFocus(){let e=this._elementRef.nativeElement,t=R();return e===t||e.contains(t)}_initializeFocusTrap(){this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._document&&(this._elementFocusedBeforeDialogWasOpened=R()))}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=E({type:i,selectors:[["cdk-dialog-container"]],viewQuery:function(t,a){if(t&1&&he(v,7),t&2){let n;me(n=ue())&&(a._portalOutlet=n.first)}},hostAttrs:["tabindex","-1",1,"cdk-dialog-container"],hostVars:6,hostBindings:function(t,a){t&2&&L("id",a._config.id||null)("role",a._config.role)("aria-modal",a._config.ariaModal)("aria-labelledby",a._config.ariaLabel?null:a._ariaLabelledByQueue[0])("aria-label",a._config.ariaLabel)("aria-describedby",a._config.ariaDescribedBy||null)},features:[f],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,a){t&1&&F(0,Be,0,0,"ng-template",0)},dependencies:[v],styles:[`.cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit}
2
2
  `],encapsulation:2})}return i})(),C=class{overlayRef;config;componentInstance=null;componentRef=null;containerInstance;disableClose;closed=new m;backdropClick;keydownEvents;outsidePointerEvents;id;_detachSubscription;constructor(o,e){this.overlayRef=o,this.config=e,this.disableClose=e.disableClose,this.backdropClick=o.backdropClick(),this.keydownEvents=o.keydownEvents(),this.outsidePointerEvents=o.outsidePointerEvents(),this.id=e.id,this.keydownEvents.subscribe(t=>{t.keyCode===27&&!this.disableClose&&!P(t)&&(t.preventDefault(),this.close(void 0,{focusOrigin:"keyboard"}))}),this.backdropClick.subscribe(()=>{!this.disableClose&&this._canClose()?this.close(void 0,{focusOrigin:"mouse"}):this.containerInstance._recaptureFocus?.()}),this._detachSubscription=o.detachments().subscribe(()=>{e.closeOnOverlayDetachments!==!1&&this.close()})}close(o,e){if(this._canClose(o)){let t=this.closed;this.containerInstance._closeInteractionType=e?.focusOrigin||"program",this._detachSubscription.unsubscribe(),this.overlayRef.dispose(),t.next(o),t.complete(),this.componentInstance=this.containerInstance=null}}updatePosition(){return this.overlayRef.updatePosition(),this}updateSize(o="",e=""){return this.overlayRef.updateSize({width:o,height:e}),this}addPanelClass(o){return this.overlayRef.addPanelClass(o),this}removePanelClass(o){return this.overlayRef.removePanelClass(o),this}_canClose(o){let e=this.config;return!!this.containerInstance&&(!e.closePredicate||e.closePredicate(o,e,this.componentInstance))}},je=new u("DialogScrollStrategy",{providedIn:"root",factory:()=>{let i=s(h);return()=>M(i)}}),Ne=new u("DialogData"),Ve=new u("DefaultDialogConfig");function ze(i){let o=oe(i),e=new w;return{valueSignal:o,get value(){return o()},change:e,ngOnDestroy(){e.complete()}}}var X=(()=>{class i{_injector=s(h);_defaultOptions=s(Ve,{optional:!0});_parentDialog=s(i,{optional:!0,skipSelf:!0});_overlayContainer=s(Oe);_idGenerator=s(b);_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new m;_afterOpenedAtThisLevel=new m;_ariaHiddenElements=new Map;_scrollStrategy=s(je);get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}afterAllClosed=A(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(T(void 0)));constructor(){}open(e,t){let a=this._defaultOptions||new g;t=c(c({},a),t),t.id=t.id||this._idGenerator.getId("cdk-dialog-"),t.id&&this.getDialogById(t.id);let n=this._getOverlayConfig(t),l=we(this._injector,n),r=new C(l,t),d=this._attachContainer(l,r,t);if(r.containerInstance=d,!this.openDialogs.length){let H=this._overlayContainer.getContainerElement();d._focusTrapped?d._focusTrapped.pipe(p(1)).subscribe(()=>{this._hideNonDialogContentFromAssistiveTechnology(H)}):this._hideNonDialogContentFromAssistiveTechnology(H)}return this._attachDialogContent(e,r,d,t),this.openDialogs.push(r),r.closed.subscribe(()=>this._removeOpenDialog(r,!0)),this.afterOpened.next(r),r}closeAll(){$(this.openDialogs,e=>e.close())}getDialogById(e){return this.openDialogs.find(t=>t.id===e)}ngOnDestroy(){$(this._openDialogsAtThisLevel,e=>{e.config.closeOnDestroy===!1&&this._removeOpenDialog(e,!1)}),$(this._openDialogsAtThisLevel,e=>e.close()),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete(),this._openDialogsAtThisLevel=[]}_getOverlayConfig(e){let t=new Te({positionStrategy:e.positionStrategy||B().centerHorizontally().centerVertically(),scrollStrategy:e.scrollStrategy||this._scrollStrategy(),panelClass:e.panelClass,hasBackdrop:e.hasBackdrop,direction:e.direction,minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight,width:e.width,height:e.height,disposeOnNavigation:e.closeOnNavigation,disableAnimations:e.disableAnimations});return e.backdropClass&&(t.backdropClass=e.backdropClass),t}_attachContainer(e,t,a){let n=a.injector||a.viewContainerRef?.injector,l=[{provide:g,useValue:a},{provide:C,useValue:t},{provide:xe,useValue:e}],r;a.container?typeof a.container=="function"?r=a.container:(r=a.container.type,l.push(...a.container.providers(a))):r=K;let d=new Y(r,a.viewContainerRef,h.create({parent:n||this._injector,providers:l}));return e.attach(d).instance}_attachDialogContent(e,t,a,n){if(e instanceof se){let l=this._createInjector(n,t,a,void 0),r={$implicit:n.data,dialogRef:t};n.templateContext&&(r=c(c({},r),typeof n.templateContext=="function"?n.templateContext():n.templateContext)),a.attachTemplatePortal(new Ce(e,null,r,l))}else{let l=this._createInjector(n,t,a,this._injector),r=a.attachComponentPortal(new Y(e,n.viewContainerRef,l));t.componentRef=r,t.componentInstance=r.instance}}_createInjector(e,t,a,n){let l=e.injector||e.viewContainerRef?.injector,r=[{provide:Ne,useValue:e.data},{provide:C,useValue:t}];return e.providers&&(typeof e.providers=="function"?r.push(...e.providers(t,e,a)):r.push(...e.providers)),e.direction&&(!l||!l.get(U,null,{optional:!0}))&&r.push({provide:U,useValue:ze(e.direction)}),h.create({parent:l||n,providers:r})}_removeOpenDialog(e,t){let a=this.openDialogs.indexOf(e);a>-1&&(this.openDialogs.splice(a,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((n,l)=>{n?l.setAttribute("aria-hidden",n):l.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),t&&this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(e){if(e.parentElement){let t=e.parentElement.children;for(let a=t.length-1;a>-1;a--){let n=t[a];n!==e&&n.nodeName!=="SCRIPT"&&n.nodeName!=="STYLE"&&!n.hasAttribute("aria-live")&&!n.hasAttribute("popover")&&(this._ariaHiddenElements.set(n,n.getAttribute("aria-hidden")),n.setAttribute("aria-hidden","true"))}}}_getAfterAllClosed(){let e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}static \u0275fac=function(t){return new(t||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function $(i,o){let e=i.length;for(;e--;)o(i[e])}var Ie=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=S({type:i});static \u0275inj=x({providers:[X],imports:[j,D,be,D]})}return i})();function He(i,o){}var V=class{viewContainerRef;injector;id;role="dialog";panelClass="";hasBackdrop=!0;backdropClass="";disableClose=!1;closePredicate;width="";height="";minWidth;minHeight;maxWidth;maxHeight;position;data=null;direction;ariaDescribedBy=null;ariaLabelledBy=null;ariaLabel=null;ariaModal=!1;autoFocus="first-tabbable";restoreFocus=!0;delayFocusTrap=!0;scrollStrategy;closeOnNavigation=!0;enterAnimationDuration;exitAnimationDuration},J="mdc-dialog--open",Ee="mdc-dialog--opening",Se="mdc-dialog--closing",Ge=150,We=75,Qe=(()=>{class i extends K{_animationStateChanged=new w;_animationsEnabled=!Z();_actionSectionCount=0;_hostElement=this._elementRef.nativeElement;_enterAnimationDuration=this._animationsEnabled?Le(this._config.enterAnimationDuration)??Ge:0;_exitAnimationDuration=this._animationsEnabled?Le(this._config.exitAnimationDuration)??We:0;_animationTimer=null;_contentAttached(){super._contentAttached(),this._startOpenAnimation()}_startOpenAnimation(){this._animationStateChanged.emit({state:"opening",totalTime:this._enterAnimationDuration}),this._animationsEnabled?(this._hostElement.style.setProperty(Fe,`${this._enterAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(Ee,J)),this._waitForAnimationToComplete(this._enterAnimationDuration,this._finishDialogOpen)):(this._hostElement.classList.add(J),Promise.resolve().then(()=>this._finishDialogOpen()))}_startExitAnimation(){this._animationStateChanged.emit({state:"closing",totalTime:this._exitAnimationDuration}),this._hostElement.classList.remove(J),this._animationsEnabled?(this._hostElement.style.setProperty(Fe,`${this._exitAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(Se)),this._waitForAnimationToComplete(this._exitAnimationDuration,this._finishDialogClose)):Promise.resolve().then(()=>this._finishDialogClose())}_updateActionSectionCount(e){this._actionSectionCount+=e,this._changeDetectorRef.markForCheck()}_finishDialogOpen=()=>{this._clearAnimationClasses(),this._openAnimationDone(this._enterAnimationDuration)};_finishDialogClose=()=>{this._clearAnimationClasses(),this._animationStateChanged.emit({state:"closed",totalTime:this._exitAnimationDuration})};_clearAnimationClasses(){this._hostElement.classList.remove(Ee,Se)}_waitForAnimationToComplete(e,t){this._animationTimer!==null&&clearTimeout(this._animationTimer),this._animationTimer=setTimeout(t,e)}_requestAnimationFrame(e){this._ngZone.runOutsideAngular(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()})}_captureInitialFocus(){this._config.delayFocusTrap||this._trapFocus()}_openAnimationDone(e){this._config.delayFocusTrap&&this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:e})}ngOnDestroy(){super.ngOnDestroy(),this._animationTimer!==null&&clearTimeout(this._animationTimer)}attachComponentPortal(e){let t=super.attachComponentPortal(e);return t.location.nativeElement.classList.add("mat-mdc-dialog-component-host"),t}static \u0275fac=(()=>{let e;return function(a){return(e||(e=k(i)))(a||i)}})();static \u0275cmp=E({type:i,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1",1,"mat-mdc-dialog-container","mdc-dialog"],hostVars:10,hostBindings:function(t,a){t&2&&(W("id",a._config.id),L("aria-modal",a._config.ariaModal)("role",a._config.role)("aria-labelledby",a._config.ariaLabel?null:a._ariaLabelledByQueue[0])("aria-label",a._config.ariaLabel)("aria-describedby",a._config.ariaDescribedBy||null),Q("_mat-animation-noopable",!a._animationsEnabled)("mat-mdc-dialog-container-with-actions",a._actionSectionCount>0))},features:[f],decls:3,vars:0,consts:[[1,"mat-mdc-dialog-inner-container","mdc-dialog__container"],[1,"mat-mdc-dialog-surface","mdc-dialog__surface"],["cdkPortalOutlet",""]],template:function(t,a){t&1&&(de(0,"div",0)(1,"div",1),F(2,He,0,0,"ng-template",2),ce()())},dependencies:[v],styles:[`.mat-mdc-dialog-container{width:100%;height:100%;display:block;box-sizing:border-box;max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit;outline:0}.cdk-overlay-pane.mat-mdc-dialog-panel{max-width:var(--mat-dialog-container-max-width, 560px);min-width:var(--mat-dialog-container-min-width, 280px)}@media(max-width: 599px){.cdk-overlay-pane.mat-mdc-dialog-panel{max-width:var(--mat-dialog-container-small-max-width, calc(100vw - 32px))}}.mat-mdc-dialog-inner-container{display:flex;flex-direction:row;align-items:center;justify-content:space-around;box-sizing:border-box;height:100%;opacity:0;transition:opacity linear var(--mat-dialog-transition-duration, 0ms);max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit}.mdc-dialog--closing .mat-mdc-dialog-inner-container{transition:opacity 75ms linear;transform:none}.mdc-dialog--open .mat-mdc-dialog-inner-container{opacity:1}._mat-animation-noopable .mat-mdc-dialog-inner-container{transition:none}.mat-mdc-dialog-surface{display:flex;flex-direction:column;flex-grow:0;flex-shrink:0;box-sizing:border-box;width:100%;height:100%;position:relative;overflow-y:auto;outline:0;transform:scale(0.8);transition:transform var(--mat-dialog-transition-duration, 0ms) cubic-bezier(0, 0, 0.2, 1);max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit;box-shadow:var(--mat-dialog-container-elevation-shadow, none);border-radius:var(--mat-dialog-container-shape, var(--mat-sys-corner-extra-large, 4px));background-color:var(--mat-dialog-container-color, var(--mat-sys-surface, white))}[dir=rtl] .mat-mdc-dialog-surface{text-align:right}.mdc-dialog--open .mat-mdc-dialog-surface,.mdc-dialog--closing .mat-mdc-dialog-surface{transform:none}._mat-animation-noopable .mat-mdc-dialog-surface{transition:none}.mat-mdc-dialog-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:2px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mat-mdc-dialog-title{display:block;position:relative;flex-shrink:0;box-sizing:border-box;margin:0 0 1px;padding:var(--mat-dialog-headline-padding, 6px 24px 13px)}.mat-mdc-dialog-title::before{display:inline-block;width:0;height:40px;content:"";vertical-align:0}[dir=rtl] .mat-mdc-dialog-title{text-align:right}.mat-mdc-dialog-container .mat-mdc-dialog-title{color:var(--mat-dialog-subhead-color, var(--mat-sys-on-surface, rgba(0, 0, 0, 0.87)));font-family:var(--mat-dialog-subhead-font, var(--mat-sys-headline-small-font, inherit));line-height:var(--mat-dialog-subhead-line-height, var(--mat-sys-headline-small-line-height, 1.5rem));font-size:var(--mat-dialog-subhead-size, var(--mat-sys-headline-small-size, 1rem));font-weight:var(--mat-dialog-subhead-weight, var(--mat-sys-headline-small-weight, 400));letter-spacing:var(--mat-dialog-subhead-tracking, var(--mat-sys-headline-small-tracking, 0.03125em))}.mat-mdc-dialog-content{display:block;flex-grow:1;box-sizing:border-box;margin:0;overflow:auto;max-height:65vh}.mat-mdc-dialog-content>:first-child{margin-top:0}.mat-mdc-dialog-content>:last-child{margin-bottom:0}.mat-mdc-dialog-container .mat-mdc-dialog-content{color:var(--mat-dialog-supporting-text-color, var(--mat-sys-on-surface-variant, rgba(0, 0, 0, 0.6)));font-family:var(--mat-dialog-supporting-text-font, var(--mat-sys-body-medium-font, inherit));line-height:var(--mat-dialog-supporting-text-line-height, var(--mat-sys-body-medium-line-height, 1.5rem));font-size:var(--mat-dialog-supporting-text-size, var(--mat-sys-body-medium-size, 1rem));font-weight:var(--mat-dialog-supporting-text-weight, var(--mat-sys-body-medium-weight, 400));letter-spacing:var(--mat-dialog-supporting-text-tracking, var(--mat-sys-body-medium-tracking, 0.03125em))}.mat-mdc-dialog-container .mat-mdc-dialog-content{padding:var(--mat-dialog-content-padding, 20px 24px)}.mat-mdc-dialog-container-with-actions .mat-mdc-dialog-content{padding:var(--mat-dialog-with-actions-content-padding, 20px 24px 0)}.mat-mdc-dialog-container .mat-mdc-dialog-title+.mat-mdc-dialog-content{padding-top:0}.mat-mdc-dialog-actions{display:flex;position:relative;flex-shrink:0;flex-wrap:wrap;align-items:center;box-sizing:border-box;min-height:52px;margin:0;border-top:1px solid rgba(0,0,0,0);padding:var(--mat-dialog-actions-padding, 16px 24px);justify-content:var(--mat-dialog-actions-alignment, flex-end)}@media(forced-colors: active){.mat-mdc-dialog-actions{border-top-color:CanvasText}}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-start,.mat-mdc-dialog-actions[align=start]{justify-content:start}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-center,.mat-mdc-dialog-actions[align=center]{justify-content:center}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-end,.mat-mdc-dialog-actions[align=end]{justify-content:flex-end}.mat-mdc-dialog-actions .mat-button-base+.mat-button-base,.mat-mdc-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-mdc-dialog-actions .mat-button-base+.mat-button-base,[dir=rtl] .mat-mdc-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}.mat-mdc-dialog-component-host{display:contents}
3
3
  `],encapsulation:2})}return i})(),Fe="--mat-dialog-transition-duration";function Le(i){return i==null?null:typeof i=="number"?i:i.endsWith("ms")?q(i.substring(0,i.length-2)):i.endsWith("s")?q(i.substring(0,i.length-1))*1e3:i==="0"?0:null}var N=(function(i){return i[i.OPEN=0]="OPEN",i[i.CLOSING=1]="CLOSING",i[i.CLOSED=2]="CLOSED",i})(N||{}),z=class{_ref;_config;_containerInstance;componentInstance;componentRef=null;disableClose;id;_afterOpened=new G(1);_beforeClosed=new G(1);_result;_closeFallbackTimeout;_state=N.OPEN;_closeInteractionType;constructor(o,e,t){this._ref=o,this._config=e,this._containerInstance=t,this.disableClose=e.disableClose,this.id=o.id,o.addPanelClass("mat-mdc-dialog-panel"),t._animationStateChanged.pipe(_(a=>a.state==="opened"),p(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),t._animationStateChanged.pipe(_(a=>a.state==="closed"),p(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),o.overlayRef.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._finishDialogClose()}),te(this.backdropClick(),this.keydownEvents().pipe(_(a=>a.keyCode===27&&!this.disableClose&&!P(a)))).subscribe(a=>{this.disableClose||(a.preventDefault(),qe(this,a.type==="keydown"?"keyboard":"mouse"))})}close(o){let e=this._config.closePredicate;e&&!e(o,this._config,this.componentInstance)||(this._result=o,this._containerInstance._animationStateChanged.pipe(_(t=>t.state==="closing"),p(1)).subscribe(t=>{this._beforeClosed.next(o),this._beforeClosed.complete(),this._ref.overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),t.totalTime+100)}),this._state=N.CLOSING,this._containerInstance._startExitAnimation())}afterOpened(){return this._afterOpened}afterClosed(){return this._ref.closed}beforeClosed(){return this._beforeClosed}backdropClick(){return this._ref.backdropClick}keydownEvents(){return this._ref.keydownEvents}updatePosition(o){let e=this._ref.config.positionStrategy;return o&&(o.left||o.right)?o.left?e.left(o.left):e.right(o.right):e.centerHorizontally(),o&&(o.top||o.bottom)?o.top?e.top(o.top):e.bottom(o.bottom):e.centerVertically(),this._ref.updatePosition(),this}updateSize(o="",e=""){return this._ref.updateSize(o,e),this}addPanelClass(o){return this._ref.addPanelClass(o),this}removePanelClass(o){return this._ref.removePanelClass(o),this}getState(){return this._state}_finishDialogClose(){this._state=N.CLOSED,this._ref.close(this._result,{focusOrigin:this._closeInteractionType}),this.componentInstance=null}};function qe(i,o,e){return i._closeInteractionType=o,i.close(e)}var Ue=new u("MatMdcDialogData"),Ye=new u("mat-mdc-dialog-default-options"),Ze=new u("mat-mdc-dialog-scroll-strategy",{providedIn:"root",factory:()=>{let i=s(h);return()=>M(i)}}),Re=(()=>{class i{_defaultOptions=s(Ye,{optional:!0});_scrollStrategy=s(Ze);_parentDialog=s(i,{optional:!0,skipSelf:!0});_idGenerator=s(b);_injector=s(h);_dialog=s(X);_animationsDisabled=Z();_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new m;_afterOpenedAtThisLevel=new m;dialogConfigClass=V;_dialogRefConstructor;_dialogContainerType;_dialogDataToken;get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}_getAfterAllClosed(){let e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}afterAllClosed=A(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(T(void 0)));constructor(){this._dialogRefConstructor=z,this._dialogContainerType=Qe,this._dialogDataToken=Ue}open(e,t){let a;t=c(c({},this._defaultOptions||new V),t),t.id=t.id||this._idGenerator.getId("mat-mdc-dialog-"),t.scrollStrategy=t.scrollStrategy||this._scrollStrategy();let n=this._dialog.open(e,ee(c({},t),{positionStrategy:B(this._injector).centerHorizontally().centerVertically(),disableClose:!0,closePredicate:void 0,closeOnDestroy:!1,closeOnOverlayDetachments:!1,disableAnimations:this._animationsDisabled||t.enterAnimationDuration?.toLocaleString()==="0"||t.exitAnimationDuration?.toString()==="0",container:{type:this._dialogContainerType,providers:()=>[{provide:this.dialogConfigClass,useValue:t},{provide:g,useValue:t}]},templateContext:()=>({dialogRef:a}),providers:(l,r,d)=>(a=new this._dialogRefConstructor(l,t,d),a.updatePosition(t?.position),[{provide:this._dialogContainerType,useValue:d},{provide:this._dialogDataToken,useValue:r.data},{provide:this._dialogRefConstructor,useValue:a}])}));return a.componentRef=n.componentRef,a.componentInstance=n.componentInstance,this.openDialogs.push(a),this.afterOpened.next(a),a.afterClosed().subscribe(()=>{let l=this.openDialogs.indexOf(a);l>-1&&(this.openDialogs.splice(l,1),this.openDialogs.length||this._getAfterAllClosed().next())}),a}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(e){return this.openDialogs.find(t=>t.id===e)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_closeDialogs(e){let t=e.length;for(;t--;)e[t].close()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var Pe=(()=>{class i{_dialogRef=s(z,{optional:!0});_elementRef=s(I);_dialog=s(Re);constructor(){}ngOnInit(){this._dialogRef||(this._dialogRef=$e(this._elementRef,this._dialog.openDialogs)),this._dialogRef&&Promise.resolve().then(()=>{this._onAdd()})}ngOnDestroy(){this._dialogRef?._containerInstance&&Promise.resolve().then(()=>{this._onRemove()})}static \u0275fac=function(t){return new(t||i)};static \u0275dir=y({type:i})}return i})(),jt=(()=>{class i extends Pe{id=s(b).getId("mat-mdc-dialog-title-");_onAdd(){this._dialogRef._containerInstance?._addAriaLabelledBy?.(this.id)}_onRemove(){this._dialogRef?._containerInstance?._removeAriaLabelledBy?.(this.id)}static \u0275fac=(()=>{let e;return function(a){return(e||(e=k(i)))(a||i)}})();static \u0275dir=y({type:i,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-mdc-dialog-title","mdc-dialog__title"],hostVars:1,hostBindings:function(t,a){t&2&&W("id",a.id)},inputs:{id:"id"},exportAs:["matDialogTitle"],features:[f]})}return i})(),Nt=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275dir=y({type:i,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-mdc-dialog-content","mdc-dialog__content"],features:[le([De])]})}return i})(),Vt=(()=>{class i extends Pe{align;_onAdd(){this._dialogRef._containerInstance?._updateActionSectionCount?.(1)}_onRemove(){this._dialogRef._containerInstance?._updateActionSectionCount?.(-1)}static \u0275fac=(()=>{let e;return function(a){return(e||(e=k(i)))(a||i)}})();static \u0275dir=y({type:i,selectors:[["","mat-dialog-actions",""],["mat-dialog-actions"],["","matDialogActions",""]],hostAttrs:[1,"mat-mdc-dialog-actions","mdc-dialog__actions"],hostVars:6,hostBindings:function(t,a){t&2&&Q("mat-mdc-dialog-actions-align-start",a.align==="start")("mat-mdc-dialog-actions-align-center",a.align==="center")("mat-mdc-dialog-actions-align-end",a.align==="end")},inputs:{align:"align"},features:[f]})}return i})();function $e(i,o){let e=i.nativeElement.parentElement;for(;e&&!e.classList.contains("mat-mdc-dialog-container");)e=e.parentElement;return e?o.find(t=>t.id===e.id):null}var zt=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=S({type:i});static \u0275inj=x({providers:[Re],imports:[Ie,j,D,ve]})}return i})();export{z as a,Ue as b,Ye as c,Re as d,jt as e,Nt as f,Vt as g,zt as h};
@@ -1 +1 @@
1
- import{a as h}from"./chunk-TPZGV5NA.js";import{i as b}from"./chunk-J3CZ3MOZ.js";import{b as u}from"./chunk-RI2JQRSB.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-RYEX2DR7.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-VIDPCJ3F.js";import{i as b}from"./chunk-G2BRVRGR.js";import{b as u}from"./chunk-IRZNRZ5Q.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-5J7BTB5J.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 +1 @@
1
- import{a as l,b as p,c as m}from"./chunk-TIPIHEBG.js";import{Wc as o,Za as s,ca as i}from"./chunk-RYEX2DR7.js";var d=class a{sanitizer=i(o);renderer=this.buildRenderer();transform(r){if(!r)return"";let e=p.parse(r,{renderer:this.renderer,breaks:!0,gfm:!0,async:!1}),t=m.sanitize(e,{ADD_TAGS:["span"],ADD_ATTR:["aria-hidden","aria-label","target","rel"],ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))/i});return this.sanitizer.bypassSecurityTrustHtml(t)}buildRenderer(){let r=new l,e=r.link.bind(r);return r.link=t=>{let n=e(t);return this.isExternal(t.href)&&(n=n.replace("<a ",'<a target="_blank" rel="noopener noreferrer" ').replace("</a>",'<span class="external-link-icon" aria-hidden="true">\u2197</span></a>')),n},r}isExternal(r){if(!r||r.startsWith("/")||r.startsWith("#")||r.startsWith("?"))return!1;if(r.startsWith("//"))return!0;try{return new URL(r,window.location.href).hostname!==window.location.hostname}catch(e){return!1}}static \u0275fac=function(e){return new(e||a)};static \u0275pipe=s({name:"agentosMarkdown",type:a,pure:!0})};export{d as a};
1
+ import{a as l,b as p,c as m}from"./chunk-4F2LQOD7.js";import{Xc as o,Za as s,ca as i}from"./chunk-5J7BTB5J.js";var d=class a{sanitizer=i(o);renderer=this.buildRenderer();transform(r){if(!r)return"";let e=p.parse(r,{renderer:this.renderer,breaks:!0,gfm:!0,async:!1}),t=m.sanitize(e,{ADD_TAGS:["span"],ADD_ATTR:["aria-hidden","aria-label","target","rel"],ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))/i});return this.sanitizer.bypassSecurityTrustHtml(t)}buildRenderer(){let r=new l,e=r.link.bind(r);return r.link=t=>{let n=e(t);return this.isExternal(t.href)&&(n=n.replace("<a ",'<a target="_blank" rel="noopener noreferrer" ').replace("</a>",'<span class="external-link-icon" aria-hidden="true">\u2197</span></a>')),n},r}isExternal(r){if(!r||r.startsWith("/")||r.startsWith("#")||r.startsWith("?"))return!1;if(r.startsWith("//"))return!0;try{return new URL(r,window.location.href).hostname!==window.location.hostname}catch(e){return!1}}static \u0275fac=function(e){return new(e||a)};static \u0275pipe=s({name:"agentosMarkdown",type:a,pure:!0})};export{d as a};
@@ -0,0 +1 @@
1
+ import{d as a}from"./chunk-PNFA7PN2.js";import"./chunk-G2BRVRGR.js";import"./chunk-7MQRVE7E.js";import"./chunk-BGEXT3EN.js";import"./chunk-PKBNMAQJ.js";import"./chunk-OBV4LQBZ.js";import"./chunk-IRZNRZ5Q.js";import"./chunk-FAM7HWYV.js";import"./chunk-WLSXA23B.js";import"./chunk-E3XC4CVU.js";import"./chunk-5J7BTB5J.js";export{a as NamespaceListComponent};
@@ -1,4 +1,4 @@
1
- import{a as de,b as w}from"./chunk-H2NKOG3U.js";import{D as $,J as se,P as ce,R as re,S as ie,Tc as E,V as g,Z as c,a as T,b as C,ca as a,d,h as j,i as r,m as D,n as k,pa as le,t as te,u as ne}from"./chunk-RYEX2DR7.js";var N=class n{http=a(E);projectState=a(w);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads`}listThreads(){return this.http.get(this.getBaseUrl())}listAllThreads(){return this.http.get("/api/threads")}getThread(e){return this.http.get(`${this.getBaseUrl()}/${e}`)}createThread(e){let t=e?{name:e}:{};return this.http.post(this.getBaseUrl(),t)}updateThread(e,t){return this.http.put(`${this.getBaseUrl()}/${e}`,{name:t})}updateThreadUsers(e,t){return this.http.put(`${this.getBaseUrl()}/${e}`,{users:t})}starThread(e){return this.http.post(`${this.getBaseUrl()}/${e}/star`,{})}unstarThread(e){return this.http.delete(`${this.getBaseUrl()}/${e}/star`)}deleteThread(e){return this.http.delete(`${this.getBaseUrl()}/${e}`)}stopThread(e){return this.http.post(`${this.getBaseUrl()}/${e}/stop`,{})}getThreadMessages(e){return this.http.get(`${this.getBaseUrl()}/${e}/messages`)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var U=class n{selectedThreadIdSubject=new r(null);isLoadingSubject=new r(!1);isLoadingThreadListSubject=new r(!1);refreshThreadListSubject=new j;threadListSubject=new r([]);hasLoadedOncePerProject=new Map;currentProjectName=null;isLoading$=this.isLoadingSubject.asObservable();isLoadingThreadList$=this.isLoadingThreadListSubject.asObservable();threadApi=a(N);projectStateService=a(w);projectApi=a(de);projectName$=this.projectStateService.selectedProject$.pipe(te(e=>e?.name),se());constructor(){ne([this.projectName$,this.refreshThreadListSubject.asObservable().pipe(re(void 0))]).pipe(g(([e])=>{e!==this.currentProjectName&&(console.log("[THREAD_STATE] Project changed, clearing thread list"),this.threadListSubject.next([]),this.currentProjectName=e),e?this.hasLoadedOncePerProject.get(e)?console.log("[THREAD_STATE] Refreshing thread list for project",e,"(no spinner)"):(console.log("[THREAD_STATE] Initial load for project",e,"- showing spinner"),this.isLoadingThreadListSubject.next(!0)):(console.log("[THREAD_STATE] No project selected, hiding spinner"),this.isLoadingThreadListSubject.next(!1))}),ie(([e])=>e?(console.log("[THREAD_STATE] Fetching threads for project:",e),this.threadApi.listThreads().pipe(te(t=>({threads:t,projectName:e})),$(t=>(console.error("[THREAD_STATE] Error loading thread list:",t),D({threads:[],projectName:e}))))):(console.log("[THREAD_STATE] No project selected, returning empty list"),D({threads:[],projectName:null}))),g(({threads:e,projectName:t})=>{console.log("[THREAD_STATE] Thread list loaded:",e.length,"threads for project",t),t&&this.hasLoadedOncePerProject.set(t,!0),this.isLoadingThreadListSubject.next(!1),this.threadListSubject.next(e)})).subscribe()}threadList$=this.threadListSubject.asObservable();refreshSelectedThreadSubject=new j;selectedThread$=ne([this.projectName$,this.selectedThreadIdSubject.pipe(se()),this.refreshSelectedThreadSubject.pipe(re(void 0))]).pipe(ie(([e,t])=>!e||!t?D(null):(this.isLoadingSubject.next(!0),this.threadApi.getThread(t).pipe(ce({bufferSize:1,refCount:!0})))),g(()=>{this.isLoadingSubject.next(!1)}));selectThread(e){this.selectedThreadIdSubject.next(e)}getSelectedThreadId(){return this.selectedThreadIdSubject.value}getSelectedThreadIdOrThrow(){let e=this.selectedThreadIdSubject.value;if(!e)throw new Error("[THREAD_STATE] No thread selected");return e}clearSelection(){this.selectedThreadIdSubject.next(null)}stop(){let e=this.selectedThreadIdSubject.value;if(!e){console.error("[THREAD_STATE] Cannot stop: no thread selected");return}console.log("[THREAD_STATE] Stopping thread:",e),this.threadApi.stopThread(e).subscribe({next:t=>console.log("[THREAD_STATE] Stop signal sent:",t.message),error:t=>console.error("[THREAD_STATE] Error stopping thread:",t)})}refreshThreadList(){console.log("[THREAD_STATE] Manually refreshing thread list"),this.refreshThreadListSubject.next()}updateStarLocal(e,t,s){let P=this.threadListSubject.value.map(l=>{if(l.id!==e)return l;let p=l.starring||[];return t&&!p.includes(s)?C(T({},l),{starring:[...p,s]}):!t&&p.includes(s)?C(T({},l),{starring:p.filter(I=>I!==s)}):l});this.threadListSubject.next(P)}refreshSelectedThread(){this.refreshSelectedThreadSubject.next()}updateThreadUsers(e,t){return this.threadApi.updateThreadUsers(e,t).pipe(g(()=>{this.refreshThreadList()}),$(s=>(console.error("[THREAD_STATE] Error updating thread users:",s),k(()=>s))))}markDone(e){let t=this.projectStateService.getSelectedProjectId();if(!t){console.error("[THREAD_STATE] Cannot mark done: no project selected");return}this.projectApi.markThreadDone(t,e).subscribe({next:()=>this.refreshThreadList(),error:s=>console.error("[THREAD_STATE] Failed to mark thread as done:",s)})}markActive(e){let t=this.projectStateService.getSelectedProjectId();if(!t){console.error("[THREAD_STATE] Cannot mark active: no project selected");return}this.projectApi.markThreadActive(t,e).subscribe({next:()=>this.refreshThreadList(),error:s=>console.error("[THREAD_STATE] Failed to mark thread as active:",s)})}renameThread(e,t){let s=t.trim();return!s||s.length===0?(console.error("[THREAD_STATE] Cannot rename thread: name is empty after trimming"),k(()=>new Error("Thread name cannot be empty"))):(console.log("[THREAD_STATE] Renaming thread:",e,"to:",s),this.threadApi.updateThread(e,s).pipe(g(i=>{console.log("[THREAD_STATE] Thread renamed successfully:",i),this.refreshThreadList()}),$(i=>(console.error("[THREAD_STATE] Error renaming thread:",i),k(()=>i)))))}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var ue=class n{http=a(E);usernameSubject=new r(null);authEnabledSubject=new r(!1);username$=this.usernameSubject.asObservable();authEnabled$=this.authEnabledSubject.asObservable();fetchCurrentUser(){return this.http.get("/api/user/me").pipe(g(e=>{this.usernameSubject.next(e.username),this.authEnabledSubject.next(e.authEnabled)}))}getUsername(){return this.usernameSubject.value}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var L=class n{STORAGE_KEY="coday-preferences";isDesktopApp=!1;electronStorage=null;voiceLanguageSubject=new r("en-US");voiceLanguage$=this.voiceLanguageSubject.asObservable();voiceInputModeSubject=new r("browser");voiceInputMode$=this.voiceInputModeSubject.asObservable();enterToSendSubject=new r(!0);enterToSend$=this.enterToSendSubject.asObservable();voiceAnnounceEnabledSubject=new r(!1);voiceAnnounceEnabled$=this.voiceAnnounceEnabledSubject.asObservable();voiceModeSubject=new r("speech");voiceMode$=this.voiceModeSubject.asObservable();voiceReadFullTextSubject=new r(!1);voiceReadFullText$=this.voiceReadFullTextSubject.asObservable();voiceVolumeSubject=new r(.8);voiceVolume$=this.voiceVolumeSubject.asObservable();voiceRateSubject=new r(1.2);voiceRate$=this.voiceRateSubject.asObservable();selectedVoiceSubject=new r(null);selectedVoice$=this.selectedVoiceSubject.asObservable();printTechnicalMessagesSubject=new r(!1);printTechnicalMessages$=this.printTechnicalMessagesSubject.asObservable();hideTechnicalMessagesSubject=new r(!0);hideTechnicalMessages$=this.hideTechnicalMessagesSubject.asObservable();hideWarningMessagesSubject=new r(!1);hideWarningMessages$=this.hideWarningMessagesSubject.asObservable();agentNotificationEnabledSubject=new r(!1);agentNotificationEnabled$=this.agentNotificationEnabledSubject.asObservable();notificationSoundEnabledSubject=new r(!1);notificationSoundEnabled$=this.notificationSoundEnabledSubject.asObservable();browserNotificationEnabledSubject=new r(!1);browserNotificationEnabled$=this.browserNotificationEnabledSubject.asObservable();themeSubject=new r("light");theme$=this.themeSubject.asObservable();missionPreviewEnabledSubject=new r(!1);missionPreviewEnabled$=this.missionPreviewEnabledSubject.asObservable();constructor(){console.log("[PREFERENCES] Initializing preferences service"),typeof window<"u"&&window.codayDesktop?.storage&&(this.isDesktopApp=!0,this.electronStorage=window.codayDesktop.storage,console.log("[PREFERENCES] Running in desktop app mode with persistent storage")),this.initializePreferences()}initializePreferences(){this.isDesktopApp?this.loadPreferencesAsync():this.loadPreferencesSync()}loadPreferencesSync(){let e=this.getPreferenceSync("voiceLanguage","en-US")??"en-US";this.voiceLanguageSubject.next(e),console.log("[PREFERENCES] Voice language initialized to:",e);let t=this.getPreferenceSync("useEnterToSend",!0)??!0;this.enterToSendSubject.next(t),console.log("[PREFERENCES] Enter to send initialized to:",t);let s=this.getPreferenceSync("voiceAnnounceEnabled",!1)??!1;this.voiceAnnounceEnabledSubject.next(s);let i=this.getPreferenceSync("voiceMode","speech")??"speech";this.voiceModeSubject.next(i);let P=this.getPreferenceSync("voiceReadFullText",!1)??!1;this.voiceReadFullTextSubject.next(P);let l=this.getPreferenceSync("voiceVolume",.8)??.8;this.voiceVolumeSubject.next(l);let p=this.getPreferenceSync("voiceRate",1.2)??1.2;this.voiceRateSubject.next(p);let I=this.getPreferenceSync("selectedVoice",null)??null;this.selectedVoiceSubject.next(I);let _=this.getPreferenceSync("printTechnicalMessages",!1)??!1;this.printTechnicalMessagesSubject.next(_);let K=this.getPreferenceSync("hideTechnicalMessages",!0)??!0;this.hideTechnicalMessagesSubject.next(K);let G=this.getPreferenceSync("hideWarningMessages",!1)??!1;this.hideWarningMessagesSubject.next(G);let Q=this.getPreferenceSync("agentNotificationEnabled",!1)??!1;this.agentNotificationEnabledSubject.next(Q);let J=this.getPreferenceSync("notificationSoundEnabled",!0)??!0;this.notificationSoundEnabledSubject.next(J);let Y=this.getPreferenceSync("browserNotificationEnabled",!1)??!1;this.browserNotificationEnabledSubject.next(Y);let X=this.getPreferenceSync("theme","light")??"light";this.themeSubject.next(X);let Z=this.getPreferenceSync("missionPreviewEnabled",!1)??!1;this.missionPreviewEnabledSubject.next(Z);let ee=this.getPreferenceSync("voiceInputMode","browser")??"browser";this.voiceInputModeSubject.next(ee),console.log("[PREFERENCES] All preferences initialized successfully")}loadPreferencesAsync(){return d(this,null,function*(){let e=(yield this.getPreferenceAsync("voiceLanguage","en-US"))??"en-US";this.voiceLanguageSubject.next(e),console.log("[PREFERENCES] Voice language initialized to:",e);let t=(yield this.getPreferenceAsync("useEnterToSend",!0))??!0;this.enterToSendSubject.next(t),console.log("[PREFERENCES] Enter to send initialized to:",t);let s=(yield this.getPreferenceAsync("voiceAnnounceEnabled",!1))??!1;this.voiceAnnounceEnabledSubject.next(s);let i=(yield this.getPreferenceAsync("voiceMode","speech"))??"speech";this.voiceModeSubject.next(i);let P=(yield this.getPreferenceAsync("voiceReadFullText",!1))??!1;this.voiceReadFullTextSubject.next(P);let l=(yield this.getPreferenceAsync("voiceVolume",.8))??.8;this.voiceVolumeSubject.next(l);let p=(yield this.getPreferenceAsync("voiceRate",1.2))??1.2;this.voiceRateSubject.next(p);let I=(yield this.getPreferenceAsync("selectedVoice",null))??null;this.selectedVoiceSubject.next(I);let _=(yield this.getPreferenceAsync("printTechnicalMessages",!1))??!1;this.printTechnicalMessagesSubject.next(_);let K=(yield this.getPreferenceAsync("hideTechnicalMessages",!0))??!0;this.hideTechnicalMessagesSubject.next(K);let G=(yield this.getPreferenceAsync("hideWarningMessages",!1))??!1;this.hideWarningMessagesSubject.next(G);let Q=(yield this.getPreferenceAsync("agentNotificationEnabled",!1))??!1;this.agentNotificationEnabledSubject.next(Q);let J=(yield this.getPreferenceAsync("notificationSoundEnabled",!0))??!0;this.notificationSoundEnabledSubject.next(J);let Y=(yield this.getPreferenceAsync("browserNotificationEnabled",!1))??!1;this.browserNotificationEnabledSubject.next(Y);let X=(yield this.getPreferenceAsync("theme","light"))??"light";this.themeSubject.next(X);let Z=(yield this.getPreferenceAsync("missionPreviewEnabled",!1))??!1;this.missionPreviewEnabledSubject.next(Z);let ee=(yield this.getPreferenceAsync("voiceInputMode","browser"))??"browser";this.voiceInputModeSubject.next(ee),console.log("[PREFERENCES] All preferences initialized successfully (async)")})}getPreference(e,t){return this.getPreferenceSync(e,t)}getPreferenceSync(e,t){try{let s=localStorage.getItem(this.STORAGE_KEY);if(!s)return t;let i=JSON.parse(s);return i[e]!==void 0?i[e]:t}catch(s){return t}}getPreferenceAsync(e,t){return d(this,null,function*(){if(!this.electronStorage)return this.getPreferenceSync(e,t);try{let s=yield this.electronStorage.get(this.STORAGE_KEY);if(!s)return t;let i=JSON.parse(s);return i[e]!==void 0?i[e]:t}catch(s){return t}})}setPreference(e,t){this.isDesktopApp?this.setPreferenceAsync(e,t):this.setPreferenceSync(e,t)}setPreferenceSync(e,t){try{let s=localStorage.getItem(this.STORAGE_KEY),i=s?JSON.parse(s):{};i[e]=t,localStorage.setItem(this.STORAGE_KEY,JSON.stringify(i)),this.updateSubject(e,t)}catch(s){console.error("Failed to set preference:",s)}}setPreferenceAsync(e,t){return d(this,null,function*(){if(!this.electronStorage){this.setPreferenceSync(e,t);return}try{let s=yield this.electronStorage.get(this.STORAGE_KEY),i=s?JSON.parse(s):{};i[e]=t,yield this.electronStorage.set(this.STORAGE_KEY,JSON.stringify(i)),this.updateSubject(e,t)}catch(s){console.error("Failed to set preference:",s)}})}updateSubject(e,t){e==="voiceLanguage"&&this.voiceLanguageSubject.next(t),e==="useEnterToSend"&&this.enterToSendSubject.next(t),e==="voiceAnnounceEnabled"&&this.voiceAnnounceEnabledSubject.next(t),e==="voiceMode"&&this.voiceModeSubject.next(t),e==="voiceReadFullText"&&this.voiceReadFullTextSubject.next(t),e==="voiceVolume"&&this.voiceVolumeSubject.next(t),e==="voiceRate"&&this.voiceRateSubject.next(t),e==="selectedVoice"&&this.selectedVoiceSubject.next(t),e==="printTechnicalMessages"&&this.printTechnicalMessagesSubject.next(t),e==="hideTechnicalMessages"&&this.hideTechnicalMessagesSubject.next(t),e==="hideWarningMessages"&&this.hideWarningMessagesSubject.next(t),e==="agentNotificationEnabled"&&this.agentNotificationEnabledSubject.next(t),e==="notificationSoundEnabled"&&this.notificationSoundEnabledSubject.next(t),e==="browserNotificationEnabled"&&this.browserNotificationEnabledSubject.next(t),e==="theme"&&this.themeSubject.next(t),e==="voiceInputMode"&&this.voiceInputModeSubject.next(t),e==="missionPreviewEnabled"&&this.missionPreviewEnabledSubject.next(t)}setVoiceLanguage(e){console.log("[PREFERENCES] Setting voice language to:",e),this.setPreference("voiceLanguage",e)}getVoiceLanguage(){return this.getPreference("voiceLanguage","en-US")??"en-US"}setVoiceInputMode(e){console.log("[PREFERENCES] Setting voice input mode to:",e),this.setPreference("voiceInputMode",e)}getVoiceInputMode(){return this.getPreference("voiceInputMode","browser")??"browser"}setEnterToSend(e){console.log("[PREFERENCES] Setting Enter to send to:",e),this.setPreference("useEnterToSend",e)}getEnterToSend(){return this.getPreference("useEnterToSend",!1)??!1}setVoiceAnnounceEnabled(e){console.log("[PREFERENCES] Setting voice announce enabled to:",e),this.setPreference("voiceAnnounceEnabled",e)}getVoiceAnnounceEnabled(){return this.getPreference("voiceAnnounceEnabled",!1)??!1}setVoiceMode(e){console.log("[PREFERENCES] Setting voice mode to:",e),this.setPreference("voiceMode",e)}getVoiceMode(){return this.getPreference("voiceMode","speech")??"speech"}setVoiceReadFullText(e){console.log("[PREFERENCES] Setting voice read full text to:",e),this.setPreference("voiceReadFullText",e)}getVoiceReadFullText(){return this.getPreference("voiceReadFullText",!1)??!1}setVoiceVolume(e){let t=Math.max(0,Math.min(1,e));console.log("[PREFERENCES] Setting voice volume to:",t),this.setPreference("voiceVolume",t)}getVoiceVolume(){return this.getPreference("voiceVolume",.8)??.8}setVoiceRate(e){let t=Math.max(.5,Math.min(2,e));console.log("[PREFERENCES] Setting voice rate to:",t),this.setPreference("voiceRate",t)}getVoiceRate(){return this.getPreference("voiceRate",1.2)??1.2}setSelectedVoice(e){console.log("[PREFERENCES] Setting selected voice to:",e),this.setPreference("selectedVoice",e)}getSelectedVoice(){return this.getPreference("selectedVoice",null)??null}setPrintTechnicalMessages(e){console.log("[PREFERENCES] Setting print technical messages to:",e),this.setPreference("printTechnicalMessages",e)}getPrintTechnicalMessages(){return this.getPreference("printTechnicalMessages",!1)??!1}setHideTechnicalMessages(e){console.log("[PREFERENCES] Setting hide technical messages to:",e),this.setPreference("hideTechnicalMessages",e)}getHideTechnicalMessages(){return this.getPreference("hideTechnicalMessages",!0)??!0}setHideWarningMessages(e){console.log("[PREFERENCES] Setting hide warning messages to:",e),this.setPreference("hideWarningMessages",e)}getHideWarningMessages(){return this.getPreference("hideWarningMessages",!1)??!1}setAgentNotificationEnabled(e){console.log("[PREFERENCES] Setting agent notification enabled to:",e),this.setPreference("agentNotificationEnabled",e)}getAgentNotificationEnabled(){return this.getPreference("agentNotificationEnabled",!1)??!1}setNotificationSoundEnabled(e){console.log("[PREFERENCES] Setting notification sound enabled to:",e),this.setPreference("notificationSoundEnabled",e)}getNotificationSoundEnabled(){return this.getPreference("notificationSoundEnabled",!0)??!0}setBrowserNotificationEnabled(e){console.log("[PREFERENCES] Setting browser notification enabled to:",e),this.setPreference("browserNotificationEnabled",e)}getBrowserNotificationEnabled(){return this.getPreference("browserNotificationEnabled",!1)??!1}setMissionPreviewEnabled(e){this.setPreference("missionPreviewEnabled",e)}getMissionPreviewEnabled(){return this.getPreference("missionPreviewEnabled",!1)??!1}getMissionPreviewPanelWidth(){return this.getPreference("missionPreviewPanelWidth",33)??33}setMissionPreviewPanelWidth(e){this.setPreference("missionPreviewPanelWidth",e)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};function oe(n,e=80){if(n.length<=e)return n;try{if(n.trim().startsWith("{")||n.trim().startsWith("[")){let t=JSON.parse(n),s=JSON.stringify(t);return s.length<=e?s:s.substring(0,e)+`...(${s.length} chars)`}}catch(t){}return n.substring(0,e)+"..."}var o=class{constructor(e,t){this.type=t;if(e.timestamp)this.timestamp=e.timestamp;else{let s=Math.random().toString(36).substring(2,7);this.timestamp=`${new Date().toISOString()}-${s}`}this.parentKey=e.parentKey,this.threadId=e.threadId,this.length=0}timestamp;parentKey;static type;length;threadId;get date(){let e=this.timestamp.lastIndexOf("-");if(e>0){let t=this.timestamp.substring(e+1);if(t.length===5&&/^[a-z0-9]+$/.test(t))return new Date(this.timestamp.substring(0,e))}return new Date(this.timestamp)}},q=class extends o{invite;constructor(e,t){super(e,t),this.invite=e.invite}buildAnswer(e){return new u({answer:e,parentKey:this.timestamp,invite:this.invite})}},F=class n extends o{static type="heartbeat";constructor(e){super(e,n.type)}},f=class n extends q{defaultValue;static type="invite";constructor(e){super(e,n.type),this.defaultValue=e.defaultValue}},He="InviteEventDefault",u=class n extends o{answer;invite;name;silent;static type="answer";constructor(e){super(e,n.type),this.answer=e.answer??"No answer",this.invite=e.invite,this.name=e.name,this.silent=e.silent}},A=class n extends o{speaker;text;static type="text";constructor(e){super(e,n.type),this.speaker=e.speaker,this.text=e.text}},B=class n extends o{chunk;static type="text_chunk";constructor(e){super(e,n.type),this.chunk=e.chunk,this.length=this.chunk.length}},M=class n extends o{warning;static type="warn";constructor(e){super(e,n.type),this.warning=e.warning}},h=class n extends o{error;static type="error";constructor(e){super(e,n.type),this.error=e.error}},b=class n extends q{options;optionalQuestion;allowFreeText;static type="choice";constructor(e){super(e,n.type),this.options=Array.isArray(e.options)?e.options:[],this.optionalQuestion=e.optionalQuestion,this.allowFreeText=e.allowFreeText??!1}},v=class n extends o{toolRequestId;name;args;static type="tool_request";constructor(e){super(e,n.type),this.toolRequestId=e.toolRequestId??this.timestamp,this.name=e.name,this.args=e.args,this.length=this.args.length+this.name.length+this.toolRequestId.length+20}buildResponse(e){return new m({output:e,toolRequestId:this.toolRequestId,parentKey:this.timestamp})}toSingleLineString(e=50){let t=oe(this.args,e);return`\u{1F527} ${this.name}(${t})`}},m=class n extends o{toolRequestId;output;static type="tool_response";constructor(e){if(super(e,n.type),this.toolRequestId=e.toolRequestId||this.timestamp||new Date().toISOString(),this.output=e.output,typeof this.output=="string")this.length=this.output.length+this.toolRequestId.length+20;else if(this.output.type==="text")this.length=this.output.content.length+this.toolRequestId.length+20;else if(this.output.type==="image"){let t=(this.output.width??0)*(this.output.height??0)/750;this.length=(t?t*3.5:this.output.content.length)+this.toolRequestId.length+20}else this.length=this.toolRequestId.length+20}getTextOutput(){return typeof this.output=="string"?this.output:this.output.type==="text"?this.output.content:this.output.type==="image"?`[Image: ${this.output.mimeType}]`:""}toSingleLineString(e=50){let t=this.getTextOutput(),s=oe(t,e),i=typeof this.output!="string"&&this.output.type==="image"?" [image]":"";return`\u2B91 ${s}${i}`}},O=class n extends o{static type="thinking";static debounce=5e3;constructor(e){super(e,n.type)}},y=class n extends o{summary;static type="summary";constructor(e){super(e,n.type),this.summary=e.summary,this.length=this.summary.length}toSingleLineString(e=80){return`\u{1F4CB} Summary: ${oe(this.summary,e)}`}},S=class n extends o{role;name;content;static type="message";constructor(e){super(e,n.type),this.role=e.role,this.name=e.name,this.content=e.content,this.length=this.content.map(t=>{if(t.type==="text")return t.content.length;if(t.type==="image"){let s=(t.width||0)*(t.height||0)/750;return s?s*3.5:t.content.length}return t.type==="audio"?t.transcription?.length??100:0}).reduce((t,s)=>t+s,0)}getTextContent(){return this.content.filter(e=>e.type==="text").map(e=>e.content).join(`
1
+ import{a as de,b as w}from"./chunk-7V5RIRTC.js";import{D as $,J as se,P as ce,R as re,S as ie,Uc as E,V as g,Z as c,a as T,b as C,ca as a,d,h as j,i as r,m as D,n as k,pa as le,t as te,u as ne}from"./chunk-5J7BTB5J.js";var N=class n{http=a(E);projectState=a(w);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads`}listThreads(){return this.http.get(this.getBaseUrl())}listAllThreads(){return this.http.get("/api/threads")}getThread(e){return this.http.get(`${this.getBaseUrl()}/${e}`)}createThread(e){let t=e?{name:e}:{};return this.http.post(this.getBaseUrl(),t)}updateThread(e,t){return this.http.put(`${this.getBaseUrl()}/${e}`,{name:t})}updateThreadUsers(e,t){return this.http.put(`${this.getBaseUrl()}/${e}`,{users:t})}starThread(e){return this.http.post(`${this.getBaseUrl()}/${e}/star`,{})}unstarThread(e){return this.http.delete(`${this.getBaseUrl()}/${e}/star`)}deleteThread(e){return this.http.delete(`${this.getBaseUrl()}/${e}`)}stopThread(e){return this.http.post(`${this.getBaseUrl()}/${e}/stop`,{})}getThreadMessages(e){return this.http.get(`${this.getBaseUrl()}/${e}/messages`)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var U=class n{selectedThreadIdSubject=new r(null);isLoadingSubject=new r(!1);isLoadingThreadListSubject=new r(!1);refreshThreadListSubject=new j;threadListSubject=new r([]);hasLoadedOncePerProject=new Map;currentProjectName=null;isLoading$=this.isLoadingSubject.asObservable();isLoadingThreadList$=this.isLoadingThreadListSubject.asObservable();threadApi=a(N);projectStateService=a(w);projectApi=a(de);projectName$=this.projectStateService.selectedProject$.pipe(te(e=>e?.name),se());constructor(){ne([this.projectName$,this.refreshThreadListSubject.asObservable().pipe(re(void 0))]).pipe(g(([e])=>{e!==this.currentProjectName&&(console.log("[THREAD_STATE] Project changed, clearing thread list"),this.threadListSubject.next([]),this.currentProjectName=e),e?this.hasLoadedOncePerProject.get(e)?console.log("[THREAD_STATE] Refreshing thread list for project",e,"(no spinner)"):(console.log("[THREAD_STATE] Initial load for project",e,"- showing spinner"),this.isLoadingThreadListSubject.next(!0)):(console.log("[THREAD_STATE] No project selected, hiding spinner"),this.isLoadingThreadListSubject.next(!1))}),ie(([e])=>e?(console.log("[THREAD_STATE] Fetching threads for project:",e),this.threadApi.listThreads().pipe(te(t=>({threads:t,projectName:e})),$(t=>(console.error("[THREAD_STATE] Error loading thread list:",t),D({threads:[],projectName:e}))))):(console.log("[THREAD_STATE] No project selected, returning empty list"),D({threads:[],projectName:null}))),g(({threads:e,projectName:t})=>{console.log("[THREAD_STATE] Thread list loaded:",e.length,"threads for project",t),t&&this.hasLoadedOncePerProject.set(t,!0),this.isLoadingThreadListSubject.next(!1),this.threadListSubject.next(e)})).subscribe()}threadList$=this.threadListSubject.asObservable();refreshSelectedThreadSubject=new j;selectedThread$=ne([this.projectName$,this.selectedThreadIdSubject.pipe(se()),this.refreshSelectedThreadSubject.pipe(re(void 0))]).pipe(ie(([e,t])=>!e||!t?D(null):(this.isLoadingSubject.next(!0),this.threadApi.getThread(t).pipe(ce({bufferSize:1,refCount:!0})))),g(()=>{this.isLoadingSubject.next(!1)}));selectThread(e){this.selectedThreadIdSubject.next(e)}getSelectedThreadId(){return this.selectedThreadIdSubject.value}getSelectedThreadIdOrThrow(){let e=this.selectedThreadIdSubject.value;if(!e)throw new Error("[THREAD_STATE] No thread selected");return e}clearSelection(){this.selectedThreadIdSubject.next(null)}stop(){let e=this.selectedThreadIdSubject.value;if(!e){console.error("[THREAD_STATE] Cannot stop: no thread selected");return}console.log("[THREAD_STATE] Stopping thread:",e),this.threadApi.stopThread(e).subscribe({next:t=>console.log("[THREAD_STATE] Stop signal sent:",t.message),error:t=>console.error("[THREAD_STATE] Error stopping thread:",t)})}refreshThreadList(){console.log("[THREAD_STATE] Manually refreshing thread list"),this.refreshThreadListSubject.next()}updateStarLocal(e,t,s){let P=this.threadListSubject.value.map(l=>{if(l.id!==e)return l;let p=l.starring||[];return t&&!p.includes(s)?C(T({},l),{starring:[...p,s]}):!t&&p.includes(s)?C(T({},l),{starring:p.filter(I=>I!==s)}):l});this.threadListSubject.next(P)}refreshSelectedThread(){this.refreshSelectedThreadSubject.next()}updateThreadUsers(e,t){return this.threadApi.updateThreadUsers(e,t).pipe(g(()=>{this.refreshThreadList()}),$(s=>(console.error("[THREAD_STATE] Error updating thread users:",s),k(()=>s))))}markDone(e){let t=this.projectStateService.getSelectedProjectId();if(!t){console.error("[THREAD_STATE] Cannot mark done: no project selected");return}this.projectApi.markThreadDone(t,e).subscribe({next:()=>this.refreshThreadList(),error:s=>console.error("[THREAD_STATE] Failed to mark thread as done:",s)})}markActive(e){let t=this.projectStateService.getSelectedProjectId();if(!t){console.error("[THREAD_STATE] Cannot mark active: no project selected");return}this.projectApi.markThreadActive(t,e).subscribe({next:()=>this.refreshThreadList(),error:s=>console.error("[THREAD_STATE] Failed to mark thread as active:",s)})}renameThread(e,t){let s=t.trim();return!s||s.length===0?(console.error("[THREAD_STATE] Cannot rename thread: name is empty after trimming"),k(()=>new Error("Thread name cannot be empty"))):(console.log("[THREAD_STATE] Renaming thread:",e,"to:",s),this.threadApi.updateThread(e,s).pipe(g(i=>{console.log("[THREAD_STATE] Thread renamed successfully:",i),this.refreshThreadList()}),$(i=>(console.error("[THREAD_STATE] Error renaming thread:",i),k(()=>i)))))}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var ue=class n{http=a(E);usernameSubject=new r(null);authEnabledSubject=new r(!1);username$=this.usernameSubject.asObservable();authEnabled$=this.authEnabledSubject.asObservable();fetchCurrentUser(){return this.http.get("/api/user/me").pipe(g(e=>{this.usernameSubject.next(e.username),this.authEnabledSubject.next(e.authEnabled)}))}getUsername(){return this.usernameSubject.value}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var L=class n{STORAGE_KEY="coday-preferences";isDesktopApp=!1;electronStorage=null;voiceLanguageSubject=new r("en-US");voiceLanguage$=this.voiceLanguageSubject.asObservable();voiceInputModeSubject=new r("browser");voiceInputMode$=this.voiceInputModeSubject.asObservable();enterToSendSubject=new r(!0);enterToSend$=this.enterToSendSubject.asObservable();voiceAnnounceEnabledSubject=new r(!1);voiceAnnounceEnabled$=this.voiceAnnounceEnabledSubject.asObservable();voiceModeSubject=new r("speech");voiceMode$=this.voiceModeSubject.asObservable();voiceReadFullTextSubject=new r(!1);voiceReadFullText$=this.voiceReadFullTextSubject.asObservable();voiceVolumeSubject=new r(.8);voiceVolume$=this.voiceVolumeSubject.asObservable();voiceRateSubject=new r(1.2);voiceRate$=this.voiceRateSubject.asObservable();selectedVoiceSubject=new r(null);selectedVoice$=this.selectedVoiceSubject.asObservable();printTechnicalMessagesSubject=new r(!1);printTechnicalMessages$=this.printTechnicalMessagesSubject.asObservable();hideTechnicalMessagesSubject=new r(!0);hideTechnicalMessages$=this.hideTechnicalMessagesSubject.asObservable();hideWarningMessagesSubject=new r(!1);hideWarningMessages$=this.hideWarningMessagesSubject.asObservable();agentNotificationEnabledSubject=new r(!1);agentNotificationEnabled$=this.agentNotificationEnabledSubject.asObservable();notificationSoundEnabledSubject=new r(!1);notificationSoundEnabled$=this.notificationSoundEnabledSubject.asObservable();browserNotificationEnabledSubject=new r(!1);browserNotificationEnabled$=this.browserNotificationEnabledSubject.asObservable();themeSubject=new r("light");theme$=this.themeSubject.asObservable();missionPreviewEnabledSubject=new r(!1);missionPreviewEnabled$=this.missionPreviewEnabledSubject.asObservable();constructor(){console.log("[PREFERENCES] Initializing preferences service"),typeof window<"u"&&window.codayDesktop?.storage&&(this.isDesktopApp=!0,this.electronStorage=window.codayDesktop.storage,console.log("[PREFERENCES] Running in desktop app mode with persistent storage")),this.initializePreferences()}initializePreferences(){this.isDesktopApp?this.loadPreferencesAsync():this.loadPreferencesSync()}loadPreferencesSync(){let e=this.getPreferenceSync("voiceLanguage","en-US")??"en-US";this.voiceLanguageSubject.next(e),console.log("[PREFERENCES] Voice language initialized to:",e);let t=this.getPreferenceSync("useEnterToSend",!0)??!0;this.enterToSendSubject.next(t),console.log("[PREFERENCES] Enter to send initialized to:",t);let s=this.getPreferenceSync("voiceAnnounceEnabled",!1)??!1;this.voiceAnnounceEnabledSubject.next(s);let i=this.getPreferenceSync("voiceMode","speech")??"speech";this.voiceModeSubject.next(i);let P=this.getPreferenceSync("voiceReadFullText",!1)??!1;this.voiceReadFullTextSubject.next(P);let l=this.getPreferenceSync("voiceVolume",.8)??.8;this.voiceVolumeSubject.next(l);let p=this.getPreferenceSync("voiceRate",1.2)??1.2;this.voiceRateSubject.next(p);let I=this.getPreferenceSync("selectedVoice",null)??null;this.selectedVoiceSubject.next(I);let _=this.getPreferenceSync("printTechnicalMessages",!1)??!1;this.printTechnicalMessagesSubject.next(_);let K=this.getPreferenceSync("hideTechnicalMessages",!0)??!0;this.hideTechnicalMessagesSubject.next(K);let G=this.getPreferenceSync("hideWarningMessages",!1)??!1;this.hideWarningMessagesSubject.next(G);let Q=this.getPreferenceSync("agentNotificationEnabled",!1)??!1;this.agentNotificationEnabledSubject.next(Q);let J=this.getPreferenceSync("notificationSoundEnabled",!0)??!0;this.notificationSoundEnabledSubject.next(J);let Y=this.getPreferenceSync("browserNotificationEnabled",!1)??!1;this.browserNotificationEnabledSubject.next(Y);let X=this.getPreferenceSync("theme","light")??"light";this.themeSubject.next(X);let Z=this.getPreferenceSync("missionPreviewEnabled",!1)??!1;this.missionPreviewEnabledSubject.next(Z);let ee=this.getPreferenceSync("voiceInputMode","browser")??"browser";this.voiceInputModeSubject.next(ee),console.log("[PREFERENCES] All preferences initialized successfully")}loadPreferencesAsync(){return d(this,null,function*(){let e=(yield this.getPreferenceAsync("voiceLanguage","en-US"))??"en-US";this.voiceLanguageSubject.next(e),console.log("[PREFERENCES] Voice language initialized to:",e);let t=(yield this.getPreferenceAsync("useEnterToSend",!0))??!0;this.enterToSendSubject.next(t),console.log("[PREFERENCES] Enter to send initialized to:",t);let s=(yield this.getPreferenceAsync("voiceAnnounceEnabled",!1))??!1;this.voiceAnnounceEnabledSubject.next(s);let i=(yield this.getPreferenceAsync("voiceMode","speech"))??"speech";this.voiceModeSubject.next(i);let P=(yield this.getPreferenceAsync("voiceReadFullText",!1))??!1;this.voiceReadFullTextSubject.next(P);let l=(yield this.getPreferenceAsync("voiceVolume",.8))??.8;this.voiceVolumeSubject.next(l);let p=(yield this.getPreferenceAsync("voiceRate",1.2))??1.2;this.voiceRateSubject.next(p);let I=(yield this.getPreferenceAsync("selectedVoice",null))??null;this.selectedVoiceSubject.next(I);let _=(yield this.getPreferenceAsync("printTechnicalMessages",!1))??!1;this.printTechnicalMessagesSubject.next(_);let K=(yield this.getPreferenceAsync("hideTechnicalMessages",!0))??!0;this.hideTechnicalMessagesSubject.next(K);let G=(yield this.getPreferenceAsync("hideWarningMessages",!1))??!1;this.hideWarningMessagesSubject.next(G);let Q=(yield this.getPreferenceAsync("agentNotificationEnabled",!1))??!1;this.agentNotificationEnabledSubject.next(Q);let J=(yield this.getPreferenceAsync("notificationSoundEnabled",!0))??!0;this.notificationSoundEnabledSubject.next(J);let Y=(yield this.getPreferenceAsync("browserNotificationEnabled",!1))??!1;this.browserNotificationEnabledSubject.next(Y);let X=(yield this.getPreferenceAsync("theme","light"))??"light";this.themeSubject.next(X);let Z=(yield this.getPreferenceAsync("missionPreviewEnabled",!1))??!1;this.missionPreviewEnabledSubject.next(Z);let ee=(yield this.getPreferenceAsync("voiceInputMode","browser"))??"browser";this.voiceInputModeSubject.next(ee),console.log("[PREFERENCES] All preferences initialized successfully (async)")})}getPreference(e,t){return this.getPreferenceSync(e,t)}getPreferenceSync(e,t){try{let s=localStorage.getItem(this.STORAGE_KEY);if(!s)return t;let i=JSON.parse(s);return i[e]!==void 0?i[e]:t}catch(s){return t}}getPreferenceAsync(e,t){return d(this,null,function*(){if(!this.electronStorage)return this.getPreferenceSync(e,t);try{let s=yield this.electronStorage.get(this.STORAGE_KEY);if(!s)return t;let i=JSON.parse(s);return i[e]!==void 0?i[e]:t}catch(s){return t}})}setPreference(e,t){this.isDesktopApp?this.setPreferenceAsync(e,t):this.setPreferenceSync(e,t)}setPreferenceSync(e,t){try{let s=localStorage.getItem(this.STORAGE_KEY),i=s?JSON.parse(s):{};i[e]=t,localStorage.setItem(this.STORAGE_KEY,JSON.stringify(i)),this.updateSubject(e,t)}catch(s){console.error("Failed to set preference:",s)}}setPreferenceAsync(e,t){return d(this,null,function*(){if(!this.electronStorage){this.setPreferenceSync(e,t);return}try{let s=yield this.electronStorage.get(this.STORAGE_KEY),i=s?JSON.parse(s):{};i[e]=t,yield this.electronStorage.set(this.STORAGE_KEY,JSON.stringify(i)),this.updateSubject(e,t)}catch(s){console.error("Failed to set preference:",s)}})}updateSubject(e,t){e==="voiceLanguage"&&this.voiceLanguageSubject.next(t),e==="useEnterToSend"&&this.enterToSendSubject.next(t),e==="voiceAnnounceEnabled"&&this.voiceAnnounceEnabledSubject.next(t),e==="voiceMode"&&this.voiceModeSubject.next(t),e==="voiceReadFullText"&&this.voiceReadFullTextSubject.next(t),e==="voiceVolume"&&this.voiceVolumeSubject.next(t),e==="voiceRate"&&this.voiceRateSubject.next(t),e==="selectedVoice"&&this.selectedVoiceSubject.next(t),e==="printTechnicalMessages"&&this.printTechnicalMessagesSubject.next(t),e==="hideTechnicalMessages"&&this.hideTechnicalMessagesSubject.next(t),e==="hideWarningMessages"&&this.hideWarningMessagesSubject.next(t),e==="agentNotificationEnabled"&&this.agentNotificationEnabledSubject.next(t),e==="notificationSoundEnabled"&&this.notificationSoundEnabledSubject.next(t),e==="browserNotificationEnabled"&&this.browserNotificationEnabledSubject.next(t),e==="theme"&&this.themeSubject.next(t),e==="voiceInputMode"&&this.voiceInputModeSubject.next(t),e==="missionPreviewEnabled"&&this.missionPreviewEnabledSubject.next(t)}setVoiceLanguage(e){console.log("[PREFERENCES] Setting voice language to:",e),this.setPreference("voiceLanguage",e)}getVoiceLanguage(){return this.getPreference("voiceLanguage","en-US")??"en-US"}setVoiceInputMode(e){console.log("[PREFERENCES] Setting voice input mode to:",e),this.setPreference("voiceInputMode",e)}getVoiceInputMode(){return this.getPreference("voiceInputMode","browser")??"browser"}setEnterToSend(e){console.log("[PREFERENCES] Setting Enter to send to:",e),this.setPreference("useEnterToSend",e)}getEnterToSend(){return this.getPreference("useEnterToSend",!1)??!1}setVoiceAnnounceEnabled(e){console.log("[PREFERENCES] Setting voice announce enabled to:",e),this.setPreference("voiceAnnounceEnabled",e)}getVoiceAnnounceEnabled(){return this.getPreference("voiceAnnounceEnabled",!1)??!1}setVoiceMode(e){console.log("[PREFERENCES] Setting voice mode to:",e),this.setPreference("voiceMode",e)}getVoiceMode(){return this.getPreference("voiceMode","speech")??"speech"}setVoiceReadFullText(e){console.log("[PREFERENCES] Setting voice read full text to:",e),this.setPreference("voiceReadFullText",e)}getVoiceReadFullText(){return this.getPreference("voiceReadFullText",!1)??!1}setVoiceVolume(e){let t=Math.max(0,Math.min(1,e));console.log("[PREFERENCES] Setting voice volume to:",t),this.setPreference("voiceVolume",t)}getVoiceVolume(){return this.getPreference("voiceVolume",.8)??.8}setVoiceRate(e){let t=Math.max(.5,Math.min(2,e));console.log("[PREFERENCES] Setting voice rate to:",t),this.setPreference("voiceRate",t)}getVoiceRate(){return this.getPreference("voiceRate",1.2)??1.2}setSelectedVoice(e){console.log("[PREFERENCES] Setting selected voice to:",e),this.setPreference("selectedVoice",e)}getSelectedVoice(){return this.getPreference("selectedVoice",null)??null}setPrintTechnicalMessages(e){console.log("[PREFERENCES] Setting print technical messages to:",e),this.setPreference("printTechnicalMessages",e)}getPrintTechnicalMessages(){return this.getPreference("printTechnicalMessages",!1)??!1}setHideTechnicalMessages(e){console.log("[PREFERENCES] Setting hide technical messages to:",e),this.setPreference("hideTechnicalMessages",e)}getHideTechnicalMessages(){return this.getPreference("hideTechnicalMessages",!0)??!0}setHideWarningMessages(e){console.log("[PREFERENCES] Setting hide warning messages to:",e),this.setPreference("hideWarningMessages",e)}getHideWarningMessages(){return this.getPreference("hideWarningMessages",!1)??!1}setAgentNotificationEnabled(e){console.log("[PREFERENCES] Setting agent notification enabled to:",e),this.setPreference("agentNotificationEnabled",e)}getAgentNotificationEnabled(){return this.getPreference("agentNotificationEnabled",!1)??!1}setNotificationSoundEnabled(e){console.log("[PREFERENCES] Setting notification sound enabled to:",e),this.setPreference("notificationSoundEnabled",e)}getNotificationSoundEnabled(){return this.getPreference("notificationSoundEnabled",!0)??!0}setBrowserNotificationEnabled(e){console.log("[PREFERENCES] Setting browser notification enabled to:",e),this.setPreference("browserNotificationEnabled",e)}getBrowserNotificationEnabled(){return this.getPreference("browserNotificationEnabled",!1)??!1}setMissionPreviewEnabled(e){this.setPreference("missionPreviewEnabled",e)}getMissionPreviewEnabled(){return this.getPreference("missionPreviewEnabled",!1)??!1}getMissionPreviewPanelWidth(){return this.getPreference("missionPreviewPanelWidth",33)??33}setMissionPreviewPanelWidth(e){this.setPreference("missionPreviewPanelWidth",e)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};function oe(n,e=80){if(n.length<=e)return n;try{if(n.trim().startsWith("{")||n.trim().startsWith("[")){let t=JSON.parse(n),s=JSON.stringify(t);return s.length<=e?s:s.substring(0,e)+`...(${s.length} chars)`}}catch(t){}return n.substring(0,e)+"..."}var o=class{constructor(e,t){this.type=t;if(e.timestamp)this.timestamp=e.timestamp;else{let s=Math.random().toString(36).substring(2,7);this.timestamp=`${new Date().toISOString()}-${s}`}this.parentKey=e.parentKey,this.threadId=e.threadId,this.length=0}timestamp;parentKey;static type;length;threadId;get date(){let e=this.timestamp.lastIndexOf("-");if(e>0){let t=this.timestamp.substring(e+1);if(t.length===5&&/^[a-z0-9]+$/.test(t))return new Date(this.timestamp.substring(0,e))}return new Date(this.timestamp)}},q=class extends o{invite;constructor(e,t){super(e,t),this.invite=e.invite}buildAnswer(e){return new u({answer:e,parentKey:this.timestamp,invite:this.invite})}},F=class n extends o{static type="heartbeat";constructor(e){super(e,n.type)}},f=class n extends q{defaultValue;static type="invite";constructor(e){super(e,n.type),this.defaultValue=e.defaultValue}},He="InviteEventDefault",u=class n extends o{answer;invite;name;silent;static type="answer";constructor(e){super(e,n.type),this.answer=e.answer??"No answer",this.invite=e.invite,this.name=e.name,this.silent=e.silent}},A=class n extends o{speaker;text;static type="text";constructor(e){super(e,n.type),this.speaker=e.speaker,this.text=e.text}},B=class n extends o{chunk;static type="text_chunk";constructor(e){super(e,n.type),this.chunk=e.chunk,this.length=this.chunk.length}},M=class n extends o{warning;static type="warn";constructor(e){super(e,n.type),this.warning=e.warning}},h=class n extends o{error;static type="error";constructor(e){super(e,n.type),this.error=e.error}},b=class n extends q{options;optionalQuestion;allowFreeText;static type="choice";constructor(e){super(e,n.type),this.options=Array.isArray(e.options)?e.options:[],this.optionalQuestion=e.optionalQuestion,this.allowFreeText=e.allowFreeText??!1}},v=class n extends o{toolRequestId;name;args;static type="tool_request";constructor(e){super(e,n.type),this.toolRequestId=e.toolRequestId??this.timestamp,this.name=e.name,this.args=e.args,this.length=this.args.length+this.name.length+this.toolRequestId.length+20}buildResponse(e){return new m({output:e,toolRequestId:this.toolRequestId,parentKey:this.timestamp})}toSingleLineString(e=50){let t=oe(this.args,e);return`\u{1F527} ${this.name}(${t})`}},m=class n extends o{toolRequestId;output;static type="tool_response";constructor(e){if(super(e,n.type),this.toolRequestId=e.toolRequestId||this.timestamp||new Date().toISOString(),this.output=e.output,typeof this.output=="string")this.length=this.output.length+this.toolRequestId.length+20;else if(this.output.type==="text")this.length=this.output.content.length+this.toolRequestId.length+20;else if(this.output.type==="image"){let t=(this.output.width??0)*(this.output.height??0)/750;this.length=(t?t*3.5:this.output.content.length)+this.toolRequestId.length+20}else this.length=this.toolRequestId.length+20}getTextOutput(){return typeof this.output=="string"?this.output:this.output.type==="text"?this.output.content:this.output.type==="image"?`[Image: ${this.output.mimeType}]`:""}toSingleLineString(e=50){let t=this.getTextOutput(),s=oe(t,e),i=typeof this.output!="string"&&this.output.type==="image"?" [image]":"";return`\u2B91 ${s}${i}`}},O=class n extends o{static type="thinking";static debounce=5e3;constructor(e){super(e,n.type)}},y=class n extends o{summary;static type="summary";constructor(e){super(e,n.type),this.summary=e.summary,this.length=this.summary.length}toSingleLineString(e=80){return`\u{1F4CB} Summary: ${oe(this.summary,e)}`}},S=class n extends o{role;name;content;static type="message";constructor(e){super(e,n.type),this.role=e.role,this.name=e.name,this.content=e.content,this.length=this.content.map(t=>{if(t.type==="text")return t.content.length;if(t.type==="image"){let s=(t.width||0)*(t.height||0)/750;return s?s*3.5:t.content.length}return t.type==="audio"?t.transcription?.length??100:0}).reduce((t,s)=>t+s,0)}getTextContent(){return this.content.filter(e=>e.type==="text").map(e=>e.content).join(`
2
2
  `)}},V=class n extends o{threadId;name;summary;users;static type="thread_update";constructor(e){super(e,n.type),this.threadId=e.threadId,this.name=e.name,this.summary=e.summary,this.users=e.users}},z=class n extends o{filename;operation;size;mimeType;static type="file";constructor(e){super(e,n.type),this.filename=e.filename,this.operation=e.operation,this.size=e.size,this.mimeType=e.mimeType}toSingleLineString(){let e=this.operation==="created"?"\u{1F4C4}":this.operation==="updated"?"\u{1F4DD}":"\u{1F5D1}\uFE0F",t=this.size?` (${(this.size/1024).toFixed(1)} KB)`:"";return`${e} ${this.operation}: ${this.filename}${t}`}},H=class n extends o{authUrl;state;integrationName;static type="oauth_request";constructor(e){super(e,n.type),this.authUrl=e.authUrl,this.state=e.state,this.integrationName=e.integrationName}},R=class n extends o{subThreadId;agentName;static type="delegation";constructor(e){super(e,n.type),this.subThreadId=e.subThreadId,this.agentName=e.agentName}},W=class n extends o{code;state;integrationName;error;errorDescription;static type="oauth_callback";constructor(e){super(e,n.type),this.code=e.code,this.state=e.state,this.integrationName=e.integrationName,this.error=e.error,this.errorDescription=e.errorDescription}},fe={[S.type]:S,[u.type]:u,[b.type]:b,[R.type]:R,[h.type]:h,[F.type]:F,[f.type]:f,[v.type]:v,[m.type]:m,[A.type]:A,[B.type]:B,[O.type]:O,[M.type]:M,[V.type]:V,[y.type]:y,[z.type]:z,[H.type]:H,[W.type]:W};function ae(n){let e=fe[n.type];return e?new e(n):void 0}var Ye=[{id:"builtin-plan",name:"plan",description:"Build a plan to complete the given task",source:"builtin",commands:[`@ We start a 3 phase process to build a comprehensive execution plan for the following task:
3
3
 
4
4
  <task>
@@ -0,0 +1 @@
1
+ import{a as k}from"./chunk-Y6K6VJYJ.js";import{c as q,d as O}from"./chunk-G2BRVRGR.js";import{a as E,c as $}from"./chunk-7MQRVE7E.js";import{o as D,t as S}from"./chunk-BGEXT3EN.js";import"./chunk-PKBNMAQJ.js";import"./chunk-OBV4LQBZ.js";import{a as M}from"./chunk-IRZNRZ5Q.js";import"./chunk-FAM7HWYV.js";import"./chunk-WLSXA23B.js";import"./chunk-E3XC4CVU.js";import{Bb as R,D as g,Db as l,Fb as s,Ic as L,Pb as N,S as A,Wa as h,ab as I,bc as w,ca as r,ec as x,fc as B,ga as p,ha as m,i as u,ic as T,lb as b,m as f,ma as C,mb as P,rb as c,sb as d,t as y,tb as _,z as v}from"./chunk-5J7BTB5J.js";var V=()=>[];function K(n,t){if(n&1){let i=R();d(0,"agentos-ai-model-item",4),l("deleteRequested",function(a){p(i);let e=s(2);return m(e.deleteModel(a))})("editRequested",function(a){p(i);let e=s(2);return m(e.editModel(a))}),_()}if(n&2){let i=s().$implicit,o=s();c("model",t)("namespaceId",o.namespaceId)("readOnly",o.isPlatformModel(i.id))}}function U(n,t){if(n&1&&b(0,K,1,3,"agentos-ai-model-item",3),n&2){let i,o=t.$implicit,a=s();P((i=a.resolveModel(o.id))?0:-1,i)}}var j="__platform__",G="Platform (read-only)",F=class n{route=r(E);router=r($);destroyRef=r(C);aiModelController=r(q);aiProviderController=r(O);namespaceId=this.route.snapshot.params.namespaceId;refresh$=new u(void 0);data$=this.refresh$.pipe(A(()=>v({namespace:this.aiModelController.listByNamespaceIdAiModel(this.namespaceId),platform:this.aiModelController.listPlatformLevelAiModel().pipe(g(()=>f([]))),providers:this.aiProviderController.listAiProvider(this.namespaceId)})));modelItems$=this.data$.pipe(y(({namespace:t,platform:i,providers:o})=>{let a=new Map(o.map(e=>[e.id??"",e.name]));return[...i.map(e=>({id:e.id??"",name:e.alias??e.apiModelName,description:e.apiModelName,groupKey:j,groupLabel:G})),...t.map(e=>({id:e.id??"",name:e.alias??e.apiModelName,description:e.apiModelName,groupKey:e.aiProviderId,groupLabel:a.get(e.aiProviderId)??e.aiProviderId}))]}));namespaceModelsById=new Map;platformModelsById=new Map;constructor(){this.data$.pipe(M(this.destroyRef)).subscribe(({namespace:t,platform:i})=>{this.namespaceModelsById=new Map(t.map(o=>[o.id??"",o])),this.platformModelsById=new Map(i.map(o=>[o.id??"",o]))})}goBack(){this.router.navigate(["/agentos","namespaces"])}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"ai-models","new"])}editModel(t){this.router.navigate(["/agentos",this.namespaceId,"ai-models",t.id,"edit"])}deleteModel(t){this.aiModelController.deleteAiModel(t.id??"").pipe(M(this.destroyRef)).subscribe(()=>this.refresh$.next())}resolveModel(t){return this.namespaceModelsById.get(t)??this.platformModelsById.get(t)??null}isPlatformModel(t){return this.platformModelsById.has(t)}static \u0275fac=function(i){return new(i||n)};static \u0275cmp=h({type:n,selectors:[["agentos-namespace-ai-models"]],decls:5,vars:6,consts:[["aiModelItemTpl",""],["title","AI models","emptyMessage","No AI models configured yet. Add one above.","cardMinWidth","400px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"model","namespaceId","readOnly"],[3,"deleteRequested","editRequested","model","namespaceId","readOnly"]],template:function(i,o){if(i&1&&(d(0,"ds-entity-list",1),x(1,"async"),l("createRequested",function(){return o.openCreateForm()}),d(2,"ds-icon-button",2),l("action",function(){return o.goBack()}),_()(),I(3,U,1,1,"ng-template",null,0,T)),i&2){let a=N(4);c("items",B(1,3,o.modelItems$)??w(5,V))("showCreate",!0)("itemTemplate",a)}},dependencies:[S,k,D,L],encapsulation:2,changeDetection:0})};export{F as NamespaceAiModelsComponent};
@@ -0,0 +1 @@
1
+ import{b as a}from"./chunk-3NOI65IY.js";import"./chunk-5K5EFCNT.js";import"./chunk-G2BRVRGR.js";import"./chunk-7MQRVE7E.js";import"./chunk-BGEXT3EN.js";import"./chunk-PKBNMAQJ.js";import"./chunk-OBV4LQBZ.js";import"./chunk-IRZNRZ5Q.js";import"./chunk-FAM7HWYV.js";import"./chunk-WLSXA23B.js";import"./chunk-E3XC4CVU.js";import"./chunk-5J7BTB5J.js";export{a as UserListComponent};
@@ -1 +1 @@
1
- import{a as g}from"./chunk-H7A4LOFH.js";import{Ka as i,Tb as p,Ub as h,Wa as l,ca as s,vb as c,wb as u}from"./chunk-RYEX2DR7.js";var m="coday_oauth_callback",d=class r{route=s(g);message="Authentication in progress...";ngOnInit(){console.log("[OAuth Callback] Component initialized");let t=this.route.snapshot.queryParamMap.get("code"),e=this.route.snapshot.queryParamMap.get("state"),o=this.route.snapshot.queryParamMap.get("error"),a=this.route.snapshot.queryParamMap.get("error_description");if(console.log("[OAuth Callback] Code:",t,"State:",e,"Error:",o,"Opener:",!!window.opener),o){if(console.log("[OAuth Callback] OAuth error received:",o,a),!window.opener){console.warn("[OAuth Callback] No window.opener \u2014 using localStorage fallback for error"),localStorage.setItem(m,JSON.stringify({error:o,state:e,errorDescription:a})),this.message="Authentication failed. You can close this window.",setTimeout(()=>window.close(),1e3);return}try{window.opener.postMessage({error:o,state:e,errorDescription:a},window.location.origin),console.log("[OAuth Callback] Error postMessage sent successfully"),setTimeout(()=>{console.log("[OAuth Callback] Closing popup after error"),window.close()},1e3)}catch(n){console.error("[OAuth Callback] Error sending error postMessage:",n),alert("OAuth error: Failed to communicate with parent window")}return}if(!t){console.error("[OAuth Callback] Missing authorization code"),this.message="OAuth callback error: Missing authorization code.";return}if(!window.opener){console.warn("[OAuth Callback] No window.opener \u2014 using localStorage fallback"),localStorage.setItem(m,JSON.stringify({code:t,state:e})),this.message="Authentication complete. You can close this window.",setTimeout(()=>window.close(),1e3);return}try{console.log("[OAuth Callback] Sending postMessage to parent"),window.opener.postMessage({code:t,state:e},window.location.origin),console.log("[OAuth Callback] postMessage sent successfully"),setTimeout(()=>{console.log("[OAuth Callback] Closing popup"),window.close()},1e3)}catch(n){console.error("[OAuth Callback] Error sending postMessage:",n),alert("OAuth callback error: Failed to communicate with parent window")}}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=l({type:r,selectors:[["app-oauth-callback"]],decls:2,vars:1,template:function(e,o){e&1&&(c(0,"p"),p(1),u()),e&2&&(i(),h(o.message))},encapsulation:2})};export{m as a,d as b};
1
+ import{a as g}from"./chunk-7MQRVE7E.js";import{Ka as i,Tb as p,Ub as h,Wa as l,ca as s,vb as c,wb as u}from"./chunk-5J7BTB5J.js";var m="coday_oauth_callback",d=class r{route=s(g);message="Authentication in progress...";ngOnInit(){console.log("[OAuth Callback] Component initialized");let t=this.route.snapshot.queryParamMap.get("code"),e=this.route.snapshot.queryParamMap.get("state"),o=this.route.snapshot.queryParamMap.get("error"),a=this.route.snapshot.queryParamMap.get("error_description");if(console.log("[OAuth Callback] Code:",t,"State:",e,"Error:",o,"Opener:",!!window.opener),o){if(console.log("[OAuth Callback] OAuth error received:",o,a),!window.opener){console.warn("[OAuth Callback] No window.opener \u2014 using localStorage fallback for error"),localStorage.setItem(m,JSON.stringify({error:o,state:e,errorDescription:a})),this.message="Authentication failed. You can close this window.",setTimeout(()=>window.close(),1e3);return}try{window.opener.postMessage({error:o,state:e,errorDescription:a},window.location.origin),console.log("[OAuth Callback] Error postMessage sent successfully"),setTimeout(()=>{console.log("[OAuth Callback] Closing popup after error"),window.close()},1e3)}catch(n){console.error("[OAuth Callback] Error sending error postMessage:",n),alert("OAuth error: Failed to communicate with parent window")}return}if(!t){console.error("[OAuth Callback] Missing authorization code"),this.message="OAuth callback error: Missing authorization code.";return}if(!window.opener){console.warn("[OAuth Callback] No window.opener \u2014 using localStorage fallback"),localStorage.setItem(m,JSON.stringify({code:t,state:e})),this.message="Authentication complete. You can close this window.",setTimeout(()=>window.close(),1e3);return}try{console.log("[OAuth Callback] Sending postMessage to parent"),window.opener.postMessage({code:t,state:e},window.location.origin),console.log("[OAuth Callback] postMessage sent successfully"),setTimeout(()=>{console.log("[OAuth Callback] Closing popup"),window.close()},1e3)}catch(n){console.error("[OAuth Callback] Error sending postMessage:",n),alert("OAuth callback error: Failed to communicate with parent window")}}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=l({type:r,selectors:[["app-oauth-callback"]],decls:2,vars:1,template:function(e,o){e&1&&(c(0,"p"),p(1),u()),e&2&&(i(),h(o.message))},encapsulation:2})};export{m as a,d as b};