@legionworks/facet 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (327) hide show
  1. package/LICENSE-APACHE +202 -0
  2. package/LICENSE-MIT +23 -0
  3. package/README.md +158 -0
  4. package/dist/gallery/chunk-4g8rem85.css +656 -0
  5. package/dist/gallery/chunk-c6s9k9ty.js +5970 -0
  6. package/dist/gallery/frame/artifact.css +8424 -0
  7. package/dist/gallery/frame/chunks/abnfDiagram-N423BO3Z-jj74szbm.js +155 -0
  8. package/dist/gallery/frame/chunks/architecture-TIHT7OUA-cvdjn7dt.js +10 -0
  9. package/dist/gallery/frame/chunks/architectureDiagram-T3A2C74G-n4z77eg6.js +8675 -0
  10. package/dist/gallery/frame/chunks/blockDiagram-VBNYF7ZC-7xsqzrd1.js +3529 -0
  11. package/dist/gallery/frame/chunks/c4Diagram-5PPSVZJV-z2zjs7wx.js +2413 -0
  12. package/dist/gallery/frame/chunks/classDiagram-JCYQIIEL-ve8rngqp.js +47 -0
  13. package/dist/gallery/frame/chunks/classDiagram-v2-OCEON4UE-8cfaxb8z.js +47 -0
  14. package/dist/gallery/frame/chunks/cose-bilkent-JH36ORCC-sn92qexx.js +4822 -0
  15. package/dist/gallery/frame/chunks/cynefin-VYW2F7L2-tqjv913d.js +10 -0
  16. package/dist/gallery/frame/chunks/cynefinDiagram-MW4NZA55-c1c0dj12.js +500 -0
  17. package/dist/gallery/frame/chunks/dagre-VZM6K2ZE-7tyg4yt2.js +476 -0
  18. package/dist/gallery/frame/chunks/diagram-7IWD3JNH-y4eng9sc.js +526 -0
  19. package/dist/gallery/frame/chunks/diagram-B4RE2ZJO-rn3p7j5h.js +673 -0
  20. package/dist/gallery/frame/chunks/diagram-LBJQPF4R-w4a2cm9q.js +255 -0
  21. package/dist/gallery/frame/chunks/diagram-Q27KOJAE-aqc2v7wy.js +575 -0
  22. package/dist/gallery/frame/chunks/diagram-UB23O5K3-xncy8nyd.js +355 -0
  23. package/dist/gallery/frame/chunks/ebnfDiagram-BXEA7PRR-acwgxz16.js +175 -0
  24. package/dist/gallery/frame/chunks/erDiagram-JOGREHBK-mzp5nswt.js +1332 -0
  25. package/dist/gallery/frame/chunks/eventmodeling-45OFAUF4-sg07qr0c.js +10 -0
  26. package/dist/gallery/frame/chunks/flowDiagram-UKHOOZJN-2e5ygs44.js +29 -0
  27. package/dist/gallery/frame/chunks/ganttDiagram-PKOTCBZU-p2hhh7hr.js +2620 -0
  28. package/dist/gallery/frame/chunks/gitGraph-TEB2WS4Q-j6kw0naa.js +10 -0
  29. package/dist/gallery/frame/chunks/gitGraphDiagram-DS77QQ5N-4z9z8wjm.js +1347 -0
  30. package/dist/gallery/frame/chunks/info-DKCQHKI2-mpt80jd3.js +10 -0
  31. package/dist/gallery/frame/chunks/infoDiagram-6WML65LV-5rqm3mgg.js +65 -0
  32. package/dist/gallery/frame/chunks/ishikawaDiagram-WSZJBQD7-b51z96jy.js +975 -0
  33. package/dist/gallery/frame/chunks/journeyDiagram-NVQOT4AX-9jbfp0pk.js +1272 -0
  34. package/dist/gallery/frame/chunks/kanban-definition-27J2QSJJ-4x0vx4se.js +1116 -0
  35. package/dist/gallery/frame/chunks/katex-xfgk95tv.js +14034 -0
  36. package/dist/gallery/frame/chunks/markdown-1s5vwkf2.js +9 -0
  37. package/dist/gallery/frame/chunks/markdown-2h6bwsms.js +3239 -0
  38. package/dist/gallery/frame/chunks/markdown-2x113yh8.js +107 -0
  39. package/dist/gallery/frame/chunks/markdown-30b7rwmp.js +1943 -0
  40. package/dist/gallery/frame/chunks/markdown-356bfj4g.js +2031 -0
  41. package/dist/gallery/frame/chunks/markdown-44n9ea69.js +2406 -0
  42. package/dist/gallery/frame/chunks/markdown-56enrf2r.js +39 -0
  43. package/dist/gallery/frame/chunks/markdown-5avymm8t.js +725 -0
  44. package/dist/gallery/frame/chunks/markdown-6r4svars.js +33 -0
  45. package/dist/gallery/frame/chunks/markdown-6zz8efx2.js +24 -0
  46. package/dist/gallery/frame/chunks/markdown-7jp6prnb.js +19 -0
  47. package/dist/gallery/frame/chunks/markdown-809k7q41.js +55 -0
  48. package/dist/gallery/frame/chunks/markdown-82xmzhzd.js +1076 -0
  49. package/dist/gallery/frame/chunks/markdown-92n37gd4.js +7627 -0
  50. package/dist/gallery/frame/chunks/markdown-ag2sssf8.js +36 -0
  51. package/dist/gallery/frame/chunks/markdown-b4s7ntq2.js +19 -0
  52. package/dist/gallery/frame/chunks/markdown-c9k0fvp1.js +100 -0
  53. package/dist/gallery/frame/chunks/markdown-ceefymn8.js +125 -0
  54. package/dist/gallery/frame/chunks/markdown-d1wfbs70.js +243 -0
  55. package/dist/gallery/frame/chunks/markdown-dy5sgjhc.js +11022 -0
  56. package/dist/gallery/frame/chunks/markdown-dz3z5w30.js +30868 -0
  57. package/dist/gallery/frame/chunks/markdown-eg6ngz7y.js +30340 -0
  58. package/dist/gallery/frame/chunks/markdown-ff5wvb43.js +1149 -0
  59. package/dist/gallery/frame/chunks/markdown-ffg06nfz.js +86 -0
  60. package/dist/gallery/frame/chunks/markdown-fvfncadf.js +472 -0
  61. package/dist/gallery/frame/chunks/markdown-gvyszqpv.js +19 -0
  62. package/dist/gallery/frame/chunks/markdown-gx1p0ew0.js +88 -0
  63. package/dist/gallery/frame/chunks/markdown-gxye5frz.js +65 -0
  64. package/dist/gallery/frame/chunks/markdown-h7pzv34e.js +105 -0
  65. package/dist/gallery/frame/chunks/markdown-hab789t9.js +47 -0
  66. package/dist/gallery/frame/chunks/markdown-hjp6sj8t.js +125 -0
  67. package/dist/gallery/frame/chunks/markdown-jka64qgp.js +1993 -0
  68. package/dist/gallery/frame/chunks/markdown-k8xkn8mw.js +56 -0
  69. package/dist/gallery/frame/chunks/markdown-m7frq8x8.js +112 -0
  70. package/dist/gallery/frame/chunks/markdown-p740v4qm.js +36 -0
  71. package/dist/gallery/frame/chunks/markdown-pxfeh231.js +57 -0
  72. package/dist/gallery/frame/chunks/markdown-pzgd8z3s.js +87 -0
  73. package/dist/gallery/frame/chunks/markdown-qx3cngz2.js +1673 -0
  74. package/dist/gallery/frame/chunks/markdown-rawhfvvc.js +85 -0
  75. package/dist/gallery/frame/chunks/markdown-rd8w0ng9.js +49 -0
  76. package/dist/gallery/frame/chunks/markdown-rm2yxfjj.js +2773 -0
  77. package/dist/gallery/frame/chunks/markdown-s1jatrnk.js +993 -0
  78. package/dist/gallery/frame/chunks/markdown-sgfg5vvq.js +59 -0
  79. package/dist/gallery/frame/chunks/markdown-t4ethv9d.js +409 -0
  80. package/dist/gallery/frame/chunks/markdown-tnmabqvz.js +36 -0
  81. package/dist/gallery/frame/chunks/markdown-tvdpppw8.js +5292 -0
  82. package/dist/gallery/frame/chunks/markdown-v0x27twr.js +22 -0
  83. package/dist/gallery/frame/chunks/markdown-v14td68x.js +36 -0
  84. package/dist/gallery/frame/chunks/markdown-w6sgd54z.js +36 -0
  85. package/dist/gallery/frame/chunks/markdown-xw8dsk8b.js +2125 -0
  86. package/dist/gallery/frame/chunks/markdown-y18mve73.js +85 -0
  87. package/dist/gallery/frame/chunks/markdown-yengsms5.js +427 -0
  88. package/dist/gallery/frame/chunks/markdown-z1wc0v0d.js +1826 -0
  89. package/dist/gallery/frame/chunks/markdown-zazx9h4n.js +329 -0
  90. package/dist/gallery/frame/chunks/mermaid-de7p4v0x.js +30 -0
  91. package/dist/gallery/frame/chunks/mindmap-definition-FAOFIHXS-ra44cbem.js +1216 -0
  92. package/dist/gallery/frame/chunks/packet-7NZHBO7P-xppm5913.js +10 -0
  93. package/dist/gallery/frame/chunks/pegDiagram-VL7TDLO6-a2a4wg03.js +163 -0
  94. package/dist/gallery/frame/chunks/pie-RZYD4A2V-hnbxk152.js +10 -0
  95. package/dist/gallery/frame/chunks/pieDiagram-7S7Q4E2Y-f1vxjtmx.js +311 -0
  96. package/dist/gallery/frame/chunks/quadrantDiagram-CIZ2JOQS-ywafa6kh.js +1390 -0
  97. package/dist/gallery/frame/chunks/radar-I7S5WNFK-ewqd27se.js +10 -0
  98. package/dist/gallery/frame/chunks/railroad-3IZDKUUU-5hy4bdx3.js +10 -0
  99. package/dist/gallery/frame/chunks/railroad-abnf-AHOZXSZD-bh5sxz0d.js +10 -0
  100. package/dist/gallery/frame/chunks/railroad-ebnf-EBAXGLYW-6b9c3zeh.js +10 -0
  101. package/dist/gallery/frame/chunks/railroad-peg-LSFZ7HO6-avc8v39s.js +10 -0
  102. package/dist/gallery/frame/chunks/railroadDiagram-AXF67PYL-qc61wax4.js +131 -0
  103. package/dist/gallery/frame/chunks/requirementDiagram-LRYGKXZP-9bs4786c.js +1295 -0
  104. package/dist/gallery/frame/chunks/sankeyDiagram-W5VNT64P-awt1em8b.js +1339 -0
  105. package/dist/gallery/frame/chunks/sequenceDiagram-SI44F4Z6-qaf9mz3t.js +4324 -0
  106. package/dist/gallery/frame/chunks/sizeCapture-X5ZJPWSS-9fq685xd.js +64 -0
  107. package/dist/gallery/frame/chunks/stateDiagram-OKZ733FA-vx7a7hh0.js +456 -0
  108. package/dist/gallery/frame/chunks/stateDiagram-v2-UEYNNEHI-x4m6ws5t.js +46 -0
  109. package/dist/gallery/frame/chunks/swimlanes-SLNWSIFB-e4mxm1gh.js +8287 -0
  110. package/dist/gallery/frame/chunks/swimlanesDiagram-ULZ7WXOC-0h93e2qq.js +42 -0
  111. package/dist/gallery/frame/chunks/timeline-definition-Z64GVDOM-wp0bhbzg.js +1549 -0
  112. package/dist/gallery/frame/chunks/treeView-QDETBFTQ-hcx7n0vt.js +10 -0
  113. package/dist/gallery/frame/chunks/treemap-6X3UGDF4-av02skdw.js +10 -0
  114. package/dist/gallery/frame/chunks/vennDiagram-T6HMQDX7-pmvk1p7n.js +2566 -0
  115. package/dist/gallery/frame/chunks/wardley-OPB4EBWU-njsp6e40.js +10 -0
  116. package/dist/gallery/frame/chunks/wardleyDiagram-T6FBY63Y-eggmnv4z.js +979 -0
  117. package/dist/gallery/frame/chunks/xychartDiagram-ELKLHX3M-q40tnpe5.js +1954 -0
  118. package/dist/gallery/frame/frame.css +183 -0
  119. package/dist/gallery/frame/runtime/chart.js +42744 -0
  120. package/dist/gallery/frame/runtime/html.js +14 -0
  121. package/dist/gallery/frame/runtime/markdown.js +1403 -0
  122. package/dist/gallery/frame/runtime/mermaid.js +32 -0
  123. package/dist/gallery/frame/runtime/svg.js +14 -0
  124. package/dist/gallery/frame/runtime/tsx.js +52 -0
  125. package/dist/gallery/index.html +104 -0
  126. package/docs/reference/cli.md +163 -0
  127. package/docs/reference/export.md +106 -0
  128. package/docs/reference/html.md +215 -0
  129. package/docs/reference/http.md +85 -0
  130. package/docs/reference/mcp.md +78 -0
  131. package/docs/reference/security.md +119 -0
  132. package/docs/reference/storage.md +93 -0
  133. package/docs/reference/tsx.md +101 -0
  134. package/docs/reference/validation.md +212 -0
  135. package/package.json +89 -0
  136. package/scripts/build-gallery.ts +127 -0
  137. package/scripts/launch-netns.sh +67 -0
  138. package/skills/facet/SKILL.md +100 -0
  139. package/src/cli/client.ts +311 -0
  140. package/src/cli/commands/create.ts +49 -0
  141. package/src/cli/commands/doctor.ts +249 -0
  142. package/src/cli/commands/export.ts +179 -0
  143. package/src/cli/commands/instantiate.ts +35 -0
  144. package/src/cli/commands/list.ts +49 -0
  145. package/src/cli/commands/open.ts +75 -0
  146. package/src/cli/commands/pin.ts +39 -0
  147. package/src/cli/commands/promote.ts +49 -0
  148. package/src/cli/commands/publish.ts +122 -0
  149. package/src/cli/commands/read-back.ts +56 -0
  150. package/src/cli/commands/status.ts +114 -0
  151. package/src/cli/commands/watch.ts +146 -0
  152. package/src/cli/main.ts +522 -0
  153. package/src/cli/output.ts +106 -0
  154. package/src/cli/parser.ts +376 -0
  155. package/src/cli/presenter.ts +212 -0
  156. package/src/cli/service-metadata.ts +134 -0
  157. package/src/cli/spawn-service.ts +326 -0
  158. package/src/css.d.ts +4 -0
  159. package/src/gallery-web/app.ts +1581 -0
  160. package/src/gallery-web/export-menu.ts +121 -0
  161. package/src/gallery-web/export.ts +112 -0
  162. package/src/gallery-web/favicon.ts +54 -0
  163. package/src/gallery-web/frame/entries/chart.ts +6 -0
  164. package/src/gallery-web/frame/entries/html.ts +6 -0
  165. package/src/gallery-web/frame/entries/markdown.ts +6 -0
  166. package/src/gallery-web/frame/entries/mermaid.ts +6 -0
  167. package/src/gallery-web/frame/entries/svg.ts +6 -0
  168. package/src/gallery-web/frame/entries/tsx.ts +6 -0
  169. package/src/gallery-web/frame/frame-payload.ts +91 -0
  170. package/src/gallery-web/frame/renderer-validation.ts +13 -0
  171. package/src/gallery-web/frame/renderers/chart.ts +182 -0
  172. package/src/gallery-web/frame/renderers/dompurify-shim.ts +112 -0
  173. package/src/gallery-web/frame/renderers/html.ts +48 -0
  174. package/src/gallery-web/frame/renderers/markdown.ts +81 -0
  175. package/src/gallery-web/frame/renderers/mermaid.ts +120 -0
  176. package/src/gallery-web/frame/renderers/registry.ts +260 -0
  177. package/src/gallery-web/frame/renderers/svg.ts +393 -0
  178. package/src/gallery-web/frame/renderers/tsx.ts +61 -0
  179. package/src/gallery-web/frame/runtime.ts +501 -0
  180. package/src/gallery-web/frame/styles/artifact.css +8424 -0
  181. package/src/gallery-web/frame/styles/frame.css +183 -0
  182. package/src/gallery-web/frame/styles/html-source.css +23 -0
  183. package/src/gallery-web/frame/view-box.ts +33 -0
  184. package/src/gallery-web/frame-html.ts +72 -0
  185. package/src/gallery-web/index.html +104 -0
  186. package/src/gallery-web/session.ts +107 -0
  187. package/src/gallery-web/sse-client.ts +212 -0
  188. package/src/gallery-web/styles/app.css +420 -0
  189. package/src/gallery-web/styles/tokens.css +112 -0
  190. package/src/gallery-web/styles/verdict.css +186 -0
  191. package/src/gallery-web/swap.ts +64 -0
  192. package/src/gallery-web/theme.ts +40 -0
  193. package/src/gallery-web/view-state.ts +93 -0
  194. package/src/harness-adapters/claude-code/README.md +10 -0
  195. package/src/harness-adapters/claude-code/facet.sh +4 -0
  196. package/src/harness-adapters/codex/README.md +10 -0
  197. package/src/harness-adapters/codex/facet.sh +4 -0
  198. package/src/harness-adapters/mcp/README.md +13 -0
  199. package/src/harness-adapters/mcp/cli-bridge.ts +216 -0
  200. package/src/harness-adapters/mcp/main.ts +15 -0
  201. package/src/harness-adapters/mcp/server.ts +164 -0
  202. package/src/harness-adapters/mcp/tool-schemas.ts +53 -0
  203. package/src/harness-adapters/opencode/README.md +10 -0
  204. package/src/harness-adapters/opencode/facet.sh +4 -0
  205. package/src/runtime/compiled-entrypoints.ts +69 -0
  206. package/src/service/dispatcher.ts +717 -0
  207. package/src/service/export.ts +218 -0
  208. package/src/service/http-utils.ts +55 -0
  209. package/src/service/lexical/expectations.ts +210 -0
  210. package/src/service/lifecycle/idle-controller.ts +125 -0
  211. package/src/service/lifecycle/orphan-cleanup.ts +128 -0
  212. package/src/service/lifecycle/process-lock.ts +235 -0
  213. package/src/service/main.ts +136 -0
  214. package/src/service/process.ts +240 -0
  215. package/src/service/router-guards.ts +239 -0
  216. package/src/service/router.ts +627 -0
  217. package/src/service/security/auth.ts +168 -0
  218. package/src/service/security/host-origin.ts +138 -0
  219. package/src/service/security/http-guards.ts +13 -0
  220. package/src/service/security/leases.ts +182 -0
  221. package/src/service/security/token-store.ts +138 -0
  222. package/src/service/server.ts +356 -0
  223. package/src/service/store/database.ts +61 -0
  224. package/src/service/store/evidence-retention.ts +234 -0
  225. package/src/service/store/migrations.ts +167 -0
  226. package/src/service/store/repository-lifecycle.ts +121 -0
  227. package/src/service/store/repository.ts +732 -0
  228. package/src/service/store/schema.ts +218 -0
  229. package/src/service/stored-verdict.ts +97 -0
  230. package/src/service/stream.ts +301 -0
  231. package/src/service/verdict-enrichment.ts +45 -0
  232. package/src/shared/build/frame-bundle-plugins.ts +61 -0
  233. package/src/shared/build-mode.ts +28 -0
  234. package/src/shared/config/evidence-read.ts +98 -0
  235. package/src/shared/config/limits.ts +56 -0
  236. package/src/shared/config/paths.ts +96 -0
  237. package/src/shared/contracts/artifact-types.ts +2 -0
  238. package/src/shared/contracts/artifact.ts +98 -0
  239. package/src/shared/contracts/commands/_shared.ts +59 -0
  240. package/src/shared/contracts/commands/guards.ts +86 -0
  241. package/src/shared/contracts/commands/index.ts +204 -0
  242. package/src/shared/contracts/commands/names.ts +35 -0
  243. package/src/shared/contracts/commands/requests.ts +149 -0
  244. package/src/shared/contracts/commands/results.ts +200 -0
  245. package/src/shared/contracts/envelope.ts +140 -0
  246. package/src/shared/contracts/events.ts +41 -0
  247. package/src/shared/contracts/observed-counts.ts +19 -0
  248. package/src/shared/contracts/renderers.ts +6 -0
  249. package/src/shared/contracts/validation.ts +296 -0
  250. package/src/shared/errors/facet-error.ts +127 -0
  251. package/src/shared/errors/store-error.ts +68 -0
  252. package/src/shared/evidence-image.ts +37 -0
  253. package/src/shared/export.ts +31 -0
  254. package/src/shared/html/policy.ts +108 -0
  255. package/src/shared/html/style-vocabulary.ts +352 -0
  256. package/src/shared/logging/logger.ts +108 -0
  257. package/src/shared/logging/redact.ts +49 -0
  258. package/src/shared/security/frozen-csp.ts +13 -0
  259. package/src/shared/storage-version.ts +2 -0
  260. package/src/shared/tsx/execution.ts +29 -0
  261. package/src/shared/tsx/import-policy.ts +94 -0
  262. package/src/shared/util/dir-permissions.ts +94 -0
  263. package/src/shared/util/mermaid-nodes.ts +230 -0
  264. package/src/shared/util/process.ts +67 -0
  265. package/src/shared/util/time.ts +21 -0
  266. package/src/shared/version.ts +3 -0
  267. package/src/validation/sandbox/limits.ts +41 -0
  268. package/src/validation/sandbox/netns.ts +177 -0
  269. package/src/validation/tier0/chart.ts +177 -0
  270. package/src/validation/tier0/dom-shim.ts +54 -0
  271. package/src/validation/tier0/html.ts +408 -0
  272. package/src/validation/tier0/markdown.ts +285 -0
  273. package/src/validation/tier0/mermaid.ts +98 -0
  274. package/src/validation/tier0/runner.ts +504 -0
  275. package/src/validation/tier0/svg.ts +321 -0
  276. package/src/validation/tier0/tsx/allowlist-resolver.ts +77 -0
  277. package/src/validation/tier0/tsx/ast-policy-capabilities.ts +238 -0
  278. package/src/validation/tier0/tsx/ast-policy-shared.ts +71 -0
  279. package/src/validation/tier0/tsx/ast-policy.ts +181 -0
  280. package/src/validation/tier0/tsx/compiler.ts +156 -0
  281. package/src/validation/tier0/worker-dispatch.ts +211 -0
  282. package/src/validation/tier0/worker-entry.ts +96 -0
  283. package/src/validation/tier0/worker-input.ts +75 -0
  284. package/src/validation/tier1/browser-process.ts +147 -0
  285. package/src/validation/tier1/cdp-pipe.ts +281 -0
  286. package/src/validation/tier1/entries/chart.ts +5 -0
  287. package/src/validation/tier1/entries/html.ts +6 -0
  288. package/src/validation/tier1/entries/markdown.ts +5 -0
  289. package/src/validation/tier1/entries/mermaid.ts +5 -0
  290. package/src/validation/tier1/entries/svg.ts +5 -0
  291. package/src/validation/tier1/entries/tsx.ts +5 -0
  292. package/src/validation/tier1/frame-target.ts +162 -0
  293. package/src/validation/tier1/harness-entry.ts +261 -0
  294. package/src/validation/tier1/harness.ts +215 -0
  295. package/src/validation/tier1/isolated-probe.ts +94 -0
  296. package/src/validation/tier1/launcher.ts +177 -0
  297. package/src/validation/tier1/limits.ts +80 -0
  298. package/src/validation/tier1/nonce.ts +17 -0
  299. package/src/validation/tier1/protocol-probe.ts +519 -0
  300. package/src/validation/tier1/runner.ts +1122 -0
  301. package/src/validation/tier1/verdict.ts +246 -0
  302. package/src/validation/tier1/webp.ts +69 -0
  303. package/templates/README.md +88 -0
  304. package/templates/bar-compare.vl.json +63 -0
  305. package/templates/capacity-report.tsx +102 -0
  306. package/templates/decision-record.md +24 -0
  307. package/templates/deployment-state.mmd +40 -0
  308. package/templates/exemplar.md +91 -0
  309. package/templates/facet-story.tsx +799 -0
  310. package/templates/fleet-dashboard.html +141 -0
  311. package/templates/html-release-ledger.html +91 -0
  312. package/templates/html-status-report.html +114 -0
  313. package/templates/incident-console.tsx +147 -0
  314. package/templates/legion-boundaries.mmd +23 -0
  315. package/templates/legion-flow.mmd +15 -0
  316. package/templates/legion-sequence.mmd +14 -0
  317. package/templates/legion-state.mmd +7 -0
  318. package/templates/metric-card.svg +29 -0
  319. package/templates/observability-map.svg +101 -0
  320. package/templates/pipeline-audit.md +108 -0
  321. package/templates/release-metrics.vl.json +98 -0
  322. package/templates/service-topology.mmd +47 -0
  323. package/templates/status-report.md +32 -0
  324. package/templates/system-map.svg +53 -0
  325. package/templates/timeseries.vl.json +71 -0
  326. package/templates/tsx-interactive-counter.tsx +19 -0
  327. package/templates/tsx-status-report.tsx +31 -0
@@ -0,0 +1,2406 @@
1
+ import {
2
+ getIconStyles
3
+ } from "./markdown-v0x27twr.js";
4
+ import {
5
+ createTooltip
6
+ } from "./markdown-hjp6sj8t.js";
7
+ import {
8
+ getDiagramElement
9
+ } from "./markdown-gvyszqpv.js";
10
+ import {
11
+ setupViewPortForSVG
12
+ } from "./markdown-6r4svars.js";
13
+ import {
14
+ JSON_SCHEMA,
15
+ load
16
+ } from "./markdown-rm2yxfjj.js";
17
+ import {
18
+ getRegisteredLayoutAlgorithm,
19
+ render
20
+ } from "./markdown-h7pzv34e.js";
21
+ import {
22
+ isValidShape
23
+ } from "./markdown-tvdpppw8.js";
24
+ import {
25
+ getEdgeId,
26
+ utils_default
27
+ } from "./markdown-ff5wvb43.js";
28
+ import {
29
+ channel_default,
30
+ clear,
31
+ common_default,
32
+ defaultConfig2,
33
+ dompurify_shim_default,
34
+ getAccDescription,
35
+ getAccTitle,
36
+ getConfig2,
37
+ getDiagramTitle,
38
+ getUserDefinedConfig,
39
+ rgba_default,
40
+ setAccDescription,
41
+ setAccTitle,
42
+ setConfig2,
43
+ setDiagramTitle
44
+ } from "./markdown-92n37gd4.js";
45
+ import {
46
+ log,
47
+ select_default
48
+ } from "./markdown-xw8dsk8b.js";
49
+ import {
50
+ __name
51
+ } from "./markdown-1s5vwkf2.js";
52
+
53
+ // node_modules/mermaid/dist/chunks/mermaid.core/chunk-JQJVKLGR.mjs
54
+ var MERMAID_DOM_ID_PREFIX = "flowchart-";
55
+ var FlowDB = class {
56
+ constructor() {
57
+ this.vertexCounter = 0;
58
+ this.config = getConfig2();
59
+ this.diagramId = "";
60
+ this.vertices = /* @__PURE__ */ new Map;
61
+ this.edges = [];
62
+ this.classes = /* @__PURE__ */ new Map;
63
+ this.subGraphs = [];
64
+ this.subGraphLookup = /* @__PURE__ */ new Map;
65
+ this.tooltips = /* @__PURE__ */ new Map;
66
+ this.subCount = 0;
67
+ this.firstGraphFlag = true;
68
+ this.secCount = -1;
69
+ this.posCrossRef = [];
70
+ this.funs = [];
71
+ this.setAccTitle = setAccTitle;
72
+ this.setAccDescription = setAccDescription;
73
+ this.setDiagramTitle = setDiagramTitle;
74
+ this.getAccTitle = getAccTitle;
75
+ this.getAccDescription = getAccDescription;
76
+ this.getDiagramTitle = getDiagramTitle;
77
+ this.funs.push(this.setupToolTips.bind(this));
78
+ this.addVertex = this.addVertex.bind(this);
79
+ this.firstGraph = this.firstGraph.bind(this);
80
+ this.setDirection = this.setDirection.bind(this);
81
+ this.addSubGraph = this.addSubGraph.bind(this);
82
+ this.addLink = this.addLink.bind(this);
83
+ this.setLink = this.setLink.bind(this);
84
+ this.updateLink = this.updateLink.bind(this);
85
+ this.addClass = this.addClass.bind(this);
86
+ this.setClass = this.setClass.bind(this);
87
+ this.destructLink = this.destructLink.bind(this);
88
+ this.setClickEvent = this.setClickEvent.bind(this);
89
+ this.setTooltip = this.setTooltip.bind(this);
90
+ this.updateLinkInterpolate = this.updateLinkInterpolate.bind(this);
91
+ this.setClickFun = this.setClickFun.bind(this);
92
+ this.bindFunctions = this.bindFunctions.bind(this);
93
+ this.lex = {
94
+ firstGraph: this.firstGraph.bind(this)
95
+ };
96
+ this.clear();
97
+ this.setGen("gen-2");
98
+ }
99
+ static {
100
+ __name(this, "FlowDB");
101
+ }
102
+ sanitizeText(txt) {
103
+ return common_default.sanitizeText(txt, this.config);
104
+ }
105
+ sanitizeNodeLabelType(labelType) {
106
+ switch (labelType) {
107
+ case "markdown":
108
+ case "string":
109
+ case "text":
110
+ return labelType;
111
+ default:
112
+ return "markdown";
113
+ }
114
+ }
115
+ setDiagramId(svgElementId) {
116
+ this.diagramId = svgElementId;
117
+ }
118
+ lookUpDomId(id) {
119
+ for (const vertex of this.vertices.values()) {
120
+ if (vertex.id === id) {
121
+ return this.diagramId ? `${this.diagramId}-${vertex.domId}` : vertex.domId;
122
+ }
123
+ }
124
+ return this.diagramId ? `${this.diagramId}-${id}` : id;
125
+ }
126
+ addVertex(id, textObj, type, style, classes, dir, props = {}, metadata) {
127
+ if (!id || id.trim().length === 0) {
128
+ return;
129
+ }
130
+ let doc;
131
+ if (metadata !== undefined) {
132
+ let yamlData;
133
+ if (!metadata.includes(`
134
+ `)) {
135
+ yamlData = `{
136
+ ` + metadata + `
137
+ }`;
138
+ } else {
139
+ yamlData = metadata + `
140
+ `;
141
+ }
142
+ doc = load(yamlData, { schema: JSON_SCHEMA });
143
+ }
144
+ const edge = this.edges.find((e) => e.id === id);
145
+ if (edge) {
146
+ const edgeDoc = doc;
147
+ if (edgeDoc?.animate !== undefined) {
148
+ edge.animate = edgeDoc.animate;
149
+ }
150
+ if (edgeDoc?.animation !== undefined) {
151
+ edge.animation = edgeDoc.animation;
152
+ }
153
+ if (edgeDoc?.curve !== undefined) {
154
+ edge.interpolate = edgeDoc.curve;
155
+ }
156
+ return;
157
+ }
158
+ let txt;
159
+ let vertex = this.vertices.get(id);
160
+ if (vertex === undefined) {
161
+ if (textObj === undefined && type === undefined && style !== undefined && style !== null) {
162
+ log.warn(`Style applied to unknown node "${id}". This may indicate a typo. The node will be created automatically.`);
163
+ }
164
+ vertex = {
165
+ id,
166
+ labelType: "text",
167
+ domId: MERMAID_DOM_ID_PREFIX + id + "-" + this.vertexCounter,
168
+ styles: [],
169
+ classes: []
170
+ };
171
+ this.vertices.set(id, vertex);
172
+ }
173
+ this.vertexCounter++;
174
+ if (textObj !== undefined) {
175
+ this.config = getConfig2();
176
+ txt = this.sanitizeText(textObj.text.trim());
177
+ vertex.labelType = textObj.type;
178
+ if (txt.startsWith('"') && txt.endsWith('"')) {
179
+ txt = txt.substring(1, txt.length - 1);
180
+ }
181
+ vertex.text = txt;
182
+ } else {
183
+ if (vertex.text === undefined) {
184
+ vertex.text = id;
185
+ }
186
+ }
187
+ if (type !== undefined) {
188
+ vertex.type = type;
189
+ }
190
+ if (style !== undefined && style !== null) {
191
+ style.forEach((s) => {
192
+ vertex.styles.push(s);
193
+ });
194
+ }
195
+ if (classes !== undefined && classes !== null) {
196
+ classes.forEach((s) => {
197
+ vertex.classes.push(s);
198
+ });
199
+ }
200
+ if (dir !== undefined) {
201
+ vertex.dir = dir;
202
+ }
203
+ if (vertex.props === undefined) {
204
+ vertex.props = props;
205
+ } else if (props !== undefined) {
206
+ Object.assign(vertex.props, props);
207
+ }
208
+ if (doc !== undefined) {
209
+ if (doc.shape) {
210
+ if (doc.shape !== doc.shape.toLowerCase() || doc.shape.includes("_")) {
211
+ throw new Error(`No such shape: ${doc.shape}. Shape names should be lowercase.`);
212
+ } else if (!isValidShape(doc.shape)) {
213
+ throw new Error(`No such shape: ${doc.shape}.`);
214
+ }
215
+ vertex.type = doc?.shape;
216
+ }
217
+ if (doc?.label) {
218
+ vertex.text = doc?.label;
219
+ vertex.labelType = this.sanitizeNodeLabelType(doc?.labelType);
220
+ }
221
+ if (doc?.icon) {
222
+ vertex.icon = doc?.icon;
223
+ if (!doc.label?.trim() && vertex.text === id) {
224
+ vertex.text = "";
225
+ }
226
+ }
227
+ if (doc?.form) {
228
+ vertex.form = doc?.form;
229
+ }
230
+ if (doc?.pos) {
231
+ vertex.pos = doc?.pos;
232
+ }
233
+ if (doc?.img) {
234
+ vertex.img = doc?.img;
235
+ if (!doc.label?.trim() && vertex.text === id) {
236
+ vertex.text = "";
237
+ }
238
+ }
239
+ if (doc?.constraint) {
240
+ vertex.constraint = doc.constraint;
241
+ }
242
+ if (doc.w) {
243
+ vertex.assetWidth = Number(doc.w);
244
+ }
245
+ if (doc.h) {
246
+ vertex.assetHeight = Number(doc.h);
247
+ }
248
+ }
249
+ }
250
+ addSingleLink(_start, _end, type, id) {
251
+ const start = _start;
252
+ const end = _end;
253
+ const edge = {
254
+ start,
255
+ end,
256
+ type: undefined,
257
+ text: "",
258
+ labelType: "text",
259
+ classes: [],
260
+ isUserDefinedId: false,
261
+ interpolate: this.edges.defaultInterpolate
262
+ };
263
+ log.info("abc78 Got edge...", edge);
264
+ const linkTextObj = type.text;
265
+ if (linkTextObj !== undefined) {
266
+ edge.text = this.sanitizeText(linkTextObj.text.trim());
267
+ if (edge.text.startsWith('"') && edge.text.endsWith('"')) {
268
+ edge.text = edge.text.substring(1, edge.text.length - 1);
269
+ }
270
+ edge.labelType = this.sanitizeNodeLabelType(linkTextObj.type);
271
+ }
272
+ if (type !== undefined) {
273
+ edge.type = type.type;
274
+ edge.stroke = type.stroke;
275
+ edge.length = type.length > 10 ? 10 : type.length;
276
+ }
277
+ if (id && !this.edges.some((e) => e.id === id)) {
278
+ edge.id = id;
279
+ edge.isUserDefinedId = true;
280
+ } else {
281
+ const existingLinks = this.edges.filter((e) => e.start === edge.start && e.end === edge.end);
282
+ if (existingLinks.length === 0) {
283
+ edge.id = getEdgeId(edge.start, edge.end, { counter: 0, prefix: "L" });
284
+ } else {
285
+ edge.id = getEdgeId(edge.start, edge.end, {
286
+ counter: existingLinks.length + 1,
287
+ prefix: "L"
288
+ });
289
+ }
290
+ }
291
+ if (this.edges.length < (this.config.maxEdges ?? 500)) {
292
+ log.info("Pushing edge...");
293
+ this.edges.push(edge);
294
+ } else {
295
+ throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.
296
+
297
+ Initialize mermaid with maxEdges set to a higher number to allow more edges.
298
+ You cannot set this config via configuration inside the diagram as it is a secure config.
299
+ You have to call mermaid.initialize.`);
300
+ }
301
+ }
302
+ isLinkData(value) {
303
+ return value !== null && typeof value === "object" && "id" in value && typeof value.id === "string";
304
+ }
305
+ addLink(_start, _end, linkData) {
306
+ const id = this.isLinkData(linkData) ? linkData.id.replace("@", "") : undefined;
307
+ log.info("addLink", _start, _end, id);
308
+ for (const start of _start) {
309
+ for (const end of _end) {
310
+ const isLastStart = start === _start[_start.length - 1];
311
+ const isFirstEnd = end === _end[0];
312
+ if (isLastStart && isFirstEnd) {
313
+ this.addSingleLink(start, end, linkData, id);
314
+ } else {
315
+ this.addSingleLink(start, end, linkData, undefined);
316
+ }
317
+ }
318
+ }
319
+ }
320
+ updateLinkInterpolate(positions, interpolate) {
321
+ positions.forEach((pos) => {
322
+ if (pos === "default") {
323
+ this.edges.defaultInterpolate = interpolate;
324
+ } else {
325
+ this.edges[pos].interpolate = interpolate;
326
+ }
327
+ });
328
+ }
329
+ updateLink(positions, style) {
330
+ positions.forEach((pos) => {
331
+ if (typeof pos === "number" && pos >= this.edges.length) {
332
+ throw new Error(`The index ${pos} 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.)`);
333
+ }
334
+ if (pos === "default") {
335
+ this.edges.defaultStyle = style;
336
+ } else {
337
+ this.edges[pos].style = style;
338
+ if ((this.edges[pos]?.style?.length ?? 0) > 0 && !this.edges[pos]?.style?.some((s) => s?.startsWith("fill"))) {
339
+ this.edges[pos]?.style?.push("fill:none");
340
+ }
341
+ }
342
+ });
343
+ }
344
+ addClass(ids, _style) {
345
+ const style = _style.join().replace(/\\,/g, "§§§").replace(/,/g, ";").replace(/§§§/g, ",").split(";");
346
+ ids.split(",").forEach((id) => {
347
+ let classNode = this.classes.get(id);
348
+ if (classNode === undefined) {
349
+ classNode = { id, styles: [], textStyles: [] };
350
+ this.classes.set(id, classNode);
351
+ }
352
+ if (style !== undefined && style !== null) {
353
+ style.forEach((s) => {
354
+ if (/color/.exec(s)) {
355
+ const newStyle = s.replace("fill", "bgFill");
356
+ classNode.textStyles.push(newStyle);
357
+ }
358
+ classNode.styles.push(s);
359
+ });
360
+ }
361
+ });
362
+ }
363
+ setDirection(dir) {
364
+ this.direction = dir.trim();
365
+ if (/.*</.exec(this.direction)) {
366
+ this.direction = "RL";
367
+ }
368
+ if (/.*\^/.exec(this.direction)) {
369
+ this.direction = "BT";
370
+ }
371
+ if (/.*>/.exec(this.direction)) {
372
+ this.direction = "LR";
373
+ }
374
+ if (/.*v/.exec(this.direction)) {
375
+ this.direction = "TB";
376
+ }
377
+ if (this.direction === "TD") {
378
+ this.direction = "TB";
379
+ }
380
+ }
381
+ setClass(ids, className) {
382
+ for (const id of ids.split(",")) {
383
+ const vertex = this.vertices.get(id);
384
+ if (vertex) {
385
+ vertex.classes.push(className);
386
+ }
387
+ const edge = this.edges.find((e) => e.id === id);
388
+ if (edge) {
389
+ edge.classes.push(className);
390
+ }
391
+ const subGraph = this.subGraphLookup.get(id);
392
+ if (subGraph) {
393
+ subGraph.classes.push(className);
394
+ }
395
+ }
396
+ }
397
+ setTooltip(ids, tooltip) {
398
+ if (tooltip === undefined) {
399
+ return;
400
+ }
401
+ tooltip = this.sanitizeText(tooltip);
402
+ for (const id of ids.split(",")) {
403
+ this.tooltips.set(this.version === "gen-1" ? this.lookUpDomId(id) : id, tooltip);
404
+ }
405
+ }
406
+ setClickFun(id, functionName, functionArgs) {
407
+ if (getConfig2().securityLevel !== "loose") {
408
+ return;
409
+ }
410
+ if (functionName === undefined) {
411
+ return;
412
+ }
413
+ let argList = [];
414
+ if (typeof functionArgs === "string") {
415
+ argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
416
+ for (let i = 0;i < argList.length; i++) {
417
+ let item = argList[i].trim();
418
+ if (item.startsWith('"') && item.endsWith('"')) {
419
+ item = item.substr(1, item.length - 2);
420
+ }
421
+ argList[i] = item;
422
+ }
423
+ }
424
+ if (argList.length === 0) {
425
+ argList.push(id);
426
+ }
427
+ const vertex = this.vertices.get(id);
428
+ if (vertex) {
429
+ vertex.haveCallback = true;
430
+ this.funs.push(() => {
431
+ const domId = this.lookUpDomId(id);
432
+ const elem = document.querySelector(`[id="${domId}"]`);
433
+ if (elem !== null) {
434
+ elem.addEventListener("click", () => {
435
+ utils_default.runFunc(functionName, ...argList);
436
+ }, false);
437
+ }
438
+ });
439
+ }
440
+ }
441
+ setLink(ids, linkStr, target) {
442
+ ids.split(",").forEach((id) => {
443
+ const vertex = this.vertices.get(id);
444
+ if (vertex !== undefined) {
445
+ vertex.link = utils_default.formatUrl(linkStr, this.config);
446
+ vertex.linkTarget = target;
447
+ }
448
+ });
449
+ this.setClass(ids, "clickable");
450
+ }
451
+ getTooltip(id) {
452
+ return this.tooltips.get(id);
453
+ }
454
+ setClickEvent(ids, functionName, functionArgs) {
455
+ ids.split(",").forEach((id) => {
456
+ this.setClickFun(id, functionName, functionArgs);
457
+ });
458
+ this.setClass(ids, "clickable");
459
+ }
460
+ bindFunctions(element) {
461
+ this.funs.forEach((fun) => {
462
+ fun(element);
463
+ });
464
+ }
465
+ getDirection() {
466
+ return this.direction?.trim();
467
+ }
468
+ getVertices() {
469
+ return this.vertices;
470
+ }
471
+ getEdges() {
472
+ return this.edges;
473
+ }
474
+ getClasses() {
475
+ return this.classes;
476
+ }
477
+ setupToolTips(element) {
478
+ const tooltipElem = createTooltip();
479
+ const svg = select_default(element).select("svg");
480
+ const nodes = svg.selectAll("g.node");
481
+ nodes.on("mouseover", (e) => {
482
+ const el = select_default(e.currentTarget);
483
+ const title = el.attr("title");
484
+ if (title === null) {
485
+ return;
486
+ }
487
+ const rect = e.currentTarget?.getBoundingClientRect();
488
+ tooltipElem.transition().duration(200).style("opacity", ".9");
489
+ tooltipElem.text(el.attr("title")).style("left", window.scrollX + rect.left + (rect.right - rect.left) / 2 + "px").style("top", window.scrollY + rect.bottom + "px");
490
+ tooltipElem.html(dompurify_shim_default.sanitize(title));
491
+ el.classed("hover", true);
492
+ }).on("mouseout", (e) => {
493
+ tooltipElem.transition().duration(500).style("opacity", 0);
494
+ const el = select_default(e.currentTarget);
495
+ el.classed("hover", false);
496
+ });
497
+ }
498
+ clear(ver = "gen-2") {
499
+ this.vertices = /* @__PURE__ */ new Map;
500
+ this.classes = /* @__PURE__ */ new Map;
501
+ this.edges = [];
502
+ this.funs = [this.setupToolTips.bind(this)];
503
+ this.diagramId = "";
504
+ this.subGraphs = [];
505
+ this.subGraphLookup = /* @__PURE__ */ new Map;
506
+ this.subCount = 0;
507
+ this.tooltips = /* @__PURE__ */ new Map;
508
+ this.firstGraphFlag = true;
509
+ this.version = ver;
510
+ this.config = getConfig2();
511
+ clear();
512
+ }
513
+ setGen(ver) {
514
+ this.version = ver || "gen-2";
515
+ }
516
+ defaultStyle() {
517
+ return "fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;";
518
+ }
519
+ addSubGraph(_id, list, _title) {
520
+ let id = _id.text.trim();
521
+ let title = _title.text;
522
+ if (_id === _title && /\s/.exec(_title.text)) {
523
+ id = undefined;
524
+ }
525
+ const uniq = /* @__PURE__ */ __name((a) => {
526
+ const prims = { boolean: {}, number: {}, string: {} };
527
+ const objs = [];
528
+ let dir2;
529
+ const nodeList2 = a.filter(function(item) {
530
+ const type = typeof item;
531
+ if (item.stmt && item.stmt === "dir") {
532
+ dir2 = item.value;
533
+ return false;
534
+ }
535
+ if (item.trim() === "") {
536
+ return false;
537
+ }
538
+ if (type in prims) {
539
+ return prims[type].hasOwnProperty(item) ? false : prims[type][item] = true;
540
+ } else {
541
+ return objs.includes(item) ? false : objs.push(item);
542
+ }
543
+ });
544
+ return { nodeList: nodeList2, dir: dir2 };
545
+ }, "uniq");
546
+ const result = uniq(list.flat());
547
+ const nodeList = result.nodeList;
548
+ const rawDir = result.dir;
549
+ const hasExplicitDir = rawDir !== undefined;
550
+ const flowchartConfig = getConfig2().flowchart ?? {};
551
+ const dir = rawDir ?? (flowchartConfig.inheritDir ? this.getDirection() ?? getConfig2().direction ?? undefined : undefined);
552
+ if (this.version === "gen-1") {
553
+ for (let i = 0;i < nodeList.length; i++) {
554
+ nodeList[i] = this.lookUpDomId(nodeList[i]);
555
+ }
556
+ }
557
+ id = id ?? "subGraph" + this.subCount;
558
+ title = title || "";
559
+ title = this.sanitizeText(title);
560
+ this.subCount = this.subCount + 1;
561
+ const subGraph = {
562
+ id,
563
+ nodes: nodeList,
564
+ title: title.trim(),
565
+ classes: [],
566
+ dir,
567
+ hasExplicitDir,
568
+ labelType: this.sanitizeNodeLabelType(_title?.type)
569
+ };
570
+ log.info("Adding", subGraph.id, subGraph.nodes, subGraph.dir);
571
+ subGraph.nodes = this.makeUniq(subGraph, this.subGraphs).nodes;
572
+ this.subGraphs.push(subGraph);
573
+ this.subGraphLookup.set(id, subGraph);
574
+ return id;
575
+ }
576
+ getPosForId(id) {
577
+ for (const [i, subGraph] of this.subGraphs.entries()) {
578
+ if (subGraph.id === id) {
579
+ return i;
580
+ }
581
+ }
582
+ return -1;
583
+ }
584
+ indexNodes2(id, pos) {
585
+ const nodes = this.subGraphs[pos].nodes;
586
+ this.secCount = this.secCount + 1;
587
+ if (this.secCount > 2000) {
588
+ return {
589
+ result: false,
590
+ count: 0
591
+ };
592
+ }
593
+ this.posCrossRef[this.secCount] = pos;
594
+ if (this.subGraphs[pos].id === id) {
595
+ return {
596
+ result: true,
597
+ count: 0
598
+ };
599
+ }
600
+ let count = 0;
601
+ let posCount = 1;
602
+ while (count < nodes.length) {
603
+ const childPos = this.getPosForId(nodes[count]);
604
+ if (childPos >= 0) {
605
+ const res = this.indexNodes2(id, childPos);
606
+ if (res.result) {
607
+ return {
608
+ result: true,
609
+ count: posCount + res.count
610
+ };
611
+ } else {
612
+ posCount = posCount + res.count;
613
+ }
614
+ }
615
+ count = count + 1;
616
+ }
617
+ return {
618
+ result: false,
619
+ count: posCount
620
+ };
621
+ }
622
+ getDepthFirstPos(pos) {
623
+ return this.posCrossRef[pos];
624
+ }
625
+ indexNodes() {
626
+ this.secCount = -1;
627
+ if (this.subGraphs.length > 0) {
628
+ this.indexNodes2("none", this.subGraphs.length - 1);
629
+ }
630
+ }
631
+ getSubGraphs() {
632
+ return this.subGraphs;
633
+ }
634
+ firstGraph() {
635
+ if (this.firstGraphFlag) {
636
+ this.firstGraphFlag = false;
637
+ return true;
638
+ }
639
+ return false;
640
+ }
641
+ destructStartLink(_str) {
642
+ let str = _str.trim();
643
+ let type = "arrow_open";
644
+ switch (str[0]) {
645
+ case "<":
646
+ type = "arrow_point";
647
+ str = str.slice(1);
648
+ break;
649
+ case "x":
650
+ type = "arrow_cross";
651
+ str = str.slice(1);
652
+ break;
653
+ case "o":
654
+ type = "arrow_circle";
655
+ str = str.slice(1);
656
+ break;
657
+ }
658
+ let stroke = "normal";
659
+ if (str.includes("=")) {
660
+ stroke = "thick";
661
+ }
662
+ if (str.includes(".")) {
663
+ stroke = "dotted";
664
+ }
665
+ return { type, stroke };
666
+ }
667
+ countChar(char, str) {
668
+ const length = str.length;
669
+ let count = 0;
670
+ for (let i = 0;i < length; ++i) {
671
+ if (str[i] === char) {
672
+ ++count;
673
+ }
674
+ }
675
+ return count;
676
+ }
677
+ destructEndLink(_str) {
678
+ const str = _str.trim();
679
+ let line = str.slice(0, -1);
680
+ let type = "arrow_open";
681
+ switch (str.slice(-1)) {
682
+ case "x":
683
+ type = "arrow_cross";
684
+ if (str.startsWith("x")) {
685
+ type = "double_" + type;
686
+ line = line.slice(1);
687
+ }
688
+ break;
689
+ case ">":
690
+ type = "arrow_point";
691
+ if (str.startsWith("<")) {
692
+ type = "double_" + type;
693
+ line = line.slice(1);
694
+ }
695
+ break;
696
+ case "o":
697
+ type = "arrow_circle";
698
+ if (str.startsWith("o")) {
699
+ type = "double_" + type;
700
+ line = line.slice(1);
701
+ }
702
+ break;
703
+ }
704
+ let stroke = "normal";
705
+ let length = line.length - 1;
706
+ if (line.startsWith("=")) {
707
+ stroke = "thick";
708
+ }
709
+ if (line.startsWith("~")) {
710
+ stroke = "invisible";
711
+ }
712
+ const dots = this.countChar(".", line);
713
+ if (dots) {
714
+ stroke = "dotted";
715
+ length = dots;
716
+ }
717
+ return { type, stroke, length };
718
+ }
719
+ destructLink(_str, _startStr) {
720
+ const info = this.destructEndLink(_str);
721
+ let startInfo;
722
+ if (_startStr) {
723
+ startInfo = this.destructStartLink(_startStr);
724
+ if (startInfo.stroke !== info.stroke) {
725
+ return { type: "INVALID", stroke: "INVALID" };
726
+ }
727
+ if (startInfo.type === "arrow_open") {
728
+ startInfo.type = info.type;
729
+ } else {
730
+ if (startInfo.type !== info.type) {
731
+ return { type: "INVALID", stroke: "INVALID" };
732
+ }
733
+ startInfo.type = "double_" + startInfo.type;
734
+ }
735
+ if (startInfo.type === "double_arrow") {
736
+ startInfo.type = "double_arrow_point";
737
+ }
738
+ startInfo.length = info.length;
739
+ return startInfo;
740
+ }
741
+ return info;
742
+ }
743
+ exists(allSgs, _id) {
744
+ for (const sg of allSgs) {
745
+ if (sg.nodes.includes(_id)) {
746
+ return true;
747
+ }
748
+ }
749
+ return false;
750
+ }
751
+ makeUniq(sg, allSubgraphs) {
752
+ const res = [];
753
+ sg.nodes.forEach((_id, pos) => {
754
+ if (!this.exists(allSubgraphs, _id)) {
755
+ res.push(sg.nodes[pos]);
756
+ }
757
+ });
758
+ return { nodes: res };
759
+ }
760
+ getTypeFromVertex(vertex) {
761
+ if (vertex.img) {
762
+ return "imageSquare";
763
+ }
764
+ if (vertex.icon) {
765
+ if (vertex.form === "circle") {
766
+ return "iconCircle";
767
+ }
768
+ if (vertex.form === "square") {
769
+ return "iconSquare";
770
+ }
771
+ if (vertex.form === "rounded") {
772
+ return "iconRounded";
773
+ }
774
+ return "icon";
775
+ }
776
+ switch (vertex.type) {
777
+ case "square":
778
+ case undefined:
779
+ return "squareRect";
780
+ case "round":
781
+ return "roundedRect";
782
+ case "ellipse":
783
+ return "ellipse";
784
+ default:
785
+ return vertex.type;
786
+ }
787
+ }
788
+ findNode(nodes, id) {
789
+ return nodes.find((node) => node.id === id);
790
+ }
791
+ destructEdgeType(type) {
792
+ let arrowTypeStart = "none";
793
+ let arrowTypeEnd = "arrow_point";
794
+ switch (type) {
795
+ case "arrow_point":
796
+ case "arrow_circle":
797
+ case "arrow_cross":
798
+ arrowTypeEnd = type;
799
+ break;
800
+ case "double_arrow_point":
801
+ case "double_arrow_circle":
802
+ case "double_arrow_cross":
803
+ arrowTypeStart = type.replace("double_", "");
804
+ arrowTypeEnd = arrowTypeStart;
805
+ break;
806
+ }
807
+ return { arrowTypeStart, arrowTypeEnd };
808
+ }
809
+ addNodeFromVertex(vertex, nodes, parentDB, subGraphDB, config, look) {
810
+ const parentId = parentDB.get(vertex.id);
811
+ const isGroup = subGraphDB.get(vertex.id) ?? false;
812
+ const node = this.findNode(nodes, vertex.id);
813
+ if (node) {
814
+ node.cssStyles = vertex.styles;
815
+ node.cssCompiledStyles = this.getCompiledStyles(vertex.classes);
816
+ node.cssClasses = vertex.classes.join(" ");
817
+ } else {
818
+ const baseNode = {
819
+ id: vertex.id,
820
+ label: vertex.text,
821
+ labelType: vertex.labelType,
822
+ labelStyle: "",
823
+ parentId,
824
+ padding: config.flowchart?.padding || 8,
825
+ cssStyles: vertex.styles,
826
+ cssCompiledStyles: this.getCompiledStyles(["default", "node", ...vertex.classes]),
827
+ cssClasses: "default " + vertex.classes.join(" "),
828
+ dir: vertex.dir,
829
+ domId: vertex.domId,
830
+ look,
831
+ link: vertex.link,
832
+ linkTarget: vertex.linkTarget,
833
+ tooltip: this.getTooltip(vertex.id),
834
+ icon: vertex.icon,
835
+ pos: vertex.pos,
836
+ img: vertex.img,
837
+ assetWidth: vertex.assetWidth,
838
+ assetHeight: vertex.assetHeight,
839
+ constraint: vertex.constraint
840
+ };
841
+ if (isGroup) {
842
+ nodes.push({
843
+ ...baseNode,
844
+ isGroup: true,
845
+ shape: "rect"
846
+ });
847
+ } else {
848
+ nodes.push({
849
+ ...baseNode,
850
+ isGroup: false,
851
+ shape: this.getTypeFromVertex(vertex)
852
+ });
853
+ }
854
+ }
855
+ }
856
+ getCompiledStyles(classDefs) {
857
+ let compiledStyles = [];
858
+ for (const customClass of classDefs) {
859
+ const cssClass = this.classes.get(customClass);
860
+ if (cssClass?.styles) {
861
+ compiledStyles = [...compiledStyles, ...cssClass.styles ?? []].map((s) => s.trim());
862
+ }
863
+ if (cssClass?.textStyles) {
864
+ compiledStyles = [...compiledStyles, ...cssClass.textStyles ?? []].map((s) => s.trim());
865
+ }
866
+ }
867
+ return compiledStyles;
868
+ }
869
+ getData() {
870
+ const config = getConfig2();
871
+ const nodes = [];
872
+ const edges = [];
873
+ const subGraphs = this.getSubGraphs();
874
+ const parentDB = /* @__PURE__ */ new Map;
875
+ const subGraphDB = /* @__PURE__ */ new Map;
876
+ for (let i = subGraphs.length - 1;i >= 0; i--) {
877
+ const subGraph = subGraphs[i];
878
+ if (subGraph.nodes.length > 0) {
879
+ subGraphDB.set(subGraph.id, true);
880
+ }
881
+ for (const id of subGraph.nodes) {
882
+ parentDB.set(id, subGraph.id);
883
+ }
884
+ }
885
+ for (let i = subGraphs.length - 1;i >= 0; i--) {
886
+ const subGraph = subGraphs[i];
887
+ nodes.push({
888
+ id: subGraph.id,
889
+ label: subGraph.title,
890
+ labelStyle: "",
891
+ labelType: subGraph.labelType,
892
+ parentId: parentDB.get(subGraph.id),
893
+ padding: 8,
894
+ cssCompiledStyles: this.getCompiledStyles(subGraph.classes),
895
+ cssClasses: subGraph.classes.join(" "),
896
+ shape: "rect",
897
+ dir: subGraph.dir === "TD" ? "TB" : subGraph.dir,
898
+ explicitDir: subGraph.hasExplicitDir,
899
+ isGroup: true,
900
+ look: config.look
901
+ });
902
+ }
903
+ const n = this.getVertices();
904
+ n.forEach((vertex) => {
905
+ this.addNodeFromVertex(vertex, nodes, parentDB, subGraphDB, config, config.look || "classic");
906
+ });
907
+ const e = this.getEdges();
908
+ e.forEach((rawEdge, index) => {
909
+ const { arrowTypeStart, arrowTypeEnd } = this.destructEdgeType(rawEdge.type);
910
+ const styles = [...e.defaultStyle ?? []];
911
+ if (rawEdge.style) {
912
+ styles.push(...rawEdge.style);
913
+ }
914
+ const edge = {
915
+ id: getEdgeId(rawEdge.start, rawEdge.end, { counter: index, prefix: "L" }, rawEdge.id),
916
+ isUserDefinedId: rawEdge.isUserDefinedId,
917
+ start: rawEdge.start,
918
+ end: rawEdge.end,
919
+ type: rawEdge.type ?? "normal",
920
+ label: rawEdge.text,
921
+ labelType: rawEdge.labelType,
922
+ labelpos: "c",
923
+ thickness: rawEdge.stroke,
924
+ minlen: rawEdge.length,
925
+ classes: rawEdge?.stroke === "invisible" ? "" : "edge-thickness-normal edge-pattern-solid flowchart-link",
926
+ arrowTypeStart: rawEdge?.stroke === "invisible" || rawEdge?.type === "arrow_open" ? "none" : arrowTypeStart,
927
+ arrowTypeEnd: rawEdge?.stroke === "invisible" || rawEdge?.type === "arrow_open" ? "none" : arrowTypeEnd,
928
+ arrowheadStyle: "fill: #333",
929
+ cssCompiledStyles: this.getCompiledStyles(rawEdge.classes),
930
+ labelStyle: styles,
931
+ style: styles,
932
+ pattern: rawEdge.stroke,
933
+ look: config.look,
934
+ animate: rawEdge.animate,
935
+ animation: rawEdge.animation,
936
+ curve: rawEdge.interpolate || this.edges.defaultInterpolate || config.flowchart?.curve
937
+ };
938
+ edges.push(edge);
939
+ });
940
+ return { nodes, edges, other: {}, config };
941
+ }
942
+ defaultConfig() {
943
+ return defaultConfig2.flowchart;
944
+ }
945
+ };
946
+ var getClasses = /* @__PURE__ */ __name(function(text, diagramObj) {
947
+ return diagramObj.db.getClasses();
948
+ }, "getClasses");
949
+ var draw = /* @__PURE__ */ __name(async function(text, id, _version, diag, positions) {
950
+ log.info("REF0:");
951
+ log.info("Drawing state diagram (v2)", id);
952
+ const { securityLevel, flowchart: conf, layout } = getConfig2();
953
+ diag.db.setDiagramId(id);
954
+ log.debug("Before getData: ");
955
+ const data4Layout = diag.db.getData();
956
+ log.debug("Data: ", data4Layout);
957
+ const svg = getDiagramElement(id, securityLevel);
958
+ const direction = diag.db.getDirection();
959
+ data4Layout.type = diag.type;
960
+ data4Layout.layoutAlgorithm = getRegisteredLayoutAlgorithm(layout);
961
+ if (data4Layout.layoutAlgorithm === "dagre" && layout === "elk") {
962
+ log.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback.");
963
+ }
964
+ data4Layout.direction = direction;
965
+ data4Layout.nodeSpacing = conf?.nodeSpacing || 50;
966
+ data4Layout.rankSpacing = conf?.rankSpacing || 50;
967
+ data4Layout.markers = ["point", "circle", "cross"];
968
+ data4Layout.diagramId = id;
969
+ log.debug("REF1:", data4Layout);
970
+ await render(data4Layout, svg, positions);
971
+ const padding = data4Layout.config.flowchart?.diagramPadding ?? 8;
972
+ utils_default.insertTitle(svg, "flowchartTitleText", conf?.titleTopMargin || 0, diag.db.getDiagramTitle());
973
+ setupViewPortForSVG(svg, padding, "flowchart", conf?.useMaxWidth || false);
974
+ }, "draw");
975
+ var flowRenderer_v3_unified_default = {
976
+ getClasses,
977
+ draw
978
+ };
979
+ var parser = function() {
980
+ var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
981
+ for (o2 = o2 || {}, l = k.length;l--; o2[k[l]] = v)
982
+ ;
983
+ return o2;
984
+ }, "o"), $V0 = [1, 4], $V1 = [1, 3], $V2 = [1, 5], $V3 = [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], $V4 = [2, 2], $V5 = [1, 13], $V6 = [1, 14], $V7 = [1, 15], $V8 = [1, 16], $V9 = [1, 23], $Va = [1, 25], $Vb = [1, 26], $Vc = [1, 27], $Vd = [1, 50], $Ve = [1, 49], $Vf = [1, 29], $Vg = [1, 30], $Vh = [1, 31], $Vi = [1, 32], $Vj = [1, 33], $Vk = [1, 45], $Vl = [1, 47], $Vm = [1, 43], $Vn = [1, 48], $Vo = [1, 44], $Vp = [1, 51], $Vq = [1, 46], $Vr = [1, 52], $Vs = [1, 53], $Vt = [1, 34], $Vu = [1, 35], $Vv = [1, 36], $Vw = [1, 37], $Vx = [1, 38], $Vy = [1, 58], $Vz = [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], $VA = [1, 62], $VB = [1, 61], $VC = [1, 63], $VD = [8, 9, 11, 75, 77, 78], $VE = [1, 79], $VF = [1, 92], $VG = [1, 97], $VH = [1, 96], $VI = [1, 93], $VJ = [1, 89], $VK = [1, 95], $VL = [1, 91], $VM = [1, 98], $VN = [1, 94], $VO = [1, 99], $VP = [1, 90], $VQ = [8, 9, 10, 11, 40, 75, 77, 78], $VR = [8, 9, 10, 11, 40, 46, 75, 77, 78], $VS = [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], $VU = [44, 60, 89, 102, 105, 106, 109, 111, 114, 115, 116], $VV = [1, 122], $VW = [1, 123], $VX = [1, 125], $VY = [1, 124], $VZ = [44, 60, 62, 74, 89, 102, 105, 106, 109, 111, 114, 115, 116], $V_ = [1, 134], $V$ = [1, 148], $V01 = [1, 149], $V11 = [1, 150], $V21 = [1, 151], $V31 = [1, 136], $V41 = [1, 138], $V51 = [1, 142], $V61 = [1, 143], $V71 = [1, 144], $V81 = [1, 145], $V91 = [1, 146], $Va1 = [1, 147], $Vb1 = [1, 152], $Vc1 = [1, 153], $Vd1 = [1, 132], $Ve1 = [1, 133], $Vf1 = [1, 140], $Vg1 = [1, 135], $Vh1 = [1, 139], $Vi1 = [1, 137], $Vj1 = [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], $Vk1 = [1, 155], $Vl1 = [1, 157], $Vm1 = [8, 9, 11], $Vn1 = [8, 9, 10, 11, 14, 44, 60, 89, 105, 106, 109, 111, 114, 115, 116], $Vo1 = [1, 177], $Vp1 = [1, 173], $Vq1 = [1, 174], $Vr1 = [1, 178], $Vs1 = [1, 175], $Vt1 = [1, 176], $Vu1 = [77, 116, 119], $Vv1 = [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], $Vw1 = [10, 106], $Vx1 = [31, 49, 51, 53, 55, 57, 62, 64, 66, 67, 69, 71, 116, 117, 118], $Vy1 = [1, 248], $Vz1 = [1, 246], $VA1 = [1, 250], $VB1 = [1, 244], $VC1 = [1, 245], $VD1 = [1, 247], $VE1 = [1, 249], $VF1 = [1, 251], $VG1 = [1, 269], $VH1 = [8, 9, 11, 106], $VI1 = [8, 9, 10, 11, 60, 84, 105, 106, 109, 110, 111, 112];
985
+ var parser2 = {
986
+ trace: /* @__PURE__ */ __name(function trace() {}, "trace"),
987
+ yy: {},
988
+ 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 },
989
+ 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" },
990
+ 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]],
991
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
992
+ var $0 = $$.length - 1;
993
+ switch (yystate) {
994
+ case 2:
995
+ this.$ = [];
996
+ break;
997
+ case 3:
998
+ if (!Array.isArray($$[$0]) || $$[$0].length > 0) {
999
+ $$[$0 - 1].push($$[$0]);
1000
+ }
1001
+ this.$ = $$[$0 - 1];
1002
+ break;
1003
+ case 4:
1004
+ case 183:
1005
+ this.$ = $$[$0];
1006
+ break;
1007
+ case 11:
1008
+ yy.setDirection("TB");
1009
+ this.$ = "TB";
1010
+ break;
1011
+ case 12:
1012
+ yy.setDirection($$[$0 - 1]);
1013
+ this.$ = $$[$0 - 1];
1014
+ break;
1015
+ case 27:
1016
+ this.$ = $$[$0 - 1].nodes;
1017
+ break;
1018
+ case 28:
1019
+ case 29:
1020
+ case 30:
1021
+ case 31:
1022
+ case 32:
1023
+ this.$ = [];
1024
+ break;
1025
+ case 33:
1026
+ this.$ = yy.addSubGraph($$[$0 - 6], $$[$0 - 1], $$[$0 - 4]);
1027
+ break;
1028
+ case 34:
1029
+ this.$ = yy.addSubGraph($$[$0 - 3], $$[$0 - 1], $$[$0 - 3]);
1030
+ break;
1031
+ case 35:
1032
+ this.$ = yy.addSubGraph(undefined, $$[$0 - 1], undefined);
1033
+ break;
1034
+ case 37:
1035
+ this.$ = $$[$0].trim();
1036
+ yy.setAccTitle(this.$);
1037
+ break;
1038
+ case 38:
1039
+ case 39:
1040
+ this.$ = $$[$0].trim();
1041
+ yy.setAccDescription(this.$);
1042
+ break;
1043
+ case 43:
1044
+ this.$ = $$[$0 - 1] + $$[$0];
1045
+ break;
1046
+ case 44:
1047
+ this.$ = $$[$0];
1048
+ break;
1049
+ case 45:
1050
+ yy.addVertex($$[$0 - 1][$$[$0 - 1].length - 1], undefined, undefined, undefined, undefined, undefined, undefined, $$[$0]);
1051
+ yy.addLink($$[$0 - 3].stmt, $$[$0 - 1], $$[$0 - 2]);
1052
+ this.$ = { stmt: $$[$0 - 1], nodes: $$[$0 - 1].concat($$[$0 - 3].nodes) };
1053
+ break;
1054
+ case 46:
1055
+ yy.addLink($$[$0 - 2].stmt, $$[$0], $$[$0 - 1]);
1056
+ this.$ = { stmt: $$[$0], nodes: $$[$0].concat($$[$0 - 2].nodes) };
1057
+ break;
1058
+ case 47:
1059
+ yy.addLink($$[$0 - 3].stmt, $$[$0 - 1], $$[$0 - 2]);
1060
+ this.$ = { stmt: $$[$0 - 1], nodes: $$[$0 - 1].concat($$[$0 - 3].nodes) };
1061
+ break;
1062
+ case 48:
1063
+ this.$ = { stmt: $$[$0 - 1], nodes: $$[$0 - 1] };
1064
+ break;
1065
+ case 49:
1066
+ yy.addVertex($$[$0 - 1][$$[$0 - 1].length - 1], undefined, undefined, undefined, undefined, undefined, undefined, $$[$0]);
1067
+ this.$ = { stmt: $$[$0 - 1], nodes: $$[$0 - 1], shapeData: $$[$0] };
1068
+ break;
1069
+ case 50:
1070
+ this.$ = { stmt: $$[$0], nodes: $$[$0] };
1071
+ break;
1072
+ case 51:
1073
+ this.$ = [$$[$0]];
1074
+ break;
1075
+ case 52:
1076
+ yy.addVertex($$[$0 - 5][$$[$0 - 5].length - 1], undefined, undefined, undefined, undefined, undefined, undefined, $$[$0 - 4]);
1077
+ this.$ = $$[$0 - 5].concat($$[$0]);
1078
+ break;
1079
+ case 53:
1080
+ this.$ = $$[$0 - 4].concat($$[$0]);
1081
+ break;
1082
+ case 54:
1083
+ this.$ = $$[$0];
1084
+ break;
1085
+ case 55:
1086
+ this.$ = $$[$0 - 2];
1087
+ yy.setClass($$[$0 - 2], $$[$0]);
1088
+ break;
1089
+ case 56:
1090
+ this.$ = $$[$0 - 3];
1091
+ yy.addVertex($$[$0 - 3], $$[$0 - 1], "square");
1092
+ break;
1093
+ case 57:
1094
+ this.$ = $$[$0 - 3];
1095
+ yy.addVertex($$[$0 - 3], $$[$0 - 1], "doublecircle");
1096
+ break;
1097
+ case 58:
1098
+ this.$ = $$[$0 - 5];
1099
+ yy.addVertex($$[$0 - 5], $$[$0 - 2], "circle");
1100
+ break;
1101
+ case 59:
1102
+ this.$ = $$[$0 - 3];
1103
+ yy.addVertex($$[$0 - 3], $$[$0 - 1], "ellipse");
1104
+ break;
1105
+ case 60:
1106
+ this.$ = $$[$0 - 3];
1107
+ yy.addVertex($$[$0 - 3], $$[$0 - 1], "stadium");
1108
+ break;
1109
+ case 61:
1110
+ this.$ = $$[$0 - 3];
1111
+ yy.addVertex($$[$0 - 3], $$[$0 - 1], "subroutine");
1112
+ break;
1113
+ case 62:
1114
+ this.$ = $$[$0 - 7];
1115
+ yy.addVertex($$[$0 - 7], $$[$0 - 1], "rect", undefined, undefined, undefined, Object.fromEntries([[$$[$0 - 5], $$[$0 - 3]]]));
1116
+ break;
1117
+ case 63:
1118
+ this.$ = $$[$0 - 3];
1119
+ yy.addVertex($$[$0 - 3], $$[$0 - 1], "cylinder");
1120
+ break;
1121
+ case 64:
1122
+ this.$ = $$[$0 - 3];
1123
+ yy.addVertex($$[$0 - 3], $$[$0 - 1], "round");
1124
+ break;
1125
+ case 65:
1126
+ this.$ = $$[$0 - 3];
1127
+ yy.addVertex($$[$0 - 3], $$[$0 - 1], "diamond");
1128
+ break;
1129
+ case 66:
1130
+ this.$ = $$[$0 - 5];
1131
+ yy.addVertex($$[$0 - 5], $$[$0 - 2], "hexagon");
1132
+ break;
1133
+ case 67:
1134
+ this.$ = $$[$0 - 3];
1135
+ yy.addVertex($$[$0 - 3], $$[$0 - 1], "odd");
1136
+ break;
1137
+ case 68:
1138
+ this.$ = $$[$0 - 3];
1139
+ yy.addVertex($$[$0 - 3], $$[$0 - 1], "trapezoid");
1140
+ break;
1141
+ case 69:
1142
+ this.$ = $$[$0 - 3];
1143
+ yy.addVertex($$[$0 - 3], $$[$0 - 1], "inv_trapezoid");
1144
+ break;
1145
+ case 70:
1146
+ this.$ = $$[$0 - 3];
1147
+ yy.addVertex($$[$0 - 3], $$[$0 - 1], "lean_right");
1148
+ break;
1149
+ case 71:
1150
+ this.$ = $$[$0 - 3];
1151
+ yy.addVertex($$[$0 - 3], $$[$0 - 1], "lean_left");
1152
+ break;
1153
+ case 72:
1154
+ this.$ = $$[$0];
1155
+ yy.addVertex($$[$0]);
1156
+ break;
1157
+ case 73:
1158
+ $$[$0 - 1].text = $$[$0];
1159
+ this.$ = $$[$0 - 1];
1160
+ break;
1161
+ case 74:
1162
+ case 75:
1163
+ $$[$0 - 2].text = $$[$0 - 1];
1164
+ this.$ = $$[$0 - 2];
1165
+ break;
1166
+ case 76:
1167
+ this.$ = $$[$0];
1168
+ break;
1169
+ case 77:
1170
+ var inf = yy.destructLink($$[$0], $$[$0 - 2]);
1171
+ this.$ = { type: inf.type, stroke: inf.stroke, length: inf.length, text: $$[$0 - 1] };
1172
+ break;
1173
+ case 78:
1174
+ var inf = yy.destructLink($$[$0], $$[$0 - 2]);
1175
+ this.$ = { type: inf.type, stroke: inf.stroke, length: inf.length, text: $$[$0 - 1], id: $$[$0 - 3] };
1176
+ break;
1177
+ case 79:
1178
+ this.$ = { text: $$[$0], type: "text" };
1179
+ break;
1180
+ case 80:
1181
+ this.$ = { text: $$[$0 - 1].text + "" + $$[$0], type: $$[$0 - 1].type };
1182
+ break;
1183
+ case 81:
1184
+ this.$ = { text: $$[$0], type: "string" };
1185
+ break;
1186
+ case 82:
1187
+ this.$ = { text: $$[$0], type: "markdown" };
1188
+ break;
1189
+ case 83:
1190
+ var inf = yy.destructLink($$[$0]);
1191
+ this.$ = { type: inf.type, stroke: inf.stroke, length: inf.length };
1192
+ break;
1193
+ case 84:
1194
+ var inf = yy.destructLink($$[$0]);
1195
+ this.$ = { type: inf.type, stroke: inf.stroke, length: inf.length, id: $$[$0 - 1] };
1196
+ break;
1197
+ case 85:
1198
+ this.$ = $$[$0 - 1];
1199
+ break;
1200
+ case 86:
1201
+ this.$ = { text: $$[$0], type: "text" };
1202
+ break;
1203
+ case 87:
1204
+ this.$ = { text: $$[$0 - 1].text + "" + $$[$0], type: $$[$0 - 1].type };
1205
+ break;
1206
+ case 88:
1207
+ this.$ = { text: $$[$0], type: "string" };
1208
+ break;
1209
+ case 89:
1210
+ case 104:
1211
+ this.$ = { text: $$[$0], type: "markdown" };
1212
+ break;
1213
+ case 101:
1214
+ this.$ = { text: $$[$0], type: "text" };
1215
+ break;
1216
+ case 102:
1217
+ this.$ = { text: $$[$0 - 1].text + "" + $$[$0], type: $$[$0 - 1].type };
1218
+ break;
1219
+ case 103:
1220
+ this.$ = { text: $$[$0], type: "text" };
1221
+ break;
1222
+ case 105:
1223
+ this.$ = $$[$0 - 4];
1224
+ yy.addClass($$[$0 - 2], $$[$0]);
1225
+ break;
1226
+ case 106:
1227
+ this.$ = $$[$0 - 4];
1228
+ yy.setClass($$[$0 - 2], $$[$0]);
1229
+ break;
1230
+ case 107:
1231
+ case 115:
1232
+ this.$ = $$[$0 - 1];
1233
+ yy.setClickEvent($$[$0 - 1], $$[$0]);
1234
+ break;
1235
+ case 108:
1236
+ case 116:
1237
+ this.$ = $$[$0 - 3];
1238
+ yy.setClickEvent($$[$0 - 3], $$[$0 - 2]);
1239
+ yy.setTooltip($$[$0 - 3], $$[$0]);
1240
+ break;
1241
+ case 109:
1242
+ this.$ = $$[$0 - 2];
1243
+ yy.setClickEvent($$[$0 - 2], $$[$0 - 1], $$[$0]);
1244
+ break;
1245
+ case 110:
1246
+ this.$ = $$[$0 - 4];
1247
+ yy.setClickEvent($$[$0 - 4], $$[$0 - 3], $$[$0 - 2]);
1248
+ yy.setTooltip($$[$0 - 4], $$[$0]);
1249
+ break;
1250
+ case 111:
1251
+ this.$ = $$[$0 - 2];
1252
+ yy.setLink($$[$0 - 2], $$[$0]);
1253
+ break;
1254
+ case 112:
1255
+ this.$ = $$[$0 - 4];
1256
+ yy.setLink($$[$0 - 4], $$[$0 - 2]);
1257
+ yy.setTooltip($$[$0 - 4], $$[$0]);
1258
+ break;
1259
+ case 113:
1260
+ this.$ = $$[$0 - 4];
1261
+ yy.setLink($$[$0 - 4], $$[$0 - 2], $$[$0]);
1262
+ break;
1263
+ case 114:
1264
+ this.$ = $$[$0 - 6];
1265
+ yy.setLink($$[$0 - 6], $$[$0 - 4], $$[$0]);
1266
+ yy.setTooltip($$[$0 - 6], $$[$0 - 2]);
1267
+ break;
1268
+ case 117:
1269
+ this.$ = $$[$0 - 1];
1270
+ yy.setLink($$[$0 - 1], $$[$0]);
1271
+ break;
1272
+ case 118:
1273
+ this.$ = $$[$0 - 3];
1274
+ yy.setLink($$[$0 - 3], $$[$0 - 2]);
1275
+ yy.setTooltip($$[$0 - 3], $$[$0]);
1276
+ break;
1277
+ case 119:
1278
+ this.$ = $$[$0 - 3];
1279
+ yy.setLink($$[$0 - 3], $$[$0 - 2], $$[$0]);
1280
+ break;
1281
+ case 120:
1282
+ this.$ = $$[$0 - 5];
1283
+ yy.setLink($$[$0 - 5], $$[$0 - 4], $$[$0]);
1284
+ yy.setTooltip($$[$0 - 5], $$[$0 - 2]);
1285
+ break;
1286
+ case 121:
1287
+ this.$ = $$[$0 - 4];
1288
+ yy.addVertex($$[$0 - 2], undefined, undefined, $$[$0]);
1289
+ break;
1290
+ case 122:
1291
+ this.$ = $$[$0 - 4];
1292
+ yy.updateLink([$$[$0 - 2]], $$[$0]);
1293
+ break;
1294
+ case 123:
1295
+ this.$ = $$[$0 - 4];
1296
+ yy.updateLink($$[$0 - 2], $$[$0]);
1297
+ break;
1298
+ case 124:
1299
+ this.$ = $$[$0 - 8];
1300
+ yy.updateLinkInterpolate([$$[$0 - 6]], $$[$0 - 2]);
1301
+ yy.updateLink([$$[$0 - 6]], $$[$0]);
1302
+ break;
1303
+ case 125:
1304
+ this.$ = $$[$0 - 8];
1305
+ yy.updateLinkInterpolate($$[$0 - 6], $$[$0 - 2]);
1306
+ yy.updateLink($$[$0 - 6], $$[$0]);
1307
+ break;
1308
+ case 126:
1309
+ this.$ = $$[$0 - 6];
1310
+ yy.updateLinkInterpolate([$$[$0 - 4]], $$[$0]);
1311
+ break;
1312
+ case 127:
1313
+ this.$ = $$[$0 - 6];
1314
+ yy.updateLinkInterpolate($$[$0 - 4], $$[$0]);
1315
+ break;
1316
+ case 128:
1317
+ case 130:
1318
+ this.$ = [$$[$0]];
1319
+ break;
1320
+ case 129:
1321
+ case 131:
1322
+ $$[$0 - 2].push($$[$0]);
1323
+ this.$ = $$[$0 - 2];
1324
+ break;
1325
+ case 133:
1326
+ this.$ = $$[$0 - 1] + $$[$0];
1327
+ break;
1328
+ case 181:
1329
+ this.$ = $$[$0];
1330
+ break;
1331
+ case 182:
1332
+ this.$ = $$[$0 - 1] + "" + $$[$0];
1333
+ break;
1334
+ case 184:
1335
+ this.$ = $$[$0 - 1] + "" + $$[$0];
1336
+ break;
1337
+ case 185:
1338
+ this.$ = { stmt: "dir", value: "TB" };
1339
+ break;
1340
+ case 186:
1341
+ this.$ = { stmt: "dir", value: "BT" };
1342
+ break;
1343
+ case 187:
1344
+ this.$ = { stmt: "dir", value: "RL" };
1345
+ break;
1346
+ case 188:
1347
+ this.$ = { stmt: "dir", value: "LR" };
1348
+ break;
1349
+ case 189:
1350
+ this.$ = { stmt: "dir", value: "TD" };
1351
+ break;
1352
+ }
1353
+ }, "anonymous"),
1354
+ table: [{ 3: 1, 4: 2, 9: $V0, 10: $V1, 12: $V2 }, { 1: [3] }, o($V3, $V4, { 5: 6 }), { 4: 7, 9: $V0, 10: $V1, 12: $V2 }, { 4: 8, 9: $V0, 10: $V1, 12: $V2 }, { 13: [1, 9], 14: [1, 10] }, { 1: [2, 1], 6: 11, 7: 12, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 20: 17, 22: 18, 23: 19, 24: 20, 25: 21, 26: 22, 27: $V9, 33: 24, 34: $Va, 36: $Vb, 38: $Vc, 42: 28, 43: 39, 44: $Vd, 45: 40, 47: 41, 60: $Ve, 84: $Vf, 85: $Vg, 86: $Vh, 87: $Vi, 88: $Vj, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 42, 114: $Vq, 115: $Vr, 116: $Vs, 121: $Vt, 122: $Vu, 123: $Vv, 124: $Vw, 125: $Vx }, o($V3, [2, 9]), o($V3, [2, 10]), o($V3, [2, 11]), { 8: [1, 55], 9: [1, 56], 10: $Vy, 15: 54, 18: 57 }, o($Vz, [2, 3]), o($Vz, [2, 4]), o($Vz, [2, 5]), o($Vz, [2, 6]), o($Vz, [2, 7]), o($Vz, [2, 8]), { 8: $VA, 9: $VB, 11: $VC, 21: 59, 41: 60, 72: 64, 75: [1, 65], 77: [1, 67], 78: [1, 66] }, { 8: $VA, 9: $VB, 11: $VC, 21: 68 }, { 8: $VA, 9: $VB, 11: $VC, 21: 69 }, { 8: $VA, 9: $VB, 11: $VC, 21: 70 }, { 8: $VA, 9: $VB, 11: $VC, 21: 71 }, { 8: $VA, 9: $VB, 11: $VC, 21: 72 }, { 8: $VA, 9: $VB, 10: [1, 73], 11: $VC, 21: 74 }, o($Vz, [2, 36]), { 35: [1, 75] }, { 37: [1, 76] }, o($Vz, [2, 39]), o($VD, [2, 50], { 18: 77, 39: 78, 10: $Vy, 40: $VE }), { 10: [1, 80] }, { 10: [1, 81] }, { 10: [1, 82] }, { 10: [1, 83] }, { 14: $VF, 44: $VG, 60: $VH, 80: [1, 87], 89: $VI, 95: [1, 84], 97: [1, 85], 101: 86, 105: $VJ, 106: $VK, 109: $VL, 111: $VM, 114: $VN, 115: $VO, 116: $VP, 120: 88 }, o($Vz, [2, 185]), o($Vz, [2, 186]), o($Vz, [2, 187]), o($Vz, [2, 188]), o($Vz, [2, 189]), o($VQ, [2, 51]), o($VQ, [2, 54], { 46: [1, 100] }), o($VR, [2, 72], { 113: 113, 29: [1, 101], 44: $Vd, 48: [1, 102], 50: [1, 103], 52: [1, 104], 54: [1, 105], 56: [1, 106], 58: [1, 107], 60: $Ve, 63: [1, 108], 65: [1, 109], 67: [1, 110], 68: [1, 111], 70: [1, 112], 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 114: $Vq, 115: $Vr, 116: $Vs }), o($VS, [2, 181]), o($VS, [2, 142]), o($VS, [2, 143]), o($VS, [2, 144]), o($VS, [2, 145]), o($VS, [2, 146]), o($VS, [2, 147]), o($VS, [2, 148]), o($VS, [2, 149]), o($VS, [2, 150]), o($VS, [2, 151]), o($VS, [2, 152]), o($V3, [2, 12]), o($V3, [2, 18]), o($V3, [2, 19]), { 9: [1, 114] }, o($VT, [2, 26], { 18: 115, 10: $Vy }), o($Vz, [2, 27]), { 42: 116, 43: 39, 44: $Vd, 45: 40, 47: 41, 60: $Ve, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 42, 114: $Vq, 115: $Vr, 116: $Vs }, o($Vz, [2, 40]), o($Vz, [2, 41]), o($Vz, [2, 42]), o($VU, [2, 76], { 73: 117, 62: [1, 119], 74: [1, 118] }), { 76: 120, 79: 121, 80: $VV, 81: $VW, 116: $VX, 119: $VY }, { 75: [1, 126], 77: [1, 127] }, o($VZ, [2, 83]), o($Vz, [2, 28]), o($Vz, [2, 29]), o($Vz, [2, 30]), o($Vz, [2, 31]), o($Vz, [2, 32]), { 10: $V_, 12: $V$, 14: $V01, 27: $V11, 28: 128, 32: $V21, 44: $V31, 60: $V41, 75: $V51, 80: [1, 130], 81: [1, 131], 83: 141, 84: $V61, 85: $V71, 86: $V81, 87: $V91, 88: $Va1, 89: $Vb1, 90: $Vc1, 91: 129, 105: $Vd1, 109: $Ve1, 111: $Vf1, 114: $Vg1, 115: $Vh1, 116: $Vi1 }, o($Vj1, $V4, { 5: 154 }), o($Vz, [2, 37]), o($Vz, [2, 38]), o($VD, [2, 48], { 44: $Vk1 }), o($VD, [2, 49], { 18: 156, 10: $Vy, 40: $Vl1 }), o($VQ, [2, 44]), { 44: $Vd, 47: 158, 60: $Ve, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 42, 114: $Vq, 115: $Vr, 116: $Vs }, { 102: [1, 159], 103: 160, 105: [1, 161] }, { 44: $Vd, 47: 162, 60: $Ve, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 42, 114: $Vq, 115: $Vr, 116: $Vs }, { 44: $Vd, 47: 163, 60: $Ve, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 42, 114: $Vq, 115: $Vr, 116: $Vs }, o($Vm1, [2, 107], { 10: [1, 164], 96: [1, 165] }), { 80: [1, 166] }, o($Vm1, [2, 115], { 120: 168, 10: [1, 167], 14: $VF, 44: $VG, 60: $VH, 89: $VI, 105: $VJ, 106: $VK, 109: $VL, 111: $VM, 114: $VN, 115: $VO, 116: $VP }), o($Vm1, [2, 117], { 10: [1, 169] }), o($Vn1, [2, 183]), o($Vn1, [2, 170]), o($Vn1, [2, 171]), o($Vn1, [2, 172]), o($Vn1, [2, 173]), o($Vn1, [2, 174]), o($Vn1, [2, 175]), o($Vn1, [2, 176]), o($Vn1, [2, 177]), o($Vn1, [2, 178]), o($Vn1, [2, 179]), o($Vn1, [2, 180]), { 44: $Vd, 47: 170, 60: $Ve, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 42, 114: $Vq, 115: $Vr, 116: $Vs }, { 30: 171, 67: $Vo1, 80: $Vp1, 81: $Vq1, 82: 172, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, { 30: 179, 67: $Vo1, 80: $Vp1, 81: $Vq1, 82: 172, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, { 30: 181, 50: [1, 180], 67: $Vo1, 80: $Vp1, 81: $Vq1, 82: 172, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, { 30: 182, 67: $Vo1, 80: $Vp1, 81: $Vq1, 82: 172, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, { 30: 183, 67: $Vo1, 80: $Vp1, 81: $Vq1, 82: 172, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, { 30: 184, 67: $Vo1, 80: $Vp1, 81: $Vq1, 82: 172, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, { 109: [1, 185] }, { 30: 186, 67: $Vo1, 80: $Vp1, 81: $Vq1, 82: 172, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, { 30: 187, 65: [1, 188], 67: $Vo1, 80: $Vp1, 81: $Vq1, 82: 172, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, { 30: 189, 67: $Vo1, 80: $Vp1, 81: $Vq1, 82: 172, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, { 30: 190, 67: $Vo1, 80: $Vp1, 81: $Vq1, 82: 172, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, { 30: 191, 67: $Vo1, 80: $Vp1, 81: $Vq1, 82: 172, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, o($VS, [2, 182]), o($V3, [2, 20]), o($VT, [2, 25]), o($VD, [2, 46], { 39: 192, 18: 193, 10: $Vy, 40: $VE }), o($VU, [2, 73], { 10: [1, 194] }), { 10: [1, 195] }, { 30: 196, 67: $Vo1, 80: $Vp1, 81: $Vq1, 82: 172, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, { 77: [1, 197], 79: 198, 116: $VX, 119: $VY }, o($Vu1, [2, 79]), o($Vu1, [2, 81]), o($Vu1, [2, 82]), o($Vu1, [2, 168]), o($Vu1, [2, 169]), { 76: 199, 79: 121, 80: $VV, 81: $VW, 116: $VX, 119: $VY }, o($VZ, [2, 84]), { 8: $VA, 9: $VB, 10: $V_, 11: $VC, 12: $V$, 14: $V01, 21: 201, 27: $V11, 29: [1, 200], 32: $V21, 44: $V31, 60: $V41, 75: $V51, 83: 141, 84: $V61, 85: $V71, 86: $V81, 87: $V91, 88: $Va1, 89: $Vb1, 90: $Vc1, 91: 202, 105: $Vd1, 109: $Ve1, 111: $Vf1, 114: $Vg1, 115: $Vh1, 116: $Vi1 }, o($Vv1, [2, 101]), o($Vv1, [2, 103]), o($Vv1, [2, 104]), o($Vv1, [2, 157]), o($Vv1, [2, 158]), o($Vv1, [2, 159]), o($Vv1, [2, 160]), o($Vv1, [2, 161]), o($Vv1, [2, 162]), o($Vv1, [2, 163]), o($Vv1, [2, 164]), o($Vv1, [2, 165]), o($Vv1, [2, 166]), o($Vv1, [2, 167]), o($Vv1, [2, 90]), o($Vv1, [2, 91]), o($Vv1, [2, 92]), o($Vv1, [2, 93]), o($Vv1, [2, 94]), o($Vv1, [2, 95]), o($Vv1, [2, 96]), o($Vv1, [2, 97]), o($Vv1, [2, 98]), o($Vv1, [2, 99]), o($Vv1, [2, 100]), { 6: 11, 7: 12, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 20: 17, 22: 18, 23: 19, 24: 20, 25: 21, 26: 22, 27: $V9, 32: [1, 203], 33: 24, 34: $Va, 36: $Vb, 38: $Vc, 42: 28, 43: 39, 44: $Vd, 45: 40, 47: 41, 60: $Ve, 84: $Vf, 85: $Vg, 86: $Vh, 87: $Vi, 88: $Vj, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 42, 114: $Vq, 115: $Vr, 116: $Vs, 121: $Vt, 122: $Vu, 123: $Vv, 124: $Vw, 125: $Vx }, { 10: $Vy, 18: 204 }, { 44: [1, 205] }, o($VQ, [2, 43]), { 10: [1, 206], 44: $Vd, 60: $Ve, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 113, 114: $Vq, 115: $Vr, 116: $Vs }, { 10: [1, 207] }, { 10: [1, 208], 106: [1, 209] }, o($Vw1, [2, 128]), { 10: [1, 210], 44: $Vd, 60: $Ve, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 113, 114: $Vq, 115: $Vr, 116: $Vs }, { 10: [1, 211], 44: $Vd, 60: $Ve, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 113, 114: $Vq, 115: $Vr, 116: $Vs }, { 80: [1, 212] }, o($Vm1, [2, 109], { 10: [1, 213] }), o($Vm1, [2, 111], { 10: [1, 214] }), { 80: [1, 215] }, o($Vn1, [2, 184]), { 80: [1, 216], 98: [1, 217] }, o($VQ, [2, 55], { 113: 113, 44: $Vd, 60: $Ve, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 114: $Vq, 115: $Vr, 116: $Vs }), { 31: [1, 218], 67: $Vo1, 82: 219, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, o($Vx1, [2, 86]), o($Vx1, [2, 88]), o($Vx1, [2, 89]), o($Vx1, [2, 153]), o($Vx1, [2, 154]), o($Vx1, [2, 155]), o($Vx1, [2, 156]), { 49: [1, 220], 67: $Vo1, 82: 219, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, { 30: 221, 67: $Vo1, 80: $Vp1, 81: $Vq1, 82: 172, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, { 51: [1, 222], 67: $Vo1, 82: 219, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, { 53: [1, 223], 67: $Vo1, 82: 219, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, { 55: [1, 224], 67: $Vo1, 82: 219, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, { 57: [1, 225], 67: $Vo1, 82: 219, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, { 60: [1, 226] }, { 64: [1, 227], 67: $Vo1, 82: 219, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, { 66: [1, 228], 67: $Vo1, 82: 219, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, { 30: 229, 67: $Vo1, 80: $Vp1, 81: $Vq1, 82: 172, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, { 31: [1, 230], 67: $Vo1, 82: 219, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, { 67: $Vo1, 69: [1, 231], 71: [1, 232], 82: 219, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, { 67: $Vo1, 69: [1, 234], 71: [1, 233], 82: 219, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, o($VD, [2, 45], { 18: 156, 10: $Vy, 40: $Vl1 }), o($VD, [2, 47], { 44: $Vk1 }), o($VU, [2, 75]), o($VU, [2, 74]), { 62: [1, 235], 67: $Vo1, 82: 219, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, o($VU, [2, 77]), o($Vu1, [2, 80]), { 77: [1, 236], 79: 198, 116: $VX, 119: $VY }, { 30: 237, 67: $Vo1, 80: $Vp1, 81: $Vq1, 82: 172, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, o($Vj1, $V4, { 5: 238 }), o($Vv1, [2, 102]), o($Vz, [2, 35]), { 43: 239, 44: $Vd, 45: 40, 47: 41, 60: $Ve, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 42, 114: $Vq, 115: $Vr, 116: $Vs }, { 10: $Vy, 18: 240 }, { 10: $Vy1, 60: $Vz1, 84: $VA1, 92: 241, 105: $VB1, 107: 242, 108: 243, 109: $VC1, 110: $VD1, 111: $VE1, 112: $VF1 }, { 10: $Vy1, 60: $Vz1, 84: $VA1, 92: 252, 104: [1, 253], 105: $VB1, 107: 242, 108: 243, 109: $VC1, 110: $VD1, 111: $VE1, 112: $VF1 }, { 10: $Vy1, 60: $Vz1, 84: $VA1, 92: 254, 104: [1, 255], 105: $VB1, 107: 242, 108: 243, 109: $VC1, 110: $VD1, 111: $VE1, 112: $VF1 }, { 105: [1, 256] }, { 10: $Vy1, 60: $Vz1, 84: $VA1, 92: 257, 105: $VB1, 107: 242, 108: 243, 109: $VC1, 110: $VD1, 111: $VE1, 112: $VF1 }, { 44: $Vd, 47: 258, 60: $Ve, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 42, 114: $Vq, 115: $Vr, 116: $Vs }, o($Vm1, [2, 108]), { 80: [1, 259] }, { 80: [1, 260], 98: [1, 261] }, o($Vm1, [2, 116]), o($Vm1, [2, 118], { 10: [1, 262] }), o($Vm1, [2, 119]), o($VR, [2, 56]), o($Vx1, [2, 87]), o($VR, [2, 57]), { 51: [1, 263], 67: $Vo1, 82: 219, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, o($VR, [2, 64]), o($VR, [2, 59]), o($VR, [2, 60]), o($VR, [2, 61]), { 109: [1, 264] }, o($VR, [2, 63]), o($VR, [2, 65]), { 66: [1, 265], 67: $Vo1, 82: 219, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, o($VR, [2, 67]), o($VR, [2, 68]), o($VR, [2, 70]), o($VR, [2, 69]), o($VR, [2, 71]), o([10, 44, 60, 89, 102, 105, 106, 109, 111, 114, 115, 116], [2, 85]), o($VU, [2, 78]), { 31: [1, 266], 67: $Vo1, 82: 219, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, { 6: 11, 7: 12, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 20: 17, 22: 18, 23: 19, 24: 20, 25: 21, 26: 22, 27: $V9, 32: [1, 267], 33: 24, 34: $Va, 36: $Vb, 38: $Vc, 42: 28, 43: 39, 44: $Vd, 45: 40, 47: 41, 60: $Ve, 84: $Vf, 85: $Vg, 86: $Vh, 87: $Vi, 88: $Vj, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 42, 114: $Vq, 115: $Vr, 116: $Vs, 121: $Vt, 122: $Vu, 123: $Vv, 124: $Vw, 125: $Vx }, o($VQ, [2, 53]), { 43: 268, 44: $Vd, 45: 40, 47: 41, 60: $Ve, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 42, 114: $Vq, 115: $Vr, 116: $Vs }, o($Vm1, [2, 121], { 106: $VG1 }), o($VH1, [2, 130], { 108: 270, 10: $Vy1, 60: $Vz1, 84: $VA1, 105: $VB1, 109: $VC1, 110: $VD1, 111: $VE1, 112: $VF1 }), o($VI1, [2, 132]), o($VI1, [2, 134]), o($VI1, [2, 135]), o($VI1, [2, 136]), o($VI1, [2, 137]), o($VI1, [2, 138]), o($VI1, [2, 139]), o($VI1, [2, 140]), o($VI1, [2, 141]), o($Vm1, [2, 122], { 106: $VG1 }), { 10: [1, 271] }, o($Vm1, [2, 123], { 106: $VG1 }), { 10: [1, 272] }, o($Vw1, [2, 129]), o($Vm1, [2, 105], { 106: $VG1 }), o($Vm1, [2, 106], { 113: 113, 44: $Vd, 60: $Ve, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 114: $Vq, 115: $Vr, 116: $Vs }), o($Vm1, [2, 110]), o($Vm1, [2, 112], { 10: [1, 273] }), o($Vm1, [2, 113]), { 98: [1, 274] }, { 51: [1, 275] }, { 62: [1, 276] }, { 66: [1, 277] }, { 8: $VA, 9: $VB, 11: $VC, 21: 278 }, o($Vz, [2, 34]), o($VQ, [2, 52]), { 10: $Vy1, 60: $Vz1, 84: $VA1, 105: $VB1, 107: 279, 108: 243, 109: $VC1, 110: $VD1, 111: $VE1, 112: $VF1 }, o($VI1, [2, 133]), { 14: $VF, 44: $VG, 60: $VH, 89: $VI, 101: 280, 105: $VJ, 106: $VK, 109: $VL, 111: $VM, 114: $VN, 115: $VO, 116: $VP, 120: 88 }, { 14: $VF, 44: $VG, 60: $VH, 89: $VI, 101: 281, 105: $VJ, 106: $VK, 109: $VL, 111: $VM, 114: $VN, 115: $VO, 116: $VP, 120: 88 }, { 98: [1, 282] }, o($Vm1, [2, 120]), o($VR, [2, 58]), { 30: 283, 67: $Vo1, 80: $Vp1, 81: $Vq1, 82: 172, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, o($VR, [2, 66]), o($Vj1, $V4, { 5: 284 }), o($VH1, [2, 131], { 108: 270, 10: $Vy1, 60: $Vz1, 84: $VA1, 105: $VB1, 109: $VC1, 110: $VD1, 111: $VE1, 112: $VF1 }), o($Vm1, [2, 126], { 120: 168, 10: [1, 285], 14: $VF, 44: $VG, 60: $VH, 89: $VI, 105: $VJ, 106: $VK, 109: $VL, 111: $VM, 114: $VN, 115: $VO, 116: $VP }), o($Vm1, [2, 127], { 120: 168, 10: [1, 286], 14: $VF, 44: $VG, 60: $VH, 89: $VI, 105: $VJ, 106: $VK, 109: $VL, 111: $VM, 114: $VN, 115: $VO, 116: $VP }), o($Vm1, [2, 114]), { 31: [1, 287], 67: $Vo1, 82: 219, 116: $Vr1, 117: $Vs1, 118: $Vt1 }, { 6: 11, 7: 12, 8: $V5, 9: $V6, 10: $V7, 11: $V8, 20: 17, 22: 18, 23: 19, 24: 20, 25: 21, 26: 22, 27: $V9, 32: [1, 288], 33: 24, 34: $Va, 36: $Vb, 38: $Vc, 42: 28, 43: 39, 44: $Vd, 45: 40, 47: 41, 60: $Ve, 84: $Vf, 85: $Vg, 86: $Vh, 87: $Vi, 88: $Vj, 89: $Vk, 102: $Vl, 105: $Vm, 106: $Vn, 109: $Vo, 111: $Vp, 113: 42, 114: $Vq, 115: $Vr, 116: $Vs, 121: $Vt, 122: $Vu, 123: $Vv, 124: $Vw, 125: $Vx }, { 10: $Vy1, 60: $Vz1, 84: $VA1, 92: 289, 105: $VB1, 107: 242, 108: 243, 109: $VC1, 110: $VD1, 111: $VE1, 112: $VF1 }, { 10: $Vy1, 60: $Vz1, 84: $VA1, 92: 290, 105: $VB1, 107: 242, 108: 243, 109: $VC1, 110: $VD1, 111: $VE1, 112: $VF1 }, o($VR, [2, 62]), o($Vz, [2, 33]), o($Vm1, [2, 124], { 106: $VG1 }), o($Vm1, [2, 125], { 106: $VG1 })],
1355
+ defaultActions: {},
1356
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
1357
+ if (hash.recoverable) {
1358
+ this.trace(str);
1359
+ } else {
1360
+ var error = new Error(str);
1361
+ error.hash = hash;
1362
+ throw error;
1363
+ }
1364
+ }, "parseError"),
1365
+ parse: /* @__PURE__ */ __name(function parse(input) {
1366
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
1367
+ var args = lstack.slice.call(arguments, 1);
1368
+ var lexer2 = Object.create(this.lexer);
1369
+ var sharedState = { yy: {} };
1370
+ for (var k in this.yy) {
1371
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
1372
+ sharedState.yy[k] = this.yy[k];
1373
+ }
1374
+ }
1375
+ lexer2.setInput(input, sharedState.yy);
1376
+ sharedState.yy.lexer = lexer2;
1377
+ sharedState.yy.parser = this;
1378
+ if (typeof lexer2.yylloc == "undefined") {
1379
+ lexer2.yylloc = {};
1380
+ }
1381
+ var yyloc = lexer2.yylloc;
1382
+ lstack.push(yyloc);
1383
+ var ranges = lexer2.options && lexer2.options.ranges;
1384
+ if (typeof sharedState.yy.parseError === "function") {
1385
+ this.parseError = sharedState.yy.parseError;
1386
+ } else {
1387
+ this.parseError = Object.getPrototypeOf(this).parseError;
1388
+ }
1389
+ function popStack(n) {
1390
+ stack.length = stack.length - 2 * n;
1391
+ vstack.length = vstack.length - n;
1392
+ lstack.length = lstack.length - n;
1393
+ }
1394
+ __name(popStack, "popStack");
1395
+ function lex() {
1396
+ var token;
1397
+ token = tstack.pop() || lexer2.lex() || EOF;
1398
+ if (typeof token !== "number") {
1399
+ if (token instanceof Array) {
1400
+ tstack = token;
1401
+ token = tstack.pop();
1402
+ }
1403
+ token = self.symbols_[token] || token;
1404
+ }
1405
+ return token;
1406
+ }
1407
+ __name(lex, "lex");
1408
+ var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
1409
+ while (true) {
1410
+ state = stack[stack.length - 1];
1411
+ if (this.defaultActions[state]) {
1412
+ action = this.defaultActions[state];
1413
+ } else {
1414
+ if (symbol === null || typeof symbol == "undefined") {
1415
+ symbol = lex();
1416
+ }
1417
+ action = table[state] && table[state][symbol];
1418
+ }
1419
+ if (typeof action === "undefined" || !action.length || !action[0]) {
1420
+ var errStr = "";
1421
+ expected = [];
1422
+ for (p in table[state]) {
1423
+ if (this.terminals_[p] && p > TERROR) {
1424
+ expected.push("'" + this.terminals_[p] + "'");
1425
+ }
1426
+ }
1427
+ if (lexer2.showPosition) {
1428
+ errStr = "Parse error on line " + (yylineno + 1) + `:
1429
+ ` + lexer2.showPosition() + `
1430
+ Expecting ` + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
1431
+ } else {
1432
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
1433
+ }
1434
+ this.parseError(errStr, {
1435
+ text: lexer2.match,
1436
+ token: this.terminals_[symbol] || symbol,
1437
+ line: lexer2.yylineno,
1438
+ loc: yyloc,
1439
+ expected
1440
+ });
1441
+ }
1442
+ if (action[0] instanceof Array && action.length > 1) {
1443
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
1444
+ }
1445
+ switch (action[0]) {
1446
+ case 1:
1447
+ stack.push(symbol);
1448
+ vstack.push(lexer2.yytext);
1449
+ lstack.push(lexer2.yylloc);
1450
+ stack.push(action[1]);
1451
+ symbol = null;
1452
+ if (!preErrorSymbol) {
1453
+ yyleng = lexer2.yyleng;
1454
+ yytext = lexer2.yytext;
1455
+ yylineno = lexer2.yylineno;
1456
+ yyloc = lexer2.yylloc;
1457
+ if (recovering > 0) {
1458
+ recovering--;
1459
+ }
1460
+ } else {
1461
+ symbol = preErrorSymbol;
1462
+ preErrorSymbol = null;
1463
+ }
1464
+ break;
1465
+ case 2:
1466
+ len = this.productions_[action[1]][1];
1467
+ yyval.$ = vstack[vstack.length - len];
1468
+ yyval._$ = {
1469
+ first_line: lstack[lstack.length - (len || 1)].first_line,
1470
+ last_line: lstack[lstack.length - 1].last_line,
1471
+ first_column: lstack[lstack.length - (len || 1)].first_column,
1472
+ last_column: lstack[lstack.length - 1].last_column
1473
+ };
1474
+ if (ranges) {
1475
+ yyval._$.range = [
1476
+ lstack[lstack.length - (len || 1)].range[0],
1477
+ lstack[lstack.length - 1].range[1]
1478
+ ];
1479
+ }
1480
+ r = this.performAction.apply(yyval, [
1481
+ yytext,
1482
+ yyleng,
1483
+ yylineno,
1484
+ sharedState.yy,
1485
+ action[1],
1486
+ vstack,
1487
+ lstack
1488
+ ].concat(args));
1489
+ if (typeof r !== "undefined") {
1490
+ return r;
1491
+ }
1492
+ if (len) {
1493
+ stack = stack.slice(0, -1 * len * 2);
1494
+ vstack = vstack.slice(0, -1 * len);
1495
+ lstack = lstack.slice(0, -1 * len);
1496
+ }
1497
+ stack.push(this.productions_[action[1]][0]);
1498
+ vstack.push(yyval.$);
1499
+ lstack.push(yyval._$);
1500
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
1501
+ stack.push(newState);
1502
+ break;
1503
+ case 3:
1504
+ return true;
1505
+ }
1506
+ }
1507
+ return true;
1508
+ }, "parse")
1509
+ };
1510
+ var lexer = /* @__PURE__ */ function() {
1511
+ var lexer2 = {
1512
+ EOF: 1,
1513
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
1514
+ if (this.yy.parser) {
1515
+ this.yy.parser.parseError(str, hash);
1516
+ } else {
1517
+ throw new Error(str);
1518
+ }
1519
+ }, "parseError"),
1520
+ setInput: /* @__PURE__ */ __name(function(input, yy) {
1521
+ this.yy = yy || this.yy || {};
1522
+ this._input = input;
1523
+ this._more = this._backtrack = this.done = false;
1524
+ this.yylineno = this.yyleng = 0;
1525
+ this.yytext = this.matched = this.match = "";
1526
+ this.conditionStack = ["INITIAL"];
1527
+ this.yylloc = {
1528
+ first_line: 1,
1529
+ first_column: 0,
1530
+ last_line: 1,
1531
+ last_column: 0
1532
+ };
1533
+ if (this.options.ranges) {
1534
+ this.yylloc.range = [0, 0];
1535
+ }
1536
+ this.offset = 0;
1537
+ return this;
1538
+ }, "setInput"),
1539
+ input: /* @__PURE__ */ __name(function() {
1540
+ var ch = this._input[0];
1541
+ this.yytext += ch;
1542
+ this.yyleng++;
1543
+ this.offset++;
1544
+ this.match += ch;
1545
+ this.matched += ch;
1546
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
1547
+ if (lines) {
1548
+ this.yylineno++;
1549
+ this.yylloc.last_line++;
1550
+ } else {
1551
+ this.yylloc.last_column++;
1552
+ }
1553
+ if (this.options.ranges) {
1554
+ this.yylloc.range[1]++;
1555
+ }
1556
+ this._input = this._input.slice(1);
1557
+ return ch;
1558
+ }, "input"),
1559
+ unput: /* @__PURE__ */ __name(function(ch) {
1560
+ var len = ch.length;
1561
+ var lines = ch.split(/(?:\r\n?|\n)/g);
1562
+ this._input = ch + this._input;
1563
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
1564
+ this.offset -= len;
1565
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
1566
+ this.match = this.match.substr(0, this.match.length - 1);
1567
+ this.matched = this.matched.substr(0, this.matched.length - 1);
1568
+ if (lines.length - 1) {
1569
+ this.yylineno -= lines.length - 1;
1570
+ }
1571
+ var r = this.yylloc.range;
1572
+ this.yylloc = {
1573
+ first_line: this.yylloc.first_line,
1574
+ last_line: this.yylineno + 1,
1575
+ first_column: this.yylloc.first_column,
1576
+ last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
1577
+ };
1578
+ if (this.options.ranges) {
1579
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
1580
+ }
1581
+ this.yyleng = this.yytext.length;
1582
+ return this;
1583
+ }, "unput"),
1584
+ more: /* @__PURE__ */ __name(function() {
1585
+ this._more = true;
1586
+ return this;
1587
+ }, "more"),
1588
+ reject: /* @__PURE__ */ __name(function() {
1589
+ if (this.options.backtrack_lexer) {
1590
+ this._backtrack = true;
1591
+ } else {
1592
+ 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).
1593
+ ` + this.showPosition(), {
1594
+ text: "",
1595
+ token: null,
1596
+ line: this.yylineno
1597
+ });
1598
+ }
1599
+ return this;
1600
+ }, "reject"),
1601
+ less: /* @__PURE__ */ __name(function(n) {
1602
+ this.unput(this.match.slice(n));
1603
+ }, "less"),
1604
+ pastInput: /* @__PURE__ */ __name(function() {
1605
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
1606
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
1607
+ }, "pastInput"),
1608
+ upcomingInput: /* @__PURE__ */ __name(function() {
1609
+ var next = this.match;
1610
+ if (next.length < 20) {
1611
+ next += this._input.substr(0, 20 - next.length);
1612
+ }
1613
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
1614
+ }, "upcomingInput"),
1615
+ showPosition: /* @__PURE__ */ __name(function() {
1616
+ var pre = this.pastInput();
1617
+ var c = new Array(pre.length + 1).join("-");
1618
+ return pre + this.upcomingInput() + `
1619
+ ` + c + "^";
1620
+ }, "showPosition"),
1621
+ test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
1622
+ var token, lines, backup;
1623
+ if (this.options.backtrack_lexer) {
1624
+ backup = {
1625
+ yylineno: this.yylineno,
1626
+ yylloc: {
1627
+ first_line: this.yylloc.first_line,
1628
+ last_line: this.last_line,
1629
+ first_column: this.yylloc.first_column,
1630
+ last_column: this.yylloc.last_column
1631
+ },
1632
+ yytext: this.yytext,
1633
+ match: this.match,
1634
+ matches: this.matches,
1635
+ matched: this.matched,
1636
+ yyleng: this.yyleng,
1637
+ offset: this.offset,
1638
+ _more: this._more,
1639
+ _input: this._input,
1640
+ yy: this.yy,
1641
+ conditionStack: this.conditionStack.slice(0),
1642
+ done: this.done
1643
+ };
1644
+ if (this.options.ranges) {
1645
+ backup.yylloc.range = this.yylloc.range.slice(0);
1646
+ }
1647
+ }
1648
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
1649
+ if (lines) {
1650
+ this.yylineno += lines.length;
1651
+ }
1652
+ this.yylloc = {
1653
+ first_line: this.yylloc.last_line,
1654
+ last_line: this.yylineno + 1,
1655
+ first_column: this.yylloc.last_column,
1656
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
1657
+ };
1658
+ this.yytext += match[0];
1659
+ this.match += match[0];
1660
+ this.matches = match;
1661
+ this.yyleng = this.yytext.length;
1662
+ if (this.options.ranges) {
1663
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
1664
+ }
1665
+ this._more = false;
1666
+ this._backtrack = false;
1667
+ this._input = this._input.slice(match[0].length);
1668
+ this.matched += match[0];
1669
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
1670
+ if (this.done && this._input) {
1671
+ this.done = false;
1672
+ }
1673
+ if (token) {
1674
+ return token;
1675
+ } else if (this._backtrack) {
1676
+ for (var k in backup) {
1677
+ this[k] = backup[k];
1678
+ }
1679
+ return false;
1680
+ }
1681
+ return false;
1682
+ }, "test_match"),
1683
+ next: /* @__PURE__ */ __name(function() {
1684
+ if (this.done) {
1685
+ return this.EOF;
1686
+ }
1687
+ if (!this._input) {
1688
+ this.done = true;
1689
+ }
1690
+ var token, match, tempMatch, index;
1691
+ if (!this._more) {
1692
+ this.yytext = "";
1693
+ this.match = "";
1694
+ }
1695
+ var rules = this._currentRules();
1696
+ for (var i = 0;i < rules.length; i++) {
1697
+ tempMatch = this._input.match(this.rules[rules[i]]);
1698
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
1699
+ match = tempMatch;
1700
+ index = i;
1701
+ if (this.options.backtrack_lexer) {
1702
+ token = this.test_match(tempMatch, rules[i]);
1703
+ if (token !== false) {
1704
+ return token;
1705
+ } else if (this._backtrack) {
1706
+ match = false;
1707
+ continue;
1708
+ } else {
1709
+ return false;
1710
+ }
1711
+ } else if (!this.options.flex) {
1712
+ break;
1713
+ }
1714
+ }
1715
+ }
1716
+ if (match) {
1717
+ token = this.test_match(match, rules[index]);
1718
+ if (token !== false) {
1719
+ return token;
1720
+ }
1721
+ return false;
1722
+ }
1723
+ if (this._input === "") {
1724
+ return this.EOF;
1725
+ } else {
1726
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
1727
+ ` + this.showPosition(), {
1728
+ text: "",
1729
+ token: null,
1730
+ line: this.yylineno
1731
+ });
1732
+ }
1733
+ }, "next"),
1734
+ lex: /* @__PURE__ */ __name(function lex() {
1735
+ var r = this.next();
1736
+ if (r) {
1737
+ return r;
1738
+ } else {
1739
+ return this.lex();
1740
+ }
1741
+ }, "lex"),
1742
+ begin: /* @__PURE__ */ __name(function begin(condition) {
1743
+ this.conditionStack.push(condition);
1744
+ }, "begin"),
1745
+ popState: /* @__PURE__ */ __name(function popState() {
1746
+ var n = this.conditionStack.length - 1;
1747
+ if (n > 0) {
1748
+ return this.conditionStack.pop();
1749
+ } else {
1750
+ return this.conditionStack[0];
1751
+ }
1752
+ }, "popState"),
1753
+ _currentRules: /* @__PURE__ */ __name(function _currentRules() {
1754
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
1755
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
1756
+ } else {
1757
+ return this.conditions["INITIAL"].rules;
1758
+ }
1759
+ }, "_currentRules"),
1760
+ topState: /* @__PURE__ */ __name(function topState(n) {
1761
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
1762
+ if (n >= 0) {
1763
+ return this.conditionStack[n];
1764
+ } else {
1765
+ return "INITIAL";
1766
+ }
1767
+ }, "topState"),
1768
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
1769
+ this.begin(condition);
1770
+ }, "pushState"),
1771
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
1772
+ return this.conditionStack.length;
1773
+ }, "stateStackSize"),
1774
+ options: {},
1775
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
1776
+ var YYSTATE = YY_START;
1777
+ switch ($avoiding_name_collisions) {
1778
+ case 0:
1779
+ this.begin("acc_title");
1780
+ return 34;
1781
+ break;
1782
+ case 1:
1783
+ this.popState();
1784
+ return "acc_title_value";
1785
+ break;
1786
+ case 2:
1787
+ this.begin("acc_descr");
1788
+ return 36;
1789
+ break;
1790
+ case 3:
1791
+ this.popState();
1792
+ return "acc_descr_value";
1793
+ break;
1794
+ case 4:
1795
+ this.begin("acc_descr_multiline");
1796
+ break;
1797
+ case 5:
1798
+ this.popState();
1799
+ break;
1800
+ case 6:
1801
+ return "acc_descr_multiline_value";
1802
+ break;
1803
+ case 7:
1804
+ this.pushState("shapeData");
1805
+ yy_.yytext = "";
1806
+ return 40;
1807
+ break;
1808
+ case 8:
1809
+ this.pushState("shapeDataStr");
1810
+ return 40;
1811
+ break;
1812
+ case 9:
1813
+ this.popState();
1814
+ return 40;
1815
+ break;
1816
+ case 10:
1817
+ const re = /\n\s*/g;
1818
+ yy_.yytext = yy_.yytext.replace(re, "<br/>");
1819
+ return 40;
1820
+ break;
1821
+ case 11:
1822
+ return 40;
1823
+ break;
1824
+ case 12:
1825
+ this.popState();
1826
+ break;
1827
+ case 13:
1828
+ this.begin("callbackname");
1829
+ break;
1830
+ case 14:
1831
+ this.popState();
1832
+ break;
1833
+ case 15:
1834
+ this.popState();
1835
+ this.begin("callbackargs");
1836
+ break;
1837
+ case 16:
1838
+ return 95;
1839
+ break;
1840
+ case 17:
1841
+ this.popState();
1842
+ break;
1843
+ case 18:
1844
+ return 96;
1845
+ break;
1846
+ case 19:
1847
+ return "MD_STR";
1848
+ break;
1849
+ case 20:
1850
+ this.popState();
1851
+ break;
1852
+ case 21:
1853
+ this.begin("md_string");
1854
+ break;
1855
+ case 22:
1856
+ return "STR";
1857
+ break;
1858
+ case 23:
1859
+ this.popState();
1860
+ break;
1861
+ case 24:
1862
+ this.pushState("string");
1863
+ break;
1864
+ case 25:
1865
+ return 84;
1866
+ break;
1867
+ case 26:
1868
+ return 102;
1869
+ break;
1870
+ case 27:
1871
+ return 85;
1872
+ break;
1873
+ case 28:
1874
+ return 104;
1875
+ break;
1876
+ case 29:
1877
+ return 86;
1878
+ break;
1879
+ case 30:
1880
+ return 87;
1881
+ break;
1882
+ case 31:
1883
+ return 97;
1884
+ break;
1885
+ case 32:
1886
+ this.begin("click");
1887
+ break;
1888
+ case 33:
1889
+ this.popState();
1890
+ break;
1891
+ case 34:
1892
+ return 88;
1893
+ break;
1894
+ case 35:
1895
+ if (yy.lex.firstGraph()) {
1896
+ this.begin("dir");
1897
+ }
1898
+ return 12;
1899
+ break;
1900
+ case 36:
1901
+ if (yy.lex.firstGraph()) {
1902
+ this.begin("dir");
1903
+ }
1904
+ return 12;
1905
+ break;
1906
+ case 37:
1907
+ if (yy.lex.firstGraph()) {
1908
+ this.begin("dir");
1909
+ }
1910
+ return 12;
1911
+ break;
1912
+ case 38:
1913
+ if (yy.lex.firstGraph()) {
1914
+ this.begin("dir");
1915
+ }
1916
+ return 12;
1917
+ break;
1918
+ case 39:
1919
+ return 27;
1920
+ break;
1921
+ case 40:
1922
+ return 32;
1923
+ break;
1924
+ case 41:
1925
+ return 98;
1926
+ break;
1927
+ case 42:
1928
+ return 98;
1929
+ break;
1930
+ case 43:
1931
+ return 98;
1932
+ break;
1933
+ case 44:
1934
+ return 98;
1935
+ break;
1936
+ case 45:
1937
+ this.popState();
1938
+ return 13;
1939
+ break;
1940
+ case 46:
1941
+ this.popState();
1942
+ return 14;
1943
+ break;
1944
+ case 47:
1945
+ this.popState();
1946
+ return 14;
1947
+ break;
1948
+ case 48:
1949
+ this.popState();
1950
+ return 14;
1951
+ break;
1952
+ case 49:
1953
+ this.popState();
1954
+ return 14;
1955
+ break;
1956
+ case 50:
1957
+ this.popState();
1958
+ return 14;
1959
+ break;
1960
+ case 51:
1961
+ this.popState();
1962
+ return 14;
1963
+ break;
1964
+ case 52:
1965
+ this.popState();
1966
+ return 14;
1967
+ break;
1968
+ case 53:
1969
+ this.popState();
1970
+ return 14;
1971
+ break;
1972
+ case 54:
1973
+ this.popState();
1974
+ return 14;
1975
+ break;
1976
+ case 55:
1977
+ this.popState();
1978
+ return 14;
1979
+ break;
1980
+ case 56:
1981
+ return 121;
1982
+ break;
1983
+ case 57:
1984
+ return 122;
1985
+ break;
1986
+ case 58:
1987
+ return 123;
1988
+ break;
1989
+ case 59:
1990
+ return 124;
1991
+ break;
1992
+ case 60:
1993
+ return 125;
1994
+ break;
1995
+ case 61:
1996
+ return 78;
1997
+ break;
1998
+ case 62:
1999
+ return 105;
2000
+ break;
2001
+ case 63:
2002
+ return 111;
2003
+ break;
2004
+ case 64:
2005
+ return 46;
2006
+ break;
2007
+ case 65:
2008
+ return 60;
2009
+ break;
2010
+ case 66:
2011
+ return 44;
2012
+ break;
2013
+ case 67:
2014
+ return 8;
2015
+ break;
2016
+ case 68:
2017
+ return 106;
2018
+ break;
2019
+ case 69:
2020
+ return 115;
2021
+ break;
2022
+ case 70:
2023
+ this.popState();
2024
+ return 77;
2025
+ break;
2026
+ case 71:
2027
+ this.pushState("edgeText");
2028
+ return 75;
2029
+ break;
2030
+ case 72:
2031
+ return 119;
2032
+ break;
2033
+ case 73:
2034
+ this.popState();
2035
+ return 77;
2036
+ break;
2037
+ case 74:
2038
+ this.pushState("thickEdgeText");
2039
+ return 75;
2040
+ break;
2041
+ case 75:
2042
+ return 119;
2043
+ break;
2044
+ case 76:
2045
+ this.popState();
2046
+ return 77;
2047
+ break;
2048
+ case 77:
2049
+ this.pushState("dottedEdgeText");
2050
+ return 75;
2051
+ break;
2052
+ case 78:
2053
+ return 119;
2054
+ break;
2055
+ case 79:
2056
+ return 77;
2057
+ break;
2058
+ case 80:
2059
+ this.popState();
2060
+ return 53;
2061
+ break;
2062
+ case 81:
2063
+ return "TEXT";
2064
+ break;
2065
+ case 82:
2066
+ this.pushState("ellipseText");
2067
+ return 52;
2068
+ break;
2069
+ case 83:
2070
+ this.popState();
2071
+ return 55;
2072
+ break;
2073
+ case 84:
2074
+ this.pushState("text");
2075
+ return 54;
2076
+ break;
2077
+ case 85:
2078
+ this.popState();
2079
+ return 57;
2080
+ break;
2081
+ case 86:
2082
+ this.pushState("text");
2083
+ return 56;
2084
+ break;
2085
+ case 87:
2086
+ return 58;
2087
+ break;
2088
+ case 88:
2089
+ this.pushState("text");
2090
+ return 67;
2091
+ break;
2092
+ case 89:
2093
+ this.popState();
2094
+ return 64;
2095
+ break;
2096
+ case 90:
2097
+ this.pushState("text");
2098
+ return 63;
2099
+ break;
2100
+ case 91:
2101
+ this.popState();
2102
+ return 49;
2103
+ break;
2104
+ case 92:
2105
+ this.pushState("text");
2106
+ return 48;
2107
+ break;
2108
+ case 93:
2109
+ this.popState();
2110
+ return 69;
2111
+ break;
2112
+ case 94:
2113
+ this.popState();
2114
+ return 71;
2115
+ break;
2116
+ case 95:
2117
+ return 117;
2118
+ break;
2119
+ case 96:
2120
+ this.pushState("trapText");
2121
+ return 68;
2122
+ break;
2123
+ case 97:
2124
+ this.pushState("trapText");
2125
+ return 70;
2126
+ break;
2127
+ case 98:
2128
+ return 118;
2129
+ break;
2130
+ case 99:
2131
+ return 67;
2132
+ break;
2133
+ case 100:
2134
+ return 90;
2135
+ break;
2136
+ case 101:
2137
+ return "SEP";
2138
+ break;
2139
+ case 102:
2140
+ return 89;
2141
+ break;
2142
+ case 103:
2143
+ return 115;
2144
+ break;
2145
+ case 104:
2146
+ return 111;
2147
+ break;
2148
+ case 105:
2149
+ return 44;
2150
+ break;
2151
+ case 106:
2152
+ return 109;
2153
+ break;
2154
+ case 107:
2155
+ return 114;
2156
+ break;
2157
+ case 108:
2158
+ return 116;
2159
+ break;
2160
+ case 109:
2161
+ this.popState();
2162
+ return 62;
2163
+ break;
2164
+ case 110:
2165
+ this.pushState("text");
2166
+ return 62;
2167
+ break;
2168
+ case 111:
2169
+ this.popState();
2170
+ return 51;
2171
+ break;
2172
+ case 112:
2173
+ this.pushState("text");
2174
+ return 50;
2175
+ break;
2176
+ case 113:
2177
+ this.popState();
2178
+ return 31;
2179
+ break;
2180
+ case 114:
2181
+ this.pushState("text");
2182
+ return 29;
2183
+ break;
2184
+ case 115:
2185
+ this.popState();
2186
+ return 66;
2187
+ break;
2188
+ case 116:
2189
+ this.pushState("text");
2190
+ return 65;
2191
+ break;
2192
+ case 117:
2193
+ return "TEXT";
2194
+ break;
2195
+ case 118:
2196
+ return "QUOTE";
2197
+ break;
2198
+ case 119:
2199
+ return 9;
2200
+ break;
2201
+ case 120:
2202
+ return 10;
2203
+ break;
2204
+ case 121:
2205
+ return 11;
2206
+ break;
2207
+ }
2208
+ }, "anonymous"),
2209
+ 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)/, /^(?:$)/],
2210
+ conditions: { shapeDataEndBracket: { rules: [21, 24, 79, 82, 84, 86, 90, 92, 96, 97, 110, 112, 114, 116], inclusive: false }, shapeDataStr: { rules: [9, 10, 21, 24, 79, 82, 84, 86, 90, 92, 96, 97, 110, 112, 114, 116], inclusive: false }, shapeData: { rules: [8, 11, 12, 21, 24, 79, 82, 84, 86, 90, 92, 96, 97, 110, 112, 114, 116], inclusive: false }, callbackargs: { rules: [17, 18, 21, 24, 79, 82, 84, 86, 90, 92, 96, 97, 110, 112, 114, 116], inclusive: false }, callbackname: { rules: [14, 15, 16, 21, 24, 79, 82, 84, 86, 90, 92, 96, 97, 110, 112, 114, 116], inclusive: false }, href: { rules: [21, 24, 79, 82, 84, 86, 90, 92, 96, 97, 110, 112, 114, 116], inclusive: false }, click: { rules: [21, 24, 33, 34, 79, 82, 84, 86, 90, 92, 96, 97, 110, 112, 114, 116], inclusive: false }, dottedEdgeText: { rules: [21, 24, 76, 78, 79, 82, 84, 86, 90, 92, 96, 97, 110, 112, 114, 116], inclusive: false }, thickEdgeText: { rules: [21, 24, 73, 75, 79, 82, 84, 86, 90, 92, 96, 97, 110, 112, 114, 116], inclusive: false }, edgeText: { rules: [21, 24, 70, 72, 79, 82, 84, 86, 90, 92, 96, 97, 110, 112, 114, 116], inclusive: false }, trapText: { rules: [21, 24, 79, 82, 84, 86, 90, 92, 93, 94, 95, 96, 97, 110, 112, 114, 116], inclusive: false }, ellipseText: { rules: [21, 24, 79, 80, 81, 82, 84, 86, 90, 92, 96, 97, 110, 112, 114, 116], inclusive: false }, 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: false }, vertex: { rules: [21, 24, 79, 82, 84, 86, 90, 92, 96, 97, 110, 112, 114, 116], inclusive: false }, 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: false }, acc_descr_multiline: { rules: [5, 6, 21, 24, 79, 82, 84, 86, 90, 92, 96, 97, 110, 112, 114, 116], inclusive: false }, acc_descr: { rules: [3, 21, 24, 79, 82, 84, 86, 90, 92, 96, 97, 110, 112, 114, 116], inclusive: false }, acc_title: { rules: [1, 21, 24, 79, 82, 84, 86, 90, 92, 96, 97, 110, 112, 114, 116], inclusive: false }, md_string: { rules: [19, 20, 21, 24, 79, 82, 84, 86, 90, 92, 96, 97, 110, 112, 114, 116], inclusive: false }, string: { rules: [21, 22, 23, 24, 79, 82, 84, 86, 90, 92, 96, 97, 110, 112, 114, 116], inclusive: false }, 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: true } }
2211
+ };
2212
+ return lexer2;
2213
+ }();
2214
+ parser2.lexer = lexer;
2215
+ function Parser() {
2216
+ this.yy = {};
2217
+ }
2218
+ __name(Parser, "Parser");
2219
+ Parser.prototype = parser2;
2220
+ parser2.Parser = Parser;
2221
+ return new Parser;
2222
+ }();
2223
+ parser.parser = parser;
2224
+ var flow_default = parser;
2225
+ var newParser = Object.assign({}, flow_default);
2226
+ newParser.parse = (src) => {
2227
+ const newSrc = src.replace(/}\s*\n/g, `}
2228
+ `);
2229
+ return flow_default.parse(newSrc);
2230
+ };
2231
+ var flowParser_default = newParser;
2232
+ var fade = /* @__PURE__ */ __name((color, opacity) => {
2233
+ const channel2 = channel_default;
2234
+ const r = channel2(color, "r");
2235
+ const g = channel2(color, "g");
2236
+ const b = channel2(color, "b");
2237
+ return rgba_default(r, g, b, opacity);
2238
+ }, "fade");
2239
+ var getStyles = /* @__PURE__ */ __name((options) => `.label {
2240
+ font-family: ${options.fontFamily};
2241
+ color: ${options.nodeTextColor || options.textColor};
2242
+ }
2243
+ .cluster-label text {
2244
+ fill: ${options.titleColor};
2245
+ }
2246
+ .cluster-label span {
2247
+ color: ${options.titleColor};
2248
+ }
2249
+ .cluster-label span p {
2250
+ background-color: transparent;
2251
+ }
2252
+
2253
+ .label text,span {
2254
+ fill: ${options.nodeTextColor || options.textColor};
2255
+ color: ${options.nodeTextColor || options.textColor};
2256
+ }
2257
+
2258
+ .node rect,
2259
+ .node circle,
2260
+ .node ellipse,
2261
+ .node polygon,
2262
+ .node path {
2263
+ fill: ${options.mainBkg};
2264
+ stroke: ${options.nodeBorder};
2265
+ stroke-width: ${options.strokeWidth ?? 1}px;
2266
+ }
2267
+ .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label {
2268
+ text-anchor: middle;
2269
+ }
2270
+
2271
+ .node .katex path {
2272
+ fill: #000;
2273
+ stroke: #000;
2274
+ stroke-width: 1px;
2275
+ }
2276
+
2277
+ .rough-node .label,.node .label, .image-shape .label, .icon-shape .label {
2278
+ text-align: center;
2279
+ }
2280
+ .node.clickable {
2281
+ cursor: pointer;
2282
+ }
2283
+
2284
+
2285
+ .root .anchor path {
2286
+ fill: ${options.lineColor} !important;
2287
+ stroke-width: 0;
2288
+ stroke: ${options.lineColor};
2289
+ }
2290
+
2291
+ .arrowheadPath {
2292
+ fill: ${options.arrowheadColor};
2293
+ }
2294
+
2295
+ .edgePath .path {
2296
+ stroke: ${options.lineColor};
2297
+ stroke-width: ${options.strokeWidth ?? 2}px;
2298
+ }
2299
+
2300
+ .flowchart-link {
2301
+ stroke: ${options.lineColor};
2302
+ fill: none;
2303
+ }
2304
+
2305
+ .edgeLabel {
2306
+ background-color: ${options.edgeLabelBackground};
2307
+ p {
2308
+ background-color: ${options.edgeLabelBackground};
2309
+ }
2310
+ rect {
2311
+ opacity: 0.5;
2312
+ background-color: ${options.edgeLabelBackground};
2313
+ fill: ${options.edgeLabelBackground};
2314
+ }
2315
+ text-align: center;
2316
+ }
2317
+
2318
+ /* For html labels only */
2319
+ .labelBkg {
2320
+ background-color: ${fade(options.edgeLabelBackground, 0.5)};
2321
+ // background-color:
2322
+ }
2323
+
2324
+ .cluster rect {
2325
+ fill: ${options.clusterBkg};
2326
+ stroke: ${options.clusterBorder};
2327
+ stroke-width: 1px;
2328
+ }
2329
+
2330
+ .cluster text {
2331
+ fill: ${options.titleColor};
2332
+ }
2333
+
2334
+ .cluster span {
2335
+ color: ${options.titleColor};
2336
+ }
2337
+ /* .cluster div {
2338
+ color: ${options.titleColor};
2339
+ } */
2340
+
2341
+ div.mermaidTooltip {
2342
+ position: absolute;
2343
+ text-align: center;
2344
+ max-width: 200px;
2345
+ padding: 2px;
2346
+ font-family: ${options.fontFamily};
2347
+ font-size: 12px;
2348
+ background: ${options.tertiaryColor};
2349
+ border: 1px solid ${options.border2};
2350
+ border-radius: 2px;
2351
+ pointer-events: none;
2352
+ z-index: 100;
2353
+ }
2354
+
2355
+ .flowchartTitleText {
2356
+ text-anchor: middle;
2357
+ font-size: 18px;
2358
+ fill: ${options.textColor};
2359
+ }
2360
+
2361
+ rect.text {
2362
+ fill: none;
2363
+ stroke-width: 0;
2364
+ }
2365
+
2366
+ .icon-shape, .image-shape {
2367
+ background-color: ${options.edgeLabelBackground};
2368
+ p {
2369
+ background-color: ${options.edgeLabelBackground};
2370
+ padding: 2px;
2371
+ }
2372
+ .label rect {
2373
+ opacity: 0.5;
2374
+ background-color: ${options.edgeLabelBackground};
2375
+ fill: ${options.edgeLabelBackground};
2376
+ }
2377
+ text-align: center;
2378
+ }
2379
+ ${getIconStyles()}
2380
+ `, "getStyles");
2381
+ var styles_default = getStyles;
2382
+ var createFlowDiagram = /* @__PURE__ */ __name(({
2383
+ defaultLayout,
2384
+ styles = styles_default
2385
+ } = {}) => ({
2386
+ parser: flowParser_default,
2387
+ get db() {
2388
+ return new FlowDB;
2389
+ },
2390
+ renderer: flowRenderer_v3_unified_default,
2391
+ styles,
2392
+ init: /* @__PURE__ */ __name((cnf) => {
2393
+ if (!cnf.flowchart) {
2394
+ cnf.flowchart = {};
2395
+ }
2396
+ const layout = getUserDefinedConfig().layout ?? defaultLayout ?? cnf.layout;
2397
+ if (layout) {
2398
+ setConfig2({ layout });
2399
+ }
2400
+ cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
2401
+ setConfig2({ flowchart: { arrowMarkerAbsolute: cnf.arrowMarkerAbsolute } });
2402
+ }, "init")
2403
+ }), "createFlowDiagram");
2404
+ var diagram = createFlowDiagram();
2405
+
2406
+ export { styles_default, createFlowDiagram, diagram };