@marimo-team/islands 0.24.3-dev9 → 0.25.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 (440) hide show
  1. package/dist/{ConnectedDataExplorerComponent-C9OF_75w.js → ConnectedDataExplorerComponent-KVhjDMSe.js} +1066 -1066
  2. package/dist/ErrorBoundary-DnNkbB_U.js +200 -0
  3. package/dist/{ImageComparisonComponent-2a9TMMm2.js → ImageComparisonComponent-Dlm5aWnH.js} +4 -4
  4. package/dist/{Plot-C-9MQeGP.js → Plot-CTyjbQDT.js} +21032 -20666
  5. package/dist/_baseMerge-BiGRwuqv.js +165 -0
  6. package/dist/{abnfDiagram-N423BO3Z-CQKwzX8t.js → abnfDiagram-VCTEODGH-CpN0FRda.js} +17 -18
  7. package/dist/{any-language-editor-DmQ7dyCx.js → any-language-editor-CycIVIeP.js} +17 -17
  8. package/dist/arc-7ra3iNdN.js +81 -0
  9. package/dist/architecture-7GRP2DOG-BWLylgiA.js +3 -0
  10. package/dist/{architectureDiagram-T3A2C74G-CncrDpfa.js → architectureDiagram-5GKGNRK7-DDyj5SRB.js} +25 -25
  11. package/dist/assets/__vite-browser-external-C9iR87Zl.js +1 -0
  12. package/dist/assets/worker-D7hWi02M.js +109 -0
  13. package/dist/blockDiagram-I7D4REHJ-BbXEXJRu.js +1922 -0
  14. package/dist/{button-CKBkqR9J.js → button-DdXAm8iz.js} +5 -5
  15. package/dist/{c4Diagram-5PPSVZJV-DarUk3Yq.js → c4Diagram-7LVT6UL2-DcLsbQmR.js} +696 -668
  16. package/dist/{capabilities-CMBBJTcc.js → capabilities-B3ce_GNu.js} +1 -1
  17. package/dist/{html-to-image-BtFMe_Nq.js → cells-DYIkSxs6.js} +6757 -10137
  18. package/dist/{channel-CyiYUzJv.js → channel-B5XnTarr.js} +1 -1
  19. package/dist/chat-ui-BXj3uYjy.js +5786 -0
  20. package/dist/{check-CHig47QV.js → check-B7cIK6gb.js} +1 -1
  21. package/dist/{chunk-2Q5K7J3B-BMuJl2jB.js → chunk-2Q5K7J3B-BMkUkeuy.js} +2 -2
  22. package/dist/chunk-4HAMMTFA-D2qv8E0X.js +4188 -0
  23. package/dist/{chunk-5VM5RSS4-Bcq0ftdy.js → chunk-5VM5RSS4-DKsmPCL6.js} +2 -2
  24. package/dist/{chunk-NSK5VX7P-CDTMcJB0.js → chunk-75Z2AOVW-5_HsvXwr.js} +23 -23
  25. package/dist/{chunk-I66GZJ75-BqyTCAPf.js → chunk-DU6HZSFF-BUgAHvnM.js} +21 -4
  26. package/dist/{chunk-2GRJ4B5K-DgO8Qudq.js → chunk-F27PBJKO-DHmYWZXr.js} +4 -4
  27. package/dist/{chunk-KEIR6QF5-C4KX3XYh.js → chunk-FOHPRMQF-BpYR8RqP.js} +4 -4
  28. package/dist/{chunk-WRU74C26-BpWsbiDK.js → chunk-GMAD6QVW-Czynz8aA.js} +486 -258
  29. package/dist/chunk-GVQU2GXP-yQEdulRS.js +37 -0
  30. package/dist/{chunk-5RXB4S5H-tLNUVDdO.js → chunk-IMKFNOWR-BfwTebD0.js} +11 -11
  31. package/dist/{chunk-JWPE2WC7-BJwjGUnF.js → chunk-JWPE2WC7-DJvv1t8U.js} +2 -2
  32. package/dist/chunk-L3NEJ4N5-DwRWnDDK.js +245 -0
  33. package/dist/{chunk-7Z6QIM7H-Dc18hFxH.js → chunk-OSK3NFVY-BBKU_Ign.js} +222 -144
  34. package/dist/{chunk-W5SLKNZC-DLnvpEtV.js → chunk-P2QGCYS3-C0iGU29N.js} +20 -20
  35. package/dist/{chunk-KBJHAD2P-BuqWqkcW.js → chunk-POPQ4Y6H-BCbS3Ozc.js} +4 -4
  36. package/dist/{chunk-4I5QYGJK-DpytHuZQ.js → chunk-PWAF6VOD-CTFCL0jI.js} +4 -4
  37. package/dist/{chunk-JQJVKLGR-CgqCwe8E.js → chunk-SHT3W25Y-BspJEJ5H.js} +109 -63
  38. package/dist/{chunk-6Q2QTUOP-DmTcEBMn.js → chunk-SVP7TREG-DX3rFNTe.js} +5 -5
  39. package/dist/{chunk-GF5L2VYU-B0wgCQgS.js → chunk-TICWLB2K-fVF7Uujg.js} +13 -13
  40. package/dist/{chunk-XXDRQBXY-D73H4IN0.js → chunk-XXDRQBXY-Dnl5VBqG.js} +3 -3
  41. package/dist/{chunk-Y2CYZVJY-DoegUj_e.js → chunk-Y2CYZVJY-DKKS1VyV.js} +1 -1
  42. package/dist/{chunk-5FQGJX7Z-B85XCPv6.js → chunk-YOKDWASO-DrWbKnxA.js} +6925 -5460
  43. package/dist/classDiagram-ZZMXUADV-Fe-V14Sc.js +30 -0
  44. package/dist/classDiagram-v2-VYDZK3BY-xTDg7lOs.js +30 -0
  45. package/dist/code-visibility-DElzk_hh.js +138 -0
  46. package/dist/{common-Cv-4hMa0.js → common-B4-ih9IA.js} +8838 -12645
  47. package/dist/{compiler-runtime-CAH9RLw2.js → compiler-runtime-Cj8ZWiNS.js} +2 -2
  48. package/dist/copy-icon-CLdENY__.js +190 -0
  49. package/dist/{cose-bilkent-JH36ORCC-FUWHkXFX.js → cose-bilkent-JH36ORCC-_LyRKVqm.js} +2 -2
  50. package/dist/cubic-OaEBhQPK.js +1404 -0
  51. package/dist/cynefin-OW5HDTMX-obq-i80l.js +3 -0
  52. package/dist/{cynefinDiagram-MW4NZA55-BXSFK93J.js → cynefinDiagram-5FMLGOSQ-CFQrqzSX.js} +10 -10
  53. package/dist/{dagre-CGyalH38.js → dagre-BGSfXNEb.js} +678 -537
  54. package/dist/dagre-GXQ25YYZ-xHNAUTyG.js +425 -0
  55. package/dist/{data-grid-overlay-editor-DZM4BAaI.js → data-grid-overlay-editor-CRH6JQPE.js} +8 -9
  56. package/dist/{data-grid-types-BnZwWG8z.js → data-grid-types-BucVmDDp.js} +1 -1
  57. package/dist/{defaultLocale-DKaU_opG.js → defaultLocale-JI_lnoCe.js} +1 -1
  58. package/dist/{diagram-7IWD3JNH-BjfzDNvj.js → diagram-S7CK7UJ4-Bt1rPbAx.js} +40 -39
  59. package/dist/{diagram-UB23O5K3-DDg-7wLA.js → diagram-UQ7AKVKN-D1sq5FoZ.js} +10 -10
  60. package/dist/{diagram-B4RE2ZJO-CKccR9eE.js → diagram-VSXAHHWV-BKpmG23x.js} +10 -10
  61. package/dist/{diagram-Q27KOJAE-Zhz01ss7.js → diagram-VX7I27RA-BMwGFVD6.js} +21 -21
  62. package/dist/{diagram-LBJQPF4R-CJ-bOruh.js → diagram-Z3DM3KII--KLDR9Pl.js} +10 -10
  63. package/dist/dialog-CgNq6y9-.js +94 -0
  64. package/dist/{dist-dAqZAPcF.js → dist-1HDa70oE.js} +3 -3
  65. package/dist/{dist-Re9sOPOx.js → dist-9x1ZRe-e.js} +2 -2
  66. package/dist/{dist-DEeLqRlU.js → dist-B1vYLK28.js} +1 -1
  67. package/dist/{dist-C5Bn52W4.js → dist-B8D7McG3.js} +3 -3
  68. package/dist/{dist-_XvgytiS.js → dist-BHCHt1NI.js} +1 -1
  69. package/dist/{dist-CRjAdnqF.js → dist-BRxfaJgs.js} +3 -3
  70. package/dist/{dist-Byj2bV8o.js → dist-BVGtK7Ht.js} +1 -1
  71. package/dist/{dist-BIN5LKyE.js → dist-BaHjhkpZ.js} +2 -2
  72. package/dist/{dist-DVFbIwc5.js → dist-BtKIs9N-.js} +1 -1
  73. package/dist/{dist-BrQGcfQ9.js → dist-C2KzV-vf.js} +2 -2
  74. package/dist/{dist-DJFiGP2k.js → dist-C2wDlYdD.js} +2 -2
  75. package/dist/{dist-BVRM2y1P.js → dist-C8xMLVYi.js} +2 -2
  76. package/dist/dist-CMh_W4y4.js +538 -0
  77. package/dist/{extends-BPB6_lTK.js → dist-CO1AwwG_.js} +516 -561
  78. package/dist/{dist-BzN60Z2s.js → dist-CPGxfVGX.js} +1 -1
  79. package/dist/{dist-C7v-9nUK.js → dist-Cm3iAFMD.js} +3 -3
  80. package/dist/{dist-CGAxEiaM.js → dist-Cs2FijYk.js} +2 -2
  81. package/dist/{dist-hXd65f0_.js → dist-D1PpnuZB.js} +1 -1
  82. package/dist/{dist-VdvbxG72.js → dist-DHOTQar0.js} +1 -1
  83. package/dist/{dist-DcgzXCfy.js → dist-DPcEtqmG.js} +2 -2
  84. package/dist/{dist-D4Z_qdP4.js → dist-Df0wKI0F.js} +1 -1
  85. package/dist/{dist-qhLI-SHd.js → dist-DszxuxS1.js} +2 -2
  86. package/dist/{dist-BEmkrGoQ.js → dist-Kxgjxakw.js} +1 -1
  87. package/dist/{dist-BbSMhhD2.js → dist-KzZ7WELx.js} +2 -2
  88. package/dist/{dist-jWUab2d1.js → dist-lA1Cttkb.js} +1 -1
  89. package/dist/dropdown-menu-CZgjYSAh.js +4502 -0
  90. package/dist/{ebnfDiagram-BXEA7PRR-Dm75pCAS.js → ebnfDiagram-PWID7BFC-WnG4cvSQ.js} +17 -18
  91. package/dist/{erDiagram-JOGREHBK-rVDG3VSQ.js → erDiagram-RLTQ6QDP-DhzKiYHc.js} +1037 -798
  92. package/dist/error-banner-B94dcDmP.js +391 -0
  93. package/dist/error-entries-C0NsUqXl.js +56 -0
  94. package/dist/{esm-CR1nhb1c.js → esm-BElI3qKH.js} +22 -22
  95. package/dist/{esm-C1d0g6Bv.js → esm-G4Fhsgng.js} +51 -37
  96. package/dist/{esm-CesmlDrs.js → esm-h8f7-1CJ.js} +423 -423
  97. package/dist/eventmodeling-NTZA5JFV-D7nP7Uyu.js +3 -0
  98. package/dist/feedback-button-cQcMqpEP.js +380 -0
  99. package/dist/flowDiagram-HODETNUW-6dMdB8pR.js +16 -0
  100. package/dist/{formats-CslNOKy0.js → formats-BR5iGb4s.js} +8 -8
  101. package/dist/{ganttDiagram-PKOTCBZU-9D-LXF6P.js → ganttDiagram-EL5Y4UJY-DbzEBLbl.js} +15 -15
  102. package/dist/gitGraph-4MIJSDKK-Dy9uQXGh.js +3 -0
  103. package/dist/{gitGraphDiagram-DS77QQ5N-BfpsXTLf.js → gitGraphDiagram-WWUBYQGX-BMf0iKi1.js} +10 -10
  104. package/dist/{glide-data-editor-sPZ8fUFn.js → glide-data-editor-DYOxfSzI.js} +2143 -1910
  105. package/dist/{glide-utils-NShAPPtn.js → glide-utils-B3rUT5PI.js} +15 -15
  106. package/dist/globals-BOoLHa7X.js +19 -0
  107. package/dist/highlighted-body-KPVGNVTW-Ad3MKZ18.js +38 -0
  108. package/dist/html-to-image-CeYYvQNb.js +3272 -0
  109. package/dist/info-A6RAGUB7-DKoayiHY.js +3 -0
  110. package/dist/{infoDiagram-6WML65LV-DqCTXHVy.js → infoDiagram-27XIBGKW-BagtCX_5.js} +7 -7
  111. package/dist/{ishikawaDiagram-WSZJBQD7-BCUYmZ1v.js → ishikawaDiagram-5VMMS53U-DByDehYy.js} +8 -8
  112. package/dist/{journeyDiagram-NVQOT4AX-BXB6M4zN.js → journeyDiagram-3NMN7TZE-D2LcKDUO.js} +8 -8
  113. package/dist/{jsx-runtime-CpoKNRgu.js → jsx-runtime-DgDPJV9S.js} +1 -1
  114. package/dist/{kanban-definition-27J2QSJJ-CGRhrDUX.js → kanban-definition-UXKFOSKX-BxwkbBI_.js} +29 -29
  115. package/dist/katex-DFBiSucW.js +21840 -0
  116. package/dist/{label-lwzzBHUW.js → label-BJ49YTvk.js} +6 -6
  117. package/dist/{linear-D5r_1YqD.js → linear-Cnaq3Tfb.js} +4 -4
  118. package/dist/{loader-VZ__bv4g.js → loader-D2W4oM-3.js} +15 -15
  119. package/dist/main.js +8113 -13475
  120. package/dist/mermaid-DPNuhemn.js +3084 -0
  121. package/dist/mermaid-HWGCJPDP-DYCzSILp.js +2 -0
  122. package/dist/mermaid-parser.core-DxuSfYwJ.js +638 -0
  123. package/dist/{mhchem-BjwrxcV-.js → mhchem-DWCF06w9.js} +1 -1
  124. package/dist/{micromark-factory-space-DruVGzeG.js → micromark-factory-space-DGxAzmw8.js} +2 -2
  125. package/dist/{mindmap-definition-FAOFIHXS-C9gRhzZq.js → mindmap-definition-YA3MSWOX-Cgvojw3y.js} +17 -17
  126. package/dist/{node-sql-parser-DesT1xNw.js → node-sql-parser-BiZOJ-FS.js} +0 -3
  127. package/dist/{number-overlay-editor-De2CabLL.js → number-overlay-editor-DZp5bEmI.js} +5 -5
  128. package/dist/objectWithoutPropertiesLoose-BRDcTsfB.js +23 -0
  129. package/dist/packet-AYTQ26CC-Yw7ajchJ.js +3 -0
  130. package/dist/{pegDiagram-VL7TDLO6-Df9IUjMD.js → pegDiagram-XKGWAZYB-DahHhYyN.js} +19 -20
  131. package/dist/{pick-SnHlmIBN.js → pick-CJeoxYOS.js} +1 -1
  132. package/dist/pie-WAS4IAKB-BKdKOAkL.js +3 -0
  133. package/dist/{pieDiagram-7S7Q4E2Y-BmRzQ8ZP.js → pieDiagram-E7YTZNPT-CCtX0oCK.js} +29 -31
  134. package/dist/{process-output-CPy0YKUe.js → process-output-BCTjlyuH.js} +7 -6
  135. package/dist/purify.es-DgKyQviY.js +805 -0
  136. package/dist/{quadrantDiagram-CIZ2JOQS-wFBvWcxS.js → quadrantDiagram-AXDQQJYC-DftINo6g.js} +5 -5
  137. package/dist/radar-RG4KPBEZ-ScR_D_Ts.js +3 -0
  138. package/dist/railroad-74A4TZTK-DQvPSdo5.js +3 -0
  139. package/dist/railroad-abnf-HS5TGJTU-CsJQG2O8.js +3 -0
  140. package/dist/railroad-ebnf-LZEXJU2U-BgEobkSn.js +3 -0
  141. package/dist/railroad-peg-WCYAUIDC-DjLAjofI.js +3 -0
  142. package/dist/{railroadDiagram-AXF67PYL-DxbIatiN.js → railroadDiagram-O6MQD6OU-Du5NsPUb.js} +17 -18
  143. package/dist/{react-dom-C94wmq5w.js → react-dom-BUgJ-ab_.js} +3 -3
  144. package/dist/{react-DMWcHin-.js → react-ofJbxM4x.js} +2 -2
  145. package/dist/{react-vega-DSD5aT7_.js → react-vega-5AcMW8gG.js} +10012 -9369
  146. package/dist/{requirementDiagram-LRYGKXZP-X_x-Y713.js → requirementDiagram-BXWQKSXE-0pmmxL6_.js} +20 -19
  147. package/dist/{reveal-component-CVsYlb9J.js → reveal-component-C9h2Lubu.js} +1303 -1237
  148. package/dist/{sankeyDiagram-W5VNT64P-BYJALbbm.js → sankeyDiagram-P5KCCOFB-CDKR5TJH.js} +4 -4
  149. package/dist/{select-3qHpFKF9.js → select-C6plhmZr.js} +317 -562
  150. package/dist/{sequenceDiagram-SI44F4Z6-BiPBe3Sv.js → sequenceDiagram-WJ2MYXX4-DB-ChWwU.js} +11 -11
  151. package/dist/{sizeCapture-X5ZJPWSS-BKLDeh5H.js → sizeCapture-INFHLROL-Dx5SpkQF.js} +2 -2
  152. package/dist/{spec-CutWdqo3.js → spec-CAYwFeV6.js} +4 -4
  153. package/dist/{src-C31ngt98.js → src-CA_m4ONl.js} +298 -303
  154. package/dist/{stateDiagram-OKZ733FA-B7QyNBxH.js → stateDiagram-D77RDMKH-orN6AwMx.js} +19 -20
  155. package/dist/stateDiagram-v2-MP3YSRHH-o05_rJN8.js +30 -0
  156. package/dist/style.css +2 -2
  157. package/dist/{swimlanes-SLNWSIFB-B4f8VP3b.js → swimlanes-42K2YHIH-BkSDcqDT.js} +1501 -1591
  158. package/dist/swimlanesDiagram-VR7AAH4N-D_nFQfRc.js +30 -0
  159. package/dist/{swiper-component-C90YjhaV.js → swiper-component-IOUowglM.js} +39 -26
  160. package/dist/{time-aWGfjN8x.js → time-BieKwdYS.js} +42 -42
  161. package/dist/{timeline-definition-Z64GVDOM-Dacq_5lr.js → timeline-definition-24CTP7MA-BuqJUIRZ.js} +7 -7
  162. package/dist/{toDate-CpXBeDq0.js → toDate-WXg1yLcI.js} +7 -7
  163. package/dist/toast-DvY70eFX.js +1834 -0
  164. package/dist/tooltip-qB8NlSqV.js +1742 -0
  165. package/dist/treeView-Q6P3EWNA-DuRV97YF.js +3 -0
  166. package/dist/treemap-WGGIJYW6-AsLq-uwC.js +3 -0
  167. package/dist/use-restore-focus-D5D9xEjZ.js +5946 -0
  168. package/dist/{use-vega-container-remeasure-DUW4tRxq.js → use-vega-container-remeasure-4DwJbPWu.js} +2 -2
  169. package/dist/{useAsyncData-CH6-CgJF.js → useAsyncData-BD6AStMt.js} +3 -3
  170. package/dist/{useDateFormatter-Cp9Jdxls.js → useDateFormatter-BRTPsUK7.js} +8 -8
  171. package/dist/{useDeepCompareMemoize-JC87C_jO.js → useDeepCompareMemoize-D_HNdyvI.js} +2 -2
  172. package/dist/{useIframeCapabilities-De3C-9b4.js → useIframeCapabilities-CVtNkI3Y.js} +2 -2
  173. package/dist/{useLifecycle-B4RGlyf0.js → useLifecycle-DPgiiwwU.js} +6 -6
  174. package/dist/useNumberFormatter-BfDpa21j.js +251 -0
  175. package/dist/useTheme-DzXmYZ5V.js +904 -0
  176. package/dist/{vega-component-ovBXgp91.js → vega-component-D0QXopU8.js} +34 -34
  177. package/dist/{vega-embed-container-TJ5z5dZw.js → vega-embed-container-CbnTccZi.js} +6 -6
  178. package/dist/vega-loader.browser-D95WfUcj.js +1139 -0
  179. package/dist/{vennDiagram-T6HMQDX7-D-Rcq3Iu.js → vennDiagram-4TSXK5OY-CTUlJ2PK.js} +9 -9
  180. package/dist/wardley-WFR3VGLG-Na-tFhQJ.js +3 -0
  181. package/dist/{wardleyDiagram-T6FBY63Y-Z-Og7_Wd.js → wardleyDiagram-VM6X3IG4-3evLUb0M.js} +10 -10
  182. package/dist/{xychartDiagram-ELKLHX3M-BDJ2dITA.js → xychartDiagram-S5SC5T6Z-DL2E3K8-.js} +248 -139
  183. package/package.json +54 -57
  184. package/src/__mocks__/notebook.ts +1 -0
  185. package/src/__mocks__/requests.ts +7 -0
  186. package/src/__tests__/__snapshots__/CellStatus.test.tsx.snap +12 -12
  187. package/src/__tests__/fixtures/pair-preview.ts +19 -0
  188. package/src/__tests__/mount.test.ts +18 -0
  189. package/src/components/app-config/optional-features.tsx +6 -0
  190. package/src/components/chat/acp/__tests__/agent-panel-initialization.test.tsx +394 -0
  191. package/src/components/chat/acp/__tests__/agent-panel.test.tsx +272 -0
  192. package/src/components/chat/acp/__tests__/state.test.ts +2 -2
  193. package/src/components/chat/acp/agent-panel.tsx +115 -74
  194. package/src/components/chat/acp/state.ts +1 -1
  195. package/src/components/data-table/__tests__/filters.test.ts +21 -21
  196. package/src/components/data-table/charts/__tests__/spec.test.ts +5 -10
  197. package/src/components/data-table/column-explorer-panel/column-explorer.tsx +2 -6
  198. package/src/components/data-table/column-summary/chart-spec-model.tsx +1 -1
  199. package/src/components/data-table/columns.tsx +64 -67
  200. package/src/components/editor/RecoveryButton.tsx +1 -0
  201. package/src/components/editor/__tests__/dynamic-favicon.test.tsx +36 -2
  202. package/src/components/editor/actions/__tests__/pair-with-agent-commands.test.ts +115 -0
  203. package/src/components/editor/actions/__tests__/pair-with-agent-modal.test.tsx +218 -0
  204. package/src/components/editor/actions/pair-with-agent-commands.ts +46 -9
  205. package/src/components/editor/actions/pair-with-agent-modal.tsx +49 -23
  206. package/src/components/editor/ai/add-cell-with-ai.tsx +1 -0
  207. package/src/components/editor/ai/ai-completion-editor.tsx +3 -1
  208. package/src/components/editor/alerts/__tests__/connection-notice.test.tsx +186 -0
  209. package/src/components/editor/alerts/__tests__/startup-progress.test.tsx +185 -0
  210. package/src/components/editor/alerts/connecting-alert.tsx +1 -66
  211. package/src/components/editor/alerts/connection-notice.tsx +186 -0
  212. package/src/components/editor/alerts/startup-output.tsx +173 -0
  213. package/src/components/editor/alerts/startup-progress.tsx +204 -0
  214. package/src/components/editor/app-container.tsx +9 -3
  215. package/src/components/editor/boundary/ErrorBoundary.tsx +38 -16
  216. package/src/components/editor/boundary/__tests__/ErrorBoundary.test.tsx +311 -0
  217. package/src/components/editor/cell/__tests__/toolbar.test.tsx +73 -0
  218. package/src/components/editor/cell/code/__tests__/rtc-editor-config.test.ts +50 -0
  219. package/src/components/editor/cell/code/cell-editor.tsx +41 -42
  220. package/src/components/editor/cell/toolbar.tsx +11 -0
  221. package/src/components/editor/chrome/components/__tests__/feedback-button.test.tsx +94 -0
  222. package/src/components/editor/chrome/components/feedback-button.tsx +63 -42
  223. package/src/components/editor/chrome/panels/__tests__/packages-panel.test.tsx +164 -8
  224. package/src/components/editor/chrome/panels/__tests__/sandbox-details.test.tsx +358 -0
  225. package/src/components/editor/chrome/panels/__tests__/sandbox-recovery.test.tsx +168 -0
  226. package/src/components/editor/chrome/panels/packages-panel.tsx +113 -175
  227. package/src/components/editor/chrome/panels/sandbox-controller.tsx +106 -0
  228. package/src/components/editor/chrome/panels/sandbox-details-state.ts +38 -0
  229. package/src/components/editor/chrome/panels/sandbox-panel.tsx +230 -0
  230. package/src/components/editor/chrome/panels/sandbox-toggle.tsx +52 -0
  231. package/src/components/editor/chrome/wrapper/app-chrome.tsx +7 -0
  232. package/src/components/editor/chrome/wrapper/footer-items/backend-status.tsx +3 -1
  233. package/src/components/editor/code/__tests__/readonly-diff.test.tsx +65 -0
  234. package/src/components/editor/code/readonly-diff.tsx +1 -1
  235. package/src/components/editor/connections/database/__tests__/__snapshots__/as-code.test.ts.snap +98 -98
  236. package/src/components/editor/connections/database/__tests__/as-code.test.ts +11 -5
  237. package/src/components/editor/dynamic-favicon.tsx +17 -10
  238. package/src/components/editor/file-tree/__tests__/file-explorer-navigation.test.tsx +13 -11
  239. package/src/components/editor/file-tree/__tests__/tree-actions.test.tsx +54 -0
  240. package/src/components/editor/file-tree/tree-actions.tsx +11 -14
  241. package/src/components/editor/header/__tests__/status.test.tsx +8 -20
  242. package/src/components/editor/header/filename-input.tsx +2 -0
  243. package/src/components/editor/header/status.tsx +5 -3
  244. package/src/components/editor/navigation/clipboard.ts +1 -0
  245. package/src/components/editor/notebook-cell.tsx +4 -2
  246. package/src/components/editor/output/JsonOutput.tsx +182 -632
  247. package/src/components/editor/output/Outputs.css +49 -17
  248. package/src/components/editor/output/__tests__/JsonOutput-interactions.test.tsx +254 -0
  249. package/src/components/editor/output/__tests__/JsonOutput-mimetype.test.tsx +41 -46
  250. package/src/components/editor/output/__tests__/{json-output.test.ts → json-output-formatting.test.ts} +113 -75
  251. package/src/components/editor/output/__tests__/json-output-pagination.test.ts +252 -0
  252. package/src/components/editor/output/json-output/formatting.ts +167 -0
  253. package/src/components/editor/output/json-output/pagination.ts +155 -0
  254. package/src/components/editor/output/json-output/renderers.tsx +196 -0
  255. package/src/components/editor/output/json-output/themes.ts +52 -0
  256. package/src/components/editor/package-alert.tsx +112 -66
  257. package/src/components/editor/renderers/cell-array.tsx +1 -5
  258. package/src/components/editor/renderers/slides-layout/__tests__/plugin.test.ts +3 -7
  259. package/src/components/slides/slide-form.tsx +1 -0
  260. package/src/components/slides/slide-notes-editor.tsx +1 -0
  261. package/src/components/tracing/tracing-spec.ts +1 -1
  262. package/src/components/ui/__tests__/badge.test.ts +6 -4
  263. package/src/components/ui/use-toast.ts +8 -0
  264. package/src/core/MarimoApp.tsx +0 -2
  265. package/src/core/ai/context/providers/__tests__/error.test.ts +16 -22
  266. package/src/core/alerts/__tests__/environment.test.ts +183 -0
  267. package/src/core/alerts/__tests__/state.test.tsx +240 -0
  268. package/src/core/alerts/environment.ts +57 -0
  269. package/src/core/alerts/state.ts +155 -99
  270. package/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap +296 -259
  271. package/src/core/cells/__tests__/apply-transaction.test.ts +34 -0
  272. package/src/core/cells/__tests__/cell.test.ts +61 -0
  273. package/src/core/cells/__tests__/cells.test.ts +182 -37
  274. package/src/core/cells/__tests__/document-changes.test.ts +39 -1
  275. package/src/core/cells/__tests__/outputs.test.tsx +117 -0
  276. package/src/core/cells/__tests__/pending-delete-service.test.tsx +4 -3
  277. package/src/core/cells/__tests__/session.test.ts +7 -0
  278. package/src/core/cells/cell.ts +9 -1
  279. package/src/core/cells/cells.ts +13 -18
  280. package/src/core/cells/document-changes.ts +11 -1
  281. package/src/core/cells/outputs.ts +66 -9
  282. package/src/core/cells/pending-delete-service.ts +12 -16
  283. package/src/core/cells/session.ts +2 -0
  284. package/src/core/cells/types.ts +2 -0
  285. package/src/core/codemirror/find-replace/__tests__/navigate.test.ts +8 -16
  286. package/src/core/codemirror/language/__tests__/sql.test.ts +70 -2
  287. package/src/core/codemirror/language/embedded/__tests__/embedded-python.test.ts +4 -8
  288. package/src/core/codemirror/language/languages/sql/sql.ts +16 -1
  289. package/src/core/codemirror/rtc/extension.ts +5 -2
  290. package/src/core/config/pair.ts +19 -0
  291. package/src/core/datasets/__tests__/data-source.test.ts +2 -0
  292. package/src/core/datasets/data-source-connections.ts +15 -10
  293. package/src/core/edit-app.tsx +8 -5
  294. package/src/core/errors/state.ts +1 -2
  295. package/src/core/export/__tests__/hooks.test.ts +1 -6
  296. package/src/core/islands/bootstrap.ts +3 -1
  297. package/src/core/islands/bridge.ts +3 -0
  298. package/src/core/islands/worker-factory.ts +2 -12
  299. package/src/core/kernel/messages.ts +2 -2
  300. package/src/core/network/__tests__/requests-network.test.ts +4 -3
  301. package/src/core/network/connection-notice.ts +117 -0
  302. package/src/core/network/connection.ts +19 -0
  303. package/src/core/network/requests-lazy.ts +3 -0
  304. package/src/core/network/requests-network.ts +12 -0
  305. package/src/core/network/requests-static.ts +3 -0
  306. package/src/core/network/requests-toasting.tsx +3 -0
  307. package/src/core/network/resolve.ts +2 -1
  308. package/src/core/network/types.ts +7 -0
  309. package/src/core/network/useConnectionNotice.ts +53 -0
  310. package/src/core/packages/__tests__/usePackageAction.test.tsx +129 -0
  311. package/src/core/packages/__tests__/useSandboxController.test.tsx +246 -0
  312. package/src/core/packages/package-data.ts +35 -0
  313. package/src/core/packages/sandbox-state.ts +67 -0
  314. package/src/core/packages/toast-components.tsx +11 -0
  315. package/src/core/packages/useInstallPackage.ts +1 -1
  316. package/src/core/packages/usePackageAction.ts +51 -0
  317. package/src/core/packages/usePackageDependencies.ts +22 -0
  318. package/src/core/packages/useSandboxController.ts +208 -0
  319. package/src/core/run-app.tsx +2 -0
  320. package/src/core/static/__tests__/files.test.ts +12 -30
  321. package/src/core/wasm/__tests__/bootstrap.test.ts +63 -0
  322. package/src/core/wasm/__tests__/bridge.test.ts +13 -4
  323. package/src/core/wasm/__tests__/fs.test.ts +22 -0
  324. package/src/core/wasm/__tests__/runtime-config.test.ts +65 -0
  325. package/src/core/wasm/bridge.ts +35 -23
  326. package/src/core/wasm/rpc.ts +2 -0
  327. package/src/core/wasm/runtime-config.ts +31 -0
  328. package/src/core/wasm/worker/bootstrap.ts +21 -11
  329. package/src/core/wasm/worker/constants.ts +1 -0
  330. package/src/core/wasm/worker/fs.ts +4 -0
  331. package/src/core/wasm/worker/getController.ts +3 -1
  332. package/src/core/wasm/worker/save-worker.ts +10 -9
  333. package/src/core/wasm/worker/types.ts +6 -4
  334. package/src/core/wasm/worker/worker.ts +9 -9
  335. package/src/core/websocket/__tests__/useMarimoKernelConnection.hook.test.tsx +404 -3
  336. package/src/core/websocket/__tests__/useMarimoKernelConnection.test.ts +8 -6
  337. package/src/core/websocket/transports/transport.ts +1 -1
  338. package/src/core/websocket/transports/ws.ts +1 -1
  339. package/src/core/websocket/types.ts +11 -1
  340. package/src/core/websocket/useMarimoKernelConnection.tsx +63 -16
  341. package/src/hooks/useDebounce.ts +2 -0
  342. package/src/mount.tsx +3 -0
  343. package/src/plugins/core/BadPlugin.tsx +3 -14
  344. package/src/plugins/core/RenderHTML.tsx +22 -2
  345. package/src/plugins/core/__test__/RenderHTML.test.ts +187 -0
  346. package/src/plugins/core/registerReactComponent.tsx +0 -1
  347. package/src/plugins/impl/FileBrowserPlugin.tsx +10 -4
  348. package/src/plugins/impl/FormPlugin.tsx +2 -0
  349. package/src/plugins/impl/MatrixPlugin.tsx +2 -0
  350. package/src/plugins/impl/RangeSliderPlugin.tsx +2 -0
  351. package/src/plugins/impl/SliderPlugin.tsx +2 -0
  352. package/src/plugins/impl/__tests__/FileBrowserPlugin.test.tsx +50 -1
  353. package/src/plugins/impl/data-editor/__tests__/glide-data-editor.test.tsx +23 -18
  354. package/src/plugins/impl/data-frames/panel.tsx +1 -0
  355. package/src/plugins/impl/image-comparison/ImageComparisonComponent.tsx +1 -1
  356. package/src/plugins/impl/image-comparison/__tests__/ImageComparisonComponent.test.tsx +15 -0
  357. package/src/plugins/impl/vega/__tests__/make-selectable.test.ts +42 -48
  358. package/src/plugins/layout/AccordionPlugin.tsx +7 -2
  359. package/src/plugins/layout/JsonOutputPlugin.tsx +7 -10
  360. package/src/plugins/layout/__test__/AccordionPlugin.test.tsx +66 -0
  361. package/src/stories/sandbox.stories.tsx +488 -0
  362. package/src/utils/__tests__/path.test.ts +6 -5
  363. package/src/utils/__tests__/worker.test.ts +81 -0
  364. package/src/utils/worker.ts +22 -0
  365. package/dist/ErrorBoundary-CR-ZQN_c.js +0 -125
  366. package/dist/_baseMerge-Dv8bBloN.js +0 -73
  367. package/dist/_initCloneObject---vediN2.js +0 -95
  368. package/dist/arc-DOVLrCPd.js +0 -82
  369. package/dist/architecture-TIHT7OUA-MiJpPpQW.js +0 -3
  370. package/dist/array-CApNbSU9.js +0 -6
  371. package/dist/assets/__vite-browser-external-BdKGjRZ4.js +0 -1
  372. package/dist/assets/worker-DlIBfp9S.js +0 -98
  373. package/dist/blockDiagram-VBNYF7ZC-Bc--I65C.js +0 -3158
  374. package/dist/chat-ui-BSwr409J.js +0 -8455
  375. package/dist/chunk-3NCLNEKW-BIp_lB_4.js +0 -14
  376. package/dist/chunk-5FCAYU7R-C_HO9A1J.js +0 -23
  377. package/dist/chunk-5HE753X5-Bixm_MV-.js +0 -38
  378. package/dist/chunk-5JV3BV7I-CH5J3iZY.js +0 -54
  379. package/dist/chunk-5TONJI2A-DG6gDiSS.js +0 -62
  380. package/dist/chunk-7BUUIJ7U-5afmIPeo.js +0 -82
  381. package/dist/chunk-BIQX33UG-7TMBUf89.js +0 -23
  382. package/dist/chunk-CQNSW5MT-Cnqqsxt-.js +0 -38
  383. package/dist/chunk-CYSBUYHQ-BAbymFHR.js +0 -23
  384. package/dist/chunk-EMLP6XTP-Bsz-QL77.js +0 -23
  385. package/dist/chunk-J7OUQ5F2-CM_meqZH.js +0 -57
  386. package/dist/chunk-JG7HCLWE-DUnCDgPk.js +0 -62
  387. package/dist/chunk-MOZMSUNE-BG6IHvzT.js +0 -35
  388. package/dist/chunk-OSBZ3O6U-CYwj_bvR.js +0 -23
  389. package/dist/chunk-QBLGF6JB-B4vJ4j8J.js +0 -23
  390. package/dist/chunk-QR6OTTB3-D4wH2ldi.js +0 -3738
  391. package/dist/chunk-R7FJI6CG-Blf8FcmZ.js +0 -64
  392. package/dist/chunk-RYQCIY6F-BWbIlBIH.js +0 -241
  393. package/dist/chunk-U6XO7XAA-COw445DS.js +0 -63
  394. package/dist/chunk-UBXNYLIW-BHigVU4H.js +0 -32
  395. package/dist/chunk-YOTPTUD7-Dn044Q_d.js +0 -30
  396. package/dist/chunk-ZIRB5QZD-BR4TMfOa.js +0 -1153
  397. package/dist/classDiagram-JCYQIIEL-DmXSLxe_.js +0 -30
  398. package/dist/classDiagram-v2-OCEON4UE-CooqVexA.js +0 -30
  399. package/dist/click-outside-container-D_URcm3D.js +0 -167
  400. package/dist/code-block-37QAKDTI-CQrzBOr-.js +0 -107
  401. package/dist/copy-CD7S58CY.js +0 -141
  402. package/dist/cynefin-VYW2F7L2-CeHAxOEX.js +0 -3
  403. package/dist/dagre-VZM6K2ZE-CJggWPTJ.js +0 -328
  404. package/dist/dist-3_o3T78I.js +0 -1360
  405. package/dist/dist-ABQjhuek.js +0 -64
  406. package/dist/dist-CO5R6VMi.js +0 -538
  407. package/dist/dropdown-menu-DhCfcscX.js +0 -5858
  408. package/dist/emotion-is-prop-valid.esm-M57VsT8j.js +0 -14
  409. package/dist/error-banner-CsXbEEjo.js +0 -611
  410. package/dist/eventmodeling-45OFAUF4-B_lWZ-Pd.js +0 -3
  411. package/dist/flowDiagram-UKHOOZJN-g1AmrZzM.js +0 -17
  412. package/dist/gitGraph-TEB2WS4Q-Dj-eXUph.js +0 -3
  413. package/dist/info-DKCQHKI2-Bhb-pe2e.js +0 -3
  414. package/dist/line-CuKjIQa1.js +0 -34
  415. package/dist/map-BJpOfPlL.js +0 -149
  416. package/dist/math-BXtKgYah.js +0 -10
  417. package/dist/mermaid-4DMBBIKO-Ddp9TgNp.js +0 -2
  418. package/dist/mermaid-Bi23Ibnw.js +0 -1173
  419. package/dist/mermaid-parser.core-Din9FvSi.js +0 -99
  420. package/dist/packet-7NZHBO7P-fbkIIyKE.js +0 -3
  421. package/dist/path-BNHuHZP8.js +0 -87
  422. package/dist/pie-RZYD4A2V-CLRIsxY1.js +0 -3
  423. package/dist/purify.es-CB-YO1Hn.js +0 -774
  424. package/dist/radar-I7S5WNFK-BGzCbgXu.js +0 -3
  425. package/dist/railroad-3IZDKUUU-CvQIIcuU.js +0 -3
  426. package/dist/railroad-abnf-AHOZXSZD-CMwtlNtu.js +0 -3
  427. package/dist/railroad-ebnf-EBAXGLYW-n1QUOAsh.js +0 -3
  428. package/dist/railroad-peg-LSFZ7HO6-PjnrpmCs.js +0 -3
  429. package/dist/schemas-DzK6U94N.js +0 -6057
  430. package/dist/stateDiagram-v2-UEYNNEHI-BTRUs8Il.js +0 -30
  431. package/dist/step-CKczO72Q.js +0 -670
  432. package/dist/swimlanesDiagram-ULZ7WXOC-NBmgBl9G.js +0 -31
  433. package/dist/timer-DpDyj9G0.js +0 -596
  434. package/dist/tooltip-Dt77sBeT.js +0 -390
  435. package/dist/treeView-QDETBFTQ-DU8LwHuf.js +0 -3
  436. package/dist/treemap-6X3UGDF4-DUk4-k_O.js +0 -3
  437. package/dist/useTheme-CVJ0UOf2.js +0 -841
  438. package/dist/vega-loader.browser-DEggZzni.js +0 -1083
  439. package/dist/wardley-OPB4EBWU-Db-AaGas.js +0 -3
  440. package/src/components/editor/output/EmotionCacheProvider.tsx +0 -32
@@ -1,3738 +0,0 @@
1
- import { a as e, r as t, u as n } from "./chunk-NSK5VX7P-CDTMcJB0.js";
2
- import { n as r, t as i } from "./src-C31ngt98.js";
3
- import { n as a } from "./chunk-Y2CYZVJY-DoegUj_e.js";
4
- import { A as o, B as s, M as c, T as l, b as u, g as d, x as f, z as p } from "./chunk-I66GZJ75-BqyTCAPf.js";
5
- import { a as m, i as h, r as g, t as _ } from "./chunk-W5SLKNZC-DLnvpEtV.js";
6
- import { n as v, t as y } from "./chunk-UBXNYLIW-BHigVU4H.js";
7
- import { t as b } from "./chunk-4I5QYGJK-DpytHuZQ.js";
8
- import { n as x } from "./chunk-WRU74C26-BpWsbiDK.js";
9
- import { t as S } from "./rough.esm-CtV9AnV1.js";
10
- //#region ../node_modules/.pnpm/mermaid@11.16.1/node_modules/mermaid/dist/chunks/mermaid.core/chunk-QR6OTTB3.mjs
11
- var C = /* @__PURE__ */ a(async (t, r, a) => {
12
- let o, s = r.useHtmlLabels || d(f()?.htmlLabels);
13
- o = a || "node default";
14
- let c = t.insert("g").attr("class", o).attr("id", r.domId || r.id), l = c.insert("g").attr("class", "label").attr("style", n(r.labelStyle)), u;
15
- u = r.label === void 0 ? "" : typeof r.label == "string" ? r.label : r.label[0];
16
- let m = !!r.icon || !!r.img, h = r.labelType === "markdown", g = await x(l, p(e(u), f()), {
17
- useHtmlLabels: s,
18
- width: r.width || f().flowchart?.wrappingWidth,
19
- classes: h ? "markdown-node-label" : "",
20
- style: r.labelStyle,
21
- addSvgBackground: m,
22
- markdown: h
23
- }, f()), _ = g.getBBox(), v = (r?.padding ?? 0) / 2;
24
- if (s) {
25
- let e = g.children[0], t = i(g);
26
- await y(e, u), _ = e.getBoundingClientRect(), t.attr("width", _.width), t.attr("height", _.height);
27
- }
28
- return s ? l.attr("transform", "translate(" + -_.width / 2 + ", " + -_.height / 2 + ")") : l.attr("transform", "translate(0, " + -_.height / 2 + ")"), r.centerLabel && l.attr("transform", "translate(" + -_.width / 2 + ", " + -_.height / 2 + ")"), l.insert("rect", ":first-child"), {
29
- shapeSvg: c,
30
- bbox: _,
31
- halfPadding: v,
32
- label: l
33
- };
34
- }, "labelHelper"), w = /* @__PURE__ */ a(async (t, n, r) => {
35
- let a = r.useHtmlLabels ?? l(f()), o = t.insert("g").attr("class", "label").attr("style", r.labelStyle || ""), s = await x(o, p(e(n), f()), {
36
- useHtmlLabels: a,
37
- width: r.width || f()?.flowchart?.wrappingWidth,
38
- style: r.labelStyle,
39
- addSvgBackground: !!r.icon || !!r.img
40
- }), c = s.getBBox(), u = r.padding / 2;
41
- if (l(f())) {
42
- let e = s.children[0], t = i(s);
43
- c = e.getBoundingClientRect(), t.attr("width", c.width), t.attr("height", c.height);
44
- }
45
- return a ? o.attr("transform", "translate(" + -c.width / 2 + ", " + -c.height / 2 + ")") : o.attr("transform", "translate(0, " + -c.height / 2 + ")"), r.centerLabel && o.attr("transform", "translate(" + -c.width / 2 + ", " + -c.height / 2 + ")"), o.insert("rect", ":first-child"), {
46
- shapeSvg: t,
47
- bbox: c,
48
- halfPadding: u,
49
- label: o
50
- };
51
- }, "insertLabel"), T = /* @__PURE__ */ a((e, t) => {
52
- let n = t.node().getBBox();
53
- e.width = n.width, e.height = n.height;
54
- }, "updateNodeBounds"), E = /* @__PURE__ */ a((e, t) => (e.look === "handDrawn" ? "rough-node" : "node") + " " + e.cssClasses + " " + (t || ""), "getNodeClasses");
55
- function D(e) {
56
- let t = e.map((e, t) => `${t === 0 ? "M" : "L"}${e.x},${e.y}`);
57
- return t.push("Z"), t.join(" ");
58
- }
59
- a(D, "createPathFromPoints");
60
- function O(e, t, n, r, i, a) {
61
- let o = [], s = n - e, c = r - t, l = s / a, u = 2 * Math.PI / l, d = t + c / 2;
62
- for (let t = 0; t <= 50; t++) {
63
- let n = e + t / 50 * s, r = d + i * Math.sin(u * (n - e));
64
- o.push({
65
- x: n,
66
- y: r
67
- });
68
- }
69
- return o;
70
- }
71
- a(O, "generateFullSineWavePoints");
72
- function k(e, t, n, r, i, a) {
73
- let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
74
- for (let i = 0; i < r; i++) {
75
- let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
76
- o.push({
77
- x: -a,
78
- y: -l
79
- });
80
- }
81
- return o;
82
- }
83
- a(k, "generateCirclePoints");
84
- function A(e) {
85
- let t = Array.from(e.childNodes).filter((e) => e.tagName === "path"), n = document.createElementNS("http://www.w3.org/2000/svg", "path"), r = t.map((e) => e.getAttribute("d")).filter((e) => e !== null).join(" ");
86
- n.setAttribute("d", r);
87
- let i = t.find((e) => e.getAttribute("fill") !== "none"), o = t.find((e) => e.getAttribute("stroke") !== "none"), s = /* @__PURE__ */ a((e, t) => e?.getAttribute(t) ?? void 0, "getAttr");
88
- if (i) {
89
- let e = {
90
- fill: s(i, "fill"),
91
- "fill-opacity": s(i, "fill-opacity") ?? "1"
92
- };
93
- Object.entries(e).forEach(([e, t]) => {
94
- t && n.setAttribute(e, t);
95
- });
96
- }
97
- if (o) {
98
- let e = {
99
- stroke: s(o, "stroke"),
100
- "stroke-width": s(o, "stroke-width") ?? "1",
101
- "stroke-opacity": s(o, "stroke-opacity") ?? "1"
102
- };
103
- Object.entries(e).forEach(([e, t]) => {
104
- t && n.setAttribute(e, t);
105
- });
106
- }
107
- let c = document.createElementNS("http://www.w3.org/2000/svg", "g");
108
- return c.appendChild(n), c;
109
- }
110
- a(A, "mergePaths");
111
- var j = /* @__PURE__ */ a((e, t) => {
112
- 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;
113
- 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), {
114
- x: n + c,
115
- y: r + l
116
- };
117
- }, "intersectRect"), M = /* @__PURE__ */ a(async (e, t, n, r = !1, i = !1) => {
118
- let a = t || "";
119
- typeof a == "object" && (a = a[0]);
120
- let o = f(), s = l(o);
121
- return await x(e, a, {
122
- style: n,
123
- isTitle: r,
124
- useHtmlLabels: s,
125
- markdown: !1,
126
- isNode: i,
127
- width: Infinity
128
- }, o);
129
- }, "createLabel"), N = /* @__PURE__ */ a((e, t, n, r, i) => [
130
- "M",
131
- e + i,
132
- t,
133
- "H",
134
- e + n - i,
135
- "A",
136
- i,
137
- i,
138
- 0,
139
- 0,
140
- 1,
141
- e + n,
142
- t + i,
143
- "V",
144
- t + r - i,
145
- "A",
146
- i,
147
- i,
148
- 0,
149
- 0,
150
- 1,
151
- e + n - i,
152
- t + r,
153
- "H",
154
- e + i,
155
- "A",
156
- i,
157
- i,
158
- 0,
159
- 0,
160
- 1,
161
- e,
162
- t + r - i,
163
- "V",
164
- t + i,
165
- "A",
166
- i,
167
- i,
168
- 0,
169
- 0,
170
- 1,
171
- e + i,
172
- t,
173
- "Z"
174
- ].join(" "), "createRoundedRectPathD"), P = /* @__PURE__ */ a(async (e, t) => {
175
- let n = f(), { themeVariables: a, handDrawnSeed: o } = n, { clusterBkg: s, clusterBorder: c } = a, l = c, { labelStyles: u, nodeStyles: p, borderStyles: g, backgroundStyles: _ } = h(t), v = e.insert("g").attr("class", "cluster swimlane " + (t.cssClasses || "")).attr("id", t.id).attr("data-id", t.id).attr("data-et", "cluster").attr("data-look", t.look), y = d(n.flowchart.htmlLabels), b = t.direction === "LR", C = v.insert("g").attr("class", "cluster-label swimlane-label"), w = await x(C, t.label, {
176
- style: t.labelStyle,
177
- useHtmlLabels: y,
178
- isNode: !0,
179
- width: t.width
180
- }), T = w.getBBox();
181
- if (y) {
182
- let e = w.children[0], t = i(w);
183
- T = e.getBoundingClientRect(), t.attr("width", T.width), t.attr("height", T.height);
184
- }
185
- let E = t.padding ?? 0, D = t.width <= T.width + E ? T.width + E : t.width;
186
- t.diff = t.width <= T.width + E ? (D - t.width) / 2 - E : -E;
187
- let O = t.height, k = t.y - O / 2, A = t.y + O / 2, M = t.x - D / 2, N = t.swimlaneContentTop === void 0 ? k + O / 3 : t.swimlaneContentTop, P = b ? 4 : 0, F = T.height + 2 * P, I, L;
188
- if (b) {
189
- let e = Math.max(F, T.height + 2 * P), n = M + e, r = Math.max(0, D - e);
190
- if (t.look === "handDrawn") {
191
- let i = S.svg(v), a = m(t, {
192
- roughness: .7,
193
- fill: s,
194
- stroke: l,
195
- fillWeight: 3,
196
- seed: o
197
- }), c = m(t, {
198
- roughness: .7,
199
- fill: "none",
200
- stroke: l,
201
- seed: o
202
- }), u = i.rectangle(M, k, e, O, a);
203
- I = v.insert(() => u, ":first-child");
204
- let d = i.rectangle(n, k, r, O, c);
205
- L = v.insert(() => d, ":first-child"), I.select("path:nth-child(2)").attr("style", g.join(";")), I.select("path").attr("style", _.join(";").replace("fill", "stroke"));
206
- } else I = v.insert("rect", ":first-child"), L = v.insert("rect", ":first-child"), I.attr("class", "swimlane-title").attr("style", p).attr("x", M).attr("y", k).attr("width", e).attr("height", O).attr("fill", s).attr("stroke", l), L.attr("class", "swimlane-body").attr("style", p).attr("x", n).attr("y", k).attr("width", r).attr("height", O).attr("fill", "none").attr("stroke", l);
207
- let i = M + e / 2, a = t.y;
208
- C.attr("transform", `translate(${i}, ${a}) rotate(-90) translate(${-T.width / 2}, ${-T.height / 2})`);
209
- } else {
210
- let e = Math.max(0, N - k), n = Math.min(F, e), r = k + n, i = Math.max(0, A - r), a = t.x - D / 2;
211
- if (t.look === "handDrawn") {
212
- let e = S.svg(v), c = m(t, {
213
- roughness: .7,
214
- fill: s,
215
- stroke: l,
216
- fillWeight: 3,
217
- seed: o
218
- }), u = m(t, {
219
- roughness: .7,
220
- fill: "none",
221
- stroke: l,
222
- seed: o
223
- }), d = e.rectangle(a, k, D, n, c);
224
- I = v.insert(() => d, ":first-child");
225
- let f = e.rectangle(a, r, D, i, u);
226
- L = v.insert(() => f, ":first-child"), I.select("path:nth-child(2)").attr("style", g.join(";")), I.select("path").attr("style", _.join(";").replace("fill", "stroke"));
227
- } else I = v.insert("rect", ":first-child"), L = v.insert("rect", ":first-child"), I.attr("class", "swimlane-title").attr("style", p).attr("x", a).attr("y", k).attr("width", D).attr("height", n).attr("fill", s).attr("stroke", l), L.attr("class", "swimlane-body").attr("style", p).attr("x", a).attr("y", r).attr("width", D).attr("height", i).attr("fill", "none").attr("stroke", l);
228
- let c = t.x - T.width / 2, u = k + (n - T.height) / 2;
229
- C.attr("transform", `translate(${c}, ${u})`);
230
- }
231
- if (r.trace("Swimlane data ", t, JSON.stringify(t)), u) {
232
- let e = C.select("span");
233
- e && e.attr("style", u);
234
- }
235
- return t.offsetX = 0, t.width = D, t.height = O, t.offsetY = T.height - E / 2, t.intersect = function(e) {
236
- return j(t, e);
237
- }, {
238
- cluster: v,
239
- labelBBox: T
240
- };
241
- }, "swimlane"), F = /* @__PURE__ */ a(async (e, t) => {
242
- r.info("Creating subgraph rect for ", t.id, t);
243
- let n = f(), { themeVariables: a, handDrawnSeed: o } = n, { clusterBkg: s, clusterBorder: c } = a, { labelStyles: u, nodeStyles: d, borderStyles: p, backgroundStyles: g } = h(t), _ = e.insert("g").attr("class", "cluster " + t.cssClasses).attr("id", t.domId).attr("data-look", t.look), y = l(n), b = _.insert("g").attr("class", "cluster-label "), C;
244
- C = t.labelType === "markdown" ? await x(b, t.label, {
245
- style: t.labelStyle,
246
- useHtmlLabels: y,
247
- isNode: !0,
248
- width: t.width
249
- }) : await M(b, t.label, t.labelStyle || "", !1, !0);
250
- let w = C.getBBox();
251
- if (l(n)) {
252
- let e = C.children[0], t = i(C);
253
- w = e.getBoundingClientRect(), t.attr("width", w.width), t.attr("height", w.height);
254
- }
255
- let T = t.width <= w.width + t.padding ? w.width + t.padding : t.width;
256
- t.diff = t.width <= w.width + t.padding ? (T - t.width) / 2 - t.padding : -t.padding;
257
- let E = t.height, D = t.x - T / 2, O = t.y - E / 2;
258
- r.trace("Data ", t, JSON.stringify(t));
259
- let k;
260
- if (t.look === "handDrawn") {
261
- let e = S.svg(_), n = m(t, {
262
- roughness: .7,
263
- fill: s,
264
- stroke: c,
265
- fillWeight: 3,
266
- seed: o
267
- }), i = e.path(N(D, O, T, E, 0), n);
268
- k = _.insert(() => (r.debug("Rough node insert CXC", i), i), ":first-child"), k.select("path:nth-child(2)").attr("style", p.join(";")), k.select("path").attr("style", g.join(";").replace("fill", "stroke"));
269
- } else k = _.insert("rect", ":first-child"), k.attr("style", d).attr("rx", t.rx).attr("ry", t.ry).attr("x", D).attr("y", O).attr("width", T).attr("height", E);
270
- let { subGraphTitleTopMargin: A } = v(n);
271
- if (b.attr("transform", `translate(${t.x - w.width / 2}, ${t.y - t.height / 2 + A})`), u) {
272
- let e = b.select("span");
273
- e && e.attr("style", u);
274
- }
275
- let P = k.node().getBBox();
276
- return t.offsetX = 0, t.width = P.width, t.height = P.height, t.offsetY = w.height - t.padding / 2, t.intersect = function(e) {
277
- return j(t, e);
278
- }, {
279
- cluster: _,
280
- labelBBox: w
281
- };
282
- }, "rect"), I = {
283
- rect: F,
284
- squareRect: F,
285
- roundedWithTitle: /* @__PURE__ */ a(async (e, t) => {
286
- let n = f(), { themeVariables: r, handDrawnSeed: a } = n, { altBackground: o, compositeBackground: s, compositeTitleBackground: c, nodeBorder: u } = r, d = e.insert("g").attr("class", t.cssClasses).attr("id", t.domId).attr("data-id", t.id).attr("data-look", t.look), p = d.insert("g", ":first-child"), m = d.insert("g").attr("class", "cluster-label"), h = d.append("rect"), g = await M(m, t.label, t.labelStyle, void 0, !0), _ = g.getBBox();
287
- if (l(n)) {
288
- let e = g.children[0], t = i(g);
289
- _ = e.getBoundingClientRect(), t.attr("width", _.width), t.attr("height", _.height);
290
- }
291
- let v = 0 * t.padding, y = v / 2, b = (t.width <= _.width + t.padding ? _.width + t.padding : t.width) + v;
292
- t.diff = t.width <= _.width + t.padding ? (b - t.width) / 2 - t.padding : -t.padding;
293
- let x = t.height + v, C = t.height + v - _.height - 6, w = t.x - b / 2, T = t.y - x / 2;
294
- t.width = b;
295
- let E = t.y - t.height / 2 - y + _.height + 2, D;
296
- if (t.look === "handDrawn") {
297
- let e = t.cssClasses.includes("statediagram-cluster-alt"), n = S.svg(d), r = t.rx || t.ry ? n.path(N(w, T, b, x, 10), {
298
- roughness: .7,
299
- fill: c,
300
- fillStyle: "solid",
301
- stroke: u,
302
- seed: a
303
- }) : n.rectangle(w, T, b, x, { seed: a });
304
- D = d.insert(() => r, ":first-child");
305
- let i = n.rectangle(w, E, b, C, {
306
- fill: e ? o : s,
307
- fillStyle: e ? "hachure" : "solid",
308
- stroke: u,
309
- seed: a
310
- });
311
- D = d.insert(() => r, ":first-child"), h = d.insert(() => i);
312
- } else D = p.insert("rect", ":first-child"), D.attr("class", "outer").attr("x", w).attr("y", T).attr("width", b).attr("height", x).attr("data-look", t.look), h.attr("class", "inner").attr("x", w).attr("y", E).attr("width", b).attr("height", C);
313
- return m.attr("transform", `translate(${t.x - _.width / 2}, ${T + 1 - (l(n) ? 0 : 3)})`), t.height = D.node().getBBox().height, t.offsetX = 0, t.offsetY = _.height - t.padding / 2, t.labelBBox = _, t.intersect = function(e) {
314
- return j(t, e);
315
- }, {
316
- cluster: d,
317
- labelBBox: _
318
- };
319
- }, "roundedWithTitle"),
320
- noteGroup: /* @__PURE__ */ a((e, t) => {
321
- let n = e.insert("g").attr("class", "note-cluster").attr("id", t.domId), r = n.insert("rect", ":first-child"), i = 0 * t.padding, a = i / 2;
322
- r.attr("rx", t.rx).attr("ry", t.ry).attr("x", t.x - t.width / 2 - a).attr("y", t.y - t.height / 2 - a).attr("width", t.width + i).attr("height", t.height + i).attr("fill", "none");
323
- let o = r.node().getBBox();
324
- return t.width = o.width, t.height = o.height, t.intersect = function(e) {
325
- return j(t, e);
326
- }, {
327
- cluster: n,
328
- labelBBox: {
329
- width: 0,
330
- height: 0
331
- }
332
- };
333
- }, "noteGroup"),
334
- divider: /* @__PURE__ */ a((e, t) => {
335
- let { themeVariables: n, handDrawnSeed: r } = f(), { nodeBorder: i } = n, a = e.insert("g").attr("class", t.cssClasses).attr("id", t.domId).attr("data-look", t.look), o = a.insert("g", ":first-child"), s = 0 * t.padding, c = t.width + s;
336
- t.diff = -t.padding;
337
- let l = t.height + s, u = t.x - c / 2, d = t.y - l / 2;
338
- t.width = c;
339
- let p;
340
- if (t.look === "handDrawn") {
341
- let e = S.svg(a).rectangle(u, d, c, l, {
342
- fill: "lightgrey",
343
- roughness: .5,
344
- strokeLineDash: [5],
345
- stroke: i,
346
- seed: r
347
- });
348
- p = a.insert(() => e, ":first-child");
349
- } else {
350
- p = o.insert("rect", ":first-child");
351
- let e = "outer";
352
- e = (t.look, "divider"), p.attr("class", e).attr("x", u).attr("y", d).attr("width", c).attr("height", l).attr("data-look", t.look);
353
- }
354
- return t.height = p.node().getBBox().height, t.offsetX = 0, t.offsetY = 0, t.intersect = function(e) {
355
- return j(t, e);
356
- }, {
357
- cluster: a,
358
- labelBBox: {}
359
- };
360
- }, "divider"),
361
- kanbanSection: /* @__PURE__ */ a(async (e, t) => {
362
- r.info("Creating subgraph rect for ", t.id, t);
363
- let n = f(), { themeVariables: a, handDrawnSeed: o } = n, { clusterBkg: s, clusterBorder: c } = a, { labelStyles: u, nodeStyles: d, borderStyles: p, backgroundStyles: g } = h(t), _ = e.insert("g").attr("class", "cluster " + t.cssClasses).attr("id", t.domId).attr("data-look", t.look), y = l(n), b = _.insert("g").attr("class", "cluster-label "), C = await x(b, t.label, {
364
- style: t.labelStyle,
365
- useHtmlLabels: y,
366
- isNode: !0,
367
- width: t.width
368
- }), w = C.getBBox();
369
- if (l(n)) {
370
- let e = C.children[0], t = i(C);
371
- w = e.getBoundingClientRect(), t.attr("width", w.width), t.attr("height", w.height);
372
- }
373
- let T = t.width <= w.width + t.padding ? w.width + t.padding : t.width;
374
- t.diff = t.width <= w.width + t.padding ? (T - t.width) / 2 - t.padding : -t.padding;
375
- let E = t.height, D = t.x - T / 2, O = t.y - E / 2;
376
- r.trace("Data ", t, JSON.stringify(t));
377
- let k;
378
- if (t.look === "handDrawn") {
379
- let e = S.svg(_), n = m(t, {
380
- roughness: .7,
381
- fill: s,
382
- stroke: c,
383
- fillWeight: 4,
384
- seed: o
385
- }), i = e.path(N(D, O, T, E, t.rx), n);
386
- k = _.insert(() => (r.debug("Rough node insert CXC", i), i), ":first-child"), k.select("path:nth-child(2)").attr("style", p.join(";")), k.select("path").attr("style", g.join(";").replace("fill", "stroke"));
387
- } else k = _.insert("rect", ":first-child"), k.attr("style", d).attr("rx", t.rx).attr("ry", t.ry).attr("x", D).attr("y", O).attr("width", T).attr("height", E);
388
- let { subGraphTitleTopMargin: A } = v(n);
389
- if (b.attr("transform", `translate(${t.x - w.width / 2}, ${t.y - t.height / 2 + A})`), u) {
390
- let e = b.select("span");
391
- e && e.attr("style", u);
392
- }
393
- let M = k.node().getBBox();
394
- return t.offsetX = 0, t.width = M.width, t.height = M.height, t.offsetY = w.height - t.padding / 2, t.intersect = function(e) {
395
- return j(t, e);
396
- }, {
397
- cluster: _,
398
- labelBBox: w
399
- };
400
- }, "kanbanSection"),
401
- swimlane: P
402
- }, L = /* @__PURE__ */ new Map(), ee = /* @__PURE__ */ a(async (e, t) => {
403
- let n = await I[t.shape || "rect"](e, t);
404
- return L.set(t.id, n), n;
405
- }, "insertCluster"), R = /* @__PURE__ */ a(() => {
406
- L = /* @__PURE__ */ new Map();
407
- }, "clear");
408
- function z(e, t) {
409
- return e.intersect(t);
410
- }
411
- a(z, "intersectNode");
412
- var te = z;
413
- function B(e, t, n, r) {
414
- 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);
415
- r.x < i && (l = -l);
416
- var u = Math.abs(t * n * s / c);
417
- return r.y < a && (u = -u), {
418
- x: i + l,
419
- y: a + u
420
- };
421
- }
422
- a(B, "intersectEllipse");
423
- var V = B;
424
- function H(e, t, n) {
425
- return V(e, t, t, n);
426
- }
427
- a(H, "intersectCircle");
428
- var U = H;
429
- function ne(e, t, n, r) {
430
- {
431
- 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;
432
- if (s !== 0 && c !== 0 && re(s, c)) return;
433
- 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;
434
- if (Math.abs(p) < l && Math.abs(m) < l && re(p, m)) return;
435
- let h = i * d - u * a;
436
- if (h === 0) return;
437
- let g = Math.abs(h / 2), _ = a * f - d * o, v = _ < 0 ? (_ - g) / h : (_ + g) / h;
438
- return _ = u * o - i * f, {
439
- x: v,
440
- y: _ < 0 ? (_ - g) / h : (_ + g) / h
441
- };
442
- }
443
- }
444
- a(ne, "intersectLine");
445
- function re(e, t) {
446
- return e * t > 0;
447
- }
448
- a(re, "sameSign");
449
- var ie = ne;
450
- function W(e, t, n) {
451
- let r = e.x, i = e.y, a = [], o = Infinity, s = Infinity;
452
- typeof t.forEach == "function" ? t.forEach(function(e) {
453
- o = Math.min(o, e.x), s = Math.min(s, e.y);
454
- }) : (o = Math.min(o, t.x), s = Math.min(s, t.y));
455
- let c = r - e.width / 2 - o, l = i - e.height / 2 - s;
456
- for (let r = 0; r < t.length; r++) {
457
- let i = t[r], o = t[r < t.length - 1 ? r + 1 : 0], s = ie(e, n, {
458
- x: c + i.x,
459
- y: l + i.y
460
- }, {
461
- x: c + o.x,
462
- y: l + o.y
463
- });
464
- s && a.push(s);
465
- }
466
- return a.length ? (a.length > 1 && a.sort(function(e, t) {
467
- 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);
468
- return a < c ? -1 : a === c ? 0 : 1;
469
- }), a[0]) : e;
470
- }
471
- a(W, "intersectPolygon");
472
- var G = {
473
- node: te,
474
- circle: U,
475
- ellipse: V,
476
- polygon: W,
477
- rect: j
478
- };
479
- function K(e, t) {
480
- let { labelStyles: i } = h(t);
481
- t.labelStyle = i;
482
- let a = E(t), o = a;
483
- a || (o = "anchor");
484
- let s = e.insert("g").attr("class", o).attr("id", t.domId || t.id), { cssStyles: c } = t, l = S.svg(s), u = m(t, {
485
- fill: "black",
486
- stroke: "none",
487
- fillStyle: "solid"
488
- });
489
- t.look !== "handDrawn" && (u.roughness = 0);
490
- let d = l.circle(0, 0, 2, u), f = s.insert(() => d, ":first-child");
491
- return f.attr("class", "anchor").attr("style", n(c)), T(t, f), t.intersect = function(e) {
492
- return r.info("Circle intersect", t, 1, e), G.circle(t, 1, e);
493
- }, s;
494
- }
495
- a(K, "anchor");
496
- function ae(e, t, n, r, i, a, o) {
497
- 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);
498
- if (m > 1) throw Error("The given radii are too small to create an arc between the points.");
499
- 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;
500
- o && y < 0 && (y += 2 * Math.PI), !o && y > 0 && (y -= 2 * Math.PI);
501
- let b = [];
502
- for (let e = 0; e < 20; e++) {
503
- let t = v + e / 19 * y, n = g + i * Math.cos(t), r = _ + a * Math.sin(t);
504
- b.push({
505
- x: n,
506
- y: r
507
- });
508
- }
509
- return b;
510
- }
511
- a(ae, "generateArcPoints");
512
- function oe(e, t, n) {
513
- let [r, i] = [t, n].sort((e, t) => t - e);
514
- return i * (1 - Math.sqrt(1 - (e / r / 2) ** 2));
515
- }
516
- a(oe, "calculateArcSagitta");
517
- async function se(e, t) {
518
- let { labelStyles: n, nodeStyles: r } = h(t);
519
- t.labelStyle = n;
520
- let i = t.padding ?? 0, o = t.look === "neo" ? 16 : i, s = t.look === "neo" ? 12 : i, c = /* @__PURE__ */ a((e) => e + s, "calcTotalHeight"), l = /* @__PURE__ */ a((e) => {
521
- let t = e / 2;
522
- return [t / (2.5 + e / 50), t];
523
- }, "calcEllipseRadius"), { shapeSvg: u, bbox: d } = await C(e, t, E(t)), f = c(t?.height ? t?.height : d.height), [p, g] = l(f), _ = oe(f, p, g), v = (t?.width ? t?.width : d.width) + o * 2 + _ - _, y = f, { cssStyles: b } = t, x = [
524
- {
525
- x: v / 2,
526
- y: -y / 2
527
- },
528
- {
529
- x: -v / 2,
530
- y: -y / 2
531
- },
532
- ...ae(-v / 2, -y / 2, -v / 2, y / 2, p, g, !1),
533
- {
534
- x: v / 2,
535
- y: y / 2
536
- },
537
- ...ae(v / 2, y / 2, v / 2, -y / 2, p, g, !0)
538
- ], w = S.svg(u), O = m(t, {});
539
- t.look !== "handDrawn" && (O.roughness = 0, O.fillStyle = "solid");
540
- let k = D(x), A = w.path(k, O), j = u.insert(() => A, ":first-child");
541
- return j.attr("class", "basic label-container outer-path"), b && t.look !== "handDrawn" && j.selectAll("path").attr("style", b), r && t.look !== "handDrawn" && j.selectAll("path").attr("style", r), j.attr("transform", `translate(${p / 2}, 0)`), T(t, j), t.intersect = function(e) {
542
- return G.polygon(t, x, e);
543
- }, u;
544
- }
545
- a(se, "bowTieRect");
546
- function q(e, t, n, r) {
547
- return e.insert("polygon", ":first-child").attr("points", r.map(function(e) {
548
- return e.x + "," + e.y;
549
- }).join(" ")).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + n / 2 + ")");
550
- }
551
- a(q, "insertPolygonShape");
552
- var ce = 12;
553
- async function le(e, t) {
554
- let { labelStyles: n, nodeStyles: r } = h(t);
555
- t.labelStyle = n;
556
- let i = t.padding ?? 0, a = t.look === "neo" ? 28 : i, o = t.look === "neo" ? 24 : i, { shapeSvg: s, bbox: c } = await C(e, t, E(t)), l = (t?.width ?? c.width) + (t.look === "neo" ? a * 2 : a + ce), u = (t?.height ?? c.height) + (t.look === "neo" ? o * 2 : o), d = l, f = -u, p = [
557
- {
558
- x: 0 + ce,
559
- y: f
560
- },
561
- {
562
- x: d,
563
- y: f
564
- },
565
- {
566
- x: d,
567
- y: 0
568
- },
569
- {
570
- x: 0,
571
- y: 0
572
- },
573
- {
574
- x: 0,
575
- y: f + ce
576
- },
577
- {
578
- x: 0 + ce,
579
- y: f
580
- }
581
- ], g, { cssStyles: _ } = t;
582
- if (t.look === "handDrawn") {
583
- let e = S.svg(s), n = m(t, {}), r = D(p), i = e.path(r, n);
584
- g = s.insert(() => i, ":first-child").attr("transform", `translate(${-l / 2}, ${u / 2})`), _ && g.attr("style", _);
585
- } else g = q(s, l, u, p);
586
- return r && g.attr("style", r), T(t, g), t.intersect = function(e) {
587
- return G.polygon(t, p, e);
588
- }, s;
589
- }
590
- a(le, "card");
591
- function ue(e, t) {
592
- let { nodeStyles: n } = h(t);
593
- t.label = "";
594
- let r = e.insert("g").attr("class", E(t)).attr("id", t.domId ?? t.id), { cssStyles: i } = t, a = Math.max(28, t.width ?? 0), o = [
595
- {
596
- x: 0,
597
- y: a / 2
598
- },
599
- {
600
- x: a / 2,
601
- y: 0
602
- },
603
- {
604
- x: 0,
605
- y: -a / 2
606
- },
607
- {
608
- x: -a / 2,
609
- y: 0
610
- }
611
- ], s = S.svg(r), c = m(t, {});
612
- t.look !== "handDrawn" && (c.roughness = 0, c.fillStyle = "solid");
613
- let l = D(o), u = s.path(l, c), d = r.insert(() => u, ":first-child");
614
- 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) {
615
- return G.polygon(t, o, e);
616
- }, r;
617
- }
618
- a(ue, "choice");
619
- async function de(e, t, i) {
620
- let { labelStyles: a, nodeStyles: o } = h(t);
621
- t.labelStyle = a;
622
- let { shapeSvg: s, bbox: c, halfPadding: l } = await C(e, t, E(t)), u = i?.padding ?? l, d = t.look === "neo" ? c.width / 2 + 32 : c.width / 2 + u, f, { cssStyles: p } = t;
623
- if (t.look === "handDrawn") {
624
- let e = S.svg(s), r = m(t, {}), i = e.circle(0, 0, d * 2, r);
625
- f = s.insert(() => i, ":first-child"), f.attr("class", "basic label-container").attr("style", n(p));
626
- } else f = s.insert("circle", ":first-child").attr("class", "basic label-container").attr("style", o).attr("r", d).attr("cx", 0).attr("cy", 0);
627
- return T(t, f), t.calcIntersect = function(e, t) {
628
- let n = e.width / 2;
629
- return G.circle(e, n, t);
630
- }, t.intersect = function(e) {
631
- return r.info("Circle intersect", t, d, e), G.circle(t, d, e);
632
- }, s;
633
- }
634
- a(de, "circle");
635
- function fe(e) {
636
- let t = Math.cos(Math.PI / 4), n = Math.sin(Math.PI / 4), r = e * 2, i = {
637
- x: r / 2 * t,
638
- y: r / 2 * n
639
- }, a = {
640
- x: -(r / 2) * t,
641
- y: r / 2 * n
642
- }, o = {
643
- x: -(r / 2) * t,
644
- y: -(r / 2) * n
645
- }, s = {
646
- x: r / 2 * t,
647
- y: -(r / 2) * n
648
- };
649
- return `M ${a.x},${a.y} L ${s.x},${s.y}
650
- M ${i.x},${i.y} L ${o.x},${o.y}`;
651
- }
652
- a(fe, "createLine");
653
- function pe(e, t) {
654
- let { labelStyles: n, nodeStyles: i } = h(t);
655
- t.labelStyle = n, t.label = "";
656
- let a = e.insert("g").attr("class", E(t)).attr("id", t.domId ?? t.id), o = Math.max(30, t?.width ?? 0), { cssStyles: s } = t, c = S.svg(a), l = m(t, {});
657
- t.look !== "handDrawn" && (l.roughness = 0, l.fillStyle = "solid");
658
- let u = c.circle(0, 0, o * 2, l), d = fe(o), f = c.path(d, l), p = a.insert(() => u, ":first-child");
659
- return p.insert(() => f), p.attr("class", "outer-path"), s && t.look !== "handDrawn" && p.selectAll("path").attr("style", s), i && t.look !== "handDrawn" && p.selectAll("path").attr("style", i), T(t, p), t.intersect = function(e) {
660
- return r.info("crossedCircle intersect", t, {
661
- radius: o,
662
- point: e
663
- }), G.circle(t, o, e);
664
- }, a;
665
- }
666
- a(pe, "crossedCircle");
667
- function J(e, t, n, r = 100, i = 0, a = 180) {
668
- let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
669
- for (let i = 0; i < r; i++) {
670
- let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
671
- o.push({
672
- x: -a,
673
- y: -l
674
- });
675
- }
676
- return o;
677
- }
678
- a(J, "generateCirclePoints");
679
- async function me(e, t) {
680
- let { labelStyles: n, nodeStyles: r } = h(t);
681
- t.labelStyle = n;
682
- let { shapeSvg: i, bbox: a, label: o } = await C(e, t, E(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 = [
683
- ...J(l / 2, -u / 2, d, 30, -90, 0),
684
- {
685
- x: -l / 2 - d,
686
- y: d
687
- },
688
- ...J(l / 2 + d * 2, -d, d, 20, -180, -270),
689
- ...J(l / 2 + d * 2, d, d, 20, -90, -180),
690
- {
691
- x: -l / 2 - d,
692
- y: -u / 2
693
- },
694
- ...J(l / 2, u / 2, d, 20, 0, 90)
695
- ], g = [
696
- {
697
- x: l / 2,
698
- y: -u / 2 - d
699
- },
700
- {
701
- x: -l / 2,
702
- y: -u / 2 - d
703
- },
704
- ...J(l / 2, -u / 2, d, 20, -90, 0),
705
- {
706
- x: -l / 2 - d,
707
- y: -d
708
- },
709
- ...J(l / 2 + l * .1, -d, d, 20, -180, -270),
710
- ...J(l / 2 + l * .1, d, d, 20, -90, -180),
711
- {
712
- x: -l / 2 - d,
713
- y: u / 2
714
- },
715
- ...J(l / 2, u / 2, d, 20, 0, 90),
716
- {
717
- x: -l / 2,
718
- y: u / 2 + d
719
- },
720
- {
721
- x: l / 2,
722
- y: u / 2 + d
723
- }
724
- ], _ = S.svg(i), v = m(t, { fill: "none" });
725
- t.look !== "handDrawn" && (v.roughness = 0, v.fillStyle = "solid");
726
- let y = D(p).replace("Z", ""), b = _.path(y, v), x = D(g), w = _.path(x, { ...v }), O = i.insert("g", ":first-child");
727
- return O.insert(() => w, ":first-child").attr("stroke-opacity", 0), O.insert(() => b, ":first-child"), O.attr("class", "text"), f && t.look !== "handDrawn" && O.selectAll("path").attr("style", f), r && t.look !== "handDrawn" && O.selectAll("path").attr("style", r), O.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))})`), T(t, O), t.intersect = function(e) {
728
- return G.polygon(t, g, e);
729
- }, i;
730
- }
731
- a(me, "curlyBraceLeft");
732
- function Y(e, t, n, r = 100, i = 0, a = 180) {
733
- let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
734
- for (let i = 0; i < r; i++) {
735
- let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
736
- o.push({
737
- x: a,
738
- y: l
739
- });
740
- }
741
- return o;
742
- }
743
- a(Y, "generateCirclePoints");
744
- async function he(e, t) {
745
- let { labelStyles: n, nodeStyles: r } = h(t);
746
- t.labelStyle = n;
747
- let { shapeSvg: i, bbox: a, label: o } = await C(e, t, E(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 = [
748
- ...Y(l / 2, -u / 2, d, 20, -90, 0),
749
- {
750
- x: l / 2 + d,
751
- y: -d
752
- },
753
- ...Y(l / 2 + d * 2, -d, d, 20, -180, -270),
754
- ...Y(l / 2 + d * 2, d, d, 20, -90, -180),
755
- {
756
- x: l / 2 + d,
757
- y: u / 2
758
- },
759
- ...Y(l / 2, u / 2, d, 20, 0, 90)
760
- ], g = [
761
- {
762
- x: -l / 2,
763
- y: -u / 2 - d
764
- },
765
- {
766
- x: l / 2,
767
- y: -u / 2 - d
768
- },
769
- ...Y(l / 2, -u / 2, d, 20, -90, 0),
770
- {
771
- x: l / 2 + d,
772
- y: -d
773
- },
774
- ...Y(l / 2 + d * 2, -d, d, 20, -180, -270),
775
- ...Y(l / 2 + d * 2, d, d, 20, -90, -180),
776
- {
777
- x: l / 2 + d,
778
- y: u / 2
779
- },
780
- ...Y(l / 2, u / 2, d, 20, 0, 90),
781
- {
782
- x: l / 2,
783
- y: u / 2 + d
784
- },
785
- {
786
- x: -l / 2,
787
- y: u / 2 + d
788
- }
789
- ], _ = S.svg(i), v = m(t, { fill: "none" });
790
- t.look !== "handDrawn" && (v.roughness = 0, v.fillStyle = "solid");
791
- let y = D(p).replace("Z", ""), b = _.path(y, v), x = D(g), w = _.path(x, { ...v }), O = i.insert("g", ":first-child");
792
- return O.insert(() => w, ":first-child").attr("stroke-opacity", 0), O.insert(() => b, ":first-child"), O.attr("class", "text"), f && t.look !== "handDrawn" && O.selectAll("path").attr("style", f), r && t.look !== "handDrawn" && O.selectAll("path").attr("style", r), O.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))})`), T(t, O), t.intersect = function(e) {
793
- return G.polygon(t, g, e);
794
- }, i;
795
- }
796
- a(he, "curlyBraceRight");
797
- function X(e, t, n, r = 100, i = 0, a = 180) {
798
- let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
799
- for (let i = 0; i < r; i++) {
800
- let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
801
- o.push({
802
- x: -a,
803
- y: -l
804
- });
805
- }
806
- return o;
807
- }
808
- a(X, "generateCirclePoints");
809
- async function ge(e, t) {
810
- let { labelStyles: n, nodeStyles: r } = h(t);
811
- t.labelStyle = n;
812
- let { shapeSvg: i, bbox: a, label: o } = await C(e, t, E(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 = [
813
- ...X(l / 2, -u / 2, d, 30, -90, 0),
814
- {
815
- x: -l / 2 - d,
816
- y: d
817
- },
818
- ...X(l / 2 + d * 2, -d, d, 20, -180, -270),
819
- ...X(l / 2 + d * 2, d, d, 20, -90, -180),
820
- {
821
- x: -l / 2 - d,
822
- y: -u / 2
823
- },
824
- ...X(l / 2, u / 2, d, 20, 0, 90)
825
- ], g = [
826
- ...X(-l / 2 + d + d / 2, -u / 2, d, 20, -90, -180),
827
- {
828
- x: l / 2 - d / 2,
829
- y: d
830
- },
831
- ...X(-l / 2 - d / 2, -d, d, 20, 0, 90),
832
- ...X(-l / 2 - d / 2, d, d, 20, -90, 0),
833
- {
834
- x: l / 2 - d / 2,
835
- y: -d
836
- },
837
- ...X(-l / 2 + d + d / 2, u / 2, d, 30, -180, -270)
838
- ], _ = [
839
- {
840
- x: l / 2,
841
- y: -u / 2 - d
842
- },
843
- {
844
- x: -l / 2,
845
- y: -u / 2 - d
846
- },
847
- ...X(l / 2, -u / 2, d, 20, -90, 0),
848
- {
849
- x: -l / 2 - d,
850
- y: -d
851
- },
852
- ...X(l / 2 + d * 2, -d, d, 20, -180, -270),
853
- ...X(l / 2 + d * 2, d, d, 20, -90, -180),
854
- {
855
- x: -l / 2 - d,
856
- y: u / 2
857
- },
858
- ...X(l / 2, u / 2, d, 20, 0, 90),
859
- {
860
- x: -l / 2,
861
- y: u / 2 + d
862
- },
863
- {
864
- x: l / 2 - d - d / 2,
865
- y: u / 2 + d
866
- },
867
- ...X(-l / 2 + d + d / 2, -u / 2, d, 20, -90, -180),
868
- {
869
- x: l / 2 - d / 2,
870
- y: d
871
- },
872
- ...X(-l / 2 - d / 2, -d, d, 20, 0, 90),
873
- ...X(-l / 2 - d / 2, d, d, 20, -90, 0),
874
- {
875
- x: l / 2 - d / 2,
876
- y: -d
877
- },
878
- ...X(-l / 2 + d + d / 2, u / 2, d, 30, -180, -270)
879
- ], v = S.svg(i), y = m(t, { fill: "none" });
880
- t.look !== "handDrawn" && (y.roughness = 0, y.fillStyle = "solid");
881
- let b = D(p).replace("Z", ""), x = v.path(b, y), w = D(g).replace("Z", ""), O = v.path(w, y), k = D(_), A = v.path(k, { ...y }), j = i.insert("g", ":first-child");
882
- return j.insert(() => A, ":first-child").attr("stroke-opacity", 0), j.insert(() => x, ":first-child"), j.insert(() => O, ":first-child"), j.attr("class", "text"), f && t.look !== "handDrawn" && j.selectAll("path").attr("style", f), r && t.look !== "handDrawn" && j.selectAll("path").attr("style", r), j.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))})`), T(t, j), t.intersect = function(e) {
883
- return G.polygon(t, _, e);
884
- }, i;
885
- }
886
- a(ge, "curlyBraces");
887
- async function _e(e, t) {
888
- let { labelStyles: n, nodeStyles: r } = h(t);
889
- t.labelStyle = n;
890
- let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i, { shapeSvg: s, bbox: c } = await C(e, t, E(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 = S.svg(s), g = m(t, {});
891
- t.look !== "handDrawn" && (g.roughness = 0, g.fillStyle = "solid");
892
- let _ = l, v = u, y = _ - d, b = v / 4, x = [
893
- {
894
- x: y,
895
- y: 0
896
- },
897
- {
898
- x: b,
899
- y: 0
900
- },
901
- {
902
- x: 0,
903
- y: v / 2
904
- },
905
- {
906
- x: b,
907
- y: v
908
- },
909
- {
910
- x: y,
911
- y: v
912
- },
913
- ...k(-y, -v / 2, d, 50, 270, 90)
914
- ], w = D(x), O = p.path(w, g), A = s.insert(() => O, ":first-child");
915
- return A.attr("class", "basic label-container outer-path"), f && t.look !== "handDrawn" && A.selectChildren("path").attr("style", f), r && t.look !== "handDrawn" && A.selectChildren("path").attr("style", r), A.attr("transform", `translate(${-l / 2}, ${-u / 2})`), T(t, A), t.intersect = function(e) {
916
- return G.polygon(t, x, e);
917
- }, s;
918
- }
919
- a(_e, "curvedTrapezoid");
920
- var ve = /* @__PURE__ */ a((e, t, n, r, i, a) => [
921
- `M${e},${t + a}`,
922
- `a${i},${a} 0,0,0 ${n},0`,
923
- `a${i},${a} 0,0,0 ${-n},0`,
924
- `l0,${r}`,
925
- `a${i},${a} 0,0,0 ${n},0`,
926
- `l0,${-r}`
927
- ].join(" "), "createCylinderPathD"), ye = /* @__PURE__ */ a((e, t, n, r, i, a) => [
928
- `M${e},${t + a}`,
929
- `M${e + n},${t + a}`,
930
- `a${i},${a} 0,0,0 ${-n},0`,
931
- `l0,${r}`,
932
- `a${i},${a} 0,0,0 ${n},0`,
933
- `l0,${-r}`
934
- ].join(" "), "createOuterCylinderPathD"), be = /* @__PURE__ */ a((e, t, n, r, i, a) => [`M${e - n / 2},${-r / 2}`, `a${i},${a} 0,0,0 ${n},0`].join(" "), "createInnerCylinderPathD"), xe = 8, Se = 8;
935
- async function Ce(e, t) {
936
- let { labelStyles: r, nodeStyles: i } = h(t);
937
- t.labelStyle = r;
938
- let a = t.padding ?? 0, o = t.look === "neo" ? 24 : a, s = t.look === "neo" ? 24 : a;
939
- if (t.width || t.height) {
940
- let e = t.width ?? 0;
941
- t.width = (t.width ?? 0) - s, t.width < Se && (t.width = Se);
942
- let n = e / 2 / (2.5 + e / 50);
943
- t.height = (t.height ?? 0) - o - n * 3, t.height < xe && (t.height = xe);
944
- }
945
- let { shapeSvg: c, bbox: l, label: u } = await C(e, t, E(t)), d = (t.width ? t.width : l.width) + s, f = d / 2, p = f / (2.5 + d / 50), g = (t.height ? t.height : l.height) + o + p, _, { cssStyles: v } = t;
946
- if (t.look === "handDrawn") {
947
- let e = S.svg(c), n = ye(0, 0, d, g, f, p), r = be(0, p, d, g, f, p), i = m(t, {}), a = e.path(n, i), o = e.path(r, m(t, { fill: "none" }));
948
- _ = c.insert(() => o, ":first-child"), _ = c.insert(() => a, ":first-child"), _.attr("class", "basic label-container"), v && _.attr("style", v);
949
- } else {
950
- let e = ve(0, 0, d, g, f, p);
951
- _ = c.insert("path", ":first-child").attr("d", e).attr("class", "basic label-container outer-path").attr("style", n(v)).attr("style", i);
952
- }
953
- return _.attr("label-offset-y", p), _.attr("transform", `translate(${-d / 2}, ${-(g / 2 + p)})`), T(t, _), 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) {
954
- let n = G.rect(t, e), r = n.x - (t.x ?? 0);
955
- 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)) {
956
- let i = p * p * (1 - r * r / (f * f));
957
- i > 0 && (i = Math.sqrt(i)), i = p - i, e.y - (t.y ?? 0) > 0 && (i = -i), n.y += i;
958
- }
959
- return n;
960
- }, c;
961
- }
962
- a(Ce, "cylinder");
963
- async function we(e, t, r) {
964
- let { labelStyles: i, nodeStyles: a } = h(t);
965
- t.labelStyle = i;
966
- let { shapeSvg: o, bbox: s } = await C(e, t, E(t)), c = Math.max(s.width + r.labelPaddingX * 2, t?.width || 0), l = Math.max(s.height + r.labelPaddingY * 2, t?.height || 0), u = -c / 2, d = -l / 2, f, { rx: p, ry: g } = t, { cssStyles: _ } = t;
967
- if (r?.rx && r.ry && (p = r.rx, g = r.ry), t.look === "handDrawn") {
968
- let e = S.svg(o), r = m(t, {}), i = p || g ? e.path(N(u, d, c, l, p || 0), r) : e.rectangle(u, d, c, l, r);
969
- f = o.insert(() => i, ":first-child"), f.attr("class", "basic label-container").attr("style", n(_));
970
- } else f = o.insert("rect", ":first-child"), f.attr("class", "basic label-container").attr("style", a).attr("rx", n(p)).attr("ry", n(g)).attr("x", u).attr("y", d).attr("width", c).attr("height", l);
971
- return T(t, f), t.calcIntersect = function(e, t) {
972
- return G.rect(e, t);
973
- }, t.intersect = function(e) {
974
- return G.rect(t, e);
975
- }, o;
976
- }
977
- a(we, "drawRect");
978
- async function Te(e, t) {
979
- let { cssClasses: n, labelPaddingX: r, labelPaddingY: i, padding: a, width: o, height: s } = t, c = await we(e, t, {
980
- rx: 0,
981
- ry: 0,
982
- classes: n ?? "",
983
- labelPaddingX: r ?? (a ?? 0) * 2,
984
- labelPaddingY: i ?? a ?? 0
985
- });
986
- if (t.look === "handDrawn") {
987
- let e = S.svg(c), n = m(t, {}), r = c.select(".basic.label-container > path:nth-child(2)"), i = r.node();
988
- if (!i) return c;
989
- let a = null;
990
- if (i instanceof SVGGraphicsElement) a = i.getBBox();
991
- else return c;
992
- 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;
993
- }
994
- let l = c.select(".basic.label-container"), u = (Number(l.attr("width")) || o) ?? 0, d = (Number(l.attr("height")) || s) ?? 0;
995
- return u > 0 && d > 0 && l.attr("stroke-dasharray", `${u} ${d}`), c;
996
- }
997
- a(Te, "datastore");
998
- async function Ee(e, t) {
999
- let { labelStyles: n, nodeStyles: r } = h(t);
1000
- t.labelStyle = n;
1001
- let i = t.look === "neo" ? 16 : t.padding ?? 0, a = t.look === "neo" ? 16 : t.padding ?? 0, { shapeSvg: o, bbox: s, label: c } = await C(e, t, E(t)), l = s.width + i, u = s.height + a, d = u * .2, f = -l / 2, p = -u / 2 - d / 2, { cssStyles: g } = t, _ = S.svg(o), v = m(t, {});
1002
- t.look !== "handDrawn" && (v.roughness = 0, v.fillStyle = "solid");
1003
- let y = [
1004
- {
1005
- x: f,
1006
- y: p + d
1007
- },
1008
- {
1009
- x: -f,
1010
- y: p + d
1011
- },
1012
- {
1013
- x: -f,
1014
- y: -p
1015
- },
1016
- {
1017
- x: f,
1018
- y: -p
1019
- },
1020
- {
1021
- x: f,
1022
- y: p
1023
- },
1024
- {
1025
- x: -f,
1026
- y: p
1027
- },
1028
- {
1029
- x: -f,
1030
- y: p + d
1031
- }
1032
- ], b = _.polygon(y.map((e) => [e.x, e.y]), v), x = o.insert(() => b, ":first-child");
1033
- return x.attr("class", "basic label-container outer-path"), g && t.look !== "handDrawn" && x.selectAll("path").attr("style", g), 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))})`), T(t, x), t.intersect = function(e) {
1034
- return G.rect(t, e);
1035
- }, o;
1036
- }
1037
- a(Ee, "dividedRectangle");
1038
- async function De(e, t) {
1039
- let { labelStyles: i, nodeStyles: a } = h(t), o = t.look === "neo" ? 12 : 5;
1040
- t.labelStyle = i;
1041
- let s = t.padding ?? 0, c = t.look === "neo" ? 16 : s, { shapeSvg: l, bbox: u } = await C(e, t, E(t)), d = (t?.width ? t?.width / 2 : u.width / 2) + (c ?? 0), f = d - o, p, { cssStyles: g } = t;
1042
- if (t.look === "handDrawn") {
1043
- let e = S.svg(l), r = m(t, {
1044
- roughness: .2,
1045
- strokeWidth: 2.5
1046
- }), i = m(t, {
1047
- roughness: .2,
1048
- strokeWidth: 1.5
1049
- }), a = e.circle(0, 0, d * 2, r), o = e.circle(0, 0, f * 2, i);
1050
- p = l.insert("g", ":first-child"), p.attr("class", n(t.cssClasses)).attr("style", n(g)), p.node()?.appendChild(a), p.node()?.appendChild(o);
1051
- } else {
1052
- p = l.insert("g", ":first-child");
1053
- let e = p.insert("circle", ":first-child"), t = p.insert("circle");
1054
- p.attr("class", "basic label-container").attr("style", a), e.attr("class", "outer-circle").attr("style", a).attr("r", d).attr("cx", 0).attr("cy", 0), t.attr("class", "inner-circle").attr("style", a).attr("r", f).attr("cx", 0).attr("cy", 0);
1055
- }
1056
- return T(t, p), t.intersect = function(e) {
1057
- return r.info("DoubleCircle intersect", t, d, e), G.circle(t, d, e);
1058
- }, l;
1059
- }
1060
- a(De, "doublecircle");
1061
- function Oe(e, t, { config: { themeVariables: n } }) {
1062
- let { labelStyles: i, nodeStyles: a } = h(t);
1063
- t.label = "", t.labelStyle = i;
1064
- let o = e.insert("g").attr("class", E(t)).attr("id", t.domId ?? t.id), { cssStyles: s } = t, c = S.svg(o), { nodeBorder: l } = n, u = m(t, { fillStyle: "solid" });
1065
- t.look !== "handDrawn" && (u.roughness = 0);
1066
- let d = c.circle(0, 0, 14, u), f = o.insert(() => d, ":first-child");
1067
- return f.selectAll("path").attr("style", `fill: ${l} !important;`), s && s.length > 0 && t.look !== "handDrawn" && f.selectAll("path").attr("style", s), a && t.look !== "handDrawn" && f.selectAll("path").attr("style", a), T(t, f), t.intersect = function(e) {
1068
- return r.info("filledCircle intersect", t, {
1069
- radius: 7,
1070
- point: e
1071
- }), G.circle(t, 7, e);
1072
- }, o;
1073
- }
1074
- a(Oe, "filledCircle");
1075
- var ke = 10, Ae = 10;
1076
- async function je(e, t) {
1077
- let { labelStyles: n, nodeStyles: i } = h(t);
1078
- t.labelStyle = n;
1079
- let a = t.padding ?? 0, o = t.look === "neo" ? a * 2 : a;
1080
- (t.width || t.height) && (t.height = t?.height ?? 0, t.height < ke && (t.height = ke), t.width = (t?.width ?? 0) - o - o / 2, t.width < Ae && (t.width = Ae));
1081
- let { shapeSvg: s, bbox: c, label: l } = await C(e, t, E(t)), u = (t?.width ? t?.width : c.width) + (o ?? 0), d = t?.height ? t?.height : u + c.height, f = d, p = [
1082
- {
1083
- x: 0,
1084
- y: -d
1085
- },
1086
- {
1087
- x: f,
1088
- y: -d
1089
- },
1090
- {
1091
- x: f / 2,
1092
- y: 0
1093
- }
1094
- ], { cssStyles: g } = t, _ = S.svg(s), v = m(t, {});
1095
- t.look !== "handDrawn" && (v.roughness = 0, v.fillStyle = "solid");
1096
- let y = D(p), b = _.path(y, v), x = s.insert(() => b, ":first-child").attr("transform", `translate(${-d / 2}, ${d / 2})`).attr("class", "outer-path");
1097
- return g && t.look !== "handDrawn" && x.selectChildren("path").attr("style", g), i && t.look !== "handDrawn" && x.selectChildren("path").attr("style", i), t.width = u, t.height = d, T(t, x), l.attr("transform", `translate(${-c.width / 2 - (c.x - (c.left ?? 0))}, ${-d / 2 + (t.padding ?? 0) / 2 + (c.y - (c.top ?? 0))})`), t.intersect = function(e) {
1098
- return r.info("Triangle intersect", t, p, e), G.polygon(t, p, e);
1099
- }, s;
1100
- }
1101
- a(je, "flippedTriangle");
1102
- function Me(e, t, { dir: n, config: { state: r, themeVariables: i } }) {
1103
- let { nodeStyles: a } = h(t);
1104
- t.label = "";
1105
- let o = e.insert("g").attr("class", E(t)).attr("id", t.domId ?? t.id), { cssStyles: s } = t, c = Math.max(70, t?.width ?? 0), l = Math.max(10, t?.height ?? 0);
1106
- n === "LR" && (c = Math.max(10, t?.width ?? 0), l = Math.max(70, t?.height ?? 0));
1107
- let u = -1 * c / 2, d = -1 * l / 2, f = S.svg(o), p = m(t, {
1108
- stroke: i.lineColor,
1109
- fill: i.lineColor
1110
- });
1111
- t.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
1112
- let g = f.rectangle(u, d, c, l, p), _ = o.insert(() => g, ":first-child");
1113
- s && t.look !== "handDrawn" && _.selectAll("path").attr("style", s), a && t.look !== "handDrawn" && _.selectAll("path").attr("style", a), T(t, _);
1114
- let v = r?.padding ?? 0;
1115
- return t.width && t.height && (t.width += v / 2 || 0, t.height += v / 2 || 0), t.intersect = function(e) {
1116
- return G.rect(t, e);
1117
- }, o;
1118
- }
1119
- a(Me, "forkJoin");
1120
- async function Ne(e, t) {
1121
- let { labelStyles: n, nodeStyles: i } = h(t);
1122
- t.labelStyle = n;
1123
- let a = t.look === "neo" ? 16 : t.padding ?? 0, o = t.look === "neo" ? 12 : t.padding ?? 0;
1124
- (t.width || t.height) && (t.height = (t?.height ?? 0) - o * 2, t.height < 10 && (t.height = 10), t.width = (t?.width ?? 0) - a * 2, t.width < 15 && (t.width = 15));
1125
- let { shapeSvg: s, bbox: c } = await C(e, t, E(t)), l = (t?.width ? t?.width : Math.max(15, c.width)) + a * 2, u = (t?.height ? t?.height : Math.max(10, c.height)) + o * 2, d = u / 2, { cssStyles: f } = t, p = S.svg(s), g = m(t, {});
1126
- t.look !== "handDrawn" && (g.roughness = 0, g.fillStyle = "solid");
1127
- let _ = [
1128
- {
1129
- x: -l / 2,
1130
- y: -u / 2
1131
- },
1132
- {
1133
- x: l / 2 - d,
1134
- y: -u / 2
1135
- },
1136
- ...k(-l / 2 + d, 0, d, 50, 90, 270),
1137
- {
1138
- x: l / 2 - d,
1139
- y: u / 2
1140
- },
1141
- {
1142
- x: -l / 2,
1143
- y: u / 2
1144
- }
1145
- ], v = D(_), y = p.path(v, g), b = s.insert(() => y, ":first-child");
1146
- return b.attr("class", "basic label-container outer-path"), f && t.look !== "handDrawn" && b.selectChildren("path").attr("style", f), i && t.look !== "handDrawn" && b.selectChildren("path").attr("style", i), T(t, b), t.intersect = function(e) {
1147
- return r.info("Pill intersect", t, {
1148
- radius: d,
1149
- point: e
1150
- }), G.polygon(t, _, e);
1151
- }, s;
1152
- }
1153
- a(Ne, "halfRoundedRectangle");
1154
- var Pe = /* @__PURE__ */ a((e, t, n, r, i) => [
1155
- `M${e + i},${t}`,
1156
- `L${e + n - i},${t}`,
1157
- `L${e + n},${t - r / 2}`,
1158
- `L${e + n - i},${t - r}`,
1159
- `L${e + i},${t - r}`,
1160
- `L${e},${t - r / 2}`,
1161
- "Z"
1162
- ].join(" "), "createHexagonPathD");
1163
- async function Fe(e, t) {
1164
- let { labelStyles: n, nodeStyles: r } = h(t), i = t.look === "neo" ? 3.5 : 4;
1165
- t.labelStyle = n;
1166
- let a = t.padding ?? 0, o = t.look === "neo" ? 70 : a, s = t.look === "neo" ? 32 : a;
1167
- if (t.width || t.height) {
1168
- let e = (t.height ?? 0) / i;
1169
- t.width = (t?.width ?? 0) - 2 * e - s, t.height = (t.height ?? 0) - o;
1170
- }
1171
- let { shapeSvg: c, bbox: l } = await C(e, t, E(t)), u = (t?.height ? t?.height : l.height) + o, d = u / i, f = (t?.width ? t?.width : l.width) + 2 * d + s, p = [
1172
- {
1173
- x: d,
1174
- y: 0
1175
- },
1176
- {
1177
- x: f - d,
1178
- y: 0
1179
- },
1180
- {
1181
- x: f,
1182
- y: -u / 2
1183
- },
1184
- {
1185
- x: f - d,
1186
- y: -u
1187
- },
1188
- {
1189
- x: d,
1190
- y: -u
1191
- },
1192
- {
1193
- x: 0,
1194
- y: -u / 2
1195
- }
1196
- ], g, { cssStyles: _ } = t;
1197
- if (t.look === "handDrawn") {
1198
- let e = S.svg(c), n = m(t, {}), r = Pe(0, 0, f, u, d), i = e.path(r, n);
1199
- g = c.insert(() => i, ":first-child").attr("transform", `translate(${-f / 2}, ${u / 2})`), _ && g.attr("style", _);
1200
- } else g = q(c, f, u, p);
1201
- return r && g.attr("style", r), t.width = f, t.height = u, T(t, g), t.intersect = function(e) {
1202
- return G.polygon(t, p, e);
1203
- }, c;
1204
- }
1205
- a(Fe, "hexagon");
1206
- async function Ie(e, t) {
1207
- let { labelStyles: n, nodeStyles: i } = h(t);
1208
- t.label = "", t.labelStyle = n;
1209
- let { shapeSvg: a } = await C(e, t, E(t)), o = Math.max(30, t?.width ?? 0), s = Math.max(30, t?.height ?? 0), { cssStyles: c } = t, l = S.svg(a), u = m(t, {});
1210
- t.look !== "handDrawn" && (u.roughness = 0, u.fillStyle = "solid");
1211
- let d = [
1212
- {
1213
- x: 0,
1214
- y: 0
1215
- },
1216
- {
1217
- x: o,
1218
- y: 0
1219
- },
1220
- {
1221
- x: 0,
1222
- y: s
1223
- },
1224
- {
1225
- x: o,
1226
- y: s
1227
- }
1228
- ], f = D(d), p = l.path(f, u), g = a.insert(() => p, ":first-child");
1229
- return g.attr("class", "basic label-container outer-path"), c && t.look !== "handDrawn" && g.selectChildren("path").attr("style", c), i && t.look !== "handDrawn" && g.selectChildren("path").attr("style", i), g.attr("transform", `translate(${-o / 2}, ${-s / 2})`), T(t, g), t.intersect = function(e) {
1230
- return r.info("Pill intersect", t, { points: d }), G.polygon(t, d, e);
1231
- }, a;
1232
- }
1233
- a(Ie, "hourglass");
1234
- async function Le(e, t, { config: { themeVariables: n, flowchart: i } }) {
1235
- let { labelStyles: a } = h(t);
1236
- t.labelStyle = a;
1237
- let o = t.assetHeight ?? 48, s = t.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
1238
- t.width = Math.max(c, l ?? 0);
1239
- let { shapeSvg: u, bbox: d, label: f } = await C(e, t, "icon-shape default"), p = t.pos === "t", g = c, v = c, { nodeBorder: y } = n, { stylesMap: x } = _(t), w = -v / 2, E = -g / 2, D = t.label ? 8 : 0, O = S.svg(u), k = m(t, {
1240
- stroke: "none",
1241
- fill: "none"
1242
- });
1243
- t.look !== "handDrawn" && (k.roughness = 0, k.fillStyle = "solid");
1244
- let A = O.rectangle(w, E, v, g, k), j = Math.max(v, d.width), M = g + d.height + D, N = O.rectangle(-j / 2, -M / 2, j, M, {
1245
- ...k,
1246
- fill: "transparent",
1247
- stroke: "none"
1248
- }), P = u.insert(() => A, ":first-child"), F = u.insert(() => N);
1249
- if (t.icon) {
1250
- let e = u.append("g");
1251
- e.html(`<g>${await b(t.icon, {
1252
- height: c,
1253
- width: c,
1254
- fallbackPrefix: ""
1255
- })}</g>`);
1256
- let n = e.node().getBBox(), r = n.width, i = n.height, a = n.x, o = n.y;
1257
- e.attr("transform", `translate(${-r / 2 - a},${p ? d.height / 2 + D / 2 - i / 2 - o : -d.height / 2 - D / 2 - i / 2 - o})`), e.attr("style", `color: ${x.get("stroke") ?? y};`);
1258
- }
1259
- return f.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${p ? -M / 2 : M / 2 - d.height})`), P.attr("transform", `translate(0,${p ? d.height / 2 + D / 2 : -d.height / 2 - D / 2})`), T(t, F), t.intersect = function(e) {
1260
- if (r.info("iconSquare intersect", t, e), !t.label) return G.rect(t, e);
1261
- let n = t.x ?? 0, i = t.y ?? 0, a = t.height ?? 0, o = [];
1262
- return o = p ? [
1263
- {
1264
- x: n - d.width / 2,
1265
- y: i - a / 2
1266
- },
1267
- {
1268
- x: n + d.width / 2,
1269
- y: i - a / 2
1270
- },
1271
- {
1272
- x: n + d.width / 2,
1273
- y: i - a / 2 + d.height + D
1274
- },
1275
- {
1276
- x: n + v / 2,
1277
- y: i - a / 2 + d.height + D
1278
- },
1279
- {
1280
- x: n + v / 2,
1281
- y: i + a / 2
1282
- },
1283
- {
1284
- x: n - v / 2,
1285
- y: i + a / 2
1286
- },
1287
- {
1288
- x: n - v / 2,
1289
- y: i - a / 2 + d.height + D
1290
- },
1291
- {
1292
- x: n - d.width / 2,
1293
- y: i - a / 2 + d.height + D
1294
- }
1295
- ] : [
1296
- {
1297
- x: n - v / 2,
1298
- y: i - a / 2
1299
- },
1300
- {
1301
- x: n + v / 2,
1302
- y: i - a / 2
1303
- },
1304
- {
1305
- x: n + v / 2,
1306
- y: i - a / 2 + g
1307
- },
1308
- {
1309
- x: n + d.width / 2,
1310
- y: i - a / 2 + g
1311
- },
1312
- {
1313
- x: n + d.width / 2 / 2,
1314
- y: i + a / 2
1315
- },
1316
- {
1317
- x: n - d.width / 2,
1318
- y: i + a / 2
1319
- },
1320
- {
1321
- x: n - d.width / 2,
1322
- y: i - a / 2 + g
1323
- },
1324
- {
1325
- x: n - v / 2,
1326
- y: i - a / 2 + g
1327
- }
1328
- ], G.polygon(t, o, e);
1329
- }, u;
1330
- }
1331
- a(Le, "icon");
1332
- async function Re(e, t, { config: { themeVariables: n, flowchart: i } }) {
1333
- let { labelStyles: a } = h(t);
1334
- t.labelStyle = a;
1335
- let o = t.assetHeight ?? 48, s = t.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
1336
- t.width = Math.max(c, l ?? 0);
1337
- let { shapeSvg: u, bbox: d, label: f } = await C(e, t, "icon-shape default"), p = t.label ? 8 : 0, g = t.pos === "t", { nodeBorder: v, mainBkg: y } = n, { stylesMap: x } = _(t), w = S.svg(u), E = m(t, {});
1338
- t.look !== "handDrawn" && (E.roughness = 0, E.fillStyle = "solid"), E.stroke = x.get("fill") ?? y;
1339
- let D = u.append("g");
1340
- t.icon && D.html(`<g>${await b(t.icon, {
1341
- height: c,
1342
- width: c,
1343
- fallbackPrefix: ""
1344
- })}</g>`);
1345
- let O = D.node().getBBox(), k = O.width, A = O.height, j = O.x, M = O.y, N = Math.max(k, A) * Math.SQRT2 + 40, P = w.circle(0, 0, N, E), F = Math.max(N, d.width), I = N + d.height + p, L = w.rectangle(-F / 2, -I / 2, F, I, {
1346
- ...E,
1347
- fill: "transparent",
1348
- stroke: "none"
1349
- }), ee = u.insert(() => P, ":first-child"), R = u.insert(() => L);
1350
- return D.attr("transform", `translate(${-k / 2 - j},${g ? d.height / 2 + p / 2 - A / 2 - M : -d.height / 2 - p / 2 - A / 2 - M})`), D.attr("style", `color: ${x.get("stroke") ?? v};`), f.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${g ? -I / 2 : I / 2 - d.height})`), ee.attr("transform", `translate(0,${g ? d.height / 2 + p / 2 : -d.height / 2 - p / 2})`), T(t, R), t.intersect = function(e) {
1351
- return r.info("iconSquare intersect", t, e), G.rect(t, e);
1352
- }, u;
1353
- }
1354
- a(Re, "iconCircle");
1355
- async function ze(e, t, { config: { themeVariables: n, flowchart: i } }) {
1356
- let { labelStyles: a } = h(t);
1357
- t.labelStyle = a;
1358
- let o = t.assetHeight ?? 48, s = t.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
1359
- t.width = Math.max(c, l ?? 0);
1360
- let { shapeSvg: u, bbox: d, halfPadding: f, label: p } = await C(e, t, "icon-shape default"), g = t.pos === "t", v = c + f * 2, y = c + f * 2, { nodeBorder: x, mainBkg: w } = n, { stylesMap: E } = _(t), D = -y / 2, O = -v / 2, k = t.label ? 8 : 0, A = S.svg(u), j = m(t, {});
1361
- t.look !== "handDrawn" && (j.roughness = 0, j.fillStyle = "solid"), j.stroke = E.get("fill") ?? w;
1362
- let M = A.path(N(D, O, y, v, 5), j), P = Math.max(y, d.width), F = v + d.height + k, I = A.rectangle(-P / 2, -F / 2, P, F, {
1363
- ...j,
1364
- fill: "transparent",
1365
- stroke: "none"
1366
- }), L = u.insert(() => M, ":first-child").attr("class", "icon-shape2"), ee = u.insert(() => I);
1367
- if (t.icon) {
1368
- let e = u.append("g");
1369
- e.html(`<g>${await b(t.icon, {
1370
- height: c,
1371
- width: c,
1372
- fallbackPrefix: ""
1373
- })}</g>`);
1374
- let n = e.node().getBBox(), r = n.width, i = n.height, a = n.x, o = n.y;
1375
- e.attr("transform", `translate(${-r / 2 - a},${g ? d.height / 2 + k / 2 - i / 2 - o : -d.height / 2 - k / 2 - i / 2 - o})`), e.attr("style", `color: ${E.get("stroke") ?? x};`);
1376
- }
1377
- return p.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${g ? -F / 2 : F / 2 - d.height})`), L.attr("transform", `translate(0,${g ? d.height / 2 + k / 2 : -d.height / 2 - k / 2})`), T(t, ee), t.intersect = function(e) {
1378
- if (r.info("iconSquare intersect", t, e), !t.label) return G.rect(t, e);
1379
- let n = t.x ?? 0, i = t.y ?? 0, a = t.height ?? 0, o = [];
1380
- return o = g ? [
1381
- {
1382
- x: n - d.width / 2,
1383
- y: i - a / 2
1384
- },
1385
- {
1386
- x: n + d.width / 2,
1387
- y: i - a / 2
1388
- },
1389
- {
1390
- x: n + d.width / 2,
1391
- y: i - a / 2 + d.height + k
1392
- },
1393
- {
1394
- x: n + y / 2,
1395
- y: i - a / 2 + d.height + k
1396
- },
1397
- {
1398
- x: n + y / 2,
1399
- y: i + a / 2
1400
- },
1401
- {
1402
- x: n - y / 2,
1403
- y: i + a / 2
1404
- },
1405
- {
1406
- x: n - y / 2,
1407
- y: i - a / 2 + d.height + k
1408
- },
1409
- {
1410
- x: n - d.width / 2,
1411
- y: i - a / 2 + d.height + k
1412
- }
1413
- ] : [
1414
- {
1415
- x: n - y / 2,
1416
- y: i - a / 2
1417
- },
1418
- {
1419
- x: n + y / 2,
1420
- y: i - a / 2
1421
- },
1422
- {
1423
- x: n + y / 2,
1424
- y: i - a / 2 + v
1425
- },
1426
- {
1427
- x: n + d.width / 2,
1428
- y: i - a / 2 + v
1429
- },
1430
- {
1431
- x: n + d.width / 2 / 2,
1432
- y: i + a / 2
1433
- },
1434
- {
1435
- x: n - d.width / 2,
1436
- y: i + a / 2
1437
- },
1438
- {
1439
- x: n - d.width / 2,
1440
- y: i - a / 2 + v
1441
- },
1442
- {
1443
- x: n - y / 2,
1444
- y: i - a / 2 + v
1445
- }
1446
- ], G.polygon(t, o, e);
1447
- }, u;
1448
- }
1449
- a(ze, "iconRounded");
1450
- async function Be(e, t, { config: { themeVariables: n, flowchart: i } }) {
1451
- let { labelStyles: a } = h(t);
1452
- t.labelStyle = a;
1453
- let o = t.assetHeight ?? 48, s = t.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
1454
- t.width = Math.max(c, l ?? 0);
1455
- let { shapeSvg: u, bbox: d, halfPadding: f, label: p } = await C(e, t, "icon-shape default"), g = t.pos === "t", v = c + f * 2, y = c + f * 2, { nodeBorder: x, mainBkg: w } = n, { stylesMap: E } = _(t), D = -y / 2, O = -v / 2, k = t.label ? 8 : 0, A = S.svg(u), j = m(t, {});
1456
- t.look !== "handDrawn" && (j.roughness = 0, j.fillStyle = "solid"), j.stroke = E.get("fill") ?? w;
1457
- let M = A.path(N(D, O, y, v, .1), j), P = Math.max(y, d.width), F = v + d.height + k, I = A.rectangle(-P / 2, -F / 2, P, F, {
1458
- ...j,
1459
- fill: "transparent",
1460
- stroke: "none"
1461
- }), L = u.insert(() => M, ":first-child"), ee = u.insert(() => I);
1462
- if (t.icon) {
1463
- let e = u.append("g");
1464
- e.html(`<g>${await b(t.icon, {
1465
- height: c,
1466
- width: c,
1467
- fallbackPrefix: ""
1468
- })}</g>`);
1469
- let n = e.node().getBBox(), r = n.width, i = n.height, a = n.x, o = n.y;
1470
- e.attr("transform", `translate(${-r / 2 - a},${g ? d.height / 2 + k / 2 - i / 2 - o : -d.height / 2 - k / 2 - i / 2 - o})`), e.attr("style", `color: ${E.get("stroke") ?? x};`);
1471
- }
1472
- return p.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${g ? -F / 2 : F / 2 - d.height})`), L.attr("transform", `translate(0,${g ? d.height / 2 + k / 2 : -d.height / 2 - k / 2})`), T(t, ee), t.intersect = function(e) {
1473
- if (r.info("iconSquare intersect", t, e), !t.label) return G.rect(t, e);
1474
- let n = t.x ?? 0, i = t.y ?? 0, a = t.height ?? 0, o = [];
1475
- return o = g ? [
1476
- {
1477
- x: n - d.width / 2,
1478
- y: i - a / 2
1479
- },
1480
- {
1481
- x: n + d.width / 2,
1482
- y: i - a / 2
1483
- },
1484
- {
1485
- x: n + d.width / 2,
1486
- y: i - a / 2 + d.height + k
1487
- },
1488
- {
1489
- x: n + y / 2,
1490
- y: i - a / 2 + d.height + k
1491
- },
1492
- {
1493
- x: n + y / 2,
1494
- y: i + a / 2
1495
- },
1496
- {
1497
- x: n - y / 2,
1498
- y: i + a / 2
1499
- },
1500
- {
1501
- x: n - y / 2,
1502
- y: i - a / 2 + d.height + k
1503
- },
1504
- {
1505
- x: n - d.width / 2,
1506
- y: i - a / 2 + d.height + k
1507
- }
1508
- ] : [
1509
- {
1510
- x: n - y / 2,
1511
- y: i - a / 2
1512
- },
1513
- {
1514
- x: n + y / 2,
1515
- y: i - a / 2
1516
- },
1517
- {
1518
- x: n + y / 2,
1519
- y: i - a / 2 + v
1520
- },
1521
- {
1522
- x: n + d.width / 2,
1523
- y: i - a / 2 + v
1524
- },
1525
- {
1526
- x: n + d.width / 2 / 2,
1527
- y: i + a / 2
1528
- },
1529
- {
1530
- x: n - d.width / 2,
1531
- y: i + a / 2
1532
- },
1533
- {
1534
- x: n - d.width / 2,
1535
- y: i - a / 2 + v
1536
- },
1537
- {
1538
- x: n - y / 2,
1539
- y: i - a / 2 + v
1540
- }
1541
- ], G.polygon(t, o, e);
1542
- }, u;
1543
- }
1544
- a(Be, "iconSquare");
1545
- async function Ve(e, t, { config: { flowchart: n } }) {
1546
- let i = new Image();
1547
- i.src = t?.img ?? "", await i.decode();
1548
- let a = Number(i.naturalWidth.toString().replace("px", "")), o = Number(i.naturalHeight.toString().replace("px", ""));
1549
- t.imageAspectRatio = a / o;
1550
- let { labelStyles: s } = h(t);
1551
- t.labelStyle = s;
1552
- let c = n?.wrappingWidth;
1553
- t.defaultWidth = n?.wrappingWidth;
1554
- let l = Math.max(t.label ? c ?? 0 : 0, t?.assetWidth ?? a), u = t.constraint === "on" && t?.assetHeight ? t.assetHeight * t.imageAspectRatio : l, d = t.constraint === "on" ? u / t.imageAspectRatio : t?.assetHeight ?? o;
1555
- t.width = Math.max(u, c ?? 0);
1556
- let { shapeSvg: f, bbox: p, label: g } = await C(e, t, "image-shape default"), _ = t.pos === "t", v = -u / 2, y = -d / 2, b = t.label ? 8 : 0, x = S.svg(f), w = m(t, {});
1557
- t.look !== "handDrawn" && (w.roughness = 0, w.fillStyle = "solid");
1558
- let E = x.rectangle(v, y, u, d, w), D = Math.max(u, p.width), O = d + p.height + b, k = x.rectangle(-D / 2, -O / 2, D, O, {
1559
- ...w,
1560
- fill: "none",
1561
- stroke: "none"
1562
- }), A = f.insert(() => E, ":first-child"), j = f.insert(() => k);
1563
- if (t.img) {
1564
- let e = f.append("image");
1565
- e.attr("href", t.img), e.attr("width", u), e.attr("height", d), e.attr("preserveAspectRatio", "none"), e.attr("transform", `translate(${-u / 2},${_ ? O / 2 - d : -O / 2})`);
1566
- }
1567
- return g.attr("transform", `translate(${-p.width / 2 - (p.x - (p.left ?? 0))},${_ ? -d / 2 - p.height / 2 - b / 2 : d / 2 - p.height / 2 + b / 2})`), A.attr("transform", `translate(0,${_ ? p.height / 2 + b / 2 : -p.height / 2 - b / 2})`), T(t, j), t.intersect = function(e) {
1568
- if (r.info("iconSquare intersect", t, e), !t.label) return G.rect(t, e);
1569
- let n = t.x ?? 0, i = t.y ?? 0, a = t.height ?? 0, o = [];
1570
- return o = _ ? [
1571
- {
1572
- x: n - p.width / 2,
1573
- y: i - a / 2
1574
- },
1575
- {
1576
- x: n + p.width / 2,
1577
- y: i - a / 2
1578
- },
1579
- {
1580
- x: n + p.width / 2,
1581
- y: i - a / 2 + p.height + b
1582
- },
1583
- {
1584
- x: n + u / 2,
1585
- y: i - a / 2 + p.height + b
1586
- },
1587
- {
1588
- x: n + u / 2,
1589
- y: i + a / 2
1590
- },
1591
- {
1592
- x: n - u / 2,
1593
- y: i + a / 2
1594
- },
1595
- {
1596
- x: n - u / 2,
1597
- y: i - a / 2 + p.height + b
1598
- },
1599
- {
1600
- x: n - p.width / 2,
1601
- y: i - a / 2 + p.height + b
1602
- }
1603
- ] : [
1604
- {
1605
- x: n - u / 2,
1606
- y: i - a / 2
1607
- },
1608
- {
1609
- x: n + u / 2,
1610
- y: i - a / 2
1611
- },
1612
- {
1613
- x: n + u / 2,
1614
- y: i - a / 2 + d
1615
- },
1616
- {
1617
- x: n + p.width / 2,
1618
- y: i - a / 2 + d
1619
- },
1620
- {
1621
- x: n + p.width / 2 / 2,
1622
- y: i + a / 2
1623
- },
1624
- {
1625
- x: n - p.width / 2,
1626
- y: i + a / 2
1627
- },
1628
- {
1629
- x: n - p.width / 2,
1630
- y: i - a / 2 + d
1631
- },
1632
- {
1633
- x: n - u / 2,
1634
- y: i - a / 2 + d
1635
- }
1636
- ], G.polygon(t, o, e);
1637
- }, f;
1638
- }
1639
- a(Ve, "imageSquare");
1640
- async function He(e, t) {
1641
- let { labelStyles: n, nodeStyles: r } = h(t);
1642
- t.labelStyle = n;
1643
- let i = t.padding ?? 0, a = i, o = t.look === "neo" ? i * 2 : i, { shapeSvg: s, bbox: c } = await C(e, t, E(t)), l = Math.max(c.width + (o ?? 0) * 2, t?.width ?? 0), u = Math.max(c.height + (a ?? 0) * 2, t?.height ?? 0), d = [
1644
- {
1645
- x: 0,
1646
- y: 0
1647
- },
1648
- {
1649
- x: l,
1650
- y: 0
1651
- },
1652
- {
1653
- x: l + 3 * u / 6,
1654
- y: -u
1655
- },
1656
- {
1657
- x: -3 * u / 6,
1658
- y: -u
1659
- }
1660
- ], f, { cssStyles: p } = t;
1661
- if (t.look === "handDrawn") {
1662
- let e = S.svg(s), n = m(t, {}), r = D(d), i = e.path(r, n);
1663
- f = s.insert(() => i, ":first-child").attr("transform", `translate(${-l / 2}, ${u / 2})`), p && f.attr("style", p);
1664
- } else f = q(s, l, u, d);
1665
- return r && f.attr("style", r), t.width = l, t.height = u, T(t, f), t.intersect = function(e) {
1666
- return G.polygon(t, d, e);
1667
- }, s;
1668
- }
1669
- a(He, "inv_trapezoid");
1670
- async function Ue(e, t) {
1671
- let { shapeSvg: n, bbox: r, label: i } = await C(e, t, "label"), a = n.insert("rect", ":first-child");
1672
- 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))})`), T(t, a), t.intersect = function(e) {
1673
- return G.rect(t, e);
1674
- }, n;
1675
- }
1676
- a(Ue, "labelRect");
1677
- async function We(e, t) {
1678
- let { labelStyles: n, nodeStyles: r } = h(t);
1679
- t.labelStyle = n;
1680
- let i = t.padding ?? 0, a = i, o = t.look === "neo" ? i * 2 : i, { shapeSvg: s, bbox: c } = await C(e, t, E(t)), l = (t?.height ?? c.height) + a, u = (t?.width ?? c.width) + o, d = [
1681
- {
1682
- x: 0,
1683
- y: 0
1684
- },
1685
- {
1686
- x: u + 3 * l / 6,
1687
- y: 0
1688
- },
1689
- {
1690
- x: u,
1691
- y: -l
1692
- },
1693
- {
1694
- x: -(3 * l) / 6,
1695
- y: -l
1696
- }
1697
- ], f, { cssStyles: p } = t;
1698
- if (t.look === "handDrawn") {
1699
- let e = S.svg(s), n = m(t, {}), r = D(d), i = e.path(r, n);
1700
- f = s.insert(() => i, ":first-child").attr("transform", `translate(${-u / 2}, ${l / 2})`), p && f.attr("style", p);
1701
- } else f = q(s, u, l, d);
1702
- return r && f.attr("style", r), t.width = u, t.height = l, T(t, f), t.intersect = function(e) {
1703
- return G.polygon(t, d, e);
1704
- }, s;
1705
- }
1706
- a(We, "lean_left");
1707
- async function Ge(e, t) {
1708
- let { labelStyles: n, nodeStyles: r } = h(t);
1709
- t.labelStyle = n;
1710
- let i = t.padding ?? 0, a = i, o = t.look === "neo" ? i * 2 : i, { shapeSvg: s, bbox: c } = await C(e, t, E(t)), l = (t?.height ?? c.height) + a, u = (t?.width ?? c.width) + o, d = [
1711
- {
1712
- x: -3 * l / 6,
1713
- y: 0
1714
- },
1715
- {
1716
- x: u,
1717
- y: 0
1718
- },
1719
- {
1720
- x: u + 3 * l / 6,
1721
- y: -l
1722
- },
1723
- {
1724
- x: 0,
1725
- y: -l
1726
- }
1727
- ], f, { cssStyles: p } = t;
1728
- if (t.look === "handDrawn") {
1729
- let e = S.svg(s), n = m(t, {}), r = D(d), i = e.path(r, n);
1730
- f = s.insert(() => i, ":first-child").attr("transform", `translate(${-u / 2}, ${l / 2})`), p && f.attr("style", p);
1731
- } else f = q(s, u, l, d);
1732
- return r && f.attr("style", r), t.width = u, t.height = l, T(t, f), t.intersect = function(e) {
1733
- return G.polygon(t, d, e);
1734
- }, s;
1735
- }
1736
- a(Ge, "lean_right");
1737
- function Ke(e, t) {
1738
- let { labelStyles: n, nodeStyles: i } = h(t);
1739
- t.label = "", t.labelStyle = n;
1740
- let a = e.insert("g").attr("class", E(t)).attr("id", t.domId ?? t.id), { cssStyles: o } = t, s = Math.max(35, t?.width ?? 0), c = Math.max(35, t?.height ?? 0), l = [
1741
- {
1742
- x: s,
1743
- y: 0
1744
- },
1745
- {
1746
- x: 0,
1747
- y: c + 7 / 2
1748
- },
1749
- {
1750
- x: s - 14,
1751
- y: c + 7 / 2
1752
- },
1753
- {
1754
- x: 0,
1755
- y: 2 * c
1756
- },
1757
- {
1758
- x: s,
1759
- y: c - 7 / 2
1760
- },
1761
- {
1762
- x: 14,
1763
- y: c - 7 / 2
1764
- }
1765
- ], u = S.svg(a), d = m(t, {});
1766
- t.look !== "handDrawn" && (d.roughness = 0, d.fillStyle = "solid");
1767
- let f = D(l), p = u.path(f, d), g = a.insert(() => p, ":first-child");
1768
- return g.attr("class", "outer-path"), o && t.look !== "handDrawn" && g.selectAll("path").attr("style", o), i && t.look !== "handDrawn" && g.selectAll("path").attr("style", i), g.attr("transform", `translate(-${s / 2},${-c})`), T(t, g), t.intersect = function(e) {
1769
- return r.info("lightningBolt intersect", t, e), G.polygon(t, l, e);
1770
- }, a;
1771
- }
1772
- a(Ke, "lightningBolt");
1773
- var qe = /* @__PURE__ */ a((e, t, n, r, i, a, o) => [
1774
- `M${e},${t + a}`,
1775
- `a${i},${a} 0,0,0 ${n},0`,
1776
- `a${i},${a} 0,0,0 ${-n},0`,
1777
- `l0,${r}`,
1778
- `a${i},${a} 0,0,0 ${n},0`,
1779
- `l0,${-r}`,
1780
- `M${e},${t + a + o}`,
1781
- `a${i},${a} 0,0,0 ${n},0`
1782
- ].join(" "), "createCylinderPathD"), Je = /* @__PURE__ */ a((e, t, n, r, i, a, o) => [
1783
- `M${e},${t + a}`,
1784
- `M${e + n},${t + a}`,
1785
- `a${i},${a} 0,0,0 ${-n},0`,
1786
- `l0,${r}`,
1787
- `a${i},${a} 0,0,0 ${n},0`,
1788
- `l0,${-r}`,
1789
- `M${e},${t + a + o}`,
1790
- `a${i},${a} 0,0,0 ${n},0`
1791
- ].join(" "), "createOuterCylinderPathD"), Ye = /* @__PURE__ */ a((e, t, n, r, i, a) => [`M${e - n / 2},${-r / 2}`, `a${i},${a} 0,0,0 ${n},0`].join(" "), "createInnerCylinderPathD"), Xe = 10, Ze = 10;
1792
- async function Qe(e, t) {
1793
- let { labelStyles: r, nodeStyles: i } = h(t);
1794
- t.labelStyle = r;
1795
- let a = t.padding ?? 0, o = t.look === "neo" ? 16 : a, s = t.look === "neo" ? 24 : a;
1796
- if (t.width || t.height) {
1797
- let e = t.width ?? 0;
1798
- t.width = (t.width ?? 0) - o, t.width < Ze && (t.width = Ze);
1799
- let n = e / 2 / (2.5 + e / 50);
1800
- t.height = (t.height ?? 0) - s - n * 3, t.height < Xe && (t.height = Xe);
1801
- }
1802
- let { shapeSvg: c, bbox: l, label: u } = await C(e, t, E(t)), d = (t?.width ? t?.width : l.width) + o * 2, f = d / 2, p = f / (2.5 + d / 50), g = (t?.height ? t?.height : l.height) + p + s * 2, _ = g * .1, v, { cssStyles: y } = t;
1803
- if (t.look === "handDrawn") {
1804
- let e = S.svg(c), n = Je(0, 0, d, g, f, p, _), r = Ye(0, p, d, g, f, p), i = m(t, {}), a = e.path(n, i), o = e.path(r, i);
1805
- c.insert(() => o, ":first-child").attr("class", "line"), v = c.insert(() => a, ":first-child"), v.attr("class", "basic label-container"), y && v.attr("style", y);
1806
- } else {
1807
- let e = qe(0, 0, d, g, f, p, _);
1808
- v = c.insert("path", ":first-child").attr("d", e).attr("class", "basic label-container outer-path").attr("style", n(y)).attr("style", i);
1809
- }
1810
- return v.attr("label-offset-y", p), v.attr("transform", `translate(${-d / 2}, ${-(g / 2 + p)})`), T(t, v), u.attr("transform", `translate(${-(l.width / 2) - (l.x - (l.left ?? 0))}, ${-(l.height / 2) + p - (l.y - (l.top ?? 0))})`), t.intersect = function(e) {
1811
- let n = G.rect(t, e), r = n.x - (t.x ?? 0);
1812
- 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)) {
1813
- let i = p * p * (1 - r * r / (f * f));
1814
- i > 0 && (i = Math.sqrt(i)), i = p - i, e.y - (t.y ?? 0) > 0 && (i = -i), n.y += i;
1815
- }
1816
- return n;
1817
- }, c;
1818
- }
1819
- a(Qe, "linedCylinder");
1820
- async function $e(e, t) {
1821
- let { labelStyles: n, nodeStyles: r } = h(t);
1822
- t.labelStyle = n;
1823
- let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i;
1824
- (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));
1825
- let { shapeSvg: s, bbox: c, label: l } = await C(e, t, E(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: g } = t, _ = S.svg(s), v = m(t, {});
1826
- t.look !== "handDrawn" && (v.roughness = 0, v.fillStyle = "solid");
1827
- let y = [
1828
- {
1829
- x: -u / 2 - u / 2 * .1,
1830
- y: -p / 2
1831
- },
1832
- {
1833
- x: -u / 2 - u / 2 * .1,
1834
- y: p / 2
1835
- },
1836
- ...O(-u / 2 - u / 2 * .1, p / 2, u / 2 + u / 2 * .1, p / 2, f, .8),
1837
- {
1838
- x: u / 2 + u / 2 * .1,
1839
- y: -p / 2
1840
- },
1841
- {
1842
- x: -u / 2 - u / 2 * .1,
1843
- y: -p / 2
1844
- },
1845
- {
1846
- x: -u / 2,
1847
- y: -p / 2
1848
- },
1849
- {
1850
- x: -u / 2,
1851
- y: p / 2 * 1.1
1852
- },
1853
- {
1854
- x: -u / 2,
1855
- y: -p / 2
1856
- }
1857
- ], b = _.polygon(y.map((e) => [e.x, e.y]), v), x = s.insert(() => b, ":first-child");
1858
- return x.attr("class", "basic label-container outer-path"), g && t.look !== "handDrawn" && x.selectAll("path").attr("style", g), 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))})`), T(t, x), t.intersect = function(e) {
1859
- return G.polygon(t, y, e);
1860
- }, s;
1861
- }
1862
- a($e, "linedWaveEdgedRect");
1863
- async function et(e, t) {
1864
- let { labelStyles: n, nodeStyles: r } = h(t);
1865
- t.labelStyle = n;
1866
- let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i, s = t.look === "neo" ? 10 : 5;
1867
- (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));
1868
- let { shapeSvg: c, bbox: l, label: u } = await C(e, t, E(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, g = f - 2 * s, _ = -p / 2, v = -g / 2, { cssStyles: y } = t, b = S.svg(c), x = m(t, {}), w = [
1869
- {
1870
- x: _ - s,
1871
- y: v + s
1872
- },
1873
- {
1874
- x: _ - s,
1875
- y: v + g + s
1876
- },
1877
- {
1878
- x: _ + p - s,
1879
- y: v + g + s
1880
- },
1881
- {
1882
- x: _ + p - s,
1883
- y: v + g
1884
- },
1885
- {
1886
- x: _ + p,
1887
- y: v + g
1888
- },
1889
- {
1890
- x: _ + p,
1891
- y: v + g - s
1892
- },
1893
- {
1894
- x: _ + p + s,
1895
- y: v + g - s
1896
- },
1897
- {
1898
- x: _ + p + s,
1899
- y: v - s
1900
- },
1901
- {
1902
- x: _ + s,
1903
- y: v - s
1904
- },
1905
- {
1906
- x: _ + s,
1907
- y: v
1908
- },
1909
- {
1910
- x: _,
1911
- y: v
1912
- },
1913
- {
1914
- x: _,
1915
- y: v + s
1916
- }
1917
- ], O = [
1918
- {
1919
- x: _,
1920
- y: v + s
1921
- },
1922
- {
1923
- x: _ + p - s,
1924
- y: v + s
1925
- },
1926
- {
1927
- x: _ + p - s,
1928
- y: v + g
1929
- },
1930
- {
1931
- x: _ + p,
1932
- y: v + g
1933
- },
1934
- {
1935
- x: _ + p,
1936
- y: v
1937
- },
1938
- {
1939
- x: _,
1940
- y: v
1941
- }
1942
- ];
1943
- t.look !== "handDrawn" && (x.roughness = 0, x.fillStyle = "solid");
1944
- let k = D(w), j = b.path(k, x), M = D(O), N = b.path(M, x);
1945
- t.look !== "handDrawn" && (j = A(j), N = A(N));
1946
- let P = c.insert("g", ":first-child");
1947
- return P.insert(() => j), P.insert(() => N), P.attr("class", "basic label-container outer-path"), y && t.look !== "handDrawn" && P.selectAll("path").attr("style", y), r && t.look !== "handDrawn" && P.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))})`), T(t, P), t.intersect = function(e) {
1948
- return G.polygon(t, w, e);
1949
- }, c;
1950
- }
1951
- a(et, "multiRect");
1952
- async function tt(e, t) {
1953
- let { labelStyles: n, nodeStyles: r } = h(t);
1954
- t.labelStyle = n;
1955
- let { shapeSvg: i, bbox: a, label: o } = await C(e, t, E(t)), s = t.padding ?? 0, c = t.look === "neo" ? 16 : s, l = t.look === "neo" ? 12 : s, u = !0;
1956
- (t.width || t.height) && (u = !1, t.width = (t?.width ?? 0) - c * 2, t.height = (t?.height ?? 0) - l * 3);
1957
- 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, g = f + (u ? p / 2 : -p / 2), _ = -d / 2, v = -g / 2, { cssStyles: y } = t, b = O(_ - 10, v + g + 10, _ + d - 10, v + g + 10, p, .8), x = b?.[b.length - 1], w = [
1958
- {
1959
- x: _ - 10,
1960
- y: v + 10
1961
- },
1962
- {
1963
- x: _ - 10,
1964
- y: v + g + 10
1965
- },
1966
- ...b,
1967
- {
1968
- x: _ + d - 10,
1969
- y: x.y - 10
1970
- },
1971
- {
1972
- x: _ + d,
1973
- y: x.y - 10
1974
- },
1975
- {
1976
- x: _ + d,
1977
- y: x.y - 20
1978
- },
1979
- {
1980
- x: _ + d + 10,
1981
- y: x.y - 20
1982
- },
1983
- {
1984
- x: _ + d + 10,
1985
- y: v - 10
1986
- },
1987
- {
1988
- x: _ + 10,
1989
- y: v - 10
1990
- },
1991
- {
1992
- x: _ + 10,
1993
- y: v
1994
- },
1995
- {
1996
- x: _,
1997
- y: v
1998
- },
1999
- {
2000
- x: _,
2001
- y: v + 10
2002
- }
2003
- ], k = [
2004
- {
2005
- x: _,
2006
- y: v + 10
2007
- },
2008
- {
2009
- x: _ + d - 10,
2010
- y: v + 10
2011
- },
2012
- {
2013
- x: _ + d - 10,
2014
- y: x.y - 10
2015
- },
2016
- {
2017
- x: _ + d,
2018
- y: x.y - 10
2019
- },
2020
- {
2021
- x: _ + d,
2022
- y: v
2023
- },
2024
- {
2025
- x: _,
2026
- y: v
2027
- }
2028
- ], A = S.svg(i), j = m(t, {});
2029
- t.look !== "handDrawn" && (j.roughness = 0, j.fillStyle = "solid");
2030
- let M = D(w), N = A.path(M, j), P = D(k), F = A.path(P, j), I = i.insert(() => N, ":first-child");
2031
- return I.insert(() => F), I.attr("class", "basic label-container outer-path"), y && t.look !== "handDrawn" && I.selectAll("path").attr("style", y), r && t.look !== "handDrawn" && I.selectAll("path").attr("style", r), I.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))})`), T(t, I), t.intersect = function(e) {
2032
- return G.polygon(t, w, e);
2033
- }, i;
2034
- }
2035
- a(tt, "multiWaveEdgedRectangle");
2036
- async function nt(e, t, { config: { themeVariables: n } }) {
2037
- let { labelStyles: r, nodeStyles: i } = h(t);
2038
- t.labelStyle = r, t.useHtmlLabels || l(u()) || (t.centerLabel = !0);
2039
- let { shapeSvg: a, bbox: o, label: s } = await C(e, t, E(t)), c = Math.max(o.width + (t.padding ?? 0) * 2, t?.width ?? 0), d = Math.max(o.height + (t.padding ?? 0) * 2, t?.height ?? 0), f = -c / 2, p = -d / 2, { cssStyles: g } = t, _ = S.svg(a), v = m(t, {
2040
- fill: n.noteBkgColor,
2041
- stroke: n.noteBorderColor
2042
- });
2043
- t.look !== "handDrawn" && (v.roughness = 0, v.fillStyle = "solid");
2044
- let y = _.rectangle(f, p, c, d, v), b = a.insert(() => y, ":first-child");
2045
- return b.attr("class", "basic label-container outer-path"), s.attr("class", "label noteLabel"), g && t.look !== "handDrawn" && b.selectAll("path").attr("style", g), i && t.look !== "handDrawn" && b.selectAll("path").attr("style", i), s.attr("transform", `translate(${-o.width / 2 - (o.x - (o.left ?? 0))}, ${-(o.height / 2) - (o.y - (o.top ?? 0))})`), T(t, b), t.intersect = function(e) {
2046
- return G.rect(t, e);
2047
- }, a;
2048
- }
2049
- a(nt, "note");
2050
- var rt = /* @__PURE__ */ a((e, t, n) => [
2051
- `M${e + n / 2},${t}`,
2052
- `L${e + n},${t - n / 2}`,
2053
- `L${e + n / 2},${t - n}`,
2054
- `L${e},${t - n / 2}`,
2055
- "Z"
2056
- ].join(" "), "createDecisionBoxPathD");
2057
- async function it(e, t) {
2058
- let { labelStyles: n, nodeStyles: r } = h(t);
2059
- t.labelStyle = n;
2060
- let { shapeSvg: i, bbox: a } = await C(e, t, E(t)), o = a.width + (t.padding ?? 0) + (a.height + (t.padding ?? 0)), s = .5, c = [
2061
- {
2062
- x: o / 2,
2063
- y: 0
2064
- },
2065
- {
2066
- x: o,
2067
- y: -o / 2
2068
- },
2069
- {
2070
- x: o / 2,
2071
- y: -o
2072
- },
2073
- {
2074
- x: 0,
2075
- y: -o / 2
2076
- }
2077
- ], l, { cssStyles: u } = t;
2078
- if (t.look === "handDrawn") {
2079
- let e = S.svg(i), n = m(t, {}), r = rt(0, 0, o), a = e.path(r, n);
2080
- l = i.insert(() => a, ":first-child").attr("transform", `translate(${-o / 2 + s}, ${o / 2})`), u && l.attr("style", u);
2081
- } else l = q(i, o, o, c), l.attr("transform", `translate(${-o / 2 + s}, ${o / 2})`);
2082
- return r && l.attr("style", r), T(t, l), t.calcIntersect = function(e, t) {
2083
- let n = e.width, r = [
2084
- {
2085
- x: n / 2,
2086
- y: 0
2087
- },
2088
- {
2089
- x: n,
2090
- y: -n / 2
2091
- },
2092
- {
2093
- x: n / 2,
2094
- y: -n
2095
- },
2096
- {
2097
- x: 0,
2098
- y: -n / 2
2099
- }
2100
- ], i = G.polygon(e, r, t);
2101
- return {
2102
- x: i.x - .5,
2103
- y: i.y - .5
2104
- };
2105
- }, t.intersect = function(e) {
2106
- return this.calcIntersect(t, e);
2107
- }, i;
2108
- }
2109
- a(it, "question");
2110
- async function at(e, t) {
2111
- let { labelStyles: n, nodeStyles: r } = h(t);
2112
- t.labelStyle = n;
2113
- 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 C(e, t, E(t)), u = (t?.width ?? c.width) + (t.look === "neo" ? a * 2 : a), d = (t?.height ?? c.height) + (t.look === "neo" ? o * 2 : o), f = -u / 2, p = -d / 2, g = p / 2, _ = [
2114
- {
2115
- x: f + g,
2116
- y: p
2117
- },
2118
- {
2119
- x: f,
2120
- y: 0
2121
- },
2122
- {
2123
- x: f + g,
2124
- y: -p
2125
- },
2126
- {
2127
- x: -f,
2128
- y: -p
2129
- },
2130
- {
2131
- x: -f,
2132
- y: p
2133
- }
2134
- ], { cssStyles: v } = t, y = S.svg(s), b = m(t, {});
2135
- t.look !== "handDrawn" && (b.roughness = 0, b.fillStyle = "solid");
2136
- let x = D(_), w = y.path(x, b), O = s.insert(() => w, ":first-child");
2137
- return 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), O.attr("transform", `translate(${-g / 2},0)`), l.attr("transform", `translate(${-g / 2 - c.width / 2 - (c.x - (c.left ?? 0))}, ${-(c.height / 2) - (c.y - (c.top ?? 0))})`), T(t, O), t.intersect = function(e) {
2138
- return G.polygon(t, _, e);
2139
- }, s;
2140
- }
2141
- a(at, "rect_left_inv_arrow");
2142
- async function ot(e, t) {
2143
- let { labelStyles: n, nodeStyles: a } = h(t);
2144
- t.labelStyle = n;
2145
- let o;
2146
- o = t.cssClasses ? "node " + t.cssClasses : "node default";
2147
- let s = e.insert("g").attr("class", o).attr("id", t.domId || t.id), c = s.insert("g"), u = s.insert("g").attr("class", "label").attr("style", a), d = t.description, p = t.label, g = await M(u, p, t.labelStyle, !0, !0), _ = {
2148
- width: 0,
2149
- height: 0
2150
- };
2151
- if (l(f())) {
2152
- let e = g.children[0], t = i(g);
2153
- _ = e.getBoundingClientRect(), t.attr("width", _.width), t.attr("height", _.height);
2154
- }
2155
- r.info("Text 2", d);
2156
- let v = d || [], y = g.getBBox(), b = await M(u, Array.isArray(v) ? v.join("<br/>") : v, t.labelStyle, !0, !0), x = b.children[0], C = i(b);
2157
- _ = x.getBoundingClientRect(), C.attr("width", _.width), C.attr("height", _.height);
2158
- let w = (t.padding || 0) / 2;
2159
- i(b).attr("transform", "translate( " + (_.width > y.width ? 0 : (y.width - _.width) / 2) + ", " + (y.height + w + 5) + ")"), i(g).attr("transform", "translate( " + (_.width < y.width ? 0 : -(y.width - _.width) / 2) + ", 0)"), _ = u.node().getBBox(), u.attr("transform", "translate(" + -_.width / 2 + ", " + (-_.height / 2 - w + 3) + ")");
2160
- let E = _.width + (t.padding || 0), D = _.height + (t.padding || 0), O = -_.width / 2 - w, k = -_.height / 2 - w, A, j;
2161
- if (t.look === "handDrawn") {
2162
- let e = S.svg(s), n = m(t, {}), i = e.path(N(O, k, E, D, t.rx || 0), n), a = e.line(-_.width / 2 - w, -_.height / 2 - w + y.height + w, _.width / 2 + w, -_.height / 2 - w + y.height + w, n);
2163
- j = s.insert(() => (r.debug("Rough node insert CXC", i), a), ":first-child"), A = s.insert(() => (r.debug("Rough node insert CXC", i), i), ":first-child");
2164
- } else A = c.insert("rect", ":first-child"), j = c.insert("line"), A.attr("class", "outer title-state").attr("style", a).attr("x", -_.width / 2 - w).attr("y", -_.height / 2 - w).attr("width", _.width + (t.padding || 0)).attr("height", _.height + (t.padding || 0)), j.attr("class", "divider").attr("x1", -_.width / 2 - w).attr("x2", _.width / 2 + w).attr("y1", -_.height / 2 - w + y.height + w).attr("y2", -_.height / 2 - w + y.height + w);
2165
- return T(t, A), t.intersect = function(e) {
2166
- return G.rect(t, e);
2167
- }, s;
2168
- }
2169
- a(ot, "rectWithTitle");
2170
- async function st(e, t, { config: { themeVariables: n } }) {
2171
- let r = n?.radius ?? 5;
2172
- return we(e, t, {
2173
- rx: r,
2174
- ry: r,
2175
- classes: "",
2176
- labelPaddingX: (t?.padding ?? 0) * 1,
2177
- labelPaddingY: (t?.padding ?? 0) * 1
2178
- });
2179
- }
2180
- a(st, "roundedRect");
2181
- var Z = 8;
2182
- async function ct(e, t) {
2183
- let { labelStyles: r, nodeStyles: i } = h(t);
2184
- t.labelStyle = r;
2185
- let a = t.look === "neo" ? 16 : t.padding ?? 0, o = t.look === "neo" ? 12 : t.padding ?? 0, { shapeSvg: s, bbox: c, label: l } = await C(e, t, E(t)), u = (t?.width ?? c.width) + a * 2 + (t.look === "neo" ? Z : Z * 2), d = (t?.height ?? c.height) + o * 2, f = u - Z, p = d, g = Z - u / 2, _ = -d / 2, { cssStyles: v } = t, y = S.svg(s), b = m(t, {});
2186
- t.look !== "handDrawn" && (b.roughness = 0, b.fillStyle = "solid");
2187
- let x = [
2188
- {
2189
- x: g,
2190
- y: _
2191
- },
2192
- {
2193
- x: g + f,
2194
- y: _
2195
- },
2196
- {
2197
- x: g + f,
2198
- y: _ + p
2199
- },
2200
- {
2201
- x: g - Z,
2202
- y: _ + p
2203
- },
2204
- {
2205
- x: g - Z,
2206
- y: _
2207
- },
2208
- {
2209
- x: g,
2210
- y: _
2211
- },
2212
- {
2213
- x: g,
2214
- y: _ + p
2215
- }
2216
- ], w = y.polygon(x.map((e) => [e.x, e.y]), b), D = s.insert(() => w, ":first-child");
2217
- return D.attr("class", "basic label-container outer-path").attr("style", n(v)), i && t.look !== "handDrawn" && D.selectAll("path").attr("style", i), v && t.look !== "handDrawn" && D.selectAll("path").attr("style", i), l.attr("transform", `translate(${Z / 2 - c.width / 2 - (c.x - (c.left ?? 0))}, ${-(c.height / 2) - (c.y - (c.top ?? 0))})`), T(t, D), t.intersect = function(e) {
2218
- return G.rect(t, e);
2219
- }, s;
2220
- }
2221
- a(ct, "shadedProcess");
2222
- async function lt(e, t) {
2223
- let { labelStyles: n, nodeStyles: r } = h(t);
2224
- t.labelStyle = n;
2225
- let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i;
2226
- (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));
2227
- let { shapeSvg: s, bbox: c, label: l } = await C(e, t, E(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, g = -f / 2, _ = -p / 2, { cssStyles: v } = t, y = S.svg(s), b = m(t, {});
2228
- t.look !== "handDrawn" && (b.roughness = 0, b.fillStyle = "solid");
2229
- let x = [
2230
- {
2231
- x: g,
2232
- y: _
2233
- },
2234
- {
2235
- x: g,
2236
- y: _ + p
2237
- },
2238
- {
2239
- x: g + f,
2240
- y: _ + p
2241
- },
2242
- {
2243
- x: g + f,
2244
- y: _ - p / 2
2245
- }
2246
- ], w = D(x), O = y.path(w, b), k = s.insert(() => O, ":first-child");
2247
- return k.attr("class", "basic label-container outer-path"), v && t.look !== "handDrawn" && k.selectChildren("path").attr("style", v), r && t.look !== "handDrawn" && k.selectChildren("path").attr("style", r), k.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))})`), T(t, k), t.intersect = function(e) {
2248
- return G.polygon(t, x, e);
2249
- }, s;
2250
- }
2251
- a(lt, "slopedRect");
2252
- async function ut(e, t) {
2253
- let n = t.padding ?? 0, r = t.look === "neo" ? 16 : n * 2, i = t.look === "neo" ? 12 : n;
2254
- return we(e, t, {
2255
- rx: 0,
2256
- ry: 0,
2257
- classes: "",
2258
- labelPaddingX: t.labelPaddingX ?? r,
2259
- labelPaddingY: i
2260
- });
2261
- }
2262
- a(ut, "squareRect");
2263
- async function dt(e, t) {
2264
- let { labelStyles: n, nodeStyles: r } = h(t);
2265
- t.labelStyle = n;
2266
- let i = t.padding ?? 0, a = t.look === "neo" ? 20 : i, o = t.look === "neo" ? 12 : i, { shapeSvg: s, bbox: c } = await C(e, t, E(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 = S.svg(s), g = m(t, {});
2267
- t.look !== "handDrawn" && (g.roughness = 0, g.fillStyle = "solid");
2268
- let _ = [
2269
- {
2270
- x: -u / 2 + d,
2271
- y: -l / 2
2272
- },
2273
- {
2274
- x: u / 2 - d,
2275
- y: -l / 2
2276
- },
2277
- ...k(-u / 2 + d, 0, d, 50, 90, 270),
2278
- {
2279
- x: u / 2 - d,
2280
- y: l / 2
2281
- },
2282
- ...k(u / 2 - d, 0, d, 50, 270, 450)
2283
- ], v = D(_), y = p.path(v, g), b = s.insert(() => y, ":first-child");
2284
- 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), T(t, b), t.intersect = function(e) {
2285
- return G.polygon(t, _, e);
2286
- }, s;
2287
- }
2288
- a(dt, "stadium");
2289
- async function ft(e, t) {
2290
- return we(e, t, {
2291
- rx: t.look === "neo" ? 3 : 5,
2292
- ry: t.look === "neo" ? 3 : 5,
2293
- classes: "flowchart-node"
2294
- });
2295
- }
2296
- a(ft, "state");
2297
- function pt(e, t, { config: { themeVariables: n } }) {
2298
- let { labelStyles: r, nodeStyles: i } = h(t);
2299
- t.labelStyle = r;
2300
- let { cssStyles: a } = t, { lineColor: o, stateBorder: s, nodeBorder: c, nodeShadow: l } = n;
2301
- (t.width || t.height) && ((t.width ?? 0) < 14 && (t.width = 14), (t.height ?? 0) < 14 && (t.height = 14)), t.width ||= 14, t.height ||= 14;
2302
- let u = e.insert("g").attr("class", "node default").attr("id", t.domId ?? t.id), d = S.svg(u), f = m(t, {});
2303
- t.look !== "handDrawn" && (f.roughness = 0, f.fillStyle = "solid");
2304
- let p = d.circle(0, 0, t.width, {
2305
- ...f,
2306
- stroke: o,
2307
- strokeWidth: 2
2308
- }), g = s ?? c, _ = (t.width ?? 0) * 5 / 14, v = d.circle(0, 0, _, {
2309
- ...f,
2310
- fill: g,
2311
- stroke: g,
2312
- strokeWidth: 2,
2313
- fillStyle: "solid"
2314
- }), y = u.insert(() => p, ":first-child");
2315
- 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") {
2316
- let t = e.node()?.ownerSVGElement?.id ?? "", n = t ? `${t}-drop-shadow-small` : "drop-shadow-small";
2317
- y.attr("style", `filter:url(#${n})`);
2318
- }
2319
- return T(t, y), t.intersect = function(e) {
2320
- return G.circle(t, (t.width ?? 0) / 2, e);
2321
- }, u;
2322
- }
2323
- a(pt, "stateEnd");
2324
- function mt(e, t, { config: { themeVariables: n } }) {
2325
- let { lineColor: r, nodeShadow: i } = n;
2326
- (t.width || t.height) && ((t.width ?? 0) < 14 && (t.width = 14), (t.height ?? 0) < 14 && (t.height = 14)), t.width ||= 14, t.height ||= 14;
2327
- let a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), o;
2328
- if (t.look === "handDrawn") {
2329
- let e = S.svg(a).circle(0, 0, t.width, g(r));
2330
- 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);
2331
- } 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);
2332
- if (t.width < 25 && i && t.look !== "handDrawn") {
2333
- let t = e.node()?.ownerSVGElement?.id ?? "", n = t ? `${t}-drop-shadow-small` : "drop-shadow-small";
2334
- o.attr("style", `filter:url(#${n})`);
2335
- }
2336
- return T(t, o), t.intersect = function(e) {
2337
- return G.circle(t, (t.width ?? 7) / 2, e);
2338
- }, a;
2339
- }
2340
- a(mt, "stateStart");
2341
- var ht = 8;
2342
- async function gt(e, t) {
2343
- let { labelStyles: r, nodeStyles: i } = h(t);
2344
- t.labelStyle = r;
2345
- let a = t?.padding ?? 8, o = t.look === "neo" ? 28 : a, s = t.look === "neo" ? 12 : a, { shapeSvg: c, bbox: l } = await C(e, t, E(t)), u = (t?.width ?? l.width) + 2 * ht + o, d = (t?.height ?? l.height) + s, f = u - 2 * ht, p = d, g = -u / 2, _ = -d / 2, v = [
2346
- {
2347
- x: 0,
2348
- y: 0
2349
- },
2350
- {
2351
- x: f,
2352
- y: 0
2353
- },
2354
- {
2355
- x: f,
2356
- y: -p
2357
- },
2358
- {
2359
- x: 0,
2360
- y: -p
2361
- },
2362
- {
2363
- x: 0,
2364
- y: 0
2365
- },
2366
- {
2367
- x: -8,
2368
- y: 0
2369
- },
2370
- {
2371
- x: f + 8,
2372
- y: 0
2373
- },
2374
- {
2375
- x: f + 8,
2376
- y: -p
2377
- },
2378
- {
2379
- x: -8,
2380
- y: -p
2381
- },
2382
- {
2383
- x: -8,
2384
- y: 0
2385
- }
2386
- ];
2387
- if (t.look === "handDrawn") {
2388
- let e = S.svg(c), r = m(t, {}), i = e.rectangle(g, _, f + 16, p, r), a = e.line(g + ht, _, g + ht, _ + p, r), o = e.line(g + ht + f, _, g + ht + f, _ + p, r);
2389
- c.insert(() => a, ":first-child"), c.insert(() => o, ":first-child");
2390
- let s = c.insert(() => i, ":first-child"), { cssStyles: l } = t;
2391
- s.attr("class", "basic label-container").attr("style", n(l)), T(t, s);
2392
- } else {
2393
- let e = q(c, f, p, v);
2394
- i && e.attr("style", i), T(t, e);
2395
- }
2396
- return t.intersect = function(e) {
2397
- return G.polygon(t, v, e);
2398
- }, c;
2399
- }
2400
- a(gt, "subroutine");
2401
- var _t = .2;
2402
- async function vt(e, t) {
2403
- let { labelStyles: n, nodeStyles: r } = h(t);
2404
- t.labelStyle = n;
2405
- let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i;
2406
- (t.width || t.height) && (t.height = Math.max((t?.height ?? 0) - o * 2, 10), t.width = Math.max((t?.width ?? 0) - a * 2 - _t * (t.height + o * 2), 10));
2407
- let { shapeSvg: s, bbox: c } = await C(e, t, E(t)), l = (t?.height ? t?.height : c.height) + o * 2, u = _t * l, d = _t * l, f = (t?.width ? t?.width : c.width) + a * 2 + u - u, p = l, g = -f / 2, _ = -p / 2, { cssStyles: v } = t, y = S.svg(s), b = m(t, {}), x = [
2408
- {
2409
- x: g - u / 2,
2410
- y: _
2411
- },
2412
- {
2413
- x: g + f + u / 2,
2414
- y: _
2415
- },
2416
- {
2417
- x: g + f + u / 2,
2418
- y: _ + p
2419
- },
2420
- {
2421
- x: g - u / 2,
2422
- y: _ + p
2423
- }
2424
- ], w = [
2425
- {
2426
- x: g + f - u / 2,
2427
- y: _ + p
2428
- },
2429
- {
2430
- x: g + f + u / 2,
2431
- y: _ + p
2432
- },
2433
- {
2434
- x: g + f + u / 2,
2435
- y: _ + p - d
2436
- }
2437
- ];
2438
- t.look !== "handDrawn" && (b.roughness = 0, b.fillStyle = "solid");
2439
- let O = D(x), k = y.path(O, b), A = D(w), j = y.path(A, {
2440
- ...b,
2441
- fillStyle: "solid"
2442
- }), M = s.insert(() => j, ":first-child");
2443
- return M.insert(() => k, ":first-child"), M.attr("class", "basic label-container outer-path"), v && t.look !== "handDrawn" && M.selectAll("path").attr("style", v), r && t.look !== "handDrawn" && M.selectAll("path").attr("style", r), T(t, M), t.intersect = function(e) {
2444
- return G.polygon(t, x, e);
2445
- }, s;
2446
- }
2447
- a(vt, "taggedRect");
2448
- async function yt(e, t) {
2449
- let { labelStyles: n, nodeStyles: r } = h(t);
2450
- t.labelStyle = n;
2451
- let { shapeSvg: i, bbox: a, label: o } = await C(e, t, E(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, g = S.svg(i), _ = m(t, {});
2452
- t.look !== "handDrawn" && (_.roughness = 0, _.fillStyle = "solid");
2453
- let v = [
2454
- {
2455
- x: -s / 2 - s / 2 * .1,
2456
- y: f / 2
2457
- },
2458
- ...O(-s / 2 - s / 2 * .1, f / 2, s / 2 + s / 2 * .1, f / 2, l, .8),
2459
- {
2460
- x: s / 2 + s / 2 * .1,
2461
- y: -f / 2
2462
- },
2463
- {
2464
- x: -s / 2 - s / 2 * .1,
2465
- y: -f / 2
2466
- }
2467
- ], y = -s / 2 + s / 2 * .1, b = -f / 2 - d * .4, x = [
2468
- {
2469
- x: y + s - u,
2470
- y: (b + c) * 1.3
2471
- },
2472
- {
2473
- x: y + s,
2474
- y: b + c - d
2475
- },
2476
- {
2477
- x: y + s,
2478
- y: (b + c) * .9
2479
- },
2480
- ...O(y + s, (b + c) * 1.25, y + s - u, (b + c) * 1.3, -c * .02, .5)
2481
- ], w = D(v), k = g.path(w, _), A = D(x), j = g.path(A, {
2482
- ..._,
2483
- fillStyle: "solid"
2484
- }), M = i.insert(() => j, ":first-child");
2485
- return M.insert(() => k, ":first-child"), M.attr("class", "basic label-container outer-path"), p && t.look !== "handDrawn" && M.selectAll("path").attr("style", p), r && t.look !== "handDrawn" && M.selectAll("path").attr("style", r), M.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))})`), T(t, M), t.intersect = function(e) {
2486
- return G.polygon(t, v, e);
2487
- }, i;
2488
- }
2489
- a(yt, "taggedWaveEdgedRectangle");
2490
- async function bt(e, t) {
2491
- let { labelStyles: n, nodeStyles: r } = h(t);
2492
- t.labelStyle = n;
2493
- let { shapeSvg: i, bbox: a } = await C(e, t, E(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");
2494
- 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), T(t, u), t.intersect = function(e) {
2495
- return G.rect(t, e);
2496
- }, i;
2497
- }
2498
- a(bt, "text");
2499
- var xt = /* @__PURE__ */ a((e, t, n, r, i, a) => `M${e},${t}
2500
- a${i},${a} 0,0,1 0,${-r}
2501
- l${n},0
2502
- a${i},${a} 0,0,1 0,${r}
2503
- M${n},${-r}
2504
- a${i},${a} 0,0,0 0,${r}
2505
- l${-n},0`, "createCylinderPathD"), St = /* @__PURE__ */ a((e, t, n, r, i, a) => [
2506
- `M${e},${t}`,
2507
- `M${e + n},${t}`,
2508
- `a${i},${a} 0,0,0 0,${-r}`,
2509
- `l${-n},0`,
2510
- `a${i},${a} 0,0,0 0,${r}`,
2511
- `l${n},0`
2512
- ].join(" "), "createOuterCylinderPathD"), Ct = /* @__PURE__ */ a((e, t, n, r, i, a) => [`M${e + n / 2},${-r / 2}`, `a${i},${a} 0,0,0 0,${r}`].join(" "), "createInnerCylinderPathD"), wt = 5, Tt = 10;
2513
- async function Et(e, t) {
2514
- let { labelStyles: r, nodeStyles: i } = h(t);
2515
- t.labelStyle = r;
2516
- let a = t.padding ?? 0, o = t.look === "neo" ? 12 : a / 2;
2517
- if (t.width || t.height) {
2518
- let e = t.height ?? 0;
2519
- t.height = (t.height ?? 0) - o, t.height < wt && (t.height = wt);
2520
- let n = e / 2 / (2.5 + e / 50);
2521
- t.width = (t.width ?? 0) - o - n * 3, t.width < Tt && (t.width = Tt);
2522
- }
2523
- let { shapeSvg: s, bbox: c, label: l } = await C(e, t, E(t)), u = (t.height ? t.height : c.height) + o, d = u / 2, f = d / (2.5 + u / 50), p = (t.width ? t.width : c.width) + f + o, { cssStyles: g } = t, _;
2524
- if (t.look === "handDrawn") {
2525
- let e = S.svg(s), n = St(0, 0, p, u, f, d), r = Ct(0, 0, p, u, f, d), i = e.path(n, m(t, {})), a = e.path(r, m(t, { fill: "none" }));
2526
- _ = s.insert(() => a, ":first-child"), _ = s.insert(() => i, ":first-child"), _.attr("class", "basic label-container"), g && _.attr("style", g);
2527
- } else {
2528
- let e = xt(0, 0, p, u, f, d);
2529
- _ = s.insert("path", ":first-child").attr("d", e).attr("class", "basic label-container").attr("style", n(g)).attr("style", i), _.attr("class", "basic label-container outer-path"), g && _.selectAll("path").attr("style", g), i && _.selectAll("path").attr("style", i);
2530
- }
2531
- return _.attr("label-offset-x", f), _.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))})`), T(t, _), t.intersect = function(e) {
2532
- let n = G.rect(t, e), r = n.y - (t.y ?? 0);
2533
- 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)) {
2534
- let i = f * f * (1 - r * r / (d * d));
2535
- i != 0 && (i = Math.sqrt(Math.abs(i))), i = f - i, e.x - (t.x ?? 0) > 0 && (i = -i), n.x += i;
2536
- }
2537
- return n;
2538
- }, s;
2539
- }
2540
- a(Et, "tiltedCylinder");
2541
- async function Dt(e, t) {
2542
- let { labelStyles: n, nodeStyles: r } = h(t);
2543
- t.labelStyle = n;
2544
- let i = t.padding ?? 0, a = (t.look, i), o = t.look === "neo" ? i * 2 : i, { shapeSvg: s, bbox: c } = await C(e, t, E(t)), l = (t?.height ?? c.height) + a, u = (t?.width ?? c.width) + o, d = [
2545
- {
2546
- x: -3 * l / 6,
2547
- y: 0
2548
- },
2549
- {
2550
- x: u + 3 * l / 6,
2551
- y: 0
2552
- },
2553
- {
2554
- x: u,
2555
- y: -l
2556
- },
2557
- {
2558
- x: 0,
2559
- y: -l
2560
- }
2561
- ], f, { cssStyles: p } = t;
2562
- if (t.look === "handDrawn") {
2563
- let e = S.svg(s), n = m(t, {}), r = D(d), i = e.path(r, n);
2564
- f = s.insert(() => i, ":first-child").attr("transform", `translate(${-u / 2}, ${l / 2})`), p && f.attr("style", p);
2565
- } else f = q(s, u, l, d);
2566
- return r && f.attr("style", r), t.width = u, t.height = l, T(t, f), t.intersect = function(e) {
2567
- return G.polygon(t, d, e);
2568
- }, s;
2569
- }
2570
- a(Dt, "trapezoid");
2571
- async function Ot(e, t) {
2572
- let { labelStyles: n, nodeStyles: r } = h(t);
2573
- t.labelStyle = n;
2574
- let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i;
2575
- (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));
2576
- let { shapeSvg: s, bbox: c } = await C(e, t, E(t)), l = (t?.width ? t?.width : c.width) + a * 2, u = (t?.height ? t?.height : c.height) + o * 2, { cssStyles: d } = t, f = S.svg(s), p = m(t, {});
2577
- t.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
2578
- let g = [
2579
- {
2580
- x: -l / 2 * .8,
2581
- y: -u / 2
2582
- },
2583
- {
2584
- x: l / 2 * .8,
2585
- y: -u / 2
2586
- },
2587
- {
2588
- x: l / 2,
2589
- y: -u / 2 * .6
2590
- },
2591
- {
2592
- x: l / 2,
2593
- y: u / 2
2594
- },
2595
- {
2596
- x: -l / 2,
2597
- y: u / 2
2598
- },
2599
- {
2600
- x: -l / 2,
2601
- y: -u / 2 * .6
2602
- }
2603
- ], _ = D(g), v = f.path(_, p), y = s.insert(() => v, ":first-child");
2604
- 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), T(t, y), t.intersect = function(e) {
2605
- return G.polygon(t, g, e);
2606
- }, s;
2607
- }
2608
- a(Ot, "trapezoidalPentagon");
2609
- var kt = 10, At = 10;
2610
- async function jt(e, t) {
2611
- let { labelStyles: n, nodeStyles: i } = h(t);
2612
- t.labelStyle = n;
2613
- let a = t.padding ?? 0, o = t.look === "neo" ? a * 2 : a;
2614
- (t.width || t.height) && (t.width = ((t?.width ?? 0) - o) / 2, t.width < At && (t.width = At), t.height = t?.height ?? 0, t.height < kt && (t.height = kt));
2615
- let { shapeSvg: s, bbox: c, label: l } = await C(e, t, E(t)), u = d(f().flowchart?.htmlLabels), p = (t?.width ? t?.width : c.width) + o, g = t?.height ? t?.height : p + c.height, _ = g, v = [
2616
- {
2617
- x: 0,
2618
- y: 0
2619
- },
2620
- {
2621
- x: _,
2622
- y: 0
2623
- },
2624
- {
2625
- x: _ / 2,
2626
- y: -g
2627
- }
2628
- ], { cssStyles: y } = t, b = S.svg(s), x = m(t, {});
2629
- t.look !== "handDrawn" && (x.roughness = 0, x.fillStyle = "solid");
2630
- let w = D(v), O = b.path(w, x), k = s.insert(() => O, ":first-child").attr("transform", `translate(${-g / 2}, ${g / 2})`).attr("class", "outer-path");
2631
- return y && t.look !== "handDrawn" && k.selectChildren("path").attr("style", y), i && t.look !== "handDrawn" && k.selectChildren("path").attr("style", i), t.width = p, t.height = g, T(t, k), l.attr("transform", `translate(${-c.width / 2 - (c.x - (c.left ?? 0))}, ${g / 2 - (c.height + (t.padding ?? 0) / (u ? 2 : 1) - (c.y - (c.top ?? 0)))})`), t.intersect = function(e) {
2632
- return r.info("Triangle intersect", t, v, e), G.polygon(t, v, e);
2633
- }, s;
2634
- }
2635
- a(jt, "triangle");
2636
- async function Mt(e, t) {
2637
- let { labelStyles: n, nodeStyles: r } = h(t);
2638
- t.labelStyle = n;
2639
- let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i, s = !0;
2640
- (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));
2641
- let { shapeSvg: c, bbox: l, label: u } = await C(e, t, E(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, g = f + (s ? p : -p), { cssStyles: _ } = t, v = 14 - d, y = v > 0 ? v / 2 : 0, b = S.svg(c), x = m(t, {});
2642
- t.look !== "handDrawn" && (x.roughness = 0, x.fillStyle = "solid");
2643
- let w = [
2644
- {
2645
- x: -d / 2 - y,
2646
- y: g / 2
2647
- },
2648
- ...O(-d / 2 - y, g / 2, d / 2 + y, g / 2, p, .8),
2649
- {
2650
- x: d / 2 + y,
2651
- y: -g / 2
2652
- },
2653
- {
2654
- x: -d / 2 - y,
2655
- y: -g / 2
2656
- }
2657
- ], k = D(w), A = b.path(k, x), j = c.insert(() => A, ":first-child");
2658
- return j.attr("class", "basic label-container outer-path"), _ && t.look !== "handDrawn" && j.selectAll("path").attr("style", _), r && t.look !== "handDrawn" && j.selectAll("path").attr("style", r), j.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))})`), T(t, j), t.intersect = function(e) {
2659
- return G.polygon(t, w, e);
2660
- }, c;
2661
- }
2662
- a(Mt, "waveEdgedRectangle");
2663
- async function Nt(e, t) {
2664
- let { labelStyles: n, nodeStyles: r } = h(t);
2665
- t.labelStyle = n;
2666
- let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 20 : i;
2667
- if (t.width || t.height) {
2668
- t.width = t?.width ?? 0, t.width < 20 && (t.width = 20), t.height = t?.height ?? 0, t.height < 10 && (t.height = 10);
2669
- let e = Math.min(t.height * .2, t.height / 4);
2670
- t.height = Math.ceil(t.height - o - 20 / 9 * e), t.width -= a * 2;
2671
- }
2672
- let { shapeSvg: s, bbox: c } = await C(e, t, E(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, g = S.svg(s), _ = m(t, {});
2673
- t.look !== "handDrawn" && (_.roughness = 0, _.fillStyle = "solid");
2674
- let v = [
2675
- {
2676
- x: -l / 2,
2677
- y: f / 2
2678
- },
2679
- ...O(-l / 2, f / 2, l / 2, f / 2, d, 1),
2680
- {
2681
- x: l / 2,
2682
- y: -f / 2
2683
- },
2684
- ...O(l / 2, -f / 2, -l / 2, -f / 2, d, -1)
2685
- ], y = D(v), b = g.path(y, _), x = s.insert(() => b, ":first-child");
2686
- 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), T(t, x), t.intersect = function(e) {
2687
- return G.polygon(t, v, e);
2688
- }, s;
2689
- }
2690
- a(Nt, "waveRectangle");
2691
- var Q = 10;
2692
- async function Pt(e, t) {
2693
- let { labelStyles: n, nodeStyles: r } = h(t);
2694
- t.labelStyle = n;
2695
- let i = t.look === "neo" ? 16 : t.padding ?? 0, a = t.look === "neo" ? 12 : t.padding ?? 0;
2696
- (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));
2697
- let { shapeSvg: o, bbox: s, label: c } = await C(e, t, E(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, g = -f / 2, { cssStyles: _ } = t, v = S.svg(o), y = m(t, {}), b = [
2698
- {
2699
- x: p - Q,
2700
- y: g - Q
2701
- },
2702
- {
2703
- x: p - Q,
2704
- y: g + f
2705
- },
2706
- {
2707
- x: p + d,
2708
- y: g + f
2709
- },
2710
- {
2711
- x: p + d,
2712
- y: g - Q
2713
- }
2714
- ], x = `M${p - Q},${g - Q} L${p + d},${g - Q} L${p + d},${g + f} L${p - Q},${g + f} L${p - Q},${g - Q}
2715
- M${p - Q},${g} L${p + d},${g}
2716
- M${p},${g - Q} L${p},${g + f}`;
2717
- t.look !== "handDrawn" && (y.roughness = 0, y.fillStyle = "solid");
2718
- let w = v.path(x, y), D = o.insert(() => w, ":first-child");
2719
- return D.attr("transform", `translate(${Q / 2}, ${Q / 2})`), D.attr("class", "basic label-container outer-path"), _ && t.look !== "handDrawn" && D.selectAll("path").attr("style", _), r && t.look !== "handDrawn" && D.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))})`), T(t, D), t.intersect = function(e) {
2720
- return G.polygon(t, b, e);
2721
- }, o;
2722
- }
2723
- a(Pt, "windowPane");
2724
- var Ft = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), It = /* @__PURE__ */ new Set([
2725
- "redux",
2726
- "redux-dark",
2727
- "redux-color",
2728
- "redux-dark-color"
2729
- ]);
2730
- async function Lt(e, n) {
2731
- let r = n;
2732
- r.alias && (n.label = r.alias);
2733
- let { theme: a, themeVariables: o } = u(), { rowEven: s, rowOdd: c, nodeBorder: l, borderColorArray: f } = o;
2734
- if (n.look === "handDrawn") {
2735
- let { themeVariables: t } = u(), { background: r } = t;
2736
- await Lt(e, {
2737
- ...n,
2738
- id: n.id + "-background",
2739
- domId: (n.domId || n.id) + "-background",
2740
- look: "default",
2741
- cssStyles: ["stroke: none", `fill: ${r}`]
2742
- });
2743
- }
2744
- let p = u();
2745
- n.useHtmlLabels = p.htmlLabels;
2746
- let g = p.er?.diagramPadding ?? 10, _ = p.er?.entityPadding ?? 6, { cssStyles: v } = n, { labelStyles: y, nodeStyles: b } = h(n);
2747
- if (r.attributes.length === 0 && n.label) {
2748
- let i = {
2749
- rx: 0,
2750
- ry: 0,
2751
- labelPaddingX: g,
2752
- labelPaddingY: g * 1.5,
2753
- classes: ""
2754
- };
2755
- t(n.label, p) + i.labelPaddingX * 2 < p.er.minEntityWidth && (n.width = p.er.minEntityWidth);
2756
- let o = await we(e, n, i);
2757
- if (a != null && Ft.has(a)) {
2758
- let e = r.colorIndex ?? 0;
2759
- o.attr("data-color-id", `color-${e % f.length}`);
2760
- }
2761
- if (!d(p.htmlLabels)) {
2762
- let e = o.select("text"), t = e.node()?.getBBox();
2763
- e.attr("transform", `translate(${-t.width / 2}, 0)`);
2764
- }
2765
- return o;
2766
- }
2767
- p.htmlLabels || (g *= 1.25, _ *= 1.25);
2768
- let x = E(n);
2769
- x ||= "node default";
2770
- let C = e.insert("g").attr("class", x).attr("id", n.domId || n.id), w = await Rt(C, n.label ?? "", p, 0, 0, ["name"], y);
2771
- w.height += _;
2772
- let D = 0, O = [], k = [], A = 0, j = 0, M = 0, N = 0, P = !0, F = !0;
2773
- for (let e of r.attributes) {
2774
- let t = await Rt(C, e.type, p, 0, D, ["attribute-type"], y);
2775
- A = Math.max(A, t.width + g);
2776
- let n = await Rt(C, e.name, p, 0, D, ["attribute-name"], y);
2777
- j = Math.max(j, n.width + g);
2778
- let r = await Rt(C, e.keys.join(), p, 0, D, ["attribute-keys"], y);
2779
- M = Math.max(M, r.width + g);
2780
- let i = await Rt(C, e.comment, p, 0, D, ["attribute-comment"], y);
2781
- N = Math.max(N, i.width + g);
2782
- let a = Math.max(t.height, n.height, r.height, i.height) + _;
2783
- k.push({
2784
- yOffset: D,
2785
- rowHeight: a
2786
- }), D += a;
2787
- }
2788
- let I = 4;
2789
- M <= g && (P = !1, M = 0, I--), N <= g && (F = !1, N = 0, I--);
2790
- let L = C.node().getBBox();
2791
- if (w.width + g * 2 - (A + j + M + N) > 0) {
2792
- let e = w.width + g * 2 - (A + j + M + N);
2793
- A += e / I, j += e / I, M > 0 && (M += e / I), N > 0 && (N += e / I);
2794
- }
2795
- let ee = A + j + M + N, R = S.svg(C), z = m(n, {});
2796
- n.look !== "handDrawn" && (z.roughness = 0, z.fillStyle = "solid");
2797
- let te = 0;
2798
- k.length > 0 && (te = k.reduce((e, t) => e + (t?.rowHeight ?? 0), 0));
2799
- let B = Math.max(L.width + g * 2, n?.width || 0, ee), V = Math.max((te ?? 0) + w.height, n?.height || 0), H = -B / 2, U = -V / 2;
2800
- if (C.selectAll("g:not(:first-child)").each((e, t, n) => {
2801
- let r = i(n[t]), a = r.attr("transform"), o = 0, s = 0;
2802
- if (a) {
2803
- let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);
2804
- e && (o = parseFloat(e[1]), s = parseFloat(e[2]), r.attr("class").includes("attribute-name") ? o += A : r.attr("class").includes("attribute-keys") ? o += A + j : r.attr("class").includes("attribute-comment") && (o += A + j + M));
2805
- }
2806
- r.attr("transform", `translate(${H + g / 2 + o}, ${s + U + w.height + _ / 2})`);
2807
- }), C.select(".name").attr("transform", "translate(" + -w.width / 2 + ", " + (U + _ / 2) + ")"), a != null && Ft.has(a)) {
2808
- let e = r.colorIndex ?? 0;
2809
- C.attr("data-color-id", `color-${e % f.length}`);
2810
- }
2811
- let ne = R.rectangle(H, U, B, V, z), re = C.insert(() => ne, ":first-child").attr("class", "outer-path").attr("style", v.join(""));
2812
- O.push(0);
2813
- for (let [e, t] of k.entries()) {
2814
- let n = (e + 1) % 2 == 0 && t.yOffset !== 0, r = R.rectangle(H, w.height + U + t?.yOffset, B, t?.rowHeight, {
2815
- ...z,
2816
- fill: n ? s : c,
2817
- stroke: l
2818
- });
2819
- C.insert(() => r, "g.label").attr("style", v.join("")).attr("class", `row-rect-${n ? "even" : "odd"}`);
2820
- }
2821
- let ie = 1e-4, W = zt(H, w.height + U, B + H, w.height + U, ie), K = R.polygon(W.map((e) => [e.x, e.y]), z);
2822
- if (C.insert(() => K).attr("class", "divider"), W = zt(A + H, w.height + U, A + H, V + U, ie), K = R.polygon(W.map((e) => [e.x, e.y]), z), C.insert(() => K).attr("class", "divider"), P) {
2823
- let e = A + j + H;
2824
- W = zt(e, w.height + U, e, V + U, ie), K = R.polygon(W.map((e) => [e.x, e.y]), z), C.insert(() => K).attr("class", "divider");
2825
- }
2826
- if (F) {
2827
- let e = A + j + M + H;
2828
- W = zt(e, w.height + U, e, V + U, ie), K = R.polygon(W.map((e) => [e.x, e.y]), z), C.insert(() => K).attr("class", "divider");
2829
- }
2830
- for (let e of O) {
2831
- let t = w.height + U + e;
2832
- W = zt(H, t, B + H, t, ie), K = R.polygon(W.map((e) => [e.x, e.y]), z), C.insert(() => K).attr("class", "divider");
2833
- }
2834
- if (T(n, re), b && n.look !== "handDrawn") {
2835
- if (a != null && It.has(a)) C.selectAll("path").attr("style", b);
2836
- else {
2837
- let e = b.split(";")?.filter((e) => e.includes("stroke"))?.map((e) => `${e}`).join("; ");
2838
- C.selectAll("path").attr("style", e ?? ""), C.selectAll(".row-rect-even path").attr("style", b);
2839
- }
2840
- }
2841
- return n.intersect = function(e) {
2842
- return G.rect(n, e);
2843
- }, C;
2844
- }
2845
- a(Lt, "erBox");
2846
- async function Rt(e, n, r, a = 0, o = 0, s = [], l = "") {
2847
- let u = e.insert("g").attr("class", `label ${s.join(" ")}`).attr("transform", `translate(${a}, ${o})`).attr("style", l);
2848
- n !== c(n) && (n = c(n), n = n.replaceAll("<", "&lt;").replaceAll(">", "&gt;"));
2849
- let f = u.node().appendChild(await x(u, n, {
2850
- width: t(n, r) + 100,
2851
- style: l,
2852
- useHtmlLabels: r.htmlLabels
2853
- }, r));
2854
- if (n.includes("&lt;") || n.includes("&gt;")) {
2855
- let e = f.children[0];
2856
- for (e.textContent = e.textContent.replaceAll("&lt;", "<").replaceAll("&gt;", ">"); e.childNodes[0];) e = e.childNodes[0], e.textContent = e.textContent.replaceAll("&lt;", "<").replaceAll("&gt;", ">");
2857
- }
2858
- let p = f.getBBox();
2859
- if (d(r.htmlLabels)) {
2860
- let e = f.children[0];
2861
- e.style.textAlign = "start";
2862
- let t = i(f);
2863
- p = e.getBoundingClientRect(), t.attr("width", p.width), t.attr("height", p.height);
2864
- }
2865
- return p;
2866
- }
2867
- a(Rt, "addText");
2868
- function zt(e, t, n, r, i) {
2869
- return e === n ? [
2870
- {
2871
- x: e - i / 2,
2872
- y: t
2873
- },
2874
- {
2875
- x: e + i / 2,
2876
- y: t
2877
- },
2878
- {
2879
- x: n + i / 2,
2880
- y: r
2881
- },
2882
- {
2883
- x: n - i / 2,
2884
- y: r
2885
- }
2886
- ] : [
2887
- {
2888
- x: e,
2889
- y: t - i / 2
2890
- },
2891
- {
2892
- x: e,
2893
- y: t + i / 2
2894
- },
2895
- {
2896
- x: n,
2897
- y: r + i / 2
2898
- },
2899
- {
2900
- x: n,
2901
- y: r - i / 2
2902
- }
2903
- ];
2904
- }
2905
- a(zt, "lineToPolygon");
2906
- async function Bt(e, t, n, r, i = n.class.padding ?? 12) {
2907
- let a = r ? 0 : 3, o = e.insert("g").attr("class", E(t)).attr("id", t.domId || t.id), s = null, c = null, l = null, u = null, d = 0, f = 0, p = 0;
2908
- if (s = o.insert("g").attr("class", "annotation-group text"), t.annotations.length > 0) {
2909
- let e = t.annotations[0];
2910
- await Vt(s, { text: `\xAB${e}\xBB` }, 0), d = s.node().getBBox().height;
2911
- }
2912
- c = o.insert("g").attr("class", "label-group text"), await Vt(c, t, 0, ["font-weight: bolder"]);
2913
- let m = c.node().getBBox();
2914
- f = m.height, l = o.insert("g").attr("class", "members-group text");
2915
- let h = 0;
2916
- for (let e of t.members) {
2917
- let t = await Vt(l, e, h, [e.parseClassifier()]);
2918
- h += t + a;
2919
- }
2920
- p = l.node().getBBox().height, p <= 0 && (p = i / 2), u = o.insert("g").attr("class", "methods-group text");
2921
- let g = 0;
2922
- for (let e of t.methods) {
2923
- let t = await Vt(u, e, g, [e.parseClassifier()]);
2924
- g += t + a;
2925
- }
2926
- let _ = o.node().getBBox();
2927
- if (s !== null) {
2928
- let e = s.node().getBBox();
2929
- s.attr("transform", `translate(${-e.width / 2})`);
2930
- }
2931
- 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(), {
2932
- shapeSvg: o,
2933
- bbox: _
2934
- };
2935
- }
2936
- a(Bt, "textHelper");
2937
- async function Vt(n, r, c, l = []) {
2938
- let f = n.insert("g").attr("class", "label").attr("style", l.join("; ")), p = u(), m = "useHtmlLabels" in r ? r.useHtmlLabels : d(p.htmlLabels) ?? !0, h = "";
2939
- h = "text" in r ? r.text : r.label, !m && h.startsWith("\\") && (h = h.substring(1)), o(h) && (m = !0);
2940
- let g = await x(f, s(e(h)), {
2941
- width: t(h, p) + 50,
2942
- classes: "markdown-node-label",
2943
- useHtmlLabels: m
2944
- }, p), _, v = 1;
2945
- if (m) {
2946
- let e = g.children[0], t = i(g);
2947
- v = e.innerHTML.split("<br>").length, e.innerHTML.includes("</math>") && (v += e.innerHTML.split("<mrow>").length - 1);
2948
- let n = e.getElementsByTagName("img");
2949
- if (n) {
2950
- let e = h.replace(/<img[^>]*>/g, "").trim() === "";
2951
- await Promise.all([...n].map((t) => new Promise((n) => {
2952
- function r() {
2953
- if (t.style.display = "flex", t.style.flexDirection = "column", e) {
2954
- let e = p.fontSize?.toString() ?? window.getComputedStyle(document.body).fontSize, n = parseInt(e, 10) * 5 + "px";
2955
- t.style.minWidth = n, t.style.maxWidth = n;
2956
- } else t.style.width = "100%";
2957
- n(t);
2958
- }
2959
- a(r, "setupImage"), setTimeout(() => {
2960
- t.complete && r();
2961
- }), t.addEventListener("error", r), t.addEventListener("load", r);
2962
- })));
2963
- }
2964
- _ = e.getBoundingClientRect(), t.attr("width", _.width), t.attr("height", _.height);
2965
- } else {
2966
- l.includes("font-weight: bolder") && i(g).selectAll("tspan").attr("font-weight", ""), v = g.children.length;
2967
- let e = g.children[0];
2968
- (g.textContent === "" || g.textContent.includes("&gt")) && (e.textContent = h[0] + h.substring(1).replaceAll("&gt;", ">").replaceAll("&lt;", "<").trim(), h[1] === " " && (e.textContent = e.textContent[0] + " " + e.textContent.substring(1))), e.textContent === "undefined" && (e.textContent = ""), _ = g.getBBox();
2969
- }
2970
- return f.attr("transform", "translate(0," + (-_.height / (2 * v) + c) + ")"), _.height;
2971
- }
2972
- a(Vt, "addText");
2973
- async function Ht(e, t) {
2974
- let n = f(), { themeVariables: r } = n, { useGradient: a } = r, o = n.class.padding ?? 12, s = o, c = t.useHtmlLabels ?? d(n.htmlLabels) ?? !0, l = t;
2975
- l.annotations = l.annotations ?? [], l.members = l.members ?? [], l.methods = l.methods ?? [];
2976
- let { shapeSvg: u, bbox: p } = await Bt(e, t, n, c, s), { labelStyles: g, nodeStyles: _ } = h(t);
2977
- t.labelStyle = g, t.cssStyles = l.styles || "";
2978
- let v = l.styles?.join(";") || _ || "";
2979
- t.cssStyles ||= v.replaceAll("!important", "").split(";");
2980
- let y = l.members.length === 0 && l.methods.length === 0 && !n.class?.hideEmptyMembersBox, b = S.svg(u), x = m(t, {});
2981
- t.look !== "handDrawn" && (x.roughness = 0, x.fillStyle = "solid");
2982
- let C = Math.max(t.width ?? 0, p.width), w = Math.max(t.height ?? 0, p.height), E = (t.height ?? 0) > p.height;
2983
- l.members.length === 0 && l.methods.length === 0 ? w += s : l.members.length > 0 && l.methods.length === 0 && (w += s * 2);
2984
- let D = -C / 2, O = -w / 2, k = y ? o * 2 : l.members.length === 0 && l.methods.length === 0 ? -o : 0;
2985
- E && (k = o * 2);
2986
- let A = b.rectangle(D - o, O - o - (y ? o : l.members.length === 0 && l.methods.length === 0 ? -o / 2 : 0), C + 2 * o, w + 2 * o + k, x), j = u.insert(() => A, ":first-child");
2987
- j.attr("class", "basic label-container outer-path");
2988
- let M = j.node().getBBox(), N = u.select(".annotation-group").node().getBBox().height - (y ? o / 2 : 0) || 0, P = u.select(".label-group").node().getBBox().height - (y ? o / 2 : 0) || 0, F = u.select(".members-group").node().getBBox().height - (y ? o / 2 : 0) || 0, I = (N + P + O + o - (O - o - (y ? o : l.members.length === 0 && l.methods.length === 0 ? -o / 2 : 0))) / 2;
2989
- if (u.selectAll(".text").each((e, t, r) => {
2990
- let a = i(r[t]), d = a.attr("transform"), f = 0;
2991
- if (d) {
2992
- let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(d);
2993
- e && (f = parseFloat(e[2]));
2994
- }
2995
- let p = f + O + o - (y ? o : l.members.length === 0 && l.methods.length === 0 ? -o / 2 : 0);
2996
- if (a.attr("class").includes("methods-group")) {
2997
- let e = Math.max(F, s / 2);
2998
- p = E ? Math.max(I, N + P + e + O + s * 2 + o) + s * 2 : N + P + e + O + s * 4 + o;
2999
- }
3000
- l.members.length === 0 && l.methods.length === 0 && n.class?.hideEmptyMembersBox && (p = l.annotations.length > 0 ? f - s : f), c || (p -= 4);
3001
- let m = D;
3002
- (a.attr("class").includes("label-group") || a.attr("class").includes("annotation-group")) && (m = -a.node()?.getBBox().width / 2 || 0, u.selectAll("text").each(function(e, t, n) {
3003
- window.getComputedStyle(n[t]).textAnchor === "middle" && (m = 0);
3004
- })), a.attr("transform", `translate(${m}, ${p})`);
3005
- }), l.members.length > 0 || l.methods.length > 0 || y) {
3006
- let e = N + P + O + o, n = b.line(M.x, e, M.x + M.width, e + .001, x);
3007
- u.insert(() => n).attr("class", `divider${t.look === "neo" && !a ? " neo-line" : ""}`).attr("style", v);
3008
- }
3009
- if (y || l.members.length > 0 || l.methods.length > 0) {
3010
- let e = N + P + F + O + s * 2 + o, n = b.line(M.x, E ? Math.max(I, e) : e, M.x + M.width, (E ? Math.max(I, e) : e) + .001, x);
3011
- u.insert(() => n).attr("class", `divider${t.look === "neo" && !a ? " neo-line" : ""}`).attr("style", v);
3012
- }
3013
- if (l.look !== "handDrawn" && u.selectAll("path").attr("style", v), j.select(":nth-child(2)").attr("style", v), u.selectAll(".divider").select("path").attr("style", v), t.labelStyle ? u.selectAll("span").attr("style", t.labelStyle) : u.selectAll("span").attr("style", v), !c) {
3014
- let e = RegExp(/color\s*:\s*([^;]*)/), t = e.exec(v);
3015
- if (t) {
3016
- let e = t[0].replace("color", "fill");
3017
- u.selectAll("tspan").attr("style", e);
3018
- } else if (g) {
3019
- let t = e.exec(g);
3020
- if (t) {
3021
- let e = t[0].replace("color", "fill");
3022
- u.selectAll("tspan").attr("style", e);
3023
- }
3024
- }
3025
- }
3026
- return T(t, j), t.intersect = function(e) {
3027
- return G.rect(t, e);
3028
- }, u;
3029
- }
3030
- a(Ht, "classBox");
3031
- async function Ut(e, t) {
3032
- let { labelStyles: n, nodeStyles: r } = h(t);
3033
- t.labelStyle = n;
3034
- let a = t, o = t, s = "verifyMethod" in t, c = E(t), { themeVariables: l } = f(), { borderColorArray: u, requirementEdgeLabelBackground: d } = l, p = e.insert("g").attr("class", c).attr("id", t.domId ?? t.id), g;
3035
- g = s ? await $(p, `&lt;&lt;${a.type}&gt;&gt;`, 0, t.labelStyle) : await $(p, "&lt;&lt;Element&gt;&gt;", 0, t.labelStyle);
3036
- let _ = g, v = await $(p, a.name, _, t.labelStyle + "; font-weight: bold;");
3037
- if (_ += v + 20, s) {
3038
- let e = await $(p, `${a.requirementId ? `ID: ${a.requirementId}` : ""}`, _, t.labelStyle);
3039
- _ += e;
3040
- let n = await $(p, `${a.text ? `Text: ${a.text}` : ""}`, _, t.labelStyle);
3041
- _ += n;
3042
- let r = await $(p, `${a.risk ? `Risk: ${a.risk}` : ""}`, _, t.labelStyle);
3043
- _ += r, await $(p, `${a.verifyMethod ? `Verification: ${a.verifyMethod}` : ""}`, _, t.labelStyle);
3044
- } else {
3045
- let e = await $(p, `${o.type ? `Type: ${o.type}` : ""}`, _, t.labelStyle);
3046
- _ += e, await $(p, `${o.docRef ? `Doc Ref: ${o.docRef}` : ""}`, _, t.labelStyle);
3047
- }
3048
- let y = (p.node()?.getBBox().width ?? 200) + 20, b = (p.node()?.getBBox().height ?? 200) + 20, x = -y / 2, C = -b / 2, w = S.svg(p), D = m(t, {});
3049
- t.look !== "handDrawn" && (D.roughness = 0, D.fillStyle = "solid");
3050
- let O = w.rectangle(x, C, y, b, D), k = p.insert(() => O, ":first-child");
3051
- if (k.attr("class", "basic label-container outer-path").attr("style", r), u?.length) {
3052
- let e = t.colorIndex ?? 0;
3053
- p.attr("data-color-id", `color-${e % u.length}`);
3054
- }
3055
- if (p.selectAll(".label").each((e, t, n) => {
3056
- let r = i(n[t]), a = r.attr("transform"), o = 0, s = 0;
3057
- if (a) {
3058
- let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);
3059
- e && (o = parseFloat(e[1]), s = parseFloat(e[2]));
3060
- }
3061
- let c = s - b / 2, l = x + 10;
3062
- (t === 0 || t === 1) && (l = o), r.attr("transform", `translate(${l}, ${c + 20})`);
3063
- }), _ > g + v + 20) {
3064
- let e = C + g + v + 20, n;
3065
- if (t.look === "neo") {
3066
- let t = .001, r = [
3067
- [x, e],
3068
- [x + y, e],
3069
- [x + y, e + t],
3070
- [x, e + t]
3071
- ];
3072
- n = w.polygon(r, D);
3073
- } else n = w.line(x, e, x + y, e, D);
3074
- p.insert(() => n).attr("class", "divider");
3075
- }
3076
- return T(t, k), t.intersect = function(e) {
3077
- return G.rect(t, e);
3078
- }, r && t.look !== "handDrawn" && (d || u?.length) && p.selectAll("path").attr("style", r), p;
3079
- }
3080
- a(Ut, "requirementBox");
3081
- async function $(n, r, a, o = "") {
3082
- if (r === "") return 0;
3083
- let c = n.insert("g").attr("class", "label").attr("style", o), l = f(), u = l.htmlLabels ?? !0, d = await x(c, s(e(r)), {
3084
- width: t(r, l) + 50,
3085
- classes: "markdown-node-label",
3086
- useHtmlLabels: u,
3087
- style: o
3088
- }, l), p;
3089
- if (u) {
3090
- let e = d.children[0], t = i(d);
3091
- p = e.getBoundingClientRect(), t.attr("width", p.width), t.attr("height", p.height);
3092
- } else {
3093
- let e = d.children[0];
3094
- for (let t of e.children) o && t.setAttribute("style", o);
3095
- p = d.getBBox(), p.height += 6;
3096
- }
3097
- return c.attr("transform", `translate(${-p.width / 2},${-p.height / 2 + a})`), p.height;
3098
- }
3099
- a($, "addText");
3100
- var Wt = /* @__PURE__ */ a((e) => {
3101
- switch (e) {
3102
- case "Very High": return "red";
3103
- case "High": return "orange";
3104
- case "Medium": return null;
3105
- case "Low": return "blue";
3106
- case "Very Low": return "lightblue";
3107
- }
3108
- }, "colorFromPriority");
3109
- async function Gt(e, t, { config: n }) {
3110
- let { labelStyles: r, nodeStyles: i } = h(t);
3111
- t.labelStyle = r || "";
3112
- let a = t.width;
3113
- t.width = (t.width ?? 200) - 10;
3114
- let { shapeSvg: o, bbox: s, label: c } = await C(e, t, E(t)), l = t.padding || 10, u = "", d;
3115
- "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"));
3116
- let f = {
3117
- useHtmlLabels: t.useHtmlLabels,
3118
- labelStyle: t.labelStyle || "",
3119
- width: t.width,
3120
- img: t.img,
3121
- padding: t.padding || 8,
3122
- centerLabel: !1
3123
- }, p, g;
3124
- d ? {label: p, bbox: g} = await w(d, "ticket" in t && t.ticket || "", f) : {label: p, bbox: g} = await w(o, "ticket" in t && t.ticket || "", f);
3125
- let { label: _, bbox: v } = await w(o, "assigned" in t && t.assigned || "", f);
3126
- t.width = a;
3127
- let y = t?.width || 0, b = Math.max(g.height, v.height) / 2, x = Math.max(s.height + 20, t?.height || 0) + b, D = -y / 2, O = -x / 2;
3128
- c.attr("transform", "translate(" + (l - y / 2) + ", " + (-b - s.height / 2) + ")"), p.attr("transform", "translate(" + (l - y / 2) + ", " + (-b + s.height / 2) + ")"), _.attr("transform", "translate(" + (l + y / 2 - v.width - 20) + ", " + (-b + s.height / 2) + ")");
3129
- let k, { rx: A, ry: j } = t, { cssStyles: M } = t;
3130
- if (t.look === "handDrawn") {
3131
- let e = S.svg(o), n = m(t, {}), r = A || j ? e.path(N(D, O, y, x, A || 0), n) : e.rectangle(D, O, y, x, n);
3132
- k = o.insert(() => r, ":first-child"), k.attr("class", "basic label-container").attr("style", M || null);
3133
- } else {
3134
- k = o.insert("rect", ":first-child"), k.attr("class", "basic label-container __APA__").attr("style", i).attr("rx", A ?? 5).attr("ry", j ?? 5).attr("x", D).attr("y", O).attr("width", y).attr("height", x);
3135
- let e = "priority" in t && t.priority;
3136
- if (e) {
3137
- let t = o.append("line"), n = D + 2, r = O + Math.floor((A ?? 0) / 2), i = O + x - Math.floor((A ?? 0) / 2);
3138
- t.attr("x1", n).attr("y1", r).attr("x2", n).attr("y2", i).attr("stroke-width", "4").attr("stroke", Wt(e));
3139
- }
3140
- }
3141
- return T(t, k), t.height = x, t.intersect = function(e) {
3142
- return G.rect(t, e);
3143
- }, o;
3144
- }
3145
- a(Gt, "kanbanItem");
3146
- async function Kt(e, t) {
3147
- let { labelStyles: i, nodeStyles: a } = h(t);
3148
- t.labelStyle = i;
3149
- let { shapeSvg: o, bbox: s, halfPadding: c, label: l } = await C(e, t, E(t)), u = s.width + 10 * c, d = s.height + 8 * c, f = .15 * u, { cssStyles: p } = t, g = s.width + 20, _ = s.height + 20, v = Math.max(u, g), y = Math.max(d, _);
3150
- l.attr("transform", `translate(${-s.width / 2}, ${-s.height / 2})`);
3151
- let b, x = `M0 0
3152
- a${f},${f} 1 0,0 ${v * .25},${-1 * y * .1}
3153
- a${f},${f} 1 0,0 ${v * .25},0
3154
- a${f},${f} 1 0,0 ${v * .25},0
3155
- a${f},${f} 1 0,0 ${v * .25},${y * .1}
3156
-
3157
- a${f},${f} 1 0,0 ${v * .15},${y * .33}
3158
- a${f * .8},${f * .8} 1 0,0 0,${y * .34}
3159
- a${f},${f} 1 0,0 ${-1 * v * .15},${y * .33}
3160
-
3161
- a${f},${f} 1 0,0 ${-1 * v * .25},${y * .15}
3162
- a${f},${f} 1 0,0 ${-1 * v * .25},0
3163
- a${f},${f} 1 0,0 ${-1 * v * .25},0
3164
- a${f},${f} 1 0,0 ${-1 * v * .25},${-1 * y * .15}
3165
-
3166
- a${f},${f} 1 0,0 ${-1 * v * .1},${-1 * y * .33}
3167
- a${f * .8},${f * .8} 1 0,0 0,${-1 * y * .34}
3168
- a${f},${f} 1 0,0 ${v * .1},${-1 * y * .33}
3169
- H0 V0 Z`;
3170
- if (t.look === "handDrawn") {
3171
- let e = S.svg(o), r = m(t, {}), i = e.path(x, r);
3172
- b = o.insert(() => i, ":first-child"), b.attr("class", "basic label-container").attr("style", n(p));
3173
- } else b = o.insert("path", ":first-child").attr("class", "basic label-container").attr("style", a).attr("d", x);
3174
- return b.attr("transform", `translate(${-v / 2}, ${-y / 2})`), T(t, b), t.calcIntersect = function(e, t) {
3175
- return G.rect(e, t);
3176
- }, t.intersect = function(e) {
3177
- return r.info("Bang intersect", t, e), G.rect(t, e);
3178
- }, o;
3179
- }
3180
- a(Kt, "bang");
3181
- async function qt(e, t) {
3182
- let { labelStyles: i, nodeStyles: a } = h(t);
3183
- t.labelStyle = i;
3184
- let { shapeSvg: o, bbox: s, halfPadding: c, label: l } = await C(e, t, E(t)), u = s.width + 2 * c, d = s.height + 2 * c, f = .15 * u, p = .25 * u, g = .35 * u, _ = .2 * u, { cssStyles: v } = t, y, b = `M0 0
3185
- a${f},${f} 0 0,1 ${u * .25},${-1 * u * .1}
3186
- a${g},${g} 1 0,1 ${u * .4},${-1 * u * .1}
3187
- a${p},${p} 1 0,1 ${u * .35},${u * .2}
3188
-
3189
- a${f},${f} 1 0,1 ${u * .15},${d * .35}
3190
- a${_},${_} 1 0,1 ${-1 * u * .15},${d * .65}
3191
-
3192
- a${p},${f} 1 0,1 ${-1 * u * .25},${u * .15}
3193
- a${g},${g} 1 0,1 ${-1 * u * .5},0
3194
- a${f},${f} 1 0,1 ${-1 * u * .25},${-1 * u * .15}
3195
-
3196
- a${f},${f} 1 0,1 ${-1 * u * .1},${-1 * d * .35}
3197
- a${_},${_} 1 0,1 ${u * .1},${-1 * d * .65}
3198
- H0 V0 Z`;
3199
- if (t.look === "handDrawn") {
3200
- let e = S.svg(o), r = m(t, {}), i = e.path(b, r);
3201
- y = o.insert(() => i, ":first-child"), y.attr("class", "basic label-container").attr("style", n(v));
3202
- } else y = o.insert("path", ":first-child").attr("class", "basic label-container").attr("style", a).attr("d", b);
3203
- return l.attr("transform", `translate(${-s.width / 2}, ${-s.height / 2})`), y.attr("transform", `translate(${-u / 2}, ${-d / 2})`), T(t, y), t.calcIntersect = function(e, t) {
3204
- return G.rect(e, t);
3205
- }, t.intersect = function(e) {
3206
- return r.info("Cloud intersect", t, e), G.rect(t, e);
3207
- }, o;
3208
- }
3209
- a(qt, "cloud");
3210
- async function Jt(e, t) {
3211
- let { labelStyles: n, nodeStyles: r } = h(t);
3212
- t.labelStyle = n;
3213
- let { shapeSvg: i, bbox: a, halfPadding: o, label: s } = await C(e, t, E(t)), c = a.width + 8 * o, l = a.height + 2 * o, u = t.look === "neo" ? `
3214
- M${-c / 2} ${l / 2 - 5}
3215
- v${-l + 10}
3216
- q0,-5 5,-5
3217
- h${c - 10}
3218
- q5,0 5,5
3219
- v${l - 5}
3220
- H${-c / 2}
3221
- Z
3222
- ` : `
3223
- M${-c / 2} ${l / 2 - 5}
3224
- v${-l + 10}
3225
- q0,-5 5,-5
3226
- h${c - 10}
3227
- q5,0 5,5
3228
- v${l - 10}
3229
- q0,5 -5,5
3230
- h${-(c - 10)}
3231
- q-5,0 -5,-5
3232
- Z
3233
- `;
3234
- if (!t.domId) throw Error(`defaultMindmapNode: node "${t.id}" is missing a domId \u2014 was render.ts domId prefixing skipped?`);
3235
- let d = i.append("path").attr("id", t.domId).attr("class", "node-bkg node-" + t.type).attr("style", r).attr("d", u);
3236
- 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()), T(t, d), t.calcIntersect = function(e, t) {
3237
- return G.rect(e, t);
3238
- }, t.intersect = function(e) {
3239
- return G.rect(t, e);
3240
- }, i;
3241
- }
3242
- a(Jt, "defaultMindmapNode");
3243
- async function Yt(e, t) {
3244
- return de(e, t, { padding: t.padding ?? 0 });
3245
- }
3246
- a(Yt, "mindmapCircle");
3247
- var Xt = [
3248
- {
3249
- semanticName: "Process",
3250
- name: "Rectangle",
3251
- shortName: "rect",
3252
- description: "Standard process shape",
3253
- aliases: [
3254
- "proc",
3255
- "process",
3256
- "rectangle"
3257
- ],
3258
- internalAliases: ["squareRect"],
3259
- handler: ut
3260
- },
3261
- {
3262
- semanticName: "Event",
3263
- name: "Rounded Rectangle",
3264
- shortName: "rounded",
3265
- description: "Represents an event",
3266
- aliases: ["event"],
3267
- internalAliases: ["roundedRect"],
3268
- handler: st
3269
- },
3270
- {
3271
- semanticName: "Terminal Point",
3272
- name: "Stadium",
3273
- shortName: "stadium",
3274
- description: "Terminal point",
3275
- aliases: ["terminal", "pill"],
3276
- handler: dt
3277
- },
3278
- {
3279
- semanticName: "Subprocess",
3280
- name: "Framed Rectangle",
3281
- shortName: "fr-rect",
3282
- description: "Subprocess",
3283
- aliases: [
3284
- "subprocess",
3285
- "subproc",
3286
- "framed-rectangle",
3287
- "subroutine"
3288
- ],
3289
- handler: gt
3290
- },
3291
- {
3292
- semanticName: "Database",
3293
- name: "Cylinder",
3294
- shortName: "cyl",
3295
- description: "Database storage",
3296
- aliases: [
3297
- "db",
3298
- "database",
3299
- "cylinder"
3300
- ],
3301
- handler: Ce
3302
- },
3303
- {
3304
- semanticName: "Data Store",
3305
- name: "Data Store",
3306
- shortName: "datastore",
3307
- description: "Data flow diagram data store",
3308
- aliases: ["data-store"],
3309
- handler: Te
3310
- },
3311
- {
3312
- semanticName: "Start",
3313
- name: "Circle",
3314
- shortName: "circle",
3315
- description: "Starting point",
3316
- aliases: ["circ"],
3317
- handler: de
3318
- },
3319
- {
3320
- semanticName: "Bang",
3321
- name: "Bang",
3322
- shortName: "bang",
3323
- description: "Bang",
3324
- aliases: ["bang"],
3325
- handler: Kt
3326
- },
3327
- {
3328
- semanticName: "Cloud",
3329
- name: "Cloud",
3330
- shortName: "cloud",
3331
- description: "cloud",
3332
- aliases: ["cloud"],
3333
- handler: qt
3334
- },
3335
- {
3336
- semanticName: "Decision",
3337
- name: "Diamond",
3338
- shortName: "diam",
3339
- description: "Decision-making step",
3340
- aliases: [
3341
- "decision",
3342
- "diamond",
3343
- "question"
3344
- ],
3345
- handler: it
3346
- },
3347
- {
3348
- semanticName: "Prepare Conditional",
3349
- name: "Hexagon",
3350
- shortName: "hex",
3351
- description: "Preparation or condition step",
3352
- aliases: ["hexagon", "prepare"],
3353
- handler: Fe
3354
- },
3355
- {
3356
- semanticName: "Data Input/Output",
3357
- name: "Lean Right",
3358
- shortName: "lean-r",
3359
- description: "Represents input or output",
3360
- aliases: ["lean-right", "in-out"],
3361
- internalAliases: ["lean_right"],
3362
- handler: Ge
3363
- },
3364
- {
3365
- semanticName: "Data Input/Output",
3366
- name: "Lean Left",
3367
- shortName: "lean-l",
3368
- description: "Represents output or input",
3369
- aliases: ["lean-left", "out-in"],
3370
- internalAliases: ["lean_left"],
3371
- handler: We
3372
- },
3373
- {
3374
- semanticName: "Priority Action",
3375
- name: "Trapezoid Base Bottom",
3376
- shortName: "trap-b",
3377
- description: "Priority action",
3378
- aliases: [
3379
- "priority",
3380
- "trapezoid-bottom",
3381
- "trapezoid"
3382
- ],
3383
- handler: Dt
3384
- },
3385
- {
3386
- semanticName: "Manual Operation",
3387
- name: "Trapezoid Base Top",
3388
- shortName: "trap-t",
3389
- description: "Represents a manual task",
3390
- aliases: [
3391
- "manual",
3392
- "trapezoid-top",
3393
- "inv-trapezoid"
3394
- ],
3395
- internalAliases: ["inv_trapezoid"],
3396
- handler: He
3397
- },
3398
- {
3399
- semanticName: "Stop",
3400
- name: "Double Circle",
3401
- shortName: "dbl-circ",
3402
- description: "Represents a stop point",
3403
- aliases: ["double-circle"],
3404
- internalAliases: ["doublecircle"],
3405
- handler: De
3406
- },
3407
- {
3408
- semanticName: "Text Block",
3409
- name: "Text Block",
3410
- shortName: "text",
3411
- description: "Text block",
3412
- handler: bt
3413
- },
3414
- {
3415
- semanticName: "Card",
3416
- name: "Notched Rectangle",
3417
- shortName: "notch-rect",
3418
- description: "Represents a card",
3419
- aliases: ["card", "notched-rectangle"],
3420
- handler: le
3421
- },
3422
- {
3423
- semanticName: "Lined/Shaded Process",
3424
- name: "Lined Rectangle",
3425
- shortName: "lin-rect",
3426
- description: "Lined process shape",
3427
- aliases: [
3428
- "lined-rectangle",
3429
- "lined-process",
3430
- "lin-proc",
3431
- "shaded-process"
3432
- ],
3433
- handler: ct
3434
- },
3435
- {
3436
- semanticName: "Start",
3437
- name: "Small Circle",
3438
- shortName: "sm-circ",
3439
- description: "Small starting point",
3440
- aliases: ["start", "small-circle"],
3441
- internalAliases: ["stateStart"],
3442
- handler: mt
3443
- },
3444
- {
3445
- semanticName: "Stop",
3446
- name: "Framed Circle",
3447
- shortName: "fr-circ",
3448
- description: "Stop point",
3449
- aliases: ["stop", "framed-circle"],
3450
- internalAliases: ["stateEnd"],
3451
- handler: pt
3452
- },
3453
- {
3454
- semanticName: "Fork/Join",
3455
- name: "Filled Rectangle",
3456
- shortName: "fork",
3457
- description: "Fork or join in process flow",
3458
- aliases: ["join"],
3459
- internalAliases: ["forkJoin"],
3460
- handler: Me
3461
- },
3462
- {
3463
- semanticName: "Collate",
3464
- name: "Hourglass",
3465
- shortName: "hourglass",
3466
- description: "Represents a collate operation",
3467
- aliases: ["hourglass", "collate"],
3468
- handler: Ie
3469
- },
3470
- {
3471
- semanticName: "Comment",
3472
- name: "Curly Brace",
3473
- shortName: "brace",
3474
- description: "Adds a comment",
3475
- aliases: ["comment", "brace-l"],
3476
- handler: me
3477
- },
3478
- {
3479
- semanticName: "Comment Right",
3480
- name: "Curly Brace",
3481
- shortName: "brace-r",
3482
- description: "Adds a comment",
3483
- handler: he
3484
- },
3485
- {
3486
- semanticName: "Comment with braces on both sides",
3487
- name: "Curly Braces",
3488
- shortName: "braces",
3489
- description: "Adds a comment",
3490
- handler: ge
3491
- },
3492
- {
3493
- semanticName: "Com Link",
3494
- name: "Lightning Bolt",
3495
- shortName: "bolt",
3496
- description: "Communication link",
3497
- aliases: ["com-link", "lightning-bolt"],
3498
- handler: Ke
3499
- },
3500
- {
3501
- semanticName: "Document",
3502
- name: "Document",
3503
- shortName: "doc",
3504
- description: "Represents a document",
3505
- aliases: ["doc", "document"],
3506
- handler: Mt
3507
- },
3508
- {
3509
- semanticName: "Delay",
3510
- name: "Half-Rounded Rectangle",
3511
- shortName: "delay",
3512
- description: "Represents a delay",
3513
- aliases: ["half-rounded-rectangle"],
3514
- handler: Ne
3515
- },
3516
- {
3517
- semanticName: "Direct Access Storage",
3518
- name: "Horizontal Cylinder",
3519
- shortName: "h-cyl",
3520
- description: "Direct access storage",
3521
- aliases: ["das", "horizontal-cylinder"],
3522
- handler: Et
3523
- },
3524
- {
3525
- semanticName: "Disk Storage",
3526
- name: "Lined Cylinder",
3527
- shortName: "lin-cyl",
3528
- description: "Disk storage",
3529
- aliases: ["disk", "lined-cylinder"],
3530
- handler: Qe
3531
- },
3532
- {
3533
- semanticName: "Display",
3534
- name: "Curved Trapezoid",
3535
- shortName: "curv-trap",
3536
- description: "Represents a display",
3537
- aliases: ["curved-trapezoid", "display"],
3538
- handler: _e
3539
- },
3540
- {
3541
- semanticName: "Divided Process",
3542
- name: "Divided Rectangle",
3543
- shortName: "div-rect",
3544
- description: "Divided process shape",
3545
- aliases: [
3546
- "div-proc",
3547
- "divided-rectangle",
3548
- "divided-process"
3549
- ],
3550
- handler: Ee
3551
- },
3552
- {
3553
- semanticName: "Extract",
3554
- name: "Triangle",
3555
- shortName: "tri",
3556
- description: "Extraction process",
3557
- aliases: ["extract", "triangle"],
3558
- handler: jt
3559
- },
3560
- {
3561
- semanticName: "Internal Storage",
3562
- name: "Window Pane",
3563
- shortName: "win-pane",
3564
- description: "Internal storage",
3565
- aliases: ["internal-storage", "window-pane"],
3566
- handler: Pt
3567
- },
3568
- {
3569
- semanticName: "Junction",
3570
- name: "Filled Circle",
3571
- shortName: "f-circ",
3572
- description: "Junction point",
3573
- aliases: ["junction", "filled-circle"],
3574
- handler: Oe
3575
- },
3576
- {
3577
- semanticName: "Loop Limit",
3578
- name: "Trapezoidal Pentagon",
3579
- shortName: "notch-pent",
3580
- description: "Loop limit step",
3581
- aliases: ["loop-limit", "notched-pentagon"],
3582
- handler: Ot
3583
- },
3584
- {
3585
- semanticName: "Manual File",
3586
- name: "Flipped Triangle",
3587
- shortName: "flip-tri",
3588
- description: "Manual file operation",
3589
- aliases: ["manual-file", "flipped-triangle"],
3590
- handler: je
3591
- },
3592
- {
3593
- semanticName: "Manual Input",
3594
- name: "Sloped Rectangle",
3595
- shortName: "sl-rect",
3596
- description: "Manual input step",
3597
- aliases: ["manual-input", "sloped-rectangle"],
3598
- handler: lt
3599
- },
3600
- {
3601
- semanticName: "Multi-Document",
3602
- name: "Stacked Document",
3603
- shortName: "docs",
3604
- description: "Multiple documents",
3605
- aliases: [
3606
- "documents",
3607
- "st-doc",
3608
- "stacked-document"
3609
- ],
3610
- handler: tt
3611
- },
3612
- {
3613
- semanticName: "Multi-Process",
3614
- name: "Stacked Rectangle",
3615
- shortName: "st-rect",
3616
- description: "Multiple processes",
3617
- aliases: [
3618
- "procs",
3619
- "processes",
3620
- "stacked-rectangle"
3621
- ],
3622
- handler: et
3623
- },
3624
- {
3625
- semanticName: "Stored Data",
3626
- name: "Bow Tie Rectangle",
3627
- shortName: "bow-rect",
3628
- description: "Stored data",
3629
- aliases: ["stored-data", "bow-tie-rectangle"],
3630
- handler: se
3631
- },
3632
- {
3633
- semanticName: "Summary",
3634
- name: "Crossed Circle",
3635
- shortName: "cross-circ",
3636
- description: "Summary",
3637
- aliases: ["summary", "crossed-circle"],
3638
- handler: pe
3639
- },
3640
- {
3641
- semanticName: "Tagged Document",
3642
- name: "Tagged Document",
3643
- shortName: "tag-doc",
3644
- description: "Tagged document",
3645
- aliases: ["tag-doc", "tagged-document"],
3646
- handler: yt
3647
- },
3648
- {
3649
- semanticName: "Tagged Process",
3650
- name: "Tagged Rectangle",
3651
- shortName: "tag-rect",
3652
- description: "Tagged process",
3653
- aliases: [
3654
- "tagged-rectangle",
3655
- "tag-proc",
3656
- "tagged-process"
3657
- ],
3658
- handler: vt
3659
- },
3660
- {
3661
- semanticName: "Paper Tape",
3662
- name: "Flag",
3663
- shortName: "flag",
3664
- description: "Paper tape",
3665
- aliases: ["paper-tape"],
3666
- handler: Nt
3667
- },
3668
- {
3669
- semanticName: "Odd",
3670
- name: "Odd",
3671
- shortName: "odd",
3672
- description: "Odd shape",
3673
- internalAliases: ["rect_left_inv_arrow"],
3674
- handler: at
3675
- },
3676
- {
3677
- semanticName: "Lined Document",
3678
- name: "Lined Document",
3679
- shortName: "lin-doc",
3680
- description: "Lined document",
3681
- aliases: ["lined-document"],
3682
- handler: $e
3683
- }
3684
- ], Zt = (/* @__PURE__ */ a(() => {
3685
- let e = [...Object.entries({
3686
- state: ft,
3687
- choice: ue,
3688
- note: nt,
3689
- rectWithTitle: ot,
3690
- labelRect: Ue,
3691
- iconSquare: Be,
3692
- iconCircle: Re,
3693
- icon: Le,
3694
- iconRounded: ze,
3695
- imageSquare: Ve,
3696
- anchor: K,
3697
- kanbanItem: Gt,
3698
- mindmapCircle: Yt,
3699
- defaultMindmapNode: Jt,
3700
- classBox: Ht,
3701
- erBox: Lt,
3702
- requirementBox: Ut
3703
- }), ...Xt.flatMap((e) => [
3704
- e.shortName,
3705
- ..."aliases" in e ? e.aliases : [],
3706
- ..."internalAliases" in e ? e.internalAliases : []
3707
- ].map((t) => [t, e.handler]))];
3708
- return Object.fromEntries(e);
3709
- }, "generateShapeMap"))();
3710
- function Qt(e) {
3711
- return e in Zt;
3712
- }
3713
- a(Qt, "isValidShape");
3714
- var $t = /* @__PURE__ */ new Map();
3715
- async function en(e, t, r) {
3716
- let i, a;
3717
- t.shape === "rect" && (t.shape = t.rx && t.ry ? "roundedRect" : "squareRect");
3718
- let o = t.shape ? Zt[t.shape] : void 0;
3719
- if (!o) throw Error(`No such shape: ${t.shape}. Please check your syntax.`);
3720
- if (t.link) {
3721
- let n;
3722
- r.config.securityLevel === "sandbox" ? n = "_top" : t.linkTarget && (n = t.linkTarget || "_blank"), i = e.insert("svg:a").attr("xlink:href", t.link).attr("target", n ?? null), a = await o(i, t, r);
3723
- } else a = await o(e, t, r), i = a;
3724
- return i.attr("data-look", n(t.look)), t.tooltip && a.attr("title", t.tooltip), $t.set(t.id, i), t.haveCallback && i.attr("class", i.attr("class") + " clickable"), i;
3725
- }
3726
- a(en, "insertNode");
3727
- var tn = /* @__PURE__ */ a((e, t) => {
3728
- $t.set(t.id, e);
3729
- }, "setNodeElem"), nn = /* @__PURE__ */ a(() => {
3730
- $t.clear();
3731
- }, "clear"), rn = /* @__PURE__ */ a((e) => {
3732
- let t = $t.get(e.id);
3733
- r.trace("Transforming node", e.diff, e, "translate(" + (e.x - e.width / 2 - 5) + ", " + e.width / 2 + ")");
3734
- let n = e.diff || 0;
3735
- return e.clusterNode ? t.attr("transform", "translate(" + (e.x + n - e.width / 2) + ", " + (e.y - e.height / 2 - 8) + ")") : t.attr("transform", "translate(" + e.x + ", " + e.y + ")"), n;
3736
- }, "positionNode");
3737
- //#endregion
3738
- export { en as a, rn as c, ee as i, tn as l, nn as n, Qt as o, M as r, C as s, R as t, T as u };