@oversk7/pi-web-dsh-style 1.3.2 → 1.3.4

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 (187) hide show
  1. package/README.md +10 -2
  2. package/THIRD_PARTY_NOTICES.md +32 -3
  3. package/package.json +4 -1
  4. package/server.ts +234 -21
  5. package/sse-channel.ts +37 -1
  6. package/web/app.css +9 -1
  7. package/web/app.js +96 -25
  8. package/web/assets/fonts/KaTeX_AMS-Regular.ttf +0 -0
  9. package/web/assets/fonts/KaTeX_AMS-Regular.woff +0 -0
  10. package/web/assets/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  11. package/web/assets/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
  12. package/web/assets/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
  13. package/web/assets/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  14. package/web/assets/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
  15. package/web/assets/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
  16. package/web/assets/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  17. package/web/assets/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
  18. package/web/assets/fonts/KaTeX_Fraktur-Bold.woff +0 -0
  19. package/web/assets/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  20. package/web/assets/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
  21. package/web/assets/fonts/KaTeX_Fraktur-Regular.woff +0 -0
  22. package/web/assets/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  23. package/web/assets/fonts/KaTeX_Main-Bold.ttf +0 -0
  24. package/web/assets/fonts/KaTeX_Main-Bold.woff +0 -0
  25. package/web/assets/fonts/KaTeX_Main-Bold.woff2 +0 -0
  26. package/web/assets/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
  27. package/web/assets/fonts/KaTeX_Main-BoldItalic.woff +0 -0
  28. package/web/assets/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  29. package/web/assets/fonts/KaTeX_Main-Italic.ttf +0 -0
  30. package/web/assets/fonts/KaTeX_Main-Italic.woff +0 -0
  31. package/web/assets/fonts/KaTeX_Main-Italic.woff2 +0 -0
  32. package/web/assets/fonts/KaTeX_Main-Regular.ttf +0 -0
  33. package/web/assets/fonts/KaTeX_Main-Regular.woff +0 -0
  34. package/web/assets/fonts/KaTeX_Main-Regular.woff2 +0 -0
  35. package/web/assets/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
  36. package/web/assets/fonts/KaTeX_Math-BoldItalic.woff +0 -0
  37. package/web/assets/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  38. package/web/assets/fonts/KaTeX_Math-Italic.ttf +0 -0
  39. package/web/assets/fonts/KaTeX_Math-Italic.woff +0 -0
  40. package/web/assets/fonts/KaTeX_Math-Italic.woff2 +0 -0
  41. package/web/assets/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
  42. package/web/assets/fonts/KaTeX_SansSerif-Bold.woff +0 -0
  43. package/web/assets/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  44. package/web/assets/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
  45. package/web/assets/fonts/KaTeX_SansSerif-Italic.woff +0 -0
  46. package/web/assets/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  47. package/web/assets/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
  48. package/web/assets/fonts/KaTeX_SansSerif-Regular.woff +0 -0
  49. package/web/assets/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  50. package/web/assets/fonts/KaTeX_Script-Regular.ttf +0 -0
  51. package/web/assets/fonts/KaTeX_Script-Regular.woff +0 -0
  52. package/web/assets/fonts/KaTeX_Script-Regular.woff2 +0 -0
  53. package/web/assets/fonts/KaTeX_Size1-Regular.ttf +0 -0
  54. package/web/assets/fonts/KaTeX_Size1-Regular.woff +0 -0
  55. package/web/assets/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  56. package/web/assets/fonts/KaTeX_Size2-Regular.ttf +0 -0
  57. package/web/assets/fonts/KaTeX_Size2-Regular.woff +0 -0
  58. package/web/assets/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  59. package/web/assets/fonts/KaTeX_Size3-Regular.ttf +0 -0
  60. package/web/assets/fonts/KaTeX_Size3-Regular.woff +0 -0
  61. package/web/assets/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  62. package/web/assets/fonts/KaTeX_Size4-Regular.ttf +0 -0
  63. package/web/assets/fonts/KaTeX_Size4-Regular.woff +0 -0
  64. package/web/assets/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  65. package/web/assets/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
  66. package/web/assets/fonts/KaTeX_Typewriter-Regular.woff +0 -0
  67. package/web/assets/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  68. package/web/assets/katex.min.css +1 -0
  69. package/web/assets/markdown.LICENSE.txt +78 -0
  70. package/web/assets/markdown.js +536 -21
  71. package/web/assets/mermaid/chunks/abnfDiagram-YUKMZFIV-FZYDJU67.js +1 -0
  72. package/web/assets/mermaid/chunks/architecture-WOLXFQ4H-BZVX64AA.js +1 -0
  73. package/web/assets/mermaid/chunks/architectureDiagram-47P4ROYG-2BMC2Z7S.js +36 -0
  74. package/web/assets/mermaid/chunks/blockDiagram-E7TT5TSB-FH6ZULKF.js +140 -0
  75. package/web/assets/mermaid/chunks/c4Diagram-CRA5TL53-OG62EAHM.js +38 -0
  76. package/web/assets/mermaid/chunks/chunk-22D53RF2.js +2 -0
  77. package/web/assets/mermaid/chunks/chunk-25KVF5ZE.js +1 -0
  78. package/web/assets/mermaid/chunks/chunk-4HYFSIZT.js +1 -0
  79. package/web/assets/mermaid/chunks/chunk-4W4OQ3QY.js +1 -0
  80. package/web/assets/mermaid/chunks/chunk-5TQRX2ND.js +1 -0
  81. package/web/assets/mermaid/chunks/chunk-64OFLKGX.js +322 -0
  82. package/web/assets/mermaid/chunks/chunk-64OFLKGX.js.LEGAL.txt +17 -0
  83. package/web/assets/mermaid/chunks/chunk-6UFWKTSA.js +1 -0
  84. package/web/assets/mermaid/chunks/chunk-6ZAAIG6Q.js +10 -0
  85. package/web/assets/mermaid/chunks/chunk-76QEHT4T.js +1 -0
  86. package/web/assets/mermaid/chunks/chunk-A7665WVC.js +1 -0
  87. package/web/assets/mermaid/chunks/chunk-AECJS4LP.js +130 -0
  88. package/web/assets/mermaid/chunks/chunk-AECJS4LP.js.LEGAL.txt +5 -0
  89. package/web/assets/mermaid/chunks/chunk-ATQQWCXO.js +2 -0
  90. package/web/assets/mermaid/chunks/chunk-DQVO43GU.js +1 -0
  91. package/web/assets/mermaid/chunks/chunk-DSKRGV6V.js +1 -0
  92. package/web/assets/mermaid/chunks/chunk-EIBFAW37.js +1 -0
  93. package/web/assets/mermaid/chunks/chunk-FBC3PYSO.js +1 -0
  94. package/web/assets/mermaid/chunks/chunk-FQ5IIL54.js +88 -0
  95. package/web/assets/mermaid/chunks/chunk-GZYY6JMP.js +1 -0
  96. package/web/assets/mermaid/chunks/chunk-HIGPS4L2.js +1 -0
  97. package/web/assets/mermaid/chunks/chunk-HP75Y56I.js +2 -0
  98. package/web/assets/mermaid/chunks/chunk-JRAHLUQM.js +32 -0
  99. package/web/assets/mermaid/chunks/chunk-KNYDPLLK.js +1 -0
  100. package/web/assets/mermaid/chunks/chunk-L465623K.js +136 -0
  101. package/web/assets/mermaid/chunks/chunk-L7BMR7WL.js +1 -0
  102. package/web/assets/mermaid/chunks/chunk-LLGPMHB6.js +1 -0
  103. package/web/assets/mermaid/chunks/chunk-NBH7YOBD.js +15 -0
  104. package/web/assets/mermaid/chunks/chunk-NCOVM3YF.js +1 -0
  105. package/web/assets/mermaid/chunks/chunk-PHKIAKHS.js +1 -0
  106. package/web/assets/mermaid/chunks/chunk-PM2IFX5O.js +1 -0
  107. package/web/assets/mermaid/chunks/chunk-PN62QGJW.js +72 -0
  108. package/web/assets/mermaid/chunks/chunk-QHMFFOZZ.js +1 -0
  109. package/web/assets/mermaid/chunks/chunk-QQZBUVKZ.js +1 -0
  110. package/web/assets/mermaid/chunks/chunk-RV7WQMNL.js +1 -0
  111. package/web/assets/mermaid/chunks/chunk-STBOPOHX.js +1 -0
  112. package/web/assets/mermaid/chunks/chunk-T3FZWEYV.js +1 -0
  113. package/web/assets/mermaid/chunks/chunk-TMMWB6NQ.js +1 -0
  114. package/web/assets/mermaid/chunks/chunk-TPW5CADB.js +1 -0
  115. package/web/assets/mermaid/chunks/chunk-TSOLLCID.js +2 -0
  116. package/web/assets/mermaid/chunks/chunk-TWGPYWIY.js +1 -0
  117. package/web/assets/mermaid/chunks/chunk-WGMEMLED.js +1 -0
  118. package/web/assets/mermaid/chunks/chunk-XC2LKMMW.js +1 -0
  119. package/web/assets/mermaid/chunks/chunk-XHVVPFJ5.js +1 -0
  120. package/web/assets/mermaid/chunks/chunk-YIN5CSIF.js +2 -0
  121. package/web/assets/mermaid/chunks/chunk-YIN5CSIF.js.LEGAL.txt +12 -0
  122. package/web/assets/mermaid/chunks/chunk-YORIST7Z.js +1 -0
  123. package/web/assets/mermaid/chunks/chunk-YPXVLPXW.js +3 -0
  124. package/web/assets/mermaid/chunks/chunk-Z4WODCD2.js +213 -0
  125. package/web/assets/mermaid/chunks/chunk-ZAERIUBF.js +1 -0
  126. package/web/assets/mermaid/chunks/chunk-ZDOBOOWG.js +62 -0
  127. package/web/assets/mermaid/chunks/classDiagram-v2-K4WV4PDN-HXQD675C.js +217 -0
  128. package/web/assets/mermaid/chunks/cose-bilkent-JH36ORCC-3VHNHM7I.js +1 -0
  129. package/web/assets/mermaid/chunks/cynefin-EF2NZ3EQ-ZO5PPXJG.js +1 -0
  130. package/web/assets/mermaid/chunks/cynefinDiagram-3GCD6N5R-LFWDWE4E.js +62 -0
  131. package/web/assets/mermaid/chunks/dagre-W4DXFKR2-SDBBVBGG.js +4 -0
  132. package/web/assets/mermaid/chunks/diagram-2UJZ2QOL-YCKW3WNJ.js +200 -0
  133. package/web/assets/mermaid/chunks/diagram-OVF4WLC6-62NNPE34.js +24 -0
  134. package/web/assets/mermaid/chunks/diagram-PFPMY2P6-7RR2GTZ5.js +30 -0
  135. package/web/assets/mermaid/chunks/diagram-UMYRVEAY-Q4I25SMR.js +24 -0
  136. package/web/assets/mermaid/chunks/diagram-YEKJPTXX-VNUTOPRK.js +41 -0
  137. package/web/assets/mermaid/chunks/diagram-ZIFT7M5P-KALXX5CE.js +3 -0
  138. package/web/assets/mermaid/chunks/ebnfDiagram-VR2GEFS7-WIFBISHL.js +1 -0
  139. package/web/assets/mermaid/chunks/elk-IJKZMXRS-LGG232IL.js +27 -0
  140. package/web/assets/mermaid/chunks/erDiagram-O2IAPWRE-KWX2J2TX.js +99 -0
  141. package/web/assets/mermaid/chunks/eventmodeling-K75KTNOO-3JNV4VSP.js +1 -0
  142. package/web/assets/mermaid/chunks/flowDiagram-OXPTDLAJ-CUMOBDC3.js +1 -0
  143. package/web/assets/mermaid/chunks/ganttDiagram-R7TSEDQI-GCS3MRFX.js +292 -0
  144. package/web/assets/mermaid/chunks/gitGraph-VSP46ZUC-HSAXKLAG.js +1 -0
  145. package/web/assets/mermaid/chunks/gitGraphDiagram-XJZIOB7I-FB763ROZ.js +106 -0
  146. package/web/assets/mermaid/chunks/info-OHQRW6UA-C4R2B34T.js +1 -0
  147. package/web/assets/mermaid/chunks/infoDiagram-5W2HQ5XZ-XCQU5T5D.js +2 -0
  148. package/web/assets/mermaid/chunks/ishikawaDiagram-K3B6WC7H-UWYT66G7.js +70 -0
  149. package/web/assets/mermaid/chunks/journeyDiagram-COXZFDF6-DOW66RYW.js +139 -0
  150. package/web/assets/mermaid/chunks/kanban-definition-P3RFRI5V-K55BXDLO.js +89 -0
  151. package/web/assets/mermaid/chunks/katex-5AUD5AJN.js +257 -0
  152. package/web/assets/mermaid/chunks/mindmap-definition-LZFPQGKD-WG3FIZ5U.js +96 -0
  153. package/web/assets/mermaid/chunks/packet-JDAUHWVQ-SFUSDIUN.js +1 -0
  154. package/web/assets/mermaid/chunks/pegDiagram-BGZESJAR-MQOH3WII.js +1 -0
  155. package/web/assets/mermaid/chunks/pie-XZMESJXO-M76QC4CD.js +1 -0
  156. package/web/assets/mermaid/chunks/pieDiagram-CAPJLFHJ-V3WNR4Y2.js +39 -0
  157. package/web/assets/mermaid/chunks/quadrantDiagram-GDMTTRAM-DJLTATHS.js +7 -0
  158. package/web/assets/mermaid/chunks/radar-ABXABTNO-HSBJ6SSD.js +1 -0
  159. package/web/assets/mermaid/chunks/railroad-I3PHUGI6-4QJMJ7LG.js +1 -0
  160. package/web/assets/mermaid/chunks/railroad-abnf-LNEFI6M7-ZLNZ5ZRH.js +1 -0
  161. package/web/assets/mermaid/chunks/railroad-ebnf-DWYD2UWJ-EBV6ZOUW.js +1 -0
  162. package/web/assets/mermaid/chunks/railroad-peg-JR7BVNR7-X3E47TO7.js +1 -0
  163. package/web/assets/mermaid/chunks/railroadDiagram-SM67HX2B-ZHEERYJS.js +1 -0
  164. package/web/assets/mermaid/chunks/requirementDiagram-X7JNWC4A-TVHJNPPI.js +84 -0
  165. package/web/assets/mermaid/chunks/sankeyDiagram-UM26HJRW-FXHWY3MM.js +40 -0
  166. package/web/assets/mermaid/chunks/sequenceDiagram-ZO4K6R2Y-OP7DCVPK.js +169 -0
  167. package/web/assets/mermaid/chunks/sizeCapture-INFHLROL-2GUJIKNX.js +1 -0
  168. package/web/assets/mermaid/chunks/stateDiagram-v2-TBUQTH76-R26D6XHK.js +291 -0
  169. package/web/assets/mermaid/chunks/swimlanes-N4OXWK64-FPGACWHE.js +1 -0
  170. package/web/assets/mermaid/chunks/swimlanesDiagram-K3J5GTZL-YMNX34Q2.js +8 -0
  171. package/web/assets/mermaid/chunks/timeline-definition-YOQAKGHF-R2U2UR4K.js +120 -0
  172. package/web/assets/mermaid/chunks/treeView-D4JQ5SDB-3BQHZUCI.js +1 -0
  173. package/web/assets/mermaid/chunks/treemap-SAJKECNS-6NJPJ5NM.js +1 -0
  174. package/web/assets/mermaid/chunks/usecaseDiagram-VIAY4XPW-BCEIGXDX.js +370 -0
  175. package/web/assets/mermaid/chunks/vennDiagram-BLWOH2XV-DOV5W2IV.js +34 -0
  176. package/web/assets/mermaid/chunks/wardley-7MLQ67FV-ITOM4KQ2.js +1 -0
  177. package/web/assets/mermaid/chunks/wardleyDiagram-YMQ3BMBF-CGJ7AG4L.js +78 -0
  178. package/web/assets/mermaid/chunks/xychartDiagram-TAQBALBS-2MTP7IBV.js +7 -0
  179. package/web/assets/mermaid/mermaid.js +11 -0
  180. package/web/assets/mermaid/mermaid.js.LEGAL.txt +7 -0
  181. package/web/index.html +1 -0
  182. package/web/markdown-diagrams.js +147 -0
  183. package/web/markdown.ts +41 -2
  184. package/web/session-sync.d.ts +12 -0
  185. package/web/session-sync.js +105 -0
  186. package/web/slash-commands.js +1 -0
  187. package/web/themes.css +46 -0
@@ -0,0 +1,4 @@
1
+ import{a as Ge,b as Ae,c as C,d as ie,e as Fe,f as Q,g as Ve}from"./chunk-XHVVPFJ5.js";import{A as U,B as ae,C as x,a as De,b as F,c as O,d as Te,e as oe,f as Me,g as X,h as u,i as S,j as W,k as y,l as je,m as Be,n as K,o as D,p as k,q as V,r as L,s as q,t as T,u as Y,v as z,w as N,x as G,y as Xe,z as P}from"./chunk-YIN5CSIF.js";import{b as Pe}from"./chunk-5TQRX2ND.js";import{g as te,i as Ce,j as Re}from"./chunk-6ZAAIG6Q.js";import{a as Oe,c as Se,e as ne}from"./chunk-QHMFFOZZ.js";import{b as Ie}from"./chunk-ZDOBOOWG.js";import"./chunk-YORIST7Z.js";import"./chunk-PM2IFX5O.js";import"./chunk-PN62QGJW.js";import"./chunk-DSKRGV6V.js";import"./chunk-HIGPS4L2.js";import"./chunk-22D53RF2.js";import"./chunk-STBOPOHX.js";import{$ as Ne}from"./chunk-AECJS4LP.js";import{b as w}from"./chunk-4HYFSIZT.js";import{a as E}from"./chunk-EIBFAW37.js";import"./chunk-PHKIAKHS.js";var Z=class{constructor(){var r={};r._next=r._prev=r,this._sentinel=r}dequeue(){var r=this._sentinel,n=r._prev;if(n!==r)return Ye(n),n}enqueue(r){var n=this._sentinel;r._prev&&r._next&&Ye(r),r._next=n._next,n._next._prev=r,n._next=r,r._prev=n}toString(){for(var r=[],n=this._sentinel,t=n._prev;t!==n;)r.push(JSON.stringify(t,Vr)),t=t._prev;return"["+r.join(", ")+"]"}};function Ye(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Vr(e,r){if(e!=="_next"&&e!=="_prev")return r}var Yr=F(1);function ze(e,r){if(e.nodeCount()<=1)return[];var n=Ur(e,r||Yr),t=zr(n.graph,n.buckets,n.zeroIdx);return O(y(t,function(o){return e.outEdges(o.v,o.w)}))}function zr(e,r,n){for(var t=[],o=r[r.length-1],a=r[0],i;e.nodeCount();){for(;i=a.dequeue();)se(e,r,n,i);for(;i=o.dequeue();)se(e,r,n,i);if(e.nodeCount()){for(var s=r.length-2;s>0;--s)if(i=r[s].dequeue(),i){t=t.concat(se(e,r,n,i,!0));break}}}return t}function se(e,r,n,t,o){var a=o?[]:void 0;return u(e.inEdges(t.v),function(i){var s=e.edge(i),d=e.node(i.v);o&&a.push({v:i.v,w:i.w}),d.out-=s,de(r,n,d)}),u(e.outEdges(t.v),function(i){var s=e.edge(i),d=i.w,f=e.node(d);f.in-=s,de(r,n,f)}),e.removeNode(t.v),a}function Ur(e,r){var n=new x,t=0,o=0;u(e.nodes(),function(s){n.setNode(s,{v:s,in:0,out:0})}),u(e.edges(),function(s){var d=n.edge(s.v,s.w)||0,f=r(s),c=d+f;n.setEdge(s.v,s.w,c),o=Math.max(o,n.node(s.v).out+=f),t=Math.max(t,n.node(s.w).in+=f)});var a=N(o+t+3).map(function(){return new Z}),i=t+1;return u(n.nodes(),function(s){de(a,i,n.node(s))}),{graph:n,buckets:a,zeroIdx:i}}function de(e,r,n){n.out?n.in?e[n.out-n.in+r].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function Ue(e){var r=e.graph().acyclicer==="greedy"?ze(e,n(e)):Wr(e);u(r,function(t){var o=e.edge(t);e.removeEdge(t),o.forwardName=t.name,o.reversed=!0,e.setEdge(t.w,t.v,o,U("rev"))});function n(t){return function(o){return t.edge(o).weight}}}function Wr(e){var r=[],n={},t={};function o(a){Object.prototype.hasOwnProperty.call(t,a)||(t[a]=!0,n[a]=!0,u(e.outEdges(a),function(i){Object.prototype.hasOwnProperty.call(n,i.w)?r.push(i):o(i.w)}),delete n[a])}return u(e.nodes(),o),r}function We(e){u(e.edges(),function(r){var n=e.edge(r);if(n.reversed){e.removeEdge(r);var t=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(r.w,r.v,n,t)}})}function I(e,r,n,t){var o;do o=U(t);while(e.hasNode(o));return n.dummy=r,e.setNode(o,n),o}function He(e){var r=new x().setGraph(e.graph());return u(e.nodes(),function(n){r.setNode(n,e.node(n))}),u(e.edges(),function(n){var t=r.edge(n.v,n.w)||{weight:0,minlen:1},o=e.edge(n);r.setEdge(n.v,n.w,{weight:t.weight+o.weight,minlen:Math.max(t.minlen,o.minlen)})}),r}function $(e){var r=new x({multigraph:e.isMultigraph()}).setGraph(e.graph());return u(e.nodes(),function(n){e.children(n).length||r.setNode(n,e.node(n))}),u(e.edges(),function(n){r.setEdge(n,e.edge(n))}),r}function fe(e,r){var n=e.x,t=e.y,o=r.x-n,a=r.y-t,i=e.width/2,s=e.height/2;if(!o&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var d,f;return Math.abs(a)*i>Math.abs(o)*s?(a<0&&(s=-s),d=s*o/a,f=s):(o<0&&(i=-i),d=i,f=i*a/o),{x:n+d,y:t+f}}function M(e){var r=y(N(ue(e)+1),function(){return[]});return u(e.nodes(),function(n){var t=e.node(n),o=t.rank;k(o)||(r[o][t.order]=n)}),r}function Je(e){var r=T(y(e.nodes(),function(n){return e.node(n).rank}));u(e.nodes(),function(n){var t=e.node(n);K(t,"rank")&&(t.rank-=r)})}function Ke(e){var r=T(y(e.nodes(),function(a){return e.node(a).rank})),n=[];u(e.nodes(),function(a){var i=e.node(a).rank-r;n[i]||(n[i]=[]),n[i].push(a)});var t=0,o=e.graph().nodeRankFactor;u(n,function(a,i){k(a)&&i%o!==0?--t:t&&u(a,function(s){e.node(s).rank+=t})})}function ce(e,r,n,t){var o={width:0,height:0};return arguments.length>=4&&(o.rank=n,o.order=t),I(e,"border",o,r)}function ue(e){return L(y(e.nodes(),function(r){var n=e.node(r).rank;if(!k(n))return n}))}function Qe(e,r){var n={lhs:[],rhs:[]};return u(e,function(t){r(t)?n.lhs.push(t):n.rhs.push(t)}),n}function Ze(e,r){var n=oe();try{return r()}finally{console.log(e+" time: "+(oe()-n)+"ms")}}function $e(e,r){return r()}function rr(e){function r(n){var t=e.children(n),o=e.node(n);if(t.length&&u(t,r),Object.prototype.hasOwnProperty.call(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var a=o.minRank,i=o.maxRank+1;a<i;++a)er(e,"borderLeft","_bl",n,o,a),er(e,"borderRight","_br",n,o,a)}}u(e.children(),r)}function er(e,r,n,t,o,a){var i={width:0,height:0,rank:a,borderType:r},s=o[r][a-1],d=I(e,"border",i,n);o[r][a]=d,e.setParent(d,t),s&&e.setEdge(s,d,{weight:1})}function tr(e){var r=e.graph().rankdir.toLowerCase();(r==="lr"||r==="rl")&&ar(e)}function or(e){var r=e.graph().rankdir.toLowerCase();(r==="bt"||r==="rl")&&qr(e),(r==="lr"||r==="rl")&&(Hr(e),ar(e))}function ar(e){u(e.nodes(),function(r){nr(e.node(r))}),u(e.edges(),function(r){nr(e.edge(r))})}function nr(e){var r=e.width;e.width=e.height,e.height=r}function qr(e){u(e.nodes(),function(r){le(e.node(r))}),u(e.edges(),function(r){var n=e.edge(r);u(n.points,le),Object.prototype.hasOwnProperty.call(n,"y")&&le(n)})}function le(e){e.y=-e.y}function Hr(e){u(e.nodes(),function(r){he(e.node(r))}),u(e.edges(),function(r){var n=e.edge(r);u(n.points,he),Object.prototype.hasOwnProperty.call(n,"x")&&he(n)})}function he(e){var r=e.x;e.x=e.y,e.y=r}function ir(e){e.graph().dummyChains=[],u(e.edges(),function(r){Kr(e,r)})}function Kr(e,r){var n=r.v,t=e.node(n).rank,o=r.w,a=e.node(o).rank,i=r.name,s=e.edge(r),d=s.labelRank;if(a!==t+1){e.removeEdge(r);var f=void 0,c,l;for(l=0,++t;t<a;++l,++t)s.points=[],f={width:0,height:0,edgeLabel:s,edgeObj:r,rank:t},c=I(e,"edge",f,"_d"),t===d&&(f.width=s.width,f.height=s.height,f.dummy="edge-label",f.labelpos=s.labelpos),e.setEdge(n,c,{weight:s.weight},i),l===0&&e.graph().dummyChains.push(c),n=c;e.setEdge(n,o,{weight:s.weight},i)}}function sr(e){u(e.graph().dummyChains,function(r){var n=e.node(r),t=n.edgeLabel,o;for(e.setEdge(n.edgeObj,t);n.dummy;)o=e.successors(r)[0],e.removeNode(r),t.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(t.x=n.x,t.y=n.y,t.width=n.width,t.height=n.height),r=o,n=e.node(r)})}function H(e){var r={};function n(t){var o=e.node(t);if(Object.prototype.hasOwnProperty.call(r,t))return o.rank;r[t]=!0;var a=T(y(e.outEdges(t),function(i){return n(i.w)-e.edge(i).minlen}));return(a===Number.POSITIVE_INFINITY||a===void 0||a===null)&&(a=0),o.rank=a}u(e.sources(),n)}function A(e,r){return e.node(r.w).rank-e.node(r.v).rank-e.edge(r).minlen}function ee(e){var r=new x({directed:!1}),n=e.nodes()[0],t=e.nodeCount();r.setNode(n,{});for(var o,a;Qr(r,e)<t;)o=Zr(r,e),a=r.hasNode(o.v)?A(e,o):-A(e,o),$r(r,e,a);return r}function Qr(e,r){function n(t){u(r.nodeEdges(t),function(o){var a=o.v,i=t===a?o.w:a;!e.hasNode(i)&&!A(r,o)&&(e.setNode(i,{}),e.setEdge(t,i,{}),n(i))})}return u(e.nodes(),n),e.nodeCount()}function Zr(e,r){return Y(r.edges(),function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return A(r,n)})}function $r(e,r,n){u(e.nodes(),function(t){r.node(t).rank+=n})}var Dt=F(1);var At=F(1);pe.CycleException=J;function pe(e){var r={},n={},t=[];function o(a){if(Object.prototype.hasOwnProperty.call(n,a))throw new J;Object.prototype.hasOwnProperty.call(r,a)||(n[a]=!0,r[a]=!0,u(e.predecessors(a),o),delete n[a],t.push(a))}if(u(e.sinks(),o),Xe(r)!==e.nodeCount())throw new J;return t}function J(){}J.prototype=new Error;function re(e,r,n){De(r)||(r=[r]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),o=[],a={};return u(r,function(i){if(!e.hasNode(i))throw new Error("Graph does not have node: "+i);fr(e,i,n==="post",a,t,o)}),o}function fr(e,r,n,t,o,a){Object.prototype.hasOwnProperty.call(t,r)||(t[r]=!0,n||a.push(r),u(o(r),function(i){fr(e,i,n,t,o,a)}),n&&a.push(r))}function me(e,r){return re(e,r,"post")}function ve(e,r){return re(e,r,"pre")}B.initLowLimValues=_e;B.initCutValues=ge;B.calcCutValue=ur;B.leaveEdge=hr;B.enterEdge=pr;B.exchangeEdges=mr;function B(e){e=He(e),H(e);var r=ee(e);_e(r),ge(r,e);for(var n,t;n=hr(r);)t=pr(r,e,n),mr(r,e,n,t)}function ge(e,r){var n=me(e,e.nodes());n=n.slice(0,n.length-1),u(n,function(t){on(e,r,t)})}function on(e,r,n){var t=e.node(n),o=t.parent;e.edge(n,o).cutvalue=ur(e,r,n)}function ur(e,r,n){var t=e.node(n),o=t.parent,a=!0,i=r.edge(n,o),s=0;return i||(a=!1,i=r.edge(o,n)),s=i.weight,u(r.nodeEdges(n),function(d){var f=d.v===n,c=f?d.w:d.v;if(c!==o){var l=f===a,h=r.edge(d).weight;if(s+=l?h:-h,sn(e,n,c)){var m=e.edge(n,c).cutvalue;s+=l?-m:m}}}),s}function _e(e,r){arguments.length<2&&(r=e.nodes()[0]),lr(e,{},1,r)}function lr(e,r,n,t,o){var a=n,i=e.node(t);return r[t]=!0,u(e.neighbors(t),function(s){Object.prototype.hasOwnProperty.call(r,s)||(n=lr(e,r,n,s,t))}),i.low=a,i.lim=n++,o?i.parent=o:delete i.parent,n}function hr(e){return W(e.edges(),function(r){return e.edge(r).cutvalue<0})}function pr(e,r,n){var t=n.v,o=n.w;r.hasEdge(t,o)||(t=n.w,o=n.v);var a=e.node(t),i=e.node(o),s=a,d=!1;a.lim>i.lim&&(s=i,d=!0);var f=S(r.edges(),function(c){return d===cr(e,e.node(c.v),s)&&d!==cr(e,e.node(c.w),s)});return Y(f,function(c){return A(r,c)})}function mr(e,r,n,t){var o=n.v,a=n.w;e.removeEdge(o,a),e.setEdge(t.v,t.w,{}),_e(e),ge(e,r),an(e,r)}function an(e,r){var n=W(e.nodes(),function(o){return!r.node(o).parent}),t=ve(e,n);t=t.slice(1),u(t,function(o){var a=e.node(o).parent,i=r.edge(o,a),s=!1;i||(i=r.edge(a,o),s=!0),r.node(o).rank=r.node(a).rank+(s?i.minlen:-i.minlen)})}function sn(e,r,n){return e.hasEdge(r,n)}function cr(e,r,n){return n.low<=r.lim&&r.lim<=n.lim}function we(e){switch(e.graph().ranker){case"network-simplex":vr(e);break;case"tight-tree":fn(e);break;case"longest-path":dn(e);break;default:vr(e)}}var dn=H;function fn(e){H(e),ee(e)}function vr(e){B(e)}function gr(e){var r=I(e,"root",{},"_root"),n=cn(e),t=L(D(n))-1,o=2*t+1;e.graph().nestingRoot=r,u(e.edges(),function(i){e.edge(i).minlen*=o});var a=un(e)+1;u(e.children(),function(i){_r(e,r,o,a,t,n,i)}),e.graph().nodeRankFactor=o}function _r(e,r,n,t,o,a,i){var s=e.children(i);if(!s.length){i!==r&&e.setEdge(r,i,{weight:0,minlen:n});return}var d=ce(e,"_bt"),f=ce(e,"_bb"),c=e.node(i);e.setParent(d,i),c.borderTop=d,e.setParent(f,i),c.borderBottom=f,u(s,function(l){_r(e,r,n,t,o,a,l);var h=e.node(l),m=h.borderTop?h.borderTop:l,g=h.borderBottom?h.borderBottom:l,v=h.borderTop?t:2*t,p=m!==g?1:o-a[i]+1;e.setEdge(d,m,{weight:v,minlen:p,nestingEdge:!0}),e.setEdge(g,f,{weight:v,minlen:p,nestingEdge:!0})}),e.parent(i)||e.setEdge(r,d,{weight:0,minlen:o+a[i]})}function cn(e){var r={};function n(t,o){var a=e.children(t);a&&a.length&&u(a,function(i){n(i,o+1)}),r[t]=o}return u(e.children(),function(t){n(t,1)}),r}function un(e){return G(e.edges(),function(r,n){return r+e.edge(n).weight},0)}function wr(e){var r=e.graph();e.removeNode(r.nestingRoot),delete r.nestingRoot,u(e.edges(),function(n){var t=e.edge(n);t.nestingEdge&&e.removeEdge(n)})}function yr(e,r,n){var t={},o;u(n,function(a){for(var i=e.parent(a),s,d;i;){if(s=e.parent(i),s?(d=t[s],t[s]=i):(d=o,o=i),d&&d!==i){r.setEdge(d,i);return}i=s}})}function br(e,r,n){var t=hn(e),o=new x({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(a){return e.node(a)});return u(e.nodes(),function(a){var i=e.node(a),s=e.parent(a);(i.rank===r||i.minRank<=r&&r<=i.maxRank)&&(o.setNode(a),o.setParent(a,s||t),u(e[n](a),function(d){var f=d.v===a?d.w:d.v,c=o.edge(f,a),l=k(c)?0:c.weight;o.setEdge(f,a,{weight:e.edge(d).weight+l})}),Object.prototype.hasOwnProperty.call(i,"minRank")&&o.setNode(a,{borderLeft:i.borderLeft[r],borderRight:i.borderRight[r]}))}),o}function hn(e){for(var r;e.hasNode(r=U("_root")););return r}function Er(e,r){for(var n=0,t=1;t<r.length;++t)n+=pn(e,r[t-1],r[t]);return n}function pn(e,r,n){for(var t=ae(n,y(n,function(f,c){return c})),o=O(y(r,function(f){return P(y(e.outEdges(f),function(c){return{pos:t[c.w],weight:e.edge(c).weight}}),"pos")})),a=1;a<n.length;)a<<=1;var i=2*a-1;a-=1;var s=y(new Array(i),function(){return 0}),d=0;return u(o.forEach(function(f){var c=f.pos+a;s[c]+=f.weight;for(var l=0;c>0;)c%2&&(l+=s[c+1]),c=c-1>>1,s[c]+=f.weight;d+=f.weight*l})),d}function xr(e){var r={},n=S(e.nodes(),function(s){return!e.children(s).length}),t=L(y(n,function(s){return e.node(s).rank})),o=y(N(t+1),function(){return[]});function a(s){if(!K(r,s)){r[s]=!0;var d=e.node(s);o[d.rank].push(s),u(e.successors(s),a)}}var i=P(n,function(s){return e.node(s).rank});return u(i,a),o}function kr(e,r){return y(r,function(n){var t=e.inEdges(n);if(t.length){var o=G(t,function(a,i){var s=e.edge(i),d=e.node(i.v);return{sum:a.sum+s.weight*d.order,weight:a.weight+s.weight}},{sum:0,weight:0});return{v:n,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:n}})}function Lr(e,r){var n={};u(e,function(o,a){var i=n[o.v]={indegree:0,in:[],out:[],vs:[o.v],i:a};k(o.barycenter)||(i.barycenter=o.barycenter,i.weight=o.weight)}),u(r.edges(),function(o){var a=n[o.v],i=n[o.w];!k(a)&&!k(i)&&(i.indegree++,a.out.push(n[o.w]))});var t=S(n,function(o){return!o.indegree});return mn(t)}function mn(e){var r=[];function n(a){return function(i){i.merged||(k(i.barycenter)||k(a.barycenter)||i.barycenter>=a.barycenter)&&vn(a,i)}}function t(a){return function(i){i.in.push(a),--i.indegree===0&&e.push(i)}}for(;e.length;){var o=e.pop();r.push(o),u(o.in.reverse(),n(o)),u(o.out,t(o))}return y(S(r,function(a){return!a.merged}),function(a){return z(a,["vs","i","barycenter","weight"])})}function vn(e,r){var n=0,t=0;e.weight&&(n+=e.barycenter*e.weight,t+=e.weight),r.weight&&(n+=r.barycenter*r.weight,t+=r.weight),e.vs=r.vs.concat(e.vs),e.barycenter=n/t,e.weight=t,e.i=Math.min(r.i,e.i),r.merged=!0}function Ir(e,r){var n=Qe(e,function(c){return Object.prototype.hasOwnProperty.call(c,"barycenter")}),t=n.lhs,o=P(n.rhs,function(c){return-c.i}),a=[],i=0,s=0,d=0;t.sort(gn(!!r)),d=Nr(a,o,d),u(t,function(c){d+=c.vs.length,a.push(c.vs),i+=c.barycenter*c.weight,s+=c.weight,d=Nr(a,o,d)});var f={vs:O(a)};return s&&(f.barycenter=i/s,f.weight=s),f}function Nr(e,r,n){for(var t;r.length&&(t=X(r)).i<=n;)r.pop(),e.push(t.vs),n++;return n}function gn(e){return function(r,n){return r.barycenter<n.barycenter?-1:r.barycenter>n.barycenter?1:e?n.i-r.i:r.i-n.i}}function ye(e,r,n,t){var o=e.children(r),a=e.node(r),i=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,d={};i&&(o=S(o,function(g){return g!==i&&g!==s}));var f=kr(e,o);u(f,function(g){if(e.children(g.v).length){var v=ye(e,g.v,n,t);d[g.v]=v,Object.prototype.hasOwnProperty.call(v,"barycenter")&&wn(g,v)}});var c=Lr(f,n);_n(c,d);var l=Ir(c,t);if(i&&(l.vs=O([i,l.vs,s]),e.predecessors(i).length)){var h=e.node(e.predecessors(i)[0]),m=e.node(e.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(l,"barycenter")||(l.barycenter=0,l.weight=0),l.barycenter=(l.barycenter*l.weight+h.order+m.order)/(l.weight+2),l.weight+=2}return l}function _n(e,r){u(e,function(n){n.vs=O(n.vs.map(function(t){return r[t]?r[t].vs:t}))})}function wn(e,r){k(e.barycenter)?(e.barycenter=r.barycenter,e.weight=r.weight):(e.barycenter=(e.barycenter*e.weight+r.barycenter*r.weight)/(e.weight+r.weight),e.weight+=r.weight)}function Pr(e){var r=ue(e),n=Or(e,N(1,r+1),"inEdges"),t=Or(e,N(r-1,-1,-1),"outEdges"),o=xr(e);Sr(e,o);for(var a=Number.POSITIVE_INFINITY,i,s=0,d=0;d<4;++s,++d){yn(s%2?n:t,s%4>=2),o=M(e);var f=Er(e,o);f<a&&(d=0,i=Te(o),a=f)}Sr(e,i)}function Or(e,r,n){return y(r,function(t){return br(e,t,n)})}function yn(e,r){var n=new x;u(e,function(t){var o=t.graph().root,a=ye(t,o,n,r);u(a.vs,function(i,s){t.node(i).order=s}),yr(t,n,a.vs)})}function Sr(e,r){u(r,function(n){u(n,function(t,o){e.node(t).order=o})})}function Cr(e){var r=En(e);u(e.graph().dummyChains,function(n){for(var t=e.node(n),o=t.edgeObj,a=bn(e,r,o.v,o.w),i=a.path,s=a.lca,d=0,f=i[d],c=!0;n!==o.w;){if(t=e.node(n),c){for(;(f=i[d])!==s&&e.node(f).maxRank<t.rank;)d++;f===s&&(c=!1)}if(!c){for(;d<i.length-1&&e.node(f=i[d+1]).minRank<=t.rank;)d++;f=i[d]}e.setParent(n,f),n=e.successors(n)[0]}})}function bn(e,r,n,t){var o=[],a=[],i=Math.min(r[n].low,r[t].low),s=Math.max(r[n].lim,r[t].lim),d,f;d=n;do d=e.parent(d),o.push(d);while(d&&(r[d].low>i||s>r[d].lim));for(f=d,d=t;(d=e.parent(d))!==f;)a.push(d);return{path:o.concat(a.reverse()),lca:f}}function En(e){var r={},n=0;function t(o){var a=n;u(e.children(o),t),r[o]={low:a,lim:n++}}return u(e.children(),t),r}function xn(e,r){var n={};function t(o,a){var i=0,s=0,d=o.length,f=X(a);return u(a,function(c,l){var h=Ln(e,c),m=h?e.node(h).order:d;(h||c===f)&&(u(a.slice(s,l+1),function(g){u(e.predecessors(g),function(v){var p=e.node(v),_=p.order;(_<i||m<_)&&!(p.dummy&&e.node(g).dummy)&&Rr(n,v,g)})}),s=l+1,i=m)}),a}return G(r,t),n}function kn(e,r){var n={};function t(a,i,s,d,f){var c;u(N(i,s),function(l){c=a[l],e.node(c).dummy&&u(e.predecessors(c),function(h){var m=e.node(h);m.dummy&&(m.order<d||m.order>f)&&Rr(n,h,c)})})}function o(a,i){var s=-1,d,f=0;return u(i,function(c,l){if(e.node(c).dummy==="border"){var h=e.predecessors(c);h.length&&(d=e.node(h[0]).order,t(i,f,l,s,d),f=l,s=d)}t(i,f,i.length,d,a.length)}),i}return G(r,o),n}function Ln(e,r){if(e.node(r).dummy)return W(e.predecessors(r),function(n){return e.node(n).dummy})}function Rr(e,r,n){if(r>n){var t=r;r=n,n=t}Object.prototype.hasOwnProperty.call(e,r)||Object.defineProperty(e,r,{enumerable:!0,configurable:!0,value:{},writable:!0});var o=e[r];Object.defineProperty(o,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Nn(e,r,n){if(r>n){var t=r;r=n,n=t}return!!e[r]&&Object.prototype.hasOwnProperty.call(e[r],n)}function In(e,r,n,t){var o={},a={},i={};return u(r,function(s){u(s,function(d,f){o[d]=d,a[d]=d,i[d]=f})}),u(r,function(s){var d=-1;u(s,function(f){var c=t(f);if(c.length){c=P(c,function(v){return i[v]});for(var l=(c.length-1)/2,h=Math.floor(l),m=Math.ceil(l);h<=m;++h){var g=c[h];a[f]===f&&d<i[g]&&!Nn(n,f,g)&&(a[g]=f,a[f]=o[f]=o[g],d=i[g])}}})}),{root:o,align:a}}function On(e,r,n,t,o){var a={},i=Sn(e,r,n,o),s=o?"borderLeft":"borderRight";function d(l,h){for(var m=i.nodes(),g=m.pop(),v={};g;)v[g]?l(g):(v[g]=!0,m.push(g),m=m.concat(h(g))),g=m.pop()}function f(l){a[l]=i.inEdges(l).reduce(function(h,m){return Math.max(h,a[m.v]+i.edge(m))},0)}function c(l){var h=i.outEdges(l).reduce(function(g,v){return Math.min(g,a[v.w]-i.edge(v))},Number.POSITIVE_INFINITY),m=e.node(l);h!==Number.POSITIVE_INFINITY&&m.borderType!==s&&(a[l]=Math.max(a[l],h))}return d(f,i.predecessors.bind(i)),d(c,i.successors.bind(i)),u(t,function(l){a[l]=a[n[l]]}),a}function Sn(e,r,n,t){var o=new x,a=e.graph(),i=Dn(a.nodesep,a.edgesep,t);return u(r,function(s){var d;u(s,function(f){var c=n[f];if(o.setNode(c),d){var l=n[d],h=o.edge(l,c);o.setEdge(l,c,Math.max(i(e,f,d),h||0))}d=f})}),o}function Pn(e,r){return Y(D(r),function(n){var t=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;return je(n,function(a,i){var s=Tn(e,i)/2;t=Math.max(a+s,t),o=Math.min(a-s,o)}),t-o})}function Cn(e,r){var n=D(r),t=T(n),o=L(n);u(["u","d"],function(a){u(["l","r"],function(i){var s=a+i,d=e[s],f;if(d!==r){var c=D(d);f=i==="l"?t-T(c):o-L(c),f&&(e[s]=V(d,function(l){return l+f}))}})})}function Rn(e,r){return V(e.ul,function(n,t){if(r)return e[r.toLowerCase()][t];var o=P(y(e,t));return(o[1]+o[2])/2})}function Dr(e){var r=M(e),n=q(xn(e,r),kn(e,r)),t={},o;u(["u","d"],function(i){o=i==="u"?r:D(r).reverse(),u(["l","r"],function(s){s==="r"&&(o=y(o,function(l){return D(l).reverse()}));var d=(i==="u"?e.predecessors:e.successors).bind(e),f=In(e,o,n,d),c=On(e,o,f.root,f.align,s==="r");s==="r"&&(c=V(c,function(l){return-l})),t[i+s]=c})});var a=Pn(e,t);return Cn(t,a),Rn(t,e.graph().align)}function Dn(e,r,n){return function(t,o,a){var i=t.node(o),s=t.node(a),d=0,f;if(d+=i.width/2,Object.prototype.hasOwnProperty.call(i,"labelpos"))switch(i.labelpos.toLowerCase()){case"l":f=-i.width/2;break;case"r":f=i.width/2;break}if(f&&(d+=n?f:-f),f=0,d+=(i.dummy?r:e)/2,d+=(s.dummy?r:e)/2,d+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":f=s.width/2;break;case"r":f=-s.width/2;break}return f&&(d+=n?f:-f),f=0,d}}function Tn(e,r){return e.node(r).width}function Tr(e){e=$(e),Mn(e),Be(Dr(e),function(r,n){e.node(n).x=r})}function Mn(e){var r=M(e),n=e.graph().ranksep,t=0;u(r,function(o){var a=L(y(o,function(i){return e.node(i).height}));u(o,function(i){e.node(i).y=t+a/2}),t+=a+n})}function xe(e,r){var n=r&&r.debugTiming?Ze:$e;n("layout",()=>{var t=n(" buildLayoutGraph",()=>Wn(e));n(" runLayout",()=>jn(t,n)),n(" updateInputGraph",()=>Bn(e,t))})}function jn(e,r){r(" makeSpaceForEdgeLabels",()=>qn(e)),r(" removeSelfEdges",()=>nt(e)),r(" acyclic",()=>Ue(e)),r(" nestingGraph.run",()=>gr(e)),r(" rank",()=>we($(e))),r(" injectEdgeLabelProxies",()=>Hn(e)),r(" removeEmptyRanks",()=>Ke(e)),r(" nestingGraph.cleanup",()=>wr(e)),r(" normalizeRanks",()=>Je(e)),r(" assignRankMinMax",()=>Jn(e)),r(" removeEdgeLabelProxies",()=>Kn(e)),r(" normalize.run",()=>ir(e)),r(" parentDummyChains",()=>Cr(e)),r(" addBorderSegments",()=>rr(e)),r(" order",()=>Pr(e)),r(" insertSelfEdges",()=>tt(e)),r(" adjustCoordinateSystem",()=>tr(e)),r(" position",()=>Tr(e)),r(" positionSelfEdges",()=>ot(e)),r(" removeBorderNodes",()=>rt(e)),r(" normalize.undo",()=>sr(e)),r(" fixupEdgeLabelCoords",()=>$n(e)),r(" undoCoordinateSystem",()=>or(e)),r(" translateGraph",()=>Qn(e)),r(" assignNodeIntersects",()=>Zn(e)),r(" reversePoints",()=>et(e)),r(" acyclic.undo",()=>We(e))}function Bn(e,r){u(e.nodes(),function(n){var t=e.node(n),o=r.node(n);t&&(t.x=o.x,t.y=o.y,r.children(n).length&&(t.width=o.width,t.height=o.height))}),u(e.edges(),function(n){var t=e.edge(n),o=r.edge(n);t.points=o.points,Object.prototype.hasOwnProperty.call(o,"x")&&(t.x=o.x,t.y=o.y)}),e.graph().width=r.graph().width,e.graph().height=r.graph().height}var Xn=["nodesep","edgesep","ranksep","marginx","marginy"],Gn={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},An=["acyclicer","ranker","rankdir","align"],Fn=["width","height"],Vn={width:0,height:0},Yn=["minlen","weight","width","height","labeloffset"],zn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Un=["labelpos"];function Wn(e){var r=new x({multigraph:!0,compound:!0}),n=Ee(e.graph());return r.setGraph(q({},Gn,be(n,Xn),z(n,An))),u(e.nodes(),function(t){var o=Ee(e.node(t));r.setNode(t,Me(be(o,Fn),Vn)),r.setParent(t,e.parent(t))}),u(e.edges(),function(t){var o=Ee(e.edge(t));r.setEdge(t,q({},zn,be(o,Yn),z(o,Un)))}),r}function qn(e){var r=e.graph();r.ranksep/=2,u(e.edges(),function(n){var t=e.edge(n);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(r.rankdir==="TB"||r.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function Hn(e){u(e.edges(),function(r){var n=e.edge(r);if(n.width&&n.height){var t=e.node(r.v),o=e.node(r.w),a={rank:(o.rank-t.rank)/2+t.rank,e:r};I(e,"edge-proxy",a,"_ep")}})}function Jn(e){var r=0;u(e.nodes(),function(n){var t=e.node(n);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,r=L(r,t.maxRank))}),e.graph().maxRank=r}function Kn(e){u(e.nodes(),function(r){var n=e.node(r);n.dummy==="edge-proxy"&&(e.edge(n.e).labelRank=n.rank,e.removeNode(r))})}function Qn(e){var r=Number.POSITIVE_INFINITY,n=0,t=Number.POSITIVE_INFINITY,o=0,a=e.graph(),i=a.marginx||0,s=a.marginy||0;function d(f){var c=f.x,l=f.y,h=f.width,m=f.height;r=Math.min(r,c-h/2),n=Math.max(n,c+h/2),t=Math.min(t,l-m/2),o=Math.max(o,l+m/2)}u(e.nodes(),function(f){d(e.node(f))}),u(e.edges(),function(f){var c=e.edge(f);Object.prototype.hasOwnProperty.call(c,"x")&&d(c)}),r-=i,t-=s,u(e.nodes(),function(f){var c=e.node(f);c.x-=r,c.y-=t}),u(e.edges(),function(f){var c=e.edge(f);u(c.points,function(l){l.x-=r,l.y-=t}),Object.prototype.hasOwnProperty.call(c,"x")&&(c.x-=r),Object.prototype.hasOwnProperty.call(c,"y")&&(c.y-=t)}),a.width=n-r+i,a.height=o-t+s}function Zn(e){u(e.edges(),function(r){var n=e.edge(r),t=e.node(r.v),o=e.node(r.w),a,i;n.points?(a=n.points[0],i=n.points[n.points.length-1]):(n.points=[],a=o,i=t),n.points.unshift(fe(t,a)),n.points.push(fe(o,i))})}function $n(e){u(e.edges(),function(r){var n=e.edge(r);if(Object.prototype.hasOwnProperty.call(n,"x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})}function et(e){u(e.edges(),function(r){var n=e.edge(r);n.reversed&&n.points.reverse()})}function rt(e){u(e.nodes(),function(r){if(e.children(r).length){var n=e.node(r),t=e.node(n.borderTop),o=e.node(n.borderBottom),a=e.node(X(n.borderLeft)),i=e.node(X(n.borderRight));n.width=Math.abs(i.x-a.x),n.height=Math.abs(o.y-t.y),n.x=a.x+n.width/2,n.y=t.y+n.height/2}}),u(e.nodes(),function(r){e.node(r).dummy==="border"&&e.removeNode(r)})}function nt(e){u(e.edges(),function(r){if(r.v===r.w){var n=e.node(r.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:r,label:e.edge(r)}),e.removeEdge(r)}})}function tt(e){var r=M(e);u(r,function(n){var t=0;u(n,function(o,a){var i=e.node(o);i.order=a+t,u(i.selfEdges,function(s){I(e,"selfedge",{width:s.label.width,height:s.label.height,rank:i.rank,order:a+ ++t,e:s.e,label:s.label},"_se")}),delete i.selfEdges})})}function ot(e){u(e.nodes(),function(r){var n=e.node(r);if(n.dummy==="selfedge"){var t=e.node(n.e.v),o=t.x+t.width/2,a=t.y,i=n.x-o,s=t.height/2;e.setEdge(n.e,n.label),e.removeNode(r),n.label.points=[{x:o+2*i/3,y:a-s},{x:o+5*i/6,y:a-s},{x:o+i,y:a},{x:o+5*i/6,y:a+s},{x:o+2*i/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function be(e,r){return V(z(e,r),Number)}function Ee(e){var r={};return u(e,function(n,t){r[t.toLowerCase()]=n}),r}var Mr=E((e,r,n)=>Math.max(r,Math.min(n,e)),"clamp"),jr=E((e="TB")=>{switch(e){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";default:return"top"}},"getDefaultSelfLoopSide"),at=E(e=>e==="flowchart"||e==="flowchart-v2"||e==="stateDiagram"||e==="er"||e==="classDiagram","shouldMergeSelfLoopSegments"),it=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],st=E((e,r,n,t,o)=>{let a=[],i=new Set;if(n.forEach(({start:c,end:l})=>{c!==t&&i.add(c),l!==t&&i.add(l)}),i.forEach(c=>{let l=e.node(c);typeof l?.x=="number"&&typeof l?.y=="number"&&a.push(l)}),a.length===0&&n.forEach(({edge:c})=>{(c.points??[]).forEach(l=>{typeof l?.x=="number"&&typeof l?.y=="number"&&a.push(l)})}),a.length===0)return jr(o);let s=a.reduce((c,l)=>({x:c.x+l.x/a.length,y:c.y+l.y/a.length}),{x:0,y:0}),d=s.x-r.x,f=s.y-r.y;return Math.abs(d)>Math.abs(f)?d>0?"right":"left":Math.abs(f)>0?f>0?"bottom":"top":jr(o)},"getSelfLoopSide"),dt=E((e,r="top",n=0,t=0)=>{let o=e.x,a=e.y-n,i=e.width/2,s=e.height/2,d=Math.max(36,Math.min(100,e.width*.8)),f=Mr(Math.max(t,e.width*.35),36,d),c=Mr(Math.min(e.width,e.height)*.45,24,48);switch(r){case"bottom":{let l=a+s;return[{x:o-f/2,y:l},{x:o-f/2,y:l+c},{x:o+f/2,y:l+c},{x:o+f/2,y:l}]}case"right":{let l=o+i;return[{x:l,y:a-f/2},{x:l+c,y:a-f/2},{x:l+c,y:a+f/2},{x:l,y:a+f/2}]}case"left":{let l=o-i;return[{x:l,y:a-f/2},{x:l-c,y:a-f/2},{x:l-c,y:a+f/2},{x:l,y:a+f/2}]}default:{let l=a-s;return[{x:o-f/2,y:l},{x:o-f/2,y:l-c},{x:o+f/2,y:l-c},{x:o+f/2,y:l}]}}},"getSelfLoopPoints"),ft=E((e,r,n="top",t=0,o={})=>{let i=e.x,s=e.y-t,d=o.width??0,f=o.height??0;switch(n){case"bottom":return{x:i,y:Math.max(...r.map(c=>c.y))+f/2+4};case"right":return{x:Math.max(...r.map(c=>c.x))+d/2+4,y:s};case"left":return{x:Math.min(...r.map(c=>c.x))-d/2-4,y:s};default:return{x:i,y:Math.min(...r.map(c=>c.y))-f/2-4}}},"getSelfLoopLabelPosition"),Xr=E((e,r=0,{mergeSelfLoops:n=!0}={})=>{let t=new Map,o=[],a=e.graph()?.rankdir;return e.edges().forEach(i=>{let s=e.edge(i);if(n&&s.selfLoop){let d=s.selfLoop.id;t.has(d)||t.set(d,[]),t.get(d).push({edge:s,start:i.v,end:i.w})}else o.push({edge:s,start:i.v,end:i.w})}),t.forEach(i=>{if(i.length!==3){i.forEach(_=>o.push(_));return}i.sort((_,R)=>_.edge.selfLoop.order-R.edge.selfLoop.order);let[s,d,f]=i,c=s.edge.originalEdge??d.edge.originalEdge??f.edge.originalEdge??d.edge,l=e.node(c.start);if(!l){i.forEach(_=>o.push(_));return}let h={width:d.edge.width,height:d.edge.height},m=st(e,l,i,c.start,a),g=dt(l,m,r,h.width??0),v=ft(l,g,m,r,h),p={...d.edge,...c,id:c.id,points:g,start:c.start,end:c.end,x:v.x,y:v.y,width:h.width,height:h.height,labelStyle:d.edge.labelStyle,fromCluster:s.edge.fromCluster??d.edge.fromCluster??f.edge.fromCluster,toCluster:s.edge.toCluster??d.edge.toCluster??f.edge.toCluster};delete p.selfLoop,delete p.originalEdge,o.push({edge:p,start:p.start,end:p.end})}),o},"getEdgesToRender"),Gr=E(async({element:e,graph:r,diagramType:n,id:t,parentCluster:o,siteConfig:a})=>{let i=r.graph().rankdir;w.trace("Dir in recursive render - dir:",i);let{clusters:s,edgePaths:d,edgeLabels:f,nodes:c,rootGroups:l}=Ge(e,{edgePathsClass:"edgePaths"});r.nodes()?w.info("Recursive render XXX",r.nodes()):w.info("No nodes found for",r),r.edges().length>0&&w.info("Recursive edges",r.edge(r.edges()[0]));let h=at(n);await Promise.all(r.nodes().map(async function(v){let p=r.node(v);if(o!==void 0){let _=JSON.parse(JSON.stringify(o.clusterData));w.trace(`Setting data for parent cluster XXX
2
+ Node.id = `,v,`
3
+ data=`,_.height,`
4
+ Parent cluster`,o.height),r.setNode(o.id,_),r.parent(v)||(w.trace("Setting parent",v,o.id),r.setParent(v,o.id,_))}if(w.info("(Insert) Node XXX"+v+": "+JSON.stringify(r.node(v))),p?.clusterNode){w.info("Cluster identified XBX",v,p.width,r.node(v));let{ranksep:_,nodesep:R}=r.graph();p.graph.setGraph({...p.graph.graph(),ranksep:_+25,nodesep:R});let ke=await pt({element:c,graph:p.graph,diagramType:n,id:t,parentCluster:r.node(v),siteConfig:a}),Le=ke.elem;Ie(p,Le),p.diff=ke.diff||0,w.info("New compound node after recursive render XAX",v,"width",p.width,"height",p.height),Se(Le,p)}else r.children(v).length>0?(w.trace("Cluster - the non recursive path XBX",v,p.id,p,p.width,"Graph:",r),w.trace(ie(p.id,r)),C.set(p.id,{id:ie(p.id,r),node:p})):(w.trace("Node - the non recursive path XAX",v,c,r.node(v),i),await Ae(c,r.node(v),{config:a,dir:i}))})),await E(async()=>{let v=r.edges().map(async function(p){let _=r.edge(p.v,p.w,p.name);if(w.info("Edge "+p.v+" -> "+p.w+": "+JSON.stringify(p)),w.info("Edge "+p.v+" -> "+p.w+": ",p," ",JSON.stringify(r.edge(p))),w.info("Fix",C,"ids:",p.v,p.w,"Translating: ",C.get(p.v),C.get(p.w)),h&&_.selfLoop){if(_.selfLoop.order!==1)return;let R={..._.originalEdge,..._,id:_.selfLoop.id,startLabelLeft:_.originalEdge?.startLabelLeft??_.startLabelLeft,startLabelRight:_.originalEdge?.startLabelRight??_.startLabelRight,endLabelLeft:_.originalEdge?.endLabelLeft??_.endLabelLeft,endLabelRight:_.originalEdge?.endLabelRight??_.endLabelRight};await te(f,R),_.width=R.width,_.height=R.height,_.labelStyle=R.labelStyle;return}await te(f,_)});await Promise.all(v)},"processEdges")();let{subGraphTitleTotalMargin:g}=Oe(a);return{elem:l,graph:r,groups:{clusters:s,edgePaths:d,edgeLabels:f,nodes:c,rootGroups:l},diagramType:n,id:t,mergeSelfLoops:h,subGraphTitleTotalMargin:g}},"measureDagreGraph"),Ar=E(e=>{w.info("############################################# XXX"),w.info("### Layout ### XXX"),w.info("############################################# XXX"),xe(e)},"runDagreGraphLayout"),ct=E((e,r,n)=>{let t=e.node(r);if(!t)return;let o={...t};return t?.clusterNode?o.y=(t.y??0)+n:e.children(r).length>0?o.height=(t.height??0)+n:o.y=(t.y??0)+n/2,o},"normalizeDagreNode"),Br=E((e,r)=>{it.forEach(n=>{r[n]!==void 0&&(e[n]=r[n])})},"applyDagreNodeLayout"),ut=E((e,r,n,t)=>({...e,start:e.start??r,end:e.end??n,points:(e.points??[]).map(o=>({...o,y:typeof o.y=="number"?o.y+t:o.y}))}),"normalizeDagreEdge"),lt=E((e,r)=>{let{graph:n,mergeSelfLoops:t,subGraphTitleTotalMargin:o=0}=r,a=new Map(e.nodes.map(s=>[s.id,s]));Q(n).forEach(s=>{let d=ct(n,s,o);if(!d)return;Br(n.node(s),d);let f=a.get(s);f&&Br(f,d)});let i=o/2;return e.edges=Xr(n,i,{mergeSelfLoops:t}).map(({edge:s,start:d,end:f})=>ut(s,d,f,i)),e},"applyDagreLayoutResult"),ht=E(async({elem:e,graph:r,groups:{clusters:n,edgePaths:t},diagramType:o,id:a,mergeSelfLoops:i,subGraphTitleTotalMargin:s})=>{let d=0;await Promise.all(Q(r).map(async function(l){let h=r.node(l);if(w.info("Position XBX => "+l+": ("+h.x,","+h.y,") width: ",h.width," height: ",h.height),h?.clusterNode)h.y+=s,w.info("A tainted cluster node XBX1",l,h.id,h.width,h.height,h.x,h.y,r.parent(l)),C.get(h.id).node=h,ne(h);else if(r.children(l).length>0){w.info("A pure cluster node XBX1",l,h.id,h.x,h.y,h.width,h.height,r.parent(l)),h.height+=s,r.node(h.parentId);let m=h?.padding/2||0,g=h?.labelBBox?.height||0,v=g-m||0;w.debug("OffsetY",v,"labelHeight",g,"halfPadding",m),await Pe(n,h),C.get(h.id).node=h}else{let m=r.node(h.parentId);h.y+=s/2,w.info("A regular node XBX1 - using the padding",h.id,"parent",h.parentId,h.width,h.height,h.x,h.y,"offsetY",h.offsetY,"parent",m,m?.offsetY,h),ne(h)}}));let f=s/2;return Xr(r,f,{mergeSelfLoops:i}).forEach(function({edge:l,start:h,end:m}){w.info("Edge "+h+" -> "+m+": "+JSON.stringify(l),l),l.points.forEach(_=>_.y+=f);let g=r.node(h),v=r.node(m),p=Re(t,l,C,o,g,v,a);Ce(l,p)}),r.nodes().forEach(function(l){let h=r.node(l);w.info(l,h.type,h.diff),h.isGroup&&(d=h.diff)}),w.warn("Returning from recursive render XAX",e,d),{elem:e,diff:d}},"paintDagreLayoutCore"),pt=E(async e=>{let r=await Gr(e);return Ar(r.graph),await ht(r)},"renderDagreSubgraph"),Fr=E(e=>{let r=new x({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.nodeSpacing||e.config?.flowchart?.nodeSpacing,ranksep:e.config?.rankSpacing||e.rankSpacing||e.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return e.nodes.forEach(n=>{r.setNode(n.id,{...n}),n.parentId&&r.setParent(n.id,n.parentId)}),w.debug("Edges:",e.edges),e.edges.forEach(n=>{if(n.start===n.end){let t=n.start,o=t+"---"+t+"---1",a=t+"---"+t+"---2",i=r.node(t);r.setNode(o,{domId:o,id:o,parentId:i.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),r.setParent(o,i.parentId),r.setNode(a,{domId:a,id:a,parentId:i.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),r.setParent(a,i.parentId);let s=structuredClone(n),d=structuredClone(n),f=structuredClone(n),c=structuredClone(n);d.originalEdge=s,d.selfLoop={id:s.id,order:0},f.originalEdge=s,f.selfLoop={id:s.id,order:1},c.originalEdge=s,c.selfLoop={id:s.id,order:2},d.label="",d.arrowTypeEnd="none",d.endLabelLeft="",d.endLabelRight="",d.startLabelLeft="",d.id=t+"-cyclic-special-1",f.startLabelRight="",f.startLabelLeft="",f.endLabelLeft="",f.endLabelRight="",f.arrowTypeStart="none",f.arrowTypeEnd="none",f.id=t+"-cyclic-special-mid",c.label="",c.startLabelRight="",c.startLabelLeft="",c.arrowTypeStart="none",i.isGroup&&(d.fromCluster=t,c.toCluster=t),c.id=t+"-cyclic-special-2",c.arrowTypeStart="none",r.setEdge(t,o,d,t+"-cyclic-special-0"),r.setEdge(o,a,f,t+"-cyclic-special-1"),r.setEdge(a,t,c,t+"-cyclic-special-2")}else r.setEdge(n.start,n.end,{...n},n.id)}),Fe(r),{graph:r}},"prepareLayoutForDagre"),mt=E(async(e,{element:r,preparedLayout:n})=>{let t=n??Fr(e),o=Ne(),a=await Gr({element:r,graph:t.graph,diagramType:e.type,id:e.diagramId,parentCluster:void 0,siteConfig:o});return t.measuredLayout=a,a},"measureDagreLayout"),vt=E((e,r)=>{let n=r.preparedLayout?.measuredLayout;if(!n)throw new Error("runDagreLayoutCore requires measureDagreLayout to run first");return Ar(n.graph),lt(e,n),n},"runDagreLayoutCore"),gt=E((e,{measure:r})=>Q(r.graph).map(n=>r.graph.node(n)).filter(Boolean),"getDagrePaintNodes"),_t=E((e,r,{measure:n})=>e?n.graph.node(e):void 0,"getDagreEdgeNode"),ya=Ve({prepareLayout:Fr,measureLayout:mt,runLayoutCore:vt,paintOptions:{clusterDb:C,getNodes:gt,getEdgeNode:_t,skipNode:E((e,{measure:r})=>!r.graph.hasNode(e.id),"skipNode"),isCluster:E((e,{measure:r})=>r.graph.hasNode(e.id)&&(r.graph.children(e.id)??[]).length>0,"isCluster")}});export{lt as applyDagreLayoutResult,Xr as getEdgesToRender,mt as measureDagreLayout,Fr as prepareLayoutForDagre,ya as render,vt as runDagreLayoutCore};
@@ -0,0 +1,200 @@
1
+ import{a as D1}from"./chunk-NBH7YOBD.js";import{a as _1}from"./chunk-DQVO43GU.js";import{a as v1}from"./chunk-GZYY6JMP.js";import{a as Ut,b as jt}from"./chunk-JRAHLUQM.js";import{b as S1,c as x1}from"./chunk-QQZBUVKZ.js";import"./chunk-25KVF5ZE.js";import"./chunk-5TQRX2ND.js";import"./chunk-6ZAAIG6Q.js";import"./chunk-QHMFFOZZ.js";import{h as T1}from"./chunk-ZAERIUBF.js";import{h as C1}from"./chunk-ZDOBOOWG.js";import"./chunk-YORIST7Z.js";import"./chunk-PM2IFX5O.js";import"./chunk-PN62QGJW.js";import"./chunk-DSKRGV6V.js";import{b as k1,c as m1,d as A1,f as E1}from"./chunk-HIGPS4L2.js";import{q as It,t as Lt}from"./chunk-22D53RF2.js";import"./chunk-STBOPOHX.js";import{$ as ce,O as u1,U as l1,V as c1,W as d1,X as h1,Y as p1,Z as f1,_ as g1,a as n1,aa as Gt,b as a1,ba as b1,g as o1}from"./chunk-AECJS4LP.js";import{b as ie,h as Vt}from"./chunk-4HYFSIZT.js";import{a as A}from"./chunk-EIBFAW37.js";import"./chunk-PHKIAKHS.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"},z1=new Set([et.SHAPE_UNSUPPORTED,et.SHAPE_REMOVED,et.CONTAINMENT_VIOLATION]),vs=new Set(Object.values(et).filter(e=>!z1.has(e))),W1=new Map([["task","roundedRect"],["tool","subroutine"],["input","lean-right"],["decision","diamond"],["refdoc","lin-doc"],["action","hexagon"],["round","rect"]]),K1=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"]),H1=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&&(W1.get(e)??e)}A($e,"resolveShapeAlias");function V1(e,i){for(let r of e)if(!r.isGroup){if((!r.shape||r.shape==="squareRect"||r.shape==="rect")&&(r.shape=Ze),K1.has(r.shape)){let n=`shape "${r.shape}" was removed in v0.8.1, using "${Ze}"`;i?.emitError?i.emitError("SHAPE_REMOVED",n,{nodeId:r.id}):ie.warn(`agentflow: ${n}`),r.shape=Ze;continue}if(!H1.has(r.shape)){let n=`shape "${r.shape}" is not supported, using "${Ze}"`;i?.emitWarning?i.emitWarning("SHAPE_UNSUPPORTED",n,{nodeId:r.id}):ie.warn(`agentflow: ${n}`),r.shape=Ze}}}A(V1,"normaliseNodeShapes");var Mt=new Map([["tool",0],["task",1],["decision",2],["input",3],["refdoc",4],["connector",5],["action",6]]),I1=Mt.size,L1=A(e=>`af-kind-${e}`,"kindClass"),Y1=[...Mt.keys()],B1=A(e=>Math.max(1,e-I1),"containerSlotCount"),M1=A((e,i)=>{let r=I1+e%B1(i);return i>0?r%i:r},"containerSlot");function y1(e,i,r){let n=ce().themeVariables?.borderColorArray,u=Array.isArray(n)?n.length:0,l=r.size;for(let a of e??[]){if(a.isGroup||a.shape==="collapsedGroup"){let f=r.get(String(a.id))??l++;a.colorIndex=M1(f,u);continue}let c=i(String(a.id));c&&Mt.has(c)&&(a.cssClasses=`${a.cssClasses??""} ${L1(c)}`.replace(/\s+/g," ").trim())}}A(y1,"assignColorSlots");var F1="agentflow-",zt=new Set(["shape","view","icon","img","form","pos","w","h","class","style","labelType"]),q1=new Set(["subroutine","subprocess","subproc","framed-rectangle","tool"]),X1={flow:"flowGroup"};function Bt(e){if(Array.isArray(e))return e.map(r=>Bt(r));if(e===null||typeof e!="object")return e;let i={};for(let r of Object.keys(e))r==="__proto__"||r==="constructor"||r==="prototype"||(i[r]=Bt(e[r]));return i}A(Bt,"stripPrototypeKeys");function w1(e){let i=!1,r=!1,n=0,u,l=[];for(let a of e.split(`
2
+ `)){if(u!==void 0){let 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++){let k=a[g];if(r)k==="\\"?g++:k==='"'&&(r=!1);else if(i)k==="'"&&(i=!1);else if(k==='"')r=!0;else if(k==="'")i=!0;else if(k==="#"&&(g===0||a[g-1]===" "||a[g-1]===" ")){c=g;break}else k==="["||k==="{"?n++:(k==="]"||k==="}")&&(n=Math.max(0,n-1))}if(i||r||n>0){l.push(a);continue}let 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
+ `)}A(w1,"stripLineTrailingCommas");var Q1=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=c1,this.setAccDescription=h1,this.setDiagramTitle=f1,this.getAccTitle=d1,this.getAccDescription=p1,this.getDiagramTitle=g1,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{A(this,"AgentFlowDB")}sanitizeText(e){return u1.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(let 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,r,n,u,l,a={},c,f){if(!e||e.trim().length===0)return;let p;if(c!==void 0){let b;c.includes(`
4
+ `)?b=c+`
5
+ `:b=`{
6
+ `+c+`
7
+ }`;try{p=jt(b,{schema:Ut})??{}}catch(d){let h=c.includes(`
8
+ `)?w1(c):c;if(h!==c)try{p=jt(h+`
9
+ `,{schema:Ut})??{}}catch{this.rethrowMetadataYamlError(d,c,f)}else this.rethrowMetadataYamlError(d,c,f)}p=Bt(p)}let g;if(p&&typeof p.shape=="string"){let b=p;g=b.shape;let d=$e(g);d&&d!==g&&(b.shape=d)}let k=this.subGraphLookup.get(e);if(k&&p){k.metadata={...k.metadata,...p};return}let v=this.connectors.get(e);if(v&&p){v.metadata={...v.metadata,...p};return}if(e==="connectors")return;let S=this.edges.find(b=>b.id===e);if(S){let b=p;b?.animate!==void 0&&(S.animate=b.animate),b?.animation!==void 0&&(S.animation=b.animation),b?.curve!==void 0&&(S.interpolate=b.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:F1+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),r!==void 0&&(T.type=r),n?.forEach(b=>{T.styles.push(b)}),u?.forEach(b=>{T.classes.push(b)}),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){let b=g??p.shape;if(typeof b!="string")throw this.positionedShapeError(`No such shape: ${JSON.stringify(b)}.`,f);if(b!==b.toLowerCase()||b.includes("_"))throw this.positionedShapeError(`No such shape: ${b}. Shape names should be lowercase.`,f);if(!C1(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){let r=new Error(e);if(!i)return r;let n=i.first_line+this.frontmatterLineOffset;return Object.assign(r,{hash:{text:"",token:null,line:n-1,loc:{first_line:n,last_line:i.last_line+this.frontmatterLineOffset,first_column:i.first_column,last_column:i.last_column},expected:[]}}),r}rethrowMetadataYamlError(e,i,r){let n=e;if(!n||n.name!=="YAMLException"||!n.mark||!r)throw e;let u;try{let l=!i.includes(`
10
+ `),a=l?`{
11
+ `+i+`
12
+ }`:i+`
13
+ `,c=r.first_line+this.frontmatterLineOffset,f=r.first_column+2,p=A((b,d)=>l?{line:c,column:f+(b===1?d:0)}:{line:c+b,column:b===0?f+d:d},"toSource"),g=p(n.mark.line,n.mark.column),k=n.reason??(n.message??"").split(`
14
+ `)[0].replace(/\s*\(\d+:\d+\)\s*$/,""),v=a.split(`
15
+ `),S=[];if(l)S.push(1);else for(let b=n.mark.line-1;b<=n.mark.line+1;b++)b<0||b>=v.length||b===v.length-1&&v[b]===""&&b!==n.mark.line||S.push(b);let B=Math.max(...S.map(b=>String(p(b,0).line).length)),T=[];for(let b of S){let d=p(b,0).line,h=` ${String(d).padStart(B)} | `;T.push(h+v[b].replace(/\t/g,"\u2192")),b===n.mark.line&&T.push("-".repeat(h.length+n.mark.column)+"^")}u={message:`${k} (${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&&(n.message=u.message,n.mark.line=u.markLine,n.mark.column=u.markColumn,n.hash=u.hash),n}addSingleLink(e,i,r,n){let a={start:e,end:i,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};ie.info("abc78 Got edge...",a);let c=r.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)),r!==void 0&&(a.type=r.type,a.stroke=r.stroke,a.length=r.length>10?10:r.length,r.edgeSemantic&&(a.edgeSemantic=r.edgeSemantic)),n&&!this.edges.some(f=>f.id===n))a.id=n,a.isUserDefinedId=!0;else{let f=this.edges.filter(p=>p.start===a.start&&p.end===a.end);f.length===0?a.id=Lt(a.start,a.end,{counter:0,prefix:"L"}):a.id=Lt(a.start,a.end,{counter:f.length+1,prefix:"L"})}if(this.edges.length<(this.config.maxEdges??500))ie.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,r){let n=this.isLinkData(r)?r.id.replace("@",""):void 0;ie.info("addLink",e,i,n);for(let u of e)for(let l of i){let a=u===e[e.length-1],c=l===i[0];a&&c?this.addSingleLink(u,l,r,n):this.addSingleLink(u,l,r,void 0)}}updateLinkInterpolate(e,i){e.forEach(r=>{if(r==="default"){this.edges.defaultInterpolate=i;return}if(typeof r=="number"&&r>=this.edges.length)throw new Error(`The index ${r} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);this.edges[r].interpolate=i})}updateLink(e,i){e.forEach(r=>{if(typeof r=="number"&&r>=this.edges.length)throw new Error(`The index ${r} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);r==="default"?this.edges.defaultStyle=i:(this.edges[r].style=i,(this.edges[r]?.style?.length??0)>0&&!this.edges[r]?.style?.some(n=>n?.startsWith("fill"))&&this.edges[r]?.style?.push("fill:none"))})}addClass(e,i){let r=i.join().replace(/\\,/g,"\xA7\xA7\xA7").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach(n=>{let u=this.classes.get(n);u===void 0&&(u={id:n,styles:[],textStyles:[]},this.classes.set(n,u)),r?.forEach(l=>{if(/color/.exec(l)){let 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(let r of e.split(",")){let n=this.vertices.get(r);n&&n.classes.push(i);let u=this.edges.find(a=>a.id===r);u&&u.classes.push(i);let l=this.subGraphLookup.get(r);l&&l.classes.push(i)}}setTooltip(e,i){if(i!==void 0){i=this.sanitizeText(i);for(let r of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(r):r,i)}}setClickFun(e,i,r){if(ce().securityLevel!=="loose"||i===void 0)return;let n=[];if(typeof r=="string"){n=r.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let l=0;l<n.length;l++){let a=n[l].trim();a.startsWith('"')&&a.endsWith('"')&&(a=a.substr(1,a.length-2)),n[l]=a}}n.length===0&&n.push(e);let u=this.vertices.get(e);u&&(u.haveCallback=!0,this.funs.push(()=>{let l=this.lookUpDomId(e),a=document.querySelector(`[id="${l}"]`);a!==null&&a.addEventListener("click",()=>{It.runFunc(i,...n)},!1)}))}setLink(e,i,r){e.split(",").forEach(n=>{let u=this.vertices.get(n);u!==void 0&&(u.link=It.formatUrl(i,this.config),u.linkTarget=r)}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,i,r){e.split(",").forEach(n=>{this.setClickFun(n,i,r)}),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 q1.has(e.type)}getTools(){let e=[];for(let i of this.vertices.values())this.isToolDefinition(i)&&e.push(i);return e}getClasses(){return this.classes}setupToolTips(e){let i=T1();Vt(e).select("svg").selectAll("g.node").on("mouseover",u=>{let l=Vt(u.currentTarget),a=l.attr("title");if(a===null)return;let 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(o1.sanitize(a)),l.classed("hover",!0)}).on("mouseout",u=>{i.transition().duration(500).style("opacity",0),Vt(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,l1()}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,r,n){let u=e?.text?.trim(),l=r?.text;e===r&&r?.text&&/\s/.exec(r.text)&&(u=void 0);let c=A(S=>{let B={boolean:{},number:{},string:{}},T=[],b;return{nodeList:S.filter(function(h){let x=typeof h;return h.stmt&&h.stmt==="dir"?(b=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:b}},"uniq")(i.flat()),f=c.nodeList,p=c.dir,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;let k={id:u,nodes:f.filter(S=>S!==u&&!this.globalNodes.has(S)),title:l.trim(),classes:[],dir:p,labelType:this.sanitizeNodeLabelType(r?.type),type:n??"flow"};ie.info("Adding",k.id,k.nodes,k.dir),k.nodes=this.makeUniq(k,this.subGraphs).nodes;let v=this.getPosForId(u);if(v!==-1){let S=this.subGraphs[v];for(let B of k.nodes)S.nodes.includes(B)||S.nodes.push(B);k.title&&(S.title=k.title),k.dir&&(S.dir=k.dir),k.type&&(S.type=k.type),this.subGraphLookup.set(u,S)}else this.subGraphs.push(k),this.subGraphLookup.set(u,k);return u}addGlobal(e){for(let i of e.flat()){if(typeof i!="string")continue;let r=i.trim();r!==""&&this.globalNodes.add(r)}for(let i of this.subGraphs)i.nodes=i.nodes.filter(r=>!this.globalNodes.has(r))}getPosForId(e){for(let[i,r]of this.subGraphs.entries())if(r.id===e)return i;return-1}indexNodes2(e,i){let r=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 n=0,u=1;for(;n<r.length;){let l=this.getPosForId(r[n]);if(l>=0){let a=this.indexNodes2(e,l);if(a.result)return{result:!0,count:u+a.count};u=u+a.count}n=n+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){let r=e?.text?.trim();if(!r)return"";let n=i?.text?.trim()??"",u=n.length>0?this.sanitizeText(n):r,l=this.connectors.get(r);return l?n.length>0&&(l.text=u):(l={id:r,labelType:"text",domId:F1+r+"-"+this.vertexCounter,styles:[],classes:[],isConnector:!0,text:u},this.connectors.set(r,l),this.vertices.set(r,l),this.vertexCounter++),r}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){let i=e.trim(),r="arrow_open",n="normal";return i.includes(".")&&(n="dotted"),{type:r,stroke:n}}countChar(e,i){let r=i.length,n=0;for(let u=0;u<r;++u)i[u]===e&&++n;return n}destructEndLink(e){let i=e.trim(),r=i.slice(0,-1),n="arrow_open";switch(i.slice(-1)){case"x":n="arrow_cross";break;case">":n="arrow_point";break;case"-":case".":n="arrow_open",r=i;break}let u="normal",l=r.length-1,a=this.countChar(".",r);return a>0&&(u="dotted",l=a),{type:n,stroke:u,length:l}}destructLink(e,i){let r=this.destructEndLink(e),n;return i?(n=this.destructStartLink(i),n.stroke!==r.stroke?{type:"INVALID",stroke:"INVALID"}:(n.type=r.type,n.length=r.length,{...n,edgeSemantic:this.computeEdgeSemantic(n.type,n.stroke)})):{...r,edgeSemantic:this.computeEdgeSemantic(r.type,r.stroke)}}exists(e,i){for(let r of e)if(r.nodes.includes(i))return!0;return!1}makeUniq(e,i){let r=[];return e.nodes.forEach((n,u)=>{this.exists(i,n)||r.push(e.nodes[u])}),{nodes:r}}getTypeFromVertex(e){let 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(r=>r.id===i)}destructEdgeType(e){let i="none",r="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":case"arrow_hierarchy":r=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":i=e.replace("double_",""),r=i;break}return{arrowTypeStart:i,arrowTypeEnd:r}}addNodeFromVertex(e,i,r,n,u,l){let a=r.get(e.id),c=n.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{let 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(let r of e){let n=this.classes.get(r);n?.styles&&(i=[...i,...n.styles??[]].map(u=>u.trim())),n?.textStyles&&(i=[...i,...n.textStyles??[]].map(u=>u.trim()))}return i}runPostParseValidators(){this.postParseValidationRun||(this.postParseValidationRun=!0)}getData(){this.runPostParseValidators();let e=ce(),i=[],r=[],n=this.getSubGraphs(),u=new Map,l=new Map,a=new Set,c=new Map,f=A((d,h,x=new Set)=>{if(x.has(d))return;x.add(d);let N=this.subGraphLookup.get(d);if(N)for(let te of N.nodes)te===h||x.has(te)||(a.add(te),c.set(te,h),f(te,h,x))},"collectDescendants");for(let d of n)d.metadata?.view==="collapsed"&&!a.has(d.id)&&f(d.id,d.id);let p=A((d,h)=>{let x=new Set,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=n.length-1;d>=0;d--){let h=n[d];if(!a.has(h.id)){h.nodes.length>0&&l.set(h.id,!0);for(let 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=n.length-1;d>=0;d--){let h=n[d];if(a.has(h.id))continue;if(h.metadata?.view==="collapsed"){let 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:X1[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")});let k=this.getEdges();k.forEach((d,h)=>{let x=c.get(d.start)??d.start,N=c.get(d.end)??d.end;if(x===N&&d.start!==d.end)return;let{arrowTypeStart:te,arrowTypeEnd:de}=this.destructEdgeType(d.type),ue=[...k.defaultStyle??[]];d.style&&ue.push(...d.style);let he={id:Lt(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};r.push(he)}),V1(i,this);let v=new Map,S=new Map;for(let d of n){let h=u.get(d.id);h!==void 0&&S.set(h,[...S.get(h)??[],d.id])}let B=0,T=A(d=>{if(!v.has(d)){v.set(d,B++);for(let h of S.get(d)??[])T(h)}},"walkContainers");for(let d of n)u.get(d.id)===void 0&&T(d.id);let b=new Set(this.getConnectors().map(d=>d.id));return y1(i,d=>{if(b.has(d))return"connector";let h=this.vertices.get(d);return h?this.deriveVertexKind(h,$e(h.type)):void 0},v),{nodes:i,edges:r,other:{},config:e,connectors:this.getConnectors()}}defaultConfig(){return b1.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();let e=new Set(this.subGraphs.map(a=>a.id)),i=[],r=[];for(let[a,c]of this.vertices){if(e.has(a))continue;if(c.isConnector){let g={id:a};if(c.text!==void 0&&c.text!==a&&(g.title=c.text),c.metadata&&Object.keys(c.metadata).length>0){let k={};for(let[v,S]of Object.entries(c.metadata))zt.has(v)||(k[v]=S);Object.keys(k).length>0&&(g.metadata=k)}r.push(g);continue}let f={id:a};c.text!==void 0&&(f.label=c.text);let 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){let g={};for(let[k,v]of Object.entries(c.metadata))zt.has(k)||(g[k]=v);Object.keys(g).length>0&&(f.metadata=g)}i.push(f)}let n=this.edges.map(a=>{let 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=>{let 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){let f={};for(let[p,g]of Object.entries(a.metadata))zt.has(p)||(f[p]=g);Object.keys(f).length>0&&(c.metadata=f)}return c}),l={vertices:i,edges:n,subGraphs:u,connectors:r,diagnostics:this.diagnostics};return this.direction!==void 0&&(l.direction=this.direction),l}setFrontmatterLineOffset(e){this.frontmatterLineOffset=e??0}toElementPosition(e){let i=e?.first_line??0,r=e?.first_column??0,n=e?.last_line??i,u=e?.last_column??r,[l,a]=e?.range??[0,0];return{startLine:i+this.frontmatterLineOffset,startColumn:r,endLine:n+this.frontmatterLineOffset,endColumn:u,startIndex:l,endIndex:a}}pushMapping(e,i,r){if(!e)return;let n={id:e,type:i,position:this.toElementPosition(r)};return this.elementMappings.push(n),n}addVertexMapping(e,i,r,n){let u=this.pushMapping(e,"vertex",n);u&&r==null&&this.bareVertexMappings.add(u)}extendVertexMapping(e,i){if(!e||!i)return;let r=this.toElementPosition(i);for(let n=this.elementMappings.length-1;n>=0;n--){let u=this.elementMappings[n];if(u.type==="vertex"&&u.id===e){this.bareVertexMappings.has(u)&&(u.type="attachment",this.bareVertexMappings.delete(u)),(r.endLine>u.position.endLine||r.endLine===u.position.endLine&&r.endColumn>u.position.endColumn)&&(u.position.endLine=r.endLine,u.position.endColumn=r.endColumn,u.position.endIndex=r.endIndex);return}}this.pushMapping(e,"attachment",i)}addEdgeMapping(e,i,r,n){let 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",n)}addSubgraphMapping(e,i,r,n){let u=(typeof e=="string"?e:e?.text)??"",l=this.toElementPosition(r),a=n?this.toElementPosition(n):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,r,n){let u=e?.text?.trim()??"";if(!u)return;let l=this.toElementPosition(r),a=n?this.toElementPosition(n):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){let r=this.elementMappings.filter(u=>{let{startLine:l,startColumn:a,endLine:c,endColumn:f}=u.position;return!(e<l||e>c||e===l&&i<a||e===c&&i>f)});if(r.length===0)return;let n=A(({position:u})=>[u.endLine-u.startLine,u.endColumn-u.startColumn],"span");return r.reduce((u,l)=>{let[a,c]=n(u),[f,p]=n(l);return f!==a?f<a?l:u:p<c?l:u})}getMappingStats(){let e=0,i=0,r=0,n=0,u=0;for(let l of this.elementMappings)l.type==="vertex"?e++:l.type==="edge"?i++:l.type==="subgraph"?r++:l.type==="connector"?n++:l.type==="attachment"&&u++;return{vertices:e,edges:i,subgraphs:r,connectors:n,attachments:u,totalElements:this.elementMappings.length}}emitDiagnostic(e,i,r,n){let u=n?.nodeId??n?.edgeId,l=u?this.getElementById(u):void 0,a={id:e,severity:i,message:r,...n?.nodeId?{nodeId:n.nodeId}:{},...n?.edgeId&&!n?.nodeId?{edgeId:n.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);let f=`agentflow[${e}]: ${r}`;i==="error"?ie.error(f):ie.warn(f)}emitWarning(e,i,r){this.emitDiagnostic(e,"warning",i,r)}emitError(e,i,r){this.emitDiagnostic(e,"error",i,r)}getDiagnostics(){return[...this.diagnostics]}},J1=A(function(e,i){return i.db.getClasses()},"getClasses"),Z1=A(async function(e,i,r,n){ie.debug("Drawing agentflow diagram",i);let{securityLevel:u,agentflow:l,layout:a}=ce();n.db.setDiagramId(i),ie.debug("Before getData: ");let c=n.db.getData();ie.debug("Data: ",c);let f=_1(i,u),p=n.db.getDirection();c.type=n.type,c.layoutAlgorithm=x1(a),c.layoutAlgorithm==="dagre"&&a==="elk"&&ie.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,ie.debug("REF1:",c),await S1(c,f);let g=l?.diagramPadding??8;It.insertTitle(f,"agentflowTitleText",l?.titleTopMargin??0,n.db.getDiagramTitle()),v1(f,g,"agentflow",l?.useMaxWidth??!0)},"draw"),$1={getClasses:J1,draw:Z1},Wt=(function(){var e=A(function(Te,m,E,C){for(E=E||{},C=Te.length;C--;E[Te[C]]=m);return E},"o"),i=[1,5],r=[1,4],n=[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],k=[1,19],v=[1,26],S=[1,27],B=[1,28],T=[1,30],b=[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],J=[1,70],Z=[1,68],$=[1,67],ee=[1,69],Me=[8,9,10,12,78,80,81],ye=[1,88],we=[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],re=[8,9,10,11,12,30,43,47,49,51,53,55,57,59,61,63,66,68,70,71,73,78,80,81,92,105,108,109,112,114,117,118,119],Kt=[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],Ht=[1,131],Yt=[1,132],tt=[1,134],st=[1,133],qt=[47,63,65,77,92,105,108,109,112,114,117,118,119],it=[1,143],rt=[1,157],nt=[1,158],at=[1,159],ot=[1,162],ut=[1,161],lt=[1,160],ct=[1,145],dt=[1,147],ht=[1,151],Xt=[1,139],Qt=[1,140],pt=[1,152],ft=[1,153],gt=[1,154],bt=[1,155],kt=[1,156],mt=[1,163],At=[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],Jt=[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],F=[1,190],X=[1,186],Q=[1,187],V=[1,191],I=[1,188],L=[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],Zt=[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],be=[1,265],ke=[1,266],me=[1,268],Ae=[1,270],Ee=[1,272],Qe=[1,292],$t=[8,9,10,12,109],le=[8,9,10,11,12,63,87,108,109,112,113,114,115],yt={trace:A(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:A(function(m,E,C,o,y,t,_){var s=t.length-1;switch(y){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],_[s-8],_[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],_[s-3]),o.addSubgraphMapping&&o.addSubgraphMapping(t[s-7],t[s-5],_[s-9],_[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"},_[s-5],_[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],_[s-3]),o.addSubgraphMapping&&o.addSubgraphMapping(t[s-4],{text:"",type:"text"},_[s-6],_[s]);break;case 42:this.$=o.addSubGraph(void 0,t[s-1],void 0,"flow"),o.addSubgraphMapping&&o.addSubgraphMapping(void 0,void 0,_[s-3],_[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],_[s-6],_[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],_[s-1]),o.addConnectorMapping&&o.addConnectorMapping(t[s-5],t[s-3],_[s-7],_[s]);break;case 46:this.$=o.addConnector(t[s-1],{text:"",type:"text"}),o.addConnectorMapping&&o.addConnectorMapping(t[s-1],{text:"",type:"text"},_[s-3],_[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],_[s-1]),o.addConnectorMapping&&o.addConnectorMapping(t[s-2],{text:"",type:"text"},_[s-4],_[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],_[s]),o.extendVertexMapping&&o.extendVertexMapping(t[s-1][t[s-1].length-1],_[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],_[s]),o.extendVertexMapping&&o.extendVertexMapping(t[s-1][t[s-1].length-1],_[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],_[s-4]),o.extendVertexMapping&&o.extendVertexMapping(t[s-5][t[s-5].length-1],_[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 w=o.destructLink(t[s],t[s-2]);this.$={type:w.type,stroke:w.stroke,length:w.length,edgeSemantic:w.edgeSemantic,text:t[s-1]};break;case 91:var w=o.destructLink(t[s],t[s-2]);this.$={type:w.type,stroke:w.stroke,length:w.length,edgeSemantic:w.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 w=o.destructLink(t[s]);this.$={type:w.type,stroke:w.stroke,length:w.length,edgeSemantic:w.edgeSemantic};break;case 97:var w=o.destructLink(t[s]);this.$={type:w.type,stroke:w.stroke,length:w.length,edgeSemantic:w.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:r,11:n,13:u},{1:[3]},e(l,a,{5:7}),{4:8,8:i,10:r,11:n,13:u},{4:9,8:i,10:r,11:n,13:u},{4:10,8:i,10:r,11:n,13:u},{14:[1,11],15:[1,12]},{1:[2,1],6:13,7:14,8:c,9:f,10:p,11:g,12:k,21:20,23:21,24:22,25:23,26:24,27:25,28:v,35:S,36:B,37:29,38:T,40:b,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:J,9:Z,10:$,12:ee,22:65,44:66,75:71,78:[1,72],80:[1,74],81:[1,73]},{8:J,9:Z,10:$,12:ee,22:75},{8:J,9:Z,10:$,12:ee,22:76},{8:J,9:Z,10:$,12:ee,22:77},{8:J,9:Z,10:$,12:ee,22:78},{8:J,9:Z,10:$,12:ee,22:79},{8:J,9:Z,10:$,11:[1,80],12:ee,22:81},{8:J,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:ye}),{11:[1,89]},{11:[1,90]},{11:[1,91]},{11:[1,92]},{15:we,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(re,[2,196]),e(re,[2,157]),e(re,[2,158]),e(re,[2,159]),e(re,[2,160]),e(re,[2,161]),e(re,[2,162]),e(re,[2,163]),e(re,[2,164]),e(re,[2,165]),e(re,[2,166]),e(re,[2,167]),e(l,[2,14]),e(l,[2,20]),e(l,[2,21]),{10:[1,123]},e(l,[2,23]),e(Kt,[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:Ht,84:Yt,119:tt,122:st},{78:[1,135],80:[1,136]},e(qt,[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:rt,15:nt,28:at,29:137,33:ot,35:ut,36:lt,47:ct,63:dt,78:ht,83:Xt,84:Qt,86:150,87:pt,88:ft,89:gt,90:bt,91:kt,92:mt,93:At,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:rt,15:nt,28:at,29:167,33:ot,35:ut,36:lt,47:ct,63:dt,78:ht,83:Xt,84:Qt,86:150,87:pt,88:ft,89:gt,90:bt,91:kt,92:mt,93:At,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:Jt}),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:we,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:F,83:X,84:Q,85:185,119:V,120:I,121:L},{31:192,70:F,83:X,84:Q,85:185,119:V,120:I,121:L},{31:194,53:[1,193],70:F,83:X,84:Q,85:185,119:V,120:I,121:L},{31:195,70:F,83:X,84:Q,85:185,119:V,120:I,121:L},{31:196,70:F,83:X,84:Q,85:185,119:V,120:I,121:L},{31:197,70:F,83:X,84:Q,85:185,119:V,120:I,121:L},{112:[1,198]},{31:199,70:F,83:X,84:Q,85:185,119:V,120:I,121:L},{31:200,68:[1,201],70:F,83:X,84:Q,85:185,119:V,120:I,121:L},{31:202,70:F,83:X,84:Q,85:185,119:V,120:I,121:L},{31:203,70:F,83:X,84:Q,85:185,119:V,120:I,121:L},{31:204,70:F,83:X,84:Q,85:185,119:V,120:I,121:L},e(re,[2,197]),e(l,[2,22]),e(Kt,[2,30]),e(Me,[2,59],{34:205,19:206,11:Se,43:ye}),e(He,[2,86],{11:[1,207]}),{11:[1,208]},{31:209,70:F,83:X,84:Q,85:185,119:V,120:I,121:L},{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:Ht,84:Yt,119:tt,122:st},e(qt,[2,97]),{8:J,9:Z,10:$,11:it,12:ee,13:rt,15:nt,22:214,28:at,30:[1,213],33:ot,34:215,35:ut,36:lt,43:ye,47:ct,63:dt,78:ht,86:150,87:pt,88:ft,89:gt,90:bt,91:kt,92:mt,93:At,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:k,21:20,23:21,24:22,25:23,26:24,27:25,28:v,33:[1,217],35:S,36:B,37:29,38:T,40:b,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:k,21:20,23:21,24:22,25:23,26:24,27:25,28:v,33:[1,218],35:S,36:B,37:29,38:T,40:b,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:J,9:Z,10:$,11:it,12:ee,13:rt,15:nt,22:220,28:at,30:[1,219],33:ot,34:221,35:ut,36:lt,43:ye,47:ct,63:dt,78:ht,86:150,87:pt,88:ft,89:gt,90:bt,91:kt,92:mt,93:At,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(Zt,[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:F,85:237,119:V,120:I,121:L},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:F,85:237,119:V,120:I,121:L},{31:239,70:F,83:X,84:Q,85:185,119:V,120:I,121:L},{54:[1,240],70:F,85:237,119:V,120:I,121:L},{56:[1,241],70:F,85:237,119:V,120:I,121:L},{58:[1,242],70:F,85:237,119:V,120:I,121:L},{60:[1,243],70:F,85:237,119:V,120:I,121:L},{63:[1,244]},{67:[1,245],70:F,85:237,119:V,120:I,121:L},{69:[1,246],70:F,85:237,119:V,120:I,121:L},{31:247,70:F,83:X,84:Q,85:185,119:V,120:I,121:L},{32:[1,248],70:F,85:237,119:V,120:I,121:L},{70:F,72:[1,249],74:[1,250],85:237,119:V,120:I,121:L},{70:F,72:[1,252],74:[1,251],85:237,119:V,120:I,121:L},e(Me,[2,58],{19:169,11:Se,43:qe}),e(Me,[2,60],{47:Jt}),e(He,[2,88]),e(He,[2,87]),{65:[1,253],70:F,85:237,119:V,120:I,121:L},e(He,[2,90]),e(Xe,[2,93]),{80:[1,254],82:211,119:tt,122:st},{31:255,70:F,83:X,84:Q,85:185,119:V,120:I,121:L},e(Ye,a,{5:256}),{8:J,9:Z,10:$,12:ee,22:257,43:qe},e(M,[2,117]),e(D,[2,42]),e(D,[2,43]),{31:258,70:F,83:X,84:Q,85:185,119:V,120:I,121:L},e(D,[2,46]),{8:J,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:be,110:263,111:264,112:ke,113:me,114:Ae,115:Ee},{11:pe,63:fe,87:ge,95:273,107:[1,274],108:be,110:263,111:264,112:ke,113:me,114:Ae,115:Ee},{11:pe,63:fe,87:ge,95:275,107:[1,276],108:be,110:263,111:264,112:ke,113:me,114:Ae,115:Ee},{108:[1,277]},{11:pe,63:fe,87:ge,95:278,108:be,110:263,111:264,112:ke,113:me,114:Ae,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:F,85:237,119:V,120:I,121:L},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:F,85:237,119:V,120:I,121:L},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:F,85:237,119:V,120:I,121:L},{6:13,7:14,8:c,9:f,10:p,11:g,12:k,21:20,23:21,24:22,25:23,26:24,27:25,28:v,33:[1,288],35:S,36:B,37:29,38:T,40:b,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:F,85:237,119:V,120:I,121:L},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:Qe}),e($t,[2,145],{111:293,11:pe,63:fe,87:ge,108:be,112:ke,113:me,114:Ae,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:Qe}),{11:[1,294]},e(R,[2,138],{109:Qe}),{11:[1,295]},e(Zt,[2,144]),e(R,[2,120],{109:Qe}),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:J,9:Z,10:$,12:ee,22:301,34:302,43:ye},e(D,[2,40]),{6:13,7:14,8:c,9:f,10:p,11:g,12:k,21:20,23:21,24:22,25:23,26:24,27:25,28:v,33:[1,303],35:S,36:B,37:29,38:T,40:b,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:J,9:Z,10:$,12:ee,22:304,34:305,43:ye},e(Ie,[2,65]),{11:pe,63:fe,87:ge,108:be,110:306,111:264,112:ke,113:me,114:Ae,115:Ee},e(le,[2,148]),{15:we,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:we,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:F,83:X,84:Q,85:185,119:V,120:I,121:L},e(q,[2,79]),e(Ye,a,{5:311}),{8:J,9:Z,10:$,12:ee,22:312,43:qe},e(D,[2,41]),e(D,[2,44]),{8:J,9:Z,10:$,12:ee,22:313,43:qe},e($t,[2,146],{111:293,11:pe,63:fe,87:ge,108:be,112:ke,113:me,114:Ae,115:Ee}),e(R,[2,141],{123:181,11:[1,314],15:we,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:we,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:F,85:237,119:V,120:I,121:L},{6:13,7:14,8:c,9:f,10:p,11:g,12:k,21:20,23:21,24:22,25:23,26:24,27:25,28:v,33:[1,317],35:S,36:B,37:29,38:T,40:b,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:be,110:263,111:264,112:ke,113:me,114:Ae,115:Ee},{11:pe,63:fe,87:ge,95:320,108:be,110:263,111:264,112:ke,113:me,114:Ae,115:Ee},e(q,[2,75]),e(D,[2,38]),{6:13,7:14,8:c,9:f,10:p,11:g,12:k,21:20,23:21,24:22,25:23,26:24,27:25,28:v,33:[1,321],35:S,36:B,37:29,38:T,40:b,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:Qe}),e(R,[2,140],{109:Qe}),e(D,[2,39])],defaultActions:{},parseError:A(function(m,E){if(E.recoverable)this.trace(m);else{var C=new Error(m);throw C.hash=E,C}},"parseError"),parse:A(function(m){var E=this,C=[0],o=[],y=[null],t=[],_=this.table,s="",w=0,e1=0,t1=0,P1=2,s1=1,G1=t.slice.call(arguments,1),Y=Object.create(this.lexer),Le={yy:{}};for(var wt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,wt)&&(Le.yy[wt]=this.yy[wt]);Y.setInput(m,Le.yy),Le.yy.lexer=Y,Le.yy.parser=this,typeof Y.yylloc>"u"&&(Y.yylloc={});var Nt=Y.yylloc;t.push(Nt);var U1=Y.options&&Y.options.ranges;typeof Le.yy.parseError=="function"?this.parseError=Le.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function j1(ae){C.length=C.length-2*ae,y.length=y.length-ae,t.length=t.length-ae}A(j1,"popStack");function i1(){var ae;return ae=o.pop()||Y.lex()||s1,typeof ae!="number"&&(ae instanceof Array&&(o=ae,ae=o.pop()),ae=E.symbols_[ae]||ae),ae}A(i1,"lex");for(var se,Rt,Be,oe,ns,Ot,Je={},vt,Ce,r1,Ft;;){if(Be=C[C.length-1],this.defaultActions[Be]?oe=this.defaultActions[Be]:((se===null||typeof se>"u")&&(se=i1()),oe=_[Be]&&_[Be][se]),typeof oe>"u"||!oe.length||!oe[0]){var Pt="";Ft=[];for(vt in _[Be])this.terminals_[vt]&&vt>P1&&Ft.push("'"+this.terminals_[vt]+"'");Y.showPosition?Pt="Parse error on line "+(w+1)+`:
23
+ `+Y.showPosition()+`
24
+ Expecting `+Ft.join(", ")+", got '"+(this.terminals_[se]||se)+"'":Pt="Parse error on line "+(w+1)+": Unexpected "+(se==s1?"end of input":"'"+(this.terminals_[se]||se)+"'"),this.parseError(Pt,{text:Y.match,token:this.terminals_[se]||se,line:Y.yylineno,loc:Nt,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),y.push(Y.yytext),t.push(Y.yylloc),C.push(oe[1]),se=null,Rt?(se=Rt,Rt=null):(e1=Y.yyleng,s=Y.yytext,w=Y.yylineno,Nt=Y.yylloc,t1>0&&t1--);break;case 2:if(Ce=this.productions_[oe[1]][1],Je.$=y[y.length-Ce],Je._$={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},U1&&(Je._$.range=[t[t.length-(Ce||1)].range[0],t[t.length-1].range[1]]),Ot=this.performAction.apply(Je,[s,e1,w,Le.yy,oe[1],y,t].concat(G1)),typeof Ot<"u")return Ot;Ce&&(C=C.slice(0,-1*Ce*2),y=y.slice(0,-1*Ce),t=t.slice(0,-1*Ce)),C.push(this.productions_[oe[1]][0]),y.push(Je.$),t.push(Je._$),r1=_[C[C.length-2]][C[C.length-1]],C.push(r1);break;case 3:return!0}}return!0},"parse")},O1=(function(){var Te={EOF:1,parseError:A(function(E,C){if(this.yy.parser)this.yy.parser.parseError(E,C);else throw new Error(E)},"parseError"),setInput:A(function(m,E){return this.yy=E||this.yy||{},this._input=m,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:A(function(){var m=this._input[0];this.yytext+=m,this.yyleng++,this.offset++,this.match+=m,this.matched+=m;var E=m.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),m},"input"),unput:A(function(m){var E=m.length,C=m.split(/(?:\r\n?|\n)/g);this._input=m+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 y=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=[y[0],y[0]+this.yyleng-E]),this.yyleng=this.yytext.length,this},"unput"),more:A(function(){return this._more=!0,this},"more"),reject:A(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:A(function(m){this.unput(this.match.slice(m))},"less"),pastInput:A(function(){var m=this.matched.substr(0,this.matched.length-this.match.length);return(m.length>20?"...":"")+m.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:A(function(){var m=this.match;return m.length<20&&(m+=this._input.substr(0,20-m.length)),(m.substr(0,20)+(m.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:A(function(){var m=this.pastInput(),E=new Array(m.length+1).join("-");return m+this.upcomingInput()+`
26
+ `+E+"^"},"showPosition"),test_match:A(function(m,E){var C,o,y;if(this.options.backtrack_lexer&&(y={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&&(y.yylloc.range=this.yylloc.range.slice(0))),o=m[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+m[0].length},this.yytext+=m[0],this.match+=m[0],this.matches=m,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(m[0].length),this.matched+=m[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 y)this[t]=y[t];return!1}return!1},"test_match"),next:A(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var m,E,C,o;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),t=0;t<y.length;t++)if(C=this._input.match(this.rules[y[t]]),C&&(!E||C[0].length>E[0].length)){if(E=C,o=t,this.options.backtrack_lexer){if(m=this.test_match(C,y[t]),m!==!1)return m;if(this._backtrack){E=!1;continue}else return!1}else if(!this.options.flex)break}return E?(m=this.test_match(E,y[o]),m!==!1?m:!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:A(function(){var E=this.next();return E||this.lex()},"lex"),begin:A(function(E){this.conditionStack.push(E)},"begin"),popState:A(function(){var E=this.conditionStack.length-1;return E>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:A(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:A(function(E){return E=this.conditionStack.length-1-Math.abs(E||0),E>=0?this.conditionStack[E]:"INITIAL"},"topState"),pushState:A(function(E){this.begin(E)},"pushState"),stateStackSize:A(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:A(function(E,C,o,y){var t=y;switch(o){case 0:return this.begin("acc_title"),38;break;case 1:return this.popState(),"acc_title_value";break;case 2:return this.begin("acc_descr"),40;break;case 3:return this.popState(),"acc_descr_value";break;case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),C.yytext="",43;break;case 8:return this.pushState("shapeDataStr"),43;break;case 9:return this.popState(),43;break;case 10:let _=/\n\s*/g;return C.yytext=C.yytext.replace(_,"<br/>"),43;break;case 11:return 43;case 12:this.popState();break;case 13:this.begin("callbackname");break;case 14:this.popState();break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 98;case 17:this.popState();break;case 18:return 99;case 19:return"MD_STR";case 20:this.popState();break;case 21:this.begin("md_string");break;case 22:return"STR";case 23:this.popState();break;case 24:this.pushState("string");break;case 25:return 87;case 26:return 105;case 27:return 88;case 28:return 107;case 29:return 89;case 30:return 90;case 31:return 100;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 91;case 35:return E.lex.firstGraph()&&this.begin("dir"),13;break;case 36:return 28;case 37:return 36;case 38:return 35;case 39:return 33;case 40:return 101;case 41:return 101;case 42:return 101;case 43:return 101;case 44:return this.popState(),14;break;case 45:return this.popState(),15;break;case 46:return this.popState(),15;break;case 47:return this.popState(),15;break;case 48:return this.popState(),15;break;case 49:return this.popState(),15;break;case 50:return this.popState(),15;break;case 51:return this.popState(),15;break;case 52:return this.popState(),15;break;case 53:return this.popState(),15;break;case 54:return this.popState(),15;break;case 55:return 124;case 56:return 125;case 57:return 126;case 58:return 127;case 59:return 128;case 60:return 81;case 61:return 108;case 62:return 114;case 63:return 49;case 64:return 63;case 65:return 47;case 66:return 9;case 67:return 109;case 68:return 118;case 69:return this.popState(),80;break;case 70:return this.pushState("edgeText"),78;break;case 71:return 122;case 72:return 80;case 73:break;case 74:return this.popState(),56;break;case 75:return"TEXT";case 76:return this.pushState("ellipseText"),55;break;case 77:return this.popState(),58;break;case 78:return this.pushState("text"),57;break;case 79:return this.popState(),60;break;case 80:return this.pushState("text"),59;break;case 81:return 61;case 82:return this.pushState("text"),70;break;case 83:return this.popState(),67;break;case 84:return this.pushState("text"),66;break;case 85:return this.popState(),52;break;case 86:return this.pushState("text"),51;break;case 87:break;case 88:return this.popState(),72;break;case 89:return this.popState(),74;break;case 90:return 120;case 91:return this.pushState("trapText"),71;break;case 92:return this.pushState("trapText"),73;break;case 93:return 121;case 94:return 70;case 95:return 93;case 96:return"SEP";case 97:return 92;case 98:return 118;case 99:return 114;case 100:return 47;case 101:return 8;case 102:return 112;case 103:return 117;case 104:return 119;case 105:return this.popState(),65;break;case 106:return this.pushState("text"),65;break;case 107:return this.popState(),54;break;case 108:return this.pushState("text"),53;break;case 109:return this.popState(),32;break;case 110:return this.pushState("text"),30;break;case 111:return this.popState(),69;break;case 112:return this.pushState("text"),68;break;case 113:break;case 114:return"TEXT";case 115:return"QUOTE";case 116:return 10;case 117:return 11;case 118:return 12}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:agentflow-beta\b)/,/^(?:flow\b)/,/^(?:connector\b)/,/^(?:global\b[ \t]*)/,/^(?:end\b[ \t]*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*--+[x>]\s*)/,/^(?:\s*--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*-\.+-\s*)/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|(?:[^\\\[\]\(\)\{\}\/%]+|(?!))+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:[ \t]*%%(?!\{)[^\n]*)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:%%(?!\{)[^\n]*)/,/^(?:(?:[^\[\]\(\)\{\}\|\"%]+|(?!))+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},shapeData:{rules:[8,11,12,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},callbackargs:{rules:[17,18,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},callbackname:{rules:[14,15,16,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},href:{rules:[21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},click:{rules:[21,24,33,34,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},edgeText:{rules:[21,24,69,71,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},trapText:{rules:[21,24,76,78,80,84,86,87,88,89,90,91,92,106,108,110,112],inclusive:!1},ellipseText:{rules:[21,24,73,74,75,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},text:{rules:[21,24,76,77,78,79,80,83,84,85,86,91,92,105,106,107,108,109,110,111,112,113,114],inclusive:!1},vertex:{rules:[21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},acc_descr:{rules:[3,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},acc_title:{rules:[1,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},md_string:{rules:[19,20,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},string:{rules:[21,22,23,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,72,76,78,80,81,82,84,86,91,92,93,94,95,96,97,98,99,100,101,102,103,104,106,108,110,112,115,116,117,118],inclusive:!0}}};return Te})();yt.lexer=O1;function _t(){this.yy={}}return A(_t,"Parser"),_t.prototype=yt,yt.Parser=_t,new _t})();Wt.parser=Wt;var N1=Wt,R1=Object.assign({},N1);R1.parse=e=>{let i=e.replace(/}[^\S\n]*\n/g,`}
28
+ `);return N1.parse(i)};var es=R1,ts=A(e=>{let{theme:i,bkgColorArray:r,borderColorArray:n}=e;if(!m1(i,n))return"";let u=A1(e.look),l=k1(r),a=E1(e.THEME_COLOR_LIMIT,n),c=A(g=>n[g%n.length],"border"),f=A(g=>l?`fill: ${r[g%r.length]};`:"","fill"),p="";for(let g of Y1){let k=Mt.get(g),v=`[data-look="${u}"].node.${L1(g)}`;p+=`
29
+
30
+ ${v} rect,
31
+ ${v} path,
32
+ ${v} polygon {
33
+ stroke: ${c(k)};
34
+ ${f(k)}
35
+ }
36
+ `}for(let g=0;g<B1(a);g++){let k=M1(g,a),v=`[data-look="${u}"][data-color-id="color-${k}"].cluster`,S=`[data-look="${u}"][data-color-id="color-${k}"].node`,B=A(T=>`${v} ${T}, ${S} ${T}`,"rule");p+=`
37
+
38
+ ${B("rect")},
39
+ ${B("path")} {
40
+ stroke: ${c(k)};
41
+ ${f(k)}
42
+ }
43
+ `}return p},"genColor"),ss=A((e,i)=>{let r=a1,n=r(e,"r"),u=r(e,"g"),l=r(e,"b");return n1(n,u,l,i)},"fade"),is=A(e=>`${ts(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: ${ss(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
+ ${D1()}
200
+ `,"getStyles"),rs=is,Vs={parser:es,get db(){return new Q1},renderer:$1,styles:rs,init:A(e=>{e.agentflow??={},e.layout&&Gt({layout:e.layout}),e.flowchart??={},e.flowchart.arrowMarkerAbsolute=e.arrowMarkerAbsolute,Gt({flowchart:{arrowMarkerAbsolute:e.arrowMarkerAbsolute}})},"init")};export{Vs as diagram};
@@ -0,0 +1,24 @@
1
+ import{a as ue}from"./chunk-NCOVM3YF.js";import{a as ye}from"./chunk-YPXVLPXW.js";import"./chunk-TPW5CADB.js";import"./chunk-TMMWB6NQ.js";import"./chunk-TWGPYWIY.js";import"./chunk-4W4OQ3QY.js";import"./chunk-RV7WQMNL.js";import"./chunk-WGMEMLED.js";import"./chunk-KNYDPLLK.js";import"./chunk-HP75Y56I.js";import"./chunk-TSOLLCID.js";import"./chunk-6UFWKTSA.js";import"./chunk-ATQQWCXO.js";import{a as fe}from"./chunk-GZYY6JMP.js";import"./chunk-76QEHT4T.js";import"./chunk-A7665WVC.js";import"./chunk-T3FZWEYV.js";import"./chunk-FBC3PYSO.js";import"./chunk-L465623K.js";import{a as he}from"./chunk-XC2LKMMW.js";import{c as me,d as $}from"./chunk-PM2IFX5O.js";import{p as I}from"./chunk-22D53RF2.js";import"./chunk-STBOPOHX.js";import{C as R,P as ae,U as le,V as se,W as re,X as ne,Y as oe,Z as ie,_ as ce,p as ee,r as te}from"./chunk-AECJS4LP.js";import{b as H,h as V,j as N,k as pe,l as de,m as B}from"./chunk-4HYFSIZT.js";import{a as h}from"./chunk-EIBFAW37.js";import"./chunk-PHKIAKHS.js";var ge=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=se,this.getAccTitle=re,this.setDiagramTitle=ie,this.getDiagramTitle=ce,this.getAccDescription=oe,this.setAccDescription=ne}static{h(this,"TreeMapDB")}getNodes(){return this.nodes}getConfig(){let r=te,s=R();return I({...r.treemap,...s.treemap??{}})}addNode(r,s){this.nodes.push(r),this.levels.set(r,s),s===0&&(this.outerNodes.push(r),this.root??=r)}getRoot(){return{name:"",children:this.outerNodes}}addClass(r,s){let i=this.classes.get(r)??{id:r,styles:[],textStyles:[]},c=s.replace(/\\,/g,"\xA7\xA7\xA7").replace(/,/g,";").replace(/§§§/g,",").split(";");c&&c.forEach(l=>{me(l)&&(i?.textStyles?i.textStyles.push(l):i.textStyles=[l]),i?.styles?i.styles.push(l):i.styles=[l]}),this.classes.set(r,i)}getClasses(){return this.classes}getStylesForClass(r){return this.classes.get(r)?.styles??[]}clear(){le(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function Se(r){if(!r.length)return[];let s=[],i=[];return r.forEach(c=>{let l={name:c.name,children:c.type==="Leaf"?void 0:[]};for(l.classSelector=c?.classSelector,c?.cssCompiledStyles&&(l.cssCompiledStyles=c.cssCompiledStyles),c.type==="Leaf"&&c.value!==void 0&&(l.value=c.value);i.length>0&&i[i.length-1].level>=c.level;)i.pop();if(i.length===0)s.push(l);else{let n=i[i.length-1].node;n.children?n.children.push(l):n.children=[l]}c.type!=="Leaf"&&i.push({node:l,level:c.level})}),s}h(Se,"buildHierarchy");var Fe=h((r,s)=>{ue(r,s);let i=[];for(let n of r.TreemapRows??[])n.$type==="ClassDefStatement"&&s.addClass(n.className??"",n.styleText??"");for(let n of r.TreemapRows??[]){let d=n.item;if(!d)continue;let m=n.indent?parseInt(n.indent):0,k=Ne(d),a=d.classSelector?s.getStylesForClass(d.classSelector):[],A=a.length>0?a:void 0,b={level:m,name:k,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:A};i.push(b)}let c=Se(i),l=h((n,d)=>{for(let m of n)s.addNode(m,d),m.children&&m.children.length>0&&l(m.children,d+1)},"addNodesRecursively");l(c,0)},"populate"),Ne=h(r=>r.name?String(r.name):"","getItemName"),xe={parser:{yy:void 0},parse:h(async r=>{try{let i=await ye("treemap",r);H.debug("Treemap AST:",i);let c=xe.parser?.yy;if(!(c instanceof ge))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.");Fe(i,c)}catch(s){throw H.error("Error parsing treemap:",s),s}},"parse")},ze=10,z=10,M=25,Ae=h((r,s,i,c)=>{let l=c.db,n=l.getConfig(),d=n.padding??ze,m=l.getDiagramTitle(),k=l.getRoot(),{themeVariables:a}=R();if(!k)return;let A=m?30:0,b=he(s),Y=n.nodeWidth?n.nodeWidth*z:960,j=n.nodeHeight?n.nodeHeight*z:500,O=Y,U=j+A;b.attr("viewBox",`0 0 ${O} ${U}`),ae(b,U,O,n.useMaxWidth);let v;try{let e=n.valueFormat||",";if(e==="$0,0")v=h(t=>"$"+N(",")(t),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){let t=/\.\d+/.exec(e),o=t?t[0]:"";v=h(f=>"$"+N(","+o)(f),"valueFormat")}else if(e.startsWith("$")){let t=e.substring(1);v=h(o=>"$"+N(t||"")(o),"valueFormat")}else v=N(e)}catch(e){H.error("Error creating format function:",e),v=N(",")}let P=B().range(["transparent",a.cScale0,a.cScale1,a.cScale2,a.cScale3,a.cScale4,a.cScale5,a.cScale6,a.cScale7,a.cScale8,a.cScale9,a.cScale10,a.cScale11]),be=B().range(["transparent",a.cScalePeer0,a.cScalePeer1,a.cScalePeer2,a.cScalePeer3,a.cScalePeer4,a.cScalePeer5,a.cScalePeer6,a.cScalePeer7,a.cScalePeer8,a.cScalePeer9,a.cScalePeer10,a.cScalePeer11]),W=B().range([a.cScaleLabel0,a.cScaleLabel1,a.cScaleLabel2,a.cScaleLabel3,a.cScaleLabel4,a.cScaleLabel5,a.cScaleLabel6,a.cScaleLabel7,a.cScaleLabel8,a.cScaleLabel9,a.cScaleLabel10,a.cScaleLabel11]);m&&b.append("text").attr("x",O/2).attr("y",A/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(m);let q=b.append("g").attr("transform",`translate(0, ${A})`).attr("class","treemapContainer"),ve=pe(k).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),J=de().size([Y,j]).paddingTop(e=>e.children&&e.children.length>0?M+z:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?z:0).paddingRight(e=>e.children&&e.children.length>0?z:0).paddingBottom(e=>e.children&&e.children.length>0?z:0).round(!0)(ve),Ce=J.descendants().filter(e=>e.children&&e.children.length>0),D=q.selectAll(".treemapSection").data(Ce).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);D.append("rect").attr("width",e=>e.x1-e.x0).attr("height",M).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),D.append("clipPath").attr("id",(e,t)=>`clip-section-${s}-${t}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",M),D.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,t)=>`treemapSection section${t}`).attr("fill",e=>P(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>be(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";let t=$({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+";"+t.borderStyles.join(";")}),D.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",M/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,t)=>`url(#clip-section-${s}-${t})`).attr("style",e=>{if(e.depth===0)return"display: none;";let t="dominant-baseline: middle; font-size: 12px; fill:"+W(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",o=$({cssCompiledStyles:e.data.cssCompiledStyles});return t+o.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;let t=V(this),o=e.data.name;t.text(o);let f=e.x1-e.x0,y=6,u;n.showValues!==!1&&e.value?u=f-10-30-10-y:u=f-y-6;let p=Math.max(15,u),w=t.node();if(w.getComputedTextLength()>p){let T=o;for(;T.length>0;){if(T=o.substring(0,T.length-1),T.length===0){t.text("..."),w.getComputedTextLength()>p&&t.text("");break}if(t.text(T+"..."),w.getComputedTextLength()<=p)break}}}),n.showValues!==!1&&D.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",M/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?v(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";let t="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+W(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",o=$({cssCompiledStyles:e.data.cssCompiledStyles});return t+o.labelStyles.replace("color:","fill:")});let K=J.leaves(),S=K.length>20,we=S?16:38,E=S?14:28,L=S?4:8,F=S?4:6,G=S?2:4,Q=S?8:10,X=S?1:2,_=q.selectAll(".treemapLeafGroup").data(K).enter().append("g").attr("class",(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);_.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?P(e.parent.data.name):P(e.data.name)).attr("style",e=>$({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?P(e.parent.data.name):P(e.data.name)).attr("stroke-width",3),_.append("clipPath").attr("id",(e,t)=>`clip-${s}-${t}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),_.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{let t=`text-anchor: middle; dominant-baseline: middle; font-size: ${we}px;fill:`+W(e.data.name)+";",o=$({cssCompiledStyles:e.data.cssCompiledStyles});return t+o.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,t)=>`url(#clip-${s}-${t})`).text(e=>e.data.name).each(function(e){let t=V(this),o=e.x1-e.x0,f=e.y1-e.y0,y=t.node(),u=o-2*G,C=f-2*G;if(u<Q||C<Q){t.style("display","none");return}let p=parseInt(t.style("font-size"),10),w=.6;for(;y.getComputedTextLength()>u&&p>L;)p--,t.style("font-size",`${p}px`);let g=Math.max(F,Math.min(E,Math.round(p*w))),x=p+X+g;for(;x>C&&p>L&&(p--,g=Math.max(F,Math.min(E,Math.round(p*w))),!(g<F&&p===L));)t.style("font-size",`${p}px`),x=p+X+g,g<=F&&x>C;t.style("font-size",`${p}px`),S?(p<L||C<L)&&t.style("display","none"):(y.getComputedTextLength()>u||p<L||C<p)&&t.style("display","none")}),n.showValues!==!1&&_.append("text").attr("class","treemapValue").attr("x",t=>(t.x1-t.x0)/2).attr("y",function(t){return(t.y1-t.y0)/2}).attr("style",t=>{let o=`text-anchor: middle; dominant-baseline: hanging; font-size: ${E}px;fill:`+W(t.data.name)+";",f=$({cssCompiledStyles:t.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,o)=>`url(#clip-${s}-${o})`).text(t=>t.value?v(t.value):"").each(function(t){let o=V(this),f=this.parentNode;if(!f){o.style("display","none");return}let y=V(f).select(".treemapLabel");if(y.empty()||y.style("display")==="none"){o.style("display","none");return}let u=parseFloat(y.style("font-size")),p=Math.max(F,Math.min(E,Math.round(u*.6)));o.style("font-size",`${p}px`);let g=(t.y1-t.y0)/2+u/2+X;o.attr("y",g);let x=t.x1-t.x0,Z=t.y1-t.y0-4,Le=x-2*G;o.node().getComputedTextLength()>Le||g+p>Z||p<F?o.style("display","none"):o.style("display",null)});let Te=n.diagramPadding??8;fe(b,Te,"flowchart",n?.useMaxWidth||!1)},"draw"),Pe=h(function(r,s){return s.db.getClasses()},"getClasses"),De={draw:Ae,getClasses:Pe},Ve={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},Me=h(({treemap:r}={})=>{let s=ee(),i=R(),c=I(s,i.themeVariables),l=I(Ve,r),n=l.titleColor??c.titleColor,d=l.labelColor??c.textColor,m=l.valueColor??c.textColor;return`
2
+ .treemapNode.section {
3
+ stroke: ${l.sectionStrokeColor};
4
+ stroke-width: ${l.sectionStrokeWidth};
5
+ fill: ${l.sectionFillColor};
6
+ }
7
+ .treemapNode.leaf {
8
+ stroke: ${l.leafStrokeColor};
9
+ stroke-width: ${l.leafStrokeWidth};
10
+ fill: ${l.leafFillColor};
11
+ }
12
+ .treemapLabel {
13
+ fill: ${d};
14
+ font-size: ${l.labelFontSize};
15
+ }
16
+ .treemapValue {
17
+ fill: ${m};
18
+ font-size: ${l.valueFontSize};
19
+ }
20
+ .treemapTitle {
21
+ fill: ${n};
22
+ font-size: ${l.titleFontSize};
23
+ }
24
+ `},"getStyles"),ke=Me,Ue={parser:xe,get db(){return new ge},renderer:De,styles:ke};export{Ue as diagram};
@@ -0,0 +1,30 @@
1
+ import{a as z}from"./chunk-L7BMR7WL.js";import{a as O}from"./chunk-NCOVM3YF.js";import{a as G}from"./chunk-YPXVLPXW.js";import"./chunk-TPW5CADB.js";import"./chunk-TMMWB6NQ.js";import"./chunk-TWGPYWIY.js";import"./chunk-4W4OQ3QY.js";import"./chunk-RV7WQMNL.js";import"./chunk-WGMEMLED.js";import"./chunk-KNYDPLLK.js";import"./chunk-HP75Y56I.js";import"./chunk-TSOLLCID.js";import"./chunk-6UFWKTSA.js";import"./chunk-ATQQWCXO.js";import"./chunk-76QEHT4T.js";import"./chunk-A7665WVC.js";import"./chunk-T3FZWEYV.js";import"./chunk-FBC3PYSO.js";import"./chunk-L465623K.js";import{a as H}from"./chunk-XC2LKMMW.js";import{b as W,d as X}from"./chunk-DSKRGV6V.js";import{p as y}from"./chunk-22D53RF2.js";import"./chunk-STBOPOHX.js";import{C as I,I as N,P as A,U as E,V as L,W as D,X as _,Y as M,Z as S,_ as R,r as k}from"./chunk-AECJS4LP.js";import{b as C}from"./chunk-4HYFSIZT.js";import{a as f}from"./chunk-EIBFAW37.js";import"./chunk-PHKIAKHS.js";var q=/[─━│┃└┗├┣]/,U=/[└┗├┣]/,re=/[─━]/,Y=/^[\s│┃]+$/,P=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,F=/^\s*%%/,ne=" ";function j(r){return r.some(t=>q.test(t))}f(j,"isBoxDrawingFormat");function J(r){for(let t of r){let e=U.exec(t);if(e?.index&&e.index>0)return e.index}return 4}f(J,"inferSegmentWidth");function K(r,t){return r.replace(/\bline\s+(\d+)\b/gi,(e,n)=>{let s=parseInt(n,10),i=t.get(s);return i?`line ${i}`:e})}f(K,"remapErrorLines");function Q(r){let t=r.split(`
2
+ `),e=new Map,n=-1;for(let[p,c]of t.entries())if(c.trim()==="treeView-beta"){n=p;break}if(n===-1)return{text:r,lineMap:e};let s=[];for(let p=n+1;p<t.length;p++){let c=t[p];c.trim()===""||F.test(c)||P.test(c)||Y.test(c)||s.push(c.replace(/\t/g," "))}if(!j(s))return{text:r,lineMap:e};let i=J(s),o=[],a=0;for(let p=0;p<=n;p++)o.push(t[p]),a++,e.set(a,p+1);for(let p=n+1;p<t.length;p++){let c=t[p],d=c.trim(),h=p+1;if(d===""){o.push(c),a++,e.set(a,h);continue}if(F.test(c)){o.push(c),a++,e.set(a,h);continue}if(P.test(c)){o.push(c),a++,e.set(a,h);continue}if(Y.test(c))continue;let l=c.replace(/\t/g," "),m=U.exec(l);if(m?.index!==void 0){let g=m.index,w=Math.round(g/i)+1,u=g+1;for(;u<l.length&&re.test(l[u]);)u++;for(;u<l.length&&l[u]===" ";)u++;let v=l.slice(u).trimEnd();if(!v)throw new Error(`Line ${h}: Empty node \u2014 expected a filename or directory name after the box-drawing prefix`);let te=ne.repeat(w);o.push(te+v),a++,e.set(a,h)}else{if(/^[\s─━│┃└┗├┣]+$/.test(l))continue;if(q.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 \u251C\u2500\u2500 or \u2514\u2500\u2500 prefixes for indented nodes.`);o.push(c),a++,e.set(a,h)}}}return{text:o.join(`
3
+ `),lineMap:e}}f(Q,"preprocessBoxDrawing");var x=new z(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),ie=f(()=>{x.reset(),E()},"clear"),oe=f(()=>x.records.stack[0],"getRoot"),se=f(()=>x.records.cnt,"getCount"),ae=k.treeView,ce=f(()=>y(ae,I().treeView),"getConfig"),le=f((r,t,e,n,s,i)=>{for(;r<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();let o={id:x.records.cnt++,level:r,name:t,nodeType:e,icon:s,cssClass:n,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:D,getAccDescription:M,getDiagramTitle:R,setAccDescription:_,setAccTitle:L,setDiagramTitle:S},B=de,he=f(r=>{O(r,B);for(let t of r.nodes){let e=typeof t.indent=="number"?t.indent:0,n=t.name,s=n.endsWith("/");s&&(n=n.slice(0,-1));let 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?N(c,I()):void 0;B.addNode(e,n,i,o,p,d)}},"populate"),pe={parse:f(async r=>{let{text:t,lineMap:e}=Q(r);try{let n=await G("treeView",t);C.debug(n),he(n)}catch(n){throw e.size>0&&n instanceof Error&&(n.message=K(n.message,e)),n}},"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 ee(r,t){let e=t?.filenameIcons?.[r];if(e)return e;let n=r.lastIndexOf(".");if(n>0){let s=r.substring(n).toLowerCase(),i=t?.extensionIcons;return i?.[s]??i?.[s.slice(1)]}}f(ee,"detectIcon");function T(r,t){return r.includes(":")?r:r in b.icons||!t?`${b.prefix}:${r}`:`${t}:${r}`}f(T,"qualifyIcon");function $(r,t){if(r.icon!=="none"){if(r.icon)return T(r.icon,t.defaultIconPack);if(t.showIcons){if(r.nodeType==="file"){let e=ee(r.name,t);if(e==="none")return;if(e)return T(e,t.defaultIconPack)}return`${b.prefix}:${r.nodeType==="directory"?"folder":"file"}`}}}f($,"getNodeIcon");W([{name:b.prefix,icons:b}]);var V=14,fe=4,ge=16,ue=f(async(r,t)=>{let e=[],n=f(i=>{let o=$(i,t);o&&e.push({icon:o,node:i}),i.children.forEach(n)},"collect");n(r);let s=await Promise.all(e.map(async({icon:i,node:o})=>({id:o.id,svg:await X(i,{height:V,width:V})})));return new Map(s.map(({id:i,svg:o})=>[i,o]))},"resolveNodeIcons"),me=f((r,t,e,n,s,i)=>{let o=n.append("g"),a="treeView-node-label";e.nodeType==="directory"&&(a+=" treeView-node-dir"),e.cssClass&&(a+=` ${e.cssClass}`);let p=V+fe,c=$(e,s),d=c!==void 0;c&&o.append("g").attr("class","treeView-node-icon").attr("transform",`translate(${r+s.paddingX}, ${t+s.paddingY})`).html(i.get(e.id)??"");let h=o.append("text").text(e.name).attr("dominant-baseline","middle").attr("class",a),{height:l,width:m}=h.node().getBBox(),g=l+s.paddingY*2,w=r+s.paddingX+(d?p:0);h.attr("x",w),h.attr("y",t+g/2);let u=w+m,v=m+s.paddingX*2+(d?p:0);return e.BBox={x:r,y:t,width:v,height:g},e.cssClass?.split(/\s+/).includes("highlight")&&o.insert("rect",":first-child").attr("x",r).attr("y",t+1).attr("width",0).attr("height",g-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:e,nodeGroup:o,labelRightEdge:u,centerY:t+g/2}},"positionLabel"),Z=f((r,t,e,n,s,i)=>r.append("line").attr("x1",t).attr("y1",e).attr("x2",n).attr("y2",s).attr("stroke-width",i).attr("class","treeView-node-line"),"positionLine"),we=f((r,t,e,n)=>{let s=0,i=0,o=[],a=f((d,h,l,m)=>{let g=m*(l.rowIndent+l.paddingX),w=me(g,s,h,d,l,n);o.push(w);let{height:u,width:v}=h.BBox;Z(d,g-l.rowIndent,s+u/2,g,s+u/2,l.lineThickness),i=Math.max(i,g+v),s+=u},"drawNode"),p=f((d,h=0)=>{a(r,d,e,h),d.children.forEach(w=>{p(w,h+1)});let{x:l,y:m,height:g}=d.BBox;if(d.children.length){let{y:w,height:u}=d.children[d.children.length-1].BBox;Z(r,l+e.paddingX,m+g,l+e.paddingX,w+u/2+e.lineThickness/2,e.lineThickness)}},"processNode");p(t);let c=o.filter(d=>d.node.description);if(c.length>0){let h=Math.max(...o.map(l=>l.labelRightEdge))+ge;for(let l of c){let g=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+g.width+e.paddingX)}}for(let d of o)if(d.node.cssClass?.split(/\s+/).includes("highlight")){let h=d.nodeGroup.select(".treeView-highlight-bg");if(!h.empty()){let 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=f(async(r,t,e,n)=>{C.debug(`Rendering treeView diagram
4
+ `+r);let s=n.db,i=s.getRoot(),o=s.getConfig(),a=H(t),p=a.append("g");p.attr("class","tree-view");let c=await ue(i,o),{totalHeight:d,totalWidth:h}=we(p,i,o,c);a.attr("viewBox",`-${o.lineThickness/2} 0 ${h} ${d}`),A(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=f(({treeView:r})=>{let{labelFontSize:t,labelColor:e,lineColor:n,iconColor:s,descriptionColor:i,highlightBg:o,highlightStroke:a}=y(Ce,r);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: ${n};
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,De={db:B,renderer:be,parser:pe,styles:ye};export{De as diagram};