(i,e,A)
| 224 | `,A)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let A=s6(e),t=RB(A);return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let A=s6(e),t=RB(A);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,A){return this.type!=="comment"||this.indent<=A?!1:e.every(t=>t.type==="newline"||t.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*Ie(this.pop())))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*Ie(this.pop()),yield*Ie(this.step());break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*Ie(this.pop()))}}};function IsA(i){let e=i.prettyErrors!==!1;return{lineCounter:i.lineCounter||e&&new vu||null,prettyErrors:e}}function CO(i,e={}){let{lineCounter:A,prettyErrors:t}=IsA(e),n=new bu(A?.addNewLine),o=new yu(e),a=null;for(let r of o.compose(n.parse(i),!0,i.length))if(!a)a=r;else if(a.options.logLevel!=="silent"){a.errors.push(new Ac(r.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return t&&A&&(a.errors.forEach(O7(i,A)),a.warnings.forEach(O7(i,A))),a}function NB(i,e,A){let t;typeof e=="function"?t=e:A===void 0&&e&&typeof e=="object"&&(A=e);let n=CO(i,A);if(!n)return null;if(n.warnings.forEach(o=>Tm(n.options.logLevel,o)),n.errors.length>0){if(n.options.logLevel!=="silent")throw n.errors[0];n.errors=[]}return n.toJS(Object.assign({reviver:t},A))}function AM(i,e,A){let t=null;if(typeof e=="function"||Array.isArray(e)?t=e:A===void 0&&e&&(A=e),typeof A=="string"&&(A=A.length),typeof A=="number"){let n=Math.round(A);A=n<1?void 0:n>8?{indent:8}:{indent:n}}if(i===void 0){let{keepUndefined:n}=A??e??{};if(!n)return}return Vg(i)&&!t?i.toString(A):new eC(i,t,A).toString(A)}var a0=class i{static generateYamlFile(e,A,t,n,o=new Set){if(o.has(e.name))return;o.add(e.name);let a=e.isRoot?"root_agent.yaml":`${e.name}.yaml`,r=`${t}/${a}`,s=e.sub_agents?e.sub_agents.map(u=>({config_path:`./${u.name}.yaml`})):[],l={name:e.name,model:e.model,agent_class:e.agent_class,description:e.description||"",instruction:e.instruction,sub_agents:s,tools:i.buildToolsConfig(e.tools,n)};(!e.description||e.description.trim()==="")&&delete l.description,e.agent_class!="LlmAgent"&&(delete l.model,delete l.instruction,delete l.tools),e.agent_class==="LoopAgent"&&e.max_iterations&&(l.max_iterations=e.max_iterations);let g=i.buildCallbacksConfig(e.callbacks);Object.keys(g).length>0&&Object.assign(l,g);let C=AM(l),d=new Blob([C],{type:"application/x-yaml"}),B=new File([d],r,{type:"application/x-yaml"});A.append("files",B);for(let u of e.sub_agents??[])i.generateYamlFile(u,A,t,n,o);if(e.tools){for(let u of e.tools)if(u.toolType==="Agent Tool"){let E=u.toolAgentName||u.name;if(!E||E==="undefined"||E.trim()==="")continue;let f=n.get(E);f&&i.generateYamlFile(f,A,t,n,o)}}}static buildToolsConfig(e,A){return!e||e.length===0?[]:e.map(t=>{let n={name:t.name};if(t.toolType==="Agent Tool"){n.name="AgentTool";let o=t.toolAgentName||t.name;if(!o||o==="undefined"||o.trim()==="")return null;let a=A.get(o);return n.args={agent:{config_path:`./${o}.yaml`},skip_summarization:a?.skip_summarization||!1},n}return t.args&&Object.keys(t.args).some(a=>{let r=t.args[a];return r!=null&&r!==""})&&(n.args=t.args),n}).filter(t=>t!==null)}static buildCallbacksConfig(e){if(!e||e.length===0)return{};let A={};return e.forEach(t=>{let n=`${t.type}_callbacks`;A[n]||(A[n]=[]),A[n].push({name:t.name})}),A}};function hsA(i,e){i&1&&(I(0,"mat-hint",3),D(1," Start with a letter or underscore, and contain only letters, digits, and underscores. "),h())}var l6=class i{constructor(e,A){this.data=e;this.dialogRef=A}newAppName="";agentService=w(el);_snackbarService=w(Xc);router=w(Is);isNameValid(){let e=this.newAppName.trim();return!(!e||!/^[a-zA-Z_]/.test(e)||!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(e))}createNewApp(){let e=this.newAppName.trim();if(!this.isNameValid()){this._snackbarService.open("App name must start with a letter or underscore and can only contain letters, digits, and underscores.","OK");return}if(this.data.existingAppNames.includes(e)){this._snackbarService.open("App name already exists. Please choose a different name.","OK");return}let A={agent_class:"LlmAgent",instruction:"You are the root agent that coordinates other agents.",isRoot:!0,model:"gemini-2.5-flash",name:e,sub_agents:[],tools:[]},t=new FormData,n=new Map;a0.generateYamlFile(A,t,e,n),this.agentService.agentBuildTmp(e,t).subscribe(o=>{o?(this.router.navigate(["/"],{queryParams:{app:e,mode:"builder"}}).then(()=>{window.location.reload()}),this.dialogRef.close(!0)):this._snackbarService.open("Something went wrong, please try again","OK")})}static \u0275fac=function(A){return new(A||i)(st(Do),st(zn))};static \u0275cmp=vA({type:i,selectors:[["app-add-item-dialog"]],decls:10,vars:3,consts:[["mat-dialog-title","",1,"new-app-title"],[2,"padding-left","20px","padding-right","24px"],["matInput","",3,"ngModelChange","keydown.enter","ngModel"],[1,"validation-hint"],["align","end"],["mat-button","","mat-dialog-close",""],["mat-button","","cdkFocusInitial","",3,"click","disabled"]],template:function(A,t){A&1&&(I(0,"h2",0),D(1,"Create a new app"),h(),I(2,"mat-form-field",1)(3,"input",2),Ni("ngModelChange",function(o){return wi(t.newAppName,o)||(t.newAppName=o),o}),U("keydown.enter",function(){return t.createNewApp()}),h(),T(4,hsA,2,0,"mat-hint",3),h(),I(5,"mat-dialog-actions",4)(6,"button",5),D(7,"Cancel"),h(),I(8,"button",6),U("click",function(){return t.createNewApp()}),D(9," Create "),h()()),A&2&&(Q(3),Ri("ngModel",t.newAppName),Q(),O(t.isNameValid()?-1:4),Q(4),H("disabled",!t.isNameValid()))},dependencies:[Xo,Zo,ka,fn,Gn,Kn,Ho,ha,ki,r2,J1],styles:[".new-app-title[_ngcontent-%COMP%]{color:var(--mdc-dialog-subhead-color)!important;font-family:Google Sans;font-size:24px}.validation-hint[_ngcontent-%COMP%]{font-size:12px;color:var(--mdc-dialog-supporting-text-color)}"]})};function FB(i,e,A){let t=typeof i=="string"?document.querySelector(i):i;if(!t)return;t.querySelectorAll("g.node").forEach(o=>{let a=o,s=o.querySelector("title")?.textContent||"";s==="__LEGEND__"||s==="__START__"||s==="__END__"||a.classList.contains("unvisited-node")||A&&!A.has(s)||(a.style.cursor="pointer",a.addEventListener("mouseenter",()=>{let l=o.querySelector("ellipse, polygon, path, rect");l&&(l.style.stroke="#42A5F5",l.style.strokeWidth="3")}),a.addEventListener("mouseleave",()=>{let l=o.querySelector("ellipse, polygon, path, rect");l&&(l.style.stroke="",l.style.strokeWidth="")}),e&&a.addEventListener("click",l=>{let C=o.querySelector("title")?.textContent||"";C&&e(C,l)}))})}function IO(i,e,A={}){let{ySpacing:t=200,xSpacing:n=350,startX:o=400,startY:a=100}=A,r=i.map(m=>m.name||m.agent?.name||""),s=new Map,l=new Map;r.forEach(m=>{s.set(m,[]),l.set(m,0)}),e.forEach(m=>{let v=m.from_node?.name||m.from_node?.agent?.name,S=m.to_node?.name||m.to_node?.agent?.name;v&&S&&(s.get(v)?.push(S),l.set(S,(l.get(S)||0)+1))});let g=new Map,C=[],d=new Map(l),B=new Set;for(r.forEach(m=>{d.get(m)===0&&(C.push(m),g.set(m,0),B.add(m))});C.length>0;){let m=C.shift(),v=g.get(m)||0;s.get(m)?.forEach(S=>{let k=g.get(S);if(k!==void 0&&k<=v)return;let M=v+1;k===void 0&&g.set(S,M);let x=d.get(S)||0;d.set(S,x-1),d.get(S)===0&&!B.has(S)&&(C.push(S),B.add(S))})}let u=Math.max(...Array.from(g.values()),0);r.forEach(m=>{g.has(m)||(g.set(m,u+1),u++)});let E=new Map;g.forEach((m,v)=>{E.has(m)||E.set(m,[]),E.get(m)?.push(v)});let f=new Map;return i.forEach(m=>{let v=m.name||m.agent?.name||"",S=g.get(v)||0,k=E.get(S)||[],M=k.indexOf(v),x=k.length,F=(M-(x-1)/2)*n;f.set(v,{x:o+F,y:a+S*t})}),{levels:g,nodesByLevel:E,positions:f}}function tc(i,e=""){return i?.name||i?.agent?.name||e}function BO(i){switch(i){case"start":return"play_arrow";case"function":return"code";case"tool":return"build";case"join":return"merge";default:return"smart_toy"}}function hO(i){switch(i){case"start":return"Start";case"function":return"Function";case"tool":return"Tool";case"join":return"Join";default:return"Agent"}}var g6={ySpacing:200,xSpacing:350,startX:400,startY:100};function EO(i){return i.map(e=>e.name).join("/")}function tC(i){return!!(i.graph||i.nodes||i.sub_agents&&i.sub_agents.length>0)}function eM(i){return i.graph?.nodes?i.graph.nodes:i.nodes?i.nodes:[]}function LB(i,e){if(i.nodes){let A=i.nodes.find(t=>t.name===e);if(A)return A}if(i.graph?.nodes){let A=i.graph.nodes.find(t=>t.name===e);if(A)return A}if(i.sub_agents){let A=i.sub_agents.find(t=>t.name===e);if(A)return A}return null}function QO(i,e){let A=e.split("/"),t=[{name:i.name,data:i}],n=i;for(let o=1;o<A.length;o++){let a=A[o],s=eM(n).find(l=>tc(l)===a);if(s)t.push({name:a,data:s}),n=s;else{console.warn(`Could not find node '${a}' in path '${e}'`);break}}return t}function EsA(i,e){i&1&&(I(0,"mat-icon",20),D(1,"chevron_right"),h())}function QsA(i,e){if(i&1){let A=aA();T(0,EsA,2,0,"mat-icon",20),I(1,"button",21),U("click",function(){let n=L(A).$index,o=p(2);return G(o.navigateToLevel(n))}),D(2),h()}if(i&2){let A=e.$implicit,t=e.$index,n=p(2);O(t>0?0:-1),Q(),_A("active",t===n.breadcrumbs().length-1),H("disabled",t===n.breadcrumbs().length-1),Q(),Ee(" ",A," ")}}function usA(i,e){if(i&1&&(I(0,"div",3)(1,"span"),D(2,"Agent Structure:"),h(),I(3,"button",19),D(4),h(),I(5,"mat-icon",20),D(6,"chevron_right"),h(),ke(7,QsA,3,5,null,null,Ja),h()),i&2){let A=p();Q(4),nA(A.appName),Q(3),_e(A.breadcrumbs())}}function psA(i,e){i&1&&(I(0,"div",15),lA(1,"mat-spinner",22),I(2,"p"),D(3,"Loading agent structure..."),h()())}function fsA(i,e){if(i&1&&(I(0,"div",16)(1,"mat-icon",23),D(2,"error_outline"),h(),I(3,"p",24),D(4),h()()),i&2){let A=p();Q(4),nA(A.errorMessage())}}function msA(i,e){if(i&1){let A=aA();I(0,"div",25),U("wheel",function(n){L(A);let o=p();return G(o.onWheel(n))})("mousedown",function(n){L(A);let o=p();return G(o.onMouseDown(n))})("mousemove",function(n){L(A);let o=p();return G(o.onMouseMove(n))})("mouseup",function(){L(A);let n=p();return G(n.onMouseUp())})("mouseleave",function(){L(A);let n=p();return G(n.onMouseUp())}),h()}if(i&2){let A=p();H("innerHTML",A.renderedGraph(),Fc)}}function wsA(i,e){i&1&&(I(0,"div",18)(1,"mat-icon",26),D(2,"account_tree"),h(),I(3,"p"),D(4,"Agent structure graph not available."),h()())}var c6=class i{appName;preloadedAppData;preloadedLightGraphSvg;preloadedDarkGraphSvg;startPath;close=new FA;agentService=w(el);graphService=w(uB);sanitizer=w(Qs);themeService=w(og);renderedGraph=mA(null);isLoading=mA(!0);errorMessage=mA(null);fullAppData=null;navigationStack=[];breadcrumbs=mA([]);isPanning=!1;wasDragging=!1;dragStartX=0;dragStartY=0;startPanX=0;startPanY=0;scale=1;translateX=0;translateY=0;lastMousedownTarget=null;onOverlayMouseDown(e){this.lastMousedownTarget=e.target}onBackdropClick(e){if(this.wasDragging||this.lastMousedownTarget&&(this.lastMousedownTarget.closest("svg")||this.lastMousedownTarget.closest(".overlay-header")||this.lastMousedownTarget.closest(".loading-container")||this.lastMousedownTarget.closest(".error-container")||this.lastMousedownTarget.closest(".no-graph-container")))return;let A=e.target;!A.closest("svg")&&!A.closest(".overlay-header")&&!A.closest(".loading-container")&&!A.closest(".error-container")&&!A.closest(".no-graph-container")&&this.close.emit()}ngOnInit(){this.loadAgentGraph()}loadAgentGraph(){if(this.isLoading.set(!0),this.errorMessage.set(null),this.renderedGraph.set(null),this.preloadedAppData){if(this.fullAppData=this.preloadedAppData,this.navigationStack=[{name:this.fullAppData.root_agent?.name||this.appName,data:this.fullAppData.root_agent}],this.startPath){let e=this.fullAppData.root_agent,A=this.startPath.split("/");for(let t of A){if(!t)continue;let n=LB(e,t);if(n)this.navigationStack.push({name:t,data:n}),e=n;else break}}this.updateBreadcrumbs(),this.renderCurrentLevel();return}this.agentService.getAppInfo(this.appName).subscribe({next:e=>{if(this.fullAppData=e,this.navigationStack=[{name:e.root_agent?.name||this.appName,data:e.root_agent}],this.startPath){let A=this.fullAppData.root_agent,t=this.startPath.split("/");for(let n of t){if(!n)continue;let o=LB(A,n);if(o)this.navigationStack.push({name:n,data:o}),A=o;else break}}this.updateBreadcrumbs(),this.renderCurrentLevel()},error:e=>{console.error("Error loading app data:",e),this.errorMessage.set("Agent structure graph not available."),this.isLoading.set(!1)}})}renderCurrentLevel(){let e=this.themeService.currentTheme()==="dark",A=this.getCurrentPath(),t=e?this.preloadedDarkGraphSvg:this.preloadedLightGraphSvg,n=t?t[A]:null;if(n){this.renderedGraph.set(this.sanitizer.bypassSecurityTrustHtml(n)),this.isLoading.set(!1),setTimeout(()=>{let o=this.getExpandableNodes();FB(".svg-container",a=>{this.wasDragging||this.onNodeClick(a)},o),this.initializeSvgTransform()},50);return}this.agentService.getAppGraphImage(this.appName,e,A).subscribe({next:o=>re(this,null,function*(){try{if(!o?.dotSrc){this.errorMessage.set("Agent structure graph not available."),this.isLoading.set(!1);return}let a=yield this.graphService.render(o.dotSrc);this.renderedGraph.set(this.sanitizer.bypassSecurityTrustHtml(a)),this.isLoading.set(!1),setTimeout(()=>{let r=this.getExpandableNodes();FB(".svg-container",s=>{this.wasDragging||this.onNodeClick(s)},r),this.initializeSvgTransform()},50)}catch(a){console.error("Error rendering graph:",a),this.errorMessage.set("Agent structure graph not available."),this.isLoading.set(!1)}}),error:o=>{console.error("Error loading agent graph:",o),this.errorMessage.set("Agent structure graph not available."),this.isLoading.set(!1)}})}getCurrentPath(){return this.navigationStack.length<=1?"":this.navigationStack.slice(1).map(e=>e.name).join("/")}updateBreadcrumbs(){this.breadcrumbs.set(this.navigationStack.map(e=>e.name))}onNodeClick(e){let A=this.navigationStack[this.navigationStack.length-1].data,t=LB(A,e);t&&tC(t)&&this.navigateIntoNode(e,t)}navigateIntoNode(e,A){this.navigationStack.push({name:e,data:A}),this.updateBreadcrumbs(),this.isLoading.set(!0),this.renderCurrentLevel()}navigateToLevel(e){e>=0&&e<this.navigationStack.length&&(this.navigationStack=this.navigationStack.slice(0,e+1),this.updateBreadcrumbs(),this.isLoading.set(!0),this.renderCurrentLevel())}getExpandableNodes(){let e=new Set;if(!this.navigationStack.length)return e;let A=this.navigationStack[this.navigationStack.length-1].data,t=this.navigationStack[this.navigationStack.length-1].name;return eM(A).forEach(o=>{let a=tc(o);a!==t&&tC(o)&&e.add(a)}),e}getSvgElement(){return document.querySelector(".svg-container svg")}applyTransform(){let e=this.getSvgElement();e&&(e.style.transform=`translate(${this.translateX}px, ${this.translateY}px) scale(${this.scale})`)}initializeSvgTransform(){let e=this.getSvgElement(),A=document.querySelector(".svg-container");if(!e||!A)return;let t=e.getBoundingClientRect(),n=A.getBoundingClientRect(),o=48,a=(n.width-o)/t.width,r=(n.height-o)/t.height;this.scale=Math.min(1,a,r);let s=t.width*this.scale,l=t.height*this.scale;this.translateX=(n.width-s)/2,this.translateY=(n.height-l)/2,this.applyTransform(),requestAnimationFrame(()=>{e.classList.add("ready")})}onWheel(e){let A=document.querySelector(".svg-container"),t=this.getSvgElement();if(!A||!t)return;e.preventDefault();let n=Math.max(-100,Math.min(100,e.deltaY)),o=Math.pow(1.002,-n),a=this.scale*o,r=A.getBoundingClientRect(),s=e.clientX-r.left,l=e.clientY-r.top,g=(s-this.translateX)/this.scale,C=(l-this.translateY)/this.scale;this.translateX=s-g*a,this.translateY=l-C*a,this.scale=a,this.applyTransform()}onMouseDown(e){if(e.button!==0||!e.target.closest("svg"))return;this.isPanning=!0,this.wasDragging=!1,this.dragStartX=e.clientX,this.dragStartY=e.clientY,this.startPanX=e.clientX,this.startPanY=e.clientY;let t=this.getSvgElement();t&&(t.style.cursor="grabbing")}onMouseMove(e){if(this.isPanning){if(!this.wasDragging){let A=e.clientX-this.dragStartX,t=e.clientY-this.dragStartY;A*A+t*t>25&&(this.wasDragging=!0)}this.translateX+=e.clientX-this.startPanX,this.translateY+=e.clientY-this.startPanY,this.startPanX=e.clientX,this.startPanY=e.clientY,this.applyTransform()}}onMouseUp(){this.isPanning=!1;let e=this.getSvgElement();e&&(e.style.cursor=""),setTimeout(()=>{this.wasDragging=!1},50)}resetZoomPan(){this.initializeSvgTransform()}static \u0275fac=function(A){return new(A||i)};static \u0275cmp=vA({type:i,selectors:[["app-agent-structure-graph-dialog"]],inputs:{appName:"appName",preloadedAppData:"preloadedAppData",preloadedLightGraphSvg:"preloadedLightGraphSvg",preloadedDarkGraphSvg:"preloadedDarkGraphSvg",startPath:"startPath"},outputs:{close:"close"},decls:35,vars:2,consts:[[1,"overlay-backdrop"],[1,"overlay-panel",3,"mousedown","click"],[1,"overlay-header"],[1,"breadcrumb-container"],[2,"flex","1"],[1,"graph-legend"],[1,"legend-item"],[2,"color","#42a5f5","font-size","16px"],[2,"color","#9333ea","font-size","16px"],[2,"color","#10b981","font-size","16px"],[2,"color","#f59e0b","font-size","16px"],[2,"color","#6b7280","font-size","16px"],["mat-icon-button","","aria-label","Close",3,"click"],[1,"overlay-content"],[1,"graph-container"],[1,"loading-container"],[1,"error-container"],[1,"svg-container",3,"innerHTML"],[1,"no-graph-container"],["disabled","",1,"breadcrumb-item"],[1,"breadcrumb-separator"],[1,"breadcrumb-item",3,"click","disabled"],["diameter","50"],[1,"error-icon"],[1,"error-message"],[1,"svg-container",3,"wheel","mousedown","mousemove","mouseup","mouseleave","innerHTML"],[1,"large-icon"]],template:function(A,t){A&1&&(lA(0,"div",0),I(1,"div",1),U("mousedown",function(o){return t.onOverlayMouseDown(o)})("click",function(o){return t.onBackdropClick(o)}),I(2,"div",2),T(3,usA,9,1,"div",3),lA(4,"span",4),I(5,"div",5)(6,"span",6)(7,"span",7),D(8,"\u2726"),h(),D(9," Agent"),h(),I(10,"span",6)(11,"span",8),D(12,"\u22B7"),h(),D(13," Workflow"),h(),I(14,"span",6)(15,"span",9),D(16,"\u0192"),h(),D(17," Function"),h(),I(18,"span",6)(19,"span",10),D(20,"\u2335"),h(),D(21," Join"),h(),I(22,"span",6)(23,"span",11),D(24,"\u{1F527}"),h(),D(25," Tool"),h()(),I(26,"button",12),U("click",function(){return t.close.emit()}),I(27,"mat-icon"),D(28,"close"),h()()(),I(29,"div",13)(30,"div",14),T(31,psA,4,0,"div",15)(32,fsA,5,1,"div",16)(33,msA,1,1,"div",17)(34,wsA,5,0,"div",18),h()()()),A&2&&(Q(3),O(t.renderedGraph()&&t.breadcrumbs().length>0?3:-1),Q(28),O(t.isLoading()?31:t.errorMessage()?32:t.renderedGraph()?33:34))},dependencies:[li,qi,yi,Un,zt,l2,Es],styles:["[_nghost-%COMP%]{display:block;position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center}.overlay-backdrop[_ngcontent-%COMP%]{position:absolute;inset:0;background-color:#000000b3}.overlay-panel[_ngcontent-%COMP%]{position:relative;width:100vw;height:100vh;display:flex;flex-direction:column;background-color:transparent;color:var(--mat-sys-on-surface);border-radius:0;overflow:hidden;box-shadow:none}.overlay-header[_ngcontent-%COMP%]{display:flex;align-items:center;height:48px;padding:0 16px;box-sizing:border-box;border-bottom:1px solid var(--mat-sys-outline-variant);background-color:var(--mat-sys-surface-container)}.overlay-content[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;overflow:hidden}.graph-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0}.agent-info[_ngcontent-%COMP%]{margin:0 0 8px;font-size:14px;color:var(--mdc-dialog-supporting-text-color)}.agent-info[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-weight:600;color:var(--mdc-dialog-supporting-text-color)}.svg-container[_ngcontent-%COMP%]{flex:1;position:relative;overflow:hidden;background-color:transparent}.svg-container[_ngcontent-%COMP%] svg{position:absolute;top:0;left:0;transform-origin:0 0;cursor:grab;border-radius:16px;box-shadow:0 4px 12px #0000004d}.svg-container[_ngcontent-%COMP%] svg>g.graph>polygon:first-child{fill:transparent!important;stroke:transparent!important}.svg-container[_ngcontent-%COMP%] svg{opacity:0;transition:opacity .1s ease-in-out}.svg-container[_ngcontent-%COMP%] svg.ready{opacity:1}.svg-container[_ngcontent-%COMP%] svg:active{cursor:grabbing}.dark-theme[_nghost-%COMP%] .svg-container[_ngcontent-%COMP%] svg, .dark-theme [_nghost-%COMP%] .svg-container[_ngcontent-%COMP%] svg{background-color:#0e172a}.light-theme[_nghost-%COMP%] .svg-container[_ngcontent-%COMP%] svg, .light-theme [_nghost-%COMP%] .svg-container[_ngcontent-%COMP%] svg{background-color:#f9fafc}.loading-container[_ngcontent-%COMP%], .error-container[_ngcontent-%COMP%], .no-graph-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:400px;padding:40px}.loading-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .error-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%], .no-graph-container[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-top:16px;font-size:14px;color:var(--mdc-dialog-supporting-text-color)}.error-icon[_ngcontent-%COMP%]{font-size:48px;width:48px;height:48px;color:#f44336}.error-message[_ngcontent-%COMP%]{color:#f44336!important}.large-icon[_ngcontent-%COMP%]{font-size:64px;width:64px;height:64px;color:var(--mdc-dialog-supporting-text-color);opacity:.6}.breadcrumb-container[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;margin-left:8px;padding:0;background-color:transparent;flex-wrap:wrap}.breadcrumb-item[_ngcontent-%COMP%]{background:none;border:none;padding:4px 8px;cursor:pointer;color:var(--mat-sys-primary);font-size:13px;border-radius:4px;transition:background-color .2s}.breadcrumb-item[_ngcontent-%COMP%]:hover:not(:disabled){background-color:var(--mat-sys-surface-container-high)}.breadcrumb-item[_ngcontent-%COMP%]:disabled, .breadcrumb-item.active[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface);cursor:default;font-weight:600}.breadcrumb-separator[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;color:var(--mat-sys-on-surface-variant)}.graph-legend[_ngcontent-%COMP%]{display:flex;align-items:center;gap:16px;margin-right:16px;font-size:13px;color:var(--mat-sys-on-surface-variant);border:1px solid var(--mat-sys-outline-variant);border-radius:8px;padding:6px 16px;background-color:var(--mat-sys-surface-container-lowest)}.graph-legend[_ngcontent-%COMP%] .legend-item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;font-weight:500}"]})};var ysA=["mat-internal-form-field",""],DsA=["*"],C6=(()=>{class i{labelPosition="after";static \u0275fac=function(t){return new(t||i)};static \u0275cmp=vA({type:i,selectors:[["div","mat-internal-form-field",""]],hostAttrs:[1,"mdc-form-field","mat-internal-form-field"],hostVars:2,hostBindings:function(t,n){t&2&&_A("mdc-form-field--align-end",n.labelPosition==="before")},inputs:{labelPosition:"labelPosition"},attrs:ysA,ngContentSelectors:DsA,decls:1,vars:0,template:function(t,n){t&1&&(Ot(),Ze(0))},styles:[`.mat-internal-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;vertical-align:middle}.mat-internal-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mat-internal-form-field>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end .mdc-form-field--align-end label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0} |
| 225 | `],encapsulation:2,changeDetection:0})}return i})();var vsA=["audioPlayer"],GB=class i{base64data=ve("");audioPlayerRef=Yo("audioPlayer");audioSrc="";constructor(){}ngOnChanges(e){e.base64data&&this.base64data()&&this.setAudioSource(this.base64data())}setAudioSource(e){e.startsWith("data:")||e.startsWith("http")||e.startsWith("blob:")?this.audioSrc=e:this.audioSrc=`data:audio/mpeg;base64,${e}`,this.audioPlayerRef()&&this.audioPlayerRef().nativeElement&&this.audioPlayerRef().nativeElement.load()}play(){this.audioPlayerRef()&&this.audioPlayerRef().nativeElement&&this.audioPlayerRef().nativeElement.play()}pause(){this.audioPlayerRef()&&this.audioPlayerRef().nativeElement&&this.audioPlayerRef().nativeElement.pause()}stop(){this.audioPlayerRef()&&this.audioPlayerRef().nativeElement&&(this.audioPlayerRef().nativeElement.pause(),this.audioPlayerRef().nativeElement.currentTime=0)}static \u0275fac=function(A){return new(A||i)};static \u0275cmp=vA({type:i,selectors:[["app-audio-player"]],viewQuery:function(A,t){A&1&&ls(t.audioPlayerRef,vsA,5),A&2&&br()},inputs:{base64data:[1,"base64data"]},features:[ii],decls:3,vars:1,consts:[["audioPlayer",""],["controls","",3,"src"]],template:function(A,t){A&1&&(Ln(0,"div"),$n(1,"audio",1,0),Xn()),A&2&&(Q(),Ma("src",t.audioSrc))},styles:[".audio-player-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;padding:15px;border-radius:8px;box-shadow:0 2px 5px var(--audio-player-container-box-shadow-color);margin:20px auto;max-width:350px}audio[_ngcontent-%COMP%]{outline:none;border-radius:5px;width:350px}.custom-controls[_ngcontent-%COMP%]{margin-top:10px;display:flex;gap:10px}.custom-controls[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:8px 15px;border:none;border-radius:5px;color:var(--audio-player-custom-controls-button-color);cursor:pointer;font-size:14px;transition:background-color .2s ease}"]})};function bsA(i,e){if(i&1){let A=aA();I(0,"div",0)(1,"div",4),D(2),h(),I(3,"button",5),U("click",function(){L(A);let n=p();return G(n.close())}),Et(),I(4,"svg",6),lA(5,"path",7),h()()()}if(i&2){let A=p();Q(),H("title",A.currentUrl),Q(),nA(A.currentUrl)}}function MsA(i,e){if(i&1){let A=aA();I(0,"button",5),U("click",function(){L(A);let n=p();return G(n.close())}),Et(),I(1,"svg",6),lA(2,"path",7),h()()}}function SsA(i,e){if(i&1){let A=aA();I(0,"button",8),U("click",function(){L(A);let n=p();return G(n.prevImage())}),Et(),I(1,"svg",6),lA(2,"path",9),h()(),hr(),I(3,"button",10),U("click",function(){L(A);let n=p();return G(n.nextImage())}),Et(),I(4,"svg",6),lA(5,"path",11),h()(),hr(),I(6,"div",12),D(7),h()}if(i&2){let A=p();H("disabled",A.currentIndex===0),Q(3),H("disabled",A.currentIndex===A.images.length-1),Q(4),Ya("",A.currentIndex+1," / ",A.images.length)}}function ksA(i,e){if(i&1&&lA(0,"div",18),i&2){let A=p(3);H("ngStyle",A.getHighlightStyle())}}function _sA(i,e){if(i&1){let A=aA();I(0,"div",16),U("click",function(n){return n.stopPropagation()})("wheel",function(n){L(A);let o=p(2);return G(o.onWheel(n))})("mousedown",function(n){L(A);let o=p(2);return G(o.onMouseDown(n))})("mousemove",function(n){L(A);let o=p(2);return G(o.onMouseMove(n))})("mouseup",function(){L(A);let n=p(2);return G(n.onMouseUp())})("mouseleave",function(){L(A);let n=p(2);return G(n.onMouseUp())}),lA(1,"img",17),T(2,ksA,1,1,"div",18),h()}if(i&2){let A=p(2);H("ngStyle",A.getTransformStyle()),Q(),H("src",A.displayContent,mo),Q(),O(A.shouldShowHighlight()?2:-1)}}function xsA(i,e){i&1&&(I(0,"div",15),D(1," No image data provided. "),h())}function RsA(i,e){if(i&1){let A=aA();I(0,"div",13),U("click",function(){L(A);let n=p();return G(n.close())}),T(1,_sA,3,3,"div",14),T(2,xsA,2,0,"div",15),h()}if(i&2){let A=p();Q(),O(A.displayContent?1:-1),Q(),O(A.displayContent?-1:2)}}function NsA(i,e){if(i&1&&lA(0,"div",3),i&2){let A=p();H("innerHTML",A.displayContent,Fc)}}var KB=class i{displayContent=null;isSvgContent=!1;images=[];currentIndex=0;currentUrl=null;urls=[];coordinates=[];scale=1;translateX=0;translateY=0;isDragging=!1;startX=0;startY=0;dialogRef=w(zn);data=w(Do);safeValuesService=w(Qs);ngOnInit(){this.images=this.data.images||[],this.currentIndex=this.data.currentIndex||0,this.urls=this.data.urls||[],this.coordinates=this.data.coordinates||[],this.updateImage()}updateImage(){this.scale=1,this.translateX=0,this.translateY=0;let e=this.data.imageData,A="";this.images.length>0&&(e=this.images[this.currentIndex],A=this.urls[this.currentIndex]||""),this.currentUrl=A,this.processImageData(e)}getHighlightStyle(){let e=this.coordinates[this.currentIndex];return e?{left:`${e.x/1e3*100}%`,top:`${e.y/1e3*100}%`}:{}}shouldShowHighlight(){return!!this.coordinates[this.currentIndex]}processImageData(e){if(!e){this.displayContent=null,this.isSvgContent=!1;return}if(e.trim().includes("<svg"))this.isSvgContent=!0,this.displayContent=this.safeValuesService.bypassSecurityTrustHtml(e);else{let A=e.startsWith("data:image/")?"":"data:image/png;base64,";this.isSvgContent=!1,this.displayContent=this.safeValuesService.bypassSecurityTrustUrl(A+e)}}nextImage(){this.currentIndex<this.images.length-1&&(this.currentIndex++,this.updateImage())}prevImage(){this.currentIndex>0&&(this.currentIndex--,this.updateImage())}onWheel(e){e.preventDefault();let A=.1;e.deltaY<0?this.scale+=A:this.scale=Math.max(.5,this.scale-A)}onMouseDown(e){this.isDragging=!0,this.startX=e.clientX-this.translateX,this.startY=e.clientY-this.translateY,e.preventDefault()}onMouseMove(e){this.isDragging&&(this.translateX=e.clientX-this.startX,this.translateY=e.clientY-this.startY)}onMouseUp(){this.isDragging=!1}getTransformStyle(){return{transform:`translate(${this.translateX}px, ${this.translateY}px) scale(${this.scale})`,transformOrigin:"center",cursor:this.isDragging?"grabbing":"grab",transition:this.isDragging?"none":"transform 0.1s ease"}}handleKeyDown(e){e.key==="ArrowLeft"?this.prevImage():e.key==="ArrowRight"&&this.nextImage()}close(){this.dialogRef.close()}static \u0275fac=function(A){return new(A||i)};static \u0275cmp=vA({type:i,selectors:[["app-view-image-dialog"]],hostBindings:function(A,t){A&1&&U("keydown",function(o){return t.handleKeyDown(o)},Fg)},decls:6,vars:4,consts:[[1,"header-bar"],[1,"close-button"],[1,"image-wrapper"],[3,"innerHTML"],[1,"image-title",3,"title"],[1,"close-button",3,"click"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 24 24","fill","currentColor","width","24px","height","24px"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"],[1,"nav-button","prev-button",3,"click","disabled"],["d","M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"],[1,"nav-button","next-button",3,"click","disabled"],["d","M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"],[1,"image-counter"],[1,"image-wrapper",3,"click"],[1,"image-container",2,"position","relative","display","inline-block",3,"ngStyle"],[1,"no-image-placeholder"],[1,"image-container",2,"position","relative","display","inline-block",3,"click","wheel","mousedown","mousemove","mouseup","mouseleave","ngStyle"],["alt","Viewed Image",3,"src"],[1,"highlight-circle",3,"ngStyle"]],template:function(A,t){A&1&&(I(0,"div"),T(1,bsA,6,2,"div",0)(2,MsA,3,0,"button",1),T(3,SsA,8,4),T(4,RsA,3,2,"div",2),T(5,NsA,1,1,"div",3),h()),A&2&&(Q(),O(t.currentUrl?1:2),Q(2),O(t.images.length>1?3:-1),Q(),O(t.isSvgContent?-1:4),Q(),O(t.isSvgContent?5:-1))},dependencies:[vI],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100vw;height:100vh;padding:0;overflow:hidden;background-color:#0009}.close-button[_ngcontent-%COMP%]{position:absolute;top:5px;right:10px;border:none;cursor:pointer;padding:8px;border-radius:50%;transition:background-color .2s ease;color:#fff;background:#00000080;display:flex;align-items:center;justify-content:center;margin-bottom:15px;z-index:30}.close-button[_ngcontent-%COMP%]:hover{background-color:#0000000d}.close-button[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:24px;height:24px;fill:currentColor}.image-wrapper[_ngcontent-%COMP%]{flex-grow:1;display:flex;justify-content:center;align-items:center;overflow:hidden}.image-wrapper[_ngcontent-%COMP%] img[_ngcontent-%COMP%], .image-wrapper[_ngcontent-%COMP%] .svg-container[_ngcontent-%COMP%]{max-width:100%;max-height:100%;object-fit:contain;border-radius:0}.no-image-placeholder[_ngcontent-%COMP%]{color:var(--trace-chart-trace-duration-color);font-style:italic;text-align:center;padding:20px}@media(max-width:1768px){.close-button[_ngcontent-%COMP%]{top:5px;right:5px;padding:5px}}.nav-button[_ngcontent-%COMP%]{position:absolute;top:50%;transform:translateY(-50%);background:#00000080;color:#fff;border:none;border-radius:50%;width:40px;height:40px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background-color .2s ease;z-index:10}.nav-button[_ngcontent-%COMP%]:hover:not(:disabled){background:#000000b3}.nav-button[_ngcontent-%COMP%]:disabled{opacity:.3;cursor:default}.nav-button[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:24px;height:24px;fill:currentColor}.prev-button[_ngcontent-%COMP%]{left:20px}.next-button[_ngcontent-%COMP%]{right:20px}.image-counter[_ngcontent-%COMP%]{position:absolute;bottom:20px;left:50%;transform:translate(-50%);background:#00000080;color:#fff;padding:4px 12px;border-radius:12px;font-size:14px;z-index:10}.header-bar[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;background:#000000b3;color:#fff;z-index:20;display:flex;align-items:center;justify-content:center;padding:8px 40px;box-sizing:border-box}.image-title[_ngcontent-%COMP%]{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:90%}.header-bar[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]{position:absolute;top:50%;right:10px;transform:translateY(-50%);color:#fff;margin-bottom:0;background:transparent}.header-bar[_ngcontent-%COMP%] .close-button[_ngcontent-%COMP%]:hover{background-color:#ffffff1a}.highlight-circle[_ngcontent-%COMP%]{position:absolute;width:30px;height:30px;border-radius:50%;background-color:#ff000080;border:2px solid red;transform:translate(-50%,-50%);pointer-events:none;z-index:5}"]})};function FsA(i,e){i&1&&(I(0,"mat-icon",4),D(1,"image"),h())}function LsA(i,e){i&1&&(I(0,"mat-icon",4),D(1,"audiotrack"),h())}function GsA(i,e){i&1&&(I(0,"mat-icon",4),D(1,"movie"),h())}function KsA(i,e){i&1&&(I(0,"mat-icon",4),D(1,"description"),h())}function UsA(i,e){i&1&&(I(0,"mat-icon",4),D(1,"text_snippet"),h())}function TsA(i,e){if(i&1&&T(0,KsA,2,0,"mat-icon",4)(1,UsA,2,0,"mat-icon",4),i&2){let A=p().$index,t=p();O(t.selectedArtifacts[A].mimeType==="text/html"?0:1)}}function OsA(i,e){i&1&&(I(0,"mat-icon",4),D(1,"insert_drive_file"),h())}function JsA(i,e){if(i&1&&(I(0,"mat-option",12),D(1),h()),i&2){let A=e.$implicit;H("value",A),Q(),nA(A.versionId)}}function YsA(i,e){if(i&1){let A=aA();I(0,"div",15)(1,"img",18),U("click",function(){L(A);let n=p().$index,o=p();return G(o.openViewImageDialog(o.selectedArtifacts[n].data))}),h()()}if(i&2){let A=p().$index,t=p();Q(),H("src",t.selectedArtifacts[A].data??"",mo)}}function HsA(i,e){if(i&1&&(I(0,"div",16),lA(1,"app-audio-player",19),h()),i&2){let A=p().$index,t=p();Q(),H("base64data",t.selectedArtifacts[A].data)}}function zsA(i,e){if(i&1&&(I(0,"div",17),lA(1,"video",20),h()),i&2){let A=p().$index,t=p();Q(),H("src",t.selectedArtifacts[A].data,mo)}}function PsA(i,e){if(i&1){let A=aA();I(0,"div",21)(1,"mat-icon",23),D(2,"description"),h(),I(3,"a",24),U("click",function(){L(A);let n=p(2).$index,o=p();return G(o.openArtifact(o.selectedArtifacts[n].data,o.selectedArtifacts[n].mimeType))}),D(4," Preview in new tab "),h()()}}function jsA(i,e){if(i&1&&(I(0,"div",22)(1,"pre",25),D(2),h()()),i&2){let A=p(2).$index,t=p();Q(2),nA(t.getTextContent(t.selectedArtifacts[A].data))}}function VsA(i,e){if(i&1&&T(0,PsA,5,0,"div",21)(1,jsA,3,1,"div",22),i&2){let A=p().$index,t=p();O(t.selectedArtifacts[A].mimeType==="text/html"?0:1)}}function qsA(i,e){if(i&1){let A=aA();I(0,"div",1)(1,"div",2)(2,"div",3),T(3,FsA,2,0,"mat-icon",4)(4,LsA,2,0,"mat-icon",4)(5,GsA,2,0,"mat-icon",4)(6,TsA,2,1)(7,OsA,2,0,"mat-icon",4),I(8,"button",5),U("click",function(){let n=L(A).$index,o=p();return G(o.openArtifact(o.selectedArtifacts[n].data,o.selectedArtifacts[n].mimeType))}),I(9,"span",6),D(10),h(),I(11,"mat-icon",7),D(12,"open_in_new"),h()()(),I(13,"div",8)(14,"div",9)(15,"span",10),D(16,"Version:"),h(),I(17,"mat-select",11),Ni("ngModelChange",function(n){let o=L(A).$index,a=p();return wi(a.selectedArtifacts[o],n)||(a.selectedArtifacts[o]=n),G(n)}),U("selectionChange",function(n){let o=L(A).$index,a=p();return G(a.onArtifactVersionChange(n,o))}),ke(18,JsA,2,2,"mat-option",12,ni),h()(),I(20,"button",13),U("click",function(){let n=L(A).$index,o=p();return G(o.downloadArtifact(o.selectedArtifacts[n]))}),I(21,"mat-icon"),D(22,"file_download"),h()()()(),I(23,"div",14),T(24,YsA,2,1,"div",15)(25,HsA,2,1,"div",16)(26,zsA,2,1,"div",17)(27,VsA,2,1),h()()}if(i&2){let A,t,n=e.$implicit,o=e.$index,a=p();Q(3),O((A=a.selectedArtifacts[o].mediaType)===a.MediaType.IMAGE?3:A===a.MediaType.AUDIO?4:A===a.MediaType.VIDEO?5:A===a.MediaType.TEXT?6:7),Q(5),H("matTooltip","Open in new tab"),Q(2),nA(a.getArtifactName(n)),Q(7),Ri("ngModel",a.selectedArtifacts[o]),Q(),_e(a.getSortedArtifactsFromId(n)),Q(2),H("matTooltip","Download artifact"),Q(4),O((t=a.selectedArtifacts[o].mediaType)===a.MediaType.IMAGE?24:t===a.MediaType.AUDIO?25:t===a.MediaType.VIDEO?26:t===a.MediaType.TEXT?27:-1)}}var WsA="default_artifact_name",iC=(o=>(o.IMAGE="image",o.AUDIO="audio",o.VIDEO="video",o.TEXT="text",o.UNSPECIFIED="unspecified",o))(iC||{});function I6(i){let e=i.toLowerCase();for(let A of Object.values(iC))if(A!=="unspecified"&&e.startsWith(A+"/"))return A;return"unspecified"}function ZsA(i){return i?i.startsWith("image/"):!1}function XsA(i){return i?i.startsWith("audio/"):!1}var d6=class i{artifacts=ve([]);selectedArtifacts=[];isArtifactAudio=XsA;isArtifactImage=ZsA;MediaType=iC;downloadService=w(QB);dialog=w(Xa);safeValuesService=w(Qs);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??WsA}getDistinctArtifactIds(){return[...new Set(this.artifacts().map(e=>e.id))]}getSortedArtifactsFromId(e){return this.artifacts().filter(A=>A.id===e).sort((A,t)=>t.versionId-A.versionId)}getTextContent(e){if(!e)return"";let A=e.indexOf(",");if(A===-1)return"";let t=e.substring(A+1);try{return atob(t)}catch(n){return"Failed to decode text content"}}onArtifactVersionChange(e,A){this.selectedArtifacts[A]=e.value}openViewImageDialog(e){if(!e||!e.startsWith("data:")||e.indexOf(";base64,")===-1)return;let A=this.dialog.open(KB,{maxWidth:"90vw",maxHeight:"90vh",data:{imageData:e}})}openArtifact(e,A){this.openBase64InNewTab(e,A)}openBase64InNewTab(e,A){this.safeValuesService.openBase64InNewTab(e,A)}static \u0275fac=function(A){return new(A||i)};static \u0275cmp=vA({type:i,selectors:[["app-artifact-tab"]],inputs:{artifacts:[1,"artifacts"]},features:[ii],decls:3,vars:0,consts:[[1,"artifact-container"],[1,"artifact-card"],[1,"artifact-card-header"],[1,"artifact-title-group"],[1,"artifact-icon"],[1,"artifact-title-link",3,"click","matTooltip"],[1,"title-text"],[1,"open-icon"],[1,"artifact-actions"],[1,"version-selector"],[1,"version-label"],["panelClass","compact-select-panel",1,"compact-select",3,"ngModelChange","selectionChange","ngModel"],[3,"value"],["mat-icon-button","",1,"compact-action-button",3,"click","matTooltip"],[1,"artifact-card-content"],[1,"preview-image-container"],[1,"preview-audio-container"],[1,"preview-video-container"],["alt","artifact.id",1,"preview-image",3,"click","src"],[3,"base64data"],["controls","",1,"preview-video",3,"src"],[1,"preview-html-container"],[1,"preview-text-container"],[1,"html-icon"],[1,"html-link",3,"click"],[1,"preview-text"]],template:function(A,t){A&1&&(I(0,"div",0),ke(1,qsA,28,6,"div",1,ni),h()),A&2&&(Q(),_e(t.getDistinctArtifactIds()))},dependencies:[ig,fn,Kn,Ho,Vr,yi,zt,GB,rn],styles:[".artifact-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;padding:8px}.artifact-card[_ngcontent-%COMP%]{background-color:var(--mat-sys-surface-container-low);border-radius:8px;overflow:hidden;display:flex;flex-direction:column;box-shadow:0 2px 8px #0000001a}.artifact-card-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:6px 12px;background-color:var(--mat-sys-surface-container);flex-wrap:wrap;gap:8px}.artifact-title-group[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex:1;min-width:200px}.artifact-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary);font-size:20px;width:20px;height:20px}.artifact-title-link[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;border:none;background:none;padding:0;font-family:inherit;color:var(--mat-sys-on-surface);cursor:pointer;max-width:250px}.artifact-title-link[_ngcontent-%COMP%]:hover{color:var(--mat-sys-primary);text-decoration:underline}.artifact-title-link[_ngcontent-%COMP%]:focus{outline:2px solid var(--mat-sys-primary);outline-offset:2px;border-radius:2px}.title-text[_ngcontent-%COMP%]{font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.open-icon[_ngcontent-%COMP%]{font-size:14px;width:14px;height:14px;flex-shrink:0}.artifact-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.version-selector[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px}.version-label[_ngcontent-%COMP%]{font-size:12px;color:var(--mat-sys-on-surface-variant);font-weight:500}.compact-select[_ngcontent-%COMP%]{width:50px;font-size:10px}.compact-select[_ngcontent-%COMP%] .mat-mdc-select-trigger{padding:2px 4px}.compact-select[_ngcontent-%COMP%] .mat-mdc-select-value{font-size:10px} .compact-select-panel{font-size:10px!important} .compact-select-panel .mat-mdc-option{font-size:10px!important;min-height:28px!important;padding:0 8px!important} .compact-select-panel .mat-mdc-option-pseudo-checkbox{transform:scale(.7)!important}.compact-action-button[_ngcontent-%COMP%]{width:32px;height:32px;display:flex;justify-content:center;align-items:center}.compact-action-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px}.artifact-card-content[_ngcontent-%COMP%]{padding:8px 12px;background-color:var(--mat-sys-surface-container-lowest)}.preview-image-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center}.preview-image[_ngcontent-%COMP%]{max-width:100%;max-height:300px;border-radius:8px;cursor:pointer}.preview-audio-container[_ngcontent-%COMP%]{width:100%}.preview-video-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center}.preview-video[_ngcontent-%COMP%]{max-width:100%;border-radius:8px}.preview-html-container[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;justify-content:center;padding:20px}.html-icon[_ngcontent-%COMP%]{color:var(--mat-sys-primary)}.html-link[_ngcontent-%COMP%]{color:var(--mat-sys-primary);text-decoration:underline;cursor:pointer;font-weight:500;font-size:14px}.html-link[_ngcontent-%COMP%]:hover{color:var(--mat-sys-primary-dark)}.preview-text-container[_ngcontent-%COMP%]{max-height:200px;overflow-y:auto;background:var(--mat-sys-surface-container-highest);padding:12px;border-radius:8px}.preview-text[_ngcontent-%COMP%]{margin:0;white-space:pre-wrap;font-family:Roboto Mono,monospace;font-size:12px;color:var(--mat-sys-on-surface)}"]})};var $sA=["input"],AlA=["label"],elA=["*"],tM={color:"accent",clickAction:"check-indeterminate",disabledInteractive:!1},tlA=new MA("mat-checkbox-default-options",{providedIn:"root",factory:()=>tM}),fs=(function(i){return i[i.Init=0]="Init",i[i.Checked=1]="Checked",i[i.Unchecked=2]="Unchecked",i[i.Indeterminate=3]="Indeterminate",i})(fs||{}),iM=class{source;checked},ic=(()=>{class i{_elementRef=w(ce);_changeDetectorRef=w(Mt);_ngZone=w(We);_animationsDisabled=In();_options=w(tlA,{optional:!0});focus(){this._inputElement.nativeElement.focus()}_createChangeEvent(A){let t=new iM;return t.source=this,t.checked=A,t}_getAnimationTargetElement(){return this._inputElement?.nativeElement}_animationClasses={uncheckedToChecked:"mdc-checkbox--anim-unchecked-checked",uncheckedToIndeterminate:"mdc-checkbox--anim-unchecked-indeterminate",checkedToUnchecked:"mdc-checkbox--anim-checked-unchecked",checkedToIndeterminate:"mdc-checkbox--anim-checked-indeterminate",indeterminateToChecked:"mdc-checkbox--anim-indeterminate-checked",indeterminateToUnchecked:"mdc-checkbox--anim-indeterminate-unchecked"};ariaLabel="";ariaLabelledby=null;ariaDescribedby;ariaExpanded;ariaControls;ariaOwns;_uniqueId;id;get inputId(){return`${this.id||this._uniqueId}-input`}required=!1;labelPosition="after";name=null;change=new FA;indeterminateChange=new FA;value;disableRipple=!1;_inputElement;_labelElement;tabIndex;color;disabledInteractive;_onTouched=()=>{};_currentAnimationClass="";_currentCheckState=fs.Init;_controlValueAccessorChangeFn=()=>{};_validatorChangeFn=()=>{};constructor(){w(Eo).load(Qr);let A=w(new Ys("tabindex"),{optional:!0});this._options=this._options||tM,this.color=this._options.color||tM.color,this.tabIndex=A==null?0:parseInt(A)||0,this.id=this._uniqueId=w(Dn).getId("mat-mdc-checkbox-"),this.disabledInteractive=this._options?.disabledInteractive??!1}ngOnChanges(A){A.required&&this._validatorChangeFn()}ngAfterViewInit(){this._syncIndeterminate(this.indeterminate)}get checked(){return this._checked}set checked(A){A!=this.checked&&(this._checked=A,this._changeDetectorRef.markForCheck())}_checked=!1;get disabled(){return this._disabled}set disabled(A){A!==this.disabled&&(this._disabled=A,this._changeDetectorRef.markForCheck())}_disabled=!1;get indeterminate(){return this._indeterminate()}set indeterminate(A){let t=A!=this._indeterminate();this._indeterminate.set(A),t&&(A?this._transitionCheckState(fs.Indeterminate):this._transitionCheckState(this.checked?fs.Checked:fs.Unchecked),this.indeterminateChange.emit(A)),this._syncIndeterminate(A)}_indeterminate=mA(!1);_isRippleDisabled(){return this.disableRipple||this.disabled}_onLabelTextChange(){this._changeDetectorRef.detectChanges()}writeValue(A){this.checked=!!A}registerOnChange(A){this._controlValueAccessorChangeFn=A}registerOnTouched(A){this._onTouched=A}setDisabledState(A){this.disabled=A}validate(A){return this.required&&A.value!==!0?{required:!0}:null}registerOnValidatorChange(A){this._validatorChangeFn=A}_transitionCheckState(A){let t=this._currentCheckState,n=this._getAnimationTargetElement();if(!(t===A||!n)&&(this._currentAnimationClass&&n.classList.remove(this._currentAnimationClass),this._currentAnimationClass=this._getAnimationClassForCheckStateTransition(t,A),this._currentCheckState=A,this._currentAnimationClass.length>0)){n.classList.add(this._currentAnimationClass);let o=this._currentAnimationClass;this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{n.classList.remove(o)},1e3)})}}_emitChangeEvent(){this._controlValueAccessorChangeFn(this.checked),this.change.emit(this._createChangeEvent(this.checked)),this._inputElement&&(this._inputElement.nativeElement.checked=this.checked)}toggle(){this.checked=!this.checked,this._controlValueAccessorChangeFn(this.checked)}_handleInputClick(){let A=this._options?.clickAction;!this.disabled&&A!=="noop"?(this.indeterminate&&A!=="check"&&Promise.resolve().then(()=>{this._indeterminate.set(!1),this.indeterminateChange.emit(!1)}),this._checked=!this._checked,this._transitionCheckState(this._checked?fs.Checked:fs.Unchecked),this._emitChangeEvent()):(this.disabled&&this.disabledInteractive||!this.disabled&&A==="noop")&&(this._inputElement.nativeElement.checked=this.checked,this._inputElement.nativeElement.indeterminate=this.indeterminate)}_onInteractionEvent(A){A.stopPropagation()}_onBlur(){Promise.resolve().then(()=>{this._onTouched(),this._changeDetectorRef.markForCheck()})}_getAnimationClassForCheckStateTransition(A,t){if(this._animationsDisabled)return"";switch(A){case fs.Init:if(t===fs.Checked)return this._animationClasses.uncheckedToChecked;if(t==fs.Indeterminate)return this._checked?this._animationClasses.checkedToIndeterminate:this._animationClasses.uncheckedToIndeterminate;break;case fs.Unchecked:return t===fs.Checked?this._animationClasses.uncheckedToChecked:this._animationClasses.uncheckedToIndeterminate;case fs.Checked:return t===fs.Unchecked?this._animationClasses.checkedToUnchecked:this._animationClasses.checkedToIndeterminate;case fs.Indeterminate:return t===fs.Checked?this._animationClasses.indeterminateToChecked:this._animationClasses.indeterminateToUnchecked}return""}_syncIndeterminate(A){let t=this._inputElement;t&&(t.nativeElement.indeterminate=A)}_onInputClick(){this._handleInputClick()}_onTouchTargetClick(){this._handleInputClick(),this.disabled||this._inputElement.nativeElement.focus()}_preventBubblingFromLabel(A){A.target&&this._labelElement.nativeElement.contains(A.target)&&A.stopPropagation()}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=vA({type:i,selectors:[["mat-checkbox"]],viewQuery:function(t,n){if(t&1&&Wt($sA,5)(AlA,5),t&2){let o;se(o=le())&&(n._inputElement=o.first),se(o=le())&&(n._labelElement=o.first)}},hostAttrs:[1,"mat-mdc-checkbox"],hostVars:16,hostBindings:function(t,n){t&2&&(Ma("id",n.id),ie("tabindex",null)("aria-label",null)("aria-labelledby",null),Ao(n.color?"mat-"+n.color:"mat-accent"),_A("_mat-animation-noopable",n._animationsDisabled)("mdc-checkbox--disabled",n.disabled)("mat-mdc-checkbox-disabled",n.disabled)("mat-mdc-checkbox-checked",n.checked)("mat-mdc-checkbox-disabled-interactive",n.disabledInteractive))},inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],ariaDescribedby:[0,"aria-describedby","ariaDescribedby"],ariaExpanded:[2,"aria-expanded","ariaExpanded",Qe],ariaControls:[0,"aria-controls","ariaControls"],ariaOwns:[0,"aria-owns","ariaOwns"],id:"id",required:[2,"required","required",Qe],labelPosition:"labelPosition",name:"name",value:"value",disableRipple:[2,"disableRipple","disableRipple",Qe],tabIndex:[2,"tabIndex","tabIndex",A=>A==null?void 0:yn(A)],color:"color",disabledInteractive:[2,"disabledInteractive","disabledInteractive",Qe],checked:[2,"checked","checked",Qe],disabled:[2,"disabled","disabled",Qe],indeterminate:[2,"indeterminate","indeterminate",Qe]},outputs:{change:"change",indeterminateChange:"indeterminateChange"},exportAs:["matCheckbox"],features:[pt([{provide:cs,useExisting:Va(()=>i),multi:!0},{provide:Oc,useExisting:i,multi:!0}]),ii],ngContentSelectors:elA,decls:15,vars:23,consts:[["checkbox",""],["input",""],["label",""],["mat-internal-form-field","",3,"click","labelPosition"],[1,"mdc-checkbox"],["aria-hidden","true",1,"mat-mdc-checkbox-touch-target",3,"click"],["type","checkbox",1,"mdc-checkbox__native-control",3,"blur","click","change","checked","indeterminate","disabled","id","required","tabIndex"],["aria-hidden","true",1,"mdc-checkbox__ripple"],["aria-hidden","true",1,"mdc-checkbox__background"],["focusable","false","viewBox","0 0 24 24",1,"mdc-checkbox__checkmark"],["fill","none","d","M1.73,12.91 8.1,19.28 22.79,4.59",1,"mdc-checkbox__checkmark-path"],[1,"mdc-checkbox__mixedmark"],["mat-ripple","","aria-hidden","true",1,"mat-mdc-checkbox-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled","matRippleCentered"],[1,"mdc-label",3,"for"]],template:function(t,n){if(t&1&&(Ot(),I(0,"div",3),U("click",function(a){return n._preventBubblingFromLabel(a)}),I(1,"div",4,0)(3,"div",5),U("click",function(){return n._onTouchTargetClick()}),h(),I(4,"input",6,1),U("blur",function(){return n._onBlur()})("click",function(){return n._onInputClick()})("change",function(a){return n._onInteractionEvent(a)}),h(),lA(6,"div",7),I(7,"div",8),Et(),I(8,"svg",9),lA(9,"path",10),h(),hr(),lA(10,"div",11),h(),lA(11,"div",12),h(),I(12,"label",13,2),Ze(14),h()()),t&2){let o=Bi(2);H("labelPosition",n.labelPosition),Q(4),_A("mdc-checkbox--selected",n.checked),H("checked",n.checked)("indeterminate",n.indeterminate)("disabled",n.disabled&&!n.disabledInteractive)("id",n.inputId)("required",n.required)("tabIndex",n.disabled&&!n.disabledInteractive?-1:n.tabIndex),ie("aria-label",n.ariaLabel||null)("aria-labelledby",n.ariaLabelledby)("aria-describedby",n.ariaDescribedby)("aria-checked",n.indeterminate?"mixed":null)("aria-controls",n.ariaControls)("aria-disabled",n.disabled&&n.disabledInteractive?!0:null)("aria-expanded",n.ariaExpanded)("aria-owns",n.ariaOwns)("name",n.name)("value",n.value),Q(7),H("matRippleTrigger",o)("matRippleDisabled",n.disableRipple||n.disabled)("matRippleCentered",!0),Q(),H("for",n.inputId)}},dependencies:[Cs,C6],styles:[`.mdc-checkbox{display:inline-block;position:relative;flex:0 0 18px;box-sizing:content-box;width:18px;height:18px;line-height:0;white-space:nowrap;cursor:pointer;vertical-align:bottom;padding:calc((var(--mat-checkbox-state-layer-size, 40px) - 18px)/2);margin:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2)}.mdc-checkbox:hover>.mdc-checkbox__ripple{opacity:var(--mat-checkbox-unselected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity));background-color:var(--mat-checkbox-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox:hover>.mat-mdc-checkbox-ripple>.mat-ripple-element{background-color:var(--mat-checkbox-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox .mdc-checkbox__native-control:focus+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-unselected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity));background-color:var(--mat-checkbox-unselected-focus-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox .mdc-checkbox__native-control:focus~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-unselected-focus-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox:active>.mdc-checkbox__native-control+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-unselected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));background-color:var(--mat-checkbox-unselected-pressed-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:active>.mdc-checkbox__native-control~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-unselected-pressed-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:hover>.mdc-checkbox__native-control:checked+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-selected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity));background-color:var(--mat-checkbox-selected-hover-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:hover>.mdc-checkbox__native-control:checked~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-selected-hover-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox .mdc-checkbox__native-control:focus:checked+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-selected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity));background-color:var(--mat-checkbox-selected-focus-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox .mdc-checkbox__native-control:focus:checked~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-selected-focus-state-layer-color, var(--mat-sys-primary))}.mdc-checkbox:active>.mdc-checkbox__native-control:checked+.mdc-checkbox__ripple{opacity:var(--mat-checkbox-selected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity));background-color:var(--mat-checkbox-selected-pressed-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox:active>.mdc-checkbox__native-control:checked~.mat-mdc-checkbox-ripple .mat-ripple-element{background-color:var(--mat-checkbox-selected-pressed-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control~.mat-mdc-checkbox-ripple .mat-ripple-element,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control+.mdc-checkbox__ripple{background-color:var(--mat-checkbox-unselected-hover-state-layer-color, var(--mat-sys-on-surface))}.mdc-checkbox .mdc-checkbox__native-control{position:absolute;margin:0;padding:0;opacity:0;cursor:inherit;z-index:1;width:var(--mat-checkbox-state-layer-size, 40px);height:var(--mat-checkbox-state-layer-size, 40px);top:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2);right:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2);left:calc((var(--mat-checkbox-state-layer-size, 40px) - var(--mat-checkbox-state-layer-size, 40px))/2)}.mdc-checkbox--disabled{cursor:default;pointer-events:none}.mdc-checkbox__background{display:inline-flex;position:absolute;align-items:center;justify-content:center;box-sizing:border-box;width:18px;height:18px;border:2px solid currentColor;border-radius:2px;background-color:rgba(0,0,0,0);pointer-events:none;will-change:background-color,border-color;transition:background-color 90ms cubic-bezier(0.4, 0, 0.6, 1),border-color 90ms cubic-bezier(0.4, 0, 0.6, 1);-webkit-print-color-adjust:exact;color-adjust:exact;border-color:var(--mat-checkbox-unselected-icon-color, var(--mat-sys-on-surface-variant));top:calc((var(--mat-checkbox-state-layer-size, 40px) - 18px)/2);left:calc((var(--mat-checkbox-state-layer-size, 40px) - 18px)/2)}.mdc-checkbox__native-control:enabled:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:enabled:indeterminate~.mdc-checkbox__background{border-color:var(--mat-checkbox-selected-icon-color, var(--mat-sys-primary));background-color:var(--mat-checkbox-selected-icon-color, var(--mat-sys-primary))}.mdc-checkbox--disabled .mdc-checkbox__background{border-color:var(--mat-checkbox-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-checkbox--disabled .mdc-checkbox__background{border-color:GrayText}}.mdc-checkbox__native-control:disabled:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:disabled:indeterminate~.mdc-checkbox__background{background-color:var(--mat-checkbox-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:rgba(0,0,0,0)}@media(forced-colors: active){.mdc-checkbox__native-control:disabled:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:disabled:indeterminate~.mdc-checkbox__background{border-color:GrayText}}.mdc-checkbox:hover>.mdc-checkbox__native-control:not(:checked)~.mdc-checkbox__background,.mdc-checkbox:hover>.mdc-checkbox__native-control:not(:indeterminate)~.mdc-checkbox__background{border-color:var(--mat-checkbox-unselected-hover-icon-color, var(--mat-sys-on-surface));background-color:rgba(0,0,0,0)}.mdc-checkbox:hover>.mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox:hover>.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background{border-color:var(--mat-checkbox-selected-hover-icon-color, var(--mat-sys-primary));background-color:var(--mat-checkbox-selected-hover-icon-color, var(--mat-sys-primary))}.mdc-checkbox__native-control:focus:focus:not(:checked)~.mdc-checkbox__background,.mdc-checkbox__native-control:focus:focus:not(:indeterminate)~.mdc-checkbox__background{border-color:var(--mat-checkbox-unselected-focus-icon-color, var(--mat-sys-on-surface))}.mdc-checkbox__native-control:focus:focus:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:focus:focus:indeterminate~.mdc-checkbox__background{border-color:var(--mat-checkbox-selected-focus-icon-color, var(--mat-sys-primary));background-color:var(--mat-checkbox-selected-focus-icon-color, var(--mat-sys-primary))}.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox:hover>.mdc-checkbox__native-control~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control:focus~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__background{border-color:var(--mat-checkbox-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox:hover>.mdc-checkbox__native-control~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox .mdc-checkbox__native-control:focus~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__background{border-color:GrayText}}.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background{background-color:var(--mat-checkbox-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:rgba(0,0,0,0)}.mdc-checkbox__checkmark{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;opacity:0;transition:opacity 180ms cubic-bezier(0.4, 0, 0.6, 1);color:var(--mat-checkbox-selected-checkmark-color, var(--mat-sys-on-primary))}@media(forced-colors: active){.mdc-checkbox__checkmark{color:CanvasText}}.mdc-checkbox--disabled .mdc-checkbox__checkmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__checkmark{color:var(--mat-checkbox-disabled-selected-checkmark-color, var(--mat-sys-surface))}@media(forced-colors: active){.mdc-checkbox--disabled .mdc-checkbox__checkmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__checkmark{color:GrayText}}.mdc-checkbox__checkmark-path{transition:stroke-dashoffset 180ms cubic-bezier(0.4, 0, 0.6, 1);stroke:currentColor;stroke-width:3.12px;stroke-dashoffset:29.7833385;stroke-dasharray:29.7833385}.mdc-checkbox__mixedmark{width:100%;height:0;transform:scaleX(0) rotate(0deg);border-width:1px;border-style:solid;opacity:0;transition:opacity 90ms cubic-bezier(0.4, 0, 0.6, 1),transform 90ms cubic-bezier(0.4, 0, 0.6, 1);border-color:var(--mat-checkbox-selected-checkmark-color, var(--mat-sys-on-primary))}@media(forced-colors: active){.mdc-checkbox__mixedmark{margin:0 1px}}.mdc-checkbox--disabled .mdc-checkbox__mixedmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__mixedmark{border-color:var(--mat-checkbox-disabled-selected-checkmark-color, var(--mat-sys-surface))}@media(forced-colors: active){.mdc-checkbox--disabled .mdc-checkbox__mixedmark,.mdc-checkbox--disabled.mat-mdc-checkbox-disabled-interactive .mdc-checkbox__mixedmark{border-color:GrayText}}.mdc-checkbox--anim-unchecked-checked .mdc-checkbox__background,.mdc-checkbox--anim-unchecked-indeterminate .mdc-checkbox__background,.mdc-checkbox--anim-checked-unchecked .mdc-checkbox__background,.mdc-checkbox--anim-indeterminate-unchecked .mdc-checkbox__background{animation-duration:180ms;animation-timing-function:linear}.mdc-checkbox--anim-unchecked-checked .mdc-checkbox__checkmark-path{animation:mdc-checkbox-unchecked-checked-checkmark-path 180ms linear;transition:none}.mdc-checkbox--anim-unchecked-indeterminate .mdc-checkbox__mixedmark{animation:mdc-checkbox-unchecked-indeterminate-mixedmark 90ms linear;transition:none}.mdc-checkbox--anim-checked-unchecked .mdc-checkbox__checkmark-path{animation:mdc-checkbox-checked-unchecked-checkmark-path 90ms linear;transition:none}.mdc-checkbox--anim-checked-indeterminate .mdc-checkbox__checkmark{animation:mdc-checkbox-checked-indeterminate-checkmark 90ms linear;transition:none}.mdc-checkbox--anim-checked-indeterminate .mdc-checkbox__mixedmark{animation:mdc-checkbox-checked-indeterminate-mixedmark 90ms linear;transition:none}.mdc-checkbox--anim-indeterminate-checked .mdc-checkbox__checkmark{animation:mdc-checkbox-indeterminate-checked-checkmark 500ms linear;transition:none}.mdc-checkbox--anim-indeterminate-checked .mdc-checkbox__mixedmark{animation:mdc-checkbox-indeterminate-checked-mixedmark 500ms linear;transition:none}.mdc-checkbox--anim-indeterminate-unchecked .mdc-checkbox__mixedmark{animation:mdc-checkbox-indeterminate-unchecked-mixedmark 300ms linear;transition:none}.mdc-checkbox__native-control:checked~.mdc-checkbox__background,.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background{transition:border-color 90ms cubic-bezier(0, 0, 0.2, 1),background-color 90ms cubic-bezier(0, 0, 0.2, 1)}.mdc-checkbox__native-control:checked~.mdc-checkbox__background>.mdc-checkbox__checkmark>.mdc-checkbox__checkmark-path,.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background>.mdc-checkbox__checkmark>.mdc-checkbox__checkmark-path{stroke-dashoffset:0}.mdc-checkbox__native-control:checked~.mdc-checkbox__background>.mdc-checkbox__checkmark{transition:opacity 180ms cubic-bezier(0, 0, 0.2, 1),transform 180ms cubic-bezier(0, 0, 0.2, 1);opacity:1}.mdc-checkbox__native-control:checked~.mdc-checkbox__background>.mdc-checkbox__mixedmark{transform:scaleX(1) rotate(-45deg)}.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background>.mdc-checkbox__checkmark{transform:rotate(45deg);opacity:0;transition:opacity 90ms cubic-bezier(0.4, 0, 0.6, 1),transform 90ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-checkbox__native-control:indeterminate~.mdc-checkbox__background>.mdc-checkbox__mixedmark{transform:scaleX(1) rotate(0deg);opacity:1}@keyframes mdc-checkbox-unchecked-checked-checkmark-path{0%,50%{stroke-dashoffset:29.7833385}50%{animation-timing-function:cubic-bezier(0, 0, 0.2, 1)}100%{stroke-dashoffset:0}}@keyframes mdc-checkbox-unchecked-indeterminate-mixedmark{0%,68.2%{transform:scaleX(0)}68.2%{animation-timing-function:cubic-bezier(0, 0, 0, 1)}100%{transform:scaleX(1)}}@keyframes mdc-checkbox-checked-unchecked-checkmark-path{from{animation-timing-function:cubic-bezier(0.4, 0, 1, 1);opacity:1;stroke-dashoffset:0}to{opacity:0;stroke-dashoffset:-29.7833385}}@keyframes mdc-checkbox-checked-indeterminate-checkmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 1);transform:rotate(0deg);opacity:1}to{transform:rotate(45deg);opacity:0}}@keyframes mdc-checkbox-indeterminate-checked-checkmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);transform:rotate(45deg);opacity:0}to{transform:rotate(360deg);opacity:1}}@keyframes mdc-checkbox-checked-indeterminate-mixedmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 1);transform:rotate(-45deg);opacity:0}to{transform:rotate(0deg);opacity:1}}@keyframes mdc-checkbox-indeterminate-checked-mixedmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);transform:rotate(0deg);opacity:1}to{transform:rotate(315deg);opacity:0}}@keyframes mdc-checkbox-indeterminate-unchecked-mixedmark{0%{animation-timing-function:linear;transform:scaleX(1);opacity:1}32.8%,100%{transform:scaleX(0);opacity:0}}.mat-mdc-checkbox{display:inline-block;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mat-mdc-checkbox-touch-target,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__native-control,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__ripple,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mat-mdc-checkbox-ripple::before,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background>.mdc-checkbox__checkmark,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background>.mdc-checkbox__checkmark>.mdc-checkbox__checkmark-path,.mat-mdc-checkbox._mat-animation-noopable>.mat-internal-form-field>.mdc-checkbox>.mdc-checkbox__background>.mdc-checkbox__mixedmark{transition:none !important;animation:none !important}.mat-mdc-checkbox label{cursor:pointer}.mat-mdc-checkbox .mat-internal-form-field{color:var(--mat-checkbox-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-checkbox-label-text-font, var(--mat-sys-body-medium-font));line-height:var(--mat-checkbox-label-text-line-height, var(--mat-sys-body-medium-line-height));font-size:var(--mat-checkbox-label-text-size, var(--mat-sys-body-medium-size));letter-spacing:var(--mat-checkbox-label-text-tracking, var(--mat-sys-body-medium-tracking));font-weight:var(--mat-checkbox-label-text-weight, var(--mat-sys-body-medium-weight))}.mat-mdc-checkbox.mat-mdc-checkbox-disabled.mat-mdc-checkbox-disabled-interactive{pointer-events:auto}.mat-mdc-checkbox.mat-mdc-checkbox-disabled.mat-mdc-checkbox-disabled-interactive input{cursor:default}.mat-mdc-checkbox.mat-mdc-checkbox-disabled label{cursor:default;color:var(--mat-checkbox-disabled-label-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}@media(forced-colors: active){.mat-mdc-checkbox.mat-mdc-checkbox-disabled label{color:GrayText}}.mat-mdc-checkbox label:empty{display:none}.mat-mdc-checkbox .mdc-checkbox__ripple{opacity:0}.mat-mdc-checkbox .mat-mdc-checkbox-ripple,.mdc-checkbox__ripple{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:50%;pointer-events:none}.mat-mdc-checkbox .mat-mdc-checkbox-ripple:not(:empty),.mdc-checkbox__ripple:not(:empty){transform:translateZ(0)}.mat-mdc-checkbox-ripple .mat-ripple-element{opacity:.1}.mat-mdc-checkbox-touch-target{position:absolute;top:50%;left:50%;height:var(--mat-checkbox-touch-target-size, 48px);width:var(--mat-checkbox-touch-target-size, 48px);transform:translate(-50%, -50%);display:var(--mat-checkbox-touch-target-display, block)}.mat-mdc-checkbox .mat-mdc-checkbox-ripple::before{border-radius:50%}.mdc-checkbox__native-control:focus-visible~.mat-focus-indicator::before{content:""} |
| 226 | `],encapsulation:2,changeDetection:0})}return i})(),uO=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=et({type:i});static \u0275inj=At({imports:[ic,Di]})}return i})();var pO=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=et({type:i});static \u0275inj=At({})}return i})();var fO=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=et({type:i});static \u0275inj=At({imports:[pO,Wc,Di]})}return i})();var nlA={google_search:"search",EnterpriseWebSearchTool:"web",VertexAiSearchTool:"search",FilesRetrieval:"find_in_page",load_memory:"memory",preload_memory:"memory",url_context:"link",VertexAiRagRetrieval:"find_in_page",exit_loop:"sync",get_user_choice:"how_to_reg",load_artifacts:"image",LongRunningFunctionTool:"data_object"};function UB(i,e){return e==="Agent Tool"?"smart_toy":e==="Built-in tool"?nlA[i]||"build":e==="Function tool"?"data_object":"build"}var nc=class i{static toolMenuTooltips=new Map([["Function tool","Build custom tools for your specific ADK agent needs."],["Built-in tool","Ready-to-use functionality such as Google Search or code executors that provide agents with common capabilities. "],["Agent tool","A sub-agent that can be invoked as a tool by another agent."]]);static toolDetailedInfo=new Map([["Function tool",{shortDescription:"Build custom tools for your specific ADK agent needs.",detailedDescription:"The ADK framework automatically inspects your Python function's signature\u2014including its name, docstring, parameters, type hints, and default values\u2014to generate a schema. This schema is what the LLM uses to understand the tool's purpose, when to use it, and what arguments it requires.",docLink:"https://google.github.io/adk-docs/tools/function-tools/"}],["Agent tool",{shortDescription:"Wraps a sub-agent as a callable tool, enabling modular and hierarchical agent architectures.",detailedDescription:"Agent tools allow you to use one agent as a tool within another agent, creating powerful multi-agent workflows.",docLink:"https://google.github.io/adk-docs/agents/multi-agents/#c-explicit-invocation-agenttool"}]]);static callbackMenuTooltips=new Map([["before_agent","Called immediately before the agent's _run_async_impl (or _run_live_impl) method is executed."],["after_agent","Called immediately after the agent's _run_async_impl (or _run_live_impl) method successfully completes."],["before_model","Called just before the generate_content_async (or equivalent) request is sent to the LLM within an LlmAgent's flow."],["after_model","Called just after a response (LlmResponse) is received from the LLM, before it's processed further by the invoking agent."],["before_tool","Called just before a specific tool's run_async method is invoked, after the LLM has generated a function call for it."],["after_tool","Called just after the tool's run_async method completes successfully."]]);static callbackDialogTooltips=new Map([["before_agent","Called immediately before the agent's _run_async_impl (or _run_live_impl) method is executed."],["after_agent","Called immediately after the agent's _run_async_impl (or _run_live_impl) method successfully completes."],["before_model","Called just before the generate_content_async (or equivalent) request is sent to the LLM within an LlmAgent's flow."],["after_model","Called just after a response (LlmResponse) is received from the LLM, before it's processed further by the invoking agent."],["before_tool","Called just before a specific tool's run_async method is invoked, after the LLM has generated a function call for it."],["after_tool","Called just after the tool's run_async method completes successfully."]]);static callbackDetailedInfo=new Map([["before_agent",{shortDescription:"Called immediately before the agent's _run_async_impl (or _run_live_impl) method is executed. It runs after the agent's InvocationContext is created but before its core logic begins.",detailedDescription:" Ideal for setting up resources or state needed only for this specific agent's run, performing validation checks on the session state (callback_context.state) before execution starts, logging the entry point of the agent's activity, or potentially modifying the invocation context before the core logic uses it.",docLink:"https://google.github.io/adk-docs/callbacks/types-of-callbacks/#before-agent-callback"}],["after_agent",{shortDescription:"Called immediately after the agent's _run_async_impl (or _run_live_impl) method successfully completes.",detailedDescription:"Useful for cleanup tasks, post-execution validation, logging the completion of an agent's activity, modifying final state, or augmenting/replacing the agent's final output.",docLink:"https://google.github.io/adk-docs/callbacks/types-of-callbacks/#after-agent-callback"}],["before_model",{shortDescription:"Called just before the generate_content_async (or equivalent) request is sent to the LLM within an LlmAgent's flow.",detailedDescription:"Allows inspection and modification of the request going to the LLM. Use cases include adding dynamic instructions, injecting few-shot examples based on state, modifying model config, implementing guardrails (like profanity filters), or implementing request-level caching.",docLink:"https://google.github.io/adk-docs/callbacks/types-of-callbacks/#before-model-callback"}],["after_model",{shortDescription:"Called just after a response (LlmResponse) is received from the LLM, before it's processed further by the invoking agent.",detailedDescription:"Allows inspection or modification of the raw LLM response.",docLink:"https://google.github.io/adk-docs/callbacks/types-of-callbacks/#after-model-callback"}],["before_tool",{shortDescription:"Called just before a specific tool's run_async method is invoked, after the LLM has generated a function call for it.",detailedDescription:"Allows inspection and modification of tool arguments, performing authorization checks before execution, logging tool usage attempts, or implementing tool-level caching.",docLink:"https://google.github.io/adk-docs/callbacks/types-of-callbacks/#before-tool-callback"}],["after_tool",{shortDescription:"Called just after the tool's run_async method completes successfully.",detailedDescription:"Allows inspection and modification of the tool's result before it's sent back to the LLM (potentially after summarization). Useful for logging tool results, post-processing or formatting results, or saving specific parts of the result to the session state.",docLink:"https://google.github.io/adk-docs/callbacks/types-of-callbacks/#after-tool-callback"}]]);static getToolMenuTooltips(e){return i.toolMenuTooltips.get(e)}static getToolDetailedInfo(e){return i.toolDetailedInfo.get(e)}static getCallbackMenuTooltips(e){return i.callbackMenuTooltips.get(e)}static getCallbackDialogTooltips(e){return i.callbackDialogTooltips.get(e)}static getCallbackDetailedInfo(e){return i.callbackDetailedInfo.get(e)}};var olA=["callbackNameInput"];function alA(i,e){if(i&1){let A=aA();vl(0),I(1,"div",8)(2,"div",9),U("click",function(){L(A);let n=p();return G(n.toggleCallbackInfo())}),I(3,"mat-icon",10),D(4,"info"),h(),I(5,"div",11)(6,"span"),D(7,"Callback Information"),h()(),I(8,"button",12)(9,"mat-icon"),D(10),h()()(),I(11,"div",13)(12,"div",14)(13,"div",15),D(14),h(),I(15,"div",16),D(16),h()(),I(17,"div",17)(18,"a",18)(19,"mat-icon"),D(20,"open_in_new"),h(),I(21,"span"),D(22,"View Official Documentation"),h()()()()(),bl()}if(i&2){let A,t,n,o=p();Q(10),nA(o.isCallbackInfoExpanded?"expand_less":"expand_more"),Q(),_A("expanded",o.isCallbackInfoExpanded),Q(3),nA((A=o.getCallbackInfo())==null?null:A.shortDescription),Q(2),nA((t=o.getCallbackInfo())==null?null:t.detailedDescription),Q(2),H("href",(n=o.getCallbackInfo())==null?null:n.docLink,mo)}}function rlA(i,e){if(i&1&&(I(0,"mat-option",21),D(1),h()),i&2){let A=e.$implicit;H("value",A),Q(),nA(A)}}function slA(i,e){if(i&1){let A=aA();vl(0),I(1,"mat-form-field",3)(2,"mat-label"),D(3,"Callback Type"),h(),I(4,"mat-select",19),Ni("ngModelChange",function(n){L(A);let o=p();return wi(o.callbackType,n)||(o.callbackType=n),G(n)}),kt(5,rlA,2,2,"mat-option",20),h()(),bl()}if(i&2){let A=p();Q(4),Ri("ngModel",A.callbackType),Q(),H("ngForOf",A.availableCallbackTypes)}}function llA(i,e){i&1&&(I(0,"mat-error"),D(1,"Same callback name has been used"),h())}function glA(i,e){i&1&&(I(0,"mat-error"),D(1,"Cannot have callback consist of two words"),h())}function clA(i,e){i&1&&(I(0,"mat-error"),D(1,"Callback function names cannot have spaces"),h())}var nM=class{isErrorState(e){return!!(e&&e.invalid)}},Mu=class i{constructor(e,A){this.dialogRef=e;this.data=A;this.callbackType=A?.callbackType??"",this.existingCallbackNames=A?.existingCallbackNames??[],this.isEditMode=!!A?.isEditMode,this.availableCallbackTypes=A?.availableCallbackTypes??[],this.isEditMode&&A?.callback&&(this.callbackName=A.callback.name,this.callbackType=A.callback.type,this.originalCallbackName=A.callback.name,this.existingCallbackNames=this.existingCallbackNames.filter(t=>t!==this.originalCallbackName))}callbackNameInput;callbackName="";callbackType="";existingCallbackNames=[];matcher=new nM;isEditMode=!1;availableCallbackTypes=[];originalCallbackName="";isCallbackInfoExpanded=!1;addCallback(){if(!this.callbackName.trim()||this.hasSpaces()||this.isDuplicateName())return;let e={name:this.callbackName.trim(),type:this.callbackType,isEditMode:this.isEditMode,originalName:this.originalCallbackName||this.callbackName.trim()};this.dialogRef.close(e)}cancel(){this.dialogRef.close()}isDuplicateName(){if(!Array.isArray(this.existingCallbackNames))return!1;let e=(this.callbackName||"").trim();return this.existingCallbackNames.includes(e)}hasSpaces(){return/\s/.test(this.callbackName||"")}createDisabled(){return!this.callbackName.trim()||this.isDuplicateName()||this.hasSpaces()}validate(){this.hasSpaces()?this.callbackNameInput.control.setErrors({hasSpaces:!0}):this.isDuplicateName()?this.callbackNameInput.control.setErrors({duplicateName:!0}):this.callbackNameInput.control.setErrors(null)}getCallbackInfo(){return nc.getCallbackDetailedInfo(this.callbackType)}toggleCallbackInfo(){this.isCallbackInfoExpanded=!this.isCallbackInfoExpanded}static \u0275fac=function(A){return new(A||i)(st(zn),st(Do))};static \u0275cmp=vA({type:i,selectors:[["app-add-callback-dialog"]],viewQuery:function(A,t){if(A&1&&Wt(olA,5),A&2){let n;se(n=le())&&(t.callbackNameInput=n.first)}},decls:18,vars:10,consts:[["callbackNameInput","ngModel"],["mat-dialog-title",""],[4,"ngIf"],[2,"width","100%"],["matInput","",3,"ngModelChange","keydown.enter","ngModel","errorStateMatcher"],["align","end"],["mat-button","",3,"click"],["mat-raised-button","","color","secondary",3,"click","disabled"],[1,"callback-info-container"],[1,"callback-info-header",3,"click"],[1,"callback-info-icon"],[1,"callback-info-title"],["mat-icon-button","","type","button","aria-label","Toggle callback information",1,"callback-info-toggle"],[1,"callback-info-body"],[1,"callback-info-content"],[1,"callback-info-short"],[1,"callback-info-detailed"],[1,"callback-info-link-container"],["target","_blank","rel","noopener noreferrer",1,"callback-info-link",3,"href"],[3,"ngModelChange","ngModel"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(A,t){if(A&1){let n=aA();I(0,"h2",1),D(1),h(),I(2,"mat-dialog-content"),kt(3,alA,23,6,"ng-container",2)(4,slA,6,2,"ng-container",2),I(5,"mat-form-field",3)(6,"mat-label"),D(7,"Callback Name"),h(),I(8,"input",4,0),Ni("ngModelChange",function(a){return L(n),wi(t.callbackName,a)||(t.callbackName=a),G(a)}),U("ngModelChange",function(){return t.validate()})("keydown.enter",function(){return t.addCallback()}),h(),kt(10,llA,2,0,"mat-error",2)(11,glA,2,0,"mat-error",2)(12,clA,2,0,"mat-error",2),h()(),I(13,"mat-dialog-actions",5)(14,"button",6),U("click",function(){return t.cancel()}),D(15,"Cancel"),h(),I(16,"button",7),U("click",function(){return t.addCallback()}),D(17),h()()}if(A&2){let n=Bi(9);Q(),nA(t.isEditMode?"Edit Callback":"Add "+t.callbackType+" Callback"),Q(2),H("ngIf",t.getCallbackInfo()),Q(),H("ngIf",t.isEditMode),Q(4),Ri("ngModel",t.callbackName),H("errorStateMatcher",t.matcher),Q(2),H("ngIf",n.hasError("duplicateName")),Q(),H("ngIf",n.hasError("hasSpaces")),Q(),H("ngIf",n.hasError("hasSpaces")),Q(4),H("disabled",t.createDisabled()),Q(),Ee(" ",t.isEditMode?"Save":"Add"," ")}},dependencies:[li,DI,ql,fn,Gn,Kn,Ho,Ls,Xo,ha,Ba,qi,ki,yi,Za,Zo,xs,xv,Ws,ka,W0,ig,Vr,Un,zt],styles:[".callback-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:16px;min-width:400px;max-width:600px}.full-width[_ngcontent-%COMP%]{width:100%}mat-dialog-content[_ngcontent-%COMP%]{padding:20px 24px;display:flex;flex-direction:column;gap:16px}mat-dialog-actions[_ngcontent-%COMP%]{padding:16px 24px;margin:0}mat-form-field[_ngcontent-%COMP%]{margin-top:8px!important}.callback-info-container[_ngcontent-%COMP%]{border:1px solid rgba(138,180,248,.2);border-radius:8px;padding:16px;margin-bottom:16px}.callback-info-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;cursor:pointer;-webkit-user-select:none;user-select:none;padding:4px 0}.callback-info-header[_ngcontent-%COMP%]:hover .callback-info-title[_ngcontent-%COMP%]{color:#a7c8ff}.callback-info-icon[_ngcontent-%COMP%]{color:#8ab4f8;font-size:20px;width:20px;height:20px;flex-shrink:0}.callback-info-title[_ngcontent-%COMP%]{flex:1;font-weight:500;color:#8ab4f8;font-size:14px;transition:color .2s ease}.callback-info-toggle[_ngcontent-%COMP%]{color:#8ab4f8;margin:-8px}.callback-info-toggle[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{transition:transform .2s ease}.callback-info-body[_ngcontent-%COMP%]{max-height:0;overflow:hidden;opacity:0;transition:max-height .3s ease,opacity .2s ease,margin-top .3s ease}.callback-info-body.expanded[_ngcontent-%COMP%]{max-height:500px;opacity:1;margin-top:12px}.callback-info-content[_ngcontent-%COMP%]{flex:1}.callback-info-short[_ngcontent-%COMP%]{font-weight:500;color:var(--mat-dialog-content-text-color);margin-bottom:8px;line-height:1.4}.callback-info-detailed[_ngcontent-%COMP%]{color:var(--mat-dialog-content-text-color);font-size:14px;line-height:1.5;opacity:.8}.callback-info-link-container[_ngcontent-%COMP%]{margin-top:12px}.callback-info-link[_ngcontent-%COMP%]{color:#8ab4f8;text-decoration:none;font-size:14px;display:inline-flex;align-items:center;gap:4px;transition:color .2s ease}.callback-info-link[_ngcontent-%COMP%]:hover{color:#a7c8ff}.callback-info-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px}"]})};function ClA(i,e){if(i&1){let A=aA();vl(0),I(1,"div",6)(2,"div",7),U("click",function(){L(A);let n=p();return G(n.toggleToolInfo())}),I(3,"mat-icon",8),D(4,"info"),h(),I(5,"div",9)(6,"span"),D(7,"Tool Information"),h()(),I(8,"button",10)(9,"mat-icon"),D(10),h()()(),I(11,"div",11)(12,"div",12)(13,"div",13),D(14),h(),I(15,"div",14),D(16),h()(),I(17,"div",15)(18,"a",16)(19,"mat-icon"),D(20,"open_in_new"),h(),I(21,"span"),D(22,"View Official Documentation"),h()()()()(),bl()}if(i&2){let A,t,n,o=p();Q(10),nA(o.isToolInfoExpanded?"expand_less":"expand_more"),Q(),_A("expanded",o.isToolInfoExpanded),Q(3),nA((A=o.getToolInfo())==null?null:A.shortDescription),Q(2),nA((t=o.getToolInfo())==null?null:t.detailedDescription),Q(2),H("href",(n=o.getToolInfo())==null?null:n.docLink,mo)}}function dlA(i,e){if(i&1){let A=aA();I(0,"mat-form-field",2)(1,"input",17),Ni("ngModelChange",function(n){L(A);let o=p();return wi(o.toolName,n)||(o.toolName=n),G(n)}),U("keydown.enter",function(){L(A);let n=p();return G(n.addTool())}),h()()}if(i&2){let A=p();Q(),Ri("ngModel",A.toolName)}}function IlA(i,e){if(i&1&&(I(0,"mat-option",20),D(1),h()),i&2){let A=e.$implicit;H("value",A),Q(),Ee(" ",A," ")}}function BlA(i,e){if(i&1){let A=aA();I(0,"mat-form-field",2)(1,"mat-select",18),Ni("ngModelChange",function(n){L(A);let o=p();return wi(o.selectedBuiltInTool,n)||(o.selectedBuiltInTool=n),G(n)}),kt(2,IlA,2,2,"mat-option",19),h()()}if(i&2){let A=p();Q(),Ri("ngModel",A.selectedBuiltInTool),Q(),H("ngForOf",A.builtInTools)}}var Q2=class i{constructor(e,A){this.data=e;this.dialogRef=A}toolName="";toolType="Function tool";selectedBuiltInTool="google_search";builtInTools=["EnterpriseWebSearchTool","exit_loop","FilesRetrieval","get_user_choice","google_search","load_artifacts","load_memory","LongRunningFunctionTool","preload_memory","url_context","VertexAiRagRetrieval","VertexAiSearchTool"];isEditMode=!1;isToolInfoExpanded=!1;ngOnInit(){this.toolType=this.data.toolType,this.isEditMode=this.data.isEditMode||!1,this.isEditMode&&this.data.toolName&&(this.toolType==="Function tool"?this.toolName=this.data.toolName:this.toolType==="Built-in tool"&&(this.selectedBuiltInTool=this.data.toolName))}addTool(){if(this.toolType==="Function tool"&&!this.toolName.trim())return;let e={toolType:this.toolType,isEditMode:this.isEditMode};this.toolType==="Function tool"?e.name=this.toolName.trim():this.toolType==="Built-in tool"&&(e.name=this.selectedBuiltInTool),this.dialogRef.close(e)}cancel(){this.dialogRef.close()}createDisabled(){return this.toolType==="Function tool"&&!this.toolName.trim()}getToolInfo(){return nc.getToolDetailedInfo(this.toolType)}toggleToolInfo(){this.isToolInfoExpanded=!this.isToolInfoExpanded}static \u0275fac=function(A){return new(A||i)(st(Do),st(zn))};static \u0275cmp=vA({type:i,selectors:[["app-add-tool-dialog"]],decls:11,vars:6,consts:[["mat-dialog-title","",1,"dialog-title"],[4,"ngIf"],[2,"width","100%"],["align","end"],["mat-button","",3,"click"],["mat-button","","cdkFocusInitial","",3,"click","disabled"],[1,"tool-info-container"],[1,"tool-info-header",3,"click"],[1,"tool-info-icon"],[1,"tool-info-title"],["mat-icon-button","","type","button","aria-label","Toggle tool information",1,"tool-info-toggle"],[1,"tool-info-body"],[1,"tool-info-content"],[1,"tool-info-short"],[1,"tool-info-detailed"],[1,"tool-info-link-container"],["target","_blank","rel","noopener noreferrer",1,"tool-info-link",3,"href"],["matInput","","placeholder","Enter full function name",3,"ngModelChange","keydown.enter","ngModel"],["placeholder","Select built-in tool",3,"ngModelChange","ngModel"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(A,t){A&1&&(I(0,"h2",0),D(1),h(),I(2,"mat-dialog-content"),kt(3,ClA,23,6,"ng-container",1),T(4,dlA,2,1,"mat-form-field",2),T(5,BlA,3,2,"mat-form-field",2),h(),I(6,"mat-dialog-actions",3)(7,"button",4),U("click",function(){return t.cancel()}),D(8,"Cancel"),h(),I(9,"button",5),U("click",function(){return t.addTool()}),D(10),h()()),A&2&&(Q(),nA(t.isEditMode?"Editing Tool":"Add New Tool"),Q(2),H("ngIf",t.getToolInfo()),Q(),O(t.toolType==="Function tool"?4:-1),Q(),O(t.toolType==="Built-in tool"?5:-1),Q(4),H("disabled",t.createDisabled()),Q(),Ee(" ",t.isEditMode?"Save":"Create"," "))},dependencies:[li,DI,ql,fn,Gn,Kn,Ho,Xo,Ba,Zo,ka,ig,Vr,ha,ki,yi,zt],styles:[".dialog-title[_ngcontent-%COMP%]{color:var(--mdc-dialog-supporting-text-color)!important;font-family:Google Sans;font-size:24px}mat-dialog-content[_ngcontent-%COMP%]{padding:20px 24px;display:flex;flex-direction:column;gap:16px}.tool-info-container[_ngcontent-%COMP%]{border:1px solid rgba(138,180,248,.2);border-radius:8px;padding:16px;margin-bottom:16px}.tool-info-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;cursor:pointer;-webkit-user-select:none;user-select:none;padding:4px 0}.tool-info-header[_ngcontent-%COMP%]:hover .tool-info-title[_ngcontent-%COMP%]{color:#a7c8ff}.tool-info-icon[_ngcontent-%COMP%]{color:#8ab4f8;font-size:20px;width:20px;height:20px;flex-shrink:0}.tool-info-title[_ngcontent-%COMP%]{flex:1;font-weight:500;color:#8ab4f8;font-size:14px;transition:color .2s ease}.tool-info-toggle[_ngcontent-%COMP%]{color:#8ab4f8;margin:-8px}.tool-info-toggle[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{transition:transform .2s ease}.tool-info-body[_ngcontent-%COMP%]{max-height:0;overflow:hidden;opacity:0;transition:max-height .3s ease,opacity .2s ease,margin-top .3s ease}.tool-info-body.expanded[_ngcontent-%COMP%]{max-height:500px;opacity:1;margin-top:12px}.tool-info-content[_ngcontent-%COMP%]{flex:1}.tool-info-short[_ngcontent-%COMP%]{font-weight:500;color:#e3e3e3;margin-bottom:8px;line-height:1.4}.tool-info-detailed[_ngcontent-%COMP%]{color:#c4c7ca;font-size:14px;line-height:1.5}.tool-info-link-container[_ngcontent-%COMP%]{margin-top:12px}.tool-info-link[_ngcontent-%COMP%]{color:#8ab4f8;text-decoration:none;font-size:14px;display:inline-flex;align-items:center;gap:4px;transition:color .2s ease}.tool-info-link[_ngcontent-%COMP%]:hover{color:#a7c8ff}.tool-info-link[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px}"]})};function sa(i){return Array.isArray(i)}function Ea(i){return i!==null&&typeof i=="object"&&(i.constructor===void 0||i.constructor.name==="Object")}function oM(i){return i&&typeof i=="object"?i.op==="add":!1}function aM(i){return i&&typeof i=="object"?i.op==="remove":!1}function B6(i){return i&&typeof i=="object"?i.op==="replace":!1}function h6(i){return i&&typeof i=="object"?i.op==="copy":!1}function u2(i){return i&&typeof i=="object"?i.op==="move":!1}function mO(i,e){return JSON.stringify(i)===JSON.stringify(e)}function hlA(i,e){return i===e}function rM(i){return i.slice(0,i.length-1)}function wO(i){return i[i.length-1]}function yO(i,e){let A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:hlA;if(i.length<e.length)return!1;for(let t=0;t<e.length;t++)if(!A(i[t],e[t]))return!1;return!0}function sM(i){return typeof i=="object"&&i!==null}function lM(i){if(sa(i)){let e=i.slice();return Object.getOwnPropertySymbols(i).forEach(A=>{e[A]=i[A]}),e}if(Ea(i)){let e=P({},i);return Object.getOwnPropertySymbols(i).forEach(A=>{e[A]=i[A]}),e}return i}function gM(i,e,A){if(i[e]===A)return i;let t=lM(i);return t[e]=A,t}function $e(i,e){let A=i,t=0;for(;t<e.length;)Ea(A)?A=A[e[t]]:sa(A)?A=A[Number.parseInt(e[t])]:A=void 0,t++;return A}function qr(i,e,A){let t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e.length===0)return A;let n=e[0],o=qr(i?i[n]:void 0,e.slice(1),A,t);if(Ea(i)||sa(i))return gM(i,n,o);if(t){let a=ElA.test(n)?[]:{};return a[n]=o,a}throw new Error("Path does not exist")}var ElA=/^\d+$/;function Su(i,e,A){if(e.length===0)return A(i);if(!sM(i))throw new Error("Path doesn't exist");let t=e[0],n=Su(i[t],e.slice(1),A);return gM(i,t,n)}function cd(i,e){if(e.length===0)return i;if(!sM(i))throw new Error("Path does not exist");if(e.length===1){let n=e[0];if(!(n in i))return i;let o=lM(i);return sa(o)&&o.splice(Number.parseInt(n),1),Ea(o)&&delete o[n],o}let A=e[0],t=cd(i[A],e.slice(1));return gM(i,A,t)}function ku(i,e,A){let t=e.slice(0,e.length-1),n=e[e.length-1];return Su(i,t,o=>{if(!Array.isArray(o))throw new TypeError(`Array expected at path ${JSON.stringify(t)}`);let a=lM(o);return a.splice(Number.parseInt(n),0,A),a})}function Fr(i,e){return i===void 0?!1:e.length===0?!0:i===null?!1:Fr(i[e[0]],e.slice(1))}function ms(i){let e=i.split("/");return e.shift(),e.map(A=>A.replace(/~1/g,"/").replace(/~0/g,"~"))}function xt(i){return i.map(DO).join("")}function DO(i){return`/${String(i).replace(/~/g,"~0").replace(/\//g,"~1")}`}function _u(i,e){return i+DO(e)}function ol(i,e,A){let t=i;for(let n=0;n<e.length;n++){DlA(e[n]);let o=e[n];if(A?.before){let s=A.before(t,o);if(s!==void 0){if(s.document!==void 0&&(t=s.document),s.json!==void 0)throw new Error('Deprecation warning: returned object property ".json" has been renamed to ".document"');s.operation!==void 0&&(o=s.operation)}}let a=t,r=al(t,o.path);if(o.op==="add")t=plA(t,r,o.value);else if(o.op==="remove")t=ulA(t,r);else if(o.op==="replace")t=QlA(t,r,o.value);else if(o.op==="copy")t=flA(t,r,xu(o.from));else if(o.op==="move")t=mlA(t,r,xu(o.from));else if(o.op==="test")wlA(t,r,o.value);else throw new Error(`Unknown JSONPatch operation ${JSON.stringify(o)}`);if(A?.after){let s=A.after(t,o,a);s!==void 0&&(t=s)}}return t}function QlA(i,e,A){return Fr(i,e)?qr(i,e,A):i}function ulA(i,e){return cd(i,e)}function plA(i,e,A){return TB(i,e)?ku(i,e,A):qr(i,e,A)}function flA(i,e,A){let t=$e(i,A);return TB(i,e)?ku(i,e,t):qr(i,e,t)}function mlA(i,e,A){let t=$e(i,A),n=cd(i,A);return TB(n,e)?ku(n,e,t):qr(n,e,t)}function wlA(i,e,A){if(A===void 0)throw new Error(`Test failed: no value provided (path: "${xt(e)}")`);if(!Fr(i,e))throw new Error(`Test failed: path not found (path: "${xt(e)}")`);let t=$e(i,e);if(!mO(t,A))throw new Error(`Test failed, value differs (path: "${xt(e)}")`)}function TB(i,e){if(e.length===0)return!1;let A=$e(i,rM(e));return Array.isArray(A)}function ylA(i,e){if(wO(e)!=="-")return e;let A=rM(e),t=$e(i,A);return A.concat(t.length)}function DlA(i){if(!["add","remove","replace","copy","move","test"].includes(i.op))throw new Error(`Unknown JSONPatch op ${JSON.stringify(i.op)}`);if(typeof i.path!="string")throw new Error(`Required property "path" missing or not a string in operation ${JSON.stringify(i)}`);if((i.op==="copy"||i.op==="move")&&typeof i.from!="string")throw new Error(`Required property "from" missing or not a string in operation ${JSON.stringify(i)}`)}function al(i,e){return ylA(i,ms(e))}function xu(i){return ms(i)}function E6(i,e,A){let t=[];return ol(i,e,{before:(o,a)=>{let r,s=al(o,a.path);if(a.op==="add")r=MO(o,s);else if(a.op==="remove")r=bO(o,s);else if(a.op==="replace")r=vO(o,s);else if(a.op==="copy")r=vlA(o,s);else if(a.op==="move")r=blA(o,s,xu(a.from));else if(a.op==="test")r=[];else throw new Error(`Unknown JSONPatch operation ${JSON.stringify(a)}`);let l;if(A?.before){let g=A.before(o,a,r);if(g?.revertOperations&&(r=g.revertOperations),g?.document&&(l=g.document),g?.json)throw new Error('Deprecation warning: returned object property ".json" has been renamed to ".document"')}if(t=r.concat(t),l!==void 0)return{document:l}}}),t}function vO(i,e){return Fr(i,e)?[{op:"replace",path:xt(e),value:$e(i,e)}]:[]}function bO(i,e){return[{op:"add",path:xt(e),value:$e(i,e)}]}function MO(i,e){return TB(i,e)||!Fr(i,e)?[{op:"remove",path:xt(e)}]:vO(i,e)}function vlA(i,e){return MO(i,e)}function blA(i,e,A){if(e.length<A.length&&yO(A,e))return[{op:"replace",path:xt(e),value:i}];let t={op:"move",from:xt(e),path:xt(A)};return!TB(i,e)&&Fr(i,e)?[t,...bO(i,e)]:[t]}var Ax=Vp(kO(),1);var nC=class extends Error{constructor(e,A){super(`${e} at position ${A}`),this.position=A}};function _O(i){return/^[0-9A-Fa-f]$/.test(i)}function f2(i){return i>="0"&&i<="9"}function xO(i){return i>=" "}function Ru(i){return`,:[]/{}() |
| 227 | +`.includes(i)}function dM(i){return i>="a"&&i<="z"||i>="A"&&i<="Z"||i==="_"||i==="$"}function IM(i){return i>="a"&&i<="z"||i>="A"&&i<="Z"||i==="_"||i==="$"||i>="0"&&i<="9"}var BM=/^(http|https|ftp|mailto|file|data|irc):\/\/$/,hM=/^[A-Za-z0-9-._~:/?#@!$&'()*+;=]$/;function EM(i){return`,[]/{} |
| 228 | +`.includes(i)}function QM(i){return Nu(i)||KlA.test(i)}var KlA=/^[[{\w-]$/;function RO(i){return i===` |
| 229 | `||i==="\r"||i===" "||i==="\b"||i==="\f"}function p2(i,e){let A=i.charCodeAt(e);return A===32||A===10||A===9||A===13}function NO(i,e){let A=i.charCodeAt(e);return A===32||A===9||A===13}function FO(i,e){let A=i.charCodeAt(e);return A===160||A===6158||A>=8192&&A<=8203||A===8239||A===8287||A===12288||A===65279}function Nu(i){return uM(i)||p6(i)}function uM(i){return i==='"'||i==="\u201C"||i==="\u201D"}function pM(i){return i==='"'}function p6(i){return i==="'"||i==="\u2018"||i==="\u2019"||i==="`"||i==="\xB4"}function fM(i){return i==="'"}function OB(i,e){let A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,t=i.lastIndexOf(e);return t!==-1?i.substring(0,t)+(A?"":i.substring(t+1)):i}function lg(i,e){let A=i.length;if(!p2(i,A-1))return i+e;for(;p2(i,A-1);)A--;return i.substring(0,A)+e+i.substring(A)}function LO(i,e,A){return i.substring(0,e)+i.substring(e+A)}function GO(i){return/[,\n][ \t\r]*$/.test(i)}var UlA={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},TlA={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:` |
no test coverage detected