@whoz-oss/coday-client 0.172.4 → 0.172.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/browser/{chunk-EH6JCC5E.js → chunk-2AWAFPH4.js} +1 -1
  2. package/browser/{chunk-7BI72RRD.js → chunk-32BDVVSG.js} +1 -1
  3. package/browser/chunk-34PTVFRS.js +1 -0
  4. package/browser/{chunk-UFIINNBU.js → chunk-46N45L7O.js} +1 -1
  5. package/browser/chunk-4DY4SO5Y.js +1 -0
  6. package/browser/{chunk-GDEZQW3C.js → chunk-7IBUVFIF.js} +1 -1
  7. package/browser/{chunk-WD4ZUXXF.js → chunk-7SVVJFNR.js} +1 -1
  8. package/browser/{chunk-QSPLAQ27.js → chunk-A6D23YB7.js} +1 -1
  9. package/browser/{chunk-O6YNK5FR.js → chunk-BAAEXH2R.js} +1 -1
  10. package/browser/{chunk-4L6UNUKM.js → chunk-CECTF44X.js} +1 -1
  11. package/browser/{chunk-EPOA3PNE.js → chunk-DLRFM3KG.js} +1 -1
  12. package/browser/{chunk-CFTXHCGZ.js → chunk-FHIUYFZ2.js} +1 -1
  13. package/browser/{chunk-MNH5XEMZ.js → chunk-GNQGVNDM.js} +1 -1
  14. package/browser/{chunk-DIMN5BFM.js → chunk-IC7YYFA3.js} +1 -1
  15. package/browser/{chunk-VY77UVRK.js → chunk-JD3M47LP.js} +1 -1
  16. package/browser/{chunk-JYJUTZMA.js → chunk-KMEAKE32.js} +1 -1
  17. package/browser/chunk-KWZFKFOK.js +1 -0
  18. package/browser/chunk-LO3SYUA5.js +1 -0
  19. package/browser/chunk-N4YKYGXC.js +1 -0
  20. package/browser/{chunk-OIFBHV2U.js → chunk-N6AZAHXT.js} +1 -1
  21. package/browser/{chunk-LL6YFZAM.js → chunk-N7BG2KYQ.js} +1 -1
  22. package/browser/{chunk-5TIYN4H7.js → chunk-OCNVIYZQ.js} +1 -1
  23. package/browser/{chunk-WUJJ3ZVR.js → chunk-PAGT3S3K.js} +1 -1
  24. package/browser/{chunk-V2FRZTTB.js → chunk-PYIP3I54.js} +1 -1
  25. package/browser/{chunk-WYUAW2U7.js → chunk-Q4IUP3VK.js} +1 -1
  26. package/browser/{chunk-ZOUZ76UW.js → chunk-QB2ZMBNG.js} +1 -1
  27. package/browser/{chunk-PFQSHXFF.js → chunk-QS5Q5GWK.js} +1 -1
  28. package/browser/{chunk-E56RKDSI.js → chunk-RM2LBLKH.js} +1 -1
  29. package/browser/{chunk-4QJ2AQ2O.js → chunk-RYVPVH4G.js} +1 -1
  30. package/browser/{chunk-IAAFQXVF.js → chunk-S5EMZVZ4.js} +1 -1
  31. package/browser/{chunk-6XJM3434.js → chunk-SE3WUHNJ.js} +1 -1
  32. package/browser/{chunk-3H5BULJH.js → chunk-YQFHR7W7.js} +1 -1
  33. package/browser/{chunk-EG4QF44S.js → chunk-YTGQFGK5.js} +1 -1
  34. package/browser/{chunk-KSFXR4QE.js → chunk-YXLZUZJS.js} +1 -1
  35. package/browser/index.html +1 -1
  36. package/browser/{main-HHLO3CH3.js → main-3PJZGYWO.js} +1 -1
  37. package/package.json +1 -1
  38. package/browser/chunk-4OIHXCET.js +0 -1
  39. package/browser/chunk-5K34TKOT.js +0 -1
  40. package/browser/chunk-B2KMZGEL.js +0 -1
  41. package/browser/chunk-YPFB5NN5.js +0 -1
@@ -1 +1 @@
1
- import{a as h}from"./chunk-T3IUNA6F.js";import{a as m}from"./chunk-JYJUTZMA.js";import{f as u}from"./chunk-4OIHXCET.js";import{D as i,P as C,S as I,V as a,Z as d,ca as c,i as p,m as r,t as f,u as g}from"./chunk-B4RKRLIY.js";var O="none",S="me",b=class l{nsController=c(u);userState=c(m);refresh$=new p(void 0);namespaceId$=new p(null);vm$=g([this.namespaceId$,this.refresh$]).pipe(I(([e])=>e?g([this.loadNamespaceConfigs(e).pipe(i(()=>r([]))),this.loadUserConfigs(e).pipe(i(()=>r([]))),this.loadUserConfigs("global").pipe(i(()=>r([])))]).pipe(f(([n,t,o])=>({namespace:n,userOnNs:t,userGlobal:o}))):g([this.loadNamespaceConfigs("").pipe(i(()=>r([]))),this.loadUserConfigs("global").pipe(i(()=>r([])))]).pipe(f(([n,t])=>({namespace:n,userOnNs:[],userGlobal:t})))),C({bufferSize:1,refCount:!0}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e)}refresh(){this.refresh$.next()}loadUserConfigs(e){let n=e==="global"?O:e;return this.nsController.listIntegrationConfig(n,S)}userGlobal$=h(this.refresh$,()=>this.loadUserConfigs("global"),[]);loadNamespaceConfigs(e){return e?this.nsController.listIntegrationConfig(e):r([])}getById(e,n){return this.nsController.getByIdIntegrationConfig(e)}create(e,n,t){let s=this.userState.currentUser()?.id;if((n==="userOnNs"||n==="userGlobal")&&!s)throw new Error(`Cannot create ${n} config before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(n==="namespace"){if(!t)throw new Error("Cannot create namespace-scoped config without a namespaceId");let y={name:e.name,integrationType:e.integrationType,description:e.description,namespaceId:t,parameters:e.parameters};return this.nsController.createIntegrationConfig(y).pipe(a(()=>this.refresh()))}if(n==="userOnNs"&&!t)throw new Error("Cannot create userOnNs config without a namespaceId");let v={name:e.name,integrationType:e.integrationType,description:e.description,userId:s,namespaceId:n==="userOnNs"?t:void 0,parameters:e.parameters};return this.nsController.createIntegrationConfig(v).pipe(a(()=>this.refresh()))}update(e,n,t,o){let s={name:n.name,integrationType:n.integrationType,description:n.description,userId:o.userId,namespaceId:o.namespaceId,parameters:n.parameters};return this.nsController.updateIntegrationConfig(e,s).pipe(a(()=>this.refresh()))}delete(e,n){return this.nsController.deleteIntegrationConfig(e).pipe(a(()=>this.refresh()))}static \u0275fac=function(n){return new(n||l)};static \u0275prov=d({token:l,factory:l.\u0275fac,providedIn:"root"})};export{b as a};
1
+ import{a as h}from"./chunk-T3IUNA6F.js";import{a as m}from"./chunk-KMEAKE32.js";import{f as u}from"./chunk-34PTVFRS.js";import{D as i,P as C,S as I,V as a,Z as d,ca as c,i as p,m as r,t as f,u as g}from"./chunk-B4RKRLIY.js";var O="none",S="me",b=class l{nsController=c(u);userState=c(m);refresh$=new p(void 0);namespaceId$=new p(null);vm$=g([this.namespaceId$,this.refresh$]).pipe(I(([e])=>e?g([this.loadNamespaceConfigs(e).pipe(i(()=>r([]))),this.loadUserConfigs(e).pipe(i(()=>r([]))),this.loadUserConfigs("global").pipe(i(()=>r([])))]).pipe(f(([n,t,o])=>({namespace:n,userOnNs:t,userGlobal:o}))):g([this.loadNamespaceConfigs("").pipe(i(()=>r([]))),this.loadUserConfigs("global").pipe(i(()=>r([])))]).pipe(f(([n,t])=>({namespace:n,userOnNs:[],userGlobal:t})))),C({bufferSize:1,refCount:!0}));setNamespace(e){this.namespaceId$.value!==e&&this.namespaceId$.next(e)}refresh(){this.refresh$.next()}loadUserConfigs(e){let n=e==="global"?O:e;return this.nsController.listIntegrationConfig(n,S)}userGlobal$=h(this.refresh$,()=>this.loadUserConfigs("global"),[]);loadNamespaceConfigs(e){return e?this.nsController.listIntegrationConfig(e):r([])}getById(e,n){return this.nsController.getByIdIntegrationConfig(e)}create(e,n,t){let s=this.userState.currentUser()?.id;if((n==="userOnNs"||n==="userGlobal")&&!s)throw new Error(`Cannot create ${n} config before UserStateService.loadMe() resolves \u2014 call loadMe() at app init`);if(n==="namespace"){if(!t)throw new Error("Cannot create namespace-scoped config without a namespaceId");let y={name:e.name,integrationType:e.integrationType,description:e.description,namespaceId:t,parameters:e.parameters};return this.nsController.createIntegrationConfig(y).pipe(a(()=>this.refresh()))}if(n==="userOnNs"&&!t)throw new Error("Cannot create userOnNs config without a namespaceId");let v={name:e.name,integrationType:e.integrationType,description:e.description,userId:s,namespaceId:n==="userOnNs"?t:void 0,parameters:e.parameters};return this.nsController.createIntegrationConfig(v).pipe(a(()=>this.refresh()))}update(e,n,t,o){let s={name:n.name,integrationType:n.integrationType,description:n.description,userId:o.userId,namespaceId:o.namespaceId,parameters:n.parameters};return this.nsController.updateIntegrationConfig(e,s).pipe(a(()=>this.refresh()))}delete(e,n){return this.nsController.deleteIntegrationConfig(e).pipe(a(()=>this.refresh()))}static \u0275fac=function(n){return new(n||l)};static \u0275prov=d({token:l,factory:l.\u0275fac,providedIn:"root"})};export{b as a};
@@ -1 +1 @@
1
- import{b as a}from"./chunk-4L6UNUKM.js";import"./chunk-4OIHXCET.js";import"./chunk-4GVABYH4.js";import"./chunk-VDRETD5H.js";import"./chunk-BUA6GPP7.js";import"./chunk-V363EHJE.js";import"./chunk-Z7E7NSDY.js";import"./chunk-ZEMOOOQR.js";import"./chunk-HZF57OLY.js";import"./chunk-EF2BOSEH.js";import"./chunk-B4RKRLIY.js";export{a as NamespaceListComponent};
1
+ import{b as a}from"./chunk-CECTF44X.js";import"./chunk-34PTVFRS.js";import"./chunk-4GVABYH4.js";import"./chunk-VDRETD5H.js";import"./chunk-BUA6GPP7.js";import"./chunk-V363EHJE.js";import"./chunk-Z7E7NSDY.js";import"./chunk-ZEMOOOQR.js";import"./chunk-HZF57OLY.js";import"./chunk-EF2BOSEH.js";import"./chunk-B4RKRLIY.js";export{a as NamespaceListComponent};
@@ -0,0 +1 @@
1
+ import{Qc as Q,Rc as h,Sc as R,Tc as j,Z as A,a as b,aa as k,b as u,ba as x,ca as O,da as K,g as L,pa as z}from"./chunk-B4RKRLIY.js";var y=class{apiKeys;username;password;accessToken;basePath;withCredentials;encoder;encodeParam;credentials;constructor({accessToken:C,apiKeys:n,basePath:r,credentials:p,encodeParam:o,encoder:t,password:e,username:i,withCredentials:l}={}){n&&(this.apiKeys=n),i!==void 0&&(this.username=i),e!==void 0&&(this.password=e),C!==void 0&&(this.accessToken=C),r!==void 0&&(this.basePath=r),l!==void 0&&(this.withCredentials=l),t&&(this.encoder=t),this.encodeParam=o??(a=>this.defaultEncodeParam(a)),this.credentials=p??{}}selectHeaderContentType(C){if(C.length===0)return;let n=C.find(r=>this.isJsonMime(r));return n===void 0?C[0]:n}selectHeaderAccept(C){if(C.length===0)return;let n=C.find(r=>this.isJsonMime(r));return n===void 0?C[0]:n}isJsonMime(C){let n=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return C!==null&&(n.test(C)||C.toLowerCase()==="application/json-patch+json")}lookupCredential(C){let n=this.credentials[C];return typeof n=="function"?n():n}addCredentialToHeaders(C,n,r,p){let o=this.lookupCredential(C);return o?r.set(n,(p??"")+o):r}addCredentialToQuery(C,n,r){let p=this.lookupCredential(C);return p?r.set(n,p):r}defaultEncodeParam(C){let n=C.dataFormat==="date-time"&&C.value instanceof Date?C.value.toISOString():C.value;return encodeURIComponent(String(n))}};var v=new k("basePath");var V=class{encodeKey(C){return encodeURIComponent(C)}encodeValue(C){return encodeURIComponent(C)}decodeKey(C){return decodeURIComponent(C)}decodeValue(C){return decodeURIComponent(C)}};var P=class{basePath="http://localhost:8124";defaultHeaders=new Q;configuration;encoder;constructor(C,n){if(this.configuration=n||new y,typeof this.configuration.basePath!="string"){let r=Array.isArray(C)?C[0]:void 0;r!=null&&(C=r),typeof C!="string"&&(C=this.basePath),this.configuration.basePath=C}this.encoder=this.configuration.encoder||new V}canConsumeForm(C){return C.indexOf("multipart/form-data")!==-1}addToHttpParams(C,n,r,p=!1){return typeof n=="object"&&!(n instanceof Date)?this.addToHttpParamsRecursive(C,n,p?r:void 0,p):this.addToHttpParamsRecursive(C,n,r)}addToHttpParamsRecursive(C,n,r,p=!1){if(n==null)return C;if(typeof n=="object"){if(r!=null)return p?Object.keys(n).reduce((o,t)=>o.append(`${r}[${t}]`,n[t]),C):C.append(r,JSON.stringify(n));if(Array.isArray(n))n.forEach(o=>C=this.addToHttpParamsRecursive(C,o,r));else if(n instanceof Date)if(r!=null)C=C.append(r,n.toISOString());else throw Error("key may not be null if value is Date");else Object.keys(n).forEach(o=>{let t=r?`${r}.${o}`:o;C=this.addToHttpParamsRecursive(C,n[o],t)});return C}else if(r!=null)return C.append(r,n);throw Error("key may not be null if value is not object or array")}};var E=class H extends P{constructor(n,r,p){super(r,p);this.httpClient=n}createAgentConfig(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter agentConfig was null or undefined when calling createAgentConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/agent-configs",{basePath:g,withCredentials:f}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(b({context:i,body:n,responseType:s},f?{withCredentials:f}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}deleteAgentConfig(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteAgentConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/agent-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}getByIdAgentConfig(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdAgentConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/agent-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}getByIdsAgentConfig(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter getByIdsRequest was null or undefined when calling getByIdsAgentConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/agent-configs/by-ids",{basePath:g,withCredentials:f}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(b({context:i,body:n,responseType:s},f?{withCredentials:f}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}getDefinitionAgentConfig(n,r,p="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling getDefinitionAgentConfig.");let e=new R({encoder:this.encoder});e=this.addToHttpParams(e,r,"withUserOverlay");let i=this.defaultHeaders,l=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);l!==void 0&&(i=i.set("Accept",l));let a=t?.context??new h,d=t?.transferCache??!0,s="json";l&&(l.startsWith("text")?s="text":this.configuration.isJsonMime(l)?s="json":s="blob");let c=`/api/agent-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/definition`,{basePath:g,withCredentials:f}=this.configuration;return this.httpClient.request("get",`${g}${c}`,u(b({context:a,params:e,responseType:s},f?{withCredentials:f}:{}),{headers:i,observe:p,transferCache:d,reportProgress:o}))}listByParentAgentConfig(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentAgentConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/agent-configs/by-parentId/${this.configuration.encodeParam({name:"parentId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}searchAgentConfig(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter agentConfigSearchRequest was null or undefined when calling searchAgentConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/agent-configs/search",{basePath:g,withCredentials:f}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(b({context:i,body:n,responseType:s},f?{withCredentials:f}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}updateAgentConfig(n,r,p="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateAgentConfig.");if(r==null)throw new Error("Required parameter agentConfig was null or undefined when calling updateAgentConfig.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);i!==void 0&&(e=e.set("Accept",i));let l=t?.context??new h,a=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";i&&(i.startsWith("text")?c="text":this.configuration.isJsonMime(i)?c="json":c="blob");let g=`/api/agent-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:f,withCredentials:m}=this.configuration;return this.httpClient.request("put",`${f}${g}`,u(b({context:l,body:r,responseType:c},m?{withCredentials:m}:{}),{headers:e,observe:p,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(y,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};var q=class H extends P{constructor(n,r,p){super(r,p);this.httpClient=n}createAiModel(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter aiModel was null or undefined when calling createAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/ai-models",{basePath:g,withCredentials:f}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(b({context:i,body:n,responseType:s},f?{withCredentials:f}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}deleteAiModel(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/ai-models/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}getByIdAiModel(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/ai-models/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}getByIdsAiModel(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter getByIdsRequest was null or undefined when calling getByIdsAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/ai-models/by-ids",{basePath:g,withCredentials:f}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(b({context:i,body:n,responseType:s},f?{withCredentials:f}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}listByNamespaceIdAiModel(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling listByNamespaceIdAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/ai-models/by-namespaceId/${this.configuration.encodeParam({name:"namespaceId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}listByParentAiModel(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/ai-models/by-parentId/${this.configuration.encodeParam({name:"parentId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}updateAiModel(n,r,p="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateAiModel.");if(r==null)throw new Error("Required parameter aiModel was null or undefined when calling updateAiModel.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);i!==void 0&&(e=e.set("Accept",i));let l=t?.context??new h,a=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";i&&(i.startsWith("text")?c="text":this.configuration.isJsonMime(i)?c="json":c="blob");let g=`/api/ai-models/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:f,withCredentials:m}=this.configuration;return this.httpClient.request("put",`${f}${g}`,u(b({context:l,body:r,responseType:c},m?{withCredentials:m}:{}),{headers:e,observe:p,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(y,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};var B=class H extends P{constructor(n,r,p){super(r,p);this.httpClient=n}createAiProvider(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter aiProvider was null or undefined when calling createAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/ai-providers",{basePath:g,withCredentials:f}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(b({context:i,body:n,responseType:s},f?{withCredentials:f}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}deleteAiProvider(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/ai-providers/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}getByIdAiProvider(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/ai-providers/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}getByIdsAiProvider(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter getByIdsRequest was null or undefined when calling getByIdsAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/ai-providers/by-ids",{basePath:g,withCredentials:f}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(b({context:i,body:n,responseType:s},f?{withCredentials:f}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}listAiProvider(n,r,p="body",o=!1,t){let e=new R({encoder:this.encoder});e=this.addToHttpParams(e,n,"namespaceId"),e=this.addToHttpParams(e,r,"userId");let i=this.defaultHeaders,l=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);l!==void 0&&(i=i.set("Accept",l));let a=t?.context??new h,d=t?.transferCache??!0,s="json";l&&(l.startsWith("text")?s="text":this.configuration.isJsonMime(l)?s="json":s="blob");let c="/api/ai-providers",{basePath:g,withCredentials:f}=this.configuration;return this.httpClient.request("get",`${g}${c}`,u(b({context:a,params:e,responseType:s},f?{withCredentials:f}:{}),{headers:i,observe:p,transferCache:d,reportProgress:o}))}updateAiProvider(n,r,p="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateAiProvider.");if(r==null)throw new Error("Required parameter aiProvider was null or undefined when calling updateAiProvider.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);i!==void 0&&(e=e.set("Accept",i));let l=t?.context??new h,a=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";i&&(i.startsWith("text")?c="text":this.configuration.isJsonMime(i)?c="json":c="blob");let g=`/api/ai-providers/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:f,withCredentials:m}=this.configuration;return this.httpClient.request("put",`${f}${g}`,u(b({context:l,body:r,responseType:c},m?{withCredentials:m}:{}),{headers:e,observe:p,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(y,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};var $=class H extends P{constructor(n,r,p){super(r,p);this.httpClient=n}addMessageCase(n,r,p="body",o=!1,t){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling addMessageCase.");if(r==null)throw new Error("Required parameter addMessageRequest was null or undefined when calling addMessageCase.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);i!==void 0&&(e=e.set("Accept",i));let l=t?.context??new h,a=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";i&&(i.startsWith("text")?c="text":this.configuration.isJsonMime(i)?c="json":c="blob");let g=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/messages`,{basePath:f,withCredentials:m}=this.configuration;return this.httpClient.request("post",`${f}${g}`,u(b({context:l,body:r,responseType:c},m?{withCredentials:m}:{}),{headers:e,observe:p,transferCache:a,reportProgress:o}))}createCase(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter _case was null or undefined when calling createCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/cases",{basePath:g,withCredentials:f}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(b({context:i,body:n,responseType:s},f?{withCredentials:f}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}deleteCase(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=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:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}getByIdCase(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=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:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}getByIdsCase(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter getByIdsRequest was null or undefined when calling getByIdsCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/cases/by-ids",{basePath:g,withCredentials:f}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(b({context:i,body:n,responseType:s},f?{withCredentials:f}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}interruptCase(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling interruptCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=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:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/interrupt`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}killCase(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling killCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=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:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/kill`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}listByParentCase(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=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:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}listByUserCase(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter userId was null or undefined when calling listByUserCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/by-user/${this.configuration.encodeParam({name:"userId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}listByUserExternalIdCase(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter externalId was null or undefined when calling listByUserExternalIdCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/cases/by-user/external/${this.configuration.encodeParam({name:"externalId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}listByUserInNamespaceCase(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter listByUserInNamespaceRequest was null or undefined when calling listByUserInNamespaceCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/cases/by-user/in-namespace",{basePath:g,withCredentials:f}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(b({context:i,body:n,responseType:s},f?{withCredentials:f}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}updateCase(n,r,p="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateCase.");if(r==null)throw new Error("Required parameter _case was null or undefined when calling updateCase.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);i!==void 0&&(e=e.set("Accept",i));let l=t?.context??new h,a=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";i&&(i.startsWith("text")?c="text":this.configuration.isJsonMime(i)?c="json":c="blob");let g=`/api/cases/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:f,withCredentials:m}=this.configuration;return this.httpClient.request("put",`${f}${g}`,u(b({context:l,body:r,responseType:c},m?{withCredentials:m}:{}),{headers:e,observe:p,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(y,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};var U=class H extends P{constructor(n,r,p){super(r,p);this.httpClient=n}createIntegrationConfig(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter integrationConfig was null or undefined when calling createIntegrationConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/integration-configs",{basePath:g,withCredentials:f}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(b({context:i,body:n,responseType:s},f?{withCredentials:f}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}deleteIntegrationConfig(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteIntegrationConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/integration-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}getByIdIntegrationConfig(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdIntegrationConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/integration-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}getByIdsIntegrationConfig(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter getByIdsRequest was null or undefined when calling getByIdsIntegrationConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/integration-configs/by-ids",{basePath:g,withCredentials:f}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(b({context:i,body:n,responseType:s},f?{withCredentials:f}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}listIntegrationConfig(n,r,p="body",o=!1,t){let e=new R({encoder:this.encoder});e=this.addToHttpParams(e,n,"namespaceId"),e=this.addToHttpParams(e,r,"userId");let i=this.defaultHeaders,l=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);l!==void 0&&(i=i.set("Accept",l));let a=t?.context??new h,d=t?.transferCache??!0,s="json";l&&(l.startsWith("text")?s="text":this.configuration.isJsonMime(l)?s="json":s="blob");let c="/api/integration-configs",{basePath:g,withCredentials:f}=this.configuration;return this.httpClient.request("get",`${g}${c}`,u(b({context:a,params:e,responseType:s},f?{withCredentials:f}:{}),{headers:i,observe:p,transferCache:d,reportProgress:o}))}updateIntegrationConfig(n,r,p="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateIntegrationConfig.");if(r==null)throw new Error("Required parameter integrationConfig was null or undefined when calling updateIntegrationConfig.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);i!==void 0&&(e=e.set("Accept",i));let l=t?.context??new h,a=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";i&&(i.startsWith("text")?c="text":this.configuration.isJsonMime(i)?c="json":c="blob");let g=`/api/integration-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:f,withCredentials:m}=this.configuration;return this.httpClient.request("put",`${f}${g}`,u(b({context:l,body:r,responseType:c},m?{withCredentials:m}:{}),{headers:e,observe:p,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(y,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};var M=class H extends P{constructor(n,r,p){super(r,p);this.httpClient=n}getTypeIntegrationType(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter type was null or undefined when calling getTypeIntegrationType.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/integration-types/${this.configuration.encodeParam({name:"type",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}listTypesIntegrationType(n="body",r=!1,p){let o=this.defaultHeaders,t=p?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);t!==void 0&&(o=o.set("Accept",t));let e=p?.context??new h,i=p?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let a="/api/integration-types",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("get",`${d}${a}`,u(b({context:e,responseType:l},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:i,reportProgress:r}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(y,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};var S=class H extends P{constructor(n,r,p){super(r,p);this.httpClient=n}createNamespace(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter namespace was null or undefined when calling createNamespace.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/namespaces",{basePath:g,withCredentials:f}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(b({context:i,body:n,responseType:s},f?{withCredentials:f}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}deleteNamespace(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteNamespace.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=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:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}deployAgentsNamespace(n,r,p="body",o=!1,t){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling deployAgentsNamespace.");if(r==null)throw new Error("Required parameter namespaceAgentDeployRequest was null or undefined when calling deployAgentsNamespace.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);i!==void 0&&(e=e.set("Accept",i));let l=t?.context??new h,a=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";i&&(i.startsWith("text")?c="text":this.configuration.isJsonMime(i)?c="json":c="blob");let g=`/api/namespaces/${this.configuration.encodeParam({name:"namespaceId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/deploy-agents`,{basePath:f,withCredentials:m}=this.configuration;return this.httpClient.request("post",`${f}${g}`,u(b({context:l,body:r,responseType:c},m?{withCredentials:m}:{}),{headers:e,observe:p,transferCache:a,reportProgress:o}))}getByIdNamespace(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdNamespace.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=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:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}getByIdsNamespace(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter getByIdsRequest was null or undefined when calling getByIdsNamespace.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/namespaces/by-ids",{basePath:g,withCredentials:f}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(b({context:i,body:n,responseType:s},f?{withCredentials:f}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}listAllNamespace(n="body",r=!1,p){let o=this.defaultHeaders,t=p?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);t!==void 0&&(o=o.set("Accept",t));let e=p?.context??new h,i=p?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let a="/api/namespaces",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("get",`${d}${a}`,u(b({context:e,responseType:l},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:i,reportProgress:r}))}listByExternalIdsNamespace(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling listByExternalIdsNamespace.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/namespaces/by-external-ids",{basePath:g,withCredentials:f}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(b({context:i,body:n,responseType:s},f?{withCredentials:f}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}listByParentNamespace(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentNamespace.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=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:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}undeployAgentsNamespace(n,r,p="body",o=!1,t){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling undeployAgentsNamespace.");if(r==null)throw new Error("Required parameter namespaceAgentDeployRequest was null or undefined when calling undeployAgentsNamespace.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);i!==void 0&&(e=e.set("Accept",i));let l=t?.context??new h,a=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";i&&(i.startsWith("text")?c="text":this.configuration.isJsonMime(i)?c="json":c="blob");let g=`/api/namespaces/${this.configuration.encodeParam({name:"namespaceId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/undeploy-agents`,{basePath:f,withCredentials:m}=this.configuration;return this.httpClient.request("post",`${f}${g}`,u(b({context:l,body:r,responseType:c},m?{withCredentials:m}:{}),{headers:e,observe:p,transferCache:a,reportProgress:o}))}updateNamespace(n,r,p="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateNamespace.");if(r==null)throw new Error("Required parameter namespace was null or undefined when calling updateNamespace.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);i!==void 0&&(e=e.set("Accept",i));let l=t?.context??new h,a=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";i&&(i.startsWith("text")?c="text":this.configuration.isJsonMime(i)?c="json":c="blob");let g=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:f,withCredentials:m}=this.configuration;return this.httpClient.request("put",`${f}${g}`,u(b({context:l,body:r,responseType:c},m?{withCredentials:m}:{}),{headers:e,observe:p,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(y,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};var Y=(p=>(p.OpenAI="OpenAI",p.Anthropic="Anthropic",p.Gemini="Gemini",p.vLLM="vLLM",p))(Y||{});var N=class H extends P{constructor(n,r,p){super(r,p);this.httpClient=n}getByIdCaseEventRest(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdCaseEventRest.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=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:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}getByIdsCaseEventRest(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIdsCaseEventRest.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/case-events/by-ids",{basePath:g,withCredentials:f}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(b({context:i,body:n,responseType:s},f?{withCredentials:f}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}listByCaseCaseEventRest(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling listByCaseCaseEventRest.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=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:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(y,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};var G=class H extends P{constructor(n,r,p){super(r,p);this.httpClient=n}grantAdmin(n,r,p="body",o=!1,t){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling grantAdmin.");if(r==null)throw new Error("Required parameter targetUserId was null or undefined when calling grantAdmin.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);i!==void 0&&(e=e.set("Accept",i));let l=t?.context??new h,a=t?.transferCache??!0,d="json";i&&(i.startsWith("text")?d="text":this.configuration.isJsonMime(i)?d="json":d="blob");let s=`/api/namespaces/${this.configuration.encodeParam({name:"namespaceId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/admins/${this.configuration.encodeParam({name:"targetUserId",value:r,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:c,withCredentials:g}=this.configuration;return this.httpClient.request("put",`${c}${s}`,u(b({context:l,responseType:d},g?{withCredentials:g}:{}),{headers:e,observe:p,transferCache:a,reportProgress:o}))}grantMember(n,r,p="body",o=!1,t){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling grantMember.");if(r==null)throw new Error("Required parameter targetUserId was null or undefined when calling grantMember.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);i!==void 0&&(e=e.set("Accept",i));let l=t?.context??new h,a=t?.transferCache??!0,d="json";i&&(i.startsWith("text")?d="text":this.configuration.isJsonMime(i)?d="json":d="blob");let s=`/api/namespaces/${this.configuration.encodeParam({name:"namespaceId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/members/${this.configuration.encodeParam({name:"targetUserId",value:r,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:c,withCredentials:g}=this.configuration;return this.httpClient.request("put",`${c}${s}`,u(b({context:l,responseType:d},g?{withCredentials:g}:{}),{headers:e,observe:p,transferCache:a,reportProgress:o}))}listNamespaceUsers(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling listNamespaceUsers.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=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:"namespaceId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/users`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}revokeAdmin(n,r,p="body",o=!1,t){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling revokeAdmin.");if(r==null)throw new Error("Required parameter targetUserId was null or undefined when calling revokeAdmin.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);i!==void 0&&(e=e.set("Accept",i));let l=t?.context??new h,a=t?.transferCache??!0,d="json";i&&(i.startsWith("text")?d="text":this.configuration.isJsonMime(i)?d="json":d="blob");let s=`/api/namespaces/${this.configuration.encodeParam({name:"namespaceId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/admins/${this.configuration.encodeParam({name:"targetUserId",value:r,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:c,withCredentials:g}=this.configuration;return this.httpClient.request("delete",`${c}${s}`,u(b({context:l,responseType:d},g?{withCredentials:g}:{}),{headers:e,observe:p,transferCache:a,reportProgress:o}))}revokeMember(n,r,p="body",o=!1,t){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling revokeMember.");if(r==null)throw new Error("Required parameter targetUserId was null or undefined when calling revokeMember.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);i!==void 0&&(e=e.set("Accept",i));let l=t?.context??new h,a=t?.transferCache??!0,d="json";i&&(i.startsWith("text")?d="text":this.configuration.isJsonMime(i)?d="json":d="blob");let s=`/api/namespaces/${this.configuration.encodeParam({name:"namespaceId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/members/${this.configuration.encodeParam({name:"targetUserId",value:r,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:c,withCredentials:g}=this.configuration;return this.httpClient.request("delete",`${c}${s}`,u(b({context:l,responseType:d},g?{withCredentials:g}:{}),{headers:e,observe:p,transferCache:a,reportProgress:o}))}updateRolesByExternalId(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter syncUserRolesRequest was null or undefined when calling updateRolesByExternalId.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/namespaces/update-roles-by-external-id",{basePath:g,withCredentials:f}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(b({context:i,body:n,responseType:s},f?{withCredentials:f}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(y,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};var J=class H extends P{constructor(n,r,p){super(r,p);this.httpClient=n}debugAllPlugins(n="body",r=!1,p){let o=this.defaultHeaders,t=p?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);t!==void 0&&(o=o.set("Accept",t));let e=p?.context??new h,i=p?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let a="/api/plugins/debug",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("get",`${d}${a}`,u(b({context:e,responseType:l},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:i,reportProgress:r}))}debugPlugin(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling debugPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=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:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/debug`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}getAllPlugins(n="body",r=!1,p){let o=this.defaultHeaders,t=p?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);t!==void 0&&(o=o.set("Accept",t));let e=p?.context??new h,i=p?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let a="/api/plugins",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("get",`${d}${a}`,u(b({context:e,responseType:l},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:i,reportProgress:r}))}getPlugin(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling getPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=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:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}reloadAllAgentsPlugin(n="body",r=!1,p){let o=this.defaultHeaders,t=p?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);t!==void 0&&(o=o.set("Accept",t));let e=p?.context??new h,i=p?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let a="/api/plugins/reload-agents",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("post",`${d}${a}`,u(b({context:e,responseType:l},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:i,reportProgress:r}))}reloadPlugin(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling reloadPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=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:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/reload`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}startPlugin(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling startPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=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:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/start`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}stopPlugin(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling stopPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=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:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/stop`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}unloadPlugin(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling unloadPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=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:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}uploadPlugin(n="body",r=!1,p){let o=this.defaultHeaders,t=p?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);t!==void 0&&(o=o.set("Accept",t));let e=p?.context??new h,i=p?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let a="/api/plugins/upload",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("post",`${d}${a}`,u(b({context:e,responseType:l},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:i,reportProgress:r}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(y,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};var W=class H extends P{constructor(n,r,p){super(r,p);this.httpClient=n}streamEventsCaseEventSse(n,r,p="body",o=!1,t){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling streamEventsCaseEventSse.");let e=new R({encoder:this.encoder});e=this.addToHttpParams(e,r,"includePreviousEvents");let i=this.defaultHeaders,l=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["text/event-stream"]);l!==void 0&&(i=i.set("Accept",l));let a=t?.context??new h,d=t?.transferCache??!0,s="json";l&&(l.startsWith("text")?s="text":this.configuration.isJsonMime(l)?s="json":s="blob");let c=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/events`,{basePath:g,withCredentials:f}=this.configuration;return this.httpClient.request("get",`${g}${c}`,u(b({context:a,params:e,responseType:s},f?{withCredentials:f}:{}),{headers:i,observe:p,transferCache:d,reportProgress:o}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(y,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};var F=class H extends P{constructor(n,r,p){super(r,p);this.httpClient=n}createUser(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter user was null or undefined when calling createUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/users",{basePath:g,withCredentials:f}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(b({context:i,body:n,responseType:s},f?{withCredentials:f}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}deleteUser(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/users/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}getByIdUser(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/users/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}getByIdsUser(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter getByIdsRequest was null or undefined when calling getByIdsUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/users/by-ids",{basePath:g,withCredentials:f}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(b({context:i,body:n,responseType:s},f?{withCredentials:f}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}getGroupsByExternalIdsUser(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling getGroupsByExternalIdsUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/users/groups-by-external-ids",{basePath:g,withCredentials:f}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(b({context:i,body:n,responseType:s},f?{withCredentials:f}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}getMeUser(n="body",r=!1,p){let o=this.defaultHeaders,t=p?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);t!==void 0&&(o=o.set("Accept",t));let e=p?.context??new h,i=p?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let a="/api/users/me",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("get",`${d}${a}`,u(b({context:e,responseType:l},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:i,reportProgress:r}))}listAllUser(n="body",r=!1,p){let o=this.defaultHeaders,t=p?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);t!==void 0&&(o=o.set("Accept",t));let e=p?.context??new h,i=p?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let a="/api/users",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("get",`${d}${a}`,u(b({context:e,responseType:l},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:i,reportProgress:r}))}listByExternalIdsUser(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling listByExternalIdsUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/users/by-external-ids",{basePath:g,withCredentials:f}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(b({context:i,body:n,responseType:s},f?{withCredentials:f}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}listByParentUser(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/users/by-parentId/${this.configuration.encodeParam({name:"parentId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}updateUser(n,r,p="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateUser.");if(r==null)throw new Error("Required parameter user was null or undefined when calling updateUser.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);i!==void 0&&(e=e.set("Accept",i));let l=t?.context??new h,a=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";i&&(i.startsWith("text")?c="text":this.configuration.isJsonMime(i)?c="json":c="blob");let g=`/api/users/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:f,withCredentials:m}=this.configuration;return this.httpClient.request("put",`${f}${g}`,u(b({context:l,body:r,responseType:c},m?{withCredentials:m}:{}),{headers:e,observe:p,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(y,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};var _=class H extends P{constructor(n,r,p){super(r,p);this.httpClient=n}createUserGroup(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter userGroupCreateRequest was null or undefined when calling createUserGroup.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a=["application/json"],d=this.configuration.selectHeaderContentType(a);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/user-groups",{basePath:g,withCredentials:f}=this.configuration;return this.httpClient.request("post",`${g}${c}`,u(b({context:i,body:n,responseType:s},f?{withCredentials:f}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}deleteUserGroup(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter userGroupId was null or undefined when calling deleteUserGroup.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/user-groups/${this.configuration.encodeParam({name:"userGroupId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}getByIdUserGroup(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter userGroupId was null or undefined when calling getByIdUserGroup.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let i=o?.context??new h,l=o?.transferCache??!0,a="json";e&&(e.startsWith("text")?a="text":this.configuration.isJsonMime(e)?a="json":a="blob");let d=`/api/user-groups/${this.configuration.encodeParam({name:"userGroupId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,u(b({context:i,responseType:a},c?{withCredentials:c}:{}),{headers:t,observe:r,transferCache:l,reportProgress:p}))}searchByNamespaceIdUserGroup(n,r="body",p=!1,o){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling searchByNamespaceIdUserGroup.");let t=new R({encoder:this.encoder});t=this.addToHttpParams(t,n,"namespaceId");let e=this.defaultHeaders,i=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);i!==void 0&&(e=e.set("Accept",i));let l=o?.context??new h,a=o?.transferCache??!0,d="json";i&&(i.startsWith("text")?d="text":this.configuration.isJsonMime(i)?d="json":d="blob");let s="/api/user-groups",{basePath:c,withCredentials:g}=this.configuration;return this.httpClient.request("get",`${c}${s}`,u(b({context:l,params:t,responseType:d},g?{withCredentials:g}:{}),{headers:e,observe:r,transferCache:a,reportProgress:p}))}updateUserGroup(n,r,p="body",o=!1,t){if(n==null)throw new Error("Required parameter userGroupId was null or undefined when calling updateUserGroup.");if(r==null)throw new Error("Required parameter userGroupUpdateRequest was null or undefined when calling updateUserGroup.");let e=this.defaultHeaders,i=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);i!==void 0&&(e=e.set("Accept",i));let l=t?.context??new h,a=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";i&&(i.startsWith("text")?c="text":this.configuration.isJsonMime(i)?c="json":c="blob");let g=`/api/user-groups/${this.configuration.encodeParam({name:"userGroupId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:f,withCredentials:m}=this.configuration;return this.httpClient.request("post",`${f}${g}`,u(b({context:l,body:r,responseType:c},m?{withCredentials:m}:{}),{headers:e,observe:p,transferCache:a,reportProgress:o}))}static \u0275fac=function(r){return new(r||H)(x(j),x(v,8),x(y,8))};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};function Do(H){return K([typeof H=="string"?{provide:v,useValue:H}:{provide:y,useValue:new y(b({},H))}])}var D=class H{config=O(y);zone=O(z);connect(C){let n=`${this.config.basePath}/api/cases/${C}/events`;return new L(r=>{let p=this.zone.runOutsideAngular(()=>new EventSource(n));return p.onmessage=o=>{try{let t=JSON.parse(o.data);this.zone.run(()=>r.next(t))}catch(t){this.zone.run(()=>r.error(new Error(`Failed to parse SSE event: ${t}`)))}},p.onerror=o=>{p.readyState===EventSource.CLOSED?this.zone.run(()=>r.complete()):this.zone.run(()=>r.error(new Error(`SSE connection error for case ${C}`))),p.close()},()=>p.close()})}static \u0275fac=function(n){return new(n||H)};static \u0275prov=A({token:H,factory:H.\u0275fac,providedIn:"root"})};export{y as a,E as b,q as c,B as d,$ as e,U as f,M as g,S as h,G as i,J as j,F as k,Y as l,Do as m};
@@ -1 +1 @@
1
- import{k as p}from"./chunk-4OIHXCET.js";import{V as s,Z as d,a as n,ca as u,ta as a}from"./chunk-B4RKRLIY.js";var c=class o{userController=u(p);users=a([]);isLoading=a(!1);loadAll(){return this.isLoading.set(!0),this.userController.listAllUser().pipe(s({next:e=>{this.users.set(e),this.isLoading.set(!1)},error:()=>this.isLoading.set(!1)}))}createUser(e){return this.userController.createUser(e).pipe(s(()=>{this.loadAll().subscribe()}))}updateUser(e,r){let t=this.users().find(i=>i.id===e);if(!t)throw new Error(`Cannot update: user ${e} not found in state`);let U=n(n({},t),r);return this.userController.updateUser(e,U).pipe(s(i=>{this.users.update(b=>b.map(l=>l.id===i.id?i:l))}))}deleteUser(e){return this.userController.deleteUser(e).pipe(s(()=>{this.users.update(r=>r.filter(t=>t.id!==e))}))}static \u0275fac=function(r){return new(r||o)};static \u0275prov=d({token:o,factory:o.\u0275fac,providedIn:"root"})};export{c as a};
1
+ import{k as p}from"./chunk-34PTVFRS.js";import{V as s,Z as d,a as n,ca as u,ta as a}from"./chunk-B4RKRLIY.js";var c=class o{userController=u(p);users=a([]);isLoading=a(!1);loadAll(){return this.isLoading.set(!0),this.userController.listAllUser().pipe(s({next:e=>{this.users.set(e),this.isLoading.set(!1)},error:()=>this.isLoading.set(!1)}))}createUser(e){return this.userController.createUser(e).pipe(s(()=>{this.loadAll().subscribe()}))}updateUser(e,r){let t=this.users().find(i=>i.id===e);if(!t)throw new Error(`Cannot update: user ${e} not found in state`);let U=n(n({},t),r);return this.userController.updateUser(e,U).pipe(s(i=>{this.users.update(b=>b.map(l=>l.id===i.id?i:l))}))}deleteUser(e){return this.userController.deleteUser(e).pipe(s(()=>{this.users.update(r=>r.filter(t=>t.id!==e))}))}static \u0275fac=function(r){return new(r||o)};static \u0275prov=d({token:o,factory:o.\u0275fac,providedIn:"root"})};export{c as a};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-PYIP3I54.js";import"./chunk-DLRFM3KG.js";import"./chunk-KMEAKE32.js";import"./chunk-34PTVFRS.js";import"./chunk-4GVABYH4.js";import"./chunk-V363EHJE.js";import"./chunk-B4RKRLIY.js";export{a as LayoutComponent};
@@ -1 +1 @@
1
- import{b as a}from"./chunk-OIFBHV2U.js";import"./chunk-UFIINNBU.js";import"./chunk-4OIHXCET.js";import"./chunk-4GVABYH4.js";import"./chunk-VDRETD5H.js";import"./chunk-BUA6GPP7.js";import"./chunk-V363EHJE.js";import"./chunk-Z7E7NSDY.js";import"./chunk-ZEMOOOQR.js";import"./chunk-HZF57OLY.js";import"./chunk-EF2BOSEH.js";import"./chunk-B4RKRLIY.js";export{a as UserListComponent};
1
+ import{b as a}from"./chunk-N6AZAHXT.js";import"./chunk-46N45L7O.js";import"./chunk-34PTVFRS.js";import"./chunk-4GVABYH4.js";import"./chunk-VDRETD5H.js";import"./chunk-BUA6GPP7.js";import"./chunk-V363EHJE.js";import"./chunk-Z7E7NSDY.js";import"./chunk-ZEMOOOQR.js";import"./chunk-HZF57OLY.js";import"./chunk-EF2BOSEH.js";import"./chunk-B4RKRLIY.js";export{a as UserListComponent};
@@ -1 +1 @@
1
- import{a as j}from"./chunk-EH6JCC5E.js";import{a as q}from"./chunk-MNH5XEMZ.js";import"./chunk-T3IUNA6F.js";import{a as Y}from"./chunk-JYJUTZMA.js";import"./chunk-4OIHXCET.js";import{d as F}from"./chunk-4GVABYH4.js";import{a as h,c as B}from"./chunk-V363EHJE.js";import{F as A,c as G,g as z,h as N,i as $,l as y,n as K,v as L,w as R}from"./chunk-HZF57OLY.js";import{Bb as x,Db as c,Dc as V,Fb as s,Ka as d,Rb as T,Tb as n,Ub as p,Vb as k,Wa as D,ca as C,ga as m,ha as u,jb as I,kb as E,lb as f,ma as U,mb as g,pb as P,qb as S,rb as w,sb as i,t as M,ta as v,tb as e,u as O,ub as b}from"./chunk-B4RKRLIY.js";function J(r,o){r&1&&(i(0,"p",5),n(1,"Loading\u2026"),e())}function Q(r,o){if(r&1){let t=x();i(0,"form",8),c("ngSubmit",function(){m(t);let a=s(2);return u(a.save())}),i(1,"div",9)(2,"h2",10),n(3,"Identity"),e(),i(4,"div",11)(5,"span",12),n(6,"Email"),e(),i(7,"span",13),n(8),e()(),i(9,"div",11)(10,"span",12),n(11,"External ID"),e(),i(12,"span",13),n(13),e()()(),i(14,"div",9)(15,"h2",10),n(16,"Profile"),e(),i(17,"div",11)(18,"label",14),n(19,"First name"),e(),b(20,"input",15),e(),i(21,"div",11)(22,"label",16),n(23,"Last name"),e(),b(24,"input",17),e(),i(25,"div",11)(26,"label",18),n(27,"Bio"),e(),b(28,"textarea",19),e()(),i(29,"div",20)(30,"button",21),n(31),e(),i(32,"button",22),c("click",function(){m(t);let a=s(2);return u(a.cancelEditing())}),n(33,"Cancel"),e()()()}if(r&2){let t=s(),l=s();w("formGroup",l.form),d(8),p(t.email),d(5),p(t.externalId),d(17),w("disabled",l.isSaving()),d(),k(" ",l.isSaving()?"Saving\u2026":"Save changes"," ")}}function W(r,o){r&1&&(i(0,"p",30),n(1," Aucune configuration globale. Cr\xE9e-en depuis les pages Integrations / AI Providers / AI Models de tes namespaces. "),e())}function X(r,o){if(r&1){let t=x();i(0,"span",37),n(1,"Delete?"),e(),i(2,"button",38),c("click",function(){m(t);let a=s().$implicit,_=s(6);return u(_.confirmDelete(a))}),n(3," Confirm "),e(),i(4,"button",39),c("click",function(){m(t);let a=s(7);return u(a.cancelDelete())}),n(5," Cancel "),e()}}function Z(r,o){if(r&1){let t=x();i(0,"button",39),c("click",function(){m(t);let a=s().$implicit,_=s(6);return u(_.armDelete(a))}),n(1," Delete "),e()}}function ee(r,o){if(r&1&&(i(0,"li",33)(1,"span",34),n(2),e(),i(3,"span",35),n(4),e(),f(5,X,6,0)(6,Z,2,0,"button",36),e()),r&2){let t=o.$implicit,l=s(6);d(2),p(t.name),d(2),p(t.subtitle),d(),g(l.isPendingDelete(t)?5:6)}}function te(r,o){if(r&1&&(i(0,"h3",31),n(1,"Integrations"),e(),i(2,"ul",32),P(3,ee,7,3,"li",33,E().trackEntry,!0),e()),r&2){let t=s(5);d(3),S(t.recap().integrations)}}function ie(r,o){if(r&1){let t=x();i(0,"span",37),n(1,"Delete?"),e(),i(2,"button",38),c("click",function(){m(t);let a=s().$implicit,_=s(6);return u(_.confirmDelete(a))}),n(3," Confirm "),e(),i(4,"button",39),c("click",function(){m(t);let a=s(7);return u(a.cancelDelete())}),n(5," Cancel "),e()}}function ne(r,o){if(r&1){let t=x();i(0,"button",39),c("click",function(){m(t);let a=s().$implicit,_=s(6);return u(_.armDelete(a))}),n(1," Delete "),e()}}function oe(r,o){if(r&1&&(i(0,"li",33)(1,"span",34),n(2),e(),i(3,"span",35),n(4),e(),f(5,ie,6,0)(6,ne,2,0,"button",36),e()),r&2){let t=o.$implicit,l=s(6);d(2),p(t.name),d(2),p(t.subtitle),d(),g(l.isPendingDelete(t)?5:6)}}function re(r,o){if(r&1&&(i(0,"h3",31),n(1,"AI Providers"),e(),i(2,"ul",32),P(3,oe,7,3,"li",33,E().trackEntry,!0),e()),r&2){let t=s(5);d(3),S(t.recap().aiProviders)}}function le(r,o){if(r&1&&(f(0,te,5,0),f(1,re,5,0)),r&2){let t=s(4);g(t.recap().integrations.length>0?0:-1),d(),g(t.recap().aiProviders.length>0?1:-1)}}function ae(r,o){if(r&1&&f(0,W,2,0,"p",30)(1,le,2,2),r&2){let t=s(3);g(t.recap().total===0?0:1)}}function se(r,o){if(r&1){let t=x();i(0,"div",7)(1,"div",9)(2,"h2",10),n(3,"Identity"),e(),i(4,"div",11)(5,"span",12),n(6,"Email"),e(),i(7,"span",23),n(8),e()(),i(9,"div",11)(10,"span",12),n(11,"External ID"),e(),i(12,"span",23),n(13),e()()(),i(14,"div",9)(15,"h2",10),n(16,"Profile"),e(),i(17,"div",11)(18,"span",12),n(19,"First name"),e(),i(20,"span",23),n(21),e()(),i(22,"div",11)(23,"span",12),n(24,"Last name"),e(),i(25,"span",23),n(26),e()(),i(27,"div",24)(28,"span",12),n(29,"Bio"),e(),i(30,"span",23),n(31),e()()(),i(32,"div",20)(33,"button",25),c("click",function(){m(t);let a=s(2);return u(a.startEditing())}),n(34," Edit profile "),e()(),i(35,"div",26)(36,"button",27),c("click",function(){m(t);let a=s(2);return u(a.toggleOverrides())}),i(37,"span",28),n(38,"\u25B6"),e(),n(39," Mes configurations utilisateur globales "),i(40,"span",29),n(41),e()(),f(42,ae,2,1),e()()}if(r&2){let t=s(),l=s();d(8),p(t.email),d(5),p(t.externalId),d(8),p(t.firstname||"\u2014"),d(5),p(t.lastname||"\u2014"),d(5),p(t.bio||"\u2014"),d(5),I("aria-expanded",l.isOverridesExpanded()),d(),T("user-profile__overrides-arrow--open",l.isOverridesExpanded()),d(4),k("(",l.recap().total,")"),d(),g(l.isOverridesExpanded()?42:-1)}}function de(r,o){if(r&1&&f(0,Q,34,5,"form",6)(1,se,43,10,"div",7),r&2){let t=s();g(t.isEditing()?0:1)}}function _e(r,o){r&1&&(i(0,"p",5),n(1,"Unable to load profile."),e())}var H=class r{userState=C(Y);router=C(F);location=C(V);destroyRef=C(U);integrationState=C(j);providerState=C(q);isEditing=v(!1);isLoading=v(!1);isSaving=v(!1);isOverridesExpanded=v(!1);currentUser=this.userState.currentUser;form=new $({firstname:new y("",{nonNullable:!0}),lastname:new y("",{nonNullable:!0}),bio:new y("",{nonNullable:!0})});recap=B(O([this.integrationState.userGlobal$,this.providerState.userGlobal$]).pipe(M(([o,t])=>{let l=o.map(_=>({category:"integration",id:_.id??"",name:_.name,subtitle:_.integrationType})),a=t.map(_=>({category:"aiProvider",id:_.id??"",name:_.name,subtitle:_.apiType}));return{integrations:l,aiProviders:a,total:l.length+a.length}})),{initialValue:{integrations:[],aiProviders:[],total:0}});ngOnInit(){if(this.currentUser()){this.syncFormFromState();return}this.isLoading.set(!0),this.userState.loadMe().pipe(h(this.destroyRef)).subscribe({next:()=>{this.syncFormFromState(),this.isLoading.set(!1)},error:()=>this.isLoading.set(!1)})}startEditing(){this.syncFormFromState(),this.isEditing.set(!0)}cancelEditing(){this.isEditing.set(!1)}save(){this.isSaving()||(this.isSaving.set(!0),this.userState.updateMe({firstname:this.form.controls.firstname.value.trim()||void 0,lastname:this.form.controls.lastname.value.trim()||void 0,bio:this.form.controls.bio.value.trim()||void 0}).pipe(h(this.destroyRef)).subscribe({next:()=>{this.isSaving.set(!1),this.isEditing.set(!1)},error:()=>this.isSaving.set(!1)}))}toggleOverrides(){this.isOverridesExpanded.update(o=>!o),this.pendingDeleteKey.set(null)}pendingDeleteKey=v(null);isPendingDelete(o){return this.pendingDeleteKey()===this.entryKey(o)}armDelete(o){o.id&&this.pendingDeleteKey.set(this.entryKey(o))}cancelDelete(){this.pendingDeleteKey.set(null)}confirmDelete(o){if(!o.id)return;this.pendingDeleteKey.set(null),(o.category==="integration"?this.integrationState.delete(o.id,"userGlobal"):this.providerState.delete(o.id,"userGlobal")).pipe(h(this.destroyRef)).subscribe({error:l=>{console.error(`[UserProfile] Delete failed for ${o.category}:${o.id}:`,l)}})}entryKey(o){return`${o.category}:${o.id}`}goBack(){window.history.length>1?this.location.back():this.router.navigate(["/agentos"])}trackEntry(o,t){return this.entryKey(t)}syncFormFromState(){let o=this.currentUser();o&&this.form.setValue({firstname:o.firstname??"",lastname:o.lastname??"",bio:o.bio??""})}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=D({type:r,selectors:[["agentos-user-profile"]],decls:11,vars:1,consts:[[1,"user-profile"],[1,"user-profile__header"],["type","button","title","Go back",1,"user-profile__back",3,"click"],[1,"user-profile__back-icon"],[1,"user-profile__title"],[1,"user-profile__loading"],[1,"user-profile__form",3,"formGroup"],[1,"user-profile__view"],[1,"user-profile__form",3,"ngSubmit","formGroup"],[1,"user-profile__section"],[1,"user-profile__section-title"],[1,"user-profile__field"],[1,"user-profile__label"],[1,"user-profile__value","user-profile__value--readonly"],["for","up-firstname",1,"user-profile__label"],["id","up-firstname","type","text","placeholder","Your first name","formControlName","firstname","autocomplete","given-name",1,"user-profile__input"],["for","up-lastname",1,"user-profile__label"],["id","up-lastname","type","text","placeholder","Your last name","formControlName","lastname","autocomplete","family-name",1,"user-profile__input"],["for","up-bio",1,"user-profile__label"],["id","up-bio","placeholder","A short description about yourself","formControlName","bio","rows","4",1,"user-profile__input","user-profile__input--textarea"],[1,"user-profile__actions"],["type","submit",1,"user-profile__btn","user-profile__btn--primary",3,"disabled"],["type","button",1,"user-profile__btn",3,"click"],[1,"user-profile__value"],[1,"user-profile__field","user-profile__field--bio"],["type","button",1,"user-profile__btn","user-profile__btn--primary",3,"click"],[1,"user-profile__overrides"],["type","button",1,"user-profile__overrides-toggle",3,"click"],[1,"user-profile__overrides-arrow"],[1,"user-profile__overrides-count"],[1,"user-profile__overrides-empty"],[1,"user-profile__overrides-subtitle"],[1,"user-profile__overrides-list"],[1,"user-profile__overrides-row"],[1,"user-profile__overrides-name"],[1,"user-profile__overrides-subtitle-text"],["type","button",1,"user-profile__overrides-delete"],[1,"user-profile__overrides-confirm-label"],["type","button",1,"user-profile__overrides-delete","user-profile__overrides-delete--confirm",3,"click"],["type","button",1,"user-profile__overrides-delete",3,"click"]],template:function(t,l){if(t&1&&(i(0,"div",0)(1,"header",1)(2,"button",2),c("click",function(){return l.goBack()}),i(3,"span",3),n(4,"\u2190"),e(),n(5," Back "),e(),i(6,"h1",4),n(7,"My profile"),e()(),f(8,J,2,0,"p",5)(9,de,2,1)(10,_e,2,0,"p",5),e()),t&2){let a;d(8),g(l.isLoading()?8:(a=l.currentUser())?9:10,a)}},dependencies:[A,K,G,z,N,R,L],styles:[".user-profile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.user-profile__overrides[_ngcontent-%COMP%]{margin-top:1rem;padding-top:1rem;border-top:1px dashed var(--color-border)}.user-profile__overrides-toggle[_ngcontent-%COMP%]{background:transparent;border:none;padding:.25rem 0;font-size:.85rem;color:var(--color-text-secondary);cursor:pointer;display:flex;align-items:center;gap:.4rem}.user-profile__overrides-toggle[_ngcontent-%COMP%]:hover{color:var(--color-text)}.user-profile__overrides-arrow[_ngcontent-%COMP%]{display:inline-block;font-size:.65rem;transition:transform .15s ease}.user-profile__overrides-arrow--open[_ngcontent-%COMP%]{transform:rotate(90deg)}.user-profile__overrides-count[_ngcontent-%COMP%]{color:var(--color-text-tertiary)}.user-profile__overrides-empty[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary);font-style:italic;padding:.5rem 0 0;margin:0}.user-profile__overrides-subtitle[_ngcontent-%COMP%]{font-size:.75rem;text-transform:uppercase;letter-spacing:.04em;color:var(--color-text-tertiary);margin:.75rem 0 .25rem}.user-profile__overrides-list[_ngcontent-%COMP%]{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:.25rem}.user-profile__overrides-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.4rem .5rem;font-size:.85rem;border-radius:6px}.user-profile__overrides-row[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.user-profile__overrides-name[_ngcontent-%COMP%]{flex:1;color:var(--color-text);font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-profile__overrides-subtitle-text[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);font-family:monospace}.user-profile__overrides-delete[_ngcontent-%COMP%]{background:transparent;border:none;font-size:.75rem;color:var(--color-error);cursor:pointer;padding:.2rem .4rem;border-radius:4px}.user-profile__overrides-delete[_ngcontent-%COMP%]:hover{background:color-mix(in srgb,var(--color-error) 12%,transparent)}.user-profile__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.user-profile__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.user-profile__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.user-profile__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.user-profile__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.user-profile__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.user-profile__view[_ngcontent-%COMP%], .user-profile__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem}.user-profile__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.user-profile__section-title[_ngcontent-%COMP%]{margin:0;font-size:.75rem;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--color-text-secondary, #6e6e73);border-bottom:1px solid var(--color-border-light, rgba(0, 0, 0, .06));padding-bottom:.5rem}.user-profile__field[_ngcontent-%COMP%]{display:grid;grid-template-columns:140px 1fr;align-items:baseline;gap:.75rem}.user-profile__field--bio[_ngcontent-%COMP%]{align-items:start}.user-profile__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);white-space:nowrap}.user-profile__value[_ngcontent-%COMP%]{font-size:.9375rem;color:var(--color-text, #1d1d1f);word-break:break-word;white-space:pre-wrap}.user-profile__value--readonly[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.875rem}.user-profile__input[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease;resize:none}.user-profile__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.user-profile__input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.user-profile__input--textarea[_ngcontent-%COMP%]{line-height:1.5;resize:vertical}.user-profile__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.user-profile__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.user-profile__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.user-profile__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.user-profile__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.user-profile__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};export{H as UserProfileComponent};
1
+ import{a as j}from"./chunk-2AWAFPH4.js";import{a as q}from"./chunk-GNQGVNDM.js";import"./chunk-T3IUNA6F.js";import{a as Y}from"./chunk-KMEAKE32.js";import"./chunk-34PTVFRS.js";import{d as F}from"./chunk-4GVABYH4.js";import{a as h,c as B}from"./chunk-V363EHJE.js";import{F as A,c as G,g as z,h as N,i as $,l as y,n as K,v as L,w as R}from"./chunk-HZF57OLY.js";import{Bb as x,Db as c,Dc as V,Fb as s,Ka as d,Rb as T,Tb as n,Ub as p,Vb as k,Wa as D,ca as C,ga as m,ha as u,jb as I,kb as E,lb as f,ma as U,mb as g,pb as P,qb as S,rb as w,sb as i,t as M,ta as v,tb as e,u as O,ub as b}from"./chunk-B4RKRLIY.js";function J(r,o){r&1&&(i(0,"p",5),n(1,"Loading\u2026"),e())}function Q(r,o){if(r&1){let t=x();i(0,"form",8),c("ngSubmit",function(){m(t);let a=s(2);return u(a.save())}),i(1,"div",9)(2,"h2",10),n(3,"Identity"),e(),i(4,"div",11)(5,"span",12),n(6,"Email"),e(),i(7,"span",13),n(8),e()(),i(9,"div",11)(10,"span",12),n(11,"External ID"),e(),i(12,"span",13),n(13),e()()(),i(14,"div",9)(15,"h2",10),n(16,"Profile"),e(),i(17,"div",11)(18,"label",14),n(19,"First name"),e(),b(20,"input",15),e(),i(21,"div",11)(22,"label",16),n(23,"Last name"),e(),b(24,"input",17),e(),i(25,"div",11)(26,"label",18),n(27,"Bio"),e(),b(28,"textarea",19),e()(),i(29,"div",20)(30,"button",21),n(31),e(),i(32,"button",22),c("click",function(){m(t);let a=s(2);return u(a.cancelEditing())}),n(33,"Cancel"),e()()()}if(r&2){let t=s(),l=s();w("formGroup",l.form),d(8),p(t.email),d(5),p(t.externalId),d(17),w("disabled",l.isSaving()),d(),k(" ",l.isSaving()?"Saving\u2026":"Save changes"," ")}}function W(r,o){r&1&&(i(0,"p",30),n(1," Aucune configuration globale. Cr\xE9e-en depuis les pages Integrations / AI Providers / AI Models de tes namespaces. "),e())}function X(r,o){if(r&1){let t=x();i(0,"span",37),n(1,"Delete?"),e(),i(2,"button",38),c("click",function(){m(t);let a=s().$implicit,_=s(6);return u(_.confirmDelete(a))}),n(3," Confirm "),e(),i(4,"button",39),c("click",function(){m(t);let a=s(7);return u(a.cancelDelete())}),n(5," Cancel "),e()}}function Z(r,o){if(r&1){let t=x();i(0,"button",39),c("click",function(){m(t);let a=s().$implicit,_=s(6);return u(_.armDelete(a))}),n(1," Delete "),e()}}function ee(r,o){if(r&1&&(i(0,"li",33)(1,"span",34),n(2),e(),i(3,"span",35),n(4),e(),f(5,X,6,0)(6,Z,2,0,"button",36),e()),r&2){let t=o.$implicit,l=s(6);d(2),p(t.name),d(2),p(t.subtitle),d(),g(l.isPendingDelete(t)?5:6)}}function te(r,o){if(r&1&&(i(0,"h3",31),n(1,"Integrations"),e(),i(2,"ul",32),P(3,ee,7,3,"li",33,E().trackEntry,!0),e()),r&2){let t=s(5);d(3),S(t.recap().integrations)}}function ie(r,o){if(r&1){let t=x();i(0,"span",37),n(1,"Delete?"),e(),i(2,"button",38),c("click",function(){m(t);let a=s().$implicit,_=s(6);return u(_.confirmDelete(a))}),n(3," Confirm "),e(),i(4,"button",39),c("click",function(){m(t);let a=s(7);return u(a.cancelDelete())}),n(5," Cancel "),e()}}function ne(r,o){if(r&1){let t=x();i(0,"button",39),c("click",function(){m(t);let a=s().$implicit,_=s(6);return u(_.armDelete(a))}),n(1," Delete "),e()}}function oe(r,o){if(r&1&&(i(0,"li",33)(1,"span",34),n(2),e(),i(3,"span",35),n(4),e(),f(5,ie,6,0)(6,ne,2,0,"button",36),e()),r&2){let t=o.$implicit,l=s(6);d(2),p(t.name),d(2),p(t.subtitle),d(),g(l.isPendingDelete(t)?5:6)}}function re(r,o){if(r&1&&(i(0,"h3",31),n(1,"AI Providers"),e(),i(2,"ul",32),P(3,oe,7,3,"li",33,E().trackEntry,!0),e()),r&2){let t=s(5);d(3),S(t.recap().aiProviders)}}function le(r,o){if(r&1&&(f(0,te,5,0),f(1,re,5,0)),r&2){let t=s(4);g(t.recap().integrations.length>0?0:-1),d(),g(t.recap().aiProviders.length>0?1:-1)}}function ae(r,o){if(r&1&&f(0,W,2,0,"p",30)(1,le,2,2),r&2){let t=s(3);g(t.recap().total===0?0:1)}}function se(r,o){if(r&1){let t=x();i(0,"div",7)(1,"div",9)(2,"h2",10),n(3,"Identity"),e(),i(4,"div",11)(5,"span",12),n(6,"Email"),e(),i(7,"span",23),n(8),e()(),i(9,"div",11)(10,"span",12),n(11,"External ID"),e(),i(12,"span",23),n(13),e()()(),i(14,"div",9)(15,"h2",10),n(16,"Profile"),e(),i(17,"div",11)(18,"span",12),n(19,"First name"),e(),i(20,"span",23),n(21),e()(),i(22,"div",11)(23,"span",12),n(24,"Last name"),e(),i(25,"span",23),n(26),e()(),i(27,"div",24)(28,"span",12),n(29,"Bio"),e(),i(30,"span",23),n(31),e()()(),i(32,"div",20)(33,"button",25),c("click",function(){m(t);let a=s(2);return u(a.startEditing())}),n(34," Edit profile "),e()(),i(35,"div",26)(36,"button",27),c("click",function(){m(t);let a=s(2);return u(a.toggleOverrides())}),i(37,"span",28),n(38,"\u25B6"),e(),n(39," Mes configurations utilisateur globales "),i(40,"span",29),n(41),e()(),f(42,ae,2,1),e()()}if(r&2){let t=s(),l=s();d(8),p(t.email),d(5),p(t.externalId),d(8),p(t.firstname||"\u2014"),d(5),p(t.lastname||"\u2014"),d(5),p(t.bio||"\u2014"),d(5),I("aria-expanded",l.isOverridesExpanded()),d(),T("user-profile__overrides-arrow--open",l.isOverridesExpanded()),d(4),k("(",l.recap().total,")"),d(),g(l.isOverridesExpanded()?42:-1)}}function de(r,o){if(r&1&&f(0,Q,34,5,"form",6)(1,se,43,10,"div",7),r&2){let t=s();g(t.isEditing()?0:1)}}function _e(r,o){r&1&&(i(0,"p",5),n(1,"Unable to load profile."),e())}var H=class r{userState=C(Y);router=C(F);location=C(V);destroyRef=C(U);integrationState=C(j);providerState=C(q);isEditing=v(!1);isLoading=v(!1);isSaving=v(!1);isOverridesExpanded=v(!1);currentUser=this.userState.currentUser;form=new $({firstname:new y("",{nonNullable:!0}),lastname:new y("",{nonNullable:!0}),bio:new y("",{nonNullable:!0})});recap=B(O([this.integrationState.userGlobal$,this.providerState.userGlobal$]).pipe(M(([o,t])=>{let l=o.map(_=>({category:"integration",id:_.id??"",name:_.name,subtitle:_.integrationType})),a=t.map(_=>({category:"aiProvider",id:_.id??"",name:_.name,subtitle:_.apiType}));return{integrations:l,aiProviders:a,total:l.length+a.length}})),{initialValue:{integrations:[],aiProviders:[],total:0}});ngOnInit(){if(this.currentUser()){this.syncFormFromState();return}this.isLoading.set(!0),this.userState.loadMe().pipe(h(this.destroyRef)).subscribe({next:()=>{this.syncFormFromState(),this.isLoading.set(!1)},error:()=>this.isLoading.set(!1)})}startEditing(){this.syncFormFromState(),this.isEditing.set(!0)}cancelEditing(){this.isEditing.set(!1)}save(){this.isSaving()||(this.isSaving.set(!0),this.userState.updateMe({firstname:this.form.controls.firstname.value.trim()||void 0,lastname:this.form.controls.lastname.value.trim()||void 0,bio:this.form.controls.bio.value.trim()||void 0}).pipe(h(this.destroyRef)).subscribe({next:()=>{this.isSaving.set(!1),this.isEditing.set(!1)},error:()=>this.isSaving.set(!1)}))}toggleOverrides(){this.isOverridesExpanded.update(o=>!o),this.pendingDeleteKey.set(null)}pendingDeleteKey=v(null);isPendingDelete(o){return this.pendingDeleteKey()===this.entryKey(o)}armDelete(o){o.id&&this.pendingDeleteKey.set(this.entryKey(o))}cancelDelete(){this.pendingDeleteKey.set(null)}confirmDelete(o){if(!o.id)return;this.pendingDeleteKey.set(null),(o.category==="integration"?this.integrationState.delete(o.id,"userGlobal"):this.providerState.delete(o.id,"userGlobal")).pipe(h(this.destroyRef)).subscribe({error:l=>{console.error(`[UserProfile] Delete failed for ${o.category}:${o.id}:`,l)}})}entryKey(o){return`${o.category}:${o.id}`}goBack(){window.history.length>1?this.location.back():this.router.navigate(["/agentos"])}trackEntry(o,t){return this.entryKey(t)}syncFormFromState(){let o=this.currentUser();o&&this.form.setValue({firstname:o.firstname??"",lastname:o.lastname??"",bio:o.bio??""})}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=D({type:r,selectors:[["agentos-user-profile"]],decls:11,vars:1,consts:[[1,"user-profile"],[1,"user-profile__header"],["type","button","title","Go back",1,"user-profile__back",3,"click"],[1,"user-profile__back-icon"],[1,"user-profile__title"],[1,"user-profile__loading"],[1,"user-profile__form",3,"formGroup"],[1,"user-profile__view"],[1,"user-profile__form",3,"ngSubmit","formGroup"],[1,"user-profile__section"],[1,"user-profile__section-title"],[1,"user-profile__field"],[1,"user-profile__label"],[1,"user-profile__value","user-profile__value--readonly"],["for","up-firstname",1,"user-profile__label"],["id","up-firstname","type","text","placeholder","Your first name","formControlName","firstname","autocomplete","given-name",1,"user-profile__input"],["for","up-lastname",1,"user-profile__label"],["id","up-lastname","type","text","placeholder","Your last name","formControlName","lastname","autocomplete","family-name",1,"user-profile__input"],["for","up-bio",1,"user-profile__label"],["id","up-bio","placeholder","A short description about yourself","formControlName","bio","rows","4",1,"user-profile__input","user-profile__input--textarea"],[1,"user-profile__actions"],["type","submit",1,"user-profile__btn","user-profile__btn--primary",3,"disabled"],["type","button",1,"user-profile__btn",3,"click"],[1,"user-profile__value"],[1,"user-profile__field","user-profile__field--bio"],["type","button",1,"user-profile__btn","user-profile__btn--primary",3,"click"],[1,"user-profile__overrides"],["type","button",1,"user-profile__overrides-toggle",3,"click"],[1,"user-profile__overrides-arrow"],[1,"user-profile__overrides-count"],[1,"user-profile__overrides-empty"],[1,"user-profile__overrides-subtitle"],[1,"user-profile__overrides-list"],[1,"user-profile__overrides-row"],[1,"user-profile__overrides-name"],[1,"user-profile__overrides-subtitle-text"],["type","button",1,"user-profile__overrides-delete"],[1,"user-profile__overrides-confirm-label"],["type","button",1,"user-profile__overrides-delete","user-profile__overrides-delete--confirm",3,"click"],["type","button",1,"user-profile__overrides-delete",3,"click"]],template:function(t,l){if(t&1&&(i(0,"div",0)(1,"header",1)(2,"button",2),c("click",function(){return l.goBack()}),i(3,"span",3),n(4,"\u2190"),e(),n(5," Back "),e(),i(6,"h1",4),n(7,"My profile"),e()(),f(8,J,2,0,"p",5)(9,de,2,1)(10,_e,2,0,"p",5),e()),t&2){let a;d(8),g(l.isLoading()?8:(a=l.currentUser())?9:10,a)}},dependencies:[A,K,G,z,N,R,L],styles:[".user-profile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.user-profile__overrides[_ngcontent-%COMP%]{margin-top:1rem;padding-top:1rem;border-top:1px dashed var(--color-border)}.user-profile__overrides-toggle[_ngcontent-%COMP%]{background:transparent;border:none;padding:.25rem 0;font-size:.85rem;color:var(--color-text-secondary);cursor:pointer;display:flex;align-items:center;gap:.4rem}.user-profile__overrides-toggle[_ngcontent-%COMP%]:hover{color:var(--color-text)}.user-profile__overrides-arrow[_ngcontent-%COMP%]{display:inline-block;font-size:.65rem;transition:transform .15s ease}.user-profile__overrides-arrow--open[_ngcontent-%COMP%]{transform:rotate(90deg)}.user-profile__overrides-count[_ngcontent-%COMP%]{color:var(--color-text-tertiary)}.user-profile__overrides-empty[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary);font-style:italic;padding:.5rem 0 0;margin:0}.user-profile__overrides-subtitle[_ngcontent-%COMP%]{font-size:.75rem;text-transform:uppercase;letter-spacing:.04em;color:var(--color-text-tertiary);margin:.75rem 0 .25rem}.user-profile__overrides-list[_ngcontent-%COMP%]{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:.25rem}.user-profile__overrides-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.4rem .5rem;font-size:.85rem;border-radius:6px}.user-profile__overrides-row[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover)}.user-profile__overrides-name[_ngcontent-%COMP%]{flex:1;color:var(--color-text);font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-profile__overrides-subtitle-text[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary);font-family:monospace}.user-profile__overrides-delete[_ngcontent-%COMP%]{background:transparent;border:none;font-size:.75rem;color:var(--color-error);cursor:pointer;padding:.2rem .4rem;border-radius:4px}.user-profile__overrides-delete[_ngcontent-%COMP%]:hover{background:color-mix(in srgb,var(--color-error) 12%,transparent)}.user-profile__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.user-profile__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.user-profile__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.user-profile__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.user-profile__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.user-profile__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.user-profile__view[_ngcontent-%COMP%], .user-profile__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem}.user-profile__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.user-profile__section-title[_ngcontent-%COMP%]{margin:0;font-size:.75rem;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--color-text-secondary, #6e6e73);border-bottom:1px solid var(--color-border-light, rgba(0, 0, 0, .06));padding-bottom:.5rem}.user-profile__field[_ngcontent-%COMP%]{display:grid;grid-template-columns:140px 1fr;align-items:baseline;gap:.75rem}.user-profile__field--bio[_ngcontent-%COMP%]{align-items:start}.user-profile__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);white-space:nowrap}.user-profile__value[_ngcontent-%COMP%]{font-size:.9375rem;color:var(--color-text, #1d1d1f);word-break:break-word;white-space:pre-wrap}.user-profile__value--readonly[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.875rem}.user-profile__input[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease;resize:none}.user-profile__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.user-profile__input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.user-profile__input--textarea[_ngcontent-%COMP%]{line-height:1.5;resize:vertical}.user-profile__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.user-profile__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.user-profile__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.user-profile__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.user-profile__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.user-profile__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};export{H as UserProfileComponent};
@@ -1 +1 @@
1
- import{a as X}from"./chunk-EH6JCC5E.js";import{a as Y}from"./chunk-KSFXR4QE.js";import"./chunk-T3IUNA6F.js";import"./chunk-JYJUTZMA.js";import{g as L}from"./chunk-4OIHXCET.js";import{b as D,d as R}from"./chunk-4GVABYH4.js";import{q as W}from"./chunk-VDRETD5H.js";import"./chunk-BUA6GPP7.js";import{a as v,c as x}from"./chunk-V363EHJE.js";import"./chunk-Z7E7NSDY.js";import"./chunk-ZEMOOOQR.js";import{F as Q,c as B,e as y,g as z,h as A,i as G,l as u,n as q,p as j,s as $,w as U,x as J,y as H,z as K}from"./chunk-HZF57OLY.js";import"./chunk-EF2BOSEH.js";import{Bb as k,Db as g,Fb as p,Ka as a,Tb as l,Ub as h,Vb as N,Wa as w,ca as m,ga as _,ha as C,kb as S,kc as V,lb as I,ma as E,mb as M,pb as O,qb as P,rb as s,sb as i,ta as d,tb as o,ua as F,ub as b}from"./chunk-B4RKRLIY.js";function ee(r,e){r&1&&(i(0,"p",5),l(1,"Loading\u2026"),o())}function te(r,e){if(r&1&&(i(0,"label",10),b(1,"input",25),i(2,"span"),l(3),o()()),r&2){let t=e.$implicit,n=p(2);a(),s("value",t.value)("formControl",n.scopeControl)("disabled",t.value==="namespace"&&!n.isAdmin()),a(2),h(t.label)}}function ne(r,e){if(r&1&&(i(0,"option",16),l(1),o()),r&2){let t=e.$implicit;s("value",t.type),a(),h(t.displayName)}}function oe(r,e){if(r&1){let t=k();i(0,"div",21)(1,"ds-json-schema-form",26),g("valueChange",function(c){_(t);let f=p(2);return C(f.onParamsChange(c))}),o()()}if(r&2){let t=p(2);a(),s("schema",e)("value",t.initialParams())}}function ie(r,e){if(r&1){let t=k();i(0,"form",7),g("ngSubmit",function(){_(t);let c=p();return C(c.submit())}),i(1,"fieldset",8)(2,"legend",9),l(3,"Scope"),o(),O(4,te,4,4,"label",10,S().trackByScope,!0),o(),i(6,"div",11)(7,"label",12),l(8,"Type "),i(9,"span",13),l(10,"*"),o()(),i(11,"select",14)(12,"option",15),l(13,"Select type"),o(),O(14,ne,2,2,"option",16,S().trackByType,!0),o()(),i(16,"div",11)(17,"label",17),l(18,"Name "),i(19,"span",13),l(20,"*"),o()(),b(21,"input",18),o(),i(22,"div",11)(23,"label",19),l(24,"Description"),o(),b(25,"textarea",20),o(),I(26,oe,2,2,"div",21),i(27,"div",22)(28,"button",23),l(29),o(),i(30,"button",24),g("click",function(){_(t);let c=p();return C(c.cancel())}),l(31,"Cancel"),o()()()}if(r&2){let t,n=p();s("formGroup",n.form),a(),s("disabled",n.isEditMode()),a(3),P(n.scopeOptions),a(7),s("formControl",n.typeControl),a(3),P(n.integrationTypes()),a(7),s("formControl",n.nameControl),a(4),s("formControl",n.descriptionControl),a(),M((t=n.schema())?26:-1,t),a(2),s("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),a(),N(" ",n.isEditMode()?"Save changes":"Create"," ")}}var re=new Set(["namespace","userOnNs","userGlobal"]),T=Object.freeze({namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),Z=class r{route=m(D);router=m(R);destroyRef=m(E);state=m(X);integrationTypeController=m(L);namespaceRole=m(Y);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=x(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:!1});form=new G({name:new u("",{nonNullable:!0,validators:[y.required,y.minLength(1)]}),description:new u(null),type:new u("",{nonNullable:!0,validators:[y.required]}),scope:new u("namespace",{nonNullable:!0})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get typeControl(){return this.form.controls.type}get scopeControl(){return this.form.controls.scope}isEditMode=d(!1);isSubmitting=d(!1);isLoading=d(!1);scopeOptions=[{value:"namespace",label:T.namespace},{value:"userOnNs",label:T.userOnNs},{value:"userGlobal",label:T.userGlobal}];paramsValue=d(null);initialParams=d(null);integrationTypes=x(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=x(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});schema=V(()=>{let e=this.selectedType();return e?this.integrationTypes().find(n=>n.type===e)?.configSchema??null:null});existingConfig=null;constructor(){F(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs")})}ngOnInit(){this.state.setNamespace(this.namespaceId);let e=this.route.snapshot.paramMap,t=this.route.snapshot.queryParamMap,n=e.get("integrationId"),c=this.parseScope(t.get("scope"));if(n){this.isEditMode.set(!0),this.scopeControl.disable(),this.loadConfig(n);return}this.scopeControl.setValue(c);let f=t.get("template");f&&this.hydrateFromTemplate(f)}parseScope(e){return e&&re.has(e)?e:"namespace"}deriveScopeFromConfig(e){return!e.userId?"namespace":e.namespaceId?"userOnNs":"userGlobal"}loadConfig(e){this.isLoading.set(!0),this.state.getById(e).pipe(v(this.destroyRef)).subscribe({next:t=>{this.existingConfig=t,this.scopeControl.setValue(this.deriveScopeFromConfig(t)),this.applyConfigToForm(t),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),console.warn(`[IntegrationForm] Could not load config '${e}' \u2014 navigating back`),this.navigateBack()}})}hydrateFromTemplate(e){this.isLoading.set(!0),this.state.getById(e).pipe(v(this.destroyRef)).subscribe({next:t=>{this.applyConfigToForm(t),this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})},error:t=>{console.warn(`[IntegrationForm] Could not hydrate from template ${e}:`,t),this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})}})}applyConfigToForm(e){this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.typeControl.setValue(e.integrationType),this.initialParams.set(e.parameters),this.paramsValue.set(e.parameters)}onParamsChange(e){this.paramsValue.set(e)}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(!0);let e=this.descriptionControl.value?.trim(),t={name:this.nameControl.value.trim(),description:e||null,integrationType:this.typeControl.value,parameters:this.paramsValue()},n=this.form.getRawValue().scope;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,t,n,this.existingConfig):this.state.create(t,n,this.namespaceId)).pipe(v(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(!1)})}cancel(){this.navigateBack()}navigateBack(){this.router.navigate(["/agentos",this.namespaceId,"integrations"])}trackByType(e,t){return t.type}trackByScope(e,t){return t.value}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=w({type:r,selectors:[["agentos-integration-form"]],decls:10,vars:2,consts:[[1,"integration-form"],[1,"integration-form__header"],["type","button","title","Back to integrations",1,"integration-form__back",3,"click"],[1,"integration-form__back-icon"],[1,"integration-form__title"],[1,"integration-form__loading"],[1,"integration-form__form",3,"formGroup"],[1,"integration-form__form",3,"ngSubmit","formGroup"],[1,"integration-form__field","integration-form__scope",3,"disabled"],[1,"integration-form__label"],[1,"integration-form__scope-option"],[1,"integration-form__field"],["for","integration-type",1,"integration-form__label"],["aria-hidden","true"],["id","integration-type",1,"integration-form__select",3,"formControl"],["value","","disabled",""],[3,"value"],["for","integration-name",1,"integration-form__label"],["id","integration-name","type","text","placeholder","Integration name","autocomplete","off",1,"integration-form__input",3,"formControl"],["for","integration-description",1,"integration-form__label"],["id","integration-description","placeholder","Optional description","rows","3",1,"integration-form__textarea",3,"formControl"],[1,"integration-form__schema-form"],[1,"integration-form__actions"],["type","submit",1,"integration-form__btn","integration-form__btn--primary",3,"disabled"],["type","button",1,"integration-form__btn",3,"click"],["type","radio",3,"value","formControl","disabled"],[3,"valueChange","schema","value"]],template:function(t,n){t&1&&(i(0,"div",0)(1,"header",1)(2,"button",2),g("click",function(){return n.cancel()}),i(3,"span",3),l(4,"\u2190"),o(),l(5," Integrations "),o(),i(6,"h1",4),l(7),o()(),I(8,ee,2,0,"p",5)(9,ie,32,8,"form",6),o()),t&2&&(a(7),h(n.isEditMode()?"Edit integration":"New integration"),a(),M(n.isLoading()?8:9))},dependencies:[Q,q,H,K,B,J,j,z,A,$,U,W],styles:[".integration-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.integration-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.integration-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.integration-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.integration-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.integration-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.integration-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.integration-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.integration-form__scope[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;border:1px solid var(--color-border-light, rgba(0, 0, 0, .06));border-radius:10px;padding:.75rem 1rem;background:transparent;margin:0}.integration-form__scope[disabled][_ngcontent-%COMP%]{opacity:.6}.integration-form__scope-option[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;color:var(--color-text, #1d1d1f);cursor:pointer}.integration-form__scope-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin:0}.integration-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.integration-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.integration-form__input[_ngcontent-%COMP%], .integration-form__textarea[_ngcontent-%COMP%], .integration-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.integration-form__input[_ngcontent-%COMP%]:focus, .integration-form__textarea[_ngcontent-%COMP%]:focus, .integration-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.integration-form__input[_ngcontent-%COMP%]::placeholder, .integration-form__textarea[_ngcontent-%COMP%]::placeholder, .integration-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.integration-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:4.5rem;line-height:1.5}.integration-form__select[_ngcontent-%COMP%]{cursor:pointer}.integration-form__select[_ngcontent-%COMP%] option[disabled][_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73)}.integration-form__schema-form[_ngcontent-%COMP%]{padding:1rem;border-radius:10px;border:1px solid var(--color-border-light, rgba(0, 0, 0, .06));background:var(--glass-bg, rgba(255, 255, 255, .5));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px))}.integration-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.integration-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.integration-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.integration-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.integration-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.integration-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};export{Z as IntegrationFormComponent};
1
+ import{a as X}from"./chunk-2AWAFPH4.js";import{a as Y}from"./chunk-YXLZUZJS.js";import"./chunk-T3IUNA6F.js";import"./chunk-KMEAKE32.js";import{g as L}from"./chunk-34PTVFRS.js";import{b as D,d as R}from"./chunk-4GVABYH4.js";import{q as W}from"./chunk-VDRETD5H.js";import"./chunk-BUA6GPP7.js";import{a as v,c as x}from"./chunk-V363EHJE.js";import"./chunk-Z7E7NSDY.js";import"./chunk-ZEMOOOQR.js";import{F as Q,c as B,e as y,g as z,h as A,i as G,l as u,n as q,p as j,s as $,w as U,x as J,y as H,z as K}from"./chunk-HZF57OLY.js";import"./chunk-EF2BOSEH.js";import{Bb as k,Db as g,Fb as p,Ka as a,Tb as l,Ub as h,Vb as N,Wa as w,ca as m,ga as _,ha as C,kb as S,kc as V,lb as I,ma as E,mb as M,pb as O,qb as P,rb as s,sb as i,ta as d,tb as o,ua as F,ub as b}from"./chunk-B4RKRLIY.js";function ee(r,e){r&1&&(i(0,"p",5),l(1,"Loading\u2026"),o())}function te(r,e){if(r&1&&(i(0,"label",10),b(1,"input",25),i(2,"span"),l(3),o()()),r&2){let t=e.$implicit,n=p(2);a(),s("value",t.value)("formControl",n.scopeControl)("disabled",t.value==="namespace"&&!n.isAdmin()),a(2),h(t.label)}}function ne(r,e){if(r&1&&(i(0,"option",16),l(1),o()),r&2){let t=e.$implicit;s("value",t.type),a(),h(t.displayName)}}function oe(r,e){if(r&1){let t=k();i(0,"div",21)(1,"ds-json-schema-form",26),g("valueChange",function(c){_(t);let f=p(2);return C(f.onParamsChange(c))}),o()()}if(r&2){let t=p(2);a(),s("schema",e)("value",t.initialParams())}}function ie(r,e){if(r&1){let t=k();i(0,"form",7),g("ngSubmit",function(){_(t);let c=p();return C(c.submit())}),i(1,"fieldset",8)(2,"legend",9),l(3,"Scope"),o(),O(4,te,4,4,"label",10,S().trackByScope,!0),o(),i(6,"div",11)(7,"label",12),l(8,"Type "),i(9,"span",13),l(10,"*"),o()(),i(11,"select",14)(12,"option",15),l(13,"Select type"),o(),O(14,ne,2,2,"option",16,S().trackByType,!0),o()(),i(16,"div",11)(17,"label",17),l(18,"Name "),i(19,"span",13),l(20,"*"),o()(),b(21,"input",18),o(),i(22,"div",11)(23,"label",19),l(24,"Description"),o(),b(25,"textarea",20),o(),I(26,oe,2,2,"div",21),i(27,"div",22)(28,"button",23),l(29),o(),i(30,"button",24),g("click",function(){_(t);let c=p();return C(c.cancel())}),l(31,"Cancel"),o()()()}if(r&2){let t,n=p();s("formGroup",n.form),a(),s("disabled",n.isEditMode()),a(3),P(n.scopeOptions),a(7),s("formControl",n.typeControl),a(3),P(n.integrationTypes()),a(7),s("formControl",n.nameControl),a(4),s("formControl",n.descriptionControl),a(),M((t=n.schema())?26:-1,t),a(2),s("disabled",n.nameControl.invalid||n.typeControl.invalid||n.isSubmitting()),a(),N(" ",n.isEditMode()?"Save changes":"Create"," ")}}var re=new Set(["namespace","userOnNs","userGlobal"]),T=Object.freeze({namespace:"Configuration du namespace",userOnNs:"Pour moi sur ce namespace",userGlobal:"Pour moi globalement"}),Z=class r{route=m(D);router=m(R);destroyRef=m(E);state=m(X);integrationTypeController=m(L);namespaceRole=m(Y);namespaceId=this.route.snapshot.params.namespaceId;isAdmin=x(this.namespaceRole.isAdminOfNamespace$(this.namespaceId),{initialValue:!1});form=new G({name:new u("",{nonNullable:!0,validators:[y.required,y.minLength(1)]}),description:new u(null),type:new u("",{nonNullable:!0,validators:[y.required]}),scope:new u("namespace",{nonNullable:!0})});get nameControl(){return this.form.controls.name}get descriptionControl(){return this.form.controls.description}get typeControl(){return this.form.controls.type}get scopeControl(){return this.form.controls.scope}isEditMode=d(!1);isSubmitting=d(!1);isLoading=d(!1);scopeOptions=[{value:"namespace",label:T.namespace},{value:"userOnNs",label:T.userOnNs},{value:"userGlobal",label:T.userGlobal}];paramsValue=d(null);initialParams=d(null);integrationTypes=x(this.integrationTypeController.listTypesIntegrationType(),{initialValue:[]});selectedType=x(this.form.controls.type.valueChanges,{initialValue:this.form.controls.type.value});schema=V(()=>{let e=this.selectedType();return e?this.integrationTypes().find(n=>n.type===e)?.configSchema??null:null});existingConfig=null;constructor(){F(()=>{this.isAdmin()||this.isEditMode()||this.scopeControl.value==="namespace"&&this.scopeControl.setValue("userOnNs")})}ngOnInit(){this.state.setNamespace(this.namespaceId);let e=this.route.snapshot.paramMap,t=this.route.snapshot.queryParamMap,n=e.get("integrationId"),c=this.parseScope(t.get("scope"));if(n){this.isEditMode.set(!0),this.scopeControl.disable(),this.loadConfig(n);return}this.scopeControl.setValue(c);let f=t.get("template");f&&this.hydrateFromTemplate(f)}parseScope(e){return e&&re.has(e)?e:"namespace"}deriveScopeFromConfig(e){return!e.userId?"namespace":e.namespaceId?"userOnNs":"userGlobal"}loadConfig(e){this.isLoading.set(!0),this.state.getById(e).pipe(v(this.destroyRef)).subscribe({next:t=>{this.existingConfig=t,this.scopeControl.setValue(this.deriveScopeFromConfig(t)),this.applyConfigToForm(t),this.isLoading.set(!1)},error:()=>{this.isLoading.set(!1),console.warn(`[IntegrationForm] Could not load config '${e}' \u2014 navigating back`),this.navigateBack()}})}hydrateFromTemplate(e){this.isLoading.set(!0),this.state.getById(e).pipe(v(this.destroyRef)).subscribe({next:t=>{this.applyConfigToForm(t),this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})},error:t=>{console.warn(`[IntegrationForm] Could not hydrate from template ${e}:`,t),this.isLoading.set(!1),this.router.navigate([],{relativeTo:this.route,queryParams:{template:null,templateScope:null},queryParamsHandling:"merge",replaceUrl:!0})}})}applyConfigToForm(e){this.nameControl.setValue(e.name),this.descriptionControl.setValue(e.description??null),this.typeControl.setValue(e.integrationType),this.initialParams.set(e.parameters),this.paramsValue.set(e.parameters)}onParamsChange(e){this.paramsValue.set(e)}submit(){if(this.nameControl.invalid||this.typeControl.invalid||this.isSubmitting())return;if(this.isEditMode()&&!this.existingConfig?.id){this.navigateBack();return}this.isSubmitting.set(!0);let e=this.descriptionControl.value?.trim(),t={name:this.nameControl.value.trim(),description:e||null,integrationType:this.typeControl.value,parameters:this.paramsValue()},n=this.form.getRawValue().scope;(this.isEditMode()&&this.existingConfig?.id?this.state.update(this.existingConfig.id,t,n,this.existingConfig):this.state.create(t,n,this.namespaceId)).pipe(v(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSubmitting.set(!1)})}cancel(){this.navigateBack()}navigateBack(){this.router.navigate(["/agentos",this.namespaceId,"integrations"])}trackByType(e,t){return t.type}trackByScope(e,t){return t.value}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=w({type:r,selectors:[["agentos-integration-form"]],decls:10,vars:2,consts:[[1,"integration-form"],[1,"integration-form__header"],["type","button","title","Back to integrations",1,"integration-form__back",3,"click"],[1,"integration-form__back-icon"],[1,"integration-form__title"],[1,"integration-form__loading"],[1,"integration-form__form",3,"formGroup"],[1,"integration-form__form",3,"ngSubmit","formGroup"],[1,"integration-form__field","integration-form__scope",3,"disabled"],[1,"integration-form__label"],[1,"integration-form__scope-option"],[1,"integration-form__field"],["for","integration-type",1,"integration-form__label"],["aria-hidden","true"],["id","integration-type",1,"integration-form__select",3,"formControl"],["value","","disabled",""],[3,"value"],["for","integration-name",1,"integration-form__label"],["id","integration-name","type","text","placeholder","Integration name","autocomplete","off",1,"integration-form__input",3,"formControl"],["for","integration-description",1,"integration-form__label"],["id","integration-description","placeholder","Optional description","rows","3",1,"integration-form__textarea",3,"formControl"],[1,"integration-form__schema-form"],[1,"integration-form__actions"],["type","submit",1,"integration-form__btn","integration-form__btn--primary",3,"disabled"],["type","button",1,"integration-form__btn",3,"click"],["type","radio",3,"value","formControl","disabled"],[3,"valueChange","schema","value"]],template:function(t,n){t&1&&(i(0,"div",0)(1,"header",1)(2,"button",2),g("click",function(){return n.cancel()}),i(3,"span",3),l(4,"\u2190"),o(),l(5," Integrations "),o(),i(6,"h1",4),l(7),o()(),I(8,ee,2,0,"p",5)(9,ie,32,8,"form",6),o()),t&2&&(a(7),h(n.isEditMode()?"Edit integration":"New integration"),a(),M(n.isLoading()?8:9))},dependencies:[Q,q,H,K,B,J,j,z,A,$,U,W],styles:[".integration-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.integration-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.integration-form__back[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.375rem;background:none;border:none;padding:0;cursor:pointer;font-size:.875rem;color:var(--color-primary, #007aff);font-family:inherit}.integration-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.integration-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.integration-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.integration-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.integration-form__form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.integration-form__scope[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;border:1px solid var(--color-border-light, rgba(0, 0, 0, .06));border-radius:10px;padding:.75rem 1rem;background:transparent;margin:0}.integration-form__scope[disabled][_ngcontent-%COMP%]{opacity:.6}.integration-form__scope-option[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;font-size:.875rem;color:var(--color-text, #1d1d1f);cursor:pointer}.integration-form__scope-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin:0}.integration-form__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.375rem}.integration-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.integration-form__input[_ngcontent-%COMP%], .integration-form__textarea[_ngcontent-%COMP%], .integration-form__select[_ngcontent-%COMP%]{width:100%;padding:.625rem .875rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;outline:none;box-sizing:border-box;transition:border-color .15s ease}.integration-form__input[_ngcontent-%COMP%]:focus, .integration-form__textarea[_ngcontent-%COMP%]:focus, .integration-form__select[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.integration-form__input[_ngcontent-%COMP%]::placeholder, .integration-form__textarea[_ngcontent-%COMP%]::placeholder, .integration-form__select[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.integration-form__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:4.5rem;line-height:1.5}.integration-form__select[_ngcontent-%COMP%]{cursor:pointer}.integration-form__select[_ngcontent-%COMP%] option[disabled][_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73)}.integration-form__schema-form[_ngcontent-%COMP%]{padding:1rem;border-radius:10px;border:1px solid var(--color-border-light, rgba(0, 0, 0, .06));background:var(--glass-bg, rgba(255, 255, 255, .5));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px))}.integration-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.integration-form__btn[_ngcontent-%COMP%]{padding:.6rem 1.25rem;border-radius:8px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.9375rem;font-family:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.integration-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.integration-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.integration-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.integration-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};export{Z as IntegrationFormComponent};
@@ -1 +1 @@
1
- import{c as a}from"./chunk-5TIYN4H7.js";import"./chunk-EPOA3PNE.js";import"./chunk-JYJUTZMA.js";import"./chunk-4OIHXCET.js";import"./chunk-4GVABYH4.js";import"./chunk-VDRETD5H.js";import"./chunk-BUA6GPP7.js";import"./chunk-V363EHJE.js";import"./chunk-Z7E7NSDY.js";import"./chunk-ZEMOOOQR.js";import"./chunk-HZF57OLY.js";import"./chunk-EF2BOSEH.js";import"./chunk-B4RKRLIY.js";export{a as CaseShellComponent};
1
+ import{c as a}from"./chunk-OCNVIYZQ.js";import"./chunk-DLRFM3KG.js";import"./chunk-KMEAKE32.js";import"./chunk-34PTVFRS.js";import"./chunk-4GVABYH4.js";import"./chunk-VDRETD5H.js";import"./chunk-BUA6GPP7.js";import"./chunk-V363EHJE.js";import"./chunk-Z7E7NSDY.js";import"./chunk-ZEMOOOQR.js";import"./chunk-HZF57OLY.js";import"./chunk-EF2BOSEH.js";import"./chunk-B4RKRLIY.js";export{a as CaseShellComponent};
@@ -1 +1 @@
1
- import{h as V}from"./chunk-4OIHXCET.js";import{d as E}from"./chunk-4GVABYH4.js";import{u as D,v as O}from"./chunk-VDRETD5H.js";import{a as N}from"./chunk-V363EHJE.js";import{Bb as I,Db as l,Fb as o,Hc as A,Ka as _,Pb as k,S as w,Tb as y,Ub as h,Wa as f,ab as M,ac as T,ca as g,dc as P,ec as L,ga as r,ha as m,hc as S,i as R,lb as C,ma as q,mb as v,oa as c,rb as u,sb as p,t as x,tb as d}from"./chunk-B4RKRLIY.js";function K(s,t){if(s&1&&(p(0,"span",3),y(1),d()),s&2){let e=o();_(),h(e.namespace.description)}}var b=class s{namespace;selected=new c;editRequested=new c;integrationsRequested=new c;aiProvidersRequested=new c;aiModelsRequested=new c;agentConfigsRequested=new c;deleteRequested=new c;menuItems=[{key:"edit",label:"Edit namespace",icon:"edit"},{key:"integrations",label:"Manage integrations",icon:"settings"},{key:"ai-providers",label:"AI Providers",icon:"smart_toy"},{key:"ai-models",label:"AI models",icon:"model_training"},{key:"agent-configs",label:"Agent Configs",icon:"support_agent"},{key:"delete",label:"Delete namespace",icon:"delete",variant:"danger"}];onSelect(){this.selected.emit(this.namespace)}onMenuAction(t){switch(t){case"edit":this.editRequested.emit(this.namespace);break;case"integrations":this.integrationsRequested.emit(this.namespace);break;case"ai-providers":this.aiProvidersRequested.emit(this.namespace);break;case"ai-models":this.aiModelsRequested.emit(this.namespace);break;case"agent-configs":this.agentConfigsRequested.emit(this.namespace);break;case"delete":confirm(`Delete namespace "${this.namespace.name}"?`)&&this.deleteRequested.emit(this.namespace);break}}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=f({type:s,selectors:[["agentos-namespace-item"]],inputs:{namespace:"namespace"},outputs:{selected:"selected",editRequested:"editRequested",integrationsRequested:"integrationsRequested",aiProvidersRequested:"aiProvidersRequested",aiModelsRequested:"aiModelsRequested",agentConfigsRequested:"agentConfigsRequested",deleteRequested:"deleteRequested"},decls:7,vars:3,consts:[["role","listitem",1,"namespace-item"],["type","button",1,"namespace-item__body",3,"click"],[1,"namespace-item__name"],[1,"namespace-item__desc"],[1,"namespace-item__actions"],[3,"itemSelected","items"]],template:function(e,a){e&1&&(p(0,"div",0)(1,"button",1),l("click",function(){return a.onSelect()}),p(2,"span",2),y(3),d(),C(4,K,2,1,"span",3),d(),p(5,"div",4)(6,"ds-kebab-menu",5),l("itemSelected",function(i){return a.onMenuAction(i)}),d()()()),e&2&&(_(3),h(a.namespace.name),_(),v(a.namespace.description?4:-1),_(2),u("items",a.menuItems))},dependencies:[O],styles:[".namespace-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.875rem 1.25rem;border-radius:10px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px));transition:background .15s ease,border-color .15s ease}.namespace-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-color:var(--color-primary, #007aff)}.namespace-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;align-items:flex-start;gap:.2rem;background:none;border:none;padding:0;cursor:pointer;text-align:left;min-width:0}.namespace-item__name[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.namespace-item__desc[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.namespace-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.namespace-item[_ngcontent-%COMP%]:hover .namespace-item__actions[_ngcontent-%COMP%], .namespace-item[_ngcontent-%COMP%]:focus-within .namespace-item__actions[_ngcontent-%COMP%]{opacity:1}"],changeDetection:0})};var j=()=>[];function z(s,t){if(s&1){let e=I();p(0,"agentos-namespace-item",3),l("selected",function(n){r(e);let i=o(2);return m(i.navigateToCases(n.id??""))})("editRequested",function(n){r(e);let i=o(2);return m(i.navigateToEdit(n))})("deleteRequested",function(n){r(e);let i=o(2);return m(i.deleteNamespace(n))})("integrationsRequested",function(n){r(e);let i=o(2);return m(i.openIntegrations(n))})("aiProvidersRequested",function(n){r(e);let i=o(2);return m(i.openAiProviders(n))})("aiModelsRequested",function(n){r(e);let i=o(2);return m(i.openAiModels(n))})("agentConfigsRequested",function(n){r(e);let i=o(2);return m(i.openAgentConfigs(n))}),d()}s&2&&u("namespace",t)}function U(s,t){if(s&1&&C(0,z,1,1,"agentos-namespace-item",2),s&2){let e,a=t.$implicit,n=o();v((e=n.resolveNamespace(a.id))?0:-1,e)}}var $=class s{router=g(E);namespaceController=g(V);destroyRef=g(q);refresh$=new R(void 0);namespaces$=this.refresh$.pipe(w(()=>this.namespaceController.listAllNamespace()));namespaceItems$=this.namespaces$.pipe(x(t=>t.map(e=>({id:e.id??"",name:e.name,description:e.description,badges:e.defaultAgentName?[{label:e.defaultAgentName,variant:"info"}]:void 0}))));namespacesById=new Map;constructor(){this.namespaces$.pipe(N(this.destroyRef)).subscribe(t=>{this.namespacesById=new Map(t.map(e=>[e.id??"",e]))})}navigateToCases(t){this.router.navigate(["/agentos",t,"cases"])}navigateToCreate(){this.router.navigate(["/agentos/namespaces/new"])}navigateToEdit(t){this.router.navigate(["/agentos/namespaces",t.id??"","edit"])}openIntegrations(t){this.router.navigate(["/agentos",t.id,"integrations"])}openAiProviders(t){this.router.navigate(["/agentos",t.id,"ai-providers"])}openAiModels(t){this.router.navigate(["/agentos",t.id,"ai-models"])}openAgentConfigs(t){this.router.navigate(["/agentos",t.id,"agent-configs"])}deleteNamespace(t){this.namespaceController.deleteNamespace(t.id??"").pipe(N(this.destroyRef)).subscribe(()=>this.refresh$.next())}resolveNamespace(t){return this.namespacesById.get(t)??null}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=f({type:s,selectors:[["agentos-namespace-list"]],decls:4,vars:6,consts:[["namespaceItemTpl",""],["title","Namespaces","emptyMessage","No namespaces yet. Create one to get started.","cardMinWidth","400px",3,"itemSelected","createRequested","items","showCreate","itemTemplate"],[3,"namespace"],[3,"selected","editRequested","deleteRequested","integrationsRequested","aiProvidersRequested","aiModelsRequested","agentConfigsRequested","namespace"]],template:function(e,a){if(e&1&&(p(0,"ds-entity-list",1),P(1,"async"),l("itemSelected",function(i){return a.navigateToCases(i)})("createRequested",function(){return a.navigateToCreate()}),d(),M(2,U,1,1,"ng-template",null,0,S)),e&2){let n=k(3);u("items",L(1,3,a.namespaceItems$)??T(5,j))("showCreate",!0)("itemTemplate",n)}},dependencies:[b,D,A],encapsulation:2})};export{b as a,$ as b};
1
+ import{h as V}from"./chunk-34PTVFRS.js";import{d as E}from"./chunk-4GVABYH4.js";import{u as D,v as O}from"./chunk-VDRETD5H.js";import{a as N}from"./chunk-V363EHJE.js";import{Bb as I,Db as l,Fb as o,Hc as A,Ka as _,Pb as k,S as w,Tb as y,Ub as h,Wa as f,ab as M,ac as T,ca as g,dc as P,ec as L,ga as r,ha as m,hc as S,i as R,lb as C,ma as q,mb as v,oa as c,rb as u,sb as p,t as x,tb as d}from"./chunk-B4RKRLIY.js";function K(s,t){if(s&1&&(p(0,"span",3),y(1),d()),s&2){let e=o();_(),h(e.namespace.description)}}var b=class s{namespace;selected=new c;editRequested=new c;integrationsRequested=new c;aiProvidersRequested=new c;aiModelsRequested=new c;agentConfigsRequested=new c;deleteRequested=new c;menuItems=[{key:"edit",label:"Edit namespace",icon:"edit"},{key:"integrations",label:"Manage integrations",icon:"settings"},{key:"ai-providers",label:"AI Providers",icon:"smart_toy"},{key:"ai-models",label:"AI models",icon:"model_training"},{key:"agent-configs",label:"Agent Configs",icon:"support_agent"},{key:"delete",label:"Delete namespace",icon:"delete",variant:"danger"}];onSelect(){this.selected.emit(this.namespace)}onMenuAction(t){switch(t){case"edit":this.editRequested.emit(this.namespace);break;case"integrations":this.integrationsRequested.emit(this.namespace);break;case"ai-providers":this.aiProvidersRequested.emit(this.namespace);break;case"ai-models":this.aiModelsRequested.emit(this.namespace);break;case"agent-configs":this.agentConfigsRequested.emit(this.namespace);break;case"delete":confirm(`Delete namespace "${this.namespace.name}"?`)&&this.deleteRequested.emit(this.namespace);break}}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=f({type:s,selectors:[["agentos-namespace-item"]],inputs:{namespace:"namespace"},outputs:{selected:"selected",editRequested:"editRequested",integrationsRequested:"integrationsRequested",aiProvidersRequested:"aiProvidersRequested",aiModelsRequested:"aiModelsRequested",agentConfigsRequested:"agentConfigsRequested",deleteRequested:"deleteRequested"},decls:7,vars:3,consts:[["role","listitem",1,"namespace-item"],["type","button",1,"namespace-item__body",3,"click"],[1,"namespace-item__name"],[1,"namespace-item__desc"],[1,"namespace-item__actions"],[3,"itemSelected","items"]],template:function(e,a){e&1&&(p(0,"div",0)(1,"button",1),l("click",function(){return a.onSelect()}),p(2,"span",2),y(3),d(),C(4,K,2,1,"span",3),d(),p(5,"div",4)(6,"ds-kebab-menu",5),l("itemSelected",function(i){return a.onMenuAction(i)}),d()()()),e&2&&(_(3),h(a.namespace.name),_(),v(a.namespace.description?4:-1),_(2),u("items",a.menuItems))},dependencies:[O],styles:[".namespace-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.875rem 1.25rem;border-radius:10px;border:1px solid var(--color-border, rgba(0, 0, 0, .08));background:var(--glass-bg, rgba(255, 255, 255, .72));-webkit-backdrop-filter:var(--glass-backdrop-blur, blur(20px));backdrop-filter:var(--glass-backdrop-blur, blur(20px));transition:background .15s ease,border-color .15s ease}.namespace-item[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .04));border-color:var(--color-primary, #007aff)}.namespace-item__body[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;align-items:flex-start;gap:.2rem;background:none;border:none;padding:0;cursor:pointer;text-align:left;min-width:0}.namespace-item__name[_ngcontent-%COMP%]{font-size:.95rem;font-weight:500;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.namespace-item__desc[_ngcontent-%COMP%]{font-size:.8rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.namespace-item__actions[_ngcontent-%COMP%]{flex-shrink:0;display:flex;align-items:center;gap:.125rem;opacity:0;transition:opacity .15s ease}.namespace-item[_ngcontent-%COMP%]:hover .namespace-item__actions[_ngcontent-%COMP%], .namespace-item[_ngcontent-%COMP%]:focus-within .namespace-item__actions[_ngcontent-%COMP%]{opacity:1}"],changeDetection:0})};var j=()=>[];function z(s,t){if(s&1){let e=I();p(0,"agentos-namespace-item",3),l("selected",function(n){r(e);let i=o(2);return m(i.navigateToCases(n.id??""))})("editRequested",function(n){r(e);let i=o(2);return m(i.navigateToEdit(n))})("deleteRequested",function(n){r(e);let i=o(2);return m(i.deleteNamespace(n))})("integrationsRequested",function(n){r(e);let i=o(2);return m(i.openIntegrations(n))})("aiProvidersRequested",function(n){r(e);let i=o(2);return m(i.openAiProviders(n))})("aiModelsRequested",function(n){r(e);let i=o(2);return m(i.openAiModels(n))})("agentConfigsRequested",function(n){r(e);let i=o(2);return m(i.openAgentConfigs(n))}),d()}s&2&&u("namespace",t)}function U(s,t){if(s&1&&C(0,z,1,1,"agentos-namespace-item",2),s&2){let e,a=t.$implicit,n=o();v((e=n.resolveNamespace(a.id))?0:-1,e)}}var $=class s{router=g(E);namespaceController=g(V);destroyRef=g(q);refresh$=new R(void 0);namespaces$=this.refresh$.pipe(w(()=>this.namespaceController.listAllNamespace()));namespaceItems$=this.namespaces$.pipe(x(t=>t.map(e=>({id:e.id??"",name:e.name,description:e.description,badges:e.defaultAgentName?[{label:e.defaultAgentName,variant:"info"}]:void 0}))));namespacesById=new Map;constructor(){this.namespaces$.pipe(N(this.destroyRef)).subscribe(t=>{this.namespacesById=new Map(t.map(e=>[e.id??"",e]))})}navigateToCases(t){this.router.navigate(["/agentos",t,"cases"])}navigateToCreate(){this.router.navigate(["/agentos/namespaces/new"])}navigateToEdit(t){this.router.navigate(["/agentos/namespaces",t.id??"","edit"])}openIntegrations(t){this.router.navigate(["/agentos",t.id,"integrations"])}openAiProviders(t){this.router.navigate(["/agentos",t.id,"ai-providers"])}openAiModels(t){this.router.navigate(["/agentos",t.id,"ai-models"])}openAgentConfigs(t){this.router.navigate(["/agentos",t.id,"agent-configs"])}deleteNamespace(t){this.namespaceController.deleteNamespace(t.id??"").pipe(N(this.destroyRef)).subscribe(()=>this.refresh$.next())}resolveNamespace(t){return this.namespacesById.get(t)??null}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=f({type:s,selectors:[["agentos-namespace-list"]],decls:4,vars:6,consts:[["namespaceItemTpl",""],["title","Namespaces","emptyMessage","No namespaces yet. Create one to get started.","cardMinWidth","400px",3,"itemSelected","createRequested","items","showCreate","itemTemplate"],[3,"namespace"],[3,"selected","editRequested","deleteRequested","integrationsRequested","aiProvidersRequested","aiModelsRequested","agentConfigsRequested","namespace"]],template:function(e,a){if(e&1&&(p(0,"ds-entity-list",1),P(1,"async"),l("itemSelected",function(i){return a.navigateToCases(i)})("createRequested",function(){return a.navigateToCreate()}),d(),M(2,U,1,1,"ng-template",null,0,S)),e&2){let n=k(3);u("items",L(1,3,a.namespaceItems$)??T(5,j))("showCreate",!0)("itemTemplate",n)}},dependencies:[b,D,A],encapsulation:2})};export{b as a,$ as b};
@@ -1 +1 @@
1
- import{a as w}from"./chunk-JYJUTZMA.js";import{j as M}from"./chunk-4OIHXCET.js";import{d as O}from"./chunk-4GVABYH4.js";import{a as S}from"./chunk-V363EHJE.js";import{Db as u,Fb as k,Ka as a,Rb as x,Tb as l,Ub as P,Wa as d,ca as i,lb as p,ma as f,mb as m,rb as v,sb as r,ta as h,tb as s,ub as b,vb as y,wb as C,xb as g}from"./chunk-B4RKRLIY.js";function H(e,t){e&1&&g(0,"span",1)}function D(e,t){e&1&&g(0,"span",2)}function B(e,t){e&1&&g(0,"span",3)}var _=class e{pluginService=i(M);online=h(null);ngOnInit(){this.pluginService.getAllPlugins().subscribe({next:()=>this.online.set(!0),error:()=>this.online.set(!1)})}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=d({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(n,o){if(n&1&&(y(0,"div",0),p(1,H,1,0,"span",1)(2,D,1,0,"span",2)(3,B,1,0,"span",3),C()),n&2){let c;a(),m((c=o.online())===!0?1:c===!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}}"]})};function U(e,t){if(e&1&&(r(0,"span",8),l(1),s()),e&2){let n=k();a(),P(n.userInitials)}}function A(e,t){e&1&&(r(0,"span",9),l(1,"\u25EF"),s())}var E=class e{router=i(O);userState=i(w);destroyRef=i(f);currentUser=this.userState.currentUser;navigateHome(){this.router.navigate(["/agentos"])}navigateToAdmin(){this.router.navigate(["/agentos/admin/users"])}ngOnInit(){this.currentUser()||this.userState.loadMe().pipe(S(this.destroyRef)).subscribe()}get userInitials(){let t=this.currentUser();if(!t)return"";let n=t.firstname?.[0]??"",o=t.lastname?.[0]??"";return(n+o).toUpperCase()||t.email?.[0]?.toUpperCase()||"?"}get isOnProfilePage(){return this.router.url.startsWith("/agentos/me")}toggleProfile(){this.isOnProfilePage?window.history.length>1?window.history.back():this.router.navigate(["/agentos"]):this.router.navigate(["/agentos/me"])}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=d({type:e,selectors:[["agentos-header"]],decls:13,vars:4,consts:[[1,"header"],["type","button","title","Home",1,"header__brand",3,"click"],["src","CODAY-Logo.png","alt","Coday",1,"header__logo-img"],[1,"header__logo-text"],[1,"header__nav"],["type","button","title","Admin",1,"header__admin-btn",3,"click"],[1,"header__admin-icon"],["type","button",1,"header__user-btn",3,"click","title"],[1,"header__user-initials"],[1,"header__user-icon"]],template:function(n,o){n&1&&(r(0,"header",0)(1,"button",1),u("click",function(){return o.navigateHome()}),b(2,"img",2),r(3,"span",3),l(4,"Coday"),s()(),r(5,"nav",4),b(6,"agentos-backend-status"),r(7,"button",5),u("click",function(){return o.navigateToAdmin()}),r(8,"span",6),l(9,"\u2699\uFE0F"),s()(),r(10,"button",7),u("click",function(){return o.toggleProfile()}),p(11,U,2,1,"span",8)(12,A,2,0,"span",9),s()()()),n&2&&(a(10),x("header__user-btn--active",o.isOnProfilePage),v("title",o.isOnProfilePage?"Back":"My profile"),a(),m(o.userInitials?11:12))},dependencies:[_],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;background:none;border:none;padding:0;cursor:pointer;border-radius:6px;transition:opacity .15s ease}.header__brand[_ngcontent-%COMP%]:hover{opacity:.7}.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}.header__admin-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;border:1.5px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--color-bg-secondary, rgba(0, 0, 0, .04));cursor:pointer;transition:background .15s ease,border-color .15s ease;padding:0;font-family:inherit;font-size:1rem;line-height:1}.header__admin-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .08));border-color:var(--color-primary, #007aff)}.header__admin-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.header__user-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;border:1.5px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--color-bg-secondary, rgba(0, 0, 0, .04));cursor:pointer;transition:background .15s ease,border-color .15s ease;padding:0;font-family:inherit}.header__user-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .08));border-color:var(--color-primary, #007aff)}.header__user-btn--active[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff)}.header__user-btn--active[_ngcontent-%COMP%] .header__user-initials[_ngcontent-%COMP%], .header__user-btn--active[_ngcontent-%COMP%] .header__user-icon[_ngcontent-%COMP%]{color:#fff}.header__user-initials[_ngcontent-%COMP%]{font-size:.75rem;font-weight:600;color:var(--color-text, #1d1d1f);line-height:1;letter-spacing:.02em}.header__user-icon[_ngcontent-%COMP%]{font-size:1rem;color:var(--color-text-secondary, #6e6e73);line-height:1}"]})};export{_ as a,E as b};
1
+ import{a as w}from"./chunk-KMEAKE32.js";import{j as M}from"./chunk-34PTVFRS.js";import{d as O}from"./chunk-4GVABYH4.js";import{a as S}from"./chunk-V363EHJE.js";import{Db as u,Fb as k,Ka as a,Rb as x,Tb as l,Ub as P,Wa as d,ca as i,lb as p,ma as f,mb as m,rb as v,sb as r,ta as h,tb as s,ub as b,vb as y,wb as C,xb as g}from"./chunk-B4RKRLIY.js";function H(e,t){e&1&&g(0,"span",1)}function D(e,t){e&1&&g(0,"span",2)}function B(e,t){e&1&&g(0,"span",3)}var _=class e{pluginService=i(M);online=h(null);ngOnInit(){this.pluginService.getAllPlugins().subscribe({next:()=>this.online.set(!0),error:()=>this.online.set(!1)})}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=d({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(n,o){if(n&1&&(y(0,"div",0),p(1,H,1,0,"span",1)(2,D,1,0,"span",2)(3,B,1,0,"span",3),C()),n&2){let c;a(),m((c=o.online())===!0?1:c===!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}}"]})};function U(e,t){if(e&1&&(r(0,"span",8),l(1),s()),e&2){let n=k();a(),P(n.userInitials)}}function A(e,t){e&1&&(r(0,"span",9),l(1,"\u25EF"),s())}var E=class e{router=i(O);userState=i(w);destroyRef=i(f);currentUser=this.userState.currentUser;navigateHome(){this.router.navigate(["/agentos"])}navigateToAdmin(){this.router.navigate(["/agentos/admin/users"])}ngOnInit(){this.currentUser()||this.userState.loadMe().pipe(S(this.destroyRef)).subscribe()}get userInitials(){let t=this.currentUser();if(!t)return"";let n=t.firstname?.[0]??"",o=t.lastname?.[0]??"";return(n+o).toUpperCase()||t.email?.[0]?.toUpperCase()||"?"}get isOnProfilePage(){return this.router.url.startsWith("/agentos/me")}toggleProfile(){this.isOnProfilePage?window.history.length>1?window.history.back():this.router.navigate(["/agentos"]):this.router.navigate(["/agentos/me"])}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=d({type:e,selectors:[["agentos-header"]],decls:13,vars:4,consts:[[1,"header"],["type","button","title","Home",1,"header__brand",3,"click"],["src","CODAY-Logo.png","alt","Coday",1,"header__logo-img"],[1,"header__logo-text"],[1,"header__nav"],["type","button","title","Admin",1,"header__admin-btn",3,"click"],[1,"header__admin-icon"],["type","button",1,"header__user-btn",3,"click","title"],[1,"header__user-initials"],[1,"header__user-icon"]],template:function(n,o){n&1&&(r(0,"header",0)(1,"button",1),u("click",function(){return o.navigateHome()}),b(2,"img",2),r(3,"span",3),l(4,"Coday"),s()(),r(5,"nav",4),b(6,"agentos-backend-status"),r(7,"button",5),u("click",function(){return o.navigateToAdmin()}),r(8,"span",6),l(9,"\u2699\uFE0F"),s()(),r(10,"button",7),u("click",function(){return o.toggleProfile()}),p(11,U,2,1,"span",8)(12,A,2,0,"span",9),s()()()),n&2&&(a(10),x("header__user-btn--active",o.isOnProfilePage),v("title",o.isOnProfilePage?"Back":"My profile"),a(),m(o.userInitials?11:12))},dependencies:[_],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;background:none;border:none;padding:0;cursor:pointer;border-radius:6px;transition:opacity .15s ease}.header__brand[_ngcontent-%COMP%]:hover{opacity:.7}.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}.header__admin-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;border:1.5px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--color-bg-secondary, rgba(0, 0, 0, .04));cursor:pointer;transition:background .15s ease,border-color .15s ease;padding:0;font-family:inherit;font-size:1rem;line-height:1}.header__admin-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .08));border-color:var(--color-primary, #007aff)}.header__admin-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.header__user-btn[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;border:1.5px solid var(--color-border, rgba(0, 0, 0, .1));background:var(--color-bg-secondary, rgba(0, 0, 0, .04));cursor:pointer;transition:background .15s ease,border-color .15s ease;padding:0;font-family:inherit}.header__user-btn[_ngcontent-%COMP%]:hover{background:var(--color-bg-hover, rgba(0, 0, 0, .08));border-color:var(--color-primary, #007aff)}.header__user-btn--active[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff)}.header__user-btn--active[_ngcontent-%COMP%] .header__user-initials[_ngcontent-%COMP%], .header__user-btn--active[_ngcontent-%COMP%] .header__user-icon[_ngcontent-%COMP%]{color:#fff}.header__user-initials[_ngcontent-%COMP%]{font-size:.75rem;font-weight:600;color:var(--color-text, #1d1d1f);line-height:1;letter-spacing:.02em}.header__user-icon[_ngcontent-%COMP%]{font-size:1rem;color:var(--color-text-secondary, #6e6e73);line-height:1}"]})};export{_ as a,E as b};