@bkm016/basalt 0.1.5 → 0.1.6

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 (199) hide show
  1. package/README.md +9 -7
  2. package/{chunk-gw05p4g3.js → chunk-053vb71h.js} +1 -1
  3. package/{chunk-3c330qna.js → chunk-063vbmtp.js} +2 -2
  4. package/{chunk-bgkegf0k.js → chunk-0javrjcm.js} +4 -4
  5. package/{chunk-pjr91g6k.js → chunk-10p3mb40.js} +1 -1
  6. package/{chunk-mkp28k1x.js → chunk-39vwrg8n.js} +2 -2
  7. package/{chunk-8xb636vr.js → chunk-6kdgk70p.js} +2 -2
  8. package/{chunk-9z7sdh5e.js → chunk-6ptv4g5e.js} +1 -1
  9. package/{chunk-zzwjt7fp.js → chunk-75434aay.js} +1 -1
  10. package/{chunk-ar3dbfp9.js → chunk-7hr6zw2m.js} +1 -1
  11. package/{chunk-h1rypb99.js → chunk-8gw5bvh3.js} +4 -4
  12. package/{chunk-a4b75ekk.js → chunk-8saewt61.js} +2 -2
  13. package/{chunk-sqaam5ak.js → chunk-8wj32837.js} +1 -1
  14. package/{chunk-539ekagy.js → chunk-8wv5t0w6.js} +5 -5
  15. package/{chunk-aw65h276.js → chunk-8x21n7y9.js} +1 -1
  16. package/{chunk-0n99m9m4.js → chunk-a0c989ky.js} +1 -1
  17. package/{chunk-srjgvdvs.js → chunk-a5apjjcn.js} +6 -6
  18. package/chunk-a81p46j7.js +2 -0
  19. package/chunk-agsfy9w7.js +2 -0
  20. package/{chunk-2qcpq99g.js → chunk-arcqjt91.js} +1 -1
  21. package/{chunk-rxj6tct8.js → chunk-bdy4jksd.js} +1 -1
  22. package/{chunk-zrkh5dw7.js → chunk-benrzwea.js} +1 -1
  23. package/chunk-bpw6q7g0.js +3 -0
  24. package/{chunk-36cqq0ga.js → chunk-c7rcw9fb.js} +5 -5
  25. package/{chunk-x89em726.js → chunk-ca982n62.js} +1 -1
  26. package/chunk-d20p02ny.js +2 -0
  27. package/{chunk-5v4g21rw.js → chunk-d6p2hgxh.js} +1 -1
  28. package/{chunk-t7sc0wwc.js → chunk-dnx91jrd.js} +2 -2
  29. package/{chunk-mat08ab1.js → chunk-dpz4hwqb.js} +2 -2
  30. package/{chunk-zn0g0859.js → chunk-ebpyvs1d.js} +2 -2
  31. package/{chunk-00gwse5r.js → chunk-ecf896fz.js} +1 -1
  32. package/{chunk-0stvywr8.js → chunk-ejsneb6f.js} +1 -1
  33. package/{chunk-7as47pcw.js → chunk-ey15ye2h.js} +1 -1
  34. package/{chunk-v4k3qmdm.js → chunk-f156y565.js} +1 -1
  35. package/{chunk-7tgqhveh.js → chunk-f544p9rh.js} +1 -1
  36. package/chunk-fmq3zwzk.js +2 -0
  37. package/{chunk-ebzkckyw.js → chunk-fx7f4m3c.js} +1 -1
  38. package/{chunk-3k7ejpkc.js → chunk-g0t9c3gv.js} +1 -1
  39. package/{chunk-7w0mefgk.js → chunk-gv7wqkey.js} +2 -2
  40. package/{chunk-2nkfxhef.js → chunk-hksqjts3.js} +252 -236
  41. package/{chunk-1xa7d5mh.js → chunk-j7yvh0ae.js} +1 -1
  42. package/{chunk-0j0qggej.js → chunk-n85qs7cs.js} +1 -1
  43. package/{chunk-7qq99360.js → chunk-n981vx1t.js} +4 -4
  44. package/{chunk-0fwdxd45.js → chunk-peja51xv.js} +1 -1
  45. package/{chunk-6dsq0fns.js → chunk-pg5nkf1y.js} +1 -1
  46. package/{chunk-jyrwk08p.js → chunk-prgm07j4.js} +1 -1
  47. package/{chunk-jvwg4rn1.js → chunk-q9dd6fhj.js} +4 -4
  48. package/{chunk-nxkmd29x.js → chunk-r8vvcp6c.js} +1 -1
  49. package/{chunk-stj493dn.js → chunk-r9aatvwm.js} +2 -2
  50. package/chunk-rfb85nj7.js +2 -0
  51. package/{chunk-980drajf.js → chunk-rfdt992v.js} +12 -12
  52. package/{chunk-e63c1186.js → chunk-s6dejhfj.js} +1 -1
  53. package/{chunk-wfyrfvfn.js → chunk-s7skpgm2.js} +1 -1
  54. package/{chunk-dddsrff6.js → chunk-tgfbtehh.js} +123 -121
  55. package/{chunk-r0jc8e7t.js → chunk-w67dvqtb.js} +2 -2
  56. package/{chunk-b9fqretv.js → chunk-whj87h4r.js} +2 -2
  57. package/{chunk-vt1anydc.js → chunk-y8dkfpmj.js} +3 -3
  58. package/{chunk-nx3jnbv8.js → chunk-z02sj1je.js} +2 -2
  59. package/{chunk-hq5ke1yp.js → chunk-zxkq9m8e.js} +1 -1
  60. package/compiled.js +3 -3
  61. package/package.json +1 -1
  62. package/ui-test-worker.js +27 -27
  63. package/web/{chunk-56krfj3b.js → chunk-03dmzvaq.js} +1 -1
  64. package/web/{chunk-affear07.js → chunk-0fgaepwm.js} +1 -1
  65. package/web/{chunk-vhzys0rr.js → chunk-0gg00f86.js} +1 -1
  66. package/web/chunk-0pecj6d7.js +1 -0
  67. package/web/chunk-0wt1dgny.js +1 -0
  68. package/web/{chunk-gxqaa4sv.js → chunk-12xxh71x.js} +5 -5
  69. package/web/chunk-1ves7sq5.js +1 -0
  70. package/web/chunk-1yj79b48.js +1 -0
  71. package/web/{chunk-x7sb3bwf.js → chunk-296hgy6k.js} +22 -22
  72. package/web/{chunk-jcdw85mv.js → chunk-2bmq1whf.js} +1 -1
  73. package/web/{chunk-1s2hp6h1.js → chunk-2wqxhqr9.js} +1 -1
  74. package/web/{chunk-y7jq61nv.js → chunk-30b33r2w.js} +2 -2
  75. package/web/{chunk-g8kkc6vz.js → chunk-30zfw7zg.js} +1 -1
  76. package/web/chunk-39ng8zwx.css +1 -0
  77. package/web/{chunk-0qr891eq.js → chunk-3de552rg.js} +1 -1
  78. package/web/{chunk-3hkgdw6f.js → chunk-3nbzj48p.js} +3 -3
  79. package/web/{chunk-12z7d0hp.js → chunk-3zebd9fq.js} +1 -1
  80. package/web/chunk-4r1n98zx.js +2 -0
  81. package/web/chunk-59678wmg.js +1 -0
  82. package/web/{chunk-pyg1mr80.js → chunk-5v44qv67.js} +20 -20
  83. package/web/chunk-5wdk97mk.js +4 -0
  84. package/web/{chunk-fnnrrzqa.js → chunk-64rafq66.js} +1 -1
  85. package/web/{chunk-qrdh9j62.js → chunk-6kkw9ptc.js} +1 -1
  86. package/web/{chunk-01hcjafh.js → chunk-718mr5gc.js} +1 -1
  87. package/web/chunk-7hs57qdr.js +1 -0
  88. package/web/{chunk-aqt7kc3s.js → chunk-7kp237t3.js} +1 -1
  89. package/web/chunk-86p42kym.js +1 -0
  90. package/web/chunk-8n79cqyd.js +1 -0
  91. package/web/{chunk-paywgcf7.js → chunk-96v2avmw.js} +2 -2
  92. package/web/{chunk-4a4j030b.js → chunk-9an6wcnr.js} +1 -1
  93. package/web/{chunk-dzg1pv80.js → chunk-9c1yt2ex.js} +3 -3
  94. package/web/{chunk-d60dpf69.js → chunk-a7gtb4kg.js} +1 -1
  95. package/web/chunk-b985y17w.js +2 -0
  96. package/web/{chunk-j34q5jn6.js → chunk-bz2v64xe.js} +1 -1
  97. package/web/{chunk-g9sqbafw.js → chunk-cb2rxtq9.js} +1 -1
  98. package/web/{chunk-g5jxwkdh.js → chunk-ck8rr0sr.js} +1 -1
  99. package/web/{chunk-zc1mk10n.js → chunk-cktmyc13.js} +2 -2
  100. package/web/{chunk-tcp77cp2.js → chunk-cm92fyr3.js} +1 -1
  101. package/web/chunk-cwtn2kdm.js +1 -0
  102. package/web/{chunk-ka7c5rhx.js → chunk-czq1yz51.js} +6 -6
  103. package/web/{chunk-qq5gh5zr.js → chunk-d4z2rgpx.js} +1 -1
  104. package/web/{chunk-0k9aec1s.js → chunk-d6tbw8br.js} +3 -3
  105. package/web/chunk-dpkyygej.js +1 -0
  106. package/web/{chunk-m8knte9z.js → chunk-dwajwrpk.js} +1 -1
  107. package/web/{chunk-7e47b1sn.js → chunk-et5ess72.js} +1 -1
  108. package/web/chunk-ez8b6neq.js +1 -0
  109. package/web/{chunk-9xgspn75.js → chunk-f5txt81n.js} +2 -2
  110. package/web/chunk-fd1kqwe3.js +1 -0
  111. package/web/chunk-fmthkpff.js +1 -0
  112. package/web/{chunk-h2ag4kvz.js → chunk-fp48zz2e.js} +1 -1
  113. package/web/{chunk-1pasbxwh.js → chunk-fx0n2g22.js} +1 -1
  114. package/web/{chunk-bnb9xhgw.js → chunk-fxs4nb93.js} +6 -6
  115. package/web/{chunk-sd22cnjy.js → chunk-g6k9z8zt.js} +1 -1
  116. package/web/{chunk-5shygfgb.js → chunk-g81h1e6n.js} +2 -2
  117. package/web/{chunk-zz397b0v.js → chunk-gsh80797.js} +1 -1
  118. package/web/chunk-hs5x78fb.js +1 -0
  119. package/web/{chunk-abhad4zj.js → chunk-ht1dzftc.js} +4 -4
  120. package/web/{chunk-zqht0jzx.js → chunk-hy4m34qp.js} +1 -1
  121. package/web/chunk-hyd5hzpa.js +1 -0
  122. package/web/chunk-hyt1nkaw.js +1 -0
  123. package/web/chunk-j6a4z530.js +1139 -0
  124. package/web/{chunk-h6gh63xj.js → chunk-jve1zc80.js} +1 -1
  125. package/web/{chunk-vttgyb5v.js → chunk-kegv14sg.js} +1 -1
  126. package/web/chunk-kw9emsqw.js +1 -0
  127. package/web/{chunk-kza0t0gj.js → chunk-kyawkpv2.js} +1 -1
  128. package/web/{chunk-xsrvw7dt.js → chunk-m2prjwk3.js} +1 -1
  129. package/web/{chunk-s24qs1bn.js → chunk-m9bzz9m0.js} +6 -6
  130. package/web/{chunk-c53xmf48.js → chunk-mqsyzzgt.js} +1 -1
  131. package/web/{chunk-26bwh1sb.js → chunk-n1jpg57t.js} +6 -6
  132. package/web/{chunk-yvgs6bm3.js → chunk-nyn9tghz.js} +1 -1
  133. package/web/{chunk-ybw6vgf6.js → chunk-nywdeb4m.js} +1 -1
  134. package/web/{chunk-1cfh0e2e.js → chunk-prvh9syp.js} +7 -7
  135. package/web/chunk-pxkhm40r.js +2 -0
  136. package/web/{chunk-d6ddkh6e.js → chunk-q9ekgjh6.js} +1 -1
  137. package/web/chunk-r3mj50zs.js +1 -0
  138. package/web/{chunk-2nht58dc.js → chunk-rf9dt6bg.js} +1 -1
  139. package/web/{chunk-4m3zdd41.js → chunk-s2920f21.js} +1 -1
  140. package/web/{chunk-crzseqbx.js → chunk-sc0ghp25.js} +1 -1
  141. package/web/{chunk-7a3c137d.js → chunk-sy7e4dmq.js} +1 -1
  142. package/web/{chunk-65nwc4cf.js → chunk-t74r2n8h.js} +1 -1
  143. package/web/{chunk-gcv91974.js → chunk-t851gdjh.js} +1 -1
  144. package/web/{chunk-mpfgr049.js → chunk-t9mvsgt9.js} +1 -1
  145. package/web/{chunk-mnzramhc.js → chunk-twdy2f67.js} +1 -1
  146. package/web/{chunk-advfpyb9.js → chunk-v4yqrx5y.js} +4 -4
  147. package/web/{chunk-z4aj066q.js → chunk-vf4vkcf9.js} +1 -1
  148. package/web/{chunk-6enn8p66.js → chunk-vtxw9rmr.js} +1 -1
  149. package/web/{chunk-k67v6dyg.js → chunk-vw1pbv1x.js} +2 -2
  150. package/web/chunk-x19v2sxv.js +1 -0
  151. package/web/{chunk-892nf39p.js → chunk-x5s7zr5f.js} +7 -7
  152. package/web/{chunk-f9k3xrwb.js → chunk-xc2sq3t5.js} +1 -1
  153. package/web/chunk-xvcfp1zh.js +2 -0
  154. package/web/chunk-y21zy3eh.js +1 -0
  155. package/web/{chunk-14bad871.js → chunk-ya3ghn3n.js} +1 -1
  156. package/web/chunk-yd74yxzt.js +8 -0
  157. package/web/{chunk-0p1nmj5n.js → chunk-z1geewdf.js} +1 -1
  158. package/web/chunk-z4ha8181.js +1 -0
  159. package/web/chunk-z8rarqe6.js +1 -0
  160. package/web/{chunk-xk1t58c4.js → chunk-zp3qrrkb.js} +4 -4
  161. package/web/{chunk-7znyd1mj.js → chunk-zsxw5fj7.js} +1 -1
  162. package/web/index.html +1 -1
  163. package/worker.js +1 -1
  164. package/chunk-2nb3d92s.js +0 -2
  165. package/chunk-2pa1z37c.js +0 -2
  166. package/chunk-4g5f43ea.js +0 -3
  167. package/chunk-eegztdzb.js +0 -2
  168. package/chunk-wd3z74av.js +0 -2
  169. package/chunk-yna8bwqc.js +0 -2
  170. package/web/chunk-0ytga215.js +0 -1
  171. package/web/chunk-1amzv4ha.js +0 -1
  172. package/web/chunk-2y0rc1fe.js +0 -1
  173. package/web/chunk-4w298aqs.js +0 -1
  174. package/web/chunk-6stt9d18.js +0 -1
  175. package/web/chunk-7pypx5h8.js +0 -2
  176. package/web/chunk-9dy7z3ej.js +0 -2
  177. package/web/chunk-9mq2cdtq.js +0 -1
  178. package/web/chunk-b5hah4mf.js +0 -1
  179. package/web/chunk-b8tfetd8.js +0 -1
  180. package/web/chunk-ckgpy4r4.js +0 -1
  181. package/web/chunk-dbnrfxt1.js +0 -8
  182. package/web/chunk-ddxf8e84.js +0 -1
  183. package/web/chunk-e8h45nyr.js +0 -1
  184. package/web/chunk-ej9vb61c.js +0 -1
  185. package/web/chunk-fjag6yg8.js +0 -2
  186. package/web/chunk-gxsb5tx3.js +0 -1
  187. package/web/chunk-jg6fmz2d.js +0 -1
  188. package/web/chunk-mz1dabxh.js +0 -1
  189. package/web/chunk-p53n0hwr.js +0 -1
  190. package/web/chunk-pfcnr9tw.js +0 -1
  191. package/web/chunk-q7xkscc5.js +0 -1
  192. package/web/chunk-qmbgb79a.js +0 -1139
  193. package/web/chunk-sfq6cw45.js +0 -2
  194. package/web/chunk-svqj4az8.js +0 -1
  195. package/web/chunk-t7jwyvvr.js +0 -1
  196. package/web/chunk-tf18d2dk.css +0 -1
  197. package/web/chunk-v0g4cqc1.js +0 -4
  198. package/web/chunk-vqfz99ff.js +0 -1
  199. package/web/chunk-zazs8p6c.js +0 -1
@@ -1,4 +1,4 @@
1
- import{e,a,ce,Re,v,C,S,E,T,A,R,L,l,ln,An,p,et,tt,M,ze,ue,oe,se,Ye,Mr,ye,ve}from"./chunk-pyg1mr80.js";import{$t}from"./chunk-tcp77cp2.js";import{je}from"./chunk-m8knte9z.js";import{Bt}from"./chunk-9dy7z3ej.js";import{ge}from"./chunk-9xgspn75.js";import{le}from"./chunk-01hcjafh.js";var A1="flowchart-",m1=class{constructor(){this.vertexCounter=0,this.config=l(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=S,this.setAccDescription=T,this.setDiagramTitle=R,this.getAccTitle=E,this.getAccDescription=A,this.getDiagramTitle=L,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.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.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{e(this,"FlowDB")}sanitizeText(t){return v.sanitizeText(t,this.config)}sanitizeNodeLabelType(t){switch(t){case"markdown":case"string":case"text":return t;default:return"markdown"}}setDiagramId(t){this.diagramId=t}lookUpDomId(t){for(let r of this.vertices.values())if(r.id===t)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${t}`:t}addVertex(t,r,n,u,c,g,d={},D){if(!t||t.trim().length===0)return;let f;if(D!==void 0){let F;if(!D.includes(`
1
+ import{e,a,ce,Re,v,C,S,E,T,A,R,L,l,ln,An,p,et,tt,M,ze,ue,oe,se,Ye,Mr,ge,ye}from"./chunk-5v44qv67.js";import{$t}from"./chunk-cm92fyr3.js";import{je}from"./chunk-dwajwrpk.js";import{Bt}from"./chunk-pxkhm40r.js";import{he}from"./chunk-f5txt81n.js";import{le}from"./chunk-718mr5gc.js";var A1="flowchart-",m1=class{constructor(){this.vertexCounter=0,this.config=l(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=S,this.setAccDescription=T,this.setDiagramTitle=R,this.getAccTitle=E,this.getAccDescription=A,this.getDiagramTitle=L,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.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.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{e(this,"FlowDB")}sanitizeText(t){return v.sanitizeText(t,this.config)}sanitizeNodeLabelType(t){switch(t){case"markdown":case"string":case"text":return t;default:return"markdown"}}setDiagramId(t){this.diagramId=t}lookUpDomId(t){for(let r of this.vertices.values())if(r.id===t)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${t}`:t}addVertex(t,r,n,u,c,g,d={},D){if(!t||t.trim().length===0)return;let f;if(D!==void 0){let F;if(!D.includes(`
2
2
  `))F=`{
3
3
  `+D+`
4
4
  }`;else F=D+`
@@ -6,9 +6,9 @@ import{e,a,ce,Re,v,C,S,E,T,A,R,L,l,ln,An,p,et,tt,M,ze,ue,oe,se,Ye,Mr,ye,ve}from"
6
6
 
7
7
  Initialize mermaid with maxEdges set to a higher number to allow more edges.
8
8
  You cannot set this config via configuration inside the diagram as it is a secure config.
9
- You have to call mermaid.initialize.`)}isLinkData(t){return t!==null&&typeof t==="object"&&"id"in t&&typeof t.id==="string"}addLink(t,r,n){let u=this.isLinkData(n)?n.id.replace("@",""):void 0;a.info("addLink",t,r,u);for(let c of t)for(let g of r){let d=c===t[t.length-1],D=g===r[0];if(d&&D)this.addSingleLink(c,g,n,u);else this.addSingleLink(c,g,n,void 0)}}updateLinkInterpolate(t,r){t.forEach((n)=>{if(n==="default")this.edges.defaultInterpolate=r;else this.edges[n].interpolate=r})}updateLink(t,r){t.forEach((n)=>{if(typeof n==="number"&&n>=this.edges.length)throw Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);if(n==="default")this.edges.defaultStyle=r;else if(this.edges[n].style=r,(this.edges[n]?.style?.length??0)>0&&!this.edges[n]?.style?.some((u)=>u?.startsWith("fill")))this.edges[n]?.style?.push("fill:none")})}addClass(t,r){let n=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");t.split(",").forEach((u)=>{let c=this.classes.get(u);if(c===void 0)c={id:u,styles:[],textStyles:[]},this.classes.set(u,c);if(n!==void 0&&n!==null)n.forEach((g)=>{if(/color/.exec(g)){let d=g.replace("fill","bgFill");c.textStyles.push(d)}c.styles.push(g)})})}setDirection(t){if(this.direction=t.trim(),/.*</.exec(this.direction))this.direction="RL";if(/.*\^/.exec(this.direction))this.direction="BT";if(/.*>/.exec(this.direction))this.direction="LR";if(/.*v/.exec(this.direction))this.direction="TB";if(this.direction==="TD")this.direction="TB"}setClass(t,r){for(let n of t.split(",")){let u=this.vertices.get(n);if(u)u.classes.push(r);let c=this.edges.find((d)=>d.id===n);if(c)c.classes.push(r);let g=this.subGraphLookup.get(n);if(g)g.classes.push(r)}}setTooltip(t,r){if(r===void 0)return;r=this.sanitizeText(r);for(let n of t.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,r)}setClickFun(t,r,n){if(l().securityLevel!=="loose")return;if(r===void 0)return;let u=[];if(typeof n==="string"){u=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let g=0;g<u.length;g++){let d=u[g].trim();if(d.startsWith('"')&&d.endsWith('"'))d=d.substr(1,d.length-2);u[g]=d}}if(u.length===0)u.push(t);let c=this.vertices.get(t);if(c)c.haveCallback=!0,this.funs.push(()=>{let g=this.lookUpDomId(t),d=document.querySelector(`[id="${g}"]`);if(d!==null)d.addEventListener("click",()=>{M.runFunc(r,...u)},!1)})}setLink(t,r,n){t.split(",").forEach((u)=>{let c=this.vertices.get(u);if(c!==void 0)c.link=M.formatUrl(r,this.config),c.linkTarget=n}),this.setClass(t,"clickable")}getTooltip(t){return this.tooltips.get(t)}setClickEvent(t,r,n){t.split(",").forEach((u)=>{this.setClickFun(u,r,n)}),this.setClass(t,"clickable")}bindFunctions(t){this.funs.forEach((r)=>{r(t)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(t){let r=$t();p(t).select("svg").selectAll("g.node").on("mouseover",(c)=>{let g=p(c.currentTarget),d=g.attr("title");if(d===null)return;let D=c.currentTarget?.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(g.attr("title")).style("left",window.scrollX+D.left+(D.right-D.left)/2+"px").style("top",window.scrollY+D.bottom+"px"),r.html(Re.sanitize(d)),g.classed("hover",!0)}).on("mouseout",(c)=>{r.transition().duration(500).style("opacity",0),p(c.currentTarget).classed("hover",!1)})}clear(t="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=t,this.config=l(),C()}setGen(t){this.version=t||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(t,r,n){let u=t.text.trim(),c=n.text;if(t===n&&/\s/.exec(n.text))u=void 0;let d=e((y)=>{let F={boolean:{},number:{},string:{}},N=[],j;return{nodeList:y.filter(function(h){let k=typeof h;if(h.stmt&&h.stmt==="dir")return j=h.value,!1;if(h.trim()==="")return!1;if(k in F)return F[k].hasOwnProperty(h)?!1:F[k][h]=!0;else return N.includes(h)?!1:N.push(h)}),dir:j}},"uniq")(r.flat()),{nodeList:D,dir:f}=d,U=l().flowchart??{};if(f=f??(U.inheritDir?this.getDirection()??l().direction??void 0:void 0),this.version==="gen-1")for(let y=0;y<D.length;y++)D[y]=this.lookUpDomId(D[y]);u=u??"subGraph"+this.subCount,c=c||"",c=this.sanitizeText(c),this.subCount=this.subCount+1;let _={id:u,nodes:D,title:c.trim(),classes:[],dir:f,labelType:this.sanitizeNodeLabelType(n?.type)};a.info("Adding",_.id,_.nodes,_.dir),_.nodes=this.makeUniq(_,this.subGraphs).nodes.filter((y)=>y!==u);let W=this.subGraphs.find((y)=>y.id===u);if(W)W.nodes.push(..._.nodes);else this.subGraphs.push(_);return this.subGraphLookup.set(u,W??_),u}getPosForId(t){for(let[r,n]of this.subGraphs.entries())if(n.id===t)return r;return-1}indexNodes2(t,r){let n=this.subGraphs[r].nodes;if(this.secCount=this.secCount+1,this.secCount>2000)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===t)return{result:!0,count:0};let u=0,c=1;while(u<n.length){let g=this.getPosForId(n[u]);if(g>=0){let d=this.indexNodes2(t,g);if(d.result)return{result:!0,count:c+d.count};else c=c+d.count}u=u+1}return{result:!1,count:c}}getDepthFirstPos(t){return this.posCrossRef[t]}indexNodes(){if(this.secCount=-1,this.subGraphs.length>0)this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){if(this.firstGraphFlag)return this.firstGraphFlag=!1,!0;return!1}destructStartLink(t){let r=t.trim(),n="arrow_open";switch(r[0]){case"<":n="arrow_point",r=r.slice(1);break;case"x":n="arrow_cross",r=r.slice(1);break;case"o":n="arrow_circle",r=r.slice(1);break}let u="normal";if(r.includes("="))u="thick";if(r.includes("."))u="dotted";return{type:n,stroke:u}}countChar(t,r){let n=r.length,u=0;for(let c=0;c<n;++c)if(r[c]===t)++u;return u}destructEndLink(t){let r=t.trim(),n=r.slice(0,-1),u="arrow_open";switch(r.slice(-1)){case"x":if(u="arrow_cross",r.startsWith("x"))u="double_"+u,n=n.slice(1);break;case">":if(u="arrow_point",r.startsWith("<"))u="double_"+u,n=n.slice(1);break;case"o":if(u="arrow_circle",r.startsWith("o"))u="double_"+u,n=n.slice(1);break}let c="normal",g=n.length-1;if(n.startsWith("="))c="thick";if(n.startsWith("~"))c="invisible";let d=this.countChar(".",n);if(d)c="dotted",g=d;return{type:u,stroke:c,length:g}}destructLink(t,r){let n=this.destructEndLink(t),u;if(r){if(u=this.destructStartLink(r),u.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};if(u.type==="arrow_open")u.type=n.type;else{if(u.type!==n.type)return{type:"INVALID",stroke:"INVALID"};u.type="double_"+u.type}if(u.type==="double_arrow")u.type="double_arrow_point";return u.length=n.length,u}return n}exists(t,r){for(let n of t)if(n.nodes.includes(r))return!0;return!1}makeUniq(t,r){let n=[];return t.nodes.forEach((u,c)=>{if(!this.exists(r,u))n.push(t.nodes[c])}),{nodes:n}}getTypeFromVertex(t){if(t.img)return"imageSquare";if(t.icon){if(t.form==="circle")return"iconCircle";if(t.form==="square")return"iconSquare";if(t.form==="rounded")return"iconRounded";return"icon"}switch(t.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return t.type}}findNode(t,r){return t.find((n)=>n.id===r)}destructEdgeType(t){let r="none",n="arrow_point";switch(t){case"arrow_point":case"arrow_circle":case"arrow_cross":n=t;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=t.replace("double_",""),n=r;break}return{arrowTypeStart:r,arrowTypeEnd:n}}addNodeFromVertex(t,r,n,u,c,g){let d=n.get(t.id),D=u.get(t.id)??!1,f=this.findNode(r,t.id);if(f)f.cssStyles=t.styles,f.cssCompiledStyles=this.getCompiledStyles(t.classes),f.cssClasses=t.classes.join(" ");else{let U={id:t.id,label:t.text,labelType:t.labelType,labelStyle:"",parentId:d,padding:c.flowchart?.padding||8,cssStyles:t.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...t.classes]),cssClasses:"default "+t.classes.join(" "),dir:t.dir,domId:t.domId,look:g,link:t.link,linkTarget:t.linkTarget,tooltip:this.getTooltip(t.id),icon:t.icon,pos:t.pos,img:t.img,assetWidth:t.assetWidth,assetHeight:t.assetHeight,constraint:t.constraint};if(D)r.push({...U,isGroup:!0,shape:"rect"});else r.push({...U,isGroup:!1,shape:this.getTypeFromVertex(t),minWidth:c.flowchart?.minNodeWidth})}}getCompiledStyles(t){let r=[];for(let n of t){let u=this.classes.get(n);if(u?.styles)r=[...r,...u.styles??[]].map((c)=>c.trim());if(u?.textStyles)r=[...r,...u.textStyles??[]].map((c)=>c.trim())}return r}getData(){let t=l(),r=[],n=[],u=this.getSubGraphs(),c=new Map,g=new Map,d=new Map;for(let h of u)for(let k of h.nodes)if(this.subGraphLookup.has(k))d.set(k,h.id);let D=new Map,f=new Map;for(let h of u){let k=d.get(h.id);if(k!==void 0)f.set(k,[...f.get(k)??[],h.id])}let U=0,_=e((h)=>{D.set(h,U++);for(let k of f.get(h)??[])_(k)},"walk");for(let h of u)if(!d.has(h.id))_(h.id);let W=e((h)=>this.subGraphLookup.get(h)?.metadata?.view==="collapsed","isCollapsed"),y=e((h)=>{let k,he=new Set,pe=h;while(pe!==void 0&&!he.has(pe)){if(he.add(pe),W(pe))k=pe;pe=d.get(pe)}return k},"outermostCollapsed"),F=new Set,N=new Map;for(let h of u){let k=y(h.id);if(k===void 0)continue;if(h.id!==k)F.add(h.id),N.set(h.id,k);for(let he of h.nodes){if(he===k)continue;F.add(he),N.set(he,k)}}for(let h=u.length-1;h>=0;h--){let k=u[h];if(F.has(k.id))continue;if(k.nodes.length>0)g.set(k.id,!0);for(let he of k.nodes)c.set(he,k.id)}for(let h=u.length-1;h>=0;h--){let k=u[h];if(F.has(k.id))continue;if(k.metadata?.view==="collapsed")r.push({id:k.id,label:k.title,labelStyle:"",labelType:k.labelType,parentId:c.get(k.id),padding:8,cssCompiledStyles:this.getCompiledStyles(k.classes),cssClasses:k.classes.join(" "),shape:"collapsedGroup",dir:k.dir,isGroup:!1,look:t.look,colorIndex:D.get(k.id)});else r.push({id:k.id,label:k.title,labelStyle:"",labelType:k.labelType,parentId:c.get(k.id),padding:8,cssCompiledStyles:this.getCompiledStyles(k.classes),cssClasses:k.classes.join(" "),shape:"rect",dir:k.dir,isGroup:!0,look:t.look,colorIndex:D.get(k.id),metadata:k.metadata})}this.getVertices().forEach((h)=>{if(F.has(h.id))return;this.addNodeFromVertex(h,r,c,g,t,t.look||"classic")});let Ie=this.getEdges();return Ie.forEach((h,k)=>{let{arrowTypeStart:he,arrowTypeEnd:pe}=this.destructEdgeType(h.type),K=[...Ie.defaultStyle??[]],Y=N.get(h.start)??h.start,H=N.get(h.end)??h.end;if(Y===H&&(N.has(h.start)||N.has(h.end)))return;if(h.style)K.push(...h.style);let q={id:ze(Y,H,{counter:k,prefix:"L"},h.id),isUserDefinedId:h.isUserDefinedId,start:Y,end:H,type:h.type??"normal",label:h.text,labelType:h.labelType,labelpos:"c",thickness:h.stroke,minlen:h.length,classes:h?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:h?.stroke==="invisible"||h?.type==="arrow_open"?"none":he,arrowTypeEnd:h?.stroke==="invisible"||h?.type==="arrow_open"?"none":pe,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(h.classes),labelStyle:K,style:K,pattern:h.stroke,look:t.look,animate:h.animate,animation:h.animation,curve:h.interpolate||this.edges.defaultInterpolate||t.flowchart?.curve};n.push(q)}),{nodes:r,edges:n,other:{},config:t}}defaultConfig(){return An.flowchart}},C1=e(function(t,r){return r.db.getClasses()},"getClasses"),D1=e(async function(t,r,n,u){a.info("REF0:"),a.info("Drawing state diagram (v2)",r);let{securityLevel:c,flowchart:g,layout:d}=l();u.db.setDiagramId(r),a.debug("Before getData: ");let D=u.db.getData();a.debug("Data: ",D);let f=ge(r,c),U=u.db.getDirection();D.type=u.type,D.layoutAlgorithm=ve(d),D.direction=U,D.nodeSpacing=g?.nodeSpacing||50,D.rankSpacing=g?.rankSpacing||50,D.markers=["point","circle","cross"],D.diagramId=r,a.debug("REF1:",D),await ye(D,f);let _=D.config.flowchart?.diagramPadding??8;M.insertTitle(f,"flowchartTitleText",g?.titleTopMargin||0,u.db.getDiagramTitle()),le(f,_,"flowchart",g?.useMaxWidth||!1)},"draw"),T1={getClasses:C1,draw:D1},Ft=function(){var t=e(function(Pe,b,m,x){for(m=m||{},x=Pe.length;x--;m[Pe[x]]=b);return m},"o"),r=[1,4],n=[1,3],u=[1,5],c=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],g=[2,2],d=[1,13],D=[1,14],f=[1,15],U=[1,16],_=[1,23],W=[1,25],y=[1,26],F=[1,27],N=[1,50],j=[1,49],Ie=[1,29],h=[1,30],k=[1,31],he=[1,32],pe=[1,33],K=[1,45],Y=[1,47],H=[1,43],q=[1,48],Q=[1,44],J=[1,51],Z=[1,46],ee=[1,52],te=[1,53],ct=[1,34],ht=[1,35],dt=[1,36],pt=[1,37],ft=[1,38],Ne=[1,58],G=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],Ce=[1,62],De=[1,61],Te=[1,63],Ke=[8,9,11,75,77,78],_t=[1,79],He=[1,92],qe=[1,97],Xe=[1,96],Qe=[1,93],Je=[1,89],Ze=[1,95],$e=[1,91],st=[1,98],it=[1,94],rt=[1,99],at=[1,90],Oe=[8,9,10,11,40,75,77,78],re=[8,9,10,11,40,46,75,77,78],fe=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],vt=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],nt=[44,60,89,102,105,106,109,111,114,115,116],Lt=[1,122],Vt=[1,123],bt=[1,125],kt=[1,124],wt=[44,60,62,74,89,102,105,106,109,111,114,115,116],It=[1,134],Rt=[1,148],Nt=[1,149],Gt=[1,150],Pt=[1,151],Ot=[1,136],Mt=[1,138],Ut=[1,142],Wt=[1,143],zt=[1,144],jt=[1,145],Kt=[1,146],Yt=[1,147],Ht=[1,152],qt=[1,153],Xt=[1,132],Qt=[1,133],Jt=[1,140],Zt=[1,135],e1=[1,139],t1=[1,137],Ct=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],s1=[1,155],i1=[1,157],z=[8,9,11],be=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],B=[1,177],ae=[1,173],ne=[1,174],V=[1,178],w=[1,175],I=[1,176],ut=[77,116,119],P=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],r1=[10,106],Ge=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],Ee=[1,248],Se=[1,246],xe=[1,250],Fe=[1,244],_e=[1,245],Be=[1,247],Le=[1,249],Ve=[1,251],ot=[1,269],a1=[8,9,11,106],me=[8,9,10,11,60,84,105,106,109,110,111,112],Dt={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:e(function(b,m,x,o,O,s,Me){var i=s.length-1;switch(O){case 2:this.$=[];break;case 3:if(!Array.isArray(s[i])||s[i].length>0)s[i-1].push(s[i]);this.$=s[i-1];break;case 4:case 183:this.$=s[i];break;case 11:o.setDirection("TB"),this.$="TB";break;case 12:o.setDirection(s[i-1]),this.$=s[i-1];break;case 27:this.$=s[i-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=o.addSubGraph(s[i-6],s[i-1],s[i-4]);break;case 34:this.$=o.addSubGraph(s[i-3],s[i-1],s[i-3]);break;case 35:this.$=o.addSubGraph(void 0,s[i-1],void 0);break;case 37:this.$=s[i].trim(),o.setAccTitle(this.$);break;case 38:case 39:this.$=s[i].trim(),o.setAccDescription(this.$);break;case 43:this.$=s[i-1]+s[i];break;case 44:this.$=s[i];break;case 45:o.addVertex(s[i-1][s[i-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i]),o.addLink(s[i-3].stmt,s[i-1],s[i-2]),this.$={stmt:s[i-1],nodes:s[i-1].concat(s[i-3].nodes)};break;case 46:o.addLink(s[i-2].stmt,s[i],s[i-1]),this.$={stmt:s[i],nodes:s[i].concat(s[i-2].nodes)};break;case 47:o.addLink(s[i-3].stmt,s[i-1],s[i-2]),this.$={stmt:s[i-1],nodes:s[i-1].concat(s[i-3].nodes)};break;case 48:this.$={stmt:s[i-1],nodes:s[i-1]};break;case 49:o.addVertex(s[i-1][s[i-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i]),this.$={stmt:s[i-1],nodes:s[i-1],shapeData:s[i]};break;case 50:this.$={stmt:s[i],nodes:s[i]};break;case 51:this.$=[s[i]];break;case 52:o.addVertex(s[i-5][s[i-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i-4]),this.$=s[i-5].concat(s[i]);break;case 53:this.$=s[i-4].concat(s[i]);break;case 54:this.$=s[i];break;case 55:this.$=s[i-2],o.setClass(s[i-2],s[i]);break;case 56:this.$=s[i-3],o.addVertex(s[i-3],s[i-1],"square");break;case 57:this.$=s[i-3],o.addVertex(s[i-3],s[i-1],"doublecircle");break;case 58:this.$=s[i-5],o.addVertex(s[i-5],s[i-2],"circle");break;case 59:this.$=s[i-3],o.addVertex(s[i-3],s[i-1],"ellipse");break;case 60:this.$=s[i-3],o.addVertex(s[i-3],s[i-1],"stadium");break;case 61:this.$=s[i-3],o.addVertex(s[i-3],s[i-1],"subroutine");break;case 62:this.$=s[i-7],o.addVertex(s[i-7],s[i-1],"rect",void 0,void 0,void 0,Object.fromEntries([[s[i-5],s[i-3]]]));break;case 63:this.$=s[i-3],o.addVertex(s[i-3],s[i-1],"cylinder");break;case 64:this.$=s[i-3],o.addVertex(s[i-3],s[i-1],"round");break;case 65:this.$=s[i-3],o.addVertex(s[i-3],s[i-1],"diamond");break;case 66:this.$=s[i-5],o.addVertex(s[i-5],s[i-2],"hexagon");break;case 67:this.$=s[i-3],o.addVertex(s[i-3],s[i-1],"odd");break;case 68:this.$=s[i-3],o.addVertex(s[i-3],s[i-1],"trapezoid");break;case 69:this.$=s[i-3],o.addVertex(s[i-3],s[i-1],"inv_trapezoid");break;case 70:this.$=s[i-3],o.addVertex(s[i-3],s[i-1],"lean_right");break;case 71:this.$=s[i-3],o.addVertex(s[i-3],s[i-1],"lean_left");break;case 72:this.$=s[i],o.addVertex(s[i]);break;case 73:s[i-1].text=s[i],this.$=s[i-1];break;case 74:case 75:s[i-2].text=s[i-1],this.$=s[i-2];break;case 76:this.$=s[i];break;case 77:var X=o.destructLink(s[i],s[i-2]);this.$={type:X.type,stroke:X.stroke,length:X.length,text:s[i-1]};break;case 78:var X=o.destructLink(s[i],s[i-2]);this.$={type:X.type,stroke:X.stroke,length:X.length,text:s[i-1],id:s[i-3]};break;case 79:this.$={text:s[i],type:"text"};break;case 80:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 81:this.$={text:s[i],type:"string"};break;case 82:this.$={text:s[i],type:"markdown"};break;case 83:var X=o.destructLink(s[i]);this.$={type:X.type,stroke:X.stroke,length:X.length};break;case 84:var X=o.destructLink(s[i]);this.$={type:X.type,stroke:X.stroke,length:X.length,id:s[i-1]};break;case 85:this.$=s[i-1];break;case 86:this.$={text:s[i],type:"text"};break;case 87:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 88:this.$={text:s[i],type:"string"};break;case 89:case 104:this.$={text:s[i],type:"markdown"};break;case 101:this.$={text:s[i],type:"text"};break;case 102:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 103:this.$={text:s[i],type:"text"};break;case 105:this.$=s[i-4],o.addClass(s[i-2],s[i]);break;case 106:this.$=s[i-4],o.setClass(s[i-2],s[i]);break;case 107:case 115:this.$=s[i-1],o.setClickEvent(s[i-1],s[i]);break;case 108:case 116:this.$=s[i-3],o.setClickEvent(s[i-3],s[i-2]),o.setTooltip(s[i-3],s[i]);break;case 109:this.$=s[i-2],o.setClickEvent(s[i-2],s[i-1],s[i]);break;case 110:this.$=s[i-4],o.setClickEvent(s[i-4],s[i-3],s[i-2]),o.setTooltip(s[i-4],s[i]);break;case 111:this.$=s[i-2],o.setLink(s[i-2],s[i]);break;case 112:this.$=s[i-4],o.setLink(s[i-4],s[i-2]),o.setTooltip(s[i-4],s[i]);break;case 113:this.$=s[i-4],o.setLink(s[i-4],s[i-2],s[i]);break;case 114:this.$=s[i-6],o.setLink(s[i-6],s[i-4],s[i]),o.setTooltip(s[i-6],s[i-2]);break;case 117:this.$=s[i-1],o.setLink(s[i-1],s[i]);break;case 118:this.$=s[i-3],o.setLink(s[i-3],s[i-2]),o.setTooltip(s[i-3],s[i]);break;case 119:this.$=s[i-3],o.setLink(s[i-3],s[i-2],s[i]);break;case 120:this.$=s[i-5],o.setLink(s[i-5],s[i-4],s[i]),o.setTooltip(s[i-5],s[i-2]);break;case 121:this.$=s[i-4],o.addVertex(s[i-2],void 0,void 0,s[i]);break;case 122:this.$=s[i-4],o.updateLink([s[i-2]],s[i]);break;case 123:this.$=s[i-4],o.updateLink(s[i-2],s[i]);break;case 124:this.$=s[i-8],o.updateLinkInterpolate([s[i-6]],s[i-2]),o.updateLink([s[i-6]],s[i]);break;case 125:this.$=s[i-8],o.updateLinkInterpolate(s[i-6],s[i-2]),o.updateLink(s[i-6],s[i]);break;case 126:this.$=s[i-6],o.updateLinkInterpolate([s[i-4]],s[i]);break;case 127:this.$=s[i-6],o.updateLinkInterpolate(s[i-4],s[i]);break;case 128:case 130:this.$=[s[i]];break;case 129:case 131:s[i-2].push(s[i]),this.$=s[i-2];break;case 133:this.$=s[i-1]+s[i];break;case 181:this.$=s[i];break;case 182:this.$=s[i-1]+""+s[i];break;case 184:this.$=s[i-1]+""+s[i];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:r,10:n,12:u},{1:[3]},t(c,g,{5:6}),{4:7,9:r,10:n,12:u},{4:8,9:r,10:n,12:u},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:d,9:D,10:f,11:U,20:17,22:18,23:19,24:20,25:21,26:22,27:_,33:24,34:W,36:y,38:F,42:28,43:39,44:N,45:40,47:41,60:j,84:Ie,85:h,86:k,87:he,88:pe,89:K,102:Y,105:H,106:q,109:Q,111:J,113:42,114:Z,115:ee,116:te,121:ct,122:ht,123:dt,124:pt,125:ft},t(c,[2,9]),t(c,[2,10]),t(c,[2,11]),{8:[1,55],9:[1,56],10:Ne,15:54,18:57},t(G,[2,3]),t(G,[2,4]),t(G,[2,5]),t(G,[2,6]),t(G,[2,7]),t(G,[2,8]),{8:Ce,9:De,11:Te,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:Ce,9:De,11:Te,21:68},{8:Ce,9:De,11:Te,21:69},{8:Ce,9:De,11:Te,21:70},{8:Ce,9:De,11:Te,21:71},{8:Ce,9:De,11:Te,21:72},{8:Ce,9:De,10:[1,73],11:Te,21:74},t(G,[2,36]),{35:[1,75]},{37:[1,76]},t(G,[2,39]),t(Ke,[2,50],{18:77,39:78,10:Ne,40:_t}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:He,44:qe,60:Xe,80:[1,87],89:Qe,95:[1,84],97:[1,85],101:86,105:Je,106:Ze,109:$e,111:st,114:it,115:rt,116:at,120:88},t(G,[2,185]),t(G,[2,186]),t(G,[2,187]),t(G,[2,188]),t(G,[2,189]),t(Oe,[2,51]),t(Oe,[2,54],{46:[1,100]}),t(re,[2,72],{113:113,29:[1,101],44:N,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:j,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:K,102:Y,105:H,106:q,109:Q,111:J,114:Z,115:ee,116:te}),t(fe,[2,181]),t(fe,[2,142]),t(fe,[2,143]),t(fe,[2,144]),t(fe,[2,145]),t(fe,[2,146]),t(fe,[2,147]),t(fe,[2,148]),t(fe,[2,149]),t(fe,[2,150]),t(fe,[2,151]),t(fe,[2,152]),t(c,[2,12]),t(c,[2,18]),t(c,[2,19]),{9:[1,114]},t(vt,[2,26],{18:115,10:Ne}),t(G,[2,27]),{42:116,43:39,44:N,45:40,47:41,60:j,89:K,102:Y,105:H,106:q,109:Q,111:J,113:42,114:Z,115:ee,116:te},t(G,[2,40]),t(G,[2,41]),t(G,[2,42]),t(nt,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:Lt,81:Vt,116:bt,119:kt},{75:[1,126],77:[1,127]},t(wt,[2,83]),t(G,[2,28]),t(G,[2,29]),t(G,[2,30]),t(G,[2,31]),t(G,[2,32]),{10:It,12:Rt,14:Nt,27:Gt,28:128,32:Pt,44:Ot,60:Mt,75:Ut,80:[1,130],81:[1,131],83:141,84:Wt,85:zt,86:jt,87:Kt,88:Yt,89:Ht,90:qt,91:129,105:Xt,109:Qt,111:Jt,114:Zt,115:e1,116:t1},t(Ct,g,{5:154}),t(G,[2,37]),t(G,[2,38]),t(Ke,[2,48],{44:s1}),t(Ke,[2,49],{18:156,10:Ne,40:i1}),t(Oe,[2,44]),{44:N,47:158,60:j,89:K,102:Y,105:H,106:q,109:Q,111:J,113:42,114:Z,115:ee,116:te},{102:[1,159],103:160,105:[1,161]},{44:N,47:162,60:j,89:K,102:Y,105:H,106:q,109:Q,111:J,113:42,114:Z,115:ee,116:te},{44:N,47:163,60:j,89:K,102:Y,105:H,106:q,109:Q,111:J,113:42,114:Z,115:ee,116:te},t(z,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},t(z,[2,115],{120:168,10:[1,167],14:He,44:qe,60:Xe,89:Qe,105:Je,106:Ze,109:$e,111:st,114:it,115:rt,116:at}),t(z,[2,117],{10:[1,169]}),t(be,[2,183]),t(be,[2,170]),t(be,[2,171]),t(be,[2,172]),t(be,[2,173]),t(be,[2,174]),t(be,[2,175]),t(be,[2,176]),t(be,[2,177]),t(be,[2,178]),t(be,[2,179]),t(be,[2,180]),{44:N,47:170,60:j,89:K,102:Y,105:H,106:q,109:Q,111:J,113:42,114:Z,115:ee,116:te},{30:171,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},{30:179,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},{30:181,50:[1,180],67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},{30:182,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},{30:183,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},{30:184,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},{109:[1,185]},{30:186,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},{30:187,65:[1,188],67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},{30:189,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},{30:190,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},{30:191,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},t(fe,[2,182]),t(c,[2,20]),t(vt,[2,25]),t(Ke,[2,46],{39:192,18:193,10:Ne,40:_t}),t(nt,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},{77:[1,197],79:198,116:bt,119:kt},t(ut,[2,79]),t(ut,[2,81]),t(ut,[2,82]),t(ut,[2,168]),t(ut,[2,169]),{76:199,79:121,80:Lt,81:Vt,116:bt,119:kt},t(wt,[2,84]),{8:Ce,9:De,10:It,11:Te,12:Rt,14:Nt,21:201,27:Gt,29:[1,200],32:Pt,44:Ot,60:Mt,75:Ut,83:141,84:Wt,85:zt,86:jt,87:Kt,88:Yt,89:Ht,90:qt,91:202,105:Xt,109:Qt,111:Jt,114:Zt,115:e1,116:t1},t(P,[2,101]),t(P,[2,103]),t(P,[2,104]),t(P,[2,157]),t(P,[2,158]),t(P,[2,159]),t(P,[2,160]),t(P,[2,161]),t(P,[2,162]),t(P,[2,163]),t(P,[2,164]),t(P,[2,165]),t(P,[2,166]),t(P,[2,167]),t(P,[2,90]),t(P,[2,91]),t(P,[2,92]),t(P,[2,93]),t(P,[2,94]),t(P,[2,95]),t(P,[2,96]),t(P,[2,97]),t(P,[2,98]),t(P,[2,99]),t(P,[2,100]),{6:11,7:12,8:d,9:D,10:f,11:U,20:17,22:18,23:19,24:20,25:21,26:22,27:_,32:[1,203],33:24,34:W,36:y,38:F,42:28,43:39,44:N,45:40,47:41,60:j,84:Ie,85:h,86:k,87:he,88:pe,89:K,102:Y,105:H,106:q,109:Q,111:J,113:42,114:Z,115:ee,116:te,121:ct,122:ht,123:dt,124:pt,125:ft},{10:Ne,18:204},{44:[1,205]},t(Oe,[2,43]),{10:[1,206],44:N,60:j,89:K,102:Y,105:H,106:q,109:Q,111:J,113:113,114:Z,115:ee,116:te},{10:[1,207]},{10:[1,208],106:[1,209]},t(r1,[2,128]),{10:[1,210],44:N,60:j,89:K,102:Y,105:H,106:q,109:Q,111:J,113:113,114:Z,115:ee,116:te},{10:[1,211],44:N,60:j,89:K,102:Y,105:H,106:q,109:Q,111:J,113:113,114:Z,115:ee,116:te},{80:[1,212]},t(z,[2,109],{10:[1,213]}),t(z,[2,111],{10:[1,214]}),{80:[1,215]},t(be,[2,184]),{80:[1,216],98:[1,217]},t(Oe,[2,55],{113:113,44:N,60:j,89:K,102:Y,105:H,106:q,109:Q,111:J,114:Z,115:ee,116:te}),{31:[1,218],67:B,82:219,116:V,117:w,118:I},t(Ge,[2,86]),t(Ge,[2,88]),t(Ge,[2,89]),t(Ge,[2,153]),t(Ge,[2,154]),t(Ge,[2,155]),t(Ge,[2,156]),{49:[1,220],67:B,82:219,116:V,117:w,118:I},{30:221,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},{51:[1,222],67:B,82:219,116:V,117:w,118:I},{53:[1,223],67:B,82:219,116:V,117:w,118:I},{55:[1,224],67:B,82:219,116:V,117:w,118:I},{57:[1,225],67:B,82:219,116:V,117:w,118:I},{60:[1,226]},{64:[1,227],67:B,82:219,116:V,117:w,118:I},{66:[1,228],67:B,82:219,116:V,117:w,118:I},{30:229,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},{31:[1,230],67:B,82:219,116:V,117:w,118:I},{67:B,69:[1,231],71:[1,232],82:219,116:V,117:w,118:I},{67:B,69:[1,234],71:[1,233],82:219,116:V,117:w,118:I},t(Ke,[2,45],{18:156,10:Ne,40:i1}),t(Ke,[2,47],{44:s1}),t(nt,[2,75]),t(nt,[2,74]),{62:[1,235],67:B,82:219,116:V,117:w,118:I},t(nt,[2,77]),t(ut,[2,80]),{77:[1,236],79:198,116:bt,119:kt},{30:237,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},t(Ct,g,{5:238}),t(P,[2,102]),t(G,[2,35]),{43:239,44:N,45:40,47:41,60:j,89:K,102:Y,105:H,106:q,109:Q,111:J,113:42,114:Z,115:ee,116:te},{10:Ne,18:240},{10:Ee,60:Se,84:xe,92:241,105:Fe,107:242,108:243,109:_e,110:Be,111:Le,112:Ve},{10:Ee,60:Se,84:xe,92:252,104:[1,253],105:Fe,107:242,108:243,109:_e,110:Be,111:Le,112:Ve},{10:Ee,60:Se,84:xe,92:254,104:[1,255],105:Fe,107:242,108:243,109:_e,110:Be,111:Le,112:Ve},{105:[1,256]},{10:Ee,60:Se,84:xe,92:257,105:Fe,107:242,108:243,109:_e,110:Be,111:Le,112:Ve},{44:N,47:258,60:j,89:K,102:Y,105:H,106:q,109:Q,111:J,113:42,114:Z,115:ee,116:te},t(z,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},t(z,[2,116]),t(z,[2,118],{10:[1,262]}),t(z,[2,119]),t(re,[2,56]),t(Ge,[2,87]),t(re,[2,57]),{51:[1,263],67:B,82:219,116:V,117:w,118:I},t(re,[2,64]),t(re,[2,59]),t(re,[2,60]),t(re,[2,61]),{109:[1,264]},t(re,[2,63]),t(re,[2,65]),{66:[1,265],67:B,82:219,116:V,117:w,118:I},t(re,[2,67]),t(re,[2,68]),t(re,[2,70]),t(re,[2,69]),t(re,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(nt,[2,78]),{31:[1,266],67:B,82:219,116:V,117:w,118:I},{6:11,7:12,8:d,9:D,10:f,11:U,20:17,22:18,23:19,24:20,25:21,26:22,27:_,32:[1,267],33:24,34:W,36:y,38:F,42:28,43:39,44:N,45:40,47:41,60:j,84:Ie,85:h,86:k,87:he,88:pe,89:K,102:Y,105:H,106:q,109:Q,111:J,113:42,114:Z,115:ee,116:te,121:ct,122:ht,123:dt,124:pt,125:ft},t(Oe,[2,53]),{43:268,44:N,45:40,47:41,60:j,89:K,102:Y,105:H,106:q,109:Q,111:J,113:42,114:Z,115:ee,116:te},t(z,[2,121],{106:ot}),t(a1,[2,130],{108:270,10:Ee,60:Se,84:xe,105:Fe,109:_e,110:Be,111:Le,112:Ve}),t(me,[2,132]),t(me,[2,134]),t(me,[2,135]),t(me,[2,136]),t(me,[2,137]),t(me,[2,138]),t(me,[2,139]),t(me,[2,140]),t(me,[2,141]),t(z,[2,122],{106:ot}),{10:[1,271]},t(z,[2,123],{106:ot}),{10:[1,272]},t(r1,[2,129]),t(z,[2,105],{106:ot}),t(z,[2,106],{113:113,44:N,60:j,89:K,102:Y,105:H,106:q,109:Q,111:J,114:Z,115:ee,116:te}),t(z,[2,110]),t(z,[2,112],{10:[1,273]}),t(z,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:Ce,9:De,11:Te,21:278},t(G,[2,34]),t(Oe,[2,52]),{10:Ee,60:Se,84:xe,105:Fe,107:279,108:243,109:_e,110:Be,111:Le,112:Ve},t(me,[2,133]),{14:He,44:qe,60:Xe,89:Qe,101:280,105:Je,106:Ze,109:$e,111:st,114:it,115:rt,116:at,120:88},{14:He,44:qe,60:Xe,89:Qe,101:281,105:Je,106:Ze,109:$e,111:st,114:it,115:rt,116:at,120:88},{98:[1,282]},t(z,[2,120]),t(re,[2,58]),{30:283,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},t(re,[2,66]),t(Ct,g,{5:284}),t(a1,[2,131],{108:270,10:Ee,60:Se,84:xe,105:Fe,109:_e,110:Be,111:Le,112:Ve}),t(z,[2,126],{120:168,10:[1,285],14:He,44:qe,60:Xe,89:Qe,105:Je,106:Ze,109:$e,111:st,114:it,115:rt,116:at}),t(z,[2,127],{120:168,10:[1,286],14:He,44:qe,60:Xe,89:Qe,105:Je,106:Ze,109:$e,111:st,114:it,115:rt,116:at}),t(z,[2,114]),{31:[1,287],67:B,82:219,116:V,117:w,118:I},{6:11,7:12,8:d,9:D,10:f,11:U,20:17,22:18,23:19,24:20,25:21,26:22,27:_,32:[1,288],33:24,34:W,36:y,38:F,42:28,43:39,44:N,45:40,47:41,60:j,84:Ie,85:h,86:k,87:he,88:pe,89:K,102:Y,105:H,106:q,109:Q,111:J,113:42,114:Z,115:ee,116:te,121:ct,122:ht,123:dt,124:pt,125:ft},{10:Ee,60:Se,84:xe,92:289,105:Fe,107:242,108:243,109:_e,110:Be,111:Le,112:Ve},{10:Ee,60:Se,84:xe,92:290,105:Fe,107:242,108:243,109:_e,110:Be,111:Le,112:Ve},t(re,[2,62]),t(G,[2,33]),t(z,[2,124],{106:ot}),t(z,[2,125],{106:ot})],defaultActions:{},parseError:e(function(b,m){if(m.recoverable)this.trace(b);else{var x=Error(b);throw x.hash=m,x}},"parseError"),parse:e(function(b){var m=this,x=[0],o=[],O=[null],s=[],Me=this.table,i="",X=0,n1=0,u1=0,f1=2,o1=1,b1=s.slice.call(arguments,1),ie=Object.create(this.lexer),Ue={yy:{}};for(var Tt in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,Tt))Ue.yy[Tt]=this.yy[Tt];if(ie.setInput(b,Ue.yy),Ue.yy.lexer=ie,Ue.yy.parser=this,typeof ie.yylloc>"u")ie.yylloc={};var Et=ie.yylloc;s.push(Et);var k1=ie.options&&ie.options.ranges;if(typeof Ue.yy.parseError==="function")this.parseError=Ue.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function g1(Ae){x.length=x.length-2*Ae,O.length=O.length-Ae,s.length=s.length-Ae}e(g1,"popStack");function l1(){var Ae=o.pop()||ie.lex()||o1;if(typeof Ae!=="number"){if(Ae instanceof Array)o=Ae,Ae=o.pop();Ae=m.symbols_[Ae]||Ae}return Ae}e(l1,"lex");var de,St,We,ke,F1,yt,lt={},At,we,c1,mt;while(!0){if(We=x[x.length-1],this.defaultActions[We])ke=this.defaultActions[We];else{if(de===null||typeof de>"u")de=l1();ke=Me[We]&&Me[We][de]}if(typeof ke>"u"||!ke.length||!ke[0]){var xt="";mt=[];for(At in Me[We])if(this.terminals_[At]&&At>f1)mt.push("'"+this.terminals_[At]+"'");if(ie.showPosition)xt="Parse error on line "+(X+1)+`:
9
+ You have to call mermaid.initialize.`)}isLinkData(t){return t!==null&&typeof t==="object"&&"id"in t&&typeof t.id==="string"}addLink(t,r,n){let u=this.isLinkData(n)?n.id.replace("@",""):void 0;a.info("addLink",t,r,u);for(let c of t)for(let g of r){let d=c===t[t.length-1],D=g===r[0];if(d&&D)this.addSingleLink(c,g,n,u);else this.addSingleLink(c,g,n,void 0)}}updateLinkInterpolate(t,r){t.forEach((n)=>{if(n==="default")this.edges.defaultInterpolate=r;else this.edges[n].interpolate=r})}updateLink(t,r){t.forEach((n)=>{if(typeof n==="number"&&n>=this.edges.length)throw Error(`The index ${n} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);if(n==="default")this.edges.defaultStyle=r;else if(this.edges[n].style=r,(this.edges[n]?.style?.length??0)>0&&!this.edges[n]?.style?.some((u)=>u?.startsWith("fill")))this.edges[n]?.style?.push("fill:none")})}addClass(t,r){let n=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");t.split(",").forEach((u)=>{let c=this.classes.get(u);if(c===void 0)c={id:u,styles:[],textStyles:[]},this.classes.set(u,c);if(n!==void 0&&n!==null)n.forEach((g)=>{if(/color/.exec(g)){let d=g.replace("fill","bgFill");c.textStyles.push(d)}c.styles.push(g)})})}setDirection(t){if(this.direction=t.trim(),/.*</.exec(this.direction))this.direction="RL";if(/.*\^/.exec(this.direction))this.direction="BT";if(/.*>/.exec(this.direction))this.direction="LR";if(/.*v/.exec(this.direction))this.direction="TB";if(this.direction==="TD")this.direction="TB"}setClass(t,r){for(let n of t.split(",")){let u=this.vertices.get(n);if(u)u.classes.push(r);let c=this.edges.find((d)=>d.id===n);if(c)c.classes.push(r);let g=this.subGraphLookup.get(n);if(g)g.classes.push(r)}}setTooltip(t,r){if(r===void 0)return;r=this.sanitizeText(r);for(let n of t.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(n):n,r)}setClickFun(t,r,n){if(l().securityLevel!=="loose")return;if(r===void 0)return;let u=[];if(typeof n==="string"){u=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let g=0;g<u.length;g++){let d=u[g].trim();if(d.startsWith('"')&&d.endsWith('"'))d=d.substr(1,d.length-2);u[g]=d}}if(u.length===0)u.push(t);let c=this.vertices.get(t);if(c)c.haveCallback=!0,this.funs.push(()=>{let g=this.lookUpDomId(t),d=document.querySelector(`[id="${g}"]`);if(d!==null)d.addEventListener("click",()=>{M.runFunc(r,...u)},!1)})}setLink(t,r,n){t.split(",").forEach((u)=>{let c=this.vertices.get(u);if(c!==void 0)c.link=M.formatUrl(r,this.config),c.linkTarget=n}),this.setClass(t,"clickable")}getTooltip(t){return this.tooltips.get(t)}setClickEvent(t,r,n){t.split(",").forEach((u)=>{this.setClickFun(u,r,n)}),this.setClass(t,"clickable")}bindFunctions(t){this.funs.forEach((r)=>{r(t)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(t){let r=$t();p(t).select("svg").selectAll("g.node").on("mouseover",(c)=>{let g=p(c.currentTarget),d=g.attr("title");if(d===null)return;let D=c.currentTarget?.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(g.attr("title")).style("left",window.scrollX+D.left+(D.right-D.left)/2+"px").style("top",window.scrollY+D.bottom+"px"),r.html(Re.sanitize(d)),g.classed("hover",!0)}).on("mouseout",(c)=>{r.transition().duration(500).style("opacity",0),p(c.currentTarget).classed("hover",!1)})}clear(t="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=t,this.config=l(),C()}setGen(t){this.version=t||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(t,r,n){let u=t.text.trim(),c=n.text;if(t===n&&/\s/.exec(n.text))u=void 0;let d=e((y)=>{let F={boolean:{},number:{},string:{}},N=[],j;return{nodeList:y.filter(function(h){let k=typeof h;if(h.stmt&&h.stmt==="dir")return j=h.value,!1;if(h.trim()==="")return!1;if(k in F)return F[k].hasOwnProperty(h)?!1:F[k][h]=!0;else return N.includes(h)?!1:N.push(h)}),dir:j}},"uniq")(r.flat()),{nodeList:D,dir:f}=d,U=l().flowchart??{};if(f=f??(U.inheritDir?this.getDirection()??l().direction??void 0:void 0),this.version==="gen-1")for(let y=0;y<D.length;y++)D[y]=this.lookUpDomId(D[y]);u=u??"subGraph"+this.subCount,c=c||"",c=this.sanitizeText(c),this.subCount=this.subCount+1;let _={id:u,nodes:D,title:c.trim(),classes:[],dir:f,labelType:this.sanitizeNodeLabelType(n?.type)};a.info("Adding",_.id,_.nodes,_.dir),_.nodes=this.makeUniq(_,this.subGraphs).nodes.filter((y)=>y!==u);let W=this.subGraphs.find((y)=>y.id===u);if(W)W.nodes.push(..._.nodes);else this.subGraphs.push(_);return this.subGraphLookup.set(u,W??_),u}getPosForId(t){for(let[r,n]of this.subGraphs.entries())if(n.id===t)return r;return-1}indexNodes2(t,r){let n=this.subGraphs[r].nodes;if(this.secCount=this.secCount+1,this.secCount>2000)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===t)return{result:!0,count:0};let u=0,c=1;while(u<n.length){let g=this.getPosForId(n[u]);if(g>=0){let d=this.indexNodes2(t,g);if(d.result)return{result:!0,count:c+d.count};else c=c+d.count}u=u+1}return{result:!1,count:c}}getDepthFirstPos(t){return this.posCrossRef[t]}indexNodes(){if(this.secCount=-1,this.subGraphs.length>0)this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){if(this.firstGraphFlag)return this.firstGraphFlag=!1,!0;return!1}destructStartLink(t){let r=t.trim(),n="arrow_open";switch(r[0]){case"<":n="arrow_point",r=r.slice(1);break;case"x":n="arrow_cross",r=r.slice(1);break;case"o":n="arrow_circle",r=r.slice(1);break}let u="normal";if(r.includes("="))u="thick";if(r.includes("."))u="dotted";return{type:n,stroke:u}}countChar(t,r){let n=r.length,u=0;for(let c=0;c<n;++c)if(r[c]===t)++u;return u}destructEndLink(t){let r=t.trim(),n=r.slice(0,-1),u="arrow_open";switch(r.slice(-1)){case"x":if(u="arrow_cross",r.startsWith("x"))u="double_"+u,n=n.slice(1);break;case">":if(u="arrow_point",r.startsWith("<"))u="double_"+u,n=n.slice(1);break;case"o":if(u="arrow_circle",r.startsWith("o"))u="double_"+u,n=n.slice(1);break}let c="normal",g=n.length-1;if(n.startsWith("="))c="thick";if(n.startsWith("~"))c="invisible";let d=this.countChar(".",n);if(d)c="dotted",g=d;return{type:u,stroke:c,length:g}}destructLink(t,r){let n=this.destructEndLink(t),u;if(r){if(u=this.destructStartLink(r),u.stroke!==n.stroke)return{type:"INVALID",stroke:"INVALID"};if(u.type==="arrow_open")u.type=n.type;else{if(u.type!==n.type)return{type:"INVALID",stroke:"INVALID"};u.type="double_"+u.type}if(u.type==="double_arrow")u.type="double_arrow_point";return u.length=n.length,u}return n}exists(t,r){for(let n of t)if(n.nodes.includes(r))return!0;return!1}makeUniq(t,r){let n=[];return t.nodes.forEach((u,c)=>{if(!this.exists(r,u))n.push(t.nodes[c])}),{nodes:n}}getTypeFromVertex(t){if(t.img)return"imageSquare";if(t.icon){if(t.form==="circle")return"iconCircle";if(t.form==="square")return"iconSquare";if(t.form==="rounded")return"iconRounded";return"icon"}switch(t.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return t.type}}findNode(t,r){return t.find((n)=>n.id===r)}destructEdgeType(t){let r="none",n="arrow_point";switch(t){case"arrow_point":case"arrow_circle":case"arrow_cross":n=t;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=t.replace("double_",""),n=r;break}return{arrowTypeStart:r,arrowTypeEnd:n}}addNodeFromVertex(t,r,n,u,c,g){let d=n.get(t.id),D=u.get(t.id)??!1,f=this.findNode(r,t.id);if(f)f.cssStyles=t.styles,f.cssCompiledStyles=this.getCompiledStyles(t.classes),f.cssClasses=t.classes.join(" ");else{let U={id:t.id,label:t.text,labelType:t.labelType,labelStyle:"",parentId:d,padding:c.flowchart?.padding||8,cssStyles:t.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...t.classes]),cssClasses:"default "+t.classes.join(" "),dir:t.dir,domId:t.domId,look:g,link:t.link,linkTarget:t.linkTarget,tooltip:this.getTooltip(t.id),icon:t.icon,pos:t.pos,img:t.img,assetWidth:t.assetWidth,assetHeight:t.assetHeight,constraint:t.constraint};if(D)r.push({...U,isGroup:!0,shape:"rect"});else r.push({...U,isGroup:!1,shape:this.getTypeFromVertex(t),minWidth:c.flowchart?.minNodeWidth})}}getCompiledStyles(t){let r=[];for(let n of t){let u=this.classes.get(n);if(u?.styles)r=[...r,...u.styles??[]].map((c)=>c.trim());if(u?.textStyles)r=[...r,...u.textStyles??[]].map((c)=>c.trim())}return r}getData(){let t=l(),r=[],n=[],u=this.getSubGraphs(),c=new Map,g=new Map,d=new Map;for(let h of u)for(let k of h.nodes)if(this.subGraphLookup.has(k))d.set(k,h.id);let D=new Map,f=new Map;for(let h of u){let k=d.get(h.id);if(k!==void 0)f.set(k,[...f.get(k)??[],h.id])}let U=0,_=e((h)=>{D.set(h,U++);for(let k of f.get(h)??[])_(k)},"walk");for(let h of u)if(!d.has(h.id))_(h.id);let W=e((h)=>this.subGraphLookup.get(h)?.metadata?.view==="collapsed","isCollapsed"),y=e((h)=>{let k,de=new Set,fe=h;while(fe!==void 0&&!de.has(fe)){if(de.add(fe),W(fe))k=fe;fe=d.get(fe)}return k},"outermostCollapsed"),F=new Set,N=new Map;for(let h of u){let k=y(h.id);if(k===void 0)continue;if(h.id!==k)F.add(h.id),N.set(h.id,k);for(let de of h.nodes){if(de===k)continue;F.add(de),N.set(de,k)}}for(let h=u.length-1;h>=0;h--){let k=u[h];if(F.has(k.id))continue;if(k.nodes.length>0)g.set(k.id,!0);for(let de of k.nodes)c.set(de,k.id)}for(let h=u.length-1;h>=0;h--){let k=u[h];if(F.has(k.id))continue;if(k.metadata?.view==="collapsed")r.push({id:k.id,label:k.title,labelStyle:"",labelType:k.labelType,parentId:c.get(k.id),padding:8,cssCompiledStyles:this.getCompiledStyles(k.classes),cssClasses:k.classes.join(" "),shape:"collapsedGroup",dir:k.dir,isGroup:!1,look:t.look,colorIndex:D.get(k.id)});else r.push({id:k.id,label:k.title,labelStyle:"",labelType:k.labelType,parentId:c.get(k.id),padding:8,cssCompiledStyles:this.getCompiledStyles(k.classes),cssClasses:k.classes.join(" "),shape:"rect",dir:k.dir,isGroup:!0,look:t.look,colorIndex:D.get(k.id),metadata:k.metadata})}this.getVertices().forEach((h)=>{if(F.has(h.id))return;this.addNodeFromVertex(h,r,c,g,t,t.look||"classic")});let Ie=this.getEdges();return Ie.forEach((h,k)=>{let{arrowTypeStart:de,arrowTypeEnd:fe}=this.destructEdgeType(h.type),K=[...Ie.defaultStyle??[]],Y=N.get(h.start)??h.start,H=N.get(h.end)??h.end;if(Y===H&&(N.has(h.start)||N.has(h.end)))return;if(h.style)K.push(...h.style);let q={id:ze(Y,H,{counter:k,prefix:"L"},h.id),isUserDefinedId:h.isUserDefinedId,start:Y,end:H,type:h.type??"normal",label:h.text,labelType:h.labelType,labelpos:"c",thickness:h.stroke,minlen:h.length,classes:h?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:h?.stroke==="invisible"||h?.type==="arrow_open"?"none":de,arrowTypeEnd:h?.stroke==="invisible"||h?.type==="arrow_open"?"none":fe,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(h.classes),labelStyle:K,style:K,pattern:h.stroke,look:t.look,animate:h.animate,animation:h.animation,curve:h.interpolate||this.edges.defaultInterpolate||t.flowchart?.curve};n.push(q)}),{nodes:r,edges:n,other:{},config:t}}defaultConfig(){return An.flowchart}},C1=e(function(t,r){return r.db.getClasses()},"getClasses"),D1=e(async function(t,r,n,u){a.info("REF0:"),a.info("Drawing state diagram (v2)",r);let{securityLevel:c,flowchart:g,layout:d}=l();u.db.setDiagramId(r),a.debug("Before getData: ");let D=u.db.getData();a.debug("Data: ",D);let f=he(r,c),U=u.db.getDirection();D.type=u.type,D.layoutAlgorithm=ye(d),D.direction=U,D.nodeSpacing=g?.nodeSpacing||50,D.rankSpacing=g?.rankSpacing||50,D.markers=["point","circle","cross"],D.diagramId=r,a.debug("REF1:",D),await ge(D,f);let _=D.config.flowchart?.diagramPadding??8;M.insertTitle(f,"flowchartTitleText",g?.titleTopMargin||0,u.db.getDiagramTitle()),le(f,_,"flowchart",g?.useMaxWidth||!1)},"draw"),T1={getClasses:C1,draw:D1},Ft=function(){var t=e(function(Pe,b,m,x){for(m=m||{},x=Pe.length;x--;m[Pe[x]]=b);return m},"o"),r=[1,4],n=[1,3],u=[1,5],c=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],g=[2,2],d=[1,13],D=[1,14],f=[1,15],U=[1,16],_=[1,23],W=[1,25],y=[1,26],F=[1,27],N=[1,50],j=[1,49],Ie=[1,29],h=[1,30],k=[1,31],de=[1,32],fe=[1,33],K=[1,45],Y=[1,47],H=[1,43],q=[1,48],Q=[1,44],J=[1,51],Z=[1,46],ee=[1,52],te=[1,53],ct=[1,34],ht=[1,35],dt=[1,36],pt=[1,37],ft=[1,38],Ne=[1,58],G=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],De=[1,62],Te=[1,61],Ee=[1,63],Ke=[8,9,11,75,77,78],_t=[1,79],He=[1,92],qe=[1,97],Xe=[1,96],Qe=[1,93],Je=[1,89],Ze=[1,95],$e=[1,91],st=[1,98],it=[1,94],rt=[1,99],at=[1,90],Oe=[8,9,10,11,40,75,77,78],re=[8,9,10,11,40,46,75,77,78],be=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],vt=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],nt=[44,60,89,102,105,106,109,111,114,115,116],Lt=[1,122],Vt=[1,123],bt=[1,125],kt=[1,124],wt=[44,60,62,74,89,102,105,106,109,111,114,115,116],It=[1,134],Rt=[1,148],Nt=[1,149],Gt=[1,150],Pt=[1,151],Ot=[1,136],Mt=[1,138],Ut=[1,142],Wt=[1,143],zt=[1,144],jt=[1,145],Kt=[1,146],Yt=[1,147],Ht=[1,152],qt=[1,153],Xt=[1,132],Qt=[1,133],Jt=[1,140],Zt=[1,135],e1=[1,139],t1=[1,137],Ct=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],s1=[1,155],i1=[1,157],z=[8,9,11],ke=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],B=[1,177],ae=[1,173],ne=[1,174],V=[1,178],w=[1,175],I=[1,176],ut=[77,116,119],P=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],r1=[10,106],Ge=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],Se=[1,248],xe=[1,246],Fe=[1,250],_e=[1,244],Be=[1,245],ve=[1,247],Le=[1,249],Ve=[1,251],ot=[1,269],a1=[8,9,11,106],Ce=[8,9,10,11,60,84,105,106,109,110,111,112],Dt={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:e(function(b,m,x,o,O,s,Me){var i=s.length-1;switch(O){case 2:this.$=[];break;case 3:if(!Array.isArray(s[i])||s[i].length>0)s[i-1].push(s[i]);this.$=s[i-1];break;case 4:case 183:this.$=s[i];break;case 11:o.setDirection("TB"),this.$="TB";break;case 12:o.setDirection(s[i-1]),this.$=s[i-1];break;case 27:this.$=s[i-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=o.addSubGraph(s[i-6],s[i-1],s[i-4]);break;case 34:this.$=o.addSubGraph(s[i-3],s[i-1],s[i-3]);break;case 35:this.$=o.addSubGraph(void 0,s[i-1],void 0);break;case 37:this.$=s[i].trim(),o.setAccTitle(this.$);break;case 38:case 39:this.$=s[i].trim(),o.setAccDescription(this.$);break;case 43:this.$=s[i-1]+s[i];break;case 44:this.$=s[i];break;case 45:o.addVertex(s[i-1][s[i-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i]),o.addLink(s[i-3].stmt,s[i-1],s[i-2]),this.$={stmt:s[i-1],nodes:s[i-1].concat(s[i-3].nodes)};break;case 46:o.addLink(s[i-2].stmt,s[i],s[i-1]),this.$={stmt:s[i],nodes:s[i].concat(s[i-2].nodes)};break;case 47:o.addLink(s[i-3].stmt,s[i-1],s[i-2]),this.$={stmt:s[i-1],nodes:s[i-1].concat(s[i-3].nodes)};break;case 48:this.$={stmt:s[i-1],nodes:s[i-1]};break;case 49:o.addVertex(s[i-1][s[i-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i]),this.$={stmt:s[i-1],nodes:s[i-1],shapeData:s[i]};break;case 50:this.$={stmt:s[i],nodes:s[i]};break;case 51:this.$=[s[i]];break;case 52:o.addVertex(s[i-5][s[i-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i-4]),this.$=s[i-5].concat(s[i]);break;case 53:this.$=s[i-4].concat(s[i]);break;case 54:this.$=s[i];break;case 55:this.$=s[i-2],o.setClass(s[i-2],s[i]);break;case 56:this.$=s[i-3],o.addVertex(s[i-3],s[i-1],"square");break;case 57:this.$=s[i-3],o.addVertex(s[i-3],s[i-1],"doublecircle");break;case 58:this.$=s[i-5],o.addVertex(s[i-5],s[i-2],"circle");break;case 59:this.$=s[i-3],o.addVertex(s[i-3],s[i-1],"ellipse");break;case 60:this.$=s[i-3],o.addVertex(s[i-3],s[i-1],"stadium");break;case 61:this.$=s[i-3],o.addVertex(s[i-3],s[i-1],"subroutine");break;case 62:this.$=s[i-7],o.addVertex(s[i-7],s[i-1],"rect",void 0,void 0,void 0,Object.fromEntries([[s[i-5],s[i-3]]]));break;case 63:this.$=s[i-3],o.addVertex(s[i-3],s[i-1],"cylinder");break;case 64:this.$=s[i-3],o.addVertex(s[i-3],s[i-1],"round");break;case 65:this.$=s[i-3],o.addVertex(s[i-3],s[i-1],"diamond");break;case 66:this.$=s[i-5],o.addVertex(s[i-5],s[i-2],"hexagon");break;case 67:this.$=s[i-3],o.addVertex(s[i-3],s[i-1],"odd");break;case 68:this.$=s[i-3],o.addVertex(s[i-3],s[i-1],"trapezoid");break;case 69:this.$=s[i-3],o.addVertex(s[i-3],s[i-1],"inv_trapezoid");break;case 70:this.$=s[i-3],o.addVertex(s[i-3],s[i-1],"lean_right");break;case 71:this.$=s[i-3],o.addVertex(s[i-3],s[i-1],"lean_left");break;case 72:this.$=s[i],o.addVertex(s[i]);break;case 73:s[i-1].text=s[i],this.$=s[i-1];break;case 74:case 75:s[i-2].text=s[i-1],this.$=s[i-2];break;case 76:this.$=s[i];break;case 77:var X=o.destructLink(s[i],s[i-2]);this.$={type:X.type,stroke:X.stroke,length:X.length,text:s[i-1]};break;case 78:var X=o.destructLink(s[i],s[i-2]);this.$={type:X.type,stroke:X.stroke,length:X.length,text:s[i-1],id:s[i-3]};break;case 79:this.$={text:s[i],type:"text"};break;case 80:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 81:this.$={text:s[i],type:"string"};break;case 82:this.$={text:s[i],type:"markdown"};break;case 83:var X=o.destructLink(s[i]);this.$={type:X.type,stroke:X.stroke,length:X.length};break;case 84:var X=o.destructLink(s[i]);this.$={type:X.type,stroke:X.stroke,length:X.length,id:s[i-1]};break;case 85:this.$=s[i-1];break;case 86:this.$={text:s[i],type:"text"};break;case 87:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 88:this.$={text:s[i],type:"string"};break;case 89:case 104:this.$={text:s[i],type:"markdown"};break;case 101:this.$={text:s[i],type:"text"};break;case 102:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 103:this.$={text:s[i],type:"text"};break;case 105:this.$=s[i-4],o.addClass(s[i-2],s[i]);break;case 106:this.$=s[i-4],o.setClass(s[i-2],s[i]);break;case 107:case 115:this.$=s[i-1],o.setClickEvent(s[i-1],s[i]);break;case 108:case 116:this.$=s[i-3],o.setClickEvent(s[i-3],s[i-2]),o.setTooltip(s[i-3],s[i]);break;case 109:this.$=s[i-2],o.setClickEvent(s[i-2],s[i-1],s[i]);break;case 110:this.$=s[i-4],o.setClickEvent(s[i-4],s[i-3],s[i-2]),o.setTooltip(s[i-4],s[i]);break;case 111:this.$=s[i-2],o.setLink(s[i-2],s[i]);break;case 112:this.$=s[i-4],o.setLink(s[i-4],s[i-2]),o.setTooltip(s[i-4],s[i]);break;case 113:this.$=s[i-4],o.setLink(s[i-4],s[i-2],s[i]);break;case 114:this.$=s[i-6],o.setLink(s[i-6],s[i-4],s[i]),o.setTooltip(s[i-6],s[i-2]);break;case 117:this.$=s[i-1],o.setLink(s[i-1],s[i]);break;case 118:this.$=s[i-3],o.setLink(s[i-3],s[i-2]),o.setTooltip(s[i-3],s[i]);break;case 119:this.$=s[i-3],o.setLink(s[i-3],s[i-2],s[i]);break;case 120:this.$=s[i-5],o.setLink(s[i-5],s[i-4],s[i]),o.setTooltip(s[i-5],s[i-2]);break;case 121:this.$=s[i-4],o.addVertex(s[i-2],void 0,void 0,s[i]);break;case 122:this.$=s[i-4],o.updateLink([s[i-2]],s[i]);break;case 123:this.$=s[i-4],o.updateLink(s[i-2],s[i]);break;case 124:this.$=s[i-8],o.updateLinkInterpolate([s[i-6]],s[i-2]),o.updateLink([s[i-6]],s[i]);break;case 125:this.$=s[i-8],o.updateLinkInterpolate(s[i-6],s[i-2]),o.updateLink(s[i-6],s[i]);break;case 126:this.$=s[i-6],o.updateLinkInterpolate([s[i-4]],s[i]);break;case 127:this.$=s[i-6],o.updateLinkInterpolate(s[i-4],s[i]);break;case 128:case 130:this.$=[s[i]];break;case 129:case 131:s[i-2].push(s[i]),this.$=s[i-2];break;case 133:this.$=s[i-1]+s[i];break;case 181:this.$=s[i];break;case 182:this.$=s[i-1]+""+s[i];break;case 184:this.$=s[i-1]+""+s[i];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:r,10:n,12:u},{1:[3]},t(c,g,{5:6}),{4:7,9:r,10:n,12:u},{4:8,9:r,10:n,12:u},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:d,9:D,10:f,11:U,20:17,22:18,23:19,24:20,25:21,26:22,27:_,33:24,34:W,36:y,38:F,42:28,43:39,44:N,45:40,47:41,60:j,84:Ie,85:h,86:k,87:de,88:fe,89:K,102:Y,105:H,106:q,109:Q,111:J,113:42,114:Z,115:ee,116:te,121:ct,122:ht,123:dt,124:pt,125:ft},t(c,[2,9]),t(c,[2,10]),t(c,[2,11]),{8:[1,55],9:[1,56],10:Ne,15:54,18:57},t(G,[2,3]),t(G,[2,4]),t(G,[2,5]),t(G,[2,6]),t(G,[2,7]),t(G,[2,8]),{8:De,9:Te,11:Ee,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:De,9:Te,11:Ee,21:68},{8:De,9:Te,11:Ee,21:69},{8:De,9:Te,11:Ee,21:70},{8:De,9:Te,11:Ee,21:71},{8:De,9:Te,11:Ee,21:72},{8:De,9:Te,10:[1,73],11:Ee,21:74},t(G,[2,36]),{35:[1,75]},{37:[1,76]},t(G,[2,39]),t(Ke,[2,50],{18:77,39:78,10:Ne,40:_t}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:He,44:qe,60:Xe,80:[1,87],89:Qe,95:[1,84],97:[1,85],101:86,105:Je,106:Ze,109:$e,111:st,114:it,115:rt,116:at,120:88},t(G,[2,185]),t(G,[2,186]),t(G,[2,187]),t(G,[2,188]),t(G,[2,189]),t(Oe,[2,51]),t(Oe,[2,54],{46:[1,100]}),t(re,[2,72],{113:113,29:[1,101],44:N,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:j,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:K,102:Y,105:H,106:q,109:Q,111:J,114:Z,115:ee,116:te}),t(be,[2,181]),t(be,[2,142]),t(be,[2,143]),t(be,[2,144]),t(be,[2,145]),t(be,[2,146]),t(be,[2,147]),t(be,[2,148]),t(be,[2,149]),t(be,[2,150]),t(be,[2,151]),t(be,[2,152]),t(c,[2,12]),t(c,[2,18]),t(c,[2,19]),{9:[1,114]},t(vt,[2,26],{18:115,10:Ne}),t(G,[2,27]),{42:116,43:39,44:N,45:40,47:41,60:j,89:K,102:Y,105:H,106:q,109:Q,111:J,113:42,114:Z,115:ee,116:te},t(G,[2,40]),t(G,[2,41]),t(G,[2,42]),t(nt,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:Lt,81:Vt,116:bt,119:kt},{75:[1,126],77:[1,127]},t(wt,[2,83]),t(G,[2,28]),t(G,[2,29]),t(G,[2,30]),t(G,[2,31]),t(G,[2,32]),{10:It,12:Rt,14:Nt,27:Gt,28:128,32:Pt,44:Ot,60:Mt,75:Ut,80:[1,130],81:[1,131],83:141,84:Wt,85:zt,86:jt,87:Kt,88:Yt,89:Ht,90:qt,91:129,105:Xt,109:Qt,111:Jt,114:Zt,115:e1,116:t1},t(Ct,g,{5:154}),t(G,[2,37]),t(G,[2,38]),t(Ke,[2,48],{44:s1}),t(Ke,[2,49],{18:156,10:Ne,40:i1}),t(Oe,[2,44]),{44:N,47:158,60:j,89:K,102:Y,105:H,106:q,109:Q,111:J,113:42,114:Z,115:ee,116:te},{102:[1,159],103:160,105:[1,161]},{44:N,47:162,60:j,89:K,102:Y,105:H,106:q,109:Q,111:J,113:42,114:Z,115:ee,116:te},{44:N,47:163,60:j,89:K,102:Y,105:H,106:q,109:Q,111:J,113:42,114:Z,115:ee,116:te},t(z,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},t(z,[2,115],{120:168,10:[1,167],14:He,44:qe,60:Xe,89:Qe,105:Je,106:Ze,109:$e,111:st,114:it,115:rt,116:at}),t(z,[2,117],{10:[1,169]}),t(ke,[2,183]),t(ke,[2,170]),t(ke,[2,171]),t(ke,[2,172]),t(ke,[2,173]),t(ke,[2,174]),t(ke,[2,175]),t(ke,[2,176]),t(ke,[2,177]),t(ke,[2,178]),t(ke,[2,179]),t(ke,[2,180]),{44:N,47:170,60:j,89:K,102:Y,105:H,106:q,109:Q,111:J,113:42,114:Z,115:ee,116:te},{30:171,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},{30:179,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},{30:181,50:[1,180],67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},{30:182,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},{30:183,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},{30:184,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},{109:[1,185]},{30:186,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},{30:187,65:[1,188],67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},{30:189,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},{30:190,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},{30:191,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},t(be,[2,182]),t(c,[2,20]),t(vt,[2,25]),t(Ke,[2,46],{39:192,18:193,10:Ne,40:_t}),t(nt,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},{77:[1,197],79:198,116:bt,119:kt},t(ut,[2,79]),t(ut,[2,81]),t(ut,[2,82]),t(ut,[2,168]),t(ut,[2,169]),{76:199,79:121,80:Lt,81:Vt,116:bt,119:kt},t(wt,[2,84]),{8:De,9:Te,10:It,11:Ee,12:Rt,14:Nt,21:201,27:Gt,29:[1,200],32:Pt,44:Ot,60:Mt,75:Ut,83:141,84:Wt,85:zt,86:jt,87:Kt,88:Yt,89:Ht,90:qt,91:202,105:Xt,109:Qt,111:Jt,114:Zt,115:e1,116:t1},t(P,[2,101]),t(P,[2,103]),t(P,[2,104]),t(P,[2,157]),t(P,[2,158]),t(P,[2,159]),t(P,[2,160]),t(P,[2,161]),t(P,[2,162]),t(P,[2,163]),t(P,[2,164]),t(P,[2,165]),t(P,[2,166]),t(P,[2,167]),t(P,[2,90]),t(P,[2,91]),t(P,[2,92]),t(P,[2,93]),t(P,[2,94]),t(P,[2,95]),t(P,[2,96]),t(P,[2,97]),t(P,[2,98]),t(P,[2,99]),t(P,[2,100]),{6:11,7:12,8:d,9:D,10:f,11:U,20:17,22:18,23:19,24:20,25:21,26:22,27:_,32:[1,203],33:24,34:W,36:y,38:F,42:28,43:39,44:N,45:40,47:41,60:j,84:Ie,85:h,86:k,87:de,88:fe,89:K,102:Y,105:H,106:q,109:Q,111:J,113:42,114:Z,115:ee,116:te,121:ct,122:ht,123:dt,124:pt,125:ft},{10:Ne,18:204},{44:[1,205]},t(Oe,[2,43]),{10:[1,206],44:N,60:j,89:K,102:Y,105:H,106:q,109:Q,111:J,113:113,114:Z,115:ee,116:te},{10:[1,207]},{10:[1,208],106:[1,209]},t(r1,[2,128]),{10:[1,210],44:N,60:j,89:K,102:Y,105:H,106:q,109:Q,111:J,113:113,114:Z,115:ee,116:te},{10:[1,211],44:N,60:j,89:K,102:Y,105:H,106:q,109:Q,111:J,113:113,114:Z,115:ee,116:te},{80:[1,212]},t(z,[2,109],{10:[1,213]}),t(z,[2,111],{10:[1,214]}),{80:[1,215]},t(ke,[2,184]),{80:[1,216],98:[1,217]},t(Oe,[2,55],{113:113,44:N,60:j,89:K,102:Y,105:H,106:q,109:Q,111:J,114:Z,115:ee,116:te}),{31:[1,218],67:B,82:219,116:V,117:w,118:I},t(Ge,[2,86]),t(Ge,[2,88]),t(Ge,[2,89]),t(Ge,[2,153]),t(Ge,[2,154]),t(Ge,[2,155]),t(Ge,[2,156]),{49:[1,220],67:B,82:219,116:V,117:w,118:I},{30:221,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},{51:[1,222],67:B,82:219,116:V,117:w,118:I},{53:[1,223],67:B,82:219,116:V,117:w,118:I},{55:[1,224],67:B,82:219,116:V,117:w,118:I},{57:[1,225],67:B,82:219,116:V,117:w,118:I},{60:[1,226]},{64:[1,227],67:B,82:219,116:V,117:w,118:I},{66:[1,228],67:B,82:219,116:V,117:w,118:I},{30:229,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},{31:[1,230],67:B,82:219,116:V,117:w,118:I},{67:B,69:[1,231],71:[1,232],82:219,116:V,117:w,118:I},{67:B,69:[1,234],71:[1,233],82:219,116:V,117:w,118:I},t(Ke,[2,45],{18:156,10:Ne,40:i1}),t(Ke,[2,47],{44:s1}),t(nt,[2,75]),t(nt,[2,74]),{62:[1,235],67:B,82:219,116:V,117:w,118:I},t(nt,[2,77]),t(ut,[2,80]),{77:[1,236],79:198,116:bt,119:kt},{30:237,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},t(Ct,g,{5:238}),t(P,[2,102]),t(G,[2,35]),{43:239,44:N,45:40,47:41,60:j,89:K,102:Y,105:H,106:q,109:Q,111:J,113:42,114:Z,115:ee,116:te},{10:Ne,18:240},{10:Se,60:xe,84:Fe,92:241,105:_e,107:242,108:243,109:Be,110:ve,111:Le,112:Ve},{10:Se,60:xe,84:Fe,92:252,104:[1,253],105:_e,107:242,108:243,109:Be,110:ve,111:Le,112:Ve},{10:Se,60:xe,84:Fe,92:254,104:[1,255],105:_e,107:242,108:243,109:Be,110:ve,111:Le,112:Ve},{105:[1,256]},{10:Se,60:xe,84:Fe,92:257,105:_e,107:242,108:243,109:Be,110:ve,111:Le,112:Ve},{44:N,47:258,60:j,89:K,102:Y,105:H,106:q,109:Q,111:J,113:42,114:Z,115:ee,116:te},t(z,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},t(z,[2,116]),t(z,[2,118],{10:[1,262]}),t(z,[2,119]),t(re,[2,56]),t(Ge,[2,87]),t(re,[2,57]),{51:[1,263],67:B,82:219,116:V,117:w,118:I},t(re,[2,64]),t(re,[2,59]),t(re,[2,60]),t(re,[2,61]),{109:[1,264]},t(re,[2,63]),t(re,[2,65]),{66:[1,265],67:B,82:219,116:V,117:w,118:I},t(re,[2,67]),t(re,[2,68]),t(re,[2,70]),t(re,[2,69]),t(re,[2,71]),t([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),t(nt,[2,78]),{31:[1,266],67:B,82:219,116:V,117:w,118:I},{6:11,7:12,8:d,9:D,10:f,11:U,20:17,22:18,23:19,24:20,25:21,26:22,27:_,32:[1,267],33:24,34:W,36:y,38:F,42:28,43:39,44:N,45:40,47:41,60:j,84:Ie,85:h,86:k,87:de,88:fe,89:K,102:Y,105:H,106:q,109:Q,111:J,113:42,114:Z,115:ee,116:te,121:ct,122:ht,123:dt,124:pt,125:ft},t(Oe,[2,53]),{43:268,44:N,45:40,47:41,60:j,89:K,102:Y,105:H,106:q,109:Q,111:J,113:42,114:Z,115:ee,116:te},t(z,[2,121],{106:ot}),t(a1,[2,130],{108:270,10:Se,60:xe,84:Fe,105:_e,109:Be,110:ve,111:Le,112:Ve}),t(Ce,[2,132]),t(Ce,[2,134]),t(Ce,[2,135]),t(Ce,[2,136]),t(Ce,[2,137]),t(Ce,[2,138]),t(Ce,[2,139]),t(Ce,[2,140]),t(Ce,[2,141]),t(z,[2,122],{106:ot}),{10:[1,271]},t(z,[2,123],{106:ot}),{10:[1,272]},t(r1,[2,129]),t(z,[2,105],{106:ot}),t(z,[2,106],{113:113,44:N,60:j,89:K,102:Y,105:H,106:q,109:Q,111:J,114:Z,115:ee,116:te}),t(z,[2,110]),t(z,[2,112],{10:[1,273]}),t(z,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:De,9:Te,11:Ee,21:278},t(G,[2,34]),t(Oe,[2,52]),{10:Se,60:xe,84:Fe,105:_e,107:279,108:243,109:Be,110:ve,111:Le,112:Ve},t(Ce,[2,133]),{14:He,44:qe,60:Xe,89:Qe,101:280,105:Je,106:Ze,109:$e,111:st,114:it,115:rt,116:at,120:88},{14:He,44:qe,60:Xe,89:Qe,101:281,105:Je,106:Ze,109:$e,111:st,114:it,115:rt,116:at,120:88},{98:[1,282]},t(z,[2,120]),t(re,[2,58]),{30:283,67:B,80:ae,81:ne,82:172,116:V,117:w,118:I},t(re,[2,66]),t(Ct,g,{5:284}),t(a1,[2,131],{108:270,10:Se,60:xe,84:Fe,105:_e,109:Be,110:ve,111:Le,112:Ve}),t(z,[2,126],{120:168,10:[1,285],14:He,44:qe,60:Xe,89:Qe,105:Je,106:Ze,109:$e,111:st,114:it,115:rt,116:at}),t(z,[2,127],{120:168,10:[1,286],14:He,44:qe,60:Xe,89:Qe,105:Je,106:Ze,109:$e,111:st,114:it,115:rt,116:at}),t(z,[2,114]),{31:[1,287],67:B,82:219,116:V,117:w,118:I},{6:11,7:12,8:d,9:D,10:f,11:U,20:17,22:18,23:19,24:20,25:21,26:22,27:_,32:[1,288],33:24,34:W,36:y,38:F,42:28,43:39,44:N,45:40,47:41,60:j,84:Ie,85:h,86:k,87:de,88:fe,89:K,102:Y,105:H,106:q,109:Q,111:J,113:42,114:Z,115:ee,116:te,121:ct,122:ht,123:dt,124:pt,125:ft},{10:Se,60:xe,84:Fe,92:289,105:_e,107:242,108:243,109:Be,110:ve,111:Le,112:Ve},{10:Se,60:xe,84:Fe,92:290,105:_e,107:242,108:243,109:Be,110:ve,111:Le,112:Ve},t(re,[2,62]),t(G,[2,33]),t(z,[2,124],{106:ot}),t(z,[2,125],{106:ot})],defaultActions:{},parseError:e(function(b,m){if(m.recoverable)this.trace(b);else{var x=Error(b);throw x.hash=m,x}},"parseError"),parse:e(function(b){var m=this,x=[0],o=[],O=[null],s=[],Me=this.table,i="",X=0,n1=0,u1=0,f1=2,o1=1,b1=s.slice.call(arguments,1),ie=Object.create(this.lexer),Ue={yy:{}};for(var Tt in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,Tt))Ue.yy[Tt]=this.yy[Tt];if(ie.setInput(b,Ue.yy),Ue.yy.lexer=ie,Ue.yy.parser=this,typeof ie.yylloc>"u")ie.yylloc={};var Et=ie.yylloc;s.push(Et);var k1=ie.options&&ie.options.ranges;if(typeof Ue.yy.parseError==="function")this.parseError=Ue.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function g1(me){x.length=x.length-2*me,O.length=O.length-me,s.length=s.length-me}e(g1,"popStack");function l1(){var me=o.pop()||ie.lex()||o1;if(typeof me!=="number"){if(me instanceof Array)o=me,me=o.pop();me=m.symbols_[me]||me}return me}e(l1,"lex");var pe,St,We,Ae,F1,yt,lt={},At,we,c1,mt;while(!0){if(We=x[x.length-1],this.defaultActions[We])Ae=this.defaultActions[We];else{if(pe===null||typeof pe>"u")pe=l1();Ae=Me[We]&&Me[We][pe]}if(typeof Ae>"u"||!Ae.length||!Ae[0]){var xt="";mt=[];for(At in Me[We])if(this.terminals_[At]&&At>f1)mt.push("'"+this.terminals_[At]+"'");if(ie.showPosition)xt="Parse error on line "+(X+1)+`:
10
10
  `+ie.showPosition()+`
11
- Expecting `+mt.join(", ")+", got '"+(this.terminals_[de]||de)+"'";else xt="Parse error on line "+(X+1)+": Unexpected "+(de==o1?"end of input":"'"+(this.terminals_[de]||de)+"'");this.parseError(xt,{text:ie.match,token:this.terminals_[de]||de,line:ie.yylineno,loc:Et,expected:mt})}if(ke[0]instanceof Array&&ke.length>1)throw Error("Parse Error: multiple actions possible at state: "+We+", token: "+de);switch(ke[0]){case 1:if(x.push(de),O.push(ie.yytext),s.push(ie.yylloc),x.push(ke[1]),de=null,!St){if(n1=ie.yyleng,i=ie.yytext,X=ie.yylineno,Et=ie.yylloc,u1>0)u1--}else de=St,St=null;break;case 2:if(we=this.productions_[ke[1]][1],lt.$=O[O.length-we],lt._$={first_line:s[s.length-(we||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(we||1)].first_column,last_column:s[s.length-1].last_column},k1)lt._$.range=[s[s.length-(we||1)].range[0],s[s.length-1].range[1]];if(yt=this.performAction.apply(lt,[i,n1,X,Ue.yy,ke[1],O,s].concat(b1)),typeof yt<"u")return yt;if(we)x=x.slice(0,-1*we*2),O=O.slice(0,-1*we),s=s.slice(0,-1*we);x.push(this.productions_[ke[1]][0]),O.push(lt.$),s.push(lt._$),c1=Me[x[x.length-2]][x[x.length-1]],x.push(c1);break;case 3:return!0}}return!0},"parse")},p1=function(){var Pe={EOF:1,parseError:e(function(m,x){if(this.yy.parser)this.yy.parser.parseError(m,x);else throw Error(m)},"parseError"),setInput:e(function(b,m){if(this.yy=m||this.yy||{},this._input=b,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];return this.offset=0,this},"setInput"),input:e(function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var m=b.match(/(?:\r\n?|\n).*/g);if(m)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),b},"input"),unput:e(function(b){var m=b.length,x=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-m),this.offset-=m;var o=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1)this.yylineno-=x.length-1;var O=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===o.length?this.yylloc.first_column:0)+o[o.length-x.length].length-x[0].length:this.yylloc.first_column-m},this.options.ranges)this.yylloc.range=[O[0],O[0]+this.yyleng-m];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(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).
11
+ Expecting `+mt.join(", ")+", got '"+(this.terminals_[pe]||pe)+"'";else xt="Parse error on line "+(X+1)+": Unexpected "+(pe==o1?"end of input":"'"+(this.terminals_[pe]||pe)+"'");this.parseError(xt,{text:ie.match,token:this.terminals_[pe]||pe,line:ie.yylineno,loc:Et,expected:mt})}if(Ae[0]instanceof Array&&Ae.length>1)throw Error("Parse Error: multiple actions possible at state: "+We+", token: "+pe);switch(Ae[0]){case 1:if(x.push(pe),O.push(ie.yytext),s.push(ie.yylloc),x.push(Ae[1]),pe=null,!St){if(n1=ie.yyleng,i=ie.yytext,X=ie.yylineno,Et=ie.yylloc,u1>0)u1--}else pe=St,St=null;break;case 2:if(we=this.productions_[Ae[1]][1],lt.$=O[O.length-we],lt._$={first_line:s[s.length-(we||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(we||1)].first_column,last_column:s[s.length-1].last_column},k1)lt._$.range=[s[s.length-(we||1)].range[0],s[s.length-1].range[1]];if(yt=this.performAction.apply(lt,[i,n1,X,Ue.yy,Ae[1],O,s].concat(b1)),typeof yt<"u")return yt;if(we)x=x.slice(0,-1*we*2),O=O.slice(0,-1*we),s=s.slice(0,-1*we);x.push(this.productions_[Ae[1]][0]),O.push(lt.$),s.push(lt._$),c1=Me[x[x.length-2]][x[x.length-1]],x.push(c1);break;case 3:return!0}}return!0},"parse")},p1=function(){var Pe={EOF:1,parseError:e(function(m,x){if(this.yy.parser)this.yy.parser.parseError(m,x);else throw Error(m)},"parseError"),setInput:e(function(b,m){if(this.yy=m||this.yy||{},this._input=b,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];return this.offset=0,this},"setInput"),input:e(function(){var b=this._input[0];this.yytext+=b,this.yyleng++,this.offset++,this.match+=b,this.matched+=b;var m=b.match(/(?:\r\n?|\n).*/g);if(m)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),b},"input"),unput:e(function(b){var m=b.length,x=b.split(/(?:\r\n?|\n)/g);this._input=b+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-m),this.offset-=m;var o=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1)this.yylineno-=x.length-1;var O=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===o.length?this.yylloc.first_column:0)+o[o.length-x.length].length-x[0].length:this.yylloc.first_column-m},this.options.ranges)this.yylloc.range=[O[0],O[0]+this.yyleng-m];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(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).
12
12
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:e(function(b){this.unput(this.match.slice(b))},"less"),pastInput:e(function(){var b=this.matched.substr(0,this.matched.length-this.match.length);return(b.length>20?"...":"")+b.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var b=this.match;if(b.length<20)b+=this._input.substr(0,20-b.length);return(b.substr(0,20)+(b.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var b=this.pastInput(),m=Array(b.length+1).join("-");return b+this.upcomingInput()+`
13
13
  `+m+"^"},"showPosition"),test_match:e(function(b,m){var x,o,O;if(this.options.backtrack_lexer){if(O={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)O.yylloc.range=this.yylloc.range.slice(0)}if(o=b[0].match(/(?:\r\n?|\n).*/g),o)this.yylineno+=o.length;if(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+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._backtrack=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],x=this.performAction.call(this,this.yy,this,m,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(x)return x;else if(this._backtrack){for(var s in O)this[s]=O[s];return!1}return!1},"test_match"),next:e(function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var b,m,x,o;if(!this._more)this.yytext="",this.match="";var O=this._currentRules();for(var s=0;s<O.length;s++)if(x=this._input.match(this.rules[O[s]]),x&&(!m||x[0].length>m[0].length)){if(m=x,o=s,this.options.backtrack_lexer)if(b=this.test_match(x,O[s]),b!==!1)return b;else if(this._backtrack){m=!1;continue}else return!1;else if(!this.options.flex)break}if(m){if(b=this.test_match(m,O[o]),b!==!1)return b;return!1}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
14
14
  `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:e(function(){var m=this.next();if(m)return m;else return this.lex()},"lex"),begin:e(function(m){this.conditionStack.push(m)},"begin"),popState:e(function(){var m=this.conditionStack.length-1;if(m>0)return this.conditionStack.pop();else return this.conditionStack[0]},"popState"),_currentRules:e(function(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1])return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;else return this.conditions.INITIAL.rules},"_currentRules"),topState:e(function(m){if(m=this.conditionStack.length-1-Math.abs(m||0),m>=0)return this.conditionStack[m];else return"INITIAL"},"topState"),pushState:e(function(m){this.begin(m)},"pushState"),stateStackSize:e(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:e(function(m,x,o,O){var s=O;switch(o){case 0:return this.begin("acc_title"),34;break;case 1:return this.popState(),"acc_title_value";break;case 2:return this.begin("acc_descr"),36;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"),x.yytext="",40;break;case 8:return this.pushState("shapeDataStr"),40;break;case 9:return this.popState(),40;break;case 10:let Me=/\n\s*/g;return x.yytext=x.yytext.replace(Me,"<br/>"),40;break;case 11:return 40;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 95;case 17:this.popState();break;case 18:return 96;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 84;case 26:return 102;case 27:return 85;case 28:return 104;case 29:return 86;case 30:return 87;case 31:return 97;case 32:this.begin("click");break;case 33:this.popState();break;case 34:return 88;case 35:if(m.lex.firstGraph())this.begin("dir");return 12;case 36:if(m.lex.firstGraph())this.begin("dir");return 12;case 37:if(m.lex.firstGraph())this.begin("dir");return 12;case 38:if(m.lex.firstGraph())this.begin("dir");return 12;case 39:return 27;case 40:return 32;case 41:return 98;case 42:return 98;case 43:return 98;case 44:return 98;case 45:return this.popState(),13;break;case 46:return this.popState(),14;break;case 47:return this.popState(),14;break;case 48:return this.popState(),14;break;case 49:return this.popState(),14;break;case 50:return this.popState(),14;break;case 51:return this.popState(),14;break;case 52:return this.popState(),14;break;case 53:return this.popState(),14;break;case 54:return this.popState(),14;break;case 55:return this.popState(),14;break;case 56:return 121;case 57:return 122;case 58:return 123;case 59:return 124;case 60:return 125;case 61:return 78;case 62:return 105;case 63:return 111;case 64:return 46;case 65:return 60;case 66:return 44;case 67:return 8;case 68:return 106;case 69:return 115;case 70:return this.popState(),77;break;case 71:return this.pushState("edgeText"),75;break;case 72:return 119;case 73:return this.popState(),77;break;case 74:return this.pushState("thickEdgeText"),75;break;case 75:return 119;case 76:return this.popState(),77;break;case 77:return this.pushState("dottedEdgeText"),75;break;case 78:return 119;case 79:return 77;case 80:return this.popState(),53;break;case 81:return"TEXT";case 82:return this.pushState("ellipseText"),52;break;case 83:return this.popState(),55;break;case 84:return this.pushState("text"),54;break;case 85:return this.popState(),57;break;case 86:return this.pushState("text"),56;break;case 87:return 58;case 88:return this.pushState("text"),67;break;case 89:return this.popState(),64;break;case 90:return this.pushState("text"),63;break;case 91:return this.popState(),49;break;case 92:return this.pushState("text"),48;break;case 93:return this.popState(),69;break;case 94:return this.popState(),71;break;case 95:return 117;case 96:return this.pushState("trapText"),68;break;case 97:return this.pushState("trapText"),70;break;case 98:return 118;case 99:return 67;case 100:return 90;case 101:return"SEP";case 102:return 89;case 103:return 115;case 104:return 111;case 105:return 44;case 106:return 109;case 107:return 114;case 108:return 116;case 109:return this.popState(),62;break;case 110:return this.pushState("text"),62;break;case 111:return this.popState(),51;break;case 112:return this.pushState("text"),50;break;case 113:return this.popState(),31;break;case 114:return this.pushState("text"),29;break;case 115:return this.popState(),66;break;case 116:return this.pushState("text"),65;break;case 117:return"TEXT";case 118:return"QUOTE";case 119:return 9;case 120:return 10;case 121:return 11}},"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]*)/,/^(?:flowchart-elk\b)/,/^(?:swimlane-beta\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_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*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:[^=]|=(?!))/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:[^\.]|\.(?!))/,/^(?:\s*~~[\~]+\s*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|[^\\\[\]\(\)\{\}\/]+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:([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])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:[^\[\]\(\)\{\}\|\"]+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:[^\S\n\r]+)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},shapeData:{rules:[8,11,12,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackargs:{rules:[17,18,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},callbackname:{rules:[14,15,16,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},href:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},click:{rules:[21,24,33,34,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dottedEdgeText:{rules:[21,24,76,78,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},thickEdgeText:{rules:[21,24,73,75,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},edgeText:{rules:[21,24,70,72,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},trapText:{rules:[21,24,79,82,84,86,90,92,93,94,95,96,97,110,112,114,116],inclusive:!1},ellipseText:{rules:[21,24,79,80,81,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},text:{rules:[21,24,79,82,83,84,85,86,89,90,91,92,96,97,109,110,111,112,113,114,115,116,117],inclusive:!1},vertex:{rules:[21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},dir:{rules:[21,24,45,46,47,48,49,50,51,52,53,54,55,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_descr:{rules:[3,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},acc_title:{rules:[1,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},md_string:{rules:[19,20,21,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},string:{rules:[21,22,23,24,79,82,84,86,90,92,96,97,110,112,114,116],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,44,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,73,74,76,77,79,82,84,86,87,88,90,92,96,97,98,99,100,101,102,103,104,105,106,107,108,110,112,114,116,118,119,120,121],inclusive:!0}}};return Pe}();Dt.lexer=p1;function gt(){this.yy={}}return e(gt,"Parser"),gt.prototype=Dt,Dt.Parser=gt,new gt}();Ft.parser=Ft;var h1=Ft,d1=Object.assign({},h1);d1.parse=(t)=>{let r=t.replace(/}\s*\n/g,`}
@@ -0,0 +1 @@
1
+ import{Ci}from"./chunk-cktmyc13.js";export{Ci as createPieServices};
@@ -1,4 +1,4 @@
1
- import{e}from"./chunk-pyg1mr80.js";var je=e(()=>`
1
+ import{e}from"./chunk-5v44qv67.js";var je=e(()=>`
2
2
  /* Font Awesome icon styling - consolidated */
3
3
  .label-icon {
4
4
  display: inline-block;
@@ -1 +1 @@
1
- import{h,o,i,r,y,t,n,_,s,Z,yt,vt,Wt,be,me,ae,de,xt,st,te,an,Q}from"./chunk-qmbgb79a.js";var je=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],ge=s("key-round",je);function xe(e){let d=[],g="",b,N=!1;for(let u=0;u<e.length;u++){let c=e[u];if(b)if(c===b)b=void 0;else if(c==="\\"&&b==='"'&&u+1<e.length)g+=e[++u];else g+=c;else if(c==='"'||c==="'")b=c,N=!0;else if(c==="\\"&&u+1<e.length)g+=e[++u],N=!0;else if(/\s/.test(c)){if(N||g)d.push(g);g="",N=!1}else g+=c,N=!0}if(N||g)d.push(g);return d}function le(e){return e.map((d)=>d===""||/[\s"'\\]/.test(d)?`"${d.replace(/(["\\])/g,"\\$1")}"`:d).join(" ")}var ve="size-4 cursor-pointer rounded border-line text-accent accent-accent focus-visible:outline-2 focus-visible:outline-accent",Te={connected:{label:"已连接",dot:"bg-success"},idle:{label:"待连接",dot:"bg-faint"},disabled:{label:"已停用",dot:"bg-faint"},failed:{label:"连接失败",dot:"bg-danger"},needs_auth:{label:"需要认证",dot:"bg-warning"}};function Y(e){return e.type==="local"?le(e.command):e.url}function he({info:e,tools:d=!1}){let g=Te[e.status.status];return n("span",{className:"inline-flex shrink-0 items-center gap-1.5 text-xs text-dim",children:[t("span",{"aria-hidden":!0,className:`size-1.5 shrink-0 rounded-full ${g.dot}`}),t("span",{className:d?void 0:"hidden @md/panel:inline",children:g.label}),d&&e.status.status==="connected"&&n("span",{className:"text-faint",children:["· ",e.toolCount," 个工具"]})]})}function $e(e){if(typeof e!=="object"||e===null||!("type"in e))return"any";let d=e.type;if(typeof d==="string")return d;if(Array.isArray(d))return d.filter((g)=>typeof g==="string").join(" | ")||"any";return"any"}function ye(e){let{Button:d,CopyButton:g,Dialog:b,StatusChip:N,confirm:u,style:c,useTheme:k}=_();k();let{info:a,connection:I}=e,[m,q]=r(),[G,K]=r(),[S,j]=r(!1),W=a.status.status==="connected",z=a.status.status==="needs_auth",V=a.status.status==="failed",A=a.config.type==="remote"&&Boolean(a.config.oauth);o(()=>{function p(x){if(x&&x!==a.name)return;let J=a.projectID?`?projectID=${encodeURIComponent(a.projectID)}`:"";I.request(`/api/mcp/${encodeURIComponent(a.name)}/connect${J}`,{method:"POST"}).then((ne)=>e.onChanged(ne)).catch(()=>{})}function f(x){if(x.data?.type==="mcp-oauth-success")p(x.data.name)}function D(x){if(x.key==="basalt-mcp-oauth-event"&&x.newValue)try{let J=JSON.parse(x.newValue);p(J.name)}catch(J){}}window.addEventListener("message",f),window.addEventListener("storage",D);let R;if("BroadcastChannel"in window)R=new BroadcastChannel("basalt-mcp-oauth"),R.onmessage=(x)=>{if(x.data?.type==="mcp-oauth-success")p(x.data.name)};return()=>{window.removeEventListener("message",f),window.removeEventListener("storage",D),R?.close()}},[I,a.name,a.projectID,e]),o(()=>{if(a.status.status!=="connected")return;let p=a.projectID?`?projectID=${encodeURIComponent(a.projectID)}`:"";I.request(`/api/mcp/${encodeURIComponent(a.name)}/tools${p}`).then((f)=>{if(Array.isArray(f))q(f),K(void 0)}).catch((f)=>{K(f instanceof Error?f.message:"获取工具失败")})},[I,a.name,a.projectID,a.status.status]);async function O(p){j(!0);try{let f=a.projectID?`?projectID=${encodeURIComponent(a.projectID)}`:"",D=await I.request(`/api/mcp/${encodeURIComponent(a.name)}/${p}${f}`,{method:"POST"});e.onChanged(D)}catch{}finally{j(!1)}}async function U(){j(!0);try{let p=a.projectID?`?projectID=${encodeURIComponent(a.projectID)}`:"",f=a.status.status==="needs_auth"?a.status.authorizationUrl:void 0;if(!f)f=(await I.request(`/api/mcp/${encodeURIComponent(a.name)}/oauth/authorize${p}`,{method:"POST"})).authorizationUrl;if(f)window.open(f,"_blank","width=600,height=700")}catch(p){K(p instanceof Error?p.message:"获取授权链接失败")}finally{j(!1)}}async function ee(){j(!0);try{let p=a.projectID?`?projectID=${encodeURIComponent(a.projectID)}`:"",f=await I.request(`/api/mcp/${encodeURIComponent(a.name)}/oauth/clear${p}`,{method:"POST"});e.onChanged(f)}finally{j(!1)}}async function E(){if(!await u({title:`删除 ${a.name}?`,description:"删除后将断开连接并不再向会话提供其工具。",action:"删除",danger:!0}))return;j(!0);try{let f=a.projectID?`?projectID=${encodeURIComponent(a.projectID)}`:"";await I.request(`/api/mcp/${encodeURIComponent(a.name)}${f}`,{method:"DELETE"}),e.onChanged(),e.onClose()}finally{j(!1)}}let T=a.config,l=Y(T),C="error"in a.status?a.status.error:void 0,M=m?.length??a.toolCount??0;return t(b,{open:!0,className:"bg-panel shadow-float",onOpenChange:(p)=>{if(!p&&!S)e.onClose()},title:n("div",{className:"flex flex-wrap items-center gap-3",children:[t("div",{className:"flex size-8 items-center justify-center rounded-[10px] border border-accent/20 bg-accent-soft text-accent",children:T.type==="local"?t(st,{className:"size-4"}):t(be,{className:"size-4"})}),t("span",{className:"font-serif text-lg font-semibold tracking-tight text-ink",children:a.name}),W?t(N,{tone:"success",pulse:!0,children:"已连接"}):z?t(N,{tone:"warning",pulse:!0,children:"需要授权"}):V?t(N,{tone:"danger",children:"连接失败"}):a.status.status==="disabled"?t(N,{tone:"neutral",children:"已停用"}):t(N,{tone:"neutral",children:"未连接"})]}),description:n("div",{className:"mt-2 flex min-w-0 flex-wrap items-center gap-1.5 text-xs",children:[n("span",{className:"flex min-w-0 max-w-full items-center gap-1 rounded-lg border border-line bg-raised/60 py-0.5 pr-1 pl-2.5 font-mono text-[11.5px] text-ink",children:[t("span",{className:"min-w-0 truncate",title:l,children:l}),t(g,{text:l,label:"复制地址",size:"icon-xs",className:"shrink-0 text-dim hover:text-ink"})]}),t("span",{className:"rounded-lg border border-line px-2 py-1 text-[11px] leading-none text-dim",children:T.type==="local"?"本地命令":"远程 HTTP"}),A&&n("span",{className:c("control.badgeAccent","gap-1 rounded-lg border border-accent/25 px-2 py-1"),children:[t(xt,{className:"size-3"}),"OAuth 2.0"]})]}),size:"lg",footer:n("div",{className:"flex w-full items-center justify-between gap-2 max-sm:flex-col",children:[n("div",{className:"flex items-center gap-1 max-sm:w-full",children:[A&&t(d,{type:"button",variant:"ghost",onClick:ee,disabled:S,title:"清除已保存的 OAuth 凭据",children:"清除凭据"}),t(d,{type:"button",variant:"danger-ghost",size:"icon-sm","aria-label":"删除服务器",onClick:E,disabled:S,title:"删除服务器",children:t(te,{className:"size-4"})})]}),n("div",{className:"flex items-center gap-2 max-sm:w-full max-sm:justify-end",children:[t(d,{type:"button",variant:"ghost",onClick:e.onEdit,disabled:S,children:"编辑配置"}),!z&&t(d,{type:"button",variant:"secondary",onClick:()=>O(W?"disconnect":"connect"),disabled:S,children:S?"处理中...":W?"断开连接":"立即连接"}),t(d,{type:"button",variant:"primary",onClick:e.onClose,children:"完成"})]})]}),children:n("div",{className:"space-y-6 pt-1",children:[z&&t("div",{className:"relative overflow-hidden rounded-2xl border border-warning/30 bg-[radial-gradient(120%_140%_at_0%_0%,color-mix(in_oklch,var(--color-warning)_16%,transparent),transparent_65%)] p-5",children:n("div",{className:"flex items-start gap-4 max-sm:flex-col",children:[t("div",{className:"relative flex size-11 shrink-0 items-center justify-center rounded-xl border border-warning/30 bg-panel text-warning shadow-[0_0_28px_-4px_color-mix(in_oklch,var(--color-warning)_55%,transparent)]",children:t(ge,{className:"size-5"})}),n("div",{className:"min-w-0 flex-1 space-y-1.5",children:[t("h4",{className:"text-sm font-semibold text-ink",children:"授权后即可使用此服务器"}),t("p",{className:"text-[13px] leading-relaxed text-dim",children:"该端点要求 OAuth 2.0 身份许可。在浏览器中完成授权后,令牌会自动保存并载入全部工具。"}),C&&t("p",{className:"line-clamp-2 break-words font-mono text-[11.5px] text-faint",title:C,children:C})]}),n(d,{type:"button",variant:"primary",onClick:U,disabled:S,className:"shrink-0",children:[t(Wt,{className:"mr-1.5 size-3.5"}),S?"正在拉起授权...":"前往授权"]})]})}),V&&n("div",{className:c("callout.base",c("callout.danger"),"gap-3 rounded-2xl p-4"),children:[t(yt,{className:"mt-0.5 size-4 shrink-0 text-danger"}),n("div",{className:"min-w-0 space-y-1",children:[t("h4",{className:"text-sm font-medium text-ink",children:"连接失败"}),t("p",{className:"font-mono text-[11.5px] leading-relaxed break-words text-dim",children:C})]})]}),n("section",{className:"space-y-3",children:[n("div",{className:"flex items-baseline justify-between gap-3 px-0.5",children:[n("h4",{className:"flex items-center gap-2 text-[13px] font-medium text-ink",children:["可用工具",t("span",{className:"rounded-full bg-raised px-1.5 py-0.5 font-mono text-[11px] leading-none text-dim",children:M})]}),t("span",{className:"text-[11.5px] text-faint",children:"对所有会话可用"})]}),G?t("div",{className:c("callout.base",c("callout.danger"),"text-xs leading-relaxed break-words"),children:G}):!W?n("div",{className:c("surface.emptyDashed","gap-2 py-10"),children:[t("div",{className:"flex size-10 items-center justify-center rounded-full bg-raised text-faint",children:t(an,{className:"size-4.5"})}),t("p",{className:"text-[13px] font-medium text-dim",children:z?"等待授权":"尚未连接"}),t("p",{className:"max-w-xs text-xs leading-relaxed text-faint",children:z?"授权完成后会自动连接并列出工具。":"连接服务器后,这里会列出它提供的全部工具。"})]}):!m?t("div",{role:"status","aria-label":"正在获取工具列表",className:"grid gap-2",children:[0,1,2].map((p)=>n("div",{className:"animate-pulse space-y-2.5 rounded-xl border border-line p-3.5",children:[t("div",{className:"h-3.5 w-32 rounded bg-raised"}),t("div",{className:"h-3 w-4/5 rounded bg-raised/70"})]},p))}):m.length===0?n("div",{className:c("surface.emptyDashed","gap-2 py-10"),children:[t("div",{className:"flex size-10 items-center justify-center rounded-full bg-raised text-faint",children:t(an,{className:"size-4.5"})}),t("p",{className:"text-[13px] font-medium text-dim",children:"没有可用工具"}),t("p",{className:"max-w-xs text-xs leading-relaxed text-faint",children:"已连接成功,但该服务器没有声明任何工具。"})]}):t("ul",{className:"grid gap-2",children:m.map((p)=>{let f=p.inputSchema?.properties??{},D=p.inputSchema?.required??[],R=Object.entries(f);return n("li",{className:c("surface.subtle","border-line bg-raised/30 p-3.5 transition-colors hover:border-line-strong hover:bg-raised/60"),children:[t("span",{className:"font-mono text-[13px] font-medium break-all text-accent",children:p.name}),p.description&&t("p",{className:"mt-1.5 text-[13px] leading-relaxed break-words text-dim",children:p.description}),R.length>0&&t("div",{className:"mt-3 flex flex-wrap gap-1.5",children:R.map(([x,J])=>n("span",{title:D.includes(x)?"必填参数":"可选参数",className:"inline-flex items-center gap-1 rounded-md border border-line bg-panel px-1.5 py-1 font-mono text-[11px] leading-none",children:[t("span",{className:"text-ink",children:x}),D.includes(x)&&t("span",{className:"text-warning",children:"*"}),t("span",{className:"text-faint",children:$e(J)})]},x))})]},p.name)})})]})]})})}var De=/^[A-Za-z0-9_-]{1,64}$/;function H(e){return t("span",{className:"truncate text-xs text-faint",children:e.children})}function Ne(e){let{pairs:d,onChange:g,InputComponent:b}=e,N=(u,c)=>g(d.map((k,a)=>a===u?{...k,...c}:k));return n("div",{className:"space-y-2",children:[n("div",{className:"flex min-h-7 items-center gap-2",children:[t("span",{className:"shrink-0 text-[13px] font-medium text-dim",children:e.label}),t(H,{children:e.tip}),n("button",{type:"button",className:"ml-auto inline-flex h-7 shrink-0 cursor-pointer items-center gap-1 rounded-lg px-2 text-xs font-medium text-dim transition-colors hover:bg-raised hover:text-ink",onClick:()=>g([...d,{key:"",value:"",saved:!1}]),children:[t(me,{className:"size-3.5"}),"添加"]})]}),d.map((u,c)=>n("div",{className:"flex min-w-0 items-center gap-1.5",children:[t(b,{"aria-label":`${e.keyLabel} ${c+1}`,placeholder:e.keyLabel,value:u.key,readOnly:u.saved,onChange:(k)=>N(c,{key:k.target.value}),className:"min-w-0 flex-[2] font-mono text-xs"}),t(b,{"aria-label":`${e.keyLabel} ${u.key||c+1} 的值`,type:"password",autoComplete:"off",placeholder:u.saved?"已保存,留空保持不变":"值",value:u.value,onChange:(k)=>N(c,{value:k.target.value}),className:"min-w-0 flex-[3] font-mono text-xs"}),t("button",{type:"button","aria-label":`删除 ${u.key||"该项"}`,className:"flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-lg text-faint transition-colors hover:bg-danger/10 hover:text-danger",onClick:()=>g(d.filter((k,a)=>a!==c)),children:t(Q,{className:"size-4"})})]},c))]})}function Ce(e){return Object.keys(e??{}).map((d)=>({key:d,value:"",saved:!0}))}function we(e){let{Button:d,Segmented:g,Dialog:b,Form:N,Field:u,Input:c,Switch:k,style:a,useTheme:I}=_();I();let{existing:m}=e,[q,G]=r(m?.config.type??"local"),[K,S]=r(m?.name??""),[j,W]=r(m?.config.type==="local"?le(m.config.command):""),[z,V]=r(m?.config.type==="remote"?m.config.url:""),[A,O]=r(Ce(m?.config.type==="local"?m.config.environment:void 0)),[U,ee]=r(Ce(m?.config.type==="remote"?m.config.headers:void 0)),E=m?.config.type==="remote"?m.config.oauth:void 0,[T,l]=r(Boolean(E)),[C,M]=r(typeof E==="object"&&E.clientId?E.clientId:""),[p,f]=r(""),[D,R]=r(typeof E==="object"&&E.scope?E.scope:""),[x,J]=r(m?.config.defer??"default"),[ne,ke]=r(m?.config.timeout!==void 0?String(m.config.timeout):""),[ie,Ie]=r(m?.config.defer!==void 0||m?.config.timeout!==void 0),[pe,X]=r(),[re,ue]=r(!1);async function Se(v){v.preventDefault(),X(void 0);let w=K.trim();if(!m&&!De.test(w)){X("名称只能包含英文字母、数字、下划线与中划线,长度 1-64");return}if(!m&&e.taken.includes(w)){X("同名服务器已存在");return}let se=ne.trim()?Number.parseInt(ne.trim(),10):void 0;if(se!==void 0&&(!Number.isFinite(se)||se<=0)){X("超时时间须为大于 0 的毫秒数");return}let ce;if(q==="local"){let L=xe(j.trim());if(!L.length){X("请输入启动命令");return}let F={};for(let B of A){let P=B.key.trim();if(!P)continue;if(!B.saved||B.value)F[P]=B.value}ce={type:"local",command:L,environment:Object.keys(F).length?F:void 0,enabled:m?m.config.enabled:!0,defer:x==="default"?void 0:x,timeout:se}}else{let L=z.trim();try{let P=new URL(L);if(P.protocol!=="http:"&&P.protocol!=="https:")throw Error("bad protocol")}catch{X("请输入合法的 HTTP 或 HTTPS 地址");return}let F={};for(let P of U){let oe=P.key.trim();if(!oe)continue;if(!P.saved||P.value)F[oe]=P.value}let B;if(T){let P=C.trim(),oe=p.trim(),fe=D.trim();if(P||oe||fe)B={clientId:P||void 0,clientSecret:oe||void 0,scope:fe||void 0};else B=!0}else B=!1;ce={type:"remote",url:L,headers:Object.keys(F).length?F:void 0,oauth:B,enabled:m?m.config.enabled:!0,defer:x==="default"?void 0:x,timeout:se}}ue(!0);try{let L=m?.name??w,F=m?m.projectID:e.projectID,B=F?`?projectID=${encodeURIComponent(F)}`:"";await e.connection.request(`/api/mcp/${encodeURIComponent(L)}${B}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(ce)}),e.onSaved()}catch(L){X(L instanceof Error?L.message:"保存失败")}finally{ue(!1)}}return t(b,{open:!0,onOpenChange:(v)=>{if(!v&&!re)e.onClose()},title:m?`编辑 ${m.name}`:"添加 MCP 服务器",size:"lg",footer:n("div",{className:"flex w-full justify-end gap-2.5",children:[t(d,{type:"button",variant:"ghost",onClick:e.onClose,disabled:re,className:"min-w-20",children:"取消"}),t(d,{type:"submit",form:"mcp-server-form",variant:"primary",disabled:re,className:"min-w-24",children:re?"保存中...":"保存"})]}),children:n(N,{id:"mcp-server-form",onSubmit:Se,children:[t(g,{value:q,onChange:(v)=>G(v),className:"w-full [&>button]:flex-1",options:[{value:"local",label:"本地(标准输入输出)"},{value:"remote",label:"远程(HTTP / SSE)"}]}),!m&&t(u,{label:"名称",aside:t(H,{children:"唯一标识,如 postgres"}),children:(v)=>t(c,{id:v,value:K,onChange:(w)=>S(w.target.value),placeholder:"postgres",className:"font-mono text-xs"})}),q==="local"?n(y,{children:[t(u,{label:"启动命令",aside:t(H,{children:"完整命令及参数"}),children:(v)=>t(c,{id:v,value:j,onChange:(w)=>W(w.target.value),placeholder:"npx -y @modelcontextprotocol/server-postgres ...",className:"font-mono text-xs"})}),t(Ne,{label:"环境变量",tip:"启动进程时注入",keyLabel:"变量名",pairs:A,onChange:O,InputComponent:c})]}):n(y,{children:[t(u,{label:"服务地址",aside:t(H,{children:"HTTP / HTTPS 端点"}),children:(v)=>t(c,{id:v,value:z,onChange:(w)=>V(w.target.value),placeholder:"https://example.com/mcp",className:"font-mono text-xs"})}),t(Ne,{label:"请求头",tip:"随每次请求发送",keyLabel:"头字段",pairs:U,onChange:ee,InputComponent:c}),n("div",{className:"flex items-center justify-between gap-4",children:[n("div",{className:"min-w-0",children:[t("span",{className:"block text-[13px] font-medium text-dim",children:"OAuth 2.0 认证"}),t("span",{className:"block truncate text-xs text-faint",children:"自动发现授权端点,使用 PKCE 并刷新令牌"})]}),t(k,{checked:T,onCheckedChange:l,label:"启用 OAuth 2.0"})]}),T&&n(y,{children:[t(u,{label:"Client ID",aside:t(H,{children:"留空自动动态注册(DCR)"}),children:(v)=>t(c,{id:v,value:C,onChange:(w)=>M(w.target.value),placeholder:"留空自动动态注册",className:"font-mono text-xs"})}),t(u,{label:"Client Secret",aside:t(H,{children:"留空保持不变"}),children:(v)=>t(c,{id:v,type:"password",autoComplete:"off",value:p,onChange:(w)=>f(w.target.value),placeholder:"••••••••",className:"font-mono text-xs"})}),t(u,{label:"Scope",aside:t(H,{children:"选填授权范围"}),children:(v)=>t(c,{id:v,value:D,onChange:(w)=>R(w.target.value),placeholder:"repo read:org",className:"font-mono text-xs"})})]})]}),n("div",{className:"space-y-3 border-t border-line/60 pt-3",children:[n("button",{type:"button","aria-expanded":ie,className:"flex w-full cursor-pointer items-center gap-1.5 text-[13px] font-medium text-dim transition-colors hover:text-ink",onClick:()=>Ie(!ie),children:[t(vt,{className:`size-3.5 transition-transform ${ie?"rotate-90":""}`}),"高级设置",t("span",{className:"truncate text-xs font-normal text-faint",children:"加载时机、超时"})]}),ie&&n("div",{className:"grid grid-cols-2 gap-3 max-sm:grid-cols-1",children:[t(u,{label:"加载时机",aside:t(H,{children:"延迟 = 按需加载"}),children:()=>t(g,{value:x,onChange:(v)=>J(v),className:"w-full [&>button]:flex-1",options:[{value:"default",label:"默认"},{value:"defer",label:"延迟"},{value:"always",label:"常驻"}]})}),t(u,{label:"超时(毫秒)",aside:t(H,{children:"留空用默认"}),children:(v)=>t(c,{id:v,value:ne,onChange:(w)=>ke(w.target.value),placeholder:"默认",className:"font-mono text-xs"})})]})]}),pe&&n("div",{role:"alert",className:a("callout.base",a("callout.danger"),"px-3 py-2.5 text-xs"),children:[t(Z,{className:"mt-0.5 size-3.5 shrink-0"}),t("span",{className:"min-w-0 break-words",children:pe})]})]})})}function tt({connection:e}){let{Button:d,Input:g,style:b,useTheme:N}=_();N();let[u,c]=r(""),[k,a]=r(),[I,m]=r(),[q,G]=r(!1),[K,S]=r(),[j,W]=r(!1),z=i(!1),[V,A]=r(),O=i(0),U=h(async()=>{let l=++O.current;G(!0);try{let C=await e.request("/api/mcp");if(l!==O.current)return;a(C),m(void 0)}catch(C){if(l===O.current)m(C instanceof Error?C.message:"读取失败")}finally{if(l===O.current)G(!1)}},[e]);o(()=>(U(),()=>{O.current++}),[U]);async function ee(l,C){if(z.current)return;z.current=!0,W(!0);let M=O.current;try{let p=l.projectID?`?projectID=${encodeURIComponent(l.projectID)}`:"",f=await e.request(`/api/mcp/${encodeURIComponent(l.name)}${p}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({...l.config,enabled:C})});if(M===O.current)a((D)=>D?.map((R)=>R.name===f.name&&R.projectID===f.projectID?f:R))}finally{z.current=!1,W(!1)}}let E=k?.filter((l)=>`${l.name} ${Y(l.config)}`.toLowerCase().includes(u.trim().toLowerCase())),T=k?.find((l)=>l.name===K);return n("div",{className:"min-w-0 space-y-6",children:[n("section",{className:"min-w-0",children:[n("div",{className:"mb-2.5 flex flex-wrap items-end justify-between gap-3 px-0.5",children:[n("div",{className:"min-w-0 flex-1 basis-48",children:[t("h2",{className:b("settings.groupTitle"),children:"MCP 服务器"}),t("p",{className:b("settings.groupDesc"),children:"外部工具与数据源管理"})]}),n("div",{className:"flex gap-2",children:[t(d,{variant:"ghost",disabled:q,onClick:U,className:"h-9 px-2.5 text-xs",children:t(ae,{className:`size-3.5 ${q?"animate-spin":""}`})}),n(d,{variant:"secondary",onClick:()=>A({}),className:"h-9 px-2.5 text-xs",children:[t(me,{className:"size-3.5 mr-1"}),"添加服务器"]})]})]}),I&&n("div",{role:"alert",className:b("callout.base",b("callout.danger"),"mb-3 flex-wrap items-center justify-between"),children:[n("p",{className:"min-w-0 flex-1 break-words text-sm text-danger",children:["无法读取 MCP 服务器:",I]}),t(d,{disabled:q,onClick:U,children:"重试"})]}),n("div",{className:"relative mb-3 min-w-0",children:[t(de,{"aria-hidden":!0,className:"pointer-events-none absolute top-3 left-3 size-4 text-faint"}),t(g,{type:"search","aria-label":"搜索 MCP 服务器",placeholder:"搜索服务器",value:u,onChange:(l)=>c(l.target.value),className:"h-10 min-w-0 pl-9"})]}),t("div",{className:b("settings.groupBox"),children:!k?t("div",{role:"status","aria-label":"正在加载",className:"divide-y divide-line",children:[0,1,2].map((l)=>n("div",{className:"h-16 space-y-2 px-4 py-3",children:[t("div",{className:"h-3 w-24 animate-pulse rounded bg-raised"}),t("div",{className:"h-3 w-2/3 animate-pulse rounded bg-raised"})]},l))}):E?.length===0?t("p",{className:"p-4 text-sm text-dim",children:"没有匹配的 MCP 服务器"}):t("ul",{className:"divide-y divide-line",children:E?.map((l)=>{let C=l.config.enabled===!1,M=l.scope==="file";return n("li",{className:`flex min-w-0 items-center justify-between gap-3 px-4 py-2.5 transition-colors hover:bg-raised/40 ${C?"opacity-55":""}`,children:[n("button",{type:"button",className:"group flex min-h-12 min-w-0 flex-1 cursor-pointer items-center gap-3 py-1 text-left focus-visible:outline-2 focus-visible:outline-accent","aria-label":`查看 ${l.name}`,disabled:M,title:M?"来自项目的 .mcp.json,只读":void 0,onClick:()=>S(l.name),children:[t("span",{"aria-hidden":!0,className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-raised text-dim",children:l.config.type==="local"?t(st,{className:"size-4"}):t(be,{className:"size-4"})}),n("span",{className:"min-w-0 flex-1",children:[t("span",{className:"block truncate text-sm font-medium text-ink",title:l.name,children:l.name}),t("span",{className:"mt-0.5 block truncate font-mono text-xs text-dim",title:Y(l.config),children:Y(l.config)})]}),t("span",{className:b("control.badge","shrink-0 text-[11px] text-dim"),children:l.scope==="project"?"项目":l.scope==="file"?".mcp.json":"全局"}),t(he,{info:l})]}),t("span",{className:"relative flex size-10 shrink-0 items-center justify-center",children:!M&&t("input",{type:"checkbox","aria-label":`启用服务器 ${l.name}`,className:ve,disabled:j||q,checked:!C,onChange:(p)=>ee(l,p.target.checked)})})]},l.name)})})})]}),T&&!V&&t(ye,{connection:e,info:T,onClose:()=>S(void 0),onEdit:()=>A({info:T}),onChanged:(l)=>l?a((C)=>C?.map((M)=>M.name===l.name?l:M)):U()},`${T.projectID}:${T.name}`),V&&t(we,{connection:e,existing:V.info,taken:(k??[]).map((l)=>l.name),onClose:()=>A(void 0),onSaved:()=>{A(void 0),U()}})]})}export{tt as McpSection};
1
+ import{h,o,i,r,y,t,n,_,s,Z,vt,rt,Wt,be,pe,ee,de,xt,lt,re,an,Q}from"./chunk-j6a4z530.js";var je=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],ge=s("key-round",je);function xe(e){let d=[],g="",b,N=!1;for(let u=0;u<e.length;u++){let c=e[u];if(b)if(c===b)b=void 0;else if(c==="\\"&&b==='"'&&u+1<e.length)g+=e[++u];else g+=c;else if(c==='"'||c==="'")b=c,N=!0;else if(c==="\\"&&u+1<e.length)g+=e[++u],N=!0;else if(/\s/.test(c)){if(N||g)d.push(g);g="",N=!1}else g+=c,N=!0}if(N||g)d.push(g);return d}function le(e){return e.map((d)=>d===""||/[\s"'\\]/.test(d)?`"${d.replace(/(["\\])/g,"\\$1")}"`:d).join(" ")}var ve="size-4 cursor-pointer rounded border-line text-accent accent-accent focus-visible:outline-2 focus-visible:outline-accent",Te={connected:{label:"已连接",dot:"bg-success"},idle:{label:"待连接",dot:"bg-faint"},disabled:{label:"已停用",dot:"bg-faint"},failed:{label:"连接失败",dot:"bg-danger"},needs_auth:{label:"需要认证",dot:"bg-warning"}};function Y(e){return e.type==="local"?le(e.command):e.url}function he({info:e,tools:d=!1}){let g=Te[e.status.status];return n("span",{className:"inline-flex shrink-0 items-center gap-1.5 text-xs text-dim",children:[t("span",{"aria-hidden":!0,className:`size-1.5 shrink-0 rounded-full ${g.dot}`}),t("span",{className:d?void 0:"hidden @md/panel:inline",children:g.label}),d&&e.status.status==="connected"&&n("span",{className:"text-faint",children:["· ",e.toolCount," 个工具"]})]})}function $e(e){if(typeof e!=="object"||e===null||!("type"in e))return"any";let d=e.type;if(typeof d==="string")return d;if(Array.isArray(d))return d.filter((g)=>typeof g==="string").join(" | ")||"any";return"any"}function ye(e){let{Button:d,CopyButton:g,Dialog:b,StatusChip:N,confirm:u,style:c,useTheme:k}=_();k();let{info:a,connection:I}=e,[m,q]=r(),[G,K]=r(),[S,j]=r(!1),W=a.status.status==="connected",z=a.status.status==="needs_auth",V=a.status.status==="failed",A=a.config.type==="remote"&&Boolean(a.config.oauth);o(()=>{function p(x){if(x&&x!==a.name)return;let J=a.projectID?`?projectID=${encodeURIComponent(a.projectID)}`:"";I.request(`/api/mcp/${encodeURIComponent(a.name)}/connect${J}`,{method:"POST"}).then((ne)=>e.onChanged(ne)).catch(()=>{})}function f(x){if(x.data?.type==="mcp-oauth-success")p(x.data.name)}function D(x){if(x.key==="basalt-mcp-oauth-event"&&x.newValue)try{let J=JSON.parse(x.newValue);p(J.name)}catch(J){}}window.addEventListener("message",f),window.addEventListener("storage",D);let R;if("BroadcastChannel"in window)R=new BroadcastChannel("basalt-mcp-oauth"),R.onmessage=(x)=>{if(x.data?.type==="mcp-oauth-success")p(x.data.name)};return()=>{window.removeEventListener("message",f),window.removeEventListener("storage",D),R?.close()}},[I,a.name,a.projectID,e]),o(()=>{if(a.status.status!=="connected")return;let p=a.projectID?`?projectID=${encodeURIComponent(a.projectID)}`:"";I.request(`/api/mcp/${encodeURIComponent(a.name)}/tools${p}`).then((f)=>{if(Array.isArray(f))q(f),K(void 0)}).catch((f)=>{K(f instanceof Error?f.message:"获取工具失败")})},[I,a.name,a.projectID,a.status.status]);async function O(p){j(!0);try{let f=a.projectID?`?projectID=${encodeURIComponent(a.projectID)}`:"",D=await I.request(`/api/mcp/${encodeURIComponent(a.name)}/${p}${f}`,{method:"POST"});e.onChanged(D)}catch{}finally{j(!1)}}async function U(){j(!0);try{let p=a.projectID?`?projectID=${encodeURIComponent(a.projectID)}`:"",f=a.status.status==="needs_auth"?a.status.authorizationUrl:void 0;if(!f)f=(await I.request(`/api/mcp/${encodeURIComponent(a.name)}/oauth/authorize${p}`,{method:"POST"})).authorizationUrl;if(f)window.open(f,"_blank","width=600,height=700")}catch(p){K(p instanceof Error?p.message:"获取授权链接失败")}finally{j(!1)}}async function te(){j(!0);try{let p=a.projectID?`?projectID=${encodeURIComponent(a.projectID)}`:"",f=await I.request(`/api/mcp/${encodeURIComponent(a.name)}/oauth/clear${p}`,{method:"POST"});e.onChanged(f)}finally{j(!1)}}async function E(){if(!await u({title:`删除 ${a.name}?`,description:"删除后将断开连接并不再向会话提供其工具。",action:"删除",danger:!0}))return;j(!0);try{let f=a.projectID?`?projectID=${encodeURIComponent(a.projectID)}`:"";await I.request(`/api/mcp/${encodeURIComponent(a.name)}${f}`,{method:"DELETE"}),e.onChanged(),e.onClose()}finally{j(!1)}}let T=a.config,l=Y(T),C="error"in a.status?a.status.error:void 0,M=m?.length??a.toolCount??0;return t(b,{open:!0,className:"bg-panel shadow-float",onOpenChange:(p)=>{if(!p&&!S)e.onClose()},title:n("div",{className:"flex flex-wrap items-center gap-3",children:[t("div",{className:"flex size-8 items-center justify-center rounded-[10px] border border-accent/20 bg-accent-soft text-accent",children:T.type==="local"?t(lt,{className:"size-4"}):t(be,{className:"size-4"})}),t("span",{className:"font-serif text-lg font-semibold tracking-tight text-ink",children:a.name}),W?t(N,{tone:"success",pulse:!0,children:"已连接"}):z?t(N,{tone:"warning",pulse:!0,children:"需要授权"}):V?t(N,{tone:"danger",children:"连接失败"}):a.status.status==="disabled"?t(N,{tone:"neutral",children:"已停用"}):t(N,{tone:"neutral",children:"未连接"})]}),description:n("div",{className:"mt-2 flex min-w-0 flex-wrap items-center gap-1.5 text-xs",children:[n("span",{className:"flex min-w-0 max-w-full items-center gap-1 rounded-lg border border-line bg-raised/60 py-0.5 pr-1 pl-2.5 font-mono text-[11.5px] text-ink",children:[t("span",{className:"min-w-0 truncate",title:l,children:l}),t(g,{text:l,label:"复制地址",size:"icon-xs",className:"shrink-0 text-dim hover:text-ink"})]}),t("span",{className:"rounded-lg border border-line px-2 py-1 text-[11px] leading-none text-dim",children:T.type==="local"?"本地命令":"远程 HTTP"}),A&&n("span",{className:c("control.badgeAccent","gap-1 rounded-lg border border-accent/25 px-2 py-1"),children:[t(xt,{className:"size-3"}),"OAuth 2.0"]})]}),size:"lg",footer:n("div",{className:"flex w-full items-center justify-between gap-2 max-sm:flex-col",children:[n("div",{className:"flex items-center gap-1 max-sm:w-full",children:[A&&t(d,{type:"button",variant:"ghost",onClick:te,disabled:S,title:"清除已保存的 OAuth 凭据",children:"清除凭据"}),t(d,{type:"button",variant:"danger-ghost",size:"icon-sm","aria-label":"删除服务器",onClick:E,disabled:S,title:"删除服务器",children:t(re,{className:"size-4"})})]}),n("div",{className:"flex items-center gap-2 max-sm:w-full max-sm:justify-end",children:[t(d,{type:"button",variant:"ghost",onClick:e.onEdit,disabled:S,children:"编辑配置"}),!z&&t(d,{type:"button",variant:"secondary",onClick:()=>O(W?"disconnect":"connect"),disabled:S,children:S?"处理中...":W?"断开连接":"立即连接"}),t(d,{type:"button",variant:"primary",onClick:e.onClose,children:"完成"})]})]}),children:n("div",{className:"space-y-6 pt-1",children:[z&&t("div",{className:"relative overflow-hidden rounded-2xl border border-warning/30 bg-[radial-gradient(120%_140%_at_0%_0%,color-mix(in_oklch,var(--color-warning)_16%,transparent),transparent_65%)] p-5",children:n("div",{className:"flex items-start gap-4 max-sm:flex-col",children:[t("div",{className:"relative flex size-11 shrink-0 items-center justify-center rounded-xl border border-warning/30 bg-panel text-warning shadow-[0_0_28px_-4px_color-mix(in_oklch,var(--color-warning)_55%,transparent)]",children:t(ge,{className:"size-5"})}),n("div",{className:"min-w-0 flex-1 space-y-1.5",children:[t("h4",{className:"text-sm font-semibold text-ink",children:"授权后即可使用此服务器"}),t("p",{className:"text-[13px] leading-relaxed text-dim",children:"该端点要求 OAuth 2.0 身份许可。在浏览器中完成授权后,令牌会自动保存并载入全部工具。"}),C&&t("p",{className:"line-clamp-2 break-words font-mono text-[11.5px] text-faint",title:C,children:C})]}),n(d,{type:"button",variant:"primary",onClick:U,disabled:S,className:"shrink-0",children:[t(Wt,{className:"mr-1.5 size-3.5"}),S?"正在拉起授权...":"前往授权"]})]})}),V&&n("div",{className:c("callout.base",c("callout.danger"),"gap-3 rounded-2xl p-4"),children:[t(vt,{className:"mt-0.5 size-4 shrink-0 text-danger"}),n("div",{className:"min-w-0 space-y-1",children:[t("h4",{className:"text-sm font-medium text-ink",children:"连接失败"}),t("p",{className:"font-mono text-[11.5px] leading-relaxed break-words text-dim",children:C})]})]}),n("section",{className:"space-y-3",children:[n("div",{className:"flex items-baseline justify-between gap-3 px-0.5",children:[n("h4",{className:"flex items-center gap-2 text-[13px] font-medium text-ink",children:["可用工具",t("span",{className:"rounded-full bg-raised px-1.5 py-0.5 font-mono text-[11px] leading-none text-dim",children:M})]}),t("span",{className:"text-[11.5px] text-faint",children:"对所有会话可用"})]}),G?t("div",{className:c("callout.base",c("callout.danger"),"text-xs leading-relaxed break-words"),children:G}):!W?n("div",{className:c("surface.emptyDashed","gap-2 py-10"),children:[t("div",{className:"flex size-10 items-center justify-center rounded-full bg-raised text-faint",children:t(an,{className:"size-4.5"})}),t("p",{className:"text-[13px] font-medium text-dim",children:z?"等待授权":"尚未连接"}),t("p",{className:"max-w-xs text-xs leading-relaxed text-faint",children:z?"授权完成后会自动连接并列出工具。":"连接服务器后,这里会列出它提供的全部工具。"})]}):!m?t("div",{role:"status","aria-label":"正在获取工具列表",className:"grid gap-2",children:[0,1,2].map((p)=>n("div",{className:"animate-pulse space-y-2.5 rounded-xl border border-line p-3.5",children:[t("div",{className:"h-3.5 w-32 rounded bg-raised"}),t("div",{className:"h-3 w-4/5 rounded bg-raised/70"})]},p))}):m.length===0?n("div",{className:c("surface.emptyDashed","gap-2 py-10"),children:[t("div",{className:"flex size-10 items-center justify-center rounded-full bg-raised text-faint",children:t(an,{className:"size-4.5"})}),t("p",{className:"text-[13px] font-medium text-dim",children:"没有可用工具"}),t("p",{className:"max-w-xs text-xs leading-relaxed text-faint",children:"已连接成功,但该服务器没有声明任何工具。"})]}):t("ul",{className:"grid gap-2",children:m.map((p)=>{let f=p.inputSchema?.properties??{},D=p.inputSchema?.required??[],R=Object.entries(f);return n("li",{className:c("surface.subtle","border-line bg-raised/30 p-3.5 transition-colors hover:border-line-strong hover:bg-raised/60"),children:[t("span",{className:"font-mono text-[13px] font-medium break-all text-accent",children:p.name}),p.description&&t("p",{className:"mt-1.5 text-[13px] leading-relaxed break-words text-dim",children:p.description}),R.length>0&&t("div",{className:"mt-3 flex flex-wrap gap-1.5",children:R.map(([x,J])=>n("span",{title:D.includes(x)?"必填参数":"可选参数",className:"inline-flex items-center gap-1 rounded-md border border-line bg-panel px-1.5 py-1 font-mono text-[11px] leading-none",children:[t("span",{className:"text-ink",children:x}),D.includes(x)&&t("span",{className:"text-warning",children:"*"}),t("span",{className:"text-faint",children:$e(J)})]},x))})]},p.name)})})]})]})})}var De=/^[A-Za-z0-9_-]{1,64}$/;function H(e){return t("span",{className:"truncate text-xs text-faint",children:e.children})}function Ne(e){let{pairs:d,onChange:g,InputComponent:b}=e,N=(u,c)=>g(d.map((k,a)=>a===u?{...k,...c}:k));return n("div",{className:"space-y-2",children:[n("div",{className:"flex min-h-7 items-center gap-2",children:[t("span",{className:"shrink-0 text-[13px] font-medium text-dim",children:e.label}),t(H,{children:e.tip}),n("button",{type:"button",className:"ml-auto inline-flex h-7 shrink-0 cursor-pointer items-center gap-1 rounded-lg px-2 text-xs font-medium text-dim transition-colors hover:bg-raised hover:text-ink",onClick:()=>g([...d,{key:"",value:"",saved:!1}]),children:[t(pe,{className:"size-3.5"}),"添加"]})]}),d.map((u,c)=>n("div",{className:"flex min-w-0 items-center gap-1.5",children:[t(b,{"aria-label":`${e.keyLabel} ${c+1}`,placeholder:e.keyLabel,value:u.key,readOnly:u.saved,onChange:(k)=>N(c,{key:k.target.value}),className:"min-w-0 flex-[2] font-mono text-xs"}),t(b,{"aria-label":`${e.keyLabel} ${u.key||c+1} 的值`,type:"password",autoComplete:"off",placeholder:u.saved?"已保存,留空保持不变":"值",value:u.value,onChange:(k)=>N(c,{value:k.target.value}),className:"min-w-0 flex-[3] font-mono text-xs"}),t("button",{type:"button","aria-label":`删除 ${u.key||"该项"}`,className:"flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-lg text-faint transition-colors hover:bg-danger/10 hover:text-danger",onClick:()=>g(d.filter((k,a)=>a!==c)),children:t(Q,{className:"size-4"})})]},c))]})}function Ce(e){return Object.keys(e??{}).map((d)=>({key:d,value:"",saved:!0}))}function we(e){let{Button:d,Segmented:g,Dialog:b,Form:N,Field:u,Input:c,Switch:k,style:a,useTheme:I}=_();I();let{existing:m}=e,[q,G]=r(m?.config.type??"local"),[K,S]=r(m?.name??""),[j,W]=r(m?.config.type==="local"?le(m.config.command):""),[z,V]=r(m?.config.type==="remote"?m.config.url:""),[A,O]=r(Ce(m?.config.type==="local"?m.config.environment:void 0)),[U,te]=r(Ce(m?.config.type==="remote"?m.config.headers:void 0)),E=m?.config.type==="remote"?m.config.oauth:void 0,[T,l]=r(Boolean(E)),[C,M]=r(typeof E==="object"&&E.clientId?E.clientId:""),[p,f]=r(""),[D,R]=r(typeof E==="object"&&E.scope?E.scope:""),[x,J]=r(m?.config.defer??"default"),[ne,ke]=r(m?.config.timeout!==void 0?String(m.config.timeout):""),[oe,Ie]=r(m?.config.defer!==void 0||m?.config.timeout!==void 0),[me,X]=r(),[ie,ue]=r(!1);async function Se(v){v.preventDefault(),X(void 0);let w=K.trim();if(!m&&!De.test(w)){X("名称只能包含英文字母、数字、下划线与中划线,长度 1-64");return}if(!m&&e.taken.includes(w)){X("同名服务器已存在");return}let ae=ne.trim()?Number.parseInt(ne.trim(),10):void 0;if(ae!==void 0&&(!Number.isFinite(ae)||ae<=0)){X("超时时间须为大于 0 的毫秒数");return}let ce;if(q==="local"){let L=xe(j.trim());if(!L.length){X("请输入启动命令");return}let F={};for(let B of A){let P=B.key.trim();if(!P)continue;if(!B.saved||B.value)F[P]=B.value}ce={type:"local",command:L,environment:Object.keys(F).length?F:void 0,enabled:m?m.config.enabled:!0,defer:x==="default"?void 0:x,timeout:ae}}else{let L=z.trim();try{let P=new URL(L);if(P.protocol!=="http:"&&P.protocol!=="https:")throw Error("bad protocol")}catch{X("请输入合法的 HTTP 或 HTTPS 地址");return}let F={};for(let P of U){let se=P.key.trim();if(!se)continue;if(!P.saved||P.value)F[se]=P.value}let B;if(T){let P=C.trim(),se=p.trim(),fe=D.trim();if(P||se||fe)B={clientId:P||void 0,clientSecret:se||void 0,scope:fe||void 0};else B=!0}else B=!1;ce={type:"remote",url:L,headers:Object.keys(F).length?F:void 0,oauth:B,enabled:m?m.config.enabled:!0,defer:x==="default"?void 0:x,timeout:ae}}ue(!0);try{let L=m?.name??w,F=m?m.projectID:e.projectID,B=F?`?projectID=${encodeURIComponent(F)}`:"";await e.connection.request(`/api/mcp/${encodeURIComponent(L)}${B}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(ce)}),e.onSaved()}catch(L){X(L instanceof Error?L.message:"保存失败")}finally{ue(!1)}}return t(b,{open:!0,onOpenChange:(v)=>{if(!v&&!ie)e.onClose()},title:m?`编辑 ${m.name}`:"添加 MCP 服务器",size:"lg",footer:n("div",{className:"flex w-full justify-end gap-2.5",children:[t(d,{type:"button",variant:"ghost",onClick:e.onClose,disabled:ie,className:"min-w-20",children:"取消"}),t(d,{type:"submit",form:"mcp-server-form",variant:"primary",disabled:ie,className:"min-w-24",children:ie?"保存中...":"保存"})]}),children:n(N,{id:"mcp-server-form",onSubmit:Se,children:[t(g,{value:q,onChange:(v)=>G(v),className:"w-full [&>button]:flex-1",options:[{value:"local",label:"本地(标准输入输出)"},{value:"remote",label:"远程(HTTP / SSE)"}]}),!m&&t(u,{label:"名称",aside:t(H,{children:"唯一标识,如 postgres"}),children:(v)=>t(c,{id:v,value:K,onChange:(w)=>S(w.target.value),placeholder:"postgres",className:"font-mono text-xs"})}),q==="local"?n(y,{children:[t(u,{label:"启动命令",aside:t(H,{children:"完整命令及参数"}),children:(v)=>t(c,{id:v,value:j,onChange:(w)=>W(w.target.value),placeholder:"npx -y @modelcontextprotocol/server-postgres ...",className:"font-mono text-xs"})}),t(Ne,{label:"环境变量",tip:"启动进程时注入",keyLabel:"变量名",pairs:A,onChange:O,InputComponent:c})]}):n(y,{children:[t(u,{label:"服务地址",aside:t(H,{children:"HTTP / HTTPS 端点"}),children:(v)=>t(c,{id:v,value:z,onChange:(w)=>V(w.target.value),placeholder:"https://example.com/mcp",className:"font-mono text-xs"})}),t(Ne,{label:"请求头",tip:"随每次请求发送",keyLabel:"头字段",pairs:U,onChange:te,InputComponent:c}),n("div",{className:"flex items-center justify-between gap-4",children:[n("div",{className:"min-w-0",children:[t("span",{className:"block text-[13px] font-medium text-dim",children:"OAuth 2.0 认证"}),t("span",{className:"block truncate text-xs text-faint",children:"自动发现授权端点,使用 PKCE 并刷新令牌"})]}),t(k,{checked:T,onCheckedChange:l,label:"启用 OAuth 2.0"})]}),T&&n(y,{children:[t(u,{label:"Client ID",aside:t(H,{children:"留空自动动态注册(DCR)"}),children:(v)=>t(c,{id:v,value:C,onChange:(w)=>M(w.target.value),placeholder:"留空自动动态注册",className:"font-mono text-xs"})}),t(u,{label:"Client Secret",aside:t(H,{children:"留空保持不变"}),children:(v)=>t(c,{id:v,type:"password",autoComplete:"off",value:p,onChange:(w)=>f(w.target.value),placeholder:"••••••••",className:"font-mono text-xs"})}),t(u,{label:"Scope",aside:t(H,{children:"选填授权范围"}),children:(v)=>t(c,{id:v,value:D,onChange:(w)=>R(w.target.value),placeholder:"repo read:org",className:"font-mono text-xs"})})]})]}),n("div",{className:"space-y-3 border-t border-line/60 pt-3",children:[n("button",{type:"button","aria-expanded":oe,className:"flex w-full cursor-pointer items-center gap-1.5 text-[13px] font-medium text-dim transition-colors hover:text-ink",onClick:()=>Ie(!oe),children:[t(rt,{className:`size-3.5 transition-transform ${oe?"rotate-90":""}`}),"高级设置",t("span",{className:"truncate text-xs font-normal text-faint",children:"加载时机、超时"})]}),oe&&n("div",{className:"grid grid-cols-2 gap-3 max-sm:grid-cols-1",children:[t(u,{label:"加载时机",aside:t(H,{children:"延迟 = 按需加载"}),children:()=>t(g,{value:x,onChange:(v)=>J(v),className:"w-full [&>button]:flex-1",options:[{value:"default",label:"默认"},{value:"defer",label:"延迟"},{value:"always",label:"常驻"}]})}),t(u,{label:"超时(毫秒)",aside:t(H,{children:"留空用默认"}),children:(v)=>t(c,{id:v,value:ne,onChange:(w)=>ke(w.target.value),placeholder:"默认",className:"font-mono text-xs"})})]})]}),me&&n("div",{role:"alert",className:a("callout.base",a("callout.danger"),"px-3 py-2.5 text-xs"),children:[t(Z,{className:"mt-0.5 size-3.5 shrink-0"}),t("span",{className:"min-w-0 break-words",children:me})]})]})})}function tt({connection:e}){let{Button:d,Input:g,style:b,useTheme:N}=_();N();let[u,c]=r(""),[k,a]=r(),[I,m]=r(),[q,G]=r(!1),[K,S]=r(),[j,W]=r(!1),z=i(!1),[V,A]=r(),O=i(0),U=h(async()=>{let l=++O.current;G(!0);try{let C=await e.request("/api/mcp");if(l!==O.current)return;a(C),m(void 0)}catch(C){if(l===O.current)m(C instanceof Error?C.message:"读取失败")}finally{if(l===O.current)G(!1)}},[e]);o(()=>(U(),()=>{O.current++}),[U]);async function te(l,C){if(z.current)return;z.current=!0,W(!0);let M=O.current;try{let p=l.projectID?`?projectID=${encodeURIComponent(l.projectID)}`:"",f=await e.request(`/api/mcp/${encodeURIComponent(l.name)}${p}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({...l.config,enabled:C})});if(M===O.current)a((D)=>D?.map((R)=>R.name===f.name&&R.projectID===f.projectID?f:R))}finally{z.current=!1,W(!1)}}let E=k?.filter((l)=>`${l.name} ${Y(l.config)}`.toLowerCase().includes(u.trim().toLowerCase())),T=k?.find((l)=>l.name===K);return n("div",{className:"min-w-0 space-y-6",children:[n("section",{className:"min-w-0",children:[n("div",{className:"mb-2.5 flex flex-wrap items-end justify-between gap-3 px-0.5",children:[n("div",{className:"min-w-0 flex-1 basis-48",children:[t("h2",{className:b("settings.groupTitle"),children:"MCP 服务器"}),t("p",{className:b("settings.groupDesc"),children:"外部工具与数据源管理"})]}),n("div",{className:"flex gap-2",children:[t(d,{variant:"ghost",disabled:q,onClick:U,className:"h-9 px-2.5 text-xs",children:t(ee,{className:`size-3.5 ${q?"animate-spin":""}`})}),n(d,{variant:"secondary",onClick:()=>A({}),className:"h-9 px-2.5 text-xs",children:[t(pe,{className:"size-3.5 mr-1"}),"添加服务器"]})]})]}),I&&n("div",{role:"alert",className:b("callout.base",b("callout.danger"),"mb-3 flex-wrap items-center justify-between"),children:[n("p",{className:"min-w-0 flex-1 break-words text-sm text-danger",children:["无法读取 MCP 服务器:",I]}),t(d,{disabled:q,onClick:U,children:"重试"})]}),n("div",{className:"relative mb-3 min-w-0",children:[t(de,{"aria-hidden":!0,className:"pointer-events-none absolute top-3 left-3 size-4 text-faint"}),t(g,{type:"search","aria-label":"搜索 MCP 服务器",placeholder:"搜索服务器",value:u,onChange:(l)=>c(l.target.value),className:"h-10 min-w-0 pl-9"})]}),t("div",{className:b("settings.groupBox"),children:!k?t("div",{role:"status","aria-label":"正在加载",className:"divide-y divide-line",children:[0,1,2].map((l)=>n("div",{className:"h-16 space-y-2 px-4 py-3",children:[t("div",{className:"h-3 w-24 animate-pulse rounded bg-raised"}),t("div",{className:"h-3 w-2/3 animate-pulse rounded bg-raised"})]},l))}):E?.length===0?t("p",{className:"p-4 text-sm text-dim",children:"没有匹配的 MCP 服务器"}):t("ul",{className:"divide-y divide-line",children:E?.map((l)=>{let C=l.config.enabled===!1,M=l.scope==="file";return n("li",{className:`flex min-w-0 items-center justify-between gap-3 px-4 py-2.5 transition-colors hover:bg-raised/40 ${C?"opacity-55":""}`,children:[n("button",{type:"button",className:"group flex min-h-12 min-w-0 flex-1 cursor-pointer items-center gap-3 py-1 text-left focus-visible:outline-2 focus-visible:outline-accent","aria-label":`查看 ${l.name}`,disabled:M,title:M?"来自项目的 .mcp.json,只读":void 0,onClick:()=>S(l.name),children:[t("span",{"aria-hidden":!0,className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-raised text-dim",children:l.config.type==="local"?t(lt,{className:"size-4"}):t(be,{className:"size-4"})}),n("span",{className:"min-w-0 flex-1",children:[t("span",{className:"block truncate text-sm font-medium text-ink",title:l.name,children:l.name}),t("span",{className:"mt-0.5 block truncate font-mono text-xs text-dim",title:Y(l.config),children:Y(l.config)})]}),t("span",{className:b("control.badge","shrink-0 text-[11px] text-dim"),children:l.scope==="project"?"项目":l.scope==="file"?".mcp.json":"全局"}),t(he,{info:l})]}),t("span",{className:"relative flex size-10 shrink-0 items-center justify-center",children:!M&&t("input",{type:"checkbox","aria-label":`启用服务器 ${l.name}`,className:ve,disabled:j||q,checked:!C,onChange:(p)=>te(l,p.target.checked)})})]},l.name)})})})]}),T&&!V&&t(ye,{connection:e,info:T,onClose:()=>S(void 0),onEdit:()=>A({info:T}),onChanged:(l)=>l?a((C)=>C?.map((M)=>M.name===l.name?l:M)):U()},`${T.projectID}:${T.name}`),V&&t(we,{connection:e,existing:V.info,taken:(k??[]).map((l)=>l.name),onClose:()=>A(void 0),onSaved:()=>{A(void 0),U()}})]})}export{tt as McpSection};
@@ -0,0 +1 @@
1
+ import{Si}from"./chunk-cktmyc13.js";export{Si as createTreeViewServices};
@@ -1,2 +1,2 @@
1
- import{e,p}from"./chunk-pyg1mr80.js";var ge=e((o,t)=>{let n;if(t==="sandbox")n=p("#i"+o);return(t==="sandbox"?p(n.nodes()[0].contentDocument.body):p("body")).select(`[id="${o}"]`)},"getDiagramElement");
2
- export{ge};
1
+ import{e,p}from"./chunk-5v44qv67.js";var he=e((o,t)=>{let n;if(t==="sandbox")n=p("#i"+o);return(t==="sandbox"?p(n.nodes()[0].contentDocument.body):p("body")).select(`[id="${o}"]`)},"getDiagramElement");
2
+ export{he};
@@ -0,0 +1 @@
1
+ import{Ti}from"./chunk-cktmyc13.js";export{Ti as createArchitectureServices};
@@ -0,0 +1 @@
1
+ import{ct}from"./chunk-30b33r2w.js";export{ct as default};
@@ -1,2 +1,2 @@
1
- import{e,a,B,V}from"./chunk-pyg1mr80.js";import{X}from"./chunk-zc1mk10n.js";var i={parse:e(async(r)=>{let t=await X("info",r);a.debug(t)},"parse")},s={version:"12.2.0"},p=e(()=>s.version,"getVersion"),g={getVersion:p},m=e((r,t,n)=>{a.debug(`rendering info diagram
1
+ import{e,a,B,V}from"./chunk-5v44qv67.js";import{X}from"./chunk-cktmyc13.js";var i={parse:e(async(r)=>{let t=await X("info",r);a.debug(t)},"parse")},s={version:"12.2.0"},p=e(()=>s.version,"getVersion"),g={getVersion:p},m=e((r,t,n)=>{a.debug(`rendering info diagram
2
2
  `+r);let o=V(t);B(o,100,400,!0),o.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${n}`)},"draw"),v={draw:m},y={parser:i,db:g,renderer:v};export{y as diagram};
@@ -1,4 +1,4 @@
1
- import{e,a,ke,b,O,B,C,l,V}from"./chunk-pyg1mr80.js";var M="",D="",E="",W=[],N=new Map,S=e((t)=>O(t,l()),"sanitizeText"),R=e((t)=>{switch(t.type){case"terminal":return{...t,value:S(t.value)};case"nonterminal":return{...t,name:S(t.name)};case"sequence":return{...t,elements:t.elements.map(R)};case"choice":return{...t,alternatives:t.alternatives.map(R)};case"optional":return{...t,element:R(t.element)};case"repetition":return{...t,element:R(t.element),separator:t.separator?R(t.separator):void 0};case"special":return{...t,text:S(t.text)}}},"sanitizeAstNode"),G=e(()=>{M="",D="",E="",W.length=0,N.clear(),C(),a.debug("[Railroad] Database cleared")},"clear"),L=e((t)=>{M=S(t),a.debug("[Railroad] Title set:",t)},"setTitle"),I=e(()=>M,"getTitle"),U=e((t)=>{let n={...t,name:S(t.name),definition:R(t.definition),comment:t.comment?S(t.comment):void 0};if(a.debug("[Railroad] Adding rule:",n.name),N.has(n.name))a.warn(`[Railroad] Rule '${n.name}' is already defined. Overwriting.`);W.push(n),N.set(n.name,n)},"addRule"),j=e(()=>W,"getRules"),J=e((t)=>N.get(t),"getRule"),Q=e((t)=>{D=S(t).replace(/^\s+/g,""),a.debug("[Railroad] Accessibility title set:",t)},"setAccTitle"),Z=e(()=>D,"getAccTitle"),ee=e((t)=>{E=S(t).replace(/\n\s+/g,`
1
+ import{e,a,ke,b,O,B,C,l,V}from"./chunk-5v44qv67.js";var M="",D="",E="",W=[],N=new Map,S=e((t)=>O(t,l()),"sanitizeText"),R=e((t)=>{switch(t.type){case"terminal":return{...t,value:S(t.value)};case"nonterminal":return{...t,name:S(t.name)};case"sequence":return{...t,elements:t.elements.map(R)};case"choice":return{...t,alternatives:t.alternatives.map(R)};case"optional":return{...t,element:R(t.element)};case"repetition":return{...t,element:R(t.element),separator:t.separator?R(t.separator):void 0};case"special":return{...t,text:S(t.text)}}},"sanitizeAstNode"),G=e(()=>{M="",D="",E="",W.length=0,N.clear(),C(),a.debug("[Railroad] Database cleared")},"clear"),L=e((t)=>{M=S(t),a.debug("[Railroad] Title set:",t)},"setTitle"),I=e(()=>M,"getTitle"),U=e((t)=>{let n={...t,name:S(t.name),definition:R(t.definition),comment:t.comment?S(t.comment):void 0};if(a.debug("[Railroad] Adding rule:",n.name),N.has(n.name))a.warn(`[Railroad] Rule '${n.name}' is already defined. Overwriting.`);W.push(n),N.set(n.name,n)},"addRule"),j=e(()=>W,"getRules"),J=e((t)=>N.get(t),"getRule"),Q=e((t)=>{D=S(t).replace(/^\s+/g,""),a.debug("[Railroad] Accessibility title set:",t)},"setAccTitle"),Z=e(()=>D,"getAccTitle"),ee=e((t)=>{E=S(t).replace(/\n\s+/g,`
2
2
  `),a.debug("[Railroad] Accessibility description set:",t)},"setAccDescription"),te=e(()=>E,"getAccDescription"),re=L,ie=I,K={clear:G,setTitle:L,getTitle:I,addRule:U,getRules:j,getRule:J,setAccTitle:Q,getAccTitle:Z,setAccDescription:ee,getAccDescription:te,setDiagramTitle:re,getDiagramTitle:ie},T={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},ne=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,ae=/^[\w "',.-]+$/,oe=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),X=e((t)=>{if(!t)return!1;return Object.keys(t).every((n)=>n==="railroad"||oe.has(n))},"isRailroadStyleOptions"),le=e((t)=>{if(!t)return{};if("railroad"in t&&t.railroad)return t.railroad;return X(t)?t:{}},"extractRailroadOverrides"),se=e((t)=>{if(!t||X(t))return{};let{railroad:n,svgId:s,theme:i,look:r,...o}=t;return o},"extractThemeOverrides"),u=e((t,n)=>{if(typeof t!=="string")return n;let s=t.trim();return ne.test(s)?s:n},"sanitizeColorValue"),H=e((t,n)=>{if(typeof t!=="string")return n;let s=t.trim();return ae.test(s)?s:n},"sanitizeFontFamilyValue"),y=e((t,n)=>{let s=typeof t==="number"?t:typeof t==="string"?Number.parseFloat(t):Number.NaN;return Number.isFinite(s)&&s>=0?s:n},"sanitizeNumberValue"),de=e((t)=>{let n=typeof t==="number"?t:typeof t==="string"?Number.parseFloat(t):Number.NaN;return Number.isFinite(n)&&n>0?n:void 0},"parseThemeFontSize"),ce=e((t)=>{let n=H(t.fontFamily,T.fontFamily),s=de(t.fontSize)??T.fontSize;return{...T,fontFamily:n,fontSize:s,terminalFill:u(t.secondBkg??t.secondaryColor,T.terminalFill),terminalStroke:u(t.secondaryBorderColor??t.lineColor,T.terminalStroke),terminalTextColor:u(t.secondaryTextColor??t.textColor,T.terminalTextColor),nonTerminalFill:u(t.mainBkg??t.background,T.nonTerminalFill),nonTerminalStroke:u(t.primaryBorderColor??t.lineColor,T.nonTerminalStroke),nonTerminalTextColor:u(t.primaryTextColor??t.textColor,T.nonTerminalTextColor),lineColor:u(t.lineColor,T.lineColor),markerFill:u(t.lineColor,T.markerFill),commentFill:u(t.labelBackground??t.tertiaryColor,T.commentFill),commentStroke:u(t.tertiaryBorderColor??t.lineColor,T.commentStroke),commentTextColor:u(t.tertiaryTextColor??t.textColor,T.commentTextColor),specialFill:u(t.tertiaryColor??t.secondaryColor,T.specialFill),specialStroke:u(t.tertiaryBorderColor??t.secondaryBorderColor,T.specialStroke),ruleNameColor:u(t.titleColor??t.textColor,T.ruleNameColor)}},"buildThemeDefaults"),_=e((t)=>{let n=b(),s={...ke(),...n.themeVariables??{},...se(t)},i=ce(s),r={...n.railroad??{},...le(t)};return{compactMode:r.compactMode??i.compactMode,padding:y(r.padding,i.padding),verticalSeparation:y(r.verticalSeparation,i.verticalSeparation),horizontalSeparation:y(r.horizontalSeparation,i.horizontalSeparation),arcRadius:y(r.arcRadius,i.arcRadius),fontSize:y(r.fontSize,i.fontSize),fontFamily:H(r.fontFamily,i.fontFamily),terminalFill:u(r.terminalFill,i.terminalFill),terminalStroke:u(r.terminalStroke,i.terminalStroke),terminalTextColor:u(r.terminalTextColor,i.terminalTextColor),nonTerminalFill:u(r.nonTerminalFill,i.nonTerminalFill),nonTerminalStroke:u(r.nonTerminalStroke,i.nonTerminalStroke),nonTerminalTextColor:u(r.nonTerminalTextColor,i.nonTerminalTextColor),lineColor:u(r.lineColor,i.lineColor),strokeWidth:y(r.strokeWidth,i.strokeWidth),markerFill:u(r.markerFill,i.markerFill),commentFill:u(r.commentFill,i.commentFill),commentStroke:u(r.commentStroke,i.commentStroke),commentTextColor:u(r.commentTextColor,i.commentTextColor),specialFill:u(r.specialFill,i.specialFill),specialStroke:u(r.specialStroke,i.specialStroke),ruleNameColor:u(r.ruleNameColor,i.ruleNameColor),showMarkers:r.showMarkers??i.showMarkers,markerRadius:y(r.markerRadius,i.markerRadius)}},"buildRailroadStyleOptions"),Dt=e((t)=>{let{fontFamily:n,fontSize:s,terminalFill:i,terminalStroke:r,terminalTextColor:o,nonTerminalFill:g,nonTerminalStroke:m,nonTerminalTextColor:d,lineColor:f,strokeWidth:p,markerFill:h,commentFill:k,commentStroke:c,commentTextColor:x,specialFill:z,specialStroke:F,ruleNameColor:v}=_(t);return`
3
3
  .railroad-diagram {
4
4
  font-family: ${n};