@whoz-oss/coday-client 0.128.0 → 0.129.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/{chunk-D6WU5O4X.js → chunk-2TT2VS4Q.js} +1 -1
- package/browser/{chunk-GVX63TKQ.js → chunk-2YPR6RKN.js} +1 -1
- package/browser/{chunk-6LO3ANKL.js → chunk-3CAK3MY2.js} +1 -1
- package/browser/{chunk-ZAM3WGZM.js → chunk-3DDLKUVJ.js} +1 -1
- package/browser/{chunk-7XSGZTN3.js → chunk-4AYGP75X.js} +1 -1
- package/browser/chunk-4KNZ7PUG.js +1 -0
- package/browser/{chunk-KYPWHL43.js → chunk-4XDVIAH5.js} +1 -1
- package/browser/{chunk-HSNVFCBN.js → chunk-6DNANWSF.js} +1 -1
- package/browser/{chunk-AK6F2DC7.js → chunk-6JH2UGTU.js} +1 -1
- package/browser/chunk-6MVTL5VJ.js +1 -0
- package/browser/chunk-7GBHCDC2.js +1 -0
- package/browser/{chunk-7CFO7WWZ.js → chunk-AHABNNMX.js} +1 -1
- package/browser/{chunk-Z26H5ES2.js → chunk-AKD5MBRD.js} +1 -1
- package/browser/chunk-B6DPIDKI.js +1 -0
- package/browser/{chunk-EPA5P2I6.js → chunk-BEKG4CZE.js} +1 -1
- package/browser/{chunk-3TO5PQRD.js → chunk-BYSD3PVJ.js} +1 -1
- package/browser/{chunk-LLDKKRUC.js → chunk-BZJFZW26.js} +1 -1
- package/browser/{chunk-ADWJAQMQ.js → chunk-CL3F6CYH.js} +1 -1
- package/browser/{chunk-WNNKQ2DH.js → chunk-CND4W2V5.js} +1 -1
- package/browser/chunk-CX2W2KP4.js +1 -0
- package/browser/{chunk-DVO44NIX.js → chunk-CXN4NTRD.js} +1 -1
- package/browser/chunk-DIZZ6MCJ.js +1 -0
- package/browser/{chunk-XJUBZLY2.js → chunk-DLU3TQID.js} +1 -1
- package/browser/{chunk-7T6Q4MDL.js → chunk-DPFJ6LFY.js} +1 -1
- package/browser/{chunk-MWWLTJ77.js → chunk-FAAHG43E.js} +1 -1
- package/browser/{chunk-KTPX26DH.js → chunk-FDCPX2YT.js} +1 -1
- package/browser/{chunk-YCJZTFYJ.js → chunk-FJR6WCPX.js} +1 -1
- package/browser/{chunk-VNCIHM33.js → chunk-FQSDA7SM.js} +1 -1
- package/browser/{chunk-IFXDK4GQ.js → chunk-FTMDL4HX.js} +1 -1
- package/browser/{chunk-XIQ3L6H6.js → chunk-G4QDBE4F.js} +1 -1
- package/browser/chunk-GYZJRAEL.js +1 -0
- package/browser/chunk-HCMK67ST.js +1 -0
- package/browser/chunk-HUWAPEGQ.js +1 -0
- package/browser/{chunk-DRBOHCTP.js → chunk-HY7OYHZF.js} +1 -1
- package/browser/{chunk-RQLQ22PM.js → chunk-HYNHL5RY.js} +1 -1
- package/browser/{chunk-3U3QVZEU.js → chunk-I75FDNMK.js} +1 -1
- package/browser/{chunk-TSDYLM5L.js → chunk-J6NHAJP2.js} +1 -1
- package/browser/{chunk-GEUVTKHG.js → chunk-KNY6WJUH.js} +1 -1
- package/browser/{chunk-AJOXSD6I.js → chunk-LCBWJP6Z.js} +1 -1
- package/browser/{chunk-QWMDAFBN.js → chunk-LTFITYTW.js} +1 -1
- package/browser/{chunk-7A54VTP2.js → chunk-MLNEYB77.js} +1 -1
- package/browser/{chunk-VGRGY2U3.js → chunk-MO6H3TK3.js} +1 -1
- package/browser/{chunk-EU3J4G2Y.js → chunk-NEINI73V.js} +1 -1
- package/browser/{chunk-UORJVNGU.js → chunk-NLRFBAA2.js} +1 -1
- package/browser/chunk-NV3MNDVJ.js +1 -0
- package/browser/{chunk-NZDKKDRG.js → chunk-OBMXZUQM.js} +1 -1
- package/browser/{chunk-IJ2YZMNS.js → chunk-OHLGZXEO.js} +1 -1
- package/browser/chunk-OMENROC2.js +1 -0
- package/browser/{chunk-QSQYSFNQ.js → chunk-OSX2KHVN.js} +1 -1
- package/browser/{chunk-I5OT3IGD.js → chunk-Q74LPU7S.js} +1 -1
- package/browser/{chunk-YXFL2FTT.js → chunk-QDQW667Q.js} +1 -1
- package/browser/{chunk-WPC6XC7P.js → chunk-QFSZDRP2.js} +1 -1
- package/browser/chunk-R2OQMKB5.js +1 -0
- package/browser/{chunk-DE5MXWYR.js → chunk-R3DKNIV5.js} +1 -1
- package/browser/chunk-R5RVDZLX.js +1 -0
- package/browser/{chunk-JWEUUCFC.js → chunk-RAJZGLER.js} +1 -1
- package/browser/{chunk-3JGMGRXW.js → chunk-RNXBUYHW.js} +2 -2
- package/browser/{chunk-B2QA6UZX.js → chunk-SDLTQWY6.js} +1 -1
- package/browser/{chunk-FFMGEAGW.js → chunk-SHWW6WRB.js} +1 -1
- package/browser/{chunk-WQUBEVZN.js → chunk-SI36SMXC.js} +1 -1
- package/browser/{chunk-AQ3SEH2N.js → chunk-SKVQOMLG.js} +1 -1
- package/browser/{chunk-NAQEVUOV.js → chunk-SQWEKOLS.js} +1 -1
- package/browser/{chunk-SDNXWYG5.js → chunk-T2JHUF63.js} +1 -1
- package/browser/chunk-T2LG7TT2.js +1 -0
- package/browser/{chunk-U4662WTU.js → chunk-TY4VCUP2.js} +1 -1
- package/browser/{chunk-IXD43YQI.js → chunk-UQNMPA5Y.js} +1 -1
- package/browser/chunk-WBRWLEC2.js +1 -0
- package/browser/{chunk-MVATXMLV.js → chunk-WC5DQJKZ.js} +1 -1
- package/browser/{chunk-IZFHJAEI.js → chunk-YBAY4MP6.js} +1 -1
- package/browser/{chunk-RHFQ7GO2.js → chunk-ZQJGEWGV.js} +1 -1
- package/browser/index.html +1 -1
- package/browser/{main-YSLZYJ4P.js → main-XJQHXNY2.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-3D3KN52V.js +0 -1
- package/browser/chunk-3YSNMKXU.js +0 -1
- package/browser/chunk-5B6P72NR.js +0 -1
- package/browser/chunk-B2FFL2F7.js +0 -1
- package/browser/chunk-FPNKDL3E.js +0 -1
- package/browser/chunk-GAZJZBKP.js +0 -1
- package/browser/chunk-GG2XORTA.js +0 -1
- package/browser/chunk-H6Q42HHV.js +0 -1
- package/browser/chunk-I5EEQETN.js +0 -1
- package/browser/chunk-O3U2KGCT.js +0 -1
- package/browser/chunk-ONXSTLRN.js +0 -1
- package/browser/chunk-QU37OGFO.js +0 -1
- package/browser/chunk-QXZ6AR76.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{E as B,k as d}from"./chunk-B2QA6UZX.js";import{D as N,Fa as g,G as M,Gb as D,Hb as z,K as R,O as b,Rb as O,Rc as $,Sb as H,Uc as j,V as v,Wa as x,Xa as U,Z as A,_ as T,aa as E,ba as _,ca as c,e as F,jb as P,la as I,m as u,mc as k,n as w,qa as S,t as m,tc as W,ya as L,z as y}from"./chunk-3JGMGRXW.js";function V(i){return Error(`Unable to find icon with the name "${i}"`)}function X(){return Error("Could not find HttpClient for use with Angular Material icons. Please add provideHttpClient() to your providers.")}function q(i){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${i}".`)}function Y(i){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${i}".`)}var a=class{url;svgText;options;svgElement=null;constructor(l,t,e){this.url=l,this.svgText=t,this.options=e}},K=(()=>{class i{_httpClient;_sanitizer;_errorHandler;_document;_svgIconConfigs=new Map;_iconSetConfigs=new Map;_cachedIconsByUrl=new Map;_inProgressUrlFetches=new Map;_fontCssClassesByAlias=new Map;_resolvers=[];_defaultFontSetClass=["material-icons","mat-ligature-font"];constructor(t,e,n,o){this._httpClient=t,this._sanitizer=e,this._errorHandler=o,this._document=n}addSvgIcon(t,e,n){return this.addSvgIconInNamespace("",t,e,n)}addSvgIconLiteral(t,e,n){return this.addSvgIconLiteralInNamespace("",t,e,n)}addSvgIconInNamespace(t,e,n,o){return this._addSvgIconConfig(t,e,new a(n,null,o))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,e,n,o){let r=this._sanitizer.sanitize(g.HTML,n);if(!r)throw Y(n);let s=d(r);return this._addSvgIconConfig(t,e,new a("",s,o))}addSvgIconSet(t,e){return this.addSvgIconSetInNamespace("",t,e)}addSvgIconSetLiteral(t,e){return this.addSvgIconSetLiteralInNamespace("",t,e)}addSvgIconSetInNamespace(t,e,n){return this._addSvgIconSetConfig(t,new a(e,null,n))}addSvgIconSetLiteralInNamespace(t,e,n){let o=this._sanitizer.sanitize(g.HTML,e);if(!o)throw Y(e);let r=d(o);return this._addSvgIconSetConfig(t,new a("",r,n))}registerFontClassAlias(t,e=t){return this._fontCssClassesByAlias.set(t,e),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(...t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){let e=this._sanitizer.sanitize(g.RESOURCE_URL,t);if(!e)throw q(t);let n=this._cachedIconsByUrl.get(e);return n?u(C(n)):this._loadSvgIconFromConfig(new a(t,null)).pipe(v(o=>this._cachedIconsByUrl.set(e,o)),m(o=>C(o)))}getNamedSvgIcon(t,e=""){let n=J(e,t),o=this._svgIconConfigs.get(n);if(o)return this._getSvgFromConfig(o);if(o=this._getIconConfigFromResolvers(e,t),o)return this._svgIconConfigs.set(n,o),this._getSvgFromConfig(o);let r=this._iconSetConfigs.get(e);return r?this._getSvgFromIconSetConfigs(t,r):w(V(n))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?u(C(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(m(e=>C(e)))}_getSvgFromIconSetConfigs(t,e){let n=this._extractIconWithNameFromAnySet(t,e);if(n)return u(n);let o=e.filter(r=>!r.svgText).map(r=>this._loadSvgIconSetFromConfig(r).pipe(N(s=>{let f=`Loading icon set URL: ${this._sanitizer.sanitize(g.RESOURCE_URL,r.url)} failed: ${s.message}`;return this._errorHandler.handleError(new Error(f)),u(null)})));return y(o).pipe(m(()=>{let r=this._extractIconWithNameFromAnySet(t,e);if(!r)throw V(t);return r}))}_extractIconWithNameFromAnySet(t,e){for(let n=e.length-1;n>=0;n--){let o=e[n];if(o.svgText&&o.svgText.toString().indexOf(t)>-1){let r=this._svgElementFromConfig(o),s=this._extractSvgIconFromSet(r,t,o.options);if(s)return s}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe(v(e=>t.svgText=e),m(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?u(null):this._fetchIcon(t).pipe(v(e=>t.svgText=e))}_extractSvgIconFromSet(t,e,n){let o=t.querySelector(`[id="${e}"]`);if(!o)return null;let r=o.cloneNode(!0);if(r.removeAttribute("id"),r.nodeName.toLowerCase()==="svg")return this._setSvgAttributes(r,n);if(r.nodeName.toLowerCase()==="symbol")return this._setSvgAttributes(this._toSvgElement(r),n);let s=this._svgElementFromString(d("<svg></svg>"));return s.appendChild(r),this._setSvgAttributes(s,n)}_svgElementFromString(t){let e=this._document.createElement("DIV");e.innerHTML=t;let n=e.querySelector("svg");if(!n)throw Error("<svg> tag not found");return n}_toSvgElement(t){let e=this._svgElementFromString(d("<svg></svg>")),n=t.attributes;for(let o=0;o<n.length;o++){let{name:r,value:s}=n[o];r!=="id"&&e.setAttribute(r,s)}for(let o=0;o<t.childNodes.length;o++)t.childNodes[o].nodeType===this._document.ELEMENT_NODE&&e.appendChild(t.childNodes[o].cloneNode(!0));return e}_setSvgAttributes(t,e){return t.setAttribute("fit",""),t.setAttribute("height","100%"),t.setAttribute("width","100%"),t.setAttribute("preserveAspectRatio","xMidYMid meet"),t.setAttribute("focusable","false"),e&&e.viewBox&&t.setAttribute("viewBox",e.viewBox),t}_fetchIcon(t){let{url:e,options:n}=t,o=n?.withCredentials??!1;if(!this._httpClient)throw X();if(e==null)throw Error(`Cannot fetch icon from URL "${e}".`);let r=this._sanitizer.sanitize(g.RESOURCE_URL,e);if(!r)throw q(e);let s=this._inProgressUrlFetches.get(r);if(s)return s;let h=this._httpClient.get(r,{responseType:"text",withCredentials:o}).pipe(m(f=>d(f)),R(()=>this._inProgressUrlFetches.delete(r)),b());return this._inProgressUrlFetches.set(r,h),h}_addSvgIconConfig(t,e,n){return this._svgIconConfigs.set(J(t,e),n),this}_addSvgIconSetConfig(t,e){let n=this._iconSetConfigs.get(t);return n?n.push(e):this._iconSetConfigs.set(t,[e]),this}_svgElementFromConfig(t){if(!t.svgElement){let e=this._svgElementFromString(t.svgText);this._setSvgAttributes(e,t.options),t.svgElement=e}return t.svgElement}_getIconConfigFromResolvers(t,e){for(let n=0;n<this._resolvers.length;n++){let o=this._resolvers[n](e,t);if(o)return Z(o)?new a(o.url,null,o.options):new a(o,null)}}static \u0275fac=function(e){return new(e||i)(_($,8),_(j),_(I,8),_(S))};static \u0275prov=A({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function C(i){return i.cloneNode(!0)}function J(i,l){return i+":"+l}function Z(i){return!!(i.url&&i.options)}var tt=["*"],et=new E("MAT_ICON_DEFAULT_OPTIONS"),nt=new E("mat-icon-location",{providedIn:"root",factory:()=>{let i=c(I),l=i?i.location:null;return{getPathname:()=>l?l.pathname+l.search:""}}}),G=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],ot=G.map(i=>`[${i}]`).join(", "),rt=/^url\(['"]?#(.*?)['"]?\)$/,yt=(()=>{class i{_elementRef=c(L);_iconRegistry=c(K);_location=c(nt);_errorHandler=c(S);_defaultColor;get color(){return this._color||this._defaultColor}set color(t){this._color=t}_color;inline=!1;get svgIcon(){return this._svgIcon}set svgIcon(t){t!==this._svgIcon&&(t?this._updateSvgIcon(t):this._svgIcon&&this._clearSvgElement(),this._svgIcon=t)}_svgIcon;get fontSet(){return this._fontSet}set fontSet(t){let e=this._cleanupFontValue(t);e!==this._fontSet&&(this._fontSet=e,this._updateFontIconClasses())}_fontSet;get fontIcon(){return this._fontIcon}set fontIcon(t){let e=this._cleanupFontValue(t);e!==this._fontIcon&&(this._fontIcon=e,this._updateFontIconClasses())}_fontIcon;_previousFontSetClass=[];_previousFontIconClass;_svgName=null;_svgNamespace=null;_previousPath;_elementsWithExternalReferences;_currentIconFetch=F.EMPTY;constructor(){let t=c(new k("aria-hidden"),{optional:!0}),e=c(et,{optional:!0});e&&(e.color&&(this.color=this._defaultColor=e.color),e.fontSet&&(this.fontSet=e.fontSet)),t||this._elementRef.nativeElement.setAttribute("aria-hidden","true")}_splitIconName(t){if(!t)return["",""];let e=t.split(":");switch(e.length){case 1:return["",e[0]];case 2:return e;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){let t=this._elementsWithExternalReferences;if(t&&t.size){let e=this._location.getPathname();e!==this._previousPath&&(this._previousPath=e,this._prependPathToReferences(e))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(t){this._clearSvgElement();let e=this._location.getPathname();this._previousPath=e,this._cacheChildrenWithExternalReferences(t),this._prependPathToReferences(e),this._elementRef.nativeElement.appendChild(t)}_clearSvgElement(){let t=this._elementRef.nativeElement,e=t.childNodes.length;for(this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear();e--;){let n=t.childNodes[e];(n.nodeType!==1||n.nodeName.toLowerCase()==="svg")&&n.remove()}}_updateFontIconClasses(){if(!this._usingFontIcon())return;let t=this._elementRef.nativeElement,e=(this.fontSet?this._iconRegistry.classNameForFontAlias(this.fontSet).split(/ +/):this._iconRegistry.getDefaultFontSetClass()).filter(n=>n.length>0);this._previousFontSetClass.forEach(n=>t.classList.remove(n)),e.forEach(n=>t.classList.add(n)),this._previousFontSetClass=e,this.fontIcon!==this._previousFontIconClass&&!e.includes("mat-ligature-font")&&(this._previousFontIconClass&&t.classList.remove(this._previousFontIconClass),this.fontIcon&&t.classList.add(this.fontIcon),this._previousFontIconClass=this.fontIcon)}_cleanupFontValue(t){return typeof t=="string"?t.trim().split(" ")[0]:t}_prependPathToReferences(t){let e=this._elementsWithExternalReferences;e&&e.forEach((n,o)=>{n.forEach(r=>{o.setAttribute(r.name,`url('${t}#${r.value}')`)})})}_cacheChildrenWithExternalReferences(t){let e=t.querySelectorAll(ot),n=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let o=0;o<e.length;o++)G.forEach(r=>{let s=e[o],h=s.getAttribute(r),f=h?h.match(rt):null;if(f){let p=n.get(s);p||(p=[],n.set(s,p)),p.push({name:r,value:f[1]})}})}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){let[e,n]=this._splitIconName(t);e&&(this._svgNamespace=e),n&&(this._svgName=n),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(n,e).pipe(M(1)).subscribe(o=>this._setSvgElement(o),o=>{let r=`Error retrieving icon ${e}:${n}! ${o.message}`;this._errorHandler.handleError(new Error(r))})}}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=x({type:i,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:10,hostBindings:function(e,n){e&2&&(P("data-mat-icon-type",n._usingFontIcon()?"font":"svg")("data-mat-icon-name",n._svgName||n.fontIcon)("data-mat-icon-namespace",n._svgNamespace||n.fontSet)("fontIcon",n._usingFontIcon()?n.fontIcon:null),H(n.color?"mat-"+n.color:""),O("mat-icon-inline",n.inline)("mat-icon-no-color",n.color!=="primary"&&n.color!=="accent"&&n.color!=="warn"))},inputs:{color:"color",inline:[2,"inline","inline",W],svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],ngContentSelectors:tt,decls:1,vars:0,template:function(e,n){e&1&&(D(),z(0))},styles:[`mat-icon,mat-icon.mat-primary,mat-icon.mat-accent,mat-icon.mat-warn{color:var(--mat-icon-color, inherit)}.mat-icon{-webkit-user-select:none;user-select:none;background-repeat:no-repeat;display:inline-block;fill:currentColor;height:24px;width:24px;overflow:hidden}.mat-icon.mat-icon-inline{font-size:inherit;height:inherit;line-height:inherit;width:inherit}.mat-icon.mat-ligature-font[fontIcon]::before{content:attr(fontIcon)}[dir=rtl] .mat-icon-rtl-mirror{transform:scale(-1, 1)}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon{display:block}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-icon{margin:auto}
|
|
1
|
+
import{E as B,k as d}from"./chunk-SDLTQWY6.js";import{D as N,Fa as g,G as M,Gb as D,Hb as z,K as R,O as b,Rb as O,Rc as $,Sb as H,Uc as j,V as v,Wa as x,Xa as U,Z as A,_ as T,aa as E,ba as _,ca as c,e as F,jb as P,la as I,m as u,mc as k,n as w,qa as S,t as m,tc as W,ya as L,z as y}from"./chunk-RNXBUYHW.js";function V(i){return Error(`Unable to find icon with the name "${i}"`)}function X(){return Error("Could not find HttpClient for use with Angular Material icons. Please add provideHttpClient() to your providers.")}function q(i){return Error(`The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was "${i}".`)}function Y(i){return Error(`The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was "${i}".`)}var a=class{url;svgText;options;svgElement=null;constructor(l,t,e){this.url=l,this.svgText=t,this.options=e}},K=(()=>{class i{_httpClient;_sanitizer;_errorHandler;_document;_svgIconConfigs=new Map;_iconSetConfigs=new Map;_cachedIconsByUrl=new Map;_inProgressUrlFetches=new Map;_fontCssClassesByAlias=new Map;_resolvers=[];_defaultFontSetClass=["material-icons","mat-ligature-font"];constructor(t,e,n,o){this._httpClient=t,this._sanitizer=e,this._errorHandler=o,this._document=n}addSvgIcon(t,e,n){return this.addSvgIconInNamespace("",t,e,n)}addSvgIconLiteral(t,e,n){return this.addSvgIconLiteralInNamespace("",t,e,n)}addSvgIconInNamespace(t,e,n,o){return this._addSvgIconConfig(t,e,new a(n,null,o))}addSvgIconResolver(t){return this._resolvers.push(t),this}addSvgIconLiteralInNamespace(t,e,n,o){let r=this._sanitizer.sanitize(g.HTML,n);if(!r)throw Y(n);let s=d(r);return this._addSvgIconConfig(t,e,new a("",s,o))}addSvgIconSet(t,e){return this.addSvgIconSetInNamespace("",t,e)}addSvgIconSetLiteral(t,e){return this.addSvgIconSetLiteralInNamespace("",t,e)}addSvgIconSetInNamespace(t,e,n){return this._addSvgIconSetConfig(t,new a(e,null,n))}addSvgIconSetLiteralInNamespace(t,e,n){let o=this._sanitizer.sanitize(g.HTML,e);if(!o)throw Y(e);let r=d(o);return this._addSvgIconSetConfig(t,new a("",r,n))}registerFontClassAlias(t,e=t){return this._fontCssClassesByAlias.set(t,e),this}classNameForFontAlias(t){return this._fontCssClassesByAlias.get(t)||t}setDefaultFontSetClass(...t){return this._defaultFontSetClass=t,this}getDefaultFontSetClass(){return this._defaultFontSetClass}getSvgIconFromUrl(t){let e=this._sanitizer.sanitize(g.RESOURCE_URL,t);if(!e)throw q(t);let n=this._cachedIconsByUrl.get(e);return n?u(C(n)):this._loadSvgIconFromConfig(new a(t,null)).pipe(v(o=>this._cachedIconsByUrl.set(e,o)),m(o=>C(o)))}getNamedSvgIcon(t,e=""){let n=J(e,t),o=this._svgIconConfigs.get(n);if(o)return this._getSvgFromConfig(o);if(o=this._getIconConfigFromResolvers(e,t),o)return this._svgIconConfigs.set(n,o),this._getSvgFromConfig(o);let r=this._iconSetConfigs.get(e);return r?this._getSvgFromIconSetConfigs(t,r):w(V(n))}ngOnDestroy(){this._resolvers=[],this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()}_getSvgFromConfig(t){return t.svgText?u(C(this._svgElementFromConfig(t))):this._loadSvgIconFromConfig(t).pipe(m(e=>C(e)))}_getSvgFromIconSetConfigs(t,e){let n=this._extractIconWithNameFromAnySet(t,e);if(n)return u(n);let o=e.filter(r=>!r.svgText).map(r=>this._loadSvgIconSetFromConfig(r).pipe(N(s=>{let f=`Loading icon set URL: ${this._sanitizer.sanitize(g.RESOURCE_URL,r.url)} failed: ${s.message}`;return this._errorHandler.handleError(new Error(f)),u(null)})));return y(o).pipe(m(()=>{let r=this._extractIconWithNameFromAnySet(t,e);if(!r)throw V(t);return r}))}_extractIconWithNameFromAnySet(t,e){for(let n=e.length-1;n>=0;n--){let o=e[n];if(o.svgText&&o.svgText.toString().indexOf(t)>-1){let r=this._svgElementFromConfig(o),s=this._extractSvgIconFromSet(r,t,o.options);if(s)return s}}return null}_loadSvgIconFromConfig(t){return this._fetchIcon(t).pipe(v(e=>t.svgText=e),m(()=>this._svgElementFromConfig(t)))}_loadSvgIconSetFromConfig(t){return t.svgText?u(null):this._fetchIcon(t).pipe(v(e=>t.svgText=e))}_extractSvgIconFromSet(t,e,n){let o=t.querySelector(`[id="${e}"]`);if(!o)return null;let r=o.cloneNode(!0);if(r.removeAttribute("id"),r.nodeName.toLowerCase()==="svg")return this._setSvgAttributes(r,n);if(r.nodeName.toLowerCase()==="symbol")return this._setSvgAttributes(this._toSvgElement(r),n);let s=this._svgElementFromString(d("<svg></svg>"));return s.appendChild(r),this._setSvgAttributes(s,n)}_svgElementFromString(t){let e=this._document.createElement("DIV");e.innerHTML=t;let n=e.querySelector("svg");if(!n)throw Error("<svg> tag not found");return n}_toSvgElement(t){let e=this._svgElementFromString(d("<svg></svg>")),n=t.attributes;for(let o=0;o<n.length;o++){let{name:r,value:s}=n[o];r!=="id"&&e.setAttribute(r,s)}for(let o=0;o<t.childNodes.length;o++)t.childNodes[o].nodeType===this._document.ELEMENT_NODE&&e.appendChild(t.childNodes[o].cloneNode(!0));return e}_setSvgAttributes(t,e){return t.setAttribute("fit",""),t.setAttribute("height","100%"),t.setAttribute("width","100%"),t.setAttribute("preserveAspectRatio","xMidYMid meet"),t.setAttribute("focusable","false"),e&&e.viewBox&&t.setAttribute("viewBox",e.viewBox),t}_fetchIcon(t){let{url:e,options:n}=t,o=n?.withCredentials??!1;if(!this._httpClient)throw X();if(e==null)throw Error(`Cannot fetch icon from URL "${e}".`);let r=this._sanitizer.sanitize(g.RESOURCE_URL,e);if(!r)throw q(e);let s=this._inProgressUrlFetches.get(r);if(s)return s;let h=this._httpClient.get(r,{responseType:"text",withCredentials:o}).pipe(m(f=>d(f)),R(()=>this._inProgressUrlFetches.delete(r)),b());return this._inProgressUrlFetches.set(r,h),h}_addSvgIconConfig(t,e,n){return this._svgIconConfigs.set(J(t,e),n),this}_addSvgIconSetConfig(t,e){let n=this._iconSetConfigs.get(t);return n?n.push(e):this._iconSetConfigs.set(t,[e]),this}_svgElementFromConfig(t){if(!t.svgElement){let e=this._svgElementFromString(t.svgText);this._setSvgAttributes(e,t.options),t.svgElement=e}return t.svgElement}_getIconConfigFromResolvers(t,e){for(let n=0;n<this._resolvers.length;n++){let o=this._resolvers[n](e,t);if(o)return Z(o)?new a(o.url,null,o.options):new a(o,null)}}static \u0275fac=function(e){return new(e||i)(_($,8),_(j),_(I,8),_(S))};static \u0275prov=A({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();function C(i){return i.cloneNode(!0)}function J(i,l){return i+":"+l}function Z(i){return!!(i.url&&i.options)}var tt=["*"],et=new E("MAT_ICON_DEFAULT_OPTIONS"),nt=new E("mat-icon-location",{providedIn:"root",factory:()=>{let i=c(I),l=i?i.location:null;return{getPathname:()=>l?l.pathname+l.search:""}}}),G=["clip-path","color-profile","src","cursor","fill","filter","marker","marker-start","marker-mid","marker-end","mask","stroke"],ot=G.map(i=>`[${i}]`).join(", "),rt=/^url\(['"]?#(.*?)['"]?\)$/,yt=(()=>{class i{_elementRef=c(L);_iconRegistry=c(K);_location=c(nt);_errorHandler=c(S);_defaultColor;get color(){return this._color||this._defaultColor}set color(t){this._color=t}_color;inline=!1;get svgIcon(){return this._svgIcon}set svgIcon(t){t!==this._svgIcon&&(t?this._updateSvgIcon(t):this._svgIcon&&this._clearSvgElement(),this._svgIcon=t)}_svgIcon;get fontSet(){return this._fontSet}set fontSet(t){let e=this._cleanupFontValue(t);e!==this._fontSet&&(this._fontSet=e,this._updateFontIconClasses())}_fontSet;get fontIcon(){return this._fontIcon}set fontIcon(t){let e=this._cleanupFontValue(t);e!==this._fontIcon&&(this._fontIcon=e,this._updateFontIconClasses())}_fontIcon;_previousFontSetClass=[];_previousFontIconClass;_svgName=null;_svgNamespace=null;_previousPath;_elementsWithExternalReferences;_currentIconFetch=F.EMPTY;constructor(){let t=c(new k("aria-hidden"),{optional:!0}),e=c(et,{optional:!0});e&&(e.color&&(this.color=this._defaultColor=e.color),e.fontSet&&(this.fontSet=e.fontSet)),t||this._elementRef.nativeElement.setAttribute("aria-hidden","true")}_splitIconName(t){if(!t)return["",""];let e=t.split(":");switch(e.length){case 1:return["",e[0]];case 2:return e;default:throw Error(`Invalid icon name: "${t}"`)}}ngOnInit(){this._updateFontIconClasses()}ngAfterViewChecked(){let t=this._elementsWithExternalReferences;if(t&&t.size){let e=this._location.getPathname();e!==this._previousPath&&(this._previousPath=e,this._prependPathToReferences(e))}}ngOnDestroy(){this._currentIconFetch.unsubscribe(),this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear()}_usingFontIcon(){return!this.svgIcon}_setSvgElement(t){this._clearSvgElement();let e=this._location.getPathname();this._previousPath=e,this._cacheChildrenWithExternalReferences(t),this._prependPathToReferences(e),this._elementRef.nativeElement.appendChild(t)}_clearSvgElement(){let t=this._elementRef.nativeElement,e=t.childNodes.length;for(this._elementsWithExternalReferences&&this._elementsWithExternalReferences.clear();e--;){let n=t.childNodes[e];(n.nodeType!==1||n.nodeName.toLowerCase()==="svg")&&n.remove()}}_updateFontIconClasses(){if(!this._usingFontIcon())return;let t=this._elementRef.nativeElement,e=(this.fontSet?this._iconRegistry.classNameForFontAlias(this.fontSet).split(/ +/):this._iconRegistry.getDefaultFontSetClass()).filter(n=>n.length>0);this._previousFontSetClass.forEach(n=>t.classList.remove(n)),e.forEach(n=>t.classList.add(n)),this._previousFontSetClass=e,this.fontIcon!==this._previousFontIconClass&&!e.includes("mat-ligature-font")&&(this._previousFontIconClass&&t.classList.remove(this._previousFontIconClass),this.fontIcon&&t.classList.add(this.fontIcon),this._previousFontIconClass=this.fontIcon)}_cleanupFontValue(t){return typeof t=="string"?t.trim().split(" ")[0]:t}_prependPathToReferences(t){let e=this._elementsWithExternalReferences;e&&e.forEach((n,o)=>{n.forEach(r=>{o.setAttribute(r.name,`url('${t}#${r.value}')`)})})}_cacheChildrenWithExternalReferences(t){let e=t.querySelectorAll(ot),n=this._elementsWithExternalReferences=this._elementsWithExternalReferences||new Map;for(let o=0;o<e.length;o++)G.forEach(r=>{let s=e[o],h=s.getAttribute(r),f=h?h.match(rt):null;if(f){let p=n.get(s);p||(p=[],n.set(s,p)),p.push({name:r,value:f[1]})}})}_updateSvgIcon(t){if(this._svgNamespace=null,this._svgName=null,this._currentIconFetch.unsubscribe(),t){let[e,n]=this._splitIconName(t);e&&(this._svgNamespace=e),n&&(this._svgName=n),this._currentIconFetch=this._iconRegistry.getNamedSvgIcon(n,e).pipe(M(1)).subscribe(o=>this._setSvgElement(o),o=>{let r=`Error retrieving icon ${e}:${n}! ${o.message}`;this._errorHandler.handleError(new Error(r))})}}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=x({type:i,selectors:[["mat-icon"]],hostAttrs:["role","img",1,"mat-icon","notranslate"],hostVars:10,hostBindings:function(e,n){e&2&&(P("data-mat-icon-type",n._usingFontIcon()?"font":"svg")("data-mat-icon-name",n._svgName||n.fontIcon)("data-mat-icon-namespace",n._svgNamespace||n.fontSet)("fontIcon",n._usingFontIcon()?n.fontIcon:null),H(n.color?"mat-"+n.color:""),O("mat-icon-inline",n.inline)("mat-icon-no-color",n.color!=="primary"&&n.color!=="accent"&&n.color!=="warn"))},inputs:{color:"color",inline:[2,"inline","inline",W],svgIcon:"svgIcon",fontSet:"fontSet",fontIcon:"fontIcon"},exportAs:["matIcon"],ngContentSelectors:tt,decls:1,vars:0,template:function(e,n){e&1&&(D(),z(0))},styles:[`mat-icon,mat-icon.mat-primary,mat-icon.mat-accent,mat-icon.mat-warn{color:var(--mat-icon-color, inherit)}.mat-icon{-webkit-user-select:none;user-select:none;background-repeat:no-repeat;display:inline-block;fill:currentColor;height:24px;width:24px;overflow:hidden}.mat-icon.mat-icon-inline{font-size:inherit;height:inherit;line-height:inherit;width:inherit}.mat-icon.mat-ligature-font[fontIcon]::before{content:attr(fontIcon)}[dir=rtl] .mat-icon-rtl-mirror{transform:scale(-1, 1)}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon{display:block}.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field:not(.mat-form-field-appearance-legacy) .mat-form-field-suffix .mat-icon-button .mat-icon{margin:auto}
|
|
2
2
|
`],encapsulation:2,changeDetection:0})}return i})(),Nt=(()=>{class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=U({type:i});static \u0275inj=T({imports:[B]})}return i})();export{yt as a,Nt as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as T}from"./chunk-FTMDL4HX.js";import{b as I,d as w}from"./chunk-LTFITYTW.js";import{a as C}from"./chunk-LCBWJP6Z.js";import{D as R,b as N,c as A,e as y,g as F,h as U,i as z,l as d,n as D,t as V,u as L}from"./chunk-DLU3TQID.js";import{Bb as P,Db as f,Fb as c,Ka as l,Tb as n,Ub as h,Vb as k,Wa as O,ca as u,ga as _,ha as p,lb as b,ma as E,mb as x,rb as v,sb as r,ta as g,tb as t,ub as m}from"./chunk-RNXBUYHW.js";function B(i,o){i&1&&(r(0,"p",5),n(1,"Loading\u2026"),t())}function q(i,o){if(i&1&&(r(0,"span",13),n(1),t()),i&2){let e=c(2);l(),h(e.form.controls.email.value)}}function $(i,o){i&1&&m(0,"input",14)}function j(i,o){if(i&1){let e=P();r(0,"form",7),f("ngSubmit",function(){_(e);let s=c();return p(s.save())}),r(1,"div",8)(2,"h2",9),n(3,"Identity"),t(),r(4,"div",10)(5,"label",11),n(6,"Email "),r(7,"span",12),n(8,"*"),t()(),b(9,q,2,1,"span",13)(10,$,1,0,"input",14),t(),r(11,"div",10)(12,"label",15),n(13,"External ID"),t(),m(14,"input",16),t()(),r(15,"div",8)(16,"h2",9),n(17,"Profile"),t(),r(18,"div",10)(19,"label",17),n(20,"First name"),t(),m(21,"input",18),t(),r(22,"div",10)(23,"label",19),n(24,"Last name"),t(),m(25,"input",20),t(),r(26,"div",21)(27,"label",22),n(28,"Bio"),t(),m(29,"textarea",23),t()(),r(30,"div",8)(31,"h2",9),n(32,"Permissions"),t(),r(33,"div",24),m(34,"input",25),r(35,"label",26),n(36,"Administrator"),t()()(),r(37,"div",27)(38,"button",28),n(39),t(),r(40,"button",29),f("click",function(){_(e);let s=c();return p(s.cancel())}),n(41,"Cancel"),t()()()}if(i&2){let e=c();v("formGroup",e.form),l(9),x(e.isEditMode?9:10),l(29),v("disabled",e.form.invalid||e.isSaving()),l(),k(" ",e.isSaving()?"Saving\u2026":e.isEditMode?"Save changes":"Create user"," ")}}var G=class i{route=u(I);router=u(w);destroyRef=u(E);userAdminState=u(T);userId=this.route.snapshot.params.userId;isEditMode=!!this.userId;isSaving=g(!1);isLoading=g(!1);form=new z({email:new d("",{nonNullable:!0,validators:[y.required,y.email]}),externalId:new d("",{nonNullable:!0}),firstname:new d("",{nonNullable:!0}),lastname:new d("",{nonNullable:!0}),bio:new d("",{nonNullable:!0}),isAdmin:new d(!1,{nonNullable:!0})});ngOnInit(){if(!this.isEditMode)return;let o=this.userAdminState.users().find(e=>e.id===this.userId);if(o){this.syncForm(o),this.form.controls.email.disable();return}this.isLoading.set(!0),this.userAdminState.loadAll().pipe(C(this.destroyRef)).subscribe({next:()=>{let e=this.userAdminState.users().find(a=>a.id===this.userId);e&&(this.syncForm(e),this.form.controls.email.disable()),this.isLoading.set(!1)},error:()=>this.isLoading.set(!1)})}get title(){return this.isEditMode?"Edit user":"New user"}save(){if(this.form.invalid||this.isSaving())return;this.isSaving.set(!0);let{email:o,externalId:e,firstname:a,lastname:s,bio:S,isAdmin:M}=this.form.getRawValue();(this.isEditMode?this.userAdminState.updateUser(this.userId,{externalId:e||void 0,firstname:a||void 0,lastname:s||void 0,bio:S||void 0,isAdmin:M}):this.userAdminState.createUser({email:o||void 0,externalId:e||void 0,firstname:a||void 0,lastname:s||void 0,bio:S||void 0,isAdmin:M})).pipe(C(this.destroyRef)).subscribe({next:()=>this.navigateBack(),error:()=>this.isSaving.set(!1)})}cancel(){this.navigateBack()}navigateBack(){this.router.navigate(["/agentos/admin/users"])}syncForm(o){this.form.setValue({email:o.email??"",externalId:o.externalId??"",firstname:o.firstname??"",lastname:o.lastname??"",bio:o.bio??"",isAdmin:o.isAdmin??!1})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=O({type:i,selectors:[["agentos-user-form"]],decls:10,vars:2,consts:[[1,"user-form"],[1,"user-form__header"],["type","button","title","Back to users",1,"user-form__back",3,"click"],[1,"user-form__back-icon"],[1,"user-form__title"],[1,"user-form__loading"],[1,"user-form__body",3,"formGroup"],[1,"user-form__body",3,"ngSubmit","formGroup"],[1,"user-form__section"],[1,"user-form__section-title"],[1,"user-form__field"],["for","uf-email",1,"user-form__label"],[1,"user-form__required"],[1,"user-form__value","user-form__value--readonly"],["id","uf-email","type","email","placeholder","user@example.com","formControlName","email","autocomplete","email",1,"user-form__input"],["for","uf-externalId",1,"user-form__label"],["id","uf-externalId","type","text","placeholder","External identifier","formControlName","externalId",1,"user-form__input"],["for","uf-firstname",1,"user-form__label"],["id","uf-firstname","type","text","placeholder","First name","formControlName","firstname","autocomplete","given-name",1,"user-form__input"],["for","uf-lastname",1,"user-form__label"],["id","uf-lastname","type","text","placeholder","Last name","formControlName","lastname","autocomplete","family-name",1,"user-form__input"],[1,"user-form__field","user-form__field--bio"],["for","uf-bio",1,"user-form__label"],["id","uf-bio","placeholder","A short description","formControlName","bio","rows","4",1,"user-form__input","user-form__input--textarea"],[1,"user-form__field","user-form__field--checkbox"],["id","uf-isAdmin","type","checkbox","formControlName","isAdmin",1,"user-form__checkbox"],["for","uf-isAdmin",1,"user-form__label","user-form__label--checkbox"],[1,"user-form__actions"],["type","submit",1,"user-form__btn","user-form__btn--primary",3,"disabled"],["type","button",1,"user-form__btn",3,"click"]],template:function(e,a){e&1&&(r(0,"div",0)(1,"header",1)(2,"button",2),f("click",function(){return a.cancel()}),r(3,"span",3),n(4,"\u2190"),t(),n(5," Users "),t(),r(6,"h1",4),n(7),t()(),b(8,B,2,0,"p",5)(9,j,42,4,"form",6),t()),e&2&&(l(7),h(a.title),l(),x(a.isLoading()?8:9))},dependencies:[R,D,A,N,F,U,L,V],styles:[".user-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.user-form__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.user-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}.user-form__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.user-form__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.user-form__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.user-form__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.user-form__body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem}.user-form__section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.user-form__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-form__field[_ngcontent-%COMP%]{display:grid;grid-template-columns:140px 1fr;align-items:baseline;gap:.75rem}.user-form__field--bio[_ngcontent-%COMP%]{align-items:start}.user-form__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text-secondary, #6e6e73);white-space:nowrap}.user-form__required[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.user-form__value[_ngcontent-%COMP%]{font-size:.9375rem;color:var(--color-text, #1d1d1f)}.user-form__value--readonly[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.875rem}.user-form__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-form__input[_ngcontent-%COMP%]:focus{border-color:var(--color-primary, #007aff)}.user-form__input[_ngcontent-%COMP%]::placeholder{color:var(--color-text-secondary, #6e6e73)}.user-form__input--textarea[_ngcontent-%COMP%]{line-height:1.5;resize:vertical}.user-form__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.user-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}.user-form__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.user-form__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.user-form__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.user-form__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};export{G as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{j as l}from"./chunk-R5RVDZLX.js";import{V as o,Z as s,a as n,ca as a,ta as i}from"./chunk-RNXBUYHW.js";var u=class t{userController=a(l);currentUser=i(null);loadMe(){return this.userController.getMeUser().pipe(o(r=>this.currentUser.set(r)))}updateMe(r){let e=this.currentUser();if(!e)throw new Error("Cannot update: current user not loaded");if(!e.id)throw new Error("Cannot update: current user has no id");let c=n(n({},e),r);return this.userController.updateUser(e.id,c).pipe(o(d=>this.currentUser.set(d)))}static \u0275fac=function(e){return new(e||t)};static \u0275prov=s({token:t,factory:t.\u0275fac,providedIn:"root"})};export{u as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Oc as K,Pc as u,Rc as P,Z as A,a as b,aa as k,b as f,ba as x,ca as O,da as L,g as D,pa as G}from"./chunk-RNXBUYHW.js";var y=class{apiKeys;username;password;accessToken;basePath;withCredentials;encoder;encodeParam;credentials;constructor({accessToken:h,apiKeys:n,basePath:a,credentials:i,encodeParam:o,encoder:t,password:e,username:p,withCredentials:l}={}){n&&(this.apiKeys=n),p!==void 0&&(this.username=p),e!==void 0&&(this.password=e),h!==void 0&&(this.accessToken=h),a!==void 0&&(this.basePath=a),l!==void 0&&(this.withCredentials=l),t&&(this.encoder=t),this.encodeParam=o??(r=>this.defaultEncodeParam(r)),this.credentials=i??{}}selectHeaderContentType(h){if(h.length===0)return;let n=h.find(a=>this.isJsonMime(a));return n===void 0?h[0]:n}selectHeaderAccept(h){if(h.length===0)return;let n=h.find(a=>this.isJsonMime(a));return n===void 0?h[0]:n}isJsonMime(h){let n=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return h!==null&&(n.test(h)||h.toLowerCase()==="application/json-patch+json")}lookupCredential(h){let n=this.credentials[h];return typeof n=="function"?n():n}addCredentialToHeaders(h,n,a,i){let o=this.lookupCredential(h);return o?a.set(n,(i??"")+o):a}addCredentialToQuery(h,n,a){let i=this.lookupCredential(h);return i?a.set(n,i):a}defaultEncodeParam(h){let n=h.dataFormat==="date-time"&&h.value instanceof Date?h.value.toISOString():h.value;return encodeURIComponent(String(n))}};var v=new k("basePath");var V=class{encodeKey(h){return encodeURIComponent(h)}encodeValue(h){return encodeURIComponent(h)}decodeKey(h){return decodeURIComponent(h)}decodeValue(h){return decodeURIComponent(h)}};var m=class{basePath="http://localhost:8124";defaultHeaders=new K;configuration;encoder;constructor(h,n){if(this.configuration=n||new y,typeof this.configuration.basePath!="string"){let a=Array.isArray(h)?h[0]:void 0;a!=null&&(h=a),typeof h!="string"&&(h=this.basePath),this.configuration.basePath=h}this.encoder=this.configuration.encoder||new V}canConsumeForm(h){return h.indexOf("multipart/form-data")!==-1}addToHttpParams(h,n,a,i=!1){return typeof n=="object"&&!(n instanceof Date)?this.addToHttpParamsRecursive(h,n,i?a:void 0,i):this.addToHttpParamsRecursive(h,n,a)}addToHttpParamsRecursive(h,n,a,i=!1){if(n==null)return h;if(typeof n=="object"){if(a!=null)return i?Object.keys(n).reduce((o,t)=>o.append(`${a}[${t}]`,n[t]),h):h.append(a,JSON.stringify(n));if(Array.isArray(n))n.forEach(o=>h=this.addToHttpParamsRecursive(h,o,a));else if(n instanceof Date)if(a!=null)h=h.append(a,n.toISOString());else throw Error("key may not be null if value is Date");else Object.keys(n).forEach(o=>{let t=a?`${a}.${o}`:o;h=this.addToHttpParamsRecursive(h,n[o],t)});return h}else if(a!=null)return h.append(a,n);throw Error("key may not be null if value is not object or array")}};var R=class C extends m{constructor(n,a,i){super(a,i);this.httpClient=n}createAgentConfig(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter agentConfig was null or undefined when calling createAgentConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/agent-configs",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${c}`,f(b({context:p,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}deleteAgentConfig(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteAgentConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/agent-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdAgentConfig(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdAgentConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/agent-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdsAgentConfig(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIdsAgentConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/agent-configs/by-ids",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${c}`,f(b({context:p,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}listByParentAgentConfig(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentAgentConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/agent-configs/by-parentId/${this.configuration.encodeParam({name:"parentId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}updateAgentConfig(n,a,i="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateAgentConfig.");if(a==null)throw new Error("Required parameter agentConfig was null or undefined when calling updateAgentConfig.");let e=this.defaultHeaders,p=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);p!==void 0&&(e=e.set("Accept",p));let l=t?.context??new u,r=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";p&&(p.startsWith("text")?c="text":this.configuration.isJsonMime(p)?c="json":c="blob");let H=`/api/agent-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:g,withCredentials:j}=this.configuration;return this.httpClient.request("put",`${g}${H}`,f(b({context:l,body:a,responseType:c},j?{withCredentials:j}:{}),{headers:e,observe:i,transferCache:r,reportProgress:o}))}static \u0275fac=function(a){return new(a||C)(x(P),x(v,8),x(y,8))};static \u0275prov=A({token:C,factory:C.\u0275fac,providedIn:"root"})};var E=class C extends m{constructor(n,a,i){super(a,i);this.httpClient=n}createAiModel(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter aiModel was null or undefined when calling createAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/ai-models",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${c}`,f(b({context:p,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}deleteAiModel(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/ai-models/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdAiModel(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/ai-models/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdsAiModel(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIdsAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/ai-models/by-ids",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${c}`,f(b({context:p,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}listByNamespaceIdAiModel(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling listByNamespaceIdAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/ai-models/by-namespaceId/${this.configuration.encodeParam({name:"namespaceId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}listByParentAiModel(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentAiModel.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/ai-models/by-parentId/${this.configuration.encodeParam({name:"parentId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}updateAiModel(n,a,i="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateAiModel.");if(a==null)throw new Error("Required parameter aiModel was null or undefined when calling updateAiModel.");let e=this.defaultHeaders,p=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);p!==void 0&&(e=e.set("Accept",p));let l=t?.context??new u,r=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";p&&(p.startsWith("text")?c="text":this.configuration.isJsonMime(p)?c="json":c="blob");let H=`/api/ai-models/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:g,withCredentials:j}=this.configuration;return this.httpClient.request("put",`${g}${H}`,f(b({context:l,body:a,responseType:c},j?{withCredentials:j}:{}),{headers:e,observe:i,transferCache:r,reportProgress:o}))}static \u0275fac=function(a){return new(a||C)(x(P),x(v,8),x(y,8))};static \u0275prov=A({token:C,factory:C.\u0275fac,providedIn:"root"})};var M=class C extends m{constructor(n,a,i){super(a,i);this.httpClient=n}createAiProvider(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter aiProvider was null or undefined when calling createAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/ai-providers",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${c}`,f(b({context:p,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}deleteAiProvider(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/ai-providers/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdAiProvider(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/ai-providers/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdsAiProvider(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIdsAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/ai-providers/by-ids",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${c}`,f(b({context:p,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}listByNamespaceIdAiProvider(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling listByNamespaceIdAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/ai-providers/by-namespaceId/${this.configuration.encodeParam({name:"namespaceId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}listByParentAiProvider(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/ai-providers/by-parentId/${this.configuration.encodeParam({name:"parentId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}listByUserIdAiProvider(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter userId was null or undefined when calling listByUserIdAiProvider.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/ai-providers/by-userId/${this.configuration.encodeParam({name:"userId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}updateAiProvider(n,a,i="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateAiProvider.");if(a==null)throw new Error("Required parameter aiProvider was null or undefined when calling updateAiProvider.");let e=this.defaultHeaders,p=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);p!==void 0&&(e=e.set("Accept",p));let l=t?.context??new u,r=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";p&&(p.startsWith("text")?c="text":this.configuration.isJsonMime(p)?c="json":c="blob");let H=`/api/ai-providers/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:g,withCredentials:j}=this.configuration;return this.httpClient.request("put",`${g}${H}`,f(b({context:l,body:a,responseType:c},j?{withCredentials:j}:{}),{headers:e,observe:i,transferCache:r,reportProgress:o}))}static \u0275fac=function(a){return new(a||C)(x(P),x(v,8),x(y,8))};static \u0275prov=A({token:C,factory:C.\u0275fac,providedIn:"root"})};var $=class C extends m{constructor(n,a,i){super(a,i);this.httpClient=n}addMessageCase(n,a,i="body",o=!1,t){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling addMessageCase.");if(a==null)throw new Error("Required parameter addMessageRequest was null or undefined when calling addMessageCase.");let e=this.defaultHeaders,p=t?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);p!==void 0&&(e=e.set("Accept",p));let l=t?.context??new u,r=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";p&&(p.startsWith("text")?c="text":this.configuration.isJsonMime(p)?c="json":c="blob");let H=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/messages`,{basePath:g,withCredentials:j}=this.configuration;return this.httpClient.request("post",`${g}${H}`,f(b({context:l,body:a,responseType:c},j?{withCredentials:j}:{}),{headers:e,observe:i,transferCache:r,reportProgress:o}))}createCase(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter _case was null or undefined when calling createCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/cases",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${c}`,f(b({context:p,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}deleteCase(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdCase(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdsCase(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIdsCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/cases/by-ids",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${c}`,f(b({context:p,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}interruptCase(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling interruptCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/interrupt`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}killCase(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling killCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/kill`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}listByParentCase(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentCase.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/cases/by-parentId/${this.configuration.encodeParam({name:"parentId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}updateCase(n,a,i="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateCase.");if(a==null)throw new Error("Required parameter _case was null or undefined when calling updateCase.");let e=this.defaultHeaders,p=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);p!==void 0&&(e=e.set("Accept",p));let l=t?.context??new u,r=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";p&&(p.startsWith("text")?c="text":this.configuration.isJsonMime(p)?c="json":c="blob");let H=`/api/cases/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:g,withCredentials:j}=this.configuration;return this.httpClient.request("put",`${g}${H}`,f(b({context:l,body:a,responseType:c},j?{withCredentials:j}:{}),{headers:e,observe:i,transferCache:r,reportProgress:o}))}static \u0275fac=function(a){return new(a||C)(x(P),x(v,8),x(y,8))};static \u0275prov=A({token:C,factory:C.\u0275fac,providedIn:"root"})};var B=class C extends m{constructor(n,a,i){super(a,i);this.httpClient=n}createIntegrationConfig(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter integrationConfig was null or undefined when calling createIntegrationConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/integration-configs",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${c}`,f(b({context:p,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}deleteIntegrationConfig(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteIntegrationConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/integration-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdIntegrationConfig(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdIntegrationConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/integration-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdsIntegrationConfig(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIdsIntegrationConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/integration-configs/by-ids",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${c}`,f(b({context:p,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}listByParentIntegrationConfig(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentIntegrationConfig.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/integration-configs/by-parentId/${this.configuration.encodeParam({name:"parentId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}updateIntegrationConfig(n,a,i="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateIntegrationConfig.");if(a==null)throw new Error("Required parameter integrationConfig was null or undefined when calling updateIntegrationConfig.");let e=this.defaultHeaders,p=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);p!==void 0&&(e=e.set("Accept",p));let l=t?.context??new u,r=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";p&&(p.startsWith("text")?c="text":this.configuration.isJsonMime(p)?c="json":c="blob");let H=`/api/integration-configs/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:g,withCredentials:j}=this.configuration;return this.httpClient.request("put",`${g}${H}`,f(b({context:l,body:a,responseType:c},j?{withCredentials:j}:{}),{headers:e,observe:i,transferCache:r,reportProgress:o}))}static \u0275fac=function(a){return new(a||C)(x(P),x(v,8),x(y,8))};static \u0275prov=A({token:C,factory:C.\u0275fac,providedIn:"root"})};var q=class C extends m{constructor(n,a,i){super(a,i);this.httpClient=n}getTypeIntegrationType(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter type was null or undefined when calling getTypeIntegrationType.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/integration-types/${this.configuration.encodeParam({name:"type",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}listTypesIntegrationType(n="body",a=!1,i){let o=this.defaultHeaders,t=i?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);t!==void 0&&(o=o.set("Accept",t));let e=i?.context??new u,p=i?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let r="/api/integration-types",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("get",`${d}${r}`,f(b({context:e,responseType:l},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:p,reportProgress:a}))}static \u0275fac=function(a){return new(a||C)(x(P),x(v,8),x(y,8))};static \u0275prov=A({token:C,factory:C.\u0275fac,providedIn:"root"})};var S=class C extends m{constructor(n,a,i){super(a,i);this.httpClient=n}createNamespace(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter namespace was null or undefined when calling createNamespace.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/namespaces",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${c}`,f(b({context:p,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}deleteNamespace(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteNamespace.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdNamespace(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdNamespace.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdsNamespace(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIdsNamespace.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/namespaces/by-ids",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${c}`,f(b({context:p,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}listAllNamespace(n="body",a=!1,i){let o=this.defaultHeaders,t=i?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);t!==void 0&&(o=o.set("Accept",t));let e=i?.context??new u,p=i?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let r="/api/namespaces",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("get",`${d}${r}`,f(b({context:e,responseType:l},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:p,reportProgress:a}))}listByParentNamespace(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentNamespace.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/namespaces/by-parentId/${this.configuration.encodeParam({name:"parentId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}updateNamespace(n,a,i="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateNamespace.");if(a==null)throw new Error("Required parameter namespace was null or undefined when calling updateNamespace.");let e=this.defaultHeaders,p=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);p!==void 0&&(e=e.set("Accept",p));let l=t?.context??new u,r=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";p&&(p.startsWith("text")?c="text":this.configuration.isJsonMime(p)?c="json":c="blob");let H=`/api/namespaces/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:g,withCredentials:j}=this.configuration;return this.httpClient.request("put",`${g}${H}`,f(b({context:l,body:a,responseType:c},j?{withCredentials:j}:{}),{headers:e,observe:i,transferCache:r,reportProgress:o}))}static \u0275fac=function(a){return new(a||C)(x(P),x(v,8),x(y,8))};static \u0275prov=A({token:C,factory:C.\u0275fac,providedIn:"root"})};var z=(a=>(a.OpenAI="OpenAI",a.Anthropic="Anthropic",a.Gemini="Gemini",a))(z||{});var N=class C extends m{constructor(n,a,i){super(a,i);this.httpClient=n}getByIdCaseEventRest(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdCaseEventRest.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/case-events/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdsCaseEventRest(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIdsCaseEventRest.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/case-events/by-ids",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${c}`,f(b({context:p,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}listByCaseCaseEventRest(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling listByCaseCaseEventRest.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/case-events/by-parentId/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}static \u0275fac=function(a){return new(a||C)(x(P),x(v,8),x(y,8))};static \u0275prov=A({token:C,factory:C.\u0275fac,providedIn:"root"})};var U=class C extends m{constructor(n,a,i){super(a,i);this.httpClient=n}grantAdmin(n,a,i="body",o=!1,t){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling grantAdmin.");if(a==null)throw new Error("Required parameter targetUserId was null or undefined when calling grantAdmin.");let e=this.defaultHeaders,p=t?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);p!==void 0&&(e=e.set("Accept",p));let l=t?.context??new u,r=t?.transferCache??!0,d="json";p&&(p.startsWith("text")?d="text":this.configuration.isJsonMime(p)?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:a,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:c,withCredentials:H}=this.configuration;return this.httpClient.request("put",`${c}${s}`,f(b({context:l,responseType:d},H?{withCredentials:H}:{}),{headers:e,observe:i,transferCache:r,reportProgress:o}))}grantMember(n,a,i="body",o=!1,t){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling grantMember.");if(a==null)throw new Error("Required parameter targetUserId was null or undefined when calling grantMember.");let e=this.defaultHeaders,p=t?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);p!==void 0&&(e=e.set("Accept",p));let l=t?.context??new u,r=t?.transferCache??!0,d="json";p&&(p.startsWith("text")?d="text":this.configuration.isJsonMime(p)?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:a,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:c,withCredentials:H}=this.configuration;return this.httpClient.request("put",`${c}${s}`,f(b({context:l,responseType:d},H?{withCredentials:H}:{}),{headers:e,observe:i,transferCache:r,reportProgress:o}))}listNamespaceUsers(n,a="body",i=!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 p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/namespaces/${this.configuration.encodeParam({name:"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}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}revokeAdmin(n,a,i="body",o=!1,t){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling revokeAdmin.");if(a==null)throw new Error("Required parameter targetUserId was null or undefined when calling revokeAdmin.");let e=this.defaultHeaders,p=t?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);p!==void 0&&(e=e.set("Accept",p));let l=t?.context??new u,r=t?.transferCache??!0,d="json";p&&(p.startsWith("text")?d="text":this.configuration.isJsonMime(p)?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:a,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:c,withCredentials:H}=this.configuration;return this.httpClient.request("delete",`${c}${s}`,f(b({context:l,responseType:d},H?{withCredentials:H}:{}),{headers:e,observe:i,transferCache:r,reportProgress:o}))}revokeMember(n,a,i="body",o=!1,t){if(n==null)throw new Error("Required parameter namespaceId was null or undefined when calling revokeMember.");if(a==null)throw new Error("Required parameter targetUserId was null or undefined when calling revokeMember.");let e=this.defaultHeaders,p=t?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);p!==void 0&&(e=e.set("Accept",p));let l=t?.context??new u,r=t?.transferCache??!0,d="json";p&&(p.startsWith("text")?d="text":this.configuration.isJsonMime(p)?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:a,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:c,withCredentials:H}=this.configuration;return this.httpClient.request("delete",`${c}${s}`,f(b({context:l,responseType:d},H?{withCredentials:H}:{}),{headers:e,observe:i,transferCache:r,reportProgress:o}))}static \u0275fac=function(a){return new(a||C)(x(P),x(v,8),x(y,8))};static \u0275prov=A({token:C,factory:C.\u0275fac,providedIn:"root"})};var J=class C extends m{constructor(n,a,i){super(a,i);this.httpClient=n}debugAllPlugins(n="body",a=!1,i){let o=this.defaultHeaders,t=i?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);t!==void 0&&(o=o.set("Accept",t));let e=i?.context??new u,p=i?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let r="/api/plugins/debug",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("get",`${d}${r}`,f(b({context:e,responseType:l},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:p,reportProgress:a}))}debugPlugin(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling debugPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/debug`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getAllPlugins(n="body",a=!1,i){let o=this.defaultHeaders,t=i?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);t!==void 0&&(o=o.set("Accept",t));let e=i?.context??new u,p=i?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let r="/api/plugins",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("get",`${d}${r}`,f(b({context:e,responseType:l},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:p,reportProgress:a}))}getPlugin(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling getPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}reloadAllAgentsPlugin(n="body",a=!1,i){let o=this.defaultHeaders,t=i?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);t!==void 0&&(o=o.set("Accept",t));let e=i?.context??new u,p=i?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let r="/api/plugins/reload-agents",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("post",`${d}${r}`,f(b({context:e,responseType:l},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:p,reportProgress:a}))}reloadPlugin(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling reloadPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/reload`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}startPlugin(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling startPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/start`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}stopPlugin(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling stopPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}/stop`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("post",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}unloadPlugin(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter pluginId was null or undefined when calling unloadPlugin.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/plugins/${this.configuration.encodeParam({name:"pluginId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:void 0})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}uploadPlugin(n="body",a=!1,i){let o=this.defaultHeaders,t=i?.httpHeaderAccept??this.configuration.selectHeaderAccept(["*/*"]);t!==void 0&&(o=o.set("Accept",t));let e=i?.context??new u,p=i?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let r="/api/plugins/upload",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("post",`${d}${r}`,f(b({context:e,responseType:l},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:p,reportProgress:a}))}static \u0275fac=function(a){return new(a||C)(x(P),x(v,8),x(y,8))};static \u0275prov=A({token:C,factory:C.\u0275fac,providedIn:"root"})};var F=class C extends m{constructor(n,a,i){super(a,i);this.httpClient=n}streamEventsCaseEventSse(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter caseId was null or undefined when calling streamEventsCaseEventSse.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["text/event-stream"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/cases/${this.configuration.encodeParam({name:"caseId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}/events`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}static \u0275fac=function(a){return new(a||C)(x(P),x(v,8),x(y,8))};static \u0275prov=A({token:C,factory:C.\u0275fac,providedIn:"root"})};var W=class C extends m{constructor(n,a,i){super(a,i);this.httpClient=n}createUser(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter user was null or undefined when calling createUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/users",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${c}`,f(b({context:p,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}deleteUser(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling deleteUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept([]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/users/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("delete",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdUser(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter id was null or undefined when calling getByIdUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/users/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getByIdsUser(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter requestBody was null or undefined when calling getByIdsUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r=["application/json"],d=this.configuration.selectHeaderContentType(r);d!==void 0&&(t=t.set("Content-Type",d));let s="json";e&&(e.startsWith("text")?s="text":this.configuration.isJsonMime(e)?s="json":s="blob");let c="/api/users/by-ids",{basePath:H,withCredentials:g}=this.configuration;return this.httpClient.request("post",`${H}${c}`,f(b({context:p,body:n,responseType:s},g?{withCredentials:g}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}getMeUser(n="body",a=!1,i){let o=this.defaultHeaders,t=i?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);t!==void 0&&(o=o.set("Accept",t));let e=i?.context??new u,p=i?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let r="/api/users/me",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("get",`${d}${r}`,f(b({context:e,responseType:l},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:p,reportProgress:a}))}listAllUser(n="body",a=!1,i){let o=this.defaultHeaders,t=i?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);t!==void 0&&(o=o.set("Accept",t));let e=i?.context??new u,p=i?.transferCache??!0,l="json";t&&(t.startsWith("text")?l="text":this.configuration.isJsonMime(t)?l="json":l="blob");let r="/api/users",{basePath:d,withCredentials:s}=this.configuration;return this.httpClient.request("get",`${d}${r}`,f(b({context:e,responseType:l},s?{withCredentials:s}:{}),{headers:o,observe:n,transferCache:p,reportProgress:a}))}listByParentUser(n,a="body",i=!1,o){if(n==null)throw new Error("Required parameter parentId was null or undefined when calling listByParentUser.");let t=this.defaultHeaders,e=o?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);e!==void 0&&(t=t.set("Accept",e));let p=o?.context??new u,l=o?.transferCache??!0,r="json";e&&(e.startsWith("text")?r="text":this.configuration.isJsonMime(e)?r="json":r="blob");let d=`/api/users/by-parentId/${this.configuration.encodeParam({name:"parentId",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:s,withCredentials:c}=this.configuration;return this.httpClient.request("get",`${s}${d}`,f(b({context:p,responseType:r},c?{withCredentials:c}:{}),{headers:t,observe:a,transferCache:l,reportProgress:i}))}updateUser(n,a,i="body",o=!1,t){if(n==null)throw new Error("Required parameter id was null or undefined when calling updateUser.");if(a==null)throw new Error("Required parameter user was null or undefined when calling updateUser.");let e=this.defaultHeaders,p=t?.httpHeaderAccept??this.configuration.selectHeaderAccept(["application/json"]);p!==void 0&&(e=e.set("Accept",p));let l=t?.context??new u,r=t?.transferCache??!0,d=["application/json"],s=this.configuration.selectHeaderContentType(d);s!==void 0&&(e=e.set("Content-Type",s));let c="json";p&&(p.startsWith("text")?c="text":this.configuration.isJsonMime(p)?c="json":c="blob");let H=`/api/users/${this.configuration.encodeParam({name:"id",value:n,in:"path",style:"simple",explode:!1,dataType:"string",dataFormat:"uuid"})}`,{basePath:g,withCredentials:j}=this.configuration;return this.httpClient.request("put",`${g}${H}`,f(b({context:l,body:a,responseType:c},j?{withCredentials:j}:{}),{headers:e,observe:i,transferCache:r,reportProgress:o}))}static \u0275fac=function(a){return new(a||C)(x(P),x(v,8),x(y,8))};static \u0275prov=A({token:C,factory:C.\u0275fac,providedIn:"root"})};function Ho(C){return L([typeof C=="string"?{provide:v,useValue:C}:{provide:y,useValue:new y(b({},C))}])}var _=class C{config=O(y);zone=O(G);connect(h){let n=`${this.config.basePath}/api/cases/${h}/events`;return new D(a=>{let i=this.zone.runOutsideAngular(()=>new EventSource(n));return i.onmessage=o=>{try{let t=JSON.parse(o.data);this.zone.run(()=>a.next(t))}catch(t){this.zone.run(()=>a.error(new Error(`Failed to parse SSE event: ${t}`)))}},i.onerror=o=>{i.readyState===EventSource.CLOSED?this.zone.run(()=>a.complete()):this.zone.run(()=>a.error(new Error(`SSE connection error for case ${h}`))),i.close()},()=>i.close()})}static \u0275fac=function(n){return new(n||C)};static \u0275prov=A({token:C,factory:C.\u0275fac,providedIn:"root"})};export{y as a,R as b,E as c,M as d,$ as e,B as f,q as g,S as h,J as i,W as j,z as k,Ho as l};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as me,c as le}from"./chunk-WNNKQ2DH.js";import{a as z}from"./chunk-AQ3SEH2N.js";import{a as Oe,b as ke,c as R}from"./chunk-7T6Q4MDL.js";import{e as Ee,f as Se,g as Fe}from"./chunk-7A54VTP2.js";import"./chunk-ZAM3WGZM.js";import{a as de,b as pe,c as ge,d as ue,e as _e}from"./chunk-RQLQ22PM.js";import{c as he,d as be,i as Ce,j as fe,m as ye,n as we}from"./chunk-AK6F2DC7.js";import"./chunk-AJOXSD6I.js";import{a as te,b as ne,d as oe,e as ie,f as re,g as ae,h as se}from"./chunk-DRBOHCTP.js";import"./chunk-IXD43YQI.js";import{a as L,b as A}from"./chunk-WPC6XC7P.js";import{A as ve,C as B,b as Me,c as Pe,g as W,m as V,p as xe}from"./chunk-XJUBZLY2.js";import"./chunk-XIQ3L6H6.js";import{O as D,Q as ce,S as I}from"./chunk-B2QA6UZX.js";import{Bb as f,Cc as $,Db as d,Fb as l,Jc as ee,Ka as c,Pb as N,Rb as T,Tb as a,Ub as M,Vb as O,Wa as F,Xb as x,Yb as v,Zb as y,ab as U,ac as J,bc as Q,ca as _,ga as g,ha as u,hc as X,kc as Z,lb as h,mb as b,nb as q,pb as H,qb as Y,rb as C,sb as n,ta as P,tb as o,yb as G,zb as K}from"./chunk-3JGMGRXW.js";function Re(s,i){if(s&1){let e=f();n(0,"div",9)(1,"mat-form-field",18)(2,"mat-label"),a(3),o(),n(4,"textarea",19),y("ngModelChange",function(r){let m=g(e).$index,E=l();return v(E.commands[m],r)||(E.commands[m]=r),u(r)}),o(),n(5,"mat-hint"),a(6,"Use placeholder for dynamic values"),o()(),n(7,"button",20),d("click",function(){let r=g(e).$index,m=l();return u(m.removeCommand(r))}),n(8,"mat-icon"),a(9,"delete"),o()()()}if(s&2){let e=i.$index,t=l();c(3),O("Prompt ",e+1),c(),x("ngModel",t.commands[e]),c(3),C("disabled",t.commands.length===1)}}function ze(s,i){if(s&1){let e=f();n(0,"div",10)(1,"h3"),a(2,"Save to"),o(),n(3,"div",21)(4,"label",22)(5,"input",23),y("ngModelChange",function(r){g(e);let m=l();return v(m.source,r)||(m.source=r),u(r)}),o(),n(6,"div",24)(7,"div",25)(8,"span",26),a(9,"\u{1F464}"),o(),n(10,"span",27),a(11,"Local"),o()(),n(12,"p",28),a(13,"Personal prompt in ~/.coday/... (not committed)"),o()()(),n(14,"label",22)(15,"input",29),y("ngModelChange",function(r){g(e);let m=l();return v(m.source,r)||(m.source=r),u(r)}),o(),n(16,"div",24)(17,"div",25)(18,"span",26),a(19,"\u{1F4E6}"),o(),n(20,"span",27),a(21,"Project"),o()(),n(22,"p",28),a(23,"Shared prompt in ./prompts/ (committable)"),o()()()(),n(24,"p",30),a(25,"Storage location is permanent and cannot be changed after creation"),o()()}if(s&2){let e=l();c(4),T("selected",e.source==="local"),c(),x("ngModel",e.source),c(9),T("selected",e.source==="project"),c(),x("ngModel",e.source)}}function Ue(s,i){if(s&1&&(n(0,"div",11)(1,"h3"),a(2,"Storage Location"),o(),n(3,"div",31)(4,"span",26),a(5),o(),n(6,"span",27),a(7),o()(),n(8,"p",30),a(9,"Cannot be changed after creation"),o()()),s&2){let e=l();c(3),T("badge-local",e.source==="local")("badge-project",e.source==="project"),c(2),M(e.source==="local"?"\u{1F464}":"\u{1F4E6}"),c(2),M(e.source==="local"?"Local":"Project")}}function Ne(s,i){if(s&1){let e=f();n(0,"div",12)(1,"label",32)(2,"input",33),y("ngModelChange",function(r){g(e);let m=l();return v(m.webhookEnabled,r)||(m.webhookEnabled=r),u(r)}),o(),n(3,"span"),a(4,"Enable webhook"),o()(),n(5,"p",30),a(6,"Enable webhook to trigger this prompt via HTTP POST"),o()()}if(s&2){let e=l();c(2),x("ngModel",e.webhookEnabled)}}function je(s,i){if(s&1){let e=f();n(0,"div",13)(1,"div",34)(2,"mat-icon",35),a(3,"link"),o(),n(4,"h4"),a(5,"Webhook URL"),o()(),n(6,"div",36)(7,"p",37),a(8),o(),n(9,"button",38),d("click",function(){g(e);let r=l();return u(r.copyWebhookUrl())}),n(10,"mat-icon"),a(11,"content_copy"),o(),n(12,"span"),a(13,"Copy URL"),o()()(),n(14,"p",30),a(15,"Use this URL to trigger the prompt via HTTP POST"),o()()}if(s&2){let e=l();c(8),M(e.getWebhookUrl())}}function qe(s,i){if(s&1&&(n(0,"div",14)(1,"mat-icon"),a(2,"error"),o(),n(3,"span"),a(4),o()()),s&2){let e=l();c(4),M(e.errorMessage)}}var k=class s{promptApi=_(z);dialogRef=_(te);configApi=_(R);snackBar=_(me);name="";description="";commands=[""];webhookEnabled=!1;threadLifetime="";source="local";isSaving=!1;errorMessage="";isAdmin=!1;isEditMode=!1;promptId="";data=_(ne);constructor(){this.isEditMode=this.data.mode==="edit"}ngOnInit(){this.configApi.getUserConfig().subscribe({next:i=>{this.isAdmin=i.groups?.includes("CODAY_ADMIN")??!1},error:i=>{console.error("[PROMPT_FORM] Error loading user config:",i),this.isAdmin=!1}}),this.isEditMode&&this.data.prompt&&(this.promptId=this.data.prompt.id,this.name=this.data.prompt.name,this.description=this.data.prompt.description,this.commands=[...this.data.prompt.commands],this.webhookEnabled=this.data.prompt.webhookEnabled,this.source=this.data.prompt.source)}addCommand(){this.commands.push("")}removeCommand(i){this.commands.length>1&&this.commands.splice(i,1)}trackByIndex(i){return i}normalizeName(){this.name=this.name.replace(/[\s_.,;:!?()[\]{}]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase()}validateForm(){return this.name.trim()?this.description.trim()?this.commands.filter(e=>e.trim()).length===0?(this.errorMessage="At least one command is required",!1):!0:(this.errorMessage="Description is required",!1):(this.errorMessage="Name is required",!1)}save(){if(this.errorMessage="",!this.validateForm())return;let i=this.commands.filter(e=>e.trim());if(this.isSaving=!0,this.isEditMode&&this.data.prompt){let e={name:this.name.trim(),description:this.description.trim(),commands:i,webhookEnabled:this.webhookEnabled};this.promptApi.updatePrompt(this.data.prompt.id,e).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:t=>{console.error("Error updating prompt:",t),this.errorMessage=t?.error?.error||t?.message||"Failed to update prompt",this.isSaving=!1}})}else{let e={name:this.name.trim(),description:this.description.trim(),commands:i,webhookEnabled:this.webhookEnabled,source:this.source};this.promptApi.createPrompt(e).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:t=>{console.error("Error creating prompt:",t),this.errorMessage=t?.error?.error||t?.message||"Failed to create prompt",this.isSaving=!1}})}}cancel(){this.dialogRef.close(!1)}getWebhookUrl(){return`${window.location.origin}/api/webhooks/${this.promptId}/execute`}copyWebhookUrl(){if(!this.webhookEnabled){this.snackBar.open("Webhook is not enabled","Close",{duration:3e3});return}if(!this.promptId){this.snackBar.open("Prompt must be saved before getting webhook URL","Close",{duration:3e3});return}let i=this.getWebhookUrl();navigator.clipboard.writeText(i).then(()=>{this.snackBar.open("Webhook URL copied to clipboard!","Close",{duration:3e3})}).catch(e=>{console.error("Failed to copy webhook URL:",e),this.snackBar.open("Failed to copy URL","Close",{duration:3e3})})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=F({type:s,selectors:[["app-prompt-form"]],decls:36,vars:11,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","my-prompt","required","",3,"ngModelChange","blur","ngModel"],["matInput","","placeholder","What does this prompt do?","rows","3","required","",3,"ngModelChange","ngModel"],[1,"commands-section"],[1,"section-header"],["mat-icon-button","","type","button","title","Add command",3,"click"],[1,"commands-list"],[1,"command-item"],[1,"source-section"],[1,"source-display"],[1,"webhook-section"],[1,"webhook-url-section"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],["appearance","outline",1,"command-field"],["matInput","","placeholder","Enter command with placeholders like \\{\\{key\\}\\}","rows","2",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove command",1,"remove-btn",3,"click","disabled"],[1,"source-options"],[1,"source-option"],["type","radio","name","source","value","local",3,"ngModelChange","ngModel"],[1,"source-content"],[1,"source-header"],[1,"source-icon"],[1,"source-label"],[1,"source-description"],["type","radio","name","source","value","project",3,"ngModelChange","ngModel"],[1,"hint"],[1,"source-badge"],[1,"checkbox-label"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"webhook-url-header"],[1,"webhook-icon"],[1,"webhook-url-content"],[1,"url-text"],["mat-raised-button","","color","accent","type","button",3,"click"]],template:function(e,t){e&1&&(n(0,"h2",0),a(1),o(),n(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),a(6,"Name"),o(),n(7,"input",3),y("ngModelChange",function(m){return v(t.name,m)||(t.name=m),m}),d("blur",function(){return t.normalizeName()}),o(),n(8,"mat-hint"),a(9,"A descriptive name (spaces and punctuation will be replaced with hyphens), will be used as command name"),o()(),n(10,"mat-form-field",2)(11,"mat-label"),a(12,"Description"),o(),n(13,"textarea",4),y("ngModelChange",function(m){return v(t.description,m)||(t.description=m),m}),o(),n(14,"mat-hint"),a(15,"Explain the purpose of this prompt, helps for searchability"),o()(),n(16,"div",5)(17,"div",6)(18,"h3"),a(19,"Prompts"),o(),n(20,"button",7),d("click",function(){return t.addCommand()}),n(21,"mat-icon"),a(22,"add"),o()()(),n(23,"div",8),H(24,Re,10,3,"div",9,q),o()(),h(26,ze,26,6,"div",10),h(27,Ue,10,6,"div",11),h(28,Ne,7,1,"div",12),h(29,je,16,1,"div",13),h(30,qe,5,1,"div",14),o()(),n(31,"mat-dialog-actions",15)(32,"button",16),d("click",function(){return t.cancel()}),a(33,"Cancel"),o(),n(34,"button",17),d("click",function(){return t.save()}),a(35),o()()),e&2&&(c(),M(t.isEditMode?"Edit Prompt":"Create Prompt"),c(6),x("ngModel",t.name),c(6),x("ngModel",t.description),c(11),Y(t.commands),c(2),b(t.isEditMode?-1:26),c(),b(t.isEditMode?27:-1),c(),b(t.isAdmin?28:-1),c(),b(t.isEditMode&&t.webhookEnabled&&t.isAdmin?29:-1),c(),b(t.errorMessage?30:-1),c(2),C("disabled",t.isSaving),c(2),C("disabled",t.isSaving),c(),O(" ",t.isSaving?"Saving...":"Save"," "))},dependencies:[ee,B,Pe,Me,xe,W,ve,V,se,ie,ae,re,I,ce,D,we,ye,Ce,he,be,fe,A,L,le],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:500px}@media(max-width:768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.commands-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:.5rem}.commands-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.commands-section[_ngcontent-%COMP%] .commands-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .command-field[_ngcontent-%COMP%]{flex:1}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{margin-top:8px}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:not-allowed}.webhook-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{width:18px;height:18px;cursor:pointer}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.95rem}.webhook-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.85rem;color:var(--color-text-secondary)}.webhook-url-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.75rem}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%] .webhook-icon[_ngcontent-%COMP%]{color:var(--color-primary)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;margin-bottom:.5rem}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%] .url-text[_ngcontent-%COMP%]{flex:1;margin:0;padding:.75rem;background:var(--color-bg);border:1px solid var(--color-border);border-radius:4px;font-family:monospace;font-size:.85rem;word-break:break-all;color:var(--color-text)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{white-space:nowrap;display:flex;align-items:center;gap:.5rem}.webhook-url-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}.source-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.source-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 1rem;font-size:1rem;font-weight:600}.source-section[_ngcontent-%COMP%] .source-options[_ngcontent-%COMP%]{display:flex;gap:1rem;margin-bottom:.75rem}@media(max-width:768px){.source-section[_ngcontent-%COMP%] .source-options[_ngcontent-%COMP%]{flex-direction:column}}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%]{flex:1;display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:var(--color-bg);border:2px solid var(--color-border);border-radius:8px;cursor:pointer;transition:all .2s ease}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%]:hover{border-color:var(--color-primary);background:var(--color-bg-hover)}.source-section[_ngcontent-%COMP%] .source-option.selected[_ngcontent-%COMP%]{border-color:var(--color-primary);background:var(--color-bg-hover);box-shadow:0 0 0 1px var(--color-primary)}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin-top:2px;cursor:pointer}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%]{flex:1}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.25rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-label[_ngcontent-%COMP%]{font-weight:600;font-size:.95rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-description[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);line-height:1.4}.source-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.thread-lifetime-disabled[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:#2196f30d;border:1px solid rgba(33,150,243,.2);border-radius:8px;margin-bottom:1rem}.thread-lifetime-disabled[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#2196f3cc;font-size:1.25rem;width:1.25rem;height:1.25rem;margin-top:2px}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;flex:1}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:.95rem;color:var(--color-text)}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{display:block;margin-top:.25rem;font-size:.85rem;color:var(--color-text-secondary);line-height:1.4}.source-display[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.source-display[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1rem;font-weight:600}.source-display[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem 1rem;border-radius:6px;font-size:.9rem;font-weight:500;margin-bottom:.5rem}.source-display[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.1rem}.source-display[_ngcontent-%COMP%] .source-badge.badge-local[_ngcontent-%COMP%]{background:#2196f31a;color:#2196f3;border:1px solid rgba(33,150,243,.3)}.source-display[_ngcontent-%COMP%] .source-badge.badge-project[_ngcontent-%COMP%]{background:#4caf501a;color:#4caf50;border:1px solid rgba(76,175,80,.3)}.source-display[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}"]})};var He=()=>[],Ye=s=>({id:s});function Ge(s,i){if(s&1&&(n(0,"div",6),a(1),o()),s&2){let e=l();c(),M(e.errorMessage())}}function Ke(s,i){if(s&1){let e=f();n(0,"ds-entity-card",8),d("selected",function(r){g(e);let m=l();return u(m.onEdit(r))}),G(1,9),n(2,"button",10),d("click",function(r){return r.stopPropagation()}),n(3,"mat-icon"),a(4,"more_vert"),o()(),K(),o()}if(s&2){let e=i.$implicit;l();let t=N(11);C("id",e.id)("name",e.name)("description",e.description)("badges",e.badges??J(6,He)),c(2),C("matMenuTriggerFor",t)("matMenuTriggerData",Q(7,Ye,e.id))}}function Je(s,i){if(s&1){let e=f();n(0,"button",11),d("click",function(){g(e);let r=l().id,m=l();return u(m.onToggleWebhook(r))}),n(1,"mat-icon"),a(2),o(),a(3),o()}if(s&2){let e=l().id,t=l();c(2),M(t.isWebhookEnabled(e)?"link_off":"link"),c(),O(" ",t.isWebhookEnabled(e)?"Disable webhook":"Enable webhook"," ")}}function Qe(s,i){if(s&1){let e=f();n(0,"button",11),d("click",function(){let r=g(e).id,m=l();return u(m.onEdit(r))}),n(1,"mat-icon"),a(2,"edit"),o(),a(3," Edit "),o(),h(4,Je,4,2,"button",12),n(5,"button",13),d("click",function(){let r=g(e).id,m=l();return u(m.onDelete(r))}),n(6,"mat-icon"),a(7,"delete"),o(),a(8," Delete "),o()}if(s&2){let e=l();c(4),b(e.isAdmin()?4:-1)}}var Te="system",De=class s{promptApi=_(z);configApi=_(R);location=_($);dialog=_(oe);prompts=P([]);isLoading=P(!1);errorMessage=P(null);showOnlyMine=P(!0);isAdmin=P(!1);currentUsername=P("");promptItems=Z(()=>{let i=this.prompts(),e=this.currentUsername(),r=this.showOnlyMine()&&e?i.filter(p=>this.isMyPrompt(p)):i,E=[...new Set(r.map(p=>p.createdBy))].sort((p,w)=>p===e&&w!==e?-1:w===e&&p!==e||p===Te?1:w===Te?-1:p.localeCompare(w)),j=[];for(let p of E){let w=p===e?`${p} (you)`:p;for(let S of r.filter(Ie=>Ie.createdBy===p))j.push({id:S.id,name:S.name,description:S.description,badges:this.buildBadges(S),groupKey:p,groupLabel:w})}return j});ngOnInit(){this.configApi.getUserConfig().subscribe({next:i=>{this.isAdmin.set(i.groups?.includes("CODAY_ADMIN")??!1),this.currentUsername.set(i.username??"")},error:()=>this.isAdmin.set(!1)}),this.loadPrompts()}loadPrompts(){this.isLoading.set(!0),this.promptApi.listPrompts().subscribe({next:i=>{this.prompts.set(i.filter(e=>!e.id.startsWith("builtin"))),this.isLoading.set(!1)},error:i=>{this.errorMessage.set(i?.error?.error??"Failed to load prompts"),this.isLoading.set(!1)}})}onBack(){this.location.back()}onCreate(){this.dialog.open(k,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadPrompts()})}onEdit(i){this.promptApi.getPrompt(i).subscribe({next:e=>{this.dialog.open(k,{width:"700px",maxHeight:"90vh",data:{mode:"edit",prompt:e}}).afterClosed().subscribe(r=>{r&&this.loadPrompts()})},error:e=>this.errorMessage.set(e?.error?.error??"Failed to load prompt")})}onDelete(i){confirm("Are you sure you want to delete this prompt?")&&this.promptApi.deletePrompt(i).subscribe({next:()=>this.loadPrompts(),error:e=>this.errorMessage.set(e?.error?.error??"Failed to delete prompt")})}onToggleWebhook(i){let e=this.prompts().find(r=>r.id===i);if(!e)return;(e.webhookEnabled?this.promptApi.disableWebhook(i):this.promptApi.enableWebhook(i)).subscribe({next:()=>this.loadPrompts(),error:r=>this.errorMessage.set(r?.error?.error??"Failed to toggle webhook")})}isWebhookEnabled(i){return this.prompts().find(e=>e.id===i)?.webhookEnabled??!1}isMyPrompt(i){let e=t=>t.replace(/[.\s]+/g,"_").toLowerCase();return e(i.createdBy)===e(this.currentUsername())}buildBadges(i){let e=[];return i.source==="local"?e.push({label:"local",variant:"info"}):e.push({label:"project",variant:"success"}),i.webhookEnabled&&e.push({label:"webhook",variant:"warning"}),e}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=F({type:s,selectors:[["app-prompt-list"]],decls:13,vars:5,consts:[["promptCard",""],["cardMenu","matMenu"],[1,"prompt-list-page"],["title","Prompts","cardMinWidth","320px","contentMaxWidth","1400px","searchPlaceholder","Filter prompts\u2026","emptyMessage","No prompts found.",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","mat-icon-button","","title","Back",3,"click"],["toolbar-extras","","color","primary",1,"prompt-list__mine-toggle",3,"ngModelChange","ngModel"],[1,"prompt-list__error"],["matMenuContent",""],[3,"selected","id","name","description","badges"],["dsCardActions",""],["mat-icon-button","",3,"click","matMenuTriggerFor","matMenuTriggerData"],["mat-menu-item","",3,"click"],["mat-menu-item",""],["mat-menu-item","",1,"prompt-list__delete-item",3,"click"]],template:function(e,t){if(e&1&&(n(0,"div",2)(1,"ds-entity-list",3),d("createRequested",function(){return t.onCreate()}),n(2,"button",4),d("click",function(){return t.onBack()}),n(3,"mat-icon"),a(4,"chevron_left"),o()(),n(5,"mat-slide-toggle",5),d("ngModelChange",function(m){return t.showOnlyMine.set(m)}),a(6," Mine "),o()(),h(7,Ge,2,1,"div",6),o(),U(8,Ke,5,9,"ng-template",null,0,X),n(10,"mat-menu",null,1),U(12,Qe,9,1,"ng-template",7),o()),e&2){let r=N(9);c(),C("items",t.promptItems())("showCreate",!0)("itemTemplate",r),c(4),C("ngModel",t.showOnlyMine()),c(2),b(t.errorMessage()?7:-1)}},dependencies:[Fe,Se,Ee,I,D,A,L,ke,Oe,_e,ge,de,pe,ue,B,W,V],styles:["[_nghost-%COMP%]{display:block;width:100%;min-height:100vh;background:var(--color-bg);overflow-y:auto}.prompt-list__mine-toggle[_ngcontent-%COMP%]{flex-shrink:0;font-size:.875rem}.prompt-list__delete-item[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.prompt-list__delete-item[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:inherit}.prompt-list__error[_ngcontent-%COMP%]{margin:1rem auto;max-width:900px;padding:.75rem 1rem;background:#dc262614;border:1px solid rgba(220,38,38,.25);border-radius:8px;color:var(--color-error, #ff3b30);font-size:.875rem}"]})};export{De as PromptListComponent};
|
|
1
|
+
import{b as me,c as le}from"./chunk-CND4W2V5.js";import{a as z}from"./chunk-SKVQOMLG.js";import{a as Oe,b as ke,c as R}from"./chunk-DPFJ6LFY.js";import{e as Ee,f as Se,g as Fe}from"./chunk-MLNEYB77.js";import"./chunk-3DDLKUVJ.js";import{a as de,b as pe,c as ge,d as ue,e as _e}from"./chunk-HYNHL5RY.js";import{c as he,d as be,i as Ce,j as fe,m as ye,n as we}from"./chunk-6JH2UGTU.js";import"./chunk-LCBWJP6Z.js";import{a as te,b as ne,d as oe,e as ie,f as re,g as ae,h as se}from"./chunk-HY7OYHZF.js";import"./chunk-UQNMPA5Y.js";import{a as L,b as A}from"./chunk-QFSZDRP2.js";import{A as ve,C as B,b as Me,c as Pe,g as W,m as V,p as xe}from"./chunk-DLU3TQID.js";import"./chunk-G4QDBE4F.js";import{O as D,Q as ce,S as I}from"./chunk-SDLTQWY6.js";import{Bb as f,Cc as $,Db as d,Fb as l,Jc as ee,Ka as c,Pb as N,Rb as T,Tb as a,Ub as M,Vb as O,Wa as F,Xb as x,Yb as v,Zb as y,ab as U,ac as J,bc as Q,ca as _,ga as g,ha as u,hc as X,kc as Z,lb as h,mb as b,nb as q,pb as H,qb as Y,rb as C,sb as n,ta as P,tb as o,yb as G,zb as K}from"./chunk-RNXBUYHW.js";function Re(s,i){if(s&1){let e=f();n(0,"div",9)(1,"mat-form-field",18)(2,"mat-label"),a(3),o(),n(4,"textarea",19),y("ngModelChange",function(r){let m=g(e).$index,E=l();return v(E.commands[m],r)||(E.commands[m]=r),u(r)}),o(),n(5,"mat-hint"),a(6,"Use placeholder for dynamic values"),o()(),n(7,"button",20),d("click",function(){let r=g(e).$index,m=l();return u(m.removeCommand(r))}),n(8,"mat-icon"),a(9,"delete"),o()()()}if(s&2){let e=i.$index,t=l();c(3),O("Prompt ",e+1),c(),x("ngModel",t.commands[e]),c(3),C("disabled",t.commands.length===1)}}function ze(s,i){if(s&1){let e=f();n(0,"div",10)(1,"h3"),a(2,"Save to"),o(),n(3,"div",21)(4,"label",22)(5,"input",23),y("ngModelChange",function(r){g(e);let m=l();return v(m.source,r)||(m.source=r),u(r)}),o(),n(6,"div",24)(7,"div",25)(8,"span",26),a(9,"\u{1F464}"),o(),n(10,"span",27),a(11,"Local"),o()(),n(12,"p",28),a(13,"Personal prompt in ~/.coday/... (not committed)"),o()()(),n(14,"label",22)(15,"input",29),y("ngModelChange",function(r){g(e);let m=l();return v(m.source,r)||(m.source=r),u(r)}),o(),n(16,"div",24)(17,"div",25)(18,"span",26),a(19,"\u{1F4E6}"),o(),n(20,"span",27),a(21,"Project"),o()(),n(22,"p",28),a(23,"Shared prompt in ./prompts/ (committable)"),o()()()(),n(24,"p",30),a(25,"Storage location is permanent and cannot be changed after creation"),o()()}if(s&2){let e=l();c(4),T("selected",e.source==="local"),c(),x("ngModel",e.source),c(9),T("selected",e.source==="project"),c(),x("ngModel",e.source)}}function Ue(s,i){if(s&1&&(n(0,"div",11)(1,"h3"),a(2,"Storage Location"),o(),n(3,"div",31)(4,"span",26),a(5),o(),n(6,"span",27),a(7),o()(),n(8,"p",30),a(9,"Cannot be changed after creation"),o()()),s&2){let e=l();c(3),T("badge-local",e.source==="local")("badge-project",e.source==="project"),c(2),M(e.source==="local"?"\u{1F464}":"\u{1F4E6}"),c(2),M(e.source==="local"?"Local":"Project")}}function Ne(s,i){if(s&1){let e=f();n(0,"div",12)(1,"label",32)(2,"input",33),y("ngModelChange",function(r){g(e);let m=l();return v(m.webhookEnabled,r)||(m.webhookEnabled=r),u(r)}),o(),n(3,"span"),a(4,"Enable webhook"),o()(),n(5,"p",30),a(6,"Enable webhook to trigger this prompt via HTTP POST"),o()()}if(s&2){let e=l();c(2),x("ngModel",e.webhookEnabled)}}function je(s,i){if(s&1){let e=f();n(0,"div",13)(1,"div",34)(2,"mat-icon",35),a(3,"link"),o(),n(4,"h4"),a(5,"Webhook URL"),o()(),n(6,"div",36)(7,"p",37),a(8),o(),n(9,"button",38),d("click",function(){g(e);let r=l();return u(r.copyWebhookUrl())}),n(10,"mat-icon"),a(11,"content_copy"),o(),n(12,"span"),a(13,"Copy URL"),o()()(),n(14,"p",30),a(15,"Use this URL to trigger the prompt via HTTP POST"),o()()}if(s&2){let e=l();c(8),M(e.getWebhookUrl())}}function qe(s,i){if(s&1&&(n(0,"div",14)(1,"mat-icon"),a(2,"error"),o(),n(3,"span"),a(4),o()()),s&2){let e=l();c(4),M(e.errorMessage)}}var k=class s{promptApi=_(z);dialogRef=_(te);configApi=_(R);snackBar=_(me);name="";description="";commands=[""];webhookEnabled=!1;threadLifetime="";source="local";isSaving=!1;errorMessage="";isAdmin=!1;isEditMode=!1;promptId="";data=_(ne);constructor(){this.isEditMode=this.data.mode==="edit"}ngOnInit(){this.configApi.getUserConfig().subscribe({next:i=>{this.isAdmin=i.groups?.includes("CODAY_ADMIN")??!1},error:i=>{console.error("[PROMPT_FORM] Error loading user config:",i),this.isAdmin=!1}}),this.isEditMode&&this.data.prompt&&(this.promptId=this.data.prompt.id,this.name=this.data.prompt.name,this.description=this.data.prompt.description,this.commands=[...this.data.prompt.commands],this.webhookEnabled=this.data.prompt.webhookEnabled,this.source=this.data.prompt.source)}addCommand(){this.commands.push("")}removeCommand(i){this.commands.length>1&&this.commands.splice(i,1)}trackByIndex(i){return i}normalizeName(){this.name=this.name.replace(/[\s_.,;:!?()[\]{}]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase()}validateForm(){return this.name.trim()?this.description.trim()?this.commands.filter(e=>e.trim()).length===0?(this.errorMessage="At least one command is required",!1):!0:(this.errorMessage="Description is required",!1):(this.errorMessage="Name is required",!1)}save(){if(this.errorMessage="",!this.validateForm())return;let i=this.commands.filter(e=>e.trim());if(this.isSaving=!0,this.isEditMode&&this.data.prompt){let e={name:this.name.trim(),description:this.description.trim(),commands:i,webhookEnabled:this.webhookEnabled};this.promptApi.updatePrompt(this.data.prompt.id,e).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:t=>{console.error("Error updating prompt:",t),this.errorMessage=t?.error?.error||t?.message||"Failed to update prompt",this.isSaving=!1}})}else{let e={name:this.name.trim(),description:this.description.trim(),commands:i,webhookEnabled:this.webhookEnabled,source:this.source};this.promptApi.createPrompt(e).subscribe({next:()=>{this.isSaving=!1,this.dialogRef.close(!0)},error:t=>{console.error("Error creating prompt:",t),this.errorMessage=t?.error?.error||t?.message||"Failed to create prompt",this.isSaving=!1}})}}cancel(){this.dialogRef.close(!1)}getWebhookUrl(){return`${window.location.origin}/api/webhooks/${this.promptId}/execute`}copyWebhookUrl(){if(!this.webhookEnabled){this.snackBar.open("Webhook is not enabled","Close",{duration:3e3});return}if(!this.promptId){this.snackBar.open("Prompt must be saved before getting webhook URL","Close",{duration:3e3});return}let i=this.getWebhookUrl();navigator.clipboard.writeText(i).then(()=>{this.snackBar.open("Webhook URL copied to clipboard!","Close",{duration:3e3})}).catch(e=>{console.error("Failed to copy webhook URL:",e),this.snackBar.open("Failed to copy URL","Close",{duration:3e3})})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=F({type:s,selectors:[["app-prompt-form"]],decls:36,vars:11,consts:[["mat-dialog-title",""],[1,"form-container"],["appearance","outline",1,"full-width"],["matInput","","placeholder","my-prompt","required","",3,"ngModelChange","blur","ngModel"],["matInput","","placeholder","What does this prompt do?","rows","3","required","",3,"ngModelChange","ngModel"],[1,"commands-section"],[1,"section-header"],["mat-icon-button","","type","button","title","Add command",3,"click"],[1,"commands-list"],[1,"command-item"],[1,"source-section"],[1,"source-display"],[1,"webhook-section"],[1,"webhook-url-section"],[1,"error-message"],["align","end"],["mat-button","",3,"click","disabled"],["mat-raised-button","","color","primary",3,"click","disabled"],["appearance","outline",1,"command-field"],["matInput","","placeholder","Enter command with placeholders like \\{\\{key\\}\\}","rows","2",3,"ngModelChange","ngModel"],["mat-icon-button","","type","button","title","Remove command",1,"remove-btn",3,"click","disabled"],[1,"source-options"],[1,"source-option"],["type","radio","name","source","value","local",3,"ngModelChange","ngModel"],[1,"source-content"],[1,"source-header"],[1,"source-icon"],[1,"source-label"],[1,"source-description"],["type","radio","name","source","value","project",3,"ngModelChange","ngModel"],[1,"hint"],[1,"source-badge"],[1,"checkbox-label"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"webhook-url-header"],[1,"webhook-icon"],[1,"webhook-url-content"],[1,"url-text"],["mat-raised-button","","color","accent","type","button",3,"click"]],template:function(e,t){e&1&&(n(0,"h2",0),a(1),o(),n(2,"mat-dialog-content")(3,"div",1)(4,"mat-form-field",2)(5,"mat-label"),a(6,"Name"),o(),n(7,"input",3),y("ngModelChange",function(m){return v(t.name,m)||(t.name=m),m}),d("blur",function(){return t.normalizeName()}),o(),n(8,"mat-hint"),a(9,"A descriptive name (spaces and punctuation will be replaced with hyphens), will be used as command name"),o()(),n(10,"mat-form-field",2)(11,"mat-label"),a(12,"Description"),o(),n(13,"textarea",4),y("ngModelChange",function(m){return v(t.description,m)||(t.description=m),m}),o(),n(14,"mat-hint"),a(15,"Explain the purpose of this prompt, helps for searchability"),o()(),n(16,"div",5)(17,"div",6)(18,"h3"),a(19,"Prompts"),o(),n(20,"button",7),d("click",function(){return t.addCommand()}),n(21,"mat-icon"),a(22,"add"),o()()(),n(23,"div",8),H(24,Re,10,3,"div",9,q),o()(),h(26,ze,26,6,"div",10),h(27,Ue,10,6,"div",11),h(28,Ne,7,1,"div",12),h(29,je,16,1,"div",13),h(30,qe,5,1,"div",14),o()(),n(31,"mat-dialog-actions",15)(32,"button",16),d("click",function(){return t.cancel()}),a(33,"Cancel"),o(),n(34,"button",17),d("click",function(){return t.save()}),a(35),o()()),e&2&&(c(),M(t.isEditMode?"Edit Prompt":"Create Prompt"),c(6),x("ngModel",t.name),c(6),x("ngModel",t.description),c(11),Y(t.commands),c(2),b(t.isEditMode?-1:26),c(),b(t.isEditMode?27:-1),c(),b(t.isAdmin?28:-1),c(),b(t.isEditMode&&t.webhookEnabled&&t.isAdmin?29:-1),c(),b(t.errorMessage?30:-1),c(2),C("disabled",t.isSaving),c(2),C("disabled",t.isSaving),c(),O(" ",t.isSaving?"Saving...":"Save"," "))},dependencies:[ee,B,Pe,Me,xe,W,ve,V,se,ie,ae,re,I,ce,D,we,ye,Ce,he,be,fe,A,L,le],styles:[".form-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0;min-width:500px}@media(max-width:768px){.form-container[_ngcontent-%COMP%]{min-width:auto}}.full-width[_ngcontent-%COMP%]{width:100%}.commands-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:.5rem}.commands-section[_ngcontent-%COMP%] .section-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.commands-section[_ngcontent-%COMP%] .commands-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.5rem}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .command-field[_ngcontent-%COMP%]{flex:1}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{margin-top:8px}.commands-section[_ngcontent-%COMP%] .command-item[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:not-allowed}.webhook-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{width:18px;height:18px;cursor:pointer}.webhook-section[_ngcontent-%COMP%] .checkbox-label[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-size:.95rem}.webhook-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:.5rem 0 0;font-size:.85rem;color:var(--color-text-secondary)}.webhook-url-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.75rem}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%] .webhook-icon[_ngcontent-%COMP%]{color:var(--color-primary)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-header[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0;font-size:1rem;font-weight:600}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;margin-bottom:.5rem}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%] .url-text[_ngcontent-%COMP%]{flex:1;margin:0;padding:.75rem;background:var(--color-bg);border:1px solid var(--color-border);border-radius:4px;font-family:monospace;font-size:.85rem;word-break:break-all;color:var(--color-text)}.webhook-url-section[_ngcontent-%COMP%] .webhook-url-content[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{white-space:nowrap;display:flex;align-items:center;gap:.5rem}.webhook-url-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary)}.error-message[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:.75rem;background:#f443361a;border:1px solid var(--color-error);border-radius:4px;color:var(--color-error)}.error-message[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:1.25rem;width:1.25rem;height:1.25rem}.error-message[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1}.source-section[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.source-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 1rem;font-size:1rem;font-weight:600}.source-section[_ngcontent-%COMP%] .source-options[_ngcontent-%COMP%]{display:flex;gap:1rem;margin-bottom:.75rem}@media(max-width:768px){.source-section[_ngcontent-%COMP%] .source-options[_ngcontent-%COMP%]{flex-direction:column}}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%]{flex:1;display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:var(--color-bg);border:2px solid var(--color-border);border-radius:8px;cursor:pointer;transition:all .2s ease}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%]:hover{border-color:var(--color-primary);background:var(--color-bg-hover)}.source-section[_ngcontent-%COMP%] .source-option.selected[_ngcontent-%COMP%]{border-color:var(--color-primary);background:var(--color-bg-hover);box-shadow:0 0 0 1px var(--color-primary)}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{margin-top:2px;cursor:pointer}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%]{flex:1}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.25rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-header[_ngcontent-%COMP%] .source-label[_ngcontent-%COMP%]{font-weight:600;font-size:.95rem}.source-section[_ngcontent-%COMP%] .source-option[_ngcontent-%COMP%] .source-content[_ngcontent-%COMP%] .source-description[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);line-height:1.4}.source-section[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}.thread-lifetime-disabled[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.75rem;padding:1rem;background:#2196f30d;border:1px solid rgba(33,150,243,.2);border-radius:8px;margin-bottom:1rem}.thread-lifetime-disabled[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:#2196f3cc;font-size:1.25rem;width:1.25rem;height:1.25rem;margin-top:2px}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;flex:1}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-size:.95rem;color:var(--color-text)}.thread-lifetime-disabled[_ngcontent-%COMP%] p[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{display:block;margin-top:.25rem;font-size:.85rem;color:var(--color-text-secondary);line-height:1.4}.source-display[_ngcontent-%COMP%]{padding:1rem;background:var(--color-surface);border-radius:8px;border:1px solid var(--color-border)}.source-display[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 .75rem;font-size:1rem;font-weight:600}.source-display[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.5rem;padding:.5rem 1rem;border-radius:6px;font-size:.9rem;font-weight:500;margin-bottom:.5rem}.source-display[_ngcontent-%COMP%] .source-badge[_ngcontent-%COMP%] .source-icon[_ngcontent-%COMP%]{font-size:1.1rem}.source-display[_ngcontent-%COMP%] .source-badge.badge-local[_ngcontent-%COMP%]{background:#2196f31a;color:#2196f3;border:1px solid rgba(33,150,243,.3)}.source-display[_ngcontent-%COMP%] .source-badge.badge-project[_ngcontent-%COMP%]{background:#4caf501a;color:#4caf50;border:1px solid rgba(76,175,80,.3)}.source-display[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary);font-style:italic}"]})};var He=()=>[],Ye=s=>({id:s});function Ge(s,i){if(s&1&&(n(0,"div",6),a(1),o()),s&2){let e=l();c(),M(e.errorMessage())}}function Ke(s,i){if(s&1){let e=f();n(0,"ds-entity-card",8),d("selected",function(r){g(e);let m=l();return u(m.onEdit(r))}),G(1,9),n(2,"button",10),d("click",function(r){return r.stopPropagation()}),n(3,"mat-icon"),a(4,"more_vert"),o()(),K(),o()}if(s&2){let e=i.$implicit;l();let t=N(11);C("id",e.id)("name",e.name)("description",e.description)("badges",e.badges??J(6,He)),c(2),C("matMenuTriggerFor",t)("matMenuTriggerData",Q(7,Ye,e.id))}}function Je(s,i){if(s&1){let e=f();n(0,"button",11),d("click",function(){g(e);let r=l().id,m=l();return u(m.onToggleWebhook(r))}),n(1,"mat-icon"),a(2),o(),a(3),o()}if(s&2){let e=l().id,t=l();c(2),M(t.isWebhookEnabled(e)?"link_off":"link"),c(),O(" ",t.isWebhookEnabled(e)?"Disable webhook":"Enable webhook"," ")}}function Qe(s,i){if(s&1){let e=f();n(0,"button",11),d("click",function(){let r=g(e).id,m=l();return u(m.onEdit(r))}),n(1,"mat-icon"),a(2,"edit"),o(),a(3," Edit "),o(),h(4,Je,4,2,"button",12),n(5,"button",13),d("click",function(){let r=g(e).id,m=l();return u(m.onDelete(r))}),n(6,"mat-icon"),a(7,"delete"),o(),a(8," Delete "),o()}if(s&2){let e=l();c(4),b(e.isAdmin()?4:-1)}}var Te="system",De=class s{promptApi=_(z);configApi=_(R);location=_($);dialog=_(oe);prompts=P([]);isLoading=P(!1);errorMessage=P(null);showOnlyMine=P(!0);isAdmin=P(!1);currentUsername=P("");promptItems=Z(()=>{let i=this.prompts(),e=this.currentUsername(),r=this.showOnlyMine()&&e?i.filter(p=>this.isMyPrompt(p)):i,E=[...new Set(r.map(p=>p.createdBy))].sort((p,w)=>p===e&&w!==e?-1:w===e&&p!==e||p===Te?1:w===Te?-1:p.localeCompare(w)),j=[];for(let p of E){let w=p===e?`${p} (you)`:p;for(let S of r.filter(Ie=>Ie.createdBy===p))j.push({id:S.id,name:S.name,description:S.description,badges:this.buildBadges(S),groupKey:p,groupLabel:w})}return j});ngOnInit(){this.configApi.getUserConfig().subscribe({next:i=>{this.isAdmin.set(i.groups?.includes("CODAY_ADMIN")??!1),this.currentUsername.set(i.username??"")},error:()=>this.isAdmin.set(!1)}),this.loadPrompts()}loadPrompts(){this.isLoading.set(!0),this.promptApi.listPrompts().subscribe({next:i=>{this.prompts.set(i.filter(e=>!e.id.startsWith("builtin"))),this.isLoading.set(!1)},error:i=>{this.errorMessage.set(i?.error?.error??"Failed to load prompts"),this.isLoading.set(!1)}})}onBack(){this.location.back()}onCreate(){this.dialog.open(k,{width:"700px",maxHeight:"90vh",data:{mode:"create"}}).afterClosed().subscribe(e=>{e&&this.loadPrompts()})}onEdit(i){this.promptApi.getPrompt(i).subscribe({next:e=>{this.dialog.open(k,{width:"700px",maxHeight:"90vh",data:{mode:"edit",prompt:e}}).afterClosed().subscribe(r=>{r&&this.loadPrompts()})},error:e=>this.errorMessage.set(e?.error?.error??"Failed to load prompt")})}onDelete(i){confirm("Are you sure you want to delete this prompt?")&&this.promptApi.deletePrompt(i).subscribe({next:()=>this.loadPrompts(),error:e=>this.errorMessage.set(e?.error?.error??"Failed to delete prompt")})}onToggleWebhook(i){let e=this.prompts().find(r=>r.id===i);if(!e)return;(e.webhookEnabled?this.promptApi.disableWebhook(i):this.promptApi.enableWebhook(i)).subscribe({next:()=>this.loadPrompts(),error:r=>this.errorMessage.set(r?.error?.error??"Failed to toggle webhook")})}isWebhookEnabled(i){return this.prompts().find(e=>e.id===i)?.webhookEnabled??!1}isMyPrompt(i){let e=t=>t.replace(/[.\s]+/g,"_").toLowerCase();return e(i.createdBy)===e(this.currentUsername())}buildBadges(i){let e=[];return i.source==="local"?e.push({label:"local",variant:"info"}):e.push({label:"project",variant:"success"}),i.webhookEnabled&&e.push({label:"webhook",variant:"warning"}),e}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=F({type:s,selectors:[["app-prompt-list"]],decls:13,vars:5,consts:[["promptCard",""],["cardMenu","matMenu"],[1,"prompt-list-page"],["title","Prompts","cardMinWidth","320px","contentMaxWidth","1400px","searchPlaceholder","Filter prompts\u2026","emptyMessage","No prompts found.",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","mat-icon-button","","title","Back",3,"click"],["toolbar-extras","","color","primary",1,"prompt-list__mine-toggle",3,"ngModelChange","ngModel"],[1,"prompt-list__error"],["matMenuContent",""],[3,"selected","id","name","description","badges"],["dsCardActions",""],["mat-icon-button","",3,"click","matMenuTriggerFor","matMenuTriggerData"],["mat-menu-item","",3,"click"],["mat-menu-item",""],["mat-menu-item","",1,"prompt-list__delete-item",3,"click"]],template:function(e,t){if(e&1&&(n(0,"div",2)(1,"ds-entity-list",3),d("createRequested",function(){return t.onCreate()}),n(2,"button",4),d("click",function(){return t.onBack()}),n(3,"mat-icon"),a(4,"chevron_left"),o()(),n(5,"mat-slide-toggle",5),d("ngModelChange",function(m){return t.showOnlyMine.set(m)}),a(6," Mine "),o()(),h(7,Ge,2,1,"div",6),o(),U(8,Ke,5,9,"ng-template",null,0,X),n(10,"mat-menu",null,1),U(12,Qe,9,1,"ng-template",7),o()),e&2){let r=N(9);c(),C("items",t.promptItems())("showCreate",!0)("itemTemplate",r),c(4),C("ngModel",t.showOnlyMine()),c(2),b(t.errorMessage()?7:-1)}},dependencies:[Fe,Se,Ee,I,D,A,L,ke,Oe,_e,ge,de,pe,ue,B,W,V],styles:["[_nghost-%COMP%]{display:block;width:100%;min-height:100vh;background:var(--color-bg);overflow-y:auto}.prompt-list__mine-toggle[_ngcontent-%COMP%]{flex-shrink:0;font-size:.875rem}.prompt-list__delete-item[_ngcontent-%COMP%]{color:var(--color-error, #ff3b30)}.prompt-list__delete-item[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{color:inherit}.prompt-list__error[_ngcontent-%COMP%]{margin:1rem auto;max-width:900px;padding:.75rem 1rem;background:#dc262614;border:1px solid rgba(220,38,38,.25);border-radius:8px;color:var(--color-error, #ff3b30);font-size:.875rem}"]})};export{De as PromptListComponent};
|