diff --git a/.github/workflows/release-update-adk-web.yaml b/.github/workflows/release-update-adk-web.yaml index e99f464c95..72d1d71d27 100644 --- a/.github/workflows/release-update-adk-web.yaml +++ b/.github/workflows/release-update-adk-web.yaml @@ -1,4 +1,4 @@ -name: Release: Update ADk Web +name: "Release: Update ADk Web" on: workflow_dispatch: @@ -27,7 +27,7 @@ jobs: run: | TARGET_DIR="src/google/adk/cli/browser" REPO="${{ github.event.inputs.adk_web_repo }}" - TAG="${{ github.event.inputs.adk_web_tag }}" + TAG="${{ github.event.inputs.adk_web_tag }}" # Clean target directory rm -rf "$TARGET_DIR"/* mkdir -p "$TARGET_DIR" diff --git a/src/google/adk/cli/browser/chunk-3YZ77ADE.js b/src/google/adk/cli/browser/chunk-3YZ77ADE.js index 08b10f4c24..3253c2d891 100644 --- a/src/google/adk/cli/browser/chunk-3YZ77ADE.js +++ b/src/google/adk/cli/browser/chunk-3YZ77ADE.js @@ -16,10 +16,10 @@ import{a as Ke}from"./chunk-DMWOYWYQ.js";import{a as je}from"./chunk-T3Q3QCCV.js stroke-dasharray: 8; } .node-icon-text { - display: flex; + display: flex; align-items: center; } - + .node-icon-text > div { color: #fff; margin: 1px; diff --git a/src/google/adk/cli/browser/chunk-B2DSW4QB.js b/src/google/adk/cli/browser/chunk-B2DSW4QB.js index 43d0ec93ef..b05d08635a 100644 --- a/src/google/adk/cli/browser/chunk-B2DSW4QB.js +++ b/src/google/adk/cli/browser/chunk-B2DSW4QB.js @@ -6,7 +6,7 @@ import{g as e}from"./chunk-JRNAXTJ7.js";var l=e(()=>` overflow: visible; vertical-align: -0.125em; } - + .node .label-icon path { fill: currentColor; stroke: revert; diff --git a/src/google/adk/cli/browser/chunk-BDIW4D5I.js b/src/google/adk/cli/browser/chunk-BDIW4D5I.js index 0dbe5bd4a3..07519d00bd 100644 --- a/src/google/adk/cli/browser/chunk-BDIW4D5I.js +++ b/src/google/adk/cli/browser/chunk-BDIW4D5I.js @@ -1,5 +1,5 @@ import{a as re}from"./chunk-DMWOYWYQ.js";import{a as se}from"./chunk-T3Q3QCCV.js";import{a as ae}from"./chunk-4R6SYGKS.js";import"./chunk-NQKWI5EB.js";import"./chunk-WR6HISGZ.js";import"./chunk-I4UDKKN5.js";import"./chunk-2DLZXFEQ.js";import"./chunk-JNY2YWG7.js";import"./chunk-XULIXUQL.js";import"./chunk-3NJNOY56.js";import"./chunk-NALL4A3P.js";import{f as Q,l as ee,m as te}from"./chunk-WBLSVR3V.js";import"./chunk-GP6TCC26.js";import{A as j,M as C,R as F,S as K,T as Y,U as Z,V as U,W as V,X as J,aa as X,r as z}from"./chunk-QFMJV7VH.js";import{a as S,g as l,i as u}from"./chunk-JRNAXTJ7.js";import"./chunk-ASJUXEUE.js";import"./chunk-EGBSMT36.js";import{a as I,b as _,j as N}from"./chunk-RMXJBC7V.js";var x={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},me=z.gitGraph,M=l(()=>ee(I(I({},me),j().gitGraph)),"getConfig"),n=new ae(()=>{let r=M(),e=r.mainBranchName,a=r.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:a}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}});function A(){return Q({length:7})}l(A,"getID");function ce(r,e){let a=Object.create(null);return r.reduce((o,t)=>{let s=e(t);return a[s]||(a[s]=!0,o.push(t)),o},[])}l(ce,"uniqBy");var pe=l(function(r){n.records.direction=r},"setDirection"),ge=l(function(r){u.debug("options str",r),r=r?.trim(),r=r||"{}";try{n.records.options=JSON.parse(r)}catch(e){u.error("error while parsing gitGraph options",e.message)}},"setOptions"),fe=l(function(){return n.records.options},"getOptions"),ye=l(function(r){let e=r.msg,a=r.id,o=r.type,t=r.tags;u.info("commit",e,a,o,t),u.debug("Entering commit:",e,a,o,t);let s=M();a=C.sanitizeText(a,s),e=C.sanitizeText(e,s),t=t?.map(d=>C.sanitizeText(d,s));let h={id:a||n.records.seq+"-"+A(),message:e,seq:n.records.seq++,type:o??x.NORMAL,tags:t??[],parents:n.records.head==null?[]:[n.records.head.id],branch:n.records.currBranch};n.records.head=h,u.info("main branch",s.mainBranchName),n.records.commits.has(h.id)&&u.warn(`Commit ID ${h.id} already exists`),n.records.commits.set(h.id,h),n.records.branches.set(n.records.currBranch,h.id),u.debug("in pushCommit "+h.id)},"commit"),$e=l(function(r){let e=r.name,a=r.order;if(e=C.sanitizeText(e,M()),n.records.branches.has(e))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${e}")`);n.records.branches.set(e,n.records.head!=null?n.records.head.id:null),n.records.branchConfig.set(e,{name:e,order:a}),ne(e),u.debug("in createBranch")},"branch"),xe=l(r=>{let e=r.branch,a=r.id,o=r.type,t=r.tags,s=M();e=C.sanitizeText(e,s),a&&(a=C.sanitizeText(a,s));let h=n.records.branches.get(n.records.currBranch),d=n.records.branches.get(e),c=h?n.records.commits.get(h):void 0,m=d?n.records.commits.get(d):void 0;if(c&&m&&c.branch===e)throw new Error(`Cannot merge branch '${e}' into itself.`);if(n.records.currBranch===e){let i=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw i.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},i}if(c===void 0||!c){let i=new Error(`Incorrect usage of "merge". Current branch (${n.records.currBranch})has no commits`);throw i.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]},i}if(!n.records.branches.has(e)){let i=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");throw i.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]},i}if(m===void 0||!m){let i=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");throw i.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']},i}if(c===m){let i=new Error('Incorrect usage of "merge". Both branches have same head');throw i.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]},i}if(a&&n.records.commits.has(a)){let i=new Error('Incorrect usage of "merge". Commit with id:'+a+" already exists, use different custom id");throw i.hash={text:`merge ${e} ${a} ${o} ${t?.join(" ")}`,token:`merge ${e} ${a} ${o} ${t?.join(" ")}`,expected:[`merge ${e} ${a}_UNIQUE ${o} ${t?.join(" ")}`]},i}let p=d||"",f={id:a||`${n.records.seq}-${A()}`,message:`merged branch ${e} into ${n.records.currBranch}`,seq:n.records.seq++,parents:n.records.head==null?[]:[n.records.head.id,p],branch:n.records.currBranch,type:x.MERGE,customType:o,customId:!!a,tags:t??[]};n.records.head=f,n.records.commits.set(f.id,f),n.records.branches.set(n.records.currBranch,f.id),u.debug(n.records.branches),u.debug("in mergeBranch")},"merge"),ue=l(function(r){let e=r.id,a=r.targetId,o=r.tags,t=r.parent;u.debug("Entering cherryPick:",e,a,o);let s=M();if(e=C.sanitizeText(e,s),a=C.sanitizeText(a,s),o=o?.map(c=>C.sanitizeText(c,s)),t=C.sanitizeText(t,s),!e||!n.records.commits.has(e)){let c=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw c.hash={text:`cherryPick ${e} ${a}`,token:`cherryPick ${e} ${a}`,expected:["cherry-pick abc"]},c}let h=n.records.commits.get(e);if(h===void 0||!h)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(t&&!(Array.isArray(h.parents)&&h.parents.includes(t)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");let d=h.branch;if(h.type===x.MERGE&&!t)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!a||!n.records.commits.has(a)){if(d===n.records.currBranch){let f=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw f.hash={text:`cherryPick ${e} ${a}`,token:`cherryPick ${e} ${a}`,expected:["cherry-pick abc"]},f}let c=n.records.branches.get(n.records.currBranch);if(c===void 0||!c){let f=new Error(`Incorrect usage of "cherry-pick". Current branch (${n.records.currBranch})has no commits`);throw f.hash={text:`cherryPick ${e} ${a}`,token:`cherryPick ${e} ${a}`,expected:["cherry-pick abc"]},f}let m=n.records.commits.get(c);if(m===void 0||!m){let f=new Error(`Incorrect usage of "cherry-pick". Current branch (${n.records.currBranch})has no commits`);throw f.hash={text:`cherryPick ${e} ${a}`,token:`cherryPick ${e} ${a}`,expected:["cherry-pick abc"]},f}let p={id:n.records.seq+"-"+A(),message:`cherry-picked ${h?.message} into ${n.records.currBranch}`,seq:n.records.seq++,parents:n.records.head==null?[]:[n.records.head.id,h.id],branch:n.records.currBranch,type:x.CHERRY_PICK,tags:o?o.filter(Boolean):[`cherry-pick:${h.id}${h.type===x.MERGE?`|parent:${t}`:""}`]};n.records.head=p,n.records.commits.set(p.id,p),n.records.branches.set(n.records.currBranch,p.id),u.debug(n.records.branches),u.debug("in cherryPick")}},"cherryPick"),ne=l(function(r){if(r=C.sanitizeText(r,M()),n.records.branches.has(r)){n.records.currBranch=r;let e=n.records.branches.get(n.records.currBranch);e===void 0||!e?n.records.head=null:n.records.head=n.records.commits.get(e)??null}else{let e=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${r}")`);throw e.hash={text:`checkout ${r}`,token:`checkout ${r}`,expected:[`branch ${r}`]},e}},"checkout");function W(r,e,a){let o=r.indexOf(e);o===-1?r.push(a):r.splice(o,1,a)}l(W,"upsert");function H(r){let e=r.reduce((t,s)=>t.seq>s.seq?t:s,r[0]),a="";r.forEach(function(t){t===e?a+=" *":a+=" |"});let o=[a,e.id,e.seq];for(let t in n.records.branches)n.records.branches.get(t)===e.id&&o.push(t);if(u.debug(o.join(" ")),e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){let t=n.records.commits.get(e.parents[0]);W(r,e,t),e.parents[1]&&r.push(n.records.commits.get(e.parents[1]))}else{if(e.parents.length==0)return;if(e.parents[0]){let t=n.records.commits.get(e.parents[0]);W(r,e,t)}}r=ce(r,t=>t.id),H(r)}l(H,"prettyPrintCommitHistory");var be=l(function(){u.debug(n.records.commits);let r=ie()[0];H([r])},"prettyPrint"),we=l(function(){n.reset(),F()},"clear"),Ce=l(function(){return[...n.records.branchConfig.values()].map((e,a)=>e.order!==null&&e.order!==void 0?e:_(I({},e),{order:parseFloat(`0.${a}`)})).sort((e,a)=>(e.order??0)-(a.order??0)).map(({name:e})=>({name:e}))},"getBranchesAsObjArray"),Be=l(function(){return n.records.branches},"getBranches"),ve=l(function(){return n.records.commits},"getCommits"),ie=l(function(){let r=[...n.records.commits.values()];return r.forEach(function(e){u.debug(e.id)}),r.sort((e,a)=>e.seq-a.seq),r},"getCommitsArray"),ke=l(function(){return n.records.currBranch},"getCurrentBranch"),Te=l(function(){return n.records.direction},"getDirection"),Ee=l(function(){return n.records.head},"getHead"),de={commitType:x,getConfig:M,setDirection:pe,setOptions:ge,getOptions:fe,commit:ye,branch:$e,merge:xe,cherryPick:ue,checkout:ne,prettyPrint:be,clear:we,getBranchesAsObjArray:Ce,getBranches:Be,getCommits:ve,getCommitsArray:ie,getCurrentBranch:ke,getDirection:Te,getHead:Ee,setAccTitle:K,getAccTitle:Y,getAccDescription:U,setAccDescription:Z,setDiagramTitle:V,getDiagramTitle:J},Le=l((r,e)=>{re(r,e),r.dir&&e.setDirection(r.dir);for(let a of r.statements)Me(a,e)},"populate"),Me=l((r,e)=>{let o={Commit:l(t=>e.commit(Pe(t)),"Commit"),Branch:l(t=>e.branch(Re(t)),"Branch"),Merge:l(t=>e.merge(Oe(t)),"Merge"),Checkout:l(t=>e.checkout(Ie(t)),"Checkout"),CherryPicking:l(t=>e.cherryPick(qe(t)),"CherryPicking")}[r.$type];o?o(r):u.error(`Unknown statement type: ${r.$type}`)},"parseStatement"),Pe=l(r=>({id:r.id,msg:r.message??"",type:r.type!==void 0?x[r.type]:x.NORMAL,tags:r.tags??void 0}),"parseCommit"),Re=l(r=>({name:r.name,order:r.order??0}),"parseBranch"),Oe=l(r=>({branch:r.branch,id:r.id??"",type:r.type!==void 0?x[r.type]:void 0,tags:r.tags??void 0}),"parseMerge"),Ie=l(r=>r.branch,"parseCheckout"),qe=l(r=>({id:r.id,targetId:"",tags:r.tags?.length===0?void 0:r.tags,parent:r.parent}),"parseCherryPicking"),Ge={parse:l(r=>N(null,null,function*(){let e=yield se("gitGraph",r);u.debug(e),Le(e,de)}),"parse")},T=10,E=40,B=4,v=2,L=8,b=new Map,w=new Map,q=30,P=new Map,G=[],k=0,$="LR",Ae=l(()=>{b.clear(),w.clear(),P.clear(),k=0,G=[],$="LR"},"clear"),he=l(r=>{let e=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof r=="string"?r.split(/\\n|\n|/gi):r).forEach(o=>{let t=document.createElementNS("http://www.w3.org/2000/svg","tspan");t.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),t.setAttribute("dy","1em"),t.setAttribute("x","0"),t.setAttribute("class","row"),t.textContent=o.trim(),e.appendChild(t)}),e},"drawText"),le=l(r=>{let e,a,o;return $==="BT"?(a=l((t,s)=>t<=s,"comparisonFunc"),o=1/0):(a=l((t,s)=>t>=s,"comparisonFunc"),o=0),r.forEach(t=>{let s=$==="TB"||$=="BT"?w.get(t)?.y:w.get(t)?.x;s!==void 0&&a(s,o)&&(e=t,o=s)}),e},"findClosestParent"),De=l(r=>{let e="",a=1/0;return r.forEach(o=>{let t=w.get(o).y;t<=a&&(e=o,a=t)}),e||void 0},"findClosestParentBT"),We=l((r,e,a)=>{let o=a,t=a,s=[];r.forEach(h=>{let d=e.get(h);if(!d)throw new Error(`Commit not found for key ${h}`);d.parents.length?(o=_e(d),t=Math.max(o,t)):s.push(d),Ne(d,o)}),o=t,s.forEach(h=>{Se(h,o,a)}),r.forEach(h=>{let d=e.get(h);if(d?.parents.length){let c=De(d.parents);o=w.get(c).y-E,o<=t&&(t=o);let m=b.get(d.branch).pos,p=o-T;w.set(d.id,{x:m,y:p})}})},"setParallelBTPos"),He=l(r=>{let e=le(r.parents.filter(o=>o!==null));if(!e)throw new Error(`Closest parent not found for commit ${r.id}`);let a=w.get(e)?.y;if(a===void 0)throw new Error(`Closest parent position not found for commit ${r.id}`);return a},"findClosestParentPos"),_e=l(r=>He(r)+E,"calculateCommitPosition"),Ne=l((r,e)=>{let a=b.get(r.branch);if(!a)throw new Error(`Branch not found for commit ${r.id}`);let o=a.pos,t=e+T;return w.set(r.id,{x:o,y:t}),{x:o,y:t}},"setCommitPosition"),Se=l((r,e,a)=>{let o=b.get(r.branch);if(!o)throw new Error(`Branch not found for commit ${r.id}`);let t=e+a,s=o.pos;w.set(r.id,{x:s,y:t})},"setRootPosition"),ze=l((r,e,a,o,t,s)=>{if(s===x.HIGHLIGHT)r.append("rect").attr("x",a.x-10).attr("y",a.y-10).attr("width",20).attr("height",20).attr("class",`commit ${e.id} commit-highlight${t%L} ${o}-outer`),r.append("rect").attr("x",a.x-6).attr("y",a.y-6).attr("width",12).attr("height",12).attr("class",`commit ${e.id} commit${t%L} ${o}-inner`);else if(s===x.CHERRY_PICK)r.append("circle").attr("cx",a.x).attr("cy",a.y).attr("r",10).attr("class",`commit ${e.id} ${o}`),r.append("circle").attr("cx",a.x-3).attr("cy",a.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${e.id} ${o}`),r.append("circle").attr("cx",a.x+3).attr("cy",a.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${e.id} ${o}`),r.append("line").attr("x1",a.x+3).attr("y1",a.y+1).attr("x2",a.x).attr("y2",a.y-5).attr("stroke","#fff").attr("class",`commit ${e.id} ${o}`),r.append("line").attr("x1",a.x-3).attr("y1",a.y+1).attr("x2",a.x).attr("y2",a.y-5).attr("stroke","#fff").attr("class",`commit ${e.id} ${o}`);else{let h=r.append("circle");if(h.attr("cx",a.x),h.attr("cy",a.y),h.attr("r",e.type===x.MERGE?9:10),h.attr("class",`commit ${e.id} commit${t%L}`),s===x.MERGE){let d=r.append("circle");d.attr("cx",a.x),d.attr("cy",a.y),d.attr("r",6),d.attr("class",`commit ${o} ${e.id} commit${t%L}`)}s===x.REVERSE&&r.append("path").attr("d",`M ${a.x-5},${a.y-5}L${a.x+5},${a.y+5}M${a.x-5},${a.y+5}L${a.x+5},${a.y-5}`).attr("class",`commit ${o} ${e.id} commit${t%L}`)}},"drawCommitBullet"),je=l((r,e,a,o,t)=>{if(e.type!==x.CHERRY_PICK&&(e.customId&&e.type===x.MERGE||e.type!==x.MERGE)&&t.showCommitLabel){let s=r.append("g"),h=s.insert("rect").attr("class","commit-label-bkg"),d=s.append("text").attr("x",o).attr("y",a.y+25).attr("class","commit-label").text(e.id),c=d.node()?.getBBox();if(c&&(h.attr("x",a.posWithOffset-c.width/2-v).attr("y",a.y+13.5).attr("width",c.width+2*v).attr("height",c.height+2*v),$==="TB"||$==="BT"?(h.attr("x",a.x-(c.width+4*B+5)).attr("y",a.y-12),d.attr("x",a.x-(c.width+4*B)).attr("y",a.y+c.height-12)):d.attr("x",a.posWithOffset-c.width/2),t.rotateCommitLabel))if($==="TB"||$==="BT")d.attr("transform","rotate(-45, "+a.x+", "+a.y+")"),h.attr("transform","rotate(-45, "+a.x+", "+a.y+")");else{let m=-7.5-(c.width+10)/25*9.5,p=10+c.width/25*8.5;s.attr("transform","translate("+m+", "+p+") rotate(-45, "+o+", "+a.y+")")}}},"drawCommitLabel"),Fe=l((r,e,a,o)=>{if(e.tags.length>0){let t=0,s=0,h=0,d=[];for(let c of e.tags.reverse()){let m=r.insert("polygon"),p=r.append("circle"),f=r.append("text").attr("y",a.y-16-t).attr("class","tag-label").text(c),i=f.node()?.getBBox();if(!i)throw new Error("Tag bbox not found");s=Math.max(s,i.width),h=Math.max(h,i.height),f.attr("x",a.posWithOffset-i.width/2),d.push({tag:f,hole:p,rect:m,yOffset:t}),t+=20}for(let{tag:c,hole:m,rect:p,yOffset:f}of d){let i=h/2,y=a.y-19.2-f;if(p.attr("class","tag-label-bkg").attr("points",` - ${o-s/2-B/2},${y+v} + ${o-s/2-B/2},${y+v} ${o-s/2-B/2},${y-v} ${a.posWithOffset-s/2-B},${y-i-v} ${a.posWithOffset+s/2+B},${y-i-v} diff --git a/src/google/adk/cli/browser/chunk-NALL4A3P.js b/src/google/adk/cli/browser/chunk-NALL4A3P.js index 8970e67502..54e9eec1d7 100644 --- a/src/google/adk/cli/browser/chunk-NALL4A3P.js +++ b/src/google/adk/cli/browser/chunk-NALL4A3P.js @@ -6,7 +6,7 @@ import{A as q,B as mt,C as Ce,D as Pe,E as hu,G as Z,I as tr,J as $t,M as qh,O a ${JSON.stringify(Object.fromEntries(n))}`));return}let s=parseInt(i);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=s}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(()=>P(this,null,function*(){let n=this.options.contentDecoder!==void 0?yield this.options.contentDecoder.decode(r):r,i=yield this.options.contentTypeDecoder.decode(n,this.options);this.callback(i)})).catch(n=>{this.fireError(n)})}}catch(r){this.fireError(r)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,Ep.default)().timer.setTimeout((e,r)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:r}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};vn.ReadableStreamMessageReader=$p});var Ry=X(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.WriteableStreamMessageWriter=En.AbstractMessageWriter=En.MessageWriter=void 0;var my=Rn(),fo=ls(),r$=xp(),gy=ci(),n$="Content-Length: ",yy=`\r `,Ty;(function(t){function e(r){let n=r;return n&&fo.func(n.dispose)&&fo.func(n.onClose)&&fo.func(n.onError)&&fo.func(n.write)}t.is=e})(Ty||(En.MessageWriter=Ty={}));var Al=class{constructor(){this.errorEmitter=new gy.Emitter,this.closeEmitter=new gy.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${fo.string(e.message)?e.message:"unknown"}`)}};En.AbstractMessageWriter=Al;var Sp;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0,my.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0,my.default)().applicationJson.encoder}}t.fromOptions=e})(Sp||(Sp={}));var kp=class extends Al{constructor(e,r){super(),this.writable=e,this.options=Sp.fromOptions(r),this.errorCount=0,this.writeSemaphore=new r$.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose())}write(e){return P(this,null,function*(){return this.writeSemaphore.lock(()=>P(this,null,function*(){return this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let i=[];return i.push(n$,n.byteLength.toString(),yy),i.push(yy),this.doWrite(e,i,n)},n=>{throw this.fireError(n),n})}))})}doWrite(e,r,n){return P(this,null,function*(){try{return yield this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(i){return this.handleError(i,e),Promise.reject(i)}})}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount)}end(){this.writable.end()}};En.WriteableStreamMessageWriter=kp});var xy=X($l=>{"use strict";Object.defineProperty($l,"__esModule",{value:!0});$l.AbstractMessageBuffer=void 0;var i$=13,s$=10,a$=`\r `,Np=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let r=0,n=0,i=0,s=0;e:for(;nthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],a=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,a}let r=this.allocNative(e),n=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let a=s.slice(0,e);r.set(a,n),n+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else r.set(s,n),n+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return r}};$l.AbstractMessageBuffer=Np});var Sy=X(J=>{"use strict";Object.defineProperty(J,"__esModule",{value:!0});J.createMessageConnection=J.ConnectionOptions=J.MessageStrategy=J.CancellationStrategy=J.CancellationSenderStrategy=J.CancellationReceiverStrategy=J.RequestCancellationReceiverStrategy=J.IdCancellationReceiverStrategy=J.ConnectionStrategy=J.ConnectionError=J.ConnectionErrors=J.LogTraceNotification=J.SetTraceNotification=J.TraceFormat=J.TraceValues=J.Trace=J.NullLogger=J.ProgressType=J.ProgressToken=void 0;var vy=Rn(),Fe=ls(),K=dp(),Ey=hp(),po=ci(),Cp=Ka(),go;(function(t){t.type=new K.NotificationType("$/cancelRequest")})(go||(go={}));var wp;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}t.is=e})(wp||(J.ProgressToken=wp={}));var ho;(function(t){t.type=new K.NotificationType("$/progress")})(ho||(ho={}));var Ip=class{constructor(){}};J.ProgressType=Ip;var _p;(function(t){function e(r){return Fe.func(r)}t.is=e})(_p||(_p={}));J.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var fe=(function(t){return t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose",t})(fe||(J.Trace=fe={})),Ay=(function(t){return t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose",t})(Ay||(J.TraceValues=Ay={}));(function(t){function e(n){if(!Fe.string(n))return t.Off;switch(n=n.toLowerCase(),n){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}t.fromString=e;function r(n){switch(n){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}t.toString=r})(fe||(J.Trace=fe={}));var Wt=(function(t){return t.Text="text",t.JSON="json",t})(Wt||(J.TraceFormat=Wt={}));(function(t){function e(r){return Fe.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(Wt||(J.TraceFormat=Wt={}));var bp;(function(t){t.type=new K.NotificationType("$/setTrace")})(bp||(J.SetTraceNotification=bp={}));var Sl;(function(t){t.type=new K.NotificationType("$/logTrace")})(Sl||(J.LogTraceNotification=Sl={}));var mo=(function(t){return t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening",t})(mo||(J.ConnectionErrors=mo={})),xs=class t extends Error{constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};J.ConnectionError=xs;var Pp;(function(t){function e(r){let n=r;return n&&Fe.func(n.cancelUndispatched)}t.is=e})(Pp||(J.ConnectionStrategy=Pp={}));var kl;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&Fe.func(n.createCancellationTokenSource)&&(n.dispose===void 0||Fe.func(n.dispose))}t.is=e})(kl||(J.IdCancellationReceiverStrategy=kl={}));var Op;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&Fe.func(n.createCancellationTokenSource)&&(n.dispose===void 0||Fe.func(n.dispose))}t.is=e})(Op||(J.RequestCancellationReceiverStrategy=Op={}));var Nl;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new Cp.CancellationTokenSource}});function e(r){return kl.is(r)||Op.is(r)}t.is=e})(Nl||(J.CancellationReceiverStrategy=Nl={}));var Cl;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(go.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&Fe.func(n.sendCancellation)&&Fe.func(n.cleanup)}t.is=e})(Cl||(J.CancellationSenderStrategy=Cl={}));var wl;(function(t){t.Message=Object.freeze({receiver:Nl.Message,sender:Cl.Message});function e(r){let n=r;return n&&Nl.is(n.receiver)&&Cl.is(n.sender)}t.is=e})(wl||(J.CancellationStrategy=wl={}));var Il;(function(t){function e(r){let n=r;return n&&Fe.func(n.handleMessage)}t.is=e})(Il||(J.MessageStrategy=Il={}));var $y;(function(t){function e(r){let n=r;return n&&(wl.is(n.cancellationStrategy)||Pp.is(n.connectionStrategy)||Il.is(n.messageStrategy))}t.is=e})($y||(J.ConnectionOptions=$y={}));var kr=(function(t){return t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed",t})(kr||{});function o$(t,e,r,n){let i=r!==void 0?r:J.NullLogger,s=0,a=0,o=0,c="2.0",l,u=new Map,p,h=new Map,g=new Map,C,k=new Ey.LinkedMap,G=new Map,M=new Set,b=new Map,E=fe.Off,H=Wt.Text,F,ye=kr.New,dr=new po.Emitter,Je=new po.Emitter,Qt=new po.Emitter,Kt=new po.Emitter,$=new po.Emitter,y=n&&n.cancellationStrategy?n.cancellationStrategy:wl.Message;function L(d){if(d===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+d.toString()}function O(d){return d===null?"res-unknown-"+(++o).toString():"res-"+d.toString()}function T(){return"not-"+(++a).toString()}function x(d,v){K.Message.isRequest(v)?d.set(L(v.id),v):K.Message.isResponse(v)?d.set(O(v.id),v):d.set(T(),v)}function A(d){}function _(){return ye===kr.Listening}function U(){return ye===kr.Closed}function N(){return ye===kr.Disposed}function Y(){(ye===kr.New||ye===kr.Listening)&&(ye=kr.Closed,Je.fire(void 0))}function Q(d){dr.fire([d,void 0,void 0])}function de(d){dr.fire(d)}t.onClose(Y),t.onError(Q),e.onClose(Y),e.onError(de);function ue(){C||k.size===0||(C=(0,vy.default)().timer.setImmediate(()=>{C=void 0,We()}))}function ve(d){K.Message.isRequest(d)?ot(d):K.Message.isNotification(d)?pr(d):K.Message.isResponse(d)?_t(d):Zt(d)}function We(){if(k.size===0)return;let d=k.shift();try{let v=n?.messageStrategy;Il.is(v)?v.handleMessage(d,ve):ve(d)}finally{ue()}}let js=d=>{try{if(K.Message.isNotification(d)&&d.method===go.type.method){let v=d.params.id,w=L(v),z=k.get(w);if(K.Message.isRequest(z)){let Te=n?.connectionStrategy,Ge=Te&&Te.cancelUndispatched?Te.cancelUndispatched(z,A):void 0;if(Ge&&(Ge.error!==void 0||Ge.result!==void 0)){k.delete(w),b.delete(v),Ge.id=z.id,Do(Ge,d.method,Date.now()),e.write(Ge).catch(()=>i.error("Sending response for canceled message failed."));return}}let ke=b.get(v);if(ke!==void 0){ke.cancel(),uu(d);return}else M.add(v)}x(k,d)}finally{ue()}};function ot(d){if(N())return;function v(oe,be,me){let Qe={jsonrpc:c,id:d.id};oe instanceof K.ResponseError?Qe.error=oe.toJson():Qe.result=oe===void 0?null:oe,Do(Qe,be,me),e.write(Qe).catch(()=>i.error("Sending response failed."))}function w(oe,be,me){let Qe={jsonrpc:c,id:d.id,error:oe.toJson()};Do(Qe,be,me),e.write(Qe).catch(()=>i.error("Sending response failed."))}function z(oe,be,me){oe===void 0&&(oe=null);let Qe={jsonrpc:c,id:d.id,result:oe};Do(Qe,be,me),e.write(Qe).catch(()=>i.error("Sending response failed."))}Qx(d);let ke=u.get(d.method),Te,Ge;ke&&(Te=ke.type,Ge=ke.handler);let je=Date.now();if(Ge||l){let oe=d.id??String(Date.now()),be=kl.is(y.receiver)?y.receiver.createCancellationTokenSource(oe):y.receiver.createCancellationTokenSource(d);d.id!==null&&M.has(d.id)&&be.cancel(),d.id!==null&&b.set(oe,be);try{let me;if(Ge)if(d.params===void 0){if(Te!==void 0&&Te.numberOfParams!==0){w(new K.ResponseError(K.ErrorCodes.InvalidParams,`Request ${d.method} defines ${Te.numberOfParams} params but received none.`),d.method,je);return}me=Ge(be.token)}else if(Array.isArray(d.params)){if(Te!==void 0&&Te.parameterStructures===K.ParameterStructures.byName){w(new K.ResponseError(K.ErrorCodes.InvalidParams,`Request ${d.method} defines parameters by name but received parameters by position`),d.method,je);return}me=Ge(...d.params,be.token)}else{if(Te!==void 0&&Te.parameterStructures===K.ParameterStructures.byPosition){w(new K.ResponseError(K.ErrorCodes.InvalidParams,`Request ${d.method} defines parameters by position but received parameters by name`),d.method,je);return}me=Ge(d.params,be.token)}else l&&(me=l(d.method,d.params,be.token));let Qe=me;me?Qe.then?Qe.then(Et=>{b.delete(oe),v(Et,d.method,je)},Et=>{b.delete(oe),Et instanceof K.ResponseError?w(Et,d.method,je):Et&&Fe.string(Et.message)?w(new K.ResponseError(K.ErrorCodes.InternalError,`Request ${d.method} failed with message: ${Et.message}`),d.method,je):w(new K.ResponseError(K.ErrorCodes.InternalError,`Request ${d.method} failed unexpectedly without providing any details.`),d.method,je)}):(b.delete(oe),v(me,d.method,je)):(b.delete(oe),z(me,d.method,je))}catch(me){b.delete(oe),me instanceof K.ResponseError?v(me,d.method,je):me&&Fe.string(me.message)?w(new K.ResponseError(K.ErrorCodes.InternalError,`Request ${d.method} failed with message: ${me.message}`),d.method,je):w(new K.ResponseError(K.ErrorCodes.InternalError,`Request ${d.method} failed unexpectedly without providing any details.`),d.method,je)}}else w(new K.ResponseError(K.ErrorCodes.MethodNotFound,`Unhandled method ${d.method}`),d.method,je)}function _t(d){if(!N())if(d.id===null)d.error?i.error(`Received response message without id: Error is: +${u}`);let h=u.substr(0,p),g=u.substr(p+1).trim();o.set(e?h.toLowerCase():h,g)}return o}tryReadBody(e){if(!(this._totalLengththis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],a=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,a}let r=this.allocNative(e),n=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let a=s.slice(0,e);r.set(a,n),n+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e}else r.set(s,n),n+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength}return r}};$l.AbstractMessageBuffer=Np});var Sy=X(J=>{"use strict";Object.defineProperty(J,"__esModule",{value:!0});J.createMessageConnection=J.ConnectionOptions=J.MessageStrategy=J.CancellationStrategy=J.CancellationSenderStrategy=J.CancellationReceiverStrategy=J.RequestCancellationReceiverStrategy=J.IdCancellationReceiverStrategy=J.ConnectionStrategy=J.ConnectionError=J.ConnectionErrors=J.LogTraceNotification=J.SetTraceNotification=J.TraceFormat=J.TraceValues=J.Trace=J.NullLogger=J.ProgressType=J.ProgressToken=void 0;var vy=Rn(),Fe=ls(),K=dp(),Ey=hp(),po=ci(),Cp=Ka(),go;(function(t){t.type=new K.NotificationType("$/cancelRequest")})(go||(go={}));var wp;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}t.is=e})(wp||(J.ProgressToken=wp={}));var ho;(function(t){t.type=new K.NotificationType("$/progress")})(ho||(ho={}));var Ip=class{constructor(){}};J.ProgressType=Ip;var _p;(function(t){function e(r){return Fe.func(r)}t.is=e})(_p||(_p={}));J.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var fe=(function(t){return t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose",t})(fe||(J.Trace=fe={})),Ay=(function(t){return t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose",t})(Ay||(J.TraceValues=Ay={}));(function(t){function e(n){if(!Fe.string(n))return t.Off;switch(n=n.toLowerCase(),n){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}t.fromString=e;function r(n){switch(n){case t.Off:return"off";case t.Messages:return"messages";case t.Compact:return"compact";case t.Verbose:return"verbose";default:return"off"}}t.toString=r})(fe||(J.Trace=fe={}));var Wt=(function(t){return t.Text="text",t.JSON="json",t})(Wt||(J.TraceFormat=Wt={}));(function(t){function e(r){return Fe.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}t.fromString=e})(Wt||(J.TraceFormat=Wt={}));var bp;(function(t){t.type=new K.NotificationType("$/setTrace")})(bp||(J.SetTraceNotification=bp={}));var Sl;(function(t){t.type=new K.NotificationType("$/logTrace")})(Sl||(J.LogTraceNotification=Sl={}));var mo=(function(t){return t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening",t})(mo||(J.ConnectionErrors=mo={})),xs=class t extends Error{constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype)}};J.ConnectionError=xs;var Pp;(function(t){function e(r){let n=r;return n&&Fe.func(n.cancelUndispatched)}t.is=e})(Pp||(J.ConnectionStrategy=Pp={}));var kl;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&Fe.func(n.createCancellationTokenSource)&&(n.dispose===void 0||Fe.func(n.dispose))}t.is=e})(kl||(J.IdCancellationReceiverStrategy=kl={}));var Op;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&Fe.func(n.createCancellationTokenSource)&&(n.dispose===void 0||Fe.func(n.dispose))}t.is=e})(Op||(J.RequestCancellationReceiverStrategy=Op={}));var Nl;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new Cp.CancellationTokenSource}});function e(r){return kl.is(r)||Op.is(r)}t.is=e})(Nl||(J.CancellationReceiverStrategy=Nl={}));var Cl;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(go.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&Fe.func(n.sendCancellation)&&Fe.func(n.cleanup)}t.is=e})(Cl||(J.CancellationSenderStrategy=Cl={}));var wl;(function(t){t.Message=Object.freeze({receiver:Nl.Message,sender:Cl.Message});function e(r){let n=r;return n&&Nl.is(n.receiver)&&Cl.is(n.sender)}t.is=e})(wl||(J.CancellationStrategy=wl={}));var Il;(function(t){function e(r){let n=r;return n&&Fe.func(n.handleMessage)}t.is=e})(Il||(J.MessageStrategy=Il={}));var $y;(function(t){function e(r){let n=r;return n&&(wl.is(n.cancellationStrategy)||Pp.is(n.connectionStrategy)||Il.is(n.messageStrategy))}t.is=e})($y||(J.ConnectionOptions=$y={}));var kr=(function(t){return t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed",t})(kr||{});function o$(t,e,r,n){let i=r!==void 0?r:J.NullLogger,s=0,a=0,o=0,c="2.0",l,u=new Map,p,h=new Map,g=new Map,C,k=new Ey.LinkedMap,G=new Map,M=new Set,b=new Map,E=fe.Off,H=Wt.Text,F,ye=kr.New,dr=new po.Emitter,Je=new po.Emitter,Qt=new po.Emitter,Kt=new po.Emitter,$=new po.Emitter,y=n&&n.cancellationStrategy?n.cancellationStrategy:wl.Message;function L(d){if(d===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+d.toString()}function O(d){return d===null?"res-unknown-"+(++o).toString():"res-"+d.toString()}function T(){return"not-"+(++a).toString()}function x(d,v){K.Message.isRequest(v)?d.set(L(v.id),v):K.Message.isResponse(v)?d.set(O(v.id),v):d.set(T(),v)}function A(d){}function _(){return ye===kr.Listening}function U(){return ye===kr.Closed}function N(){return ye===kr.Disposed}function Y(){(ye===kr.New||ye===kr.Listening)&&(ye=kr.Closed,Je.fire(void 0))}function Q(d){dr.fire([d,void 0,void 0])}function de(d){dr.fire(d)}t.onClose(Y),t.onError(Q),e.onClose(Y),e.onError(de);function ue(){C||k.size===0||(C=(0,vy.default)().timer.setImmediate(()=>{C=void 0,We()}))}function ve(d){K.Message.isRequest(d)?ot(d):K.Message.isNotification(d)?pr(d):K.Message.isResponse(d)?_t(d):Zt(d)}function We(){if(k.size===0)return;let d=k.shift();try{let v=n?.messageStrategy;Il.is(v)?v.handleMessage(d,ve):ve(d)}finally{ue()}}let js=d=>{try{if(K.Message.isNotification(d)&&d.method===go.type.method){let v=d.params.id,w=L(v),z=k.get(w);if(K.Message.isRequest(z)){let Te=n?.connectionStrategy,Ge=Te&&Te.cancelUndispatched?Te.cancelUndispatched(z,A):void 0;if(Ge&&(Ge.error!==void 0||Ge.result!==void 0)){k.delete(w),b.delete(v),Ge.id=z.id,Do(Ge,d.method,Date.now()),e.write(Ge).catch(()=>i.error("Sending response for canceled message failed."));return}}let ke=b.get(v);if(ke!==void 0){ke.cancel(),uu(d);return}else M.add(v)}x(k,d)}finally{ue()}};function ot(d){if(N())return;function v(oe,be,me){let Qe={jsonrpc:c,id:d.id};oe instanceof K.ResponseError?Qe.error=oe.toJson():Qe.result=oe===void 0?null:oe,Do(Qe,be,me),e.write(Qe).catch(()=>i.error("Sending response failed."))}function w(oe,be,me){let Qe={jsonrpc:c,id:d.id,error:oe.toJson()};Do(Qe,be,me),e.write(Qe).catch(()=>i.error("Sending response failed."))}function z(oe,be,me){oe===void 0&&(oe=null);let Qe={jsonrpc:c,id:d.id,result:oe};Do(Qe,be,me),e.write(Qe).catch(()=>i.error("Sending response failed."))}Qx(d);let ke=u.get(d.method),Te,Ge;ke&&(Te=ke.type,Ge=ke.handler);let je=Date.now();if(Ge||l){let oe=d.id??String(Date.now()),be=kl.is(y.receiver)?y.receiver.createCancellationTokenSource(oe):y.receiver.createCancellationTokenSource(d);d.id!==null&&M.has(d.id)&&be.cancel(),d.id!==null&&b.set(oe,be);try{let me;if(Ge)if(d.params===void 0){if(Te!==void 0&&Te.numberOfParams!==0){w(new K.ResponseError(K.ErrorCodes.InvalidParams,`Request ${d.method} defines ${Te.numberOfParams} params but received none.`),d.method,je);return}me=Ge(be.token)}else if(Array.isArray(d.params)){if(Te!==void 0&&Te.parameterStructures===K.ParameterStructures.byName){w(new K.ResponseError(K.ErrorCodes.InvalidParams,`Request ${d.method} defines parameters by name but received parameters by position`),d.method,je);return}me=Ge(...d.params,be.token)}else{if(Te!==void 0&&Te.parameterStructures===K.ParameterStructures.byPosition){w(new K.ResponseError(K.ErrorCodes.InvalidParams,`Request ${d.method} defines parameters by position but received parameters by name`),d.method,je);return}me=Ge(d.params,be.token)}else l&&(me=l(d.method,d.params,be.token));let Qe=me;me?Qe.then?Qe.then(Et=>{b.delete(oe),v(Et,d.method,je)},Et=>{b.delete(oe),Et instanceof K.ResponseError?w(Et,d.method,je):Et&&Fe.string(Et.message)?w(new K.ResponseError(K.ErrorCodes.InternalError,`Request ${d.method} failed with message: ${Et.message}`),d.method,je):w(new K.ResponseError(K.ErrorCodes.InternalError,`Request ${d.method} failed unexpectedly without providing any details.`),d.method,je)}):(b.delete(oe),v(me,d.method,je)):(b.delete(oe),z(me,d.method,je))}catch(me){b.delete(oe),me instanceof K.ResponseError?v(me,d.method,je):me&&Fe.string(me.message)?w(new K.ResponseError(K.ErrorCodes.InternalError,`Request ${d.method} failed with message: ${me.message}`),d.method,je):w(new K.ResponseError(K.ErrorCodes.InternalError,`Request ${d.method} failed unexpectedly without providing any details.`),d.method,je)}}else w(new K.ResponseError(K.ErrorCodes.MethodNotFound,`Unhandled method ${d.method}`),d.method,je)}function _t(d){if(!N())if(d.id===null)d.error?i.error(`Received response message without id: Error is: ${JSON.stringify(d.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let v=d.id,w=G.get(v);if(Zx(d,w),w!==void 0){G.delete(v);try{if(d.error){let z=d.error;w.reject(new K.ResponseError(z.code,z.message,z.data))}else if(d.result!==void 0)w.resolve(d.result);else throw new Error("Should never happen.")}catch(z){z.message?i.error(`Response handler '${w.method}' failed with message: ${z.message}`):i.error(`Response handler '${w.method}' failed unexpectedly.`)}}}}function pr(d){if(N())return;let v,w;if(d.method===go.type.method){let z=d.params.id;M.delete(z),uu(d);return}else{let z=h.get(d.method);z&&(w=z.handler,v=z.type)}if(w||p)try{if(uu(d),w)if(d.params===void 0)v!==void 0&&v.numberOfParams!==0&&v.parameterStructures!==K.ParameterStructures.byName&&i.error(`Notification ${d.method} defines ${v.numberOfParams} params but received none.`),w();else if(Array.isArray(d.params)){let z=d.params;d.method===ho.type.method&&z.length===2&&wp.is(z[0])?w({token:z[0],value:z[1]}):(v!==void 0&&(v.parameterStructures===K.ParameterStructures.byName&&i.error(`Notification ${d.method} defines parameters by name but received parameters by position`),v.numberOfParams!==d.params.length&&i.error(`Notification ${d.method} defines ${v.numberOfParams} params but received ${z.length} arguments`)),w(...z))}else v!==void 0&&v.parameterStructures===K.ParameterStructures.byPosition&&i.error(`Notification ${d.method} defines parameters by position but received parameters by name`),w(d.params);else p&&p(d.method,d.params)}catch(z){z.message?i.error(`Notification handler '${d.method}' failed with message: ${z.message}`):i.error(`Notification handler '${d.method}' failed unexpectedly.`)}else Qt.fire(d)}function Zt(d){if(!d){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message: ${JSON.stringify(d,null,4)}`);let v=d;if(Fe.string(v.id)||Fe.number(v.id)){let w=v.id,z=G.get(w);z&&z.reject(new Error("The received response has neither a result nor an error property."))}}function ft(d){if(d!=null)switch(E){case fe.Verbose:return JSON.stringify(d,null,4);case fe.Compact:return JSON.stringify(d);default:return}}function Bs(d){if(!(E===fe.Off||!F))if(H===Wt.Text){let v;(E===fe.Verbose||E===fe.Compact)&&d.params&&(v=`Params: ${ft(d.params)} @@ -72,7 +72,7 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e. `,type:Le.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}function gm(t,e,r){let n=[],i=!1,s=Or(Ve(Ce(t.modes))),a=In(s,c=>c[Qn]===He.NA),o=vm(r);return e&&D(a,c=>{let l=xm(c,o);if(l!==!1){let p={message:yE(c,l),type:l.issue,tokenType:c};n.push(p)}else q(c,"LINE_BREAKS")?c.LINE_BREAKS===!0&&(i=!0):yc(o,c.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found. This Lexer has been defined to track line and column information, But none of the Token Types can be identified as matching a line terminator. - See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS + See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS for details.`,type:Le.NO_LINE_BREAKS_FLAGS}),n}function ym(t){let e={},r=Pr(t);return D(r,n=>{let i=t[n];if(Ze(i))e[n]=[];else throw Error("non exhaustive match")}),e}function Tm(t){let e=t.PATTERN;if(tr(e))return!1;if(mr(e))return!0;if(q(e,"exec"))return!0;if(mt(e))return!1;throw Error("non exhaustive match")}function gE(t){return mt(t)&&t.length===1?t.charCodeAt(0):!1}var Rm={test:function(t){let e=t.length;for(let r=this.lastIndex;r Token Type Root cause: ${e.errMsg}. @@ -95,8 +95,8 @@ ${I(l,(h,g)=>` ${g+1}. ${h}`).join(` but found: '`+pt(e).image+"'";if(r)return i+r+a;{let c=`expecting at least one iteration which starts with one of these possible Token sequences:: <${I(t,l=>`[${I(l,u=>Vr(u)).join(",")}]`).join(" ,")}>`;return i+c+a}}};Object.freeze(Hr);var Lm={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<- inside top level rule: ->`+t.name+"<-"}},cr={buildDuplicateFoundError(t,e){function r(u){return u instanceof te?u.terminalType.name:u instanceof pe?u.nonTerminalName:""}let n=t.name,i=pt(e),s=i.idx,a=Ot(i),o=r(i),c=s>0,l=`->${a}${c?s:""}<- ${o?`with argument: ->${o}<-`:""} - appears more than once (${e.length} times) in the top level rule: ->${n}<-. - For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES + appears more than once (${e.length} times) in the top level rule: ->${n}<-. + For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES `;return l=l.replace(/[ \t]+/g," "),l=l.replace(/\s\s+/g,` `),l},buildNamespaceConflictError(t){return`Namespace conflict found in grammar. The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>. @@ -117,7 +117,7 @@ Only the last alternative may be an empty alternative.`},buildTooManyAlternative inside <${t.topLevelRule.name}> Rule. has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){let e=t.topLevelRule.name,r=I(t.leftRecursionPath,s=>s.name),n=`${e} --> ${r.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar. rule: <${e}> can be invoked from itself (directly or indirectly) -without consuming any Tokens. The grammar path that causes this is: +without consuming any Tokens. The grammar path that causes this is: ${n} To fix this refactor your grammar to remove the left recursion. see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Nt?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function Dm(t,e){let r=new gf(t,e);return r.resolveRefs(),r.errors}var gf=class extends Ct{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){D(Ce(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{let n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:it.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}};var yf=class extends jr{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=Ne(this.path.ruleStack).reverse(),this.occurrenceStack=Ne(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){Z(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},xc=class extends yf{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){let i=r.concat(n),s=new Ee({definition:i});this.possibleTokTypes=Jn(s),this.found=!0}}},Bi=class extends jr{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},vc=class extends Bi{walkMany(e,r,n){if(e.idx===this.occurrence){let i=pt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof te&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},va=class extends Bi{walkManySep(e,r,n){if(e.idx===this.occurrence){let i=pt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof te&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},Ec=class extends Bi{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){let i=pt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof te&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},Ea=class extends Bi{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){let i=pt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof te&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}};function Ac(t,e,r=[]){r=Ne(r);let n=[],i=0;function s(o){return o.concat(Ke(t,i+1))}function a(o){let c=Ac(s(o),e,r);return n.concat(c)}for(;r.length{Z(c.definition)===!1&&(n=a(c.definition))}),n;if(o instanceof te)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:Ke(t,i)}),n}function $c(t,e,r,n){let i="EXIT_NONE_TERMINAL",s=[i],a="EXIT_ALTERNATIVE",o=!1,c=e.length,l=c-n-1,u=[],p=[];for(p.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!Z(p);){let h=p.pop();if(h===a){o&&gr(p).idx<=l&&p.pop();continue}let g=h.def,C=h.idx,k=h.ruleStack,G=h.occurrenceStack;if(Z(g))continue;let M=g[0];if(M===i){let b={idx:C,def:Ke(g),ruleStack:tn(k),occurrenceStack:tn(G)};p.push(b)}else if(M instanceof te)if(C=0;b--){let E=M.definition[b],H={idx:C,def:E.definition.concat(Ke(g)),ruleStack:k,occurrenceStack:G};p.push(H),p.push(a)}else if(M instanceof Ee)p.push({idx:C,def:M.definition.concat(Ke(g)),ruleStack:k,occurrenceStack:G});else if(M instanceof Nt)p.push(NE(M,C,k,G));else throw Error("non exhaustive match")}return u}function NE(t,e,r,n){let i=Ne(r);i.push(t.name);let s=Ne(n);return s.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:s}}var De=(function(t){return t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION",t})(De||{});function Aa(t){if(t instanceof he||t==="Option")return De.OPTION;if(t instanceof se||t==="Repetition")return De.REPETITION;if(t instanceof Ae||t==="RepetitionMandatory")return De.REPETITION_MANDATORY;if(t instanceof $e||t==="RepetitionMandatoryWithSeparator")return De.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof Re||t==="RepetitionWithSeparator")return De.REPETITION_WITH_SEPARATOR;if(t instanceof xe||t==="Alternation")return De.ALTERNATION;throw Error("non exhaustive match")}function kc(t){let{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,s=Aa(n);return s===De.ALTERNATION?Wi(e,r,i):Vi(e,r,s,i)}function Fm(t,e,r,n,i,s){let a=Wi(t,e,r),o=Bm(a)?zi:Br;return s(a,n,o,i)}function Gm(t,e,r,n,i,s){let a=Vi(t,e,i,r),o=Bm(a)?zi:Br;return s(a[0],o,n)}function Um(t,e,r,n){let i=t.length,s=At(t,a=>At(a,o=>o.length===1));if(e)return function(a){let o=I(a,c=>c.GATE);for(let c=0;cVe(c)),o=Ue(a,(c,l,u)=>(D(l,p=>{q(c,p.tokenTypeIdx)||(c[p.tokenTypeIdx]=u),D(p.categoryMatches,h=>{q(c,h)||(c[h]=u)})}),c),{});return function(){let c=this.LA(1);return o[c.tokenTypeIdx]}}else return function(){for(let a=0;as.length===1),i=t.length;if(n&&!r){let s=Ve(t);if(s.length===1&&Z(s[0].categoryMatches)){let o=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{let a=Ue(s,(o,c,l)=>(o[c.tokenTypeIdx]=!0,D(c.categoryMatches,u=>{o[u]=!0}),o),[]);return function(){let o=this.LA(1);return a[o.tokenTypeIdx]===!0}}}else return function(){e:for(let s=0;sAc([a],1)),n=Mm(r.length),i=I(r,a=>{let o={};return D(a,c=>{let l=Tf(c.partialPath);D(l,u=>{o[u]=!0})}),o}),s=r;for(let a=1;a<=e;a++){let o=s;s=Mm(o.length);for(let c=0;c{let M=Tf(G.partialPath);D(M,b=>{i[c][b]=!0})})}}}}return n}function Wi(t,e,r,n){let i=new Sc(t,De.ALTERNATION,n);return e.accept(i),zm(i.result,r)}function Vi(t,e,r,n){let i=new Sc(t,r);e.accept(i);let s=i.result,o=new Rf(e,t,r).startWalking(),c=new Ee({definition:s}),l=new Ee({definition:o});return zm([c,l],n)}function Nc(t,e){e:for(let r=0;r{let i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function Bm(t){return At(t,e=>At(e,r=>At(r,n=>Z(n.categoryMatches))))}function Wm(t){let e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return I(e,r=>Object.assign({type:it.CUSTOM_LOOKAHEAD_VALIDATION},r))}function Vm(t,e,r,n){let i=ht(t,c=>wE(c,r)),s=LE(t,e,r),a=ht(t,c=>bE(c,r)),o=ht(t,c=>_E(c,t,n,r));return i.concat(s,a,o)}function wE(t,e){let r=new xf;t.accept(r);let n=r.allProductions,i=Uh(n,IE),s=Gt(i,o=>o.length>1);return I(Ce(s),o=>{let c=pt(o),l=e.buildDuplicateFoundError(t,o),u=Ot(c),p={message:l,type:it.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:u,occurrence:c.idx},h=Km(c);return h&&(p.parameter=h),p})}function IE(t){return`${Ot(t)}_#_${t.idx}_#_${Km(t)}`}function Km(t){return t instanceof te?t.terminalType.name:t instanceof pe?t.nonTerminalName:""}var xf=class extends Ct{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};function _E(t,e,r,n){let i=[];if(Ue(e,(a,o)=>o.name===t.name?a+1:a,0)>1){let a=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:a,type:it.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function Hm(t,e,r){let n=[],i;return Pe(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:it.INVALID_RULE_OVERRIDE,ruleName:t})),n}function Ef(t,e,r,n=[]){let i=[],s=Cc(e.definition);if(Z(s))return[];{let a=t.name;Pe(s,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:it.LEFT_RECURSION,ruleName:a});let c=wn(s,n.concat([t])),l=ht(c,u=>{let p=Ne(n);return p.push(u),Ef(t,u,r,p)});return i.concat(l)}}function Cc(t){let e=[];if(Z(t))return e;let r=pt(t);if(r instanceof pe)e.push(r.referencedRule);else if(r instanceof Ee||r instanceof he||r instanceof Ae||r instanceof $e||r instanceof Re||r instanceof se)e=e.concat(Cc(r.definition));else if(r instanceof xe)e=Ve(I(r.definition,s=>Cc(s.definition)));else if(!(r instanceof te))throw Error("non exhaustive match");let n=Xn(r),i=t.length>1;if(n&&i){let s=Ke(t);return e.concat(Cc(s))}else return e}var $a=class extends Ct{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function Ym(t,e){let r=new $a;t.accept(r);let n=r.alternations;return ht(n,s=>{let a=tn(s.definition);return ht(a,(o,c)=>{let l=$c([o],[],Br,1);return Z(l)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:s,emptyChoiceIdx:c}),type:it.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:s.idx,alternative:c+1}]:[]})})}function Xm(t,e,r){let n=new $a;t.accept(n);let i=n.alternations;return i=In(i,a=>a.ignoreAmbiguities===!0),ht(i,a=>{let o=a.idx,c=a.maxLookahead||e,l=Wi(o,t,c,a),u=PE(l,a,t,r),p=OE(l,a,t,r);return u.concat(p)})}var vf=class extends Ct{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};function bE(t,e){let r=new $a;t.accept(r);let n=r.alternations;return ht(n,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:s}),type:it.TOO_MANY_ALTS,ruleName:t.name,occurrence:s.idx}]:[])}function Jm(t,e,r){let n=[];return D(t,i=>{let s=new vf;i.accept(s);let a=s.allProductions;D(a,o=>{let c=Aa(o),l=o.maxLookahead||e,u=o.idx,h=Vi(u,i,c,l)[0];if(Z(Ve(h))){let g=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:g,type:it.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function PE(t,e,r,n){let i=[],s=Ue(t,(o,c,l)=>(e.definition[l].ignoreAmbiguities===!0||D(c,u=>{let p=[l];D(t,(h,g)=>{l!==g&&Nc(h,u)&&e.definition[g].ignoreAmbiguities!==!0&&p.push(g)}),p.length>1&&!Nc(i,u)&&(i.push(u),o.push({alts:p,path:u}))}),o),[]);return I(s,o=>{let c=I(o.alts,u=>u+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:c,prefixPath:o.path}),type:it.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:o.alts}})}function OE(t,e,r,n){let i=Ue(t,(a,o,c)=>{let l=I(o,u=>({idx:c,path:u}));return a.concat(l)},[]);return Or(ht(i,a=>{if(e.definition[a.idx].ignoreAmbiguities===!0)return[];let c=a.idx,l=a.path,u=ct(i,h=>e.definition[h.idx].ignoreAmbiguities!==!0&&h.idx{let g=[h.idx+1,c+1],C=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:g,prefixPath:h.path}),type:it.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:C,alternatives:g}})}))}function LE(t,e,r){let n=[],i=I(e,s=>s.name);return D(t,s=>{let a=s.name;if(Pe(i,a)){let o=r.buildNamespaceConflictError(s);n.push({message:o,type:it.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:a})}}),n}function Qm(t){let e=Ks(t,{errMsgProvider:Lm}),r={};return D(t.rules,n=>{r[n.name]=n}),Dm(r,e.errMsgProvider)}function Zm(t){return t=Ks(t,{errMsgProvider:cr}),Vm(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}var eg="MismatchedTokenException",tg="NoViableAltException",rg="EarlyExitException",ng="NotAllInputParsedException",ig=[eg,tg,rg,ng];Object.freeze(ig);function gn(t){return Pe(ig,t.name)}var Ki=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},Zn=class extends Ki{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=eg}},Sa=class extends Ki{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=tg}},ka=class extends Ki{constructor(e,r){super(e,r),this.name=ng}},Na=class extends Ki{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=rg}};var Af={},Sf="InRuleRecoveryException",$f=class extends Error{constructor(e){super(e),this.name=Sf}},wc=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=q(e,"recoveryEnabled")?e.recoveryEnabled:wt.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=DE)}getTokenToInsert(e){let r=Kr(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){let s=this.findReSyncTokenType(),a=this.exportLexerState(),o=[],c=!1,l=this.LA(1),u=this.LA(1),p=()=>{let h=this.LA(0),g=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:l,previous:h,ruleName:this.getCurrRuleFullName()}),C=new Zn(g,l,this.LA(0));C.resyncedTokens=tn(o),this.SAVE_ERROR(C)};for(;!c;)if(this.tokenMatcher(u,i)){p();return}else if(n.call(this)){p(),e.apply(this,r);return}else this.tokenMatcher(u,s)?c=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,o));this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){let n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new $f("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||Z(r))return!1;let n=this.LA(1);return Lr(r,s=>this.tokenMatcher(n,s))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){let r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return Pe(n,e)}findReSyncTokenType(){let e=this.flattenFollowSet(),r=this.LA(1),n=2;for(;;){let i=Lr(e,s=>xa(r,s));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Af;let e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return I(e,(n,i)=>i===0?Af:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){let e=I(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return Ve(e)}getFollowSetFromFollowKey(e){if(e===Af)return[Bt];let r=e.ruleName+e.idxInCallingRule+hc+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,Bt)||r.push(e),r}reSyncTo(e){let r=[],n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return tn(r)}attemptInRepetitionRecovery(e,r,n,i,s,a,o){}getCurrentGrammarPath(e,r){let n=this.getHumanReadableRuleStack(),i=Ne(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return I(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};function DE(t,e,r,n,i,s,a){let o=this.getKeyForAutomaticLookahead(n,i),c=this.firstAfterRepMap[o];if(c===void 0){let h=this.getCurrRuleFullName(),g=this.getGAstProductions()[h];c=new s(g,i).startWalking(),this.firstAfterRepMap[o]=c}let l=c.token,u=c.occurrence,p=c.isEndOfRule;this.RULE_STACK.length===1&&p&&l===void 0&&(l=Bt,u=1),!(l===void 0||u===void 0)&&this.shouldInRepetitionRecoveryBeTried(l,u,a)&&this.tryInRepetitionRecovery(t,e,r,l)}function Ic(t,e,r){return r|e|t}var Yr=class{constructor(e){var r;this.maxLookahead=(r=e?.maxLookahead)!==null&&r!==void 0?r:wt.maxLookahead}validate(e){let r=this.validateNoLeftRecursion(e.rules);if(Z(r)){let n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),s=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...r,...n,...i,...s]}return r}validateNoLeftRecursion(e){return ht(e,r=>Ef(r,r,cr))}validateEmptyOrAlternatives(e){return ht(e,r=>Ym(r,cr))}validateAmbiguousAlternationAlternatives(e,r){return ht(e,n=>Xm(n,r,cr))}validateSomeNonEmptyLookaheadPath(e,r){return Jm(e,r,cr)}buildLookaheadForAlternation(e){return Fm(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Um)}buildLookaheadForOptional(e){return Gm(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Aa(e.prodType),qm)}};var bc=class{initLooksAhead(e){this.dynamicTokensEnabled=q(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:wt.dynamicTokensEnabled,this.maxLookahead=q(e,"maxLookahead")?e.maxLookahead:wt.maxLookahead,this.lookaheadStrategy=q(e,"lookaheadStrategy")?e.lookaheadStrategy:new Yr({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){D(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{let{alternation:n,repetition:i,option:s,repetitionMandatory:a,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:c}=ME(r);D(n,l=>{let u=l.idx===0?"":l.idx;this.TRACE_INIT(`${Ot(l)}${u}`,()=>{let p=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:l.idx,rule:r,maxLookahead:l.maxLookahead||this.maxLookahead,hasPredicates:l.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),h=Ic(this.fullRuleNameToShort[r.name],256,l.idx);this.setLaFuncCache(h,p)})}),D(i,l=>{this.computeLookaheadFunc(r,l.idx,768,"Repetition",l.maxLookahead,Ot(l))}),D(s,l=>{this.computeLookaheadFunc(r,l.idx,512,"Option",l.maxLookahead,Ot(l))}),D(a,l=>{this.computeLookaheadFunc(r,l.idx,1024,"RepetitionMandatory",l.maxLookahead,Ot(l))}),D(o,l=>{this.computeLookaheadFunc(r,l.idx,1536,"RepetitionMandatoryWithSeparator",l.maxLookahead,Ot(l))}),D(c,l=>{this.computeLookaheadFunc(r,l.idx,1280,"RepetitionWithSeparator",l.maxLookahead,Ot(l))})})})}computeLookaheadFunc(e,r,n,i,s,a){this.TRACE_INIT(`${a}${r===0?"":r}`,()=>{let o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:s||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),c=Ic(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(c,o)})}getKeyForAutomaticLookahead(e,r){let n=this.getLastExplicitRuleShortName();return Ic(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},kf=class extends Ct{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},_c=new kf;function ME(t){_c.reset(),t.accept(_c);let e=_c.dslMethods;return _c.reset(),e}function wf(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffseta.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>: diff --git a/src/google/adk/cli/browser/chunk-QGHEW6NO.js b/src/google/adk/cli/browser/chunk-QGHEW6NO.js index 82b5b010fa..0ee96c53ab 100644 --- a/src/google/adk/cli/browser/chunk-QGHEW6NO.js +++ b/src/google/adk/cli/browser/chunk-QGHEW6NO.js @@ -57,7 +57,7 @@ Expecting `+se.join(", ")+", got '"+(this.terminals_[f]||f)+"'":fe="Parse error stroke: ${t.lineColor} !important; stroke-width: 1; } - + .edgeLabel { background-color: ${t.edgeLabelBackground}; } diff --git a/src/google/adk/cli/browser/chunk-S22PTQH2.js b/src/google/adk/cli/browser/chunk-S22PTQH2.js index 3bea5f3ccf..fad4a761c9 100644 --- a/src/google/adk/cli/browser/chunk-S22PTQH2.js +++ b/src/google/adk/cli/browser/chunk-S22PTQH2.js @@ -25,7 +25,7 @@ Expecting `+ye.join(", ")+", got '"+(this.terminals_[y]||y)+"'":qe="Parse error stroke: ${e.requirementBorderColor}; stroke-width: ${e.requirementBorderSize}; } - + .reqTitle, .reqLabel{ fill: ${e.requirementTextColor}; } diff --git a/src/google/adk/cli/browser/chunk-T2UY75BD.js b/src/google/adk/cli/browser/chunk-T2UY75BD.js index 63a477b5e3..3e9e5540d2 100644 --- a/src/google/adk/cli/browser/chunk-T2UY75BD.js +++ b/src/google/adk/cli/browser/chunk-T2UY75BD.js @@ -20,7 +20,7 @@ Expecting `+vt.join(", ")+", got '"+(this.terminals_[J]||J)+"'":Zt="Parse error .actor-line { stroke: ${e.actorLineColor}; } - + .innerArc { stroke-width: 1.5; stroke-dasharray: none; diff --git a/src/google/adk/cli/browser/chunk-W7PRDKNL.js b/src/google/adk/cli/browser/chunk-W7PRDKNL.js index 6db8bd616f..90526eb2a2 100644 --- a/src/google/adk/cli/browser/chunk-W7PRDKNL.js +++ b/src/google/adk/cli/browser/chunk-W7PRDKNL.js @@ -7,7 +7,7 @@ import{a as At,b as Ot}from"./chunk-DRBE27N3.js";import{a as w}from"./chunk-PRKF a${l},${r} 0,0,0 0,${o} l${-g},0`,"createCylinderPathD"),Ce=b((y,t,g,o,l,r)=>[`M${y},${t}`,`M${y+g},${t}`,`a${l},${r} 0,0,0 0,${-o}`,`l${-g},0`,`a${l},${r} 0,0,0 0,${o}`,`l${g},0`].join(" "),"createOuterCylinderPathD"),Pe=b((y,t,g,o,l,r)=>[`M${y+g/2},${-o/2}`,`a${l},${r} 0,0,0 0,${o}`].join(" "),"createInnerCylinderPathD");function Fs(y,t){return C(this,null,function*(){let{labelStyles:g,nodeStyles:o}=R(t);t.labelStyle=g;let{shapeSvg:l,bbox:r,label:f,halfPadding:a}=yield O(y,t,T(t)),c=t.look==="neo"?a*2:a,s=r.height+c,e=s/2,i=e/(2.5+s/50),h=r.width+i+c,{cssStyles:n}=t,p;if(t.look==="handDrawn"){let u=w.svg(l),m=Ce(0,0,h,s,i,e),d=Pe(0,0,h,s,i,e),x=u.path(m,N(t,{})),D=u.path(d,N(t,{fill:"none"}));p=l.insert(()=>D,":first-child"),p=l.insert(()=>x,":first-child"),p.attr("class","basic label-container"),n&&p.attr("style",n)}else{let u=Me(0,0,h,s,i,e);p=l.insert("path",":first-child").attr("d",u).attr("class","basic label-container").attr("style",st(n)).attr("style",o),p.attr("class","basic label-container"),n&&p.selectAll("path").attr("style",n),o&&p.selectAll("path").attr("style",o)}return p.attr("label-offset-x",i),p.attr("transform",`translate(${-h/2}, ${s/2} )`),f.attr("transform",`translate(${-(r.width/2)-i-(r.x-(r.left??0))}, ${-(r.height/2)-(r.y-(r.top??0))})`),A(t,p),t.intersect=function(u){let m=P.rect(t,u),d=m.y-(t.y??0);if(e!=0&&(Math.abs(d)<(t.height??0)/2||Math.abs(d)==(t.height??0)/2&&Math.abs(m.x-(t.x??0))>(t.width??0)/2-i)){let x=i*i*(1-d*d/(e*e));x!=0&&(x=Math.sqrt(Math.abs(x))),x=i-x,u.x-(t.x??0)>0&&(x=-x),m.x+=x}return m},l})}b(Fs,"tiltedCylinder");function Gs(y,t){return C(this,null,function*(){let{labelStyles:g,nodeStyles:o}=R(t);t.labelStyle=g;let{shapeSvg:l,bbox:r}=yield O(y,t,T(t)),f=r.width+t.padding,a=r.height+t.padding,c=[{x:-3*a/6,y:0},{x:f+3*a/6,y:0},{x:f,y:-a},{x:0,y:-a}],s,{cssStyles:e}=t;if(t.look==="handDrawn"){let i=w.svg(l),h=N(t,{}),n=z(c),p=i.path(n,h);s=l.insert(()=>p,":first-child").attr("transform",`translate(${-f/2}, ${a/2})`),e&&s.attr("style",e)}else s=ht(l,f,a,c);return o&&s.attr("style",o),t.width=f,t.height=a,A(t,s),t.intersect=function(i){return P.polygon(t,c,i)},l})}b(Gs,"trapezoid");function zs(y,t){return C(this,null,function*(){let{labelStyles:g,nodeStyles:o}=R(t);t.labelStyle=g;let{shapeSvg:l,bbox:r}=yield O(y,t,T(t)),f=60,a=20,c=Math.max(f,r.width+(t.padding??0)*2,t?.width??0),s=Math.max(a,r.height+(t.padding??0)*2,t?.height??0),{cssStyles:e}=t,i=w.svg(l),h=N(t,{});t.look!=="handDrawn"&&(h.roughness=0,h.fillStyle="solid");let n=[{x:-c/2*.8,y:-s/2},{x:c/2*.8,y:-s/2},{x:c/2,y:-s/2*.6},{x:c/2,y:s/2},{x:-c/2,y:s/2},{x:-c/2,y:-s/2*.6}],p=z(n),u=i.path(p,h),m=l.insert(()=>u,":first-child");return m.attr("class","basic label-container"),e&&t.look!=="handDrawn"&&m.selectChildren("path").attr("style",e),o&&t.look!=="handDrawn"&&m.selectChildren("path").attr("style",o),A(t,m),t.intersect=function(d){return P.polygon(t,n,d)},l})}b(zs,"trapezoidalPentagon");function Vs(y,t){return C(this,null,function*(){let{labelStyles:g,nodeStyles:o}=R(t);t.labelStyle=g;let{shapeSvg:l,bbox:r,label:f}=yield O(y,t,T(t)),a=t.useHtmlLabels||it(U()),c=r.width+(t.padding??0),s=c+r.height,e=c+r.height,i=[{x:0,y:0},{x:e,y:0},{x:e/2,y:-s}],{cssStyles:h}=t,n=w.svg(l),p=N(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");let u=z(i),m=n.path(u,p),d=l.insert(()=>m,":first-child").attr("transform",`translate(${-s/2}, ${s/2})`);return h&&t.look!=="handDrawn"&&d.selectChildren("path").attr("style",h),o&&t.look!=="handDrawn"&&d.selectChildren("path").attr("style",o),t.width=c,t.height=s,A(t,d),f.attr("transform",`translate(${-r.width/2-(r.x-(r.left??0))}, ${s/2-(r.height+(t.padding??0)/(a?2:1)-(r.y-(r.top??0)))})`),t.intersect=function(x){return Z.info("Triangle intersect",t,i,x),P.polygon(t,i,x)},l})}b(Vs,"triangle");function Zs(y,t){return C(this,null,function*(){let{labelStyles:g,nodeStyles:o}=R(t);t.labelStyle=g;let{shapeSvg:l,bbox:r,label:f}=yield O(y,t,T(t)),a=Math.max(r.width+(t.padding??0)*2,t?.width??0),c=Math.max(r.height+(t.padding??0)*2,t?.height??0),s=c/8,e=c+s,{cssStyles:i}=t,n=70-a,p=n>0?n/2:0,u=w.svg(l),m=N(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");let d=[{x:-a/2-p,y:e/2},...ft(-a/2-p,e/2,a/2+p,e/2,s,.8),{x:a/2+p,y:-e/2},{x:-a/2-p,y:-e/2}],x=z(d),D=u.path(x,m),S=l.insert(()=>D,":first-child");return S.attr("class","basic label-container"),i&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),o&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",o),S.attr("transform",`translate(0,${-s/2})`),f.attr("transform",`translate(${-a/2+(t.padding??0)-(r.x-(r.left??0))},${-c/2+(t.padding??0)-s-(r.y-(r.top??0))})`),A(t,S),t.intersect=function($){return P.polygon(t,d,$)},l})}b(Zs,"waveEdgedRectangle");function Js(y,t){return C(this,null,function*(){let{labelStyles:g,nodeStyles:o}=R(t);t.labelStyle=g;let{shapeSvg:l,bbox:r}=yield O(y,t,T(t)),f=100,a=50,c=Math.max(r.width+(t.padding??0)*2,t?.width??0),s=Math.max(r.height+(t.padding??0)*2,t?.height??0),e=c/s,i=c,h=s;i>h*e?h=i/e:i=h*e,i=Math.max(i,f),h=Math.max(h,a);let n=Math.min(h*.2,h/4),p=h+n*2,{cssStyles:u}=t,m=w.svg(l),d=N(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");let x=[{x:-i/2,y:p/2},...ft(-i/2,p/2,i/2,p/2,n,1),{x:i/2,y:-p/2},...ft(i/2,-p/2,-i/2,-p/2,n,-1)],D=z(x),S=m.path(D,d),$=l.insert(()=>S,":first-child");return $.attr("class","basic label-container"),u&&t.look!=="handDrawn"&&$.selectAll("path").attr("style",u),o&&t.look!=="handDrawn"&&$.selectAll("path").attr("style",o),A(t,$),t.intersect=function(v){return P.polygon(t,x,v)},l})}b(Js,"waveRectangle");function Qs(y,t){return C(this,null,function*(){let{labelStyles:g,nodeStyles:o}=R(t);t.labelStyle=g;let{shapeSvg:l,bbox:r,label:f}=yield O(y,t,T(t)),a=Math.max(r.width+(t.padding??0)*2,t?.width??0),c=Math.max(r.height+(t.padding??0)*2,t?.height??0),s=5,e=-a/2,i=-c/2,{cssStyles:h}=t,n=w.svg(l),p=N(t,{}),u=[{x:e-s,y:i-s},{x:e-s,y:i+c},{x:e+a,y:i+c},{x:e+a,y:i-s}],m=`M${e-s},${i-s} L${e+a},${i-s} L${e+a},${i+c} L${e-s},${i+c} L${e-s},${i-s} M${e-s},${i} L${e+a},${i} - M${e},${i-s} L${e},${i+c}`;t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");let d=n.path(m,p),x=l.insert(()=>d,":first-child");return x.attr("transform",`translate(${s/2}, ${s/2})`),x.attr("class","basic label-container"),h&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",h),o&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",o),f.attr("transform",`translate(${-(r.width/2)+s/2-(r.x-(r.left??0))}, ${-(r.height/2)+s/2-(r.y-(r.top??0))})`),A(t,x),t.intersect=function(D){return P.polygon(t,u,D)},l})}b(Qs,"windowPane");function Et(y,t){return C(this,null,function*(){let g=t;if(g.alias&&(t.label=g.alias),t.look==="handDrawn"){let{themeVariables:G}=dt(),{background:J}=G,et=rt(tt({},t),{id:t.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${J}`]});yield Et(y,et)}let o=dt();t.useHtmlLabels=o.htmlLabels;let l=o.er?.diagramPadding??10,r=o.er?.entityPadding??6,{cssStyles:f}=t,{labelStyles:a,nodeStyles:c}=R(t);if(g.attributes.length===0&&t.label){let G={rx:0,ry:0,labelPaddingX:l,labelPaddingY:l*1.5,classes:""};wt(t.label,o)+G.labelPaddingX*20){let G=i.width+l*2-(u+m+d+x);u+=G/$,m+=G/$,d>0&&(d+=G/$),x>0&&(x+=G/$)}let B=u+m+d+x,k=w.svg(e),M=N(t,{});t.look!=="handDrawn"&&(M.roughness=0,M.fillStyle="solid");let I=0;p.length>0&&(I=p.reduce((G,J)=>G+(J?.rowHeight??0),0));let Y=Math.max(v.width+l*2,t?.width||0,B),V=Math.max((I??0)+i.height,t?.height||0),q=-Y/2,W=-V/2;e.selectAll("g:not(:first-child)").each((G,J,et)=>{let at=Q(et[J]),pt=at.attr("transform"),gt=0,Tt=0;if(pt){let Ct=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(pt);Ct&&(gt=parseFloat(Ct[1]),Tt=parseFloat(Ct[2]),at.attr("class").includes("attribute-name")?gt+=u:at.attr("class").includes("attribute-keys")?gt+=u+m:at.attr("class").includes("attribute-comment")&&(gt+=u+m+d))}at.attr("transform",`translate(${q+l/2+gt}, ${Tt+W+i.height+r/2})`)}),e.select(".name").attr("transform","translate("+-i.width/2+", "+(W+r/2)+")");let j=k.rectangle(q,W,Y,V,M),L=e.insert(()=>j,":first-child").attr("style",f.join("")),{themeVariables:F}=dt(),{rowEven:_,rowOdd:H,nodeBorder:X}=F;n.push(0);for(let[G,J]of p.entries()){let at=(G+1)%2===0&&J.yOffset!==0,pt=k.rectangle(q,i.height+W+J?.yOffset,Y,J?.rowHeight,rt(tt({},M),{fill:at?_:H,stroke:X}));e.insert(()=>pt,"g.label").attr("style",f.join("")).attr("class",`row-rect-${at?"even":"odd"}`)}let E=k.line(q,i.height+W,Y+q,i.height+W,M);e.insert(()=>E).attr("class","divider"),E=k.line(u+q,i.height+W,u+q,V+W,M),e.insert(()=>E).attr("class","divider"),D&&(E=k.line(u+m+q,i.height+W,u+m+q,V+W,M),e.insert(()=>E).attr("class","divider")),S&&(E=k.line(u+m+d+q,i.height+W,u+m+d+q,V+W,M),e.insert(()=>E).attr("class","divider"));for(let G of n)E=k.line(q,i.height+W+G,Y+q,i.height+W+G,M),e.insert(()=>E).attr("class","divider");if(A(t,L),c&&t.look!=="handDrawn"){let J=c.split(";")?.filter(et=>et.includes("stroke"))?.map(et=>`${et}`).join("; ");e.selectAll("path").attr("style",J??""),e.selectAll(".row-rect-even path").attr("style",c)}return t.intersect=function(G){return P.rect(t,G)},e})}b(Et,"erBox");function mt(a,c,s){return C(this,arguments,function*(y,t,g,o=0,l=0,r=[],f=""){let e=y.insert("g").attr("class",`label ${r.join(" ")}`).attr("transform",`translate(${o}, ${l})`).attr("style",f);t!==Nt(t)&&(t=Nt(t),t=t.replaceAll("<","<").replaceAll(">",">"));let i=e.node().appendChild(yield nt(e,t,{width:wt(t,g)+100,style:f,useHtmlLabels:g.htmlLabels},g));if(t.includes("<")||t.includes(">")){let n=i.children[0];for(n.textContent=n.textContent.replaceAll("<","<").replaceAll(">",">");n.childNodes[0];)n=n.childNodes[0],n.textContent=n.textContent.replaceAll("<","<").replaceAll(">",">")}let h=i.getBBox();if(ut(g.htmlLabels)){let n=i.children[0];n.style.textAlign="start";let p=Q(i);h=n.getBoundingClientRect(),p.attr("width",h.width),p.attr("height",h.height)}return h})}b(mt,"addText");function Us(r,f,a,c){return C(this,arguments,function*(y,t,g,o,l=g.class.padding??12){let s=o?0:3,e=y.insert("g").attr("class",T(t)).attr("id",t.domId||t.id),i=null,h=null,n=null,p=null,u=0,m=0,d=0;if(i=e.insert("g").attr("class","annotation-group text"),t.annotations.length>0){let v=t.annotations[0];yield vt(i,{text:`\xAB${v}\xBB`},0),u=i.node().getBBox().height}h=e.insert("g").attr("class","label-group text"),yield vt(h,t,0,["font-weight: bolder"]);let x=h.node().getBBox();m=x.height,n=e.insert("g").attr("class","members-group text");let D=0;for(let v of t.members){let B=yield vt(n,v,D,[v.parseClassifier()]);D+=B+s}d=n.node().getBBox().height,d<=0&&(d=l/2),p=e.insert("g").attr("class","methods-group text");let S=0;for(let v of t.methods){let B=yield vt(p,v,S,[v.parseClassifier()]);S+=B+s}let $=e.node().getBBox();if(i!==null){let v=i.node().getBBox();i.attr("transform",`translate(${-v.width/2})`)}return h.attr("transform",`translate(${-x.width/2}, ${u})`),$=e.node().getBBox(),n.attr("transform",`translate(0, ${u+m+l*2})`),$=e.node().getBBox(),p.attr("transform",`translate(0, ${u+m+(d?d+l*4:l*2)})`),$=e.node().getBBox(),{shapeSvg:e,bbox:$}})}b(Us,"textHelper");function vt(l,r,f){return C(this,arguments,function*(y,t,g,o=[]){let a=y.insert("g").attr("class","label").attr("style",o.join("; ")),c=dt(),s="useHtmlLabels"in t?t.useHtmlLabels:ut(c.htmlLabels)??!0,e="";"text"in t?e=t.text:e=t.label,!s&&e.startsWith("\\")&&(e=e.substring(1)),_t(e)&&(s=!0);let i=yield nt(a,Rt(bt(e)),{width:wt(e,c)+50,classes:"markdown-node-label",useHtmlLabels:s},c),h,n=1;if(s){let p=i.children[0],u=Q(i);n=p.innerHTML.split("
").length,p.innerHTML.includes("")&&(n+=p.innerHTML.split("").length-1);let m=p.getElementsByTagName("img");if(m){let d=e.replace(/]*>/g,"").trim()==="";yield Promise.all([...m].map(x=>new Promise(D=>{function S(){if(x.style.display="flex",x.style.flexDirection="column",d){let $=c.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,B=parseInt($,10)*5+"px";x.style.minWidth=B,x.style.maxWidth=B}else x.style.width="100%";D(x)}b(S,"setupImage"),setTimeout(()=>{x.complete&&S()}),x.addEventListener("error",S),x.addEventListener("load",S)})))}h=p.getBoundingClientRect(),u.attr("width",h.width),u.attr("height",h.height)}else{o.includes("font-weight: bolder")&&Q(i).selectAll("tspan").attr("font-weight",""),n=i.children.length;let p=i.children[0];(i.textContent===""||i.textContent.includes(">"))&&(p.textContent=e[0]+e.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),e[1]===" "&&(p.textContent=p.textContent[0]+" "+p.textContent.substring(1))),p.textContent==="undefined"&&(p.textContent=""),h=i.getBBox()}return a.attr("transform","translate(0,"+(-h.height/(2*n)+g)+")"),h.height})}b(vt,"addText");function Ks(y,t){return C(this,null,function*(){let g=U(),o=g.class.padding??12,l=o,r=t.useHtmlLabels??ut(g.htmlLabels)??!0,f=t;f.annotations=f.annotations??[],f.members=f.members??[],f.methods=f.methods??[];let{shapeSvg:a,bbox:c}=yield Us(y,t,g,r,l),{labelStyles:s,nodeStyles:e}=R(t);t.labelStyle=s,t.cssStyles=f.styles||"";let i=f.styles?.join(";")||e||"";t.cssStyles||(t.cssStyles=i.replaceAll("!important","").split(";"));let h=f.members.length===0&&f.methods.length===0&&!g.class?.hideEmptyMembersBox,n=w.svg(a),p=N(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");let u=c.width,m=c.height;f.members.length===0&&f.methods.length===0?m+=l:f.members.length>0&&f.methods.length===0&&(m+=l*2);let d=-u/2,x=-m/2,D=n.rectangle(d-o,x-o-(h?o:f.members.length===0&&f.methods.length===0?-o/2:0),u+2*o,m+2*o+(h?o*2:f.members.length===0&&f.methods.length===0?-o:0),p),S=a.insert(()=>D,":first-child");S.attr("class","basic label-container");let $=S.node().getBBox();a.selectAll(".text").each((M,I,Y)=>{let V=Q(Y[I]),q=V.attr("transform"),W=0;if(q){let _=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(q);_&&(W=parseFloat(_[2]))}let j=W+x+o-(h?o:f.members.length===0&&f.methods.length===0?-o/2:0);r||(j-=4);let L=d;(V.attr("class").includes("label-group")||V.attr("class").includes("annotation-group"))&&(L=-V.node()?.getBBox().width/2||0,a.selectAll("text").each(function(F,_,H){window.getComputedStyle(H[_]).textAnchor==="middle"&&(L=0)})),V.attr("transform",`translate(${L}, ${j})`)});let v=a.select(".annotation-group").node().getBBox().height-(h?o/2:0)||0,B=a.select(".label-group").node().getBBox().height-(h?o/2:0)||0,k=a.select(".members-group").node().getBBox().height-(h?o/2:0)||0;if(f.members.length>0||f.methods.length>0||h){let M=n.line($.x,v+B+x+o,$.x+$.width,v+B+x+o,p);a.insert(()=>M).attr("class","divider").attr("style",i)}if(h||f.members.length>0||f.methods.length>0){let M=n.line($.x,v+B+k+x+l*2+o,$.x+$.width,v+B+k+x+o+l*2,p);a.insert(()=>M).attr("class","divider").attr("style",i)}if(f.look!=="handDrawn"&&a.selectAll("path").attr("style",i),S.select(":nth-child(2)").attr("style",i),a.selectAll(".divider").select("path").attr("style",i),t.labelStyle?a.selectAll("span").attr("style",t.labelStyle):a.selectAll("span").attr("style",i),!r){let M=RegExp(/color\s*:\s*([^;]*)/),I=M.exec(i);if(I){let Y=I[0].replace("color","fill");a.selectAll("tspan").attr("style",Y)}else if(s){let Y=M.exec(s);if(Y){let V=Y[0].replace("color","fill");a.selectAll("tspan").attr("style",V)}}}return A(t,S),t.intersect=function(M){return P.rect(t,M)},a})}b(Ks,"classBox");function te(y,t){return C(this,null,function*(){let{labelStyles:g,nodeStyles:o}=R(t);t.labelStyle=g;let l=t,r=t,f=20,a=20,c="verifyMethod"in t,s=T(t),e=y.insert("g").attr("class",s).attr("id",t.domId??t.id),i;c?i=yield lt(e,`<<${l.type}>>`,0,t.labelStyle):i=yield lt(e,"<<Element>>",0,t.labelStyle);let h=i,n=yield lt(e,l.name,h,t.labelStyle+"; font-weight: bold;");if(h+=n+a,c){let v=yield lt(e,`${l.requirementId?`ID: ${l.requirementId}`:""}`,h,t.labelStyle);h+=v;let B=yield lt(e,`${l.text?`Text: ${l.text}`:""}`,h,t.labelStyle);h+=B;let k=yield lt(e,`${l.risk?`Risk: ${l.risk}`:""}`,h,t.labelStyle);h+=k,yield lt(e,`${l.verifyMethod?`Verification: ${l.verifyMethod}`:""}`,h,t.labelStyle)}else{let v=yield lt(e,`${r.type?`Type: ${r.type}`:""}`,h,t.labelStyle);h+=v,yield lt(e,`${r.docRef?`Doc Ref: ${r.docRef}`:""}`,h,t.labelStyle)}let p=(e.node()?.getBBox().width??200)+f,u=(e.node()?.getBBox().height??200)+f,m=-p/2,d=-u/2,x=w.svg(e),D=N(t,{});t.look!=="handDrawn"&&(D.roughness=0,D.fillStyle="solid");let S=x.rectangle(m,d,p,u,D),$=e.insert(()=>S,":first-child");if($.attr("class","basic label-container").attr("style",o),e.selectAll(".label").each((v,B,k)=>{let M=Q(k[B]),I=M.attr("transform"),Y=0,V=0;if(I){let L=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(I);L&&(Y=parseFloat(L[1]),V=parseFloat(L[2]))}let q=V-u/2,W=m+f/2;(B===0||B===1)&&(W=Y),M.attr("transform",`translate(${W}, ${q+f})`)}),h>i+n+a){let v=x.line(m,d+i+n+a,m+p,d+i+n+a,D);e.insert(()=>v).attr("style",o)}return A(t,$),t.intersect=function(v){return P.rect(t,v)},e})}b(te,"requirementBox");function lt(y,t,g,o=""){return C(this,null,function*(){if(t==="")return 0;let l=y.insert("g").attr("class","label").attr("style",o),r=U(),f=r.htmlLabels??!0,a=yield nt(l,Rt(bt(t)),{width:wt(t,r)+50,classes:"markdown-node-label",useHtmlLabels:f,style:o},r),c;if(f){let s=a.children[0],e=Q(a);c=s.getBoundingClientRect(),e.attr("width",c.width),e.attr("height",c.height)}else{let s=a.children[0];for(let e of s.children)e.textContent=e.textContent.replaceAll(">",">").replaceAll("<","<"),o&&e.setAttribute("style",o);c=a.getBBox(),c.height+=6}return l.attr("transform",`translate(${-c.width/2},${-c.height/2+g})`),c.height})}b(lt,"addText");var Ne=b(y=>{switch(y){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");function se(o,l,r){return C(this,arguments,function*(y,t,{config:g}){let{labelStyles:f,nodeStyles:a}=R(t);t.labelStyle=f||"";let c=10,s=t.width;t.width=(t.width??200)-10;let{shapeSvg:e,bbox:i,label:h}=yield O(y,t,T(t)),n=t.padding||10,p="",u;"ticket"in t&&t.ticket&&g?.kanban?.ticketBaseUrl&&(p=g?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),u=e.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",p).attr("target","_blank"));let m={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1},d,x;u?{label:d,bbox:x}=yield Lt(u,"ticket"in t&&t.ticket||"",m):{label:d,bbox:x}=yield Lt(e,"ticket"in t&&t.ticket||"",m);let{label:D,bbox:S}=yield Lt(e,"assigned"in t&&t.assigned||"",m);t.width=s;let $=10,v=t?.width||0,B=Math.max(x.height,S.height)/2,k=Math.max(i.height+$*2,t?.height||0)+B,M=-v/2,I=-k/2;h.attr("transform","translate("+(n-v/2)+", "+(-B-i.height/2)+")"),d.attr("transform","translate("+(n-v/2)+", "+(-B+i.height/2)+")"),D.attr("transform","translate("+(n+v/2-S.width-2*c)+", "+(-B+i.height/2)+")");let Y,{rx:V,ry:q}=t,{cssStyles:W}=t;if(t.look==="handDrawn"){let j=w.svg(e),L=N(t,{}),F=V||q?j.path(yt(M,I,v,k,V||0),L):j.rectangle(M,I,v,k,L);Y=e.insert(()=>F,":first-child"),Y.attr("class","basic label-container").attr("style",W||null)}else{Y=e.insert("rect",":first-child"),Y.attr("class","basic label-container __APA__").attr("style",a).attr("rx",V??5).attr("ry",q??5).attr("x",M).attr("y",I).attr("width",v).attr("height",k);let j="priority"in t&&t.priority;if(j){let L=e.append("line"),F=M+2,_=I+Math.floor((V??0)/2),H=I+k-Math.floor((V??0)/2);L.attr("x1",F).attr("y1",_).attr("x2",F).attr("y2",H).attr("stroke-width","4").attr("stroke",Ne(j))}}return A(t,Y),t.height=k,t.intersect=function(j){return P.rect(t,j)},e})}b(se,"kanbanItem");function ee(y,t){return C(this,null,function*(){let{labelStyles:g,nodeStyles:o}=R(t);t.labelStyle=g;let{shapeSvg:l,bbox:r,halfPadding:f,label:a}=yield O(y,t,T(t)),c=r.width+10*f,s=r.height+8*f,e=.15*c,{cssStyles:i}=t,h=r.width+20,n=r.height+20,p=Math.max(c,h),u=Math.max(s,n);a.attr("transform",`translate(${-r.width/2}, ${-r.height/2})`);let m,d=`M0 0 + M${e},${i-s} L${e},${i+c}`;t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");let d=n.path(m,p),x=l.insert(()=>d,":first-child");return x.attr("transform",`translate(${s/2}, ${s/2})`),x.attr("class","basic label-container"),h&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",h),o&&t.look!=="handDrawn"&&x.selectAll("path").attr("style",o),f.attr("transform",`translate(${-(r.width/2)+s/2-(r.x-(r.left??0))}, ${-(r.height/2)+s/2-(r.y-(r.top??0))})`),A(t,x),t.intersect=function(D){return P.polygon(t,u,D)},l})}b(Qs,"windowPane");function Et(y,t){return C(this,null,function*(){let g=t;if(g.alias&&(t.label=g.alias),t.look==="handDrawn"){let{themeVariables:G}=dt(),{background:J}=G,et=rt(tt({},t),{id:t.id+"-background",look:"default",cssStyles:["stroke: none",`fill: ${J}`]});yield Et(y,et)}let o=dt();t.useHtmlLabels=o.htmlLabels;let l=o.er?.diagramPadding??10,r=o.er?.entityPadding??6,{cssStyles:f}=t,{labelStyles:a,nodeStyles:c}=R(t);if(g.attributes.length===0&&t.label){let G={rx:0,ry:0,labelPaddingX:l,labelPaddingY:l*1.5,classes:""};wt(t.label,o)+G.labelPaddingX*20){let G=i.width+l*2-(u+m+d+x);u+=G/$,m+=G/$,d>0&&(d+=G/$),x>0&&(x+=G/$)}let B=u+m+d+x,k=w.svg(e),M=N(t,{});t.look!=="handDrawn"&&(M.roughness=0,M.fillStyle="solid");let I=0;p.length>0&&(I=p.reduce((G,J)=>G+(J?.rowHeight??0),0));let Y=Math.max(v.width+l*2,t?.width||0,B),V=Math.max((I??0)+i.height,t?.height||0),q=-Y/2,W=-V/2;e.selectAll("g:not(:first-child)").each((G,J,et)=>{let at=Q(et[J]),pt=at.attr("transform"),gt=0,Tt=0;if(pt){let Ct=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(pt);Ct&&(gt=parseFloat(Ct[1]),Tt=parseFloat(Ct[2]),at.attr("class").includes("attribute-name")?gt+=u:at.attr("class").includes("attribute-keys")?gt+=u+m:at.attr("class").includes("attribute-comment")&&(gt+=u+m+d))}at.attr("transform",`translate(${q+l/2+gt}, ${Tt+W+i.height+r/2})`)}),e.select(".name").attr("transform","translate("+-i.width/2+", "+(W+r/2)+")");let j=k.rectangle(q,W,Y,V,M),L=e.insert(()=>j,":first-child").attr("style",f.join("")),{themeVariables:F}=dt(),{rowEven:_,rowOdd:H,nodeBorder:X}=F;n.push(0);for(let[G,J]of p.entries()){let at=(G+1)%2===0&&J.yOffset!==0,pt=k.rectangle(q,i.height+W+J?.yOffset,Y,J?.rowHeight,rt(tt({},M),{fill:at?_:H,stroke:X}));e.insert(()=>pt,"g.label").attr("style",f.join("")).attr("class",`row-rect-${at?"even":"odd"}`)}let E=k.line(q,i.height+W,Y+q,i.height+W,M);e.insert(()=>E).attr("class","divider"),E=k.line(u+q,i.height+W,u+q,V+W,M),e.insert(()=>E).attr("class","divider"),D&&(E=k.line(u+m+q,i.height+W,u+m+q,V+W,M),e.insert(()=>E).attr("class","divider")),S&&(E=k.line(u+m+d+q,i.height+W,u+m+d+q,V+W,M),e.insert(()=>E).attr("class","divider"));for(let G of n)E=k.line(q,i.height+W+G,Y+q,i.height+W+G,M),e.insert(()=>E).attr("class","divider");if(A(t,L),c&&t.look!=="handDrawn"){let J=c.split(";")?.filter(et=>et.includes("stroke"))?.map(et=>`${et}`).join("; ");e.selectAll("path").attr("style",J??""),e.selectAll(".row-rect-even path").attr("style",c)}return t.intersect=function(G){return P.rect(t,G)},e})}b(Et,"erBox");function mt(a,c,s){return C(this,arguments,function*(y,t,g,o=0,l=0,r=[],f=""){let e=y.insert("g").attr("class",`label ${r.join(" ")}`).attr("transform",`translate(${o}, ${l})`).attr("style",f);t!==Nt(t)&&(t=Nt(t),t=t.replaceAll("<","<").replaceAll(">",">"));let i=e.node().appendChild(yield nt(e,t,{width:wt(t,g)+100,style:f,useHtmlLabels:g.htmlLabels},g));if(t.includes("<")||t.includes(">")){let n=i.children[0];for(n.textContent=n.textContent.replaceAll("<","<").replaceAll(">",">");n.childNodes[0];)n=n.childNodes[0],n.textContent=n.textContent.replaceAll("<","<").replaceAll(">",">")}let h=i.getBBox();if(ut(g.htmlLabels)){let n=i.children[0];n.style.textAlign="start";let p=Q(i);h=n.getBoundingClientRect(),p.attr("width",h.width),p.attr("height",h.height)}return h})}b(mt,"addText");function Us(r,f,a,c){return C(this,arguments,function*(y,t,g,o,l=g.class.padding??12){let s=o?0:3,e=y.insert("g").attr("class",T(t)).attr("id",t.domId||t.id),i=null,h=null,n=null,p=null,u=0,m=0,d=0;if(i=e.insert("g").attr("class","annotation-group text"),t.annotations.length>0){let v=t.annotations[0];yield vt(i,{text:`\xAB${v}\xBB`},0),u=i.node().getBBox().height}h=e.insert("g").attr("class","label-group text"),yield vt(h,t,0,["font-weight: bolder"]);let x=h.node().getBBox();m=x.height,n=e.insert("g").attr("class","members-group text");let D=0;for(let v of t.members){let B=yield vt(n,v,D,[v.parseClassifier()]);D+=B+s}d=n.node().getBBox().height,d<=0&&(d=l/2),p=e.insert("g").attr("class","methods-group text");let S=0;for(let v of t.methods){let B=yield vt(p,v,S,[v.parseClassifier()]);S+=B+s}let $=e.node().getBBox();if(i!==null){let v=i.node().getBBox();i.attr("transform",`translate(${-v.width/2})`)}return h.attr("transform",`translate(${-x.width/2}, ${u})`),$=e.node().getBBox(),n.attr("transform",`translate(0, ${u+m+l*2})`),$=e.node().getBBox(),p.attr("transform",`translate(0, ${u+m+(d?d+l*4:l*2)})`),$=e.node().getBBox(),{shapeSvg:e,bbox:$}})}b(Us,"textHelper");function vt(l,r,f){return C(this,arguments,function*(y,t,g,o=[]){let a=y.insert("g").attr("class","label").attr("style",o.join("; ")),c=dt(),s="useHtmlLabels"in t?t.useHtmlLabels:ut(c.htmlLabels)??!0,e="";"text"in t?e=t.text:e=t.label,!s&&e.startsWith("\\")&&(e=e.substring(1)),_t(e)&&(s=!0);let i=yield nt(a,Rt(bt(e)),{width:wt(e,c)+50,classes:"markdown-node-label",useHtmlLabels:s},c),h,n=1;if(s){let p=i.children[0],u=Q(i);n=p.innerHTML.split("
").length,p.innerHTML.includes("")&&(n+=p.innerHTML.split("").length-1);let m=p.getElementsByTagName("img");if(m){let d=e.replace(/]*>/g,"").trim()==="";yield Promise.all([...m].map(x=>new Promise(D=>{function S(){if(x.style.display="flex",x.style.flexDirection="column",d){let $=c.fontSize?.toString()??window.getComputedStyle(document.body).fontSize,B=parseInt($,10)*5+"px";x.style.minWidth=B,x.style.maxWidth=B}else x.style.width="100%";D(x)}b(S,"setupImage"),setTimeout(()=>{x.complete&&S()}),x.addEventListener("error",S),x.addEventListener("load",S)})))}h=p.getBoundingClientRect(),u.attr("width",h.width),u.attr("height",h.height)}else{o.includes("font-weight: bolder")&&Q(i).selectAll("tspan").attr("font-weight",""),n=i.children.length;let p=i.children[0];(i.textContent===""||i.textContent.includes(">"))&&(p.textContent=e[0]+e.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),e[1]===" "&&(p.textContent=p.textContent[0]+" "+p.textContent.substring(1))),p.textContent==="undefined"&&(p.textContent=""),h=i.getBBox()}return a.attr("transform","translate(0,"+(-h.height/(2*n)+g)+")"),h.height})}b(vt,"addText");function Ks(y,t){return C(this,null,function*(){let g=U(),o=g.class.padding??12,l=o,r=t.useHtmlLabels??ut(g.htmlLabels)??!0,f=t;f.annotations=f.annotations??[],f.members=f.members??[],f.methods=f.methods??[];let{shapeSvg:a,bbox:c}=yield Us(y,t,g,r,l),{labelStyles:s,nodeStyles:e}=R(t);t.labelStyle=s,t.cssStyles=f.styles||"";let i=f.styles?.join(";")||e||"";t.cssStyles||(t.cssStyles=i.replaceAll("!important","").split(";"));let h=f.members.length===0&&f.methods.length===0&&!g.class?.hideEmptyMembersBox,n=w.svg(a),p=N(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");let u=c.width,m=c.height;f.members.length===0&&f.methods.length===0?m+=l:f.members.length>0&&f.methods.length===0&&(m+=l*2);let d=-u/2,x=-m/2,D=n.rectangle(d-o,x-o-(h?o:f.members.length===0&&f.methods.length===0?-o/2:0),u+2*o,m+2*o+(h?o*2:f.members.length===0&&f.methods.length===0?-o:0),p),S=a.insert(()=>D,":first-child");S.attr("class","basic label-container");let $=S.node().getBBox();a.selectAll(".text").each((M,I,Y)=>{let V=Q(Y[I]),q=V.attr("transform"),W=0;if(q){let _=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(q);_&&(W=parseFloat(_[2]))}let j=W+x+o-(h?o:f.members.length===0&&f.methods.length===0?-o/2:0);r||(j-=4);let L=d;(V.attr("class").includes("label-group")||V.attr("class").includes("annotation-group"))&&(L=-V.node()?.getBBox().width/2||0,a.selectAll("text").each(function(F,_,H){window.getComputedStyle(H[_]).textAnchor==="middle"&&(L=0)})),V.attr("transform",`translate(${L}, ${j})`)});let v=a.select(".annotation-group").node().getBBox().height-(h?o/2:0)||0,B=a.select(".label-group").node().getBBox().height-(h?o/2:0)||0,k=a.select(".members-group").node().getBBox().height-(h?o/2:0)||0;if(f.members.length>0||f.methods.length>0||h){let M=n.line($.x,v+B+x+o,$.x+$.width,v+B+x+o,p);a.insert(()=>M).attr("class","divider").attr("style",i)}if(h||f.members.length>0||f.methods.length>0){let M=n.line($.x,v+B+k+x+l*2+o,$.x+$.width,v+B+k+x+o+l*2,p);a.insert(()=>M).attr("class","divider").attr("style",i)}if(f.look!=="handDrawn"&&a.selectAll("path").attr("style",i),S.select(":nth-child(2)").attr("style",i),a.selectAll(".divider").select("path").attr("style",i),t.labelStyle?a.selectAll("span").attr("style",t.labelStyle):a.selectAll("span").attr("style",i),!r){let M=RegExp(/color\s*:\s*([^;]*)/),I=M.exec(i);if(I){let Y=I[0].replace("color","fill");a.selectAll("tspan").attr("style",Y)}else if(s){let Y=M.exec(s);if(Y){let V=Y[0].replace("color","fill");a.selectAll("tspan").attr("style",V)}}}return A(t,S),t.intersect=function(M){return P.rect(t,M)},a})}b(Ks,"classBox");function te(y,t){return C(this,null,function*(){let{labelStyles:g,nodeStyles:o}=R(t);t.labelStyle=g;let l=t,r=t,f=20,a=20,c="verifyMethod"in t,s=T(t),e=y.insert("g").attr("class",s).attr("id",t.domId??t.id),i;c?i=yield lt(e,`<<${l.type}>>`,0,t.labelStyle):i=yield lt(e,"<<Element>>",0,t.labelStyle);let h=i,n=yield lt(e,l.name,h,t.labelStyle+"; font-weight: bold;");if(h+=n+a,c){let v=yield lt(e,`${l.requirementId?`ID: ${l.requirementId}`:""}`,h,t.labelStyle);h+=v;let B=yield lt(e,`${l.text?`Text: ${l.text}`:""}`,h,t.labelStyle);h+=B;let k=yield lt(e,`${l.risk?`Risk: ${l.risk}`:""}`,h,t.labelStyle);h+=k,yield lt(e,`${l.verifyMethod?`Verification: ${l.verifyMethod}`:""}`,h,t.labelStyle)}else{let v=yield lt(e,`${r.type?`Type: ${r.type}`:""}`,h,t.labelStyle);h+=v,yield lt(e,`${r.docRef?`Doc Ref: ${r.docRef}`:""}`,h,t.labelStyle)}let p=(e.node()?.getBBox().width??200)+f,u=(e.node()?.getBBox().height??200)+f,m=-p/2,d=-u/2,x=w.svg(e),D=N(t,{});t.look!=="handDrawn"&&(D.roughness=0,D.fillStyle="solid");let S=x.rectangle(m,d,p,u,D),$=e.insert(()=>S,":first-child");if($.attr("class","basic label-container").attr("style",o),e.selectAll(".label").each((v,B,k)=>{let M=Q(k[B]),I=M.attr("transform"),Y=0,V=0;if(I){let L=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(I);L&&(Y=parseFloat(L[1]),V=parseFloat(L[2]))}let q=V-u/2,W=m+f/2;(B===0||B===1)&&(W=Y),M.attr("transform",`translate(${W}, ${q+f})`)}),h>i+n+a){let v=x.line(m,d+i+n+a,m+p,d+i+n+a,D);e.insert(()=>v).attr("style",o)}return A(t,$),t.intersect=function(v){return P.rect(t,v)},e})}b(te,"requirementBox");function lt(y,t,g,o=""){return C(this,null,function*(){if(t==="")return 0;let l=y.insert("g").attr("class","label").attr("style",o),r=U(),f=r.htmlLabels??!0,a=yield nt(l,Rt(bt(t)),{width:wt(t,r)+50,classes:"markdown-node-label",useHtmlLabels:f,style:o},r),c;if(f){let s=a.children[0],e=Q(a);c=s.getBoundingClientRect(),e.attr("width",c.width),e.attr("height",c.height)}else{let s=a.children[0];for(let e of s.children)e.textContent=e.textContent.replaceAll(">",">").replaceAll("<","<"),o&&e.setAttribute("style",o);c=a.getBBox(),c.height+=6}return l.attr("transform",`translate(${-c.width/2},${-c.height/2+g})`),c.height})}b(lt,"addText");var Ne=b(y=>{switch(y){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");function se(o,l,r){return C(this,arguments,function*(y,t,{config:g}){let{labelStyles:f,nodeStyles:a}=R(t);t.labelStyle=f||"";let c=10,s=t.width;t.width=(t.width??200)-10;let{shapeSvg:e,bbox:i,label:h}=yield O(y,t,T(t)),n=t.padding||10,p="",u;"ticket"in t&&t.ticket&&g?.kanban?.ticketBaseUrl&&(p=g?.kanban?.ticketBaseUrl.replace("#TICKET#",t.ticket),u=e.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",p).attr("target","_blank"));let m={useHtmlLabels:t.useHtmlLabels,labelStyle:t.labelStyle||"",width:t.width,img:t.img,padding:t.padding||8,centerLabel:!1},d,x;u?{label:d,bbox:x}=yield Lt(u,"ticket"in t&&t.ticket||"",m):{label:d,bbox:x}=yield Lt(e,"ticket"in t&&t.ticket||"",m);let{label:D,bbox:S}=yield Lt(e,"assigned"in t&&t.assigned||"",m);t.width=s;let $=10,v=t?.width||0,B=Math.max(x.height,S.height)/2,k=Math.max(i.height+$*2,t?.height||0)+B,M=-v/2,I=-k/2;h.attr("transform","translate("+(n-v/2)+", "+(-B-i.height/2)+")"),d.attr("transform","translate("+(n-v/2)+", "+(-B+i.height/2)+")"),D.attr("transform","translate("+(n+v/2-S.width-2*c)+", "+(-B+i.height/2)+")");let Y,{rx:V,ry:q}=t,{cssStyles:W}=t;if(t.look==="handDrawn"){let j=w.svg(e),L=N(t,{}),F=V||q?j.path(yt(M,I,v,k,V||0),L):j.rectangle(M,I,v,k,L);Y=e.insert(()=>F,":first-child"),Y.attr("class","basic label-container").attr("style",W||null)}else{Y=e.insert("rect",":first-child"),Y.attr("class","basic label-container __APA__").attr("style",a).attr("rx",V??5).attr("ry",q??5).attr("x",M).attr("y",I).attr("width",v).attr("height",k);let j="priority"in t&&t.priority;if(j){let L=e.append("line"),F=M+2,_=I+Math.floor((V??0)/2),H=I+k-Math.floor((V??0)/2);L.attr("x1",F).attr("y1",_).attr("x2",F).attr("y2",H).attr("stroke-width","4").attr("stroke",Ne(j))}}return A(t,Y),t.height=k,t.intersect=function(j){return P.rect(t,j)},e})}b(se,"kanbanItem");function ee(y,t){return C(this,null,function*(){let{labelStyles:g,nodeStyles:o}=R(t);t.labelStyle=g;let{shapeSvg:l,bbox:r,halfPadding:f,label:a}=yield O(y,t,T(t)),c=r.width+10*f,s=r.height+8*f,e=.15*c,{cssStyles:i}=t,h=r.width+20,n=r.height+20,p=Math.max(c,h),u=Math.max(s,n);a.attr("transform",`translate(${-r.width/2}, ${-r.height/2})`);let m,d=`M0 0 a${e},${e} 1 0,0 ${p*.25},${-1*u*.1} a${e},${e} 1 0,0 ${p*.25},0 a${e},${e} 1 0,0 ${p*.25},0 @@ -25,7 +25,7 @@ import{a as At,b as Ot}from"./chunk-DRBE27N3.js";import{a as w}from"./chunk-PRKF a${e},${e} 1 0,0 ${-1*p*.1},${-1*u*.33} a${e*.8},${e*.8} 1 0,0 0,${-1*u*.34} a${e},${e} 1 0,0 ${p*.1},${-1*u*.33} - H0 V0 Z`;if(t.look==="handDrawn"){let x=w.svg(l),D=N(t,{}),S=x.path(d,D);m=l.insert(()=>S,":first-child"),m.attr("class","basic label-container").attr("style",st(i))}else m=l.insert("path",":first-child").attr("class","basic label-container").attr("style",o).attr("d",d);return m.attr("transform",`translate(${-p/2}, ${-u/2})`),A(t,m),t.calcIntersect=function(x,D){return P.rect(x,D)},t.intersect=function(x){return Z.info("Bang intersect",t,x),P.rect(t,x)},l})}b(ee,"bang");function ae(y,t){return C(this,null,function*(){let{labelStyles:g,nodeStyles:o}=R(t);t.labelStyle=g;let{shapeSvg:l,bbox:r,halfPadding:f,label:a}=yield O(y,t,T(t)),c=r.width+2*f,s=r.height+2*f,e=.15*c,i=.25*c,h=.35*c,n=.2*c,{cssStyles:p}=t,u,m=`M0 0 + H0 V0 Z`;if(t.look==="handDrawn"){let x=w.svg(l),D=N(t,{}),S=x.path(d,D);m=l.insert(()=>S,":first-child"),m.attr("class","basic label-container").attr("style",st(i))}else m=l.insert("path",":first-child").attr("class","basic label-container").attr("style",o).attr("d",d);return m.attr("transform",`translate(${-p/2}, ${-u/2})`),A(t,m),t.calcIntersect=function(x,D){return P.rect(x,D)},t.intersect=function(x){return Z.info("Bang intersect",t,x),P.rect(t,x)},l})}b(ee,"bang");function ae(y,t){return C(this,null,function*(){let{labelStyles:g,nodeStyles:o}=R(t);t.labelStyle=g;let{shapeSvg:l,bbox:r,halfPadding:f,label:a}=yield O(y,t,T(t)),c=r.width+2*f,s=r.height+2*f,e=.15*c,i=.25*c,h=.35*c,n=.2*c,{cssStyles:p}=t,u,m=`M0 0 a${e},${e} 0 0,1 ${c*.25},${-1*c*.1} a${h},${h} 1 0,1 ${c*.4},${-1*c*.1} a${i},${i} 1 0,1 ${c*.35},${c*.2} diff --git a/src/google/adk/cli/browser/chunk-YVVLWU7S.js b/src/google/adk/cli/browser/chunk-YVVLWU7S.js index cc35b07e1f..203c8675f1 100644 --- a/src/google/adk/cli/browser/chunk-YVVLWU7S.js +++ b/src/google/adk/cli/browser/chunk-YVVLWU7S.js @@ -33,10 +33,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho vec2 v = ab*vec2(-cs.y,cs.x); w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v)); } - + // compute final point and distance float d = length(p-ab*vec2(cos(w),sin(w))); - + // return signed distance return (dot(p/ab,p/ab)>1.0) ? d : -d; } @@ -45,16 +45,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho uniform mat3 uPanZoomMatrix; uniform int uAtlasSize; - + // instanced in vec2 aPosition; // a vertex from the unit square - + in mat3 aTransform; // used to transform verticies, eg into a bounding box in int aVertType; // the type of thing we are rendering // the z-index that is output when using picking mode in vec4 aIndex; - + // For textures in int aAtlasId; // which shader unit/atlas to use in vec4 aTex; // x/y/w/h of texture in atlas @@ -74,7 +74,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho out vec4 vColor; out vec2 vPosition; // flat values are not interpolated - flat out int vAtlasId; + flat out int vAtlasId; flat out int vVertType; flat out vec2 vTopRight; flat out vec2 vBotLeft; @@ -82,7 +82,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho flat out vec4 vBorderColor; flat out vec2 vBorderWidth; flat out vec4 vIndex; - + void main(void) { int vid = gl_VertexID; vec2 position = aPosition; // TODO make this a vec3, simplifies some code below @@ -105,7 +105,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0); } - else if(aVertType == `).concat(Gt," || aVertType == ").concat(pa,` + else if(aVertType == `).concat(Gt," || aVertType == ").concat(pa,` || aVertType == `).concat(sn," || aVertType == ").concat(ga,`) { // simple shapes // the bounding box is needed by the fragment shader @@ -135,7 +135,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0); vColor = aColor; - } + } else if(aVertType == `).concat(Xl,`) { vec2 pointA = aPointAPointB.xy; vec2 pointB = aPointAPointB.zw; @@ -184,7 +184,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho } vColor = aColor; - } + } else if(aVertType == `).concat(Ts,` && vid < 3) { // massage the first triangle into an edge arrow if(vid == 0) @@ -236,16 +236,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `).concat(vm,` vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha - return vec4( + return vec4( top.rgb + (bot.rgb * (1.0 - top.a)), - top.a + (bot.a * (1.0 - top.a)) + top.a + (bot.a * (1.0 - top.a)) ); } vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance // scale to the zoom level so that borders don't look blurry when zoomed in // note 1.5 is an aribitrary value chosen because it looks good - return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d))); + return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d))); } void main(void) { @@ -253,7 +253,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho // look up the texel from the texture unit `).concat(i.map(function(u){return"if(vAtlasId == ".concat(u,") outColor = texture(uTexture").concat(u,", vTexCoord);")}).join(` else `),` - } + } else if(vVertType == `).concat(Ts,`) { // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out'; outColor = blend(vColor, uBGColor); @@ -262,7 +262,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho else if(vVertType == `).concat(Gt,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done } - else if(vVertType == `).concat(Gt," || vVertType == ").concat(pa,` + else if(vVertType == `).concat(Gt," || vVertType == ").concat(pa,` || vVertType == `).concat(sn," || vVertType == ").concat(ga,`) { // use SDF float outerBorder = vBorderWidth[0]; @@ -297,7 +297,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor; vec4 innerBorderColor = blend(vBorderColor, vColor); outColor = distInterp(innerBorderColor, outerColor, d); - } + } else { vec4 outerColor; if(innerBorder == 0.0 && outerBorder == 0.0) { diff --git a/src/google/adk/cli/browser/index.html b/src/google/adk/cli/browser/index.html index 059998a4c2..df99030534 100644 --- a/src/google/adk/cli/browser/index.html +++ b/src/google/adk/cli/browser/index.html @@ -32,7 +32,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCajshE7g.woff2) format('woff2'); unicode-range: U+0308, U+0530-058F, U+2010, U+2024, U+25CC, U+FB13-FB17; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -41,7 +41,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCYjshE7g.woff2) format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -50,7 +50,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCljshE7g.woff2) format('woff2'); unicode-range: U+02C7, U+02D8-02D9, U+02DB, U+0307, U+1400-167F, U+18B0-18F5, U+25CC, U+11AB0-11ABF; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -59,7 +59,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCHjshE7g.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -68,7 +68,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCOjshE7g.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -77,7 +77,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCLjshE7g.woff2) format('woff2'); unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B09; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -86,7 +86,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCbjshE7g.woff2) format('woff2'); unicode-range: U+030E, U+1200-1399, U+2D80-2DDE, U+AB01-AB2E, U+1E7E0-1E7E6, U+1E7E8-1E7EB, U+1E7ED-1E7EE, U+1E7F0-1E7FE; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -95,7 +95,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCVjshE7g.woff2) format('woff2'); unicode-range: U+0589, U+10A0-10FF, U+1C90-1CBA, U+1CBD-1CBF, U+205A, U+2D00-2D2F, U+2E31; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -104,7 +104,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCGjshE7g.woff2) format('woff2'); unicode-range: U+1F00-1FFF; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -113,7 +113,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCJjshE7g.woff2) format('woff2'); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -122,7 +122,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCRjshE7g.woff2) format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0A80-0AFF, U+200C-200D, U+20B9, U+25CC, U+A830-A839; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -131,7 +131,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCpjshE7g.woff2) format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0A01-0A76, U+200C-200D, U+20B9, U+25CC, U+262C, U+A830-A839; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -140,7 +140,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCIjshE7g.woff2) format('woff2'); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -149,7 +149,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCBjshE7g.woff2) format('woff2'); unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -158,7 +158,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCDjshE7g.woff2) format('woff2'); unicode-range: U+0E81-0EDF, U+200C-200D, U+25CC; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -167,7 +167,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCSjshE7g.woff2) format('woff2'); unicode-range: U+0307, U+0323, U+0951-0952, U+0964-0965, U+0D00-0D7F, U+1CDA, U+1CF2, U+200C-200D, U+20B9, U+25CC, U+A830-A832; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -176,7 +176,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCTjshE7g.woff2) format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0B01-0B77, U+1CDA, U+1CF2, U+200C-200D, U+20B9, U+25CC; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -185,7 +185,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCXjshE7g.woff2) format('woff2'); unicode-range: U+0964-0965, U+0D81-0DF4, U+1CF2, U+200C-200D, U+25CC, U+111E1-111F4; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -194,7 +194,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTDkjshE7g.woff2) format('woff2'); unicode-range: U+0001-000C, U+000E-001F, U+007F-009F, U+20DD-20E0, U+20E2-20E4, U+2150-218F, U+2190, U+2192, U+2194-2199, U+21AF, U+21E6-21F0, U+21F3, U+2218-2219, U+2299, U+22C4-22C6, U+2300-243F, U+2440-244A, U+2460-24FF, U+25A0-27BF, U+2800-28FF, U+2921-2922, U+2981, U+29BF, U+29EB, U+2B00-2BFF, U+4DC0-4DFF, U+FFF9-FFFB, U+10140-1018E, U+10190-1019C, U+101A0, U+101D0-101FD, U+102E0-102FB, U+10E60-10E7E, U+1D2C0-1D2D3, U+1D2E0-1D37F, U+1F000-1F0FF, U+1F100-1F1AD, U+1F1E6-1F1FF, U+1F30D-1F30F, U+1F315, U+1F31C, U+1F31E, U+1F320-1F32C, U+1F336, U+1F378, U+1F37D, U+1F382, U+1F393-1F39F, U+1F3A7-1F3A8, U+1F3AC-1F3AF, U+1F3C2, U+1F3C4-1F3C6, U+1F3CA-1F3CE, U+1F3D4-1F3E0, U+1F3ED, U+1F3F1-1F3F3, U+1F3F5-1F3F7, U+1F408, U+1F415, U+1F41F, U+1F426, U+1F43F, U+1F441-1F442, U+1F444, U+1F446-1F449, U+1F44C-1F44E, U+1F453, U+1F46A, U+1F47D, U+1F4A3, U+1F4B0, U+1F4B3, U+1F4B9, U+1F4BB, U+1F4BF, U+1F4C8-1F4CB, U+1F4D6, U+1F4DA, U+1F4DF, U+1F4E3-1F4E6, U+1F4EA-1F4ED, U+1F4F7, U+1F4F9-1F4FB, U+1F4FD-1F4FE, U+1F503, U+1F507-1F50B, U+1F50D, U+1F512-1F513, U+1F53E-1F54A, U+1F54F-1F5FA, U+1F610, U+1F650-1F67F, U+1F687, U+1F68D, U+1F691, U+1F694, U+1F698, U+1F6AD, U+1F6B2, U+1F6B9-1F6BA, U+1F6BC, U+1F6C6-1F6CF, U+1F6D3-1F6D7, U+1F6E0-1F6EA, U+1F6F0-1F6F3, U+1F6F7-1F6FC, U+1F700-1F7FF, U+1F800-1F80B, U+1F810-1F847, U+1F850-1F859, U+1F860-1F887, U+1F890-1F8AD, U+1F8B0-1F8BB, U+1F8C0-1F8C1, U+1F900-1F90B, U+1F93B, U+1F946, U+1F984, U+1F996, U+1F9E9, U+1FA00-1FA6F, U+1FA70-1FA7C, U+1FA80-1FA89, U+1FA8F-1FAC6, U+1FACE-1FADC, U+1FADF-1FAE9, U+1FAF0-1FAF8, U+1FB00-1FBFF; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -203,7 +203,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCcjshE7g.woff2) format('woff2'); unicode-range: U+0964-0965, U+0B82-0BFA, U+200C-200D, U+20B9, U+25CC; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -212,7 +212,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCWjshE7g.woff2) format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0C00-0C7F, U+1CDA, U+1CF2, U+200C-200D, U+25CC; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -221,7 +221,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCejshE7g.woff2) format('woff2'); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -230,7 +230,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCFjshE7g.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -239,7 +239,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCEjshE7g.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -248,7 +248,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCKjsg.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -257,7 +257,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2rgCIlsw.woff2) format('woff2'); unicode-range: U+0308, U+0530-058F, U+2010, U+2024, U+25CC, U+FB13-FB17; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -266,7 +266,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2rACIlsw.woff2) format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -275,7 +275,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2kQCIlsw.woff2) format('woff2'); unicode-range: U+02C7, U+02D8-02D9, U+02DB, U+0307, U+1400-167F, U+18B0-18F5, U+25CC, U+11AB0-11ABF; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -284,7 +284,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2swCIlsw.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -293,7 +293,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2ugCIlsw.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -302,7 +302,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2vwCIlsw.woff2) format('woff2'); unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B09; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -311,7 +311,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2rwCIlsw.woff2) format('woff2'); unicode-range: U+030E, U+1200-1399, U+2D80-2DDE, U+AB01-AB2E, U+1E7E0-1E7E6, U+1E7E8-1E7EB, U+1E7ED-1E7EE, U+1E7F0-1E7FE; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -320,7 +320,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2oQCIlsw.woff2) format('woff2'); unicode-range: U+0589, U+10A0-10FF, U+1C90-1CBA, U+1CBD-1CBF, U+205A, U+2D00-2D2F, U+2E31; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -329,7 +329,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2sgCIlsw.woff2) format('woff2'); unicode-range: U+1F00-1FFF; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -338,7 +338,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2vQCIlsw.woff2) format('woff2'); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -347,7 +347,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2pQCIlsw.woff2) format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0A80-0AFF, U+200C-200D, U+20B9, U+25CC, U+A830-A839; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -356,7 +356,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2nQCIlsw.woff2) format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0A01-0A76, U+200C-200D, U+20B9, U+25CC, U+262C, U+A830-A839; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -365,7 +365,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2vACIlsw.woff2) format('woff2'); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -374,7 +374,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2tQCIlsw.woff2) format('woff2'); unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -383,7 +383,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2twCIlsw.woff2) format('woff2'); unicode-range: U+0E81-0EDF, U+200C-200D, U+25CC; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -392,7 +392,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2pgCIlsw.woff2) format('woff2'); unicode-range: U+0307, U+0323, U+0951-0952, U+0964-0965, U+0D00-0D7F, U+1CDA, U+1CF2, U+200C-200D, U+20B9, U+25CC, U+A830-A832; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -401,7 +401,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2pwCIlsw.woff2) format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0B01-0B77, U+1CDA, U+1CF2, U+200C-200D, U+20B9, U+25CC; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -410,7 +410,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2owCIlsw.woff2) format('woff2'); unicode-range: U+0964-0965, U+0D81-0DF4, U+1CF2, U+200C-200D, U+25CC, U+111E1-111F4; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -419,7 +419,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq20ACIlsw.woff2) format('woff2'); unicode-range: U+0001-000C, U+000E-001F, U+007F-009F, U+20DD-20E0, U+20E2-20E4, U+2150-218F, U+2190, U+2192, U+2194-2199, U+21AF, U+21E6-21F0, U+21F3, U+2218-2219, U+2299, U+22C4-22C6, U+2300-243F, U+2440-244A, U+2460-24FF, U+25A0-27BF, U+2800-28FF, U+2921-2922, U+2981, U+29BF, U+29EB, U+2B00-2BFF, U+4DC0-4DFF, U+FFF9-FFFB, U+10140-1018E, U+10190-1019C, U+101A0, U+101D0-101FD, U+102E0-102FB, U+10E60-10E7E, U+1D2C0-1D2D3, U+1D2E0-1D37F, U+1F000-1F0FF, U+1F100-1F1AD, U+1F1E6-1F1FF, U+1F30D-1F30F, U+1F315, U+1F31C, U+1F31E, U+1F320-1F32C, U+1F336, U+1F378, U+1F37D, U+1F382, U+1F393-1F39F, U+1F3A7-1F3A8, U+1F3AC-1F3AF, U+1F3C2, U+1F3C4-1F3C6, U+1F3CA-1F3CE, U+1F3D4-1F3E0, U+1F3ED, U+1F3F1-1F3F3, U+1F3F5-1F3F7, U+1F408, U+1F415, U+1F41F, U+1F426, U+1F43F, U+1F441-1F442, U+1F444, U+1F446-1F449, U+1F44C-1F44E, U+1F453, U+1F46A, U+1F47D, U+1F4A3, U+1F4B0, U+1F4B3, U+1F4B9, U+1F4BB, U+1F4BF, U+1F4C8-1F4CB, U+1F4D6, U+1F4DA, U+1F4DF, U+1F4E3-1F4E6, U+1F4EA-1F4ED, U+1F4F7, U+1F4F9-1F4FB, U+1F4FD-1F4FE, U+1F503, U+1F507-1F50B, U+1F50D, U+1F512-1F513, U+1F53E-1F54A, U+1F54F-1F5FA, U+1F610, U+1F650-1F67F, U+1F687, U+1F68D, U+1F691, U+1F694, U+1F698, U+1F6AD, U+1F6B2, U+1F6B9-1F6BA, U+1F6BC, U+1F6C6-1F6CF, U+1F6D3-1F6D7, U+1F6E0-1F6EA, U+1F6F0-1F6F3, U+1F6F7-1F6FC, U+1F700-1F7FF, U+1F800-1F80B, U+1F810-1F847, U+1F850-1F859, U+1F860-1F887, U+1F890-1F8AD, U+1F8B0-1F8BB, U+1F8C0-1F8C1, U+1F900-1F90B, U+1F93B, U+1F946, U+1F984, U+1F996, U+1F9E9, U+1FA00-1FA6F, U+1FA70-1FA7C, U+1FA80-1FA89, U+1FA8F-1FAC6, U+1FACE-1FADC, U+1FADF-1FAE9, U+1FAF0-1FAF8, U+1FB00-1FBFF; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -428,7 +428,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2qACIlsw.woff2) format('woff2'); unicode-range: U+0964-0965, U+0B82-0BFA, U+200C-200D, U+20B9, U+25CC; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -437,7 +437,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2ogCIlsw.woff2) format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0C00-0C7F, U+1CDA, U+1CF2, U+200C-200D, U+25CC; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -446,7 +446,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2qgCIlsw.woff2) format('woff2'); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -455,7 +455,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2sQCIlsw.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -464,7 +464,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2sACIlsw.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -483,7 +483,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCajshE7g.woff2) format('woff2'); unicode-range: U+0308, U+0530-058F, U+2010, U+2024, U+25CC, U+FB13-FB17; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -492,7 +492,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCYjshE7g.woff2) format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -501,7 +501,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCljshE7g.woff2) format('woff2'); unicode-range: U+02C7, U+02D8-02D9, U+02DB, U+0307, U+1400-167F, U+18B0-18F5, U+25CC, U+11AB0-11ABF; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -510,7 +510,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCHjshE7g.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -519,7 +519,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCOjshE7g.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -528,7 +528,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCLjshE7g.woff2) format('woff2'); unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B09; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -537,7 +537,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCbjshE7g.woff2) format('woff2'); unicode-range: U+030E, U+1200-1399, U+2D80-2DDE, U+AB01-AB2E, U+1E7E0-1E7E6, U+1E7E8-1E7EB, U+1E7ED-1E7EE, U+1E7F0-1E7FE; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -546,7 +546,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCVjshE7g.woff2) format('woff2'); unicode-range: U+0589, U+10A0-10FF, U+1C90-1CBA, U+1CBD-1CBF, U+205A, U+2D00-2D2F, U+2E31; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -555,7 +555,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCGjshE7g.woff2) format('woff2'); unicode-range: U+1F00-1FFF; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -564,7 +564,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCJjshE7g.woff2) format('woff2'); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -573,7 +573,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCRjshE7g.woff2) format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0A80-0AFF, U+200C-200D, U+20B9, U+25CC, U+A830-A839; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -582,7 +582,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCpjshE7g.woff2) format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0A01-0A76, U+200C-200D, U+20B9, U+25CC, U+262C, U+A830-A839; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -591,7 +591,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCIjshE7g.woff2) format('woff2'); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -600,7 +600,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCBjshE7g.woff2) format('woff2'); unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -609,7 +609,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCDjshE7g.woff2) format('woff2'); unicode-range: U+0E81-0EDF, U+200C-200D, U+25CC; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -618,7 +618,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCSjshE7g.woff2) format('woff2'); unicode-range: U+0307, U+0323, U+0951-0952, U+0964-0965, U+0D00-0D7F, U+1CDA, U+1CF2, U+200C-200D, U+20B9, U+25CC, U+A830-A832; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -627,7 +627,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCTjshE7g.woff2) format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0B01-0B77, U+1CDA, U+1CF2, U+200C-200D, U+20B9, U+25CC; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -636,7 +636,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCXjshE7g.woff2) format('woff2'); unicode-range: U+0964-0965, U+0D81-0DF4, U+1CF2, U+200C-200D, U+25CC, U+111E1-111F4; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -645,7 +645,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTDkjshE7g.woff2) format('woff2'); unicode-range: U+0001-000C, U+000E-001F, U+007F-009F, U+20DD-20E0, U+20E2-20E4, U+2150-218F, U+2190, U+2192, U+2194-2199, U+21AF, U+21E6-21F0, U+21F3, U+2218-2219, U+2299, U+22C4-22C6, U+2300-243F, U+2440-244A, U+2460-24FF, U+25A0-27BF, U+2800-28FF, U+2921-2922, U+2981, U+29BF, U+29EB, U+2B00-2BFF, U+4DC0-4DFF, U+FFF9-FFFB, U+10140-1018E, U+10190-1019C, U+101A0, U+101D0-101FD, U+102E0-102FB, U+10E60-10E7E, U+1D2C0-1D2D3, U+1D2E0-1D37F, U+1F000-1F0FF, U+1F100-1F1AD, U+1F1E6-1F1FF, U+1F30D-1F30F, U+1F315, U+1F31C, U+1F31E, U+1F320-1F32C, U+1F336, U+1F378, U+1F37D, U+1F382, U+1F393-1F39F, U+1F3A7-1F3A8, U+1F3AC-1F3AF, U+1F3C2, U+1F3C4-1F3C6, U+1F3CA-1F3CE, U+1F3D4-1F3E0, U+1F3ED, U+1F3F1-1F3F3, U+1F3F5-1F3F7, U+1F408, U+1F415, U+1F41F, U+1F426, U+1F43F, U+1F441-1F442, U+1F444, U+1F446-1F449, U+1F44C-1F44E, U+1F453, U+1F46A, U+1F47D, U+1F4A3, U+1F4B0, U+1F4B3, U+1F4B9, U+1F4BB, U+1F4BF, U+1F4C8-1F4CB, U+1F4D6, U+1F4DA, U+1F4DF, U+1F4E3-1F4E6, U+1F4EA-1F4ED, U+1F4F7, U+1F4F9-1F4FB, U+1F4FD-1F4FE, U+1F503, U+1F507-1F50B, U+1F50D, U+1F512-1F513, U+1F53E-1F54A, U+1F54F-1F5FA, U+1F610, U+1F650-1F67F, U+1F687, U+1F68D, U+1F691, U+1F694, U+1F698, U+1F6AD, U+1F6B2, U+1F6B9-1F6BA, U+1F6BC, U+1F6C6-1F6CF, U+1F6D3-1F6D7, U+1F6E0-1F6EA, U+1F6F0-1F6F3, U+1F6F7-1F6FC, U+1F700-1F7FF, U+1F800-1F80B, U+1F810-1F847, U+1F850-1F859, U+1F860-1F887, U+1F890-1F8AD, U+1F8B0-1F8BB, U+1F8C0-1F8C1, U+1F900-1F90B, U+1F93B, U+1F946, U+1F984, U+1F996, U+1F9E9, U+1FA00-1FA6F, U+1FA70-1FA7C, U+1FA80-1FA89, U+1FA8F-1FAC6, U+1FACE-1FADC, U+1FADF-1FAE9, U+1FAF0-1FAF8, U+1FB00-1FBFF; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -654,7 +654,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCcjshE7g.woff2) format('woff2'); unicode-range: U+0964-0965, U+0B82-0BFA, U+200C-200D, U+20B9, U+25CC; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -663,7 +663,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCWjshE7g.woff2) format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0C00-0C7F, U+1CDA, U+1CF2, U+200C-200D, U+25CC; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -672,7 +672,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCejshE7g.woff2) format('woff2'); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -681,7 +681,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCFjshE7g.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -690,7 +690,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCEjshE7g.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; } - + @font-face { font-family: 'Google Sans'; font-style: italic; @@ -699,7 +699,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaXrENHsxJlGDuGo1OIlL3L2JB874GPhFI9_IqmuTCKjsg.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -708,7 +708,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2rgCIlsw.woff2) format('woff2'); unicode-range: U+0308, U+0530-058F, U+2010, U+2024, U+25CC, U+FB13-FB17; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -717,7 +717,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2rACIlsw.woff2) format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -726,7 +726,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2kQCIlsw.woff2) format('woff2'); unicode-range: U+02C7, U+02D8-02D9, U+02DB, U+0307, U+1400-167F, U+18B0-18F5, U+25CC, U+11AB0-11ABF; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -735,7 +735,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2swCIlsw.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -744,7 +744,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2ugCIlsw.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -753,7 +753,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2vwCIlsw.woff2) format('woff2'); unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B09; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -762,7 +762,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2rwCIlsw.woff2) format('woff2'); unicode-range: U+030E, U+1200-1399, U+2D80-2DDE, U+AB01-AB2E, U+1E7E0-1E7E6, U+1E7E8-1E7EB, U+1E7ED-1E7EE, U+1E7F0-1E7FE; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -771,7 +771,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2oQCIlsw.woff2) format('woff2'); unicode-range: U+0589, U+10A0-10FF, U+1C90-1CBA, U+1CBD-1CBF, U+205A, U+2D00-2D2F, U+2E31; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -780,7 +780,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2sgCIlsw.woff2) format('woff2'); unicode-range: U+1F00-1FFF; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -789,7 +789,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2vQCIlsw.woff2) format('woff2'); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -798,7 +798,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2pQCIlsw.woff2) format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0A80-0AFF, U+200C-200D, U+20B9, U+25CC, U+A830-A839; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -807,7 +807,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2nQCIlsw.woff2) format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0A01-0A76, U+200C-200D, U+20B9, U+25CC, U+262C, U+A830-A839; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -816,7 +816,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2vACIlsw.woff2) format('woff2'); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -825,7 +825,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2tQCIlsw.woff2) format('woff2'); unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -834,7 +834,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2twCIlsw.woff2) format('woff2'); unicode-range: U+0E81-0EDF, U+200C-200D, U+25CC; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -843,7 +843,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2pgCIlsw.woff2) format('woff2'); unicode-range: U+0307, U+0323, U+0951-0952, U+0964-0965, U+0D00-0D7F, U+1CDA, U+1CF2, U+200C-200D, U+20B9, U+25CC, U+A830-A832; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -852,7 +852,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2pwCIlsw.woff2) format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0B01-0B77, U+1CDA, U+1CF2, U+200C-200D, U+20B9, U+25CC; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -861,7 +861,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2owCIlsw.woff2) format('woff2'); unicode-range: U+0964-0965, U+0D81-0DF4, U+1CF2, U+200C-200D, U+25CC, U+111E1-111F4; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -870,7 +870,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq20ACIlsw.woff2) format('woff2'); unicode-range: U+0001-000C, U+000E-001F, U+007F-009F, U+20DD-20E0, U+20E2-20E4, U+2150-218F, U+2190, U+2192, U+2194-2199, U+21AF, U+21E6-21F0, U+21F3, U+2218-2219, U+2299, U+22C4-22C6, U+2300-243F, U+2440-244A, U+2460-24FF, U+25A0-27BF, U+2800-28FF, U+2921-2922, U+2981, U+29BF, U+29EB, U+2B00-2BFF, U+4DC0-4DFF, U+FFF9-FFFB, U+10140-1018E, U+10190-1019C, U+101A0, U+101D0-101FD, U+102E0-102FB, U+10E60-10E7E, U+1D2C0-1D2D3, U+1D2E0-1D37F, U+1F000-1F0FF, U+1F100-1F1AD, U+1F1E6-1F1FF, U+1F30D-1F30F, U+1F315, U+1F31C, U+1F31E, U+1F320-1F32C, U+1F336, U+1F378, U+1F37D, U+1F382, U+1F393-1F39F, U+1F3A7-1F3A8, U+1F3AC-1F3AF, U+1F3C2, U+1F3C4-1F3C6, U+1F3CA-1F3CE, U+1F3D4-1F3E0, U+1F3ED, U+1F3F1-1F3F3, U+1F3F5-1F3F7, U+1F408, U+1F415, U+1F41F, U+1F426, U+1F43F, U+1F441-1F442, U+1F444, U+1F446-1F449, U+1F44C-1F44E, U+1F453, U+1F46A, U+1F47D, U+1F4A3, U+1F4B0, U+1F4B3, U+1F4B9, U+1F4BB, U+1F4BF, U+1F4C8-1F4CB, U+1F4D6, U+1F4DA, U+1F4DF, U+1F4E3-1F4E6, U+1F4EA-1F4ED, U+1F4F7, U+1F4F9-1F4FB, U+1F4FD-1F4FE, U+1F503, U+1F507-1F50B, U+1F50D, U+1F512-1F513, U+1F53E-1F54A, U+1F54F-1F5FA, U+1F610, U+1F650-1F67F, U+1F687, U+1F68D, U+1F691, U+1F694, U+1F698, U+1F6AD, U+1F6B2, U+1F6B9-1F6BA, U+1F6BC, U+1F6C6-1F6CF, U+1F6D3-1F6D7, U+1F6E0-1F6EA, U+1F6F0-1F6F3, U+1F6F7-1F6FC, U+1F700-1F7FF, U+1F800-1F80B, U+1F810-1F847, U+1F850-1F859, U+1F860-1F887, U+1F890-1F8AD, U+1F8B0-1F8BB, U+1F8C0-1F8C1, U+1F900-1F90B, U+1F93B, U+1F946, U+1F984, U+1F996, U+1F9E9, U+1FA00-1FA6F, U+1FA70-1FA7C, U+1FA80-1FA89, U+1FA8F-1FAC6, U+1FACE-1FADC, U+1FADF-1FAE9, U+1FAF0-1FAF8, U+1FB00-1FBFF; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -879,7 +879,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2qACIlsw.woff2) format('woff2'); unicode-range: U+0964-0965, U+0B82-0BFA, U+200C-200D, U+20B9, U+25CC; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -888,7 +888,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2ogCIlsw.woff2) format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0C00-0C7F, U+1CDA, U+1CF2, U+200C-200D, U+25CC; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -897,7 +897,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2qgCIlsw.woff2) format('woff2'); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -906,7 +906,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2sQCIlsw.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -915,7 +915,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2sACIlsw.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; } - + @font-face { font-family: 'Google Sans'; font-style: normal; @@ -924,7 +924,7 @@ src: url(https://fonts.gstatic.com/s/googlesans/v69/4UaRrENHsxJlGDuGo1OIlJfC6l_24rlCK1Yo_Iq2vgCI.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } - + @font-face { font-family: 'Google Sans Mono'; font-style: italic; @@ -933,7 +933,7 @@ src: url(https://fonts.gstatic.com/s/googlesansmono/v28/P5sfzYWFYtnZ_Cg-t0Uq_rfivrdYNY1cbhrBZQI.woff2) format('woff2'); unicode-range: U+0001-000C, U+000E-001F, U+007F-009F, U+20DD-20E0, U+20E2-20E4, U+2150-218F, U+2190, U+2192, U+2194-2199, U+21AF, U+21E6-21F0, U+21F3, U+2218-2219, U+2299, U+22C4-22C6, U+2300-243F, U+2440-244A, U+2460-24FF, U+25A0-27BF, U+2800-28FF, U+2921-2922, U+2981, U+29BF, U+29EB, U+2B00-2BFF, U+4DC0-4DFF, U+FFF9-FFFB, U+10140-1018E, U+10190-1019C, U+101A0, U+101D0-101FD, U+102E0-102FB, U+10E60-10E7E, U+1D2C0-1D2D3, U+1D2E0-1D37F, U+1F000-1F0FF, U+1F100-1F1AD, U+1F1E6-1F1FF, U+1F30D-1F30F, U+1F315, U+1F31C, U+1F31E, U+1F320-1F32C, U+1F336, U+1F378, U+1F37D, U+1F382, U+1F393-1F39F, U+1F3A7-1F3A8, U+1F3AC-1F3AF, U+1F3C2, U+1F3C4-1F3C6, U+1F3CA-1F3CE, U+1F3D4-1F3E0, U+1F3ED, U+1F3F1-1F3F3, U+1F3F5-1F3F7, U+1F408, U+1F415, U+1F41F, U+1F426, U+1F43F, U+1F441-1F442, U+1F444, U+1F446-1F449, U+1F44C-1F44E, U+1F453, U+1F46A, U+1F47D, U+1F4A3, U+1F4B0, U+1F4B3, U+1F4B9, U+1F4BB, U+1F4BF, U+1F4C8-1F4CB, U+1F4D6, U+1F4DA, U+1F4DF, U+1F4E3-1F4E6, U+1F4EA-1F4ED, U+1F4F7, U+1F4F9-1F4FB, U+1F4FD-1F4FE, U+1F503, U+1F507-1F50B, U+1F50D, U+1F512-1F513, U+1F53E-1F54A, U+1F54F-1F5FA, U+1F610, U+1F650-1F67F, U+1F687, U+1F68D, U+1F691, U+1F694, U+1F698, U+1F6AD, U+1F6B2, U+1F6B9-1F6BA, U+1F6BC, U+1F6C6-1F6CF, U+1F6D3-1F6D7, U+1F6E0-1F6EA, U+1F6F0-1F6F3, U+1F6F7-1F6FC, U+1F700-1F7FF, U+1F800-1F80B, U+1F810-1F847, U+1F850-1F859, U+1F860-1F887, U+1F890-1F8AD, U+1F8B0-1F8BB, U+1F8C0-1F8C1, U+1F900-1F90B, U+1F93B, U+1F946, U+1F984, U+1F996, U+1F9E9, U+1FA00-1FA6F, U+1FA70-1FA7C, U+1FA80-1FA89, U+1FA8F-1FAC6, U+1FACE-1FADC, U+1FADF-1FAE9, U+1FAF0-1FAF8, U+1FB00-1FBFF; } - + @font-face { font-family: 'Google Sans Mono'; font-style: italic; @@ -942,7 +942,7 @@ src: url(https://fonts.gstatic.com/s/googlesansmono/v28/P5sfzYWFYtnZ_Cg-t0Uq_rfivrdYNY1cDhrBZQI.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; } - + @font-face { font-family: 'Google Sans Mono'; font-style: italic; @@ -951,7 +951,7 @@ src: url(https://fonts.gstatic.com/s/googlesansmono/v28/P5sfzYWFYtnZ_Cg-t0Uq_rfivrdYNY1cABrB.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } - + @font-face { font-family: 'Google Sans Mono'; font-style: normal; @@ -960,7 +960,7 @@ src: url(https://fonts.gstatic.com/s/googlesansmono/v28/P5sZzYWFYtnZ_Cg-t0Uq_rfivrdYNeZsAgLF.woff2) format('woff2'); unicode-range: U+0001-000C, U+000E-001F, U+007F-009F, U+20DD-20E0, U+20E2-20E4, U+2150-218F, U+2190, U+2192, U+2194-2199, U+21AF, U+21E6-21F0, U+21F3, U+2218-2219, U+2299, U+22C4-22C6, U+2300-243F, U+2440-244A, U+2460-24FF, U+25A0-27BF, U+2800-28FF, U+2921-2922, U+2981, U+29BF, U+29EB, U+2B00-2BFF, U+4DC0-4DFF, U+FFF9-FFFB, U+10140-1018E, U+10190-1019C, U+101A0, U+101D0-101FD, U+102E0-102FB, U+10E60-10E7E, U+1D2C0-1D2D3, U+1D2E0-1D37F, U+1F000-1F0FF, U+1F100-1F1AD, U+1F1E6-1F1FF, U+1F30D-1F30F, U+1F315, U+1F31C, U+1F31E, U+1F320-1F32C, U+1F336, U+1F378, U+1F37D, U+1F382, U+1F393-1F39F, U+1F3A7-1F3A8, U+1F3AC-1F3AF, U+1F3C2, U+1F3C4-1F3C6, U+1F3CA-1F3CE, U+1F3D4-1F3E0, U+1F3ED, U+1F3F1-1F3F3, U+1F3F5-1F3F7, U+1F408, U+1F415, U+1F41F, U+1F426, U+1F43F, U+1F441-1F442, U+1F444, U+1F446-1F449, U+1F44C-1F44E, U+1F453, U+1F46A, U+1F47D, U+1F4A3, U+1F4B0, U+1F4B3, U+1F4B9, U+1F4BB, U+1F4BF, U+1F4C8-1F4CB, U+1F4D6, U+1F4DA, U+1F4DF, U+1F4E3-1F4E6, U+1F4EA-1F4ED, U+1F4F7, U+1F4F9-1F4FB, U+1F4FD-1F4FE, U+1F503, U+1F507-1F50B, U+1F50D, U+1F512-1F513, U+1F53E-1F54A, U+1F54F-1F5FA, U+1F610, U+1F650-1F67F, U+1F687, U+1F68D, U+1F691, U+1F694, U+1F698, U+1F6AD, U+1F6B2, U+1F6B9-1F6BA, U+1F6BC, U+1F6C6-1F6CF, U+1F6D3-1F6D7, U+1F6E0-1F6EA, U+1F6F0-1F6F3, U+1F6F7-1F6FC, U+1F700-1F7FF, U+1F800-1F80B, U+1F810-1F847, U+1F850-1F859, U+1F860-1F887, U+1F890-1F8AD, U+1F8B0-1F8BB, U+1F8C0-1F8C1, U+1F900-1F90B, U+1F93B, U+1F946, U+1F984, U+1F996, U+1F9E9, U+1FA00-1FA6F, U+1FA70-1FA7C, U+1FA80-1FA89, U+1FA8F-1FAC6, U+1FACE-1FADC, U+1FADF-1FAE9, U+1FAF0-1FAF8, U+1FB00-1FBFF; } - + @font-face { font-family: 'Google Sans Mono'; font-style: normal; @@ -969,7 +969,7 @@ src: url(https://fonts.gstatic.com/s/googlesansmono/v28/P5sZzYWFYtnZ_Cg-t0Uq_rfivrdYNYZsAgLF.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; } - + @font-face { font-family: 'Google Sans Mono'; font-style: normal; @@ -987,7 +987,7 @@ font-weight: 400; src: url(https://fonts.gstatic.com/s/materialsymbolsoutlined/v343/kJF1BvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oDMzByHX9rA6RzaxHMPdY43zj-jCxv3fzvRNU22ZXGJpEpjC_1v-p_4MrImHCIJIZrDCvHOej.woff2) format('woff2'); } - + .material-symbols-outlined { font-family: 'Material Symbols Outlined'; font-weight: normal; @@ -1187,7 +1187,7 @@ --mat-sys-surface-container-high: #2a2a2a; --mat-sys-surface-container-highest: #3a3a3a } - + body { height: 100vh; margin: 0; diff --git a/src/google/adk/cli/browser/main-3CUQG2IN.js b/src/google/adk/cli/browser/main-3CUQG2IN.js index 4be3757671..9b644aae7e 100644 --- a/src/google/adk/cli/browser/main-3CUQG2IN.js +++ b/src/google/adk/cli/browser/main-3CUQG2IN.js @@ -253,7 +253,7 @@ ${u}}`])},g=B=>B.map(u=>`.${C(u)}`).join(""),C=B=>qlA.test(B)?B:JSON.stringify(B `&&i.lineWrapping&&(t&&(t=Be.single(t.main.anchor-1,t.main.head-1)),A={from:o.from,to:o.to,insert:On.of([" "])}),A)return fS(i,A,t,a);if(t&&!r8(t,o)){let r=!1,s="select";return i.inputState.lastSelectionTime>Date.now()-50&&(i.inputState.lastSelectionOrigin=="select"&&(r=!0),s=i.inputState.lastSelectionOrigin,s=="select.pointer"&&(t=rH(n.facet(C4).map(l=>l(i)),t))),i.dispatch({selection:t,scrollIntoView:r,userEvent:s}),!0}else return!1}function fS(i,e,A,t=-1){if(Ct.ios&&i.inputState.flushIOSKey(e))return!0;let n=i.state.selection.main;if(Ct.android&&(e.to==n.to&&(e.from==n.from||e.from==n.from-1&&i.state.sliceDoc(e.from,n.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&ih(i.contentDOM,"Enter",13)||(e.from==n.from-1&&e.to==n.to&&e.insert.length==0||t==8&&e.insert.lengthn.head)&&ih(i.contentDOM,"Backspace",8)||e.from==n.from&&e.to==n.to+1&&e.insert.length==0&&ih(i.contentDOM,"Delete",46)))return!0;let o=e.insert.toString();i.inputState.composing>=0&&i.inputState.composing++;let a,r=()=>a||(a=kcA(i,e,A));return i.state.facet(ZY).some(s=>s(i,e.from,e.to,o,r))||i.dispatch(r()),!0}function kcA(i,e,A){let t,n=i.state,o=n.selection.main,a=-1;if(e.from==e.to&&e.fromo.to){let s=e.fromC(i)),l,s);e.from==g&&(a=g)}if(a>-1)t={changes:e,selection:Be.cursor(e.from+e.insert.length,-1)};else if(e.from>=o.from&&e.to<=o.to&&e.to-e.from>=(o.to-o.from)/3&&(!A||A.main.empty&&A.main.from==e.from+e.insert.length)&&i.inputState.composing<0){let s=o.frome.to?n.sliceDoc(e.to,o.to):"";t=n.replaceSelection(i.state.toText(s+e.insert.sliceString(0,void 0,i.state.lineBreak)+l))}else{let s=n.changes(e),l=A&&A.main.to<=s.newLength?A.main:void 0;if(n.selection.ranges.length>1&&(i.inputState.composing>=0||i.inputState.compositionPendingChange)&&e.to<=o.to+10&&e.to>=o.to-10){let g=i.state.sliceDoc(e.from,e.to),C,d=A&&aH(i,A.main.head);if(d){let u=e.insert.length-(e.to-e.from);C={from:d.from,to:d.to-u}}else C=i.state.doc.lineAt(o.head);let B=o.to-e.to;t=n.changeByRange(u=>{if(u.from==o.from&&u.to==o.to)return{changes:s,range:l||u.map(s)};let E=u.to-B,f=E-g.length;if(i.state.sliceDoc(f,E)!=g||E>=C.from&&f<=C.to)return{range:u};let m=n.changes({from:f,to:E,insert:e.insert}),v=u.to-o.to;return{changes:m,range:l?Be.range(Math.max(0,l.anchor+v),Math.max(0,l.head+v)):u.map(m)}})}else t={changes:s,selection:l&&n.selection.replaceRange(l)}}let r="input.type";return(i.composing||i.inputState.compositionPendingChange&&i.inputState.compositionEndedAt>Date.now()-50)&&(i.inputState.compositionPendingChange=!1,r+=".compose",i.inputState.compositionFirstChange&&(r+=".start",i.inputState.compositionFirstChange=!1)),n.update(t,{userEvent:r,scrollIntoView:!0})}function gH(i,e,A,t){let n=Math.min(i.length,e.length),o=0;for(;o0&&r>0&&i.charCodeAt(a-1)==e.charCodeAt(r-1);)a--,r--;if(t=="end"){let s=Math.max(0,o-Math.min(a,r));A-=a+s-o}if(a=a?o-A:0;o-=s,r=o+(r-a),a=o}else if(r=r?o-A:0;o-=s,a=o+(a-r),r=o}return{from:o,toA:a,toB:r}}function _cA(i){let e=[];if(i.root.activeElement!=i.contentDOM)return e;let{anchorNode:A,anchorOffset:t,focusNode:n,focusOffset:o}=i.observer.selectionRange;return A&&(e.push(new a8(A,t)),(n!=A||o!=t)&&e.push(new a8(n,o))),e}function xcA(i,e){if(i.length==0)return null;let A=i[0].pos,t=i.length==2?i[1].pos:A;return A>-1&&t>-1?Be.single(A+e,t+e):null}function r8(i,e){return e.head==i.main.head&&e.anchor==i.main.anchor}var Y9=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Ct.safari&&e.contentDOM.addEventListener("input",()=>null),Ct.gecko&&PcA(e.contentDOM.ownerDocument)}handleEvent(e){!UcA(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,A){let t=this.handlers[e];if(t){for(let n of t.observers)n(this.view,A);for(let n of t.handlers){if(A.defaultPrevented)break;if(n(this.view,A)){A.preventDefault();break}}}}ensureHandlers(e){let A=RcA(e),t=this.handlers,n=this.view.contentDOM;for(let o in A)if(o!="scroll"){let a=!A[o].handlers.length,r=t[o];r&&a!=!r.handlers.length&&(n.removeEventListener(o,this.handleEvent),r=null),r||n.addEventListener(o,this.handleEvent,{passive:a})}for(let o in t)o!="scroll"&&!A[o]&&n.removeEventListener(o,this.handleEvent);this.handlers=A}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&CH.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Ct.android&&Ct.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let A;return Ct.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((A=cH.find(t=>t.keyCode==e.keyCode))&&!e.ctrlKey||NcA.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=A||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let A=this.pendingIOSKey;return!A||A.key=="Enter"&&e&&e.from0?!0:Ct.safari&&!Ct.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function aY(i,e){return(A,t)=>{try{return e.call(i,t,A)}catch(n){Gr(A.state,n)}}}function RcA(i){let e=Object.create(null);function A(t){return e[t]||(e[t]={observers:[],handlers:[]})}for(let t of i){let n=t.spec,o=n&&n.plugin.domEventHandlers,a=n&&n.plugin.domEventObservers;if(o)for(let r in o){let s=o[r];s&&A(r).handlers.push(aY(t.value,s))}if(a)for(let r in a){let s=a[r];s&&A(r).observers.push(aY(t.value,s))}}for(let t in sc)A(t).handlers.push(sc[t]);for(let t in cl)A(t).observers.push(cl[t]);return e}var cH=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],NcA="dthko",CH=[16,17,18,20,91,92,224,225],T6=6;function O6(i){return Math.max(0,i)*.7+8}function FcA(i,e){return Math.max(Math.abs(i.clientX-e.clientX),Math.abs(i.clientY-e.clientY))}var H9=class{constructor(e,A,t,n){this.view=e,this.startEvent=A,this.style=t,this.mustSelect=n,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=A,this.scrollParents=GY(e.contentDOM),this.atoms=e.state.facet(C4).map(a=>a(e));let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=A.shiftKey,this.multiple=e.state.facet(ir.allowMultipleSelections)&&LcA(e,A),this.dragging=KcA(e,A)&&BH(A)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&FcA(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let A=0,t=0,n=0,o=0,a=this.view.win.innerWidth,r=this.view.win.innerHeight;this.scrollParents.x&&({left:n,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:r}=this.scrollParents.y.getBoundingClientRect());let s=pS(this.view);e.clientX-s.left<=n+T6?A=-O6(n-e.clientX):e.clientX+s.right>=a-T6&&(A=O6(e.clientX-a)),e.clientY-s.top<=o+T6?t=-O6(o-e.clientY):e.clientY+s.bottom>=r-T6&&(t=O6(e.clientY-r)),this.setScrollSpeed(A,t)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,A){this.scrollSpeed={x:e,y:A},e||A?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:A}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),A&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=A,A=0),(e||A)&&this.view.win.scrollBy(e,A),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:A}=this,t=rH(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!t.eq(A.state.selection,this.dragging===!1))&&this.view.dispatch({selection:t,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(A=>A.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function LcA(i,e){let A=i.state.facet(jY);return A.length?A[0](e):Ct.mac?e.metaKey:e.ctrlKey}function GcA(i,e){let A=i.state.facet(VY);return A.length?A[0](e):Ct.mac?!e.altKey:!e.ctrlKey}function KcA(i,e){let{main:A}=i.state.selection;if(A.empty)return!1;let t=g4(i.root);if(!t||t.rangeCount==0)return!0;let n=t.getRangeAt(0).getClientRects();for(let o=0;o=e.clientX&&a.top<=e.clientY&&a.bottom>=e.clientY)return!0}return!1}function UcA(i,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let A=e.target,t;A!=i.contentDOM;A=A.parentNode)if(!A||A.nodeType==11||(t=_a.get(A))&&t.isWidget()&&!t.isHidden&&t.widget.ignoreEvent(e))return!1;return!0}var sc=Object.create(null),cl=Object.create(null),dH=Ct.ie&&Ct.ie_version<15||Ct.ios&&Ct.webkit_version<604;function TcA(i){let e=i.dom.parentNode;if(!e)return;let A=e.appendChild(document.createElement("textarea"));A.style.cssText="position: fixed; left: -10000px; top: 10px",A.focus(),setTimeout(()=>{i.focus(),A.remove(),IH(i,A.value)},50)}function u8(i,e,A){for(let t of i.facet(e))A=t(A,i);return A}function IH(i,e){e=u8(i.state,ES,e);let{state:A}=i,t,n=1,o=A.toText(e),a=o.lines==A.selection.ranges.length;if(z9!=null&&A.selection.ranges.every(s=>s.empty)&&z9==o.toString()){let s=-1;t=A.changeByRange(l=>{let g=A.doc.lineAt(l.from);if(g.from==s)return{range:l};s=g.from;let C=A.toText((a?o.line(n++).text:e)+A.lineBreak);return{changes:{from:g.from,insert:C},range:Be.cursor(l.from+C.length)}})}else a?t=A.changeByRange(s=>{let l=o.line(n++);return{changes:{from:s.from,to:s.to,insert:l.text},range:Be.cursor(s.from+l.length)}}):t=A.replaceSelection(o);i.dispatch(t,{userEvent:"input.paste",scrollIntoView:!0})}cl.scroll=i=>{i.inputState.lastScrollTop=i.scrollDOM.scrollTop,i.inputState.lastScrollLeft=i.scrollDOM.scrollLeft};cl.wheel=cl.mousewheel=i=>{i.inputState.lastWheelEvent=Date.now()};sc.keydown=(i,e)=>(i.inputState.setSelectionOrigin("select"),e.keyCode==27&&i.inputState.tabFocusMode!=0&&(i.inputState.tabFocusMode=Date.now()+2e3),!1);cl.touchstart=(i,e)=>{let A=i.inputState,t=e.targetTouches[0];A.lastTouchTime=Date.now(),t&&(A.lastTouchX=t.clientX,A.lastTouchY=t.clientY),A.setSelectionOrigin("select.pointer")};cl.touchmove=i=>{i.inputState.setSelectionOrigin("select.pointer")};sc.mousedown=(i,e)=>{if(i.observer.flush(),i.inputState.lastTouchTime>Date.now()-2e3)return!1;let A=null;for(let t of i.state.facet(qY))if(A=t(i,e),A)break;if(!A&&e.button==0&&(A=JcA(i,e)),A){let t=!i.hasFocus;i.inputState.startMouseSelection(new H9(i,e,A,t)),t&&i.observer.ignore(()=>{KY(i.contentDOM);let o=i.root.activeElement;o&&!o.contains(i.contentDOM)&&o.blur()});let n=i.inputState.mouseSelection;if(n)return n.start(e),n.dragging===!1}else i.inputState.setSelectionOrigin("select.pointer");return!1};function rY(i,e,A,t){if(t==1)return Be.cursor(e,A);if(t==2)return wcA(i.state,e,A);{let n=i.docView.lineAt(e,A),o=i.state.doc.lineAt(n?n.posAtEnd:e),a=n?n.posAtStart:o.from,r=n?n.posAtEnd:o.to;return rDate.now()-400&&Math.abs(e.clientX-i.clientX)<2&&Math.abs(e.clientY-i.clientY)<2?(lY+1)%3:1}function JcA(i,e){let A=i.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),t=BH(e),n=i.state.selection;return{update(o){o.docChanged&&(A.pos=o.changes.mapPos(A.pos),n=n.map(o.changes))},get(o,a,r){let s=i.posAndSideAtCoords({x:o.clientX,y:o.clientY},!1),l,g=rY(i,s.pos,s.assoc,t);if(A.pos!=s.pos&&!a){let C=rY(i,A.pos,A.assoc,t),d=Math.min(C.from,g.from),B=Math.max(C.to,g.to);g=d1&&(l=YcA(n,s.pos))?l:r?n.addRange(g):Be.create([g])}}}function YcA(i,e){for(let A=0;A=e)return Be.create(i.ranges.slice(0,A).concat(i.ranges.slice(A+1)),i.mainIndex==A?0:i.mainIndex-(i.mainIndex>A?1:0))}return null}sc.dragstart=(i,e)=>{let{selection:{main:A}}=i.state;if(e.target.draggable){let n=i.docView.tile.nearest(e.target);if(n&&n.isWidget()){let o=n.posAtStart,a=o+n.length;(o>=A.to||a<=A.from)&&(A=Be.range(o,a))}}let{inputState:t}=i;return t.mouseSelection&&(t.mouseSelection.dragging=!0),t.draggedContent=A,e.dataTransfer&&(e.dataTransfer.setData("Text",u8(i.state,QS,i.state.sliceDoc(A.from,A.to))),e.dataTransfer.effectAllowed="copyMove"),!1};sc.dragend=i=>(i.inputState.draggedContent=null,!1);function cY(i,e,A,t){if(A=u8(i.state,ES,A),!A)return;let n=i.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=i.inputState,a=t&&o&&GcA(i,e)?{from:o.from,to:o.to}:null,r={from:n,insert:A},s=i.state.changes(a?[a,r]:r);i.focus(),i.dispatch({changes:s,selection:{anchor:s.mapPos(n,-1),head:s.mapPos(n,1)},userEvent:a?"move.drop":"input.drop"}),i.inputState.draggedContent=null}sc.drop=(i,e)=>{if(!e.dataTransfer)return!1;if(i.state.readOnly)return!0;let A=e.dataTransfer.files;if(A&&A.length){let t=Array(A.length),n=0,o=()=>{++n==A.length&&cY(i,e,t.filter(a=>a!=null).join(i.state.lineBreak),!1)};for(let a=0;a{/[\x00-\x08\x0e-\x1f]{2}/.test(r.result)||(t[a]=r.result),o()},r.readAsText(A[a])}return!0}else{let t=e.dataTransfer.getData("Text");if(t)return cY(i,e,t,!0),!0}return!1};sc.paste=(i,e)=>{if(i.state.readOnly)return!0;i.observer.flush();let A=dH?null:e.clipboardData;return A?(IH(i,A.getData("text/plain")||A.getData("text/uri-list")),!0):(TcA(i),!1)};function HcA(i,e){let A=i.dom.parentNode;if(!A)return;let t=A.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.value=e,t.focus(),t.selectionEnd=e.length,t.selectionStart=0,setTimeout(()=>{t.remove(),i.focus()},50)}function zcA(i){let e=[],A=[],t=!1;for(let n of i.selection.ranges)n.empty||(e.push(i.sliceDoc(n.from,n.to)),A.push(n));if(!e.length){let n=-1;for(let{from:o}of i.selection.ranges){let a=i.doc.lineAt(o);a.number>n&&(e.push(a.text),A.push({from:a.from,to:Math.min(i.doc.length,a.to+1)})),n=a.number}t=!0}return{text:u8(i,QS,e.join(i.lineBreak)),ranges:A,linewise:t}}var z9=null;sc.copy=sc.cut=(i,e)=>{if(!$u(i.contentDOM,i.observer.selectionRange))return!1;let{text:A,ranges:t,linewise:n}=zcA(i.state);if(!A&&!n)return!1;z9=n?A:null,e.type=="cut"&&!i.state.readOnly&&i.dispatch({changes:t,scrollIntoView:!0,userEvent:"delete.cut"});let o=dH?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",A),!0):(HcA(i,A),!1)};var hH=sl.define();function EH(i,e){let A=[];for(let t of i.facet(XY)){let n=t(i,e);n&&A.push(n)}return A.length?i.update({effects:A,annotations:hH.of(!0)}):null}function QH(i){setTimeout(()=>{let e=i.hasFocus;if(e!=i.inputState.notifiedFocused){let A=EH(i.state,e);A?i.dispatch(A):i.update([])}},10)}cl.focus=i=>{i.inputState.lastFocusTime=Date.now(),!i.scrollDOM.scrollTop&&(i.inputState.lastScrollTop||i.inputState.lastScrollLeft)&&(i.scrollDOM.scrollTop=i.inputState.lastScrollTop,i.scrollDOM.scrollLeft=i.inputState.lastScrollLeft),QH(i)};cl.blur=i=>{i.observer.clearSelectionRange(),QH(i)};cl.compositionstart=cl.compositionupdate=i=>{i.observer.editContext||(i.inputState.compositionFirstChange==null&&(i.inputState.compositionFirstChange=!0),i.inputState.composing<0&&(i.inputState.composing=0))};cl.compositionend=i=>{i.observer.editContext||(i.inputState.composing=-1,i.inputState.compositionEndedAt=Date.now(),i.inputState.compositionPendingKey=!0,i.inputState.compositionPendingChange=i.observer.pendingRecords().length>0,i.inputState.compositionFirstChange=null,Ct.chrome&&Ct.android?i.observer.flushSoon():i.inputState.compositionPendingChange?Promise.resolve().then(()=>i.observer.flush()):setTimeout(()=>{i.inputState.composing<0&&i.docView.hasComposition&&i.update([])},50))};cl.contextmenu=i=>{i.inputState.lastContextMenu=Date.now()};sc.beforeinput=(i,e)=>{var A,t;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(i.inputState.insertingText=e.data,i.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&i.observer.editContext){let o=(A=e.dataTransfer)===null||A===void 0?void 0:A.getData("text/plain"),a=e.getTargetRanges();if(o&&a.length){let r=a[0],s=i.posAtDOM(r.startContainer,r.startOffset),l=i.posAtDOM(r.endContainer,r.endOffset);return fS(i,{from:s,to:l,insert:i.state.toText(o)},null),!0}}let n;if(Ct.chrome&&Ct.android&&(n=cH.find(o=>o.inputType==e.inputType))&&(i.observer.delayAndroidKey(n.key,n.keyCode),n.key=="Backspace"||n.key=="Delete")){let o=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>o+10&&i.hasFocus&&(i.contentDOM.blur(),i.focus())},100)}return Ct.ios&&e.inputType=="deleteContentForward"&&i.observer.flushSoon(),Ct.safari&&e.inputType=="insertText"&&i.inputState.composing>=0&&setTimeout(()=>cl.compositionend(i,e),20),!1};var CY=new Set;function PcA(i){CY.has(i)||(CY.add(i),i.addEventListener("copy",()=>{}),i.addEventListener("cut",()=>{}))}var dY=["pre-wrap","normal","pre-line","break-spaces"],sh=!1;function IY(){sh=!1}var P9=class{constructor(e){this.lineWrapping=e,this.doc=On.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,A){let t=this.doc.lineAt(A).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(t+=Math.max(0,Math.ceil((A-e-t*this.lineLength*.5)/this.lineLength))),this.lineHeight*t}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return dY.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let A=!1;for(let t=0;t-1,s=Math.abs(A-this.lineHeight)>.3||this.lineWrapping!=r||Math.abs(t-this.charWidth)>.1;if(this.lineWrapping=r,this.lineHeight=A,this.charWidth=t,this.textHeight=n,this.lineLength=o,s){this.heightSamples={};for(let l=0;l0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>q6&&(sh=!0),this.height=e)}replace(e,A,t){return i.of(t)}decomposeLeft(e,A){A.push(this)}decomposeRight(e,A){A.push(this)}applyChanges(e,A,t,n){let o=this,a=t.doc;for(let r=n.length-1;r>=0;r--){let{fromA:s,toA:l,fromB:g,toB:C}=n[r],d=o.lineAt(s,Qa.ByPosNoHeight,t.setDoc(A),0,0),B=d.to>=l?d:o.lineAt(l,Qa.ByPosNoHeight,t,0,0);for(C+=B.to-l,l=B.to;r>0&&d.from<=n[r-1].toA;)s=n[r-1].fromA,g=n[r-1].fromB,r--,so*2){let r=e[A-1];r.break?e.splice(--A,1,r.left,null,r.right):e.splice(--A,1,r.left,r.right),t+=1+r.break,n-=r.size}else if(o>n*2){let r=e[t];r.break?e.splice(t,1,r.left,null,r.right):e.splice(t,1,r.left,r.right),t+=2+r.break,o-=r.size}else break;else if(n=o&&a(this.lineAt(0,Qa.ByPos,t,n,o))}setMeasuredHeight(e){let A=e.heights[e.index++];A<0?(this.spaceAbove=-A,A=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(A)}updateHeight(e,A=0,t=!1,n){return n&&n.from<=A&&n.more&&this.setMeasuredHeight(n),this.outdated=!1,this}toString(){return`block(${this.length})`}},dg=class i extends l8{constructor(e,A,t){super(e,A,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=t}mainBlock(e,A){return new ac(A,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,A,t){let n=t[0];return t.length==1&&(n instanceof i||n instanceof M2&&n.flags&4)&&Math.abs(this.length-n.length)<10?(n instanceof M2?n=new i(n.length,this.height,this.spaceAbove):n.height=this.height,this.outdated||(n.outdated=!1),n):Nl.of(t)}updateHeight(e,A=0,t=!1,n){return n&&n.from<=A&&n.more?this.setMeasuredHeight(n):(t||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}},M2=class i extends Nl{constructor(e){super(e,0)}heightMetrics(e,A){let t=e.doc.lineAt(A).number,n=e.doc.lineAt(A+this.length).number,o=n-t+1,a,r=0;if(e.lineWrapping){let s=Math.min(this.height,e.lineHeight*o);a=s/o,this.length>o+1&&(r=(this.height-s)/(this.length-o-1))}else a=this.height/o;return{firstLine:t,lastLine:n,perLine:a,perChar:r}}blockAt(e,A,t,n){let{firstLine:o,lastLine:a,perLine:r,perChar:s}=this.heightMetrics(A,n);if(A.lineWrapping){let l=n+(e0){let o=t[t.length-1];o instanceof i?t[t.length-1]=new i(o.length+n):t.push(null,new i(n-1))}if(e>0){let o=t[0];o instanceof i?t[0]=new i(e+o.length):t.unshift(new i(e-1),null)}return Nl.of(t)}decomposeLeft(e,A){A.push(new i(e-1),null)}decomposeRight(e,A){A.push(null,new i(this.length-e-1))}updateHeight(e,A=0,t=!1,n){let o=A+this.length;if(n&&n.from<=A+this.length&&n.more){let a=[],r=Math.max(A,n.from),s=-1;for(n.from>A&&a.push(new i(n.from-A-1).updateHeight(e,A));r<=o&&n.more;){let g=e.doc.lineAt(r).length;a.length&&a.push(null);let C=n.heights[n.index++],d=0;C<0&&(d=-C,C=n.heights[n.index++]),s==-1?s=C:Math.abs(C-s)>=q6&&(s=-2);let B=new dg(g,C,d);B.outdated=!1,a.push(B),r+=g+1}r<=o&&a.push(null,new i(o-r).updateHeight(e,r));let l=Nl.of(a);return(s<0||Math.abs(l.height-this.height)>=q6||Math.abs(s-this.heightMetrics(e,A).perLine)>=q6)&&(sh=!0),s8(this,l)}else(t||this.outdated)&&(this.setHeight(e.heightForGap(A,A+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},V9=class extends Nl{constructor(e,A,t){super(e.length+A+t.length,e.height+t.height,A|(e.outdated||t.outdated?2:0)),this.left=e,this.right=t,this.size=e.size+t.size}get break(){return this.flags&1}blockAt(e,A,t,n){let o=t+this.left.height;return er))return l;let g=A==Qa.ByPosNoHeight?Qa.ByPosNoHeight:Qa.ByPos;return s?l.join(this.right.lineAt(r,g,t,a,r)):this.left.lineAt(r,g,t,n,o).join(l)}forEachLine(e,A,t,n,o,a){let r=n+this.left.height,s=o+this.left.length+this.break;if(this.break)e=s&&this.right.forEachLine(e,A,t,r,s,a);else{let l=this.lineAt(s,Qa.ByPos,t,n,o);e=e&&l.from<=A&&a(l),A>l.to&&this.right.forEachLine(l.to+1,A,t,r,s,a)}}replace(e,A,t){let n=this.left.length+this.break;if(Athis.left.length)return this.balanced(this.left,this.right.replace(e-n,A-n,t));let o=[];e>0&&this.decomposeLeft(e,o);let a=o.length;for(let r of t)o.push(r);if(e>0&&BY(o,a-1),A=t&&A.push(null)),e>t&&this.right.decomposeLeft(e-t,A)}decomposeRight(e,A){let t=this.left.length,n=t+this.break;if(e>=n)return this.right.decomposeRight(e-n,A);e2*A.size||A.size>2*e.size?Nl.of(this.break?[e,null,A]:[e,A]):(this.left=s8(this.left,e),this.right=s8(this.right,A),this.setHeight(e.height+A.height),this.outdated=e.outdated||A.outdated,this.size=e.size+A.size,this.length=e.length+this.break+A.length,this)}updateHeight(e,A=0,t=!1,n){let{left:o,right:a}=this,r=A+o.length+this.break,s=null;return n&&n.from<=A+o.length&&n.more?s=o=o.updateHeight(e,A,t,n):o.updateHeight(e,A,t),n&&n.from<=r+a.length&&n.more?s=a=a.updateHeight(e,r,t,n):a.updateHeight(e,r,t),s?this.balanced(o,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}};function BY(i,e){let A,t;i[e]==null&&(A=i[e-1])instanceof M2&&(t=i[e+1])instanceof M2&&i.splice(e-1,3,new M2(A.length+1+t.length))}var VcA=5,q9=class i{constructor(e,A){this.pos=e,this.oracle=A,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,A){if(this.lineStart>-1){let t=Math.min(A,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof dg?n.length+=t-this.pos:(t>this.pos||!this.isCovered)&&this.nodes.push(new dg(t-this.pos,-1,0)),this.writtenTo=t,A>t&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=A}point(e,A,t){if(e=VcA)&&this.addLineDeco(n,o,a)}else A>e&&this.span(e,A);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:A}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=A,this.writtenToe&&this.nodes.push(new dg(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,A){let t=new M2(A-e);return this.oracle.doc.lineAt(e).to==A&&(t.flags|=4),t}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof dg)return e;let A=new dg(0,-1,0);return this.nodes.push(A),A}addBlock(e){this.enterLine();let A=e.deco;A&&A.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,A&&A.endSide>0&&(this.covering=e)}addLineDeco(e,A,t){let n=this.ensureLine();n.length+=t,n.collapsed+=t,n.widgetHeight=Math.max(n.widgetHeight,e),n.breaks+=A,this.writtenTo=this.pos=this.pos+t}finish(e){let A=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(A instanceof dg)&&!this.isCovered?this.nodes.push(new dg(0,-1,0)):(this.writtenTog.clientHeight||g.scrollWidth>g.clientWidth)&&C.overflow!="visible"){let d=g.getBoundingClientRect();o=Math.max(o,d.left),a=Math.min(a,d.right),r=Math.max(r,d.top),s=Math.min(l==i.parentNode?n.innerHeight:s,d.bottom)}l=C.position=="absolute"||C.position=="fixed"?g.offsetParent:g.parentNode}else if(l.nodeType==11)l=l.host;else break;return{left:o-A.left,right:Math.max(o,a)-A.left,top:r-(A.top+e),bottom:Math.max(r,s)-(A.top+e)}}function ZcA(i){let e=i.getBoundingClientRect(),A=i.ownerDocument.defaultView||window;return e.left0&&e.top0}function XcA(i,e){let A=i.getBoundingClientRect();return{left:0,right:A.right-A.left,top:e,bottom:A.bottom-(A.top+e)}}var o4=class{constructor(e,A,t,n){this.from=e,this.to=A,this.size=t,this.displaySize=n}static same(e,A){if(e.length!=A.length)return!1;for(let t=0;ttypeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new P9(t),this.stateDeco=EY(A),this.heightMap=Nl.empty().applyChanges(this.stateDeco,On.empty,this.heightOracle.setDoc(A.doc),[new rc(0,0,0,A.doc.length)]);for(let n=0;n<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());n++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Lt.set(this.lineGaps.map(n=>n.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:A}=this.state.selection;for(let t=0;t<=1;t++){let n=t?A.head:A.anchor;if(!e.some(({from:o,to:a})=>n>=o&&n<=a)){let{from:o,to:a}=this.lineBlockAt(n);e.push(new $B(o,a))}}return this.viewports=e.sort((t,n)=>t.from-n.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?hY:new X9(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Zu(e,this.scaler))})}update(e,A=null){this.state=e.state;let t=this.stateDeco;this.stateDeco=EY(this.state);let n=e.changedRanges,o=rc.extendWithRanges(n,qcA(t,this.stateDeco,e?e.changes:Zr.empty(this.state.doc.length))),a=this.heightMap.height,r=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);IY(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=a||sh)&&(e.flags|=2),r?(this.scrollAnchorPos=e.changes.mapPos(r.from,-1),this.scrollAnchorHeight=r.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let s=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(A&&(A.range.heads.to)||!this.viewportIsAppropriate(s))&&(s=this.getViewport(0,A));let l=s.from!=this.viewport.from||s.to!=this.viewport.to;this.viewport=s,e.flags|=this.updateForViewport(),(l||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),A&&(this.scrollTarget=A),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet($Y)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,A=e.contentDOM,t=window.getComputedStyle(A),n=this.heightOracle,o=t.whiteSpace;this.defaultTextDirection=t.direction=="rtl"?Lo.RTL:Lo.LTR;let a=this.heightOracle.mustRefreshForWrapping(o)||this.mustMeasureContent==="refresh",r=A.getBoundingClientRect(),s=a||this.mustMeasureContent||this.contentDOMHeight!=r.height;this.contentDOMHeight=r.height,this.mustMeasureContent=!1;let l=0,g=0;if(r.width&&r.height){let{scaleX:M,scaleY:x}=LY(A,r);(M>.005&&Math.abs(this.scaleX-M)>.005||x>.005&&Math.abs(this.scaleY-x)>.005)&&(this.scaleX=M,this.scaleY=x,l|=16,a=s=!0)}let C=(parseInt(t.paddingTop)||0)*this.scaleY,d=(parseInt(t.paddingBottom)||0)*this.scaleY;(this.paddingTop!=C||this.paddingBottom!=d)&&(this.paddingTop=C,this.paddingBottom=d,l|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(n.lineWrapping&&(s=!0),this.editorWidth=e.scrollDOM.clientWidth,l|=16);let B=GY(this.view.contentDOM,!1).y;B!=this.scrollParent&&(this.scrollParent=B,this.scrollAnchorHeight=-1,this.scrollOffset=0);let u=this.getScrollOffset();this.scrollOffset!=u&&(this.scrollAnchorHeight=-1,this.scrollOffset=u),this.scrolledToBottom=UY(this.scrollParent||e.win);let E=(this.printing?XcA:WcA)(A,this.paddingTop),f=E.top-this.pixelViewport.top,m=E.bottom-this.pixelViewport.bottom;this.pixelViewport=E;let v=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(v!=this.inView&&(this.inView=v,v&&(s=!0)),!this.inView&&!this.scrollTarget&&!ZcA(e.dom))return 0;let S=r.width;if((this.contentDOMWidth!=S||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=r.width,this.editorHeight=e.scrollDOM.clientHeight,l|=16),s){let M=e.docView.measureVisibleLineHeights(this.viewport);if(n.mustRefreshForHeights(M)&&(a=!0),a||n.lineWrapping&&Math.abs(S-this.contentDOMWidth)>n.charWidth){let{lineHeight:x,charWidth:F,textHeight:z}=e.docView.measureTextSize();a=x>0&&n.refresh(o,x,F,z,Math.max(5,S/F),M),a&&(e.docView.minWidth=0,l|=16)}f>0&&m>0?g=Math.max(f,m):f<0&&m<0&&(g=Math.min(f,m)),IY();for(let x of this.viewports){let F=x.from==this.viewport.from?M:e.docView.measureVisibleLineHeights(x);this.heightMap=(a?Nl.empty().applyChanges(this.stateDeco,On.empty,this.heightOracle,[new rc(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(n,0,a,new j9(x.from,F))}sh&&(l|=2)}let k=!this.viewportIsAppropriate(this.viewport,g)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return k&&(l&2&&(l|=this.updateScaler()),this.viewport=this.getViewport(g,this.scrollTarget),l|=this.updateForViewport()),(l&2||k)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),l|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),l}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,A){let t=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),n=this.heightMap,o=this.heightOracle,{visibleTop:a,visibleBottom:r}=this,s=new $B(n.lineAt(a-t*1e3,Qa.ByHeight,o,0,0).from,n.lineAt(r+(1-t)*1e3,Qa.ByHeight,o,0,0).to);if(A){let{head:l}=A.range;if(ls.to){let g=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),C=n.lineAt(l,Qa.ByPos,o,0,0),d;A.y=="center"?d=(C.top+C.bottom)/2-g/2:A.y=="start"||A.y=="nearest"&&l=r+Math.max(10,Math.min(t,250)))&&n>a-2*1e3&&o>1,a=n<<1;if(this.defaultTextDirection!=Lo.LTR&&!t)return[];let r=[],s=(g,C,d,B)=>{if(C-gg&&mm.from>=d.from&&m.to<=d.to&&Math.abs(m.from-g)m.fromv));if(!f){if(CS.from<=C&&S.to>=C)){let S=A.moveToLineBoundary(Be.cursor(C),!1,!0).head;S>g&&(C=S)}let m=this.gapSize(d,g,C,B),v=t||m<2e6?m:2e6;f=new o4(g,C,m,v)}r.push(f)},l=g=>{if(g.length2e6)for(let x of e)x.from>=g.from&&x.fromg.from&&s(g.from,B,g,C),uA.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let A=this.stateDeco;this.lineGaps.length&&(A=A.concat(this.lineGapDeco));let t=[];uo.spans(A,this.viewport.from,this.viewport.to,{span(o,a){t.push({from:o,to:a})},point(){}},20);let n=0;if(t.length!=this.visibleRanges.length)n=12;else for(let o=0;o=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(A=>A.from<=e&&A.to>=e)||Zu(this.heightMap.lineAt(e,Qa.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(A=>A.top<=e&&A.bottom>=e)||Zu(this.heightMap.lineAt(this.scaler.fromDOM(e),Qa.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let A=this.lineBlockAtHeight(e+8);return A.from>=this.viewport.from||this.viewportLines[0].top-e>200?A:this.viewportLines[0]}elementAtHeight(e){return Zu(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}},$B=class{constructor(e,A){this.from=e,this.to=A}};function $cA(i,e,A){let t=[],n=i,o=0;return uo.spans(A,i,e,{span(){},point(a,r){a>n&&(t.push({from:n,to:a}),o+=a-n),n=r}},20),n=1)return e[e.length-1].to;let t=Math.floor(i*A);for(let n=0;;n++){let{from:o,to:a}=e[n],r=a-o;if(t<=r)return o+t;t-=r}}function Y6(i,e){let A=0;for(let{from:t,to:n}of i.ranges){if(e<=n){A+=e-t;break}A+=n-t}return A/i.total}function A0A(i,e){for(let A of i)if(e(A))return A}var hY={toDOM(i){return i},fromDOM(i){return i},scale:1,eq(i){return i==this}};function EY(i){let e=i.facet(Q8).filter(t=>typeof t!="function"),A=i.facet(uS).filter(t=>typeof t!="function");return A.length&&e.push(uo.join(A)),e}var X9=class i{constructor(e,A,t){let n=0,o=0,a=0;this.viewports=t.map(({from:r,to:s})=>{let l=A.lineAt(r,Qa.ByPos,e,0,0).top,g=A.lineAt(s,Qa.ByPos,e,0,0).bottom;return n+=g-l,{from:r,to:s,top:l,bottom:g,domTop:0,domBottom:0}}),this.scale=(7e6-n)/(A.height-n);for(let r of this.viewports)r.domTop=a+(r.top-o)*this.scale,a=r.domBottom=r.domTop+(r.bottom-r.top),o=r.bottom}toDOM(e){for(let A=0,t=0,n=0;;A++){let o=AA.from==e.viewports[t].from&&A.to==e.viewports[t].to):!1}};function Zu(i,e){if(e.scale==1)return i;let A=e.toDOM(i.top),t=e.toDOM(i.bottom);return new ac(i.from,i.length,A,t-A,Array.isArray(i._content)?i._content.map(n=>Zu(n,e)):i._content)}var H6=nt.define({combine:i=>i.join(" ")}),I9=nt.define({combine:i=>i.indexOf(!0)>-1}),$9=Cg.newName(),uH=Cg.newName(),pH=Cg.newName(),fH={"&light":"."+uH,"&dark":"."+pH};function AS(i,e,A){return new Cg(e,{finish(t){return/&/.test(t)?t.replace(/&\w*/,n=>{if(n=="&")return i;if(!A||!A[n])throw new RangeError(`Unsupported selector: ${n}`);return A[n]}):i+" "+t}})}var e0A=AS("."+$9,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},fH),t0A={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},B9=Ct.ie&&Ct.ie_version<=11,eS=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new D9,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(A=>{for(let t of A)this.queue.push(t);(Ct.ie&&Ct.ie_version<=11||Ct.ios&&e.composing)&&A.some(t=>t.type=="childList"&&t.removedNodes.length||t.type=="characterData"&&t.oldValue.length>t.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Ct.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Ct.chrome&&Ct.chrome_version<126)&&(this.editContext=new tS(e),e.state.facet(lC)&&(e.contentDOM.editContext=this.editContext.editContext)),B9&&(this.onCharData=A=>{this.queue.push({target:A.target,type:"characterData",oldValue:A.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var A;((A=this.view.docView)===null||A===void 0?void 0:A.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),A.length>0&&A[A.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(A=>{A.length>0&&A[A.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((A,t)=>A!=e[t]))){this.gapIntersection.disconnect();for(let A of e)this.gapIntersection.observe(A);this.gaps=e}}onSelectionChange(e){let A=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:t}=this,n=this.selectionRange;if(t.state.facet(lC)?t.root.activeElement!=this.dom:!$u(this.dom,n))return;let o=n.anchorNode&&t.docView.tile.nearest(n.anchorNode);if(o&&o.isWidget()&&o.widget.ignoreEvent(e)){A||(this.selectionChanged=!1);return}(Ct.ie&&Ct.ie_version<=11||Ct.android&&Ct.chrome)&&!t.state.selection.main.empty&&n.focusNode&&A4(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,A=g4(e.root);if(!A)return!1;let t=Ct.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&i0A(this.view,A)||A;if(!t||this.selectionRange.eq(t))return!1;let n=$u(this.dom,t);return n&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let o=this.delayedAndroidKey;o&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=o.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&o.force&&ih(this.dom,o.key,o.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(n)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:A,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let A=-1,t=-1,n=!1;for(let o of e){let a=this.readMutation(o);a&&(a.typeOver&&(n=!0),A==-1?{from:A,to:t}=a:(A=Math.min(a.from,A),t=Math.max(a.to,t)))}return{from:A,to:t,typeOver:n}}readChange(){let{from:e,to:A,typeOver:t}=this.processRecords(),n=this.selectionChanged&&$u(this.dom,this.selectionRange);if(e<0&&!n)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new J9(this.view,e,A,t);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let A=this.readChange();if(!A)return this.view.requestMeasure(),!1;let t=this.view.state,n=lH(this.view,A);return this.view.state==t&&(A.domChanged||A.newSel&&!r8(this.view.state.selection,A.newSel.main))&&this.view.update([]),n}readMutation(e){let A=this.view.docView.tile.nearest(e.target);if(!A||A.isWidget())return null;if(A.markDirty(e.type=="attributes"),e.type=="childList"){let t=QY(A,e.previousSibling||e.target.previousSibling,-1),n=QY(A,e.nextSibling||e.target.nextSibling,1);return{from:t?A.posAfter(t):A.posAtStart,to:n?A.posBefore(n):A.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:A.posAtStart,to:A.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(lC)!=e.state.facet(lC)&&(e.view.contentDOM.editContext=e.state.facet(lC)?this.editContext.editContext:null))}destroy(){var e,A,t;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(A=this.gapIntersection)===null||A===void 0||A.disconnect(),(t=this.resizeScroll)===null||t===void 0||t.disconnect();for(let n of this.scrollTargets)n.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function QY(i,e,A){for(;e;){let t=_a.get(e);if(t&&t.parent==i)return t;let n=e.parentNode;e=n!=i.dom?n:A>0?e.nextSibling:e.previousSibling}return null}function uY(i,e){let A=e.startContainer,t=e.startOffset,n=e.endContainer,o=e.endOffset,a=i.docView.domAtPos(i.state.selection.main.anchor,1);return A4(a.node,a.offset,n,o)&&([A,t,n,o]=[n,o,A,t]),{anchorNode:A,anchorOffset:t,focusNode:n,focusOffset:o}}function i0A(i,e){if(e.getComposedRanges){let n=e.getComposedRanges(i.root)[0];if(n)return uY(i,n)}let A=null;function t(n){n.preventDefault(),n.stopImmediatePropagation(),A=n.getTargetRanges()[0]}return i.contentDOM.addEventListener("beforeinput",t,!0),i.dom.ownerDocument.execCommand("indent"),i.contentDOM.removeEventListener("beforeinput",t,!0),A?uY(i,A):null}var tS=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let A=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=t=>{let n=e.state.selection.main,{anchor:o,head:a}=n,r=this.toEditorPos(t.updateRangeStart),s=this.toEditorPos(t.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:t.updateRangeStart,editorBase:r,drifted:!1});let l=s-r>t.text.length;r==this.from&&othis.to&&(s=o);let g=gH(e.state.sliceDoc(r,s),t.text,(l?n.from:n.to)-r,l?"end":null);if(!g){let d=Be.single(this.toEditorPos(t.selectionStart),this.toEditorPos(t.selectionEnd));r8(d,n)||e.dispatch({selection:d,userEvent:"select"});return}let C={from:g.from+r,to:g.toA+r,insert:On.of(t.text.slice(g.from,g.toB).split(` `))};if((Ct.mac||Ct.android)&&C.from==a-1&&/^\. ?$/.test(t.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(C={from:r,to:s,insert:On.of([t.text.replace("."," ")])}),this.pendingContextChange=C,!e.state.readOnly){let d=this.to-this.from+(C.to-C.from+C.insert.length);fS(e,C,Be.single(this.toEditorPos(t.selectionStart,d),this.toEditorPos(t.selectionEnd,d)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),C.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(A.text.slice(Math.max(0,t.updateRangeStart-1),Math.min(A.text.length,t.updateRangeStart+1)))&&this.handlers.compositionend(t)},this.handlers.characterboundsupdate=t=>{let n=[],o=null;for(let a=this.toEditorPos(t.rangeStart),r=this.toEditorPos(t.rangeEnd);a{let n=[];for(let o of t.getTextFormats()){let a=o.underlineStyle,r=o.underlineThickness;if(!/none/i.test(a)&&!/none/i.test(r)){let s=this.toEditorPos(o.rangeStart),l=this.toEditorPos(o.rangeEnd);if(s{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:t}=this.composing;this.composing=null,t&&this.reset(e.state)}};for(let t in this.handlers)A.addEventListener(t,this.handlers[t]);this.measureReq={read:t=>{this.editContext.updateControlBounds(t.contentDOM.getBoundingClientRect());let n=g4(t.root);n&&n.rangeCount&&this.editContext.updateSelectionBounds(n.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let A=0,t=!1,n=this.pendingContextChange;return e.changes.iterChanges((o,a,r,s,l)=>{if(t)return;let g=l.length-(a-o);if(n&&a>=n.to)if(n.from==o&&n.to==a&&n.insert.eq(l)){n=this.pendingContextChange=null,A+=g,this.to+=g;return}else n=null,this.revertPending(e.state);if(o+=A,a+=A,a<=this.from)this.from+=g,this.to+=g;else if(othis.to||this.to-this.from+l.length>3e4){t=!0;return}this.editContext.updateText(this.toContextPos(o),this.toContextPos(a),l.toString()),this.to+=g}A+=g}),n&&!t&&this.revertPending(e.state),!t}update(e){let A=this.pendingContextChange,t=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(t.from,t.to)&&e.transactions.some(n=>!n.isUserEvent("input.type")&&n.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||A)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:A}=e.selection.main;this.from=Math.max(0,A-1e4),this.to=Math.min(e.doc.length,A+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let A=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(A.from),this.toContextPos(A.from+A.insert.length),e.doc.sliceString(A.from,A.to))}setSelection(e){let{main:A}=e.selection,t=this.toContextPos(Math.max(this.from,Math.min(this.to,A.anchor))),n=this.toContextPos(A.head);(this.editContext.selectionStart!=t||this.editContext.selectionEnd!=n)&&this.editContext.updateSelection(t,n)}rangeIsValid(e){let{head:A}=e.selection.main;return!(this.from>0&&A-this.from<500||this.to1e4*3)}toEditorPos(e,A=this.to-this.from){e=Math.min(e,A);let t=this.composing;return t&&t.drifted?t.editorBase+(e-t.contextBase):e+this.from}toContextPos(e){let A=this.composing;return A&&A.drifted?A.contextBase+(e-A.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},ui=(()=>{class i{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(A={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),A.parent&&A.parent.appendChild(this.dom);let{dispatch:n}=A;this.dispatchTransactions=A.dispatchTransactions||n&&(o=>o.forEach(a=>n(a,this)))||(o=>this.update(o)),this.dispatch=this.dispatch.bind(this),this._root=A.root||ZgA(A.parent)||document,this.viewState=new g8(this,A.state||ir.create(A)),A.scrollTo&&A.scrollTo.is(U6)&&(this.viewState.scrollTarget=A.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(XB).map(o=>new t4(o));for(let o of this.plugins)o.update(this);this.observer=new eS(this),this.inputState=new Y9(this),this.inputState.ensureHandlers(this.plugins),this.docView=new o8(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...A){let t=A.length==1&&A[0]instanceof l0?A:A.length==1&&Array.isArray(A[0])?A[0]:[this.state.update(...A)];this.dispatchTransactions(t,this)}update(A){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,n=!1,o,a=this.state;for(let B of A){if(B.startState!=a)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");a=B.state}if(this.destroyed){this.viewState.state=a;return}let r=this.hasFocus,s=0,l=null;A.some(B=>B.annotation(hH))?(this.inputState.notifiedFocused=r,s=1):r!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=r,l=EH(a,r),l||(s=1));let g=this.observer.delayedAndroidKey,C=null;if(g?(this.observer.clearDelayedAndroidKey(),C=this.observer.readChange(),(C&&!this.state.doc.eq(a.doc)||!this.state.selection.eq(a.selection))&&(C=null)):this.observer.clear(),a.facet(ir.phrases)!=this.state.facet(ir.phrases))return this.setState(a);o=i8.create(this,a,A),o.flags|=s;let d=this.viewState.scrollTarget;try{this.updateState=2;for(let B of A){if(d&&(d=d.map(B.changes)),B.scrollIntoView){let{main:u}=B.state.selection;d=new e4(u.empty?u:Be.cursor(u.head,u.head>u.anchor?-1:1))}for(let u of B.effects)u.is(U6)&&(d=u.value.clip(this.state))}this.viewState.update(o,d),this.bidiCache=c8.update(this.bidiCache,o.changes),o.empty||(this.updatePlugins(o),this.inputState.update(o)),t=this.docView.update(o),this.state.facet(Wu)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(A),this.docView.updateSelection(t,A.some(B=>B.isUserEvent("select.pointer")))}finally{this.updateState=0}if(o.startState.facet(H6)!=o.state.facet(H6)&&(this.viewState.mustMeasureContent=!0),(t||n||d||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!o.empty)for(let B of this.state.facet(g9))try{B(o)}catch(u){Gr(this.state,u,"update listener")}(l||C)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),C&&!lH(this,C)&&g.force&&ih(this.contentDOM,g.key,g.keyCode)})}setState(A){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=A;return}this.updateState=2;let t=this.hasFocus;try{for(let n of this.plugins)n.destroy(this);this.viewState=new g8(this,A),this.plugins=A.facet(XB).map(n=>new t4(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new o8(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(A){let t=A.startState.facet(XB),n=A.state.facet(XB);if(t!=n){let o=[];for(let a of n){let r=t.indexOf(a);if(r<0)o.push(new t4(a));else{let s=this.plugins[r];s.mustUpdate=A,o.push(s)}}for(let a of this.plugins)a.mustUpdate!=A&&a.destroy(this);this.plugins=o,this.pluginMap.clear()}else for(let o of this.plugins)o.mustUpdate=A;for(let o=0;o-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,A&&this.observer.forceFlush();let t=null,n=this.viewState.scrollParent,o=this.viewState.getScrollOffset(),{scrollAnchorPos:a,scrollAnchorHeight:r}=this.viewState;Math.abs(o-this.viewState.scrollOffset)>1&&(r=-1),this.viewState.scrollAnchorHeight=-1;try{for(let s=0;;s++){if(r<0)if(UY(n||this.win))a=-1,r=this.viewState.heightMap.height;else{let u=this.viewState.scrollAnchorAt(o);a=u.from,r=u.top}this.updateState=1;let l=this.viewState.measure();if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(s>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let g=[];l&4||([this.measureRequests,g]=[g,this.measureRequests]);let C=g.map(u=>{try{return u.read(this)}catch(E){return Gr(this.state,E),pY}}),d=i8.create(this,this.state,[]),B=!1;d.flags|=l,t?t.flags|=l:t=d,this.updateState=2,d.empty||(this.updatePlugins(d),this.inputState.update(d),this.updateAttrs(),B=this.docView.update(d),B&&this.docViewUpdate());for(let u=0;u1||E<-1)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){o=o+E,n?n.scrollTop+=E:this.win.scrollBy(0,E),r=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let s of this.state.facet(g9))s(t)}get themeClasses(){return $9+" "+(this.state.facet(I9)?pH:uH)+" "+this.state.facet(H6)}updateAttrs(){let A=fY(this,AY,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(lC)?"true":"false",class:"cm-content",style:`${Ct.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),fY(this,S9,t);let n=this.observer.ignore(()=>{let o=WJ(this.contentDOM,this.contentAttrs,t),a=WJ(this.dom,this.editorAttrs,A);return o||a});return this.editorAttrs=A,this.contentAttrs=t,n}showAnnouncements(A){let t=!0;for(let n of A)for(let o of n.effects)if(o.is(i.announce)){t&&(this.announceDOM.textContent=""),t=!1;let a=this.announceDOM.appendChild(document.createElement("div"));a.textContent=o.value}}mountStyles(){this.styleModules=this.state.facet(Wu);let A=this.state.facet(i.cspNonce);Cg.mount(this.root,this.styleModules.concat(e0A).reverse(),A?{nonce:A}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(A){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),A){if(this.measureRequests.indexOf(A)>-1)return;if(A.key!=null){for(let t=0;tn.plugin==A)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(A){return this.readMeasured(),this.viewState.elementAtHeight(A)}lineBlockAtHeight(A){return this.readMeasured(),this.viewState.lineBlockAtHeight(A)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(A){return this.viewState.lineBlockAt(A)}get contentHeight(){return this.viewState.contentHeight}moveByChar(A,t,n){return d9(this,A,oY(this,A,t,n))}moveByGroup(A,t){return d9(this,A,oY(this,A,t,n=>vcA(this,A.head,n)))}visualLineSide(A,t){let n=this.bidiSpans(A),o=this.textDirectionAt(A.from),a=n[t?n.length-1:0];return Be.cursor(a.side(t,o)+A.from,a.forward(!t,o)?1:-1)}moveToLineBoundary(A,t,n=!0){return DcA(this,A,t,n)}moveVertically(A,t,n){return d9(this,A,bcA(this,A,t,n))}domAtPos(A,t=1){return this.docView.domAtPos(A,t)}posAtDOM(A,t=0){return this.docView.posFromDOM(A,t)}posAtCoords(A,t=!0){this.readMeasured();let n=U9(this,A,t);return n&&n.pos}posAndSideAtCoords(A,t=!0){return this.readMeasured(),U9(this,A,t)}coordsAtPos(A,t=1){this.readMeasured();let n=this.docView.coordsAt(A,t);if(!n||n.left==n.right)return n;let o=this.state.doc.lineAt(A),a=this.bidiSpans(o),r=a[Bg.find(a,A-o.from,-1,t)];return t8(n,r.dir==Lo.LTR==t>0)}coordsForChar(A){return this.readMeasured(),this.docView.coordsForChar(A)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(A){return!this.state.facet($J)||Athis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(A))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(A){if(A.length>n0A)return zY(A.length);let t=this.textDirectionAt(A.from),n;for(let a of this.bidiCache)if(a.from==A.from&&a.dir==t&&(a.fresh||HY(a.isolates,n=eY(this,A))))return a.order;n||(n=eY(this,A));let o=ocA(A.text,t,n);return this.bidiCache.push(new c8(A.from,A.to,t,n,!0,o)),o}get hasFocus(){var A;return(this.dom.ownerDocument.hasFocus()||Ct.safari&&((A=this.inputState)===null||A===void 0?void 0:A.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{KY(this.contentDOM),this.docView.updateSelection()})}setRoot(A){this._root!=A&&(this._root=A,this.observer.setWindow((A.nodeType==9?A:A.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let A of this.plugins)A.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(A,t={}){return U6.of(new e4(typeof A=="number"?Be.cursor(A):A,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:A,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(A);return U6.of(new e4(Be.cursor(n.from),"start","start",n.top-A,t,!0))}setTabFocusMode(A){A==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof A=="boolean"?this.inputState.tabFocusMode=A?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+A)}static domEventHandlers(A){return Po.define(()=>({}),{eventHandlers:A})}static domEventObservers(A){return Po.define(()=>({}),{eventObservers:A})}static theme(A,t){let n=Cg.newName(),o=[H6.of(n),Wu.of(AS(`.${n}`,A))];return t&&t.dark&&o.push(I9.of(!0)),o}static baseTheme(A){return oc.lowest(Wu.of(AS("."+$9,A,fH)))}static findFromDOM(A){var t;let n=A.querySelector(".cm-content"),o=n&&_a.get(n)||_a.get(A);return((t=o?.root)===null||t===void 0?void 0:t.view)||null}}return i.styleModule=Wu,i.inputHandler=ZY,i.clipboardInputFilter=ES,i.clipboardOutputFilter=QS,i.scrollHandler=AH,i.focusChangeEffect=XY,i.perLineTextDirection=$J,i.exceptionSink=WY,i.updateListener=g9,i.editable=lC,i.mouseSelectionStyle=qY,i.dragMovesSelection=VY,i.clickAddsSelectionRange=jY,i.decorations=Q8,i.blockWrappers=tH,i.outerDecorations=uS,i.atomicRanges=C4,i.bidiIsolatedRanges=iH,i.scrollMargins=nH,i.darkTheme=I9,i.cspNonce=nt.define({combine:e=>e.length?e[0]:""}),i.contentAttributes=S9,i.editorAttributes=AY,i.lineWrapping=i.contentAttributes.of({class:"cm-lineWrapping"}),i.announce=ln.define(),i})(),n0A=4096,pY={},c8=class i{constructor(e,A,t,n,o,a){this.from=e,this.to=A,this.dir=t,this.isolates=n,this.fresh=o,this.order=a}static update(e,A){if(A.empty&&!e.some(o=>o.fresh))return e;let t=[],n=e.length?e[e.length-1].dir:Lo.LTR;for(let o=Math.max(0,e.length-10);o=0;n--){let o=t[n],a=typeof o=="function"?o(i):o;a&&IS(a,A)}return A}var o0A=Ct.mac?"mac":Ct.windows?"win":Ct.linux?"linux":"key";function a0A(i,e){let A=i.split(/-(?!$)/),t=A[A.length-1];t=="Space"&&(t=" ");let n,o,a,r;for(let s=0;st.concat(n),[]))),A}function wH(i,e,A){return yH(mH(i.state),e,i,A)}var b2=null,s0A=4e3;function l0A(i,e=o0A){let A=Object.create(null),t=Object.create(null),n=(a,r)=>{let s=t[a];if(s==null)t[a]=r;else if(s!=r)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},o=(a,r,s,l,g)=>{var C,d;let B=A[a]||(A[a]=Object.create(null)),u=r.split(/ (?!$)/).map(m=>a0A(m,e));for(let m=1;m{let k=b2={view:S,prefix:v,scope:a};return setTimeout(()=>{b2==k&&(b2=null)},s0A),!0}]})}let E=u.join(" ");n(E,!1);let f=B[E]||(B[E]={preventDefault:!1,stopPropagation:!1,run:((d=(C=B._any)===null||C===void 0?void 0:C.run)===null||d===void 0?void 0:d.slice())||[]});s&&f.run.push(s),l&&(f.preventDefault=!0),g&&(f.stopPropagation=!0)};for(let a of i){let r=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let l of r){let g=A[l]||(A[l]=Object.create(null));g._any||(g._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:C}=a;for(let d in g)g[d].run.push(B=>C(B,iS))}let s=a[e]||a.key;if(s)for(let l of r)o(l,s,a.run,a.preventDefault,a.stopPropagation),a.shift&&o(l,"Shift-"+s,a.shift,a.preventDefault,a.stopPropagation)}return A}var iS=null;function yH(i,e,A,t){iS=e;let n=zJ(e),o=$r(n,0),a=Rl(o)==n.length&&n!=" ",r="",s=!1,l=!1,g=!1;b2&&b2.view==A&&b2.scope==t&&(r=b2.prefix+" ",CH.indexOf(e.keyCode)<0&&(l=!0,b2=null));let C=new Set,d=f=>{if(f){for(let m of f.run)if(!C.has(m)&&(C.add(m),m(A)))return f.stopPropagation&&(g=!0),!0;f.preventDefault&&(f.stopPropagation&&(g=!0),l=!0)}return!1},B=i[t],u,E;return B&&(d(B[r+z6(n,e,!a)])?s=!0:a&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Ct.windows&&e.ctrlKey&&e.altKey)&&!(Ct.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(u=sC[e.keyCode])&&u!=n?(d(B[r+z6(u,e,!0)])||e.shiftKey&&(E=WB[e.keyCode])!=n&&E!=u&&d(B[r+z6(E,e,!1)]))&&(s=!0):a&&e.shiftKey&&d(B[r+z6(n,e,!0)])&&(s=!0),!s&&d(B._any)&&(s=!0)),l&&(s=!0),s&&g&&e.stopPropagation(),iS=null,s}var md=class i{constructor(e,A,t,n,o){this.className=e,this.left=A,this.top=t,this.width=n,this.height=o}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,A){return A.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,A,t){if(t.empty){let n=e.coordsAtPos(t.head,t.assoc||1);if(!n)return[];let o=DH(e);return[new i(A,n.left-o.left,n.top-o.top,null,n.bottom-n.top)]}else return g0A(e,A,t)}};function DH(i){let e=i.scrollDOM.getBoundingClientRect();return{left:(i.textDirection==Lo.LTR?e.left:e.right-i.scrollDOM.clientWidth*i.scaleX)-i.scrollDOM.scrollLeft*i.scaleX,top:e.top-i.scrollDOM.scrollTop*i.scaleY}}function wY(i,e,A,t){let n=i.coordsAtPos(e,A*2);if(!n)return t;let o=i.dom.getBoundingClientRect(),a=(n.top+n.bottom)/2,r=i.posAtCoords({x:o.left+1,y:a}),s=i.posAtCoords({x:o.right-1,y:a});return r==null||s==null?t:{from:Math.max(t.from,Math.min(r,s)),to:Math.min(t.to,Math.max(r,s))}}function g0A(i,e,A){if(A.to<=i.viewport.from||A.from>=i.viewport.to)return[];let t=Math.max(A.from,i.viewport.from),n=Math.min(A.to,i.viewport.to),o=i.textDirection==Lo.LTR,a=i.contentDOM,r=a.getBoundingClientRect(),s=DH(i),l=a.querySelector(".cm-line"),g=l&&window.getComputedStyle(l),C=r.left+(g?parseInt(g.paddingLeft)+Math.min(0,parseInt(g.textIndent)):0),d=r.right-(g?parseInt(g.paddingRight):0),B=K9(i,t,1),u=K9(i,n,-1),E=B.type==As.Text?B:null,f=u.type==As.Text?u:null;if(E&&(i.lineWrapping||B.widgetLineBreaks)&&(E=wY(i,t,1,E)),f&&(i.lineWrapping||u.widgetLineBreaks)&&(f=wY(i,n,-1,f)),E&&f&&E.from==f.from&&E.to==f.to)return v(S(A.from,A.to,E));{let M=E?S(A.from,null,E):k(B,!1),x=f?S(null,A.to,f):k(u,!0),F=[];return(E||B).to<(f||u).from-(E&&f?1:0)||B.widgetLineBreaks>1&&M.bottom+i.defaultLineHeight/2Z&&wA.from=QA)break;xA>BA&&eA(Math.max(IA,BA),M==null&&IA<=Z,Math.min(xA,QA),x==null&&xA>=CA,dA.dir)}if(BA=RA.to+1,BA>=QA)break}return X.length==0&&eA(Z,M==null,CA,x==null,i.textDirection),{top:z,bottom:j,horizontal:X}}function k(M,x){let F=r.top+(x?M.top:M.bottom);return{top:F,bottom:F,horizontal:[]}}}function c0A(i,e){return i.constructor==e.constructor&&i.eq(e)}var nS=class{constructor(e,A){this.view=e,this.layer=A,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),A.above&&this.dom.classList.add("cm-layer-above"),A.class&&this.dom.classList.add(A.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),A.mount&&A.mount(this.dom,e)}update(e){e.startState.facet(W6)!=e.state.facet(W6)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let A=0,t=e.facet(W6);for(;A!c0A(A,this.drawn[t]))){let A=this.dom.firstChild,t=0;for(let n of e)n.update&&A&&n.constructor&&this.drawn[t].constructor&&n.update(A,this.drawn[t])?(A=A.nextSibling,t++):this.dom.insertBefore(n.draw(),A);for(;A;){let n=A.nextSibling;A.remove(),A=n}this.drawn=e,Ct.safari&&Ct.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}},W6=nt.define();function vH(i){return[Po.define(e=>new nS(e,i)),W6.of(i)]}var lh=nt.define({combine(i){return Lr(i,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,A)=>Math.min(e,A),drawRangeCursor:(e,A)=>e||A})}});function bH(i={}){return[lh.of(i),C0A,d0A,I0A,$Y.of(!0)]}function MH(i){return i.startState.facet(lh)!=i.state.facet(lh)}var C0A=vH({above:!0,markers(i){let{state:e}=i,A=e.facet(lh),t=[];for(let n of e.selection.ranges){let o=n==e.selection.main;if(n.empty||A.drawRangeCursor&&!(o&&Ct.ios&&A.iosSelectionHandles)){let a=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",r=n.empty?n:Be.cursor(n.head,n.assoc);for(let s of md.forRange(i,a,r))t.push(s)}}return t},update(i,e){i.transactions.some(t=>t.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let A=MH(i);return A&&yY(i.state,e),i.docChanged||i.selectionSet||A},mount(i,e){yY(e.state,i)},class:"cm-cursorLayer"});function yY(i,e){e.style.animationDuration=i.facet(lh).cursorBlinkRate+"ms"}var d0A=vH({above:!1,markers(i){let e=[],{main:A,ranges:t}=i.state.selection;for(let n of t)if(!n.empty)for(let o of md.forRange(i,"cm-selectionBackground",n))e.push(o);if(Ct.ios&&!A.empty&&i.state.facet(lh).iosSelectionHandles){for(let n of md.forRange(i,"cm-selectionHandle cm-selectionHandle-start",Be.cursor(A.from,1)))e.push(n);for(let n of md.forRange(i,"cm-selectionHandle cm-selectionHandle-end",Be.cursor(A.to,1)))e.push(n)}return e},update(i,e){return i.docChanged||i.selectionSet||i.viewportChanged||MH(i)},class:"cm-selectionLayer"}),I0A=oc.highest(ui.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),SH=ln.define({map(i,e){return i==null?null:e.mapPos(i)}}),Xu=La.define({create(){return null},update(i,e){return i!=null&&(i=e.changes.mapPos(i)),e.effects.reduce((A,t)=>t.is(SH)?t.value:A,i)}}),B0A=Po.fromClass(class{constructor(i){this.view=i,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(i){var e;let A=i.state.field(Xu);A==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(i.startState.field(Xu)!=A||i.docChanged||i.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:i}=this,e=i.state.field(Xu),A=e!=null&&i.coordsAtPos(e);if(!A)return null;let t=i.scrollDOM.getBoundingClientRect();return{left:A.left-t.left+i.scrollDOM.scrollLeft*i.scaleX,top:A.top-t.top+i.scrollDOM.scrollTop*i.scaleY,height:A.bottom-A.top}}drawCursor(i){if(this.cursor){let{scaleX:e,scaleY:A}=this.view;i?(this.cursor.style.left=i.left/e+"px",this.cursor.style.top=i.top/A+"px",this.cursor.style.height=i.height/A+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(i){this.view.state.field(Xu)!=i&&this.view.dispatch({effects:SH.of(i)})}},{eventObservers:{dragover(i){this.setDropPos(this.view.posAtCoords({x:i.clientX,y:i.clientY}))},dragleave(i){(i.target==this.view.contentDOM||!this.view.contentDOM.contains(i.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function kH(){return[Xu,B0A]}function DY(i,e,A,t,n){e.lastIndex=0;for(let o=i.iterRange(A,t),a=A,r;!o.next().done;a+=o.value.length)if(!o.lineBreak)for(;r=e.exec(o.value);)n(a+r.index,r)}function h0A(i,e){let A=i.visibleRanges;if(A.length==1&&A[0].from==i.viewport.from&&A[0].to==i.viewport.to)return A;let t=[];for(let{from:n,to:o}of A)n=Math.max(i.state.doc.lineAt(n).from,n-e),o=Math.min(i.state.doc.lineAt(o).to,o+e),t.length&&t[t.length-1].to>=n?t[t.length-1].to=o:t.push({from:n,to:o});return t}var oS=class{constructor(e){let{regexp:A,decoration:t,decorate:n,boundary:o,maxLength:a=1e3}=e;if(!A.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=A,n)this.addMatch=(r,s,l,g)=>n(g,l,l+r[0].length,r,s);else if(typeof t=="function")this.addMatch=(r,s,l,g)=>{let C=t(r,s,l);C&&g(l,l+r[0].length,C)};else if(t)this.addMatch=(r,s,l,g)=>g(l,l+r[0].length,t);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=o,this.maxLength=a}createDeco(e){let A=new Xr,t=A.add.bind(A);for(let{from:n,to:o}of h0A(e,this.maxLength))DY(e.state.doc,this.regexp,n,o,(a,r)=>this.addMatch(r,e,a,t));return A.finish()}updateDeco(e,A){let t=1e9,n=-1;return e.docChanged&&e.changes.iterChanges((o,a,r,s)=>{s>=e.view.viewport.from&&r<=e.view.viewport.to&&(t=Math.min(r,t),n=Math.max(s,n))}),e.viewportMoved||n-t>1e3?this.createDeco(e.view):n>-1?this.updateRange(e.view,A.map(e.changes),t,n):A}updateRange(e,A,t,n){for(let o of e.visibleRanges){let a=Math.max(o.from,t),r=Math.min(o.to,n);if(r>=a){let s=e.state.doc.lineAt(a),l=s.tos.from;a--)if(this.boundary.test(s.text[a-1-s.from])){g=a;break}for(;rd.push(m.range(E,f));if(s==l)for(this.regexp.lastIndex=g-s.from;(B=this.regexp.exec(s.text))&&B.indexthis.addMatch(f,e,E,u));A=A.update({filterFrom:g,filterTo:C,filter:(E,f)=>EC,add:d})}}return A}},aS=/x/.unicode!=null?"gu":"g",E0A=new RegExp(`[\0-\b -\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,aS),Q0A={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},h9=null;function u0A(){var i;if(h9==null&&typeof document<"u"&&document.body){let e=document.body.style;h9=((i=e.tabSize)!==null&&i!==void 0?i:e.MozTabSize)!=null}return h9||!1}var Z6=nt.define({combine(i){let e=Lr(i,{render:null,specialChars:E0A,addSpecialChars:null});return(e.replaceTabs=!u0A())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,aS)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,aS)),e}});function _H(i={}){return[Z6.of(i),p0A()]}var vY=null;function p0A(){return vY||(vY=Po.fromClass(class{constructor(i){this.view=i,this.decorations=Lt.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(i.state.facet(Z6)),this.decorations=this.decorator.createDeco(i)}makeDecorator(i){return new oS({regexp:i.specialChars,decoration:(e,A,t)=>{let{doc:n}=A.state,o=$r(e[0],0);if(o==9){let a=n.lineAt(t),r=A.state.tabSize,s=rC(a.text,r,t-a.from);return Lt.replace({widget:new sS((r-s%r)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=Lt.replace({widget:new rS(i,o)}))},boundary:i.replaceTabs?void 0:/[^]/})}update(i){let e=i.state.facet(Z6);i.startState.facet(Z6)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(i.view)):this.decorations=this.decorator.updateDeco(i,this.decorations)}},{decorations:i=>i.decorations}))}var f0A="\u2022";function m0A(i){return i>=32?f0A:i==10?"\u2424":String.fromCharCode(9216+i)}var rS=class extends gl{constructor(e,A){super(),this.options=e,this.code=A}eq(e){return e.code==this.code}toDOM(e){let A=m0A(this.code),t=e.state.phrase("Control character")+" "+(Q0A[this.code]||"0x"+this.code.toString(16)),n=this.options.render&&this.options.render(this.code,t,A);if(n)return n;let o=document.createElement("span");return o.textContent=A,o.title=t,o.setAttribute("aria-label",t),o.className="cm-specialChar",o}ignoreEvent(){return!1}},sS=class extends gl{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}};function xH(){return y0A}var w0A=Lt.line({class:"cm-activeLine"}),y0A=Po.fromClass(class{constructor(i){this.decorations=this.getDeco(i)}update(i){(i.docChanged||i.selectionSet)&&(this.decorations=this.getDeco(i.view))}getDeco(i){let e=-1,A=[];for(let t of i.state.selection.ranges){let n=i.lineBlockAt(t.head);n.from>e&&(A.push(w0A.range(n.from)),e=n.from)}return Lt.set(A)}},{decorations:i=>i.decorations});var lS=2e3;function D0A(i,e,A){let t=Math.min(e.line,A.line),n=Math.max(e.line,A.line),o=[];if(e.off>lS||A.off>lS||e.col<0||A.col<0){let a=Math.min(e.off,A.off),r=Math.max(e.off,A.off);for(let s=t;s<=n;s++){let l=i.doc.line(s);l.length<=r&&o.push(Be.range(l.from+a,l.to+r))}}else{let a=Math.min(e.col,A.col),r=Math.max(e.col,A.col);for(let s=t;s<=n;s++){let l=i.doc.line(s),g=G6(l.text,a,i.tabSize,!0);if(g<0)o.push(Be.cursor(l.to));else{let C=G6(l.text,r,i.tabSize);o.push(Be.range(l.from+g,l.from+C))}}}return o}function v0A(i,e){let A=i.coordsAtPos(i.viewport.from);return A?Math.round(Math.abs((A.left-e)/i.defaultCharacterWidth)):-1}function bY(i,e){let A=i.posAtCoords({x:e.clientX,y:e.clientY},!1),t=i.state.doc.lineAt(A),n=A-t.from,o=n>lS?-1:n==t.length?v0A(i,e.clientX):rC(t.text,i.state.tabSize,A-t.from);return{line:t.number,col:o,off:n}}function b0A(i,e){let A=bY(i,e),t=i.state.selection;return A?{update(n){if(n.docChanged){let o=n.changes.mapPos(n.startState.doc.line(A.line).from),a=n.state.doc.lineAt(o);A={line:a.number,col:A.col,off:Math.min(A.off,a.length)},t=t.map(n.changes)}},get(n,o,a){let r=bY(i,n);if(!r)return t;let s=D0A(i.state,A,r);return s.length?a?Be.create(s.concat(t.ranges)):Be.create(s):t}}:null}function RH(i){let e=i?.eventFilter||(A=>A.altKey&&A.button==0);return ui.mouseSelectionStyle.of((A,t)=>e(t)?b0A(A,t):null)}var M0A={Alt:[18,i=>!!i.altKey],Control:[17,i=>!!i.ctrlKey],Shift:[16,i=>!!i.shiftKey],Meta:[91,i=>!!i.metaKey]},S0A={style:"cursor: crosshair"};function NH(i={}){let[e,A]=M0A[i.key||"Alt"],t=Po.fromClass(class{constructor(n){this.view=n,this.isDown=!1}set(n){this.isDown!=n&&(this.isDown=n,this.view.update([]))}},{eventObservers:{keydown(n){this.set(n.keyCode==e||A(n))},keyup(n){(n.keyCode==e||!A(n))&&this.set(!1)},mousemove(n){this.set(A(n))}}});return[t,ui.contentAttributes.of(n=>{var o;return!((o=n.plugin(t))===null||o===void 0)&&o.isDown?S0A:null})]}var P6="-10000px",C8=class{constructor(e,A,t,n){this.facet=A,this.createTooltipView=t,this.removeTooltipView=n,this.input=e.state.facet(A),this.tooltips=this.input.filter(a=>a);let o=null;this.tooltipViews=this.tooltips.map(a=>o=t(a,o))}update(e,A){var t;let n=e.state.facet(this.facet),o=n.filter(s=>s);if(n===this.input){for(let s of this.tooltipViews)s.update&&s.update(e);return!1}let a=[],r=A?[]:null;for(let s=0;sA[l]=s),A.length=r.length),this.input=n,this.tooltips=o,this.tooltipViews=a,!0}};function k0A(i){let e=i.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}var E9=nt.define({combine:i=>{var e,A,t;return{position:Ct.ios?"absolute":((e=i.find(n=>n.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((A=i.find(n=>n.parent))===null||A===void 0?void 0:A.parent)||null,tooltipSpace:((t=i.find(n=>n.tooltipSpace))===null||t===void 0?void 0:t.tooltipSpace)||k0A}}}),MY=new WeakMap,mS=Po.fromClass(class{constructor(i){this.view=i,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=i.state.facet(E9);this.position=e.position,this.parent=e.parent,this.classes=i.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new C8(i,ch,(A,t)=>this.createTooltip(A,t),A=>{this.resizeObserver&&this.resizeObserver.unobserve(A.dom),A.dom.remove()}),this.above=this.manager.tooltips.map(A=>!!A.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(A=>{Date.now()>this.lastTransaction-50&&A.length>0&&A[A.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),i.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let i of this.manager.tooltipViews)this.intersectionObserver.observe(i.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(i){i.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(i,this.above);e&&this.observeIntersection();let A=e||i.geometryChanged,t=i.state.facet(E9);if(t.position!=this.position&&!this.madeAbsolute){this.position=t.position;for(let n of this.manager.tooltipViews)n.dom.style.position=this.position;A=!0}if(t.parent!=this.parent){this.parent&&this.container.remove(),this.parent=t.parent,this.createContainer();for(let n of this.manager.tooltipViews)this.container.appendChild(n.dom);A=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);A&&this.maybeMeasure()}createTooltip(i,e){let A=i.create(this.view),t=e?e.dom:null;if(A.dom.classList.add("cm-tooltip"),i.arrow&&!A.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let n=document.createElement("div");n.className="cm-tooltip-arrow",A.dom.appendChild(n)}return A.dom.style.position=this.position,A.dom.style.top=P6,A.dom.style.left="0px",this.container.insertBefore(A.dom,t),A.mount&&A.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(A.dom),A}destroy(){var i,e,A;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(i=t.destroy)===null||i===void 0||i.call(t);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(A=this.intersectionObserver)===null||A===void 0||A.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let i=1,e=1,A=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:o}=this.manager.tooltipViews[0];if(Ct.safari){let a=o.getBoundingClientRect();A=Math.abs(a.top+1e4)>1||Math.abs(a.left)>1}else A=!!o.offsetParent&&o.offsetParent!=this.container.ownerDocument.body}if(A||this.position=="absolute")if(this.parent){let o=this.parent.getBoundingClientRect();o.width&&o.height&&(i=o.width/this.parent.offsetWidth,e=o.height/this.parent.offsetHeight)}else({scaleX:i,scaleY:e}=this.view.viewState);let t=this.view.scrollDOM.getBoundingClientRect(),n=pS(this.view);return{visible:{left:t.left+n.left,top:t.top+n.top,right:t.right-n.right,bottom:t.bottom-n.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((o,a)=>{let r=this.manager.tooltipViews[a];return r.getCoords?r.getCoords(o.pos):this.view.coordsAtPos(o.pos)}),size:this.manager.tooltipViews.map(({dom:o})=>o.getBoundingClientRect()),space:this.view.state.facet(E9).tooltipSpace(this.view),scaleX:i,scaleY:e,makeAbsolute:A}}writeMeasure(i){var e;if(i.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let r of this.manager.tooltipViews)r.dom.style.position="absolute"}let{visible:A,space:t,scaleX:n,scaleY:o}=i,a=[];for(let r=0;r=Math.min(A.bottom,t.bottom)||C.rightMath.min(A.right,t.right)+.1)){g.style.top=P6;continue}let B=s.arrow?l.dom.querySelector(".cm-tooltip-arrow"):null,u=B?7:0,E=d.right-d.left,f=(e=MY.get(l))!==null&&e!==void 0?e:d.bottom-d.top,m=l.offset||x0A,v=this.view.textDirection==Lo.LTR,S=d.width>t.right-t.left?v?t.left:t.right-d.width:v?Math.max(t.left,Math.min(C.left-(B?14:0)+m.x,t.right-E)):Math.min(Math.max(t.left,C.left-E+(B?14:0)-m.x),t.right-E),k=this.above[r];!s.strictSide&&(k?C.top-f-u-m.yt.bottom)&&k==t.bottom-C.bottom>C.top-t.top&&(k=this.above[r]=!k);let M=(k?C.top-t.top:t.bottom-C.bottom)-u;if(MS&&z.topx&&(x=k?z.top-f-2-u:z.bottom+u+2);if(this.position=="absolute"?(g.style.top=(x-i.parent.top)/o+"px",SY(g,(S-i.parent.left)/n)):(g.style.top=x/o+"px",SY(g,S/n)),B){let z=C.left+(v?m.x:-m.x)-(S+14-7);B.style.left=z/n+"px"}l.overlap!==!0&&a.push({left:S,top:x,right:F,bottom:x+f}),g.classList.toggle("cm-tooltip-above",k),g.classList.toggle("cm-tooltip-below",!k),l.positioned&&l.positioned(i.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let i of this.manager.tooltipViews)i.dom.style.top=P6}},{eventObservers:{scroll(){this.maybeMeasure()}}});function SY(i,e){let A=parseInt(i.style.left,10);(isNaN(A)||Math.abs(e-A)>1)&&(i.style.left=e+"px")}var _0A=ui.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),x0A={x:0,y:0},ch=nt.define({enables:[mS,_0A]}),d8=nt.define({combine:i=>i.reduce((e,A)=>e.concat(A),[])}),I8=class i{static create(e){return new i(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new C8(e,d8,(A,t)=>this.createHostedView(A,t),A=>A.dom.remove())}createHostedView(e,A){let t=e.create(this.view);return t.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(t.dom,A?A.dom.nextSibling:this.dom.firstChild),this.mounted&&t.mount&&t.mount(this.view),t}mount(e){for(let A of this.manager.tooltipViews)A.mount&&A.mount(e);this.mounted=!0}positioned(e){for(let A of this.manager.tooltipViews)A.positioned&&A.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let A of this.manager.tooltipViews)(e=A.destroy)===null||e===void 0||e.call(A)}passProp(e){let A;for(let t of this.manager.tooltipViews){let n=t[e];if(n!==void 0){if(A===void 0)A=n;else if(A!==n)return}}return A}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}},R0A=ch.compute([d8],i=>{let e=i.facet(d8);return e.length===0?null:{pos:Math.min(...e.map(A=>A.pos)),end:Math.max(...e.map(A=>{var t;return(t=A.end)!==null&&t!==void 0?t:A.pos})),create:I8.create,above:e[0].above,arrow:e.some(A=>A.arrow)}}),gS=class{constructor(e,A,t,n,o){this.view=e,this.source=A,this.field=t,this.setHover=n,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;er.bottom||A.xr.right+e.defaultCharacterWidth)return;let s=e.bidiSpans(e.state.doc.lineAt(n)).find(g=>g.from<=n&&g.to>=n),l=s&&s.dir==Lo.RTL?-1:1;o=A.x{this.pending==r&&(this.pending=null,s&&!(Array.isArray(s)&&!s.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(s)?s:[s])}))},s=>Gr(e.state,s,"hover tooltip"))}else a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])})}get tooltip(){let e=this.view.plugin(mS),A=e?e.manager.tooltips.findIndex(t=>t.create==I8.create):-1;return A>-1?e.manager.tooltipViews[A]:null}mousemove(e){var A,t;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:n,tooltip:o}=this;if(n.length&&o&&!N0A(o.dom,e)||this.pending){let{pos:a}=n[0]||this.pending,r=(t=(A=n[0])===null||A===void 0?void 0:A.end)!==null&&t!==void 0?t:a;(a==r?this.view.posAtCoords(this.lastMove)!=a:!F0A(this.view,a,r,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:A}=this;if(A.length){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let A=t=>{e.removeEventListener("mouseleave",A),this.active.length&&!this.view.dom.contains(t.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",A)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}},j6=4;function N0A(i,e){let{left:A,right:t,top:n,bottom:o}=i.getBoundingClientRect(),a;if(a=i.querySelector(".cm-tooltip-arrow")){let r=a.getBoundingClientRect();n=Math.min(r.top,n),o=Math.max(r.bottom,o)}return e.clientX>=A-j6&&e.clientX<=t+j6&&e.clientY>=n-j6&&e.clientY<=o+j6}function F0A(i,e,A,t,n,o){let a=i.scrollDOM.getBoundingClientRect(),r=i.documentTop+i.documentPadding.top+i.contentHeight;if(a.left>t||a.rightn||Math.min(a.bottom,r)=e&&s<=A}function FH(i,e={}){let A=ln.define(),t=La.define({create(){return[]},update(n,o){if(n.length&&(e.hideOnChange&&(o.docChanged||o.selection)?n=[]:e.hideOn&&(n=n.filter(a=>!e.hideOn(o,a))),o.docChanged)){let a=[];for(let r of n){let s=o.changes.mapPos(r.pos,-1,Wr.TrackDel);if(s!=null){let l=Object.assign(Object.create(null),r);l.pos=s,l.end!=null&&(l.end=o.changes.mapPos(l.end)),a.push(l)}}n=a}for(let a of o.effects)a.is(A)&&(n=a.value),a.is(L0A)&&(n=[]);return n},provide:n=>d8.from(n)});return{active:t,extension:[t,Po.define(n=>new gS(n,i,t,A,e.hoverTime||300)),R0A]}}function wS(i,e){let A=i.plugin(mS);if(!A)return null;let t=A.manager.tooltips.indexOf(e);return t<0?null:A.manager.tooltipViews[t]}var L0A=ln.define();var kY=nt.define({combine(i){let e,A;for(let t of i)e=e||t.topContainer,A=A||t.bottomContainer;return{topContainer:e,bottomContainer:A}}});function d4(i,e){let A=i.plugin(LH),t=A?A.specs.indexOf(e):-1;return t>-1?A.panels[t]:null}var LH=Po.fromClass(class{constructor(i){this.input=i.state.facet(vd),this.specs=this.input.filter(A=>A),this.panels=this.specs.map(A=>A(i));let e=i.state.facet(kY);this.top=new Ah(i,!0,e.topContainer),this.bottom=new Ah(i,!1,e.bottomContainer),this.top.sync(this.panels.filter(A=>A.top)),this.bottom.sync(this.panels.filter(A=>!A.top));for(let A of this.panels)A.dom.classList.add("cm-panel"),A.mount&&A.mount()}update(i){let e=i.state.facet(kY);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Ah(i.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Ah(i.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let A=i.state.facet(vd);if(A!=this.input){let t=A.filter(s=>s),n=[],o=[],a=[],r=[];for(let s of t){let l=this.specs.indexOf(s),g;l<0?(g=s(i.view),r.push(g)):(g=this.panels[l],g.update&&g.update(i)),n.push(g),(g.top?o:a).push(g)}this.specs=t,this.panels=n,this.top.sync(o),this.bottom.sync(a);for(let s of r)s.dom.classList.add("cm-panel"),s.mount&&s.mount()}else for(let t of this.panels)t.update&&t.update(i)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:i=>ui.scrollMargins.of(e=>{let A=e.plugin(i);return A&&{top:A.top.scrollMargin(),bottom:A.bottom.scrollMargin()}})}),Ah=class{constructor(e,A,t){this.view=e,this.top=A,this.container=t,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let A of this.panels)A.destroy&&e.indexOf(A)<0&&A.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let A=this.container||this.view.dom;A.insertBefore(this.dom,this.top?A.firstChild:null)}let e=this.dom.firstChild;for(let A of this.panels)if(A.dom.parentNode==this.dom){for(;e!=A.dom;)e=_Y(e);e=e.nextSibling}else this.dom.insertBefore(A.dom,e);for(;e;)e=_Y(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}};function _Y(i){let e=i.nextSibling;return i.remove(),e}var vd=nt.define({enables:LH});function GH(i,e){let A,t=new Promise(a=>A=a),n=a=>G0A(a,e,A);i.state.field(Q9,!1)?i.dispatch({effects:KH.of(n)}):i.dispatch({effects:ln.appendConfig.of(Q9.init(()=>[n]))});let o=UH.of(n);return{close:o,result:t.then(a=>((i.win.queueMicrotask||(s=>i.win.setTimeout(s,10)))(()=>{i.state.field(Q9).indexOf(n)>-1&&i.dispatch({effects:o})}),a))}}var Q9=La.define({create(){return[]},update(i,e){for(let A of e.effects)A.is(KH)?i=[A.value].concat(i):A.is(UH)&&(i=i.filter(t=>t!=A.value));return i},provide:i=>vd.computeN([i],e=>e.field(i))}),KH=ln.define(),UH=ln.define();function G0A(i,e,A){let t=e.content?e.content(i,()=>a(null)):null;if(!t){if(t=po("form"),e.input){let r=po("input",e.input);/^(text|password|number|email|tel|url)$/.test(r.type)&&r.classList.add("cm-textfield"),r.name||(r.name="input"),t.appendChild(po("label",(e.label||"")+": ",r))}else t.appendChild(document.createTextNode(e.label||""));t.appendChild(document.createTextNode(" ")),t.appendChild(po("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let n=t.nodeName=="FORM"?[t]:t.querySelectorAll("form");for(let r=0;r{l.keyCode==27?(l.preventDefault(),a(null)):l.keyCode==13&&(l.preventDefault(),a(s))}),s.addEventListener("submit",l=>{l.preventDefault(),a(s)})}let o=po("div",t,po("button",{onclick:()=>a(null),"aria-label":i.state.phrase("close"),class:"cm-dialog-close",type:"button"},["\xD7"]));e.class&&(o.className=e.class),o.classList.add("cm-dialog");function a(r){o.contains(o.ownerDocument.activeElement)&&i.focus(),A(r)}return{dom:o,top:e.top,mount:()=>{if(e.focus){let r;typeof e.focus=="string"?r=t.querySelector(e.focus):r=t.querySelector("input")||t.querySelector("button"),r&&"select"in r?r.select():r&&"focus"in r&&r.focus()}}}}var Cl=class extends cg{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};Cl.prototype.elementClass="";Cl.prototype.toDOM=void 0;Cl.prototype.mapMode=Wr.TrackBefore;Cl.prototype.startSide=Cl.prototype.endSide=-1;Cl.prototype.point=!0;var X6=nt.define(),K0A=nt.define(),U0A={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>uo.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},a4=nt.define();function p8(i){return[TH(),a4.of(P(P({},U0A),i))]}var cS=nt.define({combine:i=>i.some(e=>e)});function TH(i){let e=[T0A];return i&&i.fixed===!1&&e.push(cS.of(!0)),e}var T0A=Po.fromClass(class{constructor(i){this.view=i,this.domAfter=null,this.prevViewport=i.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=i.state.facet(a4).map(e=>new B8(i,e)),this.fixed=!i.state.facet(cS);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),i.scrollDOM.insertBefore(this.dom,i.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(i){if(this.updateGutters(i)){let e=this.prevViewport,A=i.view.viewport,t=Math.min(e.to,A.to)-Math.max(e.from,A.from);this.syncGutters(t<(A.to-A.from)*.8)}if(i.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(cS)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=i.view.viewport}syncGutters(i){let e=this.dom.nextSibling;i&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let A=uo.iter(this.view.state.facet(X6),this.view.viewport.from),t=[],n=this.gutters.map(o=>new dS(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(t.length&&(t=[]),Array.isArray(o.type)){let a=!0;for(let r of o.type)if(r.type==As.Text&&a){CS(A,t,r.from);for(let s of n)s.line(this.view,r,t);a=!1}else if(r.widget)for(let s of n)s.widget(this.view,r)}else if(o.type==As.Text){CS(A,t,o.from);for(let a of n)a.line(this.view,o,t)}else if(o.widget)for(let a of n)a.widget(this.view,o);for(let o of n)o.finish();i&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(i){let e=i.startState.facet(a4),A=i.state.facet(a4),t=i.docChanged||i.heightChanged||i.viewportChanged||!uo.eq(i.startState.facet(X6),i.state.facet(X6),i.view.viewport.from,i.view.viewport.to);if(e==A)for(let n of this.gutters)n.update(i)&&(t=!0);else{t=!0;let n=[];for(let o of A){let a=e.indexOf(o);a<0?n.push(new B8(this.view,o)):(this.gutters[a].update(i),n.push(this.gutters[a]))}for(let o of this.gutters)o.dom.remove(),n.indexOf(o)<0&&o.destroy();for(let o of n)o.config.side=="after"?this.getDOMAfter().appendChild(o.dom):this.dom.appendChild(o.dom);this.gutters=n}return t}destroy(){for(let i of this.gutters)i.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:i=>ui.scrollMargins.of(e=>{let A=e.plugin(i);if(!A||A.gutters.length==0||!A.fixed)return null;let t=A.dom.offsetWidth*e.scaleX,n=A.domAfter?A.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Lo.LTR?{left:t,right:n}:{right:t,left:n}})});function xY(i){return Array.isArray(i)?i:[i]}function CS(i,e,A){for(;i.value&&i.from<=A;)i.from==A&&e.push(i.value),i.next()}var dS=class{constructor(e,A,t){this.gutter=e,this.height=t,this.i=0,this.cursor=uo.iter(e.markers,A.from)}addElement(e,A,t){let{gutter:n}=this,o=(A.top-this.height)/e.scaleY,a=A.height/e.scaleY;if(this.i==n.elements.length){let r=new h8(e,a,o,t);n.elements.push(r),n.dom.appendChild(r.dom)}else n.elements[this.i].update(e,a,o,t);this.height=A.bottom,this.i++}line(e,A,t){let n=[];CS(this.cursor,n,A.from),t.length&&(n=n.concat(t));let o=this.gutter.config.lineMarker(e,A,n);o&&n.unshift(o);let a=this.gutter;n.length==0&&!a.config.renderEmptyElements||this.addElement(e,A,n)}widget(e,A){let t=this.gutter.config.widgetMarker(e,A.widget,A),n=t?[t]:null;for(let o of e.state.facet(K0A)){let a=o(e,A.widget,A);a&&(n||(n=[])).push(a)}n&&this.addElement(e,A,n)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let A=e.elements.pop();e.dom.removeChild(A.dom),A.destroy()}}},B8=class{constructor(e,A){this.view=e,this.config=A,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let t in A.domEventHandlers)this.dom.addEventListener(t,n=>{let o=n.target,a;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let s=o.getBoundingClientRect();a=(s.top+s.bottom)/2}else a=n.clientY;let r=e.lineBlockAtHeight(a-e.documentTop);A.domEventHandlers[t](e,r,n)&&n.preventDefault()});this.markers=xY(A.markers(e)),A.initialSpacer&&(this.spacer=new h8(e,0,0,[A.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let A=this.markers;if(this.markers=xY(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let n=this.config.updateSpacer(this.spacer.markers[0],e);n!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[n])}let t=e.view.viewport;return!uo.eq(this.markers,A,t.from,t.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},h8=class{constructor(e,A,t,n){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,A,t,n)}update(e,A,t,n){this.height!=A&&(this.height=A,this.dom.style.height=A+"px"),this.above!=t&&(this.dom.style.marginTop=(this.above=t)?t+"px":""),O0A(this.markers,n)||this.setMarkers(e,n)}setMarkers(e,A){let t="cm-gutterElement",n=this.dom.firstChild;for(let o=0,a=0;;){let r=a,s=oo(r,s,l)||a(r,s,l):a}return t}})}}),r4=class extends Cl{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function u9(i,e){return i.state.facet(eh).formatNumber(e,i.state)}var H0A=a4.compute([eh],i=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(J0A)},lineMarker(e,A,t){return t.some(n=>n.toDOM)?null:new r4(u9(e,e.state.doc.lineAt(A.from).number))},widgetMarker:(e,A,t)=>{for(let n of e.state.facet(Y0A)){let o=n(e,A,t);if(o)return o}return null},lineMarkerChange:e=>e.startState.facet(eh)!=e.state.facet(eh),initialSpacer(e){return new r4(u9(e,RY(e.state.doc.lines)))},updateSpacer(e,A){let t=u9(A.view,RY(A.view.state.doc.lines));return t==e.number?e:new r4(t)},domEventHandlers:i.facet(eh).domEventHandlers,side:"before"}));function OH(i={}){return[eh.of(i),TH(),H0A]}function RY(i){let e=9;for(;e{let e=[],A=-1;for(let t of i.selection.ranges){let n=i.doc.lineAt(t.head).from;n>A&&(A=n,e.push(z0A.range(n)))}return uo.of(e)});function JH(){return P0A}var j0A=0,I4=class{constructor(e,A){this.from=e,this.to=A}},Hi=class{constructor(e={}){this.id=j0A++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=ys.match(e)),A=>{let t=e(A);return t===void 0?null:[this,t]}}};Hi.closedBy=new Hi({deserialize:i=>i.split(" ")});Hi.openedBy=new Hi({deserialize:i=>i.split(" ")});Hi.group=new Hi({deserialize:i=>i.split(" ")});Hi.isolate=new Hi({deserialize:i=>{if(i&&i!="rtl"&&i!="ltr"&&i!="auto")throw new RangeError("Invalid value for isolate: "+i);return i||"auto"}});Hi.contextHash=new Hi({perNode:!0});Hi.lookAhead=new Hi({perNode:!0});Hi.mounted=new Hi({perNode:!0});var bd=class{constructor(e,A,t,n=!1){this.tree=e,this.overlay=A,this.parser=t,this.bracketed=n}static get(e){return e&&e.props&&e.props[Hi.mounted.id]}},V0A=Object.create(null),ys=class i{constructor(e,A,t,n=0){this.name=e,this.props=A,this.id=t,this.flags=n}static define(e){let A=e.props&&e.props.length?Object.create(null):V0A,t=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),n=new i(e.name||"",A,e.id,t);if(e.props){for(let o of e.props)if(Array.isArray(o)||(o=o(n)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");A[o[0].id]=o[1]}}return n}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let A=this.prop(Hi.group);return A?A.indexOf(e)>-1:!1}return this.id==e}static match(e){let A=Object.create(null);for(let t in e)for(let n of t.split(" "))A[n]=e[t];return t=>{for(let n=t.prop(Hi.group),o=-1;o<(n?n.length:0);o++){let a=A[o<0?t.name:n[o]];if(a)return a}}}};ys.none=new ys("",Object.create(null),0,8);var B4=class i{constructor(e){this.types=e;for(let A=0;A0;for(let s=this.cursor(a|Ga.IncludeAnonymous);;){let l=!1;if(s.from<=o&&s.to>=n&&(!r&&s.type.isAnonymous||A(s)!==!1)){if(s.firstChild())continue;l=!0}for(;l&&t&&(r||!s.type.isAnonymous)&&t(s),!s.nextSibling();){if(!s.parent())return;l=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let A in this.props)e.push([+A,this.props[A]]);return e}balance(e={}){return this.children.length<=8?this:kS(ys.none,this.children,this.positions,0,this.children.length,0,this.length,(A,t,n)=>new i(this.type,A,t,n,this.propValues),e.makeTree||((A,t,n)=>new i(ys.none,A,t,n)))}static build(e){return W0A(e)}};Pa.empty=new Pa(ys.none,[],[],0);var yS=class i{constructor(e,A){this.buffer=e,this.index=A}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new i(this.buffer,this.index)}},k2=class i{constructor(e,A,t){this.buffer=e,this.length=A,this.set=t}get type(){return ys.none}toString(){let e=[];for(let A=0;A0));s=a[s+3]);return r}slice(e,A,t){let n=this.buffer,o=new Uint16Array(A-e),a=0;for(let r=e,s=0;r=e&&Ae;case 1:return A<=e&&t>e;case 2:return t>e;case 4:return!0}}function h4(i,e,A,t){for(var n;i.from==i.to||(A<1?i.from>=e:i.from>e)||(A>-1?i.to<=e:i.to0?r.length:-1;e!=l;e+=A){let g=r[e],C=s[e]+a.from,d;if(!(!(o&Ga.EnterBracketed&&g instanceof Pa&&(d=bd.get(g))&&!d.overlay&&d.bracketed&&t>=C&&t<=C+g.length)&&!PH(n,t,C,C+g.length))){if(g instanceof k2){if(o&Ga.ExcludeBuffers)continue;let B=g.findChild(0,g.buffer.length,A,t-C,n);if(B>-1)return new E4(new vS(a,g,e,C),null,B)}else if(o&Ga.IncludeAnonymous||!g.type.isAnonymous||SS(g)){let B;if(!(o&Ga.IgnoreMounts)&&(B=bd.get(g))&&!B.overlay)return new i(B.tree,C,e,a);let u=new i(g,C,e,a);return o&Ga.IncludeAnonymous||!u.type.isAnonymous?u:u.nextChild(A<0?g.children.length-1:0,A,t,n,o)}}}if(o&Ga.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?e=a.index+A:e=A<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,A,t=0){let n;if(!(t&Ga.IgnoreOverlays)&&(n=bd.get(this._tree))&&n.overlay){let o=e-this.from,a=t&Ga.EnterBracketed&&n.bracketed;for(let{from:r,to:s}of n.overlay)if((A>0||a?r<=o:r=o:s>o))return new i(n.tree,n.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,A,t)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function HH(i,e,A,t){let n=i.cursor(),o=[];if(!n.firstChild())return o;if(A!=null){for(let a=!1;!a;)if(a=n.type.is(A),!n.nextSibling())return o}for(;;){if(t!=null&&n.type.is(t))return o;if(n.type.is(e)&&o.push(n.node),!n.nextSibling())return t==null?o:[]}}function DS(i,e,A=e.length-1){for(let t=i;A>=0;t=t.parent){if(!t)return!1;if(!t.type.isAnonymous){if(e[A]&&e[A]!=t.name)return!1;A--}}return!0}var vS=class{constructor(e,A,t,n){this.parent=e,this.buffer=A,this.index=t,this.start=n}},E4=class i extends w8{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,A,t){super(),this.context=e,this._parent=A,this.index=t,this.type=e.buffer.set.types[e.buffer.buffer[t]]}child(e,A,t){let{buffer:n}=this.context,o=n.findChild(this.index+4,n.buffer[this.index+3],e,A-this.context.start,t);return o<0?null:new i(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,A,t=0){if(t&Ga.ExcludeBuffers)return null;let{buffer:n}=this.context,o=n.findChild(this.index+4,n.buffer[this.index+3],A>0?1:-1,e-this.context.start,A);return o<0?null:new i(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,A=e.buffer[this.index+3];return A<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new i(this.context,this._parent,A):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,A=this._parent?this._parent.index+4:0;return this.index==A?this.externalSibling(-1):new i(this.context,this._parent,e.findChild(A,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],A=[],{buffer:t}=this.context,n=this.index+4,o=t.buffer[this.index+3];if(o>n){let a=t.buffer[this.index+1];e.push(t.slice(n,o,a)),A.push(0)}return new Pa(this.type,e,A,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function jH(i){if(!i.length)return null;let e=0,A=i[0];for(let o=1;oA.from||a.to=e){let r=new d0(a.tree,a.overlay[0].from+o.from,-1,o);(n||(n=[t])).push(h4(r,e,A,!1))}}return n?jH(n):t}var Q4=class{get name(){return this.type.name}constructor(e,A=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=A&~Ga.EnterBracketed,e instanceof d0)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,A){this.index=e;let{start:t,buffer:n}=this.buffer;return this.type=A||n.set.types[n.buffer[e]],this.from=t+n.buffer[e+1],this.to=t+n.buffer[e+2],!0}yield(e){return e?e instanceof d0?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,A,t){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,A,t,this.mode));let{buffer:n}=this.buffer,o=n.findChild(this.index+4,n.buffer[this.index+3],e,A-this.buffer.start,t);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,A,t=this.mode){return this.buffer?t&Ga.ExcludeBuffers?!1:this.enterChild(1,e,A):this.yield(this._tree.enter(e,A,t))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ga.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Ga.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:A}=this.buffer,t=this.stack.length-1;if(e<0){let n=t<0?0:this.stack[t]+4;if(this.index!=n)return this.yieldBuf(A.findChild(n,this.index,-1,0,4))}else{let n=A.buffer[this.index+3];if(n<(t<0?A.buffer.length:A.buffer[this.stack[t]+3]))return this.yieldBuf(n)}return t<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let A,t,{buffer:n}=this;if(n){if(e>0){if(this.index-1)for(let o=A+e,a=e<0?-1:t._tree.children.length;o!=a;o+=e){let r=t._tree.children[o];if(this.mode&Ga.IncludeAnonymous||r instanceof k2||!r.type.isAnonymous||SS(r))return!1}return!0}move(e,A){if(A&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,A=0){for(;(this.from==this.to||(A<1?this.from>=e:this.from>e)||(A>-1?this.to<=e:this.to=0;){for(let a=e;a;a=a._parent)if(a.index==n){if(n==this.index)return a;A=a,t=o+1;break A}n=this.stack[--o]}for(let n=t;n=0;o--){if(o<0)return DS(this._tree,e,n);let a=t[A.buffer[this.stack[o]]];if(!a.isAnonymous){if(e[n]&&e[n]!=a.name)return!1;n--}}return!0}};function SS(i){return i.children.some(e=>e instanceof k2||!e.type.isAnonymous||SS(e))}function W0A(i){var e;let{buffer:A,nodeSet:t,maxBufferLength:n=1024,reused:o=[],minRepeatType:a=t.types.length}=i,r=Array.isArray(A)?new yS(A,A.length):A,s=t.types,l=0,g=0;function C(M,x,F,z,j,X){let{id:eA,start:Z,end:CA,size:wA}=r,BA=g,QA=l;if(wA<0)if(r.next(),wA==-1){let qA=o[eA];F.push(qA),z.push(Z-M);return}else if(wA==-3){l=eA;return}else if(wA==-4){g=eA;return}else throw new RangeError(`Unrecognized record size: ${wA}`);let RA=s[eA],dA,IA,xA=Z-M;if(CA-Z<=n&&(IA=f(r.pos-x,j))){let qA=new Uint16Array(IA.size-IA.skip),ue=r.pos-IA.size,HA=qA.length;for(;r.pos>ue;)HA=m(IA.start,qA,HA);dA=new k2(qA,CA-IA.start,t),xA=IA.start-M}else{let qA=r.pos-wA;r.next();let ue=[],HA=[],bA=eA>=a?eA:-1,PA=0,it=CA;for(;r.pos>qA;)bA>=0&&r.id==bA&&r.size>=0?(r.end<=it-n&&(u(ue,HA,Z,PA,r.end,it,bA,BA,QA),PA=ue.length,it=r.end),r.next()):X>2500?d(Z,qA,ue,HA):C(Z,qA,ue,HA,bA,X+1);if(bA>=0&&PA>0&&PA-1&&PA>0){let Xe=B(RA,QA);dA=kS(RA,ue,HA,0,ue.length,0,CA-Z,Xe,Xe)}else dA=E(RA,ue,HA,CA-Z,BA-CA,QA)}F.push(dA),z.push(xA)}function d(M,x,F,z){let j=[],X=0,eA=-1;for(;r.pos>x;){let{id:Z,start:CA,end:wA,size:BA}=r;if(BA>4)r.next();else{if(eA>-1&&CA=0;wA-=3)Z[BA++]=j[wA],Z[BA++]=j[wA+1]-CA,Z[BA++]=j[wA+2]-CA,Z[BA++]=BA;F.push(new k2(Z,j[2]-CA,t)),z.push(CA-M)}}function B(M,x){return(F,z,j)=>{let X=0,eA=F.length-1,Z,CA;if(eA>=0&&(Z=F[eA])instanceof Pa){if(!eA&&Z.type==M&&Z.length==j)return Z;(CA=Z.prop(Hi.lookAhead))&&(X=z[eA]+Z.length+CA)}return E(M,F,z,j,X,x)}}function u(M,x,F,z,j,X,eA,Z,CA){let wA=[],BA=[];for(;M.length>z;)wA.push(M.pop()),BA.push(x.pop()+F-j);M.push(E(t.types[eA],wA,BA,X-j,Z-X,CA)),x.push(j-F)}function E(M,x,F,z,j,X,eA){if(X){let Z=[Hi.contextHash,X];eA=eA?[Z].concat(eA):[Z]}if(j>25){let Z=[Hi.lookAhead,j];eA=eA?[Z].concat(eA):[Z]}return new Pa(M,x,F,z,eA)}function f(M,x){let F=r.fork(),z=0,j=0,X=0,eA=F.end-n,Z={size:0,start:0,skip:0};A:for(let CA=F.pos-M;F.pos>CA;){let wA=F.size;if(F.id==x&&wA>=0){Z.size=z,Z.start=j,Z.skip=X,X+=4,z+=4,F.next();continue}let BA=F.pos-wA;if(wA<0||BA=a?4:0,RA=F.start;for(F.next();F.pos>BA;){if(F.size<0)if(F.size==-3||F.size==-4)QA+=4;else break A;else F.id>=a&&(QA+=4);F.next()}j=RA,z+=wA,X+=QA}return(x<0||z==M)&&(Z.size=z,Z.start=j,Z.skip=X),Z.size>4?Z:void 0}function m(M,x,F){let{id:z,start:j,end:X,size:eA}=r;if(r.next(),eA>=0&&z4){let CA=r.pos-(eA-4);for(;r.pos>CA;)F=m(M,x,F)}x[--F]=Z,x[--F]=X-M,x[--F]=j-M,x[--F]=z}else eA==-3?l=z:eA==-4&&(g=z);return F}let v=[],S=[];for(;r.pos>0;)C(i.start||0,i.bufferStart||0,v,S,-1,0);let k=(e=i.length)!==null&&e!==void 0?e:v.length?S[0]+v[0].length:0;return new Pa(s[i.topID],v.reverse(),S.reverse(),k)}var zH=new WeakMap;function m8(i,e){if(!i.isAnonymous||e instanceof k2||e.type!=i)return 1;let A=zH.get(e);if(A==null){A=1;for(let t of e.children){if(t.type!=i||!(t instanceof Pa)){A=1;break}A+=m8(i,t)}zH.set(e,A)}return A}function kS(i,e,A,t,n,o,a,r,s){let l=0;for(let u=t;u=g)break;x+=F}if(S==k+1){if(x>g){let F=u[k];B(F.children,F.positions,0,F.children.length,E[k]+v);continue}C.push(u[k])}else{let F=E[S-1]+u[S-1].length-M;C.push(kS(i,u,E,k,S,M,F,null,s))}d.push(M+v-o)}}return B(e,A,t,n,0),(r||s)(C,d,a)}var Md=class i{constructor(e,A,t,n,o=!1,a=!1){this.from=e,this.to=A,this.tree=t,this.offset=n,this.open=(o?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,A=[],t=!1){let n=[new i(0,e.length,e,0,!1,t)];for(let o of A)o.to>e.length&&n.push(o);return n}static applyChanges(e,A,t=128){if(!A.length)return e;let n=[],o=1,a=e.length?e[0]:null;for(let r=0,s=0,l=0;;r++){let g=r=t)for(;a&&a.from=d.from||C<=d.to||l){let B=Math.max(d.from,s)-l,u=Math.min(d.to,C)-l;d=B>=u?null:new i(B,u,d.tree,d.offset+l,r>0,!!g)}if(d&&n.push(d),a.to>C)break;a=onew I4(n.from,n.to)):[new I4(0,0)]:[new I4(0,e.length)],this.createParse(e,A||[],t)}parse(e,A,t){let n=this.startParse(e,A,t);for(;;){let o=n.advance();if(o)return o}}},MS=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,A){return this.string.slice(e,A)}};var VAe=new Hi({perNode:!0});var Z0A=0,lc=class i{constructor(e,A,t,n){this.name=e,this.set=A,this.base=t,this.modified=n,this.id=Z0A++}toString(){let{name:e}=this;for(let A of this.modified)A.name&&(e=`${A.name}(${e})`);return e}static define(e,A){let t=typeof e=="string"?e:"?";if(e instanceof i&&(A=e),A?.base)throw new Error("Can not derive from a modified tag");let n=new i(t,[],null,[]);if(n.set.push(n),A)for(let o of A.set)n.set.push(o);return n}static defineModifier(e){let A=new b8(e);return t=>t.modified.indexOf(A)>-1?t:b8.get(t.base||t,t.modified.concat(A).sort((n,o)=>n.id-o.id))}},X0A=0,b8=class i{constructor(e){this.name=e,this.instances=[],this.id=X0A++}static get(e,A){if(!A.length)return e;let t=A[0].instances.find(r=>r.base==e&&$0A(A,r.modified));if(t)return t;let n=[],o=new lc(e.name,n,e,A);for(let r of A)r.instances.push(o);let a=ACA(A);for(let r of e.set)if(!r.modified.length)for(let s of a)n.push(i.get(r,s));return o}};function $0A(i,e){return i.length==e.length&&i.every((A,t)=>A==e[t])}function ACA(i){let e=[[]];for(let A=0;At.length-A.length)}function M8(i){let e=Object.create(null);for(let A in i){let t=i[A];Array.isArray(t)||(t=[t]);for(let n of A.split(" "))if(n){let o=[],a=2,r=n;for(let C=0;;){if(r=="..."&&C>0&&C+3==n.length){a=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(r);if(!d)throw new RangeError("Invalid path: "+n);if(o.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),C+=d[0].length,C==n.length)break;let B=n[C++];if(C==n.length&&B=="!"){a=0;break}if(B!="/")throw new RangeError("Invalid path: "+n);r=n.slice(C)}let s=o.length-1,l=o[s];if(!l)throw new RangeError("Invalid path: "+n);let g=new kd(t,a,s>0?o.slice(0,s):null);e[l]=g.sort(e[l])}}return WH.add(e)}var WH=new Hi({combine(i,e){let A,t,n;for(;i||e;){if(!i||e&&i.depth>=e.depth?(n=e,e=e.next):(n=i,i=i.next),A&&A.mode==n.mode&&!n.context&&!A.context)continue;let o=new kd(n.tags,n.mode,n.context);A?A.next=o:t=o,A=o}return t}}),kd=class{constructor(e,A,t,n){this.tags=e,this.mode=A,this.context=t,this.next=n}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let a=n;for(let r of o)for(let s of r.set){let l=A[s.id];if(l){a=a?a+" "+l:l;break}}return a},scope:t}}function eCA(i,e){let A=null;for(let t of i){let n=t.style(e);n&&(A=A?A+" "+n:n)}return A}function ZH(i,e,A,t=0,n=i.length){let o=new xS(t,Array.isArray(e)?e:[e],A);o.highlightRange(i.cursor(),t,n,"",o.highlighters),o.flush(n)}var xS=class{constructor(e,A,t){this.at=e,this.highlighters=A,this.span=t,this.class=""}startSpan(e,A){A!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=A)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,A,t,n,o){let{type:a,from:r,to:s}=e;if(r>=t||s<=A)return;a.isTop&&(o=this.highlighters.filter(B=>!B.scope||B.scope(a)));let l=n,g=tCA(e)||kd.empty,C=eCA(o,g.tags);if(C&&(l&&(l+=" "),l+=C,g.mode==1&&(n+=(n?" ":"")+C)),this.startSpan(Math.max(A,r),l),g.opaque)return;let d=e.tree&&e.tree.prop(Hi.mounted);if(d&&d.overlay){let B=e.node.enter(d.overlay[0].from+r,1),u=this.highlighters.filter(f=>!f.scope||f.scope(d.tree.type)),E=e.firstChild();for(let f=0,m=r;;f++){let v=f=S||!e.nextSibling())););if(!v||S>t)break;m=v.to+r,m>A&&(this.highlightRange(B.cursor(),Math.max(A,v.from+r),Math.min(t,m),"",u),this.startSpan(Math.min(t,m),l))}E&&e.parent()}else if(e.firstChild()){d&&(n="");do if(!(e.to<=A)){if(e.from>=t)break;this.highlightRange(e,A,t,n,o),this.startSpan(Math.min(t,e.to),l)}while(e.nextSibling());e.parent()}}};function tCA(i){let e=i.type.prop(WH);for(;e&&e.context&&!i.matchContext(e.context);)e=e.next;return e||null}var tt=lc.define,y8=tt(),_2=tt(),VH=tt(_2),qH=tt(_2),x2=tt(),D8=tt(x2),_S=tt(x2),h0=tt(),Sd=tt(h0),I0=tt(),B0=tt(),RS=tt(),u4=tt(RS),v8=tt(),Oe={comment:y8,lineComment:tt(y8),blockComment:tt(y8),docComment:tt(y8),name:_2,variableName:tt(_2),typeName:VH,tagName:tt(VH),propertyName:qH,attributeName:tt(qH),className:tt(_2),labelName:tt(_2),namespace:tt(_2),macroName:tt(_2),literal:x2,string:D8,docString:tt(D8),character:tt(D8),attributeValue:tt(D8),number:_S,integer:tt(_S),float:tt(_S),bool:tt(x2),regexp:tt(x2),escape:tt(x2),color:tt(x2),url:tt(x2),keyword:I0,self:tt(I0),null:tt(I0),atom:tt(I0),unit:tt(I0),modifier:tt(I0),operatorKeyword:tt(I0),controlKeyword:tt(I0),definitionKeyword:tt(I0),moduleKeyword:tt(I0),operator:B0,derefOperator:tt(B0),arithmeticOperator:tt(B0),logicOperator:tt(B0),bitwiseOperator:tt(B0),compareOperator:tt(B0),updateOperator:tt(B0),definitionOperator:tt(B0),typeOperator:tt(B0),controlOperator:tt(B0),punctuation:RS,separator:tt(RS),bracket:u4,angleBracket:tt(u4),squareBracket:tt(u4),paren:tt(u4),brace:tt(u4),content:h0,heading:Sd,heading1:tt(Sd),heading2:tt(Sd),heading3:tt(Sd),heading4:tt(Sd),heading5:tt(Sd),heading6:tt(Sd),contentSeparator:tt(h0),list:tt(h0),quote:tt(h0),emphasis:tt(h0),strong:tt(h0),link:tt(h0),monospace:tt(h0),strikethrough:tt(h0),inserted:tt(),deleted:tt(),changed:tt(),invalid:tt(),meta:v8,documentMeta:tt(v8),annotation:tt(v8),processingInstruction:tt(v8),definition:lc.defineModifier("definition"),constant:lc.defineModifier("constant"),function:lc.defineModifier("function"),standard:lc.defineModifier("standard"),local:lc.defineModifier("local"),special:lc.defineModifier("special")};for(let i in Oe){let e=Oe[i];e instanceof lc&&(e.name=i)}var ZAe=NS([{tag:Oe.link,class:"tok-link"},{tag:Oe.heading,class:"tok-heading"},{tag:Oe.emphasis,class:"tok-emphasis"},{tag:Oe.strong,class:"tok-strong"},{tag:Oe.keyword,class:"tok-keyword"},{tag:Oe.atom,class:"tok-atom"},{tag:Oe.bool,class:"tok-bool"},{tag:Oe.url,class:"tok-url"},{tag:Oe.labelName,class:"tok-labelName"},{tag:Oe.inserted,class:"tok-inserted"},{tag:Oe.deleted,class:"tok-deleted"},{tag:Oe.literal,class:"tok-literal"},{tag:Oe.string,class:"tok-string"},{tag:Oe.number,class:"tok-number"},{tag:[Oe.regexp,Oe.escape,Oe.special(Oe.string)],class:"tok-string2"},{tag:Oe.variableName,class:"tok-variableName"},{tag:Oe.local(Oe.variableName),class:"tok-variableName tok-local"},{tag:Oe.definition(Oe.variableName),class:"tok-variableName tok-definition"},{tag:Oe.special(Oe.variableName),class:"tok-variableName2"},{tag:Oe.definition(Oe.propertyName),class:"tok-propertyName tok-definition"},{tag:Oe.typeName,class:"tok-typeName"},{tag:Oe.namespace,class:"tok-namespace"},{tag:Oe.className,class:"tok-className"},{tag:Oe.macroName,class:"tok-macroName"},{tag:Oe.propertyName,class:"tok-propertyName"},{tag:Oe.operator,class:"tok-operator"},{tag:Oe.comment,class:"tok-comment"},{tag:Oe.meta,class:"tok-meta"},{tag:Oe.invalid,class:"tok-invalid"},{tag:Oe.punctuation,class:"tok-punctuation"}]);var FS,dh=new Hi;function iCA(i){return nt.define({combine:i?e=>e.concat(i):void 0})}var nCA=new Hi,gc=(()=>{class i{constructor(A,t,n=[],o=""){this.data=A,this.name=o,ir.prototype.hasOwnProperty("tree")||Object.defineProperty(ir.prototype,"tree",{get(){return Kr(this)}}),this.parser=t,this.extension=[R2.of(this),ir.languageData.of((a,r,s)=>{let l=XH(a,r,s),g=l.type.prop(dh);if(!g)return[];let C=a.facet(g),d=l.type.prop(nCA);if(d){let B=l.resolve(r-l.from,s);for(let u of d)if(u.test(B,a)){let E=a.facet(u.facet);return u.type=="replace"?E:E.concat(C)}}return C})].concat(n)}isActiveAt(A,t,n=-1){return XH(A,t,n).type.prop(dh)==this.data}findRegions(A){let t=A.facet(R2);if(t?.data==this.data)return[{from:0,to:A.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],o=(a,r)=>{if(a.prop(dh)==this.data){n.push({from:r,to:r+a.length});return}let s=a.prop(Hi.mounted);if(s){if(s.tree.prop(dh)==this.data){if(s.overlay)for(let l of s.overlay)n.push({from:l.from+r,to:l.to+r});else n.push({from:r,to:r+a.length});return}else if(s.overlay){let l=n.length;if(o(s.tree,s.overlay[0].from+r),n.length>l)return}}for(let l=0;lt.isTop?A:void 0)]}),e.name)}configure(e,A){return new i(this.data,this.parser.configure(e),A||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function Kr(i){let e=i.field(gc.state,!1);return e?e.tree:Pa.empty}function jS(i,e,A=50){var t;let n=(t=i.field(gc.state,!1))===null||t===void 0?void 0:t.context;if(!n)return null;let o=n.viewport;n.updateViewport({from:0,to:e});let a=n.isDone(e)||n.work(A,e)?n.tree:null;return n.updateViewport(o),a}var US=class{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,A){let t=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,A):this.string.slice(e-t,A-t)}},p4=null,TS=class i{constructor(e,A,t=[],n,o,a,r,s){this.parser=e,this.state=A,this.fragments=t,this.tree=n,this.treeLen=o,this.viewport=a,this.skipped=r,this.scheduleOn=s,this.parse=null,this.tempSkipped=[]}static create(e,A,t){return new i(e,A,[],Pa.empty,0,t,[],null)}startParse(){return this.parser.startParse(new US(this.state.doc),this.fragments)}work(e,A){return A!=null&&A>=this.state.doc.length&&(A=void 0),this.tree!=Pa.empty&&this.isDone(A??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var t;if(typeof e=="number"){let n=Date.now()+e;e=()=>Date.now()>n}for(this.parse||(this.parse=this.startParse()),A!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>A)&&A=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(A=this.parse.advance()););}),this.treeLen=e,this.tree=A,this.fragments=this.withoutTempSkipped(Md.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let A=p4;p4=this;try{return e()}finally{p4=A}}withoutTempSkipped(e){for(let A;A=this.tempSkipped.pop();)e=$H(e,A.from,A.to);return e}changes(e,A){let{fragments:t,tree:n,treeLen:o,viewport:a,skipped:r}=this;if(this.takeTree(),!e.empty){let s=[];if(e.iterChangedRanges((l,g,C,d)=>s.push({fromA:l,toA:g,fromB:C,toB:d})),t=Md.applyChanges(t,s),n=Pa.empty,o=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){r=[];for(let l of this.skipped){let g=e.mapPos(l.from,1),C=e.mapPos(l.to,-1);ge.from&&(this.fragments=$H(this.fragments,n,o),this.skipped.splice(t--,1))}return this.skipped.length>=A?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,A){this.skipped.push({from:e,to:A})}static getSkippingParser(e){return new class extends Ch{createParse(A,t,n){let o=n[0].from,a=n[n.length-1].to;return{parsedPos:o,advance(){let s=p4;if(s){for(let l of n)s.tempSkipped.push(l);e&&(s.scheduleOn=s.scheduleOn?Promise.all([s.scheduleOn,e]):e)}return this.parsedPos=a,new Pa(ys.none,[],[],a-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let A=this.fragments;return this.treeLen>=e&&A.length&&A[0].from==0&&A[0].to>=e}static get(){return p4}};function $H(i,e,A){return Md.applyChanges(i,[{fromA:e,toA:A,fromB:e,toB:A}])}var m4=class i{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let A=this.context.changes(e.changes,e.state),t=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),A.viewport.to);return A.work(20,t)||A.takeTree(),new i(A)}static init(e){let A=Math.min(3e3,e.doc.length),t=TS.create(e.facet(R2).parser,e,{from:0,to:A});return t.work(20,A)||t.takeTree(),new i(t)}};gc.state=La.define({create:m4.init,update(i,e){for(let A of e.effects)if(A.is(gc.setState))return A.value;return e.startState.facet(R2)!=e.state.facet(R2)?m4.init(e.state):i.apply(e)}});var az=i=>{let e=setTimeout(()=>i(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(az=i=>{let e=-1,A=setTimeout(()=>{e=requestIdleCallback(i,{timeout:400})},100);return()=>e<0?clearTimeout(A):cancelIdleCallback(e)});var LS=typeof navigator<"u"&&(!((FS=navigator.scheduling)===null||FS===void 0)&&FS.isInputPending)?()=>navigator.scheduling.isInputPending():null,oCA=Po.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let A=this.view.state.field(gc.state).context;(A.updateViewport(e.view.viewport)||this.view.viewport.to>A.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(A)}scheduleWork(){if(this.working)return;let{state:e}=this.view,A=e.field(gc.state);(A.tree!=A.context.tree||!A.context.isDone(e.doc.length))&&(this.working=az(this.work))}work(e){this.working=null;let A=Date.now();if(this.chunkEndn+1e3,s=o.context.work(()=>LS&&LS()||Date.now()>a,n+(r?0:1e5));this.chunkBudget-=Date.now()-A,(s||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:gc.setState.of(new m4(o.context))})),this.chunkBudget>0&&!(s&&!r)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(A=>Gr(this.view.state,A)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),R2=nt.define({combine(i){return i.length?i[0]:null},enables:i=>[gc.state,oCA,ui.contentAttributes.compute([i],e=>{let A=e.facet(i);return A&&A.name?{"data-language":A.name}:{}})]}),k8=class{constructor(e,A=[]){this.language=e,this.support=A,this.extension=[e,A]}};var aCA=nt.define(),Rd=nt.define({combine:i=>{if(!i.length)return" ";let e=i[0];if(!e||/\S/.test(e)||Array.from(e).some(A=>A!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(i[0]));return e}});function Cc(i){let e=i.facet(Rd);return e.charCodeAt(0)==9?i.tabSize*e.length:e.length}function hh(i,e){let A="",t=i.tabSize,n=i.facet(Rd)[0];if(n==" "){for(;e>=t;)A+=" ",e-=t;n=" "}for(let o=0;o=e?rCA(i,A,e):null}var _d=class{constructor(e,A={}){this.state=e,this.options=A,this.unit=Cc(e)}lineAt(e,A=1){let t=this.state.doc.lineAt(e),{simulateBreak:n,simulateDoubleBreak:o}=this.options;return n!=null&&n>=t.from&&n<=t.to?o&&n==e?{text:"",from:e}:(A<0?n-1&&(o+=a-this.countColumn(t,t.search(/\S|$/))),o}countColumn(e,A=e.length){return rC(e,this.state.tabSize,A)}lineIndent(e,A=1){let{text:t,from:n}=this.lineAt(e,A),o=this.options.overrideIndentation;if(o){let a=o(n);if(a>-1)return a}return this.countColumn(t,t.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},VS=new Hi;function rCA(i,e,A){let t=e.resolveStack(A),n=e.resolveInner(A,-1).resolve(A,0).enterUnfinishedNodesBefore(A);if(n!=t.node){let o=[];for(let a=n;a&&!(a.fromt.node.to||a.from==t.node.from&&a.type==t.node.type);a=a.parent)o.push(a);for(let a=o.length-1;a>=0;a--)t={node:o[a],next:t}}return rz(t,i,A)}function rz(i,e,A){for(let t=i;t;t=t.next){let n=lCA(t.node);if(n)return n(OS.create(e,A,t))}return 0}function sCA(i){return i.pos==i.options.simulateBreak&&i.options.simulateDoubleBreak}function lCA(i){let e=i.type.prop(VS);if(e)return e;let A=i.firstChild,t;if(A&&(t=A.type.prop(Hi.closedBy))){let n=i.lastChild,o=n&&t.indexOf(n.name)>-1;return a=>dCA(a,!0,1,void 0,o&&!sCA(a)?n.from:void 0)}return i.parent==null?gCA:null}function gCA(){return 0}var OS=class i extends _d{constructor(e,A,t){super(e.state,e.options),this.base=e,this.pos=A,this.context=t}get node(){return this.context.node}static create(e,A,t){return new i(e,A,t)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let A=this.state.doc.lineAt(e.from);for(;;){let t=e.resolve(A.from);for(;t.parent&&t.parent.from==t.from;)t=t.parent;if(cCA(t,e))break;A=this.state.doc.lineAt(t.from)}return this.lineIndent(A.from)}continue(){return rz(this.context.next,this.base,this.pos)}};function cCA(i,e){for(let A=e;A;A=A.parent)if(i==A)return!0;return!1}function CCA(i){let e=i.node,A=e.childAfter(e.from),t=e.lastChild;if(!A)return null;let n=i.options.simulateBreak,o=i.state.doc.lineAt(A.from),a=n==null||n<=o.from?o.to:Math.min(o.to,n);for(let r=A.to;;){let s=e.childAfter(r);if(!s||s==t)return null;if(!s.type.isSkipped){if(s.from>=a)return null;let l=/^ */.exec(o.text.slice(A.to-o.from))[0].length;return{from:A.from,to:A.to+l}}r=s.to}}function dCA(i,e,A,t,n){let o=i.textAfter,a=o.match(/^\s*/)[0].length,r=t&&o.slice(a,a+t.length)==t||n==i.pos+a,s=e?CCA(i):null;return s?r?i.column(s.from):i.column(s.to):i.baseIndent+(r?0:i.unit*A)}function qS({except:i,units:e=1}={}){return A=>{let t=i&&i.test(A.textAfter);return A.baseIndent+(t?0:e*A.unit)}}var ICA=200;function sz(){return ir.transactionFilter.of(i=>{if(!i.docChanged||!i.isUserEvent("input.type")&&!i.isUserEvent("input.complete"))return i;let e=i.startState.languageDataAt("indentOnInput",i.startState.selection.main.head);if(!e.length)return i;let A=i.newDoc,{head:t}=i.newSelection.main,n=A.lineAt(t);if(t>n.from+ICA)return i;let o=A.sliceString(n.from,t);if(!e.some(l=>l.test(o)))return i;let{state:a}=i,r=-1,s=[];for(let{head:l}of a.selection.ranges){let g=a.doc.lineAt(l);if(g.from==r)continue;r=g.from;let C=x8(a,g.from);if(C==null)continue;let d=/^\s*/.exec(g.text)[0],B=hh(a,C);d!=B&&s.push({from:g.from,to:g.from+d.length,insert:B})}return s.length?[i,{changes:s,sequential:!0}]:i})}var WS=nt.define(),w4=new Hi;function lz(i){let e=i.firstChild,A=i.lastChild;return e&&e.toA)continue;if(o&&r.from=e&&l.to>A&&(o=l)}}return o}function hCA(i){let e=i.lastChild;return e&&e.to==i.to&&e.type.isError}function Ih(i,e,A){for(let t of i.facet(WS)){let n=t(i,e,A);if(n)return n}return BCA(i,e,A)}function gz(i,e){let A=e.mapPos(i.from,1),t=e.mapPos(i.to,-1);return A>=t?void 0:{from:A,to:t}}var Eh=ln.define({map:gz}),y4=ln.define({map:gz});function cz(i){let e=[];for(let{head:A}of i.state.selection.ranges)e.some(t=>t.from<=A&&t.to>=A)||e.push(i.lineBlockAt(A));return e}var xd=La.define({create(){return Lt.none},update(i,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((A,t)=>i=Az(i,A,t)),i=i.map(e.changes);for(let A of e.effects)if(A.is(Eh)&&!ECA(i,A.value.from,A.value.to)){let{preparePlaceholder:t}=e.state.facet($S),n=t?Lt.replace({widget:new JS(t(e.state,A.value))}):ez;i=i.update({add:[n.range(A.value.from,A.value.to)]})}else A.is(y4)&&(i=i.update({filter:(t,n)=>A.value.from!=t||A.value.to!=n,filterFrom:A.value.from,filterTo:A.value.to}));return e.selection&&(i=Az(i,e.selection.main.head)),i},provide:i=>ui.decorations.from(i),toJSON(i,e){let A=[];return i.between(0,e.doc.length,(t,n)=>{A.push(t,n)}),A},fromJSON(i){if(!Array.isArray(i)||i.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let A=0;A{ne&&(t=!0)}),t?i.update({filterFrom:e,filterTo:A,filter:(n,o)=>n>=A||o<=e}):i}function _8(i,e,A){var t;let n=null;return(t=i.field(xd,!1))===null||t===void 0||t.between(e,A,(o,a)=>{(!n||n.from>o)&&(n={from:o,to:a})}),n}function ECA(i,e,A){let t=!1;return i.between(e,e,(n,o)=>{n==e&&o==A&&(t=!0)}),t}function Cz(i,e){return i.field(xd,!1)?e:e.concat(ln.appendConfig.of(Bz()))}var QCA=i=>{for(let e of cz(i)){let A=Ih(i.state,e.from,e.to);if(A)return i.dispatch({effects:Cz(i.state,[Eh.of(A),dz(i,A)])}),!0}return!1},ZS=i=>{if(!i.state.field(xd,!1))return!1;let e=[];for(let A of cz(i)){let t=_8(i.state,A.from,A.to);t&&e.push(y4.of(t),dz(i,t,!1))}return e.length&&i.dispatch({effects:e}),e.length>0};function dz(i,e,A=!0){let t=i.state.doc.lineAt(e.from).number,n=i.state.doc.lineAt(e.to).number;return ui.announce.of(`${i.state.phrase(A?"Folded lines":"Unfolded lines")} ${t} ${i.state.phrase("to")} ${n}.`)}var uCA=i=>{let{state:e}=i,A=[];for(let t=0;t{let e=i.state.field(xd,!1);if(!e||!e.size)return!1;let A=[];return e.between(0,i.state.doc.length,(t,n)=>{A.push(y4.of({from:t,to:n}))}),i.dispatch({effects:A}),!0};var Iz=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:QCA},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:ZS},{key:"Ctrl-Alt-[",run:uCA},{key:"Ctrl-Alt-]",run:XS}],pCA={placeholderDOM:null,preparePlaceholder:null,placeholderText:"\u2026"},$S=nt.define({combine(i){return Lr(i,pCA)}});function Bz(i){let e=[xd,mCA];return i&&e.push($S.of(i)),e}function hz(i,e){let{state:A}=i,t=A.facet($S),n=a=>{let r=i.lineBlockAt(i.posAtDOM(a.target)),s=_8(i.state,r.from,r.to);s&&i.dispatch({effects:y4.of(s)}),a.preventDefault()};if(t.placeholderDOM)return t.placeholderDOM(i,n,e);let o=document.createElement("span");return o.textContent=t.placeholderText,o.setAttribute("aria-label",A.phrase("folded code")),o.title=A.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=n,o}var ez=Lt.replace({widget:new class extends gl{toDOM(i){return hz(i,null)}}}),JS=class extends gl{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return hz(e,this.value)}},fCA={openText:"\u2304",closedText:"\u203A",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1},f4=class extends Cl{constructor(e,A){super(),this.config=e,this.open=A}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let A=document.createElement("span");return A.textContent=this.open?this.config.openText:this.config.closedText,A.title=e.state.phrase(this.open?"Fold line":"Unfold line"),A}};function Ez(i={}){let e=P(P({},fCA),i),A=new f4(e,!0),t=new f4(e,!1),n=Po.fromClass(class{constructor(a){this.from=a.viewport.from,this.markers=this.buildMarkers(a)}update(a){(a.docChanged||a.viewportChanged||a.startState.facet(R2)!=a.state.facet(R2)||a.startState.field(xd,!1)!=a.state.field(xd,!1)||Kr(a.startState)!=Kr(a.state)||e.foldingChanged(a))&&(this.markers=this.buildMarkers(a.view))}buildMarkers(a){let r=new Xr;for(let s of a.viewportLineBlocks){let l=_8(a.state,s.from,s.to)?t:Ih(a.state,s.from,s.to)?A:null;l&&r.add(s.from,s.from,l)}return r.finish()}}),{domEventHandlers:o}=e;return[n,p8({class:"cm-foldGutter",markers(a){var r;return((r=a.plugin(n))===null||r===void 0?void 0:r.markers)||uo.empty},initialSpacer(){return new f4(e,!1)},domEventHandlers:$A(P({},o),{click:(a,r,s)=>{if(o.click&&o.click(a,r,s))return!0;let l=_8(a.state,r.from,r.to);if(l)return a.dispatch({effects:y4.of(l)}),!0;let g=Ih(a.state,r.from,r.to);return g?(a.dispatch({effects:Eh.of(g)}),!0):!1}})}),Bz()]}var mCA=ui.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}}),Bh=class i{constructor(e,A){this.specs=e;let t;function n(r){let s=Cg.newName();return(t||(t=Object.create(null)))["."+s]=r,s}let o=typeof A.all=="string"?A.all:A.all?n(A.all):void 0,a=A.scope;this.scope=a instanceof gc?r=>r.prop(dh)==a.data:a?r=>r==a:void 0,this.style=NS(e.map(r=>({tag:r.tag,class:r.class||n(Object.assign({},r,{tag:null}))})),{all:o}).style,this.module=t?new Cg(t):null,this.themeType=A.themeType}static define(e,A){return new i(e,A||{})}},YS=nt.define(),Qz=nt.define({combine(i){return i.length?[i[0]]:null}});function GS(i){let e=i.facet(YS);return e.length?e:i.facet(Qz)}function Ak(i,e){let A=[wCA],t;return i instanceof Bh&&(i.module&&A.push(ui.styleModule.of(i.module)),t=i.themeType),e?.fallback?A.push(Qz.of(i)):t?A.push(YS.computeN([ui.darkTheme],n=>n.facet(ui.darkTheme)==(t=="dark")?[i]:[])):A.push(YS.of(i)),A}var HS=class{constructor(e){this.markCache=Object.create(null),this.tree=Kr(e.state),this.decorations=this.buildDeco(e,GS(e.state)),this.decoratedTo=e.viewport.to}update(e){let A=Kr(e.state),t=GS(e.state),n=t!=GS(e.startState),{viewport:o}=e.view,a=e.changes.mapPos(this.decoratedTo,1);A.length=o.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(A!=this.tree||e.viewportChanged||n)&&(this.tree=A,this.decorations=this.buildDeco(e.view,t),this.decoratedTo=o.to)}buildDeco(e,A){if(!A||!this.tree.length)return Lt.none;let t=new Xr;for(let{from:n,to:o}of e.visibleRanges)ZH(this.tree,A,(a,r,s)=>{t.add(a,r,this.markCache[s]||(this.markCache[s]=Lt.mark({class:s})))},n,o);return t.finish()}},wCA=oc.high(Po.fromClass(HS,{decorations:i=>i.decorations})),uz=Bh.define([{tag:Oe.meta,color:"#404740"},{tag:Oe.link,textDecoration:"underline"},{tag:Oe.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Oe.emphasis,fontStyle:"italic"},{tag:Oe.strong,fontWeight:"bold"},{tag:Oe.strikethrough,textDecoration:"line-through"},{tag:Oe.keyword,color:"#708"},{tag:[Oe.atom,Oe.bool,Oe.url,Oe.contentSeparator,Oe.labelName],color:"#219"},{tag:[Oe.literal,Oe.inserted],color:"#164"},{tag:[Oe.string,Oe.deleted],color:"#a11"},{tag:[Oe.regexp,Oe.escape,Oe.special(Oe.string)],color:"#e40"},{tag:Oe.definition(Oe.variableName),color:"#00f"},{tag:Oe.local(Oe.variableName),color:"#30a"},{tag:[Oe.typeName,Oe.namespace],color:"#085"},{tag:Oe.className,color:"#167"},{tag:[Oe.special(Oe.variableName),Oe.macroName],color:"#256"},{tag:Oe.definition(Oe.propertyName),color:"#00c"},{tag:Oe.comment,color:"#940"},{tag:Oe.invalid,color:"#f00"}]),yCA=ui.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),pz=1e4,fz="()[]{}",mz=nt.define({combine(i){return Lr(i,{afterCursor:!0,brackets:fz,maxScanDistance:pz,renderMatch:bCA})}}),DCA=Lt.mark({class:"cm-matchingBracket"}),vCA=Lt.mark({class:"cm-nonmatchingBracket"});function bCA(i){let e=[],A=i.matched?DCA:vCA;return e.push(A.range(i.start.from,i.start.to)),i.end&&e.push(A.range(i.end.from,i.end.to)),e}function tz(i){let e=[],A=i.facet(mz);for(let t of i.selection.ranges){if(!t.empty)continue;let n=cc(i,t.head,-1,A)||t.head>0&&cc(i,t.head-1,1,A)||A.afterCursor&&(cc(i,t.head,1,A)||t.headi.decorations}),SCA=[MCA,yCA];function wz(i={}){return[mz.of(i),SCA]}var kCA=new Hi;function zS(i,e,A){let t=i.prop(e<0?Hi.openedBy:Hi.closedBy);if(t)return t;if(i.name.length==1){let n=A.indexOf(i.name);if(n>-1&&n%2==(e<0?1:0))return[A[n+e]]}return null}function PS(i){let e=i.type.prop(kCA);return e?e(i.node):i}function cc(i,e,A,t={}){let n=t.maxScanDistance||pz,o=t.brackets||fz,a=Kr(i),r=a.resolveInner(e,A);for(let s=r;s;s=s.parent){let l=zS(s.type,A,o);if(l&&s.from0?e>=g.from&&eg.from&&e<=g.to))return _CA(i,e,A,s,g,l,o)}}return xCA(i,e,A,a,r.type,n,o)}function _CA(i,e,A,t,n,o,a){let r=t.parent,s={from:n.from,to:n.to},l=0,g=r?.cursor();if(g&&(A<0?g.childBefore(t.from):g.childAfter(t.to)))do if(A<0?g.to<=t.from:g.from>=t.to){if(l==0&&o.indexOf(g.type.name)>-1&&g.from0)return null;let l={from:A<0?e-1:e,to:A>0?e+1:e},g=i.doc.iterRange(e,A>0?i.doc.length:0),C=0;for(let d=0;!g.next().done&&d<=o;){let B=g.value;A<0&&(d+=B.length);let u=e+d*A;for(let E=A>0?0:B.length-1,f=A>0?B.length:-1;E!=f;E+=A){let m=a.indexOf(B[E]);if(!(m<0||t.resolveInner(u+E,1).type!=n))if(m%2==0==A>0)C++;else{if(C==1)return{start:l,end:{from:u+E,to:u+E+1},matched:m>>1==s>>1};C--}}A>0&&(d+=B.length)}return g.done?{start:l,matched:!1}:null}var RCA=Object.create(null),iz=[ys.none];var nz=[],oz=Object.create(null),NCA=Object.create(null);for(let[i,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])NCA[i]=FCA(RCA,e);function KS(i,e){nz.indexOf(i)>-1||(nz.push(i),console.warn(e))}function FCA(i,e){let A=[];for(let r of e.split(" ")){let s=[];for(let l of r.split(".")){let g=i[l]||Oe[l];g?typeof g=="function"?s.length?s=s.map(g):KS(l,`Modifier ${l} used at start of tag`):s.length?KS(l,`Tag ${l} used as modifier`):s=Array.isArray(g)?g:[g]:KS(l,`Unknown highlighting tag ${l}`)}for(let l of s)A.push(l)}if(!A.length)return 0;let t=e.replace(/ /g,"_"),n=t+" "+A.map(r=>r.id),o=oz[n];if(o)return o.id;let a=oz[n]=ys.define({id:iz.length,name:t,props:[M8({[t]:A})]});return iz.push(a),a.id}var oee={rtl:Lt.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:Lo.RTL}),ltr:Lt.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:Lo.LTR}),auto:Lt.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};var LCA=i=>{let{state:e}=i,A=e.doc.lineAt(e.selection.main.from),t=nk(i.state,A.from);return t.line?GCA(i):t.block?UCA(i):!1};function ik(i,e){return({state:A,dispatch:t})=>{if(A.readOnly)return!1;let n=i(e,A);return n?(t(A.update(n)),!0):!1}}var GCA=ik(JCA,0);var KCA=ik(xz,0);var UCA=ik((i,e)=>xz(i,e,OCA(e)),0);function nk(i,e){let A=i.languageDataAt("commentTokens",e,1);return A.length?A[0]:{}}var D4=50;function TCA(i,{open:e,close:A},t,n){let o=i.sliceDoc(t-D4,t),a=i.sliceDoc(n,n+D4),r=/\s*$/.exec(o)[0].length,s=/^\s*/.exec(a)[0].length,l=o.length-r;if(o.slice(l-e.length,l)==e&&a.slice(s,s+A.length)==A)return{open:{pos:t-r,margin:r&&1},close:{pos:n+s,margin:s&&1}};let g,C;n-t<=2*D4?g=C=i.sliceDoc(t,n):(g=i.sliceDoc(t,t+D4),C=i.sliceDoc(n-D4,n));let d=/^\s*/.exec(g)[0].length,B=/\s*$/.exec(C)[0].length,u=C.length-B-A.length;return g.slice(d,d+e.length)==e&&C.slice(u,u+A.length)==A?{open:{pos:t+d+e.length,margin:/\s/.test(g.charAt(d+e.length))?1:0},close:{pos:n-B-A.length,margin:/\s/.test(C.charAt(u-1))?1:0}}:null}function OCA(i){let e=[];for(let A of i.selection.ranges){let t=i.doc.lineAt(A.from),n=A.to<=t.to?t:i.doc.lineAt(A.to);n.from>t.from&&n.from==A.to&&(n=A.to==t.to+1?t:i.doc.lineAt(A.to-1));let o=e.length-1;o>=0&&e[o].to>t.from?e[o].to=n.to:e.push({from:t.from+/^\s*/.exec(t.text)[0].length,to:n.to})}return e}function xz(i,e,A=e.selection.ranges){let t=A.map(o=>nk(e,o.from).block);if(!t.every(o=>o))return null;let n=A.map((o,a)=>TCA(e,t[a],o.from,o.to));if(i!=2&&!n.every(o=>o))return{changes:e.changes(A.map((o,a)=>n[a]?[]:[{from:o.from,insert:t[a].open+" "},{from:o.to,insert:" "+t[a].close}]))};if(i!=1&&n.some(o=>o)){let o=[];for(let a=0,r;an&&(o==a||a>C.from)){n=C.from;let d=/^\s*/.exec(C.text)[0].length,B=d==C.length,u=C.text.slice(d,d+l.length)==l?d:-1;do.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:r,token:s,indent:l,empty:g,single:C}of t)(C||!g)&&o.push({from:r.from+l,insert:s+" "});let a=e.changes(o);return{changes:a,selection:e.selection.map(a,1)}}else if(i!=1&&t.some(o=>o.comment>=0)){let o=[];for(let{line:a,comment:r,token:s}of t)if(r>=0){let l=a.from+r,g=l+s.length;a.text[g-a.from]==" "&&g++,o.push({from:l,to:g})}return{changes:o}}return null}function Qh(i,e){return Be.create(i.ranges.map(e),i.mainIndex)}function dc(i,e){return i.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Ic({state:i,dispatch:e},A){let t=Qh(i.selection,A);return t.eq(i.selection,!0)?!1:(e(dc(i,t)),!0)}function N8(i,e){return Be.cursor(e?i.to:i.from)}function Rz(i,e){return Ic(i,A=>A.empty?i.moveByChar(A,e):N8(A,e))}function Ds(i){return i.textDirectionAt(i.state.selection.main.head)==Lo.LTR}var Nz=i=>Rz(i,!Ds(i)),Fz=i=>Rz(i,Ds(i));function Lz(i,e){return Ic(i,A=>A.empty?i.moveByGroup(A,e):N8(A,e))}var YCA=i=>Lz(i,!Ds(i)),HCA=i=>Lz(i,Ds(i));var hee=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function zCA(i,e,A){if(e.type.prop(A))return!0;let t=e.to-e.from;return t&&(t>2||/[^\s,.;:]/.test(i.sliceDoc(e.from,e.to)))||e.firstChild}function F8(i,e,A){let t=Kr(i).resolveInner(e.head),n=A?Hi.closedBy:Hi.openedBy;for(let s=e.head;;){let l=A?t.childAfter(s):t.childBefore(s);if(!l)break;zCA(i,l,n)?t=l:s=A?l.to:l.from}let o=t.type.prop(n),a,r;return o&&(a=A?cc(i,t.from,1):cc(i,t.to,-1))&&a.matched?r=A?a.end.to:a.end.from:r=A?t.to:t.from,Be.cursor(r,A?-1:1)}var PCA=i=>Ic(i,e=>F8(i.state,e,!Ds(i))),jCA=i=>Ic(i,e=>F8(i.state,e,Ds(i)));function Gz(i,e){return Ic(i,A=>{if(!A.empty)return N8(A,e);let t=i.moveVertically(A,e);return t.head!=A.head?t:i.moveToLineBoundary(A,e)})}var Kz=i=>Gz(i,!1),Uz=i=>Gz(i,!0);function Tz(i){let e=i.scrollDOM.clientHeighta.empty?i.moveVertically(a,e,A.height):N8(a,e));if(n.eq(t.selection))return!1;let o;if(A.selfScroll){let a=i.coordsAtPos(t.selection.main.head),r=i.scrollDOM.getBoundingClientRect(),s=r.top+A.marginTop,l=r.bottom-A.marginBottom;a&&a.top>s&&a.bottomOz(i,!1),ek=i=>Oz(i,!0);function N2(i,e,A){let t=i.lineBlockAt(e.head),n=i.moveToLineBoundary(e,A);if(n.head==e.head&&n.head!=(A?t.to:t.from)&&(n=i.moveToLineBoundary(e,A,!1)),!A&&n.head==t.from&&t.length){let o=/^\s*/.exec(i.state.sliceDoc(t.from,Math.min(t.from+100,t.to)))[0].length;o&&e.head!=t.from+o&&(n=Be.cursor(t.from+o))}return n}var VCA=i=>Ic(i,e=>N2(i,e,!0)),qCA=i=>Ic(i,e=>N2(i,e,!1)),WCA=i=>Ic(i,e=>N2(i,e,!Ds(i))),ZCA=i=>Ic(i,e=>N2(i,e,Ds(i))),XCA=i=>Ic(i,e=>Be.cursor(i.lineBlockAt(e.head).from,1)),$CA=i=>Ic(i,e=>Be.cursor(i.lineBlockAt(e.head).to,-1));function A2A(i,e,A){let t=!1,n=Qh(i.selection,o=>{let a=cc(i,o.head,-1)||cc(i,o.head,1)||o.head>0&&cc(i,o.head-1,1)||o.headA2A(i,e,!1);function hg(i,e){let A=Qh(i.state.selection,t=>{let n=e(t);return Be.range(t.anchor,n.head,n.goalColumn,n.bidiLevel||void 0,n.assoc)});return A.eq(i.state.selection)?!1:(i.dispatch(dc(i.state,A)),!0)}function Jz(i,e){return hg(i,A=>i.moveByChar(A,e))}var Yz=i=>Jz(i,!Ds(i)),Hz=i=>Jz(i,Ds(i));function zz(i,e){return hg(i,A=>i.moveByGroup(A,e))}var t2A=i=>zz(i,!Ds(i)),i2A=i=>zz(i,Ds(i));var n2A=i=>hg(i,e=>F8(i.state,e,!Ds(i))),o2A=i=>hg(i,e=>F8(i.state,e,Ds(i)));function Pz(i,e){return hg(i,A=>i.moveVertically(A,e))}var jz=i=>Pz(i,!1),Vz=i=>Pz(i,!0);function qz(i,e){return hg(i,A=>i.moveVertically(A,e,Tz(i).height))}var Dz=i=>qz(i,!1),vz=i=>qz(i,!0),a2A=i=>hg(i,e=>N2(i,e,!0)),r2A=i=>hg(i,e=>N2(i,e,!1)),s2A=i=>hg(i,e=>N2(i,e,!Ds(i))),l2A=i=>hg(i,e=>N2(i,e,Ds(i))),g2A=i=>hg(i,e=>Be.cursor(i.lineBlockAt(e.head).from)),c2A=i=>hg(i,e=>Be.cursor(i.lineBlockAt(e.head).to)),bz=({state:i,dispatch:e})=>(e(dc(i,{anchor:0})),!0),Mz=({state:i,dispatch:e})=>(e(dc(i,{anchor:i.doc.length})),!0),Sz=({state:i,dispatch:e})=>(e(dc(i,{anchor:i.selection.main.anchor,head:0})),!0),kz=({state:i,dispatch:e})=>(e(dc(i,{anchor:i.selection.main.anchor,head:i.doc.length})),!0),C2A=({state:i,dispatch:e})=>(e(i.update({selection:{anchor:0,head:i.doc.length},userEvent:"select"})),!0),d2A=({state:i,dispatch:e})=>{let A=L8(i).map(({from:t,to:n})=>Be.range(t,Math.min(n+1,i.doc.length)));return e(i.update({selection:Be.create(A),userEvent:"select"})),!0},I2A=({state:i,dispatch:e})=>{let A=Qh(i.selection,t=>{let n=Kr(i),o=n.resolveStack(t.from,1);if(t.empty){let a=n.resolveStack(t.from,-1);a.node.from>=o.node.from&&a.node.to<=o.node.to&&(o=a)}for(let a=o;a;a=a.next){let{node:r}=a;if((r.from=t.to||r.to>t.to&&r.from<=t.from)&&a.next)return Be.range(r.to,r.from)}return t});return A.eq(i.selection)?!1:(e(dc(i,A)),!0)};function Wz(i,e){let{state:A}=i,t=A.selection,n=A.selection.ranges.slice();for(let o of A.selection.ranges){let a=A.doc.lineAt(o.head);if(e?a.to0)for(let r=o;;){let s=i.moveVertically(r,e);if(s.heada.to){n.some(l=>l.head==s.head)||n.push(s);break}else{if(s.head==r.head)break;r=s}}}return n.length==t.ranges.length?!1:(i.dispatch(dc(A,Be.create(n,n.length-1))),!0)}var B2A=i=>Wz(i,!1),h2A=i=>Wz(i,!0),E2A=({state:i,dispatch:e})=>{let A=i.selection,t=null;return A.ranges.length>1?t=Be.create([A.main]):A.main.empty||(t=Be.create([Be.cursor(A.main.head)])),t?(e(dc(i,t)),!0):!1};function v4(i,e){if(i.state.readOnly)return!1;let A="delete.selection",{state:t}=i,n=t.changeByRange(o=>{let{from:a,to:r}=o;if(a==r){let s=e(o);sa&&(A="delete.forward",s=R8(i,s,!0)),a=Math.min(a,s),r=Math.max(r,s)}else a=R8(i,a,!1),r=R8(i,r,!0);return a==r?{range:o}:{changes:{from:a,to:r},range:Be.cursor(a,an(i)))t.between(e,e,(n,o)=>{ne&&(e=A?o:n)});return e}var Zz=(i,e,A)=>v4(i,t=>{let n=t.from,{state:o}=i,a=o.doc.lineAt(n),r,s;if(A&&!e&&n>a.from&&nZz(i,!1,!0);var Xz=i=>Zz(i,!0,!1),$z=(i,e)=>v4(i,A=>{let t=A.head,{state:n}=i,o=n.doc.lineAt(t),a=n.charCategorizer(t);for(let r=null;;){if(t==(e?o.to:o.from)){t==A.head&&o.number!=(e?n.doc.lines:1)&&(t+=e?1:-1);break}let s=tr(o.text,t-o.from,e)+o.from,l=o.text.slice(Math.min(t,s)-o.from,Math.max(t,s)-o.from),g=a(l);if(r!=null&&g!=r)break;(l!=" "||t!=A.head)&&(r=g),t=s}return t}),AP=i=>$z(i,!1),Q2A=i=>$z(i,!0);var u2A=i=>v4(i,e=>{let A=i.lineBlockAt(e.head).to;return e.headv4(i,e=>{let A=i.moveToLineBoundary(e,!1).head;return e.head>A?A:Math.max(0,e.head-1)}),f2A=i=>v4(i,e=>{let A=i.moveToLineBoundary(e,!0).head;return e.head{if(i.readOnly)return!1;let A=i.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:On.of(["",""])},range:Be.cursor(t.from)}));return e(i.update(A,{scrollIntoView:!0,userEvent:"input"})),!0},w2A=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let A=i.changeByRange(t=>{if(!t.empty||t.from==0||t.from==i.doc.length)return{range:t};let n=t.from,o=i.doc.lineAt(n),a=n==o.from?n-1:tr(o.text,n-o.from,!1)+o.from,r=n==o.to?n+1:tr(o.text,n-o.from,!0)+o.from;return{changes:{from:a,to:r,insert:i.doc.slice(n,r).append(i.doc.slice(a,n))},range:Be.cursor(r)}});return A.changes.empty?!1:(e(i.update(A,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function L8(i){let e=[],A=-1;for(let t of i.selection.ranges){let n=i.doc.lineAt(t.from),o=i.doc.lineAt(t.to);if(!t.empty&&t.to==o.from&&(o=i.doc.lineAt(t.to-1)),A>=n.number){let a=e[e.length-1];a.to=o.to,a.ranges.push(t)}else e.push({from:n.from,to:o.to,ranges:[t]});A=o.number+1}return e}function eP(i,e,A){if(i.readOnly)return!1;let t=[],n=[];for(let o of L8(i)){if(A?o.to==i.doc.length:o.from==0)continue;let a=i.doc.lineAt(A?o.to+1:o.from-1),r=a.length+1;if(A){t.push({from:o.to,to:a.to},{from:o.from,insert:a.text+i.lineBreak});for(let s of o.ranges)n.push(Be.range(Math.min(i.doc.length,s.anchor+r),Math.min(i.doc.length,s.head+r)))}else{t.push({from:a.from,to:o.from},{from:o.to,insert:i.lineBreak+a.text});for(let s of o.ranges)n.push(Be.range(s.anchor-r,s.head-r))}}return t.length?(e(i.update({changes:t,scrollIntoView:!0,selection:Be.create(n,i.selection.mainIndex),userEvent:"move.line"})),!0):!1}var y2A=({state:i,dispatch:e})=>eP(i,e,!1),D2A=({state:i,dispatch:e})=>eP(i,e,!0);function tP(i,e,A){if(i.readOnly)return!1;let t=[];for(let o of L8(i))A?t.push({from:o.from,insert:i.doc.slice(o.from,o.to)+i.lineBreak}):t.push({from:o.to,insert:i.lineBreak+i.doc.slice(o.from,o.to)});let n=i.changes(t);return e(i.update({changes:n,selection:i.selection.map(n,A?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}var v2A=({state:i,dispatch:e})=>tP(i,e,!1),b2A=({state:i,dispatch:e})=>tP(i,e,!0),M2A=i=>{if(i.state.readOnly)return!1;let{state:e}=i,A=e.changes(L8(e).map(({from:n,to:o})=>(n>0?n--:o{let o;if(i.lineWrapping){let a=i.lineBlockAt(n.head),r=i.coordsAtPos(n.head,n.assoc||1);r&&(o=a.bottom+i.documentTop-r.bottom+i.defaultLineHeight/2)}return i.moveVertically(n,!0,o)}).map(A);return i.dispatch({changes:A,selection:t,scrollIntoView:!0,userEvent:"delete.line"}),!0};function S2A(i,e){if(/\(\)|\[\]|\{\}/.test(i.sliceDoc(e-1,e+1)))return{from:e,to:e};let A=Kr(i).resolveInner(e),t=A.childBefore(e),n=A.childAfter(e),o;return t&&n&&t.to<=e&&n.from>=e&&(o=t.type.prop(Hi.closedBy))&&o.indexOf(n.name)>-1&&i.doc.lineAt(t.to).from==i.doc.lineAt(n.from).from&&!/\S/.test(i.sliceDoc(t.to,n.from))?{from:t.to,to:n.from}:null}var _z=iP(!1),k2A=iP(!0);function iP(i){return({state:e,dispatch:A})=>{if(e.readOnly)return!1;let t=e.changeByRange(n=>{let{from:o,to:a}=n,r=e.doc.lineAt(o),s=!i&&o==a&&S2A(e,o);i&&(o=a=(a<=r.to?r:e.doc.lineAt(a)).to);let l=new _d(e,{simulateBreak:o,simulateDoubleBreak:!!s}),g=x8(l,o);for(g==null&&(g=rC(/^\s*/.exec(e.doc.lineAt(o).text)[0],e.tabSize));ar.from&&o{let n=[];for(let a=t.from;a<=t.to;){let r=i.doc.lineAt(a);r.number>A&&(t.empty||t.to>r.from)&&(e(r,n,t),A=r.number),a=r.to+1}let o=i.changes(n);return{changes:n,range:Be.range(o.mapPos(t.anchor,1),o.mapPos(t.head,1))}})}var _2A=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let A=Object.create(null),t=new _d(i,{overrideIndentation:o=>{let a=A[o];return a??-1}}),n=ok(i,(o,a,r)=>{let s=x8(t,o.from);if(s==null)return;/\S/.test(o.text)||(s=0);let l=/^\s*/.exec(o.text)[0],g=hh(i,s);(l!=g||r.fromi.readOnly?!1:(e(i.update(ok(i,(A,t)=>{t.push({from:A.from,insert:i.facet(Rd)})}),{userEvent:"input.indent"})),!0),oP=({state:i,dispatch:e})=>i.readOnly?!1:(e(i.update(ok(i,(A,t)=>{let n=/^\s*/.exec(A.text)[0];if(!n)return;let o=rC(n,i.tabSize),a=0,r=hh(i,Math.max(0,o-Cc(i)));for(;a(i.setTabFocusMode(),!0);var R2A=[{key:"Ctrl-b",run:Nz,shift:Yz,preventDefault:!0},{key:"Ctrl-f",run:Fz,shift:Hz},{key:"Ctrl-p",run:Kz,shift:jz},{key:"Ctrl-n",run:Uz,shift:Vz},{key:"Ctrl-a",run:XCA,shift:g2A},{key:"Ctrl-e",run:$CA,shift:c2A},{key:"Ctrl-d",run:Xz},{key:"Ctrl-h",run:tk},{key:"Ctrl-k",run:u2A},{key:"Ctrl-Alt-h",run:AP},{key:"Ctrl-o",run:m2A},{key:"Ctrl-t",run:w2A},{key:"Ctrl-v",run:ek}],N2A=[{key:"ArrowLeft",run:Nz,shift:Yz,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:YCA,shift:t2A,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:WCA,shift:s2A,preventDefault:!0},{key:"ArrowRight",run:Fz,shift:Hz,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:HCA,shift:i2A,preventDefault:!0},{mac:"Cmd-ArrowRight",run:ZCA,shift:l2A,preventDefault:!0},{key:"ArrowUp",run:Kz,shift:jz,preventDefault:!0},{mac:"Cmd-ArrowUp",run:bz,shift:Sz},{mac:"Ctrl-ArrowUp",run:yz,shift:Dz},{key:"ArrowDown",run:Uz,shift:Vz,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Mz,shift:kz},{mac:"Ctrl-ArrowDown",run:ek,shift:vz},{key:"PageUp",run:yz,shift:Dz},{key:"PageDown",run:ek,shift:vz},{key:"Home",run:qCA,shift:r2A,preventDefault:!0},{key:"Mod-Home",run:bz,shift:Sz},{key:"End",run:VCA,shift:a2A,preventDefault:!0},{key:"Mod-End",run:Mz,shift:kz},{key:"Enter",run:_z,shift:_z},{key:"Mod-a",run:C2A},{key:"Backspace",run:tk,shift:tk,preventDefault:!0},{key:"Delete",run:Xz,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:AP,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Q2A,preventDefault:!0},{mac:"Mod-Backspace",run:p2A,preventDefault:!0},{mac:"Mod-Delete",run:f2A,preventDefault:!0}].concat(R2A.map(i=>({mac:i.key,run:i.run,shift:i.shift}))),aP=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:PCA,shift:n2A},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:jCA,shift:o2A},{key:"Alt-ArrowUp",run:y2A},{key:"Shift-Alt-ArrowUp",run:v2A},{key:"Alt-ArrowDown",run:D2A},{key:"Shift-Alt-ArrowDown",run:b2A},{key:"Mod-Alt-ArrowUp",run:B2A},{key:"Mod-Alt-ArrowDown",run:h2A},{key:"Escape",run:E2A},{key:"Mod-Enter",run:k2A},{key:"Alt-l",mac:"Ctrl-l",run:d2A},{key:"Mod-i",run:I2A,preventDefault:!0},{key:"Mod-[",run:oP},{key:"Mod-]",run:nP},{key:"Mod-Alt-\\",run:_2A},{key:"Shift-Mod-k",run:M2A},{key:"Shift-Mod-\\",run:e2A},{key:"Mod-/",run:LCA},{key:"Alt-A",run:KCA},{key:"Ctrl-m",mac:"Shift-Alt-m",run:x2A}].concat(N2A),rP={key:"Tab",run:nP,shift:oP};var U8=class{constructor(e,A,t){this.from=e,this.to=A,this.diagnostic=t}},Nd=class i{constructor(e,A,t){this.diagnostics=e,this.panel=A,this.selected=t}static init(e,A,t){let n=t.facet(E0).markerFilter;n&&(e=n(e,t));let o=e.slice().sort((B,u)=>B.from-u.from||B.to-u.to),a=new Xr,r=[],s=0,l=t.doc.iter(),g=0,C=t.doc.length;for(let B=0;;){let u=B==o.length?null:o[B];if(!u&&!r.length)break;let E,f;if(r.length)E=s,f=r.reduce((S,k)=>Math.min(S,k.to),u&&u.from>E?u.from:1e8);else{if(E=u.from,E>C)break;f=u.to,r.push(u),B++}for(;BS.from||S.to==E))r.push(S),B++,f=Math.min(S.to,f);else{f=Math.min(S.from,f);break}}f=Math.min(f,C);let m=!1;if(r.some(S=>S.from==E&&(S.to==f||f==C))&&(m=E==f,!m&&f-E<10)){let S=E-(g+l.value.length);S>0&&(l.next(S),g=E);for(let k=E;;){if(k>=f){m=!0;break}if(!l.lineBreak&&g+l.value.length>k)break;k=g+l.value.length,g+=l.value.length,l.next()}}let v=QP(r);if(m)a.add(E,E,Lt.widget({widget:new ak(v),diagnostics:r.slice()}));else{let S=r.reduce((k,M)=>M.markClass?k+" "+M.markClass:k,"");a.add(E,f,Lt.mark({class:"cm-lintRange cm-lintRange-"+v+S,diagnostics:r.slice(),inclusiveEnd:r.some(k=>k.to>f)}))}if(s=f,s==C)break;for(let S=0;S{if(!(e&&a.diagnostics.indexOf(e)<0))if(!t)t=new U8(n,o,e||a.diagnostics[0]);else{if(a.diagnostics.indexOf(t.diagnostic)<0)return!1;t=new U8(t.from,o,t.diagnostic)}}),t}function gP(i,e){let A=e.pos,t=e.end||A,n=i.state.facet(E0).hideOn(i,A,t);if(n!=null)return n;let o=i.startState.doc.lineAt(e.pos);return!!(i.effects.some(a=>a.is(J8))||i.changes.touchesRange(o.from,Math.max(o.to,t)))}function cP(i,e){return i.field(Fl,!1)?e:e.concat(ln.appendConfig.of(pP))}function F2A(i,e){return{effects:cP(i,[J8.of(e)])}}var J8=ln.define(),sk=ln.define(),CP=ln.define(),Fl=La.define({create(){return new Nd(Lt.none,null,null)},update(i,e){if(e.docChanged&&i.diagnostics.size){let A=i.diagnostics.map(e.changes),t=null,n=i.panel;if(i.selected){let o=e.changes.mapPos(i.selected.from,1);t=F2(A,i.selected.diagnostic,o)||F2(A,null,o)}!A.size&&n&&e.state.facet(E0).autoPanel&&(n=null),i=new Nd(A,n,t)}for(let A of e.effects)if(A.is(J8)){let t=e.state.facet(E0).autoPanel?A.value.length?b4.open:null:i.panel;i=Nd.init(A.value,t,e.state)}else A.is(sk)?i=new Nd(i.diagnostics,A.value?b4.open:null,i.selected):A.is(CP)&&(i=new Nd(i.diagnostics,i.panel,A.value));return i},provide:i=>[vd.from(i,e=>e.panel),ui.decorations.from(i,e=>e.diagnostics)]});var L2A=Lt.mark({class:"cm-lintRange cm-lintRange-active"});function G2A(i,e,A){let{diagnostics:t}=i.state.field(Fl),n,o=-1,a=-1;t.between(e-(A<0?1:0),e+(A>0?1:0),(s,l,{spec:g})=>{if(e>=s&&e<=l&&(s==l||(e>s||A>0)&&(eEP(i,A,!1)))}var K2A=i=>{let e=i.state.field(Fl,!1);(!e||!e.panel)&&i.dispatch({effects:cP(i.state,[sk.of(!0)])});let A=d4(i,b4.open);return A&&A.dom.querySelector(".cm-panel-lint ul").focus(),!0},sP=i=>{let e=i.state.field(Fl,!1);return!e||!e.panel?!1:(i.dispatch({effects:sk.of(!1)}),!0)},U2A=i=>{let e=i.state.field(Fl,!1);if(!e)return!1;let A=i.state.selection.main,t=F2(e.diagnostics,null,A.to+1);return!t&&(t=F2(e.diagnostics,null,0),!t||t.from==A.from&&t.to==A.to)?!1:(i.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0}),!0)};var IP=[{key:"Mod-Shift-m",run:K2A,preventDefault:!0},{key:"F8",run:U2A}],T2A=Po.fromClass(class{constructor(i){this.view=i,this.timeout=-1,this.set=!0;let{delay:e}=i.state.facet(E0);this.lintTime=Date.now()+e,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,e)}run(){clearTimeout(this.timeout);let i=Date.now();if(iPromise.resolve(t(this.view))),t=>{this.view.state.doc==e.doc&&this.view.dispatch(F2A(this.view.state,t.reduce((n,o)=>n.concat(o))))},t=>{Gr(this.view.state,t)})}}update(i){let e=i.state.facet(E0);(i.docChanged||e!=i.startState.facet(E0)||e.needsRefresh&&e.needsRefresh(i))&&(this.lintTime=Date.now()+e.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,e.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}});function O2A(i,e,A){let t=[],n=-1;for(let o of i)o.then(a=>{t.push(a),clearTimeout(n),t.length==i.length?e(t):n=setTimeout(()=>e(t),200)},A)}var E0=nt.define({combine(i){return P({sources:i.map(e=>e.source).filter(e=>e!=null)},Lr(i.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:lP,tooltipFilter:lP,needsRefresh:(e,A)=>e?A?t=>e(t)||A(t):e:A,hideOn:(e,A)=>e?A?(t,n,o)=>e(t,n,o)||A(t,n,o):e:A,autoPanel:(e,A)=>e||A}))}});function lP(i,e){return i?e?(A,t)=>e(i(A,t),t):i:e}function BP(i,e={}){return[E0.of({source:i,config:e}),T2A,pP]}function hP(i){let e=[];if(i)A:for(let{name:A}of i){for(let t=0;to.toLowerCase()==n.toLowerCase())){e.push(n);continue A}}e.push("")}return e}function EP(i,e,A){var t;let n=A?hP(e.actions):[];return po("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},po("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(i):e.message),(t=e.actions)===null||t===void 0?void 0:t.map((o,a)=>{let r=!1,s=B=>{if(B.preventDefault(),r)return;r=!0;let u=F2(i.state.field(Fl).diagnostics,e);u&&o.apply(i,u.from,u.to)},{name:l}=o,g=n[a]?l.indexOf(n[a]):-1,C=g<0?l:[l.slice(0,g),po("u",l.slice(g,g+1)),l.slice(g+1)],d=o.markClass?" "+o.markClass:"";return po("button",{type:"button",class:"cm-diagnosticAction"+d,onclick:s,onmousedown:s,"aria-label":` Action: ${l}${g<0?"":` (access key "${n[a]})"`}.`},C)}),e.source&&po("div",{class:"cm-diagnosticSource"},e.source))}var ak=class extends gl{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return po("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}},T8=class{constructor(e,A){this.diagnostic=A,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=EP(e,A,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}},b4=class i{constructor(e){this.view=e,this.items=[];let A=n=>{if(!(n.ctrlKey||n.altKey||n.metaKey)){if(n.keyCode==27)sP(this.view),this.view.focus();else if(n.keyCode==38||n.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(n.keyCode==40||n.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(n.keyCode==36)this.moveSelection(0);else if(n.keyCode==35)this.moveSelection(this.items.length-1);else if(n.keyCode==13)this.view.focus();else if(n.keyCode>=65&&n.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:o}=this.items[this.selectedIndex],a=hP(o.actions);for(let r=0;r{for(let o=0;osP(this.view)},"\xD7")),this.update()}get selectedIndex(){let e=this.view.state.field(Fl).selected;if(!e)return-1;for(let A=0;A{for(let g of l.diagnostics){if(a.has(g))continue;a.add(g);let C=-1,d;for(let B=t;Bt&&(this.items.splice(t,C-t),n=!0)),A&&d.diagnostic==A.diagnostic?d.dom.hasAttribute("aria-selected")||(d.dom.setAttribute("aria-selected","true"),o=d):d.dom.hasAttribute("aria-selected")&&d.dom.removeAttribute("aria-selected"),t++}});t({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:r,panel:s})=>{let l=s.height/this.list.offsetHeight;r.tops.bottom&&(this.list.scrollTop+=(r.bottom-s.bottom)/l)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),n&&this.sync()}sync(){let e=this.list.firstChild;function A(){let t=e;e=t.nextSibling,t.remove()}for(let t of this.items)if(t.dom.parentNode==this.list){for(;e!=t.dom;)A();e=t.dom.nextSibling}else this.list.insertBefore(t.dom,e);for(;e;)A()}moveSelection(e){if(this.selectedIndex<0)return;let A=this.view.state.field(Fl),t=F2(A.diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:CP.of(t)})}static open(e){return new i(e)}};function K8(i,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(i)}')`}function G8(i){return K8(``,'width="6" height="3"')}var J2A=ui.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:G8("#d11")},".cm-lintRange-warning":{backgroundImage:G8("orange")},".cm-lintRange-info":{backgroundImage:G8("#999")},".cm-lintRange-hint":{backgroundImage:G8("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function Y2A(i){return i=="error"?4:i=="warning"?3:i=="info"?2:1}function QP(i){let e="hint",A=1;for(let t of i){let n=Y2A(t.severity);n>A&&(A=n,e=t.severity)}return e}var O8=class extends Cl{constructor(e){super(),this.diagnostics=e,this.severity=QP(e)}toDOM(e){let A=document.createElement("div");A.className="cm-lint-marker cm-lint-marker-"+this.severity;let t=this.diagnostics,n=e.state.facet(Y8).tooltipFilter;return n&&(t=n(t,e.state)),t.length&&(A.onmouseover=()=>z2A(e,A,t)),A}};function H2A(i,e){let A=t=>{let n=e.getBoundingClientRect();if(!(t.clientX>n.left-10&&t.clientXn.top-10&&t.clientYe.getBoundingClientRect()}}})}),e.onmouseout=e.onmousemove=null,H2A(i,e)}let{hoverTime:n}=i.state.facet(Y8),o=setTimeout(t,n);e.onmouseout=()=>{clearTimeout(o),e.onmouseout=e.onmousemove=null},e.onmousemove=()=>{clearTimeout(o),o=setTimeout(t,n)}}function P2A(i,e){let A=Object.create(null);for(let n of e){let o=i.lineAt(n.from);(A[o.from]||(A[o.from]=[])).push(n)}let t=[];for(let n in A)t.push(new O8(A[n]).range(+n));return uo.of(t,!0)}var j2A=p8({class:"cm-gutter-lint",markers:i=>i.state.field(rk),widgetMarker:(i,e,A)=>{let t=[];return i.state.field(rk).between(A.from,A.to,(n,o,a)=>{n>A.from&&nt.is(lk)?t.value:A,i)},provide:i=>ch.from(i)}),V2A=ui.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:K8('')},".cm-lint-marker-warning":{content:K8('')},".cm-lint-marker-error":{content:K8('')}}),pP=[Fl,ui.decorations.compute([Fl],i=>{let{selected:e,panel:A}=i.field(Fl);return!e||!A||e.from==e.to?Lt.none:Lt.set([L2A.range(e.from,e.to)])}),FH(G2A,{hideOn:gP}),J2A],Y8=nt.define({combine(i){return Lr(i,{hoverTime:300,markerFilter:null,tooltipFilter:null})}});function fP(i={}){return[Y8.of(i),rk,j2A,V2A,uP]}var ck=class i{constructor(e,A,t,n,o,a,r,s,l,g=0,C){this.p=e,this.stack=A,this.state=t,this.reducePos=n,this.pos=o,this.score=a,this.buffer=r,this.bufferBase=s,this.curContext=l,this.lookAhead=g,this.parent=C}toString(){return`[${this.stack.filter((e,A)=>A%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,A,t=0){let n=e.parser.context;return new i(e,[],A,t,t,0,[],0,n?new H8(n,n.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,A){this.stack.push(this.state,A,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var A;let t=e>>19,n=e&65535,{parser:o}=this.p,a=this.reducePos=2e3&&!(!((A=this.p.parser.nodeSet.types[n])===null||A===void 0)&&A.isAnonymous)&&(l==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=g):this.p.lastBigReductionSizes;)this.stack.pop();this.reduceContext(n,l)}storeNode(e,A,t,n=4,o=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&a.buffer[r-4]==0&&a.buffer[r-1]>-1){if(A==t)return;if(a.buffer[r-2]>=A){a.buffer[r-2]=t;return}}}if(!o||this.pos==t)this.buffer.push(e,A,t,n);else{let a=this.buffer.length;if(a>0&&(this.buffer[a-4]!=0||this.buffer[a-1]<0)){let r=!1;for(let s=a;s>0&&this.buffer[s-2]>t;s-=4)if(this.buffer[s-1]>=0){r=!0;break}if(r)for(;a>0&&this.buffer[a-2]>t;)this.buffer[a]=this.buffer[a-4],this.buffer[a+1]=this.buffer[a-3],this.buffer[a+2]=this.buffer[a-2],this.buffer[a+3]=this.buffer[a-1],a-=4,n>4&&(n-=4)}this.buffer[a]=e,this.buffer[a+1]=A,this.buffer[a+2]=t,this.buffer[a+3]=n}}shift(e,A,t,n){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let o=e,{parser:a}=this.p;this.pos=n;let r=a.stateFlag(o,1);!r&&(n>t||A<=a.maxNode)&&(this.reducePos=n),this.pushState(o,r?t:Math.min(t,this.reducePos)),this.shiftContext(A,t),A<=a.maxNode&&this.buffer.push(A,t,n,4)}else this.pos=n,this.shiftContext(A,t),A<=this.p.parser.maxNode&&this.buffer.push(A,t,n,4)}apply(e,A,t,n){e&65536?this.reduce(e):this.shift(e,A,t,n)}useNode(e,A){let t=this.p.reused.length-1;(t<0||this.p.reused[t]!=e)&&(this.p.reused.push(e),t++);let n=this.pos;this.reducePos=this.pos=n+e.length,this.pushState(A,n),this.buffer.push(t,n,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,A=e.buffer.length;for(;A>0&&e.buffer[A-2]>e.reducePos;)A-=4;let t=e.buffer.slice(A),n=e.bufferBase+A;for(;e&&n==e.bufferBase;)e=e.parent;return new i(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,n,this.curContext,this.lookAhead,e)}recoverByDelete(e,A){let t=e<=this.p.parser.maxNode;t&&this.storeNode(e,this.pos,A,4),this.storeNode(0,this.pos,A,t?8:4),this.pos=this.reducePos=A,this.score-=190}canShift(e){for(let A=new Ck(this);;){let t=this.p.parser.stateSlot(A.state,4)||this.p.parser.hasAction(A.state,e);if(t==0)return!1;if((t&65536)==0)return!0;A.reduce(t)}}recoverByInsert(e){if(this.stack.length>=300)return[];let A=this.p.parser.nextStates(this.state);if(A.length>8||this.stack.length>=120){let n=[];for(let o=0,a;os&1&&r==a)||n.push(A[o],a)}A=n}let t=[];for(let n=0;n>19,n=A&65535,o=this.stack.length-t*3;if(o<0||e.getGoto(this.stack[o],n,!1)<0){let a=this.findForcedReduction();if(a==null)return!1;A=a}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(A),!0}findForcedReduction(){let{parser:e}=this.p,A=[],t=(n,o)=>{if(!A.includes(n))return A.push(n),e.allActions(n,a=>{if(!(a&393216))if(a&65536){let r=(a>>19)-o;if(r>1){let s=a&65535,l=this.stack.length-r*3;if(l>=0&&e.getGoto(this.stack[l],s,!1)>=0)return r<<19|65536|s}}else{let r=t(a,o+1);if(r!=null)return r}})};return t(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let A=0;A0&&this.emitLookAhead()}},H8=class{constructor(e,A){this.tracker=e,this.context=A,this.hash=e.strict?e.hash(A):0}},Ck=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let A=e&65535,t=e>>19;t==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let n=this.start.p.parser.getGoto(this.stack[this.base-3],A,!0);this.state=n}},dk=class i{constructor(e,A,t){this.stack=e,this.pos=A,this.index=t,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,A=e.bufferBase+e.buffer.length){return new i(e,A,A-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new i(this.stack,this.pos,this.index)}};function M4(i,e=Uint16Array){if(typeof i!="string")return i;let A=null;for(let t=0,n=0;t=92&&a--,a>=34&&a--;let s=a-32;if(s>=46&&(s-=46,r=!0),o+=s,r)break;o*=46}A?A[n++]=o:A=new e(o)}return A}var uh=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},mP=new uh,Ik=class{constructor(e,A){this.input=e,this.ranges=A,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=mP,this.rangeIndex=0,this.pos=this.chunkPos=A[0].from,this.range=A[0],this.end=A[A.length-1].to,this.readNext()}resolveOffset(e,A){let t=this.range,n=this.rangeIndex,o=this.pos+e;for(;ot.to:o>=t.to;){if(n==this.ranges.length-1)return null;let a=this.ranges[++n];o+=a.from-t.to,t=a}return o}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,A.from);return this.end}peek(e){let A=this.chunkOff+e,t,n;if(A>=0&&A=this.chunk2Pos&&tr.to&&(this.chunk2=this.chunk2.slice(0,r.to-t)),n=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),n}acceptToken(e,A=0){let t=A?this.resolveOffset(A,-1):this.pos;if(t==null||t=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,A){if(A?(this.token=A,A.start=e,A.lookAhead=e+1,A.value=A.extended=-1):this.token=mP,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&A<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,A-this.chunkPos);if(e>=this.chunk2Pos&&A<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,A-this.chunk2Pos);if(e>=this.range.from&&A<=this.range.to)return this.input.read(e,A);let t="";for(let n of this.ranges){if(n.from>=A)break;n.to>e&&(t+=this.input.read(Math.max(n.from,e),Math.min(n.to,A)))}return t}},L2=class{constructor(e,A){this.data=e,this.id=A}token(e,A){let{parser:t}=A.p;bP(this.data,e,A,this.id,t.data,t.tokenPrecTable)}};L2.prototype.contextual=L2.prototype.fallback=L2.prototype.extend=!1;var Bk=class{constructor(e,A,t){this.precTable=A,this.elseToken=t,this.data=typeof e=="string"?M4(e):e}token(e,A){let t=e.pos,n=0;for(;;){let o=e.next<0,a=e.resolveOffset(1,1);if(bP(this.data,e,A,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(o||n++,a==null)break;e.reset(a,e.token)}n&&(e.reset(t,e.token),e.acceptToken(this.elseToken,n))}};Bk.prototype.contextual=L2.prototype.fallback=L2.prototype.extend=!1;function bP(i,e,A,t,n,o){let a=0,r=1<0){let u=i[B];if(s.allows(u)&&(e.token.value==-1||e.token.value==u||W2A(u,e.token.value,n,o))){e.acceptToken(u);break}}let g=e.next,C=0,d=i[a+2];if(e.next<0&&d>C&&i[l+d*3-3]==65535){a=i[l+d*3-1];continue A}for(;C>1,u=l+B+(B<<1),E=i[u],f=i[u+1]||65536;if(g=f)C=B+1;else{a=i[u+2],e.advance();continue A}}break}}function wP(i,e,A){for(let t=e,n;(n=i[t])!=65535;t++)if(n==A)return t-e;return-1}function W2A(i,e,A,t){let n=wP(A,t,e);return n<0||wP(A,t,i)e)&&!t.type.isError)return A<0?Math.max(0,Math.min(t.to-1,e-25)):Math.min(i.length,Math.max(t.from+1,e+25));if(A<0?t.prevSibling():t.nextSibling())break;if(!t.parent())return A<0?0:i.length}}var hk=class{constructor(e,A){this.fragments=e,this.nodeSet=A,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?yP(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?yP(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=a,null;if(o instanceof Pa){if(a==e){if(a=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(a),this.index.push(0))}else this.index[A]++,this.nextStart=a+o.length}}},Ek=class{constructor(e,A){this.stream=A,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(t=>new uh)}getActions(e){let A=0,t=null,{parser:n}=e.p,{tokenizers:o}=n,a=n.stateSlot(e.state,3),r=e.curContext?e.curContext.hash:0,s=0;for(let l=0;lC.end+25&&(s=Math.max(C.lookAhead,s)),C.value!=0)){let d=A;if(C.extended>-1&&(A=this.addActions(e,C.extended,C.end,A)),A=this.addActions(e,C.value,C.end,A),!g.extend&&(t=C,A>d))break}}for(;this.actions.length>A;)this.actions.pop();return s&&e.setLookAhead(s),!t&&e.pos==this.stream.end&&(t=new uh,t.value=e.p.parser.eofTerm,t.start=t.end=e.pos,A=this.addActions(e,t.value,t.end,A)),this.mainToken=t,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let A=new uh,{pos:t,p:n}=e;return A.start=t,A.end=Math.min(t+1,n.stream.end),A.value=t==n.stream.end?n.parser.eofTerm:0,A}updateCachedToken(e,A,t){let n=this.stream.clipPos(t.pos);if(A.token(this.stream.reset(n,e),t),e.value>-1){let{parser:o}=t.p;for(let a=0;a=0&&t.p.parser.dialect.allows(r>>1)){(r&1)==0?e.value=r>>1:e.extended=r>>1;break}}}else e.value=0,e.end=this.stream.clipPos(n+1)}putAction(e,A,t,n){for(let o=0;oe.bufferLength*4?new hk(t,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,A=this.minStackPos,t=this.stacks=[],n,o;if(this.bigReductionCount>300&&e.length==1){let[a]=e;for(;a.forceReduce()&&a.stack.length&&a.stack[a.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;aA)t.push(r);else{if(this.advanceStack(r,t,e))continue;{n||(n=[],o=[]),n.push(r);let s=this.tokens.getMainToken(r);o.push(s.value,s.end)}}break}}if(!t.length){let a=n&&Z2A(n);if(a)return Ll&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw Ll&&n&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+A);this.recovering||(this.recovering=5)}if(this.recovering&&n){let a=this.stoppedAt!=null&&n[0].pos>this.stoppedAt?n[0]:this.runRecovery(n,o,t);if(a)return Ll&&console.log("Force-finish "+this.stackID(a)),this.stackToTree(a.forceAll())}if(this.recovering){let a=this.recovering==1?1:this.recovering*3;if(t.length>a)for(t.sort((r,s)=>s.score-r.score);t.length>a;)t.pop();t.some(r=>r.reducePos>A)&&this.recovering--}else if(t.length>1){A:for(let a=0;a500&&l.buffer.length>500)if((r.score-l.score||r.buffer.length-l.buffer.length)>0)t.splice(s--,1);else{t.splice(a--,1);continue A}}}t.length>12&&(t.sort((a,r)=>r.score-a.score),t.splice(12,t.length-12))}this.minStackPos=t[0].pos;for(let a=1;a ":"";if(this.stoppedAt!=null&&n>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let l=e.curContext&&e.curContext.tracker.strict,g=l?e.curContext.hash:0;for(let C=this.fragments.nodeAt(n);C;){let d=this.parser.nodeSet.types[C.type.id]==C.type?o.getGoto(e.state,C.type.id):-1;if(d>-1&&C.length&&(!l||(C.prop(Hi.contextHash)||0)==g))return e.useNode(C,d),Ll&&console.log(a+this.stackID(e)+` (via reuse of ${o.getName(C.type.id)})`),!0;if(!(C instanceof Pa)||C.children.length==0||C.positions[0]>0)break;let B=C.children[0];if(B instanceof Pa&&C.positions[0]==0)C=B;else break}}let r=o.stateSlot(e.state,4);if(r>0)return e.reduce(r),Ll&&console.log(a+this.stackID(e)+` (via always-reduce ${o.getName(r&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let l=0;ln?A.push(u):t.push(u)}return!1}advanceFully(e,A){let t=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>t)return DP(e,A),!0}}runRecovery(e,A,t){let n=null,o=!1;for(let a=0;a ":"";if(r.deadEnd&&(o||(o=!0,r.restart(),Ll&&console.log(g+this.stackID(r)+" (restarted)"),this.advanceFully(r,t))))continue;let C=r.split(),d=g;for(let B=0;B<10&&C.forceReduce()&&(Ll&&console.log(d+this.stackID(C)+" (via force-reduce)"),!this.advanceFully(C,t));B++)Ll&&(d=this.stackID(C)+" -> ");for(let B of r.recoverByInsert(s))Ll&&console.log(g+this.stackID(B)+" (via recover-insert)"),this.advanceFully(B,t);this.stream.end>r.pos?(l==r.pos&&(l++,s=0),r.recoverByDelete(s,l),Ll&&console.log(g+this.stackID(r)+` (via recover-delete ${this.parser.getName(s)})`),DP(r,t)):(!n||n.scoree.topRules[r][1]),n=[];for(let r=0;r=0)o(g,s,r[l++]);else{let C=r[l+-g];for(let d=-g;d>0;d--)o(r[l++],s,C);l++}}}this.nodeSet=new B4(A.map((r,s)=>ys.define({name:s>=this.minRepeatTerm?void 0:r,id:s,props:n[s],top:t.indexOf(s)>-1,error:s==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(s)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=1024;let a=M4(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let r=0;rtypeof r=="number"?new L2(a,r):r),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,A,t){let n=new Qk(this,e,A,t);for(let o of this.wrappers)n=o(n,e,A,t);return n}getGoto(e,A,t=!1){let n=this.goto;if(A>=n[0])return-1;for(let o=n[A+1];;){let a=n[o++],r=a&1,s=n[o++];if(r&&t)return s;for(let l=o+(a>>1);o0}validAction(e,A){return!!this.allActions(e,t=>t==A?!0:null)}allActions(e,A){let t=this.stateSlot(e,4),n=t?A(t):void 0;for(let o=this.stateSlot(e,1);n==null;o+=3){if(this.data[o]==65535)if(this.data[o+1]==1)o=CC(this.data,o+2);else break;n=A(CC(this.data,o+1))}return n}nextStates(e){let A=[];for(let t=this.stateSlot(e,1);;t+=3){if(this.data[t]==65535)if(this.data[t+1]==1)t=CC(this.data,t+2);else break;if((this.data[t+2]&1)==0){let n=this.data[t+1];A.some((o,a)=>a&1&&o==n)||A.push(this.data[t],n)}}return A}configure(e){let A=Object.assign(Object.create(i.prototype),this);if(e.props&&(A.nodeSet=this.nodeSet.extend(...e.props)),e.top){let t=this.topRules[e.top];if(!t)throw new RangeError(`Invalid top rule name ${e.top}`);A.top=t}return e.tokenizers&&(A.tokenizers=this.tokenizers.map(t=>{let n=e.tokenizers.find(o=>o.from==t);return n?n.to:t})),e.specializers&&(A.specializers=this.specializers.slice(),A.specializerSpecs=this.specializerSpecs.map((t,n)=>{let o=e.specializers.find(r=>r.from==t.external);if(!o)return t;let a=Object.assign(Object.assign({},t),{external:o.to});return A.specializers[n]=vP(a),a})),e.contextTracker&&(A.context=e.contextTracker),e.dialect&&(A.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(A.strict=e.strict),e.wrap&&(A.wrappers=A.wrappers.concat(e.wrap)),e.bufferLength!=null&&(A.bufferLength=e.bufferLength),A}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let A=this.dynamicPrecedences;return A==null?0:A[e]||0}parseDialect(e){let A=Object.keys(this.dialects),t=A.map(()=>!1);if(e)for(let o of e.split(" ")){let a=A.indexOf(o);a>=0&&(t[a]=!0)}let n=null;for(let o=0;ot)&&A.p.parser.stateFlag(A.state,2)&&(!e||e.scorei.external(A,t)<<1|e}return i.get}var X2A=M8({String:Oe.string,Number:Oe.number,"True False":Oe.bool,PropertyName:Oe.propertyName,Null:Oe.null,", :":Oe.separator,"[ ]":Oe.squareBracket,"{ }":Oe.brace}),MP=z8.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"\u26A0 JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[X2A],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});var $2A=S8.define({name:"json",parser:MP.configure({props:[VS.add({Object:qS({except:/^\s*\}/}),Array:qS({except:/^\s*\]/})}),w4.add({"Object Array":lz})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function SP(){return new k8($2A)}var kP=typeof String.prototype.normalize=="function"?i=>i.normalize("NFKD"):i=>i,K2=class{constructor(e,A,t=0,n=e.length,o,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(t,n),this.bufferStart=t,this.normalize=o?r=>o(kP(r)):kP,this.query=this.normalize(A)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return $r(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let A=qu(e),t=this.bufferStart+this.bufferPos;this.bufferPos+=Rl(e);let n=this.normalize(A);if(n.length)for(let o=0,a=t;;o++){let r=n.charCodeAt(o),s=this.match(r,a,this.bufferPos+this.bufferStart);if(o==n.length-1){if(s)return this.value=s,this;break}a==t&&othis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let A=this.matchPos<=this.to&&this.re.exec(this.curLine);if(A){let t=this.curLineStart+A.index,n=t+A[0].length;if(this.matchPos=Z8(this.text,n+(t==n?1:0)),t==this.curLineStart+this.curLine.length&&this.nextLine(),(tthis.value.to)&&(!this.test||this.test(t,n,A)))return this.value={from:t,to:n,match:A},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=t||n.to<=A){let r=new i(A,e.sliceString(A,t));return pk.set(e,r),r}if(n.from==A&&n.to==t)return n;let{text:o,from:a}=n;return a>A&&(o=e.sliceString(A,a)+o,a=A),n.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,A=this.re.exec(this.flat.text);if(A&&!A[0]&&A.index==e&&(this.re.lastIndex=e+1,A=this.re.exec(this.flat.text)),A){let t=this.flat.from+A.index,n=t+A[0].length;if((this.flat.to>=this.to||A.index+A[0].length<=this.flat.text.length-10)&&(!this.test||this.test(t,n,A)))return this.value={from:t,to:n,match:A},this.matchPos=Z8(this.text,n+(t==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=q8.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<"u"&&(V8.prototype[Symbol.iterator]=W8.prototype[Symbol.iterator]=function(){return this});function A1A(i){try{return new RegExp(i,vk),!0}catch(e){return!1}}function Z8(i,e){if(e>=i.length)return e;let A=i.lineAt(e),t;for(;e=56320&&t<57344;)e++;return e}var e1A=i=>{let{state:e}=i,A=String(e.doc.lineAt(i.state.selection.main.head).number),{close:t,result:n}=GH(i,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:A},focus:!0,submitLabel:e.phrase("go")});return n.then(o=>{let a=o&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(o.elements.line.value);if(!a){i.dispatch({effects:t});return}let r=e.doc.lineAt(e.selection.main.head),[,s,l,g,C]=a,d=g?+g.slice(1):0,B=l?+l:r.number;if(l&&C){let f=B/100;s&&(f=f*(s=="-"?-1:1)+r.number/e.doc.lines),B=Math.round(e.doc.lines*f)}else l&&s&&(B=B*(s=="-"?-1:1)+r.number);let u=e.doc.line(Math.max(1,Math.min(e.doc.lines,B))),E=Be.cursor(u.from+Math.max(0,Math.min(d,u.length)));i.dispatch({effects:[t,ui.scrollIntoView(E.from,{y:"center"})],selection:E})}),!0},t1A={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},NP=nt.define({combine(i){return Lr(i,t1A,{highlightWordAroundCursor:(e,A)=>e||A,minSelectionLength:Math.min,maxMatches:Math.min})}});function FP(i){let e=[r1A,a1A];return i&&e.push(NP.of(i)),e}var i1A=Lt.mark({class:"cm-selectionMatch"}),n1A=Lt.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function _P(i,e,A,t){return(A==0||i(e.sliceDoc(A-1,A))!=$o.Word)&&(t==e.doc.length||i(e.sliceDoc(t,t+1))!=$o.Word)}function o1A(i,e,A,t){return i(e.sliceDoc(A,A+1))==$o.Word&&i(e.sliceDoc(t-1,t))==$o.Word}var a1A=Po.fromClass(class{constructor(i){this.decorations=this.getDeco(i)}update(i){(i.selectionSet||i.docChanged||i.viewportChanged)&&(this.decorations=this.getDeco(i.view))}getDeco(i){let e=i.state.facet(NP),{state:A}=i,t=A.selection;if(t.ranges.length>1)return Lt.none;let n=t.main,o,a=null;if(n.empty){if(!e.highlightWordAroundCursor)return Lt.none;let s=A.wordAt(n.head);if(!s)return Lt.none;a=A.charCategorizer(n.head),o=A.sliceDoc(s.from,s.to)}else{let s=n.to-n.from;if(s200)return Lt.none;if(e.wholeWords){if(o=A.sliceDoc(n.from,n.to),a=A.charCategorizer(n.head),!(_P(a,A,n.from,n.to)&&o1A(a,A,n.from,n.to)))return Lt.none}else if(o=A.sliceDoc(n.from,n.to),!o)return Lt.none}let r=[];for(let s of i.visibleRanges){let l=new K2(A.doc,o,s.from,s.to);for(;!l.next().done;){let{from:g,to:C}=l.value;if((!a||_P(a,A,g,C))&&(n.empty&&g<=n.from&&C>=n.to?r.push(n1A.range(g,C)):(g>=n.to||C<=n.from)&&r.push(i1A.range(g,C)),r.length>e.maxMatches))return Lt.none}}return Lt.set(r)}},{decorations:i=>i.decorations}),r1A=ui.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),s1A=({state:i,dispatch:e})=>{let{selection:A}=i,t=Be.create(A.ranges.map(n=>i.wordAt(n.head)||Be.cursor(n.head)),A.mainIndex);return t.eq(A)?!1:(e(i.update({selection:t})),!0)};function l1A(i,e){let{main:A,ranges:t}=i.selection,n=i.wordAt(A.head),o=n&&n.from==A.from&&n.to==A.to;for(let a=!1,r=new K2(i.doc,e,t[t.length-1].to);;)if(r.next(),r.done){if(a)return null;r=new K2(i.doc,e,0,Math.max(0,t[t.length-1].from-1)),a=!0}else{if(a&&t.some(s=>s.from==r.value.from))continue;if(o){let s=i.wordAt(r.value.from);if(!s||s.from!=r.value.from||s.to!=r.value.to)continue}return r.value}}var g1A=({state:i,dispatch:e})=>{let{ranges:A}=i.selection;if(A.some(o=>o.from===o.to))return s1A({state:i,dispatch:e});let t=i.sliceDoc(A[0].from,A[0].to);if(i.selection.ranges.some(o=>i.sliceDoc(o.from,o.to)!=t))return!1;let n=l1A(i,t);return n?(e(i.update({selection:i.selection.addRange(Be.range(n.from,n.to),!1),effects:ui.scrollIntoView(n.to)})),!0):!1},Fd=nt.define({combine(i){return Lr(i,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new yk(e),scrollToMatch:e=>ui.scrollIntoView(e)})}});function LP(i){return i?[Fd.of(i),Dk]:Dk}var X8=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||A1A(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(A,t)=>t=="n"?` -`:t=="r"?"\r":t=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new mk(this):new fk(this)}getCursor(e,A=0,t){let n=e.doc?e:ir.create({doc:e});return t==null&&(t=n.doc.length),this.regexp?fh(this,n,A,t):ph(this,n,A,t)}},$8=class{constructor(e){this.spec=e}};function c1A(i,e,A){return(t,n,o,a)=>{if(A&&!A(t,n,o,a))return!1;let r=t>=a&&n<=a+o.length?o.slice(t-a,n-a):e.doc.sliceString(t,n);return i(r,e,t,n)}}function ph(i,e,A,t){let n;return i.wholeWord&&(n=C1A(e.doc,e.charCategorizer(e.selection.main.head))),i.test&&(n=c1A(i.test,e,n)),new K2(e.doc,i.unquoted,A,t,i.caseSensitive?void 0:o=>o.toLowerCase(),n)}function C1A(i,e){return(A,t,n,o)=>((o>A||o+n.length=A)return null;n.push(t.value)}return n}highlight(e,A,t,n){let o=ph(this.spec,e,Math.max(0,A-this.spec.unquoted.length),Math.min(t+this.spec.unquoted.length,e.doc.length));for(;!o.next().done;)n(o.value.from,o.value.to)}};function d1A(i,e,A){return(t,n,o)=>(!A||A(t,n,o))&&i(o[0],e,t,n)}function fh(i,e,A,t){let n;return i.wholeWord&&(n=I1A(e.charCategorizer(e.selection.main.head))),i.test&&(n=d1A(i.test,e,n)),new V8(e.doc,i.search,{ignoreCase:!i.caseSensitive,test:n},A,t)}function Aw(i,e){return i.slice(tr(i,e,!1),e)}function ew(i,e){return i.slice(e,tr(i,e))}function I1A(i){return(e,A,t)=>!t[0].length||(i(Aw(t.input,t.index))!=$o.Word||i(ew(t.input,t.index))!=$o.Word)&&(i(ew(t.input,t.index+t[0].length))!=$o.Word||i(Aw(t.input,t.index+t[0].length))!=$o.Word)}var mk=class extends $8{nextMatch(e,A,t){let n=fh(this.spec,e,t,e.doc.length).next();return n.done&&(n=fh(this.spec,e,0,A).next()),n.done?null:n.value}prevMatchInRange(e,A,t){for(let n=1;;n++){let o=Math.max(A,t-n*1e4),a=fh(this.spec,e,o,t),r=null;for(;!a.next().done;)r=a.value;if(r&&(o==A||r.from>o+10))return r;if(o==A)return null}}prevMatch(e,A,t){return this.prevMatchInRange(e,0,A)||this.prevMatchInRange(e,t,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(A,t)=>{if(t=="&")return e.match[0];if(t=="$")return"$";for(let n=t.length;n>0;n--){let o=+t.slice(0,n);if(o>0&&o=A)return null;n.push(t.value)}return n}highlight(e,A,t,n){let o=fh(this.spec,e,Math.max(0,A-250),Math.min(t+250,e.doc.length));for(;!o.next().done;)n(o.value.from,o.value.to)}},k4=ln.define(),bk=ln.define(),G2=La.define({create(i){return new S4(wk(i).create(),null)},update(i,e){for(let A of e.effects)A.is(k4)?i=new S4(A.value.create(),i.panel):A.is(bk)&&(i=new S4(i.query,A.value?Mk:null));return i},provide:i=>vd.from(i,e=>e.panel)});var S4=class{constructor(e,A){this.query=e,this.panel=A}},B1A=Lt.mark({class:"cm-searchMatch"}),h1A=Lt.mark({class:"cm-searchMatch cm-searchMatch-selected"}),E1A=Po.fromClass(class{constructor(i){this.view=i,this.decorations=this.highlight(i.state.field(G2))}update(i){let e=i.state.field(G2);(e!=i.startState.field(G2)||i.docChanged||i.selectionSet||i.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:i,panel:e}){if(!e||!i.spec.valid)return Lt.none;let{view:A}=this,t=new Xr;for(let n=0,o=A.visibleRanges,a=o.length;no[n+1].from-500;)s=o[++n].to;i.highlight(A.state,r,s,(l,g)=>{let C=A.state.selection.ranges.some(d=>d.from==l&&d.to==g);t.add(l,g,C?h1A:B1A)})}return t.finish()}},{decorations:i=>i.decorations});function _4(i){return e=>{let A=e.state.field(G2,!1);return A&&A.query.spec.valid?i(e,A):nw(e)}}var tw=_4((i,{query:e})=>{let{to:A}=i.state.selection.main,t=e.nextMatch(i.state,A,A);if(!t)return!1;let n=Be.single(t.from,t.to),o=i.state.facet(Fd);return i.dispatch({selection:n,effects:[Sk(i,t),o.scrollToMatch(n.main,i)],userEvent:"select.search"}),KP(i),!0}),iw=_4((i,{query:e})=>{let{state:A}=i,{from:t}=A.selection.main,n=e.prevMatch(A,t,t);if(!n)return!1;let o=Be.single(n.from,n.to),a=i.state.facet(Fd);return i.dispatch({selection:o,effects:[Sk(i,n),a.scrollToMatch(o.main,i)],userEvent:"select.search"}),KP(i),!0}),Q1A=_4((i,{query:e})=>{let A=e.matchAll(i.state,1e3);return!A||!A.length?!1:(i.dispatch({selection:Be.create(A.map(t=>Be.range(t.from,t.to))),userEvent:"select.search.matches"}),!0)}),u1A=({state:i,dispatch:e})=>{let A=i.selection;if(A.ranges.length>1||A.main.empty)return!1;let{from:t,to:n}=A.main,o=[],a=0;for(let r=new K2(i.doc,i.sliceDoc(t,n));!r.next().done;){if(o.length>1e3)return!1;r.value.from==t&&(a=o.length),o.push(Be.range(r.value.from,r.value.to))}return e(i.update({selection:Be.create(o,a),userEvent:"select.search.matches"})),!0},xP=_4((i,{query:e})=>{let{state:A}=i,{from:t,to:n}=A.selection.main;if(A.readOnly)return!1;let o=e.nextMatch(A,t,t);if(!o)return!1;let a=o,r=[],s,l,g=[];a.from==t&&a.to==n&&(l=A.toText(e.getReplacement(a)),r.push({from:a.from,to:a.to,insert:l}),a=e.nextMatch(A,a.from,a.to),g.push(ui.announce.of(A.phrase("replaced match on line $",A.doc.lineAt(t).number)+".")));let C=i.state.changes(r);return a&&(s=Be.single(a.from,a.to).map(C),g.push(Sk(i,a)),g.push(A.facet(Fd).scrollToMatch(s.main,i))),i.dispatch({changes:C,selection:s,effects:g,userEvent:"input.replace"}),!0}),p1A=_4((i,{query:e})=>{if(i.state.readOnly)return!1;let A=e.matchAll(i.state,1e9).map(n=>{let{from:o,to:a}=n;return{from:o,to:a,insert:e.getReplacement(n)}});if(!A.length)return!1;let t=i.state.phrase("replaced $ matches",A.length)+".";return i.dispatch({changes:A,effects:ui.announce.of(t),userEvent:"input.replace.all"}),!0});function Mk(i){return i.state.facet(Fd).createPanel(i)}function wk(i,e){var A,t,n,o,a;let r=i.selection.main,s=r.empty||r.to>r.from+100?"":i.sliceDoc(r.from,r.to);if(e&&!s)return e;let l=i.facet(Fd);return new X8({search:((A=e?.literal)!==null&&A!==void 0?A:l.literal)?s:s.replace(/\n/g,"\\n"),caseSensitive:(t=e?.caseSensitive)!==null&&t!==void 0?t:l.caseSensitive,literal:(n=e?.literal)!==null&&n!==void 0?n:l.literal,regexp:(o=e?.regexp)!==null&&o!==void 0?o:l.regexp,wholeWord:(a=e?.wholeWord)!==null&&a!==void 0?a:l.wholeWord})}function GP(i){let e=d4(i,Mk);return e&&e.dom.querySelector("[main-field]")}function KP(i){let e=GP(i);e&&e==i.root.activeElement&&e.select()}var nw=i=>{let e=i.state.field(G2,!1);if(e&&e.panel){let A=GP(i);if(A&&A!=i.root.activeElement){let t=wk(i.state,e.query.spec);t.valid&&i.dispatch({effects:k4.of(t)}),A.focus(),A.select()}}else i.dispatch({effects:[bk.of(!0),e?k4.of(wk(i.state,e.query.spec)):ln.appendConfig.of(Dk)]});return!0},ow=i=>{let e=i.state.field(G2,!1);if(!e||!e.panel)return!1;let A=d4(i,Mk);return A&&A.dom.contains(i.root.activeElement)&&i.focus(),i.dispatch({effects:bk.of(!1)}),!0},UP=[{key:"Mod-f",run:nw,scope:"editor search-panel"},{key:"F3",run:tw,shift:iw,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:tw,shift:iw,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:ow,scope:"editor search-panel"},{key:"Mod-Shift-l",run:u1A},{key:"Mod-Alt-g",run:e1A},{key:"Mod-d",run:g1A,preventDefault:!0}],yk=class{constructor(e){this.view=e;let A=this.query=e.state.field(G2).query.spec;this.commit=this.commit.bind(this),this.searchField=po("input",{value:A.search,placeholder:Gl(e,"Find"),"aria-label":Gl(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=po("input",{value:A.replace,placeholder:Gl(e,"Replace"),"aria-label":Gl(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=po("input",{type:"checkbox",name:"case",form:"",checked:A.caseSensitive,onchange:this.commit}),this.reField=po("input",{type:"checkbox",name:"re",form:"",checked:A.regexp,onchange:this.commit}),this.wordField=po("input",{type:"checkbox",name:"word",form:"",checked:A.wholeWord,onchange:this.commit});function t(n,o,a){return po("button",{class:"cm-button",name:n,onclick:o,type:"button"},a)}this.dom=po("div",{onkeydown:n=>this.keydown(n),class:"cm-search"},[this.searchField,t("next",()=>tw(e),[Gl(e,"next")]),t("prev",()=>iw(e),[Gl(e,"previous")]),t("select",()=>Q1A(e),[Gl(e,"all")]),po("label",null,[this.caseField,Gl(e,"match case")]),po("label",null,[this.reField,Gl(e,"regexp")]),po("label",null,[this.wordField,Gl(e,"by word")]),...e.state.readOnly?[]:[po("br"),this.replaceField,t("replace",()=>xP(e),[Gl(e,"replace")]),t("replaceAll",()=>p1A(e),[Gl(e,"replace all")])],po("button",{name:"close",onclick:()=>ow(e),"aria-label":Gl(e,"close"),type:"button"},["\xD7"])])}commit(){let e=new X8({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:k4.of(e)}))}keydown(e){wH(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?iw:tw)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),xP(this.view))}update(e){for(let A of e.transactions)for(let t of A.effects)t.is(k4)&&!t.value.eq(this.query)&&this.setQuery(t.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Fd).top}};function Gl(i,e){return i.state.phrase(e)}var P8=30,j8=/[\s\.,:;?!]/;function Sk(i,{from:e,to:A}){let t=i.state.doc.lineAt(e),n=i.state.doc.lineAt(A).to,o=Math.max(t.from,e-P8),a=Math.min(n,A+P8),r=i.state.sliceDoc(o,a);if(o!=t.from){for(let s=0;sr.length-P8;s--)if(!j8.test(r[s-1])&&j8.test(r[s])){r=r.slice(0,s);break}}return ui.announce.of(`${i.state.phrase("current match")}. ${r} ${i.state.phrase("on line")} ${t.number}.`)}var f1A=ui.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Dk=[G2,oc.low(E1A),f1A];var rw=class{constructor(e,A,t,n){this.state=e,this.pos=A,this.explicit=t,this.view=n,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let A=Kr(this.state).resolveInner(this.pos,-1);for(;A&&e.indexOf(A.name)<0;)A=A.parent;return A?{from:A.from,to:this.pos,text:this.state.sliceDoc(A.from,this.pos),type:A.type}:null}matchBefore(e){let A=this.state.doc.lineAt(this.pos),t=Math.max(A.from,this.pos-250),n=A.text.slice(t-A.from,this.pos-A.from),o=n.search(jP(e,!1));return o<0?null:{from:t+o,to:this.pos,text:n.slice(o)}}get aborted(){return this.abortListeners==null}addEventListener(e,A,t){e=="abort"&&this.abortListeners&&(this.abortListeners.push(A),t&&t.onDocChange&&(this.abortOnDocChange=!0))}};function TP(i){let e=Object.keys(i).join(""),A=/\w/.test(e);return A&&(e=e.replace(/\w/g,"")),`[${A?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function m1A(i){let e=Object.create(null),A=Object.create(null);for(let{label:n}of i){e[n[0]]=!0;for(let o=1;otypeof n=="string"?{label:n}:n),[A,t]=e.every(n=>/^\w+$/.test(n.label))?[/\w*$/,/\w+$/]:m1A(e);return n=>{let o=n.matchBefore(t);return o||n.explicit?{from:o?o.from:n.pos,options:e,validFor:A}:null}}var sw=class{constructor(e,A,t,n){this.completion=e,this.source=A,this.match=t,this.score=n}};function Gd(i){return i.selection.main.from}function jP(i,e){var A;let{source:t}=i,n=e&&t[0]!="^",o=t[t.length-1]!="$";return!n&&!o?i:new RegExp(`${n?"^":""}(?:${t})${o?"$":""}`,(A=i.flags)!==null&&A!==void 0?A:i.ignoreCase?"i":"")}var VP=sl.define();function y1A(i,e,A,t){let{main:n}=i.selection,o=A-n.from,a=t-n.from;return $A(P({},i.changeByRange(r=>{if(r!=n&&A!=t&&i.sliceDoc(r.from+o,r.from+a)!=i.sliceDoc(A,t))return{range:r};let s=i.toText(e);return{changes:{from:r.from+o,to:t==n.from?r.to:r.from+a,insert:s},range:Be.cursor(r.from+o+s.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}var OP=new WeakMap;function D1A(i){if(!Array.isArray(i))return i;let e=OP.get(i);return e||OP.set(i,e=w1A(i)),e}var lw=ln.define(),x4=ln.define(),Rk=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let A=0;A=48&&M<=57||M>=97&&M<=122?2:M>=65&&M<=90?1:0:(x=qu(M))!=x.toLowerCase()?1:x!=x.toUpperCase()?2:0;(!v||F==1&&f||k==0&&F!=0)&&(A[C]==M||t[C]==M&&(d=!0)?a[C++]=v:a.length&&(m=!1)),k=F,v+=Rl(M)}return C==s&&a[0]==0&&m?this.result(-100+(d?-200:0),a,e):B==s&&u==0?this.ret(-200-e.length+(E==e.length?0:-100),[0,E]):r>-1?this.ret(-700-e.length,[r,r+this.pattern.length]):B==s?this.ret(-900-e.length,[u,E]):C==s?this.result(-100+(d?-200:0)+-700+(m?0:-1100),a,e):A.length==2?null:this.result((n[0]?-700:0)+-200+-1100,n,e)}result(e,A,t){let n=[],o=0;for(let a of A){let r=a+(this.astral?Rl($r(t,a)):1);o&&n[o-1]==a?n[o-1]=r:(n[o++]=a,n[o++]=r)}return this.ret(e-t.length,n)}},Nk=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:v1A,filterStrict:!1,compareCompletions:(e,A)=>(e.sortText||e.label).localeCompare(A.sortText||A.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,A)=>e&&A,closeOnBlur:(e,A)=>e&&A,icons:(e,A)=>e&&A,tooltipClass:(e,A)=>t=>JP(e(t),A(t)),optionClass:(e,A)=>t=>JP(e(t),A(t)),addToOptions:(e,A)=>e.concat(A),filterStrict:(e,A)=>e||A})}});function JP(i,e){return i?e?i+" "+e:i:e}function v1A(i,e,A,t,n,o){let a=i.textDirection==Lo.RTL,r=a,s=!1,l="top",g,C,d=e.left-n.left,B=n.right-e.right,u=t.right-t.left,E=t.bottom-t.top;if(r&&d=E||v>e.top?g=A.bottom-e.top:(l="bottom",g=e.bottom-A.top)}let f=(e.bottom-e.top)/o.offsetHeight,m=(e.right-e.left)/o.offsetWidth;return{style:`${l}: ${g/f}px; max-width: ${C/m}px`,class:"cm-completionInfo-"+(s?a?"left-narrow":"right-narrow":r?"left":"right")}}var Uk=ln.define();function b1A(i){let e=i.addToOptions.slice();return i.icons&&e.push({render(A){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),A.type&&t.classList.add(...A.type.split(/\s+/g).map(n=>"cm-completionIcon-"+n)),t.setAttribute("aria-hidden","true"),t},position:20}),e.push({render(A,t,n,o){let a=document.createElement("span");a.className="cm-completionLabel";let r=A.displayLabel||A.label,s=0;for(let l=0;ls&&a.appendChild(document.createTextNode(r.slice(s,g)));let d=a.appendChild(document.createElement("span"));d.appendChild(document.createTextNode(r.slice(g,C))),d.className="cm-completionMatchedText",s=C}return sA.position-t.position).map(A=>A.render)}function kk(i,e,A){if(i<=A)return{from:0,to:i};if(e<0&&(e=0),e<=i>>1){let n=Math.floor(e/A);return{from:n*A,to:(n+1)*A}}let t=Math.floor((i-e)/A);return{from:i-(t+1)*A,to:i-t*A}}var Fk=class{constructor(e,A,t){this.view=e,this.stateField=A,this.applyCompletion=t,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:s=>this.placeInfo(s),key:this},this.space=null,this.currentClass="";let n=e.state.field(A),{options:o,selected:a}=n.open,r=e.state.facet(Ur);this.optionContent=b1A(r),this.optionClass=r.optionClass,this.tooltipClass=r.tooltipClass,this.range=kk(o.length,a,r.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",s=>{let{options:l}=e.state.field(A).open;for(let g=s.target,C;g&&g!=this.dom;g=g.parentNode)if(g.nodeName=="LI"&&(C=/-(\d+)$/.exec(g.id))&&+C[1]this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;g!=null&&(e.dispatch({effects:Uk.of(g)}),s.preventDefault())}}),this.dom.addEventListener("focusout",s=>{let l=e.state.field(this.stateField,!1);l&&l.tooltip&&e.state.facet(Ur).closeOnBlur&&s.relatedTarget!=e.contentDOM&&e.dispatch({effects:x4.of(null)})}),this.showOptions(o,n.id)}mount(){this.updateSel()}showOptions(e,A){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,A,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var A;let t=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),t!=n){let{options:o,selected:a,disabled:r}=t.open;(!n.open||n.open.options!=o)&&(this.range=kk(o.length,a,e.state.facet(Ur).maxRenderedOptions),this.showOptions(o,t.id)),this.updateSel(),r!=((A=n.open)===null||A===void 0?void 0:A.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!r)}}updateTooltipClass(e){let A=this.tooltipClass(e);if(A!=this.currentClass){for(let t of this.currentClass.split(" "))t&&this.dom.classList.remove(t);for(let t of A.split(" "))t&&this.dom.classList.add(t);this.currentClass=A}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),A=e.open;(A.selected>-1&&A.selected=this.range.to)&&(this.range=kk(A.options.length,A.selected,this.view.state.facet(Ur).maxRenderedOptions),this.showOptions(A.options,e.id));let t=this.updateSelectedOption(A.selected);if(t){this.destroyInfo();let{completion:n}=A.options[A.selected],{info:o}=n;if(!o)return;let a=typeof o=="string"?document.createTextNode(o):o(n);if(!a)return;"then"in a?a.then(r=>{r&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(r,n)}).catch(r=>Gr(this.view.state,r,"completion info")):(this.addInfoPane(a,n),t.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,A){this.destroyInfo();let t=this.info=document.createElement("div");if(t.className="cm-tooltip cm-completionInfo",t.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)t.appendChild(e),this.infoDestroy=null;else{let{dom:n,destroy:o}=e;t.appendChild(n),this.infoDestroy=o||null}this.dom.appendChild(t),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let A=null;for(let t=this.list.firstChild,n=this.range.from;t;t=t.nextSibling,n++)t.nodeName!="LI"||!t.id?n--:n==e?t.hasAttribute("aria-selected")||(t.setAttribute("aria-selected","true"),A=t):t.hasAttribute("aria-selected")&&(t.removeAttribute("aria-selected"),t.removeAttribute("aria-describedby"));return A&&S1A(this.list,A),A}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let A=this.dom.getBoundingClientRect(),t=this.info.getBoundingClientRect(),n=e.getBoundingClientRect(),o=this.space;if(!o){let a=this.dom.ownerDocument.documentElement;o={left:0,top:0,right:a.clientWidth,bottom:a.clientHeight}}return n.top>Math.min(o.bottom,A.bottom)-10||n.bottom{a.target==n&&a.preventDefault()});let o=null;for(let a=t.from;at.from||t.from==0))if(o=d,typeof l!="string"&&l.header)n.appendChild(l.header(l));else{let B=n.appendChild(document.createElement("completion-section"));B.textContent=d}}let g=n.appendChild(document.createElement("li"));g.id=A+"-"+a,g.setAttribute("role","option");let C=this.optionClass(r);C&&(g.className=C);for(let d of this.optionContent){let B=d(r,this.view.state,this.view,s);B&&g.appendChild(B)}}return t.from&&n.classList.add("cm-completionListIncompleteTop"),t.tonew Fk(A,i,e)}function S1A(i,e){let A=i.getBoundingClientRect(),t=e.getBoundingClientRect(),n=A.height/i.offsetHeight;t.topA.bottom&&(i.scrollTop+=(t.bottom-A.bottom)/n)}function YP(i){return(i.boost||0)*100+(i.apply?10:0)+(i.info?5:0)+(i.type?1:0)}function k1A(i,e){let A=[],t=null,n=null,o=g=>{A.push(g);let{section:C}=g.completion;if(C){t||(t=[]);let d=typeof C=="string"?C:C.name;t.some(B=>B.name==d)||t.push(typeof C=="string"?{name:d}:C)}},a=e.facet(Ur);for(let g of i)if(g.hasResult()){let C=g.result.getMatch;if(g.result.filter===!1)for(let d of g.result.options)o(new sw(d,g.source,C?C(d):[],1e9-A.length));else{let d=e.sliceDoc(g.from,g.to),B,u=a.filterStrict?new Nk(d):new Rk(d);for(let E of g.result.options)if(B=u.match(E.label)){let f=E.displayLabel?C?C(E,B.matched):[]:B.matched,m=B.score+(E.boost||0);if(o(new sw(E,g.source,f,m)),typeof E.section=="object"&&E.section.rank==="dynamic"){let{name:v}=E.section;n||(n=Object.create(null)),n[v]=Math.max(m,n[v]||-1e9)}}}}if(t){let g=Object.create(null),C=0,d=(B,u)=>(B.rank==="dynamic"&&u.rank==="dynamic"?n[u.name]-n[B.name]:0)||(typeof B.rank=="number"?B.rank:1e9)-(typeof u.rank=="number"?u.rank:1e9)||(B.named.score-C.score||l(C.completion,d.completion))){let C=g.completion;!s||s.label!=C.label||s.detail!=C.detail||s.type!=null&&C.type!=null&&s.type!=C.type||s.apply!=C.apply||s.boost!=C.boost?r.push(g):YP(g.completion)>YP(s)&&(r[r.length-1]=g),s=g.completion}return r}var Lk=class i{constructor(e,A,t,n,o,a){this.options=e,this.attrs=A,this.tooltip=t,this.timestamp=n,this.selected=o,this.disabled=a}setSelected(e,A){return e==this.selected||e>=this.options.length?this:new i(this.options,HP(A,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,A,t,n,o,a){if(n&&!a&&e.some(l=>l.isPending))return n.setDisabled();let r=k1A(e,A);if(!r.length)return n&&e.some(l=>l.isPending)?n.setDisabled():null;let s=A.facet(Ur).selectOnOpen?0:-1;if(n&&n.selected!=s&&n.selected!=-1){let l=n.options[n.selected].completion;for(let g=0;gg.hasResult()?Math.min(l,g.from):l,1e8),create:L1A,above:o.aboveCursor},n?n.timestamp:Date.now(),s,!1)}map(e){return new i(this.options,this.attrs,$A(P({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new i(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},Gk=class i{constructor(e,A,t){this.active=e,this.id=A,this.open=t}static start(){return new i(N1A,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:A}=e,t=A.facet(Ur),o=(t.override||A.languageDataAt("autocomplete",Gd(A)).map(D1A)).map(s=>(this.active.find(g=>g.source==s)||new dC(s,this.active.some(g=>g.state!=0)?1:0)).update(e,t));o.length==this.active.length&&o.every((s,l)=>s==this.active[l])&&(o=this.active);let a=this.open,r=e.effects.some(s=>s.is(Tk));a&&e.docChanged&&(a=a.map(e.changes)),e.selection||o.some(s=>s.hasResult()&&e.changes.touchesRange(s.from,s.to))||!_1A(o,this.active)||r?a=Lk.build(o,A,this.id,a,t,r):a&&a.disabled&&!o.some(s=>s.isPending)&&(a=null),!a&&o.every(s=>!s.isPending)&&o.some(s=>s.hasResult())&&(o=o.map(s=>s.hasResult()?new dC(s.source,0):s));for(let s of e.effects)s.is(Uk)&&(a=a&&a.setSelected(s.value,this.id));return o==this.active&&a==this.open?this:new i(o,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?x1A:R1A}};function _1A(i,e){if(i==e)return!0;for(let A=0,t=0;;){for(;A-1&&(A["aria-activedescendant"]=i+"-"+e),A}var N1A=[];function qP(i,e){if(i.isUserEvent("input.complete")){let t=i.annotation(VP);if(t&&e.activateOnCompletion(t))return 12}let A=i.isUserEvent("input.type");return A&&e.activateOnTyping?5:A?1:i.isUserEvent("delete.backward")?2:i.selection?8:i.docChanged?16:0}var dC=class i{constructor(e,A,t=!1){this.source=e,this.state=A,this.explicit=t}hasResult(){return!1}get isPending(){return this.state==1}update(e,A){let t=qP(e,A),n=this;(t&8||t&16&&this.touches(e))&&(n=new i(n.source,0)),t&4&&n.state==0&&(n=new i(this.source,1)),n=n.updateFor(e,t);for(let o of e.effects)if(o.is(lw))n=new i(n.source,1,o.value);else if(o.is(x4))n=new i(n.source,0);else if(o.is(Tk))for(let a of o.value)a.source==n.source&&(n=a);return n}updateFor(e,A){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(Gd(e.state))}},gw=class i extends dC{constructor(e,A,t,n,o,a){super(e,3,A),this.limit=t,this.result=n,this.from=o,this.to=a}hasResult(){return!0}updateFor(e,A){var t;if(!(A&3))return this.map(e.changes);let n=this.result;n.map&&!e.changes.empty&&(n=n.map(n,e.changes));let o=e.changes.mapPos(this.from),a=e.changes.mapPos(this.to,1),r=Gd(e.state);if(r>a||!n||A&2&&(Gd(e.startState)==this.from||rA.map(e))}}),dl=La.define({create(){return Gk.start()},update(i,e){return i.update(e)},provide:i=>[ch.from(i,e=>e.tooltip),ui.contentAttributes.from(i,e=>e.attrs)]});function Ok(i,e){let A=e.completion.apply||e.completion.label,t=i.state.field(dl).active.find(n=>n.source==e.source);return t instanceof gw?(typeof A=="string"?i.dispatch($A(P({},y1A(i.state,A,t.from,t.to)),{annotations:VP.of(e.completion)})):A(i,e.completion,t.from,t.to),!0):!1}var L1A=M1A(dl,Ok);function aw(i,e="option"){return A=>{let t=A.state.field(dl,!1);if(!t||!t.open||t.open.disabled||Date.now()-t.open.timestamp-1?t.open.selected+n*(i?1:-1):i?0:a-1;return r<0?r=e=="page"?0:a-1:r>=a&&(r=e=="page"?a-1:0),A.dispatch({effects:Uk.of(r)}),!0}}var G1A=i=>{let e=i.state.field(dl,!1);return i.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampi.state.field(dl,!1)?(i.dispatch({effects:lw.of(!0)}),!0):!1,K1A=i=>{let e=i.state.field(dl,!1);return!e||!e.active.some(A=>A.state!=0)?!1:(i.dispatch({effects:x4.of(null)}),!0)},Kk=class{constructor(e,A){this.active=e,this.context=A,this.time=Date.now(),this.updates=[],this.done=void 0}},U1A=50,T1A=1e3,O1A=Po.fromClass(class{constructor(i){this.view=i,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of i.state.field(dl).active)e.isPending&&this.startQuery(e)}update(i){let e=i.state.field(dl),A=i.state.facet(Ur);if(!i.selectionSet&&!i.docChanged&&i.startState.field(dl)==e)return;let t=i.transactions.some(o=>{let a=qP(o,A);return a&8||(o.selection||o.docChanged)&&!(a&3)});for(let o=0;oU1A&&Date.now()-a.time>T1A){for(let r of a.context.abortListeners)try{r()}catch(s){Gr(this.view.state,s)}a.context.abortListeners=null,this.running.splice(o--,1)}else a.updates.push(...i.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),i.transactions.some(o=>o.effects.some(a=>a.is(lw)))&&(this.pendingStart=!0);let n=this.pendingStart?50:A.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(o=>o.isPending&&!this.running.some(a=>a.active.source==o.source))?setTimeout(()=>this.startUpdate(),n):-1,this.composing!=0)for(let o of i.transactions)o.isUserEvent("input.type")?this.composing=2:this.composing==2&&o.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:i}=this.view,e=i.field(dl);for(let A of e.active)A.isPending&&!this.running.some(t=>t.active.source==A.source)&&this.startQuery(A);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ur).updateSyncTime))}startQuery(i){let{state:e}=this.view,A=Gd(e),t=new rw(e,A,i.explicit,this.view),n=new Kk(i,t);this.running.push(n),Promise.resolve(i.source(t)).then(o=>{n.context.aborted||(n.done=o||null,this.scheduleAccept())},o=>{this.view.dispatch({effects:x4.of(null)}),Gr(this.view.state,o)})}scheduleAccept(){this.running.every(i=>i.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ur).updateSyncTime))}accept(){var i;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],A=this.view.state.facet(Ur),t=this.view.state.field(dl);for(let n=0;nr.source==o.active.source);if(a&&a.isPending)if(o.done==null){let r=new dC(o.active.source,0);for(let s of o.updates)r=r.update(s,A);r.isPending||e.push(r)}else this.startQuery(a)}(e.length||t.open&&t.open.disabled)&&this.view.dispatch({effects:Tk.of(e)})}},{eventHandlers:{blur(i){let e=this.view.state.field(dl,!1);if(e&&e.tooltip&&this.view.state.facet(Ur).closeOnBlur){let A=e.open&&wS(this.view,e.open.tooltip);(!A||!A.dom.contains(i.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:x4.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:lw.of(!1)}),20),this.composing=0}}}),J1A=typeof navigator=="object"&&/Win/.test(navigator.platform),Y1A=oc.highest(ui.domEventHandlers({keydown(i,e){let A=e.state.field(dl,!1);if(!A||!A.open||A.open.disabled||A.open.selected<0||i.key.length>1||i.ctrlKey&&!(J1A&&i.altKey)||i.metaKey)return!1;let t=A.open.options[A.open.selected],n=A.active.find(a=>a.source==t.source),o=t.completion.commitCharacters||n.result.commitCharacters;return o&&o.indexOf(i.key)>-1&&Ok(e,t),!1}})),H1A=ui.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xB7\xB7\xB7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25CB'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25CC'"}},".cm-completionIcon-variable":{"&:after":{content:"'\u{1D465}'"}},".cm-completionIcon-constant":{"&:after":{content:"'\u{1D436}'"}},".cm-completionIcon-type":{"&:after":{content:"'\u{1D461}'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222A'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25A1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\u{1F511}\uFE0E'"}},".cm-completionIcon-namespace":{"&:after":{content:"'\u25A2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});var R4={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Ld=ln.define({map(i,e){let A=e.mapPos(i,-1,Wr.TrackAfter);return A??void 0}}),Jk=new class extends cg{};Jk.startSide=1;Jk.endSide=-1;var WP=La.define({create(){return uo.empty},update(i,e){if(i=i.map(e.changes),e.selection){let A=e.state.doc.lineAt(e.selection.main.head);i=i.update({filter:t=>t>=A.from&&t<=A.to})}for(let A of e.effects)A.is(Ld)&&(i=i.update({add:[Jk.range(A.value,A.value+1)]}));return i}});function ZP(){return[P1A,WP]}var xk="()[]{}<>\xAB\xBB\xBB\xAB\uFF3B\uFF3D\uFF5B\uFF5D";function XP(i){for(let e=0;e{if((z1A?i.composing:i.compositionStarted)||i.state.readOnly)return!1;let n=i.state.selection.main;if(t.length>2||t.length==2&&Rl($r(t,0))==1||e!=n.from||A!=n.to)return!1;let o=V1A(i.state,t);return o?(i.dispatch(o),!0):!1}),j1A=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=$P(i,i.selection.main.head).brackets||R4.brackets,n=null,o=i.changeByRange(a=>{if(a.empty){let r=q1A(i.doc,a.head);for(let s of t)if(s==r&&cw(i.doc,a.head)==XP($r(s,0)))return{changes:{from:a.head-s.length,to:a.head+s.length},range:Be.cursor(a.head-s.length)}}return{range:n=a}});return n||e(i.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!n},Aj=[{key:"Backspace",run:j1A}];function V1A(i,e){let A=$P(i,i.selection.main.head),t=A.brackets||R4.brackets;for(let n of t){let o=XP($r(n,0));if(e==n)return o==n?X1A(i,n,t.indexOf(n+n+n)>-1,A):W1A(i,n,o,A.before||R4.before);if(e==o&&ej(i,i.selection.main.from))return Z1A(i,n,o)}return null}function ej(i,e){let A=!1;return i.field(WP).between(0,i.doc.length,t=>{t==e&&(A=!0)}),A}function cw(i,e){let A=i.sliceString(e,e+2);return A.slice(0,Rl($r(A,0)))}function q1A(i,e){let A=i.sliceString(e-2,e);return Rl($r(A,0))==A.length?A:A.slice(1)}function W1A(i,e,A,t){let n=null,o=i.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:A,from:a.to}],effects:Ld.of(a.to+e.length),range:Be.range(a.anchor+e.length,a.head+e.length)};let r=cw(i.doc,a.head);return!r||/\s/.test(r)||t.indexOf(r)>-1?{changes:{insert:e+A,from:a.head},effects:Ld.of(a.head+e.length),range:Be.cursor(a.head+e.length)}:{range:n=a}});return n?null:i.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Z1A(i,e,A){let t=null,n=i.changeByRange(o=>o.empty&&cw(i.doc,o.head)==A?{changes:{from:o.head,to:o.head+A.length,insert:A},range:Be.cursor(o.head+A.length)}:t={range:o});return t?null:i.update(n,{scrollIntoView:!0,userEvent:"input.type"})}function X1A(i,e,A,t){let n=t.stringPrefixes||R4.stringPrefixes,o=null,a=i.changeByRange(r=>{if(!r.empty)return{changes:[{insert:e,from:r.from},{insert:e,from:r.to}],effects:Ld.of(r.to+e.length),range:Be.range(r.anchor+e.length,r.head+e.length)};let s=r.head,l=cw(i.doc,s),g;if(l==e){if(zP(i,s))return{changes:{insert:e+e,from:s},effects:Ld.of(s+e.length),range:Be.cursor(s+e.length)};if(ej(i,s)){let d=A&&i.sliceDoc(s,s+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:s,to:s+d.length,insert:d},range:Be.cursor(s+d.length)}}}else{if(A&&i.sliceDoc(s-2*e.length,s)==e+e&&(g=PP(i,s-2*e.length,n))>-1&&zP(i,g))return{changes:{insert:e+e+e+e,from:s},effects:Ld.of(s+e.length),range:Be.cursor(s+e.length)};if(i.charCategorizer(s)(l)!=$o.Word&&PP(i,s,n)>-1&&!$1A(i,s,e,n))return{changes:{insert:e+e,from:s},effects:Ld.of(s+e.length),range:Be.cursor(s+e.length)}}return{range:o=r}});return o?null:i.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function zP(i,e){let A=Kr(i).resolveInner(e+1);return A.parent&&A.from==e}function $1A(i,e,A,t){let n=Kr(i).resolveInner(e,-1),o=t.reduce((a,r)=>Math.max(a,r.length),0);for(let a=0;a<5;a++){let r=i.sliceDoc(n.from,Math.min(n.to,n.from+A.length+o)),s=r.indexOf(A);if(!s||s>-1&&t.indexOf(r.slice(0,s))>-1){let g=n.firstChild;for(;g&&g.from==n.from&&g.to-g.from>A.length+s;){if(i.sliceDoc(g.to-A.length,g.to)==A)return!1;g=g.firstChild}return!0}let l=n.to==e&&n.parent;if(!l)break;n=l}return!1}function PP(i,e,A){let t=i.charCategorizer(e);if(t(i.sliceDoc(e-1,e))!=$o.Word)return e;for(let n of A){let o=e-n.length;if(i.sliceDoc(o,e)==n&&t(i.sliceDoc(o-1,o))!=$o.Word)return o}return-1}function tj(i={}){return[Y1A,dl,Ur.of(i),O1A,AdA,H1A]}var Yk=[{key:"Ctrl-Space",run:_k},{mac:"Alt-`",run:_k},{mac:"Alt-i",run:_k},{key:"Escape",run:K1A},{key:"ArrowDown",run:aw(!0)},{key:"ArrowUp",run:aw(!1)},{key:"PageDown",run:aw(!0,"page")},{key:"PageUp",run:aw(!1,"page")},{key:"Enter",run:G1A}],AdA=oc.highest(gh.computeN([Ur],i=>i.facet(Ur).defaultKeymap?[Yk]:[]));function edA(i,e=i.state){let A=new Set;for(let{from:t,to:n}of i.visibleRanges){let o=t;for(;o<=n;){let a=e.doc.lineAt(o);A.has(a)||A.add(a),o=a.to+1}}return A}function Hk(i){let e=i.selection.main.head;return i.doc.lineAt(e)}function ij(i,e){let A=0;A:for(let t=0;t=o.level&&this.markerType!=="codeOnly"?this.set(e,0,n.level):n.empty&&n.level===0&&o.level!==0?this.set(e,0,0):o.level>n.level?this.set(e,0,n.level+1):this.set(e,0,o.level)}let A=ij(e.text,this.state.tabSize),t=Math.floor(A/this.unitWidth);return this.set(e,A,t)}closestNonEmpty(e,A){let t=e.number+A;for(;A===-1?t>=1:t<=this.state.doc.lines;){if(this.has(t)){let a=this.get(t);if(!a.empty)return a}let o=this.state.doc.line(t);if(o.text.trim().length){let a=ij(o.text,this.state.tabSize),r=Math.floor(a/this.unitWidth);return this.set(o,a,r)}t+=A}let n=this.state.doc.line(A===-1?1:this.state.doc.lines);return this.set(n,0,0)}findAndSetActiveLines(){let e=Hk(this.state);if(!this.has(e))return;let A=this.get(e);if(this.has(A.line.number+1)){let o=this.get(A.line.number+1);o.level>A.level&&(A=o)}if(this.has(A.line.number-1)){let o=this.get(A.line.number-1);o.level>A.level&&(A=o)}if(A.level===0)return;A.active=A.level;let t,n;for(t=A.line.number;t>1;t--){if(!this.has(t-1))continue;let o=this.get(t-1);if(o.level0&&s.push(Cw("--indent-marker-bg-color",t,e,r,l)),s.push(Cw("--indent-marker-active-bg-color",n,e,a-1,1)),a!==o&&s.push(Cw("--indent-marker-bg-color",t,e,a,o-a))}else s.push(Cw("--indent-marker-bg-color",t,e,r,o-r));return s.join(",")}var Pk=class{constructor(e){this.view=e,this.unitWidth=Cc(e.state),this.currentLineNumber=Hk(e.state).number,this.generate(e.state)}update(e){let A=Cc(e.state),t=A!==this.unitWidth;t&&(this.unitWidth=A);let n=Hk(e.state).number,o=n!==this.currentLineNumber;this.currentLineNumber=n;let a=e.state.facet(dw).highlightActiveBlock&&o;(e.docChanged||e.viewportChanged||t||a)&&this.generate(e.state)}generate(e){let A=new Xr,t=edA(this.view,e),{hideFirstIndent:n,markerType:o,thickness:a,activeThickness:r}=e.facet(dw),s=new zk(t,e,this.unitWidth,o);for(let l of t){let g=s.get(l.number);if(!g?.level)continue;let C=idA(g,this.unitWidth,n,a,r);A.add(l.from,l.from,Lt.line({class:"cm-indent-markers",attributes:{style:`--indent-markers: ${C}`}}))}this.decorations=A.finish()}};function nj(i={}){return[dw.of(i),tdA(i.colors),Po.fromClass(Pk,{decorations:e=>e.decorations})]}var ndA=["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"],odA=["mainAxis","crossAxis","limiter"];function mV(i,e){if(i==null)return{};var A,t,n=(function(a,r){if(a==null)return{};var s={};for(var l in a)if({}.hasOwnProperty.call(a,l)){if(r.indexOf(l)!==-1)continue;s[l]=a[l]}return s})(i,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(i);for(t=0;t{};function ddA(i){return i()}function f_(i){for(var e=0;e{i=A,e=t}),resolve:i,reject:e}}var IdA=1<<24,oE=16,s5=32,MV=64,tx=128,fc=512,ts=1024,mc=2048,_C=4096,w0=8192,aE=16384,ix=32768,Zd=65536,BdA=1<<17,SV=1<<18,kV=1<<19,hC=1<<25,Ow=32768,m_=1<<21,$2=1<<23,y0=Symbol("$state"),_V=Symbol("legacy props"),hdA=Symbol(""),Rh=new class extends Error{constructor(){super(...arguments),u0(this,"name","StaleReactionError"),u0(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function sp(i){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function xV(i){return i===this.v}function RV(i,e){return i!=i?e==e:i!==e||i!==null&&typeof i=="object"||typeof i=="function"}function NV(i){return!RV(i,this.v)}var Mo=null;function Ph(i){Mo=i}function s1(i){return FV().get(i)}function Jt(i){Mo={p:Mo,i:!1,c:null,e:null,s:i,x:null,l:nE&&!(arguments.length>1&&arguments[1]!==void 0&&arguments[1])?{s:null,u:null,$:[]}:null}}function Yt(i){var e=Mo,A=e.e;if(A!==null)for(var t of(e.e=null,A))XV(t);return i!==void 0&&(e.x=i),e.i=!0,Mo=e.p,i??{}}function rE(){return!nE||Mo!==null&&Mo.l===null}function FV(i){var e,A;return Mo===null&&sp(),(A=(e=Mo).c)!==null&&A!==void 0?A:e.c=new Map((function(t){for(var n=t.p;n!==null;){var o=n.c;if(o!==null)return o;n=n.p}return null})(Mo)||void 0)}var zd=[];function LV(){var i=zd;zd=[],f_(i)}function Xd(i){if(zd.length===0&&!z4){var e=zd;queueMicrotask(()=>{e===zd&&LV()})}zd.push(i)}function EdA(){for(;zd.length>0;)LV()}function GV(i){var e=co;if(e===null)return go.f|=$2,i;if((e.f&ix)===0){if((e.f&tx)===0)throw i;e.b.error(i)}else jh(i,e)}function jh(i,e){for(;e!==null;){if((e.f&tx)!==0)try{return void e.b.error(i)}catch(A){i=A}e=e.parent}throw i}var Rw=new Set,ea=null,H4=null,mg=null,fg=[],l5=null,w_=!1,z4=!1,Jw=new WeakMap,Iw=new WeakMap,Od=new WeakMap,Jd=new WeakMap,Bw=new WeakMap,Nw=new WeakMap,Fw=new WeakMap,Ul=new WeakSet,$d=class i{constructor(){wV(this,Ul),u0(this,"committed",!1),u0(this,"current",new Map),u0(this,"previous",new Map),Go(this,Jw,new Set),Go(this,Iw,new Set),Go(this,Od,0),Go(this,Jd,0),Go(this,Bw,null),Go(this,Nw,[]),Go(this,Fw,[]),u0(this,"skipped_effects",new Set),u0(this,"is_fork",!1)}is_deferred(){return this.is_fork||xe(Jd,this)>0}process(e){fg=[],H4=null,this.apply();var A,t={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(var n of e)or(Ul,this,KV).call(this,n,t);this.is_fork||or(Ul,this,QdA).call(this),this.is_deferred()?(or(Ul,this,Uh).call(this,t.effects),or(Ul,this,Uh).call(this,t.render_effects),or(Ul,this,Uh).call(this,t.block_effects)):(H4=this,ea=null,gj(t.render_effects),gj(t.effects),H4=null,(A=xe(Bw,this))===null||A===void 0||A.resolve()),mg=null}capture(e,A){var t;this.previous.has(e)||this.previous.set(e,A),(e.f&$2)===0&&(this.current.set(e,e.v),(t=mg)===null||t===void 0||t.set(e,e.v))}activate(){ea=this,this.apply()}deactivate(){ea===this&&(ea=null,mg=null)}flush(){if(this.activate(),fg.length>0){if(TV(),ea!==null&&ea!==this)return}else xe(Od,this)===0&&this.process([]);this.deactivate()}discard(){for(var e of xe(Iw,this))e(this);xe(Iw,this).clear()}increment(e){vn(Od,this,xe(Od,this)+1),e&&vn(Jd,this,xe(Jd,this)+1)}decrement(e){vn(Od,this,xe(Od,this)-1),e&&vn(Jd,this,xe(Jd,this)-1),this.revive()}revive(){for(var e of xe(Nw,this))ns(e,mc),AI(e);for(var A of xe(Fw,this))ns(A,_C),AI(A);vn(Nw,this,[]),vn(Fw,this,[]),this.flush()}oncommit(e){xe(Jw,this).add(e)}ondiscard(e){xe(Iw,this).add(e)}settled(){var e;return((e=xe(Bw,this))!==null&&e!==void 0?e:vn(Bw,this,bV())).promise}static ensure(){if(ea===null){var e=ea=new i;Rw.add(ea),z4||i.enqueue(()=>{ea===e&&e.flush()})}return ea}static enqueue(e){Xd(e)}apply(){}};function KV(i,e){i.f^=ts;for(var A=i.first;A!==null;){var t,n=A.f,o=!!(96&n),a=o&&(n&ts)!==0||(n&w0)!==0||this.skipped_effects.has(A);if((A.f&tx)!==0&&(t=A.b)!==null&&t!==void 0&&t.is_pending()&&(e={parent:e,effect:A,effects:[],render_effects:[],block_effects:[]}),!a&&A.fn!==null){o?A.f^=ts:4&n?e.effects.push(A):gE(A)&&((A.f&oE)!==0&&e.block_effects.push(A),Wh(A));var r=A.first;if(r!==null){A=r;continue}}var s=A.parent;for(A=A.next;A===null&&s!==null;)s===e.effect&&(or(Ul,this,Uh).call(this,e.effects),or(Ul,this,Uh).call(this,e.render_effects),or(Ul,this,Uh).call(this,e.block_effects),e=e.parent),A=s.next,s=s.parent}}function Uh(i){for(var e of i)((e.f&mc)!==0?xe(Nw,this):xe(Fw,this)).push(e),or(Ul,this,UV).call(this,e.deps),ns(e,ts)}function UV(i){if(i!==null)for(var e of i)2&e.f&&(e.f&Ow)!==0&&(e.f^=Ow,or(Ul,this,UV).call(this,e.deps))}function QdA(){if(xe(Jd,this)===0){for(var i of xe(Jw,this))i();xe(Jw,this).clear()}xe(Od,this)===0&&or(Ul,this,udA).call(this)}function udA(){if(Rw.size>1){this.previous.clear();var i=mg,e=!0,A={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(var t of Rw)if(t!==this){var n=[];for(var[o,a]of this.current){if(t.current.has(o)){if(!e||a===t.current.get(o))continue;t.current.set(o,a)}n.push(o)}if(n.length!==0){var r=[...t.current.keys()].filter(B=>!this.current.has(B));if(r.length>0){var s=fg;fg=[];var l=new Set,g=new Map;for(var C of n)OV(C,r,l,g);if(fg.length>0){for(var d of(ea=t,t.apply(),fg))or(Ul,t,KV).call(t,d,A);t.deactivate()}fg=s}}}else e=!1;ea=null,mg=i}this.committed=!0,Rw.delete(this)}function jo(i){var e=z4;z4=!0;try{for(;;){var A;if(EdA(),fg.length===0&&((A=ea)===null||A===void 0||A.flush(),fg.length===0))return void(l5=null);TV()}}finally{z4=e}}function TV(){var i=jd;w_=!0;try{var e=0;for(Yw(!0);fg.length>0;){var A=$d.ensure();e++>1e3&&pdA(),A.process(fg),A1.clear()}}finally{w_=!1,Yw(i),l5=null}}function pdA(){try{(function(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")})()}catch(i){jh(i,l5)}}var QC=null;function gj(i){var e=i.length;if(e!==0){for(var A=0;A0)){for(var o of(A1.clear(),QC))if(!(24576&o.f)){for(var a=[o],r=o.parent;r!==null;)QC.has(r)&&(QC.delete(r),a.push(r)),r=r.parent;for(var s=a.length-1;s>=0;s--){var l=a[s];24576&l.f||Wh(l)}}QC.clear()}}QC=null}}function OV(i,e,A,t){if(!A.has(i)&&(A.add(i),i.reactions!==null))for(var n of i.reactions){var o=n.f;2&o?OV(n,e,A,t):4194320&o&&(o&mc)===0&&JV(n,e,t)&&(ns(n,mc),AI(n))}}function JV(i,e,A){var t=A.get(i);if(t!==void 0)return t;if(i.deps!==null)for(var n of i.deps){if(e.includes(n))return!0;if(2&n.f&&JV(n,e,A))return A.set(n,!0),!0}return A.set(i,!1),!1}function AI(i){for(var e=l5=i;e.parent!==null;){var A=(e=e.parent).f;if(w_&&e===co&&(A&oE)!==0&&(A&SV)===0)return;if(96&A){if((A&ts)===0)return;e.f^=ts}}fg.push(e)}var H2=new WeakMap,q2=new WeakMap,fdA=new WeakMap,Yd=new WeakMap,qk=new WeakMap,V2=new WeakMap,z2=new WeakMap,fC=new WeakMap,U2=new WeakMap,Pd=new WeakMap,Th=new WeakMap,mh=new WeakMap,Oh=new WeakMap,F4=new WeakMap,wh=new WeakMap,cj=new WeakMap,O2=new WeakSet,y_=class{constructor(e,A,t){var n,o,a,r;wV(this,O2),u0(this,"parent",void 0),Go(this,H2,!1),Go(this,q2,void 0),Go(this,fdA,null),Go(this,Yd,void 0),Go(this,qk,void 0),Go(this,V2,void 0),Go(this,z2,null),Go(this,fC,null),Go(this,U2,null),Go(this,Pd,null),Go(this,Th,null),Go(this,mh,0),Go(this,Oh,0),Go(this,F4,!1),Go(this,wh,null),Go(this,cj,(n=()=>(vn(wh,this,xC(xe(mh,this))),()=>{vn(wh,this,null)}),a=0,r=xC(0),()=>{j4()&&(c(r),sE(()=>(a===0&&(o=uA(()=>n(()=>P4(r)))),a+=1,()=>{Xd(()=>{var s;(a-=1)==0&&((s=o)===null||s===void 0||s(),o=void 0,P4(r))})})))})),vn(q2,this,e),vn(Yd,this,A),vn(qk,this,t),this.parent=co.b,vn(H2,this,!!xe(Yd,this).pending),vn(V2,this,lE(()=>{co.b=this;var s=or(O2,this,mdA).call(this);try{vn(z2,this,D0(()=>t(s)))}catch(l){this.error(l)}return xe(Oh,this)>0?or(O2,this,dj).call(this):vn(H2,this,!1),()=>{var l;(l=xe(Th,this))===null||l===void 0||l.remove()}},589952))}is_pending(){return xe(H2,this)||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!xe(Yd,this).pending}update_pending_count(e){or(O2,this,YV).call(this,e),vn(mh,this,xe(mh,this)+e),xe(wh,this)&&Vh(xe(wh,this),xe(mh,this))}get_effect_pending(){return xe(cj,this).call(this),c(xe(wh,this))}error(e){var A=xe(Yd,this).onerror,t=xe(Yd,this).failed;if(xe(F4,this)||!A&&!t)throw e;xe(z2,this)&&(is(xe(z2,this)),vn(z2,this,null)),xe(fC,this)&&(is(xe(fC,this)),vn(fC,this,null)),xe(U2,this)&&(is(xe(U2,this)),vn(U2,this,null));var n=!1,o=!1,a=()=>{n?console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"):(n=!0,o&&(function(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")})(),$d.ensure(),vn(mh,this,0),xe(U2,this)!==null&&qh(xe(U2,this),()=>{vn(U2,this,null)}),vn(H2,this,this.has_pending_snippet()),vn(z2,this,or(O2,this,Cj).call(this,()=>(vn(F4,this,!1),D0(()=>xe(qk,this).call(this,xe(q2,this)))))),xe(Oh,this)>0?or(O2,this,dj).call(this):vn(H2,this,!1))},r=go;try{Ql(null),o=!0,A?.(e,a),o=!1}catch(s){jh(s,xe(V2,this)&&xe(V2,this).parent)}finally{Ql(r)}t&&Xd(()=>{vn(U2,this,or(O2,this,Cj).call(this,()=>{$d.ensure(),vn(F4,this,!0);try{return D0(()=>{t(xe(q2,this),()=>e,()=>a)})}catch(s){return jh(s,xe(V2,this).parent),null}finally{vn(F4,this,!1)}}))})}};function mdA(){var i=xe(q2,this);return xe(H2,this)&&(vn(Th,this,e1()),xe(q2,this).before(xe(Th,this)),i=xe(Th,this)),i}function Cj(i){var e=co,A=go,t=Mo;yg(xe(V2,this)),Ql(xe(V2,this)),Ph(xe(V2,this).ctx);try{return i()}catch(n){return GV(n),null}finally{yg(e),Ql(A),Ph(t)}}function dj(){var i=xe(Yd,this).pending;xe(z2,this)!==null&&(vn(Pd,this,document.createDocumentFragment()),xe(Pd,this).append(xe(Th,this)),aq(xe(z2,this),xe(Pd,this))),xe(fC,this)===null&&vn(fC,this,D0(()=>i(xe(q2,this))))}function YV(i){var e;this.has_pending_snippet()?(vn(Oh,this,xe(Oh,this)+i),xe(Oh,this)===0&&(vn(H2,this,!1),xe(fC,this)&&qh(xe(fC,this),()=>{vn(fC,this,null)}),xe(Pd,this)&&(xe(q2,this).before(xe(Pd,this)),vn(Pd,this,null)))):this.parent&&or(O2,e=this.parent,YV).call(e,i)}function HV(i,e,A,t){var n=rE()?lp:lt;if(A.length!==0||i.length!==0){var o=ea,a=co,r=(function(){var l=co,g=go,C=Mo,d=ea;return function(){var B=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];yg(l),Ql(g),Ph(C),B&&d?.activate()}})();i.length>0?Promise.all(i).then(()=>{r();try{return s()}finally{o?.deactivate(),hw()}}):s()}else t(e.map(n));function s(){Promise.all(A.map(l=>(function(g){var C=co;C===null&&(function(){throw new Error("https://svelte.dev/e/async_derived_orphan")})();var d=C.b,B=void 0,u=xC(es),E=!go,f=new Map;return(function(m){yc(4718592,m,!0)})(()=>{var m=bV();B=m.promise;try{Promise.resolve(g()).then(m.resolve,m.reject).then(()=>{v===ea&&v.committed&&v.deactivate(),hw()})}catch(x){m.reject(x),hw()}var v=ea;if(E){var S,k=!d.is_pending();d.update_pending_count(1),v.increment(k),(S=f.get(v))===null||S===void 0||S.reject(Rh),f.delete(v),f.set(v,m)}var M=function(x){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;if(v.activate(),F)F!==Rh&&(u.f|=$2,Vh(u,F));else for(var[z,j]of((u.f&$2)!==0&&(u.f^=$2),Vh(u,x),f)){if(f.delete(z),z===v)break;j.reject(Rh)}E&&(d.update_pending_count(-1),v.decrement(k))};m.promise.then(M,x=>M(null,x||"unknown"))}),c5(()=>{for(var m of f.values())m.reject(Rh)}),new Promise(m=>{function v(S){function k(){S===B?m(u):v(B)}S.then(k,k)}v(B)})})(l))).then(l=>{r();try{t([...e.map(n),...l])}catch(g){(a.f&aE)===0&&jh(g,a)}o?.deactivate(),hw()}).catch(l=>{jh(l,a)})}}function hw(){yg(null),Ql(null),Ph(null)}function lp(i){var e=go!==null&&2&go.f?go:null;return co!==null&&(co.f|=kV),{ctx:Mo,deps:null,effects:null,equals:xV,f:2050,fn:i,reactions:null,rv:0,v:es,wv:0,parent:e??co,ac:null}}function Bl(i){var e=lp(i);return rq(e),e}function lt(i){var e=lp(i);return e.equals=NV,e}function zV(i){var e=i.effects;if(e!==null){i.effects=null;for(var A=0;A1&&arguments[1]!==void 0&&arguments[1],n=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],o=xC(i);return t||(o.equals=NV),nE&&n&&Mo!==null&&Mo.l!==null&&((A=(e=Mo.l).s)!==null&&A!==void 0?A:e.s=[]).push(o),o}function Ol(i,e){return N(i,uA(()=>c(i))),e}function N(i,e){var A,t=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return go===null||f0&&(go.f&BdA)===0||!rE()||!(4325394&go.f)||(A=MC)!==null&&A!==void 0&&A.includes(i)||(function(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")})(),Vh(i,t?Nh(e):e)}function Vh(i,e){if(!i.equals(e)){var A=i.v;rI?A1.set(i,e):A1.set(i,A),i.v=e;var t=$d.ensure();t.capture(i,A),2&i.f&&((i.f&mc)!==0&&nx(i),ns(i,(i.f&fc)!==0?ts:_C)),i.wv=lq(),WV(i,mc),!rE()||co===null||(co.f&ts)===0||96&co.f||(Eg===null?(function(n){Eg=n})([i]):Eg.push(i)),!t.is_fork&&Wk.size>0&&!Ij&&(function(){Ij=!1;var n=jd;Yw(!0);var o=Array.from(Wk);try{for(var a of o)(a.f&ts)!==0&&ns(a,_C),gE(a)&&Wh(a)}finally{Yw(n)}Wk.clear()})()}return e}function Bj(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,A=c(i),t=e===1?A++:A--;return N(i,A),t}function P4(i){N(i,i.v+1)}function WV(i,e){var A=i.reactions;if(A!==null)for(var t=rE(),n=A.length,o=0;o{if(Vd===o)return r();var s=go,l=Vd;Ql(null),uj(o);var g=r();return Ql(s),uj(l),g};return t&&A.set("length",EC(i.length)),new Proxy(i,{defineProperty(r,s,l){"value"in l&&l.configurable!==!1&&l.enumerable!==!1&&l.writable!==!1||(function(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")})();var g=A.get(s);return g===void 0?g=a(()=>{var C=EC(l.value);return A.set(s,C),C}):N(g,l.value,!0),!0},deleteProperty(r,s){var l=A.get(s);if(l===void 0){if(s in r){var g=a(()=>EC(es));A.set(s,g),P4(n)}}else N(l,es),P4(n);return!0},get(r,s,l){var g;if(s===y0)return i;var C=A.get(s),d=s in r;if(C===void 0&&(!d||(g=vC(r,s))!==null&&g!==void 0&&g.writable)&&(C=a(()=>EC(Nh(d?r[s]:es))),A.set(s,C)),C!==void 0){var B=c(C);return B===es?void 0:B}return Reflect.get(r,s,l)},getOwnPropertyDescriptor(r,s){var l=Reflect.getOwnPropertyDescriptor(r,s);if(l&&"value"in l){var g=A.get(s);g&&(l.value=c(g))}else if(l===void 0){var C=A.get(s),d=C?.v;if(C!==void 0&&d!==es)return{enumerable:!0,configurable:!0,value:d,writable:!0}}return l},has(r,s){var l;if(s===y0)return!0;var g=A.get(s),C=g!==void 0&&g.v!==es||Reflect.has(r,s);return(g!==void 0||co!==null&&(!C||(l=vC(r,s))!==null&&l!==void 0&&l.writable))&&(g===void 0&&(g=a(()=>EC(C?Nh(r[s]):es)),A.set(s,g)),c(g)===es)?!1:C},set(r,s,l,g){var C,d=A.get(s),B=s in r;if(t&&s==="length")for(var u=l;uEC(es)),A.set(u+"",E))}d===void 0?(!B||(C=vC(r,s))!==null&&C!==void 0&&C.writable)&&(N(d=a(()=>EC(void 0)),Nh(l)),A.set(s,d)):(B=d.v!==es,N(d,a(()=>Nh(l))));var f=Reflect.getOwnPropertyDescriptor(r,s);if(f!=null&&f.set&&f.set.call(g,l),!B){if(t&&typeof s=="string"){var m=A.get("length"),v=Number(s);Number.isInteger(v)&&v>=m.v&&N(m,v+1)}P4(n)}return!0},ownKeys(r){c(n);var s=Reflect.ownKeys(r).filter(C=>{var d=A.get(C);return d===void 0||d.v!==es});for(var[l,g]of A)g.v===es||l in r||s.push(l);return s},setPrototypeOf(){(function(){throw new Error("https://svelte.dev/e/state_prototype_fixed")})()}})}function hj(i){try{if(i!==null&&typeof i=="object"&&y0 in i)return i[y0]}catch(e){}return i}function wdA(i,e){return Object.is(hj(i),hj(e))}function e1(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return document.createTextNode(i)}function Jl(i){return VV.call(i)}function gp(i){return qV.call(i)}function gA(i,e){return Jl(i)}function at(i){var e=Jl(i);return e instanceof Comment&&e.data===""?gp(e):e}function kA(i){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,A=i;e--;)A=gp(A);return A}var Ej=!1;function g5(i){var e=go,A=co;Ql(null),yg(null);try{return i()}finally{Ql(e),yg(A)}}function ydA(i,e,A){var t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:A;i.addEventListener(e,()=>g5(A));var n=i.__on_r;i.__on_r=n?()=>{n(),t(!0)}:()=>t(!0),Ej||(Ej=!0,document.addEventListener("reset",o=>{Promise.resolve().then(()=>{if(!o.defaultPrevented)for(var a of o.target.elements){var r;(r=a.__on_r)===null||r===void 0||r.call(a)}})},{capture:!0}))}function ZV(i){co===null&&(go===null&&(function(){throw new Error("https://svelte.dev/e/effect_orphan")})(),(function(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")})()),rI&&(function(){throw new Error("https://svelte.dev/e/effect_in_teardown")})()}function yc(i,e,A){var t=co;t!==null&&(t.f&w0)!==0&&(i|=w0);var n={ctx:Mo,deps:null,nodes:null,f:i|mc|fc,first:null,fn:e,last:null,next:null,parent:t,b:t&&t.b,prev:null,teardown:null,wv:0,ac:null};if(A)try{Wh(n),n.f|=ix}catch(s){throw is(n),s}else e!==null&&AI(n);var o=n;if(A&&o.deps===null&&o.teardown===null&&o.nodes===null&&o.first===o.last&&(o.f&kV)===0&&(o=o.first,(i&oE)!==0&&(i&Zd)!==0&&o!==null&&(o.f|=Zd)),o!==null&&(o.parent=t,t!==null&&(function(s,l){var g=l.last;g===null?l.last=l.first=s:(g.next=s,s.prev=g,l.last=s)})(o,t),go!==null&&2&go.f&&(i&MV)===0)){var a,r=go;((a=r.effects)!==null&&a!==void 0?a:r.effects=[]).push(o)}return n}function j4(){return go!==null&&!f0}function c5(i){var e=yc(8,null,!1);return ns(e,ts),e.teardown=i,e}function D_(i){ZV();var e=co.f;if(!(!go&&(e&s5)!==0&&(e&ix)===0))return XV(i);var A,t=Mo;((A=t.e)!==null&&A!==void 0?A:t.e=[]).push(i)}function XV(i){return yc(1048580,i,!1)}function Tr(i){return yc(4,i,!1)}function KA(i,e){var A={effect:null,ran:!1,deps:i};Mo.l.$.push(A),A.effect=sE(()=>{i(),A.ran||(A.ran=!0,uA(e))})}function Vn(){var i=Mo;sE(()=>{for(var e of i.l.$){e.deps();var A=e.effect;(A.f&ts)!==0&&ns(A,_C),gE(A)&&Wh(A),e.ran=!1}})}function sE(i){return yc(8|(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0),i,!0)}function Le(i){HV(arguments.length>3&&arguments[3]!==void 0?arguments[3]:[],arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],e=>{yc(8,()=>i(...e.map(c)),!0)})}function lE(i){return yc(oE|(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0),i,!0)}function $V(i){return yc(IdA|(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0),i,!0)}function D0(i){return yc(524320,i,!0)}function Aq(i){var e=i.teardown;if(e!==null){var A=rI,t=go;Qj(!0),Ql(null);try{e.call(null)}finally{Qj(A),Ql(t)}}}function eq(i){var e=arguments.length>1&&arguments[1]!==void 0&&arguments[1],A=i.first;i.first=i.last=null;for(var t,n=function(){var o=A.ac;o!==null&&g5(()=>{o.abort(Rh)}),t=A.next,(A.f&MV)!==0?A.parent=null:is(A,e),A=t};A!==null;)n()}function is(i){var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],A=!1;!e&&(i.f&SV)===0||i.nodes===null||i.nodes.end===null||(tq(i.nodes.start,i.nodes.end),A=!0),eq(i,e&&!A),Hw(i,0),ns(i,aE);var t=i.nodes&&i.nodes.t;if(t!==null)for(var n of t)n.stop();Aq(i);var o=i.parent;o!==null&&o.first!==null&&iq(i),i.next=i.prev=i.teardown=i.ctx=i.deps=i.fn=i.nodes=i.ac=null}function tq(i,e){for(;i!==null;){var A=i===e?null:gp(i);i.remove(),i=A}}function iq(i){var e=i.parent,A=i.prev,t=i.next;A!==null&&(A.next=t),t!==null&&(t.prev=A),e!==null&&(e.first===i&&(e.first=t),e.last===i&&(e.last=A))}function qh(i,e){var A=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],t=[];nq(i,t,!0);var n=()=>{A&&is(i),e&&e()},o=t.length;if(o>0){var a=()=>--o||n();for(var r of t)r.out(a)}else n()}function nq(i,e,A){if((i.f&w0)===0){i.f^=w0;var t=i.nodes&&i.nodes.t;if(t!==null)for(var n of t)(n.is_global||A)&&e.push(n);for(var o=i.first;o!==null;){var a=o.next;nq(o,e,((o.f&Zd)!==0||(o.f&s5)!==0&&(i.f&oE)!==0)&&A),o=a}}}function v_(i){oq(i,!0)}function oq(i,e){if((i.f&w0)!==0){i.f^=w0,(i.f&ts)===0&&(ns(i,mc),AI(i));for(var A=i.first;A!==null;){var t=A.next;oq(A,((A.f&Zd)!==0||(A.f&s5)!==0)&&e),A=t}var n=i.nodes&&i.nodes.t;if(n!==null)for(var o of n)(o.is_global||e)&&o.in()}}function aq(i,e){if(i.nodes)for(var A=i.nodes.start,t=i.nodes.end;A!==null;){var n=A===t?null:gp(A);e.append(A),A=n}}var DdA=null;var jd=!1;function Yw(i){jd=i}var rI=!1;function Qj(i){rI=i}var go=null,f0=!1;function Ql(i){go=i}var co=null;function yg(i){co=i}var MC=null;function rq(i){go!==null&&(MC===null?MC=[i]:MC.push(i))}var Ts=null,Kl=0,Eg=null,sq=1,V4=0,Vd=V4;function uj(i){Vd=i}function lq(){return++sq}function gE(i){var e=i.f;if((e&mc)!==0)return!0;if(2&e&&(i.f&=-32769),(e&_C)!==0){var A=i.deps;if(A!==null)for(var t=A.length,n=0;ni.wv)return!0}(e&fc)!==0&&mg===null&&ns(i,ts)}return!1}function gq(i,e){var A,t=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],n=i.reactions;if(n!==null&&((A=MC)===null||A===void 0||!A.includes(i)))for(var o=0;o{i.ac.abort(Rh)}),i.ac=null);try{i.f|=m_;var g=(0,i.fn)(),C=i.deps;if(Ts!==null){var d;if(Hw(i,Kl),C!==null&&Kl>0)for(C.length=Kl+Ts.length,d=0;d1&&arguments[1]!==void 0?arguments[1]:new Set;if(!(typeof i!="object"||i===null||i instanceof EventTarget||e.has(i))){for(var A in e.add(i),i instanceof Date&&i.getTime(),i)try{b_(i[A],e)}catch(r){}var t=ex(i);if(t!==Object.prototype&&t!==Array.prototype&&t!==Map.prototype&&t!==Set.prototype&&t!==Date.prototype){var n=vV(t);for(var o in n){var a=n[o].get;if(a)try{a.call(i)}catch(r){}}}}}var hq=new Set,M_=new Set;function Eq(i,e,A){var t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};function n(o){if(t.capture||T4.call(e,o),!o.cancelBubble)return g5(()=>A?.call(this,o))}return i.startsWith("pointer")||i.startsWith("touch")||i==="wheel"?Xd(()=>{e.addEventListener(i,n,t)}):e.addEventListener(i,n,t),n}function De(i,e,A,t,n){var o={capture:t,passive:n},a=Eq(i,e,A,o);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&c5(()=>{e.removeEventListener(i,a,o)})}function cp(i){for(var e=0;ea||t});var C=go,d=co;Ql(null),yg(null);try{for(var B,u=[];a!==null;){var E=a.assignedSlot||a.parentNode||a.host||null;try{var f=a["__"+n];f==null||a.disabled&&i.target!==a||f.call(a,i)}catch(S){B?u.push(S):B=S}if(i.cancelBubble||E===A||E===null)break;a=E}if(B){var m=function(S){queueMicrotask(()=>{throw S})};for(var v of u)m(v);throw B}}finally{i.__root=A,delete i.currentTarget,Ql(C),yg(d)}}}function ox(i){var e=document.createElement("template");return e.innerHTML=i.replaceAll("",""),e.content}function eI(i,e){var A=co;A.nodes===null&&(A.nodes={start:i,end:e,a:null,t:null})}function TA(i,e){var A,t=!!(1&e),n=!!(2&e),o=!i.startsWith("");return()=>{A===void 0&&(A=ox(o?i:""+i),t||(A=Jl(A)));var a=n||jV?document.importNode(A,!0):A.cloneNode(!0);return t?eI(Jl(a),a.lastChild):eI(a,a),a}}function l1(i,e){return(function(A,t){var n,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"svg",a=!A.startsWith(""),r=!!(1&t),s="<".concat(o,">").concat(a?A:""+A,"");return()=>{if(!n){var l=Jl(ox(s));if(r)for(n=document.createDocumentFragment();Jl(l);)n.appendChild(Jl(l));else n=Jl(l)}var g=n.cloneNode(!0);return r?eI(Jl(g),g.lastChild):eI(g,g),g}})(i,e,"svg")}function mr(){var i=e1((arguments.length>0&&arguments[0]!==void 0?arguments[0]:"")+"");return eI(i,i),i}function zi(){var i=document.createDocumentFragment(),e=document.createComment(""),A=e1();return i.append(e,A),eI(e,A),i}function sA(i,e){i!==null&&i.before(e)}var MdA=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"],SdA={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"},kdA=["touchstart","touchmove"];function _dA(i){return kdA.includes(i)}function Ht(i,e){var A,t=e==null?"":typeof e=="object"?e+"":e;t!==((A=i.__t)!==null&&A!==void 0?A:i.__t=i.nodeValue)&&(i.__t=t,i.nodeValue=t+"")}function xdA(i,e){return(function(A,t){var{target:n,anchor:o,props:a={},events:r,context:s,intro:l=!0}=t;(function(){if(bC===void 0){bC=window,jV=/Firefox/.test(navigator.userAgent);var u=Element.prototype,E=Node.prototype,f=Text.prototype;VV=vC(E,"firstChild").get,qV=vC(E,"nextSibling").get,lj(u)&&(u.__click=void 0,u.__className=void 0,u.__attributes=null,u.__style=void 0,u.__e=void 0),lj(f)&&(f.__t=void 0)}})();var g=new Set,C=u=>{for(var E=0;E0&&arguments[0]!==void 0?arguments[0]:{};return new Promise(m=>{f.outro?qh(E,()=>{is(E),m(void 0)}):(is(E),m(void 0))})}})(()=>{var u=o??n.appendChild(e1());return(function(E,f,m){new y_(E,f,m)})(u,{pending:()=>{}},E=>{s&&(Jt({}),Mo.c=s),r&&(a.$$events=r),d=A(E,a)||{},s&&Yt()}),()=>{for(var E of g){n.removeEventListener(E,T4);var f=yh.get(E);--f===0?(document.removeEventListener(E,T4),yh.delete(E)):yh.set(E,f)}var m;M_.delete(C),u!==o&&((m=u.parentNode)===null||m===void 0||m.removeChild(u))}});return S_.set(d,B),d})(i,e)}var yh=new Map,S_=new WeakMap,Dh,IC=new WeakMap,Kd=new WeakMap,BC=new WeakMap,L4=new WeakMap,Zk=new WeakMap,pj=new WeakMap,RdA=new WeakMap,Zh=class{constructor(e){var A=this,t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];u0(this,"anchor",void 0),Go(this,IC,new Map),Go(this,Kd,new Map),Go(this,BC,new Map),Go(this,L4,new Set),Go(this,Zk,!0),Go(this,pj,()=>{var n=ea;if(xe(IC,this).has(n)){var o=xe(IC,this).get(n),a=xe(Kd,this).get(o);if(a)v_(a),xe(L4,this).delete(o);else{var r=xe(BC,this).get(o);r&&(xe(Kd,this).set(o,r.effect),xe(BC,this).delete(o),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),a=r.effect)}for(var[s,l]of xe(IC,this)){if(xe(IC,this).delete(s),s===n)break;var g=xe(BC,this).get(l);g&&(is(g.effect),xe(BC,this).delete(l))}var C=function(u,E){if(u===o||xe(L4,A).has(u))return 1;var f=()=>{if(Array.from(xe(IC,A).values()).includes(u)){var m=document.createDocumentFragment();aq(E,m),m.append(e1()),xe(BC,A).set(u,{effect:E,fragment:m})}else is(E);xe(L4,A).delete(u),xe(Kd,A).delete(u)};xe(Zk,A)||!a?(xe(L4,A).add(u),qh(E,f,!1)):f()};for(var[d,B]of xe(Kd,this))C(d,B)}}),Go(this,RdA,n=>{xe(IC,this).delete(n);var o=Array.from(xe(IC,this).values());for(var[a,r]of xe(BC,this))o.includes(a)||(is(r.effect),xe(BC,this).delete(a))}),this.anchor=e,vn(Zk,this,t)}ensure(e,A){var t=ea;!A||xe(Kd,this).has(e)||xe(BC,this).has(e)||xe(Kd,this).set(e,D0(()=>A(this.anchor))),xe(IC,this).set(t,e),xe(pj,this).call(this)}};function os(i){Mo===null&&sp(),nE&&Mo.l!==null?Qq(Mo).m.push(i):D_(()=>{var e=uA(i);if(typeof e=="function")return e})}function Dg(i){Mo===null&&sp(),os(()=>()=>uA(i))}function NdA(){var i=Mo;return i===null&&sp(),(e,A,t)=>{var n,o=(n=i.s.$$events)===null||n===void 0?void 0:n[e];if(o){var a=rp(o)?o.slice():[o],r=(function(l,g){var{bubbles:C=!1,cancelable:d=!1}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return new CustomEvent(l,{detail:g,bubbles:C,cancelable:d})})(e,A,t);for(var s of a)s.call(i.x,r);return!r.defaultPrevented}return!0}}function FdA(i){Mo===null&&sp(),Mo.l===null&&(function(){throw new Error("https://svelte.dev/e/lifecycle_legacy_only")})(),Qq(Mo).b.push(i)}function Qq(i){var e,A=i.l;return(e=A.u)!==null&&e!==void 0?e:A.u={a:[],b:[],m:[]}}function zA(i,e){var A=arguments.length>2&&arguments[2]!==void 0&&arguments[2],t=new Zh(i);function n(o,a){t.ensure(o,a)}lE(()=>{var o=!1;e(function(a){o=!0,n(!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],a)}),o||n(!1,null)},A?Zd:0)}function uq(i,e,A){var t=new Zh(i),n=!rE();lE(()=>{var o=e();n&&o!==null&&typeof o=="object"&&(o={}),t.ensure(o,A)})}function Ka(i,e){return e}function Xk(i){for(var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],A=0;A5&&arguments[5]!==void 0?arguments[5]:null,a=i,r=new Map;!(4&e)||(a=i.appendChild(e1()));var s,l=null,g=lt(()=>{var E=A();return rp(E)?E:E==null?[]:xw(E)}),C=!0;function d(){u.fallback=l,(function(E,f,m,v,S){var k,M,x,F,z,j=!!(8&v),X=f.length,eA=E.items,Z=E.effect.first,CA=null,wA=[],BA=[];if(j)for(z=0;z0){var YA=4&v&&X===0?m:null;if(j){for(z=0;z{if(Ge){if(Ge.pending.delete(vt),Ge.done.add(vt),Ge.pending.size===0){var Ke=pA.outrogroups;Xk(xw(Ge.done)),Ke.delete(Ge),Ke.size===0&&(pA.outrogroups=null)}}else yA-=1},!1)},Dt=0;Dt{if(M!==void 0)for(F of M){var pA;(pA=F.nodes)===null||pA===void 0||(pA=pA.a)===null||pA===void 0||pA.apply()}})})(u,s,a,e,t),l!==null&&(s.length===0?(l.f&hC)===0?v_(l):(l.f^=hC,G4(l,null,a)):qh(l,()=>{l=null}))}var B=lE(()=>{for(var E=(s=c(g)).length,f=new Set,m=0;mo(a)):(l=D0(()=>o(Dh??(Dh=e1())))).f|=hC),C||d(),c(g)}),u={effect:B,items:r,outrogroups:null,fallback:l};C=!1}function LdA(i,e,A,t,n,o,a,r){var s=1&a?16&a?xC(A):cA(A,!1,!1):null,l=2&a?xC(n):null;return{v:s,i:l,e:D0(()=>(o(e,s??A,l??n,r),()=>{i.delete(t)}))}}function G4(i,e,A){if(i.nodes)for(var t=i.nodes.start,n=i.nodes.end,o=e&&(e.f&hC)===0?e.nodes.start:A;t!==null;){var a=gp(t);if(o.before(t),t===n)return;t=a}}function T2(i,e,A){e===null?i.effect.first=A:e.next=A,A===null?i.effect.last=e:A.prev=e}function pq(i,e){var A=arguments.length>2&&arguments[2]!==void 0&&arguments[2],t=arguments.length>3&&arguments[3]!==void 0&&arguments[3],n=i,o="";Le(()=>{var a,r=co;if(o!==(o=(a=e())!==null&&a!==void 0?a:"")&&(r.nodes!==null&&(tq(r.nodes.start,r.nodes.end),r.nodes=null),o!=="")){var s=o+"";A?s="".concat(s,""):t&&(s="".concat(s,""));var l=ox(s);if((A||t)&&(l=Jl(l)),eI(Jl(l),l.lastChild),A||t)for(;Jl(l);)n.before(Jl(l));else n.before(l)}})}function ya(i,e,A,t,n){var o,a=(o=e.$$slots)===null||o===void 0?void 0:o[A],r=!1;a===!0&&(a=e[A==="default"?"children":A],r=!0),a===void 0?n!==null&&n(i):a(i,r?()=>t:t)}function fq(i,e,A){var t=new Zh(i);lE(()=>{var n,o=(n=e())!==null&&n!==void 0?n:null;t.ensure(o,o&&(a=>A(a,o)))},Zd)}function Ms(i,e,A){Tr(()=>{var t=uA(()=>e(i,A?.())||{});if(A&&t!=null&&t.update){var n=!1,o={};sE(()=>{var a=A();Y(a),n&&RV(o,a)&&(o=a,t.update(a))}),n=!0}if(t!=null&&t.destroy)return()=>t.destroy()})}function GdA(i,e){var A,t=void 0;$V(()=>{t!==(t=e())&&(A&&(is(A),A=null),t&&(A=D0(()=>{Tr(()=>t(i))})))})}function mq(i){var e,A,t="";if(typeof i=="string"||typeof i=="number")t+=i;else if(typeof i=="object")if(Array.isArray(i)){var n=i.length;for(e=0;e{if(A&&!A(t,n,o,a))return!1;let r=t>=a&&n<=a+o.length?o.slice(t-a,n-a):e.doc.sliceString(t,n);return i(r,e,t,n)}}function ph(i,e,A,t){let n;return i.wholeWord&&(n=C1A(e.doc,e.charCategorizer(e.selection.main.head))),i.test&&(n=c1A(i.test,e,n)),new K2(e.doc,i.unquoted,A,t,i.caseSensitive?void 0:o=>o.toLowerCase(),n)}function C1A(i,e){return(A,t,n,o)=>((o>A||o+n.length=A)return null;n.push(t.value)}return n}highlight(e,A,t,n){let o=ph(this.spec,e,Math.max(0,A-this.spec.unquoted.length),Math.min(t+this.spec.unquoted.length,e.doc.length));for(;!o.next().done;)n(o.value.from,o.value.to)}};function d1A(i,e,A){return(t,n,o)=>(!A||A(t,n,o))&&i(o[0],e,t,n)}function fh(i,e,A,t){let n;return i.wholeWord&&(n=I1A(e.charCategorizer(e.selection.main.head))),i.test&&(n=d1A(i.test,e,n)),new V8(e.doc,i.search,{ignoreCase:!i.caseSensitive,test:n},A,t)}function Aw(i,e){return i.slice(tr(i,e,!1),e)}function ew(i,e){return i.slice(e,tr(i,e))}function I1A(i){return(e,A,t)=>!t[0].length||(i(Aw(t.input,t.index))!=$o.Word||i(ew(t.input,t.index))!=$o.Word)&&(i(ew(t.input,t.index+t[0].length))!=$o.Word||i(Aw(t.input,t.index+t[0].length))!=$o.Word)}var mk=class extends $8{nextMatch(e,A,t){let n=fh(this.spec,e,t,e.doc.length).next();return n.done&&(n=fh(this.spec,e,0,A).next()),n.done?null:n.value}prevMatchInRange(e,A,t){for(let n=1;;n++){let o=Math.max(A,t-n*1e4),a=fh(this.spec,e,o,t),r=null;for(;!a.next().done;)r=a.value;if(r&&(o==A||r.from>o+10))return r;if(o==A)return null}}prevMatch(e,A,t){return this.prevMatchInRange(e,0,A)||this.prevMatchInRange(e,t,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(A,t)=>{if(t=="&")return e.match[0];if(t=="$")return"$";for(let n=t.length;n>0;n--){let o=+t.slice(0,n);if(o>0&&o=A)return null;n.push(t.value)}return n}highlight(e,A,t,n){let o=fh(this.spec,e,Math.max(0,A-250),Math.min(t+250,e.doc.length));for(;!o.next().done;)n(o.value.from,o.value.to)}},k4=ln.define(),bk=ln.define(),G2=La.define({create(i){return new S4(wk(i).create(),null)},update(i,e){for(let A of e.effects)A.is(k4)?i=new S4(A.value.create(),i.panel):A.is(bk)&&(i=new S4(i.query,A.value?Mk:null));return i},provide:i=>vd.from(i,e=>e.panel)});var S4=class{constructor(e,A){this.query=e,this.panel=A}},B1A=Lt.mark({class:"cm-searchMatch"}),h1A=Lt.mark({class:"cm-searchMatch cm-searchMatch-selected"}),E1A=Po.fromClass(class{constructor(i){this.view=i,this.decorations=this.highlight(i.state.field(G2))}update(i){let e=i.state.field(G2);(e!=i.startState.field(G2)||i.docChanged||i.selectionSet||i.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:i,panel:e}){if(!e||!i.spec.valid)return Lt.none;let{view:A}=this,t=new Xr;for(let n=0,o=A.visibleRanges,a=o.length;no[n+1].from-500;)s=o[++n].to;i.highlight(A.state,r,s,(l,g)=>{let C=A.state.selection.ranges.some(d=>d.from==l&&d.to==g);t.add(l,g,C?h1A:B1A)})}return t.finish()}},{decorations:i=>i.decorations});function _4(i){return e=>{let A=e.state.field(G2,!1);return A&&A.query.spec.valid?i(e,A):nw(e)}}var tw=_4((i,{query:e})=>{let{to:A}=i.state.selection.main,t=e.nextMatch(i.state,A,A);if(!t)return!1;let n=Be.single(t.from,t.to),o=i.state.facet(Fd);return i.dispatch({selection:n,effects:[Sk(i,t),o.scrollToMatch(n.main,i)],userEvent:"select.search"}),KP(i),!0}),iw=_4((i,{query:e})=>{let{state:A}=i,{from:t}=A.selection.main,n=e.prevMatch(A,t,t);if(!n)return!1;let o=Be.single(n.from,n.to),a=i.state.facet(Fd);return i.dispatch({selection:o,effects:[Sk(i,n),a.scrollToMatch(o.main,i)],userEvent:"select.search"}),KP(i),!0}),Q1A=_4((i,{query:e})=>{let A=e.matchAll(i.state,1e3);return!A||!A.length?!1:(i.dispatch({selection:Be.create(A.map(t=>Be.range(t.from,t.to))),userEvent:"select.search.matches"}),!0)}),u1A=({state:i,dispatch:e})=>{let A=i.selection;if(A.ranges.length>1||A.main.empty)return!1;let{from:t,to:n}=A.main,o=[],a=0;for(let r=new K2(i.doc,i.sliceDoc(t,n));!r.next().done;){if(o.length>1e3)return!1;r.value.from==t&&(a=o.length),o.push(Be.range(r.value.from,r.value.to))}return e(i.update({selection:Be.create(o,a),userEvent:"select.search.matches"})),!0},xP=_4((i,{query:e})=>{let{state:A}=i,{from:t,to:n}=A.selection.main;if(A.readOnly)return!1;let o=e.nextMatch(A,t,t);if(!o)return!1;let a=o,r=[],s,l,g=[];a.from==t&&a.to==n&&(l=A.toText(e.getReplacement(a)),r.push({from:a.from,to:a.to,insert:l}),a=e.nextMatch(A,a.from,a.to),g.push(ui.announce.of(A.phrase("replaced match on line $",A.doc.lineAt(t).number)+".")));let C=i.state.changes(r);return a&&(s=Be.single(a.from,a.to).map(C),g.push(Sk(i,a)),g.push(A.facet(Fd).scrollToMatch(s.main,i))),i.dispatch({changes:C,selection:s,effects:g,userEvent:"input.replace"}),!0}),p1A=_4((i,{query:e})=>{if(i.state.readOnly)return!1;let A=e.matchAll(i.state,1e9).map(n=>{let{from:o,to:a}=n;return{from:o,to:a,insert:e.getReplacement(n)}});if(!A.length)return!1;let t=i.state.phrase("replaced $ matches",A.length)+".";return i.dispatch({changes:A,effects:ui.announce.of(t),userEvent:"input.replace.all"}),!0});function Mk(i){return i.state.facet(Fd).createPanel(i)}function wk(i,e){var A,t,n,o,a;let r=i.selection.main,s=r.empty||r.to>r.from+100?"":i.sliceDoc(r.from,r.to);if(e&&!s)return e;let l=i.facet(Fd);return new X8({search:((A=e?.literal)!==null&&A!==void 0?A:l.literal)?s:s.replace(/\n/g,"\\n"),caseSensitive:(t=e?.caseSensitive)!==null&&t!==void 0?t:l.caseSensitive,literal:(n=e?.literal)!==null&&n!==void 0?n:l.literal,regexp:(o=e?.regexp)!==null&&o!==void 0?o:l.regexp,wholeWord:(a=e?.wholeWord)!==null&&a!==void 0?a:l.wholeWord})}function GP(i){let e=d4(i,Mk);return e&&e.dom.querySelector("[main-field]")}function KP(i){let e=GP(i);e&&e==i.root.activeElement&&e.select()}var nw=i=>{let e=i.state.field(G2,!1);if(e&&e.panel){let A=GP(i);if(A&&A!=i.root.activeElement){let t=wk(i.state,e.query.spec);t.valid&&i.dispatch({effects:k4.of(t)}),A.focus(),A.select()}}else i.dispatch({effects:[bk.of(!0),e?k4.of(wk(i.state,e.query.spec)):ln.appendConfig.of(Dk)]});return!0},ow=i=>{let e=i.state.field(G2,!1);if(!e||!e.panel)return!1;let A=d4(i,Mk);return A&&A.dom.contains(i.root.activeElement)&&i.focus(),i.dispatch({effects:bk.of(!1)}),!0},UP=[{key:"Mod-f",run:nw,scope:"editor search-panel"},{key:"F3",run:tw,shift:iw,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:tw,shift:iw,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:ow,scope:"editor search-panel"},{key:"Mod-Shift-l",run:u1A},{key:"Mod-Alt-g",run:e1A},{key:"Mod-d",run:g1A,preventDefault:!0}],yk=class{constructor(e){this.view=e;let A=this.query=e.state.field(G2).query.spec;this.commit=this.commit.bind(this),this.searchField=po("input",{value:A.search,placeholder:Gl(e,"Find"),"aria-label":Gl(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=po("input",{value:A.replace,placeholder:Gl(e,"Replace"),"aria-label":Gl(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=po("input",{type:"checkbox",name:"case",form:"",checked:A.caseSensitive,onchange:this.commit}),this.reField=po("input",{type:"checkbox",name:"re",form:"",checked:A.regexp,onchange:this.commit}),this.wordField=po("input",{type:"checkbox",name:"word",form:"",checked:A.wholeWord,onchange:this.commit});function t(n,o,a){return po("button",{class:"cm-button",name:n,onclick:o,type:"button"},a)}this.dom=po("div",{onkeydown:n=>this.keydown(n),class:"cm-search"},[this.searchField,t("next",()=>tw(e),[Gl(e,"next")]),t("prev",()=>iw(e),[Gl(e,"previous")]),t("select",()=>Q1A(e),[Gl(e,"all")]),po("label",null,[this.caseField,Gl(e,"match case")]),po("label",null,[this.reField,Gl(e,"regexp")]),po("label",null,[this.wordField,Gl(e,"by word")]),...e.state.readOnly?[]:[po("br"),this.replaceField,t("replace",()=>xP(e),[Gl(e,"replace")]),t("replaceAll",()=>p1A(e),[Gl(e,"replace all")])],po("button",{name:"close",onclick:()=>ow(e),"aria-label":Gl(e,"close"),type:"button"},["\xD7"])])}commit(){let e=new X8({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:k4.of(e)}))}keydown(e){wH(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?iw:tw)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),xP(this.view))}update(e){for(let A of e.transactions)for(let t of A.effects)t.is(k4)&&!t.value.eq(this.query)&&this.setQuery(t.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Fd).top}};function Gl(i,e){return i.state.phrase(e)}var P8=30,j8=/[\s\.,:;?!]/;function Sk(i,{from:e,to:A}){let t=i.state.doc.lineAt(e),n=i.state.doc.lineAt(A).to,o=Math.max(t.from,e-P8),a=Math.min(n,A+P8),r=i.state.sliceDoc(o,a);if(o!=t.from){for(let s=0;sr.length-P8;s--)if(!j8.test(r[s-1])&&j8.test(r[s])){r=r.slice(0,s);break}}return ui.announce.of(`${i.state.phrase("current match")}. ${r} ${i.state.phrase("on line")} ${t.number}.`)}var f1A=ui.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Dk=[G2,oc.low(E1A),f1A];var rw=class{constructor(e,A,t,n){this.state=e,this.pos=A,this.explicit=t,this.view=n,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let A=Kr(this.state).resolveInner(this.pos,-1);for(;A&&e.indexOf(A.name)<0;)A=A.parent;return A?{from:A.from,to:this.pos,text:this.state.sliceDoc(A.from,this.pos),type:A.type}:null}matchBefore(e){let A=this.state.doc.lineAt(this.pos),t=Math.max(A.from,this.pos-250),n=A.text.slice(t-A.from,this.pos-A.from),o=n.search(jP(e,!1));return o<0?null:{from:t+o,to:this.pos,text:n.slice(o)}}get aborted(){return this.abortListeners==null}addEventListener(e,A,t){e=="abort"&&this.abortListeners&&(this.abortListeners.push(A),t&&t.onDocChange&&(this.abortOnDocChange=!0))}};function TP(i){let e=Object.keys(i).join(""),A=/\w/.test(e);return A&&(e=e.replace(/\w/g,"")),`[${A?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function m1A(i){let e=Object.create(null),A=Object.create(null);for(let{label:n}of i){e[n[0]]=!0;for(let o=1;otypeof n=="string"?{label:n}:n),[A,t]=e.every(n=>/^\w+$/.test(n.label))?[/\w*$/,/\w+$/]:m1A(e);return n=>{let o=n.matchBefore(t);return o||n.explicit?{from:o?o.from:n.pos,options:e,validFor:A}:null}}var sw=class{constructor(e,A,t,n){this.completion=e,this.source=A,this.match=t,this.score=n}};function Gd(i){return i.selection.main.from}function jP(i,e){var A;let{source:t}=i,n=e&&t[0]!="^",o=t[t.length-1]!="$";return!n&&!o?i:new RegExp(`${n?"^":""}(?:${t})${o?"$":""}`,(A=i.flags)!==null&&A!==void 0?A:i.ignoreCase?"i":"")}var VP=sl.define();function y1A(i,e,A,t){let{main:n}=i.selection,o=A-n.from,a=t-n.from;return $A(P({},i.changeByRange(r=>{if(r!=n&&A!=t&&i.sliceDoc(r.from+o,r.from+a)!=i.sliceDoc(A,t))return{range:r};let s=i.toText(e);return{changes:{from:r.from+o,to:t==n.from?r.to:r.from+a,insert:s},range:Be.cursor(r.from+o+s.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}var OP=new WeakMap;function D1A(i){if(!Array.isArray(i))return i;let e=OP.get(i);return e||OP.set(i,e=w1A(i)),e}var lw=ln.define(),x4=ln.define(),Rk=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let A=0;A=48&&M<=57||M>=97&&M<=122?2:M>=65&&M<=90?1:0:(x=qu(M))!=x.toLowerCase()?1:x!=x.toUpperCase()?2:0;(!v||F==1&&f||k==0&&F!=0)&&(A[C]==M||t[C]==M&&(d=!0)?a[C++]=v:a.length&&(m=!1)),k=F,v+=Rl(M)}return C==s&&a[0]==0&&m?this.result(-100+(d?-200:0),a,e):B==s&&u==0?this.ret(-200-e.length+(E==e.length?0:-100),[0,E]):r>-1?this.ret(-700-e.length,[r,r+this.pattern.length]):B==s?this.ret(-900-e.length,[u,E]):C==s?this.result(-100+(d?-200:0)+-700+(m?0:-1100),a,e):A.length==2?null:this.result((n[0]?-700:0)+-200+-1100,n,e)}result(e,A,t){let n=[],o=0;for(let a of A){let r=a+(this.astral?Rl($r(t,a)):1);o&&n[o-1]==a?n[o-1]=r:(n[o++]=a,n[o++]=r)}return this.ret(e-t.length,n)}},Nk=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:v1A,filterStrict:!1,compareCompletions:(e,A)=>(e.sortText||e.label).localeCompare(A.sortText||A.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,A)=>e&&A,closeOnBlur:(e,A)=>e&&A,icons:(e,A)=>e&&A,tooltipClass:(e,A)=>t=>JP(e(t),A(t)),optionClass:(e,A)=>t=>JP(e(t),A(t)),addToOptions:(e,A)=>e.concat(A),filterStrict:(e,A)=>e||A})}});function JP(i,e){return i?e?i+" "+e:i:e}function v1A(i,e,A,t,n,o){let a=i.textDirection==Lo.RTL,r=a,s=!1,l="top",g,C,d=e.left-n.left,B=n.right-e.right,u=t.right-t.left,E=t.bottom-t.top;if(r&&d=E||v>e.top?g=A.bottom-e.top:(l="bottom",g=e.bottom-A.top)}let f=(e.bottom-e.top)/o.offsetHeight,m=(e.right-e.left)/o.offsetWidth;return{style:`${l}: ${g/f}px; max-width: ${C/m}px`,class:"cm-completionInfo-"+(s?a?"left-narrow":"right-narrow":r?"left":"right")}}var Uk=ln.define();function b1A(i){let e=i.addToOptions.slice();return i.icons&&e.push({render(A){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),A.type&&t.classList.add(...A.type.split(/\s+/g).map(n=>"cm-completionIcon-"+n)),t.setAttribute("aria-hidden","true"),t},position:20}),e.push({render(A,t,n,o){let a=document.createElement("span");a.className="cm-completionLabel";let r=A.displayLabel||A.label,s=0;for(let l=0;ls&&a.appendChild(document.createTextNode(r.slice(s,g)));let d=a.appendChild(document.createElement("span"));d.appendChild(document.createTextNode(r.slice(g,C))),d.className="cm-completionMatchedText",s=C}return sA.position-t.position).map(A=>A.render)}function kk(i,e,A){if(i<=A)return{from:0,to:i};if(e<0&&(e=0),e<=i>>1){let n=Math.floor(e/A);return{from:n*A,to:(n+1)*A}}let t=Math.floor((i-e)/A);return{from:i-(t+1)*A,to:i-t*A}}var Fk=class{constructor(e,A,t){this.view=e,this.stateField=A,this.applyCompletion=t,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:s=>this.placeInfo(s),key:this},this.space=null,this.currentClass="";let n=e.state.field(A),{options:o,selected:a}=n.open,r=e.state.facet(Ur);this.optionContent=b1A(r),this.optionClass=r.optionClass,this.tooltipClass=r.tooltipClass,this.range=kk(o.length,a,r.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",s=>{let{options:l}=e.state.field(A).open;for(let g=s.target,C;g&&g!=this.dom;g=g.parentNode)if(g.nodeName=="LI"&&(C=/-(\d+)$/.exec(g.id))&&+C[1]this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;g!=null&&(e.dispatch({effects:Uk.of(g)}),s.preventDefault())}}),this.dom.addEventListener("focusout",s=>{let l=e.state.field(this.stateField,!1);l&&l.tooltip&&e.state.facet(Ur).closeOnBlur&&s.relatedTarget!=e.contentDOM&&e.dispatch({effects:x4.of(null)})}),this.showOptions(o,n.id)}mount(){this.updateSel()}showOptions(e,A){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,A,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var A;let t=e.state.field(this.stateField),n=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),t!=n){let{options:o,selected:a,disabled:r}=t.open;(!n.open||n.open.options!=o)&&(this.range=kk(o.length,a,e.state.facet(Ur).maxRenderedOptions),this.showOptions(o,t.id)),this.updateSel(),r!=((A=n.open)===null||A===void 0?void 0:A.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!r)}}updateTooltipClass(e){let A=this.tooltipClass(e);if(A!=this.currentClass){for(let t of this.currentClass.split(" "))t&&this.dom.classList.remove(t);for(let t of A.split(" "))t&&this.dom.classList.add(t);this.currentClass=A}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),A=e.open;(A.selected>-1&&A.selected=this.range.to)&&(this.range=kk(A.options.length,A.selected,this.view.state.facet(Ur).maxRenderedOptions),this.showOptions(A.options,e.id));let t=this.updateSelectedOption(A.selected);if(t){this.destroyInfo();let{completion:n}=A.options[A.selected],{info:o}=n;if(!o)return;let a=typeof o=="string"?document.createTextNode(o):o(n);if(!a)return;"then"in a?a.then(r=>{r&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(r,n)}).catch(r=>Gr(this.view.state,r,"completion info")):(this.addInfoPane(a,n),t.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,A){this.destroyInfo();let t=this.info=document.createElement("div");if(t.className="cm-tooltip cm-completionInfo",t.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)t.appendChild(e),this.infoDestroy=null;else{let{dom:n,destroy:o}=e;t.appendChild(n),this.infoDestroy=o||null}this.dom.appendChild(t),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let A=null;for(let t=this.list.firstChild,n=this.range.from;t;t=t.nextSibling,n++)t.nodeName!="LI"||!t.id?n--:n==e?t.hasAttribute("aria-selected")||(t.setAttribute("aria-selected","true"),A=t):t.hasAttribute("aria-selected")&&(t.removeAttribute("aria-selected"),t.removeAttribute("aria-describedby"));return A&&S1A(this.list,A),A}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let A=this.dom.getBoundingClientRect(),t=this.info.getBoundingClientRect(),n=e.getBoundingClientRect(),o=this.space;if(!o){let a=this.dom.ownerDocument.documentElement;o={left:0,top:0,right:a.clientWidth,bottom:a.clientHeight}}return n.top>Math.min(o.bottom,A.bottom)-10||n.bottom{a.target==n&&a.preventDefault()});let o=null;for(let a=t.from;at.from||t.from==0))if(o=d,typeof l!="string"&&l.header)n.appendChild(l.header(l));else{let B=n.appendChild(document.createElement("completion-section"));B.textContent=d}}let g=n.appendChild(document.createElement("li"));g.id=A+"-"+a,g.setAttribute("role","option");let C=this.optionClass(r);C&&(g.className=C);for(let d of this.optionContent){let B=d(r,this.view.state,this.view,s);B&&g.appendChild(B)}}return t.from&&n.classList.add("cm-completionListIncompleteTop"),t.tonew Fk(A,i,e)}function S1A(i,e){let A=i.getBoundingClientRect(),t=e.getBoundingClientRect(),n=A.height/i.offsetHeight;t.topA.bottom&&(i.scrollTop+=(t.bottom-A.bottom)/n)}function YP(i){return(i.boost||0)*100+(i.apply?10:0)+(i.info?5:0)+(i.type?1:0)}function k1A(i,e){let A=[],t=null,n=null,o=g=>{A.push(g);let{section:C}=g.completion;if(C){t||(t=[]);let d=typeof C=="string"?C:C.name;t.some(B=>B.name==d)||t.push(typeof C=="string"?{name:d}:C)}},a=e.facet(Ur);for(let g of i)if(g.hasResult()){let C=g.result.getMatch;if(g.result.filter===!1)for(let d of g.result.options)o(new sw(d,g.source,C?C(d):[],1e9-A.length));else{let d=e.sliceDoc(g.from,g.to),B,u=a.filterStrict?new Nk(d):new Rk(d);for(let E of g.result.options)if(B=u.match(E.label)){let f=E.displayLabel?C?C(E,B.matched):[]:B.matched,m=B.score+(E.boost||0);if(o(new sw(E,g.source,f,m)),typeof E.section=="object"&&E.section.rank==="dynamic"){let{name:v}=E.section;n||(n=Object.create(null)),n[v]=Math.max(m,n[v]||-1e9)}}}}if(t){let g=Object.create(null),C=0,d=(B,u)=>(B.rank==="dynamic"&&u.rank==="dynamic"?n[u.name]-n[B.name]:0)||(typeof B.rank=="number"?B.rank:1e9)-(typeof u.rank=="number"?u.rank:1e9)||(B.named.score-C.score||l(C.completion,d.completion))){let C=g.completion;!s||s.label!=C.label||s.detail!=C.detail||s.type!=null&&C.type!=null&&s.type!=C.type||s.apply!=C.apply||s.boost!=C.boost?r.push(g):YP(g.completion)>YP(s)&&(r[r.length-1]=g),s=g.completion}return r}var Lk=class i{constructor(e,A,t,n,o,a){this.options=e,this.attrs=A,this.tooltip=t,this.timestamp=n,this.selected=o,this.disabled=a}setSelected(e,A){return e==this.selected||e>=this.options.length?this:new i(this.options,HP(A,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,A,t,n,o,a){if(n&&!a&&e.some(l=>l.isPending))return n.setDisabled();let r=k1A(e,A);if(!r.length)return n&&e.some(l=>l.isPending)?n.setDisabled():null;let s=A.facet(Ur).selectOnOpen?0:-1;if(n&&n.selected!=s&&n.selected!=-1){let l=n.options[n.selected].completion;for(let g=0;gg.hasResult()?Math.min(l,g.from):l,1e8),create:L1A,above:o.aboveCursor},n?n.timestamp:Date.now(),s,!1)}map(e){return new i(this.options,this.attrs,$A(P({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new i(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},Gk=class i{constructor(e,A,t){this.active=e,this.id=A,this.open=t}static start(){return new i(N1A,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:A}=e,t=A.facet(Ur),o=(t.override||A.languageDataAt("autocomplete",Gd(A)).map(D1A)).map(s=>(this.active.find(g=>g.source==s)||new dC(s,this.active.some(g=>g.state!=0)?1:0)).update(e,t));o.length==this.active.length&&o.every((s,l)=>s==this.active[l])&&(o=this.active);let a=this.open,r=e.effects.some(s=>s.is(Tk));a&&e.docChanged&&(a=a.map(e.changes)),e.selection||o.some(s=>s.hasResult()&&e.changes.touchesRange(s.from,s.to))||!_1A(o,this.active)||r?a=Lk.build(o,A,this.id,a,t,r):a&&a.disabled&&!o.some(s=>s.isPending)&&(a=null),!a&&o.every(s=>!s.isPending)&&o.some(s=>s.hasResult())&&(o=o.map(s=>s.hasResult()?new dC(s.source,0):s));for(let s of e.effects)s.is(Uk)&&(a=a&&a.setSelected(s.value,this.id));return o==this.active&&a==this.open?this:new i(o,this.id,a)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?x1A:R1A}};function _1A(i,e){if(i==e)return!0;for(let A=0,t=0;;){for(;A-1&&(A["aria-activedescendant"]=i+"-"+e),A}var N1A=[];function qP(i,e){if(i.isUserEvent("input.complete")){let t=i.annotation(VP);if(t&&e.activateOnCompletion(t))return 12}let A=i.isUserEvent("input.type");return A&&e.activateOnTyping?5:A?1:i.isUserEvent("delete.backward")?2:i.selection?8:i.docChanged?16:0}var dC=class i{constructor(e,A,t=!1){this.source=e,this.state=A,this.explicit=t}hasResult(){return!1}get isPending(){return this.state==1}update(e,A){let t=qP(e,A),n=this;(t&8||t&16&&this.touches(e))&&(n=new i(n.source,0)),t&4&&n.state==0&&(n=new i(this.source,1)),n=n.updateFor(e,t);for(let o of e.effects)if(o.is(lw))n=new i(n.source,1,o.value);else if(o.is(x4))n=new i(n.source,0);else if(o.is(Tk))for(let a of o.value)a.source==n.source&&(n=a);return n}updateFor(e,A){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(Gd(e.state))}},gw=class i extends dC{constructor(e,A,t,n,o,a){super(e,3,A),this.limit=t,this.result=n,this.from=o,this.to=a}hasResult(){return!0}updateFor(e,A){var t;if(!(A&3))return this.map(e.changes);let n=this.result;n.map&&!e.changes.empty&&(n=n.map(n,e.changes));let o=e.changes.mapPos(this.from),a=e.changes.mapPos(this.to,1),r=Gd(e.state);if(r>a||!n||A&2&&(Gd(e.startState)==this.from||rA.map(e))}}),dl=La.define({create(){return Gk.start()},update(i,e){return i.update(e)},provide:i=>[ch.from(i,e=>e.tooltip),ui.contentAttributes.from(i,e=>e.attrs)]});function Ok(i,e){let A=e.completion.apply||e.completion.label,t=i.state.field(dl).active.find(n=>n.source==e.source);return t instanceof gw?(typeof A=="string"?i.dispatch($A(P({},y1A(i.state,A,t.from,t.to)),{annotations:VP.of(e.completion)})):A(i,e.completion,t.from,t.to),!0):!1}var L1A=M1A(dl,Ok);function aw(i,e="option"){return A=>{let t=A.state.field(dl,!1);if(!t||!t.open||t.open.disabled||Date.now()-t.open.timestamp-1?t.open.selected+n*(i?1:-1):i?0:a-1;return r<0?r=e=="page"?0:a-1:r>=a&&(r=e=="page"?a-1:0),A.dispatch({effects:Uk.of(r)}),!0}}var G1A=i=>{let e=i.state.field(dl,!1);return i.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampi.state.field(dl,!1)?(i.dispatch({effects:lw.of(!0)}),!0):!1,K1A=i=>{let e=i.state.field(dl,!1);return!e||!e.active.some(A=>A.state!=0)?!1:(i.dispatch({effects:x4.of(null)}),!0)},Kk=class{constructor(e,A){this.active=e,this.context=A,this.time=Date.now(),this.updates=[],this.done=void 0}},U1A=50,T1A=1e3,O1A=Po.fromClass(class{constructor(i){this.view=i,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of i.state.field(dl).active)e.isPending&&this.startQuery(e)}update(i){let e=i.state.field(dl),A=i.state.facet(Ur);if(!i.selectionSet&&!i.docChanged&&i.startState.field(dl)==e)return;let t=i.transactions.some(o=>{let a=qP(o,A);return a&8||(o.selection||o.docChanged)&&!(a&3)});for(let o=0;oU1A&&Date.now()-a.time>T1A){for(let r of a.context.abortListeners)try{r()}catch(s){Gr(this.view.state,s)}a.context.abortListeners=null,this.running.splice(o--,1)}else a.updates.push(...i.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),i.transactions.some(o=>o.effects.some(a=>a.is(lw)))&&(this.pendingStart=!0);let n=this.pendingStart?50:A.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(o=>o.isPending&&!this.running.some(a=>a.active.source==o.source))?setTimeout(()=>this.startUpdate(),n):-1,this.composing!=0)for(let o of i.transactions)o.isUserEvent("input.type")?this.composing=2:this.composing==2&&o.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:i}=this.view,e=i.field(dl);for(let A of e.active)A.isPending&&!this.running.some(t=>t.active.source==A.source)&&this.startQuery(A);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ur).updateSyncTime))}startQuery(i){let{state:e}=this.view,A=Gd(e),t=new rw(e,A,i.explicit,this.view),n=new Kk(i,t);this.running.push(n),Promise.resolve(i.source(t)).then(o=>{n.context.aborted||(n.done=o||null,this.scheduleAccept())},o=>{this.view.dispatch({effects:x4.of(null)}),Gr(this.view.state,o)})}scheduleAccept(){this.running.every(i=>i.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ur).updateSyncTime))}accept(){var i;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],A=this.view.state.facet(Ur),t=this.view.state.field(dl);for(let n=0;nr.source==o.active.source);if(a&&a.isPending)if(o.done==null){let r=new dC(o.active.source,0);for(let s of o.updates)r=r.update(s,A);r.isPending||e.push(r)}else this.startQuery(a)}(e.length||t.open&&t.open.disabled)&&this.view.dispatch({effects:Tk.of(e)})}},{eventHandlers:{blur(i){let e=this.view.state.field(dl,!1);if(e&&e.tooltip&&this.view.state.facet(Ur).closeOnBlur){let A=e.open&&wS(this.view,e.open.tooltip);(!A||!A.dom.contains(i.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:x4.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:lw.of(!1)}),20),this.composing=0}}}),J1A=typeof navigator=="object"&&/Win/.test(navigator.platform),Y1A=oc.highest(ui.domEventHandlers({keydown(i,e){let A=e.state.field(dl,!1);if(!A||!A.open||A.open.disabled||A.open.selected<0||i.key.length>1||i.ctrlKey&&!(J1A&&i.altKey)||i.metaKey)return!1;let t=A.open.options[A.open.selected],n=A.active.find(a=>a.source==t.source),o=t.completion.commitCharacters||n.result.commitCharacters;return o&&o.indexOf(i.key)>-1&&Ok(e,t),!1}})),H1A=ui.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xB7\xB7\xB7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25CB'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25CC'"}},".cm-completionIcon-variable":{"&:after":{content:"'\u{1D465}'"}},".cm-completionIcon-constant":{"&:after":{content:"'\u{1D436}'"}},".cm-completionIcon-type":{"&:after":{content:"'\u{1D461}'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222A'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25A1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\u{1F511}\uFE0E'"}},".cm-completionIcon-namespace":{"&:after":{content:"'\u25A2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});var R4={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Ld=ln.define({map(i,e){let A=e.mapPos(i,-1,Wr.TrackAfter);return A??void 0}}),Jk=new class extends cg{};Jk.startSide=1;Jk.endSide=-1;var WP=La.define({create(){return uo.empty},update(i,e){if(i=i.map(e.changes),e.selection){let A=e.state.doc.lineAt(e.selection.main.head);i=i.update({filter:t=>t>=A.from&&t<=A.to})}for(let A of e.effects)A.is(Ld)&&(i=i.update({add:[Jk.range(A.value,A.value+1)]}));return i}});function ZP(){return[P1A,WP]}var xk="()[]{}<>\xAB\xBB\xBB\xAB\uFF3B\uFF3D\uFF5B\uFF5D";function XP(i){for(let e=0;e{if((z1A?i.composing:i.compositionStarted)||i.state.readOnly)return!1;let n=i.state.selection.main;if(t.length>2||t.length==2&&Rl($r(t,0))==1||e!=n.from||A!=n.to)return!1;let o=V1A(i.state,t);return o?(i.dispatch(o),!0):!1}),j1A=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=$P(i,i.selection.main.head).brackets||R4.brackets,n=null,o=i.changeByRange(a=>{if(a.empty){let r=q1A(i.doc,a.head);for(let s of t)if(s==r&&cw(i.doc,a.head)==XP($r(s,0)))return{changes:{from:a.head-s.length,to:a.head+s.length},range:Be.cursor(a.head-s.length)}}return{range:n=a}});return n||e(i.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!n},Aj=[{key:"Backspace",run:j1A}];function V1A(i,e){let A=$P(i,i.selection.main.head),t=A.brackets||R4.brackets;for(let n of t){let o=XP($r(n,0));if(e==n)return o==n?X1A(i,n,t.indexOf(n+n+n)>-1,A):W1A(i,n,o,A.before||R4.before);if(e==o&&ej(i,i.selection.main.from))return Z1A(i,n,o)}return null}function ej(i,e){let A=!1;return i.field(WP).between(0,i.doc.length,t=>{t==e&&(A=!0)}),A}function cw(i,e){let A=i.sliceString(e,e+2);return A.slice(0,Rl($r(A,0)))}function q1A(i,e){let A=i.sliceString(e-2,e);return Rl($r(A,0))==A.length?A:A.slice(1)}function W1A(i,e,A,t){let n=null,o=i.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:A,from:a.to}],effects:Ld.of(a.to+e.length),range:Be.range(a.anchor+e.length,a.head+e.length)};let r=cw(i.doc,a.head);return!r||/\s/.test(r)||t.indexOf(r)>-1?{changes:{insert:e+A,from:a.head},effects:Ld.of(a.head+e.length),range:Be.cursor(a.head+e.length)}:{range:n=a}});return n?null:i.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Z1A(i,e,A){let t=null,n=i.changeByRange(o=>o.empty&&cw(i.doc,o.head)==A?{changes:{from:o.head,to:o.head+A.length,insert:A},range:Be.cursor(o.head+A.length)}:t={range:o});return t?null:i.update(n,{scrollIntoView:!0,userEvent:"input.type"})}function X1A(i,e,A,t){let n=t.stringPrefixes||R4.stringPrefixes,o=null,a=i.changeByRange(r=>{if(!r.empty)return{changes:[{insert:e,from:r.from},{insert:e,from:r.to}],effects:Ld.of(r.to+e.length),range:Be.range(r.anchor+e.length,r.head+e.length)};let s=r.head,l=cw(i.doc,s),g;if(l==e){if(zP(i,s))return{changes:{insert:e+e,from:s},effects:Ld.of(s+e.length),range:Be.cursor(s+e.length)};if(ej(i,s)){let d=A&&i.sliceDoc(s,s+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:s,to:s+d.length,insert:d},range:Be.cursor(s+d.length)}}}else{if(A&&i.sliceDoc(s-2*e.length,s)==e+e&&(g=PP(i,s-2*e.length,n))>-1&&zP(i,g))return{changes:{insert:e+e+e+e,from:s},effects:Ld.of(s+e.length),range:Be.cursor(s+e.length)};if(i.charCategorizer(s)(l)!=$o.Word&&PP(i,s,n)>-1&&!$1A(i,s,e,n))return{changes:{insert:e+e,from:s},effects:Ld.of(s+e.length),range:Be.cursor(s+e.length)}}return{range:o=r}});return o?null:i.update(a,{scrollIntoView:!0,userEvent:"input.type"})}function zP(i,e){let A=Kr(i).resolveInner(e+1);return A.parent&&A.from==e}function $1A(i,e,A,t){let n=Kr(i).resolveInner(e,-1),o=t.reduce((a,r)=>Math.max(a,r.length),0);for(let a=0;a<5;a++){let r=i.sliceDoc(n.from,Math.min(n.to,n.from+A.length+o)),s=r.indexOf(A);if(!s||s>-1&&t.indexOf(r.slice(0,s))>-1){let g=n.firstChild;for(;g&&g.from==n.from&&g.to-g.from>A.length+s;){if(i.sliceDoc(g.to-A.length,g.to)==A)return!1;g=g.firstChild}return!0}let l=n.to==e&&n.parent;if(!l)break;n=l}return!1}function PP(i,e,A){let t=i.charCategorizer(e);if(t(i.sliceDoc(e-1,e))!=$o.Word)return e;for(let n of A){let o=e-n.length;if(i.sliceDoc(o,e)==n&&t(i.sliceDoc(o-1,o))!=$o.Word)return o}return-1}function tj(i={}){return[Y1A,dl,Ur.of(i),O1A,AdA,H1A]}var Yk=[{key:"Ctrl-Space",run:_k},{mac:"Alt-`",run:_k},{mac:"Alt-i",run:_k},{key:"Escape",run:K1A},{key:"ArrowDown",run:aw(!0)},{key:"ArrowUp",run:aw(!1)},{key:"PageDown",run:aw(!0,"page")},{key:"PageUp",run:aw(!1,"page")},{key:"Enter",run:G1A}],AdA=oc.highest(gh.computeN([Ur],i=>i.facet(Ur).defaultKeymap?[Yk]:[]));function edA(i,e=i.state){let A=new Set;for(let{from:t,to:n}of i.visibleRanges){let o=t;for(;o<=n;){let a=e.doc.lineAt(o);A.has(a)||A.add(a),o=a.to+1}}return A}function Hk(i){let e=i.selection.main.head;return i.doc.lineAt(e)}function ij(i,e){let A=0;A:for(let t=0;t=o.level&&this.markerType!=="codeOnly"?this.set(e,0,n.level):n.empty&&n.level===0&&o.level!==0?this.set(e,0,0):o.level>n.level?this.set(e,0,n.level+1):this.set(e,0,o.level)}let A=ij(e.text,this.state.tabSize),t=Math.floor(A/this.unitWidth);return this.set(e,A,t)}closestNonEmpty(e,A){let t=e.number+A;for(;A===-1?t>=1:t<=this.state.doc.lines;){if(this.has(t)){let a=this.get(t);if(!a.empty)return a}let o=this.state.doc.line(t);if(o.text.trim().length){let a=ij(o.text,this.state.tabSize),r=Math.floor(a/this.unitWidth);return this.set(o,a,r)}t+=A}let n=this.state.doc.line(A===-1?1:this.state.doc.lines);return this.set(n,0,0)}findAndSetActiveLines(){let e=Hk(this.state);if(!this.has(e))return;let A=this.get(e);if(this.has(A.line.number+1)){let o=this.get(A.line.number+1);o.level>A.level&&(A=o)}if(this.has(A.line.number-1)){let o=this.get(A.line.number-1);o.level>A.level&&(A=o)}if(A.level===0)return;A.active=A.level;let t,n;for(t=A.line.number;t>1;t--){if(!this.has(t-1))continue;let o=this.get(t-1);if(o.level0&&s.push(Cw("--indent-marker-bg-color",t,e,r,l)),s.push(Cw("--indent-marker-active-bg-color",n,e,a-1,1)),a!==o&&s.push(Cw("--indent-marker-bg-color",t,e,a,o-a))}else s.push(Cw("--indent-marker-bg-color",t,e,r,o-r));return s.join(",")}var Pk=class{constructor(e){this.view=e,this.unitWidth=Cc(e.state),this.currentLineNumber=Hk(e.state).number,this.generate(e.state)}update(e){let A=Cc(e.state),t=A!==this.unitWidth;t&&(this.unitWidth=A);let n=Hk(e.state).number,o=n!==this.currentLineNumber;this.currentLineNumber=n;let a=e.state.facet(dw).highlightActiveBlock&&o;(e.docChanged||e.viewportChanged||t||a)&&this.generate(e.state)}generate(e){let A=new Xr,t=edA(this.view,e),{hideFirstIndent:n,markerType:o,thickness:a,activeThickness:r}=e.facet(dw),s=new zk(t,e,this.unitWidth,o);for(let l of t){let g=s.get(l.number);if(!g?.level)continue;let C=idA(g,this.unitWidth,n,a,r);A.add(l.from,l.from,Lt.line({class:"cm-indent-markers",attributes:{style:`--indent-markers: ${C}`}}))}this.decorations=A.finish()}};function nj(i={}){return[dw.of(i),tdA(i.colors),Po.fromClass(Pk,{decorations:e=>e.decorations})]}var ndA=["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"],odA=["mainAxis","crossAxis","limiter"];function mV(i,e){if(i==null)return{};var A,t,n=(function(a,r){if(a==null)return{};var s={};for(var l in a)if({}.hasOwnProperty.call(a,l)){if(r.indexOf(l)!==-1)continue;s[l]=a[l]}return s})(i,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(i);for(t=0;t{};function ddA(i){return i()}function f_(i){for(var e=0;e{i=A,e=t}),resolve:i,reject:e}}var IdA=1<<24,oE=16,s5=32,MV=64,tx=128,fc=512,ts=1024,mc=2048,_C=4096,w0=8192,aE=16384,ix=32768,Zd=65536,BdA=1<<17,SV=1<<18,kV=1<<19,hC=1<<25,Ow=32768,m_=1<<21,$2=1<<23,y0=Symbol("$state"),_V=Symbol("legacy props"),hdA=Symbol(""),Rh=new class extends Error{constructor(){super(...arguments),u0(this,"name","StaleReactionError"),u0(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function sp(i){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function xV(i){return i===this.v}function RV(i,e){return i!=i?e==e:i!==e||i!==null&&typeof i=="object"||typeof i=="function"}function NV(i){return!RV(i,this.v)}var Mo=null;function Ph(i){Mo=i}function s1(i){return FV().get(i)}function Jt(i){Mo={p:Mo,i:!1,c:null,e:null,s:i,x:null,l:nE&&!(arguments.length>1&&arguments[1]!==void 0&&arguments[1])?{s:null,u:null,$:[]}:null}}function Yt(i){var e=Mo,A=e.e;if(A!==null)for(var t of(e.e=null,A))XV(t);return i!==void 0&&(e.x=i),e.i=!0,Mo=e.p,i??{}}function rE(){return!nE||Mo!==null&&Mo.l===null}function FV(i){var e,A;return Mo===null&&sp(),(A=(e=Mo).c)!==null&&A!==void 0?A:e.c=new Map((function(t){for(var n=t.p;n!==null;){var o=n.c;if(o!==null)return o;n=n.p}return null})(Mo)||void 0)}var zd=[];function LV(){var i=zd;zd=[],f_(i)}function Xd(i){if(zd.length===0&&!z4){var e=zd;queueMicrotask(()=>{e===zd&&LV()})}zd.push(i)}function EdA(){for(;zd.length>0;)LV()}function GV(i){var e=co;if(e===null)return go.f|=$2,i;if((e.f&ix)===0){if((e.f&tx)===0)throw i;e.b.error(i)}else jh(i,e)}function jh(i,e){for(;e!==null;){if((e.f&tx)!==0)try{return void e.b.error(i)}catch(A){i=A}e=e.parent}throw i}var Rw=new Set,ea=null,H4=null,mg=null,fg=[],l5=null,w_=!1,z4=!1,Jw=new WeakMap,Iw=new WeakMap,Od=new WeakMap,Jd=new WeakMap,Bw=new WeakMap,Nw=new WeakMap,Fw=new WeakMap,Ul=new WeakSet,$d=class i{constructor(){wV(this,Ul),u0(this,"committed",!1),u0(this,"current",new Map),u0(this,"previous",new Map),Go(this,Jw,new Set),Go(this,Iw,new Set),Go(this,Od,0),Go(this,Jd,0),Go(this,Bw,null),Go(this,Nw,[]),Go(this,Fw,[]),u0(this,"skipped_effects",new Set),u0(this,"is_fork",!1)}is_deferred(){return this.is_fork||xe(Jd,this)>0}process(e){fg=[],H4=null,this.apply();var A,t={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(var n of e)or(Ul,this,KV).call(this,n,t);this.is_fork||or(Ul,this,QdA).call(this),this.is_deferred()?(or(Ul,this,Uh).call(this,t.effects),or(Ul,this,Uh).call(this,t.render_effects),or(Ul,this,Uh).call(this,t.block_effects)):(H4=this,ea=null,gj(t.render_effects),gj(t.effects),H4=null,(A=xe(Bw,this))===null||A===void 0||A.resolve()),mg=null}capture(e,A){var t;this.previous.has(e)||this.previous.set(e,A),(e.f&$2)===0&&(this.current.set(e,e.v),(t=mg)===null||t===void 0||t.set(e,e.v))}activate(){ea=this,this.apply()}deactivate(){ea===this&&(ea=null,mg=null)}flush(){if(this.activate(),fg.length>0){if(TV(),ea!==null&&ea!==this)return}else xe(Od,this)===0&&this.process([]);this.deactivate()}discard(){for(var e of xe(Iw,this))e(this);xe(Iw,this).clear()}increment(e){vn(Od,this,xe(Od,this)+1),e&&vn(Jd,this,xe(Jd,this)+1)}decrement(e){vn(Od,this,xe(Od,this)-1),e&&vn(Jd,this,xe(Jd,this)-1),this.revive()}revive(){for(var e of xe(Nw,this))ns(e,mc),AI(e);for(var A of xe(Fw,this))ns(A,_C),AI(A);vn(Nw,this,[]),vn(Fw,this,[]),this.flush()}oncommit(e){xe(Jw,this).add(e)}ondiscard(e){xe(Iw,this).add(e)}settled(){var e;return((e=xe(Bw,this))!==null&&e!==void 0?e:vn(Bw,this,bV())).promise}static ensure(){if(ea===null){var e=ea=new i;Rw.add(ea),z4||i.enqueue(()=>{ea===e&&e.flush()})}return ea}static enqueue(e){Xd(e)}apply(){}};function KV(i,e){i.f^=ts;for(var A=i.first;A!==null;){var t,n=A.f,o=!!(96&n),a=o&&(n&ts)!==0||(n&w0)!==0||this.skipped_effects.has(A);if((A.f&tx)!==0&&(t=A.b)!==null&&t!==void 0&&t.is_pending()&&(e={parent:e,effect:A,effects:[],render_effects:[],block_effects:[]}),!a&&A.fn!==null){o?A.f^=ts:4&n?e.effects.push(A):gE(A)&&((A.f&oE)!==0&&e.block_effects.push(A),Wh(A));var r=A.first;if(r!==null){A=r;continue}}var s=A.parent;for(A=A.next;A===null&&s!==null;)s===e.effect&&(or(Ul,this,Uh).call(this,e.effects),or(Ul,this,Uh).call(this,e.render_effects),or(Ul,this,Uh).call(this,e.block_effects),e=e.parent),A=s.next,s=s.parent}}function Uh(i){for(var e of i)((e.f&mc)!==0?xe(Nw,this):xe(Fw,this)).push(e),or(Ul,this,UV).call(this,e.deps),ns(e,ts)}function UV(i){if(i!==null)for(var e of i)2&e.f&&(e.f&Ow)!==0&&(e.f^=Ow,or(Ul,this,UV).call(this,e.deps))}function QdA(){if(xe(Jd,this)===0){for(var i of xe(Jw,this))i();xe(Jw,this).clear()}xe(Od,this)===0&&or(Ul,this,udA).call(this)}function udA(){if(Rw.size>1){this.previous.clear();var i=mg,e=!0,A={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(var t of Rw)if(t!==this){var n=[];for(var[o,a]of this.current){if(t.current.has(o)){if(!e||a===t.current.get(o))continue;t.current.set(o,a)}n.push(o)}if(n.length!==0){var r=[...t.current.keys()].filter(B=>!this.current.has(B));if(r.length>0){var s=fg;fg=[];var l=new Set,g=new Map;for(var C of n)OV(C,r,l,g);if(fg.length>0){for(var d of(ea=t,t.apply(),fg))or(Ul,t,KV).call(t,d,A);t.deactivate()}fg=s}}}else e=!1;ea=null,mg=i}this.committed=!0,Rw.delete(this)}function jo(i){var e=z4;z4=!0;try{for(;;){var A;if(EdA(),fg.length===0&&((A=ea)===null||A===void 0||A.flush(),fg.length===0))return void(l5=null);TV()}}finally{z4=e}}function TV(){var i=jd;w_=!0;try{var e=0;for(Yw(!0);fg.length>0;){var A=$d.ensure();e++>1e3&&pdA(),A.process(fg),A1.clear()}}finally{w_=!1,Yw(i),l5=null}}function pdA(){try{(function(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")})()}catch(i){jh(i,l5)}}var QC=null;function gj(i){var e=i.length;if(e!==0){for(var A=0;A0)){for(var o of(A1.clear(),QC))if(!(24576&o.f)){for(var a=[o],r=o.parent;r!==null;)QC.has(r)&&(QC.delete(r),a.push(r)),r=r.parent;for(var s=a.length-1;s>=0;s--){var l=a[s];24576&l.f||Wh(l)}}QC.clear()}}QC=null}}function OV(i,e,A,t){if(!A.has(i)&&(A.add(i),i.reactions!==null))for(var n of i.reactions){var o=n.f;2&o?OV(n,e,A,t):4194320&o&&(o&mc)===0&&JV(n,e,t)&&(ns(n,mc),AI(n))}}function JV(i,e,A){var t=A.get(i);if(t!==void 0)return t;if(i.deps!==null)for(var n of i.deps){if(e.includes(n))return!0;if(2&n.f&&JV(n,e,A))return A.set(n,!0),!0}return A.set(i,!1),!1}function AI(i){for(var e=l5=i;e.parent!==null;){var A=(e=e.parent).f;if(w_&&e===co&&(A&oE)!==0&&(A&SV)===0)return;if(96&A){if((A&ts)===0)return;e.f^=ts}}fg.push(e)}var H2=new WeakMap,q2=new WeakMap,fdA=new WeakMap,Yd=new WeakMap,qk=new WeakMap,V2=new WeakMap,z2=new WeakMap,fC=new WeakMap,U2=new WeakMap,Pd=new WeakMap,Th=new WeakMap,mh=new WeakMap,Oh=new WeakMap,F4=new WeakMap,wh=new WeakMap,cj=new WeakMap,O2=new WeakSet,y_=class{constructor(e,A,t){var n,o,a,r;wV(this,O2),u0(this,"parent",void 0),Go(this,H2,!1),Go(this,q2,void 0),Go(this,fdA,null),Go(this,Yd,void 0),Go(this,qk,void 0),Go(this,V2,void 0),Go(this,z2,null),Go(this,fC,null),Go(this,U2,null),Go(this,Pd,null),Go(this,Th,null),Go(this,mh,0),Go(this,Oh,0),Go(this,F4,!1),Go(this,wh,null),Go(this,cj,(n=()=>(vn(wh,this,xC(xe(mh,this))),()=>{vn(wh,this,null)}),a=0,r=xC(0),()=>{j4()&&(c(r),sE(()=>(a===0&&(o=uA(()=>n(()=>P4(r)))),a+=1,()=>{Xd(()=>{var s;(a-=1)==0&&((s=o)===null||s===void 0||s(),o=void 0,P4(r))})})))})),vn(q2,this,e),vn(Yd,this,A),vn(qk,this,t),this.parent=co.b,vn(H2,this,!!xe(Yd,this).pending),vn(V2,this,lE(()=>{co.b=this;var s=or(O2,this,mdA).call(this);try{vn(z2,this,D0(()=>t(s)))}catch(l){this.error(l)}return xe(Oh,this)>0?or(O2,this,dj).call(this):vn(H2,this,!1),()=>{var l;(l=xe(Th,this))===null||l===void 0||l.remove()}},589952))}is_pending(){return xe(H2,this)||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!xe(Yd,this).pending}update_pending_count(e){or(O2,this,YV).call(this,e),vn(mh,this,xe(mh,this)+e),xe(wh,this)&&Vh(xe(wh,this),xe(mh,this))}get_effect_pending(){return xe(cj,this).call(this),c(xe(wh,this))}error(e){var A=xe(Yd,this).onerror,t=xe(Yd,this).failed;if(xe(F4,this)||!A&&!t)throw e;xe(z2,this)&&(is(xe(z2,this)),vn(z2,this,null)),xe(fC,this)&&(is(xe(fC,this)),vn(fC,this,null)),xe(U2,this)&&(is(xe(U2,this)),vn(U2,this,null));var n=!1,o=!1,a=()=>{n?console.warn("https://svelte.dev/e/svelte_boundary_reset_noop"):(n=!0,o&&(function(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")})(),$d.ensure(),vn(mh,this,0),xe(U2,this)!==null&&qh(xe(U2,this),()=>{vn(U2,this,null)}),vn(H2,this,this.has_pending_snippet()),vn(z2,this,or(O2,this,Cj).call(this,()=>(vn(F4,this,!1),D0(()=>xe(qk,this).call(this,xe(q2,this)))))),xe(Oh,this)>0?or(O2,this,dj).call(this):vn(H2,this,!1))},r=go;try{Ql(null),o=!0,A?.(e,a),o=!1}catch(s){jh(s,xe(V2,this)&&xe(V2,this).parent)}finally{Ql(r)}t&&Xd(()=>{vn(U2,this,or(O2,this,Cj).call(this,()=>{$d.ensure(),vn(F4,this,!0);try{return D0(()=>{t(xe(q2,this),()=>e,()=>a)})}catch(s){return jh(s,xe(V2,this).parent),null}finally{vn(F4,this,!1)}}))})}};function mdA(){var i=xe(q2,this);return xe(H2,this)&&(vn(Th,this,e1()),xe(q2,this).before(xe(Th,this)),i=xe(Th,this)),i}function Cj(i){var e=co,A=go,t=Mo;yg(xe(V2,this)),Ql(xe(V2,this)),Ph(xe(V2,this).ctx);try{return i()}catch(n){return GV(n),null}finally{yg(e),Ql(A),Ph(t)}}function dj(){var i=xe(Yd,this).pending;xe(z2,this)!==null&&(vn(Pd,this,document.createDocumentFragment()),xe(Pd,this).append(xe(Th,this)),aq(xe(z2,this),xe(Pd,this))),xe(fC,this)===null&&vn(fC,this,D0(()=>i(xe(q2,this))))}function YV(i){var e;this.has_pending_snippet()?(vn(Oh,this,xe(Oh,this)+i),xe(Oh,this)===0&&(vn(H2,this,!1),xe(fC,this)&&qh(xe(fC,this),()=>{vn(fC,this,null)}),xe(Pd,this)&&(xe(q2,this).before(xe(Pd,this)),vn(Pd,this,null)))):this.parent&&or(O2,e=this.parent,YV).call(e,i)}function HV(i,e,A,t){var n=rE()?lp:lt;if(A.length!==0||i.length!==0){var o=ea,a=co,r=(function(){var l=co,g=go,C=Mo,d=ea;return function(){var B=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];yg(l),Ql(g),Ph(C),B&&d?.activate()}})();i.length>0?Promise.all(i).then(()=>{r();try{return s()}finally{o?.deactivate(),hw()}}):s()}else t(e.map(n));function s(){Promise.all(A.map(l=>(function(g){var C=co;C===null&&(function(){throw new Error("https://svelte.dev/e/async_derived_orphan")})();var d=C.b,B=void 0,u=xC(es),E=!go,f=new Map;return(function(m){yc(4718592,m,!0)})(()=>{var m=bV();B=m.promise;try{Promise.resolve(g()).then(m.resolve,m.reject).then(()=>{v===ea&&v.committed&&v.deactivate(),hw()})}catch(x){m.reject(x),hw()}var v=ea;if(E){var S,k=!d.is_pending();d.update_pending_count(1),v.increment(k),(S=f.get(v))===null||S===void 0||S.reject(Rh),f.delete(v),f.set(v,m)}var M=function(x){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;if(v.activate(),F)F!==Rh&&(u.f|=$2,Vh(u,F));else for(var[z,j]of((u.f&$2)!==0&&(u.f^=$2),Vh(u,x),f)){if(f.delete(z),z===v)break;j.reject(Rh)}E&&(d.update_pending_count(-1),v.decrement(k))};m.promise.then(M,x=>M(null,x||"unknown"))}),c5(()=>{for(var m of f.values())m.reject(Rh)}),new Promise(m=>{function v(S){function k(){S===B?m(u):v(B)}S.then(k,k)}v(B)})})(l))).then(l=>{r();try{t([...e.map(n),...l])}catch(g){(a.f&aE)===0&&jh(g,a)}o?.deactivate(),hw()}).catch(l=>{jh(l,a)})}}function hw(){yg(null),Ql(null),Ph(null)}function lp(i){var e=go!==null&&2&go.f?go:null;return co!==null&&(co.f|=kV),{ctx:Mo,deps:null,effects:null,equals:xV,f:2050,fn:i,reactions:null,rv:0,v:es,wv:0,parent:e??co,ac:null}}function Bl(i){var e=lp(i);return rq(e),e}function lt(i){var e=lp(i);return e.equals=NV,e}function zV(i){var e=i.effects;if(e!==null){i.effects=null;for(var A=0;A1&&arguments[1]!==void 0&&arguments[1],n=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],o=xC(i);return t||(o.equals=NV),nE&&n&&Mo!==null&&Mo.l!==null&&((A=(e=Mo.l).s)!==null&&A!==void 0?A:e.s=[]).push(o),o}function Ol(i,e){return N(i,uA(()=>c(i))),e}function N(i,e){var A,t=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return go===null||f0&&(go.f&BdA)===0||!rE()||!(4325394&go.f)||(A=MC)!==null&&A!==void 0&&A.includes(i)||(function(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")})(),Vh(i,t?Nh(e):e)}function Vh(i,e){if(!i.equals(e)){var A=i.v;rI?A1.set(i,e):A1.set(i,A),i.v=e;var t=$d.ensure();t.capture(i,A),2&i.f&&((i.f&mc)!==0&&nx(i),ns(i,(i.f&fc)!==0?ts:_C)),i.wv=lq(),WV(i,mc),!rE()||co===null||(co.f&ts)===0||96&co.f||(Eg===null?(function(n){Eg=n})([i]):Eg.push(i)),!t.is_fork&&Wk.size>0&&!Ij&&(function(){Ij=!1;var n=jd;Yw(!0);var o=Array.from(Wk);try{for(var a of o)(a.f&ts)!==0&&ns(a,_C),gE(a)&&Wh(a)}finally{Yw(n)}Wk.clear()})()}return e}function Bj(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,A=c(i),t=e===1?A++:A--;return N(i,A),t}function P4(i){N(i,i.v+1)}function WV(i,e){var A=i.reactions;if(A!==null)for(var t=rE(),n=A.length,o=0;o{if(Vd===o)return r();var s=go,l=Vd;Ql(null),uj(o);var g=r();return Ql(s),uj(l),g};return t&&A.set("length",EC(i.length)),new Proxy(i,{defineProperty(r,s,l){"value"in l&&l.configurable!==!1&&l.enumerable!==!1&&l.writable!==!1||(function(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")})();var g=A.get(s);return g===void 0?g=a(()=>{var C=EC(l.value);return A.set(s,C),C}):N(g,l.value,!0),!0},deleteProperty(r,s){var l=A.get(s);if(l===void 0){if(s in r){var g=a(()=>EC(es));A.set(s,g),P4(n)}}else N(l,es),P4(n);return!0},get(r,s,l){var g;if(s===y0)return i;var C=A.get(s),d=s in r;if(C===void 0&&(!d||(g=vC(r,s))!==null&&g!==void 0&&g.writable)&&(C=a(()=>EC(Nh(d?r[s]:es))),A.set(s,C)),C!==void 0){var B=c(C);return B===es?void 0:B}return Reflect.get(r,s,l)},getOwnPropertyDescriptor(r,s){var l=Reflect.getOwnPropertyDescriptor(r,s);if(l&&"value"in l){var g=A.get(s);g&&(l.value=c(g))}else if(l===void 0){var C=A.get(s),d=C?.v;if(C!==void 0&&d!==es)return{enumerable:!0,configurable:!0,value:d,writable:!0}}return l},has(r,s){var l;if(s===y0)return!0;var g=A.get(s),C=g!==void 0&&g.v!==es||Reflect.has(r,s);return(g!==void 0||co!==null&&(!C||(l=vC(r,s))!==null&&l!==void 0&&l.writable))&&(g===void 0&&(g=a(()=>EC(C?Nh(r[s]):es)),A.set(s,g)),c(g)===es)?!1:C},set(r,s,l,g){var C,d=A.get(s),B=s in r;if(t&&s==="length")for(var u=l;uEC(es)),A.set(u+"",E))}d===void 0?(!B||(C=vC(r,s))!==null&&C!==void 0&&C.writable)&&(N(d=a(()=>EC(void 0)),Nh(l)),A.set(s,d)):(B=d.v!==es,N(d,a(()=>Nh(l))));var f=Reflect.getOwnPropertyDescriptor(r,s);if(f!=null&&f.set&&f.set.call(g,l),!B){if(t&&typeof s=="string"){var m=A.get("length"),v=Number(s);Number.isInteger(v)&&v>=m.v&&N(m,v+1)}P4(n)}return!0},ownKeys(r){c(n);var s=Reflect.ownKeys(r).filter(C=>{var d=A.get(C);return d===void 0||d.v!==es});for(var[l,g]of A)g.v===es||l in r||s.push(l);return s},setPrototypeOf(){(function(){throw new Error("https://svelte.dev/e/state_prototype_fixed")})()}})}function hj(i){try{if(i!==null&&typeof i=="object"&&y0 in i)return i[y0]}catch(e){}return i}function wdA(i,e){return Object.is(hj(i),hj(e))}function e1(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return document.createTextNode(i)}function Jl(i){return VV.call(i)}function gp(i){return qV.call(i)}function gA(i,e){return Jl(i)}function at(i){var e=Jl(i);return e instanceof Comment&&e.data===""?gp(e):e}function kA(i){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,A=i;e--;)A=gp(A);return A}var Ej=!1;function g5(i){var e=go,A=co;Ql(null),yg(null);try{return i()}finally{Ql(e),yg(A)}}function ydA(i,e,A){var t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:A;i.addEventListener(e,()=>g5(A));var n=i.__on_r;i.__on_r=n?()=>{n(),t(!0)}:()=>t(!0),Ej||(Ej=!0,document.addEventListener("reset",o=>{Promise.resolve().then(()=>{if(!o.defaultPrevented)for(var a of o.target.elements){var r;(r=a.__on_r)===null||r===void 0||r.call(a)}})},{capture:!0}))}function ZV(i){co===null&&(go===null&&(function(){throw new Error("https://svelte.dev/e/effect_orphan")})(),(function(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")})()),rI&&(function(){throw new Error("https://svelte.dev/e/effect_in_teardown")})()}function yc(i,e,A){var t=co;t!==null&&(t.f&w0)!==0&&(i|=w0);var n={ctx:Mo,deps:null,nodes:null,f:i|mc|fc,first:null,fn:e,last:null,next:null,parent:t,b:t&&t.b,prev:null,teardown:null,wv:0,ac:null};if(A)try{Wh(n),n.f|=ix}catch(s){throw is(n),s}else e!==null&&AI(n);var o=n;if(A&&o.deps===null&&o.teardown===null&&o.nodes===null&&o.first===o.last&&(o.f&kV)===0&&(o=o.first,(i&oE)!==0&&(i&Zd)!==0&&o!==null&&(o.f|=Zd)),o!==null&&(o.parent=t,t!==null&&(function(s,l){var g=l.last;g===null?l.last=l.first=s:(g.next=s,s.prev=g,l.last=s)})(o,t),go!==null&&2&go.f&&(i&MV)===0)){var a,r=go;((a=r.effects)!==null&&a!==void 0?a:r.effects=[]).push(o)}return n}function j4(){return go!==null&&!f0}function c5(i){var e=yc(8,null,!1);return ns(e,ts),e.teardown=i,e}function D_(i){ZV();var e=co.f;if(!(!go&&(e&s5)!==0&&(e&ix)===0))return XV(i);var A,t=Mo;((A=t.e)!==null&&A!==void 0?A:t.e=[]).push(i)}function XV(i){return yc(1048580,i,!1)}function Tr(i){return yc(4,i,!1)}function KA(i,e){var A={effect:null,ran:!1,deps:i};Mo.l.$.push(A),A.effect=sE(()=>{i(),A.ran||(A.ran=!0,uA(e))})}function Vn(){var i=Mo;sE(()=>{for(var e of i.l.$){e.deps();var A=e.effect;(A.f&ts)!==0&&ns(A,_C),gE(A)&&Wh(A),e.ran=!1}})}function sE(i){return yc(8|(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0),i,!0)}function Le(i){HV(arguments.length>3&&arguments[3]!==void 0?arguments[3]:[],arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],e=>{yc(8,()=>i(...e.map(c)),!0)})}function lE(i){return yc(oE|(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0),i,!0)}function $V(i){return yc(IdA|(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0),i,!0)}function D0(i){return yc(524320,i,!0)}function Aq(i){var e=i.teardown;if(e!==null){var A=rI,t=go;Qj(!0),Ql(null);try{e.call(null)}finally{Qj(A),Ql(t)}}}function eq(i){var e=arguments.length>1&&arguments[1]!==void 0&&arguments[1],A=i.first;i.first=i.last=null;for(var t,n=function(){var o=A.ac;o!==null&&g5(()=>{o.abort(Rh)}),t=A.next,(A.f&MV)!==0?A.parent=null:is(A,e),A=t};A!==null;)n()}function is(i){var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],A=!1;!e&&(i.f&SV)===0||i.nodes===null||i.nodes.end===null||(tq(i.nodes.start,i.nodes.end),A=!0),eq(i,e&&!A),Hw(i,0),ns(i,aE);var t=i.nodes&&i.nodes.t;if(t!==null)for(var n of t)n.stop();Aq(i);var o=i.parent;o!==null&&o.first!==null&&iq(i),i.next=i.prev=i.teardown=i.ctx=i.deps=i.fn=i.nodes=i.ac=null}function tq(i,e){for(;i!==null;){var A=i===e?null:gp(i);i.remove(),i=A}}function iq(i){var e=i.parent,A=i.prev,t=i.next;A!==null&&(A.next=t),t!==null&&(t.prev=A),e!==null&&(e.first===i&&(e.first=t),e.last===i&&(e.last=A))}function qh(i,e){var A=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],t=[];nq(i,t,!0);var n=()=>{A&&is(i),e&&e()},o=t.length;if(o>0){var a=()=>--o||n();for(var r of t)r.out(a)}else n()}function nq(i,e,A){if((i.f&w0)===0){i.f^=w0;var t=i.nodes&&i.nodes.t;if(t!==null)for(var n of t)(n.is_global||A)&&e.push(n);for(var o=i.first;o!==null;){var a=o.next;nq(o,e,((o.f&Zd)!==0||(o.f&s5)!==0&&(i.f&oE)!==0)&&A),o=a}}}function v_(i){oq(i,!0)}function oq(i,e){if((i.f&w0)!==0){i.f^=w0,(i.f&ts)===0&&(ns(i,mc),AI(i));for(var A=i.first;A!==null;){var t=A.next;oq(A,((A.f&Zd)!==0||(A.f&s5)!==0)&&e),A=t}var n=i.nodes&&i.nodes.t;if(n!==null)for(var o of n)(o.is_global||e)&&o.in()}}function aq(i,e){if(i.nodes)for(var A=i.nodes.start,t=i.nodes.end;A!==null;){var n=A===t?null:gp(A);e.append(A),A=n}}var DdA=null;var jd=!1;function Yw(i){jd=i}var rI=!1;function Qj(i){rI=i}var go=null,f0=!1;function Ql(i){go=i}var co=null;function yg(i){co=i}var MC=null;function rq(i){go!==null&&(MC===null?MC=[i]:MC.push(i))}var Ts=null,Kl=0,Eg=null,sq=1,V4=0,Vd=V4;function uj(i){Vd=i}function lq(){return++sq}function gE(i){var e=i.f;if((e&mc)!==0)return!0;if(2&e&&(i.f&=-32769),(e&_C)!==0){var A=i.deps;if(A!==null)for(var t=A.length,n=0;ni.wv)return!0}(e&fc)!==0&&mg===null&&ns(i,ts)}return!1}function gq(i,e){var A,t=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],n=i.reactions;if(n!==null&&((A=MC)===null||A===void 0||!A.includes(i)))for(var o=0;o{i.ac.abort(Rh)}),i.ac=null);try{i.f|=m_;var g=(0,i.fn)(),C=i.deps;if(Ts!==null){var d;if(Hw(i,Kl),C!==null&&Kl>0)for(C.length=Kl+Ts.length,d=0;d1&&arguments[1]!==void 0?arguments[1]:new Set;if(!(typeof i!="object"||i===null||i instanceof EventTarget||e.has(i))){for(var A in e.add(i),i instanceof Date&&i.getTime(),i)try{b_(i[A],e)}catch(r){}var t=ex(i);if(t!==Object.prototype&&t!==Array.prototype&&t!==Map.prototype&&t!==Set.prototype&&t!==Date.prototype){var n=vV(t);for(var o in n){var a=n[o].get;if(a)try{a.call(i)}catch(r){}}}}}var hq=new Set,M_=new Set;function Eq(i,e,A){var t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};function n(o){if(t.capture||T4.call(e,o),!o.cancelBubble)return g5(()=>A?.call(this,o))}return i.startsWith("pointer")||i.startsWith("touch")||i==="wheel"?Xd(()=>{e.addEventListener(i,n,t)}):e.addEventListener(i,n,t),n}function De(i,e,A,t,n){var o={capture:t,passive:n},a=Eq(i,e,A,o);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&c5(()=>{e.removeEventListener(i,a,o)})}function cp(i){for(var e=0;ea||t});var C=go,d=co;Ql(null),yg(null);try{for(var B,u=[];a!==null;){var E=a.assignedSlot||a.parentNode||a.host||null;try{var f=a["__"+n];f==null||a.disabled&&i.target!==a||f.call(a,i)}catch(S){B?u.push(S):B=S}if(i.cancelBubble||E===A||E===null)break;a=E}if(B){var m=function(S){queueMicrotask(()=>{throw S})};for(var v of u)m(v);throw B}}finally{i.__root=A,delete i.currentTarget,Ql(C),yg(d)}}}function ox(i){var e=document.createElement("template");return e.innerHTML=i.replaceAll("",""),e.content}function eI(i,e){var A=co;A.nodes===null&&(A.nodes={start:i,end:e,a:null,t:null})}function TA(i,e){var A,t=!!(1&e),n=!!(2&e),o=!i.startsWith("");return()=>{A===void 0&&(A=ox(o?i:""+i),t||(A=Jl(A)));var a=n||jV?document.importNode(A,!0):A.cloneNode(!0);return t?eI(Jl(a),a.lastChild):eI(a,a),a}}function l1(i,e){return(function(A,t){var n,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"svg",a=!A.startsWith(""),r=!!(1&t),s="<".concat(o,">").concat(a?A:""+A,"");return()=>{if(!n){var l=Jl(ox(s));if(r)for(n=document.createDocumentFragment();Jl(l);)n.appendChild(Jl(l));else n=Jl(l)}var g=n.cloneNode(!0);return r?eI(Jl(g),g.lastChild):eI(g,g),g}})(i,e,"svg")}function mr(){var i=e1((arguments.length>0&&arguments[0]!==void 0?arguments[0]:"")+"");return eI(i,i),i}function zi(){var i=document.createDocumentFragment(),e=document.createComment(""),A=e1();return i.append(e,A),eI(e,A),i}function sA(i,e){i!==null&&i.before(e)}var MdA=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"],SdA={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"},kdA=["touchstart","touchmove"];function _dA(i){return kdA.includes(i)}function Ht(i,e){var A,t=e==null?"":typeof e=="object"?e+"":e;t!==((A=i.__t)!==null&&A!==void 0?A:i.__t=i.nodeValue)&&(i.__t=t,i.nodeValue=t+"")}function xdA(i,e){return(function(A,t){var{target:n,anchor:o,props:a={},events:r,context:s,intro:l=!0}=t;(function(){if(bC===void 0){bC=window,jV=/Firefox/.test(navigator.userAgent);var u=Element.prototype,E=Node.prototype,f=Text.prototype;VV=vC(E,"firstChild").get,qV=vC(E,"nextSibling").get,lj(u)&&(u.__click=void 0,u.__className=void 0,u.__attributes=null,u.__style=void 0,u.__e=void 0),lj(f)&&(f.__t=void 0)}})();var g=new Set,C=u=>{for(var E=0;E0&&arguments[0]!==void 0?arguments[0]:{};return new Promise(m=>{f.outro?qh(E,()=>{is(E),m(void 0)}):(is(E),m(void 0))})}})(()=>{var u=o??n.appendChild(e1());return(function(E,f,m){new y_(E,f,m)})(u,{pending:()=>{}},E=>{s&&(Jt({}),Mo.c=s),r&&(a.$$events=r),d=A(E,a)||{},s&&Yt()}),()=>{for(var E of g){n.removeEventListener(E,T4);var f=yh.get(E);--f===0?(document.removeEventListener(E,T4),yh.delete(E)):yh.set(E,f)}var m;M_.delete(C),u!==o&&((m=u.parentNode)===null||m===void 0||m.removeChild(u))}});return S_.set(d,B),d})(i,e)}var yh=new Map,S_=new WeakMap,Dh,IC=new WeakMap,Kd=new WeakMap,BC=new WeakMap,L4=new WeakMap,Zk=new WeakMap,pj=new WeakMap,RdA=new WeakMap,Zh=class{constructor(e){var A=this,t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];u0(this,"anchor",void 0),Go(this,IC,new Map),Go(this,Kd,new Map),Go(this,BC,new Map),Go(this,L4,new Set),Go(this,Zk,!0),Go(this,pj,()=>{var n=ea;if(xe(IC,this).has(n)){var o=xe(IC,this).get(n),a=xe(Kd,this).get(o);if(a)v_(a),xe(L4,this).delete(o);else{var r=xe(BC,this).get(o);r&&(xe(Kd,this).set(o,r.effect),xe(BC,this).delete(o),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),a=r.effect)}for(var[s,l]of xe(IC,this)){if(xe(IC,this).delete(s),s===n)break;var g=xe(BC,this).get(l);g&&(is(g.effect),xe(BC,this).delete(l))}var C=function(u,E){if(u===o||xe(L4,A).has(u))return 1;var f=()=>{if(Array.from(xe(IC,A).values()).includes(u)){var m=document.createDocumentFragment();aq(E,m),m.append(e1()),xe(BC,A).set(u,{effect:E,fragment:m})}else is(E);xe(L4,A).delete(u),xe(Kd,A).delete(u)};xe(Zk,A)||!a?(xe(L4,A).add(u),qh(E,f,!1)):f()};for(var[d,B]of xe(Kd,this))C(d,B)}}),Go(this,RdA,n=>{xe(IC,this).delete(n);var o=Array.from(xe(IC,this).values());for(var[a,r]of xe(BC,this))o.includes(a)||(is(r.effect),xe(BC,this).delete(a))}),this.anchor=e,vn(Zk,this,t)}ensure(e,A){var t=ea;!A||xe(Kd,this).has(e)||xe(BC,this).has(e)||xe(Kd,this).set(e,D0(()=>A(this.anchor))),xe(IC,this).set(t,e),xe(pj,this).call(this)}};function os(i){Mo===null&&sp(),nE&&Mo.l!==null?Qq(Mo).m.push(i):D_(()=>{var e=uA(i);if(typeof e=="function")return e})}function Dg(i){Mo===null&&sp(),os(()=>()=>uA(i))}function NdA(){var i=Mo;return i===null&&sp(),(e,A,t)=>{var n,o=(n=i.s.$$events)===null||n===void 0?void 0:n[e];if(o){var a=rp(o)?o.slice():[o],r=(function(l,g){var{bubbles:C=!1,cancelable:d=!1}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return new CustomEvent(l,{detail:g,bubbles:C,cancelable:d})})(e,A,t);for(var s of a)s.call(i.x,r);return!r.defaultPrevented}return!0}}function FdA(i){Mo===null&&sp(),Mo.l===null&&(function(){throw new Error("https://svelte.dev/e/lifecycle_legacy_only")})(),Qq(Mo).b.push(i)}function Qq(i){var e,A=i.l;return(e=A.u)!==null&&e!==void 0?e:A.u={a:[],b:[],m:[]}}function zA(i,e){var A=arguments.length>2&&arguments[2]!==void 0&&arguments[2],t=new Zh(i);function n(o,a){t.ensure(o,a)}lE(()=>{var o=!1;e(function(a){o=!0,n(!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],a)}),o||n(!1,null)},A?Zd:0)}function uq(i,e,A){var t=new Zh(i),n=!rE();lE(()=>{var o=e();n&&o!==null&&typeof o=="object"&&(o={}),t.ensure(o,A)})}function Ka(i,e){return e}function Xk(i){for(var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],A=0;A5&&arguments[5]!==void 0?arguments[5]:null,a=i,r=new Map;!(4&e)||(a=i.appendChild(e1()));var s,l=null,g=lt(()=>{var E=A();return rp(E)?E:E==null?[]:xw(E)}),C=!0;function d(){u.fallback=l,(function(E,f,m,v,S){var k,M,x,F,z,j=!!(8&v),X=f.length,eA=E.items,Z=E.effect.first,CA=null,wA=[],BA=[];if(j)for(z=0;z0){var YA=4&v&&X===0?m:null;if(j){for(z=0;z{if(Ge){if(Ge.pending.delete(vt),Ge.done.add(vt),Ge.pending.size===0){var Ke=pA.outrogroups;Xk(xw(Ge.done)),Ke.delete(Ge),Ke.size===0&&(pA.outrogroups=null)}}else yA-=1},!1)},Dt=0;Dt{if(M!==void 0)for(F of M){var pA;(pA=F.nodes)===null||pA===void 0||(pA=pA.a)===null||pA===void 0||pA.apply()}})})(u,s,a,e,t),l!==null&&(s.length===0?(l.f&hC)===0?v_(l):(l.f^=hC,G4(l,null,a)):qh(l,()=>{l=null}))}var B=lE(()=>{for(var E=(s=c(g)).length,f=new Set,m=0;mo(a)):(l=D0(()=>o(Dh??(Dh=e1())))).f|=hC),C||d(),c(g)}),u={effect:B,items:r,outrogroups:null,fallback:l};C=!1}function LdA(i,e,A,t,n,o,a,r){var s=1&a?16&a?xC(A):cA(A,!1,!1):null,l=2&a?xC(n):null;return{v:s,i:l,e:D0(()=>(o(e,s??A,l??n,r),()=>{i.delete(t)}))}}function G4(i,e,A){if(i.nodes)for(var t=i.nodes.start,n=i.nodes.end,o=e&&(e.f&hC)===0?e.nodes.start:A;t!==null;){var a=gp(t);if(o.before(t),t===n)return;t=a}}function T2(i,e,A){e===null?i.effect.first=A:e.next=A,A===null?i.effect.last=e:A.prev=e}function pq(i,e){var A=arguments.length>2&&arguments[2]!==void 0&&arguments[2],t=arguments.length>3&&arguments[3]!==void 0&&arguments[3],n=i,o="";Le(()=>{var a,r=co;if(o!==(o=(a=e())!==null&&a!==void 0?a:"")&&(r.nodes!==null&&(tq(r.nodes.start,r.nodes.end),r.nodes=null),o!=="")){var s=o+"";A?s="".concat(s,""):t&&(s="".concat(s,""));var l=ox(s);if((A||t)&&(l=Jl(l)),eI(Jl(l),l.lastChild),A||t)for(;Jl(l);)n.before(Jl(l));else n.before(l)}})}function ya(i,e,A,t,n){var o,a=(o=e.$$slots)===null||o===void 0?void 0:o[A],r=!1;a===!0&&(a=e[A==="default"?"children":A],r=!0),a===void 0?n!==null&&n(i):a(i,r?()=>t:t)}function fq(i,e,A){var t=new Zh(i);lE(()=>{var n,o=(n=e())!==null&&n!==void 0?n:null;t.ensure(o,o&&(a=>A(a,o)))},Zd)}function Ms(i,e,A){Tr(()=>{var t=uA(()=>e(i,A?.())||{});if(A&&t!=null&&t.update){var n=!1,o={};sE(()=>{var a=A();Y(a),n&&RV(o,a)&&(o=a,t.update(a))}),n=!0}if(t!=null&&t.destroy)return()=>t.destroy()})}function GdA(i,e){var A,t=void 0;$V(()=>{t!==(t=e())&&(A&&(is(A),A=null),t&&(A=D0(()=>{Tr(()=>t(i))})))})}function mq(i){var e,A,t="";if(typeof i=="string"||typeof i=="number")t+=i;else if(typeof i=="object")if(Array.isArray(i)){var n=i.length;for(e=0;e1&&arguments[1]!==void 0&&arguments[1]?" !important;":";",A="";for(var t in i){var n=i[t];n!=null&&n!==""&&(A+=" "+t+": "+n+e)}return A}function $k(i){return i[0]!=="-"||i[1]!=="-"?i.toLowerCase():i}function Ci(i,e,A,t,n,o){var a=i.__className;if(a!==A||a===void 0){var r=(function(g,C,d){var B=g==null?"":""+g;if(C&&(B=B?B+" "+C:C),d){for(var u in d)if(d[u])B=B?B+" "+u:u;else if(B.length)for(var E=u.length,f=0;(f=B.indexOf(u,f))>=0;){var m=f+E;f!==0&&!fj.includes(B[f-1])||m!==B.length&&!fj.includes(B[m])?f=m:B=(f===0?"":B.substring(0,f))+B.substring(m+1)}}return B===""?null:B})(A,t,o);r==null?i.removeAttribute("class"):e?i.className=r:i.setAttribute("class",r),i.__className=A}else if(o&&n!==o)for(var s in o){var l=!!o[s];n!=null&&l===!!n[s]||i.classList.toggle(s,l)}return o}function A_(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},A=arguments.length>2?arguments[2]:void 0,t=arguments.length>3?arguments[3]:void 0;for(var n in A){var o=A[n];e[n]!==o&&(A[n]==null?i.style.removeProperty(n):i.style.setProperty(n,o,t))}}function wg(i,e,A,t){if(i.__style!==e){var n=(function(o,a){if(a){var r,s,l="";if(Array.isArray(a)?(r=a[0],s=a[1]):r=a,o){o=String(o).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var g=!1,C=0,d=!1,B=[];r&&B.push(...Object.keys(r).map($k)),s&&B.push(...Object.keys(s).map($k));for(var u=0,E=-1,f=o.length,m=0;m2&&arguments[2]!==void 0&&arguments[2];if(i.multiple){if(e==null)return;if(!rp(e))return void console.warn("https://svelte.dev/e/select_multiple_invalid_value");for(var t of i.options)t.selected=e.includes(wj(t))}else{for(t of i.options)if(wdA(wj(t),e))return void(t.selected=!0);A&&e===void 0||(i.selectedIndex=-1)}}function KdA(i){var e=new MutationObserver(()=>{k_(i,i.__value)});e.observe(i,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),c5(()=>{e.disconnect()})}function wj(i){return"__value"in i?i.__value:i.value}var _h=Symbol("class"),K4=Symbol("style"),wq=Symbol("is custom element"),yq=Symbol("is html");function tI(i,e){var A=ax(i);A.value!==(A.value=e??void 0)&&(i.value!==e||e===0&&i.nodeName==="PROGRESS")&&(i.value=e??"")}function jn(i,e,A,t){var n=ax(i);n[e]!==(n[e]=A)&&(e==="loading"&&(i[hdA]=A),A==null?i.removeAttribute(e):typeof A!="string"&&Dq(i).includes(e)?i[e]=A:i.setAttribute(e,A))}function UdA(i,e,A,t){var n,o=ax(i),a=o[wq],r=!o[yq],s=e||{},l=i.tagName==="OPTION";for(var g in e)g in A||(A[g]=null);A.class?A.class=o1(A.class):(t||A[_h])&&(A.class=null),A[K4]&&((n=A.style)!==null&&n!==void 0||(A.style=null));var C,d,B,u,E,f,m=Dq(i),v=function(k){var M=A[k];if(l&&k==="value"&&M==null)return i.value=i.__value="",s[k]=M,0;if(k==="class")return C=i.namespaceURI==="http://www.w3.org/1999/xhtml",Ci(i,C,M,t,e?.[_h],A[_h]),s[k]=M,s[_h]=A[_h],0;if(k==="style")return wg(i,M,e?.[K4],A[K4]),s[k]=M,s[K4]=A[K4],0;if(M===(d=s[k])&&(M!==void 0||!i.hasAttribute(k))||(s[k]=M,(B=k[0]+k[1])==="$$"))return 0;if(B==="on"){var x={},F="$$"+k,z=k.slice(2);if(u=(function(wA){return MdA.includes(wA)})(z),(function(wA){return wA.endsWith("capture")&&wA!=="gotpointercapture"&&wA!=="lostpointercapture"})(z)&&(z=z.slice(0,-7),x.capture=!0),!u&&d){if(M!=null)return 0;i.removeEventListener(z,s[F],x),s[F]=null}if(M!=null)if(u)i["__".concat(z)]=M,cp([z]);else{let wA=function(BA){s[k].call(this,BA)};var CA=wA;s[F]=Eq(z,i,wA,x)}else u&&(i["__".concat(z)]=void 0)}else if(k==="style")jn(i,k,M);else if(k==="autofocus")(function(wA,BA){if(BA){var QA=document.body;wA.autofocus=!0,Xd(()=>{document.activeElement===QA&&wA.focus()})}})(i,!!M);else if(a||k!=="__value"&&(k!=="value"||M==null))if(k==="selected"&&l)(function(wA,BA){BA?wA.hasAttribute("selected")||wA.setAttribute("selected",""):wA.removeAttribute("selected")})(i,M);else if(E=k,r||(E=(function(wA){var BA;return wA=wA.toLowerCase(),(BA=SdA[wA])!==null&&BA!==void 0?BA:wA})(E)),f=E==="defaultValue"||E==="defaultChecked",M!=null||a||f)f||m.includes(E)&&(a||typeof M!="string")?(i[E]=M,E in o&&(o[E]=es)):typeof M!="function"&&jn(i,E,M);else if(o[k]=null,E==="value"||E==="checked"){var j=i,X=e===void 0;if(E==="value"){var eA=j.defaultValue;j.removeAttribute(E),j.defaultValue=eA,j.value=j.__value=X?eA:null}else{var Z=j.defaultChecked;j.removeAttribute(E),j.defaultChecked=Z,j.checked=!!X&&Z}}else i.removeAttribute(k);else i.value=i.__value=M};for(var S in A)v(S);return s}function Lw(i,e){var A=arguments.length>5?arguments[5]:void 0,t=arguments.length>6&&arguments[6]!==void 0&&arguments[6],n=arguments.length>7&&arguments[7]!==void 0&&arguments[7];HV(arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],arguments.length>3&&arguments[3]!==void 0?arguments[3]:[],o=>{var a=void 0,r={},s=i.nodeName==="SELECT",l=!1;if($V(()=>{var C=e(...o.map(c)),d=UdA(i,a,C,A,t,n);for(var B of(l&&s&&"value"in C&&k_(i,C.value),Object.getOwnPropertySymbols(r)))C[B]||is(r[B]);for(var u of Object.getOwnPropertySymbols(C)){var E=C[u];u.description!=="@attach"||a&&E===a[u]||(r[u]&&is(r[u]),r[u]=D0(()=>GdA(i,()=>E))),d[u]=E}a=d}),s){var g=i;Tr(()=>{k_(g,a.value,!0),KdA(g)})}l=!0})}function ax(i){var e;return(e=i.__attributes)!==null&&e!==void 0?e:i.__attributes={[wq]:i.nodeName.includes("-"),[yq]:i.namespaceURI==="http://www.w3.org/1999/xhtml"}}var yj=new Map;function Dq(i){var e,A=i.getAttribute("is")||i.nodeName,t=yj.get(A);if(t)return t;yj.set(A,t=[]);for(var n=i,o=Element.prototype;o!==n;){for(var a in e=vV(n))e[a].set&&t.push(a);n=ex(n)}return t}function zw(i,e){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,t=new WeakSet;ydA(i,"input",(function(){var n=Xt(function*(o){var a=o?i.defaultValue:i.value;if(a=e_(i)?t_(a):a,A(a),ea!==null&&t.add(ea),yield Cq(),a!==(a=e())){var r=i.selectionStart,s=i.selectionEnd,l=i.value.length;if(i.value=a??"",s!==null){var g=i.value.length;r===s&&s===l&&g>l?(i.selectionStart=g,i.selectionEnd=g):(i.selectionStart=r,i.selectionEnd=Math.min(s,g))}}});return function(o){return n.apply(this,arguments)}})()),uA(e)==null&&i.value&&(A(e_(i)?t_(i.value):i.value),ea!==null&&t.add(ea)),sE(()=>{var n=e();if(i===document.activeElement){var o=H4??ea;if(t.has(o))return}e_(i)&&n===t_(i.value)||(i.type!=="date"||n||i.value)&&n!==i.value&&(i.value=n??"")})}function e_(i){var e=i.type;return e==="number"||e==="range"}function t_(i){return i===""?null:+i}function Ai(i,e,A){var t=vC(i,e);t&&t.set&&(i[e]=A,c5(()=>{i[e]=null}))}function Dj(i,e){return i===e||i?.[y0]===e}function ta(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,A=arguments.length>2?arguments[2]:void 0;return Tr(()=>{var t,n;return sE(()=>{t=n,n=[],uA(()=>{i!==A(...n)&&(e(i,...n),t&&Dj(A(...t),i)&&e(null,...t))})}),()=>{Xd(()=>{n&&Dj(A(...n),i)&&e(null,...n)})}}),i}function uC(i){return function(){for(var e=arguments.length,A=new Array(e),t=0;t0&&arguments[0]!==void 0&&arguments[0],e=Mo,A=e.l.u;if(A){var t,n=()=>Y(e.s);if(i){var o=0,a={},r=lp(()=>{var s=!1,l=e.s;for(var g in l)l[g]!==a[g]&&(a[g]=l[g],s=!0);return s&&o++,o});n=()=>c(r)}A.b.length&&(t=()=>{vj(e,n),f_(A.b)},ZV(),yc(1048584,t,!0)),D_(()=>{var s=uA(()=>A.m.map(ddA));return()=>{for(var l of s)typeof l=="function"&&l()}}),A.a.length&&D_(()=>{vj(e,n),f_(A.a)})}}function vj(i,e){if(i.l.s)for(var A of i.l.s)c(A);e()}function C5(i){var e=xC(0);return function(){return arguments.length===1?(N(e,c(e)+1),arguments[0]):(c(e),i())}}function O4(i,e){var A,t=(A=i.$$events)===null||A===void 0?void 0:A[e.type],n=rp(t)?t.slice():t==null?[]:[t];for(var o of n)o.call(this,e)}var Ew=!1,TdA={get(i,e){if(!i.exclude.includes(e))return c(i.version),e in i.special?i.special[e]():i.props[e]},set(i,e,A){if(!(e in i.special)){var t=co;try{yg(i.parent_effect),i.special[e]=K({get[e](){return i.props[e]}},e,4)}finally{yg(t)}}return i.special[e](A),Bj(i.version),!0},getOwnPropertyDescriptor(i,e){if(!i.exclude.includes(e))return e in i.props?{enumerable:!0,configurable:!0,value:i.props[e]}:void 0},deleteProperty:(i,e)=>(i.exclude.includes(e)||(i.exclude.push(e),Bj(i.version)),!0),has:(i,e)=>!i.exclude.includes(e)&&e in i.props,ownKeys:i=>Reflect.ownKeys(i.props).filter(e=>!i.exclude.includes(e))};function Qw(i,e){return new Proxy({props:i,exclude:e,special:{},version:xC(0),parent_effect:co},TdA)}var OdA={get(i,e){for(var A=i.props.length;A--;){var t=i.props[A];if(N4(t)&&(t=t()),typeof t=="object"&&t!==null&&e in t)return t[e]}},set(i,e,A){for(var t=i.props.length;t--;){var n=i.props[t];N4(n)&&(n=n());var o=vC(n,e);if(o&&o.set)return o.set(A),!0}return!1},getOwnPropertyDescriptor(i,e){for(var A=i.props.length;A--;){var t=i.props[A];if(N4(t)&&(t=t()),typeof t=="object"&&t!==null&&e in t){var n=vC(t,e);return n&&!n.configurable&&(n.configurable=!0),n}}},has(i,e){if(e===y0||e===_V)return!1;for(var A of i.props)if(N4(A)&&(A=A()),A!=null&&e in A)return!0;return!1},ownKeys(i){var e=[];for(var A of i.props)if(N4(A)&&(A=A()),A){for(var t in A)e.includes(t)||e.push(t);for(var n of Object.getOwnPropertySymbols(A))e.includes(n)||e.push(n)}return e}};function t1(){for(var i=arguments.length,e=new Array(i),A=0;A(g&&(g=!1,l=s?uA(t):t),l);if(r){var d,B,u=y0 in i||_V in i;n=(d=(B=vC(i,e))===null||B===void 0?void 0:B.set)!==null&&d!==void 0?d:u&&e in i?M=>i[e]=M:void 0}var E,f=!1;if(r?[o,f]=(function(M){var x=Ew;try{return Ew=!1,[M(),Ew]}finally{Ew=x}})(()=>i[e]):o=i[e],o===void 0&&t!==void 0&&(o=C(),n&&(a&&(function(){throw new Error("https://svelte.dev/e/props_invalid_value")})(),n(o))),E=a?()=>{var M=i[e];return M===void 0?C():(g=!0,M)}:()=>{var M=i[e];return M!==void 0&&(l=void 0),M===void 0?l:M},a&&!(4&A))return E;if(n){var m=i.$$legacy;return function(M,x){return arguments.length>0?(a&&x&&!m&&!f||n(x?E():M),M):E()}}var v=!1,S=(1&A?lp:lt)(()=>(v=!1,E()));r&&c(S);var k=co;return function(M,x){if(arguments.length>0){var F=x?c(S):a&&r?Nh(M):M;return N(S,F),v=!0,l!==void 0&&(l=F),M}return rI&&v||(k.f&aE)!==0?S.v:c(S)}}function dr(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:(function(t){var n=(function(o){try{if(typeof window<"u"&&window.localStorage!==void 0)return window.localStorage[o]}catch(a){}})("debug");return n!=null&&n.endsWith("*")?t.startsWith(n.slice(0,-1)):t===n})(i);if(!e)return JdA;var A=(function(t){for(var n=0,o=0;o9466848e5&&isFinite(i)&&Math.floor(i)===i&&!isNaN(new Date(i).valueOf());if(typeof i=="bigint")return __(Number(i));try{var e=i&&i.valueOf();if(e!==i)return __(e)}catch(A){return!1}return!1}function vq(i){(uw=uw||window.document.createElement("div")).style.color="",uw.style.color=i;var e=uw.style.color;return e!==""?e.replace(/\s+/g,"").toLowerCase():void 0}var uw=void 0;function PdA(i){return typeof i=="string"&&i.length<99&&!!vq(i)}function sx(i,e){if(typeof i=="number"||typeof i=="string"||typeof i=="boolean"||i===void 0)return typeof i;if(typeof i=="bigint")return"number";if(i===null)return"null";if(Array.isArray(i))return"array";if(Jn(i))return"object";var A=e.stringify(i);return A&&rx(A)?"number":A==="true"||A==="false"?"boolean":A==="null"?"null":"unknown"}var jdA=/^https?:\/\/\S+$/;function d5(i){return typeof i=="string"&&jdA.test(i)}function cE(i,e){if(i==="")return"";var A=i.trim();return A==="null"?null:A==="true"||A!=="false"&&(rx(A)?e.parse(A):i)}var VdA=[];function Mj(i,e){if(i.length!==e.length)return!1;for(var A=0;A1&&arguments[1]!==void 0&&arguments[1],A={};if(!Array.isArray(i))throw new TypeError("Array expected");function t(a,r){(!Array.isArray(a)&&!Jn(a)||e&&r.length>0)&&(A[xt(r)]=!0),Jn(a)&&Object.keys(a).forEach(s=>{t(a[s],r.concat(s))})}for(var n=Math.min(i.length,1e4),o=0;oe?i.slice(0,e):i}function Sj(i){return Fe({},i)}function kj(i){return Object.values(i)}function _j(i,e,A,t){var n=i.slice(0),o=n.splice(e,A);return n.splice.apply(n,[e+t,0,...o]),n}function qdA(i,e,A){return i.slice(0,e).concat(A).concat(i.slice(e))}function Cp(i,e){try{return e.parse(i)}catch(A){return e.parse(gg(i))}}function Mq(i,e){try{return Cp(i,e)}catch(A){return}}function dp(i,e){i=i.replace(kq,"");try{return e(i)}catch(A){}try{return e("{"+i+"}")}catch(A){}try{return e("["+i+"]")}catch(A){}throw new Error("Failed to parse partial JSON")}function Sq(i){i=i.replace(kq,"");try{return gg(i)}catch(t){}try{var e=gg("["+i+"]");return e.substring(1,e.length-1)}catch(t){}try{var A=gg("{"+i+"}");return A.substring(1,A.length-1)}catch(t){}throw new Error("Failed to repair partial JSON")}var kq=/,\s*$/;function Xh(i,e){var A=Rj.exec(e);if(A){var t=Or(A[2]),n=(function(B,u){for(var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:B.length,m=0,v=E;v"line ".concat(n+1," column ").concat(o+1))}}var a=$dA.exec(e),r=a?Or(a[1]):void 0,s=r!==void 0?r-1:void 0,l=AIA.exec(e),g=l?Or(l[1]):void 0,C=g!==void 0?g-1:void 0,d=s!==void 0&&C!==void 0?(function(B,u,E){for(var f=B.indexOf(` @@ -287,10 +287,10 @@ ${u}}`])},g=B=>B.map(u=>`.${C(u)}`).join(""),C=B=>qlA.test(B)?B:JSON.stringify(B position: absolute; }`);var lIA=TA('
'),gIA=TA('
');function cIA(i,e){Jt(e,!1);var A=K(e,"popup",8),t=K(e,"closeAbsolutePopup",8),n=cA(),o=cA();function a(C){A().options&&A().options.closeOnOuterClick&&!CE(C.target,d=>d===c(n))&&t()(A().id)}function r(C){RC(C)==="Escape"&&(C.preventDefault(),C.stopPropagation(),t()(A().id))}os(function(){c(o)&&c(o).focus()}),di();var s=gIA();De("mousedown",bC,function(C){a(C)},!0),De("keydown",bC,r,!0),De("wheel",bC,function(C){a(C)},!0);var l=gA(s),g=C=>{var d=lIA(),B=gA(d);ta(B,u=>N(o,u),()=>c(o)),fq(kA(B,2),()=>A().component,(u,E)=>{E(u,t1(()=>A().props))}),Le(u=>wg(d,u),[()=>(c(n),Y(A()),uA(()=>(function(u,E){var f=u.getBoundingClientRect(),{left:m,top:v,positionAbove:S,positionLeft:k}=(function(){if(E.anchor){var{anchor:M,width:x=0,height:F=0,offsetTop:z=0,offsetLeft:j=0,position:X}=E,{left:eA,top:Z,bottom:CA,right:wA}=M.getBoundingClientRect(),BA=X==="top"||Z+F>window.innerHeight&&Z>F,QA=X==="left"||eA+x>window.innerWidth&&eA>x;return{left:QA?wA-j:eA+j,top:BA?Z-z:CA+z,positionAbove:BA,positionLeft:QA}}if(typeof E.left=="number"&&typeof E.top=="number"){var{left:RA,top:dA,width:IA=0,height:xA=0}=E;return{left:RA,top:dA,positionAbove:dA+xA>window.innerHeight&&dA>xA,positionLeft:RA+IA>window.innerWidth&&RA>IA}}throw new Error('Invalid config: pass either "left" and "top", or pass "anchor"')})();return(S?"bottom: ".concat(f.top-v,"px;"):"top: ".concat(v-f.top,"px;"))+(k?"right: ".concat(f.left-m,"px;"):"left: ".concat(m-f.left,"px;"))})(c(n),A().options)))]),sA(C,d)};zA(l,C=>{c(n)&&C(g)}),ta(s,C=>N(n,C),()=>c(n)),De("mousedown",s,function(C){C.stopPropagation()}),De("keydown",s,r),sA(i,s),Yt()}var CIA=TA(" ",1);function N_(i,e){Jt(e,!1);var A=dr("jsoneditor:AbsolutePopup"),t=cA([],!0);function n(r){var s=c(t).findIndex(g=>g.id===r);if(s!==-1){var l=c(t)[s];l.options.onClose&&l.options.onClose(),N(t,c(t).filter(g=>g.id!==r))}}(function(r,s){FV().set(r,s)})("absolute-popup",{openAbsolutePopup:function(r,s,l){A("open...",s,l);var g={id:Fh(),component:r,props:s||{},options:l||{}};return N(t,[...c(t),g]),g.id},closeAbsolutePopup:n}),KA(()=>c(t),()=>{A("popups",c(t))}),Vn(),di(!0);var o=CIA(),a=at(o);Da(a,1,()=>c(t),Ka,(r,s)=>{cIA(r,{get popup(){return c(s)},closeAbsolutePopup:n})}),ya(kA(a,2),e,"default",{},null),sA(i,o),Yt()}function Bp(i,e){for(var A=new Set(e),t=i.replace(/ \(copy( \d+)?\)$/,""),n=i,o=1;A.has(n);){var a="copy"+(o>1?" "+o:"");n="".concat(t," (").concat(a,")"),o++}return n}function mC(i,e){var A=e-3;return i.length>e?i.substring(0,A)+"...":i}function dIA(i){if(i==="")return"";var e=i.toLowerCase();if(e==="null")return null;if(e==="true")return!0;if(e==="false")return!1;if(e!=="undefined"){var A=Number(i),t=parseFloat(i);return isNaN(A)||isNaN(t)?i:A}}var IIA={id:"jsonquery",name:"JSONQuery",description:`

- Enter a JSON Query function to filter, sort, or transform the data. You can use functions like get, filter, - sort, pick, groupBy, uniq, etcetera. + sort, pick, groupBy, uniq, etcetera. Example query: filter(.age >= 18)

`,createQuery:function(i,e){var{filter:A,sort:t,projection:n}=e,o=[];A&&A.path&&A.relation&&A.value&&o.push(["filter",[(a=A.relation,yM("1 ".concat(a," 1"))[0]),pw(A.path),dIA(A.value)]]);var a;return t&&t.path&&t.direction&&o.push(["sort",pw(t.path),t.direction==="desc"?"desc":"asc"]),n&&n.paths&&(n.paths.length>1?o.push(["pick",...n.paths.map(pw)]):o.push(["map",pw(n.paths[0])])),jO(["pipe",...o])},executeQuery:function(i,e,A){var t=_q(A,JSON)?i:(function(n){var o=A.stringify(n);return o!==void 0?JSON.parse(o):void 0})(i);return e.trim()!==""?VO(t,e):t}};function pw(i){return["get",...i]}var BIA=l1("");function hIA(i,e){Jt(e,!1);var A=870711,t=cA(""),n=K(e,"data",8);function o(r){if(!r||!r.raw)return"";var s=r.raw,l={};return s=s.replace(/\s(?:xml:)?id=["']?([^"')\s]+)/g,(g,C)=>{var d="fa-".concat((A+=1).toString(16));return l[C]=d,' id="'.concat(d,'"')}),s=s.replace(/#(?:([^'")\s]+)|xpointer\(id\((['"]?)([^')]+)\2\)\))/g,(g,C,d,B)=>{var u=C||B;return u&&l[u]?"#".concat(l[u]):g}),s}KA(()=>Y(n()),()=>{N(t,o(n()))}),Vn();var a=BIA();pq(gA(a),()=>c(t),!0),sA(i,a),Yt()}oi(` @@ -4160,7 +4160,7 @@ ${i.themeCSS}`),i.fontFamily!==void 0&&(A+=` Error: ${t.message||t}`),this.isRunning.set(!1),A.complete()},complete:()=>{this.isRunning.set(!1),A.complete()}})}deleteTest(e){confirm(`Are you sure you want to delete test ${e}?`)&&this.testsService.deleteTest(this.appName(),e).subscribe(()=>{this.loadTests()})}rebuildAllTests(){this.rebuildTest()}rebuildTest(e){this.isRebuilding.set(!0);let A=new ne;this.dialog.open(Rp,{width:"90vw",maxWidth:"1200px",height:"80vh",data:{title:`Rebuilding ${e||"all tests"}`,output$:A.asObservable()}}),A.next(`Rebuilding tests... `),this.testsService.rebuildTests(this.appName(),e).subscribe({next:()=>{A.next(`Successfully rebuilt tests. `),this.isRebuilding.set(!1),this.loadTests(),A.complete()},error:t=>{A.next(`Error rebuilding tests: ${t.message||t} -`),this.isRebuilding.set(!1),A.complete()}})}clearConsole(){this.consoleOutput.set("")}static \u0275fac=function(A){return new(A||i)};static \u0275cmp=vA({type:i,selectors:[["app-tests-tab"]],inputs:{appName:[1,"appName"],sessionId:[1,"sessionId"],userId:[1,"userId"],isViewOnlySession:[1,"isViewOnlySession"]},outputs:{testSelected:"testSelected"},features:[ii],decls:20,vars:4,consts:[[1,"tests-container"],[1,"toolbar"],["mat-button","","color","primary",3,"click","disabled"],["mat-button","","color","accent",3,"click","disabled"],[1,"spacer"],["mat-icon-button","","matTooltip","Refresh",3,"click"],[1,"empty-state"],["mat-table","",1,"tests-table",3,"dataSource"],["matColumnDef","name"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","actions"],["mat-row","",3,"selected-row","click",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],["mat-icon-button","","color","primary","matTooltip","Run Test",3,"click","disabled"],["mat-icon-button","","color","accent","matTooltip","Rebuild Test",3,"click","disabled"],["mat-icon-button","","color","primary","matTooltip","Rename Test",3,"click","disabled"],["mat-icon-button","","color","warn","matTooltip","Delete Test",3,"click","disabled"],["mat-row","",3,"click"]],template:function(A,t){A&1&&(I(0,"div",0)(1,"div",1)(2,"button",2),U("click",function(){return t.promoteCurrentSessionToTest()}),I(3,"mat-icon"),D(4,"add"),h(),D(5," From Current Session "),h(),I(6,"button",2),U("click",function(){return t.runAllTests()}),I(7,"mat-icon"),D(8,"playlist_play"),h(),D(9," Run All "),h(),I(10,"button",3),U("click",function(){return t.rebuildAllTests()}),I(11,"mat-icon"),D(12,"sync"),h(),D(13," Rebuild All "),h(),lA(14,"span",4),I(15,"button",5),U("click",function(){return t.loadTests()}),I(16,"mat-icon"),D(17,"refresh"),h()()(),T(18,obA,5,0,"div",6)(19,cbA,8,2,"table",7),h()),A&2&&(Q(2),H("disabled",!t.sessionId()||t.isViewOnlySession()),Q(4),H("disabled",t.isRunning()||t.isRebuilding()||t.dataSource.data.length===0),Q(4),H("disabled",t.isRunning()||t.isRebuilding()||t.dataSource.data.length===0),Q(8),O(t.dataSource.data.length===0?18:19))},dependencies:[li,qi,ki,yi,Un,zt,$X,t$,e$,i$,A$,n$,o$,a$,Ha,rn,l2,pE,Ls],styles:[".tests-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;box-sizing:border-box}.tests-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;align-items:center;height:48px;flex-shrink:0;padding:0 10px;background-color:var(--mat-sys-surface-container);border-bottom:1px solid var(--mat-sys-outline-variant);gap:8px}.tests-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] .spacer[_ngcontent-%COMP%]{flex:1 1 auto}.tests-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{height:32px!important;line-height:normal!important;border-radius:16px!important;font-size:13px!important;font-weight:500!important;display:inline-flex!important;align-items:center;justify-content:center}.tests-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] button.mat-mdc-button[_ngcontent-%COMP%]{padding:0 12px!important}.tests-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] button.mat-mdc-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{margin-right:4px!important}.tests-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] button.mat-mdc-icon-button[_ngcontent-%COMP%]{width:32px!important;min-width:32px!important;padding:0!important;border-radius:50%!important}.tests-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] button.mat-mdc-icon-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{margin-right:0!important}.tests-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] button.mat-mdc-icon-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple{width:32px!important;height:32px!important;border-radius:50%!important}.tests-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px!important;width:20px!important;height:20px!important;line-height:20px!important;vertical-align:middle}.tests-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] button[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{vertical-align:middle}.tests-container[_ngcontent-%COMP%] .empty-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:32px;color:var(--mat-sys-on-surface-variant);font-style:italic;gap:8px}.tests-container[_ngcontent-%COMP%] .empty-state[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:48px;width:48px;height:48px}.tests-container[_ngcontent-%COMP%] .tests-table[_ngcontent-%COMP%]{width:100%;background:transparent;border-top:1px solid var(--mat-sys-outline-variant, #e0e0e0)}.tests-container[_ngcontent-%COMP%] .tests-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-weight:600}.tests-container[_ngcontent-%COMP%] .tests-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{vertical-align:middle;padding:6px 16px;border-bottom:1px solid var(--mat-sys-outline-variant, #e0e0e0)}.tests-container[_ngcontent-%COMP%] .tests-table[_ngcontent-%COMP%] tr.mat-header-row[_ngcontent-%COMP%]{display:none}.tests-container[_ngcontent-%COMP%] .tests-table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{cursor:pointer;background:transparent}.tests-container[_ngcontent-%COMP%] .tests-table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-surface-container-low, #f5f5f5)}.tests-container[_ngcontent-%COMP%] .tests-table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover td.mat-column-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{opacity:1}.tests-container[_ngcontent-%COMP%] .tests-table[_ngcontent-%COMP%] tr.selected-row[_ngcontent-%COMP%]{background-color:var(--mat-sys-surface-container-high, #e0e0e0)}.tests-container[_ngcontent-%COMP%] .tests-table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td.mat-column-actions[_ngcontent-%COMP%]{text-align:right}.tests-container[_ngcontent-%COMP%] .tests-table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td.mat-column-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{opacity:0;transition:opacity .2s ease-in-out}.tests-container[_ngcontent-%COMP%] .console-section[_ngcontent-%COMP%]{margin-top:16px;display:flex;flex-direction:column;gap:8px;flex:1;min-height:200px}.tests-container[_ngcontent-%COMP%] .console-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1.1rem;font-weight:600}.tests-container[_ngcontent-%COMP%] .console-section[_ngcontent-%COMP%] .console-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;font-size:.9rem;color:var(--mat-sys-on-surface-variant)}.tests-container[_ngcontent-%COMP%] .console-section[_ngcontent-%COMP%] .console-actions[_ngcontent-%COMP%] .running-status[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_pulse 1.5s infinite}.tests-container[_ngcontent-%COMP%] .console-section[_ngcontent-%COMP%] .console-box[_ngcontent-%COMP%]{background-color:#1e1e1e;color:#d4d4d4;padding:12px;border-radius:4px;font-family:Courier New,Courier,monospace;font-size:.85rem;overflow:auto;flex:1;margin:0;white-space:pre-wrap;word-break:break-all;border:1px solid #333}.tests-container[_ngcontent-%COMP%] .console-section[_ngcontent-%COMP%] .console-box[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px;height:8px}.tests-container[_ngcontent-%COMP%] .console-section[_ngcontent-%COMP%] .console-box[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#555;border-radius:4px}.tests-container[_ngcontent-%COMP%] .console-section[_ngcontent-%COMP%] .console-box[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#777}.tests-container[_ngcontent-%COMP%] .console-section[_ngcontent-%COMP%] .console-box[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#1e1e1e}@keyframes _ngcontent-%COMP%_pulse{0%{opacity:.6}50%{opacity:1}to{opacity:.6}}"]})};var CbA={stateIsEmpty:"State is empty"},I$=new MA("State Tab Messages",{factory:()=>CbA});function dbA(i,e){if(i&1&&(I(0,"div",1),D(1),h()),i&2){let A=p();Q(),nA(A.i18n.stateIsEmpty)}}function IbA(i,e){if(i&1&&(I(0,"div"),lA(1,"app-custom-json-viewer",2),h()),i&2){let A=p();Q(),H("json",A.sessionState)}}var _y=class i{sessionState;i18n=w(I$);get isEmptyState(){return!this.sessionState||Object.keys(this.sessionState).length===0}static \u0275fac=function(A){return new(A||i)};static \u0275cmp=vA({type:i,selectors:[["app-state-tab"]],inputs:{sessionState:"sessionState"},decls:3,vars:1,consts:[[1,"state-wrapper"],[1,"empty-state"],[3,"json"]],template:function(A,t){A&1&&(I(0,"div",0),T(1,dbA,2,1,"div",1)(2,IbA,2,1,"div"),h()),A&2&&(Q(),O(t.isEmptyState?1:2))},dependencies:[fl],styles:[".state-wrapper[_ngcontent-%COMP%]{padding-left:25px;padding-right:25px;margin-top:16px}.state-wrapper[_ngcontent-%COMP%] .empty-state[_ngcontent-%COMP%]{text-align:center;font-style:italic}"]})};var BbA=(i,e)=>e.span_id;function hbA(i,e){if(i&1){let A=aA();I(0,"span",20)(1,"a",24),U("click",function(){let n;L(A);let o=p(3);return G(o.selectSpanById((n=o.selectedSpan())==null?null:n.parent_span_id))}),D(2),h(),I(3,"button",21),U("click",function(){let n;L(A);let o=p(3);return G(o.copyToClipboard((n=o.selectedSpan())==null?null:n.parent_span_id))}),I(4,"mat-icon"),D(5),h()()()}if(i&2){let A,t,n,o=p(3);Q(),H("matTooltip",((A=o.selectedSpan())==null?null:A.parent_span_id)||""),Q(),nA((t=o.selectedSpan())==null?null:t.parent_span_id),Q(3),nA(o.copiedId===((n=o.selectedSpan())==null?null:n.parent_span_id)?"check":"content_copy")}}function EbA(i,e){i&1&&D(0," None ")}function QbA(i,e){if(i&1){let A=aA();I(0,"tr")(1,"td"),D(2),h(),I(3,"td")(4,"span",20)(5,"a",24),U("click",function(){let n=L(A).$implicit,o=p(4);return G(o.selectSpanById(n.span_id))}),D(6),h(),I(7,"button",21),U("click",function(){let n=L(A).$implicit,o=p(4);return G(o.copyToClipboard(n.span_id))}),I(8,"mat-icon"),D(9),h()()()()()}if(i&2){let A=e.$implicit,t=p(4);Q(2),nA(A.name),Q(3),H("matTooltip",A.span_id),Q(),nA(A.span_id),Q(3),nA(t.copiedId===A.span_id?"check":"content_copy")}}function ubA(i,e){if(i&1&&(I(0,"table",22),ke(1,QbA,10,4,"tr",null,BbA),h()),i&2){let A=p(3);Q(),_e(A.selectedSpanChildren)}}function pbA(i,e){if(i&1){let A=aA();I(0,"table",23)(1,"tr")(2,"td"),D(3,"Event ID"),h(),I(4,"td")(5,"span",20)(6,"a",24),U("click",function(){L(A),p();let n=Ki(59),o=p(2);return G(o.switchToEvent.emit(n))}),D(7),h(),I(8,"button",21),U("click",function(){L(A),p();let n=Ki(59),o=p(2);return G(o.copyToClipboard(n))}),I(9,"mat-icon"),D(10),h()()()()()()}if(i&2){p();let A=Ki(59),t=p(2);Q(6),H("matTooltip",A||""),Q(),nA(A),Q(3),nA(t.copiedId===A?"check":"content_copy")}}function fbA(i,e){if(i&1){let A=aA();I(0,"div",13)(1,"table",15)(2,"tr")(3,"td"),D(4,"Name"),h(),I(5,"td")(6,"span",16)(7,"span",17),D(8),h(),I(9,"button",18),U("click",function(){let n;L(A);let o=p(2);return G(o.copyToClipboard((n=o.selectedSpan())==null?null:n.name))}),I(10,"mat-icon"),D(11),h()()()()(),I(12,"tr")(13,"td"),D(14,"Span ID"),h(),I(15,"td",19)(16,"span",20)(17,"span",17),D(18),h(),I(19,"button",21),U("click",function(){let n;L(A);let o=p(2);return G(o.copyToClipboard((n=o.selectedSpan())==null?null:n.span_id))}),I(20,"mat-icon"),D(21),h()()()()(),I(22,"tr")(23,"td"),D(24,"Parent ID"),h(),I(25,"td"),T(26,hbA,6,3,"span",20)(27,EbA,1,0),h()(),I(28,"tr")(29,"td"),D(30,"Trace ID"),h(),I(31,"td",19)(32,"span",20)(33,"span",17),D(34),h(),I(35,"button",21),U("click",function(){let n;L(A);let o=p(2);return G(o.copyToClipboard((n=o.selectedSpan())==null?null:n.trace_id))}),I(36,"mat-icon"),D(37),h()()()()(),I(38,"tr")(39,"td"),D(40,"Start Time"),h(),I(41,"td")(42,"span",16)(43,"span",17),D(44),h(),I(45,"button",18),U("click",function(){let n;L(A);let o=p(2);return G(o.copyToClipboard(o.formatTime((n=o.selectedSpan())==null?null:n.start_time),"startTime"))}),I(46,"mat-icon"),D(47),h()()()()(),I(48,"tr")(49,"td"),D(50,"End Time"),h(),I(51,"td")(52,"span",16)(53,"span",17),D(54),h(),I(55,"button",18),U("click",function(){let n;L(A);let o=p(2);return G(o.copyToClipboard(o.formatTime((n=o.selectedSpan())==null?null:n.end_time),"endTime"))}),I(56,"mat-icon"),D(57),h()()()()()(),T(58,ubA,3,0,"table",22),ro(59),T(60,pbA,11,3,"table",23),h()}if(i&2){let A,t,n,o,a,r,s,l,g,C,d,B,u,E,f=p(2);Q(7),H("matTooltip",((A=f.selectedSpan())==null?null:A.name)||""),Q(),nA((t=f.selectedSpan())==null?null:t.name),Q(3),nA(f.copiedId===((n=f.selectedSpan())==null?null:n.name)?"check":"content_copy"),Q(6),H("matTooltip",((o=f.selectedSpan())==null?null:o.span_id)||""),Q(),nA((a=f.selectedSpan())==null?null:a.span_id),Q(3),nA(f.copiedId===((r=f.selectedSpan())==null?null:r.span_id)?"check":"content_copy"),Q(5),O((s=f.selectedSpan())!=null&&s.parent_span_id?26:27),Q(7),H("matTooltip",((l=f.selectedSpan())==null?null:l.trace_id)||""),Q(),nA((g=f.selectedSpan())==null?null:g.trace_id),Q(3),nA(f.copiedId===((C=f.selectedSpan())==null?null:C.trace_id)?"check":"content_copy"),Q(6),H("matTooltip",f.formatTime((d=f.selectedSpan())==null?null:d.start_time)),Q(),nA(f.formatTime((B=f.selectedSpan())==null?null:B.start_time)),Q(3),nA(f.copiedId==="startTime"?"check":"content_copy"),Q(6),H("matTooltip",f.formatTime((u=f.selectedSpan())==null?null:u.end_time)),Q(),nA(f.formatTime((E=f.selectedSpan())==null?null:E.end_time)),Q(3),nA(f.copiedId==="endTime"?"check":"content_copy"),Q(),O(f.selectedSpanChildren.length>0?58:-1),Q();let m=so(f.getSelectedSpanEventId());Q(),O(m?60:-1)}}function mbA(i,e){if(i&1){let A=aA();I(0,"tr")(1,"td"),D(2),h(),I(3,"td")(4,"span",16)(5,"span"),D(6),h(),I(7,"button",18),U("click",function(){let n=L(A).$implicit;p(2);let o=Ki(1),a=p(2);return G(a.copyToClipboard(o[n]==null?null:o[n].toString()))}),I(8,"mat-icon"),D(9),h()()()()()}if(i&2){let A=e.$implicit;p(2);let t=Ki(1),n=p(2);Q(2),nA(A),Q(4),nA(t[A]),Q(3),nA(n.copiedId===(t[A]==null?null:t[A].toString())?"check":"content_copy")}}function wbA(i,e){if(i&1&&(I(0,"table",15),ke(1,mbA,10,3,"tr",null,ni),h()),i&2){p();let A=Ki(1),t=p(2);Q(),_e(t.Object.keys(A))}}function ybA(i,e){i&1&&(I(0,"div",1),D(1,"No attributes available"),h())}function DbA(i,e){if(i&1&&(I(0,"div",13),ro(1),T(2,wbA,3,0,"table",15)(3,ybA,2,0,"div",1),h()),i&2){let A=p(2);Q();let t=so(A.getSelectedSpanAttributesView());Q(),O(t&&A.Object.keys(t).length>0?2:3)}}function vbA(i,e){if(i&1){let A=aA();ro(0),I(1,"div",14),lA(2,"app-custom-json-viewer",25),I(3,"button",26),U("click",function(){L(A);let n=Ki(0),o=p(2);return G(o.copyJsonToClipboard(n,"raw"))}),I(4,"mat-icon"),D(5),h()()()}if(i&2){let A=p(2),t=so(A.getSelectedSpanRawView());Q(2),H("json",t),Q(3),nA(A.copiedId==="raw"?"check":"content_copy")}}function bbA(i,e){if(i&1){let A=aA();I(0,"div",0)(1,"div",2)(2,"mat-paginator",3),U("page",function(n){L(A);let o=p();return G(o.onPage(n))}),h(),I(3,"div",4),D(4),h(),lA(5,"div",5),I(6,"button",6),U("click",function(){L(A);let n=p();return G(n.traceService.selectedRow(void 0))}),I(7,"mat-icon"),D(8,"remove_selection"),h()()(),I(9,"div",7)(10,"div",8)(11,"button",9),U("click",function(){L(A);let n=p();return G(n.selectedDetailTab.set("info"))}),I(12,"mat-icon"),D(13,"info"),h()(),I(14,"button",10),U("click",function(){L(A);let n=p();return G(n.selectedDetailTab.set("attributes"))}),I(15,"mat-icon"),D(16,"list_alt"),h()(),I(17,"button",11),U("click",function(){L(A);let n=p();return G(n.selectedDetailTab.set("raw"))}),I(18,"mat-icon"),D(19,"data_object"),h()()(),I(20,"div",12),T(21,fbA,61,19,"div",13),T(22,DbA,4,2,"div",13),T(23,vbA,6,3,"div",14),h()()()}if(i&2){let A,t=p();Q(2),H("length",t.orderedTraceData.length)("pageSize",1)("pageIndex",t.selectedSpanIndex),Q(2),Ee(" ",(A=t.selectedSpan())==null?null:A.name," "),Q(7),_A("active",t.selectedDetailTab()==="info"),Q(3),_A("active",t.selectedDetailTab()==="attributes"),Q(3),_A("active",t.selectedDetailTab()==="raw"),Q(4),O(t.selectedDetailTab()==="info"?21:-1),Q(),O(t.selectedDetailTab()==="attributes"?22:-1),Q(),O(t.selectedDetailTab()==="raw"?23:-1)}}function MbA(i,e){i&1&&(I(0,"div",1),D(1,"Select a trace span to view its details"),h())}var RR=class i extends rd{nextPageLabel="Next Span";previousPageLabel="Previous Span";firstPageLabel="First Span";lastPageLabel="Last Span";getRangeLabel=(e,A,t)=>t===0?"Span 0 of 0":(t=Math.max(t,0),`Span ${e*A+1} of ${t}`);static \u0275fac=(()=>{let e;return function(t){return(e||(e=Li(i)))(t||i)}})();static \u0275prov=jA({token:i,factory:i.\u0275fac})},xy=class i{_traceData=[];orderedTraceData=[];set traceData(e){this._traceData=e||[],this.orderedTraceData=this.computeOrdered(this._traceData)}get traceData(){return this._traceData}computeOrdered(e){let A=e.map(a=>P({},a)),t=new Map,n=[];A.forEach(a=>t.set(String(a.span_id),a)),A.forEach(a=>{if(a.parent_span_id&&t.has(String(a.parent_span_id))){let r=t.get(String(a.parent_span_id));r.children=r.children||[],r.children.push(a)}else n.push(a)});let o=a=>a.flatMap(r=>[r,...r.children?o(r.children):[]]);return o(n)}traceService=w(ng);selectedSpan=sr(this.traceService.selectedTraceRow$);static getValidTraceTab(e){return e==="info"||e==="attributes"||e==="raw"?e:"info"}selectedDetailTab=mA(i.getValidTraceTab(window.localStorage.getItem("adk-trace-tab-selected-tab")));switchToEvent=Si();constructor(){Fn(()=>{window.localStorage.setItem("adk-trace-tab-selected-tab",this.selectedDetailTab())})}formatTime(e){return e?new Date(e/1e6).toLocaleString():"N/A"}get selectedSpanChildren(){let e=this.selectedSpan();return e?e.children&&e.children.length>0?e.children:this.traceData.filter(A=>A.parent_span_id&&String(A.parent_span_id)===String(e.span_id)):[]}selectSpanById(e){if(!e)return;let A=this.traceData.find(t=>String(t.span_id)===String(e));A&&this.traceService.selectedRow(A)}get selectedSpanIndex(){let e=this.selectedSpan();if(!e)return;let A=this.orderedTraceData.findIndex(t=>t.span_id===e.span_id);return A===-1?void 0:A}onPage(e){e.pageIndex>=0&&e.pageIndex=this.orderedTraceData.length?0:this.selectedSpanIndex+1:t=this.selectedSpanIndex-1<0?this.orderedTraceData.length-1:this.selectedSpanIndex-1,this.traceService.selectedRow(this.orderedTraceData[t])}Object=Object;copiedId=null;copyToClipboard(e,A){if(e==null||e==="")return;let t=String(e);navigator.clipboard.writeText(t).then(()=>{this.copiedId=A||t,setTimeout(()=>this.copiedId=null,2e3)})}getSelectedSpanEventId(){return this.selectedSpan()?.attrEventId}getSelectedSpanAttributesView(){return this.selectedSpan()?.rawAttributesUseThisFieldOnlyForDisplay??{}}getSelectedSpanRawView(){return this.selectedSpan()?.rawSpanUseThisFieldOnlyForDisplay}copyJsonToClipboard(e,A){if(!e)return;let t=JSON.stringify(e,null,2);navigator.clipboard.writeText(t).then(()=>{this.copiedId=A,setTimeout(()=>this.copiedId=null,2e3)})}static \u0275fac=function(A){return new(A||i)};static \u0275cmp=vA({type:i,selectors:[["app-trace-tab"]],hostBindings:function(A,t){A&1&&U("keydown",function(o){return t.handleKeyboardNavigation(o)},Fg)},inputs:{traceData:"traceData"},outputs:{switchToEvent:"switchToEvent"},features:[pt([{provide:rd,useClass:RR}])],decls:2,vars:1,consts:[[1,"event-details-container"],[1,"empty-state"],[1,"event-details-header"],["hidePageSize","","aria-label","Select span",1,"event-paginator",3,"page","length","pageSize","pageIndex"],[1,"span-title"],[2,"flex-grow","1"],["mat-icon-button","","matTooltip","Clear selection",3,"click"],[1,"event-details-content"],[1,"vertical-tabs-sidebar"],["mat-icon-button","","matTooltip","Info","matTooltipPosition","right",3,"click"],["mat-icon-button","","matTooltip","Attributes","matTooltipPosition","right",3,"click"],["mat-icon-button","","matTooltip","Raw JSON","matTooltipPosition","right",3,"click"],[1,"vertical-tabs-content"],[1,"info-tables-container"],[1,"json-viewer-container","json-viewer-wrapper"],["app-info-table",""],[1,"value-cell"],[3,"matTooltip"],["mat-icon-button","","matTooltip","Copy",1,"copy-value-button",3,"click"],[1,"id-text"],[1,"id-cell"],["mat-icon-button","","matTooltip","Copy",1,"copy-id-button",3,"click"],["app-info-table","","title","Children"],["app-info-table","","title","Events"],["href","javascript:void(0)",1,"span-link","id-text",3,"click","matTooltip"],[3,"json"],["mat-icon-button","","matTooltip","Copy JSON",1,"floating-copy-button",3,"click"]],template:function(A,t){A&1&&T(0,bbA,24,13,"div",0)(1,MbA,2,0,"div",1),A&2&&O(t.selectedSpan()!==void 0?0:1)},dependencies:[qi,yi,Un,zt,Ha,rn,fl,pm,u1],styles:["[_nghost-%COMP%]{display:block;height:100%}.json-viewer-container[_ngcontent-%COMP%]{margin:10px}.event-paginator[_ngcontent-%COMP%]{display:flex;justify-content:center;background-color:transparent}.event-paginator[_ngcontent-%COMP%] .mat-mdc-paginator-range-label{order:2;margin:0 0 0 8px}.span-title[_ngcontent-%COMP%]{font-weight:500;font-family:Google Sans Mono,monospace;font-size:13px;color:var(--mat-sys-on-surface);text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:300px;margin-left:16px}.event-details-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%}.event-details-content[_ngcontent-%COMP%]{display:flex;flex:1;overflow:hidden}.vertical-tabs-sidebar[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:48px;border-right:1px solid var(--mat-sys-outline-variant);padding-top:8px;align-items:center;gap:8px}.vertical-tabs-sidebar[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border-radius:6px!important}.vertical-tabs-sidebar[_ngcontent-%COMP%] button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple, .vertical-tabs-sidebar[_ngcontent-%COMP%] button[_ngcontent-%COMP%] .mat-mdc-button-ripple, .vertical-tabs-sidebar[_ngcontent-%COMP%] button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple:before, .vertical-tabs-sidebar[_ngcontent-%COMP%] button[_ngcontent-%COMP%] .mat-mdc-focus-indicator{border-radius:6px!important}.vertical-tabs-sidebar[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{background-color:var(--mat-sys-secondary-container)!important;color:var(--mat-sys-on-secondary-container)!important}.vertical-tabs-content[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;overflow:hidden;overflow-y:auto}.event-details-header[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:center;border-bottom:1px solid var(--mat-sys-outline-variant);height:48px;flex-shrink:0}.empty-state[_ngcontent-%COMP%]{padding:16px;text-align:center;color:var(--mat-sys-on-surface-variant);font-style:italic;font-size:14px}.info-tables-container[_ngcontent-%COMP%]{padding:16px;overflow-y:auto;display:flex;flex-direction:column;gap:24px}.span-link[_ngcontent-%COMP%]{color:var(--mat-sys-primary);text-decoration:none;cursor:pointer}.span-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.id-text[_ngcontent-%COMP%]{font-family:Google Sans Mono,monospace;font-size:11px}.id-cell[_ngcontent-%COMP%], .value-cell[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;overflow:hidden}.id-cell[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:first-child, .value-cell[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;flex:1}.id-cell[_ngcontent-%COMP%]:hover .copy-id-button[_ngcontent-%COMP%], .id-cell[_ngcontent-%COMP%]:hover .copy-value-button[_ngcontent-%COMP%], .value-cell[_ngcontent-%COMP%]:hover .copy-id-button[_ngcontent-%COMP%], .value-cell[_ngcontent-%COMP%]:hover .copy-value-button[_ngcontent-%COMP%]{opacity:1}.copy-id-button[_ngcontent-%COMP%], .copy-value-button[_ngcontent-%COMP%]{width:28px!important;height:28px!important;padding:0!important;line-height:28px!important;flex-shrink:0;margin:-4px 0!important;opacity:0;transition:opacity .2s ease-in-out;border-radius:4px!important;overflow:hidden!important}.copy-id-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple, .copy-id-button[_ngcontent-%COMP%] .mat-mdc-button-ripple, .copy-id-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple:before, .copy-id-button[_ngcontent-%COMP%] .mat-mdc-focus-indicator, .copy-value-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple, .copy-value-button[_ngcontent-%COMP%] .mat-mdc-button-ripple, .copy-value-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple:before, .copy-value-button[_ngcontent-%COMP%] .mat-mdc-focus-indicator{border-radius:4px!important}.copy-id-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%], .copy-value-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;line-height:16px}.json-viewer-wrapper[_ngcontent-%COMP%]{position:relative}.json-viewer-wrapper[_ngcontent-%COMP%]:hover .floating-copy-button[_ngcontent-%COMP%]{opacity:1}.floating-copy-button[_ngcontent-%COMP%]{position:absolute;top:4px;right:4px;z-index:10;opacity:0;transition:opacity .2s ease-in-out;background-color:var(--mat-sys-surface-container-high)!important;border-radius:4px!important;overflow:hidden!important;width:28px!important;height:28px!important;line-height:28px!important;padding:0!important}.floating-copy-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple, .floating-copy-button[_ngcontent-%COMP%] .mat-mdc-button-ripple, .floating-copy-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple:before, .floating-copy-button[_ngcontent-%COMP%] .mat-mdc-focus-indicator{border-radius:4px!important}.floating-copy-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;line-height:16px}.floating-copy-button[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-secondary-container)!important;color:var(--mat-sys-on-secondary-container)!important}"]})};var SbA={agentDevelopmentKitLabel:"Agent Development Kit",disclosureTooltip:"ADK Web is for development purposes. It has access to all the data and should not be used in production.",collapsePanelTooltip:"Collapse panel",eventsTabLabel:"Events",stateTabLabel:"State",artifactsTabLabel:"Artifacts",sessionsTabLabel:"Sessions",evalTabLabel:"Evals",testsTabLabel:"Tests",selectEventAriaLabel:"Select event",infoTabLabel:"Info",graphTabLabel:"Graph",requestDetailsTabLabel:"Request",responseDetailsTabLabel:"Response",responseIsNotAvailable:"Response is not available",requestIsNotAvailable:"Request is not available",clearSelectionButtonLabel:"Remove selection"},_E=new MA("Side Panel Messages",{factory:()=>SbA});var kbA=["eventMenuTrigger"],_bA=["graphContainer"],xbA=(i,e)=>e.span_id,RbA=(i,e)=>e.modality,B$=(i,e)=>e.key,NbA=(i,e)=>e.id;function FbA(i,e){if(i&1){let A=aA();I(0,"button",10),U("click",function(){L(A);let n=p();return G(n.selectedDetailTab="graph")}),I(1,"mat-icon"),D(2,"account_tree"),h()()}if(i&2){let A=p();_A("active",A.selectedDetailTab==="graph"),H("matTooltip",zC(A.i18n.graphTabLabel))}}function LbA(i,e){if(i&1){let A=aA();I(0,"div",31),lA(1,"app-custom-json-viewer",32),I(2,"button",33),U("click",function(){L(A);let n=p(3);return G(n.copyJsonToClipboard(n.selectedEvent().nodeInfo.outputFor,"nodeInfo.outputFor"))}),I(3,"mat-icon"),D(4),h()()()}if(i&2){let A=p(3);Q(),H("json",A.selectedEvent().nodeInfo.outputFor)("showMarkdown",!0),Q(3),nA(A.copiedId==="nodeInfo.outputFor"?"check":"content_copy")}}function GbA(i,e){i&1&&D(0," N/A ")}function KbA(i,e){if(i&1){let A=aA();I(0,"tr")(1,"td"),D(2,"Message As Output"),h(),I(3,"td")(4,"span",24)(5,"span",22),D(6),h(),I(7,"button",25),U("click",function(){L(A);let n=p(3);return G(n.copyToClipboard(n.selectedEvent().nodeInfo.messageAsOutput))}),I(8,"mat-icon"),D(9),h()()()()()}if(i&2){let A,t=p(3);Q(5),H("matTooltip",((A=t.selectedEvent().nodeInfo.messageAsOutput)==null?null:A.toString())||""),Q(),nA(t.selectedEvent().nodeInfo.messageAsOutput),Q(3),nA(t.copiedId===t.selectedEvent().nodeInfo.messageAsOutput?"check":"content_copy")}}function UbA(i,e){if(i&1){let A=aA();I(0,"table",26)(1,"tr")(2,"td"),D(3,"Node Path"),h(),I(4,"td")(5,"span",24)(6,"span",22),D(7),h(),I(8,"button",25),U("click",function(){L(A);let n=p(2);return G(n.copyToClipboard(n.selectedEvent().nodeInfo.path))}),I(9,"mat-icon"),D(10),h()()()()(),I(11,"tr")(12,"td"),D(13,"Output For"),h(),I(14,"td"),T(15,LbA,5,3,"div",31)(16,GbA,1,0),h()(),T(17,KbA,10,3,"tr"),h()}if(i&2){let A=p(2);Q(6),H("matTooltip",A.selectedEvent().nodeInfo.path||""),Q(),nA(A.selectedEvent().nodeInfo.path||"N/A"),Q(3),nA(A.copiedId===A.selectedEvent().nodeInfo.path?"check":"content_copy"),Q(5),O(A.selectedEvent().nodeInfo.outputFor?15:16),Q(2),O(A.selectedEvent().nodeInfo.messageAsOutput!==void 0?17:-1)}}function TbA(i,e){if(i&1){let A=aA();I(0,"div",31),lA(1,"app-custom-json-viewer",32),I(2,"button",33),U("click",function(){L(A);let n=p().$implicit,o=p(3);return G(o.copyJsonToClipboard(o.selectedEvent().actions[n],"action."+n))}),I(3,"mat-icon"),D(4),h()()()}if(i&2){let A=p().$implicit,t=p(3);Q(),H("json",t.selectedEvent().actions[A])("showMarkdown",!0),Q(3),nA(t.copiedId==="action."+A?"check":"content_copy")}}function ObA(i,e){if(i&1){let A=aA();I(0,"span",24)(1,"span",22),D(2),h(),I(3,"button",25),U("click",function(){let n;L(A);let o=p().$implicit,a=p(3);return G(a.copyToClipboard((n=a.selectedEvent().actions[o])==null?null:n.toString()))}),I(4,"mat-icon"),D(5),h()()()}if(i&2){let A,t,n=p().$implicit,o=p(3);Q(),H("matTooltip",((A=o.selectedEvent().actions[n])==null?null:A.toString())||""),Q(),nA(o.selectedEvent().actions[n]),Q(3),nA(o.copiedId===((t=o.selectedEvent().actions[n])==null?null:t.toString())?"check":"content_copy")}}function JbA(i,e){if(i&1&&(I(0,"tr")(1,"td"),D(2),h(),I(3,"td"),T(4,TbA,5,3,"div",31)(5,ObA,6,3,"span",24),h()()),i&2){let A=e.$implicit,t=p(3);Q(2),nA(A),Q(2),O(t.isObject(t.selectedEvent().actions[A])?4:5)}}function YbA(i,e){if(i&1&&(I(0,"table",27),ke(1,JbA,6,2,"tr",null,ni),h()),i&2){let A=p(2);Q(),_e(A.Object.keys(A.selectedEvent().actions))}}function HbA(i,e){if(i&1){let A=aA();I(0,"tr")(1,"td"),D(2),h(),I(3,"td")(4,"div",31),lA(5,"app-custom-json-viewer",32),I(6,"button",33),U("click",function(){let n=L(A),o=n.$implicit,a=n.$index,r=p(3);return G(r.copyJsonToClipboard(o,"fc."+a))}),I(7,"mat-icon"),D(8),h()()()()()}if(i&2){let A=e.$implicit,t=e.$index,n=p(3);Q(2),nA(A==null?null:A.name),Q(3),H("json",A)("showMarkdown",!0),Q(3),nA(n.copiedId==="fc."+t?"check":"content_copy")}}function zbA(i,e){if(i&1&&(I(0,"table",28),ke(1,HbA,9,4,"tr",null,Ja),h()),i&2){let A=p(2);Q(),_e(A.functionCalls())}}function PbA(i,e){if(i&1&&(I(0,"div",35),lA(1,"img",36),h()),i&2){let A=p().$implicit;Q(),H("src","data:"+A.inlineData.mimeType+";base64,"+A.inlineData.data,mo)}}function jbA(i,e){if(i&1&&(I(0,"div"),lA(1,"audio",37),h()),i&2){let A=p().$implicit;Q(),H("src","data:"+A.inlineData.mimeType+";base64,"+A.inlineData.data)}}function VbA(i,e){if(i&1&&(I(0,"div"),lA(1,"video",37),h()),i&2){let A=p().$implicit;Q(),H("src","data:"+A.inlineData.mimeType+";base64,"+A.inlineData.data,mo)}}function qbA(i,e){if(i&1&&(I(0,"div"),D(1),h()),i&2){let A=p().$implicit;Q(),Ee(" Unsupported media type: ",A.inlineData==null?null:A.inlineData.mimeType," ")}}function WbA(i,e){if(i&1&&T(0,PbA,2,1,"div",35)(1,jbA,2,1,"div")(2,VbA,2,1,"div")(3,qbA,2,1,"div"),i&2){let A=e.$implicit;O(!(A.inlineData==null||A.inlineData.mimeType==null)&&A.inlineData.mimeType.startsWith("image/")?0:!(A.inlineData==null||A.inlineData.mimeType==null)&&A.inlineData.mimeType.startsWith("audio/")?1:!(A.inlineData==null||A.inlineData.mimeType==null)&&A.inlineData.mimeType.startsWith("video/")?2:3)}}function ZbA(i,e){if(i&1&&(I(0,"div",34),ke(1,WbA,4,1,null,null,Ja),h()),i&2){let A=p().$implicit;Q(),_e(A.mediaParts)}}function XbA(i,e){if(i&1){let A=aA();I(0,"tr")(1,"td"),D(2),h(),I(3,"td"),T(4,ZbA,3,0,"div",34),I(5,"div",31),lA(6,"app-custom-json-viewer",32),I(7,"button",33),U("click",function(){let n=L(A),o=n.$implicit,a=n.$index,r=p(3);return G(r.copyJsonToClipboard(o.cleanedFr,"pfr."+a))}),I(8,"mat-icon"),D(9),h()()()()()}if(i&2){let A=e.$implicit,t=e.$index,n=p(3);Q(2),nA(A.name),Q(2),O(A.hasMedia?4:-1),Q(2),H("json",A.cleanedFr)("showMarkdown",!0),Q(3),nA(n.copiedId==="pfr."+t?"check":"content_copy")}}function $bA(i,e){if(i&1&&(I(0,"table",29),ke(1,XbA,10,5,"tr",null,Ja),h()),i&2){let A=p(2);Q(),_e(A.processedFunctionResponses())}}function A7A(i,e){if(i&1){let A=aA();I(0,"tr")(1,"td"),D(2),h(),I(3,"td")(4,"span",21)(5,"a",38),U("click",function(){let n=L(A).$implicit,o=p(3);return G(o.switchToSpan(n))}),D(6),h(),I(7,"button",23),U("click",function(){let n=L(A).$implicit,o=p(3);return G(o.copyToClipboard(n.span_id))}),I(8,"mat-icon"),D(9),h()()()()()}if(i&2){let A=e.$implicit,t=p(3);Q(2),nA(A.name),Q(3),H("matTooltip",A.span_id),Q(),nA(A.span_id),Q(3),nA(t.copiedId===A.span_id?"check":"content_copy")}}function e7A(i,e){if(i&1&&(I(0,"table",30),ke(1,A7A,10,4,"tr",null,xbA),h()),i&2){let A=p(2);Q(),_e(A.associatedSpans())}}function t7A(i,e){if(i&1){let A=aA();I(0,"div",16)(1,"table",19)(2,"tr")(3,"td"),D(4,"Event ID"),h(),I(5,"td",20)(6,"span",21)(7,"span",22),D(8),h(),I(9,"button",23),U("click",function(){let n;L(A);let o=p();return G(o.copyToClipboard((n=o.selectedEvent())==null?null:n.id))}),I(10,"mat-icon"),D(11),h()()()()(),I(12,"tr")(13,"td"),D(14,"Invocation ID"),h(),I(15,"td",20)(16,"span",21)(17,"span",22),D(18),h(),I(19,"button",23),U("click",function(){let n;L(A);let o=p();return G(o.copyToClipboard((n=o.selectedEvent())==null?null:n.invocationId))}),I(20,"mat-icon"),D(21),h()()()()(),I(22,"tr")(23,"td"),D(24,"Branch"),h(),I(25,"td")(26,"span",24)(27,"span",22),D(28),h(),I(29,"button",25),U("click",function(){let n;L(A);let o=p();return G(o.copyToClipboard((n=o.selectedEvent())==null?null:n.branch))}),I(30,"mat-icon"),D(31),h()()()()(),I(32,"tr")(33,"td"),D(34,"Timestamp"),h(),I(35,"td")(36,"span",24)(37,"span",22),D(38),h(),I(39,"button",25),U("click",function(){let n;L(A);let o=p();return G(o.copyToClipboard(o.formatTime((n=o.selectedEvent())==null?null:n.timestamp),"timestamp"))}),I(40,"mat-icon"),D(41),h()()()()(),I(42,"tr")(43,"td"),D(44,"Author"),h(),I(45,"td")(46,"span",24)(47,"span",22),D(48),h(),I(49,"button",25),U("click",function(){let n;L(A);let o=p();return G(o.copyToClipboard((n=o.selectedEvent())==null?null:n.author))}),I(50,"mat-icon"),D(51),h()()()()()(),T(52,UbA,18,5,"table",26),T(53,YbA,3,0,"table",27),T(54,zbA,3,0,"table",28),T(55,$bA,3,0,"table",29),T(56,e7A,3,0,"table",30),h()}if(i&2){let A,t,n,o,a,r,s,l,g,C,d,B,u,E,f,m,v=p();Q(7),H("matTooltip",((A=v.selectedEvent())==null?null:A.id)||""),Q(),nA((t=v.selectedEvent())==null?null:t.id),Q(3),nA(v.copiedId===((n=v.selectedEvent())==null?null:n.id)?"check":"content_copy"),Q(6),H("matTooltip",((o=v.selectedEvent())==null?null:o.invocationId)||""),Q(),nA(((a=v.selectedEvent())==null?null:a.invocationId)||"N/A"),Q(3),nA(v.copiedId===((r=v.selectedEvent())==null?null:r.invocationId)?"check":"content_copy"),Q(6),H("matTooltip",((s=v.selectedEvent())==null?null:s.branch)||""),Q(),nA(((l=v.selectedEvent())==null?null:l.branch)||"N/A"),Q(3),nA(v.copiedId===((g=v.selectedEvent())==null?null:g.branch)?"check":"content_copy"),Q(6),H("matTooltip",v.formatTime((C=v.selectedEvent())==null?null:C.timestamp)),Q(),nA(v.formatTime((d=v.selectedEvent())==null?null:d.timestamp)),Q(3),nA(v.copiedId==="timestamp"?"check":"content_copy"),Q(6),H("matTooltip",((B=v.selectedEvent())==null?null:B.author)||""),Q(),nA((u=v.selectedEvent())==null?null:u.author),Q(3),nA(v.copiedId===((E=v.selectedEvent())==null?null:E.author)?"check":"content_copy"),Q(),O((f=v.selectedEvent())!=null&&f.nodeInfo?52:-1),Q(),O((m=v.selectedEvent())!=null&&m.actions&&v.Object.keys(v.selectedEvent().actions).length>0?53:-1),Q(),O(v.functionCalls().length>0?54:-1),Q(),O(v.processedFunctionResponses().length>0?55:-1),Q(),O(v.associatedSpans().length>0?56:-1)}}function i7A(i,e){if(i&1&&(I(0,"div",42),mt(1,"number"),I(2,"span",43),D(3),h(),I(4,"span",44),D(5),mt(6,"number"),h()()),i&2){let A=e.$implicit;H("matTooltip",A.modality+": "+Ft(1,3,A.tokenCount)),Q(3),nA(A.modality),Q(2),nA(Ft(6,5,A.tokenCount))}}function n7A(i,e){if(i&1&&ke(0,i7A,7,7,"div",42,RbA),i&2){let A=p().$implicit,t=p(3);_e(t.selectedEvent().usageMetadata[A])}}function o7A(i,e){if(i&1&&(I(0,"span",22),mt(1,"number"),D(2),mt(3,"number"),h()),i&2){let A=p(2).$implicit,t=p(3);H("matTooltip",Ft(1,2,t.selectedEvent().usageMetadata[A])||""),Q(2),nA(Ft(3,4,t.selectedEvent().usageMetadata[A]))}}function a7A(i,e){if(i&1&&(I(0,"span",22),D(1),h()),i&2){let A,t=p(2).$implicit,n=p(3);H("matTooltip",((A=n.selectedEvent().usageMetadata[t])==null?null:A.toString())||""),Q(),nA(n.selectedEvent().usageMetadata[t])}}function r7A(i,e){if(i&1&&T(0,o7A,4,6,"span",22)(1,a7A,2,2,"span",22),i&2){let A=p().$implicit,t=p(3);O(t.isNumber(t.selectedEvent().usageMetadata[A])?0:1)}}function s7A(i,e){if(i&1&&(I(0,"tr")(1,"td"),D(2),h(),I(3,"td")(4,"span",24)(5,"span"),T(6,n7A,2,0)(7,r7A,2,1),h()()()()),i&2){let A=e.$implicit,t=p(3);Q(2),nA(A),Q(2),_A("numeric-cell",t.isNumericValue(A,t.selectedEvent().usageMetadata[A])),Q(2),O(A==="promptTokensDetails"||A==="promptTokenDetails"||A==="candidatesTokenDetails"||A==="candidatesTokensDetails"||A==="cacheTokensDetails"?6:7)}}function l7A(i,e){if(i&1&&(I(0,"table",39),ke(1,s7A,8,4,"tr",null,ni),h()),i&2){let A=p(2);Q(),_e(A.Object.keys(A.selectedEvent().usageMetadata))}}function g7A(i,e){i&1&&(I(0,"table",39)(1,"tr")(2,"td",45),D(3," Select an LLM response to see usage metadata. "),h()()())}function c7A(i,e){if(i&1&&(I(0,"div",16),T(1,l7A,3,0,"table",39)(2,g7A,4,0,"table",39),I(3,"table",40)(4,"tr")(5,"td"),D(6,"Total Prompt Tokens"),h(),I(7,"td",41),D(8),mt(9,"number"),h()(),I(10,"tr")(11,"td"),D(12,"Total Candidates Tokens"),h(),I(13,"td",41),D(14),mt(15,"number"),h()(),I(16,"tr")(17,"td"),D(18,"Total Tokens"),h(),I(19,"td",41),D(20),mt(21,"number"),h()()()()),i&2){let A,t=p();Q(),O((A=t.selectedEvent())!=null&&A.usageMetadata&&t.Object.keys(t.selectedEvent().usageMetadata).length>0?1:2),Q(7),nA(Ft(9,4,t.sessionUsageMetadata()["Prompt Tokens"])),Q(6),nA(Ft(15,6,t.sessionUsageMetadata()["Candidates Tokens"])),Q(6),nA(Ft(21,8,t.sessionUsageMetadata()["Total Tokens"]))}}function C7A(i,e){if(i&1){let A=aA();I(0,"div",17),lA(1,"app-custom-json-viewer",32),I(2,"button",33),U("click",function(){L(A);let n=p();return G(n.copyJsonToClipboard(n.filteredSelectedEvent(),"raw"))}),I(3,"mat-icon"),D(4),h()()()}if(i&2){let A=p();Q(),H("json",A.filteredSelectedEvent())("showMarkdown",!0),Q(3),nA(A.copiedId==="raw"?"check":"content_copy")}}function d7A(i,e){if(i&1&&lA(0,"app-custom-json-viewer",32),i&2){let A=p().$implicit;H("json",A.oldValue)("showMarkdown",!0)}}function I7A(i,e){if(i&1&&(I(0,"span"),D(1),h()),i&2){let A=p().$implicit;Q(),nA(A.oldValue)}}function B7A(i,e){if(i&1&&lA(0,"app-custom-json-viewer",32),i&2){let A=p().$implicit;H("json",A.newValue)("showMarkdown",!0)}}function h7A(i,e){if(i&1&&(I(0,"span"),D(1),h()),i&2){let A=p().$implicit;Q(),nA(A.newValue)}}function E7A(i,e){if(i&1&&(I(0,"div",47)(1,"div",48),D(2),h(),I(3,"div",49)(4,"div",50)(5,"div",51),D(6,"Old Value"),h(),I(7,"div",52),T(8,d7A,1,2,"app-custom-json-viewer",32)(9,I7A,2,1,"span"),h()(),I(10,"div",50)(11,"div",51),D(12,"New Value"),h(),I(13,"div",52),T(14,B7A,1,2,"app-custom-json-viewer",32)(15,h7A,2,1,"span"),h()()()()),i&2){let A=e.$implicit,t=p(3);Q(2),nA(A.key),Q(6),O(t.isObject(A.oldValue)?8:9),Q(6),O(t.isObject(A.newValue)?14:15)}}function Q7A(i,e){if(i&1&&ke(0,E7A,16,3,"div",47,B$),i&2){let A=p(2);_e(A.stateChanges())}}function u7A(i,e){i&1&&(I(0,"div",46),D(1," No state changes in this event. "),h())}function p7A(i,e){if(i&1&&(I(0,"div",16),T(1,Q7A,2,0)(2,u7A,2,0,"div",46),h()),i&2){let A=p();Q(),O(A.stateChanges().length>0?1:2)}}function f7A(i,e){i&1&&(I(0,"div",53)(1,"mat-icon",66),D(2,"warning"),h(),I(3,"span"),D(4,"The loaded session file was for a different app. The graph may not be accurate."),h()())}function m7A(i,e){if(i&1){let A=aA();I(0,"button",72),U("click",function(){let n=L(A).$implicit,o=p(3);return G(o.onInvocationSelected(n.key))}),I(1,"mat-icon",73),D(2,"check"),h(),D(3),h()}if(i&2){let A,t=e.$implicit,n=p(3);H("matTooltip",t.key),Q(),ft("visibility",((A=n.selectedEvent())==null?null:A.invocationId)===t.key?"visible":"hidden"),Q(2),Ee(" ",t.value," ")}}function w7A(i,e){if(i&1&&(I(0,"button",67)(1,"div",68)(2,"span",69),D(3),h(),I(4,"mat-icon",70),D(5,"arrow_drop_down"),h()()(),I(6,"mat-menu",null,3),ke(8,m7A,4,4,"button",71,B$),h()),i&2){let A,t=Bi(7),n=p(2);H("matMenuTriggerFor",t),Q(2),H("matTooltip",((A=n.selectedEvent())==null?null:A.invocationId)||""),Q(),Ee(" ",n.invocationDisplayMap().get(n.selectedEvent().invocationId)||n.selectedEvent().invocationId," "),Q(5),_e(n.invocationDisplayEntries())}}function y7A(i,e){if(i&1&&(I(0,"span",57),D(1),h()),i&2){let A,t,n=p(2);H("matTooltip",((A=n.selectedEvent())==null?null:A.invocationId)||""),Q(),nA((t=n.selectedEvent())!=null&&t.invocationId?n.invocationDisplayMap().get(n.selectedEvent().invocationId)||n.selectedEvent().invocationId:"N/A")}}function D7A(i,e){i&1&&(I(0,"mat-icon",75),D(1,"chevron_right"),h())}function v7A(i,e){i&1&&(I(0,"mat-icon",75),D(1,"chevron_right"),h())}function b7A(i,e){if(i&1&&(T(0,v7A,2,0,"mat-icon",75),I(1,"button",74),D(2),h()),i&2){let A=e.$implicit,t=e.$index,n=p(3);O(t>0?0:-1),Q(),_A("active",t===n.breadcrumbs().length-1),Q(),Ee(" ",A," ")}}function M7A(i,e){if(i&1&&(I(0,"div",58)(1,"button",74),D(2),h(),T(3,D7A,2,0,"mat-icon",75),ke(4,b7A,3,4,null,null,Ja),h()),i&2){let A=p(2);Q(2),nA(A.appName()),Q(),O(A.breadcrumbs().length>0?3:-1),Q(),_e(A.breadcrumbs())}}function S7A(i,e){if(i&1){let A=aA();I(0,"button",76),U("click",function(){L(A);let n=p(2);return G(n.showAgentStructureGraph.emit(!0))}),I(1,"mat-icon"),D(2,"fullscreen"),h()()}}function k7A(i,e){i&1&&(I(0,"div",61),D(1," Graph is not available for this agent. "),h())}function _7A(i,e){i&1&&(I(0,"div",62),lA(1,"mat-progress-spinner",77),h())}function x7A(i,e){if(i&1&&lA(0,"div",63),i&2){let A=p(2);H("innerHtml",A.renderedEventGraph(),Fc)}}function R7A(i,e){if(i&1){let A=aA();I(0,"button",78),U("click",function(){let n=L(A).$implicit,o=p(2);return G(o.handleMenuSelection(n))}),I(1,"span"),D(2),mt(3,"date"),h()()}if(i&2){let A=e.$implicit;Q(2),Ya("Run ",A.runIndex," (",G0(3,2,A.timestamp,"mediumTime"),")")}}function N7A(i,e){if(i&1&&(I(0,"div",18),T(1,f7A,5,0,"div",53),I(2,"div",54)(3,"div",55)(4,"span",56),D(5,"Invocation:"),h(),T(6,w7A,10,3)(7,y7A,2,2,"span",57),h()(),T(8,M7A,6,2,"div",58),I(9,"div",59,0),T(11,S7A,3,0,"button",60),T(12,k7A,2,0,"div",61)(13,_7A,2,0,"div",62)(14,x7A,1,1,"div",63),h(),lA(15,"div",64,1),I(17,"mat-menu",null,2),ke(19,R7A,4,5,"button",65,NbA),h()()),i&2){let A,t=Bi(18),n=p();Q(),O(n.isViewOnlyAppNameMismatch()?1:-1),Q(5),O(n.invocationDisplayMap().size>0&&((A=n.selectedEvent())!=null&&A.invocationId)?6:7),Q(2),O(n.hasSubWorkflows()&&(n.breadcrumbs().length>0||n.appName())?8:-1),Q(3),O(n.graphsAvailable()?11:-1),Q(),O(n.graphsAvailable()?n.renderedEventGraph()?14:13:12),Q(3),ft("left",n.menuPos.x+"px")("top",n.menuPos.y+"px"),H("matMenuTriggerFor",t),Q(4),_e(n.menuEvents)}}function F7A(i,e){i&1&&(I(0,"div",62),lA(1,"mat-progress-spinner",77),h())}function L7A(i,e){i&1&&(I(0,"div",61),D(1,"Select an LLM response to see request details."),h())}function G7A(i,e){if(i&1){let A=aA();I(0,"div",17),lA(1,"app-custom-json-viewer",32),I(2,"button",33),U("click",function(){L(A);let n=p(2);return G(n.copyJsonToClipboard(n.llmRequest(),"request"))}),I(3,"mat-icon"),D(4),h()()()}if(i&2){let A=p(2);Q(),H("json",A.llmRequest())("showMarkdown",!0),Q(3),nA(A.copiedId==="request"?"check":"content_copy")}}function K7A(i,e){if(i&1&&(T(0,F7A,2,0,"div",62),mt(1,"async"),S1(2,L7A,2,0,"div",61)(3,G7A,5,3,"div",17)),i&2){let A=p();O(Ft(1,1,A.uiStateService.isEventRequestResponseLoading())===!0?0:A.llmRequest()?3:2)}}function U7A(i,e){i&1&&(I(0,"div",62),lA(1,"mat-progress-spinner",77),h())}function T7A(i,e){i&1&&(I(0,"div",61),D(1,"Select an LLM response to see response details."),h())}function O7A(i,e){if(i&1){let A=aA();I(0,"div",17),lA(1,"app-custom-json-viewer",32),I(2,"button",33),U("click",function(){L(A);let n=p(2);return G(n.copyJsonToClipboard(n.llmResponse(),"response"))}),I(3,"mat-icon"),D(4),h()()()}if(i&2){let A=p(2);Q(),H("json",A.llmResponse())("showMarkdown",!0),Q(3),nA(A.copiedId==="response"?"check":"content_copy")}}function J7A(i,e){if(i&1&&(T(0,U7A,2,0,"div",62),mt(1,"async"),S1(2,T7A,2,0,"div",61)(3,O7A,5,3,"div",17)),i&2){let A=p();O(Ft(1,1,A.uiStateService.isEventRequestResponseLoading())===!0?0:A.llmResponse()?3:2)}}var Ry=class i{eventDataSize=ve.required();eventDataMap=ve(new Map);selectedEventIndex=ve();selectedEvent=ve.required();filteredSelectedEvent=ve();renderedEventGraph=ve();rawSvgString=ve(null);llmRequest=ve();llmResponse=ve();traceData=ve([]);appName=ve("");selectedEventGraphPath=ve("");hasSubWorkflows=ve(!1);graphsAvailable=ve(!0);invocationDisplayMap=ve(new Map);forceGraphTab=ve(!1);isViewOnlySession=ve(!1);isViewOnlyAppNameMismatch=ve(!1);invocationDisplayEntries=ye(()=>Array.from(this.invocationDisplayMap().entries()).map(([e,A])=>({key:e,value:A})));breadcrumbs=ye(()=>{let e=this.selectedEventGraphPath();return e?e.split("/").filter(A=>A):[]});functionCalls=ye(()=>(this.selectedEvent()?.content?.parts||[]).filter(A=>!!A.functionCall).map(A=>A.functionCall));functionResponses=ye(()=>(this.selectedEvent()?.content?.parts||[]).filter(A=>!!A.functionResponse).map(A=>A.functionResponse));processedFunctionResponses=ye(()=>this.functionResponses().map(A=>{if(!A)return null;if(A&&Array.isArray(A.parts)){let n=A.parts.filter(a=>!!a.inlineData).map(a=>a.inlineData&&a.inlineData.data?$A(P({},a),{inlineData:$A(P({},a.inlineData),{data:a.inlineData.data.replace(/-/g,"+").replace(/_/g,"/")})}):a),o=P({},A);return delete o.parts,{name:A.name,cleanedFr:o,mediaParts:n,hasMedia:n.length>0}}return{name:A.name,cleanedFr:A,mediaParts:[],hasMedia:!1}}).filter(A=>A!==null));page=Si();closeSelectedEvent=Si();openImageDialog=Si();switchToTraceView=Si();showAgentStructureGraph=Si();drillDownNodePath=Si();selectEventById=Si();jumpToInvocation=Si();onInvocationSelected(e){this.jumpToInvocation.emit(e)}eventMenuTrigger;graphContainer;menuEvents=[];menuPos={x:0,y:0};uiStateService=w(ag);traceService=w(ng);i18n=w(_E);isEventRequestResponseLoadingSignal=sr(this.uiStateService.isEventRequestResponseLoading(),{initialValue:!1});associatedSpans=ye(()=>{let e=this.selectedEvent();if(!e||!e.id)return[];let A=this.traceData();if(!A)return[];let t=o=>{let a=[];for(let r of o)a.push(r),r.children&&(a=a.concat(t(r.children)));return a};return t(A).filter(o=>o.attrEventId===e.id)});sessionUsageMetadata=ye(()=>{let e=Array.from(this.eventDataMap().values()),A=0,t=0,n=0;return e.forEach(o=>{let a=o.usageMetadata;if(a){let r=a.promptTokenCount??a.promptTokens??0,s=a.candidatesTokenCount??a.candidatesTokens??0,l=a.totalTokenCount??a.totalTokens??0;A+=Number(r),t+=Number(s),n+=Number(l)}}),{"Prompt Tokens":A,"Candidates Tokens":t,"Total Tokens":n}});_selectedDetailTab="event";get selectedDetailTab(){return this._selectedDetailTab}set selectedDetailTab(e){this._selectedDetailTab=e,window.localStorage.setItem("adk-event-tab-selected-tab",e),e==="graph"&&setTimeout(()=>{this.graphContainer?.nativeElement&&FB(this.graphContainer.nativeElement,(A,t)=>{this.handleNodeClick(A,t)})},50)}copiedId=null;copyToClipboard(e,A){e&&navigator.clipboard.writeText(e).then(()=>{this.copiedId=A||e,setTimeout(()=>this.copiedId=null,2e3)})}copyJsonToClipboard(e,A){if(!e)return;let t=JSON.stringify(e,null,2);navigator.clipboard.writeText(t).then(()=>{this.copiedId=A,setTimeout(()=>this.copiedId=null,2e3)})}switchToSpan(e){this.switchToTraceView.emit(),this.traceService.selectedRow(e)}stateChanges=ye(()=>{let e=this.selectedEvent();if(!e)return[];let A=Array.from(this.eventDataMap().values());A.sort((o,a)=>(o.timestamp||0)-(a.timestamp||0));let t={},n=[];for(let o of A){let a=o.actions?.stateDelta;if(o.id===e.id){if(a)for(let r of Object.keys(a))r!=="__llm_request_key__"&&n.push({key:r,oldValue:t[r]!==void 0?t[r]:"N/A",newValue:a[r]});break}if(a)for(let r of Object.keys(a))r!=="__llm_request_key__"&&(t[r]=a[r])}return n});constructor(){let e=window.localStorage.getItem("adk-event-tab-selected-tab");e&&["event","raw","request","response","graph","metadata","state"].includes(e)&&(this._selectedDetailTab=e),Fn(()=>{let t=this.renderedEventGraph(),n=this._selectedDetailTab;t&&n==="graph"&&setTimeout(()=>{this.graphContainer?.nativeElement&&FB(this.graphContainer.nativeElement,(o,a)=>{this.handleNodeClick(o,a)})},50)});let A=!1;Fn(()=>{let t=this.forceGraphTab(),n=this.selectedEvent();t&&!A&&(this.selectedDetailTab=this.graphsAvailable()?"graph":"event"),A=t})}formatTime(e){if(!e)return"N/A";let A=e<1e10?e*1e3:e;return new Date(A).toLocaleString()}isNumber(e){return typeof e=="number"}isNumericValue(e,A){return typeof A=="number"?!0:["promptTokensDetails","promptTokenDetails","candidatesTokenDetails","candidatesTokensDetails","cacheTokensDetails"].includes(e)}isObject(e){return e!==null&&typeof e=="object"}handleNodeClick(e,A){let t=Array.from(this.eventDataMap().values()),o=this.selectedEvent()?.invocationId;o&&(t=t.filter(l=>l.invocationId===o));let a=[],r=[],s="";t.forEach(l=>{let g=l.nodeInfo?.path;if(l.author==="user"&&(g="__START__"),!g)return;let C=g;g!=="__START__"&&(C=g.split("/").map(E=>E.split("@")[0]).join("/"));let d=C.split("/"),B=d[d.length-1],u="";if(d.length>=2&&d[d.length-1]==="call_llm"&&d[d.length-2]===l.author?(B=d[d.length-2],u=d.slice(1,-2).join("/")):u=d.slice(1,-1).join("/"),u===this.selectedEventGraphPath()){let E=g.split("/"),f=E[E.length-1],m=e.includes("@")?f:B;m!==s&&(s===e&&r.length>0&&a.push(r),s=m,r=[]),m===e&&r.push(l)}}),s===e&&r.length>0&&a.push(r),a.length!==0&&(a.length===1?this.selectEventById.emit(a[0][0].id):(this.menuEvents=a.map((l,g)=>({id:l[0].id,runIndex:g+1,timestamp:l[0].timestamp})),A&&(this.menuPos={x:A.clientX,y:A.clientY}),this.eventMenuTrigger.openMenu()))}handleMenuSelection(e){this.selectEventById.emit(e.id)}Object=Object;static \u0275fac=function(A){return new(A||i)};static \u0275cmp=vA({type:i,selectors:[["app-event-tab"]],viewQuery:function(A,t){if(A&1&&Wt(kbA,5)(_bA,5),A&2){let n;se(n=le())&&(t.eventMenuTrigger=n.first),se(n=le())&&(t.graphContainer=n.first)}},inputs:{eventDataSize:[1,"eventDataSize"],eventDataMap:[1,"eventDataMap"],selectedEventIndex:[1,"selectedEventIndex"],selectedEvent:[1,"selectedEvent"],filteredSelectedEvent:[1,"filteredSelectedEvent"],renderedEventGraph:[1,"renderedEventGraph"],rawSvgString:[1,"rawSvgString"],llmRequest:[1,"llmRequest"],llmResponse:[1,"llmResponse"],traceData:[1,"traceData"],appName:[1,"appName"],selectedEventGraphPath:[1,"selectedEventGraphPath"],hasSubWorkflows:[1,"hasSubWorkflows"],graphsAvailable:[1,"graphsAvailable"],invocationDisplayMap:[1,"invocationDisplayMap"],forceGraphTab:[1,"forceGraphTab"],isViewOnlySession:[1,"isViewOnlySession"],isViewOnlyAppNameMismatch:[1,"isViewOnlyAppNameMismatch"]},outputs:{page:"page",closeSelectedEvent:"closeSelectedEvent",openImageDialog:"openImageDialog",switchToTraceView:"switchToTraceView",showAgentStructureGraph:"showAgentStructureGraph",drillDownNodePath:"drillDownNodePath",selectEventById:"selectEventById",jumpToInvocation:"jumpToInvocation"},decls:35,vars:32,consts:[["graphContainer",""],["eventMenuTrigger","matMenuTrigger"],["eventMenu","matMenu"],["invocationSelectorMenu","matMenu"],[1,"event-details-container"],[1,"event-details-header"],["hidePageSize","",1,"event-paginator",3,"page","length","pageSize","pageIndex"],["mat-icon-button","",3,"click","matTooltip"],[1,"event-details-content"],[1,"vertical-tabs-sidebar"],["mat-icon-button","","matTooltipPosition","right",3,"click","matTooltip"],["mat-icon-button","","matTooltipPosition","right",3,"active","matTooltip"],["mat-icon-button","","matTooltip","Usage Metadata","matTooltipPosition","right",3,"click"],["mat-icon-button","","matTooltip","State Changes","matTooltipPosition","right",3,"click"],["mat-icon-button","","matTooltip","Raw JSON","matTooltipPosition","right",3,"click"],[1,"vertical-tabs-content"],[1,"info-tables-container"],[1,"json-viewer-container","json-viewer-wrapper"],[1,"event-graph-wrapper"],["app-info-table",""],[1,"id-text"],[1,"id-cell"],[3,"matTooltip"],["mat-icon-button","","matTooltip","Copy",1,"copy-id-button",3,"click"],[1,"value-cell"],["mat-icon-button","","matTooltip","Copy",1,"copy-value-button",3,"click"],["app-info-table","","title","Node Info"],["app-info-table","","title","Actions"],["app-info-table","","title","Function Calls"],["app-info-table","","title","Function Responses"],["app-info-table","","title","Associated Spans"],[1,"json-viewer-wrapper"],[3,"json","showMarkdown"],["mat-icon-button","","matTooltip","Copy JSON",1,"floating-copy-button",3,"click"],[1,"media-container"],[1,"generated-image-container"],["alt","image",3,"src"],["controls","",3,"src"],["href","javascript:void(0)",1,"span-link","id-text",3,"click","matTooltip"],["app-info-table","","title","Usage Summary for Event"],["app-info-table","","title","Usage Summary for Session"],[1,"numeric-cell"],[1,"detail-row",3,"matTooltip"],[1,"modality-label"],[1,"modality-value"],["colspan","2",2,"text-align","center","padding","20px","color","var(--mat-sys-on-surface-variant)"],[1,"empty-state"],[1,"state-change-card"],[1,"state-change-header"],[1,"state-change-values"],[1,"state-value-block"],[1,"state-value-label"],[1,"state-value-content"],[1,"warning-banner",2,"background-color","#fff3cd","color","#856404","padding","8px","margin-bottom","8px","border-radius","4px","display","flex","align-items","center"],[1,"graph-header",2,"justify-content","space-between"],[2,"display","flex","align-items","center","min-width","0","flex","1","width","100%"],[2,"white-space","nowrap","flex-shrink","0"],[2,"margin-left","8px","font-weight","normal",3,"matTooltip"],[1,"breadcrumb-container"],[1,"event-graph-container"],["mat-icon-button","","matTooltip","Full Screen",1,"fullscreen-graph-button"],[1,"request-response-empty-state"],[1,"request-response-loading-spinner-container"],[1,"svg-graph-wrapper",3,"innerHtml"],[2,"visibility","hidden","position","fixed",3,"matMenuTriggerFor"],["mat-menu-item",""],[2,"margin-right","8px"],["mat-button","",1,"invocation-selector-button",2,"margin-left","8px","padding","0 8px","min-width","0","flex","1","height","24px","line-height","24px","width","100%",3,"matMenuTriggerFor"],[2,"display","flex","align-items","center","width","100%","min-width","0","justify-content","space-between"],[2,"font-weight","normal","overflow","hidden","text-overflow","ellipsis","white-space","nowrap","flex","1","text-align","left",3,"matTooltip"],[2,"margin-left","4px","font-size","18px","width","18px","height","18px","flex-shrink","0"],["mat-menu-item","","matTooltipPosition","right",3,"matTooltip"],["mat-menu-item","","matTooltipPosition","right",3,"click","matTooltip"],[2,"font-size","16px","width","16px","height","16px","margin-right","8px","color","var(--mat-sys-primary)"],["disabled","",1,"breadcrumb-item"],[1,"breadcrumb-separator"],["mat-icon-button","","matTooltip","Full Screen",1,"fullscreen-graph-button",3,"click"],["mode","indeterminate","diameter","50"],["mat-menu-item","",3,"click"]],template:function(A,t){A&1&&(I(0,"div",4)(1,"div",5)(2,"mat-paginator",6),U("page",function(o){return t.page.emit(o)}),h(),I(3,"button",7),U("click",function(){return t.closeSelectedEvent.emit()}),I(4,"mat-icon"),D(5,"remove_selection"),h()()(),I(6,"div",8)(7,"div",9)(8,"button",10),U("click",function(){return t.selectedDetailTab="event"}),I(9,"mat-icon"),D(10,"info"),h()(),T(11,FbA,3,4,"button",11),I(12,"button",10),U("click",function(){return t.selectedDetailTab="request"}),I(13,"mat-icon"),D(14,"input"),h()(),I(15,"button",10),U("click",function(){return t.selectedDetailTab="response"}),I(16,"mat-icon"),D(17,"output"),h()(),I(18,"button",12),U("click",function(){return t.selectedDetailTab="metadata"}),I(19,"mat-icon"),D(20,"analytics"),h()(),I(21,"button",13),U("click",function(){return t.selectedDetailTab="state"}),I(22,"mat-icon"),D(23,"published_with_changes"),h()(),I(24,"button",14),U("click",function(){return t.selectedDetailTab="raw"}),I(25,"mat-icon"),D(26,"data_object"),h()()(),I(27,"div",15),T(28,t7A,57,20,"div",16),T(29,c7A,22,10,"div",16),T(30,C7A,5,3,"div",17),T(31,p7A,3,1,"div",16),T(32,N7A,21,10,"div",18),T(33,K7A,4,3),T(34,J7A,4,3),h()()()),A&2&&(Q(2),H("length",t.eventDataSize())("pageSize",1)("pageIndex",t.selectedEventIndex()),ie("aria-label",t.i18n.selectEventAriaLabel),Q(),H("matTooltip",zC(t.i18n.clearSelectionButtonLabel)),Q(5),_A("active",t.selectedDetailTab==="event"),H("matTooltip",zC(t.i18n.infoTabLabel)),Q(3),O(t.graphsAvailable()?11:-1),Q(),_A("active",t.selectedDetailTab==="request"),H("matTooltip",zC(t.i18n.requestDetailsTabLabel)),Q(3),_A("active",t.selectedDetailTab==="response"),H("matTooltip",zC(t.i18n.responseDetailsTabLabel)),Q(3),_A("active",t.selectedDetailTab==="metadata"),Q(3),_A("active",t.selectedDetailTab==="state"),Q(3),_A("active",t.selectedDetailTab==="raw"),Q(4),O(t.selectedDetailTab==="event"?28:-1),Q(),O(t.selectedDetailTab==="metadata"?29:-1),Q(),O(t.selectedDetailTab==="raw"?30:-1),Q(),O(t.selectedDetailTab==="state"?31:-1),Q(),O(t.selectedDetailTab==="graph"?32:-1),Q(),O(t.selectedDetailTab==="request"?33:-1),Q(),O(t.selectedDetailTab==="response"?34:-1))},dependencies:[qi,ki,yi,zt,pm,Es,rn,s2,hs,Gs,tg,fl,u1,gs,YN,bI],styles:["[_nghost-%COMP%]{display:block;height:100%}.json-viewer-container[_ngcontent-%COMP%]{margin:10px}.event-paginator[_ngcontent-%COMP%]{margin-right:auto;display:flex;justify-content:center;background-color:transparent}.event-paginator[_ngcontent-%COMP%] .mat-mdc-paginator-range-label{order:2;margin:0 0 0 8px}.event-details-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%}.event-details-content[_ngcontent-%COMP%]{display:flex;flex:1;overflow:hidden}.vertical-tabs-sidebar[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:48px;border-right:1px solid var(--mat-sys-outline-variant);padding-top:8px;align-items:center;gap:8px}.vertical-tabs-sidebar[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border-radius:6px!important}.vertical-tabs-sidebar[_ngcontent-%COMP%] button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple, .vertical-tabs-sidebar[_ngcontent-%COMP%] button[_ngcontent-%COMP%] .mat-mdc-button-ripple, .vertical-tabs-sidebar[_ngcontent-%COMP%] button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple:before, .vertical-tabs-sidebar[_ngcontent-%COMP%] button[_ngcontent-%COMP%] .mat-mdc-focus-indicator{border-radius:6px!important}.vertical-tabs-sidebar[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{background-color:var(--mat-sys-secondary-container)!important;color:var(--mat-sys-on-secondary-container)!important}.vertical-tabs-content[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;overflow:hidden;overflow-y:auto}.event-details-header[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:center;border-bottom:1px solid var(--mat-sys-outline-variant);height:48px;flex-shrink:0}.empty-state[_ngcontent-%COMP%]{padding:16px;text-align:center;color:var(--mat-sys-on-surface-variant);font-style:italic}.details-content[_ngcontent-%COMP%]{color:var(--side-panel-details-content-color);font-size:14px}.event-graph-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;width:100%}.breadcrumb-container[_ngcontent-%COMP%]{display:flex;align-items:center;font-size:13px;color:var(--mat-sys-on-surface-variant);padding:8px 12px}.breadcrumb-container[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-weight:500;margin-right:8px;color:var(--mat-sys-on-surface)}.breadcrumb-container[_ngcontent-%COMP%] .breadcrumb-item[_ngcontent-%COMP%]{background:none;border:none;color:var(--mat-sys-primary);font-size:13px;padding:2px 4px}.breadcrumb-container[_ngcontent-%COMP%] .breadcrumb-item.active[_ngcontent-%COMP%]{font-weight:500;color:var(--mat-sys-on-surface)}.breadcrumb-container[_ngcontent-%COMP%] .breadcrumb-item[_ngcontent-%COMP%]:disabled{color:var(--mat-sys-on-surface);font-weight:500}.breadcrumb-container[_ngcontent-%COMP%] .breadcrumb-separator[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;display:flex;align-items:center;justify-content:center;color:var(--mat-sys-on-surface-variant);margin:0 4px}.graph-header[_ngcontent-%COMP%]{display:flex;align-items:center;font-size:13px;color:var(--mat-sys-on-surface-variant);background-color:var(--mat-sys-surface-container-lowest);padding:8px 16px;border-bottom:1px solid var(--mat-sys-outline-variant)}.graph-header[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-weight:500;margin-right:8px;color:var(--mat-sys-on-surface)}.event-graph-container[_ngcontent-%COMP%]{flex:1;overflow:hidden;padding:16px;position:relative}.fullscreen-graph-button[_ngcontent-%COMP%]{position:absolute;top:4px;right:4px;z-index:10;width:48px!important;height:48px!important;padding:0!important;display:flex!important;justify-content:center!important;align-items:center!important}.fullscreen-graph-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:28px!important;width:28px!important;height:28px!important;line-height:28px!important;margin:0!important;padding:0!important}.event-graph-container[_ngcontent-%COMP%] .svg-graph-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.event-graph-container[_ngcontent-%COMP%] svg{max-width:100%;max-height:100%;width:auto;height:auto;display:block}.event-graph-container[_ngcontent-%COMP%] svg>g.graph>polygon:first-child{fill:transparent!important}.request-response-loading-spinner-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;margin-top:2em}.request-response-empty-state[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;margin-top:2em;font-style:italic}.id-text[_ngcontent-%COMP%]{font-family:Google Sans Mono,monospace;font-size:12px}.id-cell[_ngcontent-%COMP%], .value-cell[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;overflow:hidden}.id-cell[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:first-child, .value-cell[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;flex:1}.id-cell[_ngcontent-%COMP%]:hover .copy-id-button[_ngcontent-%COMP%], .id-cell[_ngcontent-%COMP%]:hover .copy-value-button[_ngcontent-%COMP%], .value-cell[_ngcontent-%COMP%]:hover .copy-id-button[_ngcontent-%COMP%], .value-cell[_ngcontent-%COMP%]:hover .copy-value-button[_ngcontent-%COMP%]{opacity:1}.numeric-cell[_ngcontent-%COMP%]{text-align:right!important}.value-cell.numeric-cell[_ngcontent-%COMP%]{justify-content:flex-end}.value-cell.numeric-cell[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:first-child{text-align:right;font-family:Google Sans Mono,monospace;font-size:13px;font-weight:500;color:var(--mat-sys-on-surface)}.value-cell.numeric-cell[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:first-child span[_ngcontent-%COMP%]{font-family:Google Sans Mono,monospace}td.numeric-cell[_ngcontent-%COMP%]{text-align:right!important;font-family:Google Sans Mono,monospace!important;font-size:13px!important;font-weight:500!important;color:var(--mat-sys-on-surface)!important}.detail-row[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:center;gap:8px;margin-bottom:4px;font-size:12px;transition:transform .15s ease-in-out}.detail-row[_ngcontent-%COMP%]:hover{transform:translate(-2px)}.detail-row[_ngcontent-%COMP%]:last-child{margin-bottom:0}.detail-row[_ngcontent-%COMP%] .modality-label[_ngcontent-%COMP%]{font-size:10px;font-weight:600;letter-spacing:.5px;text-transform:uppercase;padding:2px 6px;border-radius:4px;color:var(--mat-sys-primary);background-color:var(--mat-sys-primary-container);opacity:.85}.detail-row[_ngcontent-%COMP%] .modality-value[_ngcontent-%COMP%]{font-weight:500;font-family:Google Sans Mono,monospace;color:var(--mat-sys-on-surface)}.copy-id-button[_ngcontent-%COMP%], .copy-value-button[_ngcontent-%COMP%]{width:28px!important;height:28px!important;padding:0!important;line-height:28px!important;flex-shrink:0;margin:-4px 0!important;opacity:0;transition:opacity .2s ease-in-out;border-radius:4px!important;overflow:hidden!important}.copy-id-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple, .copy-id-button[_ngcontent-%COMP%] .mat-mdc-button-ripple, .copy-id-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple:before, .copy-id-button[_ngcontent-%COMP%] .mat-mdc-focus-indicator, .copy-value-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple, .copy-value-button[_ngcontent-%COMP%] .mat-mdc-button-ripple, .copy-value-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple:before, .copy-value-button[_ngcontent-%COMP%] .mat-mdc-focus-indicator{border-radius:4px!important}.copy-id-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%], .copy-value-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;line-height:16px}.info-tables-container[_ngcontent-%COMP%]{padding:16px;overflow-y:auto;display:flex;flex-direction:column;gap:24px}.invocation-selector-button[_ngcontent-%COMP%] .mdc-button__label{width:100%;flex:1;overflow:hidden;text-overflow:ellipsis;display:flex;align-items:center;justify-content:space-between}.media-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;margin-top:8px;margin-bottom:12px}.generated-image-container[_ngcontent-%COMP%]{max-width:100%;border-radius:8px;overflow:hidden;box-shadow:0 2px 4px #0000001a;border:1px solid var(--mat-sys-outline-variant)}.generated-image-container[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:auto;display:block}audio[_ngcontent-%COMP%], video[_ngcontent-%COMP%]{max-width:100%;border-radius:4px}.json-viewer-wrapper[_ngcontent-%COMP%]{position:relative}.json-viewer-wrapper[_ngcontent-%COMP%]:hover .floating-copy-button[_ngcontent-%COMP%]{opacity:1}.floating-copy-button[_ngcontent-%COMP%]{position:absolute;top:4px;right:4px;z-index:10;opacity:0;transition:opacity .2s ease-in-out;background-color:var(--mat-sys-surface-container-high)!important;border-radius:4px!important;overflow:hidden!important;width:28px!important;height:28px!important;line-height:28px!important;padding:0!important}.floating-copy-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple, .floating-copy-button[_ngcontent-%COMP%] .mat-mdc-button-ripple, .floating-copy-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple:before, .floating-copy-button[_ngcontent-%COMP%] .mat-mdc-focus-indicator{border-radius:4px!important}.floating-copy-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;line-height:16px}.floating-copy-button[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-secondary-container)!important;color:var(--mat-sys-on-secondary-container)!important}.state-change-card[_ngcontent-%COMP%]{border-radius:8px;padding:10px;display:flex;flex-direction:column;gap:8px}.state-change-header[_ngcontent-%COMP%]{font-weight:600;font-size:14px;color:var(--mat-sys-primary);padding-bottom:4px}.state-change-values[_ngcontent-%COMP%]{display:flex;gap:12px;flex-wrap:wrap}.state-value-block[_ngcontent-%COMP%]{flex:1;min-width:200px;background-color:var(--mat-sys-surface-container-highest);border-radius:6px;padding:8px;display:flex;flex-direction:column;gap:4px}.state-value-label[_ngcontent-%COMP%]{font-size:12px;font-weight:500;color:var(--mat-sys-on-surface-variant)}.state-value-content[_ngcontent-%COMP%]{font-family:Google Sans Mono,monospace;font-size:13px;color:var(--mat-sys-on-surface);word-break:break-all}"],changeDetection:0})};var Y7A=["evalTabContainer"];function H7A(i,e){}function z7A(i,e){i&1&&(I(0,"div",1),lA(1,"mat-progress-spinner",4),h())}function P7A(i,e){if(i&1&&(I(0,"span",11),D(1),h()),i&2){let A=p(2);Q(),nA(A.i18n.infoTabLabel)}}function j7A(i,e){if(i&1){let A=aA();I(0,"app-trace-tab",12),U("switchToEvent",function(n){L(A);let o=p(2);return G(o.switchToEvent.emit(n))}),h()}if(i&2){let A=p(2);H("traceData",A.traceData())}}function V7A(i,e){if(i&1){let A=aA();I(0,"app-event-tab",13),U("page",function(n){L(A);let o=p(2);return G(o.page.emit(n))})("closeSelectedEvent",function(){L(A);let n=p(2);return G(n.closeSelectedEvent.emit())})("openImageDialog",function(n){L(A);let o=p(2);return G(o.openImageDialog.emit(n))})("switchToTraceView",function(){L(A);let n=p(2);return G(n.switchToTraceView.emit())})("showAgentStructureGraph",function(n){L(A);let o=p(2);return G(o.showAgentStructureGraph.emit(n))})("drillDownNodePath",function(n){L(A);let o=p(2);return G(o.drillDownNodePath.emit(n))})("selectEventById",function(n){L(A);let o=p(2);return G(o.selectEventById.emit(n))})("jumpToInvocation",function(n){L(A);let o=p(2);return G(o.jumpToInvocation.emit(n))}),h()}if(i&2){let A=p(2);H("eventDataSize",A.eventData().size)("eventDataMap",A.eventData())("selectedEventIndex",A.selectedEventIndex())("selectedEvent",A.selectedEvent())("traceData",A.traceData())("filteredSelectedEvent",A.filteredSelectedEvent())("renderedEventGraph",A.renderedEventGraph())("rawSvgString",A.rawSvgString())("appName",A.appName())("selectedEventGraphPath",A.selectedEventGraphPath())("llmRequest",A.llmRequest())("llmResponse",A.llmResponse())("hasSubWorkflows",A.hasSubWorkflows())("graphsAvailable",A.graphsAvailable())("invocationDisplayMap",A.invocationDisplayMap())("forceGraphTab",A.forceGraphTab())("isViewOnlySession",A.isViewOnlySession())("isViewOnlyAppNameMismatch",A.isViewOnlyAppNameMismatch())}}function q7A(i,e){i&1&&(I(0,"div",9),D(1,"Select an event or trace span to view details"),h())}function W7A(i,e){if(i&1&&(I(0,"span",11),D(1),h()),i&2){let A=p(2);Q(),nA(A.i18n.stateTabLabel)}}function Z7A(i,e){if(i&1&&(I(0,"span",11),D(1),h()),i&2){let A=p(3);Q(),nA(A.i18n.artifactsTabLabel)}}function X7A(i,e){if(i&1&&(I(0,"mat-tab"),kt(1,Z7A,2,1,"ng-template",6),lA(2,"app-artifact-tab",14),h()),i&2){let A=p(2);Q(2),H("artifacts",A.artifacts())}}function $7A(i,e){if(i&1&&(I(0,"span",11),D(1),h()),i&2){let A=p(3);Q(),nA(A.i18n.testsTabLabel)}}function AMA(i,e){if(i&1){let A=aA();I(0,"mat-tab"),kt(1,$7A,2,1,"ng-template",6),I(2,"app-tests-tab",15),U("testSelected",function(n){L(A);let o=p(2);return G(o.testSelected.emit(n))}),h()()}if(i&2){let A=p(2);Q(2),H("appName",A.appName())("sessionId",A.sessionId())("userId",A.userId())("isViewOnlySession",A.isViewOnlySession())}}function eMA(i,e){if(i&1&&(I(0,"span",11),D(1),h()),i&2){let A=p(3);Q(),nA(A.i18n.evalTabLabel)}}function tMA(i,e){i&1&&(I(0,"mat-tab"),kt(1,eMA,2,1,"ng-template",6),dn(2,null,0),h())}function iMA(i,e){if(i&1){let A=aA();I(0,"div",2)(1,"mat-tab-group",5),Ni("selectedIndexChange",function(n){L(A);let o=p();return wi(o.selectedIndex,n)||(o.selectedIndex=n),G(n)}),U("selectedTabChange",function(n){L(A);let o=p();return G(o.onTabChange(n))}),I(2,"mat-tab"),kt(3,P7A,2,1,"ng-template",6),T(4,j7A,1,1,"app-trace-tab",7)(5,V7A,1,18,"app-event-tab",8)(6,q7A,2,0,"div",9),h(),I(7,"mat-tab"),kt(8,W7A,2,1,"ng-template",6),lA(9,"app-state-tab",10),h(),T(10,X7A,3,1,"mat-tab"),mt(11,"async"),T(12,AMA,3,4,"mat-tab"),mt(13,"async"),T(14,tMA,4,0,"mat-tab"),mt(15,"async"),h()()}if(i&2){let A=p(),t=Ki(2);H("hidden",t||!A.showSidePanel()),Q(),Ri("selectedIndex",A.selectedIndex),Q(3),O(A.selectedSpan()?4:A.selectedEvent()?5:6),Q(5),H("sessionState",A.currentSessionState()),Q(),O(Ft(11,7,A.isArtifactsTabEnabledObs)?10:-1),Q(2),O(Ft(13,9,A.isTestsEnabledObs)?12:-1),Q(2),O(Ft(15,11,A.isEvalEnabledObs)?14:-1)}}var xE=class i{Object=Object;appName=ve("");userId=ve("");sessionId=ve("");traceData=ve([]);eventData=ve(new Map);currentSessionState=ve();artifacts=ve([]);selectedEvent=ve();selectedEventIndex=ve();renderedEventGraph=ve();rawSvgString=ve(null);selectedEventGraphPath=ve("");llmRequest=ve();llmResponse=ve();showSidePanel=ve(!1);isApplicationSelectorEnabledObs=ve(oe(!1));isBuilderMode=ve(!1);disableBuilderIcon=ve(!1);hasSubWorkflows=ve(!1);graphsAvailable=ve(!0);invocationDisplayMap=ve(new Map);forceGraphTab=ve(!1);isViewOnlySession=ve(!1);isViewOnlyAppNameMismatch=ve(!1);closePanel=Si();tabChange=Si();sessionSelected=Si();sessionReloaded=Si();evalCaseSelected=Si();editEvalCaseRequested=Si();testSelected=Si();evalSetIdSelected=Si();returnToSession=Si();evalNotInstalled=Si();page=Si();switchToEvent=Si();closeSelectedEvent=Si();openImageDialog=Si();openAddItemDialog=Si();enterBuilderMode=Si();showAgentStructureGraph=Si();switchToTraceView=Si();drillDownNodePath=Si();selectEventById=Si();jumpToInvocation=Si();sessionTabComponent=void 0;evalTabComponent=Yo(Sc);evalTabContainer=Yo("evalTabContainer",{read:Jo});tabGroup=Yo(fE);logoComponent=w(wB,{optional:!0});i18n=w(_E);featureFlagService=w(Nr);evalTabComponentClass=w(My,{optional:!0});environmentInjector=w(Hr);uiStateService=w(ag);traceService=w(ng);selectedSpan=sr(this.traceService.selectedTraceRow$);selectedIndex=0;pendingEvalCaseSelection=mA(void 0);pendingEvalResultSelection=mA(void 0);evalTabRef=mA(null);constructor(){Fn(()=>{let e=this.selectedEvent(),A=this.selectedSpan(),t=this.tabGroup();(e||A)&&t&&t.selectedIndex!==0&&(this.selectedIndex=0)}),Fn(()=>{this.evalTabContainer()?this.initEvalTab():this.evalTabRef.set(null)}),Fn(()=>{let e=this.evalTabRef();e&&(e.setInput("appName",this.appName()),e.setInput("userId",this.userId()),e.setInput("sessionId",this.sessionId()))}),Fn(()=>{let e=this.evalTabRef(),A=this.pendingEvalCaseSelection();e&&A&&(e.instance.selectEvalSet(A.evalSetId),e.instance.selectedEvalTab.set("cases"),e.instance.selectedEvalCase.set(A.evalCase),this.pendingEvalCaseSelection.set(void 0))}),Fn(()=>{let e=this.evalTabRef(),A=this.pendingEvalResultSelection();e&&A&&(e.instance.selectEvalSet(A.evalSetId),e.instance.selectedHistoryRun.set(A.timestamp),A.evalCase?(e.instance.selectedEvalTab.set("cases"),e.instance.selectedEvalCase.set(A.evalCase)):e.instance.selectedEvalTab.set("history"),this.pendingEvalResultSelection.set(void 0))})}ngOnInit(){}onTabChange(e){this.tabChange.emit(e),this.selectedIndex=e.index}switchToEvalTab(){this.isEvalEnabledObs.pipe(oo()).subscribe(e=>{e&&JC([this.isArtifactsTabEnabledObs.pipe(oo()),this.isTestsEnabledObs.pipe(oo())]).subscribe(([A,t])=>{let n=2;A&&n++,t&&n++,this.selectedIndex=n})})}selectEvalCase(e,A){let t=this.evalTabComponent();t?(t.selectEvalSet(e),t.selectedEvalTab.set("cases"),t.selectedEvalCase.set(A)):this.pendingEvalCaseSelection.set({evalSetId:e,evalCase:A})}selectEvalResult(e,A,t){let n=this.evalTabComponent();n?(n.selectEvalSet(e),n.selectedHistoryRun.set(A),t?(n.selectedEvalTab.set("cases"),n.selectedEvalCase.set(t)):n.selectedEvalTab.set("history")):this.pendingEvalResultSelection.set({evalSetId:e,timestamp:A,evalCase:t})}isAlwaysOnSidePanelEnabledObs=this.featureFlagService.isAlwaysOnSidePanelEnabled();isTraceEnabledObs=this.featureFlagService.isTraceEnabled();isArtifactsTabEnabledObs=this.featureFlagService.isArtifactsTabEnabled();isEvalEnabledObs=this.featureFlagService.isEvalEnabled();isTestsEnabledObs=this.featureFlagService.isTestsEnabled();isTokenStreamingEnabledObs=this.featureFlagService.isTokenStreamingEnabled();isMessageFileUploadEnabledObs=this.featureFlagService.isMessageFileUploadEnabled();isManualStateUpdateEnabledObs=this.featureFlagService.isManualStateUpdateEnabled();isBidiStreamingEnabledObs=this.featureFlagService.isBidiStreamingEnabled;filteredSelectedEvent=ye(()=>this.selectedEvent());ngAfterViewInit(){}initEvalTab(){this.isEvalEnabledObs.pipe(oo()).subscribe(e=>{if(e){let A=this.evalTabContainer();if(!A)return;A.clear();let t=A.createComponent(this.evalTabComponentClass??Sc,{environmentInjector:this.environmentInjector});if(!t)return;t.instance.sessionSelected.subscribe(n=>{this.sessionSelected.emit(n)}),t.instance.evalCaseSelected.subscribe(n=>{this.evalCaseSelected.emit(n)}),t.instance.editEvalCaseRequested.subscribe(n=>{this.editEvalCaseRequested.emit(n)}),t.instance.evalSetIdSelected.subscribe(n=>{this.evalSetIdSelected.emit(n)}),t.instance.shouldReturnToSession.subscribe(n=>{this.returnToSession.emit(n)}),t.instance.evalNotInstalledMsg.subscribe(n=>{this.evalNotInstalled.emit(n)}),this.evalTabRef.set(t)}})}static \u0275fac=function(A){return new(A||i)};static \u0275cmp=vA({type:i,selectors:[["app-side-panel"]],viewQuery:function(A,t){A&1&&ls(t.evalTabComponent,Sc,5)(t.evalTabContainer,Y7A,5,Jo)(t.tabGroup,fE,5),A&2&&br(3)},inputs:{appName:[1,"appName"],userId:[1,"userId"],sessionId:[1,"sessionId"],traceData:[1,"traceData"],eventData:[1,"eventData"],currentSessionState:[1,"currentSessionState"],artifacts:[1,"artifacts"],selectedEvent:[1,"selectedEvent"],selectedEventIndex:[1,"selectedEventIndex"],renderedEventGraph:[1,"renderedEventGraph"],rawSvgString:[1,"rawSvgString"],selectedEventGraphPath:[1,"selectedEventGraphPath"],llmRequest:[1,"llmRequest"],llmResponse:[1,"llmResponse"],showSidePanel:[1,"showSidePanel"],isApplicationSelectorEnabledObs:[1,"isApplicationSelectorEnabledObs"],isBuilderMode:[1,"isBuilderMode"],disableBuilderIcon:[1,"disableBuilderIcon"],hasSubWorkflows:[1,"hasSubWorkflows"],graphsAvailable:[1,"graphsAvailable"],invocationDisplayMap:[1,"invocationDisplayMap"],forceGraphTab:[1,"forceGraphTab"],isViewOnlySession:[1,"isViewOnlySession"],isViewOnlyAppNameMismatch:[1,"isViewOnlyAppNameMismatch"]},outputs:{closePanel:"closePanel",tabChange:"tabChange",sessionSelected:"sessionSelected",sessionReloaded:"sessionReloaded",evalCaseSelected:"evalCaseSelected",editEvalCaseRequested:"editEvalCaseRequested",testSelected:"testSelected",evalSetIdSelected:"evalSetIdSelected",returnToSession:"returnToSession",evalNotInstalled:"evalNotInstalled",page:"page",switchToEvent:"switchToEvent",closeSelectedEvent:"closeSelectedEvent",openImageDialog:"openImageDialog",openAddItemDialog:"openAddItemDialog",enterBuilderMode:"enterBuilderMode",showAgentStructureGraph:"showAgentStructureGraph",switchToTraceView:"switchToTraceView",drillDownNodePath:"drillDownNodePath",selectEventById:"selectEventById",jumpToInvocation:"jumpToInvocation"},decls:7,vars:8,consts:[["evalTabContainer",""],[1,"loading-spinner-container"],[1,"tabs-container",3,"hidden"],[1,"resize-handler"],["mode","indeterminate","diameter","50"],["animationDuration","0ms",3,"selectedIndexChange","selectedTabChange","selectedIndex"],["mat-tab-label",""],[3,"traceData"],[3,"eventDataSize","eventDataMap","selectedEventIndex","selectedEvent","traceData","filteredSelectedEvent","renderedEventGraph","rawSvgString","appName","selectedEventGraphPath","llmRequest","llmResponse","hasSubWorkflows","graphsAvailable","invocationDisplayMap","forceGraphTab","isViewOnlySession","isViewOnlyAppNameMismatch"],[1,"empty-state"],[3,"sessionState"],[1,"tab-label"],[3,"switchToEvent","traceData"],[3,"page","closeSelectedEvent","openImageDialog","switchToTraceView","showAgentStructureGraph","drillDownNodePath","selectEventById","jumpToInvocation","eventDataSize","eventDataMap","selectedEventIndex","selectedEvent","traceData","filteredSelectedEvent","renderedEventGraph","rawSvgString","appName","selectedEventGraphPath","llmRequest","llmResponse","hasSubWorkflows","graphsAvailable","invocationDisplayMap","forceGraphTab","isViewOnlySession","isViewOnlyAppNameMismatch"],[3,"artifacts"],[3,"testSelected","appName","sessionId","userId","isViewOnlySession"]],template:function(A,t){if(A&1&&(T(0,H7A,0,0),mt(1,"async"),ro(2),mt(3,"async"),T(4,z7A,2,0,"div",1),T(5,iMA,16,13,"div",2),lA(6,"div",3)),A&2){O(Ft(1,3,t.isAlwaysOnSidePanelEnabledObs)===!1?0:-1),Q(2);let n=so(Ft(3,5,t.uiStateService.isSessionLoading()));Q(2),O(n?4:-1),Q(),O(t.appName()!=""?5:-1)}},dependencies:[fE,bp,vp,xy,_y,d6,Ry,Es,ky,gs],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;position:relative}.drawer-header-wrapper[_ngcontent-%COMP%]{display:flex;height:48px;align-items:center;padding-left:20px}.drawer-header[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:space-between;align-items:center}.tabs-container[_ngcontent-%COMP%]{width:100%;flex:1;overflow:hidden;display:flex;flex-direction:column}.tab-label[_ngcontent-%COMP%]{font-size:14px}.resize-handler[_ngcontent-%COMP%]{width:6px;border-radius:4px;position:absolute;display:block;top:20px;bottom:20px;right:0;z-index:100;cursor:ew-resize}.resize-handler[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-outline-variant)}.empty-state[_ngcontent-%COMP%]{padding:16px;text-align:center;color:var(--mat-sys-on-surface-variant);font-style:italic}mat-tab-group[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;min-height:0}mat-tab-group[_ngcontent-%COMP%] .mdc-tab{padding:0 12px;min-width:48px} .mat-mdc-tab-body-wrapper{flex:1;min-height:0} .mat-mdc-tab-body-wrapper .mat-mdc-tab-body-content{overflow-x:hidden}.drawer-logo[_ngcontent-%COMP%]{margin-left:9px;display:flex;align-items:center}.drawer-logo[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{margin-right:6px}.drawer-logo[_ngcontent-%COMP%]{font-size:14px;font-style:normal;font-weight:500;line-height:20px;letter-spacing:.1px}.drawer-header-left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.panel-toggle-icon[_ngcontent-%COMP%]{font-size:20px;width:24px;height:24px;color:var(--side-panel-mat-icon-color, #c4c7c5);cursor:pointer;display:flex;align-items:center;justify-content:center}.powered-by-adk[_ngcontent-%COMP%]{font-size:10px;color:var(--side-panel-powered-by-adk-color);text-align:right;margin-top:-5px}.adk-info-icon[_ngcontent-%COMP%]{font-size:14px;color:var(--side-panel-mat-icon-color, #bdc1c6);cursor:pointer;margin-left:4px;vertical-align:middle}.mode-toggle-container[_ngcontent-%COMP%]{display:flex;align-items:center}.build-mode-button[_ngcontent-%COMP%]{margin:0 4px}.app-actions[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}.loading-spinner-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;height:100%}@media(max-width:768px){.resize-handler[_ngcontent-%COMP%]{display:none!important}.tab-label[_ngcontent-%COMP%]{font-size:12px!important} .mdc-tab{padding:0 8px!important}}"]})};var nMA=["editInput"];function oMA(i,e){if(i&1){let A=aA();I(0,"button",5),U("click",function(){L(A);let n=p();return G(n.startEdit())}),I(1,"mat-icon"),D(2,"edit"),h()()}}function aMA(i,e){if(i&1){let A=aA();I(0,"button",6),U("click",function(){L(A);let n=p();return G(n.saveEdit())}),I(1,"mat-icon"),D(2,"check"),h()(),I(3,"button",7),U("click",function(){L(A);let n=p();return G(n.cancelEdit())}),I(4,"mat-icon"),D(5,"close"),h()()}}var Ny=class i{value="";displayValue="";tooltip="";placeholder="";textClass="";save=new FA;isEditing=!1;draftValue="";editInput;startEdit(){this.draftValue=this.value,this.isEditing=!0,setTimeout(()=>{this.editInput.nativeElement.focus()})}cancelEdit(){this.isEditing=!1,this.draftValue=""}saveEdit(){this.save.emit(this.draftValue),this.isEditing=!1}handleKeydown(e){e.key==="Enter"?this.saveEdit():e.key==="Escape"&&this.cancelEdit()}get effectiveDisplayValue(){return this.displayValue||this.value}static \u0275fac=function(A){return new(A||i)};static \u0275cmp=vA({type:i,selectors:[["app-inline-edit"]],viewQuery:function(A,t){if(A&1&&Wt(nMA,5),A&2){let n;se(n=le())&&(t.editInput=n.first)}},inputs:{value:"value",displayValue:"displayValue",tooltip:"tooltip",placeholder:"placeholder",textClass:"textClass"},outputs:{save:"save"},decls:6,vars:10,consts:[["editInput",""],[1,"inline-edit-container"],[1,"inline-edit-text-wrapper"],[1,"inline-edit-input",3,"ngModelChange","keydown","readonly","ngClass","matTooltip","ngModel"],["mat-icon-button","","aria-label","Edit",1,"inline-edit-action-button"],["mat-icon-button","","aria-label","Edit",1,"inline-edit-action-button",3,"click"],["mat-icon-button","","aria-label","Save",1,"inline-edit-action-button",3,"click"],["mat-icon-button","","aria-label","Cancel",1,"inline-edit-action-button",3,"click"]],template:function(A,t){A&1&&(I(0,"div",1)(1,"div",2)(2,"input",3,0),U("ngModelChange",function(o){return t.draftValue=o})("keydown",function(o){return t.handleKeydown(o)}),h()(),T(4,oMA,3,0,"button",4)(5,aMA,6,0),h()),A&2&&(Q(2),_A("readonly",!t.isEditing),H("readonly",!t.isEditing)("ngClass",t.textClass)("matTooltip",t.isEditing?"":t.tooltip)("ngModel",t.isEditing?t.draftValue:t.effectiveDisplayValue),ie("placeholder",t.isEditing?t.placeholder:"")("aria-label",t.placeholder)("size",((t.isEditing?t.draftValue:t.effectiveDisplayValue)==null?null:(t.isEditing?t.draftValue:t.effectiveDisplayValue).length)||1),Q(2),O(t.isEditing?5:4))},dependencies:[li,Vl,fn,Gn,Kn,Ho,qi,yi,Un,zt,Ha,rn],styles:["[_nghost-%COMP%]{display:block;max-width:100%;min-width:0;width:100%}.inline-edit-container[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%;max-width:100%;min-width:0;box-sizing:border-box}.inline-edit-text-wrapper[_ngcontent-%COMP%]{flex:0 1 auto;min-width:0;display:flex;align-items:center}.inline-edit-input[_ngcontent-%COMP%]{min-width:48px;max-width:100%;padding:2px 6px;margin:-3px -7px;border:1px solid var(--chat-toolbar-session-text-color, #ccc);border-radius:4px;color:var(--chat-toolbar-session-id-color, inherit);font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;background:transparent;field-sizing:content;transition:all .2s ease}.inline-edit-input[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--primary-color, #1a73e8)}.inline-edit-input.readonly[_ngcontent-%COMP%]{min-width:0;border-color:transparent;cursor:inherit}.inline-edit-input.readonly[_ngcontent-%COMP%]:focus{outline:none;border-color:transparent}.inline-edit-action-button[_ngcontent-%COMP%]{flex-shrink:0;width:28px!important;height:28px!important;padding:0!important;display:flex;align-items:center;justify-content:center}.inline-edit-action-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;line-height:16px}"]})};var rMA={openPanelTooltip:"Open panel",retrieveLatestSessionTooltip:"Retrieve latest session and show",evalCaseIdLabel:"Eval Case ID",cancelButton:"Cancel",saveButton:"Save",editEvalCaseTooltip:"Edit current eval case",deleteEvalCaseTooltip:"Delete current eval case",sessionIdLabel:"Session",copySessionIdTooltip:"Copy session ID",sessionIdCopiedMessage:"Session ID copied",copySessionIdFailedMessage:"Failed to copy session ID",userIdLabel:"User ID",editUserIdTooltip:"Edit user ID",userIdInputPlaceholder:"Enter user ID",saveUserIdTooltip:"Save user ID",cancelUserIdEditTooltip:"Cancel editing user ID",invalidUserIdMessage:"User ID cannot be empty",loadingSessionLabel:"Loading session...",tokenStreamingLabel:"Token Streaming",moreOptionsTooltip:"More options",createNewSessionTooltip:"Create a new Session",newSessionButton:"New Session",deleteSessionTooltip:"Delete session",exportSessionTooltip:"Export session",importSessionTooltip:"Import session",viewSessionTooltip:"View session",loadingAgentsLabel:"Loading agents, please wait...",welcomeMessage:"Welcome to ADK!",selectAgentMessage:"Select an agent to begin.",failedToLoadAgentsMessage:"Failed to load agents. To get started, run",errorMessageLabel:"Error message:",noAgentsFoundWarning:"Warning: No agents found in current folder.",cannotEditSessionMessage:"Chat is disabled to prevent changes to the end user's session.",viewSessionReadOnlyMessage:'This is a read-only view of a session file. Use "Import Session" if you want to continue this session.',readOnlyBadgeLabel:"Read-only"},h$=new MA("Chat Messages",{factory:()=>rMA});var XA={};cAA(XA,{BRAND:()=>RMA,DIRTY:()=>II,EMPTY_PATH:()=>cMA,INVALID:()=>hi,NEVER:()=>E9A,OK:()=>Ss,ParseStatus:()=>rs,Schema:()=>hn,ZodAny:()=>Gy,ZodArray:()=>Gp,ZodBigInt:()=>GR,ZodBoolean:()=>KR,ZodBranded:()=>Kp,ZodCatch:()=>VR,ZodDate:()=>UR,ZodDefault:()=>jR,ZodDiscriminatedUnion:()=>Ky,ZodEffects:()=>KE,ZodEnum:()=>Jy,ZodError:()=>x0,ZodFirstPartyTypeKind:()=>_i,ZodFunction:()=>Ty,ZodIntersection:()=>YR,ZodIssueCode:()=>Ne,ZodLazy:()=>HR,ZodLiteral:()=>zR,ZodMap:()=>v$,ZodNaN:()=>S$,ZodNativeEnum:()=>PR,ZodNever:()=>BI,ZodNull:()=>OR,ZodNullable:()=>UE,ZodNumber:()=>LR,ZodObject:()=>LE,ZodOptional:()=>f1,ZodParsedType:()=>ht,ZodPipeline:()=>Up,ZodPromise:()=>Yy,ZodReadonly:()=>qR,ZodRecord:()=>Uy,ZodSchema:()=>hn,ZodSet:()=>b$,ZodString:()=>Oy,ZodSymbol:()=>y$,ZodTransformer:()=>KE,ZodTuple:()=>GE,ZodType:()=>hn,ZodUndefined:()=>TR,ZodUnion:()=>JR,ZodUnknown:()=>Lp,ZodVoid:()=>D$,addIssueToContext:()=>ot,any:()=>JMA,array:()=>PMA,bigint:()=>GMA,boolean:()=>R$,coerce:()=>h9A,custom:()=>k$,date:()=>KMA,datetimeRegex:()=>w$,defaultErrorMap:()=>TC,discriminatedUnion:()=>WMA,effect:()=>s9A,enum:()=>o9A,function:()=>t9A,getErrorMap:()=>RE,getParsedType:()=>_0,instanceof:()=>FMA,intersection:()=>ZMA,isAborted:()=>Fy,isAsync:()=>NE,isDirty:()=>Ly,isValid:()=>p1,late:()=>NMA,lazy:()=>i9A,literal:()=>n9A,makeIssue:()=>Fp,map:()=>A9A,nan:()=>LMA,nativeEnum:()=>a9A,never:()=>HMA,null:()=>OMA,nullable:()=>g9A,number:()=>x$,object:()=>jMA,objectUtil:()=>E$,oboolean:()=>B9A,onumber:()=>I9A,optional:()=>l9A,ostring:()=>d9A,pipeline:()=>C9A,preprocess:()=>c9A,promise:()=>r9A,quotelessJson:()=>sMA,record:()=>$MA,set:()=>e9A,setErrorMap:()=>gMA,strictObject:()=>VMA,string:()=>_$,symbol:()=>UMA,transformer:()=>s9A,tuple:()=>XMA,undefined:()=>TMA,union:()=>qMA,unknown:()=>YMA,util:()=>Mn,void:()=>zMA});var Mn;(function(i){i.assertEqual=n=>{};function e(n){}i.assertIs=e;function A(n){throw new Error}i.assertNever=A,i.arrayToEnum=n=>{let o={};for(let a of n)o[a]=a;return o},i.getValidEnumValues=n=>{let o=i.objectKeys(n).filter(r=>typeof n[n[r]]!="number"),a={};for(let r of o)a[r]=n[r];return i.objectValues(a)},i.objectValues=n=>i.objectKeys(n).map(function(o){return n[o]}),i.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let o=[];for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&o.push(a);return o},i.find=(n,o)=>{for(let a of n)if(o(a))return a},i.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function t(n,o=" | "){return n.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}i.joinValues=t,i.jsonStringifyReplacer=(n,o)=>typeof o=="bigint"?o.toString():o})(Mn||(Mn={}));var E$=(function(i){return i.mergeShapes=(e,A)=>P(P({},e),A),i})(E$||{}),ht=Mn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_0=i=>{switch(typeof i){case"undefined":return ht.undefined;case"string":return ht.string;case"number":return Number.isNaN(i)?ht.nan:ht.number;case"boolean":return ht.boolean;case"function":return ht.function;case"bigint":return ht.bigint;case"symbol":return ht.symbol;case"object":return Array.isArray(i)?ht.array:i===null?ht.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?ht.promise:typeof Map<"u"&&i instanceof Map?ht.map:typeof Set<"u"&&i instanceof Set?ht.set:typeof Date<"u"&&i instanceof Date?ht.date:ht.object;default:return ht.unknown}};var Ne=Mn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),sMA=i=>JSON.stringify(i,null,2).replace(/"([^"]+)":/g,"$1:"),x0=(()=>{class i extends Error{get errors(){return this.issues}constructor(A){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=A}format(A){let t=A||function(a){return a.message},n={_errors:[]},o=a=>{for(let r of a.issues)if(r.code==="invalid_union")r.unionErrors.map(o);else if(r.code==="invalid_return_type")o(r.returnTypeError);else if(r.code==="invalid_arguments")o(r.argumentsError);else if(r.path.length===0)n._errors.push(t(r));else{let s=n,l=0;for(;lt.message){let t={},n=[];for(let o of this.issues)if(o.path.length>0){let a=o.path[0];t[a]=t[a]||[],t[a].push(A(o))}else n.push(A(o));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}return i.create=e=>new i(e),i})();var lMA=(i,e)=>{let A;switch(i.code){case Ne.invalid_type:i.received===ht.undefined?A="Required":A=`Expected ${i.expected}, received ${i.received}`;break;case Ne.invalid_literal:A=`Invalid literal value, expected ${JSON.stringify(i.expected,Mn.jsonStringifyReplacer)}`;break;case Ne.unrecognized_keys:A=`Unrecognized key(s) in object: ${Mn.joinValues(i.keys,", ")}`;break;case Ne.invalid_union:A="Invalid input";break;case Ne.invalid_union_discriminator:A=`Invalid discriminator value. Expected ${Mn.joinValues(i.options)}`;break;case Ne.invalid_enum_value:A=`Invalid enum value. Expected ${Mn.joinValues(i.options)}, received '${i.received}'`;break;case Ne.invalid_arguments:A="Invalid function arguments";break;case Ne.invalid_return_type:A="Invalid function return type";break;case Ne.invalid_date:A="Invalid date";break;case Ne.invalid_string:typeof i.validation=="object"?"includes"in i.validation?(A=`Invalid input: must include "${i.validation.includes}"`,typeof i.validation.position=="number"&&(A=`${A} at one or more positions greater than or equal to ${i.validation.position}`)):"startsWith"in i.validation?A=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?A=`Invalid input: must end with "${i.validation.endsWith}"`:Mn.assertNever(i.validation):i.validation!=="regex"?A=`Invalid ${i.validation}`:A="Invalid";break;case Ne.too_small:i.type==="array"?A=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?A=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?A=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="bigint"?A=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?A=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(i.minimum))}`:A="Invalid input";break;case Ne.too_big:i.type==="array"?A=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?A=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?A=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="bigint"?A=`BigInt must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?A=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(i.maximum))}`:A="Invalid input";break;case Ne.custom:A="Invalid input";break;case Ne.invalid_intersection_types:A="Intersection results could not be merged";break;case Ne.not_multiple_of:A=`Number must be a multiple of ${i.multipleOf}`;break;case Ne.not_finite:A="Number must be finite";break;default:A=e.defaultError,Mn.assertNever(i)}return{message:A}},TC=lMA;var Q$=TC;function gMA(i){Q$=i}function RE(){return Q$}var Fp=i=>{let{data:e,path:A,errorMaps:t,issueData:n}=i,o=[...A,...n.path||[]],a=$A(P({},n),{path:o});if(n.message!==void 0)return $A(P({},n),{path:o,message:n.message});let r="",s=t.filter(l=>!!l).slice().reverse();for(let l of s)r=l(a,{data:e,defaultError:r}).message;return $A(P({},n),{path:o,message:r})},cMA=[];function ot(i,e){let A=RE(),t=Fp({issueData:e,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,A,A===TC?void 0:TC].filter(n=>!!n)});i.common.issues.push(t)}var rs=class i{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,A){let t=[];for(let n of A){if(n.status==="aborted")return hi;n.status==="dirty"&&e.dirty(),t.push(n.value)}return{status:e.value,value:t}}static mergeObjectAsync(e,A){return re(this,null,function*(){let t=[];for(let n of A){let o=yield n.key,a=yield n.value;t.push({key:o,value:a})}return i.mergeObjectSync(e,t)})}static mergeObjectSync(e,A){let t={};for(let n of A){let{key:o,value:a}=n;if(o.status==="aborted"||a.status==="aborted")return hi;o.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||n.alwaysSet)&&(t[o.value]=a.value)}return{status:e.value,value:t}}},hi=Object.freeze({status:"aborted"}),II=i=>({status:"dirty",value:i}),Ss=i=>({status:"valid",value:i}),Fy=i=>i.status==="aborted",Ly=i=>i.status==="dirty",p1=i=>i.status==="valid",NE=i=>typeof Promise<"u"&&i instanceof Promise;var Kt=(function(i){return i.errToObj=e=>typeof e=="string"?{message:e}:e||{},i.toString=e=>typeof e=="string"?e:e?.message,i})(Kt||{});var Mg=class{constructor(e,A,t,n){this._cachedPath=[],this.parent=e,this.data=A,this._path=t,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},u$=(i,e)=>{if(p1(e))return{success:!0,data:e.value};if(!i.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let A=new x0(i.common.issues);return this._error=A,this._error}}};function tn(i){if(!i)return{};let{errorMap:e,invalid_type_error:A,required_error:t,description:n}=i;if(e&&(A||t))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(a,r)=>{let{message:s}=i;return a.code==="invalid_enum_value"?{message:s??r.defaultError}:typeof r.data>"u"?{message:s??t??r.defaultError}:a.code!=="invalid_type"?{message:r.defaultError}:{message:s??A??r.defaultError}},description:n}}var hn=class{get description(){return this._def.description}_getType(e){return _0(e.data)}_getOrReturnCtx(e,A){return A||{common:e.parent.common,data:e.data,parsedType:_0(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new rs,ctx:{common:e.parent.common,data:e.data,parsedType:_0(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let A=this._parse(e);if(NE(A))throw new Error("Synchronous parse encountered promise.");return A}_parseAsync(e){let A=this._parse(e);return Promise.resolve(A)}parse(e,A){let t=this.safeParse(e,A);if(t.success)return t.data;throw t.error}safeParse(e,A){let t={common:{issues:[],async:A?.async??!1,contextualErrorMap:A?.errorMap},path:A?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_0(e)},n=this._parseSync({data:e,path:t.path,parent:t});return u$(t,n)}"~validate"(e){let A={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_0(e)};if(!this["~standard"].async)try{let t=this._parseSync({data:e,path:[],parent:A});return p1(t)?{value:t.value}:{issues:A.common.issues}}catch(t){t?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),A.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:A}).then(t=>p1(t)?{value:t.value}:{issues:A.common.issues})}parseAsync(e,A){return re(this,null,function*(){let t=yield this.safeParseAsync(e,A);if(t.success)return t.data;throw t.error})}safeParseAsync(e,A){return re(this,null,function*(){let t={common:{issues:[],contextualErrorMap:A?.errorMap,async:!0},path:A?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_0(e)},n=this._parse({data:e,path:t.path,parent:t}),o=yield NE(n)?n:Promise.resolve(n);return u$(t,o)})}refine(e,A){let t=n=>typeof A=="string"||typeof A>"u"?{message:A}:typeof A=="function"?A(n):A;return this._refinement((n,o)=>{let a=e(n),r=()=>o.addIssue(P({code:Ne.custom},t(n)));return typeof Promise<"u"&&a instanceof Promise?a.then(s=>s?!0:(r(),!1)):a?!0:(r(),!1)})}refinement(e,A){return this._refinement((t,n)=>e(t)?!0:(n.addIssue(typeof A=="function"?A(t,n):A),!1))}_refinement(e){return new KE({schema:this,typeName:_i.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:A=>this["~validate"](A)}}optional(){return f1.create(this,this._def)}nullable(){return UE.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Gp.create(this)}promise(){return Yy.create(this,this._def)}or(e){return JR.create([this,e],this._def)}and(e){return YR.create(this,e,this._def)}transform(e){return new KE($A(P({},tn(this._def)),{schema:this,typeName:_i.ZodEffects,effect:{type:"transform",transform:e}}))}default(e){let A=typeof e=="function"?e:()=>e;return new jR($A(P({},tn(this._def)),{innerType:this,defaultValue:A,typeName:_i.ZodDefault}))}brand(){return new Kp(P({typeName:_i.ZodBranded,type:this},tn(this._def)))}catch(e){let A=typeof e=="function"?e:()=>e;return new VR($A(P({},tn(this._def)),{innerType:this,catchValue:A,typeName:_i.ZodCatch}))}describe(e){let A=this.constructor;return new A($A(P({},this._def),{description:e}))}pipe(e){return Up.create(this,e)}readonly(){return qR.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},CMA=/^c[^\s-]{8,}$/i,dMA=/^[0-9a-z]+$/,IMA=/^[0-9A-HJKMNP-TV-Z]{26}$/i,BMA=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,hMA=/^[a-z0-9_-]{21}$/i,EMA=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,QMA=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,uMA=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,pMA="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",NR,fMA=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,mMA=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,wMA=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,yMA=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,DMA=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,vMA=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,f$="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",bMA=new RegExp(`^${f$}$`);function m$(i){let e="[0-5]\\d";i.precision?e=`${e}\\.\\d{${i.precision}}`:i.precision==null&&(e=`${e}(\\.\\d+)?`);let A=i.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${A}`}function MMA(i){return new RegExp(`^${m$(i)}$`)}function w$(i){let e=`${f$}T${m$(i)}`,A=[];return A.push(i.local?"Z?":"Z"),i.offset&&A.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${A.join("|")})`,new RegExp(`^${e}$`)}function SMA(i,e){return!!((e==="v4"||!e)&&fMA.test(i)||(e==="v6"||!e)&&wMA.test(i))}function kMA(i,e){if(!EMA.test(i))return!1;try{let[A]=i.split(".");if(!A)return!1;let t=A.replace(/-/g,"+").replace(/_/g,"/").padEnd(A.length+(4-A.length%4)%4,"="),n=JSON.parse(atob(t));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||e&&n.alg!==e)}catch(A){return!1}}function _MA(i,e){return!!((e==="v4"||!e)&&mMA.test(i)||(e==="v6"||!e)&&yMA.test(i))}var Oy=(()=>{class i extends hn{_parse(A){if(this._def.coerce&&(A.data=String(A.data)),this._getType(A)!==ht.string){let a=this._getOrReturnCtx(A);return ot(a,{code:Ne.invalid_type,expected:ht.string,received:a.parsedType}),hi}let n=new rs,o;for(let a of this._def.checks)if(a.kind==="min")A.data.lengtha.value&&(o=this._getOrReturnCtx(A,o),ot(o,{code:Ne.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let r=A.data.length>a.value,s=A.data.lengthA.test(o),P({validation:t,code:Ne.invalid_string},Kt.errToObj(n)))}_addCheck(A){return new i($A(P({},this._def),{checks:[...this._def.checks,A]}))}email(A){return this._addCheck(P({kind:"email"},Kt.errToObj(A)))}url(A){return this._addCheck(P({kind:"url"},Kt.errToObj(A)))}emoji(A){return this._addCheck(P({kind:"emoji"},Kt.errToObj(A)))}uuid(A){return this._addCheck(P({kind:"uuid"},Kt.errToObj(A)))}nanoid(A){return this._addCheck(P({kind:"nanoid"},Kt.errToObj(A)))}cuid(A){return this._addCheck(P({kind:"cuid"},Kt.errToObj(A)))}cuid2(A){return this._addCheck(P({kind:"cuid2"},Kt.errToObj(A)))}ulid(A){return this._addCheck(P({kind:"ulid"},Kt.errToObj(A)))}base64(A){return this._addCheck(P({kind:"base64"},Kt.errToObj(A)))}base64url(A){return this._addCheck(P({kind:"base64url"},Kt.errToObj(A)))}jwt(A){return this._addCheck(P({kind:"jwt"},Kt.errToObj(A)))}ip(A){return this._addCheck(P({kind:"ip"},Kt.errToObj(A)))}cidr(A){return this._addCheck(P({kind:"cidr"},Kt.errToObj(A)))}datetime(A){return typeof A=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:A}):this._addCheck(P({kind:"datetime",precision:typeof A?.precision>"u"?null:A?.precision,offset:A?.offset??!1,local:A?.local??!1},Kt.errToObj(A?.message)))}date(A){return this._addCheck({kind:"date",message:A})}time(A){return typeof A=="string"?this._addCheck({kind:"time",precision:null,message:A}):this._addCheck(P({kind:"time",precision:typeof A?.precision>"u"?null:A?.precision},Kt.errToObj(A?.message)))}duration(A){return this._addCheck(P({kind:"duration"},Kt.errToObj(A)))}regex(A,t){return this._addCheck(P({kind:"regex",regex:A},Kt.errToObj(t)))}includes(A,t){return this._addCheck(P({kind:"includes",value:A,position:t?.position},Kt.errToObj(t?.message)))}startsWith(A,t){return this._addCheck(P({kind:"startsWith",value:A},Kt.errToObj(t)))}endsWith(A,t){return this._addCheck(P({kind:"endsWith",value:A},Kt.errToObj(t)))}min(A,t){return this._addCheck(P({kind:"min",value:A},Kt.errToObj(t)))}max(A,t){return this._addCheck(P({kind:"max",value:A},Kt.errToObj(t)))}length(A,t){return this._addCheck(P({kind:"length",value:A},Kt.errToObj(t)))}nonempty(A){return this.min(1,Kt.errToObj(A))}trim(){return new i($A(P({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new i($A(P({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new i($A(P({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(A=>A.kind==="datetime")}get isDate(){return!!this._def.checks.find(A=>A.kind==="date")}get isTime(){return!!this._def.checks.find(A=>A.kind==="time")}get isDuration(){return!!this._def.checks.find(A=>A.kind==="duration")}get isEmail(){return!!this._def.checks.find(A=>A.kind==="email")}get isURL(){return!!this._def.checks.find(A=>A.kind==="url")}get isEmoji(){return!!this._def.checks.find(A=>A.kind==="emoji")}get isUUID(){return!!this._def.checks.find(A=>A.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(A=>A.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(A=>A.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(A=>A.kind==="cuid2")}get isULID(){return!!this._def.checks.find(A=>A.kind==="ulid")}get isIP(){return!!this._def.checks.find(A=>A.kind==="ip")}get isCIDR(){return!!this._def.checks.find(A=>A.kind==="cidr")}get isBase64(){return!!this._def.checks.find(A=>A.kind==="base64")}get isBase64url(){return!!this._def.checks.find(A=>A.kind==="base64url")}get minLength(){let A=null;for(let t of this._def.checks)t.kind==="min"&&(A===null||t.value>A)&&(A=t.value);return A}get maxLength(){let A=null;for(let t of this._def.checks)t.kind==="max"&&(A===null||t.valuenew i(P({checks:[],typeName:_i.ZodString,coerce:e?.coerce??!1},tn(e))),i})();function xMA(i,e){let A=(i.toString().split(".")[1]||"").length,t=(e.toString().split(".")[1]||"").length,n=A>t?A:t,o=Number.parseInt(i.toFixed(n).replace(".","")),a=Number.parseInt(e.toFixed(n).replace(".",""));return o%a/10**n}var LR=(()=>{class i extends hn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(A){if(this._def.coerce&&(A.data=Number(A.data)),this._getType(A)!==ht.number){let a=this._getOrReturnCtx(A);return ot(a,{code:Ne.invalid_type,expected:ht.number,received:a.parsedType}),hi}let n,o=new rs;for(let a of this._def.checks)a.kind==="int"?Mn.isInteger(A.data)||(n=this._getOrReturnCtx(A,n),ot(n,{code:Ne.invalid_type,expected:"integer",received:"float",message:a.message}),o.dirty()):a.kind==="min"?(a.inclusive?A.dataa.value:A.data>=a.value)&&(n=this._getOrReturnCtx(A,n),ot(n,{code:Ne.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="multipleOf"?xMA(A.data,a.value)!==0&&(n=this._getOrReturnCtx(A,n),ot(n,{code:Ne.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):a.kind==="finite"?Number.isFinite(A.data)||(n=this._getOrReturnCtx(A,n),ot(n,{code:Ne.not_finite,message:a.message}),o.dirty()):Mn.assertNever(a);return{status:o.value,value:A.data}}gte(A,t){return this.setLimit("min",A,!0,Kt.toString(t))}gt(A,t){return this.setLimit("min",A,!1,Kt.toString(t))}lte(A,t){return this.setLimit("max",A,!0,Kt.toString(t))}lt(A,t){return this.setLimit("max",A,!1,Kt.toString(t))}setLimit(A,t,n,o){return new i($A(P({},this._def),{checks:[...this._def.checks,{kind:A,value:t,inclusive:n,message:Kt.toString(o)}]}))}_addCheck(A){return new i($A(P({},this._def),{checks:[...this._def.checks,A]}))}int(A){return this._addCheck({kind:"int",message:Kt.toString(A)})}positive(A){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Kt.toString(A)})}negative(A){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Kt.toString(A)})}nonpositive(A){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Kt.toString(A)})}nonnegative(A){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Kt.toString(A)})}multipleOf(A,t){return this._addCheck({kind:"multipleOf",value:A,message:Kt.toString(t)})}finite(A){return this._addCheck({kind:"finite",message:Kt.toString(A)})}safe(A){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Kt.toString(A)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Kt.toString(A)})}get minValue(){let A=null;for(let t of this._def.checks)t.kind==="min"&&(A===null||t.value>A)&&(A=t.value);return A}get maxValue(){let A=null;for(let t of this._def.checks)t.kind==="max"&&(A===null||t.valueA.kind==="int"||A.kind==="multipleOf"&&Mn.isInteger(A.value))}get isFinite(){let A=null,t=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(A===null||n.valuenew i(P({checks:[],typeName:_i.ZodNumber,coerce:e?.coerce||!1},tn(e))),i})(),GR=(()=>{class i extends hn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(A){if(this._def.coerce)try{A.data=BigInt(A.data)}catch(a){return this._getInvalidInput(A)}if(this._getType(A)!==ht.bigint)return this._getInvalidInput(A);let n,o=new rs;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?A.dataa.value:A.data>=a.value)&&(n=this._getOrReturnCtx(A,n),ot(n,{code:Ne.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="multipleOf"?A.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(A,n),ot(n,{code:Ne.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):Mn.assertNever(a);return{status:o.value,value:A.data}}_getInvalidInput(A){let t=this._getOrReturnCtx(A);return ot(t,{code:Ne.invalid_type,expected:ht.bigint,received:t.parsedType}),hi}gte(A,t){return this.setLimit("min",A,!0,Kt.toString(t))}gt(A,t){return this.setLimit("min",A,!1,Kt.toString(t))}lte(A,t){return this.setLimit("max",A,!0,Kt.toString(t))}lt(A,t){return this.setLimit("max",A,!1,Kt.toString(t))}setLimit(A,t,n,o){return new i($A(P({},this._def),{checks:[...this._def.checks,{kind:A,value:t,inclusive:n,message:Kt.toString(o)}]}))}_addCheck(A){return new i($A(P({},this._def),{checks:[...this._def.checks,A]}))}positive(A){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Kt.toString(A)})}negative(A){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Kt.toString(A)})}nonpositive(A){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Kt.toString(A)})}nonnegative(A){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Kt.toString(A)})}multipleOf(A,t){return this._addCheck({kind:"multipleOf",value:A,message:Kt.toString(t)})}get minValue(){let A=null;for(let t of this._def.checks)t.kind==="min"&&(A===null||t.value>A)&&(A=t.value);return A}get maxValue(){let A=null;for(let t of this._def.checks)t.kind==="max"&&(A===null||t.valuenew i(P({checks:[],typeName:_i.ZodBigInt,coerce:e?.coerce??!1},tn(e))),i})(),KR=(()=>{class i extends hn{_parse(A){if(this._def.coerce&&(A.data=!!A.data),this._getType(A)!==ht.boolean){let n=this._getOrReturnCtx(A);return ot(n,{code:Ne.invalid_type,expected:ht.boolean,received:n.parsedType}),hi}return Ss(A.data)}}return i.create=e=>new i(P({typeName:_i.ZodBoolean,coerce:e?.coerce||!1},tn(e))),i})(),UR=(()=>{class i extends hn{_parse(A){if(this._def.coerce&&(A.data=new Date(A.data)),this._getType(A)!==ht.date){let a=this._getOrReturnCtx(A);return ot(a,{code:Ne.invalid_type,expected:ht.date,received:a.parsedType}),hi}if(Number.isNaN(A.data.getTime())){let a=this._getOrReturnCtx(A);return ot(a,{code:Ne.invalid_date}),hi}let n=new rs,o;for(let a of this._def.checks)a.kind==="min"?A.data.getTime()a.value&&(o=this._getOrReturnCtx(A,o),ot(o,{code:Ne.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):Mn.assertNever(a);return{status:n.value,value:new Date(A.data.getTime())}}_addCheck(A){return new i($A(P({},this._def),{checks:[...this._def.checks,A]}))}min(A,t){return this._addCheck({kind:"min",value:A.getTime(),message:Kt.toString(t)})}max(A,t){return this._addCheck({kind:"max",value:A.getTime(),message:Kt.toString(t)})}get minDate(){let A=null;for(let t of this._def.checks)t.kind==="min"&&(A===null||t.value>A)&&(A=t.value);return A!=null?new Date(A):null}get maxDate(){let A=null;for(let t of this._def.checks)t.kind==="max"&&(A===null||t.valuenew i(P({checks:[],coerce:e?.coerce||!1,typeName:_i.ZodDate},tn(e))),i})(),y$=(()=>{class i extends hn{_parse(A){if(this._getType(A)!==ht.symbol){let n=this._getOrReturnCtx(A);return ot(n,{code:Ne.invalid_type,expected:ht.symbol,received:n.parsedType}),hi}return Ss(A.data)}}return i.create=e=>new i(P({typeName:_i.ZodSymbol},tn(e))),i})(),TR=(()=>{class i extends hn{_parse(A){if(this._getType(A)!==ht.undefined){let n=this._getOrReturnCtx(A);return ot(n,{code:Ne.invalid_type,expected:ht.undefined,received:n.parsedType}),hi}return Ss(A.data)}}return i.create=e=>new i(P({typeName:_i.ZodUndefined},tn(e))),i})(),OR=(()=>{class i extends hn{_parse(A){if(this._getType(A)!==ht.null){let n=this._getOrReturnCtx(A);return ot(n,{code:Ne.invalid_type,expected:ht.null,received:n.parsedType}),hi}return Ss(A.data)}}return i.create=e=>new i(P({typeName:_i.ZodNull},tn(e))),i})(),Gy=(()=>{class i extends hn{constructor(){super(...arguments),this._any=!0}_parse(A){return Ss(A.data)}}return i.create=e=>new i(P({typeName:_i.ZodAny},tn(e))),i})(),Lp=(()=>{class i extends hn{constructor(){super(...arguments),this._unknown=!0}_parse(A){return Ss(A.data)}}return i.create=e=>new i(P({typeName:_i.ZodUnknown},tn(e))),i})(),BI=(()=>{class i extends hn{_parse(A){let t=this._getOrReturnCtx(A);return ot(t,{code:Ne.invalid_type,expected:ht.never,received:t.parsedType}),hi}}return i.create=e=>new i(P({typeName:_i.ZodNever},tn(e))),i})(),D$=(()=>{class i extends hn{_parse(A){if(this._getType(A)!==ht.undefined){let n=this._getOrReturnCtx(A);return ot(n,{code:Ne.invalid_type,expected:ht.void,received:n.parsedType}),hi}return Ss(A.data)}}return i.create=e=>new i(P({typeName:_i.ZodVoid},tn(e))),i})(),Gp=(()=>{class i extends hn{_parse(A){let{ctx:t,status:n}=this._processInputParams(A),o=this._def;if(t.parsedType!==ht.array)return ot(t,{code:Ne.invalid_type,expected:ht.array,received:t.parsedType}),hi;if(o.exactLength!==null){let r=t.data.length>o.exactLength.value,s=t.data.lengtho.maxLength.value&&(ot(t,{code:Ne.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((r,s)=>o.type._parseAsync(new Mg(t,r,t.path,s)))).then(r=>rs.mergeArray(n,r));let a=[...t.data].map((r,s)=>o.type._parseSync(new Mg(t,r,t.path,s)));return rs.mergeArray(n,a)}get element(){return this._def.type}min(A,t){return new i($A(P({},this._def),{minLength:{value:A,message:Kt.toString(t)}}))}max(A,t){return new i($A(P({},this._def),{maxLength:{value:A,message:Kt.toString(t)}}))}length(A,t){return new i($A(P({},this._def),{exactLength:{value:A,message:Kt.toString(t)}}))}nonempty(A){return this.min(1,A)}}return i.create=(e,A)=>new i(P({type:e,minLength:null,maxLength:null,exactLength:null,typeName:_i.ZodArray},tn(A))),i})();function FE(i){if(i instanceof LE){let e={};for(let A in i.shape){let t=i.shape[A];e[A]=f1.create(FE(t))}return new LE($A(P({},i._def),{shape:()=>e}))}else return i instanceof Gp?new Gp($A(P({},i._def),{type:FE(i.element)})):i instanceof f1?f1.create(FE(i.unwrap())):i instanceof UE?UE.create(FE(i.unwrap())):i instanceof GE?GE.create(i.items.map(e=>FE(e))):i}var LE=(()=>{class i extends hn{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let A=this._def.shape(),t=Mn.objectKeys(A);return this._cached={shape:A,keys:t},this._cached}_parse(A){if(this._getType(A)!==ht.object){let g=this._getOrReturnCtx(A);return ot(g,{code:Ne.invalid_type,expected:ht.object,received:g.parsedType}),hi}let{status:n,ctx:o}=this._processInputParams(A),{shape:a,keys:r}=this._getCached(),s=[];if(!(this._def.catchall instanceof BI&&this._def.unknownKeys==="strip"))for(let g in o.data)r.includes(g)||s.push(g);let l=[];for(let g of r){let C=a[g],d=o.data[g];l.push({key:{status:"valid",value:g},value:C._parse(new Mg(o,d,o.path,g)),alwaysSet:g in o.data})}if(this._def.catchall instanceof BI){let g=this._def.unknownKeys;if(g==="passthrough")for(let C of s)l.push({key:{status:"valid",value:C},value:{status:"valid",value:o.data[C]}});else if(g==="strict")s.length>0&&(ot(o,{code:Ne.unrecognized_keys,keys:s}),n.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let g=this._def.catchall;for(let C of s){let d=o.data[C];l.push({key:{status:"valid",value:C},value:g._parse(new Mg(o,d,o.path,C)),alwaysSet:C in o.data})}}return o.common.async?Promise.resolve().then(()=>re(this,null,function*(){let g=[];for(let C of l){let d=yield C.key,B=yield C.value;g.push({key:d,value:B,alwaysSet:C.alwaysSet})}return g})).then(g=>rs.mergeObjectSync(n,g)):rs.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(A){return Kt.errToObj,new i(P($A(P({},this._def),{unknownKeys:"strict"}),A!==void 0?{errorMap:(t,n)=>{let o=this._def.errorMap?.(t,n).message??n.defaultError;return t.code==="unrecognized_keys"?{message:Kt.errToObj(A).message??o}:{message:o}}}:{}))}strip(){return new i($A(P({},this._def),{unknownKeys:"strip"}))}passthrough(){return new i($A(P({},this._def),{unknownKeys:"passthrough"}))}extend(A){return new i($A(P({},this._def),{shape:()=>P(P({},this._def.shape()),A)}))}merge(A){return new i({unknownKeys:A._def.unknownKeys,catchall:A._def.catchall,shape:()=>P(P({},this._def.shape()),A._def.shape()),typeName:_i.ZodObject})}setKey(A,t){return this.augment({[A]:t})}catchall(A){return new i($A(P({},this._def),{catchall:A}))}pick(A){let t={};for(let n of Mn.objectKeys(A))A[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new i($A(P({},this._def),{shape:()=>t}))}omit(A){let t={};for(let n of Mn.objectKeys(this.shape))A[n]||(t[n]=this.shape[n]);return new i($A(P({},this._def),{shape:()=>t}))}deepPartial(){return FE(this)}partial(A){let t={};for(let n of Mn.objectKeys(this.shape)){let o=this.shape[n];A&&!A[n]?t[n]=o:t[n]=o.optional()}return new i($A(P({},this._def),{shape:()=>t}))}required(A){let t={};for(let n of Mn.objectKeys(this.shape))if(A&&!A[n])t[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof f1;)a=a._def.innerType;t[n]=a}return new i($A(P({},this._def),{shape:()=>t}))}keyof(){return M$(Mn.objectKeys(this.shape))}}return i.create=(e,A)=>new i(P({shape:()=>e,unknownKeys:"strip",catchall:BI.create(),typeName:_i.ZodObject},tn(A))),i.strictCreate=(e,A)=>new i(P({shape:()=>e,unknownKeys:"strict",catchall:BI.create(),typeName:_i.ZodObject},tn(A))),i.lazycreate=(e,A)=>new i(P({shape:e,unknownKeys:"strip",catchall:BI.create(),typeName:_i.ZodObject},tn(A))),i})(),JR=(()=>{class i extends hn{_parse(A){let{ctx:t}=this._processInputParams(A),n=this._def.options;function o(a){for(let s of a)if(s.result.status==="valid")return s.result;for(let s of a)if(s.result.status==="dirty")return t.common.issues.push(...s.ctx.common.issues),s.result;let r=a.map(s=>new x0(s.ctx.common.issues));return ot(t,{code:Ne.invalid_union,unionErrors:r}),hi}if(t.common.async)return Promise.all(n.map(a=>re(this,null,function*(){let r=$A(P({},t),{common:$A(P({},t.common),{issues:[]}),parent:null});return{result:yield a._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}}))).then(o);{let a,r=[];for(let l of n){let g=$A(P({},t),{common:$A(P({},t.common),{issues:[]}),parent:null}),C=l._parseSync({data:t.data,path:t.path,parent:g});if(C.status==="valid")return C;C.status==="dirty"&&!a&&(a={result:C,ctx:g}),g.common.issues.length&&r.push(g.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;let s=r.map(l=>new x0(l));return ot(t,{code:Ne.invalid_union,unionErrors:s}),hi}}get options(){return this._def.options}}return i.create=(e,A)=>new i(P({options:e,typeName:_i.ZodUnion},tn(A))),i})(),OC=i=>i instanceof HR?OC(i.schema):i instanceof KE?OC(i.innerType()):i instanceof zR?[i.value]:i instanceof Jy?i.options:i instanceof PR?Mn.objectValues(i.enum):i instanceof jR?OC(i._def.innerType):i instanceof TR?[void 0]:i instanceof OR?[null]:i instanceof f1?[void 0,...OC(i.unwrap())]:i instanceof UE?[null,...OC(i.unwrap())]:i instanceof Kp||i instanceof qR?OC(i.unwrap()):i instanceof VR?OC(i._def.innerType):[],Ky=class i extends hn{_parse(e){let{ctx:A}=this._processInputParams(e);if(A.parsedType!==ht.object)return ot(A,{code:Ne.invalid_type,expected:ht.object,received:A.parsedType}),hi;let t=this.discriminator,n=A.data[t],o=this.optionsMap.get(n);return o?A.common.async?o._parseAsync({data:A.data,path:A.path,parent:A}):o._parseSync({data:A.data,path:A.path,parent:A}):(ot(A,{code:Ne.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[t]}),hi)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,A,t){let n=new Map;for(let o of A){let a=OC(o.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let r of a){if(n.has(r))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(r)}`);n.set(r,o)}}return new i(P({typeName:_i.ZodDiscriminatedUnion,discriminator:e,options:A,optionsMap:n},tn(t)))}};function FR(i,e){let A=_0(i),t=_0(e);if(i===e)return{valid:!0,data:i};if(A===ht.object&&t===ht.object){let n=Mn.objectKeys(e),o=Mn.objectKeys(i).filter(r=>n.indexOf(r)!==-1),a=P(P({},i),e);for(let r of o){let s=FR(i[r],e[r]);if(!s.valid)return{valid:!1};a[r]=s.data}return{valid:!0,data:a}}else if(A===ht.array&&t===ht.array){if(i.length!==e.length)return{valid:!1};let n=[];for(let o=0;o{class i extends hn{_parse(A){let{status:t,ctx:n}=this._processInputParams(A),o=(a,r)=>{if(Fy(a)||Fy(r))return hi;let s=FR(a.value,r.value);return s.valid?((Ly(a)||Ly(r))&&t.dirty(),{status:t.value,value:s.data}):(ot(n,{code:Ne.invalid_intersection_types}),hi)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,r])=>o(a,r)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}return i.create=(e,A,t)=>new i(P({left:e,right:A,typeName:_i.ZodIntersection},tn(t))),i})(),GE=(()=>{class i extends hn{_parse(A){let{status:t,ctx:n}=this._processInputParams(A);if(n.parsedType!==ht.array)return ot(n,{code:Ne.invalid_type,expected:ht.array,received:n.parsedType}),hi;if(n.data.lengththis._def.items.length&&(ot(n,{code:Ne.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let a=[...n.data].map((r,s)=>{let l=this._def.items[s]||this._def.rest;return l?l._parse(new Mg(n,r,n.path,s)):null}).filter(r=>!!r);return n.common.async?Promise.all(a).then(r=>rs.mergeArray(t,r)):rs.mergeArray(t,a)}get items(){return this._def.items}rest(A){return new i($A(P({},this._def),{rest:A}))}}return i.create=(e,A)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new i(P({items:e,typeName:_i.ZodTuple,rest:null},tn(A)))},i})(),Uy=class i extends hn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:A,ctx:t}=this._processInputParams(e);if(t.parsedType!==ht.object)return ot(t,{code:Ne.invalid_type,expected:ht.object,received:t.parsedType}),hi;let n=[],o=this._def.keyType,a=this._def.valueType;for(let r in t.data)n.push({key:o._parse(new Mg(t,r,t.path,r)),value:a._parse(new Mg(t,t.data[r],t.path,r)),alwaysSet:r in t.data});return t.common.async?rs.mergeObjectAsync(A,n):rs.mergeObjectSync(A,n)}get element(){return this._def.valueType}static create(e,A,t){return A instanceof hn?new i(P({keyType:e,valueType:A,typeName:_i.ZodRecord},tn(t))):new i(P({keyType:Oy.create(),valueType:e,typeName:_i.ZodRecord},tn(A)))}},v$=(()=>{class i extends hn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(A){let{status:t,ctx:n}=this._processInputParams(A);if(n.parsedType!==ht.map)return ot(n,{code:Ne.invalid_type,expected:ht.map,received:n.parsedType}),hi;let o=this._def.keyType,a=this._def.valueType,r=[...n.data.entries()].map(([s,l],g)=>({key:o._parse(new Mg(n,s,n.path,[g,"key"])),value:a._parse(new Mg(n,l,n.path,[g,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(()=>re(this,null,function*(){for(let l of r){let g=yield l.key,C=yield l.value;if(g.status==="aborted"||C.status==="aborted")return hi;(g.status==="dirty"||C.status==="dirty")&&t.dirty(),s.set(g.value,C.value)}return{status:t.value,value:s}}))}else{let s=new Map;for(let l of r){let g=l.key,C=l.value;if(g.status==="aborted"||C.status==="aborted")return hi;(g.status==="dirty"||C.status==="dirty")&&t.dirty(),s.set(g.value,C.value)}return{status:t.value,value:s}}}}return i.create=(e,A,t)=>new i(P({valueType:A,keyType:e,typeName:_i.ZodMap},tn(t))),i})(),b$=(()=>{class i extends hn{_parse(A){let{status:t,ctx:n}=this._processInputParams(A);if(n.parsedType!==ht.set)return ot(n,{code:Ne.invalid_type,expected:ht.set,received:n.parsedType}),hi;let o=this._def;o.minSize!==null&&n.data.sizeo.maxSize.value&&(ot(n,{code:Ne.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),t.dirty());let a=this._def.valueType;function r(l){let g=new Set;for(let C of l){if(C.status==="aborted")return hi;C.status==="dirty"&&t.dirty(),g.add(C.value)}return{status:t.value,value:g}}let s=[...n.data.values()].map((l,g)=>a._parse(new Mg(n,l,n.path,g)));return n.common.async?Promise.all(s).then(l=>r(l)):r(s)}min(A,t){return new i($A(P({},this._def),{minSize:{value:A,message:Kt.toString(t)}}))}max(A,t){return new i($A(P({},this._def),{maxSize:{value:A,message:Kt.toString(t)}}))}size(A,t){return this.min(A,t).max(A,t)}nonempty(A){return this.min(1,A)}}return i.create=(e,A)=>new i(P({valueType:e,minSize:null,maxSize:null,typeName:_i.ZodSet},tn(A))),i})(),Ty=class i extends hn{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:A}=this._processInputParams(e);if(A.parsedType!==ht.function)return ot(A,{code:Ne.invalid_type,expected:ht.function,received:A.parsedType}),hi;function t(r,s){return Fp({data:r,path:A.path,errorMaps:[A.common.contextualErrorMap,A.schemaErrorMap,RE(),TC].filter(l=>!!l),issueData:{code:Ne.invalid_arguments,argumentsError:s}})}function n(r,s){return Fp({data:r,path:A.path,errorMaps:[A.common.contextualErrorMap,A.schemaErrorMap,RE(),TC].filter(l=>!!l),issueData:{code:Ne.invalid_return_type,returnTypeError:s}})}let o={errorMap:A.common.contextualErrorMap},a=A.data;if(this._def.returns instanceof Yy){let r=this;return Ss(function(...s){return re(this,null,function*(){let l=new x0([]),g=yield r._def.args.parseAsync(s,o).catch(B=>{throw l.addIssue(t(s,B)),l}),C=yield Reflect.apply(a,this,g);return yield r._def.returns._def.type.parseAsync(C,o).catch(B=>{throw l.addIssue(n(C,B)),l})})})}else{let r=this;return Ss(function(...s){let l=r._def.args.safeParse(s,o);if(!l.success)throw new x0([t(s,l.error)]);let g=Reflect.apply(a,this,l.data),C=r._def.returns.safeParse(g,o);if(!C.success)throw new x0([n(g,C.error)]);return C.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new i($A(P({},this._def),{args:GE.create(e).rest(Lp.create())}))}returns(e){return new i($A(P({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,A,t){return new i(P({args:e||GE.create([]).rest(Lp.create()),returns:A||Lp.create(),typeName:_i.ZodFunction},tn(t)))}},HR=(()=>{class i extends hn{get schema(){return this._def.getter()}_parse(A){let{ctx:t}=this._processInputParams(A);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}return i.create=(e,A)=>new i(P({getter:e,typeName:_i.ZodLazy},tn(A))),i})(),zR=(()=>{class i extends hn{_parse(A){if(A.data!==this._def.value){let t=this._getOrReturnCtx(A);return ot(t,{received:t.data,code:Ne.invalid_literal,expected:this._def.value}),hi}return{status:"valid",value:A.data}}get value(){return this._def.value}}return i.create=(e,A)=>new i(P({value:e,typeName:_i.ZodLiteral},tn(A))),i})();function M$(i,e){return new Jy(P({values:i,typeName:_i.ZodEnum},tn(e)))}var Jy=(()=>{class i extends hn{_parse(A){if(typeof A.data!="string"){let t=this._getOrReturnCtx(A),n=this._def.values;return ot(t,{expected:Mn.joinValues(n),received:t.parsedType,code:Ne.invalid_type}),hi}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(A.data)){let t=this._getOrReturnCtx(A),n=this._def.values;return ot(t,{received:t.data,code:Ne.invalid_enum_value,options:n}),hi}return Ss(A.data)}get options(){return this._def.values}get enum(){let A={};for(let t of this._def.values)A[t]=t;return A}get Values(){let A={};for(let t of this._def.values)A[t]=t;return A}get Enum(){let A={};for(let t of this._def.values)A[t]=t;return A}extract(A,t=this._def){return i.create(A,P(P({},this._def),t))}exclude(A,t=this._def){return i.create(this.options.filter(n=>!A.includes(n)),P(P({},this._def),t))}}return i.create=M$,i})(),PR=(()=>{class i extends hn{_parse(A){let t=Mn.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(A);if(n.parsedType!==ht.string&&n.parsedType!==ht.number){let o=Mn.objectValues(t);return ot(n,{expected:Mn.joinValues(o),received:n.parsedType,code:Ne.invalid_type}),hi}if(this._cache||(this._cache=new Set(Mn.getValidEnumValues(this._def.values))),!this._cache.has(A.data)){let o=Mn.objectValues(t);return ot(n,{received:n.data,code:Ne.invalid_enum_value,options:o}),hi}return Ss(A.data)}get enum(){return this._def.values}}return i.create=(e,A)=>new i(P({values:e,typeName:_i.ZodNativeEnum},tn(A))),i})(),Yy=(()=>{class i extends hn{unwrap(){return this._def.type}_parse(A){let{ctx:t}=this._processInputParams(A);if(t.parsedType!==ht.promise&&t.common.async===!1)return ot(t,{code:Ne.invalid_type,expected:ht.promise,received:t.parsedType}),hi;let n=t.parsedType===ht.promise?t.data:Promise.resolve(t.data);return Ss(n.then(o=>this._def.type.parseAsync(o,{path:t.path,errorMap:t.common.contextualErrorMap})))}}return i.create=(e,A)=>new i(P({type:e,typeName:_i.ZodPromise},tn(A))),i})(),KE=(()=>{class i extends hn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_i.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(A){let{status:t,ctx:n}=this._processInputParams(A),o=this._def.effect||null,a={addIssue:r=>{ot(n,r),r.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),o.type==="preprocess"){let r=o.transform(n.data,a);if(n.common.async)return Promise.resolve(r).then(s=>re(this,null,function*(){if(t.value==="aborted")return hi;let l=yield this._def.schema._parseAsync({data:s,path:n.path,parent:n});return l.status==="aborted"?hi:l.status==="dirty"?II(l.value):t.value==="dirty"?II(l.value):l}));{if(t.value==="aborted")return hi;let s=this._def.schema._parseSync({data:r,path:n.path,parent:n});return s.status==="aborted"?hi:s.status==="dirty"?II(s.value):t.value==="dirty"?II(s.value):s}}if(o.type==="refinement"){let r=s=>{let l=o.refinement(s,a);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?hi:(s.status==="dirty"&&t.dirty(),r(s.value),{status:t.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?hi:(s.status==="dirty"&&t.dirty(),r(s.value).then(()=>({status:t.value,value:s.value}))))}if(o.type==="transform")if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!p1(r))return hi;let s=o.transform(r.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(r=>p1(r)?Promise.resolve(o.transform(r.value,a)).then(s=>({status:t.value,value:s})):hi);Mn.assertNever(o)}}return i.create=(e,A,t)=>new i(P({schema:e,typeName:_i.ZodEffects,effect:A},tn(t))),i.createWithPreprocess=(e,A,t)=>new i(P({schema:A,effect:{type:"preprocess",transform:e},typeName:_i.ZodEffects},tn(t))),i})();var f1=(()=>{class i extends hn{_parse(A){return this._getType(A)===ht.undefined?Ss(void 0):this._def.innerType._parse(A)}unwrap(){return this._def.innerType}}return i.create=(e,A)=>new i(P({innerType:e,typeName:_i.ZodOptional},tn(A))),i})(),UE=(()=>{class i extends hn{_parse(A){return this._getType(A)===ht.null?Ss(null):this._def.innerType._parse(A)}unwrap(){return this._def.innerType}}return i.create=(e,A)=>new i(P({innerType:e,typeName:_i.ZodNullable},tn(A))),i})(),jR=(()=>{class i extends hn{_parse(A){let{ctx:t}=this._processInputParams(A),n=t.data;return t.parsedType===ht.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}return i.create=(e,A)=>new i(P({innerType:e,typeName:_i.ZodDefault,defaultValue:typeof A.default=="function"?A.default:()=>A.default},tn(A))),i})(),VR=(()=>{class i extends hn{_parse(A){let{ctx:t}=this._processInputParams(A),n=$A(P({},t),{common:$A(P({},t.common),{issues:[]})}),o=this._def.innerType._parse({data:n.data,path:n.path,parent:P({},n)});return NE(o)?o.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new x0(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new x0(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}return i.create=(e,A)=>new i(P({innerType:e,typeName:_i.ZodCatch,catchValue:typeof A.catch=="function"?A.catch:()=>A.catch},tn(A))),i})(),S$=(()=>{class i extends hn{_parse(A){if(this._getType(A)!==ht.nan){let n=this._getOrReturnCtx(A);return ot(n,{code:Ne.invalid_type,expected:ht.nan,received:n.parsedType}),hi}return{status:"valid",value:A.data}}}return i.create=e=>new i(P({typeName:_i.ZodNaN},tn(e))),i})(),RMA=Symbol("zod_brand"),Kp=class extends hn{_parse(e){let{ctx:A}=this._processInputParams(e),t=A.data;return this._def.type._parse({data:t,path:A.path,parent:A})}unwrap(){return this._def.type}},Up=class i extends hn{_parse(e){let{status:A,ctx:t}=this._processInputParams(e);if(t.common.async)return re(this,null,function*(){let o=yield this._def.in._parseAsync({data:t.data,path:t.path,parent:t});return o.status==="aborted"?hi:o.status==="dirty"?(A.dirty(),II(o.value)):this._def.out._parseAsync({data:o.value,path:t.path,parent:t})});{let n=this._def.in._parseSync({data:t.data,path:t.path,parent:t});return n.status==="aborted"?hi:n.status==="dirty"?(A.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:t.path,parent:t})}}static create(e,A){return new i({in:e,out:A,typeName:_i.ZodPipeline})}},qR=(()=>{class i extends hn{_parse(A){let t=this._def.innerType._parse(A),n=o=>(p1(o)&&(o.value=Object.freeze(o.value)),o);return NE(t)?t.then(o=>n(o)):n(t)}unwrap(){return this._def.innerType}}return i.create=(e,A)=>new i(P({innerType:e,typeName:_i.ZodReadonly},tn(A))),i})();function p$(i,e){let A=typeof i=="function"?i(e):typeof i=="string"?{message:i}:i;return typeof A=="string"?{message:A}:A}function k$(i,e={},A){return i?Gy.create().superRefine((t,n)=>{let o=i(t);if(o instanceof Promise)return o.then(a=>{if(!a){let r=p$(e,t),s=r.fatal??A??!0;n.addIssue($A(P({code:"custom"},r),{fatal:s}))}});if(!o){let a=p$(e,t),r=a.fatal??A??!0;n.addIssue($A(P({code:"custom"},a),{fatal:r}))}}):Gy.create()}var NMA={object:LE.lazycreate},_i=(function(i){return i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline",i.ZodReadonly="ZodReadonly",i})(_i||{});var FMA=(i,e={message:`Input not instance of ${i.name}`})=>k$(A=>A instanceof i,e),_$=Oy.create,x$=LR.create,LMA=S$.create,GMA=GR.create,R$=KR.create,KMA=UR.create,UMA=y$.create,TMA=TR.create,OMA=OR.create,JMA=Gy.create,YMA=Lp.create,HMA=BI.create,zMA=D$.create,PMA=Gp.create,jMA=LE.create,VMA=LE.strictCreate,qMA=JR.create,WMA=Ky.create,ZMA=YR.create,XMA=GE.create,$MA=Uy.create,A9A=v$.create,e9A=b$.create,t9A=Ty.create,i9A=HR.create,n9A=zR.create,o9A=Jy.create,a9A=PR.create,r9A=Yy.create,s9A=KE.create,l9A=f1.create,g9A=UE.create,c9A=KE.createWithPreprocess,C9A=Up.create,d9A=()=>_$().optional(),I9A=()=>x$().optional(),B9A=()=>R$().optional(),h9A={string:i=>Oy.create($A(P({},i),{coerce:!0})),number:i=>LR.create($A(P({},i),{coerce:!0})),boolean:i=>KR.create($A(P({},i),{coerce:!0})),bigint:i=>GR.create($A(P({},i),{coerce:!0})),date:i=>UR.create($A(P({},i),{coerce:!0}))};var E9A=hi;var Q9A=XA.union([XA.string(),XA.number(),XA.boolean()]),Hy=XA.lazy(()=>XA.union([Q9A,XA.array(Hy),XA.record(XA.string(),Hy)]));function zy(i){return i.transform(e=>{if(!e||typeof e!="object")return e;let A={};for(let[t,n]of Object.entries(e))n!==null&&(A[t]=n);return A})}var WR=XA.string().transform((i,e)=>{try{return JSON.parse(i)}catch(A){return e.addIssue({code:"custom",message:"Invalid JSON string"}),XA.NEVER}}),Tp=i=>XA.union([i,WR.pipe(i)]);var Py="gen_ai.input.messages",jy="gen_ai.output.messages",Vy="gen_ai.system_instructions",qy="gen_ai.tool.definitions",Wy="gen_ai.response.finish_reasons",Zy="gen_ai.usage.input_tokens",Xy="gen_ai.usage.output_tokens",N$="function",Jp="gen_ai.client.inference.operation.details",u9A=XA.object({type:XA.literal("text"),content:XA.string()}),p9A=XA.object({type:XA.literal("blob"),mime_type:XA.string(),data:XA.any()}),f9A=XA.object({type:XA.literal("file_data"),mime_type:XA.string(),uri:XA.string()}),m9A=XA.object({type:XA.literal("tool_call"),id:XA.string().nullable().optional(),name:XA.string(),arguments:XA.record(XA.string(),XA.any()).nullable().optional()}),w9A=XA.object({type:XA.literal("tool_call_response"),id:XA.string().nullable().optional(),response:XA.record(XA.string(),XA.any()).nullable().optional()}),ZR=XA.discriminatedUnion("type",[u9A,p9A,f9A,m9A,w9A]),y9A=XA.object({role:XA.string(),parts:XA.array(ZR)}),D9A=XA.object({role:XA.string(),parts:XA.array(ZR),finish_reason:XA.string()}),v9A=XA.object({type:XA.literal(N$),name:XA.string(),description:XA.string().nullable().optional(),parameters:XA.record(XA.string(),XA.any()).nullable().optional()}),b9A=XA.object({name:XA.string(),type:XA.string()}),M9A=XA.union([v9A,b9A]),S9A=Tp(XA.array(y9A)),k9A=Tp(XA.array(D9A)),_9A=Tp(XA.array(ZR)),x9A=Tp(XA.array(M9A)),XR=XA.array(XA.string()),Op=XA.number(),R9A=XA.object({[Py]:S9A.optional(),[jy]:k9A.optional(),[Vy]:_9A.optional(),[qy]:x9A.optional(),[Wy]:XR.optional(),[Zy]:Op.optional(),[Xy]:Op.optional()}).passthrough(),F$=XA.object({event_name:XA.literal(Jp),body:XA.unknown().optional(),attributes:R9A.optional()});var $y="gen_ai.system.message",AD="gen_ai.user.message",eD="gen_ai.choice",N9A=zy(XA.object({id:XA.string().nullable().optional(),name:XA.string(),args:XA.record(XA.string(),XA.any()),needsResponse:XA.boolean().nullable().optional()})),F9A=zy(XA.object({id:XA.string().nullable().optional(),name:XA.string(),response:XA.record(XA.string(),XA.any())})),G$=zy(XA.object({text:XA.string().nullable().optional(),function_call:N9A.nullable().optional(),function_response:F9A.nullable().optional()})),L9A=XA.object({parts:XA.array(G$),role:XA.string()}),L$=XA.object({content:XA.object({parts:XA.array(G$),role:XA.string().optional()}),role:XA.string().optional()}).transform(i=>{let e=P({},i.content);return i.role!==void 0&&(e.role=i.role),{content:e}}).pipe(XA.object({content:L9A})),G9A=XA.object({content:XA.string()}),K9A=XA.object({event_name:XA.enum([AD,eD]),body:XA.union([L$,WR.pipe(L$)])}),U9A=XA.object({event_name:XA.literal($y),body:G9A}),K$=XA.union([U9A,K9A]);var T9A="gcp.vertex.agent.llm_request",O9A="gcp.vertex.agent.llm_response";function tD(i){let e=J9A(i);if(e!==void 0)return e;let A=Y9A(i);if(A!==void 0)return A;let t=H9A(i);if(t!==void 0)return t}function J9A(i){let e=(i.logs??[]).find(r=>r.event_name===Jp);if(e===void 0)return;let A=e.attributes??{},t=A[Vy],n=A[Py],o=A[qy],a=A[jy];if(!(t===void 0&&n===void 0&&o===void 0&&a===void 0))return{kind:"experimental",inputs:{system_instruction:t,user_messages:n,tool_definitions:o},outputs:a}}function Y9A(i){let e=i.logs??[],A,t=[],n;for(let o of e)switch(o.event_name){case $y:A=o.body;break;case AD:t.push(o.body);break;case eD:n=o.body;break;default:break}if(!(A===void 0&&t.length===0&&n===void 0))return{kind:"stable",inputs:{system_instruction:A,user_messages:t},outputs:n}}function H9A(i){let e=i.attributes??{},A=e[T9A],t=e[O9A];if(!(A===void 0&&t===void 0))return{kind:"legacy",inputs:U$(A),outputs:U$(t)}}function U$(i){if(typeof i!="string")return i;try{return JSON.parse(i)}catch(e){return i}}var z9A=XA.union([K$,F$]);var P9A="gen_ai.operation.name",T$="gen_ai.conversation.id",j9A="gen_ai.agent.name",V9A="gen_ai.agent.description",O$="gcp.vertex.agent.invocation_id",q9A="gcp.vertex.agent.associated_event_ids",J$="gcp.vertex.agent.event_id";var AN="invoke_agent",hI="generate_content",W9A=XA.object({name:XA.string(),start_time:XA.number(),end_time:XA.number(),trace_id:XA.union([XA.string(),XA.number()]),span_id:XA.union([XA.string(),XA.number()]),parent_span_id:XA.union([XA.string(),XA.number()]).nullable().optional(),attributes:XA.record(XA.string(),Hy).optional(),logs:XA.array(z9A).optional()}),Z9A=XA.object({attrConversationId:XA.string().optional(),attrInvocationId:XA.string().optional(),attrAssociatedEventIds:XA.array(XA.string()).optional(),attrAgentName:XA.string().optional(),attrAgentDescription:XA.string().optional(),attrEventId:XA.string().optional(),attrResponseFinishReasons:XR.optional(),attrUsageInputTokens:Op.optional(),attrUsageOutputTokens:Op.optional()});function X9A(i){let e=i.attributes??{},A={attrConversationId:e[T$],attrInvocationId:e[O$],attrAssociatedEventIds:e[q9A],attrAgentName:e[j9A],attrAgentDescription:e[V9A],attrEventId:e[J$],attrResponseFinishReasons:e[Wy],attrUsageInputTokens:e[Zy],attrUsageOutputTokens:e[Xy]};for(let t of Object.keys(A))A[t]===void 0&&delete A[t];return A}var $9A=XA.object({attrConversationId:XA.string({message:`'${T$}' is required on '${AN}' spans`})}),ASA=XA.object({attrEventId:XA.string({message:`'${J$}' is required on '${hI}' spans`}),attrInvocationId:XA.string({message:`'${O$}' is required on '${hI}' spans`})});function eN(i,e){for(let A of e)i.addIssue(A)}function $R(i,e,A){let t=X9A(i),n=Z9A.safeParse(t);if(!n.success)return eN(A,n.error.issues),null;if(e===null)return n.data;let o=e.safeParse(t);return o.success?P(P({},n.data),o.data):(eN(A,o.error.issues),null)}var Y$=XA.unknown().transform((i,e)=>{let A=W9A.safeParse(i);if(!A.success)return eN(e,A.error.issues),XA.NEVER;let t=A.data,n=t.attributes?.[P9A],B=t,{logs:o,attributes:a}=B,r=Pp(B,["logs","attributes"]),s=a!==void 0?{rawAttributesUseThisFieldOnlyForDisplay:a}:{rawAttributesUseThisFieldOnlyForDisplay:{}},l={rawSpanUseThisFieldOnlyForDisplay:i};if(n===AN){let u=$R(t,$9A,e);return u===null?XA.NEVER:$A(P(P(P(P({},r),s),l),u),{attrOperationName:AN})}if(n===hI){let u=$R(t,ASA,e);if(u===null)return XA.NEVER;let E=tD({attributes:t.attributes,logs:o});return P($A(P(P(P(P({},r),s),l),u),{attrOperationName:hI}),E!==void 0?{io:E}:{})}let g=$R(t,null,e);if(g===null)return XA.NEVER;let C=tD({attributes:t.attributes,logs:o});return P(P(P(P(P({},r),s),l),g),C!==void 0?{io:C}:{})});function tN(i){if(!i)return;let e=i.system_instruction;if(e===void 0&&i.systemInstruction&&(e=i.systemInstruction),e===void 0&&i.config&&(e=i.config.system_instruction!==void 0?i.config.system_instruction:i.config.systemInstruction),typeof e=="string")return e}var eSA=["sideDrawer"],tSA=["drawerSessionTab"],iSA=["appSearchInput"],nSA=["invChipMenuTrigger"],oSA=["nodeChipMenuTrigger"],aSA=["addMenuTrigger"],rSA=[[["","adk-web-chat-container-top",""]]],sSA=["[adk-web-chat-container-top]"],z$=()=>[],lSA=(i,e)=>e.metricName;function gSA(i,e){i&1&&dn(0)}function cSA(i,e){if(i&1&&kt(0,gSA,1,0,"ng-container",40),i&2){let A=p();H("ngComponentOutlet",A.logoComponent)}}function CSA(i,e){if(i&1&&(I(0,"span",45),D(1),h()),i&2){let A=p(2);Q(),Ee(" ",A.adkVersion())}}function dSA(i,e){if(i&1&&(I(0,"div",48)(1,"div",50)(2,"span",51),D(3,"Version:"),h(),I(4,"span",52),D(5),h()(),I(6,"div",50)(7,"span",51),D(8,"Language:"),h(),I(9,"span",52),D(10),h()(),I(11,"div",50)(12,"span",51),D(13,"Lang Version:"),h(),I(14,"span",52),D(15),h()()()),i&2){let A=p(2);Q(5),nA(A.versionInfo().version),Q(5),nA(A.versionInfo().language),Q(5),nA(A.versionInfo().language_version)}}function ISA(i,e){if(i&1&&(lA(0,"img",41),I(1,"div",42)(2,"div",43)(3,"span",44),D(4,"Agent Development Kit"),h(),T(5,CSA,2,1,"span",45),h(),I(6,"div",46)(7,"div",47),D(8),h(),T(9,dSA,16,3,"div",48),h()(),I(10,"span",49),D(11,"ADK"),h()),i&2){let A=p();Q(5),O(A.adkVersion()?5:-1),Q(3),nA(A.sidePanelI18n.disclosureTooltip),Q(),O(A.versionInfo()?9:-1)}}function BSA(i,e){i&1&&(I(0,"mat-icon",20),D(1,"warning"),h())}function hSA(i,e){if(i&1){let A=aA();I(0,"span",54)(1,"button",56),U("click",function(){L(A);let n=p(2);return G(n.openAgentStructureGraphDialog())}),I(2,"mat-icon"),D(3,"account_tree"),h()()()}if(i&2){let A=p(2);H("matTooltip",A.graphsAvailable()?"View Agent Structure Graph":"Agent structure graph is not available for this agent"),Q(),H("disabled",!A.graphsAvailable())}}function ESA(i,e){if(i&1){let A=aA();lA(0,"div",53),T(1,hSA,4,2,"span",54),I(2,"span",54)(3,"button",55),U("click",function(){L(A);let n=p();return G(n.enterBuilderMode())}),I(4,"mat-icon"),D(5,"edit"),h()()()}if(i&2){let A=p();Q(),O(A.graphsAvailable()?1:-1),Q(),H("matTooltip",A.disableBuilderSwitch?"Editing is not available for this agent because it was not built by the builder":"Edit in Builder Mode"),Q(),H("disabled",A.disableBuilderSwitch)}}function QSA(i,e){if(i&1){let A=aA();I(0,"div",57)(1,"mat-icon",62),D(2,"visibility"),h(),I(3,"span",63),D(4),h(),I(5,"button",64),U("click",function(){L(A);let n=p(2);return G(n.closeReadonlySession())}),I(6,"mat-icon",65),D(7,"close"),h()()()}if(i&2){let A=p(2);Q(4),Ya("",A.readonlySessionType(),": ",A.readonlySessionName())}}function uSA(i,e){if(i&1){let A=aA();I(0,"button",69),U("click",function(){L(A);let n=p(7);return G(n.onNewSessionClick())}),I(1,"mat-icon",18),D(2,"add_comment"),h(),I(3,"span"),D(4),h()()}if(i&2){let A=p(7);H("matTooltip",A.i18n.createNewSessionTooltip),Q(4),nA(A.i18n.newSessionButton)}}function pSA(i,e){if(i&1){let A=aA();I(0,"button",70),U("click",function(){L(A);let n=p(7);return G(n.onNewSessionClick())}),I(1,"mat-icon",18),D(2,"add_comment"),h()()}if(i&2){let A=p(7);H("matTooltip",A.i18n.createNewSessionTooltip)}}function fSA(i,e){if(i&1&&(lA(0,"div",53),T(1,uSA,5,2,"button",67)(2,pSA,3,1,"button",68)),i&2){let A=p(6);Q(),O(A.uiEvents().length>0&&!A.isMobile()?1:2)}}function mSA(i,e){if(i&1&&T(0,fSA,3,1),i&2){let A=p(5);O(A.sessionId?0:-1)}}function wSA(i,e){if(i&1&&(T(0,mSA,1,1),mt(1,"async")),i&2){let A=p(4);O(Ft(1,1,A.isNewSessionButtonEnabledObs)?0:-1)}}function ySA(i,e){if(i&1&&(ro(0),mt(1,"async"),T(2,wSA,2,3)),i&2){let A=Ft(1,1,p(3).uiStateService.isSessionLoading());Q(2),O(A===!1?2:-1)}}function DSA(i,e){if(i&1){let A=aA();I(0,"div",16)(1,"button",66),U("click",function(){L(A);let n=p(2);return G(n.toggleSessionSelectorDrawer())}),I(2,"mat-icon",18),D(3,"chat"),h(),I(4,"span",19),D(5),h(),I(6,"mat-icon",21),D(7,"arrow_drop_down"),h()(),T(8,ySA,3,3),h()}if(i&2){let A=p(2);Q(5),nA(A.getToolbarSessionId()),Q(3),O(A.evalCase?-1:8)}}function vSA(i,e){if(i&1&&(I(0,"div",57)(1,"span",63),D(2),h(),I(3,"span",71),D(4),h()()),i&2){let A=p(3);Q(2),nA(A.i18n.evalCaseIdLabel),Q(2),nA(A.evalCase.evalId)}}function bSA(i,e){if(i&1){let A=aA();I(0,"button",72),U("click",function(){L(A);let n=p(3);return G(n.cancelEditEvalCase())}),D(1),h(),I(2,"button",73),U("click",function(){L(A);let n=p(3);return G(n.saveEvalCase())}),D(3),h()}if(i&2){let A=p(3);Q(),Ee(" ",A.i18n.cancelButton," "),Q(),H("disabled",!A.hasEvalCaseChanged()||A.isEvalCaseEditing()),Q(),Ee(" ",A.i18n.saveButton," ")}}function MSA(i,e){}function SSA(i,e){if(i&1&&(T(0,vSA,5,2,"div",57),I(1,"div",60),T(2,bSA,4,3)(3,MSA,0,0),h()),i&2){let A=p(2);O(A.isViewOnlySession()?-1:0),Q(2),O(A.isEvalEditMode()?2:3)}}function kSA(i,e){}function _SA(i,e){if(i&1&&(I(0,"div",74),D(1),h()),i&2){let A=p(3);Q(),nA(A.i18n.loadingSessionLabel)}}function xSA(i,e){if(i&1&&(I(0,"div",59),ro(1),mt(2,"async"),T(3,kSA,0,0)(4,_SA,2,1,"div",74),h()),i&2){let A=Ft(2,1,p(2).uiStateService.isSessionLoading());Q(3),O(A===!1?3:4)}}function RSA(i,e){if(i&1){let A=aA();I(0,"button",75),U("click",function(){L(A);let n=p(2);return G(n.themeService==null?null:n.themeService.toggleTheme())}),I(1,"mat-icon"),D(2),h()()}if(i&2){let A=p(2);H("matTooltip",(A.themeService==null?null:A.themeService.currentTheme())==="dark"?"Switch to Light Mode":"Switch to Dark Mode"),Q(2),nA((A.themeService==null?null:A.themeService.currentTheme())==="dark"?"light_mode":"dark_mode")}}function NSA(i,e){if(i&1&&(I(0,"div",22),T(1,QSA,8,2,"div",57)(2,DSA,9,2,"div",16),I(3,"div",58),T(4,SSA,4,2)(5,xSA,5,3,"div",59),h(),I(6,"div",60),ro(7),mt(8,"async"),T(9,RSA,3,2,"button",61),h()()),i&2){let A=p();Q(),O(A.isViewOnlySession()?1:2),Q(3),O(A.evalCase?4:5);let t=Ft(8,3,A.uiStateService.isSessionLoading());Q(5),O(t===!1?9:-1)}}function FSA(i,e){i&1&&(I(0,"div",85),lA(1,"mat-progress-spinner",86),h())}function LSA(i,e){i&1&&(I(0,"mat-icon",92),D(1,"check"),h())}function GSA(i,e){if(i&1){let A=aA();I(0,"button",89),U("click",function(){let n=L(A).$implicit,o=p(3);return G(o.selectAppFromDrawer(n))}),I(1,"mat-icon",90),D(2,"robot_2"),h(),I(3,"span",91),D(4),h(),T(5,LSA,2,0,"mat-icon",92),h()}if(i&2){let A=e.$implicit,t=p(3);_A("selected",A===t.appName),Q(4),nA(A),Q(),O(A===t.appName?5:-1)}}function KSA(i,e){i&1&&(I(0,"div",88),D(1,"No apps found"),h())}function USA(i,e){i&1&&ke(0,GSA,6,4,"button",87,ni,!1,KSA,2,0,"div",88),i&2&&_e(e)}function TSA(i,e){if(i&1){let A=aA();I(0,"div",76)(1,"span",77),D(2,"Select an App"),h(),I(3,"div")(4,"button",78),U("click",function(){L(A);let n=p();return G(n.openAddItemDialog())}),I(5,"mat-icon"),D(6,"add"),h()(),I(7,"button",79),U("click",function(){L(A);let n=p();return G(n.toggleAppSelectorDrawer())}),I(8,"mat-icon"),D(9,"close"),h()()()(),I(10,"div",80)(11,"mat-form-field",81)(12,"mat-icon",82),D(13,"search"),h(),I(14,"input",83,3),U("keydown",function(n){L(A);let o=p();return G(o.handleAppSearchKeydown(n))}),h()()(),I(16,"div",84),U("keydown",function(n){L(A);let o=p();return G(o.handleAppListKeydown(n))}),T(17,FSA,2,0,"div",85),mt(18,"async"),S1(19,USA,3,1),h()}if(i&2){let A,t=p();Q(14),H("formControl",t.appDrawerSearchControl),Q(3),O(t.isLoadingApps()?17:(A=Ft(18,2,t.filteredDrawerApps$))?19:-1,A)}}function OSA(i,e){if(i&1){let A=aA();I(0,"button",95),U("click",function(){L(A);let n=p(2);return G(n.importSession())}),I(1,"mat-icon"),D(2,"upload"),h(),I(3,"span"),D(4,"Import"),h()()}if(i&2){let A=p(2);H("matTooltip",A.i18n.importSessionTooltip)}}function JSA(i,e){if(i&1){let A=aA();I(0,"button",108),U("click",function(){L(A);let n=p(3);return G(n.exportSession())}),I(1,"mat-icon"),D(2,"download"),h(),I(3,"span"),D(4,"Export"),h()()}if(i&2){let A=p(3);H("matTooltip",A.i18n.exportSessionTooltip)}}function YSA(i,e){if(i&1){let A=aA();I(0,"button",109),U("click",function(){L(A);let n=p(3);return G(n.deleteSession(n.sessionId))}),I(1,"mat-icon"),D(2,"delete"),h(),I(3,"span"),D(4,"Delete"),h()()}if(i&2){let A=p(3);H("matTooltip",A.i18n.deleteSessionTooltip)}}function HSA(i,e){if(i&1){let A=aA();I(0,"div",97)(1,"span",100),D(2,"Current Session"),h(),I(3,"div",101)(4,"app-inline-edit",102),U("save",function(n){L(A);let o=p(2);return G(o.saveSessionName(n))}),h()(),I(5,"div",103)(6,"span",104),D(7),h(),I(8,"button",105),U("click",function(){L(A);let n=p(2);return G(n.copySessionId())}),I(9,"mat-icon"),D(10,"content_copy"),h()(),T(11,JSA,5,1,"button",106),mt(12,"async"),T(13,YSA,5,1,"button",107),mt(14,"async"),h()()}if(i&2){let A=p(2);Q(4),H("value",A.sessionDisplayNameDraft)("displayValue",A.getCurrentSessionDisplayName())("tooltip",A.sessionId),Q(2),H("title",A.sessionId),Q(),nA(A.sessionId),Q(4),O(Ft(12,7,A.isExportSessionEnabledObs)?11:-1),Q(2),O(Ft(14,9,A.isDeleteSessionEnabledObs)?13:-1)}}function zSA(i,e){if(i&1){let A=aA();I(0,"div",76)(1,"span",77),D(2,"Select a Session"),h(),I(3,"div",93),T(4,OSA,5,1,"button",94),mt(5,"async"),I(6,"button",95),U("click",function(){L(A);let n=p();return G(n.viewSession())}),I(7,"mat-icon"),D(8,"visibility"),h(),I(9,"span"),D(10,"View"),h()(),I(11,"button",96),U("click",function(){L(A);let n=p();return G(n.toggleSessionSelectorDrawer())}),I(12,"mat-icon"),D(13,"close"),h()()()(),T(14,HSA,15,11,"div",97),I(15,"div",98)(16,"app-session-tab",99,4),U("sessionSelected",function(n){L(A);let o=p();return G(o.onSessionSelectedFromDrawer(n))})("sessionReloaded",function(n){L(A);let o=p();return G(o.onSessionReloadedFromDrawer(n))}),h()()}if(i&2){let A=p();Q(4),O(Ft(5,6,A.importSessionEnabledObs)?4:-1),Q(2),H("matTooltip",A.i18n.viewSessionTooltip),Q(8),O(A.sessionId?14:-1),Q(2),H("userId",A.userId)("appName",A.appName)("sessionId",A.sessionId)}}function PSA(i,e){if(i&1){let A=aA();I(0,"app-side-panel",110),U("jumpToInvocation",function(n){L(A);let o=p();return G(o.handleJumpToInvocation(n))})("closePanel",function(){L(A);let n=p();return G(n.toggleSidePanel())})("tabChange",function(n){L(A);let o=p();return G(o.handleTabChange(n))})("sessionSelected",function(n){L(A);let o=p();return G(o.updateWithSelectedSession(n))})("evalCaseSelected",function(n){L(A);let o=p();return G(o.updateWithSelectedEvalCase(n))})("editEvalCaseRequested",function(n){L(A);let o=p();return G(o.handleEditEvalCaseRequested(n))})("testSelected",function(n){L(A);let o=p();return G(o.updateWithSelectedTest(n.testName,n.events))})("evalSetIdSelected",function(n){L(A);let o=p();return G(o.updateSelectedEvalSetId(n))})("returnToSession",function(n){L(A);let o=p();return G(o.handleReturnToSession(n))})("evalNotInstalled",function(n){L(A);let o=p();return G(o.handleEvalNotInstalled(n))})("page",function(n){L(A);let o=p();return G(o.handlePageEvent(n))})("closeSelectedEvent",function(){L(A);let n=p();return G(n.closeSelectedEvent())})("openImageDialog",function(n){L(A);let o=p();return G(o.openViewImageDialog(n))})("openAddItemDialog",function(){L(A);let n=p();return G(n.openAddItemDialog())})("enterBuilderMode",function(){L(A);let n=p();return G(n.enterBuilderMode())})("showAgentStructureGraph",function(){L(A);let n=p();return G(n.openAgentStructureGraphDialog("event"))})("switchToEvent",function(n){L(A);let o=p();return G(o.selectEvent(n))})("switchToTraceView",function(){L(A);let n=p();return G(n.switchToTraceView())})("drillDownNodePath",function(n){L(A);let o=p();return G(o.onEventTabDrillDown(n))})("selectEventById",function(n){L(A);let o=p();return G(o.selectEvent(n))}),h()}if(i&2){let A=p();H("isApplicationSelectorEnabledObs",A.isApplicationSelectorEnabledObs)("showSidePanel",A.showSidePanel)("appName",A.appName)("userId",A.userId)("sessionId",A.sessionId)("isViewOnlySession",A.isViewOnlySession())("isViewOnlyAppNameMismatch",A.isViewOnlyAppNameMismatch())("traceData",A.traceData)("eventData",A.eventData)("currentSessionState",A.currentSessionState)("artifacts",A.artifacts)("selectedEvent",A.selectedEvent)("selectedEventIndex",A.selectedEventIndex)("renderedEventGraph",A.renderedEventGraph)("rawSvgString",A.rawSvgString)("selectedEventGraphPath",A.selectedEventGraphPath)("llmRequest",A.llmRequest)("llmResponse",A.llmResponse)("disableBuilderIcon",A.disableBuilderSwitch)("hasSubWorkflows",A.hasSubWorkflows)("graphsAvailable",A.graphsAvailable())("invocationDisplayMap",A.invocationDisplayMap())("forceGraphTab",A.autoSelectLatestEvent)}}function jSA(i,e){if(i&1){let A=aA();I(0,"app-builder-tabs",111),U("exitBuilderMode",function(){L(A);let n=p();return G(n.exitBuilderMode())})("closePanel",function(){L(A);let n=p();return G(n.toggleSidePanel())}),h(),lA(1,"div",112)}if(i&2){let A=p();H("appNameInput",A.appName)}}function VSA(i,e){if(i&1){let A=aA();I(0,"div",37)(1,"div",113)(2,"button",114),U("click",function(){L(A);let n=p();return G(n.saveAgentBuilder())}),I(3,"mat-icon"),D(4,"check"),h()(),I(5,"button",115),U("click",function(){L(A);let n=p();return G(n.exitBuilderMode())}),I(6,"mat-icon"),D(7,"close"),h()(),I(8,"button",116),U("click",function(){L(A);let n=p();return G(n.toggleBuilderAssistant())}),I(9,"mat-icon"),D(10,"assistant"),h()()(),I(11,"app-canvas",117),U("toggleSidePanelRequest",function(){L(A);let n=p();return G(n.toggleSidePanel())})("builderAssistantCloseRequest",function(){L(A);let n=p();return G(n.toggleBuilderAssistant())}),h()()}if(i&2){let A=p();Q(8),_A("active",A.showBuilderAssistant),Q(3),H("showSidePanel",A.showSidePanel)("showBuilderAssistant",A.showBuilderAssistant)("appNameInput",A.appName)}}function qSA(i,e){if(i&1&&(I(0,"div",119)(1,"span"),D(2),h()()),i&2){let A=p(3);Q(2),nA(A.i18n.loadingAgentsLabel)}}function WSA(i,e){if(i&1&&(I(0,"span"),D(1),lA(2,"br"),D(3),h()),i&2){let A=p(4);Q(),nA(A.i18n.welcomeMessage),Q(2),Ee(" ",A.i18n.selectAgentMessage)}}function ZSA(i,e){if(i&1&&(D(0),lA(1,"br"),I(2,"pre",121),D(3),h()),i&2){let A=p(5);Ee(" ",A.i18n.errorMessageLabel," "),Q(3),nA(A.loadingError())}}function XSA(i,e){if(i&1&&(I(0,"pre",120),D(1),h()),i&2){let A=p(5);Q(),nA(A.i18n.noAgentsFoundWarning)}}function $SA(i,e){if(i&1&&(I(0,"div"),D(1),I(2,"pre"),D(3,"adk web"),h(),D(4," in the folder that contains the agents."),lA(5,"br"),T(6,ZSA,4,2)(7,XSA,2,1,"pre",120),h()),i&2){let A=p(4);Q(),Ee(" ",A.i18n.failedToLoadAgentsMessage," "),Q(5),O(A.loadingError()?6:7)}}function AkA(i,e){if(i&1&&(I(0,"div",119),T(1,WSA,4,2,"span"),mt(2,"async"),S1(3,$SA,8,2,"div"),h()),i&2){let A=p(3);Q(),O((Ft(2,1,A.apps$)||Lc(3,z$)).length>0?1:3)}}function ekA(i,e){if(i&1&&(T(0,qSA,3,1,"div",119),mt(1,"async"),S1(2,AkA,4,4,"div",119)),i&2){let A=p(2);O(A.isLoadingApps()?0:Ft(1,1,A.isApplicationSelectorEnabledObs)?2:-1)}}function tkA(i,e){if(i&1){let A=aA();I(0,"div",145,8),U("click",function(n){return n.stopPropagation()}),I(2,"span",146),D(3),h(),I(4,"button",147),U("click",function(n){L(A);let o=p(4);return G(o.removeInvocationIdFilter(n))}),I(5,"mat-icon"),D(6,"close"),h()()()}if(i&2){p();let A=Bi(17),t=p(3);H("matMenuTriggerFor",A)("matTooltip",t.invocationIdFilter()?"Invocation: "+(t.invocationDisplayMap().get(t.invocationIdFilter())||t.invocationIdFilter()):"Filter events by a specific invocation"),Q(2),H("title",t.invocationIdFilter()?t.invocationDisplayMap().get(t.invocationIdFilter())||t.invocationIdFilter():"Invocation"),Q(),nA(t.invocationIdFilter()?t.invocationDisplayMap().get(t.invocationIdFilter())||t.invocationIdFilter():"Invocation")}}function ikA(i,e){if(i&1){let A=aA();I(0,"div",145,9),U("click",function(n){return n.stopPropagation()}),I(2,"span",63),D(3,"Node"),h(),I(4,"button",147),U("click",function(n){L(A);let o=p(4);return G(o.removeNodePathFilter(n))}),I(5,"mat-icon"),D(6,"close"),h()()()}if(i&2){p();let A=Bi(21),t=p(3);H("matMenuTriggerFor",A)("matTooltip",t.nodePathFilter()?"Node: "+t.nodePathFilter():"Filter events generated by a specific node")}}function nkA(i,e){if(i&1){let A=aA();I(0,"div",148),U("click",function(n){return n.stopPropagation()}),I(1,"span",63),D(2,"Final"),h(),I(3,"button",147),U("click",function(n){return L(A),p(4).toggleHideIntermediateEvents(),G(n.stopPropagation())}),I(4,"mat-icon"),D(5,"close"),h()()()}}function okA(i,e){if(i&1&&(I(0,"button",149,10),U("click",function(t){return t.stopPropagation()}),I(2,"mat-icon"),D(3,"add"),h(),I(4,"span"),D(5,"Filter"),h()()),i&2){p();let A=Bi(12);H("matMenuTriggerFor",A)}}function akA(i,e){if(i&1){let A=aA();I(0,"button",150),U("click",function(n){L(A);let o=p(4);return G(o.clearAllFilters(n))}),I(1,"mat-icon"),D(2,"clear_all"),h(),I(3,"span"),D(4,"Clear"),h()()}}function rkA(i,e){if(i&1){let A=aA();I(0,"button",151),U("click",function(){L(A);let n=p(4);return G(n.addInvocationIdFilter())}),D(1,"Invocation"),h()}}function skA(i,e){if(i&1){let A=aA();I(0,"button",152),U("click",function(){L(A);let n=p(4);return G(n.addNodePathFilter())}),D(1,"Node"),h()}}function lkA(i,e){if(i&1){let A=aA();I(0,"button",153),U("click",function(){L(A);let n=p(4);return G(n.toggleHideIntermediateEvents())}),D(1,"Final"),h()}}function gkA(i,e){if(i&1){let A=aA();I(0,"button",154),U("click",function(){let n=L(A).$implicit,o=p(4);return G(o.setInvocationIdFilter(n))}),I(1,"mat-icon",155),D(2,"check"),h(),D(3),h()}if(i&2){let A=e.$implicit,t=p(4);H("matTooltip",A),Q(),ft("visibility",t.invocationIdFilter()===A?"visible":"hidden"),Q(2),Ee(" ",t.invocationDisplayMap().get(A)||A," ")}}function ckA(i,e){if(i&1){let A=aA();I(0,"button",156),U("click",function(){let n=L(A).$implicit,o=p(4);return G(o.setNodePathFilter(n))}),I(1,"mat-icon",155),D(2,"check"),h(),D(3),h()}if(i&2){let A=e.$implicit,t=p(4);Q(),ft("visibility",t.nodePathFilter()===A?"visible":"hidden"),Q(2),Ee(" ",A," ")}}function CkA(i,e){if(i&1){let A=aA();I(0,"mat-button-toggle-group",130),U("change",function(n){L(A);let o=p(3);return G(o.onViewModeChange(n.value))}),I(1,"mat-button-toggle",131),D(2,"Events"),h(),I(3,"mat-button-toggle",132),D(4,"Traces"),h()(),I(5,"div",133),U("click",function(n){L(A);let o=p(3);return G(o.openAddFilterMenu(n))}),T(6,tkA,7,4,"div",134),T(7,ikA,7,2,"div",134),T(8,nkA,6,0,"div",135),T(9,okA,6,1,"button",136),T(10,akA,5,0,"button",137),h(),I(11,"mat-menu",138,5),T(13,rkA,2,0,"button",139),T(14,skA,2,0,"button",140),T(15,lkA,2,0,"button",141),h(),I(16,"mat-menu",142,6),U("closed",function(){L(A);let n=p(3);return G(n.onInvocationMenuClosed())}),ke(18,gkA,4,4,"button",143,ni),h(),I(20,"mat-menu",142,7),U("closed",function(){L(A);let n=p(3);return G(n.onNodePathMenuClosed())}),ke(22,ckA,4,3,"button",144,ni),h()}if(i&2){let A=p(3);H("value",A.viewMode()),Q(6),O(A.invocationIdFilterActive()?6:-1),Q(),O(A.nodePathFilterActive()?7:-1),Q(),O(A.hideIntermediateEvents()?8:-1),Q(),O(!A.invocationIdFilterActive()||!A.nodePathFilterActive()||!A.hideIntermediateEvents()?9:-1),Q(),O(A.invocationIdFilterActive()||A.nodePathFilterActive()||A.hideIntermediateEvents()?10:-1),Q(3),O(A.invocationIdFilterActive()?-1:13),Q(),O(A.nodePathFilterActive()?-1:14),Q(),O(A.hideIntermediateEvents()?-1:15),Q(3),_e(A.invocationIdOptions()),Q(4),_e(A.nodePathOptions())}}function dkA(i,e){i&1&&(I(0,"span",123),D(1,"README.md"),h())}function IkA(i,e){if(i&1){let A=aA();I(0,"button",157),U("click",function(){L(A);let n=p(3);return G(n.isSideBySide.set(!n.isSideBySide()))}),I(1,"mat-icon",158),D(2),h(),I(3,"span",159),D(4,"Compare"),h()()}if(i&2){let A=p(3);ft("color",A.isSideBySide()?"var(--mat-sys-primary)":"var(--mat-sys-on-surface-variant)"),Q(2),nA(A.isSideBySide()?"check_circle":"radio_button_unchecked")}}function BkA(i,e){if(i&1){let A=aA();I(0,"button",156),U("click",function(n){L(A);let o=p(4);return o.showBranches.set(!o.showBranches()),G(n.stopPropagation())}),I(1,"mat-icon",162),D(2),h(),I(3,"span",163),D(4,"Branches"),h()()}if(i&2){let A=p(4);Q(),ft("color",A.showBranches()?"var(--mat-sys-primary)":"var(--mat-sys-on-surface-variant)"),Q(),Ee(" ",A.showBranches()?"check_box":"check_box_outline_blank"," ")}}function hkA(i,e){if(i&1){let A=aA();I(0,"button",156),U("click",function(n){return L(A),p(4).toggleSse(),G(n.stopPropagation())}),I(1,"mat-icon",162),D(2),h(),I(3,"span",163),D(4,"Streaming"),h()()}if(i&2){let A=p(4);Q(),ft("color",A.useSse()?"var(--mat-sys-primary)":"var(--mat-sys-on-surface-variant)"),Q(),Ee(" ",A.useSse()?"check_box":"check_box_outline_blank"," ")}}function EkA(i,e){if(i&1&&(I(0,"button",160)(1,"mat-icon"),D(2,"more_vert"),h()(),I(3,"mat-menu",161,11),T(5,BkA,5,3,"button",144),T(6,hkA,5,3,"button",144),h()),i&2){let A=Bi(4);p();let t=Ki(10),n=Ki(11),o=p(2);H("matMenuTriggerFor",A)("matTooltip",o.i18n.moreOptionsTooltip),Q(5),O(t?5:-1),Q(),O(n?6:-1)}}function QkA(i,e){if(i&1){let A=aA();I(0,"app-chat-panel",164),mt(1,"async"),Ni("userInputChange",function(n){L(A);let o=p(3);return wi(o.userInput,n)||(o.userInput=n),G(n)}),U("toggleHideIntermediateEvents",function(){L(A);let n=p(3);return G(n.toggleHideIntermediateEvents())})("toggleSse",function(){L(A);let n=p(3);return G(n.toggleSse())})("clickEvent",function(n){L(A);let o=p(3);return G(o.clickEvent(n))})("handleKeydown",function(n){L(A);let o=p(3);return G(o.handleKeydown(n.event,n.message))})("cancelEditMessage",function(n){L(A);let o=p(3);return G(o.cancelEditMessage(n))})("saveEditMessage",function(n){L(A);let o=p(3);return G(o.saveEditMessage(n))})("openViewImageDialog",function(n){L(A);let o=p(3);return G(o.openViewImageDialog(n))})("openBase64InNewTab",function(n){L(A);let o=p(3);return G(o.openBase64InNewTab(n.data,n.mimeType))})("fileSelect",function(n){L(A);let o=p(3);return G(o.onFileSelect(n))})("removeFile",function(n){L(A);let o=p(3);return G(o.removeFile(n))})("removeStateUpdate",function(){L(A);let n=p(3);return G(n.removeStateUpdate())})("sendMessage",function(n){L(A);let o=p(3);return G(o.handleChatInput(n))})("stopMessage",function(){L(A);let n=p(3);return G(n.handleStopMessage())})("updateState",function(){L(A);let n=p(3);return G(n.updateState())})("toggleAudioRecording",function(n){L(A);let o=p(3);return G(o.toggleAudioRecording(n))})("toggleVideoRecording",function(){L(A);let n=p(3);return G(n.toggleVideoRecording())})("longRunningResponseComplete",function(n){L(A);let o=p(3);return G(o.sendMessage(n))})("manualScroll",function(){L(A);let n=p(3);return G(n.onManualScroll())}),h()}if(i&2){let A=p(3);H("appName",A.appName)("agentReadme",A.agentReadme),Ri("userInput",A.userInput),H("hideIntermediateEvents",A.hideIntermediateEvents())("uiEvents",A.filteredUiEvents())("showBranches",A.showBranches())("traceData",A.traceData)("isTokenStreamingEnabled",Ft(1,23,A.isTokenStreamingEnabledObs)??!1)("useSse",A.useSse())("isChatMode",!0)("selectedFiles",A.selectedFiles)("updatedSessionState",A.updatedSessionState())("agentGraphData",A.agentGraphData())("selectedMessageIndex",A.selectedMessageIndex)("isAudioRecording",A.isAudioRecording)("micVolume",A.micVolume())("isVideoRecording",A.isVideoRecording)("userId",A.userId)("sessionId",A.sessionId)("sessionName",A.sessionId)("invocationDisplayMap",A.invocationDisplayMap())("viewMode",A.viewMode())("shouldShowEvent",A.shouldShowEventFn)}}function ukA(i,e){if(i&1){let A=aA();I(0,"app-chat-panel",165),mt(1,"async"),Ni("userInputChange",function(n){L(A);let o=p(3);return wi(o.userInput,n)||(o.userInput=n),G(n)})("userEditEvalCaseMessageChange",function(n){L(A);let o=p(3);return wi(o.userEditEvalCaseMessage,n)||(o.userEditEvalCaseMessage=n),G(n)}),U("clickEvent",function(n){L(A);let o=p(3);return G(o.clickEvent(n))})("handleKeydown",function(n){L(A);let o=p(3);return G(o.handleKeydown(n.event,n.message))})("cancelEditMessage",function(n){L(A);let o=p(3);return G(o.cancelEditMessage(n))})("saveEditMessage",function(n){L(A);let o=p(3);return G(o.saveEditMessage(n))})("openViewImageDialog",function(n){L(A);let o=p(3);return G(o.openViewImageDialog(n))})("openBase64InNewTab",function(n){L(A);let o=p(3);return G(o.openBase64InNewTab(n.data,n.mimeType))})("editEvalCaseMessage",function(n){L(A);let o=p(3);return G(o.editEvalCaseMessage(n))})("deleteEvalCaseMessage",function(n){L(A);let o=p(3);return G(o.deleteEvalCaseMessage(n.message,n.index))})("editFunctionArgs",function(n){L(A);let o=p(3);return G(o.editFunctionArgs(n))}),h()}if(i&2){let A=p(3);H("appName",A.appName)("agentReadme",A.agentReadme)("hideIntermediateEvents",A.hideIntermediateEvents())("uiEvents",A.filteredUiEvents())("showBranches",A.showBranches())("isChatMode",!1)("evalCase",A.evalCase)("isEvalEditMode",A.isEvalEditMode())("isEvalCaseEditing",A.isEvalCaseEditing())("isEditFunctionArgsEnabled",Ft(1,20,A.isEditFunctionArgsEnabledObs)??!1),Ri("userInput",A.userInput)("userEditEvalCaseMessage",A.userEditEvalCaseMessage),H("agentGraphData",A.agentGraphData())("selectedMessageIndex",A.selectedMessageIndex)("userId",A.userId)("sessionId",A.sessionId)("sessionName",A.sessionId)("invocationDisplayMap",A.invocationDisplayMap())("viewMode",A.viewMode())("shouldShowEvent",A.shouldShowEventFn)}}function pkA(i,e){if(i&1&&(I(0,"div",179),D(1),h()),i&2){p();let A=Ki(40);Q(),Ee(" ",A)}}function fkA(i,e){if(i&1&&(I(0,"div",171)(1,"span",172),D(2),mt(3,"formatMetricName"),h(),I(4,"div",173)(5,"span",174),D(6),mt(7,"number"),h(),I(8,"span",175),D(9),mt(10,"number"),h()(),I(11,"div",176)(12,"div",177),D(13),mt(14,"formatMetricName"),h(),I(15,"div",178),D(16),h(),I(17,"div",48)(18,"div",50)(19,"span",51),D(20,"Actual:"),h(),I(21,"span",52),D(22),mt(23,"number"),h()(),I(24,"div",50)(25,"span",51),D(26,"Threshold:"),h(),I(27,"span",52),D(28),mt(29,"number"),h()(),I(30,"div",50)(31,"span",51),D(32,"Min:"),h(),I(33,"span",52),D(34),h()(),I(35,"div",50)(36,"span",51),D(37,"Max:"),h(),I(38,"span",52),D(39),h()()(),ro(40),T(41,pkA,2,1,"div",179),h()()),i&2){let A=e.$implicit,t=p(6);ft("border",A.evalStatus==1?"1px solid #2e7d32":"1px solid var(--mat-sys-error)"),Q(2),nA(Ft(3,16,A.metricName)),Q(3),ft("color",A.evalStatus==1?"#2e7d32":"var(--mat-sys-error)"),Q(),Ee(" ",A.score!=null?G0(7,18,A.score,"1.2-2"):"?"," "),Q(3),Ee(" / ",G0(10,21,A.threshold,"1.2-2")," "),Q(4),nA(Ft(14,24,A.metricName)),Q(3),nA(A.metricName),Q(5),ft("color",A.evalStatus==1?"#2e7d32":"var(--mat-sys-error)"),Q(),nA(A.score!=null?G0(23,26,A.score,"1.2-2"):"?"),Q(6),nA(G0(29,29,A.threshold,"1.2-2")),Q(6),nA(t.getMetricMin(A.metricName)),Q(5),nA(t.getMetricMax(A.metricName)),Q();let n=so(t.getMetricDescription(A.metricName));Q(),O(n?41:-1)}}function mkA(i,e){if(i&1&&(I(0,"div",169),ke(1,fkA,42,33,"div",170,lSA),h()),i&2){p();let A=Ki(0);Q(),_e(A.overallEvalMetricResults)}}function wkA(i,e){if(i&1&&(ro(0),I(1,"div",166),T(2,mkA,3,0,"div",169),h()),i&2){let A=so(p(4).evalCaseResult());Q(2),O(A.overallEvalMetricResults!=null&&A.overallEvalMetricResults.length?2:-1)}}function ykA(i,e){if(i&1){let A=aA();I(0,"div",167)(1,"div",180)(2,"div",181),D(3,"Expected"),h(),I(4,"app-chat-panel",182),U("manualScroll",function(){L(A);let n=p(4);return G(n.onManualScroll())}),h()(),I(5,"div",180)(6,"div",181),D(7,"Actual"),h(),I(8,"app-chat-panel",183),mt(9,"async"),mt(10,"async"),U("toggleHideIntermediateEvents",function(){L(A);let n=p(4);return G(n.toggleHideIntermediateEvents())})("toggleSse",function(){L(A);let n=p(4);return G(n.toggleSse())}),Ni("userInputChange",function(n){L(A);let o=p(4);return wi(o.userInput,n)||(o.userInput=n),G(n)})("userEditEvalCaseMessageChange",function(n){L(A);let o=p(4);return wi(o.userEditEvalCaseMessage,n)||(o.userEditEvalCaseMessage=n),G(n)}),U("clickEvent",function(n){L(A);let o=p(4);return G(o.clickEvent(n))})("handleKeydown",function(n){L(A);let o=p(4);return G(o.handleKeydown(n.event,n.message))})("cancelEditMessage",function(n){L(A);let o=p(4);return G(o.cancelEditMessage(n))})("saveEditMessage",function(n){L(A);let o=p(4);return G(o.saveEditMessage(n))})("openViewImageDialog",function(n){L(A);let o=p(4);return G(o.openViewImageDialog(n))})("openBase64InNewTab",function(n){L(A);let o=p(4);return G(o.openBase64InNewTab(n.data,n.mimeType))})("editEvalCaseMessage",function(n){L(A);let o=p(4);return G(o.editEvalCaseMessage(n))})("deleteEvalCaseMessage",function(n){L(A);let o=p(4);return G(o.deleteEvalCaseMessage(n.message,n.index))})("editFunctionArgs",function(n){L(A);let o=p(4);return G(o.editFunctionArgs(n))})("fileSelect",function(n){L(A);let o=p(4);return G(o.onFileSelect(n))})("removeFile",function(n){L(A);let o=p(4);return G(o.removeFile(n))})("removeStateUpdate",function(){L(A);let n=p(4);return G(n.removeStateUpdate())})("sendMessage",function(n){L(A);let o=p(4);return G(o.handleChatInput(n))})("updateState",function(){L(A);let n=p(4);return G(n.updateState())})("toggleAudioRecording",function(n){L(A);let o=p(4);return G(o.toggleAudioRecording(n))})("toggleVideoRecording",function(){L(A);let n=p(4);return G(n.toggleVideoRecording())})("longRunningResponseComplete",function(n){L(A);let o=p(4);return G(o.sendMessage(n))})("manualScroll",function(){L(A);let n=p(4);return G(n.onManualScroll())}),h()()()}if(i&2){let A=p(4);Q(4),H("appName",A.appName)("agentReadme",A.agentReadme)("hideIntermediateEvents",A.hideIntermediateEvents())("uiEvents",A.filteredExpectedUiEvents())("showBranches",A.showBranches())("isChatMode",!1)("evalCase",A.evalCase)("isEvalEditMode",!1)("isEvalCaseEditing",!1)("isEditFunctionArgsEnabled",!1)("userInput","")("selectedFiles",Lc(56,z$))("updatedSessionState",null)("agentGraphData",A.agentGraphData())("selectedMessageIndex",-1)("isAudioRecording",!1)("micVolume",0)("isVideoRecording",!1)("userId",A.userId)("sessionId",A.sessionId)("sessionName",A.sessionId)("invocationDisplayMap",A.invocationDisplayMap())("viewMode",A.viewMode())("shouldShowEvent",A.shouldShowEventFn),Q(4),H("appName",A.appName)("agentReadme",A.agentReadme)("hideIntermediateEvents",A.hideIntermediateEvents())("uiEvents",A.filteredUiEvents())("showBranches",A.showBranches())("traceData",A.traceData)("isTokenStreamingEnabled",Ft(9,52,A.isTokenStreamingEnabledObs)??!1)("useSse",A.useSse())("isChatMode",!1)("evalCase",A.evalCase)("isEvalEditMode",A.isEvalEditMode())("isEvalCaseEditing",A.isEvalCaseEditing())("isEditFunctionArgsEnabled",Ft(10,54,A.isEditFunctionArgsEnabledObs)??!1),Ri("userInput",A.userInput)("userEditEvalCaseMessage",A.userEditEvalCaseMessage),H("selectedFiles",A.selectedFiles)("updatedSessionState",A.updatedSessionState())("agentGraphData",A.agentGraphData())("selectedMessageIndex",A.selectedMessageIndex)("isAudioRecording",A.isAudioRecording)("micVolume",A.micVolume())("isVideoRecording",A.isVideoRecording)("userId",A.userId)("sessionId",A.sessionId)("sessionName",A.sessionId)("invocationDisplayMap",A.invocationDisplayMap())("viewMode",A.viewMode())("shouldShowEvent",A.shouldShowEventFn)}}function DkA(i,e){if(i&1){let A=aA();I(0,"app-chat-panel",184),U("manualScroll",function(){L(A);let n=p(4);return G(n.onManualScroll())}),h()}if(i&2){let A=p(4);H("appName",A.appName)("agentReadme",A.agentReadme)("hideIntermediateEvents",A.hideIntermediateEvents())("uiEvents",A.filteredUiEvents())("showBranches",A.showBranches())("traceData",A.traceData)("isChatMode",!1)("evalCase",A.evalCase)("agentGraphData",A.agentGraphData())("selectedMessageIndex",A.selectedMessageIndex)("userId",A.userId)("sessionId",A.sessionId)("sessionName",A.sessionId)("invocationDisplayMap",A.invocationDisplayMap())("viewMode",A.viewMode())("shouldShowEvent",A.shouldShowEventFn)}}function vkA(i,e){if(i&1&&(T(0,wkA,3,2,"div",166),T(1,ykA,11,57,"div",167)(2,DkA,1,16,"app-chat-panel",168)),i&2){let A=p(3);O(A.evalCaseResult()?0:-1),Q(),O(A.isSideBySide()?1:2)}}function bkA(i,e){i&1&&(I(0,"div",129)(1,"mat-icon",185),D(2,"insert_drive_file"),h(),I(3,"h3",186),D(4,"File View"),h(),I(5,"p",187),D(6,"File content lost on refresh. Please re-upload the file to view or use it."),h()())}function MkA(i,e){if(i&1){let A=aA();I(0,"div",122),T(1,CkA,24,9)(2,dkA,2,0,"span",123),lA(3,"div",124),I(4,"button",125),mt(5,"async"),U("click",function(){L(A);let n=p(2);return G(n.refreshLatestSession())}),I(6,"mat-icon",18),mt(7,"async"),D(8,"refresh"),h()(),T(9,IkA,5,3,"button",126),ro(10)(11),mt(12,"async"),T(13,EkA,7,4),h(),T(14,QkA,2,25,"app-chat-panel",127)(15,ukA,2,22,"app-chat-panel",128)(16,vkA,3,2)(17,bkA,7,0,"div",129)}if(i&2){let A,t=p(2);Q(),O(t.uiEvents().length===0&&t.agentReadme?2:1),Q(3),H("matTooltip",t.i18n.retrieveLatestSessionTooltip)("disabled",Ft(5,8,t.uiStateService.isSessionLoading())===!0),Q(2),_A("spinning",Ft(7,10,t.uiStateService.isSessionLoading())),Q(3),O(t.chatType()==="eval-result"?9:-1),Q();let n=so(t.viewMode()!=="traces");Q();let o=so(Ft(12,13,t.isTokenStreamingEnabledObs)&&t.canEditSession());Q(2),O(n||o?13:-1),Q(),O((A=t.chatType())==="session"?14:A==="eval-case"?15:A==="eval-result"?16:A==="file"?17:-1)}}function SkA(i,e){if(i&1&&(I(0,"div",38),Ze(1),I(2,"mat-card",118),T(3,ekA,3,3),T(4,MkA,18,16),h()()),i&2){let A=p();Q(2),_A("no-side-panel",!A.showSidePanel),Q(),O(A.selectedAppControl.value?-1:3),Q(),O(A.appName!=""?4:-1)}}function kkA(i,e){if(i&1){let A=aA();I(0,"app-agent-structure-graph-dialog",188),U("close",function(){L(A);let n=p();return G(n.showAgentStructureOverlay=!1)}),h()}if(i&2){let A=p();H("appName",A.appName)("preloadedAppData",A.agentGraphData())("preloadedLightGraphSvg",A.agentStructureOverlayMode==="event"?A.eventGraphSvgLight:A.sessionGraphSvgLight)("preloadedDarkGraphSvg",A.agentStructureOverlayMode==="event"?A.eventGraphSvgDark:A.sessionGraphSvgDark)("startPath",A.agentStructureOverlayMode==="event"?A.selectedEventGraphPath:"")}}var _kA="root_agent",iD="q",xkA="hideSidePanel",iN="",nN="",H$="application/json+a2ui";function oN(i){for(i=i.replace(/-/g,"+").replace(/_/g,"/");i.length%4!==0;)i+="=";return i}var aN=class i extends rd{nextPageLabel="Next Event";previousPageLabel="Previous Event";firstPageLabel="First Event";lastPageLabel="Last Event";getRangeLabel=(e,A,t)=>t===0?`Event 0 of ${t}`:(t=Math.max(t,0),`Event ${e*A+1} of ${t}`);static \u0275fac=(()=>{let e;return function(t){return(e||(e=Li(i)))(t||i)}})();static \u0275prov=jA({token:i,factory:i.\u0275fac})},RkA="Restarting bidirectional streaming is not currently supported. Please refresh the page or start a new session.",nD=class i{i18n=w(h$);sidePanelI18n=w(_E);_snackbarService=w(Xc);activatedRoute=w($s);agentService=w(el);artifactService=w(EB);changeDetectorRef=w(Mt);dialog=w(Xa);document=w(ci);downloadService=w(QB);evalService=w(A0);eventService=w(fm);featureFlagService=w(Nr);graphService=w(uB);localFileService=w(mm);location=w(vm);renderer=w(on);router=w(Is);safeValuesService=w(Qs);testsService=w(c2);sessionService=w(tl);streamChatService=w(ym);webSocketService=w(mB);audioRecordingService=w(pB);audioPlayingService=w(fB);stringToColorService=w(g2);traceService=w(ng);uiStateService=w(ag);agentBuilderService=w($c);themeService=w(og,{optional:!0});logoComponent=w(wB,{optional:!0});activeSseSubscription;chatPanel=Yo(h1);canvasComponent=Yo.required(QE);sideDrawer=Yo.required("sideDrawer");sidePanel=Yo.required(xE);drawerSessionTab=Yo("drawerSessionTab");evalTab=Yo(Sc);appSearchInput=Yo("appSearchInput");canChat=ye(()=>this.chatType()==="session");isEvalCaseEditing=mA(!1);hasEvalCaseChanged=mA(!1);isEvalEditMode=mA(!1);isBuilderMode=mA(!1);chatType=mA("session");currentEvalCaseId=null;currentEvalTimestamp=null;videoElement;currentMessage="";uiEvents=mA([]);invocationDisplayMap=ye(()=>{let e=new Map,A=1,t="";for(let n of this.uiEvents()){if(n.role==="user")if(n.text)t=n.text;else if(n.event?.content?.parts?.length){let o=n.event.content.parts.find(a=>a.text);o&&o.text&&(t=o.text)}else t="User Message";if(n.event?.invocationId){let o=n.event.invocationId;if(!e.has(o)){let a=t||"User Message";a.length>50&&(a=a.substring(0,47)+"..."),e.set(o,`#${A} (${a})`),A++}}}return e});artifacts=[];userInput="";userEditEvalCaseMessage="";userId="user";appName="";sessionId="";sessionIdOfLoadedMessages="";evalCase=null;evalCaseResult=mA(null);metricsInfo=this.evalService.metricsInfo;updatedEvalCase=null;adkVersion=mA("");versionInfo=mA(null);evalSetId="";isAudioRecording=!1;micVolume=this.audioRecordingService.volumeLevel;isVideoRecording=!1;longRunningEvents=[];functionCallEventId="";redirectUri=Rr.getBaseUrlWithoutPath();isMobile=mA(window.innerWidth<=768);showSidePanel=window.localStorage.getItem("adk-side-panel-visible")!=="false";showBuilderAssistant=!0;showAppSelectorDrawer=!1;showSessionSelectorDrawer=!1;useSse=mA(window.localStorage.getItem("adk-use-sse")==="true");currentSessionState={};root_agent=_kA;updatedSessionState=mA(null);canEditSession=mA(!0);isViewOnlySession=mA(!1);isViewOnlyAppNameMismatch=mA(!1);isLoadedAppUnavailable=mA(!1);unavailableAppName=mA("");readonlySessionType=mA("");readonlySessionName=mA("");isSideBySide=mA(!1);showBranches=mA(!1);expectedUiEvents=mA([]);viewMode=mA(window.localStorage.getItem("chat-view-mode")||"events");invocationIdFilterActive=mA(!1);nodePathFilterActive=mA(!1);invocationIdFilter=mA("");nodePathFilter=mA("");invocationIdOptions=ye(()=>{let e=new Set;for(let A of this.uiEvents())A.event?.invocationId&&e.add(A.event.invocationId);return Array.from(e)});nodePathOptions=ye(()=>{let e=new Set;for(let A of this.uiEvents()){let t=A.bareNodePath;t&&e.add(t)}return Array.from(e)});invChipMenuTrigger=Yo("invChipMenuTrigger");nodeChipMenuTrigger=Yo("nodeChipMenuTrigger");addMenuTrigger=Yo("addMenuTrigger");openAddFilterMenu(e){e.stopPropagation(),this.addMenuTrigger()?.openMenu()}addInvocationIdFilter(){this.invocationIdFilterActive.set(!0),setTimeout(()=>{this.invChipMenuTrigger()?.openMenu()})}addNodePathFilter(){this.nodePathFilterActive.set(!0),setTimeout(()=>{this.nodeChipMenuTrigger()?.openMenu()})}removeInvocationIdFilter(e){e.stopPropagation(),this.invocationIdFilterActive.set(!1),this.invocationIdFilter.set("")}removeNodePathFilter(e){e.stopPropagation(),this.nodePathFilterActive.set(!1),this.nodePathFilter.set("")}setInvocationIdFilter(e){this.invocationIdFilter.set(e)}setNodePathFilter(e){this.nodePathFilter.set(e)}onInvocationMenuClosed(){this.invocationIdFilter()||this.invocationIdFilterActive.set(!1)}onNodePathMenuClosed(){this.nodePathFilter()||this.nodePathFilterActive.set(!1)}clearAllFilters(e){e.stopPropagation(),this.invocationIdFilterActive()&&(this.invocationIdFilterActive.set(!1),this.invocationIdFilter.set("")),this.nodePathFilterActive()&&(this.nodePathFilterActive.set(!1),this.nodePathFilter.set("")),this.hideIntermediateEvents()&&this.toggleHideIntermediateEvents()}shouldShowEvent(e){let A=this.invocationIdFilter();if(A&&!(e.event?.invocationId||"").includes(A))return!1;let t=this.nodePathFilter();if(t&&!(e.bareNodePath||"").includes(t))return!1;if(!this.hideIntermediateEvents()||e.role==="user")return!0;if(e.event?.content!==void 0){let n=e.event.content.parts||[];if(n.length>0&&n.every(a=>a.functionCall||a.functionResponse)){if(n.some(r=>{let s=r.functionCall?.id||r.functionResponse?.id;return s&&e.event?.longRunningToolIds?.includes(s)}))return!0}else return!0}if(e.event?.output!==void 0){let n=e.event?.nodeInfo,o=!1,a=n?.outputFor;if(Array.isArray(a)?o=a.some(r=>!r.includes("/")):typeof a=="string"?o=!a.includes("/"):n?.path&&(o=!n.path.includes("/")),o)return!0}return!1}shouldShowEventFn=this.shouldShowEvent.bind(this);getMetricTooltip(e,A,t){let n=this.metricsInfo().find(g=>g.metricName===e),o=n?.description||"",a=n?.metricValueInfo?.interval?.minValue??"?",r=n?.metricValueInfo?.interval?.maxValue??"?",s=A!=null?parseFloat(A).toFixed(2):"?",l=t!=null?parseFloat(t).toFixed(2):"?";return`${o?o+" | ":""}Actual: ${s} | Threshold: ${l} | Min: ${a} | Max: ${r}`}getMetricDescription(e){return this.metricsInfo().find(t=>t.metricName===e)?.description||""}getMetricMin(e){let t=this.metricsInfo().find(n=>n.metricName===e)?.metricValueInfo?.interval?.minValue;return t!=null?t.toFixed(2):"?"}getMetricMax(e){let t=this.metricsInfo().find(n=>n.metricName===e)?.metricValueInfo?.interval?.maxValue;return t!=null?t.toFixed(2):"?"}getVersionTooltip(){let e=this.versionInfo();return e?`Version: ${e.version} | Language: ${e.language} | Language Version: ${e.language_version}`:""}getMergedTooltip(){let e=this.sidePanelI18n.disclosureTooltip||"",A=this.getVersionTooltip();return A?`${e} | ${A}`:e}filteredUiEvents=ye(()=>this.uiEvents().filter(e=>this.shouldShowEvent(e)));filteredExpectedUiEvents=ye(()=>this.expectedUiEvents().filter(e=>this.shouldShowEvent(e)));onViewModeChange(e){this.viewMode.set(e);try{window.localStorage.setItem("chat-view-mode",e)}catch(A){}}originalSessionId="";hideIntermediateEvents=mA(window.localStorage.getItem("adk-hide-intermediate-events")==="true");toggleHideIntermediateEvents(){let e=!this.hideIntermediateEvents();this.hideIntermediateEvents.set(e),window.localStorage.setItem("adk-hide-intermediate-events",String(e))}sessionHasUsedBidi=new Set;eventData=new Map;traceData=[];renderedEventGraph;rawSvgString=null;agentGraphData=mA(null);sessionGraphSvgLight={};sessionGraphSvgDark={};sessionGraphDot={};dynamicGraphDot={};agentReadme="";graphsAvailable=mA(!0);get hasSubWorkflows(){return Object.keys(this.sessionGraphSvgLight).length>1}selectedEvent=void 0;selectedEventIndex=void 0;selectedMessageIndex=void 0;llmRequest=void 0;llmResponse=void 0;getMediaTypeFromMimetype=I6;selectedFiles=[];MediaType=iC;selectedAppControl=new Ps("",{nonNullable:!0});appDrawerSearchControl=new Ps("",{nonNullable:!0});openBase64InNewTab(e,A){this.safeValuesService.openBase64InNewTab(e,A)}isLoadingApps=mA(!1);loadingError=mA("");apps$=oe([]).pipe(mi(()=>{this.isLoadingApps.set(!0),this.selectedAppControl.disable()}),Mi(()=>this.agentService.listApps().pipe(aa(e=>(this.loadingError.set(e.message),oe(void 0))))),Ro(1),mi(e=>{this.isLoadingApps.set(!1),this.selectedAppControl.enable(),e?.length==1&&this.router.navigate([],{relativeTo:this.activatedRoute,queryParams:{app:e[0]},queryParamsHandling:"merge"})}),Js());filteredDrawerApps$=this.apps$.pipe(Mi(e=>Dr([oe(e),this.appDrawerSearchControl.valueChanges.pipe(Yn(""))])),Se(([e,A])=>{if(!e||!A||A.trim()==="")return e;let t=A.toLowerCase().trim();return e.filter(n=>n.toLowerCase().includes(t))}));importSessionEnabledObs=this.featureFlagService.isImportSessionEnabled();isEditFunctionArgsEnabledObs=this.featureFlagService.isEditFunctionArgsEnabled();isSessionUrlEnabledObs=this.featureFlagService.isSessionUrlEnabled();isApplicationSelectorEnabledObs=this.featureFlagService.isApplicationSelectorEnabled();isTokenStreamingEnabledObs=this.featureFlagService.isTokenStreamingEnabled();isExportSessionEnabledObs=this.featureFlagService.isExportSessionEnabled();isNewSessionButtonEnabledObs=this.featureFlagService.isNewSessionButtonEnabled();isEventFilteringEnabled=sr(this.featureFlagService.isEventFilteringEnabled());isApplicationSelectorEnabled=sr(this.featureFlagService.isApplicationSelectorEnabled());isDeleteSessionEnabledObs=this.featureFlagService.isDeleteSessionEnabled();isUserIdOnToolbarEnabledObs=this.featureFlagService.isUserIdOnToolbarEnabled();isDeveloperUiDisclaimerEnabledObs=this.featureFlagService.isDeveloperUiDisclaimerEnabled();disableBuilderSwitch=!1;autoSelectLatestEvent=!1;constructor(){Fn(()=>{this.themeService?.currentTheme()&&this.updateRenderedGraph()})}ngOnInit(){if(this.checkScreenSize(),this.isMobile()?this.showSidePanel=!1:this.showSidePanel=window.localStorage.getItem("adk-side-panel-visible")!=="false",this.syncSelectedAppFromUrl(),this.updateSelectedAppUrl(),this.hideSidePanelIfNeeded(),this.agentService.getVersion().subscribe(t=>{this.adkVersion.set(t.version||""),this.versionInfo.set(t)}),Dr([this.agentService.getApp(),this.activatedRoute.queryParams]).pipe(Bt(([t,n])=>!!t&&!!n[iD]),oo(),Se(([,t])=>t[iD])).subscribe(t=>{setTimeout(()=>{this.userInput=t})}),this.streamChatService.onStreamClose().subscribe(t=>{let n=`Please check server log for full details: +`),this.isRebuilding.set(!1),A.complete()}})}clearConsole(){this.consoleOutput.set("")}static \u0275fac=function(A){return new(A||i)};static \u0275cmp=vA({type:i,selectors:[["app-tests-tab"]],inputs:{appName:[1,"appName"],sessionId:[1,"sessionId"],userId:[1,"userId"],isViewOnlySession:[1,"isViewOnlySession"]},outputs:{testSelected:"testSelected"},features:[ii],decls:20,vars:4,consts:[[1,"tests-container"],[1,"toolbar"],["mat-button","","color","primary",3,"click","disabled"],["mat-button","","color","accent",3,"click","disabled"],[1,"spacer"],["mat-icon-button","","matTooltip","Refresh",3,"click"],[1,"empty-state"],["mat-table","",1,"tests-table",3,"dataSource"],["matColumnDef","name"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","actions"],["mat-row","",3,"selected-row","click",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],["mat-icon-button","","color","primary","matTooltip","Run Test",3,"click","disabled"],["mat-icon-button","","color","accent","matTooltip","Rebuild Test",3,"click","disabled"],["mat-icon-button","","color","primary","matTooltip","Rename Test",3,"click","disabled"],["mat-icon-button","","color","warn","matTooltip","Delete Test",3,"click","disabled"],["mat-row","",3,"click"]],template:function(A,t){A&1&&(I(0,"div",0)(1,"div",1)(2,"button",2),U("click",function(){return t.promoteCurrentSessionToTest()}),I(3,"mat-icon"),D(4,"add"),h(),D(5," From Current Session "),h(),I(6,"button",2),U("click",function(){return t.runAllTests()}),I(7,"mat-icon"),D(8,"playlist_play"),h(),D(9," Run All "),h(),I(10,"button",3),U("click",function(){return t.rebuildAllTests()}),I(11,"mat-icon"),D(12,"sync"),h(),D(13," Rebuild All "),h(),lA(14,"span",4),I(15,"button",5),U("click",function(){return t.loadTests()}),I(16,"mat-icon"),D(17,"refresh"),h()()(),T(18,obA,5,0,"div",6)(19,cbA,8,2,"table",7),h()),A&2&&(Q(2),H("disabled",!t.sessionId()||t.isViewOnlySession()),Q(4),H("disabled",t.isRunning()||t.isRebuilding()||t.dataSource.data.length===0),Q(4),H("disabled",t.isRunning()||t.isRebuilding()||t.dataSource.data.length===0),Q(8),O(t.dataSource.data.length===0?18:19))},dependencies:[li,qi,ki,yi,Un,zt,$X,t$,e$,i$,A$,n$,o$,a$,Ha,rn,l2,pE,Ls],styles:[".tests-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;box-sizing:border-box}.tests-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%]{display:flex;justify-content:flex-start;align-items:center;height:48px;flex-shrink:0;padding:0 10px;background-color:var(--mat-sys-surface-container);border-bottom:1px solid var(--mat-sys-outline-variant);gap:8px}.tests-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] .spacer[_ngcontent-%COMP%]{flex:1 1 auto}.tests-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{height:32px!important;line-height:normal!important;border-radius:16px!important;font-size:13px!important;font-weight:500!important;display:inline-flex!important;align-items:center;justify-content:center}.tests-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] button.mat-mdc-button[_ngcontent-%COMP%]{padding:0 12px!important}.tests-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] button.mat-mdc-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{margin-right:4px!important}.tests-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] button.mat-mdc-icon-button[_ngcontent-%COMP%]{width:32px!important;min-width:32px!important;padding:0!important;border-radius:50%!important}.tests-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] button.mat-mdc-icon-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{margin-right:0!important}.tests-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] button.mat-mdc-icon-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple{width:32px!important;height:32px!important;border-radius:50%!important}.tests-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px!important;width:20px!important;height:20px!important;line-height:20px!important;vertical-align:middle}.tests-container[_ngcontent-%COMP%] .toolbar[_ngcontent-%COMP%] button[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{vertical-align:middle}.tests-container[_ngcontent-%COMP%] .empty-state[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:32px;color:var(--mat-sys-on-surface-variant);font-style:italic;gap:8px}.tests-container[_ngcontent-%COMP%] .empty-state[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:48px;width:48px;height:48px}.tests-container[_ngcontent-%COMP%] .tests-table[_ngcontent-%COMP%]{width:100%;background:transparent;border-top:1px solid var(--mat-sys-outline-variant, #e0e0e0)}.tests-container[_ngcontent-%COMP%] .tests-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{font-weight:600}.tests-container[_ngcontent-%COMP%] .tests-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{vertical-align:middle;padding:6px 16px;border-bottom:1px solid var(--mat-sys-outline-variant, #e0e0e0)}.tests-container[_ngcontent-%COMP%] .tests-table[_ngcontent-%COMP%] tr.mat-header-row[_ngcontent-%COMP%]{display:none}.tests-container[_ngcontent-%COMP%] .tests-table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{cursor:pointer;background:transparent}.tests-container[_ngcontent-%COMP%] .tests-table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-surface-container-low, #f5f5f5)}.tests-container[_ngcontent-%COMP%] .tests-table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover td.mat-column-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{opacity:1}.tests-container[_ngcontent-%COMP%] .tests-table[_ngcontent-%COMP%] tr.selected-row[_ngcontent-%COMP%]{background-color:var(--mat-sys-surface-container-high, #e0e0e0)}.tests-container[_ngcontent-%COMP%] .tests-table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td.mat-column-actions[_ngcontent-%COMP%]{text-align:right}.tests-container[_ngcontent-%COMP%] .tests-table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td.mat-column-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{opacity:0;transition:opacity .2s ease-in-out}.tests-container[_ngcontent-%COMP%] .console-section[_ngcontent-%COMP%]{margin-top:16px;display:flex;flex-direction:column;gap:8px;flex:1;min-height:200px}.tests-container[_ngcontent-%COMP%] .console-section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0;font-size:1.1rem;font-weight:600}.tests-container[_ngcontent-%COMP%] .console-section[_ngcontent-%COMP%] .console-actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;font-size:.9rem;color:var(--mat-sys-on-surface-variant)}.tests-container[_ngcontent-%COMP%] .console-section[_ngcontent-%COMP%] .console-actions[_ngcontent-%COMP%] .running-status[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_pulse 1.5s infinite}.tests-container[_ngcontent-%COMP%] .console-section[_ngcontent-%COMP%] .console-box[_ngcontent-%COMP%]{background-color:#1e1e1e;color:#d4d4d4;padding:12px;border-radius:4px;font-family:Courier New,Courier,monospace;font-size:.85rem;overflow:auto;flex:1;margin:0;white-space:pre-wrap;word-break:break-all;border:1px solid #333}.tests-container[_ngcontent-%COMP%] .console-section[_ngcontent-%COMP%] .console-box[_ngcontent-%COMP%]::-webkit-scrollbar{width:8px;height:8px}.tests-container[_ngcontent-%COMP%] .console-section[_ngcontent-%COMP%] .console-box[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#555;border-radius:4px}.tests-container[_ngcontent-%COMP%] .console-section[_ngcontent-%COMP%] .console-box[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#777}.tests-container[_ngcontent-%COMP%] .console-section[_ngcontent-%COMP%] .console-box[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#1e1e1e}@keyframes _ngcontent-%COMP%_pulse{0%{opacity:.6}50%{opacity:1}to{opacity:.6}}"]})};var CbA={stateIsEmpty:"State is empty"},I$=new MA("State Tab Messages",{factory:()=>CbA});function dbA(i,e){if(i&1&&(I(0,"div",1),D(1),h()),i&2){let A=p();Q(),nA(A.i18n.stateIsEmpty)}}function IbA(i,e){if(i&1&&(I(0,"div"),lA(1,"app-custom-json-viewer",2),h()),i&2){let A=p();Q(),H("json",A.sessionState)}}var _y=class i{sessionState;i18n=w(I$);get isEmptyState(){return!this.sessionState||Object.keys(this.sessionState).length===0}static \u0275fac=function(A){return new(A||i)};static \u0275cmp=vA({type:i,selectors:[["app-state-tab"]],inputs:{sessionState:"sessionState"},decls:3,vars:1,consts:[[1,"state-wrapper"],[1,"empty-state"],[3,"json"]],template:function(A,t){A&1&&(I(0,"div",0),T(1,dbA,2,1,"div",1)(2,IbA,2,1,"div"),h()),A&2&&(Q(),O(t.isEmptyState?1:2))},dependencies:[fl],styles:[".state-wrapper[_ngcontent-%COMP%]{padding-left:25px;padding-right:25px;margin-top:16px}.state-wrapper[_ngcontent-%COMP%] .empty-state[_ngcontent-%COMP%]{text-align:center;font-style:italic}"]})};var BbA=(i,e)=>e.span_id;function hbA(i,e){if(i&1){let A=aA();I(0,"span",20)(1,"a",24),U("click",function(){let n;L(A);let o=p(3);return G(o.selectSpanById((n=o.selectedSpan())==null?null:n.parent_span_id))}),D(2),h(),I(3,"button",21),U("click",function(){let n;L(A);let o=p(3);return G(o.copyToClipboard((n=o.selectedSpan())==null?null:n.parent_span_id))}),I(4,"mat-icon"),D(5),h()()()}if(i&2){let A,t,n,o=p(3);Q(),H("matTooltip",((A=o.selectedSpan())==null?null:A.parent_span_id)||""),Q(),nA((t=o.selectedSpan())==null?null:t.parent_span_id),Q(3),nA(o.copiedId===((n=o.selectedSpan())==null?null:n.parent_span_id)?"check":"content_copy")}}function EbA(i,e){i&1&&D(0," None ")}function QbA(i,e){if(i&1){let A=aA();I(0,"tr")(1,"td"),D(2),h(),I(3,"td")(4,"span",20)(5,"a",24),U("click",function(){let n=L(A).$implicit,o=p(4);return G(o.selectSpanById(n.span_id))}),D(6),h(),I(7,"button",21),U("click",function(){let n=L(A).$implicit,o=p(4);return G(o.copyToClipboard(n.span_id))}),I(8,"mat-icon"),D(9),h()()()()()}if(i&2){let A=e.$implicit,t=p(4);Q(2),nA(A.name),Q(3),H("matTooltip",A.span_id),Q(),nA(A.span_id),Q(3),nA(t.copiedId===A.span_id?"check":"content_copy")}}function ubA(i,e){if(i&1&&(I(0,"table",22),ke(1,QbA,10,4,"tr",null,BbA),h()),i&2){let A=p(3);Q(),_e(A.selectedSpanChildren)}}function pbA(i,e){if(i&1){let A=aA();I(0,"table",23)(1,"tr")(2,"td"),D(3,"Event ID"),h(),I(4,"td")(5,"span",20)(6,"a",24),U("click",function(){L(A),p();let n=Ki(59),o=p(2);return G(o.switchToEvent.emit(n))}),D(7),h(),I(8,"button",21),U("click",function(){L(A),p();let n=Ki(59),o=p(2);return G(o.copyToClipboard(n))}),I(9,"mat-icon"),D(10),h()()()()()()}if(i&2){p();let A=Ki(59),t=p(2);Q(6),H("matTooltip",A||""),Q(),nA(A),Q(3),nA(t.copiedId===A?"check":"content_copy")}}function fbA(i,e){if(i&1){let A=aA();I(0,"div",13)(1,"table",15)(2,"tr")(3,"td"),D(4,"Name"),h(),I(5,"td")(6,"span",16)(7,"span",17),D(8),h(),I(9,"button",18),U("click",function(){let n;L(A);let o=p(2);return G(o.copyToClipboard((n=o.selectedSpan())==null?null:n.name))}),I(10,"mat-icon"),D(11),h()()()()(),I(12,"tr")(13,"td"),D(14,"Span ID"),h(),I(15,"td",19)(16,"span",20)(17,"span",17),D(18),h(),I(19,"button",21),U("click",function(){let n;L(A);let o=p(2);return G(o.copyToClipboard((n=o.selectedSpan())==null?null:n.span_id))}),I(20,"mat-icon"),D(21),h()()()()(),I(22,"tr")(23,"td"),D(24,"Parent ID"),h(),I(25,"td"),T(26,hbA,6,3,"span",20)(27,EbA,1,0),h()(),I(28,"tr")(29,"td"),D(30,"Trace ID"),h(),I(31,"td",19)(32,"span",20)(33,"span",17),D(34),h(),I(35,"button",21),U("click",function(){let n;L(A);let o=p(2);return G(o.copyToClipboard((n=o.selectedSpan())==null?null:n.trace_id))}),I(36,"mat-icon"),D(37),h()()()()(),I(38,"tr")(39,"td"),D(40,"Start Time"),h(),I(41,"td")(42,"span",16)(43,"span",17),D(44),h(),I(45,"button",18),U("click",function(){let n;L(A);let o=p(2);return G(o.copyToClipboard(o.formatTime((n=o.selectedSpan())==null?null:n.start_time),"startTime"))}),I(46,"mat-icon"),D(47),h()()()()(),I(48,"tr")(49,"td"),D(50,"End Time"),h(),I(51,"td")(52,"span",16)(53,"span",17),D(54),h(),I(55,"button",18),U("click",function(){let n;L(A);let o=p(2);return G(o.copyToClipboard(o.formatTime((n=o.selectedSpan())==null?null:n.end_time),"endTime"))}),I(56,"mat-icon"),D(57),h()()()()()(),T(58,ubA,3,0,"table",22),ro(59),T(60,pbA,11,3,"table",23),h()}if(i&2){let A,t,n,o,a,r,s,l,g,C,d,B,u,E,f=p(2);Q(7),H("matTooltip",((A=f.selectedSpan())==null?null:A.name)||""),Q(),nA((t=f.selectedSpan())==null?null:t.name),Q(3),nA(f.copiedId===((n=f.selectedSpan())==null?null:n.name)?"check":"content_copy"),Q(6),H("matTooltip",((o=f.selectedSpan())==null?null:o.span_id)||""),Q(),nA((a=f.selectedSpan())==null?null:a.span_id),Q(3),nA(f.copiedId===((r=f.selectedSpan())==null?null:r.span_id)?"check":"content_copy"),Q(5),O((s=f.selectedSpan())!=null&&s.parent_span_id?26:27),Q(7),H("matTooltip",((l=f.selectedSpan())==null?null:l.trace_id)||""),Q(),nA((g=f.selectedSpan())==null?null:g.trace_id),Q(3),nA(f.copiedId===((C=f.selectedSpan())==null?null:C.trace_id)?"check":"content_copy"),Q(6),H("matTooltip",f.formatTime((d=f.selectedSpan())==null?null:d.start_time)),Q(),nA(f.formatTime((B=f.selectedSpan())==null?null:B.start_time)),Q(3),nA(f.copiedId==="startTime"?"check":"content_copy"),Q(6),H("matTooltip",f.formatTime((u=f.selectedSpan())==null?null:u.end_time)),Q(),nA(f.formatTime((E=f.selectedSpan())==null?null:E.end_time)),Q(3),nA(f.copiedId==="endTime"?"check":"content_copy"),Q(),O(f.selectedSpanChildren.length>0?58:-1),Q();let m=so(f.getSelectedSpanEventId());Q(),O(m?60:-1)}}function mbA(i,e){if(i&1){let A=aA();I(0,"tr")(1,"td"),D(2),h(),I(3,"td")(4,"span",16)(5,"span"),D(6),h(),I(7,"button",18),U("click",function(){let n=L(A).$implicit;p(2);let o=Ki(1),a=p(2);return G(a.copyToClipboard(o[n]==null?null:o[n].toString()))}),I(8,"mat-icon"),D(9),h()()()()()}if(i&2){let A=e.$implicit;p(2);let t=Ki(1),n=p(2);Q(2),nA(A),Q(4),nA(t[A]),Q(3),nA(n.copiedId===(t[A]==null?null:t[A].toString())?"check":"content_copy")}}function wbA(i,e){if(i&1&&(I(0,"table",15),ke(1,mbA,10,3,"tr",null,ni),h()),i&2){p();let A=Ki(1),t=p(2);Q(),_e(t.Object.keys(A))}}function ybA(i,e){i&1&&(I(0,"div",1),D(1,"No attributes available"),h())}function DbA(i,e){if(i&1&&(I(0,"div",13),ro(1),T(2,wbA,3,0,"table",15)(3,ybA,2,0,"div",1),h()),i&2){let A=p(2);Q();let t=so(A.getSelectedSpanAttributesView());Q(),O(t&&A.Object.keys(t).length>0?2:3)}}function vbA(i,e){if(i&1){let A=aA();ro(0),I(1,"div",14),lA(2,"app-custom-json-viewer",25),I(3,"button",26),U("click",function(){L(A);let n=Ki(0),o=p(2);return G(o.copyJsonToClipboard(n,"raw"))}),I(4,"mat-icon"),D(5),h()()()}if(i&2){let A=p(2),t=so(A.getSelectedSpanRawView());Q(2),H("json",t),Q(3),nA(A.copiedId==="raw"?"check":"content_copy")}}function bbA(i,e){if(i&1){let A=aA();I(0,"div",0)(1,"div",2)(2,"mat-paginator",3),U("page",function(n){L(A);let o=p();return G(o.onPage(n))}),h(),I(3,"div",4),D(4),h(),lA(5,"div",5),I(6,"button",6),U("click",function(){L(A);let n=p();return G(n.traceService.selectedRow(void 0))}),I(7,"mat-icon"),D(8,"remove_selection"),h()()(),I(9,"div",7)(10,"div",8)(11,"button",9),U("click",function(){L(A);let n=p();return G(n.selectedDetailTab.set("info"))}),I(12,"mat-icon"),D(13,"info"),h()(),I(14,"button",10),U("click",function(){L(A);let n=p();return G(n.selectedDetailTab.set("attributes"))}),I(15,"mat-icon"),D(16,"list_alt"),h()(),I(17,"button",11),U("click",function(){L(A);let n=p();return G(n.selectedDetailTab.set("raw"))}),I(18,"mat-icon"),D(19,"data_object"),h()()(),I(20,"div",12),T(21,fbA,61,19,"div",13),T(22,DbA,4,2,"div",13),T(23,vbA,6,3,"div",14),h()()()}if(i&2){let A,t=p();Q(2),H("length",t.orderedTraceData.length)("pageSize",1)("pageIndex",t.selectedSpanIndex),Q(2),Ee(" ",(A=t.selectedSpan())==null?null:A.name," "),Q(7),_A("active",t.selectedDetailTab()==="info"),Q(3),_A("active",t.selectedDetailTab()==="attributes"),Q(3),_A("active",t.selectedDetailTab()==="raw"),Q(4),O(t.selectedDetailTab()==="info"?21:-1),Q(),O(t.selectedDetailTab()==="attributes"?22:-1),Q(),O(t.selectedDetailTab()==="raw"?23:-1)}}function MbA(i,e){i&1&&(I(0,"div",1),D(1,"Select a trace span to view its details"),h())}var RR=class i extends rd{nextPageLabel="Next Span";previousPageLabel="Previous Span";firstPageLabel="First Span";lastPageLabel="Last Span";getRangeLabel=(e,A,t)=>t===0?"Span 0 of 0":(t=Math.max(t,0),`Span ${e*A+1} of ${t}`);static \u0275fac=(()=>{let e;return function(t){return(e||(e=Li(i)))(t||i)}})();static \u0275prov=jA({token:i,factory:i.\u0275fac})},xy=class i{_traceData=[];orderedTraceData=[];set traceData(e){this._traceData=e||[],this.orderedTraceData=this.computeOrdered(this._traceData)}get traceData(){return this._traceData}computeOrdered(e){let A=e.map(a=>P({},a)),t=new Map,n=[];A.forEach(a=>t.set(String(a.span_id),a)),A.forEach(a=>{if(a.parent_span_id&&t.has(String(a.parent_span_id))){let r=t.get(String(a.parent_span_id));r.children=r.children||[],r.children.push(a)}else n.push(a)});let o=a=>a.flatMap(r=>[r,...r.children?o(r.children):[]]);return o(n)}traceService=w(ng);selectedSpan=sr(this.traceService.selectedTraceRow$);static getValidTraceTab(e){return e==="info"||e==="attributes"||e==="raw"?e:"info"}selectedDetailTab=mA(i.getValidTraceTab(window.localStorage.getItem("adk-trace-tab-selected-tab")));switchToEvent=Si();constructor(){Fn(()=>{window.localStorage.setItem("adk-trace-tab-selected-tab",this.selectedDetailTab())})}formatTime(e){return e?new Date(e/1e6).toLocaleString():"N/A"}get selectedSpanChildren(){let e=this.selectedSpan();return e?e.children&&e.children.length>0?e.children:this.traceData.filter(A=>A.parent_span_id&&String(A.parent_span_id)===String(e.span_id)):[]}selectSpanById(e){if(!e)return;let A=this.traceData.find(t=>String(t.span_id)===String(e));A&&this.traceService.selectedRow(A)}get selectedSpanIndex(){let e=this.selectedSpan();if(!e)return;let A=this.orderedTraceData.findIndex(t=>t.span_id===e.span_id);return A===-1?void 0:A}onPage(e){e.pageIndex>=0&&e.pageIndex=this.orderedTraceData.length?0:this.selectedSpanIndex+1:t=this.selectedSpanIndex-1<0?this.orderedTraceData.length-1:this.selectedSpanIndex-1,this.traceService.selectedRow(this.orderedTraceData[t])}Object=Object;copiedId=null;copyToClipboard(e,A){if(e==null||e==="")return;let t=String(e);navigator.clipboard.writeText(t).then(()=>{this.copiedId=A||t,setTimeout(()=>this.copiedId=null,2e3)})}getSelectedSpanEventId(){return this.selectedSpan()?.attrEventId}getSelectedSpanAttributesView(){return this.selectedSpan()?.rawAttributesUseThisFieldOnlyForDisplay??{}}getSelectedSpanRawView(){return this.selectedSpan()?.rawSpanUseThisFieldOnlyForDisplay}copyJsonToClipboard(e,A){if(!e)return;let t=JSON.stringify(e,null,2);navigator.clipboard.writeText(t).then(()=>{this.copiedId=A,setTimeout(()=>this.copiedId=null,2e3)})}static \u0275fac=function(A){return new(A||i)};static \u0275cmp=vA({type:i,selectors:[["app-trace-tab"]],hostBindings:function(A,t){A&1&&U("keydown",function(o){return t.handleKeyboardNavigation(o)},Fg)},inputs:{traceData:"traceData"},outputs:{switchToEvent:"switchToEvent"},features:[pt([{provide:rd,useClass:RR}])],decls:2,vars:1,consts:[[1,"event-details-container"],[1,"empty-state"],[1,"event-details-header"],["hidePageSize","","aria-label","Select span",1,"event-paginator",3,"page","length","pageSize","pageIndex"],[1,"span-title"],[2,"flex-grow","1"],["mat-icon-button","","matTooltip","Clear selection",3,"click"],[1,"event-details-content"],[1,"vertical-tabs-sidebar"],["mat-icon-button","","matTooltip","Info","matTooltipPosition","right",3,"click"],["mat-icon-button","","matTooltip","Attributes","matTooltipPosition","right",3,"click"],["mat-icon-button","","matTooltip","Raw JSON","matTooltipPosition","right",3,"click"],[1,"vertical-tabs-content"],[1,"info-tables-container"],[1,"json-viewer-container","json-viewer-wrapper"],["app-info-table",""],[1,"value-cell"],[3,"matTooltip"],["mat-icon-button","","matTooltip","Copy",1,"copy-value-button",3,"click"],[1,"id-text"],[1,"id-cell"],["mat-icon-button","","matTooltip","Copy",1,"copy-id-button",3,"click"],["app-info-table","","title","Children"],["app-info-table","","title","Events"],["href","javascript:void(0)",1,"span-link","id-text",3,"click","matTooltip"],[3,"json"],["mat-icon-button","","matTooltip","Copy JSON",1,"floating-copy-button",3,"click"]],template:function(A,t){A&1&&T(0,bbA,24,13,"div",0)(1,MbA,2,0,"div",1),A&2&&O(t.selectedSpan()!==void 0?0:1)},dependencies:[qi,yi,Un,zt,Ha,rn,fl,pm,u1],styles:["[_nghost-%COMP%]{display:block;height:100%}.json-viewer-container[_ngcontent-%COMP%]{margin:10px}.event-paginator[_ngcontent-%COMP%]{display:flex;justify-content:center;background-color:transparent}.event-paginator[_ngcontent-%COMP%] .mat-mdc-paginator-range-label{order:2;margin:0 0 0 8px}.span-title[_ngcontent-%COMP%]{font-weight:500;font-family:Google Sans Mono,monospace;font-size:13px;color:var(--mat-sys-on-surface);text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:300px;margin-left:16px}.event-details-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%}.event-details-content[_ngcontent-%COMP%]{display:flex;flex:1;overflow:hidden}.vertical-tabs-sidebar[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:48px;border-right:1px solid var(--mat-sys-outline-variant);padding-top:8px;align-items:center;gap:8px}.vertical-tabs-sidebar[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border-radius:6px!important}.vertical-tabs-sidebar[_ngcontent-%COMP%] button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple, .vertical-tabs-sidebar[_ngcontent-%COMP%] button[_ngcontent-%COMP%] .mat-mdc-button-ripple, .vertical-tabs-sidebar[_ngcontent-%COMP%] button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple:before, .vertical-tabs-sidebar[_ngcontent-%COMP%] button[_ngcontent-%COMP%] .mat-mdc-focus-indicator{border-radius:6px!important}.vertical-tabs-sidebar[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{background-color:var(--mat-sys-secondary-container)!important;color:var(--mat-sys-on-secondary-container)!important}.vertical-tabs-content[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;overflow:hidden;overflow-y:auto}.event-details-header[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:center;border-bottom:1px solid var(--mat-sys-outline-variant);height:48px;flex-shrink:0}.empty-state[_ngcontent-%COMP%]{padding:16px;text-align:center;color:var(--mat-sys-on-surface-variant);font-style:italic;font-size:14px}.info-tables-container[_ngcontent-%COMP%]{padding:16px;overflow-y:auto;display:flex;flex-direction:column;gap:24px}.span-link[_ngcontent-%COMP%]{color:var(--mat-sys-primary);text-decoration:none;cursor:pointer}.span-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.id-text[_ngcontent-%COMP%]{font-family:Google Sans Mono,monospace;font-size:11px}.id-cell[_ngcontent-%COMP%], .value-cell[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;overflow:hidden}.id-cell[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:first-child, .value-cell[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;flex:1}.id-cell[_ngcontent-%COMP%]:hover .copy-id-button[_ngcontent-%COMP%], .id-cell[_ngcontent-%COMP%]:hover .copy-value-button[_ngcontent-%COMP%], .value-cell[_ngcontent-%COMP%]:hover .copy-id-button[_ngcontent-%COMP%], .value-cell[_ngcontent-%COMP%]:hover .copy-value-button[_ngcontent-%COMP%]{opacity:1}.copy-id-button[_ngcontent-%COMP%], .copy-value-button[_ngcontent-%COMP%]{width:28px!important;height:28px!important;padding:0!important;line-height:28px!important;flex-shrink:0;margin:-4px 0!important;opacity:0;transition:opacity .2s ease-in-out;border-radius:4px!important;overflow:hidden!important}.copy-id-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple, .copy-id-button[_ngcontent-%COMP%] .mat-mdc-button-ripple, .copy-id-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple:before, .copy-id-button[_ngcontent-%COMP%] .mat-mdc-focus-indicator, .copy-value-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple, .copy-value-button[_ngcontent-%COMP%] .mat-mdc-button-ripple, .copy-value-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple:before, .copy-value-button[_ngcontent-%COMP%] .mat-mdc-focus-indicator{border-radius:4px!important}.copy-id-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%], .copy-value-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;line-height:16px}.json-viewer-wrapper[_ngcontent-%COMP%]{position:relative}.json-viewer-wrapper[_ngcontent-%COMP%]:hover .floating-copy-button[_ngcontent-%COMP%]{opacity:1}.floating-copy-button[_ngcontent-%COMP%]{position:absolute;top:4px;right:4px;z-index:10;opacity:0;transition:opacity .2s ease-in-out;background-color:var(--mat-sys-surface-container-high)!important;border-radius:4px!important;overflow:hidden!important;width:28px!important;height:28px!important;line-height:28px!important;padding:0!important}.floating-copy-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple, .floating-copy-button[_ngcontent-%COMP%] .mat-mdc-button-ripple, .floating-copy-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple:before, .floating-copy-button[_ngcontent-%COMP%] .mat-mdc-focus-indicator{border-radius:4px!important}.floating-copy-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;line-height:16px}.floating-copy-button[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-secondary-container)!important;color:var(--mat-sys-on-secondary-container)!important}"]})};var SbA={agentDevelopmentKitLabel:"Agent Development Kit",disclosureTooltip:"ADK Web is for development purposes. It has access to all the data and should not be used in production.",collapsePanelTooltip:"Collapse panel",eventsTabLabel:"Events",stateTabLabel:"State",artifactsTabLabel:"Artifacts",sessionsTabLabel:"Sessions",evalTabLabel:"Evals",testsTabLabel:"Tests",selectEventAriaLabel:"Select event",infoTabLabel:"Info",graphTabLabel:"Graph",requestDetailsTabLabel:"Request",responseDetailsTabLabel:"Response",responseIsNotAvailable:"Response is not available",requestIsNotAvailable:"Request is not available",clearSelectionButtonLabel:"Remove selection"},_E=new MA("Side Panel Messages",{factory:()=>SbA});var kbA=["eventMenuTrigger"],_bA=["graphContainer"],xbA=(i,e)=>e.span_id,RbA=(i,e)=>e.modality,B$=(i,e)=>e.key,NbA=(i,e)=>e.id;function FbA(i,e){if(i&1){let A=aA();I(0,"button",10),U("click",function(){L(A);let n=p();return G(n.selectedDetailTab="graph")}),I(1,"mat-icon"),D(2,"account_tree"),h()()}if(i&2){let A=p();_A("active",A.selectedDetailTab==="graph"),H("matTooltip",zC(A.i18n.graphTabLabel))}}function LbA(i,e){if(i&1){let A=aA();I(0,"div",31),lA(1,"app-custom-json-viewer",32),I(2,"button",33),U("click",function(){L(A);let n=p(3);return G(n.copyJsonToClipboard(n.selectedEvent().nodeInfo.outputFor,"nodeInfo.outputFor"))}),I(3,"mat-icon"),D(4),h()()()}if(i&2){let A=p(3);Q(),H("json",A.selectedEvent().nodeInfo.outputFor)("showMarkdown",!0),Q(3),nA(A.copiedId==="nodeInfo.outputFor"?"check":"content_copy")}}function GbA(i,e){i&1&&D(0," N/A ")}function KbA(i,e){if(i&1){let A=aA();I(0,"tr")(1,"td"),D(2,"Message As Output"),h(),I(3,"td")(4,"span",24)(5,"span",22),D(6),h(),I(7,"button",25),U("click",function(){L(A);let n=p(3);return G(n.copyToClipboard(n.selectedEvent().nodeInfo.messageAsOutput))}),I(8,"mat-icon"),D(9),h()()()()()}if(i&2){let A,t=p(3);Q(5),H("matTooltip",((A=t.selectedEvent().nodeInfo.messageAsOutput)==null?null:A.toString())||""),Q(),nA(t.selectedEvent().nodeInfo.messageAsOutput),Q(3),nA(t.copiedId===t.selectedEvent().nodeInfo.messageAsOutput?"check":"content_copy")}}function UbA(i,e){if(i&1){let A=aA();I(0,"table",26)(1,"tr")(2,"td"),D(3,"Node Path"),h(),I(4,"td")(5,"span",24)(6,"span",22),D(7),h(),I(8,"button",25),U("click",function(){L(A);let n=p(2);return G(n.copyToClipboard(n.selectedEvent().nodeInfo.path))}),I(9,"mat-icon"),D(10),h()()()()(),I(11,"tr")(12,"td"),D(13,"Output For"),h(),I(14,"td"),T(15,LbA,5,3,"div",31)(16,GbA,1,0),h()(),T(17,KbA,10,3,"tr"),h()}if(i&2){let A=p(2);Q(6),H("matTooltip",A.selectedEvent().nodeInfo.path||""),Q(),nA(A.selectedEvent().nodeInfo.path||"N/A"),Q(3),nA(A.copiedId===A.selectedEvent().nodeInfo.path?"check":"content_copy"),Q(5),O(A.selectedEvent().nodeInfo.outputFor?15:16),Q(2),O(A.selectedEvent().nodeInfo.messageAsOutput!==void 0?17:-1)}}function TbA(i,e){if(i&1){let A=aA();I(0,"div",31),lA(1,"app-custom-json-viewer",32),I(2,"button",33),U("click",function(){L(A);let n=p().$implicit,o=p(3);return G(o.copyJsonToClipboard(o.selectedEvent().actions[n],"action."+n))}),I(3,"mat-icon"),D(4),h()()()}if(i&2){let A=p().$implicit,t=p(3);Q(),H("json",t.selectedEvent().actions[A])("showMarkdown",!0),Q(3),nA(t.copiedId==="action."+A?"check":"content_copy")}}function ObA(i,e){if(i&1){let A=aA();I(0,"span",24)(1,"span",22),D(2),h(),I(3,"button",25),U("click",function(){let n;L(A);let o=p().$implicit,a=p(3);return G(a.copyToClipboard((n=a.selectedEvent().actions[o])==null?null:n.toString()))}),I(4,"mat-icon"),D(5),h()()()}if(i&2){let A,t,n=p().$implicit,o=p(3);Q(),H("matTooltip",((A=o.selectedEvent().actions[n])==null?null:A.toString())||""),Q(),nA(o.selectedEvent().actions[n]),Q(3),nA(o.copiedId===((t=o.selectedEvent().actions[n])==null?null:t.toString())?"check":"content_copy")}}function JbA(i,e){if(i&1&&(I(0,"tr")(1,"td"),D(2),h(),I(3,"td"),T(4,TbA,5,3,"div",31)(5,ObA,6,3,"span",24),h()()),i&2){let A=e.$implicit,t=p(3);Q(2),nA(A),Q(2),O(t.isObject(t.selectedEvent().actions[A])?4:5)}}function YbA(i,e){if(i&1&&(I(0,"table",27),ke(1,JbA,6,2,"tr",null,ni),h()),i&2){let A=p(2);Q(),_e(A.Object.keys(A.selectedEvent().actions))}}function HbA(i,e){if(i&1){let A=aA();I(0,"tr")(1,"td"),D(2),h(),I(3,"td")(4,"div",31),lA(5,"app-custom-json-viewer",32),I(6,"button",33),U("click",function(){let n=L(A),o=n.$implicit,a=n.$index,r=p(3);return G(r.copyJsonToClipboard(o,"fc."+a))}),I(7,"mat-icon"),D(8),h()()()()()}if(i&2){let A=e.$implicit,t=e.$index,n=p(3);Q(2),nA(A==null?null:A.name),Q(3),H("json",A)("showMarkdown",!0),Q(3),nA(n.copiedId==="fc."+t?"check":"content_copy")}}function zbA(i,e){if(i&1&&(I(0,"table",28),ke(1,HbA,9,4,"tr",null,Ja),h()),i&2){let A=p(2);Q(),_e(A.functionCalls())}}function PbA(i,e){if(i&1&&(I(0,"div",35),lA(1,"img",36),h()),i&2){let A=p().$implicit;Q(),H("src","data:"+A.inlineData.mimeType+";base64,"+A.inlineData.data,mo)}}function jbA(i,e){if(i&1&&(I(0,"div"),lA(1,"audio",37),h()),i&2){let A=p().$implicit;Q(),H("src","data:"+A.inlineData.mimeType+";base64,"+A.inlineData.data)}}function VbA(i,e){if(i&1&&(I(0,"div"),lA(1,"video",37),h()),i&2){let A=p().$implicit;Q(),H("src","data:"+A.inlineData.mimeType+";base64,"+A.inlineData.data,mo)}}function qbA(i,e){if(i&1&&(I(0,"div"),D(1),h()),i&2){let A=p().$implicit;Q(),Ee(" Unsupported media type: ",A.inlineData==null?null:A.inlineData.mimeType," ")}}function WbA(i,e){if(i&1&&T(0,PbA,2,1,"div",35)(1,jbA,2,1,"div")(2,VbA,2,1,"div")(3,qbA,2,1,"div"),i&2){let A=e.$implicit;O(!(A.inlineData==null||A.inlineData.mimeType==null)&&A.inlineData.mimeType.startsWith("image/")?0:!(A.inlineData==null||A.inlineData.mimeType==null)&&A.inlineData.mimeType.startsWith("audio/")?1:!(A.inlineData==null||A.inlineData.mimeType==null)&&A.inlineData.mimeType.startsWith("video/")?2:3)}}function ZbA(i,e){if(i&1&&(I(0,"div",34),ke(1,WbA,4,1,null,null,Ja),h()),i&2){let A=p().$implicit;Q(),_e(A.mediaParts)}}function XbA(i,e){if(i&1){let A=aA();I(0,"tr")(1,"td"),D(2),h(),I(3,"td"),T(4,ZbA,3,0,"div",34),I(5,"div",31),lA(6,"app-custom-json-viewer",32),I(7,"button",33),U("click",function(){let n=L(A),o=n.$implicit,a=n.$index,r=p(3);return G(r.copyJsonToClipboard(o.cleanedFr,"pfr."+a))}),I(8,"mat-icon"),D(9),h()()()()()}if(i&2){let A=e.$implicit,t=e.$index,n=p(3);Q(2),nA(A.name),Q(2),O(A.hasMedia?4:-1),Q(2),H("json",A.cleanedFr)("showMarkdown",!0),Q(3),nA(n.copiedId==="pfr."+t?"check":"content_copy")}}function $bA(i,e){if(i&1&&(I(0,"table",29),ke(1,XbA,10,5,"tr",null,Ja),h()),i&2){let A=p(2);Q(),_e(A.processedFunctionResponses())}}function A7A(i,e){if(i&1){let A=aA();I(0,"tr")(1,"td"),D(2),h(),I(3,"td")(4,"span",21)(5,"a",38),U("click",function(){let n=L(A).$implicit,o=p(3);return G(o.switchToSpan(n))}),D(6),h(),I(7,"button",23),U("click",function(){let n=L(A).$implicit,o=p(3);return G(o.copyToClipboard(n.span_id))}),I(8,"mat-icon"),D(9),h()()()()()}if(i&2){let A=e.$implicit,t=p(3);Q(2),nA(A.name),Q(3),H("matTooltip",A.span_id),Q(),nA(A.span_id),Q(3),nA(t.copiedId===A.span_id?"check":"content_copy")}}function e7A(i,e){if(i&1&&(I(0,"table",30),ke(1,A7A,10,4,"tr",null,xbA),h()),i&2){let A=p(2);Q(),_e(A.associatedSpans())}}function t7A(i,e){if(i&1){let A=aA();I(0,"div",16)(1,"table",19)(2,"tr")(3,"td"),D(4,"Event ID"),h(),I(5,"td",20)(6,"span",21)(7,"span",22),D(8),h(),I(9,"button",23),U("click",function(){let n;L(A);let o=p();return G(o.copyToClipboard((n=o.selectedEvent())==null?null:n.id))}),I(10,"mat-icon"),D(11),h()()()()(),I(12,"tr")(13,"td"),D(14,"Invocation ID"),h(),I(15,"td",20)(16,"span",21)(17,"span",22),D(18),h(),I(19,"button",23),U("click",function(){let n;L(A);let o=p();return G(o.copyToClipboard((n=o.selectedEvent())==null?null:n.invocationId))}),I(20,"mat-icon"),D(21),h()()()()(),I(22,"tr")(23,"td"),D(24,"Branch"),h(),I(25,"td")(26,"span",24)(27,"span",22),D(28),h(),I(29,"button",25),U("click",function(){let n;L(A);let o=p();return G(o.copyToClipboard((n=o.selectedEvent())==null?null:n.branch))}),I(30,"mat-icon"),D(31),h()()()()(),I(32,"tr")(33,"td"),D(34,"Timestamp"),h(),I(35,"td")(36,"span",24)(37,"span",22),D(38),h(),I(39,"button",25),U("click",function(){let n;L(A);let o=p();return G(o.copyToClipboard(o.formatTime((n=o.selectedEvent())==null?null:n.timestamp),"timestamp"))}),I(40,"mat-icon"),D(41),h()()()()(),I(42,"tr")(43,"td"),D(44,"Author"),h(),I(45,"td")(46,"span",24)(47,"span",22),D(48),h(),I(49,"button",25),U("click",function(){let n;L(A);let o=p();return G(o.copyToClipboard((n=o.selectedEvent())==null?null:n.author))}),I(50,"mat-icon"),D(51),h()()()()()(),T(52,UbA,18,5,"table",26),T(53,YbA,3,0,"table",27),T(54,zbA,3,0,"table",28),T(55,$bA,3,0,"table",29),T(56,e7A,3,0,"table",30),h()}if(i&2){let A,t,n,o,a,r,s,l,g,C,d,B,u,E,f,m,v=p();Q(7),H("matTooltip",((A=v.selectedEvent())==null?null:A.id)||""),Q(),nA((t=v.selectedEvent())==null?null:t.id),Q(3),nA(v.copiedId===((n=v.selectedEvent())==null?null:n.id)?"check":"content_copy"),Q(6),H("matTooltip",((o=v.selectedEvent())==null?null:o.invocationId)||""),Q(),nA(((a=v.selectedEvent())==null?null:a.invocationId)||"N/A"),Q(3),nA(v.copiedId===((r=v.selectedEvent())==null?null:r.invocationId)?"check":"content_copy"),Q(6),H("matTooltip",((s=v.selectedEvent())==null?null:s.branch)||""),Q(),nA(((l=v.selectedEvent())==null?null:l.branch)||"N/A"),Q(3),nA(v.copiedId===((g=v.selectedEvent())==null?null:g.branch)?"check":"content_copy"),Q(6),H("matTooltip",v.formatTime((C=v.selectedEvent())==null?null:C.timestamp)),Q(),nA(v.formatTime((d=v.selectedEvent())==null?null:d.timestamp)),Q(3),nA(v.copiedId==="timestamp"?"check":"content_copy"),Q(6),H("matTooltip",((B=v.selectedEvent())==null?null:B.author)||""),Q(),nA((u=v.selectedEvent())==null?null:u.author),Q(3),nA(v.copiedId===((E=v.selectedEvent())==null?null:E.author)?"check":"content_copy"),Q(),O((f=v.selectedEvent())!=null&&f.nodeInfo?52:-1),Q(),O((m=v.selectedEvent())!=null&&m.actions&&v.Object.keys(v.selectedEvent().actions).length>0?53:-1),Q(),O(v.functionCalls().length>0?54:-1),Q(),O(v.processedFunctionResponses().length>0?55:-1),Q(),O(v.associatedSpans().length>0?56:-1)}}function i7A(i,e){if(i&1&&(I(0,"div",42),mt(1,"number"),I(2,"span",43),D(3),h(),I(4,"span",44),D(5),mt(6,"number"),h()()),i&2){let A=e.$implicit;H("matTooltip",A.modality+": "+Ft(1,3,A.tokenCount)),Q(3),nA(A.modality),Q(2),nA(Ft(6,5,A.tokenCount))}}function n7A(i,e){if(i&1&&ke(0,i7A,7,7,"div",42,RbA),i&2){let A=p().$implicit,t=p(3);_e(t.selectedEvent().usageMetadata[A])}}function o7A(i,e){if(i&1&&(I(0,"span",22),mt(1,"number"),D(2),mt(3,"number"),h()),i&2){let A=p(2).$implicit,t=p(3);H("matTooltip",Ft(1,2,t.selectedEvent().usageMetadata[A])||""),Q(2),nA(Ft(3,4,t.selectedEvent().usageMetadata[A]))}}function a7A(i,e){if(i&1&&(I(0,"span",22),D(1),h()),i&2){let A,t=p(2).$implicit,n=p(3);H("matTooltip",((A=n.selectedEvent().usageMetadata[t])==null?null:A.toString())||""),Q(),nA(n.selectedEvent().usageMetadata[t])}}function r7A(i,e){if(i&1&&T(0,o7A,4,6,"span",22)(1,a7A,2,2,"span",22),i&2){let A=p().$implicit,t=p(3);O(t.isNumber(t.selectedEvent().usageMetadata[A])?0:1)}}function s7A(i,e){if(i&1&&(I(0,"tr")(1,"td"),D(2),h(),I(3,"td")(4,"span",24)(5,"span"),T(6,n7A,2,0)(7,r7A,2,1),h()()()()),i&2){let A=e.$implicit,t=p(3);Q(2),nA(A),Q(2),_A("numeric-cell",t.isNumericValue(A,t.selectedEvent().usageMetadata[A])),Q(2),O(A==="promptTokensDetails"||A==="promptTokenDetails"||A==="candidatesTokenDetails"||A==="candidatesTokensDetails"||A==="cacheTokensDetails"?6:7)}}function l7A(i,e){if(i&1&&(I(0,"table",39),ke(1,s7A,8,4,"tr",null,ni),h()),i&2){let A=p(2);Q(),_e(A.Object.keys(A.selectedEvent().usageMetadata))}}function g7A(i,e){i&1&&(I(0,"table",39)(1,"tr")(2,"td",45),D(3," Select an LLM response to see usage metadata. "),h()()())}function c7A(i,e){if(i&1&&(I(0,"div",16),T(1,l7A,3,0,"table",39)(2,g7A,4,0,"table",39),I(3,"table",40)(4,"tr")(5,"td"),D(6,"Total Prompt Tokens"),h(),I(7,"td",41),D(8),mt(9,"number"),h()(),I(10,"tr")(11,"td"),D(12,"Total Candidates Tokens"),h(),I(13,"td",41),D(14),mt(15,"number"),h()(),I(16,"tr")(17,"td"),D(18,"Total Tokens"),h(),I(19,"td",41),D(20),mt(21,"number"),h()()()()),i&2){let A,t=p();Q(),O((A=t.selectedEvent())!=null&&A.usageMetadata&&t.Object.keys(t.selectedEvent().usageMetadata).length>0?1:2),Q(7),nA(Ft(9,4,t.sessionUsageMetadata()["Prompt Tokens"])),Q(6),nA(Ft(15,6,t.sessionUsageMetadata()["Candidates Tokens"])),Q(6),nA(Ft(21,8,t.sessionUsageMetadata()["Total Tokens"]))}}function C7A(i,e){if(i&1){let A=aA();I(0,"div",17),lA(1,"app-custom-json-viewer",32),I(2,"button",33),U("click",function(){L(A);let n=p();return G(n.copyJsonToClipboard(n.filteredSelectedEvent(),"raw"))}),I(3,"mat-icon"),D(4),h()()()}if(i&2){let A=p();Q(),H("json",A.filteredSelectedEvent())("showMarkdown",!0),Q(3),nA(A.copiedId==="raw"?"check":"content_copy")}}function d7A(i,e){if(i&1&&lA(0,"app-custom-json-viewer",32),i&2){let A=p().$implicit;H("json",A.oldValue)("showMarkdown",!0)}}function I7A(i,e){if(i&1&&(I(0,"span"),D(1),h()),i&2){let A=p().$implicit;Q(),nA(A.oldValue)}}function B7A(i,e){if(i&1&&lA(0,"app-custom-json-viewer",32),i&2){let A=p().$implicit;H("json",A.newValue)("showMarkdown",!0)}}function h7A(i,e){if(i&1&&(I(0,"span"),D(1),h()),i&2){let A=p().$implicit;Q(),nA(A.newValue)}}function E7A(i,e){if(i&1&&(I(0,"div",47)(1,"div",48),D(2),h(),I(3,"div",49)(4,"div",50)(5,"div",51),D(6,"Old Value"),h(),I(7,"div",52),T(8,d7A,1,2,"app-custom-json-viewer",32)(9,I7A,2,1,"span"),h()(),I(10,"div",50)(11,"div",51),D(12,"New Value"),h(),I(13,"div",52),T(14,B7A,1,2,"app-custom-json-viewer",32)(15,h7A,2,1,"span"),h()()()()),i&2){let A=e.$implicit,t=p(3);Q(2),nA(A.key),Q(6),O(t.isObject(A.oldValue)?8:9),Q(6),O(t.isObject(A.newValue)?14:15)}}function Q7A(i,e){if(i&1&&ke(0,E7A,16,3,"div",47,B$),i&2){let A=p(2);_e(A.stateChanges())}}function u7A(i,e){i&1&&(I(0,"div",46),D(1," No state changes in this event. "),h())}function p7A(i,e){if(i&1&&(I(0,"div",16),T(1,Q7A,2,0)(2,u7A,2,0,"div",46),h()),i&2){let A=p();Q(),O(A.stateChanges().length>0?1:2)}}function f7A(i,e){i&1&&(I(0,"div",53)(1,"mat-icon",66),D(2,"warning"),h(),I(3,"span"),D(4,"The loaded session file was for a different app. The graph may not be accurate."),h()())}function m7A(i,e){if(i&1){let A=aA();I(0,"button",72),U("click",function(){let n=L(A).$implicit,o=p(3);return G(o.onInvocationSelected(n.key))}),I(1,"mat-icon",73),D(2,"check"),h(),D(3),h()}if(i&2){let A,t=e.$implicit,n=p(3);H("matTooltip",t.key),Q(),ft("visibility",((A=n.selectedEvent())==null?null:A.invocationId)===t.key?"visible":"hidden"),Q(2),Ee(" ",t.value," ")}}function w7A(i,e){if(i&1&&(I(0,"button",67)(1,"div",68)(2,"span",69),D(3),h(),I(4,"mat-icon",70),D(5,"arrow_drop_down"),h()()(),I(6,"mat-menu",null,3),ke(8,m7A,4,4,"button",71,B$),h()),i&2){let A,t=Bi(7),n=p(2);H("matMenuTriggerFor",t),Q(2),H("matTooltip",((A=n.selectedEvent())==null?null:A.invocationId)||""),Q(),Ee(" ",n.invocationDisplayMap().get(n.selectedEvent().invocationId)||n.selectedEvent().invocationId," "),Q(5),_e(n.invocationDisplayEntries())}}function y7A(i,e){if(i&1&&(I(0,"span",57),D(1),h()),i&2){let A,t,n=p(2);H("matTooltip",((A=n.selectedEvent())==null?null:A.invocationId)||""),Q(),nA((t=n.selectedEvent())!=null&&t.invocationId?n.invocationDisplayMap().get(n.selectedEvent().invocationId)||n.selectedEvent().invocationId:"N/A")}}function D7A(i,e){i&1&&(I(0,"mat-icon",75),D(1,"chevron_right"),h())}function v7A(i,e){i&1&&(I(0,"mat-icon",75),D(1,"chevron_right"),h())}function b7A(i,e){if(i&1&&(T(0,v7A,2,0,"mat-icon",75),I(1,"button",74),D(2),h()),i&2){let A=e.$implicit,t=e.$index,n=p(3);O(t>0?0:-1),Q(),_A("active",t===n.breadcrumbs().length-1),Q(),Ee(" ",A," ")}}function M7A(i,e){if(i&1&&(I(0,"div",58)(1,"button",74),D(2),h(),T(3,D7A,2,0,"mat-icon",75),ke(4,b7A,3,4,null,null,Ja),h()),i&2){let A=p(2);Q(2),nA(A.appName()),Q(),O(A.breadcrumbs().length>0?3:-1),Q(),_e(A.breadcrumbs())}}function S7A(i,e){if(i&1){let A=aA();I(0,"button",76),U("click",function(){L(A);let n=p(2);return G(n.showAgentStructureGraph.emit(!0))}),I(1,"mat-icon"),D(2,"fullscreen"),h()()}}function k7A(i,e){i&1&&(I(0,"div",61),D(1," Graph is not available for this agent. "),h())}function _7A(i,e){i&1&&(I(0,"div",62),lA(1,"mat-progress-spinner",77),h())}function x7A(i,e){if(i&1&&lA(0,"div",63),i&2){let A=p(2);H("innerHtml",A.renderedEventGraph(),Fc)}}function R7A(i,e){if(i&1){let A=aA();I(0,"button",78),U("click",function(){let n=L(A).$implicit,o=p(2);return G(o.handleMenuSelection(n))}),I(1,"span"),D(2),mt(3,"date"),h()()}if(i&2){let A=e.$implicit;Q(2),Ya("Run ",A.runIndex," (",G0(3,2,A.timestamp,"mediumTime"),")")}}function N7A(i,e){if(i&1&&(I(0,"div",18),T(1,f7A,5,0,"div",53),I(2,"div",54)(3,"div",55)(4,"span",56),D(5,"Invocation:"),h(),T(6,w7A,10,3)(7,y7A,2,2,"span",57),h()(),T(8,M7A,6,2,"div",58),I(9,"div",59,0),T(11,S7A,3,0,"button",60),T(12,k7A,2,0,"div",61)(13,_7A,2,0,"div",62)(14,x7A,1,1,"div",63),h(),lA(15,"div",64,1),I(17,"mat-menu",null,2),ke(19,R7A,4,5,"button",65,NbA),h()()),i&2){let A,t=Bi(18),n=p();Q(),O(n.isViewOnlyAppNameMismatch()?1:-1),Q(5),O(n.invocationDisplayMap().size>0&&((A=n.selectedEvent())!=null&&A.invocationId)?6:7),Q(2),O(n.hasSubWorkflows()&&(n.breadcrumbs().length>0||n.appName())?8:-1),Q(3),O(n.graphsAvailable()?11:-1),Q(),O(n.graphsAvailable()?n.renderedEventGraph()?14:13:12),Q(3),ft("left",n.menuPos.x+"px")("top",n.menuPos.y+"px"),H("matMenuTriggerFor",t),Q(4),_e(n.menuEvents)}}function F7A(i,e){i&1&&(I(0,"div",62),lA(1,"mat-progress-spinner",77),h())}function L7A(i,e){i&1&&(I(0,"div",61),D(1,"Select an LLM response to see request details."),h())}function G7A(i,e){if(i&1){let A=aA();I(0,"div",17),lA(1,"app-custom-json-viewer",32),I(2,"button",33),U("click",function(){L(A);let n=p(2);return G(n.copyJsonToClipboard(n.llmRequest(),"request"))}),I(3,"mat-icon"),D(4),h()()()}if(i&2){let A=p(2);Q(),H("json",A.llmRequest())("showMarkdown",!0),Q(3),nA(A.copiedId==="request"?"check":"content_copy")}}function K7A(i,e){if(i&1&&(T(0,F7A,2,0,"div",62),mt(1,"async"),S1(2,L7A,2,0,"div",61)(3,G7A,5,3,"div",17)),i&2){let A=p();O(Ft(1,1,A.uiStateService.isEventRequestResponseLoading())===!0?0:A.llmRequest()?3:2)}}function U7A(i,e){i&1&&(I(0,"div",62),lA(1,"mat-progress-spinner",77),h())}function T7A(i,e){i&1&&(I(0,"div",61),D(1,"Select an LLM response to see response details."),h())}function O7A(i,e){if(i&1){let A=aA();I(0,"div",17),lA(1,"app-custom-json-viewer",32),I(2,"button",33),U("click",function(){L(A);let n=p(2);return G(n.copyJsonToClipboard(n.llmResponse(),"response"))}),I(3,"mat-icon"),D(4),h()()()}if(i&2){let A=p(2);Q(),H("json",A.llmResponse())("showMarkdown",!0),Q(3),nA(A.copiedId==="response"?"check":"content_copy")}}function J7A(i,e){if(i&1&&(T(0,U7A,2,0,"div",62),mt(1,"async"),S1(2,T7A,2,0,"div",61)(3,O7A,5,3,"div",17)),i&2){let A=p();O(Ft(1,1,A.uiStateService.isEventRequestResponseLoading())===!0?0:A.llmResponse()?3:2)}}var Ry=class i{eventDataSize=ve.required();eventDataMap=ve(new Map);selectedEventIndex=ve();selectedEvent=ve.required();filteredSelectedEvent=ve();renderedEventGraph=ve();rawSvgString=ve(null);llmRequest=ve();llmResponse=ve();traceData=ve([]);appName=ve("");selectedEventGraphPath=ve("");hasSubWorkflows=ve(!1);graphsAvailable=ve(!0);invocationDisplayMap=ve(new Map);forceGraphTab=ve(!1);isViewOnlySession=ve(!1);isViewOnlyAppNameMismatch=ve(!1);invocationDisplayEntries=ye(()=>Array.from(this.invocationDisplayMap().entries()).map(([e,A])=>({key:e,value:A})));breadcrumbs=ye(()=>{let e=this.selectedEventGraphPath();return e?e.split("/").filter(A=>A):[]});functionCalls=ye(()=>(this.selectedEvent()?.content?.parts||[]).filter(A=>!!A.functionCall).map(A=>A.functionCall));functionResponses=ye(()=>(this.selectedEvent()?.content?.parts||[]).filter(A=>!!A.functionResponse).map(A=>A.functionResponse));processedFunctionResponses=ye(()=>this.functionResponses().map(A=>{if(!A)return null;if(A&&Array.isArray(A.parts)){let n=A.parts.filter(a=>!!a.inlineData).map(a=>a.inlineData&&a.inlineData.data?$A(P({},a),{inlineData:$A(P({},a.inlineData),{data:a.inlineData.data.replace(/-/g,"+").replace(/_/g,"/")})}):a),o=P({},A);return delete o.parts,{name:A.name,cleanedFr:o,mediaParts:n,hasMedia:n.length>0}}return{name:A.name,cleanedFr:A,mediaParts:[],hasMedia:!1}}).filter(A=>A!==null));page=Si();closeSelectedEvent=Si();openImageDialog=Si();switchToTraceView=Si();showAgentStructureGraph=Si();drillDownNodePath=Si();selectEventById=Si();jumpToInvocation=Si();onInvocationSelected(e){this.jumpToInvocation.emit(e)}eventMenuTrigger;graphContainer;menuEvents=[];menuPos={x:0,y:0};uiStateService=w(ag);traceService=w(ng);i18n=w(_E);isEventRequestResponseLoadingSignal=sr(this.uiStateService.isEventRequestResponseLoading(),{initialValue:!1});associatedSpans=ye(()=>{let e=this.selectedEvent();if(!e||!e.id)return[];let A=this.traceData();if(!A)return[];let t=o=>{let a=[];for(let r of o)a.push(r),r.children&&(a=a.concat(t(r.children)));return a};return t(A).filter(o=>o.attrEventId===e.id)});sessionUsageMetadata=ye(()=>{let e=Array.from(this.eventDataMap().values()),A=0,t=0,n=0;return e.forEach(o=>{let a=o.usageMetadata;if(a){let r=a.promptTokenCount??a.promptTokens??0,s=a.candidatesTokenCount??a.candidatesTokens??0,l=a.totalTokenCount??a.totalTokens??0;A+=Number(r),t+=Number(s),n+=Number(l)}}),{"Prompt Tokens":A,"Candidates Tokens":t,"Total Tokens":n}});_selectedDetailTab="event";get selectedDetailTab(){return this._selectedDetailTab}set selectedDetailTab(e){this._selectedDetailTab=e,window.localStorage.setItem("adk-event-tab-selected-tab",e),e==="graph"&&setTimeout(()=>{this.graphContainer?.nativeElement&&FB(this.graphContainer.nativeElement,(A,t)=>{this.handleNodeClick(A,t)})},50)}copiedId=null;copyToClipboard(e,A){e&&navigator.clipboard.writeText(e).then(()=>{this.copiedId=A||e,setTimeout(()=>this.copiedId=null,2e3)})}copyJsonToClipboard(e,A){if(!e)return;let t=JSON.stringify(e,null,2);navigator.clipboard.writeText(t).then(()=>{this.copiedId=A,setTimeout(()=>this.copiedId=null,2e3)})}switchToSpan(e){this.switchToTraceView.emit(),this.traceService.selectedRow(e)}stateChanges=ye(()=>{let e=this.selectedEvent();if(!e)return[];let A=Array.from(this.eventDataMap().values());A.sort((o,a)=>(o.timestamp||0)-(a.timestamp||0));let t={},n=[];for(let o of A){let a=o.actions?.stateDelta;if(o.id===e.id){if(a)for(let r of Object.keys(a))r!=="__llm_request_key__"&&n.push({key:r,oldValue:t[r]!==void 0?t[r]:"N/A",newValue:a[r]});break}if(a)for(let r of Object.keys(a))r!=="__llm_request_key__"&&(t[r]=a[r])}return n});constructor(){let e=window.localStorage.getItem("adk-event-tab-selected-tab");e&&["event","raw","request","response","graph","metadata","state"].includes(e)&&(this._selectedDetailTab=e),Fn(()=>{let t=this.renderedEventGraph(),n=this._selectedDetailTab;t&&n==="graph"&&setTimeout(()=>{this.graphContainer?.nativeElement&&FB(this.graphContainer.nativeElement,(o,a)=>{this.handleNodeClick(o,a)})},50)});let A=!1;Fn(()=>{let t=this.forceGraphTab(),n=this.selectedEvent();t&&!A&&(this.selectedDetailTab=this.graphsAvailable()?"graph":"event"),A=t})}formatTime(e){if(!e)return"N/A";let A=e<1e10?e*1e3:e;return new Date(A).toLocaleString()}isNumber(e){return typeof e=="number"}isNumericValue(e,A){return typeof A=="number"?!0:["promptTokensDetails","promptTokenDetails","candidatesTokenDetails","candidatesTokensDetails","cacheTokensDetails"].includes(e)}isObject(e){return e!==null&&typeof e=="object"}handleNodeClick(e,A){let t=Array.from(this.eventDataMap().values()),o=this.selectedEvent()?.invocationId;o&&(t=t.filter(l=>l.invocationId===o));let a=[],r=[],s="";t.forEach(l=>{let g=l.nodeInfo?.path;if(l.author==="user"&&(g="__START__"),!g)return;let C=g;g!=="__START__"&&(C=g.split("/").map(E=>E.split("@")[0]).join("/"));let d=C.split("/"),B=d[d.length-1],u="";if(d.length>=2&&d[d.length-1]==="call_llm"&&d[d.length-2]===l.author?(B=d[d.length-2],u=d.slice(1,-2).join("/")):u=d.slice(1,-1).join("/"),u===this.selectedEventGraphPath()){let E=g.split("/"),f=E[E.length-1],m=e.includes("@")?f:B;m!==s&&(s===e&&r.length>0&&a.push(r),s=m,r=[]),m===e&&r.push(l)}}),s===e&&r.length>0&&a.push(r),a.length!==0&&(a.length===1?this.selectEventById.emit(a[0][0].id):(this.menuEvents=a.map((l,g)=>({id:l[0].id,runIndex:g+1,timestamp:l[0].timestamp})),A&&(this.menuPos={x:A.clientX,y:A.clientY}),this.eventMenuTrigger.openMenu()))}handleMenuSelection(e){this.selectEventById.emit(e.id)}Object=Object;static \u0275fac=function(A){return new(A||i)};static \u0275cmp=vA({type:i,selectors:[["app-event-tab"]],viewQuery:function(A,t){if(A&1&&Wt(kbA,5)(_bA,5),A&2){let n;se(n=le())&&(t.eventMenuTrigger=n.first),se(n=le())&&(t.graphContainer=n.first)}},inputs:{eventDataSize:[1,"eventDataSize"],eventDataMap:[1,"eventDataMap"],selectedEventIndex:[1,"selectedEventIndex"],selectedEvent:[1,"selectedEvent"],filteredSelectedEvent:[1,"filteredSelectedEvent"],renderedEventGraph:[1,"renderedEventGraph"],rawSvgString:[1,"rawSvgString"],llmRequest:[1,"llmRequest"],llmResponse:[1,"llmResponse"],traceData:[1,"traceData"],appName:[1,"appName"],selectedEventGraphPath:[1,"selectedEventGraphPath"],hasSubWorkflows:[1,"hasSubWorkflows"],graphsAvailable:[1,"graphsAvailable"],invocationDisplayMap:[1,"invocationDisplayMap"],forceGraphTab:[1,"forceGraphTab"],isViewOnlySession:[1,"isViewOnlySession"],isViewOnlyAppNameMismatch:[1,"isViewOnlyAppNameMismatch"]},outputs:{page:"page",closeSelectedEvent:"closeSelectedEvent",openImageDialog:"openImageDialog",switchToTraceView:"switchToTraceView",showAgentStructureGraph:"showAgentStructureGraph",drillDownNodePath:"drillDownNodePath",selectEventById:"selectEventById",jumpToInvocation:"jumpToInvocation"},decls:35,vars:32,consts:[["graphContainer",""],["eventMenuTrigger","matMenuTrigger"],["eventMenu","matMenu"],["invocationSelectorMenu","matMenu"],[1,"event-details-container"],[1,"event-details-header"],["hidePageSize","",1,"event-paginator",3,"page","length","pageSize","pageIndex"],["mat-icon-button","",3,"click","matTooltip"],[1,"event-details-content"],[1,"vertical-tabs-sidebar"],["mat-icon-button","","matTooltipPosition","right",3,"click","matTooltip"],["mat-icon-button","","matTooltipPosition","right",3,"active","matTooltip"],["mat-icon-button","","matTooltip","Usage Metadata","matTooltipPosition","right",3,"click"],["mat-icon-button","","matTooltip","State Changes","matTooltipPosition","right",3,"click"],["mat-icon-button","","matTooltip","Raw JSON","matTooltipPosition","right",3,"click"],[1,"vertical-tabs-content"],[1,"info-tables-container"],[1,"json-viewer-container","json-viewer-wrapper"],[1,"event-graph-wrapper"],["app-info-table",""],[1,"id-text"],[1,"id-cell"],[3,"matTooltip"],["mat-icon-button","","matTooltip","Copy",1,"copy-id-button",3,"click"],[1,"value-cell"],["mat-icon-button","","matTooltip","Copy",1,"copy-value-button",3,"click"],["app-info-table","","title","Node Info"],["app-info-table","","title","Actions"],["app-info-table","","title","Function Calls"],["app-info-table","","title","Function Responses"],["app-info-table","","title","Associated Spans"],[1,"json-viewer-wrapper"],[3,"json","showMarkdown"],["mat-icon-button","","matTooltip","Copy JSON",1,"floating-copy-button",3,"click"],[1,"media-container"],[1,"generated-image-container"],["alt","image",3,"src"],["controls","",3,"src"],["href","javascript:void(0)",1,"span-link","id-text",3,"click","matTooltip"],["app-info-table","","title","Usage Summary for Event"],["app-info-table","","title","Usage Summary for Session"],[1,"numeric-cell"],[1,"detail-row",3,"matTooltip"],[1,"modality-label"],[1,"modality-value"],["colspan","2",2,"text-align","center","padding","20px","color","var(--mat-sys-on-surface-variant)"],[1,"empty-state"],[1,"state-change-card"],[1,"state-change-header"],[1,"state-change-values"],[1,"state-value-block"],[1,"state-value-label"],[1,"state-value-content"],[1,"warning-banner",2,"background-color","#fff3cd","color","#856404","padding","8px","margin-bottom","8px","border-radius","4px","display","flex","align-items","center"],[1,"graph-header",2,"justify-content","space-between"],[2,"display","flex","align-items","center","min-width","0","flex","1","width","100%"],[2,"white-space","nowrap","flex-shrink","0"],[2,"margin-left","8px","font-weight","normal",3,"matTooltip"],[1,"breadcrumb-container"],[1,"event-graph-container"],["mat-icon-button","","matTooltip","Full Screen",1,"fullscreen-graph-button"],[1,"request-response-empty-state"],[1,"request-response-loading-spinner-container"],[1,"svg-graph-wrapper",3,"innerHtml"],[2,"visibility","hidden","position","fixed",3,"matMenuTriggerFor"],["mat-menu-item",""],[2,"margin-right","8px"],["mat-button","",1,"invocation-selector-button",2,"margin-left","8px","padding","0 8px","min-width","0","flex","1","height","24px","line-height","24px","width","100%",3,"matMenuTriggerFor"],[2,"display","flex","align-items","center","width","100%","min-width","0","justify-content","space-between"],[2,"font-weight","normal","overflow","hidden","text-overflow","ellipsis","white-space","nowrap","flex","1","text-align","left",3,"matTooltip"],[2,"margin-left","4px","font-size","18px","width","18px","height","18px","flex-shrink","0"],["mat-menu-item","","matTooltipPosition","right",3,"matTooltip"],["mat-menu-item","","matTooltipPosition","right",3,"click","matTooltip"],[2,"font-size","16px","width","16px","height","16px","margin-right","8px","color","var(--mat-sys-primary)"],["disabled","",1,"breadcrumb-item"],[1,"breadcrumb-separator"],["mat-icon-button","","matTooltip","Full Screen",1,"fullscreen-graph-button",3,"click"],["mode","indeterminate","diameter","50"],["mat-menu-item","",3,"click"]],template:function(A,t){A&1&&(I(0,"div",4)(1,"div",5)(2,"mat-paginator",6),U("page",function(o){return t.page.emit(o)}),h(),I(3,"button",7),U("click",function(){return t.closeSelectedEvent.emit()}),I(4,"mat-icon"),D(5,"remove_selection"),h()()(),I(6,"div",8)(7,"div",9)(8,"button",10),U("click",function(){return t.selectedDetailTab="event"}),I(9,"mat-icon"),D(10,"info"),h()(),T(11,FbA,3,4,"button",11),I(12,"button",10),U("click",function(){return t.selectedDetailTab="request"}),I(13,"mat-icon"),D(14,"input"),h()(),I(15,"button",10),U("click",function(){return t.selectedDetailTab="response"}),I(16,"mat-icon"),D(17,"output"),h()(),I(18,"button",12),U("click",function(){return t.selectedDetailTab="metadata"}),I(19,"mat-icon"),D(20,"analytics"),h()(),I(21,"button",13),U("click",function(){return t.selectedDetailTab="state"}),I(22,"mat-icon"),D(23,"published_with_changes"),h()(),I(24,"button",14),U("click",function(){return t.selectedDetailTab="raw"}),I(25,"mat-icon"),D(26,"data_object"),h()()(),I(27,"div",15),T(28,t7A,57,20,"div",16),T(29,c7A,22,10,"div",16),T(30,C7A,5,3,"div",17),T(31,p7A,3,1,"div",16),T(32,N7A,21,10,"div",18),T(33,K7A,4,3),T(34,J7A,4,3),h()()()),A&2&&(Q(2),H("length",t.eventDataSize())("pageSize",1)("pageIndex",t.selectedEventIndex()),ie("aria-label",t.i18n.selectEventAriaLabel),Q(),H("matTooltip",zC(t.i18n.clearSelectionButtonLabel)),Q(5),_A("active",t.selectedDetailTab==="event"),H("matTooltip",zC(t.i18n.infoTabLabel)),Q(3),O(t.graphsAvailable()?11:-1),Q(),_A("active",t.selectedDetailTab==="request"),H("matTooltip",zC(t.i18n.requestDetailsTabLabel)),Q(3),_A("active",t.selectedDetailTab==="response"),H("matTooltip",zC(t.i18n.responseDetailsTabLabel)),Q(3),_A("active",t.selectedDetailTab==="metadata"),Q(3),_A("active",t.selectedDetailTab==="state"),Q(3),_A("active",t.selectedDetailTab==="raw"),Q(4),O(t.selectedDetailTab==="event"?28:-1),Q(),O(t.selectedDetailTab==="metadata"?29:-1),Q(),O(t.selectedDetailTab==="raw"?30:-1),Q(),O(t.selectedDetailTab==="state"?31:-1),Q(),O(t.selectedDetailTab==="graph"?32:-1),Q(),O(t.selectedDetailTab==="request"?33:-1),Q(),O(t.selectedDetailTab==="response"?34:-1))},dependencies:[qi,ki,yi,zt,pm,Es,rn,s2,hs,Gs,tg,fl,u1,gs,YN,bI],styles:["[_nghost-%COMP%]{display:block;height:100%}.json-viewer-container[_ngcontent-%COMP%]{margin:10px}.event-paginator[_ngcontent-%COMP%]{margin-right:auto;display:flex;justify-content:center;background-color:transparent}.event-paginator[_ngcontent-%COMP%] .mat-mdc-paginator-range-label{order:2;margin:0 0 0 8px}.event-details-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%}.event-details-content[_ngcontent-%COMP%]{display:flex;flex:1;overflow:hidden}.vertical-tabs-sidebar[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:48px;border-right:1px solid var(--mat-sys-outline-variant);padding-top:8px;align-items:center;gap:8px}.vertical-tabs-sidebar[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{border-radius:6px!important}.vertical-tabs-sidebar[_ngcontent-%COMP%] button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple, .vertical-tabs-sidebar[_ngcontent-%COMP%] button[_ngcontent-%COMP%] .mat-mdc-button-ripple, .vertical-tabs-sidebar[_ngcontent-%COMP%] button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple:before, .vertical-tabs-sidebar[_ngcontent-%COMP%] button[_ngcontent-%COMP%] .mat-mdc-focus-indicator{border-radius:6px!important}.vertical-tabs-sidebar[_ngcontent-%COMP%] button.active[_ngcontent-%COMP%]{background-color:var(--mat-sys-secondary-container)!important;color:var(--mat-sys-on-secondary-container)!important}.vertical-tabs-content[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;overflow:hidden;overflow-y:auto}.event-details-header[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:center;border-bottom:1px solid var(--mat-sys-outline-variant);height:48px;flex-shrink:0}.empty-state[_ngcontent-%COMP%]{padding:16px;text-align:center;color:var(--mat-sys-on-surface-variant);font-style:italic}.details-content[_ngcontent-%COMP%]{color:var(--side-panel-details-content-color);font-size:14px}.event-graph-wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;width:100%}.breadcrumb-container[_ngcontent-%COMP%]{display:flex;align-items:center;font-size:13px;color:var(--mat-sys-on-surface-variant);padding:8px 12px}.breadcrumb-container[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-weight:500;margin-right:8px;color:var(--mat-sys-on-surface)}.breadcrumb-container[_ngcontent-%COMP%] .breadcrumb-item[_ngcontent-%COMP%]{background:none;border:none;color:var(--mat-sys-primary);font-size:13px;padding:2px 4px}.breadcrumb-container[_ngcontent-%COMP%] .breadcrumb-item.active[_ngcontent-%COMP%]{font-weight:500;color:var(--mat-sys-on-surface)}.breadcrumb-container[_ngcontent-%COMP%] .breadcrumb-item[_ngcontent-%COMP%]:disabled{color:var(--mat-sys-on-surface);font-weight:500}.breadcrumb-container[_ngcontent-%COMP%] .breadcrumb-separator[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;display:flex;align-items:center;justify-content:center;color:var(--mat-sys-on-surface-variant);margin:0 4px}.graph-header[_ngcontent-%COMP%]{display:flex;align-items:center;font-size:13px;color:var(--mat-sys-on-surface-variant);background-color:var(--mat-sys-surface-container-lowest);padding:8px 16px;border-bottom:1px solid var(--mat-sys-outline-variant)}.graph-header[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-weight:500;margin-right:8px;color:var(--mat-sys-on-surface)}.event-graph-container[_ngcontent-%COMP%]{flex:1;overflow:hidden;padding:16px;position:relative}.fullscreen-graph-button[_ngcontent-%COMP%]{position:absolute;top:4px;right:4px;z-index:10;width:48px!important;height:48px!important;padding:0!important;display:flex!important;justify-content:center!important;align-items:center!important}.fullscreen-graph-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:28px!important;width:28px!important;height:28px!important;line-height:28px!important;margin:0!important;padding:0!important}.event-graph-container[_ngcontent-%COMP%] .svg-graph-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.event-graph-container[_ngcontent-%COMP%] svg{max-width:100%;max-height:100%;width:auto;height:auto;display:block}.event-graph-container[_ngcontent-%COMP%] svg>g.graph>polygon:first-child{fill:transparent!important}.request-response-loading-spinner-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;margin-top:2em}.request-response-empty-state[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;margin-top:2em;font-style:italic}.id-text[_ngcontent-%COMP%]{font-family:Google Sans Mono,monospace;font-size:12px}.id-cell[_ngcontent-%COMP%], .value-cell[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;overflow:hidden}.id-cell[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:first-child, .value-cell[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;flex:1}.id-cell[_ngcontent-%COMP%]:hover .copy-id-button[_ngcontent-%COMP%], .id-cell[_ngcontent-%COMP%]:hover .copy-value-button[_ngcontent-%COMP%], .value-cell[_ngcontent-%COMP%]:hover .copy-id-button[_ngcontent-%COMP%], .value-cell[_ngcontent-%COMP%]:hover .copy-value-button[_ngcontent-%COMP%]{opacity:1}.numeric-cell[_ngcontent-%COMP%]{text-align:right!important}.value-cell.numeric-cell[_ngcontent-%COMP%]{justify-content:flex-end}.value-cell.numeric-cell[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:first-child{text-align:right;font-family:Google Sans Mono,monospace;font-size:13px;font-weight:500;color:var(--mat-sys-on-surface)}.value-cell.numeric-cell[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:first-child span[_ngcontent-%COMP%]{font-family:Google Sans Mono,monospace}td.numeric-cell[_ngcontent-%COMP%]{text-align:right!important;font-family:Google Sans Mono,monospace!important;font-size:13px!important;font-weight:500!important;color:var(--mat-sys-on-surface)!important}.detail-row[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:center;gap:8px;margin-bottom:4px;font-size:12px;transition:transform .15s ease-in-out}.detail-row[_ngcontent-%COMP%]:hover{transform:translate(-2px)}.detail-row[_ngcontent-%COMP%]:last-child{margin-bottom:0}.detail-row[_ngcontent-%COMP%] .modality-label[_ngcontent-%COMP%]{font-size:10px;font-weight:600;letter-spacing:.5px;text-transform:uppercase;padding:2px 6px;border-radius:4px;color:var(--mat-sys-primary);background-color:var(--mat-sys-primary-container);opacity:.85}.detail-row[_ngcontent-%COMP%] .modality-value[_ngcontent-%COMP%]{font-weight:500;font-family:Google Sans Mono,monospace;color:var(--mat-sys-on-surface)}.copy-id-button[_ngcontent-%COMP%], .copy-value-button[_ngcontent-%COMP%]{width:28px!important;height:28px!important;padding:0!important;line-height:28px!important;flex-shrink:0;margin:-4px 0!important;opacity:0;transition:opacity .2s ease-in-out;border-radius:4px!important;overflow:hidden!important}.copy-id-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple, .copy-id-button[_ngcontent-%COMP%] .mat-mdc-button-ripple, .copy-id-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple:before, .copy-id-button[_ngcontent-%COMP%] .mat-mdc-focus-indicator, .copy-value-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple, .copy-value-button[_ngcontent-%COMP%] .mat-mdc-button-ripple, .copy-value-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple:before, .copy-value-button[_ngcontent-%COMP%] .mat-mdc-focus-indicator{border-radius:4px!important}.copy-id-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%], .copy-value-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;line-height:16px}.info-tables-container[_ngcontent-%COMP%]{padding:16px;overflow-y:auto;display:flex;flex-direction:column;gap:24px}.invocation-selector-button[_ngcontent-%COMP%] .mdc-button__label{width:100%;flex:1;overflow:hidden;text-overflow:ellipsis;display:flex;align-items:center;justify-content:space-between}.media-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;margin-top:8px;margin-bottom:12px}.generated-image-container[_ngcontent-%COMP%]{max-width:100%;border-radius:8px;overflow:hidden;box-shadow:0 2px 4px #0000001a;border:1px solid var(--mat-sys-outline-variant)}.generated-image-container[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:100%;height:auto;display:block}audio[_ngcontent-%COMP%], video[_ngcontent-%COMP%]{max-width:100%;border-radius:4px}.json-viewer-wrapper[_ngcontent-%COMP%]{position:relative}.json-viewer-wrapper[_ngcontent-%COMP%]:hover .floating-copy-button[_ngcontent-%COMP%]{opacity:1}.floating-copy-button[_ngcontent-%COMP%]{position:absolute;top:4px;right:4px;z-index:10;opacity:0;transition:opacity .2s ease-in-out;background-color:var(--mat-sys-surface-container-high)!important;border-radius:4px!important;overflow:hidden!important;width:28px!important;height:28px!important;line-height:28px!important;padding:0!important}.floating-copy-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple, .floating-copy-button[_ngcontent-%COMP%] .mat-mdc-button-ripple, .floating-copy-button[_ngcontent-%COMP%] .mat-mdc-button-persistent-ripple:before, .floating-copy-button[_ngcontent-%COMP%] .mat-mdc-focus-indicator{border-radius:4px!important}.floating-copy-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;line-height:16px}.floating-copy-button[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-secondary-container)!important;color:var(--mat-sys-on-secondary-container)!important}.state-change-card[_ngcontent-%COMP%]{border-radius:8px;padding:10px;display:flex;flex-direction:column;gap:8px}.state-change-header[_ngcontent-%COMP%]{font-weight:600;font-size:14px;color:var(--mat-sys-primary);padding-bottom:4px}.state-change-values[_ngcontent-%COMP%]{display:flex;gap:12px;flex-wrap:wrap}.state-value-block[_ngcontent-%COMP%]{flex:1;min-width:200px;background-color:var(--mat-sys-surface-container-highest);border-radius:6px;padding:8px;display:flex;flex-direction:column;gap:4px}.state-value-label[_ngcontent-%COMP%]{font-size:12px;font-weight:500;color:var(--mat-sys-on-surface-variant)}.state-value-content[_ngcontent-%COMP%]{font-family:Google Sans Mono,monospace;font-size:13px;color:var(--mat-sys-on-surface);word-break:break-all}"],changeDetection:0})};var Y7A=["evalTabContainer"];function H7A(i,e){}function z7A(i,e){i&1&&(I(0,"div",1),lA(1,"mat-progress-spinner",4),h())}function P7A(i,e){if(i&1&&(I(0,"span",11),D(1),h()),i&2){let A=p(2);Q(),nA(A.i18n.infoTabLabel)}}function j7A(i,e){if(i&1){let A=aA();I(0,"app-trace-tab",12),U("switchToEvent",function(n){L(A);let o=p(2);return G(o.switchToEvent.emit(n))}),h()}if(i&2){let A=p(2);H("traceData",A.traceData())}}function V7A(i,e){if(i&1){let A=aA();I(0,"app-event-tab",13),U("page",function(n){L(A);let o=p(2);return G(o.page.emit(n))})("closeSelectedEvent",function(){L(A);let n=p(2);return G(n.closeSelectedEvent.emit())})("openImageDialog",function(n){L(A);let o=p(2);return G(o.openImageDialog.emit(n))})("switchToTraceView",function(){L(A);let n=p(2);return G(n.switchToTraceView.emit())})("showAgentStructureGraph",function(n){L(A);let o=p(2);return G(o.showAgentStructureGraph.emit(n))})("drillDownNodePath",function(n){L(A);let o=p(2);return G(o.drillDownNodePath.emit(n))})("selectEventById",function(n){L(A);let o=p(2);return G(o.selectEventById.emit(n))})("jumpToInvocation",function(n){L(A);let o=p(2);return G(o.jumpToInvocation.emit(n))}),h()}if(i&2){let A=p(2);H("eventDataSize",A.eventData().size)("eventDataMap",A.eventData())("selectedEventIndex",A.selectedEventIndex())("selectedEvent",A.selectedEvent())("traceData",A.traceData())("filteredSelectedEvent",A.filteredSelectedEvent())("renderedEventGraph",A.renderedEventGraph())("rawSvgString",A.rawSvgString())("appName",A.appName())("selectedEventGraphPath",A.selectedEventGraphPath())("llmRequest",A.llmRequest())("llmResponse",A.llmResponse())("hasSubWorkflows",A.hasSubWorkflows())("graphsAvailable",A.graphsAvailable())("invocationDisplayMap",A.invocationDisplayMap())("forceGraphTab",A.forceGraphTab())("isViewOnlySession",A.isViewOnlySession())("isViewOnlyAppNameMismatch",A.isViewOnlyAppNameMismatch())}}function q7A(i,e){i&1&&(I(0,"div",9),D(1,"Select an event or trace span to view details"),h())}function W7A(i,e){if(i&1&&(I(0,"span",11),D(1),h()),i&2){let A=p(2);Q(),nA(A.i18n.stateTabLabel)}}function Z7A(i,e){if(i&1&&(I(0,"span",11),D(1),h()),i&2){let A=p(3);Q(),nA(A.i18n.artifactsTabLabel)}}function X7A(i,e){if(i&1&&(I(0,"mat-tab"),kt(1,Z7A,2,1,"ng-template",6),lA(2,"app-artifact-tab",14),h()),i&2){let A=p(2);Q(2),H("artifacts",A.artifacts())}}function $7A(i,e){if(i&1&&(I(0,"span",11),D(1),h()),i&2){let A=p(3);Q(),nA(A.i18n.testsTabLabel)}}function AMA(i,e){if(i&1){let A=aA();I(0,"mat-tab"),kt(1,$7A,2,1,"ng-template",6),I(2,"app-tests-tab",15),U("testSelected",function(n){L(A);let o=p(2);return G(o.testSelected.emit(n))}),h()()}if(i&2){let A=p(2);Q(2),H("appName",A.appName())("sessionId",A.sessionId())("userId",A.userId())("isViewOnlySession",A.isViewOnlySession())}}function eMA(i,e){if(i&1&&(I(0,"span",11),D(1),h()),i&2){let A=p(3);Q(),nA(A.i18n.evalTabLabel)}}function tMA(i,e){i&1&&(I(0,"mat-tab"),kt(1,eMA,2,1,"ng-template",6),dn(2,null,0),h())}function iMA(i,e){if(i&1){let A=aA();I(0,"div",2)(1,"mat-tab-group",5),Ni("selectedIndexChange",function(n){L(A);let o=p();return wi(o.selectedIndex,n)||(o.selectedIndex=n),G(n)}),U("selectedTabChange",function(n){L(A);let o=p();return G(o.onTabChange(n))}),I(2,"mat-tab"),kt(3,P7A,2,1,"ng-template",6),T(4,j7A,1,1,"app-trace-tab",7)(5,V7A,1,18,"app-event-tab",8)(6,q7A,2,0,"div",9),h(),I(7,"mat-tab"),kt(8,W7A,2,1,"ng-template",6),lA(9,"app-state-tab",10),h(),T(10,X7A,3,1,"mat-tab"),mt(11,"async"),T(12,AMA,3,4,"mat-tab"),mt(13,"async"),T(14,tMA,4,0,"mat-tab"),mt(15,"async"),h()()}if(i&2){let A=p(),t=Ki(2);H("hidden",t||!A.showSidePanel()),Q(),Ri("selectedIndex",A.selectedIndex),Q(3),O(A.selectedSpan()?4:A.selectedEvent()?5:6),Q(5),H("sessionState",A.currentSessionState()),Q(),O(Ft(11,7,A.isArtifactsTabEnabledObs)?10:-1),Q(2),O(Ft(13,9,A.isTestsEnabledObs)?12:-1),Q(2),O(Ft(15,11,A.isEvalEnabledObs)?14:-1)}}var xE=class i{Object=Object;appName=ve("");userId=ve("");sessionId=ve("");traceData=ve([]);eventData=ve(new Map);currentSessionState=ve();artifacts=ve([]);selectedEvent=ve();selectedEventIndex=ve();renderedEventGraph=ve();rawSvgString=ve(null);selectedEventGraphPath=ve("");llmRequest=ve();llmResponse=ve();showSidePanel=ve(!1);isApplicationSelectorEnabledObs=ve(oe(!1));isBuilderMode=ve(!1);disableBuilderIcon=ve(!1);hasSubWorkflows=ve(!1);graphsAvailable=ve(!0);invocationDisplayMap=ve(new Map);forceGraphTab=ve(!1);isViewOnlySession=ve(!1);isViewOnlyAppNameMismatch=ve(!1);closePanel=Si();tabChange=Si();sessionSelected=Si();sessionReloaded=Si();evalCaseSelected=Si();editEvalCaseRequested=Si();testSelected=Si();evalSetIdSelected=Si();returnToSession=Si();evalNotInstalled=Si();page=Si();switchToEvent=Si();closeSelectedEvent=Si();openImageDialog=Si();openAddItemDialog=Si();enterBuilderMode=Si();showAgentStructureGraph=Si();switchToTraceView=Si();drillDownNodePath=Si();selectEventById=Si();jumpToInvocation=Si();sessionTabComponent=void 0;evalTabComponent=Yo(Sc);evalTabContainer=Yo("evalTabContainer",{read:Jo});tabGroup=Yo(fE);logoComponent=w(wB,{optional:!0});i18n=w(_E);featureFlagService=w(Nr);evalTabComponentClass=w(My,{optional:!0});environmentInjector=w(Hr);uiStateService=w(ag);traceService=w(ng);selectedSpan=sr(this.traceService.selectedTraceRow$);selectedIndex=0;pendingEvalCaseSelection=mA(void 0);pendingEvalResultSelection=mA(void 0);evalTabRef=mA(null);constructor(){Fn(()=>{let e=this.selectedEvent(),A=this.selectedSpan(),t=this.tabGroup();(e||A)&&t&&t.selectedIndex!==0&&(this.selectedIndex=0)}),Fn(()=>{this.evalTabContainer()?this.initEvalTab():this.evalTabRef.set(null)}),Fn(()=>{let e=this.evalTabRef();e&&(e.setInput("appName",this.appName()),e.setInput("userId",this.userId()),e.setInput("sessionId",this.sessionId()))}),Fn(()=>{let e=this.evalTabRef(),A=this.pendingEvalCaseSelection();e&&A&&(e.instance.selectEvalSet(A.evalSetId),e.instance.selectedEvalTab.set("cases"),e.instance.selectedEvalCase.set(A.evalCase),this.pendingEvalCaseSelection.set(void 0))}),Fn(()=>{let e=this.evalTabRef(),A=this.pendingEvalResultSelection();e&&A&&(e.instance.selectEvalSet(A.evalSetId),e.instance.selectedHistoryRun.set(A.timestamp),A.evalCase?(e.instance.selectedEvalTab.set("cases"),e.instance.selectedEvalCase.set(A.evalCase)):e.instance.selectedEvalTab.set("history"),this.pendingEvalResultSelection.set(void 0))})}ngOnInit(){}onTabChange(e){this.tabChange.emit(e),this.selectedIndex=e.index}switchToEvalTab(){this.isEvalEnabledObs.pipe(oo()).subscribe(e=>{e&&JC([this.isArtifactsTabEnabledObs.pipe(oo()),this.isTestsEnabledObs.pipe(oo())]).subscribe(([A,t])=>{let n=2;A&&n++,t&&n++,this.selectedIndex=n})})}selectEvalCase(e,A){let t=this.evalTabComponent();t?(t.selectEvalSet(e),t.selectedEvalTab.set("cases"),t.selectedEvalCase.set(A)):this.pendingEvalCaseSelection.set({evalSetId:e,evalCase:A})}selectEvalResult(e,A,t){let n=this.evalTabComponent();n?(n.selectEvalSet(e),n.selectedHistoryRun.set(A),t?(n.selectedEvalTab.set("cases"),n.selectedEvalCase.set(t)):n.selectedEvalTab.set("history")):this.pendingEvalResultSelection.set({evalSetId:e,timestamp:A,evalCase:t})}isAlwaysOnSidePanelEnabledObs=this.featureFlagService.isAlwaysOnSidePanelEnabled();isTraceEnabledObs=this.featureFlagService.isTraceEnabled();isArtifactsTabEnabledObs=this.featureFlagService.isArtifactsTabEnabled();isEvalEnabledObs=this.featureFlagService.isEvalEnabled();isTestsEnabledObs=this.featureFlagService.isTestsEnabled();isTokenStreamingEnabledObs=this.featureFlagService.isTokenStreamingEnabled();isMessageFileUploadEnabledObs=this.featureFlagService.isMessageFileUploadEnabled();isManualStateUpdateEnabledObs=this.featureFlagService.isManualStateUpdateEnabled();isBidiStreamingEnabledObs=this.featureFlagService.isBidiStreamingEnabled;filteredSelectedEvent=ye(()=>this.selectedEvent());ngAfterViewInit(){}initEvalTab(){this.isEvalEnabledObs.pipe(oo()).subscribe(e=>{if(e){let A=this.evalTabContainer();if(!A)return;A.clear();let t=A.createComponent(this.evalTabComponentClass??Sc,{environmentInjector:this.environmentInjector});if(!t)return;t.instance.sessionSelected.subscribe(n=>{this.sessionSelected.emit(n)}),t.instance.evalCaseSelected.subscribe(n=>{this.evalCaseSelected.emit(n)}),t.instance.editEvalCaseRequested.subscribe(n=>{this.editEvalCaseRequested.emit(n)}),t.instance.evalSetIdSelected.subscribe(n=>{this.evalSetIdSelected.emit(n)}),t.instance.shouldReturnToSession.subscribe(n=>{this.returnToSession.emit(n)}),t.instance.evalNotInstalledMsg.subscribe(n=>{this.evalNotInstalled.emit(n)}),this.evalTabRef.set(t)}})}static \u0275fac=function(A){return new(A||i)};static \u0275cmp=vA({type:i,selectors:[["app-side-panel"]],viewQuery:function(A,t){A&1&&ls(t.evalTabComponent,Sc,5)(t.evalTabContainer,Y7A,5,Jo)(t.tabGroup,fE,5),A&2&&br(3)},inputs:{appName:[1,"appName"],userId:[1,"userId"],sessionId:[1,"sessionId"],traceData:[1,"traceData"],eventData:[1,"eventData"],currentSessionState:[1,"currentSessionState"],artifacts:[1,"artifacts"],selectedEvent:[1,"selectedEvent"],selectedEventIndex:[1,"selectedEventIndex"],renderedEventGraph:[1,"renderedEventGraph"],rawSvgString:[1,"rawSvgString"],selectedEventGraphPath:[1,"selectedEventGraphPath"],llmRequest:[1,"llmRequest"],llmResponse:[1,"llmResponse"],showSidePanel:[1,"showSidePanel"],isApplicationSelectorEnabledObs:[1,"isApplicationSelectorEnabledObs"],isBuilderMode:[1,"isBuilderMode"],disableBuilderIcon:[1,"disableBuilderIcon"],hasSubWorkflows:[1,"hasSubWorkflows"],graphsAvailable:[1,"graphsAvailable"],invocationDisplayMap:[1,"invocationDisplayMap"],forceGraphTab:[1,"forceGraphTab"],isViewOnlySession:[1,"isViewOnlySession"],isViewOnlyAppNameMismatch:[1,"isViewOnlyAppNameMismatch"]},outputs:{closePanel:"closePanel",tabChange:"tabChange",sessionSelected:"sessionSelected",sessionReloaded:"sessionReloaded",evalCaseSelected:"evalCaseSelected",editEvalCaseRequested:"editEvalCaseRequested",testSelected:"testSelected",evalSetIdSelected:"evalSetIdSelected",returnToSession:"returnToSession",evalNotInstalled:"evalNotInstalled",page:"page",switchToEvent:"switchToEvent",closeSelectedEvent:"closeSelectedEvent",openImageDialog:"openImageDialog",openAddItemDialog:"openAddItemDialog",enterBuilderMode:"enterBuilderMode",showAgentStructureGraph:"showAgentStructureGraph",switchToTraceView:"switchToTraceView",drillDownNodePath:"drillDownNodePath",selectEventById:"selectEventById",jumpToInvocation:"jumpToInvocation"},decls:7,vars:8,consts:[["evalTabContainer",""],[1,"loading-spinner-container"],[1,"tabs-container",3,"hidden"],[1,"resize-handler"],["mode","indeterminate","diameter","50"],["animationDuration","0ms",3,"selectedIndexChange","selectedTabChange","selectedIndex"],["mat-tab-label",""],[3,"traceData"],[3,"eventDataSize","eventDataMap","selectedEventIndex","selectedEvent","traceData","filteredSelectedEvent","renderedEventGraph","rawSvgString","appName","selectedEventGraphPath","llmRequest","llmResponse","hasSubWorkflows","graphsAvailable","invocationDisplayMap","forceGraphTab","isViewOnlySession","isViewOnlyAppNameMismatch"],[1,"empty-state"],[3,"sessionState"],[1,"tab-label"],[3,"switchToEvent","traceData"],[3,"page","closeSelectedEvent","openImageDialog","switchToTraceView","showAgentStructureGraph","drillDownNodePath","selectEventById","jumpToInvocation","eventDataSize","eventDataMap","selectedEventIndex","selectedEvent","traceData","filteredSelectedEvent","renderedEventGraph","rawSvgString","appName","selectedEventGraphPath","llmRequest","llmResponse","hasSubWorkflows","graphsAvailable","invocationDisplayMap","forceGraphTab","isViewOnlySession","isViewOnlyAppNameMismatch"],[3,"artifacts"],[3,"testSelected","appName","sessionId","userId","isViewOnlySession"]],template:function(A,t){if(A&1&&(T(0,H7A,0,0),mt(1,"async"),ro(2),mt(3,"async"),T(4,z7A,2,0,"div",1),T(5,iMA,16,13,"div",2),lA(6,"div",3)),A&2){O(Ft(1,3,t.isAlwaysOnSidePanelEnabledObs)===!1?0:-1),Q(2);let n=so(Ft(3,5,t.uiStateService.isSessionLoading()));Q(2),O(n?4:-1),Q(),O(t.appName()!=""?5:-1)}},dependencies:[fE,bp,vp,xy,_y,d6,Ry,Es,ky,gs],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;position:relative}.drawer-header-wrapper[_ngcontent-%COMP%]{display:flex;height:48px;align-items:center;padding-left:20px}.drawer-header[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:space-between;align-items:center}.tabs-container[_ngcontent-%COMP%]{width:100%;flex:1;overflow:hidden;display:flex;flex-direction:column}.tab-label[_ngcontent-%COMP%]{font-size:14px}.resize-handler[_ngcontent-%COMP%]{width:6px;border-radius:4px;position:absolute;display:block;top:20px;bottom:20px;right:0;z-index:100;cursor:ew-resize}.resize-handler[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-outline-variant)}.empty-state[_ngcontent-%COMP%]{padding:16px;text-align:center;color:var(--mat-sys-on-surface-variant);font-style:italic}mat-tab-group[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;min-height:0}mat-tab-group[_ngcontent-%COMP%] .mdc-tab{padding:0 12px;min-width:48px} .mat-mdc-tab-body-wrapper{flex:1;min-height:0} .mat-mdc-tab-body-wrapper .mat-mdc-tab-body-content{overflow-x:hidden}.drawer-logo[_ngcontent-%COMP%]{margin-left:9px;display:flex;align-items:center}.drawer-logo[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{margin-right:6px}.drawer-logo[_ngcontent-%COMP%]{font-size:14px;font-style:normal;font-weight:500;line-height:20px;letter-spacing:.1px}.drawer-header-left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.panel-toggle-icon[_ngcontent-%COMP%]{font-size:20px;width:24px;height:24px;color:var(--side-panel-mat-icon-color, #c4c7c5);cursor:pointer;display:flex;align-items:center;justify-content:center}.powered-by-adk[_ngcontent-%COMP%]{font-size:10px;color:var(--side-panel-powered-by-adk-color);text-align:right;margin-top:-5px}.adk-info-icon[_ngcontent-%COMP%]{font-size:14px;color:var(--side-panel-mat-icon-color, #bdc1c6);cursor:pointer;margin-left:4px;vertical-align:middle}.mode-toggle-container[_ngcontent-%COMP%]{display:flex;align-items:center}.build-mode-button[_ngcontent-%COMP%]{margin:0 4px}.app-actions[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}.loading-spinner-container[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;height:100%}@media(max-width:768px){.resize-handler[_ngcontent-%COMP%]{display:none!important}.tab-label[_ngcontent-%COMP%]{font-size:12px!important} .mdc-tab{padding:0 8px!important}}"]})};var nMA=["editInput"];function oMA(i,e){if(i&1){let A=aA();I(0,"button",5),U("click",function(){L(A);let n=p();return G(n.startEdit())}),I(1,"mat-icon"),D(2,"edit"),h()()}}function aMA(i,e){if(i&1){let A=aA();I(0,"button",6),U("click",function(){L(A);let n=p();return G(n.saveEdit())}),I(1,"mat-icon"),D(2,"check"),h()(),I(3,"button",7),U("click",function(){L(A);let n=p();return G(n.cancelEdit())}),I(4,"mat-icon"),D(5,"close"),h()()}}var Ny=class i{value="";displayValue="";tooltip="";placeholder="";textClass="";save=new FA;isEditing=!1;draftValue="";editInput;startEdit(){this.draftValue=this.value,this.isEditing=!0,setTimeout(()=>{this.editInput.nativeElement.focus()})}cancelEdit(){this.isEditing=!1,this.draftValue=""}saveEdit(){this.save.emit(this.draftValue),this.isEditing=!1}handleKeydown(e){e.key==="Enter"?this.saveEdit():e.key==="Escape"&&this.cancelEdit()}get effectiveDisplayValue(){return this.displayValue||this.value}static \u0275fac=function(A){return new(A||i)};static \u0275cmp=vA({type:i,selectors:[["app-inline-edit"]],viewQuery:function(A,t){if(A&1&&Wt(nMA,5),A&2){let n;se(n=le())&&(t.editInput=n.first)}},inputs:{value:"value",displayValue:"displayValue",tooltip:"tooltip",placeholder:"placeholder",textClass:"textClass"},outputs:{save:"save"},decls:6,vars:10,consts:[["editInput",""],[1,"inline-edit-container"],[1,"inline-edit-text-wrapper"],[1,"inline-edit-input",3,"ngModelChange","keydown","readonly","ngClass","matTooltip","ngModel"],["mat-icon-button","","aria-label","Edit",1,"inline-edit-action-button"],["mat-icon-button","","aria-label","Edit",1,"inline-edit-action-button",3,"click"],["mat-icon-button","","aria-label","Save",1,"inline-edit-action-button",3,"click"],["mat-icon-button","","aria-label","Cancel",1,"inline-edit-action-button",3,"click"]],template:function(A,t){A&1&&(I(0,"div",1)(1,"div",2)(2,"input",3,0),U("ngModelChange",function(o){return t.draftValue=o})("keydown",function(o){return t.handleKeydown(o)}),h()(),T(4,oMA,3,0,"button",4)(5,aMA,6,0),h()),A&2&&(Q(2),_A("readonly",!t.isEditing),H("readonly",!t.isEditing)("ngClass",t.textClass)("matTooltip",t.isEditing?"":t.tooltip)("ngModel",t.isEditing?t.draftValue:t.effectiveDisplayValue),ie("placeholder",t.isEditing?t.placeholder:"")("aria-label",t.placeholder)("size",((t.isEditing?t.draftValue:t.effectiveDisplayValue)==null?null:(t.isEditing?t.draftValue:t.effectiveDisplayValue).length)||1),Q(2),O(t.isEditing?5:4))},dependencies:[li,Vl,fn,Gn,Kn,Ho,qi,yi,Un,zt,Ha,rn],styles:["[_nghost-%COMP%]{display:block;max-width:100%;min-width:0;width:100%}.inline-edit-container[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;width:100%;max-width:100%;min-width:0;box-sizing:border-box}.inline-edit-text-wrapper[_ngcontent-%COMP%]{flex:0 1 auto;min-width:0;display:flex;align-items:center}.inline-edit-input[_ngcontent-%COMP%]{min-width:48px;max-width:100%;padding:2px 6px;margin:-3px -7px;border:1px solid var(--chat-toolbar-session-text-color, #ccc);border-radius:4px;color:var(--chat-toolbar-session-id-color, inherit);font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;background:transparent;field-sizing:content;transition:all .2s ease}.inline-edit-input[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--primary-color, #1a73e8)}.inline-edit-input.readonly[_ngcontent-%COMP%]{min-width:0;border-color:transparent;cursor:inherit}.inline-edit-input.readonly[_ngcontent-%COMP%]:focus{outline:none;border-color:transparent}.inline-edit-action-button[_ngcontent-%COMP%]{flex-shrink:0;width:28px!important;height:28px!important;padding:0!important;display:flex;align-items:center;justify-content:center}.inline-edit-action-button[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;line-height:16px}"]})};var rMA={openPanelTooltip:"Open panel",retrieveLatestSessionTooltip:"Retrieve latest session and show",evalCaseIdLabel:"Eval Case ID",cancelButton:"Cancel",saveButton:"Save",editEvalCaseTooltip:"Edit current eval case",deleteEvalCaseTooltip:"Delete current eval case",sessionIdLabel:"Session",copySessionIdTooltip:"Copy session ID",sessionIdCopiedMessage:"Session ID copied",copySessionIdFailedMessage:"Failed to copy session ID",userIdLabel:"User ID",editUserIdTooltip:"Edit user ID",userIdInputPlaceholder:"Enter user ID",saveUserIdTooltip:"Save user ID",cancelUserIdEditTooltip:"Cancel editing user ID",invalidUserIdMessage:"User ID cannot be empty",loadingSessionLabel:"Loading session...",tokenStreamingLabel:"Token Streaming",moreOptionsTooltip:"More options",createNewSessionTooltip:"Create a new Session",newSessionButton:"New Session",deleteSessionTooltip:"Delete session",exportSessionTooltip:"Export session",importSessionTooltip:"Import session",viewSessionTooltip:"View session",loadingAgentsLabel:"Loading agents, please wait...",welcomeMessage:"Welcome to ADK!",selectAgentMessage:"Select an agent to begin.",failedToLoadAgentsMessage:"Failed to load agents. To get started, run",errorMessageLabel:"Error message:",noAgentsFoundWarning:"Warning: No agents found in current folder.",cannotEditSessionMessage:"Chat is disabled to prevent changes to the end user's session.",viewSessionReadOnlyMessage:'This is a read-only view of a session file. Use "Import Session" if you want to continue this session.',readOnlyBadgeLabel:"Read-only"},h$=new MA("Chat Messages",{factory:()=>rMA});var XA={};cAA(XA,{BRAND:()=>RMA,DIRTY:()=>II,EMPTY_PATH:()=>cMA,INVALID:()=>hi,NEVER:()=>E9A,OK:()=>Ss,ParseStatus:()=>rs,Schema:()=>hn,ZodAny:()=>Gy,ZodArray:()=>Gp,ZodBigInt:()=>GR,ZodBoolean:()=>KR,ZodBranded:()=>Kp,ZodCatch:()=>VR,ZodDate:()=>UR,ZodDefault:()=>jR,ZodDiscriminatedUnion:()=>Ky,ZodEffects:()=>KE,ZodEnum:()=>Jy,ZodError:()=>x0,ZodFirstPartyTypeKind:()=>_i,ZodFunction:()=>Ty,ZodIntersection:()=>YR,ZodIssueCode:()=>Ne,ZodLazy:()=>HR,ZodLiteral:()=>zR,ZodMap:()=>v$,ZodNaN:()=>S$,ZodNativeEnum:()=>PR,ZodNever:()=>BI,ZodNull:()=>OR,ZodNullable:()=>UE,ZodNumber:()=>LR,ZodObject:()=>LE,ZodOptional:()=>f1,ZodParsedType:()=>ht,ZodPipeline:()=>Up,ZodPromise:()=>Yy,ZodReadonly:()=>qR,ZodRecord:()=>Uy,ZodSchema:()=>hn,ZodSet:()=>b$,ZodString:()=>Oy,ZodSymbol:()=>y$,ZodTransformer:()=>KE,ZodTuple:()=>GE,ZodType:()=>hn,ZodUndefined:()=>TR,ZodUnion:()=>JR,ZodUnknown:()=>Lp,ZodVoid:()=>D$,addIssueToContext:()=>ot,any:()=>JMA,array:()=>PMA,bigint:()=>GMA,boolean:()=>R$,coerce:()=>h9A,custom:()=>k$,date:()=>KMA,datetimeRegex:()=>w$,defaultErrorMap:()=>TC,discriminatedUnion:()=>WMA,effect:()=>s9A,enum:()=>o9A,function:()=>t9A,getErrorMap:()=>RE,getParsedType:()=>_0,instanceof:()=>FMA,intersection:()=>ZMA,isAborted:()=>Fy,isAsync:()=>NE,isDirty:()=>Ly,isValid:()=>p1,late:()=>NMA,lazy:()=>i9A,literal:()=>n9A,makeIssue:()=>Fp,map:()=>A9A,nan:()=>LMA,nativeEnum:()=>a9A,never:()=>HMA,null:()=>OMA,nullable:()=>g9A,number:()=>x$,object:()=>jMA,objectUtil:()=>E$,oboolean:()=>B9A,onumber:()=>I9A,optional:()=>l9A,ostring:()=>d9A,pipeline:()=>C9A,preprocess:()=>c9A,promise:()=>r9A,quotelessJson:()=>sMA,record:()=>$MA,set:()=>e9A,setErrorMap:()=>gMA,strictObject:()=>VMA,string:()=>_$,symbol:()=>UMA,transformer:()=>s9A,tuple:()=>XMA,undefined:()=>TMA,union:()=>qMA,unknown:()=>YMA,util:()=>Mn,void:()=>zMA});var Mn;(function(i){i.assertEqual=n=>{};function e(n){}i.assertIs=e;function A(n){throw new Error}i.assertNever=A,i.arrayToEnum=n=>{let o={};for(let a of n)o[a]=a;return o},i.getValidEnumValues=n=>{let o=i.objectKeys(n).filter(r=>typeof n[n[r]]!="number"),a={};for(let r of o)a[r]=n[r];return i.objectValues(a)},i.objectValues=n=>i.objectKeys(n).map(function(o){return n[o]}),i.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let o=[];for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&o.push(a);return o},i.find=(n,o)=>{for(let a of n)if(o(a))return a},i.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function t(n,o=" | "){return n.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}i.joinValues=t,i.jsonStringifyReplacer=(n,o)=>typeof o=="bigint"?o.toString():o})(Mn||(Mn={}));var E$=(function(i){return i.mergeShapes=(e,A)=>P(P({},e),A),i})(E$||{}),ht=Mn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_0=i=>{switch(typeof i){case"undefined":return ht.undefined;case"string":return ht.string;case"number":return Number.isNaN(i)?ht.nan:ht.number;case"boolean":return ht.boolean;case"function":return ht.function;case"bigint":return ht.bigint;case"symbol":return ht.symbol;case"object":return Array.isArray(i)?ht.array:i===null?ht.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?ht.promise:typeof Map<"u"&&i instanceof Map?ht.map:typeof Set<"u"&&i instanceof Set?ht.set:typeof Date<"u"&&i instanceof Date?ht.date:ht.object;default:return ht.unknown}};var Ne=Mn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),sMA=i=>JSON.stringify(i,null,2).replace(/"([^"]+)":/g,"$1:"),x0=(()=>{class i extends Error{get errors(){return this.issues}constructor(A){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=A}format(A){let t=A||function(a){return a.message},n={_errors:[]},o=a=>{for(let r of a.issues)if(r.code==="invalid_union")r.unionErrors.map(o);else if(r.code==="invalid_return_type")o(r.returnTypeError);else if(r.code==="invalid_arguments")o(r.argumentsError);else if(r.path.length===0)n._errors.push(t(r));else{let s=n,l=0;for(;lt.message){let t={},n=[];for(let o of this.issues)if(o.path.length>0){let a=o.path[0];t[a]=t[a]||[],t[a].push(A(o))}else n.push(A(o));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}return i.create=e=>new i(e),i})();var lMA=(i,e)=>{let A;switch(i.code){case Ne.invalid_type:i.received===ht.undefined?A="Required":A=`Expected ${i.expected}, received ${i.received}`;break;case Ne.invalid_literal:A=`Invalid literal value, expected ${JSON.stringify(i.expected,Mn.jsonStringifyReplacer)}`;break;case Ne.unrecognized_keys:A=`Unrecognized key(s) in object: ${Mn.joinValues(i.keys,", ")}`;break;case Ne.invalid_union:A="Invalid input";break;case Ne.invalid_union_discriminator:A=`Invalid discriminator value. Expected ${Mn.joinValues(i.options)}`;break;case Ne.invalid_enum_value:A=`Invalid enum value. Expected ${Mn.joinValues(i.options)}, received '${i.received}'`;break;case Ne.invalid_arguments:A="Invalid function arguments";break;case Ne.invalid_return_type:A="Invalid function return type";break;case Ne.invalid_date:A="Invalid date";break;case Ne.invalid_string:typeof i.validation=="object"?"includes"in i.validation?(A=`Invalid input: must include "${i.validation.includes}"`,typeof i.validation.position=="number"&&(A=`${A} at one or more positions greater than or equal to ${i.validation.position}`)):"startsWith"in i.validation?A=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?A=`Invalid input: must end with "${i.validation.endsWith}"`:Mn.assertNever(i.validation):i.validation!=="regex"?A=`Invalid ${i.validation}`:A="Invalid";break;case Ne.too_small:i.type==="array"?A=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?A=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?A=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="bigint"?A=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?A=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(i.minimum))}`:A="Invalid input";break;case Ne.too_big:i.type==="array"?A=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?A=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?A=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="bigint"?A=`BigInt must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?A=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(i.maximum))}`:A="Invalid input";break;case Ne.custom:A="Invalid input";break;case Ne.invalid_intersection_types:A="Intersection results could not be merged";break;case Ne.not_multiple_of:A=`Number must be a multiple of ${i.multipleOf}`;break;case Ne.not_finite:A="Number must be finite";break;default:A=e.defaultError,Mn.assertNever(i)}return{message:A}},TC=lMA;var Q$=TC;function gMA(i){Q$=i}function RE(){return Q$}var Fp=i=>{let{data:e,path:A,errorMaps:t,issueData:n}=i,o=[...A,...n.path||[]],a=$A(P({},n),{path:o});if(n.message!==void 0)return $A(P({},n),{path:o,message:n.message});let r="",s=t.filter(l=>!!l).slice().reverse();for(let l of s)r=l(a,{data:e,defaultError:r}).message;return $A(P({},n),{path:o,message:r})},cMA=[];function ot(i,e){let A=RE(),t=Fp({issueData:e,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,A,A===TC?void 0:TC].filter(n=>!!n)});i.common.issues.push(t)}var rs=class i{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,A){let t=[];for(let n of A){if(n.status==="aborted")return hi;n.status==="dirty"&&e.dirty(),t.push(n.value)}return{status:e.value,value:t}}static mergeObjectAsync(e,A){return re(this,null,function*(){let t=[];for(let n of A){let o=yield n.key,a=yield n.value;t.push({key:o,value:a})}return i.mergeObjectSync(e,t)})}static mergeObjectSync(e,A){let t={};for(let n of A){let{key:o,value:a}=n;if(o.status==="aborted"||a.status==="aborted")return hi;o.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||n.alwaysSet)&&(t[o.value]=a.value)}return{status:e.value,value:t}}},hi=Object.freeze({status:"aborted"}),II=i=>({status:"dirty",value:i}),Ss=i=>({status:"valid",value:i}),Fy=i=>i.status==="aborted",Ly=i=>i.status==="dirty",p1=i=>i.status==="valid",NE=i=>typeof Promise<"u"&&i instanceof Promise;var Kt=(function(i){return i.errToObj=e=>typeof e=="string"?{message:e}:e||{},i.toString=e=>typeof e=="string"?e:e?.message,i})(Kt||{});var Mg=class{constructor(e,A,t,n){this._cachedPath=[],this.parent=e,this.data=A,this._path=t,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},u$=(i,e)=>{if(p1(e))return{success:!0,data:e.value};if(!i.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let A=new x0(i.common.issues);return this._error=A,this._error}}};function tn(i){if(!i)return{};let{errorMap:e,invalid_type_error:A,required_error:t,description:n}=i;if(e&&(A||t))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(a,r)=>{let{message:s}=i;return a.code==="invalid_enum_value"?{message:s??r.defaultError}:typeof r.data>"u"?{message:s??t??r.defaultError}:a.code!=="invalid_type"?{message:r.defaultError}:{message:s??A??r.defaultError}},description:n}}var hn=class{get description(){return this._def.description}_getType(e){return _0(e.data)}_getOrReturnCtx(e,A){return A||{common:e.parent.common,data:e.data,parsedType:_0(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new rs,ctx:{common:e.parent.common,data:e.data,parsedType:_0(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let A=this._parse(e);if(NE(A))throw new Error("Synchronous parse encountered promise.");return A}_parseAsync(e){let A=this._parse(e);return Promise.resolve(A)}parse(e,A){let t=this.safeParse(e,A);if(t.success)return t.data;throw t.error}safeParse(e,A){let t={common:{issues:[],async:A?.async??!1,contextualErrorMap:A?.errorMap},path:A?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_0(e)},n=this._parseSync({data:e,path:t.path,parent:t});return u$(t,n)}"~validate"(e){let A={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_0(e)};if(!this["~standard"].async)try{let t=this._parseSync({data:e,path:[],parent:A});return p1(t)?{value:t.value}:{issues:A.common.issues}}catch(t){t?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),A.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:A}).then(t=>p1(t)?{value:t.value}:{issues:A.common.issues})}parseAsync(e,A){return re(this,null,function*(){let t=yield this.safeParseAsync(e,A);if(t.success)return t.data;throw t.error})}safeParseAsync(e,A){return re(this,null,function*(){let t={common:{issues:[],contextualErrorMap:A?.errorMap,async:!0},path:A?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_0(e)},n=this._parse({data:e,path:t.path,parent:t}),o=yield NE(n)?n:Promise.resolve(n);return u$(t,o)})}refine(e,A){let t=n=>typeof A=="string"||typeof A>"u"?{message:A}:typeof A=="function"?A(n):A;return this._refinement((n,o)=>{let a=e(n),r=()=>o.addIssue(P({code:Ne.custom},t(n)));return typeof Promise<"u"&&a instanceof Promise?a.then(s=>s?!0:(r(),!1)):a?!0:(r(),!1)})}refinement(e,A){return this._refinement((t,n)=>e(t)?!0:(n.addIssue(typeof A=="function"?A(t,n):A),!1))}_refinement(e){return new KE({schema:this,typeName:_i.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:A=>this["~validate"](A)}}optional(){return f1.create(this,this._def)}nullable(){return UE.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Gp.create(this)}promise(){return Yy.create(this,this._def)}or(e){return JR.create([this,e],this._def)}and(e){return YR.create(this,e,this._def)}transform(e){return new KE($A(P({},tn(this._def)),{schema:this,typeName:_i.ZodEffects,effect:{type:"transform",transform:e}}))}default(e){let A=typeof e=="function"?e:()=>e;return new jR($A(P({},tn(this._def)),{innerType:this,defaultValue:A,typeName:_i.ZodDefault}))}brand(){return new Kp(P({typeName:_i.ZodBranded,type:this},tn(this._def)))}catch(e){let A=typeof e=="function"?e:()=>e;return new VR($A(P({},tn(this._def)),{innerType:this,catchValue:A,typeName:_i.ZodCatch}))}describe(e){let A=this.constructor;return new A($A(P({},this._def),{description:e}))}pipe(e){return Up.create(this,e)}readonly(){return qR.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},CMA=/^c[^\s-]{8,}$/i,dMA=/^[0-9a-z]+$/,IMA=/^[0-9A-HJKMNP-TV-Z]{26}$/i,BMA=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,hMA=/^[a-z0-9_-]{21}$/i,EMA=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,QMA=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,uMA=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,pMA="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",NR,fMA=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,mMA=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,wMA=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,yMA=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,DMA=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,vMA=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,f$="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",bMA=new RegExp(`^${f$}$`);function m$(i){let e="[0-5]\\d";i.precision?e=`${e}\\.\\d{${i.precision}}`:i.precision==null&&(e=`${e}(\\.\\d+)?`);let A=i.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${A}`}function MMA(i){return new RegExp(`^${m$(i)}$`)}function w$(i){let e=`${f$}T${m$(i)}`,A=[];return A.push(i.local?"Z?":"Z"),i.offset&&A.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${A.join("|")})`,new RegExp(`^${e}$`)}function SMA(i,e){return!!((e==="v4"||!e)&&fMA.test(i)||(e==="v6"||!e)&&wMA.test(i))}function kMA(i,e){if(!EMA.test(i))return!1;try{let[A]=i.split(".");if(!A)return!1;let t=A.replace(/-/g,"+").replace(/_/g,"/").padEnd(A.length+(4-A.length%4)%4,"="),n=JSON.parse(atob(t));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||e&&n.alg!==e)}catch(A){return!1}}function _MA(i,e){return!!((e==="v4"||!e)&&mMA.test(i)||(e==="v6"||!e)&&yMA.test(i))}var Oy=(()=>{class i extends hn{_parse(A){if(this._def.coerce&&(A.data=String(A.data)),this._getType(A)!==ht.string){let a=this._getOrReturnCtx(A);return ot(a,{code:Ne.invalid_type,expected:ht.string,received:a.parsedType}),hi}let n=new rs,o;for(let a of this._def.checks)if(a.kind==="min")A.data.lengtha.value&&(o=this._getOrReturnCtx(A,o),ot(o,{code:Ne.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let r=A.data.length>a.value,s=A.data.lengthA.test(o),P({validation:t,code:Ne.invalid_string},Kt.errToObj(n)))}_addCheck(A){return new i($A(P({},this._def),{checks:[...this._def.checks,A]}))}email(A){return this._addCheck(P({kind:"email"},Kt.errToObj(A)))}url(A){return this._addCheck(P({kind:"url"},Kt.errToObj(A)))}emoji(A){return this._addCheck(P({kind:"emoji"},Kt.errToObj(A)))}uuid(A){return this._addCheck(P({kind:"uuid"},Kt.errToObj(A)))}nanoid(A){return this._addCheck(P({kind:"nanoid"},Kt.errToObj(A)))}cuid(A){return this._addCheck(P({kind:"cuid"},Kt.errToObj(A)))}cuid2(A){return this._addCheck(P({kind:"cuid2"},Kt.errToObj(A)))}ulid(A){return this._addCheck(P({kind:"ulid"},Kt.errToObj(A)))}base64(A){return this._addCheck(P({kind:"base64"},Kt.errToObj(A)))}base64url(A){return this._addCheck(P({kind:"base64url"},Kt.errToObj(A)))}jwt(A){return this._addCheck(P({kind:"jwt"},Kt.errToObj(A)))}ip(A){return this._addCheck(P({kind:"ip"},Kt.errToObj(A)))}cidr(A){return this._addCheck(P({kind:"cidr"},Kt.errToObj(A)))}datetime(A){return typeof A=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:A}):this._addCheck(P({kind:"datetime",precision:typeof A?.precision>"u"?null:A?.precision,offset:A?.offset??!1,local:A?.local??!1},Kt.errToObj(A?.message)))}date(A){return this._addCheck({kind:"date",message:A})}time(A){return typeof A=="string"?this._addCheck({kind:"time",precision:null,message:A}):this._addCheck(P({kind:"time",precision:typeof A?.precision>"u"?null:A?.precision},Kt.errToObj(A?.message)))}duration(A){return this._addCheck(P({kind:"duration"},Kt.errToObj(A)))}regex(A,t){return this._addCheck(P({kind:"regex",regex:A},Kt.errToObj(t)))}includes(A,t){return this._addCheck(P({kind:"includes",value:A,position:t?.position},Kt.errToObj(t?.message)))}startsWith(A,t){return this._addCheck(P({kind:"startsWith",value:A},Kt.errToObj(t)))}endsWith(A,t){return this._addCheck(P({kind:"endsWith",value:A},Kt.errToObj(t)))}min(A,t){return this._addCheck(P({kind:"min",value:A},Kt.errToObj(t)))}max(A,t){return this._addCheck(P({kind:"max",value:A},Kt.errToObj(t)))}length(A,t){return this._addCheck(P({kind:"length",value:A},Kt.errToObj(t)))}nonempty(A){return this.min(1,Kt.errToObj(A))}trim(){return new i($A(P({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new i($A(P({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new i($A(P({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(A=>A.kind==="datetime")}get isDate(){return!!this._def.checks.find(A=>A.kind==="date")}get isTime(){return!!this._def.checks.find(A=>A.kind==="time")}get isDuration(){return!!this._def.checks.find(A=>A.kind==="duration")}get isEmail(){return!!this._def.checks.find(A=>A.kind==="email")}get isURL(){return!!this._def.checks.find(A=>A.kind==="url")}get isEmoji(){return!!this._def.checks.find(A=>A.kind==="emoji")}get isUUID(){return!!this._def.checks.find(A=>A.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(A=>A.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(A=>A.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(A=>A.kind==="cuid2")}get isULID(){return!!this._def.checks.find(A=>A.kind==="ulid")}get isIP(){return!!this._def.checks.find(A=>A.kind==="ip")}get isCIDR(){return!!this._def.checks.find(A=>A.kind==="cidr")}get isBase64(){return!!this._def.checks.find(A=>A.kind==="base64")}get isBase64url(){return!!this._def.checks.find(A=>A.kind==="base64url")}get minLength(){let A=null;for(let t of this._def.checks)t.kind==="min"&&(A===null||t.value>A)&&(A=t.value);return A}get maxLength(){let A=null;for(let t of this._def.checks)t.kind==="max"&&(A===null||t.valuenew i(P({checks:[],typeName:_i.ZodString,coerce:e?.coerce??!1},tn(e))),i})();function xMA(i,e){let A=(i.toString().split(".")[1]||"").length,t=(e.toString().split(".")[1]||"").length,n=A>t?A:t,o=Number.parseInt(i.toFixed(n).replace(".","")),a=Number.parseInt(e.toFixed(n).replace(".",""));return o%a/10**n}var LR=(()=>{class i extends hn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(A){if(this._def.coerce&&(A.data=Number(A.data)),this._getType(A)!==ht.number){let a=this._getOrReturnCtx(A);return ot(a,{code:Ne.invalid_type,expected:ht.number,received:a.parsedType}),hi}let n,o=new rs;for(let a of this._def.checks)a.kind==="int"?Mn.isInteger(A.data)||(n=this._getOrReturnCtx(A,n),ot(n,{code:Ne.invalid_type,expected:"integer",received:"float",message:a.message}),o.dirty()):a.kind==="min"?(a.inclusive?A.dataa.value:A.data>=a.value)&&(n=this._getOrReturnCtx(A,n),ot(n,{code:Ne.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="multipleOf"?xMA(A.data,a.value)!==0&&(n=this._getOrReturnCtx(A,n),ot(n,{code:Ne.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):a.kind==="finite"?Number.isFinite(A.data)||(n=this._getOrReturnCtx(A,n),ot(n,{code:Ne.not_finite,message:a.message}),o.dirty()):Mn.assertNever(a);return{status:o.value,value:A.data}}gte(A,t){return this.setLimit("min",A,!0,Kt.toString(t))}gt(A,t){return this.setLimit("min",A,!1,Kt.toString(t))}lte(A,t){return this.setLimit("max",A,!0,Kt.toString(t))}lt(A,t){return this.setLimit("max",A,!1,Kt.toString(t))}setLimit(A,t,n,o){return new i($A(P({},this._def),{checks:[...this._def.checks,{kind:A,value:t,inclusive:n,message:Kt.toString(o)}]}))}_addCheck(A){return new i($A(P({},this._def),{checks:[...this._def.checks,A]}))}int(A){return this._addCheck({kind:"int",message:Kt.toString(A)})}positive(A){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Kt.toString(A)})}negative(A){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Kt.toString(A)})}nonpositive(A){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Kt.toString(A)})}nonnegative(A){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Kt.toString(A)})}multipleOf(A,t){return this._addCheck({kind:"multipleOf",value:A,message:Kt.toString(t)})}finite(A){return this._addCheck({kind:"finite",message:Kt.toString(A)})}safe(A){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Kt.toString(A)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Kt.toString(A)})}get minValue(){let A=null;for(let t of this._def.checks)t.kind==="min"&&(A===null||t.value>A)&&(A=t.value);return A}get maxValue(){let A=null;for(let t of this._def.checks)t.kind==="max"&&(A===null||t.valueA.kind==="int"||A.kind==="multipleOf"&&Mn.isInteger(A.value))}get isFinite(){let A=null,t=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(A===null||n.valuenew i(P({checks:[],typeName:_i.ZodNumber,coerce:e?.coerce||!1},tn(e))),i})(),GR=(()=>{class i extends hn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(A){if(this._def.coerce)try{A.data=BigInt(A.data)}catch(a){return this._getInvalidInput(A)}if(this._getType(A)!==ht.bigint)return this._getInvalidInput(A);let n,o=new rs;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?A.dataa.value:A.data>=a.value)&&(n=this._getOrReturnCtx(A,n),ot(n,{code:Ne.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="multipleOf"?A.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(A,n),ot(n,{code:Ne.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):Mn.assertNever(a);return{status:o.value,value:A.data}}_getInvalidInput(A){let t=this._getOrReturnCtx(A);return ot(t,{code:Ne.invalid_type,expected:ht.bigint,received:t.parsedType}),hi}gte(A,t){return this.setLimit("min",A,!0,Kt.toString(t))}gt(A,t){return this.setLimit("min",A,!1,Kt.toString(t))}lte(A,t){return this.setLimit("max",A,!0,Kt.toString(t))}lt(A,t){return this.setLimit("max",A,!1,Kt.toString(t))}setLimit(A,t,n,o){return new i($A(P({},this._def),{checks:[...this._def.checks,{kind:A,value:t,inclusive:n,message:Kt.toString(o)}]}))}_addCheck(A){return new i($A(P({},this._def),{checks:[...this._def.checks,A]}))}positive(A){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Kt.toString(A)})}negative(A){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Kt.toString(A)})}nonpositive(A){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Kt.toString(A)})}nonnegative(A){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Kt.toString(A)})}multipleOf(A,t){return this._addCheck({kind:"multipleOf",value:A,message:Kt.toString(t)})}get minValue(){let A=null;for(let t of this._def.checks)t.kind==="min"&&(A===null||t.value>A)&&(A=t.value);return A}get maxValue(){let A=null;for(let t of this._def.checks)t.kind==="max"&&(A===null||t.valuenew i(P({checks:[],typeName:_i.ZodBigInt,coerce:e?.coerce??!1},tn(e))),i})(),KR=(()=>{class i extends hn{_parse(A){if(this._def.coerce&&(A.data=!!A.data),this._getType(A)!==ht.boolean){let n=this._getOrReturnCtx(A);return ot(n,{code:Ne.invalid_type,expected:ht.boolean,received:n.parsedType}),hi}return Ss(A.data)}}return i.create=e=>new i(P({typeName:_i.ZodBoolean,coerce:e?.coerce||!1},tn(e))),i})(),UR=(()=>{class i extends hn{_parse(A){if(this._def.coerce&&(A.data=new Date(A.data)),this._getType(A)!==ht.date){let a=this._getOrReturnCtx(A);return ot(a,{code:Ne.invalid_type,expected:ht.date,received:a.parsedType}),hi}if(Number.isNaN(A.data.getTime())){let a=this._getOrReturnCtx(A);return ot(a,{code:Ne.invalid_date}),hi}let n=new rs,o;for(let a of this._def.checks)a.kind==="min"?A.data.getTime()a.value&&(o=this._getOrReturnCtx(A,o),ot(o,{code:Ne.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):Mn.assertNever(a);return{status:n.value,value:new Date(A.data.getTime())}}_addCheck(A){return new i($A(P({},this._def),{checks:[...this._def.checks,A]}))}min(A,t){return this._addCheck({kind:"min",value:A.getTime(),message:Kt.toString(t)})}max(A,t){return this._addCheck({kind:"max",value:A.getTime(),message:Kt.toString(t)})}get minDate(){let A=null;for(let t of this._def.checks)t.kind==="min"&&(A===null||t.value>A)&&(A=t.value);return A!=null?new Date(A):null}get maxDate(){let A=null;for(let t of this._def.checks)t.kind==="max"&&(A===null||t.valuenew i(P({checks:[],coerce:e?.coerce||!1,typeName:_i.ZodDate},tn(e))),i})(),y$=(()=>{class i extends hn{_parse(A){if(this._getType(A)!==ht.symbol){let n=this._getOrReturnCtx(A);return ot(n,{code:Ne.invalid_type,expected:ht.symbol,received:n.parsedType}),hi}return Ss(A.data)}}return i.create=e=>new i(P({typeName:_i.ZodSymbol},tn(e))),i})(),TR=(()=>{class i extends hn{_parse(A){if(this._getType(A)!==ht.undefined){let n=this._getOrReturnCtx(A);return ot(n,{code:Ne.invalid_type,expected:ht.undefined,received:n.parsedType}),hi}return Ss(A.data)}}return i.create=e=>new i(P({typeName:_i.ZodUndefined},tn(e))),i})(),OR=(()=>{class i extends hn{_parse(A){if(this._getType(A)!==ht.null){let n=this._getOrReturnCtx(A);return ot(n,{code:Ne.invalid_type,expected:ht.null,received:n.parsedType}),hi}return Ss(A.data)}}return i.create=e=>new i(P({typeName:_i.ZodNull},tn(e))),i})(),Gy=(()=>{class i extends hn{constructor(){super(...arguments),this._any=!0}_parse(A){return Ss(A.data)}}return i.create=e=>new i(P({typeName:_i.ZodAny},tn(e))),i})(),Lp=(()=>{class i extends hn{constructor(){super(...arguments),this._unknown=!0}_parse(A){return Ss(A.data)}}return i.create=e=>new i(P({typeName:_i.ZodUnknown},tn(e))),i})(),BI=(()=>{class i extends hn{_parse(A){let t=this._getOrReturnCtx(A);return ot(t,{code:Ne.invalid_type,expected:ht.never,received:t.parsedType}),hi}}return i.create=e=>new i(P({typeName:_i.ZodNever},tn(e))),i})(),D$=(()=>{class i extends hn{_parse(A){if(this._getType(A)!==ht.undefined){let n=this._getOrReturnCtx(A);return ot(n,{code:Ne.invalid_type,expected:ht.void,received:n.parsedType}),hi}return Ss(A.data)}}return i.create=e=>new i(P({typeName:_i.ZodVoid},tn(e))),i})(),Gp=(()=>{class i extends hn{_parse(A){let{ctx:t,status:n}=this._processInputParams(A),o=this._def;if(t.parsedType!==ht.array)return ot(t,{code:Ne.invalid_type,expected:ht.array,received:t.parsedType}),hi;if(o.exactLength!==null){let r=t.data.length>o.exactLength.value,s=t.data.lengtho.maxLength.value&&(ot(t,{code:Ne.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((r,s)=>o.type._parseAsync(new Mg(t,r,t.path,s)))).then(r=>rs.mergeArray(n,r));let a=[...t.data].map((r,s)=>o.type._parseSync(new Mg(t,r,t.path,s)));return rs.mergeArray(n,a)}get element(){return this._def.type}min(A,t){return new i($A(P({},this._def),{minLength:{value:A,message:Kt.toString(t)}}))}max(A,t){return new i($A(P({},this._def),{maxLength:{value:A,message:Kt.toString(t)}}))}length(A,t){return new i($A(P({},this._def),{exactLength:{value:A,message:Kt.toString(t)}}))}nonempty(A){return this.min(1,A)}}return i.create=(e,A)=>new i(P({type:e,minLength:null,maxLength:null,exactLength:null,typeName:_i.ZodArray},tn(A))),i})();function FE(i){if(i instanceof LE){let e={};for(let A in i.shape){let t=i.shape[A];e[A]=f1.create(FE(t))}return new LE($A(P({},i._def),{shape:()=>e}))}else return i instanceof Gp?new Gp($A(P({},i._def),{type:FE(i.element)})):i instanceof f1?f1.create(FE(i.unwrap())):i instanceof UE?UE.create(FE(i.unwrap())):i instanceof GE?GE.create(i.items.map(e=>FE(e))):i}var LE=(()=>{class i extends hn{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let A=this._def.shape(),t=Mn.objectKeys(A);return this._cached={shape:A,keys:t},this._cached}_parse(A){if(this._getType(A)!==ht.object){let g=this._getOrReturnCtx(A);return ot(g,{code:Ne.invalid_type,expected:ht.object,received:g.parsedType}),hi}let{status:n,ctx:o}=this._processInputParams(A),{shape:a,keys:r}=this._getCached(),s=[];if(!(this._def.catchall instanceof BI&&this._def.unknownKeys==="strip"))for(let g in o.data)r.includes(g)||s.push(g);let l=[];for(let g of r){let C=a[g],d=o.data[g];l.push({key:{status:"valid",value:g},value:C._parse(new Mg(o,d,o.path,g)),alwaysSet:g in o.data})}if(this._def.catchall instanceof BI){let g=this._def.unknownKeys;if(g==="passthrough")for(let C of s)l.push({key:{status:"valid",value:C},value:{status:"valid",value:o.data[C]}});else if(g==="strict")s.length>0&&(ot(o,{code:Ne.unrecognized_keys,keys:s}),n.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let g=this._def.catchall;for(let C of s){let d=o.data[C];l.push({key:{status:"valid",value:C},value:g._parse(new Mg(o,d,o.path,C)),alwaysSet:C in o.data})}}return o.common.async?Promise.resolve().then(()=>re(this,null,function*(){let g=[];for(let C of l){let d=yield C.key,B=yield C.value;g.push({key:d,value:B,alwaysSet:C.alwaysSet})}return g})).then(g=>rs.mergeObjectSync(n,g)):rs.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(A){return Kt.errToObj,new i(P($A(P({},this._def),{unknownKeys:"strict"}),A!==void 0?{errorMap:(t,n)=>{let o=this._def.errorMap?.(t,n).message??n.defaultError;return t.code==="unrecognized_keys"?{message:Kt.errToObj(A).message??o}:{message:o}}}:{}))}strip(){return new i($A(P({},this._def),{unknownKeys:"strip"}))}passthrough(){return new i($A(P({},this._def),{unknownKeys:"passthrough"}))}extend(A){return new i($A(P({},this._def),{shape:()=>P(P({},this._def.shape()),A)}))}merge(A){return new i({unknownKeys:A._def.unknownKeys,catchall:A._def.catchall,shape:()=>P(P({},this._def.shape()),A._def.shape()),typeName:_i.ZodObject})}setKey(A,t){return this.augment({[A]:t})}catchall(A){return new i($A(P({},this._def),{catchall:A}))}pick(A){let t={};for(let n of Mn.objectKeys(A))A[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new i($A(P({},this._def),{shape:()=>t}))}omit(A){let t={};for(let n of Mn.objectKeys(this.shape))A[n]||(t[n]=this.shape[n]);return new i($A(P({},this._def),{shape:()=>t}))}deepPartial(){return FE(this)}partial(A){let t={};for(let n of Mn.objectKeys(this.shape)){let o=this.shape[n];A&&!A[n]?t[n]=o:t[n]=o.optional()}return new i($A(P({},this._def),{shape:()=>t}))}required(A){let t={};for(let n of Mn.objectKeys(this.shape))if(A&&!A[n])t[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof f1;)a=a._def.innerType;t[n]=a}return new i($A(P({},this._def),{shape:()=>t}))}keyof(){return M$(Mn.objectKeys(this.shape))}}return i.create=(e,A)=>new i(P({shape:()=>e,unknownKeys:"strip",catchall:BI.create(),typeName:_i.ZodObject},tn(A))),i.strictCreate=(e,A)=>new i(P({shape:()=>e,unknownKeys:"strict",catchall:BI.create(),typeName:_i.ZodObject},tn(A))),i.lazycreate=(e,A)=>new i(P({shape:e,unknownKeys:"strip",catchall:BI.create(),typeName:_i.ZodObject},tn(A))),i})(),JR=(()=>{class i extends hn{_parse(A){let{ctx:t}=this._processInputParams(A),n=this._def.options;function o(a){for(let s of a)if(s.result.status==="valid")return s.result;for(let s of a)if(s.result.status==="dirty")return t.common.issues.push(...s.ctx.common.issues),s.result;let r=a.map(s=>new x0(s.ctx.common.issues));return ot(t,{code:Ne.invalid_union,unionErrors:r}),hi}if(t.common.async)return Promise.all(n.map(a=>re(this,null,function*(){let r=$A(P({},t),{common:$A(P({},t.common),{issues:[]}),parent:null});return{result:yield a._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}}))).then(o);{let a,r=[];for(let l of n){let g=$A(P({},t),{common:$A(P({},t.common),{issues:[]}),parent:null}),C=l._parseSync({data:t.data,path:t.path,parent:g});if(C.status==="valid")return C;C.status==="dirty"&&!a&&(a={result:C,ctx:g}),g.common.issues.length&&r.push(g.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;let s=r.map(l=>new x0(l));return ot(t,{code:Ne.invalid_union,unionErrors:s}),hi}}get options(){return this._def.options}}return i.create=(e,A)=>new i(P({options:e,typeName:_i.ZodUnion},tn(A))),i})(),OC=i=>i instanceof HR?OC(i.schema):i instanceof KE?OC(i.innerType()):i instanceof zR?[i.value]:i instanceof Jy?i.options:i instanceof PR?Mn.objectValues(i.enum):i instanceof jR?OC(i._def.innerType):i instanceof TR?[void 0]:i instanceof OR?[null]:i instanceof f1?[void 0,...OC(i.unwrap())]:i instanceof UE?[null,...OC(i.unwrap())]:i instanceof Kp||i instanceof qR?OC(i.unwrap()):i instanceof VR?OC(i._def.innerType):[],Ky=class i extends hn{_parse(e){let{ctx:A}=this._processInputParams(e);if(A.parsedType!==ht.object)return ot(A,{code:Ne.invalid_type,expected:ht.object,received:A.parsedType}),hi;let t=this.discriminator,n=A.data[t],o=this.optionsMap.get(n);return o?A.common.async?o._parseAsync({data:A.data,path:A.path,parent:A}):o._parseSync({data:A.data,path:A.path,parent:A}):(ot(A,{code:Ne.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[t]}),hi)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,A,t){let n=new Map;for(let o of A){let a=OC(o.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let r of a){if(n.has(r))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(r)}`);n.set(r,o)}}return new i(P({typeName:_i.ZodDiscriminatedUnion,discriminator:e,options:A,optionsMap:n},tn(t)))}};function FR(i,e){let A=_0(i),t=_0(e);if(i===e)return{valid:!0,data:i};if(A===ht.object&&t===ht.object){let n=Mn.objectKeys(e),o=Mn.objectKeys(i).filter(r=>n.indexOf(r)!==-1),a=P(P({},i),e);for(let r of o){let s=FR(i[r],e[r]);if(!s.valid)return{valid:!1};a[r]=s.data}return{valid:!0,data:a}}else if(A===ht.array&&t===ht.array){if(i.length!==e.length)return{valid:!1};let n=[];for(let o=0;o{class i extends hn{_parse(A){let{status:t,ctx:n}=this._processInputParams(A),o=(a,r)=>{if(Fy(a)||Fy(r))return hi;let s=FR(a.value,r.value);return s.valid?((Ly(a)||Ly(r))&&t.dirty(),{status:t.value,value:s.data}):(ot(n,{code:Ne.invalid_intersection_types}),hi)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,r])=>o(a,r)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}return i.create=(e,A,t)=>new i(P({left:e,right:A,typeName:_i.ZodIntersection},tn(t))),i})(),GE=(()=>{class i extends hn{_parse(A){let{status:t,ctx:n}=this._processInputParams(A);if(n.parsedType!==ht.array)return ot(n,{code:Ne.invalid_type,expected:ht.array,received:n.parsedType}),hi;if(n.data.lengththis._def.items.length&&(ot(n,{code:Ne.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let a=[...n.data].map((r,s)=>{let l=this._def.items[s]||this._def.rest;return l?l._parse(new Mg(n,r,n.path,s)):null}).filter(r=>!!r);return n.common.async?Promise.all(a).then(r=>rs.mergeArray(t,r)):rs.mergeArray(t,a)}get items(){return this._def.items}rest(A){return new i($A(P({},this._def),{rest:A}))}}return i.create=(e,A)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new i(P({items:e,typeName:_i.ZodTuple,rest:null},tn(A)))},i})(),Uy=class i extends hn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:A,ctx:t}=this._processInputParams(e);if(t.parsedType!==ht.object)return ot(t,{code:Ne.invalid_type,expected:ht.object,received:t.parsedType}),hi;let n=[],o=this._def.keyType,a=this._def.valueType;for(let r in t.data)n.push({key:o._parse(new Mg(t,r,t.path,r)),value:a._parse(new Mg(t,t.data[r],t.path,r)),alwaysSet:r in t.data});return t.common.async?rs.mergeObjectAsync(A,n):rs.mergeObjectSync(A,n)}get element(){return this._def.valueType}static create(e,A,t){return A instanceof hn?new i(P({keyType:e,valueType:A,typeName:_i.ZodRecord},tn(t))):new i(P({keyType:Oy.create(),valueType:e,typeName:_i.ZodRecord},tn(A)))}},v$=(()=>{class i extends hn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(A){let{status:t,ctx:n}=this._processInputParams(A);if(n.parsedType!==ht.map)return ot(n,{code:Ne.invalid_type,expected:ht.map,received:n.parsedType}),hi;let o=this._def.keyType,a=this._def.valueType,r=[...n.data.entries()].map(([s,l],g)=>({key:o._parse(new Mg(n,s,n.path,[g,"key"])),value:a._parse(new Mg(n,l,n.path,[g,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(()=>re(this,null,function*(){for(let l of r){let g=yield l.key,C=yield l.value;if(g.status==="aborted"||C.status==="aborted")return hi;(g.status==="dirty"||C.status==="dirty")&&t.dirty(),s.set(g.value,C.value)}return{status:t.value,value:s}}))}else{let s=new Map;for(let l of r){let g=l.key,C=l.value;if(g.status==="aborted"||C.status==="aborted")return hi;(g.status==="dirty"||C.status==="dirty")&&t.dirty(),s.set(g.value,C.value)}return{status:t.value,value:s}}}}return i.create=(e,A,t)=>new i(P({valueType:A,keyType:e,typeName:_i.ZodMap},tn(t))),i})(),b$=(()=>{class i extends hn{_parse(A){let{status:t,ctx:n}=this._processInputParams(A);if(n.parsedType!==ht.set)return ot(n,{code:Ne.invalid_type,expected:ht.set,received:n.parsedType}),hi;let o=this._def;o.minSize!==null&&n.data.sizeo.maxSize.value&&(ot(n,{code:Ne.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),t.dirty());let a=this._def.valueType;function r(l){let g=new Set;for(let C of l){if(C.status==="aborted")return hi;C.status==="dirty"&&t.dirty(),g.add(C.value)}return{status:t.value,value:g}}let s=[...n.data.values()].map((l,g)=>a._parse(new Mg(n,l,n.path,g)));return n.common.async?Promise.all(s).then(l=>r(l)):r(s)}min(A,t){return new i($A(P({},this._def),{minSize:{value:A,message:Kt.toString(t)}}))}max(A,t){return new i($A(P({},this._def),{maxSize:{value:A,message:Kt.toString(t)}}))}size(A,t){return this.min(A,t).max(A,t)}nonempty(A){return this.min(1,A)}}return i.create=(e,A)=>new i(P({valueType:e,minSize:null,maxSize:null,typeName:_i.ZodSet},tn(A))),i})(),Ty=class i extends hn{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:A}=this._processInputParams(e);if(A.parsedType!==ht.function)return ot(A,{code:Ne.invalid_type,expected:ht.function,received:A.parsedType}),hi;function t(r,s){return Fp({data:r,path:A.path,errorMaps:[A.common.contextualErrorMap,A.schemaErrorMap,RE(),TC].filter(l=>!!l),issueData:{code:Ne.invalid_arguments,argumentsError:s}})}function n(r,s){return Fp({data:r,path:A.path,errorMaps:[A.common.contextualErrorMap,A.schemaErrorMap,RE(),TC].filter(l=>!!l),issueData:{code:Ne.invalid_return_type,returnTypeError:s}})}let o={errorMap:A.common.contextualErrorMap},a=A.data;if(this._def.returns instanceof Yy){let r=this;return Ss(function(...s){return re(this,null,function*(){let l=new x0([]),g=yield r._def.args.parseAsync(s,o).catch(B=>{throw l.addIssue(t(s,B)),l}),C=yield Reflect.apply(a,this,g);return yield r._def.returns._def.type.parseAsync(C,o).catch(B=>{throw l.addIssue(n(C,B)),l})})})}else{let r=this;return Ss(function(...s){let l=r._def.args.safeParse(s,o);if(!l.success)throw new x0([t(s,l.error)]);let g=Reflect.apply(a,this,l.data),C=r._def.returns.safeParse(g,o);if(!C.success)throw new x0([n(g,C.error)]);return C.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new i($A(P({},this._def),{args:GE.create(e).rest(Lp.create())}))}returns(e){return new i($A(P({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,A,t){return new i(P({args:e||GE.create([]).rest(Lp.create()),returns:A||Lp.create(),typeName:_i.ZodFunction},tn(t)))}},HR=(()=>{class i extends hn{get schema(){return this._def.getter()}_parse(A){let{ctx:t}=this._processInputParams(A);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}return i.create=(e,A)=>new i(P({getter:e,typeName:_i.ZodLazy},tn(A))),i})(),zR=(()=>{class i extends hn{_parse(A){if(A.data!==this._def.value){let t=this._getOrReturnCtx(A);return ot(t,{received:t.data,code:Ne.invalid_literal,expected:this._def.value}),hi}return{status:"valid",value:A.data}}get value(){return this._def.value}}return i.create=(e,A)=>new i(P({value:e,typeName:_i.ZodLiteral},tn(A))),i})();function M$(i,e){return new Jy(P({values:i,typeName:_i.ZodEnum},tn(e)))}var Jy=(()=>{class i extends hn{_parse(A){if(typeof A.data!="string"){let t=this._getOrReturnCtx(A),n=this._def.values;return ot(t,{expected:Mn.joinValues(n),received:t.parsedType,code:Ne.invalid_type}),hi}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(A.data)){let t=this._getOrReturnCtx(A),n=this._def.values;return ot(t,{received:t.data,code:Ne.invalid_enum_value,options:n}),hi}return Ss(A.data)}get options(){return this._def.values}get enum(){let A={};for(let t of this._def.values)A[t]=t;return A}get Values(){let A={};for(let t of this._def.values)A[t]=t;return A}get Enum(){let A={};for(let t of this._def.values)A[t]=t;return A}extract(A,t=this._def){return i.create(A,P(P({},this._def),t))}exclude(A,t=this._def){return i.create(this.options.filter(n=>!A.includes(n)),P(P({},this._def),t))}}return i.create=M$,i})(),PR=(()=>{class i extends hn{_parse(A){let t=Mn.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(A);if(n.parsedType!==ht.string&&n.parsedType!==ht.number){let o=Mn.objectValues(t);return ot(n,{expected:Mn.joinValues(o),received:n.parsedType,code:Ne.invalid_type}),hi}if(this._cache||(this._cache=new Set(Mn.getValidEnumValues(this._def.values))),!this._cache.has(A.data)){let o=Mn.objectValues(t);return ot(n,{received:n.data,code:Ne.invalid_enum_value,options:o}),hi}return Ss(A.data)}get enum(){return this._def.values}}return i.create=(e,A)=>new i(P({values:e,typeName:_i.ZodNativeEnum},tn(A))),i})(),Yy=(()=>{class i extends hn{unwrap(){return this._def.type}_parse(A){let{ctx:t}=this._processInputParams(A);if(t.parsedType!==ht.promise&&t.common.async===!1)return ot(t,{code:Ne.invalid_type,expected:ht.promise,received:t.parsedType}),hi;let n=t.parsedType===ht.promise?t.data:Promise.resolve(t.data);return Ss(n.then(o=>this._def.type.parseAsync(o,{path:t.path,errorMap:t.common.contextualErrorMap})))}}return i.create=(e,A)=>new i(P({type:e,typeName:_i.ZodPromise},tn(A))),i})(),KE=(()=>{class i extends hn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_i.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(A){let{status:t,ctx:n}=this._processInputParams(A),o=this._def.effect||null,a={addIssue:r=>{ot(n,r),r.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),o.type==="preprocess"){let r=o.transform(n.data,a);if(n.common.async)return Promise.resolve(r).then(s=>re(this,null,function*(){if(t.value==="aborted")return hi;let l=yield this._def.schema._parseAsync({data:s,path:n.path,parent:n});return l.status==="aborted"?hi:l.status==="dirty"?II(l.value):t.value==="dirty"?II(l.value):l}));{if(t.value==="aborted")return hi;let s=this._def.schema._parseSync({data:r,path:n.path,parent:n});return s.status==="aborted"?hi:s.status==="dirty"?II(s.value):t.value==="dirty"?II(s.value):s}}if(o.type==="refinement"){let r=s=>{let l=o.refinement(s,a);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?hi:(s.status==="dirty"&&t.dirty(),r(s.value),{status:t.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?hi:(s.status==="dirty"&&t.dirty(),r(s.value).then(()=>({status:t.value,value:s.value}))))}if(o.type==="transform")if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!p1(r))return hi;let s=o.transform(r.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(r=>p1(r)?Promise.resolve(o.transform(r.value,a)).then(s=>({status:t.value,value:s})):hi);Mn.assertNever(o)}}return i.create=(e,A,t)=>new i(P({schema:e,typeName:_i.ZodEffects,effect:A},tn(t))),i.createWithPreprocess=(e,A,t)=>new i(P({schema:A,effect:{type:"preprocess",transform:e},typeName:_i.ZodEffects},tn(t))),i})();var f1=(()=>{class i extends hn{_parse(A){return this._getType(A)===ht.undefined?Ss(void 0):this._def.innerType._parse(A)}unwrap(){return this._def.innerType}}return i.create=(e,A)=>new i(P({innerType:e,typeName:_i.ZodOptional},tn(A))),i})(),UE=(()=>{class i extends hn{_parse(A){return this._getType(A)===ht.null?Ss(null):this._def.innerType._parse(A)}unwrap(){return this._def.innerType}}return i.create=(e,A)=>new i(P({innerType:e,typeName:_i.ZodNullable},tn(A))),i})(),jR=(()=>{class i extends hn{_parse(A){let{ctx:t}=this._processInputParams(A),n=t.data;return t.parsedType===ht.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}return i.create=(e,A)=>new i(P({innerType:e,typeName:_i.ZodDefault,defaultValue:typeof A.default=="function"?A.default:()=>A.default},tn(A))),i})(),VR=(()=>{class i extends hn{_parse(A){let{ctx:t}=this._processInputParams(A),n=$A(P({},t),{common:$A(P({},t.common),{issues:[]})}),o=this._def.innerType._parse({data:n.data,path:n.path,parent:P({},n)});return NE(o)?o.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new x0(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new x0(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}return i.create=(e,A)=>new i(P({innerType:e,typeName:_i.ZodCatch,catchValue:typeof A.catch=="function"?A.catch:()=>A.catch},tn(A))),i})(),S$=(()=>{class i extends hn{_parse(A){if(this._getType(A)!==ht.nan){let n=this._getOrReturnCtx(A);return ot(n,{code:Ne.invalid_type,expected:ht.nan,received:n.parsedType}),hi}return{status:"valid",value:A.data}}}return i.create=e=>new i(P({typeName:_i.ZodNaN},tn(e))),i})(),RMA=Symbol("zod_brand"),Kp=class extends hn{_parse(e){let{ctx:A}=this._processInputParams(e),t=A.data;return this._def.type._parse({data:t,path:A.path,parent:A})}unwrap(){return this._def.type}},Up=class i extends hn{_parse(e){let{status:A,ctx:t}=this._processInputParams(e);if(t.common.async)return re(this,null,function*(){let o=yield this._def.in._parseAsync({data:t.data,path:t.path,parent:t});return o.status==="aborted"?hi:o.status==="dirty"?(A.dirty(),II(o.value)):this._def.out._parseAsync({data:o.value,path:t.path,parent:t})});{let n=this._def.in._parseSync({data:t.data,path:t.path,parent:t});return n.status==="aborted"?hi:n.status==="dirty"?(A.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:t.path,parent:t})}}static create(e,A){return new i({in:e,out:A,typeName:_i.ZodPipeline})}},qR=(()=>{class i extends hn{_parse(A){let t=this._def.innerType._parse(A),n=o=>(p1(o)&&(o.value=Object.freeze(o.value)),o);return NE(t)?t.then(o=>n(o)):n(t)}unwrap(){return this._def.innerType}}return i.create=(e,A)=>new i(P({innerType:e,typeName:_i.ZodReadonly},tn(A))),i})();function p$(i,e){let A=typeof i=="function"?i(e):typeof i=="string"?{message:i}:i;return typeof A=="string"?{message:A}:A}function k$(i,e={},A){return i?Gy.create().superRefine((t,n)=>{let o=i(t);if(o instanceof Promise)return o.then(a=>{if(!a){let r=p$(e,t),s=r.fatal??A??!0;n.addIssue($A(P({code:"custom"},r),{fatal:s}))}});if(!o){let a=p$(e,t),r=a.fatal??A??!0;n.addIssue($A(P({code:"custom"},a),{fatal:r}))}}):Gy.create()}var NMA={object:LE.lazycreate},_i=(function(i){return i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline",i.ZodReadonly="ZodReadonly",i})(_i||{});var FMA=(i,e={message:`Input not instance of ${i.name}`})=>k$(A=>A instanceof i,e),_$=Oy.create,x$=LR.create,LMA=S$.create,GMA=GR.create,R$=KR.create,KMA=UR.create,UMA=y$.create,TMA=TR.create,OMA=OR.create,JMA=Gy.create,YMA=Lp.create,HMA=BI.create,zMA=D$.create,PMA=Gp.create,jMA=LE.create,VMA=LE.strictCreate,qMA=JR.create,WMA=Ky.create,ZMA=YR.create,XMA=GE.create,$MA=Uy.create,A9A=v$.create,e9A=b$.create,t9A=Ty.create,i9A=HR.create,n9A=zR.create,o9A=Jy.create,a9A=PR.create,r9A=Yy.create,s9A=KE.create,l9A=f1.create,g9A=UE.create,c9A=KE.createWithPreprocess,C9A=Up.create,d9A=()=>_$().optional(),I9A=()=>x$().optional(),B9A=()=>R$().optional(),h9A={string:i=>Oy.create($A(P({},i),{coerce:!0})),number:i=>LR.create($A(P({},i),{coerce:!0})),boolean:i=>KR.create($A(P({},i),{coerce:!0})),bigint:i=>GR.create($A(P({},i),{coerce:!0})),date:i=>UR.create($A(P({},i),{coerce:!0}))};var E9A=hi;var Q9A=XA.union([XA.string(),XA.number(),XA.boolean()]),Hy=XA.lazy(()=>XA.union([Q9A,XA.array(Hy),XA.record(XA.string(),Hy)]));function zy(i){return i.transform(e=>{if(!e||typeof e!="object")return e;let A={};for(let[t,n]of Object.entries(e))n!==null&&(A[t]=n);return A})}var WR=XA.string().transform((i,e)=>{try{return JSON.parse(i)}catch(A){return e.addIssue({code:"custom",message:"Invalid JSON string"}),XA.NEVER}}),Tp=i=>XA.union([i,WR.pipe(i)]);var Py="gen_ai.input.messages",jy="gen_ai.output.messages",Vy="gen_ai.system_instructions",qy="gen_ai.tool.definitions",Wy="gen_ai.response.finish_reasons",Zy="gen_ai.usage.input_tokens",Xy="gen_ai.usage.output_tokens",N$="function",Jp="gen_ai.client.inference.operation.details",u9A=XA.object({type:XA.literal("text"),content:XA.string()}),p9A=XA.object({type:XA.literal("blob"),mime_type:XA.string(),data:XA.any()}),f9A=XA.object({type:XA.literal("file_data"),mime_type:XA.string(),uri:XA.string()}),m9A=XA.object({type:XA.literal("tool_call"),id:XA.string().nullable().optional(),name:XA.string(),arguments:XA.record(XA.string(),XA.any()).nullable().optional()}),w9A=XA.object({type:XA.literal("tool_call_response"),id:XA.string().nullable().optional(),response:XA.record(XA.string(),XA.any()).nullable().optional()}),ZR=XA.discriminatedUnion("type",[u9A,p9A,f9A,m9A,w9A]),y9A=XA.object({role:XA.string(),parts:XA.array(ZR)}),D9A=XA.object({role:XA.string(),parts:XA.array(ZR),finish_reason:XA.string()}),v9A=XA.object({type:XA.literal(N$),name:XA.string(),description:XA.string().nullable().optional(),parameters:XA.record(XA.string(),XA.any()).nullable().optional()}),b9A=XA.object({name:XA.string(),type:XA.string()}),M9A=XA.union([v9A,b9A]),S9A=Tp(XA.array(y9A)),k9A=Tp(XA.array(D9A)),_9A=Tp(XA.array(ZR)),x9A=Tp(XA.array(M9A)),XR=XA.array(XA.string()),Op=XA.number(),R9A=XA.object({[Py]:S9A.optional(),[jy]:k9A.optional(),[Vy]:_9A.optional(),[qy]:x9A.optional(),[Wy]:XR.optional(),[Zy]:Op.optional(),[Xy]:Op.optional()}).passthrough(),F$=XA.object({event_name:XA.literal(Jp),body:XA.unknown().optional(),attributes:R9A.optional()});var $y="gen_ai.system.message",AD="gen_ai.user.message",eD="gen_ai.choice",N9A=zy(XA.object({id:XA.string().nullable().optional(),name:XA.string(),args:XA.record(XA.string(),XA.any()),needsResponse:XA.boolean().nullable().optional()})),F9A=zy(XA.object({id:XA.string().nullable().optional(),name:XA.string(),response:XA.record(XA.string(),XA.any())})),G$=zy(XA.object({text:XA.string().nullable().optional(),function_call:N9A.nullable().optional(),function_response:F9A.nullable().optional()})),L9A=XA.object({parts:XA.array(G$),role:XA.string()}),L$=XA.object({content:XA.object({parts:XA.array(G$),role:XA.string().optional()}),role:XA.string().optional()}).transform(i=>{let e=P({},i.content);return i.role!==void 0&&(e.role=i.role),{content:e}}).pipe(XA.object({content:L9A})),G9A=XA.object({content:XA.string()}),K9A=XA.object({event_name:XA.enum([AD,eD]),body:XA.union([L$,WR.pipe(L$)])}),U9A=XA.object({event_name:XA.literal($y),body:G9A}),K$=XA.union([U9A,K9A]);var T9A="gcp.vertex.agent.llm_request",O9A="gcp.vertex.agent.llm_response";function tD(i){let e=J9A(i);if(e!==void 0)return e;let A=Y9A(i);if(A!==void 0)return A;let t=H9A(i);if(t!==void 0)return t}function J9A(i){let e=(i.logs??[]).find(r=>r.event_name===Jp);if(e===void 0)return;let A=e.attributes??{},t=A[Vy],n=A[Py],o=A[qy],a=A[jy];if(!(t===void 0&&n===void 0&&o===void 0&&a===void 0))return{kind:"experimental",inputs:{system_instruction:t,user_messages:n,tool_definitions:o},outputs:a}}function Y9A(i){let e=i.logs??[],A,t=[],n;for(let o of e)switch(o.event_name){case $y:A=o.body;break;case AD:t.push(o.body);break;case eD:n=o.body;break;default:break}if(!(A===void 0&&t.length===0&&n===void 0))return{kind:"stable",inputs:{system_instruction:A,user_messages:t},outputs:n}}function H9A(i){let e=i.attributes??{},A=e[T9A],t=e[O9A];if(!(A===void 0&&t===void 0))return{kind:"legacy",inputs:U$(A),outputs:U$(t)}}function U$(i){if(typeof i!="string")return i;try{return JSON.parse(i)}catch(e){return i}}var z9A=XA.union([K$,F$]);var P9A="gen_ai.operation.name",T$="gen_ai.conversation.id",j9A="gen_ai.agent.name",V9A="gen_ai.agent.description",O$="gcp.vertex.agent.invocation_id",q9A="gcp.vertex.agent.associated_event_ids",J$="gcp.vertex.agent.event_id";var AN="invoke_agent",hI="generate_content",W9A=XA.object({name:XA.string(),start_time:XA.number(),end_time:XA.number(),trace_id:XA.union([XA.string(),XA.number()]),span_id:XA.union([XA.string(),XA.number()]),parent_span_id:XA.union([XA.string(),XA.number()]).nullable().optional(),attributes:XA.record(XA.string(),Hy).optional(),logs:XA.array(z9A).optional()}),Z9A=XA.object({attrConversationId:XA.string().optional(),attrInvocationId:XA.string().optional(),attrAssociatedEventIds:XA.array(XA.string()).optional(),attrAgentName:XA.string().optional(),attrAgentDescription:XA.string().optional(),attrEventId:XA.string().optional(),attrResponseFinishReasons:XR.optional(),attrUsageInputTokens:Op.optional(),attrUsageOutputTokens:Op.optional()});function X9A(i){let e=i.attributes??{},A={attrConversationId:e[T$],attrInvocationId:e[O$],attrAssociatedEventIds:e[q9A],attrAgentName:e[j9A],attrAgentDescription:e[V9A],attrEventId:e[J$],attrResponseFinishReasons:e[Wy],attrUsageInputTokens:e[Zy],attrUsageOutputTokens:e[Xy]};for(let t of Object.keys(A))A[t]===void 0&&delete A[t];return A}var $9A=XA.object({attrConversationId:XA.string({message:`'${T$}' is required on '${AN}' spans`})}),ASA=XA.object({attrEventId:XA.string({message:`'${J$}' is required on '${hI}' spans`}),attrInvocationId:XA.string({message:`'${O$}' is required on '${hI}' spans`})});function eN(i,e){for(let A of e)i.addIssue(A)}function $R(i,e,A){let t=X9A(i),n=Z9A.safeParse(t);if(!n.success)return eN(A,n.error.issues),null;if(e===null)return n.data;let o=e.safeParse(t);return o.success?P(P({},n.data),o.data):(eN(A,o.error.issues),null)}var Y$=XA.unknown().transform((i,e)=>{let A=W9A.safeParse(i);if(!A.success)return eN(e,A.error.issues),XA.NEVER;let t=A.data,n=t.attributes?.[P9A],B=t,{logs:o,attributes:a}=B,r=Pp(B,["logs","attributes"]),s=a!==void 0?{rawAttributesUseThisFieldOnlyForDisplay:a}:{rawAttributesUseThisFieldOnlyForDisplay:{}},l={rawSpanUseThisFieldOnlyForDisplay:i};if(n===AN){let u=$R(t,$9A,e);return u===null?XA.NEVER:$A(P(P(P(P({},r),s),l),u),{attrOperationName:AN})}if(n===hI){let u=$R(t,ASA,e);if(u===null)return XA.NEVER;let E=tD({attributes:t.attributes,logs:o});return P($A(P(P(P(P({},r),s),l),u),{attrOperationName:hI}),E!==void 0?{io:E}:{})}let g=$R(t,null,e);if(g===null)return XA.NEVER;let C=tD({attributes:t.attributes,logs:o});return P(P(P(P(P({},r),s),l),g),C!==void 0?{io:C}:{})});function tN(i){if(!i)return;let e=i.system_instruction;if(e===void 0&&i.systemInstruction&&(e=i.systemInstruction),e===void 0&&i.config&&(e=i.config.system_instruction!==void 0?i.config.system_instruction:i.config.systemInstruction),typeof e=="string")return e}var eSA=["sideDrawer"],tSA=["drawerSessionTab"],iSA=["appSearchInput"],nSA=["invChipMenuTrigger"],oSA=["nodeChipMenuTrigger"],aSA=["addMenuTrigger"],rSA=[[["","adk-web-chat-container-top",""]]],sSA=["[adk-web-chat-container-top]"],z$=()=>[],lSA=(i,e)=>e.metricName;function gSA(i,e){i&1&&dn(0)}function cSA(i,e){if(i&1&&kt(0,gSA,1,0,"ng-container",40),i&2){let A=p();H("ngComponentOutlet",A.logoComponent)}}function CSA(i,e){if(i&1&&(I(0,"span",45),D(1),h()),i&2){let A=p(2);Q(),Ee(" ",A.adkVersion())}}function dSA(i,e){if(i&1&&(I(0,"div",48)(1,"div",50)(2,"span",51),D(3,"Version:"),h(),I(4,"span",52),D(5),h()(),I(6,"div",50)(7,"span",51),D(8,"Language:"),h(),I(9,"span",52),D(10),h()(),I(11,"div",50)(12,"span",51),D(13,"Lang Version:"),h(),I(14,"span",52),D(15),h()()()),i&2){let A=p(2);Q(5),nA(A.versionInfo().version),Q(5),nA(A.versionInfo().language),Q(5),nA(A.versionInfo().language_version)}}function ISA(i,e){if(i&1&&(lA(0,"img",41),I(1,"div",42)(2,"div",43)(3,"span",44),D(4,"Agent Development Kit"),h(),T(5,CSA,2,1,"span",45),h(),I(6,"div",46)(7,"div",47),D(8),h(),T(9,dSA,16,3,"div",48),h()(),I(10,"span",49),D(11,"ADK"),h()),i&2){let A=p();Q(5),O(A.adkVersion()?5:-1),Q(3),nA(A.sidePanelI18n.disclosureTooltip),Q(),O(A.versionInfo()?9:-1)}}function BSA(i,e){i&1&&(I(0,"mat-icon",20),D(1,"warning"),h())}function hSA(i,e){if(i&1){let A=aA();I(0,"span",54)(1,"button",56),U("click",function(){L(A);let n=p(2);return G(n.openAgentStructureGraphDialog())}),I(2,"mat-icon"),D(3,"account_tree"),h()()()}if(i&2){let A=p(2);H("matTooltip",A.graphsAvailable()?"View Agent Structure Graph":"Agent structure graph is not available for this agent"),Q(),H("disabled",!A.graphsAvailable())}}function ESA(i,e){if(i&1){let A=aA();lA(0,"div",53),T(1,hSA,4,2,"span",54),I(2,"span",54)(3,"button",55),U("click",function(){L(A);let n=p();return G(n.enterBuilderMode())}),I(4,"mat-icon"),D(5,"edit"),h()()()}if(i&2){let A=p();Q(),O(A.graphsAvailable()?1:-1),Q(),H("matTooltip",A.disableBuilderSwitch?"Editing is not available for this agent because it was not built by the builder":"Edit in Builder Mode"),Q(),H("disabled",A.disableBuilderSwitch)}}function QSA(i,e){if(i&1){let A=aA();I(0,"div",57)(1,"mat-icon",62),D(2,"visibility"),h(),I(3,"span",63),D(4),h(),I(5,"button",64),U("click",function(){L(A);let n=p(2);return G(n.closeReadonlySession())}),I(6,"mat-icon",65),D(7,"close"),h()()()}if(i&2){let A=p(2);Q(4),Ya("",A.readonlySessionType(),": ",A.readonlySessionName())}}function uSA(i,e){if(i&1){let A=aA();I(0,"button",69),U("click",function(){L(A);let n=p(7);return G(n.onNewSessionClick())}),I(1,"mat-icon",18),D(2,"add_comment"),h(),I(3,"span"),D(4),h()()}if(i&2){let A=p(7);H("matTooltip",A.i18n.createNewSessionTooltip),Q(4),nA(A.i18n.newSessionButton)}}function pSA(i,e){if(i&1){let A=aA();I(0,"button",70),U("click",function(){L(A);let n=p(7);return G(n.onNewSessionClick())}),I(1,"mat-icon",18),D(2,"add_comment"),h()()}if(i&2){let A=p(7);H("matTooltip",A.i18n.createNewSessionTooltip)}}function fSA(i,e){if(i&1&&(lA(0,"div",53),T(1,uSA,5,2,"button",67)(2,pSA,3,1,"button",68)),i&2){let A=p(6);Q(),O(A.uiEvents().length>0&&!A.isMobile()?1:2)}}function mSA(i,e){if(i&1&&T(0,fSA,3,1),i&2){let A=p(5);O(A.sessionId?0:-1)}}function wSA(i,e){if(i&1&&(T(0,mSA,1,1),mt(1,"async")),i&2){let A=p(4);O(Ft(1,1,A.isNewSessionButtonEnabledObs)?0:-1)}}function ySA(i,e){if(i&1&&(ro(0),mt(1,"async"),T(2,wSA,2,3)),i&2){let A=Ft(1,1,p(3).uiStateService.isSessionLoading());Q(2),O(A===!1?2:-1)}}function DSA(i,e){if(i&1){let A=aA();I(0,"div",16)(1,"button",66),U("click",function(){L(A);let n=p(2);return G(n.toggleSessionSelectorDrawer())}),I(2,"mat-icon",18),D(3,"chat"),h(),I(4,"span",19),D(5),h(),I(6,"mat-icon",21),D(7,"arrow_drop_down"),h()(),T(8,ySA,3,3),h()}if(i&2){let A=p(2);Q(5),nA(A.getToolbarSessionId()),Q(3),O(A.evalCase?-1:8)}}function vSA(i,e){if(i&1&&(I(0,"div",57)(1,"span",63),D(2),h(),I(3,"span",71),D(4),h()()),i&2){let A=p(3);Q(2),nA(A.i18n.evalCaseIdLabel),Q(2),nA(A.evalCase.evalId)}}function bSA(i,e){if(i&1){let A=aA();I(0,"button",72),U("click",function(){L(A);let n=p(3);return G(n.cancelEditEvalCase())}),D(1),h(),I(2,"button",73),U("click",function(){L(A);let n=p(3);return G(n.saveEvalCase())}),D(3),h()}if(i&2){let A=p(3);Q(),Ee(" ",A.i18n.cancelButton," "),Q(),H("disabled",!A.hasEvalCaseChanged()||A.isEvalCaseEditing()),Q(),Ee(" ",A.i18n.saveButton," ")}}function MSA(i,e){}function SSA(i,e){if(i&1&&(T(0,vSA,5,2,"div",57),I(1,"div",60),T(2,bSA,4,3)(3,MSA,0,0),h()),i&2){let A=p(2);O(A.isViewOnlySession()?-1:0),Q(2),O(A.isEvalEditMode()?2:3)}}function kSA(i,e){}function _SA(i,e){if(i&1&&(I(0,"div",74),D(1),h()),i&2){let A=p(3);Q(),nA(A.i18n.loadingSessionLabel)}}function xSA(i,e){if(i&1&&(I(0,"div",59),ro(1),mt(2,"async"),T(3,kSA,0,0)(4,_SA,2,1,"div",74),h()),i&2){let A=Ft(2,1,p(2).uiStateService.isSessionLoading());Q(3),O(A===!1?3:4)}}function RSA(i,e){if(i&1){let A=aA();I(0,"button",75),U("click",function(){L(A);let n=p(2);return G(n.themeService==null?null:n.themeService.toggleTheme())}),I(1,"mat-icon"),D(2),h()()}if(i&2){let A=p(2);H("matTooltip",(A.themeService==null?null:A.themeService.currentTheme())==="dark"?"Switch to Light Mode":"Switch to Dark Mode"),Q(2),nA((A.themeService==null?null:A.themeService.currentTheme())==="dark"?"light_mode":"dark_mode")}}function NSA(i,e){if(i&1&&(I(0,"div",22),T(1,QSA,8,2,"div",57)(2,DSA,9,2,"div",16),I(3,"div",58),T(4,SSA,4,2)(5,xSA,5,3,"div",59),h(),I(6,"div",60),ro(7),mt(8,"async"),T(9,RSA,3,2,"button",61),h()()),i&2){let A=p();Q(),O(A.isViewOnlySession()?1:2),Q(3),O(A.evalCase?4:5);let t=Ft(8,3,A.uiStateService.isSessionLoading());Q(5),O(t===!1?9:-1)}}function FSA(i,e){i&1&&(I(0,"div",85),lA(1,"mat-progress-spinner",86),h())}function LSA(i,e){i&1&&(I(0,"mat-icon",92),D(1,"check"),h())}function GSA(i,e){if(i&1){let A=aA();I(0,"button",89),U("click",function(){let n=L(A).$implicit,o=p(3);return G(o.selectAppFromDrawer(n))}),I(1,"mat-icon",90),D(2,"robot_2"),h(),I(3,"span",91),D(4),h(),T(5,LSA,2,0,"mat-icon",92),h()}if(i&2){let A=e.$implicit,t=p(3);_A("selected",A===t.appName),Q(4),nA(A),Q(),O(A===t.appName?5:-1)}}function KSA(i,e){i&1&&(I(0,"div",88),D(1,"No apps found"),h())}function USA(i,e){i&1&&ke(0,GSA,6,4,"button",87,ni,!1,KSA,2,0,"div",88),i&2&&_e(e)}function TSA(i,e){if(i&1){let A=aA();I(0,"div",76)(1,"span",77),D(2,"Select an App"),h(),I(3,"div")(4,"button",78),U("click",function(){L(A);let n=p();return G(n.openAddItemDialog())}),I(5,"mat-icon"),D(6,"add"),h()(),I(7,"button",79),U("click",function(){L(A);let n=p();return G(n.toggleAppSelectorDrawer())}),I(8,"mat-icon"),D(9,"close"),h()()()(),I(10,"div",80)(11,"mat-form-field",81)(12,"mat-icon",82),D(13,"search"),h(),I(14,"input",83,3),U("keydown",function(n){L(A);let o=p();return G(o.handleAppSearchKeydown(n))}),h()()(),I(16,"div",84),U("keydown",function(n){L(A);let o=p();return G(o.handleAppListKeydown(n))}),T(17,FSA,2,0,"div",85),mt(18,"async"),S1(19,USA,3,1),h()}if(i&2){let A,t=p();Q(14),H("formControl",t.appDrawerSearchControl),Q(3),O(t.isLoadingApps()?17:(A=Ft(18,2,t.filteredDrawerApps$))?19:-1,A)}}function OSA(i,e){if(i&1){let A=aA();I(0,"button",95),U("click",function(){L(A);let n=p(2);return G(n.importSession())}),I(1,"mat-icon"),D(2,"upload"),h(),I(3,"span"),D(4,"Import"),h()()}if(i&2){let A=p(2);H("matTooltip",A.i18n.importSessionTooltip)}}function JSA(i,e){if(i&1){let A=aA();I(0,"button",108),U("click",function(){L(A);let n=p(3);return G(n.exportSession())}),I(1,"mat-icon"),D(2,"download"),h(),I(3,"span"),D(4,"Export"),h()()}if(i&2){let A=p(3);H("matTooltip",A.i18n.exportSessionTooltip)}}function YSA(i,e){if(i&1){let A=aA();I(0,"button",109),U("click",function(){L(A);let n=p(3);return G(n.deleteSession(n.sessionId))}),I(1,"mat-icon"),D(2,"delete"),h(),I(3,"span"),D(4,"Delete"),h()()}if(i&2){let A=p(3);H("matTooltip",A.i18n.deleteSessionTooltip)}}function HSA(i,e){if(i&1){let A=aA();I(0,"div",97)(1,"span",100),D(2,"Current Session"),h(),I(3,"div",101)(4,"app-inline-edit",102),U("save",function(n){L(A);let o=p(2);return G(o.saveSessionName(n))}),h()(),I(5,"div",103)(6,"span",104),D(7),h(),I(8,"button",105),U("click",function(){L(A);let n=p(2);return G(n.copySessionId())}),I(9,"mat-icon"),D(10,"content_copy"),h()(),T(11,JSA,5,1,"button",106),mt(12,"async"),T(13,YSA,5,1,"button",107),mt(14,"async"),h()()}if(i&2){let A=p(2);Q(4),H("value",A.sessionDisplayNameDraft)("displayValue",A.getCurrentSessionDisplayName())("tooltip",A.sessionId),Q(2),H("title",A.sessionId),Q(),nA(A.sessionId),Q(4),O(Ft(12,7,A.isExportSessionEnabledObs)?11:-1),Q(2),O(Ft(14,9,A.isDeleteSessionEnabledObs)?13:-1)}}function zSA(i,e){if(i&1){let A=aA();I(0,"div",76)(1,"span",77),D(2,"Select a Session"),h(),I(3,"div",93),T(4,OSA,5,1,"button",94),mt(5,"async"),I(6,"button",95),U("click",function(){L(A);let n=p();return G(n.viewSession())}),I(7,"mat-icon"),D(8,"visibility"),h(),I(9,"span"),D(10,"View"),h()(),I(11,"button",96),U("click",function(){L(A);let n=p();return G(n.toggleSessionSelectorDrawer())}),I(12,"mat-icon"),D(13,"close"),h()()()(),T(14,HSA,15,11,"div",97),I(15,"div",98)(16,"app-session-tab",99,4),U("sessionSelected",function(n){L(A);let o=p();return G(o.onSessionSelectedFromDrawer(n))})("sessionReloaded",function(n){L(A);let o=p();return G(o.onSessionReloadedFromDrawer(n))}),h()()}if(i&2){let A=p();Q(4),O(Ft(5,6,A.importSessionEnabledObs)?4:-1),Q(2),H("matTooltip",A.i18n.viewSessionTooltip),Q(8),O(A.sessionId?14:-1),Q(2),H("userId",A.userId)("appName",A.appName)("sessionId",A.sessionId)}}function PSA(i,e){if(i&1){let A=aA();I(0,"app-side-panel",110),U("jumpToInvocation",function(n){L(A);let o=p();return G(o.handleJumpToInvocation(n))})("closePanel",function(){L(A);let n=p();return G(n.toggleSidePanel())})("tabChange",function(n){L(A);let o=p();return G(o.handleTabChange(n))})("sessionSelected",function(n){L(A);let o=p();return G(o.updateWithSelectedSession(n))})("evalCaseSelected",function(n){L(A);let o=p();return G(o.updateWithSelectedEvalCase(n))})("editEvalCaseRequested",function(n){L(A);let o=p();return G(o.handleEditEvalCaseRequested(n))})("testSelected",function(n){L(A);let o=p();return G(o.updateWithSelectedTest(n.testName,n.events))})("evalSetIdSelected",function(n){L(A);let o=p();return G(o.updateSelectedEvalSetId(n))})("returnToSession",function(n){L(A);let o=p();return G(o.handleReturnToSession(n))})("evalNotInstalled",function(n){L(A);let o=p();return G(o.handleEvalNotInstalled(n))})("page",function(n){L(A);let o=p();return G(o.handlePageEvent(n))})("closeSelectedEvent",function(){L(A);let n=p();return G(n.closeSelectedEvent())})("openImageDialog",function(n){L(A);let o=p();return G(o.openViewImageDialog(n))})("openAddItemDialog",function(){L(A);let n=p();return G(n.openAddItemDialog())})("enterBuilderMode",function(){L(A);let n=p();return G(n.enterBuilderMode())})("showAgentStructureGraph",function(){L(A);let n=p();return G(n.openAgentStructureGraphDialog("event"))})("switchToEvent",function(n){L(A);let o=p();return G(o.selectEvent(n))})("switchToTraceView",function(){L(A);let n=p();return G(n.switchToTraceView())})("drillDownNodePath",function(n){L(A);let o=p();return G(o.onEventTabDrillDown(n))})("selectEventById",function(n){L(A);let o=p();return G(o.selectEvent(n))}),h()}if(i&2){let A=p();H("isApplicationSelectorEnabledObs",A.isApplicationSelectorEnabledObs)("showSidePanel",A.showSidePanel)("appName",A.appName)("userId",A.userId)("sessionId",A.sessionId)("isViewOnlySession",A.isViewOnlySession())("isViewOnlyAppNameMismatch",A.isViewOnlyAppNameMismatch())("traceData",A.traceData)("eventData",A.eventData)("currentSessionState",A.currentSessionState)("artifacts",A.artifacts)("selectedEvent",A.selectedEvent)("selectedEventIndex",A.selectedEventIndex)("renderedEventGraph",A.renderedEventGraph)("rawSvgString",A.rawSvgString)("selectedEventGraphPath",A.selectedEventGraphPath)("llmRequest",A.llmRequest)("llmResponse",A.llmResponse)("disableBuilderIcon",A.disableBuilderSwitch)("hasSubWorkflows",A.hasSubWorkflows)("graphsAvailable",A.graphsAvailable())("invocationDisplayMap",A.invocationDisplayMap())("forceGraphTab",A.autoSelectLatestEvent)}}function jSA(i,e){if(i&1){let A=aA();I(0,"app-builder-tabs",111),U("exitBuilderMode",function(){L(A);let n=p();return G(n.exitBuilderMode())})("closePanel",function(){L(A);let n=p();return G(n.toggleSidePanel())}),h(),lA(1,"div",112)}if(i&2){let A=p();H("appNameInput",A.appName)}}function VSA(i,e){if(i&1){let A=aA();I(0,"div",37)(1,"div",113)(2,"button",114),U("click",function(){L(A);let n=p();return G(n.saveAgentBuilder())}),I(3,"mat-icon"),D(4,"check"),h()(),I(5,"button",115),U("click",function(){L(A);let n=p();return G(n.exitBuilderMode())}),I(6,"mat-icon"),D(7,"close"),h()(),I(8,"button",116),U("click",function(){L(A);let n=p();return G(n.toggleBuilderAssistant())}),I(9,"mat-icon"),D(10,"assistant"),h()()(),I(11,"app-canvas",117),U("toggleSidePanelRequest",function(){L(A);let n=p();return G(n.toggleSidePanel())})("builderAssistantCloseRequest",function(){L(A);let n=p();return G(n.toggleBuilderAssistant())}),h()()}if(i&2){let A=p();Q(8),_A("active",A.showBuilderAssistant),Q(3),H("showSidePanel",A.showSidePanel)("showBuilderAssistant",A.showBuilderAssistant)("appNameInput",A.appName)}}function qSA(i,e){if(i&1&&(I(0,"div",119)(1,"span"),D(2),h()()),i&2){let A=p(3);Q(2),nA(A.i18n.loadingAgentsLabel)}}function WSA(i,e){if(i&1&&(I(0,"span"),D(1),lA(2,"br"),D(3),h()),i&2){let A=p(4);Q(),nA(A.i18n.welcomeMessage),Q(2),Ee(" ",A.i18n.selectAgentMessage)}}function ZSA(i,e){if(i&1&&(D(0),lA(1,"br"),I(2,"pre",121),D(3),h()),i&2){let A=p(5);Ee(" ",A.i18n.errorMessageLabel," "),Q(3),nA(A.loadingError())}}function XSA(i,e){if(i&1&&(I(0,"pre",120),D(1),h()),i&2){let A=p(5);Q(),nA(A.i18n.noAgentsFoundWarning)}}function $SA(i,e){if(i&1&&(I(0,"div"),D(1),I(2,"pre"),D(3,"adk web"),h(),D(4," in the folder that contains the agents."),lA(5,"br"),T(6,ZSA,4,2)(7,XSA,2,1,"pre",120),h()),i&2){let A=p(4);Q(),Ee(" ",A.i18n.failedToLoadAgentsMessage," "),Q(5),O(A.loadingError()?6:7)}}function AkA(i,e){if(i&1&&(I(0,"div",119),T(1,WSA,4,2,"span"),mt(2,"async"),S1(3,$SA,8,2,"div"),h()),i&2){let A=p(3);Q(),O((Ft(2,1,A.apps$)||Lc(3,z$)).length>0?1:3)}}function ekA(i,e){if(i&1&&(T(0,qSA,3,1,"div",119),mt(1,"async"),S1(2,AkA,4,4,"div",119)),i&2){let A=p(2);O(A.isLoadingApps()?0:Ft(1,1,A.isApplicationSelectorEnabledObs)?2:-1)}}function tkA(i,e){if(i&1){let A=aA();I(0,"div",145,8),U("click",function(n){return n.stopPropagation()}),I(2,"span",146),D(3),h(),I(4,"button",147),U("click",function(n){L(A);let o=p(4);return G(o.removeInvocationIdFilter(n))}),I(5,"mat-icon"),D(6,"close"),h()()()}if(i&2){p();let A=Bi(17),t=p(3);H("matMenuTriggerFor",A)("matTooltip",t.invocationIdFilter()?"Invocation: "+(t.invocationDisplayMap().get(t.invocationIdFilter())||t.invocationIdFilter()):"Filter events by a specific invocation"),Q(2),H("title",t.invocationIdFilter()?t.invocationDisplayMap().get(t.invocationIdFilter())||t.invocationIdFilter():"Invocation"),Q(),nA(t.invocationIdFilter()?t.invocationDisplayMap().get(t.invocationIdFilter())||t.invocationIdFilter():"Invocation")}}function ikA(i,e){if(i&1){let A=aA();I(0,"div",145,9),U("click",function(n){return n.stopPropagation()}),I(2,"span",63),D(3,"Node"),h(),I(4,"button",147),U("click",function(n){L(A);let o=p(4);return G(o.removeNodePathFilter(n))}),I(5,"mat-icon"),D(6,"close"),h()()()}if(i&2){p();let A=Bi(21),t=p(3);H("matMenuTriggerFor",A)("matTooltip",t.nodePathFilter()?"Node: "+t.nodePathFilter():"Filter events generated by a specific node")}}function nkA(i,e){if(i&1){let A=aA();I(0,"div",148),U("click",function(n){return n.stopPropagation()}),I(1,"span",63),D(2,"Final"),h(),I(3,"button",147),U("click",function(n){return L(A),p(4).toggleHideIntermediateEvents(),G(n.stopPropagation())}),I(4,"mat-icon"),D(5,"close"),h()()()}}function okA(i,e){if(i&1&&(I(0,"button",149,10),U("click",function(t){return t.stopPropagation()}),I(2,"mat-icon"),D(3,"add"),h(),I(4,"span"),D(5,"Filter"),h()()),i&2){p();let A=Bi(12);H("matMenuTriggerFor",A)}}function akA(i,e){if(i&1){let A=aA();I(0,"button",150),U("click",function(n){L(A);let o=p(4);return G(o.clearAllFilters(n))}),I(1,"mat-icon"),D(2,"clear_all"),h(),I(3,"span"),D(4,"Clear"),h()()}}function rkA(i,e){if(i&1){let A=aA();I(0,"button",151),U("click",function(){L(A);let n=p(4);return G(n.addInvocationIdFilter())}),D(1,"Invocation"),h()}}function skA(i,e){if(i&1){let A=aA();I(0,"button",152),U("click",function(){L(A);let n=p(4);return G(n.addNodePathFilter())}),D(1,"Node"),h()}}function lkA(i,e){if(i&1){let A=aA();I(0,"button",153),U("click",function(){L(A);let n=p(4);return G(n.toggleHideIntermediateEvents())}),D(1,"Final"),h()}}function gkA(i,e){if(i&1){let A=aA();I(0,"button",154),U("click",function(){let n=L(A).$implicit,o=p(4);return G(o.setInvocationIdFilter(n))}),I(1,"mat-icon",155),D(2,"check"),h(),D(3),h()}if(i&2){let A=e.$implicit,t=p(4);H("matTooltip",A),Q(),ft("visibility",t.invocationIdFilter()===A?"visible":"hidden"),Q(2),Ee(" ",t.invocationDisplayMap().get(A)||A," ")}}function ckA(i,e){if(i&1){let A=aA();I(0,"button",156),U("click",function(){let n=L(A).$implicit,o=p(4);return G(o.setNodePathFilter(n))}),I(1,"mat-icon",155),D(2,"check"),h(),D(3),h()}if(i&2){let A=e.$implicit,t=p(4);Q(),ft("visibility",t.nodePathFilter()===A?"visible":"hidden"),Q(2),Ee(" ",A," ")}}function CkA(i,e){if(i&1){let A=aA();I(0,"mat-button-toggle-group",130),U("change",function(n){L(A);let o=p(3);return G(o.onViewModeChange(n.value))}),I(1,"mat-button-toggle",131),D(2,"Events"),h(),I(3,"mat-button-toggle",132),D(4,"Traces"),h()(),I(5,"div",133),U("click",function(n){L(A);let o=p(3);return G(o.openAddFilterMenu(n))}),T(6,tkA,7,4,"div",134),T(7,ikA,7,2,"div",134),T(8,nkA,6,0,"div",135),T(9,okA,6,1,"button",136),T(10,akA,5,0,"button",137),h(),I(11,"mat-menu",138,5),T(13,rkA,2,0,"button",139),T(14,skA,2,0,"button",140),T(15,lkA,2,0,"button",141),h(),I(16,"mat-menu",142,6),U("closed",function(){L(A);let n=p(3);return G(n.onInvocationMenuClosed())}),ke(18,gkA,4,4,"button",143,ni),h(),I(20,"mat-menu",142,7),U("closed",function(){L(A);let n=p(3);return G(n.onNodePathMenuClosed())}),ke(22,ckA,4,3,"button",144,ni),h()}if(i&2){let A=p(3);H("value",A.viewMode()),Q(6),O(A.invocationIdFilterActive()?6:-1),Q(),O(A.nodePathFilterActive()?7:-1),Q(),O(A.hideIntermediateEvents()?8:-1),Q(),O(!A.invocationIdFilterActive()||!A.nodePathFilterActive()||!A.hideIntermediateEvents()?9:-1),Q(),O(A.invocationIdFilterActive()||A.nodePathFilterActive()||A.hideIntermediateEvents()?10:-1),Q(3),O(A.invocationIdFilterActive()?-1:13),Q(),O(A.nodePathFilterActive()?-1:14),Q(),O(A.hideIntermediateEvents()?-1:15),Q(3),_e(A.invocationIdOptions()),Q(4),_e(A.nodePathOptions())}}function dkA(i,e){i&1&&(I(0,"span",123),D(1,"README.md"),h())}function IkA(i,e){if(i&1){let A=aA();I(0,"button",157),U("click",function(){L(A);let n=p(3);return G(n.isSideBySide.set(!n.isSideBySide()))}),I(1,"mat-icon",158),D(2),h(),I(3,"span",159),D(4,"Compare"),h()()}if(i&2){let A=p(3);ft("color",A.isSideBySide()?"var(--mat-sys-primary)":"var(--mat-sys-on-surface-variant)"),Q(2),nA(A.isSideBySide()?"check_circle":"radio_button_unchecked")}}function BkA(i,e){if(i&1){let A=aA();I(0,"button",156),U("click",function(n){L(A);let o=p(4);return o.showBranches.set(!o.showBranches()),G(n.stopPropagation())}),I(1,"mat-icon",162),D(2),h(),I(3,"span",163),D(4,"Branches"),h()()}if(i&2){let A=p(4);Q(),ft("color",A.showBranches()?"var(--mat-sys-primary)":"var(--mat-sys-on-surface-variant)"),Q(),Ee(" ",A.showBranches()?"check_box":"check_box_outline_blank"," ")}}function hkA(i,e){if(i&1){let A=aA();I(0,"button",156),U("click",function(n){return L(A),p(4).toggleSse(),G(n.stopPropagation())}),I(1,"mat-icon",162),D(2),h(),I(3,"span",163),D(4,"Streaming"),h()()}if(i&2){let A=p(4);Q(),ft("color",A.useSse()?"var(--mat-sys-primary)":"var(--mat-sys-on-surface-variant)"),Q(),Ee(" ",A.useSse()?"check_box":"check_box_outline_blank"," ")}}function EkA(i,e){if(i&1&&(I(0,"button",160)(1,"mat-icon"),D(2,"more_vert"),h()(),I(3,"mat-menu",161,11),T(5,BkA,5,3,"button",144),T(6,hkA,5,3,"button",144),h()),i&2){let A=Bi(4);p();let t=Ki(10),n=Ki(11),o=p(2);H("matMenuTriggerFor",A)("matTooltip",o.i18n.moreOptionsTooltip),Q(5),O(t?5:-1),Q(),O(n?6:-1)}}function QkA(i,e){if(i&1){let A=aA();I(0,"app-chat-panel",164),mt(1,"async"),Ni("userInputChange",function(n){L(A);let o=p(3);return wi(o.userInput,n)||(o.userInput=n),G(n)}),U("toggleHideIntermediateEvents",function(){L(A);let n=p(3);return G(n.toggleHideIntermediateEvents())})("toggleSse",function(){L(A);let n=p(3);return G(n.toggleSse())})("clickEvent",function(n){L(A);let o=p(3);return G(o.clickEvent(n))})("handleKeydown",function(n){L(A);let o=p(3);return G(o.handleKeydown(n.event,n.message))})("cancelEditMessage",function(n){L(A);let o=p(3);return G(o.cancelEditMessage(n))})("saveEditMessage",function(n){L(A);let o=p(3);return G(o.saveEditMessage(n))})("openViewImageDialog",function(n){L(A);let o=p(3);return G(o.openViewImageDialog(n))})("openBase64InNewTab",function(n){L(A);let o=p(3);return G(o.openBase64InNewTab(n.data,n.mimeType))})("fileSelect",function(n){L(A);let o=p(3);return G(o.onFileSelect(n))})("removeFile",function(n){L(A);let o=p(3);return G(o.removeFile(n))})("removeStateUpdate",function(){L(A);let n=p(3);return G(n.removeStateUpdate())})("sendMessage",function(n){L(A);let o=p(3);return G(o.handleChatInput(n))})("stopMessage",function(){L(A);let n=p(3);return G(n.handleStopMessage())})("updateState",function(){L(A);let n=p(3);return G(n.updateState())})("toggleAudioRecording",function(n){L(A);let o=p(3);return G(o.toggleAudioRecording(n))})("toggleVideoRecording",function(){L(A);let n=p(3);return G(n.toggleVideoRecording())})("longRunningResponseComplete",function(n){L(A);let o=p(3);return G(o.sendMessage(n))})("manualScroll",function(){L(A);let n=p(3);return G(n.onManualScroll())}),h()}if(i&2){let A=p(3);H("appName",A.appName)("agentReadme",A.agentReadme),Ri("userInput",A.userInput),H("hideIntermediateEvents",A.hideIntermediateEvents())("uiEvents",A.filteredUiEvents())("showBranches",A.showBranches())("traceData",A.traceData)("isTokenStreamingEnabled",Ft(1,23,A.isTokenStreamingEnabledObs)??!1)("useSse",A.useSse())("isChatMode",!0)("selectedFiles",A.selectedFiles)("updatedSessionState",A.updatedSessionState())("agentGraphData",A.agentGraphData())("selectedMessageIndex",A.selectedMessageIndex)("isAudioRecording",A.isAudioRecording)("micVolume",A.micVolume())("isVideoRecording",A.isVideoRecording)("userId",A.userId)("sessionId",A.sessionId)("sessionName",A.sessionId)("invocationDisplayMap",A.invocationDisplayMap())("viewMode",A.viewMode())("shouldShowEvent",A.shouldShowEventFn)}}function ukA(i,e){if(i&1){let A=aA();I(0,"app-chat-panel",165),mt(1,"async"),Ni("userInputChange",function(n){L(A);let o=p(3);return wi(o.userInput,n)||(o.userInput=n),G(n)})("userEditEvalCaseMessageChange",function(n){L(A);let o=p(3);return wi(o.userEditEvalCaseMessage,n)||(o.userEditEvalCaseMessage=n),G(n)}),U("clickEvent",function(n){L(A);let o=p(3);return G(o.clickEvent(n))})("handleKeydown",function(n){L(A);let o=p(3);return G(o.handleKeydown(n.event,n.message))})("cancelEditMessage",function(n){L(A);let o=p(3);return G(o.cancelEditMessage(n))})("saveEditMessage",function(n){L(A);let o=p(3);return G(o.saveEditMessage(n))})("openViewImageDialog",function(n){L(A);let o=p(3);return G(o.openViewImageDialog(n))})("openBase64InNewTab",function(n){L(A);let o=p(3);return G(o.openBase64InNewTab(n.data,n.mimeType))})("editEvalCaseMessage",function(n){L(A);let o=p(3);return G(o.editEvalCaseMessage(n))})("deleteEvalCaseMessage",function(n){L(A);let o=p(3);return G(o.deleteEvalCaseMessage(n.message,n.index))})("editFunctionArgs",function(n){L(A);let o=p(3);return G(o.editFunctionArgs(n))}),h()}if(i&2){let A=p(3);H("appName",A.appName)("agentReadme",A.agentReadme)("hideIntermediateEvents",A.hideIntermediateEvents())("uiEvents",A.filteredUiEvents())("showBranches",A.showBranches())("isChatMode",!1)("evalCase",A.evalCase)("isEvalEditMode",A.isEvalEditMode())("isEvalCaseEditing",A.isEvalCaseEditing())("isEditFunctionArgsEnabled",Ft(1,20,A.isEditFunctionArgsEnabledObs)??!1),Ri("userInput",A.userInput)("userEditEvalCaseMessage",A.userEditEvalCaseMessage),H("agentGraphData",A.agentGraphData())("selectedMessageIndex",A.selectedMessageIndex)("userId",A.userId)("sessionId",A.sessionId)("sessionName",A.sessionId)("invocationDisplayMap",A.invocationDisplayMap())("viewMode",A.viewMode())("shouldShowEvent",A.shouldShowEventFn)}}function pkA(i,e){if(i&1&&(I(0,"div",179),D(1),h()),i&2){p();let A=Ki(40);Q(),Ee(" ",A)}}function fkA(i,e){if(i&1&&(I(0,"div",171)(1,"span",172),D(2),mt(3,"formatMetricName"),h(),I(4,"div",173)(5,"span",174),D(6),mt(7,"number"),h(),I(8,"span",175),D(9),mt(10,"number"),h()(),I(11,"div",176)(12,"div",177),D(13),mt(14,"formatMetricName"),h(),I(15,"div",178),D(16),h(),I(17,"div",48)(18,"div",50)(19,"span",51),D(20,"Actual:"),h(),I(21,"span",52),D(22),mt(23,"number"),h()(),I(24,"div",50)(25,"span",51),D(26,"Threshold:"),h(),I(27,"span",52),D(28),mt(29,"number"),h()(),I(30,"div",50)(31,"span",51),D(32,"Min:"),h(),I(33,"span",52),D(34),h()(),I(35,"div",50)(36,"span",51),D(37,"Max:"),h(),I(38,"span",52),D(39),h()()(),ro(40),T(41,pkA,2,1,"div",179),h()()),i&2){let A=e.$implicit,t=p(6);ft("border",A.evalStatus==1?"1px solid #2e7d32":"1px solid var(--mat-sys-error)"),Q(2),nA(Ft(3,16,A.metricName)),Q(3),ft("color",A.evalStatus==1?"#2e7d32":"var(--mat-sys-error)"),Q(),Ee(" ",A.score!=null?G0(7,18,A.score,"1.2-2"):"?"," "),Q(3),Ee(" / ",G0(10,21,A.threshold,"1.2-2")," "),Q(4),nA(Ft(14,24,A.metricName)),Q(3),nA(A.metricName),Q(5),ft("color",A.evalStatus==1?"#2e7d32":"var(--mat-sys-error)"),Q(),nA(A.score!=null?G0(23,26,A.score,"1.2-2"):"?"),Q(6),nA(G0(29,29,A.threshold,"1.2-2")),Q(6),nA(t.getMetricMin(A.metricName)),Q(5),nA(t.getMetricMax(A.metricName)),Q();let n=so(t.getMetricDescription(A.metricName));Q(),O(n?41:-1)}}function mkA(i,e){if(i&1&&(I(0,"div",169),ke(1,fkA,42,33,"div",170,lSA),h()),i&2){p();let A=Ki(0);Q(),_e(A.overallEvalMetricResults)}}function wkA(i,e){if(i&1&&(ro(0),I(1,"div",166),T(2,mkA,3,0,"div",169),h()),i&2){let A=so(p(4).evalCaseResult());Q(2),O(A.overallEvalMetricResults!=null&&A.overallEvalMetricResults.length?2:-1)}}function ykA(i,e){if(i&1){let A=aA();I(0,"div",167)(1,"div",180)(2,"div",181),D(3,"Expected"),h(),I(4,"app-chat-panel",182),U("manualScroll",function(){L(A);let n=p(4);return G(n.onManualScroll())}),h()(),I(5,"div",180)(6,"div",181),D(7,"Actual"),h(),I(8,"app-chat-panel",183),mt(9,"async"),mt(10,"async"),U("toggleHideIntermediateEvents",function(){L(A);let n=p(4);return G(n.toggleHideIntermediateEvents())})("toggleSse",function(){L(A);let n=p(4);return G(n.toggleSse())}),Ni("userInputChange",function(n){L(A);let o=p(4);return wi(o.userInput,n)||(o.userInput=n),G(n)})("userEditEvalCaseMessageChange",function(n){L(A);let o=p(4);return wi(o.userEditEvalCaseMessage,n)||(o.userEditEvalCaseMessage=n),G(n)}),U("clickEvent",function(n){L(A);let o=p(4);return G(o.clickEvent(n))})("handleKeydown",function(n){L(A);let o=p(4);return G(o.handleKeydown(n.event,n.message))})("cancelEditMessage",function(n){L(A);let o=p(4);return G(o.cancelEditMessage(n))})("saveEditMessage",function(n){L(A);let o=p(4);return G(o.saveEditMessage(n))})("openViewImageDialog",function(n){L(A);let o=p(4);return G(o.openViewImageDialog(n))})("openBase64InNewTab",function(n){L(A);let o=p(4);return G(o.openBase64InNewTab(n.data,n.mimeType))})("editEvalCaseMessage",function(n){L(A);let o=p(4);return G(o.editEvalCaseMessage(n))})("deleteEvalCaseMessage",function(n){L(A);let o=p(4);return G(o.deleteEvalCaseMessage(n.message,n.index))})("editFunctionArgs",function(n){L(A);let o=p(4);return G(o.editFunctionArgs(n))})("fileSelect",function(n){L(A);let o=p(4);return G(o.onFileSelect(n))})("removeFile",function(n){L(A);let o=p(4);return G(o.removeFile(n))})("removeStateUpdate",function(){L(A);let n=p(4);return G(n.removeStateUpdate())})("sendMessage",function(n){L(A);let o=p(4);return G(o.handleChatInput(n))})("updateState",function(){L(A);let n=p(4);return G(n.updateState())})("toggleAudioRecording",function(n){L(A);let o=p(4);return G(o.toggleAudioRecording(n))})("toggleVideoRecording",function(){L(A);let n=p(4);return G(n.toggleVideoRecording())})("longRunningResponseComplete",function(n){L(A);let o=p(4);return G(o.sendMessage(n))})("manualScroll",function(){L(A);let n=p(4);return G(n.onManualScroll())}),h()()()}if(i&2){let A=p(4);Q(4),H("appName",A.appName)("agentReadme",A.agentReadme)("hideIntermediateEvents",A.hideIntermediateEvents())("uiEvents",A.filteredExpectedUiEvents())("showBranches",A.showBranches())("isChatMode",!1)("evalCase",A.evalCase)("isEvalEditMode",!1)("isEvalCaseEditing",!1)("isEditFunctionArgsEnabled",!1)("userInput","")("selectedFiles",Lc(56,z$))("updatedSessionState",null)("agentGraphData",A.agentGraphData())("selectedMessageIndex",-1)("isAudioRecording",!1)("micVolume",0)("isVideoRecording",!1)("userId",A.userId)("sessionId",A.sessionId)("sessionName",A.sessionId)("invocationDisplayMap",A.invocationDisplayMap())("viewMode",A.viewMode())("shouldShowEvent",A.shouldShowEventFn),Q(4),H("appName",A.appName)("agentReadme",A.agentReadme)("hideIntermediateEvents",A.hideIntermediateEvents())("uiEvents",A.filteredUiEvents())("showBranches",A.showBranches())("traceData",A.traceData)("isTokenStreamingEnabled",Ft(9,52,A.isTokenStreamingEnabledObs)??!1)("useSse",A.useSse())("isChatMode",!1)("evalCase",A.evalCase)("isEvalEditMode",A.isEvalEditMode())("isEvalCaseEditing",A.isEvalCaseEditing())("isEditFunctionArgsEnabled",Ft(10,54,A.isEditFunctionArgsEnabledObs)??!1),Ri("userInput",A.userInput)("userEditEvalCaseMessage",A.userEditEvalCaseMessage),H("selectedFiles",A.selectedFiles)("updatedSessionState",A.updatedSessionState())("agentGraphData",A.agentGraphData())("selectedMessageIndex",A.selectedMessageIndex)("isAudioRecording",A.isAudioRecording)("micVolume",A.micVolume())("isVideoRecording",A.isVideoRecording)("userId",A.userId)("sessionId",A.sessionId)("sessionName",A.sessionId)("invocationDisplayMap",A.invocationDisplayMap())("viewMode",A.viewMode())("shouldShowEvent",A.shouldShowEventFn)}}function DkA(i,e){if(i&1){let A=aA();I(0,"app-chat-panel",184),U("manualScroll",function(){L(A);let n=p(4);return G(n.onManualScroll())}),h()}if(i&2){let A=p(4);H("appName",A.appName)("agentReadme",A.agentReadme)("hideIntermediateEvents",A.hideIntermediateEvents())("uiEvents",A.filteredUiEvents())("showBranches",A.showBranches())("traceData",A.traceData)("isChatMode",!1)("evalCase",A.evalCase)("agentGraphData",A.agentGraphData())("selectedMessageIndex",A.selectedMessageIndex)("userId",A.userId)("sessionId",A.sessionId)("sessionName",A.sessionId)("invocationDisplayMap",A.invocationDisplayMap())("viewMode",A.viewMode())("shouldShowEvent",A.shouldShowEventFn)}}function vkA(i,e){if(i&1&&(T(0,wkA,3,2,"div",166),T(1,ykA,11,57,"div",167)(2,DkA,1,16,"app-chat-panel",168)),i&2){let A=p(3);O(A.evalCaseResult()?0:-1),Q(),O(A.isSideBySide()?1:2)}}function bkA(i,e){i&1&&(I(0,"div",129)(1,"mat-icon",185),D(2,"insert_drive_file"),h(),I(3,"h3",186),D(4,"File View"),h(),I(5,"p",187),D(6,"File content lost on refresh. Please re-upload the file to view or use it."),h()())}function MkA(i,e){if(i&1){let A=aA();I(0,"div",122),T(1,CkA,24,9)(2,dkA,2,0,"span",123),lA(3,"div",124),I(4,"button",125),mt(5,"async"),U("click",function(){L(A);let n=p(2);return G(n.refreshLatestSession())}),I(6,"mat-icon",18),mt(7,"async"),D(8,"refresh"),h()(),T(9,IkA,5,3,"button",126),ro(10)(11),mt(12,"async"),T(13,EkA,7,4),h(),T(14,QkA,2,25,"app-chat-panel",127)(15,ukA,2,22,"app-chat-panel",128)(16,vkA,3,2)(17,bkA,7,0,"div",129)}if(i&2){let A,t=p(2);Q(),O(t.uiEvents().length===0&&t.agentReadme?2:1),Q(3),H("matTooltip",t.i18n.retrieveLatestSessionTooltip)("disabled",Ft(5,8,t.uiStateService.isSessionLoading())===!0),Q(2),_A("spinning",Ft(7,10,t.uiStateService.isSessionLoading())),Q(3),O(t.chatType()==="eval-result"?9:-1),Q();let n=so(t.viewMode()!=="traces");Q();let o=so(Ft(12,13,t.isTokenStreamingEnabledObs)&&t.canEditSession());Q(2),O(n||o?13:-1),Q(),O((A=t.chatType())==="session"?14:A==="eval-case"?15:A==="eval-result"?16:A==="file"?17:-1)}}function SkA(i,e){if(i&1&&(I(0,"div",38),Ze(1),I(2,"mat-card",118),T(3,ekA,3,3),T(4,MkA,18,16),h()()),i&2){let A=p();Q(2),_A("no-side-panel",!A.showSidePanel),Q(),O(A.selectedAppControl.value?-1:3),Q(),O(A.appName!=""?4:-1)}}function kkA(i,e){if(i&1){let A=aA();I(0,"app-agent-structure-graph-dialog",188),U("close",function(){L(A);let n=p();return G(n.showAgentStructureOverlay=!1)}),h()}if(i&2){let A=p();H("appName",A.appName)("preloadedAppData",A.agentGraphData())("preloadedLightGraphSvg",A.agentStructureOverlayMode==="event"?A.eventGraphSvgLight:A.sessionGraphSvgLight)("preloadedDarkGraphSvg",A.agentStructureOverlayMode==="event"?A.eventGraphSvgDark:A.sessionGraphSvgDark)("startPath",A.agentStructureOverlayMode==="event"?A.selectedEventGraphPath:"")}}var _kA="root_agent",iD="q",xkA="hideSidePanel",iN="",nN="",H$="application/json+a2ui";function oN(i){for(i=i.replace(/-/g,"+").replace(/_/g,"/");i.length%4!==0;)i+="=";return i}var aN=class i extends rd{nextPageLabel="Next Event";previousPageLabel="Previous Event";firstPageLabel="First Event";lastPageLabel="Last Event";getRangeLabel=(e,A,t)=>t===0?`Event 0 of ${t}`:(t=Math.max(t,0),`Event ${e*A+1} of ${t}`);static \u0275fac=(()=>{let e;return function(t){return(e||(e=Li(i)))(t||i)}})();static \u0275prov=jA({token:i,factory:i.\u0275fac})},RkA="Restarting bidirectional streaming is not currently supported. Please refresh the page or start a new session.",nD=class i{i18n=w(h$);sidePanelI18n=w(_E);_snackbarService=w(Xc);activatedRoute=w($s);agentService=w(el);artifactService=w(EB);changeDetectorRef=w(Mt);dialog=w(Xa);document=w(ci);downloadService=w(QB);evalService=w(A0);eventService=w(fm);featureFlagService=w(Nr);graphService=w(uB);localFileService=w(mm);location=w(vm);renderer=w(on);router=w(Is);safeValuesService=w(Qs);testsService=w(c2);sessionService=w(tl);streamChatService=w(ym);webSocketService=w(mB);audioRecordingService=w(pB);audioPlayingService=w(fB);stringToColorService=w(g2);traceService=w(ng);uiStateService=w(ag);agentBuilderService=w($c);themeService=w(og,{optional:!0});logoComponent=w(wB,{optional:!0});activeSseSubscription;chatPanel=Yo(h1);canvasComponent=Yo.required(QE);sideDrawer=Yo.required("sideDrawer");sidePanel=Yo.required(xE);drawerSessionTab=Yo("drawerSessionTab");evalTab=Yo(Sc);appSearchInput=Yo("appSearchInput");canChat=ye(()=>this.chatType()==="session");isEvalCaseEditing=mA(!1);hasEvalCaseChanged=mA(!1);isEvalEditMode=mA(!1);isBuilderMode=mA(!1);chatType=mA("session");currentEvalCaseId=null;currentEvalTimestamp=null;videoElement;currentMessage="";uiEvents=mA([]);invocationDisplayMap=ye(()=>{let e=new Map,A=1,t="";for(let n of this.uiEvents()){if(n.role==="user")if(n.text)t=n.text;else if(n.event?.content?.parts?.length){let o=n.event.content.parts.find(a=>a.text);o&&o.text&&(t=o.text)}else t="User Message";if(n.event?.invocationId){let o=n.event.invocationId;if(!e.has(o)){let a=t||"User Message";a.length>50&&(a=a.substring(0,47)+"..."),e.set(o,`#${A} (${a})`),A++}}}return e});artifacts=[];userInput="";userEditEvalCaseMessage="";userId="user";appName="";sessionId="";sessionIdOfLoadedMessages="";evalCase=null;evalCaseResult=mA(null);metricsInfo=this.evalService.metricsInfo;updatedEvalCase=null;adkVersion=mA("");versionInfo=mA(null);evalSetId="";isAudioRecording=!1;micVolume=this.audioRecordingService.volumeLevel;isVideoRecording=!1;longRunningEvents=[];functionCallEventId="";redirectUri=Rr.getBaseUrlWithoutPath();isMobile=mA(window.innerWidth<=768);showSidePanel=window.localStorage.getItem("adk-side-panel-visible")!=="false";showBuilderAssistant=!0;showAppSelectorDrawer=!1;showSessionSelectorDrawer=!1;useSse=mA(window.localStorage.getItem("adk-use-sse")==="true");currentSessionState={};root_agent=_kA;updatedSessionState=mA(null);canEditSession=mA(!0);isViewOnlySession=mA(!1);isViewOnlyAppNameMismatch=mA(!1);isLoadedAppUnavailable=mA(!1);unavailableAppName=mA("");readonlySessionType=mA("");readonlySessionName=mA("");isSideBySide=mA(!1);showBranches=mA(!1);expectedUiEvents=mA([]);viewMode=mA(window.localStorage.getItem("chat-view-mode")||"events");invocationIdFilterActive=mA(!1);nodePathFilterActive=mA(!1);invocationIdFilter=mA("");nodePathFilter=mA("");invocationIdOptions=ye(()=>{let e=new Set;for(let A of this.uiEvents())A.event?.invocationId&&e.add(A.event.invocationId);return Array.from(e)});nodePathOptions=ye(()=>{let e=new Set;for(let A of this.uiEvents()){let t=A.bareNodePath;t&&e.add(t)}return Array.from(e)});invChipMenuTrigger=Yo("invChipMenuTrigger");nodeChipMenuTrigger=Yo("nodeChipMenuTrigger");addMenuTrigger=Yo("addMenuTrigger");openAddFilterMenu(e){e.stopPropagation(),this.addMenuTrigger()?.openMenu()}addInvocationIdFilter(){this.invocationIdFilterActive.set(!0),setTimeout(()=>{this.invChipMenuTrigger()?.openMenu()})}addNodePathFilter(){this.nodePathFilterActive.set(!0),setTimeout(()=>{this.nodeChipMenuTrigger()?.openMenu()})}removeInvocationIdFilter(e){e.stopPropagation(),this.invocationIdFilterActive.set(!1),this.invocationIdFilter.set("")}removeNodePathFilter(e){e.stopPropagation(),this.nodePathFilterActive.set(!1),this.nodePathFilter.set("")}setInvocationIdFilter(e){this.invocationIdFilter.set(e)}setNodePathFilter(e){this.nodePathFilter.set(e)}onInvocationMenuClosed(){this.invocationIdFilter()||this.invocationIdFilterActive.set(!1)}onNodePathMenuClosed(){this.nodePathFilter()||this.nodePathFilterActive.set(!1)}clearAllFilters(e){e.stopPropagation(),this.invocationIdFilterActive()&&(this.invocationIdFilterActive.set(!1),this.invocationIdFilter.set("")),this.nodePathFilterActive()&&(this.nodePathFilterActive.set(!1),this.nodePathFilter.set("")),this.hideIntermediateEvents()&&this.toggleHideIntermediateEvents()}shouldShowEvent(e){let A=this.invocationIdFilter();if(A&&!(e.event?.invocationId||"").includes(A))return!1;let t=this.nodePathFilter();if(t&&!(e.bareNodePath||"").includes(t))return!1;if(!this.hideIntermediateEvents()||e.role==="user")return!0;if(e.event?.content!==void 0){let n=e.event.content.parts||[];if(n.length>0&&n.every(a=>a.functionCall||a.functionResponse)){if(n.some(r=>{let s=r.functionCall?.id||r.functionResponse?.id;return s&&e.event?.longRunningToolIds?.includes(s)}))return!0}else return!0}if(e.event?.output!==void 0){let n=e.event?.nodeInfo,o=!1,a=n?.outputFor;if(Array.isArray(a)?o=a.some(r=>!r.includes("/")):typeof a=="string"?o=!a.includes("/"):n?.path&&(o=!n.path.includes("/")),o)return!0}return!1}shouldShowEventFn=this.shouldShowEvent.bind(this);getMetricTooltip(e,A,t){let n=this.metricsInfo().find(g=>g.metricName===e),o=n?.description||"",a=n?.metricValueInfo?.interval?.minValue??"?",r=n?.metricValueInfo?.interval?.maxValue??"?",s=A!=null?parseFloat(A).toFixed(2):"?",l=t!=null?parseFloat(t).toFixed(2):"?";return`${o?o+" | ":""}Actual: ${s} | Threshold: ${l} | Min: ${a} | Max: ${r}`}getMetricDescription(e){return this.metricsInfo().find(t=>t.metricName===e)?.description||""}getMetricMin(e){let t=this.metricsInfo().find(n=>n.metricName===e)?.metricValueInfo?.interval?.minValue;return t!=null?t.toFixed(2):"?"}getMetricMax(e){let t=this.metricsInfo().find(n=>n.metricName===e)?.metricValueInfo?.interval?.maxValue;return t!=null?t.toFixed(2):"?"}getVersionTooltip(){let e=this.versionInfo();return e?`Version: ${e.version} | Language: ${e.language} | Language Version: ${e.language_version}`:""}getMergedTooltip(){let e=this.sidePanelI18n.disclosureTooltip||"",A=this.getVersionTooltip();return A?`${e} | ${A}`:e}filteredUiEvents=ye(()=>this.uiEvents().filter(e=>this.shouldShowEvent(e)));filteredExpectedUiEvents=ye(()=>this.expectedUiEvents().filter(e=>this.shouldShowEvent(e)));onViewModeChange(e){this.viewMode.set(e);try{window.localStorage.setItem("chat-view-mode",e)}catch(A){}}originalSessionId="";hideIntermediateEvents=mA(window.localStorage.getItem("adk-hide-intermediate-events")==="true");toggleHideIntermediateEvents(){let e=!this.hideIntermediateEvents();this.hideIntermediateEvents.set(e),window.localStorage.setItem("adk-hide-intermediate-events",String(e))}sessionHasUsedBidi=new Set;eventData=new Map;traceData=[];renderedEventGraph;rawSvgString=null;agentGraphData=mA(null);sessionGraphSvgLight={};sessionGraphSvgDark={};sessionGraphDot={};dynamicGraphDot={};agentReadme="";graphsAvailable=mA(!0);get hasSubWorkflows(){return Object.keys(this.sessionGraphSvgLight).length>1}selectedEvent=void 0;selectedEventIndex=void 0;selectedMessageIndex=void 0;llmRequest=void 0;llmResponse=void 0;getMediaTypeFromMimetype=I6;selectedFiles=[];MediaType=iC;selectedAppControl=new Ps("",{nonNullable:!0});appDrawerSearchControl=new Ps("",{nonNullable:!0});openBase64InNewTab(e,A){this.safeValuesService.openBase64InNewTab(e,A)}isLoadingApps=mA(!1);loadingError=mA("");apps$=oe([]).pipe(mi(()=>{this.isLoadingApps.set(!0),this.selectedAppControl.disable()}),Mi(()=>this.agentService.listApps().pipe(aa(e=>(this.loadingError.set(e.message),oe(void 0))))),Ro(1),mi(e=>{this.isLoadingApps.set(!1),this.selectedAppControl.enable(),e?.length==1&&this.router.navigate([],{relativeTo:this.activatedRoute,queryParams:{app:e[0]},queryParamsHandling:"merge"})}),Js());filteredDrawerApps$=this.apps$.pipe(Mi(e=>Dr([oe(e),this.appDrawerSearchControl.valueChanges.pipe(Yn(""))])),Se(([e,A])=>{if(!e||!A||A.trim()==="")return e;let t=A.toLowerCase().trim();return e.filter(n=>n.toLowerCase().includes(t))}));importSessionEnabledObs=this.featureFlagService.isImportSessionEnabled();isEditFunctionArgsEnabledObs=this.featureFlagService.isEditFunctionArgsEnabled();isSessionUrlEnabledObs=this.featureFlagService.isSessionUrlEnabled();isApplicationSelectorEnabledObs=this.featureFlagService.isApplicationSelectorEnabled();isTokenStreamingEnabledObs=this.featureFlagService.isTokenStreamingEnabled();isExportSessionEnabledObs=this.featureFlagService.isExportSessionEnabled();isNewSessionButtonEnabledObs=this.featureFlagService.isNewSessionButtonEnabled();isEventFilteringEnabled=sr(this.featureFlagService.isEventFilteringEnabled());isApplicationSelectorEnabled=sr(this.featureFlagService.isApplicationSelectorEnabled());isDeleteSessionEnabledObs=this.featureFlagService.isDeleteSessionEnabled();isUserIdOnToolbarEnabledObs=this.featureFlagService.isUserIdOnToolbarEnabled();isDeveloperUiDisclaimerEnabledObs=this.featureFlagService.isDeveloperUiDisclaimerEnabled();disableBuilderSwitch=!1;autoSelectLatestEvent=!1;constructor(){Fn(()=>{this.themeService?.currentTheme()&&this.updateRenderedGraph()})}ngOnInit(){if(this.checkScreenSize(),this.isMobile()?this.showSidePanel=!1:this.showSidePanel=window.localStorage.getItem("adk-side-panel-visible")!=="false",this.syncSelectedAppFromUrl(),this.updateSelectedAppUrl(),this.hideSidePanelIfNeeded(),this.agentService.getVersion().subscribe(t=>{this.adkVersion.set(t.version||""),this.versionInfo.set(t)}),Dr([this.agentService.getApp(),this.activatedRoute.queryParams]).pipe(Bt(([t,n])=>!!t&&!!n[iD]),oo(),Se(([,t])=>t[iD])).subscribe(t=>{setTimeout(()=>{this.userInput=t})}),this.streamChatService.onStreamClose().subscribe(t=>{let n=`Please check server log for full details: `+t;this.openSnackBar(n,"OK")}),this.webSocketService.getMessages().subscribe(t=>{if(t)try{let n=JSON.parse(t);(n.interrupted||n.inputTranscription!==void 0&&n.partial)&&this.audioPlayingService.stopAudio(),this.appendEventRow(n),this.changeDetectorRef.detectChanges()}catch(n){}}),new URL(window.location.href).searchParams.has("code")){let t=window.location.href;window.opener?.postMessage({authResponseUrl:t},window.origin),window.close()}this.agentService.getApp().subscribe(t=>{this.appName=t,this.evalService.metricsInfo.set([])}),this.traceService.selectedTraceRow$.subscribe(t=>{t&&(this.selectedEvent=void 0,this.selectedEventIndex=void 0,this.selectedMessageIndex=void 0,this.showSidePanel||(this.showSidePanel=!0,window.localStorage.setItem("adk-side-panel-visible","true"),this.sideDrawer()?.open()),this.changeDetectorRef.detectChanges())}),this.featureFlagService.isInfinityMessageScrollingEnabled().pipe(oo()).subscribe(t=>{t&&(this.uiStateService.onNewMessagesLoaded().subscribe(n=>{this.populateMessages(n.items,!0,!n.isBackground),this.loadTraceData()}),this.uiStateService.onNewMessagesLoadingFailed().subscribe(n=>{this.openSnackBar(n.message,"OK")}))})}get sessionTab(){return this.drawerSessionTab()}switchToTraceView(){this.onViewModeChange("traces")}ngAfterViewInit(){this.showSidePanel&&this.sideDrawer()?.open(),this.isApplicationSelectorEnabled()||this.loadSessionByUrlOrReset()}selectApp(e){if(this.isLoadedAppUnavailable.set(!1),e!=this.appName){let A=!this.appName;this.agentService.setApp(e),A?this.loadSessionByUrlOrReset():this.createSessionAndReset()}}loadSessionByUrlOrReset(){this.isSessionUrlEnabledObs.subscribe(e=>{let A=this.activatedRoute.snapshot?.queryParams,t=A.session,n=A.userId,o=A.evalCase,a=A.evalResult,r=A.file;if(n&&(this.userId=n),o){this.chatType.set("eval-case");let s=o.split("/");if(s.length===2){let l=s[0],g=s[1];this.evalSetId=l,this.evalService.getEvalCase(this.appName,l,g).subscribe(C=>{C&&(this.updateWithSelectedEvalCase(C),setTimeout(()=>{let d=this.sidePanel();d.switchToEvalTab(),d.selectEvalCase(l,C)},600))})}return}if(a){this.chatType.set("eval-result");let s=a.split("/");if(console.log("loadSessionByUrlOrReset evalResultUrl parts:",s),s.length===3){let l=s[0],g=s[1],C=s[2];this.evalSetId=l;let d=`${this.appName}_${l}_${C}`;console.log("loadSessionByUrlOrReset runId:",d),this.evalService.getEvalResult(this.appName,d).subscribe(B=>{if(console.log("loadSessionByUrlOrReset runResult:",B),B){let u=B.evalCaseResults?.find(E=>E.evalId===g);if(console.log("loadSessionByUrlOrReset evalCaseResult:",u),u){let E=u.sessionId;this.evalService.getEvalCase(this.appName,l,g).subscribe(f=>{this.sessionService.getSession(this.userId,this.appName,E).subscribe(m=>{this.addEvalCaseResultToEvents(m,u);let v={id:m?.id??"",appName:m?.appName??"",userId:m?.userId??"",state:m?.state??[],events:m?.events??[],isEvalResult:!0,evalCase:f,evalCaseResult:u,timestamp:C};this.updateWithSelectedSession(v),setTimeout(()=>{let S=this.sidePanel();S.switchToEvalTab(),S.selectEvalResult(l,C,f)},600)})})}}})}return}if(r){this.chatType.set("file");return}if(!e||!t){this.chatType.set("session"),this.createSessionAndReset();return}t&&(this.chatType.set("session"),this.sessionId=t,this.loadSession(t,!0))})}loadSession(e,A=!1){this.uiStateService.setIsSessionLoading(!0),this.isViewOnlySession.set(!1),this.isViewOnlyAppNameMismatch.set(!1),Dr([this.sessionService.getSession(this.userId,this.appName,e).pipe(aa(t=>(A&&(this.openSnackBar("Cannot find specified session. Creating a new one.",void 0,3e3),this.createSessionAndReset()),oe(null)))),this.featureFlagService.isInfinityMessageScrollingEnabled()]).pipe(oo()).subscribe(([t,n])=>{this.uiStateService.setIsSessionLoading(!1),t&&(n&&t.id&&this.uiStateService.lazyLoadMessages(t.id,{pageSize:100,pageToken:""}).pipe(oo()).subscribe(),this.updateWithSelectedSession(t))})}hideSidePanelIfNeeded(){this.activatedRoute.queryParams.pipe(Bt(e=>e[xkA]==="true"),Ro(1)).subscribe(()=>{this.showSidePanel=!1,this.sideDrawer()?.close()})}createSessionAndReset(){this.resetToNewSession(),this.chatType.set("session"),this.isViewOnlySession.set(!1),this.isViewOnlyAppNameMismatch.set(!1),this.canEditSession.set(!0),this.chatPanel()?.canEditSession?.set(!0),this.eventData=new Map,this.uiEvents.set([]),this.artifacts=[],this.userInput="",this.longRunningEvents=[],this.selectedEvent=void 0,this.selectedEventIndex=void 0,this.selectedMessageIndex=void 0,this.traceService.resetTraceService()}resetToNewSession(){this.sessionId="",this.currentSessionState={},this.sessionTab?.refreshSession(),this.clearSessionUrl()}createSession(){this.uiStateService.setIsSessionListLoading(!0),this.sessionService.createSession(this.userId,this.appName).subscribe(e=>{this.currentSessionState=e.state,this.sessionId=e.id??"",this.sessionTab?.refreshSession(),this.sessionTab?.reloadSession(this.sessionId),this.isSessionUrlEnabledObs.subscribe(A=>{A&&this.updateSelectedSessionUrl()})},()=>{this.uiStateService.setIsSessionListLoading(!1)})}refreshLatestSession(){this.appName&&(this.uiStateService.setIsSessionLoading(!0),this.sessionService.listSessions(this.userId,this.appName).pipe(oo()).subscribe({next:e=>{if(e.items&&e.items.length>0){let t=e.items.sort((n,o)=>{let a=Number(n.lastUpdateTime||0);return Number(o.lastUpdateTime||0)-a})[0];t.id?this.loadSession(t.id):this.uiStateService.setIsSessionLoading(!1)}else this.uiStateService.setIsSessionLoading(!1),this.openSnackBar("No sessions found for this app.","OK");this.sessionTab?.refreshSession()},error:e=>{this.uiStateService.setIsSessionLoading(!1),this.openSnackBar("Failed to refresh sessions.","OK"),console.error("Error listing sessions:",e)}}))}handleChatInput(e){return re(this,null,function*(){if(e.preventDefault(),!this.userInput.trim()&&this.selectedFiles.length<=0||e instanceof KeyboardEvent&&(e.isComposing||e.keyCode===229))return;let A={role:"user",parts:yield this.getUserMessageParts()};this.userInput="",this.selectedFiles=[];let t=this.router.parseUrl(this.location.path());t.queryParams[iD]&&(delete t.queryParams[iD],this.location.replaceState(t.toString())),yield this.sendMessage(A)})}ensureSessionActive(e){return re(this,null,function*(){if(this.sessionId)return!0;try{let A="";e?.parts&&e.parts[0]?.text&&(A=e.parts[0].text,A.length>50&&(A=A.substring(0,47)+"..."));let t=A?{__session_metadata__:{displayName:A}}:void 0,n=yield Zp(this.sessionService.createSession(this.userId,this.appName,t));return this.currentSessionState=n.state||t||{},this.sessionId=n.id??"",this.sessionTab?.refreshSession(),this.sessionTab?.reloadSession(this.sessionId),this.drawerSessionTab()?.refreshSession(),this.drawerSessionTab()?.reloadSession(this.sessionId),this.isSessionUrlEnabledObs.pipe(oo()).subscribe(o=>{o&&this.updateSelectedSessionUrl()}),!0}catch(A){return this.openSnackBar("Failed to create session","OK"),!1}})}sendMessage(e){return re(this,null,function*(){if(!(yield this.ensureSessionActive(e)))return;let t=e.functionCallEventId;t&&delete e.functionCallEventId;let n=`user_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,o={id:n,author:e.role||"user",content:e},a=this.buildUiEventFromEvent(o);this.uiEvents.update(s=>[...s,a]),setTimeout(()=>this.changeDetectorRef.detectChanges(),0),this.eventData.set(n,o),this.eventData=new Map(this.eventData);let r={appName:this.appName,userId:this.userId,sessionId:this.sessionId,newMessage:e,streaming:this.useSse(),stateDelta:this.updatedSessionState()};t&&(r.functionCallEventId=t),this.submitAgentRunRequest(r),this.changeDetectorRef.detectChanges()})}submitAgentRunRequest(e){this.autoSelectLatestEvent=!0,this.activeSseSubscription=this.agentService.runSse(e).subscribe({next:A=>re(this,null,function*(){if(A.error){this.openSnackBar(A.error,"OK");return}this.appendEventRow(A);let t=this.sidePanel().selectedIndex===0;this.autoSelectLatestEvent&&A.id&&t&&this.selectEvent(A.id,void 0,!1),A.actions&&this.processActionStateDelta(A),this.changeDetectorRef.detectChanges()}),error:A=>{this.activeSseSubscription=void 0,console.error("Send message error:",A);let t=String(A);t.includes("aborted")||t.includes("AbortError")||this.openSnackBar(A,"OK")},complete:()=>{this.activeSseSubscription=void 0,this.updatedSessionState()&&(this.currentSessionState=this.updatedSessionState(),this.updatedSessionState.set(null)),this.featureFlagService.isSessionReloadOnNewMessageEnabled().pipe(oo()).subscribe(A=>{A&&this.sessionTab?.reloadSession(this.sessionId)}),this.loadTraceData()}})}handleStopMessage(){this.activeSseSubscription&&(this.activeSseSubscription.unsubscribe(),this.activeSseSubscription=void 0)}appendEventRow(e,A=!1){if(e.inputTranscription!==void 0?e.author="user":e.outputTranscription!==void 0&&(e.author="bot"),e.errorMessage&&e.id&&!this.eventData.has(e.id)&&(this.eventData.set(e.id,e),this.eventData=new Map(this.eventData)),e.id&&!this.eventData.has(e.id)&&(this.eventData.set(e.id,e),this.eventData=new Map(this.eventData)),this.traceService.setEventData(this.eventData),e?.longRunningToolIds&&e.longRunningToolIds.length>0){let t=this.longRunningEvents.length;this.getAsyncFunctionsFromParts(e.longRunningToolIds,e.content.parts,e.invocationId),this.functionCallEventId=e.id;for(let n=t;n{this.sendOAuthResponse(o,s,this.redirectUri)}).catch(s=>{console.error("OAuth Error:",s)});break}}}if(e.partial)this.uiEvents.update(t=>{if(t.length>0){let o=t.length-1,a=t[o],r=!!(a.event?.inputTranscription||a.event?.outputTranscription),s=!!(e.inputTranscription||e.outputTranscription);if(a.event?.partial&&a.role===(e.author==="user"?"user":"bot")&&r===s){let l=this.mergePartialEvent(a,e),g=[...t];return g[o]=l,g}}let n=this.buildUiEventFromEvent(e,A);return A?[n,...t]:[...t,n]});else{let t=this.buildUiEventFromEvent(e,A);this.uiEvents.update(n=>{let o=n.findIndex(a=>a.event?.id===e.id&&e.id);if(o<0&&n.length>0){let a=e.inputTranscription!==void 0,r=e.outputTranscription!==void 0,s=e.content?.parts?.some(l=>l.thought);if(a||r||s)if(A)for(let l=0;lC.thought))){o=l;break}}}else for(let l=n.length-1;l>=0;l--){let g=n[l].event;if(g?.partial){if(a&&g.inputTranscription!==void 0){o=l;break}if(r&&g.outputTranscription!==void 0){o=l;break}if(s&&(n[l].thought||g.content?.parts?.some(C=>C.thought))){o=l;break}}}else{let l=A?0:n.length-1,g=n[l];if(g.event?.partial){let C=!!(g.event?.inputTranscription||g.event?.outputTranscription),d=!!(e.inputTranscription||e.outputTranscription);C===d&&(o=l)}}}if(o>=0){let a=n[o];(!t.functionResponses||t.functionResponses.length===0)&&(t.functionResponses=a.functionResponses),(!t.functionCalls||t.functionCalls.length===0)&&(t.functionCalls=a.functionCalls);let r=[...n];return r[o]=t,r}else return A?[t,...n]:[...n,t]})}if(e.actions?.artifactDelta){let t=this.uiEvents().find(n=>n.event?.id===e.id);if(t)for(let n in e.actions.artifactDelta)e.actions.artifactDelta.hasOwnProperty(n)&&this.renderArtifact(n,e.actions.artifactDelta[n],t)}}mergePartialEvent(e,A){let t=new su($A(P({},e),{event:A,textParts:e.textParts?e.textParts.map(o=>P({},o)):void 0})),n=A.content?.parts||[];if(this.isEventA2aResponse(A)&&(n=this.combineA2uiDataParts(n)),n=this.combineTextParts(n),n.forEach(o=>{if(o.text!==void 0&&o.text!==null){let a=o.thought?this.processThoughtText(o.text):o.text;t.text=(t.text||"")+a;let r=!!o.thought;this.addTextToParts(t,a,r)}else this.processPartIntoMessage(o,A,t)}),t.thought=t.textParts?.every(o=>o.thought)??!1,A.inputTranscription){let o=e.event?.inputTranscription?.text||"";t.event.inputTranscription={text:o+(A.inputTranscription.text||"")}}if(A.outputTranscription){let o=e.event?.outputTranscription?.text||"";t.event.outputTranscription={text:o+(A.outputTranscription.text||"")}}return t}getUserMessageParts(){return re(this,null,function*(){let e=[];if(this.userInput.trim()&&e.push({text:`${this.userInput}`}),this.selectedFiles.length>0)for(let A of this.selectedFiles)e.push(yield this.localFileService.createMessagePartFromFile(A.file));return e})}processActionStateDelta(e){e.actions&&e.actions.stateDelta&&Object.keys(e.actions.stateDelta).length>0&&(this.currentSessionState=P(P({},this.currentSessionState||{}),e.actions.stateDelta))}combineTextParts(e){let A=[],t;for(let n of e)if(n.text){let o=!!n.thought;t&&t.text&&!!t.thought===o?t.text+=n.text:(t={text:n.text,thought:o},A.push(t))}else t=void 0,A.push(n);return A}isEventA2aResponse(e){return!!e?.customMetadata?.["a2a:response"]}isA2aDataPart(e){if(!e.inlineData||e.inlineData.mimeType!=="text/plain")return!1;let A=atob(oN(e.inlineData.data));return A.startsWith(iN)&&A.endsWith(nN)}isA2uiDataPart(e){let A=this.extractA2aDataPartJson(e);return A&&A.kind==="data"&&A.metadata?.mimeType===H$}extractA2aDataPartJson(e){if(!this.isA2aDataPart(e))return null;let A=atob(oN(e.inlineData.data)),t=A.substring(iN.length,A.length-nN.length),n;try{n=JSON.parse(t)}catch(o){return null}return n}combineA2uiDataParts(e){let A=[],t=[],n;for(let o of e)this.isA2uiDataPart(o)?(t.push(this.extractA2aDataPartJson(o)),n||(n={inlineData:{mimeType:"text/plain",data:o.inlineData.data}},A.push(n))):A.push(o);if(n?.inlineData){let a=iN+JSON.stringify({kind:"data",metadata:{mimeType:H$},data:t})+nN;n.inlineData.data=btoa(a)}return A}processA2uiPartIntoMessage(e){let A={};return e.a2ui.forEach(t=>{t.data.beginRendering?A.beginRendering=t.data:t.data.surfaceUpdate?A.surfaceUpdate=t.data:t.data.dataModelUpdate&&(A.dataModelUpdate=t.data)}),A}extractA2uiJsonFromText(e){if(!e.text)return;let A="",t="",n=e.text.indexOf(A);if(n===-1)return;let o=e.text.indexOf(t,n+A.length);if(o===-1)return;let a=e.text.substring(n+A.length,o).trim();try{let r=JSON.parse(a);Array.isArray(r)||(r=[r]);let s={};r.forEach(C=>{C.beginRendering?s.beginRendering=C:C.surfaceUpdate?s.surfaceUpdate=C:C.dataModelUpdate&&(s.dataModelUpdate=C)}),e.a2uiData=s;let l=e.text.substring(0,n),g=e.text.substring(o+t.length);if(e.text=(l+g).trim(),e.textParts){for(let C of e.textParts){let d=C.text.indexOf(A);if(d!==-1){let B=C.text.indexOf(t,d+A.length);if(B!==-1){let u=C.text.substring(0,d),E=C.text.substring(B+t.length);C.text=(u+E).trim()}}}e.textParts=e.textParts.filter(C=>C.text.trim().length>0)}}catch(r){console.warn("Failed to parse inline block from text:",r)}}updateRedirectUri(e,A){try{let t=new URL(e);return t.searchParams.set("redirect_uri",A),t.toString()}catch(t){return console.warn("Failed to update redirect URI: ",t),e}}formatBase64Data(e,A){let t=oN(e);return`data:${A};base64,${t}`}addTextToParts(e,A,t){if(!A)return;e.textParts||(e.textParts=[]);let n=e.textParts[e.textParts.length-1];n&&!!n.thought===t?n.text+=A:e.textParts.push({text:A,thought:t})}processPartIntoMessage(e,A,t){if(e)if(A&&(t.event=A,A.invocationIndex!==void 0&&(t.invocationIndex=A.invocationIndex),A.toolUseIndex!==void 0&&(t.toolUseIndex=A.toolUseIndex),A.finalResponsePartIndex!==void 0&&(t.finalResponsePartIndex=A.finalResponsePartIndex)),e.text){let n=e.thought?this.processThoughtText(e.text):e.text;t.text=(t.text||"")+n,this.addTextToParts(t,n,!!e.thought),t.thought=t.textParts?.every(o=>o.thought)??!1,A?.groundingMetadata&&A.groundingMetadata.searchEntryPoint&&A.groundingMetadata.searchEntryPoint.renderedContent&&(t.renderedContent=A.groundingMetadata.searchEntryPoint.renderedContent),A?.id&&(t.event=A)}else if(e.inlineData){let n=this.formatBase64Data(e.inlineData.data,e.inlineData.mimeType),o=I6(e.inlineData.mimeType);t.inlineData={displayName:e.inlineData.displayName,data:n,mimeType:e.inlineData.mimeType,mediaType:o},t.role==="user"&&A?.id&&(t.event=A)}else if(e.functionCall){t.functionCalls||(t.functionCalls=[]);let n=A?.longRunningToolIds?.includes(e.functionCall.id),o=e.functionCall;n&&(o=$A(P({},e.functionCall),{isLongRunning:!0,invocationId:A.invocationId,functionCallEventId:A.id,needsResponse:!0,responseStatus:e.functionCall.responseStatus||"pending",userResponse:e.functionCall.userResponse||""}));let a=t.functionCalls.findIndex(r=>r.id===e.functionCall.id);a>=0?t.functionCalls[a]=P(P({},t.functionCalls[a]),o):t.functionCalls.push(o),A?.id&&(t.event=A)}else e.functionResponse?(t.functionResponses||(t.functionResponses=[]),t.functionResponses.push(e.functionResponse),A?.id&&(t.event=A)):e.executableCode?t.executableCode=e.executableCode:e.codeExecutionResult?t.codeExecutionResult=e.codeExecutionResult:e.a2ui&&(t.a2uiData=this.processA2uiPartIntoMessage(e))}handleArtifactFetchFailure(e,A,t,n){this.openSnackBar("Failed to fetch artifact data","OK"),e.error={errorMessage:"Failed to fetch artifact data"+(n?": "+(n.message||n):"")},this.changeDetectorRef.detectChanges(),this.artifacts=this.artifacts.filter(o=>o.id!==A||o.versionId!==t)}renderArtifact(e,A,t){if(this.artifacts.some(a=>a.id===e&&a.versionId===A))return;t.inlineData={data:"",mimeType:"image/png"};let o={id:e,versionId:A,data:"",mimeType:"image/png",mediaType:"image"};this.artifacts=[...this.artifacts,o],this.artifactService.getArtifactVersion(this.userId,this.appName,this.sessionId,e,A).subscribe({next:a=>{let r=a.mimeType,s=a.data;if((!r||!s)&&a.inlineData&&(r=a.inlineData.mimeType,s=a.inlineData.data),!r&&!s&&a.text){r="text/plain";try{s=btoa(unescape(encodeURIComponent(a.text)))}catch(d){console.error("Failed to encode text to base64",d),this.handleArtifactFetchFailure(t,e,A,{message:"Failed to encode text data"});return}}if(!r||!s){this.handleArtifactFetchFailure(t,e,A,{message:"Invalid response data: missing mimeType or data or text"});return}let l=this.formatBase64Data(s,r),g=I6(r),C={name:this.createDefaultArtifactName(r),data:l,mimeType:r,mediaType:g};t.inlineData=C,this.changeDetectorRef.detectChanges(),this.artifacts=this.artifacts.map(d=>d.id===e&&d.versionId===A?{id:e,versionId:A,data:l,mimeType:r,mediaType:g}:d)},error:a=>{this.handleArtifactFetchFailure(t,e,A,a)}})}sendOAuthResponse(e,A,t){this.longRunningEvents.pop();var n=structuredClone(e.args.authConfig);n.exchangedAuthCredential.oauth2.authResponseUri=A,n.exchangedAuthCredential.oauth2.redirectUri=t;let o={role:"user",parts:[{functionResponse:{id:e.id,name:e.name,response:n}}],functionCallEventId:this.functionCallEventId};this.sendMessage(o)}clickEvent(e){let A=this.uiEvents()[e],t=A.event.id;if(t){if(this.selectedMessageIndex===e){this.sideDrawer()?.open(),this.showSidePanel=!0,window.localStorage.setItem("adk-side-panel-visible","true");return}if(A.role==="user"){this.selectedEvent=this.eventData.get(t),this.selectedEventIndex=this.getIndexOfKeyInMap(t),this.selectedMessageIndex=e,this.llmRequest=void 0,this.llmResponse=void 0,this.sideDrawer()?.open(),this.showSidePanel=!0,window.localStorage.setItem("adk-side-panel-visible","true"),this.updateRenderedGraph(),this.viewMode()!=="events"&&this.onViewModeChange("events");return}this.sideDrawer()?.open(),this.showSidePanel=!0,window.localStorage.setItem("adk-side-panel-visible","true"),this.selectEvent(t,e)}}handleJumpToInvocation(e){let A=this.uiEvents(),t=-1,n=-1;for(let o=0;o{this.chatPanel()?.scrollToSelectedMessage(t)},100))}ngOnDestroy(){this.handleStopMessage(),this.streamChatService.closeStream()}onAppSelection(e){this.isAudioRecording&&(this.stopAudioRecording(),this.isAudioRecording=!1),this.isVideoRecording&&(this.stopVideoRecording(),this.isVideoRecording=!1),this.evalTab()?.resetEvalResults(),this.traceData=[]}toggleAudioRecording(e){return re(this,null,function*(){this.isAudioRecording?this.stopAudioRecording():yield this.startAudioRecording(e)})}startAudioRecording(e){return re(this,null,function*(){if(this.sessionId&&this.sessionHasUsedBidi.has(this.sessionId)){this.openSnackBar(RkA,"OK");return}(yield this.ensureSessionActive())&&(this.isAudioRecording=!0,this.streamChatService.startAudioChat({appName:this.appName,userId:this.userId,sessionId:this.sessionId,flags:e}),this.sessionHasUsedBidi.add(this.sessionId))})}stopAudioRecording(){this.audioPlayingService.stopAudio(),this.streamChatService.stopAudioChat(),this.isAudioRecording=!1,this.isVideoRecording&&this.stopVideoRecording()}toggleVideoRecording(){this.isVideoRecording?this.stopVideoRecording():this.startVideoRecording()}startVideoRecording(){let e=this.chatPanel()?.videoContainer;e&&(this.isVideoRecording=!0,this.streamChatService.startVideoStreaming(e))}stopVideoRecording(){let e=this.chatPanel()?.videoContainer;e&&(this.streamChatService.stopVideoStreaming(e),this.isVideoRecording=!1)}getAsyncFunctionsFromParts(e,A,t){for(let n of A)n.functionCall&&e.includes(n.functionCall.id)&&this.longRunningEvents.push({function:n.functionCall,invocationId:t})}openOAuthPopup(e){return new Promise((A,t)=>{if(!this.safeValuesService.windowOpen(window,e,"oauthPopup","width=600,height=700")){t("Popup blocked!");return}let o=a=>{if(a.origin!==window.location.origin)return;let{authResponseUrl:r}=a.data;r?(A(r),window.removeEventListener("message",o)):console.log("OAuth failed",a)};window.addEventListener("message",o)})}toggleSidePanel(){this.showSidePanel?(this.sideDrawer()?.close(),this.selectedEvent=void 0,this.selectedEventIndex=void 0,this.selectedMessageIndex=void 0):this.sideDrawer()?.open(),this.showSidePanel=!this.showSidePanel,window.localStorage.setItem("adk-side-panel-visible",this.showSidePanel.toString())}toggleAppSelectorDrawer(){this.showSessionSelectorDrawer=!1,this.showAppSelectorDrawer=!this.showAppSelectorDrawer,this.showAppSelectorDrawer&&this.appDrawerSearchControl.setValue("")}onSelectorDrawerOpened(){this.showAppSelectorDrawer&&this.appSearchInput()?.nativeElement.focus()}handleAppSearchKeydown(e){if(e.key==="ArrowDown"){e.preventDefault(),e.stopPropagation();let A=this.document.querySelector(".app-selector-list .app-selector-item");A&&A.focus()}}handleAppListKeydown(e){if(e.key!=="ArrowDown"&&e.key!=="ArrowUp")return;e.stopPropagation();let A=Array.from(this.document.querySelectorAll(".app-selector-list .app-selector-item")),t=A.indexOf(this.document.activeElement);if(t>-1){if(e.preventDefault(),e.key==="ArrowDown"){let n=t+1;n=0?A[n].focus():this.appSearchInput()?.nativeElement.focus()}}}onAppSelectorDrawerClosed(){this.showAppSelectorDrawer=!1}toggleSessionSelectorDrawer(){this.showAppSelectorDrawer=!1,this.showSessionSelectorDrawer=!this.showSessionSelectorDrawer}onSessionSelectorDrawerClosed(){this.showSessionSelectorDrawer=!1}onSelectorDrawerClosed(){this.showAppSelectorDrawer=!1,this.showSessionSelectorDrawer=!1}onSessionSelectedFromDrawer(e){this.showSessionSelectorDrawer=!1,this.loadSession(e)}onSessionReloadedFromDrawer(e){this.loadSession(e)}selectAppFromDrawer(e){this.selectedAppControl.setValue(e),this.showAppSelectorDrawer=!1}handleTabChange(e){this.canChat()||(this.resetEditEvalCaseVars(),this.handleReturnToSession(!0))}handleReturnToSession(e){this.sessionTab?.getSession(this.sessionId),this.evalTab()?.resetEvalCase(),this.chatType.set("session")}handleEvalNotInstalled(e){e&&this.openSnackBar(e,"OK")}resetEventsAndMessages({keepMessages:e}={}){e||(this.eventData.clear(),this.uiEvents.set([]),this.selectedEvent=void 0,this.selectedEventIndex=void 0,this.selectedMessageIndex=void 0),this.artifacts=[]}loadTraceData(){this.sessionId&&(this.uiStateService.setIsEventRequestResponseLoading(!0),this.eventService.getTrace(this.appName,this.sessionId).pipe(oo(),aa(e=>(console.error("[DEBUG] getTrace error:",e),oe([])))).subscribe(e=>{this.traceData=e,this.updateSystemInstructionFlags(),this.traceService.setEventData(this.eventData),this.traceService.setMessages(this.uiEvents()),this.selectedEvent&&this.populateLlmRequestResponse(),this.uiStateService.setIsEventRequestResponseLoading(!1),this.changeDetectorRef.detectChanges()}),this.changeDetectorRef.detectChanges())}updateSystemInstructionFlags(){if(!this.traceData||this.traceData.length===0||this.eventData.size===0)return;let e=n=>{let o=[];for(let a of n)o.push(a),a.children&&(o=o.concat(e(a.children)));return o},t=e(this.traceData).filter(n=>{let o=n.attrOperationName===hI,a=n.name==="call_llm";return(o||a)&&n.io?.inputs!==void 0}).sort((n,o)=>(n.start_time||0)-(o.start_time||0));for(let n of this.eventData.values())n.systemInstructionChanged=!1,n.precedingSystemInstruction=void 0,n.currentSystemInstruction=void 0;for(let n=1;n{r==="bot"&&t&&this.isA2uiDataPart(l)&&(l={a2ui:this.extractA2aDataPartJson(l).data}),this.processPartIntoMessage(l,e,s)}),this.extractA2uiJsonFromText(s),s}populateMessages(e,A=!1,t=!1){this.resetEventsAndMessages({keepMessages:t&&this.sessionIdOfLoadedMessages===this.sessionId}),e.forEach(n=>{this.appendEventRow(n,A)}),this.sessionIdOfLoadedMessages=this.sessionId}restorePendingLongRunningCalls(){let e=this.uiEvents(),A=new Set;this.uiEvents().forEach(t=>{t.functionResponses&&t.functionResponses.forEach(n=>{n.id&&A.add(n.id)})}),this.uiEvents().forEach(t=>{t.functionCalls&&t.functionCalls.forEach(n=>{let o=t.event.id?this.eventData.get(t.event.id):null;(n.isLongRunning||o?.longRunningToolIds?.includes(n.id))&&!A.has(n.id)&&(n.isLongRunning=!0,n.invocationId=o?.invocationId,n.functionCallEventId=t.event.id||"",n.needsResponse=!0,n.responseStatus="pending",n.userResponse=n.userResponse||"")})})}updateWithSelectedSession(e){if(!(!e||!e.id)){if(this.traceService.resetTraceService(),this.traceData=[],this.sessionId=e.id,this.currentSessionState=e.state||{},this.evalCase=null,this.resetEventsAndMessages(),e.isEvalResult){this.isViewOnlySession.set(!0),this.readonlySessionType.set("Eval Result");let A=e.evalCase?.evalId,t=e.timestamp;this.currentEvalCaseId=A,this.currentEvalTimestamp=t;let n=t;if(t){let o=Number(t);isNaN(o)||(n=new Date(o*1e3).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}))}this.readonlySessionName.set(A&&n?`${n} > ${A}`:e.id),this.canEditSession.set(!1),this.chatPanel()?.canEditSession?.set(!1)}else this.isViewOnlySession.set(!1);e.evalCase?this.expectedUiEvents.set(this.buildUiEventsFromEvalCase(e.evalCase)):this.expectedUiEvents.set([]),e.evalCaseResult?this.evalCaseResult.set(e.evalCaseResult):this.evalCaseResult.set(null),e.isEvalResult?this.chatType.set("eval-result"):(this.chatType.set("session"),this.isSideBySide.set(!1)),this.isSessionUrlEnabledObs.subscribe(A=>{A&&this.updateSelectedSessionUrl()}),e.events&&e.state&&(e.events.forEach(A=>{this.appendEventRow(A,!1)}),this.restorePendingLongRunningCalls()),this.changeDetectorRef.detectChanges(),this.loadTraceData(),e.isEvalResult||this.sessionService.canEdit(this.userId,e).pipe(oo(),aa(()=>oe(!0))).subscribe(A=>{this.chatPanel()?.canEditSession?.set(A),this.canEditSession.set(A)}),this.featureFlagService.isInfinityMessageScrollingEnabled().pipe(oo()).subscribe(A=>{A||this.populateMessages(e.events||[]),this.loadTraceData()})}}formatToolUses(e){if(!e||!Array.isArray(e))return[];let A=[];for(let t of e)A.push({name:t.name,args:t.args});return A}addEvalCaseResultToEvents(e,A){let t=A.evalMetricResultPerInvocation,n=-1;if(t)for(let o=0;o{this.appendEventRow(t,!1)}),this.canEditSession.set(!1),this.chatPanel()?.canEditSession?.set(!1),this.isViewOnlySession.set(!0),this.changeDetectorRef.detectChanges()}buildUiEventsFromEvalCase(e){let A=this.uiEvents(),t=this.eventData,n=this.chatType(),o=this.isViewOnlySession(),a=this.readonlySessionType(),r=this.readonlySessionName();this.uiEvents.set([]),this.eventData=new Map,this.updateWithSelectedEvalCase(e);let s=this.uiEvents();return this.uiEvents.set(A),this.eventData=t,this.chatType.set(n),this.isViewOnlySession.set(o),this.readonlySessionType.set(a),this.readonlySessionName.set(r),s}updateWithSelectedEvalCase(e){if(this.evalCase=e,this.chatType.set("eval-case"),this.isViewOnlySession.set(!0),this.readonlySessionType.set("Eval Case"),this.readonlySessionName.set(e.evalId),this.chatType.set("eval-case"),this.isSessionUrlEnabledObs.subscribe(A=>{A&&this.updateSelectedSessionUrl()}),this.resetEventsAndMessages(),e.events&&e.events.length>0)for(let A of e.events)this.appendEventRow(A,!1);else{e.events=[];let A=0;for(let t of e.conversation){if(t.userContent?.parts&&e.events.push({author:"user",content:t.userContent,invocationIndex:A}),t.intermediateData?.invocationEvents){let n=0;for(let o of t.intermediateData.invocationEvents)o.invocationIndex=A,o.content?.parts?.[0]?.functionCall&&(o.toolUseIndex=n,n++),e.events.push(o)}else if(t.intermediateData?.toolUses){let n=0;for(let o of t.intermediateData.toolUses)e.events.push({author:"bot",content:{parts:[{functionCall:{name:o.name,args:o.args}}]},invocationIndex:A,toolUseIndex:n}),n++,e.events.push({author:"bot",content:{parts:[{functionResponse:{name:o.name}}]},invocationIndex:A})}t.finalResponse?.parts&&e.events.push({author:"bot",content:t.finalResponse,invocationIndex:A}),A++}for(let t of e.events)this.appendEventRow(t,!1)}}handleEditEvalCaseRequested(e){this.updateWithSelectedEvalCase(e),this.editEvalCase()}updateSelectedEvalSetId(e){this.evalSetId=e}editEvalCaseMessage(e){this.isEvalCaseEditing.set(!0),this.userEditEvalCaseMessage=e.text,e.isEditing=!0,setTimeout(()=>{let A=this.chatPanel()?.textarea?.nativeElement;if(!A)return;A.focus();let t=A.value.length;e.text.charAt(t-1)===` `&&t--,A.setSelectionRange(t,t)},0)}editFunctionArgs(e){this.isEvalCaseEditing.set(!0),this.dialog.open(CI,{maxWidth:"90vw",maxHeight:"90vh",data:{dialogHeader:"Edit function arguments",functionName:e.functionCall.name,jsonContent:e.functionCall.args}}).afterClosed().subscribe(t=>{this.isEvalCaseEditing.set(!1),t&&(this.hasEvalCaseChanged.set(!0),e.functionCall.args=t,this.updatedEvalCase=structuredClone(this.evalCase),this.updatedEvalCase.conversation[e.invocationIndex].intermediateData.toolUses[e.toolUseIndex].args=t)})}saveEvalCase(){this.evalService.updateEvalCase(this.appName,this.evalSetId,this.updatedEvalCase.evalId,this.updatedEvalCase).subscribe(e=>{this.openSnackBar("Eval case updated","OK"),this.resetEditEvalCaseVars()})}cancelEditEvalCase(){this.resetEditEvalCaseVars(),this.updateWithSelectedEvalCase(this.evalCase)}resetEditEvalCaseVars(){this.hasEvalCaseChanged.set(!1),this.isEvalCaseEditing.set(!1),this.isEvalEditMode.set(!1),this.updatedEvalCase=null}cancelEditMessage(e){e.isEditing=!1,this.isEvalCaseEditing.set(!1)}saveEditMessage(e){this.hasEvalCaseChanged.set(!0),this.isEvalCaseEditing.set(!1),e.isEditing=!1,e.text=this.userEditEvalCaseMessage?this.userEditEvalCaseMessage:" ",this.updatedEvalCase=structuredClone(this.evalCase),this.updatedEvalCase.conversation[e.invocationIndex].finalResponse.parts[e.finalResponsePartIndex]={text:this.userEditEvalCaseMessage},this.userEditEvalCaseMessage=""}handleKeydown(e,A){e.key==="Enter"&&!e.shiftKey?(e.preventDefault(),this.saveEditMessage(A)):e.key==="Escape"&&this.cancelEditMessage(A)}deleteEvalCaseMessage(e,A){this.hasEvalCaseChanged.set(!0),this.uiEvents.update(t=>t.filter((n,o)=>o!==A)),this.updatedEvalCase=structuredClone(this.evalCase),this.updatedEvalCase.conversation[e.invocationIndex].finalResponse.parts.splice(e.finalResponsePartIndex,1)}editEvalCase(){this.isEvalEditMode.set(!0),this.isViewOnlySession.set(!1)}deleteEvalCase(){let e={title:"Confirm delete",message:`Are you sure you want to delete ${this.evalCase.evalId}?`,confirmButtonText:"Delete",cancelButtonText:"Cancel"};this.dialog.open(Mc,{width:"600px",data:e}).afterClosed().subscribe(t=>{t&&(this.evalTab()?.deleteEvalCase(this.evalCase.evalId),this.openSnackBar("Eval case deleted","OK"))})}onNewSessionClick(){this.resetToNewSession(),this.eventData.clear(),this.uiEvents.set([]),this.artifacts=[],this.traceData=[],this.selectedEvent=void 0,this.selectedEventIndex=void 0,this.selectedMessageIndex=void 0,this.traceService.resetTraceService(),this.chatPanel()?.focusInput(),this.evalTab()?.showEvalHistory&&this.evalTab()?.toggleEvalHistoryButton()}getToolbarSessionId(){if(!this.sessionId)return"NEW SESSION";if(this.isViewOnlySession())return this.sessionId;let e=this.currentSessionState?.__session_metadata__;return e?.displayName?e.displayName:this.sessionId}getCurrentSessionDisplayName(){return this.sessionId?this.currentSessionState?.__session_metadata__?.displayName||this.sessionId:"NEW SESSION"}copySessionId(){return re(this,null,function*(){if(this.sessionId)try{yield navigator.clipboard.writeText(this.sessionId),this.openSnackBar(this.i18n.sessionIdCopiedMessage,"OK")}catch(e){this.openSnackBar(this.i18n.copySessionIdFailedMessage,"OK")}})}saveSessionName(e){if(!this.sessionId)return;let A={__session_metadata__:$A(P({},this.currentSessionState?.__session_metadata__||{}),{displayName:e})};this.currentSessionState=P(P({},this.currentSessionState),A),this.updatedSessionState.set(P(P({},this.updatedSessionState()),A)),this.sessionService.updateSession(this.userId,this.appName,this.sessionId,{stateDelta:A}).subscribe({next:()=>{this.sessionTab&&this.sessionTab.reloadSession(this.sessionId),this.drawerSessionTab()&&this.drawerSessionTab().reloadSession(this.sessionId)}})}get sessionDisplayNameDraft(){return this.currentSessionState?.__session_metadata__?.displayName||""}saveUserId(e){if(e=e.trim(),!e){this.openSnackBar(this.i18n.invalidUserIdMessage,"OK");return}this.userId=e,this.isSessionUrlEnabledObs.pipe(Ro(1)).subscribe(A=>{A&&this.updateSelectedSessionUrl()})}onFileSelect(e){let A=e.target;if(A.files)for(let t=0;t{e&&this.canvasComponent()?.loadFromYaml(e,this.appName)},error:e=>{console.error("Error loading agent configuration:",e),this.openSnackBar("Error loading agent configuration","OK")}})}exitBuilderMode(){let e=this.router.createUrlTree([],{queryParams:{mode:null},queryParamsHandling:"merge"}).toString();this.location.replaceState(e),this.isBuilderMode.set(!1),this.agentBuilderService.clear()}toggleBuilderAssistant(){this.showBuilderAssistant=!this.showBuilderAssistant}openAddItemDialog(){this.apps$.pipe(Ro(1)).subscribe(e=>{let A=this.dialog.open(l6,{width:"600px",data:{existingAppNames:e??[]}})})}eventGraphSvgLight={};eventGraphSvgDark={};selectedEventGraphPath="";showAgentStructureOverlay=!1;agentStructureOverlayMode="session";openAgentStructureGraphDialog(e="session"){this.agentStructureOverlayMode=e,this.showAgentStructureOverlay=!0}saveAgentBuilder(){this.canvasComponent()?.saveAgent(this.appName)}onEventTabDrillDown(e){this.updateRenderedGraph(void 0,e)}updateRenderedGraph(e,A){return re(this,null,function*(){let t=this.sessionGraphSvgLight,n=this.sessionGraphSvgDark;if(Object.keys(t).length===0||Object.keys(n).length===0){this.renderedEventGraph=void 0;return}let o=e||this.selectedEvent?.nodeInfo?.path;!e&&this.selectedEvent?.author==="user"&&(o="__START__");let a=o;o&&o!=="__START__"&&(a=o.split("/").map(m=>m.split("@")[0]).join("/"));let r=A!==void 0?A:"",s="";if(a&&A===void 0){let m=a.split("/");if(s=m[m.length-1],m.length>=2&&m[m.length-1]==="call_llm"&&m[m.length-2]===this.selectedEvent?.author?(s=m[m.length-2],r=m.slice(1,-2).join("/")):r=m.slice(1,-1).join("/"),r&&!(r in t&&!(r in this.dynamicGraphDot))){let S=this.tryGenerateDynamicGraph(r);if(S&&this.dynamicGraphDot[r]!==S)try{let k=yield this.graphService.render(S);this.sessionGraphSvgLight[r]=k,this.sessionGraphSvgDark[r]=k,this.dynamicGraphDot[r]=S}catch(k){console.error("Failed to render dynamic graph",k)}}for(;r&&!(r in t);){let v=r.split("/");v.pop(),r=v.join("/")}}let l=this.sessionGraphDot[r]||this.sessionGraphDot[""]||"",g=l,C=!1;if(this.selectedEvent){let m=this.getV1HighlightPairs(this.selectedEvent);for(let[v,S]of m)if(v&&S&&S===this.selectedEvent.author){let k=new RegExp(`("${S}"|${S})\\s*->\\s*("${v}"|${v})`,"g");k.test(l)&&(g=l.replace(k,"$& [dir=back]"),C=!0)}}let d="",B="";if(C)try{d=yield this.graphService.render(g),B=d}catch(m){console.error("Failed to render modified graph",m),d=t[r]||t[""]||"",B=n[r]||n[""]||""}else d=t[r]||t[""]||"",B=n[r]||n[""]||"";if(this.selectedEvent){let m=this.getV1HighlightPairs(this.selectedEvent);m.length>0&&(d=this.applyV1Highlighting(d,m,!1),B=this.applyV1Highlighting(B,m,!0))}let u=[],E=[];if(this.selectedEventIndex!==void 0){let m=Array.from(this.eventData.values()),S=m[this.selectedEventIndex]?.invocationId;for(let k=0;kz.split("@")[0]).join("/")),F){let z=F.split("/"),j=z[z.length-1],X="";z.length>=2&&z[z.length-1]==="call_llm"&&z[z.length-2]===M.author?(j=z[z.length-2],X=z.slice(1,-2).join("/")):X=z.slice(1,-1).join("/");let eA=r in this.dynamicGraphDot,Z=x?x.split("/"):[],CA=Z.length>0?Z[Z.length-1]:"",wA=eA?CA:j;X===r&&(k<=this.selectedEventIndex&&(u.length===0||u[u.length-1]!==wA)&&u.push(wA),(E.length===0||E[E.length-1]!==wA)&&E.push(wA))}}}if(this.selectedEvent){let m=this.getV1HighlightPairs(this.selectedEvent);for(let[v,S]of m)S&&S!==""&&(E.includes(S)||E.push(S),u.includes(S)||u.push(S)),v&&v!==""&&(E.includes(v)||E.push(v),u.includes(v)||u.push(v))}E.length>0&&d&&B&&(d=this.highlightExecutionPathInSvg(d,u,E,"light"),B=this.highlightExecutionPathInSvg(B,u,E,"dark")),this.selectedEventGraphPath=r,this.eventGraphSvgLight=$A(P({},t),{[r]:d}),this.eventGraphSvgDark=$A(P({},n),{[r]:B});let f=this.themeService?.currentTheme()==="dark"?B:d;this.rawSvgString=f,this.renderedEventGraph=this.safeValuesService.bypassSecurityTrustHtml(f),this.changeDetectorRef.detectChanges()})}tryGenerateDynamicGraph(e){let A=Array.from(this.eventData.values()),t=[];for(let l of A){let g=l.nodeInfo?.path;if(!g)continue;let C=g.split("/"),d=C.map(u=>u.split("@")[0]),B="";if(d.length>=2&&d[d.length-1]==="call_llm"&&d[d.length-2]===l.author?B=d.slice(1,-2).join("/"):B=d.slice(1,-1).join("/"),B===e){let u=C[C.length-1];t.push({run:u,branch:l.branch})}}if(t.length===0)return null;let n=new Set,o=new Map;for(let l of t)n.add(l.run),l.branch&&o.set(l.run,l.branch);if(n.size===0)return null;let a=`digraph G { `;a+=` rankdir=TB; diff --git a/tests/unittests/cli/test_fast_api.py b/tests/unittests/cli/test_fast_api.py index faad333eb4..959064f89a 100755 --- a/tests/unittests/cli/test_fast_api.py +++ b/tests/unittests/cli/test_fast_api.py @@ -970,6 +970,10 @@ async def stream_query_impl(**kwargs): "google.adk.telemetry._agent_engine.get_propagated_context", new_callable=MagicMock, ), + patch( + "google.auth.default", + return_value=(MagicMock(), "test-project"), + ), ): client = _create_test_client( mock_session_service, diff --git a/tests/unittests/flows/llm_flows/test_get_transfer_targets.py b/tests/unittests/flows/llm_flows/test_get_transfer_targets.py new file mode 100644 index 0000000000..8f17a60e10 --- /dev/null +++ b/tests/unittests/flows/llm_flows/test_get_transfer_targets.py @@ -0,0 +1,65 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Unit tests for _get_transfer_targets in agent_transfer module.""" + +from __future__ import annotations + +from google.adk.agents.llm_agent import Agent +from google.adk.agents.loop_agent import LoopAgent +from google.adk.flows.llm_flows.agent_transfer import _get_transfer_targets + +from ... import testing_utils + + +def test_loop_agent_peer_does_not_raise_attribute_error(): + """LoopAgent has no 'mode' attribute; _get_transfer_targets must not crash. + + Regression test for https://github.com/google/adk-python/issues/5863. + """ + mock_model = testing_utils.MockModel.create(responses=['response']) + + loop_peer = LoopAgent(name='loop_peer', sub_agents=[]) + llm_agent = Agent(name='llm_agent', model=mock_model) + + root = Agent( + name='root', + model=mock_model, + sub_agents=[llm_agent, loop_peer], + ) + + # Before the fix this raised: + # AttributeError: 'LoopAgent' object has no attribute 'mode' + targets = _get_transfer_targets(llm_agent) + + target_names = [t.name for t in targets] + # loop_peer should be included as a valid peer transfer target + assert 'loop_peer' in target_names + + +def test_loop_agent_sub_agent_does_not_raise_attribute_error(): + """LoopAgent as a sub-agent of the current agent should also not crash.""" + mock_model = testing_utils.MockModel.create(responses=['response']) + + loop_sub = LoopAgent(name='loop_sub', sub_agents=[]) + llm_agent = Agent( + name='llm_agent', + model=mock_model, + sub_agents=[loop_sub], + ) + + targets = _get_transfer_targets(llm_agent) + + target_names = [t.name for t in targets] + assert 'loop_sub' in target_names