UNPKG

mermaid

Version:

Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.

201 lines 81.5 kB
import{a as Ln}from"./chunk-BOZ75642.mjs";import{a as Fn}from"./chunk-SDIBIOXT.mjs";import{a as In}from"./chunk-R2KH53MI.mjs";import{a as Ut,b as Wt}from"./chunk-GDOATIN3.mjs";import{b as yn,c as Vn}from"./chunk-52IMQVNL.mjs";import"./chunk-MFYRHTYG.mjs";import{h as Sn}from"./chunk-3SEI7E7V.mjs";import"./chunk-JCBDXJ5W.mjs";import"./chunk-OCMJQKYE.mjs";import"./chunk-MNT3HHAC.mjs";import{h as wn}from"./chunk-TECWHJ6D.mjs";import"./chunk-F6PIGZHG.mjs";import"./chunk-JGXDHUYS.mjs";import"./chunk-TINYC7RT.mjs";import"./chunk-TDFULVG6.mjs";import{b as Cn,c as Dn,d as Tn,f as _n}from"./chunk-MIE3LDYP.mjs";import{p as $e,s as It}from"./chunk-QADHU5CF.mjs";import"./chunk-ZZ52EIBP.mjs";import{$ as le,H as pn,T as gn,U as fn,V as bn,W as mn,X as kn,Y as An,Z as En,aa as Gt,b as cn,ba as xn,c as dn,z as hn}from"./chunk-FE53TMRB.mjs";import{b as ne,h as Vt}from"./chunk-L2B47AAZ.mjs";import{a as b}from"./chunk-QVIEFLGF.mjs";var Ze={SHAPE_UNSUPPORTED:"SHAPE_UNSUPPORTED",SHAPE_REMOVED:"SHAPE_REMOVED",EDGE_OPERATOR_UNSUPPORTED:"EDGE_OPERATOR_UNSUPPORTED",REFERENCE_EDGE_LABEL_REJECTED:"REFERENCE_EDGE_LABEL_REJECTED",CONNECTOR_REF_UNRESOLVED:"CONNECTOR_REF_UNRESOLVED",CONNECTOR_REF_NOT_A_CONNECTOR:"CONNECTOR_REF_NOT_A_CONNECTOR",METADATA_KEY_MISAPPLIED:"METADATA_KEY_MISAPPLIED",DUPLICATE_ID_NODE:"DUPLICATE_ID_NODE",RESERVED_SYNTHETIC_ID:"RESERVED_SYNTHETIC_ID",CONTAINMENT_VIOLATION:"CONTAINMENT_VIOLATION",EDGE_SEMANTIC_CONTRADICTION:"EDGE_SEMANTIC_CONTRADICTION",FLOW_NO_INPUT:"FLOW_NO_INPUT"},Yn=new Set([Ze.SHAPE_UNSUPPORTED,Ze.SHAPE_REMOVED,Ze.CONTAINMENT_VIOLATION]),oi=new Set(Object.values(Ze).filter(n=>!Yn.has(n)));var Jn=new Map([["task","roundedRect"],["tool","subroutine"],["input","lean-right"],["decision","diamond"],["refdoc","lin-doc"],["action","hexagon"],["round","rect"]]),qn=new Set(["doc","stadium","terminal","circle","trapezoid","inv_trapezoid","inv-trapezoid","doublecircle","double-circle","typeDeclaration","procs","lean_left","lean-left","in-out","cylinder","ellipse","odd","tag-rect","tagged-rectangle","delay","half-rounded-rectangle","lin-rect","lined-rectangle","win-pane","window-pane","curv-trap","curved-trapezoid"]),Xn=new Set(["roundedRect","subroutine","subprocess","subproc","framed-rectangle","lean-right","diamond","lin-doc","lined-document","hexagon","hex","connector","collapsedGroup"]),et="roundedRect";function tt(n){return n&&(Jn.get(n)??n)}b(tt,"resolveShapeAlias");function Mn(n,i){for(let s of n)if(!s.isGroup){if((!s.shape||s.shape==="squareRect"||s.shape==="rect")&&(s.shape=et),qn.has(s.shape)){let r=`shape "${s.shape}" was removed in v0.8.1, using "${et}"`;i?.emitError?i.emitError("SHAPE_REMOVED",r,{nodeId:s.id}):ne.warn(`agentflow: ${r}`),s.shape=et;continue}if(!Xn.has(s.shape)){let r=`shape "${s.shape}" is not supported, using "${et}"`;i?.emitWarning?i.emitWarning("SHAPE_UNSUPPORTED",r,{nodeId:s.id}):ne.warn(`agentflow: ${r}`),s.shape=et}}}b(Mn,"normaliseNodeShapes");var nt=new Map([["tool",0],["task",1],["decision",2],["input",3],["refdoc",4],["connector",5],["action",6]]),vn=nt.size,jt=b(n=>`af-kind-${n}`,"kindClass"),Bn=[...nt.keys()],Kt=b(n=>Math.max(1,n-vn),"containerSlotCount"),zt=b((n,i)=>{let s=vn+n%Kt(i);return i>0?s%i:s},"containerSlot");function Nn(n,i,s){let r=le().themeVariables?.borderColorArray,u=Array.isArray(r)?r.length:0,l=s.size;for(let c of n??[]){if(c.isGroup||c.shape==="collapsedGroup"){let h=s.get(String(c.id))??l++;c.colorIndex=zt(h,u);continue}let a=i(String(c.id));a&&nt.has(a)&&(c.cssClasses=`${c.cssClasses??""} ${jt(a)}`.replace(/\s+/g," ").trim())}}b(Nn,"assignColorSlots");var Rn="agentflow-",Ht=new Set(["shape","view","icon","img","form","pos","w","h","class","style","labelType"]),Qn=new Set(["subroutine","subprocess","subproc","framed-rectangle","tool"]),Zn={flow:"flowGroup"};function Yt(n){if(Array.isArray(n))return n.map(s=>Yt(s));if(n===null||typeof n!="object")return n;let i={};for(let s of Object.keys(n))s==="__proto__"||s==="constructor"||s==="prototype"||(i[s]=Yt(n[s]));return i}b(Yt,"stripPrototypeKeys");function $n(n){let i=!1,s=!1,r=0,u,l=[];for(let c of n.split(`
`)){if(u!==void 0){let p=c.length-c.trimStart().length;if(c.trim()===""||p>u){l.push(c);continue}u=void 0}let a=-1;for(let p=0;p<c.length;p++){let A=c[p];if(s)A==="\\"?p++:A==='"'&&(s=!1);else if(i)A==="'"&&(i=!1);else if(A==='"')s=!0;else if(A==="'")i=!0;else if(A==="#"&&(p===0||c[p-1]===" "||c[p-1]==="	")){a=p;break}else A==="["||A==="{"?r++:(A==="]"||A==="}")&&(r=Math.max(0,r-1))}if(i||s||r>0){l.push(c);continue}let h=a>=0?c.slice(0,a):c,f=a>=0?c.slice(a):"";if(/:\s*[>|][\d+-]*\s*$/.test(h)){u=c.length-c.trimStart().length,l.push(c);continue}l.push(h.replace(/,([\t ]*)$/,"$1")+f)}return l.join(`
`)}b($n,"stripLineTrailingCommas");var Lt=class{constructor(){this.vertexCounter=0;this.config=le();this.vertices=new Map;this.edges=[];this.classes=new Map;this.subGraphs=[];this.subGraphLookup=new Map;this.globalNodes=new Set;this.connectors=new Map;this.tooltips=new Map;this.subCount=0;this.firstGraphFlag=!0;this.secCount=-1;this.posCrossRef=[];this.diagramId="";this.preserveCommentsWhenParsing=!0;this.frontmatterLineOffset=0;this.elementMappings=[];this.bareVertexMappings=new WeakSet;this.diagnostics=[];this.postParseValidationRun=!1;this.funs=[];this.setAccTitle=fn;this.setAccDescription=mn;this.setDiagramTitle=An;this.getAccTitle=bn;this.getAccDescription=kn;this.getDiagramTitle=En;this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addGlobal=this.addGlobal.bind(this),this.addConnector=this.addConnector.bind(this),this.addConnectorMapping=this.addConnectorMapping.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.setFrontmatterLineOffset=this.setFrontmatterLineOffset.bind(this),this.addVertexMapping=this.addVertexMapping.bind(this),this.extendVertexMapping=this.extendVertexMapping.bind(this),this.addEdgeMapping=this.addEdgeMapping.bind(this),this.addSubgraphMapping=this.addSubgraphMapping.bind(this),this.emitWarning=this.emitWarning.bind(this),this.emitError=this.emitError.bind(this),this.getDiagnostics=this.getDiagnostics.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{b(this,"AgentFlowDB")}sanitizeText(i){return pn.sanitizeText(i,this.config)}sanitizeNodeLabelType(i){switch(i){case"markdown":case"string":case"text":return i;default:return"markdown"}}setDiagramId(i){this.diagramId=i}lookUpDomId(i){for(let s of this.vertices.values())if(s.id===i)return this.diagramId?`${this.diagramId}-${s.domId}`:s.domId;return this.diagramId?`${this.diagramId}-${i}`:i}addVertex(i,s,r,u,l,c,a={},h,f){if(!i||i.trim().length===0)return;let p;if(h!==void 0){let m;h.includes(`
`)?m=h+`
`:m=`{
`+h+`
}`;try{p=Wt(m,{schema:Ut})??{}}catch(d){let g=h.includes(`
`)?$n(h):h;if(g!==h)try{p=Wt(g+`
`,{schema:Ut})??{}}catch{this.rethrowMetadataYamlError(d,h,f)}else this.rethrowMetadataYamlError(d,h,f)}p=Yt(p)}let A;if(p&&typeof p.shape=="string"){let m=p;A=m.shape;let d=tt(A);d&&d!==A&&(m.shape=d)}let C=this.subGraphLookup.get(i);if(C&&p){C.metadata={...C.metadata,...p};return}let I=this.connectors.get(i);if(I&&p){I.metadata={...I.metadata,...p};return}if(i==="connectors")return;let x=this.edges.find(m=>m.id===i);if(x){let m=p;m?.animate!==void 0&&(x.animate=m.animate),m?.animation!==void 0&&(x.animation=m.animation),m?.curve!==void 0&&(x.interpolate=m.curve),p&&(x.metadata={...x.metadata,...p});return}let M,D=this.vertices.get(i);if(D===void 0&&(D={id:i,labelType:"text",domId:Rn+i+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(i,D)),this.vertexCounter++,s!==void 0?(this.config=le(),M=this.sanitizeText(s.text.trim()),D.labelType=s.type,M.startsWith('"')&&M.endsWith('"')&&(M=M.substring(1,M.length-1)),D.text=M):D.text===void 0&&(D.text=i),r!==void 0&&(D.type=r),u?.forEach(m=>{D.styles.push(m)}),l?.forEach(m=>{D.classes.push(m)}),c!==void 0&&(D.dir=c),D.props===void 0?D.props=a:a!==void 0&&Object.assign(D.props,a),p){if(D.metadata={...D.metadata,...p},p.shape){let m=A??p.shape;if(typeof m!="string")throw this.positionedShapeError(`No such shape: ${JSON.stringify(m)}.`,f);if(m!==m.toLowerCase()||m.includes("_"))throw this.positionedShapeError(`No such shape: ${m}. Shape names should be lowercase.`,f);if(!wn(p.shape))throw this.positionedShapeError(`No such shape: ${p.shape}.`,f);D.type=p?.shape}p?.label&&(D.text=this.sanitizeText(p.label),D.labelType=this.sanitizeNodeLabelType(p?.labelType))}}positionedShapeError(i,s){let r=new Error(i);if(!s)return r;let u=s.first_line+this.frontmatterLineOffset;return Object.assign(r,{hash:{text:"",token:null,line:u-1,loc:{first_line:u,last_line:s.last_line+this.frontmatterLineOffset,first_column:s.first_column,last_column:s.last_column},expected:[]}}),r}rethrowMetadataYamlError(i,s,r){let u=i;if(!u||u.name!=="YAMLException"||!u.mark||!r)throw i;let l;try{let c=!s.includes(`
`),a=c?`{
`+s+`
}`:s+`
`,h=r.first_line+this.frontmatterLineOffset,f=r.first_column+2,p=b((m,d)=>c?{line:h,column:f+(m===1?d:0)}:{line:h+m,column:m===0?f+d:d},"toSource"),A=p(u.mark.line,u.mark.column),C=u.reason??(u.message??"").split(`
`)[0].replace(/\s*\(\d+:\d+\)\s*$/,""),I=a.split(`
`),x=[];if(c)x.push(1);else for(let m=u.mark.line-1;m<=u.mark.line+1;m++)m<0||m>=I.length||m===I.length-1&&I[m]===""&&m!==u.mark.line||x.push(m);let M=Math.max(...x.map(m=>String(p(m,0).line).length)),D=[];for(let m of x){let d=p(m,0).line,g=` ${String(d).padStart(M)} | `;D.push(g+I[m].replace(/\t/g,"\u2192")),m===u.mark.line&&D.push("-".repeat(g.length+u.mark.column)+"^")}l={message:`${C} (${A.line}:${A.column+1})

${D.join(`
`)}`,markLine:A.line-1,markColumn:A.column,hash:{text:"",token:null,line:A.line-1,loc:{first_line:A.line,last_line:A.line,first_column:A.column,last_column:A.column+1},expected:[]}}}catch{}throw l&&(u.message=l.message,u.mark.line=l.markLine,u.mark.column=l.markColumn,u.hash=l.hash),u}addSingleLink(i,s,r,u){let a={start:i,end:s,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};ne.info("abc78 Got edge...",a);let h=r.text;if(h!==void 0&&(a.text=this.sanitizeText(h.text.trim()),a.text.startsWith('"')&&a.text.endsWith('"')&&(a.text=a.text.substring(1,a.text.length-1)),a.labelType=this.sanitizeNodeLabelType(h.type)),r!==void 0&&(a.type=r.type,a.stroke=r.stroke,a.length=r.length>10?10:r.length,r.edgeSemantic&&(a.edgeSemantic=r.edgeSemantic)),u&&!this.edges.some(f=>f.id===u))a.id=u,a.isUserDefinedId=!0;else{let f=this.edges.filter(p=>p.start===a.start&&p.end===a.end);f.length===0?a.id=It(a.start,a.end,{counter:0,prefix:"L"}):a.id=It(a.start,a.end,{counter:f.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))ne.info("Pushing edge..."),this.edges.push(a);else throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.

Initialize mermaid with maxEdges set to a higher number to allow more edges.
You cannot set this config via configuration inside the diagram as it is a secure config.
You have to call mermaid.initialize.`)}isLinkData(i){return i!==null&&typeof i=="object"&&"id"in i&&typeof i.id=="string"}addLink(i,s,r){let u=this.isLinkData(r)?r.id.replace("@",""):void 0;ne.info("addLink",i,s,u);for(let l of i)for(let c of s){let a=l===i[i.length-1],h=c===s[0];a&&h?this.addSingleLink(l,c,r,u):this.addSingleLink(l,c,r,void 0)}}updateLinkInterpolate(i,s){i.forEach(r=>{if(r==="default"){this.edges.defaultInterpolate=s;return}if(typeof r=="number"&&r>=this.edges.length)throw new Error(`The index ${r} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);this.edges[r].interpolate=s})}updateLink(i,s){i.forEach(r=>{if(typeof r=="number"&&r>=this.edges.length)throw new Error(`The index ${r} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);r==="default"?this.edges.defaultStyle=s:(this.edges[r].style=s,(this.edges[r]?.style?.length??0)>0&&!this.edges[r]?.style?.some(u=>u?.startsWith("fill"))&&this.edges[r]?.style?.push("fill:none"))})}addClass(i,s){let r=s.join().replace(/\\,/g,"\xA7\xA7\xA7").replace(/,/g,";").replace(/§§§/g,",").split(";");i.split(",").forEach(u=>{let l=this.classes.get(u);l===void 0&&(l={id:u,styles:[],textStyles:[]},this.classes.set(u,l)),r?.forEach(c=>{if(/color/.exec(c)){let a=c.replace("fill","bgFill");l.textStyles.push(a)}l.styles.push(c)})})}setDirection(i){this.direction=i.trim(),/.*</.exec(this.direction)&&(this.direction="RL"),/.*\^/.exec(this.direction)&&(this.direction="BT"),/.*>/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),this.direction==="TD"&&(this.direction="TB")}setClass(i,s){for(let r of i.split(",")){let u=this.vertices.get(r);u&&u.classes.push(s);let l=this.edges.find(a=>a.id===r);l&&l.classes.push(s);let c=this.subGraphLookup.get(r);c&&c.classes.push(s)}}setTooltip(i,s){if(s!==void 0){s=this.sanitizeText(s);for(let r of i.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(r):r,s)}}setClickFun(i,s,r){if(le().securityLevel!=="loose"||s===void 0)return;let u=[];if(typeof r=="string"){u=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let c=0;c<u.length;c++){let a=u[c].trim();a.startsWith('"')&&a.endsWith('"')&&(a=a.substr(1,a.length-2)),u[c]=a}}u.length===0&&u.push(i);let l=this.vertices.get(i);l&&(l.haveCallback=!0,this.funs.push(()=>{let c=this.lookUpDomId(i),a=document.querySelector(`[id="${c}"]`);a!==null&&a.addEventListener("click",()=>{$e.runFunc(s,...u)},!1)}))}setLink(i,s,r){i.split(",").forEach(u=>{let l=this.vertices.get(u);l!==void 0&&(l.link=$e.formatUrl(s,this.config),l.linkTarget=r)}),this.setClass(i,"clickable")}getTooltip(i){return this.tooltips.get(i)}setClickEvent(i,s,r){i.split(",").forEach(u=>{this.setClickFun(u,s,r)}),this.setClass(i,"clickable")}bindFunctions(i){this.funs.forEach(s=>{s(i)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}isToolDefinition(i){return Qn.has(i.type)}getTools(){let i=[];for(let s of this.vertices.values())this.isToolDefinition(s)&&i.push(s);return i}getClasses(){return this.classes}setupToolTips(i){let s=Sn();Vt(i).select("svg").selectAll("g.node").on("mouseover",l=>{let c=Vt(l.currentTarget),a=c.attr("title");if(a===null)return;let h=l.currentTarget?.getBoundingClientRect();s.transition().duration(200).style("opacity",".9"),s.text(c.attr("title")).style("left",window.scrollX+h.left+(h.right-h.left)/2+"px").style("top",window.scrollY+h.bottom+"px"),s.html(hn.sanitize(a)),c.classed("hover",!0)}).on("mouseout",l=>{s.transition().duration(500).style("opacity",0),Vt(l.currentTarget).classed("hover",!1)})}clear(i="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=i,this.config=le(),this.diagramId="",this.vertexCounter=0,this.direction=void 0,this.secCount=-1,this.posCrossRef=[],this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,gn()}setGen(i){this.version=i||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(i,s,r,u){let l=i?.text?.trim(),c=r?.text;i===r&&r?.text&&/\s/.exec(r.text)&&(l=void 0);let h=b(x=>{let M={boolean:{},number:{},string:{}},D=[],m;return{nodeList:x.filter(function(g){let L=typeof g;return g.stmt&&g.stmt==="dir"?(m=g.value,!1):g.trim()===""?!1:L in M?M[L].hasOwnProperty(g)?!1:M[L][g]=!0:D.includes(g)?!1:D.push(g)}),dir:m}},"uniq")(s.flat()),f=h.nodeList,p=h.dir,A=le().flowchart??{};if(p=p??(A.inheritDir?this.getDirection()??le().direction??void 0:void 0),this.version==="gen-1")for(let x=0;x<f.length;x++)f[x]=this.lookUpDomId(f[x]);l=l??"subGraph"+this.subCount,c=c||"",c=this.sanitizeText(c),this.subCount=this.subCount+1;let C={id:l,nodes:f.filter(x=>x!==l&&!this.globalNodes.has(x)),title:c.trim(),classes:[],dir:p,labelType:this.sanitizeNodeLabelType(r?.type),type:u??"flow"};ne.info("Adding",C.id,C.nodes,C.dir),C.nodes=this.makeUniq(C,this.subGraphs).nodes;let I=this.getPosForId(l);if(I!==-1){let x=this.subGraphs[I];for(let M of C.nodes)x.nodes.includes(M)||x.nodes.push(M);C.title&&(x.title=C.title),C.dir&&(x.dir=C.dir),C.type&&(x.type=C.type),this.subGraphLookup.set(l,x)}else this.subGraphs.push(C),this.subGraphLookup.set(l,C);return l}addGlobal(i){for(let s of i.flat()){if(typeof s!="string")continue;let r=s.trim();r!==""&&this.globalNodes.add(r)}for(let s of this.subGraphs)s.nodes=s.nodes.filter(r=>!this.globalNodes.has(r))}getPosForId(i){for(let[s,r]of this.subGraphs.entries())if(r.id===i)return s;return-1}indexNodes2(i,s){let r=this.subGraphs[s].nodes;if(this.secCount=this.secCount+1,this.secCount>2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=s,this.subGraphs[s].id===i)return{result:!0,count:0};let u=0,l=1;for(;u<r.length;){let c=this.getPosForId(r[u]);if(c>=0){let a=this.indexNodes2(i,c);if(a.result)return{result:!0,count:l+a.count};l=l+a.count}u=u+1}return{result:!1,count:l}}getDepthFirstPos(i){return this.posCrossRef[i]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}addConnector(i,s){let r=i?.text?.trim();if(!r)return"";let u=s?.text?.trim()??"",l=u.length>0?this.sanitizeText(u):r,c=this.connectors.get(r);return c?u.length>0&&(c.text=l):(c={id:r,labelType:"text",domId:Rn+r+"-"+this.vertexCounter,styles:[],classes:[],isConnector:!0,text:l},this.connectors.set(r,c),this.vertices.set(r,c),this.vertexCounter++),r}getSubGraphs(){return this.subGraphs}getConnectors(){return[...this.connectors.values()]}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}computeEdgeSemantic(i,s){if(i==="arrow_point"&&s==="normal")return"sequence";if(i==="arrow_cross"&&s==="normal")return"failure";if(i==="arrow_open"&&s==="dotted")return"reference"}destructStartLink(i){let s=i.trim(),r="arrow_open",u="normal";return s.includes(".")&&(u="dotted"),{type:r,stroke:u}}countChar(i,s){let r=s.length,u=0;for(let l=0;l<r;++l)s[l]===i&&++u;return u}destructEndLink(i){let s=i.trim(),r=s.slice(0,-1),u="arrow_open";switch(s.slice(-1)){case"x":u="arrow_cross";break;case">":u="arrow_point";break;case"-":case".":u="arrow_open",r=s;break}let l="normal",c=r.length-1,a=this.countChar(".",r);return a>0&&(l="dotted",c=a),{type:u,stroke:l,length:c}}destructLink(i,s){let r=this.destructEndLink(i),u;return s?(u=this.destructStartLink(s),u.stroke!==r.stroke?{type:"INVALID",stroke:"INVALID"}:(u.type=r.type,u.length=r.length,{...u,edgeSemantic:this.computeEdgeSemantic(u.type,u.stroke)})):{...r,edgeSemantic:this.computeEdgeSemantic(r.type,r.stroke)}}exists(i,s){for(let r of i)if(r.nodes.includes(s))return!0;return!1}makeUniq(i,s){let r=[];return i.nodes.forEach((u,l)=>{this.exists(s,u)||r.push(i.nodes[l])}),{nodes:r}}getTypeFromVertex(i){let s=typeof i.type=="string"?tt(i.type):i.type;switch(s){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return s}}findNode(i,s){return i.find(r=>r.id===s)}destructEdgeType(i){let s="none",r="arrow_point";switch(i){case"arrow_point":case"arrow_circle":case"arrow_cross":case"arrow_hierarchy":r=i;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":s=i.replace("double_",""),r=s;break}return{arrowTypeStart:s,arrowTypeEnd:r}}addNodeFromVertex(i,s,r,u,l,c){let a=r.get(i.id),h=u.get(i.id)??!1,f=this.findNode(s,i.id);if(f)f.cssStyles=i.styles,f.cssCompiledStyles=this.getCompiledStyles(i.classes),f.cssClasses=i.classes.join(" ");else{let p={id:i.id,label:i.text,labelType:i.labelType,labelStyle:"",parentId:a,padding:l.flowchart?.padding||8,cssStyles:i.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...i.classes]),cssClasses:"default "+i.classes.join(" "),dir:i.dir,domId:i.domId,look:c,link:i.link,linkTarget:i.linkTarget,tooltip:this.getTooltip(i.id),metadata:i.metadata};h?s.push({...p,isGroup:!0,shape:"rect"}):s.push({...p,isGroup:!1,shape:this.getTypeFromVertex(i),wrappingWidth:l.agentflow?.wrappingWidth,minWidth:l.agentflow?.minNodeWidth})}}getCompiledStyles(i){let s=[];for(let r of i){let u=this.classes.get(r);u?.styles&&(s=[...s,...u.styles??[]].map(l=>l.trim())),u?.textStyles&&(s=[...s,...u.textStyles??[]].map(l=>l.trim()))}return s}runPostParseValidators(){this.postParseValidationRun||(this.postParseValidationRun=!0)}getData(){this.runPostParseValidators();let i=le(),s=[],r=[],u=this.getSubGraphs(),l=new Map,c=new Map,a=new Set,h=new Map,f=b((d,g,L=new Set)=>{if(L.has(d))return;L.add(d);let R=this.subGraphLookup.get(d);if(R)for(let ie of R.nodes)ie===g||L.has(ie)||(a.add(ie),h.set(ie,g),f(ie,g,L))},"collectDescendants");for(let d of u)d.metadata?.view==="collapsed"&&!a.has(d.id)&&f(d.id,d.id);let p=b((d,g)=>{let L=new Set,R=g;for(;R!==void 0&&!L.has(R);){if(R===d)return!0;L.add(R),R=l.get(R)}return!1},"wouldCloseContainmentCycle");for(let d=u.length-1;d>=0;d--){let g=u[d];if(!a.has(g.id)){g.nodes.length>0&&c.set(g.id,!0);for(let L of g.nodes){if(p(L,g.id)){this.emitWarning(Ze.CONTAINMENT_VIOLATION,`Container "${g.id}" cannot contain "${L}" because "${L}" already contains it. The nesting that would close the loop is dropped.`,{nodeId:L});continue}l.set(L,g.id)}}}for(let d=u.length-1;d>=0;d--){let g=u[d];if(a.has(g.id))continue;if(g.metadata?.view==="collapsed"){let R={...g.metadata,containerType:g.type};s.push({id:g.id,label:g.title,labelStyle:"",labelType:g.labelType,parentId:l.get(g.id),padding:8,cssCompiledStyles:this.getCompiledStyles(g.classes),cssClasses:g.classes.join(" "),shape:"collapsedGroup",dir:g.dir,isGroup:!1,look:i.look,metadata:R})}else s.push({id:g.id,label:g.title,labelStyle:"",labelType:g.labelType,parentId:l.get(g.id),padding:8,cssCompiledStyles:this.getCompiledStyles(g.classes),cssClasses:g.classes.join(" "),shape:Zn[g.type??"flow"],dir:g.dir,isGroup:!0,look:i.look,metadata:g.metadata})}this.getVertices().forEach(d=>{a.has(d.id)||this.addNodeFromVertex(d,s,l,c,i,i.look||"classic")});let C=this.getEdges();C.forEach((d,g)=>{let L=h.get(d.start)??d.start,R=h.get(d.end)??d.end;if(L===R&&d.start!==d.end)return;let{arrowTypeStart:ie,arrowTypeEnd:he}=this.destructEdgeType(d.type),ce=[...C.defaultStyle??[]];d.style&&ce.push(...d.style);let O={id:It(L,R,{counter:g,prefix:"L"},d.id),isUserDefinedId:d.isUserDefinedId,start:L,end:R,type:d.type??"normal",label:d.text,labelType:d.labelType,labelpos:"c",thickness:d.stroke,minlen:d.length,classes:d?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:d?.stroke==="invisible"||d?.type==="arrow_open"?"none":ie,arrowTypeEnd:d?.stroke==="invisible"||d?.type==="arrow_open"?"none":he,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(d.classes),labelStyle:ce,style:ce,pattern:d.stroke,look:i.look,animate:d.animate,animation:d.animation,curve:d.interpolate||this.edges.defaultInterpolate||i.flowchart?.curve,metadata:d.metadata};r.push(O)}),Mn(s,this);let I=new Map,x=new Map;for(let d of u){let g=l.get(d.id);g!==void 0&&x.set(g,[...x.get(g)??[],d.id])}let M=0,D=b(d=>{if(!I.has(d)){I.set(d,M++);for(let g of x.get(d)??[])D(g)}},"walkContainers");for(let d of u)l.get(d.id)===void 0&&D(d.id);let m=new Set(this.getConnectors().map(d=>d.id));return Nn(s,d=>{if(m.has(d))return"connector";let g=this.vertices.get(d);return g?this.deriveVertexKind(g,tt(g.type)):void 0},I),{nodes:s,edges:r,other:{},config:i,connectors:this.getConnectors()}}defaultConfig(){return xn.flowchart}deriveVertexKind(i,s){return this.isToolDefinition(i)?"tool":s==="hexagon"||s==="hex"?"action":s==="lean-right"||s==="lean_right"?"input":s==="lin-doc"||s==="lined-document"?"refdoc":s==="diamond"?"decision":"task"}getSemanticModel(){this.runPostParseValidators();let i=new Set(this.subGraphs.map(a=>a.id)),s=[],r=[];for(let[a,h]of this.vertices){if(i.has(a))continue;if(h.isConnector){let A={id:a};if(h.text!==void 0&&h.text!==a&&(A.title=h.text),h.metadata&&Object.keys(h.metadata).length>0){let C={};for(let[I,x]of Object.entries(h.metadata))Ht.has(I)||(C[I]=x);Object.keys(C).length>0&&(A.metadata=C)}r.push(A);continue}let f={id:a};h.text!==void 0&&(f.label=h.text);let p=typeof h.type=="string"?tt(h.type):h.type;if(p!==void 0&&(f.shape=p),f.vertexKind=this.deriveVertexKind(h,p),h.metadata&&Object.keys(h.metadata).length>0){let A={};for(let[C,I]of Object.entries(h.metadata))Ht.has(C)||(A[C]=I);Object.keys(A).length>0&&(f.metadata=A)}s.push(f)}let u=this.edges.map(a=>{let h={start:a.start,end:a.end};return a.id!==void 0&&(h.id=a.id),typeof a.text=="string"&&a.text.length>0&&(h.label=a.text),a.type!==void 0&&(h.type=a.type),a.stroke!==void 0&&(h.stroke=a.stroke),a.edgeSemantic!==void 0&&(h.edgeSemantic=a.edgeSemantic),a.length!==void 0&&(h.length=a.length),a.metadata&&Object.keys(a.metadata).length>0&&(h.metadata={...a.metadata}),h}),l=this.subGraphs.map(a=>{let h={id:a.id,nodes:[...a.nodes]};if(a.type!==void 0&&(h.type=a.type),a.title!==void 0&&(h.title=a.title),a.dir!==void 0&&(h.direction=a.dir),a.metadata&&Object.keys(a.metadata).length>0){let f={};for(let[p,A]of Object.entries(a.metadata))Ht.has(p)||(f[p]=A);Object.keys(f).length>0&&(h.metadata=f)}return h}),c={vertices:s,edges:u,subGraphs:l,connectors:r,diagnostics:this.diagnostics};return this.direction!==void 0&&(c.direction=this.direction),c}setFrontmatterLineOffset(i){this.frontmatterLineOffset=i??0}toElementPosition(i){let s=i?.first_line??0,r=i?.first_column??0,u=i?.last_line??s,l=i?.last_column??r,[c,a]=i?.range??[0,0];return{startLine:s+this.frontmatterLineOffset,startColumn:r,endLine:u+this.frontmatterLineOffset,endColumn:l,startIndex:c,endIndex:a}}pushMapping(i,s,r){if(!i)return;let u={id:i,type:s,position:this.toElementPosition(r)};return this.elementMappings.push(u),u}addVertexMapping(i,s,r,u){let l=this.pushMapping(i,"vertex",u);l&&r==null&&this.bareVertexMappings.add(l)}extendVertexMapping(i,s){if(!i||!s)return;let r=this.toElementPosition(s);for(let u=this.elementMappings.length-1;u>=0;u--){let l=this.elementMappings[u];if(l.type==="vertex"&&l.id===i){this.bareVertexMappings.has(l)&&(l.type="attachment",this.bareVertexMappings.delete(l)),(r.endLine>l.position.endLine||r.endLine===l.position.endLine&&r.endColumn>l.position.endColumn)&&(l.position.endLine=r.endLine,l.position.endColumn=r.endColumn,l.position.endIndex=r.endIndex);return}}this.pushMapping(i,"attachment",s)}addEdgeMapping(i,s,r,u){let l=Array.isArray(s)?s.map(a=>typeof a=="string"?a:a?.id??"").filter(Boolean):[],c=l.length>0?l.join(">"):"edge";this.pushMapping(c,"edge",u)}addSubgraphMapping(i,s,r,u){let l=(typeof i=="string"?i:i?.text)??"",c=this.toElementPosition(r),a=u?this.toElementPosition(u):c;l&&this.elementMappings.push({id:l,type:"subgraph",position:{startLine:c.startLine,startColumn:c.startColumn,endLine:a.endLine,endColumn:a.endColumn,startIndex:c.startIndex,endIndex:a.endIndex}})}addConnectorMapping(i,s,r,u){let l=i?.text?.trim()??"";if(!l)return;let c=this.toElementPosition(r),a=u?this.toElementPosition(u):c;this.elementMappings.push({id:l,type:"connector",position:{startLine:c.startLine,startColumn:c.startColumn,endLine:a.endLine,endColumn:a.endColumn,startIndex:c.startIndex,endIndex:a.endIndex}})}getElementMappings(){return[...this.elementMappings]}getElementById(i){return this.elementMappings.find(s=>s.id===i)}getElementsOnLine(i){return this.elementMappings.filter(s=>i>=s.position.startLine&&i<=s.position.endLine)}getElementAtPosition(i,s){let r=this.elementMappings.filter(l=>{let{startLine:c,startColumn:a,endLine:h,endColumn:f}=l.position;return!(i<c||i>h||i===c&&s<a||i===h&&s>f)});if(r.length===0)return;let u=b(({position:l})=>[l.endLine-l.startLine,l.endColumn-l.startColumn],"span");return r.reduce((l,c)=>{let[a,h]=u(l),[f,p]=u(c);return f!==a?f<a?c:l:p<h?c:l})}getMappingStats(){let i=0,s=0,r=0,u=0,l=0;for(let c of this.elementMappings)c.type==="vertex"?i++:c.type==="edge"?s++:c.type==="subgraph"?r++:c.type==="connector"?u++:c.type==="attachment"&&l++;return{vertices:i,edges:s,subgraphs:r,connectors:u,attachments:l,totalElements:this.elementMappings.length}}emitDiagnostic(i,s,r,u){let l=u?.nodeId??u?.edgeId,c=l?this.getElementById(l):void 0,a={id:i,severity:s,message:r,...u?.nodeId?{nodeId:u.nodeId}:{},...u?.edgeId&&!u?.nodeId?{edgeId:u.edgeId}:{},...c?{position:c.position}:{}};if(this.diagnostics.some(p=>p.id===a.id&&p.severity===a.severity&&p.message===a.message&&p.nodeId===a.nodeId&&p.edgeId===a.edgeId))return;this.diagnostics.push(a);let f=`agentflow[${i}]: ${r}`;s==="error"?ne.error(f):ne.warn(f)}emitWarning(i,s,r){this.emitDiagnostic(i,"warning",s,r)}emitError(i,s,r){this.emitDiagnostic(i,"error",s,r)}getDiagnostics(){return[...this.diagnostics]}};var ei=b(function(n,i){return i.db.getClasses()},"getClasses"),ti=b(async function(n,i,s,r){ne.debug("Drawing agentflow diagram",i);let{securityLevel:u,agentflow:l,layout:c}=le();r.db.setDiagramId(i),ne.debug("Before getData: ");let a=r.db.getData();ne.debug("Data: ",a);let h=Fn(i,u),f=r.db.getDirection();a.type=r.type,a.layoutAlgorithm=Vn(c),a.layoutAlgorithm==="dagre"&&c==="elk"&&ne.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),a.direction=f,a.nodeSpacing=l?.nodeSpacing||50,a.rankSpacing=l?.rankSpacing||50,a.markers=["point","circle","cross","hierarchy"],a.diagramId=i,ne.debug("REF1:",a),await yn(a,h);let p=l?.diagramPadding??8;$e.insertTitle(h,"agentflowTitleText",l?.titleTopMargin??0,r.db.getDiagramTitle()),In(h,p,"agentflow",l?.useMaxWidth??!0)},"draw"),On={getClasses:ei,draw:ti};var Jt=(function(){var n=b(function(De,k,E,S){for(E=E||{},S=De.length;S--;E[De[S]]=k);return E},"o"),i=[1,5],s=[1,4],r=[1,3],u=[1,6],l=[1,8,9,10,11,12,28,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],c=[2,2],a=[1,15],h=[1,16],f=[1,17],p=[1,18],A=[1,19],C=[1,26],I=[1,27],x=[1,28],M=[1,30],D=[1,31],m=[1,32],d=[1,55],g=[1,54],L=[1,34],R=[1,35],ie=[1,36],he=[1,37],ce=[1,38],O=[1,50],G=[1,52],U=[1,48],W=[1,53],j=[1,49],K=[1,56],z=[1,51],H=[1,57],Y=[1,58],Te=[1,39],_e=[1,40],we=[1,41],Fe=[1,42],ye=[1,43],Se=[1,64],T=[1,8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],Z=[1,70],$=[1,68],ee=[1,67],te=[1,69],Me=[8,9,10,12,78,80,81],ve=[1,88],Be=[1,101],Ne=[1,106],Re=[1,105],Oe=[1,102],Pe=[1,98],Ge=[1,104],Ue=[1,100],We=[1,107],je=[1,103],Ke=[1,108],ze=[1,99],Ve=[8,9,10,11,12,43,78,80,81],q=[8,9,10,11,12,43,49,78,80,81],re=[8,9,10,11,12,30,43,47,49,51,53,55,57,59,61,63,66,68,70,71,73,78,80,81,92,105,108,109,112,114,117,118,119],Xt=[8,9,10,12,47,63,78,80,81,92,105,108,109,112,114,117,118,119],He=[47,63,92,105,108,109,112,114,117,118,119],Qt=[1,131],Zt=[1,132],it=[1,134],st=[1,133],$t=[47,63,65,77,92,105,108,109,112,114,117,118,119],rt=[1,143],at=[1,157],ot=[1,158],ut=[1,159],lt=[1,162],ct=[1,161],dt=[1,160],ht=[1,145],pt=[1,147],gt=[1,151],en=[1,139],tn=[1,140],ft=[1,152],bt=[1,153],mt=[1,154],kt=[1,155],At=[1,156],Et=[1,163],xt=[1,164],St=[1,141],Ct=[1,142],Dt=[1,149],Tt=[1,144],_t=[1,148],wt=[1,146],Ye=[8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],nn=[1,168],Je=[1,170],P=[8,9,10,12],ae=[8,9,10,11,12,15,47,63,92,108,109,112,114,117,118,119],w=[1,190],X=[1,186],Q=[1,187],F=[1,191],y=[1,188],V=[1,189],qe=[80,119,122],v=[8,9,10,11,12,13,15,28,30,33,35,36,43,47,63,78,87,88,89,90,91,92,93,108,112,114,117,118,119],sn=[11,109],Ce=[32,52,54,56,58,60,65,67,69,70,72,74,119,120,121],pe=[1,269],ge=[1,267],fe=[1,271],be=[1,265],me=[1,266],ke=[1,268],Ae=[1,270],Ee=[1,272],Xe=[1,292],rn=[8,9,10,12,109],de=[8,9,10,11,12,63,87,108,109,112,113,114,115],Mt={trace:b(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,COMMENT:8,SEMI:9,NEWLINE:10,SPACE:11,EOF:12,GRAPH:13,NODIR:14,DIR:15,FirstStmtSeparator:16,ending:17,endToken:18,spaceList:19,spaceListNewline:20,vertexStatement:21,separator:22,styleStatement:23,linkStyleStatement:24,classDefStatement:25,classStatement:26,clickStatement:27,flow:28,textNoTags:29,SQS:30,text:31,SQE:32,end:33,shapeData:34,global:35,connector:36,direction:37,acc_title:38,acc_title_value:39,acc_descr:40,acc_descr_value:41,acc_descr_multiline_value:42,SHAPE_DATA:43,link:44,node:45,styledVertex:46,AMP:47,vertex:48,STYLE_SEPARATOR:49,idString:50,DOUBLECIRCLESTART:51,DOUBLECIRCLEEND:52,PS:53,PE:54,"(-":55,"-)":56,STADIUMSTART:57,STADIUMEND:58,SUBROUTINESTART:59,SUBROUTINEEND:60,VERTEX_WITH_PROPS_START:61,"NODE_STRING[field]":62,COLON:63,"NODE_STRING[value]":64,PIPE:65,CYLINDERSTART:66,CYLINDEREND:67,DIAMOND_START:68,DIAMOND_STOP:69,TAGEND:70,TRAPSTART:71,TRAPEND:72,INVTRAPSTART:73,INVTRAPEND:74,linkStatement:75,arrowText:76,TESTSTR:77,START_LINK:78,edgeText:79,LINK:80,LINK_ID:81,edgeTextToken:82,STR:83,MD_STR:84,textToken:85,keywords:86,STYLE:87,LINKSTYLE:88,CLASSDEF:89,CLASS:90,CLICK:91,DOWN:92,UP:93,textNoTagsToken:94,stylesOpt:95,"idString[vertex]":96,"idString[class]":97,CALLBACKNAME:98,CALLBACKARGS:99,HREF:100,LINK_TARGET:101,"STR[link]":102,"STR[tooltip]":103,alphaNum:104,DEFAULT:105,numList:106,INTERPOLATE:107,NUM:108,COMMA:109,style:110,styleComponent:111,NODE_STRING:112,UNIT:113,BRKT:114,PCT:115,idStringToken:116,MINUS:117,MULT:118,UNICODE_TEXT:119,TEXT:120,TAGSTART:121,EDGE_TEXT:122,alphaNumToken:123,direction_tb:124,direction_bt:125,direction_rl:126,direction_lr:127,direction_td:128,$accept:0,$end:1},terminals_:{2:"error",8:"COMMENT",9:"SEMI",10:"NEWLINE",11:"SPACE",12:"EOF",13:"GRAPH",14:"NODIR",15:"DIR",28:"flow",30:"SQS",32:"SQE",33:"end",35:"global",36:"connector",38:"acc_title",39:"acc_title_value",40:"acc_descr",41:"acc_descr_value",42:"acc_descr_multiline_value",43:"SHAPE_DATA",47:"AMP",49:"STYLE_SEPARATOR",51:"DOUBLECIRCLESTART",52:"DOUBLECIRCLEEND",53:"PS",54:"PE",55:"(-",56:"-)",57:"STADIUMSTART",58:"STADIUMEND",59:"SUBROUTINESTART",60:"SUBROUTINEEND",61:"VERTEX_WITH_PROPS_START",62:"NODE_STRING[field]",63:"COLON",64:"NODE_STRING[value]",65:"PIPE",66:"CYLINDERSTART",67:"CYLINDEREND",68:"DIAMOND_START",69:"DIAMOND_STOP",70:"TAGEND",71:"TRAPSTART",72:"TRAPEND",73:"INVTRAPSTART",74:"INVTRAPEND",77:"TESTSTR",78:"START_LINK",80:"LINK",81:"LINK_ID",83:"STR",84:"MD_STR",87:"STYLE",88:"LINKSTYLE",89:"CLASSDEF",90:"CLASS",91:"CLICK",92:"DOWN",93:"UP",96:"idString[vertex]",97:"idString[class]",98:"CALLBACKNAME",99:"CALLBACKARGS",100:"HREF",101:"LINK_TARGET",102:"STR[link]",103:"STR[tooltip]",105:"DEFAULT",107:"INTERPOLATE",108:"NUM",109:"COMMA",112:"NODE_STRING",113:"UNIT",114:"BRKT",115:"PCT",117:"MINUS",118:"MULT",119:"UNICODE_TEXT",120:"TEXT",121:"TAGSTART",122:"EDGE_TEXT",124:"direction_tb",125:"direction_bt",126:"direction_rl",127:"direction_lr",128:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,2],[4,3],[17,2],[17,1],[18,1],[18,1],[18,1],[16,1],[16,1],[16,2],[16,1],[20,2],[20,2],[20,2],[20,1],[20,1],[20,1],[19,2],[19,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,10],[7,6],[7,7],[7,4],[7,4],[7,7],[7,8],[7,4],[7,5],[7,1],[7,2],[7,2],[7,1],[22,1],[22,1],[22,1],[22,1],[34,2],[34,1],[21,4],[21,3],[21,4],[21,2],[21,2],[21,1],[45,1],[45,6],[45,5],[46,1],[46,3],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,8],[48,4],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,4],[48,4],[48,1],[44,2],[44,3],[44,3],[44,1],[44,3],[44,4],[79,1],[79,2],[79,1],[79,1],[75,1],[75,2],[76,3],[31,1],[31,2],[31,1],[31,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[29,1],[29,2],[29,1],[29,1],[25,5],[26,5],[27,2],[27,4],[27,3],[27,5],[27,3],[27,5],[27,5],[27,7],[27,2],[27,4],[27,2],[27,4],[27,4],[27,6],[23,5],[24,5],[24,5],[24,9],[24,9],[24,7],[24,7],[106,1],[106,3],[95,1],[95,3],[110,1],[110,2],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[85,1],[85,1],[85,1],[85,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[82,1],[82,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[50,1],[50,2],[104,1],[104,2],[37,1],[37,1],[37,1],[37,1],[37,1]],performAction:b(function(k,E,S,o,B,e,_){var t=e.length-1;switch(B){case 2:this.$=[];break;case 3:(!Array.isArray(e[t])||e[t].length>0)&&e[t-1].push(e[t]),this.$=e[t-1];break;case 4:case 198:this.$=e[t];break;case 5:case 33:case 34:case 35:case 36:case 37:this.$=[];break;case 13:o.setDirection("TB"),this.$="TB";break;case 14:o.setDirection(e[t-1]),this.$=e[t-1];break;case 32:this.$=e[t-1].nodes;break;case 38:this.$=o.addSubGraph(e[t-6],e[t-1],e[t-4],"flow"),o.addSubgraphMapping&&o.addSubgraphMapping(e[t-6],e[t-4],_[t-8],_[t]);break;case 39:this.$=o.addSubGraph(e[t-7],e[t-1],e[t-5],"flow"),o.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,e[t-3],_[t-3]),o.addSubgraphMapping&&o.addSubgraphMapping(e[t-7],e[t-5],_[t-9],_[t]);break;case 40:this.$=o.addSubGraph(e[t-3],e[t-1],{text:"",type:"text"},"flow"),o.addSubgraphMapping&&o.addSubgraphMapping(e[t-3],{text:"",type:"text"},_[t-5],_[t]);break;case 41:this.$=o.addSubGraph(e[t-4],e[t-1],{text:"",type:"text"},"flow"),o.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,e[t-3],_[t-3]),o.addSubgraphMapping&&o.addSubgraphMapping(e[t-4],{text:"",type:"text"},_[t-6],_[t]);break;case 42:this.$=o.addSubGraph(void 0,e[t-1],void 0,"flow"),o.addSubgraphMapping&&o.addSubgraphMapping(void 0,void 0,_[t-3],_[t]);break;case 43:o.addGlobal(e[t-1]),this.$=[];break;case 44:this.$=o.addConnector(e[t-4],e[t-2]),o.addConnectorMapping&&o.addConnectorMapping(e[t-4],e[t-2],_[t-6],_[t]);break;case 45:this.$=o.addConnector(e[t-5],e[t-3]),o.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,e[t-1],_[t-1]),o.addConnectorMapping&&o.addConnectorMapping(e[t-5],e[t-3],_[t-7],_[t]);break;case 46:this.$=o.addConnector(e[t-1],{text:"",type:"text"}),o.addConnectorMapping&&o.addConnectorMapping(e[t-1],{text:"",type:"text"},_[t-3],_[t]);break;case 47:this.$=o.addConnector(e[t-2],{text:"",type:"text"}),o.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,e[t-1],_[t-1]),o.addConnectorMapping&&o.addConnectorMapping(e[t-2],{text:"",type:"text"},_[t-4],_[t]);break;case 49:this.$=e[t].trim(),o.setAccTitle(this.$);break;case 50:case 51:this.$=e[t].trim(),o.setAccDescription(this.$);break;case 56:this.$=e[t-1]+e[t];break;case 57:this.$=e[t];break;case 58:o.addVertex(e[t-1][e[t-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,e[t],_[t]),o.extendVertexMapping&&o.extendVertexMapping(e[t-1][e[t-1].length-1],_[t]),o.addLink(e[t-3].stmt,e[t-1],e[t-2]),o.addEdgeMapping&&o.addEdgeMapping(e[t-3].stmt,e[t-1],e[t-2],this._$),this.$={stmt:e[t-1],nodes:e[t-1].concat(e[t-3].nodes)};break;case 59:o.addLink(e[t-2].stmt,e[t],e[t-1]),o.addEdgeMapping&&o.addEdgeMapping(e[t-2].stmt,e[t],e[t-1],this._$),this.$={stmt:e[t],nodes:e[t].concat(e[t-2].nodes)};break;case 60:o.addLink(e[t-3].stmt,e[t-1],e[t-2]),o.addEdgeMapping&&o.addEdgeMapping(e[t-3].stmt,e[t-1],e[t-2],this._$),this.$={stmt:e[t-1],nodes:e[t-1].concat(e[t-3].nodes)};break;case 61:this.$={stmt:e[t-1],nodes:e[t-1]};break;case 62:o.addVertex(e[t-1][e[t-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,e[t],_[t]),o.extendVertexMapping&&o.extendVertexMapping(e[t-1][e[t-1].length-1],_[t]),this.$={stmt:e[t-1],nodes:e[t-1],shapeData:e[t]};break;case 63:this.$={stmt:e[t],nodes:e[t]};break;case 64:this.$=[e[t]];break;case 65:o.addVertex(e[t-5][e[t-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,e[t-4],_[t-4]),o.extendVertexMapping&&o.extendVertexMapping(e[t-5][e[t-5].length-1],_[t-4]),this.$=e[t-5].concat(e[t]);break;case 66:this.$=e[t-4].concat(e[t]);break;case 67:this.$=e[t];break;case 68:this.$=e[t-2],o.setClass(e[t-2],e[t]);break;case 69:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"square"),o.addVertexMapping&&o.addVertexMapping(e[t-3],e[t-1],"square",this._$);break;case 70:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"doublecircle"),o.addVertexMapping&&o.addVertexMapping(e[t-3],e[t-1],"doublecircle",this._$);break;case 71:this.$=e[t-5],o.addVertex(e[t-5],e[t-2],"circle"),o.addVertexMapping&&o.addVertexMapping(e[t-5],e[t-2],"circle",this._$);break;case 72:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"ellipse"),o.addVertexMapping&&o.addVertexMapping(e[t-3],e[t-1],"ellipse",this._$);break;case 73:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"stadium"),o.addVertexMapping&&o.addVertexMapping(e[t-3],e[t-1],"stadium",this._$);break;case 74:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"subroutine"),o.addVertexMapping&&o.addVertexMapping(e[t-3],e[t-1],"subroutine",this._$);break;case 75:this.$=e[t-7],o.addVertex(e[t-7],e[t-1],"rect",void 0,void 0,void 0,Object.fromEntries([[e[t-5],e[t-3]]])),o.addVertexMapping&&o.addVertexMapping(e[t-7],e[t-1],"rect",this._$);break;case 76:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"cylinder"),o.addVertexMapping&&o.addVertexMapping(e[t-3],e[t-1],"cylinder",this._$);break;case 77:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"round"),o.addVertexMapping&&o.addVertexMapping(e[t-3],e[t-1],"round",this._$);break;case 78:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"diamond"),o.addVertexMapping&&o.addVertexMapping(e[t-3],e[t-1],"diamond",this._$);break;case 79:this.$=e[t-5],o.addVertex(e[t-5],e[t-2],"hexagon"),o.addVertexMapping&&o.addVertexMapping(e[t-5],e[t-2],"hexagon",this._$);break;case 80:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"odd"),o.addVertexMapping&&o.addVertexMapping(e[t-3],e[t-1],"odd",this._$);break;case 81:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"trapezoid"),o.addVertexMapping&&o.addVertexMapping(e[t-3],e[t-1],"trapezoid",this._$);break;case 82:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"inv_trapezoid"),o.addVertexMapping&&o.addVertexMapping(e[t-3],e[t-1],"inv_trapezoid",this._$);break;case 83:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"lean_right"),o.addVertexMapping&&o.addVertexMapping(e[t-3],e[t-1],"lean_right",this._$);break;case 84:this.$=e[t-3],o.addVertex(e[t-3],e[t-1],"lean_left"),o.addVertexMapping&&o.addVertexMapping(e[t-3],e[t-1],"lean_left",this._$);break;case 85:this.$=e[t],o.addVertex(e[t]),o.addVertexMapping&&o.addVertexMapping(e[t],void 0,void 0,this._$);break;case 86:e[t-1].text=e[t],this.$=e[t-1];break;case 87:case 88:e[t-2].text=e[t-1],this.$=e[t-2];break;case 89:this.$=e[t];break;case 90:var N=o.destructLink(e[t],e[t-2]);this.$={type:N.type,stroke:N.stroke,length:N.length,edgeSemantic:N.edgeSemantic,text:e[t-1]};break;case 91:var N=o.destructLink(e[t],e[t-2]);this.$={type:N.type,stroke:N.stroke,length:N.length,edgeSemantic:N.edgeSemantic,text:e[t-1],id:e[t-3]};break;case 92:this.$={text:e[t],type:"text"};break;case 93:this.$={text:e[t-1].text+""+e[t],type:e[t-1].type};break;case 94:this.$={text:e[t],type:"string"};break;case 95:this.$={text:e[t],type:"markdown"};break;case 96:var N=o.destructLink(e[t]);this.$={type:N.type,stroke:N.stroke,length:N.length,edgeSemantic:N.edgeSemantic};break;case 97:var N=o.destructLink(e[t]);this.$={type:N.type,stroke:N.stroke,length:N.length,edgeSemantic:N.edgeSemantic,id:e[t-1]};break;case 98:this.$=e[t-1];break;case 99:this.$={text:e[t],type:"text"};break;case 100:this.$={text:e[t-1].text+""+e[t],type:e[t-1].type};break;case 101:this.$={text:e[t],type:"string"};break;case 102:case 119:this.$={text:e[t],type:"markdown"};break;case 116:this.$={text:e[t],type:"text"};break;case 117:this.$={text:e[t-1].text+""+e[t],type:e[t-1].type};break;case 118:this.$={text:e[t],type:"text"};break;case 120:this.$=e[t-4],o.addClass(e[t-2],e[t]);break;case 121:this.$=e[t-4],o.setClass(e[t-2],e[t]);break;case 122:case 130:this.$=e[t-1],o.setClickEvent(e[t-1],e[t]);break;case 123:case 131:this.$=e[t-3],o.setClickEvent(e[t-3],e[t-2]),o.setTooltip(e[t-3],e[t]);break;case 124:this.$=e[t-2],o.setClickEvent(e[t-2],e[t-1],e[t]);break;case 125:this.$=e[t-4],o.setClickEvent(e[t-4],e[t-3],e[t-2]),o.setTooltip(e[t-4],e[t]);break;case 126:this.$=e[t-2],o.setLink(e[t-2],e[t]);break;case 127:this.$=e[t-4],o.setLink(e[t-4],e[t-2]),o.setTooltip(e[t-4],e[t]);break;case 128:this.$=e[t-4],o.setLink(e[t-4],e[t-2],e[t]);break;case 129:this.$=e[t-6],o.setLink(e[t-6],e[t-4],e[t]),o.setTooltip(e[t-6],e[t-2]);break;case 132:this.$=e[t-1],o.setLink(e[t-1],e[t]);break;case 133:this.$=e[t-3],o.setLink(e[t-3],e[t-2]),o.setTooltip(e[t-3],e[t]);break;case 134:this.$=e[t-3],o.setLink(e[t-3],e[t-2],e[t]);break;case 135:this.$=e[t-5],o.setLink(e[t-5],e[t-4],e[t]),o.setTooltip(e[t-5],e[t-2]);break;case 136:this.$=e[t-4],o.addVertex(e[t-2],void 0,void 0,e[t]);break;case 137:this.$=e[t-4],o.updateLink([e[t-2]],e[t]);break;case 138:this.$=e[t-4],o.updateLink(e[t-2],e[t]);break;case 139:this.$=e[t-8],o.updateLinkInterpolate([e[t-6]],e[t-2]),o.updateLink([e[t-6]],e[t]);break;case 140:this.$=e[t-8],o.updateLinkInterpolate(e[t-6],e[t-2]),o.updateLink(e[t-6],e[t]);break;case 141:this.$=e[t-6],o.updateLinkInterpolate([e[t-4]],e[t]);break;case 142:this.$=e[t-6],o.updateLinkInterpolate(e[t-4],e[t]);break;case 143:case 145:this.$=[e[t]];break;case 144:case 146:e[t-2].push(e[t]),this.$=e[t-2];break;case 148:this.$=e[t-1]+e[t];break;case 196:this.$=e[t];break;case 197:this.$=e[t-1]+""+e[t];break;case 199:this.$=e[t-1]+""+e[t];break;case 200:this.$={stmt:"dir",value:"TB"};break;case 201:this.$={stmt:"dir",value:"BT"};break;case 202:this.$={stmt:"dir",value:"RL"};break;case 203:this.$={stmt:"dir",value:"LR"};break;case 204:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,8:i,10:s,11:r,13:u},{1:[3]},n(l,c,{5:7}),{4:8,8:i,10:s,11:r,13:u},{4:9,8:i,10:s,11:r,13:u},{4:10,8:i,10:s,11:r,13:u},{14:[1,11],15:[1,12]},{1:[2,1],6:13,7:14,8:a,9:h,10:f,11:p,12:A,21:20,23:21,24:22,25:23,26:24,27:25,28:C,35:I,36:x,37:29,38:M,40:D,42:m,45:33,46:44,47:d,48:45,50:46,63:g,87:L,88:R,89:ie,90:he,91:ce,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y,124:Te,125:_e,126:we,127:Fe,128:ye},n(l,[2,10]),n(l,[2,11]),n(l,[2,12]),n(l,[2,13]),{8:[1,63],9:[1,60],10:[1,61],11:Se,16:59,19:62},n(T,[2,3]),n(T,[2,4]),n(T,[2,5]),n(T,[2,6]),n(T,[2,7]),n(T,[2,8]),n(T,[2,9]),{8:Z,9:$,10:ee,12:te,22:65,44:66,75:71,78:[1,72],80:[1,74],81:[1,73]},{8:Z,9:$,10:ee,12:te,22:75},{8:Z,9:$,10:ee,12:te,22:76},{8:Z,9:$,10:ee,12:te,22:77},{8:Z,9:$,10:ee,12:te,22:78},{8:Z,9:$,10:ee,12:te,22:79},{8:Z,9:$,10:ee,11:[1,80],12:te,22:81},{8:Z,9:$,10:ee,12:te,22:82},{11:[1,83]},n(T,[2,48]),{39:[1,84]},{41:[1,85]},n(T,[2,51]),n(Me,[2,63],{19:86,34:87,11:Se,43:ve}),{11:[1,89]},{11:[1,90]},{11:[1,91]},{11:[1,92]},{15:Be,47:Ne,63:Re,83:[1,96],92:Oe,98:[1,93],100:[1,94],104:95,108:Pe,109:Ge,112:Ue,114:We,117:je,118:Ke,119:ze,123:97},n(T,[2,200]),n(T,[2,201]),n(T,[2,202]),n(T,[2,203]),n(T,[2,204]),n(Ve,[2,64]),n(Ve,[2,67],{49:[1,109]}),n(q,[2,85],{116:122,30:[1,110],47:d,51:[1,111],53:[1,112],55:[1,113],57:[1,114],59:[1,115],61:[1,116],63:g,66:[1,117],68:[1,118],70:[1,119],71:[1,120],73:[1,121],92:O,105:G,108:U,109:W,112:j,114:K,117:z,118:H,119:Y}),n(re,[2,196]),n(re,[2,157]),n(re,[2,158]),n(re,[2,159]),n(re,[2,160]),n(re,[2,161]),n(re,[2,162]),n(re,[2,163]),n(re,[2,164]),n(re,[2,165]),n(re,[2,166]),n(re,[2,167]),n(l,[2,14]),n(l,[2,20]),n(l,[2,21]),{10:[1,123]},n(l,[2,23]),n(Xt,[2,31],{19:124,11:Se}),n(T,[2,32]),{45:125,46:44,47:d,48:45,50:46,63:g,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y},n(T,[2,52]),n(T,[2,53]),n(T,[2,54]),n(T,[2,55]),n(He,[2,89],{76:126,65:[1,128],77:[1,127]}),{79:129,82:130,83:Qt,84:Zt,119:it,122:st},{78:[1,135],80:[1,136]},n($t,[2,96]),n(T,[2,33]),n(T,[2,34]),n(T,[2,35]),n(T,[2,36]),n(T,[2,37]),{11:rt,13:at,15:ot,28:ut,29:137,33:lt,35:ct,36:dt,47:ht,63:pt,78:gt,83:en,84:tn,86:150,87:ft,88:bt,89:mt,90:kt,91:At,92:Et,93:xt,94:138,108:St,112:Ct,114:Dt,117:Tt,118:_t,119:wt},n(Ye,c,{5:165}),n(Ye,c,{5:166}),{11:rt,13:at,15:ot,28:ut,29:167,33:lt,35:ct,36:dt,47:ht,63:pt,78:gt,83:en,84:tn,86:150,87:ft,88:bt,89:mt,90:kt,91:At,92:Et,93:xt,94:138,108:St,112:Ct,114:Dt,117:Tt,118:_t,119:wt},n(T,[2,49]),n(T,[2,50]),n(Me,[2,61],{47:nn}),n(Me,[2,62],{19:169,11:Se,43:Je}),n(Ve,[2,57]),{47:d,50:171,63:g,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y},{105:[1,172],106:173,108:[1,174]},{47:d,50:175,63:g,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y},{47:d,50:176,63:g,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y},n(P,[2,122],{11:[1,177],99:[1,178]}),{83:[1,179]},n(P,[2,130],{123:181,11:[1,180],15:Be,47:Ne,63:Re,92:Oe,108:Pe,109:Ge,112:Ue,114:We,117:je,118:Ke,119:ze}),n(P,[2,132],{11:[1,182]}),n(ae,[2,198]),n(ae,[2,185]),n(ae,[2,186]),n(ae,[2,187]),n(ae,[2,188]),n(ae,[2,189]),n(ae,[2,190]),n(ae,[2,191]),n(ae,[2,192]),n(ae,[2,193]),n(ae,[2,194]),n(ae,[2,195]),{47:d,50:183,63:g,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y},{31:184,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},{31:192,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},{31:194,53:[1,193],70:w,83:X,84:Q,85:185,119:F,120:y,121:V},{31:195,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},{31:196,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},{31:197,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},{112:[1,198]},{31:199,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},{31:200,68:[1,201],70:w,83:X,84:Q,85:185,119:F,120:y,121:V},{31:202,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},{31:203,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},{31:204,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},n(re,[2,197]),n(l,[2,22]),n(Xt,[2,30]),n(Me,[2,59],{34:205,19:206,11:Se,43:ve}),n(He,[2,86],{11:[1,207]}),{11:[1,208]},{31:209,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},{80:[1,210],82:211,119:it,122:st},n(qe,[2,92]),n(qe,[2,94]),n(qe,[2,95]),n(qe,[2,183]),n(qe,[2,184]),{79:212,82:130,83:Qt,84:Zt,119:it,122:st},n($t,[2,97]),{8:Z,9:$,10:ee,11:rt,12:te,13:at,15:ot,22:214,28:ut,30:[1,213],33:lt,34:215,35:ct,36:dt,43:ve,47:ht,63:pt,78:gt,86:150,87:ft,88:bt,89:mt,90:kt,91:At,92:Et,93:xt,94:216,108:St,112:Ct,114:Dt,117:Tt,118:_t,119:wt},n(v,[2,116]),n(v,[2,118]),n(v,[2,119]),n(v,[2,172]),n(v,[2,173]),n(v,[2,174]),n(v,[2,175]),n(v,[2,176]),n(v,[2,177]),n(v,[2,178]),n(v,[2,179]),n(v,[2,180]),n(v,[2,181]),n(v,[2,182]),n(v,[2,103]),n(v,[2,104]),n(v,[2,105]),n(v,[2,106]),n(v,[2,107]),n(v,[2,108]),n(v,[2,109]),n(v,[2,110]),n(v,[2,111]),n(v,[2,112]),n(v,[2,113]),n(v,[2,114]),n(v,[2,115]),{6:13,7:14,8:a,9:h,10:f,11:p,12:A,21:20,23:21,24:22,25:23,26:24,27:25,28:C,33:[1,217],35:I,36:x,37:29,38:M,40:D,42:m,45:33,46:44,47:d,48:45,50:46,63:g,87:L,88:R,89:ie,90:he,91:ce,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y,124:Te,125:_e,126:we,127:Fe,128:ye},{6:13,7:14,8:a,9:h,10:f,11:p,12:A,21:20,23:21,24:22,25:23,26:24,27:25,28:C,33:[1,218],35:I,36:x,37:29,38:M,40:D,42:m,45:33,46:44,47:d,48:45,50:46,63:g,87:L,88:R,89:ie,90:he,91:ce,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y,124:Te,125:_e,126:we,127:Fe,128:ye},{8:Z,9:$,10:ee,11:rt,12:te,13:at,15:ot,22:220,28:ut,30:[1,219],33:lt,34:221,35:ct,36:dt,43:ve,47:ht,63:pt,78:gt,86:150,87:ft,88:bt,89:mt,90:kt,91:At,92:Et,93:xt,94:216,108:St,112:Ct,114:Dt,117:Tt,118:_t,119:wt},{11:Se,19:222},{47:[1,223]},n(Ve,[2,56]),{11:[1,224],47:d,63:g,92:O,105:G,108:U,109:W,112:j,114:K,116:122,117:z,118:H,119:Y},{11:[1,225]},{11:[1,226],109:[1,227]},n(sn,[2,143]),{11:[1,228],47:d,63:g,92:O,105:G,108:U,109:W,112:j,114:K,116:122,117:z,118:H,119:Y},{11:[1,229],47:d,63:g,92:O,105:G,108:U,109:W,112:j,114:K,116:122,117:z,118:H,119:Y},{83:[1,230]},n(P,[2,124],{11:[1,231]}),n(P,[2,126],{11:[1,232]}),{83:[1,233]},n(ae,[2,199]),{83:[1,234],101:[1,235]},n(Ve,[2,68],{116:122,47:d,63:g,92:O,105:G,108:U,109:W,112:j,114:K,117:z,118:H,119:Y}),{32:[1,236],70:w,85:237,119:F,120:y,121:V},n(Ce,[2,99]),n(Ce,[2,101]),n(Ce,[2,102]),n(Ce,[2,168]),n(Ce,[2,169]),n(Ce,[2,170]),n(Ce,[2,171]),{52:[1,238],70:w,85:237,119:F,120:y,121:V},{31:239,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},{54:[1,240],70:w,85:237,119:F,120:y,121:V},{56:[1,241],70:w,85:237,119:F,120:y,121:V},{58:[1,242],70:w,85:237,119:F,120:y,121:V},{60:[1,243],70:w,85:237,119:F,120:y,121:V},{63:[1,244]},{67:[1,245],70:w,85:237,119:F,120:y,121:V},{69:[1,246],70:w,85:237,119:F,120:y,121:V},{31:247,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},{32:[1,248],70:w,85:237,119:F,120:y,121:V},{70:w,72:[1,249],74:[1,250],85:237,119:F,120:y,121:V},{70:w,72:[1,252],74:[1,251],85:237,119:F,120:y,121:V},n(Me,[2,58],{19:169,11:Se,43:Je}),n(Me,[2,60],{47:nn}),n(He,[2,88]),n(He,[2,87]),{65:[1,253],70:w,85:237,119:F,120:y,121:V},n(He,[2,90]),n(qe,[2,93]),{80:[1,254],82:211,119:it,122:st},{31:255,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},n(Ye,c,{5:256}),{8:Z,9:$,10:ee,12:te,22:257,43:Je},n(v,[2,117]),n(T,[2,42]),n(T,[2,43]),{31:258,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},n(T,[2,46]),{8:Z,9:$,10:ee,12:te,22:259,43:Je},{46:260,47:d,48:45,50:46,63:g,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y},{11:Se,19:261},{11:pe,63:ge,87:fe,95:262,108:be,110:263,111:264,112:me,113:ke,114:Ae,115:Ee},{11:pe,63:ge,87:fe,95:273,107:[1,274],108:be,110:263,111:264,112:me,113:ke,114:Ae,115:Ee},{11:pe,63:ge,87:fe,95:275,107:[1,276],108:be,110:263,111:264,112:me,113:ke,114:Ae,115:Ee},{108:[1,277]},{11:pe,63:ge,87:fe,95:278,108:be,110:263,111:264,112:me,113:ke,114:Ae,115:Ee},{47:d,50:279,63:g,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y},n(P,[2,123]),{83:[1,280]},{83:[1,281],101:[1,282]},n(P,[2,131]),n(P,[2,133],{11:[1,283]}),n(P,[2,134]),n(q,[2,69]),n(Ce,[2,100]),n(q,[2,70]),{54:[1,284],70:w,85:237,119:F,120:y,121:V},n(q,[2,77]),n(q,[2,72]),n(q,[2,73]),n(q,[2,74]),{112:[1,285]},n(q,[2,76]),n(q,[2,78]),{69:[1,286],70:w,85:237,119:F,120:y,121:V},n(q,[2,80]),n(q,[2,81]),n(q,[2,83]),n(q,[2,82]),n(q,[2,84]),n([11,47,63,92,105,108,109,112,114,117,118,119],[2,98]),n(He,[2,91]),{32:[1,287],70:w,85:237,119:F,120:y,121:V},{6:13,7:14,8:a,9:h,10:f,11:p,12:A,21:20,23:21,24:22,25:23,26:24,27:25,28:C,33:[1,288],35:I,36:x,37:29,38:M,40:D,42:m,45:33,46:44,47:d,48:45,50:46,63:g,87:L,88:R,89:ie,90:he,91:ce,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y,124:Te,125:_e,126:we,127:Fe,128:ye},n(Ye,c,{5:289}),{32:[1,290],70:w,85:237,119:F,120:y,121:V},n(T,[2,47]),n(Ve,[2,66]),{46:291,47:d,48:45,50:46,63:g,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y},n(P,[2,136],{109:Xe}),n(rn,[2,145],{111:293,11:pe,63:ge,87:fe,108:be,112:me,113:ke,114:Ae,115:Ee}),n(de,[2,147]),n(de,[2,149]),n(de,[2,150]),n(de,[2,151]),n(de,[2,152]),n(de,[2,153]),n(de,[2,154]),n(de,[2,155]),n(de,[2,156]),n(P,[2,137],{109:Xe}),{11:[1,294]},n(P,[2,138],{109:Xe}),{11:[1,295]},n(sn,[2,144]),n(P,[2,120],{109:Xe}),n(P,[2,121],{116:122,47:d,63:g,92:O,105:G,108:U,109:W,112:j,114:K,117:z,118:H,119:Y}),n(P,[2,125]),n(P,[2,127],{11:[1,296]}),n(P,[2,128]),{101:[1,297]},{54:[1,298]},{65:[1,299]},{69:[1,300]},{8:Z,9:$,10:ee,12:te,22:301,34:302,43:ve},n(T,[2,40]),{6:13,7:14,8:a,9:h,10:f,11:p,12:A,21:20,23:21,24:22,25:23,26:24,27:25,28:C,33:[1,303],35:I,36:x,37:29,38:M,40:D,42:m,45:33,46:44,47:d,48:45,50:46,63:g,87:L,88:R,89:ie,90:he,91:ce,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y,124:Te,125:_e,126:we,127:Fe,128:ye},{8:Z,9:$,10:ee,12:te,22:304,34:305,43:ve},n(Ve,[2,65]),{11:pe,63:ge,87:fe,108:be,110:306,111:264,112:me,113:ke,114:Ae,115:Ee},n(de,[2,148]),{15:Be,47:Ne,63:Re,92:Oe,104:307,108:Pe,109:Ge,112:Ue,114:We,117:je,118:Ke,119:ze,123:97},{15:Be,47:Ne,63:Re,92:Oe,104:308,108:Pe,109:Ge,112:Ue,114:We,117:je,118:Ke,119:ze,123:97},{101:[1,309]},n(P,[2,135]),n(q,[2,71]),{31:310,70:w,83:X,84:Q,85:185,119:F,120:y,121:V},n(q,[2,79]),n(Ye,c,{5:311}),{8:Z,9:$,10:ee,12:te,22:312,43:Je},n(T,[2,41]),n(T,[2,44]),{8:Z,9:$,10:ee,12:te,22:313,43:Je},n(rn,[2,146],{111:293,11:pe,63:ge,87:fe,108:be,112:me,113:ke,114:Ae,115:Ee}),n(P,[2,141],{123:181,11:[1,314],15:Be,47:Ne,63:Re,92:Oe,108:Pe,109:Ge,112:Ue,114:We,117:je,118:Ke,119:ze}),n(P,[2,142],{123:181,11:[1,315],15:Be,47:Ne,63:Re,92:Oe,108:Pe,109:Ge,112:Ue,114:We,117:je,118:Ke,119:ze}),n(P,[2,129]),{32:[1,316],70:w,85:237,119:F,120:y,121:V},{6:13,7:14,8:a,9:h,10:f,11:p,12:A,21:20,23:21,24:22,25:23,26:24,27:25,28:C,33:[1,317],35:I,36:x,37:29,38:M,40:D,42:m,45:33,46:44,47:d,48:45,50:46,63:g,87:L,88:R,89:ie,90:he,91:ce,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y,124:Te,125:_e,126:we,127:Fe,128:ye},n(Ye,c,{5:318}),n(T,[2,45]),{11:pe,63:ge,87:fe,95:319,108:be,110:263,111:264,112:me,113:ke,114:Ae,115:Ee},{11:pe,63:ge,87:fe,95:320,108:be,110:263,111:264,112:me,113:ke,114:Ae,115:Ee},n(q,[2,75]),n(T,[2,38]),{6:13,7:14,8:a,9:h,10:f,11:p,12:A,21:20,23:21,24:22,25:23,26:24,27:25,28:C,33:[1,321],35:I,36:x,37:29,38:M,40:D,42:m,45:33,46:44,47:d,48:45,50:46,63:g,87:L,88:R,89:ie,90:he,91:ce,92:O,105:G,108:U,109:W,112:j,114:K,116:47,117:z,118:H,119:Y,124:Te,125:_e,126:we,127:Fe,128:ye},n(P,[2,139],{109:Xe}),n(P,[2,140],{109:Xe}),n(T,[2,39])],defaultActions:{},parseError:b(function(k,E){if(E.recoverable)this.trace(k);else{var S=new Error(k);throw S.hash=E,S}},"parseError"),parse:b(function(k){var E=this,S=[0],o=[],B=[null],e=[],_=this.table,t="",N=0,an=0,on=0,jn=2,un=1,Kn=e.slice.call(arguments,1),J=Object.create(this.lexer),Ie={yy:{}};for(var Bt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Bt)&&(Ie.yy[Bt]=this.yy[Bt]);J.setInput(k,Ie.yy),Ie.yy.lexer=J,Ie.yy.parser=this,typeof J.yylloc>"u"&&(J.yylloc={});var Nt=J.yylloc;e.push(Nt);var zn=J.options&&J.options.ranges;typeof Ie.yy.parseError=="function"?this.parseError=Ie.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ri(oe){S.length=S.length-2*oe,B.length=B.length-oe,e.length=e.length-oe}b(ri,"popStack");function Hn(){var oe;return oe=o.pop()||J.lex()||un,typeof oe!="number"&&(oe instanceof Array&&(o=oe,oe=o.pop()),oe=E.symbols_[oe]||oe),oe}b(Hn,"lex");for(var se,Rt,Le,ue,ai,Ot,Qe={},Ft,xe,ln,yt;;){if(Le=S[S.length-1],this.defaultActions[Le]?ue=this.defaultActions[Le]:((se===null||typeof se>"u")&&(se=Hn()),ue=_[Le]&&_[Le][se]),typeof ue>"u"||!ue.length||!ue[0]){var Pt="";yt=[];for(Ft in _[Le])this.terminals_[Ft]&&Ft>jn&&yt.push("'"+this.terminals_[Ft]+"'");J.showPosition?Pt="Parse error on line "+(N+1)+`:
`+J.showPosition()+`
Expecting `+yt.join(", ")+", got '"+(this.terminals_[se]||se)+"'":Pt="Parse error on line "+(N+1)+": Unexpected "+(se==un?"end of input":"'"+(this.terminals_[se]||se)+"'"),this.parseError(Pt,{text:J.match,token:this.terminals_[se]||se,line:J.yylineno,loc:Nt,expected:yt})}if(ue[0]instanceof Array&&ue.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Le+", token: "+se);switch(ue[0]){case 1:S.push(se),B.push(J.yytext),e.push(J.yylloc),S.push(ue[1]),se=null,Rt?(se=Rt,Rt=null):(an=J.yyleng,t=J.yytext,N=J.yylineno,Nt=J.yylloc,on>0&&on--);break;case 2:if(xe=this.productions_[ue[1]][1],Qe.$=B[B.length-xe],Qe._$={first_line:e[e.length-(xe||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(xe||1)].first_column,last_column:e[e.length-1].last_column},zn&&(Qe._$.range=[e[e.length-(xe||1)].range[0],e[e.length-1].range[1]]),Ot=this.performAction.apply(Qe,[t,an,N,Ie.yy,ue[1],B,e].concat(Kn)),typeof Ot<"u")return Ot;xe&&(S=S.slice(0,-1*xe*2),B=B.slice(0,-1*xe),e=e.slice(0,-1*xe)),S.push(this.productions_[ue[1]][0]),B.push(Qe.$),e.push(Qe._$),ln=_[S[S.length-2]][S[S.length-1]],S.push(ln);break;case 3:return!0}}return!0},"parse")},Wn=(function(){var De={EOF:1,parseError:b(function(E,S){if(this.yy.parser)this.yy.parser.parseError(E,S);else throw new Error(E)},"parseError"),setInput:b(function(k,E){return this.yy=E||this.yy||{},this._input=k,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:b(function(){var k=this._input[0];this.yytext+=k,this.yyleng++,this.offset++,this.match+=k,this.matched+=k;var E=k.match(/(?:\r\n?|\n).*/g);return E?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),k},"input"),unput:b(function(k){var E=k.length,S=k.split(/(?:\r\n?|\n)/g);this._input=k+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-E),this.offset-=E;var o=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),S.length-1&&(this.yylineno-=S.length-1);var B=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:S?(S.length===o.length?this.yylloc.first_column:0)+o[o.length-S.length].length-S[0].length:this.yylloc.first_column-E},this.options.ranges&&(this.yylloc.range=[B[0],B[0]+this.yyleng-E]),this.yyleng=this.yytext.length,this},"unput"),more:b(function(){return this._more=!0,this},"more"),reject:b(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:b(function(k){this.unput(this.match.slice(k))},"less"),pastInput:b(function(){var k=this.matched.substr(0,this.matched.length-this.match.length);return(k.length>20?"...":"")+k.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:b(function(){var k=this.match;return k.length<20&&(k+=this._input.substr(0,20-k.length)),(k.substr(0,20)+(k.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:b(function(){var k=this.pastInput(),E=new Array(k.length+1).join("-");return k+this.upcomingInput()+`
`+E+"^"},"showPosition"),test_match:b(function(k,E){var S,o,B;if(this.options.backtrack_lexer&&(B={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(B.yylloc.range=this.yylloc.range.slice(0))),o=k[0].match(/(?:\r\n?|\n).*/g),o&&(this.yylineno+=o.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:o?o[o.length-1].length-o[o.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+k[0].length},this.yytext+=k[0],this.match+=k[0],this.matches=k,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(k[0].length),this.matched+=k[0],S=this.performAction.call(this,this.yy,this,E,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),S)return S;if(this._backtrack){for(var e in B)this[e]=B[e];return!1}return!1},"test_match"),next:b(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var k,E,S,o;this._more||(this.yytext="",this.match="");for(var B=this._currentRules(),e=0;e<B.length;e++)if(S=this._input.match(this.rules[B[e]]),S&&(!E||S[0].length>E[0].length)){if(E=S,o=e,this.options.backtrack_lexer){if(k=this.test_match(S,B[e]),k!==!1)return k;if(this._backtrack){E=!1;continue}else return!1}else if(!this.options.flex)break}return E?(k=this.test_match(E,B[o]),k!==!1?k:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:b(function(){var E=this.next();return E||this.lex()},"lex"),begin:b(function(E){this.conditionStack.push(E)},"begin"),popState:b(function(){var E=this.conditionStack.length-1;return E>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:b(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:b(function(E){return E=this.conditionStack.length-1-Math.abs(E||0),E>=0?this.conditionStack[E]:"INITIAL"},"topState"),pushState:b(function(E){this.begin(E)},"pushState"),stateStackSize:b(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:b(function(E,S,o,B){var e=B;switch(o){case 0:return this.begin("acc_title"),38;break;case 1:return this.popState(),"acc_title_value";break;case 2:return this.begin("acc_descr"),40;break;case 3:return this.popState(),"acc_descr_value";break;case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),S.yytext="",43;break;case 8:return this.pushState("shapeDataStr"),43;break;case 9:return this.popState(),43;break;case 10:let _=/\n\s*/g;return S.yytext=S.yytext.replace(_,"<br/>"),43;break;case 11:return 43;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 98;case 17:this.popState();break;case 18:return 99;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 87;case 26:return 105;case 27:return 88;case 28:return 107;case 29:return 89;case 30:return 90;case 31:return 100;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 91;case 35:return E.lex.firstGraph()&&this.begin("dir"),13;break;case 36:return 28;case 37:return 36;case 38:return 35;case 39:return 33;case 40:return 101;case 41:return 101;case 42:return 101;case 43:return 101;case 44:return this.popState(),14;break;case 45:return this.popState(),15;break;case 46:return this.popState(),15;break;case 47:return this.popState(),15;break;case 48:return this.popState(),15;break;case 49:return this.popState(),15;break;case 50:return this.popState(),15;break;case 51:return this.popState(),15;break;case 52:return this.popState(),15;break;case 53:return this.popState(),15;break;case 54:return this.popState(),15;break;case 55:return 124;case 56:return 125;case 57:return 126;case 58:return 127;case 59:return 128;case 60:return 81;case 61:return 108;case 62:return 114;case 63:return 49;case 64:return 63;case 65:return 47;case 66:return 9;case 67:return 109;case 68:return 118;case 69:return this.popState(),80;break;case 70:return this.pushState("edgeText"),78;break;case 71:return 122;case 72:return 80;case 73:break;case 74:return this.popState(),56;break;case 75:return"TEXT";case 76:return this.pushState("ellipseText"),55;break;case 77:return this.popState(),58;break;case 78:return this.pushState("text"),57;break;case 79:return this.popState(),60;break;case 80:return this.pushState("text"),59;break;case 81:return 61;case 82:return this.pushState("text"),70;break;case 83:return this.popState(),67;break;case 84:return this.pushState("text"),66;break;case 85:return this.popState(),52;break;case 86:return this.pushState("text"),51;break;case 87:break;case 88:return this.popState(),72;break;case 89:return this.popState(),74;break;case 90:return 120;case 91:return this.pushState("trapText"),71;break;case 92:return this.pushState("trapText"),73;break;case 93:return 121;case 94:return 70;case 95:return 93;case 96:return"SEP";case 97:return 92;case 98:return 118;case 99:return 114;case 100:return 47;case 101:return 8;case 102:return 112;case 103:return 117;case 104:return 119;case 105:return this.popState(),65;break;case 106:return this.pushState("text"),65;break;case 107:return this.popState(),54;break;case 108:return this.pushState("text"),53;break;case 109:return this.popState(),32;break;case 110:return this.pushState("text"),30;break;case 111:return this.popState(),69;break;case 112:return this.pushState("text"),68;break;case 113:break;case 114:return"TEXT";case 115:return"QUOTE";case 116:return 10;case 117:return 11;case 118:return 12}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:agentflow-beta\b)/,/^(?:flow\b)/,/^(?:connector\b)/,/^(?:global\b[ \t]*)/,/^(?:end\b[ \t]*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*--+[x>]\s*)/,/^(?:\s*--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*-\.+-\s*)/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|(?:[^\\\[\]\(\)\{\}\/%]+|(?!))+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:[ \t]*%%(?!\{)[^\n]*)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:%%(?!\{)[^\n]*)/,/^(?:(?:[^\[\]\(\)\{\}\|\"%]+|(?!))+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},shapeData:{rules:[8,11,12,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},callbackargs:{rules:[17,18,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},callbackname:{rules:[14,15,16,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},href:{rules:[21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},click:{rules:[21,24,33,34,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},edgeText:{rules:[21,24,69,71,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},trapText:{rules:[21,24,76,78,80,84,86,87,88,89,90,91,92,106,108,110,112],inclusive:!1},ellipseText:{rules:[21,24,73,74,75,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},text:{rules:[21,24,76,77,78,79,80,83,84,85,86,91,92,105,106,107,108,109,110,111,112,113,114],inclusive:!1},vertex:{rules:[21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},acc_descr:{rules:[3,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},acc_title:{rules:[1,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},md_string:{rules:[19,20,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},string:{rules:[21,22,23,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,72,76,78,80,81,82,84,86,91,92,93,94,95,96,97,98,99,100,101,102,103,104,106,108,110,112,115,116,117,118],inclusive:!0}}};return De})();Mt.lexer=Wn;function vt(){this.yy={}}return b(vt,"Parser"),vt.prototype=Mt,Mt.Parser=vt,new vt})();Jt.parser=Jt;var qt=Jt;var Pn=Object.assign({},qt);Pn.parse=n=>{let i=n.replace(/}[^\S\n]*\n/g,`}
`);return qt.parse(i)};var Gn=Pn;var ni=b(n=>{let{theme:i,bkgColorArray:s,borderColorArray:r}=n;if(!Dn(i,r))return"";let u=Tn(n.look),l=Cn(s),c=_n(n.THEME_COLOR_LIMIT,r),a=b(p=>r[p%r.length],"border"),h=b(p=>l?`fill: ${s[p%s.length]};`:"","fill"),f="";for(let p of Bn){let A=nt.get(p),C=`[data-look="${u}"].node.${jt(p)}`;f+=`

    ${C} rect,
    ${C} path,
    ${C} polygon {
      stroke: ${a(A)};
      ${h(A)}
    }
`}for(let p=0;p<Kt(c);p++){let A=zt(p,c),C=`[data-look="${u}"][data-color-id="color-${A}"].cluster`,I=`[data-look="${u}"][data-color-id="color-${A}"].node`,x=b(M=>`${C} ${M}, ${I} ${M}`,"rule");f+=`

    ${x("rect")},
    ${x("path")} {
      stroke: ${a(A)};
      ${h(A)}
    }
`}return f},"genColor"),ii=b((n,i)=>{let s=dn,r=s(n,"r"),u=s(n,"g"),l=s(n,"b");return cn(r,u,l,i)},"fade"),si=b(n=>`${ni(n)}
  .label {
    font-family: ${n.fontFamily};
    color: ${n.nodeTextColor||n.textColor};
  }
  .cluster-label text {
    fill: ${n.titleColor};
  }
  .cluster-label span {
    color: ${n.titleColor};
  }
  .cluster-label span p {
    background-color: transparent;
  }

  .label text,span {
    fill: ${n.nodeTextColor||n.textColor};
    color: ${n.nodeTextColor||n.textColor};
  }

  .node rect,
  .node circle,
  .node ellipse,
  .node polygon,
  .node path {
    fill: ${n.mainBkg};
    stroke: ${n.nodeBorder};
    stroke-width: ${n.strokeWidth??1}px;
  }
  .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label {
    text-anchor: middle;
  }
  .node .katex path {
    fill: ${n.nodeTextColor||n.textColor};
    stroke: ${n.nodeTextColor||n.textColor};
    stroke-width: 1px;
  }

  .rough-node .label,.node .label, .image-shape .label, .icon-shape .label {
    text-align: center;
  }
  .node.clickable {
    cursor: pointer;
  }


  .root .anchor path {
    fill: ${n.lineColor} !important;
    stroke-width: 0;
    stroke: ${n.lineColor};
  }

  .arrowheadPath {
    fill: ${n.arrowheadColor};
  }

  .edgePaths .path {
    stroke: ${n.lineColor};
    stroke-width: ${n.strokeWidth??2}px;
  }

  .flowchart-link {
    stroke: ${n.lineColor};
    fill: none;
  }

  .edgeLabel {
    background-color: ${n.edgeLabelBackground};
    p {
      background-color: ${n.edgeLabelBackground};
    }
    rect {
      opacity: 0.5;
      background-color: ${n.edgeLabelBackground};
      fill: ${n.edgeLabelBackground};
    }
    text-align: center;
  }

  /* For html labels only */
  .labelBkg {
    background-color: ${ii(n.edgeLabelBackground,.5)};
  }

  .cluster rect {
    fill: ${n.clusterBkg};
    stroke: ${n.clusterBorder};
    stroke-width: 1px;
  }

  .flow-cluster rect {
    fill: none;
    stroke: ${n.clusterBorder};
    stroke-width: 0.75px;
  }

  .node .collapsed-indicator {
    fill: ${n.nodeBorder};
    stroke: none;
    stroke-width: 0;
    opacity: 0.5;
  }

  .node .collapsed-separator {
    stroke-width: 0.75px;
  }

  .cluster text {
    fill: ${n.titleColor};
  }

  .cluster span {
    color: ${n.titleColor};
  }
  /* .cluster div {
    color: ${n.titleColor};
  } */

  div.mermaidTooltip {
    position: absolute;
    text-align: center;
    max-width: 200px;
    padding: 2px;
    font-family: ${n.fontFamily};
    font-size: 12px;
    background: ${n.tertiaryColor};
    border: 1px solid ${n.border2};
    border-radius: 2px;
    pointer-events: none;
    z-index: 100;
  }

  .agentflowTitleText {
    text-anchor: middle;
    font-size: 18px;
    fill: ${n.textColor};
  }

  rect.text {
    fill: none;
    stroke-width: 0;
  }

  .icon-shape, .image-shape {
    background-color: ${n.edgeLabelBackground};
    p {
      background-color: ${n.edgeLabelBackground};
      padding: 2px;
    }
    .label rect {
      opacity: 0.5;
      background-color: ${n.edgeLabelBackground};
      fill: ${n.edgeLabelBackground};
    }
    text-align: center;
  }
  ${Ln()}
`,"getStyles"),Un=si;var $i={parser:Gn,get db(){return new Lt},renderer:On,styles:Un,init:b(n=>{n.agentflow??={},n.layout&&Gt({layout:n.layout}),n.flowchart??={},n.flowchart.arrowMarkerAbsolute=n.arrowMarkerAbsolute,Gt({flowchart:{arrowMarkerAbsolute:n.arrowMarkerAbsolute}})},"init")};export{$i as diagram};