From 3f30e0825d36841832af59b2041546ead9447df5 Mon Sep 17 00:00:00 2001 From: HowardChan Date: Thu, 10 Apr 2025 14:38:28 +0800 Subject: [PATCH 1/3] Fix:reponse -> response --- src/google/adk/cli/browser/main-SLIAU2JL.js | 2 +- src/google/adk/evaluation/response_evaluator.py | 2 +- src/google/adk/flows/llm_flows/contents.py | 2 +- src/google/adk/tests/unittests/utils.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/google/adk/cli/browser/main-SLIAU2JL.js b/src/google/adk/cli/browser/main-SLIAU2JL.js index ba5a8ef..a0f086d 100644 --- a/src/google/adk/cli/browser/main-SLIAU2JL.js +++ b/src/google/adk/cli/browser/main-SLIAU2JL.js @@ -88,4 +88,4 @@ ${e} Please report this to https://github.com/markedjs/marked.`,e){let o="

An error occurred:

"+uo(i.message+"",!0)+"
";return A?Promise.resolve(o):o}if(A)return Promise.reject(i);throw i}}},bn=new om;function XA(t,e){return bn.parse(t,e)}XA.options=XA.setOptions=function(t){return bn.setOptions(t),XA.defaults=bn.defaults,nb(XA.defaults),XA};XA.getDefaults=gm;XA.defaults=Sn;XA.use=function(...t){return bn.use(...t),XA.defaults=bn.defaults,nb(XA.defaults),XA};XA.walkTokens=function(t,e){return bn.walkTokens(t,e)};XA.parseInline=bn.parseInline;XA.Parser=Gi;XA.parser=Gi.parse;XA.Renderer=Do;XA.TextRenderer=Ra;XA.Lexer=Ni;XA.lexer=Ni.lex;XA.Tokenizer=Er;XA.Hooks=Qr;XA.parse=XA;var CIA=XA.options,BIA=XA.setOptions,QIA=XA.use,EIA=XA.walkTokens,cIA=XA.parseInline;var lIA=Gi.parse,dIA=Ni.lex;var JP=["*"],HP="Copy",TP="Copied",OP=(()=>{class t{constructor(){this._buttonClick$=new K,this.copied$=this._buttonClick$.pipe(re(()=>De(tA(!0),Lg(3e3).pipe(Vn(!1)))),Bi(),Ro(1)),this.copiedText$=this.copied$.pipe(me(!1),oA(A=>A?TP:HP))}onCopyToClipboardClick(){this._buttonClick$.next()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=O({type:t,selectors:[["markdown-clipboard"]],decls:4,vars:7,consts:[[1,"markdown-clipboard-button",3,"click"]],template:function(i,o){i&1&&(u(0,"button",0),rg(1,"async"),x("click",function(){return o.onCopyToClipboardClick()}),v(2),rg(3,"async"),m()),i&2&&(gA("copied",Ds(1,3,o.copied$)),f(2),PA(Ds(3,5,o.copiedText$)))},dependencies:[EI],encapsulation:2,changeDetection:0})}}return t})(),PP=new k("CLIPBOARD_OPTIONS");var Qm=function(t){return t.CommandLine="command-line",t.LineHighlight="line-highlight",t.LineNumbers="line-numbers",t}(Qm||{}),db=new k("MARKED_EXTENSIONS"),ZP=new k("MARKED_OPTIONS"),qP=new k("MERMAID_OPTIONS"),VP="[ngx-markdown] When using the `emoji` attribute you *have to* include Emoji-Toolkit files to `angular.json` or use imports. See README for more information",WP="[ngx-markdown] When using the `katex` attribute you *have to* include KaTeX files to `angular.json` or use imports. See README for more information",zP="[ngx-markdown] When using the `mermaid` attribute you *have to* include Mermaid files to `angular.json` or use imports. See README for more information",jP="[ngx-markdown] When using the `clipboard` attribute you *have to* include Clipboard files to `angular.json` or use imports. See README for more information",XP="[ngx-markdown] When using the `clipboard` attribute you *have to* provide the `viewContainerRef` parameter to `MarkdownService.render()` function",$P="[ngx-markdown] When using the `src` attribute you *have to* pass the `HttpClient` as a parameter of the `forRoot` method. See README for more information",hb=new k("SECURITY_CONTEXT");var ub=(()=>{class t{get options(){return this._options}set options(A){this._options=R(R({},this.DEFAULT_MARKED_OPTIONS),A)}get renderer(){return this.options.renderer}set renderer(A){this.options.renderer=A}constructor(A,i,o,g,n,s,r,I){this.clipboardOptions=A,this.extensions=i,this.mermaidOptions=g,this.platform=n,this.securityContext=s,this.http=r,this.sanitizer=I,this.DEFAULT_MARKED_OPTIONS={renderer:new Do},this.DEFAULT_KATEX_OPTIONS={delimiters:[{left:"$$",right:"$$",display:!0},{left:"$",right:"$",display:!1},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}]},this.DEFAULT_MERMAID_OPTIONS={startOnLoad:!1},this.DEFAULT_CLIPBOARD_OPTIONS={buttonComponent:void 0},this.DEFAULT_PARSE_OPTIONS={decodeHtml:!1,inline:!1,emoji:!1,mermaid:!1,markedOptions:void 0,disableSanitizer:!1},this.DEFAULT_RENDER_OPTIONS={clipboard:!1,clipboardOptions:void 0,katex:!1,katexOptions:void 0,mermaid:!1,mermaidOptions:void 0},this._reload$=new K,this.reload$=this._reload$.asObservable(),this.options=o}parse(A,i=this.DEFAULT_PARSE_OPTIONS){let{decodeHtml:o,inline:g,emoji:n,mermaid:s,disableSanitizer:r}=i,I=R(R({},this.options),i.markedOptions),B=I.renderer||this.renderer||new Do;this.extensions&&(this.renderer=this.extendsRendererForExtensions(B)),s&&(this.renderer=this.extendsRendererForMermaid(B));let c=this.trimIndentation(A),D=o?this.decodeHtml(c):c,h=n?this.parseEmoji(D):D,p=this.parseMarked(h,I,g);return(r?p:this.sanitizer.sanitize(this.securityContext,p))||""}render(A,i=this.DEFAULT_RENDER_OPTIONS,o){let{clipboard:g,clipboardOptions:n,katex:s,katexOptions:r,mermaid:I,mermaidOptions:B}=i;s&&this.renderKatex(A,R(R({},this.DEFAULT_KATEX_OPTIONS),r)),I&&this.renderMermaid(A,R(R(R({},this.DEFAULT_MERMAID_OPTIONS),this.mermaidOptions),B)),g&&this.renderClipboard(A,o,R(R(R({},this.DEFAULT_CLIPBOARD_OPTIONS),this.clipboardOptions),n)),this.highlight(A)}reload(){this._reload$.next()}getSource(A){if(!this.http)throw new Error($P);return this.http.get(A,{responseType:"text"}).pipe(oA(i=>this.handleExtension(A,i)))}highlight(A){if(!to(this.platform)||typeof Prism>"u"||typeof Prism.highlightAllUnder>"u")return;A||(A=document);let i=A.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(i,o=>o.classList.add("language-none")),Prism.highlightAllUnder(A)}decodeHtml(A){if(!to(this.platform))return A;let i=document.createElement("textarea");return i.innerHTML=A,i.value}extendsRendererForExtensions(A){let i=A;return i.\u0275NgxMarkdownRendererExtendedForExtensions===!0||(this.extensions?.length>0&&XA.use(...this.extensions),i.\u0275NgxMarkdownRendererExtendedForExtensions=!0),A}extendsRendererForMermaid(A){let i=A;if(i.\u0275NgxMarkdownRendererExtendedForMermaid===!0)return A;let o=A.code;return A.code=g=>g.lang==="mermaid"?`
${g.text}
`:o(g),i.\u0275NgxMarkdownRendererExtendedForMermaid=!0,A}handleExtension(A,i){let o=A.lastIndexOf("://"),g=o>-1?A.substring(o+4):A,n=g.lastIndexOf("/"),s=n>-1?g.substring(n+1).split("?")[0]:"",r=s.lastIndexOf("."),I=r>-1?s.substring(r+1):"";return I&&I!=="md"?"```"+I+` `+i+"\n```":i}parseMarked(A,i,o=!1){if(i.renderer){let g=R({},i.renderer);delete g.\u0275NgxMarkdownRendererExtendedForExtensions,delete g.\u0275NgxMarkdownRendererExtendedForMermaid,delete i.renderer,XA.use({renderer:g})}return o?XA.parseInline(A,i):XA.parse(A,i)}parseEmoji(A){if(!to(this.platform))return A;if(typeof joypixels>"u"||typeof joypixels.shortnameToUnicode>"u")throw new Error(VP);return joypixels.shortnameToUnicode(A)}renderKatex(A,i){if(to(this.platform)){if(typeof katex>"u"||typeof renderMathInElement>"u")throw new Error(WP);renderMathInElement(A,i)}}renderClipboard(A,i,o){if(!to(this.platform))return;if(typeof ClipboardJS>"u")throw new Error(jP);if(!i)throw new Error(XP);let{buttonComponent:g,buttonTemplate:n}=o,s=A.querySelectorAll("pre");for(let r=0;rc.classList.add("hover"),B.onmouseleave=()=>c.classList.remove("hover");let D;if(g){let p=i.createComponent(g);D=p.hostView,p.changeDetectorRef.markForCheck()}else if(n)D=i.createEmbeddedView(n);else{let p=i.createComponent(OP);D=p.hostView,p.changeDetectorRef.markForCheck()}let h;D.rootNodes.forEach(p=>{c.appendChild(p),h=new ClipboardJS(p,{text:()=>I.innerText})}),D.onDestroy(()=>h.destroy())}}renderMermaid(A,i=this.DEFAULT_MERMAID_OPTIONS){if(!to(this.platform))return;if(typeof mermaid>"u"||typeof mermaid.initialize>"u")throw new Error(zP);let o=A.querySelectorAll(".mermaid");o.length!==0&&(mermaid.initialize(i),mermaid.run({nodes:o}))}trimIndentation(A){if(!A)return"";let i;return A.split(` `).map(o=>{let g=i;return o.length>0&&(g=isNaN(g)?o.search(/\S|$/):Math.min(o.search(/\S|$/),g)),isNaN(i)&&(i=g),g?o.substring(g):o}).join(` -`)}static{this.\u0275fac=function(i){return new(i||t)(J(PP,8),J(db,8),J(ZP,8),J(qP,8),J(jt),J(hb),J(it,8),J(an))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})(),Db=(()=>{class t{get disableSanitizer(){return this._disableSanitizer}set disableSanitizer(A){this._disableSanitizer=this.coerceBooleanProperty(A)}get inline(){return this._inline}set inline(A){this._inline=this.coerceBooleanProperty(A)}get clipboard(){return this._clipboard}set clipboard(A){this._clipboard=this.coerceBooleanProperty(A)}get emoji(){return this._emoji}set emoji(A){this._emoji=this.coerceBooleanProperty(A)}get katex(){return this._katex}set katex(A){this._katex=this.coerceBooleanProperty(A)}get mermaid(){return this._mermaid}set mermaid(A){this._mermaid=this.coerceBooleanProperty(A)}get lineHighlight(){return this._lineHighlight}set lineHighlight(A){this._lineHighlight=this.coerceBooleanProperty(A)}get lineNumbers(){return this._lineNumbers}set lineNumbers(A){this._lineNumbers=this.coerceBooleanProperty(A)}get commandLine(){return this._commandLine}set commandLine(A){this._commandLine=this.coerceBooleanProperty(A)}constructor(A,i,o){this.element=A,this.markdownService=i,this.viewContainerRef=o,this.error=new $,this.load=new $,this.ready=new $,this._clipboard=!1,this._commandLine=!1,this._disableSanitizer=!1,this._emoji=!1,this._inline=!1,this._katex=!1,this._lineHighlight=!1,this._lineNumbers=!1,this._mermaid=!1,this.destroyed$=new K}ngOnChanges(){this.loadContent()}loadContent(){if(this.data!=null){this.handleData();return}if(this.src!=null){this.handleSrc();return}}ngAfterViewInit(){!this.data&&!this.src&&this.handleTransclusion(),this.markdownService.reload$.pipe(DA(this.destroyed$)).subscribe(()=>this.loadContent())}ngOnDestroy(){this.destroyed$.next(),this.destroyed$.complete()}render(A,i=!1){return qe(this,null,function*(){let o={decodeHtml:i,inline:this.inline,emoji:this.emoji,mermaid:this.mermaid,disableSanitizer:this.disableSanitizer},g={clipboard:this.clipboard,clipboardOptions:this.getClipboardOptions(),katex:this.katex,katexOptions:this.katexOptions,mermaid:this.mermaid,mermaidOptions:this.mermaidOptions},n=yield this.markdownService.parse(A,o);this.element.nativeElement.innerHTML=n,this.handlePlugins(),this.markdownService.render(this.element.nativeElement,g,this.viewContainerRef),this.ready.emit()})}coerceBooleanProperty(A){return A!=null&&`${String(A)}`!="false"}getClipboardOptions(){if(this.clipboardButtonComponent||this.clipboardButtonTemplate)return{buttonComponent:this.clipboardButtonComponent,buttonTemplate:this.clipboardButtonTemplate}}handleData(){this.render(this.data)}handleSrc(){this.markdownService.getSource(this.src).subscribe({next:A=>{this.render(A).then(()=>{this.load.emit(A)})},error:A=>this.error.emit(A)})}handleTransclusion(){this.render(this.element.nativeElement.innerHTML,!0)}handlePlugins(){this.commandLine&&(this.setPluginClass(this.element.nativeElement,Qm.CommandLine),this.setPluginOptions(this.element.nativeElement,{dataFilterOutput:this.filterOutput,dataHost:this.host,dataPrompt:this.prompt,dataOutput:this.output,dataUser:this.user})),this.lineHighlight&&this.setPluginOptions(this.element.nativeElement,{dataLine:this.line,dataLineOffset:this.lineOffset}),this.lineNumbers&&(this.setPluginClass(this.element.nativeElement,Qm.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(A,i){let o=A.querySelectorAll("pre");for(let g=0;g{let s=i[n];if(s){let r=this.toLispCase(n);o.item(g).setAttribute(r,s.toString())}})}toLispCase(A){let i=A.match(/([A-Z])/g);if(!i)return A;let o=A.toString();for(let g=0,n=i.length;g{let i=eZ(A)?hA(R({},A),{multi:!0}):{provide:db,useValue:A,multi:!0};return[...e,i]},[])}var mb=(()=>{class t{static forRoot(A){return{ngModule:t,providers:[AZ(A)]}}static forChild(){return{ngModule:t}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=V({type:t})}static{this.\u0275inj=q({imports:[Uo]})}}return t})();var oZ=["switch"],gZ=["*"];function nZ(t,e){t&1&&(u(0,"span",10),at(),u(1,"svg",12),W(2,"path",13),m(),u(3,"svg",14),W(4,"path",15),m()())}var sZ=new k("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1,hideIcon:!1,disabledInteractive:!1})}),rZ={provide:Bn,useExisting:ft(()=>zE),multi:!0},WE=class{source;checked;constructor(e,A){this.source=e,this.checked=A}},zE=(()=>{class t{_elementRef=Q(Z);_focusMonitor=Q(Xt);_changeDetectorRef=Q(zA);defaults=Q(sZ);_onChange=A=>{};_onTouched=()=>{};_validatorOnChange=()=>{};_uniqueId;_checked=!1;_createChangeEvent(A){return new WE(this,A)}_labelId;get buttonId(){return`${this.id||this._uniqueId}-button`}_switchElement;focus(){this._switchElement.nativeElement.focus()}_noopAnimations;_focused;name=null;id;labelPosition="after";ariaLabel=null;ariaLabelledby=null;ariaDescribedby;required;color;disabled=!1;disableRipple=!1;tabIndex=0;get checked(){return this._checked}set checked(A){this._checked=A,this._changeDetectorRef.markForCheck()}hideIcon;disabledInteractive;change=new $;toggleChange=new $;get inputId(){return`${this.id||this._uniqueId}-input`}constructor(){Q(be).load(ki);let A=Q(new Dt("tabindex"),{optional:!0}),i=this.defaults,o=Q(ee,{optional:!0});this.tabIndex=A==null?0:parseInt(A)||0,this.color=i.color||"accent",this._noopAnimations=o==="NoopAnimations",this.id=this._uniqueId=Q(ce).getId("mat-mdc-slide-toggle-"),this.hideIcon=i.hideIcon??!1,this.disabledInteractive=i.disabledInteractive??!1,this._labelId=this._uniqueId+"-label"}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(A=>{A==="keyboard"||A==="program"?(this._focused=!0,this._changeDetectorRef.markForCheck()):A||Promise.resolve().then(()=>{this._focused=!1,this._onTouched(),this._changeDetectorRef.markForCheck()})})}ngOnChanges(A){A.required&&this._validatorOnChange()}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}writeValue(A){this.checked=!!A}registerOnChange(A){this._onChange=A}registerOnTouched(A){this._onTouched=A}validate(A){return this.required&&A.value!==!0?{required:!0}:null}registerOnValidatorChange(A){this._validatorOnChange=A}setDisabledState(A){this.disabled=A,this._changeDetectorRef.markForCheck()}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(this._createChangeEvent(this.checked))}_handleClick(){this.disabled||(this.toggleChange.emit(),this.defaults.disableToggleValue||(this.checked=!this.checked,this._onChange(this.checked),this.change.emit(new WE(this,this.checked))))}_getAriaLabelledBy(){return this.ariaLabelledby?this.ariaLabelledby:this.ariaLabel?null:this._labelId}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=O({type:t,selectors:[["mat-slide-toggle"]],viewQuery:function(i,o){if(i&1&&cA(oZ,5),i&2){let g;z(g=j())&&(o._switchElement=g.first)}},hostAttrs:[1,"mat-mdc-slide-toggle"],hostVars:13,hostBindings:function(i,o){i&2&&(yt("id",o.id),IA("tabindex",null)("aria-label",null)("name",null)("aria-labelledby",null),Xe(o.color?"mat-"+o.color:""),gA("mat-mdc-slide-toggle-focused",o._focused)("mat-mdc-slide-toggle-checked",o.checked)("_mat-animation-noopable",o._noopAnimations))},inputs:{name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],required:[2,"required","required",iA],color:"color",disabled:[2,"disabled","disabled",iA],disableRipple:[2,"disableRipple","disableRipple",iA],tabIndex:[2,"tabIndex","tabIndex",A=>A==null?0:Fe(A)],checked:[2,"checked","checked",iA],hideIcon:[2,"hideIcon","hideIcon",iA],disabledInteractive:[2,"disabledInteractive","disabledInteractive",iA]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[KA([rZ,{provide:Cg,useExisting:t,multi:!0}]),VA],ngContentSelectors:gZ,decls:13,vars:27,consts:[["switch",""],["mat-internal-form-field","",3,"labelPosition"],["role","switch","type","button",1,"mdc-switch",3,"click","tabIndex","disabled"],[1,"mdc-switch__track"],[1,"mdc-switch__handle-track"],[1,"mdc-switch__handle"],[1,"mdc-switch__shadow"],[1,"mdc-elevation-overlay"],[1,"mdc-switch__ripple"],["mat-ripple","",1,"mat-mdc-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-switch__icons"],[1,"mdc-label",3,"click","for"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--on"],["d","M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--off"],["d","M20 13H4v-2h16v2z"]],template:function(i,o){if(i&1){let g=aA();qA(),u(0,"div",1)(1,"button",2,0),x("click",function(){return H(g),T(o._handleClick())}),W(3,"span",3),u(4,"span",4)(5,"span",5)(6,"span",6),W(7,"span",7),m(),u(8,"span",8),W(9,"span",9),m(),_(10,nZ,5,0,"span",10),m()()(),u(11,"label",11),x("click",function(s){return H(g),T(s.stopPropagation())}),rA(12),m()()}if(i&2){let g=He(2);F("labelPosition",o.labelPosition),f(),gA("mdc-switch--selected",o.checked)("mdc-switch--unselected",!o.checked)("mdc-switch--checked",o.checked)("mdc-switch--disabled",o.disabled)("mat-mdc-slide-toggle-disabled-interactive",o.disabledInteractive),F("tabIndex",o.disabled&&!o.disabledInteractive?-1:o.tabIndex)("disabled",o.disabled&&!o.disabledInteractive),IA("id",o.buttonId)("name",o.name)("aria-label",o.ariaLabel)("aria-labelledby",o._getAriaLabelledBy())("aria-describedby",o.ariaDescribedby)("aria-required",o.required||null)("aria-checked",o.checked)("aria-disabled",o.disabled&&o.disabledInteractive?"true":null),f(8),F("matRippleTrigger",g)("matRippleDisabled",o.disableRipple||o.disabled)("matRippleCentered",!0),f(),wA(o.hideIcon?-1:10),f(),F("for",o.buttonId),IA("id",o._labelId)}},dependencies:[dg,cE],styles:['.mdc-switch{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;flex-shrink:0;margin:0;outline:none;overflow:visible;padding:0;position:relative;width:var(--mdc-switch-track-width, 52px)}.mdc-switch.mdc-switch--disabled{cursor:default;pointer-events:none}.mdc-switch.mat-mdc-slide-toggle-disabled-interactive{pointer-events:auto}.mdc-switch__track{overflow:hidden;position:relative;width:100%;height:var(--mdc-switch-track-height, 32px);border-radius:var(--mdc-switch-track-shape, var(--mat-sys-corner-full))}.mdc-switch--disabled.mdc-switch .mdc-switch__track{opacity:var(--mdc-switch-disabled-track-opacity, 0.12)}.mdc-switch__track::before,.mdc-switch__track::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";height:100%;left:0;position:absolute;width:100%;border-width:var(--mat-switch-track-outline-width, 2px);border-color:var(--mat-switch-track-outline-color, var(--mat-sys-outline))}.mdc-switch--selected .mdc-switch__track::before,.mdc-switch--selected .mdc-switch__track::after{border-width:var(--mat-switch-selected-track-outline-width, 2px);border-color:var(--mat-switch-selected-track-outline-color, transparent)}.mdc-switch--disabled .mdc-switch__track::before,.mdc-switch--disabled .mdc-switch__track::after{border-width:var(--mat-switch-disabled-unselected-track-outline-width, 2px);border-color:var(--mat-switch-disabled-unselected-track-outline-color, var(--mat-sys-on-surface))}@media(forced-colors: active){.mdc-switch__track{border-color:currentColor}}.mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:translateX(0);background:var(--mdc-switch-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1);transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch--selected .mdc-switch__track::before{transform:translateX(-100%)}.mdc-switch--selected .mdc-switch__track::before{opacity:var(--mat-switch-hidden-track-opacity, 0);transition:var(--mat-switch-hidden-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::before{opacity:var(--mat-switch-visible-track-opacity, 1);transition:var(--mat-switch-visible-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::before{background:var(--mdc-switch-unselected-hover-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::before{background:var(--mdc-switch-unselected-focus-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:active .mdc-switch__track::before{background:var(--mdc-switch-unselected-pressed-track-color, var(--mat-sys-surface-variant))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::before,.mdc-switch.mdc-switch--disabled .mdc-switch__track::before{background:var(--mdc-switch-disabled-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch__track::after{transform:translateX(-100%);background:var(--mdc-switch-selected-track-color, var(--mat-sys-primary))}[dir=rtl] .mdc-switch__track::after{transform:translateX(100%)}.mdc-switch--selected .mdc-switch__track::after{transform:translateX(0)}.mdc-switch--selected .mdc-switch__track::after{opacity:var(--mat-switch-visible-track-opacity, 1);transition:var(--mat-switch-visible-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::after{opacity:var(--mat-switch-hidden-track-opacity, 0);transition:var(--mat-switch-hidden-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::after{background:var(--mdc-switch-selected-hover-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::after{background:var(--mdc-switch-selected-focus-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:active .mdc-switch__track::after{background:var(--mdc-switch-selected-pressed-track-color, var(--mat-sys-primary))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::after,.mdc-switch.mdc-switch--disabled .mdc-switch__track::after{background:var(--mdc-switch-disabled-selected-track-color, var(--mat-sys-on-surface))}.mdc-switch__handle-track{height:100%;pointer-events:none;position:absolute;top:0;transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);left:0;right:auto;transform:translateX(0);width:calc(100% - var(--mdc-switch-handle-width))}[dir=rtl] .mdc-switch__handle-track{left:auto;right:0}.mdc-switch--selected .mdc-switch__handle-track{transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch__handle-track{transform:translateX(-100%)}.mdc-switch__handle{display:flex;pointer-events:auto;position:absolute;top:50%;transform:translateY(-50%);left:0;right:auto;transition:width 75ms cubic-bezier(0.4, 0, 0.2, 1),height 75ms cubic-bezier(0.4, 0, 0.2, 1),margin 75ms cubic-bezier(0.4, 0, 0.2, 1);width:var(--mdc-switch-handle-width);height:var(--mdc-switch-handle-height);border-radius:var(--mdc-switch-handle-shape, var(--mat-sys-corner-full))}[dir=rtl] .mdc-switch__handle{left:auto;right:0}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle{width:var(--mat-switch-unselected-handle-size, 16px);height:var(--mat-switch-unselected-handle-size, 16px);margin:var(--mat-switch-unselected-handle-horizontal-margin, 0 8px)}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-switch-unselected-with-icon-handle-horizontal-margin, 0 4px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle{width:var(--mat-switch-selected-handle-size, 24px);height:var(--mat-switch-selected-handle-size, 24px);margin:var(--mat-switch-selected-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-switch-selected-with-icon-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch__handle:has(.mdc-switch__icons){width:var(--mat-switch-with-icon-handle-size, 24px);height:var(--mat-switch-with-icon-handle-size, 24px)}.mat-mdc-slide-toggle .mdc-switch:active:not(.mdc-switch--disabled) .mdc-switch__handle{width:var(--mat-switch-pressed-handle-size, 28px);height:var(--mat-switch-pressed-handle-size, 28px)}.mat-mdc-slide-toggle .mdc-switch--selected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-switch-selected-pressed-handle-horizontal-margin, 0 22px)}.mat-mdc-slide-toggle .mdc-switch--unselected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-switch-unselected-pressed-handle-horizontal-margin, 0 2px)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__handle::after{opacity:var(--mat-switch-disabled-selected-handle-opacity, 1)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__handle::after{opacity:var(--mat-switch-disabled-unselected-handle-opacity, 0.38)}.mdc-switch__handle::before,.mdc-switch__handle::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";width:100%;height:100%;left:0;position:absolute;top:0;transition:background-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1),border-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);z-index:-1}@media(forced-colors: active){.mdc-switch__handle::before,.mdc-switch__handle::after{border-color:currentColor}}.mdc-switch--selected:enabled .mdc-switch__handle::after{background:var(--mdc-switch-selected-handle-color, var(--mat-sys-on-primary))}.mdc-switch--selected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-selected-hover-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-selected-focus-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:active .mdc-switch__handle::after{background:var(--mdc-switch-selected-pressed-handle-color, var(--mat-sys-primary-container))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:hover:not(:focus):not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:focus:not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:active .mdc-switch__handle::after,.mdc-switch--selected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mdc-switch-disabled-selected-handle-color, var(--mat-sys-surface))}.mdc-switch--unselected:enabled .mdc-switch__handle::after{background:var(--mdc-switch-unselected-handle-color, var(--mat-sys-outline))}.mdc-switch--unselected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-unselected-hover-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-unselected-focus-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:active .mdc-switch__handle::after{background:var(--mdc-switch-unselected-pressed-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mdc-switch-disabled-unselected-handle-color, var(--mat-sys-on-surface))}.mdc-switch__handle::before{background:var(--mdc-switch-handle-surface-color)}.mdc-switch__shadow{border-radius:inherit;bottom:0;left:0;position:absolute;right:0;top:0}.mdc-switch:enabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-handle-elevation-shadow)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__shadow,.mdc-switch.mdc-switch--disabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-disabled-handle-elevation-shadow)}.mdc-switch__ripple{left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);z-index:-1;width:var(--mdc-switch-state-layer-size, 40px);height:var(--mdc-switch-state-layer-size, 40px)}.mdc-switch__ripple::after{content:"";opacity:0}.mdc-switch--disabled .mdc-switch__ripple::after{display:none}.mat-mdc-slide-toggle-disabled-interactive .mdc-switch__ripple::after{display:block}.mdc-switch:hover .mdc-switch__ripple::after{opacity:.04;transition:75ms opacity cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mdc-switch .mdc-switch__ripple::after{opacity:.12}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:focus .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:active .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:hover:not(:focus) .mdc-switch__ripple::after,.mdc-switch--unselected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mdc-switch-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-switch--unselected:enabled:focus .mdc-switch__ripple::after{background:var(--mdc-switch-unselected-focus-state-layer-color, var(--mat-sys-on-surface))}.mdc-switch--unselected:enabled:active .mdc-switch__ripple::after{background:var(--mdc-switch-unselected-pressed-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mdc-switch-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch--selected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mdc-switch-selected-hover-state-layer-color, var(--mat-sys-primary))}.mdc-switch--selected:enabled:focus .mdc-switch__ripple::after{background:var(--mdc-switch-selected-focus-state-layer-color, var(--mat-sys-primary))}.mdc-switch--selected:enabled:active .mdc-switch__ripple::after{background:var(--mdc-switch-selected-pressed-state-layer-color, var(--mat-sys-primary));opacity:var(--mdc-switch-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch__icons{position:relative;height:100%;width:100%;z-index:1}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__icons{opacity:var(--mdc-switch-disabled-unselected-icon-opacity, 0.38)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__icons{opacity:var(--mdc-switch-disabled-selected-icon-opacity, 0.38)}.mdc-switch__icon{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;opacity:0;transition:opacity 30ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-switch--unselected .mdc-switch__icon{width:var(--mdc-switch-unselected-icon-size, 16px);height:var(--mdc-switch-unselected-icon-size, 16px);fill:var(--mdc-switch-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mdc-switch-disabled-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__icon{width:var(--mdc-switch-selected-icon-size, 16px);height:var(--mdc-switch-selected-icon-size, 16px);fill:var(--mdc-switch-selected-icon-color, var(--mat-sys-on-primary-container))}.mdc-switch--selected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mdc-switch-disabled-selected-icon-color, var(--mat-sys-on-surface))}.mdc-switch--selected .mdc-switch__icon--on,.mdc-switch--unselected .mdc-switch__icon--off{opacity:1;transition:opacity 45ms 30ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle{-webkit-user-select:none;user-select:none;display:inline-block;-webkit-tap-highlight-color:rgba(0,0,0,0);outline:0}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple,.mat-mdc-slide-toggle .mdc-switch__ripple::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple:not(:empty),.mat-mdc-slide-toggle .mdc-switch__ripple::after:not(:empty){transform:translateZ(0)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mat-focus-indicator::before{content:""}.mat-mdc-slide-toggle .mat-internal-form-field{color:var(--mat-switch-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-switch-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-switch-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-switch-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-switch-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-switch-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-slide-toggle .mat-ripple-element{opacity:.12}.mat-mdc-slide-toggle .mat-focus-indicator::before{border-radius:50%}.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle-track,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__icon,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::after,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::after{transition:none}.mat-mdc-slide-toggle .mdc-switch:enabled+.mdc-label{cursor:pointer}.mat-mdc-slide-toggle .mdc-switch--disabled+label{color:var(--mdc-switch-disabled-label-text-color)}'],encapsulation:2,changeDetection:0})}return t})();var fb=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=V({type:t});static \u0275inj=q({imports:[zE,SA,SA]})}return t})();var cr=class t{downloadBase64Data(e,A,i="image.png"){try{let o=document.createElement("a");o.href=e,o.download=i,document.body.appendChild(o),o.click(),document.body.removeChild(o)}catch(o){throw console.error("Error downloading base64 data:",o),o}}static \u0275fac=function(A){return new(A||t)};static \u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})};function CZ(t,e){t&1&&W(0,"hr",10)}function BZ(t,e){if(t&1&&(u(0,"mat-option",11),v(1),m()),t&2){let A=e.$implicit;F("value",A),f(),PA(A.versionId)}}function QZ(t,e){if(t&1&&W(0,"img",12),t&2){let A,i=b().index,o=b();F("src",(A=o.selectedArtifacts[i].data)!==null&&A!==void 0?A:"",An)}}function EZ(t,e){if(t&1){let A=aA();u(0,"div",2),_(1,CZ,1,0,"hr",3),u(2,"div",4)(3,"span"),v(4),m()(),u(5,"div",4)(6,"span"),v(7," Version: "),m(),u(8,"div",5)(9,"mat-select",6),fi("ngModelChange",function(o){let g=H(A).index,n=b();return $i(n.selectedArtifacts[g],o)||(n.selectedArtifacts[g]=o),T(o)}),x("selectionChange",function(o){let g=H(A).index,n=b();return T(n.onArtifactVersionChange(o,g))}),_(10,BZ,2,2,"mat-option",7),m()(),u(11,"button",8),x("click",function(){let o=H(A).index,g=b();return T(g.downloadArtifact(g.selectedArtifacts[o]))}),u(12,"mat-icon"),v(13,"file_download"),m(),v(14," Download "),m()(),_(15,QZ,1,1,"img",9),m()}if(t&2){let A=e.$implicit,i=e.index,o=b();f(),F("ngIf",i>0),f(3),te(" ",o.getArtifactName(A)," "),f(5),mi("ngModel",o.selectedArtifacts[i]),f(),F("ngForOf",o.getSortedArtifactsFromId(A)),f(5),F("ngIf",o.isArtifactImage(o.selectedArtifacts[i]))}}var cZ="default_artifact_name",Fa=class t{constructor(e){this.downloadService=e}artifacts=[];selectedArtifacts=[];ngOnChanges(e){if(e.artifacts){this.selectedArtifacts=[];for(let A of this.getDistinctArtifactIds())this.selectedArtifacts.push(this.getSortedArtifactsFromId(A)[0])}}downloadArtifact(e){this.downloadService.downloadBase64Data(e.data,e.mimeType,e.id)}getArtifactName(e){return e??cZ}isArtifactImage(e){return!e||!e.mimeType?!1:e.mimeType.startsWith("image/")}getDistinctArtifactIds(){return[...new Set(this.artifacts.map(e=>e.id))]}getSortedArtifactsFromId(e){return this.artifacts.filter(A=>A.id===e).sort((A,i)=>i.versionId-A.versionId)}onArtifactVersionChange(e,A){this.selectedArtifacts[A]=e.value}static \u0275fac=function(A){return new(A||t)(AA(cr))};static \u0275cmp=O({type:t,selectors:[["app-artifact-tab"]],inputs:{artifacts:"artifacts"},standalone:!1,features:[VA],decls:2,vars:1,consts:[[1,"artifact-container"],["class","artifact-box",4,"ngFor","ngForOf"],[1,"artifact-box"],["class","white-separator",4,"ngIf"],[1,"artifact-metadata"],[1,"version-select-container"],[3,"ngModelChange","selectionChange","ngModel"],[3,"value",4,"ngFor","ngForOf"],["mat-flat-button","",1,"download-button",3,"click"],["class","generated-image","alt","artifact.id",3,"src",4,"ngIf"],[1,"white-separator"],[3,"value"],["alt","artifact.id",1,"generated-image",3,"src"]],template:function(A,i){A&1&&(u(0,"div",0),_(1,EZ,16,5,"div",1),m()),A&2&&(f(),F("ngForOf",i.getDistinctArtifactIds()))},dependencies:[Rt,Jt,oo,yi,Ir,bt,ir,hg],styles:[".artifact-container[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}.artifact-box[_ngcontent-%COMP%]{padding:10px;max-width:100%;margin-left:26px;display:flex;flex-direction:column}.artifact-metadata[_ngcontent-%COMP%]{display:flex;align-items:center;margin-bottom:15px}.download-button[_ngcontent-%COMP%]{background-color:#8ab4f8!important;margin-left:35px;width:130px;height:28px;font-size:14px}.generated-image[_ngcontent-%COMP%]{max-width:60%;border-radius:8px}hr.white-separator[_ngcontent-%COMP%]{border:none;border-top:1px solid white;margin-bottom:1.2em;margin-right:15px}.version-select-container[_ngcontent-%COMP%]{background-color:#212123;width:80px;margin-left:15px}"]})};var ba=class t{sessionState={};constructor(){}static \u0275fac=function(A){return new(A||t)};static \u0275cmp=O({type:t,selectors:[["app-state-tab"]],inputs:{sessionState:"sessionState"},standalone:!1,decls:3,vars:1,consts:[[1,"state-wrapper"],[3,"json"]],template:function(A,i){A&1&&(u(0,"div",0)(1,"div"),W(2,"ngx-json-viewer",1),m()()),A&2&&(f(2),F("json",i.sessionState))},dependencies:[OE],styles:[".state-wrapper[_ngcontent-%COMP%]{padding-left:25px;padding-right:25px;margin-top:16px}"]})};var hZ=["videoContainer"],uZ=["sidenav"],DZ=["autoScroll"],mZ=()=>[],fZ=(t,e)=>({"user-message":t,"bot-message":e}),wb=t=>({"background-color":t});function wZ(t,e){if(t&1&&(u(0,"mat-option",20),v(1),m()),t&2){let A=e.$implicit;F("value",A),f(),PA(A)}}function pZ(t,e){t&1&&tn(0,wZ,2,2,"mat-option",20,en),t&2&&on(e)}function yZ(t,e){if(t&1&&(u(0,"mat-option",20),v(1),m()),t&2){let A=b(2);F("value",A.selectedAppControl.value),f(),PA(A.selectedAppControl.value)}}function MZ(t,e){if(t&1&&(u(0,"div",10)(1,"mat-select",19),_(2,pZ,2,0),rg(3,"async"),_(4,yZ,2,2,"mat-option",20),m()()),t&2){let A,i=b();f(),F("placeholder",i.isLoadingApps()?"Loading...":"Select an agent")("formControl",i.selectedAppControl),f(),wA((A=Ds(3,4,i.apps$))?2:-1,A),f(2),wA(i.selectedAppControl.value&&i.isLoadingApps()?4:-1)}}function RZ(t,e){t&1&&(u(0,"span"),v(1," No apps Avaiable in current directory"),m())}function kZ(t,e){t&1&&(u(0,"span",29),v(1,"Events"),m())}function FZ(t,e){t&1&&(u(0,"span",29),v(1,"State"),m())}function bZ(t,e){t&1&&(u(0,"span",29),v(1,"Artifacts"),m())}function SZ(t,e){t&1&&(u(0,"span",29),v(1,"Sessions"),m())}function NZ(t,e){t&1&&(u(0,"span",29),v(1,"Eval"),m())}function GZ(t,e){if(t&1){let A=aA();u(0,"div",21)(1,"mat-tab-group")(2,"mat-tab",22),_(3,kZ,2,0,"ng-template",23),u(4,"app-event-tab",24),x("selectedEvent",function(o){H(A);let g=b();return T(g.selectEvent(o))}),m()(),u(5,"mat-tab"),_(6,FZ,2,0,"ng-template",23),W(7,"app-state-tab",25),m(),u(8,"mat-tab"),_(9,bZ,2,0,"ng-template",23),W(10,"app-artifact-tab",26),m(),u(11,"mat-tab"),_(12,SZ,2,0,"ng-template",23),u(13,"app-session-tab",27),x("sessionSelected",function(o){H(A);let g=b();return T(g.updateWithSelectedSession(o))})("sessionReloaded",function(o){H(A);let g=b();return T(g.updateSessionState(o))}),m()(),u(14,"mat-tab"),_(15,NZ,2,0,"ng-template",23),u(16,"app-eval-tab",28),x("sessionSelected",function(o){H(A);let g=b();return T(g.updateWithSelectedSession(o))}),m()()()()}if(t&2){let A=b();f(4),F("eventsMap",A.eventData),f(3),F("sessionState",A.currentSessionState),f(3),F("artifacts",A.artifacts),f(3),F("userId",A.userId)("appName",A.appName)("sessionId",A.sessionId),f(3),F("appName",A.appName)("userId",A.userId)("sessionId",A.sessionId)}}function vZ(t,e){if(t&1&&W(0,"div",41),t&2){let A=b(2);F("innerHtml",A.renderedEventGraph,jp)}}function LZ(t,e){if(t&1){let A=aA();u(0,"div",30)(1,"div",31)(2,"div",32)(3,"mat-paginator",33),x("page",function(o){H(A);let g=b();return T(g.handlePageEvent(o))}),m(),u(4,"button",34)(5,"mat-icon",9),x("click",function(){H(A);let o=b();return T(o.closeSelectedEvent())}),v(6,"close"),m()()()(),u(7,"div")(8,"mat-tab-group")(9,"mat-tab",35)(10,"div",36),_(11,vZ,1,1,"div",37),m(),W(12,"ngx-json-viewer",38),m(),u(13,"mat-tab",39),W(14,"ngx-json-viewer",38),m(),u(15,"mat-tab",40),W(16,"ngx-json-viewer",38),m()()()()}if(t&2){let A=b();f(3),F("length",A.eventData.size)("pageSize",1)("pageIndex",A.selectedEventIndex),f(8),F("ngIf",A.renderedEventGraph),f(),F("json",A.selectedEvent),f(2),F("json",A.llmRequest),f(2),F("json",A.llmResponse)}}function KZ(t,e){if(t&1){let A=aA();u(0,"div",42)(1,"div",43)(2,"div",44),v(3,"Session ID"),m(),u(4,"div",45),v(5),m()(),u(6,"div",46)(7,"div",47)(8,"mat-slide-toggle",48),x("change",function(){H(A);let o=b();return T(o.toggleSse())}),v(9," Token Streaming "),m()(),W(10,"mat-divider",49),u(11,"div",50)(12,"div",51),x("click",function(){H(A);let o=b();return T(o.onNewSessionClick())}),u(13,"mat-icon"),v(14,"add"),m(),v(15," New Session "),m(),u(16,"span",52),x("click",function(){H(A);let o=b();return T(o.deleteSession(o.sessionId))}),v(17," delete "),m()()()()}if(t&2){let A=b();f(5),PA(A.sessionId),f(3),F("checked",A.enableSseIndicator()),f(2),F("vertical",!0)}}function UZ(t,e){t&1&&(u(0,"div",53)(1,"span"),v(2,"Loading agents, please wait..."),m()())}function _Z(t,e){t&1&&(u(0,"span"),v(1,"Welcome to ADK!"),W(2,"br"),v(3," Select an agent on the left to begin with."),m())}function xZ(t,e){if(t&1&&(v(0," Error message: "),W(1,"br"),u(2,"pre",55),v(3),m()),t&2){let A=b(4);f(3),PA(A.loadingError())}}function YZ(t,e){t&1&&(u(0,"pre",54),v(1,"Warning: No agents found in current folder."),m())}function JZ(t,e){if(t&1&&(u(0,"div"),v(1," Failed to load agents. To get started, run "),u(2,"pre"),v(3,"adk web"),m(),v(4," in the folder that contains the agents."),W(5,"br"),_(6,xZ,4,1)(7,YZ,2,0,"pre",54),m()),t&2){let A=b(3);f(6),wA(A.loadingError()?6:7)}}function HZ(t,e){if(t&1&&(u(0,"div",53),_(1,_Z,4,0,"span"),rg(2,"async"),_(3,JZ,8,1,"div"),m()),t&2){let A=b(2);f(),wA((Ds(2,1,A.apps$)||I0(3,mZ)).length>0?1:3)}}function TZ(t,e){if(t&1&&_(0,UZ,3,0,"div",53)(1,HZ,4,4,"div",53),t&2){let A=b();wA(A.isLoadingApps()?0:1)}}function OZ(t,e){if(t&1){let A=aA();u(0,"button",56),x("click",function(){H(A);let o=b();return T(o.openDialog())}),u(1,"mat-icon"),v(2,"priority_high"),m()()}}function PZ(t,e){if(t&1){let A=aA();u(0,"button",67),x("click",function(){H(A);let o=b().index,g=b(2);return T(g.clickEvent(o))}),u(1,"mat-icon",68),v(2,"robot_2"),m()()}}function ZZ(t,e){if(t&1&&(ui(0),W(1,"img",72),Di()),t&2){let A=b().$implicit;f(),F("src",A.url,An)}}function qZ(t,e){if(t&1&&(ui(0),u(1,"mat-icon"),v(2,"insert_drive_file"),m(),u(3,"a",73),v(4),m(),Di()),t&2){let A=b().$implicit;f(3),F("href",A.url,An),f(),PA(A.file.name)}}function VZ(t,e){if(t&1&&(u(0,"div",71),_(1,ZZ,2,1,"ng-container",64)(2,qZ,5,2,"ng-container",64),m()),t&2){let A=e.$implicit;f(),F("ngIf",A.file.type.startsWith("image/")),f(),F("ngIf",!A.file.type.startsWith("image/"))}}function WZ(t,e){if(t&1&&(u(0,"div",69),_(1,VZ,3,2,"div",70),m()),t&2){let A=b().$implicit;f(),F("ngForOf",A.attachments)}}function zZ(t,e){if(t&1&&W(0,"markdown",74),t&2){let A=b().$implicit;F("data",A.text)}}function jZ(t,e){if(t&1&&(u(0,"code"),v(1),m()),t&2){let A=b().$implicit;f(),te(" ",A.executableCode.code," ")}}function XZ(t,e){if(t&1&&(u(0,"div")(1,"div"),v(2),m(),u(3,"div"),v(4),m()()),t&2){let A=b().$implicit;f(2),te("Outcome: ",A.codeExecutionResult.outcome,""),f(2),te("Output: ",A.codeExecutionResult.output,"")}}function $Z(t,e){if(t&1&&(u(0,"div"),W(1,"img",75),m()),t&2){let A=b().$implicit;f(),F("src",A.inline_data.data,An)}}function Aq(t,e){if(t&1){let A=aA();u(0,"button",76),x("click",function(){H(A);let o=b().index,g=b(2);return T(g.clickEvent(o))}),u(1,"mat-icon"),v(2,"bolt"),m(),v(3),m()}if(t&2){let A=b().$implicit;f(3),te(" ",A.functionCall.name," ")}}function eq(t,e){if(t&1){let A=aA();u(0,"button",76),x("click",function(){H(A);let o=b().index,g=b(2);return T(g.clickEvent(o))}),u(1,"mat-icon"),v(2,"check"),m(),v(3),m()}if(t&2){let A=b().$implicit;f(3),te(" ",A.functionResponse.name," ")}}function tq(t,e){t&1&&(u(0,"button",34)(1,"mat-icon"),v(2,"person"),m()())}function iq(t,e){if(t&1&&(u(0,"div",59),_(1,PZ,3,0,"button",60),u(2,"mat-card",61),_(3,WZ,2,1,"div",62)(4,zZ,1,1,"markdown",63)(5,jZ,2,1,"code",64)(6,XZ,5,2,"div",64)(7,$Z,2,1,"div",64)(8,Aq,4,1,"button",65)(9,eq,4,1,"button",65),m(),_(10,tq,3,0,"button",66),m()),t&2){let A=e.$implicit;F("ngClass",us(10,fZ,A.role==="user",A.role==="bot")),f(),F("ngIf",A.role==="bot"),f(2),F("ngIf",A.attachments),f(),F("ngIf",A.text),f(),F("ngIf",A.executableCode),f(),F("ngIf",A.codeExecutionResult),f(),F("ngIf",A.inline_data&&A.role==="bot"),f(),F("ngIf",A.functionCall),f(),F("ngIf",A.functionResponse),f(),F("ngIf",A.role==="user")}}function oq(t,e){if(t&1&&(u(0,"div",57,1),W(2,"div",null,2),_(4,iq,11,13,"div",58),m()),t&2){let A=b();f(4),F("ngForOf",A.messages)}}function gq(t,e){if(t&1){let A=aA();u(0,"div",90),W(1,"img",91),u(2,"button",92),x("click",function(){H(A);let o=b().index,g=b(3);return T(g.removeFile(o))}),u(3,"mat-icon",93),v(4,"close"),m()()()}if(t&2){let A=b().$implicit;f(),F("src",A.url,An)}}function nq(t,e){if(t&1){let A=aA();u(0,"div",94)(1,"button",92),x("click",function(){H(A);let o=b().index,g=b(3);return T(g.removeFile(o))}),u(2,"mat-icon",93),v(3,"close"),m()(),u(4,"div",95)(5,"mat-icon"),v(6,"insert_drive_file"),m(),u(7,"span"),v(8),m()()()}if(t&2){let A=b().$implicit;f(8),PA(A.file.name)}}function sq(t,e){if(t&1&&(u(0,"div"),_(1,gq,5,1,"div",88)(2,nq,9,1,"div",89),m()),t&2){let A=e.$implicit;f(),F("ngIf",A.file.type.startsWith("image/")),f(),F("ngIf",!A.file.type.startsWith("image/"))}}function rq(t,e){if(t&1&&(u(0,"div",86),_(1,sq,3,2,"div",87),m()),t&2){let A=b(2);f(),F("ngForOf",A.selectedFiles)}}function Iq(t,e){if(t&1){let A=aA();u(0,"div",77)(1,"input",78,3),x("change",function(o){H(A);let g=b();return T(g.onFileSelect(o))}),m(),u(3,"mat-form-field",79),_(4,rq,2,1,"div",80),u(5,"input",81),fi("ngModelChange",function(o){H(A);let g=b();return $i(g.userInput,o)||(g.userInput=o),T(o)}),x("keydown.enter",function(o){H(A);let g=b();return T(g.sendMessage(o))}),m(),u(6,"div",82)(7,"button",83),x("click",function(){H(A);let o=He(2);return T(o.click())}),u(8,"mat-icon"),v(9,"attach_file"),m()(),u(10,"div")(11,"button",84),x("click",function(){H(A);let o=b();return T(o.toggleAudioRecording())}),W(12,"mat-icon",85),m(),u(13,"button",84),x("click",function(){H(A);let o=b();return T(o.toggleVideoRecording())}),W(14,"mat-icon",85),m()()()()()}if(t&2){let A=b();f(4),F("ngIf",A.selectedFiles.length&&A.appName!=""),f(),mi("ngModel",A.userInput),f(6),F("ngStyle",gn(6,wb,A.isAudioRecording?"rgb(234, 67, 53)":"rgb(51, 53, 55)")),f(),F("innerText",A.isAudioRecording?"stop":"mic"),f(),F("ngStyle",gn(8,wb,A.isVideoRecording?"rgb(234, 67, 53)":"rgb(51, 53, 55)")),f(),F("innerText",A.isVideoRecording?"stop":"videocam")}}function aq(t){for(t=t.replace(/-/g,"+").replace(/_/g,"/");t.length%4!==0;)t+="=";return t}var Em=class extends yn{nextPageLabel="Next Event";previousPageLabel="Previous Event";firstPageLabel="First Event";lastPageLabel="Last Event";getRangeLabel=(e,A,i)=>i===0?`Event 0 of ${i}`:(i=Math.max(i,0),`Event ${e*A+1} of ${i}`)},Sa=class t{constructor(e,A,i,o,g,n,s,r,I){this.sanitizer=e;this.sesisonService=A;this.artifactService=i;this.audioService=o;this.webSocketService=g;this.videoService=n;this.dialog=s;this.eventService=r;this.sessionService=I}videoContainer;sidenav;eventTabComponent;sessionTab;evalTab;scrollContainer;_snackBar=Q(Ok);enableSseIndicator=_t(!1);videoElement;currentMessage="";messages=[];lastTextChunk="";streamingTextMessage=null;artifacts=[];userInput="";userId="user";appName="";sessionId="";isAudioRecording=!1;isVideoRecording=!1;longRunningEvents=[];functionCallEventId="";redirectUri=ot.getBaseUrlWithoutPath();showSidePanel=!0;useSse=!1;currentSessionState={};eventData=new Map;eventMessageIndexArray=[];renderedEventGraph;selectedEvent=void 0;selectedEventIndex=void 0;llmRequest=void 0;llmResponse=void 0;llmRequestKey="gcp.vertex.agent.llm_request";llmResponseKey="gcp.vertex.agent.llm_response";selectedFiles=[];previousMessageCount=0;router=Q(ao);activatedRoute=Q(Io);selectedAppControl=new dQ("",{nonNullable:!0});agentService=Q(fg);isLoadingApps=_t(!1);loadingError=_t("");apps$=tA([]).pipe(Ie(()=>{this.isLoadingApps.set(!0),this.selectedAppControl.disable()}),re(()=>this.agentService.listApps().pipe(lt(e=>(this.loadingError.set(e.message),tA(void 0))))),de(1),Ie(()=>{this.isLoadingApps.set(!1),this.selectedAppControl.enable()}),Ro());ngOnInit(){if(this.syncSelectedAppFromUrl(),this.updateSelectedAppUrl(),new URL(window.location.href).searchParams.has("code")){let i=window.location.href;window.opener?.postMessage({authResponseUrl:i},window.origin),window.close()}this.agentService.getApp().subscribe(i=>{this.appName=i})}ngAfterViewInit(){this.showSidePanel=!0,this.sidenav.open()}ngAfterViewChecked(){this.messages.length!==this.previousMessageCount&&(this.scrollContainer.nativeElement.scrollTop=this.scrollContainer.nativeElement.scrollHeight,this.previousMessageCount=this.messages.length)}selectApp(e){e!=this.appName&&(this.agentService.setApp(e),this.createSession(),this.eventData=new Map,this.eventMessageIndexArray=[],this.messages=[],this.artifacts=[],this.userInput="",this.longRunningEvents=[])}createSession(){this.sesisonService.createSession(this.userId,this.appName).subscribe(e=>{this.currentSessionState=e.state,this.sessionId=e.id,this.sessionTab.refreshSession()})}sendMessage(e){return qe(this,null,function*(){if(e.preventDefault(),!this.userInput.trim())return;if(this.selectedFiles.length>0){let o=this.selectedFiles.map(g=>({file:g.file,url:g.url}));this.messages.push({role:"user",attachments:o})}this.messages.push({role:"user",text:this.userInput});let A={app_name:this.appName,user_id:this.userId,session_id:this.sessionId,new_message:{role:"user",parts:yield this.getUserMessageParts()},streaming:this.useSse};this.selectedFiles=[];let i=this.eventMessageIndexArray.length-1;this.streamingTextMessage=null,this.agentService.run_sse(A).subscribe({next:o=>qe(this,null,function*(){let g=JSON.parse(o);if(g.error){this.openSnackBar(g.error,"OK");return}if(g.content)for(let n of g.content.parts)i+=1,this.processPart(g,n,i)}),error:o=>console.error("SSE error:",o),complete:()=>{this.streamingTextMessage=null,this.sessionTab.reloadSession(this.sessionId)}}),this.userInput=""})}processPart(e,A,i){if(A.text){let o=A.text;if(this.streamingTextMessage){if(o==this.streamingTextMessage.text){this.storeEvents(A,e,i),this.eventMessageIndexArray[i]=o,this.streamingTextMessage=null;return}this.streamingTextMessage.text+=o}else if(this.streamingTextMessage={role:"bot",text:o},this.messages.push(this.streamingTextMessage),!this.useSse){this.storeEvents(A,e,i),this.eventMessageIndexArray[i]=o,this.streamingTextMessage=null;return}}else this.storeEvents(A,e,i),this.storeMessage(A,e,i)}getUserMessageParts(){return qe(this,null,function*(){let e=[{text:`${this.userInput}`}];if(this.selectedFiles.length>0)for(let A of this.selectedFiles)e.push({inline_data:{data:yield this.readFileAsBytes(A.file),mime_type:A.file.type}});return e})}readFileAsBytes(e){return new Promise((A,i)=>{let o=new FileReader;o.onload=g=>{let n=g.target.result.split(",")[1];A(n)},o.onerror=i,o.readAsDataURL(e)})}updateRedirectUri(e,A){try{let i=new URL(e);return i.searchParams.set("redirect_uri",A),i.toString()}catch(i){return console.warn("Failed to update redirect URI: ",i),e}}storeMessage(e,A,i){if(A.long_running_tool_ids&&A.long_running_tool_ids.length>0){this.getAsyncFunctionsFromParts(A.long_running_tool_ids,A.content.parts);let o=this.longRunningEvents[0];if(o.args.auth_config&&o.args.auth_config.exchanged_auth_credential&&o.args.auth_config.exchanged_auth_credential.oauth2){let g=o.args.auth_config.exchanged_auth_credential.oauth2.auth_uri,n=this.updateRedirectUri(g,this.redirectUri);this.openOAuthPopup(n).then(s=>{this.functionCallEventId=A.id,this.sendOAuthResponse(o,s,this.redirectUri)}).catch(s=>{console.error("OAuth Error:",s)})}else this.functionCallEventId=A.id}if(e.text)this.messages.push({role:A.author==="user"?"user":"bot",text:e.text}),this.eventMessageIndexArray[i]=e.text;else if(e.functionCall)this.messages.push({role:A.author==="user"?"user":"bot",functionCall:e.functionCall}),this.eventMessageIndexArray[i]=e.functionCall;else if(e.functionResponse){if(this.messages.push({role:A.author==="user"?"user":"bot",functionResponse:e.functionResponse}),A.actions&&A.actions.artifact_delta)for(let o in A.actions.artifact_delta)A.actions.artifact_delta.hasOwnProperty(o)&&this.renderArtifact(o,A.actions.artifact_delta[o]);this.eventMessageIndexArray[i]=e.functionResponse}else if(e.executableCode)this.messages.push({role:A.author==="user"?"user":"bot",executableCode:e.executableCode}),this.eventMessageIndexArray[i]=e.executableCode;else if(e.codeExecutionResult&&(this.messages.push({role:A.author==="user"?"user":"bot",codeExecutionResult:e.codeExecutionResult}),this.eventMessageIndexArray[i]=e.codeExecutionResult,A.actions&&A.actions.artifact_delta))for(let o in A.actions.artifact_delta)A.actions.artifact_delta.hasOwnProperty(o)&&this.renderArtifact(o,A.actions.artifact_delta[o])}renderArtifact(e,A){this.messages.push({role:"bot",inline_data:{data:"",mime_type:"image/png"}});let i=this.messages.length-1;this.artifactService.getArtifactVersion(this.userId,this.appName,this.sessionId,e,A).subscribe(o=>{let g=o.inlineData.mimeType,n=aq(o.inlineData.data),s=`data:${g};base64,${n}`;this.messages[i]={role:"bot",inline_data:{data:s,mime_type:g}},this.artifacts=[...this.artifacts,{id:e,data:s,mimeType:g,versionId:A}]})}storeEvents(e,A,i){let o=A.content.role+":";e.text?o+=i+e.text:e.functionCall?o+="functionCall:"+i+":"+e.functionCall.name:e.functionResponse?o+="functionResponse:"+i+":"+e.functionResponse.name:e.executableCode?o+="executableCode:"+i+":"+e.executableCode.code.slice(0,10):e.codeExecutionResult&&(o+="codeExecutionResult:"+i+":"+e.codeExecutionResult.outcome),this.eventData.set(o,A),this.eventData=new Map(this.eventData)}sendOAuthResponse(e,A,i){this.longRunningEvents.pop();let o={app_name:this.appName,user_id:this.userId,session_id:this.sessionId,new_message:{role:"user",parts:[]}};var g=e.args.auth_config;g.exchanged_auth_credential.oauth2.auth_response_uri=A,g.exchanged_auth_credential.oauth2.redirect_uri=i,o.function_call_event_id=this.functionCallEventId,o.new_message.parts.push({function_response:{id:e.id,name:e.name,response:g}}),this.agentService.run(o).subscribe(n=>{let s=this.eventMessageIndexArray.length-1;for(let r of n)if(r.content)for(let I of r.content.parts)s+=1,this.processPart(r,I,s)})}openDialog(){this.dialog.open(ma,{width:"600px",data:{event:this.longRunningEvents[0],app_name:this.appName,user_id:this.userId,session_id:this.sessionId,function_call_event_id:this.functionCallEventId}}).afterClosed().subscribe(A=>{A&&(this.longRunningEvents=A.events,this.messages.push({role:"bot",text:A.text}))})}clickEvent(e){let A=Array.from(this.eventData.entries())[e-this.userMessagesLength(e)],[i,o]=A;this.sidenav.open(),this.showSidePanel=!0,this.selectedEvent=o,this.selectedEventIndex=this.getIndexOfKeyInMap(i),this.eventService.getEventTrace(this.selectedEvent.id).subscribe(g=>{this.llmRequest=JSON.parse(g[this.llmRequestKey]),this.llmResponse=JSON.parse(g[this.llmResponseKey])}),this.eventService.getEvent(this.userId,this.appName,this.sessionId,this.selectedEvent.id).subscribe(g=>qe(this,null,function*(){if(!g.dot_src){this.renderedEventGraph=void 0;return}let n=g.dot_src,r=(yield pD()).renderString(n,{format:"svg",engine:"dot"});this.renderedEventGraph=this.sanitizer.bypassSecurityTrustHtml(r)}))}userMessagesLength(e){return this.messages.slice(0,e).filter(A=>A.role=="user").length}ngOnDestroy(){this.webSocketService.closeConnection()}toggleAudioRecording(){this.isAudioRecording?this.stopAudioRecording():this.startAudioRecording(),this.isAudioRecording=!this.isAudioRecording}startAudioRecording(){let e=window.location.protocol==="https:"?"wss":"ws";this.webSocketService.connect(`${e}://${ot.getWSServerUrl()}/run_live?app_name=${this.appName}&user_id=${this.userId}&session_id=${this.sessionId}`),this.audioService.startRecording(),this.messages.push({role:"user",text:"Speaking..."}),this.messages.push({role:"bot",text:"Speaking..."})}stopAudioRecording(){this.audioService.stopRecording(),this.webSocketService.closeConnection()}toggleVideoRecording(){this.isVideoRecording?this.stopVideoRecording():this.startVideoRecording(),this.isVideoRecording=!this.isVideoRecording}startVideoRecording(){let e=window.location.protocol==="https:"?"wss":"ws";this.webSocketService.connect(`${e}://${ot.getWSServerUrl()}/run_live?app_name=${this.appName}&user_id=${this.userId}&session_id=${this.sessionId}`),this.videoService.startRecording(this.videoContainer),this.audioService.startRecording(),this.messages.push({role:"user",text:"Speaking..."})}stopVideoRecording(){this.audioService.stopRecording(),this.videoService.stopRecording(this.videoContainer),this.webSocketService.closeConnection()}getAsyncFunctionsFromParts(e,A){for(let i of A)i.functionCall&&e.includes(i.functionCall.id)&&this.longRunningEvents.push(i.functionCall)}openOAuthPopup(e){return new Promise((A,i)=>{if(!window.open(e,"oauthPopup","width=600,height=700")){i("Popup blocked!");return}window.addEventListener("message",g=>{if(g.origin!==window.location.origin)return;let{authResponseUrl:n}=g.data;n?A(n):i("OAuth failed")},{once:!0})})}toggleSidePanel(){this.showSidePanel=!this.showSidePanel}updateWithSelectedSession(e){if(!e||!e.id||!e.events||!e.state){console.log("Session is not valid");return}this.sessionId=e.id,this.currentSessionState=e.state,this.eventData.clear(),this.eventMessageIndexArray=[],this.messages=[],this.artifacts=[];let A=0;e.events.forEach(i=>{i.content.parts.forEach(o=>{this.storeMessage(o,i,A),A+=1,i.author&&i.author!=="user"&&this.storeEvents(o,i,A)})})}updateSessionState(e){this.currentSessionState=e.state}onNewSessionClick(){this.createSession(),this.eventData.clear(),this.eventMessageIndexArray=[],this.messages=[],this.artifacts=[]}onFileSelect(e){let A=e.target;if(A.files)for(let i=0;i{this.llmRequest=JSON.parse(A[this.llmRequestKey]),this.llmResponse=JSON.parse(A[this.llmResponseKey])}),this.eventService.getEvent(this.userId,this.appName,this.sessionId,this.selectedEvent.id).subscribe(A=>qe(this,null,function*(){if(!A.dot_src){this.renderedEventGraph=void 0;return}let i=A.dot_src,g=(yield pD()).renderString(i,{format:"svg",engine:"dot"});this.renderedEventGraph=this.sanitizer.bypassSecurityTrustHtml(g)}))}deleteSession(e){let A={title:"Confirm delete",message:`Are you sure you want to delete this session ${this.sessionId}?`,confirmButtonText:"Delete",cancelButtonText:"Cancel"};this.dialog.open(fa,{width:"600px",data:A}).afterClosed().subscribe(o=>{o&&this.sessionService.deleteSession(this.userId,this.appName,e).subscribe(g=>{let n=this.sessionTab.refreshSession();n?this.sessionTab.getSession(n.id):window.location.reload()})})}syncSelectedAppFromUrl(){this.router.events.pipe(RA(e=>e instanceof Ot),oA(()=>this.activatedRoute.snapshot.queryParams)).subscribe(e=>{let A=e.app;A&&this.selectedAppControl.setValue(A)})}updateSelectedAppUrl(){this.selectedAppControl.valueChanges.pipe(Bi(),RA(Boolean)).subscribe(e=>{this.selectApp(e);let A=this.activatedRoute.snapshot.queryParams.app;e!==A&&this.router.navigate([],{queryParams:{app:e},queryParamsHandling:"merge"})})}handlePageEvent(e){if(e.pageIndex>=0){let A=this.getKeyAtIndexInMap(e.pageIndex);A&&this.selectEvent(A)}}closeSelectedEvent(){this.selectedEvent=void 0,this.selectedEventIndex=void 0}getIndexOfKeyInMap(e){let A=0,i=(g,n)=>0,o=Array.from(this.eventData.keys()).sort(i);for(let g of o){if(g===e)return A;A++}}getKeyAtIndexInMap(e){let A=(o,g)=>0,i=Array.from(this.eventData.keys()).sort(A);if(e>=0&&e0),f(),F("ngIf",i.appName!=""),f(),F("ngIf",i.appName!=""))},dependencies:[Yt,Rt,Jt,bh,io,oo,yi,YF,Ir,Eo,Mk,kg,bt,hE,gk,ok,fD,vF,OE,WD,zD,em,tm,$F,ir,hg,Db,zE,eu,kn,Fn,Rn,Fa,ba,EI],styles:[".drawer-container[_ngcontent-%COMP%]{height:100%;background-color:#131314}.generated-image[_ngcontent-%COMP%]{max-width:33%;border-radius:8px}.chat-container[_ngcontent-%COMP%]{width:100%;height:100%;max-width:1200px;margin:auto}.event-container[_ngcontent-%COMP%]{color:#fff}.drawer-header[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:flex-start;align-items:center}.drawer-header[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{width:36px;height:36px;color:#bdc1c6;cursor:pointer;display:flex;align-items:center;justify-content:center}.chat-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:500px;overflow:hidden;height:95%;box-shadow:none;background-color:#131314}.chat-messages[_ngcontent-%COMP%]{flex-grow:1;overflow-y:auto;padding:20px;margin-top:16px}.message-card[_ngcontent-%COMP%]{padding:5px 20px;margin:5px;border-radius:20px;max-width:80%;font-size:14px;font-weight:400}.user-message[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:center}.user-message[_ngcontent-%COMP%] .message-card[_ngcontent-%COMP%]{background-color:#004a77;align-self:flex-end;color:#fff;box-shadow:none}.bot-message[_ngcontent-%COMP%]{display:flex;align-items:center}.bot-message[_ngcontent-%COMP%] .message-card[_ngcontent-%COMP%]{background-color:#303030;align-self:flex-start;color:#fff;box-shadow:none}.navigation-button-sidepanel[_ngcontent-%COMP%]{margin-left:auto;margin-right:20px}.chat-input[_ngcontent-%COMP%]{display:flex;padding:10px;width:80%;margin:0 auto}.input-field[_ngcontent-%COMP%]{flex-grow:1}.input-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{color:#fff;border:none;padding:10px}.input-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::placeholder{color:#8e918f}.input-field[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:#fff;background-color:#333537}.chat-input-actions[_ngcontent-%COMP%]{margin-top:10px;display:flex;justify-content:space-between}.fab-button[_ngcontent-%COMP%]{position:fixed;bottom:200px;right:100px;z-index:1000}.sidepanel-toggle[_ngcontent-%COMP%]{position:relative;top:100px;z-index:1000}.sidenav[_ngcontent-%COMP%]{background-color:#1b1b1b;color:#fff;border-radius:0}.tabs-container[_ngcontent-%COMP%]{margin-top:20px;padding-left:10px;padding-right:10px}.tab-label[_ngcontent-%COMP%]{font-size:14px}.file-preview[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:5px;margin-top:2px;margin-bottom:8px}.file-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:5px;background:#eee;padding:5px;border-radius:4px}.image-preview[_ngcontent-%COMP%]{width:40px;height:40px;object-fit:cover;border-radius:4px}.image-preview-chat[_ngcontent-%COMP%]{max-width:90%;max-height:70vh;width:auto;height:auto;border-radius:8px;cursor:pointer;transition:transform .2s ease-in-out}button[_ngcontent-%COMP%]{margin-left:20px;margin-right:20px}.app-select[_ngcontent-%COMP%]{width:180px}.empty-state-container[_ngcontent-%COMP%]{color:#eee;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Open Sans,sans-serif;font-weight:400;letter-spacing:normal;line-height:24px;font-size:18px}.empty-state-container[_ngcontent-%COMP%] pre.warning[_ngcontent-%COMP%]{color:#ffc185}.empty-state-container[_ngcontent-%COMP%] pre.error[_ngcontent-%COMP%]{color:#ff4545}.function-event-button[_ngcontent-%COMP%]{background-color:#fff}[_nghost-%COMP%] .mat-mdc-text-field-wrapper{border:1px solid #8e918f}[_nghost-%COMP%] .input-field .mat-mdc-text-field-wrapper{border:1px solid #8e918f;border-radius:16px}[_nghost-%COMP%] .mdc-notched-outline__leading, [_nghost-%COMP%] .mdc-notched-outline__notch, [_nghost-%COMP%] .mdc-notched-outline__trailing{border:none}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{padding:0 10px 0 40px}[_nghost-%COMP%] .segment-key{color:#d3d3d3!important}[_nghost-%COMP%] .mat-mdc-mini-fab{background-color:#fff}[_nghost-%COMP%] .mat-mdc-mini-fab mat-icon{color:#000}[_nghost-%COMP%] .mat-drawer-inner-container{width:500px}.mat-mdc-select-placeholder[_ngcontent-%COMP%]{margin-left:20px}.new-session-button[_ngcontent-%COMP%]{margin-top:0;margin-left:50px;width:130px;height:28px;font-size:14px}.app-select-container[_ngcontent-%COMP%]{background-color:#212123;margin-left:20px;height:30px;display:flex;justify-content:space-between;padding-left:20px;padding-right:20px;border-radius:10px;padding-top:5px;margin-top:-2px}.drawer-header[_ngcontent-%COMP%]{--mat-select-placeholder-text-color: #8ab4f8}.drawer-header[_ngcontent-%COMP%]{--mat-select-enabled-trigger-text-color: #8ab4f8}.drawer-header[_ngcontent-%COMP%]{--mat-select-enabled-arrow-color: #8ab4f8}.event-paginator[_ngcontent-%COMP%]{background-color:inherit;display:flex;justify-content:center}[_nghost-%COMP%] .mat-mdc-paginator-page-size{display:none!important}.details-panel-container[_ngcontent-%COMP%]{position:absolute;height:98%;left:0;right:0;bottom:0;background:#242424;display:inline-block;justify-content:center;align-items:center;z-index:10}.details-content[_ngcontent-%COMP%]{color:#fff;font-size:14px}.event-paginator[_ngcontent-%COMP%]{margin-top:-8px;margin-right:160px}.adk-checkbox[_ngcontent-%COMP%]{position:fixed;bottom:0;left:0;right:0;margin-bottom:20px;margin-left:20px}.drawer-header[_ngcontent-%COMP%]{--mdc-filled-button-container-color: #89b4f8}.drawer-header[_ngcontent-%COMP%]{--mdc-filled-button-label-text-color: black}.chat-toolbar[_ngcontent-%COMP%]{position:sticky;top:0;height:48px;background:#1b1b1b;display:flex;justify-content:space-between;align-items:center;z-index:10}.toolbar-session-text[_ngcontent-%COMP%]{color:#fdfdfd;font-family:Roboto;font-size:12px;font-style:normal;font-weight:500;line-height:12px;letter-spacing:.8px;text-transform:uppercase;margin-left:20px;padding-top:4px}.toolbar-session-id[_ngcontent-%COMP%]{color:#9aa0a6;font-family:monospace;font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:.25px;margin-left:5px}.toolbar-actions[_ngcontent-%COMP%]{display:flex}.toolbar-new-sesison[_ngcontent-%COMP%]{font-size:14px;margin-right:16px;color:#9aa0a6;cursor:pointer;display:flex;align-items:center}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mat-switch-label-text-size: 14px}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mat-switch-label-text-color: #9aa0a6}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-selected-track-color: #8ab4f9}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-selected-focus-track-color: #8ab4f9}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-selected-hover-track-color: #8ab4f9}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-selected-handle-color: #1b73e8}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-selected-focus-handle-color: #1b73e8}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-selected-hover-handle-color: #1b73e8}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-track-height: 24px}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-track-width: 46px}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mat-switch-track-outline-color: #1b73e8}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mat-switch-with-icon-handle-size: 20px}.image-container[_ngcontent-%COMP%]{position:relative;display:inline-block;border-radius:12px;overflow:hidden}.image-preview[_ngcontent-%COMP%]{display:block;width:100%;height:auto;border-radius:12px;width:80px;height:80px}.delete-button[_ngcontent-%COMP%]{position:absolute;top:1px;right:1px;background-color:#000000b3;border:none;border-radius:50%;padding:8px;cursor:pointer;color:#fff;display:flex;align-items:center;justify-content:center;margin-right:0;scale:.7}.delete-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px}.file-container[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;gap:8px;height:80px;background-color:#1e1e1e;border-radius:12px}.file-info[_ngcontent-%COMP%]{margin-right:60px;padding-top:20px;padding-left:16px}"]})};var lr=class t{title="agent_framework_web";userId="";appName="";sessionId="";constructor(){}static \u0275fac=function(A){return new(A||t)};static \u0275cmp=O({type:t,selectors:[["app-root"]],standalone:!1,decls:1,vars:0,template:function(A,i){A&1&&W(0,"app-chat")},dependencies:[Sa],encapsulation:2})};var Bq=[{path:"dev-ui",component:lr},{path:"",redirectTo:"dev-ui",pathMatch:"full"}],jE=class t{static \u0275fac=function(A){return new(A||t)};static \u0275mod=V({type:t});static \u0275inj=q({imports:[VQ.forRoot(Bq),VQ]})};function pb(t){return new U(3e3,!1)}function Qq(){return new U(3100,!1)}function Eq(){return new U(3101,!1)}function cq(t){return new U(3001,!1)}function lq(t){return new U(3003,!1)}function dq(t){return new U(3004,!1)}function Mb(t,e){return new U(3005,!1)}function Rb(){return new U(3006,!1)}function kb(){return new U(3007,!1)}function Fb(t,e){return new U(3008,!1)}function bb(t){return new U(3002,!1)}function Sb(t,e,A,i,o){return new U(3010,!1)}function Nb(){return new U(3011,!1)}function Gb(){return new U(3012,!1)}function vb(){return new U(3200,!1)}function Lb(){return new U(3202,!1)}function Kb(){return new U(3013,!1)}function Ub(t){return new U(3014,!1)}function _b(t){return new U(3015,!1)}function xb(t){return new U(3016,!1)}function Yb(t,e){return new U(3404,!1)}function hq(t){return new U(3502,!1)}function Jb(t){return new U(3503,!1)}function Hb(){return new U(3300,!1)}function Tb(t){return new U(3504,!1)}function Ob(t){return new U(3301,!1)}function Pb(t,e){return new U(3302,!1)}function Zb(t){return new U(3303,!1)}function qb(t,e){return new U(3400,!1)}function Vb(t){return new U(3401,!1)}function Wb(t){return new U(3402,!1)}function zb(t,e){return new U(3505,!1)}function Zo(t){switch(t.length){case 0:return new Bo;case 1:return t[0];default:return new pn(t)}}function hm(t,e,A=new Map,i=new Map){let o=[],g=[],n=-1,s=null;if(e.forEach(r=>{let I=r.get("offset"),B=I==n,c=B&&s||new Map;r.forEach((D,h)=>{let p=h,y=D;if(h!=="offset")switch(p=t.normalizePropertyName(p,o),y){case tr:y=A.get(h);break;case ii:y=i.get(h);break;default:y=t.normalizeStyleValue(h,p,y,o);break}c.set(p,y)}),B||g.push(c),s=c,n=I}),o.length)throw hq(o);return g}function XE(t,e,A,i){switch(e){case"start":t.onStart(()=>i(A&&cm(A,"start",t)));break;case"done":t.onDone(()=>i(A&&cm(A,"done",t)));break;case"destroy":t.onDestroy(()=>i(A&&cm(A,"destroy",t)));break}}function cm(t,e,A){let i=A.totalTime,o=!!A.disabled,g=$E(t.element,t.triggerName,t.fromState,t.toState,e||t.phaseName,i??t.totalTime,o),n=t._data;return n!=null&&(g._data=n),g}function $E(t,e,A,i,o="",g=0,n){return{element:t,triggerName:e,fromState:A,toState:i,phaseName:o,totalTime:g,disabled:!!n}}function Nt(t,e,A){let i=t.get(e);return i||t.set(e,i=A),i}function um(t){let e=t.indexOf(":"),A=t.substring(1,e),i=t.slice(e+1);return[A,i]}var uq=typeof document>"u"?null:document.documentElement;function Ac(t){let e=t.parentNode||t.host||null;return e===uq?null:e}function Dq(t){return t.substring(1,6)=="ebkit"}var Nn=null,yb=!1;function jb(t){Nn||(Nn=mq()||{},yb=Nn.style?"WebkitAppearance"in Nn.style:!1);let e=!0;return Nn.style&&!Dq(t)&&(e=t in Nn.style,!e&&yb&&(e="Webkit"+t.charAt(0).toUpperCase()+t.slice(1)in Nn.style)),e}function mq(){return typeof document<"u"?document.body:null}function Dm(t,e){for(;e;){if(e===t)return!0;e=Ac(e)}return!1}function mm(t,e,A){if(A)return Array.from(t.querySelectorAll(e));let i=t.querySelector(e);return i?[i]:[]}var fq=1e3,fm="{{",wq="}}",wm="ng-enter",ec="ng-leave",Na="ng-trigger",Ga=".ng-trigger",pm="ng-animating",tc=".ng-animating";function mo(t){if(typeof t=="number")return t;let e=t.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:lm(parseFloat(e[1]),e[2])}function lm(t,e){switch(e){case"s":return t*fq;default:return t}}function va(t,e,A){return t.hasOwnProperty("duration")?t:pq(t,e,A)}function pq(t,e,A){let i=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i,o,g=0,n="";if(typeof t=="string"){let s=t.match(i);if(s===null)return e.push(pb(t)),{duration:0,delay:0,easing:""};o=lm(parseFloat(s[1]),s[2]);let r=s[3];r!=null&&(g=lm(parseFloat(r),s[4]));let I=s[5];I&&(n=I)}else o=t;if(!A){let s=!1,r=e.length;o<0&&(e.push(Qq()),s=!0),g<0&&(e.push(Eq()),s=!0),s&&e.splice(r,0,pb(t))}return{duration:o,delay:g,easing:n}}function Xb(t){return t.length?t[0]instanceof Map?t:t.map(e=>new Map(Object.entries(e))):[]}function vi(t,e,A){e.forEach((i,o)=>{let g=ic(o);A&&!A.has(o)&&A.set(o,t.style[g]),t.style[g]=i})}function bg(t,e){e.forEach((A,i)=>{let o=ic(i);t.style[o]=""})}function dr(t){return Array.isArray(t)?t.length==1?t[0]:dk(t):t}function $b(t,e,A){let i=e.params||{},o=ym(t);o.length&&o.forEach(g=>{i.hasOwnProperty(g)||A.push(cq(g))})}var dm=new RegExp(`${fm}\\s*(.+?)\\s*${wq}`,"g");function ym(t){let e=[];if(typeof t=="string"){let A;for(;A=dm.exec(t);)e.push(A[1]);dm.lastIndex=0}return e}function hr(t,e,A){let i=`${t}`,o=i.replace(dm,(g,n)=>{let s=e[n];return s==null&&(A.push(lq(n)),s=""),s.toString()});return o==i?t:o}var yq=/-+([a-z0-9])/g;function ic(t){return t.replace(yq,(...e)=>e[1].toUpperCase())}function AS(t,e){return t===0||e===0}function eS(t,e,A){if(A.size&&e.length){let i=e[0],o=[];if(A.forEach((g,n)=>{i.has(n)||o.push(n),i.set(n,g)}),o.length)for(let g=1;gn.set(s,oc(t,s)))}}return e}function Gt(t,e,A){switch(e.type){case LA.Trigger:return t.visitTrigger(e,A);case LA.State:return t.visitState(e,A);case LA.Transition:return t.visitTransition(e,A);case LA.Sequence:return t.visitSequence(e,A);case LA.Group:return t.visitGroup(e,A);case LA.Animate:return t.visitAnimate(e,A);case LA.Keyframes:return t.visitKeyframes(e,A);case LA.Style:return t.visitStyle(e,A);case LA.Reference:return t.visitReference(e,A);case LA.AnimateChild:return t.visitAnimateChild(e,A);case LA.AnimateRef:return t.visitAnimateRef(e,A);case LA.Query:return t.visitQuery(e,A);case LA.Stagger:return t.visitStagger(e,A);default:throw dq(e.type)}}function oc(t,e){return window.getComputedStyle(t)[e]}var Hm=(()=>{class t{validateStyleProperty(A){return jb(A)}containsElement(A,i){return Dm(A,i)}getParentElement(A){return Ac(A)}query(A,i,o){return mm(A,i,o)}computeStyle(A,i,o){return o||""}animate(A,i,o,g,n,s=[],r){return new Bo(o,g)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=N({token:t,factory:t.\u0275fac})}return t})(),vn=class{static NOOP=new Hm},Ln=class{};var Mq=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"]),Ic=class extends Ln{normalizePropertyName(e,A){return ic(e)}normalizeStyleValue(e,A,i,o){let g="",n=i.toString().trim();if(Mq.has(A)&&i!==0&&i!=="0")if(typeof i=="number")g="px";else{let s=i.match(/^[+-]?[\d\.]+([a-z]*)$/);s&&s[1].length==0&&o.push(Mb(e,i))}return n+g}};var ac="*";function Rq(t,e){let A=[];return typeof t=="string"?t.split(/\s*,\s*/).forEach(i=>kq(i,A,e)):A.push(t),A}function kq(t,e,A){if(t[0]==":"){let r=Fq(t,A);if(typeof r=="function"){e.push(r);return}t=r}let i=t.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(i==null||i.length<4)return A.push(_b(t)),e;let o=i[1],g=i[2],n=i[3];e.push(tS(o,n));let s=o==ac&&n==ac;g[0]=="<"&&!s&&e.push(tS(n,o))}function Fq(t,e){switch(t){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(A,i)=>parseFloat(i)>parseFloat(A);case":decrement":return(A,i)=>parseFloat(i) *"}}var gc=new Set(["true","1"]),nc=new Set(["false","0"]);function tS(t,e){let A=gc.has(t)||nc.has(t),i=gc.has(e)||nc.has(e);return(o,g)=>{let n=t==ac||t==o,s=e==ac||e==g;return!n&&A&&typeof o=="boolean"&&(n=o?gc.has(t):nc.has(t)),!s&&i&&typeof g=="boolean"&&(s=g?gc.has(e):nc.has(e)),n&&s}}var BS=":self",bq=new RegExp(`s*${BS}s*,?`,"g");function QS(t,e,A,i){return new Sm(t).build(e,A,i)}var iS="",Sm=class{_driver;constructor(e){this._driver=e}build(e,A,i){let o=new Nm(A);return this._resetContextStyleTimingState(o),Gt(this,dr(e),o)}_resetContextStyleTimingState(e){e.currentQuerySelector=iS,e.collectedStyles=new Map,e.collectedStyles.set(iS,new Map),e.currentTime=0}visitTrigger(e,A){let i=A.queryCount=0,o=A.depCount=0,g=[],n=[];return e.name.charAt(0)=="@"&&A.errors.push(Rb()),e.definitions.forEach(s=>{if(this._resetContextStyleTimingState(A),s.type==LA.State){let r=s,I=r.name;I.toString().split(/\s*,\s*/).forEach(B=>{r.name=B,g.push(this.visitState(r,A))}),r.name=I}else if(s.type==LA.Transition){let r=this.visitTransition(s,A);i+=r.queryCount,o+=r.depCount,n.push(r)}else A.errors.push(kb())}),{type:LA.Trigger,name:e.name,states:g,transitions:n,queryCount:i,depCount:o,options:null}}visitState(e,A){let i=this.visitStyle(e.styles,A),o=e.options&&e.options.params||null;if(i.containsDynamicStyles){let g=new Set,n=o||{};i.styles.forEach(s=>{s instanceof Map&&s.forEach(r=>{ym(r).forEach(I=>{n.hasOwnProperty(I)||g.add(I)})})}),g.size&&A.errors.push(Fb(e.name,[...g.values()]))}return{type:LA.State,name:e.name,style:i,options:o?{params:o}:null}}visitTransition(e,A){A.queryCount=0,A.depCount=0;let i=Gt(this,dr(e.animation),A),o=Rq(e.expr,A.errors);return{type:LA.Transition,matchers:o,animation:i,queryCount:A.queryCount,depCount:A.depCount,options:Gn(e.options)}}visitSequence(e,A){return{type:LA.Sequence,steps:e.steps.map(i=>Gt(this,i,A)),options:Gn(e.options)}}visitGroup(e,A){let i=A.currentTime,o=0,g=e.steps.map(n=>{A.currentTime=i;let s=Gt(this,n,A);return o=Math.max(o,A.currentTime),s});return A.currentTime=o,{type:LA.Group,steps:g,options:Gn(e.options)}}visitAnimate(e,A){let i=vq(e.timings,A.errors);A.currentAnimateTimings=i;let o,g=e.styles?e.styles:Ge({});if(g.type==LA.Keyframes)o=this.visitKeyframes(g,A);else{let n=e.styles,s=!1;if(!n){s=!0;let I={};i.easing&&(I.easing=i.easing),n=Ge(I)}A.currentTime+=i.duration+i.delay;let r=this.visitStyle(n,A);r.isEmptyStep=s,o=r}return A.currentAnimateTimings=null,{type:LA.Animate,timings:i,style:o,options:null}}visitStyle(e,A){let i=this._makeStyleAst(e,A);return this._validateStyleAst(i,A),i}_makeStyleAst(e,A){let i=[],o=Array.isArray(e.styles)?e.styles:[e.styles];for(let s of o)typeof s=="string"?s===ii?i.push(s):A.errors.push(bb(s)):i.push(new Map(Object.entries(s)));let g=!1,n=null;return i.forEach(s=>{if(s instanceof Map&&(s.has("easing")&&(n=s.get("easing"),s.delete("easing")),!g)){for(let r of s.values())if(r.toString().indexOf(fm)>=0){g=!0;break}}}),{type:LA.Style,styles:i,easing:n,offset:e.offset,containsDynamicStyles:g,options:null}}_validateStyleAst(e,A){let i=A.currentAnimateTimings,o=A.currentTime,g=A.currentTime;i&&g>0&&(g-=i.duration+i.delay),e.styles.forEach(n=>{typeof n!="string"&&n.forEach((s,r)=>{let I=A.collectedStyles.get(A.currentQuerySelector),B=I.get(r),c=!0;B&&(g!=o&&g>=B.startTime&&o<=B.endTime&&(A.errors.push(Sb(r,B.startTime,B.endTime,g,o)),c=!1),g=B.startTime),c&&I.set(r,{startTime:g,endTime:o}),A.options&&$b(s,A.options,A.errors)})})}visitKeyframes(e,A){let i={type:LA.Keyframes,styles:[],options:null};if(!A.currentAnimateTimings)return A.errors.push(Nb()),i;let o=1,g=0,n=[],s=!1,r=!1,I=0,B=e.steps.map(P=>{let mA=this._makeStyleAst(P,A),_A=mA.offset!=null?mA.offset:Gq(mA.styles),fA=0;return _A!=null&&(g++,fA=mA.offset=_A),r=r||fA<0||fA>1,s=s||fA0&&g{let _A=D>0?mA==h?1:D*mA:n[mA],fA=_A*L;A.currentTime=p+y.delay+fA,y.duration=fA,this._validateStyleAst(P,A),P.offset=_A,i.styles.push(P)}),i}visitReference(e,A){return{type:LA.Reference,animation:Gt(this,dr(e.animation),A),options:Gn(e.options)}}visitAnimateChild(e,A){return A.depCount++,{type:LA.AnimateChild,options:Gn(e.options)}}visitAnimateRef(e,A){return{type:LA.AnimateRef,animation:this.visitReference(e.animation,A),options:Gn(e.options)}}visitQuery(e,A){let i=A.currentQuerySelector,o=e.options||{};A.queryCount++,A.currentQuery=e;let[g,n]=Sq(e.selector);A.currentQuerySelector=i.length?i+" "+g:g,Nt(A.collectedStyles,A.currentQuerySelector,new Map);let s=Gt(this,dr(e.animation),A);return A.currentQuery=null,A.currentQuerySelector=i,{type:LA.Query,selector:g,limit:o.limit||0,optional:!!o.optional,includeSelf:n,animation:s,originalSelector:e.selector,options:Gn(e.options)}}visitStagger(e,A){A.currentQuery||A.errors.push(Kb());let i=e.timings==="full"?{duration:0,delay:0,easing:"full"}:va(e.timings,A.errors,!0);return{type:LA.Stagger,animation:Gt(this,dr(e.animation),A),timings:i,options:null}}};function Sq(t){let e=!!t.split(/\s*,\s*/).find(A=>A==BS);return e&&(t=t.replace(bq,"")),t=t.replace(/@\*/g,Ga).replace(/@\w+/g,A=>Ga+"-"+A.slice(1)).replace(/:animating/g,tc),[t,e]}function Nq(t){return t?R({},t):null}var Nm=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 Gq(t){if(typeof t=="string")return null;let e=null;if(Array.isArray(t))t.forEach(A=>{if(A instanceof Map&&A.has("offset")){let i=A;e=parseFloat(i.get("offset")),i.delete("offset")}});else if(t instanceof Map&&t.has("offset")){let A=t;e=parseFloat(A.get("offset")),A.delete("offset")}return e}function vq(t,e){if(t.hasOwnProperty("duration"))return t;if(typeof t=="number"){let g=va(t,e).duration;return Mm(g,0,"")}let A=t;if(A.split(/\s+/).some(g=>g.charAt(0)=="{"&&g.charAt(1)=="{")){let g=Mm(0,0,"");return g.dynamic=!0,g.strValue=A,g}let o=va(A,e);return Mm(o.duration,o.delay,o.easing)}function Gn(t){return t?(t=R({},t),t.params&&(t.params=Nq(t.params))):t={},t}function Mm(t,e,A){return{duration:t,delay:e,easing:A}}function Tm(t,e,A,i,o,g,n=null,s=!1){return{type:1,element:t,keyframes:e,preStyleProps:A,postStyleProps:i,duration:o,delay:g,totalTime:o+g,easing:n,subTimeline:s}}var Ka=class{_map=new Map;get(e){return this._map.get(e)||[]}append(e,A){let i=this._map.get(e);i||this._map.set(e,i=[]),i.push(...A)}has(e){return this._map.has(e)}clear(){this._map.clear()}},Lq=1,Kq=":enter",Uq=new RegExp(Kq,"g"),_q=":leave",xq=new RegExp(_q,"g");function ES(t,e,A,i,o,g=new Map,n=new Map,s,r,I=[]){return new Gm().buildKeyframes(t,e,A,i,o,g,n,s,r,I)}var Gm=class{buildKeyframes(e,A,i,o,g,n,s,r,I,B=[]){I=I||new Ka;let c=new vm(e,A,I,o,g,B,[]);c.options=r;let D=r.delay?mo(r.delay):0;c.currentTimeline.delayNextStep(D),c.currentTimeline.setStyles([n],null,c.errors,r),Gt(this,i,c);let h=c.timelines.filter(p=>p.containsAnimation());if(h.length&&s.size){let p;for(let y=h.length-1;y>=0;y--){let L=h[y];if(L.element===A){p=L;break}}p&&!p.allowOnlyTimelineStyles()&&p.setStyles([s],null,c.errors,r)}return h.length?h.map(p=>p.buildKeyframes()):[Tm(A,[],[],[],0,D,"",!1)]}visitTrigger(e,A){}visitState(e,A){}visitTransition(e,A){}visitAnimateChild(e,A){let i=A.subInstructions.get(A.element);if(i){let o=A.createSubContext(e.options),g=A.currentTimeline.currentTime,n=this._visitSubInstructions(i,o,o.options);g!=n&&A.transformIntoNewTimeline(n)}A.previousNode=e}visitAnimateRef(e,A){let i=A.createSubContext(e.options);i.transformIntoNewTimeline(),this._applyAnimationRefDelays([e.options,e.animation.options],A,i),this.visitReference(e.animation,i),A.transformIntoNewTimeline(i.currentTimeline.currentTime),A.previousNode=e}_applyAnimationRefDelays(e,A,i){for(let o of e){let g=o?.delay;if(g){let n=typeof g=="number"?g:mo(hr(g,o?.params??{},A.errors));i.delayNextStep(n)}}}_visitSubInstructions(e,A,i){let g=A.currentTimeline.currentTime,n=i.duration!=null?mo(i.duration):null,s=i.delay!=null?mo(i.delay):null;return n!==0&&e.forEach(r=>{let I=A.appendInstructionToTimeline(r,n,s);g=Math.max(g,I.duration+I.delay)}),g}visitReference(e,A){A.updateOptions(e.options,!0),Gt(this,e.animation,A),A.previousNode=e}visitSequence(e,A){let i=A.subContextCount,o=A,g=e.options;if(g&&(g.params||g.delay)&&(o=A.createSubContext(g),o.transformIntoNewTimeline(),g.delay!=null)){o.previousNode.type==LA.Style&&(o.currentTimeline.snapshotCurrentStyles(),o.previousNode=Cc);let n=mo(g.delay);o.delayNextStep(n)}e.steps.length&&(e.steps.forEach(n=>Gt(this,n,o)),o.currentTimeline.applyStylesToKeyframe(),o.subContextCount>i&&o.transformIntoNewTimeline()),A.previousNode=e}visitGroup(e,A){let i=[],o=A.currentTimeline.currentTime,g=e.options&&e.options.delay?mo(e.options.delay):0;e.steps.forEach(n=>{let s=A.createSubContext(e.options);g&&s.delayNextStep(g),Gt(this,n,s),o=Math.max(o,s.currentTimeline.currentTime),i.push(s.currentTimeline)}),i.forEach(n=>A.currentTimeline.mergeTimelineCollectedStyles(n)),A.transformIntoNewTimeline(o),A.previousNode=e}_visitTiming(e,A){if(e.dynamic){let i=e.strValue,o=A.params?hr(i,A.params,A.errors):i;return va(o,A.errors)}else return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,A){let i=A.currentAnimateTimings=this._visitTiming(e.timings,A),o=A.currentTimeline;i.delay&&(A.incrementTime(i.delay),o.snapshotCurrentStyles());let g=e.style;g.type==LA.Keyframes?this.visitKeyframes(g,A):(A.incrementTime(i.duration),this.visitStyle(g,A),o.applyStylesToKeyframe()),A.currentAnimateTimings=null,A.previousNode=e}visitStyle(e,A){let i=A.currentTimeline,o=A.currentAnimateTimings;!o&&i.hasCurrentStyleProperties()&&i.forwardFrame();let g=o&&o.easing||e.easing;e.isEmptyStep?i.applyEmptyStep(g):i.setStyles(e.styles,g,A.errors,A.options),A.previousNode=e}visitKeyframes(e,A){let i=A.currentAnimateTimings,o=A.currentTimeline.duration,g=i.duration,s=A.createSubContext().currentTimeline;s.easing=i.easing,e.styles.forEach(r=>{let I=r.offset||0;s.forwardTime(I*g),s.setStyles(r.styles,r.easing,A.errors,A.options),s.applyStylesToKeyframe()}),A.currentTimeline.mergeTimelineCollectedStyles(s),A.transformIntoNewTimeline(o+g),A.previousNode=e}visitQuery(e,A){let i=A.currentTimeline.currentTime,o=e.options||{},g=o.delay?mo(o.delay):0;g&&(A.previousNode.type===LA.Style||i==0&&A.currentTimeline.hasCurrentStyleProperties())&&(A.currentTimeline.snapshotCurrentStyles(),A.previousNode=Cc);let n=i,s=A.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!o.optional,A.errors);A.currentQueryTotal=s.length;let r=null;s.forEach((I,B)=>{A.currentQueryIndex=B;let c=A.createSubContext(e.options,I);g&&c.delayNextStep(g),I===A.element&&(r=c.currentTimeline),Gt(this,e.animation,c),c.currentTimeline.applyStylesToKeyframe();let D=c.currentTimeline.currentTime;n=Math.max(n,D)}),A.currentQueryIndex=0,A.currentQueryTotal=0,A.transformIntoNewTimeline(n),r&&(A.currentTimeline.mergeTimelineCollectedStyles(r),A.currentTimeline.snapshotCurrentStyles()),A.previousNode=e}visitStagger(e,A){let i=A.parentContext,o=A.currentTimeline,g=e.timings,n=Math.abs(g.duration),s=n*(A.currentQueryTotal-1),r=n*A.currentQueryIndex;switch(g.duration<0?"reverse":g.easing){case"reverse":r=s-r;break;case"full":r=i.currentStaggerTime;break}let B=A.currentTimeline;r&&B.delayNextStep(r);let c=B.currentTime;Gt(this,e.animation,A),A.previousNode=e,i.currentStaggerTime=o.currentTime-c+(o.startTime-i.currentTimeline.startTime)}},Cc={},vm=class t{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=Cc;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(e,A,i,o,g,n,s,r){this._driver=e,this.element=A,this.subInstructions=i,this._enterClassName=o,this._leaveClassName=g,this.errors=n,this.timelines=s,this.currentTimeline=r||new Bc(this._driver,A,0),s.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,A){if(!e)return;let i=e,o=this.options;i.duration!=null&&(o.duration=mo(i.duration)),i.delay!=null&&(o.delay=mo(i.delay));let g=i.params;if(g){let n=o.params;n||(n=this.options.params={}),Object.keys(g).forEach(s=>{(!A||!n.hasOwnProperty(s))&&(n[s]=hr(g[s],n,this.errors))})}}_copyOptions(){let e={};if(this.options){let A=this.options.params;if(A){let i=e.params={};Object.keys(A).forEach(o=>{i[o]=A[o]})}}return e}createSubContext(e=null,A,i){let o=A||this.element,g=new t(this._driver,o,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(o,i||0));return g.previousNode=this.previousNode,g.currentAnimateTimings=this.currentAnimateTimings,g.options=this._copyOptions(),g.updateOptions(e),g.currentQueryIndex=this.currentQueryIndex,g.currentQueryTotal=this.currentQueryTotal,g.parentContext=this,this.subContextCount++,g}transformIntoNewTimeline(e){return this.previousNode=Cc,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,A,i){let o={duration:A??e.duration,delay:this.currentTimeline.currentTime+(i??0)+e.delay,easing:""},g=new Lm(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,o,e.stretchStartingKeyframe);return this.timelines.push(g),o}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,A,i,o,g,n){let s=[];if(o&&s.push(this.element),e.length>0){e=e.replace(Uq,"."+this._enterClassName),e=e.replace(xq,"."+this._leaveClassName);let r=i!=1,I=this._driver.query(this.element,e,r);i!==0&&(I=i<0?I.slice(I.length+i,I.length):I.slice(0,i)),s.push(...I)}return!g&&s.length==0&&n.push(Ub(A)),s}},Bc=class t{_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,A,i,o){this._driver=e,this.element=A,this.startTime=i,this._elementTimelineStylesLookup=o,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(A),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(A,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 A=this._keyframes.size===1&&this._pendingStyles.size;this.duration||A?(this.forwardTime(this.currentTime+e),A&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,A){return this.applyStylesToKeyframe(),new t(this._driver,e,A||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+=Lq,this._loadKeyframe()}forwardTime(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,A){this._localTimelineStyles.set(e,A),this._globalTimelineStyles.set(e,A),this._styleSummary.set(e,{time:this.currentTime,value:A})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&this._previousKeyframe.set("easing",e);for(let[A,i]of this._globalTimelineStyles)this._backFill.set(A,i||ii),this._currentKeyframe.set(A,ii);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,A,i,o){A&&this._previousKeyframe.set("easing",A);let g=o&&o.params||{},n=Yq(e,this._globalTimelineStyles);for(let[s,r]of n){let I=hr(r,g,i);this._pendingStyles.set(s,I),this._localTimelineStyles.has(s)||this._backFill.set(s,this._globalTimelineStyles.get(s)??ii),this._updateStyle(s,I)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((e,A)=>{this._currentKeyframe.set(A,e)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((e,A)=>{this._currentKeyframe.has(A)||this._currentKeyframe.set(A,e)}))}snapshotCurrentStyles(){for(let[e,A]of this._localTimelineStyles)this._pendingStyles.set(e,A),this._updateStyle(e,A)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let e=[];for(let A in this._currentKeyframe)e.push(A);return e}mergeTimelineCollectedStyles(e){e._styleSummary.forEach((A,i)=>{let o=this._styleSummary.get(i);(!o||A.time>o.time)&&this._updateStyle(i,A.value)})}buildKeyframes(){this.applyStylesToKeyframe();let e=new Set,A=new Set,i=this._keyframes.size===1&&this.duration===0,o=[];this._keyframes.forEach((s,r)=>{let I=new Map([...this._backFill,...s]);I.forEach((B,c)=>{B===tr?e.add(c):B===ii&&A.add(c)}),i||I.set("offset",r/this.duration),o.push(I)});let g=[...e.values()],n=[...A.values()];if(i){let s=o[0],r=new Map(s);s.set("offset",0),r.set("offset",1),o=[s,r]}return Tm(this.element,o,g,n,this.duration,this.startTime,this.easing,!1)}},Lm=class extends Bc{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(e,A,i,o,g,n,s=!1){super(e,A,n.delay),this.keyframes=i,this.preStyleProps=o,this.postStyleProps=g,this._stretchStartingKeyframe=s,this.timings={duration:n.duration,delay:n.delay,easing:n.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:A,duration:i,easing:o}=this.timings;if(this._stretchStartingKeyframe&&A){let g=[],n=i+A,s=A/n,r=new Map(e[0]);r.set("offset",0),g.push(r);let I=new Map(e[0]);I.set("offset",oS(s)),g.push(I);let B=e.length-1;for(let c=1;c<=B;c++){let D=new Map(e[c]),h=D.get("offset"),p=A+h*i;D.set("offset",oS(p/n)),g.push(D)}i=n,A=0,o="",e=g}return Tm(this.element,e,this.preStyleProps,this.postStyleProps,i,A,o,!0)}};function oS(t,e=3){let A=Math.pow(10,e-1);return Math.round(t*A)/A}function Yq(t,e){let A=new Map,i;return t.forEach(o=>{if(o==="*"){i??=e.keys();for(let g of i)A.set(g,ii)}else for(let[g,n]of o)A.set(g,n)}),A}function gS(t,e,A,i,o,g,n,s,r,I,B,c,D){return{type:0,element:t,triggerName:e,isRemovalTransition:o,fromState:A,fromStyles:g,toState:i,toStyles:n,timelines:s,queriedElements:r,preStyleProps:I,postStyleProps:B,totalTime:c,errors:D}}var Rm={},Qc=class{_triggerName;ast;_stateStyles;constructor(e,A,i){this._triggerName=e,this.ast=A,this._stateStyles=i}match(e,A,i,o){return Jq(this.ast.matchers,e,A,i,o)}buildStyles(e,A,i){let o=this._stateStyles.get("*");return e!==void 0&&(o=this._stateStyles.get(e?.toString())||o),o?o.buildStyles(A,i):new Map}build(e,A,i,o,g,n,s,r,I,B){let c=[],D=this.ast.options&&this.ast.options.params||Rm,h=s&&s.params||Rm,p=this.buildStyles(i,h,c),y=r&&r.params||Rm,L=this.buildStyles(o,y,c),P=new Set,mA=new Map,_A=new Map,fA=o==="void",Qt={params:cS(y,D),delay:this.ast.options?.delay},ue=B?[]:ES(e,A,this.ast.animation,g,n,p,L,Qt,I,c),pe=0;return ue.forEach(le=>{pe=Math.max(le.duration+le.delay,pe)}),c.length?gS(A,this._triggerName,i,o,fA,p,L,[],[],mA,_A,pe,c):(ue.forEach(le=>{let ni=le.element,fo=Nt(mA,ni,new Set);le.preStyleProps.forEach(Ui=>fo.add(Ui));let Ki=Nt(_A,ni,new Set);le.postStyleProps.forEach(Ui=>Ki.add(Ui)),ni!==A&&P.add(ni)}),gS(A,this._triggerName,i,o,fA,p,L,ue,[...P.values()],mA,_A,pe))}};function Jq(t,e,A,i,o){return t.some(g=>g(e,A,i,o))}function cS(t,e){let A=R({},e);return Object.entries(t).forEach(([i,o])=>{o!=null&&(A[i]=o)}),A}var Km=class{styles;defaultParams;normalizer;constructor(e,A,i){this.styles=e,this.defaultParams=A,this.normalizer=i}buildStyles(e,A){let i=new Map,o=cS(e,this.defaultParams);return this.styles.styles.forEach(g=>{typeof g!="string"&&g.forEach((n,s)=>{n&&(n=hr(n,o,A));let r=this.normalizer.normalizePropertyName(s,A);n=this.normalizer.normalizeStyleValue(s,r,n,A),i.set(s,n)})}),i}};function Hq(t,e,A){return new Um(t,e,A)}var Um=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(e,A,i){this.name=e,this.ast=A,this._normalizer=i,A.states.forEach(o=>{let g=o.options&&o.options.params||{};this.states.set(o.name,new Km(o.style,g,i))}),nS(this.states,"true","1"),nS(this.states,"false","0"),A.transitions.forEach(o=>{this.transitionFactories.push(new Qc(e,o,this.states))}),this.fallbackTransition=Tq(e,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,A,i,o){return this.transitionFactories.find(n=>n.match(e,A,i,o))||null}matchStyles(e,A,i){return this.fallbackTransition.buildStyles(e,A,i)}};function Tq(t,e,A){let i=[(n,s)=>!0],o={type:LA.Sequence,steps:[],options:null},g={type:LA.Transition,animation:o,matchers:i,options:null,queryCount:0,depCount:0};return new Qc(t,g,e)}function nS(t,e,A){t.has(e)?t.has(A)||t.set(A,t.get(e)):t.has(A)&&t.set(e,t.get(A))}var Oq=new Ka,_m=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(e,A,i){this.bodyNode=e,this._driver=A,this._normalizer=i}register(e,A){let i=[],o=[],g=QS(this._driver,A,i,o);if(i.length)throw Jb(i);this._animations.set(e,g)}_buildPlayer(e,A,i){let o=e.element,g=hm(this._normalizer,e.keyframes,A,i);return this._driver.animate(o,g,e.duration,e.delay,e.easing,[],!0)}create(e,A,i={}){let o=[],g=this._animations.get(e),n,s=new Map;if(g?(n=ES(this._driver,A,g,wm,ec,new Map,new Map,i,Oq,o),n.forEach(B=>{let c=Nt(s,B.element,new Map);B.postStyleProps.forEach(D=>c.set(D,null))})):(o.push(Hb()),n=[]),o.length)throw Tb(o);s.forEach((B,c)=>{B.forEach((D,h)=>{B.set(h,this._driver.computeStyle(c,h,ii))})});let r=n.map(B=>{let c=s.get(B.element);return this._buildPlayer(B,new Map,c)}),I=Zo(r);return this._playersById.set(e,I),I.onDestroy(()=>this.destroy(e)),this.players.push(I),I}destroy(e){let A=this._getPlayer(e);A.destroy(),this._playersById.delete(e);let i=this.players.indexOf(A);i>=0&&this.players.splice(i,1)}_getPlayer(e){let A=this._playersById.get(e);if(!A)throw Ob(e);return A}listen(e,A,i,o){let g=$E(A,"","","");return XE(this._getPlayer(e),i,g,o),()=>{}}command(e,A,i,o){if(i=="register"){this.register(e,o[0]);return}if(i=="create"){let n=o[0]||{};this.create(e,A,n);return}let g=this._getPlayer(e);switch(i){case"play":g.play();break;case"pause":g.pause();break;case"reset":g.reset();break;case"restart":g.restart();break;case"finish":g.finish();break;case"init":g.init();break;case"setPosition":g.setPosition(parseFloat(o[0]));break;case"destroy":this.destroy(e);break}}},sS="ng-animate-queued",Pq=".ng-animate-queued",km="ng-animate-disabled",Zq=".ng-animate-disabled",qq="ng-star-inserted",Vq=".ng-star-inserted",Wq=[],lS={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},zq={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Li="__ng_removed",Ua=class{namespaceId;value;options;get params(){return this.options.params}constructor(e,A=""){this.namespaceId=A;let i=e&&e.hasOwnProperty("value"),o=i?e.value:e;if(this.value=Xq(o),i){let g=e,{value:n}=g,s=mc(g,["value"]);this.options=s}else this.options={};this.options.params||(this.options.params={})}absorbOptions(e){let A=e.params;if(A){let i=this.options.params;Object.keys(A).forEach(o=>{i[o]==null&&(i[o]=A[o])})}}},La="void",Fm=new Ua(La),xm=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(e,A,i){this.id=e,this.hostElement=A,this._engine=i,this._hostClassName="ng-tns-"+e,gi(A,this._hostClassName)}listen(e,A,i,o){if(!this._triggers.has(A))throw Pb(i,A);if(i==null||i.length==0)throw Zb(A);if(!$q(i))throw qb(i,A);let g=Nt(this._elementListeners,e,[]),n={name:A,phase:i,callback:o};g.push(n);let s=Nt(this._engine.statesByElement,e,new Map);return s.has(A)||(gi(e,Na),gi(e,Na+"-"+A),s.set(A,Fm)),()=>{this._engine.afterFlush(()=>{let r=g.indexOf(n);r>=0&&g.splice(r,1),this._triggers.has(A)||s.delete(A)})}}register(e,A){return this._triggers.has(e)?!1:(this._triggers.set(e,A),!0)}_getTrigger(e){let A=this._triggers.get(e);if(!A)throw Vb(e);return A}trigger(e,A,i,o=!0){let g=this._getTrigger(A),n=new _a(this.id,A,e),s=this._engine.statesByElement.get(e);s||(gi(e,Na),gi(e,Na+"-"+A),this._engine.statesByElement.set(e,s=new Map));let r=s.get(A),I=new Ua(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&r&&I.absorbOptions(r.options),s.set(A,I),r||(r=Fm),!(I.value===La)&&r.value===I.value){if(!t1(r.params,I.params)){let y=[],L=g.matchStyles(r.value,r.params,y),P=g.matchStyles(I.value,I.params,y);y.length?this._engine.reportError(y):this._engine.afterFlush(()=>{bg(e,L),vi(e,P)})}return}let D=Nt(this._engine.playersByElement,e,[]);D.forEach(y=>{y.namespaceId==this.id&&y.triggerName==A&&y.queued&&y.destroy()});let h=g.matchTransition(r.value,I.value,e,I.params),p=!1;if(!h){if(!o)return;h=g.fallbackTransition,p=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:A,transition:h,fromState:r,toState:I,player:n,isFallbackTransition:p}),p||(gi(e,sS),n.onStart(()=>{ur(e,sS)})),n.onDone(()=>{let y=this.players.indexOf(n);y>=0&&this.players.splice(y,1);let L=this._engine.playersByElement.get(e);if(L){let P=L.indexOf(n);P>=0&&L.splice(P,1)}}),this.players.push(n),D.push(n),n}deregister(e){this._triggers.delete(e),this._engine.statesByElement.forEach(A=>A.delete(e)),this._elementListeners.forEach((A,i)=>{this._elementListeners.set(i,A.filter(o=>o.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);let A=this._engine.playersByElement.get(e);A&&(A.forEach(i=>i.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,A){let i=this._engine.driver.query(e,Ga,!0);i.forEach(o=>{if(o[Li])return;let g=this._engine.fetchNamespacesByElement(o);g.size?g.forEach(n=>n.triggerLeaveAnimation(o,A,!1,!0)):this.clearElementCache(o)}),this._engine.afterFlushAnimationsDone(()=>i.forEach(o=>this.clearElementCache(o)))}triggerLeaveAnimation(e,A,i,o){let g=this._engine.statesByElement.get(e),n=new Map;if(g){let s=[];if(g.forEach((r,I)=>{if(n.set(I,r.value),this._triggers.has(I)){let B=this.trigger(e,I,La,o);B&&s.push(B)}}),s.length)return this._engine.markElementAsRemoved(this.id,e,!0,A,n),i&&Zo(s).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){let A=this._elementListeners.get(e),i=this._engine.statesByElement.get(e);if(A&&i){let o=new Set;A.forEach(g=>{let n=g.name;if(o.has(n))return;o.add(n);let r=this._triggers.get(n).fallbackTransition,I=i.get(n)||Fm,B=new Ua(La),c=new _a(this.id,n,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:n,transition:r,fromState:I,toState:B,player:c,isFallbackTransition:!0})})}}removeNode(e,A){let i=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,A),this.triggerLeaveAnimation(e,A,!0))return;let o=!1;if(i.totalAnimations){let g=i.players.length?i.playersByQueriedElement.get(e):[];if(g&&g.length)o=!0;else{let n=e;for(;n=n.parentNode;)if(i.statesByElement.get(n)){o=!0;break}}}if(this.prepareLeaveAnimationListeners(e),o)i.markElementAsRemoved(this.id,e,!1,A);else{let g=e[Li];(!g||g===lS)&&(i.afterFlush(()=>this.clearElementCache(e)),i.destroyInnerAnimations(e),i._onRemovalComplete(e,A))}}insertNode(e,A){gi(e,this._hostClassName)}drainQueuedTransitions(e){let A=[];return this._queue.forEach(i=>{let o=i.player;if(o.destroyed)return;let g=i.element,n=this._elementListeners.get(g);n&&n.forEach(s=>{if(s.name==i.triggerName){let r=$E(g,i.triggerName,i.fromState.value,i.toState.value);r._data=e,XE(i.player,s.phase,r,s.callback)}}),o.markedForDestroy?this._engine.afterFlush(()=>{o.destroy()}):A.push(i)}),this._queue=[],A.sort((i,o)=>{let g=i.transition.ast.depCount,n=o.transition.ast.depCount;return g==0||n==0?g-n:this._engine.driver.containsElement(i.element,o.element)?1:-1})}destroy(e){this.players.forEach(A=>A.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}},Ym=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,A)=>{};_onRemovalComplete(e,A){this.onRemovalComplete(e,A)}constructor(e,A,i){this.bodyNode=e,this.driver=A,this._normalizer=i}get queuedPlayers(){let e=[];return this._namespaceList.forEach(A=>{A.players.forEach(i=>{i.queued&&e.push(i)})}),e}createNamespace(e,A){let i=new xm(e,A,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,A)?this._balanceNamespaceList(i,A):(this.newHostElements.set(A,i),this.collectEnterElement(A)),this._namespaceLookup[e]=i}_balanceNamespaceList(e,A){let i=this._namespaceList,o=this.namespacesByHostElement;if(i.length-1>=0){let n=!1,s=this.driver.getParentElement(A);for(;s;){let r=o.get(s);if(r){let I=i.indexOf(r);i.splice(I+1,0,e),n=!0;break}s=this.driver.getParentElement(s)}n||i.unshift(e)}else i.push(e);return o.set(A,e),e}register(e,A){let i=this._namespaceLookup[e];return i||(i=this.createNamespace(e,A)),i}registerTrigger(e,A,i){let o=this._namespaceLookup[e];o&&o.register(A,i)&&this.totalAnimations++}destroy(e,A){e&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let i=this._fetchNamespace(e);this.namespacesByHostElement.delete(i.hostElement);let o=this._namespaceList.indexOf(i);o>=0&&this._namespaceList.splice(o,1),i.destroy(A),delete this._namespaceLookup[e]}))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){let A=new Set,i=this.statesByElement.get(e);if(i){for(let o of i.values())if(o.namespaceId){let g=this._fetchNamespace(o.namespaceId);g&&A.add(g)}}return A}trigger(e,A,i,o){if(sc(A)){let g=this._fetchNamespace(e);if(g)return g.trigger(A,i,o),!0}return!1}insertNode(e,A,i,o){if(!sc(A))return;let g=A[Li];if(g&&g.setForRemoval){g.setForRemoval=!1,g.setForMove=!0;let n=this.collectedLeaveElements.indexOf(A);n>=0&&this.collectedLeaveElements.splice(n,1)}if(e){let n=this._fetchNamespace(e);n&&n.insertNode(A,i)}o&&this.collectEnterElement(A)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,A){A?this.disabledNodes.has(e)||(this.disabledNodes.add(e),gi(e,km)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),ur(e,km))}removeNode(e,A,i){if(sc(A)){let o=e?this._fetchNamespace(e):null;o?o.removeNode(A,i):this.markElementAsRemoved(e,A,!1,i);let g=this.namespacesByHostElement.get(A);g&&g.id!==e&&g.removeNode(A,i)}else this._onRemovalComplete(A,i)}markElementAsRemoved(e,A,i,o,g){this.collectedLeaveElements.push(A),A[Li]={namespaceId:e,setForRemoval:o,hasAnimation:i,removedBeforeQueried:!1,previousTriggersValues:g}}listen(e,A,i,o,g){return sc(A)?this._fetchNamespace(e).listen(A,i,o,g):()=>{}}_buildInstruction(e,A,i,o,g){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,i,o,e.fromState.options,e.toState.options,A,g)}destroyInnerAnimations(e){let A=this.driver.query(e,Ga,!0);A.forEach(i=>this.destroyActiveAnimationsForElement(i)),this.playersByQueriedElement.size!=0&&(A=this.driver.query(e,tc,!0),A.forEach(i=>this.finishActiveQueriedAnimationOnElement(i)))}destroyActiveAnimationsForElement(e){let A=this.playersByElement.get(e);A&&A.forEach(i=>{i.queued?i.markedForDestroy=!0:i.destroy()})}finishActiveQueriedAnimationOnElement(e){let A=this.playersByQueriedElement.get(e);A&&A.forEach(i=>i.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return Zo(this.players).onDone(()=>e());e()})}processLeaveNode(e){let A=e[Li];if(A&&A.setForRemoval){if(e[Li]=lS,A.namespaceId){this.destroyInnerAnimations(e);let i=this._fetchNamespace(A.namespaceId);i&&i.clearElementCache(e)}this._onRemovalComplete(e,A.setForRemoval)}e.classList?.contains(km)&&this.markElementAsDisabled(e,!1),this.driver.query(e,Zq,!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(e=-1){let A=[];if(this.newHostElements.size&&(this.newHostElements.forEach((i,o)=>this._balanceNamespaceList(i,o)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let i=0;ii()),this._flushFns=[],this._whenQuietFns.length){let i=this._whenQuietFns;this._whenQuietFns=[],A.length?Zo(A).onDone(()=>{i.forEach(o=>o())}):i.forEach(o=>o())}}reportError(e){throw Wb(e)}_flushAnimations(e,A){let i=new Ka,o=[],g=new Map,n=[],s=new Map,r=new Map,I=new Map,B=new Set;this.disabledNodes.forEach(E=>{B.add(E);let eA=this.driver.query(E,Pq,!0);for(let uA=0;uA{let uA=wm+y++;p.set(eA,uA),E.forEach(TA=>gi(TA,uA))});let L=[],P=new Set,mA=new Set;for(let E=0;EP.add(TA)):mA.add(eA))}let _A=new Map,fA=aS(D,Array.from(P));fA.forEach((E,eA)=>{let uA=ec+y++;_A.set(eA,uA),E.forEach(TA=>gi(TA,uA))}),e.push(()=>{h.forEach((E,eA)=>{let uA=p.get(eA);E.forEach(TA=>ur(TA,uA))}),fA.forEach((E,eA)=>{let uA=_A.get(eA);E.forEach(TA=>ur(TA,uA))}),L.forEach(E=>{this.processLeaveNode(E)})});let Qt=[],ue=[];for(let E=this._namespaceList.length-1;E>=0;E--)this._namespaceList[E].drainQueuedTransitions(A).forEach(uA=>{let TA=uA.player,Re=uA.element;if(Qt.push(TA),this.collectedEnterElements.length){let Ue=Re[Li];if(Ue&&Ue.setForMove){if(Ue.previousTriggersValues&&Ue.previousTriggersValues.has(uA.triggerName)){let _i=Ue.previousTriggersValues.get(uA.triggerName),st=this.statesByElement.get(uA.element);if(st&&st.has(uA.triggerName)){let Sg=st.get(uA.triggerName);Sg.value=_i,st.set(uA.triggerName,Sg)}}TA.destroy();return}}let We=!c||!this.driver.containsElement(c,Re),nt=_A.get(Re),Wt=p.get(Re),oe=this._buildInstruction(uA,i,Wt,nt,We);if(oe.errors&&oe.errors.length){ue.push(oe);return}if(We){TA.onStart(()=>bg(Re,oe.fromStyles)),TA.onDestroy(()=>vi(Re,oe.toStyles)),o.push(TA);return}if(uA.isFallbackTransition){TA.onStart(()=>bg(Re,oe.fromStyles)),TA.onDestroy(()=>vi(Re,oe.toStyles)),o.push(TA);return}let Ya=[];oe.timelines.forEach(Ue=>{Ue.stretchStartingKeyframe=!0,this.disabledNodes.has(Ue.element)||Ya.push(Ue)}),oe.timelines=Ya,i.append(Re,oe.timelines);let Ja={instruction:oe,player:TA,element:Re};n.push(Ja),oe.queriedElements.forEach(Ue=>Nt(s,Ue,[]).push(TA)),oe.preStyleProps.forEach((Ue,_i)=>{if(Ue.size){let st=r.get(_i);st||r.set(_i,st=new Set),Ue.forEach((Sg,mr)=>st.add(mr))}}),oe.postStyleProps.forEach((Ue,_i)=>{let st=I.get(_i);st||I.set(_i,st=new Set),Ue.forEach((Sg,mr)=>st.add(mr))})});if(ue.length){let E=[];ue.forEach(eA=>{E.push(zb(eA.triggerName,eA.errors))}),Qt.forEach(eA=>eA.destroy()),this.reportError(E)}let pe=new Map,le=new Map;n.forEach(E=>{let eA=E.element;i.has(eA)&&(le.set(eA,eA),this._beforeAnimationBuild(E.player.namespaceId,E.instruction,pe))}),o.forEach(E=>{let eA=E.element;this._getPreviousPlayers(eA,!1,E.namespaceId,E.triggerName,null).forEach(TA=>{Nt(pe,eA,[]).push(TA),TA.destroy()})});let ni=L.filter(E=>CS(E,r,I)),fo=new Map;IS(fo,this.driver,mA,I,ii).forEach(E=>{CS(E,r,I)&&ni.push(E)});let Ui=new Map;h.forEach((E,eA)=>{IS(Ui,this.driver,new Set(E),r,tr)}),ni.forEach(E=>{let eA=fo.get(E),uA=Ui.get(E);fo.set(E,new Map([...eA?.entries()??[],...uA?.entries()??[]]))});let Kn=[],UA=[],Un={};n.forEach(E=>{let{element:eA,player:uA,instruction:TA}=E;if(i.has(eA)){if(B.has(eA)){uA.onDestroy(()=>vi(eA,TA.toStyles)),uA.disabled=!0,uA.overrideTotalTime(TA.totalTime),o.push(uA);return}let Re=Un;if(le.size>1){let nt=eA,Wt=[];for(;nt=nt.parentNode;){let oe=le.get(nt);if(oe){Re=oe;break}Wt.push(nt)}Wt.forEach(oe=>le.set(oe,Re))}let We=this._buildAnimation(uA.namespaceId,TA,pe,g,Ui,fo);if(uA.setRealPlayer(We),Re===Un)Kn.push(uA);else{let nt=this.playersByElement.get(Re);nt&&nt.length&&(uA.parentPlayer=Zo(nt)),o.push(uA)}}else bg(eA,TA.fromStyles),uA.onDestroy(()=>vi(eA,TA.toStyles)),UA.push(uA),B.has(eA)&&o.push(uA)}),UA.forEach(E=>{let eA=g.get(E.element);if(eA&&eA.length){let uA=Zo(eA);E.setRealPlayer(uA)}}),o.forEach(E=>{E.parentPlayer?E.syncPlayerEvents(E.parentPlayer):E.destroy()});for(let E=0;E!We.destroyed);Re.length?A1(this,eA,Re):this.processLeaveNode(eA)}return L.length=0,Kn.forEach(E=>{this.players.push(E),E.onDone(()=>{E.destroy();let eA=this.players.indexOf(E);this.players.splice(eA,1)}),E.play()}),Kn}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,A,i,o,g){let n=[];if(A){let s=this.playersByQueriedElement.get(e);s&&(n=s)}else{let s=this.playersByElement.get(e);if(s){let r=!g||g==La;s.forEach(I=>{I.queued||!r&&I.triggerName!=o||n.push(I)})}}return(i||o)&&(n=n.filter(s=>!(i&&i!=s.namespaceId||o&&o!=s.triggerName))),n}_beforeAnimationBuild(e,A,i){let o=A.triggerName,g=A.element,n=A.isRemovalTransition?void 0:e,s=A.isRemovalTransition?void 0:o;for(let r of A.timelines){let I=r.element,B=I!==g,c=Nt(i,I,[]);this._getPreviousPlayers(I,B,n,s,A.toState).forEach(h=>{let p=h.getRealPlayer();p.beforeDestroy&&p.beforeDestroy(),h.destroy(),c.push(h)})}bg(g,A.fromStyles)}_buildAnimation(e,A,i,o,g,n){let s=A.triggerName,r=A.element,I=[],B=new Set,c=new Set,D=A.timelines.map(p=>{let y=p.element;B.add(y);let L=y[Li];if(L&&L.removedBeforeQueried)return new Bo(p.duration,p.delay);let P=y!==r,mA=e1((i.get(y)||Wq).map(pe=>pe.getRealPlayer())).filter(pe=>{let le=pe;return le.element?le.element===y:!1}),_A=g.get(y),fA=n.get(y),Qt=hm(this._normalizer,p.keyframes,_A,fA),ue=this._buildPlayer(p,Qt,mA);if(p.subTimeline&&o&&c.add(y),P){let pe=new _a(e,s,y);pe.setRealPlayer(ue),I.push(pe)}return ue});I.forEach(p=>{Nt(this.playersByQueriedElement,p.element,[]).push(p),p.onDone(()=>jq(this.playersByQueriedElement,p.element,p))}),B.forEach(p=>gi(p,pm));let h=Zo(D);return h.onDestroy(()=>{B.forEach(p=>ur(p,pm)),vi(r,A.toStyles)}),c.forEach(p=>{Nt(o,p,[]).push(h)}),h}_buildPlayer(e,A,i){return A.length>0?this.driver.animate(e.element,A,e.duration,e.delay,e.easing,i):new Bo(e.duration,e.delay)}},_a=class{namespaceId;triggerName;element;_player=new Bo;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(e,A,i){this.namespaceId=e,this.triggerName=A,this.element=i}setRealPlayer(e){this._containsRealPlayer||(this._player=e,this._queuedCallbacks.forEach((A,i)=>{A.forEach(o=>XE(e,i,void 0,o))}),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 A=this._player;A.triggerCallback&&e.onStart(()=>A.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,A){Nt(this._queuedCallbacks,e,[]).push(A)}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 A=this._player;A.triggerCallback&&A.triggerCallback(e)}};function jq(t,e,A){let i=t.get(e);if(i){if(i.length){let o=i.indexOf(A);i.splice(o,1)}i.length==0&&t.delete(e)}return i}function Xq(t){return t??null}function sc(t){return t&&t.nodeType===1}function $q(t){return t=="start"||t=="done"}function rS(t,e){let A=t.style.display;return t.style.display=e??"none",A}function IS(t,e,A,i,o){let g=[];A.forEach(r=>g.push(rS(r)));let n=[];i.forEach((r,I)=>{let B=new Map;r.forEach(c=>{let D=e.computeStyle(I,c,o);B.set(c,D),(!D||D.length==0)&&(I[Li]=zq,n.push(I))}),t.set(I,B)});let s=0;return A.forEach(r=>rS(r,g[s++])),n}function aS(t,e){let A=new Map;if(t.forEach(s=>A.set(s,[])),e.length==0)return A;let i=1,o=new Set(e),g=new Map;function n(s){if(!s)return i;let r=g.get(s);if(r)return r;let I=s.parentNode;return A.has(I)?r=I:o.has(I)?r=i:r=n(I),g.set(s,r),r}return e.forEach(s=>{let r=n(s);r!==i&&A.get(r).push(s)}),A}function gi(t,e){t.classList?.add(e)}function ur(t,e){t.classList?.remove(e)}function A1(t,e,A){Zo(A).onDone(()=>t.processLeaveNode(e))}function e1(t){let e=[];return dS(t,e),e}function dS(t,e){for(let A=0;Ao.add(g)):e.set(t,i),A.delete(t),!0}var Dr=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(e,A)=>{};constructor(e,A,i){this._driver=A,this._normalizer=i,this._transitionEngine=new Ym(e.body,A,i),this._timelineEngine=new _m(e.body,A,i),this._transitionEngine.onRemovalComplete=(o,g)=>this.onRemovalComplete(o,g)}registerTrigger(e,A,i,o,g){let n=e+"-"+o,s=this._triggerCache[n];if(!s){let r=[],I=[],B=QS(this._driver,g,r,I);if(r.length)throw Yb(o,r);s=Hq(o,B,this._normalizer),this._triggerCache[n]=s}this._transitionEngine.registerTrigger(A,o,s)}register(e,A){this._transitionEngine.register(e,A)}destroy(e,A){this._transitionEngine.destroy(e,A)}onInsert(e,A,i,o){this._transitionEngine.insertNode(e,A,i,o)}onRemove(e,A,i){this._transitionEngine.removeNode(e,A,i)}disableAnimations(e,A){this._transitionEngine.markElementAsDisabled(e,A)}process(e,A,i,o){if(i.charAt(0)=="@"){let[g,n]=um(i),s=o;this._timelineEngine.command(g,A,n,s)}else this._transitionEngine.trigger(e,A,i,o)}listen(e,A,i,o,g){if(i.charAt(0)=="@"){let[n,s]=um(i);return this._timelineEngine.listen(n,A,s,g)}return this._transitionEngine.listen(e,A,i,o,g)}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 i1(t,e){let A=null,i=null;return Array.isArray(e)&&e.length?(A=bm(e[0]),e.length>1&&(i=bm(e[e.length-1]))):e instanceof Map&&(A=bm(e)),A||i?new o1(t,A,i):null}var o1=(()=>{class t{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(A,i,o){this._element=A,this._startStyles=i,this._endStyles=o;let g=t.initialStylesByElement.get(A);g||t.initialStylesByElement.set(A,g=new Map),this._initialStyles=g}start(){this._state<1&&(this._startStyles&&vi(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(vi(this._element,this._initialStyles),this._endStyles&&(vi(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(t.initialStylesByElement.delete(this._element),this._startStyles&&(bg(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(bg(this._element,this._endStyles),this._endStyles=null),vi(this._element,this._initialStyles),this._state=3)}}return t})();function bm(t){let e=null;return t.forEach((A,i)=>{g1(i)&&(e=e||new Map,e.set(i,A))}),e}function g1(t){return t==="display"||t==="position"}var Ec=class{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(e,A,i,o){this.element=e,this.keyframes=A,this.options=i,this._specialStyles=o,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._initialized=!0;let e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:new Map;let A=()=>this._onFinish();this.domPlayer.addEventListener("finish",A),this.onDestroy(()=>{this.domPlayer.removeEventListener("finish",A)})}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_convertKeyframesToObject(e){let A=[];return e.forEach(i=>{A.push(Object.fromEntries(i))}),A}_triggerWebAnimation(e,A,i){return e.animate(this._convertKeyframesToObject(A),i)}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(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(e=>e()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),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&&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===void 0&&this.init(),this.domPlayer.currentTime=e*this.time}getPosition(){return+(this.domPlayer.currentTime??0)/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){let e=new Map;this.hasStarted()&&this._finalKeyframe.forEach((i,o)=>{o!=="offset"&&e.set(o,this._finished?i:oc(this.element,o))}),this.currentSnapshot=e}triggerCallback(e){let A=e==="start"?this._onStartFns:this._onDoneFns;A.forEach(i=>i()),A.length=0}},cc=class{validateStyleProperty(e){return!0}validateAnimatableStyleProperty(e){return!0}containsElement(e,A){return Dm(e,A)}getParentElement(e){return Ac(e)}query(e,A,i){return mm(e,A,i)}computeStyle(e,A,i){return oc(e,A)}animate(e,A,i,o,g,n=[]){let s=o==0?"both":"forwards",r={duration:i,delay:o,fill:s};g&&(r.easing=g);let I=new Map,B=n.filter(h=>h instanceof Ec);AS(i,o)&&B.forEach(h=>{h.currentSnapshot.forEach((p,y)=>I.set(y,p))});let c=Xb(A).map(h=>new Map(h));c=eS(e,c,I);let D=i1(e,c);return new Ec(e,c,r,D)}};var rc="@",hS="@.disabled",lc=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(e,A,i,o){this.namespaceId=e,this.delegate=A,this.engine=i,this._onDestroy=o}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,A){return this.delegate.createElement(e,A)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,A){this.delegate.appendChild(e,A),this.engine.onInsert(this.namespaceId,A,e,!1)}insertBefore(e,A,i,o=!0){this.delegate.insertBefore(e,A,i),this.engine.onInsert(this.namespaceId,A,e,o)}removeChild(e,A,i){this.parentNode(A)&&this.engine.onRemove(this.namespaceId,A,this.delegate)}selectRootElement(e,A){return this.delegate.selectRootElement(e,A)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,A,i,o){this.delegate.setAttribute(e,A,i,o)}removeAttribute(e,A,i){this.delegate.removeAttribute(e,A,i)}addClass(e,A){this.delegate.addClass(e,A)}removeClass(e,A){this.delegate.removeClass(e,A)}setStyle(e,A,i,o){this.delegate.setStyle(e,A,i,o)}removeStyle(e,A,i){this.delegate.removeStyle(e,A,i)}setProperty(e,A,i){A.charAt(0)==rc&&A==hS?this.disableAnimations(e,!!i):this.delegate.setProperty(e,A,i)}setValue(e,A){this.delegate.setValue(e,A)}listen(e,A,i,o){return this.delegate.listen(e,A,i,o)}disableAnimations(e,A){this.engine.disableAnimations(e,A)}},Jm=class extends lc{factory;constructor(e,A,i,o,g){super(A,i,o,g),this.factory=e,this.namespaceId=A}setProperty(e,A,i){A.charAt(0)==rc?A.charAt(1)=="."&&A==hS?(i=i===void 0?!0:!!i,this.disableAnimations(e,i)):this.engine.process(this.namespaceId,e,A.slice(1),i):this.delegate.setProperty(e,A,i)}listen(e,A,i,o){if(A.charAt(0)==rc){let g=n1(e),n=A.slice(1),s="";return n.charAt(0)!=rc&&([n,s]=s1(n)),this.engine.listen(this.namespaceId,g,n,s,r=>{let I=r._data||-1;this.factory.scheduleListenerCallback(I,i,r)})}return this.delegate.listen(e,A,i,o)}};function n1(t){switch(t){case"body":return document.body;case"document":return document;case"window":return window;default:return t}}function s1(t){let e=t.indexOf("."),A=t.substring(0,e),i=t.slice(e+1);return[A,i]}var dc=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(e,A,i){this.delegate=e,this.engine=A,this._zone=i,A.onRemovalComplete=(o,g)=>{g?.removeChild(null,o)}}createRenderer(e,A){let i="",o=this.delegate.createRenderer(e,A);if(!e||!A?.data?.animation){let I=this._rendererCache,B=I.get(o);if(!B){let c=()=>I.delete(o);B=new lc(i,o,this.engine,c),I.set(o,B)}return B}let g=A.id,n=A.id+"-"+this._currentId;this._currentId++,this.engine.register(n,e);let s=I=>{Array.isArray(I)?I.forEach(s):this.engine.registerTrigger(g,n,e,I.name,I)};return A.data.animation.forEach(s),new Jm(this,n,o,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(e,A,i){if(e>=0&&eA(i));return}let o=this._animationCallbacksBuffer;o.length==0&&queueMicrotask(()=>{this._zone.run(()=>{o.forEach(g=>{let[n,s]=g;n(s)}),this._animationCallbacksBuffer=[]})}),o.push([A,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 I1=(()=>{class t extends Dr{constructor(A,i,o){super(A,i,o)}ngOnDestroy(){this.flush()}static \u0275fac=function(i){return new(i||t)(J(lA),J(vn),J(Ln))};static \u0275prov=N({token:t,factory:t.\u0275fac})}return t})();function a1(){return new Ic}function C1(t,e,A){return new dc(t,e,A)}var DS=[{provide:Ln,useFactory:a1},{provide:Dr,useClass:I1},{provide:tt,useFactory:C1,deps:[uI,Dr,X]}],B1=[{provide:vn,useClass:Hm},{provide:ee,useValue:"NoopAnimations"},...DS],uS=[{provide:vn,useFactory:()=>new cc},{provide:ee,useFactory:()=>"BrowserAnimations"},...DS],mS=(()=>{class t{static withConfig(A){return{ngModule:t,providers:A.disableAnimations?B1:uS}}static \u0275fac=function(i){return new(i||t)};static \u0275mod=V({type:t});static \u0275inj=q({providers:uS,imports:[mI]})}return t})();var hc=class t{static \u0275fac=function(A){return new(A||t)};static \u0275mod=V({type:t});static \u0275inj=q({imports:[Uo,hQ,JF,FF,To,YE,xo,Kk,xo,xF,HF,ZF,Ab,kE,qk,uF,NF,mb.forRoot(),fb,bM]})};var xa=class t{static \u0275fac=function(A){return new(A||t)};static \u0275mod=V({type:t,bootstrap:[lr]});static \u0275inj=q({providers:[Si,fg,ho,Cr,Br,Fg,co,ar,cr],imports:[hc,mI,hQ,Ph,jE,YE,To,xo,mS,xo]})};fetch("/assets/config/runtime-config.json").then(t=>t.json()).then(t=>{window.runtimeConfig=t,$B().bootstrapModule(xa).catch(e=>console.error(e))});$B().bootstrapModule(xa).catch(t=>console.error(t)); +`)}static{this.\u0275fac=function(i){return new(i||t)(J(PP,8),J(db,8),J(ZP,8),J(qP,8),J(jt),J(hb),J(it,8),J(an))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})(),Db=(()=>{class t{get disableSanitizer(){return this._disableSanitizer}set disableSanitizer(A){this._disableSanitizer=this.coerceBooleanProperty(A)}get inline(){return this._inline}set inline(A){this._inline=this.coerceBooleanProperty(A)}get clipboard(){return this._clipboard}set clipboard(A){this._clipboard=this.coerceBooleanProperty(A)}get emoji(){return this._emoji}set emoji(A){this._emoji=this.coerceBooleanProperty(A)}get katex(){return this._katex}set katex(A){this._katex=this.coerceBooleanProperty(A)}get mermaid(){return this._mermaid}set mermaid(A){this._mermaid=this.coerceBooleanProperty(A)}get lineHighlight(){return this._lineHighlight}set lineHighlight(A){this._lineHighlight=this.coerceBooleanProperty(A)}get lineNumbers(){return this._lineNumbers}set lineNumbers(A){this._lineNumbers=this.coerceBooleanProperty(A)}get commandLine(){return this._commandLine}set commandLine(A){this._commandLine=this.coerceBooleanProperty(A)}constructor(A,i,o){this.element=A,this.markdownService=i,this.viewContainerRef=o,this.error=new $,this.load=new $,this.ready=new $,this._clipboard=!1,this._commandLine=!1,this._disableSanitizer=!1,this._emoji=!1,this._inline=!1,this._katex=!1,this._lineHighlight=!1,this._lineNumbers=!1,this._mermaid=!1,this.destroyed$=new K}ngOnChanges(){this.loadContent()}loadContent(){if(this.data!=null){this.handleData();return}if(this.src!=null){this.handleSrc();return}}ngAfterViewInit(){!this.data&&!this.src&&this.handleTransclusion(),this.markdownService.reload$.pipe(DA(this.destroyed$)).subscribe(()=>this.loadContent())}ngOnDestroy(){this.destroyed$.next(),this.destroyed$.complete()}render(A,i=!1){return qe(this,null,function*(){let o={decodeHtml:i,inline:this.inline,emoji:this.emoji,mermaid:this.mermaid,disableSanitizer:this.disableSanitizer},g={clipboard:this.clipboard,clipboardOptions:this.getClipboardOptions(),katex:this.katex,katexOptions:this.katexOptions,mermaid:this.mermaid,mermaidOptions:this.mermaidOptions},n=yield this.markdownService.parse(A,o);this.element.nativeElement.innerHTML=n,this.handlePlugins(),this.markdownService.render(this.element.nativeElement,g,this.viewContainerRef),this.ready.emit()})}coerceBooleanProperty(A){return A!=null&&`${String(A)}`!="false"}getClipboardOptions(){if(this.clipboardButtonComponent||this.clipboardButtonTemplate)return{buttonComponent:this.clipboardButtonComponent,buttonTemplate:this.clipboardButtonTemplate}}handleData(){this.render(this.data)}handleSrc(){this.markdownService.getSource(this.src).subscribe({next:A=>{this.render(A).then(()=>{this.load.emit(A)})},error:A=>this.error.emit(A)})}handleTransclusion(){this.render(this.element.nativeElement.innerHTML,!0)}handlePlugins(){this.commandLine&&(this.setPluginClass(this.element.nativeElement,Qm.CommandLine),this.setPluginOptions(this.element.nativeElement,{dataFilterOutput:this.filterOutput,dataHost:this.host,dataPrompt:this.prompt,dataOutput:this.output,dataUser:this.user})),this.lineHighlight&&this.setPluginOptions(this.element.nativeElement,{dataLine:this.line,dataLineOffset:this.lineOffset}),this.lineNumbers&&(this.setPluginClass(this.element.nativeElement,Qm.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(A,i){let o=A.querySelectorAll("pre");for(let g=0;g{let s=i[n];if(s){let r=this.toLispCase(n);o.item(g).setAttribute(r,s.toString())}})}toLispCase(A){let i=A.match(/([A-Z])/g);if(!i)return A;let o=A.toString();for(let g=0,n=i.length;g{let i=eZ(A)?hA(R({},A),{multi:!0}):{provide:db,useValue:A,multi:!0};return[...e,i]},[])}var mb=(()=>{class t{static forRoot(A){return{ngModule:t,providers:[AZ(A)]}}static forChild(){return{ngModule:t}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=V({type:t})}static{this.\u0275inj=q({imports:[Uo]})}}return t})();var oZ=["switch"],gZ=["*"];function nZ(t,e){t&1&&(u(0,"span",10),at(),u(1,"svg",12),W(2,"path",13),m(),u(3,"svg",14),W(4,"path",15),m()())}var sZ=new k("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1,hideIcon:!1,disabledInteractive:!1})}),rZ={provide:Bn,useExisting:ft(()=>zE),multi:!0},WE=class{source;checked;constructor(e,A){this.source=e,this.checked=A}},zE=(()=>{class t{_elementRef=Q(Z);_focusMonitor=Q(Xt);_changeDetectorRef=Q(zA);defaults=Q(sZ);_onChange=A=>{};_onTouched=()=>{};_validatorOnChange=()=>{};_uniqueId;_checked=!1;_createChangeEvent(A){return new WE(this,A)}_labelId;get buttonId(){return`${this.id||this._uniqueId}-button`}_switchElement;focus(){this._switchElement.nativeElement.focus()}_noopAnimations;_focused;name=null;id;labelPosition="after";ariaLabel=null;ariaLabelledby=null;ariaDescribedby;required;color;disabled=!1;disableRipple=!1;tabIndex=0;get checked(){return this._checked}set checked(A){this._checked=A,this._changeDetectorRef.markForCheck()}hideIcon;disabledInteractive;change=new $;toggleChange=new $;get inputId(){return`${this.id||this._uniqueId}-input`}constructor(){Q(be).load(ki);let A=Q(new Dt("tabindex"),{optional:!0}),i=this.defaults,o=Q(ee,{optional:!0});this.tabIndex=A==null?0:parseInt(A)||0,this.color=i.color||"accent",this._noopAnimations=o==="NoopAnimations",this.id=this._uniqueId=Q(ce).getId("mat-mdc-slide-toggle-"),this.hideIcon=i.hideIcon??!1,this.disabledInteractive=i.disabledInteractive??!1,this._labelId=this._uniqueId+"-label"}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(A=>{A==="keyboard"||A==="program"?(this._focused=!0,this._changeDetectorRef.markForCheck()):A||Promise.resolve().then(()=>{this._focused=!1,this._onTouched(),this._changeDetectorRef.markForCheck()})})}ngOnChanges(A){A.required&&this._validatorOnChange()}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}writeValue(A){this.checked=!!A}registerOnChange(A){this._onChange=A}registerOnTouched(A){this._onTouched=A}validate(A){return this.required&&A.value!==!0?{required:!0}:null}registerOnValidatorChange(A){this._validatorOnChange=A}setDisabledState(A){this.disabled=A,this._changeDetectorRef.markForCheck()}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(this._createChangeEvent(this.checked))}_handleClick(){this.disabled||(this.toggleChange.emit(),this.defaults.disableToggleValue||(this.checked=!this.checked,this._onChange(this.checked),this.change.emit(new WE(this,this.checked))))}_getAriaLabelledBy(){return this.ariaLabelledby?this.ariaLabelledby:this.ariaLabel?null:this._labelId}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=O({type:t,selectors:[["mat-slide-toggle"]],viewQuery:function(i,o){if(i&1&&cA(oZ,5),i&2){let g;z(g=j())&&(o._switchElement=g.first)}},hostAttrs:[1,"mat-mdc-slide-toggle"],hostVars:13,hostBindings:function(i,o){i&2&&(yt("id",o.id),IA("tabindex",null)("aria-label",null)("name",null)("aria-labelledby",null),Xe(o.color?"mat-"+o.color:""),gA("mat-mdc-slide-toggle-focused",o._focused)("mat-mdc-slide-toggle-checked",o.checked)("_mat-animation-noopable",o._noopAnimations))},inputs:{name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],required:[2,"required","required",iA],color:"color",disabled:[2,"disabled","disabled",iA],disableRipple:[2,"disableRipple","disableRipple",iA],tabIndex:[2,"tabIndex","tabIndex",A=>A==null?0:Fe(A)],checked:[2,"checked","checked",iA],hideIcon:[2,"hideIcon","hideIcon",iA],disabledInteractive:[2,"disabledInteractive","disabledInteractive",iA]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[KA([rZ,{provide:Cg,useExisting:t,multi:!0}]),VA],ngContentSelectors:gZ,decls:13,vars:27,consts:[["switch",""],["mat-internal-form-field","",3,"labelPosition"],["role","switch","type","button",1,"mdc-switch",3,"click","tabIndex","disabled"],[1,"mdc-switch__track"],[1,"mdc-switch__handle-track"],[1,"mdc-switch__handle"],[1,"mdc-switch__shadow"],[1,"mdc-elevation-overlay"],[1,"mdc-switch__ripple"],["mat-ripple","",1,"mat-mdc-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-switch__icons"],[1,"mdc-label",3,"click","for"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--on"],["d","M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--off"],["d","M20 13H4v-2h16v2z"]],template:function(i,o){if(i&1){let g=aA();qA(),u(0,"div",1)(1,"button",2,0),x("click",function(){return H(g),T(o._handleClick())}),W(3,"span",3),u(4,"span",4)(5,"span",5)(6,"span",6),W(7,"span",7),m(),u(8,"span",8),W(9,"span",9),m(),_(10,nZ,5,0,"span",10),m()()(),u(11,"label",11),x("click",function(s){return H(g),T(s.stopPropagation())}),rA(12),m()()}if(i&2){let g=He(2);F("labelPosition",o.labelPosition),f(),gA("mdc-switch--selected",o.checked)("mdc-switch--unselected",!o.checked)("mdc-switch--checked",o.checked)("mdc-switch--disabled",o.disabled)("mat-mdc-slide-toggle-disabled-interactive",o.disabledInteractive),F("tabIndex",o.disabled&&!o.disabledInteractive?-1:o.tabIndex)("disabled",o.disabled&&!o.disabledInteractive),IA("id",o.buttonId)("name",o.name)("aria-label",o.ariaLabel)("aria-labelledby",o._getAriaLabelledBy())("aria-describedby",o.ariaDescribedby)("aria-required",o.required||null)("aria-checked",o.checked)("aria-disabled",o.disabled&&o.disabledInteractive?"true":null),f(8),F("matRippleTrigger",g)("matRippleDisabled",o.disableRipple||o.disabled)("matRippleCentered",!0),f(),wA(o.hideIcon?-1:10),f(),F("for",o.buttonId),IA("id",o._labelId)}},dependencies:[dg,cE],styles:['.mdc-switch{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;flex-shrink:0;margin:0;outline:none;overflow:visible;padding:0;position:relative;width:var(--mdc-switch-track-width, 52px)}.mdc-switch.mdc-switch--disabled{cursor:default;pointer-events:none}.mdc-switch.mat-mdc-slide-toggle-disabled-interactive{pointer-events:auto}.mdc-switch__track{overflow:hidden;position:relative;width:100%;height:var(--mdc-switch-track-height, 32px);border-radius:var(--mdc-switch-track-shape, var(--mat-sys-corner-full))}.mdc-switch--disabled.mdc-switch .mdc-switch__track{opacity:var(--mdc-switch-disabled-track-opacity, 0.12)}.mdc-switch__track::before,.mdc-switch__track::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";height:100%;left:0;position:absolute;width:100%;border-width:var(--mat-switch-track-outline-width, 2px);border-color:var(--mat-switch-track-outline-color, var(--mat-sys-outline))}.mdc-switch--selected .mdc-switch__track::before,.mdc-switch--selected .mdc-switch__track::after{border-width:var(--mat-switch-selected-track-outline-width, 2px);border-color:var(--mat-switch-selected-track-outline-color, transparent)}.mdc-switch--disabled .mdc-switch__track::before,.mdc-switch--disabled .mdc-switch__track::after{border-width:var(--mat-switch-disabled-unselected-track-outline-width, 2px);border-color:var(--mat-switch-disabled-unselected-track-outline-color, var(--mat-sys-on-surface))}@media(forced-colors: active){.mdc-switch__track{border-color:currentColor}}.mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:translateX(0);background:var(--mdc-switch-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1);transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch--selected .mdc-switch__track::before{transform:translateX(-100%)}.mdc-switch--selected .mdc-switch__track::before{opacity:var(--mat-switch-hidden-track-opacity, 0);transition:var(--mat-switch-hidden-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::before{opacity:var(--mat-switch-visible-track-opacity, 1);transition:var(--mat-switch-visible-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::before{background:var(--mdc-switch-unselected-hover-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::before{background:var(--mdc-switch-unselected-focus-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:active .mdc-switch__track::before{background:var(--mdc-switch-unselected-pressed-track-color, var(--mat-sys-surface-variant))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::before,.mdc-switch.mdc-switch--disabled .mdc-switch__track::before{background:var(--mdc-switch-disabled-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch__track::after{transform:translateX(-100%);background:var(--mdc-switch-selected-track-color, var(--mat-sys-primary))}[dir=rtl] .mdc-switch__track::after{transform:translateX(100%)}.mdc-switch--selected .mdc-switch__track::after{transform:translateX(0)}.mdc-switch--selected .mdc-switch__track::after{opacity:var(--mat-switch-visible-track-opacity, 1);transition:var(--mat-switch-visible-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::after{opacity:var(--mat-switch-hidden-track-opacity, 0);transition:var(--mat-switch-hidden-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::after{background:var(--mdc-switch-selected-hover-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::after{background:var(--mdc-switch-selected-focus-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:active .mdc-switch__track::after{background:var(--mdc-switch-selected-pressed-track-color, var(--mat-sys-primary))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::after,.mdc-switch.mdc-switch--disabled .mdc-switch__track::after{background:var(--mdc-switch-disabled-selected-track-color, var(--mat-sys-on-surface))}.mdc-switch__handle-track{height:100%;pointer-events:none;position:absolute;top:0;transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);left:0;right:auto;transform:translateX(0);width:calc(100% - var(--mdc-switch-handle-width))}[dir=rtl] .mdc-switch__handle-track{left:auto;right:0}.mdc-switch--selected .mdc-switch__handle-track{transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch__handle-track{transform:translateX(-100%)}.mdc-switch__handle{display:flex;pointer-events:auto;position:absolute;top:50%;transform:translateY(-50%);left:0;right:auto;transition:width 75ms cubic-bezier(0.4, 0, 0.2, 1),height 75ms cubic-bezier(0.4, 0, 0.2, 1),margin 75ms cubic-bezier(0.4, 0, 0.2, 1);width:var(--mdc-switch-handle-width);height:var(--mdc-switch-handle-height);border-radius:var(--mdc-switch-handle-shape, var(--mat-sys-corner-full))}[dir=rtl] .mdc-switch__handle{left:auto;right:0}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle{width:var(--mat-switch-unselected-handle-size, 16px);height:var(--mat-switch-unselected-handle-size, 16px);margin:var(--mat-switch-unselected-handle-horizontal-margin, 0 8px)}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-switch-unselected-with-icon-handle-horizontal-margin, 0 4px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle{width:var(--mat-switch-selected-handle-size, 24px);height:var(--mat-switch-selected-handle-size, 24px);margin:var(--mat-switch-selected-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-switch-selected-with-icon-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch__handle:has(.mdc-switch__icons){width:var(--mat-switch-with-icon-handle-size, 24px);height:var(--mat-switch-with-icon-handle-size, 24px)}.mat-mdc-slide-toggle .mdc-switch:active:not(.mdc-switch--disabled) .mdc-switch__handle{width:var(--mat-switch-pressed-handle-size, 28px);height:var(--mat-switch-pressed-handle-size, 28px)}.mat-mdc-slide-toggle .mdc-switch--selected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-switch-selected-pressed-handle-horizontal-margin, 0 22px)}.mat-mdc-slide-toggle .mdc-switch--unselected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-switch-unselected-pressed-handle-horizontal-margin, 0 2px)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__handle::after{opacity:var(--mat-switch-disabled-selected-handle-opacity, 1)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__handle::after{opacity:var(--mat-switch-disabled-unselected-handle-opacity, 0.38)}.mdc-switch__handle::before,.mdc-switch__handle::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";width:100%;height:100%;left:0;position:absolute;top:0;transition:background-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1),border-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);z-index:-1}@media(forced-colors: active){.mdc-switch__handle::before,.mdc-switch__handle::after{border-color:currentColor}}.mdc-switch--selected:enabled .mdc-switch__handle::after{background:var(--mdc-switch-selected-handle-color, var(--mat-sys-on-primary))}.mdc-switch--selected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-selected-hover-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-selected-focus-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:active .mdc-switch__handle::after{background:var(--mdc-switch-selected-pressed-handle-color, var(--mat-sys-primary-container))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:hover:not(:focus):not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:focus:not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:active .mdc-switch__handle::after,.mdc-switch--selected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mdc-switch-disabled-selected-handle-color, var(--mat-sys-surface))}.mdc-switch--unselected:enabled .mdc-switch__handle::after{background:var(--mdc-switch-unselected-handle-color, var(--mat-sys-outline))}.mdc-switch--unselected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-unselected-hover-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-unselected-focus-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:active .mdc-switch__handle::after{background:var(--mdc-switch-unselected-pressed-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mdc-switch-disabled-unselected-handle-color, var(--mat-sys-on-surface))}.mdc-switch__handle::before{background:var(--mdc-switch-handle-surface-color)}.mdc-switch__shadow{border-radius:inherit;bottom:0;left:0;position:absolute;right:0;top:0}.mdc-switch:enabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-handle-elevation-shadow)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__shadow,.mdc-switch.mdc-switch--disabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-disabled-handle-elevation-shadow)}.mdc-switch__ripple{left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);z-index:-1;width:var(--mdc-switch-state-layer-size, 40px);height:var(--mdc-switch-state-layer-size, 40px)}.mdc-switch__ripple::after{content:"";opacity:0}.mdc-switch--disabled .mdc-switch__ripple::after{display:none}.mat-mdc-slide-toggle-disabled-interactive .mdc-switch__ripple::after{display:block}.mdc-switch:hover .mdc-switch__ripple::after{opacity:.04;transition:75ms opacity cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mdc-switch .mdc-switch__ripple::after{opacity:.12}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:focus .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:active .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:hover:not(:focus) .mdc-switch__ripple::after,.mdc-switch--unselected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mdc-switch-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-switch--unselected:enabled:focus .mdc-switch__ripple::after{background:var(--mdc-switch-unselected-focus-state-layer-color, var(--mat-sys-on-surface))}.mdc-switch--unselected:enabled:active .mdc-switch__ripple::after{background:var(--mdc-switch-unselected-pressed-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mdc-switch-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch--selected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mdc-switch-selected-hover-state-layer-color, var(--mat-sys-primary))}.mdc-switch--selected:enabled:focus .mdc-switch__ripple::after{background:var(--mdc-switch-selected-focus-state-layer-color, var(--mat-sys-primary))}.mdc-switch--selected:enabled:active .mdc-switch__ripple::after{background:var(--mdc-switch-selected-pressed-state-layer-color, var(--mat-sys-primary));opacity:var(--mdc-switch-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch__icons{position:relative;height:100%;width:100%;z-index:1}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__icons{opacity:var(--mdc-switch-disabled-unselected-icon-opacity, 0.38)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__icons{opacity:var(--mdc-switch-disabled-selected-icon-opacity, 0.38)}.mdc-switch__icon{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;opacity:0;transition:opacity 30ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-switch--unselected .mdc-switch__icon{width:var(--mdc-switch-unselected-icon-size, 16px);height:var(--mdc-switch-unselected-icon-size, 16px);fill:var(--mdc-switch-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mdc-switch-disabled-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__icon{width:var(--mdc-switch-selected-icon-size, 16px);height:var(--mdc-switch-selected-icon-size, 16px);fill:var(--mdc-switch-selected-icon-color, var(--mat-sys-on-primary-container))}.mdc-switch--selected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mdc-switch-disabled-selected-icon-color, var(--mat-sys-on-surface))}.mdc-switch--selected .mdc-switch__icon--on,.mdc-switch--unselected .mdc-switch__icon--off{opacity:1;transition:opacity 45ms 30ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle{-webkit-user-select:none;user-select:none;display:inline-block;-webkit-tap-highlight-color:rgba(0,0,0,0);outline:0}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple,.mat-mdc-slide-toggle .mdc-switch__ripple::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple:not(:empty),.mat-mdc-slide-toggle .mdc-switch__ripple::after:not(:empty){transform:translateZ(0)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mat-focus-indicator::before{content:""}.mat-mdc-slide-toggle .mat-internal-form-field{color:var(--mat-switch-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-switch-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-switch-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-switch-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-switch-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-switch-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-slide-toggle .mat-ripple-element{opacity:.12}.mat-mdc-slide-toggle .mat-focus-indicator::before{border-radius:50%}.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle-track,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__icon,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::after,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::after{transition:none}.mat-mdc-slide-toggle .mdc-switch:enabled+.mdc-label{cursor:pointer}.mat-mdc-slide-toggle .mdc-switch--disabled+label{color:var(--mdc-switch-disabled-label-text-color)}'],encapsulation:2,changeDetection:0})}return t})();var fb=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=V({type:t});static \u0275inj=q({imports:[zE,SA,SA]})}return t})();var cr=class t{downloadBase64Data(e,A,i="image.png"){try{let o=document.createElement("a");o.href=e,o.download=i,document.body.appendChild(o),o.click(),document.body.removeChild(o)}catch(o){throw console.error("Error downloading base64 data:",o),o}}static \u0275fac=function(A){return new(A||t)};static \u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})};function CZ(t,e){t&1&&W(0,"hr",10)}function BZ(t,e){if(t&1&&(u(0,"mat-option",11),v(1),m()),t&2){let A=e.$implicit;F("value",A),f(),PA(A.versionId)}}function QZ(t,e){if(t&1&&W(0,"img",12),t&2){let A,i=b().index,o=b();F("src",(A=o.selectedArtifacts[i].data)!==null&&A!==void 0?A:"",An)}}function EZ(t,e){if(t&1){let A=aA();u(0,"div",2),_(1,CZ,1,0,"hr",3),u(2,"div",4)(3,"span"),v(4),m()(),u(5,"div",4)(6,"span"),v(7," Version: "),m(),u(8,"div",5)(9,"mat-select",6),fi("ngModelChange",function(o){let g=H(A).index,n=b();return $i(n.selectedArtifacts[g],o)||(n.selectedArtifacts[g]=o),T(o)}),x("selectionChange",function(o){let g=H(A).index,n=b();return T(n.onArtifactVersionChange(o,g))}),_(10,BZ,2,2,"mat-option",7),m()(),u(11,"button",8),x("click",function(){let o=H(A).index,g=b();return T(g.downloadArtifact(g.selectedArtifacts[o]))}),u(12,"mat-icon"),v(13,"file_download"),m(),v(14," Download "),m()(),_(15,QZ,1,1,"img",9),m()}if(t&2){let A=e.$implicit,i=e.index,o=b();f(),F("ngIf",i>0),f(3),te(" ",o.getArtifactName(A)," "),f(5),mi("ngModel",o.selectedArtifacts[i]),f(),F("ngForOf",o.getSortedArtifactsFromId(A)),f(5),F("ngIf",o.isArtifactImage(o.selectedArtifacts[i]))}}var cZ="default_artifact_name",Fa=class t{constructor(e){this.downloadService=e}artifacts=[];selectedArtifacts=[];ngOnChanges(e){if(e.artifacts){this.selectedArtifacts=[];for(let A of this.getDistinctArtifactIds())this.selectedArtifacts.push(this.getSortedArtifactsFromId(A)[0])}}downloadArtifact(e){this.downloadService.downloadBase64Data(e.data,e.mimeType,e.id)}getArtifactName(e){return e??cZ}isArtifactImage(e){return!e||!e.mimeType?!1:e.mimeType.startsWith("image/")}getDistinctArtifactIds(){return[...new Set(this.artifacts.map(e=>e.id))]}getSortedArtifactsFromId(e){return this.artifacts.filter(A=>A.id===e).sort((A,i)=>i.versionId-A.versionId)}onArtifactVersionChange(e,A){this.selectedArtifacts[A]=e.value}static \u0275fac=function(A){return new(A||t)(AA(cr))};static \u0275cmp=O({type:t,selectors:[["app-artifact-tab"]],inputs:{artifacts:"artifacts"},standalone:!1,features:[VA],decls:2,vars:1,consts:[[1,"artifact-container"],["class","artifact-box",4,"ngFor","ngForOf"],[1,"artifact-box"],["class","white-separator",4,"ngIf"],[1,"artifact-metadata"],[1,"version-select-container"],[3,"ngModelChange","selectionChange","ngModel"],[3,"value",4,"ngFor","ngForOf"],["mat-flat-button","",1,"download-button",3,"click"],["class","generated-image","alt","artifact.id",3,"src",4,"ngIf"],[1,"white-separator"],[3,"value"],["alt","artifact.id",1,"generated-image",3,"src"]],template:function(A,i){A&1&&(u(0,"div",0),_(1,EZ,16,5,"div",1),m()),A&2&&(f(),F("ngForOf",i.getDistinctArtifactIds()))},dependencies:[Rt,Jt,oo,yi,Ir,bt,ir,hg],styles:[".artifact-container[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}.artifact-box[_ngcontent-%COMP%]{padding:10px;max-width:100%;margin-left:26px;display:flex;flex-direction:column}.artifact-metadata[_ngcontent-%COMP%]{display:flex;align-items:center;margin-bottom:15px}.download-button[_ngcontent-%COMP%]{background-color:#8ab4f8!important;margin-left:35px;width:130px;height:28px;font-size:14px}.generated-image[_ngcontent-%COMP%]{max-width:60%;border-radius:8px}hr.white-separator[_ngcontent-%COMP%]{border:none;border-top:1px solid white;margin-bottom:1.2em;margin-right:15px}.version-select-container[_ngcontent-%COMP%]{background-color:#212123;width:80px;margin-left:15px}"]})};var ba=class t{sessionState={};constructor(){}static \u0275fac=function(A){return new(A||t)};static \u0275cmp=O({type:t,selectors:[["app-state-tab"]],inputs:{sessionState:"sessionState"},standalone:!1,decls:3,vars:1,consts:[[1,"state-wrapper"],[3,"json"]],template:function(A,i){A&1&&(u(0,"div",0)(1,"div"),W(2,"ngx-json-viewer",1),m()()),A&2&&(f(2),F("json",i.sessionState))},dependencies:[OE],styles:[".state-wrapper[_ngcontent-%COMP%]{padding-left:25px;padding-right:25px;margin-top:16px}"]})};var hZ=["videoContainer"],uZ=["sidenav"],DZ=["autoScroll"],mZ=()=>[],fZ=(t,e)=>({"user-message":t,"bot-message":e}),wb=t=>({"background-color":t});function wZ(t,e){if(t&1&&(u(0,"mat-option",20),v(1),m()),t&2){let A=e.$implicit;F("value",A),f(),PA(A)}}function pZ(t,e){t&1&&tn(0,wZ,2,2,"mat-option",20,en),t&2&&on(e)}function yZ(t,e){if(t&1&&(u(0,"mat-option",20),v(1),m()),t&2){let A=b(2);F("value",A.selectedAppControl.value),f(),PA(A.selectedAppControl.value)}}function MZ(t,e){if(t&1&&(u(0,"div",10)(1,"mat-select",19),_(2,pZ,2,0),rg(3,"async"),_(4,yZ,2,2,"mat-option",20),m()()),t&2){let A,i=b();f(),F("placeholder",i.isLoadingApps()?"Loading...":"Select an agent")("formControl",i.selectedAppControl),f(),wA((A=Ds(3,4,i.apps$))?2:-1,A),f(2),wA(i.selectedAppControl.value&&i.isLoadingApps()?4:-1)}}function RZ(t,e){t&1&&(u(0,"span"),v(1," No apps Avaiable in current directory"),m())}function kZ(t,e){t&1&&(u(0,"span",29),v(1,"Events"),m())}function FZ(t,e){t&1&&(u(0,"span",29),v(1,"State"),m())}function bZ(t,e){t&1&&(u(0,"span",29),v(1,"Artifacts"),m())}function SZ(t,e){t&1&&(u(0,"span",29),v(1,"Sessions"),m())}function NZ(t,e){t&1&&(u(0,"span",29),v(1,"Eval"),m())}function GZ(t,e){if(t&1){let A=aA();u(0,"div",21)(1,"mat-tab-group")(2,"mat-tab",22),_(3,kZ,2,0,"ng-template",23),u(4,"app-event-tab",24),x("selectedEvent",function(o){H(A);let g=b();return T(g.selectEvent(o))}),m()(),u(5,"mat-tab"),_(6,FZ,2,0,"ng-template",23),W(7,"app-state-tab",25),m(),u(8,"mat-tab"),_(9,bZ,2,0,"ng-template",23),W(10,"app-artifact-tab",26),m(),u(11,"mat-tab"),_(12,SZ,2,0,"ng-template",23),u(13,"app-session-tab",27),x("sessionSelected",function(o){H(A);let g=b();return T(g.updateWithSelectedSession(o))})("sessionReloaded",function(o){H(A);let g=b();return T(g.updateSessionState(o))}),m()(),u(14,"mat-tab"),_(15,NZ,2,0,"ng-template",23),u(16,"app-eval-tab",28),x("sessionSelected",function(o){H(A);let g=b();return T(g.updateWithSelectedSession(o))}),m()()()()}if(t&2){let A=b();f(4),F("eventsMap",A.eventData),f(3),F("sessionState",A.currentSessionState),f(3),F("artifacts",A.artifacts),f(3),F("userId",A.userId)("appName",A.appName)("sessionId",A.sessionId),f(3),F("appName",A.appName)("userId",A.userId)("sessionId",A.sessionId)}}function vZ(t,e){if(t&1&&W(0,"div",41),t&2){let A=b(2);F("innerHtml",A.renderedEventGraph,jp)}}function LZ(t,e){if(t&1){let A=aA();u(0,"div",30)(1,"div",31)(2,"div",32)(3,"mat-paginator",33),x("page",function(o){H(A);let g=b();return T(g.handlePageEvent(o))}),m(),u(4,"button",34)(5,"mat-icon",9),x("click",function(){H(A);let o=b();return T(o.closeSelectedEvent())}),v(6,"close"),m()()()(),u(7,"div")(8,"mat-tab-group")(9,"mat-tab",35)(10,"div",36),_(11,vZ,1,1,"div",37),m(),W(12,"ngx-json-viewer",38),m(),u(13,"mat-tab",39),W(14,"ngx-json-viewer",38),m(),u(15,"mat-tab",40),W(16,"ngx-json-viewer",38),m()()()()}if(t&2){let A=b();f(3),F("length",A.eventData.size)("pageSize",1)("pageIndex",A.selectedEventIndex),f(8),F("ngIf",A.renderedEventGraph),f(),F("json",A.selectedEvent),f(2),F("json",A.llmRequest),f(2),F("json",A.llmResponse)}}function KZ(t,e){if(t&1){let A=aA();u(0,"div",42)(1,"div",43)(2,"div",44),v(3,"Session ID"),m(),u(4,"div",45),v(5),m()(),u(6,"div",46)(7,"div",47)(8,"mat-slide-toggle",48),x("change",function(){H(A);let o=b();return T(o.toggleSse())}),v(9," Token Streaming "),m()(),W(10,"mat-divider",49),u(11,"div",50)(12,"div",51),x("click",function(){H(A);let o=b();return T(o.onNewSessionClick())}),u(13,"mat-icon"),v(14,"add"),m(),v(15," New Session "),m(),u(16,"span",52),x("click",function(){H(A);let o=b();return T(o.deleteSession(o.sessionId))}),v(17," delete "),m()()()()}if(t&2){let A=b();f(5),PA(A.sessionId),f(3),F("checked",A.enableSseIndicator()),f(2),F("vertical",!0)}}function UZ(t,e){t&1&&(u(0,"div",53)(1,"span"),v(2,"Loading agents, please wait..."),m()())}function _Z(t,e){t&1&&(u(0,"span"),v(1,"Welcome to ADK!"),W(2,"br"),v(3," Select an agent on the left to begin with."),m())}function xZ(t,e){if(t&1&&(v(0," Error message: "),W(1,"br"),u(2,"pre",55),v(3),m()),t&2){let A=b(4);f(3),PA(A.loadingError())}}function YZ(t,e){t&1&&(u(0,"pre",54),v(1,"Warning: No agents found in current folder."),m())}function JZ(t,e){if(t&1&&(u(0,"div"),v(1," Failed to load agents. To get started, run "),u(2,"pre"),v(3,"adk web"),m(),v(4," in the folder that contains the agents."),W(5,"br"),_(6,xZ,4,1)(7,YZ,2,0,"pre",54),m()),t&2){let A=b(3);f(6),wA(A.loadingError()?6:7)}}function HZ(t,e){if(t&1&&(u(0,"div",53),_(1,_Z,4,0,"span"),rg(2,"async"),_(3,JZ,8,1,"div"),m()),t&2){let A=b(2);f(),wA((Ds(2,1,A.apps$)||I0(3,mZ)).length>0?1:3)}}function TZ(t,e){if(t&1&&_(0,UZ,3,0,"div",53)(1,HZ,4,4,"div",53),t&2){let A=b();wA(A.isLoadingApps()?0:1)}}function OZ(t,e){if(t&1){let A=aA();u(0,"button",56),x("click",function(){H(A);let o=b();return T(o.openDialog())}),u(1,"mat-icon"),v(2,"priority_high"),m()()}}function PZ(t,e){if(t&1){let A=aA();u(0,"button",67),x("click",function(){H(A);let o=b().index,g=b(2);return T(g.clickEvent(o))}),u(1,"mat-icon",68),v(2,"robot_2"),m()()}}function ZZ(t,e){if(t&1&&(ui(0),W(1,"img",72),Di()),t&2){let A=b().$implicit;f(),F("src",A.url,An)}}function qZ(t,e){if(t&1&&(ui(0),u(1,"mat-icon"),v(2,"insert_drive_file"),m(),u(3,"a",73),v(4),m(),Di()),t&2){let A=b().$implicit;f(3),F("href",A.url,An),f(),PA(A.file.name)}}function VZ(t,e){if(t&1&&(u(0,"div",71),_(1,ZZ,2,1,"ng-container",64)(2,qZ,5,2,"ng-container",64),m()),t&2){let A=e.$implicit;f(),F("ngIf",A.file.type.startsWith("image/")),f(),F("ngIf",!A.file.type.startsWith("image/"))}}function WZ(t,e){if(t&1&&(u(0,"div",69),_(1,VZ,3,2,"div",70),m()),t&2){let A=b().$implicit;f(),F("ngForOf",A.attachments)}}function zZ(t,e){if(t&1&&W(0,"markdown",74),t&2){let A=b().$implicit;F("data",A.text)}}function jZ(t,e){if(t&1&&(u(0,"code"),v(1),m()),t&2){let A=b().$implicit;f(),te(" ",A.executableCode.code," ")}}function XZ(t,e){if(t&1&&(u(0,"div")(1,"div"),v(2),m(),u(3,"div"),v(4),m()()),t&2){let A=b().$implicit;f(2),te("Outcome: ",A.codeExecutionResult.outcome,""),f(2),te("Output: ",A.codeExecutionResult.output,"")}}function $Z(t,e){if(t&1&&(u(0,"div"),W(1,"img",75),m()),t&2){let A=b().$implicit;f(),F("src",A.inline_data.data,An)}}function Aq(t,e){if(t&1){let A=aA();u(0,"button",76),x("click",function(){H(A);let o=b().index,g=b(2);return T(g.clickEvent(o))}),u(1,"mat-icon"),v(2,"bolt"),m(),v(3),m()}if(t&2){let A=b().$implicit;f(3),te(" ",A.functionCall.name," ")}}function eq(t,e){if(t&1){let A=aA();u(0,"button",76),x("click",function(){H(A);let o=b().index,g=b(2);return T(g.clickEvent(o))}),u(1,"mat-icon"),v(2,"check"),m(),v(3),m()}if(t&2){let A=b().$implicit;f(3),te(" ",A.functionResponse.name," ")}}function tq(t,e){t&1&&(u(0,"button",34)(1,"mat-icon"),v(2,"person"),m()())}function iq(t,e){if(t&1&&(u(0,"div",59),_(1,PZ,3,0,"button",60),u(2,"mat-card",61),_(3,WZ,2,1,"div",62)(4,zZ,1,1,"markdown",63)(5,jZ,2,1,"code",64)(6,XZ,5,2,"div",64)(7,$Z,2,1,"div",64)(8,Aq,4,1,"button",65)(9,eq,4,1,"button",65),m(),_(10,tq,3,0,"button",66),m()),t&2){let A=e.$implicit;F("ngClass",us(10,fZ,A.role==="user",A.role==="bot")),f(),F("ngIf",A.role==="bot"),f(2),F("ngIf",A.attachments),f(),F("ngIf",A.text),f(),F("ngIf",A.executableCode),f(),F("ngIf",A.codeExecutionResult),f(),F("ngIf",A.inline_data&&A.role==="bot"),f(),F("ngIf",A.functionCall),f(),F("ngIf",A.functionResponse),f(),F("ngIf",A.role==="user")}}function oq(t,e){if(t&1&&(u(0,"div",57,1),W(2,"div",null,2),_(4,iq,11,13,"div",58),m()),t&2){let A=b();f(4),F("ngForOf",A.messages)}}function gq(t,e){if(t&1){let A=aA();u(0,"div",90),W(1,"img",91),u(2,"button",92),x("click",function(){H(A);let o=b().index,g=b(3);return T(g.removeFile(o))}),u(3,"mat-icon",93),v(4,"close"),m()()()}if(t&2){let A=b().$implicit;f(),F("src",A.url,An)}}function nq(t,e){if(t&1){let A=aA();u(0,"div",94)(1,"button",92),x("click",function(){H(A);let o=b().index,g=b(3);return T(g.removeFile(o))}),u(2,"mat-icon",93),v(3,"close"),m()(),u(4,"div",95)(5,"mat-icon"),v(6,"insert_drive_file"),m(),u(7,"span"),v(8),m()()()}if(t&2){let A=b().$implicit;f(8),PA(A.file.name)}}function sq(t,e){if(t&1&&(u(0,"div"),_(1,gq,5,1,"div",88)(2,nq,9,1,"div",89),m()),t&2){let A=e.$implicit;f(),F("ngIf",A.file.type.startsWith("image/")),f(),F("ngIf",!A.file.type.startsWith("image/"))}}function rq(t,e){if(t&1&&(u(0,"div",86),_(1,sq,3,2,"div",87),m()),t&2){let A=b(2);f(),F("ngForOf",A.selectedFiles)}}function Iq(t,e){if(t&1){let A=aA();u(0,"div",77)(1,"input",78,3),x("change",function(o){H(A);let g=b();return T(g.onFileSelect(o))}),m(),u(3,"mat-form-field",79),_(4,rq,2,1,"div",80),u(5,"input",81),fi("ngModelChange",function(o){H(A);let g=b();return $i(g.userInput,o)||(g.userInput=o),T(o)}),x("keydown.enter",function(o){H(A);let g=b();return T(g.sendMessage(o))}),m(),u(6,"div",82)(7,"button",83),x("click",function(){H(A);let o=He(2);return T(o.click())}),u(8,"mat-icon"),v(9,"attach_file"),m()(),u(10,"div")(11,"button",84),x("click",function(){H(A);let o=b();return T(o.toggleAudioRecording())}),W(12,"mat-icon",85),m(),u(13,"button",84),x("click",function(){H(A);let o=b();return T(o.toggleVideoRecording())}),W(14,"mat-icon",85),m()()()()()}if(t&2){let A=b();f(4),F("ngIf",A.selectedFiles.length&&A.appName!=""),f(),mi("ngModel",A.userInput),f(6),F("ngStyle",gn(6,wb,A.isAudioRecording?"rgb(234, 67, 53)":"rgb(51, 53, 55)")),f(),F("innerText",A.isAudioRecording?"stop":"mic"),f(),F("ngStyle",gn(8,wb,A.isVideoRecording?"rgb(234, 67, 53)":"rgb(51, 53, 55)")),f(),F("innerText",A.isVideoRecording?"stop":"videocam")}}function aq(t){for(t=t.replace(/-/g,"+").replace(/_/g,"/");t.length%4!==0;)t+="=";return t}var Em=class extends yn{nextPageLabel="Next Event";previousPageLabel="Previous Event";firstPageLabel="First Event";lastPageLabel="Last Event";getRangeLabel=(e,A,i)=>i===0?`Event 0 of ${i}`:(i=Math.max(i,0),`Event ${e*A+1} of ${i}`)},Sa=class t{constructor(e,A,i,o,g,n,s,r,I){this.sanitizer=e;this.sesisonService=A;this.artifactService=i;this.audioService=o;this.webSocketService=g;this.videoService=n;this.dialog=s;this.eventService=r;this.sessionService=I}videoContainer;sidenav;eventTabComponent;sessionTab;evalTab;scrollContainer;_snackBar=Q(Ok);enableSseIndicator=_t(!1);videoElement;currentMessage="";messages=[];lastTextChunk="";streamingTextMessage=null;artifacts=[];userInput="";userId="user";appName="";sessionId="";isAudioRecording=!1;isVideoRecording=!1;longRunningEvents=[];functionCallEventId="";redirectUri=ot.getBaseUrlWithoutPath();showSidePanel=!0;useSse=!1;currentSessionState={};eventData=new Map;eventMessageIndexArray=[];renderedEventGraph;selectedEvent=void 0;selectedEventIndex=void 0;llmRequest=void 0;llmResponse=void 0;llmRequestKey="gcp.vertex.agent.llm_request";llmResponseKey="gcp.vertex.agent.llm_response";selectedFiles=[];previousMessageCount=0;router=Q(ao);activatedRoute=Q(Io);selectedAppControl=new dQ("",{nonNullable:!0});agentService=Q(fg);isLoadingApps=_t(!1);loadingError=_t("");apps$=tA([]).pipe(Ie(()=>{this.isLoadingApps.set(!0),this.selectedAppControl.disable()}),re(()=>this.agentService.listApps().pipe(lt(e=>(this.loadingError.set(e.message),tA(void 0))))),de(1),Ie(()=>{this.isLoadingApps.set(!1),this.selectedAppControl.enable()}),Ro());ngOnInit(){if(this.syncSelectedAppFromUrl(),this.updateSelectedAppUrl(),new URL(window.location.href).searchParams.has("code")){let i=window.location.href;window.opener?.postMessage({authResponseUrl:i},window.origin),window.close()}this.agentService.getApp().subscribe(i=>{this.appName=i})}ngAfterViewInit(){this.showSidePanel=!0,this.sidenav.open()}ngAfterViewChecked(){this.messages.length!==this.previousMessageCount&&(this.scrollContainer.nativeElement.scrollTop=this.scrollContainer.nativeElement.scrollHeight,this.previousMessageCount=this.messages.length)}selectApp(e){e!=this.appName&&(this.agentService.setApp(e),this.createSession(),this.eventData=new Map,this.eventMessageIndexArray=[],this.messages=[],this.artifacts=[],this.userInput="",this.longRunningEvents=[])}createSession(){this.sesisonService.createSession(this.userId,this.appName).subscribe(e=>{this.currentSessionState=e.state,this.sessionId=e.id,this.sessionTab.refreshSession()})}sendMessage(e){return qe(this,null,function*(){if(e.preventDefault(),!this.userInput.trim())return;if(this.selectedFiles.length>0){let o=this.selectedFiles.map(g=>({file:g.file,url:g.url}));this.messages.push({role:"user",attachments:o})}this.messages.push({role:"user",text:this.userInput});let A={app_name:this.appName,user_id:this.userId,session_id:this.sessionId,new_message:{role:"user",parts:yield this.getUserMessageParts()},streaming:this.useSse};this.selectedFiles=[];let i=this.eventMessageIndexArray.length-1;this.streamingTextMessage=null,this.agentService.run_sse(A).subscribe({next:o=>qe(this,null,function*(){let g=JSON.parse(o);if(g.error){this.openSnackBar(g.error,"OK");return}if(g.content)for(let n of g.content.parts)i+=1,this.processPart(g,n,i)}),error:o=>console.error("SSE error:",o),complete:()=>{this.streamingTextMessage=null,this.sessionTab.reloadSession(this.sessionId)}}),this.userInput=""})}processPart(e,A,i){if(A.text){let o=A.text;if(this.streamingTextMessage){if(o==this.streamingTextMessage.text){this.storeEvents(A,e,i),this.eventMessageIndexArray[i]=o,this.streamingTextMessage=null;return}this.streamingTextMessage.text+=o}else if(this.streamingTextMessage={role:"bot",text:o},this.messages.push(this.streamingTextMessage),!this.useSse){this.storeEvents(A,e,i),this.eventMessageIndexArray[i]=o,this.streamingTextMessage=null;return}}else this.storeEvents(A,e,i),this.storeMessage(A,e,i)}getUserMessageParts(){return qe(this,null,function*(){let e=[{text:`${this.userInput}`}];if(this.selectedFiles.length>0)for(let A of this.selectedFiles)e.push({inline_data:{data:yield this.readFileAsBytes(A.file),mime_type:A.file.type}});return e})}readFileAsBytes(e){return new Promise((A,i)=>{let o=new FileReader;o.onload=g=>{let n=g.target.result.split(",")[1];A(n)},o.onerror=i,o.readAsDataURL(e)})}updateRedirectUri(e,A){try{let i=new URL(e);return i.searchParams.set("redirect_uri",A),i.toString()}catch(i){return console.warn("Failed to update redirect URI: ",i),e}}storeMessage(e,A,i){if(A.long_running_tool_ids&&A.long_running_tool_ids.length>0){this.getAsyncFunctionsFromParts(A.long_running_tool_ids,A.content.parts);let o=this.longRunningEvents[0];if(o.args.auth_config&&o.args.auth_config.exchanged_auth_credential&&o.args.auth_config.exchanged_auth_credential.oauth2){let g=o.args.auth_config.exchanged_auth_credential.oauth2.auth_uri,n=this.updateRedirectUri(g,this.redirectUri);this.openOAuthPopup(n).then(s=>{this.functionCallEventId=A.id,this.sendOAuthResponse(o,s,this.redirectUri)}).catch(s=>{console.error("OAuth Error:",s)})}else this.functionCallEventId=A.id}if(e.text)this.messages.push({role:A.author==="user"?"user":"bot",text:e.text}),this.eventMessageIndexArray[i]=e.text;else if(e.functionCall)this.messages.push({role:A.author==="user"?"user":"bot",functionCall:e.functionCall}),this.eventMessageIndexArray[i]=e.functionCall;else if(e.functionResponse){if(this.messages.push({role:A.author==="user"?"user":"bot",functionResponse:e.functionResponse}),A.actions&&A.actions.artifact_delta)for(let o in A.actions.artifact_delta)A.actions.artifact_delta.hasOwnProperty(o)&&this.renderArtifact(o,A.actions.artifact_delta[o]);this.eventMessageIndexArray[i]=e.functionResponse}else if(e.executableCode)this.messages.push({role:A.author==="user"?"user":"bot",executableCode:e.executableCode}),this.eventMessageIndexArray[i]=e.executableCode;else if(e.codeExecutionResult&&(this.messages.push({role:A.author==="user"?"user":"bot",codeExecutionResult:e.codeExecutionResult}),this.eventMessageIndexArray[i]=e.codeExecutionResult,A.actions&&A.actions.artifact_delta))for(let o in A.actions.artifact_delta)A.actions.artifact_delta.hasOwnProperty(o)&&this.renderArtifact(o,A.actions.artifact_delta[o])}renderArtifact(e,A){this.messages.push({role:"bot",inline_data:{data:"",mime_type:"image/png"}});let i=this.messages.length-1;this.artifactService.getArtifactVersion(this.userId,this.appName,this.sessionId,e,A).subscribe(o=>{let g=o.inlineData.mimeType,n=aq(o.inlineData.data),s=`data:${g};base64,${n}`;this.messages[i]={role:"bot",inline_data:{data:s,mime_type:g}},this.artifacts=[...this.artifacts,{id:e,data:s,mimeType:g,versionId:A}]})}storeEvents(e,A,i){let o=A.content.role+":";e.text?o+=i+e.text:e.functionCall?o+="functionCall:"+i+":"+e.functionCall.name:e.functionResponse?o+="functionResponse:"+i+":"+e.functionResponse.name:e.executableCode?o+="executableCode:"+i+":"+e.executableCode.code.slice(0,10):e.codeExecutionResult&&(o+="codeExecutionResult:"+i+":"+e.codeExecutionResult.outcome),this.eventData.set(o,A),this.eventData=new Map(this.eventData)}sendOAuthResponse(e,A,i){this.longRunningEvents.pop();let o={app_name:this.appName,user_id:this.userId,session_id:this.sessionId,new_message:{role:"user",parts:[]}};var g=e.args.auth_config;g.exchanged_auth_credential.oauth2.auth_response_uri=A,g.exchanged_auth_credential.oauth2.redirect_uri=i,o.function_call_event_id=this.functionCallEventId,o.new_message.parts.push({function_response:{id:e.id,name:e.name,response:g}}),this.agentService.run(o).subscribe(n=>{let s=this.eventMessageIndexArray.length-1;for(let r of n)if(r.content)for(let I of r.content.parts)s+=1,this.processPart(r,I,s)})}openDialog(){this.dialog.open(ma,{width:"600px",data:{event:this.longRunningEvents[0],app_name:this.appName,user_id:this.userId,session_id:this.sessionId,function_call_event_id:this.functionCallEventId}}).afterClosed().subscribe(A=>{A&&(this.longRunningEvents=A.events,this.messages.push({role:"bot",text:A.text}))})}clickEvent(e){let A=Array.from(this.eventData.entries())[e-this.userMessagesLength(e)],[i,o]=A;this.sidenav.open(),this.showSidePanel=!0,this.selectedEvent=o,this.selectedEventIndex=this.getIndexOfKeyInMap(i),this.eventService.getEventTrace(this.selectedEvent.id).subscribe(g=>{this.llmRequest=JSON.parse(g[this.llmRequestKey]),this.llmResponse=JSON.parse(g[this.llmResponseKey])}),this.eventService.getEvent(this.userId,this.appName,this.sessionId,this.selectedEvent.id).subscribe(g=>qe(this,null,function*(){if(!g.dot_src){this.renderedEventGraph=void 0;return}let n=g.dot_src,r=(yield pD()).renderString(n,{format:"svg",engine:"dot"});this.renderedEventGraph=this.sanitizer.bypassSecurityTrustHtml(r)}))}userMessagesLength(e){return this.messages.slice(0,e).filter(A=>A.role=="user").length}ngOnDestroy(){this.webSocketService.closeConnection()}toggleAudioRecording(){this.isAudioRecording?this.stopAudioRecording():this.startAudioRecording(),this.isAudioRecording=!this.isAudioRecording}startAudioRecording(){let e=window.location.protocol==="https:"?"wss":"ws";this.webSocketService.connect(`${e}://${ot.getWSServerUrl()}/run_live?app_name=${this.appName}&user_id=${this.userId}&session_id=${this.sessionId}`),this.audioService.startRecording(),this.messages.push({role:"user",text:"Speaking..."}),this.messages.push({role:"bot",text:"Speaking..."})}stopAudioRecording(){this.audioService.stopRecording(),this.webSocketService.closeConnection()}toggleVideoRecording(){this.isVideoRecording?this.stopVideoRecording():this.startVideoRecording(),this.isVideoRecording=!this.isVideoRecording}startVideoRecording(){let e=window.location.protocol==="https:"?"wss":"ws";this.webSocketService.connect(`${e}://${ot.getWSServerUrl()}/run_live?app_name=${this.appName}&user_id=${this.userId}&session_id=${this.sessionId}`),this.videoService.startRecording(this.videoContainer),this.audioService.startRecording(),this.messages.push({role:"user",text:"Speaking..."})}stopVideoRecording(){this.audioService.stopRecording(),this.videoService.stopRecording(this.videoContainer),this.webSocketService.closeConnection()}getAsyncFunctionsFromParts(e,A){for(let i of A)i.functionCall&&e.includes(i.functionCall.id)&&this.longRunningEvents.push(i.functionCall)}openOAuthPopup(e){return new Promise((A,i)=>{if(!window.open(e,"oauthPopup","width=600,height=700")){i("Popup blocked!");return}window.addEventListener("message",g=>{if(g.origin!==window.location.origin)return;let{authResponseUrl:n}=g.data;n?A(n):i("OAuth failed")},{once:!0})})}toggleSidePanel(){this.showSidePanel=!this.showSidePanel}updateWithSelectedSession(e){if(!e||!e.id||!e.events||!e.state){console.log("Session is not valid");return}this.sessionId=e.id,this.currentSessionState=e.state,this.eventData.clear(),this.eventMessageIndexArray=[],this.messages=[],this.artifacts=[];let A=0;e.events.forEach(i=>{i.content.parts.forEach(o=>{this.storeMessage(o,i,A),A+=1,i.author&&i.author!=="user"&&this.storeEvents(o,i,A)})})}updateSessionState(e){this.currentSessionState=e.state}onNewSessionClick(){this.createSession(),this.eventData.clear(),this.eventMessageIndexArray=[],this.messages=[],this.artifacts=[]}onFileSelect(e){let A=e.target;if(A.files)for(let i=0;i{this.llmRequest=JSON.parse(A[this.llmRequestKey]),this.llmResponse=JSON.parse(A[this.llmResponseKey])}),this.eventService.getEvent(this.userId,this.appName,this.sessionId,this.selectedEvent.id).subscribe(A=>qe(this,null,function*(){if(!A.dot_src){this.renderedEventGraph=void 0;return}let i=A.dot_src,g=(yield pD()).renderString(i,{format:"svg",engine:"dot"});this.renderedEventGraph=this.sanitizer.bypassSecurityTrustHtml(g)}))}deleteSession(e){let A={title:"Confirm delete",message:`Are you sure you want to delete this session ${this.sessionId}?`,confirmButtonText:"Delete",cancelButtonText:"Cancel"};this.dialog.open(fa,{width:"600px",data:A}).afterClosed().subscribe(o=>{o&&this.sessionService.deleteSession(this.userId,this.appName,e).subscribe(g=>{let n=this.sessionTab.refreshSession();n?this.sessionTab.getSession(n.id):window.location.reload()})})}syncSelectedAppFromUrl(){this.router.events.pipe(RA(e=>e instanceof Ot),oA(()=>this.activatedRoute.snapshot.queryParams)).subscribe(e=>{let A=e.app;A&&this.selectedAppControl.setValue(A)})}updateSelectedAppUrl(){this.selectedAppControl.valueChanges.pipe(Bi(),RA(Boolean)).subscribe(e=>{this.selectApp(e);let A=this.activatedRoute.snapshot.queryParams.app;e!==A&&this.router.navigate([],{queryParams:{app:e},queryParamsHandling:"merge"})})}handlePageEvent(e){if(e.pageIndex>=0){let A=this.getKeyAtIndexInMap(e.pageIndex);A&&this.selectEvent(A)}}closeSelectedEvent(){this.selectedEvent=void 0,this.selectedEventIndex=void 0}getIndexOfKeyInMap(e){let A=0,i=(g,n)=>0,o=Array.from(this.eventData.keys()).sort(i);for(let g of o){if(g===e)return A;A++}}getKeyAtIndexInMap(e){let A=(o,g)=>0,i=Array.from(this.eventData.keys()).sort(A);if(e>=0&&e0),f(),F("ngIf",i.appName!=""),f(),F("ngIf",i.appName!=""))},dependencies:[Yt,Rt,Jt,bh,io,oo,yi,YF,Ir,Eo,Mk,kg,bt,hE,gk,ok,fD,vF,OE,WD,zD,em,tm,$F,ir,hg,Db,zE,eu,kn,Fn,Rn,Fa,ba,EI],styles:[".drawer-container[_ngcontent-%COMP%]{height:100%;background-color:#131314}.generated-image[_ngcontent-%COMP%]{max-width:33%;border-radius:8px}.chat-container[_ngcontent-%COMP%]{width:100%;height:100%;max-width:1200px;margin:auto}.event-container[_ngcontent-%COMP%]{color:#fff}.drawer-header[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:flex-start;align-items:center}.drawer-header[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{width:36px;height:36px;color:#bdc1c6;cursor:pointer;display:flex;align-items:center;justify-content:center}.chat-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:500px;overflow:hidden;height:95%;box-shadow:none;background-color:#131314}.chat-messages[_ngcontent-%COMP%]{flex-grow:1;overflow-y:auto;padding:20px;margin-top:16px}.message-card[_ngcontent-%COMP%]{padding:5px 20px;margin:5px;border-radius:20px;max-width:80%;font-size:14px;font-weight:400}.user-message[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:center}.user-message[_ngcontent-%COMP%] .message-card[_ngcontent-%COMP%]{background-color:#004a77;align-self:flex-end;color:#fff;box-shadow:none}.bot-message[_ngcontent-%COMP%]{display:flex;align-items:center}.bot-message[_ngcontent-%COMP%] .message-card[_ngcontent-%COMP%]{background-color:#303030;align-self:flex-start;color:#fff;box-shadow:none}.navigation-button-sidepanel[_ngcontent-%COMP%]{margin-left:auto;margin-right:20px}.chat-input[_ngcontent-%COMP%]{display:flex;padding:10px;width:80%;margin:0 auto}.input-field[_ngcontent-%COMP%]{flex-grow:1}.input-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{color:#fff;border:none;padding:10px}.input-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::placeholder{color:#8e918f}.input-field[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:#fff;background-color:#333537}.chat-input-actions[_ngcontent-%COMP%]{margin-top:10px;display:flex;justify-content:space-between}.fab-button[_ngcontent-%COMP%]{position:fixed;bottom:200px;right:100px;z-index:1000}.sidepanel-toggle[_ngcontent-%COMP%]{position:relative;top:100px;z-index:1000}.sidenav[_ngcontent-%COMP%]{background-color:#1b1b1b;color:#fff;border-radius:0}.tabs-container[_ngcontent-%COMP%]{margin-top:20px;padding-left:10px;padding-right:10px}.tab-label[_ngcontent-%COMP%]{font-size:14px}.file-preview[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:5px;margin-top:2px;margin-bottom:8px}.file-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:5px;background:#eee;padding:5px;border-radius:4px}.image-preview[_ngcontent-%COMP%]{width:40px;height:40px;object-fit:cover;border-radius:4px}.image-preview-chat[_ngcontent-%COMP%]{max-width:90%;max-height:70vh;width:auto;height:auto;border-radius:8px;cursor:pointer;transition:transform .2s ease-in-out}button[_ngcontent-%COMP%]{margin-left:20px;margin-right:20px}.app-select[_ngcontent-%COMP%]{width:180px}.empty-state-container[_ngcontent-%COMP%]{color:#eee;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Open Sans,sans-serif;font-weight:400;letter-spacing:normal;line-height:24px;font-size:18px}.empty-state-container[_ngcontent-%COMP%] pre.warning[_ngcontent-%COMP%]{color:#ffc185}.empty-state-container[_ngcontent-%COMP%] pre.error[_ngcontent-%COMP%]{color:#ff4545}.function-event-button[_ngcontent-%COMP%]{background-color:#fff}[_nghost-%COMP%] .mat-mdc-text-field-wrapper{border:1px solid #8e918f}[_nghost-%COMP%] .input-field .mat-mdc-text-field-wrapper{border:1px solid #8e918f;border-radius:16px}[_nghost-%COMP%] .mdc-notched-outline__leading, [_nghost-%COMP%] .mdc-notched-outline__notch, [_nghost-%COMP%] .mdc-notched-outline__trailing{border:none}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{padding:0 10px 0 40px}[_nghost-%COMP%] .segment-key{color:#d3d3d3!important}[_nghost-%COMP%] .mat-mdc-mini-fab{background-color:#fff}[_nghost-%COMP%] .mat-mdc-mini-fab mat-icon{color:#000}[_nghost-%COMP%] .mat-drawer-inner-container{width:500px}.mat-mdc-select-placeholder[_ngcontent-%COMP%]{margin-left:20px}.new-session-button[_ngcontent-%COMP%]{margin-top:0;margin-left:50px;width:130px;height:28px;font-size:14px}.app-select-container[_ngcontent-%COMP%]{background-color:#212123;margin-left:20px;height:30px;display:flex;justify-content:space-between;padding-left:20px;padding-right:20px;border-radius:10px;padding-top:5px;margin-top:-2px}.drawer-header[_ngcontent-%COMP%]{--mat-select-placeholder-text-color: #8ab4f8}.drawer-header[_ngcontent-%COMP%]{--mat-select-enabled-trigger-text-color: #8ab4f8}.drawer-header[_ngcontent-%COMP%]{--mat-select-enabled-arrow-color: #8ab4f8}.event-paginator[_ngcontent-%COMP%]{background-color:inherit;display:flex;justify-content:center}[_nghost-%COMP%] .mat-mdc-paginator-page-size{display:none!important}.details-panel-container[_ngcontent-%COMP%]{position:absolute;height:98%;left:0;right:0;bottom:0;background:#242424;display:inline-block;justify-content:center;align-items:center;z-index:10}.details-content[_ngcontent-%COMP%]{color:#fff;font-size:14px}.event-paginator[_ngcontent-%COMP%]{margin-top:-8px;margin-right:160px}.adk-checkbox[_ngcontent-%COMP%]{position:fixed;bottom:0;left:0;right:0;margin-bottom:20px;margin-left:20px}.drawer-header[_ngcontent-%COMP%]{--mdc-filled-button-container-color: #89b4f8}.drawer-header[_ngcontent-%COMP%]{--mdc-filled-button-label-text-color: black}.chat-toolbar[_ngcontent-%COMP%]{position:sticky;top:0;height:48px;background:#1b1b1b;display:flex;justify-content:space-between;align-items:center;z-index:10}.toolbar-session-text[_ngcontent-%COMP%]{color:#fdfdfd;font-family:Roboto;font-size:12px;font-style:normal;font-weight:500;line-height:12px;letter-spacing:.8px;text-transform:uppercase;margin-left:20px;padding-top:4px}.toolbar-session-id[_ngcontent-%COMP%]{color:#9aa0a6;font-family:monospace;font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:.25px;margin-left:5px}.toolbar-actions[_ngcontent-%COMP%]{display:flex}.toolbar-new-sesison[_ngcontent-%COMP%]{font-size:14px;margin-right:16px;color:#9aa0a6;cursor:pointer;display:flex;align-items:center}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mat-switch-label-text-size: 14px}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mat-switch-label-text-color: #9aa0a6}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-selected-track-color: #8ab4f9}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-selected-focus-track-color: #8ab4f9}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-selected-hover-track-color: #8ab4f9}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-selected-handle-color: #1b73e8}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-selected-focus-handle-color: #1b73e8}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-selected-hover-handle-color: #1b73e8}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-track-height: 24px}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-track-width: 46px}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mat-switch-track-outline-color: #1b73e8}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mat-switch-with-icon-handle-size: 20px}.image-container[_ngcontent-%COMP%]{position:relative;display:inline-block;border-radius:12px;overflow:hidden}.image-preview[_ngcontent-%COMP%]{display:block;width:100%;height:auto;border-radius:12px;width:80px;height:80px}.delete-button[_ngcontent-%COMP%]{position:absolute;top:1px;right:1px;background-color:#000000b3;border:none;border-radius:50%;padding:8px;cursor:pointer;color:#fff;display:flex;align-items:center;justify-content:center;margin-right:0;scale:.7}.delete-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px}.file-container[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;gap:8px;height:80px;background-color:#1e1e1e;border-radius:12px}.file-info[_ngcontent-%COMP%]{margin-right:60px;padding-top:20px;padding-left:16px}"]})};var lr=class t{title="agent_framework_web";userId="";appName="";sessionId="";constructor(){}static \u0275fac=function(A){return new(A||t)};static \u0275cmp=O({type:t,selectors:[["app-root"]],standalone:!1,decls:1,vars:0,template:function(A,i){A&1&&W(0,"app-chat")},dependencies:[Sa],encapsulation:2})};var Bq=[{path:"dev-ui",component:lr},{path:"",redirectTo:"dev-ui",pathMatch:"full"}],jE=class t{static \u0275fac=function(A){return new(A||t)};static \u0275mod=V({type:t});static \u0275inj=q({imports:[VQ.forRoot(Bq),VQ]})};function pb(t){return new U(3e3,!1)}function Qq(){return new U(3100,!1)}function Eq(){return new U(3101,!1)}function cq(t){return new U(3001,!1)}function lq(t){return new U(3003,!1)}function dq(t){return new U(3004,!1)}function Mb(t,e){return new U(3005,!1)}function Rb(){return new U(3006,!1)}function kb(){return new U(3007,!1)}function Fb(t,e){return new U(3008,!1)}function bb(t){return new U(3002,!1)}function Sb(t,e,A,i,o){return new U(3010,!1)}function Nb(){return new U(3011,!1)}function Gb(){return new U(3012,!1)}function vb(){return new U(3200,!1)}function Lb(){return new U(3202,!1)}function Kb(){return new U(3013,!1)}function Ub(t){return new U(3014,!1)}function _b(t){return new U(3015,!1)}function xb(t){return new U(3016,!1)}function Yb(t,e){return new U(3404,!1)}function hq(t){return new U(3502,!1)}function Jb(t){return new U(3503,!1)}function Hb(){return new U(3300,!1)}function Tb(t){return new U(3504,!1)}function Ob(t){return new U(3301,!1)}function Pb(t,e){return new U(3302,!1)}function Zb(t){return new U(3303,!1)}function qb(t,e){return new U(3400,!1)}function Vb(t){return new U(3401,!1)}function Wb(t){return new U(3402,!1)}function zb(t,e){return new U(3505,!1)}function Zo(t){switch(t.length){case 0:return new Bo;case 1:return t[0];default:return new pn(t)}}function hm(t,e,A=new Map,i=new Map){let o=[],g=[],n=-1,s=null;if(e.forEach(r=>{let I=r.get("offset"),B=I==n,c=B&&s||new Map;r.forEach((D,h)=>{let p=h,y=D;if(h!=="offset")switch(p=t.normalizePropertyName(p,o),y){case tr:y=A.get(h);break;case ii:y=i.get(h);break;default:y=t.normalizeStyleValue(h,p,y,o);break}c.set(p,y)}),B||g.push(c),s=c,n=I}),o.length)throw hq(o);return g}function XE(t,e,A,i){switch(e){case"start":t.onStart(()=>i(A&&cm(A,"start",t)));break;case"done":t.onDone(()=>i(A&&cm(A,"done",t)));break;case"destroy":t.onDestroy(()=>i(A&&cm(A,"destroy",t)));break}}function cm(t,e,A){let i=A.totalTime,o=!!A.disabled,g=$E(t.element,t.triggerName,t.fromState,t.toState,e||t.phaseName,i??t.totalTime,o),n=t._data;return n!=null&&(g._data=n),g}function $E(t,e,A,i,o="",g=0,n){return{element:t,triggerName:e,fromState:A,toState:i,phaseName:o,totalTime:g,disabled:!!n}}function Nt(t,e,A){let i=t.get(e);return i||t.set(e,i=A),i}function um(t){let e=t.indexOf(":"),A=t.substring(1,e),i=t.slice(e+1);return[A,i]}var uq=typeof document>"u"?null:document.documentElement;function Ac(t){let e=t.parentNode||t.host||null;return e===uq?null:e}function Dq(t){return t.substring(1,6)=="ebkit"}var Nn=null,yb=!1;function jb(t){Nn||(Nn=mq()||{},yb=Nn.style?"WebkitAppearance"in Nn.style:!1);let e=!0;return Nn.style&&!Dq(t)&&(e=t in Nn.style,!e&&yb&&(e="Webkit"+t.charAt(0).toUpperCase()+t.slice(1)in Nn.style)),e}function mq(){return typeof document<"u"?document.body:null}function Dm(t,e){for(;e;){if(e===t)return!0;e=Ac(e)}return!1}function mm(t,e,A){if(A)return Array.from(t.querySelectorAll(e));let i=t.querySelector(e);return i?[i]:[]}var fq=1e3,fm="{{",wq="}}",wm="ng-enter",ec="ng-leave",Na="ng-trigger",Ga=".ng-trigger",pm="ng-animating",tc=".ng-animating";function mo(t){if(typeof t=="number")return t;let e=t.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:lm(parseFloat(e[1]),e[2])}function lm(t,e){switch(e){case"s":return t*fq;default:return t}}function va(t,e,A){return t.hasOwnProperty("duration")?t:pq(t,e,A)}function pq(t,e,A){let i=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i,o,g=0,n="";if(typeof t=="string"){let s=t.match(i);if(s===null)return e.push(pb(t)),{duration:0,delay:0,easing:""};o=lm(parseFloat(s[1]),s[2]);let r=s[3];r!=null&&(g=lm(parseFloat(r),s[4]));let I=s[5];I&&(n=I)}else o=t;if(!A){let s=!1,r=e.length;o<0&&(e.push(Qq()),s=!0),g<0&&(e.push(Eq()),s=!0),s&&e.splice(r,0,pb(t))}return{duration:o,delay:g,easing:n}}function Xb(t){return t.length?t[0]instanceof Map?t:t.map(e=>new Map(Object.entries(e))):[]}function vi(t,e,A){e.forEach((i,o)=>{let g=ic(o);A&&!A.has(o)&&A.set(o,t.style[g]),t.style[g]=i})}function bg(t,e){e.forEach((A,i)=>{let o=ic(i);t.style[o]=""})}function dr(t){return Array.isArray(t)?t.length==1?t[0]:dk(t):t}function $b(t,e,A){let i=e.params||{},o=ym(t);o.length&&o.forEach(g=>{i.hasOwnProperty(g)||A.push(cq(g))})}var dm=new RegExp(`${fm}\\s*(.+?)\\s*${wq}`,"g");function ym(t){let e=[];if(typeof t=="string"){let A;for(;A=dm.exec(t);)e.push(A[1]);dm.lastIndex=0}return e}function hr(t,e,A){let i=`${t}`,o=i.replace(dm,(g,n)=>{let s=e[n];return s==null&&(A.push(lq(n)),s=""),s.toString()});return o==i?t:o}var yq=/-+([a-z0-9])/g;function ic(t){return t.replace(yq,(...e)=>e[1].toUpperCase())}function AS(t,e){return t===0||e===0}function eS(t,e,A){if(A.size&&e.length){let i=e[0],o=[];if(A.forEach((g,n)=>{i.has(n)||o.push(n),i.set(n,g)}),o.length)for(let g=1;gn.set(s,oc(t,s)))}}return e}function Gt(t,e,A){switch(e.type){case LA.Trigger:return t.visitTrigger(e,A);case LA.State:return t.visitState(e,A);case LA.Transition:return t.visitTransition(e,A);case LA.Sequence:return t.visitSequence(e,A);case LA.Group:return t.visitGroup(e,A);case LA.Animate:return t.visitAnimate(e,A);case LA.Keyframes:return t.visitKeyframes(e,A);case LA.Style:return t.visitStyle(e,A);case LA.Reference:return t.visitReference(e,A);case LA.AnimateChild:return t.visitAnimateChild(e,A);case LA.AnimateRef:return t.visitAnimateRef(e,A);case LA.Query:return t.visitQuery(e,A);case LA.Stagger:return t.visitStagger(e,A);default:throw dq(e.type)}}function oc(t,e){return window.getComputedStyle(t)[e]}var Hm=(()=>{class t{validateStyleProperty(A){return jb(A)}containsElement(A,i){return Dm(A,i)}getParentElement(A){return Ac(A)}query(A,i,o){return mm(A,i,o)}computeStyle(A,i,o){return o||""}animate(A,i,o,g,n,s=[],r){return new Bo(o,g)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=N({token:t,factory:t.\u0275fac})}return t})(),vn=class{static NOOP=new Hm},Ln=class{};var Mq=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"]),Ic=class extends Ln{normalizePropertyName(e,A){return ic(e)}normalizeStyleValue(e,A,i,o){let g="",n=i.toString().trim();if(Mq.has(A)&&i!==0&&i!=="0")if(typeof i=="number")g="px";else{let s=i.match(/^[+-]?[\d\.]+([a-z]*)$/);s&&s[1].length==0&&o.push(Mb(e,i))}return n+g}};var ac="*";function Rq(t,e){let A=[];return typeof t=="string"?t.split(/\s*,\s*/).forEach(i=>kq(i,A,e)):A.push(t),A}function kq(t,e,A){if(t[0]==":"){let r=Fq(t,A);if(typeof r=="function"){e.push(r);return}t=r}let i=t.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(i==null||i.length<4)return A.push(_b(t)),e;let o=i[1],g=i[2],n=i[3];e.push(tS(o,n));let s=o==ac&&n==ac;g[0]=="<"&&!s&&e.push(tS(n,o))}function Fq(t,e){switch(t){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(A,i)=>parseFloat(i)>parseFloat(A);case":decrement":return(A,i)=>parseFloat(i) *"}}var gc=new Set(["true","1"]),nc=new Set(["false","0"]);function tS(t,e){let A=gc.has(t)||nc.has(t),i=gc.has(e)||nc.has(e);return(o,g)=>{let n=t==ac||t==o,s=e==ac||e==g;return!n&&A&&typeof o=="boolean"&&(n=o?gc.has(t):nc.has(t)),!s&&i&&typeof g=="boolean"&&(s=g?gc.has(e):nc.has(e)),n&&s}}var BS=":self",bq=new RegExp(`s*${BS}s*,?`,"g");function QS(t,e,A,i){return new Sm(t).build(e,A,i)}var iS="",Sm=class{_driver;constructor(e){this._driver=e}build(e,A,i){let o=new Nm(A);return this._resetContextStyleTimingState(o),Gt(this,dr(e),o)}_resetContextStyleTimingState(e){e.currentQuerySelector=iS,e.collectedStyles=new Map,e.collectedStyles.set(iS,new Map),e.currentTime=0}visitTrigger(e,A){let i=A.queryCount=0,o=A.depCount=0,g=[],n=[];return e.name.charAt(0)=="@"&&A.errors.push(Rb()),e.definitions.forEach(s=>{if(this._resetContextStyleTimingState(A),s.type==LA.State){let r=s,I=r.name;I.toString().split(/\s*,\s*/).forEach(B=>{r.name=B,g.push(this.visitState(r,A))}),r.name=I}else if(s.type==LA.Transition){let r=this.visitTransition(s,A);i+=r.queryCount,o+=r.depCount,n.push(r)}else A.errors.push(kb())}),{type:LA.Trigger,name:e.name,states:g,transitions:n,queryCount:i,depCount:o,options:null}}visitState(e,A){let i=this.visitStyle(e.styles,A),o=e.options&&e.options.params||null;if(i.containsDynamicStyles){let g=new Set,n=o||{};i.styles.forEach(s=>{s instanceof Map&&s.forEach(r=>{ym(r).forEach(I=>{n.hasOwnProperty(I)||g.add(I)})})}),g.size&&A.errors.push(Fb(e.name,[...g.values()]))}return{type:LA.State,name:e.name,style:i,options:o?{params:o}:null}}visitTransition(e,A){A.queryCount=0,A.depCount=0;let i=Gt(this,dr(e.animation),A),o=Rq(e.expr,A.errors);return{type:LA.Transition,matchers:o,animation:i,queryCount:A.queryCount,depCount:A.depCount,options:Gn(e.options)}}visitSequence(e,A){return{type:LA.Sequence,steps:e.steps.map(i=>Gt(this,i,A)),options:Gn(e.options)}}visitGroup(e,A){let i=A.currentTime,o=0,g=e.steps.map(n=>{A.currentTime=i;let s=Gt(this,n,A);return o=Math.max(o,A.currentTime),s});return A.currentTime=o,{type:LA.Group,steps:g,options:Gn(e.options)}}visitAnimate(e,A){let i=vq(e.timings,A.errors);A.currentAnimateTimings=i;let o,g=e.styles?e.styles:Ge({});if(g.type==LA.Keyframes)o=this.visitKeyframes(g,A);else{let n=e.styles,s=!1;if(!n){s=!0;let I={};i.easing&&(I.easing=i.easing),n=Ge(I)}A.currentTime+=i.duration+i.delay;let r=this.visitStyle(n,A);r.isEmptyStep=s,o=r}return A.currentAnimateTimings=null,{type:LA.Animate,timings:i,style:o,options:null}}visitStyle(e,A){let i=this._makeStyleAst(e,A);return this._validateStyleAst(i,A),i}_makeStyleAst(e,A){let i=[],o=Array.isArray(e.styles)?e.styles:[e.styles];for(let s of o)typeof s=="string"?s===ii?i.push(s):A.errors.push(bb(s)):i.push(new Map(Object.entries(s)));let g=!1,n=null;return i.forEach(s=>{if(s instanceof Map&&(s.has("easing")&&(n=s.get("easing"),s.delete("easing")),!g)){for(let r of s.values())if(r.toString().indexOf(fm)>=0){g=!0;break}}}),{type:LA.Style,styles:i,easing:n,offset:e.offset,containsDynamicStyles:g,options:null}}_validateStyleAst(e,A){let i=A.currentAnimateTimings,o=A.currentTime,g=A.currentTime;i&&g>0&&(g-=i.duration+i.delay),e.styles.forEach(n=>{typeof n!="string"&&n.forEach((s,r)=>{let I=A.collectedStyles.get(A.currentQuerySelector),B=I.get(r),c=!0;B&&(g!=o&&g>=B.startTime&&o<=B.endTime&&(A.errors.push(Sb(r,B.startTime,B.endTime,g,o)),c=!1),g=B.startTime),c&&I.set(r,{startTime:g,endTime:o}),A.options&&$b(s,A.options,A.errors)})})}visitKeyframes(e,A){let i={type:LA.Keyframes,styles:[],options:null};if(!A.currentAnimateTimings)return A.errors.push(Nb()),i;let o=1,g=0,n=[],s=!1,r=!1,I=0,B=e.steps.map(P=>{let mA=this._makeStyleAst(P,A),_A=mA.offset!=null?mA.offset:Gq(mA.styles),fA=0;return _A!=null&&(g++,fA=mA.offset=_A),r=r||fA<0||fA>1,s=s||fA0&&g{let _A=D>0?mA==h?1:D*mA:n[mA],fA=_A*L;A.currentTime=p+y.delay+fA,y.duration=fA,this._validateStyleAst(P,A),P.offset=_A,i.styles.push(P)}),i}visitReference(e,A){return{type:LA.Reference,animation:Gt(this,dr(e.animation),A),options:Gn(e.options)}}visitAnimateChild(e,A){return A.depCount++,{type:LA.AnimateChild,options:Gn(e.options)}}visitAnimateRef(e,A){return{type:LA.AnimateRef,animation:this.visitReference(e.animation,A),options:Gn(e.options)}}visitQuery(e,A){let i=A.currentQuerySelector,o=e.options||{};A.queryCount++,A.currentQuery=e;let[g,n]=Sq(e.selector);A.currentQuerySelector=i.length?i+" "+g:g,Nt(A.collectedStyles,A.currentQuerySelector,new Map);let s=Gt(this,dr(e.animation),A);return A.currentQuery=null,A.currentQuerySelector=i,{type:LA.Query,selector:g,limit:o.limit||0,optional:!!o.optional,includeSelf:n,animation:s,originalSelector:e.selector,options:Gn(e.options)}}visitStagger(e,A){A.currentQuery||A.errors.push(Kb());let i=e.timings==="full"?{duration:0,delay:0,easing:"full"}:va(e.timings,A.errors,!0);return{type:LA.Stagger,animation:Gt(this,dr(e.animation),A),timings:i,options:null}}};function Sq(t){let e=!!t.split(/\s*,\s*/).find(A=>A==BS);return e&&(t=t.replace(bq,"")),t=t.replace(/@\*/g,Ga).replace(/@\w+/g,A=>Ga+"-"+A.slice(1)).replace(/:animating/g,tc),[t,e]}function Nq(t){return t?R({},t):null}var Nm=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 Gq(t){if(typeof t=="string")return null;let e=null;if(Array.isArray(t))t.forEach(A=>{if(A instanceof Map&&A.has("offset")){let i=A;e=parseFloat(i.get("offset")),i.delete("offset")}});else if(t instanceof Map&&t.has("offset")){let A=t;e=parseFloat(A.get("offset")),A.delete("offset")}return e}function vq(t,e){if(t.hasOwnProperty("duration"))return t;if(typeof t=="number"){let g=va(t,e).duration;return Mm(g,0,"")}let A=t;if(A.split(/\s+/).some(g=>g.charAt(0)=="{"&&g.charAt(1)=="{")){let g=Mm(0,0,"");return g.dynamic=!0,g.strValue=A,g}let o=va(A,e);return Mm(o.duration,o.delay,o.easing)}function Gn(t){return t?(t=R({},t),t.params&&(t.params=Nq(t.params))):t={},t}function Mm(t,e,A){return{duration:t,delay:e,easing:A}}function Tm(t,e,A,i,o,g,n=null,s=!1){return{type:1,element:t,keyframes:e,preStyleProps:A,postStyleProps:i,duration:o,delay:g,totalTime:o+g,easing:n,subTimeline:s}}var Ka=class{_map=new Map;get(e){return this._map.get(e)||[]}append(e,A){let i=this._map.get(e);i||this._map.set(e,i=[]),i.push(...A)}has(e){return this._map.has(e)}clear(){this._map.clear()}},Lq=1,Kq=":enter",Uq=new RegExp(Kq,"g"),_q=":leave",xq=new RegExp(_q,"g");function ES(t,e,A,i,o,g=new Map,n=new Map,s,r,I=[]){return new Gm().buildKeyframes(t,e,A,i,o,g,n,s,r,I)}var Gm=class{buildKeyframes(e,A,i,o,g,n,s,r,I,B=[]){I=I||new Ka;let c=new vm(e,A,I,o,g,B,[]);c.options=r;let D=r.delay?mo(r.delay):0;c.currentTimeline.delayNextStep(D),c.currentTimeline.setStyles([n],null,c.errors,r),Gt(this,i,c);let h=c.timelines.filter(p=>p.containsAnimation());if(h.length&&s.size){let p;for(let y=h.length-1;y>=0;y--){let L=h[y];if(L.element===A){p=L;break}}p&&!p.allowOnlyTimelineStyles()&&p.setStyles([s],null,c.errors,r)}return h.length?h.map(p=>p.buildKeyframes()):[Tm(A,[],[],[],0,D,"",!1)]}visitTrigger(e,A){}visitState(e,A){}visitTransition(e,A){}visitAnimateChild(e,A){let i=A.subInstructions.get(A.element);if(i){let o=A.createSubContext(e.options),g=A.currentTimeline.currentTime,n=this._visitSubInstructions(i,o,o.options);g!=n&&A.transformIntoNewTimeline(n)}A.previousNode=e}visitAnimateRef(e,A){let i=A.createSubContext(e.options);i.transformIntoNewTimeline(),this._applyAnimationRefDelays([e.options,e.animation.options],A,i),this.visitReference(e.animation,i),A.transformIntoNewTimeline(i.currentTimeline.currentTime),A.previousNode=e}_applyAnimationRefDelays(e,A,i){for(let o of e){let g=o?.delay;if(g){let n=typeof g=="number"?g:mo(hr(g,o?.params??{},A.errors));i.delayNextStep(n)}}}_visitSubInstructions(e,A,i){let g=A.currentTimeline.currentTime,n=i.duration!=null?mo(i.duration):null,s=i.delay!=null?mo(i.delay):null;return n!==0&&e.forEach(r=>{let I=A.appendInstructionToTimeline(r,n,s);g=Math.max(g,I.duration+I.delay)}),g}visitReference(e,A){A.updateOptions(e.options,!0),Gt(this,e.animation,A),A.previousNode=e}visitSequence(e,A){let i=A.subContextCount,o=A,g=e.options;if(g&&(g.params||g.delay)&&(o=A.createSubContext(g),o.transformIntoNewTimeline(),g.delay!=null)){o.previousNode.type==LA.Style&&(o.currentTimeline.snapshotCurrentStyles(),o.previousNode=Cc);let n=mo(g.delay);o.delayNextStep(n)}e.steps.length&&(e.steps.forEach(n=>Gt(this,n,o)),o.currentTimeline.applyStylesToKeyframe(),o.subContextCount>i&&o.transformIntoNewTimeline()),A.previousNode=e}visitGroup(e,A){let i=[],o=A.currentTimeline.currentTime,g=e.options&&e.options.delay?mo(e.options.delay):0;e.steps.forEach(n=>{let s=A.createSubContext(e.options);g&&s.delayNextStep(g),Gt(this,n,s),o=Math.max(o,s.currentTimeline.currentTime),i.push(s.currentTimeline)}),i.forEach(n=>A.currentTimeline.mergeTimelineCollectedStyles(n)),A.transformIntoNewTimeline(o),A.previousNode=e}_visitTiming(e,A){if(e.dynamic){let i=e.strValue,o=A.params?hr(i,A.params,A.errors):i;return va(o,A.errors)}else return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,A){let i=A.currentAnimateTimings=this._visitTiming(e.timings,A),o=A.currentTimeline;i.delay&&(A.incrementTime(i.delay),o.snapshotCurrentStyles());let g=e.style;g.type==LA.Keyframes?this.visitKeyframes(g,A):(A.incrementTime(i.duration),this.visitStyle(g,A),o.applyStylesToKeyframe()),A.currentAnimateTimings=null,A.previousNode=e}visitStyle(e,A){let i=A.currentTimeline,o=A.currentAnimateTimings;!o&&i.hasCurrentStyleProperties()&&i.forwardFrame();let g=o&&o.easing||e.easing;e.isEmptyStep?i.applyEmptyStep(g):i.setStyles(e.styles,g,A.errors,A.options),A.previousNode=e}visitKeyframes(e,A){let i=A.currentAnimateTimings,o=A.currentTimeline.duration,g=i.duration,s=A.createSubContext().currentTimeline;s.easing=i.easing,e.styles.forEach(r=>{let I=r.offset||0;s.forwardTime(I*g),s.setStyles(r.styles,r.easing,A.errors,A.options),s.applyStylesToKeyframe()}),A.currentTimeline.mergeTimelineCollectedStyles(s),A.transformIntoNewTimeline(o+g),A.previousNode=e}visitQuery(e,A){let i=A.currentTimeline.currentTime,o=e.options||{},g=o.delay?mo(o.delay):0;g&&(A.previousNode.type===LA.Style||i==0&&A.currentTimeline.hasCurrentStyleProperties())&&(A.currentTimeline.snapshotCurrentStyles(),A.previousNode=Cc);let n=i,s=A.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!o.optional,A.errors);A.currentQueryTotal=s.length;let r=null;s.forEach((I,B)=>{A.currentQueryIndex=B;let c=A.createSubContext(e.options,I);g&&c.delayNextStep(g),I===A.element&&(r=c.currentTimeline),Gt(this,e.animation,c),c.currentTimeline.applyStylesToKeyframe();let D=c.currentTimeline.currentTime;n=Math.max(n,D)}),A.currentQueryIndex=0,A.currentQueryTotal=0,A.transformIntoNewTimeline(n),r&&(A.currentTimeline.mergeTimelineCollectedStyles(r),A.currentTimeline.snapshotCurrentStyles()),A.previousNode=e}visitStagger(e,A){let i=A.parentContext,o=A.currentTimeline,g=e.timings,n=Math.abs(g.duration),s=n*(A.currentQueryTotal-1),r=n*A.currentQueryIndex;switch(g.duration<0?"reverse":g.easing){case"reverse":r=s-r;break;case"full":r=i.currentStaggerTime;break}let B=A.currentTimeline;r&&B.delayNextStep(r);let c=B.currentTime;Gt(this,e.animation,A),A.previousNode=e,i.currentStaggerTime=o.currentTime-c+(o.startTime-i.currentTimeline.startTime)}},Cc={},vm=class t{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=Cc;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(e,A,i,o,g,n,s,r){this._driver=e,this.element=A,this.subInstructions=i,this._enterClassName=o,this._leaveClassName=g,this.errors=n,this.timelines=s,this.currentTimeline=r||new Bc(this._driver,A,0),s.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,A){if(!e)return;let i=e,o=this.options;i.duration!=null&&(o.duration=mo(i.duration)),i.delay!=null&&(o.delay=mo(i.delay));let g=i.params;if(g){let n=o.params;n||(n=this.options.params={}),Object.keys(g).forEach(s=>{(!A||!n.hasOwnProperty(s))&&(n[s]=hr(g[s],n,this.errors))})}}_copyOptions(){let e={};if(this.options){let A=this.options.params;if(A){let i=e.params={};Object.keys(A).forEach(o=>{i[o]=A[o]})}}return e}createSubContext(e=null,A,i){let o=A||this.element,g=new t(this._driver,o,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(o,i||0));return g.previousNode=this.previousNode,g.currentAnimateTimings=this.currentAnimateTimings,g.options=this._copyOptions(),g.updateOptions(e),g.currentQueryIndex=this.currentQueryIndex,g.currentQueryTotal=this.currentQueryTotal,g.parentContext=this,this.subContextCount++,g}transformIntoNewTimeline(e){return this.previousNode=Cc,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,A,i){let o={duration:A??e.duration,delay:this.currentTimeline.currentTime+(i??0)+e.delay,easing:""},g=new Lm(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,o,e.stretchStartingKeyframe);return this.timelines.push(g),o}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,A,i,o,g,n){let s=[];if(o&&s.push(this.element),e.length>0){e=e.replace(Uq,"."+this._enterClassName),e=e.replace(xq,"."+this._leaveClassName);let r=i!=1,I=this._driver.query(this.element,e,r);i!==0&&(I=i<0?I.slice(I.length+i,I.length):I.slice(0,i)),s.push(...I)}return!g&&s.length==0&&n.push(Ub(A)),s}},Bc=class t{_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,A,i,o){this._driver=e,this.element=A,this.startTime=i,this._elementTimelineStylesLookup=o,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(A),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(A,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 A=this._keyframes.size===1&&this._pendingStyles.size;this.duration||A?(this.forwardTime(this.currentTime+e),A&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,A){return this.applyStylesToKeyframe(),new t(this._driver,e,A||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+=Lq,this._loadKeyframe()}forwardTime(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,A){this._localTimelineStyles.set(e,A),this._globalTimelineStyles.set(e,A),this._styleSummary.set(e,{time:this.currentTime,value:A})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&this._previousKeyframe.set("easing",e);for(let[A,i]of this._globalTimelineStyles)this._backFill.set(A,i||ii),this._currentKeyframe.set(A,ii);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,A,i,o){A&&this._previousKeyframe.set("easing",A);let g=o&&o.params||{},n=Yq(e,this._globalTimelineStyles);for(let[s,r]of n){let I=hr(r,g,i);this._pendingStyles.set(s,I),this._localTimelineStyles.has(s)||this._backFill.set(s,this._globalTimelineStyles.get(s)??ii),this._updateStyle(s,I)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((e,A)=>{this._currentKeyframe.set(A,e)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((e,A)=>{this._currentKeyframe.has(A)||this._currentKeyframe.set(A,e)}))}snapshotCurrentStyles(){for(let[e,A]of this._localTimelineStyles)this._pendingStyles.set(e,A),this._updateStyle(e,A)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let e=[];for(let A in this._currentKeyframe)e.push(A);return e}mergeTimelineCollectedStyles(e){e._styleSummary.forEach((A,i)=>{let o=this._styleSummary.get(i);(!o||A.time>o.time)&&this._updateStyle(i,A.value)})}buildKeyframes(){this.applyStylesToKeyframe();let e=new Set,A=new Set,i=this._keyframes.size===1&&this.duration===0,o=[];this._keyframes.forEach((s,r)=>{let I=new Map([...this._backFill,...s]);I.forEach((B,c)=>{B===tr?e.add(c):B===ii&&A.add(c)}),i||I.set("offset",r/this.duration),o.push(I)});let g=[...e.values()],n=[...A.values()];if(i){let s=o[0],r=new Map(s);s.set("offset",0),r.set("offset",1),o=[s,r]}return Tm(this.element,o,g,n,this.duration,this.startTime,this.easing,!1)}},Lm=class extends Bc{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(e,A,i,o,g,n,s=!1){super(e,A,n.delay),this.keyframes=i,this.preStyleProps=o,this.postStyleProps=g,this._stretchStartingKeyframe=s,this.timings={duration:n.duration,delay:n.delay,easing:n.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:A,duration:i,easing:o}=this.timings;if(this._stretchStartingKeyframe&&A){let g=[],n=i+A,s=A/n,r=new Map(e[0]);r.set("offset",0),g.push(r);let I=new Map(e[0]);I.set("offset",oS(s)),g.push(I);let B=e.length-1;for(let c=1;c<=B;c++){let D=new Map(e[c]),h=D.get("offset"),p=A+h*i;D.set("offset",oS(p/n)),g.push(D)}i=n,A=0,o="",e=g}return Tm(this.element,e,this.preStyleProps,this.postStyleProps,i,A,o,!0)}};function oS(t,e=3){let A=Math.pow(10,e-1);return Math.round(t*A)/A}function Yq(t,e){let A=new Map,i;return t.forEach(o=>{if(o==="*"){i??=e.keys();for(let g of i)A.set(g,ii)}else for(let[g,n]of o)A.set(g,n)}),A}function gS(t,e,A,i,o,g,n,s,r,I,B,c,D){return{type:0,element:t,triggerName:e,isRemovalTransition:o,fromState:A,fromStyles:g,toState:i,toStyles:n,timelines:s,queriedElements:r,preStyleProps:I,postStyleProps:B,totalTime:c,errors:D}}var Rm={},Qc=class{_triggerName;ast;_stateStyles;constructor(e,A,i){this._triggerName=e,this.ast=A,this._stateStyles=i}match(e,A,i,o){return Jq(this.ast.matchers,e,A,i,o)}buildStyles(e,A,i){let o=this._stateStyles.get("*");return e!==void 0&&(o=this._stateStyles.get(e?.toString())||o),o?o.buildStyles(A,i):new Map}build(e,A,i,o,g,n,s,r,I,B){let c=[],D=this.ast.options&&this.ast.options.params||Rm,h=s&&s.params||Rm,p=this.buildStyles(i,h,c),y=r&&r.params||Rm,L=this.buildStyles(o,y,c),P=new Set,mA=new Map,_A=new Map,fA=o==="void",Qt={params:cS(y,D),delay:this.ast.options?.delay},ue=B?[]:ES(e,A,this.ast.animation,g,n,p,L,Qt,I,c),pe=0;return ue.forEach(le=>{pe=Math.max(le.duration+le.delay,pe)}),c.length?gS(A,this._triggerName,i,o,fA,p,L,[],[],mA,_A,pe,c):(ue.forEach(le=>{let ni=le.element,fo=Nt(mA,ni,new Set);le.preStyleProps.forEach(Ui=>fo.add(Ui));let Ki=Nt(_A,ni,new Set);le.postStyleProps.forEach(Ui=>Ki.add(Ui)),ni!==A&&P.add(ni)}),gS(A,this._triggerName,i,o,fA,p,L,ue,[...P.values()],mA,_A,pe))}};function Jq(t,e,A,i,o){return t.some(g=>g(e,A,i,o))}function cS(t,e){let A=R({},e);return Object.entries(t).forEach(([i,o])=>{o!=null&&(A[i]=o)}),A}var Km=class{styles;defaultParams;normalizer;constructor(e,A,i){this.styles=e,this.defaultParams=A,this.normalizer=i}buildStyles(e,A){let i=new Map,o=cS(e,this.defaultParams);return this.styles.styles.forEach(g=>{typeof g!="string"&&g.forEach((n,s)=>{n&&(n=hr(n,o,A));let r=this.normalizer.normalizePropertyName(s,A);n=this.normalizer.normalizeStyleValue(s,r,n,A),i.set(s,n)})}),i}};function Hq(t,e,A){return new Um(t,e,A)}var Um=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(e,A,i){this.name=e,this.ast=A,this._normalizer=i,A.states.forEach(o=>{let g=o.options&&o.options.params||{};this.states.set(o.name,new Km(o.style,g,i))}),nS(this.states,"true","1"),nS(this.states,"false","0"),A.transitions.forEach(o=>{this.transitionFactories.push(new Qc(e,o,this.states))}),this.fallbackTransition=Tq(e,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,A,i,o){return this.transitionFactories.find(n=>n.match(e,A,i,o))||null}matchStyles(e,A,i){return this.fallbackTransition.buildStyles(e,A,i)}};function Tq(t,e,A){let i=[(n,s)=>!0],o={type:LA.Sequence,steps:[],options:null},g={type:LA.Transition,animation:o,matchers:i,options:null,queryCount:0,depCount:0};return new Qc(t,g,e)}function nS(t,e,A){t.has(e)?t.has(A)||t.set(A,t.get(e)):t.has(A)&&t.set(e,t.get(A))}var Oq=new Ka,_m=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(e,A,i){this.bodyNode=e,this._driver=A,this._normalizer=i}register(e,A){let i=[],o=[],g=QS(this._driver,A,i,o);if(i.length)throw Jb(i);this._animations.set(e,g)}_buildPlayer(e,A,i){let o=e.element,g=hm(this._normalizer,e.keyframes,A,i);return this._driver.animate(o,g,e.duration,e.delay,e.easing,[],!0)}create(e,A,i={}){let o=[],g=this._animations.get(e),n,s=new Map;if(g?(n=ES(this._driver,A,g,wm,ec,new Map,new Map,i,Oq,o),n.forEach(B=>{let c=Nt(s,B.element,new Map);B.postStyleProps.forEach(D=>c.set(D,null))})):(o.push(Hb()),n=[]),o.length)throw Tb(o);s.forEach((B,c)=>{B.forEach((D,h)=>{B.set(h,this._driver.computeStyle(c,h,ii))})});let r=n.map(B=>{let c=s.get(B.element);return this._buildPlayer(B,new Map,c)}),I=Zo(r);return this._playersById.set(e,I),I.onDestroy(()=>this.destroy(e)),this.players.push(I),I}destroy(e){let A=this._getPlayer(e);A.destroy(),this._playersById.delete(e);let i=this.players.indexOf(A);i>=0&&this.players.splice(i,1)}_getPlayer(e){let A=this._playersById.get(e);if(!A)throw Ob(e);return A}listen(e,A,i,o){let g=$E(A,"","","");return XE(this._getPlayer(e),i,g,o),()=>{}}command(e,A,i,o){if(i=="register"){this.register(e,o[0]);return}if(i=="create"){let n=o[0]||{};this.create(e,A,n);return}let g=this._getPlayer(e);switch(i){case"play":g.play();break;case"pause":g.pause();break;case"reset":g.reset();break;case"restart":g.restart();break;case"finish":g.finish();break;case"init":g.init();break;case"setPosition":g.setPosition(parseFloat(o[0]));break;case"destroy":this.destroy(e);break}}},sS="ng-animate-queued",Pq=".ng-animate-queued",km="ng-animate-disabled",Zq=".ng-animate-disabled",qq="ng-star-inserted",Vq=".ng-star-inserted",Wq=[],lS={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},zq={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Li="__ng_removed",Ua=class{namespaceId;value;options;get params(){return this.options.params}constructor(e,A=""){this.namespaceId=A;let i=e&&e.hasOwnProperty("value"),o=i?e.value:e;if(this.value=Xq(o),i){let g=e,{value:n}=g,s=mc(g,["value"]);this.options=s}else this.options={};this.options.params||(this.options.params={})}absorbOptions(e){let A=e.params;if(A){let i=this.options.params;Object.keys(A).forEach(o=>{i[o]==null&&(i[o]=A[o])})}}},La="void",Fm=new Ua(La),xm=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(e,A,i){this.id=e,this.hostElement=A,this._engine=i,this._hostClassName="ng-tns-"+e,gi(A,this._hostClassName)}listen(e,A,i,o){if(!this._triggers.has(A))throw Pb(i,A);if(i==null||i.length==0)throw Zb(A);if(!$q(i))throw qb(i,A);let g=Nt(this._elementListeners,e,[]),n={name:A,phase:i,callback:o};g.push(n);let s=Nt(this._engine.statesByElement,e,new Map);return s.has(A)||(gi(e,Na),gi(e,Na+"-"+A),s.set(A,Fm)),()=>{this._engine.afterFlush(()=>{let r=g.indexOf(n);r>=0&&g.splice(r,1),this._triggers.has(A)||s.delete(A)})}}register(e,A){return this._triggers.has(e)?!1:(this._triggers.set(e,A),!0)}_getTrigger(e){let A=this._triggers.get(e);if(!A)throw Vb(e);return A}trigger(e,A,i,o=!0){let g=this._getTrigger(A),n=new _a(this.id,A,e),s=this._engine.statesByElement.get(e);s||(gi(e,Na),gi(e,Na+"-"+A),this._engine.statesByElement.set(e,s=new Map));let r=s.get(A),I=new Ua(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&r&&I.absorbOptions(r.options),s.set(A,I),r||(r=Fm),!(I.value===La)&&r.value===I.value){if(!t1(r.params,I.params)){let y=[],L=g.matchStyles(r.value,r.params,y),P=g.matchStyles(I.value,I.params,y);y.length?this._engine.reportError(y):this._engine.afterFlush(()=>{bg(e,L),vi(e,P)})}return}let D=Nt(this._engine.playersByElement,e,[]);D.forEach(y=>{y.namespaceId==this.id&&y.triggerName==A&&y.queued&&y.destroy()});let h=g.matchTransition(r.value,I.value,e,I.params),p=!1;if(!h){if(!o)return;h=g.fallbackTransition,p=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:A,transition:h,fromState:r,toState:I,player:n,isFallbackTransition:p}),p||(gi(e,sS),n.onStart(()=>{ur(e,sS)})),n.onDone(()=>{let y=this.players.indexOf(n);y>=0&&this.players.splice(y,1);let L=this._engine.playersByElement.get(e);if(L){let P=L.indexOf(n);P>=0&&L.splice(P,1)}}),this.players.push(n),D.push(n),n}deregister(e){this._triggers.delete(e),this._engine.statesByElement.forEach(A=>A.delete(e)),this._elementListeners.forEach((A,i)=>{this._elementListeners.set(i,A.filter(o=>o.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);let A=this._engine.playersByElement.get(e);A&&(A.forEach(i=>i.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,A){let i=this._engine.driver.query(e,Ga,!0);i.forEach(o=>{if(o[Li])return;let g=this._engine.fetchNamespacesByElement(o);g.size?g.forEach(n=>n.triggerLeaveAnimation(o,A,!1,!0)):this.clearElementCache(o)}),this._engine.afterFlushAnimationsDone(()=>i.forEach(o=>this.clearElementCache(o)))}triggerLeaveAnimation(e,A,i,o){let g=this._engine.statesByElement.get(e),n=new Map;if(g){let s=[];if(g.forEach((r,I)=>{if(n.set(I,r.value),this._triggers.has(I)){let B=this.trigger(e,I,La,o);B&&s.push(B)}}),s.length)return this._engine.markElementAsRemoved(this.id,e,!0,A,n),i&&Zo(s).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){let A=this._elementListeners.get(e),i=this._engine.statesByElement.get(e);if(A&&i){let o=new Set;A.forEach(g=>{let n=g.name;if(o.has(n))return;o.add(n);let r=this._triggers.get(n).fallbackTransition,I=i.get(n)||Fm,B=new Ua(La),c=new _a(this.id,n,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:n,transition:r,fromState:I,toState:B,player:c,isFallbackTransition:!0})})}}removeNode(e,A){let i=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,A),this.triggerLeaveAnimation(e,A,!0))return;let o=!1;if(i.totalAnimations){let g=i.players.length?i.playersByQueriedElement.get(e):[];if(g&&g.length)o=!0;else{let n=e;for(;n=n.parentNode;)if(i.statesByElement.get(n)){o=!0;break}}}if(this.prepareLeaveAnimationListeners(e),o)i.markElementAsRemoved(this.id,e,!1,A);else{let g=e[Li];(!g||g===lS)&&(i.afterFlush(()=>this.clearElementCache(e)),i.destroyInnerAnimations(e),i._onRemovalComplete(e,A))}}insertNode(e,A){gi(e,this._hostClassName)}drainQueuedTransitions(e){let A=[];return this._queue.forEach(i=>{let o=i.player;if(o.destroyed)return;let g=i.element,n=this._elementListeners.get(g);n&&n.forEach(s=>{if(s.name==i.triggerName){let r=$E(g,i.triggerName,i.fromState.value,i.toState.value);r._data=e,XE(i.player,s.phase,r,s.callback)}}),o.markedForDestroy?this._engine.afterFlush(()=>{o.destroy()}):A.push(i)}),this._queue=[],A.sort((i,o)=>{let g=i.transition.ast.depCount,n=o.transition.ast.depCount;return g==0||n==0?g-n:this._engine.driver.containsElement(i.element,o.element)?1:-1})}destroy(e){this.players.forEach(A=>A.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}},Ym=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,A)=>{};_onRemovalComplete(e,A){this.onRemovalComplete(e,A)}constructor(e,A,i){this.bodyNode=e,this.driver=A,this._normalizer=i}get queuedPlayers(){let e=[];return this._namespaceList.forEach(A=>{A.players.forEach(i=>{i.queued&&e.push(i)})}),e}createNamespace(e,A){let i=new xm(e,A,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,A)?this._balanceNamespaceList(i,A):(this.newHostElements.set(A,i),this.collectEnterElement(A)),this._namespaceLookup[e]=i}_balanceNamespaceList(e,A){let i=this._namespaceList,o=this.namespacesByHostElement;if(i.length-1>=0){let n=!1,s=this.driver.getParentElement(A);for(;s;){let r=o.get(s);if(r){let I=i.indexOf(r);i.splice(I+1,0,e),n=!0;break}s=this.driver.getParentElement(s)}n||i.unshift(e)}else i.push(e);return o.set(A,e),e}register(e,A){let i=this._namespaceLookup[e];return i||(i=this.createNamespace(e,A)),i}registerTrigger(e,A,i){let o=this._namespaceLookup[e];o&&o.register(A,i)&&this.totalAnimations++}destroy(e,A){e&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let i=this._fetchNamespace(e);this.namespacesByHostElement.delete(i.hostElement);let o=this._namespaceList.indexOf(i);o>=0&&this._namespaceList.splice(o,1),i.destroy(A),delete this._namespaceLookup[e]}))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){let A=new Set,i=this.statesByElement.get(e);if(i){for(let o of i.values())if(o.namespaceId){let g=this._fetchNamespace(o.namespaceId);g&&A.add(g)}}return A}trigger(e,A,i,o){if(sc(A)){let g=this._fetchNamespace(e);if(g)return g.trigger(A,i,o),!0}return!1}insertNode(e,A,i,o){if(!sc(A))return;let g=A[Li];if(g&&g.setForRemoval){g.setForRemoval=!1,g.setForMove=!0;let n=this.collectedLeaveElements.indexOf(A);n>=0&&this.collectedLeaveElements.splice(n,1)}if(e){let n=this._fetchNamespace(e);n&&n.insertNode(A,i)}o&&this.collectEnterElement(A)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,A){A?this.disabledNodes.has(e)||(this.disabledNodes.add(e),gi(e,km)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),ur(e,km))}removeNode(e,A,i){if(sc(A)){let o=e?this._fetchNamespace(e):null;o?o.removeNode(A,i):this.markElementAsRemoved(e,A,!1,i);let g=this.namespacesByHostElement.get(A);g&&g.id!==e&&g.removeNode(A,i)}else this._onRemovalComplete(A,i)}markElementAsRemoved(e,A,i,o,g){this.collectedLeaveElements.push(A),A[Li]={namespaceId:e,setForRemoval:o,hasAnimation:i,removedBeforeQueried:!1,previousTriggersValues:g}}listen(e,A,i,o,g){return sc(A)?this._fetchNamespace(e).listen(A,i,o,g):()=>{}}_buildInstruction(e,A,i,o,g){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,i,o,e.fromState.options,e.toState.options,A,g)}destroyInnerAnimations(e){let A=this.driver.query(e,Ga,!0);A.forEach(i=>this.destroyActiveAnimationsForElement(i)),this.playersByQueriedElement.size!=0&&(A=this.driver.query(e,tc,!0),A.forEach(i=>this.finishActiveQueriedAnimationOnElement(i)))}destroyActiveAnimationsForElement(e){let A=this.playersByElement.get(e);A&&A.forEach(i=>{i.queued?i.markedForDestroy=!0:i.destroy()})}finishActiveQueriedAnimationOnElement(e){let A=this.playersByQueriedElement.get(e);A&&A.forEach(i=>i.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return Zo(this.players).onDone(()=>e());e()})}processLeaveNode(e){let A=e[Li];if(A&&A.setForRemoval){if(e[Li]=lS,A.namespaceId){this.destroyInnerAnimations(e);let i=this._fetchNamespace(A.namespaceId);i&&i.clearElementCache(e)}this._onRemovalComplete(e,A.setForRemoval)}e.classList?.contains(km)&&this.markElementAsDisabled(e,!1),this.driver.query(e,Zq,!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(e=-1){let A=[];if(this.newHostElements.size&&(this.newHostElements.forEach((i,o)=>this._balanceNamespaceList(i,o)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let i=0;ii()),this._flushFns=[],this._whenQuietFns.length){let i=this._whenQuietFns;this._whenQuietFns=[],A.length?Zo(A).onDone(()=>{i.forEach(o=>o())}):i.forEach(o=>o())}}reportError(e){throw Wb(e)}_flushAnimations(e,A){let i=new Ka,o=[],g=new Map,n=[],s=new Map,r=new Map,I=new Map,B=new Set;this.disabledNodes.forEach(E=>{B.add(E);let eA=this.driver.query(E,Pq,!0);for(let uA=0;uA{let uA=wm+y++;p.set(eA,uA),E.forEach(TA=>gi(TA,uA))});let L=[],P=new Set,mA=new Set;for(let E=0;EP.add(TA)):mA.add(eA))}let _A=new Map,fA=aS(D,Array.from(P));fA.forEach((E,eA)=>{let uA=ec+y++;_A.set(eA,uA),E.forEach(TA=>gi(TA,uA))}),e.push(()=>{h.forEach((E,eA)=>{let uA=p.get(eA);E.forEach(TA=>ur(TA,uA))}),fA.forEach((E,eA)=>{let uA=_A.get(eA);E.forEach(TA=>ur(TA,uA))}),L.forEach(E=>{this.processLeaveNode(E)})});let Qt=[],ue=[];for(let E=this._namespaceList.length-1;E>=0;E--)this._namespaceList[E].drainQueuedTransitions(A).forEach(uA=>{let TA=uA.player,Re=uA.element;if(Qt.push(TA),this.collectedEnterElements.length){let Ue=Re[Li];if(Ue&&Ue.setForMove){if(Ue.previousTriggersValues&&Ue.previousTriggersValues.has(uA.triggerName)){let _i=Ue.previousTriggersValues.get(uA.triggerName),st=this.statesByElement.get(uA.element);if(st&&st.has(uA.triggerName)){let Sg=st.get(uA.triggerName);Sg.value=_i,st.set(uA.triggerName,Sg)}}TA.destroy();return}}let We=!c||!this.driver.containsElement(c,Re),nt=_A.get(Re),Wt=p.get(Re),oe=this._buildInstruction(uA,i,Wt,nt,We);if(oe.errors&&oe.errors.length){ue.push(oe);return}if(We){TA.onStart(()=>bg(Re,oe.fromStyles)),TA.onDestroy(()=>vi(Re,oe.toStyles)),o.push(TA);return}if(uA.isFallbackTransition){TA.onStart(()=>bg(Re,oe.fromStyles)),TA.onDestroy(()=>vi(Re,oe.toStyles)),o.push(TA);return}let Ya=[];oe.timelines.forEach(Ue=>{Ue.stretchStartingKeyframe=!0,this.disabledNodes.has(Ue.element)||Ya.push(Ue)}),oe.timelines=Ya,i.append(Re,oe.timelines);let Ja={instruction:oe,player:TA,element:Re};n.push(Ja),oe.queriedElements.forEach(Ue=>Nt(s,Ue,[]).push(TA)),oe.preStyleProps.forEach((Ue,_i)=>{if(Ue.size){let st=r.get(_i);st||r.set(_i,st=new Set),Ue.forEach((Sg,mr)=>st.add(mr))}}),oe.postStyleProps.forEach((Ue,_i)=>{let st=I.get(_i);st||I.set(_i,st=new Set),Ue.forEach((Sg,mr)=>st.add(mr))})});if(ue.length){let E=[];ue.forEach(eA=>{E.push(zb(eA.triggerName,eA.errors))}),Qt.forEach(eA=>eA.destroy()),this.reportError(E)}let pe=new Map,le=new Map;n.forEach(E=>{let eA=E.element;i.has(eA)&&(le.set(eA,eA),this._beforeAnimationBuild(E.player.namespaceId,E.instruction,pe))}),o.forEach(E=>{let eA=E.element;this._getPreviousPlayers(eA,!1,E.namespaceId,E.triggerName,null).forEach(TA=>{Nt(pe,eA,[]).push(TA),TA.destroy()})});let ni=L.filter(E=>CS(E,r,I)),fo=new Map;IS(fo,this.driver,mA,I,ii).forEach(E=>{CS(E,r,I)&&ni.push(E)});let Ui=new Map;h.forEach((E,eA)=>{IS(Ui,this.driver,new Set(E),r,tr)}),ni.forEach(E=>{let eA=fo.get(E),uA=Ui.get(E);fo.set(E,new Map([...eA?.entries()??[],...uA?.entries()??[]]))});let Kn=[],UA=[],Un={};n.forEach(E=>{let{element:eA,player:uA,instruction:TA}=E;if(i.has(eA)){if(B.has(eA)){uA.onDestroy(()=>vi(eA,TA.toStyles)),uA.disabled=!0,uA.overrideTotalTime(TA.totalTime),o.push(uA);return}let Re=Un;if(le.size>1){let nt=eA,Wt=[];for(;nt=nt.parentNode;){let oe=le.get(nt);if(oe){Re=oe;break}Wt.push(nt)}Wt.forEach(oe=>le.set(oe,Re))}let We=this._buildAnimation(uA.namespaceId,TA,pe,g,Ui,fo);if(uA.setRealPlayer(We),Re===Un)Kn.push(uA);else{let nt=this.playersByElement.get(Re);nt&&nt.length&&(uA.parentPlayer=Zo(nt)),o.push(uA)}}else bg(eA,TA.fromStyles),uA.onDestroy(()=>vi(eA,TA.toStyles)),UA.push(uA),B.has(eA)&&o.push(uA)}),UA.forEach(E=>{let eA=g.get(E.element);if(eA&&eA.length){let uA=Zo(eA);E.setRealPlayer(uA)}}),o.forEach(E=>{E.parentPlayer?E.syncPlayerEvents(E.parentPlayer):E.destroy()});for(let E=0;E!We.destroyed);Re.length?A1(this,eA,Re):this.processLeaveNode(eA)}return L.length=0,Kn.forEach(E=>{this.players.push(E),E.onDone(()=>{E.destroy();let eA=this.players.indexOf(E);this.players.splice(eA,1)}),E.play()}),Kn}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,A,i,o,g){let n=[];if(A){let s=this.playersByQueriedElement.get(e);s&&(n=s)}else{let s=this.playersByElement.get(e);if(s){let r=!g||g==La;s.forEach(I=>{I.queued||!r&&I.triggerName!=o||n.push(I)})}}return(i||o)&&(n=n.filter(s=>!(i&&i!=s.namespaceId||o&&o!=s.triggerName))),n}_beforeAnimationBuild(e,A,i){let o=A.triggerName,g=A.element,n=A.isRemovalTransition?void 0:e,s=A.isRemovalTransition?void 0:o;for(let r of A.timelines){let I=r.element,B=I!==g,c=Nt(i,I,[]);this._getPreviousPlayers(I,B,n,s,A.toState).forEach(h=>{let p=h.getRealPlayer();p.beforeDestroy&&p.beforeDestroy(),h.destroy(),c.push(h)})}bg(g,A.fromStyles)}_buildAnimation(e,A,i,o,g,n){let s=A.triggerName,r=A.element,I=[],B=new Set,c=new Set,D=A.timelines.map(p=>{let y=p.element;B.add(y);let L=y[Li];if(L&&L.removedBeforeQueried)return new Bo(p.duration,p.delay);let P=y!==r,mA=e1((i.get(y)||Wq).map(pe=>pe.getRealPlayer())).filter(pe=>{let le=pe;return le.element?le.element===y:!1}),_A=g.get(y),fA=n.get(y),Qt=hm(this._normalizer,p.keyframes,_A,fA),ue=this._buildPlayer(p,Qt,mA);if(p.subTimeline&&o&&c.add(y),P){let pe=new _a(e,s,y);pe.setRealPlayer(ue),I.push(pe)}return ue});I.forEach(p=>{Nt(this.playersByQueriedElement,p.element,[]).push(p),p.onDone(()=>jq(this.playersByQueriedElement,p.element,p))}),B.forEach(p=>gi(p,pm));let h=Zo(D);return h.onDestroy(()=>{B.forEach(p=>ur(p,pm)),vi(r,A.toStyles)}),c.forEach(p=>{Nt(o,p,[]).push(h)}),h}_buildPlayer(e,A,i){return A.length>0?this.driver.animate(e.element,A,e.duration,e.delay,e.easing,i):new Bo(e.duration,e.delay)}},_a=class{namespaceId;triggerName;element;_player=new Bo;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(e,A,i){this.namespaceId=e,this.triggerName=A,this.element=i}setRealPlayer(e){this._containsRealPlayer||(this._player=e,this._queuedCallbacks.forEach((A,i)=>{A.forEach(o=>XE(e,i,void 0,o))}),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 A=this._player;A.triggerCallback&&e.onStart(()=>A.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,A){Nt(this._queuedCallbacks,e,[]).push(A)}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 A=this._player;A.triggerCallback&&A.triggerCallback(e)}};function jq(t,e,A){let i=t.get(e);if(i){if(i.length){let o=i.indexOf(A);i.splice(o,1)}i.length==0&&t.delete(e)}return i}function Xq(t){return t??null}function sc(t){return t&&t.nodeType===1}function $q(t){return t=="start"||t=="done"}function rS(t,e){let A=t.style.display;return t.style.display=e??"none",A}function IS(t,e,A,i,o){let g=[];A.forEach(r=>g.push(rS(r)));let n=[];i.forEach((r,I)=>{let B=new Map;r.forEach(c=>{let D=e.computeStyle(I,c,o);B.set(c,D),(!D||D.length==0)&&(I[Li]=zq,n.push(I))}),t.set(I,B)});let s=0;return A.forEach(r=>rS(r,g[s++])),n}function aS(t,e){let A=new Map;if(t.forEach(s=>A.set(s,[])),e.length==0)return A;let i=1,o=new Set(e),g=new Map;function n(s){if(!s)return i;let r=g.get(s);if(r)return r;let I=s.parentNode;return A.has(I)?r=I:o.has(I)?r=i:r=n(I),g.set(s,r),r}return e.forEach(s=>{let r=n(s);r!==i&&A.get(r).push(s)}),A}function gi(t,e){t.classList?.add(e)}function ur(t,e){t.classList?.remove(e)}function A1(t,e,A){Zo(A).onDone(()=>t.processLeaveNode(e))}function e1(t){let e=[];return dS(t,e),e}function dS(t,e){for(let A=0;Ao.add(g)):e.set(t,i),A.delete(t),!0}var Dr=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(e,A)=>{};constructor(e,A,i){this._driver=A,this._normalizer=i,this._transitionEngine=new Ym(e.body,A,i),this._timelineEngine=new _m(e.body,A,i),this._transitionEngine.onRemovalComplete=(o,g)=>this.onRemovalComplete(o,g)}registerTrigger(e,A,i,o,g){let n=e+"-"+o,s=this._triggerCache[n];if(!s){let r=[],I=[],B=QS(this._driver,g,r,I);if(r.length)throw Yb(o,r);s=Hq(o,B,this._normalizer),this._triggerCache[n]=s}this._transitionEngine.registerTrigger(A,o,s)}register(e,A){this._transitionEngine.register(e,A)}destroy(e,A){this._transitionEngine.destroy(e,A)}onInsert(e,A,i,o){this._transitionEngine.insertNode(e,A,i,o)}onRemove(e,A,i){this._transitionEngine.removeNode(e,A,i)}disableAnimations(e,A){this._transitionEngine.markElementAsDisabled(e,A)}process(e,A,i,o){if(i.charAt(0)=="@"){let[g,n]=um(i),s=o;this._timelineEngine.command(g,A,n,s)}else this._transitionEngine.trigger(e,A,i,o)}listen(e,A,i,o,g){if(i.charAt(0)=="@"){let[n,s]=um(i);return this._timelineEngine.listen(n,A,s,g)}return this._transitionEngine.listen(e,A,i,o,g)}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 i1(t,e){let A=null,i=null;return Array.isArray(e)&&e.length?(A=bm(e[0]),e.length>1&&(i=bm(e[e.length-1]))):e instanceof Map&&(A=bm(e)),A||i?new o1(t,A,i):null}var o1=(()=>{class t{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(A,i,o){this._element=A,this._startStyles=i,this._endStyles=o;let g=t.initialStylesByElement.get(A);g||t.initialStylesByElement.set(A,g=new Map),this._initialStyles=g}start(){this._state<1&&(this._startStyles&&vi(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(vi(this._element,this._initialStyles),this._endStyles&&(vi(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(t.initialStylesByElement.delete(this._element),this._startStyles&&(bg(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(bg(this._element,this._endStyles),this._endStyles=null),vi(this._element,this._initialStyles),this._state=3)}}return t})();function bm(t){let e=null;return t.forEach((A,i)=>{g1(i)&&(e=e||new Map,e.set(i,A))}),e}function g1(t){return t==="display"||t==="position"}var Ec=class{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(e,A,i,o){this.element=e,this.keyframes=A,this.options=i,this._specialStyles=o,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._initialized=!0;let e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:new Map;let A=()=>this._onFinish();this.domPlayer.addEventListener("finish",A),this.onDestroy(()=>{this.domPlayer.removeEventListener("finish",A)})}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_convertKeyframesToObject(e){let A=[];return e.forEach(i=>{A.push(Object.fromEntries(i))}),A}_triggerWebAnimation(e,A,i){return e.animate(this._convertKeyframesToObject(A),i)}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(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(e=>e()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),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&&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===void 0&&this.init(),this.domPlayer.currentTime=e*this.time}getPosition(){return+(this.domPlayer.currentTime??0)/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){let e=new Map;this.hasStarted()&&this._finalKeyframe.forEach((i,o)=>{o!=="offset"&&e.set(o,this._finished?i:oc(this.element,o))}),this.currentSnapshot=e}triggerCallback(e){let A=e==="start"?this._onStartFns:this._onDoneFns;A.forEach(i=>i()),A.length=0}},cc=class{validateStyleProperty(e){return!0}validateAnimatableStyleProperty(e){return!0}containsElement(e,A){return Dm(e,A)}getParentElement(e){return Ac(e)}query(e,A,i){return mm(e,A,i)}computeStyle(e,A,i){return oc(e,A)}animate(e,A,i,o,g,n=[]){let s=o==0?"both":"forwards",r={duration:i,delay:o,fill:s};g&&(r.easing=g);let I=new Map,B=n.filter(h=>h instanceof Ec);AS(i,o)&&B.forEach(h=>{h.currentSnapshot.forEach((p,y)=>I.set(y,p))});let c=Xb(A).map(h=>new Map(h));c=eS(e,c,I);let D=i1(e,c);return new Ec(e,c,r,D)}};var rc="@",hS="@.disabled",lc=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(e,A,i,o){this.namespaceId=e,this.delegate=A,this.engine=i,this._onDestroy=o}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,A){return this.delegate.createElement(e,A)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,A){this.delegate.appendChild(e,A),this.engine.onInsert(this.namespaceId,A,e,!1)}insertBefore(e,A,i,o=!0){this.delegate.insertBefore(e,A,i),this.engine.onInsert(this.namespaceId,A,e,o)}removeChild(e,A,i){this.parentNode(A)&&this.engine.onRemove(this.namespaceId,A,this.delegate)}selectRootElement(e,A){return this.delegate.selectRootElement(e,A)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,A,i,o){this.delegate.setAttribute(e,A,i,o)}removeAttribute(e,A,i){this.delegate.removeAttribute(e,A,i)}addClass(e,A){this.delegate.addClass(e,A)}removeClass(e,A){this.delegate.removeClass(e,A)}setStyle(e,A,i,o){this.delegate.setStyle(e,A,i,o)}removeStyle(e,A,i){this.delegate.removeStyle(e,A,i)}setProperty(e,A,i){A.charAt(0)==rc&&A==hS?this.disableAnimations(e,!!i):this.delegate.setProperty(e,A,i)}setValue(e,A){this.delegate.setValue(e,A)}listen(e,A,i,o){return this.delegate.listen(e,A,i,o)}disableAnimations(e,A){this.engine.disableAnimations(e,A)}},Jm=class extends lc{factory;constructor(e,A,i,o,g){super(A,i,o,g),this.factory=e,this.namespaceId=A}setProperty(e,A,i){A.charAt(0)==rc?A.charAt(1)=="."&&A==hS?(i=i===void 0?!0:!!i,this.disableAnimations(e,i)):this.engine.process(this.namespaceId,e,A.slice(1),i):this.delegate.setProperty(e,A,i)}listen(e,A,i,o){if(A.charAt(0)==rc){let g=n1(e),n=A.slice(1),s="";return n.charAt(0)!=rc&&([n,s]=s1(n)),this.engine.listen(this.namespaceId,g,n,s,r=>{let I=r._data||-1;this.factory.scheduleListenerCallback(I,i,r)})}return this.delegate.listen(e,A,i,o)}};function n1(t){switch(t){case"body":return document.body;case"document":return document;case"window":return window;default:return t}}function s1(t){let e=t.indexOf("."),A=t.substring(0,e),i=t.slice(e+1);return[A,i]}var dc=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(e,A,i){this.delegate=e,this.engine=A,this._zone=i,A.onRemovalComplete=(o,g)=>{g?.removeChild(null,o)}}createRenderer(e,A){let i="",o=this.delegate.createRenderer(e,A);if(!e||!A?.data?.animation){let I=this._rendererCache,B=I.get(o);if(!B){let c=()=>I.delete(o);B=new lc(i,o,this.engine,c),I.set(o,B)}return B}let g=A.id,n=A.id+"-"+this._currentId;this._currentId++,this.engine.register(n,e);let s=I=>{Array.isArray(I)?I.forEach(s):this.engine.registerTrigger(g,n,e,I.name,I)};return A.data.animation.forEach(s),new Jm(this,n,o,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(e,A,i){if(e>=0&&eA(i));return}let o=this._animationCallbacksBuffer;o.length==0&&queueMicrotask(()=>{this._zone.run(()=>{o.forEach(g=>{let[n,s]=g;n(s)}),this._animationCallbacksBuffer=[]})}),o.push([A,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 I1=(()=>{class t extends Dr{constructor(A,i,o){super(A,i,o)}ngOnDestroy(){this.flush()}static \u0275fac=function(i){return new(i||t)(J(lA),J(vn),J(Ln))};static \u0275prov=N({token:t,factory:t.\u0275fac})}return t})();function a1(){return new Ic}function C1(t,e,A){return new dc(t,e,A)}var DS=[{provide:Ln,useFactory:a1},{provide:Dr,useClass:I1},{provide:tt,useFactory:C1,deps:[uI,Dr,X]}],B1=[{provide:vn,useClass:Hm},{provide:ee,useValue:"NoopAnimations"},...DS],uS=[{provide:vn,useFactory:()=>new cc},{provide:ee,useFactory:()=>"BrowserAnimations"},...DS],mS=(()=>{class t{static withConfig(A){return{ngModule:t,providers:A.disableAnimations?B1:uS}}static \u0275fac=function(i){return new(i||t)};static \u0275mod=V({type:t});static \u0275inj=q({providers:uS,imports:[mI]})}return t})();var hc=class t{static \u0275fac=function(A){return new(A||t)};static \u0275mod=V({type:t});static \u0275inj=q({imports:[Uo,hQ,JF,FF,To,YE,xo,Kk,xo,xF,HF,ZF,Ab,kE,qk,uF,NF,mb.forRoot(),fb,bM]})};var xa=class t{static \u0275fac=function(A){return new(A||t)};static \u0275mod=V({type:t,bootstrap:[lr]});static \u0275inj=q({providers:[Si,fg,ho,Cr,Br,Fg,co,ar,cr],imports:[hc,mI,hQ,Ph,jE,YE,To,xo,mS,xo]})};fetch("/assets/config/runtime-config.json").then(t=>t.json()).then(t=>{window.runtimeConfig=t,$B().bootstrapModule(xa).catch(e=>console.error(e))});$B().bootstrapModule(xa).catch(t=>console.error(t)); diff --git a/src/google/adk/evaluation/response_evaluator.py b/src/google/adk/evaluation/response_evaluator.py index 463f21f..c5da692 100644 --- a/src/google/adk/evaluation/response_evaluator.py +++ b/src/google/adk/evaluation/response_evaluator.py @@ -42,7 +42,7 @@ class ResponseEvaluator: A note on evaluation_criteria: `response_match_score`: This metric compares the agents final natural - language reponse with the expected final response, stored in the + language response with the expected final response, stored in the "reference" field in test/eval files. We use Rouge metric to compare the two responses. diff --git a/src/google/adk/flows/llm_flows/contents.py b/src/google/adk/flows/llm_flows/contents.py index e473963..f284755 100644 --- a/src/google/adk/flows/llm_flows/contents.py +++ b/src/google/adk/flows/llm_flows/contents.py @@ -310,7 +310,7 @@ def _merge_function_response_events( function_response_events: A list of function_response events. NOTE: function_response_events must fulfill these requirements: 1. The list is in increasing order of timestamp; 2. the first event is the - initial function_reponse event; 3. all later events should contain at + initial function_response event; 3. all later events should contain at least one function_response part that related to the function_call event. (Note, 3. may not be true when aync function return some intermediate response, there could also be some intermediate model diff --git a/src/google/adk/tests/unittests/utils.py b/src/google/adk/tests/unittests/utils.py index 592ff15..2e74db9 100644 --- a/src/google/adk/tests/unittests/utils.py +++ b/src/google/adk/tests/unittests/utils.py @@ -231,7 +231,7 @@ class MockModel(BaseLlm): if not responses: return cls(responses=[]) elif isinstance(responses[0], LlmResponse): - # reponses is list[LlmResponse] + # responses is list[LlmResponse] return cls(responses=responses) else: responses = [ From 7a34c3f5b973d93d86ad5ea3bc5f8993beeed443 Mon Sep 17 00:00:00 2001 From: Ikko Eltociear Ashimine Date: Thu, 10 Apr 2025 15:59:59 +0900 Subject: [PATCH 2/3] chore: update evals.py langauge -> language --- src/google/adk/cli/utils/evals.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/google/adk/cli/utils/evals.py b/src/google/adk/cli/utils/evals.py index f62a3d9..2be9fb8 100644 --- a/src/google/adk/cli/utils/evals.py +++ b/src/google/adk/cli/utils/evals.py @@ -66,7 +66,7 @@ def convert_session_to_eval_format(session: Session) -> list[dict[str, Any]]: 'tool_input': tool_input, }) elif subsequent_part.text: - # Also keep track of all the natural langauge responses that + # Also keep track of all the natural language responses that # agent (or sub agents) generated. intermediate_agent_responses.append( {'author': event_author, 'text': subsequent_part.text} @@ -75,7 +75,7 @@ def convert_session_to_eval_format(session: Session) -> list[dict[str, Any]]: # If we are here then either we are done reading all the events or we # encountered an event that had content authored by the end-user. # This, basically means an end of turn. - # We assume that the last natural langauge intermediate response is the + # We assume that the last natural language intermediate response is the # final response from the agent/model. We treat that as a reference. eval_case.append({ 'query': query, From 9cbaaf378fccac017746dc18b9727fd3fcae0ca5 Mon Sep 17 00:00:00 2001 From: HowardChan Date: Fri, 11 Apr 2025 08:49:37 +0800 Subject: [PATCH 3/3] Revert main-SLIAU2JL.js file --- src/google/adk/cli/browser/main-SLIAU2JL.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/google/adk/cli/browser/main-SLIAU2JL.js b/src/google/adk/cli/browser/main-SLIAU2JL.js index a0f086d..ba5a8ef 100644 --- a/src/google/adk/cli/browser/main-SLIAU2JL.js +++ b/src/google/adk/cli/browser/main-SLIAU2JL.js @@ -88,4 +88,4 @@ ${e} Please report this to https://github.com/markedjs/marked.`,e){let o="

An error occurred:

"+uo(i.message+"",!0)+"
";return A?Promise.resolve(o):o}if(A)return Promise.reject(i);throw i}}},bn=new om;function XA(t,e){return bn.parse(t,e)}XA.options=XA.setOptions=function(t){return bn.setOptions(t),XA.defaults=bn.defaults,nb(XA.defaults),XA};XA.getDefaults=gm;XA.defaults=Sn;XA.use=function(...t){return bn.use(...t),XA.defaults=bn.defaults,nb(XA.defaults),XA};XA.walkTokens=function(t,e){return bn.walkTokens(t,e)};XA.parseInline=bn.parseInline;XA.Parser=Gi;XA.parser=Gi.parse;XA.Renderer=Do;XA.TextRenderer=Ra;XA.Lexer=Ni;XA.lexer=Ni.lex;XA.Tokenizer=Er;XA.Hooks=Qr;XA.parse=XA;var CIA=XA.options,BIA=XA.setOptions,QIA=XA.use,EIA=XA.walkTokens,cIA=XA.parseInline;var lIA=Gi.parse,dIA=Ni.lex;var JP=["*"],HP="Copy",TP="Copied",OP=(()=>{class t{constructor(){this._buttonClick$=new K,this.copied$=this._buttonClick$.pipe(re(()=>De(tA(!0),Lg(3e3).pipe(Vn(!1)))),Bi(),Ro(1)),this.copiedText$=this.copied$.pipe(me(!1),oA(A=>A?TP:HP))}onCopyToClipboardClick(){this._buttonClick$.next()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=O({type:t,selectors:[["markdown-clipboard"]],decls:4,vars:7,consts:[[1,"markdown-clipboard-button",3,"click"]],template:function(i,o){i&1&&(u(0,"button",0),rg(1,"async"),x("click",function(){return o.onCopyToClipboardClick()}),v(2),rg(3,"async"),m()),i&2&&(gA("copied",Ds(1,3,o.copied$)),f(2),PA(Ds(3,5,o.copiedText$)))},dependencies:[EI],encapsulation:2,changeDetection:0})}}return t})(),PP=new k("CLIPBOARD_OPTIONS");var Qm=function(t){return t.CommandLine="command-line",t.LineHighlight="line-highlight",t.LineNumbers="line-numbers",t}(Qm||{}),db=new k("MARKED_EXTENSIONS"),ZP=new k("MARKED_OPTIONS"),qP=new k("MERMAID_OPTIONS"),VP="[ngx-markdown] When using the `emoji` attribute you *have to* include Emoji-Toolkit files to `angular.json` or use imports. See README for more information",WP="[ngx-markdown] When using the `katex` attribute you *have to* include KaTeX files to `angular.json` or use imports. See README for more information",zP="[ngx-markdown] When using the `mermaid` attribute you *have to* include Mermaid files to `angular.json` or use imports. See README for more information",jP="[ngx-markdown] When using the `clipboard` attribute you *have to* include Clipboard files to `angular.json` or use imports. See README for more information",XP="[ngx-markdown] When using the `clipboard` attribute you *have to* provide the `viewContainerRef` parameter to `MarkdownService.render()` function",$P="[ngx-markdown] When using the `src` attribute you *have to* pass the `HttpClient` as a parameter of the `forRoot` method. See README for more information",hb=new k("SECURITY_CONTEXT");var ub=(()=>{class t{get options(){return this._options}set options(A){this._options=R(R({},this.DEFAULT_MARKED_OPTIONS),A)}get renderer(){return this.options.renderer}set renderer(A){this.options.renderer=A}constructor(A,i,o,g,n,s,r,I){this.clipboardOptions=A,this.extensions=i,this.mermaidOptions=g,this.platform=n,this.securityContext=s,this.http=r,this.sanitizer=I,this.DEFAULT_MARKED_OPTIONS={renderer:new Do},this.DEFAULT_KATEX_OPTIONS={delimiters:[{left:"$$",right:"$$",display:!0},{left:"$",right:"$",display:!1},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}]},this.DEFAULT_MERMAID_OPTIONS={startOnLoad:!1},this.DEFAULT_CLIPBOARD_OPTIONS={buttonComponent:void 0},this.DEFAULT_PARSE_OPTIONS={decodeHtml:!1,inline:!1,emoji:!1,mermaid:!1,markedOptions:void 0,disableSanitizer:!1},this.DEFAULT_RENDER_OPTIONS={clipboard:!1,clipboardOptions:void 0,katex:!1,katexOptions:void 0,mermaid:!1,mermaidOptions:void 0},this._reload$=new K,this.reload$=this._reload$.asObservable(),this.options=o}parse(A,i=this.DEFAULT_PARSE_OPTIONS){let{decodeHtml:o,inline:g,emoji:n,mermaid:s,disableSanitizer:r}=i,I=R(R({},this.options),i.markedOptions),B=I.renderer||this.renderer||new Do;this.extensions&&(this.renderer=this.extendsRendererForExtensions(B)),s&&(this.renderer=this.extendsRendererForMermaid(B));let c=this.trimIndentation(A),D=o?this.decodeHtml(c):c,h=n?this.parseEmoji(D):D,p=this.parseMarked(h,I,g);return(r?p:this.sanitizer.sanitize(this.securityContext,p))||""}render(A,i=this.DEFAULT_RENDER_OPTIONS,o){let{clipboard:g,clipboardOptions:n,katex:s,katexOptions:r,mermaid:I,mermaidOptions:B}=i;s&&this.renderKatex(A,R(R({},this.DEFAULT_KATEX_OPTIONS),r)),I&&this.renderMermaid(A,R(R(R({},this.DEFAULT_MERMAID_OPTIONS),this.mermaidOptions),B)),g&&this.renderClipboard(A,o,R(R(R({},this.DEFAULT_CLIPBOARD_OPTIONS),this.clipboardOptions),n)),this.highlight(A)}reload(){this._reload$.next()}getSource(A){if(!this.http)throw new Error($P);return this.http.get(A,{responseType:"text"}).pipe(oA(i=>this.handleExtension(A,i)))}highlight(A){if(!to(this.platform)||typeof Prism>"u"||typeof Prism.highlightAllUnder>"u")return;A||(A=document);let i=A.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(i,o=>o.classList.add("language-none")),Prism.highlightAllUnder(A)}decodeHtml(A){if(!to(this.platform))return A;let i=document.createElement("textarea");return i.innerHTML=A,i.value}extendsRendererForExtensions(A){let i=A;return i.\u0275NgxMarkdownRendererExtendedForExtensions===!0||(this.extensions?.length>0&&XA.use(...this.extensions),i.\u0275NgxMarkdownRendererExtendedForExtensions=!0),A}extendsRendererForMermaid(A){let i=A;if(i.\u0275NgxMarkdownRendererExtendedForMermaid===!0)return A;let o=A.code;return A.code=g=>g.lang==="mermaid"?`
${g.text}
`:o(g),i.\u0275NgxMarkdownRendererExtendedForMermaid=!0,A}handleExtension(A,i){let o=A.lastIndexOf("://"),g=o>-1?A.substring(o+4):A,n=g.lastIndexOf("/"),s=n>-1?g.substring(n+1).split("?")[0]:"",r=s.lastIndexOf("."),I=r>-1?s.substring(r+1):"";return I&&I!=="md"?"```"+I+` `+i+"\n```":i}parseMarked(A,i,o=!1){if(i.renderer){let g=R({},i.renderer);delete g.\u0275NgxMarkdownRendererExtendedForExtensions,delete g.\u0275NgxMarkdownRendererExtendedForMermaid,delete i.renderer,XA.use({renderer:g})}return o?XA.parseInline(A,i):XA.parse(A,i)}parseEmoji(A){if(!to(this.platform))return A;if(typeof joypixels>"u"||typeof joypixels.shortnameToUnicode>"u")throw new Error(VP);return joypixels.shortnameToUnicode(A)}renderKatex(A,i){if(to(this.platform)){if(typeof katex>"u"||typeof renderMathInElement>"u")throw new Error(WP);renderMathInElement(A,i)}}renderClipboard(A,i,o){if(!to(this.platform))return;if(typeof ClipboardJS>"u")throw new Error(jP);if(!i)throw new Error(XP);let{buttonComponent:g,buttonTemplate:n}=o,s=A.querySelectorAll("pre");for(let r=0;rc.classList.add("hover"),B.onmouseleave=()=>c.classList.remove("hover");let D;if(g){let p=i.createComponent(g);D=p.hostView,p.changeDetectorRef.markForCheck()}else if(n)D=i.createEmbeddedView(n);else{let p=i.createComponent(OP);D=p.hostView,p.changeDetectorRef.markForCheck()}let h;D.rootNodes.forEach(p=>{c.appendChild(p),h=new ClipboardJS(p,{text:()=>I.innerText})}),D.onDestroy(()=>h.destroy())}}renderMermaid(A,i=this.DEFAULT_MERMAID_OPTIONS){if(!to(this.platform))return;if(typeof mermaid>"u"||typeof mermaid.initialize>"u")throw new Error(zP);let o=A.querySelectorAll(".mermaid");o.length!==0&&(mermaid.initialize(i),mermaid.run({nodes:o}))}trimIndentation(A){if(!A)return"";let i;return A.split(` `).map(o=>{let g=i;return o.length>0&&(g=isNaN(g)?o.search(/\S|$/):Math.min(o.search(/\S|$/),g)),isNaN(i)&&(i=g),g?o.substring(g):o}).join(` -`)}static{this.\u0275fac=function(i){return new(i||t)(J(PP,8),J(db,8),J(ZP,8),J(qP,8),J(jt),J(hb),J(it,8),J(an))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})(),Db=(()=>{class t{get disableSanitizer(){return this._disableSanitizer}set disableSanitizer(A){this._disableSanitizer=this.coerceBooleanProperty(A)}get inline(){return this._inline}set inline(A){this._inline=this.coerceBooleanProperty(A)}get clipboard(){return this._clipboard}set clipboard(A){this._clipboard=this.coerceBooleanProperty(A)}get emoji(){return this._emoji}set emoji(A){this._emoji=this.coerceBooleanProperty(A)}get katex(){return this._katex}set katex(A){this._katex=this.coerceBooleanProperty(A)}get mermaid(){return this._mermaid}set mermaid(A){this._mermaid=this.coerceBooleanProperty(A)}get lineHighlight(){return this._lineHighlight}set lineHighlight(A){this._lineHighlight=this.coerceBooleanProperty(A)}get lineNumbers(){return this._lineNumbers}set lineNumbers(A){this._lineNumbers=this.coerceBooleanProperty(A)}get commandLine(){return this._commandLine}set commandLine(A){this._commandLine=this.coerceBooleanProperty(A)}constructor(A,i,o){this.element=A,this.markdownService=i,this.viewContainerRef=o,this.error=new $,this.load=new $,this.ready=new $,this._clipboard=!1,this._commandLine=!1,this._disableSanitizer=!1,this._emoji=!1,this._inline=!1,this._katex=!1,this._lineHighlight=!1,this._lineNumbers=!1,this._mermaid=!1,this.destroyed$=new K}ngOnChanges(){this.loadContent()}loadContent(){if(this.data!=null){this.handleData();return}if(this.src!=null){this.handleSrc();return}}ngAfterViewInit(){!this.data&&!this.src&&this.handleTransclusion(),this.markdownService.reload$.pipe(DA(this.destroyed$)).subscribe(()=>this.loadContent())}ngOnDestroy(){this.destroyed$.next(),this.destroyed$.complete()}render(A,i=!1){return qe(this,null,function*(){let o={decodeHtml:i,inline:this.inline,emoji:this.emoji,mermaid:this.mermaid,disableSanitizer:this.disableSanitizer},g={clipboard:this.clipboard,clipboardOptions:this.getClipboardOptions(),katex:this.katex,katexOptions:this.katexOptions,mermaid:this.mermaid,mermaidOptions:this.mermaidOptions},n=yield this.markdownService.parse(A,o);this.element.nativeElement.innerHTML=n,this.handlePlugins(),this.markdownService.render(this.element.nativeElement,g,this.viewContainerRef),this.ready.emit()})}coerceBooleanProperty(A){return A!=null&&`${String(A)}`!="false"}getClipboardOptions(){if(this.clipboardButtonComponent||this.clipboardButtonTemplate)return{buttonComponent:this.clipboardButtonComponent,buttonTemplate:this.clipboardButtonTemplate}}handleData(){this.render(this.data)}handleSrc(){this.markdownService.getSource(this.src).subscribe({next:A=>{this.render(A).then(()=>{this.load.emit(A)})},error:A=>this.error.emit(A)})}handleTransclusion(){this.render(this.element.nativeElement.innerHTML,!0)}handlePlugins(){this.commandLine&&(this.setPluginClass(this.element.nativeElement,Qm.CommandLine),this.setPluginOptions(this.element.nativeElement,{dataFilterOutput:this.filterOutput,dataHost:this.host,dataPrompt:this.prompt,dataOutput:this.output,dataUser:this.user})),this.lineHighlight&&this.setPluginOptions(this.element.nativeElement,{dataLine:this.line,dataLineOffset:this.lineOffset}),this.lineNumbers&&(this.setPluginClass(this.element.nativeElement,Qm.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(A,i){let o=A.querySelectorAll("pre");for(let g=0;g{let s=i[n];if(s){let r=this.toLispCase(n);o.item(g).setAttribute(r,s.toString())}})}toLispCase(A){let i=A.match(/([A-Z])/g);if(!i)return A;let o=A.toString();for(let g=0,n=i.length;g{let i=eZ(A)?hA(R({},A),{multi:!0}):{provide:db,useValue:A,multi:!0};return[...e,i]},[])}var mb=(()=>{class t{static forRoot(A){return{ngModule:t,providers:[AZ(A)]}}static forChild(){return{ngModule:t}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=V({type:t})}static{this.\u0275inj=q({imports:[Uo]})}}return t})();var oZ=["switch"],gZ=["*"];function nZ(t,e){t&1&&(u(0,"span",10),at(),u(1,"svg",12),W(2,"path",13),m(),u(3,"svg",14),W(4,"path",15),m()())}var sZ=new k("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1,hideIcon:!1,disabledInteractive:!1})}),rZ={provide:Bn,useExisting:ft(()=>zE),multi:!0},WE=class{source;checked;constructor(e,A){this.source=e,this.checked=A}},zE=(()=>{class t{_elementRef=Q(Z);_focusMonitor=Q(Xt);_changeDetectorRef=Q(zA);defaults=Q(sZ);_onChange=A=>{};_onTouched=()=>{};_validatorOnChange=()=>{};_uniqueId;_checked=!1;_createChangeEvent(A){return new WE(this,A)}_labelId;get buttonId(){return`${this.id||this._uniqueId}-button`}_switchElement;focus(){this._switchElement.nativeElement.focus()}_noopAnimations;_focused;name=null;id;labelPosition="after";ariaLabel=null;ariaLabelledby=null;ariaDescribedby;required;color;disabled=!1;disableRipple=!1;tabIndex=0;get checked(){return this._checked}set checked(A){this._checked=A,this._changeDetectorRef.markForCheck()}hideIcon;disabledInteractive;change=new $;toggleChange=new $;get inputId(){return`${this.id||this._uniqueId}-input`}constructor(){Q(be).load(ki);let A=Q(new Dt("tabindex"),{optional:!0}),i=this.defaults,o=Q(ee,{optional:!0});this.tabIndex=A==null?0:parseInt(A)||0,this.color=i.color||"accent",this._noopAnimations=o==="NoopAnimations",this.id=this._uniqueId=Q(ce).getId("mat-mdc-slide-toggle-"),this.hideIcon=i.hideIcon??!1,this.disabledInteractive=i.disabledInteractive??!1,this._labelId=this._uniqueId+"-label"}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(A=>{A==="keyboard"||A==="program"?(this._focused=!0,this._changeDetectorRef.markForCheck()):A||Promise.resolve().then(()=>{this._focused=!1,this._onTouched(),this._changeDetectorRef.markForCheck()})})}ngOnChanges(A){A.required&&this._validatorOnChange()}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}writeValue(A){this.checked=!!A}registerOnChange(A){this._onChange=A}registerOnTouched(A){this._onTouched=A}validate(A){return this.required&&A.value!==!0?{required:!0}:null}registerOnValidatorChange(A){this._validatorOnChange=A}setDisabledState(A){this.disabled=A,this._changeDetectorRef.markForCheck()}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(this._createChangeEvent(this.checked))}_handleClick(){this.disabled||(this.toggleChange.emit(),this.defaults.disableToggleValue||(this.checked=!this.checked,this._onChange(this.checked),this.change.emit(new WE(this,this.checked))))}_getAriaLabelledBy(){return this.ariaLabelledby?this.ariaLabelledby:this.ariaLabel?null:this._labelId}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=O({type:t,selectors:[["mat-slide-toggle"]],viewQuery:function(i,o){if(i&1&&cA(oZ,5),i&2){let g;z(g=j())&&(o._switchElement=g.first)}},hostAttrs:[1,"mat-mdc-slide-toggle"],hostVars:13,hostBindings:function(i,o){i&2&&(yt("id",o.id),IA("tabindex",null)("aria-label",null)("name",null)("aria-labelledby",null),Xe(o.color?"mat-"+o.color:""),gA("mat-mdc-slide-toggle-focused",o._focused)("mat-mdc-slide-toggle-checked",o.checked)("_mat-animation-noopable",o._noopAnimations))},inputs:{name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],required:[2,"required","required",iA],color:"color",disabled:[2,"disabled","disabled",iA],disableRipple:[2,"disableRipple","disableRipple",iA],tabIndex:[2,"tabIndex","tabIndex",A=>A==null?0:Fe(A)],checked:[2,"checked","checked",iA],hideIcon:[2,"hideIcon","hideIcon",iA],disabledInteractive:[2,"disabledInteractive","disabledInteractive",iA]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[KA([rZ,{provide:Cg,useExisting:t,multi:!0}]),VA],ngContentSelectors:gZ,decls:13,vars:27,consts:[["switch",""],["mat-internal-form-field","",3,"labelPosition"],["role","switch","type","button",1,"mdc-switch",3,"click","tabIndex","disabled"],[1,"mdc-switch__track"],[1,"mdc-switch__handle-track"],[1,"mdc-switch__handle"],[1,"mdc-switch__shadow"],[1,"mdc-elevation-overlay"],[1,"mdc-switch__ripple"],["mat-ripple","",1,"mat-mdc-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-switch__icons"],[1,"mdc-label",3,"click","for"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--on"],["d","M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--off"],["d","M20 13H4v-2h16v2z"]],template:function(i,o){if(i&1){let g=aA();qA(),u(0,"div",1)(1,"button",2,0),x("click",function(){return H(g),T(o._handleClick())}),W(3,"span",3),u(4,"span",4)(5,"span",5)(6,"span",6),W(7,"span",7),m(),u(8,"span",8),W(9,"span",9),m(),_(10,nZ,5,0,"span",10),m()()(),u(11,"label",11),x("click",function(s){return H(g),T(s.stopPropagation())}),rA(12),m()()}if(i&2){let g=He(2);F("labelPosition",o.labelPosition),f(),gA("mdc-switch--selected",o.checked)("mdc-switch--unselected",!o.checked)("mdc-switch--checked",o.checked)("mdc-switch--disabled",o.disabled)("mat-mdc-slide-toggle-disabled-interactive",o.disabledInteractive),F("tabIndex",o.disabled&&!o.disabledInteractive?-1:o.tabIndex)("disabled",o.disabled&&!o.disabledInteractive),IA("id",o.buttonId)("name",o.name)("aria-label",o.ariaLabel)("aria-labelledby",o._getAriaLabelledBy())("aria-describedby",o.ariaDescribedby)("aria-required",o.required||null)("aria-checked",o.checked)("aria-disabled",o.disabled&&o.disabledInteractive?"true":null),f(8),F("matRippleTrigger",g)("matRippleDisabled",o.disableRipple||o.disabled)("matRippleCentered",!0),f(),wA(o.hideIcon?-1:10),f(),F("for",o.buttonId),IA("id",o._labelId)}},dependencies:[dg,cE],styles:['.mdc-switch{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;flex-shrink:0;margin:0;outline:none;overflow:visible;padding:0;position:relative;width:var(--mdc-switch-track-width, 52px)}.mdc-switch.mdc-switch--disabled{cursor:default;pointer-events:none}.mdc-switch.mat-mdc-slide-toggle-disabled-interactive{pointer-events:auto}.mdc-switch__track{overflow:hidden;position:relative;width:100%;height:var(--mdc-switch-track-height, 32px);border-radius:var(--mdc-switch-track-shape, var(--mat-sys-corner-full))}.mdc-switch--disabled.mdc-switch .mdc-switch__track{opacity:var(--mdc-switch-disabled-track-opacity, 0.12)}.mdc-switch__track::before,.mdc-switch__track::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";height:100%;left:0;position:absolute;width:100%;border-width:var(--mat-switch-track-outline-width, 2px);border-color:var(--mat-switch-track-outline-color, var(--mat-sys-outline))}.mdc-switch--selected .mdc-switch__track::before,.mdc-switch--selected .mdc-switch__track::after{border-width:var(--mat-switch-selected-track-outline-width, 2px);border-color:var(--mat-switch-selected-track-outline-color, transparent)}.mdc-switch--disabled .mdc-switch__track::before,.mdc-switch--disabled .mdc-switch__track::after{border-width:var(--mat-switch-disabled-unselected-track-outline-width, 2px);border-color:var(--mat-switch-disabled-unselected-track-outline-color, var(--mat-sys-on-surface))}@media(forced-colors: active){.mdc-switch__track{border-color:currentColor}}.mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:translateX(0);background:var(--mdc-switch-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1);transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch--selected .mdc-switch__track::before{transform:translateX(-100%)}.mdc-switch--selected .mdc-switch__track::before{opacity:var(--mat-switch-hidden-track-opacity, 0);transition:var(--mat-switch-hidden-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::before{opacity:var(--mat-switch-visible-track-opacity, 1);transition:var(--mat-switch-visible-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::before{background:var(--mdc-switch-unselected-hover-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::before{background:var(--mdc-switch-unselected-focus-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:active .mdc-switch__track::before{background:var(--mdc-switch-unselected-pressed-track-color, var(--mat-sys-surface-variant))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::before,.mdc-switch.mdc-switch--disabled .mdc-switch__track::before{background:var(--mdc-switch-disabled-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch__track::after{transform:translateX(-100%);background:var(--mdc-switch-selected-track-color, var(--mat-sys-primary))}[dir=rtl] .mdc-switch__track::after{transform:translateX(100%)}.mdc-switch--selected .mdc-switch__track::after{transform:translateX(0)}.mdc-switch--selected .mdc-switch__track::after{opacity:var(--mat-switch-visible-track-opacity, 1);transition:var(--mat-switch-visible-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::after{opacity:var(--mat-switch-hidden-track-opacity, 0);transition:var(--mat-switch-hidden-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::after{background:var(--mdc-switch-selected-hover-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::after{background:var(--mdc-switch-selected-focus-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:active .mdc-switch__track::after{background:var(--mdc-switch-selected-pressed-track-color, var(--mat-sys-primary))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::after,.mdc-switch.mdc-switch--disabled .mdc-switch__track::after{background:var(--mdc-switch-disabled-selected-track-color, var(--mat-sys-on-surface))}.mdc-switch__handle-track{height:100%;pointer-events:none;position:absolute;top:0;transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);left:0;right:auto;transform:translateX(0);width:calc(100% - var(--mdc-switch-handle-width))}[dir=rtl] .mdc-switch__handle-track{left:auto;right:0}.mdc-switch--selected .mdc-switch__handle-track{transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch__handle-track{transform:translateX(-100%)}.mdc-switch__handle{display:flex;pointer-events:auto;position:absolute;top:50%;transform:translateY(-50%);left:0;right:auto;transition:width 75ms cubic-bezier(0.4, 0, 0.2, 1),height 75ms cubic-bezier(0.4, 0, 0.2, 1),margin 75ms cubic-bezier(0.4, 0, 0.2, 1);width:var(--mdc-switch-handle-width);height:var(--mdc-switch-handle-height);border-radius:var(--mdc-switch-handle-shape, var(--mat-sys-corner-full))}[dir=rtl] .mdc-switch__handle{left:auto;right:0}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle{width:var(--mat-switch-unselected-handle-size, 16px);height:var(--mat-switch-unselected-handle-size, 16px);margin:var(--mat-switch-unselected-handle-horizontal-margin, 0 8px)}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-switch-unselected-with-icon-handle-horizontal-margin, 0 4px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle{width:var(--mat-switch-selected-handle-size, 24px);height:var(--mat-switch-selected-handle-size, 24px);margin:var(--mat-switch-selected-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-switch-selected-with-icon-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch__handle:has(.mdc-switch__icons){width:var(--mat-switch-with-icon-handle-size, 24px);height:var(--mat-switch-with-icon-handle-size, 24px)}.mat-mdc-slide-toggle .mdc-switch:active:not(.mdc-switch--disabled) .mdc-switch__handle{width:var(--mat-switch-pressed-handle-size, 28px);height:var(--mat-switch-pressed-handle-size, 28px)}.mat-mdc-slide-toggle .mdc-switch--selected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-switch-selected-pressed-handle-horizontal-margin, 0 22px)}.mat-mdc-slide-toggle .mdc-switch--unselected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-switch-unselected-pressed-handle-horizontal-margin, 0 2px)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__handle::after{opacity:var(--mat-switch-disabled-selected-handle-opacity, 1)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__handle::after{opacity:var(--mat-switch-disabled-unselected-handle-opacity, 0.38)}.mdc-switch__handle::before,.mdc-switch__handle::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";width:100%;height:100%;left:0;position:absolute;top:0;transition:background-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1),border-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);z-index:-1}@media(forced-colors: active){.mdc-switch__handle::before,.mdc-switch__handle::after{border-color:currentColor}}.mdc-switch--selected:enabled .mdc-switch__handle::after{background:var(--mdc-switch-selected-handle-color, var(--mat-sys-on-primary))}.mdc-switch--selected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-selected-hover-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-selected-focus-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:active .mdc-switch__handle::after{background:var(--mdc-switch-selected-pressed-handle-color, var(--mat-sys-primary-container))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:hover:not(:focus):not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:focus:not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:active .mdc-switch__handle::after,.mdc-switch--selected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mdc-switch-disabled-selected-handle-color, var(--mat-sys-surface))}.mdc-switch--unselected:enabled .mdc-switch__handle::after{background:var(--mdc-switch-unselected-handle-color, var(--mat-sys-outline))}.mdc-switch--unselected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-unselected-hover-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-unselected-focus-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:active .mdc-switch__handle::after{background:var(--mdc-switch-unselected-pressed-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mdc-switch-disabled-unselected-handle-color, var(--mat-sys-on-surface))}.mdc-switch__handle::before{background:var(--mdc-switch-handle-surface-color)}.mdc-switch__shadow{border-radius:inherit;bottom:0;left:0;position:absolute;right:0;top:0}.mdc-switch:enabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-handle-elevation-shadow)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__shadow,.mdc-switch.mdc-switch--disabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-disabled-handle-elevation-shadow)}.mdc-switch__ripple{left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);z-index:-1;width:var(--mdc-switch-state-layer-size, 40px);height:var(--mdc-switch-state-layer-size, 40px)}.mdc-switch__ripple::after{content:"";opacity:0}.mdc-switch--disabled .mdc-switch__ripple::after{display:none}.mat-mdc-slide-toggle-disabled-interactive .mdc-switch__ripple::after{display:block}.mdc-switch:hover .mdc-switch__ripple::after{opacity:.04;transition:75ms opacity cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mdc-switch .mdc-switch__ripple::after{opacity:.12}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:focus .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:active .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:hover:not(:focus) .mdc-switch__ripple::after,.mdc-switch--unselected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mdc-switch-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-switch--unselected:enabled:focus .mdc-switch__ripple::after{background:var(--mdc-switch-unselected-focus-state-layer-color, var(--mat-sys-on-surface))}.mdc-switch--unselected:enabled:active .mdc-switch__ripple::after{background:var(--mdc-switch-unselected-pressed-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mdc-switch-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch--selected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mdc-switch-selected-hover-state-layer-color, var(--mat-sys-primary))}.mdc-switch--selected:enabled:focus .mdc-switch__ripple::after{background:var(--mdc-switch-selected-focus-state-layer-color, var(--mat-sys-primary))}.mdc-switch--selected:enabled:active .mdc-switch__ripple::after{background:var(--mdc-switch-selected-pressed-state-layer-color, var(--mat-sys-primary));opacity:var(--mdc-switch-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch__icons{position:relative;height:100%;width:100%;z-index:1}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__icons{opacity:var(--mdc-switch-disabled-unselected-icon-opacity, 0.38)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__icons{opacity:var(--mdc-switch-disabled-selected-icon-opacity, 0.38)}.mdc-switch__icon{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;opacity:0;transition:opacity 30ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-switch--unselected .mdc-switch__icon{width:var(--mdc-switch-unselected-icon-size, 16px);height:var(--mdc-switch-unselected-icon-size, 16px);fill:var(--mdc-switch-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mdc-switch-disabled-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__icon{width:var(--mdc-switch-selected-icon-size, 16px);height:var(--mdc-switch-selected-icon-size, 16px);fill:var(--mdc-switch-selected-icon-color, var(--mat-sys-on-primary-container))}.mdc-switch--selected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mdc-switch-disabled-selected-icon-color, var(--mat-sys-on-surface))}.mdc-switch--selected .mdc-switch__icon--on,.mdc-switch--unselected .mdc-switch__icon--off{opacity:1;transition:opacity 45ms 30ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle{-webkit-user-select:none;user-select:none;display:inline-block;-webkit-tap-highlight-color:rgba(0,0,0,0);outline:0}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple,.mat-mdc-slide-toggle .mdc-switch__ripple::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple:not(:empty),.mat-mdc-slide-toggle .mdc-switch__ripple::after:not(:empty){transform:translateZ(0)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mat-focus-indicator::before{content:""}.mat-mdc-slide-toggle .mat-internal-form-field{color:var(--mat-switch-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-switch-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-switch-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-switch-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-switch-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-switch-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-slide-toggle .mat-ripple-element{opacity:.12}.mat-mdc-slide-toggle .mat-focus-indicator::before{border-radius:50%}.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle-track,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__icon,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::after,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::after{transition:none}.mat-mdc-slide-toggle .mdc-switch:enabled+.mdc-label{cursor:pointer}.mat-mdc-slide-toggle .mdc-switch--disabled+label{color:var(--mdc-switch-disabled-label-text-color)}'],encapsulation:2,changeDetection:0})}return t})();var fb=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=V({type:t});static \u0275inj=q({imports:[zE,SA,SA]})}return t})();var cr=class t{downloadBase64Data(e,A,i="image.png"){try{let o=document.createElement("a");o.href=e,o.download=i,document.body.appendChild(o),o.click(),document.body.removeChild(o)}catch(o){throw console.error("Error downloading base64 data:",o),o}}static \u0275fac=function(A){return new(A||t)};static \u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})};function CZ(t,e){t&1&&W(0,"hr",10)}function BZ(t,e){if(t&1&&(u(0,"mat-option",11),v(1),m()),t&2){let A=e.$implicit;F("value",A),f(),PA(A.versionId)}}function QZ(t,e){if(t&1&&W(0,"img",12),t&2){let A,i=b().index,o=b();F("src",(A=o.selectedArtifacts[i].data)!==null&&A!==void 0?A:"",An)}}function EZ(t,e){if(t&1){let A=aA();u(0,"div",2),_(1,CZ,1,0,"hr",3),u(2,"div",4)(3,"span"),v(4),m()(),u(5,"div",4)(6,"span"),v(7," Version: "),m(),u(8,"div",5)(9,"mat-select",6),fi("ngModelChange",function(o){let g=H(A).index,n=b();return $i(n.selectedArtifacts[g],o)||(n.selectedArtifacts[g]=o),T(o)}),x("selectionChange",function(o){let g=H(A).index,n=b();return T(n.onArtifactVersionChange(o,g))}),_(10,BZ,2,2,"mat-option",7),m()(),u(11,"button",8),x("click",function(){let o=H(A).index,g=b();return T(g.downloadArtifact(g.selectedArtifacts[o]))}),u(12,"mat-icon"),v(13,"file_download"),m(),v(14," Download "),m()(),_(15,QZ,1,1,"img",9),m()}if(t&2){let A=e.$implicit,i=e.index,o=b();f(),F("ngIf",i>0),f(3),te(" ",o.getArtifactName(A)," "),f(5),mi("ngModel",o.selectedArtifacts[i]),f(),F("ngForOf",o.getSortedArtifactsFromId(A)),f(5),F("ngIf",o.isArtifactImage(o.selectedArtifacts[i]))}}var cZ="default_artifact_name",Fa=class t{constructor(e){this.downloadService=e}artifacts=[];selectedArtifacts=[];ngOnChanges(e){if(e.artifacts){this.selectedArtifacts=[];for(let A of this.getDistinctArtifactIds())this.selectedArtifacts.push(this.getSortedArtifactsFromId(A)[0])}}downloadArtifact(e){this.downloadService.downloadBase64Data(e.data,e.mimeType,e.id)}getArtifactName(e){return e??cZ}isArtifactImage(e){return!e||!e.mimeType?!1:e.mimeType.startsWith("image/")}getDistinctArtifactIds(){return[...new Set(this.artifacts.map(e=>e.id))]}getSortedArtifactsFromId(e){return this.artifacts.filter(A=>A.id===e).sort((A,i)=>i.versionId-A.versionId)}onArtifactVersionChange(e,A){this.selectedArtifacts[A]=e.value}static \u0275fac=function(A){return new(A||t)(AA(cr))};static \u0275cmp=O({type:t,selectors:[["app-artifact-tab"]],inputs:{artifacts:"artifacts"},standalone:!1,features:[VA],decls:2,vars:1,consts:[[1,"artifact-container"],["class","artifact-box",4,"ngFor","ngForOf"],[1,"artifact-box"],["class","white-separator",4,"ngIf"],[1,"artifact-metadata"],[1,"version-select-container"],[3,"ngModelChange","selectionChange","ngModel"],[3,"value",4,"ngFor","ngForOf"],["mat-flat-button","",1,"download-button",3,"click"],["class","generated-image","alt","artifact.id",3,"src",4,"ngIf"],[1,"white-separator"],[3,"value"],["alt","artifact.id",1,"generated-image",3,"src"]],template:function(A,i){A&1&&(u(0,"div",0),_(1,EZ,16,5,"div",1),m()),A&2&&(f(),F("ngForOf",i.getDistinctArtifactIds()))},dependencies:[Rt,Jt,oo,yi,Ir,bt,ir,hg],styles:[".artifact-container[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}.artifact-box[_ngcontent-%COMP%]{padding:10px;max-width:100%;margin-left:26px;display:flex;flex-direction:column}.artifact-metadata[_ngcontent-%COMP%]{display:flex;align-items:center;margin-bottom:15px}.download-button[_ngcontent-%COMP%]{background-color:#8ab4f8!important;margin-left:35px;width:130px;height:28px;font-size:14px}.generated-image[_ngcontent-%COMP%]{max-width:60%;border-radius:8px}hr.white-separator[_ngcontent-%COMP%]{border:none;border-top:1px solid white;margin-bottom:1.2em;margin-right:15px}.version-select-container[_ngcontent-%COMP%]{background-color:#212123;width:80px;margin-left:15px}"]})};var ba=class t{sessionState={};constructor(){}static \u0275fac=function(A){return new(A||t)};static \u0275cmp=O({type:t,selectors:[["app-state-tab"]],inputs:{sessionState:"sessionState"},standalone:!1,decls:3,vars:1,consts:[[1,"state-wrapper"],[3,"json"]],template:function(A,i){A&1&&(u(0,"div",0)(1,"div"),W(2,"ngx-json-viewer",1),m()()),A&2&&(f(2),F("json",i.sessionState))},dependencies:[OE],styles:[".state-wrapper[_ngcontent-%COMP%]{padding-left:25px;padding-right:25px;margin-top:16px}"]})};var hZ=["videoContainer"],uZ=["sidenav"],DZ=["autoScroll"],mZ=()=>[],fZ=(t,e)=>({"user-message":t,"bot-message":e}),wb=t=>({"background-color":t});function wZ(t,e){if(t&1&&(u(0,"mat-option",20),v(1),m()),t&2){let A=e.$implicit;F("value",A),f(),PA(A)}}function pZ(t,e){t&1&&tn(0,wZ,2,2,"mat-option",20,en),t&2&&on(e)}function yZ(t,e){if(t&1&&(u(0,"mat-option",20),v(1),m()),t&2){let A=b(2);F("value",A.selectedAppControl.value),f(),PA(A.selectedAppControl.value)}}function MZ(t,e){if(t&1&&(u(0,"div",10)(1,"mat-select",19),_(2,pZ,2,0),rg(3,"async"),_(4,yZ,2,2,"mat-option",20),m()()),t&2){let A,i=b();f(),F("placeholder",i.isLoadingApps()?"Loading...":"Select an agent")("formControl",i.selectedAppControl),f(),wA((A=Ds(3,4,i.apps$))?2:-1,A),f(2),wA(i.selectedAppControl.value&&i.isLoadingApps()?4:-1)}}function RZ(t,e){t&1&&(u(0,"span"),v(1," No apps Avaiable in current directory"),m())}function kZ(t,e){t&1&&(u(0,"span",29),v(1,"Events"),m())}function FZ(t,e){t&1&&(u(0,"span",29),v(1,"State"),m())}function bZ(t,e){t&1&&(u(0,"span",29),v(1,"Artifacts"),m())}function SZ(t,e){t&1&&(u(0,"span",29),v(1,"Sessions"),m())}function NZ(t,e){t&1&&(u(0,"span",29),v(1,"Eval"),m())}function GZ(t,e){if(t&1){let A=aA();u(0,"div",21)(1,"mat-tab-group")(2,"mat-tab",22),_(3,kZ,2,0,"ng-template",23),u(4,"app-event-tab",24),x("selectedEvent",function(o){H(A);let g=b();return T(g.selectEvent(o))}),m()(),u(5,"mat-tab"),_(6,FZ,2,0,"ng-template",23),W(7,"app-state-tab",25),m(),u(8,"mat-tab"),_(9,bZ,2,0,"ng-template",23),W(10,"app-artifact-tab",26),m(),u(11,"mat-tab"),_(12,SZ,2,0,"ng-template",23),u(13,"app-session-tab",27),x("sessionSelected",function(o){H(A);let g=b();return T(g.updateWithSelectedSession(o))})("sessionReloaded",function(o){H(A);let g=b();return T(g.updateSessionState(o))}),m()(),u(14,"mat-tab"),_(15,NZ,2,0,"ng-template",23),u(16,"app-eval-tab",28),x("sessionSelected",function(o){H(A);let g=b();return T(g.updateWithSelectedSession(o))}),m()()()()}if(t&2){let A=b();f(4),F("eventsMap",A.eventData),f(3),F("sessionState",A.currentSessionState),f(3),F("artifacts",A.artifacts),f(3),F("userId",A.userId)("appName",A.appName)("sessionId",A.sessionId),f(3),F("appName",A.appName)("userId",A.userId)("sessionId",A.sessionId)}}function vZ(t,e){if(t&1&&W(0,"div",41),t&2){let A=b(2);F("innerHtml",A.renderedEventGraph,jp)}}function LZ(t,e){if(t&1){let A=aA();u(0,"div",30)(1,"div",31)(2,"div",32)(3,"mat-paginator",33),x("page",function(o){H(A);let g=b();return T(g.handlePageEvent(o))}),m(),u(4,"button",34)(5,"mat-icon",9),x("click",function(){H(A);let o=b();return T(o.closeSelectedEvent())}),v(6,"close"),m()()()(),u(7,"div")(8,"mat-tab-group")(9,"mat-tab",35)(10,"div",36),_(11,vZ,1,1,"div",37),m(),W(12,"ngx-json-viewer",38),m(),u(13,"mat-tab",39),W(14,"ngx-json-viewer",38),m(),u(15,"mat-tab",40),W(16,"ngx-json-viewer",38),m()()()()}if(t&2){let A=b();f(3),F("length",A.eventData.size)("pageSize",1)("pageIndex",A.selectedEventIndex),f(8),F("ngIf",A.renderedEventGraph),f(),F("json",A.selectedEvent),f(2),F("json",A.llmRequest),f(2),F("json",A.llmResponse)}}function KZ(t,e){if(t&1){let A=aA();u(0,"div",42)(1,"div",43)(2,"div",44),v(3,"Session ID"),m(),u(4,"div",45),v(5),m()(),u(6,"div",46)(7,"div",47)(8,"mat-slide-toggle",48),x("change",function(){H(A);let o=b();return T(o.toggleSse())}),v(9," Token Streaming "),m()(),W(10,"mat-divider",49),u(11,"div",50)(12,"div",51),x("click",function(){H(A);let o=b();return T(o.onNewSessionClick())}),u(13,"mat-icon"),v(14,"add"),m(),v(15," New Session "),m(),u(16,"span",52),x("click",function(){H(A);let o=b();return T(o.deleteSession(o.sessionId))}),v(17," delete "),m()()()()}if(t&2){let A=b();f(5),PA(A.sessionId),f(3),F("checked",A.enableSseIndicator()),f(2),F("vertical",!0)}}function UZ(t,e){t&1&&(u(0,"div",53)(1,"span"),v(2,"Loading agents, please wait..."),m()())}function _Z(t,e){t&1&&(u(0,"span"),v(1,"Welcome to ADK!"),W(2,"br"),v(3," Select an agent on the left to begin with."),m())}function xZ(t,e){if(t&1&&(v(0," Error message: "),W(1,"br"),u(2,"pre",55),v(3),m()),t&2){let A=b(4);f(3),PA(A.loadingError())}}function YZ(t,e){t&1&&(u(0,"pre",54),v(1,"Warning: No agents found in current folder."),m())}function JZ(t,e){if(t&1&&(u(0,"div"),v(1," Failed to load agents. To get started, run "),u(2,"pre"),v(3,"adk web"),m(),v(4," in the folder that contains the agents."),W(5,"br"),_(6,xZ,4,1)(7,YZ,2,0,"pre",54),m()),t&2){let A=b(3);f(6),wA(A.loadingError()?6:7)}}function HZ(t,e){if(t&1&&(u(0,"div",53),_(1,_Z,4,0,"span"),rg(2,"async"),_(3,JZ,8,1,"div"),m()),t&2){let A=b(2);f(),wA((Ds(2,1,A.apps$)||I0(3,mZ)).length>0?1:3)}}function TZ(t,e){if(t&1&&_(0,UZ,3,0,"div",53)(1,HZ,4,4,"div",53),t&2){let A=b();wA(A.isLoadingApps()?0:1)}}function OZ(t,e){if(t&1){let A=aA();u(0,"button",56),x("click",function(){H(A);let o=b();return T(o.openDialog())}),u(1,"mat-icon"),v(2,"priority_high"),m()()}}function PZ(t,e){if(t&1){let A=aA();u(0,"button",67),x("click",function(){H(A);let o=b().index,g=b(2);return T(g.clickEvent(o))}),u(1,"mat-icon",68),v(2,"robot_2"),m()()}}function ZZ(t,e){if(t&1&&(ui(0),W(1,"img",72),Di()),t&2){let A=b().$implicit;f(),F("src",A.url,An)}}function qZ(t,e){if(t&1&&(ui(0),u(1,"mat-icon"),v(2,"insert_drive_file"),m(),u(3,"a",73),v(4),m(),Di()),t&2){let A=b().$implicit;f(3),F("href",A.url,An),f(),PA(A.file.name)}}function VZ(t,e){if(t&1&&(u(0,"div",71),_(1,ZZ,2,1,"ng-container",64)(2,qZ,5,2,"ng-container",64),m()),t&2){let A=e.$implicit;f(),F("ngIf",A.file.type.startsWith("image/")),f(),F("ngIf",!A.file.type.startsWith("image/"))}}function WZ(t,e){if(t&1&&(u(0,"div",69),_(1,VZ,3,2,"div",70),m()),t&2){let A=b().$implicit;f(),F("ngForOf",A.attachments)}}function zZ(t,e){if(t&1&&W(0,"markdown",74),t&2){let A=b().$implicit;F("data",A.text)}}function jZ(t,e){if(t&1&&(u(0,"code"),v(1),m()),t&2){let A=b().$implicit;f(),te(" ",A.executableCode.code," ")}}function XZ(t,e){if(t&1&&(u(0,"div")(1,"div"),v(2),m(),u(3,"div"),v(4),m()()),t&2){let A=b().$implicit;f(2),te("Outcome: ",A.codeExecutionResult.outcome,""),f(2),te("Output: ",A.codeExecutionResult.output,"")}}function $Z(t,e){if(t&1&&(u(0,"div"),W(1,"img",75),m()),t&2){let A=b().$implicit;f(),F("src",A.inline_data.data,An)}}function Aq(t,e){if(t&1){let A=aA();u(0,"button",76),x("click",function(){H(A);let o=b().index,g=b(2);return T(g.clickEvent(o))}),u(1,"mat-icon"),v(2,"bolt"),m(),v(3),m()}if(t&2){let A=b().$implicit;f(3),te(" ",A.functionCall.name," ")}}function eq(t,e){if(t&1){let A=aA();u(0,"button",76),x("click",function(){H(A);let o=b().index,g=b(2);return T(g.clickEvent(o))}),u(1,"mat-icon"),v(2,"check"),m(),v(3),m()}if(t&2){let A=b().$implicit;f(3),te(" ",A.functionResponse.name," ")}}function tq(t,e){t&1&&(u(0,"button",34)(1,"mat-icon"),v(2,"person"),m()())}function iq(t,e){if(t&1&&(u(0,"div",59),_(1,PZ,3,0,"button",60),u(2,"mat-card",61),_(3,WZ,2,1,"div",62)(4,zZ,1,1,"markdown",63)(5,jZ,2,1,"code",64)(6,XZ,5,2,"div",64)(7,$Z,2,1,"div",64)(8,Aq,4,1,"button",65)(9,eq,4,1,"button",65),m(),_(10,tq,3,0,"button",66),m()),t&2){let A=e.$implicit;F("ngClass",us(10,fZ,A.role==="user",A.role==="bot")),f(),F("ngIf",A.role==="bot"),f(2),F("ngIf",A.attachments),f(),F("ngIf",A.text),f(),F("ngIf",A.executableCode),f(),F("ngIf",A.codeExecutionResult),f(),F("ngIf",A.inline_data&&A.role==="bot"),f(),F("ngIf",A.functionCall),f(),F("ngIf",A.functionResponse),f(),F("ngIf",A.role==="user")}}function oq(t,e){if(t&1&&(u(0,"div",57,1),W(2,"div",null,2),_(4,iq,11,13,"div",58),m()),t&2){let A=b();f(4),F("ngForOf",A.messages)}}function gq(t,e){if(t&1){let A=aA();u(0,"div",90),W(1,"img",91),u(2,"button",92),x("click",function(){H(A);let o=b().index,g=b(3);return T(g.removeFile(o))}),u(3,"mat-icon",93),v(4,"close"),m()()()}if(t&2){let A=b().$implicit;f(),F("src",A.url,An)}}function nq(t,e){if(t&1){let A=aA();u(0,"div",94)(1,"button",92),x("click",function(){H(A);let o=b().index,g=b(3);return T(g.removeFile(o))}),u(2,"mat-icon",93),v(3,"close"),m()(),u(4,"div",95)(5,"mat-icon"),v(6,"insert_drive_file"),m(),u(7,"span"),v(8),m()()()}if(t&2){let A=b().$implicit;f(8),PA(A.file.name)}}function sq(t,e){if(t&1&&(u(0,"div"),_(1,gq,5,1,"div",88)(2,nq,9,1,"div",89),m()),t&2){let A=e.$implicit;f(),F("ngIf",A.file.type.startsWith("image/")),f(),F("ngIf",!A.file.type.startsWith("image/"))}}function rq(t,e){if(t&1&&(u(0,"div",86),_(1,sq,3,2,"div",87),m()),t&2){let A=b(2);f(),F("ngForOf",A.selectedFiles)}}function Iq(t,e){if(t&1){let A=aA();u(0,"div",77)(1,"input",78,3),x("change",function(o){H(A);let g=b();return T(g.onFileSelect(o))}),m(),u(3,"mat-form-field",79),_(4,rq,2,1,"div",80),u(5,"input",81),fi("ngModelChange",function(o){H(A);let g=b();return $i(g.userInput,o)||(g.userInput=o),T(o)}),x("keydown.enter",function(o){H(A);let g=b();return T(g.sendMessage(o))}),m(),u(6,"div",82)(7,"button",83),x("click",function(){H(A);let o=He(2);return T(o.click())}),u(8,"mat-icon"),v(9,"attach_file"),m()(),u(10,"div")(11,"button",84),x("click",function(){H(A);let o=b();return T(o.toggleAudioRecording())}),W(12,"mat-icon",85),m(),u(13,"button",84),x("click",function(){H(A);let o=b();return T(o.toggleVideoRecording())}),W(14,"mat-icon",85),m()()()()()}if(t&2){let A=b();f(4),F("ngIf",A.selectedFiles.length&&A.appName!=""),f(),mi("ngModel",A.userInput),f(6),F("ngStyle",gn(6,wb,A.isAudioRecording?"rgb(234, 67, 53)":"rgb(51, 53, 55)")),f(),F("innerText",A.isAudioRecording?"stop":"mic"),f(),F("ngStyle",gn(8,wb,A.isVideoRecording?"rgb(234, 67, 53)":"rgb(51, 53, 55)")),f(),F("innerText",A.isVideoRecording?"stop":"videocam")}}function aq(t){for(t=t.replace(/-/g,"+").replace(/_/g,"/");t.length%4!==0;)t+="=";return t}var Em=class extends yn{nextPageLabel="Next Event";previousPageLabel="Previous Event";firstPageLabel="First Event";lastPageLabel="Last Event";getRangeLabel=(e,A,i)=>i===0?`Event 0 of ${i}`:(i=Math.max(i,0),`Event ${e*A+1} of ${i}`)},Sa=class t{constructor(e,A,i,o,g,n,s,r,I){this.sanitizer=e;this.sesisonService=A;this.artifactService=i;this.audioService=o;this.webSocketService=g;this.videoService=n;this.dialog=s;this.eventService=r;this.sessionService=I}videoContainer;sidenav;eventTabComponent;sessionTab;evalTab;scrollContainer;_snackBar=Q(Ok);enableSseIndicator=_t(!1);videoElement;currentMessage="";messages=[];lastTextChunk="";streamingTextMessage=null;artifacts=[];userInput="";userId="user";appName="";sessionId="";isAudioRecording=!1;isVideoRecording=!1;longRunningEvents=[];functionCallEventId="";redirectUri=ot.getBaseUrlWithoutPath();showSidePanel=!0;useSse=!1;currentSessionState={};eventData=new Map;eventMessageIndexArray=[];renderedEventGraph;selectedEvent=void 0;selectedEventIndex=void 0;llmRequest=void 0;llmResponse=void 0;llmRequestKey="gcp.vertex.agent.llm_request";llmResponseKey="gcp.vertex.agent.llm_response";selectedFiles=[];previousMessageCount=0;router=Q(ao);activatedRoute=Q(Io);selectedAppControl=new dQ("",{nonNullable:!0});agentService=Q(fg);isLoadingApps=_t(!1);loadingError=_t("");apps$=tA([]).pipe(Ie(()=>{this.isLoadingApps.set(!0),this.selectedAppControl.disable()}),re(()=>this.agentService.listApps().pipe(lt(e=>(this.loadingError.set(e.message),tA(void 0))))),de(1),Ie(()=>{this.isLoadingApps.set(!1),this.selectedAppControl.enable()}),Ro());ngOnInit(){if(this.syncSelectedAppFromUrl(),this.updateSelectedAppUrl(),new URL(window.location.href).searchParams.has("code")){let i=window.location.href;window.opener?.postMessage({authResponseUrl:i},window.origin),window.close()}this.agentService.getApp().subscribe(i=>{this.appName=i})}ngAfterViewInit(){this.showSidePanel=!0,this.sidenav.open()}ngAfterViewChecked(){this.messages.length!==this.previousMessageCount&&(this.scrollContainer.nativeElement.scrollTop=this.scrollContainer.nativeElement.scrollHeight,this.previousMessageCount=this.messages.length)}selectApp(e){e!=this.appName&&(this.agentService.setApp(e),this.createSession(),this.eventData=new Map,this.eventMessageIndexArray=[],this.messages=[],this.artifacts=[],this.userInput="",this.longRunningEvents=[])}createSession(){this.sesisonService.createSession(this.userId,this.appName).subscribe(e=>{this.currentSessionState=e.state,this.sessionId=e.id,this.sessionTab.refreshSession()})}sendMessage(e){return qe(this,null,function*(){if(e.preventDefault(),!this.userInput.trim())return;if(this.selectedFiles.length>0){let o=this.selectedFiles.map(g=>({file:g.file,url:g.url}));this.messages.push({role:"user",attachments:o})}this.messages.push({role:"user",text:this.userInput});let A={app_name:this.appName,user_id:this.userId,session_id:this.sessionId,new_message:{role:"user",parts:yield this.getUserMessageParts()},streaming:this.useSse};this.selectedFiles=[];let i=this.eventMessageIndexArray.length-1;this.streamingTextMessage=null,this.agentService.run_sse(A).subscribe({next:o=>qe(this,null,function*(){let g=JSON.parse(o);if(g.error){this.openSnackBar(g.error,"OK");return}if(g.content)for(let n of g.content.parts)i+=1,this.processPart(g,n,i)}),error:o=>console.error("SSE error:",o),complete:()=>{this.streamingTextMessage=null,this.sessionTab.reloadSession(this.sessionId)}}),this.userInput=""})}processPart(e,A,i){if(A.text){let o=A.text;if(this.streamingTextMessage){if(o==this.streamingTextMessage.text){this.storeEvents(A,e,i),this.eventMessageIndexArray[i]=o,this.streamingTextMessage=null;return}this.streamingTextMessage.text+=o}else if(this.streamingTextMessage={role:"bot",text:o},this.messages.push(this.streamingTextMessage),!this.useSse){this.storeEvents(A,e,i),this.eventMessageIndexArray[i]=o,this.streamingTextMessage=null;return}}else this.storeEvents(A,e,i),this.storeMessage(A,e,i)}getUserMessageParts(){return qe(this,null,function*(){let e=[{text:`${this.userInput}`}];if(this.selectedFiles.length>0)for(let A of this.selectedFiles)e.push({inline_data:{data:yield this.readFileAsBytes(A.file),mime_type:A.file.type}});return e})}readFileAsBytes(e){return new Promise((A,i)=>{let o=new FileReader;o.onload=g=>{let n=g.target.result.split(",")[1];A(n)},o.onerror=i,o.readAsDataURL(e)})}updateRedirectUri(e,A){try{let i=new URL(e);return i.searchParams.set("redirect_uri",A),i.toString()}catch(i){return console.warn("Failed to update redirect URI: ",i),e}}storeMessage(e,A,i){if(A.long_running_tool_ids&&A.long_running_tool_ids.length>0){this.getAsyncFunctionsFromParts(A.long_running_tool_ids,A.content.parts);let o=this.longRunningEvents[0];if(o.args.auth_config&&o.args.auth_config.exchanged_auth_credential&&o.args.auth_config.exchanged_auth_credential.oauth2){let g=o.args.auth_config.exchanged_auth_credential.oauth2.auth_uri,n=this.updateRedirectUri(g,this.redirectUri);this.openOAuthPopup(n).then(s=>{this.functionCallEventId=A.id,this.sendOAuthResponse(o,s,this.redirectUri)}).catch(s=>{console.error("OAuth Error:",s)})}else this.functionCallEventId=A.id}if(e.text)this.messages.push({role:A.author==="user"?"user":"bot",text:e.text}),this.eventMessageIndexArray[i]=e.text;else if(e.functionCall)this.messages.push({role:A.author==="user"?"user":"bot",functionCall:e.functionCall}),this.eventMessageIndexArray[i]=e.functionCall;else if(e.functionResponse){if(this.messages.push({role:A.author==="user"?"user":"bot",functionResponse:e.functionResponse}),A.actions&&A.actions.artifact_delta)for(let o in A.actions.artifact_delta)A.actions.artifact_delta.hasOwnProperty(o)&&this.renderArtifact(o,A.actions.artifact_delta[o]);this.eventMessageIndexArray[i]=e.functionResponse}else if(e.executableCode)this.messages.push({role:A.author==="user"?"user":"bot",executableCode:e.executableCode}),this.eventMessageIndexArray[i]=e.executableCode;else if(e.codeExecutionResult&&(this.messages.push({role:A.author==="user"?"user":"bot",codeExecutionResult:e.codeExecutionResult}),this.eventMessageIndexArray[i]=e.codeExecutionResult,A.actions&&A.actions.artifact_delta))for(let o in A.actions.artifact_delta)A.actions.artifact_delta.hasOwnProperty(o)&&this.renderArtifact(o,A.actions.artifact_delta[o])}renderArtifact(e,A){this.messages.push({role:"bot",inline_data:{data:"",mime_type:"image/png"}});let i=this.messages.length-1;this.artifactService.getArtifactVersion(this.userId,this.appName,this.sessionId,e,A).subscribe(o=>{let g=o.inlineData.mimeType,n=aq(o.inlineData.data),s=`data:${g};base64,${n}`;this.messages[i]={role:"bot",inline_data:{data:s,mime_type:g}},this.artifacts=[...this.artifacts,{id:e,data:s,mimeType:g,versionId:A}]})}storeEvents(e,A,i){let o=A.content.role+":";e.text?o+=i+e.text:e.functionCall?o+="functionCall:"+i+":"+e.functionCall.name:e.functionResponse?o+="functionResponse:"+i+":"+e.functionResponse.name:e.executableCode?o+="executableCode:"+i+":"+e.executableCode.code.slice(0,10):e.codeExecutionResult&&(o+="codeExecutionResult:"+i+":"+e.codeExecutionResult.outcome),this.eventData.set(o,A),this.eventData=new Map(this.eventData)}sendOAuthResponse(e,A,i){this.longRunningEvents.pop();let o={app_name:this.appName,user_id:this.userId,session_id:this.sessionId,new_message:{role:"user",parts:[]}};var g=e.args.auth_config;g.exchanged_auth_credential.oauth2.auth_response_uri=A,g.exchanged_auth_credential.oauth2.redirect_uri=i,o.function_call_event_id=this.functionCallEventId,o.new_message.parts.push({function_response:{id:e.id,name:e.name,response:g}}),this.agentService.run(o).subscribe(n=>{let s=this.eventMessageIndexArray.length-1;for(let r of n)if(r.content)for(let I of r.content.parts)s+=1,this.processPart(r,I,s)})}openDialog(){this.dialog.open(ma,{width:"600px",data:{event:this.longRunningEvents[0],app_name:this.appName,user_id:this.userId,session_id:this.sessionId,function_call_event_id:this.functionCallEventId}}).afterClosed().subscribe(A=>{A&&(this.longRunningEvents=A.events,this.messages.push({role:"bot",text:A.text}))})}clickEvent(e){let A=Array.from(this.eventData.entries())[e-this.userMessagesLength(e)],[i,o]=A;this.sidenav.open(),this.showSidePanel=!0,this.selectedEvent=o,this.selectedEventIndex=this.getIndexOfKeyInMap(i),this.eventService.getEventTrace(this.selectedEvent.id).subscribe(g=>{this.llmRequest=JSON.parse(g[this.llmRequestKey]),this.llmResponse=JSON.parse(g[this.llmResponseKey])}),this.eventService.getEvent(this.userId,this.appName,this.sessionId,this.selectedEvent.id).subscribe(g=>qe(this,null,function*(){if(!g.dot_src){this.renderedEventGraph=void 0;return}let n=g.dot_src,r=(yield pD()).renderString(n,{format:"svg",engine:"dot"});this.renderedEventGraph=this.sanitizer.bypassSecurityTrustHtml(r)}))}userMessagesLength(e){return this.messages.slice(0,e).filter(A=>A.role=="user").length}ngOnDestroy(){this.webSocketService.closeConnection()}toggleAudioRecording(){this.isAudioRecording?this.stopAudioRecording():this.startAudioRecording(),this.isAudioRecording=!this.isAudioRecording}startAudioRecording(){let e=window.location.protocol==="https:"?"wss":"ws";this.webSocketService.connect(`${e}://${ot.getWSServerUrl()}/run_live?app_name=${this.appName}&user_id=${this.userId}&session_id=${this.sessionId}`),this.audioService.startRecording(),this.messages.push({role:"user",text:"Speaking..."}),this.messages.push({role:"bot",text:"Speaking..."})}stopAudioRecording(){this.audioService.stopRecording(),this.webSocketService.closeConnection()}toggleVideoRecording(){this.isVideoRecording?this.stopVideoRecording():this.startVideoRecording(),this.isVideoRecording=!this.isVideoRecording}startVideoRecording(){let e=window.location.protocol==="https:"?"wss":"ws";this.webSocketService.connect(`${e}://${ot.getWSServerUrl()}/run_live?app_name=${this.appName}&user_id=${this.userId}&session_id=${this.sessionId}`),this.videoService.startRecording(this.videoContainer),this.audioService.startRecording(),this.messages.push({role:"user",text:"Speaking..."})}stopVideoRecording(){this.audioService.stopRecording(),this.videoService.stopRecording(this.videoContainer),this.webSocketService.closeConnection()}getAsyncFunctionsFromParts(e,A){for(let i of A)i.functionCall&&e.includes(i.functionCall.id)&&this.longRunningEvents.push(i.functionCall)}openOAuthPopup(e){return new Promise((A,i)=>{if(!window.open(e,"oauthPopup","width=600,height=700")){i("Popup blocked!");return}window.addEventListener("message",g=>{if(g.origin!==window.location.origin)return;let{authResponseUrl:n}=g.data;n?A(n):i("OAuth failed")},{once:!0})})}toggleSidePanel(){this.showSidePanel=!this.showSidePanel}updateWithSelectedSession(e){if(!e||!e.id||!e.events||!e.state){console.log("Session is not valid");return}this.sessionId=e.id,this.currentSessionState=e.state,this.eventData.clear(),this.eventMessageIndexArray=[],this.messages=[],this.artifacts=[];let A=0;e.events.forEach(i=>{i.content.parts.forEach(o=>{this.storeMessage(o,i,A),A+=1,i.author&&i.author!=="user"&&this.storeEvents(o,i,A)})})}updateSessionState(e){this.currentSessionState=e.state}onNewSessionClick(){this.createSession(),this.eventData.clear(),this.eventMessageIndexArray=[],this.messages=[],this.artifacts=[]}onFileSelect(e){let A=e.target;if(A.files)for(let i=0;i{this.llmRequest=JSON.parse(A[this.llmRequestKey]),this.llmResponse=JSON.parse(A[this.llmResponseKey])}),this.eventService.getEvent(this.userId,this.appName,this.sessionId,this.selectedEvent.id).subscribe(A=>qe(this,null,function*(){if(!A.dot_src){this.renderedEventGraph=void 0;return}let i=A.dot_src,g=(yield pD()).renderString(i,{format:"svg",engine:"dot"});this.renderedEventGraph=this.sanitizer.bypassSecurityTrustHtml(g)}))}deleteSession(e){let A={title:"Confirm delete",message:`Are you sure you want to delete this session ${this.sessionId}?`,confirmButtonText:"Delete",cancelButtonText:"Cancel"};this.dialog.open(fa,{width:"600px",data:A}).afterClosed().subscribe(o=>{o&&this.sessionService.deleteSession(this.userId,this.appName,e).subscribe(g=>{let n=this.sessionTab.refreshSession();n?this.sessionTab.getSession(n.id):window.location.reload()})})}syncSelectedAppFromUrl(){this.router.events.pipe(RA(e=>e instanceof Ot),oA(()=>this.activatedRoute.snapshot.queryParams)).subscribe(e=>{let A=e.app;A&&this.selectedAppControl.setValue(A)})}updateSelectedAppUrl(){this.selectedAppControl.valueChanges.pipe(Bi(),RA(Boolean)).subscribe(e=>{this.selectApp(e);let A=this.activatedRoute.snapshot.queryParams.app;e!==A&&this.router.navigate([],{queryParams:{app:e},queryParamsHandling:"merge"})})}handlePageEvent(e){if(e.pageIndex>=0){let A=this.getKeyAtIndexInMap(e.pageIndex);A&&this.selectEvent(A)}}closeSelectedEvent(){this.selectedEvent=void 0,this.selectedEventIndex=void 0}getIndexOfKeyInMap(e){let A=0,i=(g,n)=>0,o=Array.from(this.eventData.keys()).sort(i);for(let g of o){if(g===e)return A;A++}}getKeyAtIndexInMap(e){let A=(o,g)=>0,i=Array.from(this.eventData.keys()).sort(A);if(e>=0&&e0),f(),F("ngIf",i.appName!=""),f(),F("ngIf",i.appName!=""))},dependencies:[Yt,Rt,Jt,bh,io,oo,yi,YF,Ir,Eo,Mk,kg,bt,hE,gk,ok,fD,vF,OE,WD,zD,em,tm,$F,ir,hg,Db,zE,eu,kn,Fn,Rn,Fa,ba,EI],styles:[".drawer-container[_ngcontent-%COMP%]{height:100%;background-color:#131314}.generated-image[_ngcontent-%COMP%]{max-width:33%;border-radius:8px}.chat-container[_ngcontent-%COMP%]{width:100%;height:100%;max-width:1200px;margin:auto}.event-container[_ngcontent-%COMP%]{color:#fff}.drawer-header[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:flex-start;align-items:center}.drawer-header[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{width:36px;height:36px;color:#bdc1c6;cursor:pointer;display:flex;align-items:center;justify-content:center}.chat-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:500px;overflow:hidden;height:95%;box-shadow:none;background-color:#131314}.chat-messages[_ngcontent-%COMP%]{flex-grow:1;overflow-y:auto;padding:20px;margin-top:16px}.message-card[_ngcontent-%COMP%]{padding:5px 20px;margin:5px;border-radius:20px;max-width:80%;font-size:14px;font-weight:400}.user-message[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:center}.user-message[_ngcontent-%COMP%] .message-card[_ngcontent-%COMP%]{background-color:#004a77;align-self:flex-end;color:#fff;box-shadow:none}.bot-message[_ngcontent-%COMP%]{display:flex;align-items:center}.bot-message[_ngcontent-%COMP%] .message-card[_ngcontent-%COMP%]{background-color:#303030;align-self:flex-start;color:#fff;box-shadow:none}.navigation-button-sidepanel[_ngcontent-%COMP%]{margin-left:auto;margin-right:20px}.chat-input[_ngcontent-%COMP%]{display:flex;padding:10px;width:80%;margin:0 auto}.input-field[_ngcontent-%COMP%]{flex-grow:1}.input-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{color:#fff;border:none;padding:10px}.input-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::placeholder{color:#8e918f}.input-field[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:#fff;background-color:#333537}.chat-input-actions[_ngcontent-%COMP%]{margin-top:10px;display:flex;justify-content:space-between}.fab-button[_ngcontent-%COMP%]{position:fixed;bottom:200px;right:100px;z-index:1000}.sidepanel-toggle[_ngcontent-%COMP%]{position:relative;top:100px;z-index:1000}.sidenav[_ngcontent-%COMP%]{background-color:#1b1b1b;color:#fff;border-radius:0}.tabs-container[_ngcontent-%COMP%]{margin-top:20px;padding-left:10px;padding-right:10px}.tab-label[_ngcontent-%COMP%]{font-size:14px}.file-preview[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:5px;margin-top:2px;margin-bottom:8px}.file-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:5px;background:#eee;padding:5px;border-radius:4px}.image-preview[_ngcontent-%COMP%]{width:40px;height:40px;object-fit:cover;border-radius:4px}.image-preview-chat[_ngcontent-%COMP%]{max-width:90%;max-height:70vh;width:auto;height:auto;border-radius:8px;cursor:pointer;transition:transform .2s ease-in-out}button[_ngcontent-%COMP%]{margin-left:20px;margin-right:20px}.app-select[_ngcontent-%COMP%]{width:180px}.empty-state-container[_ngcontent-%COMP%]{color:#eee;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Open Sans,sans-serif;font-weight:400;letter-spacing:normal;line-height:24px;font-size:18px}.empty-state-container[_ngcontent-%COMP%] pre.warning[_ngcontent-%COMP%]{color:#ffc185}.empty-state-container[_ngcontent-%COMP%] pre.error[_ngcontent-%COMP%]{color:#ff4545}.function-event-button[_ngcontent-%COMP%]{background-color:#fff}[_nghost-%COMP%] .mat-mdc-text-field-wrapper{border:1px solid #8e918f}[_nghost-%COMP%] .input-field .mat-mdc-text-field-wrapper{border:1px solid #8e918f;border-radius:16px}[_nghost-%COMP%] .mdc-notched-outline__leading, [_nghost-%COMP%] .mdc-notched-outline__notch, [_nghost-%COMP%] .mdc-notched-outline__trailing{border:none}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{padding:0 10px 0 40px}[_nghost-%COMP%] .segment-key{color:#d3d3d3!important}[_nghost-%COMP%] .mat-mdc-mini-fab{background-color:#fff}[_nghost-%COMP%] .mat-mdc-mini-fab mat-icon{color:#000}[_nghost-%COMP%] .mat-drawer-inner-container{width:500px}.mat-mdc-select-placeholder[_ngcontent-%COMP%]{margin-left:20px}.new-session-button[_ngcontent-%COMP%]{margin-top:0;margin-left:50px;width:130px;height:28px;font-size:14px}.app-select-container[_ngcontent-%COMP%]{background-color:#212123;margin-left:20px;height:30px;display:flex;justify-content:space-between;padding-left:20px;padding-right:20px;border-radius:10px;padding-top:5px;margin-top:-2px}.drawer-header[_ngcontent-%COMP%]{--mat-select-placeholder-text-color: #8ab4f8}.drawer-header[_ngcontent-%COMP%]{--mat-select-enabled-trigger-text-color: #8ab4f8}.drawer-header[_ngcontent-%COMP%]{--mat-select-enabled-arrow-color: #8ab4f8}.event-paginator[_ngcontent-%COMP%]{background-color:inherit;display:flex;justify-content:center}[_nghost-%COMP%] .mat-mdc-paginator-page-size{display:none!important}.details-panel-container[_ngcontent-%COMP%]{position:absolute;height:98%;left:0;right:0;bottom:0;background:#242424;display:inline-block;justify-content:center;align-items:center;z-index:10}.details-content[_ngcontent-%COMP%]{color:#fff;font-size:14px}.event-paginator[_ngcontent-%COMP%]{margin-top:-8px;margin-right:160px}.adk-checkbox[_ngcontent-%COMP%]{position:fixed;bottom:0;left:0;right:0;margin-bottom:20px;margin-left:20px}.drawer-header[_ngcontent-%COMP%]{--mdc-filled-button-container-color: #89b4f8}.drawer-header[_ngcontent-%COMP%]{--mdc-filled-button-label-text-color: black}.chat-toolbar[_ngcontent-%COMP%]{position:sticky;top:0;height:48px;background:#1b1b1b;display:flex;justify-content:space-between;align-items:center;z-index:10}.toolbar-session-text[_ngcontent-%COMP%]{color:#fdfdfd;font-family:Roboto;font-size:12px;font-style:normal;font-weight:500;line-height:12px;letter-spacing:.8px;text-transform:uppercase;margin-left:20px;padding-top:4px}.toolbar-session-id[_ngcontent-%COMP%]{color:#9aa0a6;font-family:monospace;font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:.25px;margin-left:5px}.toolbar-actions[_ngcontent-%COMP%]{display:flex}.toolbar-new-sesison[_ngcontent-%COMP%]{font-size:14px;margin-right:16px;color:#9aa0a6;cursor:pointer;display:flex;align-items:center}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mat-switch-label-text-size: 14px}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mat-switch-label-text-color: #9aa0a6}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-selected-track-color: #8ab4f9}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-selected-focus-track-color: #8ab4f9}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-selected-hover-track-color: #8ab4f9}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-selected-handle-color: #1b73e8}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-selected-focus-handle-color: #1b73e8}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-selected-hover-handle-color: #1b73e8}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-track-height: 24px}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-track-width: 46px}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mat-switch-track-outline-color: #1b73e8}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mat-switch-with-icon-handle-size: 20px}.image-container[_ngcontent-%COMP%]{position:relative;display:inline-block;border-radius:12px;overflow:hidden}.image-preview[_ngcontent-%COMP%]{display:block;width:100%;height:auto;border-radius:12px;width:80px;height:80px}.delete-button[_ngcontent-%COMP%]{position:absolute;top:1px;right:1px;background-color:#000000b3;border:none;border-radius:50%;padding:8px;cursor:pointer;color:#fff;display:flex;align-items:center;justify-content:center;margin-right:0;scale:.7}.delete-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px}.file-container[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;gap:8px;height:80px;background-color:#1e1e1e;border-radius:12px}.file-info[_ngcontent-%COMP%]{margin-right:60px;padding-top:20px;padding-left:16px}"]})};var lr=class t{title="agent_framework_web";userId="";appName="";sessionId="";constructor(){}static \u0275fac=function(A){return new(A||t)};static \u0275cmp=O({type:t,selectors:[["app-root"]],standalone:!1,decls:1,vars:0,template:function(A,i){A&1&&W(0,"app-chat")},dependencies:[Sa],encapsulation:2})};var Bq=[{path:"dev-ui",component:lr},{path:"",redirectTo:"dev-ui",pathMatch:"full"}],jE=class t{static \u0275fac=function(A){return new(A||t)};static \u0275mod=V({type:t});static \u0275inj=q({imports:[VQ.forRoot(Bq),VQ]})};function pb(t){return new U(3e3,!1)}function Qq(){return new U(3100,!1)}function Eq(){return new U(3101,!1)}function cq(t){return new U(3001,!1)}function lq(t){return new U(3003,!1)}function dq(t){return new U(3004,!1)}function Mb(t,e){return new U(3005,!1)}function Rb(){return new U(3006,!1)}function kb(){return new U(3007,!1)}function Fb(t,e){return new U(3008,!1)}function bb(t){return new U(3002,!1)}function Sb(t,e,A,i,o){return new U(3010,!1)}function Nb(){return new U(3011,!1)}function Gb(){return new U(3012,!1)}function vb(){return new U(3200,!1)}function Lb(){return new U(3202,!1)}function Kb(){return new U(3013,!1)}function Ub(t){return new U(3014,!1)}function _b(t){return new U(3015,!1)}function xb(t){return new U(3016,!1)}function Yb(t,e){return new U(3404,!1)}function hq(t){return new U(3502,!1)}function Jb(t){return new U(3503,!1)}function Hb(){return new U(3300,!1)}function Tb(t){return new U(3504,!1)}function Ob(t){return new U(3301,!1)}function Pb(t,e){return new U(3302,!1)}function Zb(t){return new U(3303,!1)}function qb(t,e){return new U(3400,!1)}function Vb(t){return new U(3401,!1)}function Wb(t){return new U(3402,!1)}function zb(t,e){return new U(3505,!1)}function Zo(t){switch(t.length){case 0:return new Bo;case 1:return t[0];default:return new pn(t)}}function hm(t,e,A=new Map,i=new Map){let o=[],g=[],n=-1,s=null;if(e.forEach(r=>{let I=r.get("offset"),B=I==n,c=B&&s||new Map;r.forEach((D,h)=>{let p=h,y=D;if(h!=="offset")switch(p=t.normalizePropertyName(p,o),y){case tr:y=A.get(h);break;case ii:y=i.get(h);break;default:y=t.normalizeStyleValue(h,p,y,o);break}c.set(p,y)}),B||g.push(c),s=c,n=I}),o.length)throw hq(o);return g}function XE(t,e,A,i){switch(e){case"start":t.onStart(()=>i(A&&cm(A,"start",t)));break;case"done":t.onDone(()=>i(A&&cm(A,"done",t)));break;case"destroy":t.onDestroy(()=>i(A&&cm(A,"destroy",t)));break}}function cm(t,e,A){let i=A.totalTime,o=!!A.disabled,g=$E(t.element,t.triggerName,t.fromState,t.toState,e||t.phaseName,i??t.totalTime,o),n=t._data;return n!=null&&(g._data=n),g}function $E(t,e,A,i,o="",g=0,n){return{element:t,triggerName:e,fromState:A,toState:i,phaseName:o,totalTime:g,disabled:!!n}}function Nt(t,e,A){let i=t.get(e);return i||t.set(e,i=A),i}function um(t){let e=t.indexOf(":"),A=t.substring(1,e),i=t.slice(e+1);return[A,i]}var uq=typeof document>"u"?null:document.documentElement;function Ac(t){let e=t.parentNode||t.host||null;return e===uq?null:e}function Dq(t){return t.substring(1,6)=="ebkit"}var Nn=null,yb=!1;function jb(t){Nn||(Nn=mq()||{},yb=Nn.style?"WebkitAppearance"in Nn.style:!1);let e=!0;return Nn.style&&!Dq(t)&&(e=t in Nn.style,!e&&yb&&(e="Webkit"+t.charAt(0).toUpperCase()+t.slice(1)in Nn.style)),e}function mq(){return typeof document<"u"?document.body:null}function Dm(t,e){for(;e;){if(e===t)return!0;e=Ac(e)}return!1}function mm(t,e,A){if(A)return Array.from(t.querySelectorAll(e));let i=t.querySelector(e);return i?[i]:[]}var fq=1e3,fm="{{",wq="}}",wm="ng-enter",ec="ng-leave",Na="ng-trigger",Ga=".ng-trigger",pm="ng-animating",tc=".ng-animating";function mo(t){if(typeof t=="number")return t;let e=t.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:lm(parseFloat(e[1]),e[2])}function lm(t,e){switch(e){case"s":return t*fq;default:return t}}function va(t,e,A){return t.hasOwnProperty("duration")?t:pq(t,e,A)}function pq(t,e,A){let i=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i,o,g=0,n="";if(typeof t=="string"){let s=t.match(i);if(s===null)return e.push(pb(t)),{duration:0,delay:0,easing:""};o=lm(parseFloat(s[1]),s[2]);let r=s[3];r!=null&&(g=lm(parseFloat(r),s[4]));let I=s[5];I&&(n=I)}else o=t;if(!A){let s=!1,r=e.length;o<0&&(e.push(Qq()),s=!0),g<0&&(e.push(Eq()),s=!0),s&&e.splice(r,0,pb(t))}return{duration:o,delay:g,easing:n}}function Xb(t){return t.length?t[0]instanceof Map?t:t.map(e=>new Map(Object.entries(e))):[]}function vi(t,e,A){e.forEach((i,o)=>{let g=ic(o);A&&!A.has(o)&&A.set(o,t.style[g]),t.style[g]=i})}function bg(t,e){e.forEach((A,i)=>{let o=ic(i);t.style[o]=""})}function dr(t){return Array.isArray(t)?t.length==1?t[0]:dk(t):t}function $b(t,e,A){let i=e.params||{},o=ym(t);o.length&&o.forEach(g=>{i.hasOwnProperty(g)||A.push(cq(g))})}var dm=new RegExp(`${fm}\\s*(.+?)\\s*${wq}`,"g");function ym(t){let e=[];if(typeof t=="string"){let A;for(;A=dm.exec(t);)e.push(A[1]);dm.lastIndex=0}return e}function hr(t,e,A){let i=`${t}`,o=i.replace(dm,(g,n)=>{let s=e[n];return s==null&&(A.push(lq(n)),s=""),s.toString()});return o==i?t:o}var yq=/-+([a-z0-9])/g;function ic(t){return t.replace(yq,(...e)=>e[1].toUpperCase())}function AS(t,e){return t===0||e===0}function eS(t,e,A){if(A.size&&e.length){let i=e[0],o=[];if(A.forEach((g,n)=>{i.has(n)||o.push(n),i.set(n,g)}),o.length)for(let g=1;gn.set(s,oc(t,s)))}}return e}function Gt(t,e,A){switch(e.type){case LA.Trigger:return t.visitTrigger(e,A);case LA.State:return t.visitState(e,A);case LA.Transition:return t.visitTransition(e,A);case LA.Sequence:return t.visitSequence(e,A);case LA.Group:return t.visitGroup(e,A);case LA.Animate:return t.visitAnimate(e,A);case LA.Keyframes:return t.visitKeyframes(e,A);case LA.Style:return t.visitStyle(e,A);case LA.Reference:return t.visitReference(e,A);case LA.AnimateChild:return t.visitAnimateChild(e,A);case LA.AnimateRef:return t.visitAnimateRef(e,A);case LA.Query:return t.visitQuery(e,A);case LA.Stagger:return t.visitStagger(e,A);default:throw dq(e.type)}}function oc(t,e){return window.getComputedStyle(t)[e]}var Hm=(()=>{class t{validateStyleProperty(A){return jb(A)}containsElement(A,i){return Dm(A,i)}getParentElement(A){return Ac(A)}query(A,i,o){return mm(A,i,o)}computeStyle(A,i,o){return o||""}animate(A,i,o,g,n,s=[],r){return new Bo(o,g)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=N({token:t,factory:t.\u0275fac})}return t})(),vn=class{static NOOP=new Hm},Ln=class{};var Mq=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"]),Ic=class extends Ln{normalizePropertyName(e,A){return ic(e)}normalizeStyleValue(e,A,i,o){let g="",n=i.toString().trim();if(Mq.has(A)&&i!==0&&i!=="0")if(typeof i=="number")g="px";else{let s=i.match(/^[+-]?[\d\.]+([a-z]*)$/);s&&s[1].length==0&&o.push(Mb(e,i))}return n+g}};var ac="*";function Rq(t,e){let A=[];return typeof t=="string"?t.split(/\s*,\s*/).forEach(i=>kq(i,A,e)):A.push(t),A}function kq(t,e,A){if(t[0]==":"){let r=Fq(t,A);if(typeof r=="function"){e.push(r);return}t=r}let i=t.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(i==null||i.length<4)return A.push(_b(t)),e;let o=i[1],g=i[2],n=i[3];e.push(tS(o,n));let s=o==ac&&n==ac;g[0]=="<"&&!s&&e.push(tS(n,o))}function Fq(t,e){switch(t){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(A,i)=>parseFloat(i)>parseFloat(A);case":decrement":return(A,i)=>parseFloat(i) *"}}var gc=new Set(["true","1"]),nc=new Set(["false","0"]);function tS(t,e){let A=gc.has(t)||nc.has(t),i=gc.has(e)||nc.has(e);return(o,g)=>{let n=t==ac||t==o,s=e==ac||e==g;return!n&&A&&typeof o=="boolean"&&(n=o?gc.has(t):nc.has(t)),!s&&i&&typeof g=="boolean"&&(s=g?gc.has(e):nc.has(e)),n&&s}}var BS=":self",bq=new RegExp(`s*${BS}s*,?`,"g");function QS(t,e,A,i){return new Sm(t).build(e,A,i)}var iS="",Sm=class{_driver;constructor(e){this._driver=e}build(e,A,i){let o=new Nm(A);return this._resetContextStyleTimingState(o),Gt(this,dr(e),o)}_resetContextStyleTimingState(e){e.currentQuerySelector=iS,e.collectedStyles=new Map,e.collectedStyles.set(iS,new Map),e.currentTime=0}visitTrigger(e,A){let i=A.queryCount=0,o=A.depCount=0,g=[],n=[];return e.name.charAt(0)=="@"&&A.errors.push(Rb()),e.definitions.forEach(s=>{if(this._resetContextStyleTimingState(A),s.type==LA.State){let r=s,I=r.name;I.toString().split(/\s*,\s*/).forEach(B=>{r.name=B,g.push(this.visitState(r,A))}),r.name=I}else if(s.type==LA.Transition){let r=this.visitTransition(s,A);i+=r.queryCount,o+=r.depCount,n.push(r)}else A.errors.push(kb())}),{type:LA.Trigger,name:e.name,states:g,transitions:n,queryCount:i,depCount:o,options:null}}visitState(e,A){let i=this.visitStyle(e.styles,A),o=e.options&&e.options.params||null;if(i.containsDynamicStyles){let g=new Set,n=o||{};i.styles.forEach(s=>{s instanceof Map&&s.forEach(r=>{ym(r).forEach(I=>{n.hasOwnProperty(I)||g.add(I)})})}),g.size&&A.errors.push(Fb(e.name,[...g.values()]))}return{type:LA.State,name:e.name,style:i,options:o?{params:o}:null}}visitTransition(e,A){A.queryCount=0,A.depCount=0;let i=Gt(this,dr(e.animation),A),o=Rq(e.expr,A.errors);return{type:LA.Transition,matchers:o,animation:i,queryCount:A.queryCount,depCount:A.depCount,options:Gn(e.options)}}visitSequence(e,A){return{type:LA.Sequence,steps:e.steps.map(i=>Gt(this,i,A)),options:Gn(e.options)}}visitGroup(e,A){let i=A.currentTime,o=0,g=e.steps.map(n=>{A.currentTime=i;let s=Gt(this,n,A);return o=Math.max(o,A.currentTime),s});return A.currentTime=o,{type:LA.Group,steps:g,options:Gn(e.options)}}visitAnimate(e,A){let i=vq(e.timings,A.errors);A.currentAnimateTimings=i;let o,g=e.styles?e.styles:Ge({});if(g.type==LA.Keyframes)o=this.visitKeyframes(g,A);else{let n=e.styles,s=!1;if(!n){s=!0;let I={};i.easing&&(I.easing=i.easing),n=Ge(I)}A.currentTime+=i.duration+i.delay;let r=this.visitStyle(n,A);r.isEmptyStep=s,o=r}return A.currentAnimateTimings=null,{type:LA.Animate,timings:i,style:o,options:null}}visitStyle(e,A){let i=this._makeStyleAst(e,A);return this._validateStyleAst(i,A),i}_makeStyleAst(e,A){let i=[],o=Array.isArray(e.styles)?e.styles:[e.styles];for(let s of o)typeof s=="string"?s===ii?i.push(s):A.errors.push(bb(s)):i.push(new Map(Object.entries(s)));let g=!1,n=null;return i.forEach(s=>{if(s instanceof Map&&(s.has("easing")&&(n=s.get("easing"),s.delete("easing")),!g)){for(let r of s.values())if(r.toString().indexOf(fm)>=0){g=!0;break}}}),{type:LA.Style,styles:i,easing:n,offset:e.offset,containsDynamicStyles:g,options:null}}_validateStyleAst(e,A){let i=A.currentAnimateTimings,o=A.currentTime,g=A.currentTime;i&&g>0&&(g-=i.duration+i.delay),e.styles.forEach(n=>{typeof n!="string"&&n.forEach((s,r)=>{let I=A.collectedStyles.get(A.currentQuerySelector),B=I.get(r),c=!0;B&&(g!=o&&g>=B.startTime&&o<=B.endTime&&(A.errors.push(Sb(r,B.startTime,B.endTime,g,o)),c=!1),g=B.startTime),c&&I.set(r,{startTime:g,endTime:o}),A.options&&$b(s,A.options,A.errors)})})}visitKeyframes(e,A){let i={type:LA.Keyframes,styles:[],options:null};if(!A.currentAnimateTimings)return A.errors.push(Nb()),i;let o=1,g=0,n=[],s=!1,r=!1,I=0,B=e.steps.map(P=>{let mA=this._makeStyleAst(P,A),_A=mA.offset!=null?mA.offset:Gq(mA.styles),fA=0;return _A!=null&&(g++,fA=mA.offset=_A),r=r||fA<0||fA>1,s=s||fA0&&g{let _A=D>0?mA==h?1:D*mA:n[mA],fA=_A*L;A.currentTime=p+y.delay+fA,y.duration=fA,this._validateStyleAst(P,A),P.offset=_A,i.styles.push(P)}),i}visitReference(e,A){return{type:LA.Reference,animation:Gt(this,dr(e.animation),A),options:Gn(e.options)}}visitAnimateChild(e,A){return A.depCount++,{type:LA.AnimateChild,options:Gn(e.options)}}visitAnimateRef(e,A){return{type:LA.AnimateRef,animation:this.visitReference(e.animation,A),options:Gn(e.options)}}visitQuery(e,A){let i=A.currentQuerySelector,o=e.options||{};A.queryCount++,A.currentQuery=e;let[g,n]=Sq(e.selector);A.currentQuerySelector=i.length?i+" "+g:g,Nt(A.collectedStyles,A.currentQuerySelector,new Map);let s=Gt(this,dr(e.animation),A);return A.currentQuery=null,A.currentQuerySelector=i,{type:LA.Query,selector:g,limit:o.limit||0,optional:!!o.optional,includeSelf:n,animation:s,originalSelector:e.selector,options:Gn(e.options)}}visitStagger(e,A){A.currentQuery||A.errors.push(Kb());let i=e.timings==="full"?{duration:0,delay:0,easing:"full"}:va(e.timings,A.errors,!0);return{type:LA.Stagger,animation:Gt(this,dr(e.animation),A),timings:i,options:null}}};function Sq(t){let e=!!t.split(/\s*,\s*/).find(A=>A==BS);return e&&(t=t.replace(bq,"")),t=t.replace(/@\*/g,Ga).replace(/@\w+/g,A=>Ga+"-"+A.slice(1)).replace(/:animating/g,tc),[t,e]}function Nq(t){return t?R({},t):null}var Nm=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 Gq(t){if(typeof t=="string")return null;let e=null;if(Array.isArray(t))t.forEach(A=>{if(A instanceof Map&&A.has("offset")){let i=A;e=parseFloat(i.get("offset")),i.delete("offset")}});else if(t instanceof Map&&t.has("offset")){let A=t;e=parseFloat(A.get("offset")),A.delete("offset")}return e}function vq(t,e){if(t.hasOwnProperty("duration"))return t;if(typeof t=="number"){let g=va(t,e).duration;return Mm(g,0,"")}let A=t;if(A.split(/\s+/).some(g=>g.charAt(0)=="{"&&g.charAt(1)=="{")){let g=Mm(0,0,"");return g.dynamic=!0,g.strValue=A,g}let o=va(A,e);return Mm(o.duration,o.delay,o.easing)}function Gn(t){return t?(t=R({},t),t.params&&(t.params=Nq(t.params))):t={},t}function Mm(t,e,A){return{duration:t,delay:e,easing:A}}function Tm(t,e,A,i,o,g,n=null,s=!1){return{type:1,element:t,keyframes:e,preStyleProps:A,postStyleProps:i,duration:o,delay:g,totalTime:o+g,easing:n,subTimeline:s}}var Ka=class{_map=new Map;get(e){return this._map.get(e)||[]}append(e,A){let i=this._map.get(e);i||this._map.set(e,i=[]),i.push(...A)}has(e){return this._map.has(e)}clear(){this._map.clear()}},Lq=1,Kq=":enter",Uq=new RegExp(Kq,"g"),_q=":leave",xq=new RegExp(_q,"g");function ES(t,e,A,i,o,g=new Map,n=new Map,s,r,I=[]){return new Gm().buildKeyframes(t,e,A,i,o,g,n,s,r,I)}var Gm=class{buildKeyframes(e,A,i,o,g,n,s,r,I,B=[]){I=I||new Ka;let c=new vm(e,A,I,o,g,B,[]);c.options=r;let D=r.delay?mo(r.delay):0;c.currentTimeline.delayNextStep(D),c.currentTimeline.setStyles([n],null,c.errors,r),Gt(this,i,c);let h=c.timelines.filter(p=>p.containsAnimation());if(h.length&&s.size){let p;for(let y=h.length-1;y>=0;y--){let L=h[y];if(L.element===A){p=L;break}}p&&!p.allowOnlyTimelineStyles()&&p.setStyles([s],null,c.errors,r)}return h.length?h.map(p=>p.buildKeyframes()):[Tm(A,[],[],[],0,D,"",!1)]}visitTrigger(e,A){}visitState(e,A){}visitTransition(e,A){}visitAnimateChild(e,A){let i=A.subInstructions.get(A.element);if(i){let o=A.createSubContext(e.options),g=A.currentTimeline.currentTime,n=this._visitSubInstructions(i,o,o.options);g!=n&&A.transformIntoNewTimeline(n)}A.previousNode=e}visitAnimateRef(e,A){let i=A.createSubContext(e.options);i.transformIntoNewTimeline(),this._applyAnimationRefDelays([e.options,e.animation.options],A,i),this.visitReference(e.animation,i),A.transformIntoNewTimeline(i.currentTimeline.currentTime),A.previousNode=e}_applyAnimationRefDelays(e,A,i){for(let o of e){let g=o?.delay;if(g){let n=typeof g=="number"?g:mo(hr(g,o?.params??{},A.errors));i.delayNextStep(n)}}}_visitSubInstructions(e,A,i){let g=A.currentTimeline.currentTime,n=i.duration!=null?mo(i.duration):null,s=i.delay!=null?mo(i.delay):null;return n!==0&&e.forEach(r=>{let I=A.appendInstructionToTimeline(r,n,s);g=Math.max(g,I.duration+I.delay)}),g}visitReference(e,A){A.updateOptions(e.options,!0),Gt(this,e.animation,A),A.previousNode=e}visitSequence(e,A){let i=A.subContextCount,o=A,g=e.options;if(g&&(g.params||g.delay)&&(o=A.createSubContext(g),o.transformIntoNewTimeline(),g.delay!=null)){o.previousNode.type==LA.Style&&(o.currentTimeline.snapshotCurrentStyles(),o.previousNode=Cc);let n=mo(g.delay);o.delayNextStep(n)}e.steps.length&&(e.steps.forEach(n=>Gt(this,n,o)),o.currentTimeline.applyStylesToKeyframe(),o.subContextCount>i&&o.transformIntoNewTimeline()),A.previousNode=e}visitGroup(e,A){let i=[],o=A.currentTimeline.currentTime,g=e.options&&e.options.delay?mo(e.options.delay):0;e.steps.forEach(n=>{let s=A.createSubContext(e.options);g&&s.delayNextStep(g),Gt(this,n,s),o=Math.max(o,s.currentTimeline.currentTime),i.push(s.currentTimeline)}),i.forEach(n=>A.currentTimeline.mergeTimelineCollectedStyles(n)),A.transformIntoNewTimeline(o),A.previousNode=e}_visitTiming(e,A){if(e.dynamic){let i=e.strValue,o=A.params?hr(i,A.params,A.errors):i;return va(o,A.errors)}else return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,A){let i=A.currentAnimateTimings=this._visitTiming(e.timings,A),o=A.currentTimeline;i.delay&&(A.incrementTime(i.delay),o.snapshotCurrentStyles());let g=e.style;g.type==LA.Keyframes?this.visitKeyframes(g,A):(A.incrementTime(i.duration),this.visitStyle(g,A),o.applyStylesToKeyframe()),A.currentAnimateTimings=null,A.previousNode=e}visitStyle(e,A){let i=A.currentTimeline,o=A.currentAnimateTimings;!o&&i.hasCurrentStyleProperties()&&i.forwardFrame();let g=o&&o.easing||e.easing;e.isEmptyStep?i.applyEmptyStep(g):i.setStyles(e.styles,g,A.errors,A.options),A.previousNode=e}visitKeyframes(e,A){let i=A.currentAnimateTimings,o=A.currentTimeline.duration,g=i.duration,s=A.createSubContext().currentTimeline;s.easing=i.easing,e.styles.forEach(r=>{let I=r.offset||0;s.forwardTime(I*g),s.setStyles(r.styles,r.easing,A.errors,A.options),s.applyStylesToKeyframe()}),A.currentTimeline.mergeTimelineCollectedStyles(s),A.transformIntoNewTimeline(o+g),A.previousNode=e}visitQuery(e,A){let i=A.currentTimeline.currentTime,o=e.options||{},g=o.delay?mo(o.delay):0;g&&(A.previousNode.type===LA.Style||i==0&&A.currentTimeline.hasCurrentStyleProperties())&&(A.currentTimeline.snapshotCurrentStyles(),A.previousNode=Cc);let n=i,s=A.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!o.optional,A.errors);A.currentQueryTotal=s.length;let r=null;s.forEach((I,B)=>{A.currentQueryIndex=B;let c=A.createSubContext(e.options,I);g&&c.delayNextStep(g),I===A.element&&(r=c.currentTimeline),Gt(this,e.animation,c),c.currentTimeline.applyStylesToKeyframe();let D=c.currentTimeline.currentTime;n=Math.max(n,D)}),A.currentQueryIndex=0,A.currentQueryTotal=0,A.transformIntoNewTimeline(n),r&&(A.currentTimeline.mergeTimelineCollectedStyles(r),A.currentTimeline.snapshotCurrentStyles()),A.previousNode=e}visitStagger(e,A){let i=A.parentContext,o=A.currentTimeline,g=e.timings,n=Math.abs(g.duration),s=n*(A.currentQueryTotal-1),r=n*A.currentQueryIndex;switch(g.duration<0?"reverse":g.easing){case"reverse":r=s-r;break;case"full":r=i.currentStaggerTime;break}let B=A.currentTimeline;r&&B.delayNextStep(r);let c=B.currentTime;Gt(this,e.animation,A),A.previousNode=e,i.currentStaggerTime=o.currentTime-c+(o.startTime-i.currentTimeline.startTime)}},Cc={},vm=class t{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=Cc;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(e,A,i,o,g,n,s,r){this._driver=e,this.element=A,this.subInstructions=i,this._enterClassName=o,this._leaveClassName=g,this.errors=n,this.timelines=s,this.currentTimeline=r||new Bc(this._driver,A,0),s.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,A){if(!e)return;let i=e,o=this.options;i.duration!=null&&(o.duration=mo(i.duration)),i.delay!=null&&(o.delay=mo(i.delay));let g=i.params;if(g){let n=o.params;n||(n=this.options.params={}),Object.keys(g).forEach(s=>{(!A||!n.hasOwnProperty(s))&&(n[s]=hr(g[s],n,this.errors))})}}_copyOptions(){let e={};if(this.options){let A=this.options.params;if(A){let i=e.params={};Object.keys(A).forEach(o=>{i[o]=A[o]})}}return e}createSubContext(e=null,A,i){let o=A||this.element,g=new t(this._driver,o,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(o,i||0));return g.previousNode=this.previousNode,g.currentAnimateTimings=this.currentAnimateTimings,g.options=this._copyOptions(),g.updateOptions(e),g.currentQueryIndex=this.currentQueryIndex,g.currentQueryTotal=this.currentQueryTotal,g.parentContext=this,this.subContextCount++,g}transformIntoNewTimeline(e){return this.previousNode=Cc,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,A,i){let o={duration:A??e.duration,delay:this.currentTimeline.currentTime+(i??0)+e.delay,easing:""},g=new Lm(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,o,e.stretchStartingKeyframe);return this.timelines.push(g),o}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,A,i,o,g,n){let s=[];if(o&&s.push(this.element),e.length>0){e=e.replace(Uq,"."+this._enterClassName),e=e.replace(xq,"."+this._leaveClassName);let r=i!=1,I=this._driver.query(this.element,e,r);i!==0&&(I=i<0?I.slice(I.length+i,I.length):I.slice(0,i)),s.push(...I)}return!g&&s.length==0&&n.push(Ub(A)),s}},Bc=class t{_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,A,i,o){this._driver=e,this.element=A,this.startTime=i,this._elementTimelineStylesLookup=o,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(A),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(A,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 A=this._keyframes.size===1&&this._pendingStyles.size;this.duration||A?(this.forwardTime(this.currentTime+e),A&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,A){return this.applyStylesToKeyframe(),new t(this._driver,e,A||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+=Lq,this._loadKeyframe()}forwardTime(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,A){this._localTimelineStyles.set(e,A),this._globalTimelineStyles.set(e,A),this._styleSummary.set(e,{time:this.currentTime,value:A})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&this._previousKeyframe.set("easing",e);for(let[A,i]of this._globalTimelineStyles)this._backFill.set(A,i||ii),this._currentKeyframe.set(A,ii);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,A,i,o){A&&this._previousKeyframe.set("easing",A);let g=o&&o.params||{},n=Yq(e,this._globalTimelineStyles);for(let[s,r]of n){let I=hr(r,g,i);this._pendingStyles.set(s,I),this._localTimelineStyles.has(s)||this._backFill.set(s,this._globalTimelineStyles.get(s)??ii),this._updateStyle(s,I)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((e,A)=>{this._currentKeyframe.set(A,e)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((e,A)=>{this._currentKeyframe.has(A)||this._currentKeyframe.set(A,e)}))}snapshotCurrentStyles(){for(let[e,A]of this._localTimelineStyles)this._pendingStyles.set(e,A),this._updateStyle(e,A)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let e=[];for(let A in this._currentKeyframe)e.push(A);return e}mergeTimelineCollectedStyles(e){e._styleSummary.forEach((A,i)=>{let o=this._styleSummary.get(i);(!o||A.time>o.time)&&this._updateStyle(i,A.value)})}buildKeyframes(){this.applyStylesToKeyframe();let e=new Set,A=new Set,i=this._keyframes.size===1&&this.duration===0,o=[];this._keyframes.forEach((s,r)=>{let I=new Map([...this._backFill,...s]);I.forEach((B,c)=>{B===tr?e.add(c):B===ii&&A.add(c)}),i||I.set("offset",r/this.duration),o.push(I)});let g=[...e.values()],n=[...A.values()];if(i){let s=o[0],r=new Map(s);s.set("offset",0),r.set("offset",1),o=[s,r]}return Tm(this.element,o,g,n,this.duration,this.startTime,this.easing,!1)}},Lm=class extends Bc{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(e,A,i,o,g,n,s=!1){super(e,A,n.delay),this.keyframes=i,this.preStyleProps=o,this.postStyleProps=g,this._stretchStartingKeyframe=s,this.timings={duration:n.duration,delay:n.delay,easing:n.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:A,duration:i,easing:o}=this.timings;if(this._stretchStartingKeyframe&&A){let g=[],n=i+A,s=A/n,r=new Map(e[0]);r.set("offset",0),g.push(r);let I=new Map(e[0]);I.set("offset",oS(s)),g.push(I);let B=e.length-1;for(let c=1;c<=B;c++){let D=new Map(e[c]),h=D.get("offset"),p=A+h*i;D.set("offset",oS(p/n)),g.push(D)}i=n,A=0,o="",e=g}return Tm(this.element,e,this.preStyleProps,this.postStyleProps,i,A,o,!0)}};function oS(t,e=3){let A=Math.pow(10,e-1);return Math.round(t*A)/A}function Yq(t,e){let A=new Map,i;return t.forEach(o=>{if(o==="*"){i??=e.keys();for(let g of i)A.set(g,ii)}else for(let[g,n]of o)A.set(g,n)}),A}function gS(t,e,A,i,o,g,n,s,r,I,B,c,D){return{type:0,element:t,triggerName:e,isRemovalTransition:o,fromState:A,fromStyles:g,toState:i,toStyles:n,timelines:s,queriedElements:r,preStyleProps:I,postStyleProps:B,totalTime:c,errors:D}}var Rm={},Qc=class{_triggerName;ast;_stateStyles;constructor(e,A,i){this._triggerName=e,this.ast=A,this._stateStyles=i}match(e,A,i,o){return Jq(this.ast.matchers,e,A,i,o)}buildStyles(e,A,i){let o=this._stateStyles.get("*");return e!==void 0&&(o=this._stateStyles.get(e?.toString())||o),o?o.buildStyles(A,i):new Map}build(e,A,i,o,g,n,s,r,I,B){let c=[],D=this.ast.options&&this.ast.options.params||Rm,h=s&&s.params||Rm,p=this.buildStyles(i,h,c),y=r&&r.params||Rm,L=this.buildStyles(o,y,c),P=new Set,mA=new Map,_A=new Map,fA=o==="void",Qt={params:cS(y,D),delay:this.ast.options?.delay},ue=B?[]:ES(e,A,this.ast.animation,g,n,p,L,Qt,I,c),pe=0;return ue.forEach(le=>{pe=Math.max(le.duration+le.delay,pe)}),c.length?gS(A,this._triggerName,i,o,fA,p,L,[],[],mA,_A,pe,c):(ue.forEach(le=>{let ni=le.element,fo=Nt(mA,ni,new Set);le.preStyleProps.forEach(Ui=>fo.add(Ui));let Ki=Nt(_A,ni,new Set);le.postStyleProps.forEach(Ui=>Ki.add(Ui)),ni!==A&&P.add(ni)}),gS(A,this._triggerName,i,o,fA,p,L,ue,[...P.values()],mA,_A,pe))}};function Jq(t,e,A,i,o){return t.some(g=>g(e,A,i,o))}function cS(t,e){let A=R({},e);return Object.entries(t).forEach(([i,o])=>{o!=null&&(A[i]=o)}),A}var Km=class{styles;defaultParams;normalizer;constructor(e,A,i){this.styles=e,this.defaultParams=A,this.normalizer=i}buildStyles(e,A){let i=new Map,o=cS(e,this.defaultParams);return this.styles.styles.forEach(g=>{typeof g!="string"&&g.forEach((n,s)=>{n&&(n=hr(n,o,A));let r=this.normalizer.normalizePropertyName(s,A);n=this.normalizer.normalizeStyleValue(s,r,n,A),i.set(s,n)})}),i}};function Hq(t,e,A){return new Um(t,e,A)}var Um=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(e,A,i){this.name=e,this.ast=A,this._normalizer=i,A.states.forEach(o=>{let g=o.options&&o.options.params||{};this.states.set(o.name,new Km(o.style,g,i))}),nS(this.states,"true","1"),nS(this.states,"false","0"),A.transitions.forEach(o=>{this.transitionFactories.push(new Qc(e,o,this.states))}),this.fallbackTransition=Tq(e,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,A,i,o){return this.transitionFactories.find(n=>n.match(e,A,i,o))||null}matchStyles(e,A,i){return this.fallbackTransition.buildStyles(e,A,i)}};function Tq(t,e,A){let i=[(n,s)=>!0],o={type:LA.Sequence,steps:[],options:null},g={type:LA.Transition,animation:o,matchers:i,options:null,queryCount:0,depCount:0};return new Qc(t,g,e)}function nS(t,e,A){t.has(e)?t.has(A)||t.set(A,t.get(e)):t.has(A)&&t.set(e,t.get(A))}var Oq=new Ka,_m=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(e,A,i){this.bodyNode=e,this._driver=A,this._normalizer=i}register(e,A){let i=[],o=[],g=QS(this._driver,A,i,o);if(i.length)throw Jb(i);this._animations.set(e,g)}_buildPlayer(e,A,i){let o=e.element,g=hm(this._normalizer,e.keyframes,A,i);return this._driver.animate(o,g,e.duration,e.delay,e.easing,[],!0)}create(e,A,i={}){let o=[],g=this._animations.get(e),n,s=new Map;if(g?(n=ES(this._driver,A,g,wm,ec,new Map,new Map,i,Oq,o),n.forEach(B=>{let c=Nt(s,B.element,new Map);B.postStyleProps.forEach(D=>c.set(D,null))})):(o.push(Hb()),n=[]),o.length)throw Tb(o);s.forEach((B,c)=>{B.forEach((D,h)=>{B.set(h,this._driver.computeStyle(c,h,ii))})});let r=n.map(B=>{let c=s.get(B.element);return this._buildPlayer(B,new Map,c)}),I=Zo(r);return this._playersById.set(e,I),I.onDestroy(()=>this.destroy(e)),this.players.push(I),I}destroy(e){let A=this._getPlayer(e);A.destroy(),this._playersById.delete(e);let i=this.players.indexOf(A);i>=0&&this.players.splice(i,1)}_getPlayer(e){let A=this._playersById.get(e);if(!A)throw Ob(e);return A}listen(e,A,i,o){let g=$E(A,"","","");return XE(this._getPlayer(e),i,g,o),()=>{}}command(e,A,i,o){if(i=="register"){this.register(e,o[0]);return}if(i=="create"){let n=o[0]||{};this.create(e,A,n);return}let g=this._getPlayer(e);switch(i){case"play":g.play();break;case"pause":g.pause();break;case"reset":g.reset();break;case"restart":g.restart();break;case"finish":g.finish();break;case"init":g.init();break;case"setPosition":g.setPosition(parseFloat(o[0]));break;case"destroy":this.destroy(e);break}}},sS="ng-animate-queued",Pq=".ng-animate-queued",km="ng-animate-disabled",Zq=".ng-animate-disabled",qq="ng-star-inserted",Vq=".ng-star-inserted",Wq=[],lS={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},zq={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Li="__ng_removed",Ua=class{namespaceId;value;options;get params(){return this.options.params}constructor(e,A=""){this.namespaceId=A;let i=e&&e.hasOwnProperty("value"),o=i?e.value:e;if(this.value=Xq(o),i){let g=e,{value:n}=g,s=mc(g,["value"]);this.options=s}else this.options={};this.options.params||(this.options.params={})}absorbOptions(e){let A=e.params;if(A){let i=this.options.params;Object.keys(A).forEach(o=>{i[o]==null&&(i[o]=A[o])})}}},La="void",Fm=new Ua(La),xm=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(e,A,i){this.id=e,this.hostElement=A,this._engine=i,this._hostClassName="ng-tns-"+e,gi(A,this._hostClassName)}listen(e,A,i,o){if(!this._triggers.has(A))throw Pb(i,A);if(i==null||i.length==0)throw Zb(A);if(!$q(i))throw qb(i,A);let g=Nt(this._elementListeners,e,[]),n={name:A,phase:i,callback:o};g.push(n);let s=Nt(this._engine.statesByElement,e,new Map);return s.has(A)||(gi(e,Na),gi(e,Na+"-"+A),s.set(A,Fm)),()=>{this._engine.afterFlush(()=>{let r=g.indexOf(n);r>=0&&g.splice(r,1),this._triggers.has(A)||s.delete(A)})}}register(e,A){return this._triggers.has(e)?!1:(this._triggers.set(e,A),!0)}_getTrigger(e){let A=this._triggers.get(e);if(!A)throw Vb(e);return A}trigger(e,A,i,o=!0){let g=this._getTrigger(A),n=new _a(this.id,A,e),s=this._engine.statesByElement.get(e);s||(gi(e,Na),gi(e,Na+"-"+A),this._engine.statesByElement.set(e,s=new Map));let r=s.get(A),I=new Ua(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&r&&I.absorbOptions(r.options),s.set(A,I),r||(r=Fm),!(I.value===La)&&r.value===I.value){if(!t1(r.params,I.params)){let y=[],L=g.matchStyles(r.value,r.params,y),P=g.matchStyles(I.value,I.params,y);y.length?this._engine.reportError(y):this._engine.afterFlush(()=>{bg(e,L),vi(e,P)})}return}let D=Nt(this._engine.playersByElement,e,[]);D.forEach(y=>{y.namespaceId==this.id&&y.triggerName==A&&y.queued&&y.destroy()});let h=g.matchTransition(r.value,I.value,e,I.params),p=!1;if(!h){if(!o)return;h=g.fallbackTransition,p=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:A,transition:h,fromState:r,toState:I,player:n,isFallbackTransition:p}),p||(gi(e,sS),n.onStart(()=>{ur(e,sS)})),n.onDone(()=>{let y=this.players.indexOf(n);y>=0&&this.players.splice(y,1);let L=this._engine.playersByElement.get(e);if(L){let P=L.indexOf(n);P>=0&&L.splice(P,1)}}),this.players.push(n),D.push(n),n}deregister(e){this._triggers.delete(e),this._engine.statesByElement.forEach(A=>A.delete(e)),this._elementListeners.forEach((A,i)=>{this._elementListeners.set(i,A.filter(o=>o.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);let A=this._engine.playersByElement.get(e);A&&(A.forEach(i=>i.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,A){let i=this._engine.driver.query(e,Ga,!0);i.forEach(o=>{if(o[Li])return;let g=this._engine.fetchNamespacesByElement(o);g.size?g.forEach(n=>n.triggerLeaveAnimation(o,A,!1,!0)):this.clearElementCache(o)}),this._engine.afterFlushAnimationsDone(()=>i.forEach(o=>this.clearElementCache(o)))}triggerLeaveAnimation(e,A,i,o){let g=this._engine.statesByElement.get(e),n=new Map;if(g){let s=[];if(g.forEach((r,I)=>{if(n.set(I,r.value),this._triggers.has(I)){let B=this.trigger(e,I,La,o);B&&s.push(B)}}),s.length)return this._engine.markElementAsRemoved(this.id,e,!0,A,n),i&&Zo(s).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){let A=this._elementListeners.get(e),i=this._engine.statesByElement.get(e);if(A&&i){let o=new Set;A.forEach(g=>{let n=g.name;if(o.has(n))return;o.add(n);let r=this._triggers.get(n).fallbackTransition,I=i.get(n)||Fm,B=new Ua(La),c=new _a(this.id,n,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:n,transition:r,fromState:I,toState:B,player:c,isFallbackTransition:!0})})}}removeNode(e,A){let i=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,A),this.triggerLeaveAnimation(e,A,!0))return;let o=!1;if(i.totalAnimations){let g=i.players.length?i.playersByQueriedElement.get(e):[];if(g&&g.length)o=!0;else{let n=e;for(;n=n.parentNode;)if(i.statesByElement.get(n)){o=!0;break}}}if(this.prepareLeaveAnimationListeners(e),o)i.markElementAsRemoved(this.id,e,!1,A);else{let g=e[Li];(!g||g===lS)&&(i.afterFlush(()=>this.clearElementCache(e)),i.destroyInnerAnimations(e),i._onRemovalComplete(e,A))}}insertNode(e,A){gi(e,this._hostClassName)}drainQueuedTransitions(e){let A=[];return this._queue.forEach(i=>{let o=i.player;if(o.destroyed)return;let g=i.element,n=this._elementListeners.get(g);n&&n.forEach(s=>{if(s.name==i.triggerName){let r=$E(g,i.triggerName,i.fromState.value,i.toState.value);r._data=e,XE(i.player,s.phase,r,s.callback)}}),o.markedForDestroy?this._engine.afterFlush(()=>{o.destroy()}):A.push(i)}),this._queue=[],A.sort((i,o)=>{let g=i.transition.ast.depCount,n=o.transition.ast.depCount;return g==0||n==0?g-n:this._engine.driver.containsElement(i.element,o.element)?1:-1})}destroy(e){this.players.forEach(A=>A.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}},Ym=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,A)=>{};_onRemovalComplete(e,A){this.onRemovalComplete(e,A)}constructor(e,A,i){this.bodyNode=e,this.driver=A,this._normalizer=i}get queuedPlayers(){let e=[];return this._namespaceList.forEach(A=>{A.players.forEach(i=>{i.queued&&e.push(i)})}),e}createNamespace(e,A){let i=new xm(e,A,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,A)?this._balanceNamespaceList(i,A):(this.newHostElements.set(A,i),this.collectEnterElement(A)),this._namespaceLookup[e]=i}_balanceNamespaceList(e,A){let i=this._namespaceList,o=this.namespacesByHostElement;if(i.length-1>=0){let n=!1,s=this.driver.getParentElement(A);for(;s;){let r=o.get(s);if(r){let I=i.indexOf(r);i.splice(I+1,0,e),n=!0;break}s=this.driver.getParentElement(s)}n||i.unshift(e)}else i.push(e);return o.set(A,e),e}register(e,A){let i=this._namespaceLookup[e];return i||(i=this.createNamespace(e,A)),i}registerTrigger(e,A,i){let o=this._namespaceLookup[e];o&&o.register(A,i)&&this.totalAnimations++}destroy(e,A){e&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let i=this._fetchNamespace(e);this.namespacesByHostElement.delete(i.hostElement);let o=this._namespaceList.indexOf(i);o>=0&&this._namespaceList.splice(o,1),i.destroy(A),delete this._namespaceLookup[e]}))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){let A=new Set,i=this.statesByElement.get(e);if(i){for(let o of i.values())if(o.namespaceId){let g=this._fetchNamespace(o.namespaceId);g&&A.add(g)}}return A}trigger(e,A,i,o){if(sc(A)){let g=this._fetchNamespace(e);if(g)return g.trigger(A,i,o),!0}return!1}insertNode(e,A,i,o){if(!sc(A))return;let g=A[Li];if(g&&g.setForRemoval){g.setForRemoval=!1,g.setForMove=!0;let n=this.collectedLeaveElements.indexOf(A);n>=0&&this.collectedLeaveElements.splice(n,1)}if(e){let n=this._fetchNamespace(e);n&&n.insertNode(A,i)}o&&this.collectEnterElement(A)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,A){A?this.disabledNodes.has(e)||(this.disabledNodes.add(e),gi(e,km)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),ur(e,km))}removeNode(e,A,i){if(sc(A)){let o=e?this._fetchNamespace(e):null;o?o.removeNode(A,i):this.markElementAsRemoved(e,A,!1,i);let g=this.namespacesByHostElement.get(A);g&&g.id!==e&&g.removeNode(A,i)}else this._onRemovalComplete(A,i)}markElementAsRemoved(e,A,i,o,g){this.collectedLeaveElements.push(A),A[Li]={namespaceId:e,setForRemoval:o,hasAnimation:i,removedBeforeQueried:!1,previousTriggersValues:g}}listen(e,A,i,o,g){return sc(A)?this._fetchNamespace(e).listen(A,i,o,g):()=>{}}_buildInstruction(e,A,i,o,g){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,i,o,e.fromState.options,e.toState.options,A,g)}destroyInnerAnimations(e){let A=this.driver.query(e,Ga,!0);A.forEach(i=>this.destroyActiveAnimationsForElement(i)),this.playersByQueriedElement.size!=0&&(A=this.driver.query(e,tc,!0),A.forEach(i=>this.finishActiveQueriedAnimationOnElement(i)))}destroyActiveAnimationsForElement(e){let A=this.playersByElement.get(e);A&&A.forEach(i=>{i.queued?i.markedForDestroy=!0:i.destroy()})}finishActiveQueriedAnimationOnElement(e){let A=this.playersByQueriedElement.get(e);A&&A.forEach(i=>i.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return Zo(this.players).onDone(()=>e());e()})}processLeaveNode(e){let A=e[Li];if(A&&A.setForRemoval){if(e[Li]=lS,A.namespaceId){this.destroyInnerAnimations(e);let i=this._fetchNamespace(A.namespaceId);i&&i.clearElementCache(e)}this._onRemovalComplete(e,A.setForRemoval)}e.classList?.contains(km)&&this.markElementAsDisabled(e,!1),this.driver.query(e,Zq,!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(e=-1){let A=[];if(this.newHostElements.size&&(this.newHostElements.forEach((i,o)=>this._balanceNamespaceList(i,o)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let i=0;ii()),this._flushFns=[],this._whenQuietFns.length){let i=this._whenQuietFns;this._whenQuietFns=[],A.length?Zo(A).onDone(()=>{i.forEach(o=>o())}):i.forEach(o=>o())}}reportError(e){throw Wb(e)}_flushAnimations(e,A){let i=new Ka,o=[],g=new Map,n=[],s=new Map,r=new Map,I=new Map,B=new Set;this.disabledNodes.forEach(E=>{B.add(E);let eA=this.driver.query(E,Pq,!0);for(let uA=0;uA{let uA=wm+y++;p.set(eA,uA),E.forEach(TA=>gi(TA,uA))});let L=[],P=new Set,mA=new Set;for(let E=0;EP.add(TA)):mA.add(eA))}let _A=new Map,fA=aS(D,Array.from(P));fA.forEach((E,eA)=>{let uA=ec+y++;_A.set(eA,uA),E.forEach(TA=>gi(TA,uA))}),e.push(()=>{h.forEach((E,eA)=>{let uA=p.get(eA);E.forEach(TA=>ur(TA,uA))}),fA.forEach((E,eA)=>{let uA=_A.get(eA);E.forEach(TA=>ur(TA,uA))}),L.forEach(E=>{this.processLeaveNode(E)})});let Qt=[],ue=[];for(let E=this._namespaceList.length-1;E>=0;E--)this._namespaceList[E].drainQueuedTransitions(A).forEach(uA=>{let TA=uA.player,Re=uA.element;if(Qt.push(TA),this.collectedEnterElements.length){let Ue=Re[Li];if(Ue&&Ue.setForMove){if(Ue.previousTriggersValues&&Ue.previousTriggersValues.has(uA.triggerName)){let _i=Ue.previousTriggersValues.get(uA.triggerName),st=this.statesByElement.get(uA.element);if(st&&st.has(uA.triggerName)){let Sg=st.get(uA.triggerName);Sg.value=_i,st.set(uA.triggerName,Sg)}}TA.destroy();return}}let We=!c||!this.driver.containsElement(c,Re),nt=_A.get(Re),Wt=p.get(Re),oe=this._buildInstruction(uA,i,Wt,nt,We);if(oe.errors&&oe.errors.length){ue.push(oe);return}if(We){TA.onStart(()=>bg(Re,oe.fromStyles)),TA.onDestroy(()=>vi(Re,oe.toStyles)),o.push(TA);return}if(uA.isFallbackTransition){TA.onStart(()=>bg(Re,oe.fromStyles)),TA.onDestroy(()=>vi(Re,oe.toStyles)),o.push(TA);return}let Ya=[];oe.timelines.forEach(Ue=>{Ue.stretchStartingKeyframe=!0,this.disabledNodes.has(Ue.element)||Ya.push(Ue)}),oe.timelines=Ya,i.append(Re,oe.timelines);let Ja={instruction:oe,player:TA,element:Re};n.push(Ja),oe.queriedElements.forEach(Ue=>Nt(s,Ue,[]).push(TA)),oe.preStyleProps.forEach((Ue,_i)=>{if(Ue.size){let st=r.get(_i);st||r.set(_i,st=new Set),Ue.forEach((Sg,mr)=>st.add(mr))}}),oe.postStyleProps.forEach((Ue,_i)=>{let st=I.get(_i);st||I.set(_i,st=new Set),Ue.forEach((Sg,mr)=>st.add(mr))})});if(ue.length){let E=[];ue.forEach(eA=>{E.push(zb(eA.triggerName,eA.errors))}),Qt.forEach(eA=>eA.destroy()),this.reportError(E)}let pe=new Map,le=new Map;n.forEach(E=>{let eA=E.element;i.has(eA)&&(le.set(eA,eA),this._beforeAnimationBuild(E.player.namespaceId,E.instruction,pe))}),o.forEach(E=>{let eA=E.element;this._getPreviousPlayers(eA,!1,E.namespaceId,E.triggerName,null).forEach(TA=>{Nt(pe,eA,[]).push(TA),TA.destroy()})});let ni=L.filter(E=>CS(E,r,I)),fo=new Map;IS(fo,this.driver,mA,I,ii).forEach(E=>{CS(E,r,I)&&ni.push(E)});let Ui=new Map;h.forEach((E,eA)=>{IS(Ui,this.driver,new Set(E),r,tr)}),ni.forEach(E=>{let eA=fo.get(E),uA=Ui.get(E);fo.set(E,new Map([...eA?.entries()??[],...uA?.entries()??[]]))});let Kn=[],UA=[],Un={};n.forEach(E=>{let{element:eA,player:uA,instruction:TA}=E;if(i.has(eA)){if(B.has(eA)){uA.onDestroy(()=>vi(eA,TA.toStyles)),uA.disabled=!0,uA.overrideTotalTime(TA.totalTime),o.push(uA);return}let Re=Un;if(le.size>1){let nt=eA,Wt=[];for(;nt=nt.parentNode;){let oe=le.get(nt);if(oe){Re=oe;break}Wt.push(nt)}Wt.forEach(oe=>le.set(oe,Re))}let We=this._buildAnimation(uA.namespaceId,TA,pe,g,Ui,fo);if(uA.setRealPlayer(We),Re===Un)Kn.push(uA);else{let nt=this.playersByElement.get(Re);nt&&nt.length&&(uA.parentPlayer=Zo(nt)),o.push(uA)}}else bg(eA,TA.fromStyles),uA.onDestroy(()=>vi(eA,TA.toStyles)),UA.push(uA),B.has(eA)&&o.push(uA)}),UA.forEach(E=>{let eA=g.get(E.element);if(eA&&eA.length){let uA=Zo(eA);E.setRealPlayer(uA)}}),o.forEach(E=>{E.parentPlayer?E.syncPlayerEvents(E.parentPlayer):E.destroy()});for(let E=0;E!We.destroyed);Re.length?A1(this,eA,Re):this.processLeaveNode(eA)}return L.length=0,Kn.forEach(E=>{this.players.push(E),E.onDone(()=>{E.destroy();let eA=this.players.indexOf(E);this.players.splice(eA,1)}),E.play()}),Kn}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,A,i,o,g){let n=[];if(A){let s=this.playersByQueriedElement.get(e);s&&(n=s)}else{let s=this.playersByElement.get(e);if(s){let r=!g||g==La;s.forEach(I=>{I.queued||!r&&I.triggerName!=o||n.push(I)})}}return(i||o)&&(n=n.filter(s=>!(i&&i!=s.namespaceId||o&&o!=s.triggerName))),n}_beforeAnimationBuild(e,A,i){let o=A.triggerName,g=A.element,n=A.isRemovalTransition?void 0:e,s=A.isRemovalTransition?void 0:o;for(let r of A.timelines){let I=r.element,B=I!==g,c=Nt(i,I,[]);this._getPreviousPlayers(I,B,n,s,A.toState).forEach(h=>{let p=h.getRealPlayer();p.beforeDestroy&&p.beforeDestroy(),h.destroy(),c.push(h)})}bg(g,A.fromStyles)}_buildAnimation(e,A,i,o,g,n){let s=A.triggerName,r=A.element,I=[],B=new Set,c=new Set,D=A.timelines.map(p=>{let y=p.element;B.add(y);let L=y[Li];if(L&&L.removedBeforeQueried)return new Bo(p.duration,p.delay);let P=y!==r,mA=e1((i.get(y)||Wq).map(pe=>pe.getRealPlayer())).filter(pe=>{let le=pe;return le.element?le.element===y:!1}),_A=g.get(y),fA=n.get(y),Qt=hm(this._normalizer,p.keyframes,_A,fA),ue=this._buildPlayer(p,Qt,mA);if(p.subTimeline&&o&&c.add(y),P){let pe=new _a(e,s,y);pe.setRealPlayer(ue),I.push(pe)}return ue});I.forEach(p=>{Nt(this.playersByQueriedElement,p.element,[]).push(p),p.onDone(()=>jq(this.playersByQueriedElement,p.element,p))}),B.forEach(p=>gi(p,pm));let h=Zo(D);return h.onDestroy(()=>{B.forEach(p=>ur(p,pm)),vi(r,A.toStyles)}),c.forEach(p=>{Nt(o,p,[]).push(h)}),h}_buildPlayer(e,A,i){return A.length>0?this.driver.animate(e.element,A,e.duration,e.delay,e.easing,i):new Bo(e.duration,e.delay)}},_a=class{namespaceId;triggerName;element;_player=new Bo;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(e,A,i){this.namespaceId=e,this.triggerName=A,this.element=i}setRealPlayer(e){this._containsRealPlayer||(this._player=e,this._queuedCallbacks.forEach((A,i)=>{A.forEach(o=>XE(e,i,void 0,o))}),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 A=this._player;A.triggerCallback&&e.onStart(()=>A.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,A){Nt(this._queuedCallbacks,e,[]).push(A)}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 A=this._player;A.triggerCallback&&A.triggerCallback(e)}};function jq(t,e,A){let i=t.get(e);if(i){if(i.length){let o=i.indexOf(A);i.splice(o,1)}i.length==0&&t.delete(e)}return i}function Xq(t){return t??null}function sc(t){return t&&t.nodeType===1}function $q(t){return t=="start"||t=="done"}function rS(t,e){let A=t.style.display;return t.style.display=e??"none",A}function IS(t,e,A,i,o){let g=[];A.forEach(r=>g.push(rS(r)));let n=[];i.forEach((r,I)=>{let B=new Map;r.forEach(c=>{let D=e.computeStyle(I,c,o);B.set(c,D),(!D||D.length==0)&&(I[Li]=zq,n.push(I))}),t.set(I,B)});let s=0;return A.forEach(r=>rS(r,g[s++])),n}function aS(t,e){let A=new Map;if(t.forEach(s=>A.set(s,[])),e.length==0)return A;let i=1,o=new Set(e),g=new Map;function n(s){if(!s)return i;let r=g.get(s);if(r)return r;let I=s.parentNode;return A.has(I)?r=I:o.has(I)?r=i:r=n(I),g.set(s,r),r}return e.forEach(s=>{let r=n(s);r!==i&&A.get(r).push(s)}),A}function gi(t,e){t.classList?.add(e)}function ur(t,e){t.classList?.remove(e)}function A1(t,e,A){Zo(A).onDone(()=>t.processLeaveNode(e))}function e1(t){let e=[];return dS(t,e),e}function dS(t,e){for(let A=0;Ao.add(g)):e.set(t,i),A.delete(t),!0}var Dr=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(e,A)=>{};constructor(e,A,i){this._driver=A,this._normalizer=i,this._transitionEngine=new Ym(e.body,A,i),this._timelineEngine=new _m(e.body,A,i),this._transitionEngine.onRemovalComplete=(o,g)=>this.onRemovalComplete(o,g)}registerTrigger(e,A,i,o,g){let n=e+"-"+o,s=this._triggerCache[n];if(!s){let r=[],I=[],B=QS(this._driver,g,r,I);if(r.length)throw Yb(o,r);s=Hq(o,B,this._normalizer),this._triggerCache[n]=s}this._transitionEngine.registerTrigger(A,o,s)}register(e,A){this._transitionEngine.register(e,A)}destroy(e,A){this._transitionEngine.destroy(e,A)}onInsert(e,A,i,o){this._transitionEngine.insertNode(e,A,i,o)}onRemove(e,A,i){this._transitionEngine.removeNode(e,A,i)}disableAnimations(e,A){this._transitionEngine.markElementAsDisabled(e,A)}process(e,A,i,o){if(i.charAt(0)=="@"){let[g,n]=um(i),s=o;this._timelineEngine.command(g,A,n,s)}else this._transitionEngine.trigger(e,A,i,o)}listen(e,A,i,o,g){if(i.charAt(0)=="@"){let[n,s]=um(i);return this._timelineEngine.listen(n,A,s,g)}return this._transitionEngine.listen(e,A,i,o,g)}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 i1(t,e){let A=null,i=null;return Array.isArray(e)&&e.length?(A=bm(e[0]),e.length>1&&(i=bm(e[e.length-1]))):e instanceof Map&&(A=bm(e)),A||i?new o1(t,A,i):null}var o1=(()=>{class t{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(A,i,o){this._element=A,this._startStyles=i,this._endStyles=o;let g=t.initialStylesByElement.get(A);g||t.initialStylesByElement.set(A,g=new Map),this._initialStyles=g}start(){this._state<1&&(this._startStyles&&vi(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(vi(this._element,this._initialStyles),this._endStyles&&(vi(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(t.initialStylesByElement.delete(this._element),this._startStyles&&(bg(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(bg(this._element,this._endStyles),this._endStyles=null),vi(this._element,this._initialStyles),this._state=3)}}return t})();function bm(t){let e=null;return t.forEach((A,i)=>{g1(i)&&(e=e||new Map,e.set(i,A))}),e}function g1(t){return t==="display"||t==="position"}var Ec=class{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(e,A,i,o){this.element=e,this.keyframes=A,this.options=i,this._specialStyles=o,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._initialized=!0;let e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:new Map;let A=()=>this._onFinish();this.domPlayer.addEventListener("finish",A),this.onDestroy(()=>{this.domPlayer.removeEventListener("finish",A)})}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_convertKeyframesToObject(e){let A=[];return e.forEach(i=>{A.push(Object.fromEntries(i))}),A}_triggerWebAnimation(e,A,i){return e.animate(this._convertKeyframesToObject(A),i)}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(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(e=>e()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),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&&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===void 0&&this.init(),this.domPlayer.currentTime=e*this.time}getPosition(){return+(this.domPlayer.currentTime??0)/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){let e=new Map;this.hasStarted()&&this._finalKeyframe.forEach((i,o)=>{o!=="offset"&&e.set(o,this._finished?i:oc(this.element,o))}),this.currentSnapshot=e}triggerCallback(e){let A=e==="start"?this._onStartFns:this._onDoneFns;A.forEach(i=>i()),A.length=0}},cc=class{validateStyleProperty(e){return!0}validateAnimatableStyleProperty(e){return!0}containsElement(e,A){return Dm(e,A)}getParentElement(e){return Ac(e)}query(e,A,i){return mm(e,A,i)}computeStyle(e,A,i){return oc(e,A)}animate(e,A,i,o,g,n=[]){let s=o==0?"both":"forwards",r={duration:i,delay:o,fill:s};g&&(r.easing=g);let I=new Map,B=n.filter(h=>h instanceof Ec);AS(i,o)&&B.forEach(h=>{h.currentSnapshot.forEach((p,y)=>I.set(y,p))});let c=Xb(A).map(h=>new Map(h));c=eS(e,c,I);let D=i1(e,c);return new Ec(e,c,r,D)}};var rc="@",hS="@.disabled",lc=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(e,A,i,o){this.namespaceId=e,this.delegate=A,this.engine=i,this._onDestroy=o}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,A){return this.delegate.createElement(e,A)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,A){this.delegate.appendChild(e,A),this.engine.onInsert(this.namespaceId,A,e,!1)}insertBefore(e,A,i,o=!0){this.delegate.insertBefore(e,A,i),this.engine.onInsert(this.namespaceId,A,e,o)}removeChild(e,A,i){this.parentNode(A)&&this.engine.onRemove(this.namespaceId,A,this.delegate)}selectRootElement(e,A){return this.delegate.selectRootElement(e,A)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,A,i,o){this.delegate.setAttribute(e,A,i,o)}removeAttribute(e,A,i){this.delegate.removeAttribute(e,A,i)}addClass(e,A){this.delegate.addClass(e,A)}removeClass(e,A){this.delegate.removeClass(e,A)}setStyle(e,A,i,o){this.delegate.setStyle(e,A,i,o)}removeStyle(e,A,i){this.delegate.removeStyle(e,A,i)}setProperty(e,A,i){A.charAt(0)==rc&&A==hS?this.disableAnimations(e,!!i):this.delegate.setProperty(e,A,i)}setValue(e,A){this.delegate.setValue(e,A)}listen(e,A,i,o){return this.delegate.listen(e,A,i,o)}disableAnimations(e,A){this.engine.disableAnimations(e,A)}},Jm=class extends lc{factory;constructor(e,A,i,o,g){super(A,i,o,g),this.factory=e,this.namespaceId=A}setProperty(e,A,i){A.charAt(0)==rc?A.charAt(1)=="."&&A==hS?(i=i===void 0?!0:!!i,this.disableAnimations(e,i)):this.engine.process(this.namespaceId,e,A.slice(1),i):this.delegate.setProperty(e,A,i)}listen(e,A,i,o){if(A.charAt(0)==rc){let g=n1(e),n=A.slice(1),s="";return n.charAt(0)!=rc&&([n,s]=s1(n)),this.engine.listen(this.namespaceId,g,n,s,r=>{let I=r._data||-1;this.factory.scheduleListenerCallback(I,i,r)})}return this.delegate.listen(e,A,i,o)}};function n1(t){switch(t){case"body":return document.body;case"document":return document;case"window":return window;default:return t}}function s1(t){let e=t.indexOf("."),A=t.substring(0,e),i=t.slice(e+1);return[A,i]}var dc=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(e,A,i){this.delegate=e,this.engine=A,this._zone=i,A.onRemovalComplete=(o,g)=>{g?.removeChild(null,o)}}createRenderer(e,A){let i="",o=this.delegate.createRenderer(e,A);if(!e||!A?.data?.animation){let I=this._rendererCache,B=I.get(o);if(!B){let c=()=>I.delete(o);B=new lc(i,o,this.engine,c),I.set(o,B)}return B}let g=A.id,n=A.id+"-"+this._currentId;this._currentId++,this.engine.register(n,e);let s=I=>{Array.isArray(I)?I.forEach(s):this.engine.registerTrigger(g,n,e,I.name,I)};return A.data.animation.forEach(s),new Jm(this,n,o,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(e,A,i){if(e>=0&&eA(i));return}let o=this._animationCallbacksBuffer;o.length==0&&queueMicrotask(()=>{this._zone.run(()=>{o.forEach(g=>{let[n,s]=g;n(s)}),this._animationCallbacksBuffer=[]})}),o.push([A,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 I1=(()=>{class t extends Dr{constructor(A,i,o){super(A,i,o)}ngOnDestroy(){this.flush()}static \u0275fac=function(i){return new(i||t)(J(lA),J(vn),J(Ln))};static \u0275prov=N({token:t,factory:t.\u0275fac})}return t})();function a1(){return new Ic}function C1(t,e,A){return new dc(t,e,A)}var DS=[{provide:Ln,useFactory:a1},{provide:Dr,useClass:I1},{provide:tt,useFactory:C1,deps:[uI,Dr,X]}],B1=[{provide:vn,useClass:Hm},{provide:ee,useValue:"NoopAnimations"},...DS],uS=[{provide:vn,useFactory:()=>new cc},{provide:ee,useFactory:()=>"BrowserAnimations"},...DS],mS=(()=>{class t{static withConfig(A){return{ngModule:t,providers:A.disableAnimations?B1:uS}}static \u0275fac=function(i){return new(i||t)};static \u0275mod=V({type:t});static \u0275inj=q({providers:uS,imports:[mI]})}return t})();var hc=class t{static \u0275fac=function(A){return new(A||t)};static \u0275mod=V({type:t});static \u0275inj=q({imports:[Uo,hQ,JF,FF,To,YE,xo,Kk,xo,xF,HF,ZF,Ab,kE,qk,uF,NF,mb.forRoot(),fb,bM]})};var xa=class t{static \u0275fac=function(A){return new(A||t)};static \u0275mod=V({type:t,bootstrap:[lr]});static \u0275inj=q({providers:[Si,fg,ho,Cr,Br,Fg,co,ar,cr],imports:[hc,mI,hQ,Ph,jE,YE,To,xo,mS,xo]})};fetch("/assets/config/runtime-config.json").then(t=>t.json()).then(t=>{window.runtimeConfig=t,$B().bootstrapModule(xa).catch(e=>console.error(e))});$B().bootstrapModule(xa).catch(t=>console.error(t)); +`)}static{this.\u0275fac=function(i){return new(i||t)(J(PP,8),J(db,8),J(ZP,8),J(qP,8),J(jt),J(hb),J(it,8),J(an))}}static{this.\u0275prov=N({token:t,factory:t.\u0275fac})}}return t})(),Db=(()=>{class t{get disableSanitizer(){return this._disableSanitizer}set disableSanitizer(A){this._disableSanitizer=this.coerceBooleanProperty(A)}get inline(){return this._inline}set inline(A){this._inline=this.coerceBooleanProperty(A)}get clipboard(){return this._clipboard}set clipboard(A){this._clipboard=this.coerceBooleanProperty(A)}get emoji(){return this._emoji}set emoji(A){this._emoji=this.coerceBooleanProperty(A)}get katex(){return this._katex}set katex(A){this._katex=this.coerceBooleanProperty(A)}get mermaid(){return this._mermaid}set mermaid(A){this._mermaid=this.coerceBooleanProperty(A)}get lineHighlight(){return this._lineHighlight}set lineHighlight(A){this._lineHighlight=this.coerceBooleanProperty(A)}get lineNumbers(){return this._lineNumbers}set lineNumbers(A){this._lineNumbers=this.coerceBooleanProperty(A)}get commandLine(){return this._commandLine}set commandLine(A){this._commandLine=this.coerceBooleanProperty(A)}constructor(A,i,o){this.element=A,this.markdownService=i,this.viewContainerRef=o,this.error=new $,this.load=new $,this.ready=new $,this._clipboard=!1,this._commandLine=!1,this._disableSanitizer=!1,this._emoji=!1,this._inline=!1,this._katex=!1,this._lineHighlight=!1,this._lineNumbers=!1,this._mermaid=!1,this.destroyed$=new K}ngOnChanges(){this.loadContent()}loadContent(){if(this.data!=null){this.handleData();return}if(this.src!=null){this.handleSrc();return}}ngAfterViewInit(){!this.data&&!this.src&&this.handleTransclusion(),this.markdownService.reload$.pipe(DA(this.destroyed$)).subscribe(()=>this.loadContent())}ngOnDestroy(){this.destroyed$.next(),this.destroyed$.complete()}render(A,i=!1){return qe(this,null,function*(){let o={decodeHtml:i,inline:this.inline,emoji:this.emoji,mermaid:this.mermaid,disableSanitizer:this.disableSanitizer},g={clipboard:this.clipboard,clipboardOptions:this.getClipboardOptions(),katex:this.katex,katexOptions:this.katexOptions,mermaid:this.mermaid,mermaidOptions:this.mermaidOptions},n=yield this.markdownService.parse(A,o);this.element.nativeElement.innerHTML=n,this.handlePlugins(),this.markdownService.render(this.element.nativeElement,g,this.viewContainerRef),this.ready.emit()})}coerceBooleanProperty(A){return A!=null&&`${String(A)}`!="false"}getClipboardOptions(){if(this.clipboardButtonComponent||this.clipboardButtonTemplate)return{buttonComponent:this.clipboardButtonComponent,buttonTemplate:this.clipboardButtonTemplate}}handleData(){this.render(this.data)}handleSrc(){this.markdownService.getSource(this.src).subscribe({next:A=>{this.render(A).then(()=>{this.load.emit(A)})},error:A=>this.error.emit(A)})}handleTransclusion(){this.render(this.element.nativeElement.innerHTML,!0)}handlePlugins(){this.commandLine&&(this.setPluginClass(this.element.nativeElement,Qm.CommandLine),this.setPluginOptions(this.element.nativeElement,{dataFilterOutput:this.filterOutput,dataHost:this.host,dataPrompt:this.prompt,dataOutput:this.output,dataUser:this.user})),this.lineHighlight&&this.setPluginOptions(this.element.nativeElement,{dataLine:this.line,dataLineOffset:this.lineOffset}),this.lineNumbers&&(this.setPluginClass(this.element.nativeElement,Qm.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(A,i){let o=A.querySelectorAll("pre");for(let g=0;g{let s=i[n];if(s){let r=this.toLispCase(n);o.item(g).setAttribute(r,s.toString())}})}toLispCase(A){let i=A.match(/([A-Z])/g);if(!i)return A;let o=A.toString();for(let g=0,n=i.length;g{let i=eZ(A)?hA(R({},A),{multi:!0}):{provide:db,useValue:A,multi:!0};return[...e,i]},[])}var mb=(()=>{class t{static forRoot(A){return{ngModule:t,providers:[AZ(A)]}}static forChild(){return{ngModule:t}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=V({type:t})}static{this.\u0275inj=q({imports:[Uo]})}}return t})();var oZ=["switch"],gZ=["*"];function nZ(t,e){t&1&&(u(0,"span",10),at(),u(1,"svg",12),W(2,"path",13),m(),u(3,"svg",14),W(4,"path",15),m()())}var sZ=new k("mat-slide-toggle-default-options",{providedIn:"root",factory:()=>({disableToggleValue:!1,hideIcon:!1,disabledInteractive:!1})}),rZ={provide:Bn,useExisting:ft(()=>zE),multi:!0},WE=class{source;checked;constructor(e,A){this.source=e,this.checked=A}},zE=(()=>{class t{_elementRef=Q(Z);_focusMonitor=Q(Xt);_changeDetectorRef=Q(zA);defaults=Q(sZ);_onChange=A=>{};_onTouched=()=>{};_validatorOnChange=()=>{};_uniqueId;_checked=!1;_createChangeEvent(A){return new WE(this,A)}_labelId;get buttonId(){return`${this.id||this._uniqueId}-button`}_switchElement;focus(){this._switchElement.nativeElement.focus()}_noopAnimations;_focused;name=null;id;labelPosition="after";ariaLabel=null;ariaLabelledby=null;ariaDescribedby;required;color;disabled=!1;disableRipple=!1;tabIndex=0;get checked(){return this._checked}set checked(A){this._checked=A,this._changeDetectorRef.markForCheck()}hideIcon;disabledInteractive;change=new $;toggleChange=new $;get inputId(){return`${this.id||this._uniqueId}-input`}constructor(){Q(be).load(ki);let A=Q(new Dt("tabindex"),{optional:!0}),i=this.defaults,o=Q(ee,{optional:!0});this.tabIndex=A==null?0:parseInt(A)||0,this.color=i.color||"accent",this._noopAnimations=o==="NoopAnimations",this.id=this._uniqueId=Q(ce).getId("mat-mdc-slide-toggle-"),this.hideIcon=i.hideIcon??!1,this.disabledInteractive=i.disabledInteractive??!1,this._labelId=this._uniqueId+"-label"}ngAfterContentInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(A=>{A==="keyboard"||A==="program"?(this._focused=!0,this._changeDetectorRef.markForCheck()):A||Promise.resolve().then(()=>{this._focused=!1,this._onTouched(),this._changeDetectorRef.markForCheck()})})}ngOnChanges(A){A.required&&this._validatorOnChange()}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef)}writeValue(A){this.checked=!!A}registerOnChange(A){this._onChange=A}registerOnTouched(A){this._onTouched=A}validate(A){return this.required&&A.value!==!0?{required:!0}:null}registerOnValidatorChange(A){this._validatorOnChange=A}setDisabledState(A){this.disabled=A,this._changeDetectorRef.markForCheck()}toggle(){this.checked=!this.checked,this._onChange(this.checked)}_emitChangeEvent(){this._onChange(this.checked),this.change.emit(this._createChangeEvent(this.checked))}_handleClick(){this.disabled||(this.toggleChange.emit(),this.defaults.disableToggleValue||(this.checked=!this.checked,this._onChange(this.checked),this.change.emit(new WE(this,this.checked))))}_getAriaLabelledBy(){return this.ariaLabelledby?this.ariaLabelledby:this.ariaLabel?null:this._labelId}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=O({type:t,selectors:[["mat-slide-toggle"]],viewQuery:function(i,o){if(i&1&&cA(oZ,5),i&2){let g;z(g=j())&&(o._switchElement=g.first)}},hostAttrs:[1,"mat-mdc-slide-toggle"],hostVars:13,hostBindings:function(i,o){i&2&&(yt("id",o.id),IA("tabindex",null)("aria-label",null)("name",null)("aria-labelledby",null),Xe(o.color?"mat-"+o.color:""),gA("mat-mdc-slide-toggle-focused",o._focused)("mat-mdc-slide-toggle-checked",o.checked)("_mat-animation-noopable",o._noopAnimations))},inputs:{name:"name",id:"id",labelPosition:"labelPosition",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],required:[2,"required","required",iA],color:"color",disabled:[2,"disabled","disabled",iA],disableRipple:[2,"disableRipple","disableRipple",iA],tabIndex:[2,"tabIndex","tabIndex",A=>A==null?0:Fe(A)],checked:[2,"checked","checked",iA],hideIcon:[2,"hideIcon","hideIcon",iA],disabledInteractive:[2,"disabledInteractive","disabledInteractive",iA]},outputs:{change:"change",toggleChange:"toggleChange"},exportAs:["matSlideToggle"],features:[KA([rZ,{provide:Cg,useExisting:t,multi:!0}]),VA],ngContentSelectors:gZ,decls:13,vars:27,consts:[["switch",""],["mat-internal-form-field","",3,"labelPosition"],["role","switch","type","button",1,"mdc-switch",3,"click","tabIndex","disabled"],[1,"mdc-switch__track"],[1,"mdc-switch__handle-track"],[1,"mdc-switch__handle"],[1,"mdc-switch__shadow"],[1,"mdc-elevation-overlay"],[1,"mdc-switch__ripple"],["mat-ripple","",1,"mat-mdc-slide-toggle-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-switch__icons"],[1,"mdc-label",3,"click","for"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--on"],["d","M19.69,5.23L8.96,15.96l-4.23-4.23L2.96,13.5l6,6L21.46,7L19.69,5.23z"],["viewBox","0 0 24 24","aria-hidden","true",1,"mdc-switch__icon","mdc-switch__icon--off"],["d","M20 13H4v-2h16v2z"]],template:function(i,o){if(i&1){let g=aA();qA(),u(0,"div",1)(1,"button",2,0),x("click",function(){return H(g),T(o._handleClick())}),W(3,"span",3),u(4,"span",4)(5,"span",5)(6,"span",6),W(7,"span",7),m(),u(8,"span",8),W(9,"span",9),m(),_(10,nZ,5,0,"span",10),m()()(),u(11,"label",11),x("click",function(s){return H(g),T(s.stopPropagation())}),rA(12),m()()}if(i&2){let g=He(2);F("labelPosition",o.labelPosition),f(),gA("mdc-switch--selected",o.checked)("mdc-switch--unselected",!o.checked)("mdc-switch--checked",o.checked)("mdc-switch--disabled",o.disabled)("mat-mdc-slide-toggle-disabled-interactive",o.disabledInteractive),F("tabIndex",o.disabled&&!o.disabledInteractive?-1:o.tabIndex)("disabled",o.disabled&&!o.disabledInteractive),IA("id",o.buttonId)("name",o.name)("aria-label",o.ariaLabel)("aria-labelledby",o._getAriaLabelledBy())("aria-describedby",o.ariaDescribedby)("aria-required",o.required||null)("aria-checked",o.checked)("aria-disabled",o.disabled&&o.disabledInteractive?"true":null),f(8),F("matRippleTrigger",g)("matRippleDisabled",o.disableRipple||o.disabled)("matRippleCentered",!0),f(),wA(o.hideIcon?-1:10),f(),F("for",o.buttonId),IA("id",o._labelId)}},dependencies:[dg,cE],styles:['.mdc-switch{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;flex-shrink:0;margin:0;outline:none;overflow:visible;padding:0;position:relative;width:var(--mdc-switch-track-width, 52px)}.mdc-switch.mdc-switch--disabled{cursor:default;pointer-events:none}.mdc-switch.mat-mdc-slide-toggle-disabled-interactive{pointer-events:auto}.mdc-switch__track{overflow:hidden;position:relative;width:100%;height:var(--mdc-switch-track-height, 32px);border-radius:var(--mdc-switch-track-shape, var(--mat-sys-corner-full))}.mdc-switch--disabled.mdc-switch .mdc-switch__track{opacity:var(--mdc-switch-disabled-track-opacity, 0.12)}.mdc-switch__track::before,.mdc-switch__track::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";height:100%;left:0;position:absolute;width:100%;border-width:var(--mat-switch-track-outline-width, 2px);border-color:var(--mat-switch-track-outline-color, var(--mat-sys-outline))}.mdc-switch--selected .mdc-switch__track::before,.mdc-switch--selected .mdc-switch__track::after{border-width:var(--mat-switch-selected-track-outline-width, 2px);border-color:var(--mat-switch-selected-track-outline-color, transparent)}.mdc-switch--disabled .mdc-switch__track::before,.mdc-switch--disabled .mdc-switch__track::after{border-width:var(--mat-switch-disabled-unselected-track-outline-width, 2px);border-color:var(--mat-switch-disabled-unselected-track-outline-color, var(--mat-sys-on-surface))}@media(forced-colors: active){.mdc-switch__track{border-color:currentColor}}.mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0, 0, 0.2, 1);transform:translateX(0);background:var(--mdc-switch-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__track::before{transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.6, 1);transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch--selected .mdc-switch__track::before{transform:translateX(-100%)}.mdc-switch--selected .mdc-switch__track::before{opacity:var(--mat-switch-hidden-track-opacity, 0);transition:var(--mat-switch-hidden-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::before{opacity:var(--mat-switch-visible-track-opacity, 1);transition:var(--mat-switch-visible-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::before{background:var(--mdc-switch-unselected-hover-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::before{background:var(--mdc-switch-unselected-focus-track-color, var(--mat-sys-surface-variant))}.mdc-switch:enabled:active .mdc-switch__track::before{background:var(--mdc-switch-unselected-pressed-track-color, var(--mat-sys-surface-variant))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::before,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::before,.mdc-switch.mdc-switch--disabled .mdc-switch__track::before{background:var(--mdc-switch-disabled-unselected-track-color, var(--mat-sys-surface-variant))}.mdc-switch__track::after{transform:translateX(-100%);background:var(--mdc-switch-selected-track-color, var(--mat-sys-primary))}[dir=rtl] .mdc-switch__track::after{transform:translateX(100%)}.mdc-switch--selected .mdc-switch__track::after{transform:translateX(0)}.mdc-switch--selected .mdc-switch__track::after{opacity:var(--mat-switch-visible-track-opacity, 1);transition:var(--mat-switch-visible-track-transition, opacity 75ms)}.mdc-switch--unselected .mdc-switch__track::after{opacity:var(--mat-switch-hidden-track-opacity, 0);transition:var(--mat-switch-hidden-track-transition, opacity 75ms)}.mdc-switch:enabled:hover:not(:focus):not(:active) .mdc-switch__track::after{background:var(--mdc-switch-selected-hover-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:focus:not(:active) .mdc-switch__track::after{background:var(--mdc-switch-selected-focus-track-color, var(--mat-sys-primary))}.mdc-switch:enabled:active .mdc-switch__track::after{background:var(--mdc-switch-selected-pressed-track-color, var(--mat-sys-primary))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__track::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__track::after,.mdc-switch.mdc-switch--disabled .mdc-switch__track::after{background:var(--mdc-switch-disabled-selected-track-color, var(--mat-sys-on-surface))}.mdc-switch__handle-track{height:100%;pointer-events:none;position:absolute;top:0;transition:transform 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);left:0;right:auto;transform:translateX(0);width:calc(100% - var(--mdc-switch-handle-width))}[dir=rtl] .mdc-switch__handle-track{left:auto;right:0}.mdc-switch--selected .mdc-switch__handle-track{transform:translateX(100%)}[dir=rtl] .mdc-switch--selected .mdc-switch__handle-track{transform:translateX(-100%)}.mdc-switch__handle{display:flex;pointer-events:auto;position:absolute;top:50%;transform:translateY(-50%);left:0;right:auto;transition:width 75ms cubic-bezier(0.4, 0, 0.2, 1),height 75ms cubic-bezier(0.4, 0, 0.2, 1),margin 75ms cubic-bezier(0.4, 0, 0.2, 1);width:var(--mdc-switch-handle-width);height:var(--mdc-switch-handle-height);border-radius:var(--mdc-switch-handle-shape, var(--mat-sys-corner-full))}[dir=rtl] .mdc-switch__handle{left:auto;right:0}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle{width:var(--mat-switch-unselected-handle-size, 16px);height:var(--mat-switch-unselected-handle-size, 16px);margin:var(--mat-switch-unselected-handle-horizontal-margin, 0 8px)}.mat-mdc-slide-toggle .mdc-switch--unselected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-switch-unselected-with-icon-handle-horizontal-margin, 0 4px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle{width:var(--mat-switch-selected-handle-size, 24px);height:var(--mat-switch-selected-handle-size, 24px);margin:var(--mat-switch-selected-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch--selected .mdc-switch__handle:has(.mdc-switch__icons){margin:var(--mat-switch-selected-with-icon-handle-horizontal-margin, 0 24px)}.mat-mdc-slide-toggle .mdc-switch__handle:has(.mdc-switch__icons){width:var(--mat-switch-with-icon-handle-size, 24px);height:var(--mat-switch-with-icon-handle-size, 24px)}.mat-mdc-slide-toggle .mdc-switch:active:not(.mdc-switch--disabled) .mdc-switch__handle{width:var(--mat-switch-pressed-handle-size, 28px);height:var(--mat-switch-pressed-handle-size, 28px)}.mat-mdc-slide-toggle .mdc-switch--selected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-switch-selected-pressed-handle-horizontal-margin, 0 22px)}.mat-mdc-slide-toggle .mdc-switch--unselected:active:not(.mdc-switch--disabled) .mdc-switch__handle{margin:var(--mat-switch-unselected-pressed-handle-horizontal-margin, 0 2px)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__handle::after{opacity:var(--mat-switch-disabled-selected-handle-opacity, 1)}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__handle::after{opacity:var(--mat-switch-disabled-unselected-handle-opacity, 0.38)}.mdc-switch__handle::before,.mdc-switch__handle::after{border:1px solid rgba(0,0,0,0);border-radius:inherit;box-sizing:border-box;content:"";width:100%;height:100%;left:0;position:absolute;top:0;transition:background-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1),border-color 75ms 0ms cubic-bezier(0.4, 0, 0.2, 1);z-index:-1}@media(forced-colors: active){.mdc-switch__handle::before,.mdc-switch__handle::after{border-color:currentColor}}.mdc-switch--selected:enabled .mdc-switch__handle::after{background:var(--mdc-switch-selected-handle-color, var(--mat-sys-on-primary))}.mdc-switch--selected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-selected-hover-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-selected-focus-handle-color, var(--mat-sys-primary-container))}.mdc-switch--selected:enabled:active .mdc-switch__handle::after{background:var(--mdc-switch-selected-pressed-handle-color, var(--mat-sys-primary-container))}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:hover:not(:focus):not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:focus:not(:active) .mdc-switch__handle::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled.mdc-switch--selected:active .mdc-switch__handle::after,.mdc-switch--selected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mdc-switch-disabled-selected-handle-color, var(--mat-sys-surface))}.mdc-switch--unselected:enabled .mdc-switch__handle::after{background:var(--mdc-switch-unselected-handle-color, var(--mat-sys-outline))}.mdc-switch--unselected:enabled:hover:not(:focus):not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-unselected-hover-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:focus:not(:active) .mdc-switch__handle::after{background:var(--mdc-switch-unselected-focus-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected:enabled:active .mdc-switch__handle::after{background:var(--mdc-switch-unselected-pressed-handle-color, var(--mat-sys-on-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__handle::after{background:var(--mdc-switch-disabled-unselected-handle-color, var(--mat-sys-on-surface))}.mdc-switch__handle::before{background:var(--mdc-switch-handle-surface-color)}.mdc-switch__shadow{border-radius:inherit;bottom:0;left:0;position:absolute;right:0;top:0}.mdc-switch:enabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-handle-elevation-shadow)}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:hover:not(:focus):not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:focus:not(:active) .mdc-switch__shadow,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:active .mdc-switch__shadow,.mdc-switch.mdc-switch--disabled .mdc-switch__shadow{box-shadow:var(--mdc-switch-disabled-handle-elevation-shadow)}.mdc-switch__ripple{left:50%;position:absolute;top:50%;transform:translate(-50%, -50%);z-index:-1;width:var(--mdc-switch-state-layer-size, 40px);height:var(--mdc-switch-state-layer-size, 40px)}.mdc-switch__ripple::after{content:"";opacity:0}.mdc-switch--disabled .mdc-switch__ripple::after{display:none}.mat-mdc-slide-toggle-disabled-interactive .mdc-switch__ripple::after{display:block}.mdc-switch:hover .mdc-switch__ripple::after{opacity:.04;transition:75ms opacity cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mdc-switch .mdc-switch__ripple::after{opacity:.12}.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:focus .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:active .mdc-switch__ripple::after,.mat-mdc-slide-toggle-disabled-interactive.mdc-switch--disabled:enabled:hover:not(:focus) .mdc-switch__ripple::after,.mdc-switch--unselected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mdc-switch-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-switch--unselected:enabled:focus .mdc-switch__ripple::after{background:var(--mdc-switch-unselected-focus-state-layer-color, var(--mat-sys-on-surface))}.mdc-switch--unselected:enabled:active .mdc-switch__ripple::after{background:var(--mdc-switch-unselected-pressed-state-layer-color, var(--mat-sys-on-surface));opacity:var(--mdc-switch-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch--selected:enabled:hover:not(:focus) .mdc-switch__ripple::after{background:var(--mdc-switch-selected-hover-state-layer-color, var(--mat-sys-primary))}.mdc-switch--selected:enabled:focus .mdc-switch__ripple::after{background:var(--mdc-switch-selected-focus-state-layer-color, var(--mat-sys-primary))}.mdc-switch--selected:enabled:active .mdc-switch__ripple::after{background:var(--mdc-switch-selected-pressed-state-layer-color, var(--mat-sys-primary));opacity:var(--mdc-switch-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));transition:opacity 75ms linear}.mdc-switch__icons{position:relative;height:100%;width:100%;z-index:1}.mdc-switch--disabled.mdc-switch--unselected .mdc-switch__icons{opacity:var(--mdc-switch-disabled-unselected-icon-opacity, 0.38)}.mdc-switch--disabled.mdc-switch--selected .mdc-switch__icons{opacity:var(--mdc-switch-disabled-selected-icon-opacity, 0.38)}.mdc-switch__icon{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0;opacity:0;transition:opacity 30ms 0ms cubic-bezier(0.4, 0, 1, 1)}.mdc-switch--unselected .mdc-switch__icon{width:var(--mdc-switch-unselected-icon-size, 16px);height:var(--mdc-switch-unselected-icon-size, 16px);fill:var(--mdc-switch-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--unselected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mdc-switch-disabled-unselected-icon-color, var(--mat-sys-surface-variant))}.mdc-switch--selected .mdc-switch__icon{width:var(--mdc-switch-selected-icon-size, 16px);height:var(--mdc-switch-selected-icon-size, 16px);fill:var(--mdc-switch-selected-icon-color, var(--mat-sys-on-primary-container))}.mdc-switch--selected.mdc-switch--disabled .mdc-switch__icon{fill:var(--mdc-switch-disabled-selected-icon-color, var(--mat-sys-on-surface))}.mdc-switch--selected .mdc-switch__icon--on,.mdc-switch--unselected .mdc-switch__icon--off{opacity:1;transition:opacity 45ms 30ms cubic-bezier(0, 0, 0.2, 1)}.mat-mdc-slide-toggle{-webkit-user-select:none;user-select:none;display:inline-block;-webkit-tap-highlight-color:rgba(0,0,0,0);outline:0}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple,.mat-mdc-slide-toggle .mdc-switch__ripple::after{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-slide-toggle .mat-mdc-slide-toggle-ripple:not(:empty),.mat-mdc-slide-toggle .mdc-switch__ripple::after:not(:empty){transform:translateZ(0)}.mat-mdc-slide-toggle.mat-mdc-slide-toggle-focused .mat-focus-indicator::before{content:""}.mat-mdc-slide-toggle .mat-internal-form-field{color:var(--mat-switch-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-switch-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-switch-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-switch-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-switch-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-switch-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-slide-toggle .mat-ripple-element{opacity:.12}.mat-mdc-slide-toggle .mat-focus-indicator::before{border-radius:50%}.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle-track,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__icon,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__handle::after,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::before,.mat-mdc-slide-toggle._mat-animation-noopable .mdc-switch__track::after{transition:none}.mat-mdc-slide-toggle .mdc-switch:enabled+.mdc-label{cursor:pointer}.mat-mdc-slide-toggle .mdc-switch--disabled+label{color:var(--mdc-switch-disabled-label-text-color)}'],encapsulation:2,changeDetection:0})}return t})();var fb=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=V({type:t});static \u0275inj=q({imports:[zE,SA,SA]})}return t})();var cr=class t{downloadBase64Data(e,A,i="image.png"){try{let o=document.createElement("a");o.href=e,o.download=i,document.body.appendChild(o),o.click(),document.body.removeChild(o)}catch(o){throw console.error("Error downloading base64 data:",o),o}}static \u0275fac=function(A){return new(A||t)};static \u0275prov=N({token:t,factory:t.\u0275fac,providedIn:"root"})};function CZ(t,e){t&1&&W(0,"hr",10)}function BZ(t,e){if(t&1&&(u(0,"mat-option",11),v(1),m()),t&2){let A=e.$implicit;F("value",A),f(),PA(A.versionId)}}function QZ(t,e){if(t&1&&W(0,"img",12),t&2){let A,i=b().index,o=b();F("src",(A=o.selectedArtifacts[i].data)!==null&&A!==void 0?A:"",An)}}function EZ(t,e){if(t&1){let A=aA();u(0,"div",2),_(1,CZ,1,0,"hr",3),u(2,"div",4)(3,"span"),v(4),m()(),u(5,"div",4)(6,"span"),v(7," Version: "),m(),u(8,"div",5)(9,"mat-select",6),fi("ngModelChange",function(o){let g=H(A).index,n=b();return $i(n.selectedArtifacts[g],o)||(n.selectedArtifacts[g]=o),T(o)}),x("selectionChange",function(o){let g=H(A).index,n=b();return T(n.onArtifactVersionChange(o,g))}),_(10,BZ,2,2,"mat-option",7),m()(),u(11,"button",8),x("click",function(){let o=H(A).index,g=b();return T(g.downloadArtifact(g.selectedArtifacts[o]))}),u(12,"mat-icon"),v(13,"file_download"),m(),v(14," Download "),m()(),_(15,QZ,1,1,"img",9),m()}if(t&2){let A=e.$implicit,i=e.index,o=b();f(),F("ngIf",i>0),f(3),te(" ",o.getArtifactName(A)," "),f(5),mi("ngModel",o.selectedArtifacts[i]),f(),F("ngForOf",o.getSortedArtifactsFromId(A)),f(5),F("ngIf",o.isArtifactImage(o.selectedArtifacts[i]))}}var cZ="default_artifact_name",Fa=class t{constructor(e){this.downloadService=e}artifacts=[];selectedArtifacts=[];ngOnChanges(e){if(e.artifacts){this.selectedArtifacts=[];for(let A of this.getDistinctArtifactIds())this.selectedArtifacts.push(this.getSortedArtifactsFromId(A)[0])}}downloadArtifact(e){this.downloadService.downloadBase64Data(e.data,e.mimeType,e.id)}getArtifactName(e){return e??cZ}isArtifactImage(e){return!e||!e.mimeType?!1:e.mimeType.startsWith("image/")}getDistinctArtifactIds(){return[...new Set(this.artifacts.map(e=>e.id))]}getSortedArtifactsFromId(e){return this.artifacts.filter(A=>A.id===e).sort((A,i)=>i.versionId-A.versionId)}onArtifactVersionChange(e,A){this.selectedArtifacts[A]=e.value}static \u0275fac=function(A){return new(A||t)(AA(cr))};static \u0275cmp=O({type:t,selectors:[["app-artifact-tab"]],inputs:{artifacts:"artifacts"},standalone:!1,features:[VA],decls:2,vars:1,consts:[[1,"artifact-container"],["class","artifact-box",4,"ngFor","ngForOf"],[1,"artifact-box"],["class","white-separator",4,"ngIf"],[1,"artifact-metadata"],[1,"version-select-container"],[3,"ngModelChange","selectionChange","ngModel"],[3,"value",4,"ngFor","ngForOf"],["mat-flat-button","",1,"download-button",3,"click"],["class","generated-image","alt","artifact.id",3,"src",4,"ngIf"],[1,"white-separator"],[3,"value"],["alt","artifact.id",1,"generated-image",3,"src"]],template:function(A,i){A&1&&(u(0,"div",0),_(1,EZ,16,5,"div",1),m()),A&2&&(f(),F("ngForOf",i.getDistinctArtifactIds()))},dependencies:[Rt,Jt,oo,yi,Ir,bt,ir,hg],styles:[".artifact-container[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}.artifact-box[_ngcontent-%COMP%]{padding:10px;max-width:100%;margin-left:26px;display:flex;flex-direction:column}.artifact-metadata[_ngcontent-%COMP%]{display:flex;align-items:center;margin-bottom:15px}.download-button[_ngcontent-%COMP%]{background-color:#8ab4f8!important;margin-left:35px;width:130px;height:28px;font-size:14px}.generated-image[_ngcontent-%COMP%]{max-width:60%;border-radius:8px}hr.white-separator[_ngcontent-%COMP%]{border:none;border-top:1px solid white;margin-bottom:1.2em;margin-right:15px}.version-select-container[_ngcontent-%COMP%]{background-color:#212123;width:80px;margin-left:15px}"]})};var ba=class t{sessionState={};constructor(){}static \u0275fac=function(A){return new(A||t)};static \u0275cmp=O({type:t,selectors:[["app-state-tab"]],inputs:{sessionState:"sessionState"},standalone:!1,decls:3,vars:1,consts:[[1,"state-wrapper"],[3,"json"]],template:function(A,i){A&1&&(u(0,"div",0)(1,"div"),W(2,"ngx-json-viewer",1),m()()),A&2&&(f(2),F("json",i.sessionState))},dependencies:[OE],styles:[".state-wrapper[_ngcontent-%COMP%]{padding-left:25px;padding-right:25px;margin-top:16px}"]})};var hZ=["videoContainer"],uZ=["sidenav"],DZ=["autoScroll"],mZ=()=>[],fZ=(t,e)=>({"user-message":t,"bot-message":e}),wb=t=>({"background-color":t});function wZ(t,e){if(t&1&&(u(0,"mat-option",20),v(1),m()),t&2){let A=e.$implicit;F("value",A),f(),PA(A)}}function pZ(t,e){t&1&&tn(0,wZ,2,2,"mat-option",20,en),t&2&&on(e)}function yZ(t,e){if(t&1&&(u(0,"mat-option",20),v(1),m()),t&2){let A=b(2);F("value",A.selectedAppControl.value),f(),PA(A.selectedAppControl.value)}}function MZ(t,e){if(t&1&&(u(0,"div",10)(1,"mat-select",19),_(2,pZ,2,0),rg(3,"async"),_(4,yZ,2,2,"mat-option",20),m()()),t&2){let A,i=b();f(),F("placeholder",i.isLoadingApps()?"Loading...":"Select an agent")("formControl",i.selectedAppControl),f(),wA((A=Ds(3,4,i.apps$))?2:-1,A),f(2),wA(i.selectedAppControl.value&&i.isLoadingApps()?4:-1)}}function RZ(t,e){t&1&&(u(0,"span"),v(1," No apps Avaiable in current directory"),m())}function kZ(t,e){t&1&&(u(0,"span",29),v(1,"Events"),m())}function FZ(t,e){t&1&&(u(0,"span",29),v(1,"State"),m())}function bZ(t,e){t&1&&(u(0,"span",29),v(1,"Artifacts"),m())}function SZ(t,e){t&1&&(u(0,"span",29),v(1,"Sessions"),m())}function NZ(t,e){t&1&&(u(0,"span",29),v(1,"Eval"),m())}function GZ(t,e){if(t&1){let A=aA();u(0,"div",21)(1,"mat-tab-group")(2,"mat-tab",22),_(3,kZ,2,0,"ng-template",23),u(4,"app-event-tab",24),x("selectedEvent",function(o){H(A);let g=b();return T(g.selectEvent(o))}),m()(),u(5,"mat-tab"),_(6,FZ,2,0,"ng-template",23),W(7,"app-state-tab",25),m(),u(8,"mat-tab"),_(9,bZ,2,0,"ng-template",23),W(10,"app-artifact-tab",26),m(),u(11,"mat-tab"),_(12,SZ,2,0,"ng-template",23),u(13,"app-session-tab",27),x("sessionSelected",function(o){H(A);let g=b();return T(g.updateWithSelectedSession(o))})("sessionReloaded",function(o){H(A);let g=b();return T(g.updateSessionState(o))}),m()(),u(14,"mat-tab"),_(15,NZ,2,0,"ng-template",23),u(16,"app-eval-tab",28),x("sessionSelected",function(o){H(A);let g=b();return T(g.updateWithSelectedSession(o))}),m()()()()}if(t&2){let A=b();f(4),F("eventsMap",A.eventData),f(3),F("sessionState",A.currentSessionState),f(3),F("artifacts",A.artifacts),f(3),F("userId",A.userId)("appName",A.appName)("sessionId",A.sessionId),f(3),F("appName",A.appName)("userId",A.userId)("sessionId",A.sessionId)}}function vZ(t,e){if(t&1&&W(0,"div",41),t&2){let A=b(2);F("innerHtml",A.renderedEventGraph,jp)}}function LZ(t,e){if(t&1){let A=aA();u(0,"div",30)(1,"div",31)(2,"div",32)(3,"mat-paginator",33),x("page",function(o){H(A);let g=b();return T(g.handlePageEvent(o))}),m(),u(4,"button",34)(5,"mat-icon",9),x("click",function(){H(A);let o=b();return T(o.closeSelectedEvent())}),v(6,"close"),m()()()(),u(7,"div")(8,"mat-tab-group")(9,"mat-tab",35)(10,"div",36),_(11,vZ,1,1,"div",37),m(),W(12,"ngx-json-viewer",38),m(),u(13,"mat-tab",39),W(14,"ngx-json-viewer",38),m(),u(15,"mat-tab",40),W(16,"ngx-json-viewer",38),m()()()()}if(t&2){let A=b();f(3),F("length",A.eventData.size)("pageSize",1)("pageIndex",A.selectedEventIndex),f(8),F("ngIf",A.renderedEventGraph),f(),F("json",A.selectedEvent),f(2),F("json",A.llmRequest),f(2),F("json",A.llmResponse)}}function KZ(t,e){if(t&1){let A=aA();u(0,"div",42)(1,"div",43)(2,"div",44),v(3,"Session ID"),m(),u(4,"div",45),v(5),m()(),u(6,"div",46)(7,"div",47)(8,"mat-slide-toggle",48),x("change",function(){H(A);let o=b();return T(o.toggleSse())}),v(9," Token Streaming "),m()(),W(10,"mat-divider",49),u(11,"div",50)(12,"div",51),x("click",function(){H(A);let o=b();return T(o.onNewSessionClick())}),u(13,"mat-icon"),v(14,"add"),m(),v(15," New Session "),m(),u(16,"span",52),x("click",function(){H(A);let o=b();return T(o.deleteSession(o.sessionId))}),v(17," delete "),m()()()()}if(t&2){let A=b();f(5),PA(A.sessionId),f(3),F("checked",A.enableSseIndicator()),f(2),F("vertical",!0)}}function UZ(t,e){t&1&&(u(0,"div",53)(1,"span"),v(2,"Loading agents, please wait..."),m()())}function _Z(t,e){t&1&&(u(0,"span"),v(1,"Welcome to ADK!"),W(2,"br"),v(3," Select an agent on the left to begin with."),m())}function xZ(t,e){if(t&1&&(v(0," Error message: "),W(1,"br"),u(2,"pre",55),v(3),m()),t&2){let A=b(4);f(3),PA(A.loadingError())}}function YZ(t,e){t&1&&(u(0,"pre",54),v(1,"Warning: No agents found in current folder."),m())}function JZ(t,e){if(t&1&&(u(0,"div"),v(1," Failed to load agents. To get started, run "),u(2,"pre"),v(3,"adk web"),m(),v(4," in the folder that contains the agents."),W(5,"br"),_(6,xZ,4,1)(7,YZ,2,0,"pre",54),m()),t&2){let A=b(3);f(6),wA(A.loadingError()?6:7)}}function HZ(t,e){if(t&1&&(u(0,"div",53),_(1,_Z,4,0,"span"),rg(2,"async"),_(3,JZ,8,1,"div"),m()),t&2){let A=b(2);f(),wA((Ds(2,1,A.apps$)||I0(3,mZ)).length>0?1:3)}}function TZ(t,e){if(t&1&&_(0,UZ,3,0,"div",53)(1,HZ,4,4,"div",53),t&2){let A=b();wA(A.isLoadingApps()?0:1)}}function OZ(t,e){if(t&1){let A=aA();u(0,"button",56),x("click",function(){H(A);let o=b();return T(o.openDialog())}),u(1,"mat-icon"),v(2,"priority_high"),m()()}}function PZ(t,e){if(t&1){let A=aA();u(0,"button",67),x("click",function(){H(A);let o=b().index,g=b(2);return T(g.clickEvent(o))}),u(1,"mat-icon",68),v(2,"robot_2"),m()()}}function ZZ(t,e){if(t&1&&(ui(0),W(1,"img",72),Di()),t&2){let A=b().$implicit;f(),F("src",A.url,An)}}function qZ(t,e){if(t&1&&(ui(0),u(1,"mat-icon"),v(2,"insert_drive_file"),m(),u(3,"a",73),v(4),m(),Di()),t&2){let A=b().$implicit;f(3),F("href",A.url,An),f(),PA(A.file.name)}}function VZ(t,e){if(t&1&&(u(0,"div",71),_(1,ZZ,2,1,"ng-container",64)(2,qZ,5,2,"ng-container",64),m()),t&2){let A=e.$implicit;f(),F("ngIf",A.file.type.startsWith("image/")),f(),F("ngIf",!A.file.type.startsWith("image/"))}}function WZ(t,e){if(t&1&&(u(0,"div",69),_(1,VZ,3,2,"div",70),m()),t&2){let A=b().$implicit;f(),F("ngForOf",A.attachments)}}function zZ(t,e){if(t&1&&W(0,"markdown",74),t&2){let A=b().$implicit;F("data",A.text)}}function jZ(t,e){if(t&1&&(u(0,"code"),v(1),m()),t&2){let A=b().$implicit;f(),te(" ",A.executableCode.code," ")}}function XZ(t,e){if(t&1&&(u(0,"div")(1,"div"),v(2),m(),u(3,"div"),v(4),m()()),t&2){let A=b().$implicit;f(2),te("Outcome: ",A.codeExecutionResult.outcome,""),f(2),te("Output: ",A.codeExecutionResult.output,"")}}function $Z(t,e){if(t&1&&(u(0,"div"),W(1,"img",75),m()),t&2){let A=b().$implicit;f(),F("src",A.inline_data.data,An)}}function Aq(t,e){if(t&1){let A=aA();u(0,"button",76),x("click",function(){H(A);let o=b().index,g=b(2);return T(g.clickEvent(o))}),u(1,"mat-icon"),v(2,"bolt"),m(),v(3),m()}if(t&2){let A=b().$implicit;f(3),te(" ",A.functionCall.name," ")}}function eq(t,e){if(t&1){let A=aA();u(0,"button",76),x("click",function(){H(A);let o=b().index,g=b(2);return T(g.clickEvent(o))}),u(1,"mat-icon"),v(2,"check"),m(),v(3),m()}if(t&2){let A=b().$implicit;f(3),te(" ",A.functionResponse.name," ")}}function tq(t,e){t&1&&(u(0,"button",34)(1,"mat-icon"),v(2,"person"),m()())}function iq(t,e){if(t&1&&(u(0,"div",59),_(1,PZ,3,0,"button",60),u(2,"mat-card",61),_(3,WZ,2,1,"div",62)(4,zZ,1,1,"markdown",63)(5,jZ,2,1,"code",64)(6,XZ,5,2,"div",64)(7,$Z,2,1,"div",64)(8,Aq,4,1,"button",65)(9,eq,4,1,"button",65),m(),_(10,tq,3,0,"button",66),m()),t&2){let A=e.$implicit;F("ngClass",us(10,fZ,A.role==="user",A.role==="bot")),f(),F("ngIf",A.role==="bot"),f(2),F("ngIf",A.attachments),f(),F("ngIf",A.text),f(),F("ngIf",A.executableCode),f(),F("ngIf",A.codeExecutionResult),f(),F("ngIf",A.inline_data&&A.role==="bot"),f(),F("ngIf",A.functionCall),f(),F("ngIf",A.functionResponse),f(),F("ngIf",A.role==="user")}}function oq(t,e){if(t&1&&(u(0,"div",57,1),W(2,"div",null,2),_(4,iq,11,13,"div",58),m()),t&2){let A=b();f(4),F("ngForOf",A.messages)}}function gq(t,e){if(t&1){let A=aA();u(0,"div",90),W(1,"img",91),u(2,"button",92),x("click",function(){H(A);let o=b().index,g=b(3);return T(g.removeFile(o))}),u(3,"mat-icon",93),v(4,"close"),m()()()}if(t&2){let A=b().$implicit;f(),F("src",A.url,An)}}function nq(t,e){if(t&1){let A=aA();u(0,"div",94)(1,"button",92),x("click",function(){H(A);let o=b().index,g=b(3);return T(g.removeFile(o))}),u(2,"mat-icon",93),v(3,"close"),m()(),u(4,"div",95)(5,"mat-icon"),v(6,"insert_drive_file"),m(),u(7,"span"),v(8),m()()()}if(t&2){let A=b().$implicit;f(8),PA(A.file.name)}}function sq(t,e){if(t&1&&(u(0,"div"),_(1,gq,5,1,"div",88)(2,nq,9,1,"div",89),m()),t&2){let A=e.$implicit;f(),F("ngIf",A.file.type.startsWith("image/")),f(),F("ngIf",!A.file.type.startsWith("image/"))}}function rq(t,e){if(t&1&&(u(0,"div",86),_(1,sq,3,2,"div",87),m()),t&2){let A=b(2);f(),F("ngForOf",A.selectedFiles)}}function Iq(t,e){if(t&1){let A=aA();u(0,"div",77)(1,"input",78,3),x("change",function(o){H(A);let g=b();return T(g.onFileSelect(o))}),m(),u(3,"mat-form-field",79),_(4,rq,2,1,"div",80),u(5,"input",81),fi("ngModelChange",function(o){H(A);let g=b();return $i(g.userInput,o)||(g.userInput=o),T(o)}),x("keydown.enter",function(o){H(A);let g=b();return T(g.sendMessage(o))}),m(),u(6,"div",82)(7,"button",83),x("click",function(){H(A);let o=He(2);return T(o.click())}),u(8,"mat-icon"),v(9,"attach_file"),m()(),u(10,"div")(11,"button",84),x("click",function(){H(A);let o=b();return T(o.toggleAudioRecording())}),W(12,"mat-icon",85),m(),u(13,"button",84),x("click",function(){H(A);let o=b();return T(o.toggleVideoRecording())}),W(14,"mat-icon",85),m()()()()()}if(t&2){let A=b();f(4),F("ngIf",A.selectedFiles.length&&A.appName!=""),f(),mi("ngModel",A.userInput),f(6),F("ngStyle",gn(6,wb,A.isAudioRecording?"rgb(234, 67, 53)":"rgb(51, 53, 55)")),f(),F("innerText",A.isAudioRecording?"stop":"mic"),f(),F("ngStyle",gn(8,wb,A.isVideoRecording?"rgb(234, 67, 53)":"rgb(51, 53, 55)")),f(),F("innerText",A.isVideoRecording?"stop":"videocam")}}function aq(t){for(t=t.replace(/-/g,"+").replace(/_/g,"/");t.length%4!==0;)t+="=";return t}var Em=class extends yn{nextPageLabel="Next Event";previousPageLabel="Previous Event";firstPageLabel="First Event";lastPageLabel="Last Event";getRangeLabel=(e,A,i)=>i===0?`Event 0 of ${i}`:(i=Math.max(i,0),`Event ${e*A+1} of ${i}`)},Sa=class t{constructor(e,A,i,o,g,n,s,r,I){this.sanitizer=e;this.sesisonService=A;this.artifactService=i;this.audioService=o;this.webSocketService=g;this.videoService=n;this.dialog=s;this.eventService=r;this.sessionService=I}videoContainer;sidenav;eventTabComponent;sessionTab;evalTab;scrollContainer;_snackBar=Q(Ok);enableSseIndicator=_t(!1);videoElement;currentMessage="";messages=[];lastTextChunk="";streamingTextMessage=null;artifacts=[];userInput="";userId="user";appName="";sessionId="";isAudioRecording=!1;isVideoRecording=!1;longRunningEvents=[];functionCallEventId="";redirectUri=ot.getBaseUrlWithoutPath();showSidePanel=!0;useSse=!1;currentSessionState={};eventData=new Map;eventMessageIndexArray=[];renderedEventGraph;selectedEvent=void 0;selectedEventIndex=void 0;llmRequest=void 0;llmResponse=void 0;llmRequestKey="gcp.vertex.agent.llm_request";llmResponseKey="gcp.vertex.agent.llm_response";selectedFiles=[];previousMessageCount=0;router=Q(ao);activatedRoute=Q(Io);selectedAppControl=new dQ("",{nonNullable:!0});agentService=Q(fg);isLoadingApps=_t(!1);loadingError=_t("");apps$=tA([]).pipe(Ie(()=>{this.isLoadingApps.set(!0),this.selectedAppControl.disable()}),re(()=>this.agentService.listApps().pipe(lt(e=>(this.loadingError.set(e.message),tA(void 0))))),de(1),Ie(()=>{this.isLoadingApps.set(!1),this.selectedAppControl.enable()}),Ro());ngOnInit(){if(this.syncSelectedAppFromUrl(),this.updateSelectedAppUrl(),new URL(window.location.href).searchParams.has("code")){let i=window.location.href;window.opener?.postMessage({authResponseUrl:i},window.origin),window.close()}this.agentService.getApp().subscribe(i=>{this.appName=i})}ngAfterViewInit(){this.showSidePanel=!0,this.sidenav.open()}ngAfterViewChecked(){this.messages.length!==this.previousMessageCount&&(this.scrollContainer.nativeElement.scrollTop=this.scrollContainer.nativeElement.scrollHeight,this.previousMessageCount=this.messages.length)}selectApp(e){e!=this.appName&&(this.agentService.setApp(e),this.createSession(),this.eventData=new Map,this.eventMessageIndexArray=[],this.messages=[],this.artifacts=[],this.userInput="",this.longRunningEvents=[])}createSession(){this.sesisonService.createSession(this.userId,this.appName).subscribe(e=>{this.currentSessionState=e.state,this.sessionId=e.id,this.sessionTab.refreshSession()})}sendMessage(e){return qe(this,null,function*(){if(e.preventDefault(),!this.userInput.trim())return;if(this.selectedFiles.length>0){let o=this.selectedFiles.map(g=>({file:g.file,url:g.url}));this.messages.push({role:"user",attachments:o})}this.messages.push({role:"user",text:this.userInput});let A={app_name:this.appName,user_id:this.userId,session_id:this.sessionId,new_message:{role:"user",parts:yield this.getUserMessageParts()},streaming:this.useSse};this.selectedFiles=[];let i=this.eventMessageIndexArray.length-1;this.streamingTextMessage=null,this.agentService.run_sse(A).subscribe({next:o=>qe(this,null,function*(){let g=JSON.parse(o);if(g.error){this.openSnackBar(g.error,"OK");return}if(g.content)for(let n of g.content.parts)i+=1,this.processPart(g,n,i)}),error:o=>console.error("SSE error:",o),complete:()=>{this.streamingTextMessage=null,this.sessionTab.reloadSession(this.sessionId)}}),this.userInput=""})}processPart(e,A,i){if(A.text){let o=A.text;if(this.streamingTextMessage){if(o==this.streamingTextMessage.text){this.storeEvents(A,e,i),this.eventMessageIndexArray[i]=o,this.streamingTextMessage=null;return}this.streamingTextMessage.text+=o}else if(this.streamingTextMessage={role:"bot",text:o},this.messages.push(this.streamingTextMessage),!this.useSse){this.storeEvents(A,e,i),this.eventMessageIndexArray[i]=o,this.streamingTextMessage=null;return}}else this.storeEvents(A,e,i),this.storeMessage(A,e,i)}getUserMessageParts(){return qe(this,null,function*(){let e=[{text:`${this.userInput}`}];if(this.selectedFiles.length>0)for(let A of this.selectedFiles)e.push({inline_data:{data:yield this.readFileAsBytes(A.file),mime_type:A.file.type}});return e})}readFileAsBytes(e){return new Promise((A,i)=>{let o=new FileReader;o.onload=g=>{let n=g.target.result.split(",")[1];A(n)},o.onerror=i,o.readAsDataURL(e)})}updateRedirectUri(e,A){try{let i=new URL(e);return i.searchParams.set("redirect_uri",A),i.toString()}catch(i){return console.warn("Failed to update redirect URI: ",i),e}}storeMessage(e,A,i){if(A.long_running_tool_ids&&A.long_running_tool_ids.length>0){this.getAsyncFunctionsFromParts(A.long_running_tool_ids,A.content.parts);let o=this.longRunningEvents[0];if(o.args.auth_config&&o.args.auth_config.exchanged_auth_credential&&o.args.auth_config.exchanged_auth_credential.oauth2){let g=o.args.auth_config.exchanged_auth_credential.oauth2.auth_uri,n=this.updateRedirectUri(g,this.redirectUri);this.openOAuthPopup(n).then(s=>{this.functionCallEventId=A.id,this.sendOAuthResponse(o,s,this.redirectUri)}).catch(s=>{console.error("OAuth Error:",s)})}else this.functionCallEventId=A.id}if(e.text)this.messages.push({role:A.author==="user"?"user":"bot",text:e.text}),this.eventMessageIndexArray[i]=e.text;else if(e.functionCall)this.messages.push({role:A.author==="user"?"user":"bot",functionCall:e.functionCall}),this.eventMessageIndexArray[i]=e.functionCall;else if(e.functionResponse){if(this.messages.push({role:A.author==="user"?"user":"bot",functionResponse:e.functionResponse}),A.actions&&A.actions.artifact_delta)for(let o in A.actions.artifact_delta)A.actions.artifact_delta.hasOwnProperty(o)&&this.renderArtifact(o,A.actions.artifact_delta[o]);this.eventMessageIndexArray[i]=e.functionResponse}else if(e.executableCode)this.messages.push({role:A.author==="user"?"user":"bot",executableCode:e.executableCode}),this.eventMessageIndexArray[i]=e.executableCode;else if(e.codeExecutionResult&&(this.messages.push({role:A.author==="user"?"user":"bot",codeExecutionResult:e.codeExecutionResult}),this.eventMessageIndexArray[i]=e.codeExecutionResult,A.actions&&A.actions.artifact_delta))for(let o in A.actions.artifact_delta)A.actions.artifact_delta.hasOwnProperty(o)&&this.renderArtifact(o,A.actions.artifact_delta[o])}renderArtifact(e,A){this.messages.push({role:"bot",inline_data:{data:"",mime_type:"image/png"}});let i=this.messages.length-1;this.artifactService.getArtifactVersion(this.userId,this.appName,this.sessionId,e,A).subscribe(o=>{let g=o.inlineData.mimeType,n=aq(o.inlineData.data),s=`data:${g};base64,${n}`;this.messages[i]={role:"bot",inline_data:{data:s,mime_type:g}},this.artifacts=[...this.artifacts,{id:e,data:s,mimeType:g,versionId:A}]})}storeEvents(e,A,i){let o=A.content.role+":";e.text?o+=i+e.text:e.functionCall?o+="functionCall:"+i+":"+e.functionCall.name:e.functionResponse?o+="functionResponse:"+i+":"+e.functionResponse.name:e.executableCode?o+="executableCode:"+i+":"+e.executableCode.code.slice(0,10):e.codeExecutionResult&&(o+="codeExecutionResult:"+i+":"+e.codeExecutionResult.outcome),this.eventData.set(o,A),this.eventData=new Map(this.eventData)}sendOAuthResponse(e,A,i){this.longRunningEvents.pop();let o={app_name:this.appName,user_id:this.userId,session_id:this.sessionId,new_message:{role:"user",parts:[]}};var g=e.args.auth_config;g.exchanged_auth_credential.oauth2.auth_response_uri=A,g.exchanged_auth_credential.oauth2.redirect_uri=i,o.function_call_event_id=this.functionCallEventId,o.new_message.parts.push({function_response:{id:e.id,name:e.name,response:g}}),this.agentService.run(o).subscribe(n=>{let s=this.eventMessageIndexArray.length-1;for(let r of n)if(r.content)for(let I of r.content.parts)s+=1,this.processPart(r,I,s)})}openDialog(){this.dialog.open(ma,{width:"600px",data:{event:this.longRunningEvents[0],app_name:this.appName,user_id:this.userId,session_id:this.sessionId,function_call_event_id:this.functionCallEventId}}).afterClosed().subscribe(A=>{A&&(this.longRunningEvents=A.events,this.messages.push({role:"bot",text:A.text}))})}clickEvent(e){let A=Array.from(this.eventData.entries())[e-this.userMessagesLength(e)],[i,o]=A;this.sidenav.open(),this.showSidePanel=!0,this.selectedEvent=o,this.selectedEventIndex=this.getIndexOfKeyInMap(i),this.eventService.getEventTrace(this.selectedEvent.id).subscribe(g=>{this.llmRequest=JSON.parse(g[this.llmRequestKey]),this.llmResponse=JSON.parse(g[this.llmResponseKey])}),this.eventService.getEvent(this.userId,this.appName,this.sessionId,this.selectedEvent.id).subscribe(g=>qe(this,null,function*(){if(!g.dot_src){this.renderedEventGraph=void 0;return}let n=g.dot_src,r=(yield pD()).renderString(n,{format:"svg",engine:"dot"});this.renderedEventGraph=this.sanitizer.bypassSecurityTrustHtml(r)}))}userMessagesLength(e){return this.messages.slice(0,e).filter(A=>A.role=="user").length}ngOnDestroy(){this.webSocketService.closeConnection()}toggleAudioRecording(){this.isAudioRecording?this.stopAudioRecording():this.startAudioRecording(),this.isAudioRecording=!this.isAudioRecording}startAudioRecording(){let e=window.location.protocol==="https:"?"wss":"ws";this.webSocketService.connect(`${e}://${ot.getWSServerUrl()}/run_live?app_name=${this.appName}&user_id=${this.userId}&session_id=${this.sessionId}`),this.audioService.startRecording(),this.messages.push({role:"user",text:"Speaking..."}),this.messages.push({role:"bot",text:"Speaking..."})}stopAudioRecording(){this.audioService.stopRecording(),this.webSocketService.closeConnection()}toggleVideoRecording(){this.isVideoRecording?this.stopVideoRecording():this.startVideoRecording(),this.isVideoRecording=!this.isVideoRecording}startVideoRecording(){let e=window.location.protocol==="https:"?"wss":"ws";this.webSocketService.connect(`${e}://${ot.getWSServerUrl()}/run_live?app_name=${this.appName}&user_id=${this.userId}&session_id=${this.sessionId}`),this.videoService.startRecording(this.videoContainer),this.audioService.startRecording(),this.messages.push({role:"user",text:"Speaking..."})}stopVideoRecording(){this.audioService.stopRecording(),this.videoService.stopRecording(this.videoContainer),this.webSocketService.closeConnection()}getAsyncFunctionsFromParts(e,A){for(let i of A)i.functionCall&&e.includes(i.functionCall.id)&&this.longRunningEvents.push(i.functionCall)}openOAuthPopup(e){return new Promise((A,i)=>{if(!window.open(e,"oauthPopup","width=600,height=700")){i("Popup blocked!");return}window.addEventListener("message",g=>{if(g.origin!==window.location.origin)return;let{authResponseUrl:n}=g.data;n?A(n):i("OAuth failed")},{once:!0})})}toggleSidePanel(){this.showSidePanel=!this.showSidePanel}updateWithSelectedSession(e){if(!e||!e.id||!e.events||!e.state){console.log("Session is not valid");return}this.sessionId=e.id,this.currentSessionState=e.state,this.eventData.clear(),this.eventMessageIndexArray=[],this.messages=[],this.artifacts=[];let A=0;e.events.forEach(i=>{i.content.parts.forEach(o=>{this.storeMessage(o,i,A),A+=1,i.author&&i.author!=="user"&&this.storeEvents(o,i,A)})})}updateSessionState(e){this.currentSessionState=e.state}onNewSessionClick(){this.createSession(),this.eventData.clear(),this.eventMessageIndexArray=[],this.messages=[],this.artifacts=[]}onFileSelect(e){let A=e.target;if(A.files)for(let i=0;i{this.llmRequest=JSON.parse(A[this.llmRequestKey]),this.llmResponse=JSON.parse(A[this.llmResponseKey])}),this.eventService.getEvent(this.userId,this.appName,this.sessionId,this.selectedEvent.id).subscribe(A=>qe(this,null,function*(){if(!A.dot_src){this.renderedEventGraph=void 0;return}let i=A.dot_src,g=(yield pD()).renderString(i,{format:"svg",engine:"dot"});this.renderedEventGraph=this.sanitizer.bypassSecurityTrustHtml(g)}))}deleteSession(e){let A={title:"Confirm delete",message:`Are you sure you want to delete this session ${this.sessionId}?`,confirmButtonText:"Delete",cancelButtonText:"Cancel"};this.dialog.open(fa,{width:"600px",data:A}).afterClosed().subscribe(o=>{o&&this.sessionService.deleteSession(this.userId,this.appName,e).subscribe(g=>{let n=this.sessionTab.refreshSession();n?this.sessionTab.getSession(n.id):window.location.reload()})})}syncSelectedAppFromUrl(){this.router.events.pipe(RA(e=>e instanceof Ot),oA(()=>this.activatedRoute.snapshot.queryParams)).subscribe(e=>{let A=e.app;A&&this.selectedAppControl.setValue(A)})}updateSelectedAppUrl(){this.selectedAppControl.valueChanges.pipe(Bi(),RA(Boolean)).subscribe(e=>{this.selectApp(e);let A=this.activatedRoute.snapshot.queryParams.app;e!==A&&this.router.navigate([],{queryParams:{app:e},queryParamsHandling:"merge"})})}handlePageEvent(e){if(e.pageIndex>=0){let A=this.getKeyAtIndexInMap(e.pageIndex);A&&this.selectEvent(A)}}closeSelectedEvent(){this.selectedEvent=void 0,this.selectedEventIndex=void 0}getIndexOfKeyInMap(e){let A=0,i=(g,n)=>0,o=Array.from(this.eventData.keys()).sort(i);for(let g of o){if(g===e)return A;A++}}getKeyAtIndexInMap(e){let A=(o,g)=>0,i=Array.from(this.eventData.keys()).sort(A);if(e>=0&&e0),f(),F("ngIf",i.appName!=""),f(),F("ngIf",i.appName!=""))},dependencies:[Yt,Rt,Jt,bh,io,oo,yi,YF,Ir,Eo,Mk,kg,bt,hE,gk,ok,fD,vF,OE,WD,zD,em,tm,$F,ir,hg,Db,zE,eu,kn,Fn,Rn,Fa,ba,EI],styles:[".drawer-container[_ngcontent-%COMP%]{height:100%;background-color:#131314}.generated-image[_ngcontent-%COMP%]{max-width:33%;border-radius:8px}.chat-container[_ngcontent-%COMP%]{width:100%;height:100%;max-width:1200px;margin:auto}.event-container[_ngcontent-%COMP%]{color:#fff}.drawer-header[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:flex-start;align-items:center}.drawer-header[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{width:36px;height:36px;color:#bdc1c6;cursor:pointer;display:flex;align-items:center;justify-content:center}.chat-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:500px;overflow:hidden;height:95%;box-shadow:none;background-color:#131314}.chat-messages[_ngcontent-%COMP%]{flex-grow:1;overflow-y:auto;padding:20px;margin-top:16px}.message-card[_ngcontent-%COMP%]{padding:5px 20px;margin:5px;border-radius:20px;max-width:80%;font-size:14px;font-weight:400}.user-message[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:center}.user-message[_ngcontent-%COMP%] .message-card[_ngcontent-%COMP%]{background-color:#004a77;align-self:flex-end;color:#fff;box-shadow:none}.bot-message[_ngcontent-%COMP%]{display:flex;align-items:center}.bot-message[_ngcontent-%COMP%] .message-card[_ngcontent-%COMP%]{background-color:#303030;align-self:flex-start;color:#fff;box-shadow:none}.navigation-button-sidepanel[_ngcontent-%COMP%]{margin-left:auto;margin-right:20px}.chat-input[_ngcontent-%COMP%]{display:flex;padding:10px;width:80%;margin:0 auto}.input-field[_ngcontent-%COMP%]{flex-grow:1}.input-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{color:#fff;border:none;padding:10px}.input-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%]::placeholder{color:#8e918f}.input-field[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:#fff;background-color:#333537}.chat-input-actions[_ngcontent-%COMP%]{margin-top:10px;display:flex;justify-content:space-between}.fab-button[_ngcontent-%COMP%]{position:fixed;bottom:200px;right:100px;z-index:1000}.sidepanel-toggle[_ngcontent-%COMP%]{position:relative;top:100px;z-index:1000}.sidenav[_ngcontent-%COMP%]{background-color:#1b1b1b;color:#fff;border-radius:0}.tabs-container[_ngcontent-%COMP%]{margin-top:20px;padding-left:10px;padding-right:10px}.tab-label[_ngcontent-%COMP%]{font-size:14px}.file-preview[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:5px;margin-top:2px;margin-bottom:8px}.file-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:5px;background:#eee;padding:5px;border-radius:4px}.image-preview[_ngcontent-%COMP%]{width:40px;height:40px;object-fit:cover;border-radius:4px}.image-preview-chat[_ngcontent-%COMP%]{max-width:90%;max-height:70vh;width:auto;height:auto;border-radius:8px;cursor:pointer;transition:transform .2s ease-in-out}button[_ngcontent-%COMP%]{margin-left:20px;margin-right:20px}.app-select[_ngcontent-%COMP%]{width:180px}.empty-state-container[_ngcontent-%COMP%]{color:#eee;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Open Sans,sans-serif;font-weight:400;letter-spacing:normal;line-height:24px;font-size:18px}.empty-state-container[_ngcontent-%COMP%] pre.warning[_ngcontent-%COMP%]{color:#ffc185}.empty-state-container[_ngcontent-%COMP%] pre.error[_ngcontent-%COMP%]{color:#ff4545}.function-event-button[_ngcontent-%COMP%]{background-color:#fff}[_nghost-%COMP%] .mat-mdc-text-field-wrapper{border:1px solid #8e918f}[_nghost-%COMP%] .input-field .mat-mdc-text-field-wrapper{border:1px solid #8e918f;border-radius:16px}[_nghost-%COMP%] .mdc-notched-outline__leading, [_nghost-%COMP%] .mdc-notched-outline__notch, [_nghost-%COMP%] .mdc-notched-outline__trailing{border:none}[_nghost-%COMP%] .mat-mdc-form-field-icon-suffix{padding:0 10px 0 40px}[_nghost-%COMP%] .segment-key{color:#d3d3d3!important}[_nghost-%COMP%] .mat-mdc-mini-fab{background-color:#fff}[_nghost-%COMP%] .mat-mdc-mini-fab mat-icon{color:#000}[_nghost-%COMP%] .mat-drawer-inner-container{width:500px}.mat-mdc-select-placeholder[_ngcontent-%COMP%]{margin-left:20px}.new-session-button[_ngcontent-%COMP%]{margin-top:0;margin-left:50px;width:130px;height:28px;font-size:14px}.app-select-container[_ngcontent-%COMP%]{background-color:#212123;margin-left:20px;height:30px;display:flex;justify-content:space-between;padding-left:20px;padding-right:20px;border-radius:10px;padding-top:5px;margin-top:-2px}.drawer-header[_ngcontent-%COMP%]{--mat-select-placeholder-text-color: #8ab4f8}.drawer-header[_ngcontent-%COMP%]{--mat-select-enabled-trigger-text-color: #8ab4f8}.drawer-header[_ngcontent-%COMP%]{--mat-select-enabled-arrow-color: #8ab4f8}.event-paginator[_ngcontent-%COMP%]{background-color:inherit;display:flex;justify-content:center}[_nghost-%COMP%] .mat-mdc-paginator-page-size{display:none!important}.details-panel-container[_ngcontent-%COMP%]{position:absolute;height:98%;left:0;right:0;bottom:0;background:#242424;display:inline-block;justify-content:center;align-items:center;z-index:10}.details-content[_ngcontent-%COMP%]{color:#fff;font-size:14px}.event-paginator[_ngcontent-%COMP%]{margin-top:-8px;margin-right:160px}.adk-checkbox[_ngcontent-%COMP%]{position:fixed;bottom:0;left:0;right:0;margin-bottom:20px;margin-left:20px}.drawer-header[_ngcontent-%COMP%]{--mdc-filled-button-container-color: #89b4f8}.drawer-header[_ngcontent-%COMP%]{--mdc-filled-button-label-text-color: black}.chat-toolbar[_ngcontent-%COMP%]{position:sticky;top:0;height:48px;background:#1b1b1b;display:flex;justify-content:space-between;align-items:center;z-index:10}.toolbar-session-text[_ngcontent-%COMP%]{color:#fdfdfd;font-family:Roboto;font-size:12px;font-style:normal;font-weight:500;line-height:12px;letter-spacing:.8px;text-transform:uppercase;margin-left:20px;padding-top:4px}.toolbar-session-id[_ngcontent-%COMP%]{color:#9aa0a6;font-family:monospace;font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:.25px;margin-left:5px}.toolbar-actions[_ngcontent-%COMP%]{display:flex}.toolbar-new-sesison[_ngcontent-%COMP%]{font-size:14px;margin-right:16px;color:#9aa0a6;cursor:pointer;display:flex;align-items:center}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mat-switch-label-text-size: 14px}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mat-switch-label-text-color: #9aa0a6}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-selected-track-color: #8ab4f9}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-selected-focus-track-color: #8ab4f9}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-selected-hover-track-color: #8ab4f9}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-selected-handle-color: #1b73e8}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-selected-focus-handle-color: #1b73e8}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-selected-hover-handle-color: #1b73e8}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-track-height: 24px}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mdc-switch-track-width: 46px}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mat-switch-track-outline-color: #1b73e8}.toolbar-sse-toggle[_ngcontent-%COMP%]{--mat-switch-with-icon-handle-size: 20px}.image-container[_ngcontent-%COMP%]{position:relative;display:inline-block;border-radius:12px;overflow:hidden}.image-preview[_ngcontent-%COMP%]{display:block;width:100%;height:auto;border-radius:12px;width:80px;height:80px}.delete-button[_ngcontent-%COMP%]{position:absolute;top:1px;right:1px;background-color:#000000b3;border:none;border-radius:50%;padding:8px;cursor:pointer;color:#fff;display:flex;align-items:center;justify-content:center;margin-right:0;scale:.7}.delete-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px}.file-container[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;gap:8px;height:80px;background-color:#1e1e1e;border-radius:12px}.file-info[_ngcontent-%COMP%]{margin-right:60px;padding-top:20px;padding-left:16px}"]})};var lr=class t{title="agent_framework_web";userId="";appName="";sessionId="";constructor(){}static \u0275fac=function(A){return new(A||t)};static \u0275cmp=O({type:t,selectors:[["app-root"]],standalone:!1,decls:1,vars:0,template:function(A,i){A&1&&W(0,"app-chat")},dependencies:[Sa],encapsulation:2})};var Bq=[{path:"dev-ui",component:lr},{path:"",redirectTo:"dev-ui",pathMatch:"full"}],jE=class t{static \u0275fac=function(A){return new(A||t)};static \u0275mod=V({type:t});static \u0275inj=q({imports:[VQ.forRoot(Bq),VQ]})};function pb(t){return new U(3e3,!1)}function Qq(){return new U(3100,!1)}function Eq(){return new U(3101,!1)}function cq(t){return new U(3001,!1)}function lq(t){return new U(3003,!1)}function dq(t){return new U(3004,!1)}function Mb(t,e){return new U(3005,!1)}function Rb(){return new U(3006,!1)}function kb(){return new U(3007,!1)}function Fb(t,e){return new U(3008,!1)}function bb(t){return new U(3002,!1)}function Sb(t,e,A,i,o){return new U(3010,!1)}function Nb(){return new U(3011,!1)}function Gb(){return new U(3012,!1)}function vb(){return new U(3200,!1)}function Lb(){return new U(3202,!1)}function Kb(){return new U(3013,!1)}function Ub(t){return new U(3014,!1)}function _b(t){return new U(3015,!1)}function xb(t){return new U(3016,!1)}function Yb(t,e){return new U(3404,!1)}function hq(t){return new U(3502,!1)}function Jb(t){return new U(3503,!1)}function Hb(){return new U(3300,!1)}function Tb(t){return new U(3504,!1)}function Ob(t){return new U(3301,!1)}function Pb(t,e){return new U(3302,!1)}function Zb(t){return new U(3303,!1)}function qb(t,e){return new U(3400,!1)}function Vb(t){return new U(3401,!1)}function Wb(t){return new U(3402,!1)}function zb(t,e){return new U(3505,!1)}function Zo(t){switch(t.length){case 0:return new Bo;case 1:return t[0];default:return new pn(t)}}function hm(t,e,A=new Map,i=new Map){let o=[],g=[],n=-1,s=null;if(e.forEach(r=>{let I=r.get("offset"),B=I==n,c=B&&s||new Map;r.forEach((D,h)=>{let p=h,y=D;if(h!=="offset")switch(p=t.normalizePropertyName(p,o),y){case tr:y=A.get(h);break;case ii:y=i.get(h);break;default:y=t.normalizeStyleValue(h,p,y,o);break}c.set(p,y)}),B||g.push(c),s=c,n=I}),o.length)throw hq(o);return g}function XE(t,e,A,i){switch(e){case"start":t.onStart(()=>i(A&&cm(A,"start",t)));break;case"done":t.onDone(()=>i(A&&cm(A,"done",t)));break;case"destroy":t.onDestroy(()=>i(A&&cm(A,"destroy",t)));break}}function cm(t,e,A){let i=A.totalTime,o=!!A.disabled,g=$E(t.element,t.triggerName,t.fromState,t.toState,e||t.phaseName,i??t.totalTime,o),n=t._data;return n!=null&&(g._data=n),g}function $E(t,e,A,i,o="",g=0,n){return{element:t,triggerName:e,fromState:A,toState:i,phaseName:o,totalTime:g,disabled:!!n}}function Nt(t,e,A){let i=t.get(e);return i||t.set(e,i=A),i}function um(t){let e=t.indexOf(":"),A=t.substring(1,e),i=t.slice(e+1);return[A,i]}var uq=typeof document>"u"?null:document.documentElement;function Ac(t){let e=t.parentNode||t.host||null;return e===uq?null:e}function Dq(t){return t.substring(1,6)=="ebkit"}var Nn=null,yb=!1;function jb(t){Nn||(Nn=mq()||{},yb=Nn.style?"WebkitAppearance"in Nn.style:!1);let e=!0;return Nn.style&&!Dq(t)&&(e=t in Nn.style,!e&&yb&&(e="Webkit"+t.charAt(0).toUpperCase()+t.slice(1)in Nn.style)),e}function mq(){return typeof document<"u"?document.body:null}function Dm(t,e){for(;e;){if(e===t)return!0;e=Ac(e)}return!1}function mm(t,e,A){if(A)return Array.from(t.querySelectorAll(e));let i=t.querySelector(e);return i?[i]:[]}var fq=1e3,fm="{{",wq="}}",wm="ng-enter",ec="ng-leave",Na="ng-trigger",Ga=".ng-trigger",pm="ng-animating",tc=".ng-animating";function mo(t){if(typeof t=="number")return t;let e=t.match(/^(-?[\.\d]+)(m?s)/);return!e||e.length<2?0:lm(parseFloat(e[1]),e[2])}function lm(t,e){switch(e){case"s":return t*fq;default:return t}}function va(t,e,A){return t.hasOwnProperty("duration")?t:pq(t,e,A)}function pq(t,e,A){let i=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i,o,g=0,n="";if(typeof t=="string"){let s=t.match(i);if(s===null)return e.push(pb(t)),{duration:0,delay:0,easing:""};o=lm(parseFloat(s[1]),s[2]);let r=s[3];r!=null&&(g=lm(parseFloat(r),s[4]));let I=s[5];I&&(n=I)}else o=t;if(!A){let s=!1,r=e.length;o<0&&(e.push(Qq()),s=!0),g<0&&(e.push(Eq()),s=!0),s&&e.splice(r,0,pb(t))}return{duration:o,delay:g,easing:n}}function Xb(t){return t.length?t[0]instanceof Map?t:t.map(e=>new Map(Object.entries(e))):[]}function vi(t,e,A){e.forEach((i,o)=>{let g=ic(o);A&&!A.has(o)&&A.set(o,t.style[g]),t.style[g]=i})}function bg(t,e){e.forEach((A,i)=>{let o=ic(i);t.style[o]=""})}function dr(t){return Array.isArray(t)?t.length==1?t[0]:dk(t):t}function $b(t,e,A){let i=e.params||{},o=ym(t);o.length&&o.forEach(g=>{i.hasOwnProperty(g)||A.push(cq(g))})}var dm=new RegExp(`${fm}\\s*(.+?)\\s*${wq}`,"g");function ym(t){let e=[];if(typeof t=="string"){let A;for(;A=dm.exec(t);)e.push(A[1]);dm.lastIndex=0}return e}function hr(t,e,A){let i=`${t}`,o=i.replace(dm,(g,n)=>{let s=e[n];return s==null&&(A.push(lq(n)),s=""),s.toString()});return o==i?t:o}var yq=/-+([a-z0-9])/g;function ic(t){return t.replace(yq,(...e)=>e[1].toUpperCase())}function AS(t,e){return t===0||e===0}function eS(t,e,A){if(A.size&&e.length){let i=e[0],o=[];if(A.forEach((g,n)=>{i.has(n)||o.push(n),i.set(n,g)}),o.length)for(let g=1;gn.set(s,oc(t,s)))}}return e}function Gt(t,e,A){switch(e.type){case LA.Trigger:return t.visitTrigger(e,A);case LA.State:return t.visitState(e,A);case LA.Transition:return t.visitTransition(e,A);case LA.Sequence:return t.visitSequence(e,A);case LA.Group:return t.visitGroup(e,A);case LA.Animate:return t.visitAnimate(e,A);case LA.Keyframes:return t.visitKeyframes(e,A);case LA.Style:return t.visitStyle(e,A);case LA.Reference:return t.visitReference(e,A);case LA.AnimateChild:return t.visitAnimateChild(e,A);case LA.AnimateRef:return t.visitAnimateRef(e,A);case LA.Query:return t.visitQuery(e,A);case LA.Stagger:return t.visitStagger(e,A);default:throw dq(e.type)}}function oc(t,e){return window.getComputedStyle(t)[e]}var Hm=(()=>{class t{validateStyleProperty(A){return jb(A)}containsElement(A,i){return Dm(A,i)}getParentElement(A){return Ac(A)}query(A,i,o){return mm(A,i,o)}computeStyle(A,i,o){return o||""}animate(A,i,o,g,n,s=[],r){return new Bo(o,g)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=N({token:t,factory:t.\u0275fac})}return t})(),vn=class{static NOOP=new Hm},Ln=class{};var Mq=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"]),Ic=class extends Ln{normalizePropertyName(e,A){return ic(e)}normalizeStyleValue(e,A,i,o){let g="",n=i.toString().trim();if(Mq.has(A)&&i!==0&&i!=="0")if(typeof i=="number")g="px";else{let s=i.match(/^[+-]?[\d\.]+([a-z]*)$/);s&&s[1].length==0&&o.push(Mb(e,i))}return n+g}};var ac="*";function Rq(t,e){let A=[];return typeof t=="string"?t.split(/\s*,\s*/).forEach(i=>kq(i,A,e)):A.push(t),A}function kq(t,e,A){if(t[0]==":"){let r=Fq(t,A);if(typeof r=="function"){e.push(r);return}t=r}let i=t.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(i==null||i.length<4)return A.push(_b(t)),e;let o=i[1],g=i[2],n=i[3];e.push(tS(o,n));let s=o==ac&&n==ac;g[0]=="<"&&!s&&e.push(tS(n,o))}function Fq(t,e){switch(t){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(A,i)=>parseFloat(i)>parseFloat(A);case":decrement":return(A,i)=>parseFloat(i) *"}}var gc=new Set(["true","1"]),nc=new Set(["false","0"]);function tS(t,e){let A=gc.has(t)||nc.has(t),i=gc.has(e)||nc.has(e);return(o,g)=>{let n=t==ac||t==o,s=e==ac||e==g;return!n&&A&&typeof o=="boolean"&&(n=o?gc.has(t):nc.has(t)),!s&&i&&typeof g=="boolean"&&(s=g?gc.has(e):nc.has(e)),n&&s}}var BS=":self",bq=new RegExp(`s*${BS}s*,?`,"g");function QS(t,e,A,i){return new Sm(t).build(e,A,i)}var iS="",Sm=class{_driver;constructor(e){this._driver=e}build(e,A,i){let o=new Nm(A);return this._resetContextStyleTimingState(o),Gt(this,dr(e),o)}_resetContextStyleTimingState(e){e.currentQuerySelector=iS,e.collectedStyles=new Map,e.collectedStyles.set(iS,new Map),e.currentTime=0}visitTrigger(e,A){let i=A.queryCount=0,o=A.depCount=0,g=[],n=[];return e.name.charAt(0)=="@"&&A.errors.push(Rb()),e.definitions.forEach(s=>{if(this._resetContextStyleTimingState(A),s.type==LA.State){let r=s,I=r.name;I.toString().split(/\s*,\s*/).forEach(B=>{r.name=B,g.push(this.visitState(r,A))}),r.name=I}else if(s.type==LA.Transition){let r=this.visitTransition(s,A);i+=r.queryCount,o+=r.depCount,n.push(r)}else A.errors.push(kb())}),{type:LA.Trigger,name:e.name,states:g,transitions:n,queryCount:i,depCount:o,options:null}}visitState(e,A){let i=this.visitStyle(e.styles,A),o=e.options&&e.options.params||null;if(i.containsDynamicStyles){let g=new Set,n=o||{};i.styles.forEach(s=>{s instanceof Map&&s.forEach(r=>{ym(r).forEach(I=>{n.hasOwnProperty(I)||g.add(I)})})}),g.size&&A.errors.push(Fb(e.name,[...g.values()]))}return{type:LA.State,name:e.name,style:i,options:o?{params:o}:null}}visitTransition(e,A){A.queryCount=0,A.depCount=0;let i=Gt(this,dr(e.animation),A),o=Rq(e.expr,A.errors);return{type:LA.Transition,matchers:o,animation:i,queryCount:A.queryCount,depCount:A.depCount,options:Gn(e.options)}}visitSequence(e,A){return{type:LA.Sequence,steps:e.steps.map(i=>Gt(this,i,A)),options:Gn(e.options)}}visitGroup(e,A){let i=A.currentTime,o=0,g=e.steps.map(n=>{A.currentTime=i;let s=Gt(this,n,A);return o=Math.max(o,A.currentTime),s});return A.currentTime=o,{type:LA.Group,steps:g,options:Gn(e.options)}}visitAnimate(e,A){let i=vq(e.timings,A.errors);A.currentAnimateTimings=i;let o,g=e.styles?e.styles:Ge({});if(g.type==LA.Keyframes)o=this.visitKeyframes(g,A);else{let n=e.styles,s=!1;if(!n){s=!0;let I={};i.easing&&(I.easing=i.easing),n=Ge(I)}A.currentTime+=i.duration+i.delay;let r=this.visitStyle(n,A);r.isEmptyStep=s,o=r}return A.currentAnimateTimings=null,{type:LA.Animate,timings:i,style:o,options:null}}visitStyle(e,A){let i=this._makeStyleAst(e,A);return this._validateStyleAst(i,A),i}_makeStyleAst(e,A){let i=[],o=Array.isArray(e.styles)?e.styles:[e.styles];for(let s of o)typeof s=="string"?s===ii?i.push(s):A.errors.push(bb(s)):i.push(new Map(Object.entries(s)));let g=!1,n=null;return i.forEach(s=>{if(s instanceof Map&&(s.has("easing")&&(n=s.get("easing"),s.delete("easing")),!g)){for(let r of s.values())if(r.toString().indexOf(fm)>=0){g=!0;break}}}),{type:LA.Style,styles:i,easing:n,offset:e.offset,containsDynamicStyles:g,options:null}}_validateStyleAst(e,A){let i=A.currentAnimateTimings,o=A.currentTime,g=A.currentTime;i&&g>0&&(g-=i.duration+i.delay),e.styles.forEach(n=>{typeof n!="string"&&n.forEach((s,r)=>{let I=A.collectedStyles.get(A.currentQuerySelector),B=I.get(r),c=!0;B&&(g!=o&&g>=B.startTime&&o<=B.endTime&&(A.errors.push(Sb(r,B.startTime,B.endTime,g,o)),c=!1),g=B.startTime),c&&I.set(r,{startTime:g,endTime:o}),A.options&&$b(s,A.options,A.errors)})})}visitKeyframes(e,A){let i={type:LA.Keyframes,styles:[],options:null};if(!A.currentAnimateTimings)return A.errors.push(Nb()),i;let o=1,g=0,n=[],s=!1,r=!1,I=0,B=e.steps.map(P=>{let mA=this._makeStyleAst(P,A),_A=mA.offset!=null?mA.offset:Gq(mA.styles),fA=0;return _A!=null&&(g++,fA=mA.offset=_A),r=r||fA<0||fA>1,s=s||fA0&&g{let _A=D>0?mA==h?1:D*mA:n[mA],fA=_A*L;A.currentTime=p+y.delay+fA,y.duration=fA,this._validateStyleAst(P,A),P.offset=_A,i.styles.push(P)}),i}visitReference(e,A){return{type:LA.Reference,animation:Gt(this,dr(e.animation),A),options:Gn(e.options)}}visitAnimateChild(e,A){return A.depCount++,{type:LA.AnimateChild,options:Gn(e.options)}}visitAnimateRef(e,A){return{type:LA.AnimateRef,animation:this.visitReference(e.animation,A),options:Gn(e.options)}}visitQuery(e,A){let i=A.currentQuerySelector,o=e.options||{};A.queryCount++,A.currentQuery=e;let[g,n]=Sq(e.selector);A.currentQuerySelector=i.length?i+" "+g:g,Nt(A.collectedStyles,A.currentQuerySelector,new Map);let s=Gt(this,dr(e.animation),A);return A.currentQuery=null,A.currentQuerySelector=i,{type:LA.Query,selector:g,limit:o.limit||0,optional:!!o.optional,includeSelf:n,animation:s,originalSelector:e.selector,options:Gn(e.options)}}visitStagger(e,A){A.currentQuery||A.errors.push(Kb());let i=e.timings==="full"?{duration:0,delay:0,easing:"full"}:va(e.timings,A.errors,!0);return{type:LA.Stagger,animation:Gt(this,dr(e.animation),A),timings:i,options:null}}};function Sq(t){let e=!!t.split(/\s*,\s*/).find(A=>A==BS);return e&&(t=t.replace(bq,"")),t=t.replace(/@\*/g,Ga).replace(/@\w+/g,A=>Ga+"-"+A.slice(1)).replace(/:animating/g,tc),[t,e]}function Nq(t){return t?R({},t):null}var Nm=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 Gq(t){if(typeof t=="string")return null;let e=null;if(Array.isArray(t))t.forEach(A=>{if(A instanceof Map&&A.has("offset")){let i=A;e=parseFloat(i.get("offset")),i.delete("offset")}});else if(t instanceof Map&&t.has("offset")){let A=t;e=parseFloat(A.get("offset")),A.delete("offset")}return e}function vq(t,e){if(t.hasOwnProperty("duration"))return t;if(typeof t=="number"){let g=va(t,e).duration;return Mm(g,0,"")}let A=t;if(A.split(/\s+/).some(g=>g.charAt(0)=="{"&&g.charAt(1)=="{")){let g=Mm(0,0,"");return g.dynamic=!0,g.strValue=A,g}let o=va(A,e);return Mm(o.duration,o.delay,o.easing)}function Gn(t){return t?(t=R({},t),t.params&&(t.params=Nq(t.params))):t={},t}function Mm(t,e,A){return{duration:t,delay:e,easing:A}}function Tm(t,e,A,i,o,g,n=null,s=!1){return{type:1,element:t,keyframes:e,preStyleProps:A,postStyleProps:i,duration:o,delay:g,totalTime:o+g,easing:n,subTimeline:s}}var Ka=class{_map=new Map;get(e){return this._map.get(e)||[]}append(e,A){let i=this._map.get(e);i||this._map.set(e,i=[]),i.push(...A)}has(e){return this._map.has(e)}clear(){this._map.clear()}},Lq=1,Kq=":enter",Uq=new RegExp(Kq,"g"),_q=":leave",xq=new RegExp(_q,"g");function ES(t,e,A,i,o,g=new Map,n=new Map,s,r,I=[]){return new Gm().buildKeyframes(t,e,A,i,o,g,n,s,r,I)}var Gm=class{buildKeyframes(e,A,i,o,g,n,s,r,I,B=[]){I=I||new Ka;let c=new vm(e,A,I,o,g,B,[]);c.options=r;let D=r.delay?mo(r.delay):0;c.currentTimeline.delayNextStep(D),c.currentTimeline.setStyles([n],null,c.errors,r),Gt(this,i,c);let h=c.timelines.filter(p=>p.containsAnimation());if(h.length&&s.size){let p;for(let y=h.length-1;y>=0;y--){let L=h[y];if(L.element===A){p=L;break}}p&&!p.allowOnlyTimelineStyles()&&p.setStyles([s],null,c.errors,r)}return h.length?h.map(p=>p.buildKeyframes()):[Tm(A,[],[],[],0,D,"",!1)]}visitTrigger(e,A){}visitState(e,A){}visitTransition(e,A){}visitAnimateChild(e,A){let i=A.subInstructions.get(A.element);if(i){let o=A.createSubContext(e.options),g=A.currentTimeline.currentTime,n=this._visitSubInstructions(i,o,o.options);g!=n&&A.transformIntoNewTimeline(n)}A.previousNode=e}visitAnimateRef(e,A){let i=A.createSubContext(e.options);i.transformIntoNewTimeline(),this._applyAnimationRefDelays([e.options,e.animation.options],A,i),this.visitReference(e.animation,i),A.transformIntoNewTimeline(i.currentTimeline.currentTime),A.previousNode=e}_applyAnimationRefDelays(e,A,i){for(let o of e){let g=o?.delay;if(g){let n=typeof g=="number"?g:mo(hr(g,o?.params??{},A.errors));i.delayNextStep(n)}}}_visitSubInstructions(e,A,i){let g=A.currentTimeline.currentTime,n=i.duration!=null?mo(i.duration):null,s=i.delay!=null?mo(i.delay):null;return n!==0&&e.forEach(r=>{let I=A.appendInstructionToTimeline(r,n,s);g=Math.max(g,I.duration+I.delay)}),g}visitReference(e,A){A.updateOptions(e.options,!0),Gt(this,e.animation,A),A.previousNode=e}visitSequence(e,A){let i=A.subContextCount,o=A,g=e.options;if(g&&(g.params||g.delay)&&(o=A.createSubContext(g),o.transformIntoNewTimeline(),g.delay!=null)){o.previousNode.type==LA.Style&&(o.currentTimeline.snapshotCurrentStyles(),o.previousNode=Cc);let n=mo(g.delay);o.delayNextStep(n)}e.steps.length&&(e.steps.forEach(n=>Gt(this,n,o)),o.currentTimeline.applyStylesToKeyframe(),o.subContextCount>i&&o.transformIntoNewTimeline()),A.previousNode=e}visitGroup(e,A){let i=[],o=A.currentTimeline.currentTime,g=e.options&&e.options.delay?mo(e.options.delay):0;e.steps.forEach(n=>{let s=A.createSubContext(e.options);g&&s.delayNextStep(g),Gt(this,n,s),o=Math.max(o,s.currentTimeline.currentTime),i.push(s.currentTimeline)}),i.forEach(n=>A.currentTimeline.mergeTimelineCollectedStyles(n)),A.transformIntoNewTimeline(o),A.previousNode=e}_visitTiming(e,A){if(e.dynamic){let i=e.strValue,o=A.params?hr(i,A.params,A.errors):i;return va(o,A.errors)}else return{duration:e.duration,delay:e.delay,easing:e.easing}}visitAnimate(e,A){let i=A.currentAnimateTimings=this._visitTiming(e.timings,A),o=A.currentTimeline;i.delay&&(A.incrementTime(i.delay),o.snapshotCurrentStyles());let g=e.style;g.type==LA.Keyframes?this.visitKeyframes(g,A):(A.incrementTime(i.duration),this.visitStyle(g,A),o.applyStylesToKeyframe()),A.currentAnimateTimings=null,A.previousNode=e}visitStyle(e,A){let i=A.currentTimeline,o=A.currentAnimateTimings;!o&&i.hasCurrentStyleProperties()&&i.forwardFrame();let g=o&&o.easing||e.easing;e.isEmptyStep?i.applyEmptyStep(g):i.setStyles(e.styles,g,A.errors,A.options),A.previousNode=e}visitKeyframes(e,A){let i=A.currentAnimateTimings,o=A.currentTimeline.duration,g=i.duration,s=A.createSubContext().currentTimeline;s.easing=i.easing,e.styles.forEach(r=>{let I=r.offset||0;s.forwardTime(I*g),s.setStyles(r.styles,r.easing,A.errors,A.options),s.applyStylesToKeyframe()}),A.currentTimeline.mergeTimelineCollectedStyles(s),A.transformIntoNewTimeline(o+g),A.previousNode=e}visitQuery(e,A){let i=A.currentTimeline.currentTime,o=e.options||{},g=o.delay?mo(o.delay):0;g&&(A.previousNode.type===LA.Style||i==0&&A.currentTimeline.hasCurrentStyleProperties())&&(A.currentTimeline.snapshotCurrentStyles(),A.previousNode=Cc);let n=i,s=A.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!o.optional,A.errors);A.currentQueryTotal=s.length;let r=null;s.forEach((I,B)=>{A.currentQueryIndex=B;let c=A.createSubContext(e.options,I);g&&c.delayNextStep(g),I===A.element&&(r=c.currentTimeline),Gt(this,e.animation,c),c.currentTimeline.applyStylesToKeyframe();let D=c.currentTimeline.currentTime;n=Math.max(n,D)}),A.currentQueryIndex=0,A.currentQueryTotal=0,A.transformIntoNewTimeline(n),r&&(A.currentTimeline.mergeTimelineCollectedStyles(r),A.currentTimeline.snapshotCurrentStyles()),A.previousNode=e}visitStagger(e,A){let i=A.parentContext,o=A.currentTimeline,g=e.timings,n=Math.abs(g.duration),s=n*(A.currentQueryTotal-1),r=n*A.currentQueryIndex;switch(g.duration<0?"reverse":g.easing){case"reverse":r=s-r;break;case"full":r=i.currentStaggerTime;break}let B=A.currentTimeline;r&&B.delayNextStep(r);let c=B.currentTime;Gt(this,e.animation,A),A.previousNode=e,i.currentStaggerTime=o.currentTime-c+(o.startTime-i.currentTimeline.startTime)}},Cc={},vm=class t{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=Cc;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(e,A,i,o,g,n,s,r){this._driver=e,this.element=A,this.subInstructions=i,this._enterClassName=o,this._leaveClassName=g,this.errors=n,this.timelines=s,this.currentTimeline=r||new Bc(this._driver,A,0),s.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(e,A){if(!e)return;let i=e,o=this.options;i.duration!=null&&(o.duration=mo(i.duration)),i.delay!=null&&(o.delay=mo(i.delay));let g=i.params;if(g){let n=o.params;n||(n=this.options.params={}),Object.keys(g).forEach(s=>{(!A||!n.hasOwnProperty(s))&&(n[s]=hr(g[s],n,this.errors))})}}_copyOptions(){let e={};if(this.options){let A=this.options.params;if(A){let i=e.params={};Object.keys(A).forEach(o=>{i[o]=A[o]})}}return e}createSubContext(e=null,A,i){let o=A||this.element,g=new t(this._driver,o,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(o,i||0));return g.previousNode=this.previousNode,g.currentAnimateTimings=this.currentAnimateTimings,g.options=this._copyOptions(),g.updateOptions(e),g.currentQueryIndex=this.currentQueryIndex,g.currentQueryTotal=this.currentQueryTotal,g.parentContext=this,this.subContextCount++,g}transformIntoNewTimeline(e){return this.previousNode=Cc,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(e,A,i){let o={duration:A??e.duration,delay:this.currentTimeline.currentTime+(i??0)+e.delay,easing:""},g=new Lm(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,o,e.stretchStartingKeyframe);return this.timelines.push(g),o}incrementTime(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)}delayNextStep(e){e>0&&this.currentTimeline.delayNextStep(e)}invokeQuery(e,A,i,o,g,n){let s=[];if(o&&s.push(this.element),e.length>0){e=e.replace(Uq,"."+this._enterClassName),e=e.replace(xq,"."+this._leaveClassName);let r=i!=1,I=this._driver.query(this.element,e,r);i!==0&&(I=i<0?I.slice(I.length+i,I.length):I.slice(0,i)),s.push(...I)}return!g&&s.length==0&&n.push(Ub(A)),s}},Bc=class t{_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,A,i,o){this._driver=e,this.element=A,this.startTime=i,this._elementTimelineStylesLookup=o,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(A),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(A,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 A=this._keyframes.size===1&&this._pendingStyles.size;this.duration||A?(this.forwardTime(this.currentTime+e),A&&this.snapshotCurrentStyles()):this.startTime+=e}fork(e,A){return this.applyStylesToKeyframe(),new t(this._driver,e,A||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+=Lq,this._loadKeyframe()}forwardTime(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()}_updateStyle(e,A){this._localTimelineStyles.set(e,A),this._globalTimelineStyles.set(e,A),this._styleSummary.set(e,{time:this.currentTime,value:A})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(e){e&&this._previousKeyframe.set("easing",e);for(let[A,i]of this._globalTimelineStyles)this._backFill.set(A,i||ii),this._currentKeyframe.set(A,ii);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(e,A,i,o){A&&this._previousKeyframe.set("easing",A);let g=o&&o.params||{},n=Yq(e,this._globalTimelineStyles);for(let[s,r]of n){let I=hr(r,g,i);this._pendingStyles.set(s,I),this._localTimelineStyles.has(s)||this._backFill.set(s,this._globalTimelineStyles.get(s)??ii),this._updateStyle(s,I)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((e,A)=>{this._currentKeyframe.set(A,e)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((e,A)=>{this._currentKeyframe.has(A)||this._currentKeyframe.set(A,e)}))}snapshotCurrentStyles(){for(let[e,A]of this._localTimelineStyles)this._pendingStyles.set(e,A),this._updateStyle(e,A)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let e=[];for(let A in this._currentKeyframe)e.push(A);return e}mergeTimelineCollectedStyles(e){e._styleSummary.forEach((A,i)=>{let o=this._styleSummary.get(i);(!o||A.time>o.time)&&this._updateStyle(i,A.value)})}buildKeyframes(){this.applyStylesToKeyframe();let e=new Set,A=new Set,i=this._keyframes.size===1&&this.duration===0,o=[];this._keyframes.forEach((s,r)=>{let I=new Map([...this._backFill,...s]);I.forEach((B,c)=>{B===tr?e.add(c):B===ii&&A.add(c)}),i||I.set("offset",r/this.duration),o.push(I)});let g=[...e.values()],n=[...A.values()];if(i){let s=o[0],r=new Map(s);s.set("offset",0),r.set("offset",1),o=[s,r]}return Tm(this.element,o,g,n,this.duration,this.startTime,this.easing,!1)}},Lm=class extends Bc{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(e,A,i,o,g,n,s=!1){super(e,A,n.delay),this.keyframes=i,this.preStyleProps=o,this.postStyleProps=g,this._stretchStartingKeyframe=s,this.timings={duration:n.duration,delay:n.delay,easing:n.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let e=this.keyframes,{delay:A,duration:i,easing:o}=this.timings;if(this._stretchStartingKeyframe&&A){let g=[],n=i+A,s=A/n,r=new Map(e[0]);r.set("offset",0),g.push(r);let I=new Map(e[0]);I.set("offset",oS(s)),g.push(I);let B=e.length-1;for(let c=1;c<=B;c++){let D=new Map(e[c]),h=D.get("offset"),p=A+h*i;D.set("offset",oS(p/n)),g.push(D)}i=n,A=0,o="",e=g}return Tm(this.element,e,this.preStyleProps,this.postStyleProps,i,A,o,!0)}};function oS(t,e=3){let A=Math.pow(10,e-1);return Math.round(t*A)/A}function Yq(t,e){let A=new Map,i;return t.forEach(o=>{if(o==="*"){i??=e.keys();for(let g of i)A.set(g,ii)}else for(let[g,n]of o)A.set(g,n)}),A}function gS(t,e,A,i,o,g,n,s,r,I,B,c,D){return{type:0,element:t,triggerName:e,isRemovalTransition:o,fromState:A,fromStyles:g,toState:i,toStyles:n,timelines:s,queriedElements:r,preStyleProps:I,postStyleProps:B,totalTime:c,errors:D}}var Rm={},Qc=class{_triggerName;ast;_stateStyles;constructor(e,A,i){this._triggerName=e,this.ast=A,this._stateStyles=i}match(e,A,i,o){return Jq(this.ast.matchers,e,A,i,o)}buildStyles(e,A,i){let o=this._stateStyles.get("*");return e!==void 0&&(o=this._stateStyles.get(e?.toString())||o),o?o.buildStyles(A,i):new Map}build(e,A,i,o,g,n,s,r,I,B){let c=[],D=this.ast.options&&this.ast.options.params||Rm,h=s&&s.params||Rm,p=this.buildStyles(i,h,c),y=r&&r.params||Rm,L=this.buildStyles(o,y,c),P=new Set,mA=new Map,_A=new Map,fA=o==="void",Qt={params:cS(y,D),delay:this.ast.options?.delay},ue=B?[]:ES(e,A,this.ast.animation,g,n,p,L,Qt,I,c),pe=0;return ue.forEach(le=>{pe=Math.max(le.duration+le.delay,pe)}),c.length?gS(A,this._triggerName,i,o,fA,p,L,[],[],mA,_A,pe,c):(ue.forEach(le=>{let ni=le.element,fo=Nt(mA,ni,new Set);le.preStyleProps.forEach(Ui=>fo.add(Ui));let Ki=Nt(_A,ni,new Set);le.postStyleProps.forEach(Ui=>Ki.add(Ui)),ni!==A&&P.add(ni)}),gS(A,this._triggerName,i,o,fA,p,L,ue,[...P.values()],mA,_A,pe))}};function Jq(t,e,A,i,o){return t.some(g=>g(e,A,i,o))}function cS(t,e){let A=R({},e);return Object.entries(t).forEach(([i,o])=>{o!=null&&(A[i]=o)}),A}var Km=class{styles;defaultParams;normalizer;constructor(e,A,i){this.styles=e,this.defaultParams=A,this.normalizer=i}buildStyles(e,A){let i=new Map,o=cS(e,this.defaultParams);return this.styles.styles.forEach(g=>{typeof g!="string"&&g.forEach((n,s)=>{n&&(n=hr(n,o,A));let r=this.normalizer.normalizePropertyName(s,A);n=this.normalizer.normalizeStyleValue(s,r,n,A),i.set(s,n)})}),i}};function Hq(t,e,A){return new Um(t,e,A)}var Um=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(e,A,i){this.name=e,this.ast=A,this._normalizer=i,A.states.forEach(o=>{let g=o.options&&o.options.params||{};this.states.set(o.name,new Km(o.style,g,i))}),nS(this.states,"true","1"),nS(this.states,"false","0"),A.transitions.forEach(o=>{this.transitionFactories.push(new Qc(e,o,this.states))}),this.fallbackTransition=Tq(e,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(e,A,i,o){return this.transitionFactories.find(n=>n.match(e,A,i,o))||null}matchStyles(e,A,i){return this.fallbackTransition.buildStyles(e,A,i)}};function Tq(t,e,A){let i=[(n,s)=>!0],o={type:LA.Sequence,steps:[],options:null},g={type:LA.Transition,animation:o,matchers:i,options:null,queryCount:0,depCount:0};return new Qc(t,g,e)}function nS(t,e,A){t.has(e)?t.has(A)||t.set(A,t.get(e)):t.has(A)&&t.set(e,t.get(A))}var Oq=new Ka,_m=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(e,A,i){this.bodyNode=e,this._driver=A,this._normalizer=i}register(e,A){let i=[],o=[],g=QS(this._driver,A,i,o);if(i.length)throw Jb(i);this._animations.set(e,g)}_buildPlayer(e,A,i){let o=e.element,g=hm(this._normalizer,e.keyframes,A,i);return this._driver.animate(o,g,e.duration,e.delay,e.easing,[],!0)}create(e,A,i={}){let o=[],g=this._animations.get(e),n,s=new Map;if(g?(n=ES(this._driver,A,g,wm,ec,new Map,new Map,i,Oq,o),n.forEach(B=>{let c=Nt(s,B.element,new Map);B.postStyleProps.forEach(D=>c.set(D,null))})):(o.push(Hb()),n=[]),o.length)throw Tb(o);s.forEach((B,c)=>{B.forEach((D,h)=>{B.set(h,this._driver.computeStyle(c,h,ii))})});let r=n.map(B=>{let c=s.get(B.element);return this._buildPlayer(B,new Map,c)}),I=Zo(r);return this._playersById.set(e,I),I.onDestroy(()=>this.destroy(e)),this.players.push(I),I}destroy(e){let A=this._getPlayer(e);A.destroy(),this._playersById.delete(e);let i=this.players.indexOf(A);i>=0&&this.players.splice(i,1)}_getPlayer(e){let A=this._playersById.get(e);if(!A)throw Ob(e);return A}listen(e,A,i,o){let g=$E(A,"","","");return XE(this._getPlayer(e),i,g,o),()=>{}}command(e,A,i,o){if(i=="register"){this.register(e,o[0]);return}if(i=="create"){let n=o[0]||{};this.create(e,A,n);return}let g=this._getPlayer(e);switch(i){case"play":g.play();break;case"pause":g.pause();break;case"reset":g.reset();break;case"restart":g.restart();break;case"finish":g.finish();break;case"init":g.init();break;case"setPosition":g.setPosition(parseFloat(o[0]));break;case"destroy":this.destroy(e);break}}},sS="ng-animate-queued",Pq=".ng-animate-queued",km="ng-animate-disabled",Zq=".ng-animate-disabled",qq="ng-star-inserted",Vq=".ng-star-inserted",Wq=[],lS={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},zq={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Li="__ng_removed",Ua=class{namespaceId;value;options;get params(){return this.options.params}constructor(e,A=""){this.namespaceId=A;let i=e&&e.hasOwnProperty("value"),o=i?e.value:e;if(this.value=Xq(o),i){let g=e,{value:n}=g,s=mc(g,["value"]);this.options=s}else this.options={};this.options.params||(this.options.params={})}absorbOptions(e){let A=e.params;if(A){let i=this.options.params;Object.keys(A).forEach(o=>{i[o]==null&&(i[o]=A[o])})}}},La="void",Fm=new Ua(La),xm=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(e,A,i){this.id=e,this.hostElement=A,this._engine=i,this._hostClassName="ng-tns-"+e,gi(A,this._hostClassName)}listen(e,A,i,o){if(!this._triggers.has(A))throw Pb(i,A);if(i==null||i.length==0)throw Zb(A);if(!$q(i))throw qb(i,A);let g=Nt(this._elementListeners,e,[]),n={name:A,phase:i,callback:o};g.push(n);let s=Nt(this._engine.statesByElement,e,new Map);return s.has(A)||(gi(e,Na),gi(e,Na+"-"+A),s.set(A,Fm)),()=>{this._engine.afterFlush(()=>{let r=g.indexOf(n);r>=0&&g.splice(r,1),this._triggers.has(A)||s.delete(A)})}}register(e,A){return this._triggers.has(e)?!1:(this._triggers.set(e,A),!0)}_getTrigger(e){let A=this._triggers.get(e);if(!A)throw Vb(e);return A}trigger(e,A,i,o=!0){let g=this._getTrigger(A),n=new _a(this.id,A,e),s=this._engine.statesByElement.get(e);s||(gi(e,Na),gi(e,Na+"-"+A),this._engine.statesByElement.set(e,s=new Map));let r=s.get(A),I=new Ua(i,this.id);if(!(i&&i.hasOwnProperty("value"))&&r&&I.absorbOptions(r.options),s.set(A,I),r||(r=Fm),!(I.value===La)&&r.value===I.value){if(!t1(r.params,I.params)){let y=[],L=g.matchStyles(r.value,r.params,y),P=g.matchStyles(I.value,I.params,y);y.length?this._engine.reportError(y):this._engine.afterFlush(()=>{bg(e,L),vi(e,P)})}return}let D=Nt(this._engine.playersByElement,e,[]);D.forEach(y=>{y.namespaceId==this.id&&y.triggerName==A&&y.queued&&y.destroy()});let h=g.matchTransition(r.value,I.value,e,I.params),p=!1;if(!h){if(!o)return;h=g.fallbackTransition,p=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:A,transition:h,fromState:r,toState:I,player:n,isFallbackTransition:p}),p||(gi(e,sS),n.onStart(()=>{ur(e,sS)})),n.onDone(()=>{let y=this.players.indexOf(n);y>=0&&this.players.splice(y,1);let L=this._engine.playersByElement.get(e);if(L){let P=L.indexOf(n);P>=0&&L.splice(P,1)}}),this.players.push(n),D.push(n),n}deregister(e){this._triggers.delete(e),this._engine.statesByElement.forEach(A=>A.delete(e)),this._elementListeners.forEach((A,i)=>{this._elementListeners.set(i,A.filter(o=>o.name!=e))})}clearElementCache(e){this._engine.statesByElement.delete(e),this._elementListeners.delete(e);let A=this._engine.playersByElement.get(e);A&&(A.forEach(i=>i.destroy()),this._engine.playersByElement.delete(e))}_signalRemovalForInnerTriggers(e,A){let i=this._engine.driver.query(e,Ga,!0);i.forEach(o=>{if(o[Li])return;let g=this._engine.fetchNamespacesByElement(o);g.size?g.forEach(n=>n.triggerLeaveAnimation(o,A,!1,!0)):this.clearElementCache(o)}),this._engine.afterFlushAnimationsDone(()=>i.forEach(o=>this.clearElementCache(o)))}triggerLeaveAnimation(e,A,i,o){let g=this._engine.statesByElement.get(e),n=new Map;if(g){let s=[];if(g.forEach((r,I)=>{if(n.set(I,r.value),this._triggers.has(I)){let B=this.trigger(e,I,La,o);B&&s.push(B)}}),s.length)return this._engine.markElementAsRemoved(this.id,e,!0,A,n),i&&Zo(s).onDone(()=>this._engine.processLeaveNode(e)),!0}return!1}prepareLeaveAnimationListeners(e){let A=this._elementListeners.get(e),i=this._engine.statesByElement.get(e);if(A&&i){let o=new Set;A.forEach(g=>{let n=g.name;if(o.has(n))return;o.add(n);let r=this._triggers.get(n).fallbackTransition,I=i.get(n)||Fm,B=new Ua(La),c=new _a(this.id,n,e);this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:n,transition:r,fromState:I,toState:B,player:c,isFallbackTransition:!0})})}}removeNode(e,A){let i=this._engine;if(e.childElementCount&&this._signalRemovalForInnerTriggers(e,A),this.triggerLeaveAnimation(e,A,!0))return;let o=!1;if(i.totalAnimations){let g=i.players.length?i.playersByQueriedElement.get(e):[];if(g&&g.length)o=!0;else{let n=e;for(;n=n.parentNode;)if(i.statesByElement.get(n)){o=!0;break}}}if(this.prepareLeaveAnimationListeners(e),o)i.markElementAsRemoved(this.id,e,!1,A);else{let g=e[Li];(!g||g===lS)&&(i.afterFlush(()=>this.clearElementCache(e)),i.destroyInnerAnimations(e),i._onRemovalComplete(e,A))}}insertNode(e,A){gi(e,this._hostClassName)}drainQueuedTransitions(e){let A=[];return this._queue.forEach(i=>{let o=i.player;if(o.destroyed)return;let g=i.element,n=this._elementListeners.get(g);n&&n.forEach(s=>{if(s.name==i.triggerName){let r=$E(g,i.triggerName,i.fromState.value,i.toState.value);r._data=e,XE(i.player,s.phase,r,s.callback)}}),o.markedForDestroy?this._engine.afterFlush(()=>{o.destroy()}):A.push(i)}),this._queue=[],A.sort((i,o)=>{let g=i.transition.ast.depCount,n=o.transition.ast.depCount;return g==0||n==0?g-n:this._engine.driver.containsElement(i.element,o.element)?1:-1})}destroy(e){this.players.forEach(A=>A.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,e)}},Ym=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,A)=>{};_onRemovalComplete(e,A){this.onRemovalComplete(e,A)}constructor(e,A,i){this.bodyNode=e,this.driver=A,this._normalizer=i}get queuedPlayers(){let e=[];return this._namespaceList.forEach(A=>{A.players.forEach(i=>{i.queued&&e.push(i)})}),e}createNamespace(e,A){let i=new xm(e,A,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,A)?this._balanceNamespaceList(i,A):(this.newHostElements.set(A,i),this.collectEnterElement(A)),this._namespaceLookup[e]=i}_balanceNamespaceList(e,A){let i=this._namespaceList,o=this.namespacesByHostElement;if(i.length-1>=0){let n=!1,s=this.driver.getParentElement(A);for(;s;){let r=o.get(s);if(r){let I=i.indexOf(r);i.splice(I+1,0,e),n=!0;break}s=this.driver.getParentElement(s)}n||i.unshift(e)}else i.push(e);return o.set(A,e),e}register(e,A){let i=this._namespaceLookup[e];return i||(i=this.createNamespace(e,A)),i}registerTrigger(e,A,i){let o=this._namespaceLookup[e];o&&o.register(A,i)&&this.totalAnimations++}destroy(e,A){e&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let i=this._fetchNamespace(e);this.namespacesByHostElement.delete(i.hostElement);let o=this._namespaceList.indexOf(i);o>=0&&this._namespaceList.splice(o,1),i.destroy(A),delete this._namespaceLookup[e]}))}_fetchNamespace(e){return this._namespaceLookup[e]}fetchNamespacesByElement(e){let A=new Set,i=this.statesByElement.get(e);if(i){for(let o of i.values())if(o.namespaceId){let g=this._fetchNamespace(o.namespaceId);g&&A.add(g)}}return A}trigger(e,A,i,o){if(sc(A)){let g=this._fetchNamespace(e);if(g)return g.trigger(A,i,o),!0}return!1}insertNode(e,A,i,o){if(!sc(A))return;let g=A[Li];if(g&&g.setForRemoval){g.setForRemoval=!1,g.setForMove=!0;let n=this.collectedLeaveElements.indexOf(A);n>=0&&this.collectedLeaveElements.splice(n,1)}if(e){let n=this._fetchNamespace(e);n&&n.insertNode(A,i)}o&&this.collectEnterElement(A)}collectEnterElement(e){this.collectedEnterElements.push(e)}markElementAsDisabled(e,A){A?this.disabledNodes.has(e)||(this.disabledNodes.add(e),gi(e,km)):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),ur(e,km))}removeNode(e,A,i){if(sc(A)){let o=e?this._fetchNamespace(e):null;o?o.removeNode(A,i):this.markElementAsRemoved(e,A,!1,i);let g=this.namespacesByHostElement.get(A);g&&g.id!==e&&g.removeNode(A,i)}else this._onRemovalComplete(A,i)}markElementAsRemoved(e,A,i,o,g){this.collectedLeaveElements.push(A),A[Li]={namespaceId:e,setForRemoval:o,hasAnimation:i,removedBeforeQueried:!1,previousTriggersValues:g}}listen(e,A,i,o,g){return sc(A)?this._fetchNamespace(e).listen(A,i,o,g):()=>{}}_buildInstruction(e,A,i,o,g){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,i,o,e.fromState.options,e.toState.options,A,g)}destroyInnerAnimations(e){let A=this.driver.query(e,Ga,!0);A.forEach(i=>this.destroyActiveAnimationsForElement(i)),this.playersByQueriedElement.size!=0&&(A=this.driver.query(e,tc,!0),A.forEach(i=>this.finishActiveQueriedAnimationOnElement(i)))}destroyActiveAnimationsForElement(e){let A=this.playersByElement.get(e);A&&A.forEach(i=>{i.queued?i.markedForDestroy=!0:i.destroy()})}finishActiveQueriedAnimationOnElement(e){let A=this.playersByQueriedElement.get(e);A&&A.forEach(i=>i.finish())}whenRenderingDone(){return new Promise(e=>{if(this.players.length)return Zo(this.players).onDone(()=>e());e()})}processLeaveNode(e){let A=e[Li];if(A&&A.setForRemoval){if(e[Li]=lS,A.namespaceId){this.destroyInnerAnimations(e);let i=this._fetchNamespace(A.namespaceId);i&&i.clearElementCache(e)}this._onRemovalComplete(e,A.setForRemoval)}e.classList?.contains(km)&&this.markElementAsDisabled(e,!1),this.driver.query(e,Zq,!0).forEach(i=>{this.markElementAsDisabled(i,!1)})}flush(e=-1){let A=[];if(this.newHostElements.size&&(this.newHostElements.forEach((i,o)=>this._balanceNamespaceList(i,o)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let i=0;ii()),this._flushFns=[],this._whenQuietFns.length){let i=this._whenQuietFns;this._whenQuietFns=[],A.length?Zo(A).onDone(()=>{i.forEach(o=>o())}):i.forEach(o=>o())}}reportError(e){throw Wb(e)}_flushAnimations(e,A){let i=new Ka,o=[],g=new Map,n=[],s=new Map,r=new Map,I=new Map,B=new Set;this.disabledNodes.forEach(E=>{B.add(E);let eA=this.driver.query(E,Pq,!0);for(let uA=0;uA{let uA=wm+y++;p.set(eA,uA),E.forEach(TA=>gi(TA,uA))});let L=[],P=new Set,mA=new Set;for(let E=0;EP.add(TA)):mA.add(eA))}let _A=new Map,fA=aS(D,Array.from(P));fA.forEach((E,eA)=>{let uA=ec+y++;_A.set(eA,uA),E.forEach(TA=>gi(TA,uA))}),e.push(()=>{h.forEach((E,eA)=>{let uA=p.get(eA);E.forEach(TA=>ur(TA,uA))}),fA.forEach((E,eA)=>{let uA=_A.get(eA);E.forEach(TA=>ur(TA,uA))}),L.forEach(E=>{this.processLeaveNode(E)})});let Qt=[],ue=[];for(let E=this._namespaceList.length-1;E>=0;E--)this._namespaceList[E].drainQueuedTransitions(A).forEach(uA=>{let TA=uA.player,Re=uA.element;if(Qt.push(TA),this.collectedEnterElements.length){let Ue=Re[Li];if(Ue&&Ue.setForMove){if(Ue.previousTriggersValues&&Ue.previousTriggersValues.has(uA.triggerName)){let _i=Ue.previousTriggersValues.get(uA.triggerName),st=this.statesByElement.get(uA.element);if(st&&st.has(uA.triggerName)){let Sg=st.get(uA.triggerName);Sg.value=_i,st.set(uA.triggerName,Sg)}}TA.destroy();return}}let We=!c||!this.driver.containsElement(c,Re),nt=_A.get(Re),Wt=p.get(Re),oe=this._buildInstruction(uA,i,Wt,nt,We);if(oe.errors&&oe.errors.length){ue.push(oe);return}if(We){TA.onStart(()=>bg(Re,oe.fromStyles)),TA.onDestroy(()=>vi(Re,oe.toStyles)),o.push(TA);return}if(uA.isFallbackTransition){TA.onStart(()=>bg(Re,oe.fromStyles)),TA.onDestroy(()=>vi(Re,oe.toStyles)),o.push(TA);return}let Ya=[];oe.timelines.forEach(Ue=>{Ue.stretchStartingKeyframe=!0,this.disabledNodes.has(Ue.element)||Ya.push(Ue)}),oe.timelines=Ya,i.append(Re,oe.timelines);let Ja={instruction:oe,player:TA,element:Re};n.push(Ja),oe.queriedElements.forEach(Ue=>Nt(s,Ue,[]).push(TA)),oe.preStyleProps.forEach((Ue,_i)=>{if(Ue.size){let st=r.get(_i);st||r.set(_i,st=new Set),Ue.forEach((Sg,mr)=>st.add(mr))}}),oe.postStyleProps.forEach((Ue,_i)=>{let st=I.get(_i);st||I.set(_i,st=new Set),Ue.forEach((Sg,mr)=>st.add(mr))})});if(ue.length){let E=[];ue.forEach(eA=>{E.push(zb(eA.triggerName,eA.errors))}),Qt.forEach(eA=>eA.destroy()),this.reportError(E)}let pe=new Map,le=new Map;n.forEach(E=>{let eA=E.element;i.has(eA)&&(le.set(eA,eA),this._beforeAnimationBuild(E.player.namespaceId,E.instruction,pe))}),o.forEach(E=>{let eA=E.element;this._getPreviousPlayers(eA,!1,E.namespaceId,E.triggerName,null).forEach(TA=>{Nt(pe,eA,[]).push(TA),TA.destroy()})});let ni=L.filter(E=>CS(E,r,I)),fo=new Map;IS(fo,this.driver,mA,I,ii).forEach(E=>{CS(E,r,I)&&ni.push(E)});let Ui=new Map;h.forEach((E,eA)=>{IS(Ui,this.driver,new Set(E),r,tr)}),ni.forEach(E=>{let eA=fo.get(E),uA=Ui.get(E);fo.set(E,new Map([...eA?.entries()??[],...uA?.entries()??[]]))});let Kn=[],UA=[],Un={};n.forEach(E=>{let{element:eA,player:uA,instruction:TA}=E;if(i.has(eA)){if(B.has(eA)){uA.onDestroy(()=>vi(eA,TA.toStyles)),uA.disabled=!0,uA.overrideTotalTime(TA.totalTime),o.push(uA);return}let Re=Un;if(le.size>1){let nt=eA,Wt=[];for(;nt=nt.parentNode;){let oe=le.get(nt);if(oe){Re=oe;break}Wt.push(nt)}Wt.forEach(oe=>le.set(oe,Re))}let We=this._buildAnimation(uA.namespaceId,TA,pe,g,Ui,fo);if(uA.setRealPlayer(We),Re===Un)Kn.push(uA);else{let nt=this.playersByElement.get(Re);nt&&nt.length&&(uA.parentPlayer=Zo(nt)),o.push(uA)}}else bg(eA,TA.fromStyles),uA.onDestroy(()=>vi(eA,TA.toStyles)),UA.push(uA),B.has(eA)&&o.push(uA)}),UA.forEach(E=>{let eA=g.get(E.element);if(eA&&eA.length){let uA=Zo(eA);E.setRealPlayer(uA)}}),o.forEach(E=>{E.parentPlayer?E.syncPlayerEvents(E.parentPlayer):E.destroy()});for(let E=0;E!We.destroyed);Re.length?A1(this,eA,Re):this.processLeaveNode(eA)}return L.length=0,Kn.forEach(E=>{this.players.push(E),E.onDone(()=>{E.destroy();let eA=this.players.indexOf(E);this.players.splice(eA,1)}),E.play()}),Kn}afterFlush(e){this._flushFns.push(e)}afterFlushAnimationsDone(e){this._whenQuietFns.push(e)}_getPreviousPlayers(e,A,i,o,g){let n=[];if(A){let s=this.playersByQueriedElement.get(e);s&&(n=s)}else{let s=this.playersByElement.get(e);if(s){let r=!g||g==La;s.forEach(I=>{I.queued||!r&&I.triggerName!=o||n.push(I)})}}return(i||o)&&(n=n.filter(s=>!(i&&i!=s.namespaceId||o&&o!=s.triggerName))),n}_beforeAnimationBuild(e,A,i){let o=A.triggerName,g=A.element,n=A.isRemovalTransition?void 0:e,s=A.isRemovalTransition?void 0:o;for(let r of A.timelines){let I=r.element,B=I!==g,c=Nt(i,I,[]);this._getPreviousPlayers(I,B,n,s,A.toState).forEach(h=>{let p=h.getRealPlayer();p.beforeDestroy&&p.beforeDestroy(),h.destroy(),c.push(h)})}bg(g,A.fromStyles)}_buildAnimation(e,A,i,o,g,n){let s=A.triggerName,r=A.element,I=[],B=new Set,c=new Set,D=A.timelines.map(p=>{let y=p.element;B.add(y);let L=y[Li];if(L&&L.removedBeforeQueried)return new Bo(p.duration,p.delay);let P=y!==r,mA=e1((i.get(y)||Wq).map(pe=>pe.getRealPlayer())).filter(pe=>{let le=pe;return le.element?le.element===y:!1}),_A=g.get(y),fA=n.get(y),Qt=hm(this._normalizer,p.keyframes,_A,fA),ue=this._buildPlayer(p,Qt,mA);if(p.subTimeline&&o&&c.add(y),P){let pe=new _a(e,s,y);pe.setRealPlayer(ue),I.push(pe)}return ue});I.forEach(p=>{Nt(this.playersByQueriedElement,p.element,[]).push(p),p.onDone(()=>jq(this.playersByQueriedElement,p.element,p))}),B.forEach(p=>gi(p,pm));let h=Zo(D);return h.onDestroy(()=>{B.forEach(p=>ur(p,pm)),vi(r,A.toStyles)}),c.forEach(p=>{Nt(o,p,[]).push(h)}),h}_buildPlayer(e,A,i){return A.length>0?this.driver.animate(e.element,A,e.duration,e.delay,e.easing,i):new Bo(e.duration,e.delay)}},_a=class{namespaceId;triggerName;element;_player=new Bo;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(e,A,i){this.namespaceId=e,this.triggerName=A,this.element=i}setRealPlayer(e){this._containsRealPlayer||(this._player=e,this._queuedCallbacks.forEach((A,i)=>{A.forEach(o=>XE(e,i,void 0,o))}),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 A=this._player;A.triggerCallback&&e.onStart(()=>A.triggerCallback("start")),e.onDone(()=>this.finish()),e.onDestroy(()=>this.destroy())}_queueEvent(e,A){Nt(this._queuedCallbacks,e,[]).push(A)}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 A=this._player;A.triggerCallback&&A.triggerCallback(e)}};function jq(t,e,A){let i=t.get(e);if(i){if(i.length){let o=i.indexOf(A);i.splice(o,1)}i.length==0&&t.delete(e)}return i}function Xq(t){return t??null}function sc(t){return t&&t.nodeType===1}function $q(t){return t=="start"||t=="done"}function rS(t,e){let A=t.style.display;return t.style.display=e??"none",A}function IS(t,e,A,i,o){let g=[];A.forEach(r=>g.push(rS(r)));let n=[];i.forEach((r,I)=>{let B=new Map;r.forEach(c=>{let D=e.computeStyle(I,c,o);B.set(c,D),(!D||D.length==0)&&(I[Li]=zq,n.push(I))}),t.set(I,B)});let s=0;return A.forEach(r=>rS(r,g[s++])),n}function aS(t,e){let A=new Map;if(t.forEach(s=>A.set(s,[])),e.length==0)return A;let i=1,o=new Set(e),g=new Map;function n(s){if(!s)return i;let r=g.get(s);if(r)return r;let I=s.parentNode;return A.has(I)?r=I:o.has(I)?r=i:r=n(I),g.set(s,r),r}return e.forEach(s=>{let r=n(s);r!==i&&A.get(r).push(s)}),A}function gi(t,e){t.classList?.add(e)}function ur(t,e){t.classList?.remove(e)}function A1(t,e,A){Zo(A).onDone(()=>t.processLeaveNode(e))}function e1(t){let e=[];return dS(t,e),e}function dS(t,e){for(let A=0;Ao.add(g)):e.set(t,i),A.delete(t),!0}var Dr=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(e,A)=>{};constructor(e,A,i){this._driver=A,this._normalizer=i,this._transitionEngine=new Ym(e.body,A,i),this._timelineEngine=new _m(e.body,A,i),this._transitionEngine.onRemovalComplete=(o,g)=>this.onRemovalComplete(o,g)}registerTrigger(e,A,i,o,g){let n=e+"-"+o,s=this._triggerCache[n];if(!s){let r=[],I=[],B=QS(this._driver,g,r,I);if(r.length)throw Yb(o,r);s=Hq(o,B,this._normalizer),this._triggerCache[n]=s}this._transitionEngine.registerTrigger(A,o,s)}register(e,A){this._transitionEngine.register(e,A)}destroy(e,A){this._transitionEngine.destroy(e,A)}onInsert(e,A,i,o){this._transitionEngine.insertNode(e,A,i,o)}onRemove(e,A,i){this._transitionEngine.removeNode(e,A,i)}disableAnimations(e,A){this._transitionEngine.markElementAsDisabled(e,A)}process(e,A,i,o){if(i.charAt(0)=="@"){let[g,n]=um(i),s=o;this._timelineEngine.command(g,A,n,s)}else this._transitionEngine.trigger(e,A,i,o)}listen(e,A,i,o,g){if(i.charAt(0)=="@"){let[n,s]=um(i);return this._timelineEngine.listen(n,A,s,g)}return this._transitionEngine.listen(e,A,i,o,g)}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 i1(t,e){let A=null,i=null;return Array.isArray(e)&&e.length?(A=bm(e[0]),e.length>1&&(i=bm(e[e.length-1]))):e instanceof Map&&(A=bm(e)),A||i?new o1(t,A,i):null}var o1=(()=>{class t{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(A,i,o){this._element=A,this._startStyles=i,this._endStyles=o;let g=t.initialStylesByElement.get(A);g||t.initialStylesByElement.set(A,g=new Map),this._initialStyles=g}start(){this._state<1&&(this._startStyles&&vi(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(vi(this._element,this._initialStyles),this._endStyles&&(vi(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(t.initialStylesByElement.delete(this._element),this._startStyles&&(bg(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(bg(this._element,this._endStyles),this._endStyles=null),vi(this._element,this._initialStyles),this._state=3)}}return t})();function bm(t){let e=null;return t.forEach((A,i)=>{g1(i)&&(e=e||new Map,e.set(i,A))}),e}function g1(t){return t==="display"||t==="position"}var Ec=class{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(e,A,i,o){this.element=e,this.keyframes=A,this.options=i,this._specialStyles=o,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._initialized=!0;let e=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,e,this.options),this._finalKeyframe=e.length?e[e.length-1]:new Map;let A=()=>this._onFinish();this.domPlayer.addEventListener("finish",A),this.onDestroy(()=>{this.domPlayer.removeEventListener("finish",A)})}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_convertKeyframesToObject(e){let A=[];return e.forEach(i=>{A.push(Object.fromEntries(i))}),A}_triggerWebAnimation(e,A,i){return e.animate(this._convertKeyframesToObject(A),i)}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(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(e=>e()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),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&&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===void 0&&this.init(),this.domPlayer.currentTime=e*this.time}getPosition(){return+(this.domPlayer.currentTime??0)/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){let e=new Map;this.hasStarted()&&this._finalKeyframe.forEach((i,o)=>{o!=="offset"&&e.set(o,this._finished?i:oc(this.element,o))}),this.currentSnapshot=e}triggerCallback(e){let A=e==="start"?this._onStartFns:this._onDoneFns;A.forEach(i=>i()),A.length=0}},cc=class{validateStyleProperty(e){return!0}validateAnimatableStyleProperty(e){return!0}containsElement(e,A){return Dm(e,A)}getParentElement(e){return Ac(e)}query(e,A,i){return mm(e,A,i)}computeStyle(e,A,i){return oc(e,A)}animate(e,A,i,o,g,n=[]){let s=o==0?"both":"forwards",r={duration:i,delay:o,fill:s};g&&(r.easing=g);let I=new Map,B=n.filter(h=>h instanceof Ec);AS(i,o)&&B.forEach(h=>{h.currentSnapshot.forEach((p,y)=>I.set(y,p))});let c=Xb(A).map(h=>new Map(h));c=eS(e,c,I);let D=i1(e,c);return new Ec(e,c,r,D)}};var rc="@",hS="@.disabled",lc=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(e,A,i,o){this.namespaceId=e,this.delegate=A,this.engine=i,this._onDestroy=o}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,A){return this.delegate.createElement(e,A)}createComment(e){return this.delegate.createComment(e)}createText(e){return this.delegate.createText(e)}appendChild(e,A){this.delegate.appendChild(e,A),this.engine.onInsert(this.namespaceId,A,e,!1)}insertBefore(e,A,i,o=!0){this.delegate.insertBefore(e,A,i),this.engine.onInsert(this.namespaceId,A,e,o)}removeChild(e,A,i){this.parentNode(A)&&this.engine.onRemove(this.namespaceId,A,this.delegate)}selectRootElement(e,A){return this.delegate.selectRootElement(e,A)}parentNode(e){return this.delegate.parentNode(e)}nextSibling(e){return this.delegate.nextSibling(e)}setAttribute(e,A,i,o){this.delegate.setAttribute(e,A,i,o)}removeAttribute(e,A,i){this.delegate.removeAttribute(e,A,i)}addClass(e,A){this.delegate.addClass(e,A)}removeClass(e,A){this.delegate.removeClass(e,A)}setStyle(e,A,i,o){this.delegate.setStyle(e,A,i,o)}removeStyle(e,A,i){this.delegate.removeStyle(e,A,i)}setProperty(e,A,i){A.charAt(0)==rc&&A==hS?this.disableAnimations(e,!!i):this.delegate.setProperty(e,A,i)}setValue(e,A){this.delegate.setValue(e,A)}listen(e,A,i,o){return this.delegate.listen(e,A,i,o)}disableAnimations(e,A){this.engine.disableAnimations(e,A)}},Jm=class extends lc{factory;constructor(e,A,i,o,g){super(A,i,o,g),this.factory=e,this.namespaceId=A}setProperty(e,A,i){A.charAt(0)==rc?A.charAt(1)=="."&&A==hS?(i=i===void 0?!0:!!i,this.disableAnimations(e,i)):this.engine.process(this.namespaceId,e,A.slice(1),i):this.delegate.setProperty(e,A,i)}listen(e,A,i,o){if(A.charAt(0)==rc){let g=n1(e),n=A.slice(1),s="";return n.charAt(0)!=rc&&([n,s]=s1(n)),this.engine.listen(this.namespaceId,g,n,s,r=>{let I=r._data||-1;this.factory.scheduleListenerCallback(I,i,r)})}return this.delegate.listen(e,A,i,o)}};function n1(t){switch(t){case"body":return document.body;case"document":return document;case"window":return window;default:return t}}function s1(t){let e=t.indexOf("."),A=t.substring(0,e),i=t.slice(e+1);return[A,i]}var dc=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(e,A,i){this.delegate=e,this.engine=A,this._zone=i,A.onRemovalComplete=(o,g)=>{g?.removeChild(null,o)}}createRenderer(e,A){let i="",o=this.delegate.createRenderer(e,A);if(!e||!A?.data?.animation){let I=this._rendererCache,B=I.get(o);if(!B){let c=()=>I.delete(o);B=new lc(i,o,this.engine,c),I.set(o,B)}return B}let g=A.id,n=A.id+"-"+this._currentId;this._currentId++,this.engine.register(n,e);let s=I=>{Array.isArray(I)?I.forEach(s):this.engine.registerTrigger(g,n,e,I.name,I)};return A.data.animation.forEach(s),new Jm(this,n,o,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(e,A,i){if(e>=0&&eA(i));return}let o=this._animationCallbacksBuffer;o.length==0&&queueMicrotask(()=>{this._zone.run(()=>{o.forEach(g=>{let[n,s]=g;n(s)}),this._animationCallbacksBuffer=[]})}),o.push([A,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 I1=(()=>{class t extends Dr{constructor(A,i,o){super(A,i,o)}ngOnDestroy(){this.flush()}static \u0275fac=function(i){return new(i||t)(J(lA),J(vn),J(Ln))};static \u0275prov=N({token:t,factory:t.\u0275fac})}return t})();function a1(){return new Ic}function C1(t,e,A){return new dc(t,e,A)}var DS=[{provide:Ln,useFactory:a1},{provide:Dr,useClass:I1},{provide:tt,useFactory:C1,deps:[uI,Dr,X]}],B1=[{provide:vn,useClass:Hm},{provide:ee,useValue:"NoopAnimations"},...DS],uS=[{provide:vn,useFactory:()=>new cc},{provide:ee,useFactory:()=>"BrowserAnimations"},...DS],mS=(()=>{class t{static withConfig(A){return{ngModule:t,providers:A.disableAnimations?B1:uS}}static \u0275fac=function(i){return new(i||t)};static \u0275mod=V({type:t});static \u0275inj=q({providers:uS,imports:[mI]})}return t})();var hc=class t{static \u0275fac=function(A){return new(A||t)};static \u0275mod=V({type:t});static \u0275inj=q({imports:[Uo,hQ,JF,FF,To,YE,xo,Kk,xo,xF,HF,ZF,Ab,kE,qk,uF,NF,mb.forRoot(),fb,bM]})};var xa=class t{static \u0275fac=function(A){return new(A||t)};static \u0275mod=V({type:t,bootstrap:[lr]});static \u0275inj=q({providers:[Si,fg,ho,Cr,Br,Fg,co,ar,cr],imports:[hc,mI,hQ,Ph,jE,YE,To,xo,mS,xo]})};fetch("/assets/config/runtime-config.json").then(t=>t.json()).then(t=>{window.runtimeConfig=t,$B().bootstrapModule(xa).catch(e=>console.error(e))});$B().bootstrapModule(xa).catch(t=>console.error(t));