@whoz-oss/coday-client 0.121.0 → 0.121.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/3rdpartylicenses.txt +26 -26
- package/browser/chunk-2DE3OXG3.js +1 -0
- package/browser/chunk-3TOJSAQM.js +1 -0
- package/browser/chunk-4FGPNBI3.js +1 -0
- package/browser/chunk-4LFZBXC3.js +1 -0
- package/browser/chunk-4OMSGXSL.js +1 -0
- package/browser/chunk-5CTKRMM2.js +2 -0
- package/browser/{chunk-HNL4PUVG.js → chunk-5UOZGBZ2.js} +1 -1
- package/browser/chunk-7RF7FEOC.js +1 -0
- package/browser/chunk-DJBCK5D7.js +5 -0
- package/browser/chunk-ELXKRVE4.js +1 -0
- package/browser/chunk-FCCT54AP.js +1 -0
- package/browser/chunk-FPUSD6J7.js +1 -0
- package/browser/chunk-G5XS2TEE.js +1 -0
- package/browser/chunk-GT5UFSUE.js +2 -0
- package/browser/chunk-JPWWZVYZ.js +1 -0
- package/browser/chunk-JW6LSUP2.js +1 -0
- package/browser/chunk-KYPMYRHP.js +1 -0
- package/browser/chunk-LVEC3TBP.js +1 -0
- package/browser/chunk-MJEQQZDO.js +1 -0
- package/browser/{chunk-UAD6TAO5.js → chunk-NO2ODJHX.js} +1 -1
- package/browser/chunk-OK747ZMT.js +1 -0
- package/browser/chunk-OMLFSDJ5.js +1 -0
- package/browser/chunk-P5TSPSCB.js +1 -0
- package/browser/{chunk-S2O6N5YR.js → chunk-PKKHLHXJ.js} +1 -1
- package/browser/chunk-PWN5O4WY.js +1 -0
- package/browser/chunk-R35XCYRZ.js +1 -0
- package/browser/chunk-R5SZYFB2.js +1 -0
- package/browser/chunk-S5LR3GBS.js +2 -0
- package/browser/chunk-TE3JOGRA.js +2 -0
- package/browser/chunk-UGVRFJHC.js +1 -0
- package/browser/chunk-UMDZZGIC.js +1 -0
- package/browser/chunk-UXXLDXN3.js +1 -0
- package/browser/chunk-VNGIXNER.js +1 -0
- package/browser/chunk-VUV5JL5J.js +1 -0
- package/browser/chunk-W4VYO3E2.js +1 -0
- package/browser/chunk-WQDJM4TR.js +1 -0
- package/browser/chunk-XPK5V34V.js +1 -0
- package/browser/{chunk-4VDSG7R6.js → chunk-YDXVLOQW.js} +1 -1
- package/browser/chunk-Z7DC3UIO.js +1 -0
- package/browser/index.html +1 -1
- package/browser/{main-HXX7E37B.js → main-4CSREW6D.js} +2 -2
- package/package.json +1 -1
- package/browser/chunk-3YDRI4TY.js +0 -1
- package/browser/chunk-665PXQXJ.js +0 -1
- package/browser/chunk-6WTX5KC7.js +0 -1
- package/browser/chunk-72FRBMD4.js +0 -1
- package/browser/chunk-75YBV3AO.js +0 -1
- package/browser/chunk-7AQBJ5TI.js +0 -1
- package/browser/chunk-7CLTLEML.js +0 -1
- package/browser/chunk-7TOE3DRW.js +0 -2
- package/browser/chunk-A4ZJFWAK.js +0 -1
- package/browser/chunk-BIJXZ7JD.js +0 -1
- package/browser/chunk-CNPJ5XEL.js +0 -1
- package/browser/chunk-EAUVSQPC.js +0 -1
- package/browser/chunk-GLWBXLFL.js +0 -1
- package/browser/chunk-J3WTEANY.js +0 -1
- package/browser/chunk-JB7MERI6.js +0 -1
- package/browser/chunk-JBCOCIPY.js +0 -1
- package/browser/chunk-JDOIYNG7.js +0 -1
- package/browser/chunk-LXI5747H.js +0 -1
- package/browser/chunk-OVZ5YI5D.js +0 -1
- package/browser/chunk-PKJOCTNH.js +0 -2
- package/browser/chunk-QCHIMPFZ.js +0 -1
- package/browser/chunk-QMHQ4NWQ.js +0 -2
- package/browser/chunk-QU3UZZE4.js +0 -5
- package/browser/chunk-RNFBUSBO.js +0 -1
- package/browser/chunk-RQLPS2YR.js +0 -1
- package/browser/chunk-S43E5ZUR.js +0 -2
- package/browser/chunk-SQBLNCXA.js +0 -1
- package/browser/chunk-TA4AM2F6.js +0 -1
- package/browser/chunk-U3HXU6IS.js +0 -1
- package/browser/chunk-VIG2DS4B.js +0 -1
- package/browser/chunk-VLQP3XTM.js +0 -1
- package/browser/chunk-VOAECLLH.js +0 -1
- package/browser/chunk-WCNGR6NT.js +0 -1
- package/browser/chunk-YZAA7VTK.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-UXXLDXN3.js";import"./chunk-PWN5O4WY.js";import"./chunk-DJBCK5D7.js";export{a as AgentosShellComponent};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as gt,b as pt}from"./chunk-S5LR3GBS.js";import{a as H,b as ht,c as bt,d as ft}from"./chunk-5CTKRMM2.js";import{a as _t,b as vt}from"./chunk-TE3JOGRA.js";import{a as Ae,b as Le,d as We,e as Ge,f as Ne,g as Ue,h as ze}from"./chunk-NO2ODJHX.js";import{B as Ye,E as Ze,K as Je,L as et,M as tt,N as nt,Q as at,R as it,S as ot,T as rt,U as lt,V as st,W as dt,X as ct,Y as ut,Z as mt,x as Xe}from"./chunk-YDXVLOQW.js";import{b as je}from"./chunk-3TOJSAQM.js";import{G as Ee,J as Pe,K as Fe,L as W,M as Be,N as De,O as Re,P as Ve,R as G,S as N,T as U,h as we,i as Ie,s as ne,t as Oe}from"./chunk-PKKHLHXJ.js";import{A as Ke,C as $,a as $e,c as He,g as z,m as j,o as qe,z as Qe}from"./chunk-2DE3OXG3.js";import"./chunk-VNGIXNER.js";import{Ab as g,Cb as u,Db as pe,Eb as he,Fb as be,Fc as ke,Gb as fe,Ha as d,Hb as Z,Ib as J,Mb as F,Nc as Te,Ob as ee,Qb as s,Rb as O,Sb as w,Ta as I,Ua as de,Ub as f,Va as ce,Vb as _,W as oe,Wb as v,X as re,Y as le,Yb as _e,Za as X,Zb as ve,_ as K,_b as ye,aa as c,ec as Me,fa as p,ga as h,gb as V,hc as Se,ib as M,ic as Ce,jb as S,kb as ue,mb as A,na as R,nb as L,ob as b,oc as te,pb as o,pc as C,qb as r,rb as Y,sa as k,vb as me,wa as se,wb as ge,yb as x,yc as xe}from"./chunk-DJBCK5D7.js";var E=class l{http=c(Te);projectState=c(je);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=re({token:l,factory:l.\u0275fac,providedIn:"root"})};var Pt=["button"],Ft=["*"];function Bt(l,a){if(l&1&&(o(0,"div",2),Y(1,"mat-pseudo-checkbox",6),r()),l&2){let e=u();d(),b("disabled",e.disabled)}}var yt=new K("MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS",{providedIn:"root",factory:()=>({hideSingleSelectionIndicator:!1,hideMultipleSelectionIndicator:!1,disabledInteractive:!1})}),Mt=new K("MatButtonToggleGroup"),Dt={provide:$e,useExisting:oe(()=>ie),multi:!0},q=class{source;value;constructor(a,e){this.source=a,this.value=e}},ie=(()=>{class l{_changeDetector=c(te);_dir=c(Be,{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(ne).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||Oe(e))return;let n=e.target.id,i=this._buttonToggles.toArray().findIndex(T=>T.buttonId===n),m=null;switch(e.keyCode){case 32:case 13:m=this._buttonToggles.get(i)||null;break;case 38:m=this._getNextButton(i,-1);break;case 37:m=this._getNextButton(i,this.dir==="ltr"?-1:1);break;case 40:m=this._getNextButton(i,1);break;case 39:m=this._getNextButton(i,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,i=!1){!this.multiple&&this.selected&&!e.checked&&(this.selected.checked=!1),this._selectionModel?t?this._selectionModel.select(e):this._selectionModel.deselect(e):i=!0,i?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 i=1;i<=n.length;i++){let m=(e+t*i+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=ce({type:l,selectors:[["mat-button-toggle-group"]],contentQueries:function(t,n,i){if(t&1&&be(i,Q,5),t&2){let m;Z(m=J())&&(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),ee("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:[_e([Dt,{provide:Mt,useExisting:l}])]})}return l})(),Q=(()=>{class l{_changeDetectorRef=c(te);_elementRef=c(se);_focusMonitor=c(we);_idGenerator=c(ne);_animationDisabled=Ee();_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(Ie).load(Fe);let e=c(Mt,{optional:!0}),t=c(new Ce("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&&fe(Pt,5),t&2){let i;Z(i=J())&&(n._buttonElement=i.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),ee("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&&(pe(),o(0,"button",1,0),g("click",function(){return n._onButtonClick()}),M(2,Bt,2,1,"div",2),o(3,"span",3),he(4),r()(),Y(5,"span",4)(6,"span",5)),t&2){let i=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",i)("matRippleDisabled",n.disableRipple||n.disabled)}},dependencies:[Pe,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=de({type:l});static \u0275inj=le({imports:[Re,Q,De]})}return l})();var Gt=(l,a)=>a.id,Nt=(l,a)=>a.value;function Ut(l,a){if(l&1&&(o(0,"mat-option",5),s(1),r()),l&2){let e=a.$implicit;b("value",e.id),d(),w(" ",e.name," ")}}function zt(l,a){if(l&1){let e=x();o(0,"mat-checkbox",35),g("change",function(){let n=p(e).$implicit,i=u();return h(i.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 jt(l,a){if(l&1){let e=x();o(0,"mat-form-field",2)(1,"mat-label"),s(2,"Number of Occurrences"),r(),o(3,"input",10),v("ngModelChange",function(n){p(e);let i=u();return _(i.endOccurrences,n)||(i.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();o(0,"mat-form-field",2)(1,"mat-label"),s(2,"End Date"),r(),o(3,"input",36),v("ngModelChange",function(n){p(e);let i=u();return _(i.endTimestamp,n)||(i.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();o(0,"div")(1,"mat-form-field",2)(2,"mat-label"),s(3,"Parameter Value"),r(),o(4,"input",37),v("ngModelChange",function(n){p(e);let i=u();return _(i.simpleParameter,n)||(i.simpleParameter=n),h(n)}),r(),o(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();o(0,"div",40)(1,"mat-form-field",41)(2,"mat-label"),s(3,"Key"),r(),o(4,"input",42),v("ngModelChange",function(n){let i=p(e).$implicit;return _(i.key,n)||(i.key=n),h(n)}),r()(),o(5,"mat-form-field",43)(6,"mat-label"),s(7,"Value"),r(),o(8,"input",44),v("ngModelChange",function(n){let i=p(e).$implicit;return _(i.value,n)||(i.value=n),h(n)}),r()(),o(9,"button",45),g("click",function(){let n=p(e).$index,i=u(3);return h(i.removeParameter(n))}),o(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&&(o(0,"div",39),A(1,qt,12,2,"div",40,ue),r()),l&2){let e=u(2);d(),L(e.parameters)}}function Kt(l,a){if(l&1){let e=x();o(0,"div")(1,"div",26)(2,"button",38),g("click",function(){p(e);let n=u();return h(n.addParameter())}),o(3,"mat-icon"),s(4,"add"),r()()(),M(5,Qt,3,0,"div",39),o(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&&(o(0,"div",31)(1,"mat-icon"),s(2,"error"),r(),o(3,"span"),s(4),r()()),l&2){let e=u();d(4),O(e.errorMessage)}}var B=class l{schedulerApi=c(E);promptApi=c(H);dialogRef=c(Ae);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(Le);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"),i=String(a.getHours()).padStart(2,"0"),m=String(a.getMinutes()).padStart(2,"0");return`${e}-${t}-${n}T${i}:${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&&(o(0,"h2",0),s(1),r(),o(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),s(6,"Name"),r(),o(7,"input",3),v("ngModelChange",function(i){return _(t.name,i)||(t.name=i),i}),r(),o(8,"mat-hint"),s(9,"A descriptive name for this scheduler"),r()(),o(10,"mat-form-field",2)(11,"mat-label"),s(12,"Prompt"),r(),o(13,"mat-select",4),v("ngModelChange",function(i){return _(t.promptId,i)||(t.promptId=i),i}),A(14,Ut,2,2,"mat-option",5,Gt),r(),o(16,"mat-hint"),s(17,"Select the prompt to execute"),r()(),o(18,"mat-form-field",2)(19,"mat-label"),s(20,"Start Date & Time"),r(),o(21,"input",6),v("ngModelChange",function(i){return _(t.startTimestamp,i)||(t.startTimestamp=i),i}),r(),o(22,"mat-hint"),s(23,"When to start the scheduler (leave empty for now)"),r()(),o(24,"div",7)(25,"h3"),s(26,"Schedule Interval"),r(),o(27,"div",8)(28,"mat-form-field",9)(29,"mat-label"),s(30,"Every"),r(),o(31,"input",10),v("ngModelChange",function(i){return _(t.intervalValue,i)||(t.intervalValue=i),i}),r()(),o(32,"mat-form-field",11)(33,"mat-label"),s(34,"Unit"),r(),o(35,"mat-select",4),v("ngModelChange",function(i){return _(t.intervalUnit,i)||(t.intervalUnit=i),i}),o(36,"mat-option",12),s(37,"Minutes (1-59)"),r(),o(38,"mat-option",13),s(39,"Hours (1-24)"),r(),o(40,"mat-option",14),s(41,"Days (1-31)"),r(),o(42,"mat-option",15),s(43,"Months (1-12)"),r()()()()(),o(44,"div",16)(45,"h3"),s(46,"Days of Week (Optional)"),r(),o(47,"div",17),A(48,zt,2,2,"mat-checkbox",18,Nt),r(),o(50,"p",19),s(51,"Leave empty to run every day"),r()(),o(52,"div",20)(53,"h3"),s(54,"End Condition (Optional)"),r(),o(55,"mat-form-field",2)(56,"mat-label"),s(57,"End Type"),r(),o(58,"mat-select",21),v("ngModelChange",function(i){return _(t.endConditionType,i)||(t.endConditionType=i),i}),o(59,"mat-option",22),s(60,"Never (run indefinitely)"),r(),o(61,"mat-option",23),s(62,"After X occurrences"),r(),o(63,"mat-option",24),s(64,"Until specific date"),r()()(),M(65,jt,4,1,"mat-form-field",2),M(66,$t,4,1,"mat-form-field",2),r(),o(67,"div",25)(68,"div",26)(69,"h3"),s(70,"Parameters (Optional)"),r(),o(71,"mat-button-toggle-group",27),v("ngModelChange",function(i){return _(t.parameterMode,i)||(t.parameterMode=i),i}),o(72,"mat-button-toggle",28),s(73,"Simple"),r(),o(74,"mat-button-toggle",29),s(75,"Structured"),r()()(),M(76,Ht,7,2,"div"),M(77,Kt,8,2,"div"),r(),o(78,"div",30)(79,"mat-checkbox",21),v("ngModelChange",function(i){return _(t.enabled,i)||(t.enabled=i),i}),s(80,"Enabled"),r(),o(81,"p",19),s(82,"Scheduler will only run if enabled"),r()(),M(83,Xt,5,1,"div",31),r()(),o(84,"mat-dialog-actions",32)(85,"button",33),g("click",function(){return t.cancel()}),s(86,"Cancel"),r(),o(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,$,He,qe,z,Ke,Qe,j,ze,Ge,Ue,Ne,G,Ve,W,rt,ot,at,tt,nt,it,U,N,vt,_t,Ze,pt,gt,St,ie,Q],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&&(o(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();o(0,"ds-entity-card",8),g("selected",function(n){p(e);let i=u();return h(i.onEdit(n))}),me(1,9),o(2,"button",10),g("click",function(n){return n.stopPropagation()}),o(3,"mat-icon"),s(4,"more_vert"),r()(),ge(),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??ve(6,Yt)),d(2),b("matMenuTriggerFor",t)("matMenuTriggerData",ye(7,Zt,e.id))}}function tn(l,a){if(l&1){let e=x();o(0,"button",11),g("click",function(){let n=p(e).id,i=u();return h(i.onEdit(n))}),o(1,"mat-icon"),s(2,"edit"),r(),s(3," Edit "),r(),o(4,"button",11),g("click",function(){let n=p(e).id,i=u();return h(i.onToggleEnabled(n))}),o(5,"mat-icon"),s(6),r(),s(7),r(),o(8,"button",11),g("click",function(){let n=p(e).id,i=u();return h(i.onRunNow(n))}),o(9,"mat-icon"),s(10,"play_arrow"),r(),s(11," Run now "),r(),o(12,"button",12),g("click",function(){let n=p(e).id,i=u();return h(i.onDelete(n))}),o(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(H);configApi=c(ht);location=c(xe);dialog=c(We);schedulers=k([]);prompts=k([]);isLoading=k(!1);errorMessage=k(null);showOnlyMine=k(!0);currentUsername=k("");schedulerItems=Se(()=>{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(){this.location.back()}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&&(o(0,"div",2)(1,"ds-entity-list",3),g("createRequested",function(){return t.onCreate()}),o(2,"button",4),g("click",function(){return t.onBack()}),o(3,"mat-icon"),s(4,"chevron_left"),r()(),o(5,"mat-slide-toggle",5),g("ngModelChange",function(i){return t.showOnlyMine.set(i)}),s(6," Mine "),r()(),M(7,Jt,2,1,"div",6),r(),X(8,en,5,9,"ng-template",null,0,Me),o(10,"mat-menu",null,1),X(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,G,W,U,N,ft,bt,mt,ct,st,dt,ut,$,z,j],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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{L as ge,R as ue,S as he,T as fe}from"./chunk-PKKHLHXJ.js";import{C as ke,c as be,g as ve,m as ye,v as xe,w as Ce,x as Te}from"./chunk-2DE3OXG3.js";import{a as _e}from"./chunk-VNGIXNER.js";import{Ab as P,Bb as de,Cb as g,Ec as D,Ha as s,Mc as Z,Nb as me,Nc as pe,Qb as a,Rb as m,Sb as E,Ta as L,Wa as Q,X as H,a as R,aa as M,ac as x,b as A,cc as w,dc as G,fa as $,ga as V,gb as b,ha as O,hb as re,hc as p,ia as ae,ib as v,jb as y,la as ie,mb as I,nb as N,ob as S,pb as r,qb as l,rb as le,sa as h,sb as c,tb as _,ub as T,y as oe,yb as se,yc as ce}from"./chunk-DJBCK5D7.js";var Fe=(o,t)=>t.date,Re=(o,t)=>t.x,Ae=(o,t)=>t.label;function He(o,t){o&1&&(c(0,"div",0),a(1,"No daily data points for this period."),_())}function $e(o,t){if(o&1&&(O(),T(0,"rect",18)),o&2){let e=g().$implicit,n=g(2);b("x",e.w+6)("y",n.yBase-e.tokensStubH)("width",e.w)("height",e.tokensStubH)}}function Ve(o,t){if(o&1&&(O(),T(0,"rect",19)(1,"rect",20)),o&2){let e=g().$implicit,n=g(2);b("x",e.w+6)("y",n.yBase-(e.promptH??0))("width",e.w)("height",e.promptH??0),s(),b("x",e.w+6)("y",n.yBase-((e.promptH??0)+(e.completionH??0)))("width",e.w)("height",e.completionH??0)}}function Le(o,t){if(o&1){let e=se();O(),c(0,"g",15),de("mouseenter",function(i){let d=$(e).$implicit,u=g(2);return V(u.showTooltip(i,d.point))})("mousemove",function(i){let d=$(e).$implicit,u=g(2);return V(u.showTooltip(i,d.point))})("mouseleave",function(){$(e);let i=g(2);return V(i.hideTooltip())}),T(1,"rect",16)(2,"rect",17),v(3,$e,1,4,":svg:rect",18)(4,Ve,2,8),_()}if(o&2){let e=t.$implicit,n=g(2);b("transform","translate("+e.xGroup+",0)"),s(),b("y",n.yTop)("width",e.groupW)("height",n.yBase-n.yTop),s(),b("y",n.yBase-e.costH)("width",e.w)("height",e.costH),s(),y(e.tokensStubH!==null?3:4)}}function Ge(o,t){if(o&1&&(O(),c(0,"text",5),a(1),_()),o&2){let e=t.$implicit,n=g(2);b("x",e.x)("y",n.yAxis),s(),m(e.label)}}function Ye(o,t){if(o&1&&(c(0,"div",24),a(1),_(),c(2,"div",25),a(3),_()),o&2){let e=t.$implicit;s(),m(e.label),s(2),m(e.value)}}function We(o,t){if(o&1&&(c(0,"div",21)(1,"div",22),a(2),_(),c(3,"div",23),I(4,Ye,4,2,null,null,Ae),_()()),o&2){let e=g(2);me("left",e.tooltip().x+12,"px")("top",e.tooltip().y+12,"px"),s(2),m(e.tooltip().data.date),s(2),N(e.tooltipLines())}}function je(o,t){if(o&1&&(c(0,"div",8)(1,"span",10),a(2),_()()),o&2){let e=g(2);s(2),m(e.tokenCoverageLabel())}}function ze(o,t){if(o&1&&(c(0,"div",1),O(),c(1,"svg",2),T(2,"line",3)(3,"line",3),I(4,Le,5,8,":svg:g",4,Fe),I(6,Ge,2,3,":svg:text",5,Re),_(),v(8,We,6,5,"div",6),ae(),c(9,"div",7)(10,"div",8),T(11,"span",9),c(12,"span",10),a(13,"Cost (per day)"),_(),c(14,"span",11),a(15),_()(),c(16,"div",8),T(17,"span",12),c(18,"span",10),a(19,"Prompt tokens"),_()(),c(20,"div",8),T(21,"span",13),c(22,"span",10),a(23,"Completion tokens"),_()(),c(24,"div",8),T(25,"span",14),c(26,"span",10),a(27,"Tokens missing"),_()(),c(28,"div",8)(29,"span",10),a(30,"Tokens scale"),_(),c(31,"span",11),a(32),_()(),v(33,je,3,1,"div",8),_()()),o&2){let e=g();s(),b("viewBox",e.viewBox),s(),b("y1",e.yTop)("x2",720)("y2",e.yTop),s(),b("y1",e.yBase)("x2",720)("y2",e.yBase),s(),N(e.bars()),s(2),N(e.axisLabels()),s(2),y(e.tooltip().visible&&e.tooltip().data?8:-1),s(7),E("max ",e.maxCostLabel()),s(17),E("max ",e.maxTokensLabel()),s(),y(e.tokenCoverageLabel()?33:-1)}}var Y=class o{points=[];width=720;height=240;paddingX=12;paddingY=16;bottomAxisH=48;viewBox=`0 0 ${this.width} ${this.height}`;innerW=this.width-this.paddingX*2;innerH=this.height-this.paddingY*2-this.bottomAxisH;barGap=6;groupGap=14;safePoints=p(()=>(this.points??[]).filter(t=>!!t.date));maxCost=p(()=>Math.max(0,...this.safePoints().map(t=>t.cost??0)));maxTokens=p(()=>{let t=this.safePoints().map(e=>{let n=e.promptTokens??null,i=e.completionTokens??null;return n===null&&i===null?null:(n??0)+(i??0)}).filter(e=>e!==null);return Math.max(0,...t)});tokenCoverageLabel=p(()=>{let t=this.safePoints();return t.length===0?"":`Tokens available for ${t.filter(n=>n.promptTokens!==null||n.completionTokens!==null).length}/${t.length} days`});maxCostLabel=p(()=>"$"+(new D("en-US").transform(this.maxCost(),"1.2-2")??"0.00"));maxTokensLabel=p(()=>new D("en-US").transform(this.maxTokens(),"1.0-2")??"0");tooltip=h({visible:!1,x:0,y:0,data:null});toTooltipData(t){let e=t.promptTokens,n=t.completionTokens,i=e===null&&n===null?null:(e??0)+(n??0);return{date:t.date,cost:t.cost??0,promptTokens:e,completionTokens:n,totalTokens:i,callCount:t.callCount??0}}showTooltip(t,e){let i=t.currentTarget?.closest(".chart")?.getBoundingClientRect(),d=i?t.clientX-i.left:t.clientX,u=i?t.clientY-i.top:t.clientY,f=320,k=170,U=12,C=i?Math.max(0,i.width-f-U):d,B=i?Math.max(0,i.height-k-U):u,F=i?Math.min(Math.max(0,d),C):d,ee=i?Math.min(Math.max(0,u),B):u;this.tooltip.set({visible:!0,x:F,y:ee,data:this.toTooltipData(e)})}hideTooltip(){this.tooltip.update(t=>A(R({},t),{visible:!1}))}formatTokens(t){return t===null?"\u2014":new D("en-US").transform(t,"1.0-2")??"0"}formatCost(t){return"$"+(new D("en-US").transform(t??0,"1.2-2")??"0.00")}tooltipLines=p(()=>{let t=this.tooltip(),e=t.data;return!t.visible||!e?[]:[{label:"Cost",value:this.formatCost(e.cost)},{label:"Prompt tokens",value:this.formatTokens(e.promptTokens)},{label:"Completion tokens",value:this.formatTokens(e.completionTokens)},{label:"Total tokens",value:this.formatTokens(e.totalTokens)},{label:"Calls",value:`${e.callCount}`}]});bars=p(()=>{let t=this.safePoints(),e=t.length;if(e===0)return[];let n=(this.innerW-(e-1)*this.groupGap)/e,i=Math.max(2,n),d=(i-this.barGap)/2,u=Math.max(1,d),f=this.maxCost()||1,k=this.maxTokens()||1,U=45;return t.map((C,B)=>{let F=this.paddingX+B*(i+this.groupGap),Ee=(C.cost??0)/f*this.innerH,te=C.promptTokens,ne=C.completionTokens,K=te!==null||ne!==null,Oe=te??0,Ie=ne??0,Ne=K?Oe/k*this.innerH:null,Ue=K?Ie/k*this.innerH:null;return{date:C.date,point:C,xGroup:F,groupW:i,xCost:F,w:u,costH:Ee,xTokens:F+u+this.barGap,promptH:Ne,completionH:Ue,tokensStubH:K?null:U}})});axisLabels=p(()=>{let t=this.safePoints(),e=t.length;if(e===0)return[];let i=Math.max(1,Math.ceil(e/8)),d=(this.innerW-(e-1)*this.groupGap)/e,u=Math.max(2,d);return t.map((f,k)=>({p:f,i:k})).filter(({i:f})=>f%i===0||f===e-1).map(({p:f,i:k})=>{let C=this.paddingX+k*(u+this.groupGap)+u/2,B=f.date.slice(5);return{x:C,label:B}})});yTop=this.paddingY;yBase=this.paddingY+this.innerH;yAxis=this.yBase+28;static \u0275fac=function(e){return new(e||o)};static \u0275cmp=L({type:o,selectors:[["app-daily-series-chart"]],inputs:{points:"points"},decls:2,vars:1,consts:[[1,"muted"],[1,"chart"],["preserveAspectRatio","none","role","img","aria-label","Daily token and cost usage",1,"chart__svg"],["x1","0",1,"chart__grid"],[1,"chart__day"],["text-anchor","middle",1,"chart__axis-label"],[1,"chart__tooltip",3,"left","top"],[1,"chart__legend"],[1,"chart__legend-item"],["aria-hidden","true",1,"chart__legend-swatch","chart__legend-swatch--cost"],[1,"chart__legend-label"],[1,"chart__legend-value"],["aria-hidden","true",1,"chart__legend-swatch","chart__legend-swatch--prompt"],["aria-hidden","true",1,"chart__legend-swatch","chart__legend-swatch--completion"],["aria-hidden","true",1,"chart__legend-swatch","chart__legend-swatch--tokens-missing"],[1,"chart__day",3,"mouseenter","mousemove","mouseleave"],["x","0",1,"chart__hover"],["x","0",1,"chart__bar","chart__bar--cost"],[1,"chart__bar","chart__bar--tokens-missing"],[1,"chart__bar","chart__bar--prompt"],[1,"chart__bar","chart__bar--completion"],[1,"chart__tooltip"],[1,"chart__tooltip-title"],[1,"chart__tooltip-grid"],[1,"chart__tooltip-label"],[1,"chart__tooltip-value"]],template:function(e,n){e&1&&v(0,He,2,0,"div",0)(1,ze,34,11,"div",1),e&2&&y(n.safePoints().length===0?0:1)},styles:[".chart[_ngcontent-%COMP%]{display:grid;gap:.5rem;position:relative}.chart__svg[_ngcontent-%COMP%]{width:100%;height:260px;display:block;border-radius:12px;background:var(--color-bg-secondary, rgba(255, 255, 255, .72));border:1px solid var(--color-border-light, rgba(0, 0, 0, .08))}.chart__grid[_ngcontent-%COMP%]{stroke:var(--color-border-light, rgba(0, 0, 0, .08));stroke-width:1}.chart__day[_ngcontent-%COMP%]{cursor:default}.chart__hover[_ngcontent-%COMP%]{fill:transparent}.chart__day[_ngcontent-%COMP%]:hover .chart__hover[_ngcontent-%COMP%]{fill:var(--color-bg-hover, rgba(0, 0, 0, .03))}.chart__tooltip[_ngcontent-%COMP%]{position:absolute;z-index:2;min-width:220px;max-width:320px;padding:10px 12px;border-radius:12px;background:rgb(var(--color-bg-secondary-rgb, 255 255 255)/1);border:1px solid var(--color-border-light, rgba(0, 0, 0, .08));box-shadow:var(--glass-shadow, 0 8px 24px rgba(0, 0, 0, .12));pointer-events:none}.chart__tooltip-title[_ngcontent-%COMP%]{font-weight:650;margin-bottom:6px}.chart__tooltip-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr auto;column-gap:10px;row-gap:4px}.chart__tooltip-label[_ngcontent-%COMP%]{color:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:.85rem}.chart__tooltip-value[_ngcontent-%COMP%]{font-variant-numeric:tabular-nums;text-align:right}.chart__bar[_ngcontent-%COMP%]{shape-rendering:geometricPrecision;rx:2;ry:2}.chart__bar--cost[_ngcontent-%COMP%]{fill:var(--color-primary, #007aff);opacity:.85}.chart__bar--prompt[_ngcontent-%COMP%]{fill:var(--color-success, #34c759);opacity:.85}.chart__bar--completion[_ngcontent-%COMP%]{fill:var(--color-warning, #ff9500);opacity:.85}.chart__bar--tokens-missing[_ngcontent-%COMP%]{fill:transparent;stroke:var(--color-text-secondary, rgba(29, 29, 31, .55));stroke-width:1.5;stroke-dasharray:4 3}.chart__axis-label[_ngcontent-%COMP%]{fill:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:12px;font-variant-numeric:tabular-nums}.chart__legend[_ngcontent-%COMP%]{display:flex;justify-content:space-between;gap:.75rem;flex-wrap:wrap}.chart__legend-item[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:baseline}.chart__legend-swatch[_ngcontent-%COMP%]{width:10px;height:10px;border-radius:3px;align-self:center}.chart__legend-swatch--cost[_ngcontent-%COMP%]{background:var(--color-primary, #007aff)}.chart__legend-swatch--prompt[_ngcontent-%COMP%]{background:var(--color-success, #34c759)}.chart__legend-swatch--completion[_ngcontent-%COMP%]{background:var(--color-warning, #ff9500)}.chart__legend-swatch--tokens-missing[_ngcontent-%COMP%]{background:transparent;border:1px dashed var(--color-text-secondary, rgba(29, 29, 31, .55))}.chart__legend-label[_ngcontent-%COMP%]{color:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:.85rem}.chart__legend-value[_ngcontent-%COMP%]{font-variant-numeric:tabular-nums}.muted[_ngcontent-%COMP%]{color:var(--color-text-secondary, rgba(29, 29, 31, .7))}"],changeDetection:0})};var j=class o{http=M(pe);getTokenUsage(t){let e=new Z;return t.from&&(e=e.set("from",t.from)),t.to&&(e=e.set("to",t.to)),this.http.get("/api/token-usage",{params:e})}getTokenUsageSeries(t){let e=new Z;return t.from&&(e=e.set("from",t.from)),t.to&&(e=e.set("to",t.to)),this.http.get("/api/token-usage/series",{params:e})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=H({token:o,factory:o.\u0275fac,providedIn:"root"})};function Me(o){return`${o}`.padStart(2,"0")}function Se(o){return`${o.getUTCFullYear()}-${Me(o.getUTCMonth()+1)}-${Me(o.getUTCDate())}`}function Xe(o=new Date){return new Date(Date.UTC(o.getUTCFullYear(),o.getUTCMonth(),1))}function Je(o=new Date){return new Date(Date.UTC(o.getUTCFullYear(),o.getUTCMonth()+1,1))}var z=class o{api=M(j);destroyRef=M(ie);defaultFrom=Se(Xe());defaultTo=Se(Je());draftFilters=h({from:this.defaultFrom,to:this.defaultTo});appliedFilters=h({from:this.defaultFrom,to:this.defaultTo});loading=h(!1);error=h(null);aggregation=h(null);seriesResponse=h(null);series=h(null);tokenDataPartial=h(!1);aggregationByModelId=h(null);seriesByModelId=h(null);init(){this.reload()}setDraftFrom(t){this.draftFilters.update(e=>A(R({},e),{from:t}))}setDraftTo(t){this.draftFilters.update(e=>A(R({},e),{to:t}))}clearDraftFrom(){this.setDraftFrom(null)}clearDraftTo(){this.setDraftTo(null)}apply(){this.appliedFilters.set(this.draftFilters()),this.reload()}addNullableTokens(t,e){return t===null&&e===null?null:(t??0)+(e??0)}aggregateByModelId(t){let e=new Map;for(let n of t){let i=n.modelId,d=e.get(i);d?(d.promptTokens=this.addNullableTokens(d.promptTokens,n.promptTokens),d.completionTokens=this.addNullableTokens(d.completionTokens,n.completionTokens),d.totalTokens=this.addNullableTokens(d.totalTokens,n.totalTokens),d.callCount+=n.callCount??0,d.cost=(d.cost??0)+(n.cost??0)):e.set(i,{agentName:"All agents",providerName:"all",modelId:n.modelId,promptTokens:n.promptTokens,completionTokens:n.completionTokens,totalTokens:n.totalTokens,callCount:n.callCount??0,cost:n.cost??0})}return[...e.values()].sort((n,i)=>(i.totalTokens??0)-(n.totalTokens??0))}aggregateSeriesByModelId(t){let e=new Map;for(let n of t){let i=`${n.date}|${n.modelId}`,d=e.get(i);d?(d.promptTokens=this.addNullableTokens(d.promptTokens,n.promptTokens),d.completionTokens=this.addNullableTokens(d.completionTokens,n.completionTokens),d.totalTokens=this.addNullableTokens(d.totalTokens,n.totalTokens),d.callCount+=n.callCount??0,d.cost=(d.cost??0)+(n.cost??0)):e.set(i,{date:n.date,agentName:"All agents",providerName:"all",modelId:n.modelId,promptTokens:n.promptTokens,completionTokens:n.completionTokens,totalTokens:n.totalTokens,callCount:n.callCount??0,cost:n.cost??0})}return[...e.values()].sort((n,i)=>n.date<i.date?-1:1)}reload(){let{from:t,to:e}=this.appliedFilters();this.loading.set(!0),this.error.set(null),oe({aggregation:this.api.getTokenUsage({from:t,to:e}),series:this.api.getTokenUsageSeries({from:t,to:e})}).pipe(_e(this.destroyRef)).subscribe({next:({aggregation:n,series:i})=>{this.aggregation.set(n),this.seriesResponse.set(i);let d=i.points??[];this.series.set(d),this.tokenDataPartial.set(n.tokenDataPartial||i.tokenDataPartial);let u=this.aggregateByModelId(n.models??[]);this.aggregationByModelId.set(u),this.seriesByModelId.set(this.aggregateSeriesByModelId(d)),this.loading.set(!1)},error:n=>{this.loading.set(!1),this.aggregation.set(null),this.seriesResponse.set(null),this.series.set(null),this.tokenDataPartial.set(!1),this.aggregationByModelId.set(null),this.seriesByModelId.set(null),this.error.set(n instanceof Error?n.message:"Failed to load token usage")}})}static \u0275fac=function(e){return new(e||o)};static \u0275prov=H({token:o,factory:o.\u0275fac,providedIn:"root"})};var X=function(){throw new Error("DON'T USE this INSIDE A FUNCTION CALLED BY | call OR | apply IT MUST BE A PURE FUNCTION!")},Pe=typeof Proxy!="function"?Object.seal({}):new Proxy({},{get:X,set:X,deleteProperty:X,has:X}),J=class o{transform(t,e){if(typeof e!="function")throw new TypeError("You must pass a PURE function to | call");return e?.call(Pe,t)}static \u0275fac=function(e){return new(e||o)};static \u0275pipe=Q({name:"call",type:o,pure:!0})},q=class o{transform(t,...e){if(typeof t!="function")throw new TypeError("You must use | apply on a PURE function");return t.apply(Pe,e)}static \u0275fac=function(e){return new(e||o)};static \u0275pipe=Q({name:"apply",type:o,pure:!0})};function qe(o,t){o&1&&(r(0,"div",23),a(1," Partial data \u2014 token counts may not cover the full period "),l())}function Ke(o,t){o&1&&(r(0,"div",24),a(1," No token data collected for this period "),l())}function Qe(o,t){if(o&1&&(r(0,"div",19)(1,"div",20)(2,"div",21),a(3,"Total tokens"),l(),r(4,"div",22),a(5),x(6,"call"),l()(),r(7,"div",20)(8,"div",21),a(9,"Total calls"),l(),r(10,"div",22),a(11),l()(),r(12,"div",20)(13,"div",21),a(14,"Total cost"),l(),r(15,"div",22),a(16),x(17,"apply"),l()()(),v(18,qe,2,0,"div",23),v(19,Ke,2,0,"div",24)),o&2){let e=g();s(5),m(w(6,5,e.totalRow().totalTokens,e.formatTokenValue)),s(6),m(e.totalRow().callCount),s(5),m(G(17,8,e.formatCostValue,e.isMissingPeriod(),e.totalRow().cost)),s(2),y(e.isPartialPeriod()?18:-1),s(),y(e.isMissingPeriod()?19:-1)}}function Ze(o,t){o&1&&(r(0,"div",16)(1,"div",25),a(2,"Loading token usage\u2026"),l()())}function et(o,t){if(o&1&&(r(0,"div",17)(1,"div",26),a(2,"Failed to load"),l(),r(3,"div",25),a(4),l()()),o&2){let e=g();s(4),m(e.state.error())}}function tt(o,t){o&1&&(r(0,"div",16)(1,"div",26),a(2,"No data"),l(),r(3,"div",25),a(4,"No token usage recorded yet for this period."),l()())}function nt(o,t){if(o&1&&(r(0,"div",32)(1,"div",29),a(2),l(),r(3,"div",29),a(4),l(),r(5,"div",29),a(6),l(),r(7,"div",30),a(8),x(9,"call"),l(),r(10,"div",30),a(11),x(12,"call"),l(),r(13,"div",30),a(14),x(15,"call"),l(),r(16,"div",30),a(17),l(),r(18,"div",30),a(19),x(20,"apply"),l()()),o&2){let e=t.$implicit,n=g(2);s(2),m(e.agentName),s(2),m(e.providerName),s(2),m(e.modelId),s(2),m(w(9,8,e.promptTokens,n.formatTokenValue)),s(3),m(w(12,11,e.completionTokens,n.formatTokenValue)),s(3),m(w(15,14,e.totalTokens,n.formatTokenValue)),s(3),m(e.callCount),s(2),E(" ",G(20,17,n.formatCostValue,n.isMissingPeriod(),e.cost)," ")}}function ot(o,t){if(o&1&&(r(0,"div",33)(1,"div",29),a(2),l(),r(3,"div",29),a(4),l(),r(5,"div",29),a(6),l(),r(7,"div",30),a(8),x(9,"call"),l(),r(10,"div",30),a(11),x(12,"call"),l(),r(13,"div",30),a(14),x(15,"call"),l(),r(16,"div",30),a(17),l(),r(18,"div",30),a(19),x(20,"apply"),l()()),o&2){let e=g(2);s(2),m(e.totalRow().agentName),s(2),m(e.totalRow().providerName),s(2),m(e.totalRow().modelId),s(2),m(w(9,8,e.totalRow().promptTokens,e.formatTokenValue)),s(3),E(" ",w(12,11,e.totalRow().completionTokens,e.formatTokenValue)," "),s(3),m(w(15,14,e.totalRow().totalTokens,e.formatTokenValue)),s(3),m(e.totalRow().callCount),s(2),E(" ",G(20,17,e.formatCostValue,e.isMissingPeriod(),e.totalRow().cost)," ")}}function at(o,t){if(o&1&&(r(0,"div",18)(1,"section",16)(2,"div",26),a(3,"Summary"),l(),r(4,"div",27)(5,"div",28)(6,"div",29),a(7,"agentName"),l(),r(8,"div",29),a(9,"providerName"),l(),r(10,"div",29),a(11,"modelId"),l(),r(12,"div",30),a(13,"promptTokens"),l(),r(14,"div",30),a(15,"completionTokens"),l(),r(16,"div",30),a(17,"totalTokens"),l(),r(18,"div",30),a(19,"callCount"),l(),r(20,"div",30),a(21,"cost"),l()(),r(22,"div",31),I(23,nt,21,21,"div",32,re().trackRow,!0),v(25,ot,21,21,"div",33),l()()(),r(26,"section",16)(27,"div",26),a(28,"Daily series"),l(),le(29,"app-daily-series-chart",34),l()()),o&2){let e=g();s(23),N(e.rows()),s(2),y(e.totalRow()?25:-1),s(4),S("points",e.chartPoints())}}var we="\u2014",De=class o{location=M(ce);state=M(z);view=h("byModel");rowsByAgent=p(()=>this.state.aggregation()?.models??[]);totalRow=p(()=>this.state.aggregation()?.total??null);rowsByModel=p(()=>this.state.aggregationByModelId()??[]);chartPointsByAgent=p(()=>{let t=this.state.series()??[];return this.aggregateDailyPoints(t)});chartPointsByModel=p(()=>{let t=this.state.seriesByModelId()??[];return this.aggregateDailyPoints(t)});chartPoints=p(()=>this.view()==="byAgent"?this.chartPointsByAgent():this.chartPointsByModel());rows=p(()=>this.view()==="byAgent"?this.rowsByAgent():this.rowsByModel());isEmpty=p(()=>{let t=this.state.aggregation();return t?(t.models?.length??0)===0&&(t.total?.callCount??0)===0:!1});ngOnInit(){this.state.init()}onFromChange(t){this.state.setDraftFrom(t||null)}onToChange(t){this.state.setDraftTo(t||null)}clearFrom(){this.state.clearDraftFrom()}clearTo(){this.state.clearDraftTo()}apply(){this.state.apply()}aggregateDailyPoints(t){let e=new Map;for(let n of t){let i=e.get(n.date);if(!i)e.set(n.date,{date:n.date,promptTokens:n.promptTokens,completionTokens:n.completionTokens,cost:n.cost??0,callCount:n.callCount??0});else{let d=(u,f)=>u===null&&f===null?null:(u??0)+(f??0);i.promptTokens=d(i.promptTokens,n.promptTokens),i.completionTokens=d(i.completionTokens,n.completionTokens),i.cost=(i.cost??0)+(n.cost??0),i.callCount=(i.callCount??0)+(n.callCount??0)}}return[...e.values()].sort((n,i)=>n.date<i.date?-1:1)}trackRow(t,e){return`${e.agentName}|${e.providerName}|${e.modelId}`}isMissingPeriod=p(()=>{if(this.state.loading())return!1;let t=this.state.aggregation()?.total;return t?t.totalTokens===null&&(t.cost===null||t.cost===void 0):!1});isPartialPeriod=p(()=>!this.isMissingPeriod()&&this.state.tokenDataPartial());navigateBack(){this.location.back()}formatTokenValue(t){return t===null?we:new D("en-US").transform(t,"1.0-2")??"0"}formatCostValue(t,e){return t?we:"$"+(new D("en-US").transform(e??0,"1.2-2")??"0.00")}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=L({type:o,selectors:[["app-token-usage"]],decls:41,vars:8,consts:[[1,"page"],[1,"page__header"],[1,"page__title-block"],["mat-icon-button","","title","Back",3,"click"],[1,"page__title"],[1,"page__subtitle"],[1,"filters"],[1,"filters__field"],[1,"filters__label"],[1,"filters__control"],["type","date",1,"filters__input",3,"ngModelChange","ngModel"],["type","button",1,"filters__clear",3,"click","disabled"],[1,"filters__select",3,"ngModelChange","ngModel"],["value","byModel"],["value","byAgent"],["type","button",1,"filters__apply",3,"click","disabled"],[1,"card"],[1,"card","card--error"],[1,"grid"],[1,"kpis"],[1,"kpi"],[1,"kpi__label"],[1,"kpi__value"],["title","Some calls in this period were recorded before token tracking was enabled. Token counts reflect only the portion where data was collected.",1,"hint"],["title","No token usage data was collected for this period.",1,"hint"],[1,"muted"],[1,"card__title"],[1,"table"],[1,"table__head"],[1,"table__cell"],[1,"table__cell","table__cell--num"],[1,"table__body"],[1,"table__row"],[1,"table__row","table__row--total"],[3,"points"]],template:function(e,n){e&1&&(r(0,"section",0)(1,"header",1)(2,"div",2)(3,"button",3),P("click",function(){return n.navigateBack()}),r(4,"mat-icon"),a(5,"chevron_left"),l()(),r(6,"div")(7,"h1",4),a(8,"Token Usage"),l(),r(9,"p",5),a(10,"Track prompt and completion token usage by agent and model."),l()()(),r(11,"div",6)(12,"label",7)(13,"span",8),a(14,"From"),l(),r(15,"div",9)(16,"input",10),P("ngModelChange",function(d){return n.onFromChange(d)}),l(),r(17,"button",11),P("click",function(){return n.clearFrom()}),a(18," Clear "),l()()(),r(19,"label",7)(20,"span",8),a(21,"To"),l(),r(22,"div",9)(23,"input",10),P("ngModelChange",function(d){return n.onToChange(d)}),l(),r(24,"button",11),P("click",function(){return n.clearTo()}),a(25," Clear "),l()()(),r(26,"label",7)(27,"span",8),a(28,"View"),l(),r(29,"select",12),P("ngModelChange",function(d){return n.view.set(d)}),r(30,"option",13),a(31,"By model"),l(),r(32,"option",14),a(33,"By agent"),l()()(),r(34,"button",15),P("click",function(){return n.apply()}),a(35,"Apply"),l()()(),v(36,Qe,20,12),v(37,Ze,3,0,"div",16)(38,et,5,1,"div",17)(39,tt,5,0,"div",16)(40,at,30,2,"div",18),l()),e&2&&(s(16),S("ngModel",n.state.draftFilters().from),s(),S("disabled",!n.state.draftFilters().from),s(6),S("ngModel",n.state.draftFilters().to),s(),S("disabled",!n.state.draftFilters().to),s(5),S("ngModel",n.view()),s(5),S("disabled",n.state.loading()),s(2),y(n.totalRow()?36:-1),s(),y(n.state.loading()?37:n.state.error()?38:n.isEmpty()?39:40))},dependencies:[ke,Ce,Te,be,xe,ve,ye,Y,ue,ge,fe,he,J,q],styles:[".page[_ngcontent-%COMP%]{padding:1.5rem;color:var(--color-text, #1d1d1f)}.page__header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:1.5rem;margin-bottom:1rem}.page__title-block[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.75rem}.page__title[_ngcontent-%COMP%]{margin:0;font-size:1.25rem;font-weight:650}.page__subtitle[_ngcontent-%COMP%]{margin:.25rem 0 0;color:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:.95rem}.filters[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:flex-end;gap:.75rem}.filters__field[_ngcontent-%COMP%]{display:grid;gap:.25rem}.filters__label[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, rgba(29, 29, 31, .7))}.filters__control[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.filters__input[_ngcontent-%COMP%], .filters__select[_ngcontent-%COMP%]{height:34px;padding:0 .5rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:var(--color-bg-secondary, rgba(255, 255, 255, .72));color:var(--color-text, #1d1d1f)}.filters__apply[_ngcontent-%COMP%], .filters__clear[_ngcontent-%COMP%]{height:34px;padding:0 .75rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .12));background:var(--color-bg-secondary, rgba(255, 255, 255, .72));color:var(--color-text, #1d1d1f);cursor:pointer}.kpis[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.75rem;margin:.75rem 0 1rem}@media(max-width:900px){.kpis[_ngcontent-%COMP%]{grid-template-columns:1fr}}.kpi[_ngcontent-%COMP%]{border-radius:14px;padding:.75rem 1rem;background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));box-shadow:var(--glass-shadow, 0 8px 24px rgba(0, 0, 0, .08))}.kpi__label[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, rgba(29, 29, 31, .7))}.kpi__value[_ngcontent-%COMP%]{margin-top:.25rem;font-size:1.2rem;font-weight:650;font-variant-numeric:tabular-nums}.filters__apply[_ngcontent-%COMP%]{border-color:var(--color-primary, #007aff);background:var(--color-primary, #007aff);color:var(--color-text-inverse, #ffffff)}.filters__apply[_ngcontent-%COMP%]:disabled, .filters__clear[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:not-allowed}.grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1.5fr 1fr;gap:1rem;align-items:start}@media(max-width:1100px){.grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.card[_ngcontent-%COMP%]{border-radius:14px;padding:1rem;background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));box-shadow:var(--glass-shadow, 0 8px 24px rgba(0, 0, 0, .08))}.card--error[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.card__title[_ngcontent-%COMP%]{font-weight:650;margin-bottom:.75rem}.muted[_ngcontent-%COMP%]{color:var(--color-text-secondary, rgba(29, 29, 31, .7))}.table[_ngcontent-%COMP%]{overflow-x:auto}.table__head[_ngcontent-%COMP%], .table__row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr 2fr 1fr 1fr 1fr .7fr 1fr;gap:.5rem;align-items:center}.table__head[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, rgba(29, 29, 31, .7));padding:.25rem 0;border-bottom:1px solid var(--color-border-light, rgba(0, 0, 0, .08))}.table__row[_ngcontent-%COMP%]{padding:.5rem 0;border-bottom:1px solid var(--color-border-light, rgba(0, 0, 0, .08))}.table__row--total[_ngcontent-%COMP%]{font-weight:650;background:var(--color-bg-hover, rgba(0, 0, 0, .03));border-radius:10px;padding:.6rem .5rem;border-bottom:none;margin-top:.5rem}.table__cell[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.table__cell--num[_ngcontent-%COMP%]{text-align:right;font-variant-numeric:tabular-nums}.hint[_ngcontent-%COMP%]{margin:.25rem 0 1rem;color:var(--color-text-secondary, rgba(29, 29, 31, .7));font-size:.85rem}"]})};export{De as TokenUsageComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as a}from"./chunk-OK747ZMT.js";import"./chunk-YDXVLOQW.js";import"./chunk-PKKHLHXJ.js";import"./chunk-2DE3OXG3.js";import"./chunk-KYPMYRHP.js";import"./chunk-VNGIXNER.js";import"./chunk-PWN5O4WY.js";import"./chunk-DJBCK5D7.js";export{a as NamespaceListComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as x,Kc as k,Lc as u,Nc as j,X as A,_ as D,a as b,aa as O,b as f,ba as G,g as _,oa as L}from"./chunk-DJBCK5D7.js";var y=class{apiKeys;username;password;accessToken;basePath;withCredentials;encoder;encodeParam;credentials;constructor({accessToken:h,apiKeys:n,basePath:a,credentials:i,encodeParam:o,encoder:t,password:e,username:c,withCredentials:l}={}){n&&(this.apiKeys=n),c!==void 0&&(this.username=c),e!==void 0&&(this.password=e),h!==void 0&&(this.accessToken=h),a!==void 0&&(this.basePath=a),l!==void 0&&(this.withCredentials=l),t&&(this.encoder=t),this.encodeParam=o??(r=>this.defaultEncodeParam(r)),this.credentials=i??{}}selectHeaderContentType(h){if(h.length===0)return;let n=h.find(a=>this.isJsonMime(a));return n===void 0?h[0]:n}selectHeaderAccept(h){if(h.length===0)return;let n=h.find(a=>this.isJsonMime(a));return n===void 0?h[0]:n}isJsonMime(h){let n=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return h!==null&&(n.test(h)||h.toLowerCase()==="application/json-patch+json")}lookupCredential(h){let n=this.credentials[h];return typeof n=="function"?n():n}addCredentialToHeaders(h,n,a,i){let o=this.lookupCredential(h);return o?a.set(n,(i??"")+o):a}addCredentialToQuery(h,n,a){let i=this.lookupCredential(h);return i?a.set(n,i):a}defaultEncodeParam(h){let n=h.dataFormat==="date-time"&&h.value instanceof Date?h.value.toISOString():h.value;return encodeURIComponent(String(n))}};var v=new D("basePath");var V=class{encodeKey(h){return encodeURIComponent(h)}encodeValue(h){return encodeURIComponent(h)}decodeKey(h){return decodeURIComponent(h)}decodeValue(h){return decodeURIComponent(h)}};var m=class{basePath="http://localhost:8124";defaultHeaders=new k;configuration;encoder;constructor(h,n){if(this.configuration=n||new y,typeof this.configuration.basePath!="string"){let a=Array.isArray(h)?h[0]:void 0;a!=null&&(h=a),typeof h!="string"&&(h=this.basePath),this.configuration.basePath=h}this.encoder=this.configuration.encoder||new V}canConsumeForm(h){return h.indexOf("multipart/form-data")!==-1}addToHttpParams(h,n,a,i=!1){return typeof n=="object"&&!(n instanceof Date)?this.addToHttpParamsRecursive(h,n,i?a:void 0,i):this.addToHttpParamsRecursive(h,n,a)}addToHttpParamsRecursive(h,n,a,i=!1){if(n==null)return h;if(typeof n=="object"){if(a!=null)return i?Object.keys(n).reduce((o,t)=>o.append(`${a}[${t}]`,n[t]),h):h.append(a,JSON.stringify(n));if(Array.isArray(n))n.forEach(o=>h=this.addToHttpParamsRecursive(h,o,a));else if(n instanceof Date)if(a!=null)h=h.append(a,n.toISOString());else throw Error("key may not be null if value is Date");else Object.keys(n).forEach(o=>{let t=a?`${a}.${o}`:o;h=this.addToHttpParamsRecursive(h,n[o],t)});return h}else if(a!=null)return h.append(a,n);throw Error("key may not be null if value is not object or array")}};var R=class C extends m{constructor(n,a,i){super(a,i);this.httpClient=n}createAiModel(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter aiModel was null or undefined when calling createAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let p="/api/ai-models",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${p}`,f(b({context:c,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}deleteAiModel(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/ai-models/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdAiModel(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/ai-models/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdsAiModel(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIdsAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let p="/api/ai-models/by-ids",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${p}`,f(b({context:c,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}listByNamespaceIdAiModel(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling listByNamespaceIdAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/ai-models/by-namespaceId/${this.configuration.encodeParam({name:"namespaceId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}listByParentAiModel(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/ai-models/by-parentId/${this.configuration.encodeParam({name:"parentId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}updateAiModel(n,a,i="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateAiModel.");if(a==null)throw new Error("Required parameter aiModel was null or undefined when calling updateAiModel.");let e=this.defaultHeaders,c=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);c!==void 0&&(e=e.set("Accept",c));let l=t?.context??new u,r=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let p="json";c&&(c.startsWith("text")?p="text":this.configuration.isJsonMime(c)?p="json":p="blob");let H=`/api/ai-models/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:g,withCredentials:P}=this.configuration;return this.httpClient.request("put",`${g}${H}`,f(b({context:l,body:a,responseType:p},P?{withCredentials:P}:{}),{headers:e,observe:i,transferCache:r,reportProgress:o}))}static \u0275fac=function(a){return new(a||C)(x(j),x(v,8),x(y,8))};static \u0275prov=A({token:C,factory:C.\u0275fac,providedIn:"root"})};var E=class C extends m{constructor(n,a,i){super(a,i);this.httpClient=n}createAiProvider(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter aiProvider was null or undefined when calling createAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let p="/api/ai-providers",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${p}`,f(b({context:c,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}deleteAiProvider(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/ai-providers/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdAiProvider(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/ai-providers/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdsAiProvider(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIdsAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let p="/api/ai-providers/by-ids",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${p}`,f(b({context:c,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}listByNamespaceIdAiProvider(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling listByNamespaceIdAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/ai-providers/by-namespaceId/${this.configuration.encodeParam({name:"namespaceId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}listByParentAiProvider(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/ai-providers/by-parentId/${this.configuration.encodeParam({name:"parentId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}listByUserIdAiProvider(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter userId was null or undefined when calling listByUserIdAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/ai-providers/by-userId/${this.configuration.encodeParam({name:"userId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}updateAiProvider(n,a,i="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateAiProvider.");if(a==null)throw new Error("Required parameter aiProvider was null or undefined when calling updateAiProvider.");let e=this.defaultHeaders,c=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);c!==void 0&&(e=e.set("Accept",c));let l=t?.context??new u,r=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let p="json";c&&(c.startsWith("text")?p="text":this.configuration.isJsonMime(c)?p="json":p="blob");let H=`/api/ai-providers/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:g,withCredentials:P}=this.configuration;return this.httpClient.request("put",`${g}${H}`,f(b({context:l,body:a,responseType:p},P?{withCredentials:P}:{}),{headers:e,observe:i,transferCache:r,reportProgress:o}))}static \u0275fac=function(a){return new(a||C)(x(j),x(v,8),x(y,8))};static \u0275prov=A({token:C,factory:C.\u0275fac,providedIn:"root"})};var B=class C extends m{constructor(n,a,i){super(a,i);this.httpClient=n}addMessageCase(n,a,i="body",o=!1,t){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling addMessageCase.");if(a==null)throw new Error("Required parameter addMessageRequest was null or undefined when calling addMessageCase.");let e=this.defaultHeaders,c=t?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);c!==void 0&&(e=e.set("Accept",c));let l=t?.context??new u,r=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let p="json";c&&(c.startsWith("text")?p="text":this.configuration.isJsonMime(c)?p="json":p="blob");let H=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/messages`,{basePath:g,withCredentials:P}=this.configuration;return this.httpClient.request("post",`${g}${H}`,f(b({context:l,body:a,responseType:p},P?{withCredentials:P}:{}),{headers:e,observe:i,transferCache:r,reportProgress:o}))}createCase(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter _case was null or undefined when calling createCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let p="/api/cases",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${p}`,f(b({context:c,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}deleteCase(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdCase(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdsCase(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIdsCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let p="/api/cases/by-ids",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${p}`,f(b({context:c,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}interruptCase(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling interruptCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/interrupt`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("post",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}killCase(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling killCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/kill`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("post",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}listByParentCase(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/cases/by-parentId/${this.configuration.encodeParam({name:"parentId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}updateCase(n,a,i="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateCase.");if(a==null)throw new Error("Required parameter _case was null or undefined when calling updateCase.");let e=this.defaultHeaders,c=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);c!==void 0&&(e=e.set("Accept",c));let l=t?.context??new u,r=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let p="json";c&&(c.startsWith("text")?p="text":this.configuration.isJsonMime(c)?p="json":p="blob");let H=`/api/cases/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:g,withCredentials:P}=this.configuration;return this.httpClient.request("put",`${g}${H}`,f(b({context:l,body:a,responseType:p},P?{withCredentials:P}:{}),{headers:e,observe:i,transferCache:r,reportProgress:o}))}static \u0275fac=function(a){return new(a||C)(x(j),x(v,8),x(y,8))};static \u0275prov=A({token:C,factory:C.\u0275fac,providedIn:"root"})};var $=class C extends m{constructor(n,a,i){super(a,i);this.httpClient=n}createIntegrationConfig(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter integrationConfig was null or undefined when calling createIntegrationConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let p="/api/integration-configs",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${p}`,f(b({context:c,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}deleteIntegrationConfig(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteIntegrationConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/integration-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdIntegrationConfig(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdIntegrationConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/integration-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdsIntegrationConfig(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIdsIntegrationConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let p="/api/integration-configs/by-ids",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${p}`,f(b({context:c,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}listByParentIntegrationConfig(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentIntegrationConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/integration-configs/by-parentId/${this.configuration.encodeParam({name:"parentId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}updateIntegrationConfig(n,a,i="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateIntegrationConfig.");if(a==null)throw new Error("Required parameter integrationConfig was null or undefined when calling updateIntegrationConfig.");let e=this.defaultHeaders,c=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);c!==void 0&&(e=e.set("Accept",c));let l=t?.context??new u,r=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let p="json";c&&(c.startsWith("text")?p="text":this.configuration.isJsonMime(c)?p="json":p="blob");let H=`/api/integration-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:g,withCredentials:P}=this.configuration;return this.httpClient.request("put",`${g}${H}`,f(b({context:l,body:a,responseType:p},P?{withCredentials:P}:{}),{headers:e,observe:i,transferCache:r,reportProgress:o}))}static \u0275fac=function(a){return new(a||C)(x(j),x(v,8),x(y,8))};static \u0275prov=A({token:C,factory:C.\u0275fac,providedIn:"root"})};var M=class C extends m{constructor(n,a,i){super(a,i);this.httpClient=n}getTypeIntegrationType(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter type was null or undefined when calling getTypeIntegrationType.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/integration-types/${this.configuration.encodeParam({name:"type",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}listTypesIntegrationType(n="body",a=!1,i){let o=this.defaultHeaders,t=i?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);t!==void 0&&(o=o.set("Accept",t));let e=i?.context??new u,c=i?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let r="/api/integration-types",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("get",`${d}${r}`,f(b({context:e,responseType:l},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:c,reportProgress:a}))}static \u0275fac=function(a){return new(a||C)(x(j),x(v,8),x(y,8))};static \u0275prov=A({token:C,factory:C.\u0275fac,providedIn:"root"})};var q=class C extends m{constructor(n,a,i){super(a,i);this.httpClient=n}createNamespace(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter namespace was null or undefined when calling createNamespace.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let p="/api/namespaces",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${p}`,f(b({context:c,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}deleteNamespace(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteNamespace.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdNamespace(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdNamespace.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdsNamespace(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIdsNamespace.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let p="/api/namespaces/by-ids",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${p}`,f(b({context:c,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}listAllNamespace(n="body",a=!1,i){let o=this.defaultHeaders,t=i?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);t!==void 0&&(o=o.set("Accept",t));let e=i?.context??new u,c=i?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let r="/api/namespaces",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("get",`${d}${r}`,f(b({context:e,responseType:l},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:c,reportProgress:a}))}listByParentNamespace(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentNamespace.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/namespaces/by-parentId/${this.configuration.encodeParam({name:"parentId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}updateNamespace(n,a,i="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateNamespace.");if(a==null)throw new Error("Required parameter namespace was null or undefined when calling updateNamespace.");let e=this.defaultHeaders,c=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);c!==void 0&&(e=e.set("Accept",c));let l=t?.context??new u,r=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let p="json";c&&(c.startsWith("text")?p="text":this.configuration.isJsonMime(c)?p="json":p="blob");let H=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:g,withCredentials:P}=this.configuration;return this.httpClient.request("put",`${g}${H}`,f(b({context:l,body:a,responseType:p},P?{withCredentials:P}:{}),{headers:e,observe:i,transferCache:r,reportProgress:o}))}static \u0275fac=function(a){return new(a||C)(x(j),x(v,8),x(y,8))};static \u0275prov=A({token:C,factory:C.\u0275fac,providedIn:"root"})};var K=(a=>(a.OpenAI="OpenAI",a.Anthropic="Anthropic",a.Gemini="Gemini",a))(K||{});var S=class C extends m{constructor(n,a,i){super(a,i);this.httpClient=n}createAgentConfig(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter agentConfig was null or undefined when calling createAgentConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let p="/api/agent-configs",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${p}`,f(b({context:c,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}deleteAgentConfig(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteAgentConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/agent-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdAgentConfig(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdAgentConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/agent-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdsAgentConfig(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIdsAgentConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let p="/api/agent-configs/by-ids",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${p}`,f(b({context:c,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}listByParentAgentConfig(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentAgentConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/agent-configs/by-parentId/${this.configuration.encodeParam({name:"parentId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}updateAgentConfig(n,a,i="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateAgentConfig.");if(a==null)throw new Error("Required parameter agentConfig was null or undefined when calling updateAgentConfig.");let e=this.defaultHeaders,c=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);c!==void 0&&(e=e.set("Accept",c));let l=t?.context??new u,r=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let p="json";c&&(c.startsWith("text")?p="text":this.configuration.isJsonMime(c)?p="json":p="blob");let H=`/api/agent-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:g,withCredentials:P}=this.configuration;return this.httpClient.request("put",`${g}${H}`,f(b({context:l,body:a,responseType:p},P?{withCredentials:P}:{}),{headers:e,observe:i,transferCache:r,reportProgress:o}))}static \u0275fac=function(a){return new(a||C)(x(j),x(v,8),x(y,8))};static \u0275prov=A({token:C,factory:C.\u0275fac,providedIn:"root"})};var N=class C extends m{constructor(n,a,i){super(a,i);this.httpClient=n}getByIdCaseEventRest(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdCaseEventRest.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/case-events/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdsCaseEventRest(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIdsCaseEventRest.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let p="/api/case-events/by-ids",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${p}`,f(b({context:c,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}listByCaseCaseEventRest(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling listByCaseCaseEventRest.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/case-events/by-parentId/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}static \u0275fac=function(a){return new(a||C)(x(j),x(v,8),x(y,8))};static \u0275prov=A({token:C,factory:C.\u0275fac,providedIn:"root"})};var U=class C extends m{constructor(n,a,i){super(a,i);this.httpClient=n}debugAllPlugins(n="body",a=!1,i){let o=this.defaultHeaders,t=i?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);t!==void 0&&(o=o.set("Accept",t));let e=i?.context??new u,c=i?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let r="/api/plugins/debug",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("get",`${d}${r}`,f(b({context:e,responseType:l},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:c,reportProgress:a}))}debugPlugin(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling debugPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/debug`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getAllPlugins(n="body",a=!1,i){let o=this.defaultHeaders,t=i?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);t!==void 0&&(o=o.set("Accept",t));let e=i?.context??new u,c=i?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let r="/api/plugins",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("get",`${d}${r}`,f(b({context:e,responseType:l},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:c,reportProgress:a}))}getPlugin(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling getPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}reloadAllAgentsPlugin(n="body",a=!1,i){let o=this.defaultHeaders,t=i?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);t!==void 0&&(o=o.set("Accept",t));let e=i?.context??new u,c=i?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let r="/api/plugins/reload-agents",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("post",`${d}${r}`,f(b({context:e,responseType:l},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:c,reportProgress:a}))}reloadPlugin(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling reloadPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/reload`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("post",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}startPlugin(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling startPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/start`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("post",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}stopPlugin(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling stopPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/stop`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("post",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}unloadPlugin(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling unloadPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}uploadPlugin(n="body",a=!1,i){let o=this.defaultHeaders,t=i?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);t!==void 0&&(o=o.set("Accept",t));let e=i?.context??new u,c=i?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let r="/api/plugins/upload",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("post",`${d}${r}`,f(b({context:e,responseType:l},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:c,reportProgress:a}))}static \u0275fac=function(a){return new(a||C)(x(j),x(v,8),x(y,8))};static \u0275prov=A({token:C,factory:C.\u0275fac,providedIn:"root"})};var J=class C extends m{constructor(n,a,i){super(a,i);this.httpClient=n}streamEventsCaseEventSse(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling streamEventsCaseEventSse.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["text/event-stream"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/events`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}static \u0275fac=function(a){return new(a||C)(x(j),x(v,8),x(y,8))};static \u0275prov=A({token:C,factory:C.\u0275fac,providedIn:"root"})};var W=class C extends m{constructor(n,a,i){super(a,i);this.httpClient=n}createUser(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter user was null or undefined when calling createUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let p="/api/users",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${p}`,f(b({context:c,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}deleteUser(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/users/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdUser(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/users/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdsUser(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIdsUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let p="/api/users/by-ids",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${p}`,f(b({context:c,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getMeUser(n="body",a=!1,i){let o=this.defaultHeaders,t=i?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);t!==void 0&&(o=o.set("Accept",t));let e=i?.context??new u,c=i?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let r="/api/users/me",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("get",`${d}${r}`,f(b({context:e,responseType:l},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:c,reportProgress:a}))}listAllUser(n="body",a=!1,i){let o=this.defaultHeaders,t=i?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);t!==void 0&&(o=o.set("Accept",t));let e=i?.context??new u,c=i?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let r="/api/users",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("get",`${d}${r}`,f(b({context:e,responseType:l},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:c,reportProgress:a}))}listByParentUser(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let c=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/users/by-parentId/${this.configuration.encodeParam({name:"parentId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:p}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:c,responseType:r},p?{withCredentials:p}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}updateUser(n,a,i="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateUser.");if(a==null)throw new Error("Required parameter user was null or undefined when calling updateUser.");let e=this.defaultHeaders,c=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);c!==void 0&&(e=e.set("Accept",c));let l=t?.context??new u,r=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let p="json";c&&(c.startsWith("text")?p="text":this.configuration.isJsonMime(c)?p="json":p="blob");let H=`/api/users/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:g,withCredentials:P}=this.configuration;return this.httpClient.request("put",`${g}${H}`,f(b({context:l,body:a,responseType:p},P?{withCredentials:P}:{}),{headers:e,observe:i,transferCache:r,reportProgress:o}))}static \u0275fac=function(a){return new(a||C)(x(j),x(v,8),x(y,8))};static \u0275prov=A({token:C,factory:C.\u0275fac,providedIn:"root"})};function no(C){return G([typeof C=="string"?{provide:v,useValue:C}:{provide:y,useValue:new y(b({},C))}])}var F=class C{config=O(y);zone=O(L);connect(h){let n=`${this.config.basePath}/api/cases/${h}/events`;return new _(a=>{let i=this.zone.runOutsideAngular(()=>new EventSource(n));return i.onmessage=o=>{try{let t=JSON.parse(o.data);this.zone.run(()=>a.next(t))}catch(t){this.zone.run(()=>a.error(new Error(`Failed to parse SSE event: ${t}`)))}},i.onerror=o=>{i.readyState===EventSource.CLOSED?this.zone.run(()=>a.complete()):this.zone.run(()=>a.error(new Error(`SSE connection error for case ${h}`))),i.close()},()=>i.close()})}static \u0275fac=function(n){return new(n||C)};static \u0275prov=A({token:C,factory:C.\u0275fac,providedIn:"root"})};export{y as a,R as b,E as c,B as d,$ as e,M as f,q as g,U as h,W as i,K as j,no as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as ke}from"./chunk-FCCT54AP.js";import{b as ee}from"./chunk-5UOZGBZ2.js";import{b as We}from"./chunk-TE3JOGRA.js";import{a as te,b as ne,d as ie,e as oe,f as ae,g as re,h as le}from"./chunk-NO2ODJHX.js";import{K as be,M as xe,N as ve,Q as Ae,R as we,S as Se,T as Ee,U as Pe,V as De,W as Oe,X as Ie,Y as Fe,Z as Te,x as ye}from"./chunk-YDXVLOQW.js";import{b as se}from"./chunk-3TOJSAQM.js";import{L as O,P as $,R as I,S as F,T}from"./chunk-PKKHLHXJ.js";import{A as Ce,C as Me,c as de,g as me,m as ce,o as ge,p as pe,w as ue,x as _e,y as fe,z as he}from"./chunk-2DE3OXG3.js";import"./chunk-VNGIXNER.js";import{Ab as c,Cb as m,Ha as d,Mb as L,Nc as Y,Ob as A,Qb as l,Rb as x,Sb as B,Ta as E,Tb as G,Ub as u,Vb as _,Wb as f,X as j,Za as k,Zb as Z,_b as K,aa as h,ec as J,fa as g,g as V,ga as p,gb as N,hc as Q,ib as M,jb as y,kb as W,lb as U,mb as P,nb as D,ob as C,pb as i,qb as o,rb as z,sa as S,vb as q,wb as H,yb as b,yc as X}from"./chunk-DJBCK5D7.js";var v=class s{http=h(Y);projectState=h(se);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/agents`}listEditableAgents(){return this.http.get(`${this.getBaseUrl()}/editable`)}getAgent(t){return this.http.get(`${this.getBaseUrl()}/${encodeURIComponent(t)}`)}createAgent(t,e){return this.http.post(this.getBaseUrl(),{location:e,definition:t})}updateAgent(t,e){return this.http.put(`${this.getBaseUrl()}/${encodeURIComponent(t)}`,{definition:e})}listDocuments(t){return this.http.get(`${this.getBaseUrl()}/documents`,{params:{location:t}})}uploadDocument(t,e){return new V(n=>{let a=new FileReader;a.onload=()=>{let r=a.result.split(",")[1];this.http.post(`${this.getBaseUrl()}/documents`,{filename:e.name,content:r,mimeType:e.type},{params:{location:t}}).subscribe(n)},a.onerror=()=>n.error(a.error),a.readAsDataURL(e)})}deleteAgent(t){return this.http.delete(`${this.getBaseUrl()}/${encodeURIComponent(t)}`)}static \u0275fac=function(e){return new(e||s)};static \u0275prov=j({token:s,factory:s.\u0275fac,providedIn:"root"})};function Ne(s,t){s&1&&(i(0,"p",15),l(1,"No integrations defined \u2014 agent will have access to all tools."),o())}function Ue(s,t){if(s&1){let e=b();i(0,"div",16)(1,"mat-form-field",22)(2,"mat-label"),l(3,"Integration"),o(),i(4,"input",23),f("ngModelChange",function(a){let r=g(e).$implicit;return _(r.integration,a)||(r.integration=a),p(a)}),o()(),i(5,"mat-form-field",24)(6,"mat-label"),l(7,"Tools (comma-separated)"),o(),i(8,"input",25),f("ngModelChange",function(a){let r=g(e).$implicit;return _(r.tools,a)||(r.tools=a),p(a)}),o()(),i(9,"button",26),c("click",function(){let a=g(e).$index,r=m();return p(r.removeIntegrationRow(a))}),i(10,"mat-icon"),l(11,"delete"),o()()()}if(s&2){let e=t.$implicit;d(4),u("ngModel",e.integration),d(4),u("ngModel",e.tools)}}function ze(s,t){if(s&1&&(i(0,"p",30),l(1),o()),s&2){let e=m(2);d(),x(e.docUploadError)}}function qe(s,t){s&1&&(i(0,"p",15),l(1,"No mandatory documents defined."),o())}function He(s,t){if(s&1&&z(0,"option",35),s&2){let e=t.$implicit;C("value","documents/"+e)}}function Ge(s,t){if(s&1){let e=b();i(0,"div",31)(1,"mat-form-field",32)(2,"mat-label"),l(3,"Document path"),o(),i(4,"input",33),f("ngModelChange",function(a){let r=g(e).$index,R=m(2);return _(R.mandatoryDocs[r],a)||(R.mandatoryDocs[r]=a),p(a)}),o(),i(5,"datalist",34),P(6,He,1,1,"option",35,U),o()(),i(8,"button",26),c("click",function(){let a=g(e).$index,r=m(2);return p(r.removeDocRow(a))}),i(9,"mat-icon"),l(10,"delete"),o()()()}if(s&2){let e=t.$index,n=m(2);d(4),u("ngModel",n.mandatoryDocs[e]),N("list","docs-list-"+e),d(),C("id","docs-list-"+e),d(),D(n.availableDocuments)}}function Ze(s,t){if(s&1){let e=b();i(0,"div",6)(1,"span"),l(2,"Mandatory Documents"),o(),i(3,"button",27),c("click",function(){g(e);let a=m();return p(a.addDocRow())}),i(4,"mat-icon"),l(5,"add"),o()(),i(6,"label",28)(7,"mat-icon"),l(8,"upload_file"),o(),i(9,"input",29),c("change",function(a){g(e);let r=m();return p(r.onDocFileSelected(a))}),o()()(),M(10,ze,2,1,"p",30),M(11,qe,2,0,"p",15),P(12,Ge,11,3,"div",31,W)}if(s&2){let e=m();d(6),A("uploading",e.isUploadingDoc),d(3),C("disabled",e.isUploadingDoc),d(),y(e.docUploadError?10:-1),d(),y(e.mandatoryDocs.length===0?11:-1),d(),D(e.mandatoryDocs)}}function Ke(s,t){s&1&&(i(0,"p",15),l(1,"\u{1F4A1} Documents can be added after the agent is created."),o())}function Je(s,t){if(s&1){let e=b();i(0,"div",6),l(1,"Save to"),o(),i(2,"div",36)(3,"label",37)(4,"input",38),f("ngModelChange",function(a){g(e);let r=m();return _(r.location,a)||(r.location=a),p(a)}),o(),i(5,"div",39)(6,"div",40)(7,"span",41),l(8,"\u{1F464}"),o(),i(9,"span",42),l(10,"Project config"),o()(),i(11,"p",43),l(12),o()()(),i(13,"label",37)(14,"input",44),f("ngModelChange",function(a){g(e);let r=m();return _(r.location,a)||(r.location=a),p(a)}),o(),i(15,"div",39)(16,"div",40)(17,"span",41),l(18,"\u{1F4E6}"),o(),i(19,"span",42),l(20,"Colocated"),o()(),i(21,"p",43),l(22,"Next to coday.yaml in ./agents/ (committable)"),o()()()(),i(23,"p",15),l(24,"Storage location is permanent and cannot be changed after creation."),o()}if(s&2){let e=m();d(3),A("selected",e.location==="project"),d(),u("ngModel",e.location),d(8),G("~/.coday/projects/","{","name","}","/agents/ (not committed)"),d(),A("selected",e.location==="colocated"),d(),u("ngModel",e.location)}}function Qe(s,t){if(s&1&&(i(0,"div",17)(1,"span",6),l(2,"Storage Location"),o(),i(3,"span",45),l(4),o(),i(5,"p",15),l(6,"Cannot be changed after creation."),o()()),s&2){let e=m();d(3),A("badge-project",e.location==="project")("badge-colocated",e.location==="colocated"),d(),B(" ",e.location==="project"?"\u{1F464} Project config":"\u{1F4E6} Colocated"," ")}}function Xe(s,t){if(s&1&&(i(0,"div",18)(1,"mat-icon"),l(2,"error"),o(),i(3,"span"),l(4),o()()),s&2){let e=m();d(4),x(e.errorMessage)}}var w=class s{agentCrudApi=h(v);agentApi=h(ke);dialogRef=h(te);data=h(ne);name="";description="";instructions="";aiProvider="";modelName="";temperature=null;maxOutputTokens=null;openaiAssistantId="";integrationRows=[];mandatoryDocs=[];availableDocuments=[];isUploadingDoc=!1;docUploadError="";location="project";isSaving=!1;errorMessage="";isEditMode=!1;ngOnInit(){if(this.isEditMode=this.data.mode==="edit",this.isEditMode&&this.data.agent){let t=this.data.agent.definition;this.name=t.name,this.description=t.description,this.instructions=t.instructions??"",this.aiProvider=t.aiProvider??"",this.modelName=t.modelName??"",this.temperature=t.temperature??null,this.maxOutputTokens=t.maxOutputTokens??null,this.openaiAssistantId=t.openaiAssistantId??"",this.location=this.data.agent.source,t.integrations&&(this.integrationRows=Object.entries(t.integrations).map(([e,n])=>({integration:e,tools:n?.join(", ")??""}))),this.mandatoryDocs=[...t.mandatoryDocs??[]],this.loadAvailableDocuments()}}loadAvailableDocuments(){this.agentCrudApi.listDocuments(this.location).subscribe({next:t=>this.availableDocuments=t,error:()=>this.availableDocuments=[]})}addDocRow(){this.mandatoryDocs.push("")}removeDocRow(t){this.mandatoryDocs.splice(t,1)}onDocFileSelected(t){let e=t.target,n=e.files?.[0];n&&(this.isUploadingDoc=!0,this.docUploadError="",this.agentCrudApi.uploadDocument(this.location,n).subscribe({next:a=>{this.isUploadingDoc=!1,this.mandatoryDocs.push(a.relativePath),this.loadAvailableDocuments(),e.value=""},error:a=>{this.isUploadingDoc=!1,this.docUploadError=a?.error?.error??a?.message??"Upload failed",e.value=""}}))}addIntegrationRow(){this.integrationRows.push({integration:"",tools:""})}removeIntegrationRow(t){this.integrationRows.splice(t,1)}trackByIndex(t){return t}validateForm(){if(!this.name.trim())return this.errorMessage="Name is required",!1;if(!/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/.test(this.name.trim()))return this.errorMessage="Name must start with alphanumeric and contain only letters, digits, hyphens or underscores",!1;if(!this.description.trim())return this.errorMessage="Description is required",!1;for(let t of this.integrationRows)if(!t.integration.trim())return this.errorMessage="Integration name cannot be empty",!1;return!0}buildDefinition(){let t=this.mandatoryDocs.map(n=>n.trim()).filter(Boolean),e=this.integrationRows.length>0?Object.fromEntries(this.integrationRows.filter(n=>n.integration.trim()).map(n=>[n.integration.trim(),n.tools.split(",").map(a=>a.trim()).filter(Boolean)])):void 0;return{name:this.name.trim(),description:this.description.trim(),instructions:this.instructions.trim()||void 0,aiProvider:this.aiProvider.trim()||void 0,modelName:this.modelName.trim()||void 0,temperature:this.temperature??void 0,maxOutputTokens:this.maxOutputTokens??void 0,openaiAssistantId:this.openaiAssistantId.trim()||void 0,integrations:e,mandatoryDocs:t.length>0?t:void 0}}save(){if(this.errorMessage="",!this.validateForm())return;let t=this.buildDefinition();this.isSaving=!0,(this.isEditMode?this.agentCrudApi.updateAgent(this.name.trim(),t):this.agentCrudApi.createAgent(t,this.location)).subscribe({next:()=>{this.isSaving=!1,this.agentApi.clearAllCache(),this.dialogRef.close(!0)},error:n=>{this.isSaving=!1,this.errorMessage=n?.error?.error||n?.message||"Failed to save agent"}})}cancel(){this.dialogRef.close(!1)}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=E({type:s,selectors:[["app-agent-form"]],decls:69,vars:18,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","my-agent","required","",3,"ngModelChange","ngModel","readonly"],["matInput","","placeholder","What does this agent do?","rows","2","required","",3,"ngModelChange","ngModel"],["matInput","","placeholder","System instructions for the agent...","rows","6",3,"ngModelChange","ngModel"],[1,"section-title"],[1,"row-2col"],["appearance","outline"],["matInput","","placeholder","e.g. anthropic, openai",3,"ngModelChange","ngModel"],["matInput","","placeholder","e.g. claude-sonnet-4-5",3,"ngModelChange","ngModel"],["matInput","","type","number","min","0","max","2","step","0.1","placeholder","0.0 \u2013 2.0",3,"ngModelChange","ngModel"],["matInput","","type","number","min","1","placeholder","e.g. 4096",3,"ngModelChange","ngModel"],["matInput","","placeholder","asst_...",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Add integration",3,"click"],[1,"hint"],[1,"integration-row"],[1,"source-display"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],["appearance","outline",1,"integration-name"],["matInput","","placeholder","e.g. GITHUB",3,"ngModelChange","ngModel"],["appearance","outline",1,"integration-tools"],["matInput","","placeholder","Leave empty for all tools",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove",3,"click"],["mat-icon-button","","type","button","title","Add document path",3,"click"],["title","Upload a document to the pool",1,"upload-btn"],["type","file","hidden","",3,"change","disabled"],[1,"doc-upload-error"],[1,"doc-row"],["appearance","outline",1,"doc-field"],["matInput","","placeholder","documents/guide.md",3,"ngModelChange","ngModel"],[3,"id"],[3,"value"],[1,"source-options"],[1,"source-option"],["type","radio","name","location","value","project",3,"ngModelChange","ngModel"],[1,"source-content"],[1,"source-header"],[1,"source-icon"],[1,"source-label"],[1,"source-description"],["type","radio","name","location","value","colocated",3,"ngModelChange","ngModel"],[1,"source-badge"]],template:function(e,n){e&1&&(i(0,"h2",0),l(1),o(),i(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),l(6,"Name"),o(),i(7,"input",3),f("ngModelChange",function(r){return _(n.name,r)||(n.name=r),r}),o(),i(8,"mat-hint"),l(9,"Alphanumeric, hyphens and underscores only. Cannot be changed after creation."),o()(),i(10,"mat-form-field",2)(11,"mat-label"),l(12,"Description"),o(),i(13,"textarea",4),f("ngModelChange",function(r){return _(n.description,r)||(n.description=r),r}),o()(),i(14,"mat-form-field",2)(15,"mat-label"),l(16,"Instructions"),o(),i(17,"textarea",5),f("ngModelChange",function(r){return _(n.instructions,r)||(n.instructions=r),r}),o(),i(18,"mat-hint"),l(19,"System prompt / instructions sent to the AI model"),o()(),i(20,"div",6),l(21,"AI Configuration"),o(),i(22,"div",7)(23,"mat-form-field",8)(24,"mat-label"),l(25,"AI Provider"),o(),i(26,"input",9),f("ngModelChange",function(r){return _(n.aiProvider,r)||(n.aiProvider=r),r}),o()(),i(27,"mat-form-field",8)(28,"mat-label"),l(29,"Model Name"),o(),i(30,"input",10),f("ngModelChange",function(r){return _(n.modelName,r)||(n.modelName=r),r}),o()()(),i(31,"div",7)(32,"mat-form-field",8)(33,"mat-label"),l(34,"Temperature"),o(),i(35,"input",11),f("ngModelChange",function(r){return _(n.temperature,r)||(n.temperature=r),r}),o(),i(36,"mat-hint"),l(37,"Leave empty for model default"),o()(),i(38,"mat-form-field",8)(39,"mat-label"),l(40,"Max Output Tokens"),o(),i(41,"input",12),f("ngModelChange",function(r){return _(n.maxOutputTokens,r)||(n.maxOutputTokens=r),r}),o(),i(42,"mat-hint"),l(43,"Leave empty for model default"),o()()(),i(44,"mat-form-field",2)(45,"mat-label"),l(46,"OpenAI Assistant ID"),o(),i(47,"input",13),f("ngModelChange",function(r){return _(n.openaiAssistantId,r)||(n.openaiAssistantId=r),r}),o(),i(48,"mat-hint"),l(49,"If set, forces aiProvider to openai"),o()(),i(50,"div",6)(51,"span"),l(52,"Integrations"),o(),i(53,"button",14),c("click",function(){return n.addIntegrationRow()}),i(54,"mat-icon"),l(55,"add"),o()()(),M(56,Ne,2,0,"p",15),P(57,Ue,12,2,"div",16,W),M(59,Ze,14,5)(60,Ke,2,0,"p",15),M(61,Je,25,8),M(62,Qe,7,5,"div",17),M(63,Xe,5,1,"div",18),o()(),i(64,"mat-dialog-actions",19)(65,"button",20),c("click",function(){return n.cancel()}),l(66,"Cancel"),o(),i(67,"button",21),c("click",function(){return n.save()}),l(68),o()()),e&2&&(d(),x(n.isEditMode?"Edit Agent":"Create Agent"),d(6),u("ngModel",n.name),C("readonly",n.isEditMode),d(6),u("ngModel",n.description),d(4),u("ngModel",n.instructions),d(9),u("ngModel",n.aiProvider),d(4),u("ngModel",n.modelName),d(5),u("ngModel",n.temperature),d(6),u("ngModel",n.maxOutputTokens),d(6),u("ngModel",n.openaiAssistantId),d(9),y(n.integrationRows.length===0?56:-1),d(),D(n.integrationRows),d(2),y(n.isEditMode?59:60),d(2),y(n.isEditMode?-1:61),d(),y(n.isEditMode?62:-1),d(),y(n.errorMessage?63:-1),d(2),C("disabled",n.isSaving),d(2),C("disabled",n.isSaving),d(),B(" ",n.isSaving?"Saving...":"Save"," "))},dependencies:[Me,ue,_e,de,ge,pe,me,Ce,he,fe,ce,le,oe,re,ae,I,$,O,Ee,Se,Ae,xe,ve,we,T,F,We,ee],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:560px}@media(max-width:768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.section-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;font-size:1rem;font-weight:600;margin-top:.5rem;margin-bottom:-.25rem}.row-2col[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}@media(max-width:768px){.row-2col[_ngcontent-%COMP%]{grid-template-columns:1fr}}.integration-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.integration-row[_ngcontent-%COMP%] .integration-name[_ngcontent-%COMP%]{flex:0 0 180px}.integration-row[_ngcontent-%COMP%] .integration-tools[_ngcontent-%COMP%]{flex:1}.hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.source-options[_ngcontent-%COMP%]{display:flex;gap:1rem;margin-bottom:.5rem}@media(max-width:768px){.source-options[_ngcontent-%COMP%]{flex-direction:column}}.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-option[_ngcontent-%COMP%]:hover{border-color:var(--color-primary);background:var(--color-bg-hover)}.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-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin-top:2px;cursor:pointer}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%]{flex:1}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.25rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-label[_ngcontent-%COMP%]{font-weight:600;font-size:.95rem}.source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-description[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-family:monospace;line-height:1.4}.source-display[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem 1rem;border-radius:6px;font-size:.9rem;font-weight:500}.source-badge.badge-project[_ngcontent-%COMP%]{background:#2196f31a;color:#2196f3;border:1px solid rgba(33,150,243,.3)}.source-badge.badge-colocated[_ngcontent-%COMP%]{background:#4caf501a;color:#4caf50;border:1px solid rgba(76,175,80,.3)}.doc-row[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.doc-row[_ngcontent-%COMP%] .doc-field[_ngcontent-%COMP%]{flex:1}.upload-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;cursor:pointer;color:var(--color-text-secondary);transition:background .2s}.upload-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover);color:var(--color-primary)}.upload-btn.uploading[_ngcontent-%COMP%]{opacity:.5;cursor:wait}.upload-btn[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.doc-upload-error[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-error)}.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 Ye=()=>[],$e=s=>({id:s});function et(s,t){if(s&1&&(i(0,"div",5),l(1),o()),s&2){let e=m();d(),x(e.errorMessage())}}function tt(s,t){if(s&1){let e=b();i(0,"ds-entity-card",7),c("selected",function(a){g(e);let r=m();return p(r.onEdit(a))}),q(1,8),i(2,"button",9),c("click",function(a){return a.stopPropagation()}),i(3,"mat-icon"),l(4,"more_vert"),o()(),H(),o()}if(s&2){let e=t.$implicit;m();let n=L(9);C("id",e.id)("name",e.name)("description",e.description)("badges",e.badges??Z(6,Ye)),d(2),C("matMenuTriggerFor",n)("matMenuTriggerData",K(7,$e,e.id))}}function nt(s,t){if(s&1){let e=b();i(0,"button",10),c("click",function(){let a=g(e).id,r=m();return p(r.onEdit(a))}),i(1,"mat-icon"),l(2,"edit"),o(),l(3," Edit "),o(),i(4,"button",11),c("click",function(){let a=g(e).id,r=m();return p(r.onDelete(a))}),i(5,"mat-icon"),l(6,"delete"),o(),l(7," Delete "),o()}}var Be=class s{agentCrudApi=h(v);location=h(X);dialog=h(ie);agents=S([]);isLoading=S(!1);errorMessage=S(null);agentItems=Q(()=>this.agents().map(t=>({id:t.name,name:t.name,description:t.description,badges:this.buildBadges(t),groupKey:t.source,groupLabel:t.source==="project"?"Project (~/.coday/)":"Colocated (next to coday.yaml)"})));ngOnInit(){this.loadAgents()}loadAgents(){this.isLoading.set(!0),this.errorMessage.set(null),this.agentCrudApi.listEditableAgents().subscribe({next:t=>{this.agents.set(t),this.isLoading.set(!1)},error:t=>{this.errorMessage.set(t?.error?.error??"Failed to load agents"),this.isLoading.set(!1)}})}onBack(){this.location.back()}onCreate(){this.dialog.open(w,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadAgents()})}onEdit(t){this.agentCrudApi.getAgent(t).subscribe({next:e=>{this.dialog.open(w,{width:"700px",maxHeight:"90vh",data:{mode:"edit",agent:e}}).afterClosed().subscribe(a=>{a&&this.loadAgents()})},error:e=>this.errorMessage.set(e?.error?.error??"Failed to load agent")})}onDelete(t){confirm(`Are you sure you want to delete agent "${t}"?`)&&this.agentCrudApi.deleteAgent(t).subscribe({next:()=>this.loadAgents(),error:e=>this.errorMessage.set(e?.error?.error??"Failed to delete agent")})}buildBadges(t){return[t.source==="project"?{label:"project",variant:"info"}:{label:"colocated",variant:"success"}]}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=E({type:s,selectors:[["app-agent-list"]],decls:11,vars:4,consts:[["agentCard",""],["cardMenu","matMenu"],[1,"agent-list-page"],["title","Agents","cardMinWidth","260px","contentMaxWidth","1400px","searchPlaceholder","Filter agents\u2026","emptyMessage","No file-based agents found.",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","mat-icon-button","","title","Back",3,"click"],[1,"agent-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,"agent-list__delete-item",3,"click"]],template:function(e,n){if(e&1&&(i(0,"div",2)(1,"ds-entity-list",3),c("createRequested",function(){return n.onCreate()}),i(2,"button",4),c("click",function(){return n.onBack()}),i(3,"mat-icon"),l(4,"chevron_left"),o()()(),M(5,et,2,1,"div",5),o(),k(6,tt,5,9,"ng-template",null,0,J),i(8,"mat-menu",null,1),k(10,nt,8,0,"ng-template",6),o()),e&2){let a=L(7);d(),C("items",n.agentItems())("showCreate",!0)("itemTemplate",a),d(4),y(n.errorMessage()?5:-1)}},dependencies:[Pe,be,ye,I,O,T,F,Te,Ie,De,Oe,Fe],styles:["[_nghost-%COMP%]{display:block;width:100%;min-height:100vh;background:var(--color-bg);overflow-y:auto}.agent-list__delete-item[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.agent-list__delete-item[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:inherit}.agent-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{Be as AgentListComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{v as Q}from"./chunk-YDXVLOQW.js";import"./chunk-PKKHLHXJ.js";import{D as H,c as B,e as u,g as L,h as j,i as G,l as C,n as J,s as A,u as $,v as q,w as K,x as U}from"./chunk-2DE3OXG3.js";import{e as R,f as z}from"./chunk-KYPMYRHP.js";import{a as M,b as I}from"./chunk-VNGIXNER.js";import{a as F,c as N}from"./chunk-PWN5O4WY.js";import{Ab as p,Cb as g,Ha as l,Qb as r,Rb as x,Sb as V,Ta as P,a as S,aa as c,b as O,fa as f,ga as _,hb as T,hc as D,ib as b,jb as y,la as k,mb as w,nb as E,ob as s,pb as i,qb as o,rb as h,sa as d,yb as v}from"./chunk-DJBCK5D7.js";function Y(a,t){a&1&&(i(0,"p",5),r(1,"Loading\u2026"),o())}function Z(a,t){if(a&1&&(i(0,"option",13),r(1),o()),a&2){let e=t.$implicit;s("value",e.type),l(),x(e.displayName)}}function ee(a,t){if(a&1){let e=v();i(0,"div",18)(1,"ds-json-schema-form",22),p("valueChange",function(m){f(e);let X=g(2);return _(X.onParamsChange(m))}),o()()}if(a&2){let e=g(2);l(),s("schema",t)("value",e.initialParams())}}function te(a,t){if(a&1){let e=v();i(0,"form",7),p("ngSubmit",function(){f(e);let m=g();return _(m.submit())}),i(1,"div",8)(2,"label",9),r(3,"Type "),i(4,"span",10),r(5,"*"),o()(),i(6,"select",11)(7,"option",12),r(8,"Select type"),o(),w(9,Z,2,2,"option",13,T().trackByType,!0),o()(),i(11,"div",8)(12,"label",14),r(13,"Name "),i(14,"span",10),r(15,"*"),o()(),h(16,"input",15),o(),i(17,"div",8)(18,"label",16),r(19,"Description"),o(),h(20,"textarea",17),o(),b(21,ee,2,2,"div",18),i(22,"div",19)(23,"button",20),r(24),o(),i(25,"button",21),p("click",function(){f(e);let m=g();return _(m.cancel())}),r(26,"Cancel"),o()()()}if(a&2){let e,n=g();s("formGroup",n.form),l(6),s("formControl",n.typeControl),l(3),E(n.integrationTypes()),l(7),s("formControl",n.nameControl),l(4),s("formControl",n.descriptionControl),l(),y((e=n.schema())?21:-1,e),l(2),s("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),l(),V(" ",n.isEditMode()?"Save changes":"Create"," ")}}var W=class a{route=c(F);router=c(N);destroyRef=c(k);integrationConfigController=c(R);integrationTypeController=c(z);namespaceId=this.route.snapshot.params.namespaceId;form=new G({name:new C("",{nonNullable:!0,validators:[u.required,u.minLength(1)]}),description:new C(null),type:new C("",{nonNullable:!0,validators:[u.required]})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get typeControl(){return this.form.controls.type}isEditMode=d(!1);isSubmitting=d(!1);isLoading=d(!1);paramsValue=d(null);initialParams=d(null);integrationTypes=I(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=I(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});schema=D(()=>{let t=this.selectedType();return t?this.integrationTypes().find(n=>n.type===t)?.configSchema??null:null});existingConfig=null;ngOnInit(){let t=this.route.snapshot.paramMap.get("integrationId");t&&(this.isEditMode.set(!0),this.loadConfig(t))}loadConfig(t){this.isLoading.set(!0),this.integrationConfigController.getByIdIntegrationConfig(t).pipe(M(this.destroyRef)).subscribe({next:e=>{this.existingConfig=e,this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.typeControl.setValue(e.integrationType),this.initialParams.set(e.parameters),this.paramsValue.set(e.parameters),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),this.navigateBack()}})}onParamsChange(t){this.paramsValue.set(t)}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;this.isSubmitting.set(!0),(this.isEditMode()?this.integrationConfigController.updateIntegrationConfig(this.existingConfig.id??"",O(S({},this.existingConfig),{name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,integrationType:this.typeControl.value,parameters:this.paramsValue()})):this.integrationConfigController.createIntegrationConfig({name:this.nameControl.value.trim(),description:this.descriptionControl.value?.trim()||void 0,integrationType:this.typeControl.value,namespaceId:this.namespaceId,parameters:this.paramsValue()})).pipe(M(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(!1)})}cancel(){this.navigateBack()}navigateBack(){this.router.navigate(["/agentos",this.namespaceId,"integrations"])}trackByType(t,e){return e.type}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=P({type:a,selectors:[["agentos-integration-form"]],decls:10,vars:2,consts:[[1,"integration-form"],[1,"integration-form__header"],["type","button","title","Back to integrations",1,"integration-form__back",3,"click"],[1,"integration-form__back-icon"],[1,"integration-form__title"],[1,"integration-form__loading"],[1,"integration-form__form",3,"formGroup"],[1,"integration-form__form",3,"ngSubmit","formGroup"],[1,"integration-form__field"],["for","integration-type",1,"integration-form__label"],["aria-hidden","true"],["id","integration-type",1,"integration-form__select",3,"formControl"],["value","","disabled",""],[3,"value"],["for","integration-name",1,"integration-form__label"],["id","integration-name","type","text","placeholder","Integration name","autocomplete","off",1,"integration-form__input",3,"formControl"],["for","integration-description",1,"integration-form__label"],["id","integration-description","placeholder","Optional description","rows","3",1,"integration-form__textarea",3,"formControl"],[1,"integration-form__schema-form"],[1,"integration-form__actions"],["type","submit",1,"integration-form__btn","integration-form__btn--primary",3,"disabled"],["type","button",1,"integration-form__btn",3,"click"],[3,"valueChange","schema","value"]],template:function(e,n){e&1&&(i(0,"div",0)(1,"header",1)(2,"button",2),p("click",function(){return n.cancel()}),i(3,"span",3),r(4,"\u2190"),o(),r(5," Integrations "),o(),i(6,"h1",4),r(7),o()(),b(8,Y,2,0,"p",5)(9,te,27,7,"form",6),o()),e&2&&(l(7),x(n.isEditMode()?"Edit integration":"New integration"),l(),y(n.isLoading()?8:9))},dependencies:[H,J,K,U,B,q,L,j,A,$,Q],styles:[".integration-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.integration-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.integration-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.integration-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.integration-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.integration-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.integration-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.integration-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.integration-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.integration-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.integration-form__input[_ngcontent-%COMP%], .integration-form__textarea[_ngcontent-%COMP%], .integration-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.integration-form__input[_ngcontent-%COMP%]:focus, .integration-form__textarea[_ngcontent-%COMP%]:focus, .integration-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.integration-form__input[_ngcontent-%COMP%]::placeholder, .integration-form__textarea[_ngcontent-%COMP%]::placeholder, .integration-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.integration-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:4.5rem;line-height:1.5}.integration-form__select[_ngcontent-%COMP%]{cursor:pointer}.integration-form__select[_ngcontent-%COMP%] option[disabled][_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73)}.integration-form__schema-form[_ngcontent-%COMP%]{padding:1rem;border-radius:10px;border:1px solid var(--color-border-light, rgba(0, 0, 0, .06));background:var(--glass-bg, rgba(255, 255, 255, .5));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px))}.integration-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.integration-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.integration-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.integration-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.integration-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.integration-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};export{W as IntegrationFormComponent};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as Z,b as De,c as Ce,d as v,e as D,g as Ae,j as M,l as Te,m as Oe,n as xe,o as B,q as we,t as j}from"./chunk-
|
|
1
|
+
import{a as Z,b as De,c as Ce,d as v,e as D,g as Ae,j as M,l as Te,m as Oe,n as xe,o as B,q as we,t as j}from"./chunk-YDXVLOQW.js";import{G as U,M as Y,N as ve,c as R,e as pe,f as q,h as fe,o as _e,p as ye,r as be,s as b,t as P}from"./chunk-PKKHLHXJ.js";import{A as _,F as p,Gb as he,Hb as me,Ib as ue,Ja as ne,Ka as se,Ma as re,Ob as Q,P as T,Ta as E,Ua as S,Va as y,X as O,Xa as le,Y as x,Ya as f,Za as F,_ as u,a as c,aa as s,b as ee,gb as L,h as m,j as G,ja as h,ka as ie,na as w,oa as ae,oc as ge,pb as de,qb as ce,sa as oe,va as k,wa as I,x as A,z as te,zb as W}from"./chunk-DJBCK5D7.js";function Be(i,o){}var g=class{viewContainerRef;injector;id;role="dialog";panelClass="";hasBackdrop=!0;backdropClass="";disableClose=!1;closePredicate;width="";height="";minWidth;minHeight;maxWidth;maxHeight;positionStrategy;data=null;direction;ariaDescribedBy=null;ariaLabelledBy=null;ariaLabel=null;ariaModal=!1;autoFocus="first-tabbable";restoreFocus=!0;scrollStrategy;closeOnNavigation=!0;closeOnDestroy=!0;closeOnOverlayDetachments=!0;disableAnimations=!1;providers;container;templateContext};var K=(()=>{class i extends Ce{_elementRef=s(I);_focusTrapFactory=s(ye);_config;_interactivityChecker=s(_e);_ngZone=s(ae);_focusMonitor=s(fe);_renderer=s(re);_changeDetectorRef=s(ge);_injector=s(h);_platform=s(pe);_document=s(ie);_portalOutlet;_focusTrapped=new m;_focusTrap=null;_elementFocusedBeforeDialogWasOpened=null;_closeInteractionType=null;_ariaLabelledByQueue=[];_isDestroyed=!1;constructor(){super(),this._config=s(g,{optional:!0})||new g,this._config.ariaLabelledBy&&this._ariaLabelledByQueue.push(this._config.ariaLabelledBy)}_addAriaLabelledBy(e){this._ariaLabelledByQueue.push(e),this._changeDetectorRef.markForCheck()}_removeAriaLabelledBy(e){let t=this._ariaLabelledByQueue.indexOf(e);t>-1&&(this._ariaLabelledByQueue.splice(t,1),this._changeDetectorRef.markForCheck())}_contentAttached(){this._initializeFocusTrap(),this._captureInitialFocus()}_captureInitialFocus(){this._trapFocus()}ngOnDestroy(){this._focusTrapped.complete(),this._isDestroyed=!0,this._restoreFocus()}attachComponentPortal(e){this._portalOutlet.hasAttached();let t=this._portalOutlet.attachComponentPortal(e);return this._contentAttached(),t}attachTemplatePortal(e){this._portalOutlet.hasAttached();let t=this._portalOutlet.attachTemplatePortal(e);return this._contentAttached(),t}attachDomPortal=e=>{this._portalOutlet.hasAttached();let t=this._portalOutlet.attachDomPortal(e);return this._contentAttached(),t};_recaptureFocus(){this._containsFocus()||this._trapFocus()}_forceFocus(e,t){this._interactivityChecker.isFocusable(e)||(e.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{let a=()=>{n(),l(),e.removeAttribute("tabindex")},n=this._renderer.listen(e,"blur",a),l=this._renderer.listen(e,"mousedown",a)})),e.focus(t)}_focusByCssSelector(e,t){let a=this._elementRef.nativeElement.querySelector(e);a&&this._forceFocus(a,t)}_trapFocus(e){this._isDestroyed||ne(()=>{let t=this._elementRef.nativeElement;switch(this._config.autoFocus){case!1:case"dialog":this._containsFocus()||t.focus(e);break;case!0:case"first-tabbable":this._focusTrap?.focusInitialElement(e)||this._focusDialogContainer(e);break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]',e);break;default:this._focusByCssSelector(this._config.autoFocus,e);break}this._focusTrapped.next()},{injector:this._injector})}_restoreFocus(){let e=this._config.restoreFocus,t=null;if(typeof e=="string"?t=this._document.querySelector(e):typeof e=="boolean"?t=e?this._elementFocusedBeforeDialogWasOpened:null:e&&(t=e),this._config.restoreFocus&&t&&typeof t.focus=="function"){let a=R(),n=this._elementRef.nativeElement;(!a||a===this._document.body||a===n||n.contains(a))&&(this._focusMonitor?(this._focusMonitor.focusVia(t,this._closeInteractionType),this._closeInteractionType=null):t.focus())}this._focusTrap&&this._focusTrap.destroy()}_focusDialogContainer(e){this._elementRef.nativeElement.focus?.(e)}_containsFocus(){let e=this._elementRef.nativeElement,t=R();return e===t||e.contains(t)}_initializeFocusTrap(){this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._document&&(this._elementFocusedBeforeDialogWasOpened=R()))}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=E({type:i,selectors:[["cdk-dialog-container"]],viewQuery:function(t,a){if(t&1&&he(v,7),t&2){let n;me(n=ue())&&(a._portalOutlet=n.first)}},hostAttrs:["tabindex","-1",1,"cdk-dialog-container"],hostVars:6,hostBindings:function(t,a){t&2&&L("id",a._config.id||null)("role",a._config.role)("aria-modal",a._config.ariaModal)("aria-labelledby",a._config.ariaLabel?null:a._ariaLabelledByQueue[0])("aria-label",a._config.ariaLabel)("aria-describedby",a._config.ariaDescribedBy||null)},features:[f],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(t,a){t&1&&F(0,Be,0,0,"ng-template",0)},dependencies:[v],styles:[`.cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit}
|
|
2
2
|
`],encapsulation:2})}return i})(),C=class{overlayRef;config;componentInstance=null;componentRef=null;containerInstance;disableClose;closed=new m;backdropClick;keydownEvents;outsidePointerEvents;id;_detachSubscription;constructor(o,e){this.overlayRef=o,this.config=e,this.disableClose=e.disableClose,this.backdropClick=o.backdropClick(),this.keydownEvents=o.keydownEvents(),this.outsidePointerEvents=o.outsidePointerEvents(),this.id=e.id,this.keydownEvents.subscribe(t=>{t.keyCode===27&&!this.disableClose&&!P(t)&&(t.preventDefault(),this.close(void 0,{focusOrigin:"keyboard"}))}),this.backdropClick.subscribe(()=>{!this.disableClose&&this._canClose()?this.close(void 0,{focusOrigin:"mouse"}):this.containerInstance._recaptureFocus?.()}),this._detachSubscription=o.detachments().subscribe(()=>{e.closeOnOverlayDetachments!==!1&&this.close()})}close(o,e){if(this._canClose(o)){let t=this.closed;this.containerInstance._closeInteractionType=e?.focusOrigin||"program",this._detachSubscription.unsubscribe(),this.overlayRef.dispose(),t.next(o),t.complete(),this.componentInstance=this.containerInstance=null}}updatePosition(){return this.overlayRef.updatePosition(),this}updateSize(o="",e=""){return this.overlayRef.updateSize({width:o,height:e}),this}addPanelClass(o){return this.overlayRef.addPanelClass(o),this}removePanelClass(o){return this.overlayRef.removePanelClass(o),this}_canClose(o){let e=this.config;return!!this.containerInstance&&(!e.closePredicate||e.closePredicate(o,e,this.componentInstance))}},je=new u("DialogScrollStrategy",{providedIn:"root",factory:()=>{let i=s(h);return()=>M(i)}}),Ne=new u("DialogData"),Ve=new u("DefaultDialogConfig");function ze(i){let o=oe(i),e=new w;return{valueSignal:o,get value(){return o()},change:e,ngOnDestroy(){e.complete()}}}var X=(()=>{class i{_injector=s(h);_defaultOptions=s(Ve,{optional:!0});_parentDialog=s(i,{optional:!0,skipSelf:!0});_overlayContainer=s(Oe);_idGenerator=s(b);_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new m;_afterOpenedAtThisLevel=new m;_ariaHiddenElements=new Map;_scrollStrategy=s(je);get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}afterAllClosed=A(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(T(void 0)));constructor(){}open(e,t){let a=this._defaultOptions||new g;t=c(c({},a),t),t.id=t.id||this._idGenerator.getId("cdk-dialog-"),t.id&&this.getDialogById(t.id);let n=this._getOverlayConfig(t),l=we(this._injector,n),r=new C(l,t),d=this._attachContainer(l,r,t);if(r.containerInstance=d,!this.openDialogs.length){let H=this._overlayContainer.getContainerElement();d._focusTrapped?d._focusTrapped.pipe(p(1)).subscribe(()=>{this._hideNonDialogContentFromAssistiveTechnology(H)}):this._hideNonDialogContentFromAssistiveTechnology(H)}return this._attachDialogContent(e,r,d,t),this.openDialogs.push(r),r.closed.subscribe(()=>this._removeOpenDialog(r,!0)),this.afterOpened.next(r),r}closeAll(){$(this.openDialogs,e=>e.close())}getDialogById(e){return this.openDialogs.find(t=>t.id===e)}ngOnDestroy(){$(this._openDialogsAtThisLevel,e=>{e.config.closeOnDestroy===!1&&this._removeOpenDialog(e,!1)}),$(this._openDialogsAtThisLevel,e=>e.close()),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete(),this._openDialogsAtThisLevel=[]}_getOverlayConfig(e){let t=new Te({positionStrategy:e.positionStrategy||B().centerHorizontally().centerVertically(),scrollStrategy:e.scrollStrategy||this._scrollStrategy(),panelClass:e.panelClass,hasBackdrop:e.hasBackdrop,direction:e.direction,minWidth:e.minWidth,minHeight:e.minHeight,maxWidth:e.maxWidth,maxHeight:e.maxHeight,width:e.width,height:e.height,disposeOnNavigation:e.closeOnNavigation,disableAnimations:e.disableAnimations});return e.backdropClass&&(t.backdropClass=e.backdropClass),t}_attachContainer(e,t,a){let n=a.injector||a.viewContainerRef?.injector,l=[{provide:g,useValue:a},{provide:C,useValue:t},{provide:xe,useValue:e}],r;a.container?typeof a.container=="function"?r=a.container:(r=a.container.type,l.push(...a.container.providers(a))):r=K;let d=new Z(r,a.viewContainerRef,h.create({parent:n||this._injector,providers:l}));return e.attach(d).instance}_attachDialogContent(e,t,a,n){if(e instanceof se){let l=this._createInjector(n,t,a,void 0),r={$implicit:n.data,dialogRef:t};n.templateContext&&(r=c(c({},r),typeof n.templateContext=="function"?n.templateContext():n.templateContext)),a.attachTemplatePortal(new De(e,null,r,l))}else{let l=this._createInjector(n,t,a,this._injector),r=a.attachComponentPortal(new Z(e,n.viewContainerRef,l));t.componentRef=r,t.componentInstance=r.instance}}_createInjector(e,t,a,n){let l=e.injector||e.viewContainerRef?.injector,r=[{provide:Ne,useValue:e.data},{provide:C,useValue:t}];return e.providers&&(typeof e.providers=="function"?r.push(...e.providers(t,e,a)):r.push(...e.providers)),e.direction&&(!l||!l.get(Y,null,{optional:!0}))&&r.push({provide:Y,useValue:ze(e.direction)}),h.create({parent:l||n,providers:r})}_removeOpenDialog(e,t){let a=this.openDialogs.indexOf(e);a>-1&&(this.openDialogs.splice(a,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((n,l)=>{n?l.setAttribute("aria-hidden",n):l.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),t&&this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(e){if(e.parentElement){let t=e.parentElement.children;for(let a=t.length-1;a>-1;a--){let n=t[a];n!==e&&n.nodeName!=="SCRIPT"&&n.nodeName!=="STYLE"&&!n.hasAttribute("aria-live")&&!n.hasAttribute("popover")&&(this._ariaHiddenElements.set(n,n.getAttribute("aria-hidden")),n.setAttribute("aria-hidden","true"))}}}_getAfterAllClosed(){let e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}static \u0275fac=function(t){return new(t||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function $(i,o){let e=i.length;for(;e--;)o(i[e])}var Ie=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=S({type:i});static \u0275inj=x({providers:[X],imports:[j,D,be,D]})}return i})();function He(i,o){}var V=class{viewContainerRef;injector;id;role="dialog";panelClass="";hasBackdrop=!0;backdropClass="";disableClose=!1;closePredicate;width="";height="";minWidth;minHeight;maxWidth;maxHeight;position;data=null;direction;ariaDescribedBy=null;ariaLabelledBy=null;ariaLabel=null;ariaModal=!1;autoFocus="first-tabbable";restoreFocus=!0;delayFocusTrap=!0;scrollStrategy;closeOnNavigation=!0;enterAnimationDuration;exitAnimationDuration},J="mdc-dialog--open",Ee="mdc-dialog--opening",Se="mdc-dialog--closing",Ge=150,We=75,Qe=(()=>{class i extends K{_animationStateChanged=new w;_animationsEnabled=!U();_actionSectionCount=0;_hostElement=this._elementRef.nativeElement;_enterAnimationDuration=this._animationsEnabled?Le(this._config.enterAnimationDuration)??Ge:0;_exitAnimationDuration=this._animationsEnabled?Le(this._config.exitAnimationDuration)??We:0;_animationTimer=null;_contentAttached(){super._contentAttached(),this._startOpenAnimation()}_startOpenAnimation(){this._animationStateChanged.emit({state:"opening",totalTime:this._enterAnimationDuration}),this._animationsEnabled?(this._hostElement.style.setProperty(Fe,`${this._enterAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(Ee,J)),this._waitForAnimationToComplete(this._enterAnimationDuration,this._finishDialogOpen)):(this._hostElement.classList.add(J),Promise.resolve().then(()=>this._finishDialogOpen()))}_startExitAnimation(){this._animationStateChanged.emit({state:"closing",totalTime:this._exitAnimationDuration}),this._hostElement.classList.remove(J),this._animationsEnabled?(this._hostElement.style.setProperty(Fe,`${this._exitAnimationDuration}ms`),this._requestAnimationFrame(()=>this._hostElement.classList.add(Se)),this._waitForAnimationToComplete(this._exitAnimationDuration,this._finishDialogClose)):Promise.resolve().then(()=>this._finishDialogClose())}_updateActionSectionCount(e){this._actionSectionCount+=e,this._changeDetectorRef.markForCheck()}_finishDialogOpen=()=>{this._clearAnimationClasses(),this._openAnimationDone(this._enterAnimationDuration)};_finishDialogClose=()=>{this._clearAnimationClasses(),this._animationStateChanged.emit({state:"closed",totalTime:this._exitAnimationDuration})};_clearAnimationClasses(){this._hostElement.classList.remove(Ee,Se)}_waitForAnimationToComplete(e,t){this._animationTimer!==null&&clearTimeout(this._animationTimer),this._animationTimer=setTimeout(t,e)}_requestAnimationFrame(e){this._ngZone.runOutsideAngular(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()})}_captureInitialFocus(){this._config.delayFocusTrap||this._trapFocus()}_openAnimationDone(e){this._config.delayFocusTrap&&this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:e})}ngOnDestroy(){super.ngOnDestroy(),this._animationTimer!==null&&clearTimeout(this._animationTimer)}attachComponentPortal(e){let t=super.attachComponentPortal(e);return t.location.nativeElement.classList.add("mat-mdc-dialog-component-host"),t}static \u0275fac=(()=>{let e;return function(a){return(e||(e=k(i)))(a||i)}})();static \u0275cmp=E({type:i,selectors:[["mat-dialog-container"]],hostAttrs:["tabindex","-1",1,"mat-mdc-dialog-container","mdc-dialog"],hostVars:10,hostBindings:function(t,a){t&2&&(W("id",a._config.id),L("aria-modal",a._config.ariaModal)("role",a._config.role)("aria-labelledby",a._config.ariaLabel?null:a._ariaLabelledByQueue[0])("aria-label",a._config.ariaLabel)("aria-describedby",a._config.ariaDescribedBy||null),Q("_mat-animation-noopable",!a._animationsEnabled)("mat-mdc-dialog-container-with-actions",a._actionSectionCount>0))},features:[f],decls:3,vars:0,consts:[[1,"mat-mdc-dialog-inner-container","mdc-dialog__container"],[1,"mat-mdc-dialog-surface","mdc-dialog__surface"],["cdkPortalOutlet",""]],template:function(t,a){t&1&&(de(0,"div",0)(1,"div",1),F(2,He,0,0,"ng-template",2),ce()())},dependencies:[v],styles:[`.mat-mdc-dialog-container{width:100%;height:100%;display:block;box-sizing:border-box;max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit;outline:0}.cdk-overlay-pane.mat-mdc-dialog-panel{max-width:var(--mat-dialog-container-max-width, 560px);min-width:var(--mat-dialog-container-min-width, 280px)}@media(max-width: 599px){.cdk-overlay-pane.mat-mdc-dialog-panel{max-width:var(--mat-dialog-container-small-max-width, calc(100vw - 32px))}}.mat-mdc-dialog-inner-container{display:flex;flex-direction:row;align-items:center;justify-content:space-around;box-sizing:border-box;height:100%;opacity:0;transition:opacity linear var(--mat-dialog-transition-duration, 0ms);max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit}.mdc-dialog--closing .mat-mdc-dialog-inner-container{transition:opacity 75ms linear;transform:none}.mdc-dialog--open .mat-mdc-dialog-inner-container{opacity:1}._mat-animation-noopable .mat-mdc-dialog-inner-container{transition:none}.mat-mdc-dialog-surface{display:flex;flex-direction:column;flex-grow:0;flex-shrink:0;box-sizing:border-box;width:100%;height:100%;position:relative;overflow-y:auto;outline:0;transform:scale(0.8);transition:transform var(--mat-dialog-transition-duration, 0ms) cubic-bezier(0, 0, 0.2, 1);max-height:inherit;min-height:inherit;min-width:inherit;max-width:inherit;box-shadow:var(--mat-dialog-container-elevation-shadow, none);border-radius:var(--mat-dialog-container-shape, var(--mat-sys-corner-extra-large, 4px));background-color:var(--mat-dialog-container-color, var(--mat-sys-surface, white))}[dir=rtl] .mat-mdc-dialog-surface{text-align:right}.mdc-dialog--open .mat-mdc-dialog-surface,.mdc-dialog--closing .mat-mdc-dialog-surface{transform:none}._mat-animation-noopable .mat-mdc-dialog-surface{transition:none}.mat-mdc-dialog-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:2px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mat-mdc-dialog-title{display:block;position:relative;flex-shrink:0;box-sizing:border-box;margin:0 0 1px;padding:var(--mat-dialog-headline-padding, 6px 24px 13px)}.mat-mdc-dialog-title::before{display:inline-block;width:0;height:40px;content:"";vertical-align:0}[dir=rtl] .mat-mdc-dialog-title{text-align:right}.mat-mdc-dialog-container .mat-mdc-dialog-title{color:var(--mat-dialog-subhead-color, var(--mat-sys-on-surface, rgba(0, 0, 0, 0.87)));font-family:var(--mat-dialog-subhead-font, var(--mat-sys-headline-small-font, inherit));line-height:var(--mat-dialog-subhead-line-height, var(--mat-sys-headline-small-line-height, 1.5rem));font-size:var(--mat-dialog-subhead-size, var(--mat-sys-headline-small-size, 1rem));font-weight:var(--mat-dialog-subhead-weight, var(--mat-sys-headline-small-weight, 400));letter-spacing:var(--mat-dialog-subhead-tracking, var(--mat-sys-headline-small-tracking, 0.03125em))}.mat-mdc-dialog-content{display:block;flex-grow:1;box-sizing:border-box;margin:0;overflow:auto;max-height:65vh}.mat-mdc-dialog-content>:first-child{margin-top:0}.mat-mdc-dialog-content>:last-child{margin-bottom:0}.mat-mdc-dialog-container .mat-mdc-dialog-content{color:var(--mat-dialog-supporting-text-color, var(--mat-sys-on-surface-variant, rgba(0, 0, 0, 0.6)));font-family:var(--mat-dialog-supporting-text-font, var(--mat-sys-body-medium-font, inherit));line-height:var(--mat-dialog-supporting-text-line-height, var(--mat-sys-body-medium-line-height, 1.5rem));font-size:var(--mat-dialog-supporting-text-size, var(--mat-sys-body-medium-size, 1rem));font-weight:var(--mat-dialog-supporting-text-weight, var(--mat-sys-body-medium-weight, 400));letter-spacing:var(--mat-dialog-supporting-text-tracking, var(--mat-sys-body-medium-tracking, 0.03125em))}.mat-mdc-dialog-container .mat-mdc-dialog-content{padding:var(--mat-dialog-content-padding, 20px 24px)}.mat-mdc-dialog-container-with-actions .mat-mdc-dialog-content{padding:var(--mat-dialog-with-actions-content-padding, 20px 24px 0)}.mat-mdc-dialog-container .mat-mdc-dialog-title+.mat-mdc-dialog-content{padding-top:0}.mat-mdc-dialog-actions{display:flex;position:relative;flex-shrink:0;flex-wrap:wrap;align-items:center;box-sizing:border-box;min-height:52px;margin:0;border-top:1px solid rgba(0,0,0,0);padding:var(--mat-dialog-actions-padding, 16px 24px);justify-content:var(--mat-dialog-actions-alignment, flex-end)}@media(forced-colors: active){.mat-mdc-dialog-actions{border-top-color:CanvasText}}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-start,.mat-mdc-dialog-actions[align=start]{justify-content:start}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-center,.mat-mdc-dialog-actions[align=center]{justify-content:center}.mat-mdc-dialog-actions.mat-mdc-dialog-actions-align-end,.mat-mdc-dialog-actions[align=end]{justify-content:flex-end}.mat-mdc-dialog-actions .mat-button-base+.mat-button-base,.mat-mdc-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-mdc-dialog-actions .mat-button-base+.mat-button-base,[dir=rtl] .mat-mdc-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}.mat-mdc-dialog-component-host{display:contents}
|
|
3
3
|
`],encapsulation:2})}return i})(),Fe="--mat-dialog-transition-duration";function Le(i){return i==null?null:typeof i=="number"?i:i.endsWith("ms")?q(i.substring(0,i.length-2)):i.endsWith("s")?q(i.substring(0,i.length-1))*1e3:i==="0"?0:null}var N=(function(i){return i[i.OPEN=0]="OPEN",i[i.CLOSING=1]="CLOSING",i[i.CLOSED=2]="CLOSED",i})(N||{}),z=class{_ref;_config;_containerInstance;componentInstance;componentRef=null;disableClose;id;_afterOpened=new G(1);_beforeClosed=new G(1);_result;_closeFallbackTimeout;_state=N.OPEN;_closeInteractionType;constructor(o,e,t){this._ref=o,this._config=e,this._containerInstance=t,this.disableClose=e.disableClose,this.id=o.id,o.addPanelClass("mat-mdc-dialog-panel"),t._animationStateChanged.pipe(_(a=>a.state==="opened"),p(1)).subscribe(()=>{this._afterOpened.next(),this._afterOpened.complete()}),t._animationStateChanged.pipe(_(a=>a.state==="closed"),p(1)).subscribe(()=>{clearTimeout(this._closeFallbackTimeout),this._finishDialogClose()}),o.overlayRef.detachments().subscribe(()=>{this._beforeClosed.next(this._result),this._beforeClosed.complete(),this._finishDialogClose()}),te(this.backdropClick(),this.keydownEvents().pipe(_(a=>a.keyCode===27&&!this.disableClose&&!P(a)))).subscribe(a=>{this.disableClose||(a.preventDefault(),qe(this,a.type==="keydown"?"keyboard":"mouse"))})}close(o){let e=this._config.closePredicate;e&&!e(o,this._config,this.componentInstance)||(this._result=o,this._containerInstance._animationStateChanged.pipe(_(t=>t.state==="closing"),p(1)).subscribe(t=>{this._beforeClosed.next(o),this._beforeClosed.complete(),this._ref.overlayRef.detachBackdrop(),this._closeFallbackTimeout=setTimeout(()=>this._finishDialogClose(),t.totalTime+100)}),this._state=N.CLOSING,this._containerInstance._startExitAnimation())}afterOpened(){return this._afterOpened}afterClosed(){return this._ref.closed}beforeClosed(){return this._beforeClosed}backdropClick(){return this._ref.backdropClick}keydownEvents(){return this._ref.keydownEvents}updatePosition(o){let e=this._ref.config.positionStrategy;return o&&(o.left||o.right)?o.left?e.left(o.left):e.right(o.right):e.centerHorizontally(),o&&(o.top||o.bottom)?o.top?e.top(o.top):e.bottom(o.bottom):e.centerVertically(),this._ref.updatePosition(),this}updateSize(o="",e=""){return this._ref.updateSize(o,e),this}addPanelClass(o){return this._ref.addPanelClass(o),this}removePanelClass(o){return this._ref.removePanelClass(o),this}getState(){return this._state}_finishDialogClose(){this._state=N.CLOSED,this._ref.close(this._result,{focusOrigin:this._closeInteractionType}),this.componentInstance=null}};function qe(i,o,e){return i._closeInteractionType=o,i.close(e)}var Ue=new u("MatMdcDialogData"),Ye=new u("mat-mdc-dialog-default-options"),Ze=new u("mat-mdc-dialog-scroll-strategy",{providedIn:"root",factory:()=>{let i=s(h);return()=>M(i)}}),Re=(()=>{class i{_defaultOptions=s(Ye,{optional:!0});_scrollStrategy=s(Ze);_parentDialog=s(i,{optional:!0,skipSelf:!0});_idGenerator=s(b);_injector=s(h);_dialog=s(X);_animationsDisabled=U();_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new m;_afterOpenedAtThisLevel=new m;dialogConfigClass=V;_dialogRefConstructor;_dialogContainerType;_dialogDataToken;get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}_getAfterAllClosed(){let e=this._parentDialog;return e?e._getAfterAllClosed():this._afterAllClosedAtThisLevel}afterAllClosed=A(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(T(void 0)));constructor(){this._dialogRefConstructor=z,this._dialogContainerType=Qe,this._dialogDataToken=Ue}open(e,t){let a;t=c(c({},this._defaultOptions||new V),t),t.id=t.id||this._idGenerator.getId("mat-mdc-dialog-"),t.scrollStrategy=t.scrollStrategy||this._scrollStrategy();let n=this._dialog.open(e,ee(c({},t),{positionStrategy:B(this._injector).centerHorizontally().centerVertically(),disableClose:!0,closePredicate:void 0,closeOnDestroy:!1,closeOnOverlayDetachments:!1,disableAnimations:this._animationsDisabled||t.enterAnimationDuration?.toLocaleString()==="0"||t.exitAnimationDuration?.toString()==="0",container:{type:this._dialogContainerType,providers:()=>[{provide:this.dialogConfigClass,useValue:t},{provide:g,useValue:t}]},templateContext:()=>({dialogRef:a}),providers:(l,r,d)=>(a=new this._dialogRefConstructor(l,t,d),a.updatePosition(t?.position),[{provide:this._dialogContainerType,useValue:d},{provide:this._dialogDataToken,useValue:r.data},{provide:this._dialogRefConstructor,useValue:a}])}));return a.componentRef=n.componentRef,a.componentInstance=n.componentInstance,this.openDialogs.push(a),this.afterOpened.next(a),a.afterClosed().subscribe(()=>{let l=this.openDialogs.indexOf(a);l>-1&&(this.openDialogs.splice(l,1),this.openDialogs.length||this._getAfterAllClosed().next())}),a}closeAll(){this._closeDialogs(this.openDialogs)}getDialogById(e){return this.openDialogs.find(t=>t.id===e)}ngOnDestroy(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()}_closeDialogs(e){let t=e.length;for(;t--;)e[t].close()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=O({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var Pe=(()=>{class i{_dialogRef=s(z,{optional:!0});_elementRef=s(I);_dialog=s(Re);constructor(){}ngOnInit(){this._dialogRef||(this._dialogRef=$e(this._elementRef,this._dialog.openDialogs)),this._dialogRef&&Promise.resolve().then(()=>{this._onAdd()})}ngOnDestroy(){this._dialogRef?._containerInstance&&Promise.resolve().then(()=>{this._onRemove()})}static \u0275fac=function(t){return new(t||i)};static \u0275dir=y({type:i})}return i})(),jt=(()=>{class i extends Pe{id=s(b).getId("mat-mdc-dialog-title-");_onAdd(){this._dialogRef._containerInstance?._addAriaLabelledBy?.(this.id)}_onRemove(){this._dialogRef?._containerInstance?._removeAriaLabelledBy?.(this.id)}static \u0275fac=(()=>{let e;return function(a){return(e||(e=k(i)))(a||i)}})();static \u0275dir=y({type:i,selectors:[["","mat-dialog-title",""],["","matDialogTitle",""]],hostAttrs:[1,"mat-mdc-dialog-title","mdc-dialog__title"],hostVars:1,hostBindings:function(t,a){t&2&&W("id",a.id)},inputs:{id:"id"},exportAs:["matDialogTitle"],features:[f]})}return i})(),Nt=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275dir=y({type:i,selectors:[["","mat-dialog-content",""],["mat-dialog-content"],["","matDialogContent",""]],hostAttrs:[1,"mat-mdc-dialog-content","mdc-dialog__content"],features:[le([Ae])]})}return i})(),Vt=(()=>{class i extends Pe{align;_onAdd(){this._dialogRef._containerInstance?._updateActionSectionCount?.(1)}_onRemove(){this._dialogRef._containerInstance?._updateActionSectionCount?.(-1)}static \u0275fac=(()=>{let e;return function(a){return(e||(e=k(i)))(a||i)}})();static \u0275dir=y({type:i,selectors:[["","mat-dialog-actions",""],["mat-dialog-actions"],["","matDialogActions",""]],hostAttrs:[1,"mat-mdc-dialog-actions","mdc-dialog__actions"],hostVars:6,hostBindings:function(t,a){t&2&&Q("mat-mdc-dialog-actions-align-start",a.align==="start")("mat-mdc-dialog-actions-align-center",a.align==="center")("mat-mdc-dialog-actions-align-end",a.align==="end")},inputs:{align:"align"},features:[f]})}return i})();function $e(i,o){let e=i.nativeElement.parentElement;for(;e&&!e.classList.contains("mat-mdc-dialog-container");)e=e.parentElement;return e?o.find(t=>t.id===e.id):null}var zt=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=S({type:i});static \u0275inj=x({providers:[Re],imports:[Ie,j,D,ve]})}return i})();export{z as a,Ue as b,Ye as c,Re as d,jt as e,Nt as f,Vt as g,zt as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{U as O,_ as A}from"./chunk-YDXVLOQW.js";import{g as D}from"./chunk-KYPMYRHP.js";import{a as N}from"./chunk-VNGIXNER.js";import{c as V}from"./chunk-PWN5O4WY.js";import{Ab as l,Cb as o,Cc as E,Ha as _,Mb as k,Q as w,Qb as b,Rb as h,Ta as f,Za as M,Zb as T,aa as g,ac as P,bc as S,ec as L,fa as c,ga as p,i as x,ib as v,jb as C,la as q,na as d,ob as u,pb as r,qb as m,s as R,yb as I}from"./chunk-DJBCK5D7.js";function K(s,e){if(s&1&&(r(0,"span",3),b(1),m()),s&2){let t=o();_(),h(t.namespace.description)}}var y=class s{namespace;selected=new d;editRequested=new d;integrationsRequested=new d;aiProvidersRequested=new d;aiModelsRequested=new d;deleteRequested=new d;menuItems=[{key:"edit",label:"Edit namespace",icon:"edit"},{key:"integrations",label:"Manage integrations",icon:"settings"},{key:"ai-providers",label:"AI Providers",icon:"smart_toy"},{key:"ai-models",label:"AI models",icon:"model_training"},{key:"delete",label:"Delete namespace",icon:"delete",variant:"danger"}];onSelect(){this.selected.emit(this.namespace)}onMenuAction(e){switch(e){case"edit":this.editRequested.emit(this.namespace);break;case"integrations":this.integrationsRequested.emit(this.namespace);break;case"ai-providers":this.aiProvidersRequested.emit(this.namespace);break;case"ai-models":this.aiModelsRequested.emit(this.namespace);break;case"delete":confirm(`Delete namespace "${this.namespace.name}"?`)&&this.deleteRequested.emit(this.namespace);break}}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=f({type:s,selectors:[["agentos-namespace-item"]],inputs:{namespace:"namespace"},outputs:{selected:"selected",editRequested:"editRequested",integrationsRequested:"integrationsRequested",aiProvidersRequested:"aiProvidersRequested",aiModelsRequested:"aiModelsRequested",deleteRequested:"deleteRequested"},decls:7,vars:3,consts:[["role","listitem",1,"namespace-item"],["type","button",1,"namespace-item__body",3,"click"],[1,"namespace-item__name"],[1,"namespace-item__desc"],[1,"namespace-item__actions"],[3,"itemSelected","items"]],template:function(t,a){t&1&&(r(0,"div",0)(1,"button",1),l("click",function(){return a.onSelect()}),r(2,"span",2),b(3),m(),v(4,K,2,1,"span",3),m(),r(5,"div",4)(6,"ds-kebab-menu",5),l("itemSelected",function(i){return a.onMenuAction(i)}),m()()()),t&2&&(_(3),h(a.namespace.name),_(),C(a.namespace.description?4:-1),_(2),u("items",a.menuItems))},dependencies:[A],styles:[".namespace-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.875rem 1.25rem;border-radius:10px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px));transition:background .15s ease,border-color .15s ease}.namespace-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-color:var(--color-primary, #007aff)}.namespace-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;align-items:flex-start;gap:.2rem;background:none;border:none;padding:0;cursor:pointer;text-align:left;min-width:0}.namespace-item__name[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.namespace-item__desc[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.namespace-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.namespace-item[_ngcontent-%COMP%]:hover .namespace-item__actions[_ngcontent-%COMP%], .namespace-item[_ngcontent-%COMP%]:focus-within .namespace-item__actions[_ngcontent-%COMP%]{opacity:1}"],changeDetection:0})};var j=()=>[];function z(s,e){if(s&1){let t=I();r(0,"agentos-namespace-item",3),l("selected",function(n){c(t);let i=o(2);return p(i.navigateToCases(n.id??""))})("editRequested",function(n){c(t);let i=o(2);return p(i.navigateToEdit(n))})("deleteRequested",function(n){c(t);let i=o(2);return p(i.deleteNamespace(n))})("integrationsRequested",function(n){c(t);let i=o(2);return p(i.openIntegrations(n))})("aiProvidersRequested",function(n){c(t);let i=o(2);return p(i.openAiProviders(n))})("aiModelsRequested",function(n){c(t);let i=o(2);return p(i.openAiModels(n))}),m()}s&2&&u("namespace",e)}function U(s,e){if(s&1&&v(0,z,1,1,"agentos-namespace-item",2),s&2){let t,a=e.$implicit,n=o();C((t=n.resolveNamespace(a.id))?0:-1,t)}}var $=class s{router=g(V);namespaceController=g(D);destroyRef=g(q);refresh$=new x(void 0);namespaces$=this.refresh$.pipe(w(()=>this.namespaceController.listAllNamespace()));namespaceItems$=this.namespaces$.pipe(R(e=>e.map(t=>({id:t.id??"",name:t.name,description:t.description}))));namespacesById=new Map;constructor(){this.namespaces$.pipe(N(this.destroyRef)).subscribe(e=>{this.namespacesById=new Map(e.map(t=>[t.id??"",t]))})}navigateToCases(e){this.router.navigate(["/agentos",e,"cases"])}navigateToCreate(){this.router.navigate(["/agentos/namespaces/new"])}navigateToEdit(e){this.router.navigate(["/agentos/namespaces",e.id??"","edit"])}openIntegrations(e){this.router.navigate(["/agentos",e.id,"integrations"])}openAiProviders(e){this.router.navigate(["/agentos",e.id,"ai-providers"])}openAiModels(e){this.router.navigate(["/agentos",e.id,"ai-models"])}deleteNamespace(e){this.namespaceController.deleteNamespace(e.id??"").pipe(N(this.destroyRef)).subscribe(()=>this.refresh$.next())}resolveNamespace(e){return this.namespacesById.get(e)??null}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=f({type:s,selectors:[["agentos-namespace-list"]],decls:4,vars:6,consts:[["namespaceItemTpl",""],["title","Namespaces","emptyMessage","No namespaces yet. Create one to get started.","cardMinWidth","400px",3,"itemSelected","createRequested","items","showCreate","itemTemplate"],[3,"namespace"],[3,"selected","editRequested","deleteRequested","integrationsRequested","aiProvidersRequested","aiModelsRequested","namespace"]],template:function(t,a){if(t&1&&(r(0,"ds-entity-list",1),P(1,"async"),l("itemSelected",function(i){return a.navigateToCases(i)})("createRequested",function(){return a.navigateToCreate()}),m(),M(2,U,1,1,"ng-template",null,0,L)),t&2){let n=k(3);u("items",S(1,3,a.namespaceItems$)??T(5,j))("showCreate",!0)("itemTemplate",n)}},dependencies:[y,O,E],encapsulation:2})};export{y as a,$ as b};
|