@whoz-oss/coday-client 0.249.0 → 0.249.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/3rdpartylicenses.txt +372 -372
- package/browser/chunk-6uQvW5vO.js +1 -0
- package/browser/chunk-8QCOKWfy.js +1 -0
- package/browser/chunk-B0QeL_YS.js +474 -0
- package/browser/chunk-B1T1lhxO.js +1 -0
- package/browser/chunk-B4ZxVpmQ.js +1 -0
- package/browser/chunk-B9VW5ZdD.js +1 -0
- package/browser/chunk-BGG8qTjD.js +1 -0
- package/browser/chunk-BHrJwQJY.js +1 -0
- package/browser/chunk-BWVGuXWV.js +1 -0
- package/browser/chunk-BXRE8Jnn.js +1 -0
- package/browser/chunk-BXeg32ej.js +1 -0
- package/browser/chunk-BYobt-yL.js +1 -0
- package/browser/chunk-Bb8FM5N7.js +1 -0
- package/browser/chunk-BbkTgcYb.js +1 -0
- package/browser/chunk-BngP4FHh.js +2 -0
- package/browser/chunk-Bo7V2O_x.js +1 -0
- package/browser/chunk-CEFRpdhC.js +1 -0
- package/browser/chunk-CESBNo1v.js +4 -0
- package/browser/chunk-CI20rCP1.js +1 -0
- package/browser/chunk-CMgbU-FY.js +1 -0
- package/browser/chunk-CRujMca4.js +1 -0
- package/browser/chunk-CSLsbjtc.js +429 -0
- package/browser/chunk-CSWaefpi.js +1 -0
- package/browser/chunk-C_hps2N_.js +1 -0
- package/browser/chunk-CawleOYk.js +1 -0
- package/browser/chunk-CeEsFGfn.js +276 -0
- package/browser/chunk-CfgXrte_.js +1 -0
- package/browser/chunk-ChlM0KaI.js +1 -0
- package/browser/chunk-Cl7N3gK-.js +2 -0
- package/browser/chunk-CoVKXwLW.js +7 -0
- package/browser/chunk-CtCrz21E.js +1 -0
- package/browser/chunk-CujZ5wxO.js +1 -0
- package/browser/chunk-Cvmc37VM.js +1 -0
- package/browser/chunk-CyUSpM0s.js +1 -0
- package/browser/chunk-D36CcRIa.js +1 -0
- package/browser/chunk-D3bTMcOe.js +1 -0
- package/browser/chunk-D4O2SdR-.js +1 -0
- package/browser/chunk-D615HDbJ.js +37 -0
- package/browser/chunk-D8jkRlhn.js +141 -0
- package/browser/chunk-DATqkmXk.js +1 -0
- package/browser/chunk-DF9JuMSS.js +1 -0
- package/browser/chunk-DIeUX6U7.js +1 -0
- package/browser/chunk-DVw6VVSF.js +182 -0
- package/browser/chunk-DW95Jf_o.js +1 -0
- package/browser/chunk-DWXHIgAs.js +1 -0
- package/browser/chunk-Dc58xQxP.js +1 -0
- package/browser/chunk-Df2NmKyO.js +190 -0
- package/browser/chunk-Dh70Sw4n.js +675 -0
- package/browser/chunk-DqOy3vx6.js +55 -0
- package/browser/chunk-DrzUXE6a.js +1 -0
- package/browser/chunk-DuetvIR9.js +1 -0
- package/browser/chunk-Dv3y4cq8.js +508 -0
- package/browser/chunk-DxyVrxwh.js +1 -0
- package/browser/chunk-Ims5pjdx.js +1 -0
- package/browser/chunk-Js79q0Hk.js +1 -0
- package/browser/chunk-NZ2JSd9Y.js +976 -0
- package/browser/chunk-R1YuCBfk.js +1 -0
- package/browser/chunk-Tnt17Uum.js +1 -0
- package/browser/chunk-TsE9fL5L.js +1 -0
- package/browser/chunk-ZgaZX2Mw.js +1 -0
- package/browser/chunk-cxvtBPGk.js +1 -0
- package/browser/chunk-hivMYdms.js +5 -0
- package/browser/chunk-hpkckHAH.js +1 -0
- package/browser/chunk-otU95DGd.js +1 -0
- package/browser/chunk-rdNDu_G5.js +61 -0
- package/browser/chunk-sQ2hJaJy.js +1 -0
- package/browser/chunk-tiXMntK-.js +1 -0
- package/browser/index.html +1 -1
- package/browser/main-CERDHS7N.js +1811 -0
- package/package.json +14 -11
- package/browser/chunk-2PWIGCN2.js +0 -4
- package/browser/chunk-3FDPLGME.js +0 -1
- package/browser/chunk-46V5PCBB.js +0 -1
- package/browser/chunk-4KA7TIB4.js +0 -1
- package/browser/chunk-4NPMNHQN.js +0 -1
- package/browser/chunk-4OSUCDSF.js +0 -1
- package/browser/chunk-4QBMPKYR.js +0 -1
- package/browser/chunk-4U47ZPZP.js +0 -1
- package/browser/chunk-5GITXCTT.js +0 -1
- package/browser/chunk-6PGRBK22.js +0 -2
- package/browser/chunk-6XX7GME4.js +0 -1
- package/browser/chunk-7HQ3TFIP.js +0 -1
- package/browser/chunk-7OGOI6WM.js +0 -1
- package/browser/chunk-7P7KJUWV.js +0 -1
- package/browser/chunk-7SEGP55P.js +0 -1
- package/browser/chunk-7TO465TS.js +0 -1
- package/browser/chunk-ABU55DK2.js +0 -1
- package/browser/chunk-AIC4U2MU.js +0 -1
- package/browser/chunk-AKLSF437.js +0 -32
- package/browser/chunk-AS2L77JV.js +0 -2
- package/browser/chunk-AZOMCTR7.js +0 -1
- package/browser/chunk-AZSB2H23.js +0 -1
- package/browser/chunk-B5ZVUFND.js +0 -1
- package/browser/chunk-BK6WNBAO.js +0 -8
- package/browser/chunk-BTOJ27OO.js +0 -3
- package/browser/chunk-C6PO7H3U.js +0 -1
- package/browser/chunk-C7VJCZQE.js +0 -2
- package/browser/chunk-CHEXA6RY.js +0 -5
- package/browser/chunk-CJQ4FDXR.js +0 -1
- package/browser/chunk-CLTMZI2I.js +0 -2
- package/browser/chunk-CNUJJQAG.js +0 -4
- package/browser/chunk-CXNTZ6XI.js +0 -1
- package/browser/chunk-DIJGQPPG.js +0 -1
- package/browser/chunk-EMVHTOJY.js +0 -1
- package/browser/chunk-EWQMM44H.js +0 -1
- package/browser/chunk-F7UYEPIO.js +0 -1
- package/browser/chunk-FAHNOZ4S.js +0 -1
- package/browser/chunk-FELDR7HF.js +0 -1
- package/browser/chunk-FFXIBE7G.js +0 -1
- package/browser/chunk-FL2HNVMC.js +0 -1
- package/browser/chunk-G5RWG2GK.js +0 -9
- package/browser/chunk-GFK56P4B.js +0 -3
- package/browser/chunk-GIIRKWUO.js +0 -1
- package/browser/chunk-GNUSEOSN.js +0 -1
- package/browser/chunk-GOERELOH.js +0 -1
- package/browser/chunk-GS52HX7Q.js +0 -1
- package/browser/chunk-IPWNT3U4.js +0 -1
- package/browser/chunk-IWVV3FNS.js +0 -1
- package/browser/chunk-J6NBYNRX.js +0 -3
- package/browser/chunk-JOFWSHOO.js +0 -1
- package/browser/chunk-JVZA4C5U.js +0 -1
- package/browser/chunk-K2ZZYRVT.js +0 -1
- package/browser/chunk-KHCLVVXY.js +0 -1
- package/browser/chunk-KHMEGI4Z.js +0 -1
- package/browser/chunk-KSZNM45C.js +0 -2
- package/browser/chunk-L2LMV4CM.js +0 -1
- package/browser/chunk-LPIKNWWZ.js +0 -1
- package/browser/chunk-LVZVGPMV.js +0 -6
- package/browser/chunk-MHOEYCWL.js +0 -1
- package/browser/chunk-MIVM4FAD.js +0 -1
- package/browser/chunk-MNWA4UGA.js +0 -1
- package/browser/chunk-MXD6ICBN.js +0 -1
- package/browser/chunk-NHUXMXD2.js +0 -1
- package/browser/chunk-NLCT6PBH.js +0 -1
- package/browser/chunk-NQHQFPW5.js +0 -2
- package/browser/chunk-NWFFZ2FW.js +0 -1
- package/browser/chunk-NXINMPV4.js +0 -1
- package/browser/chunk-OCMS2KMG.js +0 -1
- package/browser/chunk-OO2H5F7U.js +0 -6
- package/browser/chunk-OOO6KSSL.js +0 -1
- package/browser/chunk-P4UYIBTK.js +0 -1
- package/browser/chunk-P5FCG3WF.js +0 -1
- package/browser/chunk-PGEMQVT2.js +0 -1
- package/browser/chunk-PI7ZIR5W.js +0 -1
- package/browser/chunk-PNPPZSOI.js +0 -1
- package/browser/chunk-QVW2GZXC.js +0 -1
- package/browser/chunk-QYUULQIF.js +0 -1
- package/browser/chunk-RB7N2NWN.js +0 -1
- package/browser/chunk-ROOPYJTV.js +0 -1
- package/browser/chunk-RSTB4RTA.js +0 -1
- package/browser/chunk-RUXH3KF5.js +0 -1
- package/browser/chunk-SFQE4GQ6.js +0 -1
- package/browser/chunk-SN27D3CH.js +0 -1
- package/browser/chunk-SPV5SLNS.js +0 -2
- package/browser/chunk-SQACXL4U.js +0 -1
- package/browser/chunk-SVOSTUY5.js +0 -1
- package/browser/chunk-SXFAR5TU.js +0 -1
- package/browser/chunk-TSYL5EEO.js +0 -61
- package/browser/chunk-TTHFWEW7.js +0 -6
- package/browser/chunk-UAC4ZZCA.js +0 -1
- package/browser/chunk-UAVOIVZW.js +0 -2
- package/browser/chunk-UKR2PSUI.js +0 -1
- package/browser/chunk-VCUQMGKI.js +0 -1
- package/browser/chunk-VMYKE4ZC.js +0 -1
- package/browser/chunk-VN2SNJFT.js +0 -1
- package/browser/chunk-WARAZYNV.js +0 -1
- package/browser/chunk-WLOUHJRC.js +0 -1
- package/browser/chunk-WNJYWSOR.js +0 -1
- package/browser/chunk-WRMHUQWQ.js +0 -1
- package/browser/chunk-WVXEP3PL.js +0 -1
- package/browser/chunk-XIV35L24.js +0 -1
- package/browser/chunk-XORVTVXX.js +0 -1
- package/browser/chunk-XXVFHAN5.js +0 -270
- package/browser/chunk-XZIT26QS.js +0 -1
- package/browser/chunk-YFCRBVWD.js +0 -1
- package/browser/chunk-YFONUBPG.js +0 -1
- package/browser/chunk-YGUO4DH3.js +0 -1
- package/browser/chunk-YJOXSEUO.js +0 -1
- package/browser/chunk-YV2SJQAM.js +0 -1
- package/browser/chunk-Z3AHFIZF.js +0 -1
- package/browser/chunk-ZEQWC4IU.js +0 -1
- package/browser/main-7VP3QZBV.js +0 -1
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
import{a as ue,b as w}from"./chunk-JVZA4C5U.js";import{D as $,J as re,P as le,R as ie,S as oe,V as g,Xc as E,Z as c,a as S,b as C,ca as a,d,h as j,i as r,m as k,n as D,pa as de,t as ne,u as se}from"./chunk-CHEXA6RY.js";var N=class n{http=a(E);projectState=a(w);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads`}listThreads(){return this.http.get(this.getBaseUrl())}listAllThreads(){return this.http.get("/api/threads")}getThread(e){return this.http.get(`${this.getBaseUrl()}/${e}`)}createThread(e){let t=e?{name:e}:{};return this.http.post(this.getBaseUrl(),t)}updateThread(e,t){return this.http.put(`${this.getBaseUrl()}/${e}`,{name:t})}updateThreadUsers(e,t){return this.http.put(`${this.getBaseUrl()}/${e}`,{users:t})}starThread(e){return this.http.post(`${this.getBaseUrl()}/${e}/star`,{})}unstarThread(e){return this.http.delete(`${this.getBaseUrl()}/${e}/star`)}deleteThread(e){return this.http.delete(`${this.getBaseUrl()}/${e}`)}stopThread(e){return this.http.post(`${this.getBaseUrl()}/${e}/stop`,{})}getThreadMessages(e){return this.http.get(`${this.getBaseUrl()}/${e}/messages`)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var U=class n{selectedThreadIdSubject=new r(null);isLoadingSubject=new r(!1);isLoadingThreadListSubject=new r(!1);refreshThreadListSubject=new j;threadListSubject=new r([]);hasLoadedOncePerProject=new Map;currentProjectName=null;isLoading$=this.isLoadingSubject.asObservable();isLoadingThreadList$=this.isLoadingThreadListSubject.asObservable();threadApi=a(N);projectStateService=a(w);projectApi=a(ue);projectName$=this.projectStateService.selectedProject$.pipe(ne(e=>e?.name),re());constructor(){se([this.projectName$,this.refreshThreadListSubject.asObservable().pipe(ie(void 0))]).pipe(g(([e])=>{e!==this.currentProjectName&&(console.log("[THREAD_STATE] Project changed, clearing thread list"),this.threadListSubject.next([]),this.currentProjectName=e),e?this.hasLoadedOncePerProject.get(e)?console.log("[THREAD_STATE] Refreshing thread list for project",e,"(no spinner)"):(console.log("[THREAD_STATE] Initial load for project",e,"- showing spinner"),this.isLoadingThreadListSubject.next(!0)):(console.log("[THREAD_STATE] No project selected, hiding spinner"),this.isLoadingThreadListSubject.next(!1))}),oe(([e])=>e?(console.log("[THREAD_STATE] Fetching threads for project:",e),this.threadApi.listThreads().pipe(ne(t=>({threads:t,projectName:e})),$(t=>(console.error("[THREAD_STATE] Error loading thread list:",t),k({threads:[],projectName:e}))))):(console.log("[THREAD_STATE] No project selected, returning empty list"),k({threads:[],projectName:null}))),g(({threads:e,projectName:t})=>{console.log("[THREAD_STATE] Thread list loaded:",e.length,"threads for project",t),t&&this.hasLoadedOncePerProject.set(t,!0),this.isLoadingThreadListSubject.next(!1),this.threadListSubject.next(e)})).subscribe()}threadList$=this.threadListSubject.asObservable();refreshSelectedThreadSubject=new j;selectedThread$=se([this.projectName$,this.selectedThreadIdSubject.pipe(re()),this.refreshSelectedThreadSubject.pipe(ie(void 0))]).pipe(oe(([e,t])=>!e||!t?k(null):(this.isLoadingSubject.next(!0),this.threadApi.getThread(t).pipe(le({bufferSize:1,refCount:!0})))),g(()=>{this.isLoadingSubject.next(!1)}));selectThread(e){this.selectedThreadIdSubject.next(e)}getSelectedThreadId(){return this.selectedThreadIdSubject.value}getSelectedThreadIdOrThrow(){let e=this.selectedThreadIdSubject.value;if(!e)throw new Error("[THREAD_STATE] No thread selected");return e}clearSelection(){this.selectedThreadIdSubject.next(null)}stop(){let e=this.selectedThreadIdSubject.value;if(!e){console.error("[THREAD_STATE] Cannot stop: no thread selected");return}console.log("[THREAD_STATE] Stopping thread:",e),this.threadApi.stopThread(e).subscribe({next:t=>console.log("[THREAD_STATE] Stop signal sent:",t.message),error:t=>console.error("[THREAD_STATE] Error stopping thread:",t)})}refreshThreadList(){console.log("[THREAD_STATE] Manually refreshing thread list"),this.refreshThreadListSubject.next()}updateStarLocal(e,t,s){let P=this.threadListSubject.value.map(l=>{if(l.id!==e)return l;let p=l.starring||[];return t&&!p.includes(s)?C(S({},l),{starring:[...p,s]}):!t&&p.includes(s)?C(S({},l),{starring:p.filter(I=>I!==s)}):l});this.threadListSubject.next(P)}refreshSelectedThread(){this.refreshSelectedThreadSubject.next()}updateThreadUsers(e,t){return this.threadApi.updateThreadUsers(e,t).pipe(g(()=>{this.refreshThreadList()}),$(s=>(console.error("[THREAD_STATE] Error updating thread users:",s),D(()=>s))))}markDone(e){let t=this.projectStateService.getSelectedProjectId();if(!t){console.error("[THREAD_STATE] Cannot mark done: no project selected");return}this.projectApi.markThreadDone(t,e).subscribe({next:()=>this.refreshThreadList(),error:s=>console.error("[THREAD_STATE] Failed to mark thread as done:",s)})}markActive(e){let t=this.projectStateService.getSelectedProjectId();if(!t){console.error("[THREAD_STATE] Cannot mark active: no project selected");return}this.projectApi.markThreadActive(t,e).subscribe({next:()=>this.refreshThreadList(),error:s=>console.error("[THREAD_STATE] Failed to mark thread as active:",s)})}renameThread(e,t){let s=t.trim();return!s||s.length===0?(console.error("[THREAD_STATE] Cannot rename thread: name is empty after trimming"),D(()=>new Error("Thread name cannot be empty"))):(console.log("[THREAD_STATE] Renaming thread:",e,"to:",s),this.threadApi.updateThread(e,s).pipe(g(i=>{console.log("[THREAD_STATE] Thread renamed successfully:",i),this.refreshThreadList()}),$(i=>(console.error("[THREAD_STATE] Error renaming thread:",i),D(()=>i)))))}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var he=class n{http=a(E);usernameSubject=new r(null);authEnabledSubject=new r(!1);username$=this.usernameSubject.asObservable();authEnabled$=this.authEnabledSubject.asObservable();fetchCurrentUser(){return this.http.get("/api/user/me").pipe(g(e=>{this.usernameSubject.next(e.username),this.authEnabledSubject.next(e.authEnabled)}))}getUsername(){return this.usernameSubject.value}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var L=class n{STORAGE_KEY="coday-preferences";isDesktopApp=!1;electronStorage=null;voiceLanguageSubject=new r("en-US");voiceLanguage$=this.voiceLanguageSubject.asObservable();voiceInputModeSubject=new r("browser");voiceInputMode$=this.voiceInputModeSubject.asObservable();enterToSendSubject=new r(!0);enterToSend$=this.enterToSendSubject.asObservable();voiceAnnounceEnabledSubject=new r(!1);voiceAnnounceEnabled$=this.voiceAnnounceEnabledSubject.asObservable();voiceModeSubject=new r("speech");voiceMode$=this.voiceModeSubject.asObservable();voiceReadFullTextSubject=new r(!1);voiceReadFullText$=this.voiceReadFullTextSubject.asObservable();voiceVolumeSubject=new r(.8);voiceVolume$=this.voiceVolumeSubject.asObservable();voiceRateSubject=new r(1.2);voiceRate$=this.voiceRateSubject.asObservable();selectedVoiceSubject=new r(null);selectedVoice$=this.selectedVoiceSubject.asObservable();printTechnicalMessagesSubject=new r(!1);printTechnicalMessages$=this.printTechnicalMessagesSubject.asObservable();hideTechnicalMessagesSubject=new r(!0);hideTechnicalMessages$=this.hideTechnicalMessagesSubject.asObservable();hideWarningMessagesSubject=new r(!1);hideWarningMessages$=this.hideWarningMessagesSubject.asObservable();agentNotificationEnabledSubject=new r(!1);agentNotificationEnabled$=this.agentNotificationEnabledSubject.asObservable();notificationSoundEnabledSubject=new r(!1);notificationSoundEnabled$=this.notificationSoundEnabledSubject.asObservable();browserNotificationEnabledSubject=new r(!1);browserNotificationEnabled$=this.browserNotificationEnabledSubject.asObservable();themeSubject=new r("light");theme$=this.themeSubject.asObservable();missionPreviewEnabledSubject=new r(!1);missionPreviewEnabled$=this.missionPreviewEnabledSubject.asObservable();constructor(){console.log("[PREFERENCES] Initializing preferences service"),typeof window<"u"&&window.codayDesktop?.storage&&(this.isDesktopApp=!0,this.electronStorage=window.codayDesktop.storage,console.log("[PREFERENCES] Running in desktop app mode with persistent storage")),this.initializePreferences()}initializePreferences(){this.isDesktopApp?this.loadPreferencesAsync():this.loadPreferencesSync()}loadPreferencesSync(){let e=this.getPreferenceSync("voiceLanguage","en-US")??"en-US";this.voiceLanguageSubject.next(e),console.log("[PREFERENCES] Voice language initialized to:",e);let t=this.getPreferenceSync("useEnterToSend",!0)??!0;this.enterToSendSubject.next(t),console.log("[PREFERENCES] Enter to send initialized to:",t);let s=this.getPreferenceSync("voiceAnnounceEnabled",!1)??!1;this.voiceAnnounceEnabledSubject.next(s);let i=this.getPreferenceSync("voiceMode","speech")??"speech";this.voiceModeSubject.next(i);let P=this.getPreferenceSync("voiceReadFullText",!1)??!1;this.voiceReadFullTextSubject.next(P);let l=this.getPreferenceSync("voiceVolume",.8)??.8;this.voiceVolumeSubject.next(l);let p=this.getPreferenceSync("voiceRate",1.2)??1.2;this.voiceRateSubject.next(p);let I=this.getPreferenceSync("selectedVoice",null)??null;this.selectedVoiceSubject.next(I);let K=this.getPreferenceSync("printTechnicalMessages",!1)??!1;this.printTechnicalMessagesSubject.next(K);let G=this.getPreferenceSync("hideTechnicalMessages",!0)??!0;this.hideTechnicalMessagesSubject.next(G);let Q=this.getPreferenceSync("hideWarningMessages",!1)??!1;this.hideWarningMessagesSubject.next(Q);let J=this.getPreferenceSync("agentNotificationEnabled",!1)??!1;this.agentNotificationEnabledSubject.next(J);let Y=this.getPreferenceSync("notificationSoundEnabled",!0)??!0;this.notificationSoundEnabledSubject.next(Y);let X=this.getPreferenceSync("browserNotificationEnabled",!1)??!1;this.browserNotificationEnabledSubject.next(X);let Z=this.getPreferenceSync("theme","light")??"light";this.themeSubject.next(Z);let ee=this.getPreferenceSync("missionPreviewEnabled",!1)??!1;this.missionPreviewEnabledSubject.next(ee);let te=this.getPreferenceSync("voiceInputMode","browser")??"browser";this.voiceInputModeSubject.next(te),console.log("[PREFERENCES] All preferences initialized successfully")}loadPreferencesAsync(){return d(this,null,function*(){let e=(yield this.getPreferenceAsync("voiceLanguage","en-US"))??"en-US";this.voiceLanguageSubject.next(e),console.log("[PREFERENCES] Voice language initialized to:",e);let t=(yield this.getPreferenceAsync("useEnterToSend",!0))??!0;this.enterToSendSubject.next(t),console.log("[PREFERENCES] Enter to send initialized to:",t);let s=(yield this.getPreferenceAsync("voiceAnnounceEnabled",!1))??!1;this.voiceAnnounceEnabledSubject.next(s);let i=(yield this.getPreferenceAsync("voiceMode","speech"))??"speech";this.voiceModeSubject.next(i);let P=(yield this.getPreferenceAsync("voiceReadFullText",!1))??!1;this.voiceReadFullTextSubject.next(P);let l=(yield this.getPreferenceAsync("voiceVolume",.8))??.8;this.voiceVolumeSubject.next(l);let p=(yield this.getPreferenceAsync("voiceRate",1.2))??1.2;this.voiceRateSubject.next(p);let I=(yield this.getPreferenceAsync("selectedVoice",null))??null;this.selectedVoiceSubject.next(I);let K=(yield this.getPreferenceAsync("printTechnicalMessages",!1))??!1;this.printTechnicalMessagesSubject.next(K);let G=(yield this.getPreferenceAsync("hideTechnicalMessages",!0))??!0;this.hideTechnicalMessagesSubject.next(G);let Q=(yield this.getPreferenceAsync("hideWarningMessages",!1))??!1;this.hideWarningMessagesSubject.next(Q);let J=(yield this.getPreferenceAsync("agentNotificationEnabled",!1))??!1;this.agentNotificationEnabledSubject.next(J);let Y=(yield this.getPreferenceAsync("notificationSoundEnabled",!0))??!0;this.notificationSoundEnabledSubject.next(Y);let X=(yield this.getPreferenceAsync("browserNotificationEnabled",!1))??!1;this.browserNotificationEnabledSubject.next(X);let Z=(yield this.getPreferenceAsync("theme","light"))??"light";this.themeSubject.next(Z);let ee=(yield this.getPreferenceAsync("missionPreviewEnabled",!1))??!1;this.missionPreviewEnabledSubject.next(ee);let te=(yield this.getPreferenceAsync("voiceInputMode","browser"))??"browser";this.voiceInputModeSubject.next(te),console.log("[PREFERENCES] All preferences initialized successfully (async)")})}getPreference(e,t){return this.getPreferenceSync(e,t)}getPreferenceSync(e,t){try{let s=localStorage.getItem(this.STORAGE_KEY);if(!s)return t;let i=JSON.parse(s);return i[e]!==void 0?i[e]:t}catch(s){return t}}getPreferenceAsync(e,t){return d(this,null,function*(){if(!this.electronStorage)return this.getPreferenceSync(e,t);try{let s=yield this.electronStorage.get(this.STORAGE_KEY);if(!s)return t;let i=JSON.parse(s);return i[e]!==void 0?i[e]:t}catch(s){return t}})}setPreference(e,t){this.isDesktopApp?this.setPreferenceAsync(e,t):this.setPreferenceSync(e,t)}setPreferenceSync(e,t){try{let s=localStorage.getItem(this.STORAGE_KEY),i=s?JSON.parse(s):{};i[e]=t,localStorage.setItem(this.STORAGE_KEY,JSON.stringify(i)),this.updateSubject(e,t)}catch(s){console.error("Failed to set preference:",s)}}setPreferenceAsync(e,t){return d(this,null,function*(){if(!this.electronStorage){this.setPreferenceSync(e,t);return}try{let s=yield this.electronStorage.get(this.STORAGE_KEY),i=s?JSON.parse(s):{};i[e]=t,yield this.electronStorage.set(this.STORAGE_KEY,JSON.stringify(i)),this.updateSubject(e,t)}catch(s){console.error("Failed to set preference:",s)}})}updateSubject(e,t){e==="voiceLanguage"&&this.voiceLanguageSubject.next(t),e==="useEnterToSend"&&this.enterToSendSubject.next(t),e==="voiceAnnounceEnabled"&&this.voiceAnnounceEnabledSubject.next(t),e==="voiceMode"&&this.voiceModeSubject.next(t),e==="voiceReadFullText"&&this.voiceReadFullTextSubject.next(t),e==="voiceVolume"&&this.voiceVolumeSubject.next(t),e==="voiceRate"&&this.voiceRateSubject.next(t),e==="selectedVoice"&&this.selectedVoiceSubject.next(t),e==="printTechnicalMessages"&&this.printTechnicalMessagesSubject.next(t),e==="hideTechnicalMessages"&&this.hideTechnicalMessagesSubject.next(t),e==="hideWarningMessages"&&this.hideWarningMessagesSubject.next(t),e==="agentNotificationEnabled"&&this.agentNotificationEnabledSubject.next(t),e==="notificationSoundEnabled"&&this.notificationSoundEnabledSubject.next(t),e==="browserNotificationEnabled"&&this.browserNotificationEnabledSubject.next(t),e==="theme"&&this.themeSubject.next(t),e==="voiceInputMode"&&this.voiceInputModeSubject.next(t),e==="missionPreviewEnabled"&&this.missionPreviewEnabledSubject.next(t)}setVoiceLanguage(e){console.log("[PREFERENCES] Setting voice language to:",e),this.setPreference("voiceLanguage",e)}getVoiceLanguage(){return this.getPreference("voiceLanguage","en-US")??"en-US"}setVoiceInputMode(e){console.log("[PREFERENCES] Setting voice input mode to:",e),this.setPreference("voiceInputMode",e)}getVoiceInputMode(){return this.getPreference("voiceInputMode","browser")??"browser"}setEnterToSend(e){console.log("[PREFERENCES] Setting Enter to send to:",e),this.setPreference("useEnterToSend",e)}getEnterToSend(){return this.getPreference("useEnterToSend",!1)??!1}setVoiceAnnounceEnabled(e){console.log("[PREFERENCES] Setting voice announce enabled to:",e),this.setPreference("voiceAnnounceEnabled",e)}getVoiceAnnounceEnabled(){return this.getPreference("voiceAnnounceEnabled",!1)??!1}setVoiceMode(e){console.log("[PREFERENCES] Setting voice mode to:",e),this.setPreference("voiceMode",e)}getVoiceMode(){return this.getPreference("voiceMode","speech")??"speech"}setVoiceReadFullText(e){console.log("[PREFERENCES] Setting voice read full text to:",e),this.setPreference("voiceReadFullText",e)}getVoiceReadFullText(){return this.getPreference("voiceReadFullText",!1)??!1}setVoiceVolume(e){let t=Math.max(0,Math.min(1,e));console.log("[PREFERENCES] Setting voice volume to:",t),this.setPreference("voiceVolume",t)}getVoiceVolume(){return this.getPreference("voiceVolume",.8)??.8}setVoiceRate(e){let t=Math.max(.5,Math.min(2,e));console.log("[PREFERENCES] Setting voice rate to:",t),this.setPreference("voiceRate",t)}getVoiceRate(){return this.getPreference("voiceRate",1.2)??1.2}setSelectedVoice(e){console.log("[PREFERENCES] Setting selected voice to:",e),this.setPreference("selectedVoice",e)}getSelectedVoice(){return this.getPreference("selectedVoice",null)??null}setPrintTechnicalMessages(e){console.log("[PREFERENCES] Setting print technical messages to:",e),this.setPreference("printTechnicalMessages",e)}getPrintTechnicalMessages(){return this.getPreference("printTechnicalMessages",!1)??!1}setHideTechnicalMessages(e){console.log("[PREFERENCES] Setting hide technical messages to:",e),this.setPreference("hideTechnicalMessages",e)}getHideTechnicalMessages(){return this.getPreference("hideTechnicalMessages",!0)??!0}setHideWarningMessages(e){console.log("[PREFERENCES] Setting hide warning messages to:",e),this.setPreference("hideWarningMessages",e)}getHideWarningMessages(){return this.getPreference("hideWarningMessages",!1)??!1}setAgentNotificationEnabled(e){console.log("[PREFERENCES] Setting agent notification enabled to:",e),this.setPreference("agentNotificationEnabled",e)}getAgentNotificationEnabled(){return this.getPreference("agentNotificationEnabled",!1)??!1}setNotificationSoundEnabled(e){console.log("[PREFERENCES] Setting notification sound enabled to:",e),this.setPreference("notificationSoundEnabled",e)}getNotificationSoundEnabled(){return this.getPreference("notificationSoundEnabled",!0)??!0}setBrowserNotificationEnabled(e){console.log("[PREFERENCES] Setting browser notification enabled to:",e),this.setPreference("browserNotificationEnabled",e)}getBrowserNotificationEnabled(){return this.getPreference("browserNotificationEnabled",!1)??!1}setMissionPreviewEnabled(e){this.setPreference("missionPreviewEnabled",e)}getMissionPreviewEnabled(){return this.getPreference("missionPreviewEnabled",!1)??!1}getMissionPreviewPanelWidth(){return this.getPreference("missionPreviewPanelWidth",33)??33}setMissionPreviewPanelWidth(e){this.setPreference("missionPreviewPanelWidth",e)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};function ae(n,e=80){if(n.length<=e)return n;try{if(n.trim().startsWith("{")||n.trim().startsWith("[")){let t=JSON.parse(n),s=JSON.stringify(t);return s.length<=e?s:s.substring(0,e)+`...(${s.length} chars)`}}catch(t){}return n.substring(0,e)+"..."}var o=class{constructor(e,t){this.type=t;if(e.timestamp)this.timestamp=e.timestamp;else{let s=Math.random().toString(36).substring(2,7);this.timestamp=`${new Date().toISOString()}-${s}`}this.parentKey=e.parentKey,this.threadId=e.threadId,this.length=0}timestamp;parentKey;static type;length;threadId;get date(){let e=this.timestamp.lastIndexOf("-");if(e>0){let t=this.timestamp.substring(e+1);if(t.length===5&&/^[a-z0-9]+$/.test(t))return new Date(this.timestamp.substring(0,e))}return new Date(this.timestamp)}},q=class extends o{invite;constructor(e,t){super(e,t),this.invite=e.invite}buildAnswer(e){return new u({answer:e,parentKey:this.timestamp,invite:this.invite})}},F=class n extends o{static type="heartbeat";constructor(e){super(e,n.type)}},f=class n extends q{defaultValue;static type="invite";constructor(e){super(e,n.type),this.defaultValue=e.defaultValue}},We="InviteEventDefault",u=class n extends o{answer;invite;name;silent;static type="answer";constructor(e){super(e,n.type),this.answer=e.answer??"No answer",this.invite=e.invite,this.name=e.name,this.silent=e.silent}},A=class n extends o{speaker;text;static type="text";constructor(e){super(e,n.type),this.speaker=e.speaker,this.text=e.text}},B=class n extends o{chunk;static type="text_chunk";constructor(e){super(e,n.type),this.chunk=e.chunk,this.length=this.chunk.length}},M=class n extends o{warning;static type="warn";constructor(e){super(e,n.type),this.warning=e.warning}},h=class n extends o{error;static type="error";constructor(e){super(e,n.type),this.error=e.error}},b=class n extends q{options;optionalQuestion;allowFreeText;static type="choice";constructor(e){super(e,n.type),this.options=Array.isArray(e.options)?e.options:[],this.optionalQuestion=e.optionalQuestion,this.allowFreeText=e.allowFreeText??!1}},v=class n extends o{toolRequestId;name;args;static type="tool_request";constructor(e){super(e,n.type),this.toolRequestId=e.toolRequestId??this.timestamp,this.name=e.name,this.args=e.args,this.length=this.args.length+this.name.length+this.toolRequestId.length+20}buildResponse(e){return new m({output:e,toolRequestId:this.toolRequestId,parentKey:this.timestamp})}toSingleLineString(e=50){let t=ae(this.args,e);return`\u{1F527} ${this.name}(${t})`}},m=class n extends o{toolRequestId;output;static type="tool_response";constructor(e){if(super(e,n.type),this.toolRequestId=e.toolRequestId||this.timestamp||new Date().toISOString(),this.output=e.output,typeof this.output=="string")this.length=this.output.length+this.toolRequestId.length+20;else if(this.output.type==="text")this.length=this.output.content.length+this.toolRequestId.length+20;else if(this.output.type==="image"){let t=(this.output.width??0)*(this.output.height??0)/750;this.length=(t?t*3.5:this.output.content.length)+this.toolRequestId.length+20}else this.length=this.toolRequestId.length+20}getTextOutput(){return typeof this.output=="string"?this.output:this.output.type==="text"?this.output.content:this.output.type==="image"?`[Image: ${this.output.mimeType}]`:""}toSingleLineString(e=50){let t=this.getTextOutput(),s=ae(t,e),i=typeof this.output!="string"&&this.output.type==="image"?" [image]":"";return`\u2B91 ${s}${i}`}},O=class n extends o{static type="thinking";static debounce=5e3;constructor(e){super(e,n.type)}},y=class n extends o{summary;static type="summary";constructor(e){super(e,n.type),this.summary=e.summary,this.length=this.summary.length}toSingleLineString(e=80){return`\u{1F4CB} Summary: ${ae(this.summary,e)}`}},T=class n extends o{role;name;content;static type="message";constructor(e){super(e,n.type),this.role=e.role,this.name=e.name;let t=e.content;Array.isArray(t)?this.content=t.map(s=>typeof s=="string"?{type:"text",content:s}:s):typeof t=="string"?this.content=[{type:"text",content:t}]:t&&typeof t=="object"&&"type"in t?this.content=[t]:this.content=[],this.length=this.content.map(s=>{if(s.type==="text")return s.content.length;if(s.type==="image"){let i=(s.width||0)*(s.height||0)/750;return i?i*3.5:s.content.length}return s.type==="audio"?s.transcription?.length??100:0}).reduce((s,i)=>s+i,0)}getTextContent(){return this.content.filter(e=>e.type==="text").map(e=>e.content).join(`
|
|
2
|
-
`)}},V=class n extends o{threadId;name;summary;users;static type="thread_update";constructor(e){super(e,n.type),this.threadId=e.threadId,this.name=e.name,this.summary=e.summary,this.users=e.users}},z=class n extends o{filename;operation;size;mimeType;static type="file";constructor(e){super(e,n.type),this.filename=e.filename,this.operation=e.operation,this.size=e.size,this.mimeType=e.mimeType}toSingleLineString(){let e=this.operation==="created"?"\u{1F4C4}":this.operation==="updated"?"\u{1F4DD}":"\u{1F5D1}\uFE0F",t=this.size?` (${(this.size/1024).toFixed(1)} KB)`:"";return`${e} ${this.operation}: ${this.filename}${t}`}},H=class n extends o{authUrl;state;integrationName;static type="oauth_request";constructor(e){super(e,n.type),this.authUrl=e.authUrl,this.state=e.state,this.integrationName=e.integrationName}},R=class n extends o{subThreadId;agentName;static type="delegation";constructor(e){super(e,n.type),this.subThreadId=e.subThreadId,this.agentName=e.agentName}},W=class n extends o{static type="usage";inputTokens;outputTokens;contextWindow;price;iterations;cacheReadTokens;constructor(e){super(e,n.type),this.inputTokens=e.inputTokens??0,this.outputTokens=e.outputTokens??0,this.contextWindow=e.contextWindow??0,this.price=e.price??0,this.iterations=e.iterations??0,this.cacheReadTokens=e.cacheReadTokens??0}},_=class n extends o{code;state;integrationName;error;errorDescription;static type="oauth_callback";constructor(e){super(e,n.type),this.code=e.code,this.state=e.state,this.integrationName=e.integrationName,this.error=e.error,this.errorDescription=e.errorDescription}},be={[T.type]:T,[u.type]:u,[b.type]:b,[R.type]:R,[h.type]:h,[F.type]:F,[f.type]:f,[v.type]:v,[m.type]:m,[A.type]:A,[B.type]:B,[O.type]:O,[M.type]:M,[V.type]:V,[y.type]:y,[z.type]:z,[H.type]:H,[_.type]:_,[W.type]:W};function ce(n){let e=be[n.type];return e?new e(n):void 0}var Xe=[{id:"builtin-plan",name:"plan",description:"Build a plan to complete the given task",source:"builtin",commands:[`@ We start a 3 phase process to build a comprehensive execution plan for the following task:
|
|
3
|
-
|
|
4
|
-
<task>
|
|
5
|
-
{{PARAMETERS}}
|
|
6
|
-
</task>
|
|
7
|
-
|
|
8
|
-
There will be 3 phases:
|
|
9
|
-
1. Research and understanding
|
|
10
|
-
2. Clarifying questions
|
|
11
|
-
3. Plan creation
|
|
12
|
-
|
|
13
|
-
Do not try to do all at once, wait for my request at each time.
|
|
14
|
-
|
|
15
|
-
Now we start with phase 1:
|
|
16
|
-
|
|
17
|
-
1. **Analyze the request** to identify:
|
|
18
|
-
- Core requirements and objectives
|
|
19
|
-
- Implicit assumptions or expectations
|
|
20
|
-
- Technical scope and constraints
|
|
21
|
-
|
|
22
|
-
2. **Research relevant context** using available tools:
|
|
23
|
-
- Use whatever tools you have available (file reading, API calls, search, etc.)
|
|
24
|
-
- Gather information about existing patterns, structures, and conventions
|
|
25
|
-
- Identify relevant files, modules, or resources
|
|
26
|
-
- Document key findings briefly
|
|
27
|
-
|
|
28
|
-
3. **Assess feasibility**:
|
|
29
|
-
- Identify potential challenges or blockers
|
|
30
|
-
- Note any dependencies or prerequisites
|
|
31
|
-
- Consider alternative approaches if applicable
|
|
32
|
-
|
|
33
|
-
Do not assume you have specific tools - use what's available to you.
|
|
34
|
-
|
|
35
|
-
Do not produce any document at this stage as you will have access to the accumulated research results later.
|
|
36
|
-
`,`@ let's continue with Phase 2: Clarifying Questions regarding the initial task.
|
|
37
|
-
|
|
38
|
-
<task>
|
|
39
|
-
{{PARAMETERS}}
|
|
40
|
-
</task>
|
|
41
|
-
|
|
42
|
-
Based on your research and understanding:
|
|
43
|
-
|
|
44
|
-
1. **Identify ambiguities** or missing information that could impact the completion of the task
|
|
45
|
-
- no boundaries
|
|
46
|
-
- insufficient definition of done
|
|
47
|
-
- lack of pre-requisites
|
|
48
|
-
|
|
49
|
-
2. **Ask focused questions** if clarification is needed:
|
|
50
|
-
- Use the 'invite' or 'choice' tools for user input
|
|
51
|
-
- Keep questions concise and specific
|
|
52
|
-
- Prioritize questions that significantly impact the approach
|
|
53
|
-
|
|
54
|
-
3. **Skip this phase** if the requirements are clear enough to proceed
|
|
55
|
-
|
|
56
|
-
Remember: Only ask questions that are truly necessary to create a solid plan.`,`@ finish with Phase 3: Plan Creation
|
|
57
|
-
|
|
58
|
-
Break down the task into 3-10 clear, actionable steps. Each step should be substantial enough to represent meaningful progress, but focused enough to be completed in one session.
|
|
59
|
-
|
|
60
|
-
Create a detailed execution plan:
|
|
61
|
-
- if you have access to the exchange area, save the plan there as 'plan.md'.
|
|
62
|
-
- otherwise, output the plan in the conversation.
|
|
63
|
-
- do not write any other document
|
|
64
|
-
|
|
65
|
-
The plan must follow this Markdown structure:
|
|
66
|
-
|
|
67
|
-
# Execution Plan: [Task Title]
|
|
68
|
-
|
|
69
|
-
## Overview
|
|
70
|
-
1-2 sentence summary of what will be accomplished.
|
|
71
|
-
|
|
72
|
-
## Context
|
|
73
|
-
Key information and constraints identified during research:
|
|
74
|
-
- Relevant patterns/conventions found
|
|
75
|
-
- Constraints or limitations
|
|
76
|
-
- Dependencies or prerequisites
|
|
77
|
-
- Key resources or materials involved
|
|
78
|
-
|
|
79
|
-
## Steps
|
|
80
|
-
|
|
81
|
-
### Step 1: [Step Title]
|
|
82
|
-
- **What to do**: Clear description of the action to take
|
|
83
|
-
- **Resources needed**: List files, tools, information, or materials required
|
|
84
|
-
- **Expected outcome**: What should be produced or achieved
|
|
85
|
-
- **Validation**: How to verify this step is complete
|
|
86
|
-
- **Dependencies**: Which previous steps must complete first (or "None")
|
|
87
|
-
|
|
88
|
-
### Step 2: [Step Title]
|
|
89
|
-
[Same structure as Step 1]
|
|
90
|
-
|
|
91
|
-
[Continue for all steps...]
|
|
92
|
-
|
|
93
|
-
## Success Criteria
|
|
94
|
-
How to verify the task is fully complete:
|
|
95
|
-
1. Objective measures of completion
|
|
96
|
-
2. Quality checks or review points
|
|
97
|
-
3. Final validation steps
|
|
98
|
-
|
|
99
|
-
## Risks & Considerations
|
|
100
|
-
- Potential challenges or obstacles
|
|
101
|
-
- Alternative approaches considered
|
|
102
|
-
- Areas requiring special attention
|
|
103
|
-
- Future improvements or follow-up items
|
|
104
|
-
|
|
105
|
-
---
|
|
106
|
-
|
|
107
|
-
After outputting the plan in the right place (in exchange or in conversation or according to user directives):
|
|
108
|
-
- do not produce other outputs nor documents
|
|
109
|
-
- do not start executing the plan`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""},{id:"builtin-execute-plan",name:"execute-plan",description:"Execute a previously created plan step by step, with validation and progress tracking.",source:"builtin",commands:[`@ Execute the plan from the exchange area or outlined previously in the conversation:
|
|
110
|
-
|
|
111
|
-
## Preparation
|
|
112
|
-
1. **Load the plan**: Read from exchange area (plan.md) or use previously discussed plan
|
|
113
|
-
2. **Review**: Understand the overall objective, context, and step sequence
|
|
114
|
-
3. **Pre-check**: Verify prerequisites are met; report any obvious issues
|
|
115
|
-
|
|
116
|
-
## Step-by-Step Execution
|
|
117
|
-
|
|
118
|
-
For each step in order:
|
|
119
|
-
|
|
120
|
-
1. **Announce**: State which step you're starting and what you'll do
|
|
121
|
-
2. **Check dependencies**: Verify required previous steps are complete
|
|
122
|
-
3. **Execute**: Perform the actions specified in the step
|
|
123
|
-
4. **Validate**: Apply the validation criteria from the plan
|
|
124
|
-
5. **Report**: Confirm completion and note any deviations
|
|
125
|
-
|
|
126
|
-
**For significant or risky steps**: Ask user confirmation before proceeding (use 'choice' tool)
|
|
127
|
-
|
|
128
|
-
## Issue Handling
|
|
129
|
-
|
|
130
|
-
If a step fails:
|
|
131
|
-
- Report the issue clearly
|
|
132
|
-
- Suggest solutions (retry, skip if non-critical, or stop)
|
|
133
|
-
- Use 'choice' tool to ask how to proceed if needed
|
|
134
|
-
|
|
135
|
-
## Completion
|
|
136
|
-
|
|
137
|
-
1. **Final verification**: Apply success criteria from the plan
|
|
138
|
-
2. **Summary**: Report what was accomplished, any deviations, validation results, and next steps
|
|
139
|
-
|
|
140
|
-
## Guidelines
|
|
141
|
-
- Follow the plan's order unless circumstances require adaptation
|
|
142
|
-
- Communicate progress clearly at each step, without excessive details
|
|
143
|
-
- Ask for guidance when the plan is unclear or issues arise`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""},{id:"builtin-re-prompt",name:"re-prompt",description:"Transform a vague request into a detailed, actionable prompt",source:"builtin",commands:[`@ I need you to analyze and reformulate the following request to make it more precise and actionable.
|
|
144
|
-
|
|
145
|
-
## User's initial request
|
|
146
|
-
|
|
147
|
-
{{PARAMETERS}}
|
|
148
|
-
|
|
149
|
-
## Your task
|
|
150
|
-
|
|
151
|
-
1. **Analyze the request** to identify:
|
|
152
|
-
- What is explicitly stated
|
|
153
|
-
- What is implicit or assumed
|
|
154
|
-
- What information is missing or ambiguous
|
|
155
|
-
- The likely intent behind the request
|
|
156
|
-
|
|
157
|
-
2. **Ask clarifying questions** if needed:
|
|
158
|
-
- If the request is too vague or has multiple interpretations
|
|
159
|
-
- If critical information is missing
|
|
160
|
-
- Use the 'invite' or 'choice' tools to gather necessary details
|
|
161
|
-
|
|
162
|
-
3. **Reformulate the request** into a clear, detailed, and actionable prompt:
|
|
163
|
-
- Make implicit requirements explicit
|
|
164
|
-
- Add relevant context from the current project
|
|
165
|
-
- Specify expected outcomes or deliverables
|
|
166
|
-
- Break down complex requests into clear steps if needed
|
|
167
|
-
- Use precise technical terminology when appropriate
|
|
168
|
-
|
|
169
|
-
4. **Present the reformulated request** and ask for confirmation:
|
|
170
|
-
- Show the enhanced version clearly
|
|
171
|
-
- Explain key changes or additions you made
|
|
172
|
-
- Ask if this matches the user's intent
|
|
173
|
-
|
|
174
|
-
The goal is to transform a rough idea into a well-defined request that will produce better AI responses.`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""},{id:"builtin-memory-learn",name:"memory-learn",description:"Extract and memorize new knowledge gained from recent context",source:"builtin",commands:[`@ Learn about the following topic and memorize relevant insights if defined:
|
|
175
|
-
|
|
176
|
-
<topic>
|
|
177
|
-
{{PARAMETERS}}
|
|
178
|
-
</topic>
|
|
179
|
-
|
|
180
|
-
If no specific topic is provided, extract learnings from the entire recent conversation context.
|
|
181
|
-
|
|
182
|
-
## Process
|
|
183
|
-
|
|
184
|
-
1. **Identify new knowledge**: From the recent conversation context, identify what you learned that:
|
|
185
|
-
- Was not in the initially given context
|
|
186
|
-
- Is specific to this user or project (not generic knowledge)
|
|
187
|
-
- Is useful and worth remembering
|
|
188
|
-
- Represents understanding, not just file copies
|
|
189
|
-
|
|
190
|
-
2. **Organize insights**: Split the knowledge into cohesive subjects, each with:
|
|
191
|
-
- **Title**: Short and descriptive (one sentence maximum)
|
|
192
|
-
- **Content**: Detailed explanation of what was learned
|
|
193
|
-
- Length: at most 3 paragraphs or short extracts and notes
|
|
194
|
-
- Format: Well-structured markdown
|
|
195
|
-
- Focus: Specific patterns, decisions, constraints, or insights
|
|
196
|
-
|
|
197
|
-
3. **Check for redundancy**: Before memorizing:
|
|
198
|
-
- Review the list of existing memories to avoid duplication
|
|
199
|
-
- If a similar memory exists, consider updating it instead of creating a new one
|
|
200
|
-
- delete memories if needed
|
|
201
|
-
|
|
202
|
-
4. **Memorize**: Use the memorization tools to save each subject:
|
|
203
|
-
- Choose appropriate level if available (PROJECT or USER)
|
|
204
|
-
- Ensure clear structure and completeness
|
|
205
|
-
- Memorize one subject at a time
|
|
206
|
-
|
|
207
|
-
## Guidelines
|
|
208
|
-
- Focus on actionable insights, not generic facts
|
|
209
|
-
- Ensure memories are self-contained and clear
|
|
210
|
-
- Avoid redundancy with existing memories
|
|
211
|
-
- Prioritize quality over quantity`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""},{id:"builtin-memory-curate",name:"memory-curate",description:"Analyze and clean up the memory system by consolidating redundancies and removing outdated information",source:"builtin",commands:[`@ we start a 4 phase memory curation process. Complete only the requested phase at each time.
|
|
212
|
-
|
|
213
|
-
Phase 1: Analyze redundancies
|
|
214
|
-
|
|
215
|
-
Review all current memories to identify:
|
|
216
|
-
|
|
217
|
-
1. **Redundant memories** that:
|
|
218
|
-
- Cover similar or overlapping topics
|
|
219
|
-
- Contain duplicate information
|
|
220
|
-
- Could be consolidated for better clarity
|
|
221
|
-
|
|
222
|
-
2. **For each group of redundant memories**:
|
|
223
|
-
- List the memory titles involved
|
|
224
|
-
- Explain the redundancy briefly
|
|
225
|
-
- Propose a consolidation approach
|
|
226
|
-
|
|
227
|
-
Do not make changes yet - just analyze and report findings.`,`@ Phase 2: Consolidate redundancies
|
|
228
|
-
|
|
229
|
-
Based on the analysis from Phase 1:
|
|
230
|
-
|
|
231
|
-
1. **For each identified redundancy**:
|
|
232
|
-
- Delete the individual redundant memories using deleteMemory
|
|
233
|
-
- Create a new consolidated memory that:
|
|
234
|
-
- Maintains all critical details from the originals
|
|
235
|
-
- Provides clear, well-structured content
|
|
236
|
-
- Uses appropriate level (PROJECT or USER)
|
|
237
|
-
- Explain your consolidation reasoning
|
|
238
|
-
|
|
239
|
-
2. **Be proactive but careful**: Preserve important details while eliminating duplication.`,`@ Phase 3: Check for outdated information
|
|
240
|
-
|
|
241
|
-
Review remaining memories for accuracy and relevance:
|
|
242
|
-
|
|
243
|
-
1. **Compare each memory against**:
|
|
244
|
-
- Other memories for inconsistencies
|
|
245
|
-
- Current project context for outdated information
|
|
246
|
-
- Core documentation for misalignments
|
|
247
|
-
|
|
248
|
-
2. **For each problematic memory**:
|
|
249
|
-
- List the memory title with brief explanation of the issue
|
|
250
|
-
- Take appropriate action:
|
|
251
|
-
- Delete if outdated or incorrect
|
|
252
|
-
- Update if incomplete or partially incorrect
|
|
253
|
-
- Consolidate if it fits better elsewhere
|
|
254
|
-
- Explain your reasoning clearly
|
|
255
|
-
|
|
256
|
-
Be thorough in your analysis.`,`@ Phase 4: Final verification
|
|
257
|
-
|
|
258
|
-
Verify the memory system's overall health:
|
|
259
|
-
|
|
260
|
-
1. **Review the current state**:
|
|
261
|
-
- Check overall structure and organization
|
|
262
|
-
- Verify each memory for completeness and validity
|
|
263
|
-
- Confirm proper categorization (PROJECT vs USER)
|
|
264
|
-
|
|
265
|
-
2. **Document the results**:
|
|
266
|
-
- Summarize what was consolidated or removed
|
|
267
|
-
- List any remaining issues or concerns
|
|
268
|
-
- Provide recommendations for maintaining memory quality
|
|
269
|
-
|
|
270
|
-
This ensures the memory system stays efficient and valuable.`],createdBy:"system",createdAt:new Date("2024-01-01").toISOString(),webhookEnabled:!1,parameterFormat:""}];var ht=[T.type,v.type,m.type,y.type,f.type,b.type,u.type,R.type];var pe={CONFLUENCE:[],GIT:[],GIT_WORKTREE:[],GITLAB:[],JIRA:[],SLACK:[],ZENDESK:[],BASECAMP:[]},jt=Object.keys(pe).filter(n=>pe[n]?.length===0);var ge=class n{currentThemeSubject=new r({variant:"industry",mode:"light"});currentTheme$=this.currentThemeSubject.asObservable();preferences=a(L);subscription=null;constructor(){console.log("[THEME] Initializing theme service"),this.initializeTheme(),this.setupSystemThemeListener()}ngOnDestroy(){this.subscription?.unsubscribe()}initializeTheme(){this.subscription=this.preferences.theme$.subscribe(e=>{let t=this.preferences.getPreference("themeVariant")??"industry",s={variant:["industry","terminal"].includes(t)?t:"industry",mode:["light","dark","system"].includes(e)?e:"system"};console.log("[THEME] Theme preference changed to:",s),this.applyTheme(s)})}setTheme(e){this.preferences.setPreference("themeVariant",e.variant),this.preferences.setPreference("theme",e.mode),this.applyTheme(e)}getCurrentTheme(){return this.currentThemeSubject.value}applyTheme(e){console.log("[THEME] Applying theme:",e),this.currentThemeSubject.next(e);let t=e.mode==="system"?typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light":e.mode;this.setDocumentTheme(e.variant,t)}setDocumentTheme(e,t){if(typeof document>"u"||!document.documentElement)return;let s=e==="industry"&&t==="light"?null:`${e}-${t}`;s?document.documentElement.setAttribute("data-theme",s):document.documentElement.removeAttribute("data-theme")}setupSystemThemeListener(){typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",e=>{let t=this.getCurrentTheme();t.mode==="system"&&this.setDocumentTheme(t.variant,e.matches?"dark":"light")})}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var me=class n{eventSource=null;eventsSubject=new j;connectionStatusSubject=new r({connected:!1,reconnectAttempts:0,maxAttempts:3});reconnectAttempts=0;MAX_RECONNECT_ATTEMPTS=3;RECONNECT_DELAY=2e3;events$=this.eventsSubject.asObservable();connectionStatus$=this.connectionStatusSubject.asObservable();ngZone=a(de);connectToThread(e,t){console.log("[SSE] Connecting to thread event stream:",e,t),this.eventSource&&(console.log("[SSE] Closing existing EventSource"),this.eventSource.close());let s=`/api/projects/${e}/threads/${t}/event-stream`;console.log("[SSE] EventSource URL:",s),this.eventSource=new EventSource(s),this.setupEventHandlers()}setupEventHandlers(){this.eventSource&&(this.eventSource.onmessage=e=>{this.ngZone.run(()=>{console.log("[SSE] Message received:",e.data.substring(0,100)),this.reconnectAttempts=0,this.updateConnectionStatus(!0,0);try{let t=JSON.parse(e.data),s=ce(t);s?(console.log("[SSE] Event:",s.type),this.eventsSubject.next(s)):console.warn("[SSE] Failed to build event:",t.type)}catch(t){console.error("[SSE] Parse error:",t.message)}})},this.eventSource.onopen=()=>{this.ngZone.run(()=>{console.log("[SSE] Connection established"),this.reconnectAttempts=0,this.updateConnectionStatus(!0,0)})},this.eventSource.onerror=e=>{this.ngZone.run(()=>{console.log("[SSE] EventSource error:",e),this.eventSource?.readyState===EventSource.CLOSED&&(console.log("[SSE] Connection closed"),this.updateConnectionStatus(!1,this.reconnectAttempts),this.reconnectAttempts<this.MAX_RECONNECT_ATTEMPTS?(console.log(`[SSE] Attempting reconnect ${this.reconnectAttempts+1}/${this.MAX_RECONNECT_ATTEMPTS}`),this.eventsSubject.next(new h({error:new Error(`Connection lost. Attempting to reconnect (${this.reconnectAttempts+1}/${this.MAX_RECONNECT_ATTEMPTS})...`)})),setTimeout(()=>{this.reconnectAttempts++,console.warn("[SSE] Reconnection may not work properly with thread-based connections")},this.RECONNECT_DELAY)):(console.log("[SSE] Max reconnection attempts reached"),this.eventsSubject.next(new h({error:new Error("Connection lost permanently. Please refresh the page.")}))))})})}disconnect(){this.eventSource&&(console.log("[SSE] Disconnecting EventSource"),this.eventSource.close(),this.eventSource=null,this.updateConnectionStatus(!1,0))}updateConnectionStatus(e,t){this.connectionStatusSubject.next({connected:e,reconnectAttempts:t,maxAttempts:this.MAX_RECONNECT_ATTEMPTS})}ngOnDestroy(){this.disconnect(),this.eventsSubject.complete(),this.connectionStatusSubject.complete()}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};var fe=class n{http=a(E);projectState=a(w);threadState=a(U);getBaseUrl(){return`/api/projects/${this.projectState.getSelectedProjectIdOrThrow()}/threads/${this.threadState.getSelectedThreadIdOrThrow()}/messages`}getMessages(){return this.http.get(this.getBaseUrl())}sendMessage(e){return this.http.post(this.getBaseUrl(),e,{responseType:"text"})}sendFreeMessage(e){return this.http.post(this.getBaseUrl(),{message:e})}getMessage(e){return this.http.get(`${this.getBaseUrl()}/${encodeURIComponent(e)}`)}deleteMessage(e){return this.http.delete(`${this.getBaseUrl()}/${encodeURIComponent(e)}`)}getFormattedMessage(e){return this.http.get(`${this.getBaseUrl()}/${encodeURIComponent(e)}/formatted`,{responseType:"text"})}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};export{N as a,U as b,he as c,L as d,ge as e,F as f,f as g,We as h,u as i,A as j,B as k,M as l,h as m,b as n,v as o,m as p,O as q,T as r,V as s,z as t,H as u,R as v,W as w,_ as x,ce as y,me as z,fe as A};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as o,k as i,p as l}from"./chunk-VCUQMGKI.js";import{Z as a,ca as t,z as n}from"./chunk-CHEXA6RY.js";var m=class s{controller=t(l);agentConfigController=t(o);namespaceMembership=t(i);listByNamespace(e){return this.controller.findByNamespaceIdUserGroup(e)}loadFormData(e){return n({namespaceAgents:this.agentConfigController.listByParentAgentConfig(e,!1),platformAgents:this.agentConfigController.listPlatformAgentsAgentConfig(!1),groups:this.listByNamespace(e),users:this.namespaceMembership.getMembersNamespaceMembership(e)})}loadExistingGroup(e){return n({group:this.getById(e),members:this.getMembers(e)})}getById(e){return this.controller.getByIdUserGroup(e)}getMembers(e){return this.controller.getMembersUserGroup(e)}create(e){return this.controller.createUserGroup({namespaceId:e.namespaceId,name:e.name,agentIds:e.agentIds,userExternalIdsToAdd:e.memberExternalIdsToAdd,adminExternalIds:e.adminExternalIds})}update(e,r){return this.controller.updateUserGroup(e,{name:r.name,agentIds:r.agentIds,userExternalIdsToAdd:r.memberExternalIdsToAdd,userExternalIdsToRemove:r.memberExternalIdsToRemove,adminExternalIds:r.adminExternalIds})}delete(e){return this.controller.deleteUserGroup(e)}static \u0275fac=function(r){return new(r||s)};static \u0275prov=a({token:s,factory:s.\u0275fac,providedIn:"root"})};export{m as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Z as i,aa as d,ca as h,ta as c}from"./chunk-CHEXA6RY.js";var p=["industry","terminal"],l=["light","dark","system"],r="agentos.theme.variant",a="agentos.theme.mode",y="agentos.theme",m=class n{_theme=c(this.readStoredTheme());theme=this._theme.asReadonly();media=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;onSystemChange=()=>{this._theme().mode==="system"&&this.applyTheme(this._theme())};constructor(){this.applyTheme(this._theme()),this.media?.addEventListener("change",this.onSystemChange)}ngOnDestroy(){this.media?.removeEventListener("change",this.onSystemChange)}setTheme(e){this._theme.set(e);try{localStorage.setItem(r,e.variant),localStorage.setItem(a,e.mode)}catch(t){}this.applyTheme(e)}applyTheme(e){if(typeof document>"u"||!document.documentElement)return;let t=e.mode==="system"?this.resolveSystem():e.mode,o=e.variant==="industry"&&t==="light"?null:`${e.variant}-${t}`;o?document.documentElement.setAttribute("data-theme",o):document.documentElement.removeAttribute("data-theme")}resolveSystem(){return this.media?.matches?"dark":"light"}readStoredTheme(){try{let e=localStorage.getItem(y);if(e&&!localStorage.getItem(a)){let s=l.includes(e)?e:"system";return localStorage.setItem(a,s),localStorage.setItem(r,"industry"),localStorage.removeItem(y),{variant:"industry",mode:s}}let t=localStorage.getItem(r),o=localStorage.getItem(a),T=p.includes(t??"")?t:"industry",g=l.includes(o??"")?o:"system";return{variant:T,mode:g}}catch(e){return{variant:"industry",mode:"system"}}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=i({token:n,factory:n.\u0275fac,providedIn:"root"})},I=new d("agentos.theme-port",{providedIn:"root",factory:()=>h(m)});export{p as a,l as b,m as c,I as d};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as a}from"./chunk-VCUQMGKI.js";import{Z as d,ca as l}from"./chunk-CHEXA6RY.js";var c=class r{api=l(a);getById(e){return this.api.getByIdScheduledPrompt(e)}listPlatform(){return this.api.searchScheduledPrompt({namespaceId:null,userId:null})}listByNamespace(e){return this.api.searchScheduledPrompt({namespaceId:e,userId:null})}search(e){return this.api.searchScheduledPrompt(e)}listEffective(e){return this.api.resolveEffectiveScheduledPrompt(e)}create(e){return this.api.createScheduledPrompt(e)}update(e,t){return this.api.updateScheduledPrompt(e,t)}enable(e){return this.api.enableScheduledPrompt(e)}disable(e){return this.api.disableScheduledPrompt(e)}delete(e){return this.api.deleteScheduledPrompt(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=d({token:r,factory:r.\u0275fac,providedIn:"root"})};export{c as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as P,b as O}from"./chunk-PNPPZSOI.js";import{a as x}from"./chunk-K2ZZYRVT.js";import{d as S}from"./chunk-YFCRBVWD.js";import{b as C,c as M}from"./chunk-6XX7GME4.js";import{Db as d,Fb as y,Ka as _,Tb as u,Vb as T,Wa as c,ca as s,lb as b,mb as f,mc as p,rb as v,sb as a,ta as g,tb as l,ub as m}from"./chunk-CHEXA6RY.js";function N(o,e){if(o&1&&u(0),o&2){let t=y();T(" ",t.userInitials()," ")}}function V(o,e){o&1&&u(0," \u2022\u2022\u2022 ")}var h=class o{router=s(M);userState=s(x);themePort=s(S);namespaceState=s(P);menuOpen=g(!1);isAdmin=p(()=>this.userState.currentUser()?.isAdmin===!0);isDark=p(()=>{let{mode:e}=this.themePort.theme();return e==="dark"?!0:e==="light"?!1:typeof document<"u"&&document.documentElement.getAttribute("data-theme")?.includes("dark")===!0});themeVariant=p(()=>this.themePort.theme().variant);userInitials=p(()=>{let e=this.userState.currentUser();if(!e)return"";let t=e.firstname?.[0]??"",n=e.lastname?.[0]??"";return(t+n).toUpperCase()||e.email?.[0]?.toUpperCase()||""});showTechnical=g(!1);navigateHome(){let e=this.namespaceState.activeNamespaceId();this.router.navigate(["/agentos/home"],e?{queryParams:{ns:e}}:{})}toggleMenu(e){e.stopPropagation(),this.menuOpen.update(t=>!t)}closeMenu(e){e.stopPropagation(),this.menuOpen.set(!1)}onNavigate(e){this.menuOpen.set(!1),this.router.navigate([e])}onThemeToggle(){this.menuOpen.set(!1);let e=this.isDark()?"light":"dark";this.themePort.setTheme({variant:this.themePort.theme().variant,mode:e})}onThemeVariantChanged(e){this.menuOpen.set(!1);let t=this.themePort.theme();this.themePort.setTheme({variant:e,mode:t.mode})}onLogsToggle(){this.menuOpen.set(!1)}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=c({type:o,selectors:[["agentos-shell-topbar"]],decls:10,vars:6,consts:[[1,"shell-topbar"],["type","button","title","Home",1,"shell-topbar__brand",3,"click"],["src","CODAY-Logo.png","alt","Coday",1,"shell-topbar__logo-img"],[1,"shell-topbar__logo-text"],[1,"shell-topbar__user-menu"],["type","button","title","Menu",1,"shell-topbar__user-btn",3,"click"],["variant","topbar",3,"navigateTo","themeToggled","themeVariantChanged","logsToggled","closed","open","isAdmin","isDark","themeVariant","showTechnical"]],template:function(t,n){t&1&&(a(0,"div",0)(1,"button",1),d("click",function(){return n.navigateHome()}),m(2,"img",2),a(3,"span",3),u(4,"Coday"),l()(),a(5,"div",4)(6,"button",5),d("click",function(r){return n.toggleMenu(r)}),b(7,N,1,1)(8,V,1,0),l(),a(9,"agentos-shell-user-menu",6),d("navigateTo",function(r){return n.onNavigate(r)})("themeToggled",function(){return n.onThemeToggle()})("themeVariantChanged",function(r){return n.onThemeVariantChanged(r)})("logsToggled",function(){return n.onLogsToggle()})("closed",function(r){return n.closeMenu(r)}),l()()()),t&2&&(_(7),f(n.userInitials()?7:8),_(2),v("open",n.menuOpen())("isAdmin",n.isAdmin())("isDark",n.isDark())("themeVariant",n.themeVariant())("showTechnical",n.showTechnical()))},dependencies:[O],styles:[".shell-topbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:14px 12px;border-bottom:1px solid var(--color-divider);background:var(--color-bg);flex-shrink:0}.shell-topbar__brand[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:0;border:none;background:transparent;cursor:pointer;transition:opacity .14s ease}.shell-topbar__brand[_ngcontent-%COMP%]:hover{opacity:.8}.shell-topbar__logo-img[_ngcontent-%COMP%]{height:28px;width:auto;object-fit:contain;display:block;flex:none}.shell-topbar__logo-text[_ngcontent-%COMP%]{font-weight:700;font-size:18px;color:var(--color-text);letter-spacing:-.02em;white-space:nowrap}.shell-topbar__user-menu[_ngcontent-%COMP%]{position:relative;flex-shrink:0}.shell-topbar__user-btn[_ngcontent-%COMP%]{width:32px;height:32px;flex:none;display:grid;place-items:center;border:1px solid var(--color-divider);background:var(--color-surface);font-family:var(--font-heading);font-weight:600;font-size:13px;color:var(--color-accent-700);cursor:pointer;transition:border-color .14s;border-radius:0}.shell-topbar__user-btn[_ngcontent-%COMP%]:hover{border-color:var(--color-accent)}"],changeDetection:0})};var k=class o{static \u0275fac=function(t){return new(t||o)};static \u0275cmp=c({type:o,selectors:[["agentos-layout"]],decls:4,vars:0,consts:[[1,"layout"],[1,"layout__content"]],template:function(t,n){t&1&&(a(0,"div",0),m(1,"agentos-shell-topbar"),a(2,"main",1),m(3,"router-outlet"),l()())},dependencies:[C,h],styles:[".layout[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-height:100vh}.layout__content[_ngcontent-%COMP%]{flex:1;overflow-y:auto}"]})};export{k as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as g}from"./chunk-6XX7GME4.js";import{Ka as i,Tb as p,Ub as h,Wa as l,ca as s,vb as c,wb as u}from"./chunk-CHEXA6RY.js";var m="coday_oauth_callback",d=class r{route=s(g);message="Authentication in progress...";ngOnInit(){console.log("[OAuth Callback] Component initialized");let t=this.route.snapshot.queryParamMap.get("code"),e=this.route.snapshot.queryParamMap.get("state"),o=this.route.snapshot.queryParamMap.get("error"),a=this.route.snapshot.queryParamMap.get("error_description");if(console.log("[OAuth Callback] Code:",t,"State:",e,"Error:",o,"Opener:",!!window.opener),o){if(console.log("[OAuth Callback] OAuth error received:",o,a),!window.opener){console.warn("[OAuth Callback] No window.opener \u2014 using localStorage fallback for error"),localStorage.setItem(m,JSON.stringify({error:o,state:e,errorDescription:a})),this.message="Authentication failed. You can close this window.",setTimeout(()=>window.close(),1e3);return}try{window.opener.postMessage({error:o,state:e,errorDescription:a},window.location.origin),console.log("[OAuth Callback] Error postMessage sent successfully"),setTimeout(()=>{console.log("[OAuth Callback] Closing popup after error"),window.close()},1e3)}catch(n){console.error("[OAuth Callback] Error sending error postMessage:",n),alert("OAuth error: Failed to communicate with parent window")}return}if(!t){console.error("[OAuth Callback] Missing authorization code"),this.message="OAuth callback error: Missing authorization code.";return}if(!window.opener){console.warn("[OAuth Callback] No window.opener \u2014 using localStorage fallback"),localStorage.setItem(m,JSON.stringify({code:t,state:e})),this.message="Authentication complete. You can close this window.",setTimeout(()=>window.close(),1e3);return}try{console.log("[OAuth Callback] Sending postMessage to parent"),window.opener.postMessage({code:t,state:e},window.location.origin),console.log("[OAuth Callback] postMessage sent successfully"),setTimeout(()=>{console.log("[OAuth Callback] Closing popup"),window.close()},1e3)}catch(n){console.error("[OAuth Callback] Error sending postMessage:",n),alert("OAuth callback error: Failed to communicate with parent window")}}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=l({type:r,selectors:[["app-oauth-callback"]],decls:2,vars:1,template:function(e,o){e&1&&(c(0,"p"),p(1),u()),e&2&&(i(),h(o.message))},encapsulation:2})};export{m as a,d as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as N}from"./chunk-VN2SNJFT.js";import{a as D}from"./chunk-YFONUBPG.js";import"./chunk-VCUQMGKI.js";import{a as w,c as E}from"./chunk-6XX7GME4.js";import{s as T,z as q}from"./chunk-TTHFWEW7.js";import"./chunk-OO2H5F7U.js";import"./chunk-SPV5SLNS.js";import{a as p}from"./chunk-VMYKE4ZC.js";import"./chunk-AS2L77JV.js";import"./chunk-7OGOI6WM.js";import"./chunk-G5RWG2GK.js";import{Bb as R,D as b,Db as c,Fb as r,Pb as I,Wa as y,ab as C,ca as a,ga as m,ha as d,jc as x,lb as S,m as P,ma as g,mb as v,mc as L,rb as _,sb as l,ta as u,tb as h,z as f}from"./chunk-CHEXA6RY.js";function V(i,e){if(i&1){let t=R();l(0,"agentos-scheduled-prompt-item",4),c("enableRequested",function(n){m(t);let s=r(2);return d(s.enablePrompt(n))})("disableRequested",function(n){m(t);let s=r(2);return d(s.disablePrompt(n))})("deleteRequested",function(n){m(t);let s=r(2);return d(s.deletePrompt(n))}),h()}if(i&2){let t=r().$implicit,o=r();_("definition",e)("namespaceId",o.namespaceId)("readOnly",o.isPlatformPrompt(t.id))}}function k(i,e){if(i&1&&S(0,V,1,3,"agentos-scheduled-prompt-item",3),i&2){let t,o=e.$implicit,n=r();v((t=n.resolvePrompt(o.id))?0:-1,t)}}var O="platform",B="namespace",M=class i{route=a(w);router=a(E);destroyRef=a(g);state=a(D);namespaceId=this.route.snapshot.params.namespaceId;platformPrompts=u([]);namespacePrompts=u([]);promptItems=L(()=>[...this.platformPrompts().map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:O,groupLabel:"Platform (read-only)",badges:[{label:e.enabled?"Enabled":"Disabled",variant:e.enabled?"success":"warning"}]})),...this.namespacePrompts().map(e=>({id:e.id??"",name:e.name,description:e.description,groupKey:B,groupLabel:"Namespace",badges:[{label:e.enabled?"Enabled":"Disabled",variant:e.enabled?"success":"warning"}]}))]);constructor(){f({platform:this.state.listPlatform().pipe(b(()=>P([]))),namespace:this.state.listByNamespace(this.namespaceId)}).pipe(p(this.destroyRef)).subscribe(({platform:e,namespace:t})=>{this.platformPrompts.set(e),this.namespacePrompts.set(t)})}goBack(){this.router.navigate(["/agentos","namespaces"])}openCreateForm(){this.router.navigate(["/agentos",this.namespaceId,"scheduled-prompts","new"])}enablePrompt(e){this.state.enable(e.id??"").pipe(p(this.destroyRef)).subscribe(t=>this.patchNamespacePrompt(t))}disablePrompt(e){this.state.disable(e.id??"").pipe(p(this.destroyRef)).subscribe(t=>this.patchNamespacePrompt(t))}deletePrompt(e){let t=e.id??"";this.state.delete(t).pipe(p(this.destroyRef)).subscribe(()=>this.namespacePrompts.update(o=>o.filter(n=>n.id!==t)))}resolvePrompt(e){return this.platformPrompts().find(t=>t.id===e)??this.namespacePrompts().find(t=>t.id===e)??null}isPlatformPrompt(e){return this.platformPrompts().some(t=>t.id===e)}patchNamespacePrompt(e){this.namespacePrompts.update(t=>t.map(o=>o.id===e.id?e:o))}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=y({type:i,selectors:[["agentos-scheduled-prompt-list"]],decls:4,vars:3,consts:[["scheduledPromptItemTpl",""],["title","Scheduled Prompts","emptyMessage","No scheduled prompts yet. Create one to get started.","cardMinWidth","420px",3,"createRequested","items","showCreate","itemTemplate"],["toolbar-start","","icon","arrow_back","title","Back",3,"action"],[3,"definition","namespaceId","readOnly"],[3,"enableRequested","disableRequested","deleteRequested","definition","namespaceId","readOnly"]],template:function(t,o){if(t&1&&(l(0,"ds-entity-list",1),c("createRequested",function(){return o.openCreateForm()}),l(1,"ds-icon-button",2),c("action",function(){return o.goBack()}),h()(),C(2,k,1,1,"ng-template",null,0,x)),t&2){let n=I(3);_("items",o.promptItems())("showCreate",!0)("itemTemplate",n)}},dependencies:[q,N,T],encapsulation:2,changeDetection:0})};export{M as ScheduledPromptListComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk-ROOPYJTV.js";import"./chunk-P5FCG3WF.js";import"./chunk-XZIT26QS.js";import"./chunk-VCUQMGKI.js";import"./chunk-6XX7GME4.js";import"./chunk-TTHFWEW7.js";import"./chunk-OO2H5F7U.js";import"./chunk-SPV5SLNS.js";import"./chunk-VMYKE4ZC.js";import"./chunk-AS2L77JV.js";import"./chunk-7OGOI6WM.js";import"./chunk-G5RWG2GK.js";import"./chunk-CHEXA6RY.js";export{a as NamespaceUserGroupsComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as $}from"./chunk-K2ZZYRVT.js";import{k as V,o as B}from"./chunk-VCUQMGKI.js";import{a as T,c as z}from"./chunk-6XX7GME4.js";import{w as F}from"./chunk-TTHFWEW7.js";import{a as I}from"./chunk-VMYKE4ZC.js";import{Bb as y,D as O,Db as g,Fb as d,Ka as l,Tb as m,Ub as S,Wa as U,Z as k,a as C,b as A,ca as p,ga as M,ha as h,jb as D,lb as b,m as f,ma as R,mb as u,pb as P,qb as L,rb as v,sb as a,ta as _,tb as i,z as N}from"./chunk-CHEXA6RY.js";var E=class r{membership=p(V);userController=p(B);listMembers(t){return this.membership.getMembersNamespaceMembership(t)}listAllUsers(){return this.userController.listAllUser()}updateMembers(t,e){let o=e.map(n=>C({userId:n.userId},n.role!==void 0?{role:n.role}:{}));return this.membership.updateMembersNamespaceMembership(t,o)}static \u0275fac=function(e){return new(e||r)};static \u0275prov=k({token:r,factory:r.\u0275fac,providedIn:"root"})};function j(r,t){let e=new Map(r.map(c=>[c.userId,c.role])),o=new Set(t.map(c=>c.userId)),n=t.filter(c=>e.get(c.userId)!==c.role),s=r.filter(c=>!o.has(c.userId)).map(c=>c.userId);return{toUpsert:n,toRemove:s}}function H(r){return r.some(t=>t.role==="ADMIN")}function x(r){return[r.firstname,r.lastname].filter(Boolean).join(" ").trim()||r.email||r.externalId||""}var J=20,w=class{constructor(t,e){this.candidates=t;this.excludedUserIds=e}search(t){let e=t.toLowerCase(),o=this.excludedUserIds(),n=this.candidates().filter(s=>!!s.id&&!o.has(s.id)).filter(s=>this.matches(s,e)).slice(0,J).map(s=>({id:s.id,name:x(s),description:s.email}));return f(n)}matches(t,e){return(t.externalId??"").toLowerCase().includes(e)||(t.email??"").toLowerCase().includes(e)||x(t).toLowerCase().includes(e)}};var X=(r,t)=>t.userId;function q(r,t){r&1&&(a(0,"p",5),m(1,"Loading\u2026"),i())}function K(r,t){r&1&&(a(0,"p",7),m(1," You can change roles or remove existing members. Only a platform super-admin can add a new user to this namespace. "),i())}function W(r,t){r&1&&(a(0,"p",11),m(1,"No members yet."),i())}function Z(r,t){if(r&1&&(a(0,"span",22),m(1),i()),r&2){let e=d().$implicit;l(),S(e.email)}}function Q(r,t){if(r&1){let e=y();a(0,"li",19)(1,"div",20)(2,"span",21),m(3),i(),b(4,Z,2,1,"span",22),i(),a(5,"select",23),g("change",function(n){let s=M(e).$implicit,c=d(3);return h(c.setMemberRole(s.userId,n.target.value))}),a(6,"option",24),m(7,"Member"),i(),a(8,"option",25),m(9,"Admin"),i()(),a(10,"button",26),g("click",function(){let n=M(e).$implicit,s=d(3);return h(s.removeMember(n.userId))}),m(11," \xD7 "),i()()}if(r&2){let e=t.$implicit;l(3),S(e.label),l(),u(e.email&&e.email!==e.label?4:-1),l(),v("value",e.role),D("aria-label","Role of "+e.label),l(5),v("title","Remove "+e.label)}}function ee(r,t){if(r&1&&(a(0,"ul",12),P(1,Q,12,5,"li",19,X),i()),r&2){let e=d(2);l(),L(e.selectedMembers())}}function te(r,t){r&1&&(a(0,"p",13),m(1," At least one ADMIN must remain on the namespace. Assign ADMIN to someone before saving. "),i())}function re(r,t){if(r&1){let e=y();a(0,"ds-autocomplete-input",27),g("itemSelected",function(n){M(e);let s=d(2);return h(s.onMemberSelected(n))}),i()}if(r&2){let e=d(2);v("dataSource",e.memberDataSource)}}function ne(r,t){if(r&1&&(a(0,"p",15),m(1),i()),r&2){let e=d(2);l(),S(e.errorMessage())}}function oe(r,t){if(r&1){let e=y();a(0,"div",6),b(1,K,2,0,"p",7),a(2,"fieldset",8)(3,"legend",9),m(4," Roster "),a(5,"span",10),m(6,"Exactly one role per user: ADMIN or MEMBER"),i()(),b(7,W,2,0,"p",11)(8,ee,3,0,"ul",12),b(9,te,2,0,"p",13),b(10,re,1,1,"ds-autocomplete-input",14),i(),b(11,ne,2,1,"p",15),a(12,"div",16)(13,"button",17),g("click",function(){M(e);let n=d();return h(n.submit())}),m(14," Save changes "),i(),a(15,"button",18),g("click",function(){M(e);let n=d();return h(n.cancel())}),m(16,"Cancel"),i()()()}if(r&2){let e=d();l(),u(e.isSuperAdmin()?-1:1),l(6),u(e.selectedMembers().length===0?7:8),l(2),u(e.wouldLockOutAdmins()?9:-1),l(),u(e.isSuperAdmin()?10:-1),l(),u(e.errorMessage()?11:-1),l(2),v("disabled",e.isSubmitting()||e.wouldLockOutAdmins())}}var Y=class r{route=p(T);router=p(z);destroyRef=p(R);memberState=p(E);userState=p($);namespaceId=this.route.snapshot.params.namespaceId;isLoading=_(!1);isSubmitting=_(!1);errorMessage=_(null);isSuperAdmin=_(!1);selectedMembers=_([]);originalMembers=[];candidateUsers=_([]);memberDataSource=new w(()=>this.candidateUsers(),()=>new Set(this.selectedMembers().map(t=>t.userId)));ngOnInit(){this.loadData()}loadData(){this.isLoading.set(!0),(this.userState.currentUser()?f(this.userState.currentUser()):this.userState.loadMe()).pipe(O(e=>(console.error("[NamespaceMembers] Failed to load current user",e),f(null))),I(this.destroyRef)).subscribe(e=>{let o=e?.isAdmin===!0;this.isSuperAdmin.set(o),this.loadMembersAndCandidates(o)})}loadMembersAndCandidates(t){N({members:this.memberState.listMembers(this.namespaceId),allUsers:t?this.memberState.listAllUsers():f([])}).pipe(I(this.destroyRef)).subscribe({next:({members:e,allUsers:o})=>{this.applyMembers(e),this.candidateUsers.set(o),this.isLoading.set(!1)},error:e=>{console.error("[NamespaceMembers] Failed to load namespace members",e),this.isLoading.set(!1),this.errorMessage.set("Failed to load namespace members. Please try again.")}})}applyMembers(t){this.originalMembers=t.map(e=>({userId:e.id,role:e.role})),this.selectedMembers.set(t.map(e=>({userId:e.id,label:x(e),email:e.email,role:e.role})))}onMemberSelected(t){this.selectedMembers().some(e=>e.userId===t.id)||this.selectedMembers.update(e=>[...e,{userId:t.id,label:t.name,email:t.description,role:"MEMBER"}])}removeMember(t){this.selectedMembers.update(e=>e.filter(o=>o.userId!==t))}setMemberRole(t,e){let o=e==="ADMIN"?"ADMIN":"MEMBER";this.selectedMembers.update(n=>n.map(s=>s.userId===t?A(C({},s),{role:o}):s))}wouldLockOutAdmins=()=>!H(this.selectedMembers());submit(){if(this.isSubmitting())return;if(this.wouldLockOutAdmins()){this.errorMessage.set("At least one ADMIN must remain on the namespace. Assign ADMIN to someone before saving.");return}this.isSubmitting.set(!0),this.errorMessage.set(null);let{toUpsert:t,toRemove:e}=j(this.originalMembers,this.selectedMembers().map(n=>({userId:n.userId,role:n.role})));if(t.length===0&&e.length===0){this.isSubmitting.set(!1),this.navigateBack();return}let o=[...t.map(n=>({userId:n.userId,role:n.role})),...e.map(n=>({userId:n}))];this.memberState.updateMembers(this.namespaceId,o).pipe(I(this.destroyRef)).subscribe({next:n=>{this.applyMembers(n),this.isSubmitting.set(!1),this.navigateBack()},error:n=>{this.isSubmitting.set(!1),this.errorMessage.set(this.describeError(n))}})}describeError(t){return t.status===403?"You do not have permission to add a new user to this namespace \u2014 only a platform super-admin can add someone new. You can still change roles or remove existing members.":t.status===422?t.error?.message??"This change would leave the namespace without any ADMIN. Assign ADMIN to at least one member and try again.":"An unexpected error occurred while saving namespace members. Please try again."}cancel(){this.navigateBack()}navigateBack(){this.router.navigate(["/agentos","namespaces"])}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=U({type:r,selectors:[["agentos-namespace-members"]],decls:10,vars:1,consts:[[1,"namespace-members"],[1,"namespace-members__header"],["type","button","title","Back to namespaces",1,"namespace-members__back",3,"click"],[1,"namespace-members__back-icon"],[1,"namespace-members__title"],[1,"namespace-members__loading"],[1,"namespace-members__body"],[1,"namespace-members__hint"],[1,"namespace-members__section"],[1,"namespace-members__label"],[1,"namespace-members__label-hint"],[1,"namespace-members__empty-hint"],[1,"namespace-members__members"],[1,"namespace-members__warning"],["placeholder","Add a member\u2026",3,"dataSource"],[1,"namespace-members__error"],[1,"namespace-members__actions"],["type","button",1,"namespace-members__btn","namespace-members__btn--primary",3,"click","disabled"],["type","button",1,"namespace-members__btn",3,"click"],[1,"namespace-members__member"],[1,"namespace-members__member-info"],[1,"namespace-members__member-name"],[1,"namespace-members__member-email"],[1,"namespace-members__member-role",3,"change","value"],["value","MEMBER"],["value","ADMIN"],["type","button",1,"namespace-members__member-remove",3,"click","title"],["placeholder","Add a member\u2026",3,"itemSelected","dataSource"]],template:function(e,o){e&1&&(a(0,"div",0)(1,"header",1)(2,"button",2),g("click",function(){return o.cancel()}),a(3,"span",3),m(4,"\u2190"),i(),m(5," Namespaces "),i(),a(6,"h1",4),m(7,"Members"),i()(),b(8,q,2,0,"p",5)(9,oe,17,6,"div",6),i()),e&2&&(l(8),u(o.isLoading()?8:9))},dependencies:[F],styles:[".namespace-members[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;max-width:560px;margin:0 auto;padding:2rem 1rem}.namespace-members__header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.namespace-members__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}.namespace-members__back[_ngcontent-%COMP%]:hover{text-decoration:underline}.namespace-members__back-icon[_ngcontent-%COMP%]{font-size:1rem;line-height:1}.namespace-members__title[_ngcontent-%COMP%]{margin:0;font-size:1.5rem;font-weight:600;color:var(--color-text, #1d1d1f);letter-spacing:-.02em}.namespace-members__loading[_ngcontent-%COMP%]{color:var(--color-text-secondary, #6e6e73);font-size:.9rem;margin:0}.namespace-members__body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.namespace-members__hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary, #6e6e73);line-height:1.4}.namespace-members__label[_ngcontent-%COMP%]{font-size:.875rem;font-weight:500;color:var(--color-text, #1d1d1f)}.namespace-members__label-hint[_ngcontent-%COMP%]{font-weight:400;color:var(--color-text-secondary, #6e6e73);margin-left:.375rem}.namespace-members__section[_ngcontent-%COMP%]{border:1px solid var(--color-border, rgba(0, 0, 0, .1));border-radius:8px;padding:1rem;margin:0;display:flex;flex-direction:column;gap:.75rem}.namespace-members__empty-hint[_ngcontent-%COMP%]{margin:0;font-size:.85rem;color:var(--color-text-secondary, #6e6e73);font-style:italic}.namespace-members__members[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.375rem}.namespace-members__member[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.75rem;padding:.4rem .5rem;border-radius:8px;background:var(--color-surface-hover, rgba(0, 0, 0, .03));border:1px solid var(--color-border, rgba(0, 0, 0, .08))}.namespace-members__member-info[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.1rem;min-width:0}.namespace-members__member-name[_ngcontent-%COMP%]{font-size:.9rem;color:var(--color-text, #1d1d1f);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.namespace-members__member-email[_ngcontent-%COMP%]{font-size:.75rem;color:var(--color-text-secondary, #6e6e73);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.namespace-members__member-role[_ngcontent-%COMP%]{flex-shrink:0;padding:.3rem .5rem;border-radius:6px;border:1px solid var(--color-border, rgba(0, 0, 0, .1));background:transparent;color:var(--color-text, #1d1d1f);font-size:.8rem;font-family:inherit;cursor:pointer}.namespace-members__member-role[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--color-primary, #007aff)}.namespace-members__member-remove[_ngcontent-%COMP%]{flex-shrink:0;width:1.5rem;height:1.5rem;display:flex;align-items:center;justify-content:center;border-radius:50%;border:none;background:transparent;color:var(--color-text-secondary, #6e6e73);font-size:1rem;line-height:1;cursor:pointer;transition:background .15s ease,color .15s ease}.namespace-members__member-remove[_ngcontent-%COMP%]:hover{background:var(--color-error-light, rgba(255, 59, 48, .12));color:var(--color-error, #ff3b30)}.namespace-members__warning[_ngcontent-%COMP%]{margin:0;padding:.5rem .75rem;border-radius:8px;background:var(--color-warning-light, rgba(255, 149, 0, .1));border:1px solid var(--color-warning, #ff9500);color:var(--color-warning, #ff9500);font-size:.8rem;line-height:1.4}.namespace-members__error[_ngcontent-%COMP%]{margin:0;padding:.625rem .875rem;border-radius:8px;background:var(--color-error-light, rgba(255, 59, 48, .08));border:1px solid var(--color-error, #ff3b30);color:var(--color-error, #ff3b30);font-size:.875rem;line-height:1.4}.namespace-members__actions[_ngcontent-%COMP%]{display:flex;gap:.75rem;padding-top:.5rem}.namespace-members__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}.namespace-members__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-surface-hover, rgba(0, 0, 0, .04))}.namespace-members__btn[_ngcontent-%COMP%]:disabled{opacity:.45;cursor:not-allowed}.namespace-members__btn--primary[_ngcontent-%COMP%]{background:var(--color-primary, #007aff);border-color:var(--color-primary, #007aff);color:#fff}.namespace-members__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--color-primary-hover, #0051d5);border-color:var(--color-primary-hover, #0051d5)}"],changeDetection:0})};export{E as a,Y as b};
|
package/browser/main-7VP3QZBV.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as ri}from"./chunk-VCUQMGKI.js";import{a as S,b as K,e as ii,f as xe,h as x,i as Ae,j as ce}from"./chunk-QVW2GZXC.js";import{a as ci}from"./chunk-OCMS2KMG.js";import{b as ai,c as li,e as be}from"./chunk-XXVFHAN5.js";import"./chunk-YJOXSEUO.js";import{b as Jt,e as ei,f as ti}from"./chunk-6XX7GME4.js";import{a as si}from"./chunk-2PWIGCN2.js";import{c as ni}from"./chunk-BTOJ27OO.js";import"./chunk-SPV5SLNS.js";import{c as oi}from"./chunk-VMYKE4ZC.js";import{b as we}from"./chunk-JVZA4C5U.js";import"./chunk-G5RWG2GK.js";import{B as Ft,Ca as Xe,D as Lt,G as zt,L as Kt,La as Vt,Oa as $t,Sc as Xt,Tc as xt,V as jt,W as v,Wa as Gt,Yc as Zt,Z as Ee,a as _e,ba as ve,c as Rt,ca as z,d as G,fb as Te,ka as Bt,la as qt,m as kt,pa as Qt,q as Ye,r as Se,sa as Ut,t as Ot,u as It,ub as Wt,vc as Ht,wc as Yt}from"./chunk-CHEXA6RY.js";function ui(s){return new v(3e3,!1)}function mn(){return new v(3100,!1)}function fn(){return new v(3101,!1)}function pn(s){return new v(3001,!1)}function gn(s){return new v(3003,!1)}function yn(s){return new v(3004,!1)}function di(s,e){return new v(3005,!1)}function mi(){return new v(3006,!1)}function fi(){return new v(3007,!1)}function pi(s,e){return new v(3008,!1)}function gi(s){return new v(3002,!1)}function yi(s,e,t,i,n){return new v(3010,!1)}function _i(){return new v(3011,!1)}function Si(){return new v(3012,!1)}function Ei(){return new v(3200,!1)}function vi(){return new v(3202,!1)}function Ti(){return new v(3013,!1)}function Ai(s){return new v(3014,!1)}function wi(s){return new v(3015,!1)}function bi(s){return new v(3016,!1)}function Pi(s,e){return new v(3404,!1)}function _n(s){return new v(3502,!1)}function Ni(s){return new v(3503,!1)}function Mi(){return new v(3300,!1)}function Ci(s){return new v(3504,!1)}function Di(s){return new v(3301,!1)}function Ri(s,e){return new v(3302,!1)}function ki(s){return new v(3303,!1)}function Oi(s,e){return new v(3400,!1)}function Ii(s){return new v(3401,!1)}function Fi(s){return new v(3402,!1)}function Li(s,e){return new v(3505,!1)}function V(s){switch(s.length){case 0:return new x;case 1:return s[0];default:return new Ae(s)}}function tt(s,e,t=new Map,i=new Map){let n=[],r=[],o=-1,a=null;if(e.forEach(l=>{let c=l.get("offset"),h=c==o,u=h&&a||new Map;l.forEach((_,y)=>{let m=y,g=_;if(y!=="offset")switch(m=s.normalizePropertyName(m,n),g){case ce:g=t.get(y);break;case K:g=i.get(y);break;default:g=s.normalizeStyleValue(y,m,g,n);break}u.set(m,g)}),h||r.push(u),a=u,o=c}),n.length)throw _n(n);return r}function Pe(s,e,t,i){switch(e){case"start":s.onStart(()=>i(t&&Ze(t,"start",s)));break;case"done":s.onDone(()=>i(t&&Ze(t,"done",s)));break;case"destroy":s.onDestroy(()=>i(t&&Ze(t,"destroy",s)));break}}function Ze(s,e,t){let i=t.totalTime,n=!!t.disabled,r=Ne(s.element,s.triggerName,s.fromState,s.toState,e||s.phaseName,i??s.totalTime,n),o=s._data;return o!=null&&(r._data=o),r}function Ne(s,e,t,i,n="",r=0,o){return{element:s,triggerName:e,fromState:t,toState:i,phaseName:n,totalTime:r,disabled:!!o}}function k(s,e,t){let i=s.get(e);return i||s.set(e,i=t),i}function it(s){let e=s.indexOf(":"),t=s.substring(1,e),i=s.slice(e+1);return[t,i]}var Sn=typeof document>"u"?null:document.documentElement;function Me(s){let e=s.parentNode||s.host||null;return e===Sn?null:e}function En(s){return s.substring(1,6)=="ebkit"}var Z=null,hi=!1;function zi(s){Z||(Z=vn()||{},hi=Z.style?"WebkitAppearance"in Z.style:!1);let e=!0;return Z.style&&!En(s)&&(e=s in Z.style,!e&&hi&&(e="Webkit"+s.charAt(0).toUpperCase()+s.slice(1)in Z.style)),e}function vn(){return typeof document<"u"?document.body:null}function nt(s,e){for(;e;){if(e===s)return!0;e=Me(e)}return!1}function st(s,e,t){if(t)return Array.from(s.querySelectorAll(e));let i=s.querySelector(e);return i?[i]:[]}var Tn=1e3,rt="{{",An="}}",ot="ng-enter",Ce="ng-leave",ue="ng-trigger",he=".ng-trigger",at="ng-animating",De=".ng-animating";function U(s){if(typeof s=="number")return s;let e=s.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:Je(parseFloat(e[1]),e[2])}function Je(s,e){return e==="s"?s*Tn:s}function de(s,e,t){return s.hasOwnProperty("duration")?s:bn(s,e,t)}var wn=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;function bn(s,e,t){let i,n=0,r="";if(typeof s=="string"){let o=s.match(wn);if(o===null)return e.push(ui(s)),{duration:0,delay:0,easing:""};i=Je(parseFloat(o[1]),o[2]);let a=o[3];a!=null&&(n=Je(parseFloat(a),o[4]));let l=o[5];l&&(r=l)}else i=s;if(!t){let o=!1,a=e.length;i<0&&(e.push(mn()),o=!0),n<0&&(e.push(fn()),o=!0),o&&e.splice(a,0,ui(s))}return{duration:i,delay:n,easing:r}}function Ki(s){return s.length?s[0]instanceof Map?s:s.map(e=>new Map(Object.entries(e))):[]}function j(s,e,t){e.forEach((i,n)=>{let r=Re(n);t&&!t.has(n)&&t.set(n,s.style[r]),s.style[r]=i})}function W(s,e){e.forEach((t,i)=>{let n=Re(i);s.style[n]=""})}function re(s){return Array.isArray(s)?s.length==1?s[0]:ii(s):s}function ji(s,e,t){let i=e.params||{},n=lt(s);n.length&&n.forEach(r=>{i.hasOwnProperty(r)||t.push(pn(r))})}var et=new RegExp(`${rt}\\s*(.+?)\\s*${An}`,"g");function lt(s){let e=[];if(typeof s=="string"){let t;for(;t=et.exec(s);)e.push(t[1]);et.lastIndex=0}return e}function oe(s,e,t){let i=`${s}`,n=i.replace(et,(r,o)=>{let a=e[o];return a==null&&(t.push(gn(o)),a=""),a.toString()});return n==i?s:n}var Pn=/-+([a-z0-9])/g;function Re(s){return s.replace(Pn,(...e)=>e[1].toUpperCase())}function Bi(s,e){return s===0||e===0}function qi(s,e,t){if(t.size&&e.length){let i=e[0],n=[];if(t.forEach((r,o)=>{i.has(o)||n.push(o),i.set(o,r)}),n.length)for(let r=1;r<e.length;r++){let o=e[r];n.forEach(a=>o.set(a,ke(s,a)))}}return e}function O(s,e,t){switch(e.type){case S.Trigger:return s.visitTrigger(e,t);case S.State:return s.visitState(e,t);case S.Transition:return s.visitTransition(e,t);case S.Sequence:return s.visitSequence(e,t);case S.Group:return s.visitGroup(e,t);case S.Animate:return s.visitAnimate(e,t);case S.Keyframes:return s.visitKeyframes(e,t);case S.Style:return s.visitStyle(e,t);case S.Reference:return s.visitReference(e,t);case S.AnimateChild:return s.visitAnimateChild(e,t);case S.AnimateRef:return s.visitAnimateRef(e,t);case S.Query:return s.visitQuery(e,t);case S.Stagger:return s.visitStagger(e,t);default:throw yn(e.type)}}function ke(s,e){return window.getComputedStyle(s)[e]}var bt=(()=>{class s{validateStyleProperty(t){return zi(t)}containsElement(t,i){return nt(t,i)}getParentElement(t){return Me(t)}query(t,i,n){return st(t,i,n)}computeStyle(t,i,n){return n||""}animate(t,i,n,r,o,a=[],l){return new x(n,r)}static \u0275fac=function(i){return new(i||s)};static \u0275prov=Ee({token:s,factory:s.\u0275fac})}return s})(),ee=class{static NOOP=new bt},te=class{};var Nn=new Set(["width","height","minWidth","minHeight","maxWidth","maxHeight","left","top","bottom","right","fontSize","outlineWidth","outlineOffset","paddingTop","paddingLeft","paddingBottom","paddingRight","marginTop","marginLeft","marginBottom","marginRight","borderRadius","borderWidth","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","textIndent","perspective"]),ze=class extends te{normalizePropertyName(e,t){return Re(e)}normalizeStyleValue(e,t,i,n){let r="",o=i.toString().trim();if(Nn.has(t)&&i!==0&&i!=="0")if(typeof i=="number")r="px";else{let a=i.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&a[1].length==0&&n.push(di(e,i))}return o+r}};var Ke="*";function Mn(s,e){let t=[];return typeof s=="string"?s.split(/\s*,\s*/).forEach(i=>Cn(i,t,e)):t.push(s),t}function Cn(s,e,t){if(s[0]==":"){let l=Dn(s,t);if(typeof l=="function"){e.push(l);return}s=l}let i=s.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(i==null||i.length<4)return t.push(wi(s)),e;let n=i[1],r=i[2],o=i[3];e.push(Qi(n,o));let a=n==Ke&&o==Ke;r[0]=="<"&&!a&&e.push(Qi(o,n))}function Dn(s,e){switch(s){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(t,i)=>parseFloat(i)>parseFloat(t);case":decrement":return(t,i)=>parseFloat(i)<parseFloat(t);default:return e.push(bi(s)),"* => *"}}var Oe=new Set(["true","1"]),Ie=new Set(["false","0"]);function Qi(s,e){let t=Oe.has(s)||Ie.has(s),i=Oe.has(e)||Ie.has(e);return(n,r)=>{let o=s==Ke||s==n,a=e==Ke||e==r;return!o&&t&&typeof n=="boolean"&&(o=n?Oe.has(s):Ie.has(s)),!a&&i&&typeof r=="boolean"&&(a=r?Oe.has(e):Ie.has(e)),o&&a}}var Ji=":self",Rn=new RegExp(`s*${Ji}s*,?`,"g");function en(s,e,t,i){return new ft(s).build(e,t,i)}var Ui="",ft=class{_driver;constructor(e){this._driver=e}build(e,t,i){let n=new pt(t);return this._resetContextStyleTimingState(n),O(this,re(e),n)}_resetContextStyleTimingState(e){e.currentQuerySelector=Ui,e.collectedStyles=new Map,e.collectedStyles.set(Ui,new Map),e.currentTime=0}visitTrigger(e,t){let i=t.queryCount=0,n=t.depCount=0,r=[],o=[];return e.name.charAt(0)=="@"&&t.errors.push(mi()),e.definitions.forEach(a=>{if(this._resetContextStyleTimingState(t),a.type==S.State){let l=a,c=l.name;c.toString().split(/\s*,\s*/).forEach(h=>{l.name=h,r.push(this.visitState(l,t))}),l.name=c}else if(a.type==S.Transition){let l=this.visitTransition(a,t);i+=l.queryCount,n+=l.depCount,o.push(l)}else t.errors.push(fi())}),{type:S.Trigger,name:e.name,states:r,transitions:o,queryCount:i,depCount:n,options:null}}visitState(e,t){let i=this.visitStyle(e.styles,t),n=e.options&&e.options.params||null;if(i.containsDynamicStyles){let r=new Set,o=n||{};i.styles.forEach(a=>{a instanceof Map&&a.forEach(l=>{lt(l).forEach(c=>{o.hasOwnProperty(c)||r.add(c)})})}),r.size&&t.errors.push(pi(e.name,[...r.values()]))}return{type:S.State,name:e.name,style:i,options:n?{params:n}:null}}visitTransition(e,t){t.queryCount=0,t.depCount=0;let i=O(this,re(e.animation),t),n=Mn(e.expr,t.errors);return{type:S.Transition,matchers:n,animation:i,queryCount:t.queryCount,depCount:t.depCount,options:J(e.options)}}visitSequence(e,t){return{type:S.Sequence,steps:e.steps.map(i=>O(this,i,t)),options:J(e.options)}}visitGroup(e,t){let i=t.currentTime,n=0,r=e.steps.map(o=>{t.currentTime=i;let a=O(this,o,t);return n=Math.max(n,t.currentTime),a});return t.currentTime=n,{type:S.Group,steps:r,options:J(e.options)}}visitAnimate(e,t){let i=Fn(e.timings,t.errors);t.currentAnimateTimings=i;let n,r=e.styles?e.styles:xe({});if(r.type==S.Keyframes)n=this.visitKeyframes(r,t);else{let o=e.styles,a=!1;if(!o){a=!0;let c={};i.easing&&(c.easing=i.easing),o=xe(c)}t.currentTime+=i.duration+i.delay;let l=this.visitStyle(o,t);l.isEmptyStep=a,n=l}return t.currentAnimateTimings=null,{type:S.Animate,timings:i,style:n,options:null}}visitStyle(e,t){let i=this._makeStyleAst(e,t);return this._validateStyleAst(i,t),i}_makeStyleAst(e,t){let i=[],n=Array.isArray(e.styles)?e.styles:[e.styles];for(let a of n)typeof a=="string"?a===K?i.push(a):t.errors.push(gi(a)):i.push(new Map(Object.entries(a)));let r=!1,o=null;return i.forEach(a=>{if(a instanceof Map&&(a.has("easing")&&(o=a.get("easing"),a.delete("easing")),!r)){for(let l of a.values())if(l.toString().indexOf(rt)>=0){r=!0;break}}}),{type:S.Style,styles:i,easing:o,offset:e.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(e,t){let i=t.currentAnimateTimings,n=t.currentTime,r=t.currentTime;i&&r>0&&(r-=i.duration+i.delay),e.styles.forEach(o=>{typeof o!="string"&&o.forEach((a,l)=>{let c=t.collectedStyles.get(t.currentQuerySelector),h=c.get(l),u=!0;h&&(r!=n&&r>=h.startTime&&n<=h.endTime&&(t.errors.push(yi(l,h.startTime,h.endTime,r,n)),u=!1),r=h.startTime),u&&c.set(l,{startTime:r,endTime:n}),t.options&&ji(a,t.options,t.errors)})})}visitKeyframes(e,t){let i={type:S.Keyframes,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push(_i()),i;let n=1,r=0,o=[],a=!1,l=!1,c=0,h=e.steps.map(w=>{let b=this._makeStyleAst(w,t),C=b.offset!=null?b.offset:In(b.styles),N=0;return C!=null&&(r++,N=b.offset=C),l=l||N<0||N>1,a=a||N<c,c=N,o.push(N),b});l&&t.errors.push(Si()),a&&t.errors.push(Ei());let u=e.steps.length,_=0;r>0&&r<u?t.errors.push(vi()):r==0&&(_=n/(u-1));let y=u-1,m=t.currentTime,g=t.currentAnimateTimings,T=g.duration;return h.forEach((w,b)=>{let C=_>0?b==y?1:_*b:o[b],N=C*T;t.currentTime=m+g.delay+N,g.duration=N,this._validateStyleAst(w,t),w.offset=C,i.styles.push(w)}),i}visitReference(e,t){return{type:S.Reference,animation:O(this,re(e.animation),t),options:J(e.options)}}visitAnimateChild(e,t){return t.depCount++,{type:S.AnimateChild,options:J(e.options)}}visitAnimateRef(e,t){return{type:S.AnimateRef,animation:this.visitReference(e.animation,t),options:J(e.options)}}visitQuery(e,t){let i=t.currentQuerySelector,n=e.options||{};t.queryCount++,t.currentQuery=e;let[r,o]=kn(e.selector);t.currentQuerySelector=i.length?i+" "+r:r,k(t.collectedStyles,t.currentQuerySelector,new Map);let a=O(this,re(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=i,{type:S.Query,selector:r,limit:n.limit||0,optional:!!n.optional,includeSelf:o,animation:a,originalSelector:e.selector,options:J(e.options)}}visitStagger(e,t){t.currentQuery||t.errors.push(Ti());let i=e.timings==="full"?{duration:0,delay:0,easing:"full"}:de(e.timings,t.errors,!0);return{type:S.Stagger,animation:O(this,re(e.animation),t),timings:i,options:null}}};function kn(s){let e=!!s.split(/\s*,\s*/).find(t=>t==Ji);return e&&(s=s.replace(Rn,"")),s=s.replace(/@\*/g,he).replace(/@\w+/g,t=>he+"-"+t.slice(1)).replace(/:animating/g,De),[s,e]}function On(s){return s?_e({},s):null}var pt=class{errors;queryCount=0;depCount=0;currentTransition=null;currentQuery=null;currentQuerySelector=null;currentAnimateTimings=null;currentTime=0;collectedStyles=new Map;options=null;unsupportedCSSPropertiesFound=new Set;constructor(e){this.errors=e}};function In(s){if(typeof s=="string")return null;let e=null;if(Array.isArray(s))s.forEach(t=>{if(t instanceof Map&&t.has("offset")){let i=t;e=parseFloat(i.get("offset")),i.delete("offset")}});else if(s instanceof Map&&s.has("offset")){let t=s;e=parseFloat(t.get("offset")),t.delete("offset")}return e}function Fn(s,e){if(s.hasOwnProperty("duration"))return s;if(typeof s=="number"){let r=de(s,e).duration;return ct(r,0,"")}let t=s;if(t.split(/\s+/).some(r=>r.charAt(0)=="{"&&r.charAt(1)=="{")){let r=ct(0,0,"");return r.dynamic=!0,r.strValue=t,r}let n=de(t,e);return ct(n.duration,n.delay,n.easing)}function J(s){return s?(s=_e({},s),s.params&&(s.params=On(s.params))):s={},s}function ct(s,e,t){return{duration:s,delay:e,easing:t}}function Pt(s,e,t,i,n,r,o=null,a=!1){return{type:1,element:s,keyframes:e,preStyleProps:t,postStyleProps:i,duration:n,delay:r,totalTime:n+r,easing:o,subTimeline:a}}var fe=class{_map=new Map;get(e){return this._map.get(e)||[]}append(e,t){let i=this._map.get(e);i||this._map.set(e,i=[]),i.push(...t)}has(e){return this._map.has(e)}clear(){this._map.clear()}},Ln=1,zn=":enter",Kn=new RegExp(zn,"g"),jn=":leave",Bn=new RegExp(jn,"g");function tn(s,e,t,i,n,r=new Map,o=new Map,a,l,c=[]){return new gt().buildKeyframes(s,e,t,i,n,r,o,a,l,c)}var gt=class{buildKeyframes(e,t,i,n,r,o,a,l,c,h=[]){c=c||new fe;let u=new yt(e,t,c,n,r,h,[]);u.options=l;let _=l.delay?U(l.delay):0;u.currentTimeline.delayNextStep(_),u.currentTimeline.setStyles([o],null,u.errors,l),O(this,i,u);let y=u.timelines.filter(m=>m.containsAnimation());if(y.length&&a.size){let m;for(let g=y.length-1;g>=0;g--){let T=y[g];if(T.element===t){m=T;break}}m&&!m.allowOnlyTimelineStyles()&&m.setStyles([a],null,u.errors,l)}return y.length?y.map(m=>m.buildKeyframes()):[Pt(t,[],[],[],0,_,"",!1)]}visitTrigger(e,t){}visitState(e,t){}visitTransition(e,t){}visitAnimateChild(e,t){let i=t.subInstructions.get(t.element);if(i){let n=t.createSubContext(e.options),r=t.currentTimeline.currentTime,o=this._visitSubInstructions(i,n,n.options);r!=o&&t.transformIntoNewTimeline(o)}t.previousNode=e}visitAnimateRef(e,t){let i=t.createSubContext(e.options);i.transformIntoNewTimeline(),this._applyAnimationRefDelays([e.options,e.animation.options],t,i),this.visitReference(e.animation,i),t.transformIntoNewTimeline(i.currentTimeline.currentTime),t.previousNode=e}_applyAnimationRefDelays(e,t,i){for(let n of e){let r=n?.delay;if(r){let o=typeof r=="number"?r:U(oe(r,n?.params??{},t.errors));i.delayNextStep(o)}}}_visitSubInstructions(e,t,i){let r=t.currentTimeline.currentTime,o=i.duration!=null?U(i.duration):null,a=i.delay!=null?U(i.delay):null;return o!==0&&e.forEach(l=>{let c=t.appendInstructionToTimeline(l,o,a);r=Math.max(r,c.duration+c.delay)}),r}visitReference(e,t){t.updateOptions(e.options,!0),O(this,e.animation,t),t.previousNode=e}visitSequence(e,t){let i=t.subContextCount,n=t,r=e.options;if(r&&(r.params||r.delay)&&(n=t.createSubContext(r),n.transformIntoNewTimeline(),r.delay!=null)){n.previousNode.type==S.Style&&(n.currentTimeline.snapshotCurrentStyles(),n.previousNode=je);let o=U(r.delay);n.delayNextStep(o)}e.steps.length&&(e.steps.forEach(o=>O(this,o,n)),n.currentTimeline.applyStylesToKeyframe(),n.subContextCount>i&&n.transformIntoNewTimeline()),t.previousNode=e}visitGroup(e,t){let i=[],n=t.currentTimeline.currentTime,r=e.options&&e.options.delay?U(e.options.delay):0;e.steps.forEach(o=>{let a=t.createSubContext(e.options);r&&a.delayNextStep(r),O(this,o,a),n=Math.max(n,a.currentTimeline.currentTime),i.push(a.currentTimeline)}),i.forEach(o=>t.currentTimeline.mergeTimelineCollectedStyles(o)),t.transformIntoNewTimeline(n),t.previousNode=e}_visitTiming(e,t){if(e.dynamic){let i=e.strValue,n=t.params?oe(i,t.params,t.errors):i;return de(n,t.errors)}else return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,t){let i=t.currentAnimateTimings=this._visitTiming(e.timings,t),n=t.currentTimeline;i.delay&&(t.incrementTime(i.delay),n.snapshotCurrentStyles());let r=e.style;r.type==S.Keyframes?this.visitKeyframes(r,t):(t.incrementTime(i.duration),this.visitStyle(r,t),n.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e}visitStyle(e,t){let i=t.currentTimeline,n=t.currentAnimateTimings;!n&&i.hasCurrentStyleProperties()&&i.forwardFrame();let r=n&&n.easing||e.easing;e.isEmptyStep?i.applyEmptyStep(r):i.setStyles(e.styles,r,t.errors,t.options),t.previousNode=e}visitKeyframes(e,t){let i=t.currentAnimateTimings,n=t.currentTimeline.duration,r=i.duration,a=t.createSubContext().currentTimeline;a.easing=i.easing,e.styles.forEach(l=>{let c=l.offset||0;a.forwardTime(c*r),a.setStyles(l.styles,l.easing,t.errors,t.options),a.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(a),t.transformIntoNewTimeline(n+r),t.previousNode=e}visitQuery(e,t){let i=t.currentTimeline.currentTime,n=e.options||{},r=n.delay?U(n.delay):0;r&&(t.previousNode.type===S.Style||i==0&&t.currentTimeline.hasCurrentStyleProperties())&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=je);let o=i,a=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!n.optional,t.errors);t.currentQueryTotal=a.length;let l=null;a.forEach((c,h)=>{t.currentQueryIndex=h;let u=t.createSubContext(e.options,c);r&&u.delayNextStep(r),c===t.element&&(l=u.currentTimeline),O(this,e.animation,u),u.currentTimeline.applyStylesToKeyframe();let _=u.currentTimeline.currentTime;o=Math.max(o,_)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(o),l&&(t.currentTimeline.mergeTimelineCollectedStyles(l),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e}visitStagger(e,t){let i=t.parentContext,n=t.currentTimeline,r=e.timings,o=Math.abs(r.duration),a=o*(t.currentQueryTotal-1),l=o*t.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":l=a-l;break;case"full":l=i.currentStaggerTime;break}let h=t.currentTimeline;l&&h.delayNextStep(l);let u=h.currentTime;O(this,e.animation,t),t.previousNode=e,i.currentStaggerTime=n.currentTime-u+(n.startTime-i.currentTimeline.startTime)}},je={},yt=class s{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=je;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(e,t,i,n,r,o,a,l){this._driver=e,this.element=t,this.subInstructions=i,this._enterClassName=n,this._leaveClassName=r,this.errors=o,this.timelines=a,this.currentTimeline=l||new Be(this._driver,t,0),a.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,t){if(!e)return;let i=e,n=this.options;i.duration!=null&&(n.duration=U(i.duration)),i.delay!=null&&(n.delay=U(i.delay));let r=i.params;if(r){let o=n.params;o||(o=this.options.params={}),Object.keys(r).forEach(a=>{(!t||!o.hasOwnProperty(a))&&(o[a]=oe(r[a],o,this.errors))})}}_copyOptions(){let e={};if(this.options){let t=this.options.params;if(t){let i=e.params={};Object.keys(t).forEach(n=>{i[n]=t[n]})}}return e}createSubContext(e=null,t,i){let n=t||this.element,r=new s(this._driver,n,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(n,i||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(e),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(e){return this.previousNode=je,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,t,i){let n={duration:t??e.duration,delay:this.currentTimeline.currentTime+(i??0)+e.delay,easing:""},r=new _t(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,n,e.stretchStartingKeyframe);return this.timelines.push(r),n}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,t,i,n,r,o){let a=[];if(n&&a.push(this.element),e.length>0){e=e.replace(Kn,"."+this._enterClassName),e=e.replace(Bn,"."+this._leaveClassName);let l=i!=1,c=this._driver.query(this.element,e,l);i!==0&&(c=i<0?c.slice(c.length+i,c.length):c.slice(0,i)),a.push(...c)}return!r&&a.length==0&&o.push(Ai(t)),a}},Be=class s{_driver;element;startTime;_elementTimelineStylesLookup;duration=0;easing=null;_previousKeyframe=new Map;_currentKeyframe=new Map;_keyframes=new Map;_styleSummary=new Map;_localTimelineStyles=new Map;_globalTimelineStyles;_pendingStyles=new Map;_backFill=new Map;_currentEmptyStepKeyframe=null;constructor(e,t,i,n){this._driver=e,this.element=t,this.startTime=i,this._elementTimelineStylesLookup=n,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.hasCurrentStyleProperties();default:return!0}}hasCurrentStyleProperties(){return this._currentKeyframe.size>0}get currentTime(){return this.startTime+this.duration}delayNextStep(e){let t=this._keyframes.size===1&&this._pendingStyles.size;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,t){return this.applyStylesToKeyframe(),new s(this._driver,e,t||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=new Map,this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=Ln,this._loadKeyframe()}forwardTime(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,t){this._localTimelineStyles.set(e,t),this._globalTimelineStyles.set(e,t),this._styleSummary.set(e,{time:this.currentTime,value:t})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&this._previousKeyframe.set("easing",e);for(let[t,i]of this._globalTimelineStyles)this._backFill.set(t,i||K),this._currentKeyframe.set(t,K);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,t,i,n){t&&this._previousKeyframe.set("easing",t);let r=n&&n.params||{},o=qn(e,this._globalTimelineStyles);for(let[a,l]of o){let c=oe(l,r,i);this._pendingStyles.set(a,c),this._localTimelineStyles.has(a)||this._backFill.set(a,this._globalTimelineStyles.get(a)??K),this._updateStyle(a,c)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((e,t)=>{this._currentKeyframe.set(t,e)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((e,t)=>{this._currentKeyframe.has(t)||this._currentKeyframe.set(t,e)}))}snapshotCurrentStyles(){for(let[e,t]of this._localTimelineStyles)this._pendingStyles.set(e,t),this._updateStyle(e,t)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let e=[];for(let t in this._currentKeyframe)e.push(t);return e}mergeTimelineCollectedStyles(e){e._styleSummary.forEach((t,i)=>{let n=this._styleSummary.get(i);(!n||t.time>n.time)&&this._updateStyle(i,t.value)})}buildKeyframes(){this.applyStylesToKeyframe();let e=new Set,t=new Set,i=this._keyframes.size===1&&this.duration===0,n=[];this._keyframes.forEach((a,l)=>{let c=new Map([...this._backFill,...a]);c.forEach((h,u)=>{h===ce?e.add(u):h===K&&t.add(u)}),i||c.set("offset",l/this.duration),n.push(c)});let r=[...e.values()],o=[...t.values()];if(i){let a=n[0],l=new Map(a);a.set("offset",0),l.set("offset",1),n=[a,l]}return Pt(this.element,n,r,o,this.duration,this.startTime,this.easing,!1)}},_t=class extends Be{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(e,t,i,n,r,o,a=!1){super(e,t,o.delay),this.keyframes=i,this.preStyleProps=n,this.postStyleProps=r,this._stretchStartingKeyframe=a,this.timings={duration:o.duration,delay:o.delay,easing:o.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:t,duration:i,easing:n}=this.timings;if(this._stretchStartingKeyframe&&t){let r=[],o=i+t,a=t/o,l=new Map(e[0]);l.set("offset",0),r.push(l);let c=new Map(e[0]);c.set("offset",Vi(a)),r.push(c);let h=e.length-1;for(let u=1;u<=h;u++){let _=new Map(e[u]),y=_.get("offset"),m=t+y*i;_.set("offset",Vi(m/o)),r.push(_)}i=o,t=0,n="",e=r}return Pt(this.element,e,this.preStyleProps,this.postStyleProps,i,t,n,!0)}};function Vi(s,e=3){let t=Math.pow(10,e-1);return Math.round(s*t)/t}function qn(s,e){let t=new Map,i;return s.forEach(n=>{if(n==="*"){i??=e.keys();for(let r of i)t.set(r,K)}else for(let[r,o]of n)t.set(r,o)}),t}function $i(s,e,t,i,n,r,o,a,l,c,h,u,_){return{type:0,element:s,triggerName:e,isRemovalTransition:n,fromState:t,fromStyles:r,toState:i,toStyles:o,timelines:a,queriedElements:l,preStyleProps:c,postStyleProps:h,totalTime:u,errors:_}}var ut={},qe=class{_triggerName;ast;_stateStyles;constructor(e,t,i){this._triggerName=e,this.ast=t,this._stateStyles=i}match(e,t,i,n){return Qn(this.ast.matchers,e,t,i,n)}buildStyles(e,t,i){let n=this._stateStyles.get("*");return e!==void 0&&(n=this._stateStyles.get(e?.toString())||n),n?n.buildStyles(t,i):new Map}build(e,t,i,n,r,o,a,l,c,h){let u=[],_=this.ast.options&&this.ast.options.params||ut,y=a&&a.params||ut,m=this.buildStyles(i,y,u),g=l&&l.params||ut,T=this.buildStyles(n,g,u),w=new Set,b=new Map,C=new Map,N=n==="void",ne={params:nn(g,_),delay:this.ast.options?.delay},q=h?[]:tn(e,t,this.ast.animation,r,o,m,T,ne,c,u),D=0;return q.forEach(R=>{D=Math.max(R.duration+R.delay,D)}),u.length?$i(t,this._triggerName,i,n,N,m,T,[],[],b,C,D,u):(q.forEach(R=>{let H=R.element,se=k(b,H,new Set);R.preStyleProps.forEach(Y=>se.add(Y));let Nt=k(C,H,new Set);R.postStyleProps.forEach(Y=>Nt.add(Y)),H!==t&&w.add(H)}),$i(t,this._triggerName,i,n,N,m,T,q,[...w.values()],b,C,D))}};function Qn(s,e,t,i,n){return s.some(r=>r(e,t,i,n))}function nn(s,e){let t=_e({},e);return Object.entries(s).forEach(([i,n])=>{n!=null&&(t[i]=n)}),t}var St=class{styles;defaultParams;normalizer;constructor(e,t,i){this.styles=e,this.defaultParams=t,this.normalizer=i}buildStyles(e,t){let i=new Map,n=nn(e,this.defaultParams);return this.styles.styles.forEach(r=>{typeof r!="string"&&r.forEach((o,a)=>{o&&(o=oe(o,n,t));let l=this.normalizer.normalizePropertyName(a,t);o=this.normalizer.normalizeStyleValue(a,l,o,t),i.set(a,o)})}),i}};function Un(s,e,t){return new Et(s,e,t)}var Et=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(e,t,i){this.name=e,this.ast=t,this._normalizer=i,t.states.forEach(n=>{let r=n.options&&n.options.params||{};this.states.set(n.name,new St(n.style,r,i))}),Gi(this.states,"true","1"),Gi(this.states,"false","0"),t.transitions.forEach(n=>{this.transitionFactories.push(new qe(e,n,this.states))}),this.fallbackTransition=Vn(e,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,t,i,n){return this.transitionFactories.find(o=>o.match(e,t,i,n))||null}matchStyles(e,t,i){return this.fallbackTransition.buildStyles(e,t,i)}};function Vn(s,e,t){let i=[(o,a)=>!0],n={type:S.Sequence,steps:[],options:null},r={type:S.Transition,animation:n,matchers:i,options:null,queryCount:0,depCount:0};return new qe(s,r,e)}function Gi(s,e,t){s.has(e)?s.has(t)||s.set(t,s.get(e)):s.has(t)&&s.set(e,s.get(t))}var $n=new fe,vt=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(e,t,i){this.bodyNode=e,this._driver=t,this._normalizer=i}register(e,t){let i=[],n=[],r=en(this._driver,t,i,n);if(i.length)throw Ni(i);this._animations.set(e,r)}_buildPlayer(e,t,i){let n=e.element,r=tt(this._normalizer,e.keyframes,t,i);return this._driver.animate(n,r,e.duration,e.delay,e.easing,[],!0)}create(e,t,i={}){let n=[],r=this._animations.get(e),o,a=new Map;if(r?(o=tn(this._driver,t,r,ot,Ce,new Map,new Map,i,$n,n),o.forEach(h=>{let u=k(a,h.element,new Map);h.postStyleProps.forEach(_=>u.set(_,null))})):(n.push(Mi()),o=[]),n.length)throw Ci(n);a.forEach((h,u)=>{h.forEach((_,y)=>{h.set(y,this._driver.computeStyle(u,y,K))})});let l=o.map(h=>{let u=a.get(h.element);return this._buildPlayer(h,new Map,u)}),c=V(l);return this._playersById.set(e,c),c.onDestroy(()=>this.destroy(e)),this.players.push(c),c}destroy(e){let t=this._getPlayer(e);t.destroy(),this._playersById.delete(e);let i=this.players.indexOf(t);i>=0&&this.players.splice(i,1)}_getPlayer(e){let t=this._playersById.get(e);if(!t)throw Di(e);return t}listen(e,t,i,n){let r=Ne(t,"","","");return Pe(this._getPlayer(e),i,r,n),()=>{}}command(e,t,i,n){if(i=="register"){this.register(e,n[0]);return}if(i=="create"){let o=n[0]||{};this.create(e,t,o);return}let r=this._getPlayer(e);switch(i){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(n[0]));break;case"destroy":this.destroy(e);break}}},Wi="ng-animate-queued",Gn=".ng-animate-queued",ht="ng-animate-disabled",Wn=".ng-animate-disabled",Hn="ng-star-inserted",Yn=".ng-star-inserted",Xn=[],sn={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},xn={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},B="__ng_removed",pe=class{namespaceId;value;options;get params(){return this.options.params}constructor(e,t=""){this.namespaceId=t;let i=e&&e.hasOwnProperty("value"),n=i?e.value:e;if(this.value=Jn(n),i){let r=e,{value:o}=r,a=Rt(r,["value"]);this.options=a}else this.options={};this.options.params||(this.options.params={})}absorbOptions(e){let t=e.params;if(t){let i=this.options.params;Object.keys(t).forEach(n=>{i[n]==null&&(i[n]=t[n])})}}},me="void",dt=new pe(me),Tt=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(e,t,i){this.id=e,this.hostElement=t,this._engine=i,this._hostClassName="ng-tns-"+e,L(t,this._hostClassName)}listen(e,t,i,n){if(!this._triggers.has(t))throw Ri(i,t);if(i==null||i.length==0)throw ki(t);if(!es(i))throw Oi(i,t);let r=k(this._elementListeners,e,[]),o={name:t,phase:i,callback:n};r.push(o);let a=k(this._engine.statesByElement,e,new Map);return a.has(t)||(L(e,ue),L(e,ue+"-"+t),a.set(t,dt)),()=>{this._engine.afterFlush(()=>{let l=r.indexOf(o);l>=0&&r.splice(l,1),this._triggers.has(t)||a.delete(t)})}}register(e,t){return this._triggers.has(e)?!1:(this._triggers.set(e,t),!0)}_getTrigger(e){let t=this._triggers.get(e);if(!t)throw Ii(e);return t}trigger(e,t,i,n=!0){let r=this._getTrigger(t),o=new ge(this.id,t,e),a=this._engine.statesByElement.get(e);a||(L(e,ue),L(e,ue+"-"+t),this._engine.statesByElement.set(e,a=new Map));let l=a.get(t),c=new pe(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&l&&c.absorbOptions(l.options),a.set(t,c),l||(l=dt),!(c.value===me)&&l.value===c.value){if(!ns(l.params,c.params)){let g=[],T=r.matchStyles(l.value,l.params,g),w=r.matchStyles(c.value,c.params,g);g.length?this._engine.reportError(g):this._engine.afterFlush(()=>{W(e,T),j(e,w)})}return}let _=k(this._engine.playersByElement,e,[]);_.forEach(g=>{g.namespaceId==this.id&&g.triggerName==t&&g.queued&&g.destroy()});let y=r.matchTransition(l.value,c.value,e,c.params),m=!1;if(!y){if(!n)return;y=r.fallbackTransition,m=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:y,fromState:l,toState:c,player:o,isFallbackTransition:m}),m||(L(e,Wi),o.onStart(()=>{ae(e,Wi)})),o.onDone(()=>{let g=this.players.indexOf(o);g>=0&&this.players.splice(g,1);let T=this._engine.playersByElement.get(e);if(T){let w=T.indexOf(o);w>=0&&T.splice(w,1)}}),this.players.push(o),_.push(o),o}deregister(e){this._triggers.delete(e),this._engine.statesByElement.forEach(t=>t.delete(e)),this._elementListeners.forEach((t,i)=>{this._elementListeners.set(i,t.filter(n=>n.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);let t=this._engine.playersByElement.get(e);t&&(t.forEach(i=>i.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,t){let i=this._engine.driver.query(e,he,!0);i.forEach(n=>{if(n[B])return;let r=this._engine.fetchNamespacesByElement(n);r.size?r.forEach(o=>o.triggerLeaveAnimation(n,t,!1,!0)):this.clearElementCache(n)}),this._engine.afterFlushAnimationsDone(()=>i.forEach(n=>this.clearElementCache(n)))}triggerLeaveAnimation(e,t,i,n){let r=this._engine.statesByElement.get(e),o=new Map;if(r){let a=[];if(r.forEach((l,c)=>{if(o.set(c,l.value),this._triggers.has(c)){let h=this.trigger(e,c,me,n);h&&a.push(h)}}),a.length)return this._engine.markElementAsRemoved(this.id,e,!0,t,o),i&&V(a).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){let t=this._elementListeners.get(e),i=this._engine.statesByElement.get(e);if(t&&i){let n=new Set;t.forEach(r=>{let o=r.name;if(n.has(o))return;n.add(o);let l=this._triggers.get(o).fallbackTransition,c=i.get(o)||dt,h=new pe(me),u=new ge(this.id,o,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:o,transition:l,fromState:c,toState:h,player:u,isFallbackTransition:!0})})}}removeNode(e,t){let i=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,t),this.triggerLeaveAnimation(e,t,!0))return;let n=!1;if(i.totalAnimations){let r=i.players.length?i.playersByQueriedElement.get(e):[];if(r&&r.length)n=!0;else{let o=e;for(;o=o.parentNode;)if(i.statesByElement.get(o)){n=!0;break}}}if(this.prepareLeaveAnimationListeners(e),n)i.markElementAsRemoved(this.id,e,!1,t);else{let r=e[B];(!r||r===sn)&&(i.afterFlush(()=>this.clearElementCache(e)),i.destroyInnerAnimations(e),i._onRemovalComplete(e,t))}}insertNode(e,t){L(e,this._hostClassName)}drainQueuedTransitions(e){let t=[];return this._queue.forEach(i=>{let n=i.player;if(n.destroyed)return;let r=i.element,o=this._elementListeners.get(r);o&&o.forEach(a=>{if(a.name==i.triggerName){let l=Ne(r,i.triggerName,i.fromState.value,i.toState.value);l._data=e,Pe(i.player,a.phase,l,a.callback)}}),n.markedForDestroy?this._engine.afterFlush(()=>{n.destroy()}):t.push(i)}),this._queue=[],t.sort((i,n)=>{let r=i.transition.ast.depCount,o=n.transition.ast.depCount;return r==0||o==0?r-o:this._engine.driver.containsElement(i.element,n.element)?1:-1})}destroy(e){this.players.forEach(t=>t.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}},At=class{bodyNode;driver;_normalizer;players=[];newHostElements=new Map;playersByElement=new Map;playersByQueriedElement=new Map;statesByElement=new Map;disabledNodes=new Set;totalAnimations=0;totalQueuedPlayers=0;_namespaceLookup={};_namespaceList=[];_flushFns=[];_whenQuietFns=[];namespacesByHostElement=new Map;collectedEnterElements=[];collectedLeaveElements=[];onRemovalComplete=(e,t)=>{};_onRemovalComplete(e,t){this.onRemovalComplete(e,t)}constructor(e,t,i){this.bodyNode=e,this.driver=t,this._normalizer=i}get queuedPlayers(){let e=[];return this._namespaceList.forEach(t=>{t.players.forEach(i=>{i.queued&&e.push(i)})}),e}createNamespace(e,t){let i=new Tt(e,t,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,t)?this._balanceNamespaceList(i,t):(this.newHostElements.set(t,i),this.collectEnterElement(t)),this._namespaceLookup[e]=i}_balanceNamespaceList(e,t){let i=this._namespaceList,n=this.namespacesByHostElement;if(i.length-1>=0){let o=!1,a=this.driver.getParentElement(t);for(;a;){let l=n.get(a);if(l){let c=i.indexOf(l);i.splice(c+1,0,e),o=!0;break}a=this.driver.getParentElement(a)}o||i.unshift(e)}else i.push(e);return n.set(t,e),e}register(e,t){let i=this._namespaceLookup[e];return i||(i=this.createNamespace(e,t)),i}registerTrigger(e,t,i){let n=this._namespaceLookup[e];n&&n.register(t,i)&&this.totalAnimations++}destroy(e,t){e&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let i=this._fetchNamespace(e);this.namespacesByHostElement.delete(i.hostElement);let n=this._namespaceList.indexOf(i);n>=0&&this._namespaceList.splice(n,1),i.destroy(t),delete this._namespaceLookup[e]}))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){let t=new Set,i=this.statesByElement.get(e);if(i){for(let n of i.values())if(n.namespaceId){let r=this._fetchNamespace(n.namespaceId);r&&t.add(r)}}return t}trigger(e,t,i,n){if(Fe(t)){let r=this._fetchNamespace(e);if(r)return r.trigger(t,i,n),!0}return!1}insertNode(e,t,i,n){if(!Fe(t))return;let r=t[B];if(r&&r.setForRemoval){r.setForRemoval=!1,r.setForMove=!0;let o=this.collectedLeaveElements.indexOf(t);o>=0&&this.collectedLeaveElements.splice(o,1)}if(e){let o=this._fetchNamespace(e);o&&o.insertNode(t,i)}n&&this.collectEnterElement(t)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),L(e,ht)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),ae(e,ht))}removeNode(e,t,i){if(Fe(t)){let n=e?this._fetchNamespace(e):null;n?n.removeNode(t,i):this.markElementAsRemoved(e,t,!1,i);let r=this.namespacesByHostElement.get(t);r&&r.id!==e&&r.removeNode(t,i)}else this._onRemovalComplete(t,i)}markElementAsRemoved(e,t,i,n,r){this.collectedLeaveElements.push(t),t[B]={namespaceId:e,setForRemoval:n,hasAnimation:i,removedBeforeQueried:!1,previousTriggersValues:r}}listen(e,t,i,n,r){return Fe(t)?this._fetchNamespace(e).listen(t,i,n,r):()=>{}}_buildInstruction(e,t,i,n,r){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,i,n,e.fromState.options,e.toState.options,t,r)}destroyInnerAnimations(e){let t=this.driver.query(e,he,!0);t.forEach(i=>this.destroyActiveAnimationsForElement(i)),this.playersByQueriedElement.size!=0&&(t=this.driver.query(e,De,!0),t.forEach(i=>this.finishActiveQueriedAnimationOnElement(i)))}destroyActiveAnimationsForElement(e){let t=this.playersByElement.get(e);t&&t.forEach(i=>{i.queued?i.markedForDestroy=!0:i.destroy()})}finishActiveQueriedAnimationOnElement(e){let t=this.playersByQueriedElement.get(e);t&&t.forEach(i=>i.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return V(this.players).onDone(()=>e());e()})}processLeaveNode(e){let t=e[B];if(t&&t.setForRemoval){if(e[B]=sn,t.namespaceId){this.destroyInnerAnimations(e);let i=this._fetchNamespace(t.namespaceId);i&&i.clearElementCache(e)}this._onRemovalComplete(e,t.setForRemoval)}e.classList?.contains(ht)&&this.markElementAsDisabled(e,!1),this.driver.query(e,Wn,!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(e=-1){let t=[];if(this.newHostElements.size&&(this.newHostElements.forEach((i,n)=>this._balanceNamespaceList(i,n)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let i=0;i<this.collectedEnterElements.length;i++){let n=this.collectedEnterElements[i];L(n,Hn)}if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){let i=[];try{t=this._flushAnimations(i,e)}finally{for(let n=0;n<i.length;n++)i[n]()}}else for(let i=0;i<this.collectedLeaveElements.length;i++){let n=this.collectedLeaveElements[i];this.processLeaveNode(n)}if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(i=>i()),this._flushFns=[],this._whenQuietFns.length){let i=this._whenQuietFns;this._whenQuietFns=[],t.length?V(t).onDone(()=>{i.forEach(n=>n())}):i.forEach(n=>n())}}reportError(e){throw Fi(e)}_flushAnimations(e,t){let i=new fe,n=[],r=new Map,o=[],a=new Map,l=new Map,c=new Map,h=new Set;this.disabledNodes.forEach(d=>{h.add(d);let f=this.driver.query(d,Gn,!0);for(let p=0;p<f.length;p++)h.add(f[p])});let u=this.bodyNode,_=Array.from(this.statesByElement.keys()),y=Xi(_,this.collectedEnterElements),m=new Map,g=0;y.forEach((d,f)=>{let p=ot+g++;m.set(f,p),d.forEach(E=>L(E,p))});let T=[],w=new Set,b=new Set;for(let d=0;d<this.collectedLeaveElements.length;d++){let f=this.collectedLeaveElements[d],p=f[B];p&&p.setForRemoval&&(T.push(f),w.add(f),p.hasAnimation?this.driver.query(f,Yn,!0).forEach(E=>w.add(E)):b.add(f))}let C=new Map,N=Xi(_,Array.from(w));N.forEach((d,f)=>{let p=Ce+g++;C.set(f,p),d.forEach(E=>L(E,p))}),e.push(()=>{y.forEach((d,f)=>{let p=m.get(f);d.forEach(E=>ae(E,p))}),N.forEach((d,f)=>{let p=C.get(f);d.forEach(E=>ae(E,p))}),T.forEach(d=>{this.processLeaveNode(d)})});let ne=[],q=[];for(let d=this._namespaceList.length-1;d>=0;d--)this._namespaceList[d].drainQueuedTransitions(t).forEach(p=>{let E=p.player,P=p.element;if(ne.push(E),this.collectedEnterElements.length){let M=P[B];if(M&&M.setForMove){if(M.previousTriggersValues&&M.previousTriggersValues.has(p.triggerName)){let X=M.previousTriggersValues.get(p.triggerName),F=this.statesByElement.get(p.element);if(F&&F.has(p.triggerName)){let ye=F.get(p.triggerName);ye.value=X,F.set(p.triggerName,ye)}}E.destroy();return}}let Q=!u||!this.driver.containsElement(u,P),I=C.get(P),$=m.get(P),A=this._buildInstruction(p,i,$,I,Q);if(A.errors&&A.errors.length){q.push(A);return}if(Q){E.onStart(()=>W(P,A.fromStyles)),E.onDestroy(()=>j(P,A.toStyles)),n.push(E);return}if(p.isFallbackTransition){E.onStart(()=>W(P,A.fromStyles)),E.onDestroy(()=>j(P,A.toStyles)),n.push(E);return}let Dt=[];A.timelines.forEach(M=>{M.stretchStartingKeyframe=!0,this.disabledNodes.has(M.element)||Dt.push(M)}),A.timelines=Dt,i.append(P,A.timelines);let dn={instruction:A,player:E,element:P};o.push(dn),A.queriedElements.forEach(M=>k(a,M,[]).push(E)),A.preStyleProps.forEach((M,X)=>{if(M.size){let F=l.get(X);F||l.set(X,F=new Set),M.forEach((ye,He)=>F.add(He))}}),A.postStyleProps.forEach((M,X)=>{let F=c.get(X);F||c.set(X,F=new Set),M.forEach((ye,He)=>F.add(He))})});if(q.length){let d=[];q.forEach(f=>{d.push(Li(f.triggerName,f.errors))}),ne.forEach(f=>f.destroy()),this.reportError(d)}let D=new Map,R=new Map;o.forEach(d=>{let f=d.element;i.has(f)&&(R.set(f,f),this._beforeAnimationBuild(d.player.namespaceId,d.instruction,D))}),n.forEach(d=>{let f=d.element;this._getPreviousPlayers(f,!1,d.namespaceId,d.triggerName,null).forEach(E=>{k(D,f,[]).push(E),E.destroy()})});let H=T.filter(d=>xi(d,l,c)),se=new Map;Yi(se,this.driver,b,c,K).forEach(d=>{xi(d,l,c)&&H.push(d)});let Y=new Map;y.forEach((d,f)=>{Yi(Y,this.driver,new Set(d),l,ce)}),H.forEach(d=>{let f=se.get(d),p=Y.get(d);se.set(d,new Map([...f?.entries()??[],...p?.entries()??[]]))});let We=[],Mt=[],Ct={};o.forEach(d=>{let{element:f,player:p,instruction:E}=d;if(i.has(f)){if(h.has(f)){p.onDestroy(()=>j(f,E.toStyles)),p.disabled=!0,p.overrideTotalTime(E.totalTime),n.push(p);return}let P=Ct;if(R.size>1){let I=f,$=[];for(;I=I.parentNode;){let A=R.get(I);if(A){P=A;break}$.push(I)}$.forEach(A=>R.set(A,P))}let Q=this._buildAnimation(p.namespaceId,E,D,r,Y,se);if(p.setRealPlayer(Q),P===Ct)We.push(p);else{let I=this.playersByElement.get(P);I&&I.length&&(p.parentPlayer=V(I)),n.push(p)}}else W(f,E.fromStyles),p.onDestroy(()=>j(f,E.toStyles)),Mt.push(p),h.has(f)&&n.push(p)}),Mt.forEach(d=>{let f=r.get(d.element);if(f&&f.length){let p=V(f);d.setRealPlayer(p)}}),n.forEach(d=>{d.parentPlayer?d.syncPlayerEvents(d.parentPlayer):d.destroy()});for(let d=0;d<T.length;d++){let f=T[d],p=f[B];if(ae(f,Ce),p&&p.hasAnimation)continue;let E=[];if(a.size){let Q=a.get(f);Q&&Q.length&&E.push(...Q);let I=this.driver.query(f,De,!0);for(let $=0;$<I.length;$++){let A=a.get(I[$]);A&&A.length&&E.push(...A)}}let P=E.filter(Q=>!Q.destroyed);P.length?ts(this,f,P):this.processLeaveNode(f)}return T.length=0,We.forEach(d=>{this.players.push(d),d.onDone(()=>{d.destroy();let f=this.players.indexOf(d);this.players.splice(f,1)}),d.play()}),We}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,t,i,n,r){let o=[];if(t){let a=this.playersByQueriedElement.get(e);a&&(o=a)}else{let a=this.playersByElement.get(e);if(a){let l=!r||r==me;a.forEach(c=>{c.queued||!l&&c.triggerName!=n||o.push(c)})}}return(i||n)&&(o=o.filter(a=>!(i&&i!=a.namespaceId||n&&n!=a.triggerName))),o}_beforeAnimationBuild(e,t,i){let n=t.triggerName,r=t.element,o=t.isRemovalTransition?void 0:e,a=t.isRemovalTransition?void 0:n;for(let l of t.timelines){let c=l.element,h=c!==r,u=k(i,c,[]);this._getPreviousPlayers(c,h,o,a,t.toState).forEach(y=>{let m=y.getRealPlayer();m.beforeDestroy&&m.beforeDestroy(),y.destroy(),u.push(y)})}W(r,t.fromStyles)}_buildAnimation(e,t,i,n,r,o){let a=t.triggerName,l=t.element,c=[],h=new Set,u=new Set,_=t.timelines.map(m=>{let g=m.element;h.add(g);let T=g[B];if(T&&T.removedBeforeQueried)return new x(m.duration,m.delay);let w=g!==l,b=is((i.get(g)||Xn).map(D=>D.getRealPlayer())).filter(D=>{let R=D;return R.element?R.element===g:!1}),C=r.get(g),N=o.get(g),ne=tt(this._normalizer,m.keyframes,C,N),q=this._buildPlayer(m,ne,b);if(m.subTimeline&&n&&u.add(g),w){let D=new ge(e,a,g);D.setRealPlayer(q),c.push(D)}return q});c.forEach(m=>{k(this.playersByQueriedElement,m.element,[]).push(m),m.onDone(()=>Zn(this.playersByQueriedElement,m.element,m))}),h.forEach(m=>L(m,at));let y=V(_);return y.onDestroy(()=>{h.forEach(m=>ae(m,at)),j(l,t.toStyles)}),u.forEach(m=>{k(n,m,[]).push(y)}),y}_buildPlayer(e,t,i){return t.length>0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,i):new x(e.duration,e.delay)}},ge=class{namespaceId;triggerName;element;_player=new x;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(e,t,i){this.namespaceId=e,this.triggerName=t,this.element=i}setRealPlayer(e){this._containsRealPlayer||(this._player=e,this._queuedCallbacks.forEach((t,i)=>{t.forEach(n=>Pe(e,i,void 0,n))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(e){this.totalTime=e}syncPlayerEvents(e){let t=this._player;t.triggerCallback&&e.onStart(()=>t.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,t){k(this._queuedCallbacks,e,[]).push(t)}onDone(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)}onStart(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)}onDestroy(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)}init(){this._player.init()}hasStarted(){return this.queued?!1:this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(e){this.queued||this._player.setPosition(e)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(e){let t=this._player;t.triggerCallback&&t.triggerCallback(e)}};function Zn(s,e,t){let i=s.get(e);if(i){if(i.length){let n=i.indexOf(t);i.splice(n,1)}i.length==0&&s.delete(e)}return i}function Jn(s){return s??null}function Fe(s){return s&&s.nodeType===1}function es(s){return s=="start"||s=="done"}function Hi(s,e){let t=s.style.display;return s.style.display=e??"none",t}function Yi(s,e,t,i,n){let r=[];t.forEach(l=>r.push(Hi(l)));let o=[];i.forEach((l,c)=>{let h=new Map;l.forEach(u=>{let _=e.computeStyle(c,u,n);h.set(u,_),(!_||_.length==0)&&(c[B]=xn,o.push(c))}),s.set(c,h)});let a=0;return t.forEach(l=>Hi(l,r[a++])),o}function Xi(s,e){let t=new Map;if(s.forEach(a=>t.set(a,[])),e.length==0)return t;let i=1,n=new Set(e),r=new Map;function o(a){if(!a)return i;let l=r.get(a);if(l)return l;let c=a.parentNode;return t.has(c)?l=c:n.has(c)?l=i:l=o(c),r.set(a,l),l}return e.forEach(a=>{let l=o(a);l!==i&&t.get(l).push(a)}),t}function L(s,e){s.classList?.add(e)}function ae(s,e){s.classList?.remove(e)}function ts(s,e,t){V(t).onDone(()=>s.processLeaveNode(e))}function is(s){let e=[];return rn(s,e),e}function rn(s,e){for(let t=0;t<s.length;t++){let i=s[t];i instanceof Ae?rn(i.players,e):e.push(i)}}function ns(s,e){let t=Object.keys(s),i=Object.keys(e);if(t.length!=i.length)return!1;for(let n=0;n<t.length;n++){let r=t[n];if(!e.hasOwnProperty(r)||s[r]!==e[r])return!1}return!0}function xi(s,e,t){let i=t.get(s);if(!i)return!1;let n=e.get(s);return n?i.forEach(r=>n.add(r)):e.set(s,i),t.delete(s),!0}var le=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(e,t)=>{};constructor(e,t,i){this._driver=t,this._normalizer=i,this._transitionEngine=new At(e.body,t,i),this._timelineEngine=new vt(e.body,t,i),this._transitionEngine.onRemovalComplete=(n,r)=>this.onRemovalComplete(n,r)}registerTrigger(e,t,i,n,r){let o=e+"-"+n,a=this._triggerCache[o];if(!a){let l=[],c=[],h=en(this._driver,r,l,c);if(l.length)throw Pi(n,l);a=Un(n,h,this._normalizer),this._triggerCache[o]=a}this._transitionEngine.registerTrigger(t,n,a)}register(e,t){this._transitionEngine.register(e,t)}destroy(e,t){this._transitionEngine.destroy(e,t)}onInsert(e,t,i,n){this._transitionEngine.insertNode(e,t,i,n)}onRemove(e,t,i){this._transitionEngine.removeNode(e,t,i)}disableAnimations(e,t){this._transitionEngine.markElementAsDisabled(e,t)}process(e,t,i,n){if(i.charAt(0)=="@"){let[r,o]=it(i),a=n;this._timelineEngine.command(r,t,o,a)}else this._transitionEngine.trigger(e,t,i,n)}listen(e,t,i,n,r){if(i.charAt(0)=="@"){let[o,a]=it(i);return this._timelineEngine.listen(o,t,a,r)}return this._transitionEngine.listen(e,t,i,n,r)}flush(e=-1){this._transitionEngine.flush(e)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(e){this._transitionEngine.afterFlushAnimationsDone(e)}};function ss(s,e){let t=null,i=null;return Array.isArray(e)&&e.length?(t=mt(e[0]),e.length>1&&(i=mt(e[e.length-1]))):e instanceof Map&&(t=mt(e)),t||i?new rs(s,t,i):null}var rs=(()=>{class s{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(t,i,n){this._element=t,this._startStyles=i,this._endStyles=n;let r=s.initialStylesByElement.get(t);r||s.initialStylesByElement.set(t,r=new Map),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&j(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(j(this._element,this._initialStyles),this._endStyles&&(j(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(s.initialStylesByElement.delete(this._element),this._startStyles&&(W(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(W(this._element,this._endStyles),this._endStyles=null),j(this._element,this._initialStyles),this._state=3)}}return s})();function mt(s){let e=null;return s.forEach((t,i)=>{os(i)&&(e=e||new Map,e.set(i,t))}),e}function os(s){return s==="display"||s==="position"}var Qe=class{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer=null;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(e,t,i,n){this.element=e,this.keyframes=t,this.options=i,this._specialStyles=n,this._duration=i.duration,this._delay=i.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(e=>e()),this._onDoneFns=[])}init(){this._buildPlayer()&&this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return this.domPlayer;this._initialized=!0;let e=this.keyframes,t=this._triggerWebAnimation(this.element,e,this.options);if(!t)return this._onFinish(),null;this.domPlayer=t,this._finalKeyframe=e.length?e[e.length-1]:new Map;let i=()=>this._onFinish();return t.addEventListener("finish",i),this.onDestroy(()=>{t.removeEventListener("finish",i)}),t}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer?.pause()}_convertKeyframesToObject(e){let t=[];return e.forEach(i=>{t.push(Object.fromEntries(i))}),t}_triggerWebAnimation(e,t,i){let n=this._convertKeyframesToObject(t);try{return e.animate(n,i)}catch(r){return null}}onStart(e){this._originalOnStartFns.push(e),this._onStartFns.push(e)}onDone(e){this._originalOnDoneFns.push(e),this._onDoneFns.push(e)}onDestroy(e){this._onDestroyFns.push(e)}play(){let e=this._buildPlayer();e&&(this.hasStarted()||(this._onStartFns.forEach(t=>t()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),e.play())}pause(){this.init(),this.domPlayer?.pause()}finish(){this.init(),this.domPlayer&&(this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish())}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}_resetDomPlayerState(){this.domPlayer?.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(e=>e()),this._onDestroyFns=[])}setPosition(e){this.domPlayer||this.init(),this.domPlayer&&(this.domPlayer.currentTime=e*this.time)}getPosition(){return this.domPlayer?+(this.domPlayer.currentTime??0)/this.time:this._initialized?1:0}get totalTime(){return this._delay+this._duration}beforeDestroy(){let e=new Map;this.hasStarted()&&this._finalKeyframe.forEach((i,n)=>{n!=="offset"&&e.set(n,this._finished?i:ke(this.element,n))}),this.currentSnapshot=e}triggerCallback(e){let t=e==="start"?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}},Ue=class{validateStyleProperty(e){return!0}validateAnimatableStyleProperty(e){return!0}containsElement(e,t){return nt(e,t)}getParentElement(e){return Me(e)}query(e,t,i){return st(e,t,i)}computeStyle(e,t,i){return ke(e,t)}animate(e,t,i,n,r,o=[]){let a=n==0?"both":"forwards",l={duration:i,delay:n,fill:a};r&&(l.easing=r);let c=new Map,h=o.filter(y=>y instanceof Qe);Bi(i,n)&&h.forEach(y=>{y.currentSnapshot.forEach((m,g)=>c.set(g,m))});let u=Ki(t).map(y=>new Map(y));u=qi(e,u,c);let _=ss(e,u);return new Qe(e,u,l,_)}};var Le="@",on="@.disabled",Ve=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(e,t,i,n){this.namespaceId=e,this.delegate=t,this.engine=i,this._onDestroy=n}get data(){return this.delegate.data}destroyNode(e){this.delegate.destroyNode?.(e)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(e,t){return this.delegate.createElement(e,t)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,t){this.delegate.appendChild(e,t),this.engine.onInsert(this.namespaceId,t,e,!1)}insertBefore(e,t,i,n=!0){this.delegate.insertBefore(e,t,i),this.engine.onInsert(this.namespaceId,t,e,n)}removeChild(e,t,i,n){if(n){this.delegate.removeChild(e,t,i,n);return}this.parentNode(t)&&this.engine.onRemove(this.namespaceId,t,this.delegate)}selectRootElement(e,t){return this.delegate.selectRootElement(e,t)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,t,i,n){this.delegate.setAttribute(e,t,i,n)}removeAttribute(e,t,i){this.delegate.removeAttribute(e,t,i)}addClass(e,t){this.delegate.addClass(e,t)}removeClass(e,t){this.delegate.removeClass(e,t)}setStyle(e,t,i,n){this.delegate.setStyle(e,t,i,n)}removeStyle(e,t,i){this.delegate.removeStyle(e,t,i)}setProperty(e,t,i){t.charAt(0)==Le&&t==on?this.disableAnimations(e,!!i):this.delegate.setProperty(e,t,i)}setValue(e,t){this.delegate.setValue(e,t)}listen(e,t,i,n){return this.delegate.listen(e,t,i,n)}disableAnimations(e,t){this.engine.disableAnimations(e,t)}},wt=class extends Ve{factory;constructor(e,t,i,n,r){super(t,i,n,r),this.factory=e,this.namespaceId=t}setProperty(e,t,i){t.charAt(0)==Le?t.charAt(1)=="."&&t==on?(i=i===void 0?!0:!!i,this.disableAnimations(e,i)):this.engine.process(this.namespaceId,e,t.slice(1),i):this.delegate.setProperty(e,t,i)}listen(e,t,i,n){if(t.charAt(0)==Le){let r=as(e),o=t.slice(1),a="";return o.charAt(0)!=Le&&([o,a]=ls(o)),this.engine.listen(this.namespaceId,r,o,a,l=>{let c=l._data||-1;this.factory.scheduleListenerCallback(c,i,l)})}return this.delegate.listen(e,t,i,n)}};function as(s){switch(s){case"body":return document.body;case"document":return document;case"window":return window;default:return s}}function ls(s){let e=s.indexOf("."),t=s.substring(0,e),i=s.slice(e+1);return[t,i]}var $e=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(e,t,i){this.delegate=e,this.engine=t,this._zone=i,t.onRemovalComplete=(n,r)=>{r?.removeChild(null,n)}}createRenderer(e,t){let n=this.delegate.createRenderer(e,t);if(!e||!t?.data?.animation){let c=this._rendererCache,h=c.get(n);if(!h){let u=()=>c.delete(n);h=new Ve("",n,this.engine,u),c.set(n,h)}return h}let r=t.id,o=t.id+"-"+this._currentId;this._currentId++,this.engine.register(o,e);let a=c=>{Array.isArray(c)?c.forEach(a):this.engine.registerTrigger(r,o,e,c.name,c)};return t.data.animation.forEach(a),new wt(this,o,n,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(e,t,i){if(e>=0&&e<this._microtaskId){this._zone.run(()=>t(i));return}let n=this._animationCallbacksBuffer;n.length==0&&queueMicrotask(()=>{this._zone.run(()=>{n.forEach(r=>{let[o,a]=r;o(a)}),this._animationCallbacksBuffer=[]})}),n.push([t,i])}end(){this._cdRecurDepth--,this._cdRecurDepth==0&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}componentReplaced(e){this.engine.flush(),this.delegate.componentReplaced?.(e)}};var us=(()=>{class s extends le{constructor(t,i,n){super(t,i,n)}ngOnDestroy(){this.flush()}static \u0275fac=function(i){return new(i||s)(ve(qt),ve(ee),ve(te))};static \u0275prov=Ee({token:s,factory:s.\u0275fac})}return s})();function hs(){return new ze}function ds(){return new $e(z(Xt),z(le),z(Qt))}var an=[{provide:te,useFactory:hs},{provide:le,useClass:us},{provide:$t,useFactory:ds}],zs=[{provide:ee,useClass:bt},{provide:Xe,useValue:"NoopAnimations"},...an],ms=[{provide:ee,useFactory:()=>new Ue},{provide:Xe,useFactory:()=>"BrowserAnimations"},...an];function ln(){return Vt("NgEagerAnimations"),[...ms]}var ie=s=>G(null,null,function*(){let e=z(we),t=s.params.projectName;return t?e.getSelectedProjectId()===t?!0:(e.selectProject(t),(yield Se(e.selectedProject$.pipe(Kt(n=>n?.name===t))))?.name===t):(console.log("[PROJECT GUARD] no project id in route"),!1)});var cn=s=>G(null,null,function*(){let e=z(ai),t=z(li),i=s.params.threadId;if(!t.getUsername())try{yield Ye(t.fetchCurrentUser())}catch(n){console.error("[THREAD GUARD] Failed to load current user:",n)}if(!i)return console.log("[THREAD GUARD] no threadId in route"),!1;if(console.log("[THREAD GUARD] Checking thread:",i),console.log("[THREAD GUARD] Current selected thread:",e.getSelectedThreadId()),e.getSelectedThreadId()===i)return console.log("[THREAD GUARD] Thread already selected, allowing navigation"),!0;console.log("[THREAD GUARD] Selecting thread:",i),e.selectThread(i);try{let n=yield Ye(It([e.isLoading$,e.selectedThread$]).pipe(jt(([o,a])=>console.log(`\u{1F43C} [${o?"loading":"loaded"}]`,a?.id)),Ft(([o,a])=>!o&&!!a),zt(1),Ot(([o,a])=>a?.id))),r=n===i;return r?console.log("[THREAD GUARD] Thread validated, allowing navigation"):console.error("[THREAD GUARD] Thread ID mismatch - route:",i,"loaded:",n),r}catch(n){return console.error("[THREAD GUARD] Error loading thread:",n),!1}});var un=[{path:"",loadComponent:()=>import("./chunk-GFK56P4B.js").then(s=>s.GlobalTaskControlComponent)},{path:"projects",loadComponent:()=>import("./chunk-EMVHTOJY.js").then(s=>s.ProjectListComponent)},{path:"oauth/callback",loadComponent:()=>import("./chunk-MNWA4UGA.js").then(s=>s.OAuthCallbackComponent)},{path:"project/new",loadComponent:()=>import("./chunk-IWVV3FNS.js").then(s=>s.ProjectNewComponent)},{path:"project/:projectName",loadComponent:()=>import("./chunk-AZOMCTR7.js").then(s=>s.MainAppComponent),canActivate:[ie]},{path:"project/:projectName/prompts",loadComponent:()=>import("./chunk-3FDPLGME.js").then(s=>s.PromptListComponent),canActivate:[ie]},{path:"project/:projectName/schedulers",loadComponent:()=>import("./chunk-NQHQFPW5.js").then(s=>s.SchedulerListComponent),canActivate:[ie]},{path:"project/:projectName/agents",loadComponent:()=>import("./chunk-7SEGP55P.js").then(s=>s.AgentListComponent),canActivate:[ie]},{path:"project/:projectName/tasks",loadComponent:()=>import("./chunk-UAC4ZZCA.js").then(s=>s.TaskControlComponent),canActivate:[ie]},{path:"project/:projectName/missions",redirectTo:"project/:projectName/tasks"},{path:"project/:projectName/thread/:threadId",loadComponent:()=>import("./chunk-AZOMCTR7.js").then(s=>s.MainAppComponent),canActivate:[ie,cn]},{path:"token-usage",loadComponent:()=>import("./chunk-CXNTZ6XI.js").then(s=>s.TokenUsageComponent)},{path:"agentos",loadChildren:()=>G(null,null,function*(){let{AGENTOS_ROUTES:s,THEME_PORT:e}=yield import("./chunk-QYUULQIF.js");return[{path:"",providers:[{provide:e,useFactory:t=>({theme:oi(t.currentTheme$,{initialValue:t.getCurrentTheme()}),setTheme:i=>t.setTheme(i)}),deps:[be]}],children:s}]})},{path:"**",redirectTo:""}];function fs(s){return()=>s.initializeDefaultProject()}function ps(s){return()=>{console.log("[APP_INIT] OAuthService initialized")}}function gs(s){return()=>G(null,null,function*(){let{UserStateService:e}=yield import("./chunk-QYUULQIF.js"),t=s.get(e);yield Se(t.loadMe().pipe(Lt(i=>(console.warn("Failed to load current user",i),kt(null)))))})}var hn={providers:[Ut(),Ht({eventCoalescing:!0}),ei(un),Zt(),ln(),{provide:si,useValue:{duration:3e3}},{provide:Te,useFactory:fs,deps:[we],multi:!0},{provide:Te,useFactory:ps,deps:[ci],multi:!0},{provide:Te,useFactory:gs,deps:[Bt],multi:!0},ri({basePath:"/api/agentos"}),{provide:ni,useValue:{width:"80vw",maxWidth:"80vw",maxHeight:"80vh"}}]};var Ge=class s{title="client";themeService=z(be);ngOnInit(){console.log("[APP] Application initialized with theme:",this.themeService.getCurrentTheme())}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=Gt({type:s,selectors:[["app-root"]],decls:1,vars:0,template:function(t,i){t&1&&Wt(0,"router-outlet")},dependencies:[ti,Jt],encapsulation:2})};xt(Ge,hn).catch(s=>console.error(s));"serviceWorker"in navigator&&!Yt()&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(s=>console.error("[SW] Registration failed:",s))});
|