@codexhost/cli-win32-x64 0.29.1 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/README.md +1 -1
  2. package/app/codexhost-distribution.json +1 -1
  3. package/app/console-server.mjs +40 -15
  4. package/app/console-web.js +49 -24
  5. package/app/desktop-controller.mjs +53 -28
  6. package/app/host-runtime.mjs +2616 -1978
  7. package/app/plugins/antigravity/plugin.mjs +40 -15
  8. package/app/plugins/claude-code/plugin.mjs +40 -15
  9. package/app/plugins/codebuddy/plugin.mjs +514 -109
  10. package/app/plugins/codex-usage/plugin.mjs +58 -33
  11. package/app/plugins/copilot/plugin.mjs +40 -15
  12. package/app/plugins/cursor-cli/plugin.mjs +40 -15
  13. package/app/plugins/deepseek-harness/plugin.mjs +40 -15
  14. package/app/plugins/devin/plugin.mjs +40 -15
  15. package/app/plugins/grok/plugin.mjs +40 -15
  16. package/app/plugins/hermes/plugin.mjs +40 -15
  17. package/app/plugins/kimi-code/plugin.mjs +40 -15
  18. package/app/plugins/kiro-cli/plugin.mjs +40 -15
  19. package/app/plugins/omp/plugin.mjs +40 -15
  20. package/app/plugins/opencode/plugin.mjs +40 -15
  21. package/app/plugins/pi/plugin.mjs +40 -15
  22. package/app/plugins/qoder/plugin.mjs +40 -15
  23. package/app/plugins/qoder-cn/plugin.mjs +40 -15
  24. package/app/plugins/qwen-code/plugin.mjs +40 -15
  25. package/app/plugins/workbuddy/plugin.mjs +548 -112
  26. package/app/plugins/zcode/plugin.mjs +40 -15
  27. package/app/renderer-extension.js +52 -27
  28. package/app/web/assets/abnfDiagram-XWFEHMT6-BdinLox4.js +1 -0
  29. package/app/web/assets/architectureDiagram-CSQXQB3N-DgPBbtvP.js +36 -0
  30. package/app/web/assets/blockDiagram-BEDRHYPZ-B4ENdwtZ.js +140 -0
  31. package/app/web/assets/bpmnIcons-APHXDYXF-ByGoYv9M.js +1 -0
  32. package/app/web/assets/c4Diagram-M2UUVUY5-DA6Owfyu.js +38 -0
  33. package/app/web/assets/chunk-2Q5K7J3B-Dvh3qOmo.js +1 -0
  34. package/app/web/assets/chunk-3GCGMST5-VIkqueym.js +1 -0
  35. package/app/web/assets/chunk-5VM5RSS4-DTYof_OI.js +15 -0
  36. package/app/web/assets/chunk-7U7NFRK5-Dp7s2dg0.js +88 -0
  37. package/app/web/assets/chunk-CNRTWJTD-TKBKxZLU.js +1 -0
  38. package/app/web/assets/chunk-D5HYT7QG-BRZDovSS.js +1 -0
  39. package/app/web/assets/chunk-EBZ3SEQC-C9USZ3tT.js +2 -0
  40. package/app/web/assets/chunk-JWPE2WC7-BrdvVNVo.js +1 -0
  41. package/app/web/assets/chunk-KTR4FSNJ-C7qwjGba.js +1 -0
  42. package/app/web/assets/chunk-XXDRQBXY-DlSrRuwN.js +1 -0
  43. package/app/web/assets/classDiagram-v2-KXABOMEV-BFvB4kwX.js +217 -0
  44. package/app/web/assets/cose-bilkent-JH36ORCC-UyCAqNvj.js +1 -0
  45. package/app/web/assets/cynefin-EF2NZ3EQ-CwawUbjJ.js +141 -0
  46. package/app/web/assets/cynefinDiagram-NJNITYFG-BaWEIQJ0.js +62 -0
  47. package/app/web/assets/cytoscape.esm-Cm0uQArZ.js +332 -0
  48. package/app/web/assets/d3-scale-4DPf7zan.js +1 -0
  49. package/app/web/assets/dagre-KIHZ2IZ3-B7ENIjLG.js +4 -0
  50. package/app/web/assets/diagram-7YQZDPLS-CxRMU8xq.js +41 -0
  51. package/app/web/assets/diagram-QBROCOUO-qo7sxm4K.js +200 -0
  52. package/app/web/assets/diagram-RJJCUUZO-CQiGMCMe.js +30 -0
  53. package/app/web/assets/diagram-WERXNKYE-D0Jps1As.js +24 -0
  54. package/app/web/assets/diagram-YHHI257C-p4AB8cqK.js +3 -0
  55. package/app/web/assets/diagram-YR4HJLHV-Bh6JKT04.js +24 -0
  56. package/app/web/assets/ebnfDiagram-N527522P-DRac0k4W.js +1 -0
  57. package/app/web/assets/elk-O5DQBFGD-CWTz5SZP.js +27 -0
  58. package/app/web/assets/erDiagram-K3K3BIDK-DE3w4BEY.js +99 -0
  59. package/app/web/assets/flowDiagram-Z6JWZHQI-NYs8bi5t.js +213 -0
  60. package/app/web/assets/ganttDiagram-3PRQTZWP-Bspp9btW.js +292 -0
  61. package/app/web/assets/gitGraphDiagram-VXDFKS5L-ByGW1uvv.js +106 -0
  62. package/app/web/assets/graph-D8UmR1vK.js +1 -0
  63. package/app/web/assets/grid-E2QIVN74-CegebiIw.js +1 -0
  64. package/app/web/assets/{index-aSHN2MIG.css → index-BbmB5VLj.css} +1 -1
  65. package/app/web/assets/{index-0TnaYwHS.js → index-DFPOGLS4.js} +80 -80
  66. package/app/web/assets/infoDiagram-EZ3ZOAHP-CexmsdZx.js +2 -0
  67. package/app/web/assets/ishikawaDiagram-S3EKX5GW-BbWqKhg6.js +70 -0
  68. package/app/web/assets/journeyDiagram-POQNLL5X-27YlCe-1.js +139 -0
  69. package/app/web/assets/kanban-definition-BH5XI6FM-BAhOdeck.js +89 -0
  70. package/app/web/assets/langs/{graphql-ChAeyPkT.js → graphql-D6Z3qcRW.js} +1 -1
  71. package/app/web/assets/langs/{http-BvreBIbD.js → http-XiU9G9In.js} +1 -1
  72. package/app/web/assets/langs/{php-D8omCIuJ.js → php-DL3xwS-7.js} +1 -1
  73. package/app/web/assets/langs/{rst-Do7RLLCS.js → rst-DudRVJ9g.js} +1 -1
  74. package/app/web/assets/langs/{ruby-rH_O_vse.js → ruby-_FqsfqJi.js} +1 -1
  75. package/app/web/assets/langs/{svelte-xZy73wAj.js → svelte-ClsVJoBT.js} +1 -1
  76. package/app/web/assets/langs/{vue-C4DW8agZ.js → vue-BiKMXCyK.js} +1 -1
  77. package/app/web/assets/mermaid.core-sGgCbv5y.js +314 -0
  78. package/app/web/assets/mindmap-definition-WVAN44T4-CsMIX0Lj.js +98 -0
  79. package/app/web/assets/pegDiagram-D4NLKWP3-Cs3LXqn_.js +1 -0
  80. package/app/web/assets/pieDiagram-36ENHN4W-DdQsQX9I.js +39 -0
  81. package/app/web/assets/quadrantDiagram-ZQUDMS73-D1jOKqx_.js +7 -0
  82. package/app/web/assets/railroadDiagram-JIZHGYPL-XulrgX5n.js +1 -0
  83. package/app/web/assets/render-VIF2ZAQL-CSsGw-0I.js +2 -0
  84. package/app/web/assets/requirementDiagram-AXW2TVFA-CT66GXLN.js +84 -0
  85. package/app/web/assets/sankeyDiagram-FBCJTAIF-CNRKebNY.js +40 -0
  86. package/app/web/assets/sequenceDiagram-3LA2ROMG-DVl5y64e.js +169 -0
  87. package/app/web/assets/sizeCapture-2Q2CQKSF-Kg0XxSga.js +1 -0
  88. package/app/web/assets/stateDiagram-v2-ATKHQDJO-DYQnfMsS.js +291 -0
  89. package/app/web/assets/swimlanes-YQL5WMAO-Chqt7pxD.js +1 -0
  90. package/app/web/assets/swimlanesDiagram-UCCPES4V-BfREktNP.js +8 -0
  91. package/app/web/assets/timeline-definition-7Z437IG3-aHFxjIT6.js +120 -0
  92. package/app/web/assets/usecaseDiagram-RDK6N6HP-DsC5tFe4.js +370 -0
  93. package/app/web/assets/vendor-BKfNgqAm.js +666 -0
  94. package/app/web/assets/vennDiagram-SHRQU5PJ-C65oZxFn.js +34 -0
  95. package/app/web/assets/wardleyDiagram-F3OXNVQS-HTkq7DT0.js +78 -0
  96. package/app/web/assets/xychartDiagram-GDYJKCDI-p1LpQ9MH.js +7 -0
  97. package/app/web/codexhost-settings.js +39 -39
  98. package/app/web/index.html +3 -3
  99. package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +65 -65
  100. package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +8 -8
  101. package/app/web/plugins/deepseek-ai__dsh-client-locale/client.js +1 -1
  102. package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +17 -17
  103. package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +16 -16
  104. package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +16 -16
  105. package/app/web/plugins/deepseek-ai__dsh-client-ui-layout/client.js +3 -3
  106. package/app/web/plugins/deepseek-ai__dsh-client-ui-permission-presets/client.js +1 -1
  107. package/app/web/plugins/deepseek-ai__dsh-client-ui-plan/client.js +1 -1
  108. package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-documentpreview/client.js +9 -9
  109. package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +18 -18
  110. package/app/web/plugins/deepseek-ai__dsh-client-ui-user-questions/client.js +1 -1
  111. package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +14 -14
  112. package/app/web-modules/licenses/DSH-THIRD_PARTY_NOTICES.md +1 -1
  113. package/app/web-modules/server.mjs +641 -168
  114. package/bin/codexhost.exe +0 -0
  115. package/libexec/codexhost-node-repl.exe +0 -0
  116. package/libexec/codexhost-screenshot.exe +0 -0
  117. package/libexec/codexhost-shell.exe +0 -0
  118. package/libexec/codexhost-shim.exe +0 -0
  119. package/libexec/codexhost-updater.exe +0 -0
  120. package/package.json +1 -1
  121. package/app/web/assets/vendor-C9g2bw8s.js +0 -410
@@ -0,0 +1,200 @@
1
+ import{s as b1}from"./chunk-KTR4FSNJ-C7qwjGba.js";import{g as A1}from"./chunk-5VM5RSS4-DTYof_OI.js";import{g as k1}from"./chunk-XXDRQBXY-DlSrRuwN.js";import{s as E1}from"./chunk-CNRTWJTD-TKBKxZLU.js";import{_ as k,q as $t,l as ae,c as ce,r as C1,t as S1,u as Ot,b as x1,s as T1,v as D1,a as _1,g as v1,x as F1,m as V1,y as e1,J as t1,z as I1,A as yt,k as Nt,B as L1,C as B1,D as M1,E as w1,F as y1,G as N1,H as R1,I as O1,K as P1,L as G1}from"./mermaid.core-sGgCbv5y.js";import{c as U1}from"./chunk-D5HYT7QG-BRZDovSS.js";import"./index-DFPOGLS4.js";import"./vendor-BKfNgqAm.js";var et={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"},j1=new Set([et.SHAPE_UNSUPPORTED,et.SHAPE_REMOVED,et.CONTAINMENT_VIOLATION]);new Set(Object.values(et).filter(e=>!j1.has(e)));var z1=new Map([["task","roundedRect"],["tool","subroutine"],["input","lean-right"],["lean_right","lean-right"],["decision","diamond"],["refdoc","lin-doc"],["action","hexagon"],["round","rect"]]),W1=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"]),K1=new Set(["roundedRect","subroutine","subprocess","subproc","framed-rectangle","lean-right","diamond","lin-doc","lined-document","hexagon","hex","connector","collapsedGroup"]),Ze="roundedRect";function $e(e){return e&&(z1.get(e)??e)}k($e,"resolveShapeAlias");function i1(e,i){for(const n of e)if(!n.isGroup){if((!n.shape||n.shape==="squareRect"||n.shape==="rect")&&(n.shape=Ze),W1.has(n.shape)){const r=`shape "${n.shape}" was removed in v0.8.1, using "${Ze}"`;i?.emitError?i.emitError("SHAPE_REMOVED",r,{nodeId:n.id}):ae.warn(`agentflow: ${r}`),n.shape=Ze;continue}if(!K1.has(n.shape)){const r=`shape "${n.shape}" is not supported, using "${Ze}"`;i?.emitWarning?i.emitWarning("SHAPE_UNSUPPORTED",r,{nodeId:n.id}):ae.warn(`agentflow: ${r}`),n.shape=Ze}}}k(i1,"normaliseNodeShapes");var Vt=new Map([["tool",0],["task",1],["decision",2],["input",3],["refdoc",4],["connector",5],["action",6]]),n1=Vt.size,r1=k(e=>`af-kind-${e}`,"kindClass"),H1=[...Vt.keys()],a1=k(e=>Math.max(1,e-n1),"containerSlotCount"),o1=k((e,i)=>{const n=n1+e%a1(i);return i>0?n%i:n},"containerSlot");function u1(e,i,n){const r=ce().themeVariables?.borderColorArray,u=Array.isArray(r)?r.length:0;let l=n.size;for(const a of e??[]){if(a.isGroup||a.shape==="collapsedGroup"){const f=n.get(String(a.id))??l++;a.colorIndex=o1(f,u);continue}const c=i(String(a.id));c&&Vt.has(c)&&(a.cssClasses=`${a.cssClasses??""} ${r1(c)}`.replace(/\s+/g," ").trim())}}k(u1,"assignColorSlots");var s1="agentflow-",Rt=new Set(["shape","view","icon","img","form","pos","w","h","class","style","labelType"]),Y1=new Set(["subroutine","subprocess","subproc","framed-rectangle","tool"]),q1={flow:"flowGroup"};function l1(e){let i=!1,n=!1,r=0,u;const l=[];for(const a of e.split(`
2
+ `)){if(u!==void 0){const g=a.length-a.trimStart().length;if(a.trim()===""||g>u){l.push(a);continue}u=void 0}let c=-1;for(let g=0;g<a.length;g++){const b=a[g];if(n)b==="\\"?g++:b==='"'&&(n=!1);else if(i)b==="'"&&(i=!1);else if(b==='"')n=!0;else if(b==="'")i=!0;else if(b==="#"&&(g===0||a[g-1]===" "||a[g-1]===" ")){c=g;break}else b==="["||b==="{"?r++:(b==="]"||b==="}")&&(r=Math.max(0,r-1))}if(i||n||r>0){l.push(a);continue}const f=c>=0?a.slice(0,c):a,p=c>=0?a.slice(c):"";if(/:\s*[>|][\d+-]*\s*$/.test(f)){u=a.length-a.trimStart().length,l.push(a);continue}l.push(f.replace(/,([\t ]*)$/,"$1")+p)}return l.join(`
3
+ `)}k(l1,"stripLineTrailingCommas");var X1=class{constructor(){this.vertexCounter=0,this.config=ce(),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=x1,this.setAccDescription=T1,this.setDiagramTitle=D1,this.getAccTitle=_1,this.getAccDescription=v1,this.getDiagramTitle=F1,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{k(this,"AgentFlowDB")}sanitizeText(e){return V1.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(const i of this.vertices.values())if(i.id===e)return this.diagramId?`${this.diagramId}-${i.domId}`:i.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,i,n,r,u,l,a={},c,f){if(!e||e.trim().length===0)return;let p;if(c!==void 0){let m;c.includes(`
4
+ `)?m=c+`
5
+ `:m=`{
6
+ `+c+`
7
+ }`;try{p=e1(m,{schema:t1})??{}}catch(d){const h=c.includes(`
8
+ `)?l1(c):c;if(h!==c)try{p=e1(h+`
9
+ `,{schema:t1})??{}}catch{this.rethrowMetadataYamlError(d,c,f)}else this.rethrowMetadataYamlError(d,c,f)}p=b1(p)}let g;if(p&&typeof p.shape=="string"){const m=p;g=m.shape;const d=$e(g);d&&d!==g&&(m.shape=d)}const b=this.subGraphLookup.get(e);if(b&&p){b.metadata={...b.metadata,...p};return}const _=this.connectors.get(e);if(_&&p){_.metadata={..._.metadata,...p};return}if(e==="connectors")return;const S=this.edges.find(m=>m.id===e);if(S){const m=p;m?.animate!==void 0&&(S.animate=m.animate),m?.animation!==void 0&&(S.animation=m.animation),m?.curve!==void 0&&(S.interpolate=m.curve),p&&(S.metadata={...S.metadata,...p});return}let B,T=this.vertices.get(e);if(T===void 0&&(T={id:e,labelType:"text",domId:s1+e+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(e,T)),this.vertexCounter++,i!==void 0?(this.config=ce(),B=this.sanitizeText(i.text.trim()),T.labelType=i.type,B.startsWith('"')&&B.endsWith('"')&&(B=B.substring(1,B.length-1)),T.text=B):T.text===void 0&&(T.text=e),n!==void 0&&(T.type=n),r?.forEach(m=>{T.styles.push(m)}),u?.forEach(m=>{T.classes.push(m)}),l!==void 0&&(T.dir=l),T.props===void 0?T.props=a:a!==void 0&&Object.assign(T.props,a),p){if(T.metadata={...T.metadata,...p},p.shape){const m=g??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(!I1(p.shape))throw this.positionedShapeError(`No such shape: ${p.shape}.`,f);T.type=p?.shape}p?.label&&(T.text=this.sanitizeText(p.label),T.labelType=this.sanitizeNodeLabelType(p?.labelType))}}positionedShapeError(e,i){const n=new Error(e);if(!i)return n;const r=i.first_line+this.frontmatterLineOffset;return Object.assign(n,{hash:{text:"",token:null,line:r-1,loc:{first_line:r,last_line:i.last_line+this.frontmatterLineOffset,first_column:i.first_column,last_column:i.last_column},expected:[]}}),n}rethrowMetadataYamlError(e,i,n){const r=e;if(!r||r.name!=="YAMLException"||!r.mark||!n)throw e;let u;try{const l=!i.includes(`
10
+ `),a=l?`{
11
+ `+i+`
12
+ }`:i+`
13
+ `,c=n.first_line+this.frontmatterLineOffset,f=n.first_column+2,p=k((m,d)=>l?{line:c,column:f+(m===1?d:0)}:{line:c+m,column:m===0?f+d:d},"toSource"),g=p(r.mark.line,r.mark.column),b=r.reason??(r.message??"").split(`
14
+ `)[0].replace(/\s*\(\d+:\d+\)\s*$/,""),_=a.split(`
15
+ `),S=[];if(l)S.push(1);else for(let m=r.mark.line-1;m<=r.mark.line+1;m++)m<0||m>=_.length||m===_.length-1&&_[m]===""&&m!==r.mark.line||S.push(m);const B=Math.max(...S.map(m=>String(p(m,0).line).length)),T=[];for(const m of S){const d=p(m,0).line,h=` ${String(d).padStart(B)} | `;T.push(h+_[m].replace(/\t/g,"→")),m===r.mark.line&&T.push("-".repeat(h.length+r.mark.column)+"^")}u={message:`${b} (${g.line}:${g.column+1})
16
+
17
+ ${T.join(`
18
+ `)}`,markLine:g.line-1,markColumn:g.column,hash:{text:"",token:null,line:g.line-1,loc:{first_line:g.line,last_line:g.line,first_column:g.column,last_column:g.column+1},expected:[]}}}catch{}throw u&&(r.message=u.message,r.mark.line=u.markLine,r.mark.column=u.markColumn,r.hash=u.hash),r}addSingleLink(e,i,n,r){const a={start:e,end:i,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};ae.info("abc78 Got edge...",a);const c=n.text;if(c!==void 0&&(a.text=this.sanitizeText(c.text.trim()),a.text.startsWith('"')&&a.text.endsWith('"')&&(a.text=a.text.substring(1,a.text.length-1)),a.labelType=this.sanitizeNodeLabelType(c.type)),n!==void 0&&(a.type=n.type,a.stroke=n.stroke,a.length=n.length>10?10:n.length,n.edgeSemantic&&(a.edgeSemantic=n.edgeSemantic)),r&&!this.edges.some(f=>f.id===r))a.id=r,a.isUserDefinedId=!0;else{const f=this.edges.filter(p=>p.start===a.start&&p.end===a.end);f.length===0?a.id=yt(a.start,a.end,{counter:0,prefix:"L"}):a.id=yt(a.start,a.end,{counter:f.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))ae.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}.
19
+
20
+ Initialize mermaid with maxEdges set to a higher number to allow more edges.
21
+ You cannot set this config via configuration inside the diagram as it is a secure config.
22
+ You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e=="object"&&"id"in e&&typeof e.id=="string"}addLink(e,i,n){const r=this.isLinkData(n)?n.id.replace("@",""):void 0;ae.info("addLink",e,i,r);for(const u of e)for(const l of i){const a=u===e[e.length-1],c=l===i[0];a&&c?this.addSingleLink(u,l,n,r):this.addSingleLink(u,l,n,void 0)}}updateLinkInterpolate(e,i){e.forEach(n=>{if(n==="default"){this.edges.defaultInterpolate=i;return}if(typeof n=="number"&&n>=this.edges.length)throw new Error(`The index ${n} 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[n].interpolate=i})}updateLink(e,i){e.forEach(n=>{if(typeof n=="number"&&n>=this.edges.length)throw new Error(`The index ${n} 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.)`);n==="default"?this.edges.defaultStyle=i:(this.edges[n].style=i,(this.edges[n]?.style?.length??0)>0&&!this.edges[n]?.style?.some(r=>r?.startsWith("fill"))&&this.edges[n]?.style?.push("fill:none"))})}addClass(e,i){const n=i.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(r=>{let u=this.classes.get(r);u===void 0&&(u={id:r,styles:[],textStyles:[]},this.classes.set(r,u)),n?.forEach(l=>{if(/color/.exec(l)){const a=l.replace("fill","bgFill");u.textStyles.push(a)}u.styles.push(l)})})}setDirection(e){this.direction=e.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(e,i){for(const n of e.split(",")){const r=this.vertices.get(n);r&&r.classes.push(i);const u=this.edges.find(a=>a.id===n);u&&u.classes.push(i);const l=this.subGraphLookup.get(n);l&&l.classes.push(i)}}setTooltip(e,i){if(i!==void 0){i=this.sanitizeText(i);for(const n of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,i)}}setClickFun(e,i,n){if(ce().securityLevel!=="loose"||i===void 0)return;let r=[];if(typeof n=="string"){r=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let l=0;l<r.length;l++){let a=r[l].trim();a.startsWith('"')&&a.endsWith('"')&&(a=a.substr(1,a.length-2)),r[l]=a}}r.length===0&&r.push(e);const u=this.vertices.get(e);u&&(u.haveCallback=!0,this.funs.push(()=>{const l=this.lookUpDomId(e),a=document.querySelector(`[id="${l}"]`);a!==null&&a.addEventListener("click",()=>{Ot.runFunc(i,...r)},!1)}))}setLink(e,i,n){e.split(",").forEach(r=>{const u=this.vertices.get(r);u!==void 0&&(u.link=Ot.formatUrl(i,this.config),u.linkTarget=n)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,i,n){e.split(",").forEach(r=>{this.setClickFun(r,i,n)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach(i=>{i(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}isToolDefinition(e){return Y1.has(e.type)}getTools(){const e=[];for(const i of this.vertices.values())this.isToolDefinition(i)&&e.push(i);return e}getClasses(){return this.classes}setupToolTips(e){const i=U1();Nt(e).select("svg").selectAll("g.node").on("mouseover",u=>{const l=Nt(u.currentTarget),a=l.attr("title");if(a===null)return;const c=u.currentTarget?.getBoundingClientRect();i.transition().duration(200).style("opacity",".9"),i.text(l.attr("title")).style("left",window.scrollX+c.left+(c.right-c.left)/2+"px").style("top",window.scrollY+c.bottom+"px"),i.html(L1.sanitize(a)),l.classed("hover",!0)}).on("mouseout",u=>{i.transition().duration(500).style("opacity",0),Nt(u.currentTarget).classed("hover",!1)})}clear(e="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=e,this.config=ce(),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,B1()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,i,n,r){let u=e?.text?.trim(),l=n?.text;e===n&&n?.text&&/\s/.exec(n.text)&&(u=void 0);const c=k(S=>{const B={boolean:{},number:{},string:{}},T=[];let m;return{nodeList:S.filter(function(h){const x=typeof h;return h.stmt&&h.stmt==="dir"?(m=h.value,!1):h.trim()===""?!1:x in B?B[x].hasOwnProperty(h)?!1:B[x][h]=!0:T.includes(h)?!1:T.push(h)}),dir:m}},"uniq")(i.flat()),f=c.nodeList;let p=c.dir;const g=ce().flowchart??{};if(p=p??(g.inheritDir?this.getDirection()??ce().direction??void 0:void 0),this.version==="gen-1")for(let S=0;S<f.length;S++)f[S]=this.lookUpDomId(f[S]);u=u??"subGraph"+this.subCount,l=l||"",l=this.sanitizeText(l),this.subCount=this.subCount+1;const b={id:u,nodes:f.filter(S=>S!==u&&!this.globalNodes.has(S)),title:l.trim(),classes:[],dir:p,labelType:this.sanitizeNodeLabelType(n?.type),type:r??"flow"};ae.info("Adding",b.id,b.nodes,b.dir),b.nodes=this.makeUniq(b,this.subGraphs).nodes;const _=this.getPosForId(u);if(_!==-1){const S=this.subGraphs[_];for(const B of b.nodes)S.nodes.includes(B)||S.nodes.push(B);b.title&&(S.title=b.title),b.dir&&(S.dir=b.dir),b.type&&(S.type=b.type),this.subGraphLookup.set(u,S)}else this.subGraphs.push(b),this.subGraphLookup.set(u,b);return u}addGlobal(e){for(const i of e.flat()){if(typeof i!="string")continue;const n=i.trim();n!==""&&this.globalNodes.add(n)}for(const i of this.subGraphs)i.nodes=i.nodes.filter(n=>!this.globalNodes.has(n))}getPosForId(e){for(const[i,n]of this.subGraphs.entries())if(n.id===e)return i;return-1}indexNodes2(e,i){const n=this.subGraphs[i].nodes;if(this.secCount=this.secCount+1,this.secCount>2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=i,this.subGraphs[i].id===e)return{result:!0,count:0};let r=0,u=1;for(;r<n.length;){const l=this.getPosForId(n[r]);if(l>=0){const a=this.indexNodes2(e,l);if(a.result)return{result:!0,count:u+a.count};u=u+a.count}r=r+1}return{result:!1,count:u}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}addConnector(e,i){const n=e?.text?.trim();if(!n)return"";const r=i?.text?.trim()??"",u=r.length>0?this.sanitizeText(r):n;let l=this.connectors.get(n);return l?r.length>0&&(l.text=u):(l={id:n,labelType:"text",domId:s1+n+"-"+this.vertexCounter,styles:[],classes:[],isConnector:!0,text:u},this.connectors.set(n,l),this.vertices.set(n,l),this.vertexCounter++),n}getSubGraphs(){return this.subGraphs}getConnectors(){return[...this.connectors.values()]}firstGraph(){return this.firstGraphFlag?(this.firstGraphFlag=!1,!0):!1}computeEdgeSemantic(e,i){if(e==="arrow_point"&&i==="normal")return"sequence";if(e==="arrow_cross"&&i==="normal")return"failure";if(e==="arrow_open"&&i==="dotted")return"reference"}destructStartLink(e){const i=e.trim(),n="arrow_open";let r="normal";return i.includes(".")&&(r="dotted"),{type:n,stroke:r}}countChar(e,i){const n=i.length;let r=0;for(let u=0;u<n;++u)i[u]===e&&++r;return r}destructEndLink(e){const i=e.trim();let n=i.slice(0,-1),r="arrow_open";switch(i.slice(-1)){case"x":r="arrow_cross";break;case">":r="arrow_point";break;case"-":case".":r="arrow_open",n=i;break}let u="normal",l=n.length-1;const a=this.countChar(".",n);return a>0&&(u="dotted",l=a),{type:r,stroke:u,length:l}}destructLink(e,i){const n=this.destructEndLink(e);let r;return i?(r=this.destructStartLink(i),r.stroke!==n.stroke?{type:"INVALID",stroke:"INVALID"}:(r.type=n.type,r.length=n.length,{...r,edgeSemantic:this.computeEdgeSemantic(r.type,r.stroke)})):{...n,edgeSemantic:this.computeEdgeSemantic(n.type,n.stroke)}}exists(e,i){for(const n of e)if(n.nodes.includes(i))return!0;return!1}makeUniq(e,i){const n=[];return e.nodes.forEach((r,u)=>{this.exists(i,r)||n.push(e.nodes[u])}),{nodes:n}}getTypeFromVertex(e){const i=typeof e.type=="string"?$e(e.type):e.type;switch(i){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return i}}findNode(e,i){return e.find(n=>n.id===i)}destructEdgeType(e){let i="none",n="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":case"arrow_hierarchy":n=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":i=e.replace("double_",""),n=i;break}return{arrowTypeStart:i,arrowTypeEnd:n}}addNodeFromVertex(e,i,n,r,u,l){const a=n.get(e.id),c=r.get(e.id)??!1,f=this.findNode(i,e.id);if(f)f.cssStyles=e.styles,f.cssCompiledStyles=this.getCompiledStyles(e.classes),f.cssClasses=e.classes.join(" ");else{const p={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:a,padding:u.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:l,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),metadata:e.metadata};c?i.push({...p,isGroup:!0,shape:"rect"}):i.push({...p,isGroup:!1,shape:this.getTypeFromVertex(e),wrappingWidth:u.agentflow?.wrappingWidth,minWidth:u.agentflow?.minNodeWidth})}}getCompiledStyles(e){let i=[];for(const n of e){const r=this.classes.get(n);r?.styles&&(i=[...i,...r.styles??[]].map(u=>u.trim())),r?.textStyles&&(i=[...i,...r.textStyles??[]].map(u=>u.trim()))}return i}runPostParseValidators(){this.postParseValidationRun||(this.postParseValidationRun=!0)}getData(){this.runPostParseValidators();const e=ce(),i=[],n=[],r=this.getSubGraphs(),u=new Map,l=new Map,a=new Set,c=new Map,f=k((d,h,x=new Set)=>{if(x.has(d))return;x.add(d);const N=this.subGraphLookup.get(d);if(N)for(const te of N.nodes)te===h||x.has(te)||(a.add(te),c.set(te,h),f(te,h,x))},"collectDescendants");for(const d of r)d.metadata?.view==="collapsed"&&!a.has(d.id)&&f(d.id,d.id);const p=k((d,h)=>{const x=new Set;let N=h;for(;N!==void 0&&!x.has(N);){if(N===d)return!0;x.add(N),N=u.get(N)}return!1},"wouldCloseContainmentCycle");for(let d=r.length-1;d>=0;d--){const h=r[d];if(!a.has(h.id)){h.nodes.length>0&&l.set(h.id,!0);for(const x of h.nodes){if(p(x,h.id)){this.emitWarning(et.CONTAINMENT_VIOLATION,`Container "${h.id}" cannot contain "${x}" because "${x}" already contains it. The nesting that would close the loop is dropped.`,{nodeId:x});continue}u.set(x,h.id)}}}for(let d=r.length-1;d>=0;d--){const h=r[d];if(a.has(h.id))continue;if(h.metadata?.view==="collapsed"){const N={...h.metadata,containerType:h.type};i.push({id:h.id,label:h.title,labelStyle:"",labelType:h.labelType,parentId:u.get(h.id),padding:8,cssCompiledStyles:this.getCompiledStyles(h.classes),cssClasses:h.classes.join(" "),shape:"collapsedGroup",dir:h.dir,isGroup:!1,look:e.look,metadata:N})}else i.push({id:h.id,label:h.title,labelStyle:"",labelType:h.labelType,parentId:u.get(h.id),padding:8,cssCompiledStyles:this.getCompiledStyles(h.classes),cssClasses:h.classes.join(" "),shape:q1[h.type??"flow"],dir:h.dir,isGroup:!0,look:e.look,metadata:h.metadata})}this.getVertices().forEach(d=>{a.has(d.id)||this.addNodeFromVertex(d,i,u,l,e,e.look||"classic")});const b=this.getEdges();b.forEach((d,h)=>{const x=c.get(d.start)??d.start,N=c.get(d.end)??d.end;if(x===N&&d.start!==d.end)return;const{arrowTypeStart:te,arrowTypeEnd:de}=this.destructEdgeType(d.type),ue=[...b.defaultStyle??[]];d.style&&ue.push(...d.style);const he={id:yt(x,N,{counter:h,prefix:"L"},d.id),isUserDefinedId:d.isUserDefinedId,start:x,end:N,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":te,arrowTypeEnd:d?.stroke==="invisible"||d?.type==="arrow_open"?"none":de,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(d.classes),labelStyle:ue,style:ue,pattern:d.stroke,look:e.look,animate:d.animate,animation:d.animation,curve:d.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve,metadata:d.metadata};n.push(he)}),i1(i,this);const _=new Map,S=new Map;for(const d of r){const h=u.get(d.id);h!==void 0&&S.set(h,[...S.get(h)??[],d.id])}let B=0;const T=k(d=>{if(!_.has(d)){_.set(d,B++);for(const h of S.get(d)??[])T(h)}},"walkContainers");for(const d of r)u.get(d.id)===void 0&&T(d.id);const m=new Set(this.getConnectors().map(d=>d.id));return u1(i,d=>{if(m.has(d))return"connector";const h=this.vertices.get(d);return h?this.deriveVertexKind(h,$e(h.type)):void 0},_),{nodes:i,edges:n,other:{},config:e,connectors:this.getConnectors()}}validate(){ce().layout==="grid"&&M1(void 0,[...this.vertices.values(),...this.subGraphs])}defaultConfig(){return w1.flowchart}deriveVertexKind(e,i){return this.isToolDefinition(e)?"tool":i==="hexagon"||i==="hex"?"action":i==="lean-right"||i==="lean_right"?"input":i==="lin-doc"||i==="lined-document"?"refdoc":i==="diamond"?"decision":"task"}getSemanticModel(){this.runPostParseValidators();const e=new Set(this.subGraphs.map(a=>a.id)),i=[],n=[];for(const[a,c]of this.vertices){if(e.has(a))continue;if(c.isConnector){const g={id:a};if(c.text!==void 0&&c.text!==a&&(g.title=c.text),c.metadata&&Object.keys(c.metadata).length>0){const b={};for(const[_,S]of Object.entries(c.metadata))Rt.has(_)||(b[_]=S);Object.keys(b).length>0&&(g.metadata=b)}n.push(g);continue}const f={id:a};c.text!==void 0&&(f.label=c.text);const p=typeof c.type=="string"?$e(c.type):c.type;if(p!==void 0&&(f.shape=p),f.vertexKind=this.deriveVertexKind(c,p),c.metadata&&Object.keys(c.metadata).length>0){const g={};for(const[b,_]of Object.entries(c.metadata))Rt.has(b)||(g[b]=_);Object.keys(g).length>0&&(f.metadata=g)}i.push(f)}const r=this.edges.map(a=>{const c={start:a.start,end:a.end};return a.id!==void 0&&(c.id=a.id),typeof a.text=="string"&&a.text.length>0&&(c.label=a.text),a.type!==void 0&&(c.type=a.type),a.stroke!==void 0&&(c.stroke=a.stroke),a.edgeSemantic!==void 0&&(c.edgeSemantic=a.edgeSemantic),a.length!==void 0&&(c.length=a.length),a.metadata&&Object.keys(a.metadata).length>0&&(c.metadata={...a.metadata}),c}),u=this.subGraphs.map(a=>{const c={id:a.id,nodes:[...a.nodes]};if(a.type!==void 0&&(c.type=a.type),a.title!==void 0&&(c.title=a.title),a.dir!==void 0&&(c.direction=a.dir),a.metadata&&Object.keys(a.metadata).length>0){const f={};for(const[p,g]of Object.entries(a.metadata))Rt.has(p)||(f[p]=g);Object.keys(f).length>0&&(c.metadata=f)}return c}),l={vertices:i,edges:r,subGraphs:u,connectors:n,diagnostics:this.diagnostics};return this.direction!==void 0&&(l.direction=this.direction),l}setFrontmatterLineOffset(e){this.frontmatterLineOffset=e??0}toElementPosition(e){const i=e?.first_line??0,n=e?.first_column??0,r=e?.last_line??i,u=e?.last_column??n,[l,a]=e?.range??[0,0];return{startLine:i+this.frontmatterLineOffset,startColumn:n,endLine:r+this.frontmatterLineOffset,endColumn:u,startIndex:l,endIndex:a}}pushMapping(e,i,n){if(!e)return;const r={id:e,type:i,position:this.toElementPosition(n)};return this.elementMappings.push(r),r}addVertexMapping(e,i,n,r){const u=this.pushMapping(e,"vertex",r);u&&n==null&&this.bareVertexMappings.add(u)}extendVertexMapping(e,i){if(!e||!i)return;const n=this.toElementPosition(i);for(let r=this.elementMappings.length-1;r>=0;r--){const u=this.elementMappings[r];if(u.type==="vertex"&&u.id===e){this.bareVertexMappings.has(u)&&(u.type="attachment",this.bareVertexMappings.delete(u)),(n.endLine>u.position.endLine||n.endLine===u.position.endLine&&n.endColumn>u.position.endColumn)&&(u.position.endLine=n.endLine,u.position.endColumn=n.endColumn,u.position.endIndex=n.endIndex);return}}this.pushMapping(e,"attachment",i)}addEdgeMapping(e,i,n,r){const u=Array.isArray(i)?i.map(a=>typeof a=="string"?a:a?.id??"").filter(Boolean):[],l=u.length>0?u.join(">"):"edge";this.pushMapping(l,"edge",r)}addSubgraphMapping(e,i,n,r){const u=(typeof e=="string"?e:e?.text)??"",l=this.toElementPosition(n),a=r?this.toElementPosition(r):l;u&&this.elementMappings.push({id:u,type:"subgraph",position:{startLine:l.startLine,startColumn:l.startColumn,endLine:a.endLine,endColumn:a.endColumn,startIndex:l.startIndex,endIndex:a.endIndex}})}addConnectorMapping(e,i,n,r){const u=e?.text?.trim()??"";if(!u)return;const l=this.toElementPosition(n),a=r?this.toElementPosition(r):l;this.elementMappings.push({id:u,type:"connector",position:{startLine:l.startLine,startColumn:l.startColumn,endLine:a.endLine,endColumn:a.endColumn,startIndex:l.startIndex,endIndex:a.endIndex}})}getElementMappings(){return[...this.elementMappings]}getElementById(e){return this.elementMappings.find(i=>i.id===e)}getElementsOnLine(e){return this.elementMappings.filter(i=>e>=i.position.startLine&&e<=i.position.endLine)}getElementAtPosition(e,i){const n=this.elementMappings.filter(u=>{const{startLine:l,startColumn:a,endLine:c,endColumn:f}=u.position;return!(e<l||e>c||e===l&&i<a||e===c&&i>f)});if(n.length===0)return;const r=k(({position:u})=>[u.endLine-u.startLine,u.endColumn-u.startColumn],"span");return n.reduce((u,l)=>{const[a,c]=r(u),[f,p]=r(l);return f!==a?f<a?l:u:p<c?l:u})}getMappingStats(){let e=0,i=0,n=0,r=0,u=0;for(const l of this.elementMappings)l.type==="vertex"?e++:l.type==="edge"?i++:l.type==="subgraph"?n++:l.type==="connector"?r++:l.type==="attachment"&&u++;return{vertices:e,edges:i,subgraphs:n,connectors:r,attachments:u,totalElements:this.elementMappings.length}}emitDiagnostic(e,i,n,r){const u=r?.nodeId??r?.edgeId,l=u?this.getElementById(u):void 0,a={id:e,severity:i,message:n,...r?.nodeId?{nodeId:r.nodeId}:{},...r?.edgeId&&!r?.nodeId?{edgeId:r.edgeId}:{},...l?{position:l.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);const f=`agentflow[${e}]: ${n}`;i==="error"?ae.error(f):ae.warn(f)}emitWarning(e,i,n){this.emitDiagnostic(e,"warning",i,n)}emitError(e,i,n){this.emitDiagnostic(e,"error",i,n)}getDiagnostics(){return[...this.diagnostics]}},J1=k(function(e,i){return i.db.getClasses()},"getClasses"),Q1=k(async function(e,i,n,r){ae.debug("Drawing agentflow diagram",i);const{securityLevel:u,agentflow:l,layout:a}=ce();r.db.setDiagramId(i),ae.debug("Before getData: ");const c=r.db.getData();ae.debug("Data: ",c);const f=k1(i,u),p=r.db.getDirection();c.type=r.type,c.layoutAlgorithm=C1(a),c.layoutAlgorithm==="dagre"&&a==="elk"&&ae.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."),c.direction=p,c.nodeSpacing=l?.nodeSpacing||50,c.rankSpacing=l?.rankSpacing||50,c.markers=["point","circle","cross","hierarchy"],c.diagramId=i,ae.debug("REF1:",c),await S1(c,f);const g=l?.diagramPadding??8;Ot.insertTitle(f,"agentflowTitleText",l?.titleTopMargin??0,r.db.getDiagramTitle()),E1(f,g,"agentflow",l?.useMaxWidth??!0)},"draw"),Z1={getClasses:J1,draw:Q1},Pt=(function(){var e=k(function(Te,A,E,C){for(E=E||{},C=Te.length;C--;E[Te[C]]=A);return E},"o"),i=[1,5],n=[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],a=[2,2],c=[1,15],f=[1,16],p=[1,17],g=[1,18],b=[1,19],_=[1,26],S=[1,27],B=[1,28],T=[1,30],m=[1,31],d=[1,32],h=[1,55],x=[1,54],N=[1,34],te=[1,35],de=[1,36],ue=[1,37],he=[1,38],O=[1,50],P=[1,52],G=[1,48],U=[1,53],j=[1,49],z=[1,56],W=[1,51],K=[1,57],H=[1,58],De=[1,39],_e=[1,40],ve=[1,41],Fe=[1,42],Ve=[1,43],Se=[1,64],D=[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],Q=[1,70],Z=[1,68],$=[1,67],ee=[1,69],Me=[8,9,10,12,78,80,81],we=[1,88],ye=[1,101],Ne=[1,106],Re=[1,105],Oe=[1,102],Pe=[1,98],Ge=[1,104],Ue=[1,100],je=[1,107],ze=[1,103],We=[1,108],Ke=[1,99],Ie=[8,9,10,11,12,43,78,80,81],q=[8,9,10,11,12,43,49,78,80,81],ie=[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],Gt=[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],Ut=[1,131],jt=[1,132],tt=[1,134],st=[1,133],zt=[47,63,65,77,92,105,108,109,112,114,117,118,119],it=[1,143],nt=[1,157],rt=[1,158],at=[1,159],ot=[1,162],ut=[1,161],lt=[1,160],ct=[1,145],dt=[1,147],ht=[1,151],Wt=[1,139],Kt=[1,140],pt=[1,152],ft=[1,153],gt=[1,154],mt=[1,155],bt=[1,156],At=[1,163],kt=[1,164],Et=[1,141],Ct=[1,142],St=[1,149],xt=[1,144],Tt=[1,148],Dt=[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],Ht=[1,168],qe=[1,170],R=[8,9,10,12],ne=[8,9,10,11,12,15,47,63,92,108,109,112,114,117,118,119],v=[1,190],X=[1,186],J=[1,187],F=[1,191],V=[1,188],I=[1,189],Xe=[80,119,122],M=[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],Yt=[11,109],xe=[32,52,54,56,58,60,65,67,69,70,72,74,119,120,121],pe=[1,269],fe=[1,267],ge=[1,271],me=[1,265],be=[1,266],Ae=[1,268],ke=[1,270],Ee=[1,272],Je=[1,292],qt=[8,9,10,12,109],le=[8,9,10,11,12,63,87,108,109,112,113,114,115],It={trace:k(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:k(function(A,E,C,o,w,t,L){var s=t.length-1;switch(w){case 2:this.$=[];break;case 3:(!Array.isArray(t[s])||t[s].length>0)&&t[s-1].push(t[s]),this.$=t[s-1];break;case 4:case 198:this.$=t[s];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(t[s-1]),this.$=t[s-1];break;case 32:this.$=t[s-1].nodes;break;case 38:this.$=o.addSubGraph(t[s-6],t[s-1],t[s-4],"flow"),o.addSubgraphMapping&&o.addSubgraphMapping(t[s-6],t[s-4],L[s-8],L[s]);break;case 39:this.$=o.addSubGraph(t[s-7],t[s-1],t[s-5],"flow"),o.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,t[s-3],L[s-3]),o.addSubgraphMapping&&o.addSubgraphMapping(t[s-7],t[s-5],L[s-9],L[s]);break;case 40:this.$=o.addSubGraph(t[s-3],t[s-1],{text:"",type:"text"},"flow"),o.addSubgraphMapping&&o.addSubgraphMapping(t[s-3],{text:"",type:"text"},L[s-5],L[s]);break;case 41:this.$=o.addSubGraph(t[s-4],t[s-1],{text:"",type:"text"},"flow"),o.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,t[s-3],L[s-3]),o.addSubgraphMapping&&o.addSubgraphMapping(t[s-4],{text:"",type:"text"},L[s-6],L[s]);break;case 42:this.$=o.addSubGraph(void 0,t[s-1],void 0,"flow"),o.addSubgraphMapping&&o.addSubgraphMapping(void 0,void 0,L[s-3],L[s]);break;case 43:o.addGlobal(t[s-1]),this.$=[];break;case 44:this.$=o.addConnector(t[s-4],t[s-2]),o.addConnectorMapping&&o.addConnectorMapping(t[s-4],t[s-2],L[s-6],L[s]);break;case 45:this.$=o.addConnector(t[s-5],t[s-3]),o.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,t[s-1],L[s-1]),o.addConnectorMapping&&o.addConnectorMapping(t[s-5],t[s-3],L[s-7],L[s]);break;case 46:this.$=o.addConnector(t[s-1],{text:"",type:"text"}),o.addConnectorMapping&&o.addConnectorMapping(t[s-1],{text:"",type:"text"},L[s-3],L[s]);break;case 47:this.$=o.addConnector(t[s-2],{text:"",type:"text"}),o.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,t[s-1],L[s-1]),o.addConnectorMapping&&o.addConnectorMapping(t[s-2],{text:"",type:"text"},L[s-4],L[s]);break;case 49:this.$=t[s].trim(),o.setAccTitle(this.$);break;case 50:case 51:this.$=t[s].trim(),o.setAccDescription(this.$);break;case 56:this.$=t[s-1]+t[s];break;case 57:this.$=t[s];break;case 58:o.addVertex(t[s-1][t[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s],L[s]),o.extendVertexMapping&&o.extendVertexMapping(t[s-1][t[s-1].length-1],L[s]),o.addLink(t[s-3].stmt,t[s-1],t[s-2]),o.addEdgeMapping&&o.addEdgeMapping(t[s-3].stmt,t[s-1],t[s-2],this._$),this.$={stmt:t[s-1],nodes:t[s-1].concat(t[s-3].nodes)};break;case 59:o.addLink(t[s-2].stmt,t[s],t[s-1]),o.addEdgeMapping&&o.addEdgeMapping(t[s-2].stmt,t[s],t[s-1],this._$),this.$={stmt:t[s],nodes:t[s].concat(t[s-2].nodes)};break;case 60:o.addLink(t[s-3].stmt,t[s-1],t[s-2]),o.addEdgeMapping&&o.addEdgeMapping(t[s-3].stmt,t[s-1],t[s-2],this._$),this.$={stmt:t[s-1],nodes:t[s-1].concat(t[s-3].nodes)};break;case 61:this.$={stmt:t[s-1],nodes:t[s-1]};break;case 62:o.addVertex(t[s-1][t[s-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s],L[s]),o.extendVertexMapping&&o.extendVertexMapping(t[s-1][t[s-1].length-1],L[s]),this.$={stmt:t[s-1],nodes:t[s-1],shapeData:t[s]};break;case 63:this.$={stmt:t[s],nodes:t[s]};break;case 64:this.$=[t[s]];break;case 65:o.addVertex(t[s-5][t[s-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,t[s-4],L[s-4]),o.extendVertexMapping&&o.extendVertexMapping(t[s-5][t[s-5].length-1],L[s-4]),this.$=t[s-5].concat(t[s]);break;case 66:this.$=t[s-4].concat(t[s]);break;case 67:this.$=t[s];break;case 68:this.$=t[s-2],o.setClass(t[s-2],t[s]);break;case 69:this.$=t[s-3],o.addVertex(t[s-3],t[s-1],"square"),o.addVertexMapping&&o.addVertexMapping(t[s-3],t[s-1],"square",this._$);break;case 70:this.$=t[s-3],o.addVertex(t[s-3],t[s-1],"doublecircle"),o.addVertexMapping&&o.addVertexMapping(t[s-3],t[s-1],"doublecircle",this._$);break;case 71:this.$=t[s-5],o.addVertex(t[s-5],t[s-2],"circle"),o.addVertexMapping&&o.addVertexMapping(t[s-5],t[s-2],"circle",this._$);break;case 72:this.$=t[s-3],o.addVertex(t[s-3],t[s-1],"ellipse"),o.addVertexMapping&&o.addVertexMapping(t[s-3],t[s-1],"ellipse",this._$);break;case 73:this.$=t[s-3],o.addVertex(t[s-3],t[s-1],"stadium"),o.addVertexMapping&&o.addVertexMapping(t[s-3],t[s-1],"stadium",this._$);break;case 74:this.$=t[s-3],o.addVertex(t[s-3],t[s-1],"subroutine"),o.addVertexMapping&&o.addVertexMapping(t[s-3],t[s-1],"subroutine",this._$);break;case 75:this.$=t[s-7],o.addVertex(t[s-7],t[s-1],"rect",void 0,void 0,void 0,Object.fromEntries([[t[s-5],t[s-3]]])),o.addVertexMapping&&o.addVertexMapping(t[s-7],t[s-1],"rect",this._$);break;case 76:this.$=t[s-3],o.addVertex(t[s-3],t[s-1],"cylinder"),o.addVertexMapping&&o.addVertexMapping(t[s-3],t[s-1],"cylinder",this._$);break;case 77:this.$=t[s-3],o.addVertex(t[s-3],t[s-1],"round"),o.addVertexMapping&&o.addVertexMapping(t[s-3],t[s-1],"round",this._$);break;case 78:this.$=t[s-3],o.addVertex(t[s-3],t[s-1],"diamond"),o.addVertexMapping&&o.addVertexMapping(t[s-3],t[s-1],"diamond",this._$);break;case 79:this.$=t[s-5],o.addVertex(t[s-5],t[s-2],"hexagon"),o.addVertexMapping&&o.addVertexMapping(t[s-5],t[s-2],"hexagon",this._$);break;case 80:this.$=t[s-3],o.addVertex(t[s-3],t[s-1],"odd"),o.addVertexMapping&&o.addVertexMapping(t[s-3],t[s-1],"odd",this._$);break;case 81:this.$=t[s-3],o.addVertex(t[s-3],t[s-1],"trapezoid"),o.addVertexMapping&&o.addVertexMapping(t[s-3],t[s-1],"trapezoid",this._$);break;case 82:this.$=t[s-3],o.addVertex(t[s-3],t[s-1],"inv_trapezoid"),o.addVertexMapping&&o.addVertexMapping(t[s-3],t[s-1],"inv_trapezoid",this._$);break;case 83:this.$=t[s-3],o.addVertex(t[s-3],t[s-1],"lean_right"),o.addVertexMapping&&o.addVertexMapping(t[s-3],t[s-1],"lean_right",this._$);break;case 84:this.$=t[s-3],o.addVertex(t[s-3],t[s-1],"lean_left"),o.addVertexMapping&&o.addVertexMapping(t[s-3],t[s-1],"lean_left",this._$);break;case 85:this.$=t[s],o.addVertex(t[s]),o.addVertexMapping&&o.addVertexMapping(t[s],void 0,void 0,this._$);break;case 86:t[s-1].text=t[s],this.$=t[s-1];break;case 87:case 88:t[s-2].text=t[s-1],this.$=t[s-2];break;case 89:this.$=t[s];break;case 90:var y=o.destructLink(t[s],t[s-2]);this.$={type:y.type,stroke:y.stroke,length:y.length,edgeSemantic:y.edgeSemantic,text:t[s-1]};break;case 91:var y=o.destructLink(t[s],t[s-2]);this.$={type:y.type,stroke:y.stroke,length:y.length,edgeSemantic:y.edgeSemantic,text:t[s-1],id:t[s-3]};break;case 92:this.$={text:t[s],type:"text"};break;case 93:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 94:this.$={text:t[s],type:"string"};break;case 95:this.$={text:t[s],type:"markdown"};break;case 96:var y=o.destructLink(t[s]);this.$={type:y.type,stroke:y.stroke,length:y.length,edgeSemantic:y.edgeSemantic};break;case 97:var y=o.destructLink(t[s]);this.$={type:y.type,stroke:y.stroke,length:y.length,edgeSemantic:y.edgeSemantic,id:t[s-1]};break;case 98:this.$=t[s-1];break;case 99:this.$={text:t[s],type:"text"};break;case 100:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 101:this.$={text:t[s],type:"string"};break;case 102:case 119:this.$={text:t[s],type:"markdown"};break;case 116:this.$={text:t[s],type:"text"};break;case 117:this.$={text:t[s-1].text+""+t[s],type:t[s-1].type};break;case 118:this.$={text:t[s],type:"text"};break;case 120:this.$=t[s-4],o.addClass(t[s-2],t[s]);break;case 121:this.$=t[s-4],o.setClass(t[s-2],t[s]);break;case 122:case 130:this.$=t[s-1],o.setClickEvent(t[s-1],t[s]);break;case 123:case 131:this.$=t[s-3],o.setClickEvent(t[s-3],t[s-2]),o.setTooltip(t[s-3],t[s]);break;case 124:this.$=t[s-2],o.setClickEvent(t[s-2],t[s-1],t[s]);break;case 125:this.$=t[s-4],o.setClickEvent(t[s-4],t[s-3],t[s-2]),o.setTooltip(t[s-4],t[s]);break;case 126:this.$=t[s-2],o.setLink(t[s-2],t[s]);break;case 127:this.$=t[s-4],o.setLink(t[s-4],t[s-2]),o.setTooltip(t[s-4],t[s]);break;case 128:this.$=t[s-4],o.setLink(t[s-4],t[s-2],t[s]);break;case 129:this.$=t[s-6],o.setLink(t[s-6],t[s-4],t[s]),o.setTooltip(t[s-6],t[s-2]);break;case 132:this.$=t[s-1],o.setLink(t[s-1],t[s]);break;case 133:this.$=t[s-3],o.setLink(t[s-3],t[s-2]),o.setTooltip(t[s-3],t[s]);break;case 134:this.$=t[s-3],o.setLink(t[s-3],t[s-2],t[s]);break;case 135:this.$=t[s-5],o.setLink(t[s-5],t[s-4],t[s]),o.setTooltip(t[s-5],t[s-2]);break;case 136:this.$=t[s-4],o.addVertex(t[s-2],void 0,void 0,t[s]);break;case 137:this.$=t[s-4],o.updateLink([t[s-2]],t[s]);break;case 138:this.$=t[s-4],o.updateLink(t[s-2],t[s]);break;case 139:this.$=t[s-8],o.updateLinkInterpolate([t[s-6]],t[s-2]),o.updateLink([t[s-6]],t[s]);break;case 140:this.$=t[s-8],o.updateLinkInterpolate(t[s-6],t[s-2]),o.updateLink(t[s-6],t[s]);break;case 141:this.$=t[s-6],o.updateLinkInterpolate([t[s-4]],t[s]);break;case 142:this.$=t[s-6],o.updateLinkInterpolate(t[s-4],t[s]);break;case 143:case 145:this.$=[t[s]];break;case 144:case 146:t[s-2].push(t[s]),this.$=t[s-2];break;case 148:this.$=t[s-1]+t[s];break;case 196:this.$=t[s];break;case 197:this.$=t[s-1]+""+t[s];break;case 199:this.$=t[s-1]+""+t[s];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:n,11:r,13:u},{1:[3]},e(l,a,{5:7}),{4:8,8:i,10:n,11:r,13:u},{4:9,8:i,10:n,11:r,13:u},{4:10,8:i,10:n,11:r,13:u},{14:[1,11],15:[1,12]},{1:[2,1],6:13,7:14,8:c,9:f,10:p,11:g,12:b,21:20,23:21,24:22,25:23,26:24,27:25,28:_,35:S,36:B,37:29,38:T,40:m,42:d,45:33,46:44,47:h,48:45,50:46,63:x,87:N,88:te,89:de,90:ue,91:he,92:O,105:P,108:G,109:U,112:j,114:z,116:47,117:W,118:K,119:H,124:De,125:_e,126:ve,127:Fe,128:Ve},e(l,[2,10]),e(l,[2,11]),e(l,[2,12]),e(l,[2,13]),{8:[1,63],9:[1,60],10:[1,61],11:Se,16:59,19:62},e(D,[2,3]),e(D,[2,4]),e(D,[2,5]),e(D,[2,6]),e(D,[2,7]),e(D,[2,8]),e(D,[2,9]),{8:Q,9:Z,10:$,12:ee,22:65,44:66,75:71,78:[1,72],80:[1,74],81:[1,73]},{8:Q,9:Z,10:$,12:ee,22:75},{8:Q,9:Z,10:$,12:ee,22:76},{8:Q,9:Z,10:$,12:ee,22:77},{8:Q,9:Z,10:$,12:ee,22:78},{8:Q,9:Z,10:$,12:ee,22:79},{8:Q,9:Z,10:$,11:[1,80],12:ee,22:81},{8:Q,9:Z,10:$,12:ee,22:82},{11:[1,83]},e(D,[2,48]),{39:[1,84]},{41:[1,85]},e(D,[2,51]),e(Me,[2,63],{19:86,34:87,11:Se,43:we}),{11:[1,89]},{11:[1,90]},{11:[1,91]},{11:[1,92]},{15:ye,47:Ne,63:Re,83:[1,96],92:Oe,98:[1,93],100:[1,94],104:95,108:Pe,109:Ge,112:Ue,114:je,117:ze,118:We,119:Ke,123:97},e(D,[2,200]),e(D,[2,201]),e(D,[2,202]),e(D,[2,203]),e(D,[2,204]),e(Ie,[2,64]),e(Ie,[2,67],{49:[1,109]}),e(q,[2,85],{116:122,30:[1,110],47:h,51:[1,111],53:[1,112],55:[1,113],57:[1,114],59:[1,115],61:[1,116],63:x,66:[1,117],68:[1,118],70:[1,119],71:[1,120],73:[1,121],92:O,105:P,108:G,109:U,112:j,114:z,117:W,118:K,119:H}),e(ie,[2,196]),e(ie,[2,157]),e(ie,[2,158]),e(ie,[2,159]),e(ie,[2,160]),e(ie,[2,161]),e(ie,[2,162]),e(ie,[2,163]),e(ie,[2,164]),e(ie,[2,165]),e(ie,[2,166]),e(ie,[2,167]),e(l,[2,14]),e(l,[2,20]),e(l,[2,21]),{10:[1,123]},e(l,[2,23]),e(Gt,[2,31],{19:124,11:Se}),e(D,[2,32]),{45:125,46:44,47:h,48:45,50:46,63:x,92:O,105:P,108:G,109:U,112:j,114:z,116:47,117:W,118:K,119:H},e(D,[2,52]),e(D,[2,53]),e(D,[2,54]),e(D,[2,55]),e(He,[2,89],{76:126,65:[1,128],77:[1,127]}),{79:129,82:130,83:Ut,84:jt,119:tt,122:st},{78:[1,135],80:[1,136]},e(zt,[2,96]),e(D,[2,33]),e(D,[2,34]),e(D,[2,35]),e(D,[2,36]),e(D,[2,37]),{11:it,13:nt,15:rt,28:at,29:137,33:ot,35:ut,36:lt,47:ct,63:dt,78:ht,83:Wt,84:Kt,86:150,87:pt,88:ft,89:gt,90:mt,91:bt,92:At,93:kt,94:138,108:Et,112:Ct,114:St,117:xt,118:Tt,119:Dt},e(Ye,a,{5:165}),e(Ye,a,{5:166}),{11:it,13:nt,15:rt,28:at,29:167,33:ot,35:ut,36:lt,47:ct,63:dt,78:ht,83:Wt,84:Kt,86:150,87:pt,88:ft,89:gt,90:mt,91:bt,92:At,93:kt,94:138,108:Et,112:Ct,114:St,117:xt,118:Tt,119:Dt},e(D,[2,49]),e(D,[2,50]),e(Me,[2,61],{47:Ht}),e(Me,[2,62],{19:169,11:Se,43:qe}),e(Ie,[2,57]),{47:h,50:171,63:x,92:O,105:P,108:G,109:U,112:j,114:z,116:47,117:W,118:K,119:H},{105:[1,172],106:173,108:[1,174]},{47:h,50:175,63:x,92:O,105:P,108:G,109:U,112:j,114:z,116:47,117:W,118:K,119:H},{47:h,50:176,63:x,92:O,105:P,108:G,109:U,112:j,114:z,116:47,117:W,118:K,119:H},e(R,[2,122],{11:[1,177],99:[1,178]}),{83:[1,179]},e(R,[2,130],{123:181,11:[1,180],15:ye,47:Ne,63:Re,92:Oe,108:Pe,109:Ge,112:Ue,114:je,117:ze,118:We,119:Ke}),e(R,[2,132],{11:[1,182]}),e(ne,[2,198]),e(ne,[2,185]),e(ne,[2,186]),e(ne,[2,187]),e(ne,[2,188]),e(ne,[2,189]),e(ne,[2,190]),e(ne,[2,191]),e(ne,[2,192]),e(ne,[2,193]),e(ne,[2,194]),e(ne,[2,195]),{47:h,50:183,63:x,92:O,105:P,108:G,109:U,112:j,114:z,116:47,117:W,118:K,119:H},{31:184,70:v,83:X,84:J,85:185,119:F,120:V,121:I},{31:192,70:v,83:X,84:J,85:185,119:F,120:V,121:I},{31:194,53:[1,193],70:v,83:X,84:J,85:185,119:F,120:V,121:I},{31:195,70:v,83:X,84:J,85:185,119:F,120:V,121:I},{31:196,70:v,83:X,84:J,85:185,119:F,120:V,121:I},{31:197,70:v,83:X,84:J,85:185,119:F,120:V,121:I},{112:[1,198]},{31:199,70:v,83:X,84:J,85:185,119:F,120:V,121:I},{31:200,68:[1,201],70:v,83:X,84:J,85:185,119:F,120:V,121:I},{31:202,70:v,83:X,84:J,85:185,119:F,120:V,121:I},{31:203,70:v,83:X,84:J,85:185,119:F,120:V,121:I},{31:204,70:v,83:X,84:J,85:185,119:F,120:V,121:I},e(ie,[2,197]),e(l,[2,22]),e(Gt,[2,30]),e(Me,[2,59],{34:205,19:206,11:Se,43:we}),e(He,[2,86],{11:[1,207]}),{11:[1,208]},{31:209,70:v,83:X,84:J,85:185,119:F,120:V,121:I},{80:[1,210],82:211,119:tt,122:st},e(Xe,[2,92]),e(Xe,[2,94]),e(Xe,[2,95]),e(Xe,[2,183]),e(Xe,[2,184]),{79:212,82:130,83:Ut,84:jt,119:tt,122:st},e(zt,[2,97]),{8:Q,9:Z,10:$,11:it,12:ee,13:nt,15:rt,22:214,28:at,30:[1,213],33:ot,34:215,35:ut,36:lt,43:we,47:ct,63:dt,78:ht,86:150,87:pt,88:ft,89:gt,90:mt,91:bt,92:At,93:kt,94:216,108:Et,112:Ct,114:St,117:xt,118:Tt,119:Dt},e(M,[2,116]),e(M,[2,118]),e(M,[2,119]),e(M,[2,172]),e(M,[2,173]),e(M,[2,174]),e(M,[2,175]),e(M,[2,176]),e(M,[2,177]),e(M,[2,178]),e(M,[2,179]),e(M,[2,180]),e(M,[2,181]),e(M,[2,182]),e(M,[2,103]),e(M,[2,104]),e(M,[2,105]),e(M,[2,106]),e(M,[2,107]),e(M,[2,108]),e(M,[2,109]),e(M,[2,110]),e(M,[2,111]),e(M,[2,112]),e(M,[2,113]),e(M,[2,114]),e(M,[2,115]),{6:13,7:14,8:c,9:f,10:p,11:g,12:b,21:20,23:21,24:22,25:23,26:24,27:25,28:_,33:[1,217],35:S,36:B,37:29,38:T,40:m,42:d,45:33,46:44,47:h,48:45,50:46,63:x,87:N,88:te,89:de,90:ue,91:he,92:O,105:P,108:G,109:U,112:j,114:z,116:47,117:W,118:K,119:H,124:De,125:_e,126:ve,127:Fe,128:Ve},{6:13,7:14,8:c,9:f,10:p,11:g,12:b,21:20,23:21,24:22,25:23,26:24,27:25,28:_,33:[1,218],35:S,36:B,37:29,38:T,40:m,42:d,45:33,46:44,47:h,48:45,50:46,63:x,87:N,88:te,89:de,90:ue,91:he,92:O,105:P,108:G,109:U,112:j,114:z,116:47,117:W,118:K,119:H,124:De,125:_e,126:ve,127:Fe,128:Ve},{8:Q,9:Z,10:$,11:it,12:ee,13:nt,15:rt,22:220,28:at,30:[1,219],33:ot,34:221,35:ut,36:lt,43:we,47:ct,63:dt,78:ht,86:150,87:pt,88:ft,89:gt,90:mt,91:bt,92:At,93:kt,94:216,108:Et,112:Ct,114:St,117:xt,118:Tt,119:Dt},{11:Se,19:222},{47:[1,223]},e(Ie,[2,56]),{11:[1,224],47:h,63:x,92:O,105:P,108:G,109:U,112:j,114:z,116:122,117:W,118:K,119:H},{11:[1,225]},{11:[1,226],109:[1,227]},e(Yt,[2,143]),{11:[1,228],47:h,63:x,92:O,105:P,108:G,109:U,112:j,114:z,116:122,117:W,118:K,119:H},{11:[1,229],47:h,63:x,92:O,105:P,108:G,109:U,112:j,114:z,116:122,117:W,118:K,119:H},{83:[1,230]},e(R,[2,124],{11:[1,231]}),e(R,[2,126],{11:[1,232]}),{83:[1,233]},e(ne,[2,199]),{83:[1,234],101:[1,235]},e(Ie,[2,68],{116:122,47:h,63:x,92:O,105:P,108:G,109:U,112:j,114:z,117:W,118:K,119:H}),{32:[1,236],70:v,85:237,119:F,120:V,121:I},e(xe,[2,99]),e(xe,[2,101]),e(xe,[2,102]),e(xe,[2,168]),e(xe,[2,169]),e(xe,[2,170]),e(xe,[2,171]),{52:[1,238],70:v,85:237,119:F,120:V,121:I},{31:239,70:v,83:X,84:J,85:185,119:F,120:V,121:I},{54:[1,240],70:v,85:237,119:F,120:V,121:I},{56:[1,241],70:v,85:237,119:F,120:V,121:I},{58:[1,242],70:v,85:237,119:F,120:V,121:I},{60:[1,243],70:v,85:237,119:F,120:V,121:I},{63:[1,244]},{67:[1,245],70:v,85:237,119:F,120:V,121:I},{69:[1,246],70:v,85:237,119:F,120:V,121:I},{31:247,70:v,83:X,84:J,85:185,119:F,120:V,121:I},{32:[1,248],70:v,85:237,119:F,120:V,121:I},{70:v,72:[1,249],74:[1,250],85:237,119:F,120:V,121:I},{70:v,72:[1,252],74:[1,251],85:237,119:F,120:V,121:I},e(Me,[2,58],{19:169,11:Se,43:qe}),e(Me,[2,60],{47:Ht}),e(He,[2,88]),e(He,[2,87]),{65:[1,253],70:v,85:237,119:F,120:V,121:I},e(He,[2,90]),e(Xe,[2,93]),{80:[1,254],82:211,119:tt,122:st},{31:255,70:v,83:X,84:J,85:185,119:F,120:V,121:I},e(Ye,a,{5:256}),{8:Q,9:Z,10:$,12:ee,22:257,43:qe},e(M,[2,117]),e(D,[2,42]),e(D,[2,43]),{31:258,70:v,83:X,84:J,85:185,119:F,120:V,121:I},e(D,[2,46]),{8:Q,9:Z,10:$,12:ee,22:259,43:qe},{46:260,47:h,48:45,50:46,63:x,92:O,105:P,108:G,109:U,112:j,114:z,116:47,117:W,118:K,119:H},{11:Se,19:261},{11:pe,63:fe,87:ge,95:262,108:me,110:263,111:264,112:be,113:Ae,114:ke,115:Ee},{11:pe,63:fe,87:ge,95:273,107:[1,274],108:me,110:263,111:264,112:be,113:Ae,114:ke,115:Ee},{11:pe,63:fe,87:ge,95:275,107:[1,276],108:me,110:263,111:264,112:be,113:Ae,114:ke,115:Ee},{108:[1,277]},{11:pe,63:fe,87:ge,95:278,108:me,110:263,111:264,112:be,113:Ae,114:ke,115:Ee},{47:h,50:279,63:x,92:O,105:P,108:G,109:U,112:j,114:z,116:47,117:W,118:K,119:H},e(R,[2,123]),{83:[1,280]},{83:[1,281],101:[1,282]},e(R,[2,131]),e(R,[2,133],{11:[1,283]}),e(R,[2,134]),e(q,[2,69]),e(xe,[2,100]),e(q,[2,70]),{54:[1,284],70:v,85:237,119:F,120:V,121:I},e(q,[2,77]),e(q,[2,72]),e(q,[2,73]),e(q,[2,74]),{112:[1,285]},e(q,[2,76]),e(q,[2,78]),{69:[1,286],70:v,85:237,119:F,120:V,121:I},e(q,[2,80]),e(q,[2,81]),e(q,[2,83]),e(q,[2,82]),e(q,[2,84]),e([11,47,63,92,105,108,109,112,114,117,118,119],[2,98]),e(He,[2,91]),{32:[1,287],70:v,85:237,119:F,120:V,121:I},{6:13,7:14,8:c,9:f,10:p,11:g,12:b,21:20,23:21,24:22,25:23,26:24,27:25,28:_,33:[1,288],35:S,36:B,37:29,38:T,40:m,42:d,45:33,46:44,47:h,48:45,50:46,63:x,87:N,88:te,89:de,90:ue,91:he,92:O,105:P,108:G,109:U,112:j,114:z,116:47,117:W,118:K,119:H,124:De,125:_e,126:ve,127:Fe,128:Ve},e(Ye,a,{5:289}),{32:[1,290],70:v,85:237,119:F,120:V,121:I},e(D,[2,47]),e(Ie,[2,66]),{46:291,47:h,48:45,50:46,63:x,92:O,105:P,108:G,109:U,112:j,114:z,116:47,117:W,118:K,119:H},e(R,[2,136],{109:Je}),e(qt,[2,145],{111:293,11:pe,63:fe,87:ge,108:me,112:be,113:Ae,114:ke,115:Ee}),e(le,[2,147]),e(le,[2,149]),e(le,[2,150]),e(le,[2,151]),e(le,[2,152]),e(le,[2,153]),e(le,[2,154]),e(le,[2,155]),e(le,[2,156]),e(R,[2,137],{109:Je}),{11:[1,294]},e(R,[2,138],{109:Je}),{11:[1,295]},e(Yt,[2,144]),e(R,[2,120],{109:Je}),e(R,[2,121],{116:122,47:h,63:x,92:O,105:P,108:G,109:U,112:j,114:z,117:W,118:K,119:H}),e(R,[2,125]),e(R,[2,127],{11:[1,296]}),e(R,[2,128]),{101:[1,297]},{54:[1,298]},{65:[1,299]},{69:[1,300]},{8:Q,9:Z,10:$,12:ee,22:301,34:302,43:we},e(D,[2,40]),{6:13,7:14,8:c,9:f,10:p,11:g,12:b,21:20,23:21,24:22,25:23,26:24,27:25,28:_,33:[1,303],35:S,36:B,37:29,38:T,40:m,42:d,45:33,46:44,47:h,48:45,50:46,63:x,87:N,88:te,89:de,90:ue,91:he,92:O,105:P,108:G,109:U,112:j,114:z,116:47,117:W,118:K,119:H,124:De,125:_e,126:ve,127:Fe,128:Ve},{8:Q,9:Z,10:$,12:ee,22:304,34:305,43:we},e(Ie,[2,65]),{11:pe,63:fe,87:ge,108:me,110:306,111:264,112:be,113:Ae,114:ke,115:Ee},e(le,[2,148]),{15:ye,47:Ne,63:Re,92:Oe,104:307,108:Pe,109:Ge,112:Ue,114:je,117:ze,118:We,119:Ke,123:97},{15:ye,47:Ne,63:Re,92:Oe,104:308,108:Pe,109:Ge,112:Ue,114:je,117:ze,118:We,119:Ke,123:97},{101:[1,309]},e(R,[2,135]),e(q,[2,71]),{31:310,70:v,83:X,84:J,85:185,119:F,120:V,121:I},e(q,[2,79]),e(Ye,a,{5:311}),{8:Q,9:Z,10:$,12:ee,22:312,43:qe},e(D,[2,41]),e(D,[2,44]),{8:Q,9:Z,10:$,12:ee,22:313,43:qe},e(qt,[2,146],{111:293,11:pe,63:fe,87:ge,108:me,112:be,113:Ae,114:ke,115:Ee}),e(R,[2,141],{123:181,11:[1,314],15:ye,47:Ne,63:Re,92:Oe,108:Pe,109:Ge,112:Ue,114:je,117:ze,118:We,119:Ke}),e(R,[2,142],{123:181,11:[1,315],15:ye,47:Ne,63:Re,92:Oe,108:Pe,109:Ge,112:Ue,114:je,117:ze,118:We,119:Ke}),e(R,[2,129]),{32:[1,316],70:v,85:237,119:F,120:V,121:I},{6:13,7:14,8:c,9:f,10:p,11:g,12:b,21:20,23:21,24:22,25:23,26:24,27:25,28:_,33:[1,317],35:S,36:B,37:29,38:T,40:m,42:d,45:33,46:44,47:h,48:45,50:46,63:x,87:N,88:te,89:de,90:ue,91:he,92:O,105:P,108:G,109:U,112:j,114:z,116:47,117:W,118:K,119:H,124:De,125:_e,126:ve,127:Fe,128:Ve},e(Ye,a,{5:318}),e(D,[2,45]),{11:pe,63:fe,87:ge,95:319,108:me,110:263,111:264,112:be,113:Ae,114:ke,115:Ee},{11:pe,63:fe,87:ge,95:320,108:me,110:263,111:264,112:be,113:Ae,114:ke,115:Ee},e(q,[2,75]),e(D,[2,38]),{6:13,7:14,8:c,9:f,10:p,11:g,12:b,21:20,23:21,24:22,25:23,26:24,27:25,28:_,33:[1,321],35:S,36:B,37:29,38:T,40:m,42:d,45:33,46:44,47:h,48:45,50:46,63:x,87:N,88:te,89:de,90:ue,91:he,92:O,105:P,108:G,109:U,112:j,114:z,116:47,117:W,118:K,119:H,124:De,125:_e,126:ve,127:Fe,128:Ve},e(R,[2,139],{109:Je}),e(R,[2,140],{109:Je}),e(D,[2,39])],defaultActions:{},parseError:k(function(A,E){if(E.recoverable)this.trace(A);else{var C=new Error(A);throw C.hash=E,C}},"parseError"),parse:k(function(A){var E=this,C=[0],o=[],w=[null],t=[],L=this.table,s="",y=0,Xt=0,p1=2,Jt=1,f1=t.slice.call(arguments,1),Y=Object.create(this.lexer),Le={yy:{}};for(var Lt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Lt)&&(Le.yy[Lt]=this.yy[Lt]);Y.setInput(A,Le.yy),Le.yy.lexer=Y,Le.yy.parser=this,typeof Y.yylloc>"u"&&(Y.yylloc={});var Bt=Y.yylloc;t.push(Bt);var g1=Y.options&&Y.options.ranges;typeof Le.yy.parseError=="function"?this.parseError=Le.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function m1(re){C.length=C.length-2*re,w.length=w.length-re,t.length=t.length-re}k(m1,"popStack");function Qt(){var re;return re=o.pop()||Y.lex()||Jt,typeof re!="number"&&(re instanceof Array&&(o=re,re=o.pop()),re=E.symbols_[re]||re),re}k(Qt,"lex");for(var se,Be,oe,Mt,Qe={},vt,Ce,Zt,Ft;;){if(Be=C[C.length-1],this.defaultActions[Be]?oe=this.defaultActions[Be]:((se===null||typeof se>"u")&&(se=Qt()),oe=L[Be]&&L[Be][se]),typeof oe>"u"||!oe.length||!oe[0]){var wt="";Ft=[];for(vt in L[Be])this.terminals_[vt]&&vt>p1&&Ft.push("'"+this.terminals_[vt]+"'");Y.showPosition?wt="Parse error on line "+(y+1)+`:
23
+ `+Y.showPosition()+`
24
+ Expecting `+Ft.join(", ")+", got '"+(this.terminals_[se]||se)+"'":wt="Parse error on line "+(y+1)+": Unexpected "+(se==Jt?"end of input":"'"+(this.terminals_[se]||se)+"'"),this.parseError(wt,{text:Y.match,token:this.terminals_[se]||se,line:Y.yylineno,loc:Bt,expected:Ft})}if(oe[0]instanceof Array&&oe.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Be+", token: "+se);switch(oe[0]){case 1:C.push(se),w.push(Y.yytext),t.push(Y.yylloc),C.push(oe[1]),se=null,Xt=Y.yyleng,s=Y.yytext,y=Y.yylineno,Bt=Y.yylloc;break;case 2:if(Ce=this.productions_[oe[1]][1],Qe.$=w[w.length-Ce],Qe._$={first_line:t[t.length-(Ce||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(Ce||1)].first_column,last_column:t[t.length-1].last_column},g1&&(Qe._$.range=[t[t.length-(Ce||1)].range[0],t[t.length-1].range[1]]),Mt=this.performAction.apply(Qe,[s,Xt,y,Le.yy,oe[1],w,t].concat(f1)),typeof Mt<"u")return Mt;Ce&&(C=C.slice(0,-1*Ce*2),w=w.slice(0,-1*Ce),t=t.slice(0,-1*Ce)),C.push(this.productions_[oe[1]][0]),w.push(Qe.$),t.push(Qe._$),Zt=L[C[C.length-2]][C[C.length-1]],C.push(Zt);break;case 3:return!0}}return!0},"parse")},h1=(function(){var Te={EOF:1,parseError:k(function(E,C){if(this.yy.parser)this.yy.parser.parseError(E,C);else throw new Error(E)},"parseError"),setInput:k(function(A,E){return this.yy=E||this.yy||{},this._input=A,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:k(function(){var A=this._input[0];this.yytext+=A,this.yyleng++,this.offset++,this.match+=A,this.matched+=A;var E=A.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),A},"input"),unput:k(function(A){var E=A.length,C=A.split(/(?:\r\n?|\n)/g);this._input=A+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),C.length-1&&(this.yylineno-=C.length-1);var w=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:C?(C.length===o.length?this.yylloc.first_column:0)+o[o.length-C.length].length-C[0].length:this.yylloc.first_column-E},this.options.ranges&&(this.yylloc.range=[w[0],w[0]+this.yyleng-E]),this.yyleng=this.yytext.length,this},"unput"),more:k(function(){return this._more=!0,this},"more"),reject:k(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).
25
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:k(function(A){this.unput(this.match.slice(A))},"less"),pastInput:k(function(){var A=this.matched.substr(0,this.matched.length-this.match.length);return(A.length>20?"...":"")+A.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:k(function(){var A=this.match;return A.length<20&&(A+=this._input.substr(0,20-A.length)),(A.substr(0,20)+(A.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:k(function(){var A=this.pastInput(),E=new Array(A.length+1).join("-");return A+this.upcomingInput()+`
26
+ `+E+"^"},"showPosition"),test_match:k(function(A,E){var C,o,w;if(this.options.backtrack_lexer&&(w={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&&(w.yylloc.range=this.yylloc.range.slice(0))),o=A[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+A[0].length},this.yytext+=A[0],this.match+=A[0],this.matches=A,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(A[0].length),this.matched+=A[0],C=this.performAction.call(this,this.yy,this,E,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),C)return C;if(this._backtrack){for(var t in w)this[t]=w[t];return!1}return!1},"test_match"),next:k(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var A,E,C,o;this._more||(this.yytext="",this.match="");for(var w=this._currentRules(),t=0;t<w.length;t++)if(C=this._input.match(this.rules[w[t]]),C&&(!E||C[0].length>E[0].length)){if(E=C,o=t,this.options.backtrack_lexer){if(A=this.test_match(C,w[t]),A!==!1)return A;if(this._backtrack){E=!1;continue}else return!1}else if(!this.options.flex)break}return E?(A=this.test_match(E,w[o]),A!==!1?A:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
27
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:k(function(){var E=this.next();return E||this.lex()},"lex"),begin:k(function(E){this.conditionStack.push(E)},"begin"),popState:k(function(){var E=this.conditionStack.length-1;return E>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:k(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:k(function(E){return E=this.conditionStack.length-1-Math.abs(E||0),E>=0?this.conditionStack[E]:"INITIAL"},"topState"),pushState:k(function(E){this.begin(E)},"pushState"),stateStackSize:k(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:k(function(E,C,o,w){switch(o){case 0:return this.begin("acc_title"),38;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),40;case 3:return this.popState(),"acc_descr_value";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"),C.yytext="",43;case 8:return this.pushState("shapeDataStr"),43;case 9:return this.popState(),43;case 10:const t=/\n\s*/g;return C.yytext=C.yytext.replace(t,"<br/>"),43;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;case 36:return E.lex.firstGraph()?(this.begin("dir"),13):112;case 37:return 28;case 38:return 36;case 39:return 35;case 40:return 33;case 41:return 101;case 42:return 101;case 43:return 101;case 44:return 101;case 45:return this.popState(),14;case 46:return this.popState(),15;case 47:return this.popState(),15;case 48:return this.popState(),15;case 49:return this.popState(),15;case 50:return this.popState(),15;case 51:return this.popState(),15;case 52:return this.popState(),15;case 53:return this.popState(),15;case 54:return this.popState(),15;case 55:return this.popState(),15;case 56:return 124;case 57:return 125;case 58:return 126;case 59:return 127;case 60:return 128;case 61:return 81;case 62:return 108;case 63:return 114;case 64:return 49;case 65:return 63;case 66:return 47;case 67:return 9;case 68:return 109;case 69:return 118;case 70:return this.popState(),80;case 71:return this.pushState("edgeText"),78;case 72:return 122;case 73:return 80;case 74:break;case 75:return this.popState(),56;case 76:return"TEXT";case 77:return this.pushState("ellipseText"),55;case 78:return this.popState(),58;case 79:return this.pushState("text"),57;case 80:return this.popState(),60;case 81:return this.pushState("text"),59;case 82:return 61;case 83:return this.pushState("text"),70;case 84:return this.popState(),67;case 85:return this.pushState("text"),66;case 86:return this.popState(),52;case 87:return this.pushState("text"),51;case 88:break;case 89:return this.popState(),72;case 90:return this.popState(),74;case 91:return 120;case 92:return this.pushState("trapText"),71;case 93:return this.pushState("trapText"),73;case 94:return 121;case 95:return 70;case 96:return 93;case 97:return"SEP";case 98:return 92;case 99:return 118;case 100:return 114;case 101:return 47;case 102:return 8;case 103:return 112;case 104:return 117;case 105:return 119;case 106:return this.popState(),65;case 107:return this.pushState("text"),65;case 108:return this.popState(),54;case 109:return this.pushState("text"),53;case 110:return this.popState(),32;case 111:return this.pushState("text"),30;case 112:return this.popState(),69;case 113:return this.pushState("text"),68;case 114:break;case 115:return"TEXT";case 116:return"QUOTE";case 117:return 10;case 118:return 11;case 119: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)/,/^(?:agentflow(?=[\s;]|$))/,/^(?: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,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},shapeData:{rules:[8,11,12,21,24,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},callbackargs:{rules:[17,18,21,24,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},callbackname:{rules:[14,15,16,21,24,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},href:{rules:[21,24,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},click:{rules:[21,24,33,34,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},edgeText:{rules:[21,24,70,72,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},trapText:{rules:[21,24,77,79,81,85,87,88,89,90,91,92,93,107,109,111,113],inclusive:!1},ellipseText:{rules:[21,24,74,75,76,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},text:{rules:[21,24,77,78,79,80,81,84,85,86,87,92,93,106,107,108,109,110,111,112,113,114,115],inclusive:!1},vertex:{rules:[21,24,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},dir:{rules:[21,24,45,46,47,48,49,50,51,52,53,54,55,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},acc_descr:{rules:[3,21,24,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},acc_title:{rules:[1,21,24,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},md_string:{rules:[19,20,21,24,77,79,81,85,87,92,93,107,109,111,113],inclusive:!1},string:{rules:[21,22,23,24,77,79,81,85,87,92,93,107,109,111,113],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,44,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,73,77,79,81,82,83,85,87,92,93,94,95,96,97,98,99,100,101,102,103,104,105,107,109,111,113,116,117,118,119],inclusive:!0}}};return Te})();It.lexer=h1;function _t(){this.yy={}}return k(_t,"Parser"),_t.prototype=It,It.Parser=_t,new _t})();Pt.parser=Pt;var c1=Pt,d1=Object.assign({},c1);d1.parse=e=>{const i=e.replace(/}[^\S\n]*\n/g,`}
28
+ `);return c1.parse(i)};var $1=d1,es=k(e=>{const{theme:i,bkgColorArray:n,borderColorArray:r}=e;if(!y1(i,r))return"";const u=N1(e.look),l=R1(n),a=O1(e.THEME_COLOR_LIMIT,r),c=k(g=>r[g%r.length],"border"),f=k(g=>l?`fill: ${n[g%n.length]};`:"","fill");let p="";for(const g of H1){const b=Vt.get(g),_=`[data-look="${u}"].node.${r1(g)}`;p+=`
29
+
30
+ ${_} rect,
31
+ ${_} path,
32
+ ${_} polygon {
33
+ stroke: ${c(b)};
34
+ ${f(b)}
35
+ }
36
+ `}for(let g=0;g<a1(a);g++){const b=o1(g,a),_=`[data-look="${u}"][data-color-id="color-${b}"].cluster`,S=`[data-look="${u}"][data-color-id="color-${b}"].node`,B=k(T=>`${_} ${T}, ${S} ${T}`,"rule");p+=`
37
+
38
+ ${B("rect")},
39
+ ${B("path")} {
40
+ stroke: ${c(b)};
41
+ ${f(b)}
42
+ }
43
+ `}return p},"genColor"),ts=k((e,i)=>{const n=G1,r=n(e,"r"),u=n(e,"g"),l=n(e,"b");return P1(r,u,l,i)},"fade"),ss=k(e=>`${es(e)}
44
+ .label {
45
+ font-family: ${e.fontFamily};
46
+ color: ${e.nodeTextColor||e.textColor};
47
+ }
48
+ .cluster-label text {
49
+ fill: ${e.titleColor};
50
+ }
51
+ .cluster-label span {
52
+ color: ${e.titleColor};
53
+ }
54
+ .cluster-label span p {
55
+ background-color: transparent;
56
+ }
57
+
58
+ .label text,span {
59
+ fill: ${e.nodeTextColor||e.textColor};
60
+ color: ${e.nodeTextColor||e.textColor};
61
+ }
62
+
63
+ .node rect,
64
+ .node circle,
65
+ .node ellipse,
66
+ .node polygon,
67
+ .node path {
68
+ fill: ${e.mainBkg};
69
+ stroke: ${e.nodeBorder};
70
+ stroke-width: ${e.strokeWidth??1}px;
71
+ }
72
+ .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label {
73
+ text-anchor: middle;
74
+ }
75
+ .node .katex path {
76
+ fill: ${e.nodeTextColor||e.textColor};
77
+ stroke: ${e.nodeTextColor||e.textColor};
78
+ stroke-width: 1px;
79
+ }
80
+
81
+ .rough-node .label,.node .label, .image-shape .label, .icon-shape .label {
82
+ text-align: center;
83
+ }
84
+ .node.clickable {
85
+ cursor: pointer;
86
+ }
87
+
88
+
89
+ .root .anchor path {
90
+ fill: ${e.lineColor} !important;
91
+ stroke-width: 0;
92
+ stroke: ${e.lineColor};
93
+ }
94
+
95
+ .arrowheadPath {
96
+ fill: ${e.arrowheadColor};
97
+ }
98
+
99
+ .edgePaths .path {
100
+ stroke: ${e.lineColor};
101
+ stroke-width: ${e.strokeWidth??2}px;
102
+ }
103
+
104
+ .flowchart-link {
105
+ stroke: ${e.lineColor};
106
+ fill: none;
107
+ }
108
+
109
+ .edgeLabel {
110
+ background-color: ${e.edgeLabelBackground};
111
+ p {
112
+ background-color: ${e.edgeLabelBackground};
113
+ }
114
+ rect {
115
+ opacity: 0.5;
116
+ background-color: ${e.edgeLabelBackground};
117
+ fill: ${e.edgeLabelBackground};
118
+ }
119
+ text-align: center;
120
+ }
121
+
122
+ /* For html labels only */
123
+ .labelBkg {
124
+ background-color: ${ts(e.edgeLabelBackground,.5)};
125
+ }
126
+
127
+ .cluster rect {
128
+ fill: ${e.clusterBkg};
129
+ stroke: ${e.clusterBorder};
130
+ stroke-width: 1px;
131
+ }
132
+
133
+ .flow-cluster rect {
134
+ fill: none;
135
+ stroke: ${e.clusterBorder};
136
+ stroke-width: 0.75px;
137
+ }
138
+
139
+ .node .collapsed-indicator {
140
+ fill: ${e.nodeBorder};
141
+ stroke: none;
142
+ stroke-width: 0;
143
+ opacity: 0.5;
144
+ }
145
+
146
+ .node .collapsed-separator {
147
+ stroke-width: 0.75px;
148
+ }
149
+
150
+ .cluster text {
151
+ fill: ${e.titleColor};
152
+ }
153
+
154
+ .cluster span {
155
+ color: ${e.titleColor};
156
+ }
157
+ /* .cluster div {
158
+ color: ${e.titleColor};
159
+ } */
160
+
161
+ div.mermaidTooltip {
162
+ position: absolute;
163
+ text-align: center;
164
+ max-width: 200px;
165
+ padding: 2px;
166
+ font-family: ${e.fontFamily};
167
+ font-size: 12px;
168
+ background: ${e.tertiaryColor};
169
+ border: 1px solid ${e.border2};
170
+ border-radius: 2px;
171
+ pointer-events: none;
172
+ z-index: 100;
173
+ }
174
+
175
+ .agentflowTitleText {
176
+ text-anchor: middle;
177
+ font-size: 18px;
178
+ fill: ${e.textColor};
179
+ }
180
+
181
+ rect.text {
182
+ fill: none;
183
+ stroke-width: 0;
184
+ }
185
+
186
+ .icon-shape, .image-shape {
187
+ background-color: ${e.edgeLabelBackground};
188
+ p {
189
+ background-color: ${e.edgeLabelBackground};
190
+ padding: 2px;
191
+ }
192
+ .label rect {
193
+ opacity: 0.5;
194
+ background-color: ${e.edgeLabelBackground};
195
+ fill: ${e.edgeLabelBackground};
196
+ }
197
+ text-align: center;
198
+ }
199
+ ${A1()}
200
+ `,"getStyles"),is=ss,hs={parser:$1,get db(){return new X1},renderer:Z1,styles:is,init:k(e=>{e.agentflow??={},e.layout&&$t({layout:e.layout}),e.flowchart??={},e.flowchart.arrowMarkerAbsolute=e.arrowMarkerAbsolute,$t({flowchart:{arrowMarkerAbsolute:e.arrowMarkerAbsolute}})},"init")};export{hs as diagram};
@@ -0,0 +1,30 @@
1
+ import{p as X}from"./chunk-JWPE2WC7-BrdvVNVo.js";import{I as z}from"./chunk-2Q5K7J3B-Dvh3qOmo.js";import{v as O,b as G,s as P,x as Y,g as F,a as U,_ as g,R as N,l as A,U as Z,d as j,P as E,C as q,j as J,ag as K,S as Q,ah as ee}from"./mermaid.core-sGgCbv5y.js";import{p as te}from"./cynefin-EF2NZ3EQ-CwawUbjJ.js";import"./index-DFPOGLS4.js";import"./vendor-BKfNgqAm.js";var L=/[─━│┃└┗├┣]/,D=/[└┗├┣]/,ne=/[─━]/,T=/^[\s│┃]+$/,V=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,$=/^\s*%%/,re=" ";function _(n){return n.some(t=>L.test(t))}g(_,"isBoxDrawingFormat");function S(n){for(const t of n){const e=D.exec(t);if(e?.index&&e.index>0)return e.index}return 4}g(S,"inferSegmentWidth");function M(n,t){return n.replace(/\bline\s+(\d+)\b/gi,(e,r)=>{const s=parseInt(r,10),i=t.get(s);return i?`line ${i}`:e})}g(M,"remapErrorLines");function R(n){const t=n.split(`
2
+ `),e=new Map;let r=-1;for(const[p,c]of t.entries())if(c.trim()==="treeView-beta"){r=p;break}if(r===-1)return{text:n,lineMap:e};const s=[];for(let p=r+1;p<t.length;p++){const c=t[p];c.trim()===""||$.test(c)||V.test(c)||T.test(c)||s.push(c.replace(/\t/g," "))}if(!_(s))return{text:n,lineMap:e};const i=S(s),o=[];let a=0;for(let p=0;p<=r;p++)o.push(t[p]),a++,e.set(a,p+1);for(let p=r+1;p<t.length;p++){const c=t[p],d=c.trim(),h=p+1;if(d===""){o.push(c),a++,e.set(a,h);continue}if($.test(c)){o.push(c),a++,e.set(a,h);continue}if(V.test(c)){o.push(c),a++,e.set(a,h);continue}if(T.test(c))continue;const l=c.replace(/\t/g," "),w=D.exec(l);if(w?.index!==void 0){const f=w.index,m=Math.round(f/i)+1;let u=f+1;for(;u<l.length&&ne.test(l[u]);)u++;for(;u<l.length&&l[u]===" ";)u++;const v=l.slice(u).trimEnd();if(!v)throw new Error(`Line ${h}: Empty node — expected a filename or directory name after the box-drawing prefix`);const W=re.repeat(m);o.push(W+v),a++,e.set(a,h)}else{if(/^[\s─━│┃└┗├┣]+$/.test(l))continue;if(L.test(l))o.push(c),a++,e.set(a,h);else{if(/^\s+/.test(l))throw new Error(`Line ${h}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`);o.push(c),a++,e.set(a,h)}}}return{text:o.join(`
3
+ `),lineMap:e}}g(R,"preprocessBoxDrawing");var x=new z(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),ie=g(()=>{x.reset(),q()},"clear"),oe=g(()=>x.records.stack[0],"getRoot"),se=g(()=>x.records.cnt,"getCount"),ae=Q.treeView,ce=g(()=>N(ae,E().treeView),"getConfig"),le=g((n,t,e,r,s,i)=>{for(;n<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();const o={id:x.records.cnt++,level:n,name:t,nodeType:e,icon:s,cssClass:r,description:i,children:[]};x.records.stack[x.records.stack.length-1].children.push(o),x.records.stack.push(o)},"addNode"),de={clear:ie,addNode:le,getRoot:oe,getCount:se,getConfig:ce,getAccTitle:U,getAccDescription:F,getDiagramTitle:Y,setAccDescription:P,setAccTitle:G,setDiagramTitle:O},C=de,he=g(n=>{X(n,C);for(const t of n.nodes){const e=typeof t.indent=="number"?t.indent:0;let r=t.name;const s=r.endsWith("/");s&&(r=r.slice(0,-1));const i=s?"directory":"file",o=t.classAnnotation||void 0,a=t.iconAnnotation,p=a!==void 0?a||"none":void 0,c=t.descAnnotation||void 0,d=c?J(c,E()):void 0;C.addNode(e,r,i,o,p,d)}},"populate"),pe={parse:g(async n=>{const{text:t,lineMap:e}=R(n);try{const r=await te("treeView",t);A.debug(r),he(r)}catch(r){throw e.size>0&&r instanceof Error&&(r.message=M(r.message,e)),r}},"parse")},b={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:'<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'},file:{body:'<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'}}};function H(n,t){const e=t?.filenameIcons?.[n];if(e)return e;const r=n.lastIndexOf(".");if(r>0){const s=n.substring(r).toLowerCase(),i=t?.extensionIcons;return i?.[s]??i?.[s.slice(1)]}}g(H,"detectIcon");function I(n,t){return n.includes(":")?n:n in b.icons||!t?`${b.prefix}:${n}`:`${t}:${n}`}g(I,"qualifyIcon");function B(n,t){if(n.icon!=="none"){if(n.icon)return I(n.icon,t.defaultIconPack);if(t.showIcons){if(n.nodeType==="file"){const e=H(n.name,t);if(e==="none")return;if(e)return I(e,t.defaultIconPack)}return`${b.prefix}:${n.nodeType==="directory"?"folder":"file"}`}}}g(B,"getNodeIcon");ee([{name:b.prefix,icons:b}]);var y=14,ge=4,fe=16,ue=g(async(n,t)=>{const e=[],r=g(i=>{const o=B(i,t);o&&e.push({icon:o,node:i}),i.children.forEach(r)},"collect");r(n);const s=await Promise.all(e.map(async({icon:i,node:o})=>({id:o.id,svg:await K(i,{height:y,width:y})})));return new Map(s.map(({id:i,svg:o})=>[i,o]))},"resolveNodeIcons"),we=g((n,t,e,r,s,i)=>{const o=r.append("g");let a="treeView-node-label";e.nodeType==="directory"&&(a+=" treeView-node-dir"),e.cssClass&&(a+=` ${e.cssClass}`);const p=y+ge,c=B(e,s),d=c!==void 0;c&&o.append("g").attr("class","treeView-node-icon").attr("transform",`translate(${n+s.paddingX}, ${t+s.paddingY})`).html(i.get(e.id)??"");const h=o.append("text").text(e.name).attr("dominant-baseline","middle").attr("class",a),{height:l,width:w}=h.node().getBBox(),f=l+s.paddingY*2,m=n+s.paddingX+(d?p:0);h.attr("x",m),h.attr("y",t+f/2);const u=m+w,v=w+s.paddingX*2+(d?p:0);return e.BBox={x:n,y:t,width:v,height:f},e.cssClass?.split(/\s+/).includes("highlight")&&o.insert("rect",":first-child").attr("x",n).attr("y",t+1).attr("width",0).attr("height",f-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:e,nodeGroup:o,labelRightEdge:u,centerY:t+f/2}},"positionLabel"),k=g((n,t,e,r,s,i)=>n.append("line").attr("x1",t).attr("y1",e).attr("x2",r).attr("y2",s).attr("stroke-width",i).attr("class","treeView-node-line"),"positionLine"),me=g((n,t,e,r)=>{let s=0,i=0;const o=[],a=g((d,h,l,w)=>{const f=w*(l.rowIndent+l.paddingX),m=we(f,s,h,d,l,r);o.push(m);const{height:u,width:v}=h.BBox;k(d,f-l.rowIndent,s+u/2,f,s+u/2,l.lineThickness),i=Math.max(i,f+v),s+=u},"drawNode"),p=g((d,h=0)=>{a(n,d,e,h),d.children.forEach(m=>{p(m,h+1)});const{x:l,y:w,height:f}=d.BBox;if(d.children.length){const{y:m,height:u}=d.children[d.children.length-1].BBox;k(n,l+e.paddingX,w+f,l+e.paddingX,m+u/2+e.lineThickness/2,e.lineThickness)}},"processNode");p(t);const c=o.filter(d=>d.node.description);if(c.length>0){const h=Math.max(...o.map(l=>l.labelRightEdge))+fe;for(const l of c){const f=l.nodeGroup.append("text").text(l.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",h).attr("y",l.centerY).node().getBBox();i=Math.max(i,h+f.width+e.paddingX)}}for(const d of o)if(d.node.cssClass?.split(/\s+/).includes("highlight")){const h=d.nodeGroup.select(".treeView-highlight-bg");if(!h.empty()){const l=i-d.node.BBox.x+8;h.attr("width",l),i=Math.max(i,d.node.BBox.x+l+2)}}return{totalHeight:s,totalWidth:i}},"drawTree"),xe=g(async(n,t,e,r)=>{A.debug(`Rendering treeView diagram
4
+ `+n);const s=r.db,i=s.getRoot(),o=s.getConfig(),a=Z(t),p=a.append("g");p.attr("class","tree-view");const c=await ue(i,o),{totalHeight:d,totalWidth:h}=me(p,i,o,c);a.attr("viewBox",`-${o.lineThickness/2} 0 ${h} ${d}`),j(a,d,h,o.useMaxWidth)},"draw"),ve={draw:xe},be=ve,Ce={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},Ie=g(({treeView:n})=>{const{labelFontSize:t,labelColor:e,lineColor:r,iconColor:s,descriptionColor:i,highlightBg:o,highlightStroke:a}=N(Ce,n);return`
5
+ .treeView-node-label {
6
+ font-size: ${t};
7
+ fill: ${e};
8
+ white-space: pre;
9
+ }
10
+ .treeView-node-dir {
11
+ font-weight: bold;
12
+ }
13
+ .treeView-node-line {
14
+ stroke: ${r};
15
+ }
16
+ .treeView-node-icon {
17
+ color: ${s};
18
+ }
19
+ .treeView-node-description {
20
+ font-size: ${t};
21
+ fill: ${i};
22
+ font-style: italic;
23
+ white-space: pre;
24
+ }
25
+ .treeView-highlight-bg {
26
+ fill: ${o};
27
+ stroke: ${a};
28
+ stroke-width: 1;
29
+ }
30
+ `},"styles"),ye=Ie,Ae={db:C,renderer:be,parser:pe,styles:ye};export{Ae as diagram};
@@ -0,0 +1,24 @@
1
+ import{p as T}from"./chunk-JWPE2WC7-BrdvVNVo.js";import{_ as f,R as y,U as P,d as z,l as B,b as E,a as F,v as A,x as W,g as _,s as N,P as L,S as M,C as Y}from"./mermaid.core-sGgCbv5y.js";import{p as I}from"./cynefin-EF2NZ3EQ-CwawUbjJ.js";import"./index-DFPOGLS4.js";import"./vendor-BKfNgqAm.js";var O=M.packet,C=class{constructor(){this.packet=[],this.setAccTitle=E,this.getAccTitle=F,this.setDiagramTitle=A,this.getDiagramTitle=W,this.getAccDescription=_,this.setAccDescription=N}static{f(this,"PacketDB")}getConfig(){const t=y({...O,...L().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){Y(),this.packet=[]}},U=1e4,j=f((t,e)=>{T(t,e);let r=-1,s=[],i=1;const{bitsPerRow:l}=e.getConfig();for(let{start:a,end:o,bits:d,label:g}of t.blocks){if(a!==void 0&&o!==void 0&&o<a)throw new Error(`Packet block ${a} - ${o} is invalid. End must be greater than start.`);if(a??=r+1,a!==r+1)throw new Error(`Packet block ${a} - ${o??a} is not contiguous. It should start from ${r+1}.`);if(d===0)throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);for(o??=a+(d??1)-1,d??=o-a+1,r=o,B.debug(`Packet block ${a} - ${r} with label ${g}`);s.length<=l+1&&e.getPacket().length<U;){const[c,p]=G({start:a,end:o,bits:d,label:g},i,l);if(s.push(c),c.end+1===i*l&&(e.pushWord(s),s=[],i++),!p)break;({start:a,end:o,bits:d,label:g}=p)}}e.pushWord(s)},"populate"),G=f((t,e,r)=>{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*r)return[t,void 0];const s=e*r-1,i=e*r;return[{start:t.start,end:s,label:t.label,bits:s-t.start},{start:i,end:t.end,label:t.label,bits:t.end-i}]},"getNextFittingBlock"),$={parser:{yy:void 0},parse:f(async t=>{const e=await I("packet",t),r=$.parser?.yy;if(!(r instanceof C))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");B.debug(e),j(e,r)},"parse")},H=f((t,e,r,s)=>{const i=s.db,l=i.getConfig(),{rowHeight:a,paddingY:o,bitWidth:d,bitsPerRow:g}=l,c=i.getPacket(),p=i.getDiagramTitle(),b=a+o,n=b*(c.length+1)-(p?0:a),h=d*g+2,k=P(e);k.attr("viewBox",`0 0 ${h} ${n}`),z(k,n,h,l.useMaxWidth);for(const[v,u]of c.entries())K(k,u,v,l);k.append("text").text(p).attr("x",h/2).attr("y",n-b/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),K=f((t,e,r,{rowHeight:s,paddingX:i,paddingY:l,bitWidth:a,bitsPerRow:o,showBits:d,bitOrder:g})=>{const c=t.append("g"),p=r*(s+l)+l,b=g==="descending";for(const n of e){const h=n.end-n.start+1,k=n.start%o,u=(b?o-k-h:k)*a+1,m=h*a-i;if(c.append("rect").attr("x",u).attr("y",p).attr("width",m).attr("height",s).attr("class","packetBlock"),c.append("text").attr("x",u+m/2).attr("y",p+s/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(n.label),!d)continue;const[S,D]=b?[n.end,n.start]:[n.start,n.end],w=h===1,x=p-2;c.append("text").attr("x",u+(w?m/2:0)).attr("y",x).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",w?"middle":"start").text(S),w||c.append("text").attr("x",u+m).attr("y",x).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(D)}},"drawWord"),R={draw:H},X={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},q=f(({packet:t}={})=>{const e=y(X,t);return`
2
+ .packetByte {
3
+ font-size: ${e.byteFontSize};
4
+ }
5
+ .packetByte.start {
6
+ fill: ${e.startByteColor};
7
+ }
8
+ .packetByte.end {
9
+ fill: ${e.endByteColor};
10
+ }
11
+ .packetLabel {
12
+ fill: ${e.labelColor};
13
+ font-size: ${e.labelFontSize};
14
+ }
15
+ .packetTitle {
16
+ fill: ${e.titleColor};
17
+ font-size: ${e.titleFontSize};
18
+ }
19
+ .packetBlock {
20
+ stroke: ${e.blockStrokeColor};
21
+ stroke-width: ${e.blockStrokeWidth};
22
+ fill: ${e.blockFillColor};
23
+ }
24
+ `},"styles"),et={parser:$,get db(){return new C},renderer:R,styles:q};export{et as diagram};
@@ -0,0 +1,3 @@
1
+ import{p as re}from"./chunk-JWPE2WC7-BrdvVNVo.js";import{x as oe,v as se,s as de,g as le,a as ce,b as me,_ as o,l as g,c as $,k as ue,Q as xe,C as fe,R as ge,P as B,S as he,j as P,w as S,ai as pe}from"./mermaid.core-sGgCbv5y.js";import{p as be,i as ve}from"./cynefin-EF2NZ3EQ-CwawUbjJ.js";import"./index-DFPOGLS4.js";import"./vendor-BKfNgqAm.js";var D="position frame",C="frame positioned",k="position relation",N="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){T(),fe()},"clear");function T(){w={}}o(T,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...B().eventmodeling}),"getConfig"),w={};function I(){let e=Fe;const{ast:n}=w,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=G(i,n.dataEntities,t);e=v(e,{$kind:D,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:k,index:a,frame:i,sourceFrame:l})})):e=v(e,{$kind:k,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(I,"getState");function O(e){w.ast=void 0;const n=new Set;for(const t of e.frames){if(n.has(t.name)){const i=t.$cstNode?.range.start.line,a=i===void 0?"":` on line ${i+1}`;throw new Error(`Duplicate event modeling frame ID "${t.name}"${a}`)}n.add(t.name)}w.ast=e}o(O,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function W(e){const n=e.split(".");if(n.length===2)return n[0]}o(W,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&a<t}).map(i=>Number.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=W(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function L(e){const{themeVariables:n}=B();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(L,"calculateEntityVisualProps");function G(e,n,t){const i=B(),a=P(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"};let c=`<b>${S(a,t.textMaxWidth,d)}</b>`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=P(r,i),r=S(r,t.textMaxWidth,d),r=r.replaceAll(" ","&nbsp;")),e.dataReference){const p=n.find(y=>y.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{
2
+ `)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=P(r,i),r=S(r,t.textMaxWidth,d),r=r.replaceAll(" ","&nbsp;"),r+="<br/>")}const m=r!==void 0;m&&(c+=`<br/><br/><code style="text-align: left; display: block;max-width:${t.textMaxWidth}px">${r}</code>`);const x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},u=pe(c,x),h=m?u.width/3:u.width,f={content:c,width:h,height:u.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,f),f}o(G,"calculateTextProps");function V(e,n){const t=n,i=L(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:C,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}o(V,"decidePositionFrame");function X(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(X,"calculateX");function j(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(j,"calculateMaxRight");function A(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o(A,"sortedSwimlanesArray");function Y(e,n){const t=n,i=_(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=X(a,d,r),m=c+l.width+s.boxPadding,x=j(Object.values(e.swimlanes),m);a.r=c+l.width,a.maxHeight=Math.max(a.maxHeight,l.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:l,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=A(h.swimlanes);f.length>0&&(f[0].y=0);for(let p=1;p<f.length;p++){const y=f[p],R=f[p-1];y.y=R.y+R.height+s.swimlaneGap}return h}o(Y,"evolveFramePositioned");function z(e,n){return e===0&&n.sourceFrames.length===0}o(z,"isFirstFrame");function K(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}o(K,"hasSourceFrame");function F(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(F,"findBoxByFrame");function Q(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}o(Q,"findBoxByLineIndex");function q(e,n){const t=n;if(z(t.index,t.frame))return[];const i=F(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;if(t.sourceFrame)a=F(e.boxes,t.sourceFrame);else{if(ve(t.frame))return[];a=Q(e.boxes,i.swimlane.index,t.index-1)}return a===void 0?[]:[{$kind:N,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(q,"decidePositionRelation");function J(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(J,"evolveRelationPositioned");var Me={[D]:V,[k]:q},Be={[C]:Y,[N]:J};function Z(e,n){const t=Me[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(Z,"decide");function ee(e,n){const t=n.reduce((i,a)=>{const r=Be[a.$kind];return r==null?i:r(i,a)},e);return g.debug("evolve events",{state:e,newState:t,events:n}),t}o(ee,"evolve");function v(e,n){const t=Z(e,n);return ee(e,t)}o(v,"dispatch");var M={getConfig:ke,preserveCommentsWhenParsing:!0,setOptions:we,getOptions:ye,clear:Pe,setAccTitle:me,getAccTitle:ce,getAccDescription:le,setAccDescription:de,setDiagramTitle:se,getDiagramTitle:oe,setAst:O,getDiagramProps:E,getState:I},Ee={parse:o(async e=>{const n=await be("eventmodeling",e);g.debug(n),M.setAst(n),re(n,M)},"parse")},Ae=$(),Re=Ae?.eventmodeling;function te(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}o(te,"renderD3Box");function ne(e,n){return e>n}o(ne,"dirUpwards");function ie(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,d=a.targetBox.swimlane.y+n.swimlanePadding,l=ne(r,d),c=a.sourceBox.x+a.sourceBox.dimension.width*2/3,m=a.targetBox.x+a.targetBox.dimension.width/3;let x,u;g.debug(`rendering relation up=${l} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),l?(x=r,u=d+a.targetBox.dimension.height):(x=r+a.sourceBox.dimension.height,u=d);const h=i.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}o(ie,"renderD3Relation");function ae(e,n,t,i){return a=>{const r=e.append("g").attr("class","em-swimlane"),d=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",a.height).attr("fill",d).attr("stroke",l),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}o(ae,"renderD3Swimlane");var $e=o(function(e,n,t,i){if(g.debug("in eventmodeling renderer",e+`
3
+ `,"id:",n,t),!Re)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:d}=$(),l=ue(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(ae(l,m.maxR,c,r)),m.boxes.forEach(te(l,c)),m.relations.forEach(ie(l,c,x,r)),l.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),xe(void 0,l,d?.padding??30,d?.useMaxWidth)},"draw"),De={draw:$e},Ce=o(e=>"","getStyles"),Ne=Ce,Ue={parser:Ee,db:M,renderer:De,styles:Ne};export{Ue as diagram};
@@ -0,0 +1,24 @@
1
+ import{s as ve}from"./chunk-CNRTWJTD-TKBKxZLU.js";import{p as xe}from"./chunk-JWPE2WC7-BrdvVNVo.js";import{_ as C,Y as be,P as te,R as Q,U as Ce,d as we,l as ee,aE as B,k as U,b as Te,a as Le,v as $e,x as Ae,g as Fe,s as _e,S as Ne,aF as Me,C as ke}from"./mermaid.core-sGgCbv5y.js";import{p as ze}from"./cynefin-EF2NZ3EQ-CwawUbjJ.js";import{f as I,o as K}from"./d3-scale-4DPf7zan.js";import"./index-DFPOGLS4.js";import"./vendor-BKfNgqAm.js";function Ve(e){var a=0,l=e.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;e.value=a}function De(){return this.eachAfter(Ve)}function Pe(e,a){let l=-1;for(const n of this)e.call(a,n,++l,this);return this}function Be(e,a){for(var l=this,n=[l],s,i,h=-1;l=n.pop();)if(e.call(a,l,++h,this),s=l.children)for(i=s.length-1;i>=0;--i)n.push(s[i]);return this}function Ee(e,a){for(var l=this,n=[l],s=[],i,h,d,f=-1;l=n.pop();)if(s.push(l),i=l.children)for(h=0,d=i.length;h<d;++h)n.push(i[h]);for(;l=s.pop();)e.call(a,l,++f,this);return this}function Re(e,a){let l=-1;for(const n of this)if(e.call(a,n,++l,this))return n}function We(e){return this.eachAfter(function(a){for(var l=+e(a.data)||0,n=a.children,s=n&&n.length;--s>=0;)l+=n[s].value;a.value=l})}function He(e){return this.eachBefore(function(a){a.children&&a.children.sort(e)})}function Ie(e){for(var a=this,l=Oe(a,e),n=[a];a!==l;)a=a.parent,n.push(a);for(var s=n.length;e!==l;)n.splice(s,0,e),e=e.parent;return n}function Oe(e,a){if(e===a)return e;var l=e.ancestors(),n=a.ancestors(),s=null;for(e=l.pop(),a=n.pop();e===a;)s=e,e=l.pop(),a=n.pop();return s}function qe(){for(var e=this,a=[e];e=e.parent;)a.push(e);return a}function Ge(){return Array.from(this)}function Xe(){var e=[];return this.eachBefore(function(a){a.children||e.push(a)}),e}function Ye(){var e=this,a=[];return e.each(function(l){l!==e&&a.push({source:l.parent,target:l})}),a}function*je(){var e=this,a,l=[e],n,s,i;do for(a=l.reverse(),l=[];e=a.pop();)if(yield e,n=e.children)for(s=0,i=n.length;s<i;++s)l.push(n[s]);while(l.length)}function ae(e,a){e instanceof Map?(e=[void 0,e],a===void 0&&(a=Je)):a===void 0&&(a=Ze);for(var l=new X(e),n,s=[l],i,h,d,f;n=s.pop();)if((h=a(n.data))&&(f=(h=Array.from(h)).length))for(n.children=h,d=f-1;d>=0;--d)s.push(i=h[d]=new X(h[d])),i.parent=n,i.depth=n.depth+1;return l.eachBefore(Qe)}function Ue(){return ae(this).eachBefore(Ke)}function Ze(e){return e.children}function Je(e){return Array.isArray(e)?e[1]:null}function Ke(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function Qe(e){var a=0;do e.height=a;while((e=e.parent)&&e.height<++a)}function X(e){this.data=e,this.depth=this.height=0,this.parent=null}X.prototype=ae.prototype={constructor:X,count:De,each:Pe,eachAfter:Ee,eachBefore:Be,find:Re,sum:We,sort:He,path:Ie,ancestors:qe,descendants:Ge,leaves:Xe,links:Ye,copy:Ue,[Symbol.iterator]:je};function et(e){if(typeof e!="function")throw new Error;return e}function O(){return 0}function q(e){return function(){return e}}function tt(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function ie(e,a,l,n,s){for(var i=e.children,h,d=-1,f=i.length,o=e.value&&(n-a)/e.value;++d<f;)h=i[d],h.y0=l,h.y1=s,h.x0=a,h.x1=a+=h.value*o}Object.create(X.prototype);function oe(e,a,l,n,s){for(var i=e.children,h,d=-1,f=i.length,o=e.value&&(s-l)/e.value;++d<f;)h=i[d],h.x0=a,h.x1=n,h.y0=l,h.y1=l+=h.value*o}var ce=(1+Math.sqrt(5))/2;function he(e,a,l,n,s,i){for(var h=[],d=a.children,f,o,u=0,S=0,r=d.length,v,x,g=a.value,p,b,_,$,V,R,N;u<r;){v=s-l,x=i-n;do p=d[S++].value;while(!p&&S<r);for(b=_=p,R=Math.max(x/v,v/x)/(g*e),N=p*p*R,V=Math.max(_/N,N/b);S<r;++S){if(p+=o=d[S].value,o<b&&(b=o),o>_&&(_=o),N=p*p*R,$=Math.max(_/N,N/b),$>V){p-=o;break}V=$}h.push(f={value:p,dice:v<x,children:d.slice(u,S)}),f.dice?ie(f,l,n,s,g?n+=x*p/g:i):oe(f,l,n,g?l+=v*p/g:s,i),g-=p,u=S}return h}var at=(function e(a){function l(n,s,i,h,d){he(a,n,s,i,h,d)}return l.ratio=function(n){return e((n=+n)>1?n:1)},l})(ce);function nt(){var e=at,a=!1,l=1,n=1,s=[0],i=O,h=O,d=O,f=O,o=O;function u(r){return r.x0=r.y0=0,r.x1=l,r.y1=n,r.eachBefore(S),s=[0],a&&r.eachBefore(tt),r}function S(r){var v=s[r.depth],x=r.x0+v,g=r.y0+v,p=r.x1-v,b=r.y1-v;p<x&&(x=p=(x+p)/2),b<g&&(g=b=(g+b)/2),r.x0=x,r.y0=g,r.x1=p,r.y1=b,r.children&&(v=s[r.depth+1]=i(r)/2,x+=o(r)-v,g+=h(r)-v,p-=d(r)-v,b-=f(r)-v,p<x&&(x=p=(x+p)/2),b<g&&(g=b=(g+b)/2),e(r,x,g,p,b))}return u.round=function(r){return arguments.length?(a=!!r,u):a},u.size=function(r){return arguments.length?(l=+r[0],n=+r[1],u):[l,n]},u.tile=function(r){return arguments.length?(e=et(r),u):e},u.padding=function(r){return arguments.length?u.paddingInner(r).paddingOuter(r):u.paddingInner()},u.paddingInner=function(r){return arguments.length?(i=typeof r=="function"?r:q(+r),u):i},u.paddingOuter=function(r){return arguments.length?u.paddingTop(r).paddingRight(r).paddingBottom(r).paddingLeft(r):u.paddingTop()},u.paddingTop=function(r){return arguments.length?(h=typeof r=="function"?r:q(+r),u):h},u.paddingRight=function(r){return arguments.length?(d=typeof r=="function"?r:q(+r),u):d},u.paddingBottom=function(r){return arguments.length?(f=typeof r=="function"?r:q(+r),u):f},u.paddingLeft=function(r){return arguments.length?(o=typeof r=="function"?r:q(+r),u):o},u}(function e(a){function l(n,s,i,h,d){if((f=n._squarify)&&f.ratio===a)for(var f,o,u,S,r=-1,v,x=f.length,g=n.value;++r<x;){for(o=f[r],u=o.children,S=o.value=0,v=u.length;S<v;++S)o.value+=u[S].value;o.dice?ie(o,s,i,h,g?i+=(d-i)*o.value/g:d):oe(o,s,i,g?s+=(h-s)*o.value/g:h,d),g-=o.value}else n._squarify=f=he(a,n,s,i,h,d),f.ratio=a}return l.ratio=function(n){return e((n=+n)>1?n:1)},l})(ce);var de=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=Te,this.getAccTitle=Le,this.setDiagramTitle=$e,this.getDiagramTitle=Ae,this.getAccDescription=Fe,this.setAccDescription=_e}static{C(this,"TreeMapDB")}getNodes(){return this.nodes}getConfig(){const e=Ne,a=te();return Q({...e.treemap,...a.treemap??{}})}addNode(e,a){this.nodes.push(e),this.levels.set(e,a),a===0&&(this.outerNodes.push(e),this.root??=e)}getRoot(){return{name:"",children:this.outerNodes}}addClass(e,a){const l=this.classes.get(e)??{id:e,styles:[],textStyles:[]},n=a.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");n&&n.forEach(s=>{Me(s)&&(l?.textStyles?l.textStyles.push(s):l.textStyles=[s]),l?.styles?l.styles.push(s):l.styles=[s]}),this.classes.set(e,l)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){ke(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function ue(e){if(!e.length)return[];const a=[],l=[];return e.forEach(n=>{const s={name:n.name,children:n.type==="Leaf"?void 0:[]};for(s.classSelector=n?.classSelector,n?.cssCompiledStyles&&(s.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(s.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(s);else{const i=l[l.length-1].node;i.children?i.children.push(s):i.children=[s]}n.type!=="Leaf"&&l.push({node:s,level:n.level})}),a}C(ue,"buildHierarchy");var lt=C((e,a)=>{xe(e,a);const l=[];for(const i of e.TreemapRows??[])i.$type==="ClassDefStatement"&&a.addClass(i.className??"",i.styleText??"");for(const i of e.TreemapRows??[]){const h=i.item;if(!h)continue;const d=i.indent?parseInt(i.indent):0,f=st(h),o=h.classSelector?a.getStylesForClass(h.classSelector):[],u=o.length>0?o:void 0,S={level:d,name:f,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:u};l.push(S)}const n=ue(l),s=C((i,h)=>{for(const d of i)a.addNode(d,h),d.children&&d.children.length>0&&s(d.children,h+1)},"addNodesRecursively");s(n,0)},"populate"),st=C(e=>e.name?String(e.name):"","getItemName"),pe={parser:{yy:void 0},parse:C(async e=>{try{const l=await ze("treemap",e);ee.debug("Treemap AST:",l);const n=pe.parser?.yy;if(!(n instanceof de))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");lt(l,n)}catch(a){throw ee.error("Error parsing treemap:",a),a}},"parse")},rt=10,E=10,G=25,it=C((e,a,l,n)=>{const s=n.db,i=s.getConfig(),h=i.padding??rt,d=s.getDiagramTitle(),f=s.getRoot(),{themeVariables:o}=te();if(!f)return;const u=d?30:0,S=Ce(a),r=i.nodeWidth?i.nodeWidth*E:960,v=i.nodeHeight?i.nodeHeight*E:500,x=r,g=v+u;S.attr("viewBox",`0 0 ${x} ${g}`),we(S,g,x,i.useMaxWidth);let p;try{const t=i.valueFormat||",";if(t==="$0,0")p=C(c=>"$"+I(",")(c),"valueFormat");else if(t.startsWith("$")&&t.includes(",")){const c=/\.\d+/.exec(t),m=c?c[0]:"";p=C(w=>"$"+I(","+m)(w),"valueFormat")}else if(t.startsWith("$")){const c=t.substring(1);p=C(m=>"$"+I(c||"")(m),"valueFormat")}else p=I(t)}catch(t){ee.error("Error creating format function:",t),p=I(",")}const b=K().range(["transparent",o.cScale0,o.cScale1,o.cScale2,o.cScale3,o.cScale4,o.cScale5,o.cScale6,o.cScale7,o.cScale8,o.cScale9,o.cScale10,o.cScale11]),_=K().range(["transparent",o.cScalePeer0,o.cScalePeer1,o.cScalePeer2,o.cScalePeer3,o.cScalePeer4,o.cScalePeer5,o.cScalePeer6,o.cScalePeer7,o.cScalePeer8,o.cScalePeer9,o.cScalePeer10,o.cScalePeer11]),$=K().range([o.cScaleLabel0,o.cScaleLabel1,o.cScaleLabel2,o.cScaleLabel3,o.cScaleLabel4,o.cScaleLabel5,o.cScaleLabel6,o.cScaleLabel7,o.cScaleLabel8,o.cScaleLabel9,o.cScaleLabel10,o.cScaleLabel11]);d&&S.append("text").attr("x",x/2).attr("y",u/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const V=S.append("g").attr("transform",`translate(0, ${u})`).attr("class","treemapContainer"),R=ae(f).sum(t=>t.value??0).sort((t,c)=>(c.value??0)-(t.value??0)),ne=nt().size([r,v]).paddingTop(t=>t.children&&t.children.length>0?G+E:0).paddingInner(h).paddingLeft(t=>t.children&&t.children.length>0?E:0).paddingRight(t=>t.children&&t.children.length>0?E:0).paddingBottom(t=>t.children&&t.children.length>0?E:0).round(!0)(R),fe=ne.descendants().filter(t=>t.children&&t.children.length>0),W=V.selectAll(".treemapSection").data(fe).enter().append("g").attr("class","treemapSection").attr("transform",t=>`translate(${t.x0},${t.y0})`);W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",G).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",t=>t.depth===0?"display: none;":""),W.append("clipPath").attr("id",(t,c)=>`clip-section-${a}-${c}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-12)).attr("height",G),W.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class",(t,c)=>`treemapSection section${c}`).attr("fill",t=>b(t.data.name)).attr("fill-opacity",.6).attr("stroke",t=>_(t.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",t=>{if(t.depth===0)return"display: none;";const c=B({cssCompiledStyles:t.data.cssCompiledStyles});return c.nodeStyles+";"+c.borderStyles.join(";")}),W.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",G/2).attr("dominant-baseline","middle").text(t=>t.depth===0?"":t.data.name).attr("font-weight","bold").attr("clip-path",(t,c)=>`url(#clip-section-${a}-${c})`).attr("style",t=>{if(t.depth===0)return"display: none;";const c="dominant-baseline: middle; font-size: 12px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",m=B({cssCompiledStyles:t.data.cssCompiledStyles});return c+m.labelStyles.replace("color:","fill:")}).each(function(t){if(t.depth===0)return;const c=U(this),m=t.data.name;c.text(m);const w=t.x1-t.x0,L=6;let T;i.showValues!==!1&&t.value?T=w-10-30-10-L:T=w-L-6;const y=Math.max(15,T),M=c.node();if(M.getComputedTextLength()>y){let z=m;for(;z.length>0;){if(z=m.substring(0,z.length-1),z.length===0){c.text("..."),M.getComputedTextLength()>y&&c.text("");break}if(c.text(z+"..."),M.getComputedTextLength()<=y)break}}}),i.showValues!==!1&&W.append("text").attr("class","treemapSectionValue").attr("x",t=>t.x1-t.x0-10).attr("y",G/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(t=>t.value?p(t.value):"").attr("font-style","italic").attr("style",t=>{if(t.depth===0)return"display: none;";const c="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(t.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",m=B({cssCompiledStyles:t.data.cssCompiledStyles});return c+m.labelStyles.replace("color:","fill:")});const le=ne.leaves(),A=le.length>20,me=A?16:38,Y=A?14:28,D=A?4:8,H=A?4:6,Z=A?2:4,se=A?8:10,J=A?1:2,j=V.selectAll(".treemapLeafGroup").data(le).enter().append("g").attr("class",(t,c)=>`treemapNode treemapLeafGroup leaf${c}${t.data.classSelector?` ${t.data.classSelector}`:""}x`).attr("transform",t=>`translate(${t.x0},${t.y0})`);j.append("rect").attr("width",t=>t.x1-t.x0).attr("height",t=>t.y1-t.y0).attr("class","treemapLeaf").attr("fill",t=>t.parent?b(t.parent.data.name):b(t.data.name)).attr("style",t=>B({cssCompiledStyles:t.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",t=>t.parent?b(t.parent.data.name):b(t.data.name)).attr("stroke-width",3),j.append("clipPath").attr("id",(t,c)=>`clip-${a}-${c}`).append("rect").attr("width",t=>Math.max(0,t.x1-t.x0-4)).attr("height",t=>Math.max(0,t.y1-t.y0-4)),j.append("text").attr("class","treemapLabel").attr("x",t=>(t.x1-t.x0)/2).attr("y",t=>(t.y1-t.y0)/2).attr("style",t=>{const c=`text-anchor: middle; dominant-baseline: middle; font-size: ${me}px;fill:`+$(t.data.name)+";",m=B({cssCompiledStyles:t.data.cssCompiledStyles});return c+m.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,c)=>`url(#clip-${a}-${c})`).text(t=>t.data.name).each(function(t){const c=U(this),m=t.x1-t.x0,w=t.y1-t.y0,L=c.node(),T=m-2*Z,P=w-2*Z;if(T<se||P<se){c.style("display","none");return}let y=parseInt(c.style("font-size"),10);const M=.6;for(;L.getComputedTextLength()>T&&y>D;)y--,c.style("font-size",`${y}px`);let F=Math.max(H,Math.min(Y,Math.round(y*M))),k=y+J+F;for(;k>P&&y>D&&(y--,F=Math.max(H,Math.min(Y,Math.round(y*M))),!(F<H&&y===D));)c.style("font-size",`${y}px`),k=y+J+F;c.style("font-size",`${y}px`),A?(y<D||P<D)&&c.style("display","none"):(L.getComputedTextLength()>T||y<D||P<y)&&c.style("display","none")}),i.showValues!==!1&&j.append("text").attr("class","treemapValue").attr("x",c=>(c.x1-c.x0)/2).attr("y",function(c){return(c.y1-c.y0)/2}).attr("style",c=>{const m=`text-anchor: middle; dominant-baseline: hanging; font-size: ${Y}px;fill:`+$(c.data.name)+";",w=B({cssCompiledStyles:c.data.cssCompiledStyles});return m+w.labelStyles.replace("color:","fill:")}).attr("clip-path",(c,m)=>`url(#clip-${a}-${m})`).text(c=>c.value?p(c.value):"").each(function(c){const m=U(this),w=this.parentNode;if(!w){m.style("display","none");return}const L=U(w).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){m.style("display","none");return}const T=parseFloat(L.style("font-size")),y=Math.max(H,Math.min(Y,Math.round(T*.6)));m.style("font-size",`${y}px`);const F=(c.y1-c.y0)/2+T/2+J;m.attr("y",F);const k=c.x1-c.x0,re=c.y1-c.y0-4,Se=k-2*Z;m.node().getComputedTextLength()>Se||F+y>re||y<H?m.style("display","none"):m.style("display",null)});const ge=i.diagramPadding??8;ve(S,ge,"flowchart",i?.useMaxWidth||!1)},"draw"),ot=C(function(e,a){return a.db.getClasses()},"getClasses"),ct={draw:it,getClasses:ot},ht={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},dt=C(({treemap:e}={})=>{const a=be(),l=te(),n=Q(a,l.themeVariables),s=Q(ht,e),i=s.titleColor??n.titleColor,h=s.labelColor??n.textColor,d=s.valueColor??n.textColor;return`
2
+ .treemapNode.section {
3
+ stroke: ${s.sectionStrokeColor};
4
+ stroke-width: ${s.sectionStrokeWidth};
5
+ fill: ${s.sectionFillColor};
6
+ }
7
+ .treemapNode.leaf {
8
+ stroke: ${s.leafStrokeColor};
9
+ stroke-width: ${s.leafStrokeWidth};
10
+ fill: ${s.leafFillColor};
11
+ }
12
+ .treemapLabel {
13
+ fill: ${h};
14
+ font-size: ${s.labelFontSize};
15
+ }
16
+ .treemapValue {
17
+ fill: ${d};
18
+ font-size: ${s.valueFontSize};
19
+ }
20
+ .treemapTitle {
21
+ fill: ${i};
22
+ font-size: ${s.titleFontSize};
23
+ }
24
+ `},"getStyles"),ut=dt,bt={parser:pe,get db(){return new de},renderer:ct,styles:ut};export{bt as diagram};
@@ -0,0 +1 @@
1
+ import{g as l,r as m,d as n}from"./chunk-7U7NFRK5-Dp7s2dg0.js";import{p}from"./chunk-JWPE2WC7-BrdvVNVo.js";import{_ as t,l as o}from"./mermaid.core-sGgCbv5y.js";import{M as u,a as f}from"./cynefin-EF2NZ3EQ-CwawUbjJ.js";import"./index-DFPOGLS4.js";import"./vendor-BKfNgqAm.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},S={parser:g,db:n,renderer:m,styles:l};export{S as diagram};