@whoz-oss/coday-client 0.83.0 → 0.85.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/3rdpartylicenses.txt +33 -33
- package/browser/chunk-3I3KTCJW.js +1 -0
- package/browser/{chunk-L62VJ6DL.js → chunk-64ZRWATH.js} +1 -1
- package/browser/{chunk-ZKMY6DMZ.js → chunk-6U5IOML5.js} +1 -1
- package/browser/chunk-75SUNMNL.js +1 -0
- package/browser/{chunk-TJKDVBVC.js → chunk-GNNRWNIY.js} +1 -1
- package/browser/{chunk-YXDDUSGH.js → chunk-HV577N5Z.js} +1 -1
- package/browser/chunk-J577MYXL.js +1 -0
- package/browser/chunk-JJVDNH6V.js +1 -0
- package/browser/chunk-LOONCJBU.js +1 -0
- package/browser/chunk-LU3TJP27.js +5 -0
- package/browser/chunk-NLYUDEOW.js +1 -0
- package/browser/chunk-OXQ5NGLD.js +1 -0
- package/browser/{chunk-LEVG5OCM.js → chunk-TOMK63FE.js} +1 -1
- package/browser/{chunk-NKVTMSP6.js → chunk-TYN7G4PU.js} +1 -1
- package/browser/chunk-WWXMC743.js +1 -0
- package/browser/{chunk-4Q2XO4DS.js → chunk-YELZ433M.js} +1 -1
- package/browser/index.html +1 -1
- package/browser/main-JYZJSM5L.js +377 -0
- package/package.json +1 -1
- package/browser/chunk-3FWTNKYQ.js +0 -5
- package/browser/chunk-4WEVVVZ4.js +0 -1
- package/browser/chunk-64RYYEWK.js +0 -1
- package/browser/chunk-ADVYSDMF.js +0 -1
- package/browser/chunk-HNLZEXQA.js +0 -1
- package/browser/chunk-LQ5SLS4R.js +0 -1
- package/browser/chunk-M4JNVHAR.js +0 -1
- package/browser/main-FNDXGLE2.js +0 -377
package/3rdpartylicenses.txt
CHANGED
|
@@ -103,32 +103,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
103
103
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
104
104
|
THE SOFTWARE.
|
|
105
105
|
|
|
106
|
-
--------------------------------------------------------------------------------
|
|
107
|
-
Package: @angular/core
|
|
108
|
-
License: "MIT"
|
|
109
|
-
|
|
110
|
-
The MIT License
|
|
111
|
-
|
|
112
|
-
Copyright (c) 2010-2025 Google LLC. https://angular.dev/license
|
|
113
|
-
|
|
114
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
115
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
116
|
-
in the Software without restriction, including without limitation the rights
|
|
117
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
118
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
119
|
-
furnished to do so, subject to the following conditions:
|
|
120
|
-
|
|
121
|
-
The above copyright notice and this permission notice shall be included in
|
|
122
|
-
all copies or substantial portions of the Software.
|
|
123
|
-
|
|
124
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
125
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
126
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
127
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
128
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
129
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
130
|
-
THE SOFTWARE.
|
|
131
|
-
|
|
132
106
|
--------------------------------------------------------------------------------
|
|
133
107
|
Package: marked
|
|
134
108
|
License: "MIT"
|
|
@@ -751,6 +725,32 @@ Exhibit B - “Incompatible With Secondary Licenses” Notice
|
|
|
751
725
|
the Mozilla Public License, v. 2.0.
|
|
752
726
|
|
|
753
727
|
|
|
728
|
+
--------------------------------------------------------------------------------
|
|
729
|
+
Package: date-fns
|
|
730
|
+
License: "MIT"
|
|
731
|
+
|
|
732
|
+
MIT License
|
|
733
|
+
|
|
734
|
+
Copyright (c) 2021 Sasha Koss and Lesha Koss https://kossnocorp.mit-license.org
|
|
735
|
+
|
|
736
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
737
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
738
|
+
in the Software without restriction, including without limitation the rights
|
|
739
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
740
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
741
|
+
furnished to do so, subject to the following conditions:
|
|
742
|
+
|
|
743
|
+
The above copyright notice and this permission notice shall be included in all
|
|
744
|
+
copies or substantial portions of the Software.
|
|
745
|
+
|
|
746
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
747
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
748
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
749
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
750
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
751
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
752
|
+
SOFTWARE.
|
|
753
|
+
|
|
754
754
|
--------------------------------------------------------------------------------
|
|
755
755
|
Package: @angular/forms
|
|
756
756
|
License: "MIT"
|
|
@@ -778,12 +778,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
778
778
|
THE SOFTWARE.
|
|
779
779
|
|
|
780
780
|
--------------------------------------------------------------------------------
|
|
781
|
-
Package:
|
|
781
|
+
Package: @angular/core
|
|
782
782
|
License: "MIT"
|
|
783
783
|
|
|
784
|
-
MIT License
|
|
784
|
+
The MIT License
|
|
785
785
|
|
|
786
|
-
Copyright (c)
|
|
786
|
+
Copyright (c) 2010-2025 Google LLC. https://angular.dev/license
|
|
787
787
|
|
|
788
788
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
789
789
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -792,16 +792,16 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
792
792
|
copies of the Software, and to permit persons to whom the Software is
|
|
793
793
|
furnished to do so, subject to the following conditions:
|
|
794
794
|
|
|
795
|
-
The above copyright notice and this permission notice shall be included in
|
|
796
|
-
copies or substantial portions of the Software.
|
|
795
|
+
The above copyright notice and this permission notice shall be included in
|
|
796
|
+
all copies or substantial portions of the Software.
|
|
797
797
|
|
|
798
798
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
799
799
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
800
800
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
801
801
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
802
802
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
803
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
804
|
-
SOFTWARE.
|
|
803
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
804
|
+
THE SOFTWARE.
|
|
805
805
|
|
|
806
806
|
--------------------------------------------------------------------------------
|
|
807
807
|
Package: rxjs
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-TOMK63FE.js";import"./chunk-LU3TJP27.js";export{a as AgentosShellComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as v}from"./chunk-
|
|
1
|
+
import{d as v}from"./chunk-HV577N5Z.js";import{$a as l,Aa as a,Pa as f,Qa as b,T as p,Wa as o,Xa as s,Ya as i,Za as _,_a as C,fa as g,lc as h,sa as u,tb as y}from"./chunk-LU3TJP27.js";function O(e,n){e&1&&l(0,"span",1)}function P(e,n){e&1&&l(0,"span",2)}function S(e,n){e&1&&l(0,"span",3)}var r=class e{pluginService=p(v);online=g(null);ngOnInit(){this.pluginService.getAllPlugins().subscribe({next:()=>this.online.set(!0),error:()=>this.online.set(!1)})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=a({type:e,selectors:[["agentos-backend-status"]],decls:4,vars:1,consts:[[1,"backend-status"],["title","AgentOS online",1,"dot","dot--online"],["title","AgentOS offline",1,"dot","dot--offline"],["title","Checking\u2026",1,"dot","dot--checking"]],template:function(t,d){if(t&1&&(_(0,"div",0),f(1,O,1,0,"span",1)(2,P,1,0,"span",2)(3,S,1,0,"span",3),C()),t&2){let m;u(),b((m=d.online())===!0?1:m===!1?2:3)}},styles:[".backend-status[_ngcontent-%COMP%]{display:flex;align-items:center}.dot[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;flex-shrink:0}.dot--online[_ngcontent-%COMP%]{background:var(--color-success, #34c759)}.dot--offline[_ngcontent-%COMP%]{background:var(--color-error, #ff3b30)}.dot--checking[_ngcontent-%COMP%]{background:var(--color-text-secondary, #6e6e73);opacity:.5;animation:_ngcontent-%COMP%_pulse 1.2s ease-in-out infinite}@keyframes _ngcontent-%COMP%_pulse{0%,to{opacity:.5}50%{opacity:1}}"]})};var c=class e{static \u0275fac=function(t){return new(t||e)};static \u0275cmp=a({type:e,selectors:[["agentos-header"]],decls:7,vars:0,consts:[[1,"header"],[1,"header__brand"],["src","CODAY-Logo.png","alt","Coday",1,"header__logo-img"],[1,"header__logo-text"],[1,"header__nav"]],template:function(t,d){t&1&&(o(0,"header",0)(1,"div",1),i(2,"img",2),o(3,"span",3),y(4,"Coday"),s()(),o(5,"nav",4),i(6,"agentos-backend-status"),s()())},dependencies:[r],styles:[".header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:0 1.5rem;height:56px;background:var(--glass-bg, rgba(255, 255, 255, .72));border-bottom:1px solid var(--glass-border, rgba(255, 255, 255, .18));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));position:sticky;top:0;z-index:100}.header__brand[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.header__logo-img[_ngcontent-%COMP%]{width:24px;height:24px;object-fit:contain}.header__logo-text[_ngcontent-%COMP%]{font-size:1rem;font-weight:600;letter-spacing:-.02em;color:var(--color-text, #1d1d1f)}.header__nav[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}"]})};var M=class e{static \u0275fac=function(t){return new(t||e)};static \u0275cmp=a({type:e,selectors:[["agentos-layout"]],decls:4,vars:0,consts:[[1,"layout"],[1,"layout__content"]],template:function(t,d){t&1&&(o(0,"div",0),i(1,"agentos-header"),o(2,"main",1),i(3,"router-outlet"),s()())},dependencies:[h,c],styles:[".layout[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-height:100vh}.layout__content[_ngcontent-%COMP%]{flex:1;overflow-y:auto}"]})};export{r as a,c as b,M as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as k,b as O}from"./chunk-
|
|
1
|
+
import{a as k,b as O}from"./chunk-HV577N5Z.js";import{Aa as f,Db as x,Eb as E,Oa as C,Pa as p,Qa as m,T as a,Ta as g,Ua as v,Za as i,Zb as M,_a as o,cb as b,eb as h,fa as u,fb as y,hc as P,kc as w,mc as I,sa as s,tb as r,ub as _}from"./chunk-LU3TJP27.js";function S(t,e){t&1&&(i(0,"p",6),r(1,"No cases yet. Start one below."),o())}function T(t,e){if(t&1&&(i(0,"div",7)(1,"span",8),r(2),o(),i(3,"span",9),r(4),o()()),t&2){let n=e.$implicit;s(2),_(n.id),s(2),_(n.status)}}function z(t,e){if(t&1&&g(0,T,5,2,"div",7,C().trackById,!0),t&2){let n=y();v(n)}}function V(t,e){t&1&&p(0,S,2,0,"p",6)(1,z,2,0),t&2&&m(e.length===0?0:1)}var L=class t{http=a(P);router=a(I);route=a(w);config=a(k);caseController=a(O);namespaceId=this.route.snapshot.params.namespaceId;cases$=this.caseController.listByParent1(this.namespaceId);inputValue=u("");onInput(e){this.inputValue.set(e.target.value)}onKeydown(e){e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),this.submit())}submit(){this.inputValue().trim()&&this.http.post(`${this.config.basePath}/api/cases`,{projectId:this.namespaceId,metadata:{}}).subscribe(n=>{this.inputValue.set(""),this.router.navigate(["/agentos",this.namespaceId,"cases",n.id])})}trackById(e,n){return n.id}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=f({type:t,selectors:[["agentos-case-list"]],decls:11,vars:4,consts:[[1,"case-list"],[1,"case-list__header"],[1,"case-list__items"],[1,"case-list__composer"],["placeholder","Start a new case\u2026","rows","3",1,"case-list__input",3,"input","keydown","value"],[1,"case-list__hint"],[1,"case-list__empty"],[1,"case-list__item"],[1,"case-list__item-id"],[1,"case-list__item-status"]],template:function(n,l){if(n&1&&(i(0,"div",0)(1,"header",1)(2,"h2"),r(3,"Cases"),o()(),i(4,"div",2),p(5,V,2,1),x(6,"async"),o(),i(7,"div",3)(8,"textarea",4),h("input",function(d){return l.onInput(d)})("keydown",function(d){return l.onKeydown(d)}),o(),i(9,"p",5),r(10,"Press Enter to send, Shift+Enter for new line"),o()()()),n&2){let c;s(5),m((c=E(6,2,l.cases$))?5:-1,c),s(3),b("value",l.inputValue())}},dependencies:[M],styles:[".case-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;max-width:720px;margin:0 auto;padding:2rem;gap:1.5rem}.case-list__header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.case-list__items[_ngcontent-%COMP%]{flex:1;overflow-y:auto}.case-list__empty[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.case-list__composer[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.case-list__input[_ngcontent-%COMP%]{width:100%;resize:none;padding:.75rem 1rem;border-radius:12px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));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));color:var(--color-text, #1d1d1f);font-size:.95rem;font-family:inherit;line-height:1.5;outline:none;box-sizing:border-box;transition:border-color .15s ease}.case-list__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.case-list__input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.case-list__hint[_ngcontent-%COMP%]{margin:0;font-size:.75rem;color:var(--color-text-secondary, #6e6e73);opacity:.7}"]})};export{L as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-GNNRWNIY.js";import"./chunk-HV577N5Z.js";import"./chunk-LU3TJP27.js";export{a as NamespaceListComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as M}from"./chunk-
|
|
1
|
+
import{c as M}from"./chunk-HV577N5Z.js";import{Aa as u,Db as y,Eb as h,Oa as x,Pa as c,Qa as l,T as r,Ta as g,Ua as E,X as C,Y as f,Za as a,Zb as b,_a as i,bb as v,eb as N,fb as p,mc as L,sa as o,tb as s,ub as d}from"./chunk-LU3TJP27.js";function T(e,n){e&1&&(a(0,"div",2)(1,"p"),s(2,"No namespaces available."),i()())}function w(e,n){if(e&1&&(a(0,"span",7),s(1),i()),e&2){let t=p().$implicit;o(),d(t.description)}}function I(e,n){if(e&1){let t=v();a(0,"li",4)(1,"button",5),N("click",function(){let m=C(t).$implicit,S=p(3);return f(S.select(m))}),a(2,"span",6),s(3),i(),c(4,w,2,1,"span",7),i()()}if(e&2){let t=n.$implicit;o(3),d(t.name),o(),l(t.description?4:-1)}}function k(e,n){if(e&1&&(a(0,"ul",3),g(1,I,5,2,"li",4,x().trackById,!0),i()),e&2){let t=p();o(),E(t)}}function O(e,n){e&1&&c(0,T,3,0,"div",2)(1,k,3,0,"ul",3),e&2&&l(n.length===0?0:1)}var P=class e{router=r(L);namespaceController=r(M);namespaces$=this.namespaceController.listAll();select(n){this.router.navigate(["/agentos",n.id,"cases"])}trackById(n,t){return t.id}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=u({type:e,selectors:[["agentos-namespace-list"]],decls:6,vars:3,consts:[[1,"namespace-list"],[1,"namespace-list__header"],[1,"namespace-list__empty"],[1,"namespace-list__items"],[1,"namespace-list__item"],["type","button",1,"namespace-list__item-btn",3,"click"],[1,"namespace-list__item-name"],[1,"namespace-list__item-desc"]],template:function(t,_){if(t&1&&(a(0,"div",0)(1,"header",1)(2,"h2"),s(3,"Namespaces"),i()(),c(4,O,2,1),y(5,"async"),i()),t&2){let m;o(4),l((m=h(5,1,_.namespaces$))?4:-1,m)}},dependencies:[b],styles:[".namespace-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:2rem;gap:1.5rem;max-width:640px;margin:0 auto}.namespace-list__header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.namespace-list__empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}"]})};export{P as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ia as G,P as m,R as F,S as H,T as O,U as W,a as u,b as f,dc as k,ec as h,f as N,fc as E}from"./chunk-3FWTNKYQ.js";var x=class{apiKeys;username;password;accessToken;basePath;withCredentials;encoder;encodeParam;credentials;constructor({accessToken:b,apiKeys:t,basePath:r,credentials:s,encodeParam:o,encoder:n,password:e,username:l,withCredentials:p}={}){t&&(this.apiKeys=t),l!==void 0&&(this.username=l),e!==void 0&&(this.password=e),b!==void 0&&(this.accessToken=b),r!==void 0&&(this.basePath=r),p!==void 0&&(this.withCredentials=p),n&&(this.encoder=n),this.encodeParam=o??(a=>this.defaultEncodeParam(a)),this.credentials=s??{}}selectHeaderContentType(b){if(b.length===0)return;let t=b.find(r=>this.isJsonMime(r));return t===void 0?b[0]:t}selectHeaderAccept(b){if(b.length===0)return;let t=b.find(r=>this.isJsonMime(r));return t===void 0?b[0]:t}isJsonMime(b){let t=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return b!==null&&(t.test(b)||b.toLowerCase()==="application/json-patch+json")}lookupCredential(b){let t=this.credentials[b];return typeof t=="function"?t():t}addCredentialToHeaders(b,t,r,s){let o=this.lookupCredential(b);return o?r.set(t,(s??"")+o):r}addCredentialToQuery(b,t,r){let s=this.lookupCredential(b);return s?r.set(t,s):r}defaultEncodeParam(b){let t=b.dataFormat==="date-time"&&b.value instanceof Date?b.value.toISOString():b.value;return encodeURIComponent(String(t))}};var A=new F("basePath");var R=class{encodeKey(b){return encodeURIComponent(b)}encodeValue(b){return encodeURIComponent(b)}decodeKey(b){return decodeURIComponent(b)}decodeValue(b){return decodeURIComponent(b)}};var P=class{basePath="http://localhost:8123";defaultHeaders=new k;configuration;encoder;constructor(b,t){if(this.configuration=t||new x,typeof this.configuration.basePath!="string"){let r=Array.isArray(b)?b[0]:void 0;r!=null&&(b=r),typeof b!="string"&&(b=this.basePath),this.configuration.basePath=b}this.encoder=this.configuration.encoder||new R}canConsumeForm(b){return b.indexOf("multipart/form-data")!==-1}addToHttpParams(b,t,r,s=!1){return typeof t=="object"&&!(t instanceof Date)?this.addToHttpParamsRecursive(b,t,s?r:void 0,s):this.addToHttpParamsRecursive(b,t,r)}addToHttpParamsRecursive(b,t,r,s=!1){if(t==null)return b;if(typeof t=="object"){if(r!=null)return s?Object.keys(t).reduce((o,n)=>o.append(`${r}[${n}]`,t[n]),b):b.append(r,JSON.stringify(t));if(Array.isArray(t))t.forEach(o=>b=this.addToHttpParamsRecursive(b,o,r));else if(t instanceof Date)if(r!=null)b=b.append(r,t.toISOString());else throw Error("key may not be null if value is Date");else Object.keys(t).forEach(o=>{let n=r?`${r}.${o}`:o;b=this.addToHttpParamsRecursive(b,t[o],n)});return b}else if(r!=null)return b.append(r,t);throw Error("key may not be null if value is not object or array")}};var V=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}addMessage(t,r,s="body",o=!1,n){if(t==null)throw new Error("Required parameter caseId was null or undefined when calling addMessage.");if(r==null)throw new Error("Required parameter addMessageRequest was null or undefined when calling addMessage.");let e=this.defaultHeaders,l=n?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);l!==void 0&&(e=e.set("Accept",l));let p=n?.context??new h,a=n?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let c="json";l&&(l.startsWith("text")?c="text":this.configuration.isJsonMime(l)?c="json":c="blob");let v=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/messages`,{basePath:C,withCredentials:y}=this.configuration;return this.httpClient.request("post",`${C}${v}`,f(u({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:s,transferCache:a,reportProgress:o}))}create1(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter caseModel was null or undefined when calling create1.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/cases",{basePath:v,withCredentials:C}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},C?{withCredentials:C}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}delete1(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling delete1.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getById1(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling getById1.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getByIds1(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIds1.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/cases/by-ids",{basePath:v,withCredentials:C}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},C?{withCredentials:C}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}killCase(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter caseId was null or undefined when calling killCase.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/kill`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}listByParent1(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter parentId was null or undefined when calling listByParent1.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/by-parentId/${this.configuration.encodeParam({name:"parentId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}stopCase(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter caseId was null or undefined when calling stopCase.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/stop`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}update1(t,r,s="body",o=!1,n){if(t==null)throw new Error("Required parameter id was null or undefined when calling update1.");if(r==null)throw new Error("Required parameter caseModel was null or undefined when calling update1.");let e=this.defaultHeaders,l=n?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);l!==void 0&&(e=e.set("Accept",l));let p=n?.context??new h,a=n?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let c="json";l&&(l.startsWith("text")?c="text":this.configuration.isJsonMime(l)?c="json":c="blob");let v=`/api/cases/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:C,withCredentials:y}=this.configuration;return this.httpClient.request("put",`${C}${v}`,f(u({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:s,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||g)(H(E),H(A,8),H(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};var I=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}_delete(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling _delete.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}create(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter namespace was null or undefined when calling create.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/namespaces",{basePath:v,withCredentials:C}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},C?{withCredentials:C}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getById(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling getById.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getByIds(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIds.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/namespaces/by-ids",{basePath:v,withCredentials:C}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},C?{withCredentials:C}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}listAll(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/namespaces/list",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("get",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}listByParent(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter parentId was null or undefined when calling listByParent.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/namespaces/by-parentId/${this.configuration.encodeParam({name:"parentId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}update(t,r,s="body",o=!1,n){if(t==null)throw new Error("Required parameter id was null or undefined when calling update.");if(r==null)throw new Error("Required parameter namespace was null or undefined when calling update.");let e=this.defaultHeaders,l=n?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);l!==void 0&&(e=e.set("Accept",l));let p=n?.context??new h,a=n?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let c="json";l&&(l.startsWith("text")?c="text":this.configuration.isJsonMime(l)?c="json":c="blob");let v=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:C,withCredentials:y}=this.configuration;return this.httpClient.request("put",`${C}${v}`,f(u({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:s,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||g)(H(E),H(A,8),H(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};var S=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}create2(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter agentFinishedEventAgentRunningEventAgentSelectedEventAnswerEventCaseStatusEventIntentionGeneratedEventMessageEventQuestionEventTextChunkEventThinkingEventToolRequestEventToolResponseEventToolSelectedEventWarnEvent was null or undefined when calling create2.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/case-events",{basePath:v,withCredentials:C}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},C?{withCredentials:C}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}delete2(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling delete2.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/case-events/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getById2(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling getById2.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/case-events/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getByIds2(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIds2.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/case-events/by-ids",{basePath:v,withCredentials:C}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},C?{withCredentials:C}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}listByParent2(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter parentId was null or undefined when calling listByParent2.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/case-events/by-parentId/${this.configuration.encodeParam({name:"parentId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}update2(t,r,s="body",o=!1,n){if(t==null)throw new Error("Required parameter id was null or undefined when calling update2.");if(r==null)throw new Error("Required parameter agentFinishedEventAgentRunningEventAgentSelectedEventAnswerEventCaseStatusEventIntentionGeneratedEventMessageEventQuestionEventTextChunkEventThinkingEventToolRequestEventToolResponseEventToolSelectedEventWarnEvent was null or undefined when calling update2.");let e=this.defaultHeaders,l=n?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);l!==void 0&&(e=e.set("Accept",l));let p=n?.context??new h,a=n?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let c="json";l&&(l.startsWith("text")?c="text":this.configuration.isJsonMime(l)?c="json":c="blob");let v=`/api/case-events/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:C,withCredentials:y}=this.configuration;return this.httpClient.request("put",`${C}${v}`,f(u({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:s,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||g)(H(E),H(A,8),H(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};var M=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}debugAllPlugins(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/plugins/debug",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("get",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}debugPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling debugPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/debug`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getAllPlugins(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/plugins",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("get",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}getPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling getPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}reloadAllAgents(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/plugins/reload-agents",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("post",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}reloadPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling reloadPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/reload`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}startPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling startPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/start`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}stopPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling stopPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/stop`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}unloadPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling unloadPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}uploadPlugin(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/plugins/upload",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("post",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}static \u0275fac=function(r){return new(r||g)(H(E),H(A,8),H(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};var $=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}streamEvents(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter caseId was null or undefined when calling streamEvents.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["text/event-stream"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/events`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}static \u0275fac=function(r){return new(r||g)(H(E),H(A,8),H(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};var q=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}executeTool(t,r,s="body",o=!1,n){if(t==null)throw new Error("Required parameter toolName was null or undefined when calling executeTool.");if(r==null)throw new Error("Required parameter requestBody was null or undefined when calling executeTool.");let e=this.defaultHeaders,l=n?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);l!==void 0&&(e=e.set("Accept",l));let p=n?.context??new h,a=n?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let c="json";l&&(l.startsWith("text")?c="text":this.configuration.isJsonMime(l)?c="json":c="blob");let v=`/api/tools/${this.configuration.encodeParam({name:"toolName",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/execute`,{basePath:C,withCredentials:y}=this.configuration;return this.httpClient.request("post",`${C}${v}`,f(u({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:s,transferCache:a,reportProgress:o}))}getTool(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter toolName was null or undefined when calling getTool.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/tools/${this.configuration.encodeParam({name:"toolName",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}listTools(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/tools",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("get",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}static \u0275fac=function(r){return new(r||g)(H(E),H(A,8),H(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};function en(g){return W([typeof g=="string"?{provide:A,useValue:g}:{provide:x,useValue:new x(u({},g))}])}var B=class g{config=O(x);zone=O(G);connect(b){let t=`${this.config.basePath}/api/cases/${b}/events`;return new N(r=>{let s=this.zone.runOutsideAngular(()=>new EventSource(t));return s.onmessage=o=>{try{let n=JSON.parse(o.data);this.zone.run(()=>r.next(n))}catch(n){this.zone.run(()=>r.error(new Error(`Failed to parse SSE event: ${n}`)))}},s.onerror=o=>{s.readyState===EventSource.CLOSED?this.zone.run(()=>r.complete()):this.zone.run(()=>r.error(new Error(`SSE connection error for case ${b}`))),s.close()},()=>s.close()})}static \u0275fac=function(t){return new(t||g)};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};export{x as a,V as b,I as c,M as d,en as e};
|
|
1
|
+
import{Ia as G,P as m,R as F,S as H,T as O,U as W,a as u,b as f,ec as k,f as N,gc as h,hc as E}from"./chunk-LU3TJP27.js";var x=class{apiKeys;username;password;accessToken;basePath;withCredentials;encoder;encodeParam;credentials;constructor({accessToken:b,apiKeys:t,basePath:r,credentials:s,encodeParam:o,encoder:n,password:e,username:l,withCredentials:p}={}){t&&(this.apiKeys=t),l!==void 0&&(this.username=l),e!==void 0&&(this.password=e),b!==void 0&&(this.accessToken=b),r!==void 0&&(this.basePath=r),p!==void 0&&(this.withCredentials=p),n&&(this.encoder=n),this.encodeParam=o??(a=>this.defaultEncodeParam(a)),this.credentials=s??{}}selectHeaderContentType(b){if(b.length===0)return;let t=b.find(r=>this.isJsonMime(r));return t===void 0?b[0]:t}selectHeaderAccept(b){if(b.length===0)return;let t=b.find(r=>this.isJsonMime(r));return t===void 0?b[0]:t}isJsonMime(b){let t=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return b!==null&&(t.test(b)||b.toLowerCase()==="application/json-patch+json")}lookupCredential(b){let t=this.credentials[b];return typeof t=="function"?t():t}addCredentialToHeaders(b,t,r,s){let o=this.lookupCredential(b);return o?r.set(t,(s??"")+o):r}addCredentialToQuery(b,t,r){let s=this.lookupCredential(b);return s?r.set(t,s):r}defaultEncodeParam(b){let t=b.dataFormat==="date-time"&&b.value instanceof Date?b.value.toISOString():b.value;return encodeURIComponent(String(t))}};var A=new F("basePath");var R=class{encodeKey(b){return encodeURIComponent(b)}encodeValue(b){return encodeURIComponent(b)}decodeKey(b){return decodeURIComponent(b)}decodeValue(b){return decodeURIComponent(b)}};var P=class{basePath="http://localhost:8123";defaultHeaders=new k;configuration;encoder;constructor(b,t){if(this.configuration=t||new x,typeof this.configuration.basePath!="string"){let r=Array.isArray(b)?b[0]:void 0;r!=null&&(b=r),typeof b!="string"&&(b=this.basePath),this.configuration.basePath=b}this.encoder=this.configuration.encoder||new R}canConsumeForm(b){return b.indexOf("multipart/form-data")!==-1}addToHttpParams(b,t,r,s=!1){return typeof t=="object"&&!(t instanceof Date)?this.addToHttpParamsRecursive(b,t,s?r:void 0,s):this.addToHttpParamsRecursive(b,t,r)}addToHttpParamsRecursive(b,t,r,s=!1){if(t==null)return b;if(typeof t=="object"){if(r!=null)return s?Object.keys(t).reduce((o,n)=>o.append(`${r}[${n}]`,t[n]),b):b.append(r,JSON.stringify(t));if(Array.isArray(t))t.forEach(o=>b=this.addToHttpParamsRecursive(b,o,r));else if(t instanceof Date)if(r!=null)b=b.append(r,t.toISOString());else throw Error("key may not be null if value is Date");else Object.keys(t).forEach(o=>{let n=r?`${r}.${o}`:o;b=this.addToHttpParamsRecursive(b,t[o],n)});return b}else if(r!=null)return b.append(r,t);throw Error("key may not be null if value is not object or array")}};var V=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}addMessage(t,r,s="body",o=!1,n){if(t==null)throw new Error("Required parameter caseId was null or undefined when calling addMessage.");if(r==null)throw new Error("Required parameter addMessageRequest was null or undefined when calling addMessage.");let e=this.defaultHeaders,l=n?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);l!==void 0&&(e=e.set("Accept",l));let p=n?.context??new h,a=n?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let c="json";l&&(l.startsWith("text")?c="text":this.configuration.isJsonMime(l)?c="json":c="blob");let v=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/messages`,{basePath:C,withCredentials:y}=this.configuration;return this.httpClient.request("post",`${C}${v}`,f(u({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:s,transferCache:a,reportProgress:o}))}create1(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter caseModel was null or undefined when calling create1.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/cases",{basePath:v,withCredentials:C}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},C?{withCredentials:C}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}delete1(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling delete1.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getById1(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling getById1.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getByIds1(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIds1.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/cases/by-ids",{basePath:v,withCredentials:C}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},C?{withCredentials:C}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}killCase(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter caseId was null or undefined when calling killCase.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/kill`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}listByParent1(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter parentId was null or undefined when calling listByParent1.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/by-parentId/${this.configuration.encodeParam({name:"parentId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}stopCase(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter caseId was null or undefined when calling stopCase.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/stop`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}update1(t,r,s="body",o=!1,n){if(t==null)throw new Error("Required parameter id was null or undefined when calling update1.");if(r==null)throw new Error("Required parameter caseModel was null or undefined when calling update1.");let e=this.defaultHeaders,l=n?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);l!==void 0&&(e=e.set("Accept",l));let p=n?.context??new h,a=n?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let c="json";l&&(l.startsWith("text")?c="text":this.configuration.isJsonMime(l)?c="json":c="blob");let v=`/api/cases/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:C,withCredentials:y}=this.configuration;return this.httpClient.request("put",`${C}${v}`,f(u({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:s,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||g)(H(E),H(A,8),H(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};var I=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}_delete(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling _delete.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}create(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter namespace was null or undefined when calling create.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/namespaces",{basePath:v,withCredentials:C}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},C?{withCredentials:C}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getById(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling getById.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getByIds(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIds.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/namespaces/by-ids",{basePath:v,withCredentials:C}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},C?{withCredentials:C}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}listAll(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/namespaces/list",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("get",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}listByParent(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter parentId was null or undefined when calling listByParent.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/namespaces/by-parentId/${this.configuration.encodeParam({name:"parentId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}update(t,r,s="body",o=!1,n){if(t==null)throw new Error("Required parameter id was null or undefined when calling update.");if(r==null)throw new Error("Required parameter namespace was null or undefined when calling update.");let e=this.defaultHeaders,l=n?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);l!==void 0&&(e=e.set("Accept",l));let p=n?.context??new h,a=n?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let c="json";l&&(l.startsWith("text")?c="text":this.configuration.isJsonMime(l)?c="json":c="blob");let v=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:C,withCredentials:y}=this.configuration;return this.httpClient.request("put",`${C}${v}`,f(u({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:s,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||g)(H(E),H(A,8),H(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};var S=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}create2(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter agentFinishedEventAgentRunningEventAgentSelectedEventAnswerEventCaseStatusEventIntentionGeneratedEventMessageEventQuestionEventTextChunkEventThinkingEventToolRequestEventToolResponseEventToolSelectedEventWarnEvent was null or undefined when calling create2.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/case-events",{basePath:v,withCredentials:C}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},C?{withCredentials:C}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}delete2(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling delete2.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/case-events/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getById2(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter id was null or undefined when calling getById2.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/case-events/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getByIds2(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIds2.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(n=n.set("Content-Type",d));let i="json";e&&(e.startsWith("text")?i="text":this.configuration.isJsonMime(e)?i="json":i="blob");let c="/api/case-events/by-ids",{basePath:v,withCredentials:C}=this.configuration;return this.httpClient.request("post",`${v}${c}`,f(u({context:l,body:t,responseType:i},C?{withCredentials:C}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}listByParent2(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter parentId was null or undefined when calling listByParent2.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/case-events/by-parentId/${this.configuration.encodeParam({name:"parentId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}update2(t,r,s="body",o=!1,n){if(t==null)throw new Error("Required parameter id was null or undefined when calling update2.");if(r==null)throw new Error("Required parameter agentFinishedEventAgentRunningEventAgentSelectedEventAnswerEventCaseStatusEventIntentionGeneratedEventMessageEventQuestionEventTextChunkEventThinkingEventToolRequestEventToolResponseEventToolSelectedEventWarnEvent was null or undefined when calling update2.");let e=this.defaultHeaders,l=n?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);l!==void 0&&(e=e.set("Accept",l));let p=n?.context??new h,a=n?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let c="json";l&&(l.startsWith("text")?c="text":this.configuration.isJsonMime(l)?c="json":c="blob");let v=`/api/case-events/${this.configuration.encodeParam({name:"id",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:C,withCredentials:y}=this.configuration;return this.httpClient.request("put",`${C}${v}`,f(u({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:s,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||g)(H(E),H(A,8),H(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};var M=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}debugAllPlugins(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/plugins/debug",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("get",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}debugPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling debugPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/debug`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}getAllPlugins(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/plugins",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("get",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}getPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling getPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}reloadAllAgents(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/plugins/reload-agents",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("post",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}reloadPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling reloadPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/reload`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}startPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling startPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/start`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}stopPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling stopPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/stop`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}unloadPlugin(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter pluginId was null or undefined when calling unloadPlugin.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}uploadPlugin(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/plugins/upload",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("post",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}static \u0275fac=function(r){return new(r||g)(H(E),H(A,8),H(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};var $=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}streamEvents(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter caseId was null or undefined when calling streamEvents.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["text/event-stream"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/events`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}static \u0275fac=function(r){return new(r||g)(H(E),H(A,8),H(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};var q=class g extends P{constructor(t,r,s){super(r,s);this.httpClient=t}executeTool(t,r,s="body",o=!1,n){if(t==null)throw new Error("Required parameter toolName was null or undefined when calling executeTool.");if(r==null)throw new Error("Required parameter requestBody was null or undefined when calling executeTool.");let e=this.defaultHeaders,l=n?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);l!==void 0&&(e=e.set("Accept",l));let p=n?.context??new h,a=n?.transferCache??!0,d=["application/json"],i=this.configuration.selectHeaderContentType(d);i!==void 0&&(e=e.set("Content-Type",i));let c="json";l&&(l.startsWith("text")?c="text":this.configuration.isJsonMime(l)?c="json":c="blob");let v=`/api/tools/${this.configuration.encodeParam({name:"toolName",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/execute`,{basePath:C,withCredentials:y}=this.configuration;return this.httpClient.request("post",`${C}${v}`,f(u({context:p,body:r,responseType:c},y?{withCredentials:y}:{}),{headers:e,observe:s,transferCache:a,reportProgress:o}))}getTool(t,r="body",s=!1,o){if(t==null)throw new Error("Required parameter toolName was null or undefined when calling getTool.");let n=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(n=n.set("Accept",e));let l=o?.context??new h,p=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/tools/${this.configuration.encodeParam({name:"toolName",value:t,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:i,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${i}${d}`,f(u({context:l,responseType:a},c?{withCredentials:c}:{}),{headers:n,observe:r,transferCache:p,reportProgress:s}))}listTools(t="body",r=!1,s){let o=this.defaultHeaders,n=s?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);n!==void 0&&(o=o.set("Accept",n));let e=s?.context??new h,l=s?.transferCache??!0,p="json";n&&(n.startsWith("text")?p="text":this.configuration.isJsonMime(n)?p="json":p="blob");let a="/api/tools",{basePath:d,withCredentials:i}=this.configuration;return this.httpClient.request("get",`${d}${a}`,f(u({context:e,responseType:p},i?{withCredentials:i}:{}),{headers:o,observe:t,transferCache:l,reportProgress:r}))}static \u0275fac=function(r){return new(r||g)(H(E),H(A,8),H(x,8))};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};function en(g){return W([typeof g=="string"?{provide:A,useValue:g}:{provide:x,useValue:new x(u({},g))}])}var B=class g{config=O(x);zone=O(G);connect(b){let t=`${this.config.basePath}/api/cases/${b}/events`;return new N(r=>{let s=this.zone.runOutsideAngular(()=>new EventSource(t));return s.onmessage=o=>{try{let n=JSON.parse(o.data);this.zone.run(()=>r.next(n))}catch(n){this.zone.run(()=>r.error(new Error(`Failed to parse SSE event: ${n}`)))}},s.onerror=o=>{s.readyState===EventSource.CLOSED?this.zone.run(()=>r.complete()):this.zone.run(()=>r.error(new Error(`SSE connection error for case ${b}`))),s.close()},()=>s.close()})}static \u0275fac=function(t){return new(t||g)};static \u0275prov=m({token:g,factory:g.\u0275fac,providedIn:"root"})};export{x as a,V as b,I as c,M as d,en as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as ge,Ba as me,Bb as d,Ca as l,Ea as u,G as de,Ha as x,Ib as y,J as he,Ja as Re,Jb as b,K as Ne,Ka as ke,M as fe,Ma as Te,N as A,Na as T,O as c,Ob as ve,P as F,Pb as _e,Q as pe,R as I,T as g,Tb as ye,a as h,b as m,ba as S,d as Fe,db as _,f as Ie,fa as C,g as Se,ga as q,h as W,ha as v,hc as Ue,ia as j,j as je,k as Oe,o as k,p as xe,rb as Ge,s as Pe,va as O,wa as a,z as ce}from"./chunk-LU3TJP27.js";var z=class n{baseUrl="/api/projects";http=g(Ue);listProjects(){return this.http.get(this.baseUrl)}getProject(t){return this.http.get(`${this.baseUrl}/${t}`)}getProjectConfig(t){return this.http.get(`${this.baseUrl}/${t}/config`)}updateProjectConfig(t,e){return this.http.put(`${this.baseUrl}/${t}/config`,e)}createProject(t,e){return this.http.post(this.baseUrl,{name:t,path:e})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=F({token:n,factory:n.\u0275fac,providedIn:"root"})};var He=class n{selectedProjectIdSubject=new W(null);isLoadingSubject=new W(!1);refreshTriggerSubject=new W(void 0);hasInitialized=!1;isLoading$=this.isLoadingSubject.asObservable();projectApi=g(z);projectListCall=this.refreshTriggerSubject.pipe(he(()=>this.projectApi.listProjects()),de({bufferSize:1,refCount:!0}));projectList$=this.projectListCall.pipe(k(t=>t.projects));forcedProject$=this.projectListCall.pipe(k(t=>t.forcedProject));selectedProject$=xe([this.selectedProjectIdSubject,this.forcedProject$]).pipe(he(([t,e])=>{let i=e??t;return i?this.projectApi.getProject(i):Oe(null)}),fe(t=>{t&&t.name!==this.selectedProjectIdSubject.value&&(console.log("[PROJECT-STATE] Backend returned different project name:",t.name),this.selectedProjectIdSubject.next(t.name))}),de({bufferSize:1,refCount:!0}));selectProject(t){console.log("[PROJECT-STATE] Explicit project selection:",t),this.forcedProject$.pipe(ce(1)).subscribe(e=>this.selectedProjectIdSubject.next(e??t))}getSelectedProjectId(){return this.selectedProjectIdSubject.value}getSelectedProjectIdOrThrow(){let t=this.selectedProjectIdSubject.value;if(!t)throw new Error("[PROJECT_STATE] No project selected");return t}clearSelection(){console.log("[PROJECT-STATE] Clearing project selection"),this.selectedProjectIdSubject.next(null)}initializeDefaultProject(){return Fe(this,null,function*(){if(this.hasInitialized){console.log("[PROJECT-STATE] Already initialized, skipping");return}this.hasInitialized=!0;let t=yield this.projectApi.listProjects().pipe(ce(1)).toPromise();if(!t){console.log("[PROJECT-STATE] No response from project API");return}let{defaultProject:e,forcedProject:i}=t;e&&!i?(console.log("[PROJECT-STATE] Initializing with default project:",e),this.selectedProjectIdSubject.next(e)):i?(console.log("[PROJECT-STATE] Initializing with forced project:",i),this.selectedProjectIdSubject.next(i)):console.log("[PROJECT-STATE] No default project, staying on selection page")})}createProject(t,e){return this.isLoadingSubject.next(!0),this.projectApi.createProject(t,e).pipe(fe(()=>{this.isLoadingSubject.next(!1),this.refreshTriggerSubject.next()}))}static \u0275fac=function(e){return new(e||n)};static \u0275prov=F({token:n,factory:n.\u0275fac,providedIn:"root"})};var Ke=(()=>{class n{_renderer;_elementRef;onChange=e=>{};onTouched=()=>{};constructor(e,i){this._renderer=e,this._elementRef=i}setProperty(e,i){this._renderer.setProperty(this._elementRef.nativeElement,e,i)}registerOnTouched(e){this.onTouched=e}registerOnChange(e){this.onChange=e}setDisabledState(e){this.setProperty("disabled",e)}static \u0275fac=function(i){return new(i||n)(a(O),a(j))};static \u0275dir=l({type:n})}return n})(),E=(()=>{class n extends Ke{static \u0275fac=(()=>{let e;return function(r){return(e||(e=v(n)))(r||n)}})();static \u0275dir=l({type:n,features:[u]})}return n})(),D=new I(""),Dt={provide:D,useExisting:c(()=>At),multi:!0},At=(()=>{class n extends E{writeValue(e){this.setProperty("checked",e)}static \u0275fac=(()=>{let e;return function(r){return(e||(e=v(n)))(r||n)}})();static \u0275dir=l({type:n,selectors:[["input","type","checkbox","formControlName",""],["input","type","checkbox","formControl",""],["input","type","checkbox","ngModel",""]],hostBindings:function(i,r){i&1&&_("change",function(s){return r.onChange(s.target.checked)})("blur",function(){return r.onTouched()})},standalone:!1,features:[d([Dt]),u]})}return n})(),Mt={provide:D,useExisting:c(()=>Qe),multi:!0};function Et(){let n=ye()?ye().getUserAgent():"";return/android (\d+)/.test(n.toLowerCase())}var wt=new I(""),Qe=(()=>{class n extends Ke{_compositionMode;_composing=!1;constructor(e,i,r){super(e,i),this._compositionMode=r,this._compositionMode==null&&(this._compositionMode=!Et())}writeValue(e){let i=e??"";this.setProperty("value",i)}_handleInput(e){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}_compositionStart(){this._composing=!0}_compositionEnd(e){this._composing=!1,this._compositionMode&&this.onChange(e)}static \u0275fac=function(i){return new(i||n)(a(O),a(j),a(wt,8))};static \u0275dir=l({type:n,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(i,r){i&1&&_("input",function(s){return r._handleInput(s.target.value)})("blur",function(){return r.onTouched()})("compositionstart",function(){return r._compositionStart()})("compositionend",function(s){return r._compositionEnd(s.target.value)})},standalone:!1,features:[d([Mt]),u]})}return n})();function Ve(n){return n==null||De(n)===0}function De(n){return n==null?null:Array.isArray(n)||typeof n=="string"?n.length:n instanceof Set?n.size:null}var w=new I(""),Ae=new I(""),Ft=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Le=class{static min(t){return et(t)}static max(t){return tt(t)}static required(t){return nt(t)}static requiredTrue(t){return It(t)}static email(t){return St(t)}static minLength(t){return jt(t)}static maxLength(t){return it(t)}static pattern(t){return Ot(t)}static nullValidator(t){return Z()}static compose(t){return ut(t)}static composeAsync(t){return ct(t)}};function et(n){return t=>{if(t.value==null||n==null)return null;let e=parseFloat(t.value);return!isNaN(e)&&e<n?{min:{min:n,actual:t.value}}:null}}function tt(n){return t=>{if(t.value==null||n==null)return null;let e=parseFloat(t.value);return!isNaN(e)&&e>n?{max:{max:n,actual:t.value}}:null}}function nt(n){return Ve(n.value)?{required:!0}:null}function It(n){return n.value===!0?null:{required:!0}}function St(n){return Ve(n.value)||Ft.test(n.value)?null:{email:!0}}function jt(n){return t=>{let e=t.value?.length??De(t.value);return e===null||e===0?null:e<n?{minlength:{requiredLength:n,actualLength:e}}:null}}function it(n){return t=>{let e=t.value?.length??De(t.value);return e!==null&&e>n?{maxlength:{requiredLength:n,actualLength:e}}:null}}function Ot(n){if(!n)return Z;let t,e;return typeof n=="string"?(e="",n.charAt(0)!=="^"&&(e+="^"),e+=n,n.charAt(n.length-1)!=="$"&&(e+="$"),t=new RegExp(e)):(e=n.toString(),t=n),i=>{if(Ve(i.value))return null;let r=i.value;return t.test(r)?null:{pattern:{requiredPattern:e,actualValue:r}}}}function Z(n){return null}function rt(n){return n!=null}function ot(n){return ke(n)?je(n):n}function st(n){let t={};return n.forEach(e=>{t=e!=null?h(h({},t),e):t}),Object.keys(t).length===0?null:t}function at(n,t){return t.map(e=>e(n))}function xt(n){return!n.validate}function lt(n){return n.map(t=>xt(t)?t:e=>t.validate(e))}function ut(n){if(!n)return null;let t=n.filter(rt);return t.length==0?null:function(e){return st(at(e,t))}}function Me(n){return n!=null?ut(lt(n)):null}function ct(n){if(!n)return null;let t=n.filter(rt);return t.length==0?null:function(e){let i=at(e,t).map(ot);return Pe(i).pipe(k(st))}}function Ee(n){return n!=null?ct(lt(n)):null}function $e(n,t){return n===null?[t]:Array.isArray(n)?[...n,t]:[n,t]}function dt(n){return n._rawValidators}function ht(n){return n._rawAsyncValidators}function Ce(n){return n?Array.isArray(n)?n:[n]:[]}function X(n,t){return Array.isArray(n)?n.includes(t):n===t}function We(n,t){let e=Ce(t);return Ce(n).forEach(r=>{X(e,r)||e.push(r)}),e}function qe(n,t){return Ce(t).filter(e=>!X(n,e))}var Y=class{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(t){this._rawValidators=t||[],this._composedValidatorFn=Me(this._rawValidators)}_setAsyncValidators(t){this._rawAsyncValidators=t||[],this._composedAsyncValidatorFn=Ee(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(t){this._onDestroyCallbacks.push(t)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(t=>t()),this._onDestroyCallbacks=[]}reset(t=void 0){this.control&&this.control.reset(t)}hasError(t,e){return this.control?this.control.hasError(t,e):!1}getError(t,e){return this.control?this.control.getError(t,e):null}},M=class extends Y{name;get formDirective(){return null}get path(){return null}},R=class extends Y{_parent=null;name=null;valueAccessor=null},be=class{_cd;constructor(t){this._cd=t}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}},Pt={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},Kn=m(h({},Pt),{"[class.ng-submitted]":"isSubmitted"}),Qn=(()=>{class n extends be{constructor(e){super(e)}static \u0275fac=function(i){return new(i||n)(a(R,2))};static \u0275dir=l({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(i,r){i&2&&Ge("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending)},standalone:!1,features:[u]})}return n})();var G="VALID",J="INVALID",P="PENDING",U="DISABLED",V=class{},K=class extends V{value;source;constructor(t,e){super(),this.value=t,this.source=e}},H=class extends V{pristine;source;constructor(t,e){super(),this.pristine=t,this.source=e}},L=class extends V{touched;source;constructor(t,e){super(),this.touched=t,this.source=e}},N=class extends V{status;source;constructor(t,e){super(),this.status=t,this.source=e}},Q=class extends V{source;constructor(t){super(),this.source=t}},ee=class extends V{source;constructor(t){super(),this.source=t}};function ft(n){return(se(n)?n.validators:n)||null}function Nt(n){return Array.isArray(n)?Me(n):n||null}function pt(n,t){return(se(t)?t.asyncValidators:n)||null}function Rt(n){return Array.isArray(n)?Ee(n):n||null}function se(n){return n!=null&&!Array.isArray(n)&&typeof n=="object"}function kt(n,t,e){let i=n.controls;if(!(t?Object.keys(i):i).length)throw new A(1e3,"");if(!i[e])throw new A(1001,"")}function Tt(n,t,e){n._forEachChild((i,r)=>{if(e[r]===void 0)throw new A(1002,"")})}var te=class{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(t,e){this._assignValidators(t),this._assignAsyncValidators(e)}get validator(){return this._composedValidatorFn}set validator(t){this._rawValidators=this._composedValidatorFn=t}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(t){this._rawAsyncValidators=this._composedAsyncValidatorFn=t}get parent(){return this._parent}get status(){return y(this.statusReactive)}set status(t){y(()=>this.statusReactive.set(t))}_status=b(()=>this.statusReactive());statusReactive=C(void 0);get valid(){return this.status===G}get invalid(){return this.status===J}get pending(){return this.status==P}get disabled(){return this.status===U}get enabled(){return this.status!==U}errors;get pristine(){return y(this.pristineReactive)}set pristine(t){y(()=>this.pristineReactive.set(t))}_pristine=b(()=>this.pristineReactive());pristineReactive=C(!0);get dirty(){return!this.pristine}get touched(){return y(this.touchedReactive)}set touched(t){y(()=>this.touchedReactive.set(t))}_touched=b(()=>this.touchedReactive());touchedReactive=C(!1);get untouched(){return!this.touched}_events=new Se;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(t){this._assignValidators(t)}setAsyncValidators(t){this._assignAsyncValidators(t)}addValidators(t){this.setValidators(We(t,this._rawValidators))}addAsyncValidators(t){this.setAsyncValidators(We(t,this._rawAsyncValidators))}removeValidators(t){this.setValidators(qe(t,this._rawValidators))}removeAsyncValidators(t){this.setAsyncValidators(qe(t,this._rawAsyncValidators))}hasValidator(t){return X(this._rawValidators,t)}hasAsyncValidator(t){return X(this._rawAsyncValidators,t)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(t={}){let e=this.touched===!1;this.touched=!0;let i=t.sourceControl??this;this._parent&&!t.onlySelf&&this._parent.markAsTouched(m(h({},t),{sourceControl:i})),e&&t.emitEvent!==!1&&this._events.next(new L(!0,i))}markAllAsDirty(t={}){this.markAsDirty({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsDirty(t))}markAllAsTouched(t={}){this.markAsTouched({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:this}),this._forEachChild(e=>e.markAllAsTouched(t))}markAsUntouched(t={}){let e=this.touched===!0;this.touched=!1,this._pendingTouched=!1;let i=t.sourceControl??this;this._forEachChild(r=>{r.markAsUntouched({onlySelf:!0,emitEvent:t.emitEvent,sourceControl:i})}),this._parent&&!t.onlySelf&&this._parent._updateTouched(t,i),e&&t.emitEvent!==!1&&this._events.next(new L(!1,i))}markAsDirty(t={}){let e=this.pristine===!0;this.pristine=!1;let i=t.sourceControl??this;this._parent&&!t.onlySelf&&this._parent.markAsDirty(m(h({},t),{sourceControl:i})),e&&t.emitEvent!==!1&&this._events.next(new H(!1,i))}markAsPristine(t={}){let e=this.pristine===!1;this.pristine=!0,this._pendingDirty=!1;let i=t.sourceControl??this;this._forEachChild(r=>{r.markAsPristine({onlySelf:!0,emitEvent:t.emitEvent})}),this._parent&&!t.onlySelf&&this._parent._updatePristine(t,i),e&&t.emitEvent!==!1&&this._events.next(new H(!0,i))}markAsPending(t={}){this.status=P;let e=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new N(this.status,e)),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.markAsPending(m(h({},t),{sourceControl:e}))}disable(t={}){let e=this._parentMarkedDirty(t.onlySelf);this.status=U,this.errors=null,this._forEachChild(r=>{r.disable(m(h({},t),{onlySelf:!0}))}),this._updateValue();let i=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new K(this.value,i)),this._events.next(new N(this.status,i)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(m(h({},t),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(r=>r(!0))}enable(t={}){let e=this._parentMarkedDirty(t.onlySelf);this.status=G,this._forEachChild(i=>{i.enable(m(h({},t),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent}),this._updateAncestors(m(h({},t),{skipPristineCheck:e}),this),this._onDisabledChange.forEach(i=>i(!1))}_updateAncestors(t,e){this._parent&&!t.onlySelf&&(this._parent.updateValueAndValidity(t),t.skipPristineCheck||this._parent._updatePristine({},e),this._parent._updateTouched({},e))}setParent(t){this._parent=t}getRawValue(){return this.value}updateValueAndValidity(t={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){let i=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===G||this.status===P)&&this._runAsyncValidator(i,t.emitEvent)}let e=t.sourceControl??this;t.emitEvent!==!1&&(this._events.next(new K(this.value,e)),this._events.next(new N(this.status,e)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!t.onlySelf&&this._parent.updateValueAndValidity(m(h({},t),{sourceControl:e}))}_updateTreeValidity(t={emitEvent:!0}){this._forEachChild(e=>e._updateTreeValidity(t)),this.updateValueAndValidity({onlySelf:!0,emitEvent:t.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?U:G}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(t,e){if(this.asyncValidator){this.status=P,this._hasOwnPendingAsyncValidator={emitEvent:e!==!1,shouldHaveEmitted:t!==!1};let i=ot(this.asyncValidator(this));this._asyncValidationSubscription=i.subscribe(r=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(r,{emitEvent:e,shouldHaveEmitted:t})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();let t=(this._hasOwnPendingAsyncValidator?.emitEvent||this._hasOwnPendingAsyncValidator?.shouldHaveEmitted)??!1;return this._hasOwnPendingAsyncValidator=null,t}return!1}setErrors(t,e={}){this.errors=t,this._updateControlsErrors(e.emitEvent!==!1,this,e.shouldHaveEmitted)}get(t){let e=t;return e==null||(Array.isArray(e)||(e=e.split(".")),e.length===0)?null:e.reduce((i,r)=>i&&i._find(r),this)}getError(t,e){let i=e?this.get(e):this;return i&&i.errors?i.errors[t]:null}hasError(t,e){return!!this.getError(t,e)}get root(){let t=this;for(;t._parent;)t=t._parent;return t}_updateControlsErrors(t,e,i){this.status=this._calculateStatus(),t&&this.statusChanges.emit(this.status),(t||i)&&this._events.next(new N(this.status,e)),this._parent&&this._parent._updateControlsErrors(t,e,i)}_initObservables(){this.valueChanges=new x,this.statusChanges=new x}_calculateStatus(){return this._allControlsDisabled()?U:this.errors?J:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(P)?P:this._anyControlsHaveStatus(J)?J:G}_anyControlsHaveStatus(t){return this._anyControls(e=>e.status===t)}_anyControlsDirty(){return this._anyControls(t=>t.dirty)}_anyControlsTouched(){return this._anyControls(t=>t.touched)}_updatePristine(t,e){let i=!this._anyControlsDirty(),r=this.pristine!==i;this.pristine=i,this._parent&&!t.onlySelf&&this._parent._updatePristine(t,e),r&&this._events.next(new H(this.pristine,e))}_updateTouched(t={},e){this.touched=this._anyControlsTouched(),this._events.next(new L(this.touched,e)),this._parent&&!t.onlySelf&&this._parent._updateTouched(t,e)}_onDisabledChange=[];_registerOnCollectionChange(t){this._onCollectionChange=t}_setUpdateStrategy(t){se(t)&&t.updateOn!=null&&(this._updateOn=t.updateOn)}_parentMarkedDirty(t){let e=this._parent&&this._parent.dirty;return!t&&!!e&&!this._parent._anyControlsDirty()}_find(t){return null}_assignValidators(t){this._rawValidators=Array.isArray(t)?t.slice():t,this._composedValidatorFn=Nt(this._rawValidators)}_assignAsyncValidators(t){this._rawAsyncValidators=Array.isArray(t)?t.slice():t,this._composedAsyncValidatorFn=Rt(this._rawAsyncValidators)}},ne=class extends te{constructor(t,e,i){super(ft(e),pt(i,e)),this.controls=t,this._initObservables(),this._setUpdateStrategy(e),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;registerControl(t,e){return this.controls[t]?this.controls[t]:(this.controls[t]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)}addControl(t,e,i={}){this.registerControl(t,e),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}removeControl(t,e={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],this.updateValueAndValidity({emitEvent:e.emitEvent}),this._onCollectionChange()}setControl(t,e,i={}){this.controls[t]&&this.controls[t]._registerOnCollectionChange(()=>{}),delete this.controls[t],e&&this.registerControl(t,e),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}contains(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled}setValue(t,e={}){Tt(this,!0,t),Object.keys(t).forEach(i=>{kt(this,!0,i),this.controls[i].setValue(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)}patchValue(t,e={}){t!=null&&(Object.keys(t).forEach(i=>{let r=this.controls[i];r&&r.patchValue(t[i],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e))}reset(t={},e={}){this._forEachChild((i,r)=>{i.reset(t?t[r]:null,{onlySelf:!0,emitEvent:e.emitEvent})}),this._updatePristine(e,this),this._updateTouched(e,this),this.updateValueAndValidity(e),e?.emitEvent!==!1&&this._events.next(new ee(this))}getRawValue(){return this._reduceChildren({},(t,e,i)=>(t[i]=e.getRawValue(),t))}_syncPendingControls(){let t=this._reduceChildren(!1,(e,i)=>i._syncPendingControls()?!0:e);return t&&this.updateValueAndValidity({onlySelf:!0}),t}_forEachChild(t){Object.keys(this.controls).forEach(e=>{let i=this.controls[e];i&&t(i,e)})}_setUpControls(){this._forEachChild(t=>{t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(t){for(let[e,i]of Object.entries(this.controls))if(this.contains(e)&&t(i))return!0;return!1}_reduceValue(){let t={};return this._reduceChildren(t,(e,i,r)=>((i.enabled||this.disabled)&&(e[r]=i.value),e))}_reduceChildren(t,e){let i=t;return this._forEachChild((r,o)=>{i=e(i,r,o)}),i}_allControlsDisabled(){for(let t of Object.keys(this.controls))if(this.controls[t].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(t){return this.controls.hasOwnProperty(t)?this.controls[t]:null}};var $=new I("",{providedIn:"root",factory:()=>ae}),ae="always";function Gt(n,t){return[...t.path,n]}function ie(n,t,e=ae){we(n,t),t.valueAccessor.writeValue(n.value),(n.disabled||e==="always")&&t.valueAccessor.setDisabledState?.(n.disabled),Bt(n,t),Lt(n,t),Ht(n,t),Ut(n,t)}function ze(n,t,e=!0){let i=()=>{};t.valueAccessor&&(t.valueAccessor.registerOnChange(i),t.valueAccessor.registerOnTouched(i)),oe(n,t),n&&(t._invokeOnDestroyCallbacks(),n._registerOnCollectionChange(()=>{}))}function re(n,t){n.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(t)})}function Ut(n,t){if(t.valueAccessor.setDisabledState){let e=i=>{t.valueAccessor.setDisabledState(i)};n.registerOnDisabledChange(e),t._registerOnDestroy(()=>{n._unregisterOnDisabledChange(e)})}}function we(n,t){let e=dt(n);t.validator!==null?n.setValidators($e(e,t.validator)):typeof e=="function"&&n.setValidators([e]);let i=ht(n);t.asyncValidator!==null?n.setAsyncValidators($e(i,t.asyncValidator)):typeof i=="function"&&n.setAsyncValidators([i]);let r=()=>n.updateValueAndValidity();re(t._rawValidators,r),re(t._rawAsyncValidators,r)}function oe(n,t){let e=!1;if(n!==null){if(t.validator!==null){let r=dt(n);if(Array.isArray(r)&&r.length>0){let o=r.filter(s=>s!==t.validator);o.length!==r.length&&(e=!0,n.setValidators(o))}}if(t.asyncValidator!==null){let r=ht(n);if(Array.isArray(r)&&r.length>0){let o=r.filter(s=>s!==t.asyncValidator);o.length!==r.length&&(e=!0,n.setAsyncValidators(o))}}}let i=()=>{};return re(t._rawValidators,i),re(t._rawAsyncValidators,i),e}function Bt(n,t){t.valueAccessor.registerOnChange(e=>{n._pendingValue=e,n._pendingChange=!0,n._pendingDirty=!0,n.updateOn==="change"&>(n,t)})}function Ht(n,t){t.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,n.updateOn==="blur"&&n._pendingChange&>(n,t),n.updateOn!=="submit"&&n.markAsTouched()})}function gt(n,t){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function Lt(n,t){let e=(i,r)=>{t.valueAccessor.writeValue(i),r&&t.viewToModelUpdate(i)};n.registerOnChange(e),t._registerOnDestroy(()=>{n._unregisterOnChange(e)})}function mt(n,t){n==null,we(n,t)}function $t(n,t){return oe(n,t)}function Wt(n,t){if(!n.hasOwnProperty("model"))return!1;let e=n.model;return e.isFirstChange()?!0:!Object.is(t,e.currentValue)}function qt(n){return Object.getPrototypeOf(n.constructor)===E}function vt(n,t){n._syncPendingControls(),t.forEach(e=>{let i=e.control;i.updateOn==="submit"&&i._pendingChange&&(e.viewToModelUpdate(i._pendingValue),i._pendingChange=!1)})}function zt(n,t){if(!t)return null;Array.isArray(t);let e,i,r;return t.forEach(o=>{o.constructor===Qe?e=o:qt(o)?i=o:r=o}),r||i||e||null}function Jt(n,t){let e=n.indexOf(t);e>-1&&n.splice(e,1)}var Zt={provide:M,useExisting:c(()=>Xt)},B=Promise.resolve(),Xt=(()=>{class n extends M{callSetDisabledState;get submitted(){return y(this.submittedReactive)}_submitted=b(()=>this.submittedReactive());submittedReactive=C(!1);_directives=new Set;form;ngSubmit=new x;options;constructor(e,i,r){super(),this.callSetDisabledState=r,this.form=new ne({},Me(e),Ee(i))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(e){B.then(()=>{let i=this._findContainer(e.path);e.control=i.registerControl(e.name,e.control),ie(e.control,e,this.callSetDisabledState),e.control.updateValueAndValidity({emitEvent:!1}),this._directives.add(e)})}getControl(e){return this.form.get(e.path)}removeControl(e){B.then(()=>{let i=this._findContainer(e.path);i&&i.removeControl(e.name),this._directives.delete(e)})}addFormGroup(e){B.then(()=>{let i=this._findContainer(e.path),r=new ne({});mt(r,e),i.registerControl(e.name,r),r.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(e){B.then(()=>{let i=this._findContainer(e.path);i&&i.removeControl(e.name)})}getFormGroup(e){return this.form.get(e.path)}updateModel(e,i){B.then(()=>{this.form.get(e.path).setValue(i)})}setValue(e){this.control.setValue(e)}onSubmit(e){return this.submittedReactive.set(!0),vt(this.form,this._directives),this.ngSubmit.emit(e),this.form._events.next(new Q(this.control)),e?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(e=void 0){this.form.reset(e),this.submittedReactive.set(!1)}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.form._updateOn=this.options.updateOn)}_findContainer(e){return e.pop(),e.length?this.form.get(e):this.form}static \u0275fac=function(i){return new(i||n)(a(w,10),a(Ae,10),a($,8))};static \u0275dir=l({type:n,selectors:[["form",3,"ngNoForm","",3,"formGroup",""],["ng-form"],["","ngForm",""]],hostBindings:function(i,r){i&1&&_("submit",function(s){return r.onSubmit(s)})("reset",function(){return r.onReset()})},inputs:{options:[0,"ngFormOptions","options"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[d([Zt]),u]})}return n})();function Je(n,t){let e=n.indexOf(t);e>-1&&n.splice(e,1)}function Ze(n){return typeof n=="object"&&n!==null&&Object.keys(n).length===2&&"value"in n&&"disabled"in n}var _t=class extends te{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(t=null,e,i){super(ft(e),pt(i,e)),this._applyFormState(t),this._setUpdateStrategy(e),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),se(e)&&(e.nonNullable||e.initialValueIsDefault)&&(Ze(t)?this.defaultValue=t.value:this.defaultValue=t)}setValue(t,e={}){this.value=this._pendingValue=t,this._onChange.length&&e.emitModelToViewChange!==!1&&this._onChange.forEach(i=>i(this.value,e.emitViewToModelChange!==!1)),this.updateValueAndValidity(e)}patchValue(t,e={}){this.setValue(t,e)}reset(t=this.defaultValue,e={}){this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this.value,e),this._pendingChange=!1,e?.emitEvent!==!1&&this._events.next(new ee(this))}_updateValue(){}_anyControls(t){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(t){this._onChange.push(t)}_unregisterOnChange(t){Je(this._onChange,t)}registerOnDisabledChange(t){this._onDisabledChange.push(t)}_unregisterOnDisabledChange(t){Je(this._onDisabledChange,t)}_forEachChild(t){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(t){Ze(t)?(this.value=this._pendingValue=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=t}};var Yt=n=>n instanceof _t;var Kt={provide:R,useExisting:c(()=>Qt)},Xe=Promise.resolve(),Qt=(()=>{class n extends R{_changeDetectorRef;callSetDisabledState;control=new _t;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new x;constructor(e,i,r,o,s,f){super(),this._changeDetectorRef=s,this.callSetDisabledState=f,this._parent=e,this._setValidators(i),this._setAsyncValidators(r),this.valueAccessor=zt(this,o)}ngOnChanges(e){if(this._checkForErrors(),!this._registered||"name"in e){if(this._registered&&(this._checkName(),this.formDirective)){let i=e.name.previousValue;this.formDirective.removeControl({name:i,path:this._getPath(i)})}this._setUpControl()}"isDisabled"in e&&this._updateDisabled(e),Wt(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){ie(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._checkName()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(e){Xe.then(()=>{this.control.setValue(e,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(e){let i=e.isDisabled.currentValue,r=i!==0&&_e(i);Xe.then(()=>{r&&!this.control.disabled?this.control.disable():!r&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(e){return this._parent?Gt(e,this._parent):[e]}static \u0275fac=function(i){return new(i||n)(a(M,9),a(w,10),a(Ae,10),a(D,10),a(ve,8),a($,8))};static \u0275dir=l({type:n,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:!1,features:[d([Kt]),u,q]})}return n})();var en={provide:D,useExisting:c(()=>tn),multi:!0},tn=(()=>{class n extends E{writeValue(e){let i=e??"";this.setProperty("value",i)}registerOnChange(e){this.onChange=i=>{e(i==""?null:parseFloat(i))}}static \u0275fac=(()=>{let e;return function(r){return(e||(e=v(n)))(r||n)}})();static \u0275dir=l({type:n,selectors:[["input","type","number","formControlName",""],["input","type","number","formControl",""],["input","type","number","ngModel",""]],hostBindings:function(i,r){i&1&&_("input",function(s){return r.onChange(s.target.value)})("blur",function(){return r.onTouched()})},standalone:!1,features:[d([en]),u]})}return n})(),nn={provide:D,useExisting:c(()=>on),multi:!0};var rn=(()=>{class n{_accessors=[];add(e,i){this._accessors.push([e,i])}remove(e){for(let i=this._accessors.length-1;i>=0;--i)if(this._accessors[i][1]===e){this._accessors.splice(i,1);return}}select(e){this._accessors.forEach(i=>{this._isSameGroup(i,e)&&i[1]!==e&&i[1].fireUncheck(e.value)})}_isSameGroup(e,i){return e[0].control?e[0]._parent===i._control._parent&&e[1].name===i.name:!1}static \u0275fac=function(i){return new(i||n)};static \u0275prov=F({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),on=(()=>{class n extends E{_registry;_injector;_state;_control;_fn;setDisabledStateFired=!1;onChange=()=>{};name;formControlName;value;callSetDisabledState=g($,{optional:!0})??ae;constructor(e,i,r,o){super(e,i),this._registry=r,this._injector=o}ngOnInit(){this._control=this._injector.get(R),this._checkName(),this._registry.add(this._control,this)}ngOnDestroy(){this._registry.remove(this)}writeValue(e){this._state=e===this.value,this.setProperty("checked",this._state)}registerOnChange(e){this._fn=e,this.onChange=()=>{e(this.value),this._registry.select(this)}}setDisabledState(e){(this.setDisabledStateFired||e||this.callSetDisabledState==="whenDisabledForLegacyCode")&&this.setProperty("disabled",e),this.setDisabledStateFired=!0}fireUncheck(e){this.writeValue(e)}_checkName(){this.name&&this.formControlName&&(this.name,this.formControlName),!this.name&&this.formControlName&&(this.name=this.formControlName)}static \u0275fac=function(i){return new(i||n)(a(O),a(j),a(rn),a(ge))};static \u0275dir=l({type:n,selectors:[["input","type","radio","formControlName",""],["input","type","radio","formControl",""],["input","type","radio","ngModel",""]],hostBindings:function(i,r){i&1&&_("change",function(){return r.onChange()})("blur",function(){return r.onTouched()})},inputs:{name:"name",formControlName:"formControlName",value:"value"},standalone:!1,features:[d([nn]),u]})}return n})(),sn={provide:D,useExisting:c(()=>an),multi:!0},an=(()=>{class n extends E{writeValue(e){this.setProperty("value",parseFloat(e))}registerOnChange(e){this.onChange=i=>{e(i==""?null:parseFloat(i))}}static \u0275fac=(()=>{let e;return function(r){return(e||(e=v(n)))(r||n)}})();static \u0275dir=l({type:n,selectors:[["input","type","range","formControlName",""],["input","type","range","formControl",""],["input","type","range","ngModel",""]],hostBindings:function(i,r){i&1&&_("change",function(s){return r.onChange(s.target.value)})("input",function(s){return r.onChange(s.target.value)})("blur",function(){return r.onTouched()})},standalone:!1,features:[d([sn]),u]})}return n})();var ln={provide:M,useExisting:c(()=>un)},un=(()=>{class n extends M{callSetDisabledState;get submitted(){return y(this._submittedReactive)}set submitted(e){this._submittedReactive.set(e)}_submitted=b(()=>this._submittedReactive());_submittedReactive=C(!1);_oldForm;_onCollectionChange=()=>this._updateDomValue();directives=[];form=null;ngSubmit=new x;constructor(e,i,r){super(),this.callSetDisabledState=r,this._setValidators(e),this._setAsyncValidators(i)}ngOnChanges(e){e.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(oe(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(e){let i=this.form.get(e.path);return ie(i,e,this.callSetDisabledState),i.updateValueAndValidity({emitEvent:!1}),this.directives.push(e),i}getControl(e){return this.form.get(e.path)}removeControl(e){ze(e.control||null,e,!1),Jt(this.directives,e)}addFormGroup(e){this._setUpFormContainer(e)}removeFormGroup(e){this._cleanUpFormContainer(e)}getFormGroup(e){return this.form.get(e.path)}addFormArray(e){this._setUpFormContainer(e)}removeFormArray(e){this._cleanUpFormContainer(e)}getFormArray(e){return this.form.get(e.path)}updateModel(e,i){this.form.get(e.path).setValue(i)}onSubmit(e){return this._submittedReactive.set(!0),vt(this.form,this.directives),this.ngSubmit.emit(e),this.form._events.next(new Q(this.control)),e?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(e=void 0,i={}){this.form.reset(e,i),this._submittedReactive.set(!1)}_updateDomValue(){this.directives.forEach(e=>{let i=e.control,r=this.form.get(e.path);i!==r&&(ze(i||null,e),Yt(r)&&(ie(r,e,this.callSetDisabledState),e.control=r))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(e){let i=this.form.get(e.path);mt(i,e),i.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(e){if(this.form){let i=this.form.get(e.path);i&&$t(i,e)&&i.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){we(this.form,this),this._oldForm&&oe(this._oldForm,this)}static \u0275fac=function(i){return new(i||n)(a(w,10),a(Ae,10),a($,8))};static \u0275dir=l({type:n,selectors:[["","formGroup",""]],hostBindings:function(i,r){i&1&&_("submit",function(s){return r.onSubmit(s)})("reset",function(){return r.onReset()})},inputs:{form:[0,"formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[d([ln]),u,q]})}return n})();var cn={provide:D,useExisting:c(()=>Ct),multi:!0};function yt(n,t){return n==null?`${t}`:(t&&typeof t=="object"&&(t="Object"),`${n}: ${t}`.slice(0,50))}function dn(n){return n.split(":")[0]}var Ct=(()=>{class n extends E{value;_optionMap=new Map;_idCounter=0;set compareWith(e){this._compareWith=e}_compareWith=Object.is;appRefInjector=g(Te).injector;destroyRef=g(S);cdr=g(ve);_queuedWrite=!1;_writeValueAfterRender(){this._queuedWrite||this.appRefInjector.destroyed||(this._queuedWrite=!0,Re({write:()=>{this.destroyRef.destroyed||(this._queuedWrite=!1,this.writeValue(this.value))}},{injector:this.appRefInjector}))}writeValue(e){this.cdr.markForCheck(),this.value=e;let i=this._getOptionId(e),r=yt(i,e);this.setProperty("value",r)}registerOnChange(e){this.onChange=i=>{this.value=this._getOptionValue(i),e(this.value)}}_registerOption(){return(this._idCounter++).toString()}_getOptionId(e){for(let i of this._optionMap.keys())if(this._compareWith(this._optionMap.get(i),e))return i;return null}_getOptionValue(e){let i=dn(e);return this._optionMap.has(i)?this._optionMap.get(i):e}static \u0275fac=(()=>{let e;return function(r){return(e||(e=v(n)))(r||n)}})();static \u0275dir=l({type:n,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(i,r){i&1&&_("change",function(s){return r.onChange(s.target.value)})("blur",function(){return r.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[d([cn]),u]})}return n})(),ti=(()=>{class n{_element;_renderer;_select;id;constructor(e,i,r){this._element=e,this._renderer=i,this._select=r,this._select&&(this.id=this._select._registerOption())}set ngValue(e){this._select!=null&&(this._select._optionMap.set(this.id,e),this._setElementValue(yt(this.id,e)),this._select._writeValueAfterRender())}set value(e){this._setElementValue(e),this._select&&this._select._writeValueAfterRender()}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select._writeValueAfterRender())}static \u0275fac=function(i){return new(i||n)(a(j),a(O),a(Ct,9))};static \u0275dir=l({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return n})(),hn={provide:D,useExisting:c(()=>bt),multi:!0};function Ye(n,t){return n==null?`${t}`:(typeof t=="string"&&(t=`'${t}'`),t&&typeof t=="object"&&(t="Object"),`${n}: ${t}`.slice(0,50))}function fn(n){return n.split(":")[0]}var bt=(()=>{class n extends E{value;_optionMap=new Map;_idCounter=0;set compareWith(e){this._compareWith=e}_compareWith=Object.is;writeValue(e){this.value=e;let i;if(Array.isArray(e)){let r=e.map(o=>this._getOptionId(o));i=(o,s)=>{o._setSelected(r.indexOf(s.toString())>-1)}}else i=(r,o)=>{r._setSelected(!1)};this._optionMap.forEach(i)}registerOnChange(e){this.onChange=i=>{let r=[],o=i.selectedOptions;if(o!==void 0){let s=o;for(let f=0;f<s.length;f++){let p=s[f],ue=this._getOptionValue(p.value);r.push(ue)}}else{let s=i.options;for(let f=0;f<s.length;f++){let p=s[f];if(p.selected){let ue=this._getOptionValue(p.value);r.push(ue)}}}this.value=r,e(r)}}_registerOption(e){let i=(this._idCounter++).toString();return this._optionMap.set(i,e),i}_getOptionId(e){for(let i of this._optionMap.keys())if(this._compareWith(this._optionMap.get(i)._value,e))return i;return null}_getOptionValue(e){let i=fn(e);return this._optionMap.has(i)?this._optionMap.get(i)._value:e}static \u0275fac=(()=>{let e;return function(r){return(e||(e=v(n)))(r||n)}})();static \u0275dir=l({type:n,selectors:[["select","multiple","","formControlName",""],["select","multiple","","formControl",""],["select","multiple","","ngModel",""]],hostBindings:function(i,r){i&1&&_("change",function(s){return r.onChange(s.target)})("blur",function(){return r.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[d([hn]),u]})}return n})(),ni=(()=>{class n{_element;_renderer;_select;id;_value;constructor(e,i,r){this._element=e,this._renderer=i,this._select=r,this._select&&(this.id=this._select._registerOption(this))}set ngValue(e){this._select!=null&&(this._value=e,this._setElementValue(Ye(this.id,e)),this._select.writeValue(this._select.value))}set value(e){this._select?(this._value=e,this._setElementValue(Ye(this.id,e)),this._select.writeValue(this._select.value)):this._setElementValue(e)}_setElementValue(e){this._renderer.setProperty(this._element.nativeElement,"value",e)}_setSelected(e){this._renderer.setProperty(this._element.nativeElement,"selected",e)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}static \u0275fac=function(i){return new(i||n)(a(j),a(O),a(bt,9))};static \u0275dir=l({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return n})();function pn(n){return typeof n=="number"?n:parseInt(n,10)}function Vt(n){return typeof n=="number"?n:parseFloat(n)}var le=(()=>{class n{_validator=Z;_onChange;_enabled;ngOnChanges(e){if(this.inputName in e){let i=this.normalizeInput(e[this.inputName].currentValue);this._enabled=this.enabled(i),this._validator=this._enabled?this.createValidator(i):Z,this._onChange&&this._onChange()}}validate(e){return this._validator(e)}registerOnValidatorChange(e){this._onChange=e}enabled(e){return e!=null}static \u0275fac=function(i){return new(i||n)};static \u0275dir=l({type:n,features:[q]})}return n})(),gn={provide:w,useExisting:c(()=>mn),multi:!0},mn=(()=>{class n extends le{max;inputName="max";normalizeInput=e=>Vt(e);createValidator=e=>tt(e);static \u0275fac=(()=>{let e;return function(r){return(e||(e=v(n)))(r||n)}})();static \u0275dir=l({type:n,selectors:[["input","type","number","max","","formControlName",""],["input","type","number","max","","formControl",""],["input","type","number","max","","ngModel",""]],hostVars:1,hostBindings:function(i,r){i&2&&T("max",r._enabled?r.max:null)},inputs:{max:"max"},standalone:!1,features:[d([gn]),u]})}return n})(),vn={provide:w,useExisting:c(()=>_n),multi:!0},_n=(()=>{class n extends le{min;inputName="min";normalizeInput=e=>Vt(e);createValidator=e=>et(e);static \u0275fac=(()=>{let e;return function(r){return(e||(e=v(n)))(r||n)}})();static \u0275dir=l({type:n,selectors:[["input","type","number","min","","formControlName",""],["input","type","number","min","","formControl",""],["input","type","number","min","","ngModel",""]],hostVars:1,hostBindings:function(i,r){i&2&&T("min",r._enabled?r.min:null)},inputs:{min:"min"},standalone:!1,features:[d([vn]),u]})}return n})(),yn={provide:w,useExisting:c(()=>Cn),multi:!0};var Cn=(()=>{class n extends le{required;inputName="required";normalizeInput=_e;createValidator=e=>nt;enabled(e){return e}static \u0275fac=(()=>{let e;return function(r){return(e||(e=v(n)))(r||n)}})();static \u0275dir=l({type:n,selectors:[["","required","","formControlName","",3,"type","checkbox"],["","required","","formControl","",3,"type","checkbox"],["","required","","ngModel","",3,"type","checkbox"]],hostVars:1,hostBindings:function(i,r){i&2&&T("required",r._enabled?"":null)},inputs:{required:"required"},standalone:!1,features:[d([yn]),u]})}return n})();var bn={provide:w,useExisting:c(()=>Vn),multi:!0},Vn=(()=>{class n extends le{maxlength;inputName="maxlength";normalizeInput=e=>pn(e);createValidator=e=>it(e);static \u0275fac=(()=>{let e;return function(r){return(e||(e=v(n)))(r||n)}})();static \u0275dir=l({type:n,selectors:[["","maxlength","","formControlName",""],["","maxlength","","formControl",""],["","maxlength","","ngModel",""]],hostVars:1,hostBindings:function(i,r){i&2&&T("maxlength",r._enabled?r.maxlength:null)},inputs:{maxlength:"maxlength"},standalone:!1,features:[d([bn]),u]})}return n})();var Dn=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=me({type:n});static \u0275inj=pe({})}return n})();var ii=(()=>{class n{static withConfig(e){return{ngModule:n,providers:[{provide:$,useValue:e.callSetDisabledState??ae}]}}static \u0275fac=function(i){return new(i||n)};static \u0275mod=me({type:n});static \u0275inj=pe({imports:[Dn]})}return n})();function _i(n){n||(n=g(S));let t=new Ie(e=>{if(n.destroyed){e.next();return}return n.onDestroy(e.next.bind(e))});return e=>e.pipe(Ne(t))}function yi(n,t){let i=!t?.manualCleanup?t?.injector?.get(S)??g(S):null,r=An(t?.equal),o;t?.requireSync?o=C({kind:0},{equal:r}):o=C({kind:1,value:t?.initialValue},{equal:r});let s,f=n.subscribe({next:p=>o.set({kind:1,value:p}),error:p=>{o.set({kind:2,error:p}),s?.()},complete:()=>{s?.()}});if(t?.requireSync&&o().kind===0)throw new A(601,!1);return s=i?.onDestroy(f.unsubscribe.bind(f)),b(()=>{let p=o();switch(p.kind){case 1:return p.value;case 2:throw p.error;case 0:throw new A(601,!1)}},{equal:t?.equal})}function An(n=Object.is){return(t,e)=>t.kind===1&&e.kind===1&&n(t.value,e.value)}export{z as a,He as b,_i as c,yi as d,D as e,At as f,Qe as g,w as h,Le as i,R as j,Qn as k,Xt as l,Qt as m,tn as n,on as o,an as p,un as q,Ct as r,ti as s,ni as t,mn as u,_n as v,Cn as w,Vn as x,ii as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as $,c as z,g as Y,k as V,m as H,r as L,s as J,t as q,y as G}from"./chunk-J577MYXL.js";import{$b as R,Aa as P,Db as p,Fb as c,Jb as _,Na as U,Oa as O,P as k,Pa as y,Qa as T,T as u,Ta as N,Ua as F,Va as v,Wa as o,Xa as n,Ya as B,a as M,b as S,ba as I,db as f,fa as g,fb as b,fc as w,hc as j,mc as A,qa as E,s as D,sa as l,tb as i,ub as m,vb as x}from"./chunk-LU3TJP27.js";var C=class a{http=u(j);getTokenUsage(r){let e=new w;return r.from&&(e=e.set("from",r.from)),r.to&&(e=e.set("to",r.to)),this.http.get("/api/token-usage",{params:e})}getTokenUsageSeries(r){let e=new w;return r.from&&(e=e.set("from",r.from)),r.to&&(e=e.set("to",r.to)),this.http.get("/api/token-usage/series",{params:e})}static \u0275fac=function(e){return new(e||a)};static \u0275prov=k({token:a,factory:a.\u0275fac,providedIn:"root"})};function Q(a){return`${a}`.padStart(2,"0")}function W(a){return`${a.getUTCFullYear()}-${Q(a.getUTCMonth()+1)}-${Q(a.getUTCDate())}`}function Z(a=new Date){return new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),1))}function ee(a=new Date){return new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth()+1,1))}var h=class a{api=u(C);destroyRef=u(I);defaultFrom=W(Z());defaultTo=W(ee());draftFilters=g({from:this.defaultFrom,to:this.defaultTo});appliedFilters=g({from:this.defaultFrom,to:this.defaultTo});loading=g(!1);error=g(null);aggregation=g(null);series=g(null);aggregationByModelId=g(null);seriesByModelId=g(null);init(){this.reload()}setDraftFrom(r){this.draftFilters.update(e=>S(M({},e),{from:r}))}setDraftTo(r){this.draftFilters.update(e=>S(M({},e),{to:r}))}clearDraftFrom(){this.setDraftFrom(null)}clearDraftTo(){this.setDraftTo(null)}apply(){this.appliedFilters.set(this.draftFilters()),this.reload()}aggregateByModelId(r){let e=new Map;for(let t of r){let s=t.modelId,d=e.get(s);d?(d.promptTokens+=t.promptTokens??0,d.completionTokens+=t.completionTokens??0,d.totalTokens+=t.totalTokens??0,d.callCount+=t.callCount??0,d.cost=(d.cost??0)+(t.cost??0)):e.set(s,{modelName:"All agents",providerName:"all",modelId:t.modelId,promptTokens:t.promptTokens??0,completionTokens:t.completionTokens??0,totalTokens:t.totalTokens??0,callCount:t.callCount??0,cost:t.cost??0})}return[...e.values()].sort((t,s)=>(s.totalTokens??0)-(t.totalTokens??0))}aggregateSeriesByModelId(r){let e=new Map;for(let t of r){let s=`${t.date}|${t.modelId}`,d=e.get(s);d?(d.promptTokens+=t.promptTokens??0,d.completionTokens+=t.completionTokens??0,d.totalTokens+=t.totalTokens??0,d.callCount+=t.callCount??0,d.cost=(d.cost??0)+(t.cost??0)):e.set(s,{date:t.date,modelName:"All agents",providerName:"all",modelId:t.modelId,promptTokens:t.promptTokens??0,completionTokens:t.completionTokens??0,totalTokens:t.totalTokens??0,callCount:t.callCount??0,cost:t.cost??0})}return[...e.values()].sort((t,s)=>t.date<s.date?-1:1)}reload(){let{from:r,to:e}=this.appliedFilters();this.loading.set(!0),this.error.set(null),D({aggregation:this.api.getTokenUsage({from:r,to:e}),series:this.api.getTokenUsageSeries({from:r,to:e})}).pipe(z(this.destroyRef)).subscribe({next:({aggregation:t,series:s})=>{this.aggregation.set(t),this.series.set(s);let d=this.aggregateByModelId(t.models??[]);this.aggregationByModelId.set(d),this.seriesByModelId.set(this.aggregateSeriesByModelId(s)),this.loading.set(!1)},error:t=>{this.loading.set(!1),this.aggregation.set(null),this.series.set(null),this.aggregationByModelId.set(null),this.seriesByModelId.set(null),this.error.set(t instanceof Error?t.message:"Failed to load token usage")}})}static \u0275fac=function(e){return new(e||a)};static \u0275prov=k({token:a,factory:a.\u0275fac,providedIn:"root"})};function te(a,r){if(a&1&&(o(0,"div",17)(1,"div",21)(2,"div",22),i(3,"Total tokens"),n(),o(4,"div",23),i(5),p(6,"number"),n()(),o(7,"div",21)(8,"div",22),i(9,"Total calls"),n(),o(10,"div",23),i(11),n()(),o(12,"div",21)(13,"div",22),i(14,"Total cost"),n(),o(15,"div",23),i(16),p(17,"number"),n()()()),a&2){let e=b();l(5),m(c(6,3,e.totalRow().totalTokens,"1.0-2")),l(6),m(e.totalRow().callCount),l(5),x("$",c(17,6,e.totalCost(),"1.2-2"))}}function oe(a,r){a&1&&(o(0,"div",18)(1,"div",24),i(2,"Loading token usage\u2026"),n()())}function ne(a,r){if(a&1&&(o(0,"div",19)(1,"div",25),i(2,"Failed to load"),n(),o(3,"div",24),i(4),n()()),a&2){let e=b();l(4),m(e.state.error())}}function ie(a,r){a&1&&(o(0,"div",18)(1,"div",25),i(2,"No data"),n(),o(3,"div",24),i(4,"No token usage recorded yet for this period."),n()())}function re(a,r){if(a&1&&(o(0,"div",31)(1,"div",28),i(2),n(),o(3,"div",28),i(4),n(),o(5,"div",28),i(6),n(),o(7,"div",29),i(8),p(9,"number"),n(),o(10,"div",29),i(11),p(12,"number"),n(),o(13,"div",29),i(14),p(15,"number"),n(),o(16,"div",29),i(17),n(),o(18,"div",29),i(19),p(20,"number"),n()()),a&2){let e=r.$implicit;l(2),m(e.modelName),l(2),m(e.providerName),l(2),m(e.modelId),l(2),m(c(9,8,e.promptTokens,"1.0-2")),l(3),m(c(12,11,e.completionTokens,"1.0-2")),l(3),m(c(15,14,e.totalTokens,"1.0-2")),l(3),m(e.callCount),l(2),x("$",c(20,17,e.cost??0,"1.2-2"))}}function ae(a,r){if(a&1&&(o(0,"div",32)(1,"div",28),i(2),n(),o(3,"div",28),i(4),n(),o(5,"div",28),i(6),n(),o(7,"div",29),i(8),p(9,"number"),n(),o(10,"div",29),i(11),p(12,"number"),n(),o(13,"div",29),i(14),p(15,"number"),n(),o(16,"div",29),i(17),n(),o(18,"div",29),i(19),p(20,"number"),n()()),a&2){let e=b(2);l(2),m(e.totalRow().modelName),l(2),m(e.totalRow().providerName),l(2),m(e.totalRow().modelId),l(2),m(c(9,8,e.totalRow().promptTokens,"1.0-2")),l(3),m(c(12,11,e.totalRow().completionTokens,"1.0-2")),l(3),m(c(15,14,e.totalRow().totalTokens,"1.0-2")),l(3),m(e.totalRow().callCount),l(2),x("$",c(20,17,e.totalRow().cost??0,"1.2-2"))}}function le(a,r){if(a&1&&(o(0,"div",20)(1,"section",18)(2,"div",25),i(3,"Summary"),n(),o(4,"div",26)(5,"div",27)(6,"div",28),i(7,"modelName"),n(),o(8,"div",28),i(9,"providerName"),n(),o(10,"div",28),i(11,"modelId"),n(),o(12,"div",29),i(13,"promptTokens"),n(),o(14,"div",29),i(15,"completionTokens"),n(),o(16,"div",29),i(17,"totalTokens"),n(),o(18,"div",29),i(19,"callCount"),n(),o(20,"div",29),i(21,"cost"),n()(),o(22,"div",30),N(23,re,21,20,"div",31,O().trackRow,!0),y(25,ae,21,20,"div",32),n()()(),o(26,"section",18)(27,"div",25),i(28,"Daily series"),n(),o(29,"div",24),i(30),n()()()),a&2){let e,t=b();l(23),F(t.rows()),l(2),T(t.totalRow()?25:-1),l(5),x(" Chart coming soon. (Series is already fetched: ",((e=t.state.series())==null?null:e.length)??0," points.) ")}}var X=class a{router=u(A);projectState=u($);state=u(h);view=g("byModel");rowsByAgent=_(()=>this.state.aggregation()?.models??[]);totalRow=_(()=>this.state.aggregation()?.total??null);rowsByModel=_(()=>this.state.aggregationByModelId()??[]);rows=_(()=>this.view()==="byAgent"?this.rowsByAgent():this.rowsByModel());isEmpty=_(()=>{let r=this.state.aggregation();return r?(r.models?.length??0)===0&&(r.total?.callCount??0)===0:!1});totalCost=_(()=>this.totalRow()?.cost??0);ngOnInit(){this.state.init()}onFromChange(r){this.state.setDraftFrom(r||null)}onToChange(r){this.state.setDraftTo(r||null)}clearFrom(){this.state.clearDraftFrom()}clearTo(){this.state.clearDraftTo()}apply(){this.state.apply()}trackRow(r,e){return`${e.modelName}|${e.providerName}|${e.modelId}`}navigateBackToProject(){let r=this.projectState.getSelectedProjectId();if(r){this.router.navigate(["project",r]);return}this.router.navigate(["/"])}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=P({type:a,selectors:[["app-token-usage"]],decls:40,vars:9,consts:[[1,"page"],[1,"page__header"],[1,"page__title-block"],["type","button","title","Back to project",1,"page__logo-btn",3,"click"],["alt","Coday",1,"page__logo"],[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,"kpis"],[1,"card"],[1,"card","card--error"],[1,"grid"],[1,"kpi"],[1,"kpi__label"],[1,"kpi__value"],[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"]],template:function(e,t){e&1&&(o(0,"section",0)(1,"header",1)(2,"div",2)(3,"button",3),f("click",function(){return t.navigateBackToProject()}),B(4,"img",4),n(),o(5,"div")(6,"h1",5),i(7,"Token Usage"),n(),o(8,"p",6),i(9,"Track prompt and completion token usage by agent and model."),n()()(),o(10,"div",7)(11,"label",8)(12,"span",9),i(13,"From"),n(),o(14,"div",10)(15,"input",11),f("ngModelChange",function(d){return t.onFromChange(d)}),n(),o(16,"button",12),f("click",function(){return t.clearFrom()}),i(17," Clear "),n()()(),o(18,"label",8)(19,"span",9),i(20,"To"),n(),o(21,"div",10)(22,"input",11),f("ngModelChange",function(d){return t.onToChange(d)}),n(),o(23,"button",12),f("click",function(){return t.clearTo()}),i(24," Clear "),n()()(),o(25,"label",8)(26,"span",9),i(27,"View"),n(),o(28,"select",13),f("ngModelChange",function(d){return t.view.set(d)}),o(29,"option",14),i(30,"By model"),n(),o(31,"option",15),i(32,"By agent"),n()()(),o(33,"button",16),f("click",function(){return t.apply()}),i(34,"Apply"),n()()(),y(35,te,18,9,"div",17),y(36,oe,3,0,"div",18)(37,ne,5,1,"div",19)(38,ie,5,0,"div",18)(39,le,31,2,"div",20),n()),e&2&&(l(4),U("src","CODAY-Logo.png",E),l(11),v("ngModel",t.state.draftFilters().from),l(),v("disabled",!t.state.draftFilters().from),l(6),v("ngModel",t.state.draftFilters().to),l(),v("disabled",!t.state.draftFilters().to),l(5),v("ngModel",t.view()),l(5),v("disabled",t.state.loading()),l(2),T(t.totalRow()?35:-1),l(),T(t.state.loading()?36:t.state.error()?37:t.isEmpty()?38:39))},dependencies:[G,J,q,Y,L,V,H,R],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__logo-btn[_ngcontent-%COMP%]{flex:0 0 auto;width:40px;height:40px;padding:0;border-radius:12px;border:1px solid var(--glass-border, rgba(255, 255, 255, .18));background:var(--glass-bg, rgba(255, 255, 255, .72));box-shadow:var(--glass-shadow, 0 8px 24px rgba(0, 0, 0, .08));cursor:pointer}.page__logo-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .03))}.page__logo[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:contain;padding:6px}.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}@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}"]})};export{X as TokenUsageComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as L}from"./chunk-TYN7G4PU.js";import{a as D}from"./chunk-HV577N5Z.js";import{Aa as M,Ia as S,Jb as V,Kb as F,Na as w,Pa as m,Qa as u,T as x,Ta as k,Ua as O,Va as E,Wa as s,X as h,Xa as l,Y as g,Ya as I,bb as b,db as f,fa as v,fb as _,hc as q,jb as P,kb as R,kc as z,lb as N,rb as T,sa as c,tb as d,ub as C}from"./chunk-LU3TJP27.js";var A=["composerInput"],K=(n,t)=>t.kind==="message"?t.event.id:t.call.requestId;function Q(n,t){n&1&&(s(0,"div",3)(1,"p"),d(2,"No messages yet."),l()())}function j(n,t){if(n&1&&(s(0,"div",13)(1,"span",14),d(2),l(),s(3,"p",15),d(4),l()()),n&2){let e=_().$implicit,o=_(2);T("case-chat__message--user",e.event.actor.role==="USER")("case-chat__message--agent",e.event.actor.role==="AGENT"),c(2),C(e.event.actor.displayName),c(2),C(o.extractText(e.event))}}function B(n,t){n&1&&d(0," \u23F3 ")}function H(n,t){n&1&&d(0," \u2705 ")}function G(n,t){n&1&&d(0," \u274C ")}function U(n,t){if(n&1&&(s(0,"div",22)(1,"span",23),d(2,"Payload"),l(),s(3,"pre"),d(4),l()()),n&2){let e=_(3).$implicit;c(4),C(e.call.args)}}function Y(n,t){n&1&&(s(0,"pre"),d(1),l()),n&2&&(c(),C(t))}function J(n,t){n&1&&(s(0,"span",24),d(1,"Running\u2026"),l())}function Z(n,t){n&1&&(s(0,"span",25),d(1,"No output"),l())}function W(n,t){if(n&1&&(s(0,"div",21),m(1,U,5,1,"div",22),s(2,"div",22)(3,"span",23),d(4,"Output"),l(),m(5,Y,2,1,"pre")(6,J,2,0,"span",24)(7,Z,2,0,"span",25),l()()),n&2){let e,o=_(2).$implicit,i=_(2);c(),u(o.call.args?1:-1),c(4),u((e=i.extractToolOutput(o.call))?5:o.call.response?7:6,e)}}function X(n,t){if(n&1){let e=b();s(0,"div",16)(1,"button",17),f("click",function(){h(e);let i=_().$implicit,a=_(2);return g(a.toggleToolCall(i.call.requestId))}),s(2,"span",18),m(3,B,1,0)(4,H,1,0)(5,G,1,0),l(),s(6,"span",19),d(7),l(),s(8,"span",20),d(9),l()(),m(10,W,8,2,"div",21),l()}if(n&2){let e=_().$implicit,o=_(2);T("case-chat__tool-call--pending",!e.call.response)("case-chat__tool-call--success",(e.call.response==null?null:e.call.response.success)===!0)("case-chat__tool-call--error",(e.call.response==null?null:e.call.response.success)===!1),c(),w("aria-expanded",o.isToolCallExpanded(e.call.requestId)),c(2),u(e.call.response?e.call.response.success?4:5:3),c(4),C(e.call.toolName),c(2),C(o.isToolCallExpanded(e.call.requestId)?"\u25BC":"\u25B6"),c(),u(o.isToolCallExpanded(e.call.requestId)?10:-1)}}function ee(n,t){if(n&1&&m(0,j,5,6,"div",11)(1,X,11,11,"div",12),n&2){let e=t.$implicit;u(e.kind==="message"?0:1)}}function te(n,t){if(n&1&&k(0,ee,2,1,null,null,K),n&2){let e=_();O(e.timeline())}}function ne(n,t){n&1&&(s(0,"div",4),I(1,"span",26)(2,"span",26)(3,"span",26),l())}function oe(n,t){if(n&1){let e=b();s(0,"ds-icon-button",27),f("action",function(){h(e);let i=_();return g(i.interrupt())}),l()}}function ae(n,t){if(n&1){let e=b();s(0,"ds-icon-button",28),f("action",function(){h(e);let i=_();return g(i.submit())}),l()}if(n&2){let e=_();E("disabled",!e.canSend)}}var $=class n{route=x(z);http=x(q);zone=x(S);config=x(D);caseId=this.route.snapshot.params.caseId;namespaceId=this.route.snapshot.params.namespaceId;eventSource=null;composerInput;events=v([]);inputValue=v("");isRunning=v(!1);isTerminal=v(!1);collapsedTools=v(new Set);constructor(){F(()=>{this.isRunning()||this.isTerminal()||queueMicrotask(()=>this.composerInput?.nativeElement.focus())})}timeline=V(()=>{let t=this.events(),e=new Map;for(let a of t)if(a.type==="ToolRequestEvent"){let r=a,p=r.toolRequestId??a.id,y=e.get(p);e.set(p,{requestId:p,toolName:r.toolName??"unknown",args:r.args??null,response:y?.response})}else if(a.type==="ToolResponseEvent"){let r=a,p=r.toolRequestId??a.id,y=e.get(p);e.set(p,{requestId:p,toolName:y?.toolName??r.toolName??"unknown",args:y?.args??null,response:r})}let o=[],i=new Set;for(let a of t)if(a.type==="MessageEvent")o.push({kind:"message",event:a});else if(a.type==="ToolRequestEvent"||a.type==="ToolResponseEvent"){let p=a.toolRequestId??a.id;i.has(p)||(i.add(p),o.push({kind:"tool",call:e.get(p)}))}return o});get canSend(){return!!this.inputValue().trim()&&!this.isRunning()&&!this.isTerminal()}ngOnInit(){this.connectSse()}ngOnDestroy(){this.eventSource?.close()}connectSse(){let t=`${this.config.basePath}/api/cases/${this.caseId}/events`;this.eventSource=this.zone.runOutsideAngular(()=>new EventSource(t));let e=o=>{try{let i=JSON.parse(o.data);this.zone.run(()=>{if(this.events.update(a=>a.some(r=>r.id===i.id)?a:[...a,i]),i.type==="CaseStatusEvent"){let a=i.status,r=a==="KILLED"||a==="ERROR";this.isTerminal.set(r),r?(this.isRunning.set(!1),this.eventSource?.close(),this.eventSource=null):this.isRunning.set(a==="RUNNING");return}if(i.type==="AgentFinishedEvent"){this.isRunning.set(!1);return}})}catch{console.warn("[CaseChat] Failed to parse SSE event",o.data)}};this.eventSource.addEventListener("MessageEvent",e),this.eventSource.addEventListener("CaseStatusEvent",e),this.eventSource.addEventListener("AgentSelectedEvent",e),this.eventSource.addEventListener("AgentRunningEvent",e),this.eventSource.addEventListener("AgentFinishedEvent",e),this.eventSource.addEventListener("ThinkingEvent",e),this.eventSource.addEventListener("TextChunkEvent",e),this.eventSource.addEventListener("ToolRequestEvent",e),this.eventSource.addEventListener("ToolResponseEvent",e),this.eventSource.onerror=()=>{this.zone.run(()=>{this.isRunning.set(!1)})}}onInput(t){this.inputValue.set(t.target.value)}onKeydown(t){t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),this.submit())}submit(){if(!this.canSend)return;let t=this.inputValue().trim();this.inputValue.set(""),this.isRunning.set(!0),this.http.post(`${this.config.basePath}/api/cases/${this.caseId}/messages`,{content:t,userId:"default-user"}).subscribe({error:e=>{console.error("[CaseChat] Failed to send message",e),this.isRunning.set(!1)}})}interrupt(){this.http.post(`${this.config.basePath}/api/cases/${this.caseId}/interrupt`,{}).subscribe({error:t=>console.error("[CaseChat] Failed to interrupt case",t)})}kill(){this.http.post(`${this.config.basePath}/api/cases/${this.caseId}/kill`,{}).subscribe({error:t=>console.error("[CaseChat] Failed to kill case",t)})}extractText(t){return t.content?.filter(e=>"content"in e).map(e=>e.content).join("")??""}extractToolOutput(t){if(!t.response)return null;let e=t.response.output;return e?e.content??null:null}toggleToolCall(t){this.collapsedTools.update(e=>{let o=new Set(e);return o.has(t)?o.delete(t):o.add(t),o})}isToolCallExpanded(t){return this.collapsedTools().has(t)}_namespaceId=this.namespaceId;static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["agentos-case-chat"]],viewQuery:function(e,o){if(e&1&&P(A,5),e&2){let i;R(i=N())&&(o.composerInput=i.first)}},decls:12,vars:6,consts:[["composerInput",""],[1,"case-chat"],[1,"case-chat__messages"],[1,"case-chat__empty"],[1,"case-chat__thinking"],[1,"case-chat__composer"],["placeholder","Reply\u2026","rows","3",1,"case-chat__input",3,"input","keydown","value","disabled"],[1,"case-chat__actions"],["icon","stop","variant","danger","title","Interrupt"],["icon","send","variant","primary","title","Send (Enter)",3,"disabled"],["icon","trash","variant","danger","title","Kill",3,"action","disabled"],[1,"case-chat__message",3,"case-chat__message--user","case-chat__message--agent"],[1,"case-chat__tool-call",3,"case-chat__tool-call--pending","case-chat__tool-call--success","case-chat__tool-call--error"],[1,"case-chat__message"],[1,"case-chat__message-author"],[1,"case-chat__message-text"],[1,"case-chat__tool-call"],["type","button",1,"case-chat__tool-call-header",3,"click"],[1,"case-chat__tool-call-icon"],[1,"case-chat__tool-call-name"],[1,"case-chat__tool-call-chevron"],[1,"case-chat__tool-call-output"],[1,"case-chat__tool-call-section"],[1,"case-chat__tool-call-label"],[1,"case-chat__tool-call-pending"],[1,"case-chat__tool-call-empty"],[1,"thinking-dot"],["icon","stop","variant","danger","title","Interrupt",3,"action"],["icon","send","variant","primary","title","Send (Enter)",3,"action","disabled"]],template:function(e,o){if(e&1){let i=b();s(0,"div",1)(1,"div",2),m(2,Q,3,0,"div",3)(3,te,2,0),m(4,ne,4,0,"div",4),l(),s(5,"div",5)(6,"textarea",6,0),f("input",function(r){return h(i),g(o.onInput(r))})("keydown",function(r){return h(i),g(o.onKeydown(r))}),l(),s(8,"div",7),m(9,oe,1,0,"ds-icon-button",8)(10,ae,1,1,"ds-icon-button",9),s(11,"ds-icon-button",10),f("action",function(){return h(i),g(o.kill())}),l()()()()}e&2&&(c(2),u(o.timeline().length===0?2:3),c(2),u(o.isRunning()?4:-1),c(2),E("value",o.inputValue())("disabled",o.isRunning()||o.isTerminal()),c(3),u(o.isRunning()?9:10),c(2),E("disabled",o.isTerminal()))},dependencies:[L],styles:['.case-chat[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;max-width:800px;margin:0 auto;padding:1.5rem;gap:1rem}.case-chat__messages[_ngcontent-%COMP%]{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:.75rem;padding-bottom:.5rem}.case-chat__empty[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;flex:1}.case-chat__empty[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.case-chat__tool-calls[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;margin-top:.25rem}.case-chat__tool-call[_ngcontent-%COMP%]{border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--glass-bg, rgba(255, 255, 255, .72));font-size:.8rem;overflow:hidden;transition:border-color .2s ease}.case-chat__tool-call--pending[_ngcontent-%COMP%]{border-color:var(--color-warning, #f5a623);opacity:.8}.case-chat__tool-call--success[_ngcontent-%COMP%]{border-color:var(--color-success, #34c759)}.case-chat__tool-call--error[_ngcontent-%COMP%]{border-color:var(--color-error, #ff3b30)}.case-chat__tool-call-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.4rem;width:100%;padding:.4rem .6rem;background:transparent;border:none;cursor:pointer;text-align:left;color:var(--color-text, #1d1d1f);font-family:inherit;font-size:.8rem}.case-chat__tool-call-header[_ngcontent-%COMP%]:hover{background:#0000000a}.case-chat__tool-call-icon[_ngcontent-%COMP%]{flex-shrink:0;font-size:.75rem}.case-chat__tool-call-name[_ngcontent-%COMP%]{font-weight:600;font-family:var(--font-mono, ui-monospace, "SF Mono", monospace);color:var(--color-primary, #0071e3);flex-shrink:0}.case-chat__tool-call-args[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-family:var(--font-mono, ui-monospace, "SF Mono", monospace);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}.case-chat__tool-call-chevron[_ngcontent-%COMP%]{flex-shrink:0;font-size:.6rem;color:var(--color-text-secondary, #6e6e73);margin-left:auto}.case-chat__tool-call-output[_ngcontent-%COMP%]{border-top:1px solid var(--color-border, rgba(0, 0, 0, .08));display:flex;flex-direction:column}.case-chat__tool-call-section[_ngcontent-%COMP%]{padding:.4rem .6rem .5rem}.case-chat__tool-call-section[_ngcontent-%COMP%] + .case-chat__tool-call-section[_ngcontent-%COMP%]{border-top:1px solid var(--color-border, rgba(0, 0, 0, .06))}.case-chat__tool-call-section[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{margin:.25rem 0 0;white-space:pre-wrap;word-break:break-all;font-family:var(--font-mono, ui-monospace, "SF Mono", monospace);font-size:.75rem;color:var(--color-text, #1d1d1f);max-height:200px;overflow-y:auto}.case-chat__tool-call-label[_ngcontent-%COMP%]{display:block;font-size:.65rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--color-text-secondary, #6e6e73)}.case-chat__tool-call-pending[_ngcontent-%COMP%], .case-chat__tool-call-empty[_ngcontent-%COMP%]{display:block;margin-top:.25rem;color:var(--color-text-secondary, #6e6e73);font-style:italic;font-size:.75rem}.case-chat__thinking[_ngcontent-%COMP%]{display:flex;gap:.3rem;padding:.75rem 1rem;align-self:flex-start}.case-chat__composer[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem;background:var(--glass-bg, rgba(255, 255, 255, .72));border:1px solid var(--glass-border, rgba(255, 255, 255, .18));backdrop-filter:var(--glass-backdrop-blur, blur(20px));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));border-radius:16px;padding:.5rem .5rem .5rem 1rem}.case-chat__input[_ngcontent-%COMP%]{flex:1;resize:none;padding:.5rem 0;border:none;background:transparent;color:var(--color-text, #1d1d1f);font-size:.95rem;font-family:inherit;line-height:1.5;outline:none;min-height:40px}.case-chat__input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.case-chat__input[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.case-chat__actions[_ngcontent-%COMP%]{display:flex;align-items:center;flex-shrink:0}.thinking-dot[_ngcontent-%COMP%]{width:8px;height:8px;border-radius:50%;background:var(--color-text-secondary, #6e6e73);animation:_ngcontent-%COMP%_thinking-bounce 1.2s ease-in-out infinite}.thinking-dot[_ngcontent-%COMP%]:nth-child(2){animation-delay:.2s}.thinking-dot[_ngcontent-%COMP%]:nth-child(3){animation-delay:.4s}@keyframes _ngcontent-%COMP%_thinking-bounce{0%,80%,to{transform:translateY(0);opacity:.4}40%{transform:translateY(-6px);opacity:1}}']})};export{$ as a};
|