@whoz-oss/coday-client 0.115.2 → 0.116.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/{chunk-6LHAGXIC.js → chunk-23NDPEFI.js} +1 -1
- package/browser/{chunk-X6TFXJKZ.js → chunk-6F5GPHWV.js} +1 -1
- package/browser/{chunk-YRNTZU7L.js → chunk-6PWH64OF.js} +1 -1
- package/browser/chunk-ISPDD5IG.js +2 -0
- package/browser/{chunk-YKARRAPE.js → chunk-JROTC4FL.js} +1 -1
- package/browser/chunk-L72BYLQX.js +1 -0
- package/browser/{chunk-4TOD23CW.js → chunk-QJ5RZT2C.js} +1 -1
- package/browser/chunk-STNEVMCX.js +2 -0
- package/browser/index.html +2 -2
- package/browser/{main-C4MZGYXT.js → main-RAKQ5E3N.js} +37 -37
- package/browser/{styles-TOOGLXPX.css → styles-7E3CGANH.css} +1 -1
- package/package.json +1 -1
- package/browser/chunk-WZJ3UIRS.js +0 -1
- package/browser/chunk-ZP4X376S.js +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as R,b as z,c as we,d as Oe}from"./chunk-X6TFXJKZ.js";import{a as ne,b as oe}from"./chunk-H72Z2LX3.js";import{a as ke,b as Ee,c as Se,d as Fe,e as Te}from"./chunk-AE2AQO4B.js";import{a as ie,b as re,d as ae,e as se,f as ce,g as me,h as le}from"./chunk-OUZFS4TC.js";import{M as be,O as Ce,P as fe,S as Me,T as Pe,U as xe,V as ve,W as ye,z as he}from"./chunk-4NNLWDVJ.js";import{L as D,P as te,R as I,S as L,T as A}from"./chunk-5MXEOOQM.js";import{b as de}from"./chunk-WZJ3UIRS.js";import{A as _e,C as B,b as pe,c as ge,g as W,m as V,p as ue}from"./chunk-AE24ERN3.js";import"./chunk-VVZKXHDD.js";import{Ab as O,Cb as x,Db as v,Ea as F,Eb as y,Hb as J,Ib as Q,Ka as N,Ob as X,Qb as Z,Sa as h,T as g,Ta as b,Ua as q,Wa as H,X as u,Xa as Y,Y as _,Ya as C,Za as n,_a as i,db as G,eb as K,ga as P,gb as f,hc as $,ib as d,kb as l,tc as ee,ua as c,ub as U,wb as T,yb as a,zb as M}from"./chunk-TRUXCA4C.js";function ze(s,o){if(s&1){let e=f();n(0,"div",9)(1,"mat-form-field",18)(2,"mat-label"),a(3),i(),n(4,"textarea",19),y("ngModelChange",function(r){let m=u(e).$index,E=l();return v(E.commands[m],r)||(E.commands[m]=r),_(r)}),i(),n(5,"mat-hint"),a(6,"Use placeholder for dynamic values"),i()(),n(7,"button",20),d("click",function(){let r=u(e).$index,m=l();return _(m.removeCommand(r))}),n(8,"mat-icon"),a(9,"delete"),i()()()}if(s&2){let e=o.$index,t=l();c(3),O("Prompt ",e+1),c(),x("ngModel",t.commands[e]),c(3),C("disabled",t.commands.length===1)}}function Ne(s,o){if(s&1){let e=f();n(0,"div",10)(1,"h3"),a(2,"Save to"),i(),n(3,"div",21)(4,"label",22)(5,"input",23),y("ngModelChange",function(r){u(e);let m=l();return v(m.source,r)||(m.source=r),_(r)}),i(),n(6,"div",24)(7,"div",25)(8,"span",26),a(9,"\u{1F464}"),i(),n(10,"span",27),a(11,"Local"),i()(),n(12,"p",28),a(13,"Personal prompt in ~/.coday/... (not committed)"),i()()(),n(14,"label",22)(15,"input",29),y("ngModelChange",function(r){u(e);let m=l();return v(m.source,r)||(m.source=r),_(r)}),i(),n(16,"div",24)(17,"div",25)(18,"span",26),a(19,"\u{1F4E6}"),i(),n(20,"span",27),a(21,"Project"),i()(),n(22,"p",28),a(23,"Shared prompt in ./prompts/ (committable)"),i()()()(),n(24,"p",30),a(25,"Storage location is permanent and cannot be changed after creation"),i()()}if(s&2){let e=l();c(4),T("selected",e.source==="local"),c(),x("ngModel",e.source),c(9),T("selected",e.source==="project"),c(),x("ngModel",e.source)}}function Ue(s,o){if(s&1&&(n(0,"div",11)(1,"h3"),a(2,"Storage Location"),i(),n(3,"div",31)(4,"span",26),a(5),i(),n(6,"span",27),a(7),i()(),n(8,"p",30),a(9,"Cannot be changed after creation"),i()()),s&2){let e=l();c(3),T("badge-local",e.source==="local")("badge-project",e.source==="project"),c(2),M(e.source==="local"?"\u{1F464}":"\u{1F4E6}"),c(2),M(e.source==="local"?"Local":"Project")}}function je(s,o){if(s&1){let e=f();n(0,"div",12)(1,"label",32)(2,"input",33),y("ngModelChange",function(r){u(e);let m=l();return v(m.webhookEnabled,r)||(m.webhookEnabled=r),_(r)}),i(),n(3,"span"),a(4,"Enable webhook"),i()(),n(5,"p",30),a(6,"Enable webhook to trigger this prompt via HTTP POST"),i()()}if(s&2){let e=l();c(2),x("ngModel",e.webhookEnabled)}}function qe(s,o){if(s&1){let e=f();n(0,"div",13)(1,"div",34)(2,"mat-icon",35),a(3,"link"),i(),n(4,"h4"),a(5,"Webhook URL"),i()(),n(6,"div",36)(7,"p",37),a(8),i(),n(9,"button",38),d("click",function(){u(e);let r=l();return _(r.copyWebhookUrl())}),n(10,"mat-icon"),a(11,"content_copy"),i(),n(12,"span"),a(13,"Copy URL"),i()()(),n(14,"p",30),a(15,"Use this URL to trigger the prompt via HTTP POST"),i()()}if(s&2){let e=l();c(8),M(e.getWebhookUrl())}}function He(s,o){if(s&1&&(n(0,"div",14)(1,"mat-icon"),a(2,"error"),i(),n(3,"span"),a(4),i()()),s&2){let e=l();c(4),M(e.errorMessage)}}var k=class s{promptApi=g(R);dialogRef=g(ie);configApi=g(z);snackBar=g(ne);name="";description="";commands=[""];webhookEnabled=!1;threadLifetime="";source="local";isSaving=!1;errorMessage="";isAdmin=!1;isEditMode=!1;promptId="";data=g(re);constructor(){this.isEditMode=this.data.mode==="edit"}ngOnInit(){this.configApi.getUserConfig().subscribe({next:o=>{this.isAdmin=o.groups?.includes("CODAY_ADMIN")??!1},error:o=>{console.error("[PROMPT_FORM] Error loading user config:",o),this.isAdmin=!1}}),this.isEditMode&&this.data.prompt&&(this.promptId=this.data.prompt.id,this.name=this.data.prompt.name,this.description=this.data.prompt.description,this.commands=[...this.data.prompt.commands],this.webhookEnabled=this.data.prompt.webhookEnabled,this.source=this.data.prompt.source)}addCommand(){this.commands.push("")}removeCommand(o){this.commands.length>1&&this.commands.splice(o,1)}trackByIndex(o){return o}normalizeName(){this.name=this.name.replace(/[\s_.,;:!?()[\]{}]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase()}validateForm(){return this.name.trim()?this.description.trim()?this.commands.filter(e=>e.trim()).length===0?(this.errorMessage="At least one command is required",!1):!0:(this.errorMessage="Description is required",!1):(this.errorMessage="Name is required",!1)}save(){if(this.errorMessage="",!this.validateForm())return;let o=this.commands.filter(e=>e.trim());if(this.isSaving=!0,this.isEditMode&&this.data.prompt){let e={name:this.name.trim(),description:this.description.trim(),commands:o,webhookEnabled:this.webhookEnabled};this.promptApi.updatePrompt(this.data.prompt.id,e).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:t=>{console.error("Error updating prompt:",t),this.errorMessage=t?.error?.error||t?.message||"Failed to update prompt",this.isSaving=!1}})}else{let e={name:this.name.trim(),description:this.description.trim(),commands:o,webhookEnabled:this.webhookEnabled,source:this.source};this.promptApi.createPrompt(e).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:t=>{console.error("Error creating prompt:",t),this.errorMessage=t?.error?.error||t?.message||"Failed to create prompt",this.isSaving=!1}})}}cancel(){this.dialogRef.close(!1)}getWebhookUrl(){return`${window.location.origin}/api/webhooks/${this.promptId}/execute`}copyWebhookUrl(){if(!this.webhookEnabled){this.snackBar.open("Webhook is not enabled","Close",{duration:3e3});return}if(!this.promptId){this.snackBar.open("Prompt must be saved before getting webhook URL","Close",{duration:3e3});return}let o=this.getWebhookUrl();navigator.clipboard.writeText(o).then(()=>{this.snackBar.open("Webhook URL copied to clipboard!","Close",{duration:3e3})}).catch(e=>{console.error("Failed to copy webhook URL:",e),this.snackBar.open("Failed to copy URL","Close",{duration:3e3})})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=F({type:s,selectors:[["app-prompt-form"]],decls:36,vars:11,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","my-prompt","required","",3,"ngModelChange","blur","ngModel"],["matInput","","placeholder","What does this prompt do?","rows","3","required","",3,"ngModelChange","ngModel"],[1,"commands-section"],[1,"section-header"],["mat-icon-button","","type","button","title","Add command",3,"click"],[1,"commands-list"],[1,"command-item"],[1,"source-section"],[1,"source-display"],[1,"webhook-section"],[1,"webhook-url-section"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],["appearance","outline",1,"command-field"],["matInput","","placeholder","Enter command with placeholders like \\{\\{key\\}\\}","rows","2",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove command",1,"remove-btn",3,"click","disabled"],[1,"source-options"],[1,"source-option"],["type","radio","name","source","value","local",3,"ngModelChange","ngModel"],[1,"source-content"],[1,"source-header"],[1,"source-icon"],[1,"source-label"],[1,"source-description"],["type","radio","name","source","value","project",3,"ngModelChange","ngModel"],[1,"hint"],[1,"source-badge"],[1,"checkbox-label"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"webhook-url-header"],[1,"webhook-icon"],[1,"webhook-url-content"],[1,"url-text"],["mat-raised-button","","color","accent","type","button",3,"click"]],template:function(e,t){e&1&&(n(0,"h2",0),a(1),i(),n(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),a(6,"Name"),i(),n(7,"input",3),y("ngModelChange",function(m){return v(t.name,m)||(t.name=m),m}),d("blur",function(){return t.normalizeName()}),i(),n(8,"mat-hint"),a(9,"A descriptive name (spaces and punctuation will be replaced with hyphens), will be used as command name"),i()(),n(10,"mat-form-field",2)(11,"mat-label"),a(12,"Description"),i(),n(13,"textarea",4),y("ngModelChange",function(m){return v(t.description,m)||(t.description=m),m}),i(),n(14,"mat-hint"),a(15,"Explain the purpose of this prompt, helps for searchability"),i()(),n(16,"div",5)(17,"div",6)(18,"h3"),a(19,"Prompts"),i(),n(20,"button",7),d("click",function(){return t.addCommand()}),n(21,"mat-icon"),a(22,"add"),i()()(),n(23,"div",8),H(24,ze,10,3,"div",9,q),i()(),h(26,Ne,26,6,"div",10),h(27,Ue,10,6,"div",11),h(28,je,7,1,"div",12),h(29,qe,16,1,"div",13),h(30,He,5,1,"div",14),i()(),n(31,"mat-dialog-actions",15)(32,"button",16),d("click",function(){return t.cancel()}),a(33,"Cancel"),i(),n(34,"button",17),d("click",function(){return t.save()}),a(35),i()()),e&2&&(c(),M(t.isEditMode?"Edit Prompt":"Create Prompt"),c(6),x("ngModel",t.name),c(6),x("ngModel",t.description),c(11),Y(t.commands),c(2),b(t.isEditMode?-1:26),c(),b(t.isEditMode?27:-1),c(),b(t.isAdmin?28:-1),c(),b(t.isEditMode&&t.webhookEnabled&&t.isAdmin?29:-1),c(),b(t.errorMessage?30:-1),c(2),C("disabled",t.isSaving),c(2),C("disabled",t.isSaving),c(),O(" ",t.isSaving?"Saving...":"Save"," "))},dependencies:[$,B,ge,pe,ue,W,_e,V,le,se,me,ce,I,te,D,ve,xe,Me,Ce,fe,Pe,A,L,oe],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:500px}@media(max-width:768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.commands-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:.5rem}.commands-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.commands-section[_ngcontent-%COMP%] .commands-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .command-field[_ngcontent-%COMP%]{flex:1}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{margin-top:8px}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:not-allowed}.webhook-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{width:18px;height:18px;cursor:pointer}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.95rem}.webhook-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.85rem;color:var(--color-text-secondary)}.webhook-url-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.75rem}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%] .webhook-icon[_ngcontent-%COMP%]{color:var(--color-primary)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;margin-bottom:.5rem}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%] .url-text[_ngcontent-%COMP%]{flex:1;margin:0;padding:.75rem;background:var(--color-bg);border:1px solid var(--color-border);border-radius:4px;font-family:monospace;font-size:.85rem;word-break:break-all;color:var(--color-text)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{white-space:nowrap;display:flex;align-items:center;gap:.5rem}.webhook-url-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}.source-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.source-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 1rem;font-size:1rem;font-weight:600}.source-section[_ngcontent-%COMP%] .source-options[_ngcontent-%COMP%]{display:flex;gap:1rem;margin-bottom:.75rem}@media(max-width:768px){.source-section[_ngcontent-%COMP%] .source-options[_ngcontent-%COMP%]{flex-direction:column}}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%]{flex:1;display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:var(--color-bg);border:2px solid var(--color-border);border-radius:8px;cursor:pointer;transition:all .2s ease}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%]:hover{border-color:var(--color-primary);background:var(--color-bg-hover)}.source-section[_ngcontent-%COMP%] .source-option.selected[_ngcontent-%COMP%]{border-color:var(--color-primary);background:var(--color-bg-hover);box-shadow:0 0 0 1px var(--color-primary)}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin-top:2px;cursor:pointer}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%]{flex:1}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.25rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-label[_ngcontent-%COMP%]{font-weight:600;font-size:.95rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-description[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);line-height:1.4}.source-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.thread-lifetime-disabled[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:#2196f30d;border:1px solid rgba(33,150,243,.2);border-radius:8px;margin-bottom:1rem}.thread-lifetime-disabled[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#2196f3cc;font-size:1.25rem;width:1.25rem;height:1.25rem;margin-top:2px}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;flex:1}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:.95rem;color:var(--color-text)}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{display:block;margin-top:.25rem;font-size:.85rem;color:var(--color-text-secondary);line-height:1.4}.source-display[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.source-display[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1rem;font-weight:600}.source-display[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem 1rem;border-radius:6px;font-size:.9rem;font-weight:500;margin-bottom:.5rem}.source-display[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.1rem}.source-display[_ngcontent-%COMP%] .source-badge.badge-local[_ngcontent-%COMP%]{background:#2196f31a;color:#2196f3;border:1px solid rgba(33,150,243,.3)}.source-display[_ngcontent-%COMP%] .source-badge.badge-project[_ngcontent-%COMP%]{background:#4caf501a;color:#4caf50;border:1px solid rgba(76,175,80,.3)}.source-display[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}"]})};var Ye=()=>[],Ge=s=>({id:s});function Ke(s,o){if(s&1&&(n(0,"div",6),a(1),i()),s&2){let e=l();c(),M(e.errorMessage())}}function Je(s,o){if(s&1){let e=f();n(0,"ds-entity-card",8),d("selected",function(r){u(e);let m=l();return _(m.onEdit(r))}),G(1,9),n(2,"button",10),d("click",function(r){return r.stopPropagation()}),n(3,"mat-icon"),a(4,"more_vert"),i()(),K(),i()}if(s&2){let e=o.$implicit;l();let t=U(11);C("id",e.id)("name",e.name)("description",e.description)("badges",e.badges??J(6,Ye)),c(2),C("matMenuTriggerFor",t)("matMenuTriggerData",Q(7,Ge,e.id))}}function Qe(s,o){if(s&1){let e=f();n(0,"button",11),d("click",function(){u(e);let r=l().id,m=l();return _(m.onToggleWebhook(r))}),n(1,"mat-icon"),a(2),i(),a(3),i()}if(s&2){let e=l().id,t=l();c(2),M(t.isWebhookEnabled(e)?"link_off":"link"),c(),O(" ",t.isWebhookEnabled(e)?"Disable webhook":"Enable webhook"," ")}}function Xe(s,o){if(s&1){let e=f();n(0,"button",11),d("click",function(){let r=u(e).id,m=l();return _(m.onEdit(r))}),n(1,"mat-icon"),a(2,"edit"),i(),a(3," Edit "),i(),h(4,Qe,4,2,"button",12),n(5,"button",13),d("click",function(){let r=u(e).id,m=l();return _(m.onDelete(r))}),n(6,"mat-icon"),a(7,"delete"),i(),a(8," Delete "),i()}if(s&2){let e=l();c(4),b(e.isAdmin()?4:-1)}}var De="system",Ie=class s{promptApi=g(R);configApi=g(z);projectState=g(de);dialog=g(ae);router=g(ee);prompts=P([]);isLoading=P(!1);errorMessage=P(null);showOnlyMine=P(!0);isAdmin=P(!1);currentUsername=P("");promptItems=Z(()=>{let o=this.prompts(),e=this.currentUsername(),r=this.showOnlyMine()&&e?o.filter(p=>this.isMyPrompt(p)):o,E=[...new Set(r.map(p=>p.createdBy))].sort((p,w)=>p===e&&w!==e?-1:w===e&&p!==e||p===De?1:w===De?-1:p.localeCompare(w)),j=[];for(let p of E){let w=p===e?`${p} (you)`:p;for(let S of r.filter(Le=>Le.createdBy===p))j.push({id:S.id,name:S.name,description:S.description,badges:this.buildBadges(S),groupKey:p,groupLabel:w})}return j});ngOnInit(){this.configApi.getUserConfig().subscribe({next:o=>{this.isAdmin.set(o.groups?.includes("CODAY_ADMIN")??!1),this.currentUsername.set(o.username??"")},error:()=>this.isAdmin.set(!1)}),this.loadPrompts()}loadPrompts(){this.isLoading.set(!0),this.promptApi.listPrompts().subscribe({next:o=>{this.prompts.set(o.filter(e=>!e.id.startsWith("builtin"))),this.isLoading.set(!1)},error:o=>{this.errorMessage.set(o?.error?.error??"Failed to load prompts"),this.isLoading.set(!1)}})}onBack(){let o=this.projectState.getSelectedProjectId();this.router.navigate(o?["project",o]:["/"])}onCreate(){this.dialog.open(k,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadPrompts()})}onEdit(o){this.promptApi.getPrompt(o).subscribe({next:e=>{this.dialog.open(k,{width:"700px",maxHeight:"90vh",data:{mode:"edit",prompt:e}}).afterClosed().subscribe(r=>{r&&this.loadPrompts()})},error:e=>this.errorMessage.set(e?.error?.error??"Failed to load prompt")})}onDelete(o){confirm("Are you sure you want to delete this prompt?")&&this.promptApi.deletePrompt(o).subscribe({next:()=>this.loadPrompts(),error:e=>this.errorMessage.set(e?.error?.error??"Failed to delete prompt")})}onToggleWebhook(o){let e=this.prompts().find(r=>r.id===o);if(!e)return;(e.webhookEnabled?this.promptApi.disableWebhook(o):this.promptApi.enableWebhook(o)).subscribe({next:()=>this.loadPrompts(),error:r=>this.errorMessage.set(r?.error?.error??"Failed to toggle webhook")})}isWebhookEnabled(o){return this.prompts().find(e=>e.id===o)?.webhookEnabled??!1}isMyPrompt(o){let e=t=>t.replace(/[.\s]+/g,"_").toLowerCase();return e(o.createdBy)===e(this.currentUsername())}buildBadges(o){let e=[];return o.source==="local"?e.push({label:"local",variant:"info"}):e.push({label:"project",variant:"success"}),o.webhookEnabled&&e.push({label:"webhook",variant:"warning"}),e}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=F({type:s,selectors:[["app-prompt-list"]],decls:13,vars:5,consts:[["promptCard",""],["cardMenu","matMenu"],[1,"prompt-list-page"],["title","Prompts","cardMinWidth","320px","contentMaxWidth","1400px","searchPlaceholder","Filter prompts\u2026","emptyMessage","No prompts found.",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","mat-icon-button","","title","Back",3,"click"],["toolbar-extras","","color","primary",1,"prompt-list__mine-toggle",3,"ngModelChange","ngModel"],[1,"prompt-list__error"],["matMenuContent",""],[3,"selected","id","name","description","badges"],["dsCardActions",""],["mat-icon-button","",3,"click","matMenuTriggerFor","matMenuTriggerData"],["mat-menu-item","",3,"click"],["mat-menu-item",""],["mat-menu-item","",1,"prompt-list__delete-item",3,"click"]],template:function(e,t){if(e&1&&(n(0,"div",2)(1,"ds-entity-list",3),d("createRequested",function(){return t.onCreate()}),n(2,"button",4),d("click",function(){return t.onBack()}),n(3,"mat-icon"),a(4,"chevron_left"),i()(),n(5,"mat-slide-toggle",5),d("ngModelChange",function(m){return t.showOnlyMine.set(m)}),a(6," Mine "),i()(),h(7,Ke,2,1,"div",6),i(),N(8,Je,5,9,"ng-template",null,0,X),n(10,"mat-menu",null,1),N(12,Xe,9,1,"ng-template",7),i()),e&2){let r=U(9);c(),C("items",t.promptItems())("showCreate",!0)("itemTemplate",r),c(4),C("ngModel",t.showOnlyMine()),c(2),b(t.errorMessage()?7:-1)}},dependencies:[ye,be,he,I,D,A,L,Oe,we,Te,Se,ke,Ee,Fe,B,W,V],styles:["[_nghost-%COMP%]{display:block;width:100%;min-height:100vh;background:var(--color-bg);overflow-y:auto}.prompt-list__mine-toggle[_ngcontent-%COMP%]{flex-shrink:0;font-size:.875rem}.prompt-list__delete-item[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.prompt-list__delete-item[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:inherit}.prompt-list__error[_ngcontent-%COMP%]{margin:1rem auto;max-width:900px;padding:.75rem 1rem;background:#dc262614;border:1px solid rgba(220,38,38,.25);border-radius:8px;color:var(--color-error, #ff3b30);font-size:.875rem}"]})};export{Ie as PromptListComponent};
|
|
1
|
+
import{a as R,b as z,c as we,d as Oe}from"./chunk-6F5GPHWV.js";import{a as ne,b as oe}from"./chunk-H72Z2LX3.js";import{a as ke,b as Ee,c as Se,d as Fe,e as Te}from"./chunk-AE2AQO4B.js";import{a as ie,b as re,d as ae,e as se,f as ce,g as me,h as le}from"./chunk-OUZFS4TC.js";import{M as be,O as Ce,P as fe,S as Me,T as Pe,U as xe,V as ve,W as ye,z as he}from"./chunk-4NNLWDVJ.js";import{L as D,P as te,R as I,S as L,T as A}from"./chunk-5MXEOOQM.js";import{b as de}from"./chunk-L72BYLQX.js";import{A as _e,C as B,b as pe,c as ge,g as W,m as V,p as ue}from"./chunk-AE24ERN3.js";import"./chunk-VVZKXHDD.js";import{Ab as O,Cb as x,Db as v,Ea as F,Eb as y,Hb as J,Ib as Q,Ka as N,Ob as X,Qb as Z,Sa as h,T as g,Ta as b,Ua as q,Wa as H,X as u,Xa as Y,Y as _,Ya as C,Za as n,_a as i,db as G,eb as K,ga as P,gb as f,hc as $,ib as d,kb as l,tc as ee,ua as c,ub as U,wb as T,yb as a,zb as M}from"./chunk-TRUXCA4C.js";function ze(s,o){if(s&1){let e=f();n(0,"div",9)(1,"mat-form-field",18)(2,"mat-label"),a(3),i(),n(4,"textarea",19),y("ngModelChange",function(r){let m=u(e).$index,E=l();return v(E.commands[m],r)||(E.commands[m]=r),_(r)}),i(),n(5,"mat-hint"),a(6,"Use placeholder for dynamic values"),i()(),n(7,"button",20),d("click",function(){let r=u(e).$index,m=l();return _(m.removeCommand(r))}),n(8,"mat-icon"),a(9,"delete"),i()()()}if(s&2){let e=o.$index,t=l();c(3),O("Prompt ",e+1),c(),x("ngModel",t.commands[e]),c(3),C("disabled",t.commands.length===1)}}function Ne(s,o){if(s&1){let e=f();n(0,"div",10)(1,"h3"),a(2,"Save to"),i(),n(3,"div",21)(4,"label",22)(5,"input",23),y("ngModelChange",function(r){u(e);let m=l();return v(m.source,r)||(m.source=r),_(r)}),i(),n(6,"div",24)(7,"div",25)(8,"span",26),a(9,"\u{1F464}"),i(),n(10,"span",27),a(11,"Local"),i()(),n(12,"p",28),a(13,"Personal prompt in ~/.coday/... (not committed)"),i()()(),n(14,"label",22)(15,"input",29),y("ngModelChange",function(r){u(e);let m=l();return v(m.source,r)||(m.source=r),_(r)}),i(),n(16,"div",24)(17,"div",25)(18,"span",26),a(19,"\u{1F4E6}"),i(),n(20,"span",27),a(21,"Project"),i()(),n(22,"p",28),a(23,"Shared prompt in ./prompts/ (committable)"),i()()()(),n(24,"p",30),a(25,"Storage location is permanent and cannot be changed after creation"),i()()}if(s&2){let e=l();c(4),T("selected",e.source==="local"),c(),x("ngModel",e.source),c(9),T("selected",e.source==="project"),c(),x("ngModel",e.source)}}function Ue(s,o){if(s&1&&(n(0,"div",11)(1,"h3"),a(2,"Storage Location"),i(),n(3,"div",31)(4,"span",26),a(5),i(),n(6,"span",27),a(7),i()(),n(8,"p",30),a(9,"Cannot be changed after creation"),i()()),s&2){let e=l();c(3),T("badge-local",e.source==="local")("badge-project",e.source==="project"),c(2),M(e.source==="local"?"\u{1F464}":"\u{1F4E6}"),c(2),M(e.source==="local"?"Local":"Project")}}function je(s,o){if(s&1){let e=f();n(0,"div",12)(1,"label",32)(2,"input",33),y("ngModelChange",function(r){u(e);let m=l();return v(m.webhookEnabled,r)||(m.webhookEnabled=r),_(r)}),i(),n(3,"span"),a(4,"Enable webhook"),i()(),n(5,"p",30),a(6,"Enable webhook to trigger this prompt via HTTP POST"),i()()}if(s&2){let e=l();c(2),x("ngModel",e.webhookEnabled)}}function qe(s,o){if(s&1){let e=f();n(0,"div",13)(1,"div",34)(2,"mat-icon",35),a(3,"link"),i(),n(4,"h4"),a(5,"Webhook URL"),i()(),n(6,"div",36)(7,"p",37),a(8),i(),n(9,"button",38),d("click",function(){u(e);let r=l();return _(r.copyWebhookUrl())}),n(10,"mat-icon"),a(11,"content_copy"),i(),n(12,"span"),a(13,"Copy URL"),i()()(),n(14,"p",30),a(15,"Use this URL to trigger the prompt via HTTP POST"),i()()}if(s&2){let e=l();c(8),M(e.getWebhookUrl())}}function He(s,o){if(s&1&&(n(0,"div",14)(1,"mat-icon"),a(2,"error"),i(),n(3,"span"),a(4),i()()),s&2){let e=l();c(4),M(e.errorMessage)}}var k=class s{promptApi=g(R);dialogRef=g(ie);configApi=g(z);snackBar=g(ne);name="";description="";commands=[""];webhookEnabled=!1;threadLifetime="";source="local";isSaving=!1;errorMessage="";isAdmin=!1;isEditMode=!1;promptId="";data=g(re);constructor(){this.isEditMode=this.data.mode==="edit"}ngOnInit(){this.configApi.getUserConfig().subscribe({next:o=>{this.isAdmin=o.groups?.includes("CODAY_ADMIN")??!1},error:o=>{console.error("[PROMPT_FORM] Error loading user config:",o),this.isAdmin=!1}}),this.isEditMode&&this.data.prompt&&(this.promptId=this.data.prompt.id,this.name=this.data.prompt.name,this.description=this.data.prompt.description,this.commands=[...this.data.prompt.commands],this.webhookEnabled=this.data.prompt.webhookEnabled,this.source=this.data.prompt.source)}addCommand(){this.commands.push("")}removeCommand(o){this.commands.length>1&&this.commands.splice(o,1)}trackByIndex(o){return o}normalizeName(){this.name=this.name.replace(/[\s_.,;:!?()[\]{}]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase()}validateForm(){return this.name.trim()?this.description.trim()?this.commands.filter(e=>e.trim()).length===0?(this.errorMessage="At least one command is required",!1):!0:(this.errorMessage="Description is required",!1):(this.errorMessage="Name is required",!1)}save(){if(this.errorMessage="",!this.validateForm())return;let o=this.commands.filter(e=>e.trim());if(this.isSaving=!0,this.isEditMode&&this.data.prompt){let e={name:this.name.trim(),description:this.description.trim(),commands:o,webhookEnabled:this.webhookEnabled};this.promptApi.updatePrompt(this.data.prompt.id,e).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:t=>{console.error("Error updating prompt:",t),this.errorMessage=t?.error?.error||t?.message||"Failed to update prompt",this.isSaving=!1}})}else{let e={name:this.name.trim(),description:this.description.trim(),commands:o,webhookEnabled:this.webhookEnabled,source:this.source};this.promptApi.createPrompt(e).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:t=>{console.error("Error creating prompt:",t),this.errorMessage=t?.error?.error||t?.message||"Failed to create prompt",this.isSaving=!1}})}}cancel(){this.dialogRef.close(!1)}getWebhookUrl(){return`${window.location.origin}/api/webhooks/${this.promptId}/execute`}copyWebhookUrl(){if(!this.webhookEnabled){this.snackBar.open("Webhook is not enabled","Close",{duration:3e3});return}if(!this.promptId){this.snackBar.open("Prompt must be saved before getting webhook URL","Close",{duration:3e3});return}let o=this.getWebhookUrl();navigator.clipboard.writeText(o).then(()=>{this.snackBar.open("Webhook URL copied to clipboard!","Close",{duration:3e3})}).catch(e=>{console.error("Failed to copy webhook URL:",e),this.snackBar.open("Failed to copy URL","Close",{duration:3e3})})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=F({type:s,selectors:[["app-prompt-form"]],decls:36,vars:11,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","my-prompt","required","",3,"ngModelChange","blur","ngModel"],["matInput","","placeholder","What does this prompt do?","rows","3","required","",3,"ngModelChange","ngModel"],[1,"commands-section"],[1,"section-header"],["mat-icon-button","","type","button","title","Add command",3,"click"],[1,"commands-list"],[1,"command-item"],[1,"source-section"],[1,"source-display"],[1,"webhook-section"],[1,"webhook-url-section"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],["appearance","outline",1,"command-field"],["matInput","","placeholder","Enter command with placeholders like \\{\\{key\\}\\}","rows","2",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove command",1,"remove-btn",3,"click","disabled"],[1,"source-options"],[1,"source-option"],["type","radio","name","source","value","local",3,"ngModelChange","ngModel"],[1,"source-content"],[1,"source-header"],[1,"source-icon"],[1,"source-label"],[1,"source-description"],["type","radio","name","source","value","project",3,"ngModelChange","ngModel"],[1,"hint"],[1,"source-badge"],[1,"checkbox-label"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"webhook-url-header"],[1,"webhook-icon"],[1,"webhook-url-content"],[1,"url-text"],["mat-raised-button","","color","accent","type","button",3,"click"]],template:function(e,t){e&1&&(n(0,"h2",0),a(1),i(),n(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),a(6,"Name"),i(),n(7,"input",3),y("ngModelChange",function(m){return v(t.name,m)||(t.name=m),m}),d("blur",function(){return t.normalizeName()}),i(),n(8,"mat-hint"),a(9,"A descriptive name (spaces and punctuation will be replaced with hyphens), will be used as command name"),i()(),n(10,"mat-form-field",2)(11,"mat-label"),a(12,"Description"),i(),n(13,"textarea",4),y("ngModelChange",function(m){return v(t.description,m)||(t.description=m),m}),i(),n(14,"mat-hint"),a(15,"Explain the purpose of this prompt, helps for searchability"),i()(),n(16,"div",5)(17,"div",6)(18,"h3"),a(19,"Prompts"),i(),n(20,"button",7),d("click",function(){return t.addCommand()}),n(21,"mat-icon"),a(22,"add"),i()()(),n(23,"div",8),H(24,ze,10,3,"div",9,q),i()(),h(26,Ne,26,6,"div",10),h(27,Ue,10,6,"div",11),h(28,je,7,1,"div",12),h(29,qe,16,1,"div",13),h(30,He,5,1,"div",14),i()(),n(31,"mat-dialog-actions",15)(32,"button",16),d("click",function(){return t.cancel()}),a(33,"Cancel"),i(),n(34,"button",17),d("click",function(){return t.save()}),a(35),i()()),e&2&&(c(),M(t.isEditMode?"Edit Prompt":"Create Prompt"),c(6),x("ngModel",t.name),c(6),x("ngModel",t.description),c(11),Y(t.commands),c(2),b(t.isEditMode?-1:26),c(),b(t.isEditMode?27:-1),c(),b(t.isAdmin?28:-1),c(),b(t.isEditMode&&t.webhookEnabled&&t.isAdmin?29:-1),c(),b(t.errorMessage?30:-1),c(2),C("disabled",t.isSaving),c(2),C("disabled",t.isSaving),c(),O(" ",t.isSaving?"Saving...":"Save"," "))},dependencies:[$,B,ge,pe,ue,W,_e,V,le,se,me,ce,I,te,D,ve,xe,Me,Ce,fe,Pe,A,L,oe],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:500px}@media(max-width:768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.commands-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:.5rem}.commands-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.commands-section[_ngcontent-%COMP%] .commands-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .command-field[_ngcontent-%COMP%]{flex:1}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{margin-top:8px}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:not-allowed}.webhook-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{width:18px;height:18px;cursor:pointer}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.95rem}.webhook-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.85rem;color:var(--color-text-secondary)}.webhook-url-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.75rem}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%] .webhook-icon[_ngcontent-%COMP%]{color:var(--color-primary)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;margin-bottom:.5rem}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%] .url-text[_ngcontent-%COMP%]{flex:1;margin:0;padding:.75rem;background:var(--color-bg);border:1px solid var(--color-border);border-radius:4px;font-family:monospace;font-size:.85rem;word-break:break-all;color:var(--color-text)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{white-space:nowrap;display:flex;align-items:center;gap:.5rem}.webhook-url-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}.source-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.source-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 1rem;font-size:1rem;font-weight:600}.source-section[_ngcontent-%COMP%] .source-options[_ngcontent-%COMP%]{display:flex;gap:1rem;margin-bottom:.75rem}@media(max-width:768px){.source-section[_ngcontent-%COMP%] .source-options[_ngcontent-%COMP%]{flex-direction:column}}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%]{flex:1;display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:var(--color-bg);border:2px solid var(--color-border);border-radius:8px;cursor:pointer;transition:all .2s ease}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%]:hover{border-color:var(--color-primary);background:var(--color-bg-hover)}.source-section[_ngcontent-%COMP%] .source-option.selected[_ngcontent-%COMP%]{border-color:var(--color-primary);background:var(--color-bg-hover);box-shadow:0 0 0 1px var(--color-primary)}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin-top:2px;cursor:pointer}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%]{flex:1}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.25rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-label[_ngcontent-%COMP%]{font-weight:600;font-size:.95rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-description[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);line-height:1.4}.source-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.thread-lifetime-disabled[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:#2196f30d;border:1px solid rgba(33,150,243,.2);border-radius:8px;margin-bottom:1rem}.thread-lifetime-disabled[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#2196f3cc;font-size:1.25rem;width:1.25rem;height:1.25rem;margin-top:2px}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;flex:1}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:.95rem;color:var(--color-text)}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{display:block;margin-top:.25rem;font-size:.85rem;color:var(--color-text-secondary);line-height:1.4}.source-display[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.source-display[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1rem;font-weight:600}.source-display[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem 1rem;border-radius:6px;font-size:.9rem;font-weight:500;margin-bottom:.5rem}.source-display[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.1rem}.source-display[_ngcontent-%COMP%] .source-badge.badge-local[_ngcontent-%COMP%]{background:#2196f31a;color:#2196f3;border:1px solid rgba(33,150,243,.3)}.source-display[_ngcontent-%COMP%] .source-badge.badge-project[_ngcontent-%COMP%]{background:#4caf501a;color:#4caf50;border:1px solid rgba(76,175,80,.3)}.source-display[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}"]})};var Ye=()=>[],Ge=s=>({id:s});function Ke(s,o){if(s&1&&(n(0,"div",6),a(1),i()),s&2){let e=l();c(),M(e.errorMessage())}}function Je(s,o){if(s&1){let e=f();n(0,"ds-entity-card",8),d("selected",function(r){u(e);let m=l();return _(m.onEdit(r))}),G(1,9),n(2,"button",10),d("click",function(r){return r.stopPropagation()}),n(3,"mat-icon"),a(4,"more_vert"),i()(),K(),i()}if(s&2){let e=o.$implicit;l();let t=U(11);C("id",e.id)("name",e.name)("description",e.description)("badges",e.badges??J(6,Ye)),c(2),C("matMenuTriggerFor",t)("matMenuTriggerData",Q(7,Ge,e.id))}}function Qe(s,o){if(s&1){let e=f();n(0,"button",11),d("click",function(){u(e);let r=l().id,m=l();return _(m.onToggleWebhook(r))}),n(1,"mat-icon"),a(2),i(),a(3),i()}if(s&2){let e=l().id,t=l();c(2),M(t.isWebhookEnabled(e)?"link_off":"link"),c(),O(" ",t.isWebhookEnabled(e)?"Disable webhook":"Enable webhook"," ")}}function Xe(s,o){if(s&1){let e=f();n(0,"button",11),d("click",function(){let r=u(e).id,m=l();return _(m.onEdit(r))}),n(1,"mat-icon"),a(2,"edit"),i(),a(3," Edit "),i(),h(4,Qe,4,2,"button",12),n(5,"button",13),d("click",function(){let r=u(e).id,m=l();return _(m.onDelete(r))}),n(6,"mat-icon"),a(7,"delete"),i(),a(8," Delete "),i()}if(s&2){let e=l();c(4),b(e.isAdmin()?4:-1)}}var De="system",Ie=class s{promptApi=g(R);configApi=g(z);projectState=g(de);dialog=g(ae);router=g(ee);prompts=P([]);isLoading=P(!1);errorMessage=P(null);showOnlyMine=P(!0);isAdmin=P(!1);currentUsername=P("");promptItems=Z(()=>{let o=this.prompts(),e=this.currentUsername(),r=this.showOnlyMine()&&e?o.filter(p=>this.isMyPrompt(p)):o,E=[...new Set(r.map(p=>p.createdBy))].sort((p,w)=>p===e&&w!==e?-1:w===e&&p!==e||p===De?1:w===De?-1:p.localeCompare(w)),j=[];for(let p of E){let w=p===e?`${p} (you)`:p;for(let S of r.filter(Le=>Le.createdBy===p))j.push({id:S.id,name:S.name,description:S.description,badges:this.buildBadges(S),groupKey:p,groupLabel:w})}return j});ngOnInit(){this.configApi.getUserConfig().subscribe({next:o=>{this.isAdmin.set(o.groups?.includes("CODAY_ADMIN")??!1),this.currentUsername.set(o.username??"")},error:()=>this.isAdmin.set(!1)}),this.loadPrompts()}loadPrompts(){this.isLoading.set(!0),this.promptApi.listPrompts().subscribe({next:o=>{this.prompts.set(o.filter(e=>!e.id.startsWith("builtin"))),this.isLoading.set(!1)},error:o=>{this.errorMessage.set(o?.error?.error??"Failed to load prompts"),this.isLoading.set(!1)}})}onBack(){let o=this.projectState.getSelectedProjectId();this.router.navigate(o?["project",o]:["/"])}onCreate(){this.dialog.open(k,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadPrompts()})}onEdit(o){this.promptApi.getPrompt(o).subscribe({next:e=>{this.dialog.open(k,{width:"700px",maxHeight:"90vh",data:{mode:"edit",prompt:e}}).afterClosed().subscribe(r=>{r&&this.loadPrompts()})},error:e=>this.errorMessage.set(e?.error?.error??"Failed to load prompt")})}onDelete(o){confirm("Are you sure you want to delete this prompt?")&&this.promptApi.deletePrompt(o).subscribe({next:()=>this.loadPrompts(),error:e=>this.errorMessage.set(e?.error?.error??"Failed to delete prompt")})}onToggleWebhook(o){let e=this.prompts().find(r=>r.id===o);if(!e)return;(e.webhookEnabled?this.promptApi.disableWebhook(o):this.promptApi.enableWebhook(o)).subscribe({next:()=>this.loadPrompts(),error:r=>this.errorMessage.set(r?.error?.error??"Failed to toggle webhook")})}isWebhookEnabled(o){return this.prompts().find(e=>e.id===o)?.webhookEnabled??!1}isMyPrompt(o){let e=t=>t.replace(/[.\s]+/g,"_").toLowerCase();return e(o.createdBy)===e(this.currentUsername())}buildBadges(o){let e=[];return o.source==="local"?e.push({label:"local",variant:"info"}):e.push({label:"project",variant:"success"}),o.webhookEnabled&&e.push({label:"webhook",variant:"warning"}),e}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=F({type:s,selectors:[["app-prompt-list"]],decls:13,vars:5,consts:[["promptCard",""],["cardMenu","matMenu"],[1,"prompt-list-page"],["title","Prompts","cardMinWidth","320px","contentMaxWidth","1400px","searchPlaceholder","Filter prompts\u2026","emptyMessage","No prompts found.",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","mat-icon-button","","title","Back",3,"click"],["toolbar-extras","","color","primary",1,"prompt-list__mine-toggle",3,"ngModelChange","ngModel"],[1,"prompt-list__error"],["matMenuContent",""],[3,"selected","id","name","description","badges"],["dsCardActions",""],["mat-icon-button","",3,"click","matMenuTriggerFor","matMenuTriggerData"],["mat-menu-item","",3,"click"],["mat-menu-item",""],["mat-menu-item","",1,"prompt-list__delete-item",3,"click"]],template:function(e,t){if(e&1&&(n(0,"div",2)(1,"ds-entity-list",3),d("createRequested",function(){return t.onCreate()}),n(2,"button",4),d("click",function(){return t.onBack()}),n(3,"mat-icon"),a(4,"chevron_left"),i()(),n(5,"mat-slide-toggle",5),d("ngModelChange",function(m){return t.showOnlyMine.set(m)}),a(6," Mine "),i()(),h(7,Ke,2,1,"div",6),i(),N(8,Je,5,9,"ng-template",null,0,X),n(10,"mat-menu",null,1),N(12,Xe,9,1,"ng-template",7),i()),e&2){let r=U(9);c(),C("items",t.promptItems())("showCreate",!0)("itemTemplate",r),c(4),C("ngModel",t.showOnlyMine()),c(2),b(t.errorMessage()?7:-1)}},dependencies:[ye,be,he,I,D,A,L,Oe,we,Te,Se,ke,Ee,Fe,B,W,V],styles:["[_nghost-%COMP%]{display:block;width:100%;min-height:100vh;background:var(--color-bg);overflow-y:auto}.prompt-list__mine-toggle[_ngcontent-%COMP%]{flex-shrink:0;font-size:.875rem}.prompt-list__delete-item[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.prompt-list__delete-item[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:inherit}.prompt-list__error[_ngcontent-%COMP%]{margin:1rem auto;max-width:900px;padding:.75rem 1rem;background:#dc262614;border:1px solid rgba(220,38,38,.25);border-radius:8px;color:var(--color-error, #ff3b30);font-size:.875rem}"]})};export{Ie as PromptListComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{G as g,J as u,M as o,P as n,T as c,d as j,h as i,l as d,oc as h,p as l,q as b,z as p}from"./chunk-TRUXCA4C.js";var a=class s{baseUrl="/api/projects";http=c(h);listProjects(){return this.http.get(this.baseUrl)}getProject(e){return this.http.get(`${this.baseUrl}/${e}`)}getProjectConfig(e){return this.http.get(`${this.baseUrl}/${e}/config`)}updateProjectConfig(e,t){return this.http.put(`${this.baseUrl}/${e}/config`,t)}createProject(e,t){return this.http.post(this.baseUrl,{name:e,path:t})}deleteProject(e,t){let r={};return t&&(r.removeGitWorktree="true"),this.http.delete(`${this.baseUrl}/${encodeURIComponent(e)}`,{params:r})}getPreviewEntries(e){return this.http.get(`${this.baseUrl}/${e}/preview/entries`)}startPreview(e,t){return this.http.post(`${this.baseUrl}/${e}/preview/${t}/start`,{})}stopPreview(e,t){return this.http.post(`${this.baseUrl}/${e}/preview/${t}/stop`,{})}getPreviewStatus(e,t){return this.http.get(`${this.baseUrl}/${e}/preview/${t}/status`)}getPreviewLogs(e,t){return this.http.get(`${this.baseUrl}/${e}/preview/${t}/logs`)}static \u0275fac=function(t){return new(t||s)};static \u0275prov=n({token:s,factory:s.\u0275fac,providedIn:"root"})};var P=class s{selectedProjectIdSubject=new i(null);isLoadingSubject=new i(!1);refreshTriggerSubject=new i(void 0);hasInitialized=!1;isLoading$=this.isLoadingSubject.asObservable();projectApi=c(a);projectListCall=this.refreshTriggerSubject.pipe(u(()=>this.projectApi.listProjects()),g({bufferSize:1,refCount:!0}));projectList$=this.projectListCall.pipe(l(e=>e.projects));forcedProject$=this.projectListCall.pipe(l(e=>e.forcedProject));selectedProject$=b([this.selectedProjectIdSubject,this.forcedProject$]).pipe(u(([e,t])=>{let r=t??e;return r?this.projectApi.getProject(r):d(null)}),o(e=>{e&&e.name!==this.selectedProjectIdSubject.value&&(console.log("[PROJECT-STATE] Backend returned different project name:",e.name),this.selectedProjectIdSubject.next(e.name))}),g({bufferSize:1,refCount:!0}));selectProject(e){console.log("[PROJECT-STATE] Explicit project selection:",e),this.forcedProject$.pipe(p(1)).subscribe(t=>this.selectedProjectIdSubject.next(t??e))}getSelectedProjectId(){return this.selectedProjectIdSubject.value}getSelectedProjectIdOrThrow(){let e=this.selectedProjectIdSubject.value;if(!e)throw new Error("[PROJECT_STATE] No project selected");return e}clearSelection(){console.log("[PROJECT-STATE] Clearing project selection"),this.selectedProjectIdSubject.next(null)}initializeDefaultProject(){return j(this,null,function*(){if(this.hasInitialized){console.log("[PROJECT-STATE] Already initialized, skipping");return}this.hasInitialized=!0;let e=yield this.projectApi.listProjects().pipe(p(1)).toPromise();if(!e){console.log("[PROJECT-STATE] No response from project API");return}let{defaultProject:t,forcedProject:r}=e;t&&!r?(console.log("[PROJECT-STATE] Initializing with default project:",t),this.selectedProjectIdSubject.next(t)):r?(console.log("[PROJECT-STATE] Initializing with forced project:",r),this.selectedProjectIdSubject.next(r)):console.log("[PROJECT-STATE] No default project, staying on selection page")})}createProject(e,t){return this.isLoadingSubject.next(!0),this.projectApi.createProject(e,t).pipe(o(()=>{this.isLoadingSubject.next(!1),this.refreshTriggerSubject.next()}))}deleteProject(e,t){return this.isLoadingSubject.next(!0),this.projectApi.deleteProject(e,t).pipe(o(()=>{this.isLoadingSubject.next(!1),this.refreshTriggerSubject.next(),this.selectedProjectIdSubject.value===e&&this.clearSelection()}))}static \u0275fac=function(t){return new(t||s)};static \u0275prov=n({token:s,factory:s.\u0275fac,providedIn:"root"})};export{a,P as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as O,R as V,S as z,T as F}from"./chunk-5MXEOOQM.js";import{b as D}from"./chunk-
|
|
1
|
+
import{P as O,R as V,S as z,T as F}from"./chunk-5MXEOOQM.js";import{b as D}from"./chunk-L72BYLQX.js";import{C as R,c as A,g as B,m as Q}from"./chunk-AE24ERN3.js";import{Ab as E,Cb as T,Db as I,Ea as C,Eb as N,Sa as u,T as b,Ta as g,X as v,Y as w,Ya as s,Za as i,_a as n,ca as x,gb as y,hc as S,ib as c,kb as _,ob as j,pb as P,qb as M,tc as k,ua as a,yb as l,zb as f}from"./chunk-TRUXCA4C.js";var H=["inputElement"];function G(o,r){if(o&1&&(i(0,"span",3),l(1),n()),o&2){let t=_();a(),f(t.label)}}function J(o,r){if(o&1&&(i(0,"small",5),l(1),n()),o&2){let t=_();a(),f(t.hint)}}var h=class o{label="";placeholder="";hint="";isDisabled=!1;value="";autoFocus=!0;valueChange=new x;enterPressed=new x;inputElement;inputValue="";ngAfterViewInit(){this.inputValue=this.value,this.autoFocus&&setTimeout(()=>this.inputElement?.nativeElement.focus(),100)}onValueChange(r){this.valueChange.emit(r)}onEnter(){this.inputValue.trim()&&this.enterPressed.emit(this.inputValue.trim())}focus(){this.inputElement?.nativeElement.focus()}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=C({type:o,selectors:[["app-text-input"]],viewQuery:function(t,e){if(t&1&&j(H,5),t&2){let p;P(p=M())&&(e.inputElement=p.first)}},inputs:{label:"label",placeholder:"placeholder",hint:"hint",isDisabled:"isDisabled",value:"value",autoFocus:"autoFocus"},outputs:{valueChange:"valueChange",enterPressed:"enterPressed"},decls:6,vars:5,consts:[["inputElement",""],[1,"text-input-container"],[1,"text-input-wrapper"],[1,"text-input-label"],["type","text",1,"text-input-field",3,"ngModelChange","keydown.enter","ngModel","placeholder","disabled"],[1,"text-input-hint"]],template:function(t,e){if(t&1){let p=y();i(0,"div",1)(1,"label",2),u(2,G,2,1,"span",3),i(3,"input",4,0),N("ngModelChange",function(m){return v(p),I(e.inputValue,m)||(e.inputValue=m),w(m)}),c("ngModelChange",function(m){return e.onValueChange(m)})("keydown.enter",function(){return e.onEnter()}),n()(),u(5,J,2,1,"small",5),n()}t&2&&(a(2),g(e.label?2:-1),a(),T("ngModel",e.inputValue),s("placeholder",e.placeholder)("disabled",e.isDisabled),a(2),g(e.hint?5:-1))},dependencies:[R,A,B,Q,S],styles:[".text-input-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%}.text-input-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%;cursor:text}.text-input-label[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text);margin:0}.text-input-field[_ngcontent-%COMP%]{width:100%;padding:.75rem 1rem;font-size:1rem;color:var(--color-text);background:var(--color-bg);border:1px solid var(--color-border);border-radius:8px;outline:none;transition:all .2s ease}.text-input-field[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary);opacity:.7}.text-input-field[_ngcontent-%COMP%]:focus{border-color:var(--color-primary);box-shadow:0 0 0 3px rgba(var(--color-primary-rgb),.1)}.text-input-field[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed;background:var(--color-surface)}.text-input-hint[_ngcontent-%COMP%]{font-size:.85rem;color:var(--color-text-secondary);margin:0;font-style:italic}@media(max-width:768px){.text-input-field[_ngcontent-%COMP%]{padding:.65rem .85rem;font-size:.95rem}.text-input-label[_ngcontent-%COMP%]{font-size:.9rem}.text-input-hint[_ngcontent-%COMP%]{font-size:.8rem}}"]})};function K(o,r){if(o&1&&(i(0,"div",8),l(1),n()),o&2){let t=_();a(),f(t.errorMessage)}}var W=class o{router=b(k);projectStateService=b(D);projectName="";projectPath="";isCreating=!1;errorMessage=null;isValid(){return this.projectName.trim()!==""&&this.projectPath.trim()!==""}onCreate(){if(!this.isValid()){this.errorMessage="Both name and path are required";return}this.isCreating=!0,this.errorMessage=null,this.projectStateService.createProject(this.projectName.trim(),this.projectPath.trim()).subscribe({next:()=>{let r=this.projectName.trim();this.isCreating=!1,this.projectStateService.selectProject(r),this.router.navigate(["project",r])},error:r=>{this.errorMessage=r.error?.error??"Failed to create project",this.isCreating=!1}})}onCancel(){this.router.navigate(["/"])}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=C({type:o,selectors:[["app-project-new"]],decls:19,vars:9,consts:[[1,"project-new-page"],[1,"project-new-card"],["mat-button","",1,"project-new__back",3,"click"],[1,"project-new__title"],[1,"project-new__subtitle"],[1,"project-new__form"],["label","Project name","placeholder","my-project",3,"valueChange","value","isDisabled","autoFocus"],["label","Project path","placeholder","/path/to/project","hint","Absolute path to the project directory",3,"valueChange","enterPressed","value","isDisabled"],[1,"project-new__error"],[1,"project-new__actions"],["mat-button","",3,"click","disabled"],["mat-flat-button","","color","primary",3,"click","disabled"]],template:function(t,e){t&1&&(i(0,"div",0)(1,"div",1)(2,"button",2),c("click",function(){return e.onCancel()}),i(3,"mat-icon"),l(4,"arrow_back"),n(),l(5," Back to projects "),n(),i(6,"h1",3),l(7,"New project"),n(),i(8,"p",4),l(9,"Point Coday to an existing directory on your machine."),n(),i(10,"div",5)(11,"app-text-input",6),c("valueChange",function(d){return e.projectName=d}),n(),i(12,"app-text-input",7),c("valueChange",function(d){return e.projectPath=d})("enterPressed",function(){return e.onCreate()}),n(),u(13,K,2,1,"div",8),n(),i(14,"div",9)(15,"button",10),c("click",function(){return e.onCancel()}),l(16,"Cancel"),n(),i(17,"button",11),c("click",function(){return e.onCreate()}),l(18),n()()()()),t&2&&(a(11),s("value",e.projectName)("isDisabled",e.isCreating)("autoFocus",!0),a(),s("value",e.projectPath)("isDisabled",e.isCreating),a(),g(e.errorMessage?13:-1),a(2),s("disabled",e.isCreating),a(2),s("disabled",!e.isValid()||e.isCreating),a(),E(" ",e.isCreating?"Creating\u2026":"Create project"," "))},dependencies:[V,O,F,z,h],styles:[".project-new-page[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:center;min-height:100vh;width:100%;background:var(--color-bg);padding:2rem 1.5rem;box-sizing:border-box}.project-new-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;width:100%;max-width:560px;padding:2rem;background:var(--color-bg-secondary, rgba(255, 255, 255, .7));border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:16px;box-shadow:var(--glass-shadow, 0 8px 32px rgba(31, 38, 135, .15));margin-top:2rem}.project-new__back[_ngcontent-%COMP%]{align-self:flex-start;margin-left:-.5rem;color:var(--color-text-secondary, #6e6e73)}.project-new__title[_ngcontent-%COMP%]{margin:0;font-size:1.625rem;font-weight:700;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.project-new__subtitle[_ngcontent-%COMP%]{margin:-.75rem 0 0;font-size:.9375rem;color:var(--color-text-secondary, #6e6e73)}.project-new__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.project-new__error[_ngcontent-%COMP%]{padding:.75rem 1rem;background:#dc262614;border:1px solid rgba(220,38,38,.25);border-radius:8px;color:var(--color-error, #ff3b30);font-size:.875rem}.project-new__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;justify-content:flex-end;padding-top:.25rem}"]})};export{W as ProjectNewComponent};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as st,b as dt}from"./chunk-ISPDD5IG.js";import{a as q,b as ct,c as ut,d as mt}from"./chunk-6F5GPHWV.js";import{a as _t,b as vt}from"./chunk-ORNGVCRW.js";import{a as gt,b as pt,c as ht,d as bt,e as ft}from"./chunk-AE2AQO4B.js";import{a as Le,b as We,d as Ne,e as Ge,f as Ue,g as je,h as ze}from"./chunk-OUZFS4TC.js";import{D as Ye,G as Ze,M as Je,N as et,O as tt,P as nt,S as at,T as ot,U as it,V as rt,W as lt,z as Xe}from"./chunk-4NNLWDVJ.js";import{G as Pe,J as Fe,K as Be,L as W,M as De,N as Re,O as Ve,P as Ae,R as N,S as U,T as j,h as Ie,i as Oe,s as ae,t as Ee}from"./chunk-5MXEOOQM.js";import{b as G}from"./chunk-L72BYLQX.js";import{A as Ke,C as H,a as $e,c as He,g as z,m as $,o as qe,z as Qe}from"./chunk-AE24ERN3.js";import"./chunk-VVZKXHDD.js";import{$a as Z,Ab as w,Cb as f,Db as _,Ea as I,Eb as v,Fa as ce,Ga as ue,Gb as ve,Hb as ye,Ib as Me,Ka as Y,O as re,Ob as Se,P as le,Q as se,Qa as V,Qb as Ce,R as X,Rb as xe,Sa as M,T as c,Ta as S,Ua as me,Wa as A,X as p,Xa as L,Xb as ne,Y as h,Ya as b,Yb as C,Za as i,_a as r,ca as R,db as ge,eb as pe,ga as k,gb as x,hc as ke,ib as g,ka as de,kb as u,lb as he,mb as be,nb as fe,ob as _e,oc as Te,pb as J,qb as ee,tc as we,ua as d,ub as F,wb as te,yb as s,zb as O}from"./chunk-TRUXCA4C.js";var E=class l{http=c(Te);projectState=c(G);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/schedulers`}listSchedulers(){return this.http.get(this.getBaseUrl())}getScheduler(a){return this.http.get(`${this.getBaseUrl()}/${a}`)}createScheduler(a){return this.http.post(this.getBaseUrl(),a)}updateScheduler(a,e){return this.http.put(`${this.getBaseUrl()}/${a}`,e)}deleteScheduler(a){return this.http.delete(`${this.getBaseUrl()}/${a}`)}enableScheduler(a){return this.http.post(`${this.getBaseUrl()}/${a}/enable`,{})}disableScheduler(a){return this.http.post(`${this.getBaseUrl()}/${a}/disable`,{})}runSchedulerNow(a){return this.http.post(`${this.getBaseUrl()}/${a}/run-now`,{})}static \u0275fac=function(e){return new(e||l)};static \u0275prov=le({token:l,factory:l.\u0275fac,providedIn:"root"})};var Pt=["button"],Ft=["*"];function Bt(l,a){if(l&1&&(i(0,"div",2),Z(1,"mat-pseudo-checkbox",6),r()),l&2){let e=u();d(),b("disabled",e.disabled)}}var yt=new X("MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS",{providedIn:"root",factory:()=>({hideSingleSelectionIndicator:!1,hideMultipleSelectionIndicator:!1,disabledInteractive:!1})}),Mt=new X("MatButtonToggleGroup"),Dt={provide:$e,useExisting:re(()=>ie),multi:!0},Q=class{source;value;constructor(a,e){this.source=a,this.value=e}},ie=(()=>{class l{_changeDetector=c(ne);_dir=c(De,{optional:!0});_multiple=!1;_disabled=!1;_disabledInteractive=!1;_selectionModel;_rawValue;_controlValueAccessorChangeFn=()=>{};_onTouched=()=>{};_buttonToggles;appearance;get name(){return this._name}set name(e){this._name=e,this._markButtonsForCheck()}_name=c(ae).getId("mat-button-toggle-group-");vertical=!1;get value(){let e=this._selectionModel?this._selectionModel.selected:[];return this.multiple?e.map(t=>t.value):e[0]?e[0].value:void 0}set value(e){this._setSelectionByValue(e),this.valueChange.emit(this.value)}valueChange=new R;get selected(){let e=this._selectionModel?this._selectionModel.selected:[];return this.multiple?e:e[0]||null}get multiple(){return this._multiple}set multiple(e){this._multiple=e,this._markButtonsForCheck()}get disabled(){return this._disabled}set disabled(e){this._disabled=e,this._markButtonsForCheck()}get disabledInteractive(){return this._disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e,this._markButtonsForCheck()}get dir(){return this._dir&&this._dir.value==="rtl"?"rtl":"ltr"}change=new R;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._markButtonsForCheck()}_hideSingleSelectionIndicator;get hideMultipleSelectionIndicator(){return this._hideMultipleSelectionIndicator}set hideMultipleSelectionIndicator(e){this._hideMultipleSelectionIndicator=e,this._markButtonsForCheck()}_hideMultipleSelectionIndicator;constructor(){let e=c(yt,{optional:!0});this.appearance=e&&e.appearance?e.appearance:"standard",this._hideSingleSelectionIndicator=e?.hideSingleSelectionIndicator??!1,this._hideMultipleSelectionIndicator=e?.hideMultipleSelectionIndicator??!1}ngOnInit(){this._selectionModel=new et(this.multiple,void 0,!1)}ngAfterContentInit(){this._selectionModel.select(...this._buttonToggles.filter(e=>e.checked)),this.multiple||this._initializeTabIndex()}writeValue(e){this.value=e,this._changeDetector.markForCheck()}registerOnChange(e){this._controlValueAccessorChangeFn=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e}_keydown(e){if(this.multiple||this.disabled||Ee(e))return;let n=e.target.id,o=this._buttonToggles.toArray().findIndex(T=>T.buttonId===n),m=null;switch(e.keyCode){case 32:case 13:m=this._buttonToggles.get(o)||null;break;case 38:m=this._getNextButton(o,-1);break;case 37:m=this._getNextButton(o,this.dir==="ltr"?-1:1);break;case 40:m=this._getNextButton(o,1);break;case 39:m=this._getNextButton(o,this.dir==="ltr"?1:-1);break;default:return}m&&(e.preventDefault(),m._onButtonClick(),m.focus())}_emitChangeEvent(e){let t=new Q(e,this.value);this._rawValue=t.value,this._controlValueAccessorChangeFn(t.value),this.change.emit(t)}_syncButtonToggle(e,t,n=!1,o=!1){!this.multiple&&this.selected&&!e.checked&&(this.selected.checked=!1),this._selectionModel?t?this._selectionModel.select(e):this._selectionModel.deselect(e):o=!0,o?Promise.resolve().then(()=>this._updateModelValue(e,n)):this._updateModelValue(e,n)}_isSelected(e){return this._selectionModel&&this._selectionModel.isSelected(e)}_isPrechecked(e){return typeof this._rawValue>"u"?!1:this.multiple&&Array.isArray(this._rawValue)?this._rawValue.some(t=>e.value!=null&&t===e.value):e.value===this._rawValue}_initializeTabIndex(){if(this._buttonToggles.forEach(e=>{e.tabIndex=-1}),this.selected)this.selected.tabIndex=0;else for(let e=0;e<this._buttonToggles.length;e++){let t=this._buttonToggles.get(e);if(!t.disabled){t.tabIndex=0;break}}}_getNextButton(e,t){let n=this._buttonToggles;for(let o=1;o<=n.length;o++){let m=(e+t*o+n.length)%n.length,T=n.get(m);if(T&&!T.disabled)return T}return null}_setSelectionByValue(e){if(this._rawValue=e,!this._buttonToggles)return;let t=this._buttonToggles.toArray();if(this.multiple&&e?(Array.isArray(e),this._clearSelection(),e.forEach(n=>this._selectValue(n,t))):(this._clearSelection(),this._selectValue(e,t)),!this.multiple&&t.every(n=>n.tabIndex===-1)){for(let n of t)if(!n.disabled){n.tabIndex=0;break}}}_clearSelection(){this._selectionModel.clear(),this._buttonToggles.forEach(e=>{e.checked=!1,this.multiple||(e.tabIndex=-1)})}_selectValue(e,t){for(let n of t)if(n.value===e){n.checked=!0,this._selectionModel.select(n),this.multiple||(n.tabIndex=0);break}}_updateModelValue(e,t){t&&this._emitChangeEvent(e),this.valueChange.emit(this.value)}_markButtonsForCheck(){this._buttonToggles?.forEach(e=>e._markForCheck())}static \u0275fac=function(t){return new(t||l)};static \u0275dir=ue({type:l,selectors:[["mat-button-toggle-group"]],contentQueries:function(t,n,o){if(t&1&&fe(o,K,5),t&2){let m;J(m=ee())&&(n._buttonToggles=m)}},hostAttrs:[1,"mat-button-toggle-group"],hostVars:6,hostBindings:function(t,n){t&1&&g("keydown",function(m){return n._keydown(m)}),t&2&&(V("role",n.multiple?"group":"radiogroup")("aria-disabled",n.disabled),te("mat-button-toggle-vertical",n.vertical)("mat-button-toggle-group-appearance-standard",n.appearance==="standard"))},inputs:{appearance:"appearance",name:"name",vertical:[2,"vertical","vertical",C],value:"value",multiple:[2,"multiple","multiple",C],disabled:[2,"disabled","disabled",C],disabledInteractive:[2,"disabledInteractive","disabledInteractive",C],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",C],hideMultipleSelectionIndicator:[2,"hideMultipleSelectionIndicator","hideMultipleSelectionIndicator",C]},outputs:{valueChange:"valueChange",change:"change"},exportAs:["matButtonToggleGroup"],features:[ve([Dt,{provide:Mt,useExisting:l}])]})}return l})(),K=(()=>{class l{_changeDetectorRef=c(ne);_elementRef=c(de);_focusMonitor=c(Ie);_idGenerator=c(ae);_animationDisabled=Pe();_checked=!1;ariaLabel;ariaLabelledby=null;_buttonElement;buttonToggleGroup;get buttonId(){return`${this.id}-button`}id;name;value;get tabIndex(){return this._tabIndex()}set tabIndex(e){this._tabIndex.set(e)}_tabIndex;disableRipple=!1;get appearance(){return this.buttonToggleGroup?this.buttonToggleGroup.appearance:this._appearance}set appearance(e){this._appearance=e}_appearance;get checked(){return this.buttonToggleGroup?this.buttonToggleGroup._isSelected(this):this._checked}set checked(e){e!==this._checked&&(this._checked=e,this.buttonToggleGroup&&this.buttonToggleGroup._syncButtonToggle(this,this._checked),this._changeDetectorRef.markForCheck())}get disabled(){return this._disabled||this.buttonToggleGroup&&this.buttonToggleGroup.disabled}set disabled(e){this._disabled=e}_disabled=!1;get disabledInteractive(){return this._disabledInteractive||this.buttonToggleGroup!==null&&this.buttonToggleGroup.disabledInteractive}set disabledInteractive(e){this._disabledInteractive=e}_disabledInteractive;change=new R;constructor(){c(Oe).load(Be);let e=c(Mt,{optional:!0}),t=c(new xe("tabindex"),{optional:!0})||"",n=c(yt,{optional:!0});this._tabIndex=k(parseInt(t)||0),this.buttonToggleGroup=e,this._appearance=n&&n.appearance?n.appearance:"standard",this._disabledInteractive=n?.disabledInteractive??!1}ngOnInit(){let e=this.buttonToggleGroup;this.id=this.id||this._idGenerator.getId("mat-button-toggle-"),e&&(e._isPrechecked(this)?this.checked=!0:e._isSelected(this)!==this._checked&&e._syncButtonToggle(this,this._checked))}ngAfterViewInit(){this._animationDisabled||this._elementRef.nativeElement.classList.add("mat-button-toggle-animations-enabled"),this._focusMonitor.monitor(this._elementRef,!0)}ngOnDestroy(){let e=this.buttonToggleGroup;this._focusMonitor.stopMonitoring(this._elementRef),e&&e._isSelected(this)&&e._syncButtonToggle(this,!1,!1,!0)}focus(e){this._buttonElement.nativeElement.focus(e)}_onButtonClick(){if(this.disabled)return;let e=this.isSingleSelector()?!0:!this._checked;if(e!==this._checked&&(this._checked=e,this.buttonToggleGroup&&(this.buttonToggleGroup._syncButtonToggle(this,this._checked,!0),this.buttonToggleGroup._onTouched())),this.isSingleSelector()){let t=this.buttonToggleGroup._buttonToggles.find(n=>n.tabIndex===0);t&&(t.tabIndex=-1),this.tabIndex=0}this.change.emit(new Q(this,this.value))}_markForCheck(){this._changeDetectorRef.markForCheck()}_getButtonName(){return this.isSingleSelector()?this.buttonToggleGroup.name:this.name||null}isSingleSelector(){return this.buttonToggleGroup&&!this.buttonToggleGroup.multiple}static \u0275fac=function(t){return new(t||l)};static \u0275cmp=I({type:l,selectors:[["mat-button-toggle"]],viewQuery:function(t,n){if(t&1&&_e(Pt,5),t&2){let o;J(o=ee())&&(n._buttonElement=o.first)}},hostAttrs:["role","presentation",1,"mat-button-toggle"],hostVars:14,hostBindings:function(t,n){t&1&&g("focus",function(){return n.focus()}),t&2&&(V("aria-label",null)("aria-labelledby",null)("id",n.id)("name",null),te("mat-button-toggle-standalone",!n.buttonToggleGroup)("mat-button-toggle-checked",n.checked)("mat-button-toggle-disabled",n.disabled)("mat-button-toggle-disabled-interactive",n.disabledInteractive)("mat-button-toggle-appearance-standard",n.appearance==="standard"))},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],id:"id",name:"name",value:"value",tabIndex:"tabIndex",disableRipple:[2,"disableRipple","disableRipple",C],appearance:"appearance",checked:[2,"checked","checked",C],disabled:[2,"disabled","disabled",C],disabledInteractive:[2,"disabledInteractive","disabledInteractive",C]},outputs:{change:"change"},exportAs:["matButtonToggle"],ngContentSelectors:Ft,decls:7,vars:13,consts:[["button",""],["type","button",1,"mat-button-toggle-button","mat-focus-indicator",3,"click","id","disabled"],[1,"mat-button-toggle-checkbox-wrapper"],[1,"mat-button-toggle-label-content"],[1,"mat-button-toggle-focus-overlay"],["matRipple","",1,"mat-button-toggle-ripple",3,"matRippleTrigger","matRippleDisabled"],["state","checked","aria-hidden","true","appearance","minimal",3,"disabled"]],template:function(t,n){if(t&1&&(he(),i(0,"button",1,0),g("click",function(){return n._onButtonClick()}),M(2,Bt,2,1,"div",2),i(3,"span",3),be(4),r()(),Z(5,"span",4)(6,"span",5)),t&2){let o=F(1);b("id",n.buttonId)("disabled",n.disabled&&!n.disabledInteractive||null),V("role",n.isSingleSelector()?"radio":"button")("tabindex",n.disabled&&!n.disabledInteractive?-1:n.tabIndex)("aria-pressed",n.isSingleSelector()?null:n.checked)("aria-checked",n.isSingleSelector()?n.checked:null)("name",n._getButtonName())("aria-label",n.ariaLabel)("aria-labelledby",n.ariaLabelledby)("aria-disabled",n.disabled&&n.disabledInteractive?"true":null),d(2),S(n.buttonToggleGroup&&(!n.buttonToggleGroup.multiple&&!n.buttonToggleGroup.hideSingleSelectionIndicator||n.buttonToggleGroup.multiple&&!n.buttonToggleGroup.hideMultipleSelectionIndicator)?2:-1),d(4),b("matRippleTrigger",o)("matRippleDisabled",n.disableRipple||n.disabled)}},dependencies:[Fe,Ye],styles:[`.mat-button-toggle-standalone,.mat-button-toggle-group{position:relative;display:inline-flex;flex-direction:row;white-space:nowrap;overflow:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0);border-radius:var(--mat-button-toggle-legacy-shape);transform:translateZ(0)}.mat-button-toggle-standalone:not([class*=mat-elevation-z]),.mat-button-toggle-group:not([class*=mat-elevation-z]){box-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)}@media(forced-colors: active){.mat-button-toggle-standalone,.mat-button-toggle-group{outline:solid 1px}}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{border-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard .mat-pseudo-checkbox,.mat-button-toggle-group-appearance-standard .mat-pseudo-checkbox{--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-button-toggle-selected-state-text-color, var(--mat-sys-on-secondary-container))}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard:not([class*=mat-elevation-z]),.mat-button-toggle-group-appearance-standard:not([class*=mat-elevation-z]){box-shadow:none}@media(forced-colors: active){.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{outline:0}}.mat-button-toggle-vertical{flex-direction:column}.mat-button-toggle-vertical .mat-button-toggle-label-content{display:block}.mat-button-toggle{white-space:nowrap;position:relative;color:var(--mat-button-toggle-legacy-text-color);font-family:var(--mat-button-toggle-legacy-label-text-font);font-size:var(--mat-button-toggle-legacy-label-text-size);line-height:var(--mat-button-toggle-legacy-label-text-line-height);font-weight:var(--mat-button-toggle-legacy-label-text-weight);letter-spacing:var(--mat-button-toggle-legacy-label-text-tracking);--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-button-toggle-legacy-selected-state-text-color)}.mat-button-toggle.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:var(--mat-button-toggle-legacy-focus-state-layer-opacity)}.mat-button-toggle .mat-icon svg{vertical-align:top}.mat-button-toggle-checkbox-wrapper{display:inline-block;justify-content:flex-start;align-items:center;width:0;height:18px;line-height:18px;overflow:hidden;box-sizing:border-box;position:absolute;top:50%;left:16px;transform:translate3d(0, -50%, 0)}[dir=rtl] .mat-button-toggle-checkbox-wrapper{left:auto;right:16px}.mat-button-toggle-appearance-standard .mat-button-toggle-checkbox-wrapper{left:12px}[dir=rtl] .mat-button-toggle-appearance-standard .mat-button-toggle-checkbox-wrapper{left:auto;right:12px}.mat-button-toggle-checked .mat-button-toggle-checkbox-wrapper{width:18px}.mat-button-toggle-animations-enabled .mat-button-toggle-checkbox-wrapper{transition:width 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-button-toggle-vertical .mat-button-toggle-checkbox-wrapper{transition:none}.mat-button-toggle-checked{color:var(--mat-button-toggle-legacy-selected-state-text-color);background-color:var(--mat-button-toggle-legacy-selected-state-background-color)}.mat-button-toggle-disabled{pointer-events:none;color:var(--mat-button-toggle-legacy-disabled-state-text-color);background-color:var(--mat-button-toggle-legacy-disabled-state-background-color);--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color: var(--mat-button-toggle-legacy-disabled-state-text-color)}.mat-button-toggle-disabled.mat-button-toggle-checked{background-color:var(--mat-button-toggle-legacy-disabled-selected-state-background-color)}.mat-button-toggle-disabled-interactive{pointer-events:auto}.mat-button-toggle-appearance-standard{color:var(--mat-button-toggle-text-color, var(--mat-sys-on-surface));background-color:var(--mat-button-toggle-background-color, transparent);font-family:var(--mat-button-toggle-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-button-toggle-label-text-size, var(--mat-sys-label-large-size));line-height:var(--mat-button-toggle-label-text-line-height, var(--mat-sys-label-large-line-height));font-weight:var(--mat-button-toggle-label-text-weight, var(--mat-sys-label-large-weight));letter-spacing:var(--mat-button-toggle-label-text-tracking, var(--mat-sys-label-large-tracking))}.mat-button-toggle-group-appearance-standard .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}[dir=rtl] .mat-button-toggle-group-appearance-standard .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:none;border-right:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle-appearance-standard+.mat-button-toggle-appearance-standard{border-left:none;border-right:none;border-top:solid 1px var(--mat-button-toggle-divider-color, var(--mat-sys-outline))}.mat-button-toggle-appearance-standard.mat-button-toggle-checked{color:var(--mat-button-toggle-selected-state-text-color, var(--mat-sys-on-secondary-container));background-color:var(--mat-button-toggle-selected-state-background-color, var(--mat-sys-secondary-container))}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled{color:var(--mat-button-toggle-disabled-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-button-toggle-disabled-state-background-color, transparent)}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled .mat-pseudo-checkbox{--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color: var(--mat-button-toggle-disabled-selected-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-button-toggle-appearance-standard.mat-button-toggle-disabled.mat-button-toggle-checked{color:var(--mat-button-toggle-disabled-selected-state-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-button-toggle-disabled-selected-state-background-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{background-color:var(--mat-button-toggle-state-layer-color, var(--mat-sys-on-surface))}.mat-button-toggle-appearance-standard:hover .mat-button-toggle-focus-overlay{opacity:var(--mat-button-toggle-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-button-toggle-appearance-standard.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:var(--mat-button-toggle-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}@media(hover: none){.mat-button-toggle-appearance-standard:hover .mat-button-toggle-focus-overlay{display:none}}.mat-button-toggle-label-content{-webkit-user-select:none;user-select:none;display:inline-block;padding:0 16px;line-height:var(--mat-button-toggle-legacy-height);position:relative}.mat-button-toggle-appearance-standard .mat-button-toggle-label-content{padding:0 12px;line-height:var(--mat-button-toggle-height, 40px)}.mat-button-toggle-label-content>*{vertical-align:middle}.mat-button-toggle-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit;pointer-events:none;opacity:0;background-color:var(--mat-button-toggle-legacy-state-layer-color)}@media(forced-colors: active){.mat-button-toggle-checked .mat-button-toggle-focus-overlay{border-bottom:solid 500px;opacity:.5;height:0}.mat-button-toggle-checked:hover .mat-button-toggle-focus-overlay{opacity:.6}.mat-button-toggle-checked.mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{border-bottom:solid 500px}}.mat-button-toggle .mat-button-toggle-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-button-toggle-button{border:0;background:none;color:inherit;padding:0;margin:0;font:inherit;outline:none;width:100%;cursor:pointer}.mat-button-toggle-animations-enabled .mat-button-toggle-button{transition:padding 150ms 45ms cubic-bezier(0.4, 0, 0.2, 1)}.mat-button-toggle-vertical .mat-button-toggle-button{transition:none}.mat-button-toggle-disabled .mat-button-toggle-button{cursor:default}.mat-button-toggle-button::-moz-focus-inner{border:0}.mat-button-toggle-checked .mat-button-toggle-button:has(.mat-button-toggle-checkbox-wrapper){padding-left:30px}[dir=rtl] .mat-button-toggle-checked .mat-button-toggle-button:has(.mat-button-toggle-checkbox-wrapper){padding-left:0;padding-right:30px}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard{--mat-focus-indicator-border-radius: var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard:not(.mat-button-toggle-vertical) .mat-button-toggle:last-of-type .mat-button-toggle-button::before{border-top-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-bottom-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard:not(.mat-button-toggle-vertical) .mat-button-toggle:first-of-type .mat-button-toggle-button::before{border-top-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-bottom-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle:last-of-type .mat-button-toggle-button::before{border-bottom-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-bottom-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}.mat-button-toggle-group-appearance-standard.mat-button-toggle-vertical .mat-button-toggle:first-of-type .mat-button-toggle-button::before{border-top-right-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large));border-top-left-radius:var(--mat-button-toggle-shape, var(--mat-sys-corner-extra-large))}
|
|
2
|
+
`],encapsulation:2,changeDetection:0})}return l})(),St=(()=>{class l{static \u0275fac=function(t){return new(t||l)};static \u0275mod=ce({type:l});static \u0275inj=se({imports:[Ve,K,Re]})}return l})();var Nt=(l,a)=>a.id,Gt=(l,a)=>a.value;function Ut(l,a){if(l&1&&(i(0,"mat-option",5),s(1),r()),l&2){let e=a.$implicit;b("value",e.id),d(),w(" ",e.name," ")}}function jt(l,a){if(l&1){let e=x();i(0,"mat-checkbox",35),g("change",function(){let n=p(e).$implicit,o=u();return h(o.toggleDayOfWeek(n.value))}),s(1),r()}if(l&2){let e=a.$implicit,t=u();b("checked",t.isDaySelected(e.value)),d(),w(" ",e.label," ")}}function zt(l,a){if(l&1){let e=x();i(0,"mat-form-field",2)(1,"mat-label"),s(2,"Number of Occurrences"),r(),i(3,"input",10),v("ngModelChange",function(n){p(e);let o=u();return _(o.endOccurrences,n)||(o.endOccurrences=n),h(n)}),r()()}if(l&2){let e=u();d(3),f("ngModel",e.endOccurrences)}}function $t(l,a){if(l&1){let e=x();i(0,"mat-form-field",2)(1,"mat-label"),s(2,"End Date"),r(),i(3,"input",36),v("ngModelChange",function(n){p(e);let o=u();return _(o.endTimestamp,n)||(o.endTimestamp=n),h(n)}),r()()}if(l&2){let e=u();d(3),f("ngModel",e.endTimestamp)}}function Ht(l,a){if(l&1){let e=x();i(0,"div")(1,"mat-form-field",2)(2,"mat-label"),s(3,"Parameter Value"),r(),i(4,"input",37),v("ngModelChange",function(n){p(e);let o=u();return _(o.simpleParameter,n)||(o.simpleParameter=n),h(n)}),r(),i(5,"mat-hint"),s(6),r()()()}if(l&2){let e=u();d(4),f("ngModel",e.simpleParameter),d(2),w("Simple value for ","{{PARAMETERS}}"," placeholder or appended to first command")}}function qt(l,a){if(l&1){let e=x();i(0,"div",40)(1,"mat-form-field",41)(2,"mat-label"),s(3,"Key"),r(),i(4,"input",42),v("ngModelChange",function(n){let o=p(e).$implicit;return _(o.key,n)||(o.key=n),h(n)}),r()(),i(5,"mat-form-field",43)(6,"mat-label"),s(7,"Value"),r(),i(8,"input",44),v("ngModelChange",function(n){let o=p(e).$implicit;return _(o.value,n)||(o.value=n),h(n)}),r()(),i(9,"button",45),g("click",function(){let n=p(e).$index,o=u(3);return h(o.removeParameter(n))}),i(10,"mat-icon"),s(11,"delete"),r()()()}if(l&2){let e=a.$implicit;d(4),f("ngModel",e.key),d(4),f("ngModel",e.value)}}function Qt(l,a){if(l&1&&(i(0,"div",39),A(1,qt,12,2,"div",40,me),r()),l&2){let e=u(2);d(),L(e.parameters)}}function Kt(l,a){if(l&1){let e=x();i(0,"div")(1,"div",26)(2,"button",38),g("click",function(){p(e);let n=u();return h(n.addParameter())}),i(3,"mat-icon"),s(4,"add"),r()()(),M(5,Qt,3,0,"div",39),i(6,"p",19),s(7),r()()}if(l&2){let e=u();d(5),S(e.parameters.length>0?5:-1),d(2),w("Key-value pairs for ","{{key}}"," placeholders in prompt commands")}}function Xt(l,a){if(l&1&&(i(0,"div",31)(1,"mat-icon"),s(2,"error"),r(),i(3,"span"),s(4),r()()),l&2){let e=u();d(4),O(e.errorMessage)}}var B=class l{schedulerApi=c(E);promptApi=c(q);dialogRef=c(Le);availablePrompts=[];isLoadingPrompts=!1;name="";promptId="";enabled=!0;startTimestamp="";intervalValue=1;intervalUnit="h";daysOfWeek=[];endConditionType="none";endOccurrences=10;endTimestamp="";parameterMode="simple";simpleParameter="";parameters=[];isSaving=!1;errorMessage="";isEditMode=!1;schedulerId="";data=c(We);daysOfWeekOptions=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:2,label:"Tuesday"},{value:3,label:"Wednesday"},{value:4,label:"Thursday"},{value:5,label:"Friday"},{value:6,label:"Saturday"}];constructor(){this.isEditMode=this.data.mode==="edit"}ngOnInit(){if(this.loadPrompts(),this.isEditMode||(this.startTimestamp=this.formatDateForInput(new Date)),this.isEditMode&&this.data.scheduler){if(this.schedulerId=this.data.scheduler.id,this.name=this.data.scheduler.name,this.promptId=this.data.scheduler.promptId,this.enabled=this.data.scheduler.enabled,this.data.scheduler.schedule.startTimestamp){let e=new Date(this.data.scheduler.schedule.startTimestamp);this.startTimestamp=this.formatDateForInput(e)}let a=this.data.scheduler.schedule.interval.match(/^(\d+)(min|h|d|M)$/);a&&a[1]&&a[2]&&(this.intervalValue=parseInt(a[1],10),this.intervalUnit=a[2]),this.daysOfWeek=this.data.scheduler.schedule.daysOfWeek||[],this.data.scheduler.schedule.endCondition&&(this.endConditionType=this.data.scheduler.schedule.endCondition.type,this.endConditionType==="occurrences"?this.endOccurrences=this.data.scheduler.schedule.endCondition.value:this.endConditionType==="endTimestamp"&&(this.endTimestamp=this.data.scheduler.schedule.endCondition.value)),this.data.scheduler.parameters&&(typeof this.data.scheduler.parameters=="object"&&Object.keys(this.data.scheduler.parameters).length===1&&"PARAMETERS"in this.data.scheduler.parameters?(this.parameterMode="simple",this.simpleParameter=String(this.data.scheduler.parameters.PARAMETERS)):(this.parameterMode="structured",this.parameters=Object.entries(this.data.scheduler.parameters).map(([e,t])=>({key:e,value:String(t)}))))}}loadPrompts(){this.isLoadingPrompts=!0,this.promptApi.listPrompts().subscribe({next:a=>{this.availablePrompts=a,this.isLoadingPrompts=!1},error:a=>{console.error("Error loading prompts:",a),this.errorMessage="Failed to load prompts",this.isLoadingPrompts=!1}})}toggleDayOfWeek(a){let e=this.daysOfWeek.indexOf(a);e>-1?this.daysOfWeek.splice(e,1):this.daysOfWeek.push(a),this.daysOfWeek.sort()}isDaySelected(a){return this.daysOfWeek.includes(a)}addParameter(){this.parameters.push({key:"",value:""})}removeParameter(a){this.parameters.splice(a,1)}trackByIndex(a){return a}formatDateForInput(a){let e=a.getFullYear(),t=String(a.getMonth()+1).padStart(2,"0"),n=String(a.getDate()).padStart(2,"0"),o=String(a.getHours()).padStart(2,"0"),m=String(a.getMinutes()).padStart(2,"0");return`${e}-${t}-${n}T${o}:${m}`}validateForm(){if(!this.name.trim())return this.errorMessage="Name is required",!1;if(!this.promptId)return this.errorMessage="Prompt is required",!1;if(this.intervalValue<1)return this.errorMessage="Interval must be at least 1",!1;switch(this.intervalUnit){case"min":if(this.intervalValue>59)return this.errorMessage="Minutes interval must be between 1 and 59 (use hours for longer)",!1;break;case"h":if(this.intervalValue>24)return this.errorMessage="Hours interval must be between 1 and 24 (use days for longer)",!1;break;case"d":if(this.intervalValue>31)return this.errorMessage="Days interval must be between 1 and 31 (use months for longer)",!1;break;case"M":if(this.intervalValue>12)return this.errorMessage="Months interval must be between 1 and 12",!1;break}return this.endConditionType==="occurrences"&&this.endOccurrences<1?(this.errorMessage="Occurrences must be at least 1",!1):this.endConditionType==="endTimestamp"&&!this.endTimestamp?(this.errorMessage="End date is required",!1):!0}buildSchedule(){let e={startTimestamp:(this.startTimestamp?new Date(this.startTimestamp):new Date).toISOString(),interval:`${this.intervalValue}${this.intervalUnit}`};return this.daysOfWeek.length>0&&(e.daysOfWeek=[...this.daysOfWeek]),this.endConditionType==="occurrences"?e.endCondition={type:"occurrences",value:this.endOccurrences}:this.endConditionType==="endTimestamp"&&(e.endCondition={type:"endTimestamp",value:this.endTimestamp}),e}buildParameters(){if(this.parameterMode==="simple")return this.simpleParameter.trim()?{PARAMETERS:this.simpleParameter.trim()}:void 0;let a=this.parameters.filter(t=>t.key.trim());if(a.length===0)return;let e={};return a.forEach(t=>{e[t.key]=t.value}),e}save(){if(this.errorMessage="",!this.validateForm())return;let a=this.buildSchedule(),e=this.buildParameters();this.isSaving=!0,this.isEditMode&&this.schedulerId?this.schedulerApi.updateScheduler(this.schedulerId,{name:this.name.trim(),enabled:this.enabled,promptId:this.promptId,schedule:a,parameters:e}).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:t=>{console.error("Error updating scheduler:",t),this.errorMessage=t?.error?.error||t?.message||"Failed to update scheduler",this.isSaving=!1}}):this.schedulerApi.createScheduler({name:this.name.trim(),promptId:this.promptId,schedule:a,parameters:e,enabled:this.enabled}).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:t=>{console.error("Error creating scheduler:",t),this.errorMessage=t?.error?.error||t?.message||"Failed to create scheduler",this.isSaving=!1}})}cancel(){this.dialogRef.close(!1)}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=I({type:l,selectors:[["app-scheduler-form"]],decls:89,vars:17,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","My Scheduler","required","",3,"ngModelChange","ngModel"],["required","",3,"ngModelChange","ngModel"],[3,"value"],["matInput","","type","datetime-local",3,"ngModelChange","ngModel"],[1,"interval-section"],[1,"interval-fields"],["appearance","outline",1,"interval-value"],["matInput","","type","number","min","1","required","",3,"ngModelChange","ngModel"],["appearance","outline",1,"interval-unit"],["value","min"],["value","h"],["value","d"],["value","M"],[1,"days-section"],[1,"days-checkboxes"],[3,"checked"],[1,"hint"],[1,"end-condition-section"],[3,"ngModelChange","ngModel"],["value","none"],["value","occurrences"],["value","endTimestamp"],[1,"parameters-section"],[1,"section-header"],[1,"mode-toggle",3,"ngModelChange","ngModel"],["value","simple"],["value","structured"],[1,"enabled-section"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],[3,"change","checked"],["matInput","","type","datetime-local","required","",3,"ngModelChange","ngModel"],["matInput","","placeholder","e.g., 1234 or staging",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Add parameter",3,"click"],[1,"parameters-list"],[1,"parameter-item"],["appearance","outline",1,"param-key"],["matInput","","placeholder","parameterName",3,"ngModelChange","ngModel"],["appearance","outline",1,"param-value"],["matInput","","placeholder","value",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove parameter",1,"remove-btn",3,"click"]],template:function(e,t){e&1&&(i(0,"h2",0),s(1),r(),i(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),s(6,"Name"),r(),i(7,"input",3),v("ngModelChange",function(o){return _(t.name,o)||(t.name=o),o}),r(),i(8,"mat-hint"),s(9,"A descriptive name for this scheduler"),r()(),i(10,"mat-form-field",2)(11,"mat-label"),s(12,"Prompt"),r(),i(13,"mat-select",4),v("ngModelChange",function(o){return _(t.promptId,o)||(t.promptId=o),o}),A(14,Ut,2,2,"mat-option",5,Nt),r(),i(16,"mat-hint"),s(17,"Select the prompt to execute"),r()(),i(18,"mat-form-field",2)(19,"mat-label"),s(20,"Start Date & Time"),r(),i(21,"input",6),v("ngModelChange",function(o){return _(t.startTimestamp,o)||(t.startTimestamp=o),o}),r(),i(22,"mat-hint"),s(23,"When to start the scheduler (leave empty for now)"),r()(),i(24,"div",7)(25,"h3"),s(26,"Schedule Interval"),r(),i(27,"div",8)(28,"mat-form-field",9)(29,"mat-label"),s(30,"Every"),r(),i(31,"input",10),v("ngModelChange",function(o){return _(t.intervalValue,o)||(t.intervalValue=o),o}),r()(),i(32,"mat-form-field",11)(33,"mat-label"),s(34,"Unit"),r(),i(35,"mat-select",4),v("ngModelChange",function(o){return _(t.intervalUnit,o)||(t.intervalUnit=o),o}),i(36,"mat-option",12),s(37,"Minutes (1-59)"),r(),i(38,"mat-option",13),s(39,"Hours (1-24)"),r(),i(40,"mat-option",14),s(41,"Days (1-31)"),r(),i(42,"mat-option",15),s(43,"Months (1-12)"),r()()()()(),i(44,"div",16)(45,"h3"),s(46,"Days of Week (Optional)"),r(),i(47,"div",17),A(48,jt,2,2,"mat-checkbox",18,Gt),r(),i(50,"p",19),s(51,"Leave empty to run every day"),r()(),i(52,"div",20)(53,"h3"),s(54,"End Condition (Optional)"),r(),i(55,"mat-form-field",2)(56,"mat-label"),s(57,"End Type"),r(),i(58,"mat-select",21),v("ngModelChange",function(o){return _(t.endConditionType,o)||(t.endConditionType=o),o}),i(59,"mat-option",22),s(60,"Never (run indefinitely)"),r(),i(61,"mat-option",23),s(62,"After X occurrences"),r(),i(63,"mat-option",24),s(64,"Until specific date"),r()()(),M(65,zt,4,1,"mat-form-field",2),M(66,$t,4,1,"mat-form-field",2),r(),i(67,"div",25)(68,"div",26)(69,"h3"),s(70,"Parameters (Optional)"),r(),i(71,"mat-button-toggle-group",27),v("ngModelChange",function(o){return _(t.parameterMode,o)||(t.parameterMode=o),o}),i(72,"mat-button-toggle",28),s(73,"Simple"),r(),i(74,"mat-button-toggle",29),s(75,"Structured"),r()()(),M(76,Ht,7,2,"div"),M(77,Kt,8,2,"div"),r(),i(78,"div",30)(79,"mat-checkbox",21),v("ngModelChange",function(o){return _(t.enabled,o)||(t.enabled=o),o}),s(80,"Enabled"),r(),i(81,"p",19),s(82,"Scheduler will only run if enabled"),r()(),M(83,Xt,5,1,"div",31),r()(),i(84,"mat-dialog-actions",32)(85,"button",33),g("click",function(){return t.cancel()}),s(86,"Cancel"),r(),i(87,"button",34),g("click",function(){return t.save()}),s(88),r()()),e&2&&(d(),O(t.isEditMode?"Edit Scheduler":"Create Scheduler"),d(6),f("ngModel",t.name),d(6),f("ngModel",t.promptId),d(),L(t.availablePrompts),d(7),f("ngModel",t.startTimestamp),d(10),f("ngModel",t.intervalValue),d(4),f("ngModel",t.intervalUnit),d(13),L(t.daysOfWeekOptions),d(10),f("ngModel",t.endConditionType),d(7),S(t.endConditionType==="occurrences"?65:-1),d(),S(t.endConditionType==="endTimestamp"?66:-1),d(5),f("ngModel",t.parameterMode),d(5),S(t.parameterMode==="simple"?76:-1),d(),S(t.parameterMode==="structured"?77:-1),d(2),f("ngModel",t.enabled),d(4),S(t.errorMessage?83:-1),d(2),b("disabled",t.isSaving),d(2),b("disabled",t.isSaving),d(),w(" ",t.isSaving?"Saving...":"Save"," "))},dependencies:[ke,H,He,qe,z,Ke,Qe,$,ze,Ge,je,Ue,N,Ae,W,rt,it,at,tt,nt,ot,j,U,vt,_t,Ze,dt,st,St,ie,K],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:600px}@media(max-width:768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.interval-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem;font-weight:600}.interval-section[_ngcontent-%COMP%] .interval-fields[_ngcontent-%COMP%]{display:flex;gap:1rem}.interval-section[_ngcontent-%COMP%] .interval-fields[_ngcontent-%COMP%] .interval-value[_ngcontent-%COMP%], .interval-section[_ngcontent-%COMP%] .interval-fields[_ngcontent-%COMP%] .interval-unit[_ngcontent-%COMP%]{flex:1}.days-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem;font-weight:600}.days-section[_ngcontent-%COMP%] .days-checkboxes[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem;margin-bottom:.5rem}.days-section[_ngcontent-%COMP%] .days-checkboxes[_ngcontent-%COMP%] mat-checkbox[_ngcontent-%COMP%]{min-width:120px}.days-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary)}.end-condition-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .5rem;font-size:1rem;font-weight:600}.parameters-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:.5rem}.parameters-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.parameters-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] .mode-toggle[_ngcontent-%COMP%]{height:32px}.parameters-section[_ngcontent-%COMP%] .parameters-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%] .param-key[_ngcontent-%COMP%]{flex:1}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%] .param-value[_ngcontent-%COMP%]{flex:2}.parameters-section[_ngcontent-%COMP%] .parameter-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{margin-top:8px}.parameters-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.85rem;color:var(--color-text-secondary)}.enabled-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.enabled-section[_ngcontent-%COMP%] mat-checkbox[_ngcontent-%COMP%]{display:block;margin-bottom:.5rem}.enabled-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}"]})};var Yt=()=>[],Zt=l=>({id:l});function Jt(l,a){if(l&1&&(i(0,"div",6),s(1),r()),l&2){let e=u();d(),O(e.errorMessage())}}function en(l,a){if(l&1){let e=x();i(0,"ds-entity-card",8),g("selected",function(n){p(e);let o=u();return h(o.onEdit(n))}),ge(1,9),i(2,"button",10),g("click",function(n){return n.stopPropagation()}),i(3,"mat-icon"),s(4,"more_vert"),r()(),pe(),r()}if(l&2){let e=a.$implicit;u();let t=F(11);b("id",e.id)("name",e.name)("description",e.description)("badges",e.badges??ye(6,Yt)),d(2),b("matMenuTriggerFor",t)("matMenuTriggerData",Me(7,Zt,e.id))}}function tn(l,a){if(l&1){let e=x();i(0,"button",11),g("click",function(){let n=p(e).id,o=u();return h(o.onEdit(n))}),i(1,"mat-icon"),s(2,"edit"),r(),s(3," Edit "),r(),i(4,"button",11),g("click",function(){let n=p(e).id,o=u();return h(o.onToggleEnabled(n))}),i(5,"mat-icon"),s(6),r(),s(7),r(),i(8,"button",11),g("click",function(){let n=p(e).id,o=u();return h(o.onRunNow(n))}),i(9,"mat-icon"),s(10,"play_arrow"),r(),s(11," Run now "),r(),i(12,"button",12),g("click",function(){let n=p(e).id,o=u();return h(o.onDelete(n))}),i(13,"mat-icon"),s(14,"delete"),r(),s(15," Delete "),r()}if(l&2){let e=a.id,t=u();d(6),O(t.isEnabled(e)?"pause_circle":"play_circle"),d(),w(" ",t.isEnabled(e)?"Disable":"Enable"," ")}}var Ct=class l{schedulerApi=c(E);promptApi=c(q);configApi=c(ct);projectState=c(G);dialog=c(Ne);router=c(we);schedulers=k([]);prompts=k([]);isLoading=k(!1);errorMessage=k(null);showOnlyMine=k(!0);currentUsername=k("");schedulerItems=Ce(()=>{let a=this.schedulers(),e=this.currentUsername(),n=this.showOnlyMine()&&e?a.filter(y=>this.isMyScheduler(y)):a,m=[...new Set(n.map(y=>y.createdBy))].sort((y,P)=>y===e&&P!==e?-1:P===e&&y!==e?1:y.localeCompare(P)),T=[];for(let y of m){let P=y===e?`${y} (you)`:y;for(let D of n.filter(xt=>xt.createdBy===y))T.push({id:D.id,name:D.name,description:this.buildDescription(D),badges:this.buildBadges(D),groupKey:y,groupLabel:P})}return T});ngOnInit(){this.configApi.getUserConfig().subscribe({next:a=>this.currentUsername.set(a.username??""),error:()=>{}}),this.loadPrompts(),this.loadSchedulers()}loadPrompts(){this.promptApi.listPrompts().subscribe({next:a=>this.prompts.set(a),error:()=>{}})}loadSchedulers(){this.isLoading.set(!0),this.schedulerApi.listSchedulers().subscribe({next:a=>{this.schedulers.set(a),this.isLoading.set(!1)},error:a=>{this.errorMessage.set(a?.error?.error??"Failed to load schedulers"),this.isLoading.set(!1)}})}onBack(){let a=this.projectState.getSelectedProjectId();this.router.navigate(a?["project",a]:["/"])}onCreate(){this.dialog.open(B,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadSchedulers()})}onEdit(a){this.schedulerApi.getScheduler(a).subscribe({next:e=>{this.dialog.open(B,{width:"700px",maxHeight:"90vh",data:{mode:"edit",scheduler:e}}).afterClosed().subscribe(n=>{n&&this.loadSchedulers()})},error:e=>this.errorMessage.set(e?.error?.error??"Failed to load scheduler")})}onToggleEnabled(a){let e=this.schedulers().find(n=>n.id===a);if(!e)return;(e.enabled?this.schedulerApi.disableScheduler(a):this.schedulerApi.enableScheduler(a)).subscribe({next:()=>this.loadSchedulers(),error:n=>this.errorMessage.set(n?.error?.error??"Failed to toggle scheduler")})}onRunNow(a){this.schedulerApi.runSchedulerNow(a).subscribe({next:e=>{alert(`Scheduler executed successfully! Thread ID: ${e.threadId}`),this.loadSchedulers()},error:e=>this.errorMessage.set(e?.error?.error??"Failed to run scheduler")})}onDelete(a){confirm("Are you sure you want to delete this scheduler?")&&this.schedulerApi.deleteScheduler(a).subscribe({next:()=>this.loadSchedulers(),error:e=>this.errorMessage.set(e?.error?.error??"Failed to delete scheduler")})}isEnabled(a){return this.schedulers().find(e=>e.id===a)?.enabled??!1}buildDescription(a){let e=this.getPromptName(a.promptId),t=this.formatInterval(a.schedule.interval),n=a.nextRun?new Date(a.nextRun).toLocaleString():"Expired";return`${e} \xB7 ${t} \xB7 Next: ${n}`}buildBadges(a){return[a.enabled?{label:"enabled",variant:"success"}:{label:"disabled",variant:"warning"}]}getPromptName(a){let e=this.prompts().find(t=>t.id===a);return e?e.name:a}formatInterval(a){let e=/^(\d+)(min|h|d|M)$/.exec(a);if(!e)return a;let[,t,n]=e;if(!t||!n)return a;let m={min:"minute",h:"hour",d:"day",M:"month"}[n]??n;return`Every ${t} ${m}${parseInt(t,10)>1?"s":""}`}isMyScheduler(a){let e=t=>t.replace(/[.\s]+/g,"_").toLowerCase();return e(a.createdBy)===e(this.currentUsername())}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=I({type:l,selectors:[["app-scheduler-list"]],decls:13,vars:5,consts:[["schedulerCard",""],["cardMenu","matMenu"],[1,"scheduler-list-page"],["title","Schedulers","cardMinWidth","384px","contentMaxWidth","1400px","searchPlaceholder","Filter schedulers\u2026","emptyMessage","No schedulers found.",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","mat-icon-button","","title","Back",3,"click"],["toolbar-extras","","color","primary",1,"scheduler-list__mine-toggle",3,"ngModelChange","ngModel"],[1,"scheduler-list__error"],["matMenuContent",""],[3,"selected","id","name","description","badges"],["dsCardActions",""],["mat-icon-button","",3,"click","matMenuTriggerFor","matMenuTriggerData"],["mat-menu-item","",3,"click"],["mat-menu-item","",1,"scheduler-list__delete-item",3,"click"]],template:function(e,t){if(e&1&&(i(0,"div",2)(1,"ds-entity-list",3),g("createRequested",function(){return t.onCreate()}),i(2,"button",4),g("click",function(){return t.onBack()}),i(3,"mat-icon"),s(4,"chevron_left"),r()(),i(5,"mat-slide-toggle",5),g("ngModelChange",function(o){return t.showOnlyMine.set(o)}),s(6," Mine "),r()(),M(7,Jt,2,1,"div",6),r(),Y(8,en,5,9,"ng-template",null,0,Se),i(10,"mat-menu",null,1),Y(12,tn,16,2,"ng-template",7),r()),e&2){let n=F(9);d(),b("items",t.schedulerItems())("showCreate",!0)("itemTemplate",n),d(4),b("ngModel",t.showOnlyMine()),d(2),S(t.errorMessage()?7:-1)}},dependencies:[lt,Je,Xe,N,W,j,U,mt,ut,ft,ht,gt,pt,bt,H,z,$],styles:["[_nghost-%COMP%]{display:block;width:100%;min-height:100vh;background:var(--color-bg);overflow-y:auto}.scheduler-list__mine-toggle[_ngcontent-%COMP%]{flex-shrink:0;font-size:.875rem}.scheduler-list__delete-item[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.scheduler-list__delete-item[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:inherit}.scheduler-list__error[_ngcontent-%COMP%]{margin:1rem auto;max-width:900px;padding:.75rem 1rem;background:#dc262614;border:1px solid rgba(220,38,38,.25);border-radius:8px;color:var(--color-error, #ff3b30);font-size:.875rem}"]})};export{Ct as SchedulerListComponent};
|
package/browser/index.html
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
<base href="/">
|
|
11
11
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
12
12
|
<link rel="icon" type="image/x-icon" href="CODAY-Logo.png">
|
|
13
|
-
<style>:root{--color-bg:linear-gradient(135deg, #fafbfc 0%, #f5f6f8 100%);--color-bg-solid:#fafbfc;--color-bg-secondary:rgba(255, 255, 255, .7);--color-bg-secondary-rgb:255 255 255;--color-text:#1d1d1f;--color-text-secondary:#6e6e73;--color-text-inverse:#ffffff;--color-primary:#007aff;--color-primary-hover:#0051d5;--color-accent:#8b5cf6;--color-link:#007aff;--color-border:rgba(0, 0, 0, .1);--color-border-light:rgba(40, 40, 40, .08);--color-input-bg:rgba(255, 255, 255, .8);--color-success:#34c759;--color-error:#ff3b30;--color-warning:#ff9500;--color-info:#5ac8fa;--color-message-user:rgba(0, 122, 255, .1);--color-message-ai:rgba(255, 255, 255, .8);--color-code-bg:rgba(142, 142, 147, .12);--color-code-text:#ff375f;--color-bg-hover:rgba(0, 0, 0, .04);--glass-bg:rgba(255, 255, 255, .72);--glass-border:rgba(255, 255, 255, .18);--glass-shadow:0 8px 32px 0 rgba(31, 38, 135, .15);--glass-backdrop-blur:blur(20px);--color-modal-bg:#ffffff;--color-modal-border:rgba(0, 0, 0, .12);--color-modal-shadow:0 8px 40px rgba(0, 0, 0, .18), 0 2px 8px rgba(0, 0, 0, .1);--color-shadow:rgba(0, 0, 0, .08);--color-overlay:rgba(0, 0, 0, .4)}@media print{html,body,app-root{height:auto!important;max-height:none!important;min-height:auto!important;overflow:visible!important;position:static!important}body{background:#fff!important;color:#000!important;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif!important;font-size:11pt;line-height:1.6;padding:1rem!important}*{animation:none!important;transition:none!important;box-shadow:none!important;text-shadow:none!important}}*{box-sizing:border-box}html{color-scheme:light}html{--mat-sys-background:light-dark(#faf9fd, #121316);--mat-sys-error:light-dark(#ba1a1a, #ffb4ab);--mat-sys-error-container:light-dark(#ffdad6, #93000a);--mat-sys-inverse-on-surface:light-dark(#f2f0f4, #2f3033);--mat-sys-inverse-primary:light-dark(#abc7ff, #005cbb);--mat-sys-inverse-surface:light-dark(#2f3033, #e3e2e6);--mat-sys-on-background:light-dark(#1a1b1f, #e3e2e6);--mat-sys-on-error:light-dark(#ffffff, #690005);--mat-sys-on-error-container:light-dark(#93000a, #ffdad6);--mat-sys-on-primary:light-dark(#ffffff, #002f65);--mat-sys-on-primary-container:light-dark(#00458f, #d7e3ff);--mat-sys-on-primary-fixed:light-dark(#001b3f, #001b3f);--mat-sys-on-primary-fixed-variant:light-dark(#00458f, #00458f);--mat-sys-on-secondary:light-dark(#ffffff, #283041);--mat-sys-on-secondary-container:light-dark(#3e4759, #dae2f9);--mat-sys-on-secondary-fixed:light-dark(#131c2b, #131c2b);--mat-sys-on-secondary-fixed-variant:light-dark(#3e4759, #3e4759);--mat-sys-on-surface:light-dark(#1a1b1f, #e3e2e6);--mat-sys-on-surface-variant:light-dark(#44474e, #e0e2ec);--mat-sys-on-tertiary:light-dark(#ffffff, #002f65);--mat-sys-on-tertiary-container:light-dark(#00458f, #d7e3ff);--mat-sys-on-tertiary-fixed:light-dark(#001b3f, #001b3f);--mat-sys-on-tertiary-fixed-variant:light-dark(#00458f, #00458f);--mat-sys-outline:light-dark(#74777f, #8e9099);--mat-sys-outline-variant:light-dark(#c4c6d0, #44474e);--mat-sys-primary:light-dark(#005cbb, #abc7ff);--mat-sys-primary-container:light-dark(#d7e3ff, #00458f);--mat-sys-primary-fixed:light-dark(#d7e3ff, #d7e3ff);--mat-sys-primary-fixed-dim:light-dark(#abc7ff, #abc7ff);--mat-sys-scrim:light-dark(#000000, #000000);--mat-sys-secondary:light-dark(#565e71, #bec6dc);--mat-sys-secondary-container:light-dark(#dae2f9, #3e4759);--mat-sys-secondary-fixed:light-dark(#dae2f9, #dae2f9);--mat-sys-secondary-fixed-dim:light-dark(#bec6dc, #bec6dc);--mat-sys-shadow:light-dark(#000000, #000000);--mat-sys-surface:light-dark(#faf9fd, #121316);--mat-sys-surface-bright:light-dark(#faf9fd, #38393c);--mat-sys-surface-container:light-dark(#efedf0, #1f2022);--mat-sys-surface-container-high:light-dark(#e9e7eb, #292a2c);--mat-sys-surface-container-highest:light-dark(#e3e2e6, #343537);--mat-sys-surface-container-low:light-dark(#f4f3f6, #1a1b1f);--mat-sys-surface-container-lowest:light-dark(#ffffff, #0d0e11);--mat-sys-surface-dim:light-dark(#dbd9dd, #121316);--mat-sys-surface-tint:light-dark(#005cbb, #abc7ff);--mat-sys-surface-variant:light-dark(#e0e2ec, #44474e);--mat-sys-tertiary:light-dark(#005cbb, #abc7ff);--mat-sys-tertiary-container:light-dark(#d7e3ff, #00458f);--mat-sys-tertiary-fixed:light-dark(#d7e3ff, #d7e3ff);--mat-sys-tertiary-fixed-dim:light-dark(#abc7ff, #abc7ff);--mat-sys-neutral-variant20:#2d3038;--mat-sys-neutral10:#1a1b1f;--mat-sys-level0:0px 0px 0px 0px rgba(0, 0, 0, .2), 0px 0px 0px 0px rgba(0, 0, 0, .14), 0px 0px 0px 0px rgba(0, 0, 0, .12);--mat-sys-level1:0px 2px 1px -1px rgba(0, 0, 0, .2), 0px 1px 1px 0px rgba(0, 0, 0, .14), 0px 1px 3px 0px rgba(0, 0, 0, .12);--mat-sys-level2:0px 3px 3px -2px rgba(0, 0, 0, .2), 0px 3px 4px 0px rgba(0, 0, 0, .14), 0px 1px 8px 0px rgba(0, 0, 0, .12);--mat-sys-level3:0px 3px 5px -1px rgba(0, 0, 0, .2), 0px 6px 10px 0px rgba(0, 0, 0, .14), 0px 1px 18px 0px rgba(0, 0, 0, .12);--mat-sys-level4:0px 5px 5px -3px rgba(0, 0, 0, .2), 0px 8px 10px 1px rgba(0, 0, 0, .14), 0px 3px 14px 2px rgba(0, 0, 0, .12);--mat-sys-level5:0px 7px 8px -4px rgba(0, 0, 0, .2), 0px 12px 17px 2px rgba(0, 0, 0, .14), 0px 5px 22px 4px rgba(0, 0, 0, .12);--mat-sys-body-large:400 1rem / 1.5rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-large-line-height:1.5rem;--mat-sys-body-large-size:1rem;--mat-sys-body-large-tracking:.031rem;--mat-sys-body-large-weight:400;--mat-sys-body-medium:400 .875rem / 1.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-medium-line-height:1.25rem;--mat-sys-body-medium-size:.875rem;--mat-sys-body-medium-tracking:.016rem;--mat-sys-body-medium-weight:400;--mat-sys-body-small:400 .75rem / 1rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-small-line-height:1rem;--mat-sys-body-small-size:.75rem;--mat-sys-body-small-tracking:.025rem;--mat-sys-body-small-weight:400;--mat-sys-display-large:400 3.562rem / 4rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-large-line-height:4rem;--mat-sys-display-large-size:3.562rem;--mat-sys-display-large-tracking:-.016rem;--mat-sys-display-large-weight:400;--mat-sys-display-medium:400 2.812rem / 3.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-medium-line-height:3.25rem;--mat-sys-display-medium-size:2.812rem;--mat-sys-display-medium-tracking:0;--mat-sys-display-medium-weight:400;--mat-sys-display-small:400 2.25rem / 2.75rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-small-line-height:2.75rem;--mat-sys-display-small-size:2.25rem;--mat-sys-display-small-tracking:0;--mat-sys-display-small-weight:400;--mat-sys-headline-large:400 2rem / 2.5rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-large-line-height:2.5rem;--mat-sys-headline-large-size:2rem;--mat-sys-headline-large-tracking:0;--mat-sys-headline-large-weight:400;--mat-sys-headline-medium:400 1.75rem / 2.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-medium-line-height:2.25rem;--mat-sys-headline-medium-size:1.75rem;--mat-sys-headline-medium-tracking:0;--mat-sys-headline-medium-weight:400;--mat-sys-headline-small:400 1.5rem / 2rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-small-line-height:2rem;--mat-sys-headline-small-size:1.5rem;--mat-sys-headline-small-tracking:0;--mat-sys-headline-small-weight:400;--mat-sys-label-large:500 .875rem / 1.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-large-line-height:1.25rem;--mat-sys-label-large-size:.875rem;--mat-sys-label-large-tracking:.006rem;--mat-sys-label-large-weight:500;--mat-sys-label-large-weight-prominent:700;--mat-sys-label-medium:500 .75rem / 1rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-medium-line-height:1rem;--mat-sys-label-medium-size:.75rem;--mat-sys-label-medium-tracking:.031rem;--mat-sys-label-medium-weight:500;--mat-sys-label-medium-weight-prominent:700;--mat-sys-label-small:500 .688rem / 1rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-small-line-height:1rem;--mat-sys-label-small-size:.688rem;--mat-sys-label-small-tracking:.031rem;--mat-sys-label-small-weight:500;--mat-sys-title-large:400 1.375rem / 1.75rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-large-line-height:1.75rem;--mat-sys-title-large-size:1.375rem;--mat-sys-title-large-tracking:0;--mat-sys-title-large-weight:400;--mat-sys-title-medium:500 1rem / 1.5rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-medium-line-height:1.5rem;--mat-sys-title-medium-size:1rem;--mat-sys-title-medium-tracking:.009rem;--mat-sys-title-medium-weight:500;--mat-sys-title-small:500 .875rem / 1.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-small-line-height:1.25rem;--mat-sys-title-small-size:.875rem;--mat-sys-title-small-tracking:.006rem;--mat-sys-title-small-weight:500;--mat-sys-corner-extra-large:28px;--mat-sys-corner-extra-large-top:28px 28px 0 0;--mat-sys-corner-extra-small:4px;--mat-sys-corner-extra-small-top:4px 4px 0 0;--mat-sys-corner-full:9999px;--mat-sys-corner-large:16px;--mat-sys-corner-large-end:0 16px 16px 0;--mat-sys-corner-large-start:16px 0 0 16px;--mat-sys-corner-large-top:16px 16px 0 0;--mat-sys-corner-medium:12px;--mat-sys-corner-none:0;--mat-sys-corner-small:8px;--mat-sys-dragged-state-layer-opacity:.16;--mat-sys-focus-state-layer-opacity:.12;--mat-sys-hover-state-layer-opacity:.08;--mat-sys-pressed-state-layer-opacity:.12;--mat-snack-bar-container-shape:transparent;--mat-snack-bar-container-color:transparent;--mat-snack-bar-supporting-text-color:var(--color-text)}html,body{margin:0;padding:0;width:100%;height:100%}body{background:var(--color-bg);color:var(--color-text);font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,Segoe UI,Helvetica Neue,Arial,sans-serif;transition:background .3s ease,color .3s ease;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;padding:0!important}</style><link rel="stylesheet" href="styles-TOOGLXPX.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles-TOOGLXPX.css"></noscript></head>
|
|
13
|
+
<style>:root{--color-bg:linear-gradient(135deg, #fafbfc 0%, #f5f6f8 100%);--color-bg-solid:#fafbfc;--color-bg-secondary:rgba(255, 255, 255, .7);--color-bg-secondary-rgb:255 255 255;--color-text:#1d1d1f;--color-text-secondary:#6e6e73;--color-text-inverse:#ffffff;--color-primary:#007aff;--color-primary-hover:#0051d5;--color-accent:#8b5cf6;--color-link:#007aff;--color-border:rgba(0, 0, 0, .1);--color-border-light:rgba(40, 40, 40, .08);--color-input-bg:rgba(255, 255, 255, .8);--color-success:#34c759;--color-error:#ff3b30;--color-warning:#ff9500;--color-info:#5ac8fa;--color-message-user:rgba(0, 122, 255, .1);--color-message-ai:rgba(255, 255, 255, .8);--color-code-bg:rgba(142, 142, 147, .12);--color-code-text:#ff375f;--color-bg-hover:rgba(0, 0, 0, .04);--glass-bg:rgba(255, 255, 255, .72);--glass-border:rgba(255, 255, 255, .18);--glass-shadow:0 8px 32px 0 rgba(31, 38, 135, .15);--glass-backdrop-blur:blur(20px);--color-modal-bg:#ffffff;--color-modal-border:rgba(0, 0, 0, .12);--color-modal-shadow:0 8px 40px rgba(0, 0, 0, .18), 0 2px 8px rgba(0, 0, 0, .1);--color-shadow:rgba(0, 0, 0, .08);--color-overlay:rgba(0, 0, 0, .4)}@media print{html,body,app-root{height:auto!important;max-height:none!important;min-height:auto!important;overflow:visible!important;position:static!important}body{background:#fff!important;color:#000!important;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif!important;font-size:11pt;line-height:1.6;padding:1rem!important}*{animation:none!important;transition:none!important;box-shadow:none!important;text-shadow:none!important}}*{box-sizing:border-box}html{color-scheme:light}html{--mat-sys-background:light-dark(#faf9fd, #121316);--mat-sys-error:light-dark(#ba1a1a, #ffb4ab);--mat-sys-error-container:light-dark(#ffdad6, #93000a);--mat-sys-inverse-on-surface:light-dark(#f2f0f4, #2f3033);--mat-sys-inverse-primary:light-dark(#abc7ff, #005cbb);--mat-sys-inverse-surface:light-dark(#2f3033, #e3e2e6);--mat-sys-on-background:light-dark(#1a1b1f, #e3e2e6);--mat-sys-on-error:light-dark(#ffffff, #690005);--mat-sys-on-error-container:light-dark(#93000a, #ffdad6);--mat-sys-on-primary:light-dark(#ffffff, #002f65);--mat-sys-on-primary-container:light-dark(#00458f, #d7e3ff);--mat-sys-on-primary-fixed:light-dark(#001b3f, #001b3f);--mat-sys-on-primary-fixed-variant:light-dark(#00458f, #00458f);--mat-sys-on-secondary:light-dark(#ffffff, #283041);--mat-sys-on-secondary-container:light-dark(#3e4759, #dae2f9);--mat-sys-on-secondary-fixed:light-dark(#131c2b, #131c2b);--mat-sys-on-secondary-fixed-variant:light-dark(#3e4759, #3e4759);--mat-sys-on-surface:light-dark(#1a1b1f, #e3e2e6);--mat-sys-on-surface-variant:light-dark(#44474e, #e0e2ec);--mat-sys-on-tertiary:light-dark(#ffffff, #002f65);--mat-sys-on-tertiary-container:light-dark(#00458f, #d7e3ff);--mat-sys-on-tertiary-fixed:light-dark(#001b3f, #001b3f);--mat-sys-on-tertiary-fixed-variant:light-dark(#00458f, #00458f);--mat-sys-outline:light-dark(#74777f, #8e9099);--mat-sys-outline-variant:light-dark(#c4c6d0, #44474e);--mat-sys-primary:light-dark(#005cbb, #abc7ff);--mat-sys-primary-container:light-dark(#d7e3ff, #00458f);--mat-sys-primary-fixed:light-dark(#d7e3ff, #d7e3ff);--mat-sys-primary-fixed-dim:light-dark(#abc7ff, #abc7ff);--mat-sys-scrim:light-dark(#000000, #000000);--mat-sys-secondary:light-dark(#565e71, #bec6dc);--mat-sys-secondary-container:light-dark(#dae2f9, #3e4759);--mat-sys-secondary-fixed:light-dark(#dae2f9, #dae2f9);--mat-sys-secondary-fixed-dim:light-dark(#bec6dc, #bec6dc);--mat-sys-shadow:light-dark(#000000, #000000);--mat-sys-surface:light-dark(#faf9fd, #121316);--mat-sys-surface-bright:light-dark(#faf9fd, #38393c);--mat-sys-surface-container:light-dark(#efedf0, #1f2022);--mat-sys-surface-container-high:light-dark(#e9e7eb, #292a2c);--mat-sys-surface-container-highest:light-dark(#e3e2e6, #343537);--mat-sys-surface-container-low:light-dark(#f4f3f6, #1a1b1f);--mat-sys-surface-container-lowest:light-dark(#ffffff, #0d0e11);--mat-sys-surface-dim:light-dark(#dbd9dd, #121316);--mat-sys-surface-tint:light-dark(#005cbb, #abc7ff);--mat-sys-surface-variant:light-dark(#e0e2ec, #44474e);--mat-sys-tertiary:light-dark(#005cbb, #abc7ff);--mat-sys-tertiary-container:light-dark(#d7e3ff, #00458f);--mat-sys-tertiary-fixed:light-dark(#d7e3ff, #d7e3ff);--mat-sys-tertiary-fixed-dim:light-dark(#abc7ff, #abc7ff);--mat-sys-neutral-variant20:#2d3038;--mat-sys-neutral10:#1a1b1f;--mat-sys-level0:0px 0px 0px 0px rgba(0, 0, 0, .2), 0px 0px 0px 0px rgba(0, 0, 0, .14), 0px 0px 0px 0px rgba(0, 0, 0, .12);--mat-sys-level1:0px 2px 1px -1px rgba(0, 0, 0, .2), 0px 1px 1px 0px rgba(0, 0, 0, .14), 0px 1px 3px 0px rgba(0, 0, 0, .12);--mat-sys-level2:0px 3px 3px -2px rgba(0, 0, 0, .2), 0px 3px 4px 0px rgba(0, 0, 0, .14), 0px 1px 8px 0px rgba(0, 0, 0, .12);--mat-sys-level3:0px 3px 5px -1px rgba(0, 0, 0, .2), 0px 6px 10px 0px rgba(0, 0, 0, .14), 0px 1px 18px 0px rgba(0, 0, 0, .12);--mat-sys-level4:0px 5px 5px -3px rgba(0, 0, 0, .2), 0px 8px 10px 1px rgba(0, 0, 0, .14), 0px 3px 14px 2px rgba(0, 0, 0, .12);--mat-sys-level5:0px 7px 8px -4px rgba(0, 0, 0, .2), 0px 12px 17px 2px rgba(0, 0, 0, .14), 0px 5px 22px 4px rgba(0, 0, 0, .12);--mat-sys-body-large:400 1rem / 1.5rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-large-line-height:1.5rem;--mat-sys-body-large-size:1rem;--mat-sys-body-large-tracking:.031rem;--mat-sys-body-large-weight:400;--mat-sys-body-medium:400 .875rem / 1.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-medium-line-height:1.25rem;--mat-sys-body-medium-size:.875rem;--mat-sys-body-medium-tracking:.016rem;--mat-sys-body-medium-weight:400;--mat-sys-body-small:400 .75rem / 1rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-body-small-line-height:1rem;--mat-sys-body-small-size:.75rem;--mat-sys-body-small-tracking:.025rem;--mat-sys-body-small-weight:400;--mat-sys-display-large:400 3.562rem / 4rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-large-line-height:4rem;--mat-sys-display-large-size:3.562rem;--mat-sys-display-large-tracking:-.016rem;--mat-sys-display-large-weight:400;--mat-sys-display-medium:400 2.812rem / 3.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-medium-line-height:3.25rem;--mat-sys-display-medium-size:2.812rem;--mat-sys-display-medium-tracking:0;--mat-sys-display-medium-weight:400;--mat-sys-display-small:400 2.25rem / 2.75rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-display-small-line-height:2.75rem;--mat-sys-display-small-size:2.25rem;--mat-sys-display-small-tracking:0;--mat-sys-display-small-weight:400;--mat-sys-headline-large:400 2rem / 2.5rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-large-line-height:2.5rem;--mat-sys-headline-large-size:2rem;--mat-sys-headline-large-tracking:0;--mat-sys-headline-large-weight:400;--mat-sys-headline-medium:400 1.75rem / 2.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-medium-line-height:2.25rem;--mat-sys-headline-medium-size:1.75rem;--mat-sys-headline-medium-tracking:0;--mat-sys-headline-medium-weight:400;--mat-sys-headline-small:400 1.5rem / 2rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-headline-small-line-height:2rem;--mat-sys-headline-small-size:1.5rem;--mat-sys-headline-small-tracking:0;--mat-sys-headline-small-weight:400;--mat-sys-label-large:500 .875rem / 1.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-large-line-height:1.25rem;--mat-sys-label-large-size:.875rem;--mat-sys-label-large-tracking:.006rem;--mat-sys-label-large-weight:500;--mat-sys-label-large-weight-prominent:700;--mat-sys-label-medium:500 .75rem / 1rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-medium-line-height:1rem;--mat-sys-label-medium-size:.75rem;--mat-sys-label-medium-tracking:.031rem;--mat-sys-label-medium-weight:500;--mat-sys-label-medium-weight-prominent:700;--mat-sys-label-small:500 .688rem / 1rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-label-small-line-height:1rem;--mat-sys-label-small-size:.688rem;--mat-sys-label-small-tracking:.031rem;--mat-sys-label-small-weight:500;--mat-sys-title-large:400 1.375rem / 1.75rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-large-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-large-line-height:1.75rem;--mat-sys-title-large-size:1.375rem;--mat-sys-title-large-tracking:0;--mat-sys-title-large-weight:400;--mat-sys-title-medium:500 1rem / 1.5rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-medium-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-medium-line-height:1.5rem;--mat-sys-title-medium-size:1rem;--mat-sys-title-medium-tracking:.009rem;--mat-sys-title-medium-weight:500;--mat-sys-title-small:500 .875rem / 1.25rem -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-small-font:-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;--mat-sys-title-small-line-height:1.25rem;--mat-sys-title-small-size:.875rem;--mat-sys-title-small-tracking:.006rem;--mat-sys-title-small-weight:500;--mat-sys-corner-extra-large:28px;--mat-sys-corner-extra-large-top:28px 28px 0 0;--mat-sys-corner-extra-small:4px;--mat-sys-corner-extra-small-top:4px 4px 0 0;--mat-sys-corner-full:9999px;--mat-sys-corner-large:16px;--mat-sys-corner-large-end:0 16px 16px 0;--mat-sys-corner-large-start:16px 0 0 16px;--mat-sys-corner-large-top:16px 16px 0 0;--mat-sys-corner-medium:12px;--mat-sys-corner-none:0;--mat-sys-corner-small:8px;--mat-sys-dragged-state-layer-opacity:.16;--mat-sys-focus-state-layer-opacity:.12;--mat-sys-hover-state-layer-opacity:.08;--mat-sys-pressed-state-layer-opacity:.12;--mat-snack-bar-container-shape:transparent;--mat-snack-bar-container-color:transparent;--mat-snack-bar-supporting-text-color:var(--color-text)}html,body{margin:0;padding:0;width:100%;height:100%}body{background:var(--color-bg);color:var(--color-text);font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,Segoe UI,Helvetica Neue,Arial,sans-serif;transition:background .3s ease,color .3s ease;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;padding:0!important}</style><link rel="stylesheet" href="styles-7E3CGANH.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles-7E3CGANH.css"></noscript></head>
|
|
14
14
|
<body>
|
|
15
15
|
<app-root></app-root>
|
|
16
|
-
<link rel="modulepreload" href="chunk-
|
|
16
|
+
<link rel="modulepreload" href="chunk-ISPDD5IG.js"><link rel="modulepreload" href="chunk-6F5GPHWV.js"><link rel="modulepreload" href="chunk-3QJA3PD3.js"><link rel="modulepreload" href="chunk-H72Z2LX3.js"><link rel="modulepreload" href="chunk-OUZFS4TC.js"><link rel="modulepreload" href="chunk-4NNLWDVJ.js"><link rel="modulepreload" href="chunk-5MXEOOQM.js"><link rel="modulepreload" href="chunk-L72BYLQX.js"><link rel="modulepreload" href="chunk-AE24ERN3.js"><link rel="modulepreload" href="chunk-2DVVHRX4.js"><script src="polyfills-2FSRUXKO.js" type="module"></script><script src="main-RAKQ5E3N.js" type="module"></script></body>
|
|
17
17
|
</html>
|