@altimateai/ui-components 0.0.77-beta.5 → 0.0.77-beta.7

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 (396) hide show
  1. package/dist/CoachForm.css +1 -1
  2. package/dist/CoachForm.js +60290 -20147
  3. package/dist/DbtDocsRenderer.js +1 -1
  4. package/dist/Stack.js +42 -41
  5. package/dist/Switch.js +1 -1
  6. package/dist/ToggleGroup.js +19 -19
  7. package/dist/_basePickBy.js +61 -61
  8. package/dist/_baseUniq.js +104 -104
  9. package/dist/abap.js +6 -0
  10. package/dist/actionscript-3.js +6 -0
  11. package/dist/ada.js +6 -0
  12. package/dist/andromeeda.js +4 -0
  13. package/dist/angular-html.js +32 -0
  14. package/dist/angular-ts.js +21 -0
  15. package/dist/apache.js +6 -0
  16. package/dist/apex.js +6 -0
  17. package/dist/apl.js +16 -0
  18. package/dist/applescript.js +6 -0
  19. package/dist/ara.js +6 -0
  20. package/dist/arc.js +49 -49
  21. package/dist/architectureDiagram-VXUJARFQ.js +480 -4315
  22. package/dist/architectureDiagram-VXUJARFQ2.js +831 -0
  23. package/dist/asciidoc.js +6 -0
  24. package/dist/asm.js +6 -0
  25. package/dist/assets/icons/index.js +1 -1
  26. package/dist/astro.js +18 -0
  27. package/dist/aurora-x.js +4 -0
  28. package/dist/awk.js +6 -0
  29. package/dist/ayu-dark.js +4 -0
  30. package/dist/ballerina.js +6 -0
  31. package/dist/band.js +46 -0
  32. package/dist/bat.js +6 -0
  33. package/dist/beancount.js +6 -0
  34. package/dist/berry.js +6 -0
  35. package/dist/bibtex.js +6 -0
  36. package/dist/bicep.js +6 -0
  37. package/dist/blade.js +20 -0
  38. package/dist/blockDiagram-VD42YOAC.js +1 -1
  39. package/dist/blockDiagram-VD42YOAC2.js +2266 -0
  40. package/dist/bsl.js +8 -0
  41. package/dist/c.js +6 -0
  42. package/dist/c3.js +6 -0
  43. package/dist/c4Diagram-YG6GDRKO2.js +1582 -0
  44. package/dist/cadence.js +6 -0
  45. package/dist/cairo.js +8 -0
  46. package/dist/catppuccin-frappe.js +4 -0
  47. package/dist/catppuccin-latte.js +4 -0
  48. package/dist/catppuccin-macchiato.js +4 -0
  49. package/dist/catppuccin-mocha.js +4 -0
  50. package/dist/channel.js +2 -2
  51. package/dist/chatbotV2/index.d.ts +31 -44
  52. package/dist/chatbotV2/index.js +76 -427
  53. package/dist/chunk-4BX2VUAB2.js +9 -0
  54. package/dist/chunk-55IACEB62.js +9 -0
  55. package/dist/chunk-B4BG7PRW.js +1 -1
  56. package/dist/chunk-B4BG7PRW2.js +1377 -0
  57. package/dist/chunk-DI55MBZ5.js +14 -14
  58. package/dist/chunk-DI55MBZ52.js +1382 -0
  59. package/dist/chunk-FMBD7UC42.js +19 -0
  60. package/dist/chunk-QN33PNHL2.js +20 -0
  61. package/dist/chunk-QZHKN3VN2.js +15 -0
  62. package/dist/chunk-TZMSLE5B.js +1 -1
  63. package/dist/chunk-TZMSLE5B2.js +64 -0
  64. package/dist/clarity.js +6 -0
  65. package/dist/classDiagram-2ON5EDUG2.js +17 -0
  66. package/dist/classDiagram-v2-WZHVMYZB2.js +17 -0
  67. package/dist/clojure.js +6 -0
  68. package/dist/cmake.js +6 -0
  69. package/dist/cobol.js +10 -0
  70. package/dist/code-block-37QAKDTI.js +27 -0
  71. package/dist/codeowners.js +6 -0
  72. package/dist/codeql.js +6 -0
  73. package/dist/coffee.js +8 -0
  74. package/dist/common-lisp.js +6 -0
  75. package/dist/coq.js +6 -0
  76. package/dist/cose-bilkent-S5V4N54A.js +160 -2535
  77. package/dist/cose-bilkent-S5V4N54A2.js +231 -0
  78. package/dist/cpp.js +18 -0
  79. package/dist/crystal.js +18 -0
  80. package/dist/csharp.js +6 -0
  81. package/dist/css.js +6 -0
  82. package/dist/csv.js +6 -0
  83. package/dist/cue.js +6 -0
  84. package/dist/cypher.js +6 -0
  85. package/dist/cytoscape-cose-bilkent.js +2380 -0
  86. package/dist/cytoscape-fcose.js +3840 -0
  87. package/dist/d.js +6 -0
  88. package/dist/dagre-6UL2VRFP.js +52 -52
  89. package/dist/dagre-6UL2VRFP2.js +447 -0
  90. package/dist/dark-plus.js +4 -0
  91. package/dist/dart.js +6 -0
  92. package/dist/dax.js +6 -0
  93. package/dist/dayjs.min.js +1 -1
  94. package/dist/defaultLocale.js +3 -3
  95. package/dist/desktop.js +6 -0
  96. package/dist/diagram-PSM6KHXK.js +198 -414
  97. package/dist/diagram-PSM6KHXK2.js +319 -0
  98. package/dist/diagram-QEK2KX5R.js +9 -9
  99. package/dist/diagram-QEK2KX5R2.js +221 -0
  100. package/dist/diagram-S2PKOQOG.js +7 -7
  101. package/dist/diagram-S2PKOQOG2.js +143 -0
  102. package/dist/diff.js +6 -0
  103. package/dist/docker.js +6 -0
  104. package/dist/dotenv.js +6 -0
  105. package/dist/dracula-soft.js +4 -0
  106. package/dist/dracula.js +4 -0
  107. package/dist/dream-maker.js +6 -0
  108. package/dist/edge.js +12 -0
  109. package/dist/elixir.js +8 -0
  110. package/dist/elm.js +8 -0
  111. package/dist/emacs-lisp.js +6 -0
  112. package/dist/erDiagram-Q2GNP2WA.js +12 -12
  113. package/dist/erDiagram-Q2GNP2WA2.js +843 -0
  114. package/dist/erb.js +10 -0
  115. package/dist/erlang.js +8 -0
  116. package/dist/everforest-dark.js +4 -0
  117. package/dist/everforest-light.js +4 -0
  118. package/dist/fennel.js +6 -0
  119. package/dist/fish.js +6 -0
  120. package/dist/flowDiagram-NV44I4VS.js +1 -1
  121. package/dist/flowDiagram-NV44I4VS2.js +1628 -0
  122. package/dist/fluent.js +6 -0
  123. package/dist/fortran-fixed-form.js +8 -0
  124. package/dist/fortran-free-form.js +6 -0
  125. package/dist/fsharp.js +8 -0
  126. package/dist/ganttDiagram-JELNMOA3.js +1788 -0
  127. package/dist/ganttDiagram-LVOFAZNH.js +851 -1726
  128. package/dist/gdresource.js +10 -0
  129. package/dist/gdscript.js +6 -0
  130. package/dist/gdshader.js +6 -0
  131. package/dist/genie.js +6 -0
  132. package/dist/gherkin.js +6 -0
  133. package/dist/git-commit.js +8 -0
  134. package/dist/git-rebase.js +8 -0
  135. package/dist/gitGraphDiagram-NY62KEGX.js +1 -1
  136. package/dist/gitGraphDiagram-NY62KEGX2.js +713 -0
  137. package/dist/github-dark-default.js +4 -0
  138. package/dist/github-dark-dimmed.js +4 -0
  139. package/dist/github-dark-high-contrast.js +4 -0
  140. package/dist/github-dark.js +4 -0
  141. package/dist/github-light-default.js +4 -0
  142. package/dist/github-light-high-contrast.js +4 -0
  143. package/dist/github-light.js +4 -0
  144. package/dist/gleam.js +6 -0
  145. package/dist/glimmer-js.js +14 -0
  146. package/dist/glimmer-ts.js +14 -0
  147. package/dist/glsl.js +8 -0
  148. package/dist/gn.js +6 -0
  149. package/dist/gnuplot.js +6 -0
  150. package/dist/go.js +6 -0
  151. package/dist/graph.js +13 -14
  152. package/dist/graph2.js +246 -0
  153. package/dist/graphql.js +14 -0
  154. package/dist/groovy.js +6 -0
  155. package/dist/gruvbox-dark-hard.js +4 -0
  156. package/dist/gruvbox-dark-medium.js +4 -0
  157. package/dist/gruvbox-dark-soft.js +4 -0
  158. package/dist/gruvbox-light-hard.js +4 -0
  159. package/dist/gruvbox-light-medium.js +4 -0
  160. package/dist/gruvbox-light-soft.js +4 -0
  161. package/dist/hack.js +10 -0
  162. package/dist/haml.js +10 -0
  163. package/dist/handlebars.js +14 -0
  164. package/dist/haskell.js +6 -0
  165. package/dist/haxe.js +6 -0
  166. package/dist/hcl.js +6 -0
  167. package/dist/hjson.js +6 -0
  168. package/dist/hlsl.js +6 -0
  169. package/dist/houston.js +4 -0
  170. package/dist/html-derivative.js +8 -0
  171. package/dist/html.js +10 -0
  172. package/dist/http.js +14 -0
  173. package/dist/hurl.js +12 -0
  174. package/dist/hxml.js +8 -0
  175. package/dist/hy.js +6 -0
  176. package/dist/imba.js +6 -0
  177. package/dist/index.css +1 -1
  178. package/dist/index.d.ts +101 -14
  179. package/dist/index.js +38 -39
  180. package/dist/index2.js +216 -684
  181. package/dist/index3.js +689 -0
  182. package/dist/infoDiagram-F6ZHWCRC.js +1 -1
  183. package/dist/infoDiagram-WHAUD3N6.js +24 -0
  184. package/dist/ini.js +6 -0
  185. package/dist/java.js +6 -0
  186. package/dist/javascript.js +6 -0
  187. package/dist/jinja.js +11 -0
  188. package/dist/jison.js +8 -0
  189. package/dist/journeyDiagram-XKPGCS4Q2.js +837 -0
  190. package/dist/json.js +6 -0
  191. package/dist/json5.js +6 -0
  192. package/dist/jsonc.js +6 -0
  193. package/dist/jsonl.js +6 -0
  194. package/dist/jsonnet.js +6 -0
  195. package/dist/jssm.js +6 -0
  196. package/dist/jsx.js +6 -0
  197. package/dist/julia.js +16 -0
  198. package/dist/kanagawa-dragon.js +4 -0
  199. package/dist/kanagawa-lotus.js +4 -0
  200. package/dist/kanagawa-wave.js +4 -0
  201. package/dist/kanban-definition-3W4ZIXB7.js +26 -26
  202. package/dist/kanban-definition-3W4ZIXB72.js +720 -0
  203. package/dist/katex2.js +11691 -0
  204. package/dist/kdl.js +6 -0
  205. package/dist/kotlin.js +6 -0
  206. package/dist/kusto.js +6 -0
  207. package/dist/laserwave.js +4 -0
  208. package/dist/latex.js +8 -0
  209. package/dist/layout.js +567 -678
  210. package/dist/layout2.js +1224 -0
  211. package/dist/lean.js +6 -0
  212. package/dist/less.js +6 -0
  213. package/dist/light-plus.js +4 -0
  214. package/dist/lineage/index.js +1066 -1073
  215. package/dist/linear.js +1 -1
  216. package/dist/liquid.js +14 -0
  217. package/dist/llvm.js +6 -0
  218. package/dist/log.js +6 -0
  219. package/dist/logo.js +6 -0
  220. package/dist/lua.js +8 -0
  221. package/dist/luau.js +6 -0
  222. package/dist/main.css +1 -1
  223. package/dist/main.js +152 -152
  224. package/dist/make.js +6 -0
  225. package/dist/markdown.js +6 -0
  226. package/dist/marko.js +14 -0
  227. package/dist/material-theme-darker.js +4 -0
  228. package/dist/material-theme-lighter.js +4 -0
  229. package/dist/material-theme-ocean.js +4 -0
  230. package/dist/material-theme-palenight.js +4 -0
  231. package/dist/material-theme.js +4 -0
  232. package/dist/matlab.js +6 -0
  233. package/dist/mdc.js +12 -0
  234. package/dist/mdx.js +6 -0
  235. package/dist/mermaid-4DMBBIKO.js +4 -0
  236. package/dist/mermaid-parser.core.js +155 -155
  237. package/dist/mermaid.js +6 -0
  238. package/dist/min-dark.js +4 -0
  239. package/dist/min-light.js +4 -0
  240. package/dist/mindmap-definition-VGOIOE7T.js +39 -39
  241. package/dist/mindmap-definition-VGOIOE7T2.js +786 -0
  242. package/dist/mipsasm.js +6 -0
  243. package/dist/mojo.js +6 -0
  244. package/dist/monokai.js +4 -0
  245. package/dist/moonbit.js +6 -0
  246. package/dist/move.js +6 -0
  247. package/dist/narrat.js +6 -0
  248. package/dist/nextflow.js +6 -0
  249. package/dist/nginx.js +8 -0
  250. package/dist/night-owl.js +4 -0
  251. package/dist/nim.js +20 -0
  252. package/dist/nix.js +9 -0
  253. package/dist/nord.js +4 -0
  254. package/dist/nushell.js +6 -0
  255. package/dist/objective-c.js +6 -0
  256. package/dist/objective-cpp.js +6 -0
  257. package/dist/ocaml.js +6 -0
  258. package/dist/one-dark-pro.js +4 -0
  259. package/dist/one-light.js +4 -0
  260. package/dist/openscad.js +6 -0
  261. package/dist/pascal.js +6 -0
  262. package/dist/perl.js +16 -0
  263. package/dist/php.js +18 -0
  264. package/dist/pie.js +45 -0
  265. package/dist/pieDiagram-ADFJNKIX.js +68 -108
  266. package/dist/pieDiagram-ADFJNKIX2.js +123 -0
  267. package/dist/pkl.js +6 -0
  268. package/dist/plastic.js +4 -0
  269. package/dist/plsql.js +6 -0
  270. package/dist/po.js +6 -0
  271. package/dist/poimandres.js +4 -0
  272. package/dist/polar.js +6 -0
  273. package/dist/postcss.js +6 -0
  274. package/dist/powerquery.js +6 -0
  275. package/dist/powershell.js +6 -0
  276. package/dist/prisma.js +6 -0
  277. package/dist/prolog.js +6 -0
  278. package/dist/proto.js +6 -0
  279. package/dist/pug.js +12 -0
  280. package/dist/puppet.js +6 -0
  281. package/dist/purescript.js +6 -0
  282. package/dist/python.js +6 -0
  283. package/dist/qml.js +8 -0
  284. package/dist/qmldir.js +6 -0
  285. package/dist/qss.js +6 -0
  286. package/dist/quadrantDiagram-AYHSOK5B.js +1 -1
  287. package/dist/quadrantDiagram-AYHSOK5B2.js +1025 -0
  288. package/dist/r.js +6 -0
  289. package/dist/racket.js +6 -0
  290. package/dist/raku.js +6 -0
  291. package/dist/razor.js +10 -0
  292. package/dist/red.js +4 -0
  293. package/dist/redux-toolkit.modern.js +563 -555
  294. package/dist/reg.js +6 -0
  295. package/dist/regexp.js +6 -0
  296. package/dist/rel.js +6 -0
  297. package/dist/requirementDiagram-UZGBJVZJ.js +14 -14
  298. package/dist/requirementDiagram-UZGBJVZJ2.js +852 -0
  299. package/dist/riscv.js +6 -0
  300. package/dist/rose-pine-dawn.js +4 -0
  301. package/dist/rose-pine-moon.js +4 -0
  302. package/dist/rose-pine.js +4 -0
  303. package/dist/rosmsg.js +6 -0
  304. package/dist/rst.js +22 -0
  305. package/dist/ruby.js +30 -0
  306. package/dist/rust.js +6 -0
  307. package/dist/sankeyDiagram-TZEHDZUN.js +229 -622
  308. package/dist/sankeyDiagram-TZEHDZUN2.js +418 -0
  309. package/dist/sankeyLinkHorizontal.js +403 -0
  310. package/dist/sas.js +8 -0
  311. package/dist/sass.js +6 -0
  312. package/dist/scala.js +6 -0
  313. package/dist/scheme.js +6 -0
  314. package/dist/scss.js +8 -0
  315. package/dist/sdbl.js +6 -0
  316. package/dist/sequenceDiagram-WL72ISMW.js +28 -28
  317. package/dist/sequenceDiagram-WL72ISMW2.js +2523 -0
  318. package/dist/shadcn/index.js +3508 -3121
  319. package/dist/shaderlab.js +8 -0
  320. package/dist/shellscript.js +6 -0
  321. package/dist/shellsession.js +8 -0
  322. package/dist/slack-dark.js +4 -0
  323. package/dist/slack-ochin.js +4 -0
  324. package/dist/smalltalk.js +6 -0
  325. package/dist/snazzy-light.js +4 -0
  326. package/dist/solarized-dark.js +4 -0
  327. package/dist/solarized-light.js +4 -0
  328. package/dist/solidity.js +6 -0
  329. package/dist/soy.js +8 -0
  330. package/dist/sparql.js +8 -0
  331. package/dist/splunk.js +6 -0
  332. package/dist/sql.js +6 -0
  333. package/dist/ssh-config.js +6 -0
  334. package/dist/stata.js +8 -0
  335. package/dist/stateDiagram-FKZM4ZOC.js +15 -15
  336. package/dist/stateDiagram-FKZM4ZOC2.js +264 -0
  337. package/dist/stateDiagram-v2-4FDKWEC32.js +17 -0
  338. package/dist/stylus.js +6 -0
  339. package/dist/svelte.js +14 -0
  340. package/dist/swift.js +6 -0
  341. package/dist/synthwave-84.js +4 -0
  342. package/dist/system-verilog.js +6 -0
  343. package/dist/systemd.js +6 -0
  344. package/dist/talonscript.js +6 -0
  345. package/dist/tasl.js +6 -0
  346. package/dist/tcl.js +6 -0
  347. package/dist/templ.js +12 -0
  348. package/dist/terraform.js +6 -0
  349. package/dist/tex.js +8 -0
  350. package/dist/time.js +900 -0
  351. package/dist/timeline-definition-IT6M3QCI.js +71 -71
  352. package/dist/timeline-definition-IT6M3QCI2.js +802 -0
  353. package/dist/tokyo-night.js +4 -0
  354. package/dist/toml.js +6 -0
  355. package/dist/ts-tags.js +41 -0
  356. package/dist/tsv.js +6 -0
  357. package/dist/tsx.js +6 -0
  358. package/dist/turtle.js +6 -0
  359. package/dist/twig.js +18 -0
  360. package/dist/{types-ByRPUpXR.d.ts → types-UHJCpYj0.d.ts} +25 -116
  361. package/dist/typescript.js +6 -0
  362. package/dist/typespec.js +6 -0
  363. package/dist/typst.js +6 -0
  364. package/dist/union.js +8 -0
  365. package/dist/v.js +6 -0
  366. package/dist/vala.js +6 -0
  367. package/dist/vb.js +6 -0
  368. package/dist/verilog.js +6 -0
  369. package/dist/vesper.js +4 -0
  370. package/dist/vhdl.js +6 -0
  371. package/dist/viml.js +6 -0
  372. package/dist/vitesse-black.js +4 -0
  373. package/dist/vitesse-dark.js +4 -0
  374. package/dist/vitesse-light.js +4 -0
  375. package/dist/vue-html.js +8 -0
  376. package/dist/vue-vine.js +18 -0
  377. package/dist/vue.js +31 -0
  378. package/dist/vyper.js +6 -0
  379. package/dist/wasm.js +7 -0
  380. package/dist/wasm2.js +6 -0
  381. package/dist/wenyan.js +6 -0
  382. package/dist/wgsl.js +6 -0
  383. package/dist/wikitext.js +6 -0
  384. package/dist/wit.js +6 -0
  385. package/dist/wolfram.js +6 -0
  386. package/dist/xml.js +8 -0
  387. package/dist/xsl.js +8 -0
  388. package/dist/xychartDiagram-PRI3JC2R.js +447 -489
  389. package/dist/xychartDiagram-PRI3JC2R2.js +1299 -0
  390. package/dist/yaml.js +6 -0
  391. package/dist/zenscript.js +6 -0
  392. package/dist/zig.js +6 -0
  393. package/dist/zipObject.js +128 -0
  394. package/package.json +1 -1
  395. package/dist/Accordion.js +0 -402
  396. package/dist/index2.css +0 -1
@@ -0,0 +1,2266 @@
1
+ import { g as de } from "./chunk-FMBD7UC42.js";
2
+ import { aG as d, aM as z, aS as m, aR as yt, bs as ge, b8 as st, bt as Z, bu as Ht, bv as ue, a$ as et, bw as pe, N as fe, bi as xe, aT as ye, b0 as be, A as we, T as me, bx as Le, by as bt, aO as Se } from "./CoachForm.js";
3
+ import { c as ve } from "./clone.js";
4
+ import { s as R } from "./redux-toolkit.modern.js";
5
+ import { G as Ee } from "./graph2.js";
6
+ import { c as _e } from "./channel.js";
7
+ var wt = function() {
8
+ var e = /* @__PURE__ */ d(function(T, x, g, p) {
9
+ for (g = g || {}, p = T.length; p--; g[T[p]] = x) ;
10
+ return g;
11
+ }, "o"), t = [1, 15], a = [1, 7], i = [1, 13], l = [1, 14], s = [1, 19], r = [1, 16], n = [1, 17], o = [1, 18], u = [8, 30], h = [8, 10, 21, 28, 29, 30, 31, 39, 43, 46], y = [1, 23], b = [1, 24], L = [8, 10, 15, 16, 21, 28, 29, 30, 31, 39, 43, 46], E = [8, 10, 15, 16, 21, 27, 28, 29, 30, 31, 39, 43, 46], D = [1, 49], v = {
12
+ trace: /* @__PURE__ */ d(function() {
13
+ }, "trace"),
14
+ yy: {},
15
+ symbols_: { error: 2, spaceLines: 3, SPACELINE: 4, NL: 5, separator: 6, SPACE: 7, EOF: 8, start: 9, BLOCK_DIAGRAM_KEY: 10, document: 11, stop: 12, statement: 13, link: 14, LINK: 15, START_LINK: 16, LINK_LABEL: 17, STR: 18, nodeStatement: 19, columnsStatement: 20, SPACE_BLOCK: 21, blockStatement: 22, classDefStatement: 23, cssClassStatement: 24, styleStatement: 25, node: 26, SIZE: 27, COLUMNS: 28, "id-block": 29, end: 30, NODE_ID: 31, nodeShapeNLabel: 32, dirList: 33, DIR: 34, NODE_DSTART: 35, NODE_DEND: 36, BLOCK_ARROW_START: 37, BLOCK_ARROW_END: 38, classDef: 39, CLASSDEF_ID: 40, CLASSDEF_STYLEOPTS: 41, DEFAULT: 42, class: 43, CLASSENTITY_IDS: 44, STYLECLASS: 45, style: 46, STYLE_ENTITY_IDS: 47, STYLE_DEFINITION_DATA: 48, $accept: 0, $end: 1 },
16
+ terminals_: { 2: "error", 4: "SPACELINE", 5: "NL", 7: "SPACE", 8: "EOF", 10: "BLOCK_DIAGRAM_KEY", 15: "LINK", 16: "START_LINK", 17: "LINK_LABEL", 18: "STR", 21: "SPACE_BLOCK", 27: "SIZE", 28: "COLUMNS", 29: "id-block", 30: "end", 31: "NODE_ID", 34: "DIR", 35: "NODE_DSTART", 36: "NODE_DEND", 37: "BLOCK_ARROW_START", 38: "BLOCK_ARROW_END", 39: "classDef", 40: "CLASSDEF_ID", 41: "CLASSDEF_STYLEOPTS", 42: "DEFAULT", 43: "class", 44: "CLASSENTITY_IDS", 45: "STYLECLASS", 46: "style", 47: "STYLE_ENTITY_IDS", 48: "STYLE_DEFINITION_DATA" },
17
+ productions_: [0, [3, 1], [3, 2], [3, 2], [6, 1], [6, 1], [6, 1], [9, 3], [12, 1], [12, 1], [12, 2], [12, 2], [11, 1], [11, 2], [14, 1], [14, 4], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [19, 3], [19, 2], [19, 1], [20, 1], [22, 4], [22, 3], [26, 1], [26, 2], [33, 1], [33, 2], [32, 3], [32, 4], [23, 3], [23, 3], [24, 3], [25, 3]],
18
+ performAction: /* @__PURE__ */ d(function(x, g, p, w, S, c, _) {
19
+ var f = c.length - 1;
20
+ switch (S) {
21
+ case 4:
22
+ w.getLogger().debug("Rule: separator (NL) ");
23
+ break;
24
+ case 5:
25
+ w.getLogger().debug("Rule: separator (Space) ");
26
+ break;
27
+ case 6:
28
+ w.getLogger().debug("Rule: separator (EOF) ");
29
+ break;
30
+ case 7:
31
+ w.getLogger().debug("Rule: hierarchy: ", c[f - 1]), w.setHierarchy(c[f - 1]);
32
+ break;
33
+ case 8:
34
+ w.getLogger().debug("Stop NL ");
35
+ break;
36
+ case 9:
37
+ w.getLogger().debug("Stop EOF ");
38
+ break;
39
+ case 10:
40
+ w.getLogger().debug("Stop NL2 ");
41
+ break;
42
+ case 11:
43
+ w.getLogger().debug("Stop EOF2 ");
44
+ break;
45
+ case 12:
46
+ w.getLogger().debug("Rule: statement: ", c[f]), typeof c[f].length == "number" ? this.$ = c[f] : this.$ = [c[f]];
47
+ break;
48
+ case 13:
49
+ w.getLogger().debug("Rule: statement #2: ", c[f - 1]), this.$ = [c[f - 1]].concat(c[f]);
50
+ break;
51
+ case 14:
52
+ w.getLogger().debug("Rule: link: ", c[f], x), this.$ = { edgeTypeStr: c[f], label: "" };
53
+ break;
54
+ case 15:
55
+ w.getLogger().debug("Rule: LABEL link: ", c[f - 3], c[f - 1], c[f]), this.$ = { edgeTypeStr: c[f], label: c[f - 1] };
56
+ break;
57
+ case 18:
58
+ const A = parseInt(c[f]), O = w.generateId();
59
+ this.$ = { id: O, type: "space", label: "", width: A, children: [] };
60
+ break;
61
+ case 23:
62
+ w.getLogger().debug("Rule: (nodeStatement link node) ", c[f - 2], c[f - 1], c[f], " typestr: ", c[f - 1].edgeTypeStr);
63
+ const X = w.edgeStrToEdgeData(c[f - 1].edgeTypeStr);
64
+ this.$ = [
65
+ { id: c[f - 2].id, label: c[f - 2].label, type: c[f - 2].type, directions: c[f - 2].directions },
66
+ { id: c[f - 2].id + "-" + c[f].id, start: c[f - 2].id, end: c[f].id, label: c[f - 1].label, type: "edge", directions: c[f].directions, arrowTypeEnd: X, arrowTypeStart: "arrow_open" },
67
+ { id: c[f].id, label: c[f].label, type: w.typeStr2Type(c[f].typeStr), directions: c[f].directions }
68
+ ];
69
+ break;
70
+ case 24:
71
+ w.getLogger().debug("Rule: nodeStatement (abc88 node size) ", c[f - 1], c[f]), this.$ = { id: c[f - 1].id, label: c[f - 1].label, type: w.typeStr2Type(c[f - 1].typeStr), directions: c[f - 1].directions, widthInColumns: parseInt(c[f], 10) };
72
+ break;
73
+ case 25:
74
+ w.getLogger().debug("Rule: nodeStatement (node) ", c[f]), this.$ = { id: c[f].id, label: c[f].label, type: w.typeStr2Type(c[f].typeStr), directions: c[f].directions, widthInColumns: 1 };
75
+ break;
76
+ case 26:
77
+ w.getLogger().debug("APA123", this ? this : "na"), w.getLogger().debug("COLUMNS: ", c[f]), this.$ = { type: "column-setting", columns: c[f] === "auto" ? -1 : parseInt(c[f]) };
78
+ break;
79
+ case 27:
80
+ w.getLogger().debug("Rule: id-block statement : ", c[f - 2], c[f - 1]), w.generateId(), this.$ = { ...c[f - 2], type: "composite", children: c[f - 1] };
81
+ break;
82
+ case 28:
83
+ w.getLogger().debug("Rule: blockStatement : ", c[f - 2], c[f - 1], c[f]);
84
+ const P = w.generateId();
85
+ this.$ = { id: P, type: "composite", label: "", children: c[f - 1] };
86
+ break;
87
+ case 29:
88
+ w.getLogger().debug("Rule: node (NODE_ID separator): ", c[f]), this.$ = { id: c[f] };
89
+ break;
90
+ case 30:
91
+ w.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ", c[f - 1], c[f]), this.$ = { id: c[f - 1], label: c[f].label, typeStr: c[f].typeStr, directions: c[f].directions };
92
+ break;
93
+ case 31:
94
+ w.getLogger().debug("Rule: dirList: ", c[f]), this.$ = [c[f]];
95
+ break;
96
+ case 32:
97
+ w.getLogger().debug("Rule: dirList: ", c[f - 1], c[f]), this.$ = [c[f - 1]].concat(c[f]);
98
+ break;
99
+ case 33:
100
+ w.getLogger().debug("Rule: nodeShapeNLabel: ", c[f - 2], c[f - 1], c[f]), this.$ = { typeStr: c[f - 2] + c[f], label: c[f - 1] };
101
+ break;
102
+ case 34:
103
+ w.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ", c[f - 3], c[f - 2], " #3:", c[f - 1], c[f]), this.$ = { typeStr: c[f - 3] + c[f], label: c[f - 2], directions: c[f - 1] };
104
+ break;
105
+ case 35:
106
+ case 36:
107
+ this.$ = { type: "classDef", id: c[f - 1].trim(), css: c[f].trim() };
108
+ break;
109
+ case 37:
110
+ this.$ = { type: "applyClass", id: c[f - 1].trim(), styleClass: c[f].trim() };
111
+ break;
112
+ case 38:
113
+ this.$ = { type: "applyStyles", id: c[f - 1].trim(), stylesStr: c[f].trim() };
114
+ break;
115
+ }
116
+ }, "anonymous"),
117
+ table: [{ 9: 1, 10: [1, 2] }, { 1: [3] }, { 10: t, 11: 3, 13: 4, 19: 5, 20: 6, 21: a, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: i, 29: l, 31: s, 39: r, 43: n, 46: o }, { 8: [1, 20] }, e(u, [2, 12], { 13: 4, 19: 5, 20: 6, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 11: 21, 10: t, 21: a, 28: i, 29: l, 31: s, 39: r, 43: n, 46: o }), e(h, [2, 16], { 14: 22, 15: y, 16: b }), e(h, [2, 17]), e(h, [2, 18]), e(h, [2, 19]), e(h, [2, 20]), e(h, [2, 21]), e(h, [2, 22]), e(L, [2, 25], { 27: [1, 25] }), e(h, [2, 26]), { 19: 26, 26: 12, 31: s }, { 10: t, 11: 27, 13: 4, 19: 5, 20: 6, 21: a, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: i, 29: l, 31: s, 39: r, 43: n, 46: o }, { 40: [1, 28], 42: [1, 29] }, { 44: [1, 30] }, { 47: [1, 31] }, e(E, [2, 29], { 32: 32, 35: [1, 33], 37: [1, 34] }), { 1: [2, 7] }, e(u, [2, 13]), { 26: 35, 31: s }, { 31: [2, 14] }, { 17: [1, 36] }, e(L, [2, 24]), { 10: t, 11: 37, 13: 4, 14: 22, 15: y, 16: b, 19: 5, 20: 6, 21: a, 22: 8, 23: 9, 24: 10, 25: 11, 26: 12, 28: i, 29: l, 31: s, 39: r, 43: n, 46: o }, { 30: [1, 38] }, { 41: [1, 39] }, { 41: [1, 40] }, { 45: [1, 41] }, { 48: [1, 42] }, e(E, [2, 30]), { 18: [1, 43] }, { 18: [1, 44] }, e(L, [2, 23]), { 18: [1, 45] }, { 30: [1, 46] }, e(h, [2, 28]), e(h, [2, 35]), e(h, [2, 36]), e(h, [2, 37]), e(h, [2, 38]), { 36: [1, 47] }, { 33: 48, 34: D }, { 15: [1, 50] }, e(h, [2, 27]), e(E, [2, 33]), { 38: [1, 51] }, { 33: 52, 34: D, 38: [2, 31] }, { 31: [2, 15] }, e(E, [2, 34]), { 38: [2, 32] }],
118
+ defaultActions: { 20: [2, 7], 23: [2, 14], 50: [2, 15], 52: [2, 32] },
119
+ parseError: /* @__PURE__ */ d(function(x, g) {
120
+ if (g.recoverable)
121
+ this.trace(x);
122
+ else {
123
+ var p = new Error(x);
124
+ throw p.hash = g, p;
125
+ }
126
+ }, "parseError"),
127
+ parse: /* @__PURE__ */ d(function(x) {
128
+ var g = this, p = [0], w = [], S = [null], c = [], _ = this.table, f = "", A = 0, O = 0, X = 2, P = 1, J = c.slice.call(arguments, 1), M = Object.create(this.lexer), Q = { yy: {} };
129
+ for (var ut in this.yy)
130
+ Object.prototype.hasOwnProperty.call(this.yy, ut) && (Q.yy[ut] = this.yy[ut]);
131
+ M.setInput(x, Q.yy), Q.yy.lexer = M, Q.yy.parser = this, typeof M.yylloc > "u" && (M.yylloc = {});
132
+ var pt = M.yylloc;
133
+ c.push(pt);
134
+ var oe = M.options && M.options.ranges;
135
+ typeof Q.yy.parseError == "function" ? this.parseError = Q.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
136
+ function he(H) {
137
+ p.length = p.length - 2 * H, S.length = S.length - H, c.length = c.length - H;
138
+ }
139
+ d(he, "popStack");
140
+ function Nt() {
141
+ var H;
142
+ return H = w.pop() || M.lex() || P, typeof H != "number" && (H instanceof Array && (w = H, H = w.pop()), H = g.symbols_[H] || H), H;
143
+ }
144
+ d(Nt, "lex");
145
+ for (var Y, $, U, ft, tt = {}, it, q, Ct, nt; ; ) {
146
+ if ($ = p[p.length - 1], this.defaultActions[$] ? U = this.defaultActions[$] : ((Y === null || typeof Y > "u") && (Y = Nt()), U = _[$] && _[$][Y]), typeof U > "u" || !U.length || !U[0]) {
147
+ var xt = "";
148
+ nt = [];
149
+ for (it in _[$])
150
+ this.terminals_[it] && it > X && nt.push("'" + this.terminals_[it] + "'");
151
+ M.showPosition ? xt = "Parse error on line " + (A + 1) + `:
152
+ ` + M.showPosition() + `
153
+ Expecting ` + nt.join(", ") + ", got '" + (this.terminals_[Y] || Y) + "'" : xt = "Parse error on line " + (A + 1) + ": Unexpected " + (Y == P ? "end of input" : "'" + (this.terminals_[Y] || Y) + "'"), this.parseError(xt, {
154
+ text: M.match,
155
+ token: this.terminals_[Y] || Y,
156
+ line: M.yylineno,
157
+ loc: pt,
158
+ expected: nt
159
+ });
160
+ }
161
+ if (U[0] instanceof Array && U.length > 1)
162
+ throw new Error("Parse Error: multiple actions possible at state: " + $ + ", token: " + Y);
163
+ switch (U[0]) {
164
+ case 1:
165
+ p.push(Y), S.push(M.yytext), c.push(M.yylloc), p.push(U[1]), Y = null, O = M.yyleng, f = M.yytext, A = M.yylineno, pt = M.yylloc;
166
+ break;
167
+ case 2:
168
+ if (q = this.productions_[U[1]][1], tt.$ = S[S.length - q], tt._$ = {
169
+ first_line: c[c.length - (q || 1)].first_line,
170
+ last_line: c[c.length - 1].last_line,
171
+ first_column: c[c.length - (q || 1)].first_column,
172
+ last_column: c[c.length - 1].last_column
173
+ }, oe && (tt._$.range = [
174
+ c[c.length - (q || 1)].range[0],
175
+ c[c.length - 1].range[1]
176
+ ]), ft = this.performAction.apply(tt, [
177
+ f,
178
+ O,
179
+ A,
180
+ Q.yy,
181
+ U[1],
182
+ S,
183
+ c
184
+ ].concat(J)), typeof ft < "u")
185
+ return ft;
186
+ q && (p = p.slice(0, -1 * q * 2), S = S.slice(0, -1 * q), c = c.slice(0, -1 * q)), p.push(this.productions_[U[1]][0]), S.push(tt.$), c.push(tt._$), Ct = _[p[p.length - 2]][p[p.length - 1]], p.push(Ct);
187
+ break;
188
+ case 3:
189
+ return !0;
190
+ }
191
+ }
192
+ return !0;
193
+ }, "parse")
194
+ }, N = /* @__PURE__ */ function() {
195
+ var T = {
196
+ EOF: 1,
197
+ parseError: /* @__PURE__ */ d(function(g, p) {
198
+ if (this.yy.parser)
199
+ this.yy.parser.parseError(g, p);
200
+ else
201
+ throw new Error(g);
202
+ }, "parseError"),
203
+ // resets the lexer, sets new input
204
+ setInput: /* @__PURE__ */ d(function(x, g) {
205
+ return this.yy = g || this.yy || {}, this._input = x, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
206
+ first_line: 1,
207
+ first_column: 0,
208
+ last_line: 1,
209
+ last_column: 0
210
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
211
+ }, "setInput"),
212
+ // consumes and returns one char from the input
213
+ input: /* @__PURE__ */ d(function() {
214
+ var x = this._input[0];
215
+ this.yytext += x, this.yyleng++, this.offset++, this.match += x, this.matched += x;
216
+ var g = x.match(/(?:\r\n?|\n).*/g);
217
+ return g ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), x;
218
+ }, "input"),
219
+ // unshifts one char (or a string) into the input
220
+ unput: /* @__PURE__ */ d(function(x) {
221
+ var g = x.length, p = x.split(/(?:\r\n?|\n)/g);
222
+ this._input = x + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - g), this.offset -= g;
223
+ var w = this.match.split(/(?:\r\n?|\n)/g);
224
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), p.length - 1 && (this.yylineno -= p.length - 1);
225
+ var S = this.yylloc.range;
226
+ return this.yylloc = {
227
+ first_line: this.yylloc.first_line,
228
+ last_line: this.yylineno + 1,
229
+ first_column: this.yylloc.first_column,
230
+ last_column: p ? (p.length === w.length ? this.yylloc.first_column : 0) + w[w.length - p.length].length - p[0].length : this.yylloc.first_column - g
231
+ }, this.options.ranges && (this.yylloc.range = [S[0], S[0] + this.yyleng - g]), this.yyleng = this.yytext.length, this;
232
+ }, "unput"),
233
+ // When called from action, caches matched text and appends it on next action
234
+ more: /* @__PURE__ */ d(function() {
235
+ return this._more = !0, this;
236
+ }, "more"),
237
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
238
+ reject: /* @__PURE__ */ d(function() {
239
+ if (this.options.backtrack_lexer)
240
+ this._backtrack = !0;
241
+ else
242
+ 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).
243
+ ` + this.showPosition(), {
244
+ text: "",
245
+ token: null,
246
+ line: this.yylineno
247
+ });
248
+ return this;
249
+ }, "reject"),
250
+ // retain first n characters of the match
251
+ less: /* @__PURE__ */ d(function(x) {
252
+ this.unput(this.match.slice(x));
253
+ }, "less"),
254
+ // displays already matched input, i.e. for error messages
255
+ pastInput: /* @__PURE__ */ d(function() {
256
+ var x = this.matched.substr(0, this.matched.length - this.match.length);
257
+ return (x.length > 20 ? "..." : "") + x.substr(-20).replace(/\n/g, "");
258
+ }, "pastInput"),
259
+ // displays upcoming input, i.e. for error messages
260
+ upcomingInput: /* @__PURE__ */ d(function() {
261
+ var x = this.match;
262
+ return x.length < 20 && (x += this._input.substr(0, 20 - x.length)), (x.substr(0, 20) + (x.length > 20 ? "..." : "")).replace(/\n/g, "");
263
+ }, "upcomingInput"),
264
+ // displays the character position where the lexing error occurred, i.e. for error messages
265
+ showPosition: /* @__PURE__ */ d(function() {
266
+ var x = this.pastInput(), g = new Array(x.length + 1).join("-");
267
+ return x + this.upcomingInput() + `
268
+ ` + g + "^";
269
+ }, "showPosition"),
270
+ // test the lexed token: return FALSE when not a match, otherwise return token
271
+ test_match: /* @__PURE__ */ d(function(x, g) {
272
+ var p, w, S;
273
+ if (this.options.backtrack_lexer && (S = {
274
+ yylineno: this.yylineno,
275
+ yylloc: {
276
+ first_line: this.yylloc.first_line,
277
+ last_line: this.last_line,
278
+ first_column: this.yylloc.first_column,
279
+ last_column: this.yylloc.last_column
280
+ },
281
+ yytext: this.yytext,
282
+ match: this.match,
283
+ matches: this.matches,
284
+ matched: this.matched,
285
+ yyleng: this.yyleng,
286
+ offset: this.offset,
287
+ _more: this._more,
288
+ _input: this._input,
289
+ yy: this.yy,
290
+ conditionStack: this.conditionStack.slice(0),
291
+ done: this.done
292
+ }, this.options.ranges && (S.yylloc.range = this.yylloc.range.slice(0))), w = x[0].match(/(?:\r\n?|\n).*/g), w && (this.yylineno += w.length), this.yylloc = {
293
+ first_line: this.yylloc.last_line,
294
+ last_line: this.yylineno + 1,
295
+ first_column: this.yylloc.last_column,
296
+ last_column: w ? w[w.length - 1].length - w[w.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + x[0].length
297
+ }, this.yytext += x[0], this.match += x[0], this.matches = x, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(x[0].length), this.matched += x[0], p = this.performAction.call(this, this.yy, this, g, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), p)
298
+ return p;
299
+ if (this._backtrack) {
300
+ for (var c in S)
301
+ this[c] = S[c];
302
+ return !1;
303
+ }
304
+ return !1;
305
+ }, "test_match"),
306
+ // return next match in input
307
+ next: /* @__PURE__ */ d(function() {
308
+ if (this.done)
309
+ return this.EOF;
310
+ this._input || (this.done = !0);
311
+ var x, g, p, w;
312
+ this._more || (this.yytext = "", this.match = "");
313
+ for (var S = this._currentRules(), c = 0; c < S.length; c++)
314
+ if (p = this._input.match(this.rules[S[c]]), p && (!g || p[0].length > g[0].length)) {
315
+ if (g = p, w = c, this.options.backtrack_lexer) {
316
+ if (x = this.test_match(p, S[c]), x !== !1)
317
+ return x;
318
+ if (this._backtrack) {
319
+ g = !1;
320
+ continue;
321
+ } else
322
+ return !1;
323
+ } else if (!this.options.flex)
324
+ break;
325
+ }
326
+ return g ? (x = this.test_match(g, S[w]), x !== !1 ? x : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
327
+ ` + this.showPosition(), {
328
+ text: "",
329
+ token: null,
330
+ line: this.yylineno
331
+ });
332
+ }, "next"),
333
+ // return next match that has a token
334
+ lex: /* @__PURE__ */ d(function() {
335
+ var g = this.next();
336
+ return g || this.lex();
337
+ }, "lex"),
338
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
339
+ begin: /* @__PURE__ */ d(function(g) {
340
+ this.conditionStack.push(g);
341
+ }, "begin"),
342
+ // pop the previously active lexer condition state off the condition stack
343
+ popState: /* @__PURE__ */ d(function() {
344
+ var g = this.conditionStack.length - 1;
345
+ return g > 0 ? this.conditionStack.pop() : this.conditionStack[0];
346
+ }, "popState"),
347
+ // produce the lexer rule set which is active for the currently active lexer condition state
348
+ _currentRules: /* @__PURE__ */ d(function() {
349
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
350
+ }, "_currentRules"),
351
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
352
+ topState: /* @__PURE__ */ d(function(g) {
353
+ return g = this.conditionStack.length - 1 - Math.abs(g || 0), g >= 0 ? this.conditionStack[g] : "INITIAL";
354
+ }, "topState"),
355
+ // alias for begin(condition)
356
+ pushState: /* @__PURE__ */ d(function(g) {
357
+ this.begin(g);
358
+ }, "pushState"),
359
+ // return the number of states currently on the stack
360
+ stateStackSize: /* @__PURE__ */ d(function() {
361
+ return this.conditionStack.length;
362
+ }, "stateStackSize"),
363
+ options: {},
364
+ performAction: /* @__PURE__ */ d(function(g, p, w, S) {
365
+ switch (w) {
366
+ case 0:
367
+ return g.getLogger().debug("Found block-beta"), 10;
368
+ case 1:
369
+ return g.getLogger().debug("Found id-block"), 29;
370
+ case 2:
371
+ return g.getLogger().debug("Found block"), 10;
372
+ case 3:
373
+ g.getLogger().debug(".", p.yytext);
374
+ break;
375
+ case 4:
376
+ g.getLogger().debug("_", p.yytext);
377
+ break;
378
+ case 5:
379
+ return 5;
380
+ case 6:
381
+ return p.yytext = -1, 28;
382
+ case 7:
383
+ return p.yytext = p.yytext.replace(/columns\s+/, ""), g.getLogger().debug("COLUMNS (LEX)", p.yytext), 28;
384
+ case 8:
385
+ this.pushState("md_string");
386
+ break;
387
+ case 9:
388
+ return "MD_STR";
389
+ case 10:
390
+ this.popState();
391
+ break;
392
+ case 11:
393
+ this.pushState("string");
394
+ break;
395
+ case 12:
396
+ g.getLogger().debug("LEX: POPPING STR:", p.yytext), this.popState();
397
+ break;
398
+ case 13:
399
+ return g.getLogger().debug("LEX: STR end:", p.yytext), "STR";
400
+ case 14:
401
+ return p.yytext = p.yytext.replace(/space\:/, ""), g.getLogger().debug("SPACE NUM (LEX)", p.yytext), 21;
402
+ case 15:
403
+ return p.yytext = "1", g.getLogger().debug("COLUMNS (LEX)", p.yytext), 21;
404
+ case 16:
405
+ return 42;
406
+ case 17:
407
+ return "LINKSTYLE";
408
+ case 18:
409
+ return "INTERPOLATE";
410
+ case 19:
411
+ return this.pushState("CLASSDEF"), 39;
412
+ case 20:
413
+ return this.popState(), this.pushState("CLASSDEFID"), "DEFAULT_CLASSDEF_ID";
414
+ case 21:
415
+ return this.popState(), this.pushState("CLASSDEFID"), 40;
416
+ case 22:
417
+ return this.popState(), 41;
418
+ case 23:
419
+ return this.pushState("CLASS"), 43;
420
+ case 24:
421
+ return this.popState(), this.pushState("CLASS_STYLE"), 44;
422
+ case 25:
423
+ return this.popState(), 45;
424
+ case 26:
425
+ return this.pushState("STYLE_STMNT"), 46;
426
+ case 27:
427
+ return this.popState(), this.pushState("STYLE_DEFINITION"), 47;
428
+ case 28:
429
+ return this.popState(), 48;
430
+ case 29:
431
+ return this.pushState("acc_title"), "acc_title";
432
+ case 30:
433
+ return this.popState(), "acc_title_value";
434
+ case 31:
435
+ return this.pushState("acc_descr"), "acc_descr";
436
+ case 32:
437
+ return this.popState(), "acc_descr_value";
438
+ case 33:
439
+ this.pushState("acc_descr_multiline");
440
+ break;
441
+ case 34:
442
+ this.popState();
443
+ break;
444
+ case 35:
445
+ return "acc_descr_multiline_value";
446
+ case 36:
447
+ return 30;
448
+ case 37:
449
+ return this.popState(), g.getLogger().debug("Lex: (("), "NODE_DEND";
450
+ case 38:
451
+ return this.popState(), g.getLogger().debug("Lex: (("), "NODE_DEND";
452
+ case 39:
453
+ return this.popState(), g.getLogger().debug("Lex: ))"), "NODE_DEND";
454
+ case 40:
455
+ return this.popState(), g.getLogger().debug("Lex: (("), "NODE_DEND";
456
+ case 41:
457
+ return this.popState(), g.getLogger().debug("Lex: (("), "NODE_DEND";
458
+ case 42:
459
+ return this.popState(), g.getLogger().debug("Lex: (-"), "NODE_DEND";
460
+ case 43:
461
+ return this.popState(), g.getLogger().debug("Lex: -)"), "NODE_DEND";
462
+ case 44:
463
+ return this.popState(), g.getLogger().debug("Lex: (("), "NODE_DEND";
464
+ case 45:
465
+ return this.popState(), g.getLogger().debug("Lex: ]]"), "NODE_DEND";
466
+ case 46:
467
+ return this.popState(), g.getLogger().debug("Lex: ("), "NODE_DEND";
468
+ case 47:
469
+ return this.popState(), g.getLogger().debug("Lex: ])"), "NODE_DEND";
470
+ case 48:
471
+ return this.popState(), g.getLogger().debug("Lex: /]"), "NODE_DEND";
472
+ case 49:
473
+ return this.popState(), g.getLogger().debug("Lex: /]"), "NODE_DEND";
474
+ case 50:
475
+ return this.popState(), g.getLogger().debug("Lex: )]"), "NODE_DEND";
476
+ case 51:
477
+ return this.popState(), g.getLogger().debug("Lex: )"), "NODE_DEND";
478
+ case 52:
479
+ return this.popState(), g.getLogger().debug("Lex: ]>"), "NODE_DEND";
480
+ case 53:
481
+ return this.popState(), g.getLogger().debug("Lex: ]"), "NODE_DEND";
482
+ case 54:
483
+ return g.getLogger().debug("Lexa: -)"), this.pushState("NODE"), 35;
484
+ case 55:
485
+ return g.getLogger().debug("Lexa: (-"), this.pushState("NODE"), 35;
486
+ case 56:
487
+ return g.getLogger().debug("Lexa: ))"), this.pushState("NODE"), 35;
488
+ case 57:
489
+ return g.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
490
+ case 58:
491
+ return g.getLogger().debug("Lex: ((("), this.pushState("NODE"), 35;
492
+ case 59:
493
+ return g.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
494
+ case 60:
495
+ return g.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
496
+ case 61:
497
+ return g.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
498
+ case 62:
499
+ return g.getLogger().debug("Lexc: >"), this.pushState("NODE"), 35;
500
+ case 63:
501
+ return g.getLogger().debug("Lexa: (["), this.pushState("NODE"), 35;
502
+ case 64:
503
+ return g.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
504
+ case 65:
505
+ return this.pushState("NODE"), 35;
506
+ case 66:
507
+ return this.pushState("NODE"), 35;
508
+ case 67:
509
+ return this.pushState("NODE"), 35;
510
+ case 68:
511
+ return this.pushState("NODE"), 35;
512
+ case 69:
513
+ return this.pushState("NODE"), 35;
514
+ case 70:
515
+ return this.pushState("NODE"), 35;
516
+ case 71:
517
+ return this.pushState("NODE"), 35;
518
+ case 72:
519
+ return g.getLogger().debug("Lexa: ["), this.pushState("NODE"), 35;
520
+ case 73:
521
+ return this.pushState("BLOCK_ARROW"), g.getLogger().debug("LEX ARR START"), 37;
522
+ case 74:
523
+ return g.getLogger().debug("Lex: NODE_ID", p.yytext), 31;
524
+ case 75:
525
+ return g.getLogger().debug("Lex: EOF", p.yytext), 8;
526
+ case 76:
527
+ this.pushState("md_string");
528
+ break;
529
+ case 77:
530
+ this.pushState("md_string");
531
+ break;
532
+ case 78:
533
+ return "NODE_DESCR";
534
+ case 79:
535
+ this.popState();
536
+ break;
537
+ case 80:
538
+ g.getLogger().debug("Lex: Starting string"), this.pushState("string");
539
+ break;
540
+ case 81:
541
+ g.getLogger().debug("LEX ARR: Starting string"), this.pushState("string");
542
+ break;
543
+ case 82:
544
+ return g.getLogger().debug("LEX: NODE_DESCR:", p.yytext), "NODE_DESCR";
545
+ case 83:
546
+ g.getLogger().debug("LEX POPPING"), this.popState();
547
+ break;
548
+ case 84:
549
+ g.getLogger().debug("Lex: =>BAE"), this.pushState("ARROW_DIR");
550
+ break;
551
+ case 85:
552
+ return p.yytext = p.yytext.replace(/^,\s*/, ""), g.getLogger().debug("Lex (right): dir:", p.yytext), "DIR";
553
+ case 86:
554
+ return p.yytext = p.yytext.replace(/^,\s*/, ""), g.getLogger().debug("Lex (left):", p.yytext), "DIR";
555
+ case 87:
556
+ return p.yytext = p.yytext.replace(/^,\s*/, ""), g.getLogger().debug("Lex (x):", p.yytext), "DIR";
557
+ case 88:
558
+ return p.yytext = p.yytext.replace(/^,\s*/, ""), g.getLogger().debug("Lex (y):", p.yytext), "DIR";
559
+ case 89:
560
+ return p.yytext = p.yytext.replace(/^,\s*/, ""), g.getLogger().debug("Lex (up):", p.yytext), "DIR";
561
+ case 90:
562
+ return p.yytext = p.yytext.replace(/^,\s*/, ""), g.getLogger().debug("Lex (down):", p.yytext), "DIR";
563
+ case 91:
564
+ return p.yytext = "]>", g.getLogger().debug("Lex (ARROW_DIR end):", p.yytext), this.popState(), this.popState(), "BLOCK_ARROW_END";
565
+ case 92:
566
+ return g.getLogger().debug("Lex: LINK", "#" + p.yytext + "#"), 15;
567
+ case 93:
568
+ return g.getLogger().debug("Lex: LINK", p.yytext), 15;
569
+ case 94:
570
+ return g.getLogger().debug("Lex: LINK", p.yytext), 15;
571
+ case 95:
572
+ return g.getLogger().debug("Lex: LINK", p.yytext), 15;
573
+ case 96:
574
+ return g.getLogger().debug("Lex: START_LINK", p.yytext), this.pushState("LLABEL"), 16;
575
+ case 97:
576
+ return g.getLogger().debug("Lex: START_LINK", p.yytext), this.pushState("LLABEL"), 16;
577
+ case 98:
578
+ return g.getLogger().debug("Lex: START_LINK", p.yytext), this.pushState("LLABEL"), 16;
579
+ case 99:
580
+ this.pushState("md_string");
581
+ break;
582
+ case 100:
583
+ return g.getLogger().debug("Lex: Starting string"), this.pushState("string"), "LINK_LABEL";
584
+ case 101:
585
+ return this.popState(), g.getLogger().debug("Lex: LINK", "#" + p.yytext + "#"), 15;
586
+ case 102:
587
+ return this.popState(), g.getLogger().debug("Lex: LINK", p.yytext), 15;
588
+ case 103:
589
+ return this.popState(), g.getLogger().debug("Lex: LINK", p.yytext), 15;
590
+ case 104:
591
+ return g.getLogger().debug("Lex: COLON", p.yytext), p.yytext = p.yytext.slice(1), 27;
592
+ }
593
+ }, "anonymous"),
594
+ rules: [/^(?:block-beta\b)/, /^(?:block:)/, /^(?:block\b)/, /^(?:[\s]+)/, /^(?:[\n]+)/, /^(?:((\u000D\u000A)|(\u000A)))/, /^(?:columns\s+auto\b)/, /^(?:columns\s+[\d]+)/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]*)/, /^(?:space[:]\d+)/, /^(?:space\b)/, /^(?:default\b)/, /^(?:linkStyle\b)/, /^(?:interpolate\b)/, /^(?:classDef\s+)/, /^(?:DEFAULT\s+)/, /^(?:\w+\s+)/, /^(?:[^\n]*)/, /^(?:class\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:style\s+)/, /^(?:(\w+)+((,\s*\w+)*))/, /^(?:[^\n]*)/, /^(?:accTitle\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*:\s*)/, /^(?:(?!\n||)*[^\n]*)/, /^(?:accDescr\s*\{\s*)/, /^(?:[\}])/, /^(?:[^\}]*)/, /^(?:end\b\s*)/, /^(?:\(\(\()/, /^(?:\)\)\))/, /^(?:[\)]\))/, /^(?:\}\})/, /^(?:\})/, /^(?:\(-)/, /^(?:-\))/, /^(?:\(\()/, /^(?:\]\])/, /^(?:\()/, /^(?:\]\))/, /^(?:\\\])/, /^(?:\/\])/, /^(?:\)\])/, /^(?:[\)])/, /^(?:\]>)/, /^(?:[\]])/, /^(?:-\))/, /^(?:\(-)/, /^(?:\)\))/, /^(?:\))/, /^(?:\(\(\()/, /^(?:\(\()/, /^(?:\{\{)/, /^(?:\{)/, /^(?:>)/, /^(?:\(\[)/, /^(?:\()/, /^(?:\[\[)/, /^(?:\[\|)/, /^(?:\[\()/, /^(?:\)\)\))/, /^(?:\[\\)/, /^(?:\[\/)/, /^(?:\[\\)/, /^(?:\[)/, /^(?:<\[)/, /^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/, /^(?:$)/, /^(?:["][`])/, /^(?:["][`])/, /^(?:[^`"]+)/, /^(?:[`]["])/, /^(?:["])/, /^(?:["])/, /^(?:[^"]+)/, /^(?:["])/, /^(?:\]>\s*\()/, /^(?:,?\s*right\s*)/, /^(?:,?\s*left\s*)/, /^(?:,?\s*x\s*)/, /^(?:,?\s*y\s*)/, /^(?:,?\s*up\s*)/, /^(?:,?\s*down\s*)/, /^(?:\)\s*)/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?:\s*~~[\~]+\s*)/, /^(?:\s*[xo<]?--\s*)/, /^(?:\s*[xo<]?==\s*)/, /^(?:\s*[xo<]?-\.\s*)/, /^(?:["][`])/, /^(?:["])/, /^(?:\s*[xo<]?--+[-xo>]\s*)/, /^(?:\s*[xo<]?==+[=xo>]\s*)/, /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/, /^(?::\d+)/],
595
+ conditions: { STYLE_DEFINITION: { rules: [28], inclusive: !1 }, STYLE_STMNT: { rules: [27], inclusive: !1 }, CLASSDEFID: { rules: [22], inclusive: !1 }, CLASSDEF: { rules: [20, 21], inclusive: !1 }, CLASS_STYLE: { rules: [25], inclusive: !1 }, CLASS: { rules: [24], inclusive: !1 }, LLABEL: { rules: [99, 100, 101, 102, 103], inclusive: !1 }, ARROW_DIR: { rules: [85, 86, 87, 88, 89, 90, 91], inclusive: !1 }, BLOCK_ARROW: { rules: [76, 81, 84], inclusive: !1 }, NODE: { rules: [37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 77, 80], inclusive: !1 }, md_string: { rules: [9, 10, 78, 79], inclusive: !1 }, space: { rules: [], inclusive: !1 }, string: { rules: [12, 13, 82, 83], inclusive: !1 }, acc_descr_multiline: { rules: [34, 35], inclusive: !1 }, acc_descr: { rules: [32], inclusive: !1 }, acc_title: { rules: [30], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 14, 15, 16, 17, 18, 19, 23, 26, 29, 31, 33, 36, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 92, 93, 94, 95, 96, 97, 98, 104], inclusive: !0 } }
596
+ };
597
+ return T;
598
+ }();
599
+ v.lexer = N;
600
+ function k() {
601
+ this.yy = {};
602
+ }
603
+ return d(k, "Parser"), k.prototype = v, v.Parser = k, new k();
604
+ }();
605
+ wt.parser = wt;
606
+ var ke = wt, V = /* @__PURE__ */ new Map(), Et = [], mt = /* @__PURE__ */ new Map(), It = "color", Bt = "fill", De = "bgFill", Kt = ",", Te = z(), ot = /* @__PURE__ */ new Map(), Ne = /* @__PURE__ */ d((e) => Se.sanitizeText(e, Te), "sanitizeText"), Ce = /* @__PURE__ */ d(function(e, t = "") {
607
+ let a = ot.get(e);
608
+ a || (a = { id: e, styles: [], textStyles: [] }, ot.set(e, a)), t != null && t.split(Kt).forEach((i) => {
609
+ const l = i.replace(/([^;]*);/, "$1").trim();
610
+ if (RegExp(It).exec(i)) {
611
+ const r = l.replace(Bt, De).replace(It, Bt);
612
+ a.textStyles.push(r);
613
+ }
614
+ a.styles.push(l);
615
+ });
616
+ }, "addStyleClass"), Ie = /* @__PURE__ */ d(function(e, t = "") {
617
+ const a = V.get(e);
618
+ t != null && (a.styles = t.split(Kt));
619
+ }, "addStyle2Node"), Be = /* @__PURE__ */ d(function(e, t) {
620
+ e.split(",").forEach(function(a) {
621
+ let i = V.get(a);
622
+ if (i === void 0) {
623
+ const l = a.trim();
624
+ i = { id: l, type: "na", children: [] }, V.set(l, i);
625
+ }
626
+ i.classes || (i.classes = []), i.classes.push(t);
627
+ });
628
+ }, "setCssClass"), Xt = /* @__PURE__ */ d((e, t) => {
629
+ const a = e.flat(), i = [], l = a.find((r) => (r == null ? void 0 : r.type) === "column-setting"), s = (l == null ? void 0 : l.columns) ?? -1;
630
+ for (const r of a) {
631
+ if (typeof s == "number" && s > 0 && r.type !== "column-setting" && typeof r.widthInColumns == "number" && r.widthInColumns > s && m.warn(
632
+ `Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${s}`
633
+ ), r.label && (r.label = Ne(r.label)), r.type === "classDef") {
634
+ Ce(r.id, r.css);
635
+ continue;
636
+ }
637
+ if (r.type === "applyClass") {
638
+ Be(r.id, (r == null ? void 0 : r.styleClass) ?? "");
639
+ continue;
640
+ }
641
+ if (r.type === "applyStyles") {
642
+ r != null && r.stylesStr && Ie(r.id, r == null ? void 0 : r.stylesStr);
643
+ continue;
644
+ }
645
+ if (r.type === "column-setting")
646
+ t.columns = r.columns ?? -1;
647
+ else if (r.type === "edge") {
648
+ const n = (mt.get(r.id) ?? 0) + 1;
649
+ mt.set(r.id, n), r.id = n + "-" + r.id, Et.push(r);
650
+ } else {
651
+ r.label || (r.type === "composite" ? r.label = "" : r.label = r.id);
652
+ const n = V.get(r.id);
653
+ if (n === void 0 ? V.set(r.id, r) : (r.type !== "na" && (n.type = r.type), r.label !== r.id && (n.label = r.label)), r.children && Xt(r.children, r), r.type === "space") {
654
+ const o = r.width ?? 1;
655
+ for (let u = 0; u < o; u++) {
656
+ const h = ve(r);
657
+ h.id = h.id + "-" + u, V.set(h.id, h), i.push(h);
658
+ }
659
+ } else n === void 0 && i.push(r);
660
+ }
661
+ }
662
+ t.children = i;
663
+ }, "populateBlockDatabase"), _t = [], at = { id: "root", type: "composite", children: [], columns: -1 }, Oe = /* @__PURE__ */ d(() => {
664
+ m.debug("Clear called"), be(), at = { id: "root", type: "composite", children: [], columns: -1 }, V = /* @__PURE__ */ new Map([["root", at]]), _t = [], ot = /* @__PURE__ */ new Map(), Et = [], mt = /* @__PURE__ */ new Map();
665
+ }, "clear");
666
+ function Ut(e) {
667
+ switch (m.debug("typeStr2Type", e), e) {
668
+ case "[]":
669
+ return "square";
670
+ case "()":
671
+ return m.debug("we have a round"), "round";
672
+ case "(())":
673
+ return "circle";
674
+ case ">]":
675
+ return "rect_left_inv_arrow";
676
+ case "{}":
677
+ return "diamond";
678
+ case "{{}}":
679
+ return "hexagon";
680
+ case "([])":
681
+ return "stadium";
682
+ case "[[]]":
683
+ return "subroutine";
684
+ case "[()]":
685
+ return "cylinder";
686
+ case "((()))":
687
+ return "doublecircle";
688
+ case "[//]":
689
+ return "lean_right";
690
+ case "[\\\\]":
691
+ return "lean_left";
692
+ case "[/\\]":
693
+ return "trapezoid";
694
+ case "[\\/]":
695
+ return "inv_trapezoid";
696
+ case "<[]>":
697
+ return "block_arrow";
698
+ default:
699
+ return "na";
700
+ }
701
+ }
702
+ d(Ut, "typeStr2Type");
703
+ function jt(e) {
704
+ switch (m.debug("typeStr2Type", e), e) {
705
+ case "==":
706
+ return "thick";
707
+ default:
708
+ return "normal";
709
+ }
710
+ }
711
+ d(jt, "edgeTypeStr2Type");
712
+ function Vt(e) {
713
+ switch (e.replace(/^[\s-]+|[\s-]+$/g, "")) {
714
+ case "x":
715
+ return "arrow_cross";
716
+ case "o":
717
+ return "arrow_circle";
718
+ case ">":
719
+ return "arrow_point";
720
+ default:
721
+ return "";
722
+ }
723
+ }
724
+ d(Vt, "edgeStrToEdgeData");
725
+ var Ot = 0, Re = /* @__PURE__ */ d(() => (Ot++, "id-" + Math.random().toString(36).substr(2, 12) + "-" + Ot), "generateId"), ze = /* @__PURE__ */ d((e) => {
726
+ at.children = e, Xt(e, at), _t = at.children;
727
+ }, "setHierarchy"), Ae = /* @__PURE__ */ d((e) => {
728
+ const t = V.get(e);
729
+ return t ? t.columns ? t.columns : t.children ? t.children.length : -1 : -1;
730
+ }, "getColumns"), Me = /* @__PURE__ */ d(() => [...V.values()], "getBlocksFlat"), Fe = /* @__PURE__ */ d(() => _t || [], "getBlocks"), We = /* @__PURE__ */ d(() => Et, "getEdges"), Pe = /* @__PURE__ */ d((e) => V.get(e), "getBlock"), Ye = /* @__PURE__ */ d((e) => {
731
+ V.set(e.id, e);
732
+ }, "setBlock"), He = /* @__PURE__ */ d(() => m, "getLogger"), Ke = /* @__PURE__ */ d(function() {
733
+ return ot;
734
+ }, "getClasses"), Xe = {
735
+ getConfig: /* @__PURE__ */ d(() => st().block, "getConfig"),
736
+ typeStr2Type: Ut,
737
+ edgeTypeStr2Type: jt,
738
+ edgeStrToEdgeData: Vt,
739
+ getLogger: He,
740
+ getBlocksFlat: Me,
741
+ getBlocks: Fe,
742
+ getEdges: We,
743
+ setHierarchy: ze,
744
+ getBlock: Pe,
745
+ setBlock: Ye,
746
+ getColumns: Ae,
747
+ getClasses: Ke,
748
+ clear: Oe,
749
+ generateId: Re
750
+ }, Ue = Xe, lt = /* @__PURE__ */ d((e, t) => {
751
+ const a = _e, i = a(e, "r"), l = a(e, "g"), s = a(e, "b");
752
+ return we(i, l, s, t);
753
+ }, "fade"), je = /* @__PURE__ */ d((e) => `.label {
754
+ font-family: ${e.fontFamily};
755
+ color: ${e.nodeTextColor || e.textColor};
756
+ }
757
+ .cluster-label text {
758
+ fill: ${e.titleColor};
759
+ }
760
+ .cluster-label span,p {
761
+ color: ${e.titleColor};
762
+ }
763
+
764
+
765
+
766
+ .label text,span,p {
767
+ fill: ${e.nodeTextColor || e.textColor};
768
+ color: ${e.nodeTextColor || e.textColor};
769
+ }
770
+
771
+ .node rect,
772
+ .node circle,
773
+ .node ellipse,
774
+ .node polygon,
775
+ .node path {
776
+ fill: ${e.mainBkg};
777
+ stroke: ${e.nodeBorder};
778
+ stroke-width: 1px;
779
+ }
780
+ .flowchart-label text {
781
+ text-anchor: middle;
782
+ }
783
+ // .flowchart-label .text-outer-tspan {
784
+ // text-anchor: middle;
785
+ // }
786
+ // .flowchart-label .text-inner-tspan {
787
+ // text-anchor: start;
788
+ // }
789
+
790
+ .node .label {
791
+ text-align: center;
792
+ }
793
+ .node.clickable {
794
+ cursor: pointer;
795
+ }
796
+
797
+ .arrowheadPath {
798
+ fill: ${e.arrowheadColor};
799
+ }
800
+
801
+ .edgePath .path {
802
+ stroke: ${e.lineColor};
803
+ stroke-width: 2.0px;
804
+ }
805
+
806
+ .flowchart-link {
807
+ stroke: ${e.lineColor};
808
+ fill: none;
809
+ }
810
+
811
+ .edgeLabel {
812
+ background-color: ${e.edgeLabelBackground};
813
+ rect {
814
+ opacity: 0.5;
815
+ background-color: ${e.edgeLabelBackground};
816
+ fill: ${e.edgeLabelBackground};
817
+ }
818
+ text-align: center;
819
+ }
820
+
821
+ /* For html labels only */
822
+ .labelBkg {
823
+ background-color: ${lt(e.edgeLabelBackground, 0.5)};
824
+ // background-color:
825
+ }
826
+
827
+ .node .cluster {
828
+ // fill: ${lt(e.mainBkg, 0.5)};
829
+ fill: ${lt(e.clusterBkg, 0.5)};
830
+ stroke: ${lt(e.clusterBorder, 0.2)};
831
+ box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
832
+ stroke-width: 1px;
833
+ }
834
+
835
+ .cluster text {
836
+ fill: ${e.titleColor};
837
+ }
838
+
839
+ .cluster span,p {
840
+ color: ${e.titleColor};
841
+ }
842
+ /* .cluster div {
843
+ color: ${e.titleColor};
844
+ } */
845
+
846
+ div.mermaidTooltip {
847
+ position: absolute;
848
+ text-align: center;
849
+ max-width: 200px;
850
+ padding: 2px;
851
+ font-family: ${e.fontFamily};
852
+ font-size: 12px;
853
+ background: ${e.tertiaryColor};
854
+ border: 1px solid ${e.border2};
855
+ border-radius: 2px;
856
+ pointer-events: none;
857
+ z-index: 100;
858
+ }
859
+
860
+ .flowchartTitleText {
861
+ text-anchor: middle;
862
+ font-size: 18px;
863
+ fill: ${e.textColor};
864
+ }
865
+ ${de()}
866
+ `, "getStyles"), Ve = je, Ge = /* @__PURE__ */ d((e, t, a, i) => {
867
+ t.forEach((l) => {
868
+ sr[l](e, a, i);
869
+ });
870
+ }, "insertMarkers"), Ze = /* @__PURE__ */ d((e, t, a) => {
871
+ m.trace("Making markers for ", a), e.append("defs").append("marker").attr("id", a + "_" + t + "-extensionStart").attr("class", "marker extension " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-extensionEnd").attr("class", "marker extension " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
872
+ }, "extension"), qe = /* @__PURE__ */ d((e, t, a) => {
873
+ e.append("defs").append("marker").attr("id", a + "_" + t + "-compositionStart").attr("class", "marker composition " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-compositionEnd").attr("class", "marker composition " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
874
+ }, "composition"), Je = /* @__PURE__ */ d((e, t, a) => {
875
+ e.append("defs").append("marker").attr("id", a + "_" + t + "-aggregationStart").attr("class", "marker aggregation " + t).attr("refX", 18).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-aggregationEnd").attr("class", "marker aggregation " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
876
+ }, "aggregation"), Qe = /* @__PURE__ */ d((e, t, a) => {
877
+ e.append("defs").append("marker").attr("id", a + "_" + t + "-dependencyStart").attr("class", "marker dependency " + t).attr("refX", 6).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", a + "_" + t + "-dependencyEnd").attr("class", "marker dependency " + t).attr("refX", 13).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
878
+ }, "dependency"), $e = /* @__PURE__ */ d((e, t, a) => {
879
+ e.append("defs").append("marker").attr("id", a + "_" + t + "-lollipopStart").attr("class", "marker lollipop " + t).attr("refX", 13).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6), e.append("defs").append("marker").attr("id", a + "_" + t + "-lollipopEnd").attr("class", "marker lollipop " + t).attr("refX", 1).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("circle").attr("stroke", "black").attr("fill", "transparent").attr("cx", 7).attr("cy", 7).attr("r", 6);
880
+ }, "lollipop"), tr = /* @__PURE__ */ d((e, t, a) => {
881
+ e.append("marker").attr("id", a + "_" + t + "-pointEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 6).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 0 L 10 5 L 0 10 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", a + "_" + t + "-pointStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 4.5).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto").append("path").attr("d", "M 0 5 L 10 10 L 10 0 z").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
882
+ }, "point"), er = /* @__PURE__ */ d((e, t, a) => {
883
+ e.append("marker").attr("id", a + "_" + t + "-circleEnd").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", 11).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", a + "_" + t + "-circleStart").attr("class", "marker " + t).attr("viewBox", "0 0 10 10").attr("refX", -1).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("circle").attr("cx", "5").attr("cy", "5").attr("r", "5").attr("class", "arrowMarkerPath").style("stroke-width", 1).style("stroke-dasharray", "1,0");
884
+ }, "circle"), rr = /* @__PURE__ */ d((e, t, a) => {
885
+ e.append("marker").attr("id", a + "_" + t + "-crossEnd").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", 12).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0"), e.append("marker").attr("id", a + "_" + t + "-crossStart").attr("class", "marker cross " + t).attr("viewBox", "0 0 11 11").attr("refX", -1).attr("refY", 5.2).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 11).attr("markerHeight", 11).attr("orient", "auto").append("path").attr("d", "M 1,1 l 9,9 M 10,1 l -9,9").attr("class", "arrowMarkerPath").style("stroke-width", 2).style("stroke-dasharray", "1,0");
886
+ }, "cross"), ar = /* @__PURE__ */ d((e, t, a) => {
887
+ e.append("defs").append("marker").attr("id", a + "_" + t + "-barbEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 14).attr("markerUnits", "strokeWidth").attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
888
+ }, "barb"), sr = {
889
+ extension: Ze,
890
+ composition: qe,
891
+ aggregation: Je,
892
+ dependency: Qe,
893
+ lollipop: $e,
894
+ point: tr,
895
+ circle: er,
896
+ cross: rr,
897
+ barb: ar
898
+ }, ir = Ge, Pt, Yt, B = ((Yt = (Pt = z()) == null ? void 0 : Pt.block) == null ? void 0 : Yt.padding) ?? 8;
899
+ function Gt(e, t) {
900
+ if (e === 0 || !Number.isInteger(e))
901
+ throw new Error("Columns must be an integer !== 0.");
902
+ if (t < 0 || !Number.isInteger(t))
903
+ throw new Error("Position must be a non-negative integer." + t);
904
+ if (e < 0)
905
+ return { px: t, py: 0 };
906
+ if (e === 1)
907
+ return { px: 0, py: t };
908
+ const a = t % e, i = Math.floor(t / e);
909
+ return { px: a, py: i };
910
+ }
911
+ d(Gt, "calculateBlockPosition");
912
+ var nr = /* @__PURE__ */ d((e) => {
913
+ let t = 0, a = 0;
914
+ for (const i of e.children) {
915
+ const { width: l, height: s, x: r, y: n } = i.size ?? { width: 0, height: 0, x: 0, y: 0 };
916
+ m.debug(
917
+ "getMaxChildSize abc95 child:",
918
+ i.id,
919
+ "width:",
920
+ l,
921
+ "height:",
922
+ s,
923
+ "x:",
924
+ r,
925
+ "y:",
926
+ n,
927
+ i.type
928
+ ), i.type !== "space" && (l > t && (t = l / (e.widthInColumns ?? 1)), s > a && (a = s));
929
+ }
930
+ return { width: t, height: a };
931
+ }, "getMaxChildSize");
932
+ function ht(e, t, a = 0, i = 0) {
933
+ var r, n, o, u, h, y, b, L, E, D, v;
934
+ m.debug(
935
+ "setBlockSizes abc95 (start)",
936
+ e.id,
937
+ (r = e == null ? void 0 : e.size) == null ? void 0 : r.x,
938
+ "block width =",
939
+ e == null ? void 0 : e.size,
940
+ "siblingWidth",
941
+ a
942
+ ), (n = e == null ? void 0 : e.size) != null && n.width || (e.size = {
943
+ width: a,
944
+ height: i,
945
+ x: 0,
946
+ y: 0
947
+ });
948
+ let l = 0, s = 0;
949
+ if (((o = e.children) == null ? void 0 : o.length) > 0) {
950
+ for (const S of e.children)
951
+ ht(S, t);
952
+ const N = nr(e);
953
+ l = N.width, s = N.height, m.debug("setBlockSizes abc95 maxWidth of", e.id, ":s children is ", l, s);
954
+ for (const S of e.children)
955
+ S.size && (m.debug(
956
+ `abc95 Setting size of children of ${e.id} id=${S.id} ${l} ${s} ${JSON.stringify(S.size)}`
957
+ ), S.size.width = l * (S.widthInColumns ?? 1) + B * ((S.widthInColumns ?? 1) - 1), S.size.height = s, S.size.x = 0, S.size.y = 0, m.debug(
958
+ `abc95 updating size of ${e.id} children child:${S.id} maxWidth:${l} maxHeight:${s}`
959
+ ));
960
+ for (const S of e.children)
961
+ ht(S, t, l, s);
962
+ const k = e.columns ?? -1;
963
+ let T = 0;
964
+ for (const S of e.children)
965
+ T += S.widthInColumns ?? 1;
966
+ let x = e.children.length;
967
+ k > 0 && k < T && (x = k);
968
+ const g = Math.ceil(T / x);
969
+ let p = x * (l + B) + B, w = g * (s + B) + B;
970
+ if (p < a) {
971
+ m.debug(
972
+ `Detected to small sibling: abc95 ${e.id} siblingWidth ${a} siblingHeight ${i} width ${p}`
973
+ ), p = a, w = i;
974
+ const S = (a - x * B - B) / x, c = (i - g * B - B) / g;
975
+ m.debug("Size indata abc88", e.id, "childWidth", S, "maxWidth", l), m.debug("Size indata abc88", e.id, "childHeight", c, "maxHeight", s), m.debug("Size indata abc88 xSize", x, "padding", B);
976
+ for (const _ of e.children)
977
+ _.size && (_.size.width = S, _.size.height = c, _.size.x = 0, _.size.y = 0);
978
+ }
979
+ if (m.debug(
980
+ `abc95 (finale calc) ${e.id} xSize ${x} ySize ${g} columns ${k}${e.children.length} width=${Math.max(p, ((u = e.size) == null ? void 0 : u.width) || 0)}`
981
+ ), p < (((h = e == null ? void 0 : e.size) == null ? void 0 : h.width) || 0)) {
982
+ p = ((y = e == null ? void 0 : e.size) == null ? void 0 : y.width) || 0;
983
+ const S = k > 0 ? Math.min(e.children.length, k) : e.children.length;
984
+ if (S > 0) {
985
+ const c = (p - S * B - B) / S;
986
+ m.debug("abc95 (growing to fit) width", e.id, p, (b = e.size) == null ? void 0 : b.width, c);
987
+ for (const _ of e.children)
988
+ _.size && (_.size.width = c);
989
+ }
990
+ }
991
+ e.size = {
992
+ width: p,
993
+ height: w,
994
+ x: 0,
995
+ y: 0
996
+ };
997
+ }
998
+ m.debug(
999
+ "setBlockSizes abc94 (done)",
1000
+ e.id,
1001
+ (L = e == null ? void 0 : e.size) == null ? void 0 : L.x,
1002
+ (E = e == null ? void 0 : e.size) == null ? void 0 : E.width,
1003
+ (D = e == null ? void 0 : e.size) == null ? void 0 : D.y,
1004
+ (v = e == null ? void 0 : e.size) == null ? void 0 : v.height
1005
+ );
1006
+ }
1007
+ d(ht, "setBlockSizes");
1008
+ function kt(e, t) {
1009
+ var i, l, s, r, n, o, u, h, y, b, L, E, D, v, N, k, T;
1010
+ m.debug(
1011
+ `abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${(i = e == null ? void 0 : e.size) == null ? void 0 : i.x} y: ${(l = e == null ? void 0 : e.size) == null ? void 0 : l.y} width: ${(s = e == null ? void 0 : e.size) == null ? void 0 : s.width}`
1012
+ );
1013
+ const a = e.columns ?? -1;
1014
+ if (m.debug("layoutBlocks columns abc95", e.id, "=>", a, e), e.children && // find max width of children
1015
+ e.children.length > 0) {
1016
+ const x = ((n = (r = e == null ? void 0 : e.children[0]) == null ? void 0 : r.size) == null ? void 0 : n.width) ?? 0, g = e.children.length * x + (e.children.length - 1) * B;
1017
+ m.debug("widthOfChildren 88", g, "posX");
1018
+ let p = 0;
1019
+ m.debug("abc91 block?.size?.x", e.id, (o = e == null ? void 0 : e.size) == null ? void 0 : o.x);
1020
+ let w = (u = e == null ? void 0 : e.size) != null && u.x ? ((h = e == null ? void 0 : e.size) == null ? void 0 : h.x) + (-((y = e == null ? void 0 : e.size) == null ? void 0 : y.width) / 2 || 0) : -B, S = 0;
1021
+ for (const c of e.children) {
1022
+ const _ = e;
1023
+ if (!c.size)
1024
+ continue;
1025
+ const { width: f, height: A } = c.size, { px: O, py: X } = Gt(a, p);
1026
+ if (X != S && (S = X, w = (b = e == null ? void 0 : e.size) != null && b.x ? ((L = e == null ? void 0 : e.size) == null ? void 0 : L.x) + (-((E = e == null ? void 0 : e.size) == null ? void 0 : E.width) / 2 || 0) : -B, m.debug("New row in layout for block", e.id, " and child ", c.id, S)), m.debug(
1027
+ `abc89 layout blocks (child) id: ${c.id} Pos: ${p} (px, py) ${O},${X} (${(D = _ == null ? void 0 : _.size) == null ? void 0 : D.x},${(v = _ == null ? void 0 : _.size) == null ? void 0 : v.y}) parent: ${_.id} width: ${f}${B}`
1028
+ ), _.size) {
1029
+ const J = f / 2;
1030
+ c.size.x = w + B + J, m.debug(
1031
+ `abc91 layout blocks (calc) px, pyid:${c.id} startingPos=X${w} new startingPosX${c.size.x} ${J} padding=${B} width=${f} halfWidth=${J} => x:${c.size.x} y:${c.size.y} ${c.widthInColumns} (width * (child?.w || 1)) / 2 ${f * ((c == null ? void 0 : c.widthInColumns) ?? 1) / 2}`
1032
+ ), w = c.size.x + J, c.size.y = _.size.y - _.size.height / 2 + X * (A + B) + A / 2 + B, m.debug(
1033
+ `abc88 layout blocks (calc) px, pyid:${c.id}startingPosX${w}${B}${J}=>x:${c.size.x}y:${c.size.y}${c.widthInColumns}(width * (child?.w || 1)) / 2${f * ((c == null ? void 0 : c.widthInColumns) ?? 1) / 2}`
1034
+ );
1035
+ }
1036
+ c.children && kt(c);
1037
+ let P = (c == null ? void 0 : c.widthInColumns) ?? 1;
1038
+ a > 0 && (P = Math.min(P, a - p % a)), p += P, m.debug("abc88 columnsPos", c, p);
1039
+ }
1040
+ }
1041
+ m.debug(
1042
+ `layout blocks (<==layoutBlocks) ${e.id} x: ${(N = e == null ? void 0 : e.size) == null ? void 0 : N.x} y: ${(k = e == null ? void 0 : e.size) == null ? void 0 : k.y} width: ${(T = e == null ? void 0 : e.size) == null ? void 0 : T.width}`
1043
+ );
1044
+ }
1045
+ d(kt, "layoutBlocks");
1046
+ function Dt(e, { minX: t, minY: a, maxX: i, maxY: l } = { minX: 0, minY: 0, maxX: 0, maxY: 0 }) {
1047
+ if (e.size && e.id !== "root") {
1048
+ const { x: s, y: r, width: n, height: o } = e.size;
1049
+ s - n / 2 < t && (t = s - n / 2), r - o / 2 < a && (a = r - o / 2), s + n / 2 > i && (i = s + n / 2), r + o / 2 > l && (l = r + o / 2);
1050
+ }
1051
+ if (e.children)
1052
+ for (const s of e.children)
1053
+ ({ minX: t, minY: a, maxX: i, maxY: l } = Dt(s, { minX: t, minY: a, maxX: i, maxY: l }));
1054
+ return { minX: t, minY: a, maxX: i, maxY: l };
1055
+ }
1056
+ d(Dt, "findBounds");
1057
+ function Zt(e) {
1058
+ const t = e.getBlock("root");
1059
+ if (!t)
1060
+ return;
1061
+ ht(t, e, 0, 0), kt(t), m.debug("getBlocks", JSON.stringify(t, null, 2));
1062
+ const { minX: a, minY: i, maxX: l, maxY: s } = Dt(t), r = s - i, n = l - a;
1063
+ return { x: a, y: i, width: n, height: r };
1064
+ }
1065
+ d(Zt, "layout");
1066
+ function Lt(e, t) {
1067
+ t && e.attr("style", t);
1068
+ }
1069
+ d(Lt, "applyStyle");
1070
+ function qt(e, t) {
1071
+ const a = R(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject")), i = a.append("xhtml:div"), l = e.label, s = e.isNode ? "nodeLabel" : "edgeLabel", r = i.append("span");
1072
+ return r.html(yt(l, t)), Lt(r, e.labelStyle), r.attr("class", s), Lt(i, e.labelStyle), i.style("display", "inline-block"), i.style("white-space", "nowrap"), i.attr("xmlns", "http://www.w3.org/1999/xhtml"), a.node();
1073
+ }
1074
+ d(qt, "addHtmlLabel");
1075
+ var lr = /* @__PURE__ */ d(async (e, t, a, i) => {
1076
+ let l = e || "";
1077
+ typeof l == "object" && (l = l[0]);
1078
+ const s = z();
1079
+ if (Z(s.flowchart.htmlLabels)) {
1080
+ l = l.replace(/\\n|\n/g, "<br />"), m.debug("vertexText" + l);
1081
+ const r = await Le(bt(l)), n = {
1082
+ isNode: i,
1083
+ label: r,
1084
+ labelStyle: t.replace("fill:", "color:")
1085
+ };
1086
+ return qt(n, s);
1087
+ } else {
1088
+ const r = document.createElementNS("http://www.w3.org/2000/svg", "text");
1089
+ r.setAttribute("style", t.replace("color:", "fill:"));
1090
+ let n = [];
1091
+ typeof l == "string" ? n = l.split(/\\n|\n|<br\s*\/?>/gi) : Array.isArray(l) ? n = l : n = [];
1092
+ for (const o of n) {
1093
+ const u = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
1094
+ u.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), u.setAttribute("dy", "1em"), u.setAttribute("x", "0"), a ? u.setAttribute("class", "title-row") : u.setAttribute("class", "row"), u.textContent = o.trim(), r.appendChild(u);
1095
+ }
1096
+ return r;
1097
+ }
1098
+ }, "createLabel"), j = lr, cr = /* @__PURE__ */ d((e, t, a, i, l) => {
1099
+ t.arrowTypeStart && Rt(e, "start", t.arrowTypeStart, a, i, l), t.arrowTypeEnd && Rt(e, "end", t.arrowTypeEnd, a, i, l);
1100
+ }, "addEdgeMarkers"), or = {
1101
+ arrow_cross: "cross",
1102
+ arrow_point: "point",
1103
+ arrow_barb: "barb",
1104
+ arrow_circle: "circle",
1105
+ aggregation: "aggregation",
1106
+ extension: "extension",
1107
+ composition: "composition",
1108
+ dependency: "dependency",
1109
+ lollipop: "lollipop"
1110
+ }, Rt = /* @__PURE__ */ d((e, t, a, i, l, s) => {
1111
+ const r = or[a];
1112
+ if (!r) {
1113
+ m.warn(`Unknown arrow type: ${a}`);
1114
+ return;
1115
+ }
1116
+ const n = t === "start" ? "Start" : "End";
1117
+ e.attr(`marker-${t}`, `url(${i}#${l}_${s}-${r}${n})`);
1118
+ }, "addEdgeMarker"), St = {}, W = {}, hr = /* @__PURE__ */ d(async (e, t) => {
1119
+ const a = z(), i = Z(a.flowchart.htmlLabels), l = t.labelType === "markdown" ? Ht(
1120
+ e,
1121
+ t.label,
1122
+ {
1123
+ style: t.labelStyle,
1124
+ useHtmlLabels: i,
1125
+ addSvgBackground: !0
1126
+ },
1127
+ a
1128
+ ) : await j(t.label, t.labelStyle), s = e.insert("g").attr("class", "edgeLabel"), r = s.insert("g").attr("class", "label");
1129
+ r.node().appendChild(l);
1130
+ let n = l.getBBox();
1131
+ if (i) {
1132
+ const u = l.children[0], h = R(l);
1133
+ n = u.getBoundingClientRect(), h.attr("width", n.width), h.attr("height", n.height);
1134
+ }
1135
+ r.attr("transform", "translate(" + -n.width / 2 + ", " + -n.height / 2 + ")"), St[t.id] = s, t.width = n.width, t.height = n.height;
1136
+ let o;
1137
+ if (t.startLabelLeft) {
1138
+ const u = await j(t.startLabelLeft, t.labelStyle), h = e.insert("g").attr("class", "edgeTerminals"), y = h.insert("g").attr("class", "inner");
1139
+ o = y.node().appendChild(u);
1140
+ const b = u.getBBox();
1141
+ y.attr("transform", "translate(" + -b.width / 2 + ", " + -b.height / 2 + ")"), W[t.id] || (W[t.id] = {}), W[t.id].startLeft = h, rt(o, t.startLabelLeft);
1142
+ }
1143
+ if (t.startLabelRight) {
1144
+ const u = await j(t.startLabelRight, t.labelStyle), h = e.insert("g").attr("class", "edgeTerminals"), y = h.insert("g").attr("class", "inner");
1145
+ o = h.node().appendChild(u), y.node().appendChild(u);
1146
+ const b = u.getBBox();
1147
+ y.attr("transform", "translate(" + -b.width / 2 + ", " + -b.height / 2 + ")"), W[t.id] || (W[t.id] = {}), W[t.id].startRight = h, rt(o, t.startLabelRight);
1148
+ }
1149
+ if (t.endLabelLeft) {
1150
+ const u = await j(t.endLabelLeft, t.labelStyle), h = e.insert("g").attr("class", "edgeTerminals"), y = h.insert("g").attr("class", "inner");
1151
+ o = y.node().appendChild(u);
1152
+ const b = u.getBBox();
1153
+ y.attr("transform", "translate(" + -b.width / 2 + ", " + -b.height / 2 + ")"), h.node().appendChild(u), W[t.id] || (W[t.id] = {}), W[t.id].endLeft = h, rt(o, t.endLabelLeft);
1154
+ }
1155
+ if (t.endLabelRight) {
1156
+ const u = await j(t.endLabelRight, t.labelStyle), h = e.insert("g").attr("class", "edgeTerminals"), y = h.insert("g").attr("class", "inner");
1157
+ o = y.node().appendChild(u);
1158
+ const b = u.getBBox();
1159
+ y.attr("transform", "translate(" + -b.width / 2 + ", " + -b.height / 2 + ")"), h.node().appendChild(u), W[t.id] || (W[t.id] = {}), W[t.id].endRight = h, rt(o, t.endLabelRight);
1160
+ }
1161
+ return l;
1162
+ }, "insertEdgeLabel");
1163
+ function rt(e, t) {
1164
+ z().flowchart.htmlLabels && e && (e.style.width = t.length * 9 + "px", e.style.height = "12px");
1165
+ }
1166
+ d(rt, "setTerminalWidth");
1167
+ var dr = /* @__PURE__ */ d((e, t) => {
1168
+ m.debug("Moving label abc88 ", e.id, e.label, St[e.id], t);
1169
+ let a = t.updatedPath ? t.updatedPath : t.originalPath;
1170
+ const i = z(), { subGraphTitleTotalMargin: l } = ue(i);
1171
+ if (e.label) {
1172
+ const s = St[e.id];
1173
+ let r = e.x, n = e.y;
1174
+ if (a) {
1175
+ const o = et.calcLabelPosition(a);
1176
+ m.debug(
1177
+ "Moving label " + e.label + " from (",
1178
+ r,
1179
+ ",",
1180
+ n,
1181
+ ") to (",
1182
+ o.x,
1183
+ ",",
1184
+ o.y,
1185
+ ") abc88"
1186
+ ), t.updatedPath && (r = o.x, n = o.y);
1187
+ }
1188
+ s.attr("transform", `translate(${r}, ${n + l / 2})`);
1189
+ }
1190
+ if (e.startLabelLeft) {
1191
+ const s = W[e.id].startLeft;
1192
+ let r = e.x, n = e.y;
1193
+ if (a) {
1194
+ const o = et.calcTerminalLabelPosition(e.arrowTypeStart ? 10 : 0, "start_left", a);
1195
+ r = o.x, n = o.y;
1196
+ }
1197
+ s.attr("transform", `translate(${r}, ${n})`);
1198
+ }
1199
+ if (e.startLabelRight) {
1200
+ const s = W[e.id].startRight;
1201
+ let r = e.x, n = e.y;
1202
+ if (a) {
1203
+ const o = et.calcTerminalLabelPosition(
1204
+ e.arrowTypeStart ? 10 : 0,
1205
+ "start_right",
1206
+ a
1207
+ );
1208
+ r = o.x, n = o.y;
1209
+ }
1210
+ s.attr("transform", `translate(${r}, ${n})`);
1211
+ }
1212
+ if (e.endLabelLeft) {
1213
+ const s = W[e.id].endLeft;
1214
+ let r = e.x, n = e.y;
1215
+ if (a) {
1216
+ const o = et.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_left", a);
1217
+ r = o.x, n = o.y;
1218
+ }
1219
+ s.attr("transform", `translate(${r}, ${n})`);
1220
+ }
1221
+ if (e.endLabelRight) {
1222
+ const s = W[e.id].endRight;
1223
+ let r = e.x, n = e.y;
1224
+ if (a) {
1225
+ const o = et.calcTerminalLabelPosition(e.arrowTypeEnd ? 10 : 0, "end_right", a);
1226
+ r = o.x, n = o.y;
1227
+ }
1228
+ s.attr("transform", `translate(${r}, ${n})`);
1229
+ }
1230
+ }, "positionEdgeLabel"), gr = /* @__PURE__ */ d((e, t) => {
1231
+ const a = e.x, i = e.y, l = Math.abs(t.x - a), s = Math.abs(t.y - i), r = e.width / 2, n = e.height / 2;
1232
+ return l >= r || s >= n;
1233
+ }, "outsideNode"), ur = /* @__PURE__ */ d((e, t, a) => {
1234
+ m.debug(`intersection calc abc89:
1235
+ outsidePoint: ${JSON.stringify(t)}
1236
+ insidePoint : ${JSON.stringify(a)}
1237
+ node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);
1238
+ const i = e.x, l = e.y, s = Math.abs(i - a.x), r = e.width / 2;
1239
+ let n = a.x < t.x ? r - s : r + s;
1240
+ const o = e.height / 2, u = Math.abs(t.y - a.y), h = Math.abs(t.x - a.x);
1241
+ if (Math.abs(l - t.y) * r > Math.abs(i - t.x) * o) {
1242
+ let y = a.y < t.y ? t.y - o - l : l - o - t.y;
1243
+ n = h * y / u;
1244
+ const b = {
1245
+ x: a.x < t.x ? a.x + n : a.x - h + n,
1246
+ y: a.y < t.y ? a.y + u - y : a.y - u + y
1247
+ };
1248
+ return n === 0 && (b.x = t.x, b.y = t.y), h === 0 && (b.x = t.x), u === 0 && (b.y = t.y), m.debug(`abc89 topp/bott calc, Q ${u}, q ${y}, R ${h}, r ${n}`, b), b;
1249
+ } else {
1250
+ a.x < t.x ? n = t.x - r - i : n = i - r - t.x;
1251
+ let y = u * n / h, b = a.x < t.x ? a.x + h - n : a.x - h + n, L = a.y < t.y ? a.y + y : a.y - y;
1252
+ return m.debug(`sides calc abc89, Q ${u}, q ${y}, R ${h}, r ${n}`, { _x: b, _y: L }), n === 0 && (b = t.x, L = t.y), h === 0 && (b = t.x), u === 0 && (L = t.y), { x: b, y: L };
1253
+ }
1254
+ }, "intersection"), zt = /* @__PURE__ */ d((e, t) => {
1255
+ m.debug("abc88 cutPathAtIntersect", e, t);
1256
+ let a = [], i = e[0], l = !1;
1257
+ return e.forEach((s) => {
1258
+ if (!gr(t, s) && !l) {
1259
+ const r = ur(t, i, s);
1260
+ let n = !1;
1261
+ a.forEach((o) => {
1262
+ n = n || o.x === r.x && o.y === r.y;
1263
+ }), a.some((o) => o.x === r.x && o.y === r.y) || a.push(r), l = !0;
1264
+ } else
1265
+ i = s, l || a.push(s);
1266
+ }), a;
1267
+ }, "cutPathAtIntersect"), pr = /* @__PURE__ */ d(function(e, t, a, i, l, s, r) {
1268
+ let n = a.points;
1269
+ m.debug("abc88 InsertEdge: edge=", a, "e=", t);
1270
+ let o = !1;
1271
+ const u = s.node(t.v);
1272
+ var h = s.node(t.w);
1273
+ h != null && h.intersect && (u != null && u.intersect) && (n = n.slice(1, a.points.length - 1), n.unshift(u.intersect(n[0])), n.push(h.intersect(n[n.length - 1]))), a.toCluster && (m.debug("to cluster abc88", i[a.toCluster]), n = zt(a.points, i[a.toCluster].node), o = !0), a.fromCluster && (m.debug("from cluster abc88", i[a.fromCluster]), n = zt(n.reverse(), i[a.fromCluster].node).reverse(), o = !0);
1274
+ const y = n.filter((x) => !Number.isNaN(x.y));
1275
+ let b = me;
1276
+ a.curve && (l === "graph" || l === "flowchart") && (b = a.curve);
1277
+ const { x: L, y: E } = pe(a), D = fe().x(L).y(E).curve(b);
1278
+ let v;
1279
+ switch (a.thickness) {
1280
+ case "normal":
1281
+ v = "edge-thickness-normal";
1282
+ break;
1283
+ case "thick":
1284
+ v = "edge-thickness-thick";
1285
+ break;
1286
+ case "invisible":
1287
+ v = "edge-thickness-thick";
1288
+ break;
1289
+ default:
1290
+ v = "";
1291
+ }
1292
+ switch (a.pattern) {
1293
+ case "solid":
1294
+ v += " edge-pattern-solid";
1295
+ break;
1296
+ case "dotted":
1297
+ v += " edge-pattern-dotted";
1298
+ break;
1299
+ case "dashed":
1300
+ v += " edge-pattern-dashed";
1301
+ break;
1302
+ }
1303
+ const N = e.append("path").attr("d", D(y)).attr("id", a.id).attr("class", " " + v + (a.classes ? " " + a.classes : "")).attr("style", a.style);
1304
+ let k = "";
1305
+ (z().flowchart.arrowMarkerAbsolute || z().state.arrowMarkerAbsolute) && (k = xe(!0)), cr(N, a, k, r, l);
1306
+ let T = {};
1307
+ return o && (T.updatedPath = n), T.originalPath = a.points, T;
1308
+ }, "insertEdge"), fr = /* @__PURE__ */ d((e) => {
1309
+ const t = /* @__PURE__ */ new Set();
1310
+ for (const a of e)
1311
+ switch (a) {
1312
+ case "x":
1313
+ t.add("right"), t.add("left");
1314
+ break;
1315
+ case "y":
1316
+ t.add("up"), t.add("down");
1317
+ break;
1318
+ default:
1319
+ t.add(a);
1320
+ break;
1321
+ }
1322
+ return t;
1323
+ }, "expandAndDeduplicateDirections"), xr = /* @__PURE__ */ d((e, t, a) => {
1324
+ const i = fr(e), l = 2, s = t.height + 2 * a.padding, r = s / l, n = t.width + 2 * r + a.padding, o = a.padding / 2;
1325
+ return i.has("right") && i.has("left") && i.has("up") && i.has("down") ? [
1326
+ // Bottom
1327
+ { x: 0, y: 0 },
1328
+ { x: r, y: 0 },
1329
+ { x: n / 2, y: 2 * o },
1330
+ { x: n - r, y: 0 },
1331
+ { x: n, y: 0 },
1332
+ // Right
1333
+ { x: n, y: -s / 3 },
1334
+ { x: n + 2 * o, y: -s / 2 },
1335
+ { x: n, y: -2 * s / 3 },
1336
+ { x: n, y: -s },
1337
+ // Top
1338
+ { x: n - r, y: -s },
1339
+ { x: n / 2, y: -s - 2 * o },
1340
+ { x: r, y: -s },
1341
+ // Left
1342
+ { x: 0, y: -s },
1343
+ { x: 0, y: -2 * s / 3 },
1344
+ { x: -2 * o, y: -s / 2 },
1345
+ { x: 0, y: -s / 3 }
1346
+ ] : i.has("right") && i.has("left") && i.has("up") ? [
1347
+ { x: r, y: 0 },
1348
+ { x: n - r, y: 0 },
1349
+ { x: n, y: -s / 2 },
1350
+ { x: n - r, y: -s },
1351
+ { x: r, y: -s },
1352
+ { x: 0, y: -s / 2 }
1353
+ ] : i.has("right") && i.has("left") && i.has("down") ? [
1354
+ { x: 0, y: 0 },
1355
+ { x: r, y: -s },
1356
+ { x: n - r, y: -s },
1357
+ { x: n, y: 0 }
1358
+ ] : i.has("right") && i.has("up") && i.has("down") ? [
1359
+ { x: 0, y: 0 },
1360
+ { x: n, y: -r },
1361
+ { x: n, y: -s + r },
1362
+ { x: 0, y: -s }
1363
+ ] : i.has("left") && i.has("up") && i.has("down") ? [
1364
+ { x: n, y: 0 },
1365
+ { x: 0, y: -r },
1366
+ { x: 0, y: -s + r },
1367
+ { x: n, y: -s }
1368
+ ] : i.has("right") && i.has("left") ? [
1369
+ { x: r, y: 0 },
1370
+ { x: r, y: -o },
1371
+ { x: n - r, y: -o },
1372
+ { x: n - r, y: 0 },
1373
+ { x: n, y: -s / 2 },
1374
+ { x: n - r, y: -s },
1375
+ { x: n - r, y: -s + o },
1376
+ { x: r, y: -s + o },
1377
+ { x: r, y: -s },
1378
+ { x: 0, y: -s / 2 }
1379
+ ] : i.has("up") && i.has("down") ? [
1380
+ // Bottom center
1381
+ { x: n / 2, y: 0 },
1382
+ // Left pont of bottom arrow
1383
+ { x: 0, y: -o },
1384
+ { x: r, y: -o },
1385
+ // Left top over vertical section
1386
+ { x: r, y: -s + o },
1387
+ { x: 0, y: -s + o },
1388
+ // Top of arrow
1389
+ { x: n / 2, y: -s },
1390
+ { x: n, y: -s + o },
1391
+ // Top of right vertical bar
1392
+ { x: n - r, y: -s + o },
1393
+ { x: n - r, y: -o },
1394
+ { x: n, y: -o }
1395
+ ] : i.has("right") && i.has("up") ? [
1396
+ { x: 0, y: 0 },
1397
+ { x: n, y: -r },
1398
+ { x: 0, y: -s }
1399
+ ] : i.has("right") && i.has("down") ? [
1400
+ { x: 0, y: 0 },
1401
+ { x: n, y: 0 },
1402
+ { x: 0, y: -s }
1403
+ ] : i.has("left") && i.has("up") ? [
1404
+ { x: n, y: 0 },
1405
+ { x: 0, y: -r },
1406
+ { x: n, y: -s }
1407
+ ] : i.has("left") && i.has("down") ? [
1408
+ { x: n, y: 0 },
1409
+ { x: 0, y: 0 },
1410
+ { x: n, y: -s }
1411
+ ] : i.has("right") ? [
1412
+ { x: r, y: -o },
1413
+ { x: r, y: -o },
1414
+ { x: n - r, y: -o },
1415
+ { x: n - r, y: 0 },
1416
+ { x: n, y: -s / 2 },
1417
+ { x: n - r, y: -s },
1418
+ { x: n - r, y: -s + o },
1419
+ // top left corner of arrow
1420
+ { x: r, y: -s + o },
1421
+ { x: r, y: -s + o }
1422
+ ] : i.has("left") ? [
1423
+ { x: r, y: 0 },
1424
+ { x: r, y: -o },
1425
+ // Two points, the right corners
1426
+ { x: n - r, y: -o },
1427
+ { x: n - r, y: -s + o },
1428
+ { x: r, y: -s + o },
1429
+ { x: r, y: -s },
1430
+ { x: 0, y: -s / 2 }
1431
+ ] : i.has("up") ? [
1432
+ // Bottom center
1433
+ { x: r, y: -o },
1434
+ // Left top over vertical section
1435
+ { x: r, y: -s + o },
1436
+ { x: 0, y: -s + o },
1437
+ // Top of arrow
1438
+ { x: n / 2, y: -s },
1439
+ { x: n, y: -s + o },
1440
+ // Top of right vertical bar
1441
+ { x: n - r, y: -s + o },
1442
+ { x: n - r, y: -o }
1443
+ ] : i.has("down") ? [
1444
+ // Bottom center
1445
+ { x: n / 2, y: 0 },
1446
+ // Left pont of bottom arrow
1447
+ { x: 0, y: -o },
1448
+ { x: r, y: -o },
1449
+ // Left top over vertical section
1450
+ { x: r, y: -s + o },
1451
+ { x: n - r, y: -s + o },
1452
+ { x: n - r, y: -o },
1453
+ { x: n, y: -o }
1454
+ ] : [{ x: 0, y: 0 }];
1455
+ }, "getArrowPoints");
1456
+ function Jt(e, t) {
1457
+ return e.intersect(t);
1458
+ }
1459
+ d(Jt, "intersectNode");
1460
+ var yr = Jt;
1461
+ function Qt(e, t, a, i) {
1462
+ var l = e.x, s = e.y, r = l - i.x, n = s - i.y, o = Math.sqrt(t * t * n * n + a * a * r * r), u = Math.abs(t * a * r / o);
1463
+ i.x < l && (u = -u);
1464
+ var h = Math.abs(t * a * n / o);
1465
+ return i.y < s && (h = -h), { x: l + u, y: s + h };
1466
+ }
1467
+ d(Qt, "intersectEllipse");
1468
+ var $t = Qt;
1469
+ function te(e, t, a) {
1470
+ return $t(e, t, t, a);
1471
+ }
1472
+ d(te, "intersectCircle");
1473
+ var br = te;
1474
+ function ee(e, t, a, i) {
1475
+ var l, s, r, n, o, u, h, y, b, L, E, D, v, N, k;
1476
+ if (l = t.y - e.y, r = e.x - t.x, o = t.x * e.y - e.x * t.y, b = l * a.x + r * a.y + o, L = l * i.x + r * i.y + o, !(b !== 0 && L !== 0 && vt(b, L)) && (s = i.y - a.y, n = a.x - i.x, u = i.x * a.y - a.x * i.y, h = s * e.x + n * e.y + u, y = s * t.x + n * t.y + u, !(h !== 0 && y !== 0 && vt(h, y)) && (E = l * n - s * r, E !== 0)))
1477
+ return D = Math.abs(E / 2), v = r * u - n * o, N = v < 0 ? (v - D) / E : (v + D) / E, v = s * o - l * u, k = v < 0 ? (v - D) / E : (v + D) / E, { x: N, y: k };
1478
+ }
1479
+ d(ee, "intersectLine");
1480
+ function vt(e, t) {
1481
+ return e * t > 0;
1482
+ }
1483
+ d(vt, "sameSign");
1484
+ var wr = ee, mr = re;
1485
+ function re(e, t, a) {
1486
+ var i = e.x, l = e.y, s = [], r = Number.POSITIVE_INFINITY, n = Number.POSITIVE_INFINITY;
1487
+ typeof t.forEach == "function" ? t.forEach(function(E) {
1488
+ r = Math.min(r, E.x), n = Math.min(n, E.y);
1489
+ }) : (r = Math.min(r, t.x), n = Math.min(n, t.y));
1490
+ for (var o = i - e.width / 2 - r, u = l - e.height / 2 - n, h = 0; h < t.length; h++) {
1491
+ var y = t[h], b = t[h < t.length - 1 ? h + 1 : 0], L = wr(
1492
+ e,
1493
+ a,
1494
+ { x: o + y.x, y: u + y.y },
1495
+ { x: o + b.x, y: u + b.y }
1496
+ );
1497
+ L && s.push(L);
1498
+ }
1499
+ return s.length ? (s.length > 1 && s.sort(function(E, D) {
1500
+ var v = E.x - a.x, N = E.y - a.y, k = Math.sqrt(v * v + N * N), T = D.x - a.x, x = D.y - a.y, g = Math.sqrt(T * T + x * x);
1501
+ return k < g ? -1 : k === g ? 0 : 1;
1502
+ }), s[0]) : e;
1503
+ }
1504
+ d(re, "intersectPolygon");
1505
+ var Lr = /* @__PURE__ */ d((e, t) => {
1506
+ var a = e.x, i = e.y, l = t.x - a, s = t.y - i, r = e.width / 2, n = e.height / 2, o, u;
1507
+ return Math.abs(s) * r > Math.abs(l) * n ? (s < 0 && (n = -n), o = s === 0 ? 0 : n * l / s, u = n) : (l < 0 && (r = -r), o = r, u = l === 0 ? 0 : r * s / l), { x: a + o, y: i + u };
1508
+ }, "intersectRect"), Sr = Lr, C = {
1509
+ node: yr,
1510
+ circle: br,
1511
+ ellipse: $t,
1512
+ polygon: mr,
1513
+ rect: Sr
1514
+ }, F = /* @__PURE__ */ d(async (e, t, a, i) => {
1515
+ const l = z();
1516
+ let s;
1517
+ const r = t.useHtmlLabels || Z(l.flowchart.htmlLabels);
1518
+ a ? s = a : s = "node default";
1519
+ const n = e.insert("g").attr("class", s).attr("id", t.domId || t.id), o = n.insert("g").attr("class", "label").attr("style", t.labelStyle);
1520
+ let u;
1521
+ t.labelText === void 0 ? u = "" : u = typeof t.labelText == "string" ? t.labelText : t.labelText[0];
1522
+ const h = o.node();
1523
+ let y;
1524
+ t.labelType === "markdown" ? y = Ht(
1525
+ o,
1526
+ yt(bt(u), l),
1527
+ {
1528
+ useHtmlLabels: r,
1529
+ width: t.width || l.flowchart.wrappingWidth,
1530
+ classes: "markdown-node-label"
1531
+ },
1532
+ l
1533
+ ) : y = h.appendChild(
1534
+ await j(
1535
+ yt(bt(u), l),
1536
+ t.labelStyle,
1537
+ !1,
1538
+ i
1539
+ )
1540
+ );
1541
+ let b = y.getBBox();
1542
+ const L = t.padding / 2;
1543
+ if (Z(l.flowchart.htmlLabels)) {
1544
+ const E = y.children[0], D = R(y), v = E.getElementsByTagName("img");
1545
+ if (v) {
1546
+ const N = u.replace(/<img[^>]*>/g, "").trim() === "";
1547
+ await Promise.all(
1548
+ [...v].map(
1549
+ (k) => new Promise((T) => {
1550
+ function x() {
1551
+ if (k.style.display = "flex", k.style.flexDirection = "column", N) {
1552
+ const g = l.fontSize ? l.fontSize : window.getComputedStyle(document.body).fontSize, w = parseInt(g, 10) * 5 + "px";
1553
+ k.style.minWidth = w, k.style.maxWidth = w;
1554
+ } else
1555
+ k.style.width = "100%";
1556
+ T(k);
1557
+ }
1558
+ d(x, "setupImage"), setTimeout(() => {
1559
+ k.complete && x();
1560
+ }), k.addEventListener("error", x), k.addEventListener("load", x);
1561
+ })
1562
+ )
1563
+ );
1564
+ }
1565
+ b = E.getBoundingClientRect(), D.attr("width", b.width), D.attr("height", b.height);
1566
+ }
1567
+ return r ? o.attr("transform", "translate(" + -b.width / 2 + ", " + -b.height / 2 + ")") : o.attr("transform", "translate(0, " + -b.height / 2 + ")"), t.centerLabel && o.attr("transform", "translate(" + -b.width / 2 + ", " + -b.height / 2 + ")"), o.insert("rect", ":first-child"), { shapeSvg: n, bbox: b, halfPadding: L, label: o };
1568
+ }, "labelHelper"), I = /* @__PURE__ */ d((e, t) => {
1569
+ const a = t.node().getBBox();
1570
+ e.width = a.width, e.height = a.height;
1571
+ }, "updateNodeBounds");
1572
+ function G(e, t, a, i) {
1573
+ return e.insert("polygon", ":first-child").attr(
1574
+ "points",
1575
+ i.map(function(l) {
1576
+ return l.x + "," + l.y;
1577
+ }).join(" ")
1578
+ ).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + a / 2 + ")");
1579
+ }
1580
+ d(G, "insertPolygonShape");
1581
+ var vr = /* @__PURE__ */ d(async (e, t) => {
1582
+ t.useHtmlLabels || z().flowchart.htmlLabels || (t.centerLabel = !0);
1583
+ const { shapeSvg: i, bbox: l, halfPadding: s } = await F(
1584
+ e,
1585
+ t,
1586
+ "node " + t.classes,
1587
+ !0
1588
+ );
1589
+ m.info("Classes = ", t.classes);
1590
+ const r = i.insert("rect", ":first-child");
1591
+ return r.attr("rx", t.rx).attr("ry", t.ry).attr("x", -l.width / 2 - s).attr("y", -l.height / 2 - s).attr("width", l.width + t.padding).attr("height", l.height + t.padding), I(t, r), t.intersect = function(n) {
1592
+ return C.rect(t, n);
1593
+ }, i;
1594
+ }, "note"), Er = vr, At = /* @__PURE__ */ d((e) => e ? " " + e : "", "formatClass"), K = /* @__PURE__ */ d((e, t) => `${t || "node default"}${At(e.classes)} ${At(
1595
+ e.class
1596
+ )}`, "getClassesFromNode"), Mt = /* @__PURE__ */ d(async (e, t) => {
1597
+ const { shapeSvg: a, bbox: i } = await F(
1598
+ e,
1599
+ t,
1600
+ K(t, void 0),
1601
+ !0
1602
+ ), l = i.width + t.padding, s = i.height + t.padding, r = l + s, n = [
1603
+ { x: r / 2, y: 0 },
1604
+ { x: r, y: -r / 2 },
1605
+ { x: r / 2, y: -r },
1606
+ { x: 0, y: -r / 2 }
1607
+ ];
1608
+ m.info("Question main (Circle)");
1609
+ const o = G(a, r, r, n);
1610
+ return o.attr("style", t.style), I(t, o), t.intersect = function(u) {
1611
+ return m.warn("Intersect called"), C.polygon(t, n, u);
1612
+ }, a;
1613
+ }, "question"), _r = /* @__PURE__ */ d((e, t) => {
1614
+ const a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), i = 28, l = [
1615
+ { x: 0, y: i / 2 },
1616
+ { x: i / 2, y: 0 },
1617
+ { x: 0, y: -i / 2 },
1618
+ { x: -i / 2, y: 0 }
1619
+ ];
1620
+ return a.insert("polygon", ":first-child").attr(
1621
+ "points",
1622
+ l.map(function(r) {
1623
+ return r.x + "," + r.y;
1624
+ }).join(" ")
1625
+ ).attr("class", "state-start").attr("r", 7).attr("width", 28).attr("height", 28), t.width = 28, t.height = 28, t.intersect = function(r) {
1626
+ return C.circle(t, 14, r);
1627
+ }, a;
1628
+ }, "choice"), kr = /* @__PURE__ */ d(async (e, t) => {
1629
+ const { shapeSvg: a, bbox: i } = await F(
1630
+ e,
1631
+ t,
1632
+ K(t, void 0),
1633
+ !0
1634
+ ), l = 4, s = i.height + t.padding, r = s / l, n = i.width + 2 * r + t.padding, o = [
1635
+ { x: r, y: 0 },
1636
+ { x: n - r, y: 0 },
1637
+ { x: n, y: -s / 2 },
1638
+ { x: n - r, y: -s },
1639
+ { x: r, y: -s },
1640
+ { x: 0, y: -s / 2 }
1641
+ ], u = G(a, n, s, o);
1642
+ return u.attr("style", t.style), I(t, u), t.intersect = function(h) {
1643
+ return C.polygon(t, o, h);
1644
+ }, a;
1645
+ }, "hexagon"), Dr = /* @__PURE__ */ d(async (e, t) => {
1646
+ const { shapeSvg: a, bbox: i } = await F(e, t, void 0, !0), l = 2, s = i.height + 2 * t.padding, r = s / l, n = i.width + 2 * r + t.padding, o = xr(t.directions, i, t), u = G(a, n, s, o);
1647
+ return u.attr("style", t.style), I(t, u), t.intersect = function(h) {
1648
+ return C.polygon(t, o, h);
1649
+ }, a;
1650
+ }, "block_arrow"), Tr = /* @__PURE__ */ d(async (e, t) => {
1651
+ const { shapeSvg: a, bbox: i } = await F(
1652
+ e,
1653
+ t,
1654
+ K(t, void 0),
1655
+ !0
1656
+ ), l = i.width + t.padding, s = i.height + t.padding, r = [
1657
+ { x: -s / 2, y: 0 },
1658
+ { x: l, y: 0 },
1659
+ { x: l, y: -s },
1660
+ { x: -s / 2, y: -s },
1661
+ { x: 0, y: -s / 2 }
1662
+ ];
1663
+ return G(a, l, s, r).attr("style", t.style), t.width = l + s, t.height = s, t.intersect = function(o) {
1664
+ return C.polygon(t, r, o);
1665
+ }, a;
1666
+ }, "rect_left_inv_arrow"), Nr = /* @__PURE__ */ d(async (e, t) => {
1667
+ const { shapeSvg: a, bbox: i } = await F(e, t, K(t), !0), l = i.width + t.padding, s = i.height + t.padding, r = [
1668
+ { x: -2 * s / 6, y: 0 },
1669
+ { x: l - s / 6, y: 0 },
1670
+ { x: l + 2 * s / 6, y: -s },
1671
+ { x: s / 6, y: -s }
1672
+ ], n = G(a, l, s, r);
1673
+ return n.attr("style", t.style), I(t, n), t.intersect = function(o) {
1674
+ return C.polygon(t, r, o);
1675
+ }, a;
1676
+ }, "lean_right"), Cr = /* @__PURE__ */ d(async (e, t) => {
1677
+ const { shapeSvg: a, bbox: i } = await F(
1678
+ e,
1679
+ t,
1680
+ K(t, void 0),
1681
+ !0
1682
+ ), l = i.width + t.padding, s = i.height + t.padding, r = [
1683
+ { x: 2 * s / 6, y: 0 },
1684
+ { x: l + s / 6, y: 0 },
1685
+ { x: l - 2 * s / 6, y: -s },
1686
+ { x: -s / 6, y: -s }
1687
+ ], n = G(a, l, s, r);
1688
+ return n.attr("style", t.style), I(t, n), t.intersect = function(o) {
1689
+ return C.polygon(t, r, o);
1690
+ }, a;
1691
+ }, "lean_left"), Ir = /* @__PURE__ */ d(async (e, t) => {
1692
+ const { shapeSvg: a, bbox: i } = await F(
1693
+ e,
1694
+ t,
1695
+ K(t, void 0),
1696
+ !0
1697
+ ), l = i.width + t.padding, s = i.height + t.padding, r = [
1698
+ { x: -2 * s / 6, y: 0 },
1699
+ { x: l + 2 * s / 6, y: 0 },
1700
+ { x: l - s / 6, y: -s },
1701
+ { x: s / 6, y: -s }
1702
+ ], n = G(a, l, s, r);
1703
+ return n.attr("style", t.style), I(t, n), t.intersect = function(o) {
1704
+ return C.polygon(t, r, o);
1705
+ }, a;
1706
+ }, "trapezoid"), Br = /* @__PURE__ */ d(async (e, t) => {
1707
+ const { shapeSvg: a, bbox: i } = await F(
1708
+ e,
1709
+ t,
1710
+ K(t, void 0),
1711
+ !0
1712
+ ), l = i.width + t.padding, s = i.height + t.padding, r = [
1713
+ { x: s / 6, y: 0 },
1714
+ { x: l - s / 6, y: 0 },
1715
+ { x: l + 2 * s / 6, y: -s },
1716
+ { x: -2 * s / 6, y: -s }
1717
+ ], n = G(a, l, s, r);
1718
+ return n.attr("style", t.style), I(t, n), t.intersect = function(o) {
1719
+ return C.polygon(t, r, o);
1720
+ }, a;
1721
+ }, "inv_trapezoid"), Or = /* @__PURE__ */ d(async (e, t) => {
1722
+ const { shapeSvg: a, bbox: i } = await F(
1723
+ e,
1724
+ t,
1725
+ K(t, void 0),
1726
+ !0
1727
+ ), l = i.width + t.padding, s = i.height + t.padding, r = [
1728
+ { x: 0, y: 0 },
1729
+ { x: l + s / 2, y: 0 },
1730
+ { x: l, y: -s / 2 },
1731
+ { x: l + s / 2, y: -s },
1732
+ { x: 0, y: -s }
1733
+ ], n = G(a, l, s, r);
1734
+ return n.attr("style", t.style), I(t, n), t.intersect = function(o) {
1735
+ return C.polygon(t, r, o);
1736
+ }, a;
1737
+ }, "rect_right_inv_arrow"), Rr = /* @__PURE__ */ d(async (e, t) => {
1738
+ const { shapeSvg: a, bbox: i } = await F(
1739
+ e,
1740
+ t,
1741
+ K(t, void 0),
1742
+ !0
1743
+ ), l = i.width + t.padding, s = l / 2, r = s / (2.5 + l / 50), n = i.height + r + t.padding, o = "M 0," + r + " a " + s + "," + r + " 0,0,0 " + l + " 0 a " + s + "," + r + " 0,0,0 " + -l + " 0 l 0," + n + " a " + s + "," + r + " 0,0,0 " + l + " 0 l 0," + -n, u = a.attr("label-offset-y", r).insert("path", ":first-child").attr("style", t.style).attr("d", o).attr("transform", "translate(" + -l / 2 + "," + -(n / 2 + r) + ")");
1744
+ return I(t, u), t.intersect = function(h) {
1745
+ const y = C.rect(t, h), b = y.x - t.x;
1746
+ if (s != 0 && (Math.abs(b) < t.width / 2 || Math.abs(b) == t.width / 2 && Math.abs(y.y - t.y) > t.height / 2 - r)) {
1747
+ let L = r * r * (1 - b * b / (s * s));
1748
+ L != 0 && (L = Math.sqrt(L)), L = r - L, h.y - t.y > 0 && (L = -L), y.y += L;
1749
+ }
1750
+ return y;
1751
+ }, a;
1752
+ }, "cylinder"), zr = /* @__PURE__ */ d(async (e, t) => {
1753
+ const { shapeSvg: a, bbox: i, halfPadding: l } = await F(
1754
+ e,
1755
+ t,
1756
+ "node " + t.classes + " " + t.class,
1757
+ !0
1758
+ ), s = a.insert("rect", ":first-child"), r = t.positioned ? t.width : i.width + t.padding, n = t.positioned ? t.height : i.height + t.padding, o = t.positioned ? -r / 2 : -i.width / 2 - l, u = t.positioned ? -n / 2 : -i.height / 2 - l;
1759
+ if (s.attr("class", "basic label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", o).attr("y", u).attr("width", r).attr("height", n), t.props) {
1760
+ const h = new Set(Object.keys(t.props));
1761
+ t.props.borders && (dt(s, t.props.borders, r, n), h.delete("borders")), h.forEach((y) => {
1762
+ m.warn(`Unknown node property ${y}`);
1763
+ });
1764
+ }
1765
+ return I(t, s), t.intersect = function(h) {
1766
+ return C.rect(t, h);
1767
+ }, a;
1768
+ }, "rect"), Ar = /* @__PURE__ */ d(async (e, t) => {
1769
+ const { shapeSvg: a, bbox: i, halfPadding: l } = await F(
1770
+ e,
1771
+ t,
1772
+ "node " + t.classes,
1773
+ !0
1774
+ ), s = a.insert("rect", ":first-child"), r = t.positioned ? t.width : i.width + t.padding, n = t.positioned ? t.height : i.height + t.padding, o = t.positioned ? -r / 2 : -i.width / 2 - l, u = t.positioned ? -n / 2 : -i.height / 2 - l;
1775
+ if (s.attr("class", "basic cluster composite label-container").attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("x", o).attr("y", u).attr("width", r).attr("height", n), t.props) {
1776
+ const h = new Set(Object.keys(t.props));
1777
+ t.props.borders && (dt(s, t.props.borders, r, n), h.delete("borders")), h.forEach((y) => {
1778
+ m.warn(`Unknown node property ${y}`);
1779
+ });
1780
+ }
1781
+ return I(t, s), t.intersect = function(h) {
1782
+ return C.rect(t, h);
1783
+ }, a;
1784
+ }, "composite"), Mr = /* @__PURE__ */ d(async (e, t) => {
1785
+ const { shapeSvg: a } = await F(e, t, "label", !0);
1786
+ m.trace("Classes = ", t.class);
1787
+ const i = a.insert("rect", ":first-child"), l = 0, s = 0;
1788
+ if (i.attr("width", l).attr("height", s), a.attr("class", "label edgeLabel"), t.props) {
1789
+ const r = new Set(Object.keys(t.props));
1790
+ t.props.borders && (dt(i, t.props.borders, l, s), r.delete("borders")), r.forEach((n) => {
1791
+ m.warn(`Unknown node property ${n}`);
1792
+ });
1793
+ }
1794
+ return I(t, i), t.intersect = function(r) {
1795
+ return C.rect(t, r);
1796
+ }, a;
1797
+ }, "labelRect");
1798
+ function dt(e, t, a, i) {
1799
+ const l = [], s = /* @__PURE__ */ d((n) => {
1800
+ l.push(n, 0);
1801
+ }, "addBorder"), r = /* @__PURE__ */ d((n) => {
1802
+ l.push(0, n);
1803
+ }, "skipBorder");
1804
+ t.includes("t") ? (m.debug("add top border"), s(a)) : r(a), t.includes("r") ? (m.debug("add right border"), s(i)) : r(i), t.includes("b") ? (m.debug("add bottom border"), s(a)) : r(a), t.includes("l") ? (m.debug("add left border"), s(i)) : r(i), e.attr("stroke-dasharray", l.join(" "));
1805
+ }
1806
+ d(dt, "applyNodePropertyBorders");
1807
+ var Fr = /* @__PURE__ */ d(async (e, t) => {
1808
+ let a;
1809
+ t.classes ? a = "node " + t.classes : a = "node default";
1810
+ const i = e.insert("g").attr("class", a).attr("id", t.domId || t.id), l = i.insert("rect", ":first-child"), s = i.insert("line"), r = i.insert("g").attr("class", "label"), n = t.labelText.flat ? t.labelText.flat() : t.labelText;
1811
+ let o = "";
1812
+ typeof n == "object" ? o = n[0] : o = n, m.info("Label text abc79", o, n, typeof n == "object");
1813
+ const u = r.node().appendChild(await j(o, t.labelStyle, !0, !0));
1814
+ let h = { width: 0, height: 0 };
1815
+ if (Z(z().flowchart.htmlLabels)) {
1816
+ const D = u.children[0], v = R(u);
1817
+ h = D.getBoundingClientRect(), v.attr("width", h.width), v.attr("height", h.height);
1818
+ }
1819
+ m.info("Text 2", n);
1820
+ const y = n.slice(1, n.length);
1821
+ let b = u.getBBox();
1822
+ const L = r.node().appendChild(
1823
+ await j(
1824
+ y.join ? y.join("<br/>") : y,
1825
+ t.labelStyle,
1826
+ !0,
1827
+ !0
1828
+ )
1829
+ );
1830
+ if (Z(z().flowchart.htmlLabels)) {
1831
+ const D = L.children[0], v = R(L);
1832
+ h = D.getBoundingClientRect(), v.attr("width", h.width), v.attr("height", h.height);
1833
+ }
1834
+ const E = t.padding / 2;
1835
+ return R(L).attr(
1836
+ "transform",
1837
+ "translate( " + // (titleBox.width - bbox.width) / 2 +
1838
+ (h.width > b.width ? 0 : (b.width - h.width) / 2) + ", " + (b.height + E + 5) + ")"
1839
+ ), R(u).attr(
1840
+ "transform",
1841
+ "translate( " + // (titleBox.width - bbox.width) / 2 +
1842
+ (h.width < b.width ? 0 : -(b.width - h.width) / 2) + ", 0)"
1843
+ ), h = r.node().getBBox(), r.attr(
1844
+ "transform",
1845
+ "translate(" + -h.width / 2 + ", " + (-h.height / 2 - E + 3) + ")"
1846
+ ), l.attr("class", "outer title-state").attr("x", -h.width / 2 - E).attr("y", -h.height / 2 - E).attr("width", h.width + t.padding).attr("height", h.height + t.padding), s.attr("class", "divider").attr("x1", -h.width / 2 - E).attr("x2", h.width / 2 + E).attr("y1", -h.height / 2 - E + b.height + E).attr("y2", -h.height / 2 - E + b.height + E), I(t, l), t.intersect = function(D) {
1847
+ return C.rect(t, D);
1848
+ }, i;
1849
+ }, "rectWithTitle"), Wr = /* @__PURE__ */ d(async (e, t) => {
1850
+ const { shapeSvg: a, bbox: i } = await F(
1851
+ e,
1852
+ t,
1853
+ K(t, void 0),
1854
+ !0
1855
+ ), l = i.height + t.padding, s = i.width + l / 4 + t.padding, r = a.insert("rect", ":first-child").attr("style", t.style).attr("rx", l / 2).attr("ry", l / 2).attr("x", -s / 2).attr("y", -l / 2).attr("width", s).attr("height", l);
1856
+ return I(t, r), t.intersect = function(n) {
1857
+ return C.rect(t, n);
1858
+ }, a;
1859
+ }, "stadium"), Pr = /* @__PURE__ */ d(async (e, t) => {
1860
+ const { shapeSvg: a, bbox: i, halfPadding: l } = await F(
1861
+ e,
1862
+ t,
1863
+ K(t, void 0),
1864
+ !0
1865
+ ), s = a.insert("circle", ":first-child");
1866
+ return s.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", i.width / 2 + l).attr("width", i.width + t.padding).attr("height", i.height + t.padding), m.info("Circle main"), I(t, s), t.intersect = function(r) {
1867
+ return m.info("Circle intersect", t, i.width / 2 + l, r), C.circle(t, i.width / 2 + l, r);
1868
+ }, a;
1869
+ }, "circle"), Yr = /* @__PURE__ */ d(async (e, t) => {
1870
+ const { shapeSvg: a, bbox: i, halfPadding: l } = await F(
1871
+ e,
1872
+ t,
1873
+ K(t, void 0),
1874
+ !0
1875
+ ), s = 5, r = a.insert("g", ":first-child"), n = r.insert("circle"), o = r.insert("circle");
1876
+ return r.attr("class", t.class), n.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", i.width / 2 + l + s).attr("width", i.width + t.padding + s * 2).attr("height", i.height + t.padding + s * 2), o.attr("style", t.style).attr("rx", t.rx).attr("ry", t.ry).attr("r", i.width / 2 + l).attr("width", i.width + t.padding).attr("height", i.height + t.padding), m.info("DoubleCircle main"), I(t, n), t.intersect = function(u) {
1877
+ return m.info("DoubleCircle intersect", t, i.width / 2 + l + s, u), C.circle(t, i.width / 2 + l + s, u);
1878
+ }, a;
1879
+ }, "doublecircle"), Hr = /* @__PURE__ */ d(async (e, t) => {
1880
+ const { shapeSvg: a, bbox: i } = await F(
1881
+ e,
1882
+ t,
1883
+ K(t, void 0),
1884
+ !0
1885
+ ), l = i.width + t.padding, s = i.height + t.padding, r = [
1886
+ { x: 0, y: 0 },
1887
+ { x: l, y: 0 },
1888
+ { x: l, y: -s },
1889
+ { x: 0, y: -s },
1890
+ { x: 0, y: 0 },
1891
+ { x: -8, y: 0 },
1892
+ { x: l + 8, y: 0 },
1893
+ { x: l + 8, y: -s },
1894
+ { x: -8, y: -s },
1895
+ { x: -8, y: 0 }
1896
+ ], n = G(a, l, s, r);
1897
+ return n.attr("style", t.style), I(t, n), t.intersect = function(o) {
1898
+ return C.polygon(t, r, o);
1899
+ }, a;
1900
+ }, "subroutine"), Kr = /* @__PURE__ */ d((e, t) => {
1901
+ const a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), i = a.insert("circle", ":first-child");
1902
+ return i.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), I(t, i), t.intersect = function(l) {
1903
+ return C.circle(t, 7, l);
1904
+ }, a;
1905
+ }, "start"), Ft = /* @__PURE__ */ d((e, t, a) => {
1906
+ const i = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id);
1907
+ let l = 70, s = 10;
1908
+ a === "LR" && (l = 10, s = 70);
1909
+ const r = i.append("rect").attr("x", -1 * l / 2).attr("y", -1 * s / 2).attr("width", l).attr("height", s).attr("class", "fork-join");
1910
+ return I(t, r), t.height = t.height + t.padding / 2, t.width = t.width + t.padding / 2, t.intersect = function(n) {
1911
+ return C.rect(t, n);
1912
+ }, i;
1913
+ }, "forkJoin"), Xr = /* @__PURE__ */ d((e, t) => {
1914
+ const a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), i = a.insert("circle", ":first-child"), l = a.insert("circle", ":first-child");
1915
+ return l.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14), i.attr("class", "state-end").attr("r", 5).attr("width", 10).attr("height", 10), I(t, l), t.intersect = function(s) {
1916
+ return C.circle(t, 7, s);
1917
+ }, a;
1918
+ }, "end"), Ur = /* @__PURE__ */ d(async (e, t) => {
1919
+ var S;
1920
+ const a = t.padding / 2, i = 4, l = 8;
1921
+ let s;
1922
+ t.classes ? s = "node " + t.classes : s = "node default";
1923
+ const r = e.insert("g").attr("class", s).attr("id", t.domId || t.id), n = r.insert("rect", ":first-child"), o = r.insert("line"), u = r.insert("line");
1924
+ let h = 0, y = i;
1925
+ const b = r.insert("g").attr("class", "label");
1926
+ let L = 0;
1927
+ const E = (S = t.classData.annotations) == null ? void 0 : S[0], D = t.classData.annotations[0] ? "«" + t.classData.annotations[0] + "»" : "", v = b.node().appendChild(await j(D, t.labelStyle, !0, !0));
1928
+ let N = v.getBBox();
1929
+ if (Z(z().flowchart.htmlLabels)) {
1930
+ const c = v.children[0], _ = R(v);
1931
+ N = c.getBoundingClientRect(), _.attr("width", N.width), _.attr("height", N.height);
1932
+ }
1933
+ t.classData.annotations[0] && (y += N.height + i, h += N.width);
1934
+ let k = t.classData.label;
1935
+ t.classData.type !== void 0 && t.classData.type !== "" && (z().flowchart.htmlLabels ? k += "&lt;" + t.classData.type + "&gt;" : k += "<" + t.classData.type + ">");
1936
+ const T = b.node().appendChild(await j(k, t.labelStyle, !0, !0));
1937
+ R(T).attr("class", "classTitle");
1938
+ let x = T.getBBox();
1939
+ if (Z(z().flowchart.htmlLabels)) {
1940
+ const c = T.children[0], _ = R(T);
1941
+ x = c.getBoundingClientRect(), _.attr("width", x.width), _.attr("height", x.height);
1942
+ }
1943
+ y += x.height + i, x.width > h && (h = x.width);
1944
+ const g = [];
1945
+ t.classData.members.forEach(async (c) => {
1946
+ const _ = c.getDisplayDetails();
1947
+ let f = _.displayText;
1948
+ z().flowchart.htmlLabels && (f = f.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
1949
+ const A = b.node().appendChild(
1950
+ await j(
1951
+ f,
1952
+ _.cssStyle ? _.cssStyle : t.labelStyle,
1953
+ !0,
1954
+ !0
1955
+ )
1956
+ );
1957
+ let O = A.getBBox();
1958
+ if (Z(z().flowchart.htmlLabels)) {
1959
+ const X = A.children[0], P = R(A);
1960
+ O = X.getBoundingClientRect(), P.attr("width", O.width), P.attr("height", O.height);
1961
+ }
1962
+ O.width > h && (h = O.width), y += O.height + i, g.push(A);
1963
+ }), y += l;
1964
+ const p = [];
1965
+ if (t.classData.methods.forEach(async (c) => {
1966
+ const _ = c.getDisplayDetails();
1967
+ let f = _.displayText;
1968
+ z().flowchart.htmlLabels && (f = f.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
1969
+ const A = b.node().appendChild(
1970
+ await j(
1971
+ f,
1972
+ _.cssStyle ? _.cssStyle : t.labelStyle,
1973
+ !0,
1974
+ !0
1975
+ )
1976
+ );
1977
+ let O = A.getBBox();
1978
+ if (Z(z().flowchart.htmlLabels)) {
1979
+ const X = A.children[0], P = R(A);
1980
+ O = X.getBoundingClientRect(), P.attr("width", O.width), P.attr("height", O.height);
1981
+ }
1982
+ O.width > h && (h = O.width), y += O.height + i, p.push(A);
1983
+ }), y += l, E) {
1984
+ let c = (h - N.width) / 2;
1985
+ R(v).attr(
1986
+ "transform",
1987
+ "translate( " + (-1 * h / 2 + c) + ", " + -1 * y / 2 + ")"
1988
+ ), L = N.height + i;
1989
+ }
1990
+ let w = (h - x.width) / 2;
1991
+ return R(T).attr(
1992
+ "transform",
1993
+ "translate( " + (-1 * h / 2 + w) + ", " + (-1 * y / 2 + L) + ")"
1994
+ ), L += x.height + i, o.attr("class", "divider").attr("x1", -h / 2 - a).attr("x2", h / 2 + a).attr("y1", -y / 2 - a + l + L).attr("y2", -y / 2 - a + l + L), L += l, g.forEach((c) => {
1995
+ R(c).attr(
1996
+ "transform",
1997
+ "translate( " + -h / 2 + ", " + (-1 * y / 2 + L + l / 2) + ")"
1998
+ );
1999
+ const _ = c == null ? void 0 : c.getBBox();
2000
+ L += ((_ == null ? void 0 : _.height) ?? 0) + i;
2001
+ }), L += l, u.attr("class", "divider").attr("x1", -h / 2 - a).attr("x2", h / 2 + a).attr("y1", -y / 2 - a + l + L).attr("y2", -y / 2 - a + l + L), L += l, p.forEach((c) => {
2002
+ R(c).attr(
2003
+ "transform",
2004
+ "translate( " + -h / 2 + ", " + (-1 * y / 2 + L) + ")"
2005
+ );
2006
+ const _ = c == null ? void 0 : c.getBBox();
2007
+ L += ((_ == null ? void 0 : _.height) ?? 0) + i;
2008
+ }), n.attr("style", t.style).attr("class", "outer title-state").attr("x", -h / 2 - a).attr("y", -(y / 2) - a).attr("width", h + t.padding).attr("height", y + t.padding), I(t, n), t.intersect = function(c) {
2009
+ return C.rect(t, c);
2010
+ }, r;
2011
+ }, "class_box"), Wt = {
2012
+ rhombus: Mt,
2013
+ composite: Ar,
2014
+ question: Mt,
2015
+ rect: zr,
2016
+ labelRect: Mr,
2017
+ rectWithTitle: Fr,
2018
+ choice: _r,
2019
+ circle: Pr,
2020
+ doublecircle: Yr,
2021
+ stadium: Wr,
2022
+ hexagon: kr,
2023
+ block_arrow: Dr,
2024
+ rect_left_inv_arrow: Tr,
2025
+ lean_right: Nr,
2026
+ lean_left: Cr,
2027
+ trapezoid: Ir,
2028
+ inv_trapezoid: Br,
2029
+ rect_right_inv_arrow: Or,
2030
+ cylinder: Rr,
2031
+ start: Kr,
2032
+ end: Xr,
2033
+ note: Er,
2034
+ subroutine: Hr,
2035
+ fork: Ft,
2036
+ join: Ft,
2037
+ class_box: Ur
2038
+ }, ct = {}, ae = /* @__PURE__ */ d(async (e, t, a) => {
2039
+ let i, l;
2040
+ if (t.link) {
2041
+ let s;
2042
+ z().securityLevel === "sandbox" ? s = "_top" : t.linkTarget && (s = t.linkTarget || "_blank"), i = e.insert("svg:a").attr("xlink:href", t.link).attr("target", s), l = await Wt[t.shape](i, t, a);
2043
+ } else
2044
+ l = await Wt[t.shape](e, t, a), i = l;
2045
+ return t.tooltip && l.attr("title", t.tooltip), t.class && l.attr("class", "node default " + t.class), ct[t.id] = i, t.haveCallback && ct[t.id].attr("class", ct[t.id].attr("class") + " clickable"), i;
2046
+ }, "insertNode"), jr = /* @__PURE__ */ d((e) => {
2047
+ const t = ct[e.id];
2048
+ m.trace(
2049
+ "Transforming node",
2050
+ e.diff,
2051
+ e,
2052
+ "translate(" + (e.x - e.width / 2 - 5) + ", " + e.width / 2 + ")"
2053
+ );
2054
+ const a = 8, i = e.diff || 0;
2055
+ return e.clusterNode ? t.attr(
2056
+ "transform",
2057
+ "translate(" + (e.x + i - e.width / 2) + ", " + (e.y - e.height / 2 - a) + ")"
2058
+ ) : t.attr("transform", "translate(" + e.x + ", " + e.y + ")"), i;
2059
+ }, "positionNode");
2060
+ function Tt(e, t, a = !1) {
2061
+ var b, L, E;
2062
+ const i = e;
2063
+ let l = "default";
2064
+ (((b = i == null ? void 0 : i.classes) == null ? void 0 : b.length) || 0) > 0 && (l = ((i == null ? void 0 : i.classes) ?? []).join(" ")), l = l + " flowchart-label";
2065
+ let s = 0, r = "", n;
2066
+ switch (i.type) {
2067
+ case "round":
2068
+ s = 5, r = "rect";
2069
+ break;
2070
+ case "composite":
2071
+ s = 0, r = "composite", n = 0;
2072
+ break;
2073
+ case "square":
2074
+ r = "rect";
2075
+ break;
2076
+ case "diamond":
2077
+ r = "question";
2078
+ break;
2079
+ case "hexagon":
2080
+ r = "hexagon";
2081
+ break;
2082
+ case "block_arrow":
2083
+ r = "block_arrow";
2084
+ break;
2085
+ case "odd":
2086
+ r = "rect_left_inv_arrow";
2087
+ break;
2088
+ case "lean_right":
2089
+ r = "lean_right";
2090
+ break;
2091
+ case "lean_left":
2092
+ r = "lean_left";
2093
+ break;
2094
+ case "trapezoid":
2095
+ r = "trapezoid";
2096
+ break;
2097
+ case "inv_trapezoid":
2098
+ r = "inv_trapezoid";
2099
+ break;
2100
+ case "rect_left_inv_arrow":
2101
+ r = "rect_left_inv_arrow";
2102
+ break;
2103
+ case "circle":
2104
+ r = "circle";
2105
+ break;
2106
+ case "ellipse":
2107
+ r = "ellipse";
2108
+ break;
2109
+ case "stadium":
2110
+ r = "stadium";
2111
+ break;
2112
+ case "subroutine":
2113
+ r = "subroutine";
2114
+ break;
2115
+ case "cylinder":
2116
+ r = "cylinder";
2117
+ break;
2118
+ case "group":
2119
+ r = "rect";
2120
+ break;
2121
+ case "doublecircle":
2122
+ r = "doublecircle";
2123
+ break;
2124
+ default:
2125
+ r = "rect";
2126
+ }
2127
+ const o = ge((i == null ? void 0 : i.styles) ?? []), u = i.label, h = i.size ?? { width: 0, height: 0, x: 0, y: 0 };
2128
+ return {
2129
+ labelStyle: o.labelStyle,
2130
+ shape: r,
2131
+ labelText: u,
2132
+ rx: s,
2133
+ ry: s,
2134
+ class: l,
2135
+ style: o.style,
2136
+ id: i.id,
2137
+ directions: i.directions,
2138
+ width: h.width,
2139
+ height: h.height,
2140
+ x: h.x,
2141
+ y: h.y,
2142
+ positioned: a,
2143
+ intersect: void 0,
2144
+ type: i.type,
2145
+ padding: n ?? ((E = (L = st()) == null ? void 0 : L.block) == null ? void 0 : E.padding) ?? 0
2146
+ };
2147
+ }
2148
+ d(Tt, "getNodeFromBlock");
2149
+ async function se(e, t, a) {
2150
+ const i = Tt(t, a, !1);
2151
+ if (i.type === "group")
2152
+ return;
2153
+ const l = st(), s = await ae(e, i, { config: l }), r = s.node().getBBox(), n = a.getBlock(i.id);
2154
+ n.size = { width: r.width, height: r.height, x: 0, y: 0, node: s }, a.setBlock(n), s.remove();
2155
+ }
2156
+ d(se, "calculateBlockSize");
2157
+ async function ie(e, t, a) {
2158
+ const i = Tt(t, a, !0);
2159
+ if (a.getBlock(i.id).type !== "space") {
2160
+ const s = st();
2161
+ await ae(e, i, { config: s }), t.intersect = i == null ? void 0 : i.intersect, jr(i);
2162
+ }
2163
+ }
2164
+ d(ie, "insertBlockPositioned");
2165
+ async function gt(e, t, a, i) {
2166
+ for (const l of t)
2167
+ await i(e, l, a), l.children && await gt(e, l.children, a, i);
2168
+ }
2169
+ d(gt, "performOperations");
2170
+ async function ne(e, t, a) {
2171
+ await gt(e, t, a, se);
2172
+ }
2173
+ d(ne, "calculateBlockSizes");
2174
+ async function le(e, t, a) {
2175
+ await gt(e, t, a, ie);
2176
+ }
2177
+ d(le, "insertBlocks");
2178
+ async function ce(e, t, a, i, l) {
2179
+ const s = new Ee({
2180
+ multigraph: !0,
2181
+ compound: !0
2182
+ });
2183
+ s.setGraph({
2184
+ rankdir: "TB",
2185
+ nodesep: 10,
2186
+ ranksep: 10,
2187
+ marginx: 8,
2188
+ marginy: 8
2189
+ });
2190
+ for (const r of a)
2191
+ r.size && s.setNode(r.id, {
2192
+ width: r.size.width,
2193
+ height: r.size.height,
2194
+ intersect: r.intersect
2195
+ });
2196
+ for (const r of t)
2197
+ if (r.start && r.end) {
2198
+ const n = i.getBlock(r.start), o = i.getBlock(r.end);
2199
+ if (n != null && n.size && (o != null && o.size)) {
2200
+ const u = n.size, h = o.size, y = [
2201
+ { x: u.x, y: u.y },
2202
+ { x: u.x + (h.x - u.x) / 2, y: u.y + (h.y - u.y) / 2 },
2203
+ { x: h.x, y: h.y }
2204
+ ];
2205
+ pr(
2206
+ e,
2207
+ { v: r.start, w: r.end, name: r.id },
2208
+ {
2209
+ ...r,
2210
+ arrowTypeEnd: r.arrowTypeEnd,
2211
+ arrowTypeStart: r.arrowTypeStart,
2212
+ points: y,
2213
+ classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"
2214
+ },
2215
+ void 0,
2216
+ "block",
2217
+ s,
2218
+ l
2219
+ ), r.label && (await hr(e, {
2220
+ ...r,
2221
+ label: r.label,
2222
+ labelStyle: "stroke: #333; stroke-width: 1.5px;fill:none;",
2223
+ arrowTypeEnd: r.arrowTypeEnd,
2224
+ arrowTypeStart: r.arrowTypeStart,
2225
+ points: y,
2226
+ classes: "edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"
2227
+ }), dr(
2228
+ { ...r, x: y[1].x, y: y[1].y },
2229
+ {
2230
+ originalPath: y
2231
+ }
2232
+ ));
2233
+ }
2234
+ }
2235
+ }
2236
+ d(ce, "insertEdges");
2237
+ var Vr = /* @__PURE__ */ d(function(e, t) {
2238
+ return t.db.getClasses();
2239
+ }, "getClasses"), Gr = /* @__PURE__ */ d(async function(e, t, a, i) {
2240
+ const { securityLevel: l, block: s } = st(), r = i.db;
2241
+ let n;
2242
+ l === "sandbox" && (n = R("#i" + t));
2243
+ const o = l === "sandbox" ? R(n.nodes()[0].contentDocument.body) : R("body"), u = l === "sandbox" ? o.select(`[id="${t}"]`) : R(`[id="${t}"]`);
2244
+ ir(u, ["point", "circle", "cross"], i.type, t);
2245
+ const y = r.getBlocks(), b = r.getBlocksFlat(), L = r.getEdges(), E = u.insert("g").attr("class", "block");
2246
+ await ne(E, y, r);
2247
+ const D = Zt(r);
2248
+ if (await le(E, y, r), await ce(E, L, b, r, t), D) {
2249
+ const v = D, N = Math.max(1, Math.round(0.125 * (v.width / v.height))), k = v.height + N + 10, T = v.width + 10, { useMaxWidth: x } = s;
2250
+ ye(u, k, T, !!x), m.debug("Here Bounds", D, v), u.attr(
2251
+ "viewBox",
2252
+ `${v.x - 5} ${v.y - 5} ${v.width + 10} ${v.height + 10}`
2253
+ );
2254
+ }
2255
+ }, "draw"), Zr = {
2256
+ draw: Gr,
2257
+ getClasses: Vr
2258
+ }, ra = {
2259
+ parser: ke,
2260
+ db: Ue,
2261
+ renderer: Zr,
2262
+ styles: Ve
2263
+ };
2264
+ export {
2265
+ ra as diagram
2266
+ };