@fudanda/admin-antd 0.0.0-stage → 2.20261024.1-beta.1

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 (482) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +58 -3
  3. package/THIRD_PARTY_NOTICES.md +55 -0
  4. package/dist/assets/libarchive-DxGirPmi.wasm +0 -0
  5. package/dist/assets/pdfium-BJ2Yip8Q.wasm +0 -0
  6. package/dist/assets/ppt-font-cjk-DxgKpThH.otf +0 -0
  7. package/dist/assets/ppt-native-Cz5DBbag.wasm +0 -0
  8. package/dist/assets/pptx.worker-CtaL8LO_.js +30 -0
  9. package/dist/assets/worker-C5LZNsKY.mjs +1650 -0
  10. package/dist/assets/worker-CDeo9jS-.js +40 -0
  11. package/dist/assets/worker-bundle-Dx5mKZOL.js +6 -0
  12. package/dist/automation.d.ts +3 -0
  13. package/dist/automation.js +15 -0
  14. package/dist/chunks/App-DNjXLysb.js +79 -0
  15. package/dist/chunks/AppModal-DJzQA6FR.js +1 -0
  16. package/dist/chunks/ArcBaseAdmin-BZrHGq2f.js +1 -0
  17. package/dist/chunks/ConfigurableTable-DzmZDd8F.js +55 -0
  18. package/dist/chunks/DashboardPage-BohGodSl.js +22 -0
  19. package/dist/chunks/DataScopePanel-B2-x8Jcz.js +1 -0
  20. package/dist/chunks/DateTimeText-CIt0Qy45.js +1 -0
  21. package/dist/chunks/DepartmentsPage-DMWY__Y_.js +1 -0
  22. package/dist/chunks/DictTag-2-adKbYg.js +1 -0
  23. package/dist/chunks/DictsPage-DILDyHi-.js +15 -0
  24. package/dist/chunks/EditFormModal-DNHOZHxM.js +1 -0
  25. package/dist/chunks/EmptyIllustration-DUC3RZmF.js +1 -0
  26. package/dist/chunks/EntityContextRuntime-DMklAv-k.js +1 -0
  27. package/dist/chunks/EntityContextRuntime-sslBZqYD.js +1 -0
  28. package/dist/chunks/EntityRelationButton-DWn1rC2J.js +8 -0
  29. package/dist/chunks/ExportButton-AzH4D0oW.js +1 -0
  30. package/dist/chunks/FileNameCell-DPyi64Rv.js +1 -0
  31. package/dist/chunks/FileStorageConfigsPage-CzuOgeK0.js +15 -0
  32. package/dist/chunks/FileTypeIcon-DIih3XQG.js +1 -0
  33. package/dist/chunks/FileViewerPreviewPanel-CMqVtGCr.js +41 -0
  34. package/dist/chunks/FilesPage-BaEBCOCs.js +43 -0
  35. package/dist/chunks/IdentitySecurityPage-BO7nY8id.js +1 -0
  36. package/dist/chunks/JsonPreviewPanel-Dhbza-Uu.js +1 -0
  37. package/dist/chunks/LogStatsScaffold-CLycj3da.js +1 -0
  38. package/dist/chunks/LoginLogsPage-DTmHi8u0.js +1 -0
  39. package/dist/chunks/LoginLogsTable-DVmHnC6V.js +1 -0
  40. package/dist/chunks/MarkdownPreviewPanel-DoiaAeRv.js +51 -0
  41. package/dist/chunks/MasterDetailLayout-sjPWw8BI.js +8 -0
  42. package/dist/chunks/MemberAssignmentSheet-Czbt6_zv.js +1 -0
  43. package/dist/chunks/MenuCommandPalette-BCOzf-Kq.js +8 -0
  44. package/dist/chunks/MenusPage-DN8DTGB1.js +1 -0
  45. package/dist/chunks/ModalFooter-RMlvqrO9.js +1 -0
  46. package/dist/chunks/MonacoPreviewPanel-Dnz7xpWP.js +1 -0
  47. package/dist/chunks/NavListPanel-vjIOIqK0.js +1 -0
  48. package/dist/chunks/OnlineSessionsPage-FoHYZKlR.js +1 -0
  49. package/dist/chunks/OperationLogsPage-BeRnGcBJ.js +1 -0
  50. package/dist/chunks/OperationLogsTable-COI-Lp-y.js +1 -0
  51. package/dist/chunks/PDFPreviewPanel-BIQuBnZZ.js +37 -0
  52. package/dist/chunks/PasswordInput-DGEJO9yx.js +1 -0
  53. package/dist/chunks/PositionsPage-DohI0luX.js +1 -0
  54. package/dist/chunks/PreferencesSheetBody-B9niQABW.js +43 -0
  55. package/dist/chunks/ProfilePage-CVTRv7xb.js +15 -0
  56. package/dist/chunks/RelationPanel-B1X6AVaM.js +36 -0
  57. package/dist/chunks/ResponsiveTableActions-y54aSdhs.js +1 -0
  58. package/dist/chunks/RolesPage-CtUw93L8.js +1 -0
  59. package/dist/chunks/ScrollArea-DqjJmHDN.js +11 -0
  60. package/dist/chunks/SearchToolbar-CvgYKUjr.js +1 -0
  61. package/dist/chunks/SessionClientTag-DIwnYodW.js +22 -0
  62. package/dist/chunks/SessionConflictModal-BLNuDsN_.js +1 -0
  63. package/dist/chunks/SettingRow-DVNmTJWC.js +1 -0
  64. package/dist/chunks/SettingsPage-BRnCxYQm.js +26 -0
  65. package/dist/chunks/StatCard-Czjfs0fa.js +4 -0
  66. package/dist/chunks/UTIF-QUtClmQd.js +1 -0
  67. package/dist/chunks/UserAvatar-B8CFnTCn.js +1 -0
  68. package/dist/chunks/UserDisplay-J0Re8z-7.js +1 -0
  69. package/dist/chunks/UserGroupsPage-CNwbejx-.js +1 -0
  70. package/dist/chunks/UserLogsPanels-BHeSxWrk.js +36 -0
  71. package/dist/chunks/UserTransferSelect-CAeyxdor.js +22 -0
  72. package/dist/chunks/UsersPage-BXt9fOru.js +36 -0
  73. package/dist/chunks/abnfDiagram-VCTEODGH-Z6OhNjoW.js +1 -0
  74. package/dist/chunks/activity-DBu4axwF.js +8 -0
  75. package/dist/chunks/arc-B3K1fDeF.js +1 -0
  76. package/dist/chunks/architecture-7GRP2DOG-CMtoOwin.js +1 -0
  77. package/dist/chunks/architectureDiagram-5GKGNRK7-V5A7S5fY.js +36 -0
  78. package/dist/chunks/archive-B_IKvysI.js +72 -0
  79. package/dist/chunks/array-BrHhzP_A.js +1 -0
  80. package/dist/chunks/arrow-left-CsxBMzKY.js +8 -0
  81. package/dist/chunks/avsc-C0VoJRmm.js +160 -0
  82. package/dist/chunks/blockDiagram-I7D4REHJ-CFKGJkc_.js +129 -0
  83. package/dist/chunks/browser-BKLM0ThC-mnGPrtB_.js +1 -0
  84. package/dist/chunks/browser-index-JqxD-45S.js +1 -0
  85. package/dist/chunks/builtin_esm-external-require-react-BsBndGeN.js +1 -0
  86. package/dist/chunks/bundle-DbfUnEV1.js +29 -0
  87. package/dist/chunks/c4Diagram-7LVT6UL2-BqYYoXPe.js +38 -0
  88. package/dist/chunks/channel-C9Dr7Z-W.js +1 -0
  89. package/dist/chunks/chart-data-DImT_Mzn.js +5 -0
  90. package/dist/chunks/chart-renderer-k-Rd8vdL.js +7 -0
  91. package/dist/chunks/chevron-down-mn2tSKQd.js +8 -0
  92. package/dist/chunks/chevron-right-EBApfX6q.js +15 -0
  93. package/dist/chunks/chevrons-up-down-2M6hY6wt.js +15 -0
  94. package/dist/chunks/chunk-2E4U76K2-DNbbdpCx.js +1 -0
  95. package/dist/chunks/chunk-2Q5K7J3B-CmAE3Vs0.js +1 -0
  96. package/dist/chunks/chunk-2ZTRR5NV-BjsSRgBv.js +2 -0
  97. package/dist/chunks/chunk-3Z5EZCMW-uYiqz-6y.js +1 -0
  98. package/dist/chunks/chunk-4HAMMTFA-Aw59LwS3.js +62 -0
  99. package/dist/chunks/chunk-5V3GS4D5-B_CVcJic.js +1 -0
  100. package/dist/chunks/chunk-5VM5RSS4-DMlsEAcl.js +15 -0
  101. package/dist/chunks/chunk-6AZGARVD-CgAiC5mV.js +1 -0
  102. package/dist/chunks/chunk-6EIED4P4-CXz5D9B0.js +1 -0
  103. package/dist/chunks/chunk-6K3QC6MW-DtaQ52mY.js +1 -0
  104. package/dist/chunks/chunk-6TQVIW2G-D0YDxefI.js +1 -0
  105. package/dist/chunks/chunk-747NJXEK-DGoElbDa.js +2 -0
  106. package/dist/chunks/chunk-75Z2AOVW-IO9R6faP.js +2 -0
  107. package/dist/chunks/chunk-CLGD4ZFX-tRS89bnq.js +1 -0
  108. package/dist/chunks/chunk-DU6HZSFF-Bx48E1rg.js +125 -0
  109. package/dist/chunks/chunk-F27PBJKO-DtLva7y0.js +1 -0
  110. package/dist/chunks/chunk-FOHPRMQF-B8MMrnxV.js +255 -0
  111. package/dist/chunks/chunk-GMAD6QVW-D41KnniX.js +72 -0
  112. package/dist/chunks/chunk-GVQU2GXP-CVzgM_ui.js +1 -0
  113. package/dist/chunks/chunk-I5DQTOEV-CoecQT42.js +1 -0
  114. package/dist/chunks/chunk-ICYGCRZG-lH3opfCY.js +1 -0
  115. package/dist/chunks/chunk-IH6LHLGP-tD-j3Rsy.js +1 -0
  116. package/dist/chunks/chunk-IMKFNOWR-CL9pLQhV.js +231 -0
  117. package/dist/chunks/chunk-JWPE2WC7-Wk0BVLn5.js +1 -0
  118. package/dist/chunks/chunk-KI3K4JFJ-C-3Y_9er.js +1 -0
  119. package/dist/chunks/chunk-L3NEJ4N5-CmvrS7Dt.js +1 -0
  120. package/dist/chunks/chunk-LNGE3PJU-BP1fsJRz.js +34 -0
  121. package/dist/chunks/chunk-OSK3NFVY-C9uWOXTC.js +10 -0
  122. package/dist/chunks/chunk-OUJLGHUK-Cm55l9bx.js +2 -0
  123. package/dist/chunks/chunk-P2QGCYS3-C9bc1yiM.js +1 -0
  124. package/dist/chunks/chunk-POPQ4Y6H-P1s5xaxM.js +1 -0
  125. package/dist/chunks/chunk-PWAF6VOD-IORmPx9D.js +1 -0
  126. package/dist/chunks/chunk-SHT3W25Y-Bip4melZ.js +168 -0
  127. package/dist/chunks/chunk-SVP7TREG-BKCgUOuy.js +88 -0
  128. package/dist/chunks/chunk-TICWLB2K-12W2EmSx.js +206 -0
  129. package/dist/chunks/chunk-TLUHSLCS-DsqF476v.js +1 -0
  130. package/dist/chunks/chunk-UY3FDG6J-71d_M6t3.js +1 -0
  131. package/dist/chunks/chunk-XHIXRSVI-C2X1-xC6.js +1 -0
  132. package/dist/chunks/chunk-XXDRQBXY-Bl6AoSZF.js +1 -0
  133. package/dist/chunks/chunk-Y2CYZVJY-DjEHBC-3.js +1 -0
  134. package/dist/chunks/circle-check-RKAno__V.js +8 -0
  135. package/dist/chunks/circle-x-BB5x-D-8.js +8 -0
  136. package/dist/chunks/classDiagram-ZZMXUADV-CZrpYcfK.js +1 -0
  137. package/dist/chunks/classDiagram-v2-VYDZK3BY-CZrpYcfK.js +1 -0
  138. package/dist/chunks/clipboard-ERcMSMRH.js +1 -0
  139. package/dist/chunks/clock-CniP1gZS.js +8 -0
  140. package/dist/chunks/confirm-BtBBEqk8.js +1 -0
  141. package/dist/chunks/controls-C5dPckUT.js +1 -0
  142. package/dist/chunks/copy-ofLPH1I0.js +8 -0
  143. package/dist/chunks/cose-bilkent-JH36ORCC-D9OUqkk5.js +1 -0
  144. package/dist/chunks/createLucideIcon-BtwfYE6A.js +83 -0
  145. package/dist/chunks/cynefin-OW5HDTMX-B8_kUynj.js +1 -0
  146. package/dist/chunks/cynefinDiagram-5FMLGOSQ-DhQChnCg.js +62 -0
  147. package/dist/chunks/cytoscape.esm-wDUnleWx.js +339 -0
  148. package/dist/chunks/dagre-GXQ25YYZ-CfbwC_a5.js +4 -0
  149. package/dist/chunks/dagre-ZVAWSfFw.js +1 -0
  150. package/dist/chunks/data-B05HzECj.js +28 -0
  151. package/dist/chunks/date-picker-CPUxgHVv.js +1 -0
  152. package/dist/chunks/defaultLocale-BvxIcb9Y.js +1 -0
  153. package/dist/chunks/deleteAction-CCocr5uV.js +1 -0
  154. package/dist/chunks/diagram-D9cwc7QH.js +5 -0
  155. package/dist/chunks/diagram-S7CK7UJ4-DVPbdtMm.js +30 -0
  156. package/dist/chunks/diagram-UQ7AKVKN-D_ZBhGLL.js +41 -0
  157. package/dist/chunks/diagram-VSXAHHWV-Dqypp-OX.js +3 -0
  158. package/dist/chunks/diagram-VX7I27RA-CbWJVJ_L.js +24 -0
  159. package/dist/chunks/diagram-Z3DM3KII-CUyP4-RY.js +24 -0
  160. package/dist/chunks/direct-engine-thps0u7R.js +5 -0
  161. package/dist/chunks/dist-Bauqz5on.js +1 -0
  162. package/dist/chunks/dist-CWj_XYki.js +1 -0
  163. package/dist/chunks/dist-D_KGQS7-.js +11 -0
  164. package/dist/chunks/dist-DdW4yNBK.js +1 -0
  165. package/dist/chunks/docx-preview-CPN81HCr.js +11 -0
  166. package/dist/chunks/download--5IybXxz.js +8 -0
  167. package/dist/chunks/drawing-D2Qrun-P.js +48 -0
  168. package/dist/chunks/ebnfDiagram-PWID7BFC-C5NMigjm.js +1 -0
  169. package/dist/chunks/ellipsis-Dux1Nxa5.js +8 -0
  170. package/dist/chunks/email-ByshRsFv.js +61 -0
  171. package/dist/chunks/emailHtml-BAKcRhSm.js +1 -0
  172. package/dist/chunks/erDiagram-RLTQ6QDP-B5rUHJPJ.js +99 -0
  173. package/dist/chunks/eventmodeling-NTZA5JFV-C74no5BH.js +1 -0
  174. package/dist/chunks/export-BkwewH6Q.js +1 -0
  175. package/dist/chunks/export-DlTz5dc2.js +341 -0
  176. package/dist/chunks/eye-off-BtJoIT5n.js +8 -0
  177. package/dist/chunks/feedback-BnjMKZpz.js +1 -0
  178. package/dist/chunks/file-utils-DyvnVEoH.js +1 -0
  179. package/dist/chunks/fit-CsnhEncA.js +1 -0
  180. package/dist/chunks/flowDiagram-HODETNUW-BuMvaSeo.js +1 -0
  181. package/dist/chunks/form-CQutQFiD.js +1 -0
  182. package/dist/chunks/funnel-BwQjQI4Y.js +8 -0
  183. package/dist/chunks/ganttDiagram-EL5Y4UJY-DIAlbvVg.js +292 -0
  184. package/dist/chunks/geo-DR0fL7r2.js +38 -0
  185. package/dist/chunks/gitGraph-4MIJSDKK-Ce5mOfp1.js +1 -0
  186. package/dist/chunks/gitGraphDiagram-WWUBYQGX-DN3G9xiQ.js +106 -0
  187. package/dist/chunks/graphlib-CYBMTUbW.js +1 -0
  188. package/dist/chunks/icons-CbRx5Om7.js +1 -0
  189. package/dist/chunks/illustrations-DT1eq6jI.js +1 -0
  190. package/dist/chunks/image-ez9hvzKT.js +17 -0
  191. package/dist/chunks/index.es-OAWlVkoK.js +16 -0
  192. package/dist/chunks/info-A6RAGUB7-BP6lMBIR.js +1 -0
  193. package/dist/chunks/info-BQa8C31Y.js +8 -0
  194. package/dist/chunks/infoDiagram-27XIBGKW-BhQtr_Ti.js +2 -0
  195. package/dist/chunks/init-Ca_Ibf4y.js +1 -0
  196. package/dist/chunks/ishikawaDiagram-5VMMS53U-CLR6CAi4.js +70 -0
  197. package/dist/chunks/journeyDiagram-3NMN7TZE-_-Q7sjsP.js +139 -0
  198. package/dist/chunks/json-viewer-DHYRjY8I.js +1 -0
  199. package/dist/chunks/jszip.min-hNOoGCeG.js +14 -0
  200. package/dist/chunks/kanban-definition-UXKFOSKX-D97mHeUZ.js +89 -0
  201. package/dist/chunks/katex-D5qu7EYh.js +257 -0
  202. package/dist/chunks/layout-grid-Bp9bwiQZ.js +8 -0
  203. package/dist/chunks/lib-BlRm3nk1.js +15 -0
  204. package/dist/chunks/lib-C1nFUu19.js +4 -0
  205. package/dist/chunks/lib-CqYXBtHb.js +1 -0
  206. package/dist/chunks/libarchive-DRzzJvQl.js +7 -0
  207. package/dist/chunks/line-BV7qVRkM.js +1 -0
  208. package/dist/chunks/line-qVHaOdPp.js +1 -0
  209. package/dist/chunks/linear-DXABSWHW.js +1 -0
  210. package/dist/chunks/list-0CbyOlT9.js +1 -0
  211. package/dist/chunks/list-DCcWnjUg.js +8 -0
  212. package/dist/chunks/listTableProps-DDynsnLF.js +1 -0
  213. package/dist/chunks/log-in-OzbNes8i.js +8 -0
  214. package/dist/chunks/lucide-react-VfAPsQQ5.js +8 -0
  215. package/dist/chunks/maplibre-gl-Bxi83GUP.js +819 -0
  216. package/dist/chunks/maplibre-shared-Oo0L8Lll.js +6 -0
  217. package/dist/chunks/maximize-CnmQ11E7.js +8 -0
  218. package/dist/chunks/media-DoGe_p4O.js +1 -0
  219. package/dist/chunks/menu-mQgsexFx.js +15 -0
  220. package/dist/chunks/mermaid-parser.core-DvCAQkzY.js +3 -0
  221. package/dist/chunks/mermaid.core-CxOC6yPr.js +15 -0
  222. package/dist/chunks/messages-CFyOVxEM.js +1 -0
  223. package/dist/chunks/mindmap-definition-YA3MSWOX-A2UgnMwx.js +96 -0
  224. package/dist/chunks/minimize-Bpau_zCe.js +8 -0
  225. package/dist/chunks/msg-BzZbudMm.js +7 -0
  226. package/dist/chunks/ofd-C7DKqJ6Z.js +33 -0
  227. package/dist/chunks/ofd-DrJyXIpS.js +14 -0
  228. package/dist/chunks/openDocument-DGzqlyJg.js +12 -0
  229. package/dist/chunks/options-B65xkxOY.js +1 -0
  230. package/dist/chunks/ordinal-NuFkISw7.js +1 -0
  231. package/dist/chunks/packet-AYTQ26CC-DS6h3a5l.js +1 -0
  232. package/dist/chunks/panzoom.es-DnuzxUQi.js +1 -0
  233. package/dist/chunks/parse-6ZQGx714.js +1 -0
  234. package/dist/chunks/parser-DC3PvpL4.js +72 -0
  235. package/dist/chunks/path-VUNELGFR.js +1 -0
  236. package/dist/chunks/pegDiagram-XKGWAZYB-DxQqpKfh.js +1 -0
  237. package/dist/chunks/pie-WAS4IAKB-BsaegmNA.js +1 -0
  238. package/dist/chunks/pieDiagram-E7YTZNPT-BUsnkTkJ.js +39 -0
  239. package/dist/chunks/postal-mime-DMcA5b7k.js +28 -0
  240. package/dist/chunks/ppt-B0WY5Gks.js +30 -0
  241. package/dist/chunks/ppt-BIiNnCyj.js +1 -0
  242. package/dist/chunks/pptx-DX5KDFZ7.js +109 -0
  243. package/dist/chunks/preload-helper-C-73SErw.js +1 -0
  244. package/dist/chunks/print-mask-Dguzv0rv.js +17 -0
  245. package/dist/chunks/printLayout-oeudvFkr.js +34 -0
  246. package/dist/chunks/printMask-LefOTJqk.js +8 -0
  247. package/dist/chunks/psd-hjeNFQZ-.js +36 -0
  248. package/dist/chunks/purify.es-BsWMI_aG.js +5 -0
  249. package/dist/chunks/quadrantDiagram-AXDQQJYC-BmQNSzhY.js +7 -0
  250. package/dist/chunks/radar-RG4KPBEZ-BoHdw2h7.js +1 -0
  251. package/dist/chunks/railroad-74A4TZTK-BifJffb4.js +1 -0
  252. package/dist/chunks/railroad-abnf-HS5TGJTU-CMEPumRO.js +1 -0
  253. package/dist/chunks/railroad-ebnf-LZEXJU2U-B06BgAeN.js +1 -0
  254. package/dist/chunks/railroad-peg-WCYAUIDC-CMjriUEs.js +1 -0
  255. package/dist/chunks/railroadDiagram-O6MQD6OU-B2t5KY26.js +1 -0
  256. package/dist/chunks/react-runtime-x2lFbSKq.js +11 -0
  257. package/dist/chunks/refresh-cw-Dz8O9-Hp.js +8 -0
  258. package/dist/chunks/rendered-slot-YhfmcMJr.js +1 -0
  259. package/dist/chunks/requirementDiagram-BXWQKSXE-CBBfNOAp.js +84 -0
  260. package/dist/chunks/rolldown-runtime-BKuNeK48.js +1 -0
  261. package/dist/chunks/rotate-ccw-D2__Zisi.js +8 -0
  262. package/dist/chunks/rotate-cw-BSTVLlWY.js +8 -0
  263. package/dist/chunks/rough.esm-CVrpq1dW.js +1 -0
  264. package/dist/chunks/sankeyDiagram-P5KCCOFB-Cp8SrFyb.js +40 -0
  265. package/dist/chunks/save-w-NwiMMY.js +8 -0
  266. package/dist/chunks/search-DYZU68h1.js +8 -0
  267. package/dist/chunks/search-filters-CRIhZ0gL.js +1 -0
  268. package/dist/chunks/sequenceDiagram-WJ2MYXX4-PDtVfEoj.js +162 -0
  269. package/dist/chunks/shield-alert-De_Hx56I.js +8 -0
  270. package/dist/chunks/sizeCapture-INFHLROL-DA-kAaXB.js +1 -0
  271. package/dist/chunks/skeleton-CrjMjJNr.js +1 -0
  272. package/dist/chunks/spreadsheet-BzbBEhmY.js +1 -0
  273. package/dist/chunks/spreadsheet-LR3SOG-x.js +58 -0
  274. package/dist/chunks/sql-wasm-browser-CFddXd9f.js +2 -0
  275. package/dist/chunks/src-C1iDJpBK.js +1 -0
  276. package/dist/chunks/src-vLpLkuQx.js +1 -0
  277. package/dist/chunks/stateDiagram-D77RDMKH-C1Sx8KUD.js +1 -0
  278. package/dist/chunks/stateDiagram-v2-MP3YSRHH-7wYLSzBX.js +1 -0
  279. package/dist/chunks/swimlanes-42K2YHIH-BmybX9eL.js +1 -0
  280. package/dist/chunks/swimlanesDiagram-VR7AAH4N-DxhXklfm.js +8 -0
  281. package/dist/chunks/tabs-BobA_IcO.js +1 -0
  282. package/dist/chunks/theme-controller-D-ATwFal.js +1 -0
  283. package/dist/chunks/timeline-definition-24CTP7MA-QS9QNm2i.js +120 -0
  284. package/dist/chunks/tinycolor-CG1wnM-U.js +1 -0
  285. package/dist/chunks/togeojson.es-BE8iM7U6.js +1 -0
  286. package/dist/chunks/toolbar-controls-CThS0xuP.js +15 -0
  287. package/dist/chunks/trash-tHBT8Mpw.js +8 -0
  288. package/dist/chunks/treeView-Q6P3EWNA-CN0l7whJ.js +1 -0
  289. package/dist/chunks/treemap-WGGIJYW6-C4P1fQxS.js +1 -0
  290. package/dist/chunks/typography-DKK_iHcj.js +1 -0
  291. package/dist/chunks/ui-BFsHoY7a.js +1 -0
  292. package/dist/chunks/ui-utils-ClxYogUQ.js +1 -0
  293. package/dist/chunks/upload-M-n6woFv.js +8 -0
  294. package/dist/chunks/useCrudOperationColumn-D935tixd.js +1 -0
  295. package/dist/chunks/useListPage-CbcOQG4m.js +1 -0
  296. package/dist/chunks/useModalViewport-HF7te75S.js +1 -0
  297. package/dist/chunks/useRowSelection-4GOMFmjG.js +1 -0
  298. package/dist/chunks/useStatusToggle-B2qZaoc-.js +1 -0
  299. package/dist/chunks/user-round-kYfBkPNu.js +15 -0
  300. package/dist/chunks/users-BXZLb4TY.js +8 -0
  301. package/dist/chunks/vennDiagram-4TSXK5OY-CVd73ycc.js +34 -0
  302. package/dist/chunks/view-B8ZvC8z3.js +1 -0
  303. package/dist/chunks/viewer-Ct88ypIL.js +24 -0
  304. package/dist/chunks/wardley-WFR3VGLG-cG9pRFwD.js +1 -0
  305. package/dist/chunks/wardleyDiagram-VM6X3IG4-B42d0Gqz.js +78 -0
  306. package/dist/chunks/wordDoc-BZY3ZnxN.js +152 -0
  307. package/dist/chunks/wordDocx-Bt2mlB3C.js +77 -0
  308. package/dist/chunks/wordMl-Y_ghyTZ8.js +1 -0
  309. package/dist/chunks/worker-engine-B4e92GsN.js +17369 -0
  310. package/dist/chunks/x-Ak9hw1R9.js +8 -0
  311. package/dist/chunks/xmind-CF9YwkOD.js +58 -0
  312. package/dist/chunks/xychartDiagram-S5SC5T6Z-B_Owv9Ho.js +7 -0
  313. package/dist/file-viewer/flyfish-viewer-assets.json +46 -0
  314. package/dist/file-viewer/vendor/docx/docx.worker.js +5 -0
  315. package/dist/file-viewer/vendor/docx/jszip.min.js +13 -0
  316. package/dist/file-viewer/vendor/xlsx/sheet.worker.js +107 -0
  317. package/dist/file-viewer/wasm/data/sql-wasm.wasm +0 -0
  318. package/dist/index.d.ts +5 -0
  319. package/dist/index.js +1 -0
  320. package/dist/public/avatars/avatar-01.svg +1 -0
  321. package/dist/public/avatars/avatar-02.svg +1 -0
  322. package/dist/public/avatars/avatar-03.svg +1 -0
  323. package/dist/public/avatars/avatar-04.svg +1 -0
  324. package/dist/public/avatars/avatar-05.svg +1 -0
  325. package/dist/public/avatars/avatar-06.svg +1 -0
  326. package/dist/public/avatars/avatar-07.svg +1 -0
  327. package/dist/public/avatars/avatar-08.svg +1 -0
  328. package/dist/public/avatars/avatar-09.svg +1 -0
  329. package/dist/public/avatars/avatar-10.svg +1 -0
  330. package/dist/public/avatars/avatar-11.svg +1 -0
  331. package/dist/public/avatars/avatar-12.svg +1 -0
  332. package/dist/public/monaco/vs/abap-D-t0cyap.js +1 -0
  333. package/dist/public/monaco/vs/apex-CcIm7xu6.js +1 -0
  334. package/dist/public/monaco/vs/assets/css.worker-URu8fCFR.js +97 -0
  335. package/dist/public/monaco/vs/assets/editor.worker-lj3bdIIn.js +30 -0
  336. package/dist/public/monaco/vs/assets/editorWebWorkerMain-CA_vMoUU.js +30 -0
  337. package/dist/public/monaco/vs/assets/html.worker-D1SL3iM8.js +474 -0
  338. package/dist/public/monaco/vs/assets/json.worker-CoJx_OPf.js +62 -0
  339. package/dist/public/monaco/vs/assets/ts.worker-BWKtMYOk.js +67722 -0
  340. package/dist/public/monaco/vs/azcli-BA0tQDCg.js +1 -0
  341. package/dist/public/monaco/vs/basic-languages/monaco.contribution.js +1 -0
  342. package/dist/public/monaco/vs/bat-C397hTD6.js +1 -0
  343. package/dist/public/monaco/vs/bicep-DF5aW17k.js +2 -0
  344. package/dist/public/monaco/vs/cameligo-plsz8qhj.js +1 -0
  345. package/dist/public/monaco/vs/clojure-Y2auQMzK.js +1 -0
  346. package/dist/public/monaco/vs/coffee-Bu45yuWE.js +1 -0
  347. package/dist/public/monaco/vs/cpp-CkKPQIni.js +1 -0
  348. package/dist/public/monaco/vs/csharp-CX28MZyh.js +1 -0
  349. package/dist/public/monaco/vs/csp-D8uWnyxW.js +1 -0
  350. package/dist/public/monaco/vs/css-CaeNmE3S.js +3 -0
  351. package/dist/public/monaco/vs/css.worker-CyhWkhHo.js +1 -0
  352. package/dist/public/monaco/vs/cssMode-CV6Ay48H.js +1 -0
  353. package/dist/public/monaco/vs/cypher-DVThT8BS.js +1 -0
  354. package/dist/public/monaco/vs/dart-CmGfCvrO.js +1 -0
  355. package/dist/public/monaco/vs/dockerfile-CZqqYdch.js +1 -0
  356. package/dist/public/monaco/vs/ecl-30fUercY.js +1 -0
  357. package/dist/public/monaco/vs/editor/editor.main.css +1 -0
  358. package/dist/public/monaco/vs/editor/editor.main.js +1 -0
  359. package/dist/public/monaco/vs/editor-KLE6jdfb.js +831 -0
  360. package/dist/public/monaco/vs/editor.js +1 -0
  361. package/dist/public/monaco/vs/editorWorkerHost-fVE1cjcC.js +35 -0
  362. package/dist/public/monaco/vs/elixir-xjPaIfzF.js +1 -0
  363. package/dist/public/monaco/vs/flow9-DqtmStfK.js +1 -0
  364. package/dist/public/monaco/vs/freemarker2-FWreY7v7.js +3 -0
  365. package/dist/public/monaco/vs/fsharp-BOMdg4U1.js +1 -0
  366. package/dist/public/monaco/vs/go-D_hbi-Jt.js +1 -0
  367. package/dist/public/monaco/vs/graphql-CKUU4kLG.js +1 -0
  368. package/dist/public/monaco/vs/handlebars-CZi4pHCH.js +1 -0
  369. package/dist/public/monaco/vs/hcl-DTaboeZW.js +1 -0
  370. package/dist/public/monaco/vs/html-j_7ZTNRU.js +1 -0
  371. package/dist/public/monaco/vs/html.worker-CA3iAimZ.js +1 -0
  372. package/dist/public/monaco/vs/htmlMode-27by_KM4.js +1 -0
  373. package/dist/public/monaco/vs/index-049xrXrp.js +1 -0
  374. package/dist/public/monaco/vs/index-CBVt3dzv.js +5 -0
  375. package/dist/public/monaco/vs/index.js +1 -0
  376. package/dist/public/monaco/vs/ini-CsNwO04R.js +1 -0
  377. package/dist/public/monaco/vs/initialize-DL0l1TGY.js +1 -0
  378. package/dist/public/monaco/vs/java-CI4ZMsH9.js +1 -0
  379. package/dist/public/monaco/vs/javascript-DTJl4Jn1.js +1 -0
  380. package/dist/public/monaco/vs/json.worker-BizpAl9O.js +1 -0
  381. package/dist/public/monaco/vs/jsonMode-DLUiMUrI.js +1 -0
  382. package/dist/public/monaco/vs/julia-BwzEvaQw.js +1 -0
  383. package/dist/public/monaco/vs/kotlin-IUYPiTV8.js +1 -0
  384. package/dist/public/monaco/vs/language/css/monaco.contribution.js +1 -0
  385. package/dist/public/monaco/vs/language/html/monaco.contribution.js +1 -0
  386. package/dist/public/monaco/vs/language/json/monaco.contribution.js +1 -0
  387. package/dist/public/monaco/vs/language/typescript/monaco.contribution.js +1 -0
  388. package/dist/public/monaco/vs/less-C0eDYdqa.js +2 -0
  389. package/dist/public/monaco/vs/lexon-iON-Kj97.js +1 -0
  390. package/dist/public/monaco/vs/liquid-CLJYelW6.js +1 -0
  391. package/dist/public/monaco/vs/loader.js +1368 -0
  392. package/dist/public/monaco/vs/lspLanguageFeatures-BIkJOWLw.js +2 -0
  393. package/dist/public/monaco/vs/lua-DtygF91M.js +1 -0
  394. package/dist/public/monaco/vs/m3-CsR4AuFi.js +1 -0
  395. package/dist/public/monaco/vs/main-BEx-Fmlo.js +15 -0
  396. package/dist/public/monaco/vs/main-DsK8pnKg.js +3 -0
  397. package/dist/public/monaco/vs/markdown-C_rD0bIw.js +1 -0
  398. package/dist/public/monaco/vs/mdx-CpzZIPHF.js +1 -0
  399. package/dist/public/monaco/vs/mips-CiYP61RB.js +1 -0
  400. package/dist/public/monaco/vs/monaco.contribution-9cKT3C7t.js +1 -0
  401. package/dist/public/monaco/vs/monaco.contribution-BE88ZNGY.js +1 -0
  402. package/dist/public/monaco/vs/monaco.contribution-BPhsneLd.js +1 -0
  403. package/dist/public/monaco/vs/monaco.contribution-BgRy6xDf.js +1 -0
  404. package/dist/public/monaco/vs/msdax-C38-sJlp.js +1 -0
  405. package/dist/public/monaco/vs/mysql-CdtbpvbG.js +1 -0
  406. package/dist/public/monaco/vs/nls/lang/cs.d.ts +1 -0
  407. package/dist/public/monaco/vs/nls/lang/cs.js +9 -0
  408. package/dist/public/monaco/vs/nls/lang/de.d.ts +1 -0
  409. package/dist/public/monaco/vs/nls/lang/de.js +9 -0
  410. package/dist/public/monaco/vs/nls/lang/es.d.ts +1 -0
  411. package/dist/public/monaco/vs/nls/lang/es.js +9 -0
  412. package/dist/public/monaco/vs/nls/lang/fr.d.ts +1 -0
  413. package/dist/public/monaco/vs/nls/lang/fr.js +9 -0
  414. package/dist/public/monaco/vs/nls/lang/it.d.ts +1 -0
  415. package/dist/public/monaco/vs/nls/lang/it.js +9 -0
  416. package/dist/public/monaco/vs/nls/lang/ja.d.ts +1 -0
  417. package/dist/public/monaco/vs/nls/lang/ja.js +9 -0
  418. package/dist/public/monaco/vs/nls/lang/ko.d.ts +1 -0
  419. package/dist/public/monaco/vs/nls/lang/ko.js +9 -0
  420. package/dist/public/monaco/vs/nls/lang/pl.d.ts +1 -0
  421. package/dist/public/monaco/vs/nls/lang/pl.js +9 -0
  422. package/dist/public/monaco/vs/nls/lang/pt-br.d.ts +1 -0
  423. package/dist/public/monaco/vs/nls/lang/pt-br.js +9 -0
  424. package/dist/public/monaco/vs/nls/lang/ru.d.ts +1 -0
  425. package/dist/public/monaco/vs/nls/lang/ru.js +9 -0
  426. package/dist/public/monaco/vs/nls/lang/tr.d.ts +1 -0
  427. package/dist/public/monaco/vs/nls/lang/tr.js +9 -0
  428. package/dist/public/monaco/vs/nls/lang/zh-cn.d.ts +1 -0
  429. package/dist/public/monaco/vs/nls/lang/zh-cn.js +9 -0
  430. package/dist/public/monaco/vs/nls/lang/zh-tw.d.ts +1 -0
  431. package/dist/public/monaco/vs/nls/lang/zh-tw.js +9 -0
  432. package/dist/public/monaco/vs/nls.messages-loader.js +1 -0
  433. package/dist/public/monaco/vs/objective-c-CntZFaHX.js +1 -0
  434. package/dist/public/monaco/vs/pascal-r6kuqfl_.js +1 -0
  435. package/dist/public/monaco/vs/pascaligo-BiXoTmXh.js +1 -0
  436. package/dist/public/monaco/vs/perl-DABw_TcH.js +1 -0
  437. package/dist/public/monaco/vs/pgsql-me_jFXeX.js +1 -0
  438. package/dist/public/monaco/vs/php-D_kh-9LK.js +1 -0
  439. package/dist/public/monaco/vs/pla-VfZjczW0.js +1 -0
  440. package/dist/public/monaco/vs/postiats-BBSzz8Pk.js +1 -0
  441. package/dist/public/monaco/vs/powerquery-Dt-g_2cc.js +1 -0
  442. package/dist/public/monaco/vs/powershell-B-7ap1zc.js +1 -0
  443. package/dist/public/monaco/vs/protobuf-BmtuEB1A.js +2 -0
  444. package/dist/public/monaco/vs/pug-BRpRNeEb.js +1 -0
  445. package/dist/public/monaco/vs/python-CqWUUgfu.js +1 -0
  446. package/dist/public/monaco/vs/qsharp-BzsFaUU9.js +1 -0
  447. package/dist/public/monaco/vs/r-f8dDdrp4.js +1 -0
  448. package/dist/public/monaco/vs/razor-hok5y9Km.js +1 -0
  449. package/dist/public/monaco/vs/redis-fvZQY4PI.js +1 -0
  450. package/dist/public/monaco/vs/redshift-45Et0LQi.js +1 -0
  451. package/dist/public/monaco/vs/restructuredtext-C7UUFKFD.js +1 -0
  452. package/dist/public/monaco/vs/ruby-CZO8zYTz.js +1 -0
  453. package/dist/public/monaco/vs/rust-Bfetafyc.js +1 -0
  454. package/dist/public/monaco/vs/sb-3GYllVck.js +1 -0
  455. package/dist/public/monaco/vs/scala-foMgrKo1.js +1 -0
  456. package/dist/public/monaco/vs/scheme-CHdMtr7p.js +1 -0
  457. package/dist/public/monaco/vs/scss-C1cmLt9V.js +3 -0
  458. package/dist/public/monaco/vs/shell-ClXCKCEW.js +1 -0
  459. package/dist/public/monaco/vs/solidity-MZ6ExpPy.js +1 -0
  460. package/dist/public/monaco/vs/sophia-DWkuSsPQ.js +1 -0
  461. package/dist/public/monaco/vs/sparql-AUGFYSyk.js +1 -0
  462. package/dist/public/monaco/vs/sql-32GpJSV2.js +1 -0
  463. package/dist/public/monaco/vs/st-CuDFIVZ_.js +1 -0
  464. package/dist/public/monaco/vs/swift-t-PfMj7W.js +1 -0
  465. package/dist/public/monaco/vs/systemverilog-Ch4vA8Yt.js +1 -0
  466. package/dist/public/monaco/vs/tcl-D74tq1nH.js +1 -0
  467. package/dist/public/monaco/vs/toggleHighContrast-qGX7E9o7.js +61 -0
  468. package/dist/public/monaco/vs/ts.worker-2QLmBukE.js +1 -0
  469. package/dist/public/monaco/vs/tsMode-B0S_kp2q.js +11 -0
  470. package/dist/public/monaco/vs/twig-C6taOxMV.js +1 -0
  471. package/dist/public/monaco/vs/typescript-_2t_511t.js +1 -0
  472. package/dist/public/monaco/vs/typespec-8OfoLt6R.js +1 -0
  473. package/dist/public/monaco/vs/vb-Dyb2648j.js +1 -0
  474. package/dist/public/monaco/vs/wgsl-BhLXMOR0.js +298 -0
  475. package/dist/public/monaco/vs/workers-BBttULjf.js +1 -0
  476. package/dist/public/monaco/vs/xml-cZjNDqDT.js +1 -0
  477. package/dist/public/monaco/vs/yaml-A1fOIdH6.js +1 -0
  478. package/dist/src-LbWcrSWe.js +3 -0
  479. package/dist/styles.css +2 -0
  480. package/dist/styles.d.ts +1 -0
  481. package/dist/types.d.ts +1 -0
  482. package/package.json +113 -4
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{n as t,r as n}from"./chunk-Y2CYZVJY-DjEHBC-3.js";import{C as r,w as i}from"./src-C1iDJpBK.js";import{j as a}from"./chunk-DU6HZSFF-Bx48E1rg.js";import{d as o}from"./chunk-75Z2AOVW-IO9R6faP.js";import{n as s}from"./chunk-PWAF6VOD-IORmPx9D.js";import{i as c}from"./chunk-GMAD6QVW-D41KnniX.js";import{n as l}from"./chunk-P2QGCYS3-C9bc1yiM.js";import{r as u}from"./chunk-4HAMMTFA-Aw59LwS3.js";import{r as d}from"./chunk-GVQU2GXP-CVzgM_ui.js";import{i as f,s as p}from"./chunk-OSK3NFVY-C9uWOXTC.js";import{n as m}from"./chunk-L3NEJ4N5-CmvrS7Dt.js";import{c as h,i as g}from"./chunk-2E4U76K2-DNbbdpCx.js";function _(e){let t=[];for(let n=0;n<e.length-1;n++)t.push({a:e[n],b:e[n+1]});return t}function v(e,t,n,r){let i=t.x-e.x,a=t.y-e.y,o=r.x-n.x,s=r.y-n.y,c=i*s-a*o;if(c===0)return null;let l=n.x-e.x,u=n.y-e.y,d=(l*s-u*o)/c,f=(l*a-u*i)/c;return d<=Wn||d>=1-Wn||f<=Wn||f>=1-Wn?null:{point:{x:e.x+d*i,y:e.y+d*a},tA:d,tB:f}}function y(e){return Math.abs(e.b.x-e.a.x)>=Math.abs(e.b.y-e.a.y)}function b(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],i=_(r.points);for(let a=n+1;a<e.length;a++){let n=e[a],o=_(n.points);for(let[e,a]of i.entries())for(let[i,s]of o.entries()){let o=v(a.a,a.b,s.a,s.b);if(!o)continue;let c=y(a);c!==y(s)&&c?t.push({jumpEdgeId:r.id,otherEdgeId:n.id,segIndex:e,t:o.tA,point:o.point}):t.push({jumpEdgeId:n.id,otherEdgeId:r.id,segIndex:i,t:o.tB,point:o.point})}}}return t}function x(e){return`${Math.round(e*1e3)/1e3}`}function S(e){return`${x(e.x)},${x(e.y)}`}function C(e){let t=e.b.x-e.a.x,n=e.b.y-e.a.y;return Math.abs(t)>=Math.abs(n)?+(t>=0):+(n>=0)}function w(e,t){if(e.length<2)return e.map(e=>({...e}));let n=e.map(e=>({...e})),r=t.arrowTypeStart&&p[t.arrowTypeStart];if(r){let t=e[0],i=e[1],a=Math.atan2(i.y-t.y,i.x-t.x);n[0].x=t.x+r*Math.cos(a),n[0].y=t.y+r*Math.sin(a)}let i=t.arrowTypeEnd&&p[t.arrowTypeEnd];if(i){let t=e.length,r=e[t-2],a=e[t-1],o=Math.atan2(a.y-r.y,a.x-r.x);n[t-1].x=a.x-i*Math.cos(o),n[t-1].y=a.y-i*Math.sin(o)}return n}function T(e,t,n,r,i){let a=e.point.x,o=e.point.y,s={x:a-t*e.r,y:o-n*e.r},c={x:a+t*e.r,y:o+n*e.r},l=[`L${S(s)}`];return i===`arc`?l.push(`A${x(e.r)},${x(e.r)} 0 0 ${r} ${S(c)}`):l.push(`M${S(c)}`),l}function E(e,t,n,r){let i=t.x-e.x,a=t.y-e.y,o=n.x-t.x,s=n.y-t.y,c=Math.hypot(i,a),l=Math.hypot(o,s);if(c<Un||l<Un)return null;let u=i/c,d=a/c,f=o/l,p=s/l,m=u*f+d*p,h=Math.acos(Math.max(-1,Math.min(1,m)));if(h<Un||Math.abs(Math.PI-h)<Un)return null;let g=Math.min(r/Math.sin(h/2),c/2,l/2);return{startX:t.x-u*g,startY:t.y-d*g,endX:t.x+f*g,endY:t.y+p*g,ctrlX:t.x,ctrlY:t.y,cutLen:g}}function D(e,t,n){let r=e.points;if(r.length<2)return``;let i=w(r,e),a=e.curve===`rounded`,o=_(i),s=/* @__PURE__ */ new Map;for(let e of t){let t=o[e.segIndex];if(!t)continue;let r=Math.hypot(t.b.x-t.a.x,t.b.y-t.a.y),i=s.get(e.segIndex)??[];i.push({t:e.t,point:e.point,d:e.t*r,r:n.jumpRadius}),s.set(e.segIndex,i)}let c=[`M${S(i[0])}`];for(let e=0;e<o.length;e++){let t=o[e],r=Math.hypot(t.b.x-t.a.x,t.b.y-t.a.y),l=r===0?0:(t.b.x-t.a.x)/r,u=r===0?0:(t.b.y-t.a.y)/r,d=C(t),f=0;if(a&&e>0){let t=E(i[e-1],i[e],i[e+1]??i[e],Hn);t&&(f=t.cutLen)}let p=r,m=null;a&&e<o.length-1&&(m=E(i[e],i[e+1],i[e+2]??i[e+1],Hn),m&&(p=r-m.cutLen));let h=[...s.get(e)??[]].sort((e,t)=>e.t-t.t);for(let e of h)e.r=Math.min(e.r,e.d-f,p-e.d);for(let e=0;e<h.length-1;e++){let t=h[e+1].d-h[e].d;if(h[e].r+h[e+1].r>t){let n=t/2;h[e].r=Math.min(h[e].r,n),h[e+1].r=Math.min(h[e+1].r,n)}}for(let e of h)e.r<Gn||c.push(...T(e,l,u,d,n.jumpStyle));a&&m?(c.push(`L${x(m.startX)},${x(m.startY)}`),c.push(`Q${x(m.ctrlX)},${x(m.ctrlY)} ${x(m.endX)},${x(m.endY)}`)):c.push(`L${S(t.b)}`)}return c.join(` `)}function O(e){return/^[\d\s+,.LMelm-]*$/.test(e)}function k(e){return!e||e===`linear`||e===`rounded`||e===`step`||e===`stepBefore`||e===`stepAfter`}function A(e){if(!e)return null;try{let t=typeof atob==`function`?atob(e):Buffer.from(e,`base64`).toString(),n=JSON.parse(t);if(!Array.isArray(n))return null;let r=[];for(let e of n)e&&typeof e.x==`number`&&typeof e.y==`number`&&r.push({x:e.x,y:e.y});return r.length>=2?r:null}catch{return null}}function j(e,t,n){if(!n.enabled)return;let r=e.node();if(!r)return;let i=/* @__PURE__ */ new Map;for(let e of t)i.set(e.id,e);let a=[],o=/* @__PURE__ */ new Map;for(let e of t){let t=typeof CSS<`u`&&CSS.escape?CSS.escape(e.id):e.id,n=r.querySelector(`path[data-id="${t}"]`);if(!n)continue;o.set(e.id,n);let i=A(n.getAttribute(`data-points`))??e.points;a.push({...e,points:i})}let s=b(a);if(s.length===0)return;let c=/* @__PURE__ */ new Map;for(let e of s){let t=c.get(e.jumpEdgeId)??[];t.push(e),c.set(e.jumpEdgeId,t)}for(let e of a){let t=c.get(e.id);if(!t||t.length===0)continue;let r=i.get(e.id)?.curve;if(r!==void 0&&!k(r))continue;let a=o.get(e.id);if(!a||r===void 0&&!O(a.getAttribute(`d`)??``))continue;let s=a.getAttribute(`style`)??``,l=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(s),u=l?Number.parseFloat(l[1]):null,d=l?Number.parseFloat(l[2]):null,f=D(e,t,n);if(a.setAttribute(`d`,f),u!==null&&d!==null&&typeof a.getTotalLength==`function`){let e=a.getTotalLength(),t=`0 ${u} ${Math.max(0,e-u-d)} ${d}`,n=s.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${t};`).replace(/;\s*;+/g,`;`);a.setAttribute(`style`,n)}}}function ee(e,{measure:t}){let n=e.config?.swimlane?.lineHops;if(n===!1)return;let r=n===`gap`?`gap`:`arc`,i=e.edges.filter(e=>Array.isArray(e.points)&&e.points.length>=2).map(e=>({id:e.id,points:e.points,curve:e.curve,arrowTypeStart:e.arrowTypeStart,arrowTypeEnd:e.arrowTypeEnd}));j(t.groups.edgePaths,i,{enabled:!0,jumpRadius:6,jumpStyle:r})}function te(e){return Math.max(e.padding??Jn,Jn)}function M(e){let{x:t,y:n,width:r,height:i}=e,a=e.swimlaneContentTop;if(typeof t!=`number`||typeof n!=`number`||typeof r!=`number`||typeof i!=`number`||typeof a!=`number`||!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(r)||!Number.isFinite(i)||!Number.isFinite(a)||r<=0||i<=0){delete e.groupTitleRect;return}let o=n-i/2,s=Math.min(a,n+i/2),c=o+Math.min(qn,Math.max(0,s-o));c<=o?delete e.groupTitleRect:e.groupTitleRect={left:t-r/2,right:t+r/2,top:o,bottom:c}}function ne(e){let t=e.direction,n=e.nodes??=[];for(let n of e.nodes??[])n.isGroup&&!n.parentId&&(n.shape=`swimlane`,t&&(n.direction=t));let r=n.filter(e=>!e.isGroup&&!e.parentId);if(r.length===0)return;let i=n.find(e=>e.id===Kn);i?i.isGroup&&(i.shape=`swimlane`,t&&(i.direction=t)):(i={id:Kn,label:``,isGroup:!0,shape:`swimlane`,padding:20,...t?{direction:t}:{}},n.push(i));for(let e of r)e.parentId=Kn}function re(e){let t=/* @__PURE__ */ new Map;for(let n of e.nodes??[])t.set(n.id,n);let n=[];for(let t of e.edges??[]){let e=typeof t.start==`string`?t.start:void 0,r=typeof t.end==`string`?t.end:void 0;e&&r&&(t.labelNodeId||n.push({id:t.id,src:e,dst:r,ref:t}))}let r=e.nodes??[],i=r.filter(e=>e.isGroup),a=r.filter(e=>!e.isGroup);return{nodes:[...[...i].reverse(),...a].map(e=>e.id),edges:n,layout:e,nodeById:t}}function ie(e,t,n,r){let{layout:i}=e,a=e.nodeById,o=r?.layerGap??100,s=r?.nodeGap??40,c=0;for(let e of t.layers){let t=0;for(let r of e){let e=a.get(r);if(!e){t++;continue}e.layer=c,e.order=t;let i=n.x[r]??t*s,l=n.y[r]??c*o;e.x=i,e.y=l,t++}c++}let l=i.nodes??[],u=/* @__PURE__ */ new Map,d=[];for(let e of l){if(!e?.isGroup)continue;e.parentId||d.push(e);let t=l.filter(t=>t.parentId===e.id),r=1/0,i=-1/0,a=1/0,o=-1/0;for(let e of t){let t=e.x??n.x[e.id],s=e.y??n.y[e.id],c=e.width??0,l=e.height??0;t!=null&&s!=null&&(r=Math.min(r,t-c/2),i=Math.max(i,t+c/2),a=Math.min(a,s-l/2),o=Math.max(o,s+l/2))}if(r===1/0||a===1/0)e.x=e.x??0,e.y=e.y??0,e.width=e.width??0,e.height=e.height??0;else{let t=e.padding??20,n=e.parentId?t:2*te(e),s=t,c=Math.max(0,i-r)+n,l=Math.max(0,o-a)+s,d=(r+i)/2,f=(a+o)/2;e.x=d,e.y=f,e.width=c,e.height=l,u.set(e.id,{minX:r,maxX:i,minY:a,maxY:o})}}if(d.length>0&&u.size>0){let e=1/0,t=-1/0,n=0;for(let r of d){let i=r.padding??20;i>n&&(n=i);let a=u.get(r.id);a&&(e=Math.min(e,a.minY),t=Math.max(t,a.maxY))}if(e!==1/0&&t!==-1/0){let r=Math.max(0,t-e)+2*Math.max(n,36),i=(e+t)/2;for(let t of d)t.y=i,t.height=r,t.swimlaneContentTop=e;let a=[...d].sort((e,t)=>(e.x??0)-(t.x??0)),o=[],s=[],c=[];for(let e of a){let t=u.get(e.id);if(!t)continue;let n=Math.max(0,t.maxX-t.minX)+2*te(e),r=(t.minX+t.maxX)/2;o.push(e.id),s.push(r),c.push(n)}let l=o.length;if(l>0){let e=/* @__PURE__ */ new Map;if(l===1)e.set(o[0],c[0]);else{let t=[];for(let e=0;e<l-1;e++)t.push(s[e+1]-s[e]);let n=Array(l);n[0]=0;for(let e=0;e<l-1;e++)n[e+1]=2*t[e]-n[e];let r=0,i=1/0;for(let e=0;e<l;e++){let t=c[e];e%2==0?r=Math.max(r,t-n[e]):i=Math.min(i,n[e]-t)}let a=r;a=r<=i?(r+i)/2:r;for(let t=0;t<l;t++){let r=n[t]+(t%2==0?a:-a),i=Math.max(c[t],r);e.set(o[t],i)}}for(let t of d){let n=e.get(t.id);n!=null&&(t.width=n),M(t)}}}}}function ae(e){let t=[],n=[],r=/* @__PURE__ */ new Map;for(let t of e.nodes)r.set(t.id,t);for(let a of e.edges){if(!a.label||a.label.length===0||a.isLayoutOnly||a.labelNodeId)continue;let e=a.start?r.get(a.start):void 0,o=a.end?r.get(a.end):void 0;if(!e||!o){i.warn(Yn,`Edge ${a.id} has missing source or target node`);continue}let s=`edge-label-${a.start}-${a.end}-${a.id}`,c=e.parentId===o.parentId?e.parentId:o.parentId,l={id:s,label:a.label,edgeStart:a.start??``,edgeEnd:a.end??``,shape:`labelRect`,width:0,height:0,isEdgeLabel:!0,isDummy:!0,parentId:c,isGroup:!1,labelStyle:Array.isArray(a.labelStyle)?a.labelStyle[0]:a.labelStyle??``,...e.dir?{dir:e.dir}:{}};t.push(l),a.labelNodeId=s,a.label=void 0,a.text=void 0;let u={id:`${a.id}-to-label`,start:a.start,end:s,type:`normal`,isLayoutOnly:!0},d={id:`${a.id}-from-label`,start:s,end:a.end,type:`normal`,isLayoutOnly:!0};n.push(u,d)}let a=[...e.nodes,...t],o=[...e.edges,...n];return{...e,nodes:a,edges:o}}function oe(e){let t=e.x??0,n=e.y??0,r=e.width??0,i=e.height??0;return r>0&&i>0?{cx:t,cy:n,rect:me(t,n,r,i)}:void 0}function se(e){if(e.isGroup)return;let t=oe(e);if(t)return{id:String(e.id??``),cx:t.cx,cy:t.cy,rect:t.rect}}function N(e,t,n=q){return Math.abs(e.x-t.x)<n&&Math.abs(e.y-t.y)<n}function P(e,t,n=q){return Math.abs(e.x-t.x)<n}function F(e,t,n=q){return Math.abs(e.y-t.y)<n}function I(e,t,n=q){return F(e,t,n)&&Math.abs(e.x-t.x)>n}function L(e,t,n=q){return P(e,t,n)&&Math.abs(e.y-t.y)>n}function R(e,t,n,r){return Math.max(0,Math.min(Math.max(e,t),Math.max(n,r))-Math.max(Math.min(e,t),Math.min(n,r)))}function z(e,t,n=q){return e.horizontal&&t.horizontal&&F(e.a,t.a,n)?R(e.a.x,e.b.x,t.a.x,t.b.x):e.vertical&&t.vertical&&P(e.a,t.a,n)?R(e.a.y,e.b.y,t.a.y,t.b.y):0}function ce(e,t=q){let n=[];for(let r=0;r<e.length-1;r++){let i=e[r],a=e[r+1],o=I(i,a,t),s=L(i,a,t);(o||s)&&n.push({index:r,a:i,b:a,horizontal:o,vertical:s})}return n}function B(e,t=q){let n=ce(e,t),r=0;for(let e=1;e<n.length;e++)n[e-1].horizontal!==n[e].horizontal&&r++;return r}function V(e,t=q){let n=[];for(let r of e){let e=n.length>0?n[n.length-1]:void 0;(!e||!N(e,r,t))&&n.push({x:r.x,y:r.y})}return n}function H(e,t=q){if(!e||e.length!==4)return;let[n,r,i,a]=e;return I(n,r,t)&&L(r,i,t)&&I(i,a,t)?{kind:`HVH`,p0:n,p1:r,p2:i,p3:a}:L(n,r,t)&&I(r,i,t)&&L(i,a,t)?{kind:`VHV`,p0:n,p1:r,p2:i,p3:a}:void 0}function le(e,t,n,r=0){let i=Math.min(e.x,t.x),a=Math.max(e.x,t.x),o=Math.min(e.y,t.y),s=Math.max(e.y,t.y);return a>n.left-r&&i<n.right+r&&s>n.top-r&&o<n.bottom+r}function ue(e,t,n=0){return e.x>t.left+n&&e.x<t.right-n&&e.y>t.top+n&&e.y<t.bottom-n}function de(e,t){return e.left<=t.left&&e.right>=t.right&&e.top<=t.top&&e.bottom>=t.bottom}function fe(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}function pe(e,t){return{left:e.left-t,right:e.right+t,top:e.top-t,bottom:e.bottom+t}}function me(e,t,n,r){return{left:e-n/2,right:e+n/2,top:t-r/2,bottom:t+r/2}}function U(e){return oe(e)?.rect}function W(e,t){switch(t){case`top`:return{x:e.cx,y:e.rect.top};case`bottom`:return{x:e.cx,y:e.rect.bottom};case`left`:return{x:e.rect.left,y:e.cy};case`right`:return{x:e.rect.right,y:e.cy}}}function G(e,t,n,r,i,a=q){let o=t===`left`||t===`right`,s=r===`left`||r===`right`;if(o&&s){if(t===`right`&&r===`left`&&e.x<n.x||t===`left`&&r===`right`&&e.x>n.x){if(F(e,n,a))return[e,n];let t=(e.x+n.x)/2;return[e,{x:t,y:e.y},{x:t,y:n.y},n]}if(t===r){if(F(e,n,a))return;let r=t===`left`?Math.min(e.x,n.x)-i:Math.max(e.x,n.x)+i;return[e,{x:r,y:e.y},{x:r,y:n.y},n]}return}if(!o&&!s){if(t===r){if(P(e,n,a))return;let r=t===`top`?Math.min(e.y,n.y)-i:Math.max(e.y,n.y)+i;return[e,{x:e.x,y:r},{x:n.x,y:r},n]}if(!(t===`bottom`&&r===`top`&&e.y<n.y||t===`top`&&r===`bottom`&&e.y>n.y))return;if(P(e,n,a))return[e,n];let o=(e.y+n.y)/2;return[e,{x:e.x,y:o},{x:n.x,y:o},n]}if(o&&!s){let i=t===`right`&&n.x>e.x||t===`left`&&n.x<e.x,a=r===`top`&&e.y<n.y||r===`bottom`&&e.y>n.y;return i&&a?[e,{x:n.x,y:e.y},n]:void 0}let c=t===`bottom`&&n.y>e.y||t===`top`&&n.y<e.y,l=r===`left`&&e.x<n.x||r===`right`&&e.x>n.x;return c&&l?[e,{x:e.x,y:n.y},n]:void 0}function he(e,t,n,r){return t===`left`||t===`right`?[e,{x:r,y:e.y},{x:r,y:n.y},n]:[e,{x:e.x,y:r},{x:n.x,y:r},n]}function ge(e){let t=/* @__PURE__ */ new Map,n=[];for(let r of e){if(r.isEdgeLabel)continue;let e=se(r);e&&(t.set(e.id,e),n.push({id:e.id,rect:e.rect}))}return{nodeInfoById:t,realNodeRects:n}}function _e(e){let t=[],n=[];for(let r of e){let e=se(r);if(!e)continue;let i={id:e.id,rect:e.rect};r.isEdgeLabel?n.push(i):t.push(i)}return{realNodeRects:t,labelNodeRects:n}}function ve(e,{includeEdgeLabels:t=!0}={}){let n=[];for(let r of e){if(r.isGroup||!t&&r.isEdgeLabel)continue;let e=r.x??0,i=r.y??0,a=r.width??0,o=r.height??0;n.push({nodeId:r.id,...me(e,i,a,o)})}return n}function ye(e,t,n=q){let r=e.start,i=e.end;if(!r||!i)return;let a=t.get(r),o=t.get(i);if(a&&o)return{srcId:r,dstId:i,srcInfo:a,dstInfo:o,collinearX:Math.abs(a.cx-o.cx)<n,collinearY:Math.abs(a.cy-o.cy)<n}}function K(e,t,n,r=[],i=0){for(let a of n)if(!r.includes(a.id)&&le(e,t,a.rect,-i))return!0;return!1}function be(e,t,n,r,i=q,a=1e-6){let o=F(e,t,i),s=P(e,t,i),c=F(n,r,i),l=P(n,r,i);if(o&&c||s&&l||!(o||s)||!(c||l))return!1;let u=o?{a:e,b:t}:{a:n,b:r},d=s?{a:e,b:t}:{a:n,b:r},f=u.a.y,p=Math.min(u.a.x,u.b.x),m=Math.max(u.a.x,u.b.x),h=d.a.x,g=Math.min(d.a.y,d.b.y),_=Math.max(d.a.y,d.b.y);if(h<p||h>m||f<g||f>_)return!1;let v=Math.abs(h-u.a.x)<a&&Math.abs(f-u.a.y)<a||Math.abs(h-u.b.x)<a&&Math.abs(f-u.b.y)<a,y=Math.abs(h-d.a.x)<a&&Math.abs(f-d.a.y)<a||Math.abs(h-d.b.x)<a&&Math.abs(f-d.b.y)<a;return!(v&&y)}function xe(e,t,n,r,i=q){let a=F(e,t,i),o=P(e,t,i),s=F(n,r,i),c=P(n,r,i);return o&&c&&P(e,n,i)?R(e.y,t.y,n.y,r.y)>i:a&&s&&F(e,n,i)?R(e.x,t.x,n.x,r.x)>i:!1}function Se(e,t,n,r,{epsilon:i=q,skipDegenerateOther:a=!1}={}){for(let o of n){if(o===r||o.isLayoutOnly)continue;let n=o.points;if(!(!n||n.length<2))for(let r=0;r<n.length-1;r++){let o=n[r],s=n[r+1];if(!(a&&N(o,s,i))&&(be(e,t,o,s,i)||xe(e,t,o,s,i)))return!0}}return!1}function Ce(e,t,n,r,i=q){let a=F(e,t,i),o=P(e,t,i),s=F(n,r,i),c=P(n,r,i);if(!(a&&c||o&&s))return!1;let l=a?{a:e,b:t}:{a:n,b:r},u=a?{a:n,b:r}:{a:e,b:t},d=l.a.y,f=Math.min(l.a.x,l.b.x),p=Math.max(l.a.x,l.b.x),m=u.a.x,h=Math.min(u.a.y,u.b.y),g=Math.max(u.a.y,u.b.y);return m>f+i&&m<p-i&&d>h+i&&d<g-i}function we(e,t,n){let r=Math.min(t,n),i=Math.max(t,n);return e>r+q&&e<i-q}function Te(e,t,n){return P(e,t)&&P(t,n)?we(t.y,e.y,n.y):F(e,t)&&F(t,n)?we(t.x,e.x,n.x):!1}function Ee(e){let t=!1,n=[];for(let r=0;r<e.length;r++){let i=n[n.length-1],a=e[r],o=r+1<e.length?e[r+1]:void 0;if(i&&o){if(N(i,o)){r++,t=!0;continue}if(Te(i,a,o)){t=!0;continue}}n.push(a)}return{points:n,changed:t}}function De(e){let t=[e[0]];for(let n=1;n<e.length;n++){let r=t[t.length-1],i=e[n];if(!P(r,i)&&!F(r,i)){let e=t.length>=2?t[t.length-2]:void 0,n=e&&P(e,r)?{x:r.x,y:i.y}:{x:i.x,y:r.y};t.push(n)}t.push(i)}let n=[];for(let e of t){let t=n[n.length-1];(!t||!N(t,e))&&n.push(e)}return n}function Oe(e){if(e.length<3)return e;let t=[...e];for(let e=0;e<32;e++){let e=Ee(t);if(t=e.points,!e.changed)break}return t}function ke(e,t,n){let r=e;if(r.isLayoutOnly||!r.points||r.points.length<n)return;let i=r.start?t.get(r.start):void 0,a=r.end?t.get(r.end):void 0;return{edge:r,points:r.points,srcRect:i?U(i):void 0,dstRect:a?U(a):void 0}}function Ae(e,t,n){if(F(e,t,J))return{x:e.x<n.left?n.left:n.right,y:e.y};if(P(e,t,J)){let t=e.y<n.top?n.top:n.bottom;return{x:e.x,y:t}}return{x:Math.min(n.right,Math.max(n.left,e.x)),y:Math.min(n.bottom,Math.max(n.top,e.y))}}function je(e,t,n){let r=n?1:-1,i=n?0:e.length-1;for(;i>=0&&i<e.length&&ue(e[i],t,Xn);)i+=r;if(i<0||i>=e.length)return e;let a=i-r;if(a<0||a>=e.length)return e;let o=Ae(e[i],e[a],t);return n?[o,...e.slice(i)]:[...e.slice(0,i+1),o]}function Me(e,t){for(let n of e){let e=ke(n,t,2);if(!e)continue;let r=[...e.points];e.srcRect&&(r=je(r,e.srcRect,!0)),e.dstRect&&(r=je(r,e.dstRect,!1)),r=Oe(De(r)),r=Ue(r,e.srcRect,e.dstRect),e.edge.points=Oe(De(r))}}function Ne(e,t,n,r=!1){if(F(e,t,J)){if(t.y<n.top-J||t.y>n.bottom+J)return t;if(r){if(e.x<n.left-J)return{x:n.left,y:e.y};if(e.x>n.right+J)return{x:n.right,y:e.y}}return{x:Math.abs(t.x-n.left)<=Math.abs(t.x-n.right)?n.left:n.right,y:e.y}}if(P(e,t,J)){if(t.x<n.left-J||t.x>n.right+J)return t;if(r){if(e.y<n.top-J)return{x:e.x,y:n.top};if(e.y>n.bottom+J)return{x:e.x,y:n.bottom}}let i=Math.abs(t.y-n.top)<=Math.abs(t.y-n.bottom);return{x:e.x,y:i?n.top:n.bottom}}return t}function Pe(e,t,n){let r=e[t];for(let i=t+n;i>=0&&i<e.length;i+=n){let t=e[i];if(!N(t,r,J))return t}return e[t+n]}function Fe(e,t){let n=e+Zn,r=t-Zn;return n<=r?{lo:n,hi:r}:{lo:(e+t)/2,hi:(e+t)/2}}function Ie(e,t,n){let{lo:r,hi:i}=Fe(t,n);return Math.min(i,Math.max(r,e))}function Le(e){let t=Math.max(...e.map(e=>e.lo)),n=Math.min(...e.map(e=>e.hi));if(!(t>n))return{lo:t,hi:n}}function Re(e,t){return t===`left`||t===`right`?Fe(e.top,e.bottom):Fe(e.left,e.right)}function ze(e,t,n){let r=e.y>=n.top-J&&e.y<=n.bottom+J,i=e.x>=n.left-J&&e.x<=n.right+J;if(F(e,t,J)&&r){if(Math.abs(e.x-n.left)<J)return`left`;if(Math.abs(e.x-n.right)<J)return`right`}if(P(e,t,J)&&i){if(Math.abs(e.y-n.top)<J)return`top`;if(Math.abs(e.y-n.bottom)<J)return`bottom`}}function Be(e){return e===`left`||e===`right`}function Ve(e,t,n,r,i){let a=[],o=n?ze(e,t,n):void 0,s=r?ze(t,e,r):void 0;return n&&o&&Be(o)===i&&a.push(Re(n,o)),r&&s&&Be(s)===i&&a.push(Re(r,s)),a.length>0?Le(a):void 0}function He(e,t,n,r,i){let a=Ve(e,t,n,r,i);if(!a)return;let o=i?e.y:e.x,s=Math.min(a.hi,Math.max(a.lo,o));if(!(Math.abs(s-o)<J))return i?[{x:e.x,y:s},{x:t.x,y:s}]:[{x:s,y:e.y},{x:s,y:t.y}]}function Ue(e,t,n){if(e.length!==2)return e;let[r,i]=e;return F(r,i,J)?He(r,i,t,n,!0)??e:P(r,i,J)?He(r,i,t,n,!1)??e:e}function We(e,t,n){return Be(n)?{x:e.x,y:Ie(e.y,t.top,t.bottom)}:{x:Ie(e.x,t.left,t.right),y:e.y}}function Ge(e,t,n,r,i,a){let o=e.map(e=>({...e}));for(let s=t;s>=0&&s<e.length;s+=n){let t=e[s];if(a&&!F(t,r,J)||!a&&!P(t,r,J))break;a?o[s].y=i.y:o[s].x=i.x}return o}function Ke(e,t,n){if(e.length<2)return e;let r=n?0:e.length-1,i=n?1:-1,a=e[r],o=Pe(e,r,i);if(!o)return e;let s=ze(a,o,t);if(!s)return e;let c=Be(s),l=We(a,t,s);return N(a,l,J)?e:Ge(e,r,i,a,l,c)}function qe(e,t,n){let r=Math.min(e.x,t.x)>=n.left-J&&Math.max(e.x,t.x)<=n.right+J,i=Math.min(e.y,t.y)>=n.top-J&&Math.max(e.y,t.y)<=n.bottom+J;if(Math.abs(e.y-n.top)<J&&Math.abs(t.y-n.top)<J&&r)return`top`;if(Math.abs(e.y-n.bottom)<J&&Math.abs(t.y-n.bottom)<J&&r)return`bottom`;if(Math.abs(e.x-n.left)<J&&Math.abs(t.x-n.left)<J&&i)return`left`;if(Math.abs(e.x-n.right)<J&&Math.abs(t.x-n.right)<J&&i)return`right`}function Je(e,t,n,r){switch(e){case`top`:return P(t,n,J)&&n.y<r.top-J;case`bottom`:return P(t,n,J)&&n.y>r.bottom+J;case`left`:return F(t,n,J)&&n.x<r.left-J;case`right`:return F(t,n,J)&&n.x>r.right+J}}function Ye(e,t,n){if(e.length<3)return e;if(n){let n=qe(e[0],e[1],t);return n&&Je(n,e[1],e[2],t)?e.slice(1):e}let r=e.length-1,i=qe(e[r-1],e[r],t);return i&&Je(i,e[r-1],e[r-2],t)?e.slice(0,r):e}function Xe(e,t,n){let r=e;if(t){let e=Pe(r,0,1);if(e){let n=Ne(e,r[0],t);n!==r[0]&&(r=[n,...r.slice(1)])}r=Ye(r,t,!0)}if(n){let e=r.length-1,t=Pe(r,e,-1);if(t){let i=Ne(t,r[e],n,!0);i!==r[e]&&(r=[...r.slice(0,e),i])}r=Ye(r,n,!1)}let i=Ue(r,t,n);return i!==r||r.length===2?i:(t&&(r=Ke(r,t,!0)),n&&(r=Ke(r,n,!1)),r)}function Ze(e,t){for(let n of e){let e=ke(n,t,2);if(!e)continue;let r=Xe(V(e.points,J),e.srcRect,e.dstRect);if(r.length<3){e.edge.points=r;continue}let i=[r[0],{...r[0]},...r.slice(1,-1),r[r.length-1],{...r[r.length-1]}];e.edge.points=i}}function Qe(e){return new Map(e.map(e=>[e.id,e]))}function $e(e,t){let n=e.parentId,r=null;for(;n;){let e=t.get(n);if(!e?.isGroup)break;r=e.id,n=e.parentId}return r}function et(e,t){let n=0,r=e.parentId;for(;r;){let e=t.get(r);if(!e?.isGroup)break;n++,r=e.parentId}return n}function tt(e){let t=1/0,n=-1/0,r=1/0,i=-1/0;for(let a of e){let e=a.x,o=a.y;if(typeof e!=`number`||typeof o!=`number`)continue;let s=a.width??0,c=a.height??0;t=Math.min(t,e-s/2),n=Math.max(n,e+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}return t===1/0||r===1/0?null:{minX:t,maxX:n,minY:r,maxY:i}}function nt(e,t){let n=e.padding??20;e.x=(t.minX+t.maxX)/2,e.y=(t.minY+t.maxY)/2,e.width=Math.max(0,t.maxX-t.minX)+n,e.height=Math.max(0,t.maxY-t.minY)+n}function rt(e){let t=Qe(e),n=e.filter(e=>e.isGroup&&e.parentId).sort((e,n)=>et(n,t)-et(e,t));for(let t of n){let n=tt(e.filter(e=>e.parentId===t.id));n&&nt(t,n)}}function it(e,n){let r=e.nodes??[],i=e.edges??[],a=r.filter(e=>!e.isGroup),o=1/0,s=-1/0;for(let e of a){let t=e[n];typeof t==`number`&&(o=Math.min(o,t),s=Math.max(s,t))}if(!Number.isFinite(o)||!Number.isFinite(s))return!1;let c=/* @__PURE__ */ t(e=>o+s-e,`mirror`);for(let e of r){let t=e[n];typeof t==`number`&&(e[n]=c(t));let r=e.groupTitleRect;r&&(e.groupTitleRect=n===`x`?{...r,left:c(r.right),right:c(r.left)}:{...r,top:c(r.bottom),bottom:c(r.top)})}for(let e of i)for(let t of e.points??[])t[n]=c(t[n]);return!0}function at(e){return!(e.nodes??[]).some(e=>!e.isGroup)||it(e,`y`)}function ot(e,t=`LR`){let n=e.nodes??[],r=e.edges??[],i=n.filter(e=>!e.isGroup),a=1/0,o=1/0;for(let e of i){let t=e.x??0,n=e.y??0;t<a&&(a=t),n<o&&(o=n)}if(!Number.isFinite(a)||!Number.isFinite(o))return!1;let s=0,c=0;for(let e of i)s+=e.width??0,c+=e.height??0;let l=s/i.length,u=c/i.length,d=u>0?Math.max(1,l/u):1;for(let e of i){let t=e.x??0,n=((e.y??0)-o)*d+36,r=t-a;e.x=n,e.y=r}for(let e of r)if(e.points)for(let t of e.points){let e=t.x,n=(t.y-o)*d+36,r=e-a;t.x=n,t.y=r}rt(n);let f=n.filter(e=>e.isGroup&&!e.parentId);if(f.length===0)return t===`RL`&&it(e,`x`),!0;let p=Qe(n),m=/* @__PURE__ */ new Map;for(let e of n){if(e.isGroup)continue;let t=$e(e,p);if(!t)continue;let n=m.get(t)??[];n.push(e),m.set(t,n)}let h=0;for(let e of f){let t=e.padding??0;t>h&&(h=t)}let g=[],_=1/0,v=-1/0;for(let e of f){let t=tt(m.get(e.id)??[]);t&&(_=Math.min(_,t.minX),v=Math.max(v,t.maxX),g.push({lane:e,contentTop:t.minY,contentBottom:t.maxY,centerY:(t.minY+t.maxY)/2}))}if(_===1/0||v===-1/0)return!0;let y=Math.max(0,v-_)+2*Math.max(h,10),b=36+y,x=(_+v)/2-y/2-36,S=x+b/2,C=Math.max(h,36);g.sort((e,t)=>e.centerY-t.centerY);for(let e=0;e<g.length;e++){let t=g[e],n,r;if(n=e===0?t.contentTop-C:(g[e-1].contentBottom+t.contentTop)/2,e===g.length-1)r=t.contentBottom+C;else{let n=g[e+1];r=(t.contentBottom+n.contentTop)/2}let i=Math.max(0,r-n),a=(n+r)/2;t.lane.x=S,t.lane.y=a,t.lane.width=b,t.lane.height=i,t.lane.swimlaneContentTop=t.contentTop,t.lane.groupTitleRect={left:x,right:x+36,top:n,bottom:r}}return t===`RL`&&it(e,`x`),!0}function st(e,t){let{nodeInfoById:n,realNodeRects:r}=ge(t);for(let t of e){if(t.isLayoutOnly)continue;let i=t.points;if(!i||i.length<4)continue;let a=H(V(i,Qn),Qn);if(!a)continue;let{p3:o}=a,s=a.kind===`HVH`,c=ye(t,n,Qn);if(!c)continue;let{srcId:l,dstId:u,srcInfo:d,dstInfo:f,collinearX:p,collinearY:m}=c;if(p||m)continue;let h,g=d.rect;for(let n of er){let i,a,c;if(s){let e=f.cy>d.cy?g.bottom:g.top,t=d.cx+n;if(t<=g.left+Qn||t>=g.right-Qn)continue;i={x:t,y:e},a={x:t,y:o.y},c={x:o.x,y:o.y}}else{let e=f.cx>d.cx?g.right:g.left,t=d.cy+n;if(t<=g.top+Qn||t>=g.bottom-Qn)continue;i={x:e,y:t},a={x:o.x,y:t},c={x:o.x,y:o.y}}let p=N(i,a,Qn),m=N(a,c,Qn);if(p&&m||!p&&K(i,a,r,[l],1)||!m&&K(a,c,r,[u],1))continue;let _=!p&&Se(i,a,e,t,{epsilon:Qn,skipDegenerateOther:!0}),v=!m&&Se(a,c,e,t,{epsilon:Qn,skipDegenerateOther:!0});if(!(_||v)){h=p?[a,c]:m?[i,a]:[i,a,c];break}}h&&(t.points=h)}}function ct(e,n){let r=.001,{realNodeRects:i,labelNodeRects:a}=_e(n.values());for(let o of e){if(o.isLayoutOnly)continue;let s=o.points;if(!s||s.length<4)continue;let c=V(s,r);if(c.length<4)continue;let l=c.length-1,u=c[l],d=c[l-1],f=c[l-2],p=u.x-d.x,m=u.y-d.y,h=Math.hypot(p,m);if(h>=10||h<r)continue;let g=d.x-f.x,_=d.y-f.y;if(Math.hypot(g,_)<r)continue;let v=I(d,u,r),y=L(d,u,r),b=I(f,d,r),x=L(f,d,r);if(!(v&&x||y&&b))continue;let S=o.end,C=o.start,w=S?n.get(S):void 0;if(!w)continue;let T=w.x??0,E=w.y??0,D=U(w);if(!D)continue;let O,k;if(x){let e=_<0;O={x:T,y:f.y},k={x:T,y:e?D.bottom:D.top}}else{let e=g>0;O={x:f.x,y:E},k={x:e?D.right:D.left,y:E}}if(K(O,k,i,S?[S]:[],-2)||K(O,k,a,[],-2))continue;if(C){let e=n.get(C),t=e?U(e):void 0;if(t&&ue(O,t,2))continue}let A=/* @__PURE__ */ t((e,t)=>`${e.x.toFixed(3)},${e.y.toFixed(3)}|${t.x.toFixed(3)},${t.y.toFixed(3)}`,`ownSegmentKey`),j=/* @__PURE__ */ new Set;for(let e=0;e<c.length-1;e++)j.add(A(c[e],c[e+1]));let ee=/* @__PURE__ */ t((t,n)=>{for(let i of e){if(i===o||i.isLayoutOnly)continue;let e=i.points;if(!(!e||e.length<2))for(let i=0;i<e.length-1;i++){let a=e[i],o=e[i+1];if(!j.has(A(a,o))&&Ce(t,n,a,o,r))return!0}}return!1},`segmentCrossesOtherEdge`);if(ee(O,k))continue;if(l-3>=0){let e=c[l-3],t=[C,S].filter(e=>!!e);if(K(e,O,i,t,-2)||ee(e,O))continue}let te=[...c.slice(0,l-2),O,k];o.points=te;let M=o.labelNodeId;if(M){let e=n.get(M);if(e){let t=e.width??0,n=e.height??0;if(t>0&&n>0){let i,a,o=-1;for(let e=0;e<te.length-1;e++){let s=te[e],c=te[e+1],l=Math.hypot(c.x-s.x,c.y-s.y),u=F(s,c,r),d=P(s,c,r);(u&&l>=t+2||d&&l>=n+2)&&l>o&&(o=l,i=(s.x+c.x)/2,a=(s.y+c.y)/2)}i!==void 0&&a!==void 0&&(e.x=i,e.y=a)}}}}}function lt(e,n){let r=/* @__PURE__ */ t((e,t)=>{let n=e.x??0,r=e.y??0,i=t.x-n,a=t.y-r,o=(e.width??0)/2,s=(e.height??0)/2;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),{x:n+(a===0?0:s*i/a),y:r+s}):(i<0&&(o=-o),{x:n+o,y:r+(i===0?0:o*a/i)})},`rectIntersect`),i=/* @__PURE__ */ t((e,t)=>{let i=V(e.points??[]);if(i.length<2)return;let a=t?e.start:e.end,o=a?n.get(a):void 0,s=o?U(o):void 0;if(!o||!a||!s)return;let c=t?i[0]:i[i.length-1],l=t?i[1]:i[i.length-2],u=r(o,c),d=c;if(tr(l,u)&&(d=l),P(u,d,Y))return{edge:e,edgeId:String(e.id??``),nodeId:a,atStart:t,orientation:`V`,coord:u.x,min:Math.min(u.y,d.y),max:Math.max(u.y,d.y),boundary:u,railEnd:d,rect:s};if(F(u,d,Y))return{edge:e,edgeId:String(e.id??``),nodeId:a,atStart:t,orientation:`H`,coord:u.y,min:Math.min(u.x,d.x),max:Math.max(u.x,d.x),boundary:u,railEnd:d,rect:s}},`terminalLaneFor`),a=/* @__PURE__ */ t((e,t)=>Math.max(0,Math.min(e.max,t.max)-Math.max(e.min,t.min)),`projectedOverlapLength`),o=/* @__PURE__ */ t((e,t)=>e.nodeId!==t.nodeId||e.orientation!==t.orientation?!1:e.orientation===`H`?(Math.abs(e.boundary.x-e.rect.left)<1||Math.abs(e.boundary.x-e.rect.right)<1)&&P(e.boundary,t.boundary,1):(Math.abs(e.boundary.y-e.rect.top)<1||Math.abs(e.boundary.y-e.rect.bottom)<1)&&F(e.boundary,t.boundary,1),`sameTerminalFace`),s=/* @__PURE__ */ t((e,t)=>e.nodeId!==t.nodeId||e.orientation!==t.orientation?!1:a(e,t)>=X&&Math.abs(e.coord-t.coord)<.5,`exactTerminalLaneConflict`),c=/* @__PURE__ */ t((e,t)=>{if(e.nodeId!==t.nodeId||e.orientation!==t.orientation||e.orientation!==`H`||e.atStart===t.atStart)return!1;let n=a(e,t);if(n<X)return!1;let r=e.rect.bottom-e.rect.top;return n<r||n>2*r?!1:o(e,t)&&Math.abs(e.coord-t.coord)<16},`nearTerminalLaneConflict`),l=/* @__PURE__ */ t((e,n)=>{let r=V(e.edge.points??[]);if(r.length<2)return;let i=e.orientation===`V`?{x:e.boundary.x+n,y:e.boundary.y}:{x:e.boundary.x,y:e.boundary.y+n},a=e.orientation===`V`?{x:e.railEnd.x+n,y:e.railEnd.y}:{x:e.railEnd.x,y:e.railEnd.y+n};if(!(/* @__PURE__ */ t(()=>Math.abs(e.boundary.y-e.rect.top)<1||Math.abs(e.boundary.y-e.rect.bottom)<1?F(i,e.boundary,Y)&&i.x>=e.rect.left+1&&i.x<=e.rect.right-1:Math.abs(e.boundary.x-e.rect.left)<1||Math.abs(e.boundary.x-e.rect.right)<1?P(i,e.boundary,Y)&&i.y>=e.rect.top+1&&i.y<=e.rect.bottom-1:!1,`boundaryStaysOnSameFace`))())return;if(e.atStart){let t=r.length>1&&N(r[1],e.railEnd,Y),n=r.slice(t?2:1),o=n[0];return o&&!tr(o,a)?void 0:[i,a,...n]}let o=r.length>1&&N(r[r.length-2],e.railEnd,Y),s=r.slice(0,o?-2:-1),c=s[s.length-1];if(!c||tr(c,a))return[...s,a,i]},`shiftedCandidate`),u=/* @__PURE__ */ t(e=>{let t=e.edge,r=V(t.points??[]);if(r.length!==2)return!1;let i=t.start,a=t.end,o=i?n.get(i):void 0,s=a?n.get(a):void 0;if(!o||!s)return!1;let c=o.x??0,l=o.y??0,u=s.x??0,d=s.y??0,[f,p]=r;return F(f,p,Y)&&Math.abs(l-d)<1&&Math.abs(c-u)>1||P(f,p,Y)&&Math.abs(c-u)<1&&Math.abs(l-d)>1},`laneIsStraightCollinearConnector`),d=[-7,7,-14,14,-21,21];for(let t=0;t<8;t++){let t=e.filter(e=>!e.isLayoutOnly).flatMap(e=>[i(e,!0),i(e,!1)]).filter(e=>!!e),n=!1;for(let e=0;e<t.length&&!n;e++)for(let r=e+1;r<t.length&&!n;r++){let a=t[e],o=t[r];if(a.edge===o.edge||!(s(a,o)||c(a,o)))continue;let f=!s(a,o),p=[a,o].sort((e,t)=>{let n=u(e),r=u(t);return n===r?Number(!t.atStart)-Number(!e.atStart):Number(n)-Number(r)});for(let e of p){for(let r of d){let a=l(e,r);if(!a)continue;let o=i({...e.edge,points:a},e.atStart);if(o&&!t.some(t=>t.edge!==e.edge&&(s(o,t)||f&&c(o,t)))){e.edge.points=a,n=!0;break}}if(n)break}}if(!n)return}}function ut(e,n){let{realNodeRects:r,labelNodeRects:i}=_e(n.values()),a=/* @__PURE__ */ t((t,n)=>{let a=t.start,o=t.end,s=Z(n);if(s.length!==n.length-1)return!1;let c=[a,o].filter(e=>!!e);for(let e of s)if(K(e.a,e.b,r,c,-2)||K(e.a,e.b,i,[],-2))return!1;for(let n of e){if(n===t||n.isLayoutOnly)continue;let e=n.points;if(!(!e||e.length<2)){for(let t of s)for(let n of Z(V(e)))if(z(t,n,.5)>=X||Ce(t.a,t.b,n.a,n.b,Y))return!1}}return!0},`candidateIsSafe`),o=/* @__PURE__ */ t((e,t)=>{if(t+4>=e.length)return;let n=e[t],r=e[t+1],i=e[t+2],a=e[t+3],o=e[t+4],s=I(n,r)&&L(r,i)&&I(i,a)&&L(a,o)&&P(n,a,Y)&&P(n,o,Y)&&P(r,i,Y)&&(r.x-n.x)*(a.x-i.x)<0,c=L(n,r)&&I(r,i)&&L(i,a)&&I(a,o)&&F(n,a,Y)&&F(n,o,Y)&&F(r,i,Y)&&(r.y-n.y)*(a.y-i.y)<0;if(s||c)return V([...e.slice(0,t+1),o,...e.slice(t+5)]);if(t+5>=e.length)return;let l=e[t+5],u=L(n,r)&&I(r,i)&&L(i,a)&&I(a,o)&&L(o,l)&&P(n,o,Y)&&P(n,l,Y)&&P(i,a,Y)&&(i.x-r.x)*(o.x-a.x)<0,d=I(n,r)&&L(r,i)&&I(i,a)&&L(a,o)&&I(o,l)&&F(n,o,Y)&&F(n,l,Y)&&F(i,a,Y)&&(i.y-r.y)*(o.y-a.y)<0;if(u||d)return V([...e.slice(0,t+1),l,...e.slice(t+6)])},`withoutDogleg`);for(let t=0;t<8;t++){let t=!1;for(let n of e){if(n.isLayoutOnly)continue;let e=V(n.points??[]);for(let r=0;r<=e.length-5;r++){let i=o(e,r);if(i&&a(n,i)){n.points=i,t=!0;break}}if(t)break}if(!t)return}}function dt(e,n){let{realNodeRects:r,labelNodeRects:i}=_e(n.values()),a=e.filter(e=>!e.isLayoutOnly),o=/* @__PURE__ */ t((e,t,n)=>V(e===t?n??[]:e.points??[]),`pointsFor`),s=/* @__PURE__ */ t((e,t)=>{let n=0;for(let r=0;r<a.length;r++){let i=Z(o(a[r],e,t));for(let s=r+1;s<a.length;s++){let r=Z(o(a[s],e,t));for(let e of i)for(let t of r)Ce(e.a,e.b,t.a,t.b,Y)&&n++}}return n},`strictCrossingCount`),c=/* @__PURE__ */ t(e=>{let t=Z(e);if(t.length!==3)return;let n=t[1];if(t[0].horizontal!==n.horizontal&&t[2].horizontal!==n.horizontal)return{index:n.index,horizontal:n.horizontal,vertical:n.vertical,segment:n}},`middleRail`),l=/* @__PURE__ */ t((e,t)=>{let n=[e.start,e.end].filter(e=>!!e);return r.filter(e=>{if(n.includes(e.id))return!1;let r=e.rect;return t.horizontal?R(t.a.x,t.b.x,r.left,r.right)>=X&&t.a.y>=r.top-2&&t.a.y<=r.bottom+2:R(t.a.y,t.b.y,r.top,r.bottom)>=X&&t.a.x>=r.left-2&&t.a.x<=r.right+2})},`blockingRectsFor`),u=/* @__PURE__ */ t((e,t,n)=>{let r=e.map(e=>({...e}));if(t.horizontal)r[t.index].y=n,r[t.index+1].y=n;else if(t.vertical)r[t.index].x=n,r[t.index+1].x=n;else return;let i=Oe(V(r));return Z(i).length===i.length-1?i:void 0},`candidateByMovingRail`),d=/* @__PURE__ */ t((e,t,n)=>{let c=[e.start,e.end].filter(e=>!!e),l=Z(t);if(l.length!==t.length-1)return!1;for(let e of l)if(K(e.a,e.b,r,c,-2)||K(e.a,e.b,i,[],-2))return!1;for(let t of a)if(t!==e){for(let e of l)for(let n of Z(o(t)))if(z(e,n,.5)>=X)return!1}return s(e,t)<=n},`candidateIsSafe`);for(let e=0;e<8;e++){let e=s(),t=!1;for(let n of a){let r=o(n),i=c(r);if(!i)continue;let a=l(n,i.segment);if(a.length===0)continue;let s=i.horizontal?[Math.min(...a.map(e=>e.rect.top))-20,Math.max(...a.map(e=>e.rect.bottom))+20]:[Math.min(...a.map(e=>e.rect.left))-20,Math.max(...a.map(e=>e.rect.right))+20];for(let a of s){let o=u(r,i.segment,a);if(o&&d(n,o,e)){n.points=o,t=!0;break}}if(t)break}if(!t)return}}function ft(e,n){let r=/* @__PURE__ */ t(e=>{let t=e.groupTitleRect;if(!(!t||typeof t.left!=`number`||typeof t.right!=`number`||typeof t.top!=`number`||typeof t.bottom!=`number`||!Number.isFinite(t.left)||!Number.isFinite(t.right)||!Number.isFinite(t.top)||!Number.isFinite(t.bottom)||t.right<=t.left||t.bottom<=t.top))return{left:t.left,right:t.right,top:t.top,bottom:t.bottom}},`validTitleRect`),i=/* @__PURE__ */ t(e=>{if(!e.isGroup||e.parentId)return;let t=e.direction,n=typeof t==`string`?t.toUpperCase():``;if(n===`LR`||n===`RL`||n===`BT`)return;let i=r(e),a=e.y,o=e.height;if(!i||typeof a!=`number`||typeof o!=`number`||!Number.isFinite(a)||!Number.isFinite(o)||o<=0)return;let s=i.right-i.left,c=i.bottom-i.top;if(!(c<=0||s<c))return{node:e,rect:i}},`topLaneTitleFor`),a=/* @__PURE__ */ t((e,t)=>{if(!e.horizontal)return!1;let n=e.a.y;return n<=t.top+Y||n>=t.bottom-Y?!1:R(e.a.x,e.b.x,t.left,t.right)>=X},`horizontalSegmentIntersectsTitle`),o=[...n.values()].map(i).filter(e=>!!e);if(o.length===0)return;let s=0;for(let t of e){if(t.isLayoutOnly)continue;let e=V(t.points??[]);for(let t of Z(e))for(let e of o)a(t,e.rect)&&(s=Math.max(s,e.rect.bottom-t.a.y+4))}if(!(s<=Y))for(let e of o){let t=e.node.y,n=e.node.height;typeof t!=`number`||typeof n!=`number`||!Number.isFinite(t)||!Number.isFinite(n)||n<=0||(e.node.y=t-s/2,e.node.height=n+s,e.node.groupTitleRect={...e.rect,top:e.rect.top-s,bottom:e.rect.bottom-s})}}function pt(e,n){let r=/* @__PURE__ */ t(e=>{let t=e.groupTitleRect;if(!(!t||typeof t.left!=`number`||typeof t.right!=`number`||typeof t.top!=`number`||typeof t.bottom!=`number`||!Number.isFinite(t.left)||!Number.isFinite(t.right)||!Number.isFinite(t.top)||!Number.isFinite(t.bottom)||t.right<=t.left||t.bottom<=t.top))return{left:t.left,right:t.right,top:t.top,bottom:t.bottom}},`validTitleRect`),i=/* @__PURE__ */ t(e=>{if(!e.isGroup||e.parentId||e.direction!==`LR`)return;let t=r(e),n=e.x,i=e.width;if(!t||typeof n!=`number`||typeof i!=`number`||!Number.isFinite(n)||!Number.isFinite(i)||i<=0)return;let a=t.right-t.left,o=t.bottom-t.top;if(!(a<=0||o<a))return{node:e,rect:t}},`leftLaneTitleFor`),a=/* @__PURE__ */ t((e,t)=>{if(!e.vertical)return!1;let n=e.a.x;return n<=t.left+Y||n>=t.right-Y?!1:R(e.a.y,e.b.y,t.top,t.bottom)>=X},`verticalSegmentIntersectsTitle`),o=/* @__PURE__ */ t((e,t)=>{if(!e.horizontal)return!1;let n=e.a.y;return n<=t.top+Y||n>=t.bottom-Y?!1:R(e.a.x,e.b.x,t.left,t.right)>=X},`horizontalSegmentIntersectsTitle`),s=[...n.values()].map(i).filter(e=>!!e);if(s.length===0)return;let c=0;for(let t of e){if(t.isLayoutOnly)continue;let e=V(t.points??[]);for(let t of Z(e))for(let e of s)if(a(t,e.rect))c=Math.max(c,e.rect.right-t.a.x+4);else if(o(t,e.rect)){let n=Math.min(t.a.x,t.b.x);c=Math.max(c,e.rect.right-n+4)}}if(!(c<=Y))for(let e of s){let t=e.node.x,n=e.node.width;typeof t!=`number`||typeof n!=`number`||!Number.isFinite(t)||!Number.isFinite(n)||n<=0||(e.node.x=t-c/2,e.node.width=n+c,e.node.groupTitleRect={...e.rect,left:e.rect.left-c,right:e.rect.right-c})}}function mt(e,n){let{realNodeRects:r}=_e(n.values()),i=e.filter(e=>!e.isLayoutOnly),a=/* @__PURE__ */ t((e,t=/* @__PURE__ */ new Map)=>V(t.get(e)??e.points??[]),`replacementPointsFor`),o=/* @__PURE__ */ t((e=/* @__PURE__ */ new Map)=>{let t=0;for(let n=0;n<i.length;n++){let r=Z(a(i[n],e));for(let o=n+1;o<i.length;o++){let n=Z(a(i[o],e));for(let e of r)for(let r of n)Ce(e.a,e.b,r.a,r.b,Y)&&t++}}return t},`crossingCount`),s=/* @__PURE__ */ t((e=/* @__PURE__ */ new Map)=>i.reduce((t,n)=>t+B(a(n,e)),0),`totalBends`),c=/* @__PURE__ */ t(e=>{let t=a(e);if(t.length<4)return;let n=t[t.length-2],r=t[t.length-1];if(I(n,r,Y)||L(n,r,Y))return{tailStart:n,terminal:r}},`terminalTailFor`),l=/* @__PURE__ */ t((e,t)=>{let n=a(e);if(n.length<3)return;let r=n[0],i=n[1],o;if(I(r,i,Y))o={x:i.x,y:t.tailStart.y};else if(L(r,i,Y))o={x:t.tailStart.x,y:i.y};else return;let s=Oe(V([r,i,o,t.tailStart,t.terminal]));return Z(s).length===s.length-1?s:void 0},`candidateWithDestinationTail`),u=/* @__PURE__ */ t((e,t)=>{let n=[e.start,e.end].filter(e=>!!e);for(let e of Z(t))if(K(e.a,e.b,r,n,-2))return!0;return!1},`pathHasNodeHit`),d=/* @__PURE__ */ t((e,t,n)=>{for(let r of i)if(r!==e){for(let e of Z(t))for(let t of Z(a(r,n)))if(z(e,t,.5)>=X)return!0}return!1},`pathHasSharedTrack`),f=/* @__PURE__ */ t((e,t,n)=>!u(e,t)&&!d(e,t,n),`candidateIsSafe`),p=/* @__PURE__ */ t(()=>{let e=/* @__PURE__ */ new Map;for(let t of i){let r=t.end;if(!r||!n.has(r)||a(t).length<4)continue;let i=e.get(r)??[];i.push(t),e.set(r,i)}return e},`edgesByDestination`);for(let e=0;e<4;e++){let e=o();if(e===0)return;let t=s(),n,r=e,i=t;for(let t of p().values())for(let a=0;a<t.length;a++)for(let u=a+1;u<t.length;u++){let d=t[a],p=t[u],m=c(d),h=c(p);if(!m||!h)continue;let g=l(d,h),_=l(p,m);if(!g||!_)continue;let v=/* @__PURE__ */ new Map([[d,g],[p,_]]);if(!f(d,g,v)||!f(p,_,v))continue;let y=o(v),b=s(v);y>=e||y>r||y===r&&b>=i||(n=v,r=y,i=b)}if(!n)return;for(let[e,t]of n)e.points=t}}function ht(e,n){let{realNodeRects:r,labelNodeRects:i}=_e(n.values()),a=e.filter(e=>!e.isLayoutOnly),o=/* @__PURE__ */ t((e,t=/* @__PURE__ */ new Map)=>V(t.get(e)??e.points??[]),`replacementPointsFor`),s=/* @__PURE__ */ t((e=/* @__PURE__ */ new Map)=>{let t=0;for(let n=0;n<a.length;n++){let r=Z(o(a[n],e));for(let i=n+1;i<a.length;i++){let n=Z(o(a[i],e));for(let e of r)for(let r of n)Ce(e.a,e.b,r.a,r.b,Y)&&t++}}return t},`strictCrossingCount`),c=/* @__PURE__ */ t((e=/* @__PURE__ */ new Map)=>a.reduce((t,n)=>t+B(o(n,e)),0),`totalBends`),l=/* @__PURE__ */ t(e=>{let t=e.start,r=e.end,i=t?n.get(t):void 0,a=r?n.get(r):void 0,o=i?U(i):void 0,s=a?U(a):void 0;return o&&s?{src:o,dst:s}:void 0},`endpointRectsFor`),u=/* @__PURE__ */ t((e,t,n)=>{if(n.index<=0||n.index+1>=t.length-1)return;let r=l(e);if(r){if(n.vertical){let i=n.a.x,a=Math.min(r.src.left,r.dst.left),o=Math.max(r.src.right,r.dst.right),s=i<a-Y?`left`:i>o+Y?`right`:void 0;return s?{edge:e,points:t,segmentIndex:n.index,axis:`vertical`,side:s,coord:i,min:Math.min(n.a.y,n.b.y),max:Math.max(n.a.y,n.b.y)}:void 0}if(n.horizontal){let i=n.a.y,a=Math.min(r.src.top,r.dst.top),o=Math.max(r.src.bottom,r.dst.bottom),s=i<a-Y?`top`:i>o+Y?`bottom`:void 0;return s?{edge:e,points:t,segmentIndex:n.index,axis:`horizontal`,side:s,coord:i,min:Math.min(n.a.x,n.b.x),max:Math.max(n.a.x,n.b.x)}:void 0}}},`externalRailForSegment`),d=/* @__PURE__ */ t(()=>{let e=[];for(let t of a){let n=o(t);for(let r of Z(n)){let i=u(t,n,r);i&&e.push(i)}}return e},`collectExternalRails`),f=/* @__PURE__ */ t((e,t)=>e.edge!==t.edge&&e.axis===t.axis&&e.side===t.side&&R(e.min,e.max,t.min,t.max)>=X,`railsInteract`),p=/* @__PURE__ */ t(e=>{let t=[],n=/* @__PURE__ */ new Set;for(let r of e){if(n.has(r))continue;let i=[r],a=[];for(n.add(r);i.length>0;){let t=i.pop();a.push(t);for(let r of e)!n.has(r)&&f(t,r)&&(n.add(r),i.push(r))}a.length>1&&t.push(a)}return t},`connectedComponents`),m=/* @__PURE__ */ t(e=>{let t=[];for(let n of e)t.some(e=>Math.abs(e-n.coord)<Y)||t.push(n.coord);for(;t.length<e.length;){let n=Math.min(...t),r=Math.max(...t),i=e[0].side;t.push(i===`left`||i===`top`?n-12*(e.length-t.length):r+12*(e.length-t.length))}return t},`uniqueCoordsFor`),h=/* @__PURE__ */ t(e=>{let n=e.map(e=>e.coord),r=m(e),i=[];if(e.length<=6){let a=Array(r.length).fill(!1),o=[],s=/* @__PURE__ */ t(()=>{if(o.length===e.length)o.some((e,t)=>Math.abs(e-n[t])>=Y)&&i.push([...o]);else for(let[e,t]of r.entries())a[e]||(a[e]=!0,o.push(t),s(),o.pop(),a[e]=!1)},`visit`);return s(),i}for(let e=0;e<n.length;e++)for(let t=e+1;t<n.length;t++){let r=[...n];[r[e],r[t]]=[r[t],r[e]],i.push(r)}return i},`coordinateAssignmentsFor`),g=/* @__PURE__ */ t((e,t)=>{let n=/* @__PURE__ */ new Map;for(let[r,i]of e.entries()){let e=t[r],a=n.get(i.edge)??i.points.map(e=>({x:e.x,y:e.y}));i.axis===`vertical`?(a[i.segmentIndex].x=e,a[i.segmentIndex+1].x=e):(a[i.segmentIndex].y=e,a[i.segmentIndex+1].y=e),n.set(i.edge,a)}let r=/* @__PURE__ */ new Map;for(let[e,t]of n){let n=Oe(V(t));if(Z(n).length!==n.length-1)return;r.set(e,n)}return r},`replacementsForAssignment`),_=/* @__PURE__ */ t(e=>{for(let[t,n]of e){let e=[t.start,t.end].filter(e=>!!e);for(let t of Z(n))if(K(t.a,t.b,r,e,-2)||K(t.a,t.b,i,[],-2))return!1}for(let t=0;t<a.length;t++){let n=a[t],r=e.has(n),i=Z(o(n,e));for(let n=t+1;n<a.length;n++){let t=a[n];if(!r&&!e.has(t))continue;let s=Z(o(t,e));for(let e of i)for(let t of s)if(z(e,t,.5)>=X)return!1}}return!0},`candidateIsSafe`);for(let e=0;e<4;e++){let e=s();if(e===0)return;let t,n=e,r=c(),i=1/0;for(let a of p(d()))for(let o of h(a)){let l=g(a,o);if(!l||!_(l))continue;let u=s(l);if(u>=e)continue;let d=c(l),f=a.reduce((e,t,n)=>e+Math.abs(o[n]-t.coord),0);u>n||u===n&&(d>r||d===r&&f>=i)||(t=l,n=u,r=d,i=f)}if(!t)return;for(let[e,n]of t)e.points=n}}function gt(e,n){let{realNodeRects:r,labelNodeRects:i}=_e(n.values()),a=e.filter(e=>!e.isLayoutOnly),o=/* @__PURE__ */ t((e,t,n)=>V(e===t?n??[]:e.points??[]),`pointsFor`),s=/* @__PURE__ */ t(e=>Z(e).reduce((e,t)=>{let n=t.a.x-t.b.x,r=t.a.y-t.b.y;return e+Math.hypot(n,r)},0),`pathLength`),c=/* @__PURE__ */ t((e,t)=>{let n=0;for(let r=0;r<a.length;r++){let i=Z(o(a[r],e,t));for(let s=r+1;s<a.length;s++){let r=Z(o(a[s],e,t));for(let e of i)for(let t of r)Ce(e.a,e.b,t.a,t.b,Y)&&n++}}return n},`strictCrossingCount`),l=/* @__PURE__ */ t((e,t)=>{if(e.horizontal){let n=e.a.y;return(Math.abs(n-t.top)<1||Math.abs(n-t.bottom)<1)&&R(e.a.x,e.b.x,t.left,t.right)>=X}if(e.vertical){let n=e.a.x;return(Math.abs(n-t.left)<1||Math.abs(n-t.right)<1)&&R(e.a.y,e.b.y,t.top,t.bottom)>=X}return!1},`segmentRunsAlongRectBorder`),u=/* @__PURE__ */ t(e=>{let t=[e.start,e.end].filter(e=>!!e),r=[];for(let e of t){let t=n.get(e),i=t?U(t):void 0;i&&r.push(i)}return r},`endpointRectsFor`),d=/* @__PURE__ */ t((e,t)=>{if(t+3>=e.length)return[];let n=e[t],r=e[t+1],i=e[t+2],a=e[t+3],o=I(n,r,Y)&&L(r,i,Y)&&I(i,a,Y),s=L(n,r,Y)&&I(r,i,Y)&&L(i,a,Y);if(!o&&!s||!(o?Math.sign(r.x-n.x)!==Math.sign(a.x-i.x):Math.sign(r.y-n.y)!==Math.sign(a.y-i.y)))return[];let c=P(n,a,Y)||F(n,a,Y)?[]:[{x:n.x,y:a.y},{x:a.x,y:n.y}],l=c.length===0?[[...e.slice(0,t+1),...e.slice(t+3)]]:c.map(n=>[...e.slice(0,t+1),n,...e.slice(t+3)]),u=/* @__PURE__ */ new Set;return l.map(e=>Oe(V(e))).filter(e=>{if(Z(e).length!==e.length-1||!e.some(e=>N(e,a,Y)))return!1;let t=e.map(e=>`${e.x.toFixed(3)},${e.y.toFixed(3)}`).join(`|`);return!u.has(t)&&(u.add(t),!0)})},`shortcutCandidatesAt`),f=/* @__PURE__ */ t((e,t,n)=>{let s=[e.start,e.end].filter(e=>!!e),d=u(e);for(let e of Z(t))if(K(e.a,e.b,r,s,-2)||K(e.a,e.b,i,[],-2)||d.some(t=>l(e,t)))return!1;for(let n of a)if(n!==e){for(let e of Z(t))for(let t of Z(o(n)))if(z(e,t,.5)>=X)return!1}return c(e,t)<=n},`candidateIsSafe`);for(let e=0;e<8;e++){let e=c(),t,n,r=e,i=1/0,l=1/0;for(let u of a){let a=o(u),p=B(a,Y),m=s(a);for(let o=0;o<=a.length-4;o++)for(let h of d(a,o)){let a=B(h,Y),o=s(h);if(!(a<p||a===p&&o<m-Y)||!f(u,h,e))continue;let d=c(u,h);d>r||d===r&&(a>i||a===i&&o>=l)||(t=u,n=h,r=d,i=a,l=o)}}if(!t||!n)return;t.points=n}}function _t(e,n){let r=[];for(let e of n.values()){if(e.isGroup||e.isEdgeLabel)continue;let t=e.x??0,n=e.y??0,i=U(e);i&&r.push({id:String(e.id??``),cx:t,cy:n,rect:i})}if(r.length===0)return;let i=new Map(r.map(e=>[e.id,e])),a=r.map(e=>({id:e.id,rect:e.rect})),o=[`top`,`bottom`,`left`,`right`],s={top:Math.min(...r.map(e=>e.rect.top))-20,bottom:Math.max(...r.map(e=>e.rect.bottom))+20,left:Math.min(...r.map(e=>e.rect.left))-20,right:Math.max(...r.map(e=>e.rect.right))+20},c=e.filter(e=>!e.isLayoutOnly),l=new Map(c.map((e,t)=>[e,t])),u=/* @__PURE__ */ t(e=>{let t=e===`left`||e===`top`?-1:1,n=[];for(let r=0;r<=2;r++)n.push(s[e]+t*20*r);return n},`outwardTracksForSide`),d=/* @__PURE__ */ t((e,t=/* @__PURE__ */ new Map)=>V(t.get(e)??e.points??[]),`replacementPointsFor`),f=/* @__PURE__ */ t((e,t)=>{let n=0;for(let r of e)for(let e of t)Ce(r.a,r.b,e.a,e.b,Y)&&n++;return n},`crossingCountBetweenSegments`),p=/* @__PURE__ */ t((e,t)=>f(Z(e),Z(t)),`crossingCountBetweenPaths`),m=/* @__PURE__ */ t((e=/* @__PURE__ */ new Map)=>{let n=0,r=[],i=/* @__PURE__ */ new Set,a=[],o=/* @__PURE__ */ t(e=>{i.has(e)||(i.add(e),a.push(e))},`addEdge`);for(let t=0;t<c.length;t++){let i=c[t],a=d(i,e);for(let s=t+1;s<c.length;s++){let t=c[s],l=p(a,d(t,e));l>0&&(n+=l,r.push({first:i,second:t,count:l}),o(i),o(t))}}return a.sort((e,t)=>(l.get(e)??0)-(l.get(t)??0)),{count:n,pairs:r,edgeSet:i,edges:a}},`crossingSnapshot`),h=/* @__PURE__ */ t((e,t)=>{let n=new Set(t.keys());if(n.size===0)return e.count;let r=0;for(let t of e.pairs)(n.has(t.first)||n.has(t.second))&&(r+=t.count);let i=0;for(let e=0;e<c.length;e++){let r=c[e],a=n.has(r),o=d(r,t);for(let r=e+1;r<c.length;r++){let e=c[r];(a||n.has(e))&&(i+=p(o,d(e,t)))}}return e.count-r+i},`crossingCountWithReplacements`),g=/* @__PURE__ */ t(e=>{let t=/* @__PURE__ */ new Map;for(let n of e.pairs){let e=t.get(n.first)??/* @__PURE__ */ new Set;e.add(n.second),t.set(n.first,e);let r=t.get(n.second)??/* @__PURE__ */ new Set;r.add(n.first),t.set(n.second,r)}let n=[],r=/* @__PURE__ */ new Set;for(let i of e.edges){if(r.has(i))continue;let e=[i],a=[];for(r.add(i);e.length>0;){let n=e.pop();a.push(n);for(let i of t.get(n)??[])r.has(i)||(r.add(i),e.push(i))}a.sort((e,t)=>(l.get(e)??0)-(l.get(t)??0)),a.length>1&&n.push(a)}return n},`crossingComponents`),_=/* @__PURE__ */ t(e=>[e.start,e.end].filter(e=>!!e),`endpointIdsFor`),v=/* @__PURE__ */ t(e=>{let t=[];for(let n of g(e)){let e=new Set(n),r=new Set(n.flatMap(e=>_(e))),i=[...n];for(let t of c)e.has(t)||_(t).some(e=>r.has(e))&&i.push(t);i.sort((e,t)=>(l.get(e)??0)-(l.get(t)??0)),t.push(i)}return t},`pairSearchGroups`),y=/* @__PURE__ */ t((e,t,n)=>h(e,/* @__PURE__ */ new Map([[t,n]])),`crossingCountWithSingleReplacement`),b=/* @__PURE__ */ t(e=>{let t=/* @__PURE__ */ new Map;for(let n of e.pairs)t.set(n.first,(t.get(n.first)??0)+n.count),t.set(n.second,(t.get(n.second)??0)+n.count);return t},`currentCrossingsByEdge`),x=/* @__PURE__ */ t(e=>e.slice(1).reduce((t,n,r)=>{let i=e[r];return t+Math.abs(n.x-i.x)+Math.abs(n.y-i.y)},0),`pathLength`),S=/* @__PURE__ */ t((e=/* @__PURE__ */ new Map)=>c.reduce((t,n)=>t+B(d(n,e)),0),`totalBends`),C=/* @__PURE__ */ t((e=/* @__PURE__ */ new Map)=>c.reduce((t,n)=>t+x(d(n,e)),0),`totalLength`),w=/* @__PURE__ */ t((e,t,n=/* @__PURE__ */ new Map)=>{let r=Z(t);for(let t of c)if(t!==e){for(let e of r)for(let r of Z(d(t,n)))if(z(e,r,.5)>=X)return!0}return!1},`pathHasSegmentConflict`),T=/* @__PURE__ */ t((e,t)=>{let n=[e.start,e.end].filter(e=>!!e);for(let e of Z(t))if(K(e.a,e.b,a,n,-2))return!0;return!1},`pathHitsNode`),E=/* @__PURE__ */ t((e,t)=>{let n=Oe(V(t));Z(n).length===n.length-1&&e.push(n)},`pushOrthogonalCandidate`),D=/* @__PURE__ */ t(e=>e===`left`||e===`right`,`sideIsHorizontal`),O=/* @__PURE__ */ t((e,t,n)=>{switch(t){case`left`:return Math.min(e.x,n.x)-20;case`right`:return Math.max(e.x,n.x)+20;case`top`:return Math.min(e.y,n.y)-20;case`bottom`:return Math.max(e.y,n.y)+20}},`localTrackForSameSide`),k=/* @__PURE__ */ t((e,t,n,r)=>{let i=n===`left`||n===`top`?-1:1,a=[O(t,n,r),s[n]];for(let o of a)for(let a=0;a<=2;a++)E(e,he(t,n,r,o+i*20*a))},`addSameSideCandidates`),A=/* @__PURE__ */ t((e,t,n,r,i)=>{for(let a of u(n))for(let n of u(i))E(e,[t,{x:a,y:t.y},{x:a,y:n},{x:r.x,y:n},r])},`addHorizontalToVerticalCandidates`),j=/* @__PURE__ */ t((e,t,n,r,i)=>{for(let a of u(n))for(let n of u(i))E(e,[t,{x:t.x,y:a},{x:n,y:a},{x:n,y:r.y},r])},`addVerticalToHorizontalCandidates`),ee=/* @__PURE__ */ t((e,t,n,r,i)=>{let a=[...u(`top`),...u(`bottom`)];for(let o of u(n))for(let n of u(i))for(let i of a)E(e,[t,{x:o,y:t.y},{x:o,y:i},{x:n,y:i},{x:n,y:r.y},r])},`addHorizontalPairCandidates`),te=/* @__PURE__ */ t((e,t,n,r,i)=>{let a=[...u(`left`),...u(`right`)];for(let o of u(n))for(let n of u(i))for(let i of a)E(e,[t,{x:t.x,y:o},{x:i,y:o},{x:i,y:n},{x:r.x,y:n},r])},`addVerticalPairCandidates`),M=/* @__PURE__ */ t(e=>{let t=/* @__PURE__ */ new Set;return e.map(e=>V(e)).filter(e=>{let n=e.map(e=>`${e.x.toFixed(3)},${e.y.toFixed(3)}`).join(`|`);return t.has(n)||e.length<2?!1:(t.add(n),!0)})},`dedupeCandidatePaths`),ne=/* @__PURE__ */ t((e,t,n,r)=>{let i=[],a=G(e,t,n,r,20,Y);a&&E(i,a),t===r&&k(i,e,t,n);let o=D(t),s=D(r);return o&&!s?A(i,e,t,n,r):!o&&s?j(i,e,t,n,r):o?ee(i,e,t,n,r):te(i,e,t,n,r),M(i)},`buildCandidatesForSides`),re=/* @__PURE__ */ t((e,t,n,r)=>{let i=[...u(`left`),...u(`right`)],a=[...u(`top`),...u(`bottom`)];for(let s of o){let o=W(r,s),c=s===`top`||s===`bottom`?u(s):a;for(let r of i){E(e,[t,n,{x:r,y:n.y},{x:r,y:o.y},o]);for(let i of c)E(e,[t,n,{x:r,y:n.y},{x:r,y:i},{x:o.x,y:i},o])}}},`addVerticalDepartureOuterTrackCandidates`),ie=/* @__PURE__ */ t((e,t,n,r)=>{let i=[...u(`left`),...u(`right`)],a=[...u(`top`),...u(`bottom`)];for(let s of o){let o=W(r,s),c=s===`left`||s===`right`?u(s):i;for(let r of a){E(e,[t,n,{x:n.x,y:r},{x:o.x,y:r},o]);for(let i of c)E(e,[t,n,{x:n.x,y:r},{x:i,y:r},{x:i,y:o.y},o])}}},`addHorizontalDepartureOuterTrackCandidates`),ae=/* @__PURE__ */ t(e=>{let t=e.start,n=e.end,r=n?i.get(n):void 0;if(!t||!r)return[];let a=V(e.points??[]);if(a.length<4)return[];let o=a[0],s=a[1],c=[];return L(o,s,Y)?re(c,o,s,r):I(o,s,Y)&&ie(c,o,s,r),c},`terminalPreservingOuterTrackCandidates`),oe=/* @__PURE__ */ t(e=>{let t=e.start,n=e.end,r=t?i.get(t):void 0,a=n?i.get(n):void 0;if(!r||!a)return[];let s=[];for(let e of o){let t=W(r,e);for(let n of o)s.push(...ne(t,e,W(a,n),n))}return s.push(...ae(e)),s},`candidatePathsFor`),se=/* @__PURE__ */ t(()=>new Map(c.map(e=>[e,Z(d(e))])),`currentSegmentsByEdge`),N=/* @__PURE__ */ t((e,t,n)=>{let r=/* @__PURE__ */ new Set;for(let i of c){if(i===e)continue;let a=n.get(i)??Z(d(i));t.some(e=>a.some(t=>z(e,t,.5)>=X))&&r.add(i)}return r},`sharedTrackConflictsFor`),P=/* @__PURE__ */ t((e,t,n,r)=>{let i=/* @__PURE__ */ new Set;return oe(e).map(e=>Oe(V(e))).filter(t=>{if(T(e,t))return!1;let n=t.map(e=>`${e.x.toFixed(3)},${e.y.toFixed(3)}`).join(`|`);return i.has(n)||t.length<2?!1:(i.add(n),!0)}).map(i=>{let a=Z(i),o=0;for(let t of c)t!==e&&(o+=f(a,n.get(t)??Z(d(t))));return{candidate:i,candidateSegments:a,crossings:t.count-(r.get(e)??0)+o,bends:B(i,Y),totalBends:B(i),length:x(i)}}).filter(({crossings:e})=>e<=t.count).sort((e,t)=>e.crossings-t.crossings||e.bends-t.bends||e.length-t.length).slice(0,48).map(t=>({path:t.candidate,segments:t.candidateSegments,sharedTrackConflicts:N(e,t.candidateSegments,n),totalBends:t.totalBends,length:t.length}))},`pairCandidatesFor`),F=/* @__PURE__ */ t((e,t,n,r,i,a)=>{let o=0;for(let n of e.pairs)(n.first===t||n.second===t||n.first===r||n.second===r)&&(o+=n.count);let s=f(n.segments,i.segments);for(let e of c){if(e===t||e===r)continue;let o=a.get(e)??Z(d(e));s+=f(n.segments,o)+f(i.segments,o)}return e.count-o+s},`pairCrossingCount`),R=/* @__PURE__ */ t((e,t)=>{for(let n of e.sharedTrackConflicts)if(n!==t)return!1;return!0},`conflictsOnlyWith`),ce=/* @__PURE__ */ t((e,t)=>e.segments.some(e=>t.segments.some(t=>z(e,t,.5)>=X)),`candidatesShareTrack`),H=/* @__PURE__ */ t((e,t,n,r)=>R(t,n.edge)&&R(r,e.edge)&&!ce(t,r),`pairCandidatesAreCompatible`),le=/* @__PURE__ */ t((e,t,n,r,i)=>{let a=F(e.current,t.edge,n,r.edge,i,e.baseSegments);if(!(a>=e.current.count))return{replacements:/* @__PURE__ */ new Map([[t.edge,n.path],[r.edge,i.path]]),crossings:a,bends:e.currentBends-(e.baseBendsByEdge.get(t.edge)??0)-(e.baseBendsByEdge.get(r.edge)??0)+n.totalBends+i.totalBends,length:e.currentLength-(e.baseLengthByEdge.get(t.edge)??0)-(e.baseLengthByEdge.get(r.edge)??0)+n.length+i.length}},`scorePairReplacement`),ue=/* @__PURE__ */ t((e,t)=>e.crossings<t.crossings||e.crossings===t.crossings&&(e.bends<t.bends||e.bends===t.bends&&e.length<t.length),`pairScoreIsBetter`),de=/* @__PURE__ */ t((e,t,n,r)=>{let i=r;for(let r of t.candidates)for(let a of n.candidates){if(!H(t,r,n,a))continue;let o=le(e,t,r,n,a);o&&ue(o,i)&&(i=o)}return i},`bestScoreForOptionPair`),fe=/* @__PURE__ */ t(e=>{let t=S(),n=C(),r=se(),i=b(e),a=new Map(c.map(e=>[e,B(d(e))])),o=new Map(c.map(e=>[e,x(d(e))])),s=/* @__PURE__ */ new Map,l=v(e);for(let t of l)for(let n of t){if(s.has(n))continue;let t=P(n,e,r,i);t.length>0&&s.set(n,{edge:n,candidates:t})}let u={replacements:/* @__PURE__ */ new Map,crossings:e.count,bends:t,length:n},f={current:e,currentBends:t,currentLength:n,baseBendsByEdge:a,baseLengthByEdge:o,baseSegments:r};for(let t of l){let n=new Set(t.filter(t=>e.edgeSet.has(t))),r=t.map(e=>s.get(e)).filter(e=>!!e);for(let e=0;e<r.length;e++){let t=r[e];for(let i=e+1;i<r.length;i++){let e=r[i];(n.has(t.edge)||n.has(e.edge))&&(u=de(f,t,e,u))}}}return u.replacements.size>0?u.replacements:void 0},`bestPairedReplacement`);for(let e=0;e<4;e++){let e=m(),t=e.count;if(t===0)return;let n,r,i=t,a=1/0;for(let o of e.edges){let s=B(d(o),Y);for(let c of oe(o)){let l=T(o,c),u=!l&&w(o,c),d=y(e,o,c),f=B(c,Y);l||u||(d<t||d===t&&f<s)&&(d>i||d===i&&f>=a||(n=o,r=c,i=d,a=f))}}if(n&&r){n.points=r;continue}let o=fe(e);if(!o)return;for(let[e,t]of o)e.points=t}}function vt(e,n){let{nodeInfoById:r,realNodeRects:i}=ge(n),a=[`top`,`bottom`,`left`,`right`],o={top:Math.min(...i.map(e=>e.rect.top))-20,bottom:Math.max(...i.map(e=>e.rect.bottom))+20,left:Math.min(...i.map(e=>e.rect.left))-20,right:Math.max(...i.map(e=>e.rect.right))+20},s=/* @__PURE__ */ t((e,t,n,r)=>{let i=[],a=G(e,t,n,r,20,nr);return a&&i.push(a),t===r&&i.push(he(e,t,n,o[t])),i},`buildOrthogonalPathCandidates`),c=/* @__PURE__ */ t((e,t)=>{for(let n=0;n<e.length-1;n++){let r=e[n],a=e[n+1];if(K(r,a,i,t,1))return!0}return!1},`pathHitsNode`),l=/* @__PURE__ */ t((t,n,r=!1)=>{let i=0,a=ce(t,nr),o=n.start,s=n.end;for(let t of e){if(t===n||t.isLayoutOnly)continue;let e=t.start,c=t.end;if(!r&&o&&s&&(e===o||e===s||c===o||c===s))continue;let l=t.points;if(!(!l||l.length<2))for(let e of a)for(let t of ce(l,nr))(be(e.a,e.b,t.a,t.b,nr,nr)||z(e,t,nr)>=rr)&&i++}return i},`pathConflictCount`),u=/* @__PURE__ */ t((e,t)=>{let n=Math.abs(e.y-t.rect.top),r=Math.abs(e.y-t.rect.bottom),i=Math.abs(e.x-t.rect.left),a=Math.abs(e.x-t.rect.right),o=`top`,s=n;return r<s&&(o=`bottom`,s=r),i<s&&(o=`left`,s=i),a<s&&(o=`right`,s=a),o},`nearestSideOfRect`),d=/* @__PURE__ */ new Map,f=/* @__PURE__ */ t((e,t,n)=>{let r=d.get(e)??[];r.push({side:t,edgeId:n}),d.set(e,r)},`addFaceClaim`);for(let t of e){if(t.isLayoutOnly)continue;let e=t.points??[];if(e.length<1)continue;let n=t.id??``,i=t.start,a=t.end;if(i){let t=r.get(i);t&&f(i,u(e[0],t),n)}if(a){let t=r.get(a);t&&f(a,u(e[e.length-1],t),n)}}let p=/* @__PURE__ */ t((e,t,n)=>d.get(e)?.some(e=>e.edgeId!==n&&e.side===t)??!1,`faceIsClaimed`);for(let t of e){if(t.isLayoutOnly)continue;let e=t.points;if(!e||e.length<2)continue;let n=B(e,nr);if(n<4)continue;let i=t.start,o=t.end;if(!i||!o)continue;let m=r.get(i),h=r.get(o);if(!m||!h)continue;let g=t.id??``,_=l(e,t,!0),v=l(e,t),y,b=_,x=n;for(let e of a){if(p(i,e,g))continue;let n=W(m,e);for(let r of a){if(p(o,r,g))continue;let a=W(h,r);for(let u of s(n,e,a,r)){if(c(u,[i,o]))continue;let e=B(u,nr);if(_>0){let n=l(u,t,!0);if(n>b||n===b&&e>=x)continue;b=n,x=e,y=u}else l(u,t)>v||e<x&&(x=e,y=u)}}}if(y){t.points=y;let e=d.get(i);e&&d.set(i,e.filter(e=>e.edgeId!==g));let n=d.get(o);n&&d.set(o,n.filter(e=>e.edgeId!==g)),f(i,u(y[0],m),g),f(o,u(y[y.length-1],h),g)}}}function yt(e,t){let n=t?0:e.length-1,r=t?1:-1,i=e[n],a=e[n+r];if(!i||!a)return;let o=a.x-i.x,s=a.y-i.y;if(!(Math.abs(o)+Math.abs(s)<Q)){if(Math.abs(s)<=Q){let e=i.x+Math.sign(o)*ir;return{left:Math.min(i.x,e),right:Math.max(i.x,e),top:i.y-ar,bottom:i.y+ar}}if(Math.abs(o)<=Q){let e=i.y+Math.sign(s)*ir;return{left:i.x-ar,right:i.x+ar,top:Math.min(i.y,e),bottom:Math.max(i.y,e)}}return{left:Math.min(i.x,a.x),right:Math.max(i.x,a.x),top:Math.min(i.y,a.y),bottom:Math.max(i.y,a.y)}}}function bt(e){return{left:Math.min(e.left,e.right),right:Math.max(e.left,e.right),top:Math.min(e.top,e.bottom),bottom:Math.max(e.top,e.bottom)}}function xt(e,t){let n=V(t);return[yt(n,!0),yt(n,!1)].some(t=>t&&fe(e,bt(t)))}function St(e,n){let r=[];for(let t of e){if(t.isLayoutOnly)continue;let e=t.points;if(!(!e||e.length<2))for(let n=0;n<e.length-1;n++)r.push({edgeId:t.id,p1:e[n],p2:e[n+1]})}let i=[],a=[];for(let e of n.values()){let t=e.isGroup,n=e.parentId;if(t&&!n){let t=U(e);t&&a.push({id:e.id,rect:t});continue}if(t||e.isEdgeLabel)continue;let r=U(e);r&&i.push({nodeId:e.id,rect:r})}let o=/* @__PURE__ */ t((e,t)=>{let n=pe(t,3);for(let{nodeId:t,rect:r}of i)if(t!==e&&fe(n,r))return!0;return!1},`labelOverlapsForeignNode`),s=/* @__PURE__ */ t((e,t)=>{let n=pe(t,3);for(let t of r)if(t.edgeId!==e&&le(t.p1,t.p2,n))return!0;return!1},`labelOverlapsForeignEdge`),c=/* @__PURE__ */ t((e,t,n)=>o(e,n)||s(t,n),`labelOverlapsAnything`),l=[],u=/* @__PURE__ */ t(e=>{for(let{id:t,rect:n}of a)if(de(n,e))return t},`findContainingLane`),d=/* @__PURE__ */ t((e,t)=>l.some(n=>n.labelId!==e&&fe(t,n.rect)),`overlapsPlacedLabel`);for(let r of e){if(r.isLayoutOnly)continue;let e=r.labelNodeId;if(!e)continue;let i=n.get(e);if(!i)continue;let f=r.points;if(!f||f.length<2)continue;let p=i.width??0,m=i.height??0;if(p<=0||m<=0)continue;let h=[];for(let e=0;e<f.length-1;e++){let t=f[e],n=f[e+1],r=Math.abs(t.x-n.x),i=Math.abs(t.y-n.y);r<Q&&i<Q||r>=Q&&i>=Q||h.push({idx:e,length:r+i,orientation:r>=Q?`horizontal`:`vertical`,midX:(t.x+n.x)/2,midY:(t.y+n.y)/2})}if(h.length===0)continue;let g=h.length>=3?h.filter(e=>e.idx>0&&e.idx<h.length-1):h,_=g.length>0?g:h,v=p>=m?`horizontal`:`vertical`,y=/* @__PURE__ */ t(e=>[...e].sort((e,t)=>{let n=e.orientation===v;if(n!==(t.orientation===v))return n?-1:1;let r=e.length>=(e.orientation===`horizontal`?p:m)+2;return r===t.length>=(t.orientation===`horizontal`?p:m)+2?t.length-e.length:r?-1:1}),`rankSegments`),b=h[0],x=h[h.length-1],S=[.5,.25,.75,.05,.95,.15,.85,.1,.9],C=/* @__PURE__ */ t((e,t)=>{let n=f[e.idx],r=f[e.idx+1];return{midX:n.x+(r.x-n.x)*t,midY:n.y+(r.y-n.y)*t}},`anchorAtT`),w=/* @__PURE__ */ t((e,t,n)=>Math.min(n,Math.max(t,e)),`clamp`),T=/* @__PURE__ */ t((e,t)=>e.midX>=t.left-Q&&e.midX<=t.right+Q&&e.midY>=t.top-Q&&e.midY<=t.bottom+Q,`pointInsideRectInclusive`),E=/* @__PURE__ */ t(e=>{let t=me(e.midX,e.midY,p,m),n=u(t);if(n)return{laneId:n,anchor:e,rect:t};let r=a.find(({rect:t})=>T(e,t));if(!r)return;let i=r.rect.left+p/2+1,o=r.rect.right-p/2-1,s=r.rect.top+m/2+1,c=r.rect.bottom-m/2-1;if(i>o||s>c)return;let l={midX:w(e.midX,i,o),midY:w(e.midY,s,c)},d=me(l.midX,l.midY,p,m);return T(e,d)?{laneId:r.id,anchor:l,rect:d}:void 0},`placementForAnchor`),D=/* @__PURE__ */ t((e,t,n)=>e.orientation===`horizontal`?Math.abs(t.midX-n.x):Math.abs(t.midY-n.y),`distanceAlongSegment`),O=/* @__PURE__ */ t((e,t)=>{let n=(e.orientation===`horizontal`?p/2:m/2)+12;if(e===b){let r=f[e.idx];if(D(e,t,r)+Q<n)return!1}if(e===x){let r=f[e.idx+1];if(D(e,t,r)+Q<n)return!1}return!0},`labelClearsTerminalEndpoints`),k=/* @__PURE__ */ t(t=>{let n=y(t);for(let t of n)for(let n of S){let i=C(t,n);if(!O(t,i))continue;let a=E(i);if(a&&!xt(a.rect,f)&&!d(e,a.rect)&&!c(e,r.id,a.rect))return{laneId:a.laneId,anchor:a.anchor}}},`tryPool`),A=/* @__PURE__ */ t((t,n,i=!1)=>{let a=y(t);for(let t of a){let a={midX:t.midX,midY:t.midY};if(n&&!O(t,a))continue;let c=E(a);if(c&&!xt(c.rect,f)&&!d(e,c.rect)&&!o(e,c.rect)&&(i||!s(r.id,c.rect)))return{laneId:c.laneId,anchor:c.anchor}}},`findLaneContainingFallback`),j=k(_)??(_.length<h.length?k(h):void 0)??A(h,!0)??A(h,!1)??A(h,!1,!0);if(j){i.x=j.anchor.midX,i.y=j.anchor.midY,i.parentId=j.laneId;let t=me(j.anchor.midX,j.anchor.midY,p,m),n=l.findIndex(t=>t.labelId===e);n>=0?l[n]={labelId:e,rect:t}:l.push({labelId:e,rect:t})}}}function Ct(e,t){return e<t?`${e}::${t}`:`${t}::${e}`}function wt(e,n){let{nodeInfoById:r,realNodeRects:i}=ge(n),a=/* @__PURE__ */ new Map;for(let e of n){let t=e.id;e.isGroup||e.isEdgeLabel&&a.set(t,{w:e.width??0,h:e.height??0})}let o=/* @__PURE__ */ t((n,r,i,o)=>{let s=Ct(r,i),c=0,l=/* @__PURE__ */ t(e=>{if(!e)return;let t=a.get(e);if(!t)return;let n=o===`x`?t.w/2:t.h/2;n>c&&(c=n)},`consider`);l(n.labelNodeId);for(let t of e){if(t===n||t.isLayoutOnly)continue;let e=t.start,r=t.end;e&&r&&Ct(e,r)===s&&l(t.labelNodeId)}return c>0?c+cr:0},`labelClearanceFor`);for(let t of e){if(t.isLayoutOnly)continue;let n=t.points;if(!H(n,or))continue;let a=ye(t,r,or);if(!a)continue;let{srcId:s,dstId:c,srcInfo:l,dstInfo:u,collinearX:d,collinearY:f}=a;if(d===f)continue;let p,m;if(d){let e=u.cy>l.cy;p={x:l.cx,y:e?l.rect.bottom:l.rect.top},m={x:u.cx,y:e?u.rect.top:u.rect.bottom}}else{let e=u.cx>l.cx;p={x:e?l.rect.right:l.rect.left,y:l.cy},m={x:e?u.rect.left:u.rect.right,y:u.cy}}if(K(p,m,i,[s,c],1))continue;let h=o(t,s,c,d?`x`:`y`),g=h>sr?h:sr,_=[0,g,-g];for(let n of _){let r={...p},a={...m};if(d){if(r.x+=n,a.x+=n,r.x<=l.rect.left||r.x>=l.rect.right||a.x<=u.rect.left||a.x>=u.rect.right)continue}else if(r.y+=n,a.y+=n,r.y<=l.rect.top||r.y>=l.rect.bottom||a.y<=u.rect.top||a.y>=u.rect.bottom)continue;if(!K(r,a,i,[s,c],1)&&!Se(r,a,e,t,{epsilon:or})){t.points=[r,a];break}}}}function Tt(e,n){let r=.001,{realNodeRects:i,labelNodeRects:a}=_e(n.values()),o=/* @__PURE__ */ t((e,t)=>ce(t,r).map(n=>({...n,edge:e,interior:n.index>=1&&n.index<=t.length-3})),`segmentsFor`),s=/* @__PURE__ */ t(()=>{let t=[];for(let n of e){if(n.isLayoutOnly)continue;let e=n.points;!e||e.length<2||t.push(...o(n,V(e)))}return t},`allSegments`),c=/* @__PURE__ */ t((e,t)=>e.horizontal&&t.horizontal?R(e.a.x,e.b.x,t.a.x,t.b.x)>=8&&Math.abs(e.a.y-t.a.y)<7:e.vertical&&t.vertical?R(e.a.y,e.b.y,t.a.y,t.b.y)>=8&&Math.abs(e.a.x-t.a.x)<7:!1,`hasCrowdedParallelTrack`),l=/* @__PURE__ */ t((t,n)=>{let s=t.start,l=t.end,u=o(t,n);if(u.length!==n.length-1)return!1;let d=[s,l].filter(e=>!!e),f=t.labelNodeId?[t.labelNodeId]:[];for(let e of u)if(K(e.a,e.b,i,d,-2)||K(e.a,e.b,a,f,-2))return!1;for(let n of e){if(n===t||n.isLayoutOnly)continue;let e=n.points;if(!(!e||e.length<2)){for(let t of u)for(let i of o(n,V(e)))if(c(t,i)||Ce(t.a,t.b,i.a,i.b,r))return!1}}return!0},`candidateIsSafe`),u=/* @__PURE__ */ t((e,t)=>{let n=V(e.edge.points??[]);if(n.length<4||e.index>=n.length-1)return;let r=n.map(e=>({...e}));if(e.horizontal)r[e.index].y+=t,r[e.index+1].y+=t;else if(e.vertical)r[e.index].x+=t,r[e.index+1].x+=t;else return;return o(e.edge,r).length===r.length-1?r:void 0},`shiftedCandidate`),d=/* @__PURE__ */ t((e,t)=>({x:e.x??(t.left+t.right)/2,y:e.y??(t.top+t.bottom)/2}),`nodeCenter`),f=/* @__PURE__ */ t(e=>{let t=e.edge,r=V(t.points??[]);if(r.length!==4||e.index!==1)return;let i=t.start?n.get(t.start):void 0,a=t.end?n.get(t.end):void 0,o=i?U(i):void 0,s=a?U(a):void 0,c=r.slice(e.index+2);if(i&&a&&o&&s&&c.length!==0)return{sourceCenter:d(i,o),targetCenter:d(a,s),sourceRect:o,tail:c}},`sourceDetourContextFor`),p=/* @__PURE__ */ t((e,t,n,i,a,o)=>{let s=i.y>=n.y,c=s?a.bottom:a.top,l=c+(s?20:-20);if(s&&e.b.y<=l+r||!s&&e.b.y>=l-r)return;let u=e.a.x+t;return V([{x:n.x,y:c},{x:n.x,y:l},{x:u,y:l},{x:u,y:e.b.y},...o],r)},`verticalSourceDetour`),m=/* @__PURE__ */ t((e,t,n,i,a,o)=>{let s=i.x>=n.x,c=s?a.right:a.left,l=c+(s?20:-20);if(s&&e.b.x<=l+r||!s&&e.b.x>=l-r)return;let u=e.a.y+t;return V([{x:c,y:n.y},{x:l,y:n.y},{x:l,y:u},{x:e.b.x,y:u},...o],r)},`horizontalSourceDetour`),h=/* @__PURE__ */ t((e,t)=>{let n=f(e);if(n){if(e.vertical)return p(e,t,n.sourceCenter,n.targetCenter,n.sourceRect,n.tail);if(e.horizontal)return m(e,t,n.sourceCenter,n.targetCenter,n.sourceRect,n.tail)}},`sourceDetourCandidate`),g=[-7,7,-14,14,-21,21];for(let e=0;e<12;e++){let e=s(),t=!1;for(let n=0;n<e.length&&!t;n++)for(let r=n+1;r<e.length&&!t;r++){let i=e[n],a=e[r];if(i.edge===a.edge||!c(i,a))continue;let o=[i,a].filter(e=>e.interior);for(let e of o){for(let n of g){let r=u(e,n);if(r&&l(e.edge,r)){e.edge.points=r,t=!0;break}let i=h(e,n);if(i&&l(e.edge,i)){e.edge.points=i,t=!0;break}}if(t)break}}if(!t)return}}function Et(e,t,n,r){let i=t.x-e.x,a=t.y-e.y,o=r.x-n.x,s=r.y-n.y,c=i*s-a*o;if(Math.abs(c)<1e-10)return!1;let l=n.x-e.x,u=n.y-e.y,d=(l*s-u*o)/c,f=(l*a-u*i)/c,p=.01;return d>p&&d<.99&&f>p&&f<.99}function Dt(e){let t=e.nodes??[],n=e.edges??[],r=[];if(!n.length||!t.length)return r;let a=ve(t),o=[];for(let e of n){if(e.isLayoutOnly)continue;let t=e.points;if(!t||t.length<2)continue;let n=e.start,i=e.end,s=e.labelNodeId,c=e.id??`${n}->${i}`;for(let e of a)if(e.nodeId!==n&&e.nodeId!==i&&!(s&&e.nodeId===s)){for(let n=0;n<t.length-1;n++)if(le(t[n],t[n+1],e,-1)){r.push({type:`edge-node-overlap`,edgeId:c,targetId:e.nodeId,detail:`segment ${n} passes through node "${e.nodeId}"`});break}}for(let e=0;e<t.length-1;e++)o.push({edgeId:c,start:n,end:i,p1:t[e],p2:t[e+1]})}let s=/* @__PURE__ */ new Set;for(let e=0;e<o.length;e++)for(let t=e+1;t<o.length;t++){let n=o[e],i=o[t];if(n.edgeId!==i.edgeId&&n.start!==i.start&&n.start!==i.end&&n.end!==i.start&&n.end!==i.end&&Et(n.p1,n.p2,i.p1,i.p2)){let e=n.edgeId<i.edgeId?`${n.edgeId}|${i.edgeId}`:`${i.edgeId}|${n.edgeId}`;s.has(e)||(s.add(e),r.push({type:`edge-edge-crossing`,edgeId:n.edgeId,targetId:i.edgeId,detail:`edges "${n.edgeId}" and "${i.edgeId}" cross`}))}}if(r.length>0){let e=r.filter(e=>e.type===`edge-node-overlap`).length,t=r.filter(e=>e.type===`edge-edge-crossing`).length;i.warn(`[SWIMLANE_VALIDATE] ${r.length} issue(s) detected: ${e} edge-node overlap(s), ${t} edge crossing(s)`);for(let e of r)i.warn(`[SWIMLANE_VALIDATE] ${e.type}: ${e.detail}`)}return r}function Ot(e,n){let r=e.nodes??[],i=e.edges??[],a=r.filter(e=>!e.isGroup);if((n===`LR`||n===`RL`)&&a.length>0&&!ot(e,n)||n===`BT`&&a.length>0&&!at(e))return;for(let e of i){if(e.isLayoutOnly)continue;let t=e.points;!t||t.length<2||(e.points=Oe(De(t)))}vt(i,r),wt(i,r),st(i,r);let o=/* @__PURE__ */ new Map;for(let e of r)o.set(String(e.id),e);St(i,o),Me(i,o),ct(i,o),Tt(i,o),lt(i,o),ut(i,o),dt(i,o),mt(i,o);let s=/* @__PURE__ */ t(()=>{_t(i,o),ht(i,o),gt(i,o),St(i,o),Ze(i,o),dt(i,o),St(i,o),Ze(i,o)},`finalizeRenderedEdges`);s(),Tt(i,o),s(),ft(i,o),pt(i,o),ft(i,o),pt(i,o)}function kt(e){let t=new Map(e.nodeById),n=/* @__PURE__ */ new Set,r=[];for(let i of e.edges){if(!t.has(i.src)||!t.has(i.dst))continue;let e=`${i.id}:${i.src}->${i.dst}`;n.has(e)||(n.add(e),r.push(i))}return{nodes:[...t.keys()],edges:r,layout:e.layout,nodeById:t}}function At(e,t){return e.edges.filter(e=>e.dst===t)}function jt(e){let t=/* @__PURE__ */ new Map;for(let n of e.nodes)t.set(n,[]);for(let n of e.edges)t.get(n.src).push(n.dst);return t}function Mt(e){let t=jt(e);for(let e of t.values())e.sort((e,t)=>e.localeCompare(t));return t}function Nt(e){let t=/* @__PURE__ */ new Map;for(let n of e.nodes)t.set(n,0);for(let n of e.edges)t.set(n.dst,(t.get(n.dst)??0)+1);return t}function Pt(e){return[...e.entries()].filter(([,e])=>e===0).map(([e])=>e).sort((e,t)=>e.localeCompare(t))}function Ft(e,t=()=>!0){let n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new Map;for(let t of e.nodes)n.set(t,[]),r.set(t,[]);for(let i of e.edges)t(i)&&(r.get(i.src).push(i.dst),n.get(i.dst).push(i.src));return{preds:n,succs:r}}function It(e,t,n,r){let i=0;for(let t of e.nodes)r?.skipGroups&&e.nodeById.get(t)?.isGroup||(i=Math.max(i,n[t]??0));let a=Array.from({length:i+1},()=>[]);for(let i of t)r?.skipGroups&&e.nodeById.get(i)?.isGroup||a[Math.max(0,n[i]??0)].push(i);return a}function Lt(e){let t=Nt(e),n=Pt(t),r=[],i=Mt(e);for(;n.length;){let e=n.shift();r.push(e);for(let r of i.get(e)??[])if(t.set(r,(t.get(r)??0)-1),(t.get(r)??0)===0){let e=0;for(;e<n.length&&n[e]<r;)e++;n.splice(e,0,r)}}return r.length===e.nodes.length?r:null}function Rt(e){let t=/* @__PURE__ */ new Map,n=0;for(let r of e)t.set(r,n),n++;return t}function zt(e){let n=Array(e.length),r=/* @__PURE__ */ t((t,i)=>{if(i-t<=1)return 0;let a=t+i>>1,o=r(t,a)+r(a,i),s=t,c=a,l=t;for(;s<a||c<i;)c>=i||s<a&&e[s]<=e[c]?n[l++]=e[s++]:(n[l++]=e[c++],o+=a-s);for(let r=t;r<i;r++)e[r]=n[r];return o},`count`);return r(0,e.length)}function Bt(e){let n=kt(e),r=/* @__PURE__ */ new Map;for(let e of n.nodes)r.set(e,[]);for(let e of n.edges)r.get(e.src).push(e);for(let e of r.values())e.sort((e,t)=>e.dst===t.dst?e.id.localeCompare(t.id):e.dst.localeCompare(t.dst));let i=/* @__PURE__ */ Object.create(null);for(let e of n.nodes)i[e]=0;let a=[],o=/* @__PURE__ */ t(e=>{i[e]=1;for(let t of r.get(e)??[]){let e=t.dst;i[e]===0?o(e):i[e]===1&&a.push(t)}i[e]=2},`dfs`),s=[...n.nodes].sort((e,t)=>e.localeCompare(t));for(let e of s)i[e]===0&&o(e);let c=new Set(a.map(e=>`${e.id}:${e.src}->${e.dst}`)),l=n.edges.map(e=>c.has(`${e.id}:${e.src}->${e.dst}`)?{id:e.id,src:e.dst,dst:e.src,weight:e.weight,ref:e.ref}:e);return{acyclic:{nodes:[...n.nodes],edges:l,layout:n.layout,nodeById:new Map(n.nodeById)},reversed:a}}function Vt(e){let n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ t(t=>{if(n.has(t))return n.get(t);let i=e.nodeById.get(t);if(!i)return n.set(t,null),null;let a=i.parentId;if(!a)return n.set(t,null),null;let o=r(a)??a;return n.set(t,o),o},`resolve`);for(let t of e.nodes)r(t);return n}function Ht(e){let t=Vt(e);return e=>t.get(e)??null}function Ut(e){let t=[];for(let n of e.layout.nodes??[])n.isGroup&&!n.parentId&&t.push(n.id);return[...new Set(t)].reverse()}function Wt(e,t){let n=Ut(e);if(!t||t.length===0)return n;let r=new Set(n),i=/* @__PURE__ */ new Set,a=[];for(let e of t)r.has(e)&&!i.has(e)&&(i.add(e),a.push(e));for(let e of n)i.has(e)||a.push(e);return a}function Gt(e,n){let r=kt(e),i=n?.laneOf??(()=>null),a=n?.rankHint,{preds:o}=Ft(r);for(let e of o.values())e.sort((e,t)=>e.localeCompare(t));let s=Lt(r)??[...r.nodes].sort((e,t)=>e.localeCompare(t)),c=/* @__PURE__ */ new Map;for(let[e,t]of s.entries())c.set(t,e);let l=/* @__PURE__ */ new Map,u=/* @__PURE__ */ new Map;for(let e of r.nodes)u.set(e,[]);for(let e of s){let t=(o.get(e)??[]).filter(e=>l.has(e));if(t.length>0){let n=Kt(e,t,{laneOf:i,rankHint:a,topoIndex:c});l.set(e,n),u.get(n).push(e)}else l.has(e)||l.set(e,null)}for(let e of r.nodes)l.has(e)||l.set(e,null);let d=/* @__PURE__ */ new Set;for(let e of r.nodes)(l.get(e)??null)===null&&d.add(e);let f=[...d].sort((e,t)=>{let n=c.get(e)??0,r=c.get(t)??0;return n===r?e.localeCompare(t):n-r}),p=qt(r),m=/* @__PURE__ */ new Map;for(let[e,t]of p.entries())m.set(e,[...t].sort((e,t)=>e.localeCompare(t)));let h=Jt(m),g=Yt(m),_=/* @__PURE__ */ new Map;for(let e of r.nodes)_.set(e,[]);for(let e of g)for(let t of e.nodes){let n=_.get(t);n?n.push(e.id):_.set(t,[e.id])}let v=[],y=[],b=/* @__PURE__ */ new Set,x=/* @__PURE__ */ t(e=>{if(!b.has(e)){b.add(e),v.push(e);for(let t of u.get(e)??[])x(t);y.push(e)}},`walk`);for(let e of f)x(e);for(let e of s)x(e);return{parent:l,children:u,roots:f,componentOf:h,blocks:g,nodeBlocks:_,adjacency:m,preorder:v,postorder:y,topologicalOrder:s}}function Kt(e,t,n){let r=n.laneOf(e);return[...t].sort((e,t)=>{let i=n.laneOf(e),a=n.laneOf(t),o=i!=null&&i===r;if(o!==(a!=null&&a===r))return o?-1:1;let s=n.rankHint?.[e],c=n.rankHint?.[t];if(s!=null&&c!=null&&s!==c)return c-s;let l=n.topoIndex.get(e)??0,u=n.topoIndex.get(t)??0;return l===u?e.localeCompare(t):l-u})[0]}function qt(e){let t=/* @__PURE__ */ new Map;for(let n of e.nodes)t.set(n,/* @__PURE__ */ new Set);for(let n of e.edges)t.get(n.src).add(n.dst),t.get(n.dst).add(n.src);return t}function Jt(e){let t=/* @__PURE__ */ new Map,n=0;for(let r of e.keys()){if(t.has(r))continue;let i=[r];for(;i.length>0;){let r=i.pop();if(!t.has(r)){t.set(r,n);for(let n of e.get(r)??[])t.has(n)||i.push(n)}}n++}return t}function Yt(e){let n=/* @__PURE__ */ new Map,r=/* @__PURE__ */ new Map,i=[],a=[],o=0,s=/* @__PURE__ */ t((t,c)=>{n.set(t,++o),r.set(t,o);for(let l of e.get(t)??[])l!==c&&(n.has(l)?(n.get(l)??0)<(n.get(t)??0)&&(i.push([t,l]),r.set(t,Math.min(r.get(t)??o,n.get(l)??o))):(i.push([t,l]),s(l,t),r.set(t,Math.min(r.get(t)??o,r.get(l)??o)),(r.get(l)??0)>=(n.get(t)??0)&&a.push(Xt(t,l,i,a.length))))},`visit`);for(let t of e.keys())n.has(t)||s(t,null);return a}function Xt(e,t,n,r){let i=[],a=/* @__PURE__ */ new Set;for(;n.length>0;){let r=n.pop();if(i.push(r),a.add(r[0]),a.add(r[1]),r[0]===e&&r[1]===t||r[0]===t&&r[1]===e)break}return{id:r,edges:i,nodes:[...a]}}function Zt(e,n,r){let i=[...e.nodes],a=/* @__PURE__ */ new Map;for(let[e,t]of i.entries())a.set(t,e);let o=i.length,s=Array(o).fill(-1),c=Array(o).fill(0),l=[],u=/* @__PURE__ */ new Set;for(let e of i){let t=r.parent.get(e)??null,n=a.get(e);n!=null&&(t??(s[n]=-1,c[n]=0,u.has(e)||(u.add(e),l.push(e))))}for(;l.length>0;){let e=l.shift(),t=a.get(e);if(t==null)continue;let n=r.children.get(e)??[];for(let e of n){if(u.has(e))continue;let n=a.get(e);n!=null&&(s[n]=t,c[n]=c[t]+1,u.add(e),l.push(e))}}for(let e of i){if(u.has(e))continue;let t=a.get(e);t!=null&&(s[t]=-1,c[t]=0,u.add(e))}let d=Math.max(1,Math.ceil(Math.log2(Math.max(1,o)))+1),f=Array.from({length:d},()=>Array(o).fill(-1));for(let e=0;e<o;e++)f[0][e]=s[e];for(let e=1;e<d;e++)for(let t=0;t<o;t++){let n=f[e-1][t];f[e][t]=n===-1?-1:f[e-1][n]}let p=/* @__PURE__ */ t((e,t)=>{if(e===-1||t===-1)return-1;c[e]<c[t]&&([e,t]=[t,e]);let n=c[e]-c[t];for(let t=0;t<d;t++)if(n>>t&1&&(e=f[t][e],e===-1))return-1;if(e===t)return e;for(let n=d-1;n>=0;n--){let r=f[n][e],i=f[n][t];r!==-1&&i!==-1&&r!==i&&(e=r,t=i)}return f[0][e]},`lcaIndex`),m=Array.from({length:o},()=>/* @__PURE__ */ new Map);for(let t of e.edges){let e=t.src,r=t.dst,i=n[e],o=n[r];if(i==null||o==null||(i>o&&([e,r]=[r,e],[i,o]=[o,i]),i==null||o==null||i===o))continue;let s=a.get(e),c=a.get(r);if(s==null||c==null)continue;let l=p(s,c);if(l===-1)continue;let u=m[l];for(let e=i;e<o;e++)u.set(e,(u.get(e)??0)+1)}let h=/* @__PURE__ */ new Map,g=/* @__PURE__ */ t((e,t)=>{if(t.size!==0)for(let[n,r]of t)e.set(n,(e.get(n)??0)+r)},`mergeInto`),_=/* @__PURE__ */ new Set,v=/* @__PURE__ */ t(e=>{let t=a.get(e);_.add(e);let i=t==null?void 0:m[t],o=i?new Map(i):/* @__PURE__ */ new Map,s=r.children.get(e)??[];for(let t of s){let r=v(t),i=n[e];if(i!=null){let a=h.get(e);a||(a=/* @__PURE__ */ new Map,h.set(e,a));let o=r.get(i)??0,s=n[t];s!=null&&s>i&&(o+=1),a.set(t,o)}g(o,r)}return o},`dfs`);for(let e of r.roots)_.has(e)||v(e);for(let e of i)_.has(e)||v(e);return h}function Qt(e,n,r){let i=/* @__PURE__ */ new Map,a=/* @__PURE__ */ t(e=>{let t=r[e]??0,o=[...n.get(e)??[]];o.sort($t(r));for(let e of o){a(e);let n=i.get(e);n!=null&&(t=Math.min(t,n))}i.set(e,t)},`annotate`);for(let t of e)a(t);return i}function $t(e){return(t,n)=>{let r=e[t]??0,i=e[n]??0;return r===i?t.localeCompare(n):r-i}}function en(e,n,r,i){let a=0;for(let e of n){let t=r[e]??0;t>a&&(a=t)}let o=Array.from({length:a+1},()=>[]),s=/* @__PURE__ */ new Set,c=/* @__PURE__ */ t(e=>{if(s.has(e))return;s.add(e);let t=r[e]??0;o[t]||(o[t]=[]),o[t].push(e);for(let t of i(e))c(t)},`emit`);for(let t of e)c(t);for(let e of n)if(!s.has(e)){let t=r[e]??0;o[t]||(o[t]=[]),o[t].push(e),s.add(e)}return o}function tn(e){let t=[];for(let n of e){let e=/* @__PURE__ */ new Set,r=[];for(let t of n)e.has(t)||(e.add(t),r.push(t));t.push(r)}return t}function nn(e,t,n,r){return i=>{let a=e.get(i)??[];if(a.length===0)return[];let o=t[i]??0,s=[],c=[],l=n.get(i);for(let e of a){let t=r.get(e)??o;t>o?s.push({child:e,min:t}):c.push(e)}return s.sort((e,t)=>e.min===t.min?e.child.localeCompare(t.child):e.min-t.min),c.sort((e,t)=>{let n=l?.get(e)??0,i=l?.get(t)??0;if(n!==i)return n-i;let a=r.get(e)??o,s=r.get(t)??o;return a===s?e.localeCompare(t):a-s}),[...s.map(e=>e.child),...c]}}function rn(e,t,n){let r=Gt(e,{rankHint:t,laneOf:n}),{children:i,roots:a}=r;for(let t of e.nodes)i.has(t)||i.set(t,[]);let o=Zt(e,t,r),s=[...a].sort($t(t)),c=nn(i,t,o,Qt(s,i,t)),l=en(s,e.nodes,t,c);return l=tn(l),l}function an(e,t,n){let r=new Set(e),i=new Set(t),a=Rt(t),o=[];for(let e of n)r.has(e.src)&&i.has(e.dst)&&o.push(a.get(e.dst));return zt(o)}function on(e,t,n){let r=[];for(let e of t){let t=n[e.src],i=n[e.dst];if(t==null||i==null||t===i)continue;let a=e.src,o=e.dst,s=t,c=i;t>i&&(a=e.dst,o=e.src,s=i,c=t);for(let t=s;t<c;t++)r.push({id:`${e.id}@${t}`,src:a,dst:o,ref:e.ref})}let i=0;for(let t=0;t+1<e.length;t++)i+=an(e[t],e[t+1],r);return i}function sn(e,t){let n={...t},{preds:r}=Ft(e),i=Ht(e),a=on(rn(e,n,i),e.edges,n),o=ur.MAX_CROSSING_OPTIMIZATION_PASSES;for(let t=0;t<o;t++){let t=!1,o=[...e.nodes].sort((e,t)=>(n[t]??0)-(n[e]??0));for(let s of o){let o=n[s]??0;if(o===0)continue;let c=0;for(let e of r.get(s)??[])c=Math.max(c,(n[e]??0)+1);if(c>=o)continue;let l=o;n[s]=c;let u=on(rn(e,n,i),e.edges,n);u<a?(a=u,t=!0):n[s]=l}if(!t)break}return n}function cn(e,t){let n=Ht(e),r=[...e.nodes].sort((e,n)=>(t[e]??0)-(t[n]??0)||e.localeCompare(n));for(let i of r){let r=n(i);if(!r)continue;let a=e.edges.filter(e=>e.src===i);if(a.length===0)continue;let o=!1,s=0;for(let e of a){let t=n(e.dst);t==null||t===r?o=!0:s++}if(s===0||o)continue;let c=0,l=!1;for(let t of e.edges){if(t.dst!==i)continue;let e=n(t.src);e&&(e===r?l=!0:c++)}if(c>0||!l)continue;let u=t[i]??0,d=u+s,f=0;for(let n of e.edges)n.dst===i&&(f=Math.max(f,(t[n.src]??0)+1));let p=Math.max(u,f,d);p!==u&&(t[i]=p)}}function ln(e,t){let n=kt(e),r=Lt(n)??[...n.nodes].sort(),i=t?.compactSingleInput??!1,a=Ht(n),o=/* @__PURE__ */ Object.create(null);for(let e of r){let r=At(n,e),s=t?.ignoreCrossLaneEdges?r.filter(t=>{let n=a(t.src),r=a(e);return!n||!r||n===r}):r;if(s.length===0)o[e]=0;else if(i&&s.length===1){let t=s[0].src;a(t)===a(e)?o[e]=(o[t]??0)+1:o[e]=o[t]??0}else{let t=-1/0;for(let e of s)t=Math.max(t,(o[e.src]??0)+1);o[e]=t===-1/0?0:t}}return(t?.optimizeRanksByCrossings??!1)&&(o=sn(n,o)),t?.ignoreCrossLaneEdges&&cn(n,o),{layers:rn(n,o,a),rankOf:o,dummy:/* @__PURE__ */ new Set}}function un(e,n){let r=kt(e),i={...ln(r,{compactSingleInput:n?.compactSingleInput,ignoreCrossLaneEdges:n?.ignoreCrossLaneEdges,optimizeRanksByCrossings:n?.optimizeRanksByCrossings}).rankOf},a=Ht(r),{preds:o,succs:s}=Ft(r,e=>{if(n?.ignoreCrossLaneEdges){let t=a(e.src),n=a(e.dst);if(t&&n&&t!==n)return!1}return!0}),c=Lt(r)??[...r.nodes],l=[...c].reverse(),u=/* @__PURE__ */ t((e,t)=>{let n=0;for(let t of o.get(e)??[])n=Math.max(n,(i[t]??0)+1);let r=1/0,a=s.get(e)??[];return a.length>0&&(r=Math.min(...a.map(e=>(i[e]??0)-1))),Number.isFinite(r)||(r=Math.max(n,t)),Math.min(Math.max(t,n),r)},`clampFeasible`),d=ur.GRAVITY_ITERATIONS,f=/* @__PURE__ */ t(e=>{let t=!1;for(let n of e){let e=o.get(n)??[],r=s.get(n)??[];if(e.length===0&&r.length===0)continue;let a=e.length>0?e.reduce((e,t)=>e+(i[t]??0)+1,0)/e.length:i[n]??0,c=r.length>0?r.reduce((e,t)=>e+(i[t]??0)-1,0)/r.length:i[n]??0,l=Math.round((a+c)/2),d=u(n,l);d!==i[n]&&(i[n]=d,t=!0)}return t},`relaxOrder`);for(let e=0;e<d;e++){let e=f(c),t=f(l);if(!e&&!t)break}for(let e of c){let t=0;for(let n of o.get(e)??[])t=Math.max(t,(i[n]??0)+1);(i[e]??0)<t&&(i[e]=t)}for(let e of l){let t=s.get(e)??[];if(t.length>0){let n=Math.min(...t.map(e=>(i[e]??0)-1));(i[e]??0)>n&&(i[e]=n)}}return{layers:It(r,c,i),rankOf:i,dummy:/* @__PURE__ */ new Set}}function dn(e){let t=Nt(e),n=Mt(e),r=Pt(t),i=[];for(;r.length>0;){let e=[];for(let a of r){i.push(a);for(let r of n.get(a)??[])t.set(r,(t.get(r)??0)-1),(t.get(r)??0)===0&&e.push(r)}r=e.sort((e,t)=>e.localeCompare(t))}return i.length===e.nodes.length?i:null}function fn(e,n){let r=kt(e),i=n?.direction===`LR`?dn(r)??[...r.nodes].sort():Lt(r)??[...r.nodes].sort(),a=Ht(r),o=/* @__PURE__ */ t(e=>a(e)??e,`laneOf`),s=/* @__PURE__ */ Object.create(null),c=/* @__PURE__ */ new Map,l=/* @__PURE__ */ t((e,t)=>n?.ignoreCrossLaneEdges??!0?+(o(e)===o(t)):1,`edgeWeight`);for(let e of i){if(r.nodeById.get(e)?.isGroup)continue;let t=At(r,e),n=0;if(t.length>0)for(let r of t){let t=r.src,i=s[t]??0;n=Math.max(n,i+l(t,e))}let i=o(e),a=c.get(i)??0,u=Math.max(n,a);s[e]=u,c.set(i,u+1)}return{layers:It(r,i,s,{skipGroups:!0}),rankOf:s,dummy:/* @__PURE__ */ new Set}}function pn(e,n){let r=kt(n),{rankOf:i}=e,a=e.layers.map(e=>[...e]),o=new Set(e.dummy?[...e.dummy]:[]),s=0,c=new Map(r.nodeById),l=/* @__PURE__ */ t(e=>{let t=`placeholder-${s++}`,n={id:t,isGroup:!1,isDummy:!0,width:0,height:0};for(c.set(t,n),o.add(t);a.length<=e;)a.push([]);return a[e].push(t),i[t]=e,t},`addDummyAt`),u=[...r.edges].sort((e,t)=>e.id===t.id?e.src===t.src?e.dst.localeCompare(t.dst):e.src.localeCompare(t.src):e.id.localeCompare(t.id)),d=[];for(let e of u){let t=i[e.src]??0,n=i[e.dst]??0;if(n-t<=1){d.push(e);continue}let r=e.src;for(let i=t+1,a=0;i<n;i++,a++){let t=l(i);d.push({id:`${e.id}#${a}`,src:r,dst:t,weight:e.weight,ref:e.ref}),r=t}let a=n-t-2;d.push({id:`${e.id}#${Math.max(a+1,0)}`,src:r,dst:e.dst,weight:e.weight,ref:e.ref})}let f={nodes:[...r.nodes,...[...o].filter(e=>!r.nodes.includes(e))],edges:d,layout:r.layout,nodeById:c};return{layering:{layers:a,rankOf:i,dummy:o},graphWithDummies:f}}function mn(e){let t=e.length;if(t===0)return 1/0;let n=[...e].sort((e,t)=>e-t);return t%2==1?n[(t-1)/2]:.5*(n[t/2-1]+n[t/2])}function hn(e){return e.length===0?1/0:e.reduce((e,t)=>e+t,0)/e.length}function gn(e,t,n,r){let i=/* @__PURE__ */ new Map;for(let t of e)i.set(t,[]);for(let e of n)r===`down`?t.has(e.src)&&i.has(e.dst)&&i.get(e.dst).push(t.get(e.src)):t.has(e.dst)&&i.has(e.src)&&i.get(e.src).push(t.get(e.dst));return i}function _n(e,t,n){let r=n.get(e)??0,i=n.get(t)??0;return r===i?e.localeCompare(t):r-i}function vn(e,t,n){let r=new Set(e),i=new Set(t),a=Rt(e),o=Rt(t),s=[];for(let e of n)r.has(e.src)&&i.has(e.dst)&&s.push({u:a.get(e.src),v:o.get(e.dst)});return s.sort((e,t)=>e.u===t.u?e.v-t.v:e.u-t.u),zt(s.map(e=>e.v))}function yn(e,t,n){return[...e].sort((e,r)=>{let i=mn(t.get(e)??[]),a=mn(t.get(r)??[]);return i===a?_n(e,r,n):isFinite(i)?isFinite(a)?i-a:-1:1})}function bn(e,t,n,r,i,a){let o=Rt(e),s=Rt(t),c=gn(t,o,n,r);if(!i||!a||a.length===0)return yn(t,c,s);let l=/* @__PURE__ */ new Map;for(let e of t){let t=i(e),n=l.get(t)??[];n.push(e),l.set(t,n)}let u=[];for(let e of a){let t=l.get(e);if(!t||t.length===0)continue;let n=yn(t,c,s);u.push(...n)}let d=l.get(null);if(d&&d.length>0){let e=yn(d,c,s);for(let t of e){let e=hn(c.get(t)??[]),n=u.length;if(isFinite(e)){for(let[t,r]of u.entries())if(e<hn(c.get(r)??[])){n=t;break}}u.splice(n,0,t)}}return u}function xn(e,n,r,i,a){let o=[...n],s=new Set(e),c=new Set(n),l=i?new Set(i):null,u=r.filter(e=>s.has(e.src)&&c.has(e.dst)),d=l?r.filter(e=>c.has(e.src)&&l.has(e.dst)):void 0,f=/* @__PURE__ */ t(t=>{let n=vn(e,t,u);return d&&i&&(n+=vn(t,i,d)),n},`crossingScore`),p=a?/* @__PURE__ */ new Map:null;if(a&&p)for(let e of n)p.set(e,a(e));let m=!0,h=f(o);for(;m;){m=!1;for(let e=0;e+1<o.length;e++){if(p&&p.get(o[e])!==p.get(o[e+1]))continue;let t=h;[o[e],o[e+1]]=[o[e+1],o[e]];let n=f(o);n<t?(h=n,m=!0):[o[e],o[e+1]]=[o[e+1],o[e]]}}return o}function Sn(e,t,n){let r=e.layers.map(e=>[...e]),i=t.edges,a=Ht(t),o=Wt(t,n?.laneOrder);for(let e=0;e<3;e++){for(let e=1;e<r.length;e++)r[e]=bn(r[e-1],r[e],i,`down`,a,o),r[e]=xn(r[e-1],r[e],i,r[e+1],a);for(let e=r.length-2;e>=0;e--)r[e]=bn(r[e+1],r[e],i,`up`,a,o),r[e]=xn(r[e+1],r[e],i,r[e-1],a)}return{layers:r}}function Cn(e,n,r){let i=r?.layerGap??dr.DEFAULT_LAYER_GAP,a=r?.nodeGap??dr.DEFAULT_NODE_GAP,o=r?.laneGap??a*2,s=r?.direction??`TB`,c=s===`LR`||s===`RL`,l=e.layers,u=/* @__PURE__ */ Object.create(null),d=/* @__PURE__ */ Object.create(null),f=/* @__PURE__ */ t(e=>n.nodeById.get(e),`getNode`),p=/* @__PURE__ */ t(e=>f(e)?.width??0,`getWidth`),m=/* @__PURE__ */ t(e=>f(e)?.height??0,`getHeight`),h=Ht(n),g=Wt(n,r?.laneOrder),_=l.map(e=>e.reduce((e,t)=>Math.max(e,m(t)),0)),v=[];if(c)for(let e=0;e+1<l.length;e++){let t=l[e].reduce((e,t)=>Math.max(e,p(t)),0),n=l[e+1].reduce((e,t)=>Math.max(e,p(t)),0),r=_[e],a=_[e+1],o=r/2+a/2,s=(t+n)/2,c=Math.max(0,s-o-i);v.push(c)}let y=/* @__PURE__ */ new Set;for(let e of l)for(let t of e)y.add(h(t));let b=y.has(null),x=g.filter(e=>y.has(e)),S=[...b?[null]:[],...x],C=/* @__PURE__ */ Object.create(null);for(let e of x)C[e]=0;b&&(C.null=0);for(let e of l){let t=/* @__PURE__ */ Object.create(null),n=[];for(let r of e){let e=h(r);e===null?n.push(r):(t[e]||=[]).push(r)}for(let[e,n]of Object.entries(t)){let t=n.reduce((e,t)=>e+p(t),0)+a*Math.max(0,n.length-1);C[e]=Math.max(C[e]??0,t)}if(b&&n.length){let e=n.reduce((e,t)=>e+p(t),0)+a*Math.max(0,n.length-1);C.null=Math.max(C.null??0,e)}}let w=/* @__PURE__ */ new Map;{let e=S.map(e=>(e===null?C.null:C[e])??0),t=-(e.reduce((e,t)=>e+t,0)+o*Math.max(0,S.length-1))/2;for(let n=0;n<S.length;n++){let r=S[n],i=e[n]??0,a=t+i/2;w.set(r,a),t+=i,n<S.length-1&&(t+=o)}}let T=0;for(let[e,t]of l.entries()){let n=_[e]??0,r=/* @__PURE__ */ new Map;for(let e of t){let t=h(e),n=r.get(t)??[];n.push(e),r.set(t,n)}for(let e of S){let t=r.get(e)??[];if(t.length===0)continue;let i=w.get(e);if(t.length===1){let e=t[0];u[e]=i,d[e]=T+n/2}else{let e=t.map(e=>p(e)),r=i-(e.reduce((e,t)=>e+t,0)+a*(t.length-1))/2;for(let[i,o]of t.entries()){let t=e[i];u[o]=r+t/2,d[o]=T+n/2,r+=t+a}}}let o=v[e]??0;T+=n+i+o}let E=/* @__PURE__ */ new Map;for(let e of n.edges){let t=e.ref.id;E.has(t)||E.set(t,[]),E.get(t).push(e)}for(let[,e]of E){if(e.length===0)continue;let t=e[0].ref,r=t.start,i=t.end;if(r==null||i==null)continue;let a=Math.round(((u[r]??0)+(u[i]??0))/2),o=/* @__PURE__ */ new Set;for(let t of e)o.add(t.src),o.add(t.dst);for(let e of o)e!==r&&e!==i&&n.nodeById.get(e)?.isDummy&&(u[e]=a)}return{x:u,y:d}}function wn(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function Tn(e){let t=e>>>0;return()=>{t+=1831565813;let e=t;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}function En(e,t){let n=[...e],r=Tn(t);for(let e=n.length-1;e>0;e--){let t=Math.floor(r()*(e+1));[n[e],n[t]]=[n[t],n[e]]}return n}function Dn(e,t){let n=0;for(let[r,i]of e.entries())n+=Math.abs(r-(t.get(i)??r));return n}function On(e,t){let n=/* @__PURE__ */ new Map;for(let[t,r]of e.entries())n.set(r,t);let r=0;for(let{a:e,b:i,weight:a}of t){let t=n.get(e),o=n.get(i);t!=null&&o!=null&&(r+=a*Math.abs(t-o))}return r}function kn(e){let t=Ut(e);if(t.length<2)return[];let n=new Map(t.map((e,t)=>[e,t])),r=Ht(e),i=/* @__PURE__ */ new Map;for(let t of e.layout.edges??[]){if(t.isLayoutOnly)continue;let a=typeof t.start==`string`?t.start:void 0,o=typeof t.end==`string`?t.end:void 0;if(!a||!o||!e.nodeById.has(a)||!e.nodeById.has(o))continue;let s=r(a),c=r(o);if(!s||!c||s===c)continue;let l=n.get(s),u=n.get(c);if(l==null||u==null)continue;let[d,f]=l<=u?[s,c]:[c,s],p=`${d}\0${f}`,m=i.get(p);m?m.weight++:i.set(p,{a:d,b:f,weight:1})}return[...i.values()]}function An(e,t,n){let r=[...e],i=On(r,t),a=!0,o=0,s=Math.max(1,r.length);for(;a&&o<s;){a=!1,o++;for(let e=0;e+1<r.length;e++){[r[e],r[e+1]]=[r[e+1],r[e]];let n=On(r,t);n<i?(i=n,a=!0):[r[e],r[e+1]]=[r[e+1],r[e]]}}return{order:r,cost:i,sourceDistance:Dn(r,n)}}function jn(e,t){return e.cost===t.cost?e.sourceDistance<t.sourceDistance:e.cost<t.cost}function Mn(e,t,n){let r=[...t].sort((e,t)=>e.a===t.a?e.b.localeCompare(t.b):e.a.localeCompare(t.a)).map(({a:e,b:t,weight:n})=>`${e}:${t}:${n}`).join(`|`);return wn(`${e.join(`|`)}#${r}#${n}`)}function Nn(e,t={}){let n=Ut(e);if(n.length<2)return n;let r=kn(e);if(r.length===0)return n;let i=new Map(n.map((e,t)=>[e,t])),a=An(n,r,i),o=Math.max(0,t.restarts??fr);for(let e=0;e<o;e++){let t=An(En(n,Mn(n,r,e)),r,i);jn(t,a)&&(a=t)}return a.order}function Pn(e,t){let n=t?.ignoreCrossLaneEdges??!0,r=t?.optimizeRanksByCrossings??!0,i=kt(e),a=t?.automaticLaneOrdering?Nn(i,{restarts:fr}):void 0,o=Bt(i),s=o.acyclic,{layering:c,graphWithDummies:l}=pn(n?fn(s,{compactSingleInput:t?.compactSingleInput??ur.DEFAULT_COMPACT_SINGLE_INPUT,ignoreCrossLaneEdges:!0,direction:t?.direction}):un(s,{compactSingleInput:t?.compactSingleInput??ur.DEFAULT_COMPACT_SINGLE_INPUT,ignoreCrossLaneEdges:!1,optimizeRanksByCrossings:r}),s),u=Sn(c,l,{laneOrder:a}),d=Cn(u,l,{layerGap:t?.layerGap,nodeGap:t?.nodeGap,direction:t?.direction,laneOrder:a});return{acyclic:s,reversed:o.reversed,layering:c,ordered:u,coordinates:d}}function Fn(e,t,n){let r=e.x??0,i=e.y??0,a=t.x-r,o=t.y-i,s=Math.abs(a),c=Math.abs(o);return s<$&&c<$?n:c>$&&c*3>=s?o>0?`bottom`:`top`:s>$?a>0?`right`:`left`:n}function In(e,t){return Math.abs(e.to-t.from)<$||Math.abs(e.to-t.to)<$?e.to:e.from}function Ln(e,t){return e.orient===`vertical`?{x:e.coord,y:t}:{x:t,y:e.coord}}function Rn(e,n){let r=e.nodes??[],i=e.edges??[],a=[];for(let e of i)e.isLayoutOnly||a.push({...e,__originalEdge:e});let o=/* @__PURE__ */ new Map,s=/* @__PURE__ */ new Map,c=[],l=n===`LR`;for(let e of r)o.set(e.id,e);let u=r.filter(e=>e.isGroup&&!e.parentId);for(let e of u){let n={id:e.id},i=/* @__PURE__ */ t(e=>{s.set(e.id,n),r.filter(t=>t.parentId===e.id).forEach(i)},`assignLane`);i(e)}let d=r.filter(e=>!e.isGroup&&!e.isEdgeLabel).map(e=>{let t=e.width??10,n=e.height??10,r=e.x??0,i=e.y??0,a=pr;return{nodeId:e.id,minX:r-t/2-a,maxX:r+t/2+a,minY:i-n/2-a,maxY:i+n/2+a,visualXHalfExtent:l?n/2+a:t/2+a}}),f=/* @__PURE__ */ t((e,t,n,r)=>{let i=c.find(n=>n.orientation===e&&Math.abs(n.coord-t)<1);return i||(i={id:`pipe-${e}-${t.toFixed(0)}`,orientation:e,coord:t,spanMin:n,spanMax:r,tracks:[]},c.push(i)),i.spanMin=Math.min(i.spanMin,n),i.spanMax=Math.max(i.spanMax,r),i},`getOrAddPipe`),p=/* @__PURE__ */ t((e,t)=>{let n=e.width??10,r=e.height??10,i=e.x??0,a=e.y??0;switch(t){case`top`:return{x:i,y:a-r/2};case`bottom`:return{x:i,y:a+r/2};case`left`:return{x:i-n/2,y:a};case`right`:return{x:i+n/2,y:a}}},`portForSide`),m=/* @__PURE__ */ t((e,t,n)=>p(e,Fn(e,t,n?`bottom`:`top`)),`getOrthogonalPort`),h=[],g=[],_=/* @__PURE__ */ new Set,v=1e3,y=/* @__PURE__ */ t((e,t,n)=>{if(h.length===0)return 0;let r=Math.abs(t.y-n.y)<$,i=Math.abs(t.x-n.x)<$;if(!r&&!i)return 0;let a=0;if(r){let r=t.y,i=Math.min(t.x,n.x)-$,o=Math.max(t.x,n.x)+$;if(o<=i)return 0;for(let t of h)t.edgeIndex!==e&&t.orientation===`vertical`&&(t.pipe.coord<i||t.pipe.coord>o||t.from-$<=r&&t.to+$>=r&&(a+=v))}else if(i){let r=t.x,i=Math.min(t.y,n.y)-$,o=Math.max(t.y,n.y)+$;if(o<=i)return 0;for(let t of h)t.edgeIndex!==e&&t.orientation===`horizontal`&&(t.pipe.coord<i||t.pipe.coord>o||t.from-$<=r&&t.to+$>=r&&(a+=v))}return a},`crossingPenalty`),b=a.map((e,t)=>{if(!e.start||!e.end)return{idx:t,crossLane:0,dx:0,dy:0};let n=o.get(e.start),r=o.get(e.end),i=s.get(e.start),a=s.get(e.end);return{idx:t,crossLane:i&&a&&i.id!==a.id?1:0,dx:n&&r?Math.abs((r.x??0)-(n.x??0)):0,dy:n&&r?Math.abs((r.y??0)-(n.y??0)):0}}).sort((e,t)=>{if(e.crossLane!==t.crossLane)return t.crossLane-e.crossLane;let n=e.dx+e.dy,r=t.dx+t.dy;return Math.abs(n-r)>1?n-r:e.idx-t.idx}).map(e=>e.idx),x=/* @__PURE__ */ t((e,t,n,r)=>{let i=Math.min(e.x,t.x),a=Math.max(e.x,t.x),o=Math.min(e.y,t.y),s=Math.max(e.y,t.y);return!!d.find(c=>n&&c.nodeId===n||r&&c.nodeId===r?!1:Math.abs(e.x-t.x)>$?c.minY<e.y&&c.maxY>e.y&&c.maxX>i&&c.minX<a:c.minX<e.x&&c.maxX>e.x&&c.maxY>o&&c.minY<s)},`isSegmentBlocked`),S=/* @__PURE__ */ new Map,C=/* @__PURE__ */ new Map;for(let e of a)e.start&&e.end&&e.start!==e.end&&(C.set(e.start,(C.get(e.start)??0)+1),C.set(e.end,(C.get(e.end)??0)+1));let w=/* @__PURE__ */ t((e,t)=>Fn(e,t,`bottom`),`determineSide`),T=/* @__PURE__ */ new Map;for(let[e,t]of a.entries()){if(!t.start||!t.end||t.start===t.end||t.points&&t.points.length>0)continue;let n=o.get(t.start),r=o.get(t.end);if(!n||!r)continue;let i=(r.x??0)-(n.x??0),a=(r.y??0)-(n.y??0);T.set(e,{edgeIdx:e,srcId:t.start,dstId:t.end,srcSide:w(n,{x:r.x??0,y:r.y??0}),dstSide:w(r,{x:n.x??0,y:n.y??0}),absDx:Math.abs(i),absDy:Math.abs(a),dxSign:Math.sign(i),dySign:Math.sign(a)})}let E=/* @__PURE__ */ t(e=>e.srcSide===`top`||e.srcSide===`bottom`?e.absDx===0?1/0:e.absDy/e.absDx:e.absDy===0?1/0:e.absDx/e.absDy,`preferenceStrength`),D=/* @__PURE__ */ t(e=>e.srcSide===`top`||e.srcSide===`bottom`?e.dxSign>=0?`right`:`left`:e.dySign>=0?`bottom`:`top`,`secondarySide`),O=/* @__PURE__ */ new Map;for(let e of T.values()){let t=`${e.srcId}:${e.srcSide}`;O.has(t)||O.set(t,[]),O.get(t).push(e)}let k=/* @__PURE__ */ new Map,A=/* @__PURE__ */ t((e,t)=>`${e}:${t}`,`loadKey`);for(let e of T.values())k.set(A(e.srcId,e.srcSide),(k.get(A(e.srcId,e.srcSide))??0)+1),k.set(A(e.dstId,e.dstSide),(k.get(A(e.dstId,e.dstSide))??0)+1);for(let e of O.values())if(!(e.length<2)){e.sort((e,t)=>{let n=E(e),r=E(t);return Math.abs(n-r)>1e-9?r-n:e.edgeIdx-t.edgeIdx});for(let t=1;t<e.length;t++){let n=e[t],r=D(n),i=k.get(A(n.srcId,n.srcSide))??0,a=k.get(A(n.srcId,r))??0;a>=i||(k.set(A(n.srcId,n.srcSide),i-1),k.set(A(n.srcId,r),a+1),n.srcSide=r)}}let j=/* @__PURE__ */ t(e=>{let t=e?.shape;return t===`question`||t===`diamond`},`isDiamondNode`),ee=/* @__PURE__ */ new Map;for(let e of T.values())ee.has(e.dstId)||ee.set(e.dstId,/* @__PURE__ */ new Set),ee.get(e.dstId).add(e.dstSide);for(let e of T.values()){if(!j(o.get(e.srcId)))continue;let t=ee.get(e.srcId);if(!t?.has(e.srcSide))continue;let n=D(e);if(t.has(n)||(k.get(A(e.srcId,n))??0)>0)continue;let r=k.get(A(e.srcId,e.srcSide))??0;k.set(A(e.srcId,e.srcSide),Math.max(0,r-1)),k.set(A(e.srcId,n),1),e.srcSide=n}for(let e of T.values()){let{edgeIdx:t,srcId:n,dstId:r,srcSide:i,dstSide:a}=e,s=o.get(n),c=o.get(r),l=`${n}:${i}:src`,u=i===`top`||i===`bottom`?c.x??0:c.y??0;S.has(l)||S.set(l,[]),S.get(l).push({edgeIdx:t,oppositeCoord:u});let d=`${r}:${a}:dst`,f=a===`top`||a===`bottom`?s.x??0:s.y??0;S.has(d)||S.set(d,[]),S.get(d).push({edgeIdx:t,oppositeCoord:f})}let te=/* @__PURE__ */ new Map;for(let[e,t]of S){if(t.length<2)continue;t.sort((e,t)=>e.oppositeCoord-t.oppositeCoord);let n=e.split(`:`),r=n.slice(0,-2).join(`:`),i=n[n.length-2],a=n[n.length-1],s=o.get(r);if(!s)continue;let c=i===`left`||i===`right`?s.height??10:s.width??10,l=s.shape,u=l===`question`||l===`diamond`?c*.3:c,d=Math.min(20,Math.max(8,u/(t.length+1))),f=-(d*(t.length-1))/2;for(let[e,n]of t.entries()){let t=f+e*d,r=`${n.edgeIdx}:${a}`;te.set(r,t)}}let M=/* @__PURE__ */ t(e=>!!a[e]?.labelNodeId,`edgeHasLabelNode`),ne=/* @__PURE__ */ t((e,t)=>e?(S.get(`${e}:${t}:src`)??[]).some(({edgeIdx:e})=>M(e))||(S.get(`${e}:${t}:dst`)??[]).some(({edgeIdx:e})=>M(e)):!1,`faceHasLabelNode`),re=/* @__PURE__ */ t((e,t,n)=>t===`top`||t===`bottom`?{x:e.x+n,y:e.y}:{x:e.x,y:e.y+n},`applyPortOffset`),ie=/* @__PURE__ */ t((e,t,n)=>{let r=T.get(e),i={x:n.x??0,y:n.y??0},a={x:t.x??0,y:t.y??0},o=r?.srcSide??w(t,i),s=r?.dstSide??w(n,a),c=r?p(t,r.srcSide):m(t,i,!0),l=r?p(n,r.dstSide):m(n,a,!1),u=te.get(`${e}:src`),d=te.get(`${e}:dst`);return u!==void 0&&(c=re(c,o,u)),d!==void 0&&(l=re(l,s,d)),{pSrcPort:c,pDstPort:l,srcSide:o,dstSide:s}},`portsForEdge`);for(let e of b){let n=a[e];if(g[e]=[],!n.start||!n.end||n.points&&n.points.length>0||n.start===n.end)continue;let r=o.get(n.start),i=o.get(n.end);if(!r||!i)continue;let{pSrcPort:s,pDstPort:u,srcSide:p,dstSide:m}=ie(e,r,i),v={...s},b={...u},w=p===`top`||p===`bottom`,T=m===`top`||m===`bottom`;w?v.y=s.y>(r.y??0)?s.y+_r:s.y-_r:v.x=s.x>(r.x??0)?s.x+_r:s.x-_r,T?b.y=u.y>(i.y??0)?u.y+_r:u.y-_r:b.x=u.x>(i.x??0)?u.x+_r:u.x-_r;let E=/* @__PURE__ */ t((e,t)=>{for(let n of d)if(!t.includes(n.nodeId)&&e.x>n.minX&&e.x<n.maxX&&e.y>n.minY&&e.y<n.maxY)return{inside:!0,obstacle:n};return{inside:!1}},`isPointInObstacle`),D=/* @__PURE__ */ t((e,t,n,r,i)=>{if(i){let i=e.y>(t.y??0);return{x:(n.x??0)>=e.x?r.maxX+mr:r.minX-mr,y:i?r.maxY+hr:r.minY-hr,leavesPositiveSide:i}}let a=e.x>(t.x??0),o=(n.y??0)>=e.y;return{x:a?r.maxX+mr:r.minX-mr,y:o?r.maxY+hr:r.minY-hr,leavesPositiveSide:a}},`obstacleDetour`),O=[],k=[n.start,n.end],A=E(v,k);if(A.inside&&A.obstacle){let e=A.obstacle;if(w){let t=D(s,r,i,e,!0);v.x=t.x,v.y=t.y;let n=t.leavesPositiveSide?Math.min(e.minY-2,s.y+_r):Math.max(e.maxY+2,s.y-_r);O=[{x:s.x,y:n},{x:t.x,y:n},{x:t.x,y:t.y}]}else{let t=D(s,r,i,e,!1),n=t.leavesPositiveSide?Math.min(e.minX-2,s.x+_r):Math.max(e.maxX+2,s.x-_r);v.x=t.x,v.y=t.y,O=[{x:n,y:s.y},{x:n,y:t.y},{x:t.x,y:t.y}]}}let j=[],ee=E(b,k);if(ee.inside&&ee.obstacle){let e=ee.obstacle;if(T){let t=D(u,i,r,e,!0);b.x=t.x,b.y=t.y,j=[{x:t.x,y:t.y},{x:u.x,y:t.y}]}else{let t=D(u,i,r,e,!1);b.x=t.x,b.y=t.y,j=[{x:t.x,y:t.y},{x:t.x,y:u.y}]}}if(O.length===0&&j.length===0){let t=mr,r=Math.abs(v.x-b.x)<t,i=Math.abs(v.y-b.y)<t,a=te.get(`${e}:src`)!==void 0||te.get(`${e}:dst`)!==void 0,o=(S.get(`${n.start??``}:${p}:src`)?.length??0)+(S.get(`${n.start??``}:${p}:dst`)?.length??0),c=(S.get(`${n.end??``}:${m}:src`)?.length??0)+(S.get(`${n.end??``}:${m}:dst`)?.length??0),l=o>1||c>1,d=C.get(n.start??``)??0,f=C.get(n.end??``)??0,g=o>1&&ne(n.start,p)||c>1&&ne(n.end,m);if((r||i)&&!a&&(!l||l&&!g&&(o<=1||d<=2)&&(c<=1||f<=2))&&!x(s,u,n.start,n.end)){n.points=[{...s},{...v},{...b},{...u}],_.add(e);let t=i?`horizontal`:`vertical`,r=i?s.y:s.x,a=i?Math.min(s.x,u.x):Math.min(s.y,u.y),o=i?Math.max(s.x,u.x):Math.max(s.y,u.y),c={id:`fast-path-${t}-${r.toFixed(0)}-${e}`,orientation:t,coord:r,spanMin:a,spanMax:o,tracks:[]};h.push({edgeIndex:e,segmentIndex:0,orientation:t,pipe:c,trackIndex:0,from:a,to:o});continue}}v.x=f(`vertical`,v.x,v.y,v.y).coord,b.x=f(`vertical`,b.x,b.y,b.y).coord;let M=Math.min(v.x,b.x)-50,re=Math.max(v.x,b.x)+50,ae=Math.min(v.y,b.y)-50,oe=Math.max(v.y,b.y)+50;for(let e of d){let t=Math.min(v.x,b.x),n=Math.max(v.x,b.x),r=Math.min(v.y,b.y),i=Math.max(v.y,b.y);e.minX<n&&e.maxX>t&&e.minY<i&&e.maxY>r&&(M=Math.min(M,e.minX-gr),re=Math.max(re,e.maxX+gr),ae=Math.min(ae,e.minY-gr),oe=Math.max(oe,e.maxY+gr))}for(let e of d){if(e.maxX<M||e.minX>re||e.maxY<ae||e.minY>oe)continue;let t=mr;f(`horizontal`,e.minY-t,M,re),f(`horizontal`,e.maxY+t,M,re);let n=hr;f(`vertical`,e.minX-n,ae,oe),f(`vertical`,e.maxX+n,ae,oe)}f(`horizontal`,v.y,M,re),f(`horizontal`,b.y,M,re);let se=c.filter(e=>e.orientation===`horizontal`&&e.coord>=ae&&e.coord<=oe),N=c.filter(e=>e.orientation===`vertical`&&e.coord>=M&&e.coord<=re),P=/* @__PURE__ */ t((e,t)=>`${e.toFixed(1)},${t.toFixed(1)}`,`getKey`),F=P(v.x,v.y),I=P(b.x,b.y),L=/* @__PURE__ */ new Map,R=/* @__PURE__ */ new Map,z=/* @__PURE__ */ new Map,ce=/* @__PURE__ */ new Set,B=[];L.set(F,0),z.set(F,`n`),B.push({key:F,f:Math.hypot(b.x-v.x,b.y-v.y),pt:v}),ce.add(F);let V=[],H=/* @__PURE__ */ t((e,t)=>x(e,t,n.start,n.end),`checkSegmentBlocked`),le={x:b.x,y:v.y},ue=H(v,le),de=H(le,b),fe=ue||de,pe={x:v.x,y:b.y},me=H(v,pe),U=H(pe,b);if(fe?me||U||(V=Math.abs(v.x-b.x)<$?[v,b]:[v,pe,b]):V=Math.abs(v.y-b.y)<$||Math.abs(v.x-b.x)<$?[v,b]:[v,le,b],V.length===0)for(;B.length>0;){B.sort((e,t)=>e.f-t.f);let t=B.shift();if(ce.delete(t.key),t.key===I){let e=I,t=b;for(V=[t];R.has(e);){let n=R.get(e);V.unshift(n),t=n,e=P(n.x,n.y)}break}let r=t.pt.x,i=t.pt.y,a=N.sort((e,t)=>e.coord-t.coord),o=a.findIndex(e=>Math.abs(e.coord-r)<1),s=se.sort((e,t)=>e.coord-t.coord),c=s.findIndex(e=>Math.abs(e.coord-i)<1),l=[];o>0&&l.push({x:a[o-1].coord,y:i}),o>=0&&o<a.length-1&&l.push({x:a[o+1].coord,y:i}),c>0&&l.push({x:r,y:s[c-1].coord}),c>=0&&c<s.length-1&&l.push({x:r,y:s[c+1].coord});for(let a of l){let o=Math.min(r,a.x),s=Math.max(r,a.x),c=Math.min(i,a.y),l=Math.max(i,a.y);if(d.some(e=>e.nodeId===n.start||e.nodeId===n.end?!1:o===s?e.minX<r&&e.maxX>r&&e.maxY>c&&e.minY<l:e.minY<i&&e.maxY>i&&e.maxX>o&&e.minX<s))continue;let u=P(a.x,a.y),f=Math.abs(a.x-r)+Math.abs(a.y-i),p=y(e,t.pt,a),m=0,h=b.x-v.x,g=b.y-v.y,_=a.x-r,x=a.y-i;(g>10&&x<-5||g<-10&&x>5)&&(m=Math.abs(x)*100),(h>10&&_<-5||h<-10&&_>5)&&(m+=Math.abs(_)*50);let S=0,C=z.get(t.key)??`n`,w=Math.abs(_)>$?`h`:`v`;C!==`n`&&C!==w&&(S=50);let T=f+p+m+S,E=(L.get(t.key)??1/0)+T,D=Math.abs(b.x-a.x)+Math.abs(b.y-a.y);if(E<(L.get(u)??1/0)){if(R.set(u,t.pt),L.set(u,E),z.set(u,w),!ce.has(u))B.push({key:u,f:E+D,pt:a}),ce.add(u);else{let e=B.findIndex(e=>e.key===u);e!==-1&&(B[e].f=E+D)}}}}if(V.length===0&&(V=[v,{x:v.x,y:b.y},b]),V.length>4){let e=V[0],n=V[V.length-1],r=Math.min(e.x,n.x),i=Math.max(e.x,n.x),a=Math.min(e.y,n.y),o=Math.max(e.y,n.y);for(let e of V)r=Math.min(r,e.x),i=Math.max(i,e.x),a=Math.min(a,e.y),o=Math.max(o,e.y);let s=i>Math.max(e.x,n.x),c=r<Math.min(e.x,n.x);if(l){let t=hr;if(s){let r=Math.max(e.x,n.x),a=Math.min(e.y,n.y),o=Math.max(e.y,n.y),s=d.filter(e=>e.minX<r&&e.maxX>r&&e.minY<o&&e.maxY>a);if(s.length>0){let r=Math.max(e.x,n.x);for(let e of s){let n=(e.minX+e.maxX)/2;if(e.visualXHalfExtent===void 0||isNaN(e.visualXHalfExtent))continue;let i=n+e.visualXHalfExtent+t;r=Math.max(r,i)}isNaN(r)||(i=r)}}if(c){let i=d.filter(r=>r.minX<Math.min(e.x,n.x)+t&&r.minY<Math.max(e.y,n.y)&&r.maxY>Math.min(e.y,n.y));if(i.length>0){let a=Math.min(e.x,n.x);for(let e of i){let n=(e.minX+e.maxX)/2-e.visualXHalfExtent-t;a=Math.min(a,n)}r=a}}}let u=/* @__PURE__ */ t(t=>{let r=n.y>e.y,i=d.filter(t=>{let r=Math.min(e.x,n.x)<t.maxX&&Math.max(e.x,n.x)>t.minX,i=Math.min(e.y,n.y)<t.maxY&&Math.max(e.y,n.y)>t.minY;return r&&i}),a=i;if(l&&i.length>0){let e=i.filter(e=>e.minX<t&&e.maxX>t);e.length>0&&(a=e)}if(a.length===0)return n.y;let o=mr;if(r){let e=Math.max(...a.map(e=>e.maxY))+o;if(e<n.y-$)return e}else{let e=Math.min(...a.map(e=>e.minY))-o;if(e>n.y+$)return e}return n.y},`findBestReturnY`),f=/* @__PURE__ */ t(t=>{let r=u(t),i={x:t,y:e.y},a={x:t,y:r},o={x:n.x,y:r},s=H(e,i),c=H(i,a),l=H(a,o),d=r!==n.y&&H(o,n);return!s&&!c&&!l&&!d?Math.abs(r-n.y)<$?[e,i,a,n]:[e,i,a,o,n]:null},`trySimplifyWithDetourX`),p=s&&!c?f(i):c&&!s?f(r):null;p&&(V=p)}let W=[s,...O,...V,...j.reverse(),u];if(W.length>=3){let e=W[W.length-1],t=W[W.length-2],n=W[W.length-3],r=Math.abs(n.y-t.y)<$&&Math.abs(t.y-e.y)<$,i=Math.abs(n.x-t.x)<$&&Math.abs(t.x-e.x)<$;if(r){let r=Math.sign(t.x-n.x),i=Math.sign(e.x-n.x);r!==0&&r===i&&Math.abs(t.x-n.x)>Math.abs(e.x-n.x)&&W.splice(-2,1)}else if(i){let r=Math.sign(t.y-n.y),i=Math.sign(e.y-n.y);r!==0&&r===i&&Math.abs(t.y-n.y)>Math.abs(e.y-n.y)&&W.splice(-2,1)}}let G=[W[0]];for(let e=1;e<W.length-1;e++){if(e===1){G.push(W[e]);continue}let t=G[G.length-1],n=W[e],r=W[e+1];if(Math.abs(t.y-n.y)<$&&Math.abs(n.y-r.y)<$){if(n.x>t.x!=r.x>n.x){G.push(n);continue}}else if(Math.abs(t.x-n.x)<$&&Math.abs(n.x-r.x)<$){if(n.y>t.y!=r.y>n.y){G.push(n);continue}}else G.push(n)}G.push(W[W.length-1]);for(let t=0;t<G.length-1;t++){let n=G[t],r=G[t+1],i=Math.abs(n.x-r.x)<$?`vertical`:`horizontal`,a=i===`vertical`?n.x:n.y,o=i===`vertical`?Math.min(n.y,r.y):Math.min(n.x,r.x),s=i===`vertical`?Math.max(n.y,r.y):Math.max(n.x,r.x),c=f(i,a,o,s),l={edgeIndex:e,segmentIndex:t,orientation:i,pipe:c,trackIndex:0,from:o,to:s};h.push(l),g[e].push(h.length-1),c.tracks[0]||(c.tracks[0]={index:0,coord:c.coord,segments:[]}),c.tracks[0].segments.push({edgeIndex:e,segmentIndex:t,from:o,to:s})}}let ae=/* @__PURE__ */ t((e,t)=>e.from<t.to&&t.from<e.to,`segmentsOverlap`),oe=/* @__PURE__ */ t((e,t,n,r)=>{let i=!r.segments.some(n=>(n.edgeIndex!==t.edgeIndex||n.segmentIndex!==t.segmentIndex)&&ae(n,e)),a=!n.segments.some(n=>(n.edgeIndex!==e.edgeIndex||n.segmentIndex!==e.segmentIndex)&&ae(n,t));return i&&a?(e.trackIndex=r.index,t.trackIndex=n.index,n.segments=[...n.segments.filter(t=>t.edgeIndex!==e.edgeIndex||t.segmentIndex!==e.segmentIndex),{edgeIndex:t.edgeIndex,segmentIndex:t.segmentIndex,from:t.from,to:t.to}],r.segments=[...r.segments.filter(e=>e.edgeIndex!==t.edgeIndex||e.segmentIndex!==t.segmentIndex),{edgeIndex:e.edgeIndex,segmentIndex:e.segmentIndex,from:e.from,to:e.to}],!0):!1},`trySwapSegmentsAcrossTracks`),se=/* @__PURE__ */ t(e=>{let t=e.tracks.length;return e.tracks[t]={index:t,coord:e.coord,segments:[]},t},`createNewTrack`),N=/* @__PURE__ */ t((e,t)=>{let n=e.pipe.tracks[e.trackIndex];n.segments=n.segments.filter(t=>t.edgeIndex!==e.edgeIndex||t.segmentIndex!==e.segmentIndex),e.trackIndex=t,e.pipe.tracks[t].segments.push({edgeIndex:e.edgeIndex,segmentIndex:e.segmentIndex,from:e.from,to:e.to})},`moveSegmentToTrack`),P=/* @__PURE__ */ t((e,t)=>{let n=g[e.edgeIndex];for(let r of n){let n=h[r];n.pipe===e.pipe&&N(n,t)}},`moveSegmentChainToTrack`),F=/* @__PURE__ */ t(e=>{let t=g[e.edgeIndex],n=t.indexOf(h.indexOf(e)),r=[];return n>0&&r.push(h[t[n-1]]),n<t.length-1&&r.push(h[t[n+1]]),r},`getAdjacentSegmentsAlongEdge`),I=/* @__PURE__ */ t((e,t)=>{if(e.orientation===t.orientation)return!1;let n=e.orientation===`horizontal`?e:t,r=e.orientation===`horizontal`?t:e;return r.pipe.coord>n.from&&r.pipe.coord<n.to&&n.pipe.coord>r.from&&n.pipe.coord<r.to},`haveAnyCrossing`),L=/* @__PURE__ */ t((e,t)=>{for(let n of e.tracks)if(!n.segments.some(e=>(e.edgeIndex!==t.edgeIndex||e.segmentIndex!==t.segmentIndex)&&ae(e,t)))return n.index;return-1},`findAvailableTrack`),R=/* @__PURE__ */ t((e,t)=>{if(e.trackIndex===t.trackIndex)return ae(e,t);let n=F(e),r=F(t);return n.some(e=>r.some(t=>I(e,t)))},`segmentsConflict`),z=/* @__PURE__ */ t((e,t,n)=>{if(oe(e,t,e.pipe.tracks[e.trackIndex],t.pipe.tracks[t.trackIndex]))return;let r=L(e.pipe,t);n(t,r===-1?se(e.pipe):r)},`resolveTrackConflict`),ce=/* @__PURE__ */ t(e=>{let t=0;for(let n=0;n<e.length;n++)for(let r=n+1;r<e.length;r++){let i=e[n],a=e[r];i.pipe===a.pipe&&R(i,a)&&(t++,z(i,a,P))}return t},`resolveHandleConflicts`),B=/* @__PURE__ */ new Map,V=/* @__PURE__ */ t(e=>{if(B.has(e))return B.get(e);let t=g[e];if(t.length===0){let t={dest:0,deviation:0,base:0,delta:0};return B.set(e,t),t}let n=h[t[0]].pipe.coord,r=n;for(let e=1;e<t.length;e++){let i=h[t[e]];if(i.orientation===`horizontal`){let e=i.from,t=i.to;r=Math.abs(e-n)>Math.abs(t-n)?e:t;break}}let i=Math.abs(r-n),a={dest:r,deviation:i,base:n,delta:r-n};return B.set(e,a),a},`getDestInfo`),H=/* @__PURE__ */ t(()=>{let e=0,n=/* @__PURE__ */ new Map;for(let[e,t]of a.entries())g[e].length!==0&&t.start&&(n.has(t.start)||n.set(t.start,[]),n.get(t.start).push(e));let r=/* @__PURE__ */ t(e=>{let t=a[e];if(!t.start||!t.end)return 0;let n=o.get(t.start),r=o.get(t.end);if(!n||!r)return 0;let i=(r.x??0)-(n.x??0),s=(r.y??0)-(n.y??0);return Math.abs(i)+Math.abs(s)},`getEdgeDistance`);for(let t of n.values()){t.sort((e,t)=>{let n=V(e),i=V(t);if(Math.abs(n.deviation-i.deviation)>1)return n.deviation-i.deviation;if(Math.abs(n.dest-i.dest)>1)return n.dest-i.dest;let a=r(e),o=r(t);if(Math.abs(a-o)>1)return o-a;let s=g[e].length,c=g[t].length;if(s!==c)return s-c;if(s===1){let n=g[e][0],r=g[t][0];if(h[n]&&h[r]){let e=h[n],t=h[r],i=Math.abs(e.to-e.from),a=Math.abs(t.to-t.from);if(Math.abs(i-a)>1)return i-a}}return 0});let n=t.map(e=>h[g[e][0]]);e+=ce(n)}return e},`fixSourceHandleCrossings`),le=/* @__PURE__ */ t(()=>{let e=0,n=/* @__PURE__ */ new Map;for(let[e,t]of a.entries())g[e].length!==0&&t.end&&(n.has(t.end)||n.set(t.end,[]),n.get(t.end).push(e));for(let r of n.values()){r.sort((e,n)=>{let r=/* @__PURE__ */ t(e=>{let t=g[e];if(t.length<2)return 0;let n=h[t[t.length-2]];return Math.abs(n.to-n.from)},`getDist`),i=r(e),a=r(n);return Math.abs(i-a)>.1?i-a:e-n});let n=r.map(e=>h[g[e][g[e].length-1]]);e+=ce(n)}return e},`fixTargetHandleCrossings`),ue=/* @__PURE__ */ t(()=>{let e=0;for(let t of c){let n=[];for(let e of t.tracks)for(let t of e.segments){let e=g[t.edgeIndex].find(e=>h[e].segmentIndex===t.segmentIndex);e!==void 0&&n.push(h[e])}n.sort((e,t)=>e.edgeIndex-t.edgeIndex||e.segmentIndex-t.segmentIndex);for(let t=0;t<n.length;t++)for(let r=t+1;r<n.length;r++){let i=n[t],a=n[r];R(i,a)&&(e++,z(i,a,N))}}return e},`fixPipeCrossings`),de=0;for(;de<10;){let e=0;if(e+=H(),e+=le(),e+=ue(),e===0)break;de++}let fe=/* @__PURE__ */ new Map;for(let e of c){let n=[];e.tracks.forEach(e=>{e.segments.forEach(t=>{n.push({edgeIndex:t.edgeIndex,segmentIndex:t.segmentIndex,trackIndex:e.index,from:t.from,to:t.to})})}),n.sort((e,t)=>e.from-t.from);let r=[];if(n.length>0){let e=[n[0]],t=n[0].to;for(let i=1;i<n.length;i++){let a=n[i];a.from<t?(e.push(a),t=Math.max(t,a.to)):(r.push(e),e=[a],t=a.to)}r.push(e)}for(let n of r){let r=/* @__PURE__ */ new Set;n.forEach(e=>r.add(e.trackIndex));let i=/* @__PURE__ */ new Map;n.forEach(e=>{let t=V(e.edgeIndex);i.set(e.trackIndex,(i.get(e.trackIndex)??0)+t.delta)});let a=[...r].filter(e=>(i.get(e)??0)<-1),o=[...r].filter(e=>(i.get(e)??0)>1),s=[...r].filter(e=>Math.abs(i.get(e)??0)<=1);a.sort((e,t)=>(i.get(t)??0)-(i.get(e)??0)),o.sort((e,t)=>(i.get(e)??0)-(i.get(t)??0));let c=/* @__PURE__ */ t((t,r)=>{n.filter(e=>e.trackIndex===t).forEach(t=>{let n=_.has(t.edgeIndex)?e.coord:r;fe.set(`${t.edgeIndex}-${t.segmentIndex}`,n)})},`assignCoord`),l=0;for(let t of a)l++,c(t,e.coord-l*vr);if(s.length===0&&r.size>0){let e=[...r].sort((e,t)=>Math.abs(i.get(e)??0)-Math.abs(i.get(t)??0))[0],t=a.indexOf(e);t!==-1&&a.splice(t,1);let n=o.indexOf(e);n!==-1&&o.splice(n,1),s.push(e)}let u=0;for(let t of s){if(u===0)c(t,e.coord);else{let n=u%2==1?1:-1,r=Math.ceil(u/2);c(t,e.coord+n*r*vr*.5)}u++}let d=0;for(let t of o)d++,c(t,e.coord+d*vr)}}for(let[e,t]of a.entries()){let n=g[e]??[];if(n.length===0)continue;let r=[],{pSrcPort:i,pDstPort:a}=ie(e,o.get(t.start),o.get(t.end)),s=n.map(e=>{let t=h[e],n=fe.get(`${t.edgeIndex}-${t.segmentIndex}`)??t.pipe.coord;return{orient:t.orientation,coord:n,from:t.from,to:t.to}});r.push(i);for(let e=0;e<s.length;e++){let t=s[e],n=r[r.length-1],i=t.orient===`vertical`?n.y:n.x,a=t.orient===`vertical`?n.x:n.y,o=s[e+1],c=e<s.length-1;if(Math.abs(a-t.coord)>$&&r.push(Ln(t,i)),c&&o.orient===t.orient){if(Math.abs(t.coord-o.coord)>$){let e=t.orient===`vertical`?(i+o.from)/2:In(t,o);r.push(Ln(t,e),Ln(o,e))}else(e===0||e===s.length-2)&&r.push(Ln(t,In(t,o)))}else if(c)r.push(Ln(t,o.coord));else{let e=Math.abs(t.from-i)<Math.abs(t.to-i)?t.to:t.from;r.push(Ln(t,e))}}let c=r[r.length-1];(Math.abs(c.x-a.x)>$||Math.abs(c.y-a.y)>$)&&r.push(a);let l=[];r.length>0&&l.push(r[0]);for(let e=1;e<r.length;e++){let t=r[e],n=l[l.length-1];(Math.abs(t.x-n.x)>$||Math.abs(t.y-n.y)>$)&&l.push(t)}t.points=l}for(let e of a){let t=e.__originalEdge;t&&e.points&&(t.points=e.points)}e.edges=(e.edges??[]).filter(e=>!e.isLayoutOnly);let pe=/* @__PURE__ */ t((e,t)=>{let n=t.x??0,r=t.y??0,i=t.width??0,a=t.height??0;if(i<=0||a<=0)return e;let o=n-i/2,s=n+i/2,c=r-a/2,l=r+a/2;if(e.x<o||e.x>s||e.y<c||e.y>l)return e;let u=e.x-o,d=s-e.x,f=e.y-c,p=l-e.y,m=Math.min(u,d,f,p);return m===u?{x:o,y:e.y}:m===d?{x:s,y:e.y}:m===f?{x:e.x,y:c}:{x:e.x,y:l}},`nodeBoundaryClamp`);for(let t of e.edges){let e=t.points;if(!e||e.length<2)continue;let n=t.start,r=t.end,i=n?o.get(n):void 0,a=r?o.get(r):void 0;i&&(e[0]=pe(e[0],i)),a&&(e[e.length-1]=pe(e[e.length-1],a))}return e}function zn(e){return e.direction??`TB`}function Bn(e){let t=re(e),n=e.config.flowchart?.nodeSpacing??40,r=e.config.flowchart?.rankSpacing??100,i=e.config.swimlane?.ignoreCrossLaneEdges??!0,a=e.config.swimlane?.optimizeRanksByCrossings??!0,o=e.config.swimlane?.automaticLaneOrdering??!1,s=zn(e),{ordered:c,coordinates:l}=Pn(t,{nodeGap:n,layerGap:r,ignoreCrossLaneEdges:i,optimizeRanksByCrossings:a,automaticLaneOrdering:o,direction:s});ie(t,c,l,{nodeGap:n,layerGap:r});for(let t of e.edges??[])delete t.points;Rn(e,s);for(let t of e.edges??[])(!t.curve||t.curve===`basis`)&&(t.curve=`rounded`);return Ot(e,s),Dt(e),s}function Vn(e){ne(e);let t=ae(e);e.nodes=t.nodes,e.edges=t.edges}var Hn,Un,Wn,Gn,Kn,qn,Jn,Yn,q,J,Xn,Zn,Qn,$n,er,Y,X,Z,tr,nr,rr,Q,ir,ar,or,sr,cr,lr,ur,dr,fr,$,pr,mr,hr,gr,_r,vr,yr;function br(){return(br=e((()=>{h(),m(),f(),d(),u(),l(),c(),s(),o(),a(),r(),n(),Hn=5,Un=1e-5,Wn=1e-6,t(_,`buildSegmentList`),t(v,`segmentIntersection`),t(y,`isHorizontalSeg`),t(b,`findEdgeIntersections`),t(x,`fmt`),t(S,`pointToString`),t(C,`getArcSweepFlag`),Gn=.001,t(w,`applyMarkerOffsets`),t(T,`emitJump`),t(E,`computeRoundedCorner`),t(D,`rewriteEdgePath`),t(O,`isStraightPath`),t(k,`curveSupportsLineHops`),t(A,`decodeDataPoints`),t(j,`applyLineJumpsToSvg`),t(ee,`applySwimlaneLineJumps`),Kn=`__swimlane_default__`,qn=21,Jn=20,t(te,`topLaneHorizontalPadding`),t(M,`assignTopLaneTitleRect`),t(ne,`prepareLayoutForSwimlanes`),t(re,`toGraphView`),t(ie,`writeBackToLayoutData`),Yn=`[EdgeLabelNodes]`,t(ae,`createEdgeLabelNodes`),q=.001,t(oe,`measuredNodeRect`),t(se,`nodeBoundsInfoFor`),t(N,`samePoint`),t(P,`sameX`),t(F,`sameY`),t(I,`isHorizontalSegment`),t(L,`isVerticalSegment`),t(R,`overlapLength`),t(z,`sameAxisSegmentOverlapLength`),t(ce,`orthogonalSegmentsForPoints`),t(B,`countOrthogonalBends`),t(V,`dedupeConsecutivePoints`),t(H,`classifyThreeSegmentRoute`),t(le,`segmentBoundsOverlapRect`),t(ue,`pointInsideRect`),t(de,`rectContainsRect`),t(fe,`rectsOverlap`),t(pe,`inflateRect`),t(me,`rectFromCenterSize`),t(U,`rectOfNodeBounds`),t(W,`portForRectSide`),t(G,`buildOrthogonalPortPath`),t(he,`buildSameSideTrackPath`),t(ge,`collectRealNodeBounds`),t(_e,`collectNodeRectEntries`),t(ve,`collectLayoutNodeRects`),t(ye,`getNodePairGeometry`),t(K,`segmentHitsAnyRect`),t(be,`orthogonalSegmentsCross`),t(xe,`sameAxisSegmentsOverlap`),t(Se,`segmentConflictsWithAnyEdge`),t(Ce,`orthogonalSegmentsStrictlyCross`),t(we,`strictlyBetween`),t(Te,`isCollinearIntermediate`),t(Ee,`simplifyPolylineOnce`),t(De,`orthogonalizePolyline`),t(Oe,`simplifyPolyline`),J=.001,Xn=.5,Zn=4,t(ke,`endpointContextFor`),t(Ae,`segmentEnterPoint`),t(je,`clipEndpoint`),t(Me,`clipEdgeEndpointsToNodeBoundaries`),t(Ne,`snapEndpointToBoundary`),t(Pe,`firstDistinctAdjacent`),t(Fe,`cornerClearanceRange`),t(Ie,`clampToCornerClearance`),t(Le,`intersectRanges`),t(Re,`clearanceRangeForSide`),t(ze,`terminalSideForSegment`),t(Be,`isHorizontalSide`),t(Ve,`straightClearanceRange`),t(He,`clearStraightEndpointCornerAxis`),t(Ue,`clearStraightEndpointCornerConnections`),t(We,`cornerClearedEndpoint`),t(Ge,`moveCollinearEndpointRun`),t(Ke,`clearEndpointCornerConnection`),t(qe,`borderSideForSegment`),t(Je,`leavesOutward`),t(Ye,`collapseOwnBorderStub`),t(Xe,`snapAndCollapseEndpoints`),t(Ze,`prepareEdgeEndpointsForRenderer`),t(Qe,`buildNodeMap`),t($e,`resolveTopLevelGroupId`),t(et,`groupDepth`),t(tt,`boundsForChildren`),t(nt,`applyGroupBounds`),t(rt,`recomputeNestedGroupBounds`),t(it,`mirrorAxis`),t(at,`applyBtDirectionTransform`),t(ot,`applyLrDirectionTransform`),Qn=1e-6,$n=8,er=[0,$n,-$n,2*$n,-2*$n],t(st,`portSwapToLShape`),t(ct,`collapseShortTerminalStub`),Y=.001,X=8,Z=ce,tr=/* @__PURE__ */ t((e,t)=>P(e,t,Y)||F(e,t,Y),`orthogonallyAligned`),t(lt,`separateSharedRenderedTerminalLanes`),t(ut,`collapseRedundantRectangularDoglegs`),t(dt,`liftObstacleHuggingSameSideRails`),t(ft,`liftTopLaneTitleBandsAboveRails`),t(pt,`shiftLeftLaneTitleBandsLeftOfRails`),t(mt,`swapDestinationTerminalTailsToReduceCrossings`),t(ht,`reassignCrossingExternalRailChannels`),t(gt,`shortcutRedundantOrthogonalJogs`),t(_t,`resolveRenderedOrthogonalCrossings`),nr=.001,rr=8,t(vt,`simplifyDetouredEdges`),Q=.001,ir=10,ar=7,t(yt,`markerClearanceRectFor`),t(bt,`normalizeRect`),t(xt,`labelOverlapsOwnMarker`),t(St,`anchorLabelsToPolyline`),or=1e-6,sr=4,cr=3,t(Ct,`pairKey`),t(wt,`straightenCollinearSiblingDetours`),t(Tt,`nudgeSharedInteriorSubpaths`),t(Et,`segmentsIntersect`),t(Dt,`validateSwimlanesLayout`),t(Ot,`postProcessSwimlaneLayout`),t(kt,`normalizeGraph`),t(At,`incoming`),t(jt,`buildSuccessorMap`),t(Mt,`buildSortedSuccessorMap`),t(Nt,`buildInDegreeMap`),t(Pt,`sortedZeroInDegreeNodes`),t(Ft,`buildPredecessorSuccessorMaps`),t(It,`buildLayersFromRanks`),t(Lt,`topoSortIfAcyclic`),t(Rt,`buildLayerIndex`),t(zt,`countInversions`),t(Bt,`removeCycles_DFS`),t(Vt,`buildTopLaneMap`),t(Ht,`createTopLaneResolver`),t(Ut,`buildTopLaneOrder`),t(Wt,`resolveTopLaneOrder`),lr={EPSILON:1e-6},ur={GRAVITY_ITERATIONS:8,MAX_CROSSING_OPTIMIZATION_PASSES:4,DEFAULT_COMPACT_SINGLE_INPUT:!0},dr={DEFAULT_LAYER_GAP:100,DEFAULT_NODE_GAP:40},t(Gt,`buildDrivingTree`),t(Kt,`chooseParent`),t(qt,`buildAdjacency`),t(Jt,`assignComponents`),t(Yt,`computeBlocks`),t(Xt,`popBlock`),t(Zt,`computeSubtreeCrossCounts`),t(Qt,`annotateMinimumLayers`),t($t,`compareByRankThenId`),t(en,`emitNodesInTreeOrder`),t(tn,`deduplicateLayers`),t(nn,`createChildOrderer`),t(rn,`buildMultitreeLayerOrder`),t(an,`countCrossingsBetweenAdjacent`),t(on,`totalCrossings`),t(sn,`optimizeRanksByCrossings`),t(cn,`adjustCrossLaneSources`),t(ln,`assignLayers_LongestPath`),t(un,`assignLayers_Gravity`),t(dn,`topoSortByGenerationIfAcyclic`),t(fn,`assignLayers_LaneAwareCompact`),t(pn,`makeProperLayering`),t(mn,`median`),t(hn,`barycenter`),t(gn,`neighborPositionsFor`),t(_n,`currentOrderTieBreak`),t(vn,`countCrossingsBetweenAdjacent`),t(yn,`sortByHeuristic`),t(bn,`reorderLayer`),t(xn,`transposeImprove`),t(Sn,`orderLayers`),t(Cn,`assignCoordinates`),fr=8,t(wn,`hashString`),t(Tn,`mulberry32`),t(En,`deterministicShuffle`),t(Dn,`sourceDistance`),t(On,`laneArrangementCost`),t(kn,`buildWeightedLaneEdges`),t(An,`greedySwitch`),t(jn,`isBetterCandidate`),t(Mn,`seedForRestart`),t(Nn,`optimizeTopLaneOrder`),t(Pn,`sugiyamaLayout`),$=lr.EPSILON,pr=8,mr=15,hr=15,gr=25,_r=20,vr=10,t(Fn,`chooseOrthogonalSide`),t(In,`sharedLineEndpointCoord`),t(Ln,`pointOnLine`),t(Rn,`routeEdgesOrthogonal`),t(zn,`getSwimlaneDirection`),t(Bn,`runSwimlaneLayoutCore`),t(Vn,`prepareSwimlaneLayout`),yr=g({prepareLayout:Vn,runLayoutCore:Bn,afterPaint:ee})})))()}br();export{yr as render};
@@ -0,0 +1,8 @@
1
+ import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{n as t,r as n}from"./chunk-Y2CYZVJY-DjEHBC-3.js";import{C as r}from"./src-C1iDJpBK.js";import{j as i}from"./chunk-DU6HZSFF-Bx48E1rg.js";import{d as a}from"./chunk-75Z2AOVW-IO9R6faP.js";import{n as o}from"./chunk-PWAF6VOD-IORmPx9D.js";import{i as s}from"./chunk-GMAD6QVW-D41KnniX.js";import{n as c}from"./chunk-P2QGCYS3-C9bc1yiM.js";import{r as l}from"./chunk-4HAMMTFA-Aw59LwS3.js";import{r as u}from"./chunk-GVQU2GXP-CVzgM_ui.js";import{i as d}from"./chunk-OSK3NFVY-C9uWOXTC.js";import{l as f}from"./chunk-F27PBJKO-DtLva7y0.js";import{n as p}from"./chunk-XXDRQBXY-Bl6AoSZF.js";import{t as m}from"./chunk-POPQ4Y6H-P1s5xaxM.js";import{n as h}from"./chunk-L3NEJ4N5-CmvrS7Dt.js";import{n as g}from"./chunk-TLUHSLCS-DsqF476v.js";import{n as _}from"./chunk-LNGE3PJU-BP1fsJRz.js";import{i as v,r as y,t as b}from"./chunk-SHT3W25Y-Bip4melZ.js";var x;function S(){return(S=e((()=>{y(),p(),m(),_(),g(),f(),h(),d(),u(),l(),c(),s(),o(),a(),i(),r(),n(),x=b({defaultLayout:`swimlane`,styles:/* @__PURE__ */ t(e=>`${v(e)}
2
+ .swimlane.cluster rect {
3
+ stroke: ${e.clusterBorder} !important;
4
+ }
5
+ [data-look="neo"].cluster rect {
6
+ filter: none;
7
+ }
8
+ `,`getStyles`)})})))()}S();export{x as diagram};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{Children as t}from"react";import{useOptionalPreferences as n}from"@fudanda/react-core/hooks/usePreferences";import{Fragment as r,jsx as i}from"react/jsx-runtime";import{Tabs as a}from"antd";function o({children:e,items:r,className:o,size:s,type:c,collapsible:l,lazyRender:u,keepDOM:d,...f}){let p=n()?.preferences,m=p?.tabsType??c??`line`,h=p?.tabsSize;return/* @__PURE__ */ i(a,{...f,className:[`arc-page-tabs`,`arc-page-tabs--${m}`,o].filter(Boolean).join(` `),size:h===`medium`?`middle`:h??s,type:m===`card`||m===`button`?`card`:m===`editable-card`?`editable-card`:`line`,destroyOnHidden:f.destroyOnHidden??!d,items:r??t.toArray(e).filter(e=>typeof e==`object`&&!!e&&`props`in e).map(e=>({key:e.props.itemKey??String(e.key),label:e.props.tab,children:e.props.children,forceRender:u===!1}))})}var s,c;function l(){return(l=e((()=>{s=({children:e})=>/* @__PURE__ */ i(r,{children:e}),c=/* @__PURE__ */ Object.assign(o,{TabPane:s})})))()}export{c as n,l as r,s as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{createContext as t,useContext as n}from"react";function r(){let e=n(i);if(!e)throw Error(`useThemeController must be used within ThemeProvider`);return e}var i;function a(){return(a=e((()=>{i=t(null)})))()}export{a as n,r,i as t};
@@ -0,0 +1,120 @@
1
+ import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{n as t,r as n,t as r}from"./chunk-Y2CYZVJY-DjEHBC-3.js";import{C as i,S as a,t as o,w as s}from"./src-C1iDJpBK.js";import{Y as c,a as l,b as u,et as d,j as f,nt as p,o as m,ot as h,rt as g,st as _,tt as v,x as y}from"./chunk-DU6HZSFF-Bx48E1rg.js";import{t as b}from"./arc-B3K1fDeF.js";import{d as x,m as S}from"./chunk-75Z2AOVW-IO9R6faP.js";import{n as C,t as w}from"./chunk-CLGD4ZFX-tRS89bnq.js";function T(e,t){e.each(function(){var e=a(this),n=e.text().split(/(\s+|<br>)/).reverse(),r,i=[],o=1.1,s=e.attr(`y`),c=parseFloat(e.attr(`dy`)),l=e.text(null).append(`tspan`).attr(`x`,0).attr(`y`,s).attr(`dy`,c+`em`);for(let a=0;a<n.length;a++)r=n[n.length-1-a],i.push(r),l.text(i.join(` `).trim()),(l.node().getComputedTextLength()>t||r===`<br>`)&&(i.pop(),l.text(i.join(` `).trim()),i=r===`<br>`?[``]:[r],l=e.append(`tspan`).attr(`x`,0).attr(`y`,s).attr(`dy`,o+`em`).text(r))})}var E,D,O,k,A,j,M,N,P,F,I,L,R,ee,te,ne,re,z,B,V,ie,H,U,ae,oe,W,se,ce,G,le,ue,de,K,q,fe,pe,me,he,J,ge,Y,_e,ve,X,Z,ye,Q,be,xe,Se,Ce,$,we,Te,Ee,De,Oe,ke,Ae,je,Me;function Ne(){return(Ne=e((()=>{w(),x(),f(),i(),n(),o(),v(),p(),h(),E=(function(){var e=/* @__PURE__ */ t(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[6,11,13,14,15,17,19,20,23,24],r=[1,12],i=[1,13],a=[1,14],o=[1,15],s=[1,16],c=[1,19],l=[1,20],u={trace:/* @__PURE__ */ t(function(){},`trace`),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:`error`,6:`EOF`,7:`timeline`,8:`timeline_lr`,9:`timeline_td`,11:`SPACE`,13:`NEWLINE`,14:`title`,15:`acc_title`,16:`acc_title_value`,17:`acc_descr`,18:`acc_descr_value`,19:`acc_descr_multiline_value`,20:`section`,23:`period`,24:`event`},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:/* @__PURE__ */ t(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 3:r.setDirection(`LR`);break;case 4:r.setDirection(`TD`);break;case 5:this.$=[];break;case 6:a[s-1].push(a[s]),this.$=a[s-1];break;case 7:case 8:this.$=a[s];break;case 9:case 10:this.$=[];break;case 11:r.getCommonDb().setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 12:this.$=a[s].trim(),r.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=a[s].trim(),r.getCommonDb().setAccDescription(this.$);break;case 15:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 18:r.addTask(a[s],0,``),this.$=a[s];break;case 19:r.addEvent(a[s].substr(2)),this.$=a[s]}},`anonymous`),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(n,[2,5],{5:6}),e(n,[2,2]),e(n,[2,3]),e(n,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:r,15:i,17:a,19:o,20:s,21:17,22:18,23:c,24:l},e(n,[2,10],{1:[2,1]}),e(n,[2,6]),{12:21,14:r,15:i,17:a,19:o,20:s,21:17,22:18,23:c,24:l},e(n,[2,8]),e(n,[2,9]),e(n,[2,11]),{16:[1,22]},{18:[1,23]},e(n,[2,14]),e(n,[2,15]),e(n,[2,16]),e(n,[2,17]),e(n,[2,18]),e(n,[2,19]),e(n,[2,7]),e(n,[2,12]),e(n,[2,13])],defaultActions:{},parseError:/* @__PURE__ */ t(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:/* @__PURE__ */ t(function(e){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}t(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}t(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
+ `+h.showPosition()+`
3
+ Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};u.lexer=/* @__PURE__ */ (function(){return{EOF:1,parseError:/* @__PURE__ */ t(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:/* @__PURE__ */ t(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:/* @__PURE__ */ t(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:/* @__PURE__ */ t(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:/* @__PURE__ */ t(function(){return this._more=!0,this},`more`),reject:/* @__PURE__ */ t(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:/* @__PURE__ */ t(function(e){this.unput(this.match.slice(e))},`less`),pastInput:/* @__PURE__ */ t(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:/* @__PURE__ */ t(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:/* @__PURE__ */ t(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
5
+ `+t+`^`},`showPosition`),test_match:/* @__PURE__ */ t(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:/* @__PURE__ */ t(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e!==!1&&e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:/* @__PURE__ */ t(function(){return this.next()||this.lex()},`lex`),begin:/* @__PURE__ */ t(function(e){this.conditionStack.push(e)},`begin`),popState:/* @__PURE__ */ t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:/* @__PURE__ */ t(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:/* @__PURE__ */ t(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:/* @__PURE__ */ t(function(e){this.begin(e)},`pushState`),stateStackSize:/* @__PURE__ */ t(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:/* @__PURE__ */ t(function(e,t,n,r){switch(n){case 0:break;case 1:break;case 2:return 13;case 3:break;case 4:break;case 5:return 8;case 6:return 9;case 7:return 7;case 8:return 14;case 9:return this.begin(`acc_title`),15;case 10:return this.popState(),`acc_title_value`;case 11:return this.begin(`acc_descr`),17;case 12:return this.popState(),`acc_descr_value`;case 13:this.begin(`acc_descr_multiline`);break;case 14:this.popState();break;case 15:return`acc_descr_multiline_value`;case 16:return 20;case 17:return 24;case 18:return 23;case 19:return 6;case 20:return`INVALID`}},`anonymous`),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline[ \t]+LR\b)/i,/^(?:timeline[ \t]+TD\b)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[14,15],inclusive:!1},acc_descr:{rules:[12],inclusive:!1},acc_title:{rules:[10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,13,16,17,18,19,20],inclusive:!0}}}})();function d(){this.yy={}}return t(d,`Parser`),d.prototype=u,u.Parser=d,new d})(),E.parser=E,D=E,O={},r(O,{addEvent:()=>z,addSection:()=>ee,addTask:()=>re,addTaskOrg:()=>B,clear:()=>I,default:()=>ie,getCommonDb:()=>F,getDirection:()=>R,getSections:()=>te,getTasks:()=>ne,setDirection:()=>L}),k=``,A=0,j=`LR`,M=[],N=[],P=[],F=/* @__PURE__ */ t(()=>m,`getCommonDb`),I=/* @__PURE__ */ t(function(){M.length=0,N.length=0,k=``,P.length=0,j=`LR`,l()},`clear`),L=/* @__PURE__ */ t(function(e){j=e},`setDirection`),R=/* @__PURE__ */ t(function(){return j},`getDirection`),ee=/* @__PURE__ */ t(function(e){k=e,M.push(e)},`addSection`),te=/* @__PURE__ */ t(function(){return M},`getSections`),ne=/* @__PURE__ */ t(function(){let e=V(),t=0;for(;!e&&t<100;)e=V(),t++;return N.push(...P),N},`getTasks`),re=/* @__PURE__ */ t(function(e,t,n){let r={id:A++,section:k,type:k,task:e,score:t||0,events:n?[n]:[]};P.push(r)},`addTask`),z=/* @__PURE__ */ t(function(e){P.find(e=>e.id===A-1).events.push(e)},`addEvent`),B=/* @__PURE__ */ t(function(e){let t={section:k,type:k,description:e,task:e,classes:[]};N.push(t)},`addTaskOrg`),V=/* @__PURE__ */ t(function(){let e=/* @__PURE__ */ t(function(e){return P[e].processed},`compileTask`),n=!0;for(let[t,r]of P.entries())e(t),n&&=r.processed;return n},`compileTasks`),ie={clear:I,getCommonDb:F,getDirection:R,setDirection:L,addSection:ee,getSections:te,getTasks:ne,addTask:re,addTaskOrg:B,addEvent:z},H=0,U=/* @__PURE__ */ t(function(e,t){let n=e.append(`rect`);return n.attr(`x`,t.x),n.attr(`y`,t.y),n.attr(`fill`,t.fill),n.attr(`stroke`,t.stroke),n.attr(`width`,t.width),n.attr(`height`,t.height),n.attr(`rx`,t.rx),n.attr(`ry`,t.ry),t.class!==void 0&&n.attr(`class`,t.class),n},`drawRect`),ae=/* @__PURE__ */ t(function(e,n){let r=e.append(`circle`).attr(`cx`,n.cx).attr(`cy`,n.cy).attr(`class`,`face`).attr(`r`,15).attr(`stroke-width`,2).attr(`overflow`,`visible`),i=e.append(`g`);i.append(`circle`).attr(`cx`,n.cx-5).attr(`cy`,n.cy-5).attr(`r`,1.5).attr(`stroke-width`,2).attr(`fill`,`#666`).attr(`stroke`,`#666`),i.append(`circle`).attr(`cx`,n.cx+5).attr(`cy`,n.cy-5).attr(`r`,1.5).attr(`stroke-width`,2).attr(`fill`,`#666`).attr(`stroke`,`#666`);function a(e){let t=b().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(15/2).outerRadius(15/2.2);e.append(`path`).attr(`class`,`mouth`).attr(`d`,t).attr(`transform`,`translate(`+n.cx+`,`+(n.cy+2)+`)`)}t(a,`smile`);function o(e){let t=b().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(15/2).outerRadius(15/2.2);e.append(`path`).attr(`class`,`mouth`).attr(`d`,t).attr(`transform`,`translate(`+n.cx+`,`+(n.cy+7)+`)`)}t(o,`sad`);function s(e){e.append(`line`).attr(`class`,`mouth`).attr(`stroke`,2).attr(`x1`,n.cx-5).attr(`y1`,n.cy+7).attr(`x2`,n.cx+5).attr(`y2`,n.cy+7).attr(`class`,`mouth`).attr(`stroke-width`,`1px`).attr(`stroke`,`#666`)}return t(s,`ambivalent`),n.score>3?a(i):n.score<3?o(i):s(i),r},`drawFace`),oe=/* @__PURE__ */ t(function(e,t){let n=e.append(`circle`);return n.attr(`cx`,t.cx),n.attr(`cy`,t.cy),n.attr(`class`,`actor-`+t.pos),n.attr(`fill`,t.fill),n.attr(`stroke`,t.stroke),n.attr(`r`,t.r),n.class!==void 0&&n.attr(`class`,n.class),t.title!==void 0&&n.append(`title`).text(t.title),n},`drawCircle`),W=/* @__PURE__ */ t(function(e,t){let n=t.text.replace(/<br\s*\/?>/gi,` `),r=e.append(`text`);r.attr(`x`,t.x),r.attr(`y`,t.y),r.attr(`class`,`legend`),r.style(`text-anchor`,t.anchor),t.class!==void 0&&r.attr(`class`,t.class);let i=r.append(`tspan`);return i.attr(`x`,t.x+t.textMargin*2),i.text(n),r},`drawText`),se=/* @__PURE__ */ t(function(e,n){function r(e,t,n,r,i){return e+`,`+t+` `+(e+n)+`,`+t+` `+(e+n)+`,`+(t+r-i)+` `+(e+n-i*1.2)+`,`+(t+r)+` `+e+`,`+(t+r)}t(r,`genPoints`);let i=e.append(`polygon`);i.attr(`points`,r(n.x,n.y,50,20,7)),i.attr(`class`,`labelBox`),n.y+=n.labelMargin,n.x+=.5*n.labelMargin,W(e,n)},`drawLabel`),ce=/* @__PURE__ */ t(function(e,t,n){let r=e.append(`g`),i=K();i.x=t.x,i.y=t.y,i.fill=t.fill,i.width=n.width,i.height=n.height,i.class=`journey-section section-type-`+t.num,i.rx=3,i.ry=3,U(r,i),q(n)(t.text,r,i.x,i.y,i.width,i.height,{class:`journey-section section-type-`+t.num},n,t.colour)},`drawSection`),G=-1,le=/* @__PURE__ */ t(function(e,t,n,r){let i=t.x+n.width/2,a=e.append(`g`);G++,a.append(`line`).attr(`id`,r+`-task`+G).attr(`x1`,i).attr(`y1`,t.y).attr(`x2`,i).attr(`y2`,450).attr(`class`,`task-line`).attr(`stroke-width`,`1px`).attr(`stroke-dasharray`,`4 2`).attr(`stroke`,`#666`),ae(a,{cx:i,cy:300+(5-t.score)*30,score:t.score});let o=K();o.x=t.x,o.y=t.y,o.fill=t.fill,o.width=n.width,o.height=n.height,o.class=`task task-type-`+t.num,o.rx=3,o.ry=3,U(a,o),q(n)(t.task,a,o.x,o.y,o.width,o.height,{class:`task`},n,t.colour)},`drawTask`),ue=/* @__PURE__ */ t(function(e,t){U(e,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:`rect`}).lower()},`drawBackgroundRect`),de=/* @__PURE__ */ t(function(){return{x:0,y:0,fill:void 0,"text-anchor":`start`,width:100,height:100,textMargin:0,rx:0,ry:0}},`getTextObj`),K=/* @__PURE__ */ t(function(){return{x:0,y:0,width:100,anchor:`start`,height:100,rx:0,ry:0}},`getNoteRect`),q=/* @__PURE__ */ (function(){function e(e,t,n,r,a,o,s,c){i(t.append(`text`).attr(`x`,n+a/2).attr(`y`,r+o/2+5).style(`font-color`,c).style(`text-anchor`,`middle`).text(e),s)}t(e,`byText`);function n(e,t,n,r,a,o,s,c,l){let{taskFontSize:u,taskFontFamily:d}=c,f=e.split(/<br\s*\/?>/gi);for(let e=0;e<f.length;e++){let c=e*u-u*(f.length-1)/2,p=t.append(`text`).attr(`x`,n+a/2).attr(`y`,r).attr(`fill`,l).style(`text-anchor`,`middle`).style(`font-size`,u).style(`font-family`,d);p.append(`tspan`).attr(`x`,n+a/2).attr(`dy`,c).text(f[e]),p.attr(`y`,r+o/2).attr(`dominant-baseline`,`central`).attr(`alignment-baseline`,`central`),i(p,s)}}t(n,`byTspan`);function r(e,t,r,a,o,s,c,l){let u=t.append(`switch`),d=u.append(`foreignObject`).attr(`x`,r).attr(`y`,a).attr(`width`,o).attr(`height`,s).attr(`position`,`fixed`).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`);d.append(`div`).attr(`class`,`label`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).text(e),n(e,u,r,a,o,s,c,l),i(d,c)}t(r,`byFo`);function i(e,t){for(let n in t)n in t&&e.attr(n,t[n])}return t(i,`_setTextAttrs`),function(t){return t.textPlacement===`fo`?r:t.textPlacement===`old`?e:n}})(),fe=/* @__PURE__ */ t(function(e,t){H=0,G=-1,e.append(`defs`).append(`marker`).attr(`id`,t+`-arrowhead`).attr(`refX`,5).attr(`refY`,2).attr(`markerWidth`,6).attr(`markerHeight`,4).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 0,0 V 4 L6,2 Z`)},`initGraphics`),t(T,`wrap`),pe=/* @__PURE__ */ t(function(e,t,n,r,i,o=!1){let{theme:s,look:c}=r,l=s?.includes(`redux`),u=n%(r?.themeVariables?.THEME_COLOR_LIMIT??12)-1,d=e.append(`g`);t.section=u,d.attr(`class`,(t.class?t.class+` `:``)+`timeline-node `+(`section-`+u));let f=d.append(`g`),p=d.append(`g`),m=p.append(`text`).text(t.descr).attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).call(T,t.width).node().getBBox(),h=r.fontSize?.replace?r.fontSize.replace(`px`,``):r.fontSize;if(t.height=m.height+h*1.1*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width+=2*t.padding,p.attr(`transform`,`translate(`+t.width/2+`, `+t.padding/2+`)`),l&&p.attr(`transform`,`translate(${t.width/2}, ${o?t.padding/2+3:t.padding})`),he(f,t,u,i,r),c===`neo`&&(d.attr(`data-look`,`neo`),l)){let t=s.includes(`dark`),n=e.node()?.ownerSVGElement??e.node(),r=a(n),i=r.attr(`id`)??``,o=i?`${i}-drop-shadow`:`drop-shadow`;if(r.select(`#${o}`).empty()){let e=r.select(`defs`);(e.empty()?r.append(`defs`):e).append(`filter`).attr(`id`,o).attr(`height`,`130%`).attr(`width`,`130%`).append(`feDropShadow`).attr(`dx`,`4`).attr(`dy`,`4`).attr(`stdDeviation`,0).attr(`flood-opacity`,t?`0.2`:`0.06`).attr(`flood-color`,t?`#FFFFFF`:`#000000`)}}return t},`drawNode`),me=/* @__PURE__ */ t(function(e,t,n){let r=e.append(`g`),i=r.append(`text`).text(t.descr).attr(`dy`,`1em`).attr(`alignment-baseline`,`middle`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).call(T,t.width).node().getBBox(),a=n.fontSize?.replace?n.fontSize.replace(`px`,``):n.fontSize;return r.remove(),i.height+a*1.1*.5+t.padding},`getVirtualNodeHeight`),he=/* @__PURE__ */ t(function(e,t,n,r,i){let{theme:a}=i,o=a?.includes(`redux`)?0:5,s=o>0?`M0 ${t.height-5} v${-t.height+10} q0,-${o},${o},-${o} h${t.width-10} q${o},0,${o},${o} v${t.height-5} H0 Z`:`M0 ${t.height-5} v${-(t.height-5)} h${t.width} v${t.height} H0 Z`;e.append(`path`).attr(`id`,r+`-node-`+H++).attr(`class`,`node-bkg node-`+t.type).attr(`d`,s),a?.includes(`redux`)||e.append(`line`).attr(`class`,`node-line-`+n).attr(`x1`,0).attr(`y1`,t.height).attr(`x2`,t.width).attr(`y2`,t.height)},`defaultBkg`),J={drawRect:U,drawCircle:oe,drawSection:ce,drawText:W,drawLabel:se,drawTask:le,drawBackgroundRect:ue,getTextObj:de,getNoteRect:K,initGraphics:fe,drawNode:pe,getVirtualNodeHeight:me},ge=/* @__PURE__ */ t(function(e,t,n,r){let i=y(),{look:o,theme:l,themeVariables:u}=i,{useGradient:d,gradientStart:f,gradientStop:p}=u,m=i.timeline?.leftMargin??50;s.debug(`timeline`,r.db);let h=i.securityLevel,g;h===`sandbox`&&(g=a(`#i`+t));let _=a(h===`sandbox`?g.nodes()[0].contentDocument.body:`body`).select(`#`+t);_.append(`g`);let v=r.db.getTasks(),b=r.db.getCommonDb().getDiagramTitle();s.debug(`task`,v),J.initGraphics(_,t);let x=r.db.getSections();s.debug(`sections`,x);let S=0,C=0,w=0,T=0,E=50+m,D=50;T=50;let O=0,k=!0;x.forEach(function(e){let t={number:O,descr:e,section:O,width:150,padding:20,maxHeight:S},n=J.getVirtualNodeHeight(_,t,i);s.debug(`sectionHeight before draw`,n),S=Math.max(S,n+20)});let A=0,j=0;s.debug(`tasks.length`,v.length);for(let[e,t]of v.entries()){let n={number:e,descr:t,section:t.section,width:150,padding:20,maxHeight:C},r=J.getVirtualNodeHeight(_,n,i);s.debug(`taskHeight before draw`,r),C=Math.max(C,r+20),A=Math.max(A,t.events.length);let a=0;for(let e of t.events){let n={descr:e,section:t.section,number:t.section,width:150,padding:20,maxHeight:50};a+=J.getVirtualNodeHeight(_,n,i)}t.events.length>0&&(a+=(t.events.length-1)*10),j=Math.max(j,a)}s.debug(`maxSectionHeight before draw`,S),s.debug(`maxTaskHeight before draw`,C),x&&x.length>0?x.forEach(e=>{let n=v.filter(t=>t.section===e),r={number:O,descr:e,section:O,width:200*Math.max(n.length,1)-50,padding:20,maxHeight:S};s.debug(`sectionNode`,r);let a=_.append(`g`),o=J.drawNode(a,r,O,i,t);s.debug(`sectionNode output`,o),a.attr(`transform`,`translate(${E}, ${T})`),D+=S+50,n.length>0&&Y(_,n,O,E,D,C,i,A,j,S,!1,t),E+=200*Math.max(n.length,1),D=T,O++}):(k=!1,Y(_,v,O,E,D,C,i,A,j,S,!0,t));let M=_.node().getBBox();if(s.debug(`bounds`,M),b&&_.append(`text`).text(b).attr(`x`,o===`neo`?M.x*2+m:M.width/2-m).attr(`font-size`,`4ex`).attr(`font-weight`,`bold`).attr(`y`,20),w=k?S+C+150:C+100,_.append(`g`).attr(`class`,`lineWrapper`).append(`line`).attr(`x1`,m).attr(`y1`,w).attr(`x2`,M.width+3*m).attr(`y2`,w).attr(`stroke-width`,4).attr(`stroke`,`black`).attr(`marker-end`,`url(#${t}-arrowhead)`),o===`neo`&&d&&l!==`neutral`){let e=_.select(`defs`),t=(e.empty()?_.append(`defs`):e).append(`linearGradient`).attr(`id`,_.attr(`id`)+`-gradient`).attr(`gradientUnits`,`objectBoundingBox`).attr(`x1`,`0%`).attr(`y1`,`0%`).attr(`x2`,`100%`).attr(`y2`,`0%`);t.append(`stop`).attr(`offset`,`0%`).attr(`stop-color`,f).attr(`stop-opacity`,1),t.append(`stop`).attr(`offset`,`100%`).attr(`stop-color`,p).attr(`stop-opacity`,1)}c(void 0,_,i.timeline?.padding??50,i.timeline?.useMaxWidth??!1)},`draw`),Y=/* @__PURE__ */ t(function(e,t,n,r,i,a,o,c,l,u,d,f){for(let c of t){let t={descr:c.task,section:n,number:n,width:150,padding:20,maxHeight:a};s.debug(`taskNode`,t);let u=e.append(`g`).attr(`class`,`taskWrapper`),p=J.drawNode(u,t,n,o,f).height;if(s.debug(`taskHeight after draw`,p),u.attr(`transform`,`translate(${r}, ${i})`),a=Math.max(a,p),c.events){let t=e.append(`g`).attr(`class`,`lineWrapper`),s=a;i+=100,s+=_e(e,c.events,n,r,i,o,f),i-=100,t.append(`line`).attr(`x1`,r+95).attr(`y1`,i+a).attr(`x2`,r+95).attr(`y2`,i+a+100+l+100).attr(`stroke-width`,2).attr(`stroke`,`black`).attr(`marker-end`,`url(#${f}-arrowhead)`).attr(`stroke-dasharray`,`5,5`)}r+=200,d&&!o.timeline?.disableMulticolor&&n++}i-=10},`drawTasks`),_e=/* @__PURE__ */ t(function(e,t,n,r,i,a,o){let c=0,l=i;i+=100;for(let l of t){let t={descr:l,section:n,number:n,width:150,padding:20,maxHeight:50};s.debug(`eventNode`,t);let u=e.append(`g`).attr(`class`,`eventWrapper`),d=J.drawNode(u,t,n,a,o,!0).height;c+=d,u.attr(`transform`,`translate(${r}, ${i})`),i=i+10+d}return i=l,c},`drawEvents`),ve={setConf:/* @__PURE__ */ t(()=>{},`setConf`),draw:ge},X=200,Z=5,ye=X+Z*2,Q=X+100,be=Q+Z*2,xe=10,Se=0,Ce=20,$=20,we=30,Te=50,Ee=/* @__PURE__ */ t(function(e,t,n,r){let i=y(),a=i.timeline?.leftMargin??50;s.debug(`timeline`,r.db);let o=C(t);o.append(`g`);let l=r.db.getTasks(),u=r.db.getCommonDb().getDiagramTitle();s.debug(`task`,l),J.initGraphics(o);let d=r.db.getSections();s.debug(`sections`,d);let f=0,p=0,m=50+a,h=50,g=h,_=m,v=ye+$,b=be+Te,x=_+v,w=0,T=d&&d.length>0,E=T?x:m+v,D=Math.max(50,v+b-Z*2);d.forEach(function(e){let t={number:w,descr:e,section:w,width:D,padding:Z,maxHeight:f},n=J.getVirtualNodeHeight(o,t,i);s.debug(`sectionHeight before draw`,n),f=Math.max(f,n)});let O=0;s.debug(`tasks.length`,l.length);for(let[e,t]of l.entries()){let n={number:e,descr:t,section:t.section,width:X,padding:Z,maxHeight:p},r=J.getVirtualNodeHeight(o,n,i);s.debug(`taskHeight before draw`,r),p=Math.max(p,r);let a=0;for(let e of t.events){let n={descr:e,section:t.section,number:t.section,width:Q,padding:Z,maxHeight:50};a+=J.getVirtualNodeHeight(o,n,i)}t.events.length>0&&(a+=(t.events.length-1)*xe),O=Math.max(O,a)+Se}s.debug(`maxSectionHeight before draw`,f),s.debug(`maxTaskHeight before draw`,p);let k=Math.max(p,O)+we;T?d.forEach(e=>{let t=l.filter(t=>t.section===e),n={number:w,descr:e,section:w,width:D,padding:Z,maxHeight:f};s.debug(`sectionNode`,n);let r=o.append(`g`),a=J.drawNode(r,n,w,i);s.debug(`sectionNode output`,a);let c=E-v;r.attr(`transform`,`translate(${c}, ${h})`);let u=h+a.height+Ce;t.length>0&&De(o,t,w,E,u,p,i,k,!1);let d=t.length,m=a.height+Ce+k*Math.max(d,1)-(d>0?we*2:0);h+=m,w++}):De(o,l,w,E,h,p,i,k,!0);let A=o.node()?.getBBox();if(!A)throw Error(`bbox not found`);if(s.debug(`bounds`,A),u){if(o.append(`text`).text(u).attr(`x`,A.width/2-a).attr(`font-size`,`4ex`).attr(`font-weight`,`bold`).attr(`y`,20),A=o.node()?.getBBox(),!A)throw Error(`bbox not found`);s.debug(`bounds after title`,A)}let[j]=S(i.fontSize),M=(j??16)*2,N=(j??16)*.5+20,P=o.append(`g`).attr(`class`,`lineWrapper`);P.append(`line`).attr(`x1`,E).attr(`y1`,g-M).attr(`x2`,E).attr(`y2`,A.y+A.height+N).attr(`stroke-width`,4).attr(`stroke`,`black`).attr(`marker-end`,`url(#arrowhead)`),P.lower(),c(void 0,o,i.timeline?.padding??50,i.timeline?.useMaxWidth??!1)},`draw`),De=/* @__PURE__ */ t(function(e,t,n,r,i,a,o,c,l){for(let u of t){let t={descr:u.task,section:n,number:n,width:X,padding:Z,maxHeight:a};s.debug(`taskNode`,t);let d=e.append(`g`).attr(`class`,`taskWrapper`),f=J.drawNode(d,t,n,o),p=f.height;s.debug(`taskHeight after draw`,p);let m=r-$-f.width;if(d.attr(`transform`,`translate(${m}, ${i})`),a=Math.max(a,p),u.events&&u.events.length>0){let t=i,a=r+Te;Oe(e,u.events,n,r,a,t,o)}i+=c,l&&!o.timeline?.disableMulticolor&&n++}},`drawTasks`),Oe=/* @__PURE__ */ t(function(e,t,n,r,i,a,o){let c=a;for(let a of t){let t={descr:a,section:n,number:n,width:Q,padding:Z,maxHeight:0};s.debug(`eventNode`,t);let l=e.append(`g`).attr(`class`,`eventWrapper`),u=J.drawNode(l,t,n,o).height;l.attr(`transform`,`translate(${i}, ${c})`);let d=e.append(`g`).attr(`class`,`lineWrapper`),f=c+u/2;d.append(`line`).attr(`x1`,r).attr(`y1`,f).attr(`x2`,i).attr(`y2`,f).attr(`stroke-width`,2).attr(`stroke`,`black`).attr(`marker-end`,`url(#arrowhead)`).attr(`stroke-dasharray`,`5,5`),c=c+u+xe}return c-a},`drawEvents`),ke={setConf:/* @__PURE__ */ t(()=>{},`setConf`),draw:Ee},Ae=/* @__PURE__ */ t(e=>{let{theme:t}=u(),n=t?.includes(`dark`),r=t?.includes(`color`),i=e.svgId?.replace(/^#/,``)??``,a=i?`url(#${i}-drop-shadow)`:e.dropShadow??`none`,o=``;for(let t=0;t<e.THEME_COLOR_LIMIT;t++){let i=`${17-3*t}`,s=r?e.borderColorArray[t]:e.mainBkg,c=r?e.borderColorArray[t]:e.nodeBorder;o+=`
7
+ .section-${t-1} rect,
8
+ .section-${t-1} path,
9
+ .section-${t-1} circle {
10
+ fill: ${n&&r?e.mainBkg:s};
11
+ stroke: ${c};
12
+ stroke-width: ${e.strokeWidth};
13
+ filter: ${a};
14
+ }
15
+
16
+ .section-${t-1} text {
17
+ fill: ${e.nodeBorder};
18
+ font-weight: ${e.fontWeight}
19
+ }
20
+
21
+ .node-icon-${t-1} {
22
+ font-size: 40px;
23
+ color: ${e[`cScaleLabel`+t]};
24
+ }
25
+
26
+ .section-edge-${t-1} {
27
+ stroke: ${e[`cScale`+t]};
28
+ }
29
+
30
+ .edge-depth-${t-1} {
31
+ stroke-width: ${i};
32
+ }
33
+
34
+ .section-${t-1} line {
35
+ stroke: ${e[`cScaleInv`+t]};
36
+ stroke-width: 3;
37
+ }
38
+
39
+ .lineWrapper line {
40
+ stroke: ${e.nodeBorder};
41
+ stroke-width:${e.strokeWidth}
42
+ }
43
+
44
+ .disabled,
45
+ .disabled circle,
46
+ .disabled text {
47
+ fill: ${e.tertiaryColor??`lightgray`};
48
+ }
49
+
50
+ .disabled text {
51
+ fill: ${e.clusterBorder??`#efefef`};
52
+ }
53
+ `}return o},`genReduxSections`),je=/* @__PURE__ */ t(e=>{let t=``;for(let t=0;t<e.THEME_COLOR_LIMIT;t++)e[`lineColor`+t]=e[`lineColor`+t]||e[`cScaleInv`+t],_(e[`lineColor`+t])?e[`lineColor`+t]=g(e[`lineColor`+t],20):e[`lineColor`+t]=d(e[`lineColor`+t],20);for(let n=0;n<e.THEME_COLOR_LIMIT;n++){let r=``+(17-3*n);t+=`
54
+ .section-${n-1} rect, .section-${n-1} path, .section-${n-1} circle, .section-${n-1} path {
55
+ fill: ${e[`cScale`+n]};
56
+ }
57
+ .section-${n-1} text {
58
+ fill: ${e[`cScaleLabel`+n]};
59
+ }
60
+ .node-icon-${n-1} {
61
+ font-size: 40px;
62
+ color: ${e[`cScaleLabel`+n]};
63
+ }
64
+ .section-edge-${n-1}{
65
+ stroke: ${e[`cScale`+n]};
66
+ }
67
+ .edge-depth-${n-1}{
68
+ stroke-width: ${r};
69
+ }
70
+ .section-${n-1} line {
71
+ stroke: ${e[`cScaleInv`+n]} ;
72
+ stroke-width: 3;
73
+ }
74
+
75
+ .lineWrapper line{
76
+ stroke: ${e[`cScaleLabel`+n]} ;
77
+ }
78
+
79
+ .disabled, .disabled circle, .disabled text {
80
+ fill: ${e.tertiaryColor??`lightgray`};
81
+ }
82
+ .disabled text {
83
+ fill: ${e.clusterBorder??`#efefef`};
84
+ }
85
+ `}return t},`genSections`),Me={db:O,renderer:{setConf:/* @__PURE__ */ t(()=>{},`setConf`),draw:/* @__PURE__ */ t((e,t,n,r)=>(r?.db?.getDirection?.()??`LR`)===`TD`?ke.draw(e,t,n,r):ve.draw(e,t,n,r),`draw`)},parser:D,styles:/* @__PURE__ */ t(e=>{let{theme:t}=u(),n=t?.includes(`redux`),r=t===`neutral`,i=e.svgId?.replace(/^#/,``)??``,a=``;if(e.useGradient&&i&&e.THEME_COLOR_LIMIT&&!r)for(let t=0;t<e.THEME_COLOR_LIMIT;t++)a+=`
86
+ .section-${t-1}[data-look="neo"] rect,
87
+ .section-${t-1}[data-look="neo"] path,
88
+ .section-${t-1}[data-look="neo"] circle {
89
+ fill: ${e.mainBkg};
90
+ stroke: url(#${i}-gradient);
91
+ stroke-width: 2;
92
+ }
93
+ .section-${t-1}[data-look="neo"] line {
94
+ stroke: url(#${i}-gradient);
95
+ stroke-width: 2;
96
+ }`;return`
97
+ .edge {
98
+ stroke-width: 3;
99
+ }
100
+ ${n?Ae(e):je(e)}
101
+ ${a}
102
+ .section-root rect, .section-root path, .section-root circle {
103
+ fill: ${e.git0};
104
+ }
105
+ .section-root text {
106
+ fill: ${e.gitBranchLabel0};
107
+ }
108
+ .icon-container {
109
+ height:100%;
110
+ display: flex;
111
+ justify-content: center;
112
+ align-items: center;
113
+ }
114
+ .edge {
115
+ fill: none;
116
+ }
117
+ .eventWrapper {
118
+ filter: brightness(120%);
119
+ }
120
+ `},`getStyles`)}})))()}Ne();export{Me as diagram};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-BKuNeK48.js";var t,n;function r(){return(r=e((()=>{t=4096,n=(e,t)=>{let n=Math.max(2,Math.floor(t));if(e.length<=n)return e.map((e,t)=>t);let r=Math.max(1,Math.floor((n-2)/2)),i=(e.length-2)/r,a=[0];for(let t=0;t<r;t+=1){let n=Math.max(1,Math.floor(1+t*i)),r=Math.min(e.length-1,Math.ceil(1+(t+1)*i)),o=n,s=n;for(let t=n+1;t<r;t+=1)e[t]<e[o]&&(o=t),e[t]>e[s]&&(s=t);o<=s?a.push(o,s):a.push(s,o)}return a.push(e.length-1),Array.from(new Set(a))}})))()}function i(e){"@babel/helpers - typeof";return i=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},i(e)}function a(e,t){if(e||=``,t||={},e instanceof a)return e;if(!(this instanceof a))return new a(e,t);var n=o(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}function o(e){var t={r:0,g:0,b:0},n=1,r=null,a=null,o=null,c=!1,u=!1;return typeof e==`string`&&(e=z(e)),i(e)==`object`&&(R(e.r)&&R(e.g)&&R(e.b)?(t=s(e.r,e.g,e.b),c=!0,u=String(e.r).substr(-1)===`%`?`prgb`:`rgb`):R(e.h)&&R(e.s)&&R(e.v)?(r=F(e.s),a=F(e.v),t=d(e.h,r,a),c=!0,u=`hsv`):R(e.h)&&R(e.s)&&R(e.l)&&(r=F(e.s),o=F(e.l),t=l(e.h,r,o),c=!0,u=`hsl`),e.hasOwnProperty(`a`)&&(n=e.a)),n=O(n),{ok:c,format:e.format||u,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}function s(e,t,n){return{r:k(e,255)*255,g:k(t,255)*255,b:k(n,255)*255}}function c(e,t,n){e=k(e,255),t=k(t,255),n=k(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),a,o,s=(r+i)/2;if(r==i)a=o=0;else{var c=r-i;switch(o=s>.5?c/(2-r-i):c/(r+i),r){case e:a=(t-n)/c+(t<n?6:0);break;case t:a=(n-e)/c+2;break;case n:a=(e-t)/c+4}a/=6}return{h:a,s:o,l:s}}function l(e,t,n){var r,i,a;e=k(e,360),t=k(t,100),n=k(n,100);function o(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(t===0)r=i=a=n;else{var s=n<.5?n*(1+t):n+t-n*t,c=2*n-s;r=o(c,s,e+1/3),i=o(c,s,e),a=o(c,s,e-1/3)}return{r:r*255,g:i*255,b:a*255}}function u(e,t,n){e=k(e,255),t=k(t,255),n=k(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),a,o,s=r,c=r-i;if(o=r===0?0:c/r,r==i)a=0;else{switch(r){case e:a=(t-n)/c+(t<n?6:0);break;case t:a=(n-e)/c+2;break;case n:a=(e-t)/c+4}a/=6}return{h:a,s:o,v:s}}function d(e,t,n){e=k(e,360)*6,t=k(t,100),n=k(n,100);var r=Math.floor(e),i=e-r,a=n*(1-t),o=n*(1-i*t),s=n*(1-(1-i)*t),c=r%6,l=[n,o,a,a,s,n][c],u=[s,n,n,o,a,a][c],d=[a,a,s,n,n,o][c];return{r:l*255,g:u*255,b:d*255}}function f(e,t,n,r){var i=[P(Math.round(e).toString(16)),P(Math.round(t).toString(16)),P(Math.round(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join(``)}function p(e,t,n,r,i){var a=[P(Math.round(e).toString(16)),P(Math.round(t).toString(16)),P(Math.round(n).toString(16)),P(I(r))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join(``)}function m(e,t,n,r){return[P(I(r)),P(Math.round(e).toString(16)),P(Math.round(t).toString(16)),P(Math.round(n).toString(16))].join(``)}function h(e,t){t=t===0?0:t||10;var n=a(e).toHsl();return n.s-=t/100,n.s=A(n.s),a(n)}function g(e,t){t=t===0?0:t||10;var n=a(e).toHsl();return n.s+=t/100,n.s=A(n.s),a(n)}function _(e){return a(e).desaturate(100)}function v(e,t){t=t===0?0:t||10;var n=a(e).toHsl();return n.l+=t/100,n.l=A(n.l),a(n)}function y(e,t){t=t===0?0:t||10;var n=a(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),a(n)}function b(e,t){t=t===0?0:t||10;var n=a(e).toHsl();return n.l-=t/100,n.l=A(n.l),a(n)}function x(e,t){var n=a(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,a(n)}function S(e){var t=a(e).toHsl();return t.h=(t.h+180)%360,a(t)}function C(e,t){if(isNaN(t)||t<=0)throw Error(`Argument to polyad must be a positive number`);for(var n=a(e).toHsl(),r=[a(e)],i=360/t,o=1;o<t;o++)r.push(a({h:(n.h+o*i)%360,s:n.s,l:n.l}));return r}function w(e){var t=a(e).toHsl(),n=t.h;return[a(e),a({h:(n+72)%360,s:t.s,l:t.l}),a({h:(n+216)%360,s:t.s,l:t.l})]}function T(e,t,n){t||=6,n||=30;var r=a(e).toHsl(),i=360/n,o=[a(e)];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,o.push(a(r));return o}function E(e,t){t||=6;for(var n=a(e).toHsv(),r=n.h,i=n.s,o=n.v,s=[],c=1/t;t--;)s.push(a({h:r,s:i,v:o})),o=(o+c)%1;return s}function D(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}function O(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function k(e,t){M(e)&&(e=`100%`);var n=N(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function A(e){return Math.min(1,Math.max(0,e))}function j(e){return parseInt(e,16)}function M(e){return typeof e==`string`&&e.indexOf(`.`)!=-1&&parseFloat(e)===1}function N(e){return typeof e==`string`&&e.indexOf(`%`)!=-1}function P(e){return e.length==1?`0`+e:``+e}function F(e){return e<=1&&(e=e*100+`%`),e}function I(e){return Math.round(parseFloat(e)*255).toString(16)}function L(e){return j(e)/255}function R(e){return!!G.CSS_UNIT.exec(e)}function z(e){e=e.replace(V,``).replace(H,``).toLowerCase();var t=!1;if(U[e])e=U[e],t=!0;else if(e==`transparent`)return{r:0,g:0,b:0,a:0,format:`name`};var n;return(n=G.rgb.exec(e))?{r:n[1],g:n[2],b:n[3]}:(n=G.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=G.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=G.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=G.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=G.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=G.hex8.exec(e))?{r:j(n[1]),g:j(n[2]),b:j(n[3]),a:L(n[4]),format:t?`name`:`hex8`}:(n=G.hex6.exec(e))?{r:j(n[1]),g:j(n[2]),b:j(n[3]),format:t?`name`:`hex`}:(n=G.hex4.exec(e))?{r:j(n[1]+``+n[1]),g:j(n[2]+``+n[2]),b:j(n[3]+``+n[3]),a:L(n[4]+``+n[4]),format:t?`name`:`hex8`}:(n=G.hex3.exec(e))?{r:j(n[1]+``+n[1]),g:j(n[2]+``+n[2]),b:j(n[3]+``+n[3]),format:t?`name`:`hex`}:!1}function B(e){var t,n;return e||={level:`AA`,size:`small`},t=(e.level||`AA`).toUpperCase(),n=(e.size||`small`).toLowerCase(),t!==`AA`&&t!==`AAA`&&(t=`AA`),n!==`small`&&n!==`large`&&(n=`small`),{level:t,size:n}}var V,H,U,W,G;function K(){return(K=e((()=>{V=/^\s+/,H=/\s+$/,a.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),t=e.r/255,n=e.g/255,r=e.b/255,i=t<=.03928?t/12.92:((t+.055)/1.055)**2.4,a=n<=.03928?n/12.92:((n+.055)/1.055)**2.4,o=r<=.03928?r/12.92:((r+.055)/1.055)**2.4;return .2126*i+.7152*a+.0722*o},setAlpha:function(e){return this._a=O(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=u(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=u(this._r,this._g,this._b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.v*100);return this._a==1?`hsv(`+t+`, `+n+`%, `+r+`%)`:`hsva(`+t+`, `+n+`%, `+r+`%, `+this._roundA+`)`},toHsl:function(){var e=c(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=c(this._r,this._g,this._b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.l*100);return this._a==1?`hsl(`+t+`, `+n+`%, `+r+`%)`:`hsla(`+t+`, `+n+`%, `+r+`%, `+this._roundA+`)`},toHex:function(e){return f(this._r,this._g,this._b,e)},toHexString:function(e){return`#`+this.toHex(e)},toHex8:function(e){return p(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return`#`+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?`rgb(`+Math.round(this._r)+`, `+Math.round(this._g)+`, `+Math.round(this._b)+`)`:`rgba(`+Math.round(this._r)+`, `+Math.round(this._g)+`, `+Math.round(this._b)+`, `+this._roundA+`)`},toPercentageRgb:function(){return{r:Math.round(k(this._r,255)*100)+`%`,g:Math.round(k(this._g,255)*100)+`%`,b:Math.round(k(this._b,255)*100)+`%`,a:this._a}},toPercentageRgbString:function(){return this._a==1?`rgb(`+Math.round(k(this._r,255)*100)+`%, `+Math.round(k(this._g,255)*100)+`%, `+Math.round(k(this._b,255)*100)+`%)`:`rgba(`+Math.round(k(this._r,255)*100)+`%, `+Math.round(k(this._g,255)*100)+`%, `+Math.round(k(this._b,255)*100)+`%, `+this._roundA+`)`},toName:function(){return this._a===0?`transparent`:this._a<1?!1:W[f(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var t=`#`+m(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?`GradientType = 1, `:``;if(e){var i=a(e);n=`#`+m(i._r,i._g,i._b,i._a)}return`progid:DXImageTransform.Microsoft.gradient(`+r+`startColorstr=`+t+`,endColorstr=`+n+`)`},toString:function(e){var t=!!e;e||=this._format;var n=!1,r=this._a<1&&this._a>=0;return!t&&r&&(e===`hex`||e===`hex6`||e===`hex3`||e===`hex4`||e===`hex8`||e===`name`)?e===`name`&&this._a===0?this.toName():this.toRgbString():(e===`rgb`&&(n=this.toRgbString()),e===`prgb`&&(n=this.toPercentageRgbString()),(e===`hex`||e===`hex6`)&&(n=this.toHexString()),e===`hex3`&&(n=this.toHexString(!0)),e===`hex4`&&(n=this.toHex8String(!0)),e===`hex8`&&(n=this.toHex8String()),e===`name`&&(n=this.toName()),e===`hsl`&&(n=this.toHslString()),e===`hsv`&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return a(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(v,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(b,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(_,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(T,arguments)},complement:function(){return this._applyCombination(S,arguments)},monochromatic:function(){return this._applyCombination(E,arguments)},splitcomplement:function(){return this._applyCombination(w,arguments)},triad:function(){return this._applyCombination(C,[3])},tetrad:function(){return this._applyCombination(C,[4])}},a.fromRatio=function(e,t){if(i(e)==`object`){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=r===`a`?e[r]:F(e[r]));e=n}return a(e,t)},a.equals=function(e,t){return!e||!t?!1:a(e).toRgbString()==a(t).toRgbString()},a.random=function(){return a.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},a.mix=function(e,t,n){n=n===0?0:n||50;var r=a(e).toRgb(),i=a(t).toRgb(),o=n/100;return a({r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a})},a.readability=function(e,t){var n=a(e),r=a(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},a.isReadable=function(e,t,n){var r=a.readability(e,t),i,o=!1;switch(i=B(n),i.level+i.size){case`AAsmall`:case`AAAlarge`:o=r>=4.5;break;case`AAlarge`:o=r>=3;break;case`AAAsmall`:o=r>=7}return o},a.mostReadable=function(e,t,n){var r=null,i=0,o,s,c,l;n||={},s=n.includeFallbackColors,c=n.level,l=n.size;for(var u=0;u<t.length;u++)o=a.readability(e,t[u]),o>i&&(i=o,r=a(t[u]));return a.isReadable(e,r,{level:c,size:l})||!s?r:(n.includeFallbackColors=!1,a.mostReadable(e,[`#fff`,`#000`],n))},U=a.names={aliceblue:`f0f8ff`,antiquewhite:`faebd7`,aqua:`0ff`,aquamarine:`7fffd4`,azure:`f0ffff`,beige:`f5f5dc`,bisque:`ffe4c4`,black:`000`,blanchedalmond:`ffebcd`,blue:`00f`,blueviolet:`8a2be2`,brown:`a52a2a`,burlywood:`deb887`,burntsienna:`ea7e5d`,cadetblue:`5f9ea0`,chartreuse:`7fff00`,chocolate:`d2691e`,coral:`ff7f50`,cornflowerblue:`6495ed`,cornsilk:`fff8dc`,crimson:`dc143c`,cyan:`0ff`,darkblue:`00008b`,darkcyan:`008b8b`,darkgoldenrod:`b8860b`,darkgray:`a9a9a9`,darkgreen:`006400`,darkgrey:`a9a9a9`,darkkhaki:`bdb76b`,darkmagenta:`8b008b`,darkolivegreen:`556b2f`,darkorange:`ff8c00`,darkorchid:`9932cc`,darkred:`8b0000`,darksalmon:`e9967a`,darkseagreen:`8fbc8f`,darkslateblue:`483d8b`,darkslategray:`2f4f4f`,darkslategrey:`2f4f4f`,darkturquoise:`00ced1`,darkviolet:`9400d3`,deeppink:`ff1493`,deepskyblue:`00bfff`,dimgray:`696969`,dimgrey:`696969`,dodgerblue:`1e90ff`,firebrick:`b22222`,floralwhite:`fffaf0`,forestgreen:`228b22`,fuchsia:`f0f`,gainsboro:`dcdcdc`,ghostwhite:`f8f8ff`,gold:`ffd700`,goldenrod:`daa520`,gray:`808080`,green:`008000`,greenyellow:`adff2f`,grey:`808080`,honeydew:`f0fff0`,hotpink:`ff69b4`,indianred:`cd5c5c`,indigo:`4b0082`,ivory:`fffff0`,khaki:`f0e68c`,lavender:`e6e6fa`,lavenderblush:`fff0f5`,lawngreen:`7cfc00`,lemonchiffon:`fffacd`,lightblue:`add8e6`,lightcoral:`f08080`,lightcyan:`e0ffff`,lightgoldenrodyellow:`fafad2`,lightgray:`d3d3d3`,lightgreen:`90ee90`,lightgrey:`d3d3d3`,lightpink:`ffb6c1`,lightsalmon:`ffa07a`,lightseagreen:`20b2aa`,lightskyblue:`87cefa`,lightslategray:`789`,lightslategrey:`789`,lightsteelblue:`b0c4de`,lightyellow:`ffffe0`,lime:`0f0`,limegreen:`32cd32`,linen:`faf0e6`,magenta:`f0f`,maroon:`800000`,mediumaquamarine:`66cdaa`,mediumblue:`0000cd`,mediumorchid:`ba55d3`,mediumpurple:`9370db`,mediumseagreen:`3cb371`,mediumslateblue:`7b68ee`,mediumspringgreen:`00fa9a`,mediumturquoise:`48d1cc`,mediumvioletred:`c71585`,midnightblue:`191970`,mintcream:`f5fffa`,mistyrose:`ffe4e1`,moccasin:`ffe4b5`,navajowhite:`ffdead`,navy:`000080`,oldlace:`fdf5e6`,olive:`808000`,olivedrab:`6b8e23`,orange:`ffa500`,orangered:`ff4500`,orchid:`da70d6`,palegoldenrod:`eee8aa`,palegreen:`98fb98`,paleturquoise:`afeeee`,palevioletred:`db7093`,papayawhip:`ffefd5`,peachpuff:`ffdab9`,peru:`cd853f`,pink:`ffc0cb`,plum:`dda0dd`,powderblue:`b0e0e6`,purple:`800080`,rebeccapurple:`663399`,red:`f00`,rosybrown:`bc8f8f`,royalblue:`4169e1`,saddlebrown:`8b4513`,salmon:`fa8072`,sandybrown:`f4a460`,seagreen:`2e8b57`,seashell:`fff5ee`,sienna:`a0522d`,silver:`c0c0c0`,skyblue:`87ceeb`,slateblue:`6a5acd`,slategray:`708090`,slategrey:`708090`,snow:`fffafa`,springgreen:`00ff7f`,steelblue:`4682b4`,tan:`d2b48c`,teal:`008080`,thistle:`d8bfd8`,tomato:`ff6347`,turquoise:`40e0d0`,violet:`ee82ee`,wheat:`f5deb3`,white:`fff`,whitesmoke:`f5f5f5`,yellow:`ff0`,yellowgreen:`9acd32`},W=a.hexNames=D(U),G=function(){var e=`(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)`,t=`[\\s|\\(]+(`+e+`)[,|\\s]+(`+e+`)[,|\\s]+(`+e+`)\\s*\\)?`,n=`[\\s|\\(]+(`+e+`)[,|\\s]+(`+e+`)[,|\\s]+(`+e+`)[,|\\s]+(`+e+`)\\s*\\)?`;return{CSS_UNIT:new RegExp(e),rgb:RegExp(`rgb`+t),rgba:RegExp(`rgba`+n),hsl:RegExp(`hsl`+t),hsla:RegExp(`hsla`+n),hsv:RegExp(`hsv`+t),hsva:RegExp(`hsva`+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}()})))()}export{r as a,n as i,a as n,t as r,K as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-BKuNeK48.js";function t(e,t){return Array.from(e.getElementsByTagName(t))}function n(e){return e[0]===`#`?e:`#${e}`}function r(e,t,n){return Array.from(e.getElementsByTagNameNS(n,t))}function i(e){return e?.normalize(),e?.textContent||``}function a(e,t,n){let r=e.getElementsByTagName(t),i=r.length?r[0]:null;return i&&n&&n(i),i}function o(e,t,n){let r={};if(!e)return r;let i=e.getElementsByTagName(t),a=i.length?i[0]:null;return a&&n?n(a,r):r}function s(e,t,n){let r=i(a(e,t));return r&&n&&n(r)||{}}function c(e,t,n){let r=Number.parseFloat(i(a(e,t)));if(!Number.isNaN(r))return r&&n&&n(r)||{}}function l(e,t,n){let r=Number.parseFloat(i(a(e,t)));if(!Number.isNaN(r))return n&&n(r),r}function u(e,t){let n={};for(let r of t)s(e,r,e=>{n[r]=e});return n}function d(e){return e?.nodeType===1}function f(e){let t=[];if(e===null)return t;for(let n of Array.from(e.childNodes)){if(!d(n))continue;let e=ee(n.nodeName);if(e===`gpxtpx:TrackPointExtension`)t=t.concat(f(n));else{let r=i(n);t.push([e,te(r)])}}return t}function ee(e){return[`heart`,`gpxtpx:hr`,`hr`].includes(e)?`heart`:e}function te(e){let t=Number.parseFloat(e);return Number.isNaN(t)?e:t}function p(e){let t=[Number.parseFloat(e.getAttribute(`lon`)||``),Number.parseFloat(e.getAttribute(`lat`)||``)];if(Number.isNaN(t[0])||Number.isNaN(t[1]))return null;l(e,`ele`,e=>{t.push(e)});let n=a(e,`time`);return{coordinates:t,time:n?i(n):null,extendedValues:f(a(e,`extensions`))}}function m(e){return o(e,`line`,e=>Object.assign({},s(e,`color`,e=>({stroke:`#${e}`})),c(e,`opacity`,e=>({"stroke-opacity":e})),c(e,`width`,e=>({"stroke-width":e*96/25.4}))))}function h(e,n){let r=u(n,[`name`,`cmt`,`desc`,`type`,`time`,`keywords`]);for(let[t,a]of e)for(let e of Array.from(n.getElementsByTagNameNS(a,`*`)))r[e.tagName.replace(`:`,`_`)]=i(e)?.trim();let a=t(n,`link`);return a.length&&(r.links=a.map(e=>Object.assign({href:e.getAttribute(`href`)},u(e,[`text`,`type`])))),r}function g(e,n){let r=t(e,n),i=[],a=[],o={};for(let e=0;e<r.length;e++){let t=p(r[e]);if(t){i.push(t.coordinates),t.time&&a.push(t.time);for(let[n,i]of t.extendedValues){let t=n===`heart`?n:`${n.replace(`gpxtpx:`,``)}s`;o[t]||(o[t]=Array(r.length).fill(null)),o[t][e]=i}}}if(!(i.length<2))return{line:i,times:a,extendedValues:o}}function ne(e,t){let n=g(t,`rtept`);if(n)return{type:`Feature`,properties:Object.assign({_gpxType:`rte`},h(e,t),m(a(t,`extensions`))),geometry:{type:`LineString`,coordinates:n.line}}}function re(e,n){let r=t(n,`trkseg`),i=[],o=[],s=[];for(let e of r){let t=g(e,`trkpt`);t&&(s.push(t),t.times?.length&&o.push(t.times))}if(s.length===0)return null;let c=s.length>1,l=Object.assign({_gpxType:`trk`},h(e,n),m(a(n,`extensions`)),o.length?{coordinateProperties:{times:c?o:o[0]}}:{});for(let e=0;e<s.length;e++){let t=s[e];i.push(t.line),l.coordinateProperties||={};let n=l.coordinateProperties;for(let[r,i]of Object.entries(t.extendedValues))c?(n[r]||(n[r]=s.map(e=>Array(e.line.length).fill(null))),n[r][e]=i):n[r]=i}return{type:`Feature`,properties:l,geometry:c?{type:`MultiLineString`,coordinates:i}:{type:`LineString`,coordinates:i[0]}}}function ie(e,t){let n=Object.assign(h(e,t),u(t,[`sym`])),r=p(t);return r?{type:`Feature`,properties:n,geometry:{type:`Point`,coordinates:r.coordinates}}:null}function*_(e){let n=e,r=`http://www.garmin.com/xmlschemas/GpxExtensions/v3`,i=[[`gpxx`,r]],a=n.getElementsByTagName(`gpx`)[0]?.attributes;if(a)for(let e of Array.from(a))e.name?.startsWith(`xmlns:`)&&e.value!==r&&i.push([e.name,e.value]);for(let e of t(n,`trk`)){let t=re(i,e);t&&(yield t)}for(let e of t(n,`rte`)){let t=ne(i,e);t&&(yield t)}for(let e of t(n,`wpt`)){let t=ie(i,e);t&&(yield t)}}function ae(e){return{type:`FeatureCollection`,features:Array.from(_(e))}}function v(e,t){let n=[];for(let[r,o]of t){let t=a(e,r);if(!t){let n=e.getElementsByTagNameNS(H,r);n.length&&(t=n[0])}let s=Number.parseFloat(i(t));Number.isNaN(s)||n.push([o,s])}return n}function oe(e){let t=[l(e,`LongitudeDegrees`),l(e,`LatitudeDegrees`)];if(t[0]===void 0||Number.isNaN(t[0])||t[1]===void 0||Number.isNaN(t[1]))return null;let n=a(e,`HeartRateBpm`),r=i(a(e,`Time`));return a(e,`AltitudeMeters`,e=>{let n=Number.parseFloat(i(e));Number.isNaN(n)||t.push(n)}),{coordinates:t,time:r||null,heartRate:n?Number.parseFloat(i(n)):null,extensions:v(e,U)}}function se(e){let n=t(e,`Trackpoint`),r=[],i=[],a=[];if(n.length<2)return null;let o={},s={extendedProperties:o};for(let e=0;e<n.length;e++){let t=oe(n[e]);if(t===null)continue;r.push(t.coordinates);let{time:s,heartRate:c,extensions:l}=t;s&&i.push(s),c&&a.push(c);for(let[t,r]of l)o[t]||(o[t]=Array(n.length).fill(null)),o[t][e]=r}return r.length<2?null:Object.assign(s,{line:r,times:i,heartRates:a})}function y(e){let n=t(e,`Track`),r=[],a=[],s=[],c=[],l,u=Object.assign(Object.fromEntries(v(e,W)),o(e,`Name`,e=>({name:i(e)})));for(let e of n)l=se(e),l&&(r.push(l.line),l.times.length&&a.push(l.times),l.heartRates.length&&s.push(l.heartRates),c.push(l.extendedProperties));for(let e=0;e<c.length;e++){let t=c[e];for(let i in t)n.length===1?l&&(u[i]=l.extendedProperties[i]):(u[i]||(u[i]=r.map(e=>Array(e.length).fill(null))),u[i][e]=t[i])}return r.length===0?null:((a.length||s.length)&&(u.coordinateProperties=Object.assign(a.length?{times:r.length===1?a[0]:a}:{},s.length?{heart:r.length===1?s[0]:s}:{})),{type:`Feature`,properties:u,geometry:r.length===1?{type:`LineString`,coordinates:r[0]}:{type:`MultiLineString`,coordinates:r}})}function*b(e){for(let n of t(e,`Lap`)){let e=y(n);e&&(yield e)}for(let n of t(e,`Courses`)){let e=y(n);e&&(yield e)}}function ce(e){return{type:`FeatureCollection`,features:Array.from(b(e))}}function x(e,t){let n={},r=t===`stroke`||t===`fill`?t:`${t}-color`;return e[0]===`#`&&(e=e.substring(1)),e.length===6||e.length===3?n[r]=`#${e}`:e.length===8&&(n[`${t}-opacity`]=Number.parseInt(e.substring(0,2),16)/255,n[r]=`#${e.substring(6,8)}${e.substring(4,6)}${e.substring(2,4)}`),n}function S(e,t,n){let r={};return l(e,t,e=>{r[n]=e}),r}function C(e,t){return o(e,`color`,e=>x(i(e),t))}function w(e){return o(e,`Icon`,(e,t)=>(s(e,`href`,e=>{t.icon=e}),t))}function le(e){return o(e,`IconStyle`,e=>Object.assign(C(e,`icon`),S(e,`scale`,`icon-scale`),S(e,`heading`,`icon-heading`),o(e,`hotSpot`,e=>{let t=Number.parseFloat(e.getAttribute(`x`)||``),n=Number.parseFloat(e.getAttribute(`y`)||``),r=e.getAttribute(`xunits`)||``,i=e.getAttribute(`yunits`)||``;return!Number.isNaN(t)&&!Number.isNaN(n)?{"icon-offset":[t,n],"icon-offset-units":[r,i]}:{}}),w(e)))}function ue(e){return o(e,`LabelStyle`,e=>Object.assign(C(e,`label`),S(e,`scale`,`label-scale`)))}function de(e){return o(e,`LineStyle`,e=>Object.assign(C(e,`stroke`),S(e,`width`,`stroke-width`)))}function fe(e){return o(e,`PolyStyle`,(e,t)=>Object.assign(t,o(e,`color`,e=>x(i(e),`fill`)),s(e,`fill`,e=>{if(e===`0`)return{"fill-opacity":0}}),s(e,`outline`,e=>{if(e===`0`)return{"stroke-opacity":0}})))}function T(e){return Object.assign({},fe(e),de(e),ue(e),le(e))}function E(e){return e.replace(G,``).split(`,`).map(Number.parseFloat).filter(e=>!Number.isNaN(e)).slice(0,3)}function D(e){return e.replace(K,``).split(q).map(E).filter(e=>e.length>=2)}function pe(e){let n=t(e,`coord`);n.length===0&&(n=r(e,`coord`,`*`));let a=n.map(e=>i(e).split(` `).map(Number.parseFloat));return a.length===0?null:{geometry:a.length>2?{type:`LineString`,coordinates:a}:{type:`Point`,coordinates:a[0]},times:t(e,`when`).map(e=>i(e))}}function O(e){if(e.length===0)return e;let t=e[0],n=e[e.length-1],r=!0;for(let e=0;e<Math.max(t.length,n.length);e++)if(t[e]!==n[e]){r=!1;break}return r?e:e.concat([e[0]])}function k(e){return i(a(e,`coordinates`))}function A(e){let n=[],r=[];for(let i=0;i<e.childNodes.length;i++){let a=e.childNodes.item(i);if(d(a))switch(a.tagName){case`MultiGeometry`:case`MultiTrack`:case`gx:MultiTrack`:{let e=A(a);n=n.concat(e.geometries),r=r.concat(e.coordTimes);break}case`Point`:{let e=E(k(a));e.length>=2&&n.push({type:`Point`,coordinates:e});break}case`LinearRing`:case`LineString`:{let e=D(k(a));e.length>=2&&n.push({type:`LineString`,coordinates:e});break}case`Polygon`:{let e=[];for(let n of t(a,`LinearRing`)){let t=O(D(k(n)));t.length>=4&&e.push(t)}e.length&&n.push({type:`Polygon`,coordinates:e});break}case`Track`:case`gx:Track`:{let e=pe(a);if(!e)break;let{times:t,geometry:i}=e;n.push(i),t.length&&r.push(t);break}}}return{geometries:n,coordTimes:r}}function j(e,n){return o(e,`ExtendedData`,(e,r)=>{for(let n of t(e,`Data`))r[n.getAttribute(`name`)||``]=i(a(n,`value`));for(let a of t(e,`SimpleData`)){let e=a.getAttribute(`name`)||``;r[e]=(n[e]||Y.string)(i(a))}return r})}function M(e){let t=a(e,`description`);for(let e of Array.from(t?.childNodes||[]))if(e.nodeType===4)return{description:{"@type":`html`,value:i(e)}};return{}}function N(e){return o(e,`TimeSpan`,e=>({timespan:{begin:i(a(e,`begin`)),end:i(a(e,`end`))}}))}function P(e){return o(e,`TimeStamp`,e=>({timestamp:i(a(e,`when`))}))}function F(e,t){return s(e,`styleUrl`,e=>(e=n(e),t[e]?Object.assign({styleUrl:e},t[e]):{styleUrl:e}))}function me(e){switch(e?.textContent){case X.ABSOLUTE:return X.ABSOLUTE;case X.CLAMP_TO_GROUND:return X.CLAMP_TO_GROUND;case X.CLAMP_TO_SEAFLOOR:return X.CLAMP_TO_SEAFLOOR;case X.RELATIVE_TO_GROUND:return X.RELATIVE_TO_GROUND;case X.RELATIVE_TO_SEAFLOOR:return X.RELATIVE_TO_SEAFLOOR}return null}function he(e){return a(e,`gx:LatLonQuad`)?{geometry:{type:`Polygon`,coordinates:[O(D(k(e)))]}}:_e(e)}function ge(e,t,n){let r=[(e[0]+e[2])/2,(e[1]+e[3])/2];return[t[0].map(e=>{let t=e[1]-r[1],i=e[0]-r[0],a=Math.sqrt(t**2+i**2),o=Math.atan2(t,i)+n*Z;return[r[0]+Math.cos(o)*a,r[1]+Math.sin(o)*a]})]}function _e(e){let t=a(e,`LatLonBox`);if(t){let e=l(t,`north`),n=l(t,`west`),r=l(t,`east`),i=l(t,`south`),a=l(t,`rotation`);if(typeof e==`number`&&typeof i==`number`&&typeof n==`number`&&typeof r==`number`){let t=[n,i,r,e],o=[[[n,e],[r,e],[r,i],[n,i],[n,e]]];return typeof a==`number`&&(o=ge(t,o,a)),{bbox:t,geometry:{type:`Polygon`,coordinates:o}}}}return null}function I(e,t,n,r){let i=he(e),a=i?.geometry||null;if(!a&&r.skipNullGeometry)return null;let o={type:`Feature`,geometry:a,properties:Object.assign({"@geometry-type":`groundoverlay`},u(e,[`name`,`address`,`visibility`,`open`,`phoneNumber`,`description`]),M(e),F(e,t),T(e),w(e),j(e,n),N(e),P(e))};i?.bbox&&(o.bbox=i.bbox),o.properties?.visibility!==void 0&&(o.properties.visibility=o.properties.visibility!==`0`);let s=e.getAttribute(`id`);return s!==null&&s!==``&&(o.id=s),o}function ve(e){let t=a(e,`Region`);return t?{coordinateBox:be(t),lod:ye(e)}:null}function ye(e){let t=a(e,`Lod`);return t?[l(t,`minLodPixels`)??-1,l(t,`maxLodPixels`)??-1,l(t,`minFadeExtent`)??null,l(t,`maxFadeExtent`)??null]:null}function be(e){let t=a(e,`LatLonAltBox`);if(t){let e=l(t,`north`),n=l(t,`west`),r=l(t,`east`),i=l(t,`south`);if(me(a(t,`altitudeMode`)||a(t,`gx:altitudeMode`))&&console.debug(`Encountered an unsupported feature of KML for togeojson: please contact developers for support of altitude mode.`),typeof e==`number`&&typeof i==`number`&&typeof n==`number`&&typeof r==`number`)return{bbox:[n,i,r,e],geometry:{type:`Polygon`,coordinates:[[[n,e],[r,e],[r,i],[n,i],[n,e]]]}}}return null}function xe(e){let t=a(e,`Link`);return t?u(t,[`href`,`refreshMode`,`refreshInterval`,`viewRefreshMode`,`viewRefreshTime`,`viewBoundScale`,`viewFormat`,`httpQuery`]):{}}function L(e,t,n,r){let i=ve(e),a=i?.coordinateBox?.geometry||null;if(!a&&r.skipNullGeometry)return null;let o={type:`Feature`,geometry:a,properties:Object.assign({"@geometry-type":`networklink`},u(e,[`name`,`address`,`visibility`,`open`,`phoneNumber`,`styleUrl`,`refreshVisibility`,`flyToView`,`description`]),M(e),F(e,t),T(e),w(e),j(e,n),N(e),P(e),xe(e),i?.lod?{lod:i.lod}:{})};i?.coordinateBox?.bbox&&(o.bbox=i.coordinateBox.bbox),o.properties?.visibility!==void 0&&(o.properties.visibility=o.properties.visibility!==`0`);let s=e.getAttribute(`id`);return s!==null&&s!==``&&(o.id=s),o}function Se(e){return e.length===0?null:e.length===1?e[0]:{type:`GeometryCollection`,geometries:e}}function R(e,t,n,r){let{coordTimes:i,geometries:a}=A(e),o=Se(a);if(!o&&r.skipNullGeometry)return null;let s={type:`Feature`,geometry:o,properties:Object.assign(u(e,[`name`,`address`,`visibility`,`open`,`phoneNumber`,`description`]),M(e),F(e,t),T(e),j(e,n),N(e),P(e),i.length?{coordinateProperties:{times:i.length===1?i[0]:i}}:{})};s.properties?.visibility!==void 0&&(s.properties.visibility=s.properties.visibility!==`0`);let c=e.getAttribute(`id`);return c!==null&&c!==``&&(s.id=c),s}function Ce(e){let t=e.getAttribute(`id`),r=e.parentNode;return!t&&d(r)&&r.localName===`CascadingStyle`&&(t=r.getAttribute(`kml:id`)||r.getAttribute(`id`)),n(t||``)}function z(e){let r={};for(let n of t(e,`Style`))r[Ce(n)]=T(n);for(let i of t(e,`StyleMap`)){let e=n(i.getAttribute(`id`)||``);s(i,`styleUrl`,t=>{t=n(t),r[t]&&(r[e]=r[t])})}return r}function B(e){let n={};for(let r of t(e,`SimpleField`))n[r.getAttribute(`name`)||``]=Y[r.getAttribute(`type`)||``]||Y.string;return n}function we(e){let t={};for(let n of Array.from(e.childNodes))d(n)&&Q.includes(n.tagName)&&(t[n.tagName]=i(n));return{type:`folder`,meta:t,children:[]}}function Te(e,t={skipNullGeometry:!1}){let n=e,r=z(n),i=B(n),a={type:`root`,children:[]};function o(e,t,n){if(d(e))switch(e.tagName){case`GroundOverlay`:{let a=I(e,r,i,n);a&&t.children.push(a);break}case`Placemark`:{let a=R(e,r,i,n);a&&t.children.push(a);break}case`Folder`:{let n=we(e);t.children.push(n),t=n;break}case`NetworkLink`:{let a=L(e,r,i,n);a&&t.children.push(a);break}}if(e.childNodes)for(let r=0;r<e.childNodes.length;r++)o(e.childNodes[r],t,n)}return o(n,a,t),a}function*V(e,n={skipNullGeometry:!1}){let r=e,i=z(r),a=B(r);for(let e of t(r,`Placemark`)){let t=R(e,i,a,n);t&&(yield t)}for(let e of t(r,`GroundOverlay`)){let t=I(e,i,a,n);t&&(yield t)}for(let e of t(r,`NetworkLink`)){let t=L(e,i,a,n);t&&(yield t)}}function Ee(e,t={skipNullGeometry:!1}){return{type:`FeatureCollection`,features:Array.from(V(e,t))}}var H,U,W,G,K,q,J,Y,X,Z,Q;function $(){return($=e((()=>{H=`http://www.garmin.com/xmlschemas/ActivityExtension/v2`,U=[[`heartRate`,`heartRates`],[`Cadence`,`cadences`],[`Speed`,`speeds`],[`Watts`,`watts`]],W=[[`TotalTimeSeconds`,`totalTimeSeconds`],[`DistanceMeters`,`distanceMeters`],[`MaximumSpeed`,`maxSpeed`],[`AverageHeartRateBpm`,`avgHeartRate`],[`MaximumHeartRateBpm`,`maxHeartRate`],[`AvgSpeed`,`avgSpeed`],[`AvgWatts`,`avgWatts`],[`MaxWatts`,`maxWatts`]],G=/\s*/g,K=/^\s*|\s*$/g,q=/\s+/,J=e=>Number(e),Y={string:e=>e,int:J,uint:J,short:J,ushort:J,float:J,double:J,bool:e=>!!e},(function(e){e.ABSOLUTE=`absolute`,e.RELATIVE_TO_GROUND=`relativeToGround`,e.CLAMP_TO_GROUND=`clampToGround`,e.CLAMP_TO_SEAFLOOR=`clampToSeaFloor`,e.RELATIVE_TO_SEAFLOOR=`relativeToSeaFloor`})(X||={}),Z=Math.PI/180,Q=[`name`,`visibility`,`open`,`address`,`description`,`phoneNumber`,`visibility`]})))()}$();export{ae as gpx,_ as gpxGen,Ee as kml,V as kmlGen,Te as kmlWithFolders,ce as tcx,b as tcxGen};
@@ -0,0 +1,15 @@
1
+ import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{n as t,t as n}from"./createLucideIcon-BtwfYE6A.js";import{n as r,t as i}from"./circle-check-RKAno__V.js";import{n as a,t as o}from"./rotate-ccw-D2__Zisi.js";import{n as s,t as c}from"./search-DYZU68h1.js";import{C as l,a as u}from"./ui-BFsHoY7a.js";import{Fragment as d,jsx as f,jsxs as p}from"react/jsx-runtime";import{BatchDeleteButton as m}from"@fudanda/table-antd";import{usePermission as h}from"@fudanda/react-core/hooks/usePermission";var g,_;function v(){return(v=e((()=>{
2
+ /**
3
+ * @license lucide-react v1.53.0 - ISC
4
+ *
5
+ * This source code is licensed under the ISC license.
6
+ * See the LICENSE file in the root directory of this source tree.
7
+ */
8
+ t(),g={name:`ban`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]},g.node,_=n(g)})))()}var y,b;function x(){return(x=e((()=>{
9
+ /**
10
+ * @license lucide-react v1.53.0 - ISC
11
+ *
12
+ * This source code is licensed under the ISC license.
13
+ * See the LICENSE file in the root directory of this source tree.
14
+ */
15
+ t(),y={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]},y.node,b=n(y)})))()}function S({onClick:e,disabled:t,loading:n,children:r=`查询`}){return/* @__PURE__ */ f(u,{type:`primary`,icon:/* @__PURE__ */ f(c,{size:14}),onClick:e,disabled:t,loading:n,children:r})}function C({onClick:e,disabled:t,loading:n,children:r=`重置`}){return/* @__PURE__ */ f(u,{type:`tertiary`,icon:/* @__PURE__ */ f(o,{size:14}),onClick:e,disabled:t,loading:n,children:r})}function w({onClick:e,disabled:t,loading:n,children:r=`刷新`}){return/* @__PURE__ */ f(u,{type:`tertiary`,icon:/* @__PURE__ */ f(o,{size:14}),onClick:e,disabled:t,loading:n,children:r})}function T({permission:e,onClick:t,disabled:n,loading:r,children:i=`新增`}){let{hasPermission:a}=h();return e&&!a(e)?null:/* @__PURE__ */ f(u,{type:`primary`,icon:/* @__PURE__ */ f(b,{size:14}),onClick:t,disabled:n,loading:r,children:i})}function E({count:e,onClick:t,disabled:n,loading:r,label:a=`批量启用`}){return/* @__PURE__ */ p(u,{theme:`light`,icon:/* @__PURE__ */ f(i,{size:14}),onClick:t,disabled:n,loading:r,children:[a,` (`,e,`)`]})}function D({count:e,onClick:t,disabled:n,loading:r,label:i=`批量停用`,danger:a=!1}){return/* @__PURE__ */ p(u,{type:a?`danger`:`warning`,theme:`light`,icon:/* @__PURE__ */ f(_,{size:14}),onClick:t,disabled:n,loading:r,children:[i,` (`,e,`)`]})}function O({count:e,onChange:t,disableLabel:n,danger:r,loading:i}){return/* @__PURE__ */ p(d,{children:[/* @__PURE__ */ f(E,{count:e,onClick:()=>void t(`enabled`),loading:i}),/* @__PURE__ */ f(D,{count:e,label:n,danger:r,onClick:()=>void t(`disabled`),loading:i})]})}function k(){return(k=e((()=>{l(),v(),r(),x(),a(),s()})))()}export{C as a,b as c,w as i,x as l,O as n,S as o,T as r,k as s,m as t};