docmedown 0.1.7 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (304) hide show
  1. package/LICENSE +201 -21
  2. package/README.md +86 -37
  3. package/dist/architecture-7GRP2DOG-B8Xs9IfY.mjs +2 -0
  4. package/dist/architecture-7GRP2DOG-Vdsw7WC7.js +1 -0
  5. package/dist/cli.js +672 -1294
  6. package/dist/cynefin-OW5HDTMX-DU6kwwck.js +1 -0
  7. package/dist/cynefin-OW5HDTMX-F0P2M_lQ.mjs +2 -0
  8. package/dist/docmedown-compiler.js +228 -0
  9. package/dist/docmedown-mermaid.js +3588 -0
  10. package/dist/docmedown.cjs +7264 -80
  11. package/dist/docmedown.iife.js +7624 -424
  12. package/dist/docmedown.mjs +15531 -15009
  13. package/dist/docmedown.web.js +7628 -0
  14. package/dist/eventmodeling-NTZA5JFV-D58ICByZ.js +1 -0
  15. package/dist/eventmodeling-NTZA5JFV-SxxTo5cJ.mjs +2 -0
  16. package/dist/gitGraph-4MIJSDKK-C_R2a4aQ.mjs +2 -0
  17. package/dist/gitGraph-4MIJSDKK-CdMj8HJ8.js +1 -0
  18. package/dist/info-A6RAGUB7-CG4UBCfn.js +1 -0
  19. package/dist/info-A6RAGUB7-DmjQlHTj.mjs +2 -0
  20. package/dist/mermaid-BvOI3ZSW.js +3334 -0
  21. package/dist/mermaid-Cx9uSfoz.mjs +116948 -0
  22. package/dist/packet-AYTQ26CC-CMuoEJn0.js +1 -0
  23. package/dist/packet-AYTQ26CC-tdMo_iPL.mjs +2 -0
  24. package/dist/pie-WAS4IAKB-C1hjX8y0.js +1 -0
  25. package/dist/pie-WAS4IAKB-DG2Bio1G.mjs +2 -0
  26. package/dist/prism-CeBRmKvl.js +2 -0
  27. package/dist/prism-CummdiZX.mjs +1588 -0
  28. package/dist/radar-RG4KPBEZ-DHxYOB0f.mjs +2 -0
  29. package/dist/radar-RG4KPBEZ-Dvyo3gdA.js +1 -0
  30. package/dist/railroad-74A4TZTK-1sb9Z_QQ.js +1 -0
  31. package/dist/railroad-74A4TZTK-CwztrSkE.mjs +2 -0
  32. package/dist/railroad-abnf-HS5TGJTU-4264fZjH.js +1 -0
  33. package/dist/railroad-abnf-HS5TGJTU-BKCsR9iC.mjs +2 -0
  34. package/dist/railroad-ebnf-LZEXJU2U-BXErl5kO.js +1 -0
  35. package/dist/railroad-ebnf-LZEXJU2U-DzDOfuxK.mjs +2 -0
  36. package/dist/railroad-peg-WCYAUIDC-B6gNHamV.mjs +2 -0
  37. package/dist/railroad-peg-WCYAUIDC-D7pSwRGa.js +1 -0
  38. package/dist/rolldown-runtime-B0aSnxlc.mjs +20 -0
  39. package/dist/rolldown-runtime-DF3sbh8G.js +1 -0
  40. package/dist/svelte-compiler-loader-Deqbdbvf.js +1 -0
  41. package/dist/svelte-compiler-loader-DtYQgEKV.mjs +50 -0
  42. package/dist/svelte-runtime-Brc440dp.js +5 -0
  43. package/dist/svelte-runtime-CgCk_bw1.mjs +40 -0
  44. package/dist/treeView-Q6P3EWNA-DArM8kFH.mjs +2 -0
  45. package/dist/treeView-Q6P3EWNA-JstiGzov.js +1 -0
  46. package/dist/treemap-WGGIJYW6-CMIcmEVN.mjs +2 -0
  47. package/dist/treemap-WGGIJYW6-Dq6fFckz.js +1 -0
  48. package/dist/ts-compiler-BMDmcNn5.mjs +93 -0
  49. package/dist/ts-compiler-U7pTMJjY.js +3 -0
  50. package/dist/types/runtime/bridges/dynamic-component.d.ts +43 -0
  51. package/dist/types/runtime/bridges/element-bridge.d.ts +24 -0
  52. package/dist/types/runtime/bridges/index.d.ts +3 -0
  53. package/dist/types/runtime/bridges/react-bridge.d.ts +35 -0
  54. package/dist/types/runtime/compiler-cache.d.ts +18 -0
  55. package/dist/types/runtime/config-schema.d.ts +2 -0
  56. package/dist/types/runtime/favicons.d.ts +28 -0
  57. package/dist/types/runtime/loader/local-loader.d.ts +13 -0
  58. package/dist/types/runtime/markdown/component-body.d.ts +7 -0
  59. package/dist/types/runtime/markdown/escape.d.ts +1 -0
  60. package/dist/types/runtime/markdown/highlighter.d.ts +32 -6
  61. package/dist/types/runtime/markdown/katex.d.ts +5 -0
  62. package/dist/types/runtime/markdown/mermaid-engine.d.ts +1 -0
  63. package/dist/types/runtime/markdown/mermaid-loader.d.ts +19 -0
  64. package/dist/types/runtime/markdown/mermaid.d.ts +6 -0
  65. package/dist/types/runtime/markdown/tables.d.ts +68 -0
  66. package/dist/types/runtime/media.d.ts +30 -0
  67. package/dist/types/runtime/motion.d.ts +134 -0
  68. package/dist/types/runtime/offline-export.d.ts +9 -2
  69. package/dist/types/runtime/router.d.ts +40 -2
  70. package/dist/types/runtime/splash.d.ts +90 -0
  71. package/dist/types/runtime/svelte-compiler-engine.d.ts +1 -0
  72. package/dist/types/runtime/svelte-compiler-loader.d.ts +14 -0
  73. package/dist/types/runtime/svelte-runtime.d.ts +29 -0
  74. package/dist/types/runtime/svelte-tag.d.ts +7 -0
  75. package/dist/types/runtime/ts-compiler.d.ts +24 -0
  76. package/dist/types/runtime/types.d.ts +1 -0
  77. package/dist/types/ui/doc-context.svelte.d.ts +198 -0
  78. package/dist/types/ui/index.d.ts +33 -0
  79. package/dist/types/ui/registry.d.ts +52 -0
  80. package/dist/types/ui/theme.svelte.d.ts +32 -0
  81. package/dist/wardley-WFR3VGLG-BK9BA6h6.mjs +2 -0
  82. package/dist/wardley-WFR3VGLG-Cbs7W-dU.js +1 -0
  83. package/package.json +61 -48
  84. package/schemas/docs.schema.json +186 -181
  85. package/templates/.dmd/CounterWidget.svelte +29 -0
  86. package/templates/README.md +2 -2
  87. package/templates/favicon.svg +12 -0
  88. package/templates/favicons/favicon-book.svg +11 -0
  89. package/templates/favicons/favicon-markdown.svg +11 -0
  90. package/templates/favicons/favicon-minimal.svg +15 -0
  91. package/templates/favicons/favicon-terminal.svg +14 -0
  92. package/templates/favicons/favicon.svg +12 -0
  93. package/templates/guides/custom-components.md +82 -22
  94. package/templates/index.html +6 -3
  95. package/dist/abnfDiagram-VCTEODGH-CtQBp0Qv.mjs +0 -89
  96. package/dist/abnfDiagram-VCTEODGH-mccrzlD_.js +0 -1
  97. package/dist/arc-DgPKXEdT.mjs +0 -82
  98. package/dist/arc-n7TW7Bis.js +0 -1
  99. package/dist/architecture-7GRP2DOG-B7myQ46f.js +0 -1
  100. package/dist/architecture-7GRP2DOG-Cxj1ussQ.mjs +0 -3
  101. package/dist/architectureDiagram-5GKGNRK7-BdTCu5T3.js +0 -36
  102. package/dist/architectureDiagram-5GKGNRK7-CkgZa-G1.mjs +0 -4154
  103. package/dist/array-CApNbSU9.mjs +0 -6
  104. package/dist/array-DZSRzHA_.js +0 -1
  105. package/dist/blockDiagram-I7D4REHJ-CSYvpxQw.js +0 -129
  106. package/dist/blockDiagram-I7D4REHJ-CYngfPD9.mjs +0 -1922
  107. package/dist/c4Diagram-7LVT6UL2-B-sz5MUK.js +0 -38
  108. package/dist/c4Diagram-7LVT6UL2-DEzxFf2b.mjs +0 -3010
  109. package/dist/channel-LgHproiI.mjs +0 -5
  110. package/dist/channel-yqu0m4cl.js +0 -1
  111. package/dist/chunk-2E4U76K2-BOyeRQsI.js +0 -1
  112. package/dist/chunk-2E4U76K2-CoTrgtfg.mjs +0 -348
  113. package/dist/chunk-2Q5K7J3B-D4EgYPOq.mjs +0 -15
  114. package/dist/chunk-2Q5K7J3B-DhjCNjaM.js +0 -1
  115. package/dist/chunk-4HAMMTFA-GFyfmcSO.js +0 -62
  116. package/dist/chunk-4HAMMTFA-VgWPe1ng.mjs +0 -4188
  117. package/dist/chunk-5VM5RSS4-GINalzIv.js +0 -15
  118. package/dist/chunk-5VM5RSS4-TqxtqrwE.mjs +0 -5
  119. package/dist/chunk-75Z2AOVW-DYouz5MZ.js +0 -2
  120. package/dist/chunk-75Z2AOVW-Dz0Sko9Y.mjs +0 -1330
  121. package/dist/chunk-CLGD4ZFX-C5J-e2io.js +0 -1
  122. package/dist/chunk-CLGD4ZFX-DBkwyMMv.mjs +0 -14
  123. package/dist/chunk-DU6HZSFF-BEQZSmUu.mjs +0 -3836
  124. package/dist/chunk-DU6HZSFF-CWc5ewtb.js +0 -127
  125. package/dist/chunk-F27PBJKO-8jvY_jJK.js +0 -1
  126. package/dist/chunk-F27PBJKO-DFH3sRZG.mjs +0 -61
  127. package/dist/chunk-FOHPRMQF-LRqOLsSw.mjs +0 -21456
  128. package/dist/chunk-FOHPRMQF-tmTlwTeH.js +0 -161
  129. package/dist/chunk-GMAD6QVW-BZeZ4fdb.mjs +0 -1863
  130. package/dist/chunk-GMAD6QVW-DEQiTa0c.js +0 -72
  131. package/dist/chunk-GVQU2GXP-B1D3J05J.mjs +0 -37
  132. package/dist/chunk-GVQU2GXP-CdJIWN41.js +0 -1
  133. package/dist/chunk-IMKFNOWR-BmZb9U1f.mjs +0 -2042
  134. package/dist/chunk-IMKFNOWR-CPJsszGN.js +0 -231
  135. package/dist/chunk-JWPE2WC7-DIKiF5cm.mjs +0 -8
  136. package/dist/chunk-JWPE2WC7-p1fYVdYc.js +0 -1
  137. package/dist/chunk-L3NEJ4N5-TzDiVs78.js +0 -1
  138. package/dist/chunk-L3NEJ4N5-lal8wUID.mjs +0 -245
  139. package/dist/chunk-LNGE3PJU-BQX75wkM.js +0 -34
  140. package/dist/chunk-LNGE3PJU-DJ9JuXV6.mjs +0 -1521
  141. package/dist/chunk-OSK3NFVY-9AWK88m1.mjs +0 -672
  142. package/dist/chunk-OSK3NFVY-CHzvVe8m.js +0 -10
  143. package/dist/chunk-P2QGCYS3-6q3AXPt5.mjs +0 -67
  144. package/dist/chunk-P2QGCYS3-DKZzpRQW.js +0 -1
  145. package/dist/chunk-POPQ4Y6H-Dd7J9tx3.mjs +0 -26
  146. package/dist/chunk-POPQ4Y6H-T5C7wpjf.js +0 -1
  147. package/dist/chunk-PWAF6VOD-BYG76tEe.mjs +0 -275
  148. package/dist/chunk-PWAF6VOD-DxZLuCEw.js +0 -1
  149. package/dist/chunk-SHT3W25Y-B2Wes8jn.mjs +0 -4183
  150. package/dist/chunk-SHT3W25Y-BQjHSn5K.js +0 -168
  151. package/dist/chunk-SVP7TREG-BFMd615E.js +0 -88
  152. package/dist/chunk-SVP7TREG-CynckzeF.mjs +0 -490
  153. package/dist/chunk-TICWLB2K-BfCuoR1V.mjs +0 -3357
  154. package/dist/chunk-TICWLB2K-agcyBfUp.js +0 -206
  155. package/dist/chunk-TLUHSLCS-CUrWaKDG.mjs +0 -59
  156. package/dist/chunk-TLUHSLCS-Drx_a7am.js +0 -1
  157. package/dist/chunk-XXDRQBXY-AAk1-Cyg.js +0 -1
  158. package/dist/chunk-XXDRQBXY-DpR8eYzz.mjs +0 -9
  159. package/dist/chunk-Y2CYZVJY-CnmLqFtv.js +0 -1
  160. package/dist/chunk-Y2CYZVJY-i11wjrBe.mjs +0 -12
  161. package/dist/classDiagram-ZZMXUADV-B7IN9zcX.js +0 -1
  162. package/dist/classDiagram-ZZMXUADV-tcy6gxSB.mjs +0 -30
  163. package/dist/classDiagram-v2-VYDZK3BY-B7IN9zcX.js +0 -1
  164. package/dist/classDiagram-v2-VYDZK3BY-D5wM6Acp.mjs +0 -30
  165. package/dist/cose-bilkent-JH36ORCC-DBUPO3qJ.js +0 -1
  166. package/dist/cose-bilkent-JH36ORCC-Slpx4WIt.mjs +0 -2253
  167. package/dist/cynefin-OW5HDTMX--QVnfGi1.mjs +0 -3
  168. package/dist/cynefin-OW5HDTMX-lNKysi7S.js +0 -1
  169. package/dist/cynefinDiagram-5FMLGOSQ-CsFONYqx.js +0 -62
  170. package/dist/cynefinDiagram-5FMLGOSQ-DsrxYBcg.mjs +0 -355
  171. package/dist/cytoscape.esm-C5TvPYYm.mjs +0 -18148
  172. package/dist/cytoscape.esm-CBmWJr5M.js +0 -321
  173. package/dist/dagre-CZ6P9L_h.js +0 -1
  174. package/dist/dagre-GXQ25YYZ-CQszk-7P.js +0 -4
  175. package/dist/dagre-GXQ25YYZ-ecYByRSn.mjs +0 -425
  176. package/dist/dagre-J_1oH0eY.mjs +0 -1934
  177. package/dist/defaultLocale-N-0uLSyg.mjs +0 -198
  178. package/dist/defaultLocale-ybN1Vtvg.js +0 -1
  179. package/dist/diagram-S7CK7UJ4-CTMvxX__.js +0 -30
  180. package/dist/diagram-S7CK7UJ4-DxCghfa-.mjs +0 -301
  181. package/dist/diagram-UQ7AKVKN-1viEkqlG.js +0 -41
  182. package/dist/diagram-UQ7AKVKN-BA7Z_oB7.mjs +0 -214
  183. package/dist/diagram-VSXAHHWV-DgVT19mq.js +0 -3
  184. package/dist/diagram-VSXAHHWV-Dtqo03M5.mjs +0 -432
  185. package/dist/diagram-VX7I27RA-CNw0pOX_.js +0 -24
  186. package/dist/diagram-VX7I27RA-GMPRt8Zh.mjs +0 -527
  187. package/dist/diagram-Z3DM3KII-C6XdQK_Q.mjs +0 -134
  188. package/dist/diagram-Z3DM3KII-CPkBr3FT.js +0 -24
  189. package/dist/dist-CXWJafG_.js +0 -1
  190. package/dist/dist-DNdLIC8h.mjs +0 -59
  191. package/dist/ebnfDiagram-PWID7BFC-CseVsyL3.js +0 -1
  192. package/dist/ebnfDiagram-PWID7BFC-D_dBDXWC.mjs +0 -100
  193. package/dist/erDiagram-RLTQ6QDP-DFwfQTRS.js +0 -99
  194. package/dist/erDiagram-RLTQ6QDP-DP7ddGMH.mjs +0 -1966
  195. package/dist/eventmodeling-NTZA5JFV-CzxVg0l5.js +0 -1
  196. package/dist/eventmodeling-NTZA5JFV-Djsy__5n.mjs +0 -3
  197. package/dist/flowDiagram-HODETNUW-7hSJfI3W.js +0 -1
  198. package/dist/flowDiagram-HODETNUW-Dqu5Lr19.mjs +0 -17
  199. package/dist/ganttDiagram-EL5Y4UJY-KNL3tzTD.mjs +0 -3072
  200. package/dist/ganttDiagram-EL5Y4UJY-aiLqNWgi.js +0 -292
  201. package/dist/gitGraph-4MIJSDKK-DnElfqX7.js +0 -1
  202. package/dist/gitGraph-4MIJSDKK-xuKJBT2e.mjs +0 -3
  203. package/dist/gitGraphDiagram-WWUBYQGX-D4gSo_-e.js +0 -106
  204. package/dist/gitGraphDiagram-WWUBYQGX-Dooss5fG.mjs +0 -733
  205. package/dist/graphlib-BaETKKSa.js +0 -1
  206. package/dist/graphlib-XW-Jr8pF.mjs +0 -1267
  207. package/dist/info-A6RAGUB7-ClYskpn6.mjs +0 -3
  208. package/dist/info-A6RAGUB7-DDvvt-fW.js +0 -1
  209. package/dist/infoDiagram-27XIBGKW-B2-y2mdQ.mjs +0 -20
  210. package/dist/infoDiagram-27XIBGKW-DYQ9NzfL.js +0 -2
  211. package/dist/init-BJdqMO10.js +0 -1
  212. package/dist/init-CsQUQz36.mjs +0 -13
  213. package/dist/ishikawaDiagram-5VMMS53U-ULIhoYO5.js +0 -70
  214. package/dist/ishikawaDiagram-5VMMS53U-xAArNh-1.mjs +0 -719
  215. package/dist/journeyDiagram-3NMN7TZE-BBMYNZRL.js +0 -139
  216. package/dist/journeyDiagram-3NMN7TZE-BH-uKqP7.mjs +0 -884
  217. package/dist/kanban-definition-UXKFOSKX-Be49llXr.mjs +0 -976
  218. package/dist/kanban-definition-UXKFOSKX-CDL5yJkq.js +0 -89
  219. package/dist/line-BEwhHSLl.js +0 -1
  220. package/dist/line-CiXRog8O.mjs +0 -34
  221. package/dist/linear-75tfjrny.js +0 -1
  222. package/dist/linear-Ncx_RuON.mjs +0 -288
  223. package/dist/mermaid-parser.core-BBApyu_y.js +0 -6
  224. package/dist/mermaid-parser.core-BRHibdUE.mjs +0 -638
  225. package/dist/mindmap-definition-YA3MSWOX-Chy7XP_5.mjs +0 -1006
  226. package/dist/mindmap-definition-YA3MSWOX-DOda-fkL.js +0 -96
  227. package/dist/ordinal-B1BNQwUR.mjs +0 -65
  228. package/dist/ordinal-B9aFWmF9.js +0 -1
  229. package/dist/packet-AYTQ26CC-CorIy9Ul.js +0 -1
  230. package/dist/packet-AYTQ26CC-DWH8gXJK.mjs +0 -3
  231. package/dist/path-CnWkkRiY.mjs +0 -84
  232. package/dist/path-DIS6ck99.js +0 -1
  233. package/dist/pegDiagram-XKGWAZYB-Cdw6MeON.js +0 -1
  234. package/dist/pegDiagram-XKGWAZYB-uNfxRaq1.mjs +0 -94
  235. package/dist/pie-WAS4IAKB-Cn5eK-5P.mjs +0 -3
  236. package/dist/pie-WAS4IAKB-D84xrSoY.js +0 -1
  237. package/dist/pieDiagram-E7YTZNPT-Bd6mvpJw.js +0 -39
  238. package/dist/pieDiagram-E7YTZNPT-Cczo96a2.mjs +0 -203
  239. package/dist/quadrantDiagram-AXDQQJYC-BPfgvMsS.js +0 -7
  240. package/dist/quadrantDiagram-AXDQQJYC-eqRNtVRl.mjs +0 -2001
  241. package/dist/radar-RG4KPBEZ-DvkxGdO6.mjs +0 -3
  242. package/dist/radar-RG4KPBEZ-R2sQOLL9.js +0 -1
  243. package/dist/railroad-74A4TZTK-BOZIf6ts.js +0 -1
  244. package/dist/railroad-74A4TZTK-CrQzn8Nm.mjs +0 -3
  245. package/dist/railroad-abnf-HS5TGJTU-BZYetxLz.mjs +0 -3
  246. package/dist/railroad-abnf-HS5TGJTU-CXU1aC4B.js +0 -1
  247. package/dist/railroad-ebnf-LZEXJU2U-D29kI3YW.js +0 -1
  248. package/dist/railroad-ebnf-LZEXJU2U-qgzTOmN6.mjs +0 -3
  249. package/dist/railroad-peg-WCYAUIDC-Bjs9Ws3P.mjs +0 -3
  250. package/dist/railroad-peg-WCYAUIDC-CXviP0hz.js +0 -1
  251. package/dist/railroadDiagram-O6MQD6OU-58kvwt7H.mjs +0 -76
  252. package/dist/railroadDiagram-O6MQD6OU-CKY3uzTc.js +0 -1
  253. package/dist/requirementDiagram-BXWQKSXE-0hZ04Q6h.js +0 -84
  254. package/dist/requirementDiagram-BXWQKSXE-CS673B5n.mjs +0 -2224
  255. package/dist/rough.esm-ChRLLRha.js +0 -1
  256. package/dist/rough.esm-DXYGHN3m.mjs +0 -1361
  257. package/dist/sankeyDiagram-P5KCCOFB-D1D6HfAM.mjs +0 -972
  258. package/dist/sankeyDiagram-P5KCCOFB-ciJb9Zr8.js +0 -40
  259. package/dist/sequenceDiagram-WJ2MYXX4-BXEznuI6.js +0 -162
  260. package/dist/sequenceDiagram-WJ2MYXX4-CI1VT8AG.mjs +0 -4156
  261. package/dist/sizeCapture-INFHLROL-BihkCH-7.js +0 -1
  262. package/dist/sizeCapture-INFHLROL-BmxqyOLj.mjs +0 -46
  263. package/dist/src-B4mN2BMl.js +0 -1
  264. package/dist/src-D_hsMyeP.mjs +0 -2154
  265. package/dist/stateDiagram-D77RDMKH-BQrSs72W.mjs +0 -220
  266. package/dist/stateDiagram-D77RDMKH-D2PtkW2U.js +0 -1
  267. package/dist/stateDiagram-v2-MP3YSRHH-CCbvNfk-.mjs +0 -30
  268. package/dist/stateDiagram-v2-MP3YSRHH-Dq1QuPeN.js +0 -1
  269. package/dist/swimlanes-42K2YHIH-CA316NPm.mjs +0 -4979
  270. package/dist/swimlanes-42K2YHIH-DlggBCTy.js +0 -1
  271. package/dist/swimlanesDiagram-VR7AAH4N-BV9PEIoG.js +0 -8
  272. package/dist/swimlanesDiagram-VR7AAH4N-BfrOCfdf.mjs +0 -31
  273. package/dist/timeline-definition-24CTP7MA-Bkd8rWNJ.js +0 -120
  274. package/dist/timeline-definition-24CTP7MA-BvkqNYt1.mjs +0 -1069
  275. package/dist/treeView-Q6P3EWNA-Aof3Cp1M.mjs +0 -3
  276. package/dist/treeView-Q6P3EWNA-BTzvdwbb.js +0 -1
  277. package/dist/treemap-WGGIJYW6-BNXGg99p.mjs +0 -3
  278. package/dist/treemap-WGGIJYW6-DfR4P2Hh.js +0 -1
  279. package/dist/types/runtime/app.d.ts +0 -9
  280. package/dist/types/runtime/components/AppearanceMenu.d.ts +0 -2
  281. package/dist/types/runtime/components/Builtins.d.ts +0 -44
  282. package/dist/types/runtime/components/Content.d.ts +0 -2
  283. package/dist/types/runtime/components/DmdRegistry.d.ts +0 -19
  284. package/dist/types/runtime/components/Layout.d.ts +0 -2
  285. package/dist/types/runtime/components/MermaidDiagram.d.ts +0 -16
  286. package/dist/types/runtime/components/Navbar.d.ts +0 -2
  287. package/dist/types/runtime/components/OfflineDownloadButton.d.ts +0 -2
  288. package/dist/types/runtime/components/OfflineNotice.d.ts +0 -6
  289. package/dist/types/runtime/components/Sidebar.d.ts +0 -2
  290. package/dist/types/runtime/components/TableOfContents.d.ts +0 -8
  291. package/dist/types/runtime/index.d.ts +0 -8
  292. package/dist/types/runtime/markdown/renderer.d.ts +0 -7
  293. package/dist/types/runtime/provider/DocProvider.d.ts +0 -40
  294. package/dist/types/runtime/provider/ThemeProvider.d.ts +0 -25
  295. package/dist/types/runtime/search/SearchModal.d.ts +0 -11
  296. package/dist/vennDiagram-4TSXK5OY-BOUFXjso.js +0 -34
  297. package/dist/vennDiagram-4TSXK5OY-CeOg3-hU.mjs +0 -1880
  298. package/dist/wardley-WFR3VGLG-BOYcSLd1.mjs +0 -3
  299. package/dist/wardley-WFR3VGLG-DWDqJSgm.js +0 -1
  300. package/dist/wardleyDiagram-VM6X3IG4-BhWgMjFr.js +0 -78
  301. package/dist/wardleyDiagram-VM6X3IG4-C31KoRmF.mjs +0 -645
  302. package/dist/xychartDiagram-S5SC5T6Z-1yU8zz6I.js +0 -7
  303. package/dist/xychartDiagram-S5SC5T6Z-BK7upFom.mjs +0 -2210
  304. package/templates/.dmd/components.js +0 -25
@@ -1,4188 +0,0 @@
1
- import { m as e, p as t } from "./src-D_hsMyeP.mjs";
2
- import { n } from "./chunk-Y2CYZVJY-i11wjrBe.mjs";
3
- import { A as r, B as i, M as a, T as o, b as s, f as c, g as l, x as u, z as d } from "./chunk-DU6HZSFF-BEQZSmUu.mjs";
4
- import { a as f, p, r as m, u as h } from "./chunk-75Z2AOVW-Dz0Sko9Y.mjs";
5
- import { a as g, i as _, r as v, t as y } from "./chunk-P2QGCYS3-6q3AXPt5.mjs";
6
- import { t as b } from "./chunk-PWAF6VOD-BYG76tEe.mjs";
7
- import { n as x, r as S } from "./chunk-GMAD6QVW-BZeZ4fdb.mjs";
8
- import { t as C } from "./rough.esm-DXYGHN3m.mjs";
9
- //#region node_modules/mermaid/dist/chunks/mermaid.core/chunk-4HAMMTFA.mjs
10
- var w = 1, T = 3;
11
- async function E(e) {
12
- let t = e.getElementsByTagName("img");
13
- if (!t || t.length === 0) return;
14
- let r = !D(e);
15
- await Promise.all([...t].map((e) => new Promise((t) => {
16
- function i() {
17
- if (e.style.display = "flex", e.style.flexDirection = "column", r) {
18
- let t = u().fontSize ? u().fontSize : window.getComputedStyle(document.body).fontSize, [n = c.fontSize] = p(t), r = n * 5 + "px";
19
- e.style.minWidth = r, e.style.maxWidth = r;
20
- } else e.style.width = "100%";
21
- t(e);
22
- }
23
- n(i, "setupImage"), setTimeout(() => {
24
- e.complete && i();
25
- }), e.addEventListener("error", i), e.addEventListener("load", i);
26
- })));
27
- }
28
- n(E, "configureLabelImages");
29
- function D(e) {
30
- return e.nodeType === T ? e.textContent?.trim() !== "" : e.nodeType !== w || e.tagName.toLowerCase() === "img" ? !1 : [...e.childNodes].some(D);
31
- }
32
- n(D, "hasTextBesidesImages");
33
- var O = 3, k = 32, A = /* @__PURE__ */ n(async (e, n, r) => {
34
- let i = u(), a = e.insert("g").attr("class", r ?? "node default").attr("id", n.domId || n.id), o = a.insert("g").attr("class", "label").attr("style", h(n.labelStyle)), s = [
35
- {
36
- text: typeof n.label == "string" ? n.label : n.label?.[0] ?? "",
37
- cssClass: "c4-name"
38
- },
39
- {
40
- text: n.stereotype,
41
- cssClass: "c4-type"
42
- },
43
- ...(n.description ?? []).map((e) => ({
44
- text: e,
45
- cssClass: "c4-descr"
46
- }))
47
- ].filter((e) => e.text), c = n.width ? Math.max(n.width - 2 * (n.padding ?? 0), k) : u().flowchart?.wrappingWidth ?? 200, l = i.c4?.wrap ?? !0 ? c : Infinity, p = await Promise.all(s.map(async (e) => {
48
- let r = o.append("g").attr("class", e.cssClass), a = await x(r, d(f(e.text ?? ""), i), {
49
- useHtmlLabels: !1,
50
- markdown: !1,
51
- isNode: !0,
52
- width: l,
53
- style: n.labelStyle
54
- }, i);
55
- return t(a).selectAll("tspan.text-outer-tspan").attr("text-anchor", "middle"), t(a).selectAll("tspan.text-inner-tspan").attr("font-weight", null).attr("font-style", null), {
56
- el: r,
57
- box: r.node().getBBox()
58
- };
59
- })), m = Math.max(...p.map(({ box: e }) => e.width), 0), g = 0;
60
- for (let { el: e, box: t } of p) e.attr("transform", `translate(${m / 2 - t.x - t.width / 2}, ${g - t.y})`), g += t.height + O;
61
- let _ = p.length > 0 ? g - O : 0;
62
- return o.insert("rect", ":first-child"), o.attr("transform", `translate(${-m / 2}, ${-_ / 2})`), {
63
- shapeSvg: a,
64
- bbox: o.node().getBBox(),
65
- halfPadding: (n.padding ?? 0) / 2,
66
- label: o
67
- };
68
- }, "c4LabelHelper"), j = /* @__PURE__ */ n(async (e, n, r) => {
69
- if (n.stereotype !== void 0) return A(e, n, r);
70
- let i, a = n.useHtmlLabels || l(u()?.htmlLabels);
71
- i = r || "node default";
72
- let o = e.insert("g").attr("class", i).attr("id", n.domId || n.id), s = o.insert("g").attr("class", "label").attr("style", h(n.labelStyle)), c;
73
- c = n.label === void 0 ? "" : typeof n.label == "string" ? n.label : n.label[0];
74
- let p = !!n.icon || !!n.img, m = n.labelType === "markdown", g = await x(s, d(f(c), u()), {
75
- useHtmlLabels: a,
76
- width: n.width || n.wrappingWidth || u().flowchart?.wrappingWidth,
77
- classes: m ? "markdown-node-label" : "",
78
- style: n.labelStyle,
79
- addSvgBackground: p,
80
- markdown: m
81
- }, u()), _ = (n?.padding ?? 0) / 2, v;
82
- if (a) {
83
- let e = g.children[0], n = t(g);
84
- await E(e), v = await S.measure(() => e.getBoundingClientRect()), n.attr("width", v.width), n.attr("height", v.height);
85
- } else v = await S.measure(() => g.getBBox());
86
- return a ? s.attr("transform", "translate(" + -v.width / 2 + ", " + -v.height / 2 + ")") : s.attr("transform", "translate(0, " + -v.height / 2 + ")"), n.centerLabel && s.attr("transform", "translate(" + -v.width / 2 + ", " + -v.height / 2 + ")"), s.insert("rect", ":first-child"), {
87
- shapeSvg: o,
88
- bbox: v,
89
- halfPadding: _,
90
- label: s
91
- };
92
- }, "labelHelper"), M = /* @__PURE__ */ n(async (e, n, r) => {
93
- let i = r.useHtmlLabels ?? o(u()), a = e.insert("g").attr("class", "label").attr("style", r.labelStyle || ""), s = await x(a, d(f(n), u()), {
94
- useHtmlLabels: i,
95
- width: r.width || u()?.flowchart?.wrappingWidth,
96
- style: r.labelStyle,
97
- addSvgBackground: !!r.icon || !!r.img
98
- }), c = r.padding / 2, l;
99
- if (o(u())) {
100
- let e = s.children[0], n = t(s);
101
- l = await S.measure(() => e.getBoundingClientRect()), n.attr("width", l.width), n.attr("height", l.height);
102
- } else l = await S.measure(() => s.getBBox());
103
- return i ? a.attr("transform", "translate(" + -l.width / 2 + ", " + -l.height / 2 + ")") : a.attr("transform", "translate(0, " + -l.height / 2 + ")"), r.centerLabel && a.attr("transform", "translate(" + -l.width / 2 + ", " + -l.height / 2 + ")"), a.insert("rect", ":first-child"), {
104
- shapeSvg: e,
105
- bbox: l,
106
- halfPadding: c,
107
- label: a
108
- };
109
- }, "insertLabel"), N = /* @__PURE__ */ n((e, t, n) => {
110
- if (n) {
111
- e.width = n.width, e.height = n.height;
112
- return;
113
- }
114
- let r = t.node().getBBox();
115
- e.width = r.width, e.height = r.height;
116
- }, "updateNodeBounds"), P = /* @__PURE__ */ n((e, t) => (e.look === "handDrawn" ? "rough-node" : "node") + " " + e.cssClasses + " " + (t || ""), "getNodeClasses");
117
- function F(e) {
118
- let t = e.map((e, t) => `${t === 0 ? "M" : "L"}${e.x},${e.y}`);
119
- return t.push("Z"), t.join(" ");
120
- }
121
- n(F, "createPathFromPoints");
122
- function I(e, t, n, r, i, a) {
123
- let o = [], s = n - e, c = r - t, l = s / a, u = 2 * Math.PI / l, d = t + c / 2;
124
- for (let t = 0; t <= 50; t++) {
125
- let n = e + t / 50 * s, r = d + i * Math.sin(u * (n - e));
126
- o.push({
127
- x: n,
128
- y: r
129
- });
130
- }
131
- return o;
132
- }
133
- n(I, "generateFullSineWavePoints");
134
- function L(e, t, n, r, i, a) {
135
- let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
136
- for (let i = 0; i < r; i++) {
137
- let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
138
- o.push({
139
- x: -a,
140
- y: -l
141
- });
142
- }
143
- return o;
144
- }
145
- n(L, "generateCirclePoints");
146
- function ee(e) {
147
- let t = Array.from(e.childNodes).filter((e) => e.tagName === "path"), r = document.createElementNS("http://www.w3.org/2000/svg", "path"), i = t.map((e) => e.getAttribute("d")).filter((e) => e !== null).join(" ");
148
- r.setAttribute("d", i);
149
- let a = t.find((e) => e.getAttribute("fill") !== "none"), o = t.find((e) => e.getAttribute("stroke") !== "none"), s = /* @__PURE__ */ n((e, t) => e?.getAttribute(t) ?? void 0, "getAttr");
150
- if (a) {
151
- let e = {
152
- fill: s(a, "fill"),
153
- "fill-opacity": s(a, "fill-opacity") ?? "1"
154
- };
155
- Object.entries(e).forEach(([e, t]) => {
156
- t && r.setAttribute(e, t);
157
- });
158
- }
159
- if (o) {
160
- let e = {
161
- stroke: s(o, "stroke"),
162
- "stroke-width": s(o, "stroke-width") ?? "1",
163
- "stroke-opacity": s(o, "stroke-opacity") ?? "1"
164
- };
165
- Object.entries(e).forEach(([e, t]) => {
166
- t && r.setAttribute(e, t);
167
- });
168
- }
169
- let c = document.createElementNS("http://www.w3.org/2000/svg", "g");
170
- return c.appendChild(r), c;
171
- }
172
- n(ee, "mergePaths");
173
- var R = /* @__PURE__ */ n((e, t) => {
174
- var n = e.x, r = e.y, i = t.x - n, a = t.y - r, o = e.width / 2, s = e.height / 2, c, l;
175
- return Math.abs(a) * o > Math.abs(i) * s ? (a < 0 && (s = -s), c = a === 0 ? 0 : s * i / a, l = s) : (i < 0 && (o = -o), c = o, l = i === 0 ? 0 : o * a / i), {
176
- x: n + c,
177
- y: r + l
178
- };
179
- }, "intersectRect"), z = /* @__PURE__ */ n((e, t, n, r, i) => [
180
- "M",
181
- e + i,
182
- t,
183
- "H",
184
- e + n - i,
185
- "A",
186
- i,
187
- i,
188
- 0,
189
- 0,
190
- 1,
191
- e + n,
192
- t + i,
193
- "V",
194
- t + r - i,
195
- "A",
196
- i,
197
- i,
198
- 0,
199
- 0,
200
- 1,
201
- e + n - i,
202
- t + r,
203
- "H",
204
- e + i,
205
- "A",
206
- i,
207
- i,
208
- 0,
209
- 0,
210
- 1,
211
- e,
212
- t + r - i,
213
- "V",
214
- t + i,
215
- "A",
216
- i,
217
- i,
218
- 0,
219
- 0,
220
- 1,
221
- e + i,
222
- t,
223
- "Z"
224
- ].join(" "), "createRoundedRectPathD"), te = /* @__PURE__ */ n(async (e, t, n, r = !1, i = !1) => {
225
- let a = t || "";
226
- typeof a == "object" && (a = a[0]);
227
- let s = u(), c = o(s);
228
- return await x(e, a, {
229
- style: n,
230
- isTitle: r,
231
- useHtmlLabels: c,
232
- markdown: !1,
233
- isNode: i,
234
- width: Infinity
235
- }, s);
236
- }, "createLabel");
237
- function B(e, t) {
238
- return e.intersect(t);
239
- }
240
- n(B, "intersectNode");
241
- var ne = B;
242
- function V(e, t, n, r) {
243
- var i = e.x, a = e.y, o = i - r.x, s = a - r.y, c = Math.sqrt(t * t * s * s + n * n * o * o), l = Math.abs(t * n * o / c);
244
- r.x < i && (l = -l);
245
- var u = Math.abs(t * n * s / c);
246
- return r.y < a && (u = -u), {
247
- x: i + l,
248
- y: a + u
249
- };
250
- }
251
- n(V, "intersectEllipse");
252
- var H = V;
253
- function re(e, t, n) {
254
- return H(e, t, t, n);
255
- }
256
- n(re, "intersectCircle");
257
- var ie = re;
258
- function U(e, t, n, r) {
259
- {
260
- let i = t.y - e.y, a = e.x - t.x, o = t.x * e.y - e.x * t.y, s = i * n.x + a * n.y + o, c = i * r.x + a * r.y + o, l = 1e-6;
261
- if (s !== 0 && c !== 0 && W(s, c)) return;
262
- let u = r.y - n.y, d = n.x - r.x, f = r.x * n.y - n.x * r.y, p = u * e.x + d * e.y + f, m = u * t.x + d * t.y + f;
263
- if (Math.abs(p) < l && Math.abs(m) < l && W(p, m)) return;
264
- let h = i * d - u * a;
265
- if (h === 0) return;
266
- let g = Math.abs(h / 2), _ = a * f - d * o, v = _ < 0 ? (_ - g) / h : (_ + g) / h;
267
- return _ = u * o - i * f, {
268
- x: v,
269
- y: _ < 0 ? (_ - g) / h : (_ + g) / h
270
- };
271
- }
272
- }
273
- n(U, "intersectLine");
274
- function W(e, t) {
275
- return e * t > 0;
276
- }
277
- n(W, "sameSign");
278
- var G = U;
279
- function ae(e, t, n) {
280
- let r = e.x, i = e.y, a = [], o = Infinity, s = Infinity;
281
- typeof t.forEach == "function" ? t.forEach(function(e) {
282
- o = Math.min(o, e.x), s = Math.min(s, e.y);
283
- }) : (o = Math.min(o, t.x), s = Math.min(s, t.y));
284
- let c = r - e.width / 2 - o, l = i - e.height / 2 - s;
285
- for (let r = 0; r < t.length; r++) {
286
- let i = t[r], o = t[r < t.length - 1 ? r + 1 : 0], s = G(e, n, {
287
- x: c + i.x,
288
- y: l + i.y
289
- }, {
290
- x: c + o.x,
291
- y: l + o.y
292
- });
293
- s && a.push(s);
294
- }
295
- return a.length ? (a.length > 1 && a.sort(function(e, t) {
296
- let r = e.x - n.x, i = e.y - n.y, a = Math.sqrt(r * r + i * i), o = t.x - n.x, s = t.y - n.y, c = Math.sqrt(o * o + s * s);
297
- return a < c ? -1 : a === c ? 0 : 1;
298
- }), a[0]) : e;
299
- }
300
- n(ae, "intersectPolygon");
301
- var K = {
302
- node: ne,
303
- circle: ie,
304
- ellipse: H,
305
- polygon: ae,
306
- rect: R
307
- };
308
- function oe(t, n) {
309
- let { labelStyles: r } = _(n);
310
- n.labelStyle = r;
311
- let i = P(n), a = i;
312
- i || (a = "anchor");
313
- let o = t.insert("g").attr("class", a).attr("id", n.domId || n.id), { cssStyles: s } = n, c = C.svg(o), l = g(n, {
314
- fill: "black",
315
- stroke: "none",
316
- fillStyle: "solid"
317
- });
318
- n.look !== "handDrawn" && (l.roughness = 0);
319
- let u = c.circle(0, 0, 2, l), d = o.insert(() => u, ":first-child");
320
- return d.attr("class", "anchor").attr("style", h(s)), N(n, d), n.intersect = function(t) {
321
- return e.info("Circle intersect", n, 1, t), K.circle(n, 1, t);
322
- }, o;
323
- }
324
- n(oe, "anchor");
325
- function se(e, t, n, r, i, a, o) {
326
- let s = (e + n) / 2, c = (t + r) / 2, l = Math.atan2(r - t, n - e), u = (n - e) / 2, d = (r - t) / 2, f = u / i, p = d / a, m = Math.sqrt(f ** 2 + p ** 2);
327
- if (m > 1) throw Error("The given radii are too small to create an arc between the points.");
328
- let h = Math.sqrt(1 - m ** 2), g = s + h * a * Math.sin(l) * (o ? -1 : 1), _ = c - h * i * Math.cos(l) * (o ? -1 : 1), v = Math.atan2((t - _) / a, (e - g) / i), y = Math.atan2((r - _) / a, (n - g) / i) - v;
329
- o && y < 0 && (y += 2 * Math.PI), !o && y > 0 && (y -= 2 * Math.PI);
330
- let b = [];
331
- for (let e = 0; e < 20; e++) {
332
- let t = v + e / 19 * y, n = g + i * Math.cos(t), r = _ + a * Math.sin(t);
333
- b.push({
334
- x: n,
335
- y: r
336
- });
337
- }
338
- return b;
339
- }
340
- n(se, "generateArcPoints");
341
- function ce(e, t, n) {
342
- let [r, i] = [t, n].sort((e, t) => t - e);
343
- return i * (1 - Math.sqrt(1 - (e / r / 2) ** 2));
344
- }
345
- n(ce, "calculateArcSagitta");
346
- async function le(e, t) {
347
- let { labelStyles: r, nodeStyles: i } = _(t);
348
- t.labelStyle = r;
349
- let a = t.padding ?? 0, o = t.look === "neo" ? 16 : a, s = t.look === "neo" ? 12 : a, c = /* @__PURE__ */ n((e) => e + s, "calcTotalHeight"), l = /* @__PURE__ */ n((e) => {
350
- let t = e / 2;
351
- return [t / (2.5 + e / 50), t];
352
- }, "calcEllipseRadius"), { shapeSvg: u, bbox: d } = await j(e, t, P(t)), f = c(t?.height ? t?.height : d.height), [p, m] = l(f), h = ce(f, p, m), v = (t?.width ? t?.width : d.width) + o * 2 + h - h, y = f, { cssStyles: b } = t, x = [
353
- {
354
- x: v / 2,
355
- y: -y / 2
356
- },
357
- {
358
- x: -v / 2,
359
- y: -y / 2
360
- },
361
- ...se(-v / 2, -y / 2, -v / 2, y / 2, p, m, !1),
362
- {
363
- x: v / 2,
364
- y: y / 2
365
- },
366
- ...se(v / 2, y / 2, v / 2, -y / 2, p, m, !0)
367
- ], S = C.svg(u), w = g(t, {});
368
- t.look !== "handDrawn" && (w.roughness = 0, w.fillStyle = "solid");
369
- let T = F(x), E = S.path(T, w), D = u.insert(() => E, ":first-child");
370
- return D.attr("class", "basic label-container outer-path"), b && t.look !== "handDrawn" && D.selectAll("path").attr("style", b), i && t.look !== "handDrawn" && D.selectAll("path").attr("style", i), D.attr("transform", `translate(${p / 2}, 0)`), N(t, D), t.intersect = function(e) {
371
- return K.polygon(t, x, e);
372
- }, u;
373
- }
374
- n(le, "bowTieRect");
375
- async function ue(e, t, { config: { themeVariables: r } }) {
376
- let { labelStyles: i, nodeStyles: a } = _(t);
377
- t.labelStyle = i;
378
- let { shapeSvg: o, bbox: s, label: c } = await j(e, t, P(t)), l = r?.nodeBorder ?? r?.lineColor ?? "currentColor", u = t.padding ?? 12, d = Math.max(s.width + u * 2, t.width ?? 0, 80), f = Math.max(Math.min(d * .08, 12), 5), p = Math.max(s.height + u * 2 + f, t.height ?? 0), m = -p / 2 + f, h = p / 2, v = d * .72, y = [
379
- `M${-d / 2},${m}`,
380
- `L${-v / 2},${h}`,
381
- `A${v / 2},${f} 0 0 0 ${v / 2},${h}`,
382
- `L${d / 2},${m}`,
383
- `A${d / 2},${f} 0 0 0 ${-d / 2},${m}`,
384
- "Z"
385
- ].join(" "), { cssStyles: b } = t, x = o.insert("g", ":first-child").attr("class", "basic label-container");
386
- if (t.look === "handDrawn") {
387
- let e = C.svg(o).path(y, g(t, {}));
388
- x.node()?.appendChild(e), b && x.attr("style", b);
389
- } else x.append("path").attr("d", y).attr("style", a);
390
- x.append("ellipse").attr("cx", 0).attr("cy", m).attr("rx", d / 2).attr("ry", f).attr("style", `fill:none;stroke:${l};stroke-width:1px`), N(t, x);
391
- let S = m + (h - m) / 2;
392
- c.attr("transform", `translate(${-(s.width / 2) - (s.x - (s.left ?? 0))}, ${S - s.height / 2 - (s.y - (s.top ?? 0))})`);
393
- let w = /* @__PURE__ */ n((e, t, n) => Array.from({ length: 13 }, (r, i) => {
394
- let a = Math.PI - i * Math.PI / 12;
395
- return {
396
- x: e * Math.cos(a),
397
- y: t + n * f * Math.sin(a)
398
- };
399
- }), "arc"), T = [...w(d / 2, m, -1), ...w(v / 2, h, 1).reverse()];
400
- return t.intersect = function(e) {
401
- return K.polygon(t, T, e);
402
- }, o;
403
- }
404
- n(ue, "bucket");
405
- var de = 20, fe = 8, pe = 80, me = 8;
406
- async function he(e, t) {
407
- let { themeVariables: n } = u(), r = n.clusterBkg, i = n.clusterBorder, { nodeStyles: a } = _(t), { shapeSvg: s, bbox: c } = await j(e, t, P(t)), l = t.padding ?? 8, d = c.height, f = Math.max(c.width + l * 2, pe, t?.width ?? 0), p = Math.max(d + fe + de + l * 2, t?.height ?? 0), m = -f / 2, v = -p / 2, y = -(fe + de) / 2, b = s.select(".label");
408
- b && (t.useHtmlLabels ?? o(u()) ? b.attr("transform", `translate(${-c.width / 2}, ${-c.height / 2 + y})`) : b.attr("transform", `translate(0, ${-c.height / 2 + y})`));
409
- let x;
410
- if (t.look === "handDrawn") {
411
- let e = C.svg(s), n = g(t, {
412
- fill: r,
413
- stroke: i,
414
- fillStyle: "solid"
415
- }), a = e.path(z(m, v, f, p, me), n);
416
- x = s.insert(() => a, ":first-child"), x.attr("class", "basic label-container collapsed-group").attr("style", h(t.cssStyles));
417
- } else x = s.insert("rect", ":first-child"), x.attr("class", "basic label-container collapsed-group").attr("style", a).attr("rx", me).attr("ry", me).attr("x", m).attr("y", v).attr("width", f).attr("height", p).attr("fill", r).attr("stroke", i);
418
- let S = v + l + d + fe;
419
- s.append("line").attr("class", "collapsed-separator").attr("x1", m + 8).attr("y1", S).attr("x2", m + f - 8).attr("y2", S).attr("stroke", i).attr("stroke-dasharray", "3, 3");
420
- let w = S + de / 2;
421
- for (let e = -1; e <= 1; e++) s.append("circle").attr("class", "collapsed-indicator").attr("cx", e * 10).attr("cy", w).attr("r", 2.5).attr("fill", i);
422
- return N(t, x), t.calcIntersect = function(e, t) {
423
- return K.rect(e, t);
424
- }, t.intersect = function(e) {
425
- return K.rect(t, e);
426
- }, s;
427
- }
428
- n(he, "collapsedGroup");
429
- function q(e, t, n, r) {
430
- return e.insert("polygon", ":first-child").attr("points", r.map(function(e) {
431
- return e.x + "," + e.y;
432
- }).join(" ")).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + n / 2 + ")");
433
- }
434
- n(q, "insertPolygonShape");
435
- var ge = [
436
- "right",
437
- "left",
438
- "up",
439
- "down"
440
- ], _e = "point", ve = /* @__PURE__ */ n((e) => {
441
- let t = /* @__PURE__ */ new Set();
442
- for (let n of e) switch (n) {
443
- case "x":
444
- t.add("right"), t.add("left");
445
- break;
446
- case "y":
447
- t.add("up"), t.add("down");
448
- break;
449
- default: t.add(n);
450
- }
451
- return t;
452
- }, "expandAndDeduplicateDirections"), ye = /* @__PURE__ */ n((e) => ge.filter((t) => e.has(t)).join("|") || _e, "getDirectionKey"), be = {
453
- "right|left|up|down": /* @__PURE__ */ n(({ height: e, midpoint: t, padding: n, width: r }) => [
454
- {
455
- x: 0,
456
- y: 0
457
- },
458
- {
459
- x: t,
460
- y: 0
461
- },
462
- {
463
- x: r / 2,
464
- y: 2 * n
465
- },
466
- {
467
- x: r - t,
468
- y: 0
469
- },
470
- {
471
- x: r,
472
- y: 0
473
- },
474
- {
475
- x: r,
476
- y: -e / 3
477
- },
478
- {
479
- x: r + 2 * n,
480
- y: -e / 2
481
- },
482
- {
483
- x: r,
484
- y: -2 * e / 3
485
- },
486
- {
487
- x: r,
488
- y: -e
489
- },
490
- {
491
- x: r - t,
492
- y: -e
493
- },
494
- {
495
- x: r / 2,
496
- y: -e - 2 * n
497
- },
498
- {
499
- x: t,
500
- y: -e
501
- },
502
- {
503
- x: 0,
504
- y: -e
505
- },
506
- {
507
- x: 0,
508
- y: -2 * e / 3
509
- },
510
- {
511
- x: -2 * n,
512
- y: -e / 2
513
- },
514
- {
515
- x: 0,
516
- y: -e / 3
517
- }
518
- ], "right|left|up|down"),
519
- "right|left|up": /* @__PURE__ */ n(({ height: e, midpoint: t, width: n }) => [
520
- {
521
- x: t,
522
- y: 0
523
- },
524
- {
525
- x: n - t,
526
- y: 0
527
- },
528
- {
529
- x: n,
530
- y: -e / 2
531
- },
532
- {
533
- x: n - t,
534
- y: -e
535
- },
536
- {
537
- x: t,
538
- y: -e
539
- },
540
- {
541
- x: 0,
542
- y: -e / 2
543
- }
544
- ], "right|left|up"),
545
- "right|left|down": /* @__PURE__ */ n(({ height: e, midpoint: t, width: n }) => [
546
- {
547
- x: 0,
548
- y: 0
549
- },
550
- {
551
- x: t,
552
- y: -e
553
- },
554
- {
555
- x: n - t,
556
- y: -e
557
- },
558
- {
559
- x: n,
560
- y: 0
561
- }
562
- ], "right|left|down"),
563
- "right|up|down": /* @__PURE__ */ n(({ height: e, midpoint: t, width: n }) => [
564
- {
565
- x: 0,
566
- y: 0
567
- },
568
- {
569
- x: n,
570
- y: -t
571
- },
572
- {
573
- x: n,
574
- y: -e + t
575
- },
576
- {
577
- x: 0,
578
- y: -e
579
- }
580
- ], "right|up|down"),
581
- "left|up|down": /* @__PURE__ */ n(({ height: e, midpoint: t, width: n }) => [
582
- {
583
- x: n,
584
- y: 0
585
- },
586
- {
587
- x: 0,
588
- y: -t
589
- },
590
- {
591
- x: 0,
592
- y: -e + t
593
- },
594
- {
595
- x: n,
596
- y: -e
597
- }
598
- ], "left|up|down"),
599
- "right|left": /* @__PURE__ */ n(({ height: e, midpoint: t, padding: n, width: r }) => [
600
- {
601
- x: t,
602
- y: 0
603
- },
604
- {
605
- x: t,
606
- y: -n
607
- },
608
- {
609
- x: r - t,
610
- y: -n
611
- },
612
- {
613
- x: r - t,
614
- y: 0
615
- },
616
- {
617
- x: r,
618
- y: -e / 2
619
- },
620
- {
621
- x: r - t,
622
- y: -e
623
- },
624
- {
625
- x: r - t,
626
- y: -e + n
627
- },
628
- {
629
- x: t,
630
- y: -e + n
631
- },
632
- {
633
- x: t,
634
- y: -e
635
- },
636
- {
637
- x: 0,
638
- y: -e / 2
639
- }
640
- ], "right|left"),
641
- "up|down": /* @__PURE__ */ n(({ height: e, midpoint: t, padding: n, width: r }) => [
642
- {
643
- x: r / 2,
644
- y: 0
645
- },
646
- {
647
- x: 0,
648
- y: -n
649
- },
650
- {
651
- x: t,
652
- y: -n
653
- },
654
- {
655
- x: t,
656
- y: -e + n
657
- },
658
- {
659
- x: 0,
660
- y: -e + n
661
- },
662
- {
663
- x: r / 2,
664
- y: -e
665
- },
666
- {
667
- x: r,
668
- y: -e + n
669
- },
670
- {
671
- x: r - t,
672
- y: -e + n
673
- },
674
- {
675
- x: r - t,
676
- y: -n
677
- },
678
- {
679
- x: r,
680
- y: -n
681
- }
682
- ], "up|down"),
683
- "right|up": /* @__PURE__ */ n(({ height: e, midpoint: t, width: n }) => [
684
- {
685
- x: 0,
686
- y: 0
687
- },
688
- {
689
- x: n,
690
- y: -t
691
- },
692
- {
693
- x: 0,
694
- y: -e
695
- }
696
- ], "right|up"),
697
- "right|down": /* @__PURE__ */ n(({ height: e, width: t }) => [
698
- {
699
- x: 0,
700
- y: 0
701
- },
702
- {
703
- x: t,
704
- y: 0
705
- },
706
- {
707
- x: 0,
708
- y: -e
709
- }
710
- ], "right|down"),
711
- "left|up": /* @__PURE__ */ n(({ height: e, midpoint: t, width: n }) => [
712
- {
713
- x: n,
714
- y: 0
715
- },
716
- {
717
- x: 0,
718
- y: -t
719
- },
720
- {
721
- x: n,
722
- y: -e
723
- }
724
- ], "left|up"),
725
- "left|down": /* @__PURE__ */ n(({ height: e, width: t }) => [
726
- {
727
- x: t,
728
- y: 0
729
- },
730
- {
731
- x: 0,
732
- y: 0
733
- },
734
- {
735
- x: t,
736
- y: -e
737
- }
738
- ], "left|down"),
739
- right: /* @__PURE__ */ n(({ height: e, midpoint: t, padding: n, width: r }) => [
740
- {
741
- x: t,
742
- y: -n
743
- },
744
- {
745
- x: t,
746
- y: -n
747
- },
748
- {
749
- x: r - t,
750
- y: -n
751
- },
752
- {
753
- x: r - t,
754
- y: 0
755
- },
756
- {
757
- x: r,
758
- y: -e / 2
759
- },
760
- {
761
- x: r - t,
762
- y: -e
763
- },
764
- {
765
- x: r - t,
766
- y: -e + n
767
- },
768
- {
769
- x: t,
770
- y: -e + n
771
- },
772
- {
773
- x: t,
774
- y: -e + n
775
- }
776
- ], "right"),
777
- left: /* @__PURE__ */ n(({ height: e, midpoint: t, padding: n, width: r }) => [
778
- {
779
- x: t,
780
- y: 0
781
- },
782
- {
783
- x: t,
784
- y: -n
785
- },
786
- {
787
- x: r - t,
788
- y: -n
789
- },
790
- {
791
- x: r - t,
792
- y: -e + n
793
- },
794
- {
795
- x: t,
796
- y: -e + n
797
- },
798
- {
799
- x: t,
800
- y: -e
801
- },
802
- {
803
- x: 0,
804
- y: -e / 2
805
- }
806
- ], "left"),
807
- up: /* @__PURE__ */ n(({ height: e, midpoint: t, padding: n, width: r }) => [
808
- {
809
- x: t,
810
- y: -n
811
- },
812
- {
813
- x: t,
814
- y: -e + n
815
- },
816
- {
817
- x: 0,
818
- y: -e + n
819
- },
820
- {
821
- x: r / 2,
822
- y: -e
823
- },
824
- {
825
- x: r,
826
- y: -e + n
827
- },
828
- {
829
- x: r - t,
830
- y: -e + n
831
- },
832
- {
833
- x: r - t,
834
- y: -n
835
- }
836
- ], "up"),
837
- down: /* @__PURE__ */ n(({ height: e, midpoint: t, padding: n, width: r }) => [
838
- {
839
- x: r / 2,
840
- y: 0
841
- },
842
- {
843
- x: 0,
844
- y: -n
845
- },
846
- {
847
- x: t,
848
- y: -n
849
- },
850
- {
851
- x: t,
852
- y: -e + n
853
- },
854
- {
855
- x: r - t,
856
- y: -e + n
857
- },
858
- {
859
- x: r - t,
860
- y: -n
861
- },
862
- {
863
- x: r,
864
- y: -n
865
- }
866
- ], "down"),
867
- [_e]: () => [{
868
- x: 0,
869
- y: 0
870
- }]
871
- }, xe = /* @__PURE__ */ n((e, t, n, r) => {
872
- let i = ve(e), a = (n.padding ?? 0) / 2, o = t.height + 4 * a, s = o / 2, c = r ?? t.width + 2 * s + 2 * a;
873
- return (be[ye(i)] ?? be[_e])({
874
- height: o,
875
- midpoint: s,
876
- padding: a,
877
- width: c
878
- });
879
- }, "getArrowPoints");
880
- async function Se(e, t) {
881
- let n = t, { shapeSvg: r, bbox: i } = await j(e, n, P(n)), a = n.padding ?? 0, o = i.height + 2 * a, s = o / 2, c = i.width + 2 * s + a, l = n.width ?? 0, u = n.positioned && (n.widthInColumns ?? 1) > 1 && l > c ? l : c, d = xe(n.directions ?? [], i, n, u), f = q(r, u, o, d);
882
- return f.attr("style", n.style ?? null), N(n, f), n.intersect = function(e) {
883
- return K.polygon(n, d, e);
884
- }, r;
885
- }
886
- n(Se, "block_arrow");
887
- async function Ce(e, t, { config: { themeVariables: n } }) {
888
- let { labelStyles: r, nodeStyles: i } = _(t);
889
- t.labelStyle = r;
890
- let { shapeSvg: a, bbox: o, label: s } = await j(e, t, P(t)), c = n?.nodeBorder ?? n?.lineColor ?? "currentColor", l = t.padding ?? 12, u = Math.max(o.width + l * 2, t.width ?? 0, 90), d = Math.max(o.height + l * 2 + 18, t.height ?? 0), f = -d / 2, { cssStyles: p } = t, m = a.insert("g", ":first-child").attr("class", "basic label-container");
891
- if (t.look === "handDrawn") {
892
- let e = C.svg(a).path(z(-u / 2, f, u, d, 12), g(t, {}));
893
- m.node()?.appendChild(e), p && m.attr("style", p);
894
- } else m.append("rect").attr("x", -u / 2).attr("y", f).attr("width", u).attr("height", d).attr("rx", 12).attr("ry", 12).attr("style", i);
895
- m.append("line").attr("x1", -u / 2).attr("y1", f + 18).attr("x2", u / 2).attr("y2", f + 18).attr("style", `stroke:${c};stroke-width:1px`);
896
- for (let e = 0; e < 3; e++) m.append("circle").attr("cx", -u / 2 + 12 + e * 9).attr("cy", f + 9).attr("r", 2.5).attr("style", `fill:${c};stroke:none`);
897
- m.append("rect").attr("class", "browser-address-bar").attr("x", -u / 2 + 44).attr("y", f + 4).attr("width", Math.max(u - 56, 10)).attr("height", 10).attr("rx", 3).attr("ry", 3).attr("style", `fill:none;stroke:${c};stroke-width:1px;opacity:0.6`), N(t, m);
898
- let h = f + 18 + (d - 18) / 2;
899
- return s.attr("transform", `translate(${-(o.width / 2) - (o.x - (o.left ?? 0))}, ${h - o.height / 2 - (o.y - (o.top ?? 0))})`), t.intersect = function(e) {
900
- return K.rect(t, e);
901
- }, a;
902
- }
903
- n(Ce, "browser");
904
- var we = 12;
905
- async function Te(e, t) {
906
- let { labelStyles: n, nodeStyles: r } = _(t);
907
- t.labelStyle = n;
908
- let i = t.padding ?? 0, a = t.look === "neo" ? 28 : i, o = t.look === "neo" ? 24 : i, { shapeSvg: s, bbox: c } = await j(e, t, P(t)), l = (t?.width ?? c.width) + (t.look === "neo" ? a * 2 : a + we), u = (t?.height ?? c.height) + (t.look === "neo" ? o * 2 : o), d = l, f = -u, p = [
909
- {
910
- x: 0 + we,
911
- y: f
912
- },
913
- {
914
- x: d,
915
- y: f
916
- },
917
- {
918
- x: d,
919
- y: 0
920
- },
921
- {
922
- x: 0,
923
- y: 0
924
- },
925
- {
926
- x: 0,
927
- y: f + we
928
- },
929
- {
930
- x: 0 + we,
931
- y: f
932
- }
933
- ], m, { cssStyles: h } = t;
934
- if (t.look === "handDrawn") {
935
- let e = C.svg(s), n = g(t, {}), r = F(p), i = e.path(r, n);
936
- m = s.insert(() => i, ":first-child").attr("transform", `translate(${-l / 2}, ${u / 2})`), h && m.attr("style", h);
937
- } else m = q(s, l, u, p);
938
- return r && m.attr("style", r), N(t, m), t.intersect = function(e) {
939
- return K.polygon(t, p, e);
940
- }, s;
941
- }
942
- n(Te, "card");
943
- function Ee(e, t) {
944
- let { nodeStyles: n } = _(t);
945
- t.label = "";
946
- let r = e.insert("g").attr("class", P(t)).attr("id", t.domId ?? t.id), { cssStyles: i } = t, a = Math.max(28, t.width ?? 0), o = [
947
- {
948
- x: 0,
949
- y: a / 2
950
- },
951
- {
952
- x: a / 2,
953
- y: 0
954
- },
955
- {
956
- x: 0,
957
- y: -a / 2
958
- },
959
- {
960
- x: -a / 2,
961
- y: 0
962
- }
963
- ], s = C.svg(r), c = g(t, {});
964
- t.look !== "handDrawn" && (c.roughness = 0, c.fillStyle = "solid");
965
- let l = F(o), u = s.path(l, c), d = r.insert(() => u, ":first-child");
966
- return i && t.look !== "handDrawn" && d.selectAll("path").attr("style", i), n && t.look !== "handDrawn" && d.selectAll("path").attr("style", n), t.width = 28, t.height = 28, t.intersect = function(e) {
967
- return K.polygon(t, o, e);
968
- }, r;
969
- }
970
- n(Ee, "choice");
971
- async function De(t, n, r) {
972
- let { labelStyles: i, nodeStyles: a } = _(n);
973
- n.labelStyle = i;
974
- let { shapeSvg: o, bbox: s, halfPadding: c } = await j(t, n, P(n)), l = r?.padding ?? c, u = n.look === "neo" ? s.width / 2 + 32 : s.width / 2 + l, d, { cssStyles: f } = n;
975
- if (n.look === "handDrawn") {
976
- let e = C.svg(o), t = g(n, {}), r = e.circle(0, 0, u * 2, t);
977
- d = o.insert(() => r, ":first-child"), d.attr("class", "basic label-container").attr("style", h(f));
978
- } else d = o.insert("circle", ":first-child").attr("class", "basic label-container").attr("style", a).attr("r", u).attr("cx", 0).attr("cy", 0);
979
- return N(n, d), n.calcIntersect = function(e, t) {
980
- let n = e.width / 2;
981
- return K.circle(e, n, t);
982
- }, n.intersect = function(t) {
983
- return e.info("Circle intersect", n, u, t), K.circle(n, u, t);
984
- }, o;
985
- }
986
- n(De, "circle");
987
- async function Oe(e, t) {
988
- let n = t, { shapeSvg: r, bbox: i, halfPadding: a } = await j(e, n, [
989
- "node",
990
- n.cssClasses,
991
- n.class
992
- ].filter(Boolean).join(" ")), o = r.insert("rect", ":first-child"), s = n.padding ?? 0, c = n.positioned ? n.width ?? 0 : i.width + s, l = n.positioned ? n.height ?? 0 : i.height + s, u = n.positioned ? -c / 2 : -i.width / 2 - a, d = n.positioned ? -l / 2 : -i.height / 2 - a;
993
- return o.attr("class", "basic cluster composite label-container").attr("style", n.style ?? null).attr("rx", n.rx ?? null).attr("ry", n.ry ?? null).attr("x", u).attr("y", d).attr("width", c).attr("height", l), N(n, o), n.intersect = function(e) {
994
- return K.rect(n, e);
995
- }, r;
996
- }
997
- n(Oe, "composite");
998
- async function ke(e, t, { config: { themeVariables: n } }) {
999
- let { labelStyles: r, nodeStyles: i } = _(t);
1000
- t.labelStyle = r;
1001
- let { shapeSvg: a, bbox: o, label: s } = await j(e, t, P(t)), c = n?.nodeBorder ?? n?.lineColor ?? "currentColor", l = t.padding ?? 12, u = Math.max(o.width + l * 2, t.width ?? 0, 90), d = Math.max(o.height + l * 2 + 20, t.height ?? 0), f = -d / 2, { cssStyles: p } = t, m = a.insert("g", ":first-child").attr("class", "basic label-container");
1002
- if (t.look === "handDrawn") {
1003
- let e = C.svg(a).path(z(-u / 2, f, u, d, 12), g(t, {}));
1004
- m.node()?.appendChild(e), p && m.attr("style", p);
1005
- } else m.append("rect").attr("x", -u / 2).attr("y", f).attr("width", u).attr("height", d).attr("rx", 12).attr("ry", 12).attr("style", i);
1006
- m.append("text").attr("x", -u / 2 + 12).attr("y", f + 16).attr("class", "console-glyph").attr("style", `font-family:monospace;font-weight:bold;font-size:14px;fill:${c}`).text(">_"), N(t, m);
1007
- let h = f + 20 + (d - 20) / 2;
1008
- return s.attr("transform", `translate(${-(o.width / 2) - (o.x - (o.left ?? 0))}, ${h - o.height / 2 - (o.y - (o.top ?? 0))})`), t.intersect = function(e) {
1009
- return K.rect(t, e);
1010
- }, a;
1011
- }
1012
- n(ke, "consoleWindow");
1013
- function Ae(e) {
1014
- let t = Math.cos(Math.PI / 4), n = Math.sin(Math.PI / 4), r = e * 2, i = {
1015
- x: r / 2 * t,
1016
- y: r / 2 * n
1017
- }, a = {
1018
- x: -(r / 2) * t,
1019
- y: r / 2 * n
1020
- }, o = {
1021
- x: -(r / 2) * t,
1022
- y: -(r / 2) * n
1023
- }, s = {
1024
- x: r / 2 * t,
1025
- y: -(r / 2) * n
1026
- };
1027
- return `M ${a.x},${a.y} L ${s.x},${s.y}
1028
- M ${i.x},${i.y} L ${o.x},${o.y}`;
1029
- }
1030
- n(Ae, "createLine");
1031
- function je(t, n) {
1032
- let { labelStyles: r, nodeStyles: i } = _(n);
1033
- n.labelStyle = r, n.label = "";
1034
- let a = t.insert("g").attr("class", P(n)).attr("id", n.domId ?? n.id), o = Math.max(30, n?.width ?? 0), { cssStyles: s } = n, c = C.svg(a), l = g(n, {});
1035
- n.look !== "handDrawn" && (l.roughness = 0, l.fillStyle = "solid");
1036
- let u = c.circle(0, 0, o * 2, l), d = Ae(o), f = c.path(d, l), p = a.insert(() => u, ":first-child");
1037
- return p.insert(() => f), p.attr("class", "outer-path"), s && n.look !== "handDrawn" && p.selectAll("path").attr("style", s), i && n.look !== "handDrawn" && p.selectAll("path").attr("style", i), N(n, p), n.intersect = function(t) {
1038
- return e.info("crossedCircle intersect", n, {
1039
- radius: o,
1040
- point: t
1041
- }), K.circle(n, o, t);
1042
- }, a;
1043
- }
1044
- n(je, "crossedCircle");
1045
- function J(e, t, n, r = 100, i = 0, a = 180) {
1046
- let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
1047
- for (let i = 0; i < r; i++) {
1048
- let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
1049
- o.push({
1050
- x: -a,
1051
- y: -l
1052
- });
1053
- }
1054
- return o;
1055
- }
1056
- n(J, "generateCirclePoints");
1057
- async function Me(e, t) {
1058
- let { labelStyles: n, nodeStyles: r } = _(t);
1059
- t.labelStyle = n;
1060
- let { shapeSvg: i, bbox: a, label: o } = await j(e, t, P(t)), s = t.look === "neo" ? 18 : t.padding ?? 0, c = t.look === "neo" ? 12 : t.padding ?? 0, l = a.width + s, u = a.height + c, d = Math.max(5, u * .1), { cssStyles: f } = t, p = [
1061
- ...J(l / 2, -u / 2, d, 30, -90, 0),
1062
- {
1063
- x: -l / 2 - d,
1064
- y: d
1065
- },
1066
- ...J(l / 2 + d * 2, -d, d, 20, -180, -270),
1067
- ...J(l / 2 + d * 2, d, d, 20, -90, -180),
1068
- {
1069
- x: -l / 2 - d,
1070
- y: -u / 2
1071
- },
1072
- ...J(l / 2, u / 2, d, 20, 0, 90)
1073
- ], m = [
1074
- {
1075
- x: l / 2,
1076
- y: -u / 2 - d
1077
- },
1078
- {
1079
- x: -l / 2,
1080
- y: -u / 2 - d
1081
- },
1082
- ...J(l / 2, -u / 2, d, 20, -90, 0),
1083
- {
1084
- x: -l / 2 - d,
1085
- y: -d
1086
- },
1087
- ...J(l / 2 + l * .1, -d, d, 20, -180, -270),
1088
- ...J(l / 2 + l * .1, d, d, 20, -90, -180),
1089
- {
1090
- x: -l / 2 - d,
1091
- y: u / 2
1092
- },
1093
- ...J(l / 2, u / 2, d, 20, 0, 90),
1094
- {
1095
- x: -l / 2,
1096
- y: u / 2 + d
1097
- },
1098
- {
1099
- x: l / 2,
1100
- y: u / 2 + d
1101
- }
1102
- ], h = C.svg(i), v = g(t, { fill: "none" });
1103
- t.look !== "handDrawn" && (v.roughness = 0, v.fillStyle = "solid");
1104
- let y = F(p).replace("Z", ""), b = h.path(y, v), x = F(m), S = h.path(x, { ...v }), w = i.insert("g", ":first-child");
1105
- return w.insert(() => S, ":first-child").attr("stroke-opacity", 0), w.insert(() => b, ":first-child"), w.attr("class", "text"), f && t.look !== "handDrawn" && w.selectAll("path").attr("style", f), r && t.look !== "handDrawn" && w.selectAll("path").attr("style", r), w.attr("transform", `translate(${d}, 0)`), o.attr("transform", `translate(${-l / 2 + d - (a.x - (a.left ?? 0))},${-u / 2 + (t.padding ?? 0) / 2 - (a.y - (a.top ?? 0))})`), N(t, w), t.intersect = function(e) {
1106
- return K.polygon(t, m, e);
1107
- }, i;
1108
- }
1109
- n(Me, "curlyBraceLeft");
1110
- function Y(e, t, n, r = 100, i = 0, a = 180) {
1111
- let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
1112
- for (let i = 0; i < r; i++) {
1113
- let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
1114
- o.push({
1115
- x: a,
1116
- y: l
1117
- });
1118
- }
1119
- return o;
1120
- }
1121
- n(Y, "generateCirclePoints");
1122
- async function Ne(e, t) {
1123
- let { labelStyles: n, nodeStyles: r } = _(t);
1124
- t.labelStyle = n;
1125
- let { shapeSvg: i, bbox: a, label: o } = await j(e, t, P(t)), s = t.look === "neo" ? 18 : t.padding ?? 0, c = t.look === "neo" ? 12 : t.padding ?? 0, l = a.width + (t.look === "neo" ? s * 2 : s), u = a.height + (t.look === "neo" ? c * 2 : c), d = Math.max(5, u * .1), { cssStyles: f } = t, p = [
1126
- ...Y(l / 2, -u / 2, d, 20, -90, 0),
1127
- {
1128
- x: l / 2 + d,
1129
- y: -d
1130
- },
1131
- ...Y(l / 2 + d * 2, -d, d, 20, -180, -270),
1132
- ...Y(l / 2 + d * 2, d, d, 20, -90, -180),
1133
- {
1134
- x: l / 2 + d,
1135
- y: u / 2
1136
- },
1137
- ...Y(l / 2, u / 2, d, 20, 0, 90)
1138
- ], m = [
1139
- {
1140
- x: -l / 2,
1141
- y: -u / 2 - d
1142
- },
1143
- {
1144
- x: l / 2,
1145
- y: -u / 2 - d
1146
- },
1147
- ...Y(l / 2, -u / 2, d, 20, -90, 0),
1148
- {
1149
- x: l / 2 + d,
1150
- y: -d
1151
- },
1152
- ...Y(l / 2 + d * 2, -d, d, 20, -180, -270),
1153
- ...Y(l / 2 + d * 2, d, d, 20, -90, -180),
1154
- {
1155
- x: l / 2 + d,
1156
- y: u / 2
1157
- },
1158
- ...Y(l / 2, u / 2, d, 20, 0, 90),
1159
- {
1160
- x: l / 2,
1161
- y: u / 2 + d
1162
- },
1163
- {
1164
- x: -l / 2,
1165
- y: u / 2 + d
1166
- }
1167
- ], h = C.svg(i), v = g(t, { fill: "none" });
1168
- t.look !== "handDrawn" && (v.roughness = 0, v.fillStyle = "solid");
1169
- let y = F(p).replace("Z", ""), b = h.path(y, v), x = F(m), S = h.path(x, { ...v }), w = i.insert("g", ":first-child");
1170
- return w.insert(() => S, ":first-child").attr("stroke-opacity", 0), w.insert(() => b, ":first-child"), w.attr("class", "text"), f && t.look !== "handDrawn" && w.selectAll("path").attr("style", f), r && t.look !== "handDrawn" && w.selectAll("path").attr("style", r), w.attr("transform", `translate(${-d}, 0)`), o.attr("transform", `translate(${-l / 2 + (t.padding ?? 0) / 2 - (a.x - (a.left ?? 0))},${-u / 2 + (t.padding ?? 0) / 2 - (a.y - (a.top ?? 0))})`), N(t, w), t.intersect = function(e) {
1171
- return K.polygon(t, m, e);
1172
- }, i;
1173
- }
1174
- n(Ne, "curlyBraceRight");
1175
- function X(e, t, n, r = 100, i = 0, a = 180) {
1176
- let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
1177
- for (let i = 0; i < r; i++) {
1178
- let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
1179
- o.push({
1180
- x: -a,
1181
- y: -l
1182
- });
1183
- }
1184
- return o;
1185
- }
1186
- n(X, "generateCirclePoints");
1187
- async function Pe(e, t) {
1188
- let { labelStyles: n, nodeStyles: r } = _(t);
1189
- t.labelStyle = n;
1190
- let { shapeSvg: i, bbox: a, label: o } = await j(e, t, P(t)), s = t.look === "neo" ? 18 : t.padding ?? 0, c = t.look === "neo" ? 12 : t.padding ?? 0, l = a.width + (t.look === "neo" ? s * 2 : s), u = a.height + (t.look === "neo" ? c * 2 : c), d = Math.max(5, u * .1), { cssStyles: f } = t, p = [
1191
- ...X(l / 2, -u / 2, d, 30, -90, 0),
1192
- {
1193
- x: -l / 2 - d,
1194
- y: d
1195
- },
1196
- ...X(l / 2 + d * 2, -d, d, 20, -180, -270),
1197
- ...X(l / 2 + d * 2, d, d, 20, -90, -180),
1198
- {
1199
- x: -l / 2 - d,
1200
- y: -u / 2
1201
- },
1202
- ...X(l / 2, u / 2, d, 20, 0, 90)
1203
- ], m = [
1204
- ...X(-l / 2 + d + d / 2, -u / 2, d, 20, -90, -180),
1205
- {
1206
- x: l / 2 - d / 2,
1207
- y: d
1208
- },
1209
- ...X(-l / 2 - d / 2, -d, d, 20, 0, 90),
1210
- ...X(-l / 2 - d / 2, d, d, 20, -90, 0),
1211
- {
1212
- x: l / 2 - d / 2,
1213
- y: -d
1214
- },
1215
- ...X(-l / 2 + d + d / 2, u / 2, d, 30, -180, -270)
1216
- ], h = [
1217
- {
1218
- x: l / 2,
1219
- y: -u / 2 - d
1220
- },
1221
- {
1222
- x: -l / 2,
1223
- y: -u / 2 - d
1224
- },
1225
- ...X(l / 2, -u / 2, d, 20, -90, 0),
1226
- {
1227
- x: -l / 2 - d,
1228
- y: -d
1229
- },
1230
- ...X(l / 2 + d * 2, -d, d, 20, -180, -270),
1231
- ...X(l / 2 + d * 2, d, d, 20, -90, -180),
1232
- {
1233
- x: -l / 2 - d,
1234
- y: u / 2
1235
- },
1236
- ...X(l / 2, u / 2, d, 20, 0, 90),
1237
- {
1238
- x: -l / 2,
1239
- y: u / 2 + d
1240
- },
1241
- {
1242
- x: l / 2 - d - d / 2,
1243
- y: u / 2 + d
1244
- },
1245
- ...X(-l / 2 + d + d / 2, -u / 2, d, 20, -90, -180),
1246
- {
1247
- x: l / 2 - d / 2,
1248
- y: d
1249
- },
1250
- ...X(-l / 2 - d / 2, -d, d, 20, 0, 90),
1251
- ...X(-l / 2 - d / 2, d, d, 20, -90, 0),
1252
- {
1253
- x: l / 2 - d / 2,
1254
- y: -d
1255
- },
1256
- ...X(-l / 2 + d + d / 2, u / 2, d, 30, -180, -270)
1257
- ], v = C.svg(i), y = g(t, { fill: "none" });
1258
- t.look !== "handDrawn" && (y.roughness = 0, y.fillStyle = "solid");
1259
- let b = F(p).replace("Z", ""), x = v.path(b, y), S = F(m).replace("Z", ""), w = v.path(S, y), T = F(h), E = v.path(T, { ...y }), D = i.insert("g", ":first-child");
1260
- return D.insert(() => E, ":first-child").attr("stroke-opacity", 0), D.insert(() => x, ":first-child"), D.insert(() => w, ":first-child"), D.attr("class", "text"), f && t.look !== "handDrawn" && D.selectAll("path").attr("style", f), r && t.look !== "handDrawn" && D.selectAll("path").attr("style", r), D.attr("transform", `translate(${d - d / 4}, 0)`), o.attr("transform", `translate(${-l / 2 + (t.padding ?? 0) / 2 - (a.x - (a.left ?? 0))},${-u / 2 + (t.padding ?? 0) / 2 - (a.y - (a.top ?? 0))})`), N(t, D), t.intersect = function(e) {
1261
- return K.polygon(t, h, e);
1262
- }, i;
1263
- }
1264
- n(Pe, "curlyBraces");
1265
- async function Fe(e, t) {
1266
- let { labelStyles: n, nodeStyles: r } = _(t);
1267
- t.labelStyle = n;
1268
- let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i, { shapeSvg: s, bbox: c } = await j(e, t, P(t)), l = Math.max(20, (c.width + a * 2) * 1.25, t?.width ?? 0), u = Math.max(5, c.height + o * 2, t?.height ?? 0), d = u / 2, { cssStyles: f } = t, p = C.svg(s), m = g(t, {});
1269
- t.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
1270
- let h = l, v = u, y = h - d, b = v / 4, x = [
1271
- {
1272
- x: y,
1273
- y: 0
1274
- },
1275
- {
1276
- x: b,
1277
- y: 0
1278
- },
1279
- {
1280
- x: 0,
1281
- y: v / 2
1282
- },
1283
- {
1284
- x: b,
1285
- y: v
1286
- },
1287
- {
1288
- x: y,
1289
- y: v
1290
- },
1291
- ...L(-y, -v / 2, d, 50, 270, 90)
1292
- ], S = F(x), w = p.path(S, m), T = s.insert(() => w, ":first-child");
1293
- return T.attr("class", "basic label-container outer-path"), f && t.look !== "handDrawn" && T.selectChildren("path").attr("style", f), r && t.look !== "handDrawn" && T.selectChildren("path").attr("style", r), T.attr("transform", `translate(${-l / 2}, ${-u / 2})`), N(t, T), t.intersect = function(e) {
1294
- return K.polygon(t, x, e);
1295
- }, s;
1296
- }
1297
- n(Fe, "curvedTrapezoid");
1298
- async function Ie(e, t) {
1299
- let { labelStyles: n, nodeStyles: r } = _(t);
1300
- t.labelStyle = n;
1301
- let { shapeSvg: i, bbox: a, label: o } = await j(e, t, P(t)), s = t.padding ?? 20, c = Math.max(a.width + s * 2, t.width ?? 0, 100), l = Math.min(Math.max(c * .23, 16), 56), u = l * .27, d = Math.max(a.height + s * 2, t.height ? t.height - (2 * l - u) : 0), f = Math.min(c * .177, d * .45), p = d + 2 * l - u, m = -p / 2, h = m + 2 * l - u, v = i.insert("g", ":first-child").attr("class", "basic label-container"), { cssStyles: y } = t;
1302
- if (t.look === "handDrawn") {
1303
- let e = C.svg(i), n = g(t, {}), r = e.path(z(-c / 2, h, c, d, f), n), a = e.circle(0, m + l, l * 2, n);
1304
- v.insert(() => a, ":first-child"), v.insert(() => r, ":first-child"), y && v.attr("style", y);
1305
- } else v.append("rect").attr("x", -c / 2).attr("y", h).attr("width", c).attr("height", d).attr("rx", f).attr("ry", f).attr("style", r), v.append("circle").attr("cx", 0).attr("cy", m + l).attr("r", l).attr("style", r);
1306
- N(t, v);
1307
- let b = h + d / 2;
1308
- o.attr("transform", `translate(${-(a.width / 2) - (a.x - (a.left ?? 0))}, ${b - a.height / 2 - (a.y - (a.top ?? 0))})`);
1309
- let x = m + l, S = Math.asin(Math.min(1, (h - x) / l)) * 180 / Math.PI, w = [
1310
- ...L(0, -x, l, 24, 180 + S, -S),
1311
- ...L(-(-c / 2 + f), -(h + f), f, 12, 90, 0),
1312
- ...L(-(-c / 2 + f), -(p / 2 - f), f, 12, 360, 270),
1313
- ...L(-(c / 2 - f), -(p / 2 - f), f, 12, 270, 180),
1314
- ...L(-(c / 2 - f), -(h + f), f, 12, 180, 90)
1315
- ];
1316
- return t.intersect = function(e) {
1317
- return K.polygon(t, w, e);
1318
- }, i;
1319
- }
1320
- n(Ie, "person");
1321
- var Le = /* @__PURE__ */ n((e, t, n, r, i, a) => [
1322
- `M${e},${t + a}`,
1323
- `a${i},${a} 0,0,0 ${n},0`,
1324
- `a${i},${a} 0,0,0 ${-n},0`,
1325
- `l0,${r}`,
1326
- `a${i},${a} 0,0,0 ${n},0`,
1327
- `l0,${-r}`
1328
- ].join(" "), "createCylinderPathD"), Re = /* @__PURE__ */ n((e, t, n, r, i, a) => [
1329
- `M${e},${t + a}`,
1330
- `M${e + n},${t + a}`,
1331
- `a${i},${a} 0,0,0 ${-n},0`,
1332
- `l0,${r}`,
1333
- `a${i},${a} 0,0,0 ${n},0`,
1334
- `l0,${-r}`
1335
- ].join(" "), "createOuterCylinderPathD"), ze = /* @__PURE__ */ n((e, t, n, r, i, a) => [`M${e - n / 2},${-r / 2}`, `a${i},${a} 0,0,0 ${n},0`].join(" "), "createInnerCylinderPathD"), Be = 8, Ve = 8;
1336
- async function He(e, t) {
1337
- let { labelStyles: n, nodeStyles: r } = _(t);
1338
- t.labelStyle = n;
1339
- let i = t.padding ?? 0, a = t.look === "neo" ? 24 : i, o = t.look === "neo" ? 24 : i, s = t.width ?? 0;
1340
- if (t.width && (t.width -= o, t.width < Ve && (t.width = Ve)), t.height) {
1341
- let e = s / 2 / (2.5 + s / 50);
1342
- t.height = t.height - a - e * 3, t.height < Be && (t.height = Be);
1343
- }
1344
- let { shapeSvg: c, bbox: l, label: u } = await j(e, t, P(t)), d = Math.max(t.width ?? 0, l.width) + o, f = d / 2, p = f / (2.5 + d / 50), m = Math.max(t.height ?? 0, l.height) + a + p, v, { cssStyles: y } = t;
1345
- if (t.look === "handDrawn") {
1346
- let e = C.svg(c), n = Re(0, 0, d, m, f, p), r = ze(0, p, d, m, f, p), i = g(t, {}), a = e.path(n, i), o = e.path(r, g(t, { fill: "none" }));
1347
- v = c.insert(() => o, ":first-child"), v = c.insert(() => a, ":first-child"), v.attr("class", "basic label-container"), y && v.attr("style", y);
1348
- } else {
1349
- let e = Le(0, 0, d, m, f, p);
1350
- v = c.insert("path", ":first-child").attr("d", e).attr("class", "basic label-container outer-path").attr("style", h(y)).attr("style", r);
1351
- }
1352
- return v.attr("label-offset-y", p), v.attr("transform", `translate(${-d / 2}, ${-(m / 2 + p)})`), N(t, v), u.attr("transform", `translate(${-(l.width / 2) - (l.x - (l.left ?? 0))}, ${-(l.height / 2) + (t.padding ?? 0) / 1.5 - (l.y - (l.top ?? 0))})`), t.intersect = function(e) {
1353
- let n = K.rect(t, e), r = n.x - (t.x ?? 0);
1354
- if (f != 0 && (Math.abs(r) < (t.width ?? 0) / 2 || Math.abs(r) == (t.width ?? 0) / 2 && Math.abs(n.y - (t.y ?? 0)) > (t.height ?? 0) / 2 - p)) {
1355
- let i = p * p * (1 - r * r / (f * f));
1356
- i > 0 && (i = Math.sqrt(i)), i = p - i, e.y - (t.y ?? 0) > 0 && (i = -i), n.y += i;
1357
- }
1358
- return n;
1359
- }, c;
1360
- }
1361
- n(He, "cylinder");
1362
- async function Ue(e, t, n) {
1363
- let { labelStyles: r, nodeStyles: i } = _(t);
1364
- t.labelStyle = r;
1365
- let { shapeSvg: a, bbox: o } = await j(e, t, P(t)), s = Math.max(o.width + n.labelPaddingX * 2, t?.width || 0), c = Math.max(o.height + n.labelPaddingY * 2, t?.height || 0), l = -s / 2, u = -c / 2, d, { rx: f, ry: p } = t, { cssStyles: m } = t;
1366
- if (n?.rx && n.ry && (f = n.rx, p = n.ry), t.look === "handDrawn") {
1367
- let e = C.svg(a), n = g(t, {}), r = f || p ? e.path(z(l, u, s, c, f || 0), n) : e.rectangle(l, u, s, c, n);
1368
- d = a.insert(() => r, ":first-child"), d.attr("class", "basic label-container").attr("style", h(m));
1369
- } else d = a.insert("rect", ":first-child"), d.attr("class", "basic label-container").attr("style", i).attr("rx", h(f)).attr("ry", h(p)).attr("x", l).attr("y", u).attr("width", s).attr("height", c);
1370
- return N(t, d, t.look === "handDrawn" ? void 0 : {
1371
- width: s,
1372
- height: c
1373
- }), t.calcIntersect = function(e, t) {
1374
- return K.rect(e, t);
1375
- }, t.intersect = function(e) {
1376
- return K.rect(t, e);
1377
- }, a;
1378
- }
1379
- n(Ue, "drawRect");
1380
- async function We(e, t) {
1381
- let { cssClasses: n, labelPaddingX: r, labelPaddingY: i, padding: a, width: o, height: s } = t, c = await Ue(e, t, {
1382
- rx: 0,
1383
- ry: 0,
1384
- classes: n ?? "",
1385
- labelPaddingX: r ?? (a ?? 0) * 2,
1386
- labelPaddingY: i ?? a ?? 0
1387
- });
1388
- if (t.look === "handDrawn") {
1389
- let e = C.svg(c), n = g(t, {}), r = c.select(".basic.label-container > path:nth-child(2)"), i = r.node();
1390
- if (!i) return c;
1391
- let a = null;
1392
- if (i instanceof SVGGraphicsElement) a = i.getBBox();
1393
- else return c;
1394
- return c.insert(() => e.line(a.x, a.y, a.x + a.width, a.y, n), ".basic.label-container g.label"), c.insert(() => e.line(a.x, a.y + a.height, a.x + a.width, a.y + a.height, n), ".basic.label-container g.label"), r.remove(), c;
1395
- }
1396
- let l = c.select(".basic.label-container"), u = (Number(l.attr("width")) || o) ?? 0, d = (Number(l.attr("height")) || s) ?? 0;
1397
- return u > 0 && d > 0 && l.attr("stroke-dasharray", `${u} ${d}`), c;
1398
- }
1399
- n(We, "datastore");
1400
- async function Ge(e, t) {
1401
- let { labelStyles: n, nodeStyles: r } = _(t);
1402
- t.labelStyle = n;
1403
- let i = t.look === "neo" ? 16 : t.padding ?? 0, a = t.look === "neo" ? 16 : t.padding ?? 0, { shapeSvg: o, bbox: s, label: c } = await j(e, t, P(t)), l = s.width + i, u = s.height + a, d = u * .2, f = -l / 2, p = -u / 2 - d / 2, { cssStyles: m } = t, h = C.svg(o), v = g(t, {});
1404
- t.look !== "handDrawn" && (v.roughness = 0, v.fillStyle = "solid");
1405
- let y = [
1406
- {
1407
- x: f,
1408
- y: p + d
1409
- },
1410
- {
1411
- x: -f,
1412
- y: p + d
1413
- },
1414
- {
1415
- x: -f,
1416
- y: -p
1417
- },
1418
- {
1419
- x: f,
1420
- y: -p
1421
- },
1422
- {
1423
- x: f,
1424
- y: p
1425
- },
1426
- {
1427
- x: -f,
1428
- y: p
1429
- },
1430
- {
1431
- x: -f,
1432
- y: p + d
1433
- }
1434
- ], b = h.polygon(y.map((e) => [e.x, e.y]), v), x = o.insert(() => b, ":first-child");
1435
- return x.attr("class", "basic label-container outer-path"), m && t.look !== "handDrawn" && x.selectAll("path").attr("style", m), r && t.look !== "handDrawn" && x.selectAll("path").attr("style", r), c.attr("transform", `translate(${f + (t.padding ?? 0) / 2 - (s.x - (s.left ?? 0))}, ${p + d + (t.padding ?? 0) / 2 - (s.y - (s.top ?? 0))})`), N(t, x), t.intersect = function(e) {
1436
- return K.rect(t, e);
1437
- }, o;
1438
- }
1439
- n(Ge, "dividedRectangle");
1440
- async function Ke(t, n) {
1441
- let { labelStyles: r, nodeStyles: i } = _(n), a = n.look === "neo" ? 12 : 5;
1442
- n.labelStyle = r;
1443
- let o = n.padding ?? 0, s = n.look === "neo" ? 16 : o, { shapeSvg: c, bbox: l } = await j(t, n, P(n)), u = (n?.width ? n?.width / 2 : l.width / 2) + (s ?? 0), d = u - a, f, { cssStyles: p } = n;
1444
- if (n.look === "handDrawn") {
1445
- let e = C.svg(c), t = g(n, {
1446
- roughness: .2,
1447
- strokeWidth: 2.5
1448
- }), r = g(n, {
1449
- roughness: .2,
1450
- strokeWidth: 1.5
1451
- }), i = e.circle(0, 0, u * 2, t), a = e.circle(0, 0, d * 2, r);
1452
- f = c.insert("g", ":first-child"), f.attr("class", h(n.cssClasses)).attr("style", h(p)), f.node()?.appendChild(i), f.node()?.appendChild(a);
1453
- } else {
1454
- f = c.insert("g", ":first-child");
1455
- let e = f.insert("circle", ":first-child"), t = f.insert("circle");
1456
- f.attr("class", "basic label-container").attr("style", i), e.attr("class", "outer-circle").attr("style", i).attr("r", u).attr("cx", 0).attr("cy", 0), t.attr("class", "inner-circle").attr("style", i).attr("r", d).attr("cx", 0).attr("cy", 0);
1457
- }
1458
- return N(n, f), n.intersect = function(t) {
1459
- return e.info("DoubleCircle intersect", n, u, t), K.circle(n, u, t);
1460
- }, c;
1461
- }
1462
- n(Ke, "doublecircle");
1463
- function qe(t, n, { config: { themeVariables: r } }) {
1464
- let { labelStyles: i, nodeStyles: a } = _(n);
1465
- n.label = "", n.labelStyle = i;
1466
- let o = t.insert("g").attr("class", P(n)).attr("id", n.domId ?? n.id), { cssStyles: s } = n, c = C.svg(o), { nodeBorder: l } = r, u = g(n, { fillStyle: "solid" });
1467
- n.look !== "handDrawn" && (u.roughness = 0);
1468
- let d = c.circle(0, 0, 14, u), f = o.insert(() => d, ":first-child");
1469
- return f.selectAll("path").attr("style", `fill: ${l} !important;`), s && s.length > 0 && n.look !== "handDrawn" && f.selectAll("path").attr("style", s), a && n.look !== "handDrawn" && f.selectAll("path").attr("style", a), N(n, f), n.intersect = function(t) {
1470
- return e.info("filledCircle intersect", n, {
1471
- radius: 7,
1472
- point: t
1473
- }), K.circle(n, 7, t);
1474
- }, o;
1475
- }
1476
- n(qe, "filledCircle");
1477
- var Je = 10, Ye = 10;
1478
- async function Xe(t, n) {
1479
- let { labelStyles: r, nodeStyles: i } = _(n);
1480
- n.labelStyle = r;
1481
- let a = n.padding ?? 0, o = n.look === "neo" ? a * 2 : a;
1482
- (n.width || n.height) && (n.height = n?.height ?? 0, n.height < Je && (n.height = Je), n.width = (n?.width ?? 0) - o - o / 2, n.width < Ye && (n.width = Ye));
1483
- let { shapeSvg: s, bbox: c, label: l } = await j(t, n, P(n)), u = (n?.width ? n?.width : c.width) + (o ?? 0), d = n?.height ? n?.height : u + c.height, f = d, p = [
1484
- {
1485
- x: 0,
1486
- y: -d
1487
- },
1488
- {
1489
- x: f,
1490
- y: -d
1491
- },
1492
- {
1493
- x: f / 2,
1494
- y: 0
1495
- }
1496
- ], { cssStyles: m } = n, h = C.svg(s), v = g(n, {});
1497
- n.look !== "handDrawn" && (v.roughness = 0, v.fillStyle = "solid");
1498
- let y = F(p), b = h.path(y, v), x = s.insert(() => b, ":first-child").attr("transform", `translate(${-d / 2}, ${d / 2})`).attr("class", "outer-path");
1499
- return m && n.look !== "handDrawn" && x.selectChildren("path").attr("style", m), i && n.look !== "handDrawn" && x.selectChildren("path").attr("style", i), n.width = u, n.height = d, N(n, x), l.attr("transform", `translate(${-c.width / 2 - (c.x - (c.left ?? 0))}, ${-d / 2 + (n.padding ?? 0) / 2 + (c.y - (c.top ?? 0))})`), n.intersect = function(t) {
1500
- return e.info("Triangle intersect", n, p, t), K.polygon(n, p, t);
1501
- }, s;
1502
- }
1503
- n(Xe, "flippedTriangle");
1504
- async function Ze(e, t) {
1505
- let { labelStyles: n, nodeStyles: r } = _(t);
1506
- t.labelStyle = n;
1507
- let { shapeSvg: i, bbox: a, label: o } = await j(e, t, P(t)), s = t.padding ?? 12, c = Math.max(a.width + s * 2, t.width ?? 0, 90), l = a.height + s * 2, u = Math.max(Math.min(l * .16, 14), 8), d = Math.max(l + u, t.height ?? 0), f = d - u, p = Math.max(c * .38, 28), m = -d / 2, h = [
1508
- {
1509
- x: -c / 2,
1510
- y: m
1511
- },
1512
- {
1513
- x: -c / 2 + p,
1514
- y: m
1515
- },
1516
- {
1517
- x: -c / 2 + p,
1518
- y: m + u
1519
- },
1520
- {
1521
- x: c / 2,
1522
- y: m + u
1523
- },
1524
- {
1525
- x: c / 2,
1526
- y: d / 2
1527
- },
1528
- {
1529
- x: -c / 2,
1530
- y: d / 2
1531
- }
1532
- ], v = [
1533
- `M${h[0].x},${h[0].y}`,
1534
- ...h.slice(1).map((e) => `L${e.x},${e.y}`),
1535
- "Z"
1536
- ].join(" "), { cssStyles: y } = t, b;
1537
- if (t.look === "handDrawn") {
1538
- let e = C.svg(i).path(v, g(t, {}));
1539
- b = i.insert(() => e, ":first-child").attr("class", "basic label-container"), y && b.attr("style", y);
1540
- } else b = i.insert("path", ":first-child").attr("d", v).attr("class", "basic label-container").attr("style", r);
1541
- t.look === "handDrawn" ? N(t, b) : N(t, b, {
1542
- width: c,
1543
- height: d
1544
- });
1545
- let x = m + u + f / 2;
1546
- return o.attr("transform", `translate(${-(a.width / 2) - (a.x - (a.left ?? 0))}, ${x - a.height / 2 - (a.y - (a.top ?? 0))})`), t.intersect = function(e) {
1547
- return K.polygon(t, h, e);
1548
- }, i;
1549
- }
1550
- n(Ze, "folder");
1551
- function Qe(e, t, { dir: n, config: { state: r, themeVariables: i } }) {
1552
- let { nodeStyles: a } = _(t);
1553
- t.label = "";
1554
- let o = e.insert("g").attr("class", P(t)).attr("id", t.domId ?? t.id), { cssStyles: s } = t, c = Math.max(70, t?.width ?? 0), l = Math.max(10, t?.height ?? 0);
1555
- n === "LR" && (c = Math.max(10, t?.width ?? 0), l = Math.max(70, t?.height ?? 0));
1556
- let u = -1 * c / 2, d = -1 * l / 2, f = C.svg(o), p = g(t, {
1557
- stroke: i.lineColor,
1558
- fill: i.lineColor
1559
- });
1560
- t.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
1561
- let m = f.rectangle(u, d, c, l, p), h = o.insert(() => m, ":first-child");
1562
- s && t.look !== "handDrawn" && h.selectAll("path").attr("style", s), a && t.look !== "handDrawn" && h.selectAll("path").attr("style", a), N(t, h);
1563
- let v = r?.padding ?? 0;
1564
- return t.width && t.height && (t.width += v / 2 || 0, t.height += v / 2 || 0), t.intersect = function(e) {
1565
- return K.rect(t, e);
1566
- }, o;
1567
- }
1568
- n(Qe, "forkJoin");
1569
- async function $e(t, n) {
1570
- let { labelStyles: r, nodeStyles: i } = _(n);
1571
- n.labelStyle = r;
1572
- let a = n.look === "neo" ? 16 : n.padding ?? 0, o = n.look === "neo" ? 12 : n.padding ?? 0;
1573
- (n.width || n.height) && (n.height = (n?.height ?? 0) - o * 2, n.height < 10 && (n.height = 10), n.width = (n?.width ?? 0) - a * 2, n.width < 15 && (n.width = 15));
1574
- let { shapeSvg: s, bbox: c } = await j(t, n, P(n)), l = (n?.width ? n?.width : Math.max(15, c.width)) + a * 2, u = (n?.height ? n?.height : Math.max(10, c.height)) + o * 2, d = u / 2, { cssStyles: f } = n, p = C.svg(s), m = g(n, {});
1575
- n.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
1576
- let h = [
1577
- {
1578
- x: -l / 2,
1579
- y: -u / 2
1580
- },
1581
- {
1582
- x: l / 2 - d,
1583
- y: -u / 2
1584
- },
1585
- ...L(-l / 2 + d, 0, d, 50, 90, 270),
1586
- {
1587
- x: l / 2 - d,
1588
- y: u / 2
1589
- },
1590
- {
1591
- x: -l / 2,
1592
- y: u / 2
1593
- }
1594
- ], v = F(h), y = p.path(v, m), b = s.insert(() => y, ":first-child");
1595
- return b.attr("class", "basic label-container outer-path"), f && n.look !== "handDrawn" && b.selectChildren("path").attr("style", f), i && n.look !== "handDrawn" && b.selectChildren("path").attr("style", i), N(n, b), n.intersect = function(t) {
1596
- return e.info("Pill intersect", n, {
1597
- radius: d,
1598
- point: t
1599
- }), K.polygon(n, h, t);
1600
- }, s;
1601
- }
1602
- n($e, "halfRoundedRectangle");
1603
- var et = /* @__PURE__ */ n((e, t, n, r, i) => [
1604
- `M${e + i},${t}`,
1605
- `L${e + n - i},${t}`,
1606
- `L${e + n},${t - r / 2}`,
1607
- `L${e + n - i},${t - r}`,
1608
- `L${e + i},${t - r}`,
1609
- `L${e},${t - r / 2}`,
1610
- "Z"
1611
- ].join(" "), "createHexagonPathD");
1612
- async function tt(e, t) {
1613
- let { labelStyles: n, nodeStyles: r } = _(t), i = t.look === "neo" ? 3.5 : 4;
1614
- t.labelStyle = n;
1615
- let a = t.padding ?? 0, o = t.look === "neo" ? 70 : a, s = t.look === "neo" ? 32 : a;
1616
- if (t.width || t.height) {
1617
- let e = (t.height ?? 0) / i;
1618
- t.width = (t?.width ?? 0) - 2 * e - s, t.height = (t.height ?? 0) - o;
1619
- }
1620
- let { shapeSvg: c, bbox: l } = await j(e, t, P(t)), u = (t?.height ? t?.height : l.height) + o, d = u / i, f = (t?.width ? t?.width : l.width) + 2 * d + s, p = [
1621
- {
1622
- x: d,
1623
- y: 0
1624
- },
1625
- {
1626
- x: f - d,
1627
- y: 0
1628
- },
1629
- {
1630
- x: f,
1631
- y: -u / 2
1632
- },
1633
- {
1634
- x: f - d,
1635
- y: -u
1636
- },
1637
- {
1638
- x: d,
1639
- y: -u
1640
- },
1641
- {
1642
- x: 0,
1643
- y: -u / 2
1644
- }
1645
- ], m, { cssStyles: h } = t;
1646
- if (t.look === "handDrawn") {
1647
- let e = C.svg(c), n = g(t, {}), r = et(0, 0, f, u, d), i = e.path(r, n);
1648
- m = c.insert(() => i, ":first-child").attr("transform", `translate(${-f / 2}, ${u / 2})`), h && m.attr("style", h);
1649
- } else m = q(c, f, u, p);
1650
- return r && m.attr("style", r), t.width = f, t.height = u, N(t, m), t.intersect = function(e) {
1651
- return K.polygon(t, p, e);
1652
- }, c;
1653
- }
1654
- n(tt, "hexagon");
1655
- async function nt(t, n) {
1656
- let { labelStyles: r, nodeStyles: i } = _(n);
1657
- n.label = "", n.labelStyle = r;
1658
- let { shapeSvg: a } = await j(t, n, P(n)), o = Math.max(30, n?.width ?? 0), s = Math.max(30, n?.height ?? 0), { cssStyles: c } = n, l = C.svg(a), u = g(n, {});
1659
- n.look !== "handDrawn" && (u.roughness = 0, u.fillStyle = "solid");
1660
- let d = [
1661
- {
1662
- x: 0,
1663
- y: 0
1664
- },
1665
- {
1666
- x: o,
1667
- y: 0
1668
- },
1669
- {
1670
- x: 0,
1671
- y: s
1672
- },
1673
- {
1674
- x: o,
1675
- y: s
1676
- }
1677
- ], f = F(d), p = l.path(f, u), m = a.insert(() => p, ":first-child");
1678
- return m.attr("class", "basic label-container outer-path"), c && n.look !== "handDrawn" && m.selectChildren("path").attr("style", c), i && n.look !== "handDrawn" && m.selectChildren("path").attr("style", i), m.attr("transform", `translate(${-o / 2}, ${-s / 2})`), N(n, m), n.intersect = function(t) {
1679
- return e.info("Pill intersect", n, { points: d }), K.polygon(n, d, t);
1680
- }, a;
1681
- }
1682
- n(nt, "hourglass");
1683
- async function rt(t, n, { config: { themeVariables: r, flowchart: i } }) {
1684
- let { labelStyles: a } = _(n);
1685
- n.labelStyle = a;
1686
- let o = n.assetHeight ?? 48, s = n.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
1687
- n.width = Math.max(c, l ?? 0);
1688
- let { shapeSvg: u, bbox: d, label: f } = await j(t, n, "icon-shape default"), p = n.pos === "t", m = c, h = c, { nodeBorder: v } = r, { stylesMap: x } = y(n), S = -h / 2, w = -m / 2, T = n.label ? 8 : 0, E = C.svg(u), D = g(n, {
1689
- stroke: "none",
1690
- fill: "none"
1691
- });
1692
- n.look !== "handDrawn" && (D.roughness = 0, D.fillStyle = "solid");
1693
- let O = E.rectangle(S, w, h, m, D), k = Math.max(h, d.width), A = m + d.height + T, M = E.rectangle(-k / 2, -A / 2, k, A, {
1694
- ...D,
1695
- fill: "transparent",
1696
- stroke: "none"
1697
- }), P = u.insert(() => O, ":first-child"), F = u.insert(() => M);
1698
- if (n.icon) {
1699
- let e = u.append("g");
1700
- e.html(`<g>${await b(n.icon, {
1701
- height: c,
1702
- width: c,
1703
- fallbackPrefix: ""
1704
- })}</g>`);
1705
- let t = e.node().getBBox(), r = t.width, i = t.height, a = t.x, o = t.y;
1706
- e.attr("transform", `translate(${-r / 2 - a},${p ? d.height / 2 + T / 2 - i / 2 - o : -d.height / 2 - T / 2 - i / 2 - o})`), e.attr("style", `color: ${x.get("stroke") ?? v};`);
1707
- }
1708
- return f.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${p ? -A / 2 : A / 2 - d.height})`), P.attr("transform", `translate(0,${p ? d.height / 2 + T / 2 : -d.height / 2 - T / 2})`), N(n, F), n.intersect = function(t) {
1709
- if (e.info("iconSquare intersect", n, t), !n.label) return K.rect(n, t);
1710
- let r = n.x ?? 0, i = n.y ?? 0, a = n.height ?? 0, o = [];
1711
- return o = p ? [
1712
- {
1713
- x: r - d.width / 2,
1714
- y: i - a / 2
1715
- },
1716
- {
1717
- x: r + d.width / 2,
1718
- y: i - a / 2
1719
- },
1720
- {
1721
- x: r + d.width / 2,
1722
- y: i - a / 2 + d.height + T
1723
- },
1724
- {
1725
- x: r + h / 2,
1726
- y: i - a / 2 + d.height + T
1727
- },
1728
- {
1729
- x: r + h / 2,
1730
- y: i + a / 2
1731
- },
1732
- {
1733
- x: r - h / 2,
1734
- y: i + a / 2
1735
- },
1736
- {
1737
- x: r - h / 2,
1738
- y: i - a / 2 + d.height + T
1739
- },
1740
- {
1741
- x: r - d.width / 2,
1742
- y: i - a / 2 + d.height + T
1743
- }
1744
- ] : [
1745
- {
1746
- x: r - h / 2,
1747
- y: i - a / 2
1748
- },
1749
- {
1750
- x: r + h / 2,
1751
- y: i - a / 2
1752
- },
1753
- {
1754
- x: r + h / 2,
1755
- y: i - a / 2 + m
1756
- },
1757
- {
1758
- x: r + d.width / 2,
1759
- y: i - a / 2 + m
1760
- },
1761
- {
1762
- x: r + d.width / 2 / 2,
1763
- y: i + a / 2
1764
- },
1765
- {
1766
- x: r - d.width / 2,
1767
- y: i + a / 2
1768
- },
1769
- {
1770
- x: r - d.width / 2,
1771
- y: i - a / 2 + m
1772
- },
1773
- {
1774
- x: r - h / 2,
1775
- y: i - a / 2 + m
1776
- }
1777
- ], K.polygon(n, o, t);
1778
- }, u;
1779
- }
1780
- n(rt, "icon");
1781
- async function it(t, n, { config: { themeVariables: r, flowchart: i } }) {
1782
- let { labelStyles: a } = _(n);
1783
- n.labelStyle = a;
1784
- let o = n.assetHeight ?? 48, s = n.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
1785
- n.width = Math.max(c, l ?? 0);
1786
- let { shapeSvg: u, bbox: d, label: f } = await j(t, n, "icon-shape default"), p = n.label ? 8 : 0, m = n.pos === "t", { nodeBorder: h, mainBkg: v } = r, { stylesMap: x } = y(n), S = C.svg(u), w = g(n, {});
1787
- n.look !== "handDrawn" && (w.roughness = 0, w.fillStyle = "solid"), w.stroke = x.get("fill") ?? v;
1788
- let T = u.append("g");
1789
- n.icon && T.html(`<g>${await b(n.icon, {
1790
- height: c,
1791
- width: c,
1792
- fallbackPrefix: ""
1793
- })}</g>`);
1794
- let E = T.node().getBBox(), D = E.width, O = E.height, k = E.x, A = E.y, M = Math.max(D, O) * Math.SQRT2 + 40, P = S.circle(0, 0, M, w), F = Math.max(M, d.width), I = M + d.height + p, L = S.rectangle(-F / 2, -I / 2, F, I, {
1795
- ...w,
1796
- fill: "transparent",
1797
- stroke: "none"
1798
- }), ee = u.insert(() => P, ":first-child"), R = u.insert(() => L);
1799
- return T.attr("transform", `translate(${-D / 2 - k},${m ? d.height / 2 + p / 2 - O / 2 - A : -d.height / 2 - p / 2 - O / 2 - A})`), T.attr("style", `color: ${x.get("stroke") ?? h};`), f.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${m ? -I / 2 : I / 2 - d.height})`), ee.attr("transform", `translate(0,${m ? d.height / 2 + p / 2 : -d.height / 2 - p / 2})`), N(n, R), n.intersect = function(t) {
1800
- return e.info("iconSquare intersect", n, t), K.rect(n, t);
1801
- }, u;
1802
- }
1803
- n(it, "iconCircle");
1804
- async function at(t, n, { config: { themeVariables: r, flowchart: i } }) {
1805
- let { labelStyles: a } = _(n);
1806
- n.labelStyle = a;
1807
- let o = n.assetHeight ?? 48, s = n.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
1808
- n.width = Math.max(c, l ?? 0);
1809
- let { shapeSvg: u, bbox: d, halfPadding: f, label: p } = await j(t, n, "icon-shape default"), m = n.pos === "t", h = c + f * 2, v = c + f * 2, { nodeBorder: x, mainBkg: S } = r, { stylesMap: w } = y(n), T = -v / 2, E = -h / 2, D = n.label ? 8 : 0, O = C.svg(u), k = g(n, {});
1810
- n.look !== "handDrawn" && (k.roughness = 0, k.fillStyle = "solid"), k.stroke = w.get("fill") ?? S;
1811
- let A = O.path(z(T, E, v, h, 5), k), M = Math.max(v, d.width), P = h + d.height + D, F = O.rectangle(-M / 2, -P / 2, M, P, {
1812
- ...k,
1813
- fill: "transparent",
1814
- stroke: "none"
1815
- }), I = u.insert(() => A, ":first-child").attr("class", "icon-shape2"), L = u.insert(() => F);
1816
- if (n.icon) {
1817
- let e = u.append("g");
1818
- e.html(`<g>${await b(n.icon, {
1819
- height: c,
1820
- width: c,
1821
- fallbackPrefix: ""
1822
- })}</g>`);
1823
- let t = e.node().getBBox(), r = t.width, i = t.height, a = t.x, o = t.y;
1824
- e.attr("transform", `translate(${-r / 2 - a},${m ? d.height / 2 + D / 2 - i / 2 - o : -d.height / 2 - D / 2 - i / 2 - o})`), e.attr("style", `color: ${w.get("stroke") ?? x};`);
1825
- }
1826
- return p.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${m ? -P / 2 : P / 2 - d.height})`), I.attr("transform", `translate(0,${m ? d.height / 2 + D / 2 : -d.height / 2 - D / 2})`), N(n, L), n.intersect = function(t) {
1827
- if (e.info("iconSquare intersect", n, t), !n.label) return K.rect(n, t);
1828
- let r = n.x ?? 0, i = n.y ?? 0, a = n.height ?? 0, o = [];
1829
- return o = m ? [
1830
- {
1831
- x: r - d.width / 2,
1832
- y: i - a / 2
1833
- },
1834
- {
1835
- x: r + d.width / 2,
1836
- y: i - a / 2
1837
- },
1838
- {
1839
- x: r + d.width / 2,
1840
- y: i - a / 2 + d.height + D
1841
- },
1842
- {
1843
- x: r + v / 2,
1844
- y: i - a / 2 + d.height + D
1845
- },
1846
- {
1847
- x: r + v / 2,
1848
- y: i + a / 2
1849
- },
1850
- {
1851
- x: r - v / 2,
1852
- y: i + a / 2
1853
- },
1854
- {
1855
- x: r - v / 2,
1856
- y: i - a / 2 + d.height + D
1857
- },
1858
- {
1859
- x: r - d.width / 2,
1860
- y: i - a / 2 + d.height + D
1861
- }
1862
- ] : [
1863
- {
1864
- x: r - v / 2,
1865
- y: i - a / 2
1866
- },
1867
- {
1868
- x: r + v / 2,
1869
- y: i - a / 2
1870
- },
1871
- {
1872
- x: r + v / 2,
1873
- y: i - a / 2 + h
1874
- },
1875
- {
1876
- x: r + d.width / 2,
1877
- y: i - a / 2 + h
1878
- },
1879
- {
1880
- x: r + d.width / 2 / 2,
1881
- y: i + a / 2
1882
- },
1883
- {
1884
- x: r - d.width / 2,
1885
- y: i + a / 2
1886
- },
1887
- {
1888
- x: r - d.width / 2,
1889
- y: i - a / 2 + h
1890
- },
1891
- {
1892
- x: r - v / 2,
1893
- y: i - a / 2 + h
1894
- }
1895
- ], K.polygon(n, o, t);
1896
- }, u;
1897
- }
1898
- n(at, "iconRounded");
1899
- async function ot(t, n, { config: { themeVariables: r, flowchart: i } }) {
1900
- let { labelStyles: a } = _(n);
1901
- n.labelStyle = a;
1902
- let o = n.assetHeight ?? 48, s = n.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
1903
- n.width = Math.max(c, l ?? 0);
1904
- let { shapeSvg: u, bbox: d, halfPadding: f, label: p } = await j(t, n, "icon-shape default"), m = n.pos === "t", h = c + f * 2, v = c + f * 2, { nodeBorder: x, mainBkg: S } = r, { stylesMap: w } = y(n), T = -v / 2, E = -h / 2, D = n.label ? 8 : 0, O = C.svg(u), k = g(n, {});
1905
- n.look !== "handDrawn" && (k.roughness = 0, k.fillStyle = "solid"), k.stroke = w.get("fill") ?? S;
1906
- let A = O.path(z(T, E, v, h, .1), k), M = Math.max(v, d.width), P = h + d.height + D, F = O.rectangle(-M / 2, -P / 2, M, P, {
1907
- ...k,
1908
- fill: "transparent",
1909
- stroke: "none"
1910
- }), I = u.insert(() => A, ":first-child"), L = u.insert(() => F);
1911
- if (n.icon) {
1912
- let e = u.append("g");
1913
- e.html(`<g>${await b(n.icon, {
1914
- height: c,
1915
- width: c,
1916
- fallbackPrefix: ""
1917
- })}</g>`);
1918
- let t = e.node().getBBox(), r = t.width, i = t.height, a = t.x, o = t.y;
1919
- e.attr("transform", `translate(${-r / 2 - a},${m ? d.height / 2 + D / 2 - i / 2 - o : -d.height / 2 - D / 2 - i / 2 - o})`), e.attr("style", `color: ${w.get("stroke") ?? x};`);
1920
- }
1921
- return p.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${m ? -P / 2 : P / 2 - d.height})`), I.attr("transform", `translate(0,${m ? d.height / 2 + D / 2 : -d.height / 2 - D / 2})`), N(n, L), n.intersect = function(t) {
1922
- if (e.info("iconSquare intersect", n, t), !n.label) return K.rect(n, t);
1923
- let r = n.x ?? 0, i = n.y ?? 0, a = n.height ?? 0, o = [];
1924
- return o = m ? [
1925
- {
1926
- x: r - d.width / 2,
1927
- y: i - a / 2
1928
- },
1929
- {
1930
- x: r + d.width / 2,
1931
- y: i - a / 2
1932
- },
1933
- {
1934
- x: r + d.width / 2,
1935
- y: i - a / 2 + d.height + D
1936
- },
1937
- {
1938
- x: r + v / 2,
1939
- y: i - a / 2 + d.height + D
1940
- },
1941
- {
1942
- x: r + v / 2,
1943
- y: i + a / 2
1944
- },
1945
- {
1946
- x: r - v / 2,
1947
- y: i + a / 2
1948
- },
1949
- {
1950
- x: r - v / 2,
1951
- y: i - a / 2 + d.height + D
1952
- },
1953
- {
1954
- x: r - d.width / 2,
1955
- y: i - a / 2 + d.height + D
1956
- }
1957
- ] : [
1958
- {
1959
- x: r - v / 2,
1960
- y: i - a / 2
1961
- },
1962
- {
1963
- x: r + v / 2,
1964
- y: i - a / 2
1965
- },
1966
- {
1967
- x: r + v / 2,
1968
- y: i - a / 2 + h
1969
- },
1970
- {
1971
- x: r + d.width / 2,
1972
- y: i - a / 2 + h
1973
- },
1974
- {
1975
- x: r + d.width / 2 / 2,
1976
- y: i + a / 2
1977
- },
1978
- {
1979
- x: r - d.width / 2,
1980
- y: i + a / 2
1981
- },
1982
- {
1983
- x: r - d.width / 2,
1984
- y: i - a / 2 + h
1985
- },
1986
- {
1987
- x: r - v / 2,
1988
- y: i - a / 2 + h
1989
- }
1990
- ], K.polygon(n, o, t);
1991
- }, u;
1992
- }
1993
- n(ot, "iconSquare");
1994
- async function st(t, n, { config: { flowchart: r } }) {
1995
- let i = new Image();
1996
- i.src = n?.img ?? "", await i.decode();
1997
- let a = Number(i.naturalWidth.toString().replace("px", "")), o = Number(i.naturalHeight.toString().replace("px", ""));
1998
- n.imageAspectRatio = a / o;
1999
- let { labelStyles: s } = _(n);
2000
- n.labelStyle = s;
2001
- let c = r?.wrappingWidth;
2002
- n.defaultWidth = r?.wrappingWidth;
2003
- let l = Math.max(n.label ? c ?? 0 : 0, n?.assetWidth ?? a), u = n.constraint === "on" && n?.assetHeight ? n.assetHeight * n.imageAspectRatio : l, d = n.constraint === "on" ? u / n.imageAspectRatio : n?.assetHeight ?? o;
2004
- n.width = Math.max(u, c ?? 0);
2005
- let { shapeSvg: f, bbox: p, label: m } = await j(t, n, "image-shape default"), h = n.pos === "t", v = -u / 2, y = -d / 2, b = n.label ? 8 : 0, x = C.svg(f), S = g(n, {});
2006
- n.look !== "handDrawn" && (S.roughness = 0, S.fillStyle = "solid");
2007
- let w = x.rectangle(v, y, u, d, S), T = Math.max(u, p.width), E = d + p.height + b, D = x.rectangle(-T / 2, -E / 2, T, E, {
2008
- ...S,
2009
- fill: "none",
2010
- stroke: "none"
2011
- }), O = f.insert(() => w, ":first-child"), k = f.insert(() => D);
2012
- if (n.img) {
2013
- let e = f.append("image");
2014
- e.attr("href", n.img), e.attr("width", u), e.attr("height", d), e.attr("preserveAspectRatio", "none"), e.attr("transform", `translate(${-u / 2},${h ? E / 2 - d : -E / 2})`);
2015
- }
2016
- return m.attr("transform", `translate(${-p.width / 2 - (p.x - (p.left ?? 0))},${h ? -d / 2 - p.height / 2 - b / 2 : d / 2 - p.height / 2 + b / 2})`), O.attr("transform", `translate(0,${h ? p.height / 2 + b / 2 : -p.height / 2 - b / 2})`), N(n, k), n.intersect = function(t) {
2017
- if (e.info("iconSquare intersect", n, t), !n.label) return K.rect(n, t);
2018
- let r = n.x ?? 0, i = n.y ?? 0, a = n.height ?? 0, o = [];
2019
- return o = h ? [
2020
- {
2021
- x: r - p.width / 2,
2022
- y: i - a / 2
2023
- },
2024
- {
2025
- x: r + p.width / 2,
2026
- y: i - a / 2
2027
- },
2028
- {
2029
- x: r + p.width / 2,
2030
- y: i - a / 2 + p.height + b
2031
- },
2032
- {
2033
- x: r + u / 2,
2034
- y: i - a / 2 + p.height + b
2035
- },
2036
- {
2037
- x: r + u / 2,
2038
- y: i + a / 2
2039
- },
2040
- {
2041
- x: r - u / 2,
2042
- y: i + a / 2
2043
- },
2044
- {
2045
- x: r - u / 2,
2046
- y: i - a / 2 + p.height + b
2047
- },
2048
- {
2049
- x: r - p.width / 2,
2050
- y: i - a / 2 + p.height + b
2051
- }
2052
- ] : [
2053
- {
2054
- x: r - u / 2,
2055
- y: i - a / 2
2056
- },
2057
- {
2058
- x: r + u / 2,
2059
- y: i - a / 2
2060
- },
2061
- {
2062
- x: r + u / 2,
2063
- y: i - a / 2 + d
2064
- },
2065
- {
2066
- x: r + p.width / 2,
2067
- y: i - a / 2 + d
2068
- },
2069
- {
2070
- x: r + p.width / 2 / 2,
2071
- y: i + a / 2
2072
- },
2073
- {
2074
- x: r - p.width / 2,
2075
- y: i + a / 2
2076
- },
2077
- {
2078
- x: r - p.width / 2,
2079
- y: i - a / 2 + d
2080
- },
2081
- {
2082
- x: r - u / 2,
2083
- y: i - a / 2 + d
2084
- }
2085
- ], K.polygon(n, o, t);
2086
- }, f;
2087
- }
2088
- n(st, "imageSquare");
2089
- async function ct(e, t) {
2090
- let { labelStyles: n, nodeStyles: r } = _(t);
2091
- t.labelStyle = n;
2092
- let i = t.padding ?? 0, a = i, o = t.look === "neo" ? i * 2 : i, { shapeSvg: s, bbox: c } = await j(e, t, P(t)), l = Math.max(c.height + a * 2, t.height ?? 0), u = Math.max(c.width + o * 2, (t.width ?? 0) - l), d = [
2093
- {
2094
- x: 0,
2095
- y: 0
2096
- },
2097
- {
2098
- x: u,
2099
- y: 0
2100
- },
2101
- {
2102
- x: u + 3 * l / 6,
2103
- y: -l
2104
- },
2105
- {
2106
- x: -3 * l / 6,
2107
- y: -l
2108
- }
2109
- ], f, { cssStyles: p } = t;
2110
- if (t.look === "handDrawn") {
2111
- let e = C.svg(s), n = g(t, {}), r = F(d), i = e.path(r, n);
2112
- f = s.insert(() => i, ":first-child").attr("transform", `translate(${-u / 2}, ${l / 2})`), p && f.attr("style", p);
2113
- } else f = q(s, u, l, d);
2114
- return r && f.attr("style", r), t.width = u, t.height = l, N(t, f), t.intersect = function(e) {
2115
- return K.polygon(t, d, e);
2116
- }, s;
2117
- }
2118
- n(ct, "inv_trapezoid");
2119
- async function lt(e, t) {
2120
- let { shapeSvg: n, bbox: r, label: i } = await j(e, t, "label"), a = n.insert("rect", ":first-child");
2121
- return a.attr("width", .1).attr("height", .1), n.attr("class", "label edgeLabel"), i.attr("transform", `translate(${-(r.width / 2) - (r.x - (r.left ?? 0))}, ${-(r.height / 2) - (r.y - (r.top ?? 0))})`), N(t, a), t.intersect = function(e) {
2122
- return K.rect(t, e);
2123
- }, n;
2124
- }
2125
- n(lt, "labelRect");
2126
- async function ut(e, t) {
2127
- let { labelStyles: n, nodeStyles: r } = _(t);
2128
- t.labelStyle = n;
2129
- let i = t.padding ?? 0, a = i, o = t.look === "neo" ? i * 2 : i, { shapeSvg: s, bbox: c } = await j(e, t, P(t)), l = Math.max(c.height + a, t.height ?? 0), u = Math.max(c.width + o, (t.width ?? 0) - l), d = [
2130
- {
2131
- x: 0,
2132
- y: 0
2133
- },
2134
- {
2135
- x: u + 3 * l / 6,
2136
- y: 0
2137
- },
2138
- {
2139
- x: u,
2140
- y: -l
2141
- },
2142
- {
2143
- x: -(3 * l) / 6,
2144
- y: -l
2145
- }
2146
- ], f, { cssStyles: p } = t;
2147
- if (t.look === "handDrawn") {
2148
- let e = C.svg(s), n = g(t, {}), r = F(d), i = e.path(r, n);
2149
- f = s.insert(() => i, ":first-child").attr("transform", `translate(${-u / 2}, ${l / 2})`), p && f.attr("style", p);
2150
- } else f = q(s, u, l, d);
2151
- return r && f.attr("style", r), t.width = u, t.height = l, N(t, f), t.intersect = function(e) {
2152
- return K.polygon(t, d, e);
2153
- }, s;
2154
- }
2155
- n(ut, "lean_left");
2156
- async function dt(e, t) {
2157
- let { labelStyles: n, nodeStyles: r } = _(t);
2158
- t.labelStyle = n;
2159
- let i = t.padding ?? 0, a = i, o = t.look === "neo" ? i * 2 : i, { shapeSvg: s, bbox: c } = await j(e, t, P(t)), l = Math.max(c.height + a, t.height ?? 0), u = Math.max(c.width + o, (t.width ?? 0) - l), d = [
2160
- {
2161
- x: -3 * l / 6,
2162
- y: 0
2163
- },
2164
- {
2165
- x: u,
2166
- y: 0
2167
- },
2168
- {
2169
- x: u + 3 * l / 6,
2170
- y: -l
2171
- },
2172
- {
2173
- x: 0,
2174
- y: -l
2175
- }
2176
- ], f, { cssStyles: p } = t;
2177
- if (t.look === "handDrawn") {
2178
- let e = C.svg(s), n = g(t, {}), r = F(d), i = e.path(r, n);
2179
- f = s.insert(() => i, ":first-child").attr("transform", `translate(${-u / 2}, ${l / 2})`), p && f.attr("style", p);
2180
- } else f = q(s, u, l, d);
2181
- return r && f.attr("style", r), t.width = u, t.height = l, N(t, f), t.intersect = function(e) {
2182
- return K.polygon(t, d, e);
2183
- }, s;
2184
- }
2185
- n(dt, "lean_right");
2186
- function ft(t, n) {
2187
- let { labelStyles: r, nodeStyles: i } = _(n);
2188
- n.label = "", n.labelStyle = r;
2189
- let a = t.insert("g").attr("class", P(n)).attr("id", n.domId ?? n.id), { cssStyles: o } = n, s = Math.max(35, n?.width ?? 0), c = Math.max(35, n?.height ?? 0), l = [
2190
- {
2191
- x: s,
2192
- y: 0
2193
- },
2194
- {
2195
- x: 0,
2196
- y: c + 7 / 2
2197
- },
2198
- {
2199
- x: s - 14,
2200
- y: c + 7 / 2
2201
- },
2202
- {
2203
- x: 0,
2204
- y: 2 * c
2205
- },
2206
- {
2207
- x: s,
2208
- y: c - 7 / 2
2209
- },
2210
- {
2211
- x: 14,
2212
- y: c - 7 / 2
2213
- }
2214
- ], u = C.svg(a), d = g(n, {});
2215
- n.look !== "handDrawn" && (d.roughness = 0, d.fillStyle = "solid");
2216
- let f = F(l), p = u.path(f, d), m = a.insert(() => p, ":first-child");
2217
- return m.attr("class", "outer-path"), o && n.look !== "handDrawn" && m.selectAll("path").attr("style", o), i && n.look !== "handDrawn" && m.selectAll("path").attr("style", i), m.attr("transform", `translate(-${s / 2},${-c})`), N(n, m), n.intersect = function(t) {
2218
- return e.info("lightningBolt intersect", n, t), K.polygon(n, l, t);
2219
- }, a;
2220
- }
2221
- n(ft, "lightningBolt");
2222
- var pt = /* @__PURE__ */ n((e, t, n, r, i, a, o) => [
2223
- `M${e},${t + a}`,
2224
- `a${i},${a} 0,0,0 ${n},0`,
2225
- `a${i},${a} 0,0,0 ${-n},0`,
2226
- `l0,${r}`,
2227
- `a${i},${a} 0,0,0 ${n},0`,
2228
- `l0,${-r}`,
2229
- `M${e},${t + a + o}`,
2230
- `a${i},${a} 0,0,0 ${n},0`
2231
- ].join(" "), "createCylinderPathD"), mt = /* @__PURE__ */ n((e, t, n, r, i, a, o) => [
2232
- `M${e},${t + a}`,
2233
- `M${e + n},${t + a}`,
2234
- `a${i},${a} 0,0,0 ${-n},0`,
2235
- `l0,${r}`,
2236
- `a${i},${a} 0,0,0 ${n},0`,
2237
- `l0,${-r}`,
2238
- `M${e},${t + a + o}`,
2239
- `a${i},${a} 0,0,0 ${n},0`
2240
- ].join(" "), "createOuterCylinderPathD"), ht = /* @__PURE__ */ n((e, t, n, r, i, a) => [`M${e - n / 2},${-r / 2}`, `a${i},${a} 0,0,0 ${n},0`].join(" "), "createInnerCylinderPathD"), gt = 10, _t = 10;
2241
- async function vt(e, t) {
2242
- let { labelStyles: n, nodeStyles: r } = _(t);
2243
- t.labelStyle = n;
2244
- let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 24 : i;
2245
- if (t.width || t.height) {
2246
- let e = t.width ?? 0;
2247
- t.width = (t.width ?? 0) - a, t.width < _t && (t.width = _t);
2248
- let n = e / 2 / (2.5 + e / 50);
2249
- t.height = (t.height ?? 0) - o - n * 3, t.height < gt && (t.height = gt);
2250
- }
2251
- let { shapeSvg: s, bbox: c, label: l } = await j(e, t, P(t)), u = (t?.width ? t?.width : c.width) + a * 2, d = u / 2, f = d / (2.5 + u / 50), p = (t?.height ? t?.height : c.height) + f + o * 2, m = p * .1, v, { cssStyles: y } = t;
2252
- if (t.look === "handDrawn") {
2253
- let e = C.svg(s), n = mt(0, 0, u, p, d, f, m), r = ht(0, f, u, p, d, f), i = g(t, {}), a = e.path(n, i), o = e.path(r, i);
2254
- s.insert(() => o, ":first-child").attr("class", "line"), v = s.insert(() => a, ":first-child"), v.attr("class", "basic label-container"), y && v.attr("style", y);
2255
- } else {
2256
- let e = pt(0, 0, u, p, d, f, m);
2257
- v = s.insert("path", ":first-child").attr("d", e).attr("class", "basic label-container outer-path").attr("style", h(y)).attr("style", r);
2258
- }
2259
- return v.attr("label-offset-y", f), v.attr("transform", `translate(${-u / 2}, ${-(p / 2 + f)})`), N(t, v), l.attr("transform", `translate(${-(c.width / 2) - (c.x - (c.left ?? 0))}, ${-(c.height / 2) + f - (c.y - (c.top ?? 0))})`), t.intersect = function(e) {
2260
- let n = K.rect(t, e), r = n.x - (t.x ?? 0);
2261
- if (d != 0 && (Math.abs(r) < (t.width ?? 0) / 2 || Math.abs(r) == (t.width ?? 0) / 2 && Math.abs(n.y - (t.y ?? 0)) > (t.height ?? 0) / 2 - f)) {
2262
- let i = f * f * (1 - r * r / (d * d));
2263
- i > 0 && (i = Math.sqrt(i)), i = f - i, e.y - (t.y ?? 0) > 0 && (i = -i), n.y += i;
2264
- }
2265
- return n;
2266
- }, s;
2267
- }
2268
- n(vt, "linedCylinder");
2269
- async function yt(e, t) {
2270
- let { labelStyles: n, nodeStyles: r } = _(t);
2271
- t.labelStyle = n;
2272
- let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i;
2273
- (t.width || t.height) && (t.width = (t.width ?? 0) * 10 / 11 - a * 2, t.width < 10 && (t.width = 10), t.height = (t?.height ?? 0) - o * 2, t.height < 10 && (t.height = 10));
2274
- let { shapeSvg: s, bbox: c, label: l } = await j(e, t, P(t)), u = (t?.width ? t?.width : c.width) + (a ?? 0) * 2, d = (t?.height ? t?.height : c.height) + (o ?? 0) * 2, f = t.look === "neo" ? d / 4 : d / 8, p = d + f, { cssStyles: m } = t, h = C.svg(s), v = g(t, {});
2275
- t.look !== "handDrawn" && (v.roughness = 0, v.fillStyle = "solid");
2276
- let y = [
2277
- {
2278
- x: -u / 2 - u / 2 * .1,
2279
- y: -p / 2
2280
- },
2281
- {
2282
- x: -u / 2 - u / 2 * .1,
2283
- y: p / 2
2284
- },
2285
- ...I(-u / 2 - u / 2 * .1, p / 2, u / 2 + u / 2 * .1, p / 2, f, .8),
2286
- {
2287
- x: u / 2 + u / 2 * .1,
2288
- y: -p / 2
2289
- },
2290
- {
2291
- x: -u / 2 - u / 2 * .1,
2292
- y: -p / 2
2293
- },
2294
- {
2295
- x: -u / 2,
2296
- y: -p / 2
2297
- },
2298
- {
2299
- x: -u / 2,
2300
- y: p / 2 * 1.1
2301
- },
2302
- {
2303
- x: -u / 2,
2304
- y: -p / 2
2305
- }
2306
- ], b = h.polygon(y.map((e) => [e.x, e.y]), v), x = s.insert(() => b, ":first-child");
2307
- return x.attr("class", "basic label-container outer-path"), m && t.look !== "handDrawn" && x.selectAll("path").attr("style", m), r && t.look !== "handDrawn" && x.selectAll("path").attr("style", r), x.attr("transform", `translate(0,${-f / 2})`), l.attr("transform", `translate(${-u / 2 + (t.padding ?? 0) + u / 2 * .1 / 2 - (c.x - (c.left ?? 0))},${-d / 2 + (t.padding ?? 0) - f / 2 - (c.y - (c.top ?? 0))})`), N(t, x), t.intersect = function(e) {
2308
- return K.polygon(t, y, e);
2309
- }, s;
2310
- }
2311
- n(yt, "linedWaveEdgedRect");
2312
- async function bt(e, t) {
2313
- let { labelStyles: n, nodeStyles: r } = _(t);
2314
- t.labelStyle = n;
2315
- let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i, s = t.look === "neo" ? 10 : 5;
2316
- (t.width || t.height) && (t.width = Math.max((t?.width ?? 0) - a * 2 - 2 * s, 10), t.height = Math.max((t?.height ?? 0) - o * 2 - 2 * s, 10));
2317
- let { shapeSvg: c, bbox: l, label: u } = await j(e, t, P(t)), d = (t?.width ? t?.width : l.width) + a * 2 + 2 * s, f = (t?.height ? t?.height : l.height) + o * 2 + 2 * s, p = d - 2 * s, m = f - 2 * s, h = -p / 2, v = -m / 2, { cssStyles: y } = t, b = C.svg(c), x = g(t, {}), S = [
2318
- {
2319
- x: h - s,
2320
- y: v + s
2321
- },
2322
- {
2323
- x: h - s,
2324
- y: v + m + s
2325
- },
2326
- {
2327
- x: h + p - s,
2328
- y: v + m + s
2329
- },
2330
- {
2331
- x: h + p - s,
2332
- y: v + m
2333
- },
2334
- {
2335
- x: h + p,
2336
- y: v + m
2337
- },
2338
- {
2339
- x: h + p,
2340
- y: v + m - s
2341
- },
2342
- {
2343
- x: h + p + s,
2344
- y: v + m - s
2345
- },
2346
- {
2347
- x: h + p + s,
2348
- y: v - s
2349
- },
2350
- {
2351
- x: h + s,
2352
- y: v - s
2353
- },
2354
- {
2355
- x: h + s,
2356
- y: v
2357
- },
2358
- {
2359
- x: h,
2360
- y: v
2361
- },
2362
- {
2363
- x: h,
2364
- y: v + s
2365
- }
2366
- ], w = [
2367
- {
2368
- x: h,
2369
- y: v + s
2370
- },
2371
- {
2372
- x: h + p - s,
2373
- y: v + s
2374
- },
2375
- {
2376
- x: h + p - s,
2377
- y: v + m
2378
- },
2379
- {
2380
- x: h + p,
2381
- y: v + m
2382
- },
2383
- {
2384
- x: h + p,
2385
- y: v
2386
- },
2387
- {
2388
- x: h,
2389
- y: v
2390
- }
2391
- ];
2392
- t.look !== "handDrawn" && (x.roughness = 0, x.fillStyle = "solid");
2393
- let T = F(S), E = b.path(T, x), D = F(w), O = b.path(D, x);
2394
- t.look !== "handDrawn" && (E = ee(E), O = ee(O));
2395
- let k = c.insert("g", ":first-child");
2396
- return k.insert(() => E), k.insert(() => O), k.attr("class", "basic label-container outer-path"), y && t.look !== "handDrawn" && k.selectAll("path").attr("style", y), r && t.look !== "handDrawn" && k.selectAll("path").attr("style", r), u.attr("transform", `translate(${-(l.width / 2) - s - (l.x - (l.left ?? 0))}, ${-(l.height / 2) + s - (l.y - (l.top ?? 0))})`), N(t, k), t.intersect = function(e) {
2397
- return K.polygon(t, S, e);
2398
- }, c;
2399
- }
2400
- n(bt, "multiRect");
2401
- async function xt(e, t) {
2402
- let { labelStyles: n, nodeStyles: r } = _(t);
2403
- t.labelStyle = n;
2404
- let { shapeSvg: i, bbox: a, label: o } = await j(e, t, P(t)), s = t.padding ?? 0, c = t.look === "neo" ? 16 : s, l = t.look === "neo" ? 12 : s, u = !0;
2405
- (t.width || t.height) && (u = !1, t.width = (t?.width ?? 0) - c * 2, t.height = (t?.height ?? 0) - l * 3);
2406
- let d = Math.max(a.width, t?.width ?? 0) + c * 2, f = Math.max(a.height, t?.height ?? 0) + l * 3, p = t.look === "neo" ? f / 4 : f / 8, m = f + (u ? p / 2 : -p / 2), h = -d / 2, v = -m / 2, { cssStyles: y } = t, b = I(h - 10, v + m + 10, h + d - 10, v + m + 10, p, .8), x = b?.[b.length - 1], S = [
2407
- {
2408
- x: h - 10,
2409
- y: v + 10
2410
- },
2411
- {
2412
- x: h - 10,
2413
- y: v + m + 10
2414
- },
2415
- ...b,
2416
- {
2417
- x: h + d - 10,
2418
- y: x.y - 10
2419
- },
2420
- {
2421
- x: h + d,
2422
- y: x.y - 10
2423
- },
2424
- {
2425
- x: h + d,
2426
- y: x.y - 20
2427
- },
2428
- {
2429
- x: h + d + 10,
2430
- y: x.y - 20
2431
- },
2432
- {
2433
- x: h + d + 10,
2434
- y: v - 10
2435
- },
2436
- {
2437
- x: h + 10,
2438
- y: v - 10
2439
- },
2440
- {
2441
- x: h + 10,
2442
- y: v
2443
- },
2444
- {
2445
- x: h,
2446
- y: v
2447
- },
2448
- {
2449
- x: h,
2450
- y: v + 10
2451
- }
2452
- ], w = [
2453
- {
2454
- x: h,
2455
- y: v + 10
2456
- },
2457
- {
2458
- x: h + d - 10,
2459
- y: v + 10
2460
- },
2461
- {
2462
- x: h + d - 10,
2463
- y: x.y - 10
2464
- },
2465
- {
2466
- x: h + d,
2467
- y: x.y - 10
2468
- },
2469
- {
2470
- x: h + d,
2471
- y: v
2472
- },
2473
- {
2474
- x: h,
2475
- y: v
2476
- }
2477
- ], T = C.svg(i), E = g(t, {});
2478
- t.look !== "handDrawn" && (E.roughness = 0, E.fillStyle = "solid");
2479
- let D = F(S), O = T.path(D, E), k = F(w), A = T.path(k, E), M = i.insert(() => O, ":first-child");
2480
- return M.insert(() => A), M.attr("class", "basic label-container outer-path"), y && t.look !== "handDrawn" && M.selectAll("path").attr("style", y), r && t.look !== "handDrawn" && M.selectAll("path").attr("style", r), M.attr("transform", `translate(0,${-p / 2})`), o.attr("transform", `translate(${-(a.width / 2) - 10 - (a.x - (a.left ?? 0))}, ${-(a.height / 2) + 10 - p / 2 - (a.y - (a.top ?? 0))})`), N(t, M), t.intersect = function(e) {
2481
- return K.polygon(t, S, e);
2482
- }, i;
2483
- }
2484
- n(xt, "multiWaveEdgedRectangle");
2485
- async function St(e, t, { config: { themeVariables: n } }) {
2486
- let { labelStyles: r, nodeStyles: i } = _(t);
2487
- t.labelStyle = r, t.useHtmlLabels || o(s()) || (t.centerLabel = !0);
2488
- let { shapeSvg: a, bbox: c, label: l } = await j(e, t, P(t)), u = Math.max(c.width + (t.padding ?? 0) * 2, t?.width ?? 0), d = Math.max(c.height + (t.padding ?? 0) * 2, t?.height ?? 0), f = -u / 2, p = -d / 2, { cssStyles: m } = t, h = C.svg(a), v = g(t, {
2489
- fill: n.noteBkgColor,
2490
- stroke: n.noteBorderColor
2491
- });
2492
- t.look !== "handDrawn" && (v.roughness = 0, v.fillStyle = "solid");
2493
- let y = h.rectangle(f, p, u, d, v), b = a.insert(() => y, ":first-child");
2494
- return b.attr("class", "basic label-container outer-path"), l.attr("class", "label noteLabel"), m && t.look !== "handDrawn" && b.selectAll("path").attr("style", m), i && t.look !== "handDrawn" && b.selectAll("path").attr("style", i), l.attr("transform", `translate(${-c.width / 2 - (c.x - (c.left ?? 0))}, ${-(c.height / 2) - (c.y - (c.top ?? 0))})`), N(t, b), t.intersect = function(e) {
2495
- return K.rect(t, e);
2496
- }, a;
2497
- }
2498
- n(St, "note");
2499
- var Ct = /* @__PURE__ */ n((e, t, n) => [
2500
- `M${e + n / 2},${t}`,
2501
- `L${e + n},${t - n / 2}`,
2502
- `L${e + n / 2},${t - n}`,
2503
- `L${e},${t - n / 2}`,
2504
- "Z"
2505
- ].join(" "), "createDecisionBoxPathD");
2506
- async function wt(e, t) {
2507
- let { labelStyles: n, nodeStyles: r } = _(t);
2508
- t.labelStyle = n;
2509
- let { shapeSvg: i, bbox: a } = await j(e, t, P(t)), o = a.width + (t.padding ?? 0) + (a.height + (t.padding ?? 0)), s = .5, c = [
2510
- {
2511
- x: o / 2,
2512
- y: 0
2513
- },
2514
- {
2515
- x: o,
2516
- y: -o / 2
2517
- },
2518
- {
2519
- x: o / 2,
2520
- y: -o
2521
- },
2522
- {
2523
- x: 0,
2524
- y: -o / 2
2525
- }
2526
- ], l, { cssStyles: u } = t;
2527
- if (t.look === "handDrawn") {
2528
- let e = C.svg(i), n = g(t, {}), r = Ct(0, 0, o), a = e.path(r, n);
2529
- l = i.insert(() => a, ":first-child").attr("transform", `translate(${-o / 2 + s}, ${o / 2})`), u && l.attr("style", u);
2530
- } else l = q(i, o, o, c), l.attr("transform", `translate(${-o / 2 + s}, ${o / 2})`);
2531
- return r && l.attr("style", r), N(t, l), t.calcIntersect = function(e, t) {
2532
- let n = e.width, r = [
2533
- {
2534
- x: n / 2,
2535
- y: 0
2536
- },
2537
- {
2538
- x: n,
2539
- y: -n / 2
2540
- },
2541
- {
2542
- x: n / 2,
2543
- y: -n
2544
- },
2545
- {
2546
- x: 0,
2547
- y: -n / 2
2548
- }
2549
- ], i = K.polygon(e, r, t);
2550
- return {
2551
- x: i.x - .5,
2552
- y: i.y - .5
2553
- };
2554
- }, t.intersect = function(e) {
2555
- return this.calcIntersect(t, e);
2556
- }, i;
2557
- }
2558
- n(wt, "question");
2559
- async function Tt(e, t) {
2560
- let { labelStyles: n, nodeStyles: r } = _(t);
2561
- t.labelStyle = n;
2562
- let i = t.padding ?? 0, a = t.look === "neo" ? 21 : i ?? 0, o = t.look === "neo" ? 12 : i ?? 0, { shapeSvg: s, bbox: c, label: l } = await j(e, t, P(t)), u = c.width + (t.look === "neo" ? a * 2 : a), d = Math.max(c.height + (t.look === "neo" ? o * 2 : o), t.height ?? 0), f = d / 4, p = -Math.max(u, (t.width ?? 0) - f) / 2, m = -d / 2, h = m / 2, v = [
2563
- {
2564
- x: p + h,
2565
- y: m
2566
- },
2567
- {
2568
- x: p,
2569
- y: 0
2570
- },
2571
- {
2572
- x: p + h,
2573
- y: -m
2574
- },
2575
- {
2576
- x: -p,
2577
- y: -m
2578
- },
2579
- {
2580
- x: -p,
2581
- y: m
2582
- }
2583
- ], { cssStyles: y } = t, b = C.svg(s), x = g(t, {});
2584
- t.look !== "handDrawn" && (x.roughness = 0, x.fillStyle = "solid");
2585
- let S = F(v), w = b.path(S, x), T = s.insert(() => w, ":first-child");
2586
- return T.attr("class", "basic label-container outer-path"), y && t.look !== "handDrawn" && T.selectAll("path").attr("style", y), r && t.look !== "handDrawn" && T.selectAll("path").attr("style", r), T.attr("transform", `translate(${-h / 2},0)`), l.attr("transform", `translate(${-h / 2 - c.width / 2 - (c.x - (c.left ?? 0))}, ${-(c.height / 2) - (c.y - (c.top ?? 0))})`), N(t, T), t.intersect = function(e) {
2587
- return K.polygon(t, v, e);
2588
- }, s;
2589
- }
2590
- n(Tt, "rect_left_inv_arrow");
2591
- async function Et(n, r) {
2592
- let { labelStyles: i, nodeStyles: a } = _(r);
2593
- r.labelStyle = i;
2594
- let s;
2595
- s = r.cssClasses ? "node " + r.cssClasses : "node default";
2596
- let c = n.insert("g").attr("class", s).attr("id", r.domId || r.id), l = c.insert("g"), d = c.insert("g").attr("class", "label").attr("style", a), f = r.description, p = r.label, m = await te(d, p, r.labelStyle, !0, !0), h = {
2597
- width: 0,
2598
- height: 0
2599
- };
2600
- if (o(u())) {
2601
- let e = m.children[0], n = t(m);
2602
- h = e.getBoundingClientRect(), n.attr("width", h.width), n.attr("height", h.height);
2603
- }
2604
- e.info("Text 2", f);
2605
- let v = f || [], y = m.getBBox(), b = await te(d, Array.isArray(v) ? v.join("<br/>") : v, r.labelStyle, !0, !0), x = b.children[0], S = t(b);
2606
- h = x.getBoundingClientRect(), S.attr("width", h.width), S.attr("height", h.height);
2607
- let w = (r.padding || 0) / 2;
2608
- t(b).attr("transform", "translate( " + (h.width > y.width ? 0 : (y.width - h.width) / 2) + ", " + (y.height + w + 5) + ")"), t(m).attr("transform", "translate( " + (h.width < y.width ? 0 : -(y.width - h.width) / 2) + ", 0)"), h = d.node().getBBox(), d.attr("transform", "translate(" + -h.width / 2 + ", " + (-h.height / 2 - w + 3) + ")");
2609
- let T = h.width + (r.padding || 0), E = h.height + (r.padding || 0), D = -h.width / 2 - w, O = -h.height / 2 - w, k, A;
2610
- if (r.look === "handDrawn") {
2611
- let t = C.svg(c), n = g(r, {}), i = t.path(z(D, O, T, E, r.rx || 0), n), a = t.line(-h.width / 2 - w, -h.height / 2 - w + y.height + w, h.width / 2 + w, -h.height / 2 - w + y.height + w, n);
2612
- A = c.insert(() => (e.debug("Rough node insert CXC", i), a), ":first-child"), k = c.insert(() => (e.debug("Rough node insert CXC", i), i), ":first-child");
2613
- } else k = l.insert("rect", ":first-child"), A = l.insert("line"), k.attr("class", "outer title-state").attr("style", a).attr("x", -h.width / 2 - w).attr("y", -h.height / 2 - w).attr("width", h.width + (r.padding || 0)).attr("height", h.height + (r.padding || 0)), A.attr("class", "divider").attr("x1", -h.width / 2 - w).attr("x2", h.width / 2 + w).attr("y1", -h.height / 2 - w + y.height + w).attr("y2", -h.height / 2 - w + y.height + w);
2614
- return N(r, k), r.intersect = function(e) {
2615
- return K.rect(r, e);
2616
- }, c;
2617
- }
2618
- n(Et, "rectWithTitle");
2619
- async function Dt(e, t, { config: { themeVariables: n } }) {
2620
- let r = n?.radius ?? 5;
2621
- return Ue(e, t, {
2622
- rx: r,
2623
- ry: r,
2624
- classes: "",
2625
- labelPaddingX: (t?.padding ?? 0) * 1,
2626
- labelPaddingY: (t?.padding ?? 0) * 1
2627
- });
2628
- }
2629
- n(Dt, "roundedRect");
2630
- var Z = 8;
2631
- async function Ot(e, t) {
2632
- let { labelStyles: n, nodeStyles: r } = _(t);
2633
- t.labelStyle = n;
2634
- let i = t.look === "neo" ? 16 : t.padding ?? 0, a = t.look === "neo" ? 12 : t.padding ?? 0, { shapeSvg: o, bbox: s, label: c } = await j(e, t, P(t)), l = (t?.width ?? s.width) + i * 2 + (t.look === "neo" ? Z : Z * 2), u = (t?.height ?? s.height) + a * 2, d = l - Z, f = u, p = Z - l / 2, m = -u / 2, { cssStyles: v } = t, y = C.svg(o), b = g(t, {});
2635
- t.look !== "handDrawn" && (b.roughness = 0, b.fillStyle = "solid");
2636
- let x = [
2637
- {
2638
- x: p,
2639
- y: m
2640
- },
2641
- {
2642
- x: p + d,
2643
- y: m
2644
- },
2645
- {
2646
- x: p + d,
2647
- y: m + f
2648
- },
2649
- {
2650
- x: p - Z,
2651
- y: m + f
2652
- },
2653
- {
2654
- x: p - Z,
2655
- y: m
2656
- },
2657
- {
2658
- x: p,
2659
- y: m
2660
- },
2661
- {
2662
- x: p,
2663
- y: m + f
2664
- }
2665
- ], S = y.polygon(x.map((e) => [e.x, e.y]), b), w = o.insert(() => S, ":first-child");
2666
- return w.attr("class", "basic label-container outer-path").attr("style", h(v)), r && t.look !== "handDrawn" && w.selectAll("path").attr("style", r), v && t.look !== "handDrawn" && w.selectAll("path").attr("style", r), c.attr("transform", `translate(${Z / 2 - s.width / 2 - (s.x - (s.left ?? 0))}, ${-(s.height / 2) - (s.y - (s.top ?? 0))})`), N(t, w), t.intersect = function(e) {
2667
- return K.rect(t, e);
2668
- }, o;
2669
- }
2670
- n(Ot, "shadedProcess");
2671
- async function kt(e, t) {
2672
- let { labelStyles: n, nodeStyles: r } = _(t);
2673
- t.labelStyle = n;
2674
- let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i;
2675
- (t.width || t.height) && (t.width = Math.max((t?.width ?? 0) - a * 2, 10), t.height = Math.max((t?.height ?? 0) / 1.5 - o * 2, 10));
2676
- let { shapeSvg: s, bbox: c, label: l } = await j(e, t, P(t)), u = (t?.width ? t?.width : c.width) + a * 2, d = ((t?.height ? t?.height : c.height) + o * 2) * 1.5, f = u, p = d / 1.5, m = -f / 2, h = -p / 2, { cssStyles: v } = t, y = C.svg(s), b = g(t, {});
2677
- t.look !== "handDrawn" && (b.roughness = 0, b.fillStyle = "solid");
2678
- let x = [
2679
- {
2680
- x: m,
2681
- y: h
2682
- },
2683
- {
2684
- x: m,
2685
- y: h + p
2686
- },
2687
- {
2688
- x: m + f,
2689
- y: h + p
2690
- },
2691
- {
2692
- x: m + f,
2693
- y: h - p / 2
2694
- }
2695
- ], S = F(x), w = y.path(S, b), T = s.insert(() => w, ":first-child");
2696
- return T.attr("class", "basic label-container outer-path"), v && t.look !== "handDrawn" && T.selectChildren("path").attr("style", v), r && t.look !== "handDrawn" && T.selectChildren("path").attr("style", r), T.attr("transform", `translate(0, ${p / 4})`), l.attr("transform", `translate(${-f / 2 + (t.padding ?? 0) - (c.x - (c.left ?? 0))}, ${-p / 4 + (t.padding ?? 0) - (c.y - (c.top ?? 0))})`), N(t, T), t.intersect = function(e) {
2697
- return K.polygon(t, x, e);
2698
- }, s;
2699
- }
2700
- n(kt, "slopedRect");
2701
- async function At(e, t) {
2702
- let n = t.padding ?? 0, r = t.look === "neo" ? 16 : n * 2, i = t.look === "neo" ? 12 : n;
2703
- return Ue(e, t, {
2704
- rx: 0,
2705
- ry: 0,
2706
- classes: "",
2707
- labelPaddingX: t.labelPaddingX ?? r,
2708
- labelPaddingY: i
2709
- });
2710
- }
2711
- n(At, "squareRect");
2712
- async function jt(e, t) {
2713
- let { labelStyles: n, nodeStyles: r } = _(t);
2714
- t.labelStyle = n;
2715
- let i = t.padding ?? 0, a = t.look === "neo" ? 20 : i, o = t.look === "neo" ? 12 : i, { shapeSvg: s, bbox: c } = await j(e, t, P(t)), l = c.height + (t.look === "neo" ? o * 2 : o), u = c.width + l / 4 + (t.look === "neo" ? a * 2 : a), d = l / 2, { cssStyles: f } = t, p = C.svg(s), m = g(t, {});
2716
- t.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
2717
- let h = [
2718
- {
2719
- x: -u / 2 + d,
2720
- y: -l / 2
2721
- },
2722
- {
2723
- x: u / 2 - d,
2724
- y: -l / 2
2725
- },
2726
- ...L(-u / 2 + d, 0, d, 50, 90, 270),
2727
- {
2728
- x: u / 2 - d,
2729
- y: l / 2
2730
- },
2731
- ...L(u / 2 - d, 0, d, 50, 270, 450)
2732
- ], v = F(h), y = p.path(v, m), b = s.insert(() => y, ":first-child");
2733
- return b.attr("class", "basic label-container outer-path"), f && t.look !== "handDrawn" && b.selectChildren("path").attr("style", f), r && t.look !== "handDrawn" && b.selectChildren("path").attr("style", r), N(t, b), t.intersect = function(e) {
2734
- return K.polygon(t, h, e);
2735
- }, s;
2736
- }
2737
- n(jt, "stadium");
2738
- async function Mt(e, t) {
2739
- return Ue(e, t, {
2740
- rx: t.look === "neo" ? 3 : 5,
2741
- ry: t.look === "neo" ? 3 : 5,
2742
- classes: "flowchart-node"
2743
- });
2744
- }
2745
- n(Mt, "state");
2746
- function Nt(e, t, { config: { themeVariables: n } }) {
2747
- let { labelStyles: r, nodeStyles: i } = _(t);
2748
- t.labelStyle = r;
2749
- let { cssStyles: a } = t, { lineColor: o, stateBorder: s, nodeBorder: c, nodeShadow: l } = n;
2750
- (t.width || t.height) && ((t.width ?? 0) < 14 && (t.width = 14), (t.height ?? 0) < 14 && (t.height = 14)), t.width ||= 14, t.height ||= 14;
2751
- let u = e.insert("g").attr("class", "node default").attr("id", t.domId ?? t.id), d = C.svg(u), f = g(t, {});
2752
- t.look !== "handDrawn" && (f.roughness = 0, f.fillStyle = "solid");
2753
- let p = d.circle(0, 0, t.width, {
2754
- ...f,
2755
- stroke: o,
2756
- strokeWidth: 2
2757
- }), m = s ?? c, h = (t.width ?? 0) * 5 / 14, v = d.circle(0, 0, h, {
2758
- ...f,
2759
- fill: m,
2760
- stroke: m,
2761
- strokeWidth: 2,
2762
- fillStyle: "solid"
2763
- }), y = u.insert(() => p, ":first-child");
2764
- if (y.insert(() => v), t.look !== "handDrawn" && y.attr("class", "outer-path"), a && y.selectAll("path").attr("style", a), i && y.selectAll("path").attr("style", i), t.width < 25 && l && t.look !== "handDrawn") {
2765
- let t = e.node()?.ownerSVGElement?.id ?? "", n = t ? `${t}-drop-shadow-small` : "drop-shadow-small";
2766
- y.attr("style", `filter:url(#${n})`);
2767
- }
2768
- return N(t, y), t.intersect = function(e) {
2769
- return K.circle(t, (t.width ?? 0) / 2, e);
2770
- }, u;
2771
- }
2772
- n(Nt, "stateEnd");
2773
- function Pt(e, t, { config: { themeVariables: n } }) {
2774
- let { lineColor: r, nodeShadow: i } = n;
2775
- (t.width || t.height) && ((t.width ?? 0) < 14 && (t.width = 14), (t.height ?? 0) < 14 && (t.height = 14)), t.width ||= 14, t.height ||= 14;
2776
- let a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), o;
2777
- if (t.look === "handDrawn") {
2778
- let e = C.svg(a).circle(0, 0, t.width, v(r));
2779
- o = a.insert(() => e), o.attr("class", "state-start").attr("r", (t.width ?? 7) / 2).attr("width", t.width ?? 14).attr("height", t.height ?? 14);
2780
- } else o = a.insert("circle", ":first-child"), o.attr("class", "state-start").attr("r", (t.width ?? 7) / 2).attr("width", t.width ?? 14).attr("height", t.height ?? 14);
2781
- if (t.width < 25 && i && t.look !== "handDrawn") {
2782
- let t = e.node()?.ownerSVGElement?.id ?? "", n = t ? `${t}-drop-shadow-small` : "drop-shadow-small";
2783
- o.attr("style", `filter:url(#${n})`);
2784
- }
2785
- return N(t, o), t.intersect = function(e) {
2786
- return K.circle(t, (t.width ?? 7) / 2, e);
2787
- }, a;
2788
- }
2789
- n(Pt, "stateStart");
2790
- var Ft = 8;
2791
- async function It(e, t) {
2792
- let { labelStyles: n, nodeStyles: r } = _(t);
2793
- t.labelStyle = n;
2794
- let i = t?.padding ?? 8, a = t.look === "neo" ? 28 : i, o = t.look === "neo" ? 12 : i, { shapeSvg: s, bbox: c } = await j(e, t, P(t)), l = Math.max(c.width + 2 * Ft + a, t.width ?? 0), u = Math.max(c.height + o, t.height ?? 0), d = l - 2 * Ft, f = u, p = -l / 2, m = -u / 2, v = [
2795
- {
2796
- x: 0,
2797
- y: 0
2798
- },
2799
- {
2800
- x: d,
2801
- y: 0
2802
- },
2803
- {
2804
- x: d,
2805
- y: -f
2806
- },
2807
- {
2808
- x: 0,
2809
- y: -f
2810
- },
2811
- {
2812
- x: 0,
2813
- y: 0
2814
- },
2815
- {
2816
- x: -8,
2817
- y: 0
2818
- },
2819
- {
2820
- x: d + 8,
2821
- y: 0
2822
- },
2823
- {
2824
- x: d + 8,
2825
- y: -f
2826
- },
2827
- {
2828
- x: -8,
2829
- y: -f
2830
- },
2831
- {
2832
- x: -8,
2833
- y: 0
2834
- }
2835
- ];
2836
- if (t.look === "handDrawn") {
2837
- let e = C.svg(s), n = g(t, {}), r = e.rectangle(p, m, d + 16, f, n), i = e.line(p + Ft, m, p + Ft, m + f, n), a = e.line(p + Ft + d, m, p + Ft + d, m + f, n);
2838
- s.insert(() => i, ":first-child"), s.insert(() => a, ":first-child");
2839
- let o = s.insert(() => r, ":first-child"), { cssStyles: c } = t;
2840
- o.attr("class", "basic label-container").attr("style", h(c)), N(t, o);
2841
- } else {
2842
- let e = q(s, d, f, v);
2843
- r && e.attr("style", r), N(t, e);
2844
- }
2845
- return t.intersect = function(e) {
2846
- return K.polygon(t, v, e);
2847
- }, s;
2848
- }
2849
- n(It, "subroutine");
2850
- var Lt = .2;
2851
- async function Rt(e, t) {
2852
- let { labelStyles: n, nodeStyles: r } = _(t);
2853
- t.labelStyle = n;
2854
- let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i;
2855
- (t.width || t.height) && (t.height = Math.max((t?.height ?? 0) - o * 2, 10), t.width = Math.max((t?.width ?? 0) - a * 2 - Lt * (t.height + o * 2), 10));
2856
- let { shapeSvg: s, bbox: c } = await j(e, t, P(t)), l = (t?.height ? t?.height : c.height) + o * 2, u = Lt * l, d = Lt * l, f = (t?.width ? t?.width : c.width) + a * 2 + u - u, p = l, m = -f / 2, h = -p / 2, { cssStyles: v } = t, y = C.svg(s), b = g(t, {}), x = [
2857
- {
2858
- x: m - u / 2,
2859
- y: h
2860
- },
2861
- {
2862
- x: m + f + u / 2,
2863
- y: h
2864
- },
2865
- {
2866
- x: m + f + u / 2,
2867
- y: h + p
2868
- },
2869
- {
2870
- x: m - u / 2,
2871
- y: h + p
2872
- }
2873
- ], S = [
2874
- {
2875
- x: m + f - u / 2,
2876
- y: h + p
2877
- },
2878
- {
2879
- x: m + f + u / 2,
2880
- y: h + p
2881
- },
2882
- {
2883
- x: m + f + u / 2,
2884
- y: h + p - d
2885
- }
2886
- ];
2887
- t.look !== "handDrawn" && (b.roughness = 0, b.fillStyle = "solid");
2888
- let w = F(x), T = y.path(w, b), E = F(S), D = y.path(E, {
2889
- ...b,
2890
- fillStyle: "solid"
2891
- }), O = s.insert(() => D, ":first-child");
2892
- return O.insert(() => T, ":first-child"), O.attr("class", "basic label-container outer-path"), v && t.look !== "handDrawn" && O.selectAll("path").attr("style", v), r && t.look !== "handDrawn" && O.selectAll("path").attr("style", r), N(t, O), t.intersect = function(e) {
2893
- return K.polygon(t, x, e);
2894
- }, s;
2895
- }
2896
- n(Rt, "taggedRect");
2897
- async function zt(e, t) {
2898
- let { labelStyles: n, nodeStyles: r } = _(t);
2899
- t.labelStyle = n;
2900
- let { shapeSvg: i, bbox: a, label: o } = await j(e, t, P(t)), s = Math.max(a.width + (t.padding ?? 0) * 2, t?.width ?? 0), c = Math.max(a.height + (t.padding ?? 0) * 2, t?.height ?? 0), l = c / 8, u = .2 * s, d = .2 * c, f = c + l, { cssStyles: p } = t, m = C.svg(i), h = g(t, {});
2901
- t.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
2902
- let v = [
2903
- {
2904
- x: -s / 2 - s / 2 * .1,
2905
- y: f / 2
2906
- },
2907
- ...I(-s / 2 - s / 2 * .1, f / 2, s / 2 + s / 2 * .1, f / 2, l, .8),
2908
- {
2909
- x: s / 2 + s / 2 * .1,
2910
- y: -f / 2
2911
- },
2912
- {
2913
- x: -s / 2 - s / 2 * .1,
2914
- y: -f / 2
2915
- }
2916
- ], y = -s / 2 + s / 2 * .1, b = -f / 2 - d * .4, x = [
2917
- {
2918
- x: y + s - u,
2919
- y: (b + c) * 1.3
2920
- },
2921
- {
2922
- x: y + s,
2923
- y: b + c - d
2924
- },
2925
- {
2926
- x: y + s,
2927
- y: (b + c) * .9
2928
- },
2929
- ...I(y + s, (b + c) * 1.25, y + s - u, (b + c) * 1.3, -c * .02, .5)
2930
- ], S = F(v), w = m.path(S, h), T = F(x), E = m.path(T, {
2931
- ...h,
2932
- fillStyle: "solid"
2933
- }), D = i.insert(() => E, ":first-child");
2934
- return D.insert(() => w, ":first-child"), D.attr("class", "basic label-container outer-path"), p && t.look !== "handDrawn" && D.selectAll("path").attr("style", p), r && t.look !== "handDrawn" && D.selectAll("path").attr("style", r), D.attr("transform", `translate(0,${-l / 2})`), o.attr("transform", `translate(${-s / 2 + (t.padding ?? 0) - (a.x - (a.left ?? 0))},${-c / 2 + (t.padding ?? 0) - l / 2 - (a.y - (a.top ?? 0))})`), N(t, D), t.intersect = function(e) {
2935
- return K.polygon(t, v, e);
2936
- }, i;
2937
- }
2938
- n(zt, "taggedWaveEdgedRectangle");
2939
- async function Bt(e, t) {
2940
- let { labelStyles: n, nodeStyles: r } = _(t);
2941
- t.labelStyle = n;
2942
- let { shapeSvg: i, bbox: a } = await j(e, t, P(t)), o = Math.max(a.width + (t.padding ?? 0), t?.width || 0), s = Math.max(a.height + (t.padding ?? 0), t?.height || 0), c = -o / 2, l = -s / 2, u = i.insert("rect", ":first-child");
2943
- return u.attr("class", "text").attr("style", r).attr("rx", 0).attr("ry", 0).attr("x", c).attr("y", l).attr("width", o).attr("height", s), N(t, u), t.intersect = function(e) {
2944
- return K.rect(t, e);
2945
- }, i;
2946
- }
2947
- n(Bt, "text");
2948
- var Vt = /* @__PURE__ */ n((e, t, n, r, i, a) => `M${e},${t}
2949
- a${i},${a} 0,0,1 0,${-r}
2950
- l${n},0
2951
- a${i},${a} 0,0,1 0,${r}
2952
- M${n},${-r}
2953
- a${i},${a} 0,0,0 0,${r}
2954
- l${-n},0`, "createCylinderPathD"), Ht = /* @__PURE__ */ n((e, t, n, r, i, a) => [
2955
- `M${e},${t}`,
2956
- `M${e + n},${t}`,
2957
- `a${i},${a} 0,0,0 0,${-r}`,
2958
- `l${-n},0`,
2959
- `a${i},${a} 0,0,0 0,${r}`,
2960
- `l${n},0`
2961
- ].join(" "), "createOuterCylinderPathD"), Ut = /* @__PURE__ */ n((e, t, n, r, i, a) => [`M${e + n / 2},${-r / 2}`, `a${i},${a} 0,0,0 0,${r}`].join(" "), "createInnerCylinderPathD"), Wt = 5, Gt = 10;
2962
- async function Kt(e, t) {
2963
- let { labelStyles: n, nodeStyles: r } = _(t);
2964
- t.labelStyle = n;
2965
- let i = t.padding ?? 0, a = t.look === "neo" ? 12 : i / 2, o = t.height ?? 0;
2966
- if (t.height && (t.height -= a, t.height < Wt && (t.height = Wt)), t.width) {
2967
- let e = o / 2 / (2.5 + o / 50);
2968
- t.width = t.width - a - e * 3, t.width < Gt && (t.width = Gt);
2969
- }
2970
- let { shapeSvg: s, bbox: c, label: l } = await j(e, t, P(t)), u = Math.max(t.height ?? 0, c.height) + a, d = u / 2, f = d / (2.5 + u / 50), p = Math.max(t.width ?? 0, c.width) + f + a, { cssStyles: m } = t, v;
2971
- if (t.look === "handDrawn") {
2972
- let e = C.svg(s), n = Ht(0, 0, p, u, f, d), r = Ut(0, 0, p, u, f, d), i = e.path(n, g(t, {})), a = e.path(r, g(t, { fill: "none" }));
2973
- v = s.insert(() => a, ":first-child"), v = s.insert(() => i, ":first-child"), v.attr("class", "basic label-container"), m && v.attr("style", m);
2974
- } else {
2975
- let e = Vt(0, 0, p, u, f, d);
2976
- v = s.insert("path", ":first-child").attr("d", e).attr("class", "basic label-container").attr("style", h(m)).attr("style", r), v.attr("class", "basic label-container outer-path"), m && v.selectAll("path").attr("style", m), r && v.selectAll("path").attr("style", r);
2977
- }
2978
- return v.attr("label-offset-x", f), v.attr("transform", `translate(${-p / 2}, ${u / 2} )`), l.attr("transform", `translate(${-(c.width / 2) - f - (c.x - (c.left ?? 0))}, ${-(c.height / 2) - (c.y - (c.top ?? 0))})`), N(t, v), t.intersect = function(e) {
2979
- let n = K.rect(t, e), r = n.y - (t.y ?? 0);
2980
- if (d != 0 && (Math.abs(r) < (t.height ?? 0) / 2 || Math.abs(r) == (t.height ?? 0) / 2 && Math.abs(n.x - (t.x ?? 0)) > (t.width ?? 0) / 2 - f)) {
2981
- let i = f * f * (1 - r * r / (d * d));
2982
- i != 0 && (i = Math.sqrt(Math.abs(i))), i = f - i, e.x - (t.x ?? 0) > 0 && (i = -i), n.x += i;
2983
- }
2984
- return n;
2985
- }, s;
2986
- }
2987
- n(Kt, "tiltedCylinder");
2988
- async function qt(e, t) {
2989
- let { labelStyles: n, nodeStyles: r } = _(t);
2990
- t.labelStyle = n;
2991
- let i = t.padding ?? 0, a = (t.look, i), o = t.look === "neo" ? i * 2 : i, { shapeSvg: s, bbox: c } = await j(e, t, P(t)), l = Math.max(c.height + a, t.height ?? 0), u = Math.max(c.width + o, (t.width ?? 0) - l), d = [
2992
- {
2993
- x: -3 * l / 6,
2994
- y: 0
2995
- },
2996
- {
2997
- x: u + 3 * l / 6,
2998
- y: 0
2999
- },
3000
- {
3001
- x: u,
3002
- y: -l
3003
- },
3004
- {
3005
- x: 0,
3006
- y: -l
3007
- }
3008
- ], f, { cssStyles: p } = t;
3009
- if (t.look === "handDrawn") {
3010
- let e = C.svg(s), n = g(t, {}), r = F(d), i = e.path(r, n);
3011
- f = s.insert(() => i, ":first-child").attr("transform", `translate(${-u / 2}, ${l / 2})`), p && f.attr("style", p);
3012
- } else f = q(s, u, l, d);
3013
- return r && f.attr("style", r), t.width = u, t.height = l, N(t, f), t.intersect = function(e) {
3014
- return K.polygon(t, d, e);
3015
- }, s;
3016
- }
3017
- n(qt, "trapezoid");
3018
- async function Jt(e, t) {
3019
- let { labelStyles: n, nodeStyles: r } = _(t);
3020
- t.labelStyle = n;
3021
- let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i;
3022
- (t.width || t.height) && (t.height = (t.height ?? 0) - o * 2, t.height < 5 && (t.height = 5), t.width = (t.width ?? 0) - a * 2, t.width < 15 && (t.width = 15));
3023
- let { shapeSvg: s, bbox: c } = await j(e, t, P(t)), l = (t?.width ? t?.width : c.width) + a * 2, u = (t?.height ? t?.height : c.height) + o * 2, { cssStyles: d } = t, f = C.svg(s), p = g(t, {});
3024
- t.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
3025
- let m = [
3026
- {
3027
- x: -l / 2 * .8,
3028
- y: -u / 2
3029
- },
3030
- {
3031
- x: l / 2 * .8,
3032
- y: -u / 2
3033
- },
3034
- {
3035
- x: l / 2,
3036
- y: -u / 2 * .6
3037
- },
3038
- {
3039
- x: l / 2,
3040
- y: u / 2
3041
- },
3042
- {
3043
- x: -l / 2,
3044
- y: u / 2
3045
- },
3046
- {
3047
- x: -l / 2,
3048
- y: -u / 2 * .6
3049
- }
3050
- ], h = F(m), v = f.path(h, p), y = s.insert(() => v, ":first-child");
3051
- return y.attr("class", "basic label-container outer-path"), d && t.look !== "handDrawn" && y.selectChildren("path").attr("style", d), r && t.look !== "handDrawn" && y.selectChildren("path").attr("style", r), N(t, y), t.intersect = function(e) {
3052
- return K.polygon(t, m, e);
3053
- }, s;
3054
- }
3055
- n(Jt, "trapezoidalPentagon");
3056
- var Yt = 10, Xt = 10;
3057
- async function Zt(t, n) {
3058
- let { labelStyles: r, nodeStyles: i } = _(n);
3059
- n.labelStyle = r;
3060
- let a = n.padding ?? 0, o = n.look === "neo" ? a * 2 : a;
3061
- (n.width || n.height) && (n.width = ((n?.width ?? 0) - o) / 2, n.width < Xt && (n.width = Xt), n.height = n?.height ?? 0, n.height < Yt && (n.height = Yt));
3062
- let { shapeSvg: s, bbox: c, label: d } = await j(t, n, P(n)), f = l(u().flowchart?.htmlLabels), p = (n?.width ? n?.width : c.width) + o, m = n?.height ? n?.height : p + c.height, h = m, v = [
3063
- {
3064
- x: 0,
3065
- y: 0
3066
- },
3067
- {
3068
- x: h,
3069
- y: 0
3070
- },
3071
- {
3072
- x: h / 2,
3073
- y: -m
3074
- }
3075
- ], { cssStyles: y } = n, b = C.svg(s), x = g(n, {});
3076
- n.look !== "handDrawn" && (x.roughness = 0, x.fillStyle = "solid");
3077
- let S = F(v), w = b.path(S, x), T = s.insert(() => w, ":first-child").attr("transform", `translate(${-m / 2}, ${m / 2})`).attr("class", "outer-path");
3078
- return y && n.look !== "handDrawn" && T.selectChildren("path").attr("style", y), i && n.look !== "handDrawn" && T.selectChildren("path").attr("style", i), n.width = p, n.height = m, N(n, T), d.attr("transform", `translate(${-c.width / 2 - (c.x - (c.left ?? 0))}, ${m / 2 - (c.height + (n.padding ?? 0) / (f ? 2 : 1) - (c.y - (c.top ?? 0)))})`), n.intersect = function(t) {
3079
- return e.info("Triangle intersect", n, v, t), K.polygon(n, v, t);
3080
- }, s;
3081
- }
3082
- n(Zt, "triangle");
3083
- async function Qt(e, t) {
3084
- let { labelStyles: n, nodeStyles: r } = _(t);
3085
- t.labelStyle = n;
3086
- let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i, s = !0;
3087
- (t.width || t.height) && (s = !1, t.width = (t?.width ?? 0) - a * 2, t.width < 10 && (t.width = 10), t.height = (t?.height ?? 0) - o * 2, t.height < 10 && (t.height = 10));
3088
- let { shapeSvg: c, bbox: l, label: u } = await j(e, t, P(t)), d = (t?.width ? t?.width : l.width) + (a ?? 0) * 2, f = (t?.height ? t?.height : l.height) + (o ?? 0) * 2, p = t.look === "neo" ? f / 4 : f / 8, m = f + (s ? p : -p), { cssStyles: h } = t, v = 14 - d, y = v > 0 ? v / 2 : 0, b = C.svg(c), x = g(t, {});
3089
- t.look !== "handDrawn" && (x.roughness = 0, x.fillStyle = "solid");
3090
- let S = [
3091
- {
3092
- x: -d / 2 - y,
3093
- y: m / 2
3094
- },
3095
- ...I(-d / 2 - y, m / 2, d / 2 + y, m / 2, p, .8),
3096
- {
3097
- x: d / 2 + y,
3098
- y: -m / 2
3099
- },
3100
- {
3101
- x: -d / 2 - y,
3102
- y: -m / 2
3103
- }
3104
- ], w = F(S), T = b.path(w, x), E = c.insert(() => T, ":first-child");
3105
- return E.attr("class", "basic label-container outer-path"), h && t.look !== "handDrawn" && E.selectAll("path").attr("style", h), r && t.look !== "handDrawn" && E.selectAll("path").attr("style", r), E.attr("transform", `translate(0,${-p / 2})`), u.attr("transform", `translate(${-d / 2 + (t.padding ?? 0) - (l.x - (l.left ?? 0))},${-f / 2 + (t.padding ?? 0) - p - (l.y - (l.top ?? 0))})`), N(t, E), t.intersect = function(e) {
3106
- return K.polygon(t, S, e);
3107
- }, c;
3108
- }
3109
- n(Qt, "waveEdgedRectangle");
3110
- async function $t(e, t) {
3111
- let { labelStyles: n, nodeStyles: r } = _(t);
3112
- t.labelStyle = n;
3113
- let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 20 : i;
3114
- if (t.width || t.height) {
3115
- t.width = t?.width ?? 0, t.width < 20 && (t.width = 20), t.height = t?.height ?? 0, t.height < 10 && (t.height = 10);
3116
- let e = Math.min(t.height * .2, t.height / 4);
3117
- t.height = Math.ceil(t.height - o - 20 / 9 * e), t.width -= a * 2;
3118
- }
3119
- let { shapeSvg: s, bbox: c } = await j(e, t, P(t)), l = (t?.width ? t?.width : c.width) + a * 2, u = (t?.height ? t?.height : c.height) + o, d = u / 8, f = u + d * 2, { cssStyles: p } = t, m = C.svg(s), h = g(t, {});
3120
- t.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
3121
- let v = [
3122
- {
3123
- x: -l / 2,
3124
- y: f / 2
3125
- },
3126
- ...I(-l / 2, f / 2, l / 2, f / 2, d, 1),
3127
- {
3128
- x: l / 2,
3129
- y: -f / 2
3130
- },
3131
- ...I(l / 2, -f / 2, -l / 2, -f / 2, d, -1)
3132
- ], y = F(v), b = m.path(y, h), x = s.insert(() => b, ":first-child");
3133
- return x.attr("class", "basic label-container"), p && t.look !== "handDrawn" && x.selectAll("path").attr("style", p), r && t.look !== "handDrawn" && x.selectAll("path").attr("style", r), N(t, x), t.intersect = function(e) {
3134
- return K.polygon(t, v, e);
3135
- }, s;
3136
- }
3137
- n($t, "waveRectangle");
3138
- var Q = 10;
3139
- async function en(e, t) {
3140
- let { labelStyles: n, nodeStyles: r } = _(t);
3141
- t.labelStyle = n;
3142
- let i = t.look === "neo" ? 16 : t.padding ?? 0, a = t.look === "neo" ? 12 : t.padding ?? 0;
3143
- (t.width || t.height) && (t.width = Math.max((t?.width ?? 0) - i * 2 - Q, 10), t.height = Math.max((t?.height ?? 0) - a * 2 - Q, 10));
3144
- let { shapeSvg: o, bbox: s, label: c } = await j(e, t, P(t)), l = (t?.width ? t?.width : s.width) + i * 2 + Q, u = (t?.height ? t?.height : s.height) + a * 2 + Q, d = l - Q, f = u - Q, p = -d / 2, m = -f / 2, { cssStyles: h } = t, v = C.svg(o), y = g(t, {}), b = [
3145
- {
3146
- x: p - Q,
3147
- y: m - Q
3148
- },
3149
- {
3150
- x: p - Q,
3151
- y: m + f
3152
- },
3153
- {
3154
- x: p + d,
3155
- y: m + f
3156
- },
3157
- {
3158
- x: p + d,
3159
- y: m - Q
3160
- }
3161
- ], x = `M${p - Q},${m - Q} L${p + d},${m - Q} L${p + d},${m + f} L${p - Q},${m + f} L${p - Q},${m - Q}
3162
- M${p - Q},${m} L${p + d},${m}
3163
- M${p},${m - Q} L${p},${m + f}`;
3164
- t.look !== "handDrawn" && (y.roughness = 0, y.fillStyle = "solid");
3165
- let S = v.path(x, y), w = o.insert(() => S, ":first-child");
3166
- return w.attr("transform", `translate(${Q / 2}, ${Q / 2})`), w.attr("class", "basic label-container outer-path"), h && t.look !== "handDrawn" && w.selectAll("path").attr("style", h), r && t.look !== "handDrawn" && w.selectAll("path").attr("style", r), c.attr("transform", `translate(${-(s.width / 2) + Q / 2 - (s.x - (s.left ?? 0))}, ${-(s.height / 2) + Q / 2 - (s.y - (s.top ?? 0))})`), N(t, w), t.intersect = function(e) {
3167
- return K.polygon(t, b, e);
3168
- }, o;
3169
- }
3170
- n(en, "windowPane");
3171
- var tn = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), nn = /* @__PURE__ */ new Set([
3172
- "redux",
3173
- "redux-dark",
3174
- "redux-color",
3175
- "redux-dark-color"
3176
- ]);
3177
- async function rn(e, n) {
3178
- let r = n;
3179
- r.alias && (n.label = r.alias);
3180
- let { theme: i, themeVariables: a } = s(), { rowEven: o, rowOdd: c, nodeBorder: u, borderColorArray: d } = a;
3181
- if (n.look === "handDrawn") {
3182
- let { themeVariables: t } = s(), { background: r } = t;
3183
- await rn(e, {
3184
- ...n,
3185
- id: n.id + "-background",
3186
- domId: (n.domId || n.id) + "-background",
3187
- look: "default",
3188
- cssStyles: ["stroke: none", `fill: ${r}`]
3189
- });
3190
- }
3191
- let f = s();
3192
- n.useHtmlLabels = f.htmlLabels;
3193
- let p = f.er?.diagramPadding ?? 10, h = f.er?.entityPadding ?? 6, { cssStyles: v } = n, { labelStyles: y, nodeStyles: b } = _(n);
3194
- if (r.attributes.length === 0 && n.label) {
3195
- let t = {
3196
- rx: 0,
3197
- ry: 0,
3198
- labelPaddingX: p,
3199
- labelPaddingY: p * 1.5,
3200
- classes: ""
3201
- };
3202
- m(n.label, f) + t.labelPaddingX * 2 < f.er.minEntityWidth && (n.width = f.er.minEntityWidth);
3203
- let a = await Ue(e, n, t);
3204
- if (i != null && tn.has(i)) {
3205
- let e = r.colorIndex ?? 0;
3206
- a.attr("data-color-id", `color-${e % d.length}`);
3207
- }
3208
- if (!l(f.htmlLabels)) {
3209
- let e = a.select("text"), t = e.node()?.getBBox();
3210
- e.attr("transform", `translate(${-t.width / 2}, 0)`);
3211
- }
3212
- return a;
3213
- }
3214
- f.htmlLabels || (p *= 1.25, h *= 1.25);
3215
- let x = P(n);
3216
- x ||= "node default";
3217
- let S = e.insert("g").attr("class", x).attr("id", n.domId || n.id), w = await an(S, n.label ?? "", f, 0, 0, ["name"], y);
3218
- w.height += h;
3219
- let T = 0, E = [], D = [], O = 0, k = 0, A = 0, j = 0, M = !0, F = !0;
3220
- for (let e of r.attributes) {
3221
- let t = await an(S, e.type, f, 0, T, ["attribute-type"], y);
3222
- O = Math.max(O, t.width + p);
3223
- let n = await an(S, e.name, f, 0, T, ["attribute-name"], y);
3224
- k = Math.max(k, n.width + p);
3225
- let r = await an(S, e.keys.join(), f, 0, T, ["attribute-keys"], y);
3226
- A = Math.max(A, r.width + p);
3227
- let i = await an(S, e.comment, f, 0, T, ["attribute-comment"], y);
3228
- j = Math.max(j, i.width + p);
3229
- let a = Math.max(t.height, n.height, r.height, i.height) + h;
3230
- D.push({
3231
- yOffset: T,
3232
- rowHeight: a
3233
- }), T += a;
3234
- }
3235
- let I = 4;
3236
- A <= p && (M = !1, A = 0, I--), j <= p && (F = !1, j = 0, I--);
3237
- let L = S.node().getBBox();
3238
- if (w.width + p * 2 - (O + k + A + j) > 0) {
3239
- let e = w.width + p * 2 - (O + k + A + j);
3240
- O += e / I, k += e / I, A > 0 && (A += e / I), j > 0 && (j += e / I);
3241
- }
3242
- let ee = O + k + A + j, R = C.svg(S), z = g(n, {});
3243
- n.look !== "handDrawn" && (z.roughness = 0, z.fillStyle = "solid");
3244
- let te = 0;
3245
- D.length > 0 && (te = D.reduce((e, t) => e + (t?.rowHeight ?? 0), 0));
3246
- let B = Math.max(L.width + p * 2, n?.width || 0, ee), ne = Math.max((te ?? 0) + w.height, n?.height || 0), V = -B / 2, H = -ne / 2;
3247
- if (S.selectAll("g:not(:first-child)").each((e, n, r) => {
3248
- let i = t(r[n]), a = i.attr("transform"), o = 0, s = 0;
3249
- if (a) {
3250
- let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);
3251
- e && (o = parseFloat(e[1]), s = parseFloat(e[2]), i.attr("class").includes("attribute-name") ? o += O : i.attr("class").includes("attribute-keys") ? o += O + k : i.attr("class").includes("attribute-comment") && (o += O + k + A));
3252
- }
3253
- i.attr("transform", `translate(${V + p / 2 + o}, ${s + H + w.height + h / 2})`);
3254
- }), S.select(".name").attr("transform", "translate(" + -w.width / 2 + ", " + (H + h / 2) + ")"), i != null && tn.has(i)) {
3255
- let e = r.colorIndex ?? 0;
3256
- S.attr("data-color-id", `color-${e % d.length}`);
3257
- }
3258
- let re = R.rectangle(V, H, B, ne, z), ie = S.insert(() => re, ":first-child").attr("class", "outer-path").attr("style", v.join(""));
3259
- E.push(0);
3260
- for (let [e, t] of D.entries()) {
3261
- let n = (e + 1) % 2 == 0 && t.yOffset !== 0, r = R.rectangle(V, w.height + H + t?.yOffset, B, t?.rowHeight, {
3262
- ...z,
3263
- fill: n ? o : c,
3264
- stroke: u
3265
- });
3266
- S.insert(() => r, "g.label").attr("style", v.join("")).attr("class", `row-rect-${n ? "even" : "odd"}`);
3267
- }
3268
- let U = 1e-4, W = on(V, w.height + H, B + V, w.height + H, U), G = R.polygon(W.map((e) => [e.x, e.y]), z);
3269
- if (S.insert(() => G).attr("class", "divider"), W = on(O + V, w.height + H, O + V, ne + H, U), G = R.polygon(W.map((e) => [e.x, e.y]), z), S.insert(() => G).attr("class", "divider"), M) {
3270
- let e = O + k + V;
3271
- W = on(e, w.height + H, e, ne + H, U), G = R.polygon(W.map((e) => [e.x, e.y]), z), S.insert(() => G).attr("class", "divider");
3272
- }
3273
- if (F) {
3274
- let e = O + k + A + V;
3275
- W = on(e, w.height + H, e, ne + H, U), G = R.polygon(W.map((e) => [e.x, e.y]), z), S.insert(() => G).attr("class", "divider");
3276
- }
3277
- for (let e of E) {
3278
- let t = w.height + H + e;
3279
- W = on(V, t, B + V, t, U), G = R.polygon(W.map((e) => [e.x, e.y]), z), S.insert(() => G).attr("class", "divider");
3280
- }
3281
- if (N(n, ie), b && n.look !== "handDrawn") {
3282
- if (i != null && nn.has(i)) S.selectAll("path").attr("style", b);
3283
- else {
3284
- let e = b.split(";")?.filter((e) => e.includes("stroke"))?.map((e) => `${e}`).join("; ");
3285
- S.selectAll("path").attr("style", e ?? ""), S.selectAll(".row-rect-even path").attr("style", b);
3286
- }
3287
- }
3288
- return n.intersect = function(e) {
3289
- return K.rect(n, e);
3290
- }, S;
3291
- }
3292
- n(rn, "erBox");
3293
- async function an(e, n, r, i = 0, o = 0, s = [], c = "") {
3294
- let u = e.insert("g").attr("class", `label ${s.join(" ")}`).attr("transform", `translate(${i}, ${o})`).attr("style", c);
3295
- n !== a(n) && (n = a(n), n = n.replaceAll("<", "&lt;").replaceAll(">", "&gt;"));
3296
- let d = u.node().appendChild(await x(u, n, {
3297
- width: m(n, r) + 100,
3298
- style: c,
3299
- useHtmlLabels: r.htmlLabels
3300
- }, r));
3301
- if (n.includes("&lt;") || n.includes("&gt;")) {
3302
- let e = d.children[0];
3303
- for (e.textContent = e.textContent.replaceAll("&lt;", "<").replaceAll("&gt;", ">"); e.childNodes[0];) e = e.childNodes[0], e.textContent = e.textContent.replaceAll("&lt;", "<").replaceAll("&gt;", ">");
3304
- }
3305
- let f = d.getBBox();
3306
- if (l(r.htmlLabels)) {
3307
- let e = d.children[0];
3308
- e.style.textAlign = "start";
3309
- let n = t(d);
3310
- f = e.getBoundingClientRect(), n.attr("width", f.width), n.attr("height", f.height);
3311
- }
3312
- return f;
3313
- }
3314
- n(an, "addText");
3315
- function on(e, t, n, r, i) {
3316
- return e === n ? [
3317
- {
3318
- x: e - i / 2,
3319
- y: t
3320
- },
3321
- {
3322
- x: e + i / 2,
3323
- y: t
3324
- },
3325
- {
3326
- x: n + i / 2,
3327
- y: r
3328
- },
3329
- {
3330
- x: n - i / 2,
3331
- y: r
3332
- }
3333
- ] : [
3334
- {
3335
- x: e,
3336
- y: t - i / 2
3337
- },
3338
- {
3339
- x: e,
3340
- y: t + i / 2
3341
- },
3342
- {
3343
- x: n,
3344
- y: r + i / 2
3345
- },
3346
- {
3347
- x: n,
3348
- y: r - i / 2
3349
- }
3350
- ];
3351
- }
3352
- n(on, "lineToPolygon");
3353
- async function sn(e, t, n, r, i = n.class.padding ?? 12) {
3354
- let a = r ? 0 : 3, o = e.insert("g").attr("class", P(t)).attr("id", t.domId || t.id), s = null, c = null, l = null, u = null, d = 0, f = 0, p = 0;
3355
- if (s = o.insert("g").attr("class", "annotation-group text"), t.annotations.length > 0) {
3356
- let e = t.annotations[0];
3357
- await cn(s, { text: `\xAB${e}\xBB` }, 0), d = s.node().getBBox().height;
3358
- }
3359
- c = o.insert("g").attr("class", "label-group text"), await cn(c, t, 0, ["font-weight: bolder"]);
3360
- let m = c.node().getBBox();
3361
- f = m.height, l = o.insert("g").attr("class", "members-group text");
3362
- let h = 0;
3363
- for (let e of t.members) {
3364
- let t = await cn(l, e, h, [e.parseClassifier()]);
3365
- h += t + a;
3366
- }
3367
- p = l.node().getBBox().height, p <= 0 && (p = i / 2), u = o.insert("g").attr("class", "methods-group text");
3368
- let g = 0;
3369
- for (let e of t.methods) {
3370
- let t = await cn(u, e, g, [e.parseClassifier()]);
3371
- g += t + a;
3372
- }
3373
- let _ = o.node().getBBox();
3374
- if (s !== null) {
3375
- let e = s.node().getBBox();
3376
- s.attr("transform", `translate(${-e.width / 2})`);
3377
- }
3378
- return c.attr("transform", `translate(${-m.width / 2}, ${d})`), _ = o.node().getBBox(), l.attr("transform", `translate(0, ${d + f + i * 2})`), _ = o.node().getBBox(), u.attr("transform", `translate(0, ${d + f + (p ? p + i * 4 : i * 2)})`), _ = o.node().getBBox(), {
3379
- shapeSvg: o,
3380
- bbox: _
3381
- };
3382
- }
3383
- n(sn, "textHelper");
3384
- async function cn(e, n, a, o = []) {
3385
- let c = e.insert("g").attr("class", "label").attr("style", o.join("; ")), u = s(), d = "useHtmlLabels" in n ? n.useHtmlLabels : l(u.htmlLabels) ?? !0, p = "";
3386
- p = "text" in n ? n.text : n.label, !d && p.startsWith("\\") && (p = p.substring(1)), r(p) && (d = !0);
3387
- let h = await x(c, i(f(p)), {
3388
- width: m(p, u) + 50,
3389
- classes: "markdown-node-label",
3390
- useHtmlLabels: d
3391
- }, u), g, _ = 1;
3392
- if (d) {
3393
- let e = h.children[0], n = t(h);
3394
- _ = e.innerHTML.split("<br>").length, e.innerHTML.includes("</math>") && (_ += e.innerHTML.split("<mrow>").length - 1), await E(e), g = e.getBoundingClientRect(), n.attr("width", g.width), n.attr("height", g.height);
3395
- } else {
3396
- o.includes("font-weight: bolder") && t(h).selectAll("tspan").attr("font-weight", ""), _ = h.children.length;
3397
- let e = h.children[0];
3398
- (h.textContent === "" || h.textContent.includes("&gt")) && (e.textContent = p[0] + p.substring(1).replaceAll("&gt;", ">").replaceAll("&lt;", "<").trim(), p[1] === " " && (e.textContent = e.textContent[0] + " " + e.textContent.substring(1))), e.textContent === "undefined" && (e.textContent = ""), g = h.getBBox();
3399
- }
3400
- return c.attr("transform", "translate(0," + (-g.height / (2 * _) + a) + ")"), g.height;
3401
- }
3402
- n(cn, "addText");
3403
- async function ln(e, n) {
3404
- let r = u(), { themeVariables: i } = r, { useGradient: a } = i, o = r.class.padding ?? 12, s = o, c = n.useHtmlLabels ?? l(r.htmlLabels) ?? !0, d = n;
3405
- d.annotations = d.annotations ?? [], d.members = d.members ?? [], d.methods = d.methods ?? [];
3406
- let { shapeSvg: f, bbox: p } = await sn(e, n, r, c, s), { labelStyles: m, nodeStyles: h } = _(n);
3407
- n.labelStyle = m, n.cssStyles = d.styles || "";
3408
- let v = d.styles?.join(";") || h || "";
3409
- n.cssStyles ||= v.replaceAll("!important", "").split(";");
3410
- let y = d.members.length === 0 && d.methods.length === 0 && !r.class?.hideEmptyMembersBox, b = C.svg(f), x = g(n, {});
3411
- n.look !== "handDrawn" && (x.roughness = 0, x.fillStyle = "solid");
3412
- let S = Math.max(n.width ?? 0, p.width), w = Math.max(n.height ?? 0, p.height), T = (n.height ?? 0) > p.height;
3413
- d.members.length === 0 && d.methods.length === 0 ? w += s : d.members.length > 0 && d.methods.length === 0 && (w += s * 2);
3414
- let E = -S / 2, D = -w / 2, O = y ? o * 2 : d.members.length === 0 && d.methods.length === 0 ? -o : 0;
3415
- T && (O = o * 2);
3416
- let k = b.rectangle(E - o, D - o - (y ? o : d.members.length === 0 && d.methods.length === 0 ? -o / 2 : 0), S + 2 * o, w + 2 * o + O, x), A = f.insert(() => k, ":first-child");
3417
- A.attr("class", "basic label-container outer-path");
3418
- let j = A.node().getBBox(), M = f.select(".annotation-group").node().getBBox().height - (y ? o / 2 : 0) || 0, P = f.select(".label-group").node().getBBox().height - (y ? o / 2 : 0) || 0, F = f.select(".members-group").node().getBBox().height - (y ? o / 2 : 0) || 0, I = (M + P + D + o - (D - o - (y ? o : d.members.length === 0 && d.methods.length === 0 ? -o / 2 : 0))) / 2;
3419
- if (f.selectAll(".text").each((e, n, i) => {
3420
- let a = t(i[n]), l = a.attr("transform"), u = 0;
3421
- if (l) {
3422
- let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(l);
3423
- e && (u = parseFloat(e[2]));
3424
- }
3425
- let p = u + D + o - (y ? o : d.members.length === 0 && d.methods.length === 0 ? -o / 2 : 0);
3426
- if (a.attr("class").includes("methods-group")) {
3427
- let e = Math.max(F, s / 2);
3428
- p = T ? Math.max(I, M + P + e + D + s * 2 + o) + s * 2 : M + P + e + D + s * 4 + o;
3429
- }
3430
- d.members.length === 0 && d.methods.length === 0 && r.class?.hideEmptyMembersBox && (p = d.annotations.length > 0 ? u - s : u), c || (p -= 4);
3431
- let m = E;
3432
- (a.attr("class").includes("label-group") || a.attr("class").includes("annotation-group")) && (m = -a.node()?.getBBox().width / 2 || 0, f.selectAll("text").each(function(e, t, n) {
3433
- window.getComputedStyle(n[t]).textAnchor === "middle" && (m = 0);
3434
- })), a.attr("transform", `translate(${m}, ${p})`);
3435
- }), d.members.length > 0 || d.methods.length > 0 || y) {
3436
- let e = M + P + D + o, t = b.line(j.x, e, j.x + j.width, e + .001, x);
3437
- f.insert(() => t).attr("class", `divider${n.look === "neo" && !a ? " neo-line" : ""}`).attr("style", v);
3438
- }
3439
- if (y || d.members.length > 0 || d.methods.length > 0) {
3440
- let e = M + P + F + D + s * 2 + o, t = b.line(j.x, T ? Math.max(I, e) : e, j.x + j.width, (T ? Math.max(I, e) : e) + .001, x);
3441
- f.insert(() => t).attr("class", `divider${n.look === "neo" && !a ? " neo-line" : ""}`).attr("style", v);
3442
- }
3443
- if (d.look !== "handDrawn" && f.selectAll("path").attr("style", v), A.select(":nth-child(2)").attr("style", v), f.selectAll(".divider").select("path").attr("style", v), n.labelStyle ? f.selectAll("span").attr("style", n.labelStyle) : f.selectAll("span").attr("style", v), !c) {
3444
- let e = RegExp(/color\s*:\s*([^;]*)/), t = e.exec(v);
3445
- if (t) {
3446
- let e = t[0].replace("color", "fill");
3447
- f.selectAll("tspan").attr("style", e);
3448
- } else if (m) {
3449
- let t = e.exec(m);
3450
- if (t) {
3451
- let e = t[0].replace("color", "fill");
3452
- f.selectAll("tspan").attr("style", e);
3453
- }
3454
- }
3455
- }
3456
- return N(n, A), n.intersect = function(e) {
3457
- return K.rect(n, e);
3458
- }, f;
3459
- }
3460
- n(ln, "classBox");
3461
- async function un(e, n) {
3462
- let { labelStyles: r, nodeStyles: i } = _(n);
3463
- n.labelStyle = r;
3464
- let a = n, o = n, s = "verifyMethod" in n, c = P(n), l = u(), { themeVariables: d } = l, { borderColorArray: f, requirementEdgeLabelBackground: p } = d, m = l.layout === "elk" ? "start" : "center", h = e.insert("g").attr("class", c).attr("id", n.domId ?? n.id), v;
3465
- v = s ? await $(h, `&lt;&lt;${a.type}&gt;&gt;`, 0, n.labelStyle) : await $(h, "&lt;&lt;Element&gt;&gt;", 0, n.labelStyle);
3466
- let y = v, b = await $(h, a.name, y, n.labelStyle + "; font-weight: bold;");
3467
- if (y += b + 20, s) {
3468
- let e = await $(h, `${a.requirementId ? `ID: ${a.requirementId}` : ""}`, y, n.labelStyle, m);
3469
- y += e;
3470
- let t = await $(h, `${a.text ? `Text: ${a.text}` : ""}`, y, n.labelStyle, m);
3471
- y += t;
3472
- let r = await $(h, `${a.risk ? `Risk: ${a.risk}` : ""}`, y, n.labelStyle, m);
3473
- y += r, await $(h, `${a.verifyMethod ? `Verification: ${a.verifyMethod}` : ""}`, y, n.labelStyle, m);
3474
- } else {
3475
- let e = await $(h, `${o.type ? `Type: ${o.type}` : ""}`, y, n.labelStyle, m);
3476
- y += e, await $(h, `${o.docRef ? `Doc Ref: ${o.docRef}` : ""}`, y, n.labelStyle, m);
3477
- }
3478
- let x = (h.node()?.getBBox().width ?? 200) + 20, S = (h.node()?.getBBox().height ?? 200) + 20, w = -x / 2, T = -S / 2, E = C.svg(h), D = g(n, {});
3479
- n.look !== "handDrawn" && (D.roughness = 0, D.fillStyle = "solid");
3480
- let O = E.rectangle(w, T, x, S, D), k = h.insert(() => O, ":first-child");
3481
- if (k.attr("class", "basic label-container outer-path").attr("style", i), f?.length) {
3482
- let e = n.colorIndex ?? 0;
3483
- h.attr("data-color-id", `color-${e % f.length}`);
3484
- }
3485
- if (h.selectAll(".label").each((e, n, r) => {
3486
- let i = t(r[n]), a = i.attr("transform"), o = 0, s = 0;
3487
- if (a) {
3488
- let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);
3489
- e && (o = parseFloat(e[1]), s = parseFloat(e[2]));
3490
- }
3491
- let c = s - S / 2, l = w + 10;
3492
- (n === 0 || n === 1) && (l = o), i.attr("transform", `translate(${l}, ${c + 20})`);
3493
- }), y > v + b + 20) {
3494
- let e = T + v + b + 20, t;
3495
- if (n.look === "neo") {
3496
- let n = .001, r = [
3497
- [w, e],
3498
- [w + x, e],
3499
- [w + x, e + n],
3500
- [w, e + n]
3501
- ];
3502
- t = E.polygon(r, D);
3503
- } else t = E.line(w, e, w + x, e, D);
3504
- h.insert(() => t).attr("class", "divider");
3505
- }
3506
- return N(n, k), n.intersect = function(e) {
3507
- return K.rect(n, e);
3508
- }, i && n.look !== "handDrawn" && (p || f?.length) && h.selectAll("path").attr("style", i), h;
3509
- }
3510
- n(un, "requirementBox");
3511
- async function $(e, n, r, a = "", o = "center") {
3512
- if (n === "") return 0;
3513
- let s = e.insert("g").attr("class", "label").attr("style", a), c = u(), l = c.htmlLabels ?? !0, d = await x(s, i(f(n)), {
3514
- width: m(n, c) + 50,
3515
- classes: "markdown-node-label",
3516
- useHtmlLabels: l,
3517
- style: a
3518
- }, c), p;
3519
- if (l) {
3520
- let e = d.children[0], n = t(d);
3521
- o === "start" && t(e).style("text-align", "left"), p = e.getBoundingClientRect(), n.attr("width", p.width), n.attr("height", p.height);
3522
- } else {
3523
- let e = d.children[0];
3524
- for (let t of e.children) a && t.setAttribute("style", a);
3525
- if (o === "start") {
3526
- e.setAttribute("text-anchor", "start");
3527
- for (let t of e.children) t.setAttribute("text-anchor", "start");
3528
- }
3529
- p = d.getBBox(), p.height += 6;
3530
- }
3531
- return s.attr("transform", `translate(${-p.width / 2},${-p.height / 2 + r})`), p.height;
3532
- }
3533
- n($, "addText");
3534
- var dn = /* @__PURE__ */ n((e) => {
3535
- switch (e) {
3536
- case "Very High": return "red";
3537
- case "High": return "orange";
3538
- case "Medium": return null;
3539
- case "Low": return "blue";
3540
- case "Very Low": return "lightblue";
3541
- }
3542
- }, "colorFromPriority");
3543
- async function fn(e, t, { config: n }) {
3544
- let { labelStyles: r, nodeStyles: i } = _(t);
3545
- t.labelStyle = r || "";
3546
- let a = t.width;
3547
- t.width = (t.width ?? 200) - 10;
3548
- let { shapeSvg: o, bbox: s, label: c } = await j(e, t, P(t)), l = t.padding || 10, u = "", d;
3549
- "ticket" in t && t.ticket && n?.kanban?.ticketBaseUrl && (u = n?.kanban?.ticketBaseUrl.replace("#TICKET#", t.ticket), d = o.insert("svg:a", ":first-child").attr("class", "kanban-ticket-link").attr("xlink:href", u).attr("target", "_blank"));
3550
- let f = {
3551
- useHtmlLabels: t.useHtmlLabels,
3552
- labelStyle: t.labelStyle || "",
3553
- width: t.width,
3554
- img: t.img,
3555
- padding: t.padding || 8,
3556
- centerLabel: !1
3557
- }, p, m;
3558
- d ? {label: p, bbox: m} = await M(d, "ticket" in t && t.ticket || "", f) : {label: p, bbox: m} = await M(o, "ticket" in t && t.ticket || "", f);
3559
- let { label: h, bbox: v } = await M(o, "assigned" in t && t.assigned || "", f);
3560
- t.width = a;
3561
- let y = t?.width || 0, b = Math.max(m.height, v.height) / 2, x = Math.max(s.height + 20, t?.height || 0) + b, S = -y / 2, w = -x / 2;
3562
- c.attr("transform", "translate(" + (l - y / 2) + ", " + (-b - s.height / 2) + ")"), p.attr("transform", "translate(" + (l - y / 2) + ", " + (-b + s.height / 2) + ")"), h.attr("transform", "translate(" + (l + y / 2 - v.width - 20) + ", " + (-b + s.height / 2) + ")");
3563
- let T, { rx: E, ry: D } = t, { cssStyles: O } = t;
3564
- if (t.look === "handDrawn") {
3565
- let e = C.svg(o), n = g(t, {}), r = E || D ? e.path(z(S, w, y, x, E || 0), n) : e.rectangle(S, w, y, x, n);
3566
- T = o.insert(() => r, ":first-child"), T.attr("class", "basic label-container").attr("style", O || null);
3567
- } else {
3568
- T = o.insert("rect", ":first-child"), T.attr("class", "basic label-container __APA__").attr("style", i).attr("rx", E ?? 5).attr("ry", D ?? 5).attr("x", S).attr("y", w).attr("width", y).attr("height", x);
3569
- let e = "priority" in t && t.priority;
3570
- if (e) {
3571
- let t = o.append("line"), n = S + 2, r = w + Math.floor((E ?? 0) / 2), i = w + x - Math.floor((E ?? 0) / 2);
3572
- t.attr("x1", n).attr("y1", r).attr("x2", n).attr("y2", i).attr("stroke-width", "4").attr("stroke", dn(e));
3573
- }
3574
- }
3575
- return N(t, T), t.height = x, t.intersect = function(e) {
3576
- return K.rect(t, e);
3577
- }, o;
3578
- }
3579
- n(fn, "kanbanItem");
3580
- async function pn(t, n) {
3581
- let { labelStyles: r, nodeStyles: i } = _(n);
3582
- n.labelStyle = r;
3583
- let { shapeSvg: a, bbox: o, halfPadding: s, label: c } = await j(t, n, P(n)), l = o.width + 10 * s, u = o.height + 8 * s, d = .15 * l, { cssStyles: f } = n, p = o.width + 20, m = o.height + 20, v = Math.max(l, p), y = Math.max(u, m);
3584
- c.attr("transform", `translate(${-o.width / 2}, ${-o.height / 2})`);
3585
- let b, x = `M0 0
3586
- a${d},${d} 1 0,0 ${v * .25},${-1 * y * .1}
3587
- a${d},${d} 1 0,0 ${v * .25},0
3588
- a${d},${d} 1 0,0 ${v * .25},0
3589
- a${d},${d} 1 0,0 ${v * .25},${y * .1}
3590
-
3591
- a${d},${d} 1 0,0 ${v * .15},${y * .33}
3592
- a${d * .8},${d * .8} 1 0,0 0,${y * .34}
3593
- a${d},${d} 1 0,0 ${-1 * v * .15},${y * .33}
3594
-
3595
- a${d},${d} 1 0,0 ${-1 * v * .25},${y * .15}
3596
- a${d},${d} 1 0,0 ${-1 * v * .25},0
3597
- a${d},${d} 1 0,0 ${-1 * v * .25},0
3598
- a${d},${d} 1 0,0 ${-1 * v * .25},${-1 * y * .15}
3599
-
3600
- a${d},${d} 1 0,0 ${-1 * v * .1},${-1 * y * .33}
3601
- a${d * .8},${d * .8} 1 0,0 0,${-1 * y * .34}
3602
- a${d},${d} 1 0,0 ${v * .1},${-1 * y * .33}
3603
- H0 V0 Z`;
3604
- if (n.look === "handDrawn") {
3605
- let e = C.svg(a), t = g(n, {}), r = e.path(x, t);
3606
- b = a.insert(() => r, ":first-child"), b.attr("class", "basic label-container").attr("style", h(f));
3607
- } else b = a.insert("path", ":first-child").attr("class", "basic label-container").attr("style", i).attr("d", x);
3608
- return b.attr("transform", `translate(${-v / 2}, ${-y / 2})`), N(n, b), n.calcIntersect = function(e, t) {
3609
- return K.rect(e, t);
3610
- }, n.intersect = function(t) {
3611
- return e.info("Bang intersect", n, t), K.rect(n, t);
3612
- }, a;
3613
- }
3614
- n(pn, "bang");
3615
- async function mn(t, n) {
3616
- let { labelStyles: r, nodeStyles: i } = _(n);
3617
- n.labelStyle = r;
3618
- let { shapeSvg: a, bbox: o, halfPadding: s, label: c } = await j(t, n, P(n)), l = o.width + 2 * s, u = o.height + 2 * s, d = .15 * l, f = .25 * l, p = .35 * l, m = .2 * l, { cssStyles: v } = n, y, b = `M0 0
3619
- a${d},${d} 0 0,1 ${l * .25},${-1 * l * .1}
3620
- a${p},${p} 1 0,1 ${l * .4},${-1 * l * .1}
3621
- a${f},${f} 1 0,1 ${l * .35},${l * .2}
3622
-
3623
- a${d},${d} 1 0,1 ${l * .15},${u * .35}
3624
- a${m},${m} 1 0,1 ${-1 * l * .15},${u * .65}
3625
-
3626
- a${f},${d} 1 0,1 ${-1 * l * .25},${l * .15}
3627
- a${p},${p} 1 0,1 ${-1 * l * .5},0
3628
- a${d},${d} 1 0,1 ${-1 * l * .25},${-1 * l * .15}
3629
-
3630
- a${d},${d} 1 0,1 ${-1 * l * .1},${-1 * u * .35}
3631
- a${m},${m} 1 0,1 ${l * .1},${-1 * u * .65}
3632
- H0 V0 Z`;
3633
- if (n.look === "handDrawn") {
3634
- let e = C.svg(a), t = g(n, {}), r = e.path(b, t);
3635
- y = a.insert(() => r, ":first-child"), y.attr("class", "basic label-container").attr("style", h(v));
3636
- } else y = a.insert("path", ":first-child").attr("class", "basic label-container").attr("style", i).attr("d", b);
3637
- return c.attr("transform", `translate(${-o.width / 2}, ${-o.height / 2})`), y.attr("transform", `translate(${-l / 2}, ${-u / 2})`), N(n, y), n.calcIntersect = function(e, t) {
3638
- return K.rect(e, t);
3639
- }, n.intersect = function(t) {
3640
- return e.info("Cloud intersect", n, t), K.rect(n, t);
3641
- }, a;
3642
- }
3643
- n(mn, "cloud");
3644
- async function hn(e, t) {
3645
- let { labelStyles: n, nodeStyles: r } = _(t);
3646
- t.labelStyle = n;
3647
- let { shapeSvg: i, bbox: a, halfPadding: o, label: s } = await j(e, t, P(t)), c = a.width + 8 * o, l = a.height + 2 * o, u = t.look === "neo" ? `
3648
- M${-c / 2} ${l / 2 - 5}
3649
- v${-l + 10}
3650
- q0,-5 5,-5
3651
- h${c - 10}
3652
- q5,0 5,5
3653
- v${l - 5}
3654
- H${-c / 2}
3655
- Z
3656
- ` : `
3657
- M${-c / 2} ${l / 2 - 5}
3658
- v${-l + 10}
3659
- q0,-5 5,-5
3660
- h${c - 10}
3661
- q5,0 5,5
3662
- v${l - 10}
3663
- q0,5 -5,5
3664
- h${-(c - 10)}
3665
- q-5,0 -5,-5
3666
- Z
3667
- `;
3668
- if (!t.domId) throw Error(`defaultMindmapNode: node "${t.id}" is missing a domId \u2014 was render.ts domId prefixing skipped?`);
3669
- let d = i.append("path").attr("id", t.domId).attr("class", "node-bkg node-" + t.type).attr("style", r).attr("d", u);
3670
- return i.append("line").attr("class", "node-line-").attr("x1", -c / 2).attr("y1", l / 2).attr("x2", c / 2).attr("y2", l / 2), s.attr("transform", `translate(${-a.width / 2}, ${-a.height / 2})`), i.append(() => s.node()), N(t, d), t.calcIntersect = function(e, t) {
3671
- return K.rect(e, t);
3672
- }, t.intersect = function(e) {
3673
- return K.rect(t, e);
3674
- }, i;
3675
- }
3676
- n(hn, "defaultMindmapNode");
3677
- async function gn(e, t) {
3678
- return De(e, t, { padding: t.padding ?? 0 });
3679
- }
3680
- n(gn, "mindmapCircle");
3681
- var _n = [
3682
- {
3683
- semanticName: "Process",
3684
- name: "Rectangle",
3685
- shortName: "rect",
3686
- description: "Standard process shape",
3687
- aliases: [
3688
- "proc",
3689
- "process",
3690
- "rectangle"
3691
- ],
3692
- internalAliases: ["squareRect"],
3693
- handler: At
3694
- },
3695
- {
3696
- semanticName: "Event",
3697
- name: "Rounded Rectangle",
3698
- shortName: "rounded",
3699
- description: "Represents an event",
3700
- aliases: ["event"],
3701
- internalAliases: ["roundedRect"],
3702
- handler: Dt
3703
- },
3704
- {
3705
- semanticName: "Terminal Point",
3706
- name: "Stadium",
3707
- shortName: "stadium",
3708
- description: "Terminal point",
3709
- aliases: ["terminal", "pill"],
3710
- handler: jt
3711
- },
3712
- {
3713
- semanticName: "Subprocess",
3714
- name: "Framed Rectangle",
3715
- shortName: "fr-rect",
3716
- description: "Subprocess",
3717
- aliases: [
3718
- "subprocess",
3719
- "subproc",
3720
- "framed-rectangle",
3721
- "subroutine"
3722
- ],
3723
- handler: It
3724
- },
3725
- {
3726
- semanticName: "Database",
3727
- name: "Cylinder",
3728
- shortName: "cyl",
3729
- description: "Database storage",
3730
- aliases: [
3731
- "db",
3732
- "database",
3733
- "cylinder"
3734
- ],
3735
- handler: He
3736
- },
3737
- {
3738
- semanticName: "Data Store",
3739
- name: "Data Store",
3740
- shortName: "datastore",
3741
- description: "Data flow diagram data store",
3742
- aliases: ["data-store"],
3743
- handler: We
3744
- },
3745
- {
3746
- semanticName: "Folder",
3747
- name: "Folder",
3748
- shortName: "folder",
3749
- description: "Folder or directory",
3750
- aliases: ["directory"],
3751
- handler: Ze
3752
- },
3753
- {
3754
- semanticName: "Bucket",
3755
- name: "Bucket",
3756
- shortName: "bucket",
3757
- description: "Object storage bucket",
3758
- handler: ue
3759
- },
3760
- {
3761
- semanticName: "Console",
3762
- name: "Console (terminal window)",
3763
- shortName: "console",
3764
- description: "Terminal or console window",
3765
- handler: ke
3766
- },
3767
- {
3768
- semanticName: "Browser",
3769
- name: "Browser",
3770
- shortName: "browser",
3771
- description: "Browser window",
3772
- handler: Ce
3773
- },
3774
- {
3775
- semanticName: "Person",
3776
- name: "Person",
3777
- shortName: "person",
3778
- description: "Person (circular head above a rounded body)",
3779
- handler: Ie
3780
- },
3781
- {
3782
- semanticName: "Start",
3783
- name: "Circle",
3784
- shortName: "circle",
3785
- description: "Starting point",
3786
- aliases: ["circ"],
3787
- handler: De
3788
- },
3789
- {
3790
- semanticName: "Bang",
3791
- name: "Bang",
3792
- shortName: "bang",
3793
- description: "Bang",
3794
- aliases: ["bang"],
3795
- handler: pn
3796
- },
3797
- {
3798
- semanticName: "Cloud",
3799
- name: "Cloud",
3800
- shortName: "cloud",
3801
- description: "cloud",
3802
- aliases: ["cloud"],
3803
- handler: mn
3804
- },
3805
- {
3806
- semanticName: "Decision",
3807
- name: "Diamond",
3808
- shortName: "diam",
3809
- description: "Decision-making step",
3810
- aliases: [
3811
- "decision",
3812
- "diamond",
3813
- "question"
3814
- ],
3815
- handler: wt
3816
- },
3817
- {
3818
- semanticName: "Prepare Conditional",
3819
- name: "Hexagon",
3820
- shortName: "hex",
3821
- description: "Preparation or condition step",
3822
- aliases: ["hexagon", "prepare"],
3823
- handler: tt
3824
- },
3825
- {
3826
- semanticName: "Data Input/Output",
3827
- name: "Lean Right",
3828
- shortName: "lean-r",
3829
- description: "Represents input or output",
3830
- aliases: ["lean-right", "in-out"],
3831
- internalAliases: ["lean_right"],
3832
- handler: dt
3833
- },
3834
- {
3835
- semanticName: "Data Input/Output",
3836
- name: "Lean Left",
3837
- shortName: "lean-l",
3838
- description: "Represents output or input",
3839
- aliases: ["lean-left", "out-in"],
3840
- internalAliases: ["lean_left"],
3841
- handler: ut
3842
- },
3843
- {
3844
- semanticName: "Priority Action",
3845
- name: "Trapezoid Base Bottom",
3846
- shortName: "trap-b",
3847
- description: "Priority action",
3848
- aliases: [
3849
- "priority",
3850
- "trapezoid-bottom",
3851
- "trapezoid"
3852
- ],
3853
- handler: qt
3854
- },
3855
- {
3856
- semanticName: "Manual Operation",
3857
- name: "Trapezoid Base Top",
3858
- shortName: "trap-t",
3859
- description: "Represents a manual task",
3860
- aliases: [
3861
- "manual",
3862
- "trapezoid-top",
3863
- "inv-trapezoid"
3864
- ],
3865
- internalAliases: ["inv_trapezoid"],
3866
- handler: ct
3867
- },
3868
- {
3869
- semanticName: "Stop",
3870
- name: "Double Circle",
3871
- shortName: "dbl-circ",
3872
- description: "Represents a stop point",
3873
- aliases: ["double-circle"],
3874
- internalAliases: ["doublecircle"],
3875
- handler: Ke
3876
- },
3877
- {
3878
- semanticName: "Text Block",
3879
- name: "Text Block",
3880
- shortName: "text",
3881
- description: "Text block",
3882
- handler: Bt
3883
- },
3884
- {
3885
- semanticName: "Card",
3886
- name: "Notched Rectangle",
3887
- shortName: "notch-rect",
3888
- description: "Represents a card",
3889
- aliases: ["card", "notched-rectangle"],
3890
- handler: Te
3891
- },
3892
- {
3893
- semanticName: "Lined/Shaded Process",
3894
- name: "Lined Rectangle",
3895
- shortName: "lin-rect",
3896
- description: "Lined process shape",
3897
- aliases: [
3898
- "lined-rectangle",
3899
- "lined-process",
3900
- "lin-proc",
3901
- "shaded-process"
3902
- ],
3903
- handler: Ot
3904
- },
3905
- {
3906
- semanticName: "Start",
3907
- name: "Small Circle",
3908
- shortName: "sm-circ",
3909
- description: "Small starting point",
3910
- aliases: ["start", "small-circle"],
3911
- internalAliases: ["stateStart"],
3912
- handler: Pt
3913
- },
3914
- {
3915
- semanticName: "Stop",
3916
- name: "Framed Circle",
3917
- shortName: "fr-circ",
3918
- description: "Stop point",
3919
- aliases: ["stop", "framed-circle"],
3920
- internalAliases: ["stateEnd"],
3921
- handler: Nt
3922
- },
3923
- {
3924
- semanticName: "Fork/Join",
3925
- name: "Filled Rectangle",
3926
- shortName: "fork",
3927
- description: "Fork or join in process flow",
3928
- aliases: ["join"],
3929
- internalAliases: ["forkJoin"],
3930
- handler: Qe
3931
- },
3932
- {
3933
- semanticName: "Collate",
3934
- name: "Hourglass",
3935
- shortName: "hourglass",
3936
- description: "Represents a collate operation",
3937
- aliases: ["hourglass", "collate"],
3938
- handler: nt
3939
- },
3940
- {
3941
- semanticName: "Comment",
3942
- name: "Curly Brace",
3943
- shortName: "brace",
3944
- description: "Adds a comment",
3945
- aliases: ["comment", "brace-l"],
3946
- handler: Me
3947
- },
3948
- {
3949
- semanticName: "Comment Right",
3950
- name: "Curly Brace",
3951
- shortName: "brace-r",
3952
- description: "Adds a comment",
3953
- handler: Ne
3954
- },
3955
- {
3956
- semanticName: "Comment with braces on both sides",
3957
- name: "Curly Braces",
3958
- shortName: "braces",
3959
- description: "Adds a comment",
3960
- handler: Pe
3961
- },
3962
- {
3963
- semanticName: "Com Link",
3964
- name: "Lightning Bolt",
3965
- shortName: "bolt",
3966
- description: "Communication link",
3967
- aliases: ["com-link", "lightning-bolt"],
3968
- handler: ft
3969
- },
3970
- {
3971
- semanticName: "Document",
3972
- name: "Document",
3973
- shortName: "doc",
3974
- description: "Represents a document",
3975
- aliases: ["doc", "document"],
3976
- handler: Qt
3977
- },
3978
- {
3979
- semanticName: "Delay",
3980
- name: "Half-Rounded Rectangle",
3981
- shortName: "delay",
3982
- description: "Represents a delay",
3983
- aliases: ["half-rounded-rectangle"],
3984
- handler: $e
3985
- },
3986
- {
3987
- semanticName: "Direct Access Storage",
3988
- name: "Horizontal Cylinder",
3989
- shortName: "h-cyl",
3990
- description: "Direct access storage",
3991
- aliases: ["das", "horizontal-cylinder"],
3992
- handler: Kt
3993
- },
3994
- {
3995
- semanticName: "Disk Storage",
3996
- name: "Lined Cylinder",
3997
- shortName: "lin-cyl",
3998
- description: "Disk storage",
3999
- aliases: ["disk", "lined-cylinder"],
4000
- handler: vt
4001
- },
4002
- {
4003
- semanticName: "Display",
4004
- name: "Curved Trapezoid",
4005
- shortName: "curv-trap",
4006
- description: "Represents a display",
4007
- aliases: ["curved-trapezoid", "display"],
4008
- handler: Fe
4009
- },
4010
- {
4011
- semanticName: "Divided Process",
4012
- name: "Divided Rectangle",
4013
- shortName: "div-rect",
4014
- description: "Divided process shape",
4015
- aliases: [
4016
- "div-proc",
4017
- "divided-rectangle",
4018
- "divided-process"
4019
- ],
4020
- handler: Ge
4021
- },
4022
- {
4023
- semanticName: "Extract",
4024
- name: "Triangle",
4025
- shortName: "tri",
4026
- description: "Extraction process",
4027
- aliases: ["extract", "triangle"],
4028
- handler: Zt
4029
- },
4030
- {
4031
- semanticName: "Internal Storage",
4032
- name: "Window Pane",
4033
- shortName: "win-pane",
4034
- description: "Internal storage",
4035
- aliases: ["internal-storage", "window-pane"],
4036
- handler: en
4037
- },
4038
- {
4039
- semanticName: "Junction",
4040
- name: "Filled Circle",
4041
- shortName: "f-circ",
4042
- description: "Junction point",
4043
- aliases: ["junction", "filled-circle"],
4044
- handler: qe
4045
- },
4046
- {
4047
- semanticName: "Loop Limit",
4048
- name: "Trapezoidal Pentagon",
4049
- shortName: "notch-pent",
4050
- description: "Loop limit step",
4051
- aliases: ["loop-limit", "notched-pentagon"],
4052
- handler: Jt
4053
- },
4054
- {
4055
- semanticName: "Manual File",
4056
- name: "Flipped Triangle",
4057
- shortName: "flip-tri",
4058
- description: "Manual file operation",
4059
- aliases: ["manual-file", "flipped-triangle"],
4060
- handler: Xe
4061
- },
4062
- {
4063
- semanticName: "Manual Input",
4064
- name: "Sloped Rectangle",
4065
- shortName: "sl-rect",
4066
- description: "Manual input step",
4067
- aliases: ["manual-input", "sloped-rectangle"],
4068
- handler: kt
4069
- },
4070
- {
4071
- semanticName: "Multi-Document",
4072
- name: "Stacked Document",
4073
- shortName: "docs",
4074
- description: "Multiple documents",
4075
- aliases: [
4076
- "documents",
4077
- "st-doc",
4078
- "stacked-document"
4079
- ],
4080
- handler: xt
4081
- },
4082
- {
4083
- semanticName: "Multi-Process",
4084
- name: "Stacked Rectangle",
4085
- shortName: "st-rect",
4086
- description: "Multiple processes",
4087
- aliases: [
4088
- "procs",
4089
- "processes",
4090
- "stacked-rectangle"
4091
- ],
4092
- handler: bt
4093
- },
4094
- {
4095
- semanticName: "Stored Data",
4096
- name: "Bow Tie Rectangle",
4097
- shortName: "bow-rect",
4098
- description: "Stored data",
4099
- aliases: ["stored-data", "bow-tie-rectangle"],
4100
- handler: le
4101
- },
4102
- {
4103
- semanticName: "Summary",
4104
- name: "Crossed Circle",
4105
- shortName: "cross-circ",
4106
- description: "Summary",
4107
- aliases: ["summary", "crossed-circle"],
4108
- handler: je
4109
- },
4110
- {
4111
- semanticName: "Tagged Document",
4112
- name: "Tagged Document",
4113
- shortName: "tag-doc",
4114
- description: "Tagged document",
4115
- aliases: ["tag-doc", "tagged-document"],
4116
- handler: zt
4117
- },
4118
- {
4119
- semanticName: "Tagged Process",
4120
- name: "Tagged Rectangle",
4121
- shortName: "tag-rect",
4122
- description: "Tagged process",
4123
- aliases: [
4124
- "tagged-rectangle",
4125
- "tag-proc",
4126
- "tagged-process"
4127
- ],
4128
- handler: Rt
4129
- },
4130
- {
4131
- semanticName: "Paper Tape",
4132
- name: "Flag",
4133
- shortName: "flag",
4134
- description: "Paper tape",
4135
- aliases: ["paper-tape"],
4136
- handler: $t
4137
- },
4138
- {
4139
- semanticName: "Odd",
4140
- name: "Odd",
4141
- shortName: "odd",
4142
- description: "Odd shape",
4143
- internalAliases: ["rect_left_inv_arrow"],
4144
- handler: Tt
4145
- },
4146
- {
4147
- semanticName: "Lined Document",
4148
- name: "Lined Document",
4149
- shortName: "lin-doc",
4150
- description: "Lined document",
4151
- aliases: ["lined-document"],
4152
- handler: yt
4153
- }
4154
- ], vn = (/* @__PURE__ */ n(() => {
4155
- let e = [...Object.entries({
4156
- state: Mt,
4157
- choice: Ee,
4158
- note: St,
4159
- composite: Oe,
4160
- rectWithTitle: Et,
4161
- labelRect: lt,
4162
- block_arrow: Se,
4163
- collapsedGroup: he,
4164
- iconSquare: ot,
4165
- iconCircle: it,
4166
- icon: rt,
4167
- iconRounded: at,
4168
- imageSquare: st,
4169
- anchor: oe,
4170
- kanbanItem: fn,
4171
- mindmapCircle: gn,
4172
- defaultMindmapNode: hn,
4173
- classBox: ln,
4174
- erBox: rn,
4175
- requirementBox: un
4176
- }), ..._n.flatMap((e) => [
4177
- e.shortName,
4178
- ..."aliases" in e ? e.aliases : [],
4179
- ..."internalAliases" in e ? e.internalAliases : []
4180
- ].map((t) => [t, e.handler]))];
4181
- return Object.fromEntries(e);
4182
- }, "generateShapeMap"))();
4183
- function yn(e) {
4184
- return e in vn;
4185
- }
4186
- n(yn, "isValidShape");
4187
- //#endregion
4188
- export { j as a, yn as i, z as n, vn as o, R as r, N as s, te as t };