@loopstack/loopstack-studio 0.25.0 → 0.25.2

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 (196) hide show
  1. package/dist/components/ai-elements/message.js +2 -2
  2. package/dist/components/ai-elements/reasoning.js +9 -9
  3. package/dist/loopstack-studio.css +1 -1
  4. package/dist/node_modules/@chevrotain/gast/lib/src/helpers.js +2 -5
  5. package/dist/node_modules/@chevrotain/gast/lib/src/model.js +69 -72
  6. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{architecture-7HQA4BMR.js → architecture-YZFGNWBL.js} +2 -2
  7. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-TQ3KTPDO.js → chunk-2KRD3SAO.js} +1 -1
  8. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-4F5CHEZ2.js → chunk-67CJDMHE.js} +1 -1
  9. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-UMXZTB3W.js → chunk-7N4EOEYR.js} +5 -2
  10. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-PL6DKKU2.js → chunk-AA7GKIK3.js} +1 -1
  11. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-CIAEETIT.js +23 -0
  12. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-SJTYNZTY.js → chunk-FOC6F5B3.js} +1 -1
  13. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-K5T4RW27.js +1197 -0
  14. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-FRFDVMJY.js → chunk-KGLVRYIC.js} +1 -1
  15. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-B2363JML.js → chunk-LIHQZDEY.js} +1 -1
  16. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-ORNJ4GCN.js +29 -0
  17. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{gitGraph-G5XIXVHT.js → gitGraph-7Q5UKJZL.js} +2 -2
  18. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-OMHHGYJF.js +3 -0
  19. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-4T2RLAQJ.js +3 -0
  20. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-ZZUOXDRM.js +3 -0
  21. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-PYXPWWZC.js +3 -0
  22. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treeView-SZITEDCU.js +3 -0
  23. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-W4RFUUIX.js +3 -0
  24. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/wardley-RL74JXVD.js +3 -0
  25. package/dist/node_modules/@mermaid-js/parser/dist/mermaid-parser.core.js +27 -17
  26. package/dist/node_modules/@upsetjs/venn.js/build/venn.esm.js +903 -0
  27. package/dist/node_modules/@xyflow/react/dist/esm/index.js +76 -75
  28. package/dist/node_modules/@xyflow/system/dist/esm/index.js +30 -28
  29. package/dist/node_modules/chevrotain/lib/src/parse/cst/cst_visitor.js +31 -40
  30. package/dist/node_modules/chevrotain/lib/src/parse/errors_public.js +23 -26
  31. package/dist/node_modules/chevrotain/lib/src/parse/exceptions_public.js +12 -13
  32. package/dist/node_modules/chevrotain/lib/src/parse/grammar/checks.js +181 -205
  33. package/dist/node_modules/chevrotain/lib/src/parse/grammar/first.js +11 -13
  34. package/dist/node_modules/chevrotain/lib/src/parse/grammar/follow.js +12 -13
  35. package/dist/node_modules/chevrotain/lib/src/parse/grammar/gast/gast_resolver_public.js +8 -9
  36. package/dist/node_modules/chevrotain/lib/src/parse/grammar/interpreter.js +176 -183
  37. package/dist/node_modules/chevrotain/lib/src/parse/grammar/llk_lookahead.js +17 -19
  38. package/dist/node_modules/chevrotain/lib/src/parse/grammar/lookahead.js +153 -160
  39. package/dist/node_modules/chevrotain/lib/src/parse/grammar/resolver.js +10 -12
  40. package/dist/node_modules/chevrotain/lib/src/parse/grammar/rest.js +36 -38
  41. package/dist/node_modules/chevrotain/lib/src/parse/parser/parser.js +37 -45
  42. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/error_handler.js +12 -14
  43. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/gast_recorder.js +80 -86
  44. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/lexer_adapter.js +6 -2
  45. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/looksahead.js +39 -41
  46. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/perf_tracer.js +7 -8
  47. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_api.js +69 -70
  48. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_engine.js +215 -205
  49. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recoverable.js +76 -76
  50. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/tree_builder.js +29 -39
  51. package/dist/node_modules/chevrotain/lib/src/scan/lexer.js +252 -274
  52. package/dist/node_modules/chevrotain/lib/src/scan/lexer_public.js +93 -106
  53. package/dist/node_modules/chevrotain/lib/src/scan/reg_exp.js +61 -61
  54. package/dist/node_modules/chevrotain/lib/src/scan/tokens.js +31 -41
  55. package/dist/node_modules/chevrotain/lib/src/scan/tokens_public.js +15 -18
  56. package/dist/node_modules/chevrotain-allstar/lib/all-star-lookahead.js +226 -226
  57. package/dist/node_modules/chevrotain-allstar/lib/atn.js +17 -17
  58. package/dist/node_modules/cytoscape/dist/cytoscape.esm.js +17 -14
  59. package/dist/node_modules/dagre-d3-es/src/dagre/greedy-fas.js +19 -19
  60. package/dist/node_modules/dagre-d3-es/src/dagre/layout.js +48 -48
  61. package/dist/node_modules/dagre-d3-es/src/dagre/nesting-graph.js +9 -9
  62. package/dist/node_modules/dagre-d3-es/src/dagre/order/cross-count.js +3 -3
  63. package/dist/node_modules/dagre-d3-es/src/dagre/order/index.js +11 -11
  64. package/dist/node_modules/dagre-d3-es/src/dagre/order/init-order.js +4 -4
  65. package/dist/node_modules/dagre-d3-es/src/dagre/order/resolve-conflicts.js +4 -4
  66. package/dist/node_modules/dagre-d3-es/src/dagre/order/sort-subgraph.js +8 -8
  67. package/dist/node_modules/dagre-d3-es/src/dagre/order/sort.js +5 -5
  68. package/dist/node_modules/dagre-d3-es/src/dagre/position/bk.js +61 -61
  69. package/dist/node_modules/dagre-d3-es/src/dagre/position/index.js +1 -1
  70. package/dist/node_modules/dagre-d3-es/src/dagre/rank/network-simplex.js +25 -25
  71. package/dist/node_modules/dagre-d3-es/src/dagre/rank/util.js +8 -8
  72. package/dist/node_modules/dagre-d3-es/src/dagre/util.js +48 -48
  73. package/dist/node_modules/dagre-d3-es/src/graphlib/graph.js +109 -109
  74. package/dist/node_modules/dagre-d3-es/src/graphlib/json.js +17 -17
  75. package/dist/node_modules/dompurify/dist/purify.es.js +67 -67
  76. package/dist/node_modules/katex/dist/katex.js +1256 -1209
  77. package/dist/node_modules/khroma/dist/methods/transparentize.js +3 -0
  78. package/dist/node_modules/lodash-es/_baseClone.js +2 -2
  79. package/dist/node_modules/lodash-es/_baseMatchesProperty.js +6 -6
  80. package/dist/node_modules/lodash-es/_baseToString.js +1 -1
  81. package/dist/node_modules/lodash-es/_baseUniq.js +1 -1
  82. package/dist/node_modules/lodash-es/_createSet.js +1 -1
  83. package/dist/node_modules/lodash-es/_getAllKeys.js +2 -2
  84. package/dist/node_modules/lodash-es/_getAllKeysIn.js +1 -1
  85. package/dist/node_modules/lodash-es/findIndex.js +2 -2
  86. package/dist/node_modules/lodash-es/flatMap.js +1 -1
  87. package/dist/node_modules/lodash-es/forEach.js +1 -1
  88. package/dist/node_modules/lodash-es/max.js +1 -1
  89. package/dist/node_modules/lodash-es/min.js +1 -1
  90. package/dist/node_modules/lodash-es/minBy.js +1 -1
  91. package/dist/node_modules/lodash-es/reduce.js +1 -1
  92. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-Q4EWVU46.js +691 -0
  93. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{blockDiagram-VD42YOAC.js → blockDiagram-DXYQGD6D.js} +183 -157
  94. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{c4Diagram-YG6GDRKO.js → c4Diagram-AHTNJAMY.js} +65 -63
  95. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-336JU56O.js +47 -0
  96. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-EXTU4WIE.js → chunk-426QAEUC.js} +1 -1
  97. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-B4BG7PRW.js → chunk-4TB4RGXK.js} +533 -393
  98. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-5FUZZQ4R.js +3638 -0
  99. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-S3R3BYOJ.js → chunk-5PVQY5BW.js} +1 -1
  100. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-HN2XXSSU.js → chunk-BSJP7CBP.js} +20 -14
  101. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-QN33PNHL.js → chunk-EDXVE4YY.js} +1 -1
  102. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ENJZ2VHE.js +568 -0
  103. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ICPOFSXX.js +2320 -0
  104. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-DI55MBZ5.js → chunk-OYMX7WX6.js} +35 -21
  105. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-U2HBQHQK.js +272 -0
  106. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-ATLVNIR6.js → chunk-X2U36JSP.js} +1 -1
  107. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-MI3HLSF2.js → chunk-XPW4576I.js} +11 -7
  108. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-YZCP3GAM.js +60 -0
  109. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ZZ45TVLE.js +30 -0
  110. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{classDiagram-2ON5EDUG.js → classDiagram-6PBFFD2Q.js} +12 -11
  111. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{classDiagram-v2-WZHVMYZB.js → classDiagram-v2-HSJHXN6E.js} +12 -11
  112. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{dagre-6UL2VRFP.js → dagre-KV5264BT.js} +8 -8
  113. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-5BDNPKRD.js +99 -0
  114. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{diagram-PSM6KHXK.js → diagram-G4DWMVQ6.js} +20 -23
  115. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-MMDJMWI5.js +211 -0
  116. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{diagram-S2PKOQOG.js → diagram-TYMM5635.js} +4 -4
  117. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{erDiagram-Q2GNP2WA.js → erDiagram-SMLLAGMA.js} +486 -386
  118. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{flowDiagram-NV44I4VS.js → flowDiagram-DWJPFMVM.js} +915 -898
  119. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{ganttDiagram-JELNMOA3.js → ganttDiagram-T4ZO3ILL.js} +59 -29
  120. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-UUTBAWPF.js +728 -0
  121. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/infoDiagram-42DDH7IO.js +17 -0
  122. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ishikawaDiagram-UXIWVN3A.js +714 -0
  123. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{journeyDiagram-XKPGCS4Q.js → journeyDiagram-VCZTEJTY.js} +32 -32
  124. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{kanban-definition-3W4ZIXB7.js → kanban-definition-6JOO6SKY.js} +13 -9
  125. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{mindmap-definition-VGOIOE7T.js → mindmap-definition-QFDTVHPH.js} +105 -59
  126. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-DEJITSTG.js +117 -0
  127. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{quadrantDiagram-AYHSOK5B.js → quadrantDiagram-34T5L4WZ.js} +1 -1
  128. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{requirementDiagram-UZGBJVZJ.js → requirementDiagram-MS252O5E.js} +49 -19
  129. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{sankeyDiagram-TZEHDZUN.js → sankeyDiagram-XADWPNL6.js} +1 -1
  130. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-FGHM5R23.js +4155 -0
  131. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{stateDiagram-FKZM4ZOC.js → stateDiagram-FHFEXIEX.js} +12 -12
  132. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{stateDiagram-v2-4FDKWEC3.js → stateDiagram-v2-QKLJ7IA2.js} +11 -11
  133. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-GMOUNBTQ.js +1071 -0
  134. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/vennDiagram-DHZGUBPP.js +959 -0
  135. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/wardleyDiagram-NUSXRM2D.js +574 -0
  136. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{xychartDiagram-PRI3JC2R.js → xychartDiagram-5P7HB3ND.js} +38 -35
  137. package/dist/node_modules/mermaid/dist/mermaid.core.js +235 -192
  138. package/dist/node_modules/nanoid/url-alphabet/index.js +1 -1
  139. package/dist/node_modules/remend/dist/index.js +333 -264
  140. package/dist/node_modules/streamdown/dist/chunk-BO2N2NFS.js +2498 -0
  141. package/dist/node_modules/streamdown/dist/highlighted-body-OFNGDK62.js +35 -0
  142. package/dist/node_modules/streamdown/dist/index.js +1 -1
  143. package/dist/node_modules/streamdown/dist/mermaid-GHXKKRXX.js +3 -0
  144. package/dist/node_modules/streamdown/node_modules/marked/lib/marked.esm.js +672 -667
  145. package/dist/pages/DashboardPage.js +3 -3
  146. package/package.json +2 -2
  147. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-TCCFYFTB.js +0 -787
  148. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-VBDWY6EO.js +0 -3
  149. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-DYOGHKS2.js +0 -3
  150. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-VRWISCQL.js +0 -3
  151. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-ZZBFDIW7.js +0 -3
  152. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-GDKQZRPO.js +0 -3
  153. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/context_assist.js +0 -16
  154. package/dist/node_modules/lodash-es/_arrayAggregator.js +0 -9
  155. package/dist/node_modules/lodash-es/_arrayEvery.js +0 -6
  156. package/dist/node_modules/lodash-es/_baseAggregator.js +0 -8
  157. package/dist/node_modules/lodash-es/_baseDifference.js +0 -22
  158. package/dist/node_modules/lodash-es/_baseEvery.js +0 -9
  159. package/dist/node_modules/lodash-es/_baseIsRegExp.js +0 -8
  160. package/dist/node_modules/lodash-es/_baseSlice.js +0 -8
  161. package/dist/node_modules/lodash-es/_baseSome.js +0 -9
  162. package/dist/node_modules/lodash-es/_createAggregator.js +0 -12
  163. package/dist/node_modules/lodash-es/assign.js +0 -14
  164. package/dist/node_modules/lodash-es/compact.js +0 -9
  165. package/dist/node_modules/lodash-es/difference.js +0 -8
  166. package/dist/node_modules/lodash-es/drop.js +0 -8
  167. package/dist/node_modules/lodash-es/dropRight.js +0 -8
  168. package/dist/node_modules/lodash-es/every.js +0 -11
  169. package/dist/node_modules/lodash-es/groupBy.js +0 -6
  170. package/dist/node_modules/lodash-es/head.js +0 -5
  171. package/dist/node_modules/lodash-es/includes.js +0 -13
  172. package/dist/node_modules/lodash-es/indexOf.js +0 -11
  173. package/dist/node_modules/lodash-es/isRegExp.js +0 -5
  174. package/dist/node_modules/lodash-es/negate.js +0 -16
  175. package/dist/node_modules/lodash-es/pickBy.js +0 -15
  176. package/dist/node_modules/lodash-es/reject.js +0 -10
  177. package/dist/node_modules/lodash-es/some.js +0 -11
  178. package/dist/node_modules/lodash-es/uniq.js +0 -6
  179. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-VXUJARFQ.js +0 -673
  180. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ABZYJK2D.js +0 -1547
  181. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-CVBHYZKI.js +0 -10
  182. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-DR5Q36YT.js +0 -135
  183. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-JA3XYJ7Z.js +0 -247
  184. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-JZLCHNYA.js +0 -3516
  185. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-N4CR4FBY.js +0 -39
  186. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-QXUST7PY.js +0 -497
  187. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-TZMSLE5B.js +0 -55
  188. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-QEK2KX5R.js +0 -211
  189. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-V2S2FVAM.js +0 -621
  190. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/infoDiagram-HS3SLOUP.js +0 -18
  191. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-ADFJNKIX.js +0 -117
  192. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-WL72ISMW.js +0 -3560
  193. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-IT6M3QCI.js +0 -833
  194. package/dist/node_modules/streamdown/dist/chunk-RLXIAIE6.js +0 -2189
  195. package/dist/node_modules/streamdown/dist/highlighted-body-B3W2YXNL.js +0 -33
  196. package/dist/node_modules/streamdown/dist/mermaid-3ZIDBTTL.js +0 -3
@@ -1,17 +1,17 @@
1
1
  import { __name, log } from "./chunk-AGHRB4JF.js";
2
2
  import rgba_default from "../../../../khroma/dist/methods/rgba.js";
3
3
  import channel_default from "../../../../khroma/dist/methods/channel.js";
4
- import { clear, common_default, configureSvgSize, evaluate, getConfig, getConfig2, getUrl, sanitizeText } from "./chunk-ABZYJK2D.js";
4
+ import { clear, common_default, configureSvgSize, getConfig, getConfig2, getEffectiveHtmlLabels, getUrl, sanitizeText } from "./chunk-ICPOFSXX.js";
5
5
  import select_default from "../../../../d3-selection/src/select.js";
6
6
  import line_default from "../../../../d3-shape/src/line.js";
7
7
  import basis_default from "../../../../d3-shape/src/curve/basis.js";
8
8
  import "../../../../d3/src/index.js";
9
- import { getLineFunctionsWithOffset } from "./chunk-HN2XXSSU.js";
10
- import { getSubGraphTitleMargins } from "./chunk-CVBHYZKI.js";
11
- import { decodeEntities, getStylesFromArray, utils_default } from "./chunk-S3R3BYOJ.js";
12
- import { createText, replaceIconSubstring } from "./chunk-JA3XYJ7Z.js";
13
- import clone_default from "../../../../lodash-es/clone.js";
9
+ import { computeLabelTransform, getLineFunctionsWithOffset } from "./chunk-BSJP7CBP.js";
10
+ import { decodeEntities, getStylesFromArray, utils_default } from "./chunk-5PVQY5BW.js";
11
+ import { configureLabelImages, getSubGraphTitleMargins } from "./chunk-ZZ45TVLE.js";
12
+ import { createText } from "./chunk-U2HBQHQK.js";
14
13
  import { getIconStyles } from "./chunk-FMBD7UC4.js";
14
+ import clone_default from "../../../../lodash-es/clone.js";
15
15
  import { Graph } from "../../../../dagre-d3-es/src/graphlib/graph.js";
16
16
  import "../../../../dagre-d3-es/src/graphlib/index.js";
17
17
  var parser = (function() {
@@ -1149,7 +1149,7 @@ var parser = (function() {
1149
1149
  return __name(z, "Parser"), z.prototype = R, R.Parser = z, new z();
1150
1150
  })();
1151
1151
  parser.parser = parser;
1152
- var block_default = parser, blockDatabase = /* @__PURE__ */ new Map(), edgeList = [], edgeCount = /* @__PURE__ */ new Map(), COLOR_KEYWORD = "color", FILL_KEYWORD = "fill", BG_FILL = "bgFill", STYLECLASS_SEP = ",", config = getConfig2(), classes = /* @__PURE__ */ new Map(), sanitizeText2 = /* @__PURE__ */ __name((e) => common_default.sanitizeText(e, config), "sanitizeText"), addStyleClass = /* @__PURE__ */ __name(function(e, S = "") {
1152
+ var block_default = parser, blockDatabase = /* @__PURE__ */ new Map(), edgeList = [], edgeCount = /* @__PURE__ */ new Map(), COLOR_KEYWORD = "color", FILL_KEYWORD = "fill", BG_FILL = "bgFill", STYLECLASS_SEP = ",", config = getConfig2(), classes = /* @__PURE__ */ new Map(), diagramId = "", sanitizeText2 = /* @__PURE__ */ __name((e) => common_default.sanitizeText(e, config), "sanitizeText"), addStyleClass = /* @__PURE__ */ __name(function(e, S = "") {
1153
1153
  let C = classes.get(e);
1154
1154
  C || (C = {
1155
1155
  id: e,
@@ -1222,7 +1222,7 @@ var block_default = parser, blockDatabase = /* @__PURE__ */ new Map(), edgeList
1222
1222
  type: "composite",
1223
1223
  children: [],
1224
1224
  columns: -1
1225
- }, blockDatabase = /* @__PURE__ */ new Map([["root", rootBlock]]), blocks = [], classes = /* @__PURE__ */ new Map(), edgeList = [], edgeCount = /* @__PURE__ */ new Map();
1225
+ }, blockDatabase = /* @__PURE__ */ new Map([["root", rootBlock]]), blocks = [], classes = /* @__PURE__ */ new Map(), edgeList = [], edgeCount = /* @__PURE__ */ new Map(), diagramId = "";
1226
1226
  }, "clear");
1227
1227
  function typeStr2Type(e) {
1228
1228
  switch (log.debug("typeStr2Type", e), e) {
@@ -1285,7 +1285,11 @@ var cnt = 0, blockDB_default = {
1285
1285
  return classes;
1286
1286
  }, "getClasses"),
1287
1287
  clear: clear2,
1288
- generateId: /* @__PURE__ */ __name(() => (cnt++, "id-" + Math.random().toString(36).substr(2, 12) + "-" + cnt), "generateId")
1288
+ generateId: /* @__PURE__ */ __name(() => (cnt++, "id-" + Math.random().toString(36).substr(2, 12) + "-" + cnt), "generateId"),
1289
+ setDiagramId: /* @__PURE__ */ __name((e) => {
1290
+ diagramId = e;
1291
+ }, "setDiagramId"),
1292
+ getDiagramId: /* @__PURE__ */ __name(() => diagramId, "getDiagramId")
1289
1293
  }, fade = /* @__PURE__ */ __name((e, S) => {
1290
1294
  let T = channel_default;
1291
1295
  return rgba_default(T(e, "r"), T(e, "g"), T(e, "b"), S);
@@ -1349,6 +1353,17 @@ var cnt = 0, blockDB_default = {
1349
1353
 
1350
1354
  .edgeLabel {
1351
1355
  background-color: ${e.edgeLabelBackground};
1356
+ /*
1357
+ * This is for backward compatibility with existing code that didn't
1358
+ * add a \`<p>\` around edge labels.
1359
+ *
1360
+ * TODO: We should probably remove this in a future release.
1361
+ */
1362
+ p {
1363
+ margin: 0;
1364
+ padding: 0;
1365
+ display: inline;
1366
+ }
1352
1367
  rect {
1353
1368
  opacity: 0.5;
1354
1369
  background-color: ${e.edgeLabelBackground};
@@ -1359,8 +1374,7 @@ var cnt = 0, blockDB_default = {
1359
1374
 
1360
1375
  /* For html labels only */
1361
1376
  .labelBkg {
1362
- background-color: ${fade(e.edgeLabelBackground, .5)};
1363
- // background-color:
1377
+ background-color: ${e.edgeLabelBackground};
1364
1378
  }
1365
1379
 
1366
1380
  .node .cluster {
@@ -1453,13 +1467,13 @@ __name(calculateBlockPosition, "calculateBlockPosition");
1453
1467
  var getMaxChildSize = /* @__PURE__ */ __name((e) => {
1454
1468
  let C = 0, w = 0;
1455
1469
  for (let T of e.children) {
1456
- let { width: E, height: D, x: O, y: k } = T.size ?? {
1470
+ let { width: e, height: E, x: D, y: O } = T.size ?? {
1457
1471
  width: 0,
1458
1472
  height: 0,
1459
1473
  x: 0,
1460
1474
  y: 0
1461
1475
  };
1462
- log.debug("getMaxChildSize abc95 child:", T.id, "width:", E, "height:", D, "x:", O, "y:", k, T.type), T.type !== "space" && (E > C && (C = E / (e.widthInColumns ?? 1)), D > w && (w = D));
1476
+ log.debug("getMaxChildSize abc95 child:", T.id, "width:", e, "height:", E, "x:", D, "y:", O, T.type), T.type !== "space" && (e > C && (C = e / (T.widthInColumns ?? 1)), E > w && (w = E));
1463
1477
  }
1464
1478
  return {
1465
1479
  width: C,
@@ -1516,20 +1530,38 @@ function layoutBlocks(e, C) {
1516
1530
  if (log.debug("layoutBlocks columns abc95", e.id, "=>", w, e), e.children && e.children.length > 0) {
1517
1531
  let T = e?.children[0]?.size?.width ?? 0, E = e.children.length * T + (e.children.length - 1) * padding;
1518
1532
  log.debug("widthOfChildren 88", E, "posX");
1519
- let D = 0;
1533
+ let D = /* @__PURE__ */ new Map();
1534
+ {
1535
+ let S = 0;
1536
+ for (let C of e.children) {
1537
+ if (!C.size) continue;
1538
+ let { py: e } = calculateBlockPosition(w, S), T = D.get(e) ?? 0;
1539
+ C.size.height > T && D.set(e, C.size.height);
1540
+ let E = C?.widthInColumns ?? 1;
1541
+ w > 0 && (E = Math.min(E, w - S % w)), S += E;
1542
+ }
1543
+ }
1544
+ let O = /* @__PURE__ */ new Map();
1545
+ {
1546
+ let e = 0, S = [...D.keys()].sort((e, S) => e - S);
1547
+ for (let C of S) O.set(C, e), e += (D.get(C) ?? 0) + padding;
1548
+ }
1549
+ let k = 0;
1520
1550
  log.debug("abc91 block?.size?.x", e.id, e?.size?.x);
1521
- let O = e?.size?.x ? e?.size?.x + (-e?.size?.width / 2 || 0) : -padding, k = 0;
1551
+ let A = e?.size?.x ? e?.size?.x + (-e?.size?.width / 2 || 0) : -padding, j = 0;
1522
1552
  for (let T of e.children) {
1523
1553
  let E = e;
1524
1554
  if (!T.size) continue;
1525
- let { width: A, height: j } = T.size, { px: M, py: N } = calculateBlockPosition(w, D);
1526
- if (N != k && (k = N, O = e?.size?.x ? e?.size?.x + (-e?.size?.width / 2 || 0) : -padding, log.debug("New row in layout for block", e.id, " and child ", T.id, k)), log.debug(`abc89 layout blocks (child) id: ${T.id} Pos: ${D} (px, py) ${M},${N} (${E?.size?.x},${E?.size?.y}) parent: ${E.id} width: ${A}${padding}`), E.size) {
1527
- let e = A / 2;
1528
- T.size.x = O + padding + e, log.debug(`abc91 layout blocks (calc) px, pyid:${T.id} startingPos=X${O} new startingPosX${T.size.x} ${e} padding=${padding} width=${A} halfWidth=${e} => x:${T.size.x} y:${T.size.y} ${T.widthInColumns} (width * (child?.w || 1)) / 2 ${A * (T?.widthInColumns ?? 1) / 2}`), O = T.size.x + e, T.size.y = E.size.y - E.size.height / 2 + N * (j + padding) + j / 2 + padding, log.debug(`abc88 layout blocks (calc) px, pyid:${T.id}startingPosX${O}${padding}${e}=>x:${T.size.x}y:${T.size.y}${T.widthInColumns}(width * (child?.w || 1)) / 2${A * (T?.widthInColumns ?? 1) / 2}`);
1555
+ let { width: M, height: N } = T.size, { px: P, py: F } = calculateBlockPosition(w, k);
1556
+ if (F != j && (j = F, A = e?.size?.x ? e?.size?.x + (-e?.size?.width / 2 || 0) : -padding, log.debug("New row in layout for block", e.id, " and child ", T.id, j)), log.debug(`abc89 layout blocks (child) id: ${T.id} Pos: ${k} (px, py) ${P},${F} (${E?.size?.x},${E?.size?.y}) parent: ${E.id} width: ${M}${padding}`), E.size) {
1557
+ let e = M / 2;
1558
+ T.size.x = A + padding + e, log.debug(`abc91 layout blocks (calc) px, pyid:${T.id} startingPos=X${A} new startingPosX${T.size.x} ${e} padding=${padding} width=${M} halfWidth=${e} => x:${T.size.x} y:${T.size.y} ${T.widthInColumns} (width * (child?.w || 1)) / 2 ${M * (T?.widthInColumns ?? 1) / 2}`), A = T.size.x + e;
1559
+ let C = O.get(F) ?? 0, w = D.get(F) ?? N;
1560
+ T.size.y = E.size.y - E.size.height / 2 + C + w / 2 + padding, log.debug(`abc88 layout blocks (calc) px, pyid:${T.id}startingPosX${A}${padding}${e}=>x:${T.size.x}y:${T.size.y}${T.widthInColumns}(width * (child?.w || 1)) / 2${M * (T?.widthInColumns ?? 1) / 2}`);
1529
1561
  }
1530
1562
  T.children && layoutBlocks(T, C);
1531
- let P = T?.widthInColumns ?? 1;
1532
- w > 0 && (P = Math.min(P, w - D % w)), D += P, log.debug("abc88 columnsPos", T, D);
1563
+ let I = T?.widthInColumns ?? 1;
1564
+ w > 0 && (I = Math.min(I, w - k % w)), k += I, log.debug("abc88 columnsPos", T, k);
1533
1565
  }
1534
1566
  }
1535
1567
  log.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);
@@ -1572,35 +1604,18 @@ function layout(e) {
1572
1604
  };
1573
1605
  }
1574
1606
  __name(layout, "layout");
1575
- function applyStyle(e, S) {
1576
- S && e.attr("style", S);
1577
- }
1578
- __name(applyStyle, "applyStyle");
1579
- function addHtmlLabel(e, S) {
1580
- let C = select_default(document.createElementNS("http://www.w3.org/2000/svg", "foreignObject")), w = C.append("xhtml:div"), T = e.label, E = e.isNode ? "nodeLabel" : "edgeLabel", D = w.append("span");
1581
- return D.html(sanitizeText(T, S)), applyStyle(D, e.labelStyle), D.attr("class", E), applyStyle(w, e.labelStyle), w.style("display", "inline-block"), w.style("white-space", "nowrap"), w.attr("xmlns", "http://www.w3.org/1999/xhtml"), C.node();
1582
- }
1583
- __name(addHtmlLabel, "addHtmlLabel");
1584
- var createLabel_default = /* @__PURE__ */ __name(async (e, C, w, T) => {
1585
- let E = e || "";
1607
+ var createLabel_default = /* @__PURE__ */ __name(async (e, S, C, w = !1, T = !1) => {
1608
+ let E = S || "";
1586
1609
  typeof E == "object" && (E = E[0]);
1587
- let D = getConfig2();
1588
- if (evaluate(D.flowchart.htmlLabels)) return E = E.replace(/\\n|\n/g, "<br />"), log.debug("vertexText" + E), addHtmlLabel({
1610
+ let D = getConfig2(), O = getEffectiveHtmlLabels(D);
1611
+ return await createText(e, E, {
1612
+ style: C,
1613
+ isTitle: w,
1614
+ useHtmlLabels: O,
1615
+ markdown: !1,
1589
1616
  isNode: T,
1590
- label: await replaceIconSubstring(decodeEntities(E)),
1591
- labelStyle: C.replace("fill:", "color:")
1617
+ width: Infinity
1592
1618
  }, D);
1593
- {
1594
- let e = document.createElementNS("http://www.w3.org/2000/svg", "text");
1595
- e.setAttribute("style", C.replace("color:", "fill:"));
1596
- let S = [];
1597
- S = typeof E == "string" ? E.split(/\\n|\n|<br\s*\/?>/gi) : Array.isArray(E) ? E : [];
1598
- for (let C of S) {
1599
- let S = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
1600
- S.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), S.setAttribute("dy", "1em"), S.setAttribute("x", "0"), w ? S.setAttribute("class", "title-row") : S.setAttribute("class", "row"), S.textContent = C.trim(), e.appendChild(S);
1601
- }
1602
- return e;
1603
- }
1604
1619
  }, "createLabel"), addEdgeMarkers = /* @__PURE__ */ __name((e, S, C, w, T) => {
1605
1620
  S.arrowTypeStart && addEdgeMarker(e, "start", S.arrowTypeStart, C, w, T), S.arrowTypeEnd && addEdgeMarker(e, "end", S.arrowTypeEnd, C, w, T);
1606
1621
  }, "addEdgeMarkers"), arrowTypesMap = {
@@ -1622,47 +1637,69 @@ var createLabel_default = /* @__PURE__ */ __name(async (e, C, w, T) => {
1622
1637
  let k = C === "start" ? "Start" : "End";
1623
1638
  e.attr(`marker-${C}`, `url(${T}#${E}_${D}-${O}${k})`);
1624
1639
  }, "addEdgeMarker"), edgeLabels = {}, terminalLabels = {}, insertEdgeLabel = /* @__PURE__ */ __name(async (e, S) => {
1625
- let C = getConfig2(), w = evaluate(C.flowchart.htmlLabels), T = S.labelType === "markdown" ? createText(e, S.label, {
1640
+ let C = getConfig2(), w = getEffectiveHtmlLabels(C), T = e.insert("g").attr("class", "edgeLabel"), E = T.insert("g").attr("class", "label"), D = S.labelType === "markdown", O = await createText(e, S.label, {
1626
1641
  style: S.labelStyle,
1627
1642
  useHtmlLabels: w,
1628
- addSvgBackground: !0
1629
- }, C) : await createLabel_default(S.label, S.labelStyle), E = e.insert("g").attr("class", "edgeLabel"), D = E.insert("g").attr("class", "label");
1630
- D.node().appendChild(T);
1631
- let k = T.getBBox();
1643
+ addSvgBackground: D,
1644
+ isNode: !1,
1645
+ markdown: D,
1646
+ width: D ? void 0 : Infinity
1647
+ }, C);
1648
+ E.node().appendChild(O);
1649
+ let j = O.getBBox(), M = j;
1632
1650
  if (w) {
1633
- let e = T.children[0], S = select_default(T);
1634
- k = e.getBoundingClientRect(), S.attr("width", k.width), S.attr("height", k.height);
1651
+ let e = O.children[0], S = select_default(O);
1652
+ j = e.getBoundingClientRect(), M = j, S.attr("width", j.width), S.attr("height", j.height);
1653
+ } else {
1654
+ let e = select_default(O).select("text").node();
1655
+ e && typeof e.getBBox == "function" && (M = e.getBBox());
1635
1656
  }
1636
- D.attr("transform", "translate(" + -k.width / 2 + ", " + -k.height / 2 + ")"), edgeLabels[S.id] = E, S.width = k.width, S.height = k.height;
1637
- let j;
1657
+ E.attr("transform", computeLabelTransform(M, w)), edgeLabels[S.id] = T, S.width = j.width, S.height = j.height;
1658
+ let P;
1638
1659
  if (S.startLabelLeft) {
1639
- let C = await createLabel_default(S.startLabelLeft, S.labelStyle), w = e.insert("g").attr("class", "edgeTerminals"), T = w.insert("g").attr("class", "inner");
1640
- j = T.node().appendChild(C);
1641
- let E = C.getBBox();
1642
- T.attr("transform", "translate(" + -E.width / 2 + ", " + -E.height / 2 + ")"), terminalLabels[S.id] || (terminalLabels[S.id] = {}), terminalLabels[S.id].startLeft = w, setTerminalWidth(j, S.startLabelLeft);
1660
+ let C = e.insert("g").attr("class", "edgeTerminals"), T = C.insert("g").attr("class", "inner"), E = await createLabel_default(T, S.startLabelLeft, S.labelStyle);
1661
+ P = E;
1662
+ let D = E.getBBox();
1663
+ if (w) {
1664
+ let e = E.children[0], S = select_default(E);
1665
+ D = e.getBoundingClientRect(), S.attr("width", D.width), S.attr("height", D.height);
1666
+ }
1667
+ T.attr("transform", computeLabelTransform(D, w)), terminalLabels[S.id] || (terminalLabels[S.id] = {}), terminalLabels[S.id].startLeft = C, setTerminalWidth(P, S.startLabelLeft);
1643
1668
  }
1644
1669
  if (S.startLabelRight) {
1645
- let C = await createLabel_default(S.startLabelRight, S.labelStyle), w = e.insert("g").attr("class", "edgeTerminals"), T = w.insert("g").attr("class", "inner");
1646
- j = w.node().appendChild(C), T.node().appendChild(C);
1647
- let E = C.getBBox();
1648
- T.attr("transform", "translate(" + -E.width / 2 + ", " + -E.height / 2 + ")"), terminalLabels[S.id] || (terminalLabels[S.id] = {}), terminalLabels[S.id].startRight = w, setTerminalWidth(j, S.startLabelRight);
1670
+ let C = e.insert("g").attr("class", "edgeTerminals"), T = C.insert("g").attr("class", "inner"), E = await createLabel_default(C, S.startLabelRight, S.labelStyle);
1671
+ P = E, T.node().appendChild(E);
1672
+ let D = E.getBBox();
1673
+ if (w) {
1674
+ let e = E.children[0], S = select_default(E);
1675
+ D = e.getBoundingClientRect(), S.attr("width", D.width), S.attr("height", D.height);
1676
+ }
1677
+ T.attr("transform", computeLabelTransform(D, w)), terminalLabels[S.id] || (terminalLabels[S.id] = {}), terminalLabels[S.id].startRight = C, setTerminalWidth(P, S.startLabelRight);
1649
1678
  }
1650
1679
  if (S.endLabelLeft) {
1651
- let C = await createLabel_default(S.endLabelLeft, S.labelStyle), w = e.insert("g").attr("class", "edgeTerminals"), T = w.insert("g").attr("class", "inner");
1652
- j = T.node().appendChild(C);
1653
- let E = C.getBBox();
1654
- T.attr("transform", "translate(" + -E.width / 2 + ", " + -E.height / 2 + ")"), w.node().appendChild(C), terminalLabels[S.id] || (terminalLabels[S.id] = {}), terminalLabels[S.id].endLeft = w, setTerminalWidth(j, S.endLabelLeft);
1680
+ let C = e.insert("g").attr("class", "edgeTerminals"), T = C.insert("g").attr("class", "inner"), E = await createLabel_default(T, S.endLabelLeft, S.labelStyle);
1681
+ P = E;
1682
+ let D = E.getBBox();
1683
+ if (w) {
1684
+ let e = E.children[0], S = select_default(E);
1685
+ D = e.getBoundingClientRect(), S.attr("width", D.width), S.attr("height", D.height);
1686
+ }
1687
+ T.attr("transform", computeLabelTransform(D, w)), C.node().appendChild(E), terminalLabels[S.id] || (terminalLabels[S.id] = {}), terminalLabels[S.id].endLeft = C, setTerminalWidth(P, S.endLabelLeft);
1655
1688
  }
1656
1689
  if (S.endLabelRight) {
1657
- let C = await createLabel_default(S.endLabelRight, S.labelStyle), w = e.insert("g").attr("class", "edgeTerminals"), T = w.insert("g").attr("class", "inner");
1658
- j = T.node().appendChild(C);
1659
- let E = C.getBBox();
1660
- T.attr("transform", "translate(" + -E.width / 2 + ", " + -E.height / 2 + ")"), w.node().appendChild(C), terminalLabels[S.id] || (terminalLabels[S.id] = {}), terminalLabels[S.id].endRight = w, setTerminalWidth(j, S.endLabelRight);
1690
+ let C = e.insert("g").attr("class", "edgeTerminals"), T = C.insert("g").attr("class", "inner"), E = await createLabel_default(T, S.endLabelRight, S.labelStyle);
1691
+ P = E;
1692
+ let D = E.getBBox();
1693
+ if (w) {
1694
+ let e = E.children[0], S = select_default(E);
1695
+ D = e.getBoundingClientRect(), S.attr("width", D.width), S.attr("height", D.height);
1696
+ }
1697
+ T.attr("transform", computeLabelTransform(D, w)), C.node().appendChild(E), terminalLabels[S.id] || (terminalLabels[S.id] = {}), terminalLabels[S.id].endRight = C, setTerminalWidth(P, S.endLabelRight);
1661
1698
  }
1662
- return T;
1699
+ return O;
1663
1700
  }, "insertEdgeLabel");
1664
1701
  function setTerminalWidth(e, S) {
1665
- getConfig2().flowchart.htmlLabels && e && (e.style.width = S.length * 9 + "px", e.style.height = "12px");
1702
+ getEffectiveHtmlLabels(getConfig2()) && e && (e.style.width = S.length * 9 + "px", e.style.height = "12px");
1666
1703
  }
1667
1704
  __name(setTerminalWidth, "setTerminalWidth");
1668
1705
  var positionEdgeLabel = /* @__PURE__ */ __name((e, C) => {
@@ -1748,12 +1785,12 @@ var positionEdgeLabel = /* @__PURE__ */ __name((e, C) => {
1748
1785
  } else T = e, E || w.push(e);
1749
1786
  }), w;
1750
1787
  }, "cutPathAtIntersect"), insertEdge = /* @__PURE__ */ __name(function(e, C, w, T, E, D, O) {
1751
- let k = w.points;
1788
+ let A = w.points;
1752
1789
  log.debug("abc88 InsertEdge: edge=", w, "e=", C);
1753
1790
  let M = !1, N = D.node(C.v);
1754
- var L = D.node(C.w);
1755
- L?.intersect && N?.intersect && (k = k.slice(1, w.points.length - 1), k.unshift(N.intersect(k[0])), k.push(L.intersect(k[k.length - 1]))), w.toCluster && (log.debug("to cluster abc88", T[w.toCluster]), k = cutPathAtIntersect(w.points, T[w.toCluster].node), M = !0), w.fromCluster && (log.debug("from cluster abc88", T[w.fromCluster]), k = cutPathAtIntersect(k.reverse(), T[w.fromCluster].node).reverse(), M = !0);
1756
- let R = k.filter((e) => !Number.isNaN(e.y)), z = basis_default;
1791
+ var I = D.node(C.w);
1792
+ I?.intersect && N?.intersect && (A = A.slice(1, w.points.length - 1), A.unshift(N.intersect(A[0])), A.push(I.intersect(A[A.length - 1]))), w.toCluster && (log.debug("to cluster abc88", T[w.toCluster]), A = cutPathAtIntersect(w.points, T[w.toCluster].node), M = !0), w.fromCluster && (log.debug("from cluster abc88", T[w.fromCluster]), A = cutPathAtIntersect(A.reverse(), T[w.fromCluster].node).reverse(), M = !0);
1793
+ let R = A.filter((e) => !Number.isNaN(e.y)), z = basis_default;
1757
1794
  w.curve && (E === "graph" || E === "flowchart") && (z = w.curve);
1758
1795
  let { x: B, y: V } = getLineFunctionsWithOffset(w), H = line_default().x(B).y(V).curve(z), U;
1759
1796
  switch (w.thickness) {
@@ -1782,7 +1819,7 @@ var positionEdgeLabel = /* @__PURE__ */ __name((e, C) => {
1782
1819
  let W = e.append("path").attr("d", H(R)).attr("id", w.id).attr("class", " " + U + (w.classes ? " " + w.classes : "")).attr("style", w.style), G = "";
1783
1820
  (getConfig2().flowchart.arrowMarkerAbsolute || getConfig2().state.arrowMarkerAbsolute) && (G = getUrl(!0)), addEdgeMarkers(W, w, G, O, E);
1784
1821
  let K = {};
1785
- return M && (K.updatedPath = k), K.originalPath = w.points, K;
1822
+ return M && (K.updatedPath = A), K.originalPath = w.points, K;
1786
1823
  }, "insertEdge"), expandAndDeduplicateDirections = /* @__PURE__ */ __name((e) => {
1787
1824
  let S = /* @__PURE__ */ new Set();
1788
1825
  for (let C of e) switch (C) {
@@ -2270,42 +2307,27 @@ var intersect_default = {
2270
2307
  y: w + A
2271
2308
  };
2272
2309
  }, "intersectRect")
2273
- }, labelHelper = /* @__PURE__ */ __name(async (S, C, w, T) => {
2274
- let E = getConfig2(), D, k = C.useHtmlLabels || evaluate(E.flowchart.htmlLabels);
2275
- D = w || "node default";
2276
- let j = S.insert("g").attr("class", D).attr("id", C.domId || C.id), P = j.insert("g").attr("class", "label").attr("style", C.labelStyle), F;
2277
- F = C.labelText === void 0 ? "" : typeof C.labelText == "string" ? C.labelText : C.labelText[0];
2278
- let I = P.node(), L;
2279
- L = C.labelType === "markdown" ? createText(P, sanitizeText(decodeEntities(F), E), {
2280
- useHtmlLabels: k,
2281
- width: C.width || E.flowchart.wrappingWidth,
2310
+ }, labelHelper = /* @__PURE__ */ __name(async (e, S, C, w) => {
2311
+ let T = getConfig2(), E, D = S.useHtmlLabels || getEffectiveHtmlLabels(T);
2312
+ E = C || "node default";
2313
+ let O = e.insert("g").attr("class", E).attr("id", S.domId || S.id), j = O.insert("g").attr("class", "label").attr("style", S.labelStyle), P;
2314
+ P = S.labelText === void 0 ? "" : typeof S.labelText == "string" ? S.labelText : S.labelText[0];
2315
+ let F;
2316
+ F = S.labelType === "markdown" ? createText(j, sanitizeText(decodeEntities(P), T), {
2317
+ useHtmlLabels: D,
2318
+ width: S.width || T.flowchart.wrappingWidth,
2282
2319
  classes: "markdown-node-label"
2283
- }, E) : I.appendChild(await createLabel_default(sanitizeText(decodeEntities(F), E), C.labelStyle, !1, T));
2284
- let z = L.getBBox(), B = C.padding / 2;
2285
- if (evaluate(E.flowchart.htmlLabels)) {
2286
- let S = L.children[0], C = select_default(L), w = S.getElementsByTagName("img");
2287
- if (w) {
2288
- let S = F.replace(/<img[^>]*>/g, "").trim() === "";
2289
- await Promise.all([...w].map((C) => new Promise((w) => {
2290
- function T() {
2291
- if (C.style.display = "flex", C.style.flexDirection = "column", S) {
2292
- let e = E.fontSize ? E.fontSize : window.getComputedStyle(document.body).fontSize, S = parseInt(e, 10) * 5 + "px";
2293
- C.style.minWidth = S, C.style.maxWidth = S;
2294
- } else C.style.width = "100%";
2295
- w(C);
2296
- }
2297
- __name(T, "setupImage"), setTimeout(() => {
2298
- C.complete && T();
2299
- }), C.addEventListener("error", T), C.addEventListener("load", T);
2300
- })));
2301
- }
2302
- z = S.getBoundingClientRect(), C.attr("width", z.width), C.attr("height", z.height);
2320
+ }, T) : await createLabel_default(j, sanitizeText(decodeEntities(P), T), S.labelStyle, !1, w);
2321
+ let I = F.getBBox(), L = S.padding / 2;
2322
+ if (getEffectiveHtmlLabels(T)) {
2323
+ let e = F.children[0], S = select_default(F);
2324
+ await configureLabelImages(e, P), I = e.getBoundingClientRect(), S.attr("width", I.width), S.attr("height", I.height);
2303
2325
  }
2304
- return k ? P.attr("transform", "translate(" + -z.width / 2 + ", " + -z.height / 2 + ")") : P.attr("transform", "translate(0, " + -z.height / 2 + ")"), C.centerLabel && P.attr("transform", "translate(" + -z.width / 2 + ", " + -z.height / 2 + ")"), P.insert("rect", ":first-child"), {
2305
- shapeSvg: j,
2306
- bbox: z,
2307
- halfPadding: B,
2308
- label: P
2326
+ return D ? j.attr("transform", "translate(" + -I.width / 2 + ", " + -I.height / 2 + ")") : j.attr("transform", "translate(0, " + -I.height / 2 + ")"), S.centerLabel && j.attr("transform", "translate(" + -I.width / 2 + ", " + -I.height / 2 + ")"), j.insert("rect", ":first-child"), {
2327
+ shapeSvg: O,
2328
+ bbox: I,
2329
+ halfPadding: L,
2330
+ label: j
2309
2331
  };
2310
2332
  }, "labelHelper"), updateNodeBounds = /* @__PURE__ */ __name((e, S) => {
2311
2333
  let C = S.node().getBBox();
@@ -2318,7 +2340,7 @@ function insertPolygonShape(e, S, C, w) {
2318
2340
  }
2319
2341
  __name(insertPolygonShape, "insertPolygonShape");
2320
2342
  var note_default = /* @__PURE__ */ __name(async (e, C) => {
2321
- C.useHtmlLabels || getConfig2().flowchart.htmlLabels || (C.centerLabel = !0);
2343
+ C.useHtmlLabels || getEffectiveHtmlLabels(getConfig2()) || (C.centerLabel = !0);
2322
2344
  let { shapeSvg: w, bbox: T, halfPadding: E } = await labelHelper(e, C, "node " + C.classes, !0);
2323
2345
  log.info("Classes = ", C.classes);
2324
2346
  let D = w.insert("rect", ":first-child");
@@ -2606,24 +2628,24 @@ __name(applyNodePropertyBorders, "applyNodePropertyBorders");
2606
2628
  var rectWithTitle = /* @__PURE__ */ __name(async (e, C) => {
2607
2629
  let w;
2608
2630
  w = C.classes ? "node " + C.classes : "node default";
2609
- let T = e.insert("g").attr("class", w).attr("id", C.domId || C.id), E = T.insert("rect", ":first-child"), D = T.insert("line"), k = T.insert("g").attr("class", "label"), j = C.labelText.flat ? C.labelText.flat() : C.labelText, M = "";
2631
+ let T = e.insert("g").attr("class", w).attr("id", C.domId || C.id), E = T.insert("rect", ":first-child"), D = T.insert("line"), O = T.insert("g").attr("class", "label"), j = C.labelText.flat ? C.labelText.flat() : C.labelText, M = "";
2610
2632
  M = typeof j == "object" ? j[0] : j, log.info("Label text abc79", M, j, typeof j == "object");
2611
- let P = k.node().appendChild(await createLabel_default(M, C.labelStyle, !0, !0)), F = {
2633
+ let P = await createLabel_default(O, M, C.labelStyle, !0, !0), F = {
2612
2634
  width: 0,
2613
2635
  height: 0
2614
2636
  };
2615
- if (evaluate(getConfig2().flowchart.htmlLabels)) {
2637
+ if (getEffectiveHtmlLabels(getConfig2())) {
2616
2638
  let e = P.children[0], S = select_default(P);
2617
2639
  F = e.getBoundingClientRect(), S.attr("width", F.width), S.attr("height", F.height);
2618
2640
  }
2619
2641
  log.info("Text 2", j);
2620
- let I = j.slice(1, j.length), L = P.getBBox(), R = k.node().appendChild(await createLabel_default(I.join ? I.join("<br/>") : I, C.labelStyle, !0, !0));
2621
- if (evaluate(getConfig2().flowchart.htmlLabels)) {
2642
+ let I = j.slice(1, j.length), L = P.getBBox(), R = await createLabel_default(O, I.join ? I.join("<br/>") : I, C.labelStyle, !0, !0);
2643
+ if (getEffectiveHtmlLabels(getConfig2())) {
2622
2644
  let e = R.children[0], S = select_default(R);
2623
2645
  F = e.getBoundingClientRect(), S.attr("width", F.width), S.attr("height", F.height);
2624
2646
  }
2625
2647
  let z = C.padding / 2;
2626
- return select_default(R).attr("transform", "translate( " + (F.width > L.width ? 0 : (L.width - F.width) / 2) + ", " + (L.height + z + 5) + ")"), select_default(P).attr("transform", "translate( " + (F.width < L.width ? 0 : -(L.width - F.width) / 2) + ", 0)"), F = k.node().getBBox(), k.attr("transform", "translate(" + -F.width / 2 + ", " + (-F.height / 2 - z + 3) + ")"), E.attr("class", "outer title-state").attr("x", -F.width / 2 - z).attr("y", -F.height / 2 - z).attr("width", F.width + C.padding).attr("height", F.height + C.padding), D.attr("class", "divider").attr("x1", -F.width / 2 - z).attr("x2", F.width / 2 + z).attr("y1", -F.height / 2 - z + L.height + z).attr("y2", -F.height / 2 - z + L.height + z), updateNodeBounds(C, E), C.intersect = function(e) {
2648
+ return select_default(R).attr("transform", "translate( " + (F.width > L.width ? 0 : (L.width - F.width) / 2) + ", " + (L.height + z + 5) + ")"), select_default(P).attr("transform", "translate( " + (F.width < L.width ? 0 : -(L.width - F.width) / 2) + ", 0)"), F = O.node().getBBox(), O.attr("transform", "translate(" + -F.width / 2 + ", " + (-F.height / 2 - z + 3) + ")"), E.attr("class", "outer title-state").attr("x", -F.width / 2 - z).attr("y", -F.height / 2 - z).attr("width", F.width + C.padding).attr("height", F.height + C.padding), D.attr("class", "divider").attr("x1", -F.width / 2 - z).attr("x2", F.width / 2 + z).attr("y1", -F.height / 2 - z + L.height + z).attr("y2", -F.height / 2 - z + L.height + z), updateNodeBounds(C, E), C.intersect = function(e) {
2627
2649
  return intersect_default.rect(C, e);
2628
2650
  }, T;
2629
2651
  }, "rectWithTitle"), stadium = /* @__PURE__ */ __name(async (e, S) => {
@@ -2731,53 +2753,53 @@ var rectWithTitle = /* @__PURE__ */ __name(async (e, C) => {
2731
2753
  class_box: /* @__PURE__ */ __name(async (e, S) => {
2732
2754
  let C = S.padding / 2, w;
2733
2755
  w = S.classes ? "node " + S.classes : "node default";
2734
- let T = e.insert("g").attr("class", w).attr("id", S.domId || S.id), E = T.insert("rect", ":first-child"), D = T.insert("line"), k = T.insert("line"), j = 0, M = 4, P = T.insert("g").attr("class", "label"), F = 0, I = S.classData.annotations?.[0], L = S.classData.annotations[0] ? "«" + S.classData.annotations[0] + "»" : "", R = P.node().appendChild(await createLabel_default(L, S.labelStyle, !0, !0)), z = R.getBBox();
2735
- if (evaluate(getConfig2().flowchart.htmlLabels)) {
2736
- let e = R.children[0], S = select_default(R);
2737
- z = e.getBoundingClientRect(), S.attr("width", z.width), S.attr("height", z.height);
2756
+ let T = e.insert("g").attr("class", w).attr("id", S.domId || S.id), E = T.insert("rect", ":first-child"), D = T.insert("line"), O = T.insert("line"), j = 0, M = 4, P = T.insert("g").attr("class", "label"), F = 0, I = S.classData.annotations?.[0], L = await createLabel_default(P, S.classData.annotations[0] ? "«" + S.classData.annotations[0] + "»" : "", S.labelStyle, !0, !0), R = L.getBBox();
2757
+ if (getEffectiveHtmlLabels(getConfig2())) {
2758
+ let e = L.children[0], S = select_default(L);
2759
+ R = e.getBoundingClientRect(), S.attr("width", R.width), S.attr("height", R.height);
2738
2760
  }
2739
- S.classData.annotations[0] && (M += z.height + 4, j += z.width);
2740
- let B = S.classData.label;
2741
- S.classData.type !== void 0 && S.classData.type !== "" && (getConfig2().flowchart.htmlLabels ? B += "&lt;" + S.classData.type + "&gt;" : B += "<" + S.classData.type + ">");
2742
- let V = P.node().appendChild(await createLabel_default(B, S.labelStyle, !0, !0));
2743
- select_default(V).attr("class", "classTitle");
2744
- let H = V.getBBox();
2745
- if (evaluate(getConfig2().flowchart.htmlLabels)) {
2746
- let e = V.children[0], S = select_default(V);
2747
- H = e.getBoundingClientRect(), S.attr("width", H.width), S.attr("height", H.height);
2761
+ S.classData.annotations[0] && (M += R.height + 4, j += R.width);
2762
+ let z = S.classData.label;
2763
+ S.classData.type !== void 0 && S.classData.type !== "" && (getEffectiveHtmlLabels(getConfig2()) ? z += "&lt;" + S.classData.type + "&gt;" : z += "<" + S.classData.type + ">");
2764
+ let B = await createLabel_default(P, z, S.labelStyle, !0, !0);
2765
+ select_default(B).attr("class", "classTitle");
2766
+ let V = B.getBBox();
2767
+ if (getEffectiveHtmlLabels(getConfig2())) {
2768
+ let e = B.children[0], S = select_default(B);
2769
+ V = e.getBoundingClientRect(), S.attr("width", V.width), S.attr("height", V.height);
2748
2770
  }
2749
- M += H.height + 4, H.width > j && (j = H.width);
2750
- let U = [];
2771
+ M += V.height + 4, V.width > j && (j = V.width);
2772
+ let H = [];
2751
2773
  S.classData.members.forEach(async (e) => {
2752
2774
  let C = e.getDisplayDetails(), w = C.displayText;
2753
- getConfig2().flowchart.htmlLabels && (w = w.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
2754
- let T = P.node().appendChild(await createLabel_default(w, C.cssStyle ? C.cssStyle : S.labelStyle, !0, !0)), E = T.getBBox();
2755
- if (evaluate(getConfig2().flowchart.htmlLabels)) {
2775
+ getEffectiveHtmlLabels(getConfig2()) && (w = w.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
2776
+ let T = await createLabel_default(P, w, C.cssStyle ? C.cssStyle : S.labelStyle, !0, !0), E = T.getBBox();
2777
+ if (getEffectiveHtmlLabels(getConfig2())) {
2756
2778
  let e = T.children[0], S = select_default(T);
2757
2779
  E = e.getBoundingClientRect(), S.attr("width", E.width), S.attr("height", E.height);
2758
2780
  }
2759
- E.width > j && (j = E.width), M += E.height + 4, U.push(T);
2781
+ E.width > j && (j = E.width), M += E.height + 4, H.push(T);
2760
2782
  }), M += 8;
2761
- let W = [];
2783
+ let U = [];
2762
2784
  if (S.classData.methods.forEach(async (e) => {
2763
2785
  let C = e.getDisplayDetails(), w = C.displayText;
2764
- getConfig2().flowchart.htmlLabels && (w = w.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
2765
- let T = P.node().appendChild(await createLabel_default(w, C.cssStyle ? C.cssStyle : S.labelStyle, !0, !0)), E = T.getBBox();
2766
- if (evaluate(getConfig2().flowchart.htmlLabels)) {
2786
+ getEffectiveHtmlLabels(getConfig2()) && (w = w.replace(/</g, "&lt;").replace(/>/g, "&gt;"));
2787
+ let T = await createLabel_default(P, w, C.cssStyle ? C.cssStyle : S.labelStyle, !0, !0), E = T.getBBox();
2788
+ if (getEffectiveHtmlLabels(getConfig2())) {
2767
2789
  let e = T.children[0], S = select_default(T);
2768
2790
  E = e.getBoundingClientRect(), S.attr("width", E.width), S.attr("height", E.height);
2769
2791
  }
2770
- E.width > j && (j = E.width), M += E.height + 4, W.push(T);
2792
+ E.width > j && (j = E.width), M += E.height + 4, U.push(T);
2771
2793
  }), M += 8, I) {
2772
- let e = (j - z.width) / 2;
2773
- select_default(R).attr("transform", "translate( " + (-1 * j / 2 + e) + ", " + -1 * M / 2 + ")"), F = z.height + 4;
2794
+ let e = (j - R.width) / 2;
2795
+ select_default(L).attr("transform", "translate( " + (-1 * j / 2 + e) + ", " + -1 * M / 2 + ")"), F = R.height + 4;
2774
2796
  }
2775
- let G = (j - H.width) / 2;
2776
- return select_default(V).attr("transform", "translate( " + (-1 * j / 2 + G) + ", " + (-1 * M / 2 + F) + ")"), F += H.height + 4, D.attr("class", "divider").attr("x1", -j / 2 - C).attr("x2", j / 2 + C).attr("y1", -M / 2 - C + 8 + F).attr("y2", -M / 2 - C + 8 + F), F += 8, U.forEach((e) => {
2797
+ let W = (j - V.width) / 2;
2798
+ return select_default(B).attr("transform", "translate( " + (-1 * j / 2 + W) + ", " + (-1 * M / 2 + F) + ")"), F += V.height + 4, D.attr("class", "divider").attr("x1", -j / 2 - C).attr("x2", j / 2 + C).attr("y1", -M / 2 - C + 8 + F).attr("y2", -M / 2 - C + 8 + F), F += 8, H.forEach((e) => {
2777
2799
  select_default(e).attr("transform", "translate( " + -j / 2 + ", " + (-1 * M / 2 + F + 8 / 2) + ")");
2778
2800
  let S = e?.getBBox();
2779
2801
  F += (S?.height ?? 0) + 4;
2780
- }), F += 8, k.attr("class", "divider").attr("x1", -j / 2 - C).attr("x2", j / 2 + C).attr("y1", -M / 2 - C + 8 + F).attr("y2", -M / 2 - C + 8 + F), F += 8, W.forEach((e) => {
2802
+ }), F += 8, O.attr("class", "divider").attr("x1", -j / 2 - C).attr("x2", j / 2 + C).attr("y1", -M / 2 - C + 8 + F).attr("y2", -M / 2 - C + 8 + F), F += 8, U.forEach((e) => {
2781
2803
  select_default(e).attr("transform", "translate( " + -j / 2 + ", " + (-1 * M / 2 + F) + ")");
2782
2804
  let S = e?.getBBox();
2783
2805
  F += (S?.height ?? 0) + 4;
@@ -2801,13 +2823,13 @@ var rectWithTitle = /* @__PURE__ */ __name(async (e, C) => {
2801
2823
  function getNodeFromBlock(e, S, C = !1) {
2802
2824
  let w = e, T = "default";
2803
2825
  (w?.classes?.length || 0) > 0 && (T = (w?.classes ?? []).join(" ")), T += " flowchart-label";
2804
- let E = 0, D = "", O;
2826
+ let E = 0, D = "", k;
2805
2827
  switch (w.type) {
2806
2828
  case "round":
2807
2829
  E = 5, D = "rect";
2808
2830
  break;
2809
2831
  case "composite":
2810
- E = 0, D = "composite", O = 0;
2832
+ E = 0, D = "composite", k = 0;
2811
2833
  break;
2812
2834
  case "square":
2813
2835
  D = "rect";
@@ -2867,7 +2889,7 @@ function getNodeFromBlock(e, S, C = !1) {
2867
2889
  height: 0,
2868
2890
  x: 0,
2869
2891
  y: 0
2870
- };
2892
+ }, N = S.getDiagramId();
2871
2893
  return {
2872
2894
  labelStyle: A.labelStyle,
2873
2895
  shape: D,
@@ -2877,6 +2899,7 @@ function getNodeFromBlock(e, S, C = !1) {
2877
2899
  class: T,
2878
2900
  style: A.style,
2879
2901
  id: w.id,
2902
+ domId: N ? `${N}-${w.id}` : w.id,
2880
2903
  directions: w.directions,
2881
2904
  width: M.width,
2882
2905
  height: M.height,
@@ -2885,7 +2908,7 @@ function getNodeFromBlock(e, S, C = !1) {
2885
2908
  positioned: C,
2886
2909
  intersect: void 0,
2887
2910
  type: w.type,
2888
- padding: O ?? getConfig()?.block?.padding ?? 0
2911
+ padding: k ?? getConfig()?.block?.padding ?? 0
2889
2912
  };
2890
2913
  }
2891
2914
  __name(getNodeFromBlock, "getNodeFromBlock");
@@ -2952,13 +2975,14 @@ async function insertEdges(e, S, C, w, T) {
2952
2975
  x: O.x,
2953
2976
  y: O.y
2954
2977
  }
2955
- ];
2978
+ ], A = T ? `${T}-${C.id}` : C.id;
2956
2979
  insertEdge(e, {
2957
2980
  v: C.start,
2958
2981
  w: C.end,
2959
- name: C.id
2982
+ name: A
2960
2983
  }, {
2961
2984
  ...C,
2985
+ id: A,
2962
2986
  arrowTypeEnd: C.arrowTypeEnd,
2963
2987
  arrowTypeStart: C.arrowTypeStart,
2964
2988
  points: k,
@@ -2985,7 +3009,9 @@ var diagram = {
2985
3009
  db: blockDB_default,
2986
3010
  renderer: {
2987
3011
  draw: /* @__PURE__ */ __name(async function(e, C, w, T) {
2988
- let { securityLevel: E, block: O } = getConfig(), A = T.db, j;
3012
+ let { securityLevel: E, block: k } = getConfig(), A = T.db;
3013
+ A.setDiagramId(C);
3014
+ let j;
2989
3015
  E === "sandbox" && (j = select_default("#i" + C));
2990
3016
  let M = select_default(E === "sandbox" ? j.nodes()[0].contentDocument.body : "body"), P = E === "sandbox" ? M.select(`[id="${C}"]`) : select_default(`[id="${C}"]`);
2991
3017
  markers_default(P, [
@@ -2997,7 +3023,7 @@ var diagram = {
2997
3023
  await calculateBlockSizes(R, F, A);
2998
3024
  let z = layout(A);
2999
3025
  if (await insertBlocks(R, F, A), await insertEdges(R, L, I, A, C), z) {
3000
- let e = z, C = Math.max(1, Math.round(.125 * (e.width / e.height))), w = e.height + C + 10, T = e.width + 10, { useMaxWidth: E } = O;
3026
+ let e = z, C = Math.max(1, Math.round(.125 * (e.width / e.height))), w = e.height + C + 10, T = e.width + 10, { useMaxWidth: E } = k;
3001
3027
  configureSvgSize(P, w, T, !!E), log.debug("Here Bounds", z, e), P.attr("viewBox", `${e.x - 5} ${e.y - 5} ${e.width + 10} ${e.height + 10}`);
3002
3028
  }
3003
3029
  }, "draw"),