@whoz-oss/coday-client 3.16.0 → 3.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/browser/{chunk-CjrWXBiR.js → chunk-0njD_aMa.js} +1 -1
  2. package/browser/{chunk-Dtu-PLbq.js → chunk-6WIaUDav.js} +1 -1
  3. package/browser/{chunk-CgqDTJ5-.js → chunk-B1OTuTxt.js} +1 -1
  4. package/browser/{chunk-Be1LOFvg.js → chunk-B3-4EW3s.js} +1 -1
  5. package/browser/{chunk-B0vRsgnD.js → chunk-B626-rya.js} +1 -1
  6. package/browser/{chunk-BHZY3TvC.js → chunk-B6BZBDSv.js} +1 -1
  7. package/browser/{chunk-jv0lz5Ah.js → chunk-B7kKWG4P.js} +1 -1
  8. package/browser/chunk-B7yga-a4.js +1 -0
  9. package/browser/{chunk-rwEyLSEP.js → chunk-BAWubWk8.js} +1 -1
  10. package/browser/chunk-BDaTUrH4.js +1 -0
  11. package/browser/{chunk-UzUd84Qf.js → chunk-BHvLB-pV.js} +1 -1
  12. package/browser/{chunk-Ci1jk71f.js → chunk-BJ5G7Y-a.js} +1 -1
  13. package/browser/{chunk-7jUQT_3F.js → chunk-BPfJALqU.js} +1 -1
  14. package/browser/{chunk-CFZbDe5T.js → chunk-BTX631I3.js} +1 -1
  15. package/browser/{chunk-CBNhmZDS.js → chunk-BVAD9f9s.js} +1 -1
  16. package/browser/{chunk-Dcftf7UY.js → chunk-BXkvjekT.js} +1 -1
  17. package/browser/{chunk-tTmeIHGS.js → chunk-BYyTBqh4.js} +1 -1
  18. package/browser/{chunk-CPBcDx4G.js → chunk-B_49KV6W.js} +1 -1
  19. package/browser/{chunk-CtkiOUdU.js → chunk-BaO2vi_O.js} +1 -1
  20. package/browser/{chunk-DDnWPYAA.js → chunk-BcT0wYqu.js} +1 -1
  21. package/browser/{chunk-YS-vAhPY.js → chunk-BdJzYh5V.js} +1 -1
  22. package/browser/{chunk-BTS5TBK0.js → chunk-Bgd8Jkga.js} +1 -1
  23. package/browser/chunk-BkN5jb4J.js +1 -0
  24. package/browser/{chunk-0OiZWE88.js → chunk-Brx_KbnM.js} +1 -1
  25. package/browser/{chunk-Bib1Seeu.js → chunk-BtEXE3Xz.js} +1 -1
  26. package/browser/{chunk-6gdeYlLc.js → chunk-Bu5Xq3QT.js} +1 -1
  27. package/browser/{chunk-C-aF2_1R.js → chunk-BwDJA6_r.js} +1 -1
  28. package/browser/{chunk-CGMAzvSo.js → chunk-C2VdQfMJ.js} +1 -1
  29. package/browser/{chunk-Dfujxxcr.js → chunk-C49BBPGm.js} +1 -1
  30. package/browser/{chunk-HjD5Rk4C.js → chunk-C5WD0UQE.js} +1 -1
  31. package/browser/{chunk-DzlrRiVM.js → chunk-CI760KmO.js} +1 -1
  32. package/browser/{chunk-Co81dkbz.js → chunk-CI7wYBKk.js} +1 -1
  33. package/browser/{chunk-BdpJ2ZCM.js → chunk-CKhGzoqa.js} +1 -1
  34. package/browser/{chunk-izARvh_2.js → chunk-CNAj5Eon.js} +1 -1
  35. package/browser/{chunk-BNS6Fgaw.js → chunk-CUz5MHdA.js} +1 -1
  36. package/browser/{chunk-axGY7UtD.js → chunk-CXTwGKdl.js} +1 -1
  37. package/browser/{chunk-SbH2L3h2.js → chunk-Ci9l-k84.js} +1 -1
  38. package/browser/{chunk-CbK5Lcu9.js → chunk-ClEmA_ih.js} +1 -1
  39. package/browser/{chunk-kvCfAm7Z.js → chunk-ClSDInQq.js} +1 -1
  40. package/browser/{chunk-BSSDDOqW.js → chunk-CpZK7G-Q.js} +1 -1
  41. package/browser/{chunk-CYulIMKp.js → chunk-CxUcyBb9.js} +1 -1
  42. package/browser/{chunk-BJYyjaQ6.js → chunk-D-jBfPIO.js} +1 -1
  43. package/browser/{chunk-CXLytVC3.js → chunk-D202v_ff.js} +1 -1
  44. package/browser/{chunk-BUJoEGsf.js → chunk-DCwEaE_b.js} +1 -1
  45. package/browser/{chunk-CtWMrBfw.js → chunk-DFQuWS_F.js} +1 -1
  46. package/browser/{chunk-pH1k_bet.js → chunk-DHb3-uKf.js} +1 -1
  47. package/browser/{chunk-IUvEtpfr.js → chunk-DKllQ3Ve.js} +1 -1
  48. package/browser/{chunk-DgrvmqY2.js → chunk-DMRb150M.js} +1 -1
  49. package/browser/{chunk-B_9LxHBv.js → chunk-DMtXGu5h.js} +1 -1
  50. package/browser/{chunk-swj7IkJA.js → chunk-DO3lSvop.js} +1 -1
  51. package/browser/{chunk-CTuHnJP4.js → chunk-DQtoh8wv.js} +1 -1
  52. package/browser/{chunk-S8F5_Te_.js → chunk-DjMtxVWg.js} +1 -1
  53. package/browser/{chunk-Bn3R3VC2.js → chunk-DjoW6kqa.js} +1 -1
  54. package/browser/{chunk-fhFxOLYS.js → chunk-DpHEu7EG.js} +1 -1
  55. package/browser/{chunk-Bhq5earA.js → chunk-DqC8XT4v.js} +1 -1
  56. package/browser/{chunk-gmPqDrDS.js → chunk-DqioJb1X.js} +1 -1
  57. package/browser/{chunk-fYErSEXN.js → chunk-DrzvCb86.js} +1 -1
  58. package/browser/{chunk-CwaAd8kk.js → chunk-DwFGK2iu.js} +1 -1
  59. package/browser/{chunk-iNIQR015.js → chunk-DxrynR3o.js} +1 -1
  60. package/browser/{chunk-BJeLQooO.js → chunk-DxvmpOv5.js} +1 -1
  61. package/browser/{chunk-C_s4Z3Dk.js → chunk-EBW8PloQ.js} +1 -1
  62. package/browser/{chunk-DOq0u21j.js → chunk-LVItL87L.js} +1 -1
  63. package/browser/{chunk-BEKR4Un_.js → chunk-P8B5rz7L.js} +1 -1
  64. package/browser/{chunk-BY7uKZAo.js → chunk-R-GmZrHu.js} +3 -3
  65. package/browser/{chunk-CiWu4t_i.js → chunk-b6g-uBR5.js} +1 -1
  66. package/browser/{chunk-YfG457Nc.js → chunk-bfpuueWC.js} +1 -1
  67. package/browser/{chunk-DQLU3kYb.js → chunk-mrKeqPKc.js} +1 -1
  68. package/browser/index.html +1 -1
  69. package/browser/{main-5PAOSHSM.js → main-LBRSRTYI.js} +14 -14
  70. package/package.json +1 -1
  71. package/browser/chunk-BEUXx3TO.js +0 -1
  72. package/browser/chunk-BdApeECy.js +0 -1
  73. package/browser/chunk-DoKoAMs6.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whoz-oss/coday-client",
3
- "version": "3.16.0",
3
+ "version": "3.17.0",
4
4
  "repository": "https://github.com/whoz-oss/coday",
5
5
  "type": "module",
6
6
  "dependencies": {
@@ -1 +0,0 @@
1
- import {bS as Da,a7 as va,X as br,cE as Od}from'./main-5PAOSHSM.js';function i(t,o,p){return t.pipe(Da(()=>o().pipe(va(()=>br(p)))),Od({bufferSize:1,refCount:true}))}export{i};
@@ -1 +0,0 @@
1
- import {d}from'./chunk-BY7uKZAo.js';import {g,ao as V,G as G$1,w as we,d8 as B$1,a as Gi,c as U$1,h as Fw,s as si,m as ws,o as Rg,Q as QC,n as hl,q as oC,t as nI,v as bg,x as iC,a8 as Yg,A as Ug,a5 as Dl,a9 as gC,ac as EC,T as Tg,r as cC,y as uC,S as Sg,bf as dT,bg as pT,aa as wf,ab as Cf,bj as dE}from'./main-5PAOSHSM.js';import'./chunk-kvCfAm7Z.js';import'./chunk-CtkiOUdU.js';import'./chunk-S8F5_Te_.js';import'./chunk-tTmeIHGS.js';var F=(n,o)=>o.name;function B(n,o){n&1&&(ws(0,"p",6),QC(1,"Loading\u2026"),hl());}function $(n,o){n&1&&(ws(0,"p",7),QC(1,"Failed to load agent definition."),hl());}function j(n,o){if(n&1&&(ws(0,"dt",12),QC(1,"User context"),hl(),ws(2,"dd",14),QC(3),hl()),n&2){let e=EC();nI(3),Yg(e.userId);}}function H(n,o){if(n&1&&(ws(0,"pre",21),QC(1),hl()),n&2){let e=EC(2);nI(),Yg(e.systemPrompt);}}function J(n,o){if(n&1){let e=gC();ws(0,"section",9)(1,"button",19),Rg("click",function(){wf(e);let g=EC(2);return Cf(g.toggleSystemPrompt())}),ws(2,"h2",10),QC(3,"System Prompt"),hl(),ws(4,"span",20),QC(5," \u25BC "),hl()(),oC(6,H,2,1,"pre",21),hl();}if(n&2){let e=EC(2);nI(),Tg("aria-expanded",!e.systemPromptCollapsed()),nI(3),Ug("agent-config-inspect__chevron--open",!e.systemPromptCollapsed()),nI(2),iC(e.systemPromptCollapsed()?-1:6);}}function U(n,o){if(n&1&&(ws(0,"pre",21),QC(1),hl()),n&2){let e=EC(2);nI(),Yg(e.instructions);}}function G(n,o){if(n&1){let e=gC();ws(0,"section",9)(1,"button",19),Rg("click",function(){wf(e);let g=EC(2);return Cf(g.toggleInstructions())}),ws(2,"h2",10),QC(3,"Instructions"),hl(),ws(4,"span",20),QC(5," \u25BC "),hl()(),oC(6,U,2,1,"pre",21),hl();}if(n&2){let e=EC(2);nI(),Tg("aria-expanded",!e.instructionsCollapsed()),nI(3),Ug("agent-config-inspect__chevron--open",!e.instructionsCollapsed()),nI(2),iC(e.instructionsCollapsed()?-1:6);}}function q(n,o){n&1&&(ws(0,"p",17),QC(1,"No tools available for this agent."),hl());}function K(n,o){if(n&1&&(Sg(0,"div",26),dT(1,"agentosMarkdown")),n&2){let e=EC(2).$implicit;bg("innerHTML",pT(1,1,e.description),dE);}}function Q(n,o){if(n&1&&(ws(0,"div",25),oC(1,K,2,3,"div",26),ws(2,"pre",27),QC(3),hl()()),n&2){let e=EC().$implicit,c=EC(3);nI(),iC(e.description?1:-1),nI(2),Yg(c.formatSchema(e.inputSchema));}}function W(n,o){if(n&1){let e=gC();ws(0,"li",22)(1,"button",23),Rg("click",function(){let g=wf(e).$implicit,V=EC(3);return Cf(V.toggleTool(g))}),ws(2,"span",24),QC(3),hl(),ws(4,"span",20),QC(5," \u25BC "),hl()(),oC(6,Q,4,2,"div",25),hl();}if(n&2){let e=o.$implicit,c=EC(3);nI(),Tg("aria-expanded",c.isToolExpanded(e)),nI(2),Yg(e.name),nI(),Ug("agent-config-inspect__chevron--open",c.isToolExpanded(e)),nI(2),iC(c.isToolExpanded(e)?6:-1);}}function X(n,o){if(n&1&&(ws(0,"ul",18),cC(1,W,7,5,"li",22,F),hl()),n&2){let e=EC();nI(),uC(e.tools);}}function Y(n,o){if(n&1&&(ws(0,"div",8)(1,"section",9)(2,"h2",10),QC(3,"General"),hl(),ws(4,"dl",11)(5,"dt",12),QC(6,"Name"),hl(),ws(7,"dd",13),QC(8),hl(),ws(9,"dt",12),QC(10,"Resolved model"),hl(),ws(11,"dd",14),QC(12),hl(),ws(13,"dt",12),QC(14,"Provider"),hl(),ws(15,"dd",13),QC(16),hl(),ws(17,"dt",12),QC(18,"Advanced execution"),hl(),ws(19,"dd",13)(20,"span",15),QC(21),hl()(),oC(22,j,4,1),hl()(),oC(23,J,7,4,"section",9),oC(24,G,7,4,"section",9),ws(25,"section",9)(26,"h2",10),QC(27," Tools "),ws(28,"span",16),QC(29),hl()(),oC(30,q,2,0,"p",17)(31,X,3,0,"ul",18),hl()()),n&2){let e=o;nI(8),Yg(e.name),nI(4),Yg(e.resolvedModelApiName),nI(4),Yg(e.resolvedProviderName),nI(4),Ug("agent-config-inspect__badge--active",e.advancedExecution),nI(),Dl(" ",e.advancedExecution?"Enabled":"Disabled"," "),nI(),iC(e.userId?22:-1),nI(),iC(e.systemPrompt?23:-1),nI(),iC(e.instructions?24:-1),nI(5),Dl("(",e.tools.length,")"),nI(),iC(e.tools.length===0?30:31);}}var R=class n{route=g(V);router=g(G$1);destroyRef=g(we);agentConfigController=g(B$1);namespaceId=this.route.snapshot.params.namespaceId;agentConfigId=this.route.snapshot.params.agentConfigId;isPlatformMode=!this.namespaceId;isLoading=Gi(true);hasError=Gi(false);definition=Gi(null);expandedTools=Gi(new Set);systemPromptCollapsed=Gi(true);instructionsCollapsed=Gi(true);ngOnInit(){this.agentConfigController.getDefinitionAgentConfig(this.agentConfigId).pipe(U$1(this.destroyRef)).subscribe({next:o=>{this.definition.set(o),this.isLoading.set(false);},error:()=>{this.hasError.set(true),this.isLoading.set(false);}});}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=Fw({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&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return c.back()}),ws(3,"span",3),QC(4,"\u2190"),hl(),QC(5," Agent Configs "),hl(),ws(6,"h1",4),QC(7,"Agent definition"),hl(),ws(8,"a",5),QC(9,"Edit config \u2192"),hl()(),oC(10,B,2,0,"p",6)(11,$,2,0,"p",7)(12,Y,32,11,"div",8),hl()),e&2){let g;nI(8),bg("routerLink",c.editRoute()),nI(2),iC(c.isLoading()?10:c.hasError()?11:(g=c.definition())?12:-1,g);}},dependencies:[si,d],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}"]})};export{R as AgentConfigInspectComponent};
@@ -1 +0,0 @@
1
- import {c}from'./chunk-CbK5Lcu9.js';import {g,ao as V,G,w as we$1,d8 as B,d9 as He,da as Ce$1,a as Gi,db as xe$1,F,bR as Sd,E as ET,W as Vy,c as U,a7 as va,X as br,z as z$1,b as P,h as Fw,m as ws,o as Rg,Q as QC,n as hl,q as oC,t as nI,a5 as Dl,x as iC,a9 as gC,S as Sg,a3 as GI,r as cC,ac as EC,v as bg,A as Ug,a6 as qI,y as uC,a8 as Yg,aa as wf,ab as Cf,bk as vh}from'./main-5PAOSHSM.js';import {o as z,k as _t,b as _e$1,n as ni,J as Jn,Q as Qn,e as ei,Y as Ye,f as fn,a as wt,A as At,Z as Zn,l as Xn,$ as $t,C as Cn,E as En}from'./chunk-tTmeIHGS.js';var A=(n,t)=>t.value,se=(n,t)=>t.id;function pe(n,t){n&1&&(ws(0,"p",5),QC(1,"Loading\u2026"),hl());}function ue(n,t){n&1&&(ws(0,"span",12),QC(1," Name is required. "),hl());}function fe(n,t){if(n&1&&(ws(0,"p",40),QC(1),hl(),ws(2,"span",13),QC(3,"Agent Config cannot be changed after creation."),hl()),n&2){let e=EC(2);nI(),Yg(e.resolveAgentConfigName(e.agentConfigIdControl.value));}}function _e(n,t){if(n&1&&(ws(0,"a",41),QC(1,"Add an agent config"),hl(),QC(2," first. ")),n&2){let e=EC(3);bg("href","/agentos/"+e.namespaceId+"/agent-configs/new",vh);}}function he(n,t){if(n&1&&(ws(0,"p",13),QC(1," No agent configs available in this scope yet. "),oC(2,_e,3,1),hl()),n&2){let e=EC(2);nI(2),iC(e.isPlatformMode?-1:2);}}function ge(n,t){if(n&1&&(ws(0,"option",23),QC(1),hl()),n&2){let e=t.$implicit;bg("value",e.id),nI(),Yg(e.name);}}function Ce(n,t){n&1&&(ws(0,"span",12),QC(1,"Agent Config is required."),hl());}function ve(n,t){if(n&1&&(ws(0,"select",42)(1,"option",43),QC(2,"Select an agent config\u2026"),hl(),cC(3,ge,2,2,"option",23,se),hl(),GI(),oC(5,Ce,2,0,"span",12),ws(6,"span",13),QC(7,"Immutable after creation."),hl()),n&2){let e=EC(2);bg("formControl",e.agentConfigIdControl),qI(),nI(3),uC(e.availableAgentConfigs()),nI(2),iC(e.agentConfigIdControl.invalid&&e.agentConfigIdControl.touched?5:-1);}}function ye(n,t){n&1&&(ws(0,"span",12),QC(1,"Opening message is required."),hl());}function be(n,t){if(n&1&&(ws(0,"option",23),QC(1),hl()),n&2){let e=t.$implicit;bg("value",e.value),nI(),Yg(e.label);}}function xe(n,t){if(n&1){let e=gC();ws(0,"label",46)(1,"input",47),Rg("change",function(){let h=wf(e).$implicit,P=EC(3);return Cf(P.toggleDay(h.value))}),hl(),ws(2,"span",48),QC(3),hl()();}if(n&2){let e=t.$implicit,l=EC(3);nI(),bg("checked",l.isDaySelected(e.value)),nI(2),Yg(e.label);}}function Se(n,t){if(n&1&&(ws(0,"div",8)(1,"span",44),QC(2,"Days of week"),hl(),ws(3,"div",45),cC(4,xe,4,2,"label",46,A),hl(),ws(6,"span",13),QC(7,"Leave empty to run every day of the week."),hl()()),n&2){let e=EC(2);nI(4),uC(e.dayOptions);}}function Pe(n,t){n&1&&(ws(0,"span",12),QC(1,"Valid time is required (HH:mm)."),hl());}function Ee(n,t){n&1&&(ws(0,"span",12),QC(1,"Start date is required."),hl());}function Me(n,t){if(n&1&&(ws(0,"option",23),QC(1),hl()),n&2){let e=t.$implicit;bg("value",e.value),nI(),Yg(e.label);}}function Oe(n,t){n&1&&(ws(0,"span",12),QC(1,"End date is required."),hl());}function De(n,t){if(n&1&&(ws(0,"div",8)(1,"label",49),QC(2," End date "),ws(3,"span",10),QC(4,"*"),hl()(),Sg(5,"input",50),GI(),oC(6,Oe,2,0,"span",12),hl()),n&2){let e=EC(2);nI(5),Ug("scheduled-prompt-form__input--invalid",e.form.hasError("endDateRequired")&&e.endDateControl.touched),bg("formControl",e.endDateControl),qI(),nI(),iC(e.form.hasError("endDateRequired")&&e.endDateControl.touched?6:-1);}}function Te(n,t){n&1&&(ws(0,"span",12),QC(1,"Must be at least 1."),hl());}function we(n,t){if(n&1&&(ws(0,"div",8)(1,"label",51),QC(2," Number of occurrences "),ws(3,"span",10),QC(4,"*"),hl()(),Sg(5,"input",52),GI(),oC(6,Te,2,0,"span",12),hl()),n&2){let e=EC(2);nI(5),Ug("scheduled-prompt-form__input--invalid",e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched),bg("formControl",e.occurrenceCountControl),qI(),nI(),iC(e.form.hasError("occurrenceCountRequired")&&e.occurrenceCountControl.touched?6:-1);}}function ke(n,t){if(n&1&&(ws(0,"p",36),QC(1),hl()),n&2){let e=EC(2);nI(),Yg(e.errorMessage());}}function Fe(n,t){if(n&1){let e=gC();ws(0,"form",7),Rg("ngSubmit",function(){wf(e);let h=EC();return Cf(h.submit())}),ws(1,"div",8)(2,"label",9),QC(3," Name "),ws(4,"span",10),QC(5,"*"),hl()(),Sg(6,"input",11),GI(),oC(7,ue,2,0,"span",12),ws(8,"span",13),QC(9,'Free-form name (e.g. "Weekly Report"). Cannot be changed after creation.'),hl()(),ws(10,"div",8)(11,"label",14),QC(12,"Description"),hl(),Sg(13,"input",15),GI(),hl(),ws(14,"div",8)(15,"label",16),QC(16," Agent Config "),ws(17,"span",10),QC(18,"*"),hl()(),oC(19,fe,4,1)(20,he,3,1,"p",13)(21,ve,8,2),hl(),ws(22,"div",8)(23,"label",17),QC(24," Opening message "),ws(25,"span",10),QC(26,"*"),hl()(),Sg(27,"textarea",18),GI(),oC(28,ye,2,0,"span",12),ws(29,"span",13),QC(30," The message sent to the agent when the scheduled prompt fires. "),hl()(),ws(31,"fieldset",19)(32,"legend",20),QC(33,"Recurrence"),hl(),ws(34,"div",8)(35,"label",21),QC(36," Unit "),ws(37,"span",10),QC(38,"*"),hl()(),ws(39,"select",22),cC(40,be,2,2,"option",23,A),hl(),GI(),hl(),oC(42,Se,8,0,"div",8),ws(43,"div",8)(44,"label",24),QC(45," Time (UTC) "),ws(46,"span",10),QC(47,"*"),hl()(),ws(48,"div",25),Sg(49,"input",26),GI(),ws(50,"span",27),QC(51,"UTC"),hl()(),oC(52,Pe,2,0,"span",12),hl()(),ws(53,"fieldset",19)(54,"legend",20),QC(55,"Planning"),hl(),ws(56,"div",8)(57,"label",28),QC(58," Start date "),ws(59,"span",10),QC(60,"*"),hl()(),Sg(61,"input",29),GI(),oC(62,Ee,2,0,"span",12),hl(),ws(63,"div",8)(64,"label",30),QC(65," Ends "),ws(66,"span",10),QC(67,"*"),hl()(),ws(68,"select",31),cC(69,Me,2,2,"option",23,A),hl(),GI(),hl(),oC(71,De,7,4,"div",8),oC(72,we,7,4,"div",8),hl(),ws(73,"div",8)(74,"label",32),Sg(75,"input",33),GI(),ws(76,"span",34),QC(77,"Enabled"),hl()(),ws(78,"p",35),QC(79," When disabled, the scheduled prompt is saved but will not run on schedule. "),hl()(),oC(80,ke,2,1,"p",36),ws(81,"div",37)(82,"button",38),QC(83),hl(),ws(84,"button",39),Rg("click",function(){wf(e);let h=EC();return Cf(h.cancel())}),QC(85,"Cancel"),hl()()();}if(n&2){let e=EC();bg("formGroup",e.form),nI(6),Ug("scheduled-prompt-form__input--invalid",e.nameControl.invalid&&e.nameControl.touched),bg("formControl",e.nameControl),qI(),nI(),iC(e.nameControl.invalid&&e.nameControl.touched?7:-1),nI(6),bg("formControl",e.descriptionControl),qI(),nI(6),iC(e.isEditMode()?19:e.availableAgentConfigs().length===0?20:21),nI(8),Ug("scheduled-prompt-form__textarea--invalid",e.promptContentControl.invalid&&e.promptContentControl.touched),bg("formControl",e.promptContentControl),qI(),nI(),iC(e.promptContentControl.invalid&&e.promptContentControl.touched?28:-1),nI(11),bg("formControl",e.unitControl),qI(),nI(),uC(e.schedulerUnits),nI(2),iC(e.showDayFilter()?42:-1),nI(7),bg("formControl",e.timeUtcControl),qI(),nI(3),iC(e.timeUtcControl.invalid&&e.timeUtcControl.touched?52:-1),nI(9),Ug("scheduled-prompt-form__input--invalid",e.startDateControl.invalid&&e.startDateControl.touched),bg("formControl",e.startDateControl),qI(),nI(),iC(e.startDateControl.invalid&&e.startDateControl.touched?62:-1),nI(6),bg("formControl",e.endTypeControl),qI(),nI(),uC(e.endTypes),nI(2),iC(e.showEndDate()?71:-1),nI(),iC(e.showOccurrenceCount()?72:-1),nI(3),bg("formControl",e.enabledControl),qI(),nI(5),iC(e.errorMessage()?80:-1),nI(2),bg("disabled",e.form.invalid||e.isSubmitting()),nI(),Dl(" ",e.isEditMode()?"Save changes":"Create scheduled prompt"," ");}}var me=class n{route=g(V);router=g(G);destroyRef=g(we$1);state=g(c);agentConfigController=g(B);namespaceId=this.route.snapshot.params.namespaceId;isPlatformMode=!this.namespaceId;form=new z({name:new _t("",{nonNullable:true,validators:[_e$1.required]}),description:new _t(null),agentConfigId:new _t("",{nonNullable:true,validators:[_e$1.required]}),promptContent:new _t("",{nonNullable:true,validators:[_e$1.required]}),unit:new _t(Ce$1.WEEK,{nonNullable:true,validators:[_e$1.required]}),days:new _t([],{nonNullable:true}),timeUtc:new _t("09:00",{nonNullable:true,validators:[_e$1.required,_e$1.pattern(/^([01]\d|2[0-3]):[0-5]\d$/)]}),startDate:new _t("",{nonNullable:true,validators:[_e$1.required]}),endType:new _t(He.NEVER,{nonNullable:true,validators:[_e$1.required]}),endDate:new _t(null),occurrenceCount:new _t(null),enabled:new _t(true,{nonNullable:true})},{validators:[Ne,Ie]});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get agentConfigIdControl(){return this.form.controls.agentConfigId}get promptContentControl(){return this.form.controls.promptContent}get unitControl(){return this.form.controls.unit}get daysControl(){return this.form.controls.days}get timeUtcControl(){return this.form.controls.timeUtc}get startDateControl(){return this.form.controls.startDate}get endTypeControl(){return this.form.controls.endType}get endDateControl(){return this.form.controls.endDate}get occurrenceCountControl(){return this.form.controls.occurrenceCount}get enabledControl(){return this.form.controls.enabled}isEditMode=Gi(false);isSubmitting=Gi(false);isLoading=Gi(false);errorMessage=Gi(null);SchedulerUnit=Ce$1;SchedulerEndType=He;schedulerUnits=[{value:Ce$1.WEEK,label:"Week(s)"},{value:Ce$1.MONTH,label:"Month(s)"}];endTypes=[{value:He.NEVER,label:"Never"},{value:He.ON_DATE,label:"On date"},{value:He.OCCURRENCES,label:"After N occurrences"}];dayOptions=Object.entries(xe$1).map(([t,e])=>({value:t,label:e}));unitSignal=F(this.unitControl.valueChanges.pipe(Sd(this.unitControl.value)));endTypeSignal=F(this.endTypeControl.valueChanges.pipe(Sd(this.endTypeControl.value)));showDayFilter=ET(()=>this.unitSignal()===Ce$1.WEEK);showEndDate=ET(()=>this.endTypeSignal()===He.ON_DATE);showOccurrenceCount=ET(()=>this.endTypeSignal()===He.OCCURRENCES);agentConfigs=Gi([]);availableAgentConfigs=this.agentConfigs.asReadonly();existingPrompt=null;ngOnInit(){this.startDateControl.setValue(Ve());let t=this.route.snapshot.paramMap.get("scheduledPromptId");t?(this.isEditMode.set(true),this.loadPromptAndResources(t)):this.loadResources();}loadPromptAndResources(t){this.isLoading.set(true),Vy({prompt:this.state.getById(t),agentConfigs:this.agentConfigs$()}).pipe(U(this.destroyRef)).subscribe({next:({prompt:e,agentConfigs:l})=>{this.existingPrompt=e,this.agentConfigs.set(l),this.hydrateForm(e),this.isLoading.set(false);},error:()=>{this.isLoading.set(false),this.navigateBack();}});}loadResources(){this.agentConfigs$().pipe(U(this.destroyRef)).subscribe(t=>this.agentConfigs.set(t));}agentConfigs$(){return (this.isPlatformMode?this.agentConfigController.listPlatformAgentsAgentConfig():this.agentConfigController.listByParentAgentConfig(this.namespaceId)).pipe(va(()=>br([])))}hydrateForm(t){this.nameControl.setValue(t.name),this.descriptionControl.setValue(t.description??null),this.agentConfigIdControl.setValue(t.agentConfigId),this.promptContentControl.setValue(t.promptContent),this.unitControl.setValue(t.recurrence.unit),this.daysControl.setValue(t.recurrence.days??[]),this.timeUtcControl.setValue(t.recurrence.timeUtc),this.startDateControl.setValue(t.planning.startDate),this.endTypeControl.setValue(t.planning.endType),this.endDateControl.setValue(t.planning.endDate??null),this.occurrenceCountControl.setValue(t.planning.maxOccurrenceCount??null),this.enabledControl.setValue(t.enabled);}isDaySelected(t){return this.daysControl.value.includes(t)}toggleDay(t){let e=this.daysControl.value,l=e.includes(t)?e.filter(h=>h!==t):[...e,t];this.daysControl.setValue(l);}resolveAgentConfigName(t){return this.agentConfigs().find(e=>e.id===t)?.name??t}submit(){if(this.form.invalid||this.isSubmitting())return;this.isSubmitting.set(true),this.errorMessage.set(null);let t=this.isEditMode()&&!!this.existingPrompt?.id,e=this.endTypeControl.value,l=z$1(P({},this.existingPrompt??{}),{namespaceId:this.namespaceId??null,name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,agentConfigId:t?this.existingPrompt.agentConfigId:this.agentConfigIdControl.value,promptContent:this.promptContentControl.value.trim(),recurrence:{unit:this.unitControl.value,days:this.daysControl.value,timeUtc:this.timeUtcControl.value},planning:{startDate:this.startDateControl.value,endType:e,endDate:e===He.ON_DATE?this.endDateControl.value??void 0:void 0,maxOccurrenceCount:e===He.OCCURRENCES?this.occurrenceCountControl.value??void 0:void 0},enabled:this.enabledControl.value});(t?this.state.update(this.existingPrompt.id,l):this.state.create(l)).pipe(U(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:P=>{this.isSubmitting.set(false),P.status===409?this.errorMessage.set(`A scheduled prompt named "${l.name}" already exists in this scope.`):P.status===400?this.errorMessage.set(P.error?.message??"Invalid scheduled prompt data."):this.errorMessage.set("An unexpected error occurred. Please try again.");}});}cancel(){this.navigateBack();}navigateBack(){this.isPlatformMode?this.router.navigate(["/agentos","admin","scheduled-prompts"]):this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts"]);}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Fw({type:n,selectors:[["agentos-scheduled-prompt-form"]],decls:10,vars:3,consts:[[1,"scheduled-prompt-form"],[1,"scheduled-prompt-form__header"],["type","button","title","Back to scheduled prompts",1,"scheduled-prompt-form__back",3,"click"],[1,"scheduled-prompt-form__back-icon"],[1,"scheduled-prompt-form__title"],[1,"scheduled-prompt-form__loading"],[1,"scheduled-prompt-form__form",3,"formGroup"],[1,"scheduled-prompt-form__form",3,"ngSubmit","formGroup"],[1,"scheduled-prompt-form__field"],["for","sp-name",1,"scheduled-prompt-form__label"],["aria-hidden","true"],["id","sp-name","type","text","placeholder","e.g. Weekly Report","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],[1,"scheduled-prompt-form__field-error"],[1,"scheduled-prompt-form__field-hint"],["for","sp-description",1,"scheduled-prompt-form__label"],["id","sp-description","type","text","placeholder","Optional \u2014 short description","autocomplete","off",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-agent-config",1,"scheduled-prompt-form__label"],["for","sp-prompt-content",1,"scheduled-prompt-form__label"],["id","sp-prompt-content","rows","6","placeholder","Enter the message sent to the agent when the scheduled prompt fires\u2026",1,"scheduled-prompt-form__textarea",3,"formControl"],[1,"scheduled-prompt-form__fieldset"],[1,"scheduled-prompt-form__legend"],["for","sp-unit",1,"scheduled-prompt-form__label"],["id","sp-unit",1,"scheduled-prompt-form__select",3,"formControl"],[3,"value"],["for","sp-time",1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__time-wrapper"],["id","sp-time","type","time",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--time",3,"formControl"],[1,"scheduled-prompt-form__utc-badge"],["for","sp-start-date",1,"scheduled-prompt-form__label"],["id","sp-start-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-end-type",1,"scheduled-prompt-form__label"],["id","sp-end-type",1,"scheduled-prompt-form__select",3,"formControl"],[1,"scheduled-prompt-form__toggle-label"],["type","checkbox",1,"scheduled-prompt-form__toggle-checkbox",3,"formControl"],[1,"scheduled-prompt-form__toggle-text"],[1,"scheduled-prompt-form__toggle-hint"],[1,"scheduled-prompt-form__error"],[1,"scheduled-prompt-form__actions"],["type","submit",1,"scheduled-prompt-form__btn","scheduled-prompt-form__btn--primary",3,"disabled"],["type","button",1,"scheduled-prompt-form__btn",3,"click"],[1,"scheduled-prompt-form__readonly-value"],[3,"href"],["id","sp-agent-config",1,"scheduled-prompt-form__select",3,"formControl"],["value","","disabled",""],[1,"scheduled-prompt-form__label"],[1,"scheduled-prompt-form__day-grid"],[1,"scheduled-prompt-form__day-label"],["type","checkbox",1,"scheduled-prompt-form__day-checkbox",3,"change","checked"],[1,"scheduled-prompt-form__day-text"],["for","sp-end-date",1,"scheduled-prompt-form__label"],["id","sp-end-date","type","date",1,"scheduled-prompt-form__input",3,"formControl"],["for","sp-occurrence-count",1,"scheduled-prompt-form__label"],["id","sp-occurrence-count","type","number","min","1",1,"scheduled-prompt-form__input","scheduled-prompt-form__input--number",3,"formControl"]],template:function(e,l){e&1&&(ws(0,"div",0)(1,"header",1)(2,"button",2),Rg("click",function(){return l.cancel()}),ws(3,"span",3),QC(4,"\u2190"),hl(),QC(5),hl(),ws(6,"h1",4),QC(7),hl()(),oC(8,pe,2,0,"p",5)(9,Fe,86,26,"form",6),hl()),e&2&&(nI(5),Dl(" ",l.isPlatformMode?"Platform Scheduled Prompts":"Scheduled Prompts"," "),nI(2),Dl(" ",l.isEditMode()?"Edit scheduled prompt":"New scheduled prompt"," "),nI(),iC(l.isLoading()?8:9));},dependencies:[ni,Jn,Qn,ei,Ye,fn,wt,At,Zn,Xn,$t,Cn,En],styles:[".scheduled-prompt-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.scheduled-prompt-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.scheduled-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}.scheduled-prompt-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.scheduled-prompt-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.scheduled-prompt-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.scheduled-prompt-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.scheduled-prompt-form__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.scheduled-prompt-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__input[_ngcontent-%COMP%], .scheduled-prompt-form__select[_ngcontent-%COMP%], .scheduled-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}.scheduled-prompt-form__input[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__select[_ngcontent-%COMP%]:focus, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.scheduled-prompt-form__input[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__select[_ngcontent-%COMP%]::placeholder, .scheduled-prompt-form__textarea[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__select[_ngcontent-%COMP%]{cursor:pointer;appearance:auto}.scheduled-prompt-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:100px;line-height:1.5}.scheduled-prompt-form__input--time[_ngcontent-%COMP%]{flex:1;min-width:0}.scheduled-prompt-form__input--number[_ngcontent-%COMP%]{max-width:120px}.scheduled-prompt-form__time-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.scheduled-prompt-form__utc-badge[_ngcontent-%COMP%]{flex-shrink:0;font-size:.75rem;font-weight:600;font-family:monospace;color:var(--color-text-secondary, #6e6e73);background:var(--color-surface, rgba(0, 0, 0, .05));padding:.25rem .5rem;border-radius:4px;text-transform:uppercase;letter-spacing:.06em}.scheduled-prompt-form__fieldset[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:8px;padding:1rem 1.25rem 1.25rem;margin:0;display:flex;flex-direction:column;gap:1.25rem}.scheduled-prompt-form__legend[_ngcontent-%COMP%]{font-size:.8125rem;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--color-text-secondary, #6e6e73);padding:0 .375rem}.scheduled-prompt-form__day-grid[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.5rem}.scheduled-prompt-form__day-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__day-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__day-text[_ngcontent-%COMP%]{font-size:.875rem;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__hint[_ngcontent-%COMP%]{margin:0;font-size:.875rem;color:var(--color-text-secondary, #6e6e73)}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30);margin:0}.scheduled-prompt-form__field-error[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-error, #ff3b30)}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--color-primary, #007aff);text-decoration:none}.scheduled-prompt-form__field-hint[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{text-decoration:underline}.scheduled-prompt-form__readonly-value[_ngcontent-%COMP%]{margin:0;font-size:.9375rem;color:var(--color-text, #1d1d1f);padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--color-surface, rgba(0, 0, 0, .03))}.scheduled-prompt-form__input--invalid[_ngcontent-%COMP%], .scheduled-prompt-form__textarea--invalid[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.scheduled-prompt-form__toggle-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer;-webkit-user-select:none;user-select:none}.scheduled-prompt-form__toggle-checkbox[_ngcontent-%COMP%]{width:1rem;height:1rem;flex-shrink:0;accent-color:var(--color-primary, #007aff);cursor:pointer}.scheduled-prompt-form__toggle-text[_ngcontent-%COMP%]{font-size:.9rem;font-weight:500;color:var(--color-text, #1d1d1f)}.scheduled-prompt-form__toggle-hint[_ngcontent-%COMP%]{margin:.25rem 0 0 1.5rem;font-size:.8rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.scheduled-prompt-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.scheduled-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}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.scheduled-prompt-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.scheduled-prompt-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"]})};function Ne(n){let t=n.get("endType")?.value,e=n.get("endDate")?.value;return t===He.ON_DATE&&!e?{endDateRequired:true}:null}function Ie(n){let t=n.get("endType")?.value,e=n.get("occurrenceCount")?.value;return t===He.OCCURRENCES&&(e==null||e<1)?{occurrenceCountRequired:true}:null}function Ve(){let n=new Date,t=n.getFullYear(),e=String(n.getMonth()+1).padStart(2,"0"),l=String(n.getDate()).padStart(2,"0");return `${t}-${e}-${l}`}export{me as ScheduledPromptFormComponent};