@intent-hq/web 2.345.0 → 2.346.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (364) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/assets/{0.BtTQsuHZ.css → 0.C6uvaa87.css} +1 -1
  3. package/web/app/immutable/chunks/-UJlOg-6.js +1 -0
  4. package/web/app/immutable/chunks/-Wo302Zr.js +9 -0
  5. package/web/app/immutable/chunks/0qEvU7Aj.js +8 -0
  6. package/web/app/immutable/chunks/1_fC7X8z.js +1 -0
  7. package/web/app/immutable/chunks/2V4-p70U.js +408 -0
  8. package/web/app/immutable/chunks/{D3mUsAm9.js → 3DAIKGff.js} +1 -1
  9. package/web/app/immutable/chunks/{6Zmm5CZL.js → 3as4gwP9.js} +7 -7
  10. package/web/app/immutable/chunks/{BqRoJfH0.js → 3h5ZjEwa.js} +1 -1
  11. package/web/app/immutable/chunks/{Dz4sFk1c.js → 4sUGQp1u.js} +1 -1
  12. package/web/app/immutable/chunks/{fZqvRnJh.js → 5Ixgq0WC.js} +1 -1
  13. package/web/app/immutable/chunks/{CgQ2Q_uI.js → 71L4lHBq.js} +1 -1
  14. package/web/app/immutable/chunks/7eL9Pgig.js +1 -0
  15. package/web/app/immutable/chunks/{CWE4oREl.js → 9XVQ1GVX.js} +1 -1
  16. package/web/app/immutable/chunks/{C8dU7SM3.js → A8_BT67P.js} +1 -1
  17. package/web/app/immutable/chunks/ACNn9MHT.js +2 -0
  18. package/web/app/immutable/chunks/{Cv_J2c72.js → B-7vt8Nv.js} +1 -1
  19. package/web/app/immutable/chunks/B0-4rCYZ.js +2 -0
  20. package/web/app/immutable/chunks/{Chj7QpdD.js → B0WVH3Hg.js} +1 -1
  21. package/web/app/immutable/chunks/B0mNIdOb.js +1 -0
  22. package/web/app/immutable/chunks/{CWQrbZgx.js → B1HPKTBI.js} +1 -1
  23. package/web/app/immutable/chunks/{s_GzTTEG.js → B1U_DCBw.js} +1 -1
  24. package/web/app/immutable/chunks/{VyOfhH-C.js → B3D9gAmi.js} +1 -1
  25. package/web/app/immutable/chunks/{C-M7eh_Z.js → B4XZNQ4a.js} +1 -1
  26. package/web/app/immutable/chunks/{BqqN40AD.js → B4gIvcP2.js} +1 -1
  27. package/web/app/immutable/chunks/{C4dCVzfY.js → B55-cQLT.js} +1 -1
  28. package/web/app/immutable/chunks/B5HeJKYE.js +1 -0
  29. package/web/app/immutable/chunks/{Dlag9Uxb.js → B79pUPc3.js} +9 -9
  30. package/web/app/immutable/chunks/{34C5M9lk.js → B7dTLx8u.js} +1 -1
  31. package/web/app/immutable/chunks/B83M2_sj.js +1 -0
  32. package/web/app/immutable/chunks/BAGVOK-j.js +4 -0
  33. package/web/app/immutable/chunks/{DXDMhDlS.js → BBlTlRXR.js} +1 -1
  34. package/web/app/immutable/chunks/{D3I0DcnM.js → BDDEv5gU.js} +1 -1
  35. package/web/app/immutable/chunks/BDPAYMJ1.js +4 -0
  36. package/web/app/immutable/chunks/BDPqCRJm.js +2 -0
  37. package/web/app/immutable/chunks/{B0a-wzQr.js → BDZoh7yg.js} +1 -1
  38. package/web/app/immutable/chunks/{oilydQC6.js → BDtb6AfX.js} +1 -1
  39. package/web/app/immutable/chunks/{oxLL7zSC.js → BDzYiKUH.js} +3 -3
  40. package/web/app/immutable/chunks/{PwvNS9aJ.js → BJZ04Dji.js} +1 -1
  41. package/web/app/immutable/chunks/{A34-FDia.js → BK2lpqz4.js} +1 -1
  42. package/web/app/immutable/chunks/{BC2xxkKo.js → BK64B_Ic.js} +7 -7
  43. package/web/app/immutable/chunks/{8XhHIJcn.js → BKw5KoGy.js} +1 -1
  44. package/web/app/immutable/chunks/{1MWULgfl.js → BLaIjbEF.js} +1 -1
  45. package/web/app/immutable/chunks/{BkbQGifa.js → BLl22NdQ.js} +1 -1
  46. package/web/app/immutable/chunks/{ByTOmivs.js → BM7oCSp5.js} +1 -1
  47. package/web/app/immutable/chunks/{C8BVjzNA.js → BMKkyPLo.js} +1 -1
  48. package/web/app/immutable/chunks/BO8NImWp.js +1 -0
  49. package/web/app/immutable/chunks/BOxkenyY.js +1 -0
  50. package/web/app/immutable/chunks/{CW_fORnH.js → BOyF7pe9.js} +1 -1
  51. package/web/app/immutable/chunks/BQ5F0iVp.js +1 -0
  52. package/web/app/immutable/chunks/BQbcEQz0.js +1 -0
  53. package/web/app/immutable/chunks/{DW36BCXj.js → BTNEDHav.js} +1 -1
  54. package/web/app/immutable/chunks/{zN8eBYty.js → BVURea8L.js} +1 -1
  55. package/web/app/immutable/chunks/{C6WI65lc.js → BW9EApvt.js} +10 -10
  56. package/web/app/immutable/chunks/BWAGtvpD.js +1 -0
  57. package/web/app/immutable/chunks/BWTugGQ8.js +1 -0
  58. package/web/app/immutable/chunks/{D_2_kcuU.js → BWZmCaEW.js} +1 -1
  59. package/web/app/immutable/chunks/{Bj3n1RUK.js → BY3nRRgO.js} +3 -3
  60. package/web/app/immutable/chunks/{DZxSFexp.js → BYDvuR-h.js} +1 -1
  61. package/web/app/immutable/chunks/{CaGwo1Kh.js → BZYeogxf.js} +1 -1
  62. package/web/app/immutable/chunks/{RvvsGyv8.js → Ba1C4iSG.js} +1 -1
  63. package/web/app/immutable/chunks/{DSf8k2cE.js → BaYeKXL3.js} +1 -1
  64. package/web/app/immutable/chunks/{BZLRqiW7.js → BaYzTmbw.js} +1 -1
  65. package/web/app/immutable/chunks/Bbkml6DP.js +1 -0
  66. package/web/app/immutable/chunks/{9HNwwiNt.js → BcbQZUsh.js} +1 -1
  67. package/web/app/immutable/chunks/BcgSXbtK.js +1 -0
  68. package/web/app/immutable/chunks/{DLJVFWjT.js → BeJ5WWx4.js} +22 -22
  69. package/web/app/immutable/chunks/{A0r9TbR7.js → BfbZn9QX.js} +1 -1
  70. package/web/app/immutable/chunks/BgKhYgm8.js +1 -0
  71. package/web/app/immutable/chunks/Bgi2L8Br.js +1 -0
  72. package/web/app/immutable/chunks/Bgw3O9rE.js +1 -0
  73. package/web/app/immutable/chunks/Big_dnEI.js +1 -0
  74. package/web/app/immutable/chunks/{D6yqDOhs.js → BjURBDIt.js} +5 -5
  75. package/web/app/immutable/chunks/{CJ58g2zu.js → BlEwAz4v.js} +1 -1
  76. package/web/app/immutable/chunks/{BUGXi07N.js → BmEcZoA2.js} +1 -1
  77. package/web/app/immutable/chunks/{Bb-m1QhD.js → BnkmaA34.js} +1 -1
  78. package/web/app/immutable/chunks/BpYNQf9o.js +1 -0
  79. package/web/app/immutable/chunks/{m3ndyWcI.js → BqBqZaGQ.js} +1 -1
  80. package/web/app/immutable/chunks/{D419Hgek.js → BqyYlCY3.js} +1 -1
  81. package/web/app/immutable/chunks/BrIsEZwT.js +1 -0
  82. package/web/app/immutable/chunks/Brqq8vhd.js +6 -0
  83. package/web/app/immutable/chunks/{Dx41gQiN.js → Bxnf75xq.js} +1 -1
  84. package/web/app/immutable/chunks/ByLCbaqp.js +1 -0
  85. package/web/app/immutable/chunks/{xOJeCqJf.js → C-OtpXcF.js} +1 -1
  86. package/web/app/immutable/chunks/{B7w_8Qom.js → C1CDOGnh.js} +2 -2
  87. package/web/app/immutable/chunks/C1osWUn_.js +1 -0
  88. package/web/app/immutable/chunks/{BI7MYBTt.js → C33Dw59E.js} +1 -1
  89. package/web/app/immutable/chunks/{BMm9sGZ6.js → C3NeTp2u.js} +1 -1
  90. package/web/app/immutable/chunks/{DdSX2jjJ.js → C3VPe7p1.js} +1 -1
  91. package/web/app/immutable/chunks/{BYMNRS4c.js → C3oF1SK5.js} +1 -1
  92. package/web/app/immutable/chunks/{CW13jkE8.js → C4HHXGmJ.js} +1 -1
  93. package/web/app/immutable/chunks/{ByCIOkhM.js → C59or46M.js} +1 -1
  94. package/web/app/immutable/chunks/{CL2hu5s-.js → C5SissXF.js} +1 -1
  95. package/web/app/immutable/chunks/{C-ZPZDJB.js → C8XrM-qb.js} +1 -1
  96. package/web/app/immutable/chunks/CA6TS0WC.js +1 -0
  97. package/web/app/immutable/chunks/CAUaU8Wh.js +1 -0
  98. package/web/app/immutable/chunks/CAdgzoaK.js +1 -0
  99. package/web/app/immutable/chunks/{BrRRz1w6.js → CCm1BgPl.js} +1 -1
  100. package/web/app/immutable/chunks/CDbQwqu1.js +1 -0
  101. package/web/app/immutable/chunks/CEsW1euQ.js +1 -0
  102. package/web/app/immutable/chunks/{CYEd8dKU.js → CFs6uWH2.js} +1 -1
  103. package/web/app/immutable/chunks/{D6YDmdhV.js → CGcQAX9W.js} +1 -1
  104. package/web/app/immutable/chunks/{CVYjvOCP.js → CHfmHJ17.js} +1 -1
  105. package/web/app/immutable/chunks/{DwKUz42C.js → CJ_dtcmM.js} +1 -1
  106. package/web/app/immutable/chunks/{DqvXXMrh.js → CNT1n9YR.js} +1 -1
  107. package/web/app/immutable/chunks/CP8WYBBE.js +1 -0
  108. package/web/app/immutable/chunks/{DtKh4Q6Q.js → CQB76zlc.js} +1 -1
  109. package/web/app/immutable/chunks/{DpMTpLDQ.js → CQbtnalz.js} +1 -1
  110. package/web/app/immutable/chunks/{CNIUwMPp.js → CQyjMIYw.js} +1 -1
  111. package/web/app/immutable/chunks/CSQXURhP.js +1 -0
  112. package/web/app/immutable/chunks/{DnpnDt-B.js → CSg3z6A2.js} +1 -1
  113. package/web/app/immutable/chunks/{m18NZZRr.js → CVa6MqnK.js} +1 -1
  114. package/web/app/immutable/chunks/{DInreQbI.js → CXVUfxHv.js} +2 -2
  115. package/web/app/immutable/chunks/{C0p8rhDn.js → CXpFRnSj.js} +1 -1
  116. package/web/app/immutable/chunks/C_EpV6jU.js +2 -0
  117. package/web/app/immutable/chunks/Cb0zVN4i.js +1 -0
  118. package/web/app/immutable/chunks/{BP7CI4Qx.js → CbZEAbX5.js} +1 -1
  119. package/web/app/immutable/chunks/{BqQiAH0O.js → CcaAQlGA.js} +1 -1
  120. package/web/app/immutable/chunks/CgLoJgPR.js +1 -0
  121. package/web/app/immutable/chunks/{B4ilKCwe.js → CguBowm8.js} +1 -1
  122. package/web/app/immutable/chunks/{Ds3Wirif.js → ChNPgGKQ.js} +1 -1
  123. package/web/app/immutable/chunks/{B203wRvP.js → Chpqmkx4.js} +1 -1
  124. package/web/app/immutable/chunks/{DbK3CxeL.js → CiIELmgj.js} +1 -1
  125. package/web/app/immutable/chunks/CiKocWhX.js +1 -0
  126. package/web/app/immutable/chunks/{BYtSPAAW.js → CjbCpI18.js} +1 -1
  127. package/web/app/immutable/chunks/{BvZrnx87.js → Ckp5dOHW.js} +1 -1
  128. package/web/app/immutable/chunks/{BfZCAeqU.js → ClMg3ew2.js} +1 -1
  129. package/web/app/immutable/chunks/{A8JjhnEv.js → Clhk_Z-l.js} +1 -1
  130. package/web/app/immutable/chunks/{CXNfY5OA.js → CmoBwSCp.js} +1 -1
  131. package/web/app/immutable/chunks/{B5tGFpkq.js → CpHzYkzi.js} +1 -1
  132. package/web/app/immutable/chunks/{p3fN-Vr3.js → Cq2aackv.js} +1 -1
  133. package/web/app/immutable/chunks/Cq8oeEXe.js +1 -0
  134. package/web/app/immutable/chunks/CrHk5l6X.js +1 -0
  135. package/web/app/immutable/chunks/{BUdcKH65.js → CrjpdU4V.js} +1 -1
  136. package/web/app/immutable/chunks/CswFIiBb.js +1 -0
  137. package/web/app/immutable/chunks/{BA3fud46.js → CtDj7gZD.js} +1 -1
  138. package/web/app/immutable/chunks/{CaXjFtDt.js → CvGEpOsC.js} +1 -1
  139. package/web/app/immutable/chunks/CvHwMug-.js +2 -0
  140. package/web/app/immutable/chunks/{CaxyE6o_.js → Cx31i8ng.js} +1 -1
  141. package/web/app/immutable/chunks/CzcD2H5U.js +2 -0
  142. package/web/app/immutable/chunks/CzdMU9Bu.js +2 -0
  143. package/web/app/immutable/chunks/{CKzqOQI8.js → D-TVq_rK.js} +1 -1
  144. package/web/app/immutable/chunks/{ChY17Glq.js → D-i7C44m.js} +2 -2
  145. package/web/app/immutable/chunks/{DDfvytcD.js → D0I9E6A0.js} +1 -1
  146. package/web/app/immutable/chunks/{DYk0s6f0.js → D1CYDv8t.js} +1 -1
  147. package/web/app/immutable/chunks/{BuTNFoR8.js → D31IcU1_.js} +1 -1
  148. package/web/app/immutable/chunks/{DDMEgpvU.js → D3toWTag.js} +8 -8
  149. package/web/app/immutable/chunks/{Bywuf0q4.js → D492HRYt.js} +1 -1
  150. package/web/app/immutable/chunks/{BkNc2eFX.js → D7NdkRF-.js} +4 -4
  151. package/web/app/immutable/chunks/{GETqdV-9.js → D7dPbXji.js} +1 -1
  152. package/web/app/immutable/chunks/D9jYN6_J.js +1 -0
  153. package/web/app/immutable/chunks/{n58mTCVv.js → D9jvlcNy.js} +1 -1
  154. package/web/app/immutable/chunks/{BabPi6C5.js → DByMRbHr.js} +1 -1
  155. package/web/app/immutable/chunks/{aETzmnsD.js → DDySjsub.js} +1 -1
  156. package/web/app/immutable/chunks/{B9Hetctu.js → DE8QOEZV.js} +1 -1
  157. package/web/app/immutable/chunks/{DCDhq2rq.js → DF1uIj8u.js} +1 -1
  158. package/web/app/immutable/chunks/{BYFJ74nm.js → DFs6FJS8.js} +1 -1
  159. package/web/app/immutable/chunks/{CgW9XFcu.js → DGmRhalF.js} +1 -1
  160. package/web/app/immutable/chunks/DH-29Rs_.js +11 -0
  161. package/web/app/immutable/chunks/{B3kzQQLK.js → DHGSAfCZ.js} +1 -1
  162. package/web/app/immutable/chunks/DHROL4K5.js +1 -0
  163. package/web/app/immutable/chunks/DKKFIb2l.js +1 -0
  164. package/web/app/immutable/chunks/DKTqwHrN.js +1 -0
  165. package/web/app/immutable/chunks/DMYKSC8W.js +2 -0
  166. package/web/app/immutable/chunks/{-7ARPWgR.js → DMjNjha0.js} +1 -1
  167. package/web/app/immutable/chunks/{C1nHAGLu.js → DNWBkvFP.js} +1 -1
  168. package/web/app/immutable/chunks/DNjgs7AU.js +1 -0
  169. package/web/app/immutable/chunks/{DkQ7I_3J.js → DOB2ATTF.js} +5 -5
  170. package/web/app/immutable/chunks/{BTWq1_ry.js → DOCWMdWU.js} +1 -1
  171. package/web/app/immutable/chunks/{Bc6DihnT.js → DOKxXiSI.js} +18 -18
  172. package/web/app/immutable/chunks/DOPeTAKk.js +13 -0
  173. package/web/app/immutable/chunks/{PrJr0a2j.js → DPUWJyjX.js} +1 -1
  174. package/web/app/immutable/chunks/{_xNtAuSN.js → DQlH_Wce.js} +1 -1
  175. package/web/app/immutable/chunks/{BIEvH8pu.js → DRZKWEq3.js} +1 -1
  176. package/web/app/immutable/chunks/DTSEdINd.js +2 -0
  177. package/web/app/immutable/chunks/{j5aoAM0N.js → DUQV_xq3.js} +1 -1
  178. package/web/app/immutable/chunks/{Dsmvkh8d.js → DW9MEQey.js} +1 -1
  179. package/web/app/immutable/chunks/{BL8tUtYB.js → DXnd4CJZ.js} +1 -1
  180. package/web/app/immutable/chunks/DYnCJwSs.js +1 -0
  181. package/web/app/immutable/chunks/DZ3SUe8R.js +1 -0
  182. package/web/app/immutable/chunks/{BmP1Wws6.js → DZyAzxxC.js} +1 -1
  183. package/web/app/immutable/chunks/D_SZXZdx.js +1 -0
  184. package/web/app/immutable/chunks/{BhMsVKL2.js → DcZKw8cP.js} +2 -2
  185. package/web/app/immutable/chunks/{B9x-giji.js → DccrGg38.js} +22 -22
  186. package/web/app/immutable/chunks/DcwC09tE.js +1 -0
  187. package/web/app/immutable/chunks/{Bvc8qRhk.js → DdVIXVso.js} +1 -1
  188. package/web/app/immutable/chunks/DeCAcSD9.js +19 -0
  189. package/web/app/immutable/chunks/DfjJilaB.js +2 -0
  190. package/web/app/immutable/chunks/{XzMpMF29.js → DgHZa_R5.js} +1 -1
  191. package/web/app/immutable/chunks/{ZI2UcNVx.js → DgwMMJRI.js} +1 -1
  192. package/web/app/immutable/chunks/{CVoXekIe.js → DhHSeQsG.js} +3 -3
  193. package/web/app/immutable/chunks/{CG3imlyr.js → Dj8J0eqI.js} +1 -1
  194. package/web/app/immutable/chunks/DjdPlKc4.js +2 -0
  195. package/web/app/immutable/chunks/{finAdq6c.js → DknPpgEW.js} +1 -1
  196. package/web/app/immutable/chunks/Dkr_RXdV.js +1 -0
  197. package/web/app/immutable/chunks/Dkva_evl.js +11 -0
  198. package/web/app/immutable/chunks/{7teYU7wH.js → Do80Vc58.js} +1 -1
  199. package/web/app/immutable/chunks/{X8W_BfF4.js → Dr45ln4z.js} +1 -1
  200. package/web/app/immutable/chunks/DryyHkNv.js +1 -0
  201. package/web/app/immutable/chunks/{BdkEw9JP.js → DtAyUyC0.js} +1 -1
  202. package/web/app/immutable/chunks/Dto-4yb7.js +1 -0
  203. package/web/app/immutable/chunks/{CSdIXJpO.js → DukmxKgk.js} +1 -1
  204. package/web/app/immutable/chunks/{BwSA3fCS.js → DwA_Z_f6.js} +1 -1
  205. package/web/app/immutable/chunks/{Drt5qRI8.js → Dx3sZmi8.js} +1 -1
  206. package/web/app/immutable/chunks/{CcXuSxXv.js → DxBGs1BP.js} +1 -1
  207. package/web/app/immutable/chunks/{CeswpNyE.js → DzGNgfrZ.js} +1 -1
  208. package/web/app/immutable/chunks/DzKYjnRy.js +2 -0
  209. package/web/app/immutable/chunks/{HvBMlLJP.js → DzejiLWr.js} +3 -3
  210. package/web/app/immutable/chunks/{CBqGKeYg.js → G_wYaln-.js} +1 -1
  211. package/web/app/immutable/chunks/GzTl4Sb0.js +1 -0
  212. package/web/app/immutable/chunks/IRbjhecv.js +8 -0
  213. package/web/app/immutable/chunks/OPvMR-5p.js +1 -0
  214. package/web/app/immutable/chunks/{gURPJ1oX.js → SVZRr24P.js} +1 -1
  215. package/web/app/immutable/chunks/{DYmPPjiq.js → T9tywf_e.js} +1 -1
  216. package/web/app/immutable/chunks/TL85KYB9.js +1 -0
  217. package/web/app/immutable/chunks/{BgX4ALX_.js → U6cHmbYS.js} +3 -3
  218. package/web/app/immutable/chunks/{DLqztIqC.js → V9qci_dz.js} +1 -1
  219. package/web/app/immutable/chunks/{CpLvDQcH.js → W7sv3DY6.js} +1 -1
  220. package/web/app/immutable/chunks/{CrfXhNNb.js → WbTmlouE.js} +1 -1
  221. package/web/app/immutable/chunks/{BAxqzRwc.js → Y4VeEPHl.js} +1 -1
  222. package/web/app/immutable/chunks/{BVviSubD.js → YYacqJ9a.js} +1 -1
  223. package/web/app/immutable/chunks/{BdCclrfD.js → Zl17pAXX.js} +1 -1
  224. package/web/app/immutable/chunks/{BVt_T8ao.js → aQy6qVNs.js} +1 -1
  225. package/web/app/immutable/chunks/{C3SYquhf.js → ahX1JzRb.js} +1 -1
  226. package/web/app/immutable/chunks/{B0biUQQF.js → asQ_ruFQ.js} +1 -1
  227. package/web/app/immutable/chunks/{BGX6W-wu.js → bKyElw3h.js} +1 -1
  228. package/web/app/immutable/chunks/cATI0wnI.js +1 -0
  229. package/web/app/immutable/chunks/ciTxbtqU.js +1 -0
  230. package/web/app/immutable/chunks/d-Ep-sfP.js +1 -0
  231. package/web/app/immutable/chunks/dBZS3-kp.js +3 -0
  232. package/web/app/immutable/chunks/{Bk2z5Cd0.js → eNHX5lds.js} +1 -1
  233. package/web/app/immutable/chunks/etVaBLxV.js +6 -0
  234. package/web/app/immutable/chunks/euZ22sAu.js +1 -0
  235. package/web/app/immutable/chunks/{COrK0goa.js → ftma9Ybn.js} +1 -1
  236. package/web/app/immutable/chunks/fzs92dqr.js +1 -0
  237. package/web/app/immutable/chunks/i2sZiDEq.js +1 -0
  238. package/web/app/immutable/chunks/iKgBWWl-.js +2 -0
  239. package/web/app/immutable/chunks/{BXTuZcZW.js → jlJQSpH6.js} +1 -1
  240. package/web/app/immutable/chunks/{t_3vjEsA.js → ouMKS3MA.js} +1 -1
  241. package/web/app/immutable/chunks/{DpsFFL7J.js → s0TWEExr.js} +1 -1
  242. package/web/app/immutable/chunks/{XIXbmV8F.js → txy0Txom.js} +1 -1
  243. package/web/app/immutable/chunks/{CYf2hryc.js → wTgWcOy1.js} +1 -1
  244. package/web/app/immutable/chunks/{BIlaJXMS.js → z-RLr2Z1.js} +1 -1
  245. package/web/app/immutable/chunks/zGl9gaL0.js +1 -0
  246. package/web/app/immutable/chunks/{DXCE75Ih.js → z_Tdw9N5.js} +1 -1
  247. package/web/app/immutable/entry/app.BXnRxWvG.js +4 -0
  248. package/web/app/immutable/entry/start.BX3EKd8C.js +1 -0
  249. package/web/app/immutable/nodes/0.CFk1FXLg.js +1 -0
  250. package/web/app/immutable/nodes/1.Bd67D1tA.js +1 -0
  251. package/web/app/immutable/nodes/10.CTZ0L3wZ.js +41 -0
  252. package/web/app/immutable/nodes/11.CH_h0WbH.js +1 -0
  253. package/web/app/immutable/nodes/12.DhihsAtw.js +1 -0
  254. package/web/app/immutable/nodes/{13.CscEwLVK.js → 13.B727xJXs.js} +5 -5
  255. package/web/app/immutable/nodes/14.CgITgBOZ.js +3 -0
  256. package/web/app/immutable/nodes/15.CCzIPJGf.js +1 -0
  257. package/web/app/immutable/nodes/{16.Cfgb0nOQ.js → 16.CbtJfPHZ.js} +2 -2
  258. package/web/app/immutable/nodes/17.CelzCwXF.js +1 -0
  259. package/web/app/immutable/nodes/{17.yV85i6g8.js → 18.fqvApY-g.js} +2 -2
  260. package/web/app/immutable/nodes/2.t-1b60vK.js +13 -0
  261. package/web/app/immutable/nodes/3.4L0YPvZL.js +2 -0
  262. package/web/app/immutable/nodes/4.BLQgcpcU.js +1 -0
  263. package/web/app/immutable/nodes/5.Bp_OiOTI.js +5 -0
  264. package/web/app/immutable/nodes/6.CcuwCBp4.js +1 -0
  265. package/web/app/immutable/nodes/7.B-TRUT7o.js +1 -0
  266. package/web/app/immutable/nodes/{8.omc6d3jg.js → 8.CaG5gby5.js} +9 -9
  267. package/web/app/immutable/nodes/{9._4FUjrca.js → 9.DosMxTmg.js} +17 -17
  268. package/web/app/version.json +1 -1
  269. package/web/index.html +28 -21
  270. package/web/app/immutable/chunks/-6JGlnE4.js +0 -1
  271. package/web/app/immutable/chunks/-SwunqO3.js +0 -1
  272. package/web/app/immutable/chunks/2xvAjJNs.js +0 -1
  273. package/web/app/immutable/chunks/5MLUIYhU.js +0 -1
  274. package/web/app/immutable/chunks/B3lXnLB8.js +0 -2
  275. package/web/app/immutable/chunks/BBL1FO1t.js +0 -1
  276. package/web/app/immutable/chunks/BCASO_bV.js +0 -1
  277. package/web/app/immutable/chunks/BF-IM3Qf.js +0 -1
  278. package/web/app/immutable/chunks/BKYCO_49.js +0 -4
  279. package/web/app/immutable/chunks/BMMoYJAn.js +0 -1
  280. package/web/app/immutable/chunks/BP5uyQTv.js +0 -18
  281. package/web/app/immutable/chunks/BVPvh88-.js +0 -1
  282. package/web/app/immutable/chunks/BX3QD7rd.js +0 -1
  283. package/web/app/immutable/chunks/BXeiKdwz.js +0 -1
  284. package/web/app/immutable/chunks/BYU1cTbO.js +0 -2
  285. package/web/app/immutable/chunks/BZcpShp8.js +0 -9
  286. package/web/app/immutable/chunks/BbNk8c_P.js +0 -1
  287. package/web/app/immutable/chunks/Bba6So1V.js +0 -1
  288. package/web/app/immutable/chunks/Bc5_gcpq.js +0 -1
  289. package/web/app/immutable/chunks/BdD2ADMz.js +0 -1
  290. package/web/app/immutable/chunks/BlZYlbA9.js +0 -1
  291. package/web/app/immutable/chunks/BoCZH6mk.js +0 -1
  292. package/web/app/immutable/chunks/Bs26_0Q5.js +0 -2
  293. package/web/app/immutable/chunks/ByuX26Ym.js +0 -6
  294. package/web/app/immutable/chunks/C-MmtmWQ.js +0 -1
  295. package/web/app/immutable/chunks/C52Qm4vO.js +0 -1
  296. package/web/app/immutable/chunks/C5AlgdZ0.js +0 -1
  297. package/web/app/immutable/chunks/C8AARFCw.js +0 -2
  298. package/web/app/immutable/chunks/CAOA5kev.js +0 -2
  299. package/web/app/immutable/chunks/CEQZVenN.js +0 -6
  300. package/web/app/immutable/chunks/CN-2rfdx.js +0 -1
  301. package/web/app/immutable/chunks/CRQGIXhv.js +0 -1
  302. package/web/app/immutable/chunks/CWT4x6lB.js +0 -2
  303. package/web/app/immutable/chunks/CbCgON3R.js +0 -1
  304. package/web/app/immutable/chunks/CeT1zT46.js +0 -1
  305. package/web/app/immutable/chunks/Cfj3Lc6y.js +0 -1
  306. package/web/app/immutable/chunks/Cjpu4SJA.js +0 -1
  307. package/web/app/immutable/chunks/Ck9ZyE1n.js +0 -2
  308. package/web/app/immutable/chunks/CkSjvO0_.js +0 -1
  309. package/web/app/immutable/chunks/CoLl8pQb.js +0 -1
  310. package/web/app/immutable/chunks/CpadbTI2.js +0 -408
  311. package/web/app/immutable/chunks/CsxVJm8Y.js +0 -1
  312. package/web/app/immutable/chunks/CteSc0c_.js +0 -1
  313. package/web/app/immutable/chunks/CuhrgDBI.js +0 -1
  314. package/web/app/immutable/chunks/CvWyDJGm.js +0 -1
  315. package/web/app/immutable/chunks/CzVyzyWv.js +0 -2
  316. package/web/app/immutable/chunks/D6Wx8h-l.js +0 -11
  317. package/web/app/immutable/chunks/D8Ohjkn4.js +0 -3
  318. package/web/app/immutable/chunks/DATvyyct.js +0 -1
  319. package/web/app/immutable/chunks/DAoagkbK.js +0 -2
  320. package/web/app/immutable/chunks/DEjP-x_s.js +0 -1
  321. package/web/app/immutable/chunks/DFF9daPQ.js +0 -13
  322. package/web/app/immutable/chunks/DIP3ex32.js +0 -1
  323. package/web/app/immutable/chunks/DPDCu-py.js +0 -1
  324. package/web/app/immutable/chunks/DPR3VaPZ.js +0 -2
  325. package/web/app/immutable/chunks/DTQYcznv.js +0 -1
  326. package/web/app/immutable/chunks/DU8kuP6M.js +0 -1
  327. package/web/app/immutable/chunks/DZmwTozc.js +0 -1
  328. package/web/app/immutable/chunks/Dc64E_SR.js +0 -1
  329. package/web/app/immutable/chunks/Ddw98WmY.js +0 -8
  330. package/web/app/immutable/chunks/De4z9gHo.js +0 -1
  331. package/web/app/immutable/chunks/Dk6iNNLu.js +0 -1
  332. package/web/app/immutable/chunks/DlHB0ULA.js +0 -2
  333. package/web/app/immutable/chunks/DpHl7r8K.js +0 -1
  334. package/web/app/immutable/chunks/Dq3RHtWu.js +0 -1
  335. package/web/app/immutable/chunks/Dq3leYTy.js +0 -19
  336. package/web/app/immutable/chunks/Dq6CuXZE.js +0 -1
  337. package/web/app/immutable/chunks/DqJ-M21G.js +0 -1
  338. package/web/app/immutable/chunks/Dwyq6WEC.js +0 -1
  339. package/web/app/immutable/chunks/DxNbgJ8X.js +0 -2
  340. package/web/app/immutable/chunks/DzHHkfB1.js +0 -1
  341. package/web/app/immutable/chunks/EbDWf2Y-.js +0 -1
  342. package/web/app/immutable/chunks/Ek5W6pp5.js +0 -1
  343. package/web/app/immutable/chunks/H60Tbroe.js +0 -1
  344. package/web/app/immutable/chunks/JzAjTSJP.js +0 -1
  345. package/web/app/immutable/chunks/PPmweWGv.js +0 -2
  346. package/web/app/immutable/chunks/UYKGMt9K.js +0 -1
  347. package/web/app/immutable/chunks/X_y6HQmR.js +0 -1
  348. package/web/app/immutable/chunks/YNoNxkXn.js +0 -4
  349. package/web/app/immutable/entry/app.Ci0fqF_i.js +0 -4
  350. package/web/app/immutable/entry/start.DzDtsQrC.js +0 -1
  351. package/web/app/immutable/nodes/0.BJcKF537.js +0 -1
  352. package/web/app/immutable/nodes/1.Dj_1C4wl.js +0 -1
  353. package/web/app/immutable/nodes/10.DTBkzFBQ.js +0 -41
  354. package/web/app/immutable/nodes/11.C9N9_Xb9.js +0 -1
  355. package/web/app/immutable/nodes/12.CqRfopX4.js +0 -1
  356. package/web/app/immutable/nodes/14.BDOAvRMB.js +0 -3
  357. package/web/app/immutable/nodes/15.BWtoiI44.js +0 -1
  358. package/web/app/immutable/nodes/2.B_fHdNW9.js +0 -13
  359. package/web/app/immutable/nodes/3.CzW2JK5A.js +0 -2
  360. package/web/app/immutable/nodes/4.DP65YvXF.js +0 -1
  361. package/web/app/immutable/nodes/5.ivE-5gZP.js +0 -5
  362. package/web/app/immutable/nodes/6.58wOdki0.js +0 -1
  363. package/web/app/immutable/nodes/7.9Khb1Buc.js +0 -1
  364. /package/web/app/immutable/assets/{17.Cznk2DRv.css → 18.Cznk2DRv.css} +0 -0
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/B9Hetctu.js","/app/immutable/chunks/Chj7QpdD.js","/app/immutable/chunks/CAOA5kev.js","/app/immutable/chunks/DTQYcznv.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/-xK_vQQs.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/B0a-wzQr.js","/app/immutable/chunks/CG3imlyr.js","/app/immutable/chunks/BAxqzRwc.js","/app/immutable/chunks/lAmQKSWr.js","/app/immutable/chunks/CaXjFtDt.js","/app/immutable/chunks/DW36BCXj.js","/app/immutable/chunks/CJ58g2zu.js","/app/immutable/chunks/BTWq1_ry.js","/app/immutable/chunks/DDfvytcD.js","/app/immutable/chunks/Bywuf0q4.js","/app/immutable/chunks/Ds3Wirif.js","/app/immutable/chunks/B0biUQQF.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/A0r9TbR7.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/DLqztIqC.js","/app/immutable/chunks/CaxyE6o_.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/-SwunqO3.js","/app/immutable/chunks/CoLl8pQb.js","/app/immutable/chunks/BmP1Wws6.js","/app/immutable/chunks/Ck9ZyE1n.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/BP5uyQTv.js","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/finAdq6c.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BIEvH8pu.js","/app/immutable/chunks/BqqN40AD.js","/app/immutable/chunks/DCDhq2rq.js","/app/immutable/chunks/CuhrgDBI.js","/app/immutable/chunks/DpMTpLDQ.js","/app/immutable/chunks/DfxQWSVU.js","/app/immutable/chunks/BWYr8u9e.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.BeL_JB6L.css","/app/immutable/chunks/C1nHAGLu.js","/app/immutable/chunks/B5tGFpkq.js","/app/immutable/chunks/C8dU7SM3.js","/app/immutable/chunks/BMm9sGZ6.js","/app/immutable/chunks/CeswpNyE.js","/app/immutable/chunks/BvFAWM27.js","/app/immutable/chunks/CzVyzyWv.js","/app/immutable/chunks/CEQZVenN.js","/app/immutable/chunks/BVt_T8ao.js","/app/immutable/chunks/DpsFFL7J.js","/app/immutable/chunks/DqvXXMrh.js","/app/immutable/chunks/BfZCAeqU.js","/app/immutable/chunks/DwKUz42C.js","/app/immutable/chunks/BGX6W-wu.js","/app/immutable/chunks/GETqdV-9.js","/app/immutable/chunks/Cv_J2c72.js","/app/immutable/chunks/Bvc8qRhk.js","/app/immutable/chunks/m18NZZRr.js","/app/immutable/chunks/CBqGKeYg.js","/app/immutable/chunks/BdCclrfD.js","/app/immutable/chunks/CXNfY5OA.js","/app/immutable/chunks/BUdcKH65.js","/app/immutable/chunks/DtKh4Q6Q.js","/app/immutable/chunks/BUGXi07N.js","/app/immutable/chunks/C0p8rhDn.js","/app/immutable/chunks/BYtSPAAW.js","/app/immutable/chunks/ByTOmivs.js","/app/immutable/chunks/CYEd8dKU.js","/app/immutable/chunks/Dx41gQiN.js","/app/immutable/chunks/Bk2z5Cd0.js","/app/immutable/chunks/PwvNS9aJ.js","/app/immutable/chunks/DYk0s6f0.js","/app/immutable/chunks/BvZrnx87.js","/app/immutable/chunks/BXTuZcZW.js","/app/immutable/chunks/BrRRz1w6.js","/app/immutable/chunks/BuTNFoR8.js","/app/immutable/chunks/CrfXhNNb.js","/app/immutable/chunks/VyOfhH-C.js","/app/immutable/chunks/Dsmvkh8d.js","/app/immutable/chunks/t_3vjEsA.js","/app/immutable/chunks/C-ZPZDJB.js","/app/immutable/chunks/7teYU7wH.js","/app/immutable/chunks/BkbQGifa.js","/app/immutable/chunks/1MWULgfl.js","/app/immutable/chunks/Bb-m1QhD.js"])))=>i.map(i=>d[i]);
2
- var lC=Object.defineProperty;var cC=(e,t,r)=>t in e?lC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var xr=(e,t,r)=>cC(e,typeof t!="symbol"?t+"":t,r);import{_ as Ve,t as Oo,br as He,bp as je,bz as Do,b as Ro,a_ as yr,bs as hC}from"./DTQYcznv.js";import{g as dC}from"./BdWqymET.js";import{aP as bs}from"./Ds3Wirif.js";import{b7 as uC,cc as fC,bs as No,a7 as Ko,ay as ui,aD as A,bS as We,be as en,b$ as rl,b_ as cr,bO as br,W as ge,c9 as Dt,bn as qo,aA as _e,aB as ar,bk as hd,bH as gt,ca as Bo,c5 as pl,a5 as qe,bA as $e,bV as ce,bl as Tr,c0 as Th,aC as pi,aw as ml,a as Wu,bj as Np,br as wi,cb as gC,bf as pC}from"./DYhIMPy1.js";import{z as zu}from"./BKYCO_49.js";import{v as co,u as fe,s as rn,o as mC,i as qp,e as yC,f as xC,g as bC,n as ya,p as Hu,j as Wp,w as Xa}from"./Ck9ZyE1n.js";import{b as no}from"./BaIAhI85.js";import{c as CC}from"./ChTqQfQN.js";import{c$ as wC,cR as kC,F as dn,aI as SC,b7 as zp,l as vC,m as MC,f as TC,i as BC,v as Yu,s as Xu,g as _C,G as LC,P as AC,q as FC,y as $C,p as EC,j as PC,D as ju,H as IC,U as OC,at as DC,au as RC,aU as NC}from"./CoLl8pQb.js";import{f as Ja,am as qC}from"./BP5uyQTv.js";import{r as WC,a6 as zC}from"./Dlag9Uxb.js";import{e as HC,H as YC}from"./ByuX26Ym.js";import{G as Hp}from"./-SwunqO3.js";import{I as To,h as Gu,H as Is,d as Uu}from"./BqqN40AD.js";import{c as fa}from"./BmP1Wws6.js";import{e as XC}from"./DYmPPjiq.js";import{t as jC}from"./De4z9gHo.js";import{s as il}from"./CaxyE6o_.js";import{s as Vu,a as GC}from"./BsieX9dN.js";import{p as UC,K as VC,h as ZC,i as Cc,M as KC}from"./Ddw98WmY.js";import"./BXeiKdwz.js";import{t as wo}from"./CuhrgDBI.js";import"./DpMTpLDQ.js";import"./A0r9TbR7.js";import{cq as QC}from"./DCDhq2rq.js";function JC(e,t){uC(window,["resize"],()=>fC(()=>t(window[e])))}var Yp=Object.defineProperty,C=(e,t)=>Yp(e,"name",{value:t,configurable:!0}),t2=(e,t)=>{for(var r in t)Yp(e,r,{get:t[r],enumerable:!0})};function Xp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}C(Xp,"getDefaultExportFromCjs");var ei={},Pn={},Xo={},Zu;function Ts(){if(Zu)return Xo;Zu=1;function e(s){return typeof s>"u"||s===null}C(e,"isNothing");function t(s){return typeof s=="object"&&s!==null}C(t,"isObject");function r(s){return Array.isArray(s)?s:e(s)?[]:[s]}C(r,"toArray");function i(s,n){if(n){const l=Object.keys(n);for(let c=0,h=l.length;c<h;c+=1){const d=l[c];s[d]=n[d]}}return s}C(i,"extend");function o(s,n){let l="";for(let c=0;c<n;c+=1)l+=s;return l}C(o,"repeat");function a(s){return s===0&&Number.NEGATIVE_INFINITY===1/s}return C(a,"isNegativeZero"),Xo.isNothing=e,Xo.isObject=t,Xo.toArray=r,Xo.repeat=o,Xo.isNegativeZero=a,Xo.extend=i,Xo}C(Ts,"requireCommon");var wc,Ku;function Bs(){if(Ku)return wc;Ku=1;function e(r,i){let o="";const a=r.reason||"(unknown reason)";return r.mark?(r.mark.name&&(o+='in "'+r.mark.name+'" '),o+="("+(r.mark.line+1)+":"+(r.mark.column+1)+")",!i&&r.mark.snippet&&(o+=`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/DE8QOEZV.js","/app/immutable/chunks/B0WVH3Hg.js","/app/immutable/chunks/DfjJilaB.js","/app/immutable/chunks/D9jYN6_J.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/-xK_vQQs.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BDZoh7yg.js","/app/immutable/chunks/Dj8J0eqI.js","/app/immutable/chunks/Y4VeEPHl.js","/app/immutable/chunks/lAmQKSWr.js","/app/immutable/chunks/CvGEpOsC.js","/app/immutable/chunks/BTNEDHav.js","/app/immutable/chunks/BlEwAz4v.js","/app/immutable/chunks/DOCWMdWU.js","/app/immutable/chunks/D0I9E6A0.js","/app/immutable/chunks/D492HRYt.js","/app/immutable/chunks/ChNPgGKQ.js","/app/immutable/chunks/asQ_ruFQ.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/BfbZn9QX.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/V9qci_dz.js","/app/immutable/chunks/Cx31i8ng.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/CEsW1euQ.js","/app/immutable/chunks/CAUaU8Wh.js","/app/immutable/chunks/DZyAzxxC.js","/app/immutable/chunks/7eL9Pgig.js","/app/immutable/chunks/C_EpV6jU.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/Bgw3O9rE.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/Dkva_evl.js","/app/immutable/chunks/DknPpgEW.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/DRZKWEq3.js","/app/immutable/chunks/B4gIvcP2.js","/app/immutable/chunks/DF1uIj8u.js","/app/immutable/chunks/BWAGtvpD.js","/app/immutable/chunks/0qEvU7Aj.js","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/OPvMR-5p.js","/app/immutable/chunks/CQbtnalz.js","/app/immutable/chunks/DfxQWSVU.js","/app/immutable/chunks/BWYr8u9e.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.BeL_JB6L.css","/app/immutable/chunks/DNWBkvFP.js","/app/immutable/chunks/CpHzYkzi.js","/app/immutable/chunks/A8_BT67P.js","/app/immutable/chunks/C3NeTp2u.js","/app/immutable/chunks/DzGNgfrZ.js","/app/immutable/chunks/BvFAWM27.js","/app/immutable/chunks/DTSEdINd.js","/app/immutable/chunks/etVaBLxV.js","/app/immutable/chunks/aQy6qVNs.js","/app/immutable/chunks/s0TWEExr.js","/app/immutable/chunks/CNT1n9YR.js","/app/immutable/chunks/ClMg3ew2.js","/app/immutable/chunks/CJ_dtcmM.js","/app/immutable/chunks/bKyElw3h.js","/app/immutable/chunks/D7dPbXji.js","/app/immutable/chunks/B-7vt8Nv.js","/app/immutable/chunks/DdVIXVso.js","/app/immutable/chunks/CVa6MqnK.js","/app/immutable/chunks/G_wYaln-.js","/app/immutable/chunks/Zl17pAXX.js","/app/immutable/chunks/CmoBwSCp.js","/app/immutable/chunks/CrjpdU4V.js","/app/immutable/chunks/CQB76zlc.js","/app/immutable/chunks/BmEcZoA2.js","/app/immutable/chunks/CXpFRnSj.js","/app/immutable/chunks/CjbCpI18.js","/app/immutable/chunks/BM7oCSp5.js","/app/immutable/chunks/CFs6uWH2.js","/app/immutable/chunks/Bxnf75xq.js","/app/immutable/chunks/eNHX5lds.js","/app/immutable/chunks/BJZ04Dji.js","/app/immutable/chunks/D1CYDv8t.js","/app/immutable/chunks/Ckp5dOHW.js","/app/immutable/chunks/jlJQSpH6.js","/app/immutable/chunks/CCm1BgPl.js","/app/immutable/chunks/D31IcU1_.js","/app/immutable/chunks/WbTmlouE.js","/app/immutable/chunks/B3D9gAmi.js","/app/immutable/chunks/DW9MEQey.js","/app/immutable/chunks/ouMKS3MA.js","/app/immutable/chunks/C8XrM-qb.js","/app/immutable/chunks/Do80Vc58.js","/app/immutable/chunks/BLl22NdQ.js","/app/immutable/chunks/BLaIjbEF.js","/app/immutable/chunks/BnkmaA34.js"])))=>i.map(i=>d[i]);
2
+ var lC=Object.defineProperty;var cC=(e,t,r)=>t in e?lC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var xr=(e,t,r)=>cC(e,typeof t!="symbol"?t+"":t,r);import{_ as Ve,t as Oo,bq as He,bo as je,by as Do,b as Ro,br as hC}from"./D9jYN6_J.js";import{g as dC}from"./BdWqymET.js";import{aP as bs}from"./ChNPgGKQ.js";import{b7 as uC,cc as fC,bs as No,a7 as Ko,ay as ui,aD as A,bS as We,be as en,b$ as rl,b_ as cr,bO as br,W as ge,c9 as Dt,bn as qo,aA as _e,aB as ar,bk as hd,bH as gt,ca as Bo,c5 as pl,a5 as qe,bA as $e,bV as ce,bl as Tr,c0 as Th,aC as pi,aw as ml,a as Wu,bj as Np,br as wi,cb as gC,bf as pC}from"./DYhIMPy1.js";import{i as yr}from"./7eL9Pgig.js";import{z as zu}from"./BAGVOK-j.js";import{f as co,s as fe,b as qp,c as Wp,g as Xa}from"./C_EpV6jU.js";import{b as no}from"./BaIAhI85.js";import{c as mC}from"./ChTqQfQN.js";import{c$ as yC,cR as xC,F as dn,aI as bC,b7 as zp,l as CC,m as wC,f as kC,i as SC,v as Hu,s as Yu,g as vC,G as MC,P as TC,q as BC,y as _C,p as LC,j as AC,D as Xu,H as FC,U as $C,at as EC,au as PC,aU as IC}from"./CAUaU8Wh.js";import{f as Ja,ae as OC}from"./0qEvU7Aj.js";import"./Dkva_evl.js";import{r as DC,a6 as RC}from"./B79pUPc3.js";import{p as rn,h as NC,d as qC,S as WC,e as zC,g as ya,i as ju}from"./Bgw3O9rE.js";import{e as HC,H as YC}from"./Brqq8vhd.js";import{k as Hp}from"./OPvMR-5p.js";import{I as To,h as Gu,H as Is,d as Uu}from"./B4gIvcP2.js";import{c as fa}from"./DZyAzxxC.js";import{e as XC}from"./T9tywf_e.js";import{t as jC}from"./Big_dnEI.js";import{s as il}from"./Cx31i8ng.js";import{s as Vu,a as GC}from"./BsieX9dN.js";import{p as UC,K as VC,h as ZC,i as Cc,M as KC}from"./IRbjhecv.js";import"./d-Ep-sfP.js";import{t as wo}from"./BWAGtvpD.js";import"./CQbtnalz.js";import"./BfbZn9QX.js";import{cq as QC}from"./DF1uIj8u.js";function JC(e,t){uC(window,["resize"],()=>fC(()=>t(window[e])))}var Yp=Object.defineProperty,C=(e,t)=>Yp(e,"name",{value:t,configurable:!0}),t2=(e,t)=>{for(var r in t)Yp(e,r,{get:t[r],enumerable:!0})};function Xp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}C(Xp,"getDefaultExportFromCjs");var ei={},Pn={},Xo={},Zu;function Ts(){if(Zu)return Xo;Zu=1;function e(s){return typeof s>"u"||s===null}C(e,"isNothing");function t(s){return typeof s=="object"&&s!==null}C(t,"isObject");function r(s){return Array.isArray(s)?s:e(s)?[]:[s]}C(r,"toArray");function i(s,n){if(n){const l=Object.keys(n);for(let c=0,h=l.length;c<h;c+=1){const d=l[c];s[d]=n[d]}}return s}C(i,"extend");function o(s,n){let l="";for(let c=0;c<n;c+=1)l+=s;return l}C(o,"repeat");function a(s){return s===0&&Number.NEGATIVE_INFINITY===1/s}return C(a,"isNegativeZero"),Xo.isNothing=e,Xo.isObject=t,Xo.toArray=r,Xo.repeat=o,Xo.isNegativeZero=a,Xo.extend=i,Xo}C(Ts,"requireCommon");var wc,Ku;function Bs(){if(Ku)return wc;Ku=1;function e(r,i){let o="";const a=r.reason||"(unknown reason)";return r.mark?(r.mark.name&&(o+='in "'+r.mark.name+'" '),o+="("+(r.mark.line+1)+":"+(r.mark.column+1)+")",!i&&r.mark.snippet&&(o+=`
3
3
 
4
4
  `+r.mark.snippet),a+" "+o):a}C(e,"formatError");function t(r,i){Error.call(this),this.name="YAMLException",this.reason=r,this.mark=i,this.message=e(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return C(t,"YAMLException2"),t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=C(function(i){return this.name+": "+e(this,i)},"toString"),wc=t,wc}C(Bs,"requireException");var kc,Qu;function jp(){if(Qu)return kc;Qu=1;const e=Ts();function t(o,a,s,n,l){let c="",h="";const d=Math.floor(l/2)-1;return n-a>d&&(c=" ... ",a=n-d+c.length),s-n>d&&(h=" ...",s=n+d-h.length),{str:c+o.slice(a,s).replace(/\t/g,"→")+h,pos:n-a+c.length}}C(t,"getLine");function r(o,a){return e.repeat(" ",a-o.length)+o}C(r,"padStart");function i(o,a){if(a=Object.create(a||null),!o.buffer)return null;a.maxLength||(a.maxLength=79),typeof a.indent!="number"&&(a.indent=1),typeof a.linesBefore!="number"&&(a.linesBefore=3),typeof a.linesAfter!="number"&&(a.linesAfter=2);const s=/\r?\n|\r|\0/g,n=[0],l=[];let c,h=-1;for(;c=s.exec(o.buffer);)l.push(c.index),n.push(c.index+c[0].length),o.position<=c.index&&h<0&&(h=n.length-2);h<0&&(h=n.length-1);let d="";const u=Math.min(o.line+a.linesAfter,l.length).toString().length,f=a.maxLength-(a.indent+u+3);for(let p=1;p<=a.linesBefore&&!(h-p<0);p++){const m=t(o.buffer,n[h-p],l[h-p],o.position-(n[h]-n[h-p]),f);d=e.repeat(" ",a.indent)+r((o.line-p+1).toString(),u)+" | "+m.str+`
5
5
  `+d}const g=t(o.buffer,n[h],l[h],o.position,f);d+=e.repeat(" ",a.indent)+r((o.line+1).toString(),u)+" | "+g.str+`
@@ -30,10 +30,10 @@ var lC=Object.defineProperty;var cC=(e,t,r)=>t in e?lC(e,t,{enumerable:!0,config
30
30
  `+N.slice(xt,Tt),xt=Tt+1),st=kt;return jt+=`
31
31
  `,N.length-xt>et&&st>xt?jt+=N.slice(xt,st)+`
32
32
  `+N.slice(st+1):jt+=N.slice(xt),jt.slice(1)}C(ue,"foldLine");function Ee(N){let et="",it=0;for(let ct=0;ct<N.length;it>=65536?ct+=2:ct++){it=G(N,ct);const xt=$[it];!xt&&V(it)?(et+=N[ct],it>=65536&&(et+=N[ct+1])):et+=xt||q(it)}return et}C(Ee,"escapeString");function ke(N,et,it){let ct="";const xt=N.tag;for(let Tt=0,st=it.length;Tt<st;Tt+=1){let kt=it[Tt];N.replacer&&(kt=N.replacer.call(it,String(Tt),kt)),(J(N,et,kt,!1,!1)||typeof kt>"u"&&J(N,et,null,!1,!1))&&(ct!==""&&(ct+=","+(N.condenseFlow?"":" ")),ct+=N.dump)}N.tag=xt,N.dump="["+ct+"]"}C(ke,"writeFlowSequence");function Se(N,et,it,ct){let xt="";const Tt=N.tag;for(let st=0,kt=it.length;st<kt;st+=1){let jt=it[st];N.replacer&&(jt=N.replacer.call(it,String(st),jt)),(J(N,et+1,jt,!0,!0,!1,!0)||typeof jt>"u"&&J(N,et+1,null,!0,!0,!1,!0))&&((!ct||xt!=="")&&(xt+=z(N,et)),N.dump&&n===N.dump.charCodeAt(0)?xt+="-":xt+="- ",xt+=N.dump)}N.tag=Tt,N.dump=xt||"[]"}C(Se,"writeBlockSequence");function _t(N,et,it){let ct="";const xt=N.tag,Tt=Object.keys(it);for(let st=0,kt=Tt.length;st<kt;st+=1){let jt="";ct!==""&&(jt+=", "),N.condenseFlow&&(jt+='"');const re=Tt[st];let Kt=it[re];N.replacer&&(Kt=N.replacer.call(it,re,Kt)),J(N,et,re,!1,!1)&&(N.dump.length>1024&&(jt+="? "),jt+=N.dump+(N.condenseFlow?'"':"")+":"+(N.condenseFlow?"":" "),J(N,et,Kt,!1,!1)&&(jt+=N.dump,ct+=jt))}N.tag=xt,N.dump="{"+ct+"}"}C(_t,"writeFlowMapping");function Xt(N,et,it,ct){let xt="";const Tt=N.tag,st=Object.keys(it);if(N.sortKeys===!0)st.sort();else if(typeof N.sortKeys=="function")st.sort(N.sortKeys);else if(N.sortKeys)throw new t("sortKeys must be a boolean or a function");for(let kt=0,jt=st.length;kt<jt;kt+=1){let re="";(!ct||xt!=="")&&(re+=z(N,et));const Kt=st[kt];let xe=it[Kt];if(N.replacer&&(xe=N.replacer.call(it,Kt,xe)),!J(N,et+1,Kt,!0,!0,!0))continue;const Pe=N.tag!==null&&N.tag!=="?"||N.dump&&N.dump.length>1024;Pe&&(N.dump&&n===N.dump.charCodeAt(0)?re+="?":re+="? "),re+=N.dump,Pe&&(re+=z(N,et)),J(N,et+1,xe,!0,Pe)&&(N.dump&&n===N.dump.charCodeAt(0)?re+=":":re+=": ",re+=N.dump,xt+=re)}N.tag=Tt,N.dump=xt||"{}"}C(Xt,"writeBlockMapping");function w(N,et,it){const ct=it?N.explicitTypes:N.implicitTypes;for(let xt=0,Tt=ct.length;xt<Tt;xt+=1){const st=ct[xt];if((st.instanceOf||st.predicate)&&(!st.instanceOf||typeof et=="object"&&et instanceof st.instanceOf)&&(!st.predicate||st.predicate(et))){if(it?st.multi&&st.representName?N.tag=st.representName(et):N.tag=st.tag:N.tag="?",st.represent){const kt=N.styleMap[st.tag]||st.defaultStyle;let jt;if(i.call(st.represent)==="[object Function]")jt=st.represent(et,kt);else if(o.call(st.represent,kt))jt=st.represent[kt](et,kt);else throw new t("!<"+st.tag+'> tag resolver accepts not "'+kt+'" style');N.dump=jt}return!0}}return!1}C(w,"detectType");function J(N,et,it,ct,xt,Tt,st){N.tag=null,N.dump=it,w(N,it,!1)||w(N,it,!0);const kt=i.call(N.dump),jt=ct;ct&&(ct=N.flowLevel<0||N.flowLevel>et);const re=kt==="[object Object]"||kt==="[object Array]";let Kt,xe;if(re&&(Kt=N.duplicates.indexOf(it),xe=Kt!==-1),(N.tag!==null&&N.tag!=="?"||xe||N.indent!==2&&et>0)&&(xt=!1),xe&&N.usedDuplicates[Kt])N.dump="*ref_"+Kt;else{if(re&&xe&&!N.usedDuplicates[Kt]&&(N.usedDuplicates[Kt]=!0),kt==="[object Object]")ct&&Object.keys(N.dump).length!==0?(Xt(N,et,N.dump,xt),xe&&(N.dump="&ref_"+Kt+N.dump)):(_t(N,et,N.dump),xe&&(N.dump="&ref_"+Kt+" "+N.dump));else if(kt==="[object Array]")ct&&N.dump.length!==0?(N.noArrayIndent&&!st&&et>0?Se(N,et-1,N.dump,xt):Se(N,et,N.dump,xt),xe&&(N.dump="&ref_"+Kt+N.dump)):(ke(N,et,N.dump),xe&&(N.dump="&ref_"+Kt+" "+N.dump));else if(kt==="[object String]")N.tag!=="?"&&Bt(N,N.dump,et,Tt,jt);else{if(kt==="[object Undefined]")return!1;if(N.skipInvalid)return!1;throw new t("unacceptable kind of an object to dump "+kt)}if(N.tag!==null&&N.tag!=="?"){let Pe=encodeURI(N.tag[0]==="!"?N.tag.slice(1):N.tag).replace(/!/g,"%21");N.tag[0]==="!"?Pe="!"+Pe:Pe.slice(0,18)==="tag:yaml.org,2002:"?Pe="!!"+Pe.slice(18):Pe="!<"+Pe+">",N.dump=Pe+" "+N.dump}}return!0}C(J,"writeNode");function dt(N,et){const it=[],ct=[];mt(N,it,ct);const xt=ct.length;for(let Tt=0;Tt<xt;Tt+=1)et.duplicates.push(it[ct[Tt]]);et.usedDuplicates=new Array(xt)}C(dt,"getDuplicateReferences");function mt(N,et,it){if(N!==null&&typeof N=="object"){const ct=et.indexOf(N);if(ct!==-1)it.indexOf(ct)===-1&&it.push(ct);else if(et.push(N),Array.isArray(N))for(let xt=0,Tt=N.length;xt<Tt;xt+=1)mt(N[xt],et,it);else{const xt=Object.keys(N);for(let Tt=0,st=xt.length;Tt<st;Tt+=1)mt(N[xt[Tt]],et,it)}}}C(mt,"inspectNode");function ft(N,et){et=et||{};const it=new Y(et);it.noRefs||dt(N,it);let ct=N;return it.replacer&&(ct=it.replacer.call({"":ct},"",ct)),J(it,0,ct,!0,!0)?it.dump+`
33
- `:""}return C(ft,"dump2"),zc.dump=ft,zc}C(Up,"requireDumper");var wf;function Vp(){if(wf)return ei;wf=1;const e=Gp(),t=Up();function r(i,o){return function(){throw new Error("Function yaml."+i+" is removed in js-yaml 4. Use yaml."+o+" instead, which is now safe by default.")}}return C(r,"renamed"),ei.Type=si(),ei.Schema=dd(),ei.FAILSAFE_SCHEMA=pd(),ei.JSON_SCHEMA=Cd(),ei.CORE_SCHEMA=wd(),ei.DEFAULT_SCHEMA=Ul(),ei.load=e.load,ei.loadAll=e.loadAll,ei.dump=t.dump,ei.YAMLException=Bs(),ei.types={binary:vd(),float:bd(),map:gd(),null:md(),pairs:Td(),set:Bd(),timestamp:kd(),bool:yd(),int:xd(),merge:Sd(),omap:Md(),seq:fd(),str:ud()},ei.safeLoad=r("safeLoad","load"),ei.safeLoadAll=r("safeLoadAll","loadAll"),ei.safeDump=r("safeDump","dump"),ei}C(Vp,"requireJsYaml");var e2=Vp(),r2=Xp(e2),{Type:H4,Schema:Y4,FAILSAFE_SCHEMA:X4,JSON_SCHEMA:i2,CORE_SCHEMA:j4,DEFAULT_SCHEMA:G4,load:o2,loadAll:U4,dump:V4,YAMLException:Z4,types:K4,safeLoad:Q4,safeLoadAll:J4,safeDump:tP}=r2,a2=C((e,t)=>{const{theme:r,themeVariables:i}=t,{useGradient:o,gradientStart:a,gradientStop:s}=i??{},n=e.attr("id"),l=r?.includes("dark")?"#FFFFFF":"#000000",c=C((d,u,f)=>e.append("defs").append("filter").attr("id",d).attr("height",u).attr("width",u).append("feDropShadow").attr("dx",f).attr("dy",f).attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",l),"dropShadow");if(c(`${n}-drop-shadow`,"130%","4"),c(`${n}-drop-shadow-small`,"150%","2"),!o)return;const h=e.append("linearGradient").attr("id",`${n}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");h.append("svg:stop").attr("offset","0%").attr("stop-color",a).attr("stop-opacity",1),h.append("svg:stop").attr("offset","100%").attr("stop-color",s).attr("stop-opacity",1)},"insertLookDefs"),ol={exports:{}},s2=ol.exports,kf;function n2(){return kf||(kf=1,(function(e,t){(function(r,i){e.exports=i()})(s2,(function(){var r=1e3,i=6e4,o=36e5,a="millisecond",s="second",n="minute",l="hour",c="day",h="week",d="month",u="quarter",f="year",g="date",p="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,x={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function($){var I=["th","st","nd","rd"],F=$%100;return"["+$+(I[(F-20)%10]||I[F]||I[0])+"]"}},b=function($,I,F){var R=String($);return!R||R.length>=I?$:""+Array(I+1-R.length).join(F)+$},S={s:b,z:function($){var I=-$.utcOffset(),F=Math.abs(I),R=Math.floor(F/60),q=F%60;return(I<=0?"+":"-")+b(R,2,"0")+":"+b(q,2,"0")},m:function $(I,F){if(I.date()<F.date())return-$(F,I);var R=12*(F.year()-I.year())+(F.month()-I.month()),q=I.clone().add(R,d),D=F-q<0,P=I.clone().add(R+(D?-1:1),d);return+(-(R+(F-q)/(D?q-P:P-q))||0)},a:function($){return $<0?Math.ceil($)||0:Math.floor($)},p:function($){return{M:d,y:f,w:h,d:c,D:g,h:l,m:n,s,ms:a,Q:u}[$]||String($||"").toLowerCase().replace(/s$/,"")},u:function($){return $===void 0}},T="en",k={};k[T]=x;var _="$isDayjsObject",L=function($){return $ instanceof E||!(!$||!$[_])},v=function $(I,F,R){var q;if(!I)return T;if(typeof I=="string"){var D=I.toLowerCase();k[D]&&(q=D),F&&(k[D]=F,q=D);var P=I.split("-");if(!q&&P.length>1)return $(P[0])}else{var Y=I.name;k[Y]=I,q=Y}return!R&&q&&(T=q),q||!R&&T},M=function($,I){if(L($))return $.clone();var F=typeof I=="object"?I:{};return F.date=$,F.args=arguments,new E(F)},B=S;B.l=v,B.i=L,B.w=function($,I){return M($,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var E=(function(){function $(F){this.$L=v(F.locale,null,!0),this.parse(F),this.$x=this.$x||F.x||{},this[_]=!0}var I=$.prototype;return I.parse=function(F){this.$d=(function(R){var q=R.date,D=R.utc;if(q===null)return new Date(NaN);if(B.u(q))return new Date;if(q instanceof Date)return new Date(q);if(typeof q=="string"&&!/Z$/i.test(q)){var P=q.match(m);if(P){var Y=P[2]-1||0,X=(P[7]||"0").substring(0,3);return D?new Date(Date.UTC(P[1],Y,P[3]||1,P[4]||0,P[5]||0,P[6]||0,X)):new Date(P[1],Y,P[3]||1,P[4]||0,P[5]||0,P[6]||0,X)}}return new Date(q)})(F),this.init()},I.init=function(){var F=this.$d;this.$y=F.getFullYear(),this.$M=F.getMonth(),this.$D=F.getDate(),this.$W=F.getDay(),this.$H=F.getHours(),this.$m=F.getMinutes(),this.$s=F.getSeconds(),this.$ms=F.getMilliseconds()},I.$utils=function(){return B},I.isValid=function(){return this.$d.toString()!==p},I.isSame=function(F,R){var q=M(F);return this.startOf(R)<=q&&q<=this.endOf(R)},I.isAfter=function(F,R){return M(F)<this.startOf(R)},I.isBefore=function(F,R){return this.endOf(R)<M(F)},I.$g=function(F,R,q){return B.u(F)?this[R]:this.set(q,F)},I.unix=function(){return Math.floor(this.valueOf()/1e3)},I.valueOf=function(){return this.$d.getTime()},I.startOf=function(F,R){var q=this,D=!!B.u(R)||R,P=B.p(F),Y=function(ht,H){var G=B.w(q.$u?Date.UTC(q.$y,H,ht):new Date(q.$y,H,ht),q);return D?G:G.endOf(c)},X=function(ht,H){return B.w(q.toDate()[ht].apply(q.toDate("s"),(D?[0,0,0,0]:[23,59,59,999]).slice(H)),q)},z=this.$W,U=this.$M,j=this.$D,V="set"+(this.$u?"UTC":"");switch(P){case f:return D?Y(1,0):Y(31,11);case d:return D?Y(1,U):Y(0,U+1);case h:var Q=this.$locale().weekStart||0,rt=(z<Q?z+7:z)-Q;return Y(D?j-rt:j+(6-rt),U);case c:case g:return X(V+"Hours",0);case l:return X(V+"Minutes",1);case n:return X(V+"Seconds",2);case s:return X(V+"Milliseconds",3);default:return this.clone()}},I.endOf=function(F){return this.startOf(F,!1)},I.$set=function(F,R){var q,D=B.p(F),P="set"+(this.$u?"UTC":""),Y=(q={},q[c]=P+"Date",q[g]=P+"Date",q[d]=P+"Month",q[f]=P+"FullYear",q[l]=P+"Hours",q[n]=P+"Minutes",q[s]=P+"Seconds",q[a]=P+"Milliseconds",q)[D],X=D===c?this.$D+(R-this.$W):R;if(D===d||D===f){var z=this.clone().set(g,1);z.$d[Y](X),z.init(),this.$d=z.set(g,Math.min(this.$D,z.daysInMonth())).$d}else Y&&this.$d[Y](X);return this.init(),this},I.set=function(F,R){return this.clone().$set(F,R)},I.get=function(F){return this[B.p(F)]()},I.add=function(F,R){var q,D=this;F=Number(F);var P=B.p(R),Y=function(U){var j=M(D);return B.w(j.date(j.date()+Math.round(U*F)),D)};if(P===d)return this.set(d,this.$M+F);if(P===f)return this.set(f,this.$y+F);if(P===c)return Y(1);if(P===h)return Y(7);var X=(q={},q[n]=i,q[l]=o,q[s]=r,q)[P]||1,z=this.$d.getTime()+F*X;return B.w(z,this)},I.subtract=function(F,R){return this.add(-1*F,R)},I.format=function(F){var R=this,q=this.$locale();if(!this.isValid())return q.invalidDate||p;var D=F||"YYYY-MM-DDTHH:mm:ssZ",P=B.z(this),Y=this.$H,X=this.$m,z=this.$M,U=q.weekdays,j=q.months,V=q.meridiem,Q=function(H,G,K,tt){return H&&(H[G]||H(R,D))||K[G].slice(0,tt)},rt=function(H){return B.s(Y%12||12,H,"0")},ht=V||function(H,G,K){var tt=H<12?"AM":"PM";return K?tt.toLowerCase():tt};return D.replace(y,(function(H,G){return G||(function(K){switch(K){case"YY":return String(R.$y).slice(-2);case"YYYY":return B.s(R.$y,4,"0");case"M":return z+1;case"MM":return B.s(z+1,2,"0");case"MMM":return Q(q.monthsShort,z,j,3);case"MMMM":return Q(j,z);case"D":return R.$D;case"DD":return B.s(R.$D,2,"0");case"d":return String(R.$W);case"dd":return Q(q.weekdaysMin,R.$W,U,2);case"ddd":return Q(q.weekdaysShort,R.$W,U,3);case"dddd":return U[R.$W];case"H":return String(Y);case"HH":return B.s(Y,2,"0");case"h":return rt(1);case"hh":return rt(2);case"a":return ht(Y,X,!0);case"A":return ht(Y,X,!1);case"m":return String(X);case"mm":return B.s(X,2,"0");case"s":return String(R.$s);case"ss":return B.s(R.$s,2,"0");case"SSS":return B.s(R.$ms,3,"0");case"Z":return P}return null})(H)||P.replace(":","")}))},I.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},I.diff=function(F,R,q){var D,P=this,Y=B.p(R),X=M(F),z=(X.utcOffset()-this.utcOffset())*i,U=this-X,j=function(){return B.m(P,X)};switch(Y){case f:D=j()/12;break;case d:D=j();break;case u:D=j()/3;break;case h:D=(U-z)/6048e5;break;case c:D=(U-z)/864e5;break;case l:D=U/o;break;case n:D=U/i;break;case s:D=U/r;break;default:D=U}return q?D:B.a(D)},I.daysInMonth=function(){return this.endOf(d).$D},I.$locale=function(){return k[this.$L]},I.locale=function(F,R){if(!F)return this.$L;var q=this.clone(),D=v(F,R,!0);return D&&(q.$L=D),q},I.clone=function(){return B.w(this.$d,this)},I.toDate=function(){return new Date(this.valueOf())},I.toJSON=function(){return this.isValid()?this.toISOString():null},I.toISOString=function(){return this.$d.toISOString()},I.toString=function(){return this.$d.toUTCString()},$})(),O=E.prototype;return M.prototype=O,[["$ms",a],["$s",s],["$m",n],["$H",l],["$W",c],["$M",d],["$y",f],["$D",g]].forEach((function($){O[$[1]]=function(I){return this.$g(I,$[0],$[1])}})),M.extend=function($,I){return $.$i||($(I,E,M),$.$i=!0),M},M.locale=v,M.isDayjs=L,M.unix=function($){return M(1e3*$)},M.en=k[T],M.Ls=k,M.p={},M}))})(ol)),ol.exports}var l2=n2();const c2=dC(l2);var ko={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},Lt={trace:C((...e)=>{},"trace"),debug:C((...e)=>{},"debug"),info:C((...e)=>{},"info"),warn:C((...e)=>{},"warn"),error:C((...e)=>{},"error"),fatal:C((...e)=>{},"fatal")},_d=C(function(e="fatal"){let t=ko.fatal;typeof e=="string"?e.toLowerCase()in ko&&(t=ko[e]):typeof e=="number"&&(t=e),Lt.trace=()=>{},Lt.debug=()=>{},Lt.info=()=>{},Lt.warn=()=>{},Lt.error=()=>{},Lt.fatal=()=>{},t<=ko.fatal&&(Lt.fatal=console.error?console.error.bind(console,_i("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",_i("FATAL"))),t<=ko.error&&(Lt.error=console.error?console.error.bind(console,_i("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",_i("ERROR"))),t<=ko.warn&&(Lt.warn=console.warn?console.warn.bind(console,_i("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",_i("WARN"))),t<=ko.info&&(Lt.info=console.info?console.info.bind(console,_i("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",_i("INFO"))),t<=ko.debug&&(Lt.debug=console.debug?console.debug.bind(console,_i("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",_i("DEBUG"))),t<=ko.trace&&(Lt.trace=console.debug?console.debug.bind(console,_i("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",_i("TRACE")))},"setLogLevel"),_i=C(e=>`%c${c2().format("ss.SSS")} : ${e} : `,"format");const al={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),hsl2rgb:({h:e,s:t,l:r},i)=>{if(!t)return r*2.55;e/=360,t/=100,r/=100;const o=r<.5?r*(1+t):r+t-r*t,a=2*r-o;switch(i){case"r":return al.hue2rgb(a,o,e+1/3)*255;case"g":return al.hue2rgb(a,o,e)*255;case"b":return al.hue2rgb(a,o,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const o=Math.max(e,t,r),a=Math.min(e,t,r),s=(o+a)/2;if(i==="l")return s*100;if(o===a)return 0;const n=o-a,l=s>.5?n/(2-o-a):n/(o+a);if(i==="s")return l*100;switch(o){case e:return((t-r)/n+(t<r?6:0))*60;case t:return((r-e)/n+2)*60;case r:return((e-t)/n+4)*60;default:return-1}}},h2={clamp:(e,t,r)=>t>r?Math.min(t,Math.max(r,e)):Math.min(r,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},d2={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},ze={channel:al,lang:h2,unit:d2},Go={};for(let e=0;e<=255;e++)Go[e]=ze.unit.dec2hex(e);const ii={ALL:0,RGB:1,HSL:2};class u2{constructor(){this.type=ii.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=ii.ALL}is(t){return this.type===t}}class f2{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new u2}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=ii.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:o}=t;r===void 0&&(t.h=ze.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=ze.channel.rgb2hsl(t,"s")),o===void 0&&(t.l=ze.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:o}=t;r===void 0&&(t.r=ze.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=ze.channel.hsl2rgb(t,"g")),o===void 0&&(t.b=ze.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(ii.HSL)&&r!==void 0?r:(this._ensureHSL(),ze.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(ii.HSL)&&r!==void 0?r:(this._ensureHSL(),ze.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(ii.HSL)&&r!==void 0?r:(this._ensureHSL(),ze.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(ii.RGB)&&r!==void 0?r:(this._ensureRGB(),ze.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(ii.RGB)&&r!==void 0?r:(this._ensureRGB(),ze.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(ii.RGB)&&r!==void 0?r:(this._ensureRGB(),ze.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(ii.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(ii.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(ii.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(ii.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(ii.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(ii.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const Vl=new f2({r:0,g:0,b:0,a:0},"transparent"),ts={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(ts.re);if(!t)return;const r=t[1],i=parseInt(r,16),o=r.length,a=o%4===0,s=o>4,n=s?1:17,l=s?8:4,c=a?0:-1,h=s?255:15;return Vl.set({r:(i>>l*(c+3)&h)*n,g:(i>>l*(c+2)&h)*n,b:(i>>l*(c+1)&h)*n,a:a?(i&h)*n/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`#${Go[Math.round(t)]}${Go[Math.round(r)]}${Go[Math.round(i)]}${Go[Math.round(o*255)]}`:`#${Go[Math.round(t)]}${Go[Math.round(r)]}${Go[Math.round(i)]}`}},xa={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{const t=e.match(xa.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return ze.channel.clamp.h(parseFloat(r)*.9);case"rad":return ze.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return ze.channel.clamp.h(parseFloat(r)*360)}}return ze.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(xa.re);if(!r)return;const[,i,o,a,s,n]=r;return Vl.set({h:xa._hue2deg(i),s:ze.channel.clamp.s(parseFloat(o)),l:ze.channel.clamp.l(parseFloat(a)),a:s?ze.channel.clamp.a(n?parseFloat(s)/100:parseFloat(s)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:o}=e;return o<1?`hsla(${ze.lang.round(t)}, ${ze.lang.round(r)}%, ${ze.lang.round(i)}%, ${o})`:`hsl(${ze.lang.round(t)}, ${ze.lang.round(r)}%, ${ze.lang.round(i)}%)`}},on={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",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:"#ff00ff",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:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",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:"#ff0000",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",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:e=>{e=e.toLowerCase();const t=on.colors[e];if(t)return ts.parse(t)},stringify:e=>{const t=ts.stringify(e);for(const r in on.colors)if(on.colors[r]===t)return r}},Gs={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const t=e.charCodeAt(0);if(t!==114&&t!==82)return;const r=e.match(Gs.re);if(!r)return;const[,i,o,a,s,n,l,c,h]=r;return Vl.set({r:ze.channel.clamp.r(o?parseFloat(i)*2.55:parseFloat(i)),g:ze.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:ze.channel.clamp.b(l?parseFloat(n)*2.55:parseFloat(n)),a:c?ze.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`rgba(${ze.lang.round(t)}, ${ze.lang.round(r)}, ${ze.lang.round(i)}, ${ze.lang.round(o)})`:`rgb(${ze.lang.round(t)}, ${ze.lang.round(r)}, ${ze.lang.round(i)})`}},Ui={format:{keyword:on,hex:ts,rgb:Gs,rgba:Gs,hsl:xa,hsla:xa},parse:e=>{if(typeof e!="string")return e;const t=ts.parse(e)||Gs.parse(e)||xa.parse(e)||on.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(ii.HSL)||e.data.r===void 0?xa.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?Gs.stringify(e):ts.stringify(e)},Zp=(e,t)=>{const r=Ui.parse(e);for(const i in t)r[i]=ze.channel.clamp[i](t[i]);return Ui.stringify(r)},Qo=(e,t,r=0,i=1)=>{if(typeof e!="number")return Zp(e,{a:t});const o=Vl.set({r:ze.channel.clamp.r(e),g:ze.channel.clamp.g(t),b:ze.channel.clamp.b(r),a:ze.channel.clamp.a(i)});return Ui.stringify(o)},g2=(e,t)=>ze.lang.round(Ui.parse(e)[t]),p2=e=>{const{r:t,g:r,b:i}=Ui.parse(e),o=.2126*ze.channel.toLinear(t)+.7152*ze.channel.toLinear(r)+.0722*ze.channel.toLinear(i);return ze.lang.round(o)},m2=e=>p2(e)>=.5,bi=e=>!m2(e),Kp=(e,t,r)=>{const i=Ui.parse(e),o=i[t],a=ze.channel.clamp[t](o+r);return o!==a&&(i[t]=a),Ui.stringify(i)},pt=(e,t)=>Kp(e,"l",t),yt=(e,t)=>Kp(e,"l",-t),W=(e,t)=>{const r=Ui.parse(e),i={};for(const o in t)t[o]&&(i[o]=r[o]+t[o]);return Zp(e,i)},y2=(e,t,r=50)=>{const{r:i,g:o,b:a,a:s}=Ui.parse(e),{r:n,g:l,b:c,a:h}=Ui.parse(t),d=r/100,u=d*2-1,f=s-h,p=((u*f===-1?u:(u+f)/(1+u*f))+1)/2,m=1-p,y=i*p+n*m,x=o*p+l*m,b=a*p+c*m,S=s*d+h*(1-d);return Qo(y,x,b,S)},lt=(e,t=100)=>{const r=Ui.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,y2(r,e,t)};var an=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,yl=/\s/,x2=C(e=>{let t="",r=0,i=0;for(;i<e.length;){const o=e.indexOf("%%",i);if(o===-1)break;const a=e.indexOf(`
33
+ `:""}return C(ft,"dump2"),zc.dump=ft,zc}C(Up,"requireDumper");var wf;function Vp(){if(wf)return ei;wf=1;const e=Gp(),t=Up();function r(i,o){return function(){throw new Error("Function yaml."+i+" is removed in js-yaml 4. Use yaml."+o+" instead, which is now safe by default.")}}return C(r,"renamed"),ei.Type=si(),ei.Schema=dd(),ei.FAILSAFE_SCHEMA=pd(),ei.JSON_SCHEMA=Cd(),ei.CORE_SCHEMA=wd(),ei.DEFAULT_SCHEMA=Ul(),ei.load=e.load,ei.loadAll=e.loadAll,ei.dump=t.dump,ei.YAMLException=Bs(),ei.types={binary:vd(),float:bd(),map:gd(),null:md(),pairs:Td(),set:Bd(),timestamp:kd(),bool:yd(),int:xd(),merge:Sd(),omap:Md(),seq:fd(),str:ud()},ei.safeLoad=r("safeLoad","load"),ei.safeLoadAll=r("safeLoadAll","loadAll"),ei.safeDump=r("safeDump","dump"),ei}C(Vp,"requireJsYaml");var e2=Vp(),r2=Xp(e2),{Type:j4,Schema:G4,FAILSAFE_SCHEMA:U4,JSON_SCHEMA:i2,CORE_SCHEMA:V4,DEFAULT_SCHEMA:Z4,load:o2,loadAll:K4,dump:Q4,YAMLException:J4,types:tP,safeLoad:eP,safeLoadAll:rP,safeDump:iP}=r2,a2=C((e,t)=>{const{theme:r,themeVariables:i}=t,{useGradient:o,gradientStart:a,gradientStop:s}=i??{},n=e.attr("id"),l=r?.includes("dark")?"#FFFFFF":"#000000",c=C((d,u,f)=>e.append("defs").append("filter").attr("id",d).attr("height",u).attr("width",u).append("feDropShadow").attr("dx",f).attr("dy",f).attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",l),"dropShadow");if(c(`${n}-drop-shadow`,"130%","4"),c(`${n}-drop-shadow-small`,"150%","2"),!o)return;const h=e.append("linearGradient").attr("id",`${n}-gradient`).attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");h.append("svg:stop").attr("offset","0%").attr("stop-color",a).attr("stop-opacity",1),h.append("svg:stop").attr("offset","100%").attr("stop-color",s).attr("stop-opacity",1)},"insertLookDefs"),ol={exports:{}},s2=ol.exports,kf;function n2(){return kf||(kf=1,(function(e,t){(function(r,i){e.exports=i()})(s2,(function(){var r=1e3,i=6e4,o=36e5,a="millisecond",s="second",n="minute",l="hour",c="day",h="week",d="month",u="quarter",f="year",g="date",p="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,x={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function($){var I=["th","st","nd","rd"],F=$%100;return"["+$+(I[(F-20)%10]||I[F]||I[0])+"]"}},b=function($,I,F){var R=String($);return!R||R.length>=I?$:""+Array(I+1-R.length).join(F)+$},S={s:b,z:function($){var I=-$.utcOffset(),F=Math.abs(I),R=Math.floor(F/60),q=F%60;return(I<=0?"+":"-")+b(R,2,"0")+":"+b(q,2,"0")},m:function $(I,F){if(I.date()<F.date())return-$(F,I);var R=12*(F.year()-I.year())+(F.month()-I.month()),q=I.clone().add(R,d),D=F-q<0,P=I.clone().add(R+(D?-1:1),d);return+(-(R+(F-q)/(D?q-P:P-q))||0)},a:function($){return $<0?Math.ceil($)||0:Math.floor($)},p:function($){return{M:d,y:f,w:h,d:c,D:g,h:l,m:n,s,ms:a,Q:u}[$]||String($||"").toLowerCase().replace(/s$/,"")},u:function($){return $===void 0}},T="en",k={};k[T]=x;var _="$isDayjsObject",L=function($){return $ instanceof E||!(!$||!$[_])},v=function $(I,F,R){var q;if(!I)return T;if(typeof I=="string"){var D=I.toLowerCase();k[D]&&(q=D),F&&(k[D]=F,q=D);var P=I.split("-");if(!q&&P.length>1)return $(P[0])}else{var Y=I.name;k[Y]=I,q=Y}return!R&&q&&(T=q),q||!R&&T},M=function($,I){if(L($))return $.clone();var F=typeof I=="object"?I:{};return F.date=$,F.args=arguments,new E(F)},B=S;B.l=v,B.i=L,B.w=function($,I){return M($,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var E=(function(){function $(F){this.$L=v(F.locale,null,!0),this.parse(F),this.$x=this.$x||F.x||{},this[_]=!0}var I=$.prototype;return I.parse=function(F){this.$d=(function(R){var q=R.date,D=R.utc;if(q===null)return new Date(NaN);if(B.u(q))return new Date;if(q instanceof Date)return new Date(q);if(typeof q=="string"&&!/Z$/i.test(q)){var P=q.match(m);if(P){var Y=P[2]-1||0,X=(P[7]||"0").substring(0,3);return D?new Date(Date.UTC(P[1],Y,P[3]||1,P[4]||0,P[5]||0,P[6]||0,X)):new Date(P[1],Y,P[3]||1,P[4]||0,P[5]||0,P[6]||0,X)}}return new Date(q)})(F),this.init()},I.init=function(){var F=this.$d;this.$y=F.getFullYear(),this.$M=F.getMonth(),this.$D=F.getDate(),this.$W=F.getDay(),this.$H=F.getHours(),this.$m=F.getMinutes(),this.$s=F.getSeconds(),this.$ms=F.getMilliseconds()},I.$utils=function(){return B},I.isValid=function(){return this.$d.toString()!==p},I.isSame=function(F,R){var q=M(F);return this.startOf(R)<=q&&q<=this.endOf(R)},I.isAfter=function(F,R){return M(F)<this.startOf(R)},I.isBefore=function(F,R){return this.endOf(R)<M(F)},I.$g=function(F,R,q){return B.u(F)?this[R]:this.set(q,F)},I.unix=function(){return Math.floor(this.valueOf()/1e3)},I.valueOf=function(){return this.$d.getTime()},I.startOf=function(F,R){var q=this,D=!!B.u(R)||R,P=B.p(F),Y=function(ht,H){var G=B.w(q.$u?Date.UTC(q.$y,H,ht):new Date(q.$y,H,ht),q);return D?G:G.endOf(c)},X=function(ht,H){return B.w(q.toDate()[ht].apply(q.toDate("s"),(D?[0,0,0,0]:[23,59,59,999]).slice(H)),q)},z=this.$W,U=this.$M,j=this.$D,V="set"+(this.$u?"UTC":"");switch(P){case f:return D?Y(1,0):Y(31,11);case d:return D?Y(1,U):Y(0,U+1);case h:var Q=this.$locale().weekStart||0,rt=(z<Q?z+7:z)-Q;return Y(D?j-rt:j+(6-rt),U);case c:case g:return X(V+"Hours",0);case l:return X(V+"Minutes",1);case n:return X(V+"Seconds",2);case s:return X(V+"Milliseconds",3);default:return this.clone()}},I.endOf=function(F){return this.startOf(F,!1)},I.$set=function(F,R){var q,D=B.p(F),P="set"+(this.$u?"UTC":""),Y=(q={},q[c]=P+"Date",q[g]=P+"Date",q[d]=P+"Month",q[f]=P+"FullYear",q[l]=P+"Hours",q[n]=P+"Minutes",q[s]=P+"Seconds",q[a]=P+"Milliseconds",q)[D],X=D===c?this.$D+(R-this.$W):R;if(D===d||D===f){var z=this.clone().set(g,1);z.$d[Y](X),z.init(),this.$d=z.set(g,Math.min(this.$D,z.daysInMonth())).$d}else Y&&this.$d[Y](X);return this.init(),this},I.set=function(F,R){return this.clone().$set(F,R)},I.get=function(F){return this[B.p(F)]()},I.add=function(F,R){var q,D=this;F=Number(F);var P=B.p(R),Y=function(U){var j=M(D);return B.w(j.date(j.date()+Math.round(U*F)),D)};if(P===d)return this.set(d,this.$M+F);if(P===f)return this.set(f,this.$y+F);if(P===c)return Y(1);if(P===h)return Y(7);var X=(q={},q[n]=i,q[l]=o,q[s]=r,q)[P]||1,z=this.$d.getTime()+F*X;return B.w(z,this)},I.subtract=function(F,R){return this.add(-1*F,R)},I.format=function(F){var R=this,q=this.$locale();if(!this.isValid())return q.invalidDate||p;var D=F||"YYYY-MM-DDTHH:mm:ssZ",P=B.z(this),Y=this.$H,X=this.$m,z=this.$M,U=q.weekdays,j=q.months,V=q.meridiem,Q=function(H,G,K,tt){return H&&(H[G]||H(R,D))||K[G].slice(0,tt)},rt=function(H){return B.s(Y%12||12,H,"0")},ht=V||function(H,G,K){var tt=H<12?"AM":"PM";return K?tt.toLowerCase():tt};return D.replace(y,(function(H,G){return G||(function(K){switch(K){case"YY":return String(R.$y).slice(-2);case"YYYY":return B.s(R.$y,4,"0");case"M":return z+1;case"MM":return B.s(z+1,2,"0");case"MMM":return Q(q.monthsShort,z,j,3);case"MMMM":return Q(j,z);case"D":return R.$D;case"DD":return B.s(R.$D,2,"0");case"d":return String(R.$W);case"dd":return Q(q.weekdaysMin,R.$W,U,2);case"ddd":return Q(q.weekdaysShort,R.$W,U,3);case"dddd":return U[R.$W];case"H":return String(Y);case"HH":return B.s(Y,2,"0");case"h":return rt(1);case"hh":return rt(2);case"a":return ht(Y,X,!0);case"A":return ht(Y,X,!1);case"m":return String(X);case"mm":return B.s(X,2,"0");case"s":return String(R.$s);case"ss":return B.s(R.$s,2,"0");case"SSS":return B.s(R.$ms,3,"0");case"Z":return P}return null})(H)||P.replace(":","")}))},I.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},I.diff=function(F,R,q){var D,P=this,Y=B.p(R),X=M(F),z=(X.utcOffset()-this.utcOffset())*i,U=this-X,j=function(){return B.m(P,X)};switch(Y){case f:D=j()/12;break;case d:D=j();break;case u:D=j()/3;break;case h:D=(U-z)/6048e5;break;case c:D=(U-z)/864e5;break;case l:D=U/o;break;case n:D=U/i;break;case s:D=U/r;break;default:D=U}return q?D:B.a(D)},I.daysInMonth=function(){return this.endOf(d).$D},I.$locale=function(){return k[this.$L]},I.locale=function(F,R){if(!F)return this.$L;var q=this.clone(),D=v(F,R,!0);return D&&(q.$L=D),q},I.clone=function(){return B.w(this.$d,this)},I.toDate=function(){return new Date(this.valueOf())},I.toJSON=function(){return this.isValid()?this.toISOString():null},I.toISOString=function(){return this.$d.toISOString()},I.toString=function(){return this.$d.toUTCString()},$})(),O=E.prototype;return M.prototype=O,[["$ms",a],["$s",s],["$m",n],["$H",l],["$W",c],["$M",d],["$y",f],["$D",g]].forEach((function($){O[$[1]]=function(I){return this.$g(I,$[0],$[1])}})),M.extend=function($,I){return $.$i||($(I,E,M),$.$i=!0),M},M.locale=v,M.isDayjs=L,M.unix=function($){return M(1e3*$)},M.en=k[T],M.Ls=k,M.p={},M}))})(ol)),ol.exports}var l2=n2();const c2=dC(l2);var ko={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},Lt={trace:C((...e)=>{},"trace"),debug:C((...e)=>{},"debug"),info:C((...e)=>{},"info"),warn:C((...e)=>{},"warn"),error:C((...e)=>{},"error"),fatal:C((...e)=>{},"fatal")},_d=C(function(e="fatal"){let t=ko.fatal;typeof e=="string"?e.toLowerCase()in ko&&(t=ko[e]):typeof e=="number"&&(t=e),Lt.trace=()=>{},Lt.debug=()=>{},Lt.info=()=>{},Lt.warn=()=>{},Lt.error=()=>{},Lt.fatal=()=>{},t<=ko.fatal&&(Lt.fatal=console.error?console.error.bind(console,_i("FATAL"),"color: orange"):console.log.bind(console,"\x1B[35m",_i("FATAL"))),t<=ko.error&&(Lt.error=console.error?console.error.bind(console,_i("ERROR"),"color: orange"):console.log.bind(console,"\x1B[31m",_i("ERROR"))),t<=ko.warn&&(Lt.warn=console.warn?console.warn.bind(console,_i("WARN"),"color: orange"):console.log.bind(console,"\x1B[33m",_i("WARN"))),t<=ko.info&&(Lt.info=console.info?console.info.bind(console,_i("INFO"),"color: lightblue"):console.log.bind(console,"\x1B[34m",_i("INFO"))),t<=ko.debug&&(Lt.debug=console.debug?console.debug.bind(console,_i("DEBUG"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",_i("DEBUG"))),t<=ko.trace&&(Lt.trace=console.debug?console.debug.bind(console,_i("TRACE"),"color: lightgreen"):console.log.bind(console,"\x1B[32m",_i("TRACE")))},"setLogLevel"),_i=C(e=>`%c${c2().format("ss.SSS")} : ${e} : `,"format");const al={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:e=>e>=255?255:e<0?0:e,g:e=>e>=255?255:e<0?0:e,b:e=>e>=255?255:e<0?0:e,h:e=>e%360,s:e=>e>=100?100:e<0?0:e,l:e=>e>=100?100:e<0?0:e,a:e=>e>=1?1:e<0?0:e},toLinear:e=>{const t=e/255;return e>.03928?Math.pow((t+.055)/1.055,2.4):t/12.92},hue2rgb:(e,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e),hsl2rgb:({h:e,s:t,l:r},i)=>{if(!t)return r*2.55;e/=360,t/=100,r/=100;const o=r<.5?r*(1+t):r+t-r*t,a=2*r-o;switch(i){case"r":return al.hue2rgb(a,o,e+1/3)*255;case"g":return al.hue2rgb(a,o,e)*255;case"b":return al.hue2rgb(a,o,e-1/3)*255}},rgb2hsl:({r:e,g:t,b:r},i)=>{e/=255,t/=255,r/=255;const o=Math.max(e,t,r),a=Math.min(e,t,r),s=(o+a)/2;if(i==="l")return s*100;if(o===a)return 0;const n=o-a,l=s>.5?n/(2-o-a):n/(o+a);if(i==="s")return l*100;switch(o){case e:return((t-r)/n+(t<r?6:0))*60;case t:return((r-e)/n+2)*60;case r:return((e-t)/n+4)*60;default:return-1}}},h2={clamp:(e,t,r)=>t>r?Math.min(t,Math.max(r,e)):Math.min(r,Math.max(t,e)),round:e=>Math.round(e*1e10)/1e10},d2={dec2hex:e=>{const t=Math.round(e).toString(16);return t.length>1?t:`0${t}`}},ze={channel:al,lang:h2,unit:d2},Go={};for(let e=0;e<=255;e++)Go[e]=ze.unit.dec2hex(e);const ii={ALL:0,RGB:1,HSL:2};class u2{constructor(){this.type=ii.ALL}get(){return this.type}set(t){if(this.type&&this.type!==t)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=t}reset(){this.type=ii.ALL}is(t){return this.type===t}}class f2{constructor(t,r){this.color=r,this.changed=!1,this.data=t,this.type=new u2}set(t,r){return this.color=r,this.changed=!1,this.data=t,this.type.type=ii.ALL,this}_ensureHSL(){const t=this.data,{h:r,s:i,l:o}=t;r===void 0&&(t.h=ze.channel.rgb2hsl(t,"h")),i===void 0&&(t.s=ze.channel.rgb2hsl(t,"s")),o===void 0&&(t.l=ze.channel.rgb2hsl(t,"l"))}_ensureRGB(){const t=this.data,{r,g:i,b:o}=t;r===void 0&&(t.r=ze.channel.hsl2rgb(t,"r")),i===void 0&&(t.g=ze.channel.hsl2rgb(t,"g")),o===void 0&&(t.b=ze.channel.hsl2rgb(t,"b"))}get r(){const t=this.data,r=t.r;return!this.type.is(ii.HSL)&&r!==void 0?r:(this._ensureHSL(),ze.channel.hsl2rgb(t,"r"))}get g(){const t=this.data,r=t.g;return!this.type.is(ii.HSL)&&r!==void 0?r:(this._ensureHSL(),ze.channel.hsl2rgb(t,"g"))}get b(){const t=this.data,r=t.b;return!this.type.is(ii.HSL)&&r!==void 0?r:(this._ensureHSL(),ze.channel.hsl2rgb(t,"b"))}get h(){const t=this.data,r=t.h;return!this.type.is(ii.RGB)&&r!==void 0?r:(this._ensureRGB(),ze.channel.rgb2hsl(t,"h"))}get s(){const t=this.data,r=t.s;return!this.type.is(ii.RGB)&&r!==void 0?r:(this._ensureRGB(),ze.channel.rgb2hsl(t,"s"))}get l(){const t=this.data,r=t.l;return!this.type.is(ii.RGB)&&r!==void 0?r:(this._ensureRGB(),ze.channel.rgb2hsl(t,"l"))}get a(){return this.data.a}set r(t){this.type.set(ii.RGB),this.changed=!0,this.data.r=t}set g(t){this.type.set(ii.RGB),this.changed=!0,this.data.g=t}set b(t){this.type.set(ii.RGB),this.changed=!0,this.data.b=t}set h(t){this.type.set(ii.HSL),this.changed=!0,this.data.h=t}set s(t){this.type.set(ii.HSL),this.changed=!0,this.data.s=t}set l(t){this.type.set(ii.HSL),this.changed=!0,this.data.l=t}set a(t){this.changed=!0,this.data.a=t}}const Vl=new f2({r:0,g:0,b:0,a:0},"transparent"),ts={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:e=>{if(e.charCodeAt(0)!==35)return;const t=e.match(ts.re);if(!t)return;const r=t[1],i=parseInt(r,16),o=r.length,a=o%4===0,s=o>4,n=s?1:17,l=s?8:4,c=a?0:-1,h=s?255:15;return Vl.set({r:(i>>l*(c+3)&h)*n,g:(i>>l*(c+2)&h)*n,b:(i>>l*(c+1)&h)*n,a:a?(i&h)*n/255:1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`#${Go[Math.round(t)]}${Go[Math.round(r)]}${Go[Math.round(i)]}${Go[Math.round(o*255)]}`:`#${Go[Math.round(t)]}${Go[Math.round(r)]}${Go[Math.round(i)]}`}},xa={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:e=>{const t=e.match(xa.hueRe);if(t){const[,r,i]=t;switch(i){case"grad":return ze.channel.clamp.h(parseFloat(r)*.9);case"rad":return ze.channel.clamp.h(parseFloat(r)*180/Math.PI);case"turn":return ze.channel.clamp.h(parseFloat(r)*360)}}return ze.channel.clamp.h(parseFloat(e))},parse:e=>{const t=e.charCodeAt(0);if(t!==104&&t!==72)return;const r=e.match(xa.re);if(!r)return;const[,i,o,a,s,n]=r;return Vl.set({h:xa._hue2deg(i),s:ze.channel.clamp.s(parseFloat(o)),l:ze.channel.clamp.l(parseFloat(a)),a:s?ze.channel.clamp.a(n?parseFloat(s)/100:parseFloat(s)):1},e)},stringify:e=>{const{h:t,s:r,l:i,a:o}=e;return o<1?`hsla(${ze.lang.round(t)}, ${ze.lang.round(r)}%, ${ze.lang.round(i)}%, ${o})`:`hsl(${ze.lang.round(t)}, ${ze.lang.round(r)}%, ${ze.lang.round(i)}%)`}},on={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",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:"#ff00ff",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:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",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:"#ff0000",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",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:e=>{e=e.toLowerCase();const t=on.colors[e];if(t)return ts.parse(t)},stringify:e=>{const t=ts.stringify(e);for(const r in on.colors)if(on.colors[r]===t)return r}},Gs={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:e=>{const t=e.charCodeAt(0);if(t!==114&&t!==82)return;const r=e.match(Gs.re);if(!r)return;const[,i,o,a,s,n,l,c,h]=r;return Vl.set({r:ze.channel.clamp.r(o?parseFloat(i)*2.55:parseFloat(i)),g:ze.channel.clamp.g(s?parseFloat(a)*2.55:parseFloat(a)),b:ze.channel.clamp.b(l?parseFloat(n)*2.55:parseFloat(n)),a:c?ze.channel.clamp.a(h?parseFloat(c)/100:parseFloat(c)):1},e)},stringify:e=>{const{r:t,g:r,b:i,a:o}=e;return o<1?`rgba(${ze.lang.round(t)}, ${ze.lang.round(r)}, ${ze.lang.round(i)}, ${ze.lang.round(o)})`:`rgb(${ze.lang.round(t)}, ${ze.lang.round(r)}, ${ze.lang.round(i)})`}},Ui={format:{keyword:on,hex:ts,rgb:Gs,rgba:Gs,hsl:xa,hsla:xa},parse:e=>{if(typeof e!="string")return e;const t=ts.parse(e)||Gs.parse(e)||xa.parse(e)||on.parse(e);if(t)return t;throw new Error(`Unsupported color format: "${e}"`)},stringify:e=>!e.changed&&e.color?e.color:e.type.is(ii.HSL)||e.data.r===void 0?xa.stringify(e):e.a<1||!Number.isInteger(e.r)||!Number.isInteger(e.g)||!Number.isInteger(e.b)?Gs.stringify(e):ts.stringify(e)},Zp=(e,t)=>{const r=Ui.parse(e);for(const i in t)r[i]=ze.channel.clamp[i](t[i]);return Ui.stringify(r)},Qo=(e,t,r=0,i=1)=>{if(typeof e!="number")return Zp(e,{a:t});const o=Vl.set({r:ze.channel.clamp.r(e),g:ze.channel.clamp.g(t),b:ze.channel.clamp.b(r),a:ze.channel.clamp.a(i)});return Ui.stringify(o)},g2=(e,t)=>ze.lang.round(Ui.parse(e)[t]),p2=e=>{const{r:t,g:r,b:i}=Ui.parse(e),o=.2126*ze.channel.toLinear(t)+.7152*ze.channel.toLinear(r)+.0722*ze.channel.toLinear(i);return ze.lang.round(o)},m2=e=>p2(e)>=.5,bi=e=>!m2(e),Kp=(e,t,r)=>{const i=Ui.parse(e),o=i[t],a=ze.channel.clamp[t](o+r);return o!==a&&(i[t]=a),Ui.stringify(i)},pt=(e,t)=>Kp(e,"l",t),yt=(e,t)=>Kp(e,"l",-t),W=(e,t)=>{const r=Ui.parse(e),i={};for(const o in t)t[o]&&(i[o]=r[o]+t[o]);return Zp(e,i)},y2=(e,t,r=50)=>{const{r:i,g:o,b:a,a:s}=Ui.parse(e),{r:n,g:l,b:c,a:h}=Ui.parse(t),d=r/100,u=d*2-1,f=s-h,p=((u*f===-1?u:(u+f)/(1+u*f))+1)/2,m=1-p,y=i*p+n*m,x=o*p+l*m,b=a*p+c*m,S=s*d+h*(1-d);return Qo(y,x,b,S)},lt=(e,t=100)=>{const r=Ui.parse(e);return r.r=255-r.r,r.g=255-r.g,r.b=255-r.b,y2(r,e,t)};var an=/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,yl=/\s/,x2=C(e=>{let t="",r=0,i=0;for(;i<e.length;){const o=e.indexOf("%%",i);if(o===-1)break;const a=e.indexOf(`
34
34
  `,o);if(a===-1)break;let s=o;for(;s>r&&yl.test(e[s-1]);)s--;t+=e.slice(r,s)+`
35
35
  `,r=a+1,i=r}return t+e.slice(r)},"stripAnyComments"),sl=C(e=>e===`
36
- `||e==="\r","isLineBreak"),b2=C((e,t)=>{let r=-1;for(let i=t;i<e.length&&yl.test(e[i]);i++)sl(e[i])&&(r=i);return r},"lastLineBreakInWhitespaceRun"),Qp=C(e=>{let t=0;for(;t<e.length&&yl.test(e[t])&&!sl(e[t]);)t++;const r=e.slice(0,t);if(!e.startsWith("---",t))return;const i=[];for(let h=t+3;h<e.length&&yl.test(e[h]);h++)sl(e[h])&&i.push(h);if(i.length===0)return;const o=`${r}---`,a=C(h=>sl(e[h])&&e.startsWith(o,h+1)?b2(e,h+1+o.length):-1,"closingEnd"),s=i[0]+1;let n=-1;for(let h=s;h<e.length;h++)a(h)!==-1&&(n=h);if(n===-1)return;let l=i[0];for(const h of i)h<n&&(l=h);const c=l+1;for(let h=c;h<=n;h++){const d=a(h);if(d!==-1)return{indent:r,body:e.slice(c,h),length:d+1}}},"matchFrontMatter"),os,Jp=(os=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},C(os,"UnknownDiagramError"),os),Ta={},Zl=C(function(e,t){const r=Qp(e);e=x2((r?e.slice(r.length):e).replace(an,""));for(const[i,{detector:o}]of Object.entries(Ta))if(o(e,t))return i;throw new Jp(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),Bh=C((...e)=>{for(const{id:t,detector:r,loader:i}of e)tm(t,r,i)},"registerLazyLoadedDiagrams"),tm=C((e,t,r)=>{Ta[e]&&Lt.warn(`Detector with key ${e} already exists. Overwriting.`),Ta[e]={detector:t,loader:r},Lt.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),C2=C(e=>Ta[e].loader,"getDiagramLoader"),_h=C((e,t,{depth:r=2}={})=>{const i={depth:r};if(Array.isArray(t)&&!Array.isArray(e))return t.forEach(o=>_h(e,o,i)),e;if(Array.isArray(t)&&Array.isArray(e))return t.forEach(o=>{e.includes(o)||e.push(o)}),e;if(e==null||r<=0)return e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t;if(t!=null&&typeof e=="object"&&typeof t=="object"){const o=e;Object.entries(t).forEach(([a,s])=>{if(typeof s=="object"){if(s===null)return;Object.hasOwn(e,a)||Object.defineProperty(e,a,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),o[a]===void 0&&(o[a]=Array.isArray(s)?[]:{}),typeof o[a]=="object"&&(o[a]=_h(o[a],s,{depth:r-1}))}else typeof o[a]!="object"&&(Object.hasOwn(e,a)?o[a]=s:Object.defineProperty(e,a,{value:s,writable:!0,enumerable:!0,configurable:!0}))})}return e},"assignWithDepth"),Wr=_h,go="#ffffff",po="#f2f2f2",Ne=C((e,t)=>t?W(e,{s:-40,l:10}):W(e,{s:-40,l:-10}),"mkBorder"),Sf=C(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isPlainObject"),Vi=C((e,t)=>Sf(e)&&Sf(t)?{...e,...t}:t,"applyOverride"),as,w2=(as=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||W(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||W(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Ne(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Ne(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Ne(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||yt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||pt(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||yt(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||yt(this.mainBkg,10)):(this.rowOdd=this.rowOdd||pt(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||pt(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||W(this.primaryColor,{h:30}),this.cScale4=this.cScale4||W(this.primaryColor,{h:60}),this.cScale5=this.cScale5||W(this.primaryColor,{h:90}),this.cScale6=this.cScale6||W(this.primaryColor,{h:120}),this.cScale7=this.cScale7||W(this.primaryColor,{h:150}),this.cScale8=this.cScale8||W(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||W(this.primaryColor,{h:270}),this.cScale10=this.cScale10||W(this.primaryColor,{h:300}),this.cScale11=this.cScale11||W(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=yt(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=yt(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||lt(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||pt(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||yt(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||W(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||W(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||W(this.primaryColor,{h:64}),this.fillType3=this.fillType3||W(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||W(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||W(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||W(this.primaryColor,{h:128}),this.fillType7=this.fillType7||W(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||W(this.primaryColor,{l:-10}),this.pie5=this.pie5||W(this.secondaryColor,{l:-10}),this.pie6=this.pie6||W(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||W(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||W(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||W(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||W(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||W(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||W(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??W(this.primaryColor,{l:-30}),this.venn2=this.venn2??W(this.secondaryColor,{l:-30}),this.venn3=this.venn3??W(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??W(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??W(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??W(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??W(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??W(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.archEdgeColor=this.archEdgeColor||"#777",this.archEdgeArrowColor=this.archEdgeArrowColor||"#777",this.archEdgeWidth=this.archEdgeWidth||"3",this.archGroupBorderColor=this.archGroupBorderColor||"#000",this.archGroupBorderWidth=this.archGroupBorderWidth||"2px",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||W(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||W(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||W(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||W(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||W(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||W(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||bi(this.quadrant1Fill)?pt(this.quadrant1Fill):yt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||W(this.primaryColor,{h:-30}),this.git4=this.git4||W(this.primaryColor,{h:-60}),this.git5=this.git5||W(this.primaryColor,{h:-90}),this.git6=this.git6||W(this.primaryColor,{h:60}),this.git7=this.git7||W(this.primaryColor,{h:120}),this.darkMode?(this.git0=pt(this.git0,25),this.git1=pt(this.git1,25),this.git2=pt(this.git2,25),this.git3=pt(this.git3,25),this.git4=pt(this.git4,25),this.git5=pt(this.git5,25),this.git6=pt(this.git6,25),this.git7=pt(this.git7,25)):(this.git0=yt(this.git0,25),this.git1=yt(this.git1,25),this.git2=yt(this.git2,25),this.git3=yt(this.git3,25),this.git4=yt(this.git4,25),this.git5=yt(this.git5,25),this.git6=yt(this.git6,25),this.git7=yt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||go,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||po,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Vi(this[i],t[i])}),Object.hasOwn(t,"nodeBorder")&&!Object.hasOwn(t,"useGradient")&&(this.useGradient=!1)}},C(as,"Theme"),as),k2=C(e=>{const t=new w2;return t.calculate(e),t},"getThemeVariables"),ss,S2=(ss=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=pt(this.primaryColor,16),this.tertiaryColor=W(this.primaryColor,{h:-160}),this.primaryBorderColor=lt(this.background),this.secondaryBorderColor=Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ne(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.tertiaryColor),this.lineColor=lt(this.background),this.textColor=lt(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=pt(lt("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Qo(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=yt("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=yt(this.sectionBkgColor,10),this.taskBorderColor=Qo(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Qo(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||pt(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||yt(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){this.secondBkg=pt(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=pt(this.labelBackground,25),this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=pt(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=lt(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=W(this.primaryColor,{h:64}),this.fillType3=W(this.secondaryColor,{h:64}),this.fillType4=W(this.primaryColor,{h:-64}),this.fillType5=W(this.secondaryColor,{h:-64}),this.fillType6=W(this.primaryColor,{h:128}),this.fillType7=W(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||W(this.primaryColor,{h:30}),this.cScale4=this.cScale4||W(this.primaryColor,{h:60}),this.cScale5=this.cScale5||W(this.primaryColor,{h:90}),this.cScale6=this.cScale6||W(this.primaryColor,{h:120}),this.cScale7=this.cScale7||W(this.primaryColor,{h:150}),this.cScale8=this.cScale8||W(this.primaryColor,{h:210}),this.cScale9=this.cScale9||W(this.primaryColor,{h:270}),this.cScale10=this.cScale10||W(this.primaryColor,{h:300}),this.cScale11=this.cScale11||W(this.primaryColor,{h:330});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||lt(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScalePeer"+t]=this["cScalePeer"+t]||pt(this["cScale"+t],10);for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||W(this.mainBkg,{h:30,s:-30,l:-(-10+t*4)}),this["surfacePeer"+t]=this["surfacePeer"+t]||W(this.mainBkg,{h:30,s:-30,l:-(-7+t*4)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.mainContrastColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.mainContrastColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let t=0;t<8;t++)this["venn"+(t+1)]=this["venn"+(t+1)]??pt(this["cScale"+t],30);this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#FF6B6B",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#1B5E20",complicatedBg:this.cynefin?.complicatedBg||"#0D47A1",chaoticBg:this.cynefin?.chaoticBg||"#BF360C",clearBg:this.cynefin?.clearBg||"#F57F17",confusionBg:this.cynefin?.confusionBg||"#4A148C",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||W(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||W(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||W(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||W(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||W(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||W(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||bi(this.quadrant1Fill)?pt(this.quadrant1Fill):yt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"},this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.background},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#ff6b6b",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.mainBkg,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.mainBkg},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=pt(this.secondaryColor,20),this.git1=pt(this.pie2||this.secondaryColor,20),this.git2=pt(this.pie3||this.tertiaryColor,20),this.git3=pt(this.pie4||W(this.primaryColor,{h:-30}),20),this.git4=pt(this.pie5||W(this.primaryColor,{h:-60}),20),this.git5=pt(this.pie6||W(this.primaryColor,{h:-90}),10),this.git6=pt(this.pie7||W(this.primaryColor,{h:60}),10),this.git7=pt(this.pie8||W(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||lt(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||lt(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"#2d2d2d",this.emUiStroke=this.emUiStroke||"#555",this.emProcessorFill=this.emProcessorFill||pt("#5a3d5c",10),this.emProcessorStroke=this.emProcessorStroke||"#8a6d8c",this.emReadModelFill=this.emReadModelFill||pt("#3d5a2d",10),this.emReadModelStroke=this.emReadModelStroke||"#6d8c5c",this.emCommandFill=this.emCommandFill||pt("#2d3d5a",10),this.emCommandStroke=this.emCommandStroke||"#5c6d8c",this.emEventFill=this.emEventFill||pt("#5a452d",10),this.emEventStroke=this.emEventStroke||"#8c755c",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||pt(this.background,5),this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||pt(this.background,12),this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||pt(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||pt(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Vi(this[i],t[i])})}},C(ss,"Theme"),ss),v2=C(e=>{const t=new S2;return t.calculate(e),t},"getThemeVariables"),ns,M2=(ns=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=W(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=W(this.primaryColor,{h:-160}),this.primaryBorderColor=Ne(this.primaryColor,this.darkMode),this.secondaryBorderColor=Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ne(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.tertiaryColor),this.lineColor=lt(this.background),this.textColor=lt(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=Ne(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=Qo(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||W(this.primaryColor,{h:30}),this.cScale4=this.cScale4||W(this.primaryColor,{h:60}),this.cScale5=this.cScale5||W(this.primaryColor,{h:90}),this.cScale6=this.cScale6||W(this.primaryColor,{h:120}),this.cScale7=this.cScale7||W(this.primaryColor,{h:150}),this.cScale8=this.cScale8||W(this.primaryColor,{h:210}),this.cScale9=this.cScale9||W(this.primaryColor,{h:270}),this.cScale10=this.cScale10||W(this.primaryColor,{h:300}),this.cScale11=this.cScale11||W(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||yt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||yt(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=yt(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||yt(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||W(this["cScale"+t],{h:180});for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||W(this.mainBkg,{h:30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||W(this.mainBkg,{h:30,l:-(7+t*5)});if(this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!=="calculated"){this.cScaleLabel0=this.cScaleLabel0||lt(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||lt(this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||pt(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||pt(this.primaryColor,1),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=W(this.primaryColor,{h:64}),this.fillType3=W(this.secondaryColor,{h:64}),this.fillType4=W(this.primaryColor,{h:-64}),this.fillType5=W(this.secondaryColor,{h:-64}),this.fillType6=W(this.primaryColor,{h:128}),this.fillType7=W(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||W(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||W(this.primaryColor,{l:-10}),this.pie5=this.pie5||W(this.secondaryColor,{l:-30}),this.pie6=this.pie6||W(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||W(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||W(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||W(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||W(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||W(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||W(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??W(this.primaryColor,{l:-30}),this.venn2=this.venn2??W(this.secondaryColor,{l:-30}),this.venn3=this.venn3??W(this.tertiaryColor,{l:-40}),this.venn4=this.venn4??W(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??W(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??W(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??W(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??W(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||W(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||W(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||W(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||W(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||W(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||W(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||bi(this.quadrant1Fill)?pt(this.quadrant1Fill):yt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||W(this.primaryColor,{h:-30}),this.git4=this.git4||W(this.primaryColor,{h:-60}),this.git5=this.git5||W(this.primaryColor,{h:-90}),this.git6=this.git6||W(this.primaryColor,{h:60}),this.git7=this.git7||W(this.primaryColor,{h:120}),this.darkMode?(this.git0=pt(this.git0,25),this.git1=pt(this.git1,25),this.git2=pt(this.git2,25),this.git3=pt(this.git3,25),this.git4=pt(this.git4,25),this.git5=pt(this.git5,25),this.git6=pt(this.git6,25),this.git7=pt(this.git7,25)):(this.git0=yt(this.git0,25),this.git1=yt(this.git1,25),this.git2=yt(this.git2,25),this.git3=yt(this.git3,25),this.git4=yt(this.git4,25),this.git5=yt(this.git5,25),this.git6=yt(this.git6,25),this.git7=yt(this.git7,25)),this.gitInv0=this.gitInv0||yt(lt(this.git0),25),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||lt(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||lt(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||go,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||po}calculate(t){if(Object.keys(this).forEach(i=>{this[i]==="calculated"&&(this[i]=void 0)}),typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Vi(this[i],t[i])})}},C(ns,"Theme"),ns),T2=C(e=>{const t=new M2;return t.calculate(e),t},"getThemeVariables"),ls,B2=(ls=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=pt("#cde498",10),this.primaryBorderColor=Ne(this.primaryColor,this.darkMode),this.secondaryBorderColor=Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ne(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.primaryColor),this.lineColor=lt(this.background),this.textColor=lt(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){this.actorBorder=yt(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||W(this.primaryColor,{h:30}),this.cScale4=this.cScale4||W(this.primaryColor,{h:60}),this.cScale5=this.cScale5||W(this.primaryColor,{h:90}),this.cScale6=this.cScale6||W(this.primaryColor,{h:120}),this.cScale7=this.cScale7||W(this.primaryColor,{h:150}),this.cScale8=this.cScale8||W(this.primaryColor,{h:210}),this.cScale9=this.cScale9||W(this.primaryColor,{h:270}),this.cScale10=this.cScale10||W(this.primaryColor,{h:300}),this.cScale11=this.cScale11||W(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||yt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||yt(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=yt(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||yt(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||W(this["cScale"+t],{h:180});this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||W(this.mainBkg,{h:30,s:-30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||W(this.mainBkg,{h:30,s:-30,l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||pt(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||pt(this.mainBkg,20),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=W(this.primaryColor,{h:64}),this.fillType3=W(this.secondaryColor,{h:64}),this.fillType4=W(this.primaryColor,{h:-64}),this.fillType5=W(this.secondaryColor,{h:-64}),this.fillType6=W(this.primaryColor,{h:128}),this.fillType7=W(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||W(this.primaryColor,{l:-30}),this.pie5=this.pie5||W(this.secondaryColor,{l:-30}),this.pie6=this.pie6||W(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||W(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||W(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||W(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||W(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||W(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||W(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??W(this.primaryColor,{l:-30}),this.venn2=this.venn2??W(this.secondaryColor,{l:-30}),this.venn3=this.venn3??W(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??W(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??W(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??W(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??W(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??W(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B4513",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#C8E6C9",complicatedBg:this.cynefin?.complicatedBg||"#DCEDC8",chaoticBg:this.cynefin?.chaoticBg||"#FFE0B2",clearBg:this.cynefin?.clearBg||"#FFF9C4",confusionBg:this.cynefin?.confusionBg||"#D7CCC8",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||W(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||W(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||W(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||W(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||W(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||W(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||bi(this.quadrant1Fill)?pt(this.quadrant1Fill):yt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.mainBkg},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||W(this.primaryColor,{h:-30}),this.git4=this.git4||W(this.primaryColor,{h:-60}),this.git5=this.git5||W(this.primaryColor,{h:-90}),this.git6=this.git6||W(this.primaryColor,{h:60}),this.git7=this.git7||W(this.primaryColor,{h:120}),this.darkMode?(this.git0=pt(this.git0,25),this.git1=pt(this.git1,25),this.git2=pt(this.git2,25),this.git3=pt(this.git3,25),this.git4=pt(this.git4,25),this.git5=pt(this.git5,25),this.git6=pt(this.git6,25),this.git7=pt(this.git7,25)):(this.git0=yt(this.git0,25),this.git1=yt(this.git1,25),this.git2=yt(this.git2,25),this.git3=yt(this.git3,25),this.git4=yt(this.git4,25),this.git5=yt(this.git5,25),this.git6=yt(this.git6,25),this.git7=yt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||lt(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||lt(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||go,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||po}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Vi(this[i],t[i])})}},C(ls,"Theme"),ls),_2=C(e=>{const t=new B2;return t.calculate(e),t},"getThemeVariables"),cs,L2=(cs=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=pt(this.contrast,55),this.background="#ffffff",this.tertiaryColor=W(this.primaryColor,{h:-160}),this.primaryBorderColor=Ne(this.primaryColor,this.darkMode),this.secondaryBorderColor=Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ne(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.tertiaryColor),this.lineColor=lt(this.background),this.textColor=lt(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||pt(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){this.secondBkg=pt(this.contrast,55),this.border2=this.contrast,this.actorBorder=pt(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||lt(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||pt(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||yt(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||W(this.mainBkg,{l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||W(this.mainBkg,{l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.sectionBkgColor=pt(this.contrast,30),this.sectionBkgColor2=pt(this.contrast,30),this.taskBorderColor=yt(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=pt(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=yt(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.vertLineColor=this.critBkgColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||"#000",this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=W(this.primaryColor,{h:64}),this.fillType3=W(this.secondaryColor,{h:64}),this.fillType4=W(this.primaryColor,{h:-64}),this.fillType5=W(this.secondaryColor,{h:-64}),this.fillType6=W(this.primaryColor,{h:128}),this.fillType7=W(this.secondaryColor,{h:128});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let t=0;t<8;t++)this["venn"+(t+1)]=this["venn"+(t+1)]??this["cScale"+t];this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||W(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||W(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||W(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||W(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||W(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||W(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||bi(this.quadrant1Fill)?pt(this.quadrant1Fill):yt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=yt(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||W(this.primaryColor,{h:-30}),this.git4=this.pie5||W(this.primaryColor,{h:-60}),this.git5=this.pie6||W(this.primaryColor,{h:-90}),this.git6=this.pie7||W(this.primaryColor,{h:60}),this.git7=this.pie8||W(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1="white",this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3="white",this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||go,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||po}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Vi(this[i],t[i])})}},C(cs,"Theme"),cs),A2=C(e=>{const t=new L2;return t.calculate(e),t},"getThemeVariables"),hs,F2=(hs=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=Ne(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||W(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||W(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Ne(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Ne(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Ne(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||yt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||(bi(this.background)?pt(this.background,4):yt(this.background,4));const t="#ECECFE",r="#E9E9F1",i=W(t,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||pt(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||t,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||i,this.cScale3=this.cScale3||W(t,{h:30}),this.cScale4=this.cScale4||W(t,{h:60}),this.cScale5=this.cScale5||W(t,{h:90}),this.cScale6=this.cScale6||W(t,{h:120}),this.cScale7=this.cScale7||W(t,{h:150}),this.cScale8=this.cScale8||W(t,{h:210,l:150}),this.cScale9=this.cScale9||W(t,{h:270}),this.cScale10=this.cScale10||W(t,{h:300}),this.cScale11=this.cScale11||W(t,{h:330}),this.darkMode)for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScale"+a]=yt(this["cScale"+a],75);else for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScale"+a]=yt(this["cScale"+a],25);for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScaleInv"+a]=this["cScaleInv"+a]||lt(this["cScale"+a]);for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this.darkMode?this["cScalePeer"+a]=this["cScalePeer"+a]||pt(this["cScale"+a],10):this["cScalePeer"+a]=this["cScalePeer"+a]||yt(this["cScale"+a],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScaleLabel"+a]=this["cScaleLabel"+a]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let a=0;a<5;a++)this["surface"+a]=this["surface"+a]||W(this.mainBkg,{h:180,s:-15,l:o*(5+a*3)}),this["surfacePeer"+a]=this["surfacePeer"+a]||W(this.mainBkg,{h:180,s:-15,l:o*(8+a*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||W(t,{h:64}),this.fillType3=this.fillType3||W(r,{h:64}),this.fillType4=this.fillType4||W(t,{h:-64}),this.fillType5=this.fillType5||W(r,{h:-64}),this.fillType6=this.fillType6||W(t,{h:128}),this.fillType7=this.fillType7||W(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||W(t,{l:-10}),this.pie5=this.pie5||W(r,{l:-10}),this.pie6=this.pie6||W(i,{l:-10}),this.pie7=this.pie7||W(t,{h:60,l:-10}),this.pie8=this.pie8||W(t,{h:-60,l:-10}),this.pie9=this.pie9||W(t,{h:120,l:0}),this.pie10=this.pie10||W(t,{h:60,l:-20}),this.pie11=this.pie11||W(t,{h:-60,l:-20}),this.pie12=this.pie12||W(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||W(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||W(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||W(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||W(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||W(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||W(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||bi(this.quadrant1Fill)?pt(this.quadrant1Fill):yt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||W(t,{h:-30}),this.git4=this.git4||W(t,{h:-60}),this.git5=this.git5||W(t,{h:-90}),this.git6=this.git6||W(t,{h:60}),this.git7=this.git7||W(t,{h:120}),this.darkMode?(this.git0=pt(this.git0,25),this.git1=pt(this.git1,25),this.git2=pt(this.git2,25),this.git3=pt(this.git3,25),this.git4=pt(this.git4,25),this.git5=pt(this.git5,25),this.git6=pt(this.git6,25),this.git7=pt(this.git7,25)):(this.git0=yt(this.git0,25),this.git1=yt(this.git1,25),this.git2=yt(this.git2,25),this.git3=yt(this.git3,25),this.git4=yt(this.git4,25),this.git5=yt(this.git5,25),this.git6=yt(this.git6,25),this.git7=yt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||go,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||po}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Vi(this[i],t[i])})}},C(hs,"Theme"),hs),$2=C(e=>{const t=new F2;return t.calculate(e),t},"getThemeVariables"),ds,E2=(ds=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=pt(this.primaryColor,16),this.tertiaryColor=W(this.primaryColor,{h:-160}),this.primaryBorderColor=lt(this.background),this.secondaryBorderColor=Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ne(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=pt(lt("#323D47"),10),this.border1="#ccc",this.border2=Qo(255,255,255,.25),this.arrowheadColor=lt(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||W(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||W(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Ne(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Ne(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Ne(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.secondBkg=this.secondBkg==="calculated"?pt(this.mainBkg,16):this.secondBkg,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||yt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||pt(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||this.secondBkg,this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||W(this.primaryColor,{h:30}),this.cScale4=this.cScale4||W(this.primaryColor,{h:60}),this.cScale5=this.cScale5||W(this.primaryColor,{h:90}),this.cScale6=this.cScale6||W(this.primaryColor,{h:120}),this.cScale7=this.cScale7||W(this.primaryColor,{h:150}),this.cScale8=this.cScale8||W(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||W(this.primaryColor,{h:270}),this.cScale10=this.cScale10||W(this.primaryColor,{h:300}),this.cScale11=this.cScale11||W(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=yt(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=yt(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||lt(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||pt(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||yt(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||W(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||W(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||W(this.primaryColor,{h:64}),this.fillType3=this.fillType3||W(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||W(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||W(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||W(this.primaryColor,{h:128}),this.fillType7=this.fillType7||W(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||W(this.primaryColor,{l:-10}),this.pie5=this.pie5||W(this.secondaryColor,{l:-10}),this.pie6=this.pie6||W(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||W(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||W(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||W(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||W(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||W(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||W(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||W(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||W(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||W(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||W(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||W(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||W(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||bi(this.quadrant1Fill)?pt(this.quadrant1Fill):yt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||"#0b0000",this.git1=this.git1||"#4d1037",this.git2=this.git2||"#3f5258",this.git3=this.git3||"#4f2f1b",this.git4=this.git4||"#6e0a0a",this.git5=this.git5||"#3b0048",this.git6=this.git6||"#995a01",this.git7=this.git7||"#154706",this.gitDarkMode=!0,this.gitDarkMode?(this.git0=pt(this.git0,25),this.git1=pt(this.git1,25),this.git2=pt(this.git2,25),this.git3=pt(this.git3,25),this.git4=pt(this.git4,25),this.git5=pt(this.git5,25),this.git6=pt(this.git6,25),this.git7=pt(this.git7,25)):(this.git0=yt(this.git0,25),this.git1=yt(this.git1,25),this.git2=yt(this.git2,25),this.git3=yt(this.git3,25),this.git4=yt(this.git4,25),this.git5=yt(this.git5,25),this.git6=yt(this.git6,25),this.git7=yt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||go,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||po}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Vi(this[i],t[i])})}},C(ds,"Theme"),ds),P2=C(e=>{const t=new E2;return t.calculate(e),t},"getThemeVariables"),us,I2=(us=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=Ne("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||W(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||W(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Ne(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Ne(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Ne(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||yt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||(bi(this.background)?pt(this.background,4):yt(this.background,4));const t="#ECECFE",r="#E9E9F1",i=W(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||pt(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScale"+a]=this.mainBkg;if(this.darkMode)for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScale"+a]=yt(this["cScale"+a],75);else for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScale"+a]=yt(this["cScale"+a],25);for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScaleInv"+a]=this["cScaleInv"+a]||lt(this["cScale"+a]);for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this.darkMode?this["cScalePeer"+a]=this["cScalePeer"+a]||pt(this["cScale"+a],10):this["cScalePeer"+a]=this["cScalePeer"+a]||yt(this["cScale"+a],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScaleLabel"+a]=this["cScaleLabel"+a]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let a=0;a<5;a++)this["surface"+a]=this["surface"+a]||W(this.mainBkg,{h:180,s:-15,l:o*(5+a*3)}),this["surfacePeer"+a]=this["surfacePeer"+a]||W(this.mainBkg,{h:180,s:-15,l:o*(8+a*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||W(t,{h:64}),this.fillType3=this.fillType3||W(r,{h:64}),this.fillType4=this.fillType4||W(t,{h:-64}),this.fillType5=this.fillType5||W(r,{h:-64}),this.fillType6=this.fillType6||W(t,{h:128}),this.fillType7=this.fillType7||W(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||W(t,{l:-10}),this.pie5=this.pie5||W(r,{l:-10}),this.pie6=this.pie6||W(i,{l:-10}),this.pie7=this.pie7||W(t,{h:60,l:-10}),this.pie8=this.pie8||W(t,{h:-60,l:-10}),this.pie9=this.pie9||W(t,{h:120,l:0}),this.pie10=this.pie10||W(t,{h:60,l:-20}),this.pie11=this.pie11||W(t,{h:-60,l:-20}),this.pie12=this.pie12||W(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||W(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||W(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||W(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||W(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||W(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||W(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||bi(this.quadrant1Fill)?pt(this.quadrant1Fill):yt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#FFFFFF",this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||W(t,{h:-30}),this.git4=this.git4||W(t,{h:-60}),this.git5=this.git5||W(t,{h:-90}),this.git6=this.git6||W(t,{h:60}),this.git7=this.git7||W(t,{h:120}),this.darkMode?(this.git0=pt(this.git0,25),this.git1=pt(this.git1,25),this.git2=pt(this.git2,25),this.git3=pt(this.git3,25),this.git4=pt(this.git4,25),this.git5=pt(this.git5,25),this.git6=pt(this.git6,25),this.git7=pt(this.git7,25)):(this.git0=yt(this.git0,25),this.git1=yt(this.git1,25),this.git2=yt(this.git2,25),this.git3=yt(this.git3,25),this.git4=yt(this.git4,25),this.git5=yt(this.git5,25),this.git6=yt(this.git6,25),this.git7=yt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.erEdgeLabelBackground="#FFFFFF",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||go,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||po}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Vi(this[i],t[i])})}},C(us,"Theme"),us),O2=C(e=>{const t=new I2;return t.calculate(e),t},"getThemeVariables"),fs,D2=(fs=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=pt(this.primaryColor,16),this.tertiaryColor=W(this.primaryColor,{h:-160}),this.primaryBorderColor=lt(this.background),this.secondaryBorderColor=Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ne(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=pt(lt("#323D47"),10),this.border1="#ccc",this.border2=Qo(255,255,255,.25),this.arrowheadColor=lt(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||W(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||W(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Ne(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Ne(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Ne(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.secondBkg=this.secondBkg==="calculated"?pt(this.mainBkg,16):this.secondBkg,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||yt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||pt(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||this.secondBkg,this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||W(this.primaryColor,{h:30}),this.cScale4=this.cScale4||W(this.primaryColor,{h:60}),this.cScale5=this.cScale5||W(this.primaryColor,{h:90}),this.cScale6=this.cScale6||W(this.primaryColor,{h:120}),this.cScale7=this.cScale7||W(this.primaryColor,{h:150}),this.cScale8=this.cScale8||W(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||W(this.primaryColor,{h:270}),this.cScale10=this.cScale10||W(this.primaryColor,{h:300}),this.cScale11=this.cScale11||W(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=yt(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=yt(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||lt(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||pt(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||yt(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||W(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||W(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||W(this.primaryColor,{h:64}),this.fillType3=this.fillType3||W(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||W(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||W(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||W(this.primaryColor,{h:128}),this.fillType7=this.fillType7||W(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||W(this.primaryColor,{l:-10}),this.pie5=this.pie5||W(this.secondaryColor,{l:-10}),this.pie6=this.pie6||W(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||W(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||W(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||W(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||W(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||W(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||W(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||W(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||W(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||W(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||W(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||W(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||W(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||bi(this.quadrant1Fill)?pt(this.quadrant1Fill):yt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#16141F",this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||W(this.primaryColor,{h:-30}),this.git4=this.git4||W(this.primaryColor,{h:-60}),this.git5=this.git5||W(this.primaryColor,{h:-90}),this.git6=this.git6||W(this.primaryColor,{h:60}),this.git7=this.git7||W(this.primaryColor,{h:120}),this.darkMode?(this.git0=pt(this.git0,25),this.git1=pt(this.git1,25),this.git2=pt(this.git2,25),this.git3=pt(this.git3,25),this.git4=pt(this.git4,25),this.git5=pt(this.git5,25),this.git6=pt(this.git6,25),this.git7=pt(this.git7,25)):(this.git0=yt(this.git0,25),this.git1=yt(this.git1,25),this.git2=yt(this.git2,25),this.git3=yt(this.git3,25),this.git4=yt(this.git4,25),this.git5=yt(this.git5,25),this.git6=yt(this.git6,25),this.git7=yt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.erEdgeLabelBackground="#16141F",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||go,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||po}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Vi(this[i],t[i])})}},C(fs,"Theme"),fs),R2=C(e=>{const t=new D2;return t.calculate(e),t},"getThemeVariables"),gs,N2=(gs=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=Ne("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.usecaseActorBorder="#A78BFA",this.usecaseActorBkg="#F5F3FF",this.usecaseBorder="#2DD4BF",this.usecaseBkg="#F0FDFA",this.usecaseBoundaryBorder="#BDBCCC",this.usecaseBoundaryBkg="#FAFAFC",this.usecaseIncludeLine="#38BDF8",this.usecaseExtendLine="#FB923C",this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||W(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||W(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Ne(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Ne(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Ne(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||yt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||(bi(this.background)?pt(this.background,4):yt(this.background,4));const t="#ECECFE",r="#E9E9F1",i=W(t,{h:180,l:5});this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||pt(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateEdgeLabelBackground=this.stateEdgeLabelBackground||"#FFFFFF",this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#F9F9FB",this.compositeTitleBackground=this.compositeTitleBackground||"#F9F9FB",this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad",this.sectionBkgColor=this.sectionBkgColor||this.cScale0,this.sectionBkgColor2=this.sectionBkgColor2||this.cScale1,this.altSectionBkgColor=this.altSectionBkgColor||"white";for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScaleInv"+a]=this["cScaleInv"+a]||lt(this["cScale"+a]);for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this.darkMode?this["cScalePeer"+a]=this["cScalePeer"+a]||pt(this["cScale"+a],10):this["cScalePeer"+a]=this["cScalePeer"+a]||yt(this["cScale"+a],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScaleLabel"+a]=this["cScaleLabel"+a]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let a=0;a<5;a++)this["surface"+a]=this["surface"+a]||W(this.mainBkg,{h:180,s:-15,l:o*(5+a*3)}),this["surfacePeer"+a]=this["surfacePeer"+a]||W(this.mainBkg,{h:180,s:-15,l:o*(8+a*3)});this.classText=this.classText||this.textColor;for(let a=0;a<8;a++)this["fillType"+a]=this["fillType"+a]||this.bkgColorArray[a];for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["pie"+(a+1)]=this["pie"+(a+1)]||this["cScale"+a];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let a=0;a<8;a++)this["venn"+(a+1)]=this["venn"+(a+1)]??this.borderColorArray[a%this.borderColorArray.length];this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||W(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||W(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||W(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||W(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||W(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||W(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||bi(this.quadrant1Fill)?pt(this.quadrant1Fill):yt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#FFFFFF",this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||W(t,{h:-30}),this.git4=this.git4||W(t,{h:-60}),this.git5=this.git5||W(t,{h:-90}),this.git6=this.git6||W(t,{h:60}),this.git7=this.git7||W(t,{h:120}),this.darkMode?(this.git0=pt(this.git0,25),this.git1=pt(this.git1,25),this.git2=pt(this.git2,25),this.git3=pt(this.git3,25),this.git4=pt(this.git4,25),this.git5=pt(this.git5,25),this.git6=pt(this.git6,25),this.git7=pt(this.git7,25)):(this.git0=yt(this.git0,25),this.git1=yt(this.git1,25),this.git2=yt(this.git2,25),this.git3=yt(this.git3,25),this.git4=yt(this.git4,25),this.git5=yt(this.git5,25),this.git6=yt(this.git6,25),this.git7=yt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLineColor=this.commitLineColor??"#BDBCCC",this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.fontWeight=600,this.erEdgeLabelBackground="#FFFFFF",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||go,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||po}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Vi(this[i],t[i])})}},C(gs,"Theme"),gs),q2=C(e=>{const t=new N2;return t.calculate(e),t},"getThemeVariables"),ps,W2=(ps=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=pt(this.primaryColor,16),this.tertiaryColor=W(this.primaryColor,{h:-160}),this.primaryBorderColor=lt(this.background),this.secondaryBorderColor=Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ne(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=pt(lt("#323D47"),10),this.border1="#ccc",this.border2=Qo(255,255,255,.25),this.arrowheadColor=lt(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.usecaseActorBorder="#A78BFA",this.usecaseBorder="#2DD4BF",this.usecaseBoundaryBorder="#BDBCCC",this.usecaseIncludeLine="#38BDF8",this.usecaseExtendLine="#FB923C",this.filterColor="#FFFFFF"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||W(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||W(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Ne(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Ne(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Ne(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.secondBkg=this.secondBkg==="calculated"?pt(this.mainBkg,16):this.secondBkg,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||yt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||pt(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||this.secondBkg,this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateEdgeLabelBackground=this.stateEdgeLabelBackground||"#16141F",this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||"#16141F",this.altBackground=this.altBackground||"#16141F",this.compositeTitleBackground=this.compositeTitleBackground||"#16141F",this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad",this.sectionBkgColor=this.sectionBkgColor||this.cScale0,this.sectionBkgColor2=this.sectionBkgColor2||this.cScale1,this.altSectionBkgColor=this.altSectionBkgColor||this.background;for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScaleInv"+i]=this["cScaleInv"+i]||lt(this["cScale"+i]);for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this.darkMode?this["cScalePeer"+i]=this["cScalePeer"+i]||pt(this["cScale"+i],10):this["cScalePeer"+i]=this["cScalePeer"+i]||yt(this["cScale"+i],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScaleLabel"+i]=yt(this["cScale"+i],75);const t=this.darkMode?-4:-1;for(let i=0;i<5;i++)this["surface"+i]=this["surface"+i]||W(this.mainBkg,{h:180,s:-15,l:t*(5+i*3)}),this["surfacePeer"+i]=this["surfacePeer"+i]||W(this.mainBkg,{h:180,s:-15,l:t*(8+i*3)});this.classText=this.classText||this.textColor,["#701a75","#134e4a","#7c2d12","#581c87","#14532d","#4c1d95","#7f1d1d","#713f12"].forEach((i,o)=>{this["fillType"+o]=this["fillType"+o]||i});for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["pie"+(i+1)]=this["pie"+(i+1)]||this["cScale"+i];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||"#28253D",this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let i=0;i<8;i++)this["venn"+(i+1)]=this["venn"+(i+1)]??this.borderColorArray[i%this.borderColorArray.length];this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||W(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||W(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||W(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||W(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||W(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||W(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||bi(this.quadrant1Fill)?pt(this.quadrant1Fill):yt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#16141F",this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||W(this.primaryColor,{h:-30}),this.git4=this.git4||W(this.primaryColor,{h:-60}),this.git5=this.git5||W(this.primaryColor,{h:-90}),this.git6=this.git6||W(this.primaryColor,{h:60}),this.git7=this.git7||W(this.primaryColor,{h:120}),this.darkMode?(this.git0=pt(this.git0,25),this.git1=pt(this.git1,25),this.git2=pt(this.git2,25),this.git3=pt(this.git3,25),this.git4=pt(this.git4,25),this.git5=pt(this.git5,25),this.git6=pt(this.git6,25),this.git7=pt(this.git7,25)):(this.git0=yt(this.git0,25),this.git1=yt(this.git1,25),this.git2=yt(this.git2,25),this.git3=yt(this.git3,25),this.git4=yt(this.git4,25),this.git5=yt(this.git5,25),this.git6=yt(this.git6,25),this.git7=yt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.fontWeight=600,this.erEdgeLabelBackground="#16141F",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||go,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||po}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Vi(this[i],t[i])})}},C(ps,"Theme"),ps),z2=C(e=>{const t=new W2;return t.calculate(e),t},"getThemeVariables"),$o={base:{getThemeVariables:k2},dark:{getThemeVariables:v2},default:{getThemeVariables:T2},forest:{getThemeVariables:_2},neutral:{getThemeVariables:A2},neo:{getThemeVariables:$2},"neo-dark":{getThemeVariables:P2},redux:{getThemeVariables:O2},"redux-dark":{getThemeVariables:R2},"redux-color":{getThemeVariables:q2},"redux-dark-color":{getThemeVariables:z2}},Or={flowchart:{useMaxWidth:!0,theme:"redux-color",look:"neo",titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,wrappingWidth:120,minNodeWidth:120,stepDuration:1,stepNumbers:!1,inheritDir:!1},swimlane:{useMaxWidth:!0,theme:"redux-color",look:"neo",layout:"swimlane",lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},agentflow:{useMaxWidth:!0,theme:"redux-color",look:"neo",titleTopMargin:25,diagramPadding:8,nodeSpacing:50,rankSpacing:50,wrappingWidth:120,minNodeWidth:120},sequence:{useMaxWidth:!0,theme:"redux-color",look:"neo",hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,theme:"redux-color",look:"neo",titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,theme:"redux-color",look:"neo",layout:"elk",wrappingWidth:120,minNodeWidth:120,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5},er:{useMaxWidth:!0,theme:"redux-color",look:"neo",titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,donutHole:0,legendPosition:"right",highlightSlice:""},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,showLegend:!0,legendFontSize:14,legendPadding:10,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,theme:"redux-color",look:"neo",rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,colorBy:"branch",padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,bitOrder:"ascending",paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},usecase:{useMaxWidth:!0,theme:"redux-color",look:"neo",wrappingWidth:120,minNodeWidth:120,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:"normal",usecaseFontSize:12,usecaseFontFamily:'"Open Sans", sans-serif',usecaseFontWeight:"normal",nodeSpacing:50,rankSpacing:50,diagramPadding:20,colorScheme:"role"},venn:{useMaxWidth:!0,theme:"redux-color",look:"neo",width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},theme:"default",look:"classic",handDrawnSeed:0,layout:"elk",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},em={...Or,deterministicIDSeed:void 0,elk:{mergeEdges:!1,straightenEdges:!0,lineHops:!0,preset:"default",nodePlacementStrategy:void 0,layeringStrategy:void 0,cycleBreakingStrategy:void 0,layeringLayerBound:4,nodePlacementAlignment:void 0,forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES",keepEntryNodeOnTop:!1,orientFeedbackEdges:!0},themeCSS:void 0,themeVariables:$o.default.getThemeVariables(),sequence:{...Or.sequence,messageFont:C(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:C(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:C(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{theme:Or.class?.theme,look:Or.class?.look,layout:Or.class?.layout,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...Or.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Or.c4,useWidth:void 0,personFont:C(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Or.flowchart,inheritDir:!1},external_personFont:C(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:C(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:C(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:C(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:C(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:C(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:C(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:C(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:C(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:C(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:C(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:C(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:C(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:C(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:C(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:C(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:C(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:C(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:C(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:C(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:C(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...Or.pie,useWidth:984},xyChart:{...Or.xyChart,useWidth:void 0},requirement:{...Or.requirement,useWidth:void 0},packet:{...Or.packet},eventmodeling:{...Or.eventmodeling},treeView:{...Or.treeView,useWidth:void 0},radar:{...Or.radar},usecase:{...Or.usecase},railroad:{...Or.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...Or.ishikawa},sankey:{...Or.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...Or.venn},cynefin:{...Or.cynefin}},rm=C((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...rm(e[i],"")]:[...r,t+i],[]),"keyify"),H2=new Set(rm(em,"")),Ld=em,Y2={"flowchart-v2":"flowchart","flowchart-elk":"flowchart",classDiagram:"class",stateDiagram:"state",xychart:"xyChart",railroadAbnf:"railroad",railroadEbnf:"railroad",railroadPeg:"railroad"},X2=C(e=>Y2[e]??e,"getDiagramConfigKey"),j2={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},G2=C((e,t)=>{for(const r of Object.keys(e)){const i=e[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof i!="string"||!t.test(i))&&(Lt.debug("sanitize deleting dictionary entry:",r,i),delete e[r])}},"sanitizeDictionaryConfig"),xl=C(e=>{if(Lt.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>xl(t));return}for(const t of Object.keys(e)){if(Lt.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!H2.has(t)||e[t]==null){Lt.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const i=j2[t];i?G2(e[t],i):(Lt.debug("sanitizing object",t),xl(e[t]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(Lt.debug("sanitizing css option",t),e[t]=im(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const r=e.themeVariables[t];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}Lt.debug("After sanitization",e)}},"sanitizeDirective"),im=C(e=>{let t=0,r=0;for(const i of e){if(t<r)return"{ /* ERROR: Unbalanced CSS */ }";i==="{"?t++:i==="}"&&r++}return t!==r?"{ /* ERROR: Unbalanced CSS */ }":e},"sanitizeCss"),Jo=Object.freeze(Ld),U2=["theme","look","layout"],V2=new Set(["classic","handDrawn","neo"]),Z2=C((e,t)=>e==="theme"?t==="null"||Object.hasOwn($o,t):e!=="look"||V2.has(t),"isUsableAppearance"),K2=C((e,t,r)=>e?[e[t]?.[r],e[r]].find(o=>o!==void 0&&Z2(r,o)):void 0,"readAppearance"),mo=C(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),hi=Wr({},Jo),bl,Cl={},Eo=[],sn=Wr({},Jo),nn,Q2=C((e,t)=>{if(!nn)return;const r=[t,...[...Eo].reverse(),Cl,Jo],i=e[nn];for(const o of U2)for(const a of r){const s=K2(a,nn,o);if(s!==void 0){e[o]=s,i?.[o]!==void 0&&(i[o]=s);break}}},"resolveAppearance"),_s=C((e,t)=>{let r=Wr({},e),i={};for(const a of t)sm(a),i=Wr(i,a);if(r=Wr(r,i),Q2(r,i),(!!i.theme||r.theme!==e.theme)&&r.theme&&Object.hasOwn($o,r.theme)){const a=Wr({},bl),s=Wr(a.themeVariables||{},i.themeVariables);r.themeVariables=$o[r.theme].getThemeVariables(s)}return sn=r,ow(sn),sn},"updateCurrentConfig"),Ad=C(e=>{nn=e===void 0?void 0:X2(e),_s(hi,Eo)},"setDiagramConfigScope"),J2=C(e=>(hi=Wr({},Jo),hi=Wr(hi,e),Cl=Wr({},e),e.theme&&Object.hasOwn($o,e.theme)&&(hi.themeVariables=$o[e.theme].getThemeVariables(e.themeVariables)),_s(hi,Eo),hi),"setSiteConfig"),tw=C(e=>{bl=Wr({},e)},"saveConfigFromInitialize"),ew=C(e=>(hi=Wr(hi,e),Cl=Wr(Cl,e),_s(hi,Eo),hi),"updateSiteConfig"),om=C(()=>Wr({},hi),"getSiteConfig"),am=C(e=>(_s(sn,[e]),Ar()),"setConfig"),Ar=C(()=>Wr({},sn),"getConfig"),sm=C(e=>{e&&(["secure",...hi.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(Lt.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&sm(e[t])}))},"sanitize"),rw=C(e=>{xl(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),Eo.push(e),_s(hi,Eo)},"addDirective"),wl=C((e=hi)=>{Eo=[],nn=void 0,_s(e,Eo)},"reset"),iw={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},vf={},nm=C(e=>{vf[e]||(Lt.warn(iw[e]),vf[e]=!0)},"issueWarning"),ow=C(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&nm("LAZY_LOAD_DEPRECATED")},"checkConfig"),eP=C(()=>{let e={};bl&&(e=Wr(e,bl));for(const t of Eo)e=Wr(e,t);return e},"getUserDefinedConfig"),Zr=C(e=>(e.flowchart?.htmlLabels!=null&&nm("FLOWCHART_HTML_LABELS_DEPRECATED"),mo(e.htmlLabels??e.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),wn=/<\/?br\s*\/?>/gi,aw=new RegExp(wn.source,"i"),sw=C(e=>e?hm(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),nw=(()=>{let e=!1;return()=>{e||(lm(),e=!0)}})();function lm(){const e="data-temp-href-target";bs.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),bs.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)??""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}C(lm,"setupDompurifyHooks");var cm=C(e=>(nw(),bs.sanitize(e)),"removeScript"),Mf=C((e,t)=>{if(Zr(t)){const r=t.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?e=cm(e):r!=="loose"&&(e=hm(e),e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"),e=e.replace(/=/g,"&equals;"),e=dw(e))}return e},"sanitizeMore"),Ei=C((e,t)=>e&&(t.dompurifyConfig?e=bs.sanitize(Mf(e,t),t.dompurifyConfig).toString():e=bs.sanitize(Mf(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),lw=C((e,t)=>typeof e=="string"?Ei(e,t):e.flat().map(r=>Ei(r,t)),"sanitizeTextOrArray"),cw=C(e=>aw.test(e),"hasBreaks"),hw=C(e=>e.split(wn),"splitBreaks"),dw=C(e=>e.replace(/#br#/g,"<br/>"),"placeholderToBreak"),hm=C(e=>e.replace(wn,"#br#"),"breakToPlaceholder"),uw=C(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),fw=C(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),gw=C(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),Tf=C(function(e){const t=e.split(/(,)/),r=[];for(let i=0;i<t.length;i++){let o=t[i];if(o===","&&i>0&&i+1<t.length){const a=t[i-1],s=t[i+1];pw(a,s)&&(o=a+","+s,i++,r.pop())}r.push(mw(o))}return r.join("")},"parseGenericTypes"),Lh=C((e,t)=>Math.max(0,e.split(t).length-1),"countOccurrence"),pw=C((e,t)=>{const r=Lh(e,"~"),i=Lh(t,"~");return r===1&&i===1},"shouldCombineSets"),mw=C(e=>{const t=Lh(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const i=[...e];let o=i.indexOf("~"),a=i.lastIndexOf("~");for(;o!==-1&&a!==-1&&o!==a;)i[o]="<",i[a]=">",o=i.indexOf("~"),a=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),Bf=C(()=>window.MathMLElement!==void 0,"isMathMLSupported"),Ah=/\$\$(.*?)\$\$/g,un=C(e=>(e.match(Ah)?.length??0)>0,"hasKatex"),rP=C(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await dm(e,t),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",r);const o={width:r.clientWidth,height:r.clientHeight};return r.remove(),o},"calculateMathMLDimensions"),yw=C(async(e,t)=>{if(!un(e))return e;if(!(Bf()||t.legacyMathML||t.forceLegacyMathML))return e.replace(Ah,"MathML is unsupported in this environment.");{const{default:r}=await Ve(async()=>{const{default:o}=await import("./B9rO5sNH.js");return{default:o}},[],import.meta.url),i=t.forceLegacyMathML||!Bf()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(wn).map(o=>un(o)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${o}</div>`:`<div>${o}</div>`).join("").replace(Ah,(o,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),dm=C(async(e,t)=>Ei(await yw(e,t),t),"renderKatexSanitized"),kn={getRows:sw,sanitizeText:Ei,sanitizeTextOrArray:lw,hasBreaks:cw,splitBreaks:hw,lineBreakRegex:wn,removeScript:cm,getUrl:uw,evaluate:mo,getMax:fw,getMin:gw},xw=C(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),bw=C(function(e,t,r){let i=new Map;return r?(i.set("width","100%"),i.set("style",`max-width: ${t}px;`)):(i.set("height",e),i.set("width",t)),i},"calculateSvgSizeAttrs"),um=C(function(e,t,r,i){const o=bw(t,r,i);xw(e,o)},"configureSvgSize"),Cw=C(function(e,t,r,i){const o=t.node().getBBox(),a=o.width,s=o.height;Lt.info(`SVG bounds: ${a}x${s}`,o);let n=0,l=0;Lt.info(`Graph bounds: ${n}x${l}`,e),n=a+r*2,l=s+r*2,Lt.info(`Calculated bounds: ${n}x${l}`),um(t,l,n,i);const c=`${o.x-r} ${o.y-r} ${o.width+2*r} ${o.height+2*r}`;t.attr("viewBox",c)},"setupGraphViewbox"),nl={};function Fh(e){return[...e.cssRules].map(t=>t.cssText).join(`
36
+ `||e==="\r","isLineBreak"),b2=C((e,t)=>{let r=-1;for(let i=t;i<e.length&&yl.test(e[i]);i++)sl(e[i])&&(r=i);return r},"lastLineBreakInWhitespaceRun"),Qp=C(e=>{let t=0;for(;t<e.length&&yl.test(e[t])&&!sl(e[t]);)t++;const r=e.slice(0,t);if(!e.startsWith("---",t))return;const i=[];for(let h=t+3;h<e.length&&yl.test(e[h]);h++)sl(e[h])&&i.push(h);if(i.length===0)return;const o=`${r}---`,a=C(h=>sl(e[h])&&e.startsWith(o,h+1)?b2(e,h+1+o.length):-1,"closingEnd"),s=i[0]+1;let n=-1;for(let h=s;h<e.length;h++)a(h)!==-1&&(n=h);if(n===-1)return;let l=i[0];for(const h of i)h<n&&(l=h);const c=l+1;for(let h=c;h<=n;h++){const d=a(h);if(d!==-1)return{indent:r,body:e.slice(c,h),length:d+1}}},"matchFrontMatter"),os,Jp=(os=class extends Error{constructor(t){super(t),this.name="UnknownDiagramError"}},C(os,"UnknownDiagramError"),os),Ta={},Zl=C(function(e,t){const r=Qp(e);e=x2((r?e.slice(r.length):e).replace(an,""));for(const[i,{detector:o}]of Object.entries(Ta))if(o(e,t))return i;throw new Jp(`No diagram type detected matching given configuration for text: ${e}`)},"detectType"),Bh=C((...e)=>{for(const{id:t,detector:r,loader:i}of e)tm(t,r,i)},"registerLazyLoadedDiagrams"),tm=C((e,t,r)=>{Ta[e]&&Lt.warn(`Detector with key ${e} already exists. Overwriting.`),Ta[e]={detector:t,loader:r},Lt.debug(`Detector with key ${e} added${r?" with loader":""}`)},"addDetector"),C2=C(e=>Ta[e].loader,"getDiagramLoader"),_h=C((e,t,{depth:r=2}={})=>{const i={depth:r};if(Array.isArray(t)&&!Array.isArray(e))return t.forEach(o=>_h(e,o,i)),e;if(Array.isArray(t)&&Array.isArray(e))return t.forEach(o=>{e.includes(o)||e.push(o)}),e;if(e==null||r<=0)return e!=null&&typeof e=="object"&&typeof t=="object"?Object.assign(e,t):t;if(t!=null&&typeof e=="object"&&typeof t=="object"){const o=e;Object.entries(t).forEach(([a,s])=>{if(typeof s=="object"){if(s===null)return;Object.hasOwn(e,a)||Object.defineProperty(e,a,{value:void 0,writable:!0,enumerable:!0,configurable:!0}),o[a]===void 0&&(o[a]=Array.isArray(s)?[]:{}),typeof o[a]=="object"&&(o[a]=_h(o[a],s,{depth:r-1}))}else typeof o[a]!="object"&&(Object.hasOwn(e,a)?o[a]=s:Object.defineProperty(e,a,{value:s,writable:!0,enumerable:!0,configurable:!0}))})}return e},"assignWithDepth"),Wr=_h,go="#ffffff",po="#f2f2f2",Ne=C((e,t)=>t?W(e,{s:-40,l:10}):W(e,{s:-40,l:-10}),"mkBorder"),Sf=C(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isPlainObject"),Vi=C((e,t)=>Sf(e)&&Sf(t)?{...e,...t}:t,"applyOverride"),as,w2=(as=class{constructor(){this.background="#f4f4f4",this.primaryColor="#fff4dd",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.useGradient=!0,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||W(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||W(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Ne(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Ne(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Ne(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||yt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||pt(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||"navy",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.darkMode?(this.rowOdd=this.rowOdd||yt(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||yt(this.mainBkg,10)):(this.rowOdd=this.rowOdd||pt(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||pt(this.mainBkg,5)),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||this.tertiaryColor,this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||W(this.primaryColor,{h:30}),this.cScale4=this.cScale4||W(this.primaryColor,{h:60}),this.cScale5=this.cScale5||W(this.primaryColor,{h:90}),this.cScale6=this.cScale6||W(this.primaryColor,{h:120}),this.cScale7=this.cScale7||W(this.primaryColor,{h:150}),this.cScale8=this.cScale8||W(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||W(this.primaryColor,{h:270}),this.cScale10=this.cScale10||W(this.primaryColor,{h:300}),this.cScale11=this.cScale11||W(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=yt(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=yt(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||lt(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||pt(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||yt(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||W(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||W(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||W(this.primaryColor,{h:64}),this.fillType3=this.fillType3||W(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||W(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||W(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||W(this.primaryColor,{h:128}),this.fillType7=this.fillType7||W(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||W(this.primaryColor,{l:-10}),this.pie5=this.pie5||W(this.secondaryColor,{l:-10}),this.pie6=this.pie6||W(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||W(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||W(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||W(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||W(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||W(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||W(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??W(this.primaryColor,{l:-30}),this.venn2=this.venn2??W(this.secondaryColor,{l:-30}),this.venn3=this.venn3??W(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??W(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??W(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??W(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??W(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??W(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.archEdgeColor=this.archEdgeColor||"#777",this.archEdgeArrowColor=this.archEdgeArrowColor||"#777",this.archEdgeWidth=this.archEdgeWidth||"3",this.archGroupBorderColor=this.archGroupBorderColor||"#000",this.archGroupBorderWidth=this.archGroupBorderWidth||"2px",this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||W(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||W(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||W(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||W(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||W(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||W(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||bi(this.quadrant1Fill)?pt(this.quadrant1Fill):yt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||W(this.primaryColor,{h:-30}),this.git4=this.git4||W(this.primaryColor,{h:-60}),this.git5=this.git5||W(this.primaryColor,{h:-90}),this.git6=this.git6||W(this.primaryColor,{h:60}),this.git7=this.git7||W(this.primaryColor,{h:120}),this.darkMode?(this.git0=pt(this.git0,25),this.git1=pt(this.git1,25),this.git2=pt(this.git2,25),this.git3=pt(this.git3,25),this.git4=pt(this.git4,25),this.git5=pt(this.git5,25),this.git6=pt(this.git6,25),this.git7=pt(this.git7,25)):(this.git0=yt(this.git0,25),this.git1=yt(this.git1,25),this.git2=yt(this.git2,25),this.git3=yt(this.git3,25),this.git4=yt(this.git4,25),this.git5=yt(this.git5,25),this.git6=yt(this.git6,25),this.git7=yt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||go,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||po,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Vi(this[i],t[i])}),Object.hasOwn(t,"nodeBorder")&&!Object.hasOwn(t,"useGradient")&&(this.useGradient=!1)}},C(as,"Theme"),as),k2=C(e=>{const t=new w2;return t.calculate(e),t},"getThemeVariables"),ss,S2=(ss=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=pt(this.primaryColor,16),this.tertiaryColor=W(this.primaryColor,{h:-160}),this.primaryBorderColor=lt(this.background),this.secondaryBorderColor=Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ne(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.tertiaryColor),this.lineColor=lt(this.background),this.textColor=lt(this.background),this.mainBkg="#1f2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=pt(lt("#323D47"),10),this.lineColor="calculated",this.border1="#ccc",this.border2=Qo(255,255,255,.25),this.arrowheadColor="calculated",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#F9FFFE",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="calculated",this.activationBkgColor="calculated",this.sequenceNumberColor="black",this.clusterBkg="#302F3D",this.sectionBkgColor=yt("#EAE8D9",30),this.altSectionBkgColor="calculated",this.sectionBkgColor2="#EAE8D9",this.excludeBkgColor=yt(this.sectionBkgColor,10),this.taskBorderColor=Qo(255,255,255,70),this.taskBkgColor="calculated",this.taskTextColor="calculated",this.taskTextLightColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor=Qo(255,255,255,50),this.activeTaskBkgColor="#81B1DB",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="grey",this.critBorderColor="#E83737",this.critBkgColor="#E83737",this.taskTextDarkColor="calculated",this.todayLineColor="#DB5757",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd=this.rowOdd||pt(this.mainBkg,5)||"#ffffff",this.rowEven=this.rowEven||yt(this.mainBkg,10),this.labelColor="calculated",this.errorBkgColor="#a44141",this.errorTextColor="#ddd",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal"}updateColors(){this.secondBkg=pt(this.mainBkg,16),this.lineColor=this.mainContrastColor,this.arrowheadColor=this.mainContrastColor,this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.edgeLabelBackground=pt(this.labelBackground,25),this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.actorTextColor=this.mainContrastColor,this.actorLineColor=this.actorBorder,this.signalColor=this.mainContrastColor,this.signalTextColor=this.mainContrastColor,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.mainContrastColor,this.loopTextColor=this.mainContrastColor,this.noteBorderColor=this.secondaryBorderColor,this.noteBkgColor=this.secondBkg,this.noteTextColor=this.secondaryTextColor,this.activationBorderColor=this.border1,this.activationBkgColor=this.secondBkg,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.background,this.taskBkgColor=pt(this.mainBkg,23),this.taskTextColor=this.darkTextColor,this.taskTextLightColor=this.mainContrastColor,this.taskTextOutsideColor=this.taskTextLightColor,this.gridColor=this.mainContrastColor,this.doneTaskBkgColor=this.mainContrastColor,this.taskTextDarkColor=lt(this.doneTaskBkgColor),this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#555",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#f4f4f4",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=W(this.primaryColor,{h:64}),this.fillType3=W(this.secondaryColor,{h:64}),this.fillType4=W(this.primaryColor,{h:-64}),this.fillType5=W(this.secondaryColor,{h:-64}),this.fillType6=W(this.primaryColor,{h:128}),this.fillType7=W(this.secondaryColor,{h:128}),this.cScale1=this.cScale1||"#0b0000",this.cScale2=this.cScale2||"#4d1037",this.cScale3=this.cScale3||"#3f5258",this.cScale4=this.cScale4||"#4f2f1b",this.cScale5=this.cScale5||"#6e0a0a",this.cScale6=this.cScale6||"#3b0048",this.cScale7=this.cScale7||"#995a01",this.cScale8=this.cScale8||"#154706",this.cScale9=this.cScale9||"#161722",this.cScale10=this.cScale10||"#00296f",this.cScale11=this.cScale11||"#01629c",this.cScale12=this.cScale12||"#010029",this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||W(this.primaryColor,{h:30}),this.cScale4=this.cScale4||W(this.primaryColor,{h:60}),this.cScale5=this.cScale5||W(this.primaryColor,{h:90}),this.cScale6=this.cScale6||W(this.primaryColor,{h:120}),this.cScale7=this.cScale7||W(this.primaryColor,{h:150}),this.cScale8=this.cScale8||W(this.primaryColor,{h:210}),this.cScale9=this.cScale9||W(this.primaryColor,{h:270}),this.cScale10=this.cScale10||W(this.primaryColor,{h:300}),this.cScale11=this.cScale11||W(this.primaryColor,{h:330});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||lt(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScalePeer"+t]=this["cScalePeer"+t]||pt(this["cScale"+t],10);for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||W(this.mainBkg,{h:30,s:-30,l:-(-10+t*4)}),this["surfacePeer"+t]=this["surfacePeer"+t]||W(this.mainBkg,{h:30,s:-30,l:-(-7+t*4)});this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.mainContrastColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.mainContrastColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let t=0;t<8;t++)this["venn"+(t+1)]=this["venn"+(t+1)]??pt(this["cScale"+t],30);this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#FF6B6B",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#1B5E20",complicatedBg:this.cynefin?.complicatedBg||"#0D47A1",chaoticBg:this.cynefin?.chaoticBg||"#BF360C",clearBg:this.cynefin?.clearBg||"#F57F17",confusionBg:this.cynefin?.confusionBg||"#4A148C",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||W(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||W(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||W(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||W(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||W(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||W(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||bi(this.quadrant1Fill)?pt(this.quadrant1Fill):yt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#3498db,#2ecc71,#e74c3c,#f1c40f,#bdc3c7,#ffffff,#34495e,#9b59b6,#1abc9c,#e67e22"},this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.background},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#ff6b6b",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.mainBkg,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.mainBkg},this.classText=this.primaryTextColor,this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=pt(this.secondaryColor,20),this.git1=pt(this.pie2||this.secondaryColor,20),this.git2=pt(this.pie3||this.tertiaryColor,20),this.git3=pt(this.pie4||W(this.primaryColor,{h:-30}),20),this.git4=pt(this.pie5||W(this.primaryColor,{h:-60}),20),this.git5=pt(this.pie6||W(this.primaryColor,{h:-90}),10),this.git6=pt(this.pie7||W(this.primaryColor,{h:60}),10),this.git7=pt(this.pie8||W(this.primaryColor,{h:120}),20),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||lt(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||lt(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"#2d2d2d",this.emUiStroke=this.emUiStroke||"#555",this.emProcessorFill=this.emProcessorFill||pt("#5a3d5c",10),this.emProcessorStroke=this.emProcessorStroke||"#8a6d8c",this.emReadModelFill=this.emReadModelFill||pt("#3d5a2d",10),this.emReadModelStroke=this.emReadModelStroke||"#6d8c5c",this.emCommandFill=this.emCommandFill||pt("#2d3d5a",10),this.emCommandStroke=this.emCommandStroke||"#5c6d8c",this.emEventFill=this.emEventFill||pt("#5a452d",10),this.emEventStroke=this.emEventStroke||"#8c755c",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||pt(this.background,5),this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||pt(this.background,12),this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||pt(this.background,12),this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||pt(this.background,2),this.nodeBorder=this.nodeBorder||"#999"}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Vi(this[i],t[i])})}},C(ss,"Theme"),ss),v2=C(e=>{const t=new S2;return t.calculate(e),t},"getThemeVariables"),ns,M2=(ns=class{constructor(){this.background="#f4f4f4",this.primaryColor="#ECECFF",this.secondaryColor=W(this.primaryColor,{h:120}),this.secondaryColor="#ffffde",this.tertiaryColor=W(this.primaryColor,{h:-160}),this.primaryBorderColor=Ne(this.primaryColor,this.darkMode),this.secondaryBorderColor=Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ne(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.tertiaryColor),this.lineColor=lt(this.background),this.textColor=lt(this.background),this.background="white",this.mainBkg="#ECECFF",this.secondBkg="#ffffde",this.lineColor="#333333",this.border1="#9370DB",this.primaryBorderColor=Ne(this.primaryColor,this.darkMode),this.border2="#aaaa33",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.labelBackground="rgba(232,232,232, 0.8)",this.textColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="calculated",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.clusterBkg="#FBFBFF",this.sectionBkgColor="calculated",this.altSectionBkgColor="calculated",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="calculated",this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor="calculated",this.taskTextOutsideColor=this.taskTextDarkColor,this.taskTextClickableColor="calculated",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBorderColor="calculated",this.critBkgColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.sectionBkgColor=Qo(102,102,255,.49),this.altSectionBkgColor="white",this.sectionBkgColor2="#fff400",this.taskBorderColor="#534fbc",this.taskBkgColor="#8a90dd",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="#534fbc",this.activeTaskBkgColor="#bfc7ff",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="navy",this.noteFontWeight=this.noteFontWeight||"normal",this.fontWeight=this.fontWeight||"normal",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.rowOdd="calculated",this.rowEven="calculated",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!1,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow(1px 2px 2px rgba(185, 185, 185, 1))",this.updateColors()}updateColors(){this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||W(this.primaryColor,{h:30}),this.cScale4=this.cScale4||W(this.primaryColor,{h:60}),this.cScale5=this.cScale5||W(this.primaryColor,{h:90}),this.cScale6=this.cScale6||W(this.primaryColor,{h:120}),this.cScale7=this.cScale7||W(this.primaryColor,{h:150}),this.cScale8=this.cScale8||W(this.primaryColor,{h:210}),this.cScale9=this.cScale9||W(this.primaryColor,{h:270}),this.cScale10=this.cScale10||W(this.primaryColor,{h:300}),this.cScale11=this.cScale11||W(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||yt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||yt(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=yt(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||yt(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||W(this["cScale"+t],{h:180});for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||W(this.mainBkg,{h:30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||W(this.mainBkg,{h:30,l:-(7+t*5)});if(this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor,this.labelTextColor!=="calculated"){this.cScaleLabel0=this.cScaleLabel0||lt(this.labelTextColor),this.cScaleLabel3=this.cScaleLabel3||lt(this.labelTextColor);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.labelTextColor}this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.textColor,this.edgeLabelBackground=this.labelBackground,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder=this.border1,this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.signalColor=this.textColor,this.signalTextColor=this.textColor,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||pt(this.primaryColor,75)||"#ffffff",this.rowEven=this.rowEven||pt(this.primaryColor,1),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=W(this.primaryColor,{h:64}),this.fillType3=W(this.secondaryColor,{h:64}),this.fillType4=W(this.primaryColor,{h:-64}),this.fillType5=W(this.secondaryColor,{h:-64}),this.fillType6=W(this.primaryColor,{h:128}),this.fillType7=W(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||W(this.tertiaryColor,{l:-40}),this.pie4=this.pie4||W(this.primaryColor,{l:-10}),this.pie5=this.pie5||W(this.secondaryColor,{l:-30}),this.pie6=this.pie6||W(this.tertiaryColor,{l:-20}),this.pie7=this.pie7||W(this.primaryColor,{h:60,l:-20}),this.pie8=this.pie8||W(this.primaryColor,{h:-60,l:-40}),this.pie9=this.pie9||W(this.primaryColor,{h:120,l:-40}),this.pie10=this.pie10||W(this.primaryColor,{h:60,l:-40}),this.pie11=this.pie11||W(this.primaryColor,{h:-90,l:-40}),this.pie12=this.pie12||W(this.primaryColor,{h:120,l:-30}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??W(this.primaryColor,{l:-30}),this.venn2=this.venn2??W(this.secondaryColor,{l:-30}),this.venn3=this.venn3??W(this.tertiaryColor,{l:-40}),this.venn4=this.venn4??W(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??W(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??W(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??W(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??W(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||W(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||W(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||W(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||W(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||W(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||W(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||bi(this.quadrant1Fill)?pt(this.quadrant1Fill):yt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#ECECFF,#8493A6,#FFC3A0,#DCDDE1,#B8E994,#D1A36F,#C3CDE6,#FFB6C1,#496078,#F8F3E3"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.labelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||W(this.primaryColor,{h:-30}),this.git4=this.git4||W(this.primaryColor,{h:-60}),this.git5=this.git5||W(this.primaryColor,{h:-90}),this.git6=this.git6||W(this.primaryColor,{h:60}),this.git7=this.git7||W(this.primaryColor,{h:120}),this.darkMode?(this.git0=pt(this.git0,25),this.git1=pt(this.git1,25),this.git2=pt(this.git2,25),this.git3=pt(this.git3,25),this.git4=pt(this.git4,25),this.git5=pt(this.git5,25),this.git6=pt(this.git6,25),this.git7=pt(this.git7,25)):(this.git0=yt(this.git0,25),this.git1=yt(this.git1,25),this.git2=yt(this.git2,25),this.git3=yt(this.git3,25),this.git4=yt(this.git4,25),this.git5=yt(this.git5,25),this.git6=yt(this.git6,25),this.git7=yt(this.git7,25)),this.gitInv0=this.gitInv0||yt(lt(this.git0),25),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||lt(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||lt(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||go,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||po}calculate(t){if(Object.keys(this).forEach(i=>{this[i]==="calculated"&&(this[i]=void 0)}),typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Vi(this[i],t[i])})}},C(ns,"Theme"),ns),T2=C(e=>{const t=new M2;return t.calculate(e),t},"getThemeVariables"),ls,B2=(ls=class{constructor(){this.background="#f4f4f4",this.primaryColor="#cde498",this.secondaryColor="#cdffb2",this.background="white",this.mainBkg="#cde498",this.secondBkg="#cdffb2",this.lineColor="green",this.border1="#13540c",this.border2="#6eaa49",this.arrowheadColor="green",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.tertiaryColor=pt("#cde498",10),this.primaryBorderColor=Ne(this.primaryColor,this.darkMode),this.secondaryBorderColor=Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ne(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.primaryColor),this.lineColor=lt(this.background),this.textColor=lt(this.background),this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="#333",this.edgeLabelBackground="#e8e8e8",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="black",this.actorLineColor="calculated",this.signalColor="#333",this.signalTextColor="#333",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="#326932",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="#fff5ad",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="#6eaa49",this.altSectionBkgColor="white",this.sectionBkgColor2="#6eaa49",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="#487e3a",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="black",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="lightgrey",this.doneTaskBkgColor="lightgrey",this.doneTaskBorderColor="grey",this.critBorderColor="#ff8888",this.critBkgColor="red",this.todayLineColor="red",this.vertLineColor="#00BFFF",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.5))"}updateColors(){this.actorBorder=yt(this.mainBkg,20),this.actorBkg=this.mainBkg,this.labelBoxBkgColor=this.actorBkg,this.labelTextColor=this.actorTextColor,this.loopTextColor=this.actorTextColor,this.noteBorderColor=this.border2,this.noteTextColor=this.actorTextColor,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||W(this.primaryColor,{h:30}),this.cScale4=this.cScale4||W(this.primaryColor,{h:60}),this.cScale5=this.cScale5||W(this.primaryColor,{h:90}),this.cScale6=this.cScale6||W(this.primaryColor,{h:120}),this.cScale7=this.cScale7||W(this.primaryColor,{h:150}),this.cScale8=this.cScale8||W(this.primaryColor,{h:210}),this.cScale9=this.cScale9||W(this.primaryColor,{h:270}),this.cScale10=this.cScale10||W(this.primaryColor,{h:300}),this.cScale11=this.cScale11||W(this.primaryColor,{h:330}),this.cScalePeer1=this.cScalePeer1||yt(this.secondaryColor,45),this.cScalePeer2=this.cScalePeer2||yt(this.tertiaryColor,40);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScale"+t]=yt(this["cScale"+t],10),this["cScalePeer"+t]=this["cScalePeer"+t]||yt(this["cScale"+t],25);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||W(this["cScale"+t],{h:180});this.scaleLabelColor=this.scaleLabelColor!=="calculated"&&this.scaleLabelColor?this.scaleLabelColor:this.labelTextColor;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||W(this.mainBkg,{h:30,s:-30,l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||W(this.mainBkg,{h:30,s:-30,l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.taskBorderColor=this.border1,this.taskTextColor=this.taskTextLightColor,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.rowOdd=this.rowOdd||pt(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||pt(this.mainBkg,20),this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.primaryBorderColor,this.specialStateColor=this.lineColor,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=W(this.primaryColor,{h:64}),this.fillType3=W(this.secondaryColor,{h:64}),this.fillType4=W(this.primaryColor,{h:-64}),this.fillType5=W(this.secondaryColor,{h:-64}),this.fillType6=W(this.primaryColor,{h:128}),this.fillType7=W(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||W(this.primaryColor,{l:-30}),this.pie5=this.pie5||W(this.secondaryColor,{l:-30}),this.pie6=this.pie6||W(this.tertiaryColor,{h:40,l:-40}),this.pie7=this.pie7||W(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||W(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||W(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||W(this.primaryColor,{h:60,l:-50}),this.pie11=this.pie11||W(this.primaryColor,{h:-60,l:-50}),this.pie12=this.pie12||W(this.primaryColor,{h:120,l:-50}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.venn1=this.venn1??W(this.primaryColor,{l:-30}),this.venn2=this.venn2??W(this.secondaryColor,{l:-30}),this.venn3=this.venn3??W(this.tertiaryColor,{l:-30}),this.venn4=this.venn4??W(this.primaryColor,{h:60,l:-30}),this.venn5=this.venn5??W(this.primaryColor,{h:-60,l:-30}),this.venn6=this.venn6??W(this.secondaryColor,{h:60,l:-30}),this.venn7=this.venn7??W(this.primaryColor,{h:120,l:-30}),this.venn8=this.venn8??W(this.secondaryColor,{h:120,l:-30}),this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B4513",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#C8E6C9",complicatedBg:this.cynefin?.complicatedBg||"#DCEDC8",chaoticBg:this.cynefin?.chaoticBg||"#FFE0B2",clearBg:this.cynefin?.clearBg||"#FFF9C4",confusionBg:this.cynefin?.confusionBg||"#D7CCC8",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||W(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||W(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||W(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||W(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||W(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||W(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||bi(this.quadrant1Fill)?pt(this.quadrant1Fill):yt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.packet={startByteColor:this.primaryTextColor,endByteColor:this.primaryTextColor,labelColor:this.primaryTextColor,titleColor:this.primaryTextColor,blockStrokeColor:this.primaryTextColor,blockFillColor:this.mainBkg},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#CDE498,#FF6B6B,#A0D2DB,#D7BDE2,#F0F0F0,#FFC3A0,#7FD8BE,#FF9A8B,#FAF3E0,#FFF176"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||W(this.primaryColor,{h:-30}),this.git4=this.git4||W(this.primaryColor,{h:-60}),this.git5=this.git5||W(this.primaryColor,{h:-90}),this.git6=this.git6||W(this.primaryColor,{h:60}),this.git7=this.git7||W(this.primaryColor,{h:120}),this.darkMode?(this.git0=pt(this.git0,25),this.git1=pt(this.git1,25),this.git2=pt(this.git2,25),this.git3=pt(this.git3,25),this.git4=pt(this.git4,25),this.git5=pt(this.git5,25),this.git6=pt(this.git6,25),this.git7=pt(this.git7,25)):(this.git0=yt(this.git0,25),this.git1=yt(this.git1,25),this.git2=yt(this.git2,25),this.git3=yt(this.git3,25),this.git4=yt(this.git4,25),this.git5=yt(this.git5,25),this.git6=yt(this.git6,25),this.git7=yt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.gitBranchLabel0=this.gitBranchLabel0||lt(this.labelTextColor),this.gitBranchLabel1=this.gitBranchLabel1||this.labelTextColor,this.gitBranchLabel2=this.gitBranchLabel2||this.labelTextColor,this.gitBranchLabel3=this.gitBranchLabel3||lt(this.labelTextColor),this.gitBranchLabel4=this.gitBranchLabel4||this.labelTextColor,this.gitBranchLabel5=this.gitBranchLabel5||this.labelTextColor,this.gitBranchLabel6=this.gitBranchLabel6||this.labelTextColor,this.gitBranchLabel7=this.gitBranchLabel7||this.labelTextColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||go,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||po}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Vi(this[i],t[i])})}},C(ls,"Theme"),ls),_2=C(e=>{const t=new B2;return t.calculate(e),t},"getThemeVariables"),cs,L2=(cs=class{constructor(){this.primaryColor="#eee",this.contrast="#707070",this.secondaryColor=pt(this.contrast,55),this.background="#ffffff",this.tertiaryColor=W(this.primaryColor,{h:-160}),this.primaryBorderColor=Ne(this.primaryColor,this.darkMode),this.secondaryBorderColor=Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ne(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.tertiaryColor),this.lineColor=lt(this.background),this.textColor=lt(this.background),this.mainBkg="#eee",this.secondBkg="calculated",this.lineColor="#666",this.border1="#999",this.border2="calculated",this.note="#ffa",this.text="#333",this.critical="#d42",this.done="#bbb",this.arrowheadColor="#333333",this.fontFamily='"trebuchet ms", verdana, arial, sans-serif',this.fontSize="16px",this.THEME_COLOR_LIMIT=12,this.radius=5,this.strokeWidth=1,this.nodeBkg="calculated",this.nodeBorder="calculated",this.clusterBkg="calculated",this.clusterBorder="calculated",this.defaultLinkColor="calculated",this.titleColor="calculated",this.edgeLabelBackground="white",this.actorBorder="calculated",this.actorBkg="calculated",this.actorTextColor="calculated",this.actorLineColor=this.actorBorder,this.signalColor="calculated",this.signalTextColor="calculated",this.labelBoxBkgColor="calculated",this.labelBoxBorderColor="calculated",this.labelTextColor="calculated",this.loopTextColor="calculated",this.noteBorderColor="calculated",this.noteBkgColor="calculated",this.noteTextColor="calculated",this.activationBorderColor="#666",this.activationBkgColor="#f4f4f4",this.sequenceNumberColor="white",this.sectionBkgColor="calculated",this.altSectionBkgColor="white",this.sectionBkgColor2="calculated",this.excludeBkgColor="#eeeeee",this.taskBorderColor="calculated",this.taskBkgColor="calculated",this.taskTextLightColor="white",this.taskTextColor="calculated",this.taskTextDarkColor="calculated",this.taskTextOutsideColor="calculated",this.taskTextClickableColor="#003163",this.activeTaskBorderColor="calculated",this.activeTaskBkgColor="calculated",this.gridColor="calculated",this.doneTaskBkgColor="calculated",this.doneTaskBorderColor="calculated",this.critBkgColor="calculated",this.critBorderColor="calculated",this.todayLineColor="calculated",this.vertLineColor="calculated",this.personBorder=this.primaryBorderColor,this.personBkg=this.mainBkg,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal",this.rowOdd=this.rowOdd||pt(this.mainBkg,75)||"#ffffff",this.rowEven=this.rowEven||"#f4f4f4",this.labelColor="black",this.errorBkgColor="#552222",this.errorTextColor="#552222",this.useGradient=!0,this.gradientStart=this.primaryBorderColor,this.gradientStop=this.secondaryBorderColor,this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,1))"}updateColors(){this.secondBkg=pt(this.contrast,55),this.border2=this.contrast,this.actorBorder=pt(this.border1,23),this.actorBkg=this.mainBkg,this.actorTextColor=this.text,this.actorLineColor=this.actorBorder,this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.signalColor=this.text,this.signalTextColor=this.text,this.labelBoxBkgColor=this.actorBkg,this.labelBoxBorderColor=this.actorBorder,this.labelTextColor=this.text,this.loopTextColor=this.text,this.noteBorderColor="#999",this.noteBkgColor="#666",this.noteTextColor="#fff",this.cScale0=this.cScale0||"#555",this.cScale1=this.cScale1||"#F4F4F4",this.cScale2=this.cScale2||"#555",this.cScale3=this.cScale3||"#BBB",this.cScale4=this.cScale4||"#777",this.cScale5=this.cScale5||"#999",this.cScale6=this.cScale6||"#DDD",this.cScale7=this.cScale7||"#FFF",this.cScale8=this.cScale8||"#DDD",this.cScale9=this.cScale9||"#BBB",this.cScale10=this.cScale10||"#999",this.cScale11=this.cScale11||"#777";for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleInv"+t]=this["cScaleInv"+t]||lt(this["cScale"+t]);for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this.darkMode?this["cScalePeer"+t]=this["cScalePeer"+t]||pt(this["cScale"+t],10):this["cScalePeer"+t]=this["cScalePeer"+t]||yt(this["cScale"+t],10);this.scaleLabelColor=this.scaleLabelColor||(this.darkMode?"black":this.labelTextColor),this.cScaleLabel0=this.cScaleLabel0||this.cScale1,this.cScaleLabel2=this.cScaleLabel2||this.cScale1;for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["cScaleLabel"+t]=this["cScaleLabel"+t]||this.scaleLabelColor;for(let t=0;t<5;t++)this["surface"+t]=this["surface"+t]||W(this.mainBkg,{l:-(5+t*5)}),this["surfacePeer"+t]=this["surfacePeer"+t]||W(this.mainBkg,{l:-(8+t*5)});this.nodeBkg=this.mainBkg,this.nodeBorder=this.border1,this.clusterBkg=this.secondBkg,this.clusterBorder=this.border2,this.defaultLinkColor=this.lineColor,this.titleColor=this.text,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.sectionBkgColor=pt(this.contrast,30),this.sectionBkgColor2=pt(this.contrast,30),this.taskBorderColor=yt(this.contrast,10),this.taskBkgColor=this.contrast,this.taskTextColor=this.taskTextLightColor,this.taskTextDarkColor=this.text,this.taskTextOutsideColor=this.taskTextDarkColor,this.activeTaskBorderColor=this.taskBorderColor,this.activeTaskBkgColor=this.mainBkg,this.gridColor=pt(this.border1,30),this.doneTaskBkgColor=this.done,this.doneTaskBorderColor=this.lineColor,this.critBkgColor=this.critical,this.critBorderColor=yt(this.critBkgColor,10),this.todayLineColor=this.critBkgColor,this.vertLineColor=this.critBkgColor,this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.transitionColor=this.transitionColor||"#000",this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f4f4f4",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.stateBorder=this.stateBorder||"#000",this.innerEndBackground=this.primaryBorderColor,this.specialStateColor="#222",this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.classText=this.primaryTextColor,this.fillType0=this.primaryColor,this.fillType1=this.secondaryColor,this.fillType2=W(this.primaryColor,{h:64}),this.fillType3=W(this.secondaryColor,{h:64}),this.fillType4=W(this.primaryColor,{h:-64}),this.fillType5=W(this.secondaryColor,{h:-64}),this.fillType6=W(this.primaryColor,{h:128}),this.fillType7=W(this.secondaryColor,{h:128});for(let t=0;t<this.THEME_COLOR_LIMIT;t++)this["pie"+t]=this["cScale"+t];this.pie12=this.pie0,this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let t=0;t<8;t++)this["venn"+(t+1)]=this["venn"+(t+1)]??this["cScale"+t];this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.cynefin={domainFontSize:this.cynefin?.domainFontSize||16,itemFontSize:this.cynefin?.itemFontSize||12,boundaryColor:this.cynefin?.boundaryColor||this.lineColor,boundaryWidth:this.cynefin?.boundaryWidth||2,cliffColor:this.cynefin?.cliffColor||"#8B0000",cliffWidth:this.cynefin?.cliffWidth||4,arrowColor:this.cynefin?.arrowColor||this.lineColor,arrowWidth:this.cynefin?.arrowWidth||2,complexBg:this.cynefin?.complexBg||"#E8F5E9",complicatedBg:this.cynefin?.complicatedBg||"#E3F2FD",chaoticBg:this.cynefin?.chaoticBg||"#FBE9E7",clearBg:this.cynefin?.clearBg||"#FFF8E1",confusionBg:this.cynefin?.confusionBg||"#F3E5F5",textColor:this.cynefin?.textColor||this.textColor,labelColor:this.cynefin?.labelColor||this.primaryTextColor},this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||W(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||W(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||W(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||W(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||W(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||W(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||bi(this.quadrant1Fill)?pt(this.quadrant1Fill):yt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,dataLabelColor:this.xyChart?.dataLabelColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#EEE,#6BB8E4,#8ACB88,#C7ACD6,#E8DCC2,#FFB2A8,#FFF380,#7E8D91,#FFD8B1,#FAF3E0"},this.radar={axisColor:this.radar?.axisColor||this.lineColor,axisStrokeWidth:this.radar?.axisStrokeWidth||2,axisLabelFontSize:this.radar?.axisLabelFontSize||12,curveOpacity:this.radar?.curveOpacity||.5,curveStrokeWidth:this.radar?.curveStrokeWidth||2,graticuleColor:this.radar?.graticuleColor||"#DEDEDE",graticuleStrokeWidth:this.radar?.graticuleStrokeWidth||1,graticuleOpacity:this.radar?.graticuleOpacity||.3,legendBoxSize:this.radar?.legendBoxSize||12,legendFontSize:this.radar?.legendFontSize||12},this.wardleyEvolutionColor=this.wardleyEvolutionColor||"#dc3545",this.wardley={backgroundColor:this.wardley?.backgroundColor||this.background,axisColor:this.wardley?.axisColor||this.lineColor,axisTextColor:this.wardley?.axisTextColor||this.primaryTextColor,gridColor:this.wardley?.gridColor||this.gridColor,componentFill:this.wardley?.componentFill||this.background,componentStroke:this.wardley?.componentStroke||this.lineColor,componentLabelColor:this.wardley?.componentLabelColor||this.primaryTextColor,linkStroke:this.wardley?.linkStroke||this.lineColor,evolutionStroke:this.wardley?.evolutionStroke||this.wardleyEvolutionColor,annotationStroke:this.wardley?.annotationStroke||this.lineColor,annotationTextColor:this.wardley?.annotationTextColor||this.primaryTextColor,annotationFill:this.wardley?.annotationFill||this.background},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||this.edgeLabelBackground,this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=yt(this.pie1,25)||this.primaryColor,this.git1=this.pie2||this.secondaryColor,this.git2=this.pie3||this.tertiaryColor,this.git3=this.pie4||W(this.primaryColor,{h:-30}),this.git4=this.pie5||W(this.primaryColor,{h:-60}),this.git5=this.pie6||W(this.primaryColor,{h:-90}),this.git6=this.pie7||W(this.primaryColor,{h:60}),this.git7=this.pie8||W(this.primaryColor,{h:120}),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||this.labelTextColor,this.gitBranchLabel0=this.branchLabelColor,this.gitBranchLabel1="white",this.gitBranchLabel2=this.branchLabelColor,this.gitBranchLabel3="white",this.gitBranchLabel4=this.branchLabelColor,this.gitBranchLabel5=this.branchLabelColor,this.gitBranchLabel6=this.branchLabelColor,this.gitBranchLabel7=this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.emUiFill=this.emUiFill||"white",this.emUiStroke=this.emUiStroke||"#dbdada",this.emProcessorFill=this.emProcessorFill||"#edb3f6",this.emProcessorStroke=this.emProcessorStroke||"#b88cbf",this.emReadModelFill=this.emReadModelFill||"#d3f1a2",this.emReadModelStroke=this.emReadModelStroke||"#a3b732",this.emCommandFill=this.emCommandFill||"#bcd6fe",this.emCommandStroke=this.emCommandStroke||"#679ac3",this.emEventFill=this.emEventFill||"#ffb778",this.emEventStroke=this.emEventStroke||"#c19a0f",this.emSwimlaneBackgroundOdd=this.emSwimlaneBackgroundOdd||"rgb(250,250,250)",this.emSwimlaneBackgroundStroke=this.emSwimlaneBackgroundStroke||"rgb(240,240,240)",this.emArrowhead=this.emArrowhead||this.lineColor,this.emRelationStroke=this.emRelationStroke||this.lineColor,this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||go,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||po}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Vi(this[i],t[i])})}},C(cs,"Theme"),cs),A2=C(e=>{const t=new L2;return t.calculate(e),t},"getThemeVariables"),hs,F2=(hs=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=2,this.primaryBorderColor=Ne(this.primaryColor,this.darkMode),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.nodeBorder="#000000",this.stateBorder="#000000",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 0px 1px 2px rgba(0, 0, 0, 0.25));",this.tertiaryColor="#ffffff",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||W(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||W(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Ne(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Ne(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Ne(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||yt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||(bi(this.background)?pt(this.background,4):yt(this.background,4));const t="#ECECFE",r="#E9E9F1",i=W(t,{h:180,l:5});if(this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||pt(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||t,this.cScale1=this.cScale1||r,this.cScale2=this.cScale2||i,this.cScale3=this.cScale3||W(t,{h:30}),this.cScale4=this.cScale4||W(t,{h:60}),this.cScale5=this.cScale5||W(t,{h:90}),this.cScale6=this.cScale6||W(t,{h:120}),this.cScale7=this.cScale7||W(t,{h:150}),this.cScale8=this.cScale8||W(t,{h:210,l:150}),this.cScale9=this.cScale9||W(t,{h:270}),this.cScale10=this.cScale10||W(t,{h:300}),this.cScale11=this.cScale11||W(t,{h:330}),this.darkMode)for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScale"+a]=yt(this["cScale"+a],75);else for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScale"+a]=yt(this["cScale"+a],25);for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScaleInv"+a]=this["cScaleInv"+a]||lt(this["cScale"+a]);for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this.darkMode?this["cScalePeer"+a]=this["cScalePeer"+a]||pt(this["cScale"+a],10):this["cScalePeer"+a]=this["cScalePeer"+a]||yt(this["cScale"+a],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScaleLabel"+a]=this["cScaleLabel"+a]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let a=0;a<5;a++)this["surface"+a]=this["surface"+a]||W(this.mainBkg,{h:180,s:-15,l:o*(5+a*3)}),this["surfacePeer"+a]=this["surfacePeer"+a]||W(this.mainBkg,{h:180,s:-15,l:o*(8+a*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||W(t,{h:64}),this.fillType3=this.fillType3||W(r,{h:64}),this.fillType4=this.fillType4||W(t,{h:-64}),this.fillType5=this.fillType5||W(r,{h:-64}),this.fillType6=this.fillType6||W(t,{h:128}),this.fillType7=this.fillType7||W(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||W(t,{l:-10}),this.pie5=this.pie5||W(r,{l:-10}),this.pie6=this.pie6||W(i,{l:-10}),this.pie7=this.pie7||W(t,{h:60,l:-10}),this.pie8=this.pie8||W(t,{h:-60,l:-10}),this.pie9=this.pie9||W(t,{h:120,l:0}),this.pie10=this.pie10||W(t,{h:60,l:-20}),this.pie11=this.pie11||W(t,{h:-60,l:-20}),this.pie12=this.pie12||W(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||W(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||W(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||W(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||W(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||W(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||W(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||bi(this.quadrant1Fill)?pt(this.quadrant1Fill):yt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||W(t,{h:-30}),this.git4=this.git4||W(t,{h:-60}),this.git5=this.git5||W(t,{h:-90}),this.git6=this.git6||W(t,{h:60}),this.git7=this.git7||W(t,{h:120}),this.darkMode?(this.git0=pt(this.git0,25),this.git1=pt(this.git1,25),this.git2=pt(this.git2,25),this.git3=pt(this.git3,25),this.git4=pt(this.git4,25),this.git5=pt(this.git5,25),this.git6=pt(this.git6,25),this.git7=pt(this.git7,25)):(this.git0=yt(this.git0,25),this.git1=yt(this.git1,25),this.git2=yt(this.git2,25),this.git3=yt(this.git3,25),this.git4=yt(this.git4,25),this.git5=yt(this.git5,25),this.git6=yt(this.git6,25),this.git7=yt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||go,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||po}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Vi(this[i],t[i])})}},C(hs,"Theme"),hs),$2=C(e=>{const t=new F2;return t.calculate(e),t},"getThemeVariables"),ds,E2=(ds=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=pt(this.primaryColor,16),this.tertiaryColor=W(this.primaryColor,{h:-160}),this.primaryBorderColor=lt(this.background),this.secondaryBorderColor=Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ne(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.tertiaryColor),this.mainBkg="#2a2020",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=pt(lt("#323D47"),10),this.border1="#ccc",this.border2=Qo(255,255,255,.25),this.arrowheadColor=lt(this.background),this.fontFamily="arial, sans-serif",this.fontSize="14px",this.labelBackground="#181818",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=3,this.strokeWidth=1,this.noteBkgColor="#fff5ad",this.noteTextColor="#333",this.THEME_COLOR_LIMIT=12,this.fontFamily="arial, sans-serif",this.fontSize="14px",this.useGradient=!0,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="drop-shadow( 1px 2px 2px rgba(185,185,185,0.2))",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.noteFontWeight="normal",this.fontWeight="normal"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#333"),this.secondaryColor=this.secondaryColor||W(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||W(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Ne(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Ne(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Ne(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#333",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.secondBkg=this.secondBkg==="calculated"?pt(this.mainBkg,16):this.secondBkg,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||yt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||pt(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||this.secondBkg,this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||W(this.primaryColor,{h:30}),this.cScale4=this.cScale4||W(this.primaryColor,{h:60}),this.cScale5=this.cScale5||W(this.primaryColor,{h:90}),this.cScale6=this.cScale6||W(this.primaryColor,{h:120}),this.cScale7=this.cScale7||W(this.primaryColor,{h:150}),this.cScale8=this.cScale8||W(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||W(this.primaryColor,{h:270}),this.cScale10=this.cScale10||W(this.primaryColor,{h:300}),this.cScale11=this.cScale11||W(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=yt(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=yt(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||lt(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||pt(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||yt(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||W(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||W(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||W(this.primaryColor,{h:64}),this.fillType3=this.fillType3||W(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||W(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||W(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||W(this.primaryColor,{h:128}),this.fillType7=this.fillType7||W(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||W(this.primaryColor,{l:-10}),this.pie5=this.pie5||W(this.secondaryColor,{l:-10}),this.pie6=this.pie6||W(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||W(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||W(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||W(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||W(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||W(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||W(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||W(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||W(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||W(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||W(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||W(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||W(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||bi(this.quadrant1Fill)?pt(this.quadrant1Fill):yt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.git0=this.git0||"#0b0000",this.git1=this.git1||"#4d1037",this.git2=this.git2||"#3f5258",this.git3=this.git3||"#4f2f1b",this.git4=this.git4||"#6e0a0a",this.git5=this.git5||"#3b0048",this.git6=this.git6||"#995a01",this.git7=this.git7||"#154706",this.gitDarkMode=!0,this.gitDarkMode?(this.git0=pt(this.git0,25),this.git1=pt(this.git1,25),this.git2=pt(this.git2,25),this.git3=pt(this.git3,25),this.git4=pt(this.git4,25),this.git5=pt(this.git5,25),this.git6=pt(this.git6,25),this.git7=pt(this.git7,25)):(this.git0=yt(this.git0,25),this.git1=yt(this.git1,25),this.git2=yt(this.git2,25),this.git3=yt(this.git3,25),this.git4=yt(this.git4,25),this.git5=yt(this.git5,25),this.git6=yt(this.git6,25),this.git7=yt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||go,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||po}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Vi(this[i],t[i])})}},C(ds,"Theme"),ds),P2=C(e=>{const t=new E2;return t.calculate(e),t},"getThemeVariables"),us,I2=(us=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=Ne("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||W(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||W(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Ne(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Ne(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Ne(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#FEF9C3",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.noteFontWeight=600,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||yt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||(bi(this.background)?pt(this.background,4):yt(this.background,4));const t="#ECECFE",r="#E9E9F1",i=W(t,{h:180,l:5});this.sectionBkgColor=this.sectionBkgColor||i,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||r,this.sectionBkgColor2=this.sectionBkgColor2||t,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||pt(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.compositeTitleBackground="#F9F9FB",this.altBackground="#F9F9FB",this.stateEdgeLabelBackground="#FFFFFF",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor;for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScale"+a]=this.mainBkg;if(this.darkMode)for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScale"+a]=yt(this["cScale"+a],75);else for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScale"+a]=yt(this["cScale"+a],25);for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScaleInv"+a]=this["cScaleInv"+a]||lt(this["cScale"+a]);for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this.darkMode?this["cScalePeer"+a]=this["cScalePeer"+a]||pt(this["cScale"+a],10):this["cScalePeer"+a]=this["cScalePeer"+a]||yt(this["cScale"+a],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScaleLabel"+a]=this["cScaleLabel"+a]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let a=0;a<5;a++)this["surface"+a]=this["surface"+a]||W(this.mainBkg,{h:180,s:-15,l:o*(5+a*3)}),this["surfacePeer"+a]=this["surfacePeer"+a]||W(this.mainBkg,{h:180,s:-15,l:o*(8+a*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||t,this.fillType1=this.fillType1||r,this.fillType2=this.fillType2||W(t,{h:64}),this.fillType3=this.fillType3||W(r,{h:64}),this.fillType4=this.fillType4||W(t,{h:-64}),this.fillType5=this.fillType5||W(r,{h:-64}),this.fillType6=this.fillType6||W(t,{h:128}),this.fillType7=this.fillType7||W(r,{h:128}),this.pie1=this.pie1||t,this.pie2=this.pie2||r,this.pie3=this.pie3||i,this.pie4=this.pie4||W(t,{l:-10}),this.pie5=this.pie5||W(r,{l:-10}),this.pie6=this.pie6||W(i,{l:-10}),this.pie7=this.pie7||W(t,{h:60,l:-10}),this.pie8=this.pie8||W(t,{h:-60,l:-10}),this.pie9=this.pie9||W(t,{h:120,l:0}),this.pie10=this.pie10||W(t,{h:60,l:-20}),this.pie11=this.pie11||W(t,{h:-60,l:-20}),this.pie12=this.pie12||W(t,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||W(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||W(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||W(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||W(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||W(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||W(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||bi(this.quadrant1Fill)?pt(this.quadrant1Fill):yt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#FFFFFF",this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||W(t,{h:-30}),this.git4=this.git4||W(t,{h:-60}),this.git5=this.git5||W(t,{h:-90}),this.git6=this.git6||W(t,{h:60}),this.git7=this.git7||W(t,{h:120}),this.darkMode?(this.git0=pt(this.git0,25),this.git1=pt(this.git1,25),this.git2=pt(this.git2,25),this.git3=pt(this.git3,25),this.git4=pt(this.git4,25),this.git5=pt(this.git5,25),this.git6=pt(this.git6,25),this.git7=pt(this.git7,25)):(this.git0=yt(this.git0,25),this.git1=yt(this.git1,25),this.git2=yt(this.git2,25),this.git3=yt(this.git3,25),this.git4=yt(this.git4,25),this.git5=yt(this.git5,25),this.git6=yt(this.git6,25),this.git7=yt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.erEdgeLabelBackground="#FFFFFF",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||go,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||po}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Vi(this[i],t[i])})}},C(us,"Theme"),us),O2=C(e=>{const t=new I2;return t.calculate(e),t},"getThemeVariables"),fs,D2=(fs=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=pt(this.primaryColor,16),this.tertiaryColor=W(this.primaryColor,{h:-160}),this.primaryBorderColor=lt(this.background),this.secondaryBorderColor=Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ne(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=pt(lt("#323D47"),10),this.border1="#ccc",this.border2=Qo(255,255,255,.25),this.arrowheadColor=lt(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.filterColor="#FFFFFF"}updateColors(){if(this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||W(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||W(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Ne(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Ne(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Ne(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.secondBkg=this.secondBkg==="calculated"?pt(this.mainBkg,16):this.secondBkg,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||yt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.sectionBkgColor=this.sectionBkgColor||this.tertiaryColor,this.altSectionBkgColor=this.altSectionBkgColor||"white",this.sectionBkgColor=this.sectionBkgColor||this.secondaryColor,this.sectionBkgColor2=this.sectionBkgColor2||this.primaryColor,this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||pt(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||this.secondBkg,this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.compositeBackground="#16141F",this.altBackground="#16141F",this.compositeTitleBackground="#16141F",this.stateEdgeLabelBackground="#16141F",this.fontWeight=600,this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#f0f0f0",this.compositeTitleBackground=this.compositeTitleBackground||this.mainBkg,this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||this.primaryColor,this.cScale1=this.cScale1||this.secondaryColor,this.cScale2=this.cScale2||this.tertiaryColor,this.cScale3=this.cScale3||W(this.primaryColor,{h:30}),this.cScale4=this.cScale4||W(this.primaryColor,{h:60}),this.cScale5=this.cScale5||W(this.primaryColor,{h:90}),this.cScale6=this.cScale6||W(this.primaryColor,{h:120}),this.cScale7=this.cScale7||W(this.primaryColor,{h:150}),this.cScale8=this.cScale8||W(this.primaryColor,{h:210,l:150}),this.cScale9=this.cScale9||W(this.primaryColor,{h:270}),this.cScale10=this.cScale10||W(this.primaryColor,{h:300}),this.cScale11=this.cScale11||W(this.primaryColor,{h:330}),this.darkMode)for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=yt(this["cScale"+r],75);else for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScale"+r]=yt(this["cScale"+r],25);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleInv"+r]=this["cScaleInv"+r]||lt(this["cScale"+r]);for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this.darkMode?this["cScalePeer"+r]=this["cScalePeer"+r]||pt(this["cScale"+r],10):this["cScalePeer"+r]=this["cScalePeer"+r]||yt(this["cScale"+r],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let r=0;r<this.THEME_COLOR_LIMIT;r++)this["cScaleLabel"+r]=this["cScaleLabel"+r]||this.scaleLabelColor;const t=this.darkMode?-4:-1;for(let r=0;r<5;r++)this["surface"+r]=this["surface"+r]||W(this.mainBkg,{h:180,s:-15,l:t*(5+r*3)}),this["surfacePeer"+r]=this["surfacePeer"+r]||W(this.mainBkg,{h:180,s:-15,l:t*(8+r*3)});this.classText=this.classText||this.textColor,this.fillType0=this.fillType0||this.primaryColor,this.fillType1=this.fillType1||this.secondaryColor,this.fillType2=this.fillType2||W(this.primaryColor,{h:64}),this.fillType3=this.fillType3||W(this.secondaryColor,{h:64}),this.fillType4=this.fillType4||W(this.primaryColor,{h:-64}),this.fillType5=this.fillType5||W(this.secondaryColor,{h:-64}),this.fillType6=this.fillType6||W(this.primaryColor,{h:128}),this.fillType7=this.fillType7||W(this.secondaryColor,{h:128}),this.pie1=this.pie1||this.primaryColor,this.pie2=this.pie2||this.secondaryColor,this.pie3=this.pie3||this.tertiaryColor,this.pie4=this.pie4||W(this.primaryColor,{l:-10}),this.pie5=this.pie5||W(this.secondaryColor,{l:-10}),this.pie6=this.pie6||W(this.tertiaryColor,{l:-10}),this.pie7=this.pie7||W(this.primaryColor,{h:60,l:-10}),this.pie8=this.pie8||W(this.primaryColor,{h:-60,l:-10}),this.pie9=this.pie9||W(this.primaryColor,{h:120,l:0}),this.pie10=this.pie10||W(this.primaryColor,{h:60,l:-20}),this.pie11=this.pie11||W(this.primaryColor,{h:-60,l:-20}),this.pie12=this.pie12||W(this.primaryColor,{h:120,l:-10}),this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7",this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||W(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||W(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||W(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||W(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||W(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||W(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||bi(this.quadrant1Fill)?pt(this.quadrant1Fill):yt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#16141F",this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||W(this.primaryColor,{h:-30}),this.git4=this.git4||W(this.primaryColor,{h:-60}),this.git5=this.git5||W(this.primaryColor,{h:-90}),this.git6=this.git6||W(this.primaryColor,{h:60}),this.git7=this.git7||W(this.primaryColor,{h:120}),this.darkMode?(this.git0=pt(this.git0,25),this.git1=pt(this.git1,25),this.git2=pt(this.git2,25),this.git3=pt(this.git3,25),this.git4=pt(this.git4,25),this.git5=pt(this.git5,25),this.git6=pt(this.git6,25),this.git7=pt(this.git7,25)):(this.git0=yt(this.git0,25),this.git1=yt(this.git1,25),this.git2=yt(this.git2,25),this.git3=yt(this.git3,25),this.git4=yt(this.git4,25),this.git5=yt(this.git5,25),this.git6=yt(this.git6,25),this.git7=yt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.erEdgeLabelBackground="#16141F",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||go,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||po}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Vi(this[i],t[i])})}},C(fs,"Theme"),fs),R2=C(e=>{const t=new D2;return t.calculate(e),t},"getThemeVariables"),gs,N2=(gs=class{constructor(){this.background="#ffffff",this.primaryColor="#cccccc",this.mainBkg="#ffffff",this.noteBkgColor="#fff5ad",this.noteTextColor="#28253D",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.primaryBorderColor=Ne("#28253D",this.darkMode),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#28253D",this.stateBorder="#28253D",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.tertiaryColor="#ffffff",this.clusterBkg="#F9F9FB",this.clusterBorder="#BDBCCC",this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.actorBorder="#28253D",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=["#FDF4FF","#F0FDFA","#FFF7ED","#ECFEFF","#F0FDF4","#F5F3FF","#FEF2F2","#FEFCE8","#EEF2FF","#F7FEE7","#F0F9FF","#FFF1F2"],this.usecaseActorBorder="#A78BFA",this.usecaseActorBkg="#F5F3FF",this.usecaseBorder="#2DD4BF",this.usecaseBkg="#F0FDFA",this.usecaseBoundaryBorder="#BDBCCC",this.usecaseBoundaryBkg="#FAFAFC",this.usecaseIncludeLine="#38BDF8",this.usecaseExtendLine="#FB923C",this.filterColor="#000000"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#28253D"),this.secondaryColor=this.secondaryColor||W(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||W(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Ne(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Ne(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Ne(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#28253D",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.nodeBorder=this.nodeBorder||this.primaryBorderColor,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||yt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||(bi(this.background)?pt(this.background,4):yt(this.background,4));const t="#ECECFE",r="#E9E9F1",i=W(t,{h:180,l:5});this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||t,this.activeTaskBorderColor=this.activeTaskBorderColor||t,this.activeTaskBkgColor=this.activeTaskBkgColor||pt(t,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||"lightgrey",this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateEdgeLabelBackground=this.stateEdgeLabelBackground||"#FFFFFF",this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||this.background||this.tertiaryColor,this.altBackground=this.altBackground||"#F9F9FB",this.compositeTitleBackground=this.compositeTitleBackground||"#F9F9FB",this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad",this.sectionBkgColor=this.sectionBkgColor||this.cScale0,this.sectionBkgColor2=this.sectionBkgColor2||this.cScale1,this.altSectionBkgColor=this.altSectionBkgColor||"white";for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScaleInv"+a]=this["cScaleInv"+a]||lt(this["cScale"+a]);for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this.darkMode?this["cScalePeer"+a]=this["cScalePeer"+a]||pt(this["cScale"+a],10):this["cScalePeer"+a]=this["cScalePeer"+a]||yt(this["cScale"+a],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["cScaleLabel"+a]=this["cScaleLabel"+a]||this.scaleLabelColor;const o=this.darkMode?-4:-1;for(let a=0;a<5;a++)this["surface"+a]=this["surface"+a]||W(this.mainBkg,{h:180,s:-15,l:o*(5+a*3)}),this["surfacePeer"+a]=this["surfacePeer"+a]||W(this.mainBkg,{h:180,s:-15,l:o*(8+a*3)});this.classText=this.classText||this.textColor;for(let a=0;a<8;a++)this["fillType"+a]=this["fillType"+a]||this.bkgColorArray[a];for(let a=0;a<this.THEME_COLOR_LIMIT;a++)this["pie"+(a+1)]=this["pie"+(a+1)]||this["cScale"+a];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||this.textColor,this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let a=0;a<8;a++)this["venn"+(a+1)]=this["venn"+(a+1)]??this.borderColorArray[a%this.borderColorArray.length];this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||t,this.quadrant2Fill=this.quadrant2Fill||W(t,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||W(t,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||W(t,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||W(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||W(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||W(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||bi(this.quadrant1Fill)?pt(this.quadrant1Fill):yt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||t,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#FFFFFF",this.git0=this.git0||t,this.git1=this.git1||r,this.git2=this.git2||i,this.git3=this.git3||W(t,{h:-30}),this.git4=this.git4||W(t,{h:-60}),this.git5=this.git5||W(t,{h:-90}),this.git6=this.git6||W(t,{h:60}),this.git7=this.git7||W(t,{h:120}),this.darkMode?(this.git0=pt(this.git0,25),this.git1=pt(this.git1,25),this.git2=pt(this.git2,25),this.git3=pt(this.git3,25),this.git4=pt(this.git4,25),this.git5=pt(this.git5,25),this.git6=pt(this.git6,25),this.git7=pt(this.git7,25)):(this.git0=yt(this.git0,25),this.git1=yt(this.git1,25),this.git2=yt(this.git2,25),this.git3=yt(this.git3,25),this.git4=yt(this.git4,25),this.git5=yt(this.git5,25),this.git6=yt(this.git6,25),this.git7=yt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLineColor=this.commitLineColor??"#BDBCCC",this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.fontWeight=600,this.erEdgeLabelBackground="#FFFFFF",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||go,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||po}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Vi(this[i],t[i])})}},C(gs,"Theme"),gs),q2=C(e=>{const t=new N2;return t.calculate(e),t},"getThemeVariables"),ps,W2=(ps=class{constructor(){this.background="#333",this.primaryColor="#1f2020",this.secondaryColor=pt(this.primaryColor,16),this.tertiaryColor=W(this.primaryColor,{h:-160}),this.primaryBorderColor=lt(this.background),this.secondaryBorderColor=Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=Ne(this.tertiaryColor,this.darkMode),this.primaryTextColor=lt(this.primaryColor),this.secondaryTextColor=lt(this.secondaryColor),this.tertiaryTextColor=lt(this.tertiaryColor),this.mainBkg="#111113",this.secondBkg="calculated",this.mainContrastColor="lightgrey",this.darkTextColor=pt(lt("#323D47"),10),this.border1="#ccc",this.border2=Qo(255,255,255,.25),this.arrowheadColor=lt(this.background),this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.labelBackground="#111113",this.textColor="#ccc",this.THEME_COLOR_LIMIT=12,this.radius=12,this.strokeWidth=2,this.noteBkgColor=this.noteBkgColor??"#FEF9C3",this.noteTextColor=this.noteTextColor??"#28253D",this.THEME_COLOR_LIMIT=12,this.fontFamily='"Recursive Variable", arial, sans-serif',this.fontSize="14px",this.nodeBorder="#FFFFFF",this.stateBorder="#FFFFFF",this.useGradient=!1,this.gradientStart="#0042eb",this.gradientStop="#eb0042",this.dropShadow="url(#drop-shadow)",this.nodeShadow=!0,this.archEdgeColor="calculated",this.archEdgeArrowColor="calculated",this.archEdgeWidth="3",this.archGroupBorderColor=this.primaryBorderColor,this.archGroupBorderWidth="2px",this.clusterBkg="#1E1A2E",this.clusterBorder="#BDBCCC",this.noteBorderColor="#FACC15",this.noteFontWeight=600,this.borderColorArray=["#E879F9","#2DD4BF","#FB923C","#22D3EE","#4ADE80","#A78BFA","#F87171","#FACC15","#818CF8","#A3E635 ","#38BDF8","#FB7185"],this.bkgColorArray=[],this.usecaseActorBorder="#A78BFA",this.usecaseBorder="#2DD4BF",this.usecaseBoundaryBorder="#BDBCCC",this.usecaseIncludeLine="#38BDF8",this.usecaseExtendLine="#FB923C",this.filterColor="#FFFFFF"}updateColors(){this.primaryTextColor=this.primaryTextColor||(this.darkMode?"#eee":"#FFFFFF"),this.secondaryColor=this.secondaryColor||W(this.primaryColor,{h:-120}),this.tertiaryColor=this.tertiaryColor||W(this.primaryColor,{h:180,l:5}),this.primaryBorderColor=this.primaryBorderColor||Ne(this.primaryColor,this.darkMode),this.secondaryBorderColor=this.secondaryBorderColor||Ne(this.secondaryColor,this.darkMode),this.tertiaryBorderColor=this.tertiaryBorderColor||Ne(this.tertiaryColor,this.darkMode),this.noteBorderColor=this.noteBorderColor||Ne(this.noteBkgColor,this.darkMode),this.noteBkgColor=this.noteBkgColor||"#fff5ad",this.noteTextColor=this.noteTextColor||"#FFFFFF",this.secondaryTextColor=this.secondaryTextColor||lt(this.secondaryColor),this.tertiaryTextColor=this.tertiaryTextColor||lt(this.tertiaryColor),this.lineColor=this.lineColor||lt(this.background),this.arrowheadColor=this.arrowheadColor||lt(this.background),this.textColor=this.textColor||this.primaryTextColor,this.border2=this.border2||this.tertiaryBorderColor,this.nodeBkg=this.nodeBkg||this.primaryColor,this.mainBkg=this.mainBkg||this.primaryColor,this.secondBkg=this.secondBkg==="calculated"?pt(this.mainBkg,16):this.secondBkg,this.nodeBorder=this.nodeBorder||this.border1,this.clusterBkg=this.clusterBkg||this.tertiaryColor,this.clusterBorder=this.clusterBorder||this.tertiaryBorderColor,this.defaultLinkColor=this.defaultLinkColor||this.lineColor,this.titleColor=this.titleColor||this.tertiaryTextColor,this.edgeLabelBackground=this.edgeLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.nodeTextColor=this.nodeTextColor||this.primaryTextColor,this.flowContainerStroke=this.flowContainerStroke||this.secondaryBorderColor,this.actorBorder="#FFFFFF",this.signalColor="#FFFFFF",this.labelBoxBorderColor="#BDBCCC",this.actorBorder=this.actorBorder||this.primaryBorderColor,this.actorBkg=this.actorBkg||this.mainBkg,this.actorTextColor=this.actorTextColor||this.primaryTextColor,this.actorLineColor=this.actorLineColor||this.actorBorder,this.labelBoxBkgColor=this.labelBoxBkgColor||this.actorBkg,this.signalColor=this.signalColor||this.textColor,this.signalTextColor=this.signalTextColor||this.textColor,this.labelBoxBorderColor=this.labelBoxBorderColor||this.actorBorder,this.labelTextColor=this.labelTextColor||this.actorTextColor,this.loopTextColor=this.loopTextColor||this.actorTextColor,this.activationBorderColor=this.activationBorderColor||yt(this.secondaryColor,10),this.activationBkgColor=this.activationBkgColor||this.secondaryColor,this.sequenceNumberColor=this.sequenceNumberColor||lt(this.lineColor),this.rectBkgColor=this.rectBkgColor||this.tertiaryColor,this.rootLabelColor="#FFFFFF",this.excludeBkgColor=this.excludeBkgColor||"#eeeeee",this.taskBorderColor=this.taskBorderColor||this.primaryBorderColor,this.taskBkgColor=this.taskBkgColor||this.primaryColor,this.activeTaskBorderColor=this.activeTaskBorderColor||this.primaryColor,this.activeTaskBkgColor=this.activeTaskBkgColor||pt(this.primaryColor,23),this.gridColor=this.gridColor||"lightgrey",this.doneTaskBkgColor=this.doneTaskBkgColor||this.secondBkg,this.doneTaskBorderColor=this.doneTaskBorderColor||"grey",this.critBorderColor=this.critBorderColor||"#ff8888",this.critBkgColor=this.critBkgColor||"red",this.todayLineColor=this.todayLineColor||"red",this.taskTextColor=this.taskTextColor||this.textColor,this.vertLineColor=this.vertLineColor||this.primaryBorderColor,this.taskTextOutsideColor=this.taskTextOutsideColor||this.textColor,this.taskTextLightColor=this.taskTextLightColor||this.textColor,this.taskTextColor=this.taskTextColor||this.primaryTextColor,this.taskTextDarkColor=this.taskTextDarkColor||this.textColor,this.taskTextClickableColor=this.taskTextClickableColor||"#003163",this.archEdgeColor=this.lineColor,this.archEdgeArrowColor=this.lineColor,this.personBorder=this.personBorder||this.primaryBorderColor,this.personBkg=this.personBkg||this.mainBkg,this.transitionColor=this.transitionColor||this.lineColor,this.transitionLabelColor=this.transitionLabelColor||this.textColor,this.stateLabelColor=this.stateLabelColor||this.stateBkg||this.primaryTextColor,this.stateEdgeLabelBackground=this.stateEdgeLabelBackground||"#16141F",this.stateBkg=this.stateBkg||this.mainBkg,this.labelBackgroundColor=this.labelBackgroundColor||this.stateBkg,this.compositeBackground=this.compositeBackground||"#16141F",this.altBackground=this.altBackground||"#16141F",this.compositeTitleBackground=this.compositeTitleBackground||"#16141F",this.compositeBorder=this.compositeBorder||this.nodeBorder,this.innerEndBackground=this.nodeBorder,this.errorBkgColor=this.errorBkgColor||this.tertiaryColor,this.errorTextColor=this.errorTextColor||this.tertiaryTextColor,this.transitionColor=this.transitionColor||this.lineColor,this.specialStateColor=this.lineColor,this.cScale0=this.cScale0||"#f4a8ff",this.cScale1=this.cScale1||"#46ecd5",this.cScale2=this.cScale2||"#ffb86a",this.cScale3=this.cScale3||"#dab2ff",this.cScale4=this.cScale4||"#7bf1a8",this.cScale5=this.cScale5||"#c4b4ff",this.cScale6=this.cScale6||"#ffa2a2",this.cScale7=this.cScale7||"#ffdf20",this.cScale8=this.cScale8||"#a3b3ff",this.cScale9=this.cScale9||"#bbf451",this.cScale10=this.cScale10||"#74d4ff",this.cScale11=this.cScale11||"#ffa1ad",this.sectionBkgColor=this.sectionBkgColor||this.cScale0,this.sectionBkgColor2=this.sectionBkgColor2||this.cScale1,this.altSectionBkgColor=this.altSectionBkgColor||this.background;for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScaleInv"+i]=this["cScaleInv"+i]||lt(this["cScale"+i]);for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this.darkMode?this["cScalePeer"+i]=this["cScalePeer"+i]||pt(this["cScale"+i],10):this["cScalePeer"+i]=this["cScalePeer"+i]||yt(this["cScale"+i],10);this.scaleLabelColor=this.scaleLabelColor||this.labelTextColor;for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["cScaleLabel"+i]=yt(this["cScale"+i],75);const t=this.darkMode?-4:-1;for(let i=0;i<5;i++)this["surface"+i]=this["surface"+i]||W(this.mainBkg,{h:180,s:-15,l:t*(5+i*3)}),this["surfacePeer"+i]=this["surfacePeer"+i]||W(this.mainBkg,{h:180,s:-15,l:t*(8+i*3)});this.classText=this.classText||this.textColor,["#701a75","#134e4a","#7c2d12","#581c87","#14532d","#4c1d95","#7f1d1d","#713f12"].forEach((i,o)=>{this["fillType"+o]=this["fillType"+o]||i});for(let i=0;i<this.THEME_COLOR_LIMIT;i++)this["pie"+(i+1)]=this["pie"+(i+1)]||this["cScale"+i];this.pieTitleTextSize=this.pieTitleTextSize||"25px",this.pieTitleTextColor=this.pieTitleTextColor||this.taskTextDarkColor,this.pieSectionTextSize=this.pieSectionTextSize||"17px",this.pieSectionTextColor=this.pieSectionTextColor||"#28253D",this.pieLegendTextSize=this.pieLegendTextSize||"17px",this.pieLegendTextColor=this.pieLegendTextColor||this.taskTextDarkColor,this.pieStrokeColor=this.pieStrokeColor||"black",this.pieStrokeWidth=this.pieStrokeWidth||"2px",this.pieOuterStrokeWidth=this.pieOuterStrokeWidth||"2px",this.pieOuterStrokeColor=this.pieOuterStrokeColor||"black",this.pieOpacity=this.pieOpacity||"0.7";for(let i=0;i<8;i++)this["venn"+(i+1)]=this["venn"+(i+1)]??this.borderColorArray[i%this.borderColorArray.length];this.vennTitleTextColor=this.vennTitleTextColor??this.titleColor,this.vennSetTextColor=this.vennSetTextColor??this.textColor,this.quadrant1Fill=this.quadrant1Fill||this.primaryColor,this.quadrant2Fill=this.quadrant2Fill||W(this.primaryColor,{r:5,g:5,b:5}),this.quadrant3Fill=this.quadrant3Fill||W(this.primaryColor,{r:10,g:10,b:10}),this.quadrant4Fill=this.quadrant4Fill||W(this.primaryColor,{r:15,g:15,b:15}),this.quadrant1TextFill=this.quadrant1TextFill||this.primaryTextColor,this.quadrant2TextFill=this.quadrant2TextFill||W(this.primaryTextColor,{r:-5,g:-5,b:-5}),this.quadrant3TextFill=this.quadrant3TextFill||W(this.primaryTextColor,{r:-10,g:-10,b:-10}),this.quadrant4TextFill=this.quadrant4TextFill||W(this.primaryTextColor,{r:-15,g:-15,b:-15}),this.quadrantPointFill=this.quadrantPointFill||bi(this.quadrant1Fill)?pt(this.quadrant1Fill):yt(this.quadrant1Fill),this.quadrantPointTextFill=this.quadrantPointTextFill||this.primaryTextColor,this.quadrantXAxisTextFill=this.quadrantXAxisTextFill||this.primaryTextColor,this.quadrantYAxisTextFill=this.quadrantYAxisTextFill||this.primaryTextColor,this.quadrantInternalBorderStrokeFill=this.quadrantInternalBorderStrokeFill||this.primaryBorderColor,this.quadrantExternalBorderStrokeFill=this.quadrantExternalBorderStrokeFill||this.primaryBorderColor,this.quadrantTitleFill=this.quadrantTitleFill||this.primaryTextColor,this.xyChart={backgroundColor:this.xyChart?.backgroundColor||this.background,titleColor:this.xyChart?.titleColor||this.primaryTextColor,legendTextColor:this.xyChart?.legendTextColor||this.primaryTextColor,xAxisTitleColor:this.xyChart?.xAxisTitleColor||this.primaryTextColor,xAxisLabelColor:this.xyChart?.xAxisLabelColor||this.primaryTextColor,xAxisTickColor:this.xyChart?.xAxisTickColor||this.primaryTextColor,xAxisLineColor:this.xyChart?.xAxisLineColor||this.primaryTextColor,yAxisTitleColor:this.xyChart?.yAxisTitleColor||this.primaryTextColor,yAxisLabelColor:this.xyChart?.yAxisLabelColor||this.primaryTextColor,yAxisTickColor:this.xyChart?.yAxisTickColor||this.primaryTextColor,yAxisLineColor:this.xyChart?.yAxisLineColor||this.primaryTextColor,plotColorPalette:this.xyChart?.plotColorPalette||"#FFF4DD,#FFD8B1,#FFA07A,#ECEFF1,#D6DBDF,#C3E0A8,#FFB6A4,#FFD74D,#738FA7,#FFFFF0"},this.requirementBackground=this.requirementBackground||this.primaryColor,this.requirementBorderColor=this.requirementBorderColor||this.primaryBorderColor,this.requirementBorderSize=this.requirementBorderSize||"1",this.requirementTextColor=this.requirementTextColor||this.primaryTextColor,this.relationColor=this.relationColor||this.lineColor,this.relationLabelBackground=this.relationLabelBackground||(this.darkMode?yt(this.secondaryColor,30):this.secondaryColor),this.relationLabelColor=this.relationLabelColor||this.actorTextColor,this.requirementEdgeLabelBackground="#16141F",this.git0=this.git0||this.primaryColor,this.git1=this.git1||this.secondaryColor,this.git2=this.git2||this.tertiaryColor,this.git3=this.git3||W(this.primaryColor,{h:-30}),this.git4=this.git4||W(this.primaryColor,{h:-60}),this.git5=this.git5||W(this.primaryColor,{h:-90}),this.git6=this.git6||W(this.primaryColor,{h:60}),this.git7=this.git7||W(this.primaryColor,{h:120}),this.darkMode?(this.git0=pt(this.git0,25),this.git1=pt(this.git1,25),this.git2=pt(this.git2,25),this.git3=pt(this.git3,25),this.git4=pt(this.git4,25),this.git5=pt(this.git5,25),this.git6=pt(this.git6,25),this.git7=pt(this.git7,25)):(this.git0=yt(this.git0,25),this.git1=yt(this.git1,25),this.git2=yt(this.git2,25),this.git3=yt(this.git3,25),this.git4=yt(this.git4,25),this.git5=yt(this.git5,25),this.git6=yt(this.git6,25),this.git7=yt(this.git7,25)),this.gitInv0=this.gitInv0||lt(this.git0),this.gitInv1=this.gitInv1||lt(this.git1),this.gitInv2=this.gitInv2||lt(this.git2),this.gitInv3=this.gitInv3||lt(this.git3),this.gitInv4=this.gitInv4||lt(this.git4),this.gitInv5=this.gitInv5||lt(this.git5),this.gitInv6=this.gitInv6||lt(this.git6),this.gitInv7=this.gitInv7||lt(this.git7),this.branchLabelColor=this.branchLabelColor||(this.darkMode?"black":this.labelTextColor),this.gitBranchLabel0=this.gitBranchLabel0||this.branchLabelColor,this.gitBranchLabel1=this.gitBranchLabel1||this.branchLabelColor,this.gitBranchLabel2=this.gitBranchLabel2||this.branchLabelColor,this.gitBranchLabel3=this.gitBranchLabel3||this.branchLabelColor,this.gitBranchLabel4=this.gitBranchLabel4||this.branchLabelColor,this.gitBranchLabel5=this.gitBranchLabel5||this.branchLabelColor,this.gitBranchLabel6=this.gitBranchLabel6||this.branchLabelColor,this.gitBranchLabel7=this.gitBranchLabel7||this.branchLabelColor,this.tagLabelColor=this.tagLabelColor||this.primaryTextColor,this.tagLabelBackground=this.tagLabelBackground||this.primaryColor,this.tagLabelBorder=this.tagBorder||this.primaryBorderColor,this.tagLabelFontSize=this.tagLabelFontSize||"10px",this.commitLabelColor=this.commitLabelColor||this.secondaryTextColor,this.commitLabelBackground=this.commitLabelBackground||this.secondaryColor,this.commitLabelFontSize=this.commitLabelFontSize||"10px",this.commitLineColor=this.commitLineColor??"#BDBCCC",this.fontWeight=600,this.erEdgeLabelBackground="#16141F",this.attributeBackgroundColorOdd=this.attributeBackgroundColorOdd||go,this.attributeBackgroundColorEven=this.attributeBackgroundColorEven||po}calculate(t){if(typeof t!="object"){this.updateColors();return}const r=Object.keys(t);r.forEach(i=>{this[i]=t[i]}),this.updateColors(),r.forEach(i=>{this[i]=Vi(this[i],t[i])})}},C(ps,"Theme"),ps),z2=C(e=>{const t=new W2;return t.calculate(e),t},"getThemeVariables"),$o={base:{getThemeVariables:k2},dark:{getThemeVariables:v2},default:{getThemeVariables:T2},forest:{getThemeVariables:_2},neutral:{getThemeVariables:A2},neo:{getThemeVariables:$2},"neo-dark":{getThemeVariables:P2},redux:{getThemeVariables:O2},"redux-dark":{getThemeVariables:R2},"redux-color":{getThemeVariables:q2},"redux-dark-color":{getThemeVariables:z2}},Or={flowchart:{useMaxWidth:!0,theme:"redux-color",look:"neo",titleTopMargin:25,subGraphTitleMargin:{top:0,bottom:0},diagramPadding:8,htmlLabels:null,nodeSpacing:50,rankSpacing:50,curve:"basis",padding:15,wrappingWidth:120,minNodeWidth:120,stepDuration:1,stepNumbers:!1,inheritDir:!1},swimlane:{useMaxWidth:!0,theme:"redux-color",look:"neo",layout:"swimlane",lineHops:"arc",ignoreCrossLaneEdges:!0,optimizeRanksByCrossings:!0,automaticLaneOrdering:!1},agentflow:{useMaxWidth:!0,theme:"redux-color",look:"neo",titleTopMargin:25,diagramPadding:8,nodeSpacing:50,rankSpacing:50,wrappingWidth:120,minNodeWidth:120},sequence:{useMaxWidth:!0,theme:"redux-color",look:"neo",hideUnusedParticipants:!1,activationWidth:10,diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",mirrorActors:!0,forceMenus:!1,bottomMarginAdj:1,rightAngles:!1,showSequenceNumbers:!1,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:400,noteFontSize:14,noteFontFamily:'"trebuchet ms", verdana, arial, sans-serif',noteFontWeight:400,noteAlign:"center",messageFontSize:16,messageFontFamily:'"trebuchet ms", verdana, arial, sans-serif',messageFontWeight:400,wrap:!1,wrapPadding:10,labelBoxWidth:50,labelBoxHeight:20},gantt:{useMaxWidth:!0,titleTopMargin:25,barHeight:20,barGap:4,topPadding:50,rightPadding:75,leftPadding:75,gridLineStartPadding:35,fontSize:11,sectionFontSize:11,numberSectionStyles:4,axisFormat:"%Y-%m-%d",topAxis:!1,displayMode:"",weekday:"sunday"},journey:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,maxLabelWidth:360,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],titleColor:"",titleFontFamily:'"trebuchet ms", verdana, arial, sans-serif',titleFontSize:"4ex"},class:{useMaxWidth:!0,theme:"redux-color",look:"neo",titleTopMargin:25,arrowMarkerAbsolute:!1,dividerMargin:10,padding:5,textHeight:10,htmlLabels:!1,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},state:{useMaxWidth:!0,theme:"redux-color",look:"neo",layout:"elk",wrappingWidth:120,minNodeWidth:120,titleTopMargin:25,dividerMargin:10,sizeUnit:5,padding:8,textHeight:10,titleShift:-15,noteMargin:10,forkWidth:70,forkHeight:7,miniPadding:2,fontSizeFactor:5.02,fontSize:24,labelHeight:16,edgeLengthFactor:"20",compositTitleSize:35,radius:5},er:{useMaxWidth:!0,theme:"redux-color",look:"neo",titleTopMargin:25,diagramPadding:20,layoutDirection:"TB",minEntityWidth:100,minEntityHeight:75,entityPadding:15,nodeSpacing:140,rankSpacing:80,stroke:"gray",fill:"honeydew",fontSize:12},pie:{useMaxWidth:!0,textPosition:.75,donutHole:0,legendPosition:"right",highlightSlice:""},quadrantChart:{useMaxWidth:!0,chartWidth:500,chartHeight:500,titleFontSize:20,titlePadding:10,quadrantPadding:5,xAxisLabelPadding:5,yAxisLabelPadding:5,xAxisLabelFontSize:16,yAxisLabelFontSize:16,quadrantLabelFontSize:16,quadrantTextTopPadding:5,pointTextPadding:5,pointLabelFontSize:12,pointRadius:5,xAxisPosition:"top",yAxisPosition:"left",quadrantInternalBorderStrokeWidth:1,quadrantExternalBorderStrokeWidth:2},xyChart:{useMaxWidth:!0,width:700,height:500,titleFontSize:20,titlePadding:10,showDataLabel:!1,showDataLabelOutsideBar:!1,showTitle:!0,showLegend:!0,legendFontSize:14,legendPadding:10,xAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},yAxis:{$ref:"#/$defs/XYChartAxisConfig",showLabel:!0,labelFontSize:14,labelPadding:5,showTitle:!0,titleFontSize:16,titlePadding:5,showTick:!0,tickLength:5,tickWidth:2,showAxisLine:!0,axisLineWidth:2,labelRotation:0},chartOrientation:"vertical",plotReservedSpacePercent:50},requirement:{useMaxWidth:!0,theme:"redux-color",look:"neo",rect_fill:"#f9f9f9",text_color:"#333",rect_border_size:"0.5px",rect_border_color:"#bbb",rect_min_width:200,rect_min_height:200,fontSize:14,rect_padding:10,line_height:20},mindmap:{useMaxWidth:!0,colorBy:"branch",padding:10,maxNodeWidth:200,layoutAlgorithm:"cose-bilkent"},ishikawa:{useMaxWidth:!0,diagramPadding:20},kanban:{useMaxWidth:!0,padding:8,sectionWidth:200,ticketBaseUrl:""},timeline:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,leftMargin:150,width:150,height:50,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,messageAlign:"center",bottomMarginAdj:1,rightAngles:!1,taskFontSize:14,taskFontFamily:'"Open Sans", sans-serif',taskMargin:50,activationWidth:10,textPlacement:"fo",actorColours:["#8FBC8F","#7CFC00","#00FFFF","#20B2AA","#B0E0E6","#FFFFE0"],sectionFills:["#191970","#8B008B","#4B0082","#2F4F4F","#800000","#8B4513","#00008B"],sectionColours:["#fff"],disableMulticolor:!1},gitGraph:{useMaxWidth:!0,titleTopMargin:25,diagramPadding:8,nodeLabel:{width:75,height:100,x:-25,y:0},mainBranchName:"main",mainBranchOrder:0,showCommitLabel:!0,showBranches:!0,rotateCommitLabel:!0,parallelCommits:!1,arrowMarkerAbsolute:!1},c4:{useMaxWidth:!0,diagramMarginX:50,diagramMarginY:10,c4ShapeMargin:50,c4ShapePadding:20,width:216,height:60,boxMargin:10,c4ShapeInRow:4,nextLinePaddingX:0,c4BoundaryInRow:2,personFontSize:14,personFontFamily:'"Open Sans", sans-serif',personFontWeight:"normal",external_personFontSize:14,external_personFontFamily:'"Open Sans", sans-serif',external_personFontWeight:"normal",systemFontSize:14,systemFontFamily:'"Open Sans", sans-serif',systemFontWeight:"normal",external_systemFontSize:14,external_systemFontFamily:'"Open Sans", sans-serif',external_systemFontWeight:"normal",system_dbFontSize:14,system_dbFontFamily:'"Open Sans", sans-serif',system_dbFontWeight:"normal",external_system_dbFontSize:14,external_system_dbFontFamily:'"Open Sans", sans-serif',external_system_dbFontWeight:"normal",system_queueFontSize:14,system_queueFontFamily:'"Open Sans", sans-serif',system_queueFontWeight:"normal",external_system_queueFontSize:14,external_system_queueFontFamily:'"Open Sans", sans-serif',external_system_queueFontWeight:"normal",boundaryFontSize:14,boundaryFontFamily:'"Open Sans", sans-serif',boundaryFontWeight:"normal",messageFontSize:12,messageFontFamily:'"Open Sans", sans-serif',messageFontWeight:"normal",containerFontSize:14,containerFontFamily:'"Open Sans", sans-serif',containerFontWeight:"normal",external_containerFontSize:14,external_containerFontFamily:'"Open Sans", sans-serif',external_containerFontWeight:"normal",container_dbFontSize:14,container_dbFontFamily:'"Open Sans", sans-serif',container_dbFontWeight:"normal",external_container_dbFontSize:14,external_container_dbFontFamily:'"Open Sans", sans-serif',external_container_dbFontWeight:"normal",container_queueFontSize:14,container_queueFontFamily:'"Open Sans", sans-serif',container_queueFontWeight:"normal",external_container_queueFontSize:14,external_container_queueFontFamily:'"Open Sans", sans-serif',external_container_queueFontWeight:"normal",componentFontSize:14,componentFontFamily:'"Open Sans", sans-serif',componentFontWeight:"normal",external_componentFontSize:14,external_componentFontFamily:'"Open Sans", sans-serif',external_componentFontWeight:"normal",component_dbFontSize:14,component_dbFontFamily:'"Open Sans", sans-serif',component_dbFontWeight:"normal",external_component_dbFontSize:14,external_component_dbFontFamily:'"Open Sans", sans-serif',external_component_dbFontWeight:"normal",component_queueFontSize:14,component_queueFontFamily:'"Open Sans", sans-serif',component_queueFontWeight:"normal",external_component_queueFontSize:14,external_component_queueFontFamily:'"Open Sans", sans-serif',external_component_queueFontWeight:"normal",wrap:!0,wrapPadding:10,person_bg_color:"#08427B",person_border_color:"#073B6F",external_person_bg_color:"#686868",external_person_border_color:"#8A8A8A",system_bg_color:"#1168BD",system_border_color:"#3C7FC0",system_db_bg_color:"#1168BD",system_db_border_color:"#3C7FC0",system_queue_bg_color:"#1168BD",system_queue_border_color:"#3C7FC0",external_system_bg_color:"#999999",external_system_border_color:"#8A8A8A",external_system_db_bg_color:"#999999",external_system_db_border_color:"#8A8A8A",external_system_queue_bg_color:"#999999",external_system_queue_border_color:"#8A8A8A",container_bg_color:"#438DD5",container_border_color:"#3C7FC0",container_db_bg_color:"#438DD5",container_db_border_color:"#3C7FC0",container_queue_bg_color:"#438DD5",container_queue_border_color:"#3C7FC0",external_container_bg_color:"#B3B3B3",external_container_border_color:"#A6A6A6",external_container_db_bg_color:"#B3B3B3",external_container_db_border_color:"#A6A6A6",external_container_queue_bg_color:"#B3B3B3",external_container_queue_border_color:"#A6A6A6",component_bg_color:"#85BBF0",component_border_color:"#78A8D8",component_db_bg_color:"#85BBF0",component_db_border_color:"#78A8D8",component_queue_bg_color:"#85BBF0",component_queue_border_color:"#78A8D8",external_component_bg_color:"#CCCCCC",external_component_border_color:"#BFBFBF",external_component_db_bg_color:"#CCCCCC",external_component_db_border_color:"#BFBFBF",external_component_queue_bg_color:"#CCCCCC",external_component_queue_border_color:"#BFBFBF"},sankey:{useMaxWidth:!0,width:600,height:400,linkColor:"gradient",nodeAlignment:"justify",showValues:!0,prefix:"",suffix:"",nodeWidth:10,nodePadding:12,labelStyle:"legacy"},block:{useMaxWidth:!0,padding:8},packet:{useMaxWidth:!0,rowHeight:32,bitWidth:32,bitsPerRow:32,showBits:!0,bitOrder:"ascending",paddingX:5,paddingY:5},treeView:{useMaxWidth:!0,rowIndent:10,paddingX:5,paddingY:5,lineThickness:1,showIcons:!1,defaultIconPack:"",filenameIcons:{},extensionIcons:{}},architecture:{useMaxWidth:!0,padding:40,iconSize:80,fontSize:16,randomize:!1,nodeSeparation:75,idealEdgeLengthMultiplier:1.5,edgeElasticity:.45,numIter:2500,seed:1},eventmodeling:{useMaxWidth:!0,padding:30,rowHeight:32},radar:{useMaxWidth:!0,width:600,height:600,marginTop:50,marginRight:50,marginBottom:50,marginLeft:50,axisScaleFactor:1,axisLabelFactor:1.05,curveTension:.17},usecase:{useMaxWidth:!0,theme:"redux-color",look:"neo",wrappingWidth:120,minNodeWidth:120,actorFontSize:14,actorFontFamily:'"Open Sans", sans-serif',actorFontWeight:"normal",usecaseFontSize:12,usecaseFontFamily:'"Open Sans", sans-serif',usecaseFontWeight:"normal",nodeSpacing:50,rankSpacing:50,diagramPadding:20,colorScheme:"role"},venn:{useMaxWidth:!0,theme:"redux-color",look:"neo",width:800,height:450,padding:8,useDebugLayout:!1},cynefin:{useMaxWidth:!0,width:800,height:600,padding:40,showDomainDescriptions:!0,boundaryAmplitude:8,seed:0},theme:"default",look:"classic",handDrawnSeed:0,layout:"elk",maxTextSize:5e4,maxEdges:500,darkMode:!1,fontFamily:'"trebuchet ms", verdana, arial, sans-serif;',logLevel:5,securityLevel:"strict",startOnLoad:!0,arrowMarkerAbsolute:!1,secure:["secure","securityLevel","startOnLoad","maxTextSize","suppressErrorRendering","maxEdges"],legacyMathML:!1,forceLegacyMathML:!1,deterministicIds:!1,fontSize:16,markdownAutoWrap:!0,suppressErrorRendering:!1},em={...Or,deterministicIDSeed:void 0,elk:{mergeEdges:!1,straightenEdges:!0,lineHops:!0,preset:"default",nodePlacementStrategy:void 0,layeringStrategy:void 0,cycleBreakingStrategy:void 0,layeringLayerBound:4,nodePlacementAlignment:void 0,forceNodeModelOrder:!1,considerModelOrder:"NODES_AND_EDGES",keepEntryNodeOnTop:!1,orientFeedbackEdges:!0},themeCSS:void 0,themeVariables:$o.default.getThemeVariables(),sequence:{...Or.sequence,messageFont:C(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont"),noteFont:C(function(){return{fontFamily:this.noteFontFamily,fontSize:this.noteFontSize,fontWeight:this.noteFontWeight}},"noteFont"),actorFont:C(function(){return{fontFamily:this.actorFontFamily,fontSize:this.actorFontSize,fontWeight:this.actorFontWeight}},"actorFont")},class:{theme:Or.class?.theme,look:Or.class?.look,layout:Or.class?.layout,hideEmptyMembersBox:!1,hierarchicalNamespaces:!0},gantt:{...Or.gantt,tickInterval:void 0,useWidth:void 0},c4:{...Or.c4,useWidth:void 0,personFont:C(function(){return{fontFamily:this.personFontFamily,fontSize:this.personFontSize,fontWeight:this.personFontWeight}},"personFont"),flowchart:{...Or.flowchart,inheritDir:!1},external_personFont:C(function(){return{fontFamily:this.external_personFontFamily,fontSize:this.external_personFontSize,fontWeight:this.external_personFontWeight}},"external_personFont"),systemFont:C(function(){return{fontFamily:this.systemFontFamily,fontSize:this.systemFontSize,fontWeight:this.systemFontWeight}},"systemFont"),external_systemFont:C(function(){return{fontFamily:this.external_systemFontFamily,fontSize:this.external_systemFontSize,fontWeight:this.external_systemFontWeight}},"external_systemFont"),system_dbFont:C(function(){return{fontFamily:this.system_dbFontFamily,fontSize:this.system_dbFontSize,fontWeight:this.system_dbFontWeight}},"system_dbFont"),external_system_dbFont:C(function(){return{fontFamily:this.external_system_dbFontFamily,fontSize:this.external_system_dbFontSize,fontWeight:this.external_system_dbFontWeight}},"external_system_dbFont"),system_queueFont:C(function(){return{fontFamily:this.system_queueFontFamily,fontSize:this.system_queueFontSize,fontWeight:this.system_queueFontWeight}},"system_queueFont"),external_system_queueFont:C(function(){return{fontFamily:this.external_system_queueFontFamily,fontSize:this.external_system_queueFontSize,fontWeight:this.external_system_queueFontWeight}},"external_system_queueFont"),containerFont:C(function(){return{fontFamily:this.containerFontFamily,fontSize:this.containerFontSize,fontWeight:this.containerFontWeight}},"containerFont"),external_containerFont:C(function(){return{fontFamily:this.external_containerFontFamily,fontSize:this.external_containerFontSize,fontWeight:this.external_containerFontWeight}},"external_containerFont"),container_dbFont:C(function(){return{fontFamily:this.container_dbFontFamily,fontSize:this.container_dbFontSize,fontWeight:this.container_dbFontWeight}},"container_dbFont"),external_container_dbFont:C(function(){return{fontFamily:this.external_container_dbFontFamily,fontSize:this.external_container_dbFontSize,fontWeight:this.external_container_dbFontWeight}},"external_container_dbFont"),container_queueFont:C(function(){return{fontFamily:this.container_queueFontFamily,fontSize:this.container_queueFontSize,fontWeight:this.container_queueFontWeight}},"container_queueFont"),external_container_queueFont:C(function(){return{fontFamily:this.external_container_queueFontFamily,fontSize:this.external_container_queueFontSize,fontWeight:this.external_container_queueFontWeight}},"external_container_queueFont"),componentFont:C(function(){return{fontFamily:this.componentFontFamily,fontSize:this.componentFontSize,fontWeight:this.componentFontWeight}},"componentFont"),external_componentFont:C(function(){return{fontFamily:this.external_componentFontFamily,fontSize:this.external_componentFontSize,fontWeight:this.external_componentFontWeight}},"external_componentFont"),component_dbFont:C(function(){return{fontFamily:this.component_dbFontFamily,fontSize:this.component_dbFontSize,fontWeight:this.component_dbFontWeight}},"component_dbFont"),external_component_dbFont:C(function(){return{fontFamily:this.external_component_dbFontFamily,fontSize:this.external_component_dbFontSize,fontWeight:this.external_component_dbFontWeight}},"external_component_dbFont"),component_queueFont:C(function(){return{fontFamily:this.component_queueFontFamily,fontSize:this.component_queueFontSize,fontWeight:this.component_queueFontWeight}},"component_queueFont"),external_component_queueFont:C(function(){return{fontFamily:this.external_component_queueFontFamily,fontSize:this.external_component_queueFontSize,fontWeight:this.external_component_queueFontWeight}},"external_component_queueFont"),boundaryFont:C(function(){return{fontFamily:this.boundaryFontFamily,fontSize:this.boundaryFontSize,fontWeight:this.boundaryFontWeight}},"boundaryFont"),messageFont:C(function(){return{fontFamily:this.messageFontFamily,fontSize:this.messageFontSize,fontWeight:this.messageFontWeight}},"messageFont")},pie:{...Or.pie,useWidth:984},xyChart:{...Or.xyChart,useWidth:void 0},requirement:{...Or.requirement,useWidth:void 0},packet:{...Or.packet},eventmodeling:{...Or.eventmodeling},treeView:{...Or.treeView,useWidth:void 0},radar:{...Or.radar},usecase:{...Or.usecase},railroad:{...Or.railroad,fontSize:void 0,fontFamily:void 0,terminalFill:void 0,terminalStroke:void 0,terminalTextColor:void 0,nonTerminalFill:void 0,nonTerminalStroke:void 0,nonTerminalTextColor:void 0,lineColor:void 0,markerFill:void 0,commentFill:void 0,commentStroke:void 0,commentTextColor:void 0,specialFill:void 0,specialStroke:void 0,ruleNameColor:void 0},ishikawa:{...Or.ishikawa},sankey:{...Or.sankey,nodeColors:void 0},treemap:{useMaxWidth:!0,padding:10,diagramPadding:8,showValues:!0,nodeWidth:100,nodeHeight:40,borderWidth:1,valueFontSize:12,labelFontSize:14,valueFormat:","},venn:{...Or.venn},cynefin:{...Or.cynefin}},rm=C((e,t="")=>Object.keys(e).reduce((r,i)=>Array.isArray(e[i])?r:typeof e[i]=="object"&&e[i]!==null?[...r,t+i,...rm(e[i],"")]:[...r,t+i],[]),"keyify"),H2=new Set(rm(em,"")),Ld=em,Y2={"flowchart-v2":"flowchart","flowchart-elk":"flowchart",classDiagram:"class",stateDiagram:"state",xychart:"xyChart",railroadAbnf:"railroad",railroadEbnf:"railroad",railroadPeg:"railroad"},X2=C(e=>Y2[e]??e,"getDiagramConfigKey"),j2={nodeColors:/^#[\da-f]{3,8}$|^rgb\([\d\s%,.]+\)$|^hsl\([\d\s%,.]+\)$|^[a-z]+$/i,filenameIcons:/^[\w-]+(?::[\w-]+)?$/,extensionIcons:/^[\w-]+(?::[\w-]+)?$/},G2=C((e,t)=>{for(const r of Object.keys(e)){const i=e[r];(r.startsWith("__")||r.includes("proto")||r.includes("constr")||typeof i!="string"||!t.test(i))&&(Lt.debug("sanitize deleting dictionary entry:",r,i),delete e[r])}},"sanitizeDictionaryConfig"),xl=C(e=>{if(Lt.debug("sanitizeDirective called with",e),!(typeof e!="object"||e==null)){if(Array.isArray(e)){e.forEach(t=>xl(t));return}for(const t of Object.keys(e)){if(Lt.debug("Checking key",t),t.startsWith("__")||t.includes("proto")||t.includes("constr")||!H2.has(t)||e[t]==null){Lt.debug("sanitize deleting key: ",t),delete e[t];continue}if(typeof e[t]=="object"){const i=j2[t];i?G2(e[t],i):(Lt.debug("sanitizing object",t),xl(e[t]));continue}const r=["themeCSS","fontFamily","altFontFamily"];for(const i of r)t.includes(i)&&(Lt.debug("sanitizing css option",t),e[t]=im(e[t]))}if(e.themeVariables)for(const t of Object.keys(e.themeVariables)){const r=e.themeVariables[t];r?.match&&!r.match(/^[\d "#%(),.;A-Za-z]+$/)&&(e.themeVariables[t]="")}Lt.debug("After sanitization",e)}},"sanitizeDirective"),im=C(e=>{let t=0,r=0;for(const i of e){if(t<r)return"{ /* ERROR: Unbalanced CSS */ }";i==="{"?t++:i==="}"&&r++}return t!==r?"{ /* ERROR: Unbalanced CSS */ }":e},"sanitizeCss"),Jo=Object.freeze(Ld),U2=["theme","look","layout"],V2=new Set(["classic","handDrawn","neo"]),Z2=C((e,t)=>e==="theme"?t==="null"||Object.hasOwn($o,t):e!=="look"||V2.has(t),"isUsableAppearance"),K2=C((e,t,r)=>e?[e[t]?.[r],e[r]].find(o=>o!==void 0&&Z2(r,o)):void 0,"readAppearance"),mo=C(e=>!(e===!1||["false","null","0"].includes(String(e).trim().toLowerCase())),"evaluate"),hi=Wr({},Jo),bl,Cl={},Eo=[],sn=Wr({},Jo),nn,Q2=C((e,t)=>{if(!nn)return;const r=[t,...[...Eo].reverse(),Cl,Jo],i=e[nn];for(const o of U2)for(const a of r){const s=K2(a,nn,o);if(s!==void 0){e[o]=s,i?.[o]!==void 0&&(i[o]=s);break}}},"resolveAppearance"),_s=C((e,t)=>{let r=Wr({},e),i={};for(const a of t)sm(a),i=Wr(i,a);if(r=Wr(r,i),Q2(r,i),(!!i.theme||r.theme!==e.theme)&&r.theme&&Object.hasOwn($o,r.theme)){const a=Wr({},bl),s=Wr(a.themeVariables||{},i.themeVariables);r.themeVariables=$o[r.theme].getThemeVariables(s)}return sn=r,ow(sn),sn},"updateCurrentConfig"),Ad=C(e=>{nn=e===void 0?void 0:X2(e),_s(hi,Eo)},"setDiagramConfigScope"),J2=C(e=>(hi=Wr({},Jo),hi=Wr(hi,e),Cl=Wr({},e),e.theme&&Object.hasOwn($o,e.theme)&&(hi.themeVariables=$o[e.theme].getThemeVariables(e.themeVariables)),_s(hi,Eo),hi),"setSiteConfig"),tw=C(e=>{bl=Wr({},e)},"saveConfigFromInitialize"),ew=C(e=>(hi=Wr(hi,e),Cl=Wr(Cl,e),_s(hi,Eo),hi),"updateSiteConfig"),om=C(()=>Wr({},hi),"getSiteConfig"),am=C(e=>(_s(sn,[e]),Ar()),"setConfig"),Ar=C(()=>Wr({},sn),"getConfig"),sm=C(e=>{e&&(["secure",...hi.secure??[]].forEach(t=>{Object.hasOwn(e,t)&&(Lt.debug(`Denied attempt to modify a secure key ${t}`,e[t]),delete e[t])}),Object.keys(e).forEach(t=>{t.startsWith("__")&&delete e[t]}),Object.keys(e).forEach(t=>{typeof e[t]=="string"&&(e[t].includes("<")||e[t].includes(">")||e[t].includes("url(data:"))&&delete e[t],typeof e[t]=="object"&&sm(e[t])}))},"sanitize"),rw=C(e=>{xl(e),e.fontFamily&&!e.themeVariables?.fontFamily&&(e.themeVariables={...e.themeVariables,fontFamily:e.fontFamily}),Eo.push(e),_s(hi,Eo)},"addDirective"),wl=C((e=hi)=>{Eo=[],nn=void 0,_s(e,Eo)},"reset"),iw={LAZY_LOAD_DEPRECATED:"The configuration options lazyLoadedDiagrams and loadExternalDiagramsAtStartup are deprecated. Please use registerExternalDiagrams instead.",FLOWCHART_HTML_LABELS_DEPRECATED:"flowchart.htmlLabels is deprecated. Please use global htmlLabels instead."},vf={},nm=C(e=>{vf[e]||(Lt.warn(iw[e]),vf[e]=!0)},"issueWarning"),ow=C(e=>{e&&(e.lazyLoadedDiagrams||e.loadExternalDiagramsAtStartup)&&nm("LAZY_LOAD_DEPRECATED")},"checkConfig"),oP=C(()=>{let e={};bl&&(e=Wr(e,bl));for(const t of Eo)e=Wr(e,t);return e},"getUserDefinedConfig"),Zr=C(e=>(e.flowchart?.htmlLabels!=null&&nm("FLOWCHART_HTML_LABELS_DEPRECATED"),mo(e.htmlLabels??e.flowchart?.htmlLabels??!0)),"getEffectiveHtmlLabels"),wn=/<\/?br\s*\/?>/gi,aw=new RegExp(wn.source,"i"),sw=C(e=>e?hm(e).replace(/\\n/g,"#br#").split("#br#"):[""],"getRows"),nw=(()=>{let e=!1;return()=>{e||(lm(),e=!0)}})();function lm(){const e="data-temp-href-target";bs.addHook("beforeSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute("target")&&t.setAttribute(e,t.getAttribute("target")??"")}),bs.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&t.hasAttribute(e)&&(t.setAttribute("target",t.getAttribute(e)??""),t.removeAttribute(e),t.getAttribute("target")==="_blank"&&t.setAttribute("rel","noopener"))})}C(lm,"setupDompurifyHooks");var cm=C(e=>(nw(),bs.sanitize(e)),"removeScript"),Mf=C((e,t)=>{if(Zr(t)){const r=t.securityLevel;r==="antiscript"||r==="strict"||r==="sandbox"?e=cm(e):r!=="loose"&&(e=hm(e),e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"),e=e.replace(/=/g,"&equals;"),e=dw(e))}return e},"sanitizeMore"),Ei=C((e,t)=>e&&(t.dompurifyConfig?e=bs.sanitize(Mf(e,t),t.dompurifyConfig).toString():e=bs.sanitize(Mf(e,t),{FORBID_TAGS:["style"]}).toString(),e),"sanitizeText"),lw=C((e,t)=>typeof e=="string"?Ei(e,t):e.flat().map(r=>Ei(r,t)),"sanitizeTextOrArray"),cw=C(e=>aw.test(e),"hasBreaks"),hw=C(e=>e.split(wn),"splitBreaks"),dw=C(e=>e.replace(/#br#/g,"<br/>"),"placeholderToBreak"),hm=C(e=>e.replace(wn,"#br#"),"breakToPlaceholder"),uw=C(e=>{let t="";return e&&(t=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,t=CSS.escape(t)),t},"getUrl"),fw=C(function(...e){const t=e.filter(r=>!isNaN(r));return Math.max(...t)},"getMax"),gw=C(function(...e){const t=e.filter(r=>!isNaN(r));return Math.min(...t)},"getMin"),Tf=C(function(e){const t=e.split(/(,)/),r=[];for(let i=0;i<t.length;i++){let o=t[i];if(o===","&&i>0&&i+1<t.length){const a=t[i-1],s=t[i+1];pw(a,s)&&(o=a+","+s,i++,r.pop())}r.push(mw(o))}return r.join("")},"parseGenericTypes"),Lh=C((e,t)=>Math.max(0,e.split(t).length-1),"countOccurrence"),pw=C((e,t)=>{const r=Lh(e,"~"),i=Lh(t,"~");return r===1&&i===1},"shouldCombineSets"),mw=C(e=>{const t=Lh(e,"~");let r=!1;if(t<=1)return e;t%2!==0&&e.startsWith("~")&&(e=e.substring(1),r=!0);const i=[...e];let o=i.indexOf("~"),a=i.lastIndexOf("~");for(;o!==-1&&a!==-1&&o!==a;)i[o]="<",i[a]=">",o=i.indexOf("~"),a=i.lastIndexOf("~");return r&&i.unshift("~"),i.join("")},"processSet"),Bf=C(()=>window.MathMLElement!==void 0,"isMathMLSupported"),Ah=/\$\$(.*?)\$\$/g,un=C(e=>(e.match(Ah)?.length??0)>0,"hasKatex"),aP=C(async(e,t)=>{const r=document.createElement("div");r.innerHTML=await dm(e,t),r.id="katex-temp",r.style.visibility="hidden",r.style.position="absolute",r.style.top="0",document.querySelector("body")?.insertAdjacentElement("beforeend",r);const o={width:r.clientWidth,height:r.clientHeight};return r.remove(),o},"calculateMathMLDimensions"),yw=C(async(e,t)=>{if(!un(e))return e;if(!(Bf()||t.legacyMathML||t.forceLegacyMathML))return e.replace(Ah,"MathML is unsupported in this environment.");{const{default:r}=await Ve(async()=>{const{default:o}=await import("./B9rO5sNH.js");return{default:o}},[],import.meta.url),i=t.forceLegacyMathML||!Bf()&&t.legacyMathML?"htmlAndMathml":"mathml";return e.split(wn).map(o=>un(o)?`<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">${o}</div>`:`<div>${o}</div>`).join("").replace(Ah,(o,a)=>r.renderToString(a,{throwOnError:!0,displayMode:!0,output:i}).replace(/\n/g," ").replace(/<annotation.*<\/annotation>/g,""))}},"renderKatexUnsanitized"),dm=C(async(e,t)=>Ei(await yw(e,t),t),"renderKatexSanitized"),kn={getRows:sw,sanitizeText:Ei,sanitizeTextOrArray:lw,hasBreaks:cw,splitBreaks:hw,lineBreakRegex:wn,removeScript:cm,getUrl:uw,evaluate:mo,getMax:fw,getMin:gw},xw=C(function(e,t){for(let r of t)e.attr(r[0],r[1])},"d3Attrs"),bw=C(function(e,t,r){let i=new Map;return r?(i.set("width","100%"),i.set("style",`max-width: ${t}px;`)):(i.set("height",e),i.set("width",t)),i},"calculateSvgSizeAttrs"),um=C(function(e,t,r,i){const o=bw(t,r,i);xw(e,o)},"configureSvgSize"),Cw=C(function(e,t,r,i){const o=t.node().getBBox(),a=o.width,s=o.height;Lt.info(`SVG bounds: ${a}x${s}`,o);let n=0,l=0;Lt.info(`Graph bounds: ${n}x${l}`,e),n=a+r*2,l=s+r*2,Lt.info(`Calculated bounds: ${n}x${l}`),um(t,l,n,i);const c=`${o.x-r} ${o.y-r} ${o.width+2*r} ${o.height+2*r}`;t.attr("viewBox",c)},"setupGraphViewbox"),nl={};function Fh(e){return[...e.cssRules].map(t=>t.cssText).join(`
37
37
  `)}C(Fh,"cssStyleSheetToString");var ww=C((e,t,r,i)=>{let o="";return e in nl&&nl[e]?o=nl[e]({...r,svgId:i}):Lt.warn(`No theme found for ${e}`),`& {
38
38
  font-family: ${r.fontFamily};
39
39
  font-size: ${r.fontSize};
@@ -156,8 +156,8 @@ var lC=Object.defineProperty;var cC=(e,t,r)=>t in e?lC(e,t,{enumerable:!0,config
156
156
 
157
157
  ${t}
158
158
  `},"getStyles"),kw=C((e,t)=>{t!==void 0&&(nl[e]=t)},"addStylesForDiagram"),Sw=ww,fm={};t2(fm,{clear:()=>vw,getAccDescription:()=>_w,getAccTitle:()=>Tw,getDiagramTitle:()=>Aw,setAccDescription:()=>Bw,setAccTitle:()=>Mw,setDiagramTitle:()=>Lw});var Fd="",$d="",Ed="",Pd=C(e=>Ei(e,Ar()),"sanitizeText"),vw=C(()=>{Fd="",Ed="",$d=""},"clear"),Mw=C(e=>{Fd=Pd(e).replace(/^\s+/g,"")},"setAccTitle"),Tw=C(()=>Fd,"getAccTitle"),Bw=C(e=>{Ed=Pd(e).replace(/\n\s+/g,`
159
- `)},"setAccDescription"),_w=C(()=>Ed,"getAccDescription"),Lw=C(e=>{$d=Pd(e)},"setDiagramTitle"),Aw=C(()=>$d,"getDiagramTitle"),_f=Lt,Fw=_d,Ge=Ar,iP=am,oP=Jo,Id=C(e=>Ei(e,Ge()),"sanitizeText"),$w=Cw,Ew=C(()=>fm,"getCommonDb"),kl={},Sl=C((e,t,r)=>{kl[e]&&_f.warn(`Diagram with id ${e} already registered. Overwriting.`),kl[e]=t,r&&tm(e,r),kw(e,t.styles),t.injectUtils?.(_f,Fw,Ge,Id,$w,Ew(),()=>{})},"registerDiagram"),$h=C(e=>{if(e in kl)return kl[e];throw new Pw(e)},"getDiagram"),ms,Pw=(ms=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},C(ms,"DiagramNotFoundError"),ms),Iw=C(e=>{const{handDrawnSeed:t}=Ge();return{fill:e,hachureAngle:120,hachureGap:1.5,fillWeight:1.5,roughness:.7,stroke:e,seed:t}},"solidStateFill"),Ow=C(e=>Array.isArray(e)?e:e?e.split(";").map(t=>t.trim()).filter(Boolean):[],"normalizeStyleList"),sa=C(e=>{const t=Dw([...e.cssCompiledStyles||[],...e.cssStyles||[],...Ow(e.labelStyle)]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),Dw=C(e=>{const t=new Map;return e.forEach(r=>{const[i,o]=r.split(":");t.set(i.trim(),o?.trim())}),t},"styles2Map"),gm=C(e=>e==="color"||e==="font-size"||e==="font-family"||e==="font-weight"||e==="font-style"||e==="text-decoration"||e==="text-align"||e==="text-transform"||e==="line-height"||e==="letter-spacing"||e==="word-spacing"||e==="text-shadow"||e==="text-overflow"||e==="white-space"||e==="word-wrap"||e==="word-break"||e==="overflow-wrap"||e==="hyphens","isLabelStyle"),Ut=C(e=>{const{stylesArray:t}=sa(e),r=[],i=[],o=[],a=[];return t.forEach(s=>{const n=s[0];gm(n)?r.push(s.join(":")+" !important"):(i.push(s.join(":")+" !important"),n.includes("stroke")&&o.push(s.join(":")+" !important"),n==="fill"&&a.push(s.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:t,borderStyles:o,backgroundStyles:a}},"styles2String"),Gt=C((e,t)=>{const{themeVariables:r,handDrawnSeed:i}=Ge(),{nodeBorder:o,mainBkg:a}=r,{stylesMap:s}=sa(e);return Object.assign({roughness:.7,fill:s.get("fill")||a,fillStyle:"hachure",fillWeight:1.5,hachureGap:1.5,stroke:s.get("stroke")||o,seed:i,strokeWidth:s.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:Rw(s.get("stroke-dasharray"))},t)},"userNodeOverrides"),Rw=C(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const o=isNaN(t[0])?0:t[0];return[o,o]}const r=isNaN(t[0])?0:t[0],i=isNaN(t[1])?0:t[1];return[r,i]},"getStrokeDashArray");const Nw=Object.freeze({left:0,top:0,width:16,height:16}),vl=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),pm=Object.freeze({...Nw,...vl}),qw=Object.freeze({...pm,body:"",hidden:!1}),Ww=Object.freeze({width:null,height:null}),zw=Object.freeze({...Ww,...vl}),Hw=(e,t,r,i="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;i=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const n=o.pop(),l=o.pop(),c={provider:o.length>0?o[0]:i,prefix:l,name:n};return Hc(c)?c:null}const a=o[0],s=a.split("-");if(s.length>1){const n={provider:i,prefix:s.shift(),name:s.join("-")};return Hc(n)?n:null}if(r&&i===""){const n={provider:i,prefix:"",name:a};return Hc(n,r)?n:null}return null},Hc=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function Yw(e,t){const r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(r.rotate=i),r}function Lf(e,t){const r=Yw(e,t);for(const i in qw)i in vl?i in e&&!(i in r)&&(r[i]=vl[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function Xw(e,t){const r=e.icons,i=e.aliases||Object.create(null),o=Object.create(null);function a(s){if(r[s])return o[s]=[];if(!(s in o)){o[s]=null;const n=i[s]&&i[s].parent,l=n&&a(n);l&&(o[s]=[n].concat(l))}return o[s]}return(t||Object.keys(r).concat(Object.keys(i))).forEach(a),o}function Af(e,t,r){const i=e.icons,o=e.aliases||Object.create(null);let a={};function s(n){a=Lf(i[n]||o[n],a)}return s(t),r.forEach(s),Lf(e,a)}function jw(e,t){if(e.icons[t])return Af(e,t,[]);const r=Xw(e,[t])[t];return r?Af(e,t,r):null}const Gw=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Uw=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Ff(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;const i=e.split(Gw);if(i===null||!i.length)return e;const o=[];let a=i.shift(),s=Uw.test(a);for(;;){if(s){const n=parseFloat(a);isNaN(n)?o.push(a):o.push(Math.ceil(n*t*r)/r)}else o.push(a);if(a=i.shift(),a===void 0)return o.join("");s=!s}}function Vw(e,t="defs"){let r="";const i=e.indexOf("<"+t);for(;i>=0;){const o=e.indexOf(">",i),a=e.indexOf("</"+t);if(o===-1||a===-1)break;const s=e.indexOf(">",a);if(s===-1)break;r+=e.slice(o+1,a).trim(),e=e.slice(0,i).trim()+e.slice(s+1)}return{defs:r,content:e}}function Zw(e,t){return e?"<defs>"+e+"</defs>"+t:t}function Kw(e,t,r){const i=Vw(e);return Zw(i.defs,t+i.content+r)}const Qw=e=>e==="unset"||e==="undefined"||e==="none";function Jw(e,t){const r={...pm,...e},i={...zw,...t},o={left:r.left,top:r.top,width:r.width,height:r.height};let a=r.body;[r,i].forEach(p=>{const m=[],y=p.hFlip,x=p.vFlip;let b=p.rotate;y?x?b+=2:(m.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),m.push("scale(-1 1)"),o.top=o.left=0):x&&(m.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),m.push("scale(1 -1)"),o.top=o.left=0);let S;switch(b<0&&(b-=Math.floor(b/4)*4),b=b%4,b){case 1:S=o.height/2+o.top,m.unshift("rotate(90 "+S.toString()+" "+S.toString()+")");break;case 2:m.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:S=o.width/2+o.left,m.unshift("rotate(-90 "+S.toString()+" "+S.toString()+")");break}b%2===1&&(o.left!==o.top&&(S=o.left,o.left=o.top,o.top=S),o.width!==o.height&&(S=o.width,o.width=o.height,o.height=S)),m.length&&(a=Kw(a,'<g transform="'+m.join(" ")+'">',"</g>"))});const s=i.width,n=i.height,l=o.width,c=o.height;let h,d;s===null?(d=n===null?"1em":n==="auto"?c:n,h=Ff(d,l/c)):(h=s==="auto"?l:s,d=n===null?Ff(h,c/l):n==="auto"?c:n);const u={},f=(p,m)=>{Qw(m)||(u[p]=m.toString())};f("width",h),f("height",d);const g=[o.left,o.top,l,c];return u.viewBox=g.join(" "),{attributes:u,viewBox:g,body:a}}const tk=/\sid="(\S+)"/g,$f=new Map;function ek(e){e=e.replace(/[0-9]+$/,"")||"a";const t=$f.get(e)||0;return $f.set(e,t+1),t?`${e}${t}`:e}function rk(e){const t=[];let r;for(;r=tk.exec(e);)t.push(r[1]);if(!t.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(o=>{const a=ek(o),s=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+a+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}function ik(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)r+=" "+i+'="'+t[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+e+"</svg>"}var ok={body:'<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',height:80,width:80},Ml=new Map,Od=new Map,mm=C(e=>{for(const t of e){if(!t.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(Lt.debug("Registering icon pack:",t.name),"loader"in t)Od.set(t.name,t.loader);else if("icons"in t)Ml.set(t.name,t.icons);else throw Lt.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),ak=C(e=>Ml.has(e)||Od.has(e),"isIconPackRegistered"),ym=C(async(e,t)=>{const r=Hw(e,!0,t!==void 0);if(!r)throw new Error(`Invalid icon name: ${e}`);const i=r.prefix||t;if(!i)throw new Error(`Icon name must contain a prefix: ${e}`);let o=Ml.get(i);if(!o){const s=Od.get(i);if(!s)throw new Error(`Icon set not found: ${r.prefix}`);try{o={...await s(),prefix:i},Ml.set(i,o)}catch(n){throw Lt.error(n),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=jw(o,r.name);if(!a)throw new Error(`Icon not found: ${e}`);return a},"getRegisteredIconData"),xm=C(async e=>{try{return await ym(e),!0}catch{return!1}},"isIconAvailable"),$a=C(async(e,t,r)=>{let i;try{i=await ym(e,t?.fallbackPrefix)}catch(s){Lt.error(s),i=ok}const o=Jw(i,t),a=ik(rk(o.body),{...o.attributes,...r});return Ei(a,Ar())},"getIconSVG"),In={},Yr={},Ef;function sk(){return Ef||(Ef=1,Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.BLANK_URL=Yr.relativeFirstCharacters=Yr.whitespaceEscapeCharsRegex=Yr.urlSchemeRegex=Yr.ctrlCharactersRegex=Yr.htmlCtrlEntityRegex=Yr.htmlEntitiesRegex=Yr.invalidProtocolRegex=void 0,Yr.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,Yr.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,Yr.htmlCtrlEntityRegex=/&(newline|tab);/gi,Yr.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,Yr.urlSchemeRegex=/^.+(:|&colon;)/gim,Yr.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,Yr.relativeFirstCharacters=[".","/"],Yr.BLANK_URL="about:blank"),Yr}var Pf;function nk(){if(Pf)return In;Pf=1,Object.defineProperty(In,"__esModule",{value:!0}),In.sanitizeUrl=a;var e=sk();function t(s){return e.relativeFirstCharacters.indexOf(s[0])>-1}function r(s){var n=s.replace(e.ctrlCharactersRegex,"");return n.replace(e.htmlEntitiesRegex,function(l,c){return String.fromCharCode(c)})}function i(s){return URL.canParse(s)}function o(s){try{return decodeURIComponent(s)}catch{return s}}function a(s){if(!s)return e.BLANK_URL;var n,l=o(s.trim());do l=r(l).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),l=o(l),n=l.match(e.ctrlCharactersRegex)||l.match(e.htmlEntitiesRegex)||l.match(e.htmlCtrlEntityRegex)||l.match(e.whitespaceEscapeCharsRegex);while(n&&n.length>0);var c=l;if(!c)return e.BLANK_URL;if(t(c))return c;var h=c.trimStart(),d=h.match(e.urlSchemeRegex);if(!d)return c;var u=d[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(u))return e.BLANK_URL;var f=h.replace(/\\/g,"/");if(u==="mailto:"||u.includes("://"))return f;if(u==="http:"||u==="https:"){if(!i(f))return e.BLANK_URL;var g=new URL(f);return g.protocol=g.protocol.toLowerCase(),g.hostname=g.hostname.toLowerCase(),g.toString()}return f}return In}var lk=nk(),Eh="http://www.w3.org/1999/xhtml",If={svg:"http://www.w3.org/2000/svg",xhtml:Eh,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function bm(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),If.hasOwnProperty(t)?{space:If[t],local:e}:e}function ck(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Eh&&t.documentElement.namespaceURI===Eh?t.createElement(e):t.createElementNS(r,e)}}function hk(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Cm(e){var t=bm(e);return(t.local?hk:ck)(t)}function dk(){}function wm(e){return e==null?dk:function(){return this.querySelector(e)}}function uk(e){typeof e!="function"&&(e=wm(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var a=t[o],s=a.length,n=i[o]=new Array(s),l,c,h=0;h<s;++h)(l=a[h])&&(c=e.call(l,l.__data__,h,a))&&("__data__"in l&&(c.__data__=l.__data__),n[h]=c);return new Pi(i,this._parents)}function fk(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function gk(){return[]}function pk(e){return e==null?gk:function(){return this.querySelectorAll(e)}}function mk(e){return function(){return fk(e.apply(this,arguments))}}function yk(e){typeof e=="function"?e=mk(e):e=pk(e);for(var t=this._groups,r=t.length,i=[],o=[],a=0;a<r;++a)for(var s=t[a],n=s.length,l,c=0;c<n;++c)(l=s[c])&&(i.push(e.call(l,l.__data__,c,s)),o.push(l));return new Pi(i,o)}function xk(e){return function(){return this.matches(e)}}function km(e){return function(t){return t.matches(e)}}var bk=Array.prototype.find;function Ck(e){return function(){return bk.call(this.children,e)}}function wk(){return this.firstElementChild}function kk(e){return this.select(e==null?wk:Ck(typeof e=="function"?e:km(e)))}var Sk=Array.prototype.filter;function vk(){return Array.from(this.children)}function Mk(e){return function(){return Sk.call(this.children,e)}}function Tk(e){return this.selectAll(e==null?vk:Mk(typeof e=="function"?e:km(e)))}function Bk(e){typeof e!="function"&&(e=xk(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var a=t[o],s=a.length,n=i[o]=[],l,c=0;c<s;++c)(l=a[c])&&e.call(l,l.__data__,c,a)&&n.push(l);return new Pi(i,this._parents)}function Sm(e){return new Array(e.length)}function _k(){return new Pi(this._enter||this._groups.map(Sm),this._parents)}function Tl(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Tl.prototype={constructor:Tl,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Lk(e){return function(){return e}}function Ak(e,t,r,i,o,a){for(var s=0,n,l=t.length,c=a.length;s<c;++s)(n=t[s])?(n.__data__=a[s],i[s]=n):r[s]=new Tl(e,a[s]);for(;s<l;++s)(n=t[s])&&(o[s]=n)}function Fk(e,t,r,i,o,a,s){var n,l,c=new Map,h=t.length,d=a.length,u=new Array(h),f;for(n=0;n<h;++n)(l=t[n])&&(u[n]=f=s.call(l,l.__data__,n,t)+"",c.has(f)?o[n]=l:c.set(f,l));for(n=0;n<d;++n)f=s.call(e,a[n],n,a)+"",(l=c.get(f))?(i[n]=l,l.__data__=a[n],c.delete(f)):r[n]=new Tl(e,a[n]);for(n=0;n<h;++n)(l=t[n])&&c.get(u[n])===l&&(o[n]=l)}function $k(e){return e.__data__}function Ek(e,t){if(!arguments.length)return Array.from(this,$k);var r=t?Fk:Ak,i=this._parents,o=this._groups;typeof e!="function"&&(e=Lk(e));for(var a=o.length,s=new Array(a),n=new Array(a),l=new Array(a),c=0;c<a;++c){var h=i[c],d=o[c],u=d.length,f=Pk(e.call(h,h&&h.__data__,c,i)),g=f.length,p=n[c]=new Array(g),m=s[c]=new Array(g),y=l[c]=new Array(u);r(h,d,p,m,y,f,t);for(var x=0,b=0,S,T;x<g;++x)if(S=p[x]){for(x>=b&&(b=x+1);!(T=m[b])&&++b<g;);S._next=T||null}}return s=new Pi(s,i),s._enter=n,s._exit=l,s}function Pk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ik(){return new Pi(this._exit||this._groups.map(Sm),this._parents)}function Ok(e,t,r){var i=this.enter(),o=this,a=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),r==null?a.remove():r(a),i&&o?i.merge(o).order():o}function Dk(e){for(var t=e.selection?e.selection():e,r=this._groups,i=t._groups,o=r.length,a=i.length,s=Math.min(o,a),n=new Array(o),l=0;l<s;++l)for(var c=r[l],h=i[l],d=c.length,u=n[l]=new Array(d),f,g=0;g<d;++g)(f=c[g]||h[g])&&(u[g]=f);for(;l<o;++l)n[l]=r[l];return new Pi(n,this._parents)}function Rk(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var i=e[t],o=i.length-1,a=i[o],s;--o>=0;)(s=i[o])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function Nk(e){e||(e=qk);function t(d,u){return d&&u?e(d.__data__,u.__data__):!d-!u}for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a){for(var s=r[a],n=s.length,l=o[a]=new Array(n),c,h=0;h<n;++h)(c=s[h])&&(l[h]=c);l.sort(t)}return new Pi(o,this._parents).order()}function qk(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Wk(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function zk(){return Array.from(this)}function Hk(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],o=0,a=i.length;o<a;++o){var s=i[o];if(s)return s}return null}function Yk(){let e=0;for(const t of this)++e;return e}function Xk(){return!this.node()}function jk(e){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var o=t[r],a=0,s=o.length,n;a<s;++a)(n=o[a])&&e.call(n,n.__data__,a,o);return this}function Gk(e){return function(){this.removeAttribute(e)}}function Uk(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Vk(e,t){return function(){this.setAttribute(e,t)}}function Zk(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Kk(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function Qk(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function Jk(e,t){var r=bm(e);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((t==null?r.local?Uk:Gk:typeof t=="function"?r.local?Qk:Kk:r.local?Zk:Vk)(r,t))}function vm(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function tS(e){return function(){this.style.removeProperty(e)}}function eS(e,t,r){return function(){this.style.setProperty(e,t,r)}}function rS(e,t,r){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function iS(e,t,r){return arguments.length>1?this.each((t==null?tS:typeof t=="function"?rS:eS)(e,t,r??"")):oS(this.node(),e)}function oS(e,t){return e.style.getPropertyValue(t)||vm(e).getComputedStyle(e,null).getPropertyValue(t)}function aS(e){return function(){delete this[e]}}function sS(e,t){return function(){this[e]=t}}function nS(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function lS(e,t){return arguments.length>1?this.each((t==null?aS:typeof t=="function"?nS:sS)(e,t)):this.node()[e]}function Mm(e){return e.trim().split(/^|\s+/)}function Dd(e){return e.classList||new Tm(e)}function Tm(e){this._node=e,this._names=Mm(e.getAttribute("class")||"")}Tm.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Bm(e,t){for(var r=Dd(e),i=-1,o=t.length;++i<o;)r.add(t[i])}function _m(e,t){for(var r=Dd(e),i=-1,o=t.length;++i<o;)r.remove(t[i])}function cS(e){return function(){Bm(this,e)}}function hS(e){return function(){_m(this,e)}}function dS(e,t){return function(){(t.apply(this,arguments)?Bm:_m)(this,e)}}function uS(e,t){var r=Mm(e+"");if(arguments.length<2){for(var i=Dd(this.node()),o=-1,a=r.length;++o<a;)if(!i.contains(r[o]))return!1;return!0}return this.each((typeof t=="function"?dS:t?cS:hS)(r,t))}function fS(){this.textContent=""}function gS(e){return function(){this.textContent=e}}function pS(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function mS(e){return arguments.length?this.each(e==null?fS:(typeof e=="function"?pS:gS)(e)):this.node().textContent}function yS(){this.innerHTML=""}function xS(e){return function(){this.innerHTML=e}}function bS(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function CS(e){return arguments.length?this.each(e==null?yS:(typeof e=="function"?bS:xS)(e)):this.node().innerHTML}function wS(){this.nextSibling&&this.parentNode.appendChild(this)}function kS(){return this.each(wS)}function SS(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function vS(){return this.each(SS)}function MS(e){var t=typeof e=="function"?e:Cm(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function TS(){return null}function BS(e,t){var r=typeof e=="function"?e:Cm(e),i=t==null?TS:typeof t=="function"?t:wm(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function _S(){var e=this.parentNode;e&&e.removeChild(this)}function LS(){return this.each(_S)}function AS(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function FS(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function $S(e){return this.select(e?FS:AS)}function ES(e){return arguments.length?this.property("__data__",e):this.node().__data__}function PS(e){return function(t){e.call(this,t,this.__data__)}}function IS(e){return e.trim().split(/^|\s+/).map(function(t){var r="",i=t.indexOf(".");return i>=0&&(r=t.slice(i+1),t=t.slice(0,i)),{type:t,name:r}})}function OS(e){return function(){var t=this.__on;if(t){for(var r=0,i=-1,o=t.length,a;r<o;++r)a=t[r],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++i]=a;++i?t.length=i:delete this.__on}}}function DS(e,t,r){return function(){var i=this.__on,o,a=PS(t);if(i){for(var s=0,n=i.length;s<n;++s)if((o=i[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=a,o.options=r),o.value=t;return}}this.addEventListener(e.type,a,r),o={type:e.type,name:e.name,value:t,listener:a,options:r},i?i.push(o):this.__on=[o]}}function RS(e,t,r){var i=IS(e+""),o,a=i.length,s;if(arguments.length<2){var n=this.node().__on;if(n){for(var l=0,c=n.length,h;l<c;++l)for(o=0,h=n[l];o<a;++o)if((s=i[o]).type===h.type&&s.name===h.name)return h.value}return}for(n=t?DS:OS,o=0;o<a;++o)this.each(n(i[o],t,r));return this}function Lm(e,t,r){var i=vm(e),o=i.CustomEvent;typeof o=="function"?o=new o(t,r):(o=i.document.createEvent("Event"),r?(o.initEvent(t,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function NS(e,t){return function(){return Lm(this,e,t)}}function qS(e,t){return function(){return Lm(this,e,t.apply(this,arguments))}}function WS(e,t){return this.each((typeof t=="function"?qS:NS)(e,t))}function*zS(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],o=0,a=i.length,s;o<a;++o)(s=i[o])&&(yield s)}var HS=[null];function Pi(e,t){this._groups=e,this._parents=t}function YS(){return this}Pi.prototype={constructor:Pi,select:uk,selectAll:yk,selectChild:kk,selectChildren:Tk,filter:Bk,data:Ek,enter:_k,exit:Ik,join:Ok,merge:Dk,selection:YS,order:Rk,sort:Nk,call:Wk,nodes:zk,node:Hk,size:Yk,empty:Xk,each:jk,attr:Jk,style:iS,property:lS,classed:uS,text:mS,html:CS,raise:kS,lower:vS,append:MS,insert:BS,remove:LS,clone:$S,datum:ES,on:RS,dispatch:WS,[Symbol.iterator]:zS};function Ye(e){return typeof e=="string"?new Pi([[document.querySelector(e)]],[document.documentElement]):new Pi([[e]],HS)}var XS=0;function Of(){this._="@"+(++XS).toString(36)}Of.prototype={constructor:Of,get:function(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function(e,t){return e[this._]=t},remove:function(e){return this._ in e&&delete e[this._]},toString:function(){return this._}};function Ls(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Sn(e,t){var r=Object.create(e.prototype);for(var i in t)r[i]=t[i];return r}function na(){}var Ba=.7,Cs=1/Ba,es="\\s*([+-]?\\d+)\\s*",fn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ho="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",jS=/^#([0-9a-f]{3,8})$/,GS=new RegExp(`^rgb\\(${es},${es},${es}\\)$`),US=new RegExp(`^rgb\\(${ho},${ho},${ho}\\)$`),VS=new RegExp(`^rgba\\(${es},${es},${es},${fn}\\)$`),ZS=new RegExp(`^rgba\\(${ho},${ho},${ho},${fn}\\)$`),KS=new RegExp(`^hsl\\(${fn},${ho},${ho}\\)$`),QS=new RegExp(`^hsla\\(${fn},${ho},${ho},${fn}\\)$`),Df={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Ls(na,Kl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Rf,formatHex:Rf,formatHex8:JS,formatHsl:tv,formatRgb:Nf,toString:Nf});function Rf(){return this.rgb().formatHex()}function JS(){return this.rgb().formatHex8()}function tv(){return Am(this).formatHsl()}function Nf(){return this.rgb().formatRgb()}function Kl(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=jS.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?qf(t):r===3?new Vr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?On(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?On(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=GS.exec(e))?new Vr(t[1],t[2],t[3],1):(t=US.exec(e))?new Vr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=VS.exec(e))?On(t[1],t[2],t[3],t[4]):(t=ZS.exec(e))?On(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=KS.exec(e))?Hf(t[1],t[2]/100,t[3]/100,1):(t=QS.exec(e))?Hf(t[1],t[2]/100,t[3]/100,t[4]):Df.hasOwnProperty(e)?qf(Df[e]):e==="transparent"?new Vr(NaN,NaN,NaN,0):null}function qf(e){return new Vr(e>>16&255,e>>8&255,e&255,1)}function On(e,t,r,i){return i<=0&&(e=t=r=NaN),new Vr(e,t,r,i)}function Rd(e){return e instanceof na||(e=Kl(e)),e?(e=e.rgb(),new Vr(e.r,e.g,e.b,e.opacity)):new Vr}function ao(e,t,r,i){return arguments.length===1?Rd(e):new Vr(e,t,r,i??1)}function Vr(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}Ls(Vr,ao,Sn(na,{brighter(e){return e=e==null?Cs:Math.pow(Cs,e),new Vr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ba:Math.pow(Ba,e),new Vr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Vr(Ca(this.r),Ca(this.g),Ca(this.b),Bl(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Wf,formatHex:Wf,formatHex8:ev,formatRgb:zf,toString:zf}));function Wf(){return`#${ba(this.r)}${ba(this.g)}${ba(this.b)}`}function ev(){return`#${ba(this.r)}${ba(this.g)}${ba(this.b)}${ba((isNaN(this.opacity)?1:this.opacity)*255)}`}function zf(){const e=Bl(this.opacity);return`${e===1?"rgb(":"rgba("}${Ca(this.r)}, ${Ca(this.g)}, ${Ca(this.b)}${e===1?")":`, ${e})`}`}function Bl(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ca(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ba(e){return e=Ca(e),(e<16?"0":"")+e.toString(16)}function Hf(e,t,r,i){return i<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Xi(e,t,r,i)}function Am(e){if(e instanceof Xi)return new Xi(e.h,e.s,e.l,e.opacity);if(e instanceof na||(e=Kl(e)),!e)return new Xi;if(e instanceof Xi)return e;e=e.rgb();var t=e.r/255,r=e.g/255,i=e.b/255,o=Math.min(t,r,i),a=Math.max(t,r,i),s=NaN,n=a-o,l=(a+o)/2;return n?(t===a?s=(r-i)/n+(r<i)*6:r===a?s=(i-t)/n+2:s=(t-r)/n+4,n/=l<.5?a+o:2-a-o,s*=60):n=l>0&&l<1?0:s,new Xi(s,n,l,e.opacity)}function rv(e,t,r,i){return arguments.length===1?Am(e):new Xi(e,t,r,i??1)}function Xi(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}Ls(Xi,rv,Sn(na,{brighter(e){return e=e==null?Cs:Math.pow(Cs,e),new Xi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ba:Math.pow(Ba,e),new Xi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*t,o=2*r-i;return new Vr(Yc(e>=240?e-240:e+120,o,i),Yc(e,o,i),Yc(e<120?e+240:e-120,o,i),this.opacity)},clamp(){return new Xi(Yf(this.h),Dn(this.s),Dn(this.l),Bl(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Bl(this.opacity);return`${e===1?"hsl(":"hsla("}${Yf(this.h)}, ${Dn(this.s)*100}%, ${Dn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Yf(e){return e=(e||0)%360,e<0?e+360:e}function Dn(e){return Math.max(0,Math.min(1,e||0))}function Yc(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Fm=Math.PI/180,$m=180/Math.PI,_l=18,Em=.96422,Pm=1,Im=.82521,Om=4/29,rs=6/29,Dm=3*rs*rs,iv=rs*rs*rs;function Rm(e){if(e instanceof uo)return new uo(e.l,e.a,e.b,e.opacity);if(e instanceof _o)return Nm(e);e instanceof Vr||(e=Rd(e));var t=Uc(e.r),r=Uc(e.g),i=Uc(e.b),o=Xc((.2225045*t+.7168786*r+.0606169*i)/Pm),a,s;return t===r&&r===i?a=s=o:(a=Xc((.4360747*t+.3850649*r+.1430804*i)/Em),s=Xc((.0139322*t+.0971045*r+.7141733*i)/Im)),new uo(116*o-16,500*(a-o),200*(o-s),e.opacity)}function ov(e,t,r,i){return arguments.length===1?Rm(e):new uo(e,t,r,i??1)}function uo(e,t,r,i){this.l=+e,this.a=+t,this.b=+r,this.opacity=+i}Ls(uo,ov,Sn(na,{brighter(e){return new uo(this.l+_l*(e??1),this.a,this.b,this.opacity)},darker(e){return new uo(this.l-_l*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,r=isNaN(this.b)?e:e-this.b/200;return t=Em*jc(t),e=Pm*jc(e),r=Im*jc(r),new Vr(Gc(3.1338561*t-1.6168667*e-.4906146*r),Gc(-.9787684*t+1.9161415*e+.033454*r),Gc(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}}));function Xc(e){return e>iv?Math.pow(e,1/3):e/Dm+Om}function jc(e){return e>rs?e*e*e:Dm*(e-Om)}function Gc(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Uc(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function av(e){if(e instanceof _o)return new _o(e.h,e.c,e.l,e.opacity);if(e instanceof uo||(e=Rm(e)),e.a===0&&e.b===0)return new _o(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*$m;return new _o(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function sv(e,t,r,i){return arguments.length===1?av(e):new _o(e,t,r,i??1)}function _o(e,t,r,i){this.h=+e,this.c=+t,this.l=+r,this.opacity=+i}function Nm(e){if(isNaN(e.h))return new uo(e.l,0,0,e.opacity);var t=e.h*Fm;return new uo(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Ls(_o,sv,Sn(na,{brighter(e){return new _o(this.h,this.c,this.l+_l*(e??1),this.opacity)},darker(e){return new _o(this.h,this.c,this.l-_l*(e??1),this.opacity)},rgb(){return Nm(this).rgb()}}));var qm=-.14861,Nd=1.78277,qd=-.29227,Ql=-.90649,gn=1.97294,Xf=gn*Ql,jf=gn*Nd,Gf=Nd*qd-Ql*qm;function nv(e){if(e instanceof wa)return new wa(e.h,e.s,e.l,e.opacity);e instanceof Vr||(e=Rd(e));var t=e.r/255,r=e.g/255,i=e.b/255,o=(Gf*i+Xf*t-jf*r)/(Gf+Xf-jf),a=i-o,s=(gn*(r-o)-qd*a)/Ql,n=Math.sqrt(s*s+a*a)/(gn*o*(1-o)),l=n?Math.atan2(s,a)*$m-120:NaN;return new wa(l<0?l+360:l,n,o,e.opacity)}function lv(e,t,r,i){return arguments.length===1?nv(e):new wa(e,t,r,i??1)}function wa(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}Ls(wa,lv,Sn(na,{brighter(e){return e=e==null?Cs:Math.pow(Cs,e),new wa(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ba:Math.pow(Ba,e),new wa(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Fm,t=+this.l,r=isNaN(this.s)?0:this.s*t*(1-t),i=Math.cos(e),o=Math.sin(e);return new Vr(255*(t+r*(qm*i+Nd*o)),255*(t+r*(qd*i+Ql*o)),255*(t+r*(gn*i)),this.opacity)}}));const Us=Math.PI,Ph=2*Us,ga=1e-6,cv=Ph-ga;function Wm(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function hv(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Wm;const r=10**t;return function(i){this._+=i[0];for(let o=1,a=i.length;o<a;++o)this._+=Math.round(arguments[o]*r)/r+i[o]}}function zm(e,t,r,i){return e===r&&t===i}function dv(e){const t=Math.floor(e);if(!(t<=15))return zm;const r=10**t,i=function(o){return Math.round(o*r)};return function(o,a,s,n){return i(o)===i(s)&&i(a)===i(n)}}class uv{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Wm:hv(t),this._equal=t==null?zm:dv(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,i,o){this._append`Q${+t},${+r},${this._x1=+i},${this._y1=+o}`}bezierCurveTo(t,r,i,o,a,s){this._append`C${+t},${+r},${+i},${+o},${this._x1=+a},${this._y1=+s}`}arcTo(t,r,i,o,a){if(t=+t,r=+r,i=+i,o=+o,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,n=this._y1,l=i-t,c=o-r,h=s-t,d=n-r,u=h*h+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(u>ga)if(!(Math.abs(d*l-c*h)>ga)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let f=i-s,g=o-n,p=l*l+c*c,m=f*f+g*g,y=Math.sqrt(p),x=Math.sqrt(u),b=a*Math.tan((Us-Math.acos((p+u-m)/(2*y*x)))/2),S=b/x,T=b/y;Math.abs(S-1)>ga&&this._append`L${t+S*h},${r+S*d}`,this._append`A${a},${a},0,0,${+(d*f>h*g)},${this._x1=t+T*l},${this._y1=r+T*c}`}}arc(t,r,i,o,a,s){if(t=+t,r=+r,i=+i,s=!!s,i<0)throw new Error(`negative radius: ${i}`);let n=i*Math.cos(o),l=i*Math.sin(o),c=t+n,h=r+l,d=1^s,u=s?o-a:a-o;if(this._x1===null?this._append`M${c},${h}`:(Math.abs(this._x1-c)>ga||Math.abs(this._y1-h)>ga)&&this._append`L${c},${h}`,!!i){if(u<0&&(u=u%Ph+Ph),u>cv)this._append`A${i},${i},0,1,${d},${t-n},${r-l}A${i},${i},0,1,${d},${this._x1=c},${this._y1=h}`;else if(u>ga){const f=t+i*Math.cos(a),g=r+i*Math.sin(a);if(u>=Us&&this._equal(c,h,f,g)){u/=2;let p=o+u;this._append`A${i},${i},0,${+(u>=Us)},${d},${t+i*Math.cos(p)},${r+i*Math.sin(p)}`}this._append`A${i},${i},0,${+(u>=Us)},${d},${this._x1=f},${this._y1=g}`}}}rect(t,r,i,o){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${i=+i}v${+o}h${-i}Z`}toString(){return this._}}function Dr(e){return function(){return e}}const Uf=Math.abs,ri=Math.atan2,ca=Math.cos,fv=Math.max,Vc=Math.min,Ji=Math.sin,Va=Math.sqrt,oi=1e-12,pn=Math.PI,Ll=pn/2,ll=2*pn;function gv(e){return e>1?0:e<-1?pn:Math.acos(e)}function Vf(e){return e>=1?Ll:e<=-1?-Ll:Math.asin(e)}function Hm(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const i=Math.floor(r);if(!(i>=0))throw new RangeError(`invalid digits: ${r}`);t=i}return e},()=>new uv(t)}function pv(e){return e.innerRadius}function mv(e){return e.outerRadius}function yv(e){return e.startAngle}function xv(e){return e.endAngle}function bv(e){return e&&e.padAngle}function Cv(e,t,r,i,o,a,s,n){var l=r-e,c=i-t,h=s-o,d=n-a,u=d*l-h*c;if(!(u*u<oi))return u=(h*(t-a)-d*(e-o))/u,[e+u*l,t+u*c]}function Rn(e,t,r,i,o,a,s){var n=e-r,l=t-i,c=(s?a:-a)/Va(n*n+l*l),h=c*l,d=-c*n,u=e+h,f=t+d,g=r+h,p=i+d,m=(u+g)/2,y=(f+p)/2,x=g-u,b=p-f,S=x*x+b*b,T=o-a,k=u*p-g*f,_=(b<0?-1:1)*Va(fv(0,T*T*S-k*k)),L=(k*b-x*_)/S,v=(-k*x-b*_)/S,M=(k*b+x*_)/S,B=(-k*x+b*_)/S,E=L-m,O=v-y,$=M-m,I=B-y;return E*E+O*O>$*$+I*I&&(L=M,v=B),{cx:L,cy:v,x01:-h,y01:-d,x11:L*(o/T-1),y11:v*(o/T-1)}}function aP(){var e=pv,t=mv,r=Dr(0),i=null,o=yv,a=xv,s=bv,n=null,l=Hm(c);function c(){var h,d,u=+e.apply(this,arguments),f=+t.apply(this,arguments),g=o.apply(this,arguments)-Ll,p=a.apply(this,arguments)-Ll,m=Uf(p-g),y=p>g;if(n||(n=h=l()),f<u&&(d=f,f=u,u=d),!(f>oi))n.moveTo(0,0);else if(m>ll-oi)n.moveTo(f*ca(g),f*Ji(g)),n.arc(0,0,f,g,p,!y),u>oi&&(n.moveTo(u*ca(p),u*Ji(p)),n.arc(0,0,u,p,g,y));else{var x=g,b=p,S=g,T=p,k=m,_=m,L=s.apply(this,arguments)/2,v=L>oi&&(i?+i.apply(this,arguments):Va(u*u+f*f)),M=Vc(Uf(f-u)/2,+r.apply(this,arguments)),B=M,E=M,O,$;if(v>oi){var I=Vf(v/u*Ji(L)),F=Vf(v/f*Ji(L));(k-=I*2)>oi?(I*=y?1:-1,S+=I,T-=I):(k=0,S=T=(g+p)/2),(_-=F*2)>oi?(F*=y?1:-1,x+=F,b-=F):(_=0,x=b=(g+p)/2)}var R=f*ca(x),q=f*Ji(x),D=u*ca(T),P=u*Ji(T);if(M>oi){var Y=f*ca(b),X=f*Ji(b),z=u*ca(S),U=u*Ji(S),j;if(m<pn)if(j=Cv(R,q,z,U,Y,X,D,P)){var V=R-j[0],Q=q-j[1],rt=Y-j[0],ht=X-j[1],H=1/Ji(gv((V*rt+Q*ht)/(Va(V*V+Q*Q)*Va(rt*rt+ht*ht)))/2),G=Va(j[0]*j[0]+j[1]*j[1]);B=Vc(M,(u-G)/(H-1)),E=Vc(M,(f-G)/(H+1))}else B=E=0}_>oi?E>oi?(O=Rn(z,U,R,q,f,E,y),$=Rn(Y,X,D,P,f,E,y),n.moveTo(O.cx+O.x01,O.cy+O.y01),E<M?n.arc(O.cx,O.cy,E,ri(O.y01,O.x01),ri($.y01,$.x01),!y):(n.arc(O.cx,O.cy,E,ri(O.y01,O.x01),ri(O.y11,O.x11),!y),n.arc(0,0,f,ri(O.cy+O.y11,O.cx+O.x11),ri($.cy+$.y11,$.cx+$.x11),!y),n.arc($.cx,$.cy,E,ri($.y11,$.x11),ri($.y01,$.x01),!y))):(n.moveTo(R,q),n.arc(0,0,f,x,b,!y)):n.moveTo(R,q),!(u>oi)||!(k>oi)?n.lineTo(D,P):B>oi?(O=Rn(D,P,Y,X,u,-B,y),$=Rn(R,q,z,U,u,-B,y),n.lineTo(O.cx+O.x01,O.cy+O.y01),B<M?n.arc(O.cx,O.cy,B,ri(O.y01,O.x01),ri($.y01,$.x01),!y):(n.arc(O.cx,O.cy,B,ri(O.y01,O.x01),ri(O.y11,O.x11),!y),n.arc(0,0,u,ri(O.cy+O.y11,O.cx+O.x11),ri($.cy+$.y11,$.cx+$.x11),y),n.arc($.cx,$.cy,B,ri($.y11,$.x11),ri($.y01,$.x01),!y))):n.arc(0,0,u,T,S,y)}if(n.closePath(),h)return n=null,h+""||null}return c.centroid=function(){var h=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,d=(+o.apply(this,arguments)+ +a.apply(this,arguments))/2-pn/2;return[ca(d)*h,Ji(d)*h]},c.innerRadius=function(h){return arguments.length?(e=typeof h=="function"?h:Dr(+h),c):e},c.outerRadius=function(h){return arguments.length?(t=typeof h=="function"?h:Dr(+h),c):t},c.cornerRadius=function(h){return arguments.length?(r=typeof h=="function"?h:Dr(+h),c):r},c.padRadius=function(h){return arguments.length?(i=h==null?null:typeof h=="function"?h:Dr(+h),c):i},c.startAngle=function(h){return arguments.length?(o=typeof h=="function"?h:Dr(+h),c):o},c.endAngle=function(h){return arguments.length?(a=typeof h=="function"?h:Dr(+h),c):a},c.padAngle=function(h){return arguments.length?(s=typeof h=="function"?h:Dr(+h),c):s},c.context=function(h){return arguments.length?(n=h??null,c):n},c}function Ym(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Xm(e){this._context=e}Xm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function ln(e){return new Xm(e)}function wv(e){return e[0]}function kv(e){return e[1]}function Sv(e,t){var r=Dr(!0),i=null,o=ln,a=null,s=Hm(n);e=typeof e=="function"?e:e===void 0?wv:Dr(e),t=typeof t=="function"?t:t===void 0?kv:Dr(t);function n(l){var c,h=(l=Ym(l)).length,d,u=!1,f;for(i==null&&(a=o(f=s())),c=0;c<=h;++c)!(c<h&&r(d=l[c],c,l))===u&&((u=!u)?a.lineStart():a.lineEnd()),u&&a.point(+e(d,c,l),+t(d,c,l));if(f)return a=null,f+""||null}return n.x=function(l){return arguments.length?(e=typeof l=="function"?l:Dr(+l),n):e},n.y=function(l){return arguments.length?(t=typeof l=="function"?l:Dr(+l),n):t},n.defined=function(l){return arguments.length?(r=typeof l=="function"?l:Dr(!!l),n):r},n.curve=function(l){return arguments.length?(o=l,i!=null&&(a=o(i)),n):o},n.context=function(l){return arguments.length?(l==null?i=a=null:a=o(i=l),n):i},n}function vv(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function Mv(e){return e}function sP(){var e=Mv,t=vv,r=null,i=Dr(0),o=Dr(ll),a=Dr(0);function s(n){var l,c=(n=Ym(n)).length,h,d,u=0,f=new Array(c),g=new Array(c),p=+i.apply(this,arguments),m=Math.min(ll,Math.max(-ll,o.apply(this,arguments)-p)),y,x=Math.min(Math.abs(m)/c,a.apply(this,arguments)),b=x*(m<0?-1:1),S;for(l=0;l<c;++l)(S=g[f[l]=l]=+e(n[l],l,n))>0&&(u+=S);for(t!=null?f.sort(function(T,k){return t(g[T],g[k])}):r!=null&&f.sort(function(T,k){return r(n[T],n[k])}),l=0,d=u?(m-c*b)/u:0;l<c;++l,p=y)h=f[l],S=g[h],y=p+(S>0?S*d:0)+b,g[h]={data:n[h],index:l,value:S,startAngle:p,endAngle:y,padAngle:x};return g}return s.value=function(n){return arguments.length?(e=typeof n=="function"?n:Dr(+n),s):e},s.sortValues=function(n){return arguments.length?(t=n,r=null,s):t},s.sort=function(n){return arguments.length?(r=n,t=null,s):r},s.startAngle=function(n){return arguments.length?(i=typeof n=="function"?n:Dr(+n),s):i},s.endAngle=function(n){return arguments.length?(o=typeof n=="function"?n:Dr(+n),s):o},s.padAngle=function(n){return arguments.length?(a=typeof n=="function"?n:Dr(+n),s):a},s}class jm{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Gm(e){return new jm(e,!0)}function Um(e){return new jm(e,!1)}function ta(){}function Al(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function Jl(e){this._context=e}Jl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Al(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Al(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ih(e){return new Jl(e)}function Vm(e){this._context=e}Vm.prototype={areaStart:ta,areaEnd:ta,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Al(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Tv(e){return new Vm(e)}function Zm(e){this._context=e}Zm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,i):this._context.moveTo(r,i);break;case 3:this._point=4;default:Al(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Bv(e){return new Zm(e)}function Km(e,t){this._basis=new Jl(e),this._beta=t}Km.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var i=e[0],o=t[0],a=e[r]-i,s=t[r]-o,n=-1,l;++n<=r;)l=n/r,this._basis.point(this._beta*e[n]+(1-this._beta)*(i+l*a),this._beta*t[n]+(1-this._beta)*(o+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var _v=(function e(t){function r(i){return t===1?new Jl(i):new Km(i,t)}return r.beta=function(i){return e(+i)},r})(.85);function Fl(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function Wd(e,t){this._context=e,this._k=(1-t)/6}Wd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Fl(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Fl(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Qm=(function e(t){function r(i){return new Wd(i,t)}return r.tension=function(i){return e(+i)},r})(0);function zd(e,t){this._context=e,this._k=(1-t)/6}zd.prototype={areaStart:ta,areaEnd:ta,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Fl(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Lv=(function e(t){function r(i){return new zd(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Hd(e,t){this._context=e,this._k=(1-t)/6}Hd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Fl(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Av=(function e(t){function r(i){return new Hd(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Yd(e,t,r){var i=e._x1,o=e._y1,a=e._x2,s=e._y2;if(e._l01_a>oi){var n=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*n-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,o=(o*n-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>oi){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,h=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*c+e._x1*e._l23_2a-t*e._l12_2a)/h,s=(s*c+e._y1*e._l23_2a-r*e._l12_2a)/h}e._context.bezierCurveTo(i,o,a,s,e._x2,e._y2)}function Jm(e,t){this._context=e,this._alpha=t}Jm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Yd(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ty=(function e(t){function r(i){return t?new Jm(i,t):new Wd(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function ey(e,t){this._context=e,this._alpha=t}ey.prototype={areaStart:ta,areaEnd:ta,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Yd(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Fv=(function e(t){function r(i){return t?new ey(i,t):new zd(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function ry(e,t){this._context=e,this._alpha=t}ry.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Yd(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var $v=(function e(t){function r(i){return t?new ry(i,t):new Hd(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function iy(e){this._context=e}iy.prototype={areaStart:ta,areaEnd:ta,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Ev(e){return new iy(e)}function Zf(e){return e<0?-1:1}function Kf(e,t,r){var i=e._x1-e._x0,o=t-e._x1,a=(e._y1-e._y0)/(i||o<0&&-0),s=(r-e._y1)/(o||i<0&&-0),n=(a*o+s*i)/(i+o);return(Zf(a)+Zf(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(n))||0}function Qf(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Zc(e,t,r){var i=e._x0,o=e._y0,a=e._x1,s=e._y1,n=(a-i)/3;e._context.bezierCurveTo(i+n,o+n*t,a-n,s-n*r,a,s)}function $l(e){this._context=e}$l.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Zc(this,this._t0,Qf(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Zc(this,Qf(this,r=Kf(this,e,t)),r);break;default:Zc(this,this._t0,r=Kf(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function oy(e){this._context=new ay(e)}(oy.prototype=Object.create($l.prototype)).point=function(e,t){$l.prototype.point.call(this,t,e)};function ay(e){this._context=e}ay.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,i,o,a){this._context.bezierCurveTo(t,e,i,r,a,o)}};function sy(e){return new $l(e)}function ny(e){return new oy(e)}function ly(e){this._context=e}ly.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var i=Jf(e),o=Jf(t),a=0,s=1;s<r;++a,++s)this._context.bezierCurveTo(i[0][a],o[0][a],i[1][a],o[1][a],e[s],t[s]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Jf(e){var t,r=e.length-1,i,o=new Array(r),a=new Array(r),s=new Array(r);for(o[0]=0,a[0]=2,s[0]=e[0]+2*e[1],t=1;t<r-1;++t)o[t]=1,a[t]=4,s[t]=4*e[t]+2*e[t+1];for(o[r-1]=2,a[r-1]=7,s[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)i=o[t]/a[t-1],a[t]-=i,s[t]-=i*s[t-1];for(o[r-1]=s[r-1]/a[r-1],t=r-2;t>=0;--t)o[t]=(s[t]-o[t+1])/a[t];for(a[r-1]=(e[r]+o[r-1])/2,t=0;t<r-1;++t)a[t]=2*e[t+1]-o[t+1];return[o,a]}function cy(e){return new ly(e)}function tc(e,t){this._context=e,this._t=t}tc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function hy(e){return new tc(e,.5)}function dy(e){return new tc(e,0)}function uy(e){return new tc(e,1)}function Kc(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!=="[object Object]"){const r=e[Symbol.toStringTag];return r==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${r}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Pv(){}function fy(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Xd(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Iv="[object RegExp]",gy="[object String]",py="[object Number]",my="[object Boolean]",yy="[object Arguments]",Ov="[object Symbol]",Dv="[object Date]",Rv="[object Map]",Nv="[object Set]",qv="[object Array]",Wv="[object ArrayBuffer]",zv="[object Object]",Hv="[object DataView]",Yv="[object Uint8Array]",Xv="[object Uint8ClampedArray]",jv="[object Uint16Array]",Gv="[object Uint32Array]",Uv="[object Int8Array]",Vv="[object Int16Array]",Zv="[object Int32Array]",Kv="[object Float32Array]",Qv="[object Float64Array]",tg=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function jd(e){return typeof tg.Buffer<"u"&&tg.Buffer.isBuffer(e)}function Jv(e){return Number.isSafeInteger(e)&&e>=0}function xy(e){return e!=null&&typeof e!="function"&&Jv(e.length)}function tM(e){return e==="__proto__"}function Gd(e){return e==null||typeof e!="object"&&typeof e!="function"}function Ud(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function eM(e,t){return Za(e,void 0,e,new Map,t)}function Za(e,t,r,i=new Map,o=void 0){const a=o?.(e,t,r,i);if(a!==void 0)return a;if(Gd(e))return e;if(i.has(e))return i.get(e);if(Array.isArray(e)){const s=new Array(e.length);i.set(e,s);for(let n=0;n<e.length;n++)s[n]=Za(e[n],n,r,i,o);return Object.hasOwn(e,"index")&&(s.index=e.index),Object.hasOwn(e,"input")&&(s.input=e.input),s}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const s=new RegExp(e.source,e.flags);return s.lastIndex=e.lastIndex,s}if(e instanceof Map){const s=new Map;i.set(e,s);for(const[n,l]of e)s.set(n,Za(l,n,r,i,o));return s}if(e instanceof Set){const s=new Set;i.set(e,s);for(const n of e)s.add(Za(n,void 0,r,i,o));return s}if(jd(e))return e.subarray();if(Ud(e)){const s=new(Object.getPrototypeOf(e)).constructor(e.length);i.set(e,s);for(let n=0;n<e.length;n++)s[n]=Za(e[n],n,r,i,o);return s}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const s=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return i.set(e,s),Wi(s,e,r,i,o),s}if(typeof File<"u"&&e instanceof File){const s=new File([e],e.name,{type:e.type});return i.set(e,s),Wi(s,e,r,i,o),s}if(typeof Blob<"u"&&e instanceof Blob){const s=new Blob([e],{type:e.type});return i.set(e,s),Wi(s,e,r,i,o),s}if(e instanceof Error){const s=structuredClone(e);return i.set(e,s),s.message=e.message,s.name=e.name,s.stack=e.stack,s.cause=e.cause,s.constructor=e.constructor,Wi(s,e,r,i,o),s}if(e instanceof Boolean){const s=new Boolean(e.valueOf());return i.set(e,s),Wi(s,e,r,i,o),s}if(e instanceof Number){const s=new Number(e.valueOf());return i.set(e,s),Wi(s,e,r,i,o),s}if(e instanceof String){const s=new String(e.valueOf());return i.set(e,s),Wi(s,e,r,i,o),s}if(typeof e=="object"&&rM(e)){const s=Object.create(Object.getPrototypeOf(e));return i.set(e,s),Wi(s,e,r,i,o),s}return e}function Wi(e,t,r=e,i,o){const a=[...Object.keys(t),...fy(t)];for(let s=0;s<a.length;s++){const n=a[s],l=Object.getOwnPropertyDescriptor(e,n);(l==null||l.writable)&&(e[n]=Za(t[n],n,r,i,o))}}function rM(e){switch(Xd(e)){case yy:case qv:case Wv:case Hv:case my:case Dv:case Kv:case Qv:case Uv:case Vv:case Zv:case Rv:case py:case zv:case Iv:case Nv:case gy:case Ov:case Yv:case Xv:case jv:case Gv:return!0;default:return!1}}function iM(e,t){return eM(e,(r,i,o,a)=>{if(typeof e=="object"){if(Xd(e)==="[object Object]"&&typeof e.constructor!="function"){const s={};return a.set(e,s),Wi(s,e,o,a),s}switch(Object.prototype.toString.call(e)){case py:case gy:case my:{const s=new e.constructor(e?.valueOf());return Wi(s,e),s}case yy:{const s={};return Wi(s,e),s.length=e.length,s[Symbol.iterator]=e[Symbol.iterator],s}default:return}}})}function eg(e){return iM(e)}function Oh(e){return e!==null&&typeof e=="object"&&Xd(e)==="[object Arguments]"}function Dh(e){return typeof e=="object"&&e!==null}function oM(e){return Dh(e)&&xy(e)}function cl(e){return Ud(e)}function aM(e){const t=e?.constructor;return e===(typeof t=="function"?t.prototype:Object.prototype)}function vn(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");const r=function(...i){const o=t?t.apply(this,i):i[0],a=r.cache;if(a.has(o))return a.get(o);const s=e.apply(this,i);return r.cache=a.set(o,s)||a,s};return r.cache=new(vn.Cache||Map),r}vn.Cache=Map;function sM(e){if(Gd(e))return e;if(Array.isArray(e)||Ud(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);const t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);const r=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new r(e);if(e instanceof RegExp){const i=new r(e);return i.lastIndex=e.lastIndex,i}if(e instanceof DataView)return new r(e.buffer.slice(0));if(e instanceof Error){let i;return e instanceof AggregateError?i=new r(e.errors,e.message,{cause:e.cause}):i=new r(e.message,{cause:e.cause}),i.stack=e.stack,Object.assign(i,e),i}return typeof File<"u"&&e instanceof File?new r([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e=="object"?Object.assign(Object.create(t),e):e}function nM(e,...t){const r=t.slice(0,-1),i=t[t.length-1];let o=e;for(let a=0;a<r.length;a++){const s=r[a];o=hl(o,s,i,new Map)}return o}function hl(e,t,r,i){if(Gd(e)&&(e=Object(e)),t==null||typeof t!="object")return e;if(i.has(t))return sM(i.get(t));if(i.set(t,e),Array.isArray(t)){t=t.slice();for(let a=0;a<t.length;a++)a in t||(t[a]=void 0)}const o=[...Object.keys(t),...fy(t)];for(let a=0;a<o.length;a++){const s=o[a];if(tM(s))continue;let n=t[s],l=e[s];if(Oh(n)&&(n={...n}),Oh(l)&&(l={...l}),jd(n)&&(n=eg(n)),Array.isArray(n))if(Array.isArray(l)){const h=[],d=Reflect.ownKeys(l);for(let u=0;u<d.length;u++){const f=d[u];h[f]=l[f]}l=h}else if(oM(l)){const h=[];for(let d=0;d<l.length;d++)h[d]=l[d];l=h}else l=[];const c=r(l,n,s,e,t,i);c!==void 0?e[s]=c:Array.isArray(n)||Dh(l)&&Dh(n)&&(Kc(l)||Kc(n)||cl(l)||cl(n))?e[s]=hl(l,n,r,i):l==null&&Kc(n)?e[s]=hl({},n,r,i):l==null&&cl(n)?e[s]=eg(n):(l===void 0||n!==void 0)&&(e[s]=n)}return e}function lM(e,...t){return nM(e,...t,Pv)}function rg(e){if(e==null)return!0;if(xy(e))return typeof e.splice!="function"&&typeof e!="string"&&!jd(e)&&!cl(e)&&!Oh(e)?!1:e.length===0;if(typeof e=="object"||typeof e=="function"){if(e instanceof Map||e instanceof Set)return e.size===0;const t=Object.keys(e);return aM(e)?t.filter(r=>r!=="constructor").length===0:t.length===0}return!0}var cM="​",hM={curveBasis:Ih,curveBasisClosed:Tv,curveBasisOpen:Bv,curveBumpX:Gm,curveBumpY:Um,curveBundle:_v,curveCardinalClosed:Lv,curveCardinalOpen:Av,curveCardinal:Qm,curveCatmullRomClosed:Fv,curveCatmullRomOpen:$v,curveCatmullRom:ty,curveLinear:ln,curveLinearClosed:Ev,curveMonotoneX:sy,curveMonotoneY:ny,curveNatural:cy,curveStep:hy,curveStepAfter:uy,curveStepBefore:dy},dM=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,uM=C(function(e,t){const r=by(e,/(?:init\b)|(?:initialize\b)/);let i={};if(Array.isArray(r)){const s=r.map(n=>n.args);xl(s),i=Wr(i,[...s])}else i=r.args;if(!i)return;let o=Zl(e,t);const a="config";return i[a]!==void 0&&(o==="flowchart-v2"&&(o="flowchart"),i[o]=i[a],delete i[a]),i},"detectInit"),by=C(function(e,t=null){try{const r=new RegExp(`[%]{2}(?![{]${dM.source})(?=[}][%]{2}).*
160
- `,"ig");e=e.trim().replace(r,"").replace(/'/gm,'"'),Lt.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let i;const o=[];for(;(i=an.exec(e))!==null;)if(i.index===an.lastIndex&&an.lastIndex++,i&&!t||t&&i[1]?.match(t)||t&&i[2]?.match(t)){const a=i[1]?i[1]:i[2],s=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;o.push({type:a,args:s})}return o.length===0?{type:e,args:null}:o.length===1?o[0]:o}catch(r){return Lt.error(`ERROR: ${r.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),fM=C(function(e){return e.replace(an,"")},"removeDirectives"),gM=C(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function Vd(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return hM[r]??t}C(Vd,"interpolateToCurve");function Cy(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?lk.sanitizeUrl(r):r}C(Cy,"formatUrl");var pM=C((e,...t)=>{const r=e.split("."),i=r.length-1,o=r[i];let a=window;for(let s=0;s<i;s++)if(a=a[r[s]],!a){Lt.error(`Function name: ${e} not found in window`);return}a[o](...t)},"runFunc");function Zd(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}C(Zd,"distance");function wy(e){let t,r=0;e.forEach(o=>{r+=Zd(o,t),t=o});const i=r/2;return Kd(e,i)}C(wy,"traverseEdge");function ky(e){return e.length===1?e[0]:wy(e)}C(ky,"calcLabelPosition");var ig=C((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),Kd=C((e,t)=>{let r,i=t;for(const o of e){if(r){const a=Zd(o,r);if(a===0)return r;if(a<i)i-=a;else{const s=i/a;if(s<=0)return r;if(s>=1)return{x:o.x,y:o.y};if(s>0&&s<1)return{x:ig((1-s)*r.x+s*o.x,5),y:ig((1-s)*r.y+s*o.y,5)}}}r=o}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),mM=C((e,t,r)=>{Lt.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const o=Kd(t,25),a=e?10:5,s=Math.atan2(t[0].y-o.y,t[0].x-o.x),n={x:0,y:0};return n.x=Math.sin(s)*a+(t[0].x+o.x)/2,n.y=-Math.cos(s)*a+(t[0].y+o.y)/2,n},"calcCardinalityPosition");function Sy(e,t,r){const i=structuredClone(r);Lt.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();const o=25+e,a=Kd(i,o),s=10+e*.5,n=Math.atan2(i[0].y-a.y,i[0].x-a.x),l={x:0,y:0};return t==="start_left"?(l.x=Math.sin(n+Math.PI)*s+(i[0].x+a.x)/2,l.y=-Math.cos(n+Math.PI)*s+(i[0].y+a.y)/2):t==="end_right"?(l.x=Math.sin(n-Math.PI)*s+(i[0].x+a.x)/2,l.y=-Math.cos(n-Math.PI)*s+(i[0].y+a.y)/2):(l.x=Math.sin(n)*s+(i[0].x+a.x)/2,l.y=-Math.cos(n)*s+(i[0].y+a.y)/2),l}C(Sy,"calcTerminalLabelPosition");function vy(e){let t="",r="";for(const i of e)i!==void 0&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":t=t+i+";");return{style:t,labelStyle:r}}C(vy,"getStylesFromArray");var og=0,yM=C(()=>(og++,"id-"+Math.random().toString(36).substr(2,12)+"-"+og),"generateId");function My(e){let t="";const r="0123456789abcdef",i=r.length;for(let o=0;o<e;o++)t+=r.charAt(Math.floor(Math.random()*i));return t}C(My,"makeRandomHex");var xM=C(e=>My(e.length),"random"),bM=C(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),CM=C(function(e,t){const r=t.text.replace(kn.lineBreakRegex," "),[,i]=ec(t.fontSize),o=e.append("text");o.attr("x",t.x),o.attr("y",t.y),o.style("text-anchor",t.anchor),o.style("font-family",t.fontFamily),o.style("font-size",i),o.style("font-weight",t.fontWeight),o.attr("fill",t.fill),t.class!==void 0&&o.attr("class",t.class);const a=o.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.attr("fill",t.fill),a.text(r),o},"drawSimpleText"),wM=vn((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),kn.hasBreaks(e)))return e;const i=e.split(" ").filter(Boolean),o=[];let a="";return i.forEach((s,n)=>{const l=Po(`${s} `,r),c=Po(a,r);if(l>t){const{hyphenatedStrings:u,remainingWord:f}=kM(s,t,"-",r);o.push(a,...u),a=f}else c+l>=t?(o.push(a),a=s):a=[a,s].filter(Boolean).join(" ");n+1===i.length&&o.push(a)}),o.filter(s=>s!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),kM=vn((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const o=[...e],a=[];let s="";return o.forEach((n,l)=>{const c=`${s}${n}`;if(Po(c,i)>=t){const d=l+1,u=o.length===d,f=`${c}${r}`;a.push(u?c:f),s=""}else s=c}),{hyphenatedStrings:a,remainingWord:s}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function Ty(e,t){return Qd(e,t).height}C(Ty,"calculateTextHeight");function Po(e,t){return Qd(e,t).width}C(Po,"calculateTextWidth");var Qd=vn((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:o=400}=t;if(!e)return{width:0,height:0};const[,a]=ec(r),s=["sans-serif",i],n=e.split(kn.lineBreakRegex),l=[],c=Ye("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const h=c.append("svg");for(const u of s){let f=0;const g={width:0,height:0,lineHeight:0};for(const p of n){const m=bM();m.text=p||cM;const y=CM(h,m).style("font-size",a).style("font-weight",o).style("font-family",u),x=(y._groups||y)[0][0].getBBox();if(x.width===0&&x.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,x.width)),f=Math.round(x.height),g.height+=f,g.lineHeight=Math.round(Math.max(g.lineHeight,f))}l.push(g)}h.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),ys,SM=(ys=class{constructor(t=!1,r){this.count=0,this.count=r?r.length:0,this.next=t?()=>this.count++:()=>Date.now()}},C(ys,"InitIDGenerator"),ys),Nn,vM=C(function(e){return Nn=Nn||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Nn.innerHTML=e,unescape(Nn.textContent)},"entityDecode");function Jd(e){return"str"in e}C(Jd,"isDetailedError");function By(e){return e instanceof Error?e.message:String(e)}C(By,"getErrorMessage");var MM=C((e,t,r,i)=>{if(!i)return;const o=e.node()?.getBBox();o&&e.append("text").text(i).attr("text-anchor","middle").attr("x",o.x+o.width/2).attr("y",-r).attr("class",t)},"insertTitle"),ec=C(e=>{if(typeof e=="number")return[e,e+"px"];const t=parseInt(e??"",10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+"px"]:[t,e]},"parseFontSize");function tu(e,t){return lM({},e,t)}C(tu,"cleanAndMerge");var Si={assignWithDepth:Wr,wrapLabel:wM,calculateTextHeight:Ty,calculateTextWidth:Po,calculateTextDimensions:Qd,cleanAndMerge:tu,detectInit:uM,detectDirective:by,isSubstringInArray:gM,interpolateToCurve:Vd,calcLabelPosition:ky,calcCardinalityPosition:mM,calcTerminalLabelPosition:Sy,formatUrl:Cy,getStylesFromArray:vy,generateId:yM,random:xM,runFunc:pM,entityDecode:vM,insertTitle:MM,isLabelCoordinateInPath:_y,parseFontSize:ec,InitIDGenerator:SM},TM=C(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/#\w+;/g,function(r){const i=r.substring(1,r.length-1);return/^\+?\d+$/.test(i)?"fl°°"+i+"¶ß":"fl°"+i+"¶ß"}),t},"encodeEntities"),ea=C(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),nP=C((e,t,{counter:r=0,prefix:i,suffix:o},a)=>a||`${i?`${i}_`:""}${e}_${t}_${r}${o?`_${o}`:""}`,"getEdgeId");function Hr(e){return e??null}C(Hr,"handleUndefinedAttr");function _y(e,t){const r=Math.round(e.x),i=Math.round(e.y),o=t.replace(/(\d+\.\d+)/g,a=>Math.round(parseFloat(a)).toString());return o.includes(r.toString())||o.includes(i.toString())}C(_y,"isLabelCoordinateInPath");function eu(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ea=eu();function Ly(e){Ea=e}var cn={exec:()=>null};function ur(e,t=""){let r=typeof e=="string"?e:e.source,i={replace:(o,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(fi.caret,"$1"),r=r.replace(o,s),i},getRegex:()=>new RegExp(r,t)};return i}var BM=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),fi={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},_M=/^(?:[ \t]*(?:\n|$))+/,LM=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,AM=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Mn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,FM=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ru=/(?:[*+-]|\d{1,9}[.)])/,Ay=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Fy=ur(Ay).replace(/bull/g,ru).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),$M=ur(Ay).replace(/bull/g,ru).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),iu=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,EM=/^[^\n]+/,ou=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,PM=ur(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ou).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),IM=ur(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ru).getRegex(),rc="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",au=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,OM=ur("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",au).replace("tag",rc).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),$y=ur(iu).replace("hr",Mn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rc).getRegex(),DM=ur(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",$y).getRegex(),su={blockquote:DM,code:LM,def:PM,fences:AM,heading:FM,hr:Mn,html:OM,lheading:Fy,list:IM,newline:_M,paragraph:$y,table:cn,text:EM},ag=ur("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Mn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rc).getRegex(),RM={...su,lheading:$M,table:ag,paragraph:ur(iu).replace("hr",Mn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ag).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rc).getRegex()},NM={...su,html:ur(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",au).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:cn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ur(iu).replace("hr",Mn).replace("heading",` *#{1,6} *[^
159
+ `)},"setAccDescription"),_w=C(()=>Ed,"getAccDescription"),Lw=C(e=>{$d=Pd(e)},"setDiagramTitle"),Aw=C(()=>$d,"getDiagramTitle"),_f=Lt,Fw=_d,Ge=Ar,sP=am,nP=Jo,Id=C(e=>Ei(e,Ge()),"sanitizeText"),$w=Cw,Ew=C(()=>fm,"getCommonDb"),kl={},Sl=C((e,t,r)=>{kl[e]&&_f.warn(`Diagram with id ${e} already registered. Overwriting.`),kl[e]=t,r&&tm(e,r),kw(e,t.styles),t.injectUtils?.(_f,Fw,Ge,Id,$w,Ew(),()=>{})},"registerDiagram"),$h=C(e=>{if(e in kl)return kl[e];throw new Pw(e)},"getDiagram"),ms,Pw=(ms=class extends Error{constructor(t){super(`Diagram ${t} not found.`)}},C(ms,"DiagramNotFoundError"),ms),Iw=C(e=>{const{handDrawnSeed:t}=Ge();return{fill:e,hachureAngle:120,hachureGap:1.5,fillWeight:1.5,roughness:.7,stroke:e,seed:t}},"solidStateFill"),Ow=C(e=>Array.isArray(e)?e:e?e.split(";").map(t=>t.trim()).filter(Boolean):[],"normalizeStyleList"),sa=C(e=>{const t=Dw([...e.cssCompiledStyles||[],...e.cssStyles||[],...Ow(e.labelStyle)]);return{stylesMap:t,stylesArray:[...t]}},"compileStyles"),Dw=C(e=>{const t=new Map;return e.forEach(r=>{const[i,o]=r.split(":");t.set(i.trim(),o?.trim())}),t},"styles2Map"),gm=C(e=>e==="color"||e==="font-size"||e==="font-family"||e==="font-weight"||e==="font-style"||e==="text-decoration"||e==="text-align"||e==="text-transform"||e==="line-height"||e==="letter-spacing"||e==="word-spacing"||e==="text-shadow"||e==="text-overflow"||e==="white-space"||e==="word-wrap"||e==="word-break"||e==="overflow-wrap"||e==="hyphens","isLabelStyle"),Ut=C(e=>{const{stylesArray:t}=sa(e),r=[],i=[],o=[],a=[];return t.forEach(s=>{const n=s[0];gm(n)?r.push(s.join(":")+" !important"):(i.push(s.join(":")+" !important"),n.includes("stroke")&&o.push(s.join(":")+" !important"),n==="fill"&&a.push(s.join(":")+" !important"))}),{labelStyles:r.join(";"),nodeStyles:i.join(";"),stylesArray:t,borderStyles:o,backgroundStyles:a}},"styles2String"),Gt=C((e,t)=>{const{themeVariables:r,handDrawnSeed:i}=Ge(),{nodeBorder:o,mainBkg:a}=r,{stylesMap:s}=sa(e);return Object.assign({roughness:.7,fill:s.get("fill")||a,fillStyle:"hachure",fillWeight:1.5,hachureGap:1.5,stroke:s.get("stroke")||o,seed:i,strokeWidth:s.get("stroke-width")?.replace("px","")||1.3,fillLineDash:[0,0],strokeLineDash:Rw(s.get("stroke-dasharray"))},t)},"userNodeOverrides"),Rw=C(e=>{if(!e)return[0,0];const t=e.trim().split(/\s+/).map(Number);if(t.length===1){const o=isNaN(t[0])?0:t[0];return[o,o]}const r=isNaN(t[0])?0:t[0],i=isNaN(t[1])?0:t[1];return[r,i]},"getStrokeDashArray");const Nw=Object.freeze({left:0,top:0,width:16,height:16}),vl=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),pm=Object.freeze({...Nw,...vl}),qw=Object.freeze({...pm,body:"",hidden:!1}),Ww=Object.freeze({width:null,height:null}),zw=Object.freeze({...Ww,...vl}),Hw=(e,t,r,i="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;i=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const n=o.pop(),l=o.pop(),c={provider:o.length>0?o[0]:i,prefix:l,name:n};return Hc(c)?c:null}const a=o[0],s=a.split("-");if(s.length>1){const n={provider:i,prefix:s.shift(),name:s.join("-")};return Hc(n)?n:null}if(r&&i===""){const n={provider:i,prefix:"",name:a};return Hc(n,r)?n:null}return null},Hc=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1;function Yw(e,t){const r={};!e.hFlip!=!t.hFlip&&(r.hFlip=!0),!e.vFlip!=!t.vFlip&&(r.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(r.rotate=i),r}function Lf(e,t){const r=Yw(e,t);for(const i in qw)i in vl?i in e&&!(i in r)&&(r[i]=vl[i]):i in t?r[i]=t[i]:i in e&&(r[i]=e[i]);return r}function Xw(e,t){const r=e.icons,i=e.aliases||Object.create(null),o=Object.create(null);function a(s){if(r[s])return o[s]=[];if(!(s in o)){o[s]=null;const n=i[s]&&i[s].parent,l=n&&a(n);l&&(o[s]=[n].concat(l))}return o[s]}return(t||Object.keys(r).concat(Object.keys(i))).forEach(a),o}function Af(e,t,r){const i=e.icons,o=e.aliases||Object.create(null);let a={};function s(n){a=Lf(i[n]||o[n],a)}return s(t),r.forEach(s),Lf(e,a)}function jw(e,t){if(e.icons[t])return Af(e,t,[]);const r=Xw(e,[t])[t];return r?Af(e,t,r):null}const Gw=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Uw=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Ff(e,t,r){if(t===1)return e;if(r=r||100,typeof e=="number")return Math.ceil(e*t*r)/r;if(typeof e!="string")return e;const i=e.split(Gw);if(i===null||!i.length)return e;const o=[];let a=i.shift(),s=Uw.test(a);for(;;){if(s){const n=parseFloat(a);isNaN(n)?o.push(a):o.push(Math.ceil(n*t*r)/r)}else o.push(a);if(a=i.shift(),a===void 0)return o.join("");s=!s}}function Vw(e,t="defs"){let r="";const i=e.indexOf("<"+t);for(;i>=0;){const o=e.indexOf(">",i),a=e.indexOf("</"+t);if(o===-1||a===-1)break;const s=e.indexOf(">",a);if(s===-1)break;r+=e.slice(o+1,a).trim(),e=e.slice(0,i).trim()+e.slice(s+1)}return{defs:r,content:e}}function Zw(e,t){return e?"<defs>"+e+"</defs>"+t:t}function Kw(e,t,r){const i=Vw(e);return Zw(i.defs,t+i.content+r)}const Qw=e=>e==="unset"||e==="undefined"||e==="none";function Jw(e,t){const r={...pm,...e},i={...zw,...t},o={left:r.left,top:r.top,width:r.width,height:r.height};let a=r.body;[r,i].forEach(p=>{const m=[],y=p.hFlip,x=p.vFlip;let b=p.rotate;y?x?b+=2:(m.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),m.push("scale(-1 1)"),o.top=o.left=0):x&&(m.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),m.push("scale(1 -1)"),o.top=o.left=0);let S;switch(b<0&&(b-=Math.floor(b/4)*4),b=b%4,b){case 1:S=o.height/2+o.top,m.unshift("rotate(90 "+S.toString()+" "+S.toString()+")");break;case 2:m.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:S=o.width/2+o.left,m.unshift("rotate(-90 "+S.toString()+" "+S.toString()+")");break}b%2===1&&(o.left!==o.top&&(S=o.left,o.left=o.top,o.top=S),o.width!==o.height&&(S=o.width,o.width=o.height,o.height=S)),m.length&&(a=Kw(a,'<g transform="'+m.join(" ")+'">',"</g>"))});const s=i.width,n=i.height,l=o.width,c=o.height;let h,d;s===null?(d=n===null?"1em":n==="auto"?c:n,h=Ff(d,l/c)):(h=s==="auto"?l:s,d=n===null?Ff(h,c/l):n==="auto"?c:n);const u={},f=(p,m)=>{Qw(m)||(u[p]=m.toString())};f("width",h),f("height",d);const g=[o.left,o.top,l,c];return u.viewBox=g.join(" "),{attributes:u,viewBox:g,body:a}}const tk=/\sid="(\S+)"/g,$f=new Map;function ek(e){e=e.replace(/[0-9]+$/,"")||"a";const t=$f.get(e)||0;return $f.set(e,t+1),t?`${e}${t}`:e}function rk(e){const t=[];let r;for(;r=tk.exec(e);)t.push(r[1]);if(!t.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return t.forEach(o=>{const a=ek(o),s=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+s+')([")]|\\.[a-z])',"g"),"$1"+a+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}function ik(e,t){let r=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)r+=" "+i+'="'+t[i]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+r+">"+e+"</svg>"}var ok={body:'<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/><text transform="translate(21.16 64.67)" style="fill: #fff; font-family: ArialMT, Arial; font-size: 67.75px;"><tspan x="0" y="0">?</tspan></text></g>',height:80,width:80},Ml=new Map,Od=new Map,mm=C(e=>{for(const t of e){if(!t.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(Lt.debug("Registering icon pack:",t.name),"loader"in t)Od.set(t.name,t.loader);else if("icons"in t)Ml.set(t.name,t.icons);else throw Lt.error("Invalid icon loader:",t),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),ak=C(e=>Ml.has(e)||Od.has(e),"isIconPackRegistered"),ym=C(async(e,t)=>{const r=Hw(e,!0,t!==void 0);if(!r)throw new Error(`Invalid icon name: ${e}`);const i=r.prefix||t;if(!i)throw new Error(`Icon name must contain a prefix: ${e}`);let o=Ml.get(i);if(!o){const s=Od.get(i);if(!s)throw new Error(`Icon set not found: ${r.prefix}`);try{o={...await s(),prefix:i},Ml.set(i,o)}catch(n){throw Lt.error(n),new Error(`Failed to load icon set: ${r.prefix}`)}}const a=jw(o,r.name);if(!a)throw new Error(`Icon not found: ${e}`);return a},"getRegisteredIconData"),xm=C(async e=>{try{return await ym(e),!0}catch{return!1}},"isIconAvailable"),$a=C(async(e,t,r)=>{let i;try{i=await ym(e,t?.fallbackPrefix)}catch(s){Lt.error(s),i=ok}const o=Jw(i,t),a=ik(rk(o.body),{...o.attributes,...r});return Ei(a,Ar())},"getIconSVG"),In={},Yr={},Ef;function sk(){return Ef||(Ef=1,Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.BLANK_URL=Yr.relativeFirstCharacters=Yr.whitespaceEscapeCharsRegex=Yr.urlSchemeRegex=Yr.ctrlCharactersRegex=Yr.htmlCtrlEntityRegex=Yr.htmlEntitiesRegex=Yr.invalidProtocolRegex=void 0,Yr.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,Yr.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,Yr.htmlCtrlEntityRegex=/&(newline|tab);/gi,Yr.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,Yr.urlSchemeRegex=/^.+(:|&colon;)/gim,Yr.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,Yr.relativeFirstCharacters=[".","/"],Yr.BLANK_URL="about:blank"),Yr}var Pf;function nk(){if(Pf)return In;Pf=1,Object.defineProperty(In,"__esModule",{value:!0}),In.sanitizeUrl=a;var e=sk();function t(s){return e.relativeFirstCharacters.indexOf(s[0])>-1}function r(s){var n=s.replace(e.ctrlCharactersRegex,"");return n.replace(e.htmlEntitiesRegex,function(l,c){return String.fromCharCode(c)})}function i(s){return URL.canParse(s)}function o(s){try{return decodeURIComponent(s)}catch{return s}}function a(s){if(!s)return e.BLANK_URL;var n,l=o(s.trim());do l=r(l).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),l=o(l),n=l.match(e.ctrlCharactersRegex)||l.match(e.htmlEntitiesRegex)||l.match(e.htmlCtrlEntityRegex)||l.match(e.whitespaceEscapeCharsRegex);while(n&&n.length>0);var c=l;if(!c)return e.BLANK_URL;if(t(c))return c;var h=c.trimStart(),d=h.match(e.urlSchemeRegex);if(!d)return c;var u=d[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(u))return e.BLANK_URL;var f=h.replace(/\\/g,"/");if(u==="mailto:"||u.includes("://"))return f;if(u==="http:"||u==="https:"){if(!i(f))return e.BLANK_URL;var g=new URL(f);return g.protocol=g.protocol.toLowerCase(),g.hostname=g.hostname.toLowerCase(),g.toString()}return f}return In}var lk=nk(),Eh="http://www.w3.org/1999/xhtml",If={svg:"http://www.w3.org/2000/svg",xhtml:Eh,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function bm(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),If.hasOwnProperty(t)?{space:If[t],local:e}:e}function ck(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Eh&&t.documentElement.namespaceURI===Eh?t.createElement(e):t.createElementNS(r,e)}}function hk(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Cm(e){var t=bm(e);return(t.local?hk:ck)(t)}function dk(){}function wm(e){return e==null?dk:function(){return this.querySelector(e)}}function uk(e){typeof e!="function"&&(e=wm(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var a=t[o],s=a.length,n=i[o]=new Array(s),l,c,h=0;h<s;++h)(l=a[h])&&(c=e.call(l,l.__data__,h,a))&&("__data__"in l&&(c.__data__=l.__data__),n[h]=c);return new Pi(i,this._parents)}function fk(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function gk(){return[]}function pk(e){return e==null?gk:function(){return this.querySelectorAll(e)}}function mk(e){return function(){return fk(e.apply(this,arguments))}}function yk(e){typeof e=="function"?e=mk(e):e=pk(e);for(var t=this._groups,r=t.length,i=[],o=[],a=0;a<r;++a)for(var s=t[a],n=s.length,l,c=0;c<n;++c)(l=s[c])&&(i.push(e.call(l,l.__data__,c,s)),o.push(l));return new Pi(i,o)}function xk(e){return function(){return this.matches(e)}}function km(e){return function(t){return t.matches(e)}}var bk=Array.prototype.find;function Ck(e){return function(){return bk.call(this.children,e)}}function wk(){return this.firstElementChild}function kk(e){return this.select(e==null?wk:Ck(typeof e=="function"?e:km(e)))}var Sk=Array.prototype.filter;function vk(){return Array.from(this.children)}function Mk(e){return function(){return Sk.call(this.children,e)}}function Tk(e){return this.selectAll(e==null?vk:Mk(typeof e=="function"?e:km(e)))}function Bk(e){typeof e!="function"&&(e=xk(e));for(var t=this._groups,r=t.length,i=new Array(r),o=0;o<r;++o)for(var a=t[o],s=a.length,n=i[o]=[],l,c=0;c<s;++c)(l=a[c])&&e.call(l,l.__data__,c,a)&&n.push(l);return new Pi(i,this._parents)}function Sm(e){return new Array(e.length)}function _k(){return new Pi(this._enter||this._groups.map(Sm),this._parents)}function Tl(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Tl.prototype={constructor:Tl,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Lk(e){return function(){return e}}function Ak(e,t,r,i,o,a){for(var s=0,n,l=t.length,c=a.length;s<c;++s)(n=t[s])?(n.__data__=a[s],i[s]=n):r[s]=new Tl(e,a[s]);for(;s<l;++s)(n=t[s])&&(o[s]=n)}function Fk(e,t,r,i,o,a,s){var n,l,c=new Map,h=t.length,d=a.length,u=new Array(h),f;for(n=0;n<h;++n)(l=t[n])&&(u[n]=f=s.call(l,l.__data__,n,t)+"",c.has(f)?o[n]=l:c.set(f,l));for(n=0;n<d;++n)f=s.call(e,a[n],n,a)+"",(l=c.get(f))?(i[n]=l,l.__data__=a[n],c.delete(f)):r[n]=new Tl(e,a[n]);for(n=0;n<h;++n)(l=t[n])&&c.get(u[n])===l&&(o[n]=l)}function $k(e){return e.__data__}function Ek(e,t){if(!arguments.length)return Array.from(this,$k);var r=t?Fk:Ak,i=this._parents,o=this._groups;typeof e!="function"&&(e=Lk(e));for(var a=o.length,s=new Array(a),n=new Array(a),l=new Array(a),c=0;c<a;++c){var h=i[c],d=o[c],u=d.length,f=Pk(e.call(h,h&&h.__data__,c,i)),g=f.length,p=n[c]=new Array(g),m=s[c]=new Array(g),y=l[c]=new Array(u);r(h,d,p,m,y,f,t);for(var x=0,b=0,S,T;x<g;++x)if(S=p[x]){for(x>=b&&(b=x+1);!(T=m[b])&&++b<g;);S._next=T||null}}return s=new Pi(s,i),s._enter=n,s._exit=l,s}function Pk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ik(){return new Pi(this._exit||this._groups.map(Sm),this._parents)}function Ok(e,t,r){var i=this.enter(),o=this,a=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),r==null?a.remove():r(a),i&&o?i.merge(o).order():o}function Dk(e){for(var t=e.selection?e.selection():e,r=this._groups,i=t._groups,o=r.length,a=i.length,s=Math.min(o,a),n=new Array(o),l=0;l<s;++l)for(var c=r[l],h=i[l],d=c.length,u=n[l]=new Array(d),f,g=0;g<d;++g)(f=c[g]||h[g])&&(u[g]=f);for(;l<o;++l)n[l]=r[l];return new Pi(n,this._parents)}function Rk(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var i=e[t],o=i.length-1,a=i[o],s;--o>=0;)(s=i[o])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function Nk(e){e||(e=qk);function t(d,u){return d&&u?e(d.__data__,u.__data__):!d-!u}for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a){for(var s=r[a],n=s.length,l=o[a]=new Array(n),c,h=0;h<n;++h)(c=s[h])&&(l[h]=c);l.sort(t)}return new Pi(o,this._parents).order()}function qk(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Wk(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function zk(){return Array.from(this)}function Hk(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],o=0,a=i.length;o<a;++o){var s=i[o];if(s)return s}return null}function Yk(){let e=0;for(const t of this)++e;return e}function Xk(){return!this.node()}function jk(e){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var o=t[r],a=0,s=o.length,n;a<s;++a)(n=o[a])&&e.call(n,n.__data__,a,o);return this}function Gk(e){return function(){this.removeAttribute(e)}}function Uk(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Vk(e,t){return function(){this.setAttribute(e,t)}}function Zk(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Kk(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function Qk(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function Jk(e,t){var r=bm(e);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((t==null?r.local?Uk:Gk:typeof t=="function"?r.local?Qk:Kk:r.local?Zk:Vk)(r,t))}function vm(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function tS(e){return function(){this.style.removeProperty(e)}}function eS(e,t,r){return function(){this.style.setProperty(e,t,r)}}function rS(e,t,r){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,r)}}function iS(e,t,r){return arguments.length>1?this.each((t==null?tS:typeof t=="function"?rS:eS)(e,t,r??"")):oS(this.node(),e)}function oS(e,t){return e.style.getPropertyValue(t)||vm(e).getComputedStyle(e,null).getPropertyValue(t)}function aS(e){return function(){delete this[e]}}function sS(e,t){return function(){this[e]=t}}function nS(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function lS(e,t){return arguments.length>1?this.each((t==null?aS:typeof t=="function"?nS:sS)(e,t)):this.node()[e]}function Mm(e){return e.trim().split(/^|\s+/)}function Dd(e){return e.classList||new Tm(e)}function Tm(e){this._node=e,this._names=Mm(e.getAttribute("class")||"")}Tm.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Bm(e,t){for(var r=Dd(e),i=-1,o=t.length;++i<o;)r.add(t[i])}function _m(e,t){for(var r=Dd(e),i=-1,o=t.length;++i<o;)r.remove(t[i])}function cS(e){return function(){Bm(this,e)}}function hS(e){return function(){_m(this,e)}}function dS(e,t){return function(){(t.apply(this,arguments)?Bm:_m)(this,e)}}function uS(e,t){var r=Mm(e+"");if(arguments.length<2){for(var i=Dd(this.node()),o=-1,a=r.length;++o<a;)if(!i.contains(r[o]))return!1;return!0}return this.each((typeof t=="function"?dS:t?cS:hS)(r,t))}function fS(){this.textContent=""}function gS(e){return function(){this.textContent=e}}function pS(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function mS(e){return arguments.length?this.each(e==null?fS:(typeof e=="function"?pS:gS)(e)):this.node().textContent}function yS(){this.innerHTML=""}function xS(e){return function(){this.innerHTML=e}}function bS(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function CS(e){return arguments.length?this.each(e==null?yS:(typeof e=="function"?bS:xS)(e)):this.node().innerHTML}function wS(){this.nextSibling&&this.parentNode.appendChild(this)}function kS(){return this.each(wS)}function SS(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function vS(){return this.each(SS)}function MS(e){var t=typeof e=="function"?e:Cm(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function TS(){return null}function BS(e,t){var r=typeof e=="function"?e:Cm(e),i=t==null?TS:typeof t=="function"?t:wm(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),i.apply(this,arguments)||null)})}function _S(){var e=this.parentNode;e&&e.removeChild(this)}function LS(){return this.each(_S)}function AS(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function FS(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function $S(e){return this.select(e?FS:AS)}function ES(e){return arguments.length?this.property("__data__",e):this.node().__data__}function PS(e){return function(t){e.call(this,t,this.__data__)}}function IS(e){return e.trim().split(/^|\s+/).map(function(t){var r="",i=t.indexOf(".");return i>=0&&(r=t.slice(i+1),t=t.slice(0,i)),{type:t,name:r}})}function OS(e){return function(){var t=this.__on;if(t){for(var r=0,i=-1,o=t.length,a;r<o;++r)a=t[r],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++i]=a;++i?t.length=i:delete this.__on}}}function DS(e,t,r){return function(){var i=this.__on,o,a=PS(t);if(i){for(var s=0,n=i.length;s<n;++s)if((o=i[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=a,o.options=r),o.value=t;return}}this.addEventListener(e.type,a,r),o={type:e.type,name:e.name,value:t,listener:a,options:r},i?i.push(o):this.__on=[o]}}function RS(e,t,r){var i=IS(e+""),o,a=i.length,s;if(arguments.length<2){var n=this.node().__on;if(n){for(var l=0,c=n.length,h;l<c;++l)for(o=0,h=n[l];o<a;++o)if((s=i[o]).type===h.type&&s.name===h.name)return h.value}return}for(n=t?DS:OS,o=0;o<a;++o)this.each(n(i[o],t,r));return this}function Lm(e,t,r){var i=vm(e),o=i.CustomEvent;typeof o=="function"?o=new o(t,r):(o=i.document.createEvent("Event"),r?(o.initEvent(t,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function NS(e,t){return function(){return Lm(this,e,t)}}function qS(e,t){return function(){return Lm(this,e,t.apply(this,arguments))}}function WS(e,t){return this.each((typeof t=="function"?qS:NS)(e,t))}function*zS(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var i=e[t],o=0,a=i.length,s;o<a;++o)(s=i[o])&&(yield s)}var HS=[null];function Pi(e,t){this._groups=e,this._parents=t}function YS(){return this}Pi.prototype={constructor:Pi,select:uk,selectAll:yk,selectChild:kk,selectChildren:Tk,filter:Bk,data:Ek,enter:_k,exit:Ik,join:Ok,merge:Dk,selection:YS,order:Rk,sort:Nk,call:Wk,nodes:zk,node:Hk,size:Yk,empty:Xk,each:jk,attr:Jk,style:iS,property:lS,classed:uS,text:mS,html:CS,raise:kS,lower:vS,append:MS,insert:BS,remove:LS,clone:$S,datum:ES,on:RS,dispatch:WS,[Symbol.iterator]:zS};function Ye(e){return typeof e=="string"?new Pi([[document.querySelector(e)]],[document.documentElement]):new Pi([[e]],HS)}var XS=0;function Of(){this._="@"+(++XS).toString(36)}Of.prototype={constructor:Of,get:function(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function(e,t){return e[this._]=t},remove:function(e){return this._ in e&&delete e[this._]},toString:function(){return this._}};function Ls(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Sn(e,t){var r=Object.create(e.prototype);for(var i in t)r[i]=t[i];return r}function na(){}var Ba=.7,Cs=1/Ba,es="\\s*([+-]?\\d+)\\s*",fn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ho="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",jS=/^#([0-9a-f]{3,8})$/,GS=new RegExp(`^rgb\\(${es},${es},${es}\\)$`),US=new RegExp(`^rgb\\(${ho},${ho},${ho}\\)$`),VS=new RegExp(`^rgba\\(${es},${es},${es},${fn}\\)$`),ZS=new RegExp(`^rgba\\(${ho},${ho},${ho},${fn}\\)$`),KS=new RegExp(`^hsl\\(${fn},${ho},${ho}\\)$`),QS=new RegExp(`^hsla\\(${fn},${ho},${ho},${fn}\\)$`),Df={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Ls(na,Kl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Rf,formatHex:Rf,formatHex8:JS,formatHsl:tv,formatRgb:Nf,toString:Nf});function Rf(){return this.rgb().formatHex()}function JS(){return this.rgb().formatHex8()}function tv(){return Am(this).formatHsl()}function Nf(){return this.rgb().formatRgb()}function Kl(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=jS.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?qf(t):r===3?new Vr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?On(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?On(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=GS.exec(e))?new Vr(t[1],t[2],t[3],1):(t=US.exec(e))?new Vr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=VS.exec(e))?On(t[1],t[2],t[3],t[4]):(t=ZS.exec(e))?On(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=KS.exec(e))?Hf(t[1],t[2]/100,t[3]/100,1):(t=QS.exec(e))?Hf(t[1],t[2]/100,t[3]/100,t[4]):Df.hasOwnProperty(e)?qf(Df[e]):e==="transparent"?new Vr(NaN,NaN,NaN,0):null}function qf(e){return new Vr(e>>16&255,e>>8&255,e&255,1)}function On(e,t,r,i){return i<=0&&(e=t=r=NaN),new Vr(e,t,r,i)}function Rd(e){return e instanceof na||(e=Kl(e)),e?(e=e.rgb(),new Vr(e.r,e.g,e.b,e.opacity)):new Vr}function ao(e,t,r,i){return arguments.length===1?Rd(e):new Vr(e,t,r,i??1)}function Vr(e,t,r,i){this.r=+e,this.g=+t,this.b=+r,this.opacity=+i}Ls(Vr,ao,Sn(na,{brighter(e){return e=e==null?Cs:Math.pow(Cs,e),new Vr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ba:Math.pow(Ba,e),new Vr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Vr(Ca(this.r),Ca(this.g),Ca(this.b),Bl(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Wf,formatHex:Wf,formatHex8:ev,formatRgb:zf,toString:zf}));function Wf(){return`#${ba(this.r)}${ba(this.g)}${ba(this.b)}`}function ev(){return`#${ba(this.r)}${ba(this.g)}${ba(this.b)}${ba((isNaN(this.opacity)?1:this.opacity)*255)}`}function zf(){const e=Bl(this.opacity);return`${e===1?"rgb(":"rgba("}${Ca(this.r)}, ${Ca(this.g)}, ${Ca(this.b)}${e===1?")":`, ${e})`}`}function Bl(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ca(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ba(e){return e=Ca(e),(e<16?"0":"")+e.toString(16)}function Hf(e,t,r,i){return i<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Xi(e,t,r,i)}function Am(e){if(e instanceof Xi)return new Xi(e.h,e.s,e.l,e.opacity);if(e instanceof na||(e=Kl(e)),!e)return new Xi;if(e instanceof Xi)return e;e=e.rgb();var t=e.r/255,r=e.g/255,i=e.b/255,o=Math.min(t,r,i),a=Math.max(t,r,i),s=NaN,n=a-o,l=(a+o)/2;return n?(t===a?s=(r-i)/n+(r<i)*6:r===a?s=(i-t)/n+2:s=(t-r)/n+4,n/=l<.5?a+o:2-a-o,s*=60):n=l>0&&l<1?0:s,new Xi(s,n,l,e.opacity)}function rv(e,t,r,i){return arguments.length===1?Am(e):new Xi(e,t,r,i??1)}function Xi(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}Ls(Xi,rv,Sn(na,{brighter(e){return e=e==null?Cs:Math.pow(Cs,e),new Xi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ba:Math.pow(Ba,e),new Xi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,i=r+(r<.5?r:1-r)*t,o=2*r-i;return new Vr(Yc(e>=240?e-240:e+120,o,i),Yc(e,o,i),Yc(e<120?e+240:e-120,o,i),this.opacity)},clamp(){return new Xi(Yf(this.h),Dn(this.s),Dn(this.l),Bl(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Bl(this.opacity);return`${e===1?"hsl(":"hsla("}${Yf(this.h)}, ${Dn(this.s)*100}%, ${Dn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Yf(e){return e=(e||0)%360,e<0?e+360:e}function Dn(e){return Math.max(0,Math.min(1,e||0))}function Yc(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Fm=Math.PI/180,$m=180/Math.PI,_l=18,Em=.96422,Pm=1,Im=.82521,Om=4/29,rs=6/29,Dm=3*rs*rs,iv=rs*rs*rs;function Rm(e){if(e instanceof uo)return new uo(e.l,e.a,e.b,e.opacity);if(e instanceof _o)return Nm(e);e instanceof Vr||(e=Rd(e));var t=Uc(e.r),r=Uc(e.g),i=Uc(e.b),o=Xc((.2225045*t+.7168786*r+.0606169*i)/Pm),a,s;return t===r&&r===i?a=s=o:(a=Xc((.4360747*t+.3850649*r+.1430804*i)/Em),s=Xc((.0139322*t+.0971045*r+.7141733*i)/Im)),new uo(116*o-16,500*(a-o),200*(o-s),e.opacity)}function ov(e,t,r,i){return arguments.length===1?Rm(e):new uo(e,t,r,i??1)}function uo(e,t,r,i){this.l=+e,this.a=+t,this.b=+r,this.opacity=+i}Ls(uo,ov,Sn(na,{brighter(e){return new uo(this.l+_l*(e??1),this.a,this.b,this.opacity)},darker(e){return new uo(this.l-_l*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,r=isNaN(this.b)?e:e-this.b/200;return t=Em*jc(t),e=Pm*jc(e),r=Im*jc(r),new Vr(Gc(3.1338561*t-1.6168667*e-.4906146*r),Gc(-.9787684*t+1.9161415*e+.033454*r),Gc(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}}));function Xc(e){return e>iv?Math.pow(e,1/3):e/Dm+Om}function jc(e){return e>rs?e*e*e:Dm*(e-Om)}function Gc(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Uc(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function av(e){if(e instanceof _o)return new _o(e.h,e.c,e.l,e.opacity);if(e instanceof uo||(e=Rm(e)),e.a===0&&e.b===0)return new _o(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*$m;return new _o(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function sv(e,t,r,i){return arguments.length===1?av(e):new _o(e,t,r,i??1)}function _o(e,t,r,i){this.h=+e,this.c=+t,this.l=+r,this.opacity=+i}function Nm(e){if(isNaN(e.h))return new uo(e.l,0,0,e.opacity);var t=e.h*Fm;return new uo(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Ls(_o,sv,Sn(na,{brighter(e){return new _o(this.h,this.c,this.l+_l*(e??1),this.opacity)},darker(e){return new _o(this.h,this.c,this.l-_l*(e??1),this.opacity)},rgb(){return Nm(this).rgb()}}));var qm=-.14861,Nd=1.78277,qd=-.29227,Ql=-.90649,gn=1.97294,Xf=gn*Ql,jf=gn*Nd,Gf=Nd*qd-Ql*qm;function nv(e){if(e instanceof wa)return new wa(e.h,e.s,e.l,e.opacity);e instanceof Vr||(e=Rd(e));var t=e.r/255,r=e.g/255,i=e.b/255,o=(Gf*i+Xf*t-jf*r)/(Gf+Xf-jf),a=i-o,s=(gn*(r-o)-qd*a)/Ql,n=Math.sqrt(s*s+a*a)/(gn*o*(1-o)),l=n?Math.atan2(s,a)*$m-120:NaN;return new wa(l<0?l+360:l,n,o,e.opacity)}function lv(e,t,r,i){return arguments.length===1?nv(e):new wa(e,t,r,i??1)}function wa(e,t,r,i){this.h=+e,this.s=+t,this.l=+r,this.opacity=+i}Ls(wa,lv,Sn(na,{brighter(e){return e=e==null?Cs:Math.pow(Cs,e),new wa(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ba:Math.pow(Ba,e),new wa(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Fm,t=+this.l,r=isNaN(this.s)?0:this.s*t*(1-t),i=Math.cos(e),o=Math.sin(e);return new Vr(255*(t+r*(qm*i+Nd*o)),255*(t+r*(qd*i+Ql*o)),255*(t+r*(gn*i)),this.opacity)}}));const Us=Math.PI,Ph=2*Us,ga=1e-6,cv=Ph-ga;function Wm(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function hv(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Wm;const r=10**t;return function(i){this._+=i[0];for(let o=1,a=i.length;o<a;++o)this._+=Math.round(arguments[o]*r)/r+i[o]}}function zm(e,t,r,i){return e===r&&t===i}function dv(e){const t=Math.floor(e);if(!(t<=15))return zm;const r=10**t,i=function(o){return Math.round(o*r)};return function(o,a,s,n){return i(o)===i(s)&&i(a)===i(n)}}class uv{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?Wm:hv(t),this._equal=t==null?zm:dv(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,i,o){this._append`Q${+t},${+r},${this._x1=+i},${this._y1=+o}`}bezierCurveTo(t,r,i,o,a,s){this._append`C${+t},${+r},${+i},${+o},${this._x1=+a},${this._y1=+s}`}arcTo(t,r,i,o,a){if(t=+t,r=+r,i=+i,o=+o,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,n=this._y1,l=i-t,c=o-r,h=s-t,d=n-r,u=h*h+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(u>ga)if(!(Math.abs(d*l-c*h)>ga)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let f=i-s,g=o-n,p=l*l+c*c,m=f*f+g*g,y=Math.sqrt(p),x=Math.sqrt(u),b=a*Math.tan((Us-Math.acos((p+u-m)/(2*y*x)))/2),S=b/x,T=b/y;Math.abs(S-1)>ga&&this._append`L${t+S*h},${r+S*d}`,this._append`A${a},${a},0,0,${+(d*f>h*g)},${this._x1=t+T*l},${this._y1=r+T*c}`}}arc(t,r,i,o,a,s){if(t=+t,r=+r,i=+i,s=!!s,i<0)throw new Error(`negative radius: ${i}`);let n=i*Math.cos(o),l=i*Math.sin(o),c=t+n,h=r+l,d=1^s,u=s?o-a:a-o;if(this._x1===null?this._append`M${c},${h}`:(Math.abs(this._x1-c)>ga||Math.abs(this._y1-h)>ga)&&this._append`L${c},${h}`,!!i){if(u<0&&(u=u%Ph+Ph),u>cv)this._append`A${i},${i},0,1,${d},${t-n},${r-l}A${i},${i},0,1,${d},${this._x1=c},${this._y1=h}`;else if(u>ga){const f=t+i*Math.cos(a),g=r+i*Math.sin(a);if(u>=Us&&this._equal(c,h,f,g)){u/=2;let p=o+u;this._append`A${i},${i},0,${+(u>=Us)},${d},${t+i*Math.cos(p)},${r+i*Math.sin(p)}`}this._append`A${i},${i},0,${+(u>=Us)},${d},${this._x1=f},${this._y1=g}`}}}rect(t,r,i,o){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${i=+i}v${+o}h${-i}Z`}toString(){return this._}}function Dr(e){return function(){return e}}const Uf=Math.abs,ri=Math.atan2,ca=Math.cos,fv=Math.max,Vc=Math.min,Ji=Math.sin,Va=Math.sqrt,oi=1e-12,pn=Math.PI,Ll=pn/2,ll=2*pn;function gv(e){return e>1?0:e<-1?pn:Math.acos(e)}function Vf(e){return e>=1?Ll:e<=-1?-Ll:Math.asin(e)}function Hm(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const i=Math.floor(r);if(!(i>=0))throw new RangeError(`invalid digits: ${r}`);t=i}return e},()=>new uv(t)}function pv(e){return e.innerRadius}function mv(e){return e.outerRadius}function yv(e){return e.startAngle}function xv(e){return e.endAngle}function bv(e){return e&&e.padAngle}function Cv(e,t,r,i,o,a,s,n){var l=r-e,c=i-t,h=s-o,d=n-a,u=d*l-h*c;if(!(u*u<oi))return u=(h*(t-a)-d*(e-o))/u,[e+u*l,t+u*c]}function Rn(e,t,r,i,o,a,s){var n=e-r,l=t-i,c=(s?a:-a)/Va(n*n+l*l),h=c*l,d=-c*n,u=e+h,f=t+d,g=r+h,p=i+d,m=(u+g)/2,y=(f+p)/2,x=g-u,b=p-f,S=x*x+b*b,T=o-a,k=u*p-g*f,_=(b<0?-1:1)*Va(fv(0,T*T*S-k*k)),L=(k*b-x*_)/S,v=(-k*x-b*_)/S,M=(k*b+x*_)/S,B=(-k*x+b*_)/S,E=L-m,O=v-y,$=M-m,I=B-y;return E*E+O*O>$*$+I*I&&(L=M,v=B),{cx:L,cy:v,x01:-h,y01:-d,x11:L*(o/T-1),y11:v*(o/T-1)}}function lP(){var e=pv,t=mv,r=Dr(0),i=null,o=yv,a=xv,s=bv,n=null,l=Hm(c);function c(){var h,d,u=+e.apply(this,arguments),f=+t.apply(this,arguments),g=o.apply(this,arguments)-Ll,p=a.apply(this,arguments)-Ll,m=Uf(p-g),y=p>g;if(n||(n=h=l()),f<u&&(d=f,f=u,u=d),!(f>oi))n.moveTo(0,0);else if(m>ll-oi)n.moveTo(f*ca(g),f*Ji(g)),n.arc(0,0,f,g,p,!y),u>oi&&(n.moveTo(u*ca(p),u*Ji(p)),n.arc(0,0,u,p,g,y));else{var x=g,b=p,S=g,T=p,k=m,_=m,L=s.apply(this,arguments)/2,v=L>oi&&(i?+i.apply(this,arguments):Va(u*u+f*f)),M=Vc(Uf(f-u)/2,+r.apply(this,arguments)),B=M,E=M,O,$;if(v>oi){var I=Vf(v/u*Ji(L)),F=Vf(v/f*Ji(L));(k-=I*2)>oi?(I*=y?1:-1,S+=I,T-=I):(k=0,S=T=(g+p)/2),(_-=F*2)>oi?(F*=y?1:-1,x+=F,b-=F):(_=0,x=b=(g+p)/2)}var R=f*ca(x),q=f*Ji(x),D=u*ca(T),P=u*Ji(T);if(M>oi){var Y=f*ca(b),X=f*Ji(b),z=u*ca(S),U=u*Ji(S),j;if(m<pn)if(j=Cv(R,q,z,U,Y,X,D,P)){var V=R-j[0],Q=q-j[1],rt=Y-j[0],ht=X-j[1],H=1/Ji(gv((V*rt+Q*ht)/(Va(V*V+Q*Q)*Va(rt*rt+ht*ht)))/2),G=Va(j[0]*j[0]+j[1]*j[1]);B=Vc(M,(u-G)/(H-1)),E=Vc(M,(f-G)/(H+1))}else B=E=0}_>oi?E>oi?(O=Rn(z,U,R,q,f,E,y),$=Rn(Y,X,D,P,f,E,y),n.moveTo(O.cx+O.x01,O.cy+O.y01),E<M?n.arc(O.cx,O.cy,E,ri(O.y01,O.x01),ri($.y01,$.x01),!y):(n.arc(O.cx,O.cy,E,ri(O.y01,O.x01),ri(O.y11,O.x11),!y),n.arc(0,0,f,ri(O.cy+O.y11,O.cx+O.x11),ri($.cy+$.y11,$.cx+$.x11),!y),n.arc($.cx,$.cy,E,ri($.y11,$.x11),ri($.y01,$.x01),!y))):(n.moveTo(R,q),n.arc(0,0,f,x,b,!y)):n.moveTo(R,q),!(u>oi)||!(k>oi)?n.lineTo(D,P):B>oi?(O=Rn(D,P,Y,X,u,-B,y),$=Rn(R,q,z,U,u,-B,y),n.lineTo(O.cx+O.x01,O.cy+O.y01),B<M?n.arc(O.cx,O.cy,B,ri(O.y01,O.x01),ri($.y01,$.x01),!y):(n.arc(O.cx,O.cy,B,ri(O.y01,O.x01),ri(O.y11,O.x11),!y),n.arc(0,0,u,ri(O.cy+O.y11,O.cx+O.x11),ri($.cy+$.y11,$.cx+$.x11),y),n.arc($.cx,$.cy,B,ri($.y11,$.x11),ri($.y01,$.x01),!y))):n.arc(0,0,u,T,S,y)}if(n.closePath(),h)return n=null,h+""||null}return c.centroid=function(){var h=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,d=(+o.apply(this,arguments)+ +a.apply(this,arguments))/2-pn/2;return[ca(d)*h,Ji(d)*h]},c.innerRadius=function(h){return arguments.length?(e=typeof h=="function"?h:Dr(+h),c):e},c.outerRadius=function(h){return arguments.length?(t=typeof h=="function"?h:Dr(+h),c):t},c.cornerRadius=function(h){return arguments.length?(r=typeof h=="function"?h:Dr(+h),c):r},c.padRadius=function(h){return arguments.length?(i=h==null?null:typeof h=="function"?h:Dr(+h),c):i},c.startAngle=function(h){return arguments.length?(o=typeof h=="function"?h:Dr(+h),c):o},c.endAngle=function(h){return arguments.length?(a=typeof h=="function"?h:Dr(+h),c):a},c.padAngle=function(h){return arguments.length?(s=typeof h=="function"?h:Dr(+h),c):s},c.context=function(h){return arguments.length?(n=h??null,c):n},c}function Ym(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Xm(e){this._context=e}Xm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function ln(e){return new Xm(e)}function wv(e){return e[0]}function kv(e){return e[1]}function Sv(e,t){var r=Dr(!0),i=null,o=ln,a=null,s=Hm(n);e=typeof e=="function"?e:e===void 0?wv:Dr(e),t=typeof t=="function"?t:t===void 0?kv:Dr(t);function n(l){var c,h=(l=Ym(l)).length,d,u=!1,f;for(i==null&&(a=o(f=s())),c=0;c<=h;++c)!(c<h&&r(d=l[c],c,l))===u&&((u=!u)?a.lineStart():a.lineEnd()),u&&a.point(+e(d,c,l),+t(d,c,l));if(f)return a=null,f+""||null}return n.x=function(l){return arguments.length?(e=typeof l=="function"?l:Dr(+l),n):e},n.y=function(l){return arguments.length?(t=typeof l=="function"?l:Dr(+l),n):t},n.defined=function(l){return arguments.length?(r=typeof l=="function"?l:Dr(!!l),n):r},n.curve=function(l){return arguments.length?(o=l,i!=null&&(a=o(i)),n):o},n.context=function(l){return arguments.length?(l==null?i=a=null:a=o(i=l),n):i},n}function vv(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function Mv(e){return e}function cP(){var e=Mv,t=vv,r=null,i=Dr(0),o=Dr(ll),a=Dr(0);function s(n){var l,c=(n=Ym(n)).length,h,d,u=0,f=new Array(c),g=new Array(c),p=+i.apply(this,arguments),m=Math.min(ll,Math.max(-ll,o.apply(this,arguments)-p)),y,x=Math.min(Math.abs(m)/c,a.apply(this,arguments)),b=x*(m<0?-1:1),S;for(l=0;l<c;++l)(S=g[f[l]=l]=+e(n[l],l,n))>0&&(u+=S);for(t!=null?f.sort(function(T,k){return t(g[T],g[k])}):r!=null&&f.sort(function(T,k){return r(n[T],n[k])}),l=0,d=u?(m-c*b)/u:0;l<c;++l,p=y)h=f[l],S=g[h],y=p+(S>0?S*d:0)+b,g[h]={data:n[h],index:l,value:S,startAngle:p,endAngle:y,padAngle:x};return g}return s.value=function(n){return arguments.length?(e=typeof n=="function"?n:Dr(+n),s):e},s.sortValues=function(n){return arguments.length?(t=n,r=null,s):t},s.sort=function(n){return arguments.length?(r=n,t=null,s):r},s.startAngle=function(n){return arguments.length?(i=typeof n=="function"?n:Dr(+n),s):i},s.endAngle=function(n){return arguments.length?(o=typeof n=="function"?n:Dr(+n),s):o},s.padAngle=function(n){return arguments.length?(a=typeof n=="function"?n:Dr(+n),s):a},s}class jm{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Gm(e){return new jm(e,!0)}function Um(e){return new jm(e,!1)}function ta(){}function Al(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function Jl(e){this._context=e}Jl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Al(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Al(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ih(e){return new Jl(e)}function Vm(e){this._context=e}Vm.prototype={areaStart:ta,areaEnd:ta,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Al(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Tv(e){return new Vm(e)}function Zm(e){this._context=e}Zm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,i):this._context.moveTo(r,i);break;case 3:this._point=4;default:Al(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Bv(e){return new Zm(e)}function Km(e,t){this._basis=new Jl(e),this._beta=t}Km.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var i=e[0],o=t[0],a=e[r]-i,s=t[r]-o,n=-1,l;++n<=r;)l=n/r,this._basis.point(this._beta*e[n]+(1-this._beta)*(i+l*a),this._beta*t[n]+(1-this._beta)*(o+l*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var _v=(function e(t){function r(i){return t===1?new Jl(i):new Km(i,t)}return r.beta=function(i){return e(+i)},r})(.85);function Fl(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function Wd(e,t){this._context=e,this._k=(1-t)/6}Wd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Fl(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Fl(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Qm=(function e(t){function r(i){return new Wd(i,t)}return r.tension=function(i){return e(+i)},r})(0);function zd(e,t){this._context=e,this._k=(1-t)/6}zd.prototype={areaStart:ta,areaEnd:ta,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Fl(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Lv=(function e(t){function r(i){return new zd(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Hd(e,t){this._context=e,this._k=(1-t)/6}Hd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Fl(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Av=(function e(t){function r(i){return new Hd(i,t)}return r.tension=function(i){return e(+i)},r})(0);function Yd(e,t,r){var i=e._x1,o=e._y1,a=e._x2,s=e._y2;if(e._l01_a>oi){var n=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*n-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,o=(o*n-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>oi){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,h=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*c+e._x1*e._l23_2a-t*e._l12_2a)/h,s=(s*c+e._y1*e._l23_2a-r*e._l12_2a)/h}e._context.bezierCurveTo(i,o,a,s,e._x2,e._y2)}function Jm(e,t){this._context=e,this._alpha=t}Jm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:Yd(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ty=(function e(t){function r(i){return t?new Jm(i,t):new Wd(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function ey(e,t){this._context=e,this._alpha=t}ey.prototype={areaStart:ta,areaEnd:ta,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:Yd(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Fv=(function e(t){function r(i){return t?new ey(i,t):new zd(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function ry(e,t){this._context=e,this._alpha=t}ry.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Yd(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var $v=(function e(t){function r(i){return t?new ry(i,t):new Hd(i,0)}return r.alpha=function(i){return e(+i)},r})(.5);function iy(e){this._context=e}iy.prototype={areaStart:ta,areaEnd:ta,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Ev(e){return new iy(e)}function Zf(e){return e<0?-1:1}function Kf(e,t,r){var i=e._x1-e._x0,o=t-e._x1,a=(e._y1-e._y0)/(i||o<0&&-0),s=(r-e._y1)/(o||i<0&&-0),n=(a*o+s*i)/(i+o);return(Zf(a)+Zf(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(n))||0}function Qf(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Zc(e,t,r){var i=e._x0,o=e._y0,a=e._x1,s=e._y1,n=(a-i)/3;e._context.bezierCurveTo(i+n,o+n*t,a-n,s-n*r,a,s)}function $l(e){this._context=e}$l.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Zc(this,this._t0,Qf(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Zc(this,Qf(this,r=Kf(this,e,t)),r);break;default:Zc(this,this._t0,r=Kf(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function oy(e){this._context=new ay(e)}(oy.prototype=Object.create($l.prototype)).point=function(e,t){$l.prototype.point.call(this,t,e)};function ay(e){this._context=e}ay.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,i,o,a){this._context.bezierCurveTo(t,e,i,r,a,o)}};function sy(e){return new $l(e)}function ny(e){return new oy(e)}function ly(e){this._context=e}ly.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var i=Jf(e),o=Jf(t),a=0,s=1;s<r;++a,++s)this._context.bezierCurveTo(i[0][a],o[0][a],i[1][a],o[1][a],e[s],t[s]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function Jf(e){var t,r=e.length-1,i,o=new Array(r),a=new Array(r),s=new Array(r);for(o[0]=0,a[0]=2,s[0]=e[0]+2*e[1],t=1;t<r-1;++t)o[t]=1,a[t]=4,s[t]=4*e[t]+2*e[t+1];for(o[r-1]=2,a[r-1]=7,s[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)i=o[t]/a[t-1],a[t]-=i,s[t]-=i*s[t-1];for(o[r-1]=s[r-1]/a[r-1],t=r-2;t>=0;--t)o[t]=(s[t]-o[t+1])/a[t];for(a[r-1]=(e[r]+o[r-1])/2,t=0;t<r-1;++t)a[t]=2*e[t+1]-o[t+1];return[o,a]}function cy(e){return new ly(e)}function tc(e,t){this._context=e,this._t=t}tc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function hy(e){return new tc(e,.5)}function dy(e){return new tc(e,0)}function uy(e){return new tc(e,1)}function Kc(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!=="[object Object]"){const r=e[Symbol.toStringTag];return r==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${r}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Pv(){}function fy(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Xd(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Iv="[object RegExp]",gy="[object String]",py="[object Number]",my="[object Boolean]",yy="[object Arguments]",Ov="[object Symbol]",Dv="[object Date]",Rv="[object Map]",Nv="[object Set]",qv="[object Array]",Wv="[object ArrayBuffer]",zv="[object Object]",Hv="[object DataView]",Yv="[object Uint8Array]",Xv="[object Uint8ClampedArray]",jv="[object Uint16Array]",Gv="[object Uint32Array]",Uv="[object Int8Array]",Vv="[object Int16Array]",Zv="[object Int32Array]",Kv="[object Float32Array]",Qv="[object Float64Array]",tg=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function jd(e){return typeof tg.Buffer<"u"&&tg.Buffer.isBuffer(e)}function Jv(e){return Number.isSafeInteger(e)&&e>=0}function xy(e){return e!=null&&typeof e!="function"&&Jv(e.length)}function tM(e){return e==="__proto__"}function Gd(e){return e==null||typeof e!="object"&&typeof e!="function"}function Ud(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function eM(e,t){return Za(e,void 0,e,new Map,t)}function Za(e,t,r,i=new Map,o=void 0){const a=o?.(e,t,r,i);if(a!==void 0)return a;if(Gd(e))return e;if(i.has(e))return i.get(e);if(Array.isArray(e)){const s=new Array(e.length);i.set(e,s);for(let n=0;n<e.length;n++)s[n]=Za(e[n],n,r,i,o);return Object.hasOwn(e,"index")&&(s.index=e.index),Object.hasOwn(e,"input")&&(s.input=e.input),s}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const s=new RegExp(e.source,e.flags);return s.lastIndex=e.lastIndex,s}if(e instanceof Map){const s=new Map;i.set(e,s);for(const[n,l]of e)s.set(n,Za(l,n,r,i,o));return s}if(e instanceof Set){const s=new Set;i.set(e,s);for(const n of e)s.add(Za(n,void 0,r,i,o));return s}if(jd(e))return e.subarray();if(Ud(e)){const s=new(Object.getPrototypeOf(e)).constructor(e.length);i.set(e,s);for(let n=0;n<e.length;n++)s[n]=Za(e[n],n,r,i,o);return s}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const s=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return i.set(e,s),Wi(s,e,r,i,o),s}if(typeof File<"u"&&e instanceof File){const s=new File([e],e.name,{type:e.type});return i.set(e,s),Wi(s,e,r,i,o),s}if(typeof Blob<"u"&&e instanceof Blob){const s=new Blob([e],{type:e.type});return i.set(e,s),Wi(s,e,r,i,o),s}if(e instanceof Error){const s=structuredClone(e);return i.set(e,s),s.message=e.message,s.name=e.name,s.stack=e.stack,s.cause=e.cause,s.constructor=e.constructor,Wi(s,e,r,i,o),s}if(e instanceof Boolean){const s=new Boolean(e.valueOf());return i.set(e,s),Wi(s,e,r,i,o),s}if(e instanceof Number){const s=new Number(e.valueOf());return i.set(e,s),Wi(s,e,r,i,o),s}if(e instanceof String){const s=new String(e.valueOf());return i.set(e,s),Wi(s,e,r,i,o),s}if(typeof e=="object"&&rM(e)){const s=Object.create(Object.getPrototypeOf(e));return i.set(e,s),Wi(s,e,r,i,o),s}return e}function Wi(e,t,r=e,i,o){const a=[...Object.keys(t),...fy(t)];for(let s=0;s<a.length;s++){const n=a[s],l=Object.getOwnPropertyDescriptor(e,n);(l==null||l.writable)&&(e[n]=Za(t[n],n,r,i,o))}}function rM(e){switch(Xd(e)){case yy:case qv:case Wv:case Hv:case my:case Dv:case Kv:case Qv:case Uv:case Vv:case Zv:case Rv:case py:case zv:case Iv:case Nv:case gy:case Ov:case Yv:case Xv:case jv:case Gv:return!0;default:return!1}}function iM(e,t){return eM(e,(r,i,o,a)=>{if(typeof e=="object"){if(Xd(e)==="[object Object]"&&typeof e.constructor!="function"){const s={};return a.set(e,s),Wi(s,e,o,a),s}switch(Object.prototype.toString.call(e)){case py:case gy:case my:{const s=new e.constructor(e?.valueOf());return Wi(s,e),s}case yy:{const s={};return Wi(s,e),s.length=e.length,s[Symbol.iterator]=e[Symbol.iterator],s}default:return}}})}function eg(e){return iM(e)}function Oh(e){return e!==null&&typeof e=="object"&&Xd(e)==="[object Arguments]"}function Dh(e){return typeof e=="object"&&e!==null}function oM(e){return Dh(e)&&xy(e)}function cl(e){return Ud(e)}function aM(e){const t=e?.constructor;return e===(typeof t=="function"?t.prototype:Object.prototype)}function vn(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");const r=function(...i){const o=t?t.apply(this,i):i[0],a=r.cache;if(a.has(o))return a.get(o);const s=e.apply(this,i);return r.cache=a.set(o,s)||a,s};return r.cache=new(vn.Cache||Map),r}vn.Cache=Map;function sM(e){if(Gd(e))return e;if(Array.isArray(e)||Ud(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);const t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);const r=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new r(e);if(e instanceof RegExp){const i=new r(e);return i.lastIndex=e.lastIndex,i}if(e instanceof DataView)return new r(e.buffer.slice(0));if(e instanceof Error){let i;return e instanceof AggregateError?i=new r(e.errors,e.message,{cause:e.cause}):i=new r(e.message,{cause:e.cause}),i.stack=e.stack,Object.assign(i,e),i}return typeof File<"u"&&e instanceof File?new r([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e=="object"?Object.assign(Object.create(t),e):e}function nM(e,...t){const r=t.slice(0,-1),i=t[t.length-1];let o=e;for(let a=0;a<r.length;a++){const s=r[a];o=hl(o,s,i,new Map)}return o}function hl(e,t,r,i){if(Gd(e)&&(e=Object(e)),t==null||typeof t!="object")return e;if(i.has(t))return sM(i.get(t));if(i.set(t,e),Array.isArray(t)){t=t.slice();for(let a=0;a<t.length;a++)a in t||(t[a]=void 0)}const o=[...Object.keys(t),...fy(t)];for(let a=0;a<o.length;a++){const s=o[a];if(tM(s))continue;let n=t[s],l=e[s];if(Oh(n)&&(n={...n}),Oh(l)&&(l={...l}),jd(n)&&(n=eg(n)),Array.isArray(n))if(Array.isArray(l)){const h=[],d=Reflect.ownKeys(l);for(let u=0;u<d.length;u++){const f=d[u];h[f]=l[f]}l=h}else if(oM(l)){const h=[];for(let d=0;d<l.length;d++)h[d]=l[d];l=h}else l=[];const c=r(l,n,s,e,t,i);c!==void 0?e[s]=c:Array.isArray(n)||Dh(l)&&Dh(n)&&(Kc(l)||Kc(n)||cl(l)||cl(n))?e[s]=hl(l,n,r,i):l==null&&Kc(n)?e[s]=hl({},n,r,i):l==null&&cl(n)?e[s]=eg(n):(l===void 0||n!==void 0)&&(e[s]=n)}return e}function lM(e,...t){return nM(e,...t,Pv)}function rg(e){if(e==null)return!0;if(xy(e))return typeof e.splice!="function"&&typeof e!="string"&&!jd(e)&&!cl(e)&&!Oh(e)?!1:e.length===0;if(typeof e=="object"||typeof e=="function"){if(e instanceof Map||e instanceof Set)return e.size===0;const t=Object.keys(e);return aM(e)?t.filter(r=>r!=="constructor").length===0:t.length===0}return!0}var cM="​",hM={curveBasis:Ih,curveBasisClosed:Tv,curveBasisOpen:Bv,curveBumpX:Gm,curveBumpY:Um,curveBundle:_v,curveCardinalClosed:Lv,curveCardinalOpen:Av,curveCardinal:Qm,curveCatmullRomClosed:Fv,curveCatmullRomOpen:$v,curveCatmullRom:ty,curveLinear:ln,curveLinearClosed:Ev,curveMonotoneX:sy,curveMonotoneY:ny,curveNatural:cy,curveStep:hy,curveStepAfter:uy,curveStepBefore:dy},dM=/\s*(?:(\w+)(?=:):|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi,uM=C(function(e,t){const r=by(e,/(?:init\b)|(?:initialize\b)/);let i={};if(Array.isArray(r)){const s=r.map(n=>n.args);xl(s),i=Wr(i,[...s])}else i=r.args;if(!i)return;let o=Zl(e,t);const a="config";return i[a]!==void 0&&(o==="flowchart-v2"&&(o="flowchart"),i[o]=i[a],delete i[a]),i},"detectInit"),by=C(function(e,t=null){try{const r=new RegExp(`[%]{2}(?![{]${dM.source})(?=[}][%]{2}).*
160
+ `,"ig");e=e.trim().replace(r,"").replace(/'/gm,'"'),Lt.debug(`Detecting diagram directive${t!==null?" type:"+t:""} based on the text:${e}`);let i;const o=[];for(;(i=an.exec(e))!==null;)if(i.index===an.lastIndex&&an.lastIndex++,i&&!t||t&&i[1]?.match(t)||t&&i[2]?.match(t)){const a=i[1]?i[1]:i[2],s=i[3]?i[3].trim():i[4]?JSON.parse(i[4].trim()):null;o.push({type:a,args:s})}return o.length===0?{type:e,args:null}:o.length===1?o[0]:o}catch(r){return Lt.error(`ERROR: ${r.message} - Unable to parse directive type: '${t}' based on the text: '${e}'`),{type:void 0,args:null}}},"detectDirective"),fM=C(function(e){return e.replace(an,"")},"removeDirectives"),gM=C(function(e,t){for(const[r,i]of t.entries())if(i.match(e))return r;return-1},"isSubstringInArray");function Vd(e,t){if(!e)return t;const r=`curve${e.charAt(0).toUpperCase()+e.slice(1)}`;return hM[r]??t}C(Vd,"interpolateToCurve");function Cy(e,t){const r=e.trim();if(r)return t.securityLevel!=="loose"?lk.sanitizeUrl(r):r}C(Cy,"formatUrl");var pM=C((e,...t)=>{const r=e.split("."),i=r.length-1,o=r[i];let a=window;for(let s=0;s<i;s++)if(a=a[r[s]],!a){Lt.error(`Function name: ${e} not found in window`);return}a[o](...t)},"runFunc");function Zd(e,t){return!e||!t?0:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}C(Zd,"distance");function wy(e){let t,r=0;e.forEach(o=>{r+=Zd(o,t),t=o});const i=r/2;return Kd(e,i)}C(wy,"traverseEdge");function ky(e){return e.length===1?e[0]:wy(e)}C(ky,"calcLabelPosition");var ig=C((e,t=2)=>{const r=Math.pow(10,t);return Math.round(e*r)/r},"roundNumber"),Kd=C((e,t)=>{let r,i=t;for(const o of e){if(r){const a=Zd(o,r);if(a===0)return r;if(a<i)i-=a;else{const s=i/a;if(s<=0)return r;if(s>=1)return{x:o.x,y:o.y};if(s>0&&s<1)return{x:ig((1-s)*r.x+s*o.x,5),y:ig((1-s)*r.y+s*o.y,5)}}}r=o}throw new Error("Could not find a suitable point for the given distance")},"calculatePoint"),mM=C((e,t,r)=>{Lt.info(`our points ${JSON.stringify(t)}`),t[0]!==r&&(t=t.reverse());const o=Kd(t,25),a=e?10:5,s=Math.atan2(t[0].y-o.y,t[0].x-o.x),n={x:0,y:0};return n.x=Math.sin(s)*a+(t[0].x+o.x)/2,n.y=-Math.cos(s)*a+(t[0].y+o.y)/2,n},"calcCardinalityPosition");function Sy(e,t,r){const i=structuredClone(r);Lt.info("our points",i),t!=="start_left"&&t!=="start_right"&&i.reverse();const o=25+e,a=Kd(i,o),s=10+e*.5,n=Math.atan2(i[0].y-a.y,i[0].x-a.x),l={x:0,y:0};return t==="start_left"?(l.x=Math.sin(n+Math.PI)*s+(i[0].x+a.x)/2,l.y=-Math.cos(n+Math.PI)*s+(i[0].y+a.y)/2):t==="end_right"?(l.x=Math.sin(n-Math.PI)*s+(i[0].x+a.x)/2,l.y=-Math.cos(n-Math.PI)*s+(i[0].y+a.y)/2):(l.x=Math.sin(n)*s+(i[0].x+a.x)/2,l.y=-Math.cos(n)*s+(i[0].y+a.y)/2),l}C(Sy,"calcTerminalLabelPosition");function vy(e){let t="",r="";for(const i of e)i!==void 0&&(i.startsWith("color:")||i.startsWith("text-align:")?r=r+i+";":t=t+i+";");return{style:t,labelStyle:r}}C(vy,"getStylesFromArray");var og=0,yM=C(()=>(og++,"id-"+Math.random().toString(36).substr(2,12)+"-"+og),"generateId");function My(e){let t="";const r="0123456789abcdef",i=r.length;for(let o=0;o<e;o++)t+=r.charAt(Math.floor(Math.random()*i));return t}C(My,"makeRandomHex");var xM=C(e=>My(e.length),"random"),bM=C(function(){return{x:0,y:0,fill:void 0,anchor:"start",style:"#666",width:100,height:100,textMargin:0,rx:0,ry:0,valign:void 0,text:""}},"getTextObj"),CM=C(function(e,t){const r=t.text.replace(kn.lineBreakRegex," "),[,i]=ec(t.fontSize),o=e.append("text");o.attr("x",t.x),o.attr("y",t.y),o.style("text-anchor",t.anchor),o.style("font-family",t.fontFamily),o.style("font-size",i),o.style("font-weight",t.fontWeight),o.attr("fill",t.fill),t.class!==void 0&&o.attr("class",t.class);const a=o.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.attr("fill",t.fill),a.text(r),o},"drawSimpleText"),wM=vn((e,t,r)=>{if(!e||(r=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",joinWith:"<br/>"},r),kn.hasBreaks(e)))return e;const i=e.split(" ").filter(Boolean),o=[];let a="";return i.forEach((s,n)=>{const l=Po(`${s} `,r),c=Po(a,r);if(l>t){const{hyphenatedStrings:u,remainingWord:f}=kM(s,t,"-",r);o.push(a,...u),a=f}else c+l>=t?(o.push(a),a=s):a=[a,s].filter(Boolean).join(" ");n+1===i.length&&o.push(a)}),o.filter(s=>s!=="").join(r.joinWith)},(e,t,r)=>`${e}${t}${r.fontSize}${r.fontWeight}${r.fontFamily}${r.joinWith}`),kM=vn((e,t,r="-",i)=>{i=Object.assign({fontSize:12,fontWeight:400,fontFamily:"Arial",margin:0},i);const o=[...e],a=[];let s="";return o.forEach((n,l)=>{const c=`${s}${n}`;if(Po(c,i)>=t){const d=l+1,u=o.length===d,f=`${c}${r}`;a.push(u?c:f),s=""}else s=c}),{hyphenatedStrings:a,remainingWord:s}},(e,t,r="-",i)=>`${e}${t}${r}${i.fontSize}${i.fontWeight}${i.fontFamily}`);function Ty(e,t){return Qd(e,t).height}C(Ty,"calculateTextHeight");function Po(e,t){return Qd(e,t).width}C(Po,"calculateTextWidth");var Qd=vn((e,t)=>{const{fontSize:r=12,fontFamily:i="Arial",fontWeight:o=400}=t;if(!e)return{width:0,height:0};const[,a]=ec(r),s=["sans-serif",i],n=e.split(kn.lineBreakRegex),l=[],c=Ye("body");if(!c.remove)return{width:0,height:0,lineHeight:0};const h=c.append("svg");for(const u of s){let f=0;const g={width:0,height:0,lineHeight:0};for(const p of n){const m=bM();m.text=p||cM;const y=CM(h,m).style("font-size",a).style("font-weight",o).style("font-family",u),x=(y._groups||y)[0][0].getBBox();if(x.width===0&&x.height===0)throw new Error("svg element not in render tree");g.width=Math.round(Math.max(g.width,x.width)),f=Math.round(x.height),g.height+=f,g.lineHeight=Math.round(Math.max(g.lineHeight,f))}l.push(g)}h.remove();const d=isNaN(l[1].height)||isNaN(l[1].width)||isNaN(l[1].lineHeight)||l[0].height>l[1].height&&l[0].width>l[1].width&&l[0].lineHeight>l[1].lineHeight?0:1;return l[d]},(e,t)=>`${e}${t.fontSize}${t.fontWeight}${t.fontFamily}`),ys,SM=(ys=class{constructor(t=!1,r){this.count=0,this.count=r?r.length:0,this.next=t?()=>this.count++:()=>Date.now()}},C(ys,"InitIDGenerator"),ys),Nn,vM=C(function(e){return Nn=Nn||document.createElement("div"),e=escape(e).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),Nn.innerHTML=e,unescape(Nn.textContent)},"entityDecode");function Jd(e){return"str"in e}C(Jd,"isDetailedError");function By(e){return e instanceof Error?e.message:String(e)}C(By,"getErrorMessage");var MM=C((e,t,r,i)=>{if(!i)return;const o=e.node()?.getBBox();o&&e.append("text").text(i).attr("text-anchor","middle").attr("x",o.x+o.width/2).attr("y",-r).attr("class",t)},"insertTitle"),ec=C(e=>{if(typeof e=="number")return[e,e+"px"];const t=parseInt(e??"",10);return Number.isNaN(t)?[void 0,void 0]:e===String(t)?[t,e+"px"]:[t,e]},"parseFontSize");function tu(e,t){return lM({},e,t)}C(tu,"cleanAndMerge");var Si={assignWithDepth:Wr,wrapLabel:wM,calculateTextHeight:Ty,calculateTextWidth:Po,calculateTextDimensions:Qd,cleanAndMerge:tu,detectInit:uM,detectDirective:by,isSubstringInArray:gM,interpolateToCurve:Vd,calcLabelPosition:ky,calcCardinalityPosition:mM,calcTerminalLabelPosition:Sy,formatUrl:Cy,getStylesFromArray:vy,generateId:yM,random:xM,runFunc:pM,entityDecode:vM,insertTitle:MM,isLabelCoordinateInPath:_y,parseFontSize:ec,InitIDGenerator:SM},TM=C(function(e){let t=e;return t=t.replace(/style.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/classDef.*:\S*#.*;/g,function(r){return r.substring(0,r.length-1)}),t=t.replace(/#\w+;/g,function(r){const i=r.substring(1,r.length-1);return/^\+?\d+$/.test(i)?"fl°°"+i+"¶ß":"fl°"+i+"¶ß"}),t},"encodeEntities"),ea=C(function(e){return e.replace(/fl°°/g,"&#").replace(/fl°/g,"&").replace(/¶ß/g,";")},"decodeEntities"),hP=C((e,t,{counter:r=0,prefix:i,suffix:o},a)=>a||`${i?`${i}_`:""}${e}_${t}_${r}${o?`_${o}`:""}`,"getEdgeId");function Hr(e){return e??null}C(Hr,"handleUndefinedAttr");function _y(e,t){const r=Math.round(e.x),i=Math.round(e.y),o=t.replace(/(\d+\.\d+)/g,a=>Math.round(parseFloat(a)).toString());return o.includes(r.toString())||o.includes(i.toString())}C(_y,"isLabelCoordinateInPath");function eu(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ea=eu();function Ly(e){Ea=e}var cn={exec:()=>null};function ur(e,t=""){let r=typeof e=="string"?e:e.source,i={replace:(o,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(fi.caret,"$1"),r=r.replace(o,s),i},getRegex:()=>new RegExp(r,t)};return i}var BM=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),fi={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},_M=/^(?:[ \t]*(?:\n|$))+/,LM=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,AM=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Mn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,FM=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ru=/(?:[*+-]|\d{1,9}[.)])/,Ay=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Fy=ur(Ay).replace(/bull/g,ru).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),$M=ur(Ay).replace(/bull/g,ru).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),iu=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,EM=/^[^\n]+/,ou=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,PM=ur(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ou).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),IM=ur(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ru).getRegex(),rc="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",au=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,OM=ur("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",au).replace("tag",rc).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),$y=ur(iu).replace("hr",Mn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rc).getRegex(),DM=ur(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",$y).getRegex(),su={blockquote:DM,code:LM,def:PM,fences:AM,heading:FM,hr:Mn,html:OM,lheading:Fy,list:IM,newline:_M,paragraph:$y,table:cn,text:EM},ag=ur("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Mn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rc).getRegex(),RM={...su,lheading:$M,table:ag,paragraph:ur(iu).replace("hr",Mn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ag).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",rc).getRegex()},NM={...su,html:ur(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",au).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:cn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ur(iu).replace("hr",Mn).replace("heading",` *#{1,6} *[^
161
161
  ]`).replace("lheading",Fy).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},qM=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,WM=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ey=/^( {2,}|\\)\n(?!\s*$)/,zM=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ic=/[\p{P}\p{S}]/u,nu=/[\s\p{P}\p{S}]/u,Py=/[^\s\p{P}\p{S}]/u,HM=ur(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,nu).getRegex(),Iy=/(?!~)[\p{P}\p{S}]/u,YM=/(?!~)[\s\p{P}\p{S}]/u,XM=/(?:[^\s\p{P}\p{S}]|~)/u,jM=ur(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",BM?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Oy=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,GM=ur(Oy,"u").replace(/punct/g,ic).getRegex(),UM=ur(Oy,"u").replace(/punct/g,Iy).getRegex(),Dy="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",VM=ur(Dy,"gu").replace(/notPunctSpace/g,Py).replace(/punctSpace/g,nu).replace(/punct/g,ic).getRegex(),ZM=ur(Dy,"gu").replace(/notPunctSpace/g,XM).replace(/punctSpace/g,YM).replace(/punct/g,Iy).getRegex(),KM=ur("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Py).replace(/punctSpace/g,nu).replace(/punct/g,ic).getRegex(),QM=ur(/\\(punct)/,"gu").replace(/punct/g,ic).getRegex(),JM=ur(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),tT=ur(au).replace("(?:-->|$)","-->").getRegex(),eT=ur("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",tT).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),El=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,rT=ur(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",El).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ry=ur(/^!?\[(label)\]\[(ref)\]/).replace("label",El).replace("ref",ou).getRegex(),Ny=ur(/^!?\[(ref)\](?:\[\])?/).replace("ref",ou).getRegex(),iT=ur("reflink|nolink(?!\\()","g").replace("reflink",Ry).replace("nolink",Ny).getRegex(),sg=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,lu={_backpedal:cn,anyPunctuation:QM,autolink:JM,blockSkip:jM,br:Ey,code:WM,del:cn,emStrongLDelim:GM,emStrongRDelimAst:VM,emStrongRDelimUnd:KM,escape:qM,link:rT,nolink:Ny,punctuation:HM,reflink:Ry,reflinkSearch:iT,tag:eT,text:zM,url:cn},oT={...lu,link:ur(/^!?\[(label)\]\((.*?)\)/).replace("label",El).getRegex(),reflink:ur(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",El).getRegex()},Rh={...lu,emStrongRDelimAst:ZM,emStrongLDelim:UM,url:ur(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",sg).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ur(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",sg).getRegex()},aT={...Rh,br:ur(Ey).replace("{2,}","*").getRegex(),text:ur(Rh.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},qn={normal:su,gfm:RM,pedantic:NM},Os={normal:lu,gfm:Rh,breaks:aT,pedantic:oT},sT={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ng=e=>sT[e];function ro(e,t){if(t){if(fi.escapeTest.test(e))return e.replace(fi.escapeReplace,ng)}else if(fi.escapeTestNoEncode.test(e))return e.replace(fi.escapeReplaceNoEncode,ng);return e}function lg(e){try{e=encodeURI(e).replace(fi.percentDecode,"%")}catch{return null}return e}function cg(e,t){let r=e.replace(fi.findPipe,(a,s,n)=>{let l=!1,c=s;for(;--c>=0&&n[c]==="\\";)l=!l;return l?"|":" |"}),i=r.split(fi.splitPipe),o=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;o<i.length;o++)i[o]=i[o].trim().replace(fi.slashPipe,"|");return i}function Ds(e,t,r){let i=e.length;if(i===0)return"";let o=0;for(;o<i&&e.charAt(i-o-1)===t;)o++;return e.slice(0,i-o)}function nT(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let i=0;i<e.length;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])r++;else if(e[i]===t[1]&&(r--,r<0))return i;return r>0?-2:-1}function hg(e,t,r,i,o){let a=t.href,s=t.title||null,n=e[1].replace(o.other.outputLinkReplace,"$1");i.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:s,text:n,tokens:i.inlineTokens(n)};return i.state.inLink=!1,l}function lT(e,t,r){let i=e.match(r.other.indentCodeCompensation);if(i===null)return t;let o=i[1];return t.split(`
162
162
  `).map(a=>{let s=a.match(r.other.beginningSpace);if(s===null)return a;let[n]=s;return n.length>=o.length?a.slice(o.length):a}).join(`
163
163
  `)}var Pl=class{constructor(t){xr(this,"options");xr(this,"rules");xr(this,"lexer");this.options=t||Ea}space(t){let r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){let r=this.rules.block.code.exec(t);if(r){let i=r[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?i:Ds(i,`
@@ -226,9 +226,9 @@ ${a.join(`
226
226
  `)}`)}},C(xs,"Profiler");globalThis.injected??={includeLargeFeatures:!0,profiling:!1,version:"0.0.0"};function Wy(e,{markdownAutoWrap:t}){const i=e.replace(/<br\/>/g,`
227
227
  `).replace(/\n{2,}/g,`
228
228
  `);return qy(i)}C(Wy,"preprocessMarkdown");function zy(e){return e.split(/\\n|\n|<br\s*\/?>/gi).map(t=>t.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}C(zy,"nonMarkdownToLines");function Hy(e,t={}){const r=Wy(e,t),i=fr.lexer(r),o=[[]];let a=0;function s(n,l="normal"){n.type==="text"?n.text.split(`
229
- `).forEach((h,d)=>{d!==0&&(a++,o.push([])),h.split(" ").forEach(u=>{u=u.replace(/&#39;/g,"'"),u&&o[a].push({content:u,type:l})})}):n.type==="strong"||n.type==="em"?n.tokens.forEach(c=>{s(c,n.type)}):n.type==="html"&&o[a].push({content:n.text,type:"normal"})}return C(s,"processNode"),i.forEach(n=>{n.type==="paragraph"?n.tokens?.forEach(l=>{s(l)}):n.type==="html"?o[a].push({content:n.text,type:"normal"}):o[a].push({content:n.raw,type:"normal"})}),o}C(Hy,"markdownToLines");function Yy(e){return e?`<p>${e.replace(/\\n|\n/g,"<br />")}</p>`:""}C(Yy,"nonMarkdownToHTML");function Xy(e,{markdownAutoWrap:t}={}){const r=fr.lexer(e);function i(o){return o.type==="text"?t===!1?o.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):o.text.replace(/\n */g,"<br/>"):o.type==="strong"?`<strong>${o.tokens?.map(i).join("")}</strong>`:o.type==="em"?`<em>${o.tokens?.map(i).join("")}</em>`:o.type==="paragraph"?`<p>${o.tokens?.map(i).join("")}</p>`:o.type==="space"?"":o.type==="html"?`${o.text}`:o.type==="escape"?o.text:(Lt.warn(`Unsupported markdown: ${o.type}`),o.raw)}return C(i,"output"),r.map(i).join("")}C(Xy,"markdownToHTML");var fT=(function(e){var t=function(){},r=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.msRequestAnimationFrame||function(c){return setTimeout(c,16)};function i(){var c=this;c.reads=[],c.writes=[],c.raf=r.bind(e)}C(i,"FastDom"),i.prototype={constructor:i,runTasks:C(function(c){for(var h;h=c.shift();)h()},"runTasks"),measure:C(function(c,h){var d=h?c.bind(h):c;return this.reads.push(d),o(this),d},"measure"),mutate:C(function(c,h){var d=h?c.bind(h):c;return this.writes.push(d),o(this),d},"mutate"),clear:C(function(c){return s(this.reads,c)||s(this.writes,c)},"clear"),extend:C(function(c){if(typeof c!="object")throw new Error("expected object");var h=Object.create(this);return n(h,c),h.fastdom=this,h.initialize&&h.initialize(),h},"extend"),catch:null};function o(c){c.scheduled||(c.scheduled=!0,c.raf(a.bind(null,c)))}C(o,"scheduleFlush");function a(c){var h=c.writes,d=c.reads,u;try{t("flushing reads",d.length),c.runTasks(d),t("flushing writes",h.length),c.runTasks(h)}catch(f){u=f}if(c.scheduled=!1,(d.length||h.length)&&o(c),u)if(t("task errored",u.message),c.catch)c.catch(u);else throw u}C(a,"flush");function s(c,h){var d=c.indexOf(h);return!!~d&&!!c.splice(d,1)}C(s,"remove");function n(c,h){for(var d in h)h.hasOwnProperty(d)&&(c[d]=h[d])}C(n,"mixin");var l=e.fastdom=e.fastdom||new i;return l})(typeof window<"u"?window:globalThis),jy={initialize:C(function(){this._tasks=new Map},"initialize"),mutate:C(function(e,t){return zh(this,"mutate",e,t)},"mutate"),measure:C(function(e,t){return zh(this,"measure",e,t)},"measure"),clear:C(function(e){var t=this._tasks,r=t.get(e);this.fastdom.clear(r),t.delete(e)},"clear")};function zh(e,t,r,i){var o=e._tasks,a=e.fastdom,s,n=new Promise(function(l,c){s=a[t](function(){o.delete(n);try{l(i?r.call(i):r())}catch(h){c(h)}},i)});return o.set(n,s),n}C(zh,"create");var{initialize:fP,mutate:gP,measure:pP,clear:mP}=jy,gT=jy,pT=fT.extend({raf(e){typeof queueMicrotask=="function"?queueMicrotask(e):setTimeout(e,0)}}).extend(gT),La=pT;function Gy(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}C(Gy,"splitTextToChars");function Uy(e,t){const r=Gy(t.content);return hu(e,[],r,t.type)}C(Uy,"splitWordToFitWidth");function hu(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];const[o,...a]=r,s=[...t,o];return e([{content:s.join(""),type:i}])?hu(e,s,a,i):(t.length===0&&o&&(t.push(o),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}C(hu,"splitWordToFitWidthRecursion");function Vy(e,t){if(e.some(({content:r})=>r.includes(`
229
+ `).forEach((h,d)=>{d!==0&&(a++,o.push([])),h.split(" ").forEach(u=>{u=u.replace(/&#39;/g,"'"),u&&o[a].push({content:u,type:l})})}):n.type==="strong"||n.type==="em"?n.tokens.forEach(c=>{s(c,n.type)}):n.type==="html"&&o[a].push({content:n.text,type:"normal"})}return C(s,"processNode"),i.forEach(n=>{n.type==="paragraph"?n.tokens?.forEach(l=>{s(l)}):n.type==="html"?o[a].push({content:n.text,type:"normal"}):o[a].push({content:n.raw,type:"normal"})}),o}C(Hy,"markdownToLines");function Yy(e){return e?`<p>${e.replace(/\\n|\n/g,"<br />")}</p>`:""}C(Yy,"nonMarkdownToHTML");function Xy(e,{markdownAutoWrap:t}={}){const r=fr.lexer(e);function i(o){return o.type==="text"?t===!1?o.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):o.text.replace(/\n */g,"<br/>"):o.type==="strong"?`<strong>${o.tokens?.map(i).join("")}</strong>`:o.type==="em"?`<em>${o.tokens?.map(i).join("")}</em>`:o.type==="paragraph"?`<p>${o.tokens?.map(i).join("")}</p>`:o.type==="space"?"":o.type==="html"?`${o.text}`:o.type==="escape"?o.text:(Lt.warn(`Unsupported markdown: ${o.type}`),o.raw)}return C(i,"output"),r.map(i).join("")}C(Xy,"markdownToHTML");var fT=(function(e){var t=function(){},r=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.msRequestAnimationFrame||function(c){return setTimeout(c,16)};function i(){var c=this;c.reads=[],c.writes=[],c.raf=r.bind(e)}C(i,"FastDom"),i.prototype={constructor:i,runTasks:C(function(c){for(var h;h=c.shift();)h()},"runTasks"),measure:C(function(c,h){var d=h?c.bind(h):c;return this.reads.push(d),o(this),d},"measure"),mutate:C(function(c,h){var d=h?c.bind(h):c;return this.writes.push(d),o(this),d},"mutate"),clear:C(function(c){return s(this.reads,c)||s(this.writes,c)},"clear"),extend:C(function(c){if(typeof c!="object")throw new Error("expected object");var h=Object.create(this);return n(h,c),h.fastdom=this,h.initialize&&h.initialize(),h},"extend"),catch:null};function o(c){c.scheduled||(c.scheduled=!0,c.raf(a.bind(null,c)))}C(o,"scheduleFlush");function a(c){var h=c.writes,d=c.reads,u;try{t("flushing reads",d.length),c.runTasks(d),t("flushing writes",h.length),c.runTasks(h)}catch(f){u=f}if(c.scheduled=!1,(d.length||h.length)&&o(c),u)if(t("task errored",u.message),c.catch)c.catch(u);else throw u}C(a,"flush");function s(c,h){var d=c.indexOf(h);return!!~d&&!!c.splice(d,1)}C(s,"remove");function n(c,h){for(var d in h)h.hasOwnProperty(d)&&(c[d]=h[d])}C(n,"mixin");var l=e.fastdom=e.fastdom||new i;return l})(typeof window<"u"?window:globalThis),jy={initialize:C(function(){this._tasks=new Map},"initialize"),mutate:C(function(e,t){return zh(this,"mutate",e,t)},"mutate"),measure:C(function(e,t){return zh(this,"measure",e,t)},"measure"),clear:C(function(e){var t=this._tasks,r=t.get(e);this.fastdom.clear(r),t.delete(e)},"clear")};function zh(e,t,r,i){var o=e._tasks,a=e.fastdom,s,n=new Promise(function(l,c){s=a[t](function(){o.delete(n);try{l(i?r.call(i):r())}catch(h){c(h)}},i)});return o.set(n,s),n}C(zh,"create");var{initialize:mP,mutate:yP,measure:xP,clear:bP}=jy,gT=jy,pT=fT.extend({raf(e){typeof queueMicrotask=="function"?queueMicrotask(e):setTimeout(e,0)}}).extend(gT),La=pT;function Gy(e){return Intl.Segmenter?[...new Intl.Segmenter().segment(e)].map(t=>t.segment):[...e]}C(Gy,"splitTextToChars");function Uy(e,t){const r=Gy(t.content);return hu(e,[],r,t.type)}C(Uy,"splitWordToFitWidth");function hu(e,t,r,i){if(r.length===0)return[{content:t.join(""),type:i},{content:"",type:i}];const[o,...a]=r,s=[...t,o];return e([{content:s.join(""),type:i}])?hu(e,s,a,i):(t.length===0&&o&&(t.push(o),r.shift()),[{content:t.join(""),type:i},{content:r.join(""),type:i}])}C(hu,"splitWordToFitWidthRecursion");function Vy(e,t){if(e.some(({content:r})=>r.includes(`
230
230
  `)))throw new Error("splitLineToFitWidth does not support newlines in the line");return Ol(e,t)}C(Vy,"splitLineToFitWidth");function Ol(e,t,r=[],i=[]){if(e.length===0)return i.length>0&&r.push(i),r.length>0?r:[];let o="";e[0].content===" "&&(o=" ",e.shift());const a=e.shift()??{content:" ",type:"normal"},s=[...i];if(o!==""&&s.push({content:o,type:"normal"}),s.push(a),t(s))return Ol(e,t,r,s);if(i.length>0)r.push(i),e.unshift(a);else if(a.content){const[n,l]=Uy(t,a);r.push([n]),l.content&&e.unshift(l)}return Ol(e,t,r)}C(Ol,"splitLineToFitWidthRecursion");function Hh(e,t){t&&e.attr("style",t)}C(Hh,"applyStyle");var dg=16384;async function Zy(e,t,r,i,o=!1,a=Ar(),s=0){const n=e.append("foreignObject");n.attr("width",`${Math.min(10*r,dg)}px`),n.attr("height",`${Math.min(10*r,dg)}px`);const l=n.append("xhtml:div"),c=un(t.label)?await dm(t.label.replace(kn.lineBreakRegex,`
231
- `),a):Ei(t.label,a),h=t.isNode?"nodeLabel":"edgeLabel",d=l.append("span");d.html(c),Hh(d,t.labelStyle),d.attr("class",`${h} ${i}`),Hh(l,t.labelStyle),l.style("display","table-cell"),l.style("white-space","nowrap"),l.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(l.style("max-width",r+"px"),l.style("text-align","center")),l.attr("xmlns","http://www.w3.org/1999/xhtml"),o&&l.attr("class","labelBkg");const u=await La.measure(()=>l.node().getBoundingClientRect());return u.width===r?(l.style("display","table"),l.style("white-space","break-spaces"),l.style("width",r+"px")):u.width<s&&(l.style("display","table"),l.style("width",s+"px"),l.style("text-align","center")),n.node()}C(Zy,"addHtmlSpan");function oc(e,t,r,i=!1){const o=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return i&&o.attr("text-anchor","middle"),o}C(oc,"createTspan");function Ky(e,t,r){const i=e.append("text"),o=oc(i,1,t);ac(o,r);const a=o.node().getComputedTextLength();return i.remove(),a}C(Ky,"computeWidthOfText");function mT(e,t,r){const i=e.append("text"),o=oc(i,1,t);ac(o,[{content:r,type:"normal"}]);const a=o.node()?.getBoundingClientRect();return a&&i.remove(),a}C(mT,"computeDimensionOfText");function Qy(e,t,r,i=!1,o=!1){const s=t.append("g"),n=s.insert("rect").attr("class","background").attr("style","stroke: none"),l=s.append("text").attr("y","-10.1");o&&l.attr("text-anchor","middle");let c=0;for(const h of r){const d=C(f=>Ky(s,1.1,f)<=e,"checkWidth"),u=d(h)?[h]:Vy(h,d);for(const f of u){const g=oc(l,c,1.1,o);ac(g,f),c++}}if(i){const h=l.node().getBBox(),d=2;return n.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),s.node()}else return l.node()}C(Qy,"createFormattedText");function Yh(e){const t=/&(amp|lt|gt);/g;return e.replace(t,(r,i)=>{switch(i){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}C(Yh,"decodeHTMLEntities");function ac(e,t){e.text(""),t.forEach((r,i)=>{const o=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");i===0?o.text(Yh(r.content)):o.text(" "+Yh(r.content))})}C(ac,"updateTextContentAndStyles");async function Jy(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(o,a,s)=>(r.push((async()=>{const n=`${a}:${s}`;return await xm(n)?await $a(n,void 0,{class:"label-icon"}):`<i class='${Ei(o,t).replace(":"," ")}'></i>`})()),o));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}C(Jy,"replaceIconSubstring");var vi=C(async(e,t="",{style:r="",isTitle:i=!1,classes:o="",useHtmlLabels:a=!0,markdown:s=!0,isNode:n=!0,width:l=200,minWidth:c=0,addSvgBackground:h=!1}={},d)=>{if(Lt.debug("XYZ createText",t,r,i,o,a,n,"addSvgBackground: ",h),a){const u=s?Xy(t,d):Yy(t),f=await Jy(ea(u),d),g=t.replace(/\\\\/g,"\\"),p={isNode:n,label:un(t)?g:f,labelStyle:r.replace("fill:","color:")};return await Zy(e,p,l,o,h,d,c)}else{const u=ea(t.replace(/<br\s*\/?>/g,"<br/>")),f=s?Hy(u.replace("<br>","<br/>"),d):zy(u),g=Qy(l,e,f,t?h:!1,!n);if(n){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const p=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Ye(g).attr("style",p)}else{const p=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");Ye(g).select("rect").attr("style",p.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Ye(g).select("text").attr("style",m)}return i?Ye(g).selectAll("tspan.text-outer-tspan").classed("title-row",!0):Ye(g).selectAll("tspan.text-outer-tspan").classed("row",!0),g}},"createText"),yT=new Set(["redux-color","redux-dark-color"]),xT=12,bT=64,du=C(e=>Array.isArray(e)&&e.length>0,"hasPalette"),CT=C((e,t)=>e!=null&&yT.has(e)&&du(t),"isColorTheme"),wT=/^[\w-]+$/,yP=C(e=>{const t=typeof e=="string"||typeof e=="number"?String(e):"";return wT.test(t)?t:"classic"},"safeLook"),tx=C(e=>du(e)?e.length:0,"paletteSlotCount"),xP=C((e,t)=>du(t)?tx(t):typeof e=="number"&&Number.isInteger(e)&&e>0&&e<=bT?e:xT,"colorSlotCount"),Oi=C((e,t,r,i)=>{if(t===void 0||!CT(r,i))return;const o=t%tx(i);e.attr("data-color-id",`color-${o}`)},"stampColorSlot");function Jc(e,t,r){if(e&&e.length){const[i,o]=t,a=Math.PI/180*r,s=Math.cos(a),n=Math.sin(a);for(const l of e){const[c,h]=l;l[0]=(c-i)*s-(h-o)*n+i,l[1]=(c-i)*n+(h-o)*s+o}}}function kT(e,t){return e[0]===t[0]&&e[1]===t[1]}function ST(e,t,r,i=1){const o=r,a=Math.max(t,.1),s=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,n=[0,0];if(o)for(const c of s)Jc(c,n,o);const l=(function(c,h,d){const u=[];for(const x of c){const b=[...x];kT(b[0],b[b.length-1])||b.push([b[0][0],b[0][1]]),b.length>2&&u.push(b)}const f=[];h=Math.max(h,.1);const g=[];for(const x of u)for(let b=0;b<x.length-1;b++){const S=x[b],T=x[b+1];if(S[1]!==T[1]){const k=Math.min(S[1],T[1]);g.push({ymin:k,ymax:Math.max(S[1],T[1]),x:k===S[1]?S[0]:T[0],islope:(T[0]-S[0])/(T[1]-S[1])})}}if(g.sort(((x,b)=>x.ymin<b.ymin?-1:x.ymin>b.ymin?1:x.x<b.x?-1:x.x>b.x?1:x.ymax===b.ymax?0:(x.ymax-b.ymax)/Math.abs(x.ymax-b.ymax))),!g.length)return f;let p=[],m=g[0].ymin,y=0;for(;p.length||g.length;){if(g.length){let x=-1;for(let b=0;b<g.length&&!(g[b].ymin>m);b++)x=b;g.splice(0,x+1).forEach((b=>{p.push({s:m,edge:b})}))}if(p=p.filter((x=>!(x.edge.ymax<=m))),p.sort(((x,b)=>x.edge.x===b.edge.x?0:(x.edge.x-b.edge.x)/Math.abs(x.edge.x-b.edge.x))),(d!==1||y%h==0)&&p.length>1)for(let x=0;x<p.length;x+=2){const b=x+1;if(b>=p.length)break;const S=p[x].edge,T=p[b].edge;f.push([[Math.round(S.x),m],[Math.round(T.x),m]])}m+=d,p.forEach((x=>{x.edge.x=x.edge.x+d*x.edge.islope})),y++}return f})(s,a,i);if(o){for(const c of s)Jc(c,n,-o);(function(c,h,d){const u=[];c.forEach((f=>u.push(...f))),Jc(u,h,d)})(l,n,-o)}return l}function Tn(e,t){var r;const i=t.hachureAngle+90;let o=t.hachureGap;o<0&&(o=4*t.strokeWidth),o=Math.round(Math.max(o,.1));let a=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=o),ST(e,o,i,a||1)}class uu{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const i=Tn(t,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(t,r){const i=[];for(const o of t)i.push(...this.helper.doubleLineOps(o[0][0],o[0][1],o[1][0],o[1][1],r));return i}}function sc(e){const t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}class vT extends uu{fillPolygons(t,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);const o=Tn(t,Object.assign({},r,{hachureGap:i})),a=Math.PI/180*r.hachureAngle,s=[],n=.5*i*Math.cos(a),l=.5*i*Math.sin(a);for(const[c,h]of o)sc([c,h])&&s.push([[c[0]-n,c[1]+l],[...h]],[[c[0]+n,c[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(s,r)}}}class MT extends uu{fillPolygons(t,r){const i=this._fillPolygons(t,r),o=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(t,o);return i.ops=i.ops.concat(a.ops),i}}class TT{constructor(t){this.helper=t}fillPolygons(t,r){const i=Tn(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(i,r)}dotsOnLines(t,r){const i=[];let o=r.hachureGap;o<0&&(o=4*r.strokeWidth),o=Math.max(o,.1);let a=r.fillWeight;a<0&&(a=r.strokeWidth/2);const s=o/4;for(const n of t){const l=sc(n),c=l/o,h=Math.ceil(c)-1,d=l-h*o,u=(n[0][0]+n[1][0])/2-o/4,f=Math.min(n[0][1],n[1][1]);for(let g=0;g<h;g++){const p=f+d+g*o,m=u-s+2*Math.random()*s,y=p-s+2*Math.random()*s,x=this.helper.ellipse(m,y,a,a,r);i.push(...x.ops)}}return{type:"fillSketch",ops:i}}}class BT{constructor(t){this.helper=t}fillPolygons(t,r){const i=Tn(t,r);return{type:"fillSketch",ops:this.dashedLine(i,r)}}dashedLine(t,r){const i=r.dashOffset<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashOffset,o=r.dashGap<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashGap,a=[];return t.forEach((s=>{const n=sc(s),l=Math.floor(n/(i+o)),c=(n+o-l*(i+o))/2;let h=s[0],d=s[1];h[0]>d[0]&&(h=s[1],d=s[0]);const u=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let f=0;f<l;f++){const g=f*(i+o),p=g+i,m=[h[0]+g*Math.cos(u)+c*Math.cos(u),h[1]+g*Math.sin(u)+c*Math.sin(u)],y=[h[0]+p*Math.cos(u)+c*Math.cos(u),h[1]+p*Math.sin(u)+c*Math.sin(u)];a.push(...this.helper.doubleLineOps(m[0],m[1],y[0],y[1],r))}})),a}}class _T{constructor(t){this.helper=t}fillPolygons(t,r){const i=r.hachureGap<0?4*r.strokeWidth:r.hachureGap,o=r.zigzagOffset<0?i:r.zigzagOffset,a=Tn(t,r=Object.assign({},r,{hachureGap:i+o}));return{type:"fillSketch",ops:this.zigzagLines(a,o,r)}}zigzagLines(t,r,i){const o=[];return t.forEach((a=>{const s=sc(a),n=Math.round(s/(2*r));let l=a[0],c=a[1];l[0]>c[0]&&(l=a[1],c=a[0]);const h=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let d=0;d<n;d++){const u=2*d*r,f=2*(d+1)*r,g=Math.sqrt(2*Math.pow(r,2)),p=[l[0]+u*Math.cos(h),l[1]+u*Math.sin(h)],m=[l[0]+f*Math.cos(h),l[1]+f*Math.sin(h)],y=[p[0]+g*Math.cos(h+Math.PI/4),p[1]+g*Math.sin(h+Math.PI/4)];o.push(...this.helper.doubleLineOps(p[0],p[1],y[0],y[1],i),...this.helper.doubleLineOps(y[0],y[1],m[0],m[1],i))}})),o}}const xi={};class LT{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const AT=0,th=1,ug=2,Wn={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function eh(e,t){return e.type===t}function fu(e){const t=[],r=(function(s){const n=new Array;for(;s!=="";)if(s.match(/^([ \t\r\n,]+)/))s=s.substr(RegExp.$1.length);else if(s.match(/^([aAcChHlLmMqQsStTvVzZ])/))n[n.length]={type:AT,text:RegExp.$1},s=s.substr(RegExp.$1.length);else{if(!s.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];n[n.length]={type:th,text:`${parseFloat(RegExp.$1)}`},s=s.substr(RegExp.$1.length)}return n[n.length]={type:ug,text:""},n})(e);let i="BOD",o=0,a=r[o];for(;!eh(a,ug);){let s=0;const n=[];if(i==="BOD"){if(a.text!=="M"&&a.text!=="m")return fu("M0,0"+e);o++,s=Wn[a.text],i=a.text}else eh(a,th)?s=Wn[i]:(o++,s=Wn[a.text],i=a.text);if(!(o+s<r.length))throw new Error("Path data ended short");for(let l=o;l<o+s;l++){const c=r[l];if(!eh(c,th))throw new Error("Param not a number: "+i+","+c.text);n[n.length]=+c.text}if(typeof Wn[i]!="number")throw new Error("Bad segment: "+i);{const l={key:i,data:n};t.push(l),o+=s,a=r[o],i==="M"&&(i="L"),i==="m"&&(i="l")}}return t}function ex(e){let t=0,r=0,i=0,o=0;const a=[];for(const{key:s,data:n}of e)switch(s){case"M":a.push({key:"M",data:[...n]}),[t,r]=n,[i,o]=n;break;case"m":t+=n[0],r+=n[1],a.push({key:"M",data:[t,r]}),i=t,o=r;break;case"L":a.push({key:"L",data:[...n]}),[t,r]=n;break;case"l":t+=n[0],r+=n[1],a.push({key:"L",data:[t,r]});break;case"C":a.push({key:"C",data:[...n]}),t=n[4],r=n[5];break;case"c":{const l=n.map(((c,h)=>h%2?c+r:c+t));a.push({key:"C",data:l}),t=l[4],r=l[5];break}case"Q":a.push({key:"Q",data:[...n]}),t=n[2],r=n[3];break;case"q":{const l=n.map(((c,h)=>h%2?c+r:c+t));a.push({key:"Q",data:l}),t=l[2],r=l[3];break}case"A":a.push({key:"A",data:[...n]}),t=n[5],r=n[6];break;case"a":t+=n[5],r+=n[6],a.push({key:"A",data:[n[0],n[1],n[2],n[3],n[4],t,r]});break;case"H":a.push({key:"H",data:[...n]}),t=n[0];break;case"h":t+=n[0],a.push({key:"H",data:[t]});break;case"V":a.push({key:"V",data:[...n]}),r=n[0];break;case"v":r+=n[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...n]}),t=n[2],r=n[3];break;case"s":{const l=n.map(((c,h)=>h%2?c+r:c+t));a.push({key:"S",data:l}),t=l[2],r=l[3];break}case"T":a.push({key:"T",data:[...n]}),t=n[0],r=n[1];break;case"t":t+=n[0],r+=n[1],a.push({key:"T",data:[t,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),t=i,r=o}return a}function rx(e){const t=[];let r="",i=0,o=0,a=0,s=0,n=0,l=0;for(const{key:c,data:h}of e){switch(c){case"M":t.push({key:"M",data:[...h]}),[i,o]=h,[a,s]=h;break;case"C":t.push({key:"C",data:[...h]}),i=h[4],o=h[5],n=h[2],l=h[3];break;case"L":t.push({key:"L",data:[...h]}),[i,o]=h;break;case"H":i=h[0],t.push({key:"L",data:[i,o]});break;case"V":o=h[0],t.push({key:"L",data:[i,o]});break;case"S":{let d=0,u=0;r==="C"||r==="S"?(d=i+(i-n),u=o+(o-l)):(d=i,u=o),t.push({key:"C",data:[d,u,...h]}),n=h[0],l=h[1],i=h[2],o=h[3];break}case"T":{const[d,u]=h;let f=0,g=0;r==="Q"||r==="T"?(f=i+(i-n),g=o+(o-l)):(f=i,g=o);const p=i+2*(f-i)/3,m=o+2*(g-o)/3,y=d+2*(f-d)/3,x=u+2*(g-u)/3;t.push({key:"C",data:[p,m,y,x,d,u]}),n=f,l=g,i=d,o=u;break}case"Q":{const[d,u,f,g]=h,p=i+2*(d-i)/3,m=o+2*(u-o)/3,y=f+2*(d-f)/3,x=g+2*(u-g)/3;t.push({key:"C",data:[p,m,y,x,f,g]}),n=d,l=u,i=f,o=g;break}case"A":{const d=Math.abs(h[0]),u=Math.abs(h[1]),f=h[2],g=h[3],p=h[4],m=h[5],y=h[6];d===0||u===0?(t.push({key:"C",data:[i,o,m,y,m,y]}),i=m,o=y):(i!==m||o!==y)&&(ix(i,o,m,y,d,u,f,g,p).forEach((function(x){t.push({key:"C",data:x})})),i=m,o=y);break}case"Z":t.push({key:"Z",data:[]}),i=a,o=s}r=c}return t}function Rs(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function ix(e,t,r,i,o,a,s,n,l,c){const h=(d=s,Math.PI*d/180);var d;let u=[],f=0,g=0,p=0,m=0;if(c)[f,g,p,m]=c;else{[e,t]=Rs(e,t,-h),[r,i]=Rs(r,i,-h);const O=(e-r)/2,$=(t-i)/2;let I=O*O/(o*o)+$*$/(a*a);I>1&&(I=Math.sqrt(I),o*=I,a*=I);const F=o*o,R=a*a,q=F*R-F*$*$-R*O*O,D=F*$*$+R*O*O,P=(n===l?-1:1)*Math.sqrt(Math.abs(q/D));p=P*o*$/a+(e+r)/2,m=P*-a*O/o+(t+i)/2,f=Math.asin(parseFloat(((t-m)/a).toFixed(9))),g=Math.asin(parseFloat(((i-m)/a).toFixed(9))),e<p&&(f=Math.PI-f),r<p&&(g=Math.PI-g),f<0&&(f=2*Math.PI+f),g<0&&(g=2*Math.PI+g),l&&f>g&&(f-=2*Math.PI),!l&&g>f&&(g-=2*Math.PI)}let y=g-f;if(Math.abs(y)>120*Math.PI/180){const O=g,$=r,I=i;g=l&&g>f?f+120*Math.PI/180*1:f+120*Math.PI/180*-1,u=ix(r=p+o*Math.cos(g),i=m+a*Math.sin(g),$,I,o,a,s,0,l,[g,O,p,m])}y=g-f;const x=Math.cos(f),b=Math.sin(f),S=Math.cos(g),T=Math.sin(g),k=Math.tan(y/4),_=4/3*o*k,L=4/3*a*k,v=[e,t],M=[e+_*b,t-L*x],B=[r+_*T,i-L*S],E=[r,i];if(M[0]=2*v[0]-M[0],M[1]=2*v[1]-M[1],c)return[M,B,E].concat(u);{u=[M,B,E].concat(u);const O=[];for(let $=0;$<u.length;$+=3){const I=Rs(u[$][0],u[$][1],h),F=Rs(u[$+1][0],u[$+1][1],h),R=Rs(u[$+2][0],u[$+2][1],h);O.push([I[0],I[1],F[0],F[1],R[0],R[1]])}return O}}const FT={randOffset:function(e,t){return Re(e,t)},randOffsetWithRange:function(e,t,r){return Dl(e,t,r)},ellipse:function(e,t,r,i,o){const a=ax(r,i,o);return Xh(e,t,o,a).opset},doubleLineOps:function(e,t,r,i,o){return ra(e,t,r,i,o,!0)}};function ox(e,t,r,i,o){return{type:"path",ops:ra(e,t,r,i,o)}}function dl(e,t,r){const i=(e||[]).length;if(i>2){const o=[];for(let a=0;a<i-1;a++)o.push(...ra(e[a][0],e[a][1],e[a+1][0],e[a+1][1],r));return t&&o.push(...ra(e[i-1][0],e[i-1][1],e[0][0],e[0][1],r)),{type:"path",ops:o}}return i===2?ox(e[0][0],e[0][1],e[1][0],e[1][1],r):{type:"path",ops:[]}}function $T(e,t,r,i,o){return(function(a,s){return dl(a,!0,s)})([[e,t],[e+r,t],[e+r,t+i],[e,t+i]],o)}function fg(e,t){if(e.length){const r=typeof e[0][0]=="number"?[e]:e,i=zn(r[0],1*(1+.2*t.roughness),t),o=t.disableMultiStroke?[]:zn(r[0],1.5*(1+.22*t.roughness),mg(t));for(let a=1;a<r.length;a++){const s=r[a];if(s.length){const n=zn(s,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:zn(s,1.5*(1+.22*t.roughness),mg(t));for(const c of n)c.op!=="move"&&i.push(c);for(const c of l)c.op!=="move"&&o.push(c)}}return{type:"path",ops:i.concat(o)}}return{type:"path",ops:[]}}function ax(e,t,r){const i=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),o=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*i)),a=2*Math.PI/o;let s=Math.abs(e/2),n=Math.abs(t/2);const l=1-r.curveFitting;return s+=Re(s*l,r),n+=Re(n*l,r),{increment:a,rx:s,ry:n}}function Xh(e,t,r,i){const[o,a]=yg(i.increment,e,t,i.rx,i.ry,1,i.increment*Dl(.1,Dl(.4,1,r),r),r);let s=Rl(o,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[n]=yg(i.increment,e,t,i.rx,i.ry,1.5,0,r),l=Rl(n,null,r);s=s.concat(l)}return{estimatedPoints:a,opset:{type:"path",ops:s}}}function gg(e,t,r,i,o,a,s,n,l){const c=e,h=t;let d=Math.abs(r/2),u=Math.abs(i/2);d+=Re(.01*d,l),u+=Re(.01*u,l);let f=o,g=a;for(;f<0;)f+=2*Math.PI,g+=2*Math.PI;g-f>2*Math.PI&&(f=0,g=2*Math.PI);const p=2*Math.PI/l.curveStepCount,m=Math.min(p/2,(g-f)/2),y=xg(m,c,h,d,u,f,g,1,l);if(!l.disableMultiStroke){const x=xg(m,c,h,d,u,f,g,1.5,l);y.push(...x)}return s&&(n?y.push(...ra(c,h,c+d*Math.cos(f),h+u*Math.sin(f),l),...ra(c,h,c+d*Math.cos(g),h+u*Math.sin(g),l)):y.push({op:"lineTo",data:[c,h]},{op:"lineTo",data:[c+d*Math.cos(f),h+u*Math.sin(f)]})),{type:"path",ops:y}}function pg(e,t){const r=rx(ex(fu(e))),i=[];let o=[0,0],a=[0,0];for(const{key:s,data:n}of r)switch(s){case"M":a=[n[0],n[1]],o=[n[0],n[1]];break;case"L":i.push(...ra(a[0],a[1],n[0],n[1],t)),a=[n[0],n[1]];break;case"C":{const[l,c,h,d,u,f]=n;i.push(...ET(l,c,h,d,u,f,a,t)),a=[u,f];break}case"Z":i.push(...ra(a[0],a[1],o[0],o[1],t)),a=[o[0],o[1]]}return{type:"path",ops:i}}function rh(e,t){const r=[];for(const i of e)if(i.length){const o=t.maxRandomnessOffset||0,a=i.length;if(a>2){r.push({op:"move",data:[i[0][0]+Re(o,t),i[0][1]+Re(o,t)]});for(let s=1;s<a;s++)r.push({op:"lineTo",data:[i[s][0]+Re(o,t),i[s][1]+Re(o,t)]})}}return{type:"fillPath",ops:r}}function Ra(e,t){return(function(r,i){let o=r.fillStyle||"hachure";if(!xi[o])switch(o){case"zigzag":xi[o]||(xi[o]=new vT(i));break;case"cross-hatch":xi[o]||(xi[o]=new MT(i));break;case"dots":xi[o]||(xi[o]=new TT(i));break;case"dashed":xi[o]||(xi[o]=new BT(i));break;case"zigzag-line":xi[o]||(xi[o]=new _T(i));break;default:o="hachure",xi[o]||(xi[o]=new uu(i))}return xi[o]})(t,FT).fillPolygons(e,t)}function mg(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function sx(e){return e.randomizer||(e.randomizer=new LT(e.seed||0)),e.randomizer.next()}function Dl(e,t,r,i=1){return r.roughness*i*(sx(r)*(t-e)+e)}function Re(e,t,r=1){return Dl(-e,e,t,r)}function ra(e,t,r,i,o,a=!1){const s=a?o.disableMultiStrokeFill:o.disableMultiStroke,n=jh(e,t,r,i,o,!0,!1);if(s)return n;const l=jh(e,t,r,i,o,!0,!0);return n.concat(l)}function jh(e,t,r,i,o,a,s){const n=Math.pow(e-r,2)+Math.pow(t-i,2),l=Math.sqrt(n);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let h=o.maxRandomnessOffset||0;h*h*100>n&&(h=l/10);const d=h/2,u=.2+.2*sx(o);let f=o.bowing*o.maxRandomnessOffset*(i-t)/200,g=o.bowing*o.maxRandomnessOffset*(e-r)/200;f=Re(f,o,c),g=Re(g,o,c);const p=[],m=()=>Re(d,o,c),y=()=>Re(h,o,c),x=o.preserveVertices;return s?p.push({op:"move",data:[e+(x?0:m()),t+(x?0:m())]}):p.push({op:"move",data:[e+(x?0:Re(h,o,c)),t+(x?0:Re(h,o,c))]}),s?p.push({op:"bcurveTo",data:[f+e+(r-e)*u+m(),g+t+(i-t)*u+m(),f+e+2*(r-e)*u+m(),g+t+2*(i-t)*u+m(),r+(x?0:m()),i+(x?0:m())]}):p.push({op:"bcurveTo",data:[f+e+(r-e)*u+y(),g+t+(i-t)*u+y(),f+e+2*(r-e)*u+y(),g+t+2*(i-t)*u+y(),r+(x?0:y()),i+(x?0:y())]}),p}function zn(e,t,r){if(!e.length)return[];const i=[];i.push([e[0][0]+Re(t,r),e[0][1]+Re(t,r)]),i.push([e[0][0]+Re(t,r),e[0][1]+Re(t,r)]);for(let o=1;o<e.length;o++)i.push([e[o][0]+Re(t,r),e[o][1]+Re(t,r)]),o===e.length-1&&i.push([e[o][0]+Re(t,r),e[o][1]+Re(t,r)]);return Rl(i,null,r)}function Rl(e,t,r){const i=e.length,o=[];if(i>3){const a=[],s=1-r.curveTightness;o.push({op:"move",data:[e[1][0],e[1][1]]});for(let n=1;n+2<i;n++){const l=e[n];a[0]=[l[0],l[1]],a[1]=[l[0]+(s*e[n+1][0]-s*e[n-1][0])/6,l[1]+(s*e[n+1][1]-s*e[n-1][1])/6],a[2]=[e[n+1][0]+(s*e[n][0]-s*e[n+2][0])/6,e[n+1][1]+(s*e[n][1]-s*e[n+2][1])/6],a[3]=[e[n+1][0],e[n+1][1]],o.push({op:"bcurveTo",data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}}else i===3?(o.push({op:"move",data:[e[1][0],e[1][1]]}),o.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):i===2&&o.push(...jh(e[0][0],e[0][1],e[1][0],e[1][1],r,!0,!0));return o}function yg(e,t,r,i,o,a,s,n){const l=[],c=[];if(n.roughness===0){e/=4,c.push([t+i*Math.cos(-e),r+o*Math.sin(-e)]);for(let h=0;h<=2*Math.PI;h+=e){const d=[t+i*Math.cos(h),r+o*Math.sin(h)];l.push(d),c.push(d)}c.push([t+i*Math.cos(0),r+o*Math.sin(0)]),c.push([t+i*Math.cos(e),r+o*Math.sin(e)])}else{const h=Re(.5,n)-Math.PI/2;c.push([Re(a,n)+t+.9*i*Math.cos(h-e),Re(a,n)+r+.9*o*Math.sin(h-e)]);const d=2*Math.PI+h-.01;for(let u=h;u<d;u+=e){const f=[Re(a,n)+t+i*Math.cos(u),Re(a,n)+r+o*Math.sin(u)];l.push(f),c.push(f)}c.push([Re(a,n)+t+i*Math.cos(h+2*Math.PI+.5*s),Re(a,n)+r+o*Math.sin(h+2*Math.PI+.5*s)]),c.push([Re(a,n)+t+.98*i*Math.cos(h+s),Re(a,n)+r+.98*o*Math.sin(h+s)]),c.push([Re(a,n)+t+.9*i*Math.cos(h+.5*s),Re(a,n)+r+.9*o*Math.sin(h+.5*s)])}return[c,l]}function xg(e,t,r,i,o,a,s,n,l){const c=a+Re(.1,l),h=[];h.push([Re(n,l)+t+.9*i*Math.cos(c-e),Re(n,l)+r+.9*o*Math.sin(c-e)]);for(let d=c;d<=s;d+=e)h.push([Re(n,l)+t+i*Math.cos(d),Re(n,l)+r+o*Math.sin(d)]);return h.push([t+i*Math.cos(s),r+o*Math.sin(s)]),h.push([t+i*Math.cos(s),r+o*Math.sin(s)]),Rl(h,null,l)}function ET(e,t,r,i,o,a,s,n){const l=[],c=[n.maxRandomnessOffset||1,(n.maxRandomnessOffset||1)+.3];let h=[0,0];const d=n.disableMultiStroke?1:2,u=n.preserveVertices;for(let f=0;f<d;f++)f===0?l.push({op:"move",data:[s[0],s[1]]}):l.push({op:"move",data:[s[0]+(u?0:Re(c[0],n)),s[1]+(u?0:Re(c[0],n))]}),h=u?[o,a]:[o+Re(c[f],n),a+Re(c[f],n)],l.push({op:"bcurveTo",data:[e+Re(c[f],n),t+Re(c[f],n),r+Re(c[f],n),i+Re(c[f],n),h[0],h[1]]});return l}function Ns(e){return[...e]}function bg(e,t=0){const r=e.length;if(r<3)throw new Error("A curve must have at least three points.");const i=[];if(r===3)i.push(Ns(e[0]),Ns(e[1]),Ns(e[2]),Ns(e[2]));else{const o=[];o.push(e[0],e[0]);for(let n=1;n<e.length;n++)o.push(e[n]),n===e.length-1&&o.push(e[n]);const a=[],s=1-t;i.push(Ns(o[0]));for(let n=1;n+2<o.length;n++){const l=o[n];a[0]=[l[0],l[1]],a[1]=[l[0]+(s*o[n+1][0]-s*o[n-1][0])/6,l[1]+(s*o[n+1][1]-s*o[n-1][1])/6],a[2]=[o[n+1][0]+(s*o[n][0]-s*o[n+2][0])/6,o[n+1][1]+(s*o[n][1]-s*o[n+2][1])/6],a[3]=[o[n+1][0],o[n+1][1]],i.push(a[1],a[2],a[3])}}return i}function ul(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function PT(e,t,r){const i=ul(t,r);if(i===0)return ul(e,t);let o=((e[0]-t[0])*(r[0]-t[0])+(e[1]-t[1])*(r[1]-t[1]))/i;return o=Math.max(0,Math.min(1,o)),ul(e,pa(t,r,o))}function pa(e,t,r){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function Gh(e,t,r,i){const o=i||[];if((function(n,l){const c=n[l+0],h=n[l+1],d=n[l+2],u=n[l+3];let f=3*h[0]-2*c[0]-u[0];f*=f;let g=3*h[1]-2*c[1]-u[1];g*=g;let p=3*d[0]-2*u[0]-c[0];p*=p;let m=3*d[1]-2*u[1]-c[1];return m*=m,f<p&&(f=p),g<m&&(g=m),f+g})(e,t)<r){const n=e[t+0];o.length?(a=o[o.length-1],s=n,Math.sqrt(ul(a,s))>1&&o.push(n)):o.push(n),o.push(e[t+3])}else{const l=e[t+0],c=e[t+1],h=e[t+2],d=e[t+3],u=pa(l,c,.5),f=pa(c,h,.5),g=pa(h,d,.5),p=pa(u,f,.5),m=pa(f,g,.5),y=pa(p,m,.5);Gh([l,u,p,y],0,r,o),Gh([y,m,g,d],0,r,o)}var a,s;return o}function IT(e,t){return Nl(e,0,e.length,t)}function Nl(e,t,r,i,o){const a=o||[],s=e[t],n=e[r-1];let l=0,c=1;for(let h=t+1;h<r-1;++h){const d=PT(e[h],s,n);d>l&&(l=d,c=h)}return Math.sqrt(l)>i?(Nl(e,t,c+1,i,a),Nl(e,c,r,i,a)):(a.length||a.push(s),a.push(n)),a}function ih(e,t=.15,r){const i=[],o=(e.length-1)/3;for(let a=0;a<o;a++)Gh(e,3*a,t,i);return r&&r>0?Nl(i,0,i.length,r):i}const ki="none";class ql{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,r,i){return{shape:t,sets:r||[],options:i||this.defaultOptions}}line(t,r,i,o,a){const s=this._o(a);return this._d("line",[ox(t,r,i,o,s)],s)}rectangle(t,r,i,o,a){const s=this._o(a),n=[],l=$T(t,r,i,o,s);if(s.fill){const c=[[t,r],[t+i,r],[t+i,r+o],[t,r+o]];s.fillStyle==="solid"?n.push(rh([c],s)):n.push(Ra([c],s))}return s.stroke!==ki&&n.push(l),this._d("rectangle",n,s)}ellipse(t,r,i,o,a){const s=this._o(a),n=[],l=ax(i,o,s),c=Xh(t,r,s,l);if(s.fill)if(s.fillStyle==="solid"){const h=Xh(t,r,s,l).opset;h.type="fillPath",n.push(h)}else n.push(Ra([c.estimatedPoints],s));return s.stroke!==ki&&n.push(c.opset),this._d("ellipse",n,s)}circle(t,r,i,o){const a=this.ellipse(t,r,i,i,o);return a.shape="circle",a}linearPath(t,r){const i=this._o(r);return this._d("linearPath",[dl(t,!1,i)],i)}arc(t,r,i,o,a,s,n=!1,l){const c=this._o(l),h=[],d=gg(t,r,i,o,a,s,n,!0,c);if(n&&c.fill)if(c.fillStyle==="solid"){const u=Object.assign({},c);u.disableMultiStroke=!0;const f=gg(t,r,i,o,a,s,!0,!1,u);f.type="fillPath",h.push(f)}else h.push((function(u,f,g,p,m,y,x){const b=u,S=f;let T=Math.abs(g/2),k=Math.abs(p/2);T+=Re(.01*T,x),k+=Re(.01*k,x);let _=m,L=y;for(;_<0;)_+=2*Math.PI,L+=2*Math.PI;L-_>2*Math.PI&&(_=0,L=2*Math.PI);const v=(L-_)/x.curveStepCount,M=[];for(let B=_;B<=L;B+=v)M.push([b+T*Math.cos(B),S+k*Math.sin(B)]);return M.push([b+T*Math.cos(L),S+k*Math.sin(L)]),M.push([b,S]),Ra([M],x)})(t,r,i,o,a,s,c));return c.stroke!==ki&&h.push(d),this._d("arc",h,c)}curve(t,r){const i=this._o(r),o=[],a=fg(t,i);if(i.fill&&i.fill!==ki)if(i.fillStyle==="solid"){const s=fg(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{const s=[],n=t;if(n.length){const l=typeof n[0][0]=="number"?[n]:n;for(const c of l)c.length<3?s.push(...c):c.length===3?s.push(...ih(bg([c[0],c[0],c[1],c[2]]),10,(1+i.roughness)/2)):s.push(...ih(bg(c),10,(1+i.roughness)/2))}s.length&&o.push(Ra([s],i))}return i.stroke!==ki&&o.push(a),this._d("curve",o,i)}polygon(t,r){const i=this._o(r),o=[],a=dl(t,!0,i);return i.fill&&(i.fillStyle==="solid"?o.push(rh([t],i)):o.push(Ra([t],i))),i.stroke!==ki&&o.push(a),this._d("polygon",o,i)}path(t,r){const i=this._o(r),o=[];if(!t)return this._d("path",o,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const a=i.fill&&i.fill!=="transparent"&&i.fill!==ki,s=i.stroke!==ki,n=!!(i.simplification&&i.simplification<1),l=(function(h,d,u){const f=rx(ex(fu(h))),g=[];let p=[],m=[0,0],y=[];const x=()=>{y.length>=4&&p.push(...ih(y,d)),y=[]},b=()=>{x(),p.length&&(g.push(p),p=[])};for(const{key:T,data:k}of f)switch(T){case"M":b(),m=[k[0],k[1]],p.push(m);break;case"L":x(),p.push([k[0],k[1]]);break;case"C":if(!y.length){const _=p.length?p[p.length-1]:m;y.push([_[0],_[1]])}y.push([k[0],k[1]]),y.push([k[2],k[3]]),y.push([k[4],k[5]]);break;case"Z":x(),p.push([m[0],m[1]])}if(b(),!u)return g;const S=[];for(const T of g){const k=IT(T,u);k.length&&S.push(k)}return S})(t,1,n?4-4*(i.simplification||1):(1+i.roughness)/2),c=pg(t,i);if(a)if(i.fillStyle==="solid")if(l.length===1){const h=pg(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else o.push(rh(l,i));else o.push(Ra(l,i));return s&&(n?l.forEach((h=>{o.push(dl(h,!1,i))})):o.push(c)),this._d("path",o,i)}opsToPath(t,r){let i="";for(const o of t.ops){const a=typeof r=="number"&&r>=0?o.data.map((s=>+s.toFixed(r))):o.data;switch(o.op){case"move":i+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":i+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":i+=`L${a[0]} ${a[1]} `}}return i.trim()}toPaths(t){const r=t.sets||[],i=t.options||this.defaultOptions,o=[];for(const a of r){let s=null;switch(a.type){case"path":s={d:this.opsToPath(a),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:ki};break;case"fillPath":s={d:this.opsToPath(a),stroke:ki,strokeWidth:0,fill:i.fill||ki};break;case"fillSketch":s=this.fillSketch(a,i)}s&&o.push(s)}return o}fillSketch(t,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||ki,strokeWidth:i,fill:ki}}_mergedShape(t){return t.filter(((r,i)=>i===0||r.op!=="move"))}}class OT{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new ql(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.ctx,a=t.options.fixedDecimalPlaceDigits;for(const s of r)switch(s.type){case"path":o.save(),o.strokeStyle=i.stroke==="none"?"transparent":i.stroke,o.lineWidth=i.strokeWidth,i.strokeLineDash&&o.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(o.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(o,s,a),o.restore();break;case"fillPath":{o.save(),o.fillStyle=i.fill||"";const n=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(o,s,a,n),o.restore();break}case"fillSketch":this.fillSketch(o,s,i)}}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=o,this._drawToContext(t,r,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,i,o="nonzero"){t.beginPath();for(const a of r.ops){const s=typeof i=="number"&&i>=0?a.data.map((n=>+n.toFixed(i))):a.data;switch(a.op){case"move":t.moveTo(s[0],s[1]);break;case"bcurveTo":t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":t.lineTo(s[0],s[1])}}r.type==="fillPath"?t.fill(o):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,i,o,a){const s=this.gen.line(t,r,i,o,a);return this.draw(s),s}rectangle(t,r,i,o,a){const s=this.gen.rectangle(t,r,i,o,a);return this.draw(s),s}ellipse(t,r,i,o,a){const s=this.gen.ellipse(t,r,i,o,a);return this.draw(s),s}circle(t,r,i,o){const a=this.gen.circle(t,r,i,o);return this.draw(a),a}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i),i}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i),i}arc(t,r,i,o,a,s,n=!1,l){const c=this.gen.arc(t,r,i,o,a,s,n,l);return this.draw(c),c}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i),i}path(t,r){const i=this.gen.path(t,r);return this.draw(i),i}}const Hn="http://www.w3.org/2000/svg";class DT{constructor(t,r){this.svg=t,this.gen=new ql(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.svg.ownerDocument||window.document,a=o.createElementNS(Hn,"g"),s=t.options.fixedDecimalPlaceDigits;for(const n of r){let l=null;switch(n.type){case"path":l=o.createElementNS(Hn,"path"),l.setAttribute("d",this.opsToPath(n,s)),l.setAttribute("stroke",i.stroke),l.setAttribute("stroke-width",i.strokeWidth+""),l.setAttribute("fill","none"),i.strokeLineDash&&l.setAttribute("stroke-dasharray",i.strokeLineDash.join(" ").trim()),i.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${i.strokeLineDashOffset}`);break;case"fillPath":l=o.createElementNS(Hn,"path"),l.setAttribute("d",this.opsToPath(n,s)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",i.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(o,n,i)}l&&a.appendChild(l)}return a}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2);const a=t.createElementNS(Hn,"path");return a.setAttribute("d",this.opsToPath(r,i.fixedDecimalPlaceDigits)),a.setAttribute("stroke",i.fill||""),a.setAttribute("stroke-width",o+""),a.setAttribute("fill","none"),i.fillLineDash&&a.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,i,o,a){const s=this.gen.line(t,r,i,o,a);return this.draw(s)}rectangle(t,r,i,o,a){const s=this.gen.rectangle(t,r,i,o,a);return this.draw(s)}ellipse(t,r,i,o,a){const s=this.gen.ellipse(t,r,i,o,a);return this.draw(s)}circle(t,r,i,o){const a=this.gen.circle(t,r,i,o);return this.draw(a)}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i)}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i)}arc(t,r,i,o,a,s,n=!1,l){const c=this.gen.arc(t,r,i,o,a,s,n,l);return this.draw(c)}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i)}path(t,r){const i=this.gen.path(t,r);return this.draw(i)}}var Zt={canvas:(e,t)=>new OT(e,t),svg:(e,t)=>new DT(e,t),generator:e=>new ql(e),newSeed:()=>ql.newSeed()},RT=1,NT=3;async function gu(e){const t=e.getElementsByTagName("img");if(!t||t.length===0)return;const r=!pu(e);await Promise.all([...t].map(i=>new Promise(o=>{function a(){if(i.style.display="flex",i.style.flexDirection="column",r){const s=Ge().fontSize?Ge().fontSize:window.getComputedStyle(document.body).fontSize,n=5,[l=Ld.fontSize]=ec(s),c=l*n+"px";i.style.minWidth=c,i.style.maxWidth=c}else i.style.width="100%";o(i)}C(a,"setupImage"),setTimeout(()=>{i.complete&&a()}),i.addEventListener("error",a),i.addEventListener("load",a)})))}C(gu,"configureLabelImages");function pu(e){return e.nodeType===NT?e.textContent?.trim()!=="":e.nodeType!==RT||e.tagName.toLowerCase()==="img"?!1:[...e.childNodes].some(pu)}C(pu,"hasTextBesidesImages");var Cg=3,qT=32,WT=C(async(e,t,r)=>{const i=Ge(),o=e.insert("g").attr("class",r??"node default").attr("id",t.domId||t.id),a=o.insert("g").attr("class","label").attr("style",Hr(t.labelStyle)),n=[{text:typeof t.label=="string"?t.label:t.label?.[0]??"",cssClass:"c4-name"},{text:t.stereotype,cssClass:"c4-type"},...(t.description??[]).map(y=>({text:y,cssClass:"c4-descr"}))].filter(y=>y.text),l=t.width?Math.max(t.width-2*(t.padding??0),qT):Ge().flowchart?.wrappingWidth??200,h=i.c4?.wrap??!0?l:Number.POSITIVE_INFINITY,d=await Promise.all(n.map(async y=>{const x=a.append("g").attr("class",y.cssClass),b=await vi(x,Ei(ea(y.text??""),i),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:h,style:t.labelStyle},i);return Ye(b).selectAll("tspan.text-outer-tspan").attr("text-anchor","middle"),Ye(b).selectAll("tspan.text-inner-tspan").attr("font-weight",null).attr("font-style",null),{el:x,box:x.node().getBBox()}})),u=Math.max(...d.map(({box:y})=>y.width),0);let f=0;for(const{el:y,box:x}of d)y.attr("transform",`translate(${u/2-x.x-x.width/2}, ${f-x.y})`),f+=x.height+Cg;const g=d.length>0?f-Cg:0;a.insert("rect",":first-child"),a.attr("transform",`translate(${-u/2}, ${-g/2})`);const p=a.node().getBBox(),m=(t.padding??0)/2;return{shapeSvg:o,bbox:p,halfPadding:m,label:a}},"c4LabelHelper"),wg=C((e,t)=>{const{x:r,y:i,width:o,height:a}=e;return o>=t?e:"left"in e?{x:r,y:i,width:t,height:a,top:i,left:r,bottom:i+a,right:r+t,toJSON:C(()=>({}),"toJSON")}:{x:r-(t-o)/2,y:i,width:t,height:a}},"withMinWidth"),he=C(async(e,t,r,{ignoreMinWidth:i=!1}={})=>{if(t.stereotype!==void 0)return WT(e,t,r);let o;const a=t.useHtmlLabels||mo(Ge()?.htmlLabels);r?o=r:o="node default";const s=e.insert("g").attr("class",o).attr("id",t.domId||t.id),n=s.insert("g").attr("class","label").attr("style",Hr(t.labelStyle));let l;t.label===void 0?l="":l=typeof t.label=="string"?t.label:t.label[0];const c=!!t.icon||!!t.img,h=t.labelType==="markdown",d=l&&!t.width&&!i?t.minWidth??0:0,u=await vi(n,Ei(ea(l),Ge()),{useHtmlLabels:a,width:t.width||t.wrappingWidth||Ge().flowchart?.wrappingWidth,minWidth:d,classes:h?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:c,markdown:h},Ge()),f=(t?.padding??0)/2;let g;if(a){const p=u.children[0],m=Ye(u);await gu(p),g=await La.measure(()=>p.getBoundingClientRect()),g=wg(g,d),m.attr("width",g.width),m.attr("height",g.height)}else g=await La.measure(()=>u.getBBox()),g=wg(g,d);return a?n.attr("transform","translate("+-g.width/2+", "+-g.height/2+")"):n.attr("transform","translate(0, "+-g.height/2+")"),t.centerLabel&&n.attr("transform","translate("+-g.width/2+", "+-g.height/2+")"),n.insert("rect",":first-child"),{shapeSvg:s,bbox:g,halfPadding:f,label:n}},"labelHelper"),ka=C(async(e,t,r)=>{const i=r.useHtmlLabels??Zr(Ge()),o=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await vi(o,Ei(ea(t),Ge()),{useHtmlLabels:i,width:r.width||Ge()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),s=r.padding/2;let n;if(Zr(Ge())){const l=a.children[0],c=Ye(a);n=await La.measure(()=>l.getBoundingClientRect()),c.attr("width",n.width),c.attr("height",n.height)}else n=await La.measure(()=>a.getBBox());return i?o.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"):o.attr("transform","translate(0, "+-n.height/2+")"),r.centerLabel&&o.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:e,bbox:n,halfPadding:s,label:o}},"insertLabel"),ee=C((e,t,r)=>{if(r){e.width=r.width,e.height=r.height;return}const i=t.node().getBBox();e.width=i.width,e.height=i.height},"updateNodeBounds"),se=C((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function sr(e){const t=e.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}C(sr,"createPathFromPoints");function ia(e,t,r,i,o,a){const s=[],l=r-e,c=i-t,h=l/a,d=2*Math.PI/h,u=t+c/2;for(let f=0;f<=50;f++){const g=f/50,p=e+g*l,m=u+o*Math.sin(d*(p-e));s.push({x:p,y:m})}return s}C(ia,"generateFullSineWavePoints");function so(e,t,r,i,o,a){const s=[],n=o*Math.PI/180,h=(a*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*h,f=e+r*Math.cos(u),g=t+r*Math.sin(u);s.push({x:-f,y:-g})}return s}C(so,"generateCirclePoints");function Uh(e){const t=Array.from(e.childNodes).filter(l=>l.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=t.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",i);const o=t.find(l=>l.getAttribute("fill")!=="none"),a=t.find(l=>l.getAttribute("stroke")!=="none"),s=C((l,c)=>l?.getAttribute(c)??void 0,"getAttr");if(o){const l={fill:s(o,"fill"),"fill-opacity":s(o,"fill-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}if(a){const l={stroke:s(a,"stroke"),"stroke-width":s(a,"stroke-width")??"1","stroke-opacity":s(a,"stroke-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}const n=document.createElementNS("http://www.w3.org/2000/svg","g");return n.appendChild(r),n}C(Uh,"mergePaths");var zT=C((e,t)=>{var r=e.x,i=e.y,o=t.x-r,a=t.y-i,s=e.width/2,n=e.height/2,l,c;return Math.abs(a)*s>Math.abs(o)*n?(a<0&&(n=-n),l=a===0?0:n*o/a,c=n):(o<0&&(s=-s),l=s,c=o===0?0:s*a/o),{x:r+l,y:i+c}},"intersectRect"),Wo=zT;function nx(e,t){return e.intersect(t)}C(nx,"intersectNode");var HT=nx;function lx(e,t,r,i){var o=e.x,a=e.y,s=o-i.x,n=a-i.y,l=Math.sqrt(t*t*n*n+r*r*s*s),c=Math.abs(t*r*s/l);i.x<o&&(c=-c);var h=Math.abs(t*r*n/l);return i.y<a&&(h=-h),{x:o+c,y:a+h}}C(lx,"intersectEllipse");var cx=lx;function hx(e,t,r){return cx(e,t,t,r)}C(hx,"intersectCircle");var YT=hx;function dx(e,t,r,i){{const o=t.y-e.y,a=e.x-t.x,s=t.x*e.y-e.x*t.y,n=o*r.x+a*r.y+s,l=o*i.x+a*i.y+s,c=1e-6;if(n!==0&&l!==0&&Vh(n,l))return;const h=i.y-r.y,d=r.x-i.x,u=i.x*r.y-r.x*i.y,f=h*e.x+d*e.y+u,g=h*t.x+d*t.y+u;if(Math.abs(f)<c&&Math.abs(g)<c&&Vh(f,g))return;const p=o*d-h*a;if(p===0)return;const m=(a*u-d*s)/p,y=(h*s-o*u)/p;return{x:m,y}}}C(dx,"intersectLine");function Vh(e,t){return e*t>0}C(Vh,"sameSign");var XT=dx;function ux(e,t,r){let i=e.x,o=e.y,a=[],s=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(h){s=Math.min(s,h.x),n=Math.min(n,h.y)}):(s=Math.min(s,t.x),n=Math.min(n,t.y));let l=i-e.width/2-s,c=o-e.height/2-n;for(let h=0;h<t.length;h++){let d=t[h],u=t[h<t.length-1?h+1:0],f=XT(e,r,{x:l+d.x,y:c+d.y},{x:l+u.x,y:c+u.y});f&&a.push(f)}return a.length?(a.length>1&&a.sort(function(h,d){let u=h.x-r.x,f=h.y-r.y,g=Math.sqrt(u*u+f*f),p=d.x-r.x,m=d.y-r.y,y=Math.sqrt(p*p+m*m);return g<y?-1:g===y?0:1}),a[0]):e}C(ux,"intersectPolygon");var jT=ux,Yt={node:HT,circle:YT,ellipse:cx,polygon:jT,rect:Wo},Mi=C((e,t,r,i,o)=>["M",e+o,t,"H",e+r-o,"A",o,o,0,0,1,e+r,t+o,"V",t+i-o,"A",o,o,0,0,1,e+r-o,t+i,"H",e+o,"A",o,o,0,0,1,e,t+i-o,"V",t+o,"A",o,o,0,0,1,e+o,t,"Z"].join(" "),"createRoundedRectPathD"),GT=C(async(e,t,r,i=!1,o=!1)=>{let a=t||"";typeof a=="object"&&(a=a[0]);const s=Ge(),n=Zr(s);return await vi(e,a,{style:r,isTitle:i,useHtmlLabels:n,markdown:!1,isNode:o,width:Number.POSITIVE_INFINITY},s)},"createLabel"),Lo=GT;function fx(e,t){const{labelStyles:r}=Ut(t);t.labelStyle=r;const i=se(t);let o=i;i||(o="anchor");const a=e.insert("g").attr("class",o).attr("id",t.domId||t.id),s=1,{cssStyles:n}=t,l=Zt.svg(a),c=Gt(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(c.roughness=0);const h=l.circle(0,0,s*2,c),d=a.insert(()=>h,":first-child");return d.attr("class","anchor").attr("style",Hr(n)),ee(t,d),t.intersect=function(u){return Lt.info("Circle intersect",t,s,u),Yt.circle(t,s,u)},a}C(fx,"anchor");function Zh(e,t,r,i,o,a,s){const l=(e+r)/2,c=(t+i)/2,h=Math.atan2(i-t,r-e),d=(r-e)/2,u=(i-t)/2,f=d/o,g=u/a,p=Math.sqrt(f**2+g**2);if(p>1)throw new Error("The given radii are too small to create an arc between the points.");const m=Math.sqrt(1-p**2),y=l+m*a*Math.sin(h)*(s?-1:1),x=c-m*o*Math.cos(h)*(s?-1:1),b=Math.atan2((t-x)/a,(e-y)/o);let T=Math.atan2((i-x)/a,(r-y)/o)-b;s&&T<0&&(T+=2*Math.PI),!s&&T>0&&(T-=2*Math.PI);const k=[];for(let _=0;_<20;_++){const L=_/19,v=b+L*T,M=y+o*Math.cos(v),B=x+a*Math.sin(v);k.push({x:M,y:B})}return k}C(Zh,"generateArcPoints");function gx(e,t,r){const[i,o]=[t,r].sort((a,s)=>s-a);return o*(1-Math.sqrt(1-(e/i/2)**2))}C(gx,"calculateArcSagitta");async function px(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?16:o,s=t.look==="neo"?12:o,n=C(v=>v+s,"calcTotalHeight"),l=C(v=>{const M=v/2;return[M/(2.5+v/50),M]},"calcEllipseRadius"),{shapeSvg:c,bbox:h}=await he(e,t,se(t)),d=n(t?.height?t?.height:h.height),[u,f]=l(d),g=gx(d,u,f),m=(t?.width?t?.width:h.width)+a*2+g-g,y=d,{cssStyles:x}=t,b=[{x:m/2,y:-y/2},{x:-m/2,y:-y/2},...Zh(-m/2,-y/2,-m/2,y/2,u,f,!1),{x:m/2,y:y/2},...Zh(m/2,y/2,m/2,-y/2,u,f,!0)],S=Zt.svg(c),T=Gt(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const k=sr(b),_=S.path(k,T),L=c.insert(()=>_,":first-child");return L.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",i),L.attr("transform",`translate(${u/2}, 0)`),ee(t,L),t.intersect=function(v){return Yt.polygon(t,b,v)},c}C(px,"bowTieRect");async function mx(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=Ut(t);t.labelStyle=i;const{shapeSvg:a,bbox:s,label:n}=await he(e,t,se(t)),l=r?.nodeBorder??r?.lineColor??"currentColor",c=t.padding??12,h=Math.max(s.width+c*2,t.width??0,80),d=Math.max(Math.min(h*.08,12),5),u=Math.max(s.height+c*2+d,t.height??0),f=-u/2+d,g=u/2,p=h*.72,m=[`M${-h/2},${f}`,`L${-p/2},${g}`,`A${p/2},${d} 0 0 0 ${p/2},${g}`,`L${h/2},${f}`,`A${h/2},${d} 0 0 0 ${-h/2},${f}`,"Z"].join(" "),{cssStyles:y}=t,x=a.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){const L=Zt.svg(a).path(m,Gt(t,{}));x.node()?.appendChild(L),y&&x.attr("style",y)}else x.append("path").attr("d",m).attr("style",o);x.append("ellipse").attr("cx",0).attr("cy",f).attr("rx",h/2).attr("ry",d).attr("style",`fill:none;stroke:${l};stroke-width:1px`),ee(t,x);const b=f+(g-f)/2;n.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${b-s.height/2-(s.y-(s.top??0))})`);const S=12,T=C((_,L,v)=>Array.from({length:S+1},(M,B)=>{const E=Math.PI-B*Math.PI/S;return{x:_*Math.cos(E),y:L+v*d*Math.sin(E)}}),"arc"),k=[...T(h/2,f,-1),...T(p/2,g,1).reverse()];return t.intersect=function(_){return Yt.polygon(t,k,_)},a}C(mx,"bucket");var kg=20,Sg=8,UT=80,VT=8;function yx(e){const{themeVariables:t}=Ge(),r=t.clusterBkg,i=t.clusterBorder;switch(e){case"flow":return{rx:10,fill:"none",stroke:t.flowContainerStroke||t.secondaryBorderColor,strokeWidth:.75,cssClass:"flow-collapsed"};default:return{rx:VT,fill:r,stroke:i,cssClass:"collapsed-group"}}}C(yx,"getCollapsedStyle");async function xx(e,t){const r=yx(t.metadata?.containerType),{fill:i,stroke:o}=r,{nodeStyles:a}=Ut(t),{shapeSvg:s,bbox:n}=await he(e,t,se(t)),{theme:l,themeVariables:c}=Ge();Oi(s,t.colorIndex,l,c.borderColorArray);const h=t.padding??8,d=n.height,u=Math.max(n.width+h*2,UT,t?.width??0),f=Math.max(d+Sg+kg+h*2,t?.height??0),g=-u/2,p=-f/2,m=-28/2,y=s.select(".label");y&&(t.useHtmlLabels??Zr(Ge())?y.attr("transform",`translate(${-n.width/2}, ${-n.height/2+m})`):y.attr("transform",`translate(0, ${-n.height/2+m})`));let x;if(t.look==="handDrawn"){const _=Zt.svg(s),L=Gt(t,{fill:i,stroke:o,...r.strokeWidth===void 0?{}:{strokeWidth:r.strokeWidth},...i==="none"?{fillWeight:0}:{fillStyle:"solid"}}),v=_.path(Mi(g,p,u,f,r.rx),L);x=s.insert(()=>v,":first-child"),x.attr("class","basic label-container "+r.cssClass).attr("style",Hr(t.cssStyles))}else x=s.insert("rect",":first-child"),x.attr("class","basic label-container "+r.cssClass).attr("style",a).attr("rx",r.rx).attr("ry",r.rx).attr("x",g).attr("y",p).attr("width",u).attr("height",f).attr("fill",i).attr("stroke",o),r.strokeWidth!==void 0&&x.attr("stroke-width",r.strokeWidth+"px");const b=p+h+d+Sg;s.append("line").attr("class","collapsed-separator").attr("x1",g+8).attr("y1",b).attr("x2",g+u-8).attr("y2",b).attr("stroke",o).attr("stroke-dasharray","3, 3");const S=b+kg/2,T=2.5,k=10;for(let _=-1;_<=1;_++)s.append("circle").attr("class","collapsed-indicator").attr("cx",_*k).attr("cy",S).attr("r",T).attr("fill",o);return ee(t,x),t.calcIntersect=function(_,L){return Yt.rect(_,L)},t.intersect=function(_){return Yt.rect(t,_)},s}C(xx,"collapsedGroup");function yo(e,t,r,i){return e.insert("polygon",":first-child").attr("points",i.map(function(o){return o.x+","+o.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}C(yo,"insertPolygonShape");var ZT=["right","left","up","down"],mu="point",KT=C(e=>{const t=new Set;for(const r of e)switch(r){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(r);break}return t},"expandAndDeduplicateDirections"),QT=C(e=>ZT.filter(t=>e.has(t)).join("|")||mu,"getDirectionKey"),vg={"right|left|up|down":C(({height:e,midpoint:t,padding:r,width:i})=>[{x:0,y:0},{x:t,y:0},{x:i/2,y:2*r},{x:i-t,y:0},{x:i,y:0},{x:i,y:-e/3},{x:i+2*r,y:-e/2},{x:i,y:-2*e/3},{x:i,y:-e},{x:i-t,y:-e},{x:i/2,y:-e-2*r},{x:t,y:-e},{x:0,y:-e},{x:0,y:-2*e/3},{x:-2*r,y:-e/2},{x:0,y:-e/3}],"right|left|up|down"),"right|left|up":C(({height:e,midpoint:t,width:r})=>[{x:t,y:0},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:t,y:-e},{x:0,y:-e/2}],"right|left|up"),"right|left|down":C(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:t,y:-e},{x:r-t,y:-e},{x:r,y:0}],"right|left|down"),"right|up|down":C(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:r,y:-t},{x:r,y:-e+t},{x:0,y:-e}],"right|up|down"),"left|up|down":C(({height:e,midpoint:t,width:r})=>[{x:r,y:0},{x:0,y:-t},{x:0,y:-e+t},{x:r,y:-e}],"left|up|down"),"right|left":C(({height:e,midpoint:t,padding:r,width:i})=>[{x:t,y:0},{x:t,y:-r},{x:i-t,y:-r},{x:i-t,y:0},{x:i,y:-e/2},{x:i-t,y:-e},{x:i-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e},{x:0,y:-e/2}],"right|left"),"up|down":C(({height:e,midpoint:t,padding:r,width:i})=>[{x:i/2,y:0},{x:0,y:-r},{x:t,y:-r},{x:t,y:-e+r},{x:0,y:-e+r},{x:i/2,y:-e},{x:i,y:-e+r},{x:i-t,y:-e+r},{x:i-t,y:-r},{x:i,y:-r}],"up|down"),"right|up":C(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:r,y:-t},{x:0,y:-e}],"right|up"),"right|down":C(({height:e,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-e}],"right|down"),"left|up":C(({height:e,midpoint:t,width:r})=>[{x:r,y:0},{x:0,y:-t},{x:r,y:-e}],"left|up"),"left|down":C(({height:e,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-e}],"left|down"),right:C(({height:e,midpoint:t,padding:r,width:i})=>[{x:t,y:-r},{x:t,y:-r},{x:i-t,y:-r},{x:i-t,y:0},{x:i,y:-e/2},{x:i-t,y:-e},{x:i-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e+r}],"right"),left:C(({height:e,midpoint:t,padding:r,width:i})=>[{x:t,y:0},{x:t,y:-r},{x:i-t,y:-r},{x:i-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e},{x:0,y:-e/2}],"left"),up:C(({height:e,midpoint:t,padding:r,width:i})=>[{x:t,y:-r},{x:t,y:-e+r},{x:0,y:-e+r},{x:i/2,y:-e},{x:i,y:-e+r},{x:i-t,y:-e+r},{x:i-t,y:-r}],"up"),down:C(({height:e,midpoint:t,padding:r,width:i})=>[{x:i/2,y:0},{x:0,y:-r},{x:t,y:-r},{x:t,y:-e+r},{x:i-t,y:-e+r},{x:i-t,y:-r},{x:i,y:-r}],"down"),[mu]:()=>[{x:0,y:0}]},JT=C((e,t,r,i)=>{const o=KT(e),a=(r.padding??0)/2,s=t.height+4*a,n=s/2,l=i??t.width+2*n+2*a,c=QT(o);return(vg[c]??vg[mu])({height:s,midpoint:n,padding:a,width:l})},"getArrowPoints");async function bx(e,t){const r=t,{shapeSvg:i,bbox:o}=await he(e,r,se(r)),a=r.padding??0,s=o.height+2*a,n=s/2,l=o.width+2*n+a,c=r.width??0,d=r.positioned&&(r.widthInColumns??1)>1&&c>l?c:l,u=JT(r.directions??[],o,r,d),f=yo(i,d,s,u);return f.attr("style",r.style??null),ee(r,f),r.intersect=function(g){return Yt.polygon(r,u,g)},i}C(bx,"block_arrow");async function Cx(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=Ut(t);t.labelStyle=i;const{shapeSvg:a,bbox:s,label:n}=await he(e,t,se(t)),l=r?.nodeBorder??r?.lineColor??"currentColor",c=t.padding??12,h=18,d=12,u=Math.max(s.width+c*2,t.width??0,90),f=Math.max(s.height+c*2+h,t.height??0),g=-f/2,{cssStyles:p}=t,m=a.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){const b=Zt.svg(a).path(Mi(-u/2,g,u,f,d),Gt(t,{}));m.node()?.appendChild(b),p&&m.attr("style",p)}else m.append("rect").attr("x",-u/2).attr("y",g).attr("width",u).attr("height",f).attr("rx",d).attr("ry",d).attr("style",o);m.append("line").attr("x1",-u/2).attr("y1",g+h).attr("x2",u/2).attr("y2",g+h).attr("style",`stroke:${l};stroke-width:1px`);for(let x=0;x<3;x++)m.append("circle").attr("cx",-u/2+12+x*9).attr("cy",g+h/2).attr("r",2.5).attr("style",`fill:${l};stroke:none`);m.append("rect").attr("class","browser-address-bar").attr("x",-u/2+44).attr("y",g+4).attr("width",Math.max(u-56,10)).attr("height",h-8).attr("rx",3).attr("ry",3).attr("style",`fill:none;stroke:${l};stroke-width:1px;opacity:0.6`),ee(t,m);const y=g+h+(f-h)/2;return n.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${y-s.height/2-(s.y-(s.top??0))})`),t.intersect=function(x){return Yt.rect(t,x)},a}C(Cx,"browser");var Yn=12;async function wx(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?28:o,s=t.look==="neo"?24:o,{shapeSvg:n,bbox:l}=await he(e,t,se(t)),c=(t?.width??l.width)+(t.look==="neo"?a*2:a+Yn),h=(t?.height??l.height)+(t.look==="neo"?s*2:s),d=0,u=c,f=-h,g=0,p=[{x:d+Yn,y:f},{x:u,y:f},{x:u,y:g},{x:d,y:g},{x:d,y:f+Yn},{x:d+Yn,y:f}];let m;const{cssStyles:y}=t;if(t.look==="handDrawn"){const x=Zt.svg(n),b=Gt(t,{}),S=sr(p),T=x.path(S,b);m=n.insert(()=>T,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),y&&m.attr("style",y)}else m=yo(n,c,h,p);return i&&m.attr("style",i),ee(t,m),t.intersect=function(x){return Yt.polygon(t,p,x)},n}C(wx,"card");function kx(e,t){const{nodeStyles:r}=Ut(t);t.label="";const i=e.insert("g").attr("class",se(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,a=Math.max(28,t.width??0),s=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],n=Zt.svg(i),l=Gt(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=sr(s),h=n.path(c,l),d=i.insert(()=>h,":first-child");return o&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",o),r&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(u){return Yt.polygon(t,s,u)},i}C(kx,"choice");async function yu(e,t,r){const{labelStyles:i,nodeStyles:o}=Ut(t);t.labelStyle=i;const{shapeSvg:a,bbox:s,halfPadding:n}=await he(e,t,se(t),{ignoreMinWidth:!0}),l=16,c=r?.padding??n,h=Math.sqrt(s.width**2+s.height**2)/2,d=t.look==="neo"?h+l:h+c;let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const g=Zt.svg(a),p=Gt(t,{}),m=g.circle(0,0,d*2,p);u=a.insert(()=>m,":first-child"),u.attr("class","basic label-container").attr("style",Hr(f))}else u=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",o).attr("r",d).attr("cx",0).attr("cy",0);return ee(t,u),t.calcIntersect=function(g,p){const m=g.width/2;return Yt.circle(g,m,p)},t.intersect=function(g){return Lt.info("Circle intersect",t,d,g),Yt.circle(t,d,g)},a}C(yu,"circle");async function Sx(e,t){const r=t,i=["node",r.cssClasses,r.class].filter(Boolean).join(" "),{shapeSvg:o,bbox:a,halfPadding:s}=await he(e,r,i),n=o.insert("rect",":first-child"),l=r.padding??0,c=r.positioned?r.width??0:a.width+l,h=r.positioned?r.height??0:a.height+l,d=r.positioned?-c/2:-a.width/2-s,u=r.positioned?-h/2:-a.height/2-s;return n.attr("class","basic cluster composite label-container").attr("style",r.style??null).attr("rx",r.rx??null).attr("ry",r.ry??null).attr("x",d).attr("y",u).attr("width",c).attr("height",h),ee(r,n),r.intersect=function(f){return Yt.rect(r,f)},o}C(Sx,"composite");async function vx(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=Ut(t);t.labelStyle=i;const{shapeSvg:a,bbox:s,label:n}=await he(e,t,se(t)),l=r?.nodeBorder??r?.lineColor??"currentColor",c=t.padding??12,h=20,d=12,u=Math.max(s.width+c*2,t.width??0,90),f=Math.max(s.height+c*2+h,t.height??0),g=-f/2,{cssStyles:p}=t,m=a.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){const b=Zt.svg(a).path(Mi(-u/2,g,u,f,d),Gt(t,{}));m.node()?.appendChild(b),p&&m.attr("style",p)}else m.append("rect").attr("x",-u/2).attr("y",g).attr("width",u).attr("height",f).attr("rx",d).attr("ry",d).attr("style",o);m.append("text").attr("x",-u/2+12).attr("y",g+16).attr("class","console-glyph").attr("style",`font-family:monospace;font-weight:bold;font-size:14px;fill:${l}`).text(">_"),ee(t,m);const y=g+h+(f-h)/2;return n.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${y-s.height/2-(s.y-(s.top??0))})`),t.intersect=function(x){return Yt.rect(t,x)},a}C(vx,"consoleWindow");function Mx(e){const t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=e*2,o={x:i/2*t,y:i/2*r},a={x:-(i/2)*t,y:i/2*r},s={x:-(i/2)*t,y:-(i/2)*r},n={x:i/2*t,y:-(i/2)*r};return`M ${a.x},${a.y} L ${n.x},${n.y}
231
+ `),a):Ei(t.label,a),h=t.isNode?"nodeLabel":"edgeLabel",d=l.append("span");d.html(c),Hh(d,t.labelStyle),d.attr("class",`${h} ${i}`),Hh(l,t.labelStyle),l.style("display","table-cell"),l.style("white-space","nowrap"),l.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(l.style("max-width",r+"px"),l.style("text-align","center")),l.attr("xmlns","http://www.w3.org/1999/xhtml"),o&&l.attr("class","labelBkg");const u=await La.measure(()=>l.node().getBoundingClientRect());return u.width===r?(l.style("display","table"),l.style("white-space","break-spaces"),l.style("width",r+"px")):u.width<s&&(l.style("display","table"),l.style("width",s+"px"),l.style("text-align","center")),n.node()}C(Zy,"addHtmlSpan");function oc(e,t,r,i=!1){const o=e.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",t*r-.1+"em").attr("dy",r+"em");return i&&o.attr("text-anchor","middle"),o}C(oc,"createTspan");function Ky(e,t,r){const i=e.append("text"),o=oc(i,1,t);ac(o,r);const a=o.node().getComputedTextLength();return i.remove(),a}C(Ky,"computeWidthOfText");function mT(e,t,r){const i=e.append("text"),o=oc(i,1,t);ac(o,[{content:r,type:"normal"}]);const a=o.node()?.getBoundingClientRect();return a&&i.remove(),a}C(mT,"computeDimensionOfText");function Qy(e,t,r,i=!1,o=!1){const s=t.append("g"),n=s.insert("rect").attr("class","background").attr("style","stroke: none"),l=s.append("text").attr("y","-10.1");o&&l.attr("text-anchor","middle");let c=0;for(const h of r){const d=C(f=>Ky(s,1.1,f)<=e,"checkWidth"),u=d(h)?[h]:Vy(h,d);for(const f of u){const g=oc(l,c,1.1,o);ac(g,f),c++}}if(i){const h=l.node().getBBox(),d=2;return n.attr("x",h.x-d).attr("y",h.y-d).attr("width",h.width+2*d).attr("height",h.height+2*d),s.node()}else return l.node()}C(Qy,"createFormattedText");function Yh(e){const t=/&(amp|lt|gt);/g;return e.replace(t,(r,i)=>{switch(i){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}C(Yh,"decodeHTMLEntities");function ac(e,t){e.text(""),t.forEach((r,i)=>{const o=e.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");i===0?o.text(Yh(r.content)):o.text(" "+Yh(r.content))})}C(ac,"updateTextContentAndStyles");async function Jy(e,t={}){const r=[];e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(o,a,s)=>(r.push((async()=>{const n=`${a}:${s}`;return await xm(n)?await $a(n,void 0,{class:"label-icon"}):`<i class='${Ei(o,t).replace(":"," ")}'></i>`})()),o));const i=await Promise.all(r);return e.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>i.shift()??"")}C(Jy,"replaceIconSubstring");var vi=C(async(e,t="",{style:r="",isTitle:i=!1,classes:o="",useHtmlLabels:a=!0,markdown:s=!0,isNode:n=!0,width:l=200,minWidth:c=0,addSvgBackground:h=!1}={},d)=>{if(Lt.debug("XYZ createText",t,r,i,o,a,n,"addSvgBackground: ",h),a){const u=s?Xy(t,d):Yy(t),f=await Jy(ea(u),d),g=t.replace(/\\\\/g,"\\"),p={isNode:n,label:un(t)?g:f,labelStyle:r.replace("fill:","color:")};return await Zy(e,p,l,o,h,d,c)}else{const u=ea(t.replace(/<br\s*\/?>/g,"<br/>")),f=s?Hy(u.replace("<br>","<br/>"),d):zy(u),g=Qy(l,e,f,t?h:!1,!n);if(n){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));const p=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Ye(g).attr("style",p)}else{const p=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");Ye(g).select("rect").attr("style",p.replace(/background:/g,"fill:"));const m=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");Ye(g).select("text").attr("style",m)}return i?Ye(g).selectAll("tspan.text-outer-tspan").classed("title-row",!0):Ye(g).selectAll("tspan.text-outer-tspan").classed("row",!0),g}},"createText"),yT=new Set(["redux-color","redux-dark-color"]),xT=12,bT=64,du=C(e=>Array.isArray(e)&&e.length>0,"hasPalette"),CT=C((e,t)=>e!=null&&yT.has(e)&&du(t),"isColorTheme"),wT=/^[\w-]+$/,CP=C(e=>{const t=typeof e=="string"||typeof e=="number"?String(e):"";return wT.test(t)?t:"classic"},"safeLook"),tx=C(e=>du(e)?e.length:0,"paletteSlotCount"),wP=C((e,t)=>du(t)?tx(t):typeof e=="number"&&Number.isInteger(e)&&e>0&&e<=bT?e:xT,"colorSlotCount"),Oi=C((e,t,r,i)=>{if(t===void 0||!CT(r,i))return;const o=t%tx(i);e.attr("data-color-id",`color-${o}`)},"stampColorSlot");function Jc(e,t,r){if(e&&e.length){const[i,o]=t,a=Math.PI/180*r,s=Math.cos(a),n=Math.sin(a);for(const l of e){const[c,h]=l;l[0]=(c-i)*s-(h-o)*n+i,l[1]=(c-i)*n+(h-o)*s+o}}}function kT(e,t){return e[0]===t[0]&&e[1]===t[1]}function ST(e,t,r,i=1){const o=r,a=Math.max(t,.1),s=e[0]&&e[0][0]&&typeof e[0][0]=="number"?[e]:e,n=[0,0];if(o)for(const c of s)Jc(c,n,o);const l=(function(c,h,d){const u=[];for(const x of c){const b=[...x];kT(b[0],b[b.length-1])||b.push([b[0][0],b[0][1]]),b.length>2&&u.push(b)}const f=[];h=Math.max(h,.1);const g=[];for(const x of u)for(let b=0;b<x.length-1;b++){const S=x[b],T=x[b+1];if(S[1]!==T[1]){const k=Math.min(S[1],T[1]);g.push({ymin:k,ymax:Math.max(S[1],T[1]),x:k===S[1]?S[0]:T[0],islope:(T[0]-S[0])/(T[1]-S[1])})}}if(g.sort(((x,b)=>x.ymin<b.ymin?-1:x.ymin>b.ymin?1:x.x<b.x?-1:x.x>b.x?1:x.ymax===b.ymax?0:(x.ymax-b.ymax)/Math.abs(x.ymax-b.ymax))),!g.length)return f;let p=[],m=g[0].ymin,y=0;for(;p.length||g.length;){if(g.length){let x=-1;for(let b=0;b<g.length&&!(g[b].ymin>m);b++)x=b;g.splice(0,x+1).forEach((b=>{p.push({s:m,edge:b})}))}if(p=p.filter((x=>!(x.edge.ymax<=m))),p.sort(((x,b)=>x.edge.x===b.edge.x?0:(x.edge.x-b.edge.x)/Math.abs(x.edge.x-b.edge.x))),(d!==1||y%h==0)&&p.length>1)for(let x=0;x<p.length;x+=2){const b=x+1;if(b>=p.length)break;const S=p[x].edge,T=p[b].edge;f.push([[Math.round(S.x),m],[Math.round(T.x),m]])}m+=d,p.forEach((x=>{x.edge.x=x.edge.x+d*x.edge.islope})),y++}return f})(s,a,i);if(o){for(const c of s)Jc(c,n,-o);(function(c,h,d){const u=[];c.forEach((f=>u.push(...f))),Jc(u,h,d)})(l,n,-o)}return l}function Tn(e,t){var r;const i=t.hachureAngle+90;let o=t.hachureGap;o<0&&(o=4*t.strokeWidth),o=Math.round(Math.max(o,.1));let a=1;return t.roughness>=1&&(((r=t.randomizer)===null||r===void 0?void 0:r.next())||Math.random())>.7&&(a=o),ST(e,o,i,a||1)}class uu{constructor(t){this.helper=t}fillPolygons(t,r){return this._fillPolygons(t,r)}_fillPolygons(t,r){const i=Tn(t,r);return{type:"fillSketch",ops:this.renderLines(i,r)}}renderLines(t,r){const i=[];for(const o of t)i.push(...this.helper.doubleLineOps(o[0][0],o[0][1],o[1][0],o[1][1],r));return i}}function sc(e){const t=e[0],r=e[1];return Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2))}class vT extends uu{fillPolygons(t,r){let i=r.hachureGap;i<0&&(i=4*r.strokeWidth),i=Math.max(i,.1);const o=Tn(t,Object.assign({},r,{hachureGap:i})),a=Math.PI/180*r.hachureAngle,s=[],n=.5*i*Math.cos(a),l=.5*i*Math.sin(a);for(const[c,h]of o)sc([c,h])&&s.push([[c[0]-n,c[1]+l],[...h]],[[c[0]+n,c[1]-l],[...h]]);return{type:"fillSketch",ops:this.renderLines(s,r)}}}class MT extends uu{fillPolygons(t,r){const i=this._fillPolygons(t,r),o=Object.assign({},r,{hachureAngle:r.hachureAngle+90}),a=this._fillPolygons(t,o);return i.ops=i.ops.concat(a.ops),i}}class TT{constructor(t){this.helper=t}fillPolygons(t,r){const i=Tn(t,r=Object.assign({},r,{hachureAngle:0}));return this.dotsOnLines(i,r)}dotsOnLines(t,r){const i=[];let o=r.hachureGap;o<0&&(o=4*r.strokeWidth),o=Math.max(o,.1);let a=r.fillWeight;a<0&&(a=r.strokeWidth/2);const s=o/4;for(const n of t){const l=sc(n),c=l/o,h=Math.ceil(c)-1,d=l-h*o,u=(n[0][0]+n[1][0])/2-o/4,f=Math.min(n[0][1],n[1][1]);for(let g=0;g<h;g++){const p=f+d+g*o,m=u-s+2*Math.random()*s,y=p-s+2*Math.random()*s,x=this.helper.ellipse(m,y,a,a,r);i.push(...x.ops)}}return{type:"fillSketch",ops:i}}}class BT{constructor(t){this.helper=t}fillPolygons(t,r){const i=Tn(t,r);return{type:"fillSketch",ops:this.dashedLine(i,r)}}dashedLine(t,r){const i=r.dashOffset<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashOffset,o=r.dashGap<0?r.hachureGap<0?4*r.strokeWidth:r.hachureGap:r.dashGap,a=[];return t.forEach((s=>{const n=sc(s),l=Math.floor(n/(i+o)),c=(n+o-l*(i+o))/2;let h=s[0],d=s[1];h[0]>d[0]&&(h=s[1],d=s[0]);const u=Math.atan((d[1]-h[1])/(d[0]-h[0]));for(let f=0;f<l;f++){const g=f*(i+o),p=g+i,m=[h[0]+g*Math.cos(u)+c*Math.cos(u),h[1]+g*Math.sin(u)+c*Math.sin(u)],y=[h[0]+p*Math.cos(u)+c*Math.cos(u),h[1]+p*Math.sin(u)+c*Math.sin(u)];a.push(...this.helper.doubleLineOps(m[0],m[1],y[0],y[1],r))}})),a}}class _T{constructor(t){this.helper=t}fillPolygons(t,r){const i=r.hachureGap<0?4*r.strokeWidth:r.hachureGap,o=r.zigzagOffset<0?i:r.zigzagOffset,a=Tn(t,r=Object.assign({},r,{hachureGap:i+o}));return{type:"fillSketch",ops:this.zigzagLines(a,o,r)}}zigzagLines(t,r,i){const o=[];return t.forEach((a=>{const s=sc(a),n=Math.round(s/(2*r));let l=a[0],c=a[1];l[0]>c[0]&&(l=a[1],c=a[0]);const h=Math.atan((c[1]-l[1])/(c[0]-l[0]));for(let d=0;d<n;d++){const u=2*d*r,f=2*(d+1)*r,g=Math.sqrt(2*Math.pow(r,2)),p=[l[0]+u*Math.cos(h),l[1]+u*Math.sin(h)],m=[l[0]+f*Math.cos(h),l[1]+f*Math.sin(h)],y=[p[0]+g*Math.cos(h+Math.PI/4),p[1]+g*Math.sin(h+Math.PI/4)];o.push(...this.helper.doubleLineOps(p[0],p[1],y[0],y[1],i),...this.helper.doubleLineOps(y[0],y[1],m[0],m[1],i))}})),o}}const xi={};class LT{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const AT=0,th=1,ug=2,Wn={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function eh(e,t){return e.type===t}function fu(e){const t=[],r=(function(s){const n=new Array;for(;s!=="";)if(s.match(/^([ \t\r\n,]+)/))s=s.substr(RegExp.$1.length);else if(s.match(/^([aAcChHlLmMqQsStTvVzZ])/))n[n.length]={type:AT,text:RegExp.$1},s=s.substr(RegExp.$1.length);else{if(!s.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];n[n.length]={type:th,text:`${parseFloat(RegExp.$1)}`},s=s.substr(RegExp.$1.length)}return n[n.length]={type:ug,text:""},n})(e);let i="BOD",o=0,a=r[o];for(;!eh(a,ug);){let s=0;const n=[];if(i==="BOD"){if(a.text!=="M"&&a.text!=="m")return fu("M0,0"+e);o++,s=Wn[a.text],i=a.text}else eh(a,th)?s=Wn[i]:(o++,s=Wn[a.text],i=a.text);if(!(o+s<r.length))throw new Error("Path data ended short");for(let l=o;l<o+s;l++){const c=r[l];if(!eh(c,th))throw new Error("Param not a number: "+i+","+c.text);n[n.length]=+c.text}if(typeof Wn[i]!="number")throw new Error("Bad segment: "+i);{const l={key:i,data:n};t.push(l),o+=s,a=r[o],i==="M"&&(i="L"),i==="m"&&(i="l")}}return t}function ex(e){let t=0,r=0,i=0,o=0;const a=[];for(const{key:s,data:n}of e)switch(s){case"M":a.push({key:"M",data:[...n]}),[t,r]=n,[i,o]=n;break;case"m":t+=n[0],r+=n[1],a.push({key:"M",data:[t,r]}),i=t,o=r;break;case"L":a.push({key:"L",data:[...n]}),[t,r]=n;break;case"l":t+=n[0],r+=n[1],a.push({key:"L",data:[t,r]});break;case"C":a.push({key:"C",data:[...n]}),t=n[4],r=n[5];break;case"c":{const l=n.map(((c,h)=>h%2?c+r:c+t));a.push({key:"C",data:l}),t=l[4],r=l[5];break}case"Q":a.push({key:"Q",data:[...n]}),t=n[2],r=n[3];break;case"q":{const l=n.map(((c,h)=>h%2?c+r:c+t));a.push({key:"Q",data:l}),t=l[2],r=l[3];break}case"A":a.push({key:"A",data:[...n]}),t=n[5],r=n[6];break;case"a":t+=n[5],r+=n[6],a.push({key:"A",data:[n[0],n[1],n[2],n[3],n[4],t,r]});break;case"H":a.push({key:"H",data:[...n]}),t=n[0];break;case"h":t+=n[0],a.push({key:"H",data:[t]});break;case"V":a.push({key:"V",data:[...n]}),r=n[0];break;case"v":r+=n[0],a.push({key:"V",data:[r]});break;case"S":a.push({key:"S",data:[...n]}),t=n[2],r=n[3];break;case"s":{const l=n.map(((c,h)=>h%2?c+r:c+t));a.push({key:"S",data:l}),t=l[2],r=l[3];break}case"T":a.push({key:"T",data:[...n]}),t=n[0],r=n[1];break;case"t":t+=n[0],r+=n[1],a.push({key:"T",data:[t,r]});break;case"Z":case"z":a.push({key:"Z",data:[]}),t=i,r=o}return a}function rx(e){const t=[];let r="",i=0,o=0,a=0,s=0,n=0,l=0;for(const{key:c,data:h}of e){switch(c){case"M":t.push({key:"M",data:[...h]}),[i,o]=h,[a,s]=h;break;case"C":t.push({key:"C",data:[...h]}),i=h[4],o=h[5],n=h[2],l=h[3];break;case"L":t.push({key:"L",data:[...h]}),[i,o]=h;break;case"H":i=h[0],t.push({key:"L",data:[i,o]});break;case"V":o=h[0],t.push({key:"L",data:[i,o]});break;case"S":{let d=0,u=0;r==="C"||r==="S"?(d=i+(i-n),u=o+(o-l)):(d=i,u=o),t.push({key:"C",data:[d,u,...h]}),n=h[0],l=h[1],i=h[2],o=h[3];break}case"T":{const[d,u]=h;let f=0,g=0;r==="Q"||r==="T"?(f=i+(i-n),g=o+(o-l)):(f=i,g=o);const p=i+2*(f-i)/3,m=o+2*(g-o)/3,y=d+2*(f-d)/3,x=u+2*(g-u)/3;t.push({key:"C",data:[p,m,y,x,d,u]}),n=f,l=g,i=d,o=u;break}case"Q":{const[d,u,f,g]=h,p=i+2*(d-i)/3,m=o+2*(u-o)/3,y=f+2*(d-f)/3,x=g+2*(u-g)/3;t.push({key:"C",data:[p,m,y,x,f,g]}),n=d,l=u,i=f,o=g;break}case"A":{const d=Math.abs(h[0]),u=Math.abs(h[1]),f=h[2],g=h[3],p=h[4],m=h[5],y=h[6];d===0||u===0?(t.push({key:"C",data:[i,o,m,y,m,y]}),i=m,o=y):(i!==m||o!==y)&&(ix(i,o,m,y,d,u,f,g,p).forEach((function(x){t.push({key:"C",data:x})})),i=m,o=y);break}case"Z":t.push({key:"Z",data:[]}),i=a,o=s}r=c}return t}function Rs(e,t,r){return[e*Math.cos(r)-t*Math.sin(r),e*Math.sin(r)+t*Math.cos(r)]}function ix(e,t,r,i,o,a,s,n,l,c){const h=(d=s,Math.PI*d/180);var d;let u=[],f=0,g=0,p=0,m=0;if(c)[f,g,p,m]=c;else{[e,t]=Rs(e,t,-h),[r,i]=Rs(r,i,-h);const O=(e-r)/2,$=(t-i)/2;let I=O*O/(o*o)+$*$/(a*a);I>1&&(I=Math.sqrt(I),o*=I,a*=I);const F=o*o,R=a*a,q=F*R-F*$*$-R*O*O,D=F*$*$+R*O*O,P=(n===l?-1:1)*Math.sqrt(Math.abs(q/D));p=P*o*$/a+(e+r)/2,m=P*-a*O/o+(t+i)/2,f=Math.asin(parseFloat(((t-m)/a).toFixed(9))),g=Math.asin(parseFloat(((i-m)/a).toFixed(9))),e<p&&(f=Math.PI-f),r<p&&(g=Math.PI-g),f<0&&(f=2*Math.PI+f),g<0&&(g=2*Math.PI+g),l&&f>g&&(f-=2*Math.PI),!l&&g>f&&(g-=2*Math.PI)}let y=g-f;if(Math.abs(y)>120*Math.PI/180){const O=g,$=r,I=i;g=l&&g>f?f+120*Math.PI/180*1:f+120*Math.PI/180*-1,u=ix(r=p+o*Math.cos(g),i=m+a*Math.sin(g),$,I,o,a,s,0,l,[g,O,p,m])}y=g-f;const x=Math.cos(f),b=Math.sin(f),S=Math.cos(g),T=Math.sin(g),k=Math.tan(y/4),_=4/3*o*k,L=4/3*a*k,v=[e,t],M=[e+_*b,t-L*x],B=[r+_*T,i-L*S],E=[r,i];if(M[0]=2*v[0]-M[0],M[1]=2*v[1]-M[1],c)return[M,B,E].concat(u);{u=[M,B,E].concat(u);const O=[];for(let $=0;$<u.length;$+=3){const I=Rs(u[$][0],u[$][1],h),F=Rs(u[$+1][0],u[$+1][1],h),R=Rs(u[$+2][0],u[$+2][1],h);O.push([I[0],I[1],F[0],F[1],R[0],R[1]])}return O}}const FT={randOffset:function(e,t){return Re(e,t)},randOffsetWithRange:function(e,t,r){return Dl(e,t,r)},ellipse:function(e,t,r,i,o){const a=ax(r,i,o);return Xh(e,t,o,a).opset},doubleLineOps:function(e,t,r,i,o){return ra(e,t,r,i,o,!0)}};function ox(e,t,r,i,o){return{type:"path",ops:ra(e,t,r,i,o)}}function dl(e,t,r){const i=(e||[]).length;if(i>2){const o=[];for(let a=0;a<i-1;a++)o.push(...ra(e[a][0],e[a][1],e[a+1][0],e[a+1][1],r));return t&&o.push(...ra(e[i-1][0],e[i-1][1],e[0][0],e[0][1],r)),{type:"path",ops:o}}return i===2?ox(e[0][0],e[0][1],e[1][0],e[1][1],r):{type:"path",ops:[]}}function $T(e,t,r,i,o){return(function(a,s){return dl(a,!0,s)})([[e,t],[e+r,t],[e+r,t+i],[e,t+i]],o)}function fg(e,t){if(e.length){const r=typeof e[0][0]=="number"?[e]:e,i=zn(r[0],1*(1+.2*t.roughness),t),o=t.disableMultiStroke?[]:zn(r[0],1.5*(1+.22*t.roughness),mg(t));for(let a=1;a<r.length;a++){const s=r[a];if(s.length){const n=zn(s,1*(1+.2*t.roughness),t),l=t.disableMultiStroke?[]:zn(s,1.5*(1+.22*t.roughness),mg(t));for(const c of n)c.op!=="move"&&i.push(c);for(const c of l)c.op!=="move"&&o.push(c)}}return{type:"path",ops:i.concat(o)}}return{type:"path",ops:[]}}function ax(e,t,r){const i=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(e/2,2)+Math.pow(t/2,2))/2)),o=Math.ceil(Math.max(r.curveStepCount,r.curveStepCount/Math.sqrt(200)*i)),a=2*Math.PI/o;let s=Math.abs(e/2),n=Math.abs(t/2);const l=1-r.curveFitting;return s+=Re(s*l,r),n+=Re(n*l,r),{increment:a,rx:s,ry:n}}function Xh(e,t,r,i){const[o,a]=yg(i.increment,e,t,i.rx,i.ry,1,i.increment*Dl(.1,Dl(.4,1,r),r),r);let s=Rl(o,null,r);if(!r.disableMultiStroke&&r.roughness!==0){const[n]=yg(i.increment,e,t,i.rx,i.ry,1.5,0,r),l=Rl(n,null,r);s=s.concat(l)}return{estimatedPoints:a,opset:{type:"path",ops:s}}}function gg(e,t,r,i,o,a,s,n,l){const c=e,h=t;let d=Math.abs(r/2),u=Math.abs(i/2);d+=Re(.01*d,l),u+=Re(.01*u,l);let f=o,g=a;for(;f<0;)f+=2*Math.PI,g+=2*Math.PI;g-f>2*Math.PI&&(f=0,g=2*Math.PI);const p=2*Math.PI/l.curveStepCount,m=Math.min(p/2,(g-f)/2),y=xg(m,c,h,d,u,f,g,1,l);if(!l.disableMultiStroke){const x=xg(m,c,h,d,u,f,g,1.5,l);y.push(...x)}return s&&(n?y.push(...ra(c,h,c+d*Math.cos(f),h+u*Math.sin(f),l),...ra(c,h,c+d*Math.cos(g),h+u*Math.sin(g),l)):y.push({op:"lineTo",data:[c,h]},{op:"lineTo",data:[c+d*Math.cos(f),h+u*Math.sin(f)]})),{type:"path",ops:y}}function pg(e,t){const r=rx(ex(fu(e))),i=[];let o=[0,0],a=[0,0];for(const{key:s,data:n}of r)switch(s){case"M":a=[n[0],n[1]],o=[n[0],n[1]];break;case"L":i.push(...ra(a[0],a[1],n[0],n[1],t)),a=[n[0],n[1]];break;case"C":{const[l,c,h,d,u,f]=n;i.push(...ET(l,c,h,d,u,f,a,t)),a=[u,f];break}case"Z":i.push(...ra(a[0],a[1],o[0],o[1],t)),a=[o[0],o[1]]}return{type:"path",ops:i}}function rh(e,t){const r=[];for(const i of e)if(i.length){const o=t.maxRandomnessOffset||0,a=i.length;if(a>2){r.push({op:"move",data:[i[0][0]+Re(o,t),i[0][1]+Re(o,t)]});for(let s=1;s<a;s++)r.push({op:"lineTo",data:[i[s][0]+Re(o,t),i[s][1]+Re(o,t)]})}}return{type:"fillPath",ops:r}}function Ra(e,t){return(function(r,i){let o=r.fillStyle||"hachure";if(!xi[o])switch(o){case"zigzag":xi[o]||(xi[o]=new vT(i));break;case"cross-hatch":xi[o]||(xi[o]=new MT(i));break;case"dots":xi[o]||(xi[o]=new TT(i));break;case"dashed":xi[o]||(xi[o]=new BT(i));break;case"zigzag-line":xi[o]||(xi[o]=new _T(i));break;default:o="hachure",xi[o]||(xi[o]=new uu(i))}return xi[o]})(t,FT).fillPolygons(e,t)}function mg(e){const t=Object.assign({},e);return t.randomizer=void 0,e.seed&&(t.seed=e.seed+1),t}function sx(e){return e.randomizer||(e.randomizer=new LT(e.seed||0)),e.randomizer.next()}function Dl(e,t,r,i=1){return r.roughness*i*(sx(r)*(t-e)+e)}function Re(e,t,r=1){return Dl(-e,e,t,r)}function ra(e,t,r,i,o,a=!1){const s=a?o.disableMultiStrokeFill:o.disableMultiStroke,n=jh(e,t,r,i,o,!0,!1);if(s)return n;const l=jh(e,t,r,i,o,!0,!0);return n.concat(l)}function jh(e,t,r,i,o,a,s){const n=Math.pow(e-r,2)+Math.pow(t-i,2),l=Math.sqrt(n);let c=1;c=l<200?1:l>500?.4:-.0016668*l+1.233334;let h=o.maxRandomnessOffset||0;h*h*100>n&&(h=l/10);const d=h/2,u=.2+.2*sx(o);let f=o.bowing*o.maxRandomnessOffset*(i-t)/200,g=o.bowing*o.maxRandomnessOffset*(e-r)/200;f=Re(f,o,c),g=Re(g,o,c);const p=[],m=()=>Re(d,o,c),y=()=>Re(h,o,c),x=o.preserveVertices;return s?p.push({op:"move",data:[e+(x?0:m()),t+(x?0:m())]}):p.push({op:"move",data:[e+(x?0:Re(h,o,c)),t+(x?0:Re(h,o,c))]}),s?p.push({op:"bcurveTo",data:[f+e+(r-e)*u+m(),g+t+(i-t)*u+m(),f+e+2*(r-e)*u+m(),g+t+2*(i-t)*u+m(),r+(x?0:m()),i+(x?0:m())]}):p.push({op:"bcurveTo",data:[f+e+(r-e)*u+y(),g+t+(i-t)*u+y(),f+e+2*(r-e)*u+y(),g+t+2*(i-t)*u+y(),r+(x?0:y()),i+(x?0:y())]}),p}function zn(e,t,r){if(!e.length)return[];const i=[];i.push([e[0][0]+Re(t,r),e[0][1]+Re(t,r)]),i.push([e[0][0]+Re(t,r),e[0][1]+Re(t,r)]);for(let o=1;o<e.length;o++)i.push([e[o][0]+Re(t,r),e[o][1]+Re(t,r)]),o===e.length-1&&i.push([e[o][0]+Re(t,r),e[o][1]+Re(t,r)]);return Rl(i,null,r)}function Rl(e,t,r){const i=e.length,o=[];if(i>3){const a=[],s=1-r.curveTightness;o.push({op:"move",data:[e[1][0],e[1][1]]});for(let n=1;n+2<i;n++){const l=e[n];a[0]=[l[0],l[1]],a[1]=[l[0]+(s*e[n+1][0]-s*e[n-1][0])/6,l[1]+(s*e[n+1][1]-s*e[n-1][1])/6],a[2]=[e[n+1][0]+(s*e[n][0]-s*e[n+2][0])/6,e[n+1][1]+(s*e[n][1]-s*e[n+2][1])/6],a[3]=[e[n+1][0],e[n+1][1]],o.push({op:"bcurveTo",data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}}else i===3?(o.push({op:"move",data:[e[1][0],e[1][1]]}),o.push({op:"bcurveTo",data:[e[1][0],e[1][1],e[2][0],e[2][1],e[2][0],e[2][1]]})):i===2&&o.push(...jh(e[0][0],e[0][1],e[1][0],e[1][1],r,!0,!0));return o}function yg(e,t,r,i,o,a,s,n){const l=[],c=[];if(n.roughness===0){e/=4,c.push([t+i*Math.cos(-e),r+o*Math.sin(-e)]);for(let h=0;h<=2*Math.PI;h+=e){const d=[t+i*Math.cos(h),r+o*Math.sin(h)];l.push(d),c.push(d)}c.push([t+i*Math.cos(0),r+o*Math.sin(0)]),c.push([t+i*Math.cos(e),r+o*Math.sin(e)])}else{const h=Re(.5,n)-Math.PI/2;c.push([Re(a,n)+t+.9*i*Math.cos(h-e),Re(a,n)+r+.9*o*Math.sin(h-e)]);const d=2*Math.PI+h-.01;for(let u=h;u<d;u+=e){const f=[Re(a,n)+t+i*Math.cos(u),Re(a,n)+r+o*Math.sin(u)];l.push(f),c.push(f)}c.push([Re(a,n)+t+i*Math.cos(h+2*Math.PI+.5*s),Re(a,n)+r+o*Math.sin(h+2*Math.PI+.5*s)]),c.push([Re(a,n)+t+.98*i*Math.cos(h+s),Re(a,n)+r+.98*o*Math.sin(h+s)]),c.push([Re(a,n)+t+.9*i*Math.cos(h+.5*s),Re(a,n)+r+.9*o*Math.sin(h+.5*s)])}return[c,l]}function xg(e,t,r,i,o,a,s,n,l){const c=a+Re(.1,l),h=[];h.push([Re(n,l)+t+.9*i*Math.cos(c-e),Re(n,l)+r+.9*o*Math.sin(c-e)]);for(let d=c;d<=s;d+=e)h.push([Re(n,l)+t+i*Math.cos(d),Re(n,l)+r+o*Math.sin(d)]);return h.push([t+i*Math.cos(s),r+o*Math.sin(s)]),h.push([t+i*Math.cos(s),r+o*Math.sin(s)]),Rl(h,null,l)}function ET(e,t,r,i,o,a,s,n){const l=[],c=[n.maxRandomnessOffset||1,(n.maxRandomnessOffset||1)+.3];let h=[0,0];const d=n.disableMultiStroke?1:2,u=n.preserveVertices;for(let f=0;f<d;f++)f===0?l.push({op:"move",data:[s[0],s[1]]}):l.push({op:"move",data:[s[0]+(u?0:Re(c[0],n)),s[1]+(u?0:Re(c[0],n))]}),h=u?[o,a]:[o+Re(c[f],n),a+Re(c[f],n)],l.push({op:"bcurveTo",data:[e+Re(c[f],n),t+Re(c[f],n),r+Re(c[f],n),i+Re(c[f],n),h[0],h[1]]});return l}function Ns(e){return[...e]}function bg(e,t=0){const r=e.length;if(r<3)throw new Error("A curve must have at least three points.");const i=[];if(r===3)i.push(Ns(e[0]),Ns(e[1]),Ns(e[2]),Ns(e[2]));else{const o=[];o.push(e[0],e[0]);for(let n=1;n<e.length;n++)o.push(e[n]),n===e.length-1&&o.push(e[n]);const a=[],s=1-t;i.push(Ns(o[0]));for(let n=1;n+2<o.length;n++){const l=o[n];a[0]=[l[0],l[1]],a[1]=[l[0]+(s*o[n+1][0]-s*o[n-1][0])/6,l[1]+(s*o[n+1][1]-s*o[n-1][1])/6],a[2]=[o[n+1][0]+(s*o[n][0]-s*o[n+2][0])/6,o[n+1][1]+(s*o[n][1]-s*o[n+2][1])/6],a[3]=[o[n+1][0],o[n+1][1]],i.push(a[1],a[2],a[3])}}return i}function ul(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function PT(e,t,r){const i=ul(t,r);if(i===0)return ul(e,t);let o=((e[0]-t[0])*(r[0]-t[0])+(e[1]-t[1])*(r[1]-t[1]))/i;return o=Math.max(0,Math.min(1,o)),ul(e,pa(t,r,o))}function pa(e,t,r){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function Gh(e,t,r,i){const o=i||[];if((function(n,l){const c=n[l+0],h=n[l+1],d=n[l+2],u=n[l+3];let f=3*h[0]-2*c[0]-u[0];f*=f;let g=3*h[1]-2*c[1]-u[1];g*=g;let p=3*d[0]-2*u[0]-c[0];p*=p;let m=3*d[1]-2*u[1]-c[1];return m*=m,f<p&&(f=p),g<m&&(g=m),f+g})(e,t)<r){const n=e[t+0];o.length?(a=o[o.length-1],s=n,Math.sqrt(ul(a,s))>1&&o.push(n)):o.push(n),o.push(e[t+3])}else{const l=e[t+0],c=e[t+1],h=e[t+2],d=e[t+3],u=pa(l,c,.5),f=pa(c,h,.5),g=pa(h,d,.5),p=pa(u,f,.5),m=pa(f,g,.5),y=pa(p,m,.5);Gh([l,u,p,y],0,r,o),Gh([y,m,g,d],0,r,o)}var a,s;return o}function IT(e,t){return Nl(e,0,e.length,t)}function Nl(e,t,r,i,o){const a=o||[],s=e[t],n=e[r-1];let l=0,c=1;for(let h=t+1;h<r-1;++h){const d=PT(e[h],s,n);d>l&&(l=d,c=h)}return Math.sqrt(l)>i?(Nl(e,t,c+1,i,a),Nl(e,c,r,i,a)):(a.length||a.push(s),a.push(n)),a}function ih(e,t=.15,r){const i=[],o=(e.length-1)/3;for(let a=0;a<o;a++)Gh(e,3*a,t,i);return r&&r>0?Nl(i,0,i.length,r):i}const ki="none";class ql{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1,fillShapeRoughnessGain:.8},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,r,i){return{shape:t,sets:r||[],options:i||this.defaultOptions}}line(t,r,i,o,a){const s=this._o(a);return this._d("line",[ox(t,r,i,o,s)],s)}rectangle(t,r,i,o,a){const s=this._o(a),n=[],l=$T(t,r,i,o,s);if(s.fill){const c=[[t,r],[t+i,r],[t+i,r+o],[t,r+o]];s.fillStyle==="solid"?n.push(rh([c],s)):n.push(Ra([c],s))}return s.stroke!==ki&&n.push(l),this._d("rectangle",n,s)}ellipse(t,r,i,o,a){const s=this._o(a),n=[],l=ax(i,o,s),c=Xh(t,r,s,l);if(s.fill)if(s.fillStyle==="solid"){const h=Xh(t,r,s,l).opset;h.type="fillPath",n.push(h)}else n.push(Ra([c.estimatedPoints],s));return s.stroke!==ki&&n.push(c.opset),this._d("ellipse",n,s)}circle(t,r,i,o){const a=this.ellipse(t,r,i,i,o);return a.shape="circle",a}linearPath(t,r){const i=this._o(r);return this._d("linearPath",[dl(t,!1,i)],i)}arc(t,r,i,o,a,s,n=!1,l){const c=this._o(l),h=[],d=gg(t,r,i,o,a,s,n,!0,c);if(n&&c.fill)if(c.fillStyle==="solid"){const u=Object.assign({},c);u.disableMultiStroke=!0;const f=gg(t,r,i,o,a,s,!0,!1,u);f.type="fillPath",h.push(f)}else h.push((function(u,f,g,p,m,y,x){const b=u,S=f;let T=Math.abs(g/2),k=Math.abs(p/2);T+=Re(.01*T,x),k+=Re(.01*k,x);let _=m,L=y;for(;_<0;)_+=2*Math.PI,L+=2*Math.PI;L-_>2*Math.PI&&(_=0,L=2*Math.PI);const v=(L-_)/x.curveStepCount,M=[];for(let B=_;B<=L;B+=v)M.push([b+T*Math.cos(B),S+k*Math.sin(B)]);return M.push([b+T*Math.cos(L),S+k*Math.sin(L)]),M.push([b,S]),Ra([M],x)})(t,r,i,o,a,s,c));return c.stroke!==ki&&h.push(d),this._d("arc",h,c)}curve(t,r){const i=this._o(r),o=[],a=fg(t,i);if(i.fill&&i.fill!==ki)if(i.fillStyle==="solid"){const s=fg(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(s.ops)})}else{const s=[],n=t;if(n.length){const l=typeof n[0][0]=="number"?[n]:n;for(const c of l)c.length<3?s.push(...c):c.length===3?s.push(...ih(bg([c[0],c[0],c[1],c[2]]),10,(1+i.roughness)/2)):s.push(...ih(bg(c),10,(1+i.roughness)/2))}s.length&&o.push(Ra([s],i))}return i.stroke!==ki&&o.push(a),this._d("curve",o,i)}polygon(t,r){const i=this._o(r),o=[],a=dl(t,!0,i);return i.fill&&(i.fillStyle==="solid"?o.push(rh([t],i)):o.push(Ra([t],i))),i.stroke!==ki&&o.push(a),this._d("polygon",o,i)}path(t,r){const i=this._o(r),o=[];if(!t)return this._d("path",o,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const a=i.fill&&i.fill!=="transparent"&&i.fill!==ki,s=i.stroke!==ki,n=!!(i.simplification&&i.simplification<1),l=(function(h,d,u){const f=rx(ex(fu(h))),g=[];let p=[],m=[0,0],y=[];const x=()=>{y.length>=4&&p.push(...ih(y,d)),y=[]},b=()=>{x(),p.length&&(g.push(p),p=[])};for(const{key:T,data:k}of f)switch(T){case"M":b(),m=[k[0],k[1]],p.push(m);break;case"L":x(),p.push([k[0],k[1]]);break;case"C":if(!y.length){const _=p.length?p[p.length-1]:m;y.push([_[0],_[1]])}y.push([k[0],k[1]]),y.push([k[2],k[3]]),y.push([k[4],k[5]]);break;case"Z":x(),p.push([m[0],m[1]])}if(b(),!u)return g;const S=[];for(const T of g){const k=IT(T,u);k.length&&S.push(k)}return S})(t,1,n?4-4*(i.simplification||1):(1+i.roughness)/2),c=pg(t,i);if(a)if(i.fillStyle==="solid")if(l.length===1){const h=pg(t,Object.assign(Object.assign({},i),{disableMultiStroke:!0,roughness:i.roughness?i.roughness+i.fillShapeRoughnessGain:0}));o.push({type:"fillPath",ops:this._mergedShape(h.ops)})}else o.push(rh(l,i));else o.push(Ra(l,i));return s&&(n?l.forEach((h=>{o.push(dl(h,!1,i))})):o.push(c)),this._d("path",o,i)}opsToPath(t,r){let i="";for(const o of t.ops){const a=typeof r=="number"&&r>=0?o.data.map((s=>+s.toFixed(r))):o.data;switch(o.op){case"move":i+=`M${a[0]} ${a[1]} `;break;case"bcurveTo":i+=`C${a[0]} ${a[1]}, ${a[2]} ${a[3]}, ${a[4]} ${a[5]} `;break;case"lineTo":i+=`L${a[0]} ${a[1]} `}}return i.trim()}toPaths(t){const r=t.sets||[],i=t.options||this.defaultOptions,o=[];for(const a of r){let s=null;switch(a.type){case"path":s={d:this.opsToPath(a),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:ki};break;case"fillPath":s={d:this.opsToPath(a),stroke:ki,strokeWidth:0,fill:i.fill||ki};break;case"fillSketch":s=this.fillSketch(a,i)}s&&o.push(s)}return o}fillSketch(t,r){let i=r.fillWeight;return i<0&&(i=r.strokeWidth/2),{d:this.opsToPath(t),stroke:r.fill||ki,strokeWidth:i,fill:ki}}_mergedShape(t){return t.filter(((r,i)=>i===0||r.op!=="move"))}}class OT{constructor(t,r){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new ql(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.ctx,a=t.options.fixedDecimalPlaceDigits;for(const s of r)switch(s.type){case"path":o.save(),o.strokeStyle=i.stroke==="none"?"transparent":i.stroke,o.lineWidth=i.strokeWidth,i.strokeLineDash&&o.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(o.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(o,s,a),o.restore();break;case"fillPath":{o.save(),o.fillStyle=i.fill||"";const n=t.shape==="curve"||t.shape==="polygon"||t.shape==="path"?"evenodd":"nonzero";this._drawToContext(o,s,a,n),o.restore();break}case"fillSketch":this.fillSketch(o,s,i)}}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=o,this._drawToContext(t,r,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,r,i,o="nonzero"){t.beginPath();for(const a of r.ops){const s=typeof i=="number"&&i>=0?a.data.map((n=>+n.toFixed(i))):a.data;switch(a.op){case"move":t.moveTo(s[0],s[1]);break;case"bcurveTo":t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":t.lineTo(s[0],s[1])}}r.type==="fillPath"?t.fill(o):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,r,i,o,a){const s=this.gen.line(t,r,i,o,a);return this.draw(s),s}rectangle(t,r,i,o,a){const s=this.gen.rectangle(t,r,i,o,a);return this.draw(s),s}ellipse(t,r,i,o,a){const s=this.gen.ellipse(t,r,i,o,a);return this.draw(s),s}circle(t,r,i,o){const a=this.gen.circle(t,r,i,o);return this.draw(a),a}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i),i}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i),i}arc(t,r,i,o,a,s,n=!1,l){const c=this.gen.arc(t,r,i,o,a,s,n,l);return this.draw(c),c}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i),i}path(t,r){const i=this.gen.path(t,r);return this.draw(i),i}}const Hn="http://www.w3.org/2000/svg";class DT{constructor(t,r){this.svg=t,this.gen=new ql(r)}draw(t){const r=t.sets||[],i=t.options||this.getDefaultOptions(),o=this.svg.ownerDocument||window.document,a=o.createElementNS(Hn,"g"),s=t.options.fixedDecimalPlaceDigits;for(const n of r){let l=null;switch(n.type){case"path":l=o.createElementNS(Hn,"path"),l.setAttribute("d",this.opsToPath(n,s)),l.setAttribute("stroke",i.stroke),l.setAttribute("stroke-width",i.strokeWidth+""),l.setAttribute("fill","none"),i.strokeLineDash&&l.setAttribute("stroke-dasharray",i.strokeLineDash.join(" ").trim()),i.strokeLineDashOffset&&l.setAttribute("stroke-dashoffset",`${i.strokeLineDashOffset}`);break;case"fillPath":l=o.createElementNS(Hn,"path"),l.setAttribute("d",this.opsToPath(n,s)),l.setAttribute("stroke","none"),l.setAttribute("stroke-width","0"),l.setAttribute("fill",i.fill||""),t.shape!=="curve"&&t.shape!=="polygon"||l.setAttribute("fill-rule","evenodd");break;case"fillSketch":l=this.fillSketch(o,n,i)}l&&a.appendChild(l)}return a}fillSketch(t,r,i){let o=i.fillWeight;o<0&&(o=i.strokeWidth/2);const a=t.createElementNS(Hn,"path");return a.setAttribute("d",this.opsToPath(r,i.fixedDecimalPlaceDigits)),a.setAttribute("stroke",i.fill||""),a.setAttribute("stroke-width",o+""),a.setAttribute("fill","none"),i.fillLineDash&&a.setAttribute("stroke-dasharray",i.fillLineDash.join(" ").trim()),i.fillLineDashOffset&&a.setAttribute("stroke-dashoffset",`${i.fillLineDashOffset}`),a}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}opsToPath(t,r){return this.gen.opsToPath(t,r)}line(t,r,i,o,a){const s=this.gen.line(t,r,i,o,a);return this.draw(s)}rectangle(t,r,i,o,a){const s=this.gen.rectangle(t,r,i,o,a);return this.draw(s)}ellipse(t,r,i,o,a){const s=this.gen.ellipse(t,r,i,o,a);return this.draw(s)}circle(t,r,i,o){const a=this.gen.circle(t,r,i,o);return this.draw(a)}linearPath(t,r){const i=this.gen.linearPath(t,r);return this.draw(i)}polygon(t,r){const i=this.gen.polygon(t,r);return this.draw(i)}arc(t,r,i,o,a,s,n=!1,l){const c=this.gen.arc(t,r,i,o,a,s,n,l);return this.draw(c)}curve(t,r){const i=this.gen.curve(t,r);return this.draw(i)}path(t,r){const i=this.gen.path(t,r);return this.draw(i)}}var Zt={canvas:(e,t)=>new OT(e,t),svg:(e,t)=>new DT(e,t),generator:e=>new ql(e),newSeed:()=>ql.newSeed()},RT=1,NT=3;async function gu(e){const t=e.getElementsByTagName("img");if(!t||t.length===0)return;const r=!pu(e);await Promise.all([...t].map(i=>new Promise(o=>{function a(){if(i.style.display="flex",i.style.flexDirection="column",r){const s=Ge().fontSize?Ge().fontSize:window.getComputedStyle(document.body).fontSize,n=5,[l=Ld.fontSize]=ec(s),c=l*n+"px";i.style.minWidth=c,i.style.maxWidth=c}else i.style.width="100%";o(i)}C(a,"setupImage"),setTimeout(()=>{i.complete&&a()}),i.addEventListener("error",a),i.addEventListener("load",a)})))}C(gu,"configureLabelImages");function pu(e){return e.nodeType===NT?e.textContent?.trim()!=="":e.nodeType!==RT||e.tagName.toLowerCase()==="img"?!1:[...e.childNodes].some(pu)}C(pu,"hasTextBesidesImages");var Cg=3,qT=32,WT=C(async(e,t,r)=>{const i=Ge(),o=e.insert("g").attr("class",r??"node default").attr("id",t.domId||t.id),a=o.insert("g").attr("class","label").attr("style",Hr(t.labelStyle)),n=[{text:typeof t.label=="string"?t.label:t.label?.[0]??"",cssClass:"c4-name"},{text:t.stereotype,cssClass:"c4-type"},...(t.description??[]).map(y=>({text:y,cssClass:"c4-descr"}))].filter(y=>y.text),l=t.width?Math.max(t.width-2*(t.padding??0),qT):Ge().flowchart?.wrappingWidth??200,h=i.c4?.wrap??!0?l:Number.POSITIVE_INFINITY,d=await Promise.all(n.map(async y=>{const x=a.append("g").attr("class",y.cssClass),b=await vi(x,Ei(ea(y.text??""),i),{useHtmlLabels:!1,markdown:!1,isNode:!0,width:h,style:t.labelStyle},i);return Ye(b).selectAll("tspan.text-outer-tspan").attr("text-anchor","middle"),Ye(b).selectAll("tspan.text-inner-tspan").attr("font-weight",null).attr("font-style",null),{el:x,box:x.node().getBBox()}})),u=Math.max(...d.map(({box:y})=>y.width),0);let f=0;for(const{el:y,box:x}of d)y.attr("transform",`translate(${u/2-x.x-x.width/2}, ${f-x.y})`),f+=x.height+Cg;const g=d.length>0?f-Cg:0;a.insert("rect",":first-child"),a.attr("transform",`translate(${-u/2}, ${-g/2})`);const p=a.node().getBBox(),m=(t.padding??0)/2;return{shapeSvg:o,bbox:p,halfPadding:m,label:a}},"c4LabelHelper"),wg=C((e,t)=>{const{x:r,y:i,width:o,height:a}=e;return o>=t?e:"left"in e?{x:r,y:i,width:t,height:a,top:i,left:r,bottom:i+a,right:r+t,toJSON:C(()=>({}),"toJSON")}:{x:r-(t-o)/2,y:i,width:t,height:a}},"withMinWidth"),he=C(async(e,t,r,{ignoreMinWidth:i=!1}={})=>{if(t.stereotype!==void 0)return WT(e,t,r);let o;const a=t.useHtmlLabels||mo(Ge()?.htmlLabels);r?o=r:o="node default";const s=e.insert("g").attr("class",o).attr("id",t.domId||t.id),n=s.insert("g").attr("class","label").attr("style",Hr(t.labelStyle));let l;t.label===void 0?l="":l=typeof t.label=="string"?t.label:t.label[0];const c=!!t.icon||!!t.img,h=t.labelType==="markdown",d=l&&!t.width&&!i?t.minWidth??0:0,u=await vi(n,Ei(ea(l),Ge()),{useHtmlLabels:a,width:t.width||t.wrappingWidth||Ge().flowchart?.wrappingWidth,minWidth:d,classes:h?"markdown-node-label":"",style:t.labelStyle,addSvgBackground:c,markdown:h},Ge()),f=(t?.padding??0)/2;let g;if(a){const p=u.children[0],m=Ye(u);await gu(p),g=await La.measure(()=>p.getBoundingClientRect()),g=wg(g,d),m.attr("width",g.width),m.attr("height",g.height)}else g=await La.measure(()=>u.getBBox()),g=wg(g,d);return a?n.attr("transform","translate("+-g.width/2+", "+-g.height/2+")"):n.attr("transform","translate(0, "+-g.height/2+")"),t.centerLabel&&n.attr("transform","translate("+-g.width/2+", "+-g.height/2+")"),n.insert("rect",":first-child"),{shapeSvg:s,bbox:g,halfPadding:f,label:n}},"labelHelper"),ka=C(async(e,t,r)=>{const i=r.useHtmlLabels??Zr(Ge()),o=e.insert("g").attr("class","label").attr("style",r.labelStyle||""),a=await vi(o,Ei(ea(t),Ge()),{useHtmlLabels:i,width:r.width||Ge()?.flowchart?.wrappingWidth,style:r.labelStyle,addSvgBackground:!!r.icon||!!r.img}),s=r.padding/2;let n;if(Zr(Ge())){const l=a.children[0],c=Ye(a);n=await La.measure(()=>l.getBoundingClientRect()),c.attr("width",n.width),c.attr("height",n.height)}else n=await La.measure(()=>a.getBBox());return i?o.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"):o.attr("transform","translate(0, "+-n.height/2+")"),r.centerLabel&&o.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:e,bbox:n,halfPadding:s,label:o}},"insertLabel"),ee=C((e,t,r)=>{if(r){e.width=r.width,e.height=r.height;return}const i=t.node().getBBox();e.width=i.width,e.height=i.height},"updateNodeBounds"),se=C((e,t)=>(e.look==="handDrawn"?"rough-node":"node")+" "+e.cssClasses+" "+(t||""),"getNodeClasses");function sr(e){const t=e.map((r,i)=>`${i===0?"M":"L"}${r.x},${r.y}`);return t.push("Z"),t.join(" ")}C(sr,"createPathFromPoints");function ia(e,t,r,i,o,a){const s=[],l=r-e,c=i-t,h=l/a,d=2*Math.PI/h,u=t+c/2;for(let f=0;f<=50;f++){const g=f/50,p=e+g*l,m=u+o*Math.sin(d*(p-e));s.push({x:p,y:m})}return s}C(ia,"generateFullSineWavePoints");function so(e,t,r,i,o,a){const s=[],n=o*Math.PI/180,h=(a*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*h,f=e+r*Math.cos(u),g=t+r*Math.sin(u);s.push({x:-f,y:-g})}return s}C(so,"generateCirclePoints");function Uh(e){const t=Array.from(e.childNodes).filter(l=>l.tagName==="path"),r=document.createElementNS("http://www.w3.org/2000/svg","path"),i=t.map(l=>l.getAttribute("d")).filter(l=>l!==null).join(" ");r.setAttribute("d",i);const o=t.find(l=>l.getAttribute("fill")!=="none"),a=t.find(l=>l.getAttribute("stroke")!=="none"),s=C((l,c)=>l?.getAttribute(c)??void 0,"getAttr");if(o){const l={fill:s(o,"fill"),"fill-opacity":s(o,"fill-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}if(a){const l={stroke:s(a,"stroke"),"stroke-width":s(a,"stroke-width")??"1","stroke-opacity":s(a,"stroke-opacity")??"1"};Object.entries(l).forEach(([c,h])=>{h&&r.setAttribute(c,h)})}const n=document.createElementNS("http://www.w3.org/2000/svg","g");return n.appendChild(r),n}C(Uh,"mergePaths");var zT=C((e,t)=>{var r=e.x,i=e.y,o=t.x-r,a=t.y-i,s=e.width/2,n=e.height/2,l,c;return Math.abs(a)*s>Math.abs(o)*n?(a<0&&(n=-n),l=a===0?0:n*o/a,c=n):(o<0&&(s=-s),l=s,c=o===0?0:s*a/o),{x:r+l,y:i+c}},"intersectRect"),Wo=zT;function nx(e,t){return e.intersect(t)}C(nx,"intersectNode");var HT=nx;function lx(e,t,r,i){var o=e.x,a=e.y,s=o-i.x,n=a-i.y,l=Math.sqrt(t*t*n*n+r*r*s*s),c=Math.abs(t*r*s/l);i.x<o&&(c=-c);var h=Math.abs(t*r*n/l);return i.y<a&&(h=-h),{x:o+c,y:a+h}}C(lx,"intersectEllipse");var cx=lx;function hx(e,t,r){return cx(e,t,t,r)}C(hx,"intersectCircle");var YT=hx;function dx(e,t,r,i){{const o=t.y-e.y,a=e.x-t.x,s=t.x*e.y-e.x*t.y,n=o*r.x+a*r.y+s,l=o*i.x+a*i.y+s,c=1e-6;if(n!==0&&l!==0&&Vh(n,l))return;const h=i.y-r.y,d=r.x-i.x,u=i.x*r.y-r.x*i.y,f=h*e.x+d*e.y+u,g=h*t.x+d*t.y+u;if(Math.abs(f)<c&&Math.abs(g)<c&&Vh(f,g))return;const p=o*d-h*a;if(p===0)return;const m=(a*u-d*s)/p,y=(h*s-o*u)/p;return{x:m,y}}}C(dx,"intersectLine");function Vh(e,t){return e*t>0}C(Vh,"sameSign");var XT=dx;function ux(e,t,r){let i=e.x,o=e.y,a=[],s=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(h){s=Math.min(s,h.x),n=Math.min(n,h.y)}):(s=Math.min(s,t.x),n=Math.min(n,t.y));let l=i-e.width/2-s,c=o-e.height/2-n;for(let h=0;h<t.length;h++){let d=t[h],u=t[h<t.length-1?h+1:0],f=XT(e,r,{x:l+d.x,y:c+d.y},{x:l+u.x,y:c+u.y});f&&a.push(f)}return a.length?(a.length>1&&a.sort(function(h,d){let u=h.x-r.x,f=h.y-r.y,g=Math.sqrt(u*u+f*f),p=d.x-r.x,m=d.y-r.y,y=Math.sqrt(p*p+m*m);return g<y?-1:g===y?0:1}),a[0]):e}C(ux,"intersectPolygon");var jT=ux,Yt={node:HT,circle:YT,ellipse:cx,polygon:jT,rect:Wo},Mi=C((e,t,r,i,o)=>["M",e+o,t,"H",e+r-o,"A",o,o,0,0,1,e+r,t+o,"V",t+i-o,"A",o,o,0,0,1,e+r-o,t+i,"H",e+o,"A",o,o,0,0,1,e,t+i-o,"V",t+o,"A",o,o,0,0,1,e+o,t,"Z"].join(" "),"createRoundedRectPathD"),GT=C(async(e,t,r,i=!1,o=!1)=>{let a=t||"";typeof a=="object"&&(a=a[0]);const s=Ge(),n=Zr(s);return await vi(e,a,{style:r,isTitle:i,useHtmlLabels:n,markdown:!1,isNode:o,width:Number.POSITIVE_INFINITY},s)},"createLabel"),Lo=GT;function fx(e,t){const{labelStyles:r}=Ut(t);t.labelStyle=r;const i=se(t);let o=i;i||(o="anchor");const a=e.insert("g").attr("class",o).attr("id",t.domId||t.id),s=1,{cssStyles:n}=t,l=Zt.svg(a),c=Gt(t,{fill:"black",stroke:"none",fillStyle:"solid"});t.look!=="handDrawn"&&(c.roughness=0);const h=l.circle(0,0,s*2,c),d=a.insert(()=>h,":first-child");return d.attr("class","anchor").attr("style",Hr(n)),ee(t,d),t.intersect=function(u){return Lt.info("Circle intersect",t,s,u),Yt.circle(t,s,u)},a}C(fx,"anchor");function Zh(e,t,r,i,o,a,s){const l=(e+r)/2,c=(t+i)/2,h=Math.atan2(i-t,r-e),d=(r-e)/2,u=(i-t)/2,f=d/o,g=u/a,p=Math.sqrt(f**2+g**2);if(p>1)throw new Error("The given radii are too small to create an arc between the points.");const m=Math.sqrt(1-p**2),y=l+m*a*Math.sin(h)*(s?-1:1),x=c-m*o*Math.cos(h)*(s?-1:1),b=Math.atan2((t-x)/a,(e-y)/o);let T=Math.atan2((i-x)/a,(r-y)/o)-b;s&&T<0&&(T+=2*Math.PI),!s&&T>0&&(T-=2*Math.PI);const k=[];for(let _=0;_<20;_++){const L=_/19,v=b+L*T,M=y+o*Math.cos(v),B=x+a*Math.sin(v);k.push({x:M,y:B})}return k}C(Zh,"generateArcPoints");function gx(e,t,r){const[i,o]=[t,r].sort((a,s)=>s-a);return o*(1-Math.sqrt(1-(e/i/2)**2))}C(gx,"calculateArcSagitta");async function px(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?16:o,s=t.look==="neo"?12:o,n=C(v=>v+s,"calcTotalHeight"),l=C(v=>{const M=v/2;return[M/(2.5+v/50),M]},"calcEllipseRadius"),{shapeSvg:c,bbox:h}=await he(e,t,se(t)),d=n(t?.height?t?.height:h.height),[u,f]=l(d),g=gx(d,u,f),m=(t?.width?t?.width:h.width)+a*2+g-g,y=d,{cssStyles:x}=t,b=[{x:m/2,y:-y/2},{x:-m/2,y:-y/2},...Zh(-m/2,-y/2,-m/2,y/2,u,f,!1),{x:m/2,y:y/2},...Zh(m/2,y/2,m/2,-y/2,u,f,!0)],S=Zt.svg(c),T=Gt(t,{});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const k=sr(b),_=S.path(k,T),L=c.insert(()=>_,":first-child");return L.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",i),L.attr("transform",`translate(${u/2}, 0)`),ee(t,L),t.intersect=function(v){return Yt.polygon(t,b,v)},c}C(px,"bowTieRect");async function mx(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=Ut(t);t.labelStyle=i;const{shapeSvg:a,bbox:s,label:n}=await he(e,t,se(t)),l=r?.nodeBorder??r?.lineColor??"currentColor",c=t.padding??12,h=Math.max(s.width+c*2,t.width??0,80),d=Math.max(Math.min(h*.08,12),5),u=Math.max(s.height+c*2+d,t.height??0),f=-u/2+d,g=u/2,p=h*.72,m=[`M${-h/2},${f}`,`L${-p/2},${g}`,`A${p/2},${d} 0 0 0 ${p/2},${g}`,`L${h/2},${f}`,`A${h/2},${d} 0 0 0 ${-h/2},${f}`,"Z"].join(" "),{cssStyles:y}=t,x=a.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){const L=Zt.svg(a).path(m,Gt(t,{}));x.node()?.appendChild(L),y&&x.attr("style",y)}else x.append("path").attr("d",m).attr("style",o);x.append("ellipse").attr("cx",0).attr("cy",f).attr("rx",h/2).attr("ry",d).attr("style",`fill:none;stroke:${l};stroke-width:1px`),ee(t,x);const b=f+(g-f)/2;n.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${b-s.height/2-(s.y-(s.top??0))})`);const S=12,T=C((_,L,v)=>Array.from({length:S+1},(M,B)=>{const E=Math.PI-B*Math.PI/S;return{x:_*Math.cos(E),y:L+v*d*Math.sin(E)}}),"arc"),k=[...T(h/2,f,-1),...T(p/2,g,1).reverse()];return t.intersect=function(_){return Yt.polygon(t,k,_)},a}C(mx,"bucket");var kg=20,Sg=8,UT=80,VT=8;function yx(e){const{themeVariables:t}=Ge(),r=t.clusterBkg,i=t.clusterBorder;switch(e){case"flow":return{rx:10,fill:"none",stroke:t.flowContainerStroke||t.secondaryBorderColor,strokeWidth:.75,cssClass:"flow-collapsed"};default:return{rx:VT,fill:r,stroke:i,cssClass:"collapsed-group"}}}C(yx,"getCollapsedStyle");async function xx(e,t){const r=yx(t.metadata?.containerType),{fill:i,stroke:o}=r,{nodeStyles:a}=Ut(t),{shapeSvg:s,bbox:n}=await he(e,t,se(t)),{theme:l,themeVariables:c}=Ge();Oi(s,t.colorIndex,l,c.borderColorArray);const h=t.padding??8,d=n.height,u=Math.max(n.width+h*2,UT,t?.width??0),f=Math.max(d+Sg+kg+h*2,t?.height??0),g=-u/2,p=-f/2,m=-28/2,y=s.select(".label");y&&(t.useHtmlLabels??Zr(Ge())?y.attr("transform",`translate(${-n.width/2}, ${-n.height/2+m})`):y.attr("transform",`translate(0, ${-n.height/2+m})`));let x;if(t.look==="handDrawn"){const _=Zt.svg(s),L=Gt(t,{fill:i,stroke:o,...r.strokeWidth===void 0?{}:{strokeWidth:r.strokeWidth},...i==="none"?{fillWeight:0}:{fillStyle:"solid"}}),v=_.path(Mi(g,p,u,f,r.rx),L);x=s.insert(()=>v,":first-child"),x.attr("class","basic label-container "+r.cssClass).attr("style",Hr(t.cssStyles))}else x=s.insert("rect",":first-child"),x.attr("class","basic label-container "+r.cssClass).attr("style",a).attr("rx",r.rx).attr("ry",r.rx).attr("x",g).attr("y",p).attr("width",u).attr("height",f).attr("fill",i).attr("stroke",o),r.strokeWidth!==void 0&&x.attr("stroke-width",r.strokeWidth+"px");const b=p+h+d+Sg;s.append("line").attr("class","collapsed-separator").attr("x1",g+8).attr("y1",b).attr("x2",g+u-8).attr("y2",b).attr("stroke",o).attr("stroke-dasharray","3, 3");const S=b+kg/2,T=2.5,k=10;for(let _=-1;_<=1;_++)s.append("circle").attr("class","collapsed-indicator").attr("cx",_*k).attr("cy",S).attr("r",T).attr("fill",o);return ee(t,x),t.calcIntersect=function(_,L){return Yt.rect(_,L)},t.intersect=function(_){return Yt.rect(t,_)},s}C(xx,"collapsedGroup");function yo(e,t,r,i){return e.insert("polygon",":first-child").attr("points",i.map(function(o){return o.x+","+o.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+r/2+")")}C(yo,"insertPolygonShape");var ZT=["right","left","up","down"],mu="point",KT=C(e=>{const t=new Set;for(const r of e)switch(r){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(r);break}return t},"expandAndDeduplicateDirections"),QT=C(e=>ZT.filter(t=>e.has(t)).join("|")||mu,"getDirectionKey"),vg={"right|left|up|down":C(({height:e,midpoint:t,padding:r,width:i})=>[{x:0,y:0},{x:t,y:0},{x:i/2,y:2*r},{x:i-t,y:0},{x:i,y:0},{x:i,y:-e/3},{x:i+2*r,y:-e/2},{x:i,y:-2*e/3},{x:i,y:-e},{x:i-t,y:-e},{x:i/2,y:-e-2*r},{x:t,y:-e},{x:0,y:-e},{x:0,y:-2*e/3},{x:-2*r,y:-e/2},{x:0,y:-e/3}],"right|left|up|down"),"right|left|up":C(({height:e,midpoint:t,width:r})=>[{x:t,y:0},{x:r-t,y:0},{x:r,y:-e/2},{x:r-t,y:-e},{x:t,y:-e},{x:0,y:-e/2}],"right|left|up"),"right|left|down":C(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:t,y:-e},{x:r-t,y:-e},{x:r,y:0}],"right|left|down"),"right|up|down":C(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:r,y:-t},{x:r,y:-e+t},{x:0,y:-e}],"right|up|down"),"left|up|down":C(({height:e,midpoint:t,width:r})=>[{x:r,y:0},{x:0,y:-t},{x:0,y:-e+t},{x:r,y:-e}],"left|up|down"),"right|left":C(({height:e,midpoint:t,padding:r,width:i})=>[{x:t,y:0},{x:t,y:-r},{x:i-t,y:-r},{x:i-t,y:0},{x:i,y:-e/2},{x:i-t,y:-e},{x:i-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e},{x:0,y:-e/2}],"right|left"),"up|down":C(({height:e,midpoint:t,padding:r,width:i})=>[{x:i/2,y:0},{x:0,y:-r},{x:t,y:-r},{x:t,y:-e+r},{x:0,y:-e+r},{x:i/2,y:-e},{x:i,y:-e+r},{x:i-t,y:-e+r},{x:i-t,y:-r},{x:i,y:-r}],"up|down"),"right|up":C(({height:e,midpoint:t,width:r})=>[{x:0,y:0},{x:r,y:-t},{x:0,y:-e}],"right|up"),"right|down":C(({height:e,width:t})=>[{x:0,y:0},{x:t,y:0},{x:0,y:-e}],"right|down"),"left|up":C(({height:e,midpoint:t,width:r})=>[{x:r,y:0},{x:0,y:-t},{x:r,y:-e}],"left|up"),"left|down":C(({height:e,width:t})=>[{x:t,y:0},{x:0,y:0},{x:t,y:-e}],"left|down"),right:C(({height:e,midpoint:t,padding:r,width:i})=>[{x:t,y:-r},{x:t,y:-r},{x:i-t,y:-r},{x:i-t,y:0},{x:i,y:-e/2},{x:i-t,y:-e},{x:i-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e+r}],"right"),left:C(({height:e,midpoint:t,padding:r,width:i})=>[{x:t,y:0},{x:t,y:-r},{x:i-t,y:-r},{x:i-t,y:-e+r},{x:t,y:-e+r},{x:t,y:-e},{x:0,y:-e/2}],"left"),up:C(({height:e,midpoint:t,padding:r,width:i})=>[{x:t,y:-r},{x:t,y:-e+r},{x:0,y:-e+r},{x:i/2,y:-e},{x:i,y:-e+r},{x:i-t,y:-e+r},{x:i-t,y:-r}],"up"),down:C(({height:e,midpoint:t,padding:r,width:i})=>[{x:i/2,y:0},{x:0,y:-r},{x:t,y:-r},{x:t,y:-e+r},{x:i-t,y:-e+r},{x:i-t,y:-r},{x:i,y:-r}],"down"),[mu]:()=>[{x:0,y:0}]},JT=C((e,t,r,i)=>{const o=KT(e),a=(r.padding??0)/2,s=t.height+4*a,n=s/2,l=i??t.width+2*n+2*a,c=QT(o);return(vg[c]??vg[mu])({height:s,midpoint:n,padding:a,width:l})},"getArrowPoints");async function bx(e,t){const r=t,{shapeSvg:i,bbox:o}=await he(e,r,se(r)),a=r.padding??0,s=o.height+2*a,n=s/2,l=o.width+2*n+a,c=r.width??0,d=r.positioned&&(r.widthInColumns??1)>1&&c>l?c:l,u=JT(r.directions??[],o,r,d),f=yo(i,d,s,u);return f.attr("style",r.style??null),ee(r,f),r.intersect=function(g){return Yt.polygon(r,u,g)},i}C(bx,"block_arrow");async function Cx(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=Ut(t);t.labelStyle=i;const{shapeSvg:a,bbox:s,label:n}=await he(e,t,se(t)),l=r?.nodeBorder??r?.lineColor??"currentColor",c=t.padding??12,h=18,d=12,u=Math.max(s.width+c*2,t.width??0,90),f=Math.max(s.height+c*2+h,t.height??0),g=-f/2,{cssStyles:p}=t,m=a.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){const b=Zt.svg(a).path(Mi(-u/2,g,u,f,d),Gt(t,{}));m.node()?.appendChild(b),p&&m.attr("style",p)}else m.append("rect").attr("x",-u/2).attr("y",g).attr("width",u).attr("height",f).attr("rx",d).attr("ry",d).attr("style",o);m.append("line").attr("x1",-u/2).attr("y1",g+h).attr("x2",u/2).attr("y2",g+h).attr("style",`stroke:${l};stroke-width:1px`);for(let x=0;x<3;x++)m.append("circle").attr("cx",-u/2+12+x*9).attr("cy",g+h/2).attr("r",2.5).attr("style",`fill:${l};stroke:none`);m.append("rect").attr("class","browser-address-bar").attr("x",-u/2+44).attr("y",g+4).attr("width",Math.max(u-56,10)).attr("height",h-8).attr("rx",3).attr("ry",3).attr("style",`fill:none;stroke:${l};stroke-width:1px;opacity:0.6`),ee(t,m);const y=g+h+(f-h)/2;return n.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${y-s.height/2-(s.y-(s.top??0))})`),t.intersect=function(x){return Yt.rect(t,x)},a}C(Cx,"browser");var Yn=12;async function wx(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?28:o,s=t.look==="neo"?24:o,{shapeSvg:n,bbox:l}=await he(e,t,se(t)),c=(t?.width??l.width)+(t.look==="neo"?a*2:a+Yn),h=(t?.height??l.height)+(t.look==="neo"?s*2:s),d=0,u=c,f=-h,g=0,p=[{x:d+Yn,y:f},{x:u,y:f},{x:u,y:g},{x:d,y:g},{x:d,y:f+Yn},{x:d+Yn,y:f}];let m;const{cssStyles:y}=t;if(t.look==="handDrawn"){const x=Zt.svg(n),b=Gt(t,{}),S=sr(p),T=x.path(S,b);m=n.insert(()=>T,":first-child").attr("transform",`translate(${-c/2}, ${h/2})`),y&&m.attr("style",y)}else m=yo(n,c,h,p);return i&&m.attr("style",i),ee(t,m),t.intersect=function(x){return Yt.polygon(t,p,x)},n}C(wx,"card");function kx(e,t){const{nodeStyles:r}=Ut(t);t.label="";const i=e.insert("g").attr("class",se(t)).attr("id",t.domId??t.id),{cssStyles:o}=t,a=Math.max(28,t.width??0),s=[{x:0,y:a/2},{x:a/2,y:0},{x:0,y:-a/2},{x:-a/2,y:0}],n=Zt.svg(i),l=Gt(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=sr(s),h=n.path(c,l),d=i.insert(()=>h,":first-child");return o&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",o),r&&t.look!=="handDrawn"&&d.selectAll("path").attr("style",r),t.width=28,t.height=28,t.intersect=function(u){return Yt.polygon(t,s,u)},i}C(kx,"choice");async function yu(e,t,r){const{labelStyles:i,nodeStyles:o}=Ut(t);t.labelStyle=i;const{shapeSvg:a,bbox:s,halfPadding:n}=await he(e,t,se(t),{ignoreMinWidth:!0}),l=16,c=r?.padding??n,h=Math.sqrt(s.width**2+s.height**2)/2,d=t.look==="neo"?h+l:h+c;let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const g=Zt.svg(a),p=Gt(t,{}),m=g.circle(0,0,d*2,p);u=a.insert(()=>m,":first-child"),u.attr("class","basic label-container").attr("style",Hr(f))}else u=a.insert("circle",":first-child").attr("class","basic label-container").attr("style",o).attr("r",d).attr("cx",0).attr("cy",0);return ee(t,u),t.calcIntersect=function(g,p){const m=g.width/2;return Yt.circle(g,m,p)},t.intersect=function(g){return Lt.info("Circle intersect",t,d,g),Yt.circle(t,d,g)},a}C(yu,"circle");async function Sx(e,t){const r=t,i=["node",r.cssClasses,r.class].filter(Boolean).join(" "),{shapeSvg:o,bbox:a,halfPadding:s}=await he(e,r,i),n=o.insert("rect",":first-child"),l=r.padding??0,c=r.positioned?r.width??0:a.width+l,h=r.positioned?r.height??0:a.height+l,d=r.positioned?-c/2:-a.width/2-s,u=r.positioned?-h/2:-a.height/2-s;return n.attr("class","basic cluster composite label-container").attr("style",r.style??null).attr("rx",r.rx??null).attr("ry",r.ry??null).attr("x",d).attr("y",u).attr("width",c).attr("height",h),ee(r,n),r.intersect=function(f){return Yt.rect(r,f)},o}C(Sx,"composite");async function vx(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=Ut(t);t.labelStyle=i;const{shapeSvg:a,bbox:s,label:n}=await he(e,t,se(t)),l=r?.nodeBorder??r?.lineColor??"currentColor",c=t.padding??12,h=20,d=12,u=Math.max(s.width+c*2,t.width??0,90),f=Math.max(s.height+c*2+h,t.height??0),g=-f/2,{cssStyles:p}=t,m=a.insert("g",":first-child").attr("class","basic label-container");if(t.look==="handDrawn"){const b=Zt.svg(a).path(Mi(-u/2,g,u,f,d),Gt(t,{}));m.node()?.appendChild(b),p&&m.attr("style",p)}else m.append("rect").attr("x",-u/2).attr("y",g).attr("width",u).attr("height",f).attr("rx",d).attr("ry",d).attr("style",o);m.append("text").attr("x",-u/2+12).attr("y",g+16).attr("class","console-glyph").attr("style",`font-family:monospace;font-weight:bold;font-size:14px;fill:${l}`).text(">_"),ee(t,m);const y=g+h+(f-h)/2;return n.attr("transform",`translate(${-(s.width/2)-(s.x-(s.left??0))}, ${y-s.height/2-(s.y-(s.top??0))})`),t.intersect=function(x){return Yt.rect(t,x)},a}C(vx,"consoleWindow");function Mx(e){const t=Math.cos(Math.PI/4),r=Math.sin(Math.PI/4),i=e*2,o={x:i/2*t,y:i/2*r},a={x:-(i/2)*t,y:i/2*r},s={x:-(i/2)*t,y:-(i/2)*r},n={x:i/2*t,y:-(i/2)*r};return`M ${a.x},${a.y} L ${n.x},${n.y}
232
232
  M ${o.x},${o.y} L ${s.x},${s.y}`}C(Mx,"createLine");function Tx(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r,t.label="";const o=e.insert("g").attr("class",se(t)).attr("id",t.domId??t.id),a=Math.max(30,t?.width??0),{cssStyles:s}=t,n=Zt.svg(o),l=Gt(t,{});t.look!=="handDrawn"&&(l.roughness=0,l.fillStyle="solid");const c=n.circle(0,0,a*2,l),h=Mx(a),d=n.path(h,l),u=o.insert(()=>c,":first-child");return u.insert(()=>d),u.attr("class","outer-path"),s&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",s),i&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",i),ee(t,u),t.intersect=function(f){return Lt.info("crossedCircle intersect",t,{radius:a,point:f}),Yt.circle(t,a,f)},o}C(Tx,"crossedCircle");function vo(e,t,r,i=100,o=0,a=180){const s=[],n=o*Math.PI/180,h=(a*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*h,f=e+r*Math.cos(u),g=t+r*Math.sin(u);s.push({x:-f,y:-g})}return s}C(vo,"generateCirclePoints");async function Bx(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,label:s}=await he(e,t,se(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=a.width+n,h=a.height+l,d=Math.max(5,h*.1),{cssStyles:u}=t,f=[...vo(c/2,-h/2,d,30,-90,0),{x:-c/2-d,y:d},...vo(c/2+d*2,-d,d,20,-180,-270),...vo(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-h/2},...vo(c/2,h/2,d,20,0,90)],g=[{x:c/2,y:-h/2-d},{x:-c/2,y:-h/2-d},...vo(c/2,-h/2,d,20,-90,0),{x:-c/2-d,y:-d},...vo(c/2+c*.1,-d,d,20,-180,-270),...vo(c/2+c*.1,d,d,20,-90,-180),{x:-c/2-d,y:h/2},...vo(c/2,h/2,d,20,0,90),{x:-c/2,y:h/2+d},{x:c/2,y:h/2+d}],p=Zt.svg(o),m=Gt(t,{fill:"none"});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const x=sr(f).replace("Z",""),b=p.path(x,m),S=sr(g),T=p.path(S,{...m}),k=o.insert("g",":first-child");return k.insert(()=>T,":first-child").attr("stroke-opacity",0),k.insert(()=>b,":first-child"),k.attr("class","text"),u&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),k.attr("transform",`translate(${d}, 0)`),s.attr("transform",`translate(${-c/2+d-(a.x-(a.left??0))},${-h/2+(t.padding??0)/2-(a.y-(a.top??0))})`),ee(t,k),t.intersect=function(_){return Yt.polygon(t,g,_)},o}C(Bx,"curlyBraceLeft");function Mo(e,t,r,i=100,o=0,a=180){const s=[],n=o*Math.PI/180,h=(a*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*h,f=e+r*Math.cos(u),g=t+r*Math.sin(u);s.push({x:f,y:g})}return s}C(Mo,"generateCirclePoints");async function _x(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,label:s}=await he(e,t,se(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=a.width+(t.look==="neo"?n*2:n),h=a.height+(t.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:u}=t,f=[...Mo(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...Mo(c/2+d*2,-d,d,20,-180,-270),...Mo(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...Mo(c/2,h/2,d,20,0,90)],g=[{x:-c/2,y:-h/2-d},{x:c/2,y:-h/2-d},...Mo(c/2,-h/2,d,20,-90,0),{x:c/2+d,y:-d},...Mo(c/2+d*2,-d,d,20,-180,-270),...Mo(c/2+d*2,d,d,20,-90,-180),{x:c/2+d,y:h/2},...Mo(c/2,h/2,d,20,0,90),{x:c/2,y:h/2+d},{x:-c/2,y:h/2+d}],p=Zt.svg(o),m=Gt(t,{fill:"none"});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const x=sr(f).replace("Z",""),b=p.path(x,m),S=sr(g),T=p.path(S,{...m}),k=o.insert("g",":first-child");return k.insert(()=>T,":first-child").attr("stroke-opacity",0),k.insert(()=>b,":first-child"),k.attr("class","text"),u&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&k.selectAll("path").attr("style",i),k.attr("transform",`translate(${-d}, 0)`),s.attr("transform",`translate(${-c/2+(t.padding??0)/2-(a.x-(a.left??0))},${-h/2+(t.padding??0)/2-(a.y-(a.top??0))})`),ee(t,k),t.intersect=function(_){return Yt.polygon(t,g,_)},o}C(_x,"curlyBraceRight");function Kr(e,t,r,i=100,o=0,a=180){const s=[],n=o*Math.PI/180,h=(a*Math.PI/180-n)/(i-1);for(let d=0;d<i;d++){const u=n+d*h,f=e+r*Math.cos(u),g=t+r*Math.sin(u);s.push({x:-f,y:-g})}return s}C(Kr,"generateCirclePoints");async function Lx(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,label:s}=await he(e,t,se(t)),n=t.look==="neo"?18:t.padding??0,l=t.look==="neo"?12:t.padding??0,c=a.width+(t.look==="neo"?n*2:n),h=a.height+(t.look==="neo"?l*2:l),d=Math.max(5,h*.1),{cssStyles:u}=t,f=[...Kr(c/2,-h/2,d,30,-90,0),{x:-c/2-d,y:d},...Kr(c/2+d*2,-d,d,20,-180,-270),...Kr(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:-h/2},...Kr(c/2,h/2,d,20,0,90)],g=[...Kr(-c/2+d+d/2,-h/2,d,20,-90,-180),{x:c/2-d/2,y:d},...Kr(-c/2-d/2,-d,d,20,0,90),...Kr(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...Kr(-c/2+d+d/2,h/2,d,30,-180,-270)],p=[{x:c/2,y:-h/2-d},{x:-c/2,y:-h/2-d},...Kr(c/2,-h/2,d,20,-90,0),{x:-c/2-d,y:-d},...Kr(c/2+d*2,-d,d,20,-180,-270),...Kr(c/2+d*2,d,d,20,-90,-180),{x:-c/2-d,y:h/2},...Kr(c/2,h/2,d,20,0,90),{x:-c/2,y:h/2+d},{x:c/2-d-d/2,y:h/2+d},...Kr(-c/2+d+d/2,-h/2,d,20,-90,-180),{x:c/2-d/2,y:d},...Kr(-c/2-d/2,-d,d,20,0,90),...Kr(-c/2-d/2,d,d,20,-90,0),{x:c/2-d/2,y:-d},...Kr(-c/2+d+d/2,h/2,d,30,-180,-270)],m=Zt.svg(o),y=Gt(t,{fill:"none"});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const b=sr(f).replace("Z",""),S=m.path(b,y),k=sr(g).replace("Z",""),_=m.path(k,y),L=sr(p),v=m.path(L,{...y}),M=o.insert("g",":first-child");return M.insert(()=>v,":first-child").attr("stroke-opacity",0),M.insert(()=>S,":first-child"),M.insert(()=>_,":first-child"),M.attr("class","text"),u&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",u),i&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",i),M.attr("transform",`translate(${d-d/4}, 0)`),s.attr("transform",`translate(${-c/2+(t.padding??0)/2-(a.x-(a.left??0))},${-h/2+(t.padding??0)/2-(a.y-(a.top??0))})`),ee(t,M),t.intersect=function(B){return Yt.polygon(t,p,B)},o}C(Lx,"curlyBraces");async function Ax(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?16:o,s=t.look==="neo"?12:o,n=20,l=5,{shapeSvg:c,bbox:h}=await he(e,t,se(t)),d=Math.max(l,h.height+s*2,t?.height??0),u=d/2,f=u-Math.sqrt(Math.max(0,u**2-(h.height/2)**2)),g=Math.max(d/4,f),p=Math.max(n,h.width+a*2+g*2,(h.width+a*2)*1.25,t?.width??0),{cssStyles:m}=t,y=Zt.svg(c),x=Gt(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=p,S=d,T=b-u,k=S/4,_=[{x:T,y:0},{x:k,y:0},{x:0,y:S/2},{x:k,y:S},{x:T,y:S},...so(-T,-S/2,u,50,270,90)],L=sr(_),v=y.path(L,x),M=c.insert(()=>v,":first-child");return M.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&M.selectChildren("path").attr("style",m),i&&t.look!=="handDrawn"&&M.selectChildren("path").attr("style",i),M.attr("transform",`translate(${-p/2}, ${-d/2})`),ee(t,M),t.intersect=function(B){return Yt.polygon(t,_,B)},c}C(Ax,"curvedTrapezoid");async function Fx(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,label:s}=await he(e,t,se(t)),n=t.padding??20,l=Math.max(a.width+n*2,t.width??0,100),c=Math.min(Math.max(l*.23,16),56),h=c*.27,d=Math.max(a.height+n*2,t.height?t.height-(2*c-h):0),u=Math.min(l*.177,d*.45),f=d+2*c-h,g=-f/2,p=g+2*c-h,m=o.insert("g",":first-child").attr("class","basic label-container"),{cssStyles:y}=t;if(t.look==="handDrawn"){const L=Zt.svg(o),v=Gt(t,{}),M=L.path(Mi(-l/2,p,l,d,u),v),B=L.circle(0,g+c,c*2,v);m.insert(()=>B,":first-child"),m.insert(()=>M,":first-child"),y&&m.attr("style",y)}else m.append("rect").attr("x",-l/2).attr("y",p).attr("width",l).attr("height",d).attr("rx",u).attr("ry",u).attr("style",i),m.append("circle").attr("cx",0).attr("cy",g+c).attr("r",c).attr("style",i);ee(t,m);const x=p+d/2;s.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${x-a.height/2-(a.y-(a.top??0))})`);const b=g+c,S=Math.asin(Math.min(1,(p-b)/c))*180/Math.PI,_=[...so(0,-b,c,24,180+S,-S),...so(-(-l/2+u),-(p+u),u,12,90,0),...so(-(-l/2+u),-(f/2-u),u,12,360,270),...so(-(l/2-u),-(f/2-u),u,12,270,180),...so(-(l/2-u),-(p+u),u,12,180,90)];return t.intersect=function(L){return Yt.polygon(t,_,L)},o}C(Fx,"person");var tB=C((e,t,r,i,o,a)=>[`M${e},${t+a}`,`a${o},${a} 0,0,0 ${r},0`,`a${o},${a} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${a} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createCylinderPathD"),eB=C((e,t,r,i,o,a)=>[`M${e},${t+a}`,`M${e+r},${t+a}`,`a${o},${a} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${a} 0,0,0 ${r},0`,`l0,${-i}`].join(" "),"createOuterCylinderPathD"),rB=C((e,t,r,i,o,a)=>[`M${e-r/2},${-i/2}`,`a${o},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Mg=8,Tg=8;async function $x(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?24:o,s=t.look==="neo"?24:o,n=t.width??0;if(t.width&&(t.width=t.width-s,t.width<Tg&&(t.width=Tg)),t.height){const x=n/2/(2.5+n/50);t.height=t.height-a-x*3,t.height<Mg&&(t.height=Mg)}const{shapeSvg:l,bbox:c,label:h}=await he(e,t,se(t)),d=Math.max(t.width??0,c.width)+s,u=d/2,f=u/(2.5+d/50),g=Math.max(t.height??0,c.height)+a+f;let p;const{cssStyles:m}=t;if(t.look==="handDrawn"){const y=Zt.svg(l),x=eB(0,0,d,g,u,f),b=rB(0,f,d,g,u,f),S=Gt(t,{}),T=y.path(x,S),k=y.path(b,Gt(t,{fill:"none"}));p=l.insert(()=>k,":first-child"),p=l.insert(()=>T,":first-child"),p.attr("class","basic label-container"),m&&p.attr("style",m)}else{const y=tB(0,0,d,g,u,f);p=l.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Hr(m)).attr("style",i)}return p.attr("label-offset-y",f),p.attr("transform",`translate(${-d/2}, ${-(g/2+f)})`),ee(t,p),h.attr("transform",`translate(${-(c.width/2)-(c.x-(c.left??0))}, ${-(c.height/2)+(t.padding??0)/1.5-(c.y-(c.top??0))})`),t.intersect=function(y){const x=Yt.rect(t,y),b=x.x-(t.x??0);if(u!=0&&(Math.abs(b)<(t.width??0)/2||Math.abs(b)==(t.width??0)/2&&Math.abs(x.y-(t.y??0))>(t.height??0)/2-f)){let S=f*f*(1-b*b/(u*u));S>0&&(S=Math.sqrt(S)),S=f-S,y.y-(t.y??0)>0&&(S=-S),x.y+=S}return x},l}C($x,"cylinder");async function As(e,t,r){const{labelStyles:i,nodeStyles:o}=Ut(t);t.labelStyle=i;const{shapeSvg:a,bbox:s}=await he(e,t,se(t)),n=Math.max(s.width+r.labelPaddingX*2,t?.width||0),l=Math.max(s.height+r.labelPaddingY*2,t?.height||0),c=-n/2,h=-l/2;let d,{rx:u,ry:f}=t;const{cssStyles:g}=t;if(r?.rx&&r.ry&&(u=r.rx,f=r.ry),t.look==="handDrawn"){const p=Zt.svg(a),m=Gt(t,{}),y=u||f?p.path(Mi(c,h,n,l,u||0),m):p.rectangle(c,h,n,l,m);d=a.insert(()=>y,":first-child"),d.attr("class","basic label-container").attr("style",Hr(g))}else d=a.insert("rect",":first-child"),d.attr("class","basic label-container").attr("style",o).attr("rx",Hr(u)).attr("ry",Hr(f)).attr("x",c).attr("y",h).attr("width",n).attr("height",l);return ee(t,d,t.look==="handDrawn"?void 0:{width:n,height:l}),t.calcIntersect=function(p,m){return Yt.rect(p,m)},t.intersect=function(p){return Yt.rect(t,p)},a}C(As,"drawRect");async function Ex(e,t){const{cssClasses:r,labelPaddingX:i,labelPaddingY:o,padding:a,width:s,height:n}=t,l={rx:0,ry:0,labelPaddingX:i??(a??0)*2,labelPaddingY:o??a??0},c=await As(e,t,l);if(t.look==="handDrawn"){const f=Zt.svg(c),g=Gt(t,{}),p=c.select(".basic.label-container > path:nth-child(2)"),m=p.node();if(!m)return c;let y=null;if(m instanceof SVGGraphicsElement)y=m.getBBox();else return c;return c.insert(()=>f.line(y.x,y.y,y.x+y.width,y.y,g),".basic.label-container g.label"),c.insert(()=>f.line(y.x,y.y+y.height,y.x+y.width,y.y+y.height,g),".basic.label-container g.label"),p.remove(),c}const h=c.select(".basic.label-container"),d=(Number(h.attr("width"))||s)??0,u=(Number(h.attr("height"))||n)??0;return d>0&&u>0&&h.attr("stroke-dasharray",`${d} ${u}`),c}C(Ex,"datastore");async function Px(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,a=t.look==="neo"?16:t.padding??0,{shapeSvg:s,bbox:n,label:l}=await he(e,t,se(t)),c=n.width+o,h=n.height+a,d=h*.2,u=-c/2,f=-h/2-d/2,{cssStyles:g}=t,p=Zt.svg(s),m=Gt(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:u,y:f+d},{x:-u,y:f+d},{x:-u,y:-f},{x:u,y:-f},{x:u,y:f},{x:-u,y:f},{x:-u,y:f+d}],x=p.polygon(y.map(S=>[S.x,S.y]),m),b=s.insert(()=>x,":first-child");return b.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",i),l.attr("transform",`translate(${u+(t.padding??0)/2-(n.x-(n.left??0))}, ${f+d+(t.padding??0)/2-(n.y-(n.top??0))})`),ee(t,b),t.intersect=function(S){return Yt.rect(t,S)},s}C(Px,"dividedRectangle");async function Ix(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t),o=t.look==="neo"?12:5;t.labelStyle=r;const a=t.padding??0,s=t.look==="neo"?16:a,{shapeSvg:n,bbox:l}=await he(e,t,se(t),{ignoreMinWidth:!0}),c=Math.sqrt(l.width**2+l.height**2)/2,h=(t?.width?t?.width/2:c)+(s??0),d=h+o;let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const g=Zt.svg(n),p=Gt(t,{roughness:.2,strokeWidth:2.5}),m=Gt(t,{roughness:.2,strokeWidth:1.5}),y=g.circle(0,0,d*2,p),x=g.circle(0,0,h*2,m);u=n.insert("g",":first-child"),u.attr("class",Hr(t.cssClasses)).attr("style",Hr(f)),u.node()?.appendChild(y),u.node()?.appendChild(x)}else{u=n.insert("g",":first-child");const g=u.insert("circle",":first-child"),p=u.insert("circle");u.attr("class","basic label-container").attr("style",i),g.attr("class","outer-circle").attr("style",i).attr("r",d).attr("cx",0).attr("cy",0),p.attr("class","inner-circle").attr("style",i).attr("r",h).attr("cx",0).attr("cy",0)}return ee(t,u),t.intersect=function(g){return Lt.info("DoubleCircle intersect",t,d,g),Yt.circle(t,d,g)},n}C(Ix,"doublecircle");async function Ox(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,halfPadding:s}=await he(e,t,se(t)),{theme:n,themeVariables:l}=Ge();Oi(o,t.colorIndex,n,l.borderColorArray);const c=s??10,h=a.width/2+c*2,d=a.height/2+c*2;let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const g=Zt.svg(o),p=Gt(t,{}),m=g.ellipse(0,0,h*2,d*2,p);u=o.insert(()=>m,":first-child"),u.attr("class","basic label-container"),f&&u.attr("style",f)}else u=o.insert("ellipse",":first-child").attr("class","basic label-container").attr("style",i).attr("rx",h).attr("ry",d).attr("cx",0).attr("cy",0);return t.width=h*2,t.height=d*2,ee(t,u),t.calcIntersect=function(g,p){const m=g.width/2,y=g.height/2;return Yt.ellipse(g,m,y,p)},t.intersect=function(g){return Yt.ellipse(t,h,d,g)},o}C(Ox,"usecaseEllipse");function Dx(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=Ut(t);t.label="",t.labelStyle=i;const a=e.insert("g").attr("class",se(t)).attr("id",t.domId??t.id),s=7,{cssStyles:n}=t,l=Zt.svg(a),{nodeBorder:c}=r,h=Gt(t,{fillStyle:"solid"});t.look!=="handDrawn"&&(h.roughness=0);const d=l.circle(0,0,s*2,h),u=a.insert(()=>d,":first-child");return u.selectAll("path").attr("style",`fill: ${c} !important;`),n&&n.length>0&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",n),o&&t.look!=="handDrawn"&&u.selectAll("path").attr("style",o),ee(t,u),t.intersect=function(f){return Lt.info("filledCircle intersect",t,{radius:s,point:f}),Yt.circle(t,s,f)},a}C(Dx,"filledCircle");var Bg=10,_g=10;async function Rx(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?o*2:o;(t.width||t.height)&&(t.height=t?.height??0,t.height<Bg&&(t.height=Bg),t.width=(t?.width??0)-a-a/2,t.width<_g&&(t.width=_g));const{shapeSvg:s,bbox:n,label:l}=await he(e,t,se(t)),c=(t?.width?t?.width:n.width)+(a??0),h=t?.height?t?.height:c+n.height,d=h,u=[{x:0,y:-h},{x:d,y:-h},{x:d/2,y:0}],{cssStyles:f}=t,g=Zt.svg(s),p=Gt(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const m=sr(u),y=g.path(m,p),x=s.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${h/2})`).attr("class","outer-path");return f&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",f),i&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",i),t.width=c,t.height=h,ee(t,x),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-h/2+(t.padding??0)/2+(n.y-(n.top??0))})`),t.intersect=function(b){return Lt.info("Triangle intersect",t,u,b),Yt.polygon(t,u,b)},s}C(Rx,"flippedTriangle");async function Nx(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,label:s}=await he(e,t,se(t)),n=t.padding??12,l=Math.max(a.width+n*2,t.width??0,90),c=a.height+n*2,h=Math.max(Math.min(c*.16,14),8),d=Math.max(c+h,t.height??0),u=d-h,f=Math.max(l*.38,28),g=-d/2,p=[{x:-l/2,y:g},{x:-l/2+f,y:g},{x:-l/2+f,y:g+h},{x:l/2,y:g+h},{x:l/2,y:d/2},{x:-l/2,y:d/2}],m=[`M${p[0].x},${p[0].y}`,...p.slice(1).map(S=>`L${S.x},${S.y}`),"Z"].join(" "),{cssStyles:y}=t;let x;if(t.look==="handDrawn"){const T=Zt.svg(o).path(m,Gt(t,{}));x=o.insert(()=>T,":first-child").attr("class","basic label-container"),y&&x.attr("style",y)}else x=o.insert("path",":first-child").attr("d",m).attr("class","basic label-container").attr("style",i);t.look==="handDrawn"?ee(t,x):ee(t,x,{width:l,height:d});const b=g+h+u/2;return s.attr("transform",`translate(${-(a.width/2)-(a.x-(a.left??0))}, ${b-a.height/2-(a.y-(a.top??0))})`),t.intersect=function(S){return Yt.polygon(t,p,S)},o}C(Nx,"folder");function qx(e,t,{dir:r,config:{state:i,themeVariables:o}}){const{nodeStyles:a}=Ut(t);t.label="";const s=e.insert("g").attr("class",se(t)).attr("id",t.domId??t.id),{cssStyles:n}=t;let l=Math.max(70,t?.width??0),c=Math.max(10,t?.height??0);(r==="LR"||r==="RL")&&(l=Math.max(10,t?.width??0),c=Math.max(70,t?.height??0));const h=-1*l/2,d=-1*c/2,u=Zt.svg(s),f=Gt(t,{stroke:o.lineColor,fill:o.lineColor});t.look!=="handDrawn"&&(f.roughness=0,f.fillStyle="solid");const g=u.rectangle(h,d,l,c,f),p=s.insert(()=>g,":first-child");n&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",n),a&&t.look!=="handDrawn"&&p.selectAll("path").attr("style",a),ee(t,p);const m=i?.padding??0;return t.width&&t.height&&(t.width+=m/2||0,t.height+=m/2||0),t.intersect=function(y){return Yt.rect(t,y)},s}C(qx,"forkJoin");async function Wx(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const o=15,a=10,s=t.look==="neo"?16:t.padding??0,n=t.look==="neo"?12:t.padding??0;(t.width||t.height)&&(t.height=(t?.height??0)-n*2,t.height<a&&(t.height=a),t.width=(t?.width??0)-s*2,t.width<o&&(t.width=o));const{shapeSvg:l,bbox:c}=await he(e,t,se(t)),h=(t?.height?t?.height:Math.max(a,c.height))+n*2,d=h/2,u=d-Math.sqrt(Math.max(0,d**2-(c.height/2)**2)),f=(t?.width?t?.width:Math.max(o,c.width)+u*2)+s*2,{cssStyles:g}=t,p=Zt.svg(l),m=Gt(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-f/2,y:-h/2},{x:f/2-d,y:-h/2},...so(-f/2+d,0,d,50,90,270),{x:f/2-d,y:h/2},{x:-f/2,y:h/2}],x=sr(y),b=p.path(x,m),S=l.insert(()=>b,":first-child");return S.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",g),i&&t.look!=="handDrawn"&&S.selectChildren("path").attr("style",i),ee(t,S),t.intersect=function(T){return Lt.info("Pill intersect",t,{radius:d,point:T}),Yt.polygon(t,y,T)},l}C(Wx,"halfRoundedRectangle");var iB=C((e,t,r,i,o)=>[`M${e+o},${t}`,`L${e+r-o},${t}`,`L${e+r},${t-i/2}`,`L${e+r-o},${t-i}`,`L${e+o},${t-i}`,`L${e},${t-i/2}`,"Z"].join(" "),"createHexagonPathD");async function zx(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t),o=t.look==="neo"?3.5:4;t.labelStyle=r;const a=t.padding??0,s=70,n=32,l=t.look==="neo"?s:a,c=t.look==="neo"?n:a;if(t.width||t.height){const b=(t.height??0)/o;t.width=(t?.width??0)-2*b-c,t.height=(t.height??0)-l}const{shapeSvg:h,bbox:d}=await he(e,t,se(t)),u=(t?.height?t?.height:d.height)+l,f=u/o,g=(t?.width?t?.width:d.width)+2*f+c,p=[{x:f,y:0},{x:g-f,y:0},{x:g,y:-u/2},{x:g-f,y:-u},{x:f,y:-u},{x:0,y:-u/2}];let m;const{cssStyles:y}=t;if(t.look==="handDrawn"){const x=Zt.svg(h),b=Gt(t,{}),S=iB(0,0,g,u,f),T=x.path(S,b);m=h.insert(()=>T,":first-child").attr("transform",`translate(${-g/2}, ${u/2})`),y&&m.attr("style",y)}else m=yo(h,g,u,p);return i&&m.attr("style",i),t.width=g,t.height=u,ee(t,m),t.intersect=function(x){return Yt.polygon(t,p,x)},h}C(zx,"hexagon");async function Hx(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.label="",t.labelStyle=r;const{shapeSvg:o}=await he(e,t,se(t)),a=Math.max(30,t?.width??0),s=Math.max(30,t?.height??0),{cssStyles:n}=t,l=Zt.svg(o),c=Gt(t,{});t.look!=="handDrawn"&&(c.roughness=0,c.fillStyle="solid");const h=[{x:0,y:0},{x:a,y:0},{x:0,y:s},{x:a,y:s}],d=sr(h),u=l.path(d,c),f=o.insert(()=>u,":first-child");return f.attr("class","basic label-container outer-path"),n&&t.look!=="handDrawn"&&f.selectChildren("path").attr("style",n),i&&t.look!=="handDrawn"&&f.selectChildren("path").attr("style",i),f.attr("transform",`translate(${-a/2}, ${-s/2})`),ee(t,f),t.intersect=function(g){return Lt.info("Pill intersect",t,{points:h}),Yt.polygon(t,h,g)},o}C(Hx,"hourglass");async function Yx(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=Ut(t);t.labelStyle=o;const a=t.assetHeight??48,s=t.assetWidth??48,n=Math.max(a,s),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await he(e,t,"icon-shape default"),u=t.pos==="t",f=n,g=n,{nodeBorder:p}=r,{stylesMap:m}=sa(t),y=-g/2,x=-f/2,b=t.label?8:0,S=Zt.svg(c),T=Gt(t,{stroke:"none",fill:"none"});t.look!=="handDrawn"&&(T.roughness=0,T.fillStyle="solid");const k=S.rectangle(y,x,g,f,T),_=Math.max(g,h.width),L=f+h.height+b,v=S.rectangle(-_/2,-L/2,_,L,{...T,fill:"transparent",stroke:"none"}),M=c.insert(()=>k,":first-child"),B=c.insert(()=>v);if(t.icon){const E=c.append("g");E.html(`<g>${await $a(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const O=E.node().getBBox(),$=O.width,I=O.height,F=O.x,R=O.y;E.attr("transform",`translate(${-$/2-F},${u?h.height/2+b/2-I/2-R:-h.height/2-b/2-I/2-R})`),E.attr("style",`color: ${m.get("stroke")??p};`)}return d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${u?-L/2:L/2-h.height})`),M.attr("transform",`translate(0,${u?h.height/2+b/2:-h.height/2-b/2})`),ee(t,B),t.intersect=function(E){if(Lt.info("iconSquare intersect",t,E),!t.label)return Yt.rect(t,E);const O=t.x??0,$=t.y??0,I=t.height??0;let F=[];return u?F=[{x:O-h.width/2,y:$-I/2},{x:O+h.width/2,y:$-I/2},{x:O+h.width/2,y:$-I/2+h.height+b},{x:O+g/2,y:$-I/2+h.height+b},{x:O+g/2,y:$+I/2},{x:O-g/2,y:$+I/2},{x:O-g/2,y:$-I/2+h.height+b},{x:O-h.width/2,y:$-I/2+h.height+b}]:F=[{x:O-g/2,y:$-I/2},{x:O+g/2,y:$-I/2},{x:O+g/2,y:$-I/2+f},{x:O+h.width/2,y:$-I/2+f},{x:O+h.width/2/2,y:$+I/2},{x:O-h.width/2,y:$+I/2},{x:O-h.width/2,y:$-I/2+f},{x:O-g/2,y:$-I/2+f}],Yt.polygon(t,F,E)},c}C(Yx,"icon");async function Xx(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=Ut(t);t.labelStyle=o;const a=t.assetHeight??48,s=t.assetWidth??48,n=Math.max(a,s),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,label:d}=await he(e,t,"icon-shape default"),u=20,f=t.label?8:0,g=t.pos==="t",{nodeBorder:p,mainBkg:m}=r,{stylesMap:y}=sa(t),x=Zt.svg(c),b=Gt(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const S=y.get("fill");b.stroke=S??m;const T=c.append("g");t.icon&&T.html(`<g>${await $a(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const k=T.node().getBBox(),_=k.width,L=k.height,v=k.x,M=k.y,B=Math.max(_,L)*Math.SQRT2+u*2,E=x.circle(0,0,B,b),O=Math.max(B,h.width),$=B+h.height+f,I=x.rectangle(-O/2,-$/2,O,$,{...b,fill:"transparent",stroke:"none"}),F=c.insert(()=>E,":first-child"),R=c.insert(()=>I);return T.attr("transform",`translate(${-_/2-v},${g?h.height/2+f/2-L/2-M:-h.height/2-f/2-L/2-M})`),T.attr("style",`color: ${y.get("stroke")??p};`),d.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${g?-$/2:$/2-h.height})`),F.attr("transform",`translate(0,${g?h.height/2+f/2:-h.height/2-f/2})`),ee(t,R),t.intersect=function(q){return Lt.info("iconSquare intersect",t,q),Yt.rect(t,q)},c}C(Xx,"iconCircle");async function jx(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=Ut(t);t.labelStyle=o;const a=t.assetHeight??48,s=t.assetWidth??48,n=Math.max(a,s),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:u}=await he(e,t,"icon-shape default"),f=t.pos==="t",g=n+d*2,p=n+d*2,{nodeBorder:m,mainBkg:y}=r,{stylesMap:x}=sa(t),b=-p/2,S=-g/2,T=t.label?8:0,k=Zt.svg(c),_=Gt(t,{});t.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");const L=x.get("fill");_.stroke=L??y;const v=k.path(Mi(b,S,p,g,5),_),M=Math.max(p,h.width),B=g+h.height+T,E=k.rectangle(-M/2,-B/2,M,B,{..._,fill:"transparent",stroke:"none"}),O=c.insert(()=>v,":first-child").attr("class","icon-shape2"),$=c.insert(()=>E);if(t.icon){const I=c.append("g");I.html(`<g>${await $a(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const F=I.node().getBBox(),R=F.width,q=F.height,D=F.x,P=F.y;I.attr("transform",`translate(${-R/2-D},${f?h.height/2+T/2-q/2-P:-h.height/2-T/2-q/2-P})`),I.attr("style",`color: ${x.get("stroke")??m};`)}return u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-B/2:B/2-h.height})`),O.attr("transform",`translate(0,${f?h.height/2+T/2:-h.height/2-T/2})`),ee(t,$),t.intersect=function(I){if(Lt.info("iconSquare intersect",t,I),!t.label)return Yt.rect(t,I);const F=t.x??0,R=t.y??0,q=t.height??0;let D=[];return f?D=[{x:F-h.width/2,y:R-q/2},{x:F+h.width/2,y:R-q/2},{x:F+h.width/2,y:R-q/2+h.height+T},{x:F+p/2,y:R-q/2+h.height+T},{x:F+p/2,y:R+q/2},{x:F-p/2,y:R+q/2},{x:F-p/2,y:R-q/2+h.height+T},{x:F-h.width/2,y:R-q/2+h.height+T}]:D=[{x:F-p/2,y:R-q/2},{x:F+p/2,y:R-q/2},{x:F+p/2,y:R-q/2+g},{x:F+h.width/2,y:R-q/2+g},{x:F+h.width/2/2,y:R+q/2},{x:F-h.width/2,y:R+q/2},{x:F-h.width/2,y:R-q/2+g},{x:F-p/2,y:R-q/2+g}],Yt.polygon(t,D,I)},c}C(jx,"iconRounded");async function Gx(e,t,{config:{themeVariables:r,flowchart:i}}){const{labelStyles:o}=Ut(t);t.labelStyle=o;const a=t.assetHeight??48,s=t.assetWidth??48,n=Math.max(a,s),l=i?.wrappingWidth;t.width=Math.max(n,l??0);const{shapeSvg:c,bbox:h,halfPadding:d,label:u}=await he(e,t,"icon-shape default"),f=t.pos==="t",g=n+d*2,p=n+d*2,{nodeBorder:m,mainBkg:y}=r,{stylesMap:x}=sa(t),b=-p/2,S=-g/2,T=t.label?8:0,k=Zt.svg(c),_=Gt(t,{});t.look!=="handDrawn"&&(_.roughness=0,_.fillStyle="solid");const L=x.get("fill");_.stroke=L??y;const v=k.path(Mi(b,S,p,g,.1),_),M=Math.max(p,h.width),B=g+h.height+T,E=k.rectangle(-M/2,-B/2,M,B,{..._,fill:"transparent",stroke:"none"}),O=c.insert(()=>v,":first-child"),$=c.insert(()=>E);if(t.icon){const I=c.append("g");I.html(`<g>${await $a(t.icon,{height:n,width:n,fallbackPrefix:""})}</g>`);const F=I.node().getBBox(),R=F.width,q=F.height,D=F.x,P=F.y;I.attr("transform",`translate(${-R/2-D},${f?h.height/2+T/2-q/2-P:-h.height/2-T/2-q/2-P})`),I.attr("style",`color: ${x.get("stroke")??m};`)}return u.attr("transform",`translate(${-h.width/2-(h.x-(h.left??0))},${f?-B/2:B/2-h.height})`),O.attr("transform",`translate(0,${f?h.height/2+T/2:-h.height/2-T/2})`),ee(t,$),t.intersect=function(I){if(Lt.info("iconSquare intersect",t,I),!t.label)return Yt.rect(t,I);const F=t.x??0,R=t.y??0,q=t.height??0;let D=[];return f?D=[{x:F-h.width/2,y:R-q/2},{x:F+h.width/2,y:R-q/2},{x:F+h.width/2,y:R-q/2+h.height+T},{x:F+p/2,y:R-q/2+h.height+T},{x:F+p/2,y:R+q/2},{x:F-p/2,y:R+q/2},{x:F-p/2,y:R-q/2+h.height+T},{x:F-h.width/2,y:R-q/2+h.height+T}]:D=[{x:F-p/2,y:R-q/2},{x:F+p/2,y:R-q/2},{x:F+p/2,y:R-q/2+g},{x:F+h.width/2,y:R-q/2+g},{x:F+h.width/2/2,y:R+q/2},{x:F-h.width/2,y:R+q/2},{x:F-h.width/2,y:R-q/2+g},{x:F-p/2,y:R-q/2+g}],Yt.polygon(t,D,I)},c}C(Gx,"iconSquare");async function Ux(e,t,{config:{flowchart:r}}){const i=new Image;i.src=t?.img??"",await i.decode();const o=Number(i.naturalWidth.toString().replace("px","")),a=Number(i.naturalHeight.toString().replace("px",""));t.imageAspectRatio=o/a;const{labelStyles:s}=Ut(t);t.labelStyle=s;const n=r?.wrappingWidth;t.defaultWidth=r?.wrappingWidth;const l=Math.max(t.label?n??0:0,t?.assetWidth??o),c=t.constraint==="on"&&t?.assetHeight?t.assetHeight*t.imageAspectRatio:l,h=t.constraint==="on"?c/t.imageAspectRatio:t?.assetHeight??a;t.width=Math.max(c,n??0);const{shapeSvg:d,bbox:u,label:f}=await he(e,t,"image-shape default"),g=t.pos==="t",p=-c/2,m=-h/2,y=t.label?8:0,x=Zt.svg(d),b=Gt(t,{});t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const S=x.rectangle(p,m,c,h,b),T=Math.max(c,u.width),k=h+u.height+y,_=x.rectangle(-T/2,-k/2,T,k,{...b,fill:"none",stroke:"none"}),L=d.insert(()=>S,":first-child"),v=d.insert(()=>_);if(t.img){const M=d.append("image");M.attr("href",t.img),M.attr("width",c),M.attr("height",h),M.attr("preserveAspectRatio","none"),M.attr("transform",`translate(${-c/2},${g?k/2-h:-k/2})`)}return f.attr("transform",`translate(${-u.width/2-(u.x-(u.left??0))},${g?-h/2-u.height/2-y/2:h/2-u.height/2+y/2})`),L.attr("transform",`translate(0,${g?u.height/2+y/2:-u.height/2-y/2})`),ee(t,v),t.intersect=function(M){if(Lt.info("iconSquare intersect",t,M),!t.label)return Yt.rect(t,M);const B=t.x??0,E=t.y??0,O=t.height??0;let $=[];return g?$=[{x:B-u.width/2,y:E-O/2},{x:B+u.width/2,y:E-O/2},{x:B+u.width/2,y:E-O/2+u.height+y},{x:B+c/2,y:E-O/2+u.height+y},{x:B+c/2,y:E+O/2},{x:B-c/2,y:E+O/2},{x:B-c/2,y:E-O/2+u.height+y},{x:B-u.width/2,y:E-O/2+u.height+y}]:$=[{x:B-c/2,y:E-O/2},{x:B+c/2,y:E-O/2},{x:B+c/2,y:E-O/2+h},{x:B+u.width/2,y:E-O/2+h},{x:B+u.width/2/2,y:E+O/2},{x:B-u.width/2,y:E+O/2},{x:B-u.width/2,y:E-O/2+h},{x:B-c/2,y:E-O/2+h}],Yt.polygon(t,$,M)},d}C(Ux,"imageSquare");async function Vx(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const o=t.padding??0,a=o,s=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await he(e,t,se(t)),c=Math.max(l.height+a*2,t.height??0),h=Math.max(l.width+s*2,(t.width??0)-c),d=[{x:0,y:0},{x:h,y:0},{x:h+3*c/6,y:-c},{x:-3*c/6,y:-c}];let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const g=Zt.svg(n),p=Gt(t,{}),m=sr(d),y=g.path(m,p);u=n.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),f&&u.attr("style",f)}else u=yo(n,h,c,d);return i&&u.attr("style",i),t.width=h,t.height=c,ee(t,u),t.intersect=function(g){return Yt.polygon(t,d,g)},n}C(Vx,"inv_trapezoid");async function Zx(e,t){const{shapeSvg:r,bbox:i,label:o}=await he(e,t,"label"),a=r.insert("rect",":first-child");return a.attr("width",.1).attr("height",.1),r.attr("class","label edgeLabel"),o.attr("transform",`translate(${-(i.width/2)-(i.x-(i.left??0))}, ${-(i.height/2)-(i.y-(i.top??0))})`),ee(t,a),t.intersect=function(l){return Yt.rect(t,l)},r}C(Zx,"labelRect");async function Kx(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const o=t.padding??0,a=o,s=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await he(e,t,se(t)),c=Math.max(l.height+a,t.height??0),h=Math.max(l.width+s,(t.width??0)-c),d=[{x:0,y:0},{x:h+3*c/6,y:0},{x:h,y:-c},{x:-(3*c)/6,y:-c}];let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const g=Zt.svg(n),p=Gt(t,{}),m=sr(d),y=g.path(m,p);u=n.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),f&&u.attr("style",f)}else u=yo(n,h,c,d);return i&&u.attr("style",i),t.width=h,t.height=c,ee(t,u),t.intersect=function(g){return Yt.polygon(t,d,g)},n}C(Kx,"lean_left");async function Qx(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const o=t.padding??0,a=o,s=t.look==="neo"?o*2:o,{shapeSvg:n,bbox:l}=await he(e,t,se(t)),c=Math.max(l.height+a,t.height??0),h=Math.max(l.width+s,(t.width??0)-c),d=[{x:-3*c/6,y:0},{x:h,y:0},{x:h+3*c/6,y:-c},{x:0,y:-c}];let u;const{cssStyles:f}=t;if(t.look==="handDrawn"){const g=Zt.svg(n),p=Gt(t,{}),m=sr(d),y=g.path(m,p);u=n.insert(()=>y,":first-child").attr("transform",`translate(${-h/2}, ${c/2})`),f&&u.attr("style",f)}else u=yo(n,h,c,d);return i&&u.attr("style",i),t.width=h,t.height=c,ee(t,u),t.intersect=function(g){return Yt.polygon(t,d,g)},n}C(Qx,"lean_right");function Jx(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.label="",t.labelStyle=r;const o=e.insert("g").attr("class",se(t)).attr("id",t.domId??t.id),{cssStyles:a}=t,s=Math.max(35,t?.width??0),n=Math.max(35,t?.height??0),l=7,c=[{x:s,y:0},{x:0,y:n+l/2},{x:s-2*l,y:n+l/2},{x:0,y:2*n},{x:s,y:n-l/2},{x:2*l,y:n-l/2}],h=Zt.svg(o),d=Gt(t,{});t.look!=="handDrawn"&&(d.roughness=0,d.fillStyle="solid");const u=sr(c),f=h.path(u,d),g=o.insert(()=>f,":first-child");return g.attr("class","outer-path"),a&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",a),i&&t.look!=="handDrawn"&&g.selectAll("path").attr("style",i),g.attr("transform",`translate(-${s/2},${-n})`),ee(t,g),t.intersect=function(p){return Lt.info("lightningBolt intersect",t,p),Yt.polygon(t,c,p)},o}C(Jx,"lightningBolt");var oB=C((e,t,r,i,o,a,s)=>[`M${e},${t+a}`,`a${o},${a} 0,0,0 ${r},0`,`a${o},${a} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${a} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+a+s}`,`a${o},${a} 0,0,0 ${r},0`].join(" "),"createCylinderPathD"),aB=C((e,t,r,i,o,a,s)=>[`M${e},${t+a}`,`M${e+r},${t+a}`,`a${o},${a} 0,0,0 ${-r},0`,`l0,${i}`,`a${o},${a} 0,0,0 ${r},0`,`l0,${-i}`,`M${e},${t+a+s}`,`a${o},${a} 0,0,0 ${r},0`].join(" "),"createOuterCylinderPathD"),sB=C((e,t,r,i,o,a)=>[`M${e-r/2},${-i/2}`,`a${o},${a} 0,0,0 ${r},0`].join(" "),"createInnerCylinderPathD"),Lg=10,Ag=10;async function t0(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?16:o,s=t.look==="neo"?24:o;if(t.width||t.height){const y=t.width??0;t.width=(t.width??0)-a,t.width<Ag&&(t.width=Ag);const b=y/2/(2.5+y/50);t.height=(t.height??0)-s-b*3,t.height<Lg&&(t.height=Lg)}const{shapeSvg:n,bbox:l,label:c}=await he(e,t,se(t)),h=(t?.width?t?.width:l.width)+a*2,d=h/2,u=d/(2.5+h/50),f=(t?.height?t?.height:l.height)+u+s*2,g=f*.1;let p;const{cssStyles:m}=t;if(t.look==="handDrawn"){const y=Zt.svg(n),x=aB(0,0,h,f,d,u,g),b=sB(0,u,h,f,d,u),S=Gt(t,{}),T=y.path(x,S),k=y.path(b,S);n.insert(()=>k,":first-child").attr("class","line"),p=n.insert(()=>T,":first-child"),p.attr("class","basic label-container"),m&&p.attr("style",m)}else{const y=oB(0,0,h,f,d,u,g);p=n.insert("path",":first-child").attr("d",y).attr("class","basic label-container outer-path").attr("style",Hr(m)).attr("style",i)}return p.attr("label-offset-y",u),p.attr("transform",`translate(${-h/2}, ${-(f/2+u)})`),ee(t,p),c.attr("transform",`translate(${-(l.width/2)-(l.x-(l.left??0))}, ${-(l.height/2)+u-(l.y-(l.top??0))})`),t.intersect=function(y){const x=Yt.rect(t,y),b=x.x-(t.x??0);if(d!=0&&(Math.abs(b)<(t.width??0)/2||Math.abs(b)==(t.width??0)/2&&Math.abs(x.y-(t.y??0))>(t.height??0)/2-u)){let S=u*u*(1-b*b/(d*d));S>0&&(S=Math.sqrt(S)),S=u-S,y.y-(t.y??0)>0&&(S=-S),x.y+=S}return x},n}C(t0,"linedCylinder");async function e0(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?16:o,s=t.look==="neo"?12:o;if(t.width||t.height){const S=t.width;t.width=(S??0)*10/11-a*2,t.width<10&&(t.width=10),t.height=(t?.height??0)-s*2,t.height<10&&(t.height=10)}const{shapeSvg:n,bbox:l,label:c}=await he(e,t,se(t)),h=(t?.width?t?.width:l.width)+(a??0)*2,d=(t?.height?t?.height:l.height)+(s??0)*2,u=t.look==="neo"?d/4:d/8,f=d+u,{cssStyles:g}=t,p=Zt.svg(n),m=Gt(t,{});t.look!=="handDrawn"&&(m.roughness=0,m.fillStyle="solid");const y=[{x:-h/2-h/2*.1,y:-f/2},{x:-h/2-h/2*.1,y:f/2},...ia(-h/2-h/2*.1,f/2,h/2+h/2*.1,f/2,u,.8),{x:h/2+h/2*.1,y:-f/2},{x:-h/2-h/2*.1,y:-f/2},{x:-h/2,y:-f/2},{x:-h/2,y:f/2*1.1},{x:-h/2,y:-f/2}],x=p.polygon(y.map(S=>[S.x,S.y]),m),b=n.insert(()=>x,":first-child");return b.attr("class","basic label-container outer-path"),g&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",g),i&&t.look!=="handDrawn"&&b.selectAll("path").attr("style",i),b.attr("transform",`translate(0,${-u/2})`),c.attr("transform",`translate(${-h/2+(t.padding??0)+h/2*.1/2-(l.x-(l.left??0))},${-d/2+(t.padding??0)-u-(l.y-(l.top??0))})`),ee(t,b),t.intersect=function(S){return Yt.polygon(t,y,S)},n}C(e0,"linedWaveEdgedRect");var nB=56,oh=72,Fg=8,$g=2,lB=8,cB={normal:"usecase-actor-shape usecase-actor-normal",hollow:"usecase-actor-hollow",awesome:"usecase-actor-awesome",icon:"usecase-actor-icon"},Eg=Math.PI/3,Pg=.6,ah=C((e,t)=>{const r=t*Pg,i=t*Math.sqrt(1-Pg**2),o=Math.cos(Eg),a=-Math.sin(Eg),s=r*-a,n=e+r*o,l=i*o,c=i*a;return`M ${s-l} ${n-c} L ${s+l} ${n+c}`},"businessMarkerPathForCircle"),hB={normal:ah(-24,12),hollow:ah(-23,9),awesome:ah(-21,13),icon:"M 12 -8 L 26 -26"},Ig=C((e,t,r)=>{const i=(t.x??0)-(t.left??0),o=(t.y??0)-(t.top??0);e.attr("transform",`translate(${-t.width/2-i},${r-t.height/2-o})`)},"positionLabel"),xu=C((e,t,r,i,o=!1)=>{if(t.look==="handDrawn"){const n=Zt.svg(e).path(r,Gt(t,o?{fill:"none"}:{}));return e.insert(()=>n,":first-child").attr("class",i)}const a=e.append("path").attr("class",i).attr("d",r);return o&&a.attr("fill","none"),a},"appendActorPath"),dB=C((e,t,r,i,o,a,s=!1)=>{if(t.look==="handDrawn"){const c=Zt.svg(e).circle(r,i,o*2,Gt(t,s?{fill:"none"}:{}));return e.insert(()=>c,":first-child").attr("class",a)}const n=e.append("circle").attr("class",a).attr("cx",r).attr("cy",i).attr("r",o);return s&&n.attr("fill","none"),n},"appendActorCircle"),uB=C((e,t,r)=>{t.business&&e.append("path").attr("class","usecase-business-marker usecase-actor-business-marker").attr("d",hB[r]).attr("fill","none").attr("style","stroke: inherit !important; stroke-width: inherit !important")},"appendBusinessActorMarker");async function Bn(e,t,r,i){const{labelStyles:o,nodeStyles:a}=Ut(t);t.labelStyle=o;const s=r==="icon"||t.stereotype!==void 0?{...t,icon:r==="icon"?void 0:t.icon,stereotype:void 0}:t,{shapeSvg:n,bbox:l,label:c}=await he(e,s,se(t,`usecase-actor-variant usecase-actor-${r}`)),h=t.accessibleName??t.label;h&&n.attr("role","img").attr("aria-label",h),c.attr("class","label actor-label usecase-actor-label");const{theme:d,themeVariables:u}=Ge();Oi(n,t.colorIndex,d,u.borderColorArray);let f,g;if(t.stereotype){const L=await ka(n,`«${t.stereotype}»`,{labelStyle:o,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});f=L.label.attr("class","label usecase-stereotype"),g=L.bbox}const p=n.append("g").attr("class",`usecase-actor-glyph ${cB[r]}`).attr("style",a||null);await i(p,t),uB(p,t,r);const m=t.padding??lB,y=g?.height??0,x=oh+Fg+l.height+(g?y+$g:0),b=Math.max(nB,l.width,g?.width??0)+m*2,S=x+m*2,T=-x/2;p.attr("transform",`translate(0,${T+oh/2})`);let k=T+oh+Fg;f&&g&&(k+=y/2,Ig(f,g,k),k+=y/2+$g),Ig(c,l,k+l.height/2);const _=n.insert("rect",":first-child").attr("class","usecase-actor-outline").attr("x",-b/2).attr("y",-S/2).attr("width",b).attr("height",S).attr("opacity",0).attr("aria-hidden","true");return ee(t,_),t.intersect=L=>Yt.rect(t,L),n}C(Bn,"renderUsecaseActor");var fB=["M 0 -12","C 6.627 -12 12 -17.373 12 -24","C 12 -30.627 6.627 -36 0 -36","C -6.627 -36 -12 -30.627 -12 -24","C -12 -17.373 -6.627 -12 0 -12 Z","M 0 -12 V 8","M -17 -5 H 17","M 0 8 L -15 28","M 0 8 L 15 28"].join(" ");async function r0(e,t){return Bn(e,t,"normal",(r,i)=>{xu(r,i,fB,"usecase-actor-stick")})}C(r0,"usecaseActor");var gB=["M 0 -34","C 7.18 -34 13 -28.18 13 -21","C 13 -13.82 7.18 -8 0 -8","C -7.18 -8 -13 -13.82 -13 -21","C -13 -28.18 -7.18 -34 0 -34 Z","M -24 25","C -24 7 -14 -3 0 -3","C 14 -3 24 7 24 25","C 24 28 21 30 18 30","H -18","C -21 30 -24 28 -24 25 Z"].join(" ");async function i0(e,t){return Bn(e,t,"awesome",(r,i)=>{xu(r,i,gB,"usecase-actor-awesome-silhouette")})}C(i0,"usecaseActorAwesome");var pB=["M -22 -10","H 22","V 0","H 6","L 22 17","L 13 28","L 0 13","L -13 28","L -22 17","L -6 0","H -22","Z"].join(" ");async function o0(e,t){return Bn(e,t,"hollow",(r,i)=>{dB(r,i,0,-23,9,"usecase-actor-hollow-head",!0),xu(r,i,pB,"usecase-actor-hollow-body",!0)})}C(o0,"usecaseActorHollow");var Na=52,Og=42,Dg=-2,mB=C(async(e,t)=>{const r=-Na/2,i=Dg-Na/2;if(t.look==="handDrawn"){const h=Zt.svg(e).rectangle(r,i,Na,Na,Gt(t,{}));e.insert(()=>h,":first-child").attr("class","usecase-actor-icon-frame")}else e.append("rect").attr("class","usecase-actor-icon-frame").attr("x",r).attr("y",i).attr("width",Na).attr("height",Na).attr("rx",4).attr("ry",4);const o=t.icon??"",a=await xm(o.includes(":")?o:`fa:${o}`),s=await $a(o,{height:Og,width:Og,fallbackPrefix:"fa"}),n=e.append("g").attr("class",`usecase-actor-icon-symbol${a?"":" usecase-actor-icon-fallback"}`).attr("aria-hidden","true").html(`<g>${s}</g>`),l=n.node()?.getBBox();l&&n.attr("transform",`translate(${-l.width/2-l.x},${Dg-l.height/2-l.y})`)},"drawIconActor");async function a0(e,t){return Bn(e,t,"icon",mB)}C(a0,"usecaseActorIcon");var Rg=C((e,t,r)=>{const i=(t.x??0)-(t.left??0),o=(t.y??0)-(t.top??0);e.attr("transform",`translate(${-t.width/2-i},${r-t.height/2-o})`)},"positionLabel");async function s0(e,t){const r=t,{labelStyles:i,nodeStyles:o}=Ut(t);t.labelStyle=i;const a=r.stereotype?{...t,stereotype:void 0}:t,{shapeSvg:s,bbox:n,halfPadding:l,label:c}=await he(e,a,se(t,"usecase-business-shape"));c.attr("class","label usecase-label");const{theme:h,themeVariables:d}=Ge();Oi(s,t.colorIndex,h,d.borderColorArray);let u,f;if(r.stereotype){const O=await ka(s,`«${r.stereotype}»`,{labelStyle:i,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0,width:t.wrappingWidth});u=O.label.attr("class","label usecase-stereotype"),f=O.bbox}const g=f?2:0,p=n.height+(f?.height??0)+g,m=Math.max(n.width,f?.width??0),y=l??10,x=m/2+y*2,b=p/2+y*2,S=Math.min(Math.max(y/5,1),y/2),T=m/2+S,k=x-S,_=T/x,L=k/x,v=b*Math.sqrt(Math.max(0,1-_*_)),M=-b*Math.sqrt(Math.max(0,1-L*L));u&&f&&Rg(u,f,-p/2+f.height/2),Rg(c,n,p/2-n.height/2);let B;if(t.look==="handDrawn"){const $=Zt.svg(s).ellipse(0,0,x*2,b*2,Gt(t,{}));B=s.insert(()=>$,":first-child").attr("class","basic label-container usecase-business-ellipse")}else B=s.insert("ellipse",":first-child").attr("class","basic label-container usecase-business-ellipse").attr("style",o).attr("rx",x).attr("ry",b).attr("cx",0).attr("cy",0);s.append("path").attr("class","usecase-business-marker").attr("d",`M ${T} ${v} L ${k} ${M}`).attr("fill","none").attr("style",o||null);const E=r.accessibleName??r.label;return E&&s.attr("role","img").attr("aria-label",E),ee(t,B),t.calcIntersect=(O,$)=>Yt.ellipse(O,O.width/2,O.height/2,$),t.intersect=O=>Yt.ellipse(t,x,b,O),s}C(s0,"usecaseBusiness");var sh=8,Ng=4,yB=1,nh=C((e,t,r,i)=>{const o=(t.x??0)-(t.left??0),a=(t.y??0)-(t.top??0);e.attr("transform",`translate(${r-t.width/2-o},${i-t.height/2-a})`)},"positionLabel"),xB=C(e=>{const t=Number.parseFloat(e??"");return Number.isFinite(t)&&t>=0?t:yB},"numericStrokeWidth");async function n0(e,t){const r=t,{labelStyles:i,nodeStyles:o}=Ut(t),{stylesMap:a}=sa(t);t.labelStyle=i;const{shapeSvg:s,bbox:n,label:l}=await he(e,t,se(t,"usecase-json-table"));s.attr("role","img"),r.accessibleName&&s.attr("aria-label",r.accessibleName),l.attr("class","label usecase-json-title");const c=s.append("g").attr("class","usecase-json-table-grid"),h=[];for(const O of r.jsonRows??[]){const $=await ka(c,O.key,{labelStyle:i,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0}),I=await ka(c,O.value,{labelStyle:i,useHtmlLabels:t.useHtmlLabels,padding:0,centerLabel:!0});h.push({key:{label:$.label.attr("class","label usecase-json-key"),bbox:$.bbox},value:{label:I.label.attr("class","label usecase-json-value"),bbox:I.bbox}})}const d=Math.max(0,...h.map(({key:O})=>O.bbox.width))+sh*2,u=Math.max(0,...h.map(({value:O})=>O.bbox.width))+sh*2,f=n.width+sh*2,g=Math.max(f,d+u),p=u+Math.max(0,g-d-u),m=n.height+Ng*2,y=h.map(({key:O,value:$})=>Math.max(O.bbox.height,$.bbox.height)+Ng*2),x=m+y.reduce((O,$)=>O+$,0),b=xB(a.get("stroke-width")),S=g+b*2,T=x+b*2,k=-g/2,_=-x/2,L=t.look==="handDrawn"?Zt.svg(s):void 0,v=L?Gt(t,{}):void 0,M=C((O,$,I,F,R,q)=>{if(L&&v){const D=L.rectangle(I,F,R,q,v);return O.insert(()=>D,":first-child").attr("class",$)}return O.insert("rect",":first-child").attr("class",$).attr("x",I).attr("y",F).attr("width",R).attr("height",q).attr("style",o)},"insertCell"),B=M(s,"label-container usecase-json-border",-S/2,-T/2,S,T);M(c,"usecase-json-cell usecase-json-title-cell",k,_,g,m),c.node()?.append(l.node()),nh(l,n,0,_+m/2);let E=_+m;return h.forEach(({key:O,value:$},I)=>{const F=y[I],R=c.append("g").attr("class","usecase-json-row").attr("data-row-index",I).attr("transform",`translate(0,${E})`);M(R,"usecase-json-cell usecase-json-key-cell",k,0,d,F),M(R,"usecase-json-cell usecase-json-value-cell",k+d,0,p,F),R.node()?.append(O.label.node(),$.label.node()),nh(O.label,O.bbox,k+d/2,F/2),nh($.label,$.bbox,k+d+p/2,F/2),E+=F}),ee(t,B),t.intersect=O=>Yt.rect(t,O),s}C(n0,"usecaseJsonTable");async function l0(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?16:o,s=t.look==="neo"?12:o,n=t.look==="neo"?10:5;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2-2*n,10),t.height=Math.max((t?.height??0)-s*2-2*n,10));const{shapeSvg:l,bbox:c,label:h}=await he(e,t,se(t)),d=(t?.width?t?.width:c.width)+a*2+2*n,u=(t?.height?t?.height:c.height)+s*2+2*n,f=d-2*n,g=u-2*n,p=-f/2,m=-g/2,{cssStyles:y}=t,x=Zt.svg(l),b=Gt(t,{}),S=[{x:p-n,y:m+n},{x:p-n,y:m+g+n},{x:p+f-n,y:m+g+n},{x:p+f-n,y:m+g},{x:p+f,y:m+g},{x:p+f,y:m+g-n},{x:p+f+n,y:m+g-n},{x:p+f+n,y:m-n},{x:p+n,y:m-n},{x:p+n,y:m},{x:p,y:m},{x:p,y:m+n}],T=[{x:p,y:m+n},{x:p+f-n,y:m+n},{x:p+f-n,y:m+g},{x:p+f,y:m+g},{x:p+f,y:m},{x:p,y:m}];t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const k=sr(S);let _=x.path(k,b);const L=sr(T);let v=x.path(L,b);t.look!=="handDrawn"&&(_=Uh(_),v=Uh(v));const M=l.insert("g",":first-child");return M.insert(()=>_),M.insert(()=>v),M.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",i),h.attr("transform",`translate(${-(c.width/2)-n-(c.x-(c.left??0))}, ${-(c.height/2)+n-(c.y-(c.top??0))})`),ee(t,M),t.intersect=function(B){return Yt.polygon(t,S,B)},l}C(l0,"multiRect");async function c0(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,label:s}=await he(e,t,se(t)),n=t.padding??0,l=t.look==="neo"?16:n,c=t.look==="neo"?12:n;let h=!0;(t.width||t.height)&&(h=!1,t.width=(t?.width??0)-l*2,t.height=(t?.height??0)-c*3);const d=Math.max(a.width,t?.width??0)+l*2,u=Math.max(a.height,t?.height??0)+c*3,f=t.look==="neo"?u/4:u/8,g=u+(h?f/2:-f/2),p=-d/2,m=-g/2,y=10,{cssStyles:x}=t,b=ia(p-y,m+g+y,p+d-y,m+g+y,f,.8),S=b?.[b.length-1],T=[{x:p-y,y:m+y},{x:p-y,y:m+g+y},...b,{x:p+d-y,y:S.y-y},{x:p+d,y:S.y-y},{x:p+d,y:S.y-2*y},{x:p+d+y,y:S.y-2*y},{x:p+d+y,y:m-y},{x:p+y,y:m-y},{x:p+y,y:m},{x:p,y:m},{x:p,y:m+y}],k=[{x:p,y:m+y},{x:p+d-y,y:m+y},{x:p+d-y,y:S.y-y},{x:p+d,y:S.y-y},{x:p+d,y:m},{x:p,y:m}],_=Zt.svg(o),L=Gt(t,{});t.look!=="handDrawn"&&(L.roughness=0,L.fillStyle="solid");const v=sr(T),M=_.path(v,L),B=sr(k),E=_.path(B,L),O=o.insert(()=>M,":first-child");return O.insert(()=>E),O.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&O.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&O.selectAll("path").attr("style",i),O.attr("transform",`translate(0,${-f/2})`),s.attr("transform",`translate(${-(a.width/2)-y-(a.x-(a.left??0))}, ${-(a.height/2)+y-f-(a.y-(a.top??0))})`),ee(t,O),t.intersect=function($){return Yt.polygon(t,T,$)},o}C(c0,"multiWaveEdgedRectangle");async function h0(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=Ut(t);t.labelStyle=i,t.useHtmlLabels||Zr(Ar())||(t.centerLabel=!0);const{shapeSvg:s,bbox:n,label:l}=await he(e,t,se(t)),c=Math.max(n.width+(t.padding??0)*2,t?.width??0),h=Math.max(n.height+(t.padding??0)*2,t?.height??0),d=-c/2,u=-h/2,{cssStyles:f}=t,g=Zt.svg(s),p=Gt(t,{fill:r.noteBkgColor,stroke:r.noteBorderColor});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const m=g.rectangle(d,u,c,h,p),y=s.insert(()=>m,":first-child");return y.attr("class","basic label-container outer-path"),l.attr("class","label noteLabel"),f&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",f),o&&t.look!=="handDrawn"&&y.selectAll("path").attr("style",o),l.attr("transform",`translate(${-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),ee(t,y),t.intersect=function(x){return Yt.rect(t,x)},s}C(h0,"note");var bB=C((e,t,r)=>[`M${e+r/2},${t}`,`L${e+r},${t-r/2}`,`L${e+r/2},${t-r}`,`L${e},${t-r/2}`,"Z"].join(" "),"createDecisionBoxPathD");async function d0(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const{shapeSvg:o,bbox:a}=await he(e,t,se(t)),s=a.width+(t.padding??0),n=a.height+(t.padding??0),l=s+n,c=.5,h=[{x:l/2,y:0},{x:l,y:-l/2},{x:l/2,y:-l},{x:0,y:-l/2}];let d;const{cssStyles:u}=t;if(t.look==="handDrawn"){const f=Zt.svg(o),g=Gt(t,{}),p=bB(0,0,l),m=f.path(p,g);d=o.insert(()=>m,":first-child").attr("transform",`translate(${-l/2+c}, ${l/2})`),u&&d.attr("style",u)}else d=yo(o,l,l,h),d.attr("transform",`translate(${-l/2+c}, ${l/2})`);return i&&d.attr("style",i),ee(t,d),t.calcIntersect=function(f,g){const p=f.width,m=[{x:p/2,y:0},{x:p,y:-p/2},{x:p/2,y:-p},{x:0,y:-p/2}];return Yt.polygon(f,m,g)},t.intersect=function(f){return this.calcIntersect(t,f)},o}C(d0,"question");async function u0(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?21:o??0,s=t.look==="neo"?12:o??0,{shapeSvg:n,bbox:l,label:c}=await he(e,t,se(t)),h=l.width+(t.look==="neo"?a*2:a),d=Math.max(l.height+(t.look==="neo"?s*2:s),t.height??0),u=d/4,g=-Math.max(h,(t.width??0)-u)/2,p=-d/2,m=p/2,y=[{x:g+m,y:p},{x:g,y:0},{x:g+m,y:-p},{x:-g,y:-p},{x:-g,y:p}],{cssStyles:x}=t,b=Zt.svg(n),S=Gt(t,{});t.look!=="handDrawn"&&(S.roughness=0,S.fillStyle="solid");const T=sr(y),k=b.path(T,S),_=n.insert(()=>k,":first-child");return _.attr("class","basic label-container outer-path"),x&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",x),i&&t.look!=="handDrawn"&&_.selectAll("path").attr("style",i),_.attr("transform",`translate(${-m/2},0)`),c.attr("transform",`translate(${-m/2-l.width/2-(l.x-(l.left??0))}, ${-(l.height/2)-(l.y-(l.top??0))})`),ee(t,_),t.intersect=function(L){return Yt.polygon(t,y,L)},n}C(u0,"rect_left_inv_arrow");async function f0(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;let o;t.cssClasses?o="node "+t.cssClasses:o="node default";const a=e.insert("g").attr("class",o).attr("id",t.domId||t.id),s=a.insert("g"),n=a.insert("g").attr("class","label").attr("style",i),l=t.description,c=t.label,h=await Lo(n,c,t.labelStyle,!0,!0);let d={width:0,height:0};if(Zr(Ge())){const L=h.children[0],v=Ye(h);d=L.getBoundingClientRect(),v.attr("width",d.width),v.attr("height",d.height)}Lt.info("Text 2",l);const u=l||[],f=h.getBBox(),g=await Lo(n,Array.isArray(u)?u.join("<br/>"):u,t.labelStyle,!0,!0),p=g.children[0],m=Ye(g);d=p.getBoundingClientRect(),m.attr("width",d.width),m.attr("height",d.height);const y=(t.padding||0)/2;Ye(g).attr("transform","translate( "+(d.width>f.width?0:(f.width-d.width)/2)+", "+(f.height+y+5)+")"),Ye(h).attr("transform","translate( "+(d.width<f.width?0:-(f.width-d.width)/2)+", 0)"),d=n.node().getBBox(),n.attr("transform","translate("+-d.width/2+", "+(-d.height/2-y+3)+")");const x=d.width+(t.padding||0),b=d.height+(t.padding||0),S=-d.width/2-y,T=-d.height/2-y;let k,_;if(t.look==="handDrawn"){const L=Zt.svg(a),v=Gt(t,{}),M=L.path(Mi(S,T,x,b,t.rx||0),v),B=L.line(-d.width/2-y,-d.height/2-y+f.height+y,d.width/2+y,-d.height/2-y+f.height+y,v);_=a.insert(()=>(Lt.debug("Rough node insert CXC",M),B),":first-child"),k=a.insert(()=>(Lt.debug("Rough node insert CXC",M),M),":first-child")}else k=s.insert("rect",":first-child"),_=s.insert("line"),k.attr("class","outer title-state").attr("style",i).attr("x",-d.width/2-y).attr("y",-d.height/2-y).attr("width",d.width+(t.padding||0)).attr("height",d.height+(t.padding||0)),_.attr("class","divider").attr("x1",-d.width/2-y).attr("x2",d.width/2+y).attr("y1",-d.height/2-y+f.height+y).attr("y2",-d.height/2-y+f.height+y);return ee(t,k),t.intersect=function(L){return Yt.rect(t,L)},a}C(f0,"rectWithTitle");async function g0(e,t,{config:{themeVariables:r}}){const i=r?.radius??5,o={rx:i,ry:i,labelPaddingX:(t?.padding??0)*1,labelPaddingY:(t?.padding??0)*1};return As(e,t,o)}C(g0,"roundedRect");var ha=8;async function p0(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const o=t.look==="neo"?16:t.padding??0,a=t.look==="neo"?12:t.padding??0,{shapeSvg:s,bbox:n,label:l}=await he(e,t,se(t)),c=(t?.width??n.width)+o*2+(t.look==="neo"?ha:ha*2),h=(t?.height??n.height)+a*2,d=c-ha,u=h,f=ha-c/2,g=-h/2,{cssStyles:p}=t,m=Zt.svg(s),y=Gt(t,{});t.look!=="handDrawn"&&(y.roughness=0,y.fillStyle="solid");const x=[{x:f,y:g},{x:f+d,y:g},{x:f+d,y:g+u},{x:f-ha,y:g+u},{x:f-ha,y:g},{x:f,y:g},{x:f,y:g+u}],b=m.polygon(x.map(T=>[T.x,T.y]),y),S=s.insert(()=>b,":first-child");return S.attr("class","basic label-container outer-path").attr("style",Hr(p)),i&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),p&&t.look!=="handDrawn"&&S.selectAll("path").attr("style",i),l.attr("transform",`translate(${ha/2-n.width/2-(n.x-(n.left??0))}, ${-(n.height/2)-(n.y-(n.top??0))})`),ee(t,S),t.intersect=function(T){return Yt.rect(t,T)},s}C(p0,"shadedProcess");async function m0(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?16:o,s=t.look==="neo"?12:o;(t.width||t.height)&&(t.width=Math.max((t?.width??0)-a*2,10),t.height=Math.max((t?.height??0)/1.5-s*2,10));const{shapeSvg:n,bbox:l,label:c}=await he(e,t,se(t)),h=(t?.width?t?.width:l.width)+a*2,d=((t?.height?t?.height:l.height)+s*2)*1.5,u=h,f=d/1.5,g=-u/2,p=-f/2,{cssStyles:m}=t,y=Zt.svg(n),x=Gt(t,{});t.look!=="handDrawn"&&(x.roughness=0,x.fillStyle="solid");const b=[{x:g,y:p},{x:g,y:p+f},{x:g+u,y:p+f},{x:g+u,y:p-f/2}],S=sr(b),T=y.path(S,x),k=n.insert(()=>T,":first-child");return k.attr("class","basic label-container outer-path"),m&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",m),i&&t.look!=="handDrawn"&&k.selectChildren("path").attr("style",i),k.attr("transform",`translate(0, ${f/4})`),c.attr("transform",`translate(${-u/2+(t.padding??0)-(l.x-(l.left??0))}, ${-f/4+(t.padding??0)-(l.y-(l.top??0))})`),ee(t,k),t.intersect=function(_){return Yt.polygon(t,b,_)},n}C(m0,"slopedRect");async function y0(e,t){const r=t.padding??0,i=t.look==="neo"?16:r*2,o=t.look==="neo"?12:r,a={rx:0,ry:0,labelPaddingX:t.labelPaddingX??i,labelPaddingY:o},s=await As(e,t,a);if(t.colorIndex!==void 0){const{theme:n,themeVariables:l}=Ge();Oi(s,t.colorIndex,n,l.borderColorArray)}return s}C(y0,"squareRect");var Kh=50,CB=C((e,t,r)=>{const i=e.height+r,o=i*Math.cos(Math.PI/(2*(Kh-1))),a=Math.sqrt(Math.max(0,o**2-e.height**2));return{w:Math.max(e.width+i/4+t,1.5*i+(i-o),e.width+t+i-a),h:i}},"stadiumDimensions");async function x0(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?40:o,s=t.look==="neo"?24:o,{shapeSvg:n,bbox:l}=await he(e,t,se(t)),{w:c,h}=CB(l,a,s),d=h/2,{cssStyles:u}=t,f=Zt.svg(n),g=Gt(t,{});t.look!=="handDrawn"&&(g.roughness=0,g.fillStyle="solid");const p=[{x:-c/2+d,y:-h/2},{x:c/2-d,y:-h/2},...so(-c/2+d,0,d,Kh,90,270),{x:c/2-d,y:h/2},...so(c/2-d,0,d,Kh,270,450)],m=sr(p),y=f.path(m,g),x=n.insert(()=>y,":first-child");return x.attr("class","basic label-container outer-path"),u&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",u),i&&t.look!=="handDrawn"&&x.selectChildren("path").attr("style",i),ee(t,x),t.intersect=function(b){return Yt.polygon(t,p,b)},n}C(x0,"stadium");async function b0(e,t){const r={rx:t.look==="neo"?3:5,ry:t.look==="neo"?3:5};return As(e,t,r)}C(b0,"state");function C0(e,t,{config:{themeVariables:r}}){const{labelStyles:i,nodeStyles:o}=Ut(t);t.labelStyle=i;const{cssStyles:a}=t,{lineColor:s,stateBorder:n,nodeBorder:l,nodeShadow:c}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const h=e.insert("g").attr("class","node default").attr("id",t.domId??t.id),d=Zt.svg(h),u=Gt(t,{});t.look!=="handDrawn"&&(u.roughness=0,u.fillStyle="solid");const f=d.circle(0,0,t.width,{...u,stroke:s,strokeWidth:2}),g=n??l,p=(t.width??0)*5/14,m=d.circle(0,0,p,{...u,fill:g,stroke:g,strokeWidth:2,fillStyle:"solid"}),y=h.insert(()=>f,":first-child");if(y.insert(()=>m),t.look!=="handDrawn"&&y.attr("class","outer-path"),a&&y.selectAll("path").attr("style",a),o&&y.selectAll("path").attr("style",o),t.width<25&&c&&t.look!=="handDrawn"){const x=e.node()?.ownerSVGElement?.id??"",b=x?`${x}-drop-shadow-small`:"drop-shadow-small";y.attr("style",`filter:url(#${b})`)}return ee(t,y),t.intersect=function(x){return Yt.circle(t,(t.width??0)/2,x)},h}C(C0,"stateEnd");function w0(e,t,{config:{themeVariables:r}}){const{lineColor:i,nodeShadow:o}=r;(t.width||t.height)&&((t.width??0)<14&&(t.width=14),(t.height??0)<14&&(t.height=14)),t.width||(t.width=14),t.height||(t.height=14);const a=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let s;if(t.look==="handDrawn"){const l=Zt.svg(a).circle(0,0,t.width,Iw(i));s=a.insert(()=>l),s.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14)}else s=a.insert("circle",":first-child"),s.attr("class","state-start").attr("r",(t.width??7)/2).attr("width",t.width??14).attr("height",t.height??14);if(t.width<25&&o&&t.look!=="handDrawn"){const n=e.node()?.ownerSVGElement?.id??"",l=n?`${n}-drop-shadow-small`:"drop-shadow-small";s.attr("style",`filter:url(#${l})`)}return ee(t,s),t.intersect=function(n){return Yt.circle(t,(t.width??7)/2,n)},a}C(w0,"stateStart");var qa=8;async function k0(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const o=t?.padding??8,a=t.look==="neo"?28:o,s=t.look==="neo"?12:o,{shapeSvg:n,bbox:l}=await he(e,t,se(t)),c=Math.max(l.width+2*qa+a,t.width??0),h=Math.max(l.height+s,t.height??0),d=c-2*qa,u=h,f=-c/2,g=-h/2,p=[{x:0,y:0},{x:d,y:0},{x:d,y:-u},{x:0,y:-u},{x:0,y:0},{x:-8,y:0},{x:d+8,y:0},{x:d+8,y:-u},{x:-8,y:-u},{x:-8,y:0}];if(t.look==="handDrawn"){const m=Zt.svg(n),y=Gt(t,{}),x=m.rectangle(f,g,d+16,u,y),b=m.line(f+qa,g,f+qa,g+u,y),S=m.line(f+qa+d,g,f+qa+d,g+u,y);n.insert(()=>b,":first-child"),n.insert(()=>S,":first-child");const T=n.insert(()=>x,":first-child"),{cssStyles:k}=t;T.attr("class","basic label-container").attr("style",Hr(k)),ee(t,T)}else{const m=yo(n,d,u,p);i&&m.attr("style",i),ee(t,m)}return t.intersect=function(m){return Yt.polygon(t,p,m)},n}C(k0,"subroutine");var lh=.2;async function S0(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const o=t.padding??0,a=t.look==="neo"?16:o,s=t.look==="neo"?12:o;(t.width||t.height)&&(t.height=Math.max((t?.height??0)-s*2,10),t.width=Math.max((t?.width??0)-a*2-lh*(t.height+s*2),10));const{shapeSvg:n,bbox:l}=await he(e,t,se(t)),c=(t?.height?t?.height:l.height)+s*2,h=lh*c,d=lh*c,f=(t?.width?t?.width:l.width)+a*2+h-h,g=c,p=-f/2,m=-g/2,{cssStyles:y}=t,x=Zt.svg(n),b=Gt(t,{}),S=[{x:p-h/2,y:m},{x:p+f+h/2,y:m},{x:p+f+h/2,y:m+g},{x:p-h/2,y:m+g}],T=[{x:p+f-h/2,y:m+g},{x:p+f+h/2,y:m+g},{x:p+f+h/2,y:m+g-d}];t.look!=="handDrawn"&&(b.roughness=0,b.fillStyle="solid");const k=sr(S),_=x.path(k,b),L=sr(T),v=x.path(L,{...b,fillStyle:"solid"}),M=n.insert(()=>v,":first-child");return M.insert(()=>_,":first-child"),M.attr("class","basic label-container outer-path"),y&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",y),i&&t.look!=="handDrawn"&&M.selectAll("path").attr("style",i),ee(t,M),t.intersect=function(B){return Yt.polygon(t,S,B)},n}C(S0,"taggedRect");async function v0(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,label:s}=await he(e,t,se(t)),n=Math.max(a.width+(t.padding??0)*2,t?.width??0),l=Math.max(a.height+(t.padding??0)*2,t?.height??0),c=l/8,h=.2*n,d=.2*l,u=l+c,{cssStyles:f}=t,g=Zt.svg(o),p=Gt(t,{});t.look!=="handDrawn"&&(p.roughness=0,p.fillStyle="solid");const m=[{x:-n/2-n/2*.1,y:u/2},...ia(-n/2-n/2*.1,u/2,n/2+n/2*.1,u/2,c,.8),{x:n/2+n/2*.1,y:-u/2},{x:-n/2-n/2*.1,y:-u/2}],y=-n/2+n/2*.1,x=-u/2-d*.4,b=[{x:y+n-h,y:(x+l)*1.3},{x:y+n,y:x+l-d},{x:y+n,y:(x+l)*.9},...ia(y+n,(x+l)*1.25,y+n-h,(x+l)*1.3,-l*.02,.5)],S=sr(m),T=g.path(S,p),k=sr(b),_=g.path(k,{...p,fillStyle:"solid"}),L=o.insert(()=>_,":first-child");return L.insert(()=>T,":first-child"),L.attr("class","basic label-container outer-path"),f&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",f),i&&t.look!=="handDrawn"&&L.selectAll("path").attr("style",i),L.attr("transform",`translate(0,${-c/2})`),s.attr("transform",`translate(${-n/2+(t.padding??0)-(a.x-(a.left??0))},${-l/2+(t.padding??0)-c/2-(a.y-(a.top??0))})`),ee(t,L),t.intersect=function(v){return Yt.polygon(t,m,v)},o}C(v0,"taggedWaveEdgedRectangle");async function M0(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const{shapeSvg:o,bbox:a}=await he(e,t,se(t)),s=Math.max(a.width+(t.padding??0),t?.width||0),n=Math.max(a.height+(t.padding??0),t?.height||0),l=-s/2,c=-n/2,h=o.insert("rect",":first-child");return h.attr("class","text").attr("style",i).attr("rx",0).attr("ry",0).attr("x",l).attr("y",c).attr("width",s).attr("height",n),ee(t,h),t.intersect=function(d){return Yt.rect(t,d)},o}C(M0,"text");var wB=C((e,t,r,i,o,a)=>`M${e},${t}
233
233
  a${o},${a} 0,0,1 0,${-i}
234
234
  l${r},0
@@ -289,7 +289,7 @@ ${a.join(`
289
289
  h${-(l-2*h)}
290
290
  q${-h},0 ${-h},${-h}
291
291
  Z
292
- `;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId — was render.ts domId prefixing skipped?`);const u=o.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",i).attr("d",d);return o.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",c/2).attr("x2",l/2).attr("y2",c/2),n.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),o.append(()=>n.node()),ee(t,u),t.calcIntersect=function(f,g){return Yt.rect(f,g)},t.intersect=function(f){return Yt.rect(t,f)},o}C(N0,"defaultMindmapNode");async function q0(e,t){const r={padding:t.padding??0};return yu(e,t,r)}C(q0,"mindmapCircle");var Wa=36,da=50,TB=100,BB=80,oa=6,Ka=16,_B="bpmn",LB={start:{rings:1,strokeWidth:1.6},intermediate:{rings:2,strokeWidth:1.4},boundary:{rings:2,strokeWidth:1.4},end:{rings:1,strokeWidth:3.4}},Xg;async function W0(){return Xg??=Ve(async()=>{const{bpmnIcons:e}=await import("./ByGoYv9M.js");return{bpmnIcons:e}},[],import.meta.url).then(({bpmnIcons:e})=>{ak(e.prefix)||mm([{name:e.prefix,icons:e}])}),Xg}C(W0,"ensureBpmnIcons");function z0(e){const t=e.metadata?.dataDirection;return t==="input"||t==="output"?t:void 0}C(z0,"dataDirectionOf");function H0(e){return e.metadata?.isCollection===!0}C(H0,"isCollectionData");async function Wl(e,t){return await W0(),$a(e,{height:t,width:t,fallbackPrefix:_B})}C(Wl,"glyphSvg");var _n=C((e,t,r)=>{const i=(t.x??0)-(t.left??0),o=(t.y??0)-(t.top??0);e.attr("transform",`translate(${-t.width/2-i},${r-t.height/2-o})`)},"positionLabelBelow"),Y0=C(async(e,t,r)=>{if(!t)return;const i=e.append("g").attr("class","bpmn-glyph");i.html(`<g>${await Wl(t,r)}</g>`),i.attr("transform",`translate(${-r/2}, ${-r/2})`)},"appendGlyph"),Ln=C((e,t,r,i,o)=>{o&&(t.metadata={...t.metadata??{},drawnExtent:o});const a=e.insert("rect",":first-child").attr("class","bpmn-bounds").attr("x",-r/2).attr("y",-i/2).attr("width",r).attr("height",i).attr("opacity",0).attr("aria-hidden","true");return ee(t,a),a},"reserveBounds"),AB=8,zl=C((e,t,r)=>Math.min(Math.max(e,t),r),"clamp"),nc=C((e,t,r,i,o)=>{const a=e.x??0,s=e.y??0,n=t/2,l=r/2,c=i.x-a,h=i.y-s,d=o??(Math.abs(c)*l>Math.abs(h)*n?c>=0?"right":"left":h>=0?"bottom":"top"),u=C(f=>Math.max(0,f-Math.min(AB,f/2)),"reach");return d==="left"||d==="right"?{x:a+(d==="right"?n:-n),y:zl(i.y,s-u(l),s+u(l))}:{x:zl(i.x,a-u(n),a+u(n)),y:s+(d==="bottom"?l:-l)}},"faceProjectIntersect"),FB=C((e,t,r)=>{const i=e.x??0,o=e.y??0,a=t/2,s=r.x-i,n=r.y-o,l=a*.85;if(Math.abs(n)>=Math.abs(s)){const h=zl(s,-l,l);return{x:i+h,y:o+Math.sign(n||1)*Math.sqrt(a*a-h*h)}}const c=zl(n,-l,l);return{x:i+Math.sign(s||1)*Math.sqrt(a*a-c*c),y:o+c}},"ringIntersect"),$B=C((e,t,r,i)=>{const o=e.x??0,a=e.y??0,s=t/2,n=r/2,l=i.x-o,c=i.y-a;return Math.abs(l)*n>Math.abs(c)*s?{x:o+Math.sign(l)*s,y:a}:{x:o,y:a+Math.sign(c||1)*n}},"faceCentreIntersect");async function An(e,t,r){const i=t,{labelStyles:o,nodeStyles:a}=Ut(t);t.labelStyle=o;const{rings:s,strokeWidth:n}=LB[r],l=Wa/2,{shapeSvg:c,bbox:h,label:d}=await he(e,t,se(t,`bpmn-event bpmn-event-${r}`)),u=c.insert("g",":first-child").attr("class","bpmn-event-body");u.attr("style",a);for(let y=0;y<s;y++)u.append("circle").attr("class",y===0?"bpmn-event-ring":"bpmn-event-ring bpmn-event-ring-inner").attr("r",l-y*3).style("stroke-width",`${n}px`);await Y0(u,i.icon,Ka);const f=h.height>0&&!!t.label,g=f?oa+h.height:0,p=Wa+2*g,m=Math.max(Wa,f?h.width:0);return f&&_n(d,h,l+oa+h.height/2),Ln(c,t,m,p,{width:Wa,height:Wa}),t.intersect=function(y){return FB(t,Wa,y)},c}C(An,"renderBpmnEvent");async function X0(e,t){return An(e,t,"start")}C(X0,"bpmnStart");async function j0(e,t){return An(e,t,"intermediate")}C(j0,"bpmnIntermediate");async function G0(e,t){return An(e,t,"boundary")}C(G0,"bpmnBoundary");async function U0(e,t){return An(e,t,"end")}C(U0,"bpmnEnd");async function V0(e,t){const r=t,{labelStyles:i,nodeStyles:o}=Ut(t);t.labelStyle=i;const a=da/2,{shapeSvg:s,bbox:n,label:l}=await he(e,t,se(t,"bpmn-gateway")),c=s.insert("g",":first-child").attr("class","bpmn-gateway-body");c.append("polygon").attr("class","bpmn-gateway-diamond").attr("points",`0,${-a} ${a},0 0,${a} ${-a},0`).attr("style",o),await Y0(c,r.icon,Ka+2);const h=n.height>0&&!!t.label,d=h?oa+n.height:0,u=da+2*d,f=Math.max(da,h?n.width:0);return h&&_n(l,n,a+oa+n.height/2),Ln(s,t,f,u,{width:da,height:da}),t.intersect=function(g){return $B(t,da,da,g)},s}C(V0,"bpmnGateway");async function Z0(e,t){const r=t,{labelStyles:i,nodeStyles:o}=Ut(t);t.labelStyle=i;const{shapeSvg:a,bbox:s,label:n}=await he(e,t,se(t,"bpmn-activity")),l=r.markers??[],c=r.icon,h=c?Ka+6:10,d=l.length>0?Ka+4:10,u=Math.max(TB,s.width+16),f=Math.max(BB,s.height+h+d),g=a.insert("g",":first-child").attr("class","bpmn-activity-body");if(g.append("rect").attr("class","bpmn-activity-rect").attr("x",-u/2).attr("y",-f/2).attr("width",u).attr("height",f).attr("rx",10).attr("ry",10).attr("style",o),c){const p=g.append("g").attr("class","bpmn-activity-icon");p.html(`<g>${await Wl(c,Ka)}</g>`),p.attr("transform",`translate(${-u/2+6}, ${-f/2+6})`)}if(l.length>0){const p=g.append("g").attr("class","bpmn-activity-markers"),m=Ka-2,y=l.length*m;for(const[x,b]of l.entries()){const S=p.append("g");S.html(`<g>${await Wl(b,m)}</g>`),S.attr("transform",`translate(${-y/2+x*m}, 0)`)}p.attr("transform",`translate(0, ${f/2-m-3})`)}if(s.height>0){const p=-f/2+h,m=f/2-d;_n(n,s,(p+m)/2)}return ee(t,g),t.intersect=function(p){return nc(t,u,f,p)},a}C(Z0,"bpmnActivity");var qs=36,za=50,Xn=10;async function K0(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,label:s}=await he(e,t,se(t,"bpmn-data-object")),n=o.insert("g",":first-child").attr("class","bpmn-data-body"),l=-qs/2,c=-za/2,h=qs/2,d=za/2;n.append("path").attr("class","bpmn-data-page").attr("d",`M${l},${c} H${h-Xn} L${h},${c+Xn} V${d} H${l} Z`).attr("style",i),n.append("path").attr("class","bpmn-data-fold").attr("d",`M${h-Xn},${c} V${c+Xn} H${h}`);const u=z0(t);u&&n.append("path").attr("class",`bpmn-data-arrow bpmn-data-arrow-${u}`).attr("d",`M${l+4},${c+9} h7 v-3 l5,4.5 -5,4.5 v-3 h-7 Z`),H0(t)&&n.append("path").attr("class","bpmn-data-collection").attr("d",`M-4,${d-11} v9 M0,${d-11} v9 M4,${d-11} v9`);const f=a.height>0&&!!t.label,g=f?oa+a.height:0,p=za+2*g,m=Math.max(qs,f?a.width:0);return f&&_n(s,a,za/2+oa+a.height/2),Ln(o,t,m,p,{width:qs,height:za}),t.intersect=function(y){return nc(t,qs,za,y)},o}C(K0,"bpmnDataObject");var to=50;async function Q0(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,label:s}=await he(e,t,se(t,"bpmn-data-store")),n=o.insert("g",":first-child").attr("class","bpmn-data-body"),l=to/2,c=6;n.append("path").attr("class","bpmn-store-body").attr("d",`M${-l},${-l+c} a${l},${c} 0 0 1 ${to},0 V${l-c} a${l},${c} 0 0 1 ${-to},0 Z`).attr("style",i);for(const g of[0,5,10])n.append("path").attr("class","bpmn-store-rings").attr("d",`M${-l},${-l+c+g} a${l},${c} 0 0 0 ${to},0`);const h=a.height>0&&!!t.label,d=h?oa+a.height:0,u=to+2*d,f=Math.max(to,h?a.width:0);return h&&_n(s,a,l+oa+a.height/2),Ln(o,t,f,u,{width:to,height:to}),t.intersect=function(g){return nc(t,to,to,g)},o}C(Q0,"bpmnDataStore");async function J0(e,t){const{labelStyles:r}=Ut(t);t.labelStyle=r,t.wrappingWidth=160;const{shapeSvg:i,bbox:o,label:a}=await he(e,t,se(t,"bpmn-annotation")),s=8,n=Math.max(28,o.height+s*2),l=o.width+s*2+6,c=t.metadata?.attachFace==="right"?"right":"left";i.insert("g",":first-child").attr("class","bpmn-annotation-body").append("path").attr("class","bpmn-annotation-bracket").attr("d",c==="right"?`M${l/2-6},${-n/2} h6 V${n/2} h-6`:`M${-l/2+6},${-n/2} h-6 V${n/2} h6`);const d=c==="right"?-l/2+s:-l/2+s+6;return a.attr("transform",`translate(${d-(o.x??0)+(o.left??0)},${-o.height/2-((o.y??0)-(o.top??0))})`),Ln(i,t,l,n),t.intersect=function(u){return nc(t,l,n,u,c)},i}C(J0,"bpmnAnnotation");var EB=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:y0},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:g0},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:x0},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:k0},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:$x},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:Ex},{semanticName:"Folder",name:"Folder",shortName:"folder",description:"Folder or directory",aliases:["directory"],handler:Nx},{semanticName:"Bucket",name:"Bucket",shortName:"bucket",description:"Object storage bucket",handler:mx},{semanticName:"Console",name:"Console (terminal window)",shortName:"console",description:"Terminal or console window",handler:vx},{semanticName:"Browser",name:"Browser",shortName:"browser",description:"Browser window",handler:Cx},{semanticName:"Person",name:"Person",shortName:"person",description:"Person (circular head above a rounded body)",handler:Fx},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:yu},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:D0},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:R0},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:d0},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:zx},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Qx},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Kx},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:B0},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:Vx},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Ix},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:M0},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:wx},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:p0},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:w0},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:C0},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:qx},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Hx},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Bx},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:_x},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Lx},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Jx},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:A0},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:Wx},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:T0},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:t0},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Ax},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Px},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:L0},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:$0},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Dx},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:_0},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:Rx},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:m0},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:c0},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:l0},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:px},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Tx},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:v0},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:S0},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:F0},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:u0},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:e0}],PB=C(()=>{const t=[...Object.entries({state:b0,choice:kx,note:h0,composite:Sx,rectWithTitle:f0,labelRect:Zx,block_arrow:bx,collapsedGroup:xx,iconSquare:Gx,iconCircle:Xx,icon:Yx,iconRounded:jx,imageSquare:Ux,anchor:fx,kanbanItem:O0,mindmapCircle:q0,defaultMindmapNode:N0,classBox:P0,erBox:bu,requirementBox:I0,usecaseActor:r0,usecaseActorHollow:o0,usecaseActorAwesome:i0,usecaseActorIcon:a0,usecaseBusiness:s0,usecaseEllipse:Ox,usecaseJsonTable:n0,"bpmn-start":X0,"bpmn-intermediate":j0,"bpmn-boundary":G0,"bpmn-end":U0,"bpmn-gateway":V0,"bpmn-activity":Z0,"bpmn-data":K0,"bpmn-data-store":Q0,"bpmn-annotation":J0}),...EB.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(o=>[o,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),tb=PB();function IB(e){return e in tb}C(IB,"isValidShape");var Fn=C(({flowchart:e})=>{const t=e?.subGraphTitleMargin?.top??0,r=e?.subGraphTitleMargin?.bottom??0,i=t+r;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:i}},"getSubGraphTitleMargins"),lc=new Map;async function eb(e,t,r){let i,o;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const a=t.shape?tb[t.shape]:void 0;if(!a)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let s;r.config.securityLevel==="sandbox"?s="_top":t.linkTarget&&(s=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",s??null),o=await a(i,t,r)}else o=await a(e,t,r),i=o;return i.attr("data-look",Hr(t.look)),t.tooltip&&o.attr("title",t.tooltip),lc.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}C(eb,"insertNode");var bP=C((e,t)=>{lc.set(t.id,e)},"setNodeElem"),CP=C(()=>{lc.clear()},"clear"),wP=C(e=>{const t=lc.get(e.id);Lt.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const r=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode"),rb=C(async(e,t,{variant:r="swimlane"}={})=>{const i=r==="pool",o=i?"pool swimlane":"swimlane",a=i?"pool-label swimlane-label":"swimlane-label",s=i?"pool-title swimlane-title":"swimlane-title",n=i?"pool-body swimlane-body":"swimlane-body",l=Ge(),{theme:c,themeVariables:h,handDrawnSeed:d}=l,{clusterBkg:u,clusterBorder:f,borderColorArray:g}=h,p=f,{labelStyles:m,nodeStyles:y,borderStyles:x,backgroundStyles:b}=Ut(t),S=e.insert("g").attr("class","cluster "+o+" "+(t.cssClasses||"")).attr("id",t.domId??t.id).attr("data-id",t.id).attr("data-et","cluster").attr("data-look",t.look);Oi(S,t.colorIndex,c,g);const T=mo(l.flowchart.htmlLabels),k=t.direction==="LR",_=S.insert("g").attr("class","cluster-label "+a),L=await vi(_,t.label,{style:t.labelStyle,useHtmlLabels:T,isNode:!0,width:t.width});let v=L.getBBox();if(T){const Y=L.children[0],X=Ye(L);v=Y.getBoundingClientRect(),X.attr("width",v.width),X.attr("height",v.height)}const M=t.padding??0,B=t.width<=v.width+M?v.width+M:t.width;t.width<=v.width+M?t.diff=(B-t.width)/2-M:t.diff=-M;const E=t.height,O=t.y-E/2,$=t.y+E/2,I=t.x-B/2,F=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:O+E/3,R=k?4:0,q=v.height+2*R;let D,P;if(k){const Y=Math.max(q,v.height+2*R),X=I+Y,z=Math.max(0,B-Y);if(t.look==="handDrawn"){const V=Zt.svg(S),Q=Gt(t,{roughness:.7,fill:u,stroke:p,seed:d}),rt=Gt(t,{roughness:.7,fill:"none",stroke:p,seed:d}),ht=V.rectangle(I,O,Y,E,Q);D=S.insert(()=>ht,":first-child").attr("class",s);const H=V.rectangle(X,O,z,E,rt);P=S.insert(()=>H,":first-child").attr("class",n),D.select("path:nth-child(2)").attr("style",x.join(";")),D.select("path").attr("style",b.join(";").replace("fill","stroke"))}else D=S.insert("rect",":first-child"),P=S.insert("rect",":first-child"),D.attr("class",s).attr("style",y).attr("x",I).attr("y",O).attr("width",Y).attr("height",E).attr("fill",u).attr("stroke",p),P.attr("class",n).attr("style",y).attr("x",X).attr("y",O).attr("width",z).attr("height",E).attr("fill","none").attr("stroke",p);const U=I+Y/2,j=t.y;_.attr("transform",`translate(${U}, ${j}) rotate(-90) translate(${-v.width/2}, ${-v.height/2})`)}else{const Y=Math.max(0,F-O),X=Math.min(q,Y),z=O+X,U=Math.max(0,$-z),j=t.x-B/2;if(t.look==="handDrawn"){const rt=Zt.svg(S),ht=Gt(t,{roughness:.7,fill:u,stroke:p,fillWeight:3,seed:d}),H=Gt(t,{roughness:.7,fill:"none",stroke:p,seed:d}),G=rt.rectangle(j,O,B,X,ht);D=S.insert(()=>G,":first-child").attr("class",s);const K=rt.rectangle(j,z,B,U,H);P=S.insert(()=>K,":first-child").attr("class",n),D.select("path:nth-child(2)").attr("style",x.join(";")),D.select("path").attr("style",b.join(";").replace("fill","stroke"))}else D=S.insert("rect",":first-child"),P=S.insert("rect",":first-child"),D.attr("class",s).attr("style",y).attr("x",j).attr("y",O).attr("width",B).attr("height",X).attr("fill",u).attr("stroke",p),P.attr("class",n).attr("style",y).attr("x",j).attr("y",z).attr("width",B).attr("height",U).attr("fill","none").attr("stroke",p);const V=t.x-v.width/2,Q=O+(X-v.height)/2;_.attr("transform",`translate(${V}, ${Q})`)}if(Lt.trace("Swimlane data ",t,JSON.stringify(t)),m){const Y=_.select("span");Y&&Y.attr("style",m)}return t.offsetX=0,t.width=B,t.height=E,t.offsetY=v.height-M/2,t.intersect=function(Y){return Wo(t,Y)},{cluster:S,labelBBox:v}},"swimlane"),ib=C(async(e,t)=>{Lt.info("Creating subgraph rect for ",t.id,t);const r=Ge(),{theme:i,themeVariables:o,handDrawnSeed:a}=r,{clusterBkg:s,clusterBorder:n,borderColorArray:l}=o,{labelStyles:c,nodeStyles:h,borderStyles:d,backgroundStyles:u}=Ut(t),f=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look);Oi(f,t.colorIndex,i,l);const g=Zr(r),p=f.insert("g").attr("class","cluster-label ");let m;t.labelType==="markdown"?m=await vi(p,t.label,{style:t.labelStyle,useHtmlLabels:g,isNode:!0,width:t.width}):m=await Lo(p,t.label,t.labelStyle||"",!1,!0);let y=m.getBBox();if(Zr(r)){const v=m.children[0],M=Ye(m);y=v.getBoundingClientRect(),M.attr("width",y.width),M.attr("height",y.height)}const x=t.width<=y.width+t.padding?y.width+t.padding:t.width;t.width<=y.width+t.padding?t.diff=(x-t.width)/2-t.padding:t.diff=-t.padding;const b=t.height,S=t.x-x/2,T=t.y-b/2;Lt.trace("Data ",t,JSON.stringify(t));let k;if(t.look==="handDrawn"){const v=Zt.svg(f),M=Gt(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:a}),B=v.path(Mi(S,T,x,b,0),M);k=f.insert(()=>(Lt.debug("Rough node insert CXC",B),B),":first-child"),k.select("path:nth-child(2)").attr("style",d.join(";")),k.select("path").attr("style",u.join(";").replace("fill","stroke"))}else k=f.insert("rect",":first-child"),k.attr("style",h).attr("rx",t.rx).attr("ry",t.ry).attr("x",S).attr("y",T).attr("width",x).attr("height",b);const{subGraphTitleTopMargin:_}=Fn(r);if(p.attr("transform",`translate(${t.x-y.width/2}, ${t.y-t.height/2+_})`),c){const v=p.select("span");v&&v.attr("style",c)}const L=k.node().getBBox();return t.offsetX=0,t.width=L.width,t.height=L.height,t.offsetY=y.height-t.padding/2,t.intersect=function(v){return Wo(t,v)},{cluster:f,labelBBox:y}},"rect"),OB=C((e,t)=>{const r=e.insert("g").attr("class","note-cluster").attr("id",t.domId),i=r.insert("rect",":first-child"),o=0*t.padding,a=o/2;i.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-a).attr("y",t.y-t.height/2-a).attr("width",t.width+o).attr("height",t.height+o).attr("fill","none");const s=i.node().getBBox();return t.width=s.width,t.height=s.height,t.intersect=function(n){return Wo(t,n)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),DB=C(async(e,t)=>{const r=Ge(),{theme:i,themeVariables:o,handDrawnSeed:a}=r,{altBackground:s,borderColorArray:n,compositeBackground:l,compositeTitleBackground:c,nodeBorder:h}=o,d=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look);Oi(d,t.colorIndex,i,n);const u=d.insert("g",":first-child"),f=d.insert("g").attr("class","cluster-label");let g=d.append("rect");const p=await Lo(f,t.label,t.labelStyle,void 0,!0);let m=p.getBBox();if(Zr(r)){const B=p.children[0],E=Ye(p);m=B.getBoundingClientRect(),E.attr("width",m.width),E.attr("height",m.height)}const y=0*t.padding,x=y/2,b=(t.width<=m.width+t.padding?m.width+t.padding:t.width)+y;t.width<=m.width+t.padding?t.diff=(b-t.width)/2-t.padding:t.diff=-t.padding;const S=t.height+y,T=t.height+y-m.height-6,k=t.x-b/2,_=t.y-S/2;t.width=b;const L=t.y-t.height/2-x+m.height+2;let v;if(t.look==="handDrawn"){const B=t.cssClasses.includes("statediagram-cluster-alt"),E=Zt.svg(d),O=t.rx||t.ry?E.path(Mi(k,_,b,S,10),{roughness:.7,fill:c,fillStyle:"solid",stroke:h,seed:a}):E.rectangle(k,_,b,S,{seed:a});v=d.insert(()=>O,":first-child");const $=E.rectangle(k,L,b,T,{fill:B?s:l,fillStyle:B?"hachure":"solid",stroke:h,seed:a});v=d.insert(()=>O,":first-child"),g=d.insert(()=>$),v.attr("class","outer"),g.attr("class","inner")}else v=u.insert("rect",":first-child"),v.attr("class","outer").attr("x",k).attr("y",_).attr("width",b).attr("height",S).attr("data-look",t.look),g.attr("class","inner").attr("x",k).attr("y",L).attr("width",b).attr("height",T);f.attr("transform",`translate(${t.x-m.width/2}, ${_+1-(Zr(r)?0:3)})`);const M=v.node().getBBox();return t.height=M.height,t.offsetX=0,t.offsetY=m.height-t.padding/2,t.labelBBox=m,t.intersect=function(B){return Wo(t,B)},{cluster:d,labelBBox:m}},"roundedWithTitle"),RB=C(async(e,t)=>{Lt.info("Creating subgraph rect for ",t.id,t);const r=Ge(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:a,clusterBorder:s}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=Ut(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),u=Zr(r),f=d.insert("g").attr("class","cluster-label "),g=await vi(f,t.label,{style:t.labelStyle,useHtmlLabels:u,isNode:!0,width:t.width});let p=g.getBBox();if(Zr(r)){const _=g.children[0],L=Ye(g);p=_.getBoundingClientRect(),L.attr("width",p.width),L.attr("height",p.height)}const m=t.width<=p.width+t.padding?p.width+t.padding:t.width;t.width<=p.width+t.padding?t.diff=(m-t.width)/2-t.padding:t.diff=-t.padding;const y=t.height,x=t.x-m/2,b=t.y-y/2;Lt.trace("Data ",t,JSON.stringify(t));let S;if(t.look==="handDrawn"){const _=Zt.svg(d),L=Gt(t,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:o}),v=_.path(Mi(x,b,m,y,t.rx),L);S=d.insert(()=>(Lt.debug("Rough node insert CXC",v),v),":first-child"),S.select("path:nth-child(2)").attr("style",c.join(";")),S.select("path").attr("style",h.join(";").replace("fill","stroke"))}else S=d.insert("rect",":first-child"),S.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",x).attr("y",b).attr("width",m).attr("height",y);const{subGraphTitleTopMargin:T}=Fn(r);if(f.attr("transform",`translate(${t.x-p.width/2}, ${t.y-t.height/2+T})`),n){const _=f.select("span");_&&_.attr("style",n)}const k=S.node().getBBox();return t.offsetX=0,t.width=k.width,t.height=k.height,t.offsetY=p.height-t.padding/2,t.intersect=function(_){return Wo(t,_)},{cluster:d,labelBBox:p}},"kanbanSection"),NB=C((e,t)=>{const r=Ge(),{theme:i,themeVariables:o,handDrawnSeed:a}=r,{altBackground:s,nodeBorder:n,borderColorArray:l}=o,c=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look);Oi(c,t.colorIndex,i,l);const h=c.insert("g",":first-child"),d=0*t.padding,u=t.width+d;t.diff=-t.padding;const f=t.height+d,g=t.x-u/2,p=t.y-f/2;t.width=u;let m;if(t.look==="handDrawn"){const b=Zt.svg(c).rectangle(g,p,u,f,{fill:s??"#efefef",fillStyle:"solid",roughness:.5,strokeLineDash:[5],stroke:n,seed:a});m=c.insert(()=>b,":first-child").attr("class","divider")}else{m=h.insert("rect",":first-child");let x="outer";t.look,x="divider",m.attr("class",x).attr("x",g).attr("y",p).attr("width",u).attr("height",f).attr("data-look",t.look)}const y=m.node().getBBox();return t.height=y.height,t.offsetX=0,t.offsetY=0,t.intersect=function(x){return Wo(t,x)},{cluster:c,labelBBox:{}}},"divider"),qB=C(async(e,t,r)=>{Lt.info(`Creating ${r.cssClass} for `,t.id,t);const i=Ge(),{theme:o,themeVariables:a,handDrawnSeed:s}=i,{borderColorArray:n}=a,{labelStyles:l,borderStyles:c}=Ut(t),h=e.insert("g").attr("class","cluster "+r.cssClass+" "+t.cssClasses).attr("id",t.domId??t.id).attr("data-look",t.look);Oi(h,t.colorIndex,o,n);const d=Zr(i),u=h.insert("g").attr("class","cluster-label");let f={width:0,height:0};const g=t.label?.trim();if(g){let T;if(t.labelType==="markdown"?T=await vi(u,t.label,{style:t.labelStyle,useHtmlLabels:d,isNode:!0,width:t.width}):T=await Lo(u,t.label,t.labelStyle||"",!1,!0),f=T.getBBox(),d){const k=T.children[0],_=Ye(T);f=k.getBoundingClientRect(),_.attr("width",f.width),_.attr("height",f.height)}}const p=t.width<=f.width+t.padding?f.width+t.padding:t.width;t.width<=f.width+t.padding?t.diff=(p-t.width)/2-t.padding:t.diff=-t.padding;const m=t.height,y=t.x-p/2,x=t.y-m/2;let b;if(t.look==="handDrawn"){const T=Zt.svg(h),k=Gt(t,{roughness:r.roughness,fill:r.fill,stroke:r.stroke,strokeWidth:r.strokeWidth,seed:s,...r.fill==="none"?{fillWeight:0}:{fillStyle:"solid"},...r.strokeDash?{strokeLineDash:r.strokeDash}:{}}),_=T.path(Mi(y,x,p,m,r.rx),k);b=h.insert(()=>_,":first-child"),b.select("path:nth-child(2)").attr("style",c.join(";"))}else b=h.insert("rect",":first-child"),b.attr("rx",r.rx).attr("ry",r.rx).attr("x",y).attr("y",x).attr("width",p).attr("height",m).attr("fill",r.fill).attr("stroke",r.stroke).attr("stroke-width",r.strokeWidth+"px"),r.strokeDash&&b.attr("stroke-dasharray",r.strokeDash.join(", "));if(g){const{subGraphTitleTopMargin:T}=Fn(i);if(u.attr("transform",`translate(${t.x-f.width/2}, ${t.y-t.height/2+T})`),l){const k=u.select("span");k&&k.attr("style",l)}}const S=b.node().getBBox();return t.offsetX=0,t.width=S.width,t.height=S.height,t.offsetY=f.height-t.padding/2,t.intersect=function(T){return Wo(t,T)},{cluster:h,labelBBox:f}},"createContainerGroup"),WB=C(async(e,t)=>{const{themeVariables:r}=Ge(),i=r.flowContainerStroke||r.secondaryBorderColor;return qB(e,t,{cssClass:"flow-cluster",rx:10,fill:"none",stroke:i,strokeWidth:.75,roughness:.7})},"flowGroup"),zB=C((e,t)=>{const r=e.boundaryType||"rect",i=r==="package"?20:e.padding,o=r==="package"?t.height+10:0,a=Math.max(e.width,t.width+i),s=r==="package"?Math.max(e.height,o+e.padding*2):e.height,n=e.x-a/2,l=e.y-s/2;return{boundaryType:r,width:a,height:s,x:n,y:l,bodyY:l+o,bodyHeight:s-o,tabHeight:o,tabWidth:r==="package"?Math.min(a,Math.max(80,t.width+20)):0}},"getUsecaseSystemBoundaryGeometry"),HB=C(async(e,t)=>{Lt.info("Creating usecase system boundary for ",t.id,t);const r=Ge(),{theme:i,themeVariables:o,handDrawnSeed:a}=r,{clusterBkg:s,clusterBorder:n,borderColorArray:l}=o,{labelStyles:c,nodeStyles:h}=Ut(t),{stylesMap:d}=sa(t),u=t.boundaryType||"rect",f=e.insert("g").attr("class",`cluster usecase-system-boundary usecase-system-boundary-${u} ${t.cssClasses}`).attr("id",typeof t.domId=="string"?t.domId:t.id).attr("data-boundary-type",u).attr("data-look",t.look);Oi(f,t.colorIndex,i,l);const g=Zr(r),p=f.insert("g").attr("class","cluster-label system-boundary-title"),m=await vi(p,t.label,{style:c,useHtmlLabels:g,isNode:!0});let y=m.getBBox();if(g){const O=m.children[0],$=Ye(m);y=O.getBoundingClientRect(),$.attr("width",y.width),$.attr("height",y.height)}const x=zB(t,y),{width:b,height:S,x:T,y:k,bodyY:_,bodyHeight:L,tabHeight:v,tabWidth:M}=x;t.diff=t.width<=y.width+t.padding?(b-t.width)/2-t.padding:-t.padding;const B=Gt(t,{fill:d.get("fill")||s,stroke:d.get("stroke")||n,strokeWidth:d.get("stroke-width")?.replace("px","")||1,seed:a});if(t.look==="handDrawn"){const O=Zt.svg(f),$=O.rectangle(T,_,b,L,B);if(f.insert(()=>$,":first-child").attr("class","boundary-body label-container"),u==="package"){const I=O.rectangle(T,k,M,v,B);f.insert(()=>I,":first-child").attr("class","boundary-tab system-boundary-package-tab label-container")}}else f.insert("rect",":first-child").attr("class","boundary-body label-container").attr("style",h).attr("x",T).attr("y",_).attr("width",b).attr("height",L),u==="package"&&f.insert("rect",":first-child").attr("class","boundary-tab system-boundary-package-tab label-container").attr("style",h).attr("x",T).attr("y",k).attr("width",M).attr("height",v);const{subGraphTitleTopMargin:E}=Fn(r);return u==="package"?p.attr("transform",`translate(${T+(M-y.width)/2}, ${k+(v-y.height)/2})`):p.attr("transform",`translate(${t.x-y.width/2}, ${k+E})`),c&&(p.attr("style",c),p.select("span").attr("style",c)),t.offsetX=0,t.width=b,t.height=S,t.offsetY=y.height-t.padding/2,t.labelBBox=y,t.intersect=function(O){return Wo(t,O)},{cluster:f,labelBBox:y}},"usecaseSystemBoundary"),YB=ib,XB=C((e,t)=>rb(e,t,{variant:"pool"}),"pool"),jB={rect:ib,squareRect:YB,roundedWithTitle:DB,noteGroup:OB,divider:NB,kanbanSection:RB,flowGroup:WB,usecaseSystemBoundary:HB,swimlane:rb,pool:XB},GB=new Set(["noteGroup","divider"]),kP=C(e=>!GB.has(e??"rect"),"clusterPaintsTitle"),ob=new Map,UB=C(async(e,t)=>{const r=t.shape||"rect",i=await jB[r](e,t);return ob.set(t.id,i),i},"insertCluster"),SP=C(()=>{ob=new Map},"clear"),Ws=C((e,t)=>{if(t)return"translate("+-e.width/2+", "+-e.height/2+")";const r=e.x??0,i=e.y??0;return"translate("+-(r+e.width/2)+", "+-(i+e.height/2)+")"},"computeLabelTransform"),Ur={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},jg={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5,arrow_open_head:4,arrow_hollow_circle:8};function Ks(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=Lr(e),t=Lr(t);const[r,i]=[e.x,e.y],[o,a]=[t.x,t.y],s=o-r,n=a-i;return{angle:Math.atan(n/s),deltaX:s,deltaY:n}}C(Ks,"calculateDeltaAndAngle");var Lr=C(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),VB=C(e=>({x:C(function(t,r,i){let o=0;const a=Lr(i[0]).x<Lr(i[i.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(Ur,e.arrowTypeStart)){const{angle:f,deltaX:g}=Ks(i[0],i[1]);o=Ur[e.arrowTypeStart]*Math.cos(f)*(g>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Ur,e.arrowTypeEnd)){const{angle:f,deltaX:g}=Ks(i[i.length-1],i[i.length-2]);o=Ur[e.arrowTypeEnd]*Math.cos(f)*(g>=0?1:-1)}const s=Math.abs(Lr(t).x-Lr(i[i.length-1]).x),n=Math.abs(Lr(t).y-Lr(i[i.length-1]).y),l=Math.abs(Lr(t).x-Lr(i[0]).x),c=Math.abs(Lr(t).y-Lr(i[0]).y),h=Ur[e.arrowTypeStart],d=Ur[e.arrowTypeEnd],u=1;if(s<d&&s>0&&n<d){let f=d+u-s;f*=a==="right"?-1:1,o-=f}if(l<h&&l>0&&c<h){let f=h+u-l;f*=a==="right"?-1:1,o+=f}return Lr(t).x+o},"x"),y:C(function(t,r,i){let o=0;const a=Lr(i[0]).y<Lr(i[i.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(Ur,e.arrowTypeStart)){const{angle:f,deltaY:g}=Ks(i[0],i[1]);o=Ur[e.arrowTypeStart]*Math.abs(Math.sin(f))*(g>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Ur,e.arrowTypeEnd)){const{angle:f,deltaY:g}=Ks(i[i.length-1],i[i.length-2]);o=Ur[e.arrowTypeEnd]*Math.abs(Math.sin(f))*(g>=0?1:-1)}const s=Math.abs(Lr(t).y-Lr(i[i.length-1]).y),n=Math.abs(Lr(t).x-Lr(i[i.length-1]).x),l=Math.abs(Lr(t).y-Lr(i[0]).y),c=Math.abs(Lr(t).x-Lr(i[0]).x),h=Ur[e.arrowTypeStart],d=Ur[e.arrowTypeEnd],u=1;if(s<d&&s>0&&n<d){let f=d+u-s;f*=a==="up"?-1:1,o-=f}if(l<h&&l>0&&c<h){let f=h+u-l;f*=a==="up"?-1:1,o+=f}return Lr(t).y+o},"y")}),"getLineFunctionsWithOffset"),ab=1,ZB=C(e=>typeof e=="number"&&Number.isFinite(e)&&e>0?e:ab,"getStepDuration"),Cu=C(e=>typeof e.step=="number"&&Number.isInteger(e.step)&&e.step>0,"isStepEdge"),Gg=[.25,.35,.15,.65,.75,.5,.85,.1,.9],Qh=9,KB=11,QB=2,JB="#333333",Ug=12,Vg=6,Zg=14,Kg=.01,t_=4.5,sb=/translate\(\s*(-?[\d.e]+)[\s,]+(-?[\d.e]+)/i,e_=4,r_=.6,i_=4,o_=C((e,t,r=ab)=>{const i=Math.max(t,e);return{begin:(e-1)*r,dur:r,gap:(i-1)*r}},"getEdgeStepTiming"),a_=C(e=>`step_${Array.from(e,t=>/[\dA-Za-z]/.test(t)?t:`_${(t.codePointAt(0)??0).toString(16)}_`).join("")}`,"toAnimationId"),s_=C(e=>{const t=/^m\s*(-?[\d.e]+)[\s,]+(-?[\d.e]+)/i.exec(e.trim());return t?`translate(${t[1]},${t[2]}) `:""},"pathStartTranslate"),n_=C(e=>Array.from(e,(t,r)=>{const i=t.codePointAt(0)??0;if(i===0)return"�";const o=i<=31||i===127,a=/\d/.test(t)&&(r===0||r===1&&e.startsWith("-"));return o||a?`\\${i.toString(16)} `:e==="-"?"\\-":i>=128||/[\w-]/.test(t)?t:`\\${t}`}).join(""),"escapeCssIdentifierFallback"),l_=C(e=>typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(e):n_(e),"escapeCssIdentifier"),c_=C((e,t)=>{const r=e.node(),i=r?.ownerSVGElement??r?.closest?.("svg")??r,o=t||i?.getAttribute("id");if(!i||!o||i.querySelector("style.edge-step-style"))return;const a=`#${l_(o)} `,s=i.ownerDocument.createElementNS("http://www.w3.org/2000/svg","style");s.setAttribute("class","edge-step-style"),s.textContent=`@media (prefers-reduced-motion: reduce) { ${a}.edge-step-dot, ${a}.edge-step-highlight { display: none; } }`,i.appendChild(s)},"ensureReducedMotionStyle"),h_=C((e,t)=>{const r=e.filter(a=>Number.isFinite(a.x)&&Number.isFinite(a.y));if(r.length===0)return;const i=r.slice(1).map((a,s)=>Math.hypot(a.x-r[s].x,a.y-r[s].y));let o=i.reduce((a,s)=>a+s,0)*t;for(const[a,s]of i.entries()){if(o<=s&&s>0){const n=o/s,l=r[a],c=r[a+1];return{x:l.x+(c.x-l.x)*n,y:l.y+(c.y-l.y)*n}}o-=s}return r[r.length-1]},"pointAlongPolyline"),d_=C((e,t)=>{const r=typeof t?.getTotalLength=="function"?t.getTotalLength():0,i=t?.getPointAtLength?.bind(t);return r>0&&i?o=>{const{x:a,y:s}=i(r*o);return{x:a,y:s}}:o=>h_(e,o)},"createPathSampler"),u_=C((e,t)=>Math.min(Number.POSITIVE_INFINITY,...t.map(r=>{const i=Math.max(Math.abs(e.x-r.x)-r.halfWidth,0),o=Math.max(Math.abs(e.y-r.y)-r.halfHeight,0);return Math.hypot(i,o)-Qh})),"roomAround"),f_=C((e,t)=>{const r=e(t),i=e(Math.max(t-Kg,0)),o=e(Math.min(t+Kg,1));if(!r||!i||!o)return[];const a=Math.hypot(o.x-i.x,o.y-i.y);if(a===0)return[];const s={x:-(o.y-i.y)/a,y:(o.x-i.x)/a};return[1,-1].map(n=>({x:r.x+s.x*Zg*n,y:r.y+s.y*Zg*n}))},"besideThePath"),g_=C((e,t)=>{const r=[...Gg.map(e),...Gg.flatMap(a=>f_(e,a))];let i,o=Number.NEGATIVE_INFINITY;for(const a of r){if(!a||!Number.isFinite(a.x)||!Number.isFinite(a.y))continue;const s=u_(a,t);if(s>=QB)return a;s>o&&(i=a,o=s)}return i},"chooseBadgePosition"),nb=C((e,t)=>({...e,halfWidth:t,halfHeight:t}),"square"),p_=C(e=>{const t=sb.exec(e.getAttribute("transform")??"");return t?{x:Number(t[1]),y:Number(t[2])}:{x:0,y:0}},"translationOf"),wu=C(e=>{const t={x:0,y:0};for(let r=e;r&&r.localName!=="svg";r=r.parentElement){const{x:i,y:o}=p_(r);t.x+=i,t.y+=o}return t},"offsetInSvg"),m_=C((e,t)=>{if(!sb.test(e.getAttribute("transform")??""))return;const r=wu(e),i=r.x-t.x,o=r.y-t.y,a=e.getBBox?.();if(a)return{x:i+a.x+a.width/2,y:o+a.y+a.height/2,halfWidth:a.width/2,halfHeight:a.height/2}},"boxedObstacle"),y_=C(e=>{try{const t=JSON.parse(atob(e.getAttribute("data-points")??""));return Array.isArray(t)?t:[]}catch{return[]}},"readPoints"),Qg=C((e,t)=>{const r=Math.hypot(e.x-t.x,e.y-t.y);if(r===0)return nb(e,Ug);const i={x:(e.x-t.x)/r,y:(e.y-t.y)/r},o=Ug/2;return{x:e.x-i.x*o,y:e.y-i.y*o,halfWidth:Math.abs(i.x)*o+Math.abs(i.y)*Vg,halfHeight:Math.abs(i.y)*o+Math.abs(i.x)*Vg}},"arrowheadObstacle"),Jg=C((e,t)=>{const r=e.getAttribute(t);return!!r&&r!=="none"},"hasMarker"),x_=C((e,t)=>{const r=y_(e).filter(n=>Number.isFinite(n?.x)&&Number.isFinite(n?.y));if(r.length===0)return[];const i=wu(e),o=C(n=>({x:n.x+i.x-t.x,y:n.y+i.y-t.y}),"toSvg"),a=r.length-1,s=[];return Jg(e,"marker-start")&&s.push(Qg(o(r[0]),o(r[Math.min(1,a)]))),Jg(e,"marker-end")&&s.push(Qg(o(r[a]),o(r[Math.max(a-1,0)]))),s},"arrowheadObstacles"),lb=C(e=>{const t={x:0,y:0},r=[...e?.querySelectorAll(".edgeLabel, .node")??[]].map(o=>m_(o,t)).filter(o=>o!==void 0),i=[...e?.querySelectorAll('path[data-edge="true"]')??[]].flatMap(o=>x_(o,t));return[...r,...i]},"collectBadgeObstacles"),b_=C((e,t)=>{if(!e.label||t.length===0)return[];const{x:r,y:i}=Si.calcLabelPosition(t);return[{x:r,y:i,halfWidth:(e.width??0)/2,halfHeight:(e.height??0)/2}]},"edgeLabelObstacles"),C_=C(e=>{const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4},"linearChannel"),tp=C(e=>{try{const[t,r,i]=["r","g","b"].map(o=>C_(g2(e,o)));return .2126*t+.7152*r+.0722*i}catch{return}},"relativeLuminance"),w_=C((e,t)=>{const r=tp(e),i=tp(t);return r===void 0||i===void 0?0:(Math.max(r,i)+.05)/(Math.min(r,i)+.05)},"contrastRatio"),k_=C((e,t)=>{const i=[...t.filter(a=>!!a),"#ffffff","#000000"].map(a=>({color:a,ratio:w_(e,a)}));return(i.find(({ratio:a})=>a>=t_)??i.reduce((a,s)=>s.ratio>a.ratio?s:a)).color},"pickBadgeTextColor"),S_=C(e=>{const t=e?.replace(/^stroke:\s*/,"").trim();return t===""?void 0:t},"bareColor"),v_=C((e,t,r,i=lb(e.node()?.closest("svg")))=>{if(!Cu(t)||!t.showStepNumber)return;const o=wu(e.node()),a=i.map(c=>({...c,x:c.x-o.x,y:c.y-o.y})),s=g_(d_(r.points,r.pathNode),[...a,...b_(t,r.points)]);if(!s)return;const n=S_(r.color)??JB,l=e.append("g").attr("class","edge-step-badge").attr("transform",`translate(${s.x},${s.y})`).attr("pointer-events","none").attr("data-step",t.step);return l.append("circle").attr("r",Qh).attr("fill",n),l.append("text").attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",KB).attr("fill",k_(n,r.textColors??[])).text(String(t.step)),nb({x:s.x+o.x,y:s.y+o.y},Qh)},"insertEdgeStepBadge"),ep=C((e,t,r)=>{e.append("animateTransform").attr("attributeName","transform").attr("type","scale").attr("values","1;1").attr("dur",`${r}s`).attr("begin",`${t}.begin`).attr("fill","remove")},"showWhileStepPlays"),M_=C((e,t,r,i,o)=>{if(!Cu(t)||!r)return;const{begin:a,dur:s,gap:n}=o_(t.step,t.stepCount??t.step,ZB(t.stepDuration)),l=a_(`${i}-${t.id}-step`),c=`${s_(r)}scale(0)`,h=o?.replace(/^stroke:\s*/,""),d=e.append("path").attr("class","edge-step-highlight").attr("aria-hidden","true").attr("d",r).attr("fill","none").attr("stroke",h??"currentColor").attr("stroke-width",e_).attr("stroke-linecap","round").attr("stroke-opacity",r_).attr("pointer-events","none").attr("transform",c).attr("data-step",t.step);ep(d,l,s);const u=e.append("circle").attr("class","edge-step-dot").attr("r",i_).attr("aria-hidden","true").attr("transform",c).attr("data-step",t.step);h&&u.attr("fill",h).attr("stroke","none"),u.append("animateMotion").attr("id",l).attr("path",r).attr("dur",`${s}s`).attr("begin",`${a}s;${l}.end+${n}s`).attr("fill","remove"),ep(u,l,s),c_(e,i)},"insertEdgeStepDot"),Hl=new WeakMap,T_=C(e=>{const t=e.querySelector(":scope > g.edge-step-badges");if(t)return t;const r=e.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");return r.setAttribute("class","edge-step-badges"),e.appendChild(r)},"badgeLayer"),B_=C(e=>{const t=e?Hl.get(e):void 0;if(!e||!t)return;Hl.delete(e);const r=lb(e);for(const{elem:i,edge:o,options:a}of t){const s=i.node()?.parentElement;if(!s)continue;const n=Ye(T_(s)),l=v_(n,o,a,r);l&&r.push(l)}},"placeQueuedStepBadges"),__=C((e,t,r,i,o)=>{M_(e,t,r,i,o.color);const a=e.node(),s=a?.ownerSVGElement??a;!s||!Cu(t)||!t.showStepNumber||Hl.set(s,[...Hl.get(s)??[],{elem:e,edge:t,options:o}])},"insertEdgeStepMarks"),L_=C((e,t,r,i,o,a=!1,s)=>{t.arrowTypeStart&&rp(e,"start",t.arrowTypeStart,r,i,o,a,s),t.arrowTypeEnd&&rp(e,"end",t.arrowTypeEnd,r,i,o,a,s)},"addEdgeMarkers"),A_={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},arrow_open_head:{type:"openArrow",fill:!1},arrow_hollow_circle:{type:"hollowCircle",fill:!1},arrow_hierarchy:{type:"hierarchy",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},F_=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],rp=C((e,t,r,i,o,a,s=!1,n)=>{if(!r||r==="none")return;const l=A_[r],c=l&&F_.includes(l.type);if(!l){Lt.warn(`Unknown arrow type: ${r}`);return}const h=l.type,f=`${o}_${a}-${h}${t==="start"?"Start":"End"}${s&&c?"-margin":""}`;if(n&&n.trim()!==""){const g=n.replace(/[^\dA-Za-z]/g,"_"),p=`${f}_${g}`;if(!document.getElementById(p)){const m=document.getElementById(f);if(m){const y=m.cloneNode(!0);y.id=p,y.querySelectorAll("path, circle, line").forEach(b=>{b.setAttribute("stroke",n),l.fill&&b.setAttribute("fill",n)}),m.parentNode?.appendChild(y)}}e.attr(`marker-${t}`,`url(${i}#${p})`)}else e.attr(`marker-${t}`,`url(${i}#${f})`)},"addEdgeMarker"),$_=C(e=>typeof e=="string"?e:Ge()?.flowchart?.curve,"resolveEdgeCurveType"),Yl=new Map,Jr=new Map,vP=C(()=>{Yl.clear(),Jr.clear()},"clear"),MP=C(e=>!!(e.label||e.startLabelLeft||e.startLabelRight||e.endLabelLeft||e.endLabelRight),"hasEdgeLabel"),zs=C(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),E_=C(async(e,t)=>{const r=Ge();let i=Zr(r);const{labelStyles:o}=Ut(t);t.labelStyle=o;const a=e.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label").attr("data-id",t.id),n=t.labelType==="markdown",c=await vi(e,t.label,{style:zs(t.labelStyle),useHtmlLabels:i,addSvgBackground:!0,isNode:!1,markdown:n,width:n?void 0:void 0},r);s.node().appendChild(c),Lt.info("abc82",t,t.labelType);let h,d;if(i){const f=c.children[0],g=Ye(c);h=await La.measure(()=>f.getBoundingClientRect()),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const f=Ye(c).select("text").node();await La.measure(()=>{h=c.getBBox(),f&&typeof f.getBBox=="function"?d=f.getBBox():d=h})}s.attr("transform",Ws(d,i)),Yl.set(t.id,a),t.width=h.width,t.height=h.height;let u;if(t.startLabelLeft){const f=e.insert("g").attr("class","edgeTerminals"),g=f.insert("g").attr("class","inner"),p=await Lo(g,t.startLabelLeft,zs(t.labelStyle)||"",!1,!1);u=p;let m=p.getBBox();if(i){const y=p.children[0],x=Ye(p);m=y.getBoundingClientRect(),x.attr("width",m.width),x.attr("height",m.height)}g.attr("transform",Ws(m,i)),Jr.get(t.id)||Jr.set(t.id,{}),Jr.get(t.id).startLeft=f,Js(u,t.startLabelLeft,m),Qs(t,"startLeft",m)}if(t.startLabelRight){const f=e.insert("g").attr("class","edgeTerminals"),g=f.insert("g").attr("class","inner"),p=await Lo(g,t.startLabelRight,zs(t.labelStyle)||"",!1,!1);u=p;let m=p.getBBox();if(i){const y=p.children[0],x=Ye(p);m=y.getBoundingClientRect(),x.attr("width",m.width),x.attr("height",m.height)}g.attr("transform",Ws(m,i)),Jr.get(t.id)||Jr.set(t.id,{}),Jr.get(t.id).startRight=f,Js(u,t.startLabelRight,m),Qs(t,"startRight",m)}if(t.endLabelLeft){const f=e.insert("g").attr("class","edgeTerminals"),g=f.insert("g").attr("class","inner"),p=await Lo(g,t.endLabelLeft,zs(t.labelStyle)||"",!1,!1);u=p;let m=p.getBBox();if(i){const y=p.children[0],x=Ye(p);m=y.getBoundingClientRect(),x.attr("width",m.width),x.attr("height",m.height)}g.attr("transform",Ws(m,i)),Jr.get(t.id)||Jr.set(t.id,{}),Jr.get(t.id).endLeft=f,Js(u,t.endLabelLeft,m),Qs(t,"endLeft",m)}if(t.endLabelRight){const f=e.insert("g").attr("class","edgeTerminals"),g=f.insert("g").attr("class","inner"),p=await Lo(g,t.endLabelRight,zs(t.labelStyle)||"",!1,!1);u=p;let m=p.getBBox();if(i){const y=p.children[0],x=Ye(p);m=y.getBoundingClientRect(),x.attr("width",m.width),x.attr("height",m.height)}g.attr("transform",Ws(m,i)),Jr.get(t.id)||Jr.set(t.id,{}),Jr.get(t.id).endRight=f,Js(u,t.endLabelRight,m),Qs(t,"endRight",m)}return c},"insertEdgeLabel");function Qs(e,t,r){e.terminalLabelSizes??={},e.terminalLabelSizes[t]={width:r.width,height:r.height}}C(Qs,"recordTerminalLabelSize");function Js(e,t,r){Zr(Ge())&&e&&(e.style.width=Math.max(t.length*9,r.width)+"px",e.style.height=r.height+"px")}C(Js,"setTerminalWidth");var P_=C((e,t)=>{let r=e.x,i=e.y;if(t?.updatedPath){const o=Si.calcLabelPosition(t.updatedPath);if(t.originalPath){const a=Si.calcLabelPosition(t.originalPath);r=e.x+(o.x-a.x),i=e.y+(o.y-a.y)}else r=o.x,i=o.y}return{x:r,y:i}},"resolveEdgeLabelPosition"),I_=C((e,t)=>{Lt.debug("Moving label abc88 ",e.id,e.label,Yl.get(e.id),t);const r=Ge(),{subGraphTitleTotalMargin:i}=Fn(r);if(e.label){const a=Yl.get(e.id),{x:s,y:n}=P_(e,t);Lt.debug("Moving label "+e.label+" from (",e.x,",",e.y,") to (",s,",",n,") abc88"),a.attr("transform",`translate(${s}, ${n+i/2})`)}const o=t.updatedPath?t.updatedPath:t.originalPath;if(e.startLabelLeft){const a=Jr.get(e.id).startLeft;let s=e.x,n=e.y;if(o){const l=Si.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",o);s=l.x,n=l.y}a.attr("transform",`translate(${s}, ${n})`)}if(e.startLabelRight){const a=Jr.get(e.id).startRight;let s=e.x,n=e.y;if(o){const l=Si.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",o);s=l.x,n=l.y}a.attr("transform",`translate(${s}, ${n})`)}if(e.endLabelLeft){const a=Jr.get(e.id).endLeft;let s=e.x,n=e.y;if(o){const l=Si.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",o);s=l.x,n=l.y}a.attr("transform",`translate(${s}, ${n})`)}if(e.endLabelRight){const a=Jr.get(e.id).endRight;let s=e.x,n=e.y;if(o){const l=Si.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",o);s=l.x,n=l.y}a.attr("transform",`translate(${s}, ${n})`)}},"positionEdgeLabel"),ws=.5,Ao=C((e,t)=>Math.abs(e.x-t.x)<ws,"sharesColumn"),Fo=C((e,t)=>Math.abs(e.y-t.y)<ws,"sharesRow"),cb=C((e,t)=>Ao(e,t)&&Fo(e,t),"coincides");function hb(e,t,r){return Ao(e,t)&&!Fo(e,t)?Ao(r,t):Fo(e,t)&&!Ao(e,t)?Fo(r,t):Ao(r,t)||Fo(r,t)}C(hb,"keepsArrivalAxis");function db(e,t,r){return cb(e,t)?{heading:t,from:r}:{heading:e,from:t}}C(db,"arrivalSegment");function ub({heading:e,from:t},r,i){return(e.x-t.x)*(i.x-r.x)+(e.y-t.y)*(i.y-r.y)<0}C(ub,"runsAgainstHeading");function fb({heading:e,from:t},r,i){return Fo(e,t)&&!Ao(e,t)?{x:i.x,y:r.y}:Ao(e,t)&&!Fo(e,t)?{x:r.x,y:i.y}:i}C(fb,"snapToArrivalAxis");function gb(e,t,r,i){if((Ao(e,t)||Fo(e,t))&&!hb(e,t,i))return e;const a=db(e,t,r);return ub(a,t,i)?t:fb(a,t,i)}C(gb,"dockFinalPoint");function pb(e){const t=Object.hasOwn(Ur,e)?Ur[e]:0;return Number.isFinite(t)?t:0}C(pb,"markerPullBack");function mb({originalLast:e,lastInner:t,newLast:r,minLength:i}){const o=!cb(e,t),a=Math.hypot(r.x-t.x,r.y-t.y);return a>=Math.max(ws,i)?r:o&&a>=ws?e:void 0}C(mb,"finalDockPoint");var O_=C((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith("-to-label")||!Array.isArray(t)||t.length!==2)return t;const[r,i]=t,o=Math.abs(i.x-r.x),a=Math.abs(i.y-r.y);return o<.001||a<.001?t:a>=o?[r,{x:r.x,y:i.y},i]:[r,{x:i.x,y:r.y},i]},"orthogonalizeToLabelClippedPoints"),D_=C((e,t)=>{const r=e.x,i=e.y,o=Math.abs(t.x-r),a=Math.abs(t.y-i),s=e.width/2,n=e.height/2;return o>=s||a>=n},"outsideNode"),R_=C((e,t,r)=>{Lt.debug(`intersection calc abc89:
292
+ `;if(!t.domId)throw new Error(`defaultMindmapNode: node "${t.id}" is missing a domId — was render.ts domId prefixing skipped?`);const u=o.append("path").attr("id",t.domId).attr("class","node-bkg node-"+t.type).attr("style",i).attr("d",d);return o.append("line").attr("class","node-line-").attr("x1",-l/2).attr("y1",c/2).attr("x2",l/2).attr("y2",c/2),n.attr("transform",`translate(${-a.width/2}, ${-a.height/2})`),o.append(()=>n.node()),ee(t,u),t.calcIntersect=function(f,g){return Yt.rect(f,g)},t.intersect=function(f){return Yt.rect(t,f)},o}C(N0,"defaultMindmapNode");async function q0(e,t){const r={padding:t.padding??0};return yu(e,t,r)}C(q0,"mindmapCircle");var Wa=36,da=50,TB=100,BB=80,oa=6,Ka=16,_B="bpmn",LB={start:{rings:1,strokeWidth:1.6},intermediate:{rings:2,strokeWidth:1.4},boundary:{rings:2,strokeWidth:1.4},end:{rings:1,strokeWidth:3.4}},Xg;async function W0(){return Xg??=Ve(async()=>{const{bpmnIcons:e}=await import("./ByGoYv9M.js");return{bpmnIcons:e}},[],import.meta.url).then(({bpmnIcons:e})=>{ak(e.prefix)||mm([{name:e.prefix,icons:e}])}),Xg}C(W0,"ensureBpmnIcons");function z0(e){const t=e.metadata?.dataDirection;return t==="input"||t==="output"?t:void 0}C(z0,"dataDirectionOf");function H0(e){return e.metadata?.isCollection===!0}C(H0,"isCollectionData");async function Wl(e,t){return await W0(),$a(e,{height:t,width:t,fallbackPrefix:_B})}C(Wl,"glyphSvg");var _n=C((e,t,r)=>{const i=(t.x??0)-(t.left??0),o=(t.y??0)-(t.top??0);e.attr("transform",`translate(${-t.width/2-i},${r-t.height/2-o})`)},"positionLabelBelow"),Y0=C(async(e,t,r)=>{if(!t)return;const i=e.append("g").attr("class","bpmn-glyph");i.html(`<g>${await Wl(t,r)}</g>`),i.attr("transform",`translate(${-r/2}, ${-r/2})`)},"appendGlyph"),Ln=C((e,t,r,i,o)=>{o&&(t.metadata={...t.metadata??{},drawnExtent:o});const a=e.insert("rect",":first-child").attr("class","bpmn-bounds").attr("x",-r/2).attr("y",-i/2).attr("width",r).attr("height",i).attr("opacity",0).attr("aria-hidden","true");return ee(t,a),a},"reserveBounds"),AB=8,zl=C((e,t,r)=>Math.min(Math.max(e,t),r),"clamp"),nc=C((e,t,r,i,o)=>{const a=e.x??0,s=e.y??0,n=t/2,l=r/2,c=i.x-a,h=i.y-s,d=o??(Math.abs(c)*l>Math.abs(h)*n?c>=0?"right":"left":h>=0?"bottom":"top"),u=C(f=>Math.max(0,f-Math.min(AB,f/2)),"reach");return d==="left"||d==="right"?{x:a+(d==="right"?n:-n),y:zl(i.y,s-u(l),s+u(l))}:{x:zl(i.x,a-u(n),a+u(n)),y:s+(d==="bottom"?l:-l)}},"faceProjectIntersect"),FB=C((e,t,r)=>{const i=e.x??0,o=e.y??0,a=t/2,s=r.x-i,n=r.y-o,l=a*.85;if(Math.abs(n)>=Math.abs(s)){const h=zl(s,-l,l);return{x:i+h,y:o+Math.sign(n||1)*Math.sqrt(a*a-h*h)}}const c=zl(n,-l,l);return{x:i+Math.sign(s||1)*Math.sqrt(a*a-c*c),y:o+c}},"ringIntersect"),$B=C((e,t,r,i)=>{const o=e.x??0,a=e.y??0,s=t/2,n=r/2,l=i.x-o,c=i.y-a;return Math.abs(l)*n>Math.abs(c)*s?{x:o+Math.sign(l)*s,y:a}:{x:o,y:a+Math.sign(c||1)*n}},"faceCentreIntersect");async function An(e,t,r){const i=t,{labelStyles:o,nodeStyles:a}=Ut(t);t.labelStyle=o;const{rings:s,strokeWidth:n}=LB[r],l=Wa/2,{shapeSvg:c,bbox:h,label:d}=await he(e,t,se(t,`bpmn-event bpmn-event-${r}`)),u=c.insert("g",":first-child").attr("class","bpmn-event-body");u.attr("style",a);for(let y=0;y<s;y++)u.append("circle").attr("class",y===0?"bpmn-event-ring":"bpmn-event-ring bpmn-event-ring-inner").attr("r",l-y*3).style("stroke-width",`${n}px`);await Y0(u,i.icon,Ka);const f=h.height>0&&!!t.label,g=f?oa+h.height:0,p=Wa+2*g,m=Math.max(Wa,f?h.width:0);return f&&_n(d,h,l+oa+h.height/2),Ln(c,t,m,p,{width:Wa,height:Wa}),t.intersect=function(y){return FB(t,Wa,y)},c}C(An,"renderBpmnEvent");async function X0(e,t){return An(e,t,"start")}C(X0,"bpmnStart");async function j0(e,t){return An(e,t,"intermediate")}C(j0,"bpmnIntermediate");async function G0(e,t){return An(e,t,"boundary")}C(G0,"bpmnBoundary");async function U0(e,t){return An(e,t,"end")}C(U0,"bpmnEnd");async function V0(e,t){const r=t,{labelStyles:i,nodeStyles:o}=Ut(t);t.labelStyle=i;const a=da/2,{shapeSvg:s,bbox:n,label:l}=await he(e,t,se(t,"bpmn-gateway")),c=s.insert("g",":first-child").attr("class","bpmn-gateway-body");c.append("polygon").attr("class","bpmn-gateway-diamond").attr("points",`0,${-a} ${a},0 0,${a} ${-a},0`).attr("style",o),await Y0(c,r.icon,Ka+2);const h=n.height>0&&!!t.label,d=h?oa+n.height:0,u=da+2*d,f=Math.max(da,h?n.width:0);return h&&_n(l,n,a+oa+n.height/2),Ln(s,t,f,u,{width:da,height:da}),t.intersect=function(g){return $B(t,da,da,g)},s}C(V0,"bpmnGateway");async function Z0(e,t){const r=t,{labelStyles:i,nodeStyles:o}=Ut(t);t.labelStyle=i;const{shapeSvg:a,bbox:s,label:n}=await he(e,t,se(t,"bpmn-activity")),l=r.markers??[],c=r.icon,h=c?Ka+6:10,d=l.length>0?Ka+4:10,u=Math.max(TB,s.width+16),f=Math.max(BB,s.height+h+d),g=a.insert("g",":first-child").attr("class","bpmn-activity-body");if(g.append("rect").attr("class","bpmn-activity-rect").attr("x",-u/2).attr("y",-f/2).attr("width",u).attr("height",f).attr("rx",10).attr("ry",10).attr("style",o),c){const p=g.append("g").attr("class","bpmn-activity-icon");p.html(`<g>${await Wl(c,Ka)}</g>`),p.attr("transform",`translate(${-u/2+6}, ${-f/2+6})`)}if(l.length>0){const p=g.append("g").attr("class","bpmn-activity-markers"),m=Ka-2,y=l.length*m;for(const[x,b]of l.entries()){const S=p.append("g");S.html(`<g>${await Wl(b,m)}</g>`),S.attr("transform",`translate(${-y/2+x*m}, 0)`)}p.attr("transform",`translate(0, ${f/2-m-3})`)}if(s.height>0){const p=-f/2+h,m=f/2-d;_n(n,s,(p+m)/2)}return ee(t,g),t.intersect=function(p){return nc(t,u,f,p)},a}C(Z0,"bpmnActivity");var qs=36,za=50,Xn=10;async function K0(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,label:s}=await he(e,t,se(t,"bpmn-data-object")),n=o.insert("g",":first-child").attr("class","bpmn-data-body"),l=-qs/2,c=-za/2,h=qs/2,d=za/2;n.append("path").attr("class","bpmn-data-page").attr("d",`M${l},${c} H${h-Xn} L${h},${c+Xn} V${d} H${l} Z`).attr("style",i),n.append("path").attr("class","bpmn-data-fold").attr("d",`M${h-Xn},${c} V${c+Xn} H${h}`);const u=z0(t);u&&n.append("path").attr("class",`bpmn-data-arrow bpmn-data-arrow-${u}`).attr("d",`M${l+4},${c+9} h7 v-3 l5,4.5 -5,4.5 v-3 h-7 Z`),H0(t)&&n.append("path").attr("class","bpmn-data-collection").attr("d",`M-4,${d-11} v9 M0,${d-11} v9 M4,${d-11} v9`);const f=a.height>0&&!!t.label,g=f?oa+a.height:0,p=za+2*g,m=Math.max(qs,f?a.width:0);return f&&_n(s,a,za/2+oa+a.height/2),Ln(o,t,m,p,{width:qs,height:za}),t.intersect=function(y){return nc(t,qs,za,y)},o}C(K0,"bpmnDataObject");var to=50;async function Q0(e,t){const{labelStyles:r,nodeStyles:i}=Ut(t);t.labelStyle=r;const{shapeSvg:o,bbox:a,label:s}=await he(e,t,se(t,"bpmn-data-store")),n=o.insert("g",":first-child").attr("class","bpmn-data-body"),l=to/2,c=6;n.append("path").attr("class","bpmn-store-body").attr("d",`M${-l},${-l+c} a${l},${c} 0 0 1 ${to},0 V${l-c} a${l},${c} 0 0 1 ${-to},0 Z`).attr("style",i);for(const g of[0,5,10])n.append("path").attr("class","bpmn-store-rings").attr("d",`M${-l},${-l+c+g} a${l},${c} 0 0 0 ${to},0`);const h=a.height>0&&!!t.label,d=h?oa+a.height:0,u=to+2*d,f=Math.max(to,h?a.width:0);return h&&_n(s,a,l+oa+a.height/2),Ln(o,t,f,u,{width:to,height:to}),t.intersect=function(g){return nc(t,to,to,g)},o}C(Q0,"bpmnDataStore");async function J0(e,t){const{labelStyles:r}=Ut(t);t.labelStyle=r,t.wrappingWidth=160;const{shapeSvg:i,bbox:o,label:a}=await he(e,t,se(t,"bpmn-annotation")),s=8,n=Math.max(28,o.height+s*2),l=o.width+s*2+6,c=t.metadata?.attachFace==="right"?"right":"left";i.insert("g",":first-child").attr("class","bpmn-annotation-body").append("path").attr("class","bpmn-annotation-bracket").attr("d",c==="right"?`M${l/2-6},${-n/2} h6 V${n/2} h-6`:`M${-l/2+6},${-n/2} h-6 V${n/2} h6`);const d=c==="right"?-l/2+s:-l/2+s+6;return a.attr("transform",`translate(${d-(o.x??0)+(o.left??0)},${-o.height/2-((o.y??0)-(o.top??0))})`),Ln(i,t,l,n),t.intersect=function(u){return nc(t,l,n,u,c)},i}C(J0,"bpmnAnnotation");var EB=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:y0},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:g0},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:x0},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:k0},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:$x},{semanticName:"Data Store",name:"Data Store",shortName:"datastore",description:"Data flow diagram data store",aliases:["data-store"],handler:Ex},{semanticName:"Folder",name:"Folder",shortName:"folder",description:"Folder or directory",aliases:["directory"],handler:Nx},{semanticName:"Bucket",name:"Bucket",shortName:"bucket",description:"Object storage bucket",handler:mx},{semanticName:"Console",name:"Console (terminal window)",shortName:"console",description:"Terminal or console window",handler:vx},{semanticName:"Browser",name:"Browser",shortName:"browser",description:"Browser window",handler:Cx},{semanticName:"Person",name:"Person",shortName:"person",description:"Person (circular head above a rounded body)",handler:Fx},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:yu},{semanticName:"Bang",name:"Bang",shortName:"bang",description:"Bang",aliases:["bang"],handler:D0},{semanticName:"Cloud",name:"Cloud",shortName:"cloud",description:"cloud",aliases:["cloud"],handler:R0},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:d0},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:zx},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:Qx},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:Kx},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:B0},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:Vx},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Ix},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:M0},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:wx},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:p0},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:w0},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:C0},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:qx},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:Hx},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:Bx},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:_x},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Lx},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:Jx},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:A0},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:Wx},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:T0},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:t0},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Ax},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Px},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:L0},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:$0},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Dx},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:_0},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:Rx},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:m0},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:c0},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:l0},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:px},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Tx},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:v0},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:S0},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:F0},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:u0},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:e0}],PB=C(()=>{const t=[...Object.entries({state:b0,choice:kx,note:h0,composite:Sx,rectWithTitle:f0,labelRect:Zx,block_arrow:bx,collapsedGroup:xx,iconSquare:Gx,iconCircle:Xx,icon:Yx,iconRounded:jx,imageSquare:Ux,anchor:fx,kanbanItem:O0,mindmapCircle:q0,defaultMindmapNode:N0,classBox:P0,erBox:bu,requirementBox:I0,usecaseActor:r0,usecaseActorHollow:o0,usecaseActorAwesome:i0,usecaseActorIcon:a0,usecaseBusiness:s0,usecaseEllipse:Ox,usecaseJsonTable:n0,"bpmn-start":X0,"bpmn-intermediate":j0,"bpmn-boundary":G0,"bpmn-end":U0,"bpmn-gateway":V0,"bpmn-activity":Z0,"bpmn-data":K0,"bpmn-data-store":Q0,"bpmn-annotation":J0}),...EB.flatMap(r=>[r.shortName,..."aliases"in r?r.aliases:[],..."internalAliases"in r?r.internalAliases:[]].map(o=>[o,r.handler]))];return Object.fromEntries(t)},"generateShapeMap"),tb=PB();function IB(e){return e in tb}C(IB,"isValidShape");var Fn=C(({flowchart:e})=>{const t=e?.subGraphTitleMargin?.top??0,r=e?.subGraphTitleMargin?.bottom??0,i=t+r;return{subGraphTitleTopMargin:t,subGraphTitleBottomMargin:r,subGraphTitleTotalMargin:i}},"getSubGraphTitleMargins"),lc=new Map;async function eb(e,t,r){let i,o;t.shape==="rect"&&(t.rx&&t.ry?t.shape="roundedRect":t.shape="squareRect");const a=t.shape?tb[t.shape]:void 0;if(!a)throw new Error(`No such shape: ${t.shape}. Please check your syntax.`);if(t.link){let s;r.config.securityLevel==="sandbox"?s="_top":t.linkTarget&&(s=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",s??null),o=await a(i,t,r)}else o=await a(e,t,r),i=o;return i.attr("data-look",Hr(t.look)),t.tooltip&&o.attr("title",t.tooltip),lc.set(t.id,i),t.haveCallback&&i.attr("class",i.attr("class")+" clickable"),i}C(eb,"insertNode");var kP=C((e,t)=>{lc.set(t.id,e)},"setNodeElem"),SP=C(()=>{lc.clear()},"clear"),vP=C(e=>{const t=lc.get(e.id);Lt.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const r=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-r)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode"),rb=C(async(e,t,{variant:r="swimlane"}={})=>{const i=r==="pool",o=i?"pool swimlane":"swimlane",a=i?"pool-label swimlane-label":"swimlane-label",s=i?"pool-title swimlane-title":"swimlane-title",n=i?"pool-body swimlane-body":"swimlane-body",l=Ge(),{theme:c,themeVariables:h,handDrawnSeed:d}=l,{clusterBkg:u,clusterBorder:f,borderColorArray:g}=h,p=f,{labelStyles:m,nodeStyles:y,borderStyles:x,backgroundStyles:b}=Ut(t),S=e.insert("g").attr("class","cluster "+o+" "+(t.cssClasses||"")).attr("id",t.domId??t.id).attr("data-id",t.id).attr("data-et","cluster").attr("data-look",t.look);Oi(S,t.colorIndex,c,g);const T=mo(l.flowchart.htmlLabels),k=t.direction==="LR",_=S.insert("g").attr("class","cluster-label "+a),L=await vi(_,t.label,{style:t.labelStyle,useHtmlLabels:T,isNode:!0,width:t.width});let v=L.getBBox();if(T){const Y=L.children[0],X=Ye(L);v=Y.getBoundingClientRect(),X.attr("width",v.width),X.attr("height",v.height)}const M=t.padding??0,B=t.width<=v.width+M?v.width+M:t.width;t.width<=v.width+M?t.diff=(B-t.width)/2-M:t.diff=-M;const E=t.height,O=t.y-E/2,$=t.y+E/2,I=t.x-B/2,F=t.swimlaneContentTop!==void 0?t.swimlaneContentTop:O+E/3,R=k?4:0,q=v.height+2*R;let D,P;if(k){const Y=Math.max(q,v.height+2*R),X=I+Y,z=Math.max(0,B-Y);if(t.look==="handDrawn"){const V=Zt.svg(S),Q=Gt(t,{roughness:.7,fill:u,stroke:p,seed:d}),rt=Gt(t,{roughness:.7,fill:"none",stroke:p,seed:d}),ht=V.rectangle(I,O,Y,E,Q);D=S.insert(()=>ht,":first-child").attr("class",s);const H=V.rectangle(X,O,z,E,rt);P=S.insert(()=>H,":first-child").attr("class",n),D.select("path:nth-child(2)").attr("style",x.join(";")),D.select("path").attr("style",b.join(";").replace("fill","stroke"))}else D=S.insert("rect",":first-child"),P=S.insert("rect",":first-child"),D.attr("class",s).attr("style",y).attr("x",I).attr("y",O).attr("width",Y).attr("height",E).attr("fill",u).attr("stroke",p),P.attr("class",n).attr("style",y).attr("x",X).attr("y",O).attr("width",z).attr("height",E).attr("fill","none").attr("stroke",p);const U=I+Y/2,j=t.y;_.attr("transform",`translate(${U}, ${j}) rotate(-90) translate(${-v.width/2}, ${-v.height/2})`)}else{const Y=Math.max(0,F-O),X=Math.min(q,Y),z=O+X,U=Math.max(0,$-z),j=t.x-B/2;if(t.look==="handDrawn"){const rt=Zt.svg(S),ht=Gt(t,{roughness:.7,fill:u,stroke:p,fillWeight:3,seed:d}),H=Gt(t,{roughness:.7,fill:"none",stroke:p,seed:d}),G=rt.rectangle(j,O,B,X,ht);D=S.insert(()=>G,":first-child").attr("class",s);const K=rt.rectangle(j,z,B,U,H);P=S.insert(()=>K,":first-child").attr("class",n),D.select("path:nth-child(2)").attr("style",x.join(";")),D.select("path").attr("style",b.join(";").replace("fill","stroke"))}else D=S.insert("rect",":first-child"),P=S.insert("rect",":first-child"),D.attr("class",s).attr("style",y).attr("x",j).attr("y",O).attr("width",B).attr("height",X).attr("fill",u).attr("stroke",p),P.attr("class",n).attr("style",y).attr("x",j).attr("y",z).attr("width",B).attr("height",U).attr("fill","none").attr("stroke",p);const V=t.x-v.width/2,Q=O+(X-v.height)/2;_.attr("transform",`translate(${V}, ${Q})`)}if(Lt.trace("Swimlane data ",t,JSON.stringify(t)),m){const Y=_.select("span");Y&&Y.attr("style",m)}return t.offsetX=0,t.width=B,t.height=E,t.offsetY=v.height-M/2,t.intersect=function(Y){return Wo(t,Y)},{cluster:S,labelBBox:v}},"swimlane"),ib=C(async(e,t)=>{Lt.info("Creating subgraph rect for ",t.id,t);const r=Ge(),{theme:i,themeVariables:o,handDrawnSeed:a}=r,{clusterBkg:s,clusterBorder:n,borderColorArray:l}=o,{labelStyles:c,nodeStyles:h,borderStyles:d,backgroundStyles:u}=Ut(t),f=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look);Oi(f,t.colorIndex,i,l);const g=Zr(r),p=f.insert("g").attr("class","cluster-label ");let m;t.labelType==="markdown"?m=await vi(p,t.label,{style:t.labelStyle,useHtmlLabels:g,isNode:!0,width:t.width}):m=await Lo(p,t.label,t.labelStyle||"",!1,!0);let y=m.getBBox();if(Zr(r)){const v=m.children[0],M=Ye(m);y=v.getBoundingClientRect(),M.attr("width",y.width),M.attr("height",y.height)}const x=t.width<=y.width+t.padding?y.width+t.padding:t.width;t.width<=y.width+t.padding?t.diff=(x-t.width)/2-t.padding:t.diff=-t.padding;const b=t.height,S=t.x-x/2,T=t.y-b/2;Lt.trace("Data ",t,JSON.stringify(t));let k;if(t.look==="handDrawn"){const v=Zt.svg(f),M=Gt(t,{roughness:.7,fill:s,stroke:n,fillWeight:3,seed:a}),B=v.path(Mi(S,T,x,b,0),M);k=f.insert(()=>(Lt.debug("Rough node insert CXC",B),B),":first-child"),k.select("path:nth-child(2)").attr("style",d.join(";")),k.select("path").attr("style",u.join(";").replace("fill","stroke"))}else k=f.insert("rect",":first-child"),k.attr("style",h).attr("rx",t.rx).attr("ry",t.ry).attr("x",S).attr("y",T).attr("width",x).attr("height",b);const{subGraphTitleTopMargin:_}=Fn(r);if(p.attr("transform",`translate(${t.x-y.width/2}, ${t.y-t.height/2+_})`),c){const v=p.select("span");v&&v.attr("style",c)}const L=k.node().getBBox();return t.offsetX=0,t.width=L.width,t.height=L.height,t.offsetY=y.height-t.padding/2,t.intersect=function(v){return Wo(t,v)},{cluster:f,labelBBox:y}},"rect"),OB=C((e,t)=>{const r=e.insert("g").attr("class","note-cluster").attr("id",t.domId),i=r.insert("rect",":first-child"),o=0*t.padding,a=o/2;i.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-a).attr("y",t.y-t.height/2-a).attr("width",t.width+o).attr("height",t.height+o).attr("fill","none");const s=i.node().getBBox();return t.width=s.width,t.height=s.height,t.intersect=function(n){return Wo(t,n)},{cluster:r,labelBBox:{width:0,height:0}}},"noteGroup"),DB=C(async(e,t)=>{const r=Ge(),{theme:i,themeVariables:o,handDrawnSeed:a}=r,{altBackground:s,borderColorArray:n,compositeBackground:l,compositeTitleBackground:c,nodeBorder:h}=o,d=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-id",t.id).attr("data-look",t.look);Oi(d,t.colorIndex,i,n);const u=d.insert("g",":first-child"),f=d.insert("g").attr("class","cluster-label");let g=d.append("rect");const p=await Lo(f,t.label,t.labelStyle,void 0,!0);let m=p.getBBox();if(Zr(r)){const B=p.children[0],E=Ye(p);m=B.getBoundingClientRect(),E.attr("width",m.width),E.attr("height",m.height)}const y=0*t.padding,x=y/2,b=(t.width<=m.width+t.padding?m.width+t.padding:t.width)+y;t.width<=m.width+t.padding?t.diff=(b-t.width)/2-t.padding:t.diff=-t.padding;const S=t.height+y,T=t.height+y-m.height-6,k=t.x-b/2,_=t.y-S/2;t.width=b;const L=t.y-t.height/2-x+m.height+2;let v;if(t.look==="handDrawn"){const B=t.cssClasses.includes("statediagram-cluster-alt"),E=Zt.svg(d),O=t.rx||t.ry?E.path(Mi(k,_,b,S,10),{roughness:.7,fill:c,fillStyle:"solid",stroke:h,seed:a}):E.rectangle(k,_,b,S,{seed:a});v=d.insert(()=>O,":first-child");const $=E.rectangle(k,L,b,T,{fill:B?s:l,fillStyle:B?"hachure":"solid",stroke:h,seed:a});v=d.insert(()=>O,":first-child"),g=d.insert(()=>$),v.attr("class","outer"),g.attr("class","inner")}else v=u.insert("rect",":first-child"),v.attr("class","outer").attr("x",k).attr("y",_).attr("width",b).attr("height",S).attr("data-look",t.look),g.attr("class","inner").attr("x",k).attr("y",L).attr("width",b).attr("height",T);f.attr("transform",`translate(${t.x-m.width/2}, ${_+1-(Zr(r)?0:3)})`);const M=v.node().getBBox();return t.height=M.height,t.offsetX=0,t.offsetY=m.height-t.padding/2,t.labelBBox=m,t.intersect=function(B){return Wo(t,B)},{cluster:d,labelBBox:m}},"roundedWithTitle"),RB=C(async(e,t)=>{Lt.info("Creating subgraph rect for ",t.id,t);const r=Ge(),{themeVariables:i,handDrawnSeed:o}=r,{clusterBkg:a,clusterBorder:s}=i,{labelStyles:n,nodeStyles:l,borderStyles:c,backgroundStyles:h}=Ut(t),d=e.insert("g").attr("class","cluster "+t.cssClasses).attr("id",t.domId).attr("data-look",t.look),u=Zr(r),f=d.insert("g").attr("class","cluster-label "),g=await vi(f,t.label,{style:t.labelStyle,useHtmlLabels:u,isNode:!0,width:t.width});let p=g.getBBox();if(Zr(r)){const _=g.children[0],L=Ye(g);p=_.getBoundingClientRect(),L.attr("width",p.width),L.attr("height",p.height)}const m=t.width<=p.width+t.padding?p.width+t.padding:t.width;t.width<=p.width+t.padding?t.diff=(m-t.width)/2-t.padding:t.diff=-t.padding;const y=t.height,x=t.x-m/2,b=t.y-y/2;Lt.trace("Data ",t,JSON.stringify(t));let S;if(t.look==="handDrawn"){const _=Zt.svg(d),L=Gt(t,{roughness:.7,fill:a,stroke:s,fillWeight:4,seed:o}),v=_.path(Mi(x,b,m,y,t.rx),L);S=d.insert(()=>(Lt.debug("Rough node insert CXC",v),v),":first-child"),S.select("path:nth-child(2)").attr("style",c.join(";")),S.select("path").attr("style",h.join(";").replace("fill","stroke"))}else S=d.insert("rect",":first-child"),S.attr("style",l).attr("rx",t.rx).attr("ry",t.ry).attr("x",x).attr("y",b).attr("width",m).attr("height",y);const{subGraphTitleTopMargin:T}=Fn(r);if(f.attr("transform",`translate(${t.x-p.width/2}, ${t.y-t.height/2+T})`),n){const _=f.select("span");_&&_.attr("style",n)}const k=S.node().getBBox();return t.offsetX=0,t.width=k.width,t.height=k.height,t.offsetY=p.height-t.padding/2,t.intersect=function(_){return Wo(t,_)},{cluster:d,labelBBox:p}},"kanbanSection"),NB=C((e,t)=>{const r=Ge(),{theme:i,themeVariables:o,handDrawnSeed:a}=r,{altBackground:s,nodeBorder:n,borderColorArray:l}=o,c=e.insert("g").attr("class",t.cssClasses).attr("id",t.domId).attr("data-look",t.look);Oi(c,t.colorIndex,i,l);const h=c.insert("g",":first-child"),d=0*t.padding,u=t.width+d;t.diff=-t.padding;const f=t.height+d,g=t.x-u/2,p=t.y-f/2;t.width=u;let m;if(t.look==="handDrawn"){const b=Zt.svg(c).rectangle(g,p,u,f,{fill:s??"#efefef",fillStyle:"solid",roughness:.5,strokeLineDash:[5],stroke:n,seed:a});m=c.insert(()=>b,":first-child").attr("class","divider")}else{m=h.insert("rect",":first-child");let x="outer";t.look,x="divider",m.attr("class",x).attr("x",g).attr("y",p).attr("width",u).attr("height",f).attr("data-look",t.look)}const y=m.node().getBBox();return t.height=y.height,t.offsetX=0,t.offsetY=0,t.intersect=function(x){return Wo(t,x)},{cluster:c,labelBBox:{}}},"divider"),qB=C(async(e,t,r)=>{Lt.info(`Creating ${r.cssClass} for `,t.id,t);const i=Ge(),{theme:o,themeVariables:a,handDrawnSeed:s}=i,{borderColorArray:n}=a,{labelStyles:l,borderStyles:c}=Ut(t),h=e.insert("g").attr("class","cluster "+r.cssClass+" "+t.cssClasses).attr("id",t.domId??t.id).attr("data-look",t.look);Oi(h,t.colorIndex,o,n);const d=Zr(i),u=h.insert("g").attr("class","cluster-label");let f={width:0,height:0};const g=t.label?.trim();if(g){let T;if(t.labelType==="markdown"?T=await vi(u,t.label,{style:t.labelStyle,useHtmlLabels:d,isNode:!0,width:t.width}):T=await Lo(u,t.label,t.labelStyle||"",!1,!0),f=T.getBBox(),d){const k=T.children[0],_=Ye(T);f=k.getBoundingClientRect(),_.attr("width",f.width),_.attr("height",f.height)}}const p=t.width<=f.width+t.padding?f.width+t.padding:t.width;t.width<=f.width+t.padding?t.diff=(p-t.width)/2-t.padding:t.diff=-t.padding;const m=t.height,y=t.x-p/2,x=t.y-m/2;let b;if(t.look==="handDrawn"){const T=Zt.svg(h),k=Gt(t,{roughness:r.roughness,fill:r.fill,stroke:r.stroke,strokeWidth:r.strokeWidth,seed:s,...r.fill==="none"?{fillWeight:0}:{fillStyle:"solid"},...r.strokeDash?{strokeLineDash:r.strokeDash}:{}}),_=T.path(Mi(y,x,p,m,r.rx),k);b=h.insert(()=>_,":first-child"),b.select("path:nth-child(2)").attr("style",c.join(";"))}else b=h.insert("rect",":first-child"),b.attr("rx",r.rx).attr("ry",r.rx).attr("x",y).attr("y",x).attr("width",p).attr("height",m).attr("fill",r.fill).attr("stroke",r.stroke).attr("stroke-width",r.strokeWidth+"px"),r.strokeDash&&b.attr("stroke-dasharray",r.strokeDash.join(", "));if(g){const{subGraphTitleTopMargin:T}=Fn(i);if(u.attr("transform",`translate(${t.x-f.width/2}, ${t.y-t.height/2+T})`),l){const k=u.select("span");k&&k.attr("style",l)}}const S=b.node().getBBox();return t.offsetX=0,t.width=S.width,t.height=S.height,t.offsetY=f.height-t.padding/2,t.intersect=function(T){return Wo(t,T)},{cluster:h,labelBBox:f}},"createContainerGroup"),WB=C(async(e,t)=>{const{themeVariables:r}=Ge(),i=r.flowContainerStroke||r.secondaryBorderColor;return qB(e,t,{cssClass:"flow-cluster",rx:10,fill:"none",stroke:i,strokeWidth:.75,roughness:.7})},"flowGroup"),zB=C((e,t)=>{const r=e.boundaryType||"rect",i=r==="package"?20:e.padding,o=r==="package"?t.height+10:0,a=Math.max(e.width,t.width+i),s=r==="package"?Math.max(e.height,o+e.padding*2):e.height,n=e.x-a/2,l=e.y-s/2;return{boundaryType:r,width:a,height:s,x:n,y:l,bodyY:l+o,bodyHeight:s-o,tabHeight:o,tabWidth:r==="package"?Math.min(a,Math.max(80,t.width+20)):0}},"getUsecaseSystemBoundaryGeometry"),HB=C(async(e,t)=>{Lt.info("Creating usecase system boundary for ",t.id,t);const r=Ge(),{theme:i,themeVariables:o,handDrawnSeed:a}=r,{clusterBkg:s,clusterBorder:n,borderColorArray:l}=o,{labelStyles:c,nodeStyles:h}=Ut(t),{stylesMap:d}=sa(t),u=t.boundaryType||"rect",f=e.insert("g").attr("class",`cluster usecase-system-boundary usecase-system-boundary-${u} ${t.cssClasses}`).attr("id",typeof t.domId=="string"?t.domId:t.id).attr("data-boundary-type",u).attr("data-look",t.look);Oi(f,t.colorIndex,i,l);const g=Zr(r),p=f.insert("g").attr("class","cluster-label system-boundary-title"),m=await vi(p,t.label,{style:c,useHtmlLabels:g,isNode:!0});let y=m.getBBox();if(g){const O=m.children[0],$=Ye(m);y=O.getBoundingClientRect(),$.attr("width",y.width),$.attr("height",y.height)}const x=zB(t,y),{width:b,height:S,x:T,y:k,bodyY:_,bodyHeight:L,tabHeight:v,tabWidth:M}=x;t.diff=t.width<=y.width+t.padding?(b-t.width)/2-t.padding:-t.padding;const B=Gt(t,{fill:d.get("fill")||s,stroke:d.get("stroke")||n,strokeWidth:d.get("stroke-width")?.replace("px","")||1,seed:a});if(t.look==="handDrawn"){const O=Zt.svg(f),$=O.rectangle(T,_,b,L,B);if(f.insert(()=>$,":first-child").attr("class","boundary-body label-container"),u==="package"){const I=O.rectangle(T,k,M,v,B);f.insert(()=>I,":first-child").attr("class","boundary-tab system-boundary-package-tab label-container")}}else f.insert("rect",":first-child").attr("class","boundary-body label-container").attr("style",h).attr("x",T).attr("y",_).attr("width",b).attr("height",L),u==="package"&&f.insert("rect",":first-child").attr("class","boundary-tab system-boundary-package-tab label-container").attr("style",h).attr("x",T).attr("y",k).attr("width",M).attr("height",v);const{subGraphTitleTopMargin:E}=Fn(r);return u==="package"?p.attr("transform",`translate(${T+(M-y.width)/2}, ${k+(v-y.height)/2})`):p.attr("transform",`translate(${t.x-y.width/2}, ${k+E})`),c&&(p.attr("style",c),p.select("span").attr("style",c)),t.offsetX=0,t.width=b,t.height=S,t.offsetY=y.height-t.padding/2,t.labelBBox=y,t.intersect=function(O){return Wo(t,O)},{cluster:f,labelBBox:y}},"usecaseSystemBoundary"),YB=ib,XB=C((e,t)=>rb(e,t,{variant:"pool"}),"pool"),jB={rect:ib,squareRect:YB,roundedWithTitle:DB,noteGroup:OB,divider:NB,kanbanSection:RB,flowGroup:WB,usecaseSystemBoundary:HB,swimlane:rb,pool:XB},GB=new Set(["noteGroup","divider"]),MP=C(e=>!GB.has(e??"rect"),"clusterPaintsTitle"),ob=new Map,UB=C(async(e,t)=>{const r=t.shape||"rect",i=await jB[r](e,t);return ob.set(t.id,i),i},"insertCluster"),TP=C(()=>{ob=new Map},"clear"),Ws=C((e,t)=>{if(t)return"translate("+-e.width/2+", "+-e.height/2+")";const r=e.x??0,i=e.y??0;return"translate("+-(r+e.width/2)+", "+-(i+e.height/2)+")"},"computeLabelTransform"),Ur={aggregation:17.25,extension:17.25,composition:17.25,dependency:6,lollipop:13.5,arrow_point:4,arrow_barb:0,arrow_barb_neo:5.5},jg={arrow_point:4,arrow_cross:12.5,arrow_circle:12.5,arrow_open_head:4,arrow_hollow_circle:8};function Ks(e,t){if(e===void 0||t===void 0)return{angle:0,deltaX:0,deltaY:0};e=Lr(e),t=Lr(t);const[r,i]=[e.x,e.y],[o,a]=[t.x,t.y],s=o-r,n=a-i;return{angle:Math.atan(n/s),deltaX:s,deltaY:n}}C(Ks,"calculateDeltaAndAngle");var Lr=C(e=>Array.isArray(e)?{x:e[0],y:e[1]}:e,"pointTransformer"),VB=C(e=>({x:C(function(t,r,i){let o=0;const a=Lr(i[0]).x<Lr(i[i.length-1]).x?"left":"right";if(r===0&&Object.hasOwn(Ur,e.arrowTypeStart)){const{angle:f,deltaX:g}=Ks(i[0],i[1]);o=Ur[e.arrowTypeStart]*Math.cos(f)*(g>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Ur,e.arrowTypeEnd)){const{angle:f,deltaX:g}=Ks(i[i.length-1],i[i.length-2]);o=Ur[e.arrowTypeEnd]*Math.cos(f)*(g>=0?1:-1)}const s=Math.abs(Lr(t).x-Lr(i[i.length-1]).x),n=Math.abs(Lr(t).y-Lr(i[i.length-1]).y),l=Math.abs(Lr(t).x-Lr(i[0]).x),c=Math.abs(Lr(t).y-Lr(i[0]).y),h=Ur[e.arrowTypeStart],d=Ur[e.arrowTypeEnd],u=1;if(s<d&&s>0&&n<d){let f=d+u-s;f*=a==="right"?-1:1,o-=f}if(l<h&&l>0&&c<h){let f=h+u-l;f*=a==="right"?-1:1,o+=f}return Lr(t).x+o},"x"),y:C(function(t,r,i){let o=0;const a=Lr(i[0]).y<Lr(i[i.length-1]).y?"down":"up";if(r===0&&Object.hasOwn(Ur,e.arrowTypeStart)){const{angle:f,deltaY:g}=Ks(i[0],i[1]);o=Ur[e.arrowTypeStart]*Math.abs(Math.sin(f))*(g>=0?1:-1)}else if(r===i.length-1&&Object.hasOwn(Ur,e.arrowTypeEnd)){const{angle:f,deltaY:g}=Ks(i[i.length-1],i[i.length-2]);o=Ur[e.arrowTypeEnd]*Math.abs(Math.sin(f))*(g>=0?1:-1)}const s=Math.abs(Lr(t).y-Lr(i[i.length-1]).y),n=Math.abs(Lr(t).x-Lr(i[i.length-1]).x),l=Math.abs(Lr(t).y-Lr(i[0]).y),c=Math.abs(Lr(t).x-Lr(i[0]).x),h=Ur[e.arrowTypeStart],d=Ur[e.arrowTypeEnd],u=1;if(s<d&&s>0&&n<d){let f=d+u-s;f*=a==="up"?-1:1,o-=f}if(l<h&&l>0&&c<h){let f=h+u-l;f*=a==="up"?-1:1,o+=f}return Lr(t).y+o},"y")}),"getLineFunctionsWithOffset"),ab=1,ZB=C(e=>typeof e=="number"&&Number.isFinite(e)&&e>0?e:ab,"getStepDuration"),Cu=C(e=>typeof e.step=="number"&&Number.isInteger(e.step)&&e.step>0,"isStepEdge"),Gg=[.25,.35,.15,.65,.75,.5,.85,.1,.9],Qh=9,KB=11,QB=2,JB="#333333",Ug=12,Vg=6,Zg=14,Kg=.01,t_=4.5,sb=/translate\(\s*(-?[\d.e]+)[\s,]+(-?[\d.e]+)/i,e_=4,r_=.6,i_=4,o_=C((e,t,r=ab)=>{const i=Math.max(t,e);return{begin:(e-1)*r,dur:r,gap:(i-1)*r}},"getEdgeStepTiming"),a_=C(e=>`step_${Array.from(e,t=>/[\dA-Za-z]/.test(t)?t:`_${(t.codePointAt(0)??0).toString(16)}_`).join("")}`,"toAnimationId"),s_=C(e=>{const t=/^m\s*(-?[\d.e]+)[\s,]+(-?[\d.e]+)/i.exec(e.trim());return t?`translate(${t[1]},${t[2]}) `:""},"pathStartTranslate"),n_=C(e=>Array.from(e,(t,r)=>{const i=t.codePointAt(0)??0;if(i===0)return"�";const o=i<=31||i===127,a=/\d/.test(t)&&(r===0||r===1&&e.startsWith("-"));return o||a?`\\${i.toString(16)} `:e==="-"?"\\-":i>=128||/[\w-]/.test(t)?t:`\\${t}`}).join(""),"escapeCssIdentifierFallback"),l_=C(e=>typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(e):n_(e),"escapeCssIdentifier"),c_=C((e,t)=>{const r=e.node(),i=r?.ownerSVGElement??r?.closest?.("svg")??r,o=t||i?.getAttribute("id");if(!i||!o||i.querySelector("style.edge-step-style"))return;const a=`#${l_(o)} `,s=i.ownerDocument.createElementNS("http://www.w3.org/2000/svg","style");s.setAttribute("class","edge-step-style"),s.textContent=`@media (prefers-reduced-motion: reduce) { ${a}.edge-step-dot, ${a}.edge-step-highlight { display: none; } }`,i.appendChild(s)},"ensureReducedMotionStyle"),h_=C((e,t)=>{const r=e.filter(a=>Number.isFinite(a.x)&&Number.isFinite(a.y));if(r.length===0)return;const i=r.slice(1).map((a,s)=>Math.hypot(a.x-r[s].x,a.y-r[s].y));let o=i.reduce((a,s)=>a+s,0)*t;for(const[a,s]of i.entries()){if(o<=s&&s>0){const n=o/s,l=r[a],c=r[a+1];return{x:l.x+(c.x-l.x)*n,y:l.y+(c.y-l.y)*n}}o-=s}return r[r.length-1]},"pointAlongPolyline"),d_=C((e,t)=>{const r=typeof t?.getTotalLength=="function"?t.getTotalLength():0,i=t?.getPointAtLength?.bind(t);return r>0&&i?o=>{const{x:a,y:s}=i(r*o);return{x:a,y:s}}:o=>h_(e,o)},"createPathSampler"),u_=C((e,t)=>Math.min(Number.POSITIVE_INFINITY,...t.map(r=>{const i=Math.max(Math.abs(e.x-r.x)-r.halfWidth,0),o=Math.max(Math.abs(e.y-r.y)-r.halfHeight,0);return Math.hypot(i,o)-Qh})),"roomAround"),f_=C((e,t)=>{const r=e(t),i=e(Math.max(t-Kg,0)),o=e(Math.min(t+Kg,1));if(!r||!i||!o)return[];const a=Math.hypot(o.x-i.x,o.y-i.y);if(a===0)return[];const s={x:-(o.y-i.y)/a,y:(o.x-i.x)/a};return[1,-1].map(n=>({x:r.x+s.x*Zg*n,y:r.y+s.y*Zg*n}))},"besideThePath"),g_=C((e,t)=>{const r=[...Gg.map(e),...Gg.flatMap(a=>f_(e,a))];let i,o=Number.NEGATIVE_INFINITY;for(const a of r){if(!a||!Number.isFinite(a.x)||!Number.isFinite(a.y))continue;const s=u_(a,t);if(s>=QB)return a;s>o&&(i=a,o=s)}return i},"chooseBadgePosition"),nb=C((e,t)=>({...e,halfWidth:t,halfHeight:t}),"square"),p_=C(e=>{const t=sb.exec(e.getAttribute("transform")??"");return t?{x:Number(t[1]),y:Number(t[2])}:{x:0,y:0}},"translationOf"),wu=C(e=>{const t={x:0,y:0};for(let r=e;r&&r.localName!=="svg";r=r.parentElement){const{x:i,y:o}=p_(r);t.x+=i,t.y+=o}return t},"offsetInSvg"),m_=C((e,t)=>{if(!sb.test(e.getAttribute("transform")??""))return;const r=wu(e),i=r.x-t.x,o=r.y-t.y,a=e.getBBox?.();if(a)return{x:i+a.x+a.width/2,y:o+a.y+a.height/2,halfWidth:a.width/2,halfHeight:a.height/2}},"boxedObstacle"),y_=C(e=>{try{const t=JSON.parse(atob(e.getAttribute("data-points")??""));return Array.isArray(t)?t:[]}catch{return[]}},"readPoints"),Qg=C((e,t)=>{const r=Math.hypot(e.x-t.x,e.y-t.y);if(r===0)return nb(e,Ug);const i={x:(e.x-t.x)/r,y:(e.y-t.y)/r},o=Ug/2;return{x:e.x-i.x*o,y:e.y-i.y*o,halfWidth:Math.abs(i.x)*o+Math.abs(i.y)*Vg,halfHeight:Math.abs(i.y)*o+Math.abs(i.x)*Vg}},"arrowheadObstacle"),Jg=C((e,t)=>{const r=e.getAttribute(t);return!!r&&r!=="none"},"hasMarker"),x_=C((e,t)=>{const r=y_(e).filter(n=>Number.isFinite(n?.x)&&Number.isFinite(n?.y));if(r.length===0)return[];const i=wu(e),o=C(n=>({x:n.x+i.x-t.x,y:n.y+i.y-t.y}),"toSvg"),a=r.length-1,s=[];return Jg(e,"marker-start")&&s.push(Qg(o(r[0]),o(r[Math.min(1,a)]))),Jg(e,"marker-end")&&s.push(Qg(o(r[a]),o(r[Math.max(a-1,0)]))),s},"arrowheadObstacles"),lb=C(e=>{const t={x:0,y:0},r=[...e?.querySelectorAll(".edgeLabel, .node")??[]].map(o=>m_(o,t)).filter(o=>o!==void 0),i=[...e?.querySelectorAll('path[data-edge="true"]')??[]].flatMap(o=>x_(o,t));return[...r,...i]},"collectBadgeObstacles"),b_=C((e,t)=>{if(!e.label||t.length===0)return[];const{x:r,y:i}=Si.calcLabelPosition(t);return[{x:r,y:i,halfWidth:(e.width??0)/2,halfHeight:(e.height??0)/2}]},"edgeLabelObstacles"),C_=C(e=>{const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4},"linearChannel"),tp=C(e=>{try{const[t,r,i]=["r","g","b"].map(o=>C_(g2(e,o)));return .2126*t+.7152*r+.0722*i}catch{return}},"relativeLuminance"),w_=C((e,t)=>{const r=tp(e),i=tp(t);return r===void 0||i===void 0?0:(Math.max(r,i)+.05)/(Math.min(r,i)+.05)},"contrastRatio"),k_=C((e,t)=>{const i=[...t.filter(a=>!!a),"#ffffff","#000000"].map(a=>({color:a,ratio:w_(e,a)}));return(i.find(({ratio:a})=>a>=t_)??i.reduce((a,s)=>s.ratio>a.ratio?s:a)).color},"pickBadgeTextColor"),S_=C(e=>{const t=e?.replace(/^stroke:\s*/,"").trim();return t===""?void 0:t},"bareColor"),v_=C((e,t,r,i=lb(e.node()?.closest("svg")))=>{if(!Cu(t)||!t.showStepNumber)return;const o=wu(e.node()),a=i.map(c=>({...c,x:c.x-o.x,y:c.y-o.y})),s=g_(d_(r.points,r.pathNode),[...a,...b_(t,r.points)]);if(!s)return;const n=S_(r.color)??JB,l=e.append("g").attr("class","edge-step-badge").attr("transform",`translate(${s.x},${s.y})`).attr("pointer-events","none").attr("data-step",t.step);return l.append("circle").attr("r",Qh).attr("fill",n),l.append("text").attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",KB).attr("fill",k_(n,r.textColors??[])).text(String(t.step)),nb({x:s.x+o.x,y:s.y+o.y},Qh)},"insertEdgeStepBadge"),ep=C((e,t,r)=>{e.append("animateTransform").attr("attributeName","transform").attr("type","scale").attr("values","1;1").attr("dur",`${r}s`).attr("begin",`${t}.begin`).attr("fill","remove")},"showWhileStepPlays"),M_=C((e,t,r,i,o)=>{if(!Cu(t)||!r)return;const{begin:a,dur:s,gap:n}=o_(t.step,t.stepCount??t.step,ZB(t.stepDuration)),l=a_(`${i}-${t.id}-step`),c=`${s_(r)}scale(0)`,h=o?.replace(/^stroke:\s*/,""),d=e.append("path").attr("class","edge-step-highlight").attr("aria-hidden","true").attr("d",r).attr("fill","none").attr("stroke",h??"currentColor").attr("stroke-width",e_).attr("stroke-linecap","round").attr("stroke-opacity",r_).attr("pointer-events","none").attr("transform",c).attr("data-step",t.step);ep(d,l,s);const u=e.append("circle").attr("class","edge-step-dot").attr("r",i_).attr("aria-hidden","true").attr("transform",c).attr("data-step",t.step);h&&u.attr("fill",h).attr("stroke","none"),u.append("animateMotion").attr("id",l).attr("path",r).attr("dur",`${s}s`).attr("begin",`${a}s;${l}.end+${n}s`).attr("fill","remove"),ep(u,l,s),c_(e,i)},"insertEdgeStepDot"),Hl=new WeakMap,T_=C(e=>{const t=e.querySelector(":scope > g.edge-step-badges");if(t)return t;const r=e.ownerDocument.createElementNS("http://www.w3.org/2000/svg","g");return r.setAttribute("class","edge-step-badges"),e.appendChild(r)},"badgeLayer"),B_=C(e=>{const t=e?Hl.get(e):void 0;if(!e||!t)return;Hl.delete(e);const r=lb(e);for(const{elem:i,edge:o,options:a}of t){const s=i.node()?.parentElement;if(!s)continue;const n=Ye(T_(s)),l=v_(n,o,a,r);l&&r.push(l)}},"placeQueuedStepBadges"),__=C((e,t,r,i,o)=>{M_(e,t,r,i,o.color);const a=e.node(),s=a?.ownerSVGElement??a;!s||!Cu(t)||!t.showStepNumber||Hl.set(s,[...Hl.get(s)??[],{elem:e,edge:t,options:o}])},"insertEdgeStepMarks"),L_=C((e,t,r,i,o,a=!1,s)=>{t.arrowTypeStart&&rp(e,"start",t.arrowTypeStart,r,i,o,a,s),t.arrowTypeEnd&&rp(e,"end",t.arrowTypeEnd,r,i,o,a,s)},"addEdgeMarkers"),A_={arrow_cross:{type:"cross",fill:!1},arrow_point:{type:"point",fill:!0},arrow_barb:{type:"barb",fill:!0},arrow_barb_neo:{type:"barb",fill:!0},arrow_circle:{type:"circle",fill:!1},arrow_open_head:{type:"openArrow",fill:!1},arrow_hollow_circle:{type:"hollowCircle",fill:!1},arrow_hierarchy:{type:"hierarchy",fill:!1},aggregation:{type:"aggregation",fill:!1},extension:{type:"extension",fill:!1},composition:{type:"composition",fill:!0},dependency:{type:"dependency",fill:!0},lollipop:{type:"lollipop",fill:!1},only_one:{type:"onlyOne",fill:!1},zero_or_one:{type:"zeroOrOne",fill:!1},one_or_more:{type:"oneOrMore",fill:!1},zero_or_more:{type:"zeroOrMore",fill:!1},requirement_arrow:{type:"requirement_arrow",fill:!1},requirement_contains:{type:"requirement_contains",fill:!1}},F_=["cross","point","circle","lollipop","aggregation","extension","composition","dependency","barb"],rp=C((e,t,r,i,o,a,s=!1,n)=>{if(!r||r==="none")return;const l=A_[r],c=l&&F_.includes(l.type);if(!l){Lt.warn(`Unknown arrow type: ${r}`);return}const h=l.type,f=`${o}_${a}-${h}${t==="start"?"Start":"End"}${s&&c?"-margin":""}`;if(n&&n.trim()!==""){const g=n.replace(/[^\dA-Za-z]/g,"_"),p=`${f}_${g}`;if(!document.getElementById(p)){const m=document.getElementById(f);if(m){const y=m.cloneNode(!0);y.id=p,y.querySelectorAll("path, circle, line").forEach(b=>{b.setAttribute("stroke",n),l.fill&&b.setAttribute("fill",n)}),m.parentNode?.appendChild(y)}}e.attr(`marker-${t}`,`url(${i}#${p})`)}else e.attr(`marker-${t}`,`url(${i}#${f})`)},"addEdgeMarker"),$_=C(e=>typeof e=="string"?e:Ge()?.flowchart?.curve,"resolveEdgeCurveType"),Yl=new Map,Jr=new Map,BP=C(()=>{Yl.clear(),Jr.clear()},"clear"),_P=C(e=>!!(e.label||e.startLabelLeft||e.startLabelRight||e.endLabelLeft||e.endLabelRight),"hasEdgeLabel"),zs=C(e=>e?typeof e=="string"?e:e.reduce((t,r)=>t+";"+r,""):"","getLabelStyles"),E_=C(async(e,t)=>{const r=Ge();let i=Zr(r);const{labelStyles:o}=Ut(t);t.labelStyle=o;const a=e.insert("g").attr("class","edgeLabel"),s=a.insert("g").attr("class","label").attr("data-id",t.id),n=t.labelType==="markdown",c=await vi(e,t.label,{style:zs(t.labelStyle),useHtmlLabels:i,addSvgBackground:!0,isNode:!1,markdown:n,width:n?void 0:void 0},r);s.node().appendChild(c),Lt.info("abc82",t,t.labelType);let h,d;if(i){const f=c.children[0],g=Ye(c);h=await La.measure(()=>f.getBoundingClientRect()),d=h,g.attr("width",h.width),g.attr("height",h.height)}else{const f=Ye(c).select("text").node();await La.measure(()=>{h=c.getBBox(),f&&typeof f.getBBox=="function"?d=f.getBBox():d=h})}s.attr("transform",Ws(d,i)),Yl.set(t.id,a),t.width=h.width,t.height=h.height;let u;if(t.startLabelLeft){const f=e.insert("g").attr("class","edgeTerminals"),g=f.insert("g").attr("class","inner"),p=await Lo(g,t.startLabelLeft,zs(t.labelStyle)||"",!1,!1);u=p;let m=p.getBBox();if(i){const y=p.children[0],x=Ye(p);m=y.getBoundingClientRect(),x.attr("width",m.width),x.attr("height",m.height)}g.attr("transform",Ws(m,i)),Jr.get(t.id)||Jr.set(t.id,{}),Jr.get(t.id).startLeft=f,Js(u,t.startLabelLeft,m),Qs(t,"startLeft",m)}if(t.startLabelRight){const f=e.insert("g").attr("class","edgeTerminals"),g=f.insert("g").attr("class","inner"),p=await Lo(g,t.startLabelRight,zs(t.labelStyle)||"",!1,!1);u=p;let m=p.getBBox();if(i){const y=p.children[0],x=Ye(p);m=y.getBoundingClientRect(),x.attr("width",m.width),x.attr("height",m.height)}g.attr("transform",Ws(m,i)),Jr.get(t.id)||Jr.set(t.id,{}),Jr.get(t.id).startRight=f,Js(u,t.startLabelRight,m),Qs(t,"startRight",m)}if(t.endLabelLeft){const f=e.insert("g").attr("class","edgeTerminals"),g=f.insert("g").attr("class","inner"),p=await Lo(g,t.endLabelLeft,zs(t.labelStyle)||"",!1,!1);u=p;let m=p.getBBox();if(i){const y=p.children[0],x=Ye(p);m=y.getBoundingClientRect(),x.attr("width",m.width),x.attr("height",m.height)}g.attr("transform",Ws(m,i)),Jr.get(t.id)||Jr.set(t.id,{}),Jr.get(t.id).endLeft=f,Js(u,t.endLabelLeft,m),Qs(t,"endLeft",m)}if(t.endLabelRight){const f=e.insert("g").attr("class","edgeTerminals"),g=f.insert("g").attr("class","inner"),p=await Lo(g,t.endLabelRight,zs(t.labelStyle)||"",!1,!1);u=p;let m=p.getBBox();if(i){const y=p.children[0],x=Ye(p);m=y.getBoundingClientRect(),x.attr("width",m.width),x.attr("height",m.height)}g.attr("transform",Ws(m,i)),Jr.get(t.id)||Jr.set(t.id,{}),Jr.get(t.id).endRight=f,Js(u,t.endLabelRight,m),Qs(t,"endRight",m)}return c},"insertEdgeLabel");function Qs(e,t,r){e.terminalLabelSizes??={},e.terminalLabelSizes[t]={width:r.width,height:r.height}}C(Qs,"recordTerminalLabelSize");function Js(e,t,r){Zr(Ge())&&e&&(e.style.width=Math.max(t.length*9,r.width)+"px",e.style.height=r.height+"px")}C(Js,"setTerminalWidth");var P_=C((e,t)=>{let r=e.x,i=e.y;if(t?.updatedPath){const o=Si.calcLabelPosition(t.updatedPath);if(t.originalPath){const a=Si.calcLabelPosition(t.originalPath);r=e.x+(o.x-a.x),i=e.y+(o.y-a.y)}else r=o.x,i=o.y}return{x:r,y:i}},"resolveEdgeLabelPosition"),I_=C((e,t)=>{Lt.debug("Moving label abc88 ",e.id,e.label,Yl.get(e.id),t);const r=Ge(),{subGraphTitleTotalMargin:i}=Fn(r);if(e.label){const a=Yl.get(e.id),{x:s,y:n}=P_(e,t);Lt.debug("Moving label "+e.label+" from (",e.x,",",e.y,") to (",s,",",n,") abc88"),a.attr("transform",`translate(${s}, ${n+i/2})`)}const o=t.updatedPath?t.updatedPath:t.originalPath;if(e.startLabelLeft){const a=Jr.get(e.id).startLeft;let s=e.x,n=e.y;if(o){const l=Si.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",o);s=l.x,n=l.y}a.attr("transform",`translate(${s}, ${n})`)}if(e.startLabelRight){const a=Jr.get(e.id).startRight;let s=e.x,n=e.y;if(o){const l=Si.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",o);s=l.x,n=l.y}a.attr("transform",`translate(${s}, ${n})`)}if(e.endLabelLeft){const a=Jr.get(e.id).endLeft;let s=e.x,n=e.y;if(o){const l=Si.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",o);s=l.x,n=l.y}a.attr("transform",`translate(${s}, ${n})`)}if(e.endLabelRight){const a=Jr.get(e.id).endRight;let s=e.x,n=e.y;if(o){const l=Si.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",o);s=l.x,n=l.y}a.attr("transform",`translate(${s}, ${n})`)}},"positionEdgeLabel"),ws=.5,Ao=C((e,t)=>Math.abs(e.x-t.x)<ws,"sharesColumn"),Fo=C((e,t)=>Math.abs(e.y-t.y)<ws,"sharesRow"),cb=C((e,t)=>Ao(e,t)&&Fo(e,t),"coincides");function hb(e,t,r){return Ao(e,t)&&!Fo(e,t)?Ao(r,t):Fo(e,t)&&!Ao(e,t)?Fo(r,t):Ao(r,t)||Fo(r,t)}C(hb,"keepsArrivalAxis");function db(e,t,r){return cb(e,t)?{heading:t,from:r}:{heading:e,from:t}}C(db,"arrivalSegment");function ub({heading:e,from:t},r,i){return(e.x-t.x)*(i.x-r.x)+(e.y-t.y)*(i.y-r.y)<0}C(ub,"runsAgainstHeading");function fb({heading:e,from:t},r,i){return Fo(e,t)&&!Ao(e,t)?{x:i.x,y:r.y}:Ao(e,t)&&!Fo(e,t)?{x:r.x,y:i.y}:i}C(fb,"snapToArrivalAxis");function gb(e,t,r,i){if((Ao(e,t)||Fo(e,t))&&!hb(e,t,i))return e;const a=db(e,t,r);return ub(a,t,i)?t:fb(a,t,i)}C(gb,"dockFinalPoint");function pb(e){const t=Object.hasOwn(Ur,e)?Ur[e]:0;return Number.isFinite(t)?t:0}C(pb,"markerPullBack");function mb({originalLast:e,lastInner:t,newLast:r,minLength:i}){const o=!cb(e,t),a=Math.hypot(r.x-t.x,r.y-t.y);return a>=Math.max(ws,i)?r:o&&a>=ws?e:void 0}C(mb,"finalDockPoint");var O_=C((e,t)=>{if(!e?.isLabelEdge||!e?.id?.endsWith("-to-label")||!Array.isArray(t)||t.length!==2)return t;const[r,i]=t,o=Math.abs(i.x-r.x),a=Math.abs(i.y-r.y);return o<.001||a<.001?t:a>=o?[r,{x:r.x,y:i.y},i]:[r,{x:i.x,y:r.y},i]},"orthogonalizeToLabelClippedPoints"),D_=C((e,t)=>{const r=e.x,i=e.y,o=Math.abs(t.x-r),a=Math.abs(t.y-i),s=e.width/2,n=e.height/2;return o>=s||a>=n},"outsideNode"),R_=C((e,t,r)=>{Lt.debug(`intersection calc abc89:
293
293
  outsidePoint: ${JSON.stringify(t)}
294
294
  insidePoint : ${JSON.stringify(r)}
295
295
  node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,o=e.y,a=Math.abs(i-r.x),s=e.width/2;let n=r.x<t.x?s-a:s+a;const l=e.height/2,c=Math.abs(t.y-r.y),h=Math.abs(t.x-r.x);if(Math.abs(o-t.y)*s>Math.abs(i-t.x)*l){let d=r.y<t.y?t.y-l-o:o-l-t.y;n=h*d/c;const u={x:r.x<t.x?r.x+n:r.x-h+n,y:r.y<t.y?r.y+c-d:r.y-c+d};return n===0&&(u.x=t.x,u.y=t.y),h===0&&(u.x=t.x),c===0&&(u.y=t.y),Lt.debug(`abc89 top/bottom calc, Q ${c}, q ${d}, R ${h}, r ${n}`,u),u}else{r.x<t.x?n=t.x-s-i:n=i-s-t.x;let d=c*n/h,u=r.x<t.x?r.x+h-n:r.x-h+n,f=r.y<t.y?r.y+d:r.y-d;return Lt.debug(`sides calc abc89, Q ${c}, q ${d}, R ${h}, r ${n}`,{_x:u,_y:f}),n===0&&(u=t.x,f=t.y),h===0&&(u=t.x),c===0&&(f=t.y),{x:u,y:f}}},"intersection"),ip=C((e,t)=>{Lt.warn("abc88 cutPathAtIntersect",e,t);let r=[],i=e[0],o=!1;return e.forEach(a=>{if(Lt.info("abc88 checking point",a,t),!D_(t,a)&&!o){const s=R_(t,i,a);Lt.debug("abc88 inside",a,i,s),Lt.debug("abc88 intersection",s,t);let n=!1;r.forEach(l=>{n=n||l.x===s.x&&l.y===s.y}),r.some(l=>l.x===s.x&&l.y===s.y)?Lt.warn("abc88 no intersect",s,r):r.push(s),o=!0}else Lt.warn("abc88 outside",a,i),i=a,o||r.push(a)}),Lt.debug("returning points",r),r},"cutPathAtIntersect");function yb(e){const t=[],r=[];for(let i=1;i<e.length-1;i++){const o=e[i-1],a=e[i],s=e[i+1];(o.x===a.x&&a.y===s.y&&Math.abs(a.x-s.x)>5&&Math.abs(a.y-o.y)>5||o.y===a.y&&a.x===s.x&&Math.abs(a.x-o.x)>5&&Math.abs(a.y-s.y)>5)&&(t.push(a),r.push(i))}return{cornerPoints:t,cornerPointPositions:r}}C(yb,"extractCornerPoints");var op=C(function(e,t,r){const i=t.x-e.x,o=t.y-e.y,a=Math.sqrt(i*i+o*o),s=r/a;return{x:t.x-s*i,y:t.y-s*o}},"findAdjacentPoint"),N_=C(function(e){const{cornerPointPositions:t}=yb(e),r=[];for(let i=0;i<e.length;i++)if(t.includes(i)){const o=e[i-1],a=e[i+1],s=e[i],n=op(o,s,5),l=op(a,s,5),c=l.x-n.x,h=l.y-n.y;r.push(n);const d=Math.sqrt(2)*2;let u={x:s.x,y:s.y};if(Math.abs(a.x-o.x)>10&&Math.abs(a.y-o.y)>=10){Lt.debug("Corner point fixing",Math.abs(a.x-o.x),Math.abs(a.y-o.y));const f=5;s.x===n.x?u={x:c<0?n.x-f+d:n.x+f-d,y:h<0?n.y-d:n.y+d}:u={x:c<0?n.x-d:n.x+d,y:h<0?n.y-f+d:n.y+f-d}}else Lt.debug("Corner point skipping fixing",Math.abs(a.x-o.x),Math.abs(a.y-o.y));r.push(u,l)}else r.push(e[i]);return r},"fixCorners"),q_=C((e,t,r)=>{const i=e-t-r,o=2,a=2,s=o+a,n=Math.floor(i/s),l=Number.isFinite(n)?Math.max(0,n):0,c=Array(l).fill(`${o} ${a}`).join(" ");return`0 ${t} ${c} ${r}`},"generateDashArray"),W_=C(function(e,t,r,i,o,a,s,n=!1,l=void 0){if(!s)throw new Error(`insertEdge: missing diagramId for edge "${t.id}" — edge IDs require a diagram prefix for uniqueness`);const{handDrawnSeed:c,layout:h}=Ge(),d=l??h;let u=t.points,f=!1;const g=o;var p=a;const m=[];for(const P in t.cssCompiledStyles)gm(P)||m.push(t.cssCompiledStyles[P]);if(d==="swimlane"){if(!n&&p.intersect&&g.intersect&&Array.isArray(u)&&u.length>=2)if(u.length===2){const[P,Y]=u;u=Ao(P,Y)||Fo(P,Y)?[g.intersect(P),p.intersect(Y)]:[g.intersect(Y),p.intersect(P)]}else{const P=u.slice(1,-1),Y=P[0],X=P[P.length-1],z=g.intersect(Y),U=u[u.length-1],j=p.intersect(X),V=P.at(-2)??u[0],Q=gb(U,X,V,j),rt=mb({originalLast:U,lastInner:X,newLast:Q,minLength:pb(t.arrowTypeEnd)}),H=Math.abs(z.x-Y.x)<ws&&Math.abs(z.y-Y.y)<ws?[]:[z],G=rt?[rt]:[];u=[...H,...P,...G]}u=O_(t,u)}else p.intersect&&g.intersect&&!n&&(u=u.slice(1,t.points.length-1),u.unshift(g.intersect(u[0])),u.push(p.intersect(u[u.length-1])));const y=btoa(JSON.stringify(u));t.toCluster&&(Lt.info("to cluster abc88",r.get(t.toCluster)),u=ip(t.points,r.get(t.toCluster).node),f=!0),t.fromCluster&&(Lt.debug("from cluster abc88",r.get(t.fromCluster),JSON.stringify(u,null,2)),u=ip(u.reverse(),r.get(t.fromCluster).node).reverse(),f=!0);let x=u.filter(P=>!Number.isNaN(P.y));const b=$_(t.curve);b!=="rounded"&&(x=N_(x));let S=ln;switch(b){case"linear":S=ln;break;case"basis":S=Ih;break;case"cardinal":S=Qm;break;case"bumpX":S=Gm;break;case"bumpY":S=Um;break;case"catmullRom":S=ty;break;case"monotoneX":S=sy;break;case"monotoneY":S=ny;break;case"natural":S=cy;break;case"step":S=hy;break;case"stepAfter":S=uy;break;case"stepBefore":S=dy;break;case"rounded":S=ln;break;default:S=Ih}const{x:T,y:k}=VB(t),_=Sv().x(T).y(k).curve(S);let L;switch(t.thickness){case"normal":L="edge-thickness-normal";break;case"thick":L="edge-thickness-thick";break;case"invisible":L="edge-thickness-invisible";break;default:L="edge-thickness-normal"}switch(t.pattern){case"solid":L+=" edge-pattern-solid";break;case"dotted":L+=" edge-pattern-dotted";break;case"dashed":L+=" edge-pattern-dashed";break;default:L+=" edge-pattern-solid"}let v,M=b==="rounded"?xb(bb(x,t),5):_(x);const B=Array.isArray(t.style)?t.style:[t.style];let E=B.find(P=>P?.startsWith("stroke:")),O="";t.animate&&(O="edge-animation-fast"),t.animation&&(O="edge-animation-"+t.animation);let $=!1;if(t.look==="handDrawn"){const P=Zt.svg(e);Object.assign([],x);const Y=P.path(M,{roughness:.3,seed:c});L+=" transition",v=Ye(Y).select("path").attr("id",`${s}-${t.id}`).attr("class"," "+L+(t.classes?" "+t.classes:"")+(O?" "+O:"")).attr("style",B?B.reduce((z,U)=>z+";"+U,""):"");let X=v.attr("d");v.attr("d",X),e.node().appendChild(v.node())}else{const P=m.join(";"),Y=B?B.reduce((Q,rt)=>Q+rt+";",""):"",X=(P?P+";"+Y+";":Y)+";"+(B?B.reduce((Q,rt)=>Q+";"+rt,""):"");v=e.append("path").attr("d",M).attr("id",`${s}-${t.id}`).attr("class"," "+L+(t.classes?" "+t.classes:"")+(O?" "+O:"")).attr("style",X),E=X.match(/stroke:([^;]+)/)?.[1],$=t.animate===!0||!!t.animation||P.includes("animation");const z=v.node(),U=typeof z.getTotalLength=="function"?z.getTotalLength():0,j=jg[t.arrowTypeStart]||0,V=jg[t.arrowTypeEnd]||0;if(t.look==="neo"&&!$){const rt=`stroke-dasharray: ${t.pattern==="dotted"||t.pattern==="dashed"?q_(U,j,V):`0 ${j} ${U-j-V} ${V}`}; stroke-dashoffset: 0;`;v.attr("style",rt+v.attr("style"))}}if(v.attr("data-edge",!0),v.attr("data-et","edge"),v.attr("data-id",t.id),v.attr("data-points",y),v.attr("data-look",Hr(t.look)),t.step!==void 0){const{themeVariables:P}=Ge(),Y=E??P?.lineColor;__(e,t,M,s,{points:x,pathNode:v.node(),color:Y,textColors:[P?.background,P?.primaryTextColor]})}t.showPoints&&x.forEach(P=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",P.x).attr("cy",P.y)});let I="";(Ge().flowchart.arrowMarkerAbsolute||Ge().state.arrowMarkerAbsolute)&&(I=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,I=I.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),Lt.info("arrowTypeStart",t.arrowTypeStart),Lt.info("arrowTypeEnd",t.arrowTypeEnd);const F=!$&&t?.look==="neo";L_(v,t,I,s,i,F,E);const R=Math.floor(u.length/2),q=u[R];Si.isLabelCoordinateInPath(q,v.attr("d"))||(f=!0);let D={};return f&&(D.updatedPath=u),D.originalPath=t.points,D},"insertEdge");function xb(e,t){if(e.length<2)return"";let r="";const i=e.length,o=1e-5;for(let a=0;a<i;a++){const s=e[a],n=e[a-1],l=e[a+1];if(a===0)r+=`M${s.x},${s.y}`;else if(a===i-1)r+=`L${s.x},${s.y}`;else{const c=s.x-n.x,h=s.y-n.y,d=l.x-s.x,u=l.y-s.y,f=Math.hypot(c,h),g=Math.hypot(d,u);if(f<o||g<o){r+=`L${s.x},${s.y}`;continue}const p=c/f,m=h/f,y=d/g,x=u/g,b=p*y+m*x,S=Math.max(-1,Math.min(1,b)),T=Math.acos(S);if(T<o||Math.abs(Math.PI-T)<o){r+=`L${s.x},${s.y}`;continue}const k=Math.min(t/Math.sin(T/2),f/2,g/2),_=s.x-p*k,L=s.y-m*k,v=s.x+y*k,M=s.y+x*k;r+=`L${_},${L}`,r+=`Q${s.x},${s.y} ${v},${M}`}}return r}C(xb,"generateRoundedPath");function Jh(e,t){if(!e||!t)return{angle:0,deltaX:0,deltaY:0};const r=t.x-e.x,i=t.y-e.y;return{angle:Math.atan2(i,r),deltaX:r,deltaY:i}}C(Jh,"calculateDeltaAndAngle");function bb(e,t){const r=e.map(o=>({...o}));if(e.length>=2&&Ur[t.arrowTypeStart]){const o=Ur[t.arrowTypeStart],a=e[0],s=e[1],{angle:n}=Jh(a,s),l=o*Math.cos(n),c=o*Math.sin(n);r[0].x=a.x+l,r[0].y=a.y+c}const i=e.length;if(i>=2&&Ur[t.arrowTypeEnd]){const o=Ur[t.arrowTypeEnd],a=e[i-1],s=e[i-2],{angle:n}=Jh(s,a),l=o*Math.cos(n),c=o*Math.sin(n);r[i-1].x=a.x-l,r[i-1].y=a.y-c}return r}C(bb,"applyMarkerOffsetsToPoints");var z_=C((e,t,r,i)=>{t.forEach(o=>{gL[o](e,r,i)})},"insertMarkers"),H_=C((e,t,r)=>{Lt.trace("Making markers for ",r),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 1,1 V 13 L18,7 Z"),e.append("marker").attr("id",r+"_"+t+"-extensionStart-margin").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,7 18,13 18,1").style("stroke-width",2).style("stroke-dasharray","0"),e.append("defs").append("marker").attr("id",r+"_"+t+"-extensionEnd-margin").attr("class","marker extension "+t).attr("refX",9).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("viewBox","0 0 20 14").append("polygon").attr("points","10,1 10,13 18,7").style("stroke-width",2).style("stroke-dasharray","0")},"extension"),Y_=C((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionStart-margin").attr("class","marker composition "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("viewBox","0 0 15 15").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-compositionEnd-margin").attr("class","marker composition "+t).attr("refX",3.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),X_=C((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationStart-margin").attr("class","marker aggregation "+t).attr("refX",15).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-aggregationEnd-margin").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",2).attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),j_=C((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyStart-margin").attr("class","marker dependency "+t).attr("refX",4).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-dependencyEnd-margin").attr("class","marker dependency "+t).attr("refX",16).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").style("stroke-width",0).attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),G_=C((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopStart-margin").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2),e.append("defs").append("marker").attr("id",r+"_"+t+"-lollipopEnd-margin").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6).attr("stroke-width",2)},"lollipop"),U_=C((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",11.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10.5).attr("markerHeight",14).attr("orient","auto").append("path").attr("d","M 0 0 L 11.5 7 L 0 14 z").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-pointStart-margin").attr("class","marker "+t).attr("viewBox","0 0 11.5 14").attr("refX",1).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11.5).attr("markerHeight",14).attr("orient","auto").append("polygon").attr("points","0,7 11.5,14 11.5,0").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"point"),V_=C((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleEnd-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refY",5).attr("refX",12.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-circleStart-margin").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",14).attr("markerHeight",14).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",0).style("stroke-dasharray","1,0")},"circle"),Z_=C((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",r+"_"+t+"-crossEnd-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",17.7).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5),e.append("marker").attr("id",r+"_"+t+"-crossStart-margin").attr("class","marker cross "+t).attr("viewBox","0 0 15 15").attr("refX",-3.5).attr("refY",7.5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1,1 L 14,14 M 1,14 L 14,1").attr("class","arrowMarkerPath").style("stroke-width",2.5).style("stroke-dasharray","1,0")},"cross"),K_=C((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),Q_=C((e,t,r)=>{const i=Ar(),{themeVariables:o}=i,{transitionColor:a}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z"),e.append("defs").append("marker").attr("id",r+"_"+t+"-barbEnd-margin").attr("refX",17).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L11,14 L13,7 L11,0 Z").attr("fill",`${a}`)},"barbNeo"),J_=C((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),tL=C((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("d","M9,0 L9,18");const o=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),o.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),eL=C((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),rL=C((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const o=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");o.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),o.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),iL=C((e,t,r)=>{const i=Ar(),{themeVariables:o}=i,{strokeWidth:a}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneStart").attr("class","marker onlyOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M9,0 L9,18 M15,0 L15,18").attr("stroke-width",`${a}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-onlyOneEnd").attr("class","marker onlyOne "+t).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M3,0 L3,18 M9,0 L9,18").attr("stroke-width",`${a}`)},"only_one_neo"),oL=C((e,t,r)=>{const i=Ar(),{themeVariables:o}=i,{strokeWidth:a,mainBkg:s}=o,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneStart").attr("class","marker zeroOrOne "+t).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto").attr("markerUnits","userSpaceOnUse");n.append("circle").attr("fill",s??"white").attr("cx",21).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),n.append("path").attr("d","M9,0 L9,18").attr("stroke-width",`${a}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+t).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("markerUnits","userSpaceOnUse").attr("orient","auto");l.append("circle").attr("fill",s??"white").attr("cx",9).attr("cy",9).attr("stroke-width",`${a}`).attr("r",6),l.append("path").attr("d","M21,0 L21,18").attr("stroke-width",`${a}`)},"zero_or_one_neo"),aL=C((e,t,r)=>{const i=Ar(),{themeVariables:o}=i,{strokeWidth:a}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreStart").attr("class","marker oneOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27").attr("stroke-width",`${a}`),e.append("defs").append("marker").attr("id",r+"_"+t+"-oneOrMoreEnd").attr("class","marker oneOrMore "+t).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18").attr("stroke-width",`${a}`)},"one_or_more_neo"),sL=C((e,t,r)=>{const i=Ar(),{themeVariables:o}=i,{strokeWidth:a,mainBkg:s}=o,n=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+t).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("markerUnits","userSpaceOnUse").attr("orient","auto");n.append("circle").attr("fill",s??"white").attr("cx",45.5).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),n.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18").attr("stroke-width",`${a}`);const l=e.append("defs").append("marker").attr("id",r+"_"+t+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+t).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto").attr("markerUnits","userSpaceOnUse");l.append("circle").attr("fill",s??"white").attr("cx",11).attr("cy",18).attr("r",6).attr("stroke-width",`${a}`),l.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18").attr("stroke-width",`${a}`)},"zero_or_more_neo"),nL=C((e,t,r)=>{e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
@@ -298,8 +298,8 @@ ${a.join(`
298
298
  L0,20`)},"requirement_arrow"),lL=C((e,t,r)=>{const i=Ar(),{themeVariables:o}=i,{strokeWidth:a}=o;e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${a}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0
299
299
  L20,10
300
300
  M20,10
301
- L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),cL=C((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),hL=C((e,t,r)=>{const i=Ar(),{themeVariables:o}=i,{strokeWidth:a}=o,s=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");s.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),s.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),s.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),s.selectAll("*").attr("stroke-width",`${a}`)},"requirement_contains_neo"),dL=C((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-hierarchyEnd").attr("class","marker hierarchy "+t).attr("viewBox","0 0 12 10").attr("refX",10).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M 0 0 L 6 5 L 0 10 M 4 0 L 10 5 L 4 10").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0").style("fill","none"),e.append("marker").attr("id",r+"_"+t+"-hierarchyStart").attr("class","marker hierarchy "+t).attr("viewBox","0 0 12 10").attr("refX",2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M 12 0 L 6 5 L 12 10 M 8 0 L 2 5 L 8 10").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0").style("fill","none")},"hierarchy"),uL=C((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-openArrowEnd").attr("class","marker openArrow "+t).attr("viewBox","0 0 12 12").attr("refX",11).attr("refY",6).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1 1 L 11 6 L 1 11").attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-linecap","round").style("stroke-linejoin","round").style("stroke-dasharray","1,0").style("fill","none"),e.append("marker").attr("id",r+"_"+t+"-openArrowStart").attr("class","marker openArrow "+t).attr("viewBox","0 0 12 12").attr("refX",1).attr("refY",6).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 11 1 L 1 6 L 11 11").attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-linecap","round").style("stroke-linejoin","round").style("stroke-dasharray","1,0").style("fill","none")},"openArrow"),fL=C((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-hollowCircleStart").attr("class","marker hollowCircle "+t).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("circle").attr("cx",5).attr("cy",5).attr("r",3.6).attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-dasharray","1,0").style("fill","none"),e.append("marker").attr("id",r+"_"+t+"-hollowCircleEnd").attr("class","marker hollowCircle "+t).attr("viewBox","0 0 10 10").attr("refX",10).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("circle").attr("cx",5).attr("cy",5).attr("r",3.6).attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-dasharray","1,0").style("fill","none")},"hollowCircle"),gL={extension:H_,composition:Y_,aggregation:X_,dependency:j_,lollipop:G_,point:U_,circle:V_,cross:Z_,barb:K_,barbNeo:Q_,hierarchy:dL,only_one:J_,zero_or_one:tL,one_or_more:eL,zero_or_more:rL,only_one_neo:iL,zero_or_one_neo:oL,one_or_more_neo:aL,zero_or_more_neo:sL,requirement_arrow:nL,requirement_contains:cL,requirement_arrow_neo:lL,requirement_contains_neo:hL,openArrow:uL,hollowCircle:fL},pL=z_,mL={common:kn,getConfig:Ar,insertCluster:UB,insertEdge:W_,insertEdgeLabel:E_,insertMarkers:pL,insertNode:eb,interpolateToCurve:Vd,labelHelper:he,log:Lt,positionEdgeLabel:I_},yL=["elk.stress","elk.force","elk.mrtree","elk.sporeOverlap","elk.box","elk.rectpacking"],mn=Object.create(null),Cb=C(e=>{for(const t of e)mn[t.name]=t},"registerLayoutLoaders"),xL=C(()=>{const e=C(async()=>await Ve(()=>import("./B9Hetctu.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url),"loader");return[{name:"elk",loader:e,algorithm:"elk.layered"},...yL.map(t=>({name:t,loader:e,algorithm:t}))]},"elkLayoutLoaders"),bL=C(()=>{Cb([{name:"dagre",loader:C(async()=>await Ve(()=>import("./B0a-wzQr.js"),__vite__mapDeps([7,2,3,4,5]),import.meta.url),"loader")},{name:"swimlane",loader:C(async()=>await Ve(()=>import("./CG3imlyr.js"),__vite__mapDeps([8,1,2,3,4,5]),import.meta.url),"loader")},{name:"cose-bilkent",loader:C(async()=>await Ve(()=>import("./BAxqzRwc.js"),__vite__mapDeps([9,10,6]),import.meta.url),"loader")},...xL()])},"registerDefaultLayoutLoaders");bL();var TP=C(async(e,t)=>{if(!Object.hasOwn(mn,e.layoutAlgorithm))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const a of e.nodes){const s=a.domId||a.id;a.domId=`${e.diagramId}-${s}`}const r=mn[e.layoutAlgorithm],i=await r.loader();a2(t,e.config);const o=await i.render(e,t,mL,{algorithm:r.algorithm});return B_(t.node()),o},"render"),ch="dagre",BP=C((e="",{fallback:t=ch}={})=>{if(Object.hasOwn(mn,e))return e;for(const r of[t,ch])if(Object.hasOwn(mn,r))return Lt.warn(`Layout algorithm ${e} is not registered. Using ${r} as fallback.`),r;throw new Error(`Neither layout algorithm ${e}, ${t}, nor ${ch} is registered.`)},"getRegisteredLayoutAlgorithm"),CL=C(e=>{const{securityLevel:t}=Ge();let r=Ye("body");if(t==="sandbox"){const a=Ye(`#i${e}`).node()?.contentDocument??document;r=Ye(a.body)}return r.select(`#${e}`)},"selectSvgElement"),ku="comm",wb="rule",kb="decl",wL="@media",kL="@import",SL="@supports",vL="@namespace",td="@keyframes",Sb="@layer",ML="@scope",TL=Math.abs,hn=String.fromCharCode;function vb(e){return e.trim()}function ed(e,t,r){return e.replace(t,r)}function is(e,t){return e.charCodeAt(t)|0}function ks(e,t,r){return e.slice(t,r)}function oo(e){return e.length}function Mb(e){return e.length}function jn(e,t){return t.push(e),e}var cc=1,Ss=1,Tb=0,Ii=0,qr=0,Fs="";function Su(e,t,r,i,o,a,s,n){return{value:e,root:t,parent:r,type:i,props:o,children:a,line:cc,column:Ss,length:s,return:"",siblings:n}}function BL(){return qr}function _L(){return qr=Ii>0?is(Fs,--Ii):0,Ss--,qr===10&&(Ss=1,cc--),qr}function ji(){return qr=Ii<Tb?is(Fs,Ii++):0,Ss++,qr===10&&(Ss=1,cc++),qr}function Vo(){return is(Fs,Ii)}function fl(){return Ii}function hc(e,t){return ks(Fs,e,t)}function yn(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function LL(e){return cc=Ss=1,Tb=oo(Fs=e),Ii=0,[]}function AL(e){return Fs="",e}function hh(e){return vb(hc(Ii-1,rd(e===91?e+2:e===40?e+1:e)))}function FL(e){for(;(qr=Vo())&&qr<33;)ji();return yn(e)>2||yn(qr)>3?"":" "}function $L(e,t){for(;--t&&ji()&&!(qr<48||qr>102||qr>57&&qr<65||qr>70&&qr<97););return hc(e,fl()+(t<6&&Vo()==32&&ji()==32))}function rd(e){for(;ji();)switch(qr){case e:return Ii;case 34:case 39:e!==34&&e!==39&&rd(qr);break;case 40:e===41&&rd(e);break;case 92:ji();break}return Ii}function EL(e,t){for(;ji()&&e+qr!==57;)if(e+qr===84&&Vo()===47)break;return"/*"+hc(t,Ii-1)+"*"+hn(e===47?e:ji())}function PL(e){for(;!yn(Vo());)ji();return hc(e,Ii)}function IL(e){return AL(gl("",null,null,null,[""],e=LL(e),0,[0],e))}function gl(e,t,r,i,o,a,s,n,l){for(var c=0,h=0,d=s,u=0,f=0,g=0,p=1,m=1,y=1,x=0,b=0,S="",T=o,k=a,_=i,L=S;m;)switch(g=b,b=ji()){case 40:g!=108&&is(L,d-1)==58?(x++,L+="("):L+=hh(b);break;case 41:x--,L+=")";break;case 34:case 39:case 91:L+=hh(b);break;case 9:case 10:case 13:case 32:if(x>0){L+=hn(b);break}L+=FL(g);break;case 92:L+=$L(fl()-1,7);continue;case 47:switch(Vo()){case 42:case 47:jn(OL(EL(ji(),fl()),t,r,l),l),(yn(g||1)==5||yn(Vo()||1)==5)&&oo(L)&&ks(L,-1,void 0)!==" "&&(L+=" ");break;default:L+="/"}break;case 123*p:n[c++]=oo(L)*y;case 125*p:case 59:case 0:if(x>0&&b){L+=hn(b);break}switch(b){case 0:case 125:m=0;case 59+h:y==-1&&(L=ed(L,/\f/g,"")),f>0&&(oo(L)-d||p===0)&&jn(f>32?sp(L+";",i,r,d-1,l):sp(ed(L," ","")+";",i,r,d-2,l),l);break;case 59:L+=";";default:if(jn(_=ap(L,t,r,c,h,o,n,S,T=[],k=[],d,a),a),b===123)if(h===0)gl(L,t,_,_,T,a,d,n,k);else{switch(u){case 99:if(is(L,3)===110)break;case 108:if(is(L,2)===97)break;default:h=0;case 100:case 109:case 115:}h?gl(e,_,_,i&&jn(ap(e,_,_,0,0,o,n,S,o,T=[],d,k),k),o,k,d,n,i?T:k):gl(L,_,_,_,[""],k,0,n,k)}}c=h=f=0,p=y=1,S=L="",d=s;break;case 58:d=1+oo(L),f=g;default:if(p<1){if(b==123)--p;else if(b==125&&p++==0&&_L()==125)continue}switch(L+=hn(b),b*p){case 38:y=h>0?1:(L+="\f",-1);break;case 44:if(x>0)break;n[c++]=(oo(L)-1)*y,y=1;break;case 64:Vo()===45&&(L+=hh(ji())),u=Vo(),h=d=oo(S=L+=PL(fl())),b++;break;case 45:g===45&&oo(L)==2&&(p=0)}}return a}function ap(e,t,r,i,o,a,s,n,l,c,h,d){for(var u=o-1,f=o===0?a:[""],g=Mb(f),p=0,m=0,y=0;p<i;++p)for(var x=0,b=ks(e,u+1,u=TL(m=s[p])),S=e;x<g;++x)(S=vb(m>0?f[x]+" "+b:ed(b,/&\f/g,f[x])))&&(l[y++]=S);return Su(e,t,r,o===0?wb:n,l,c,h,d)}function OL(e,t,r,i){return Su(e,t,r,ku,hn(BL()),ks(e,2,-2),0,i)}function sp(e,t,r,i,o){return Su(e,t,r,kb,ks(e,0,i),ks(e,i+1,-1),i,o)}function id(e,t){for(var r="",i=0;i<e.length;i++)r+=t(e[i],i,e,t)||"";return r}function DL(e,t,r,i){switch(e.type){case Sb:if(e.children.length)break;case kL:case vL:case kb:return e.return=e.return||e.value;case ku:return"";case td:return e.return=e.value+"{"+id(e.children,i)+"}";case wb:if(!oo(e.value=e.props.join(",")))return""}return oo(r=id(e.children,i))?e.return=e.value+"{"+r+"}":""}function RL(e){var t=Mb(e);return function(r,i,o,a){for(var s="",n=0;n<t;n++)s+=e[n](r,i,o,a)||"";return s}}var Bb="c4",NL=C(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),qL=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./CaXjFtDt.js");return{diagram:t}},__vite__mapDeps([11,12]),import.meta.url);return{id:Bb,diagram:e}},"loader"),WL={id:Bb,detector:NL,loader:qL},zL=WL,_b="flowchart-v2",HL=C(e=>/^\s*(graph|flowchart)/.test(e),"detector"),YL=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./CJ58g2zu.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,6,48,49,50,51,52,53,54]),import.meta.url);return{id:_b,diagram:e}},"loader"),XL={id:_b,detector:HL,loader:YL},jL=XL,Lb="agentflow",GL=C(e=>/^\s*agentflow-beta\b/.test(e),"detector"),UL=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./DpsFFL7J.js");return{diagram:t}},__vite__mapDeps([55,14,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,6,48,49,50,51,52,53,54]),import.meta.url);return{id:Lb,diagram:e}},"loader"),VL={id:Lb,detector:GL,loader:UL},ZL=VL,Ab="swimlane",KL=C(e=>/^\s*swimlane-beta\b/.test(e),"detector"),QL=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./DqvXXMrh.js");return{diagram:t}},__vite__mapDeps([56,13,14,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,6,48,49,50,51,52,53,54]),import.meta.url);return{id:Ab,diagram:e}},"loader"),JL={id:Ab,detector:KL,loader:QL},tA=JL,Fb="er",eA=C(e=>/^\s*erDiagram/.test(e),"detector"),rA=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./BfZCAeqU.js");return{diagram:t}},__vite__mapDeps([57,15,16]),import.meta.url);return{id:Fb,diagram:e}},"loader"),iA={id:Fb,detector:eA,loader:rA},oA=iA,$b="gitGraph",aA=C(e=>/^\s*gitGraph/.test(e),"detector"),sA=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./DwKUz42C.js");return{diagram:t}},__vite__mapDeps([58,59,60,61,3,4]),import.meta.url);return{id:$b,diagram:e}},"loader"),nA={id:$b,detector:aA,loader:sA},lA=nA,Eb="gantt",cA=C(e=>/^\s*gantt/.test(e),"detector"),hA=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./Bvc8qRhk.js");return{diagram:t}},__vite__mapDeps([62,6,63]),import.meta.url);return{id:Eb,diagram:e}},"loader"),dA={id:Eb,detector:cA,loader:hA},uA=dA,Pb="info",fA=C(e=>/^\s*info/.test(e),"detector"),gA=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./CBqGKeYg.js");return{diagram:t}},__vite__mapDeps([64,61,3,4]),import.meta.url);return{id:Pb,diagram:e}},"loader"),pA={id:Pb,detector:fA,loader:gA},Ib="pie",mA=C(e=>/^\s*pie/.test(e),"detector"),yA=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./BdCclrfD.js");return{diagram:t}},__vite__mapDeps([65,60,61,3,4,63]),import.meta.url);return{id:Ib,diagram:e}},"loader"),xA={id:Ib,detector:mA,loader:yA},Ob="quadrantChart",bA=C(e=>/^\s*quadrantChart/.test(e),"detector"),CA=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./CXNfY5OA.js");return{diagram:t}},__vite__mapDeps([66,63]),import.meta.url);return{id:Ob,diagram:e}},"loader"),wA={id:Ob,detector:bA,loader:CA},kA=wA,Db="xychart",SA=C(e=>/^\s*xychart(-beta)?/.test(e),"detector"),vA=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./BUdcKH65.js");return{diagram:t}},__vite__mapDeps([67,63]),import.meta.url);return{id:Db,diagram:e}},"loader"),MA={id:Db,detector:SA,loader:vA},TA=MA,Rb="requirement",BA=C(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),_A=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./DtKh4Q6Q.js");return{diagram:t}},__vite__mapDeps([68,15,16]),import.meta.url);return{id:Rb,diagram:e}},"loader"),LA={id:Rb,detector:BA,loader:_A},AA=LA,Nb="sequence",FA=C(e=>/^\s*sequenceDiagram/.test(e),"detector"),$A=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./BUGXi07N.js");return{diagram:t}},__vite__mapDeps([69,59,12]),import.meta.url);return{id:Nb,diagram:e}},"loader"),EA={id:Nb,detector:FA,loader:$A},PA=EA,qb="classDiagram",IA=C(e=>/^\s*classDiagram/.test(e),"detector"),OA=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./C0p8rhDn.js");return{diagram:t}},__vite__mapDeps([70,14,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,6,48,49,50,51,52,53,54]),import.meta.url);return{id:qb,diagram:e}},"loader"),DA={id:qb,detector:IA,loader:OA},RA=DA,Wb="stateDiagram",NA=C(e=>/^\s*stateDiagram/.test(e),"detector"),qA=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./BYtSPAAW.js");return{diagram:t}},__vite__mapDeps([71,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,6,48,49,50,51,52,53,54]),import.meta.url);return{id:Wb,diagram:e}},"loader"),WA={id:Wb,detector:NA,loader:qA},zA=WA,zb="journey",HA=C(e=>/^\s*journey/.test(e),"detector"),YA=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./ByTOmivs.js");return{diagram:t}},__vite__mapDeps([72,14,12]),import.meta.url);return{id:zb,diagram:e}},"loader"),XA={id:zb,detector:HA,loader:YA},jA=XA,Gn=4,Hs=75,GA=C(e=>{const t=[];for(const o of e.split(/\s+/)){let a=[...o];for(;a.length>Hs;)t.push(a.slice(0,Hs).join("")),a=a.slice(Hs);a.length>0&&t.push(a.join(""))}const r=[];let i="";for(const o of t){const a=i?`${i} ${o}`:o;[...a].length>Hs?(r.push(i),i=o):i=a}if(i&&r.push(i),r.length>Gn){r.length=Gn;const o=r[Gn-1]??"";r[Gn-1]=`${[...o].slice(0,Hs-3).join("")}...`}return r},"wrapErrorMessage"),UA=C((e,t,r,i)=>{Lt.debug(`rendering svg for syntax error
302
- `);const o=CL(t),a=o.append("g"),s=GA(i?.db.getErrorMessage?.()??""),n=s.length>0?500+s.length*56:512;o.attr("viewBox",`0 0 2412 ${n}`),um(o,100,n,!0),a.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),a.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),a.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),a.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),a.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),a.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),a.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),a.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`),s.forEach((l,c)=>{a.append("text").attr("class","error-text").attr("x",1440).attr("y",510+c*56).attr("font-size","42px").style("text-anchor","middle").text(l)})},"draw"),Hb={draw:UA},VA=Hb,dh,ZA={clear(){dh=void 0},setErrorMessage(e){dh=e},getErrorMessage(){return dh}},KA={db:ZA,renderer:Hb,parser:{parse:C(()=>{},"parse")}},QA=KA,Yb="flowchart-elk",JA=C((e,t={})=>/^\s*flowchart-elk/.test(e)?(t.layout="elk",!0):!1,"detector"),t5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./CJ58g2zu.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,6,48,49,50,51,52,53,54]),import.meta.url);return{id:Yb,diagram:e}},"loader"),e5={id:Yb,detector:JA,loader:t5},r5=e5,Xb="timeline",i5=C(e=>/^\s*timeline/.test(e),"detector"),o5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./CNIUwMPp.js");return{diagram:t}},[],import.meta.url);return{id:Xb,diagram:e}},"loader"),a5={id:Xb,detector:i5,loader:o5},s5=a5,jb="mindmap",n5=C(e=>/^\s*mindmap/.test(e),"detector"),l5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./CYEd8dKU.js");return{diagram:t}},__vite__mapDeps([73,15,16]),import.meta.url);return{id:jb,diagram:e}},"loader"),c5={id:jb,detector:n5,loader:l5},h5=c5,Gb="kanban",d5=C(e=>/^\s*kanban/.test(e),"detector"),u5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./Dx41gQiN.js");return{diagram:t}},__vite__mapDeps([74,14]),import.meta.url);return{id:Gb,diagram:e}},"loader"),f5={id:Gb,detector:d5,loader:u5},g5=f5,Ub="sankey",p5=C(e=>/^\s*sankey(-beta)?/.test(e),"detector"),m5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./Bk2z5Cd0.js");return{diagram:t}},__vite__mapDeps([75,63]),import.meta.url);return{id:Ub,diagram:e}},"loader"),y5={id:Ub,detector:p5,loader:m5},x5=y5,Vb="packet",b5=C(e=>/^\s*packet(-beta)?/.test(e),"detector"),C5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./PwvNS9aJ.js");return{diagram:t}},__vite__mapDeps([76,60,61,3,4]),import.meta.url);return{id:Vb,diagram:e}},"loader"),w5={id:Vb,detector:b5,loader:C5},Zb="radar",k5=C(e=>/^\s*radar-beta/.test(e),"detector"),S5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./DYk0s6f0.js");return{diagram:t}},__vite__mapDeps([77,60,61,3,4]),import.meta.url);return{id:Zb,diagram:e}},"loader"),v5={id:Zb,detector:k5,loader:S5},Kb="block",M5=C(e=>/^\s*block(-beta)?/.test(e),"detector"),T5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./BvZrnx87.js");return{diagram:t}},__vite__mapDeps([78,14,5]),import.meta.url);return{id:Kb,diagram:e}},"loader"),B5={id:Kb,detector:M5,loader:T5},_5=B5,Qb="treeView",L5=C(e=>/^\s*treeView-beta/.test(e),"detector"),A5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./BXTuZcZW.js");return{diagram:t}},__vite__mapDeps([79,59,60,61,3,4]),import.meta.url);return{id:Qb,diagram:e}},"loader"),F5={id:Qb,detector:L5,loader:A5},$5=F5,Jb="architecture",E5=C(e=>/^\s*architecture/.test(e),"detector"),P5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./BrRRz1w6.js");return{diagram:t}},__vite__mapDeps([80,60,61,3,4,10,6]),import.meta.url);return{id:Jb,diagram:e}},"loader"),I5={id:Jb,detector:E5,loader:P5},O5=I5,t1="eventmodeling",D5=C(e=>/^\s*eventmodeling/.test(e),"detector"),R5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./BuTNFoR8.js");return{diagram:t}},__vite__mapDeps([81,60,61,3,4]),import.meta.url);return{id:t1,diagram:e}},"loader"),N5={id:t1,detector:D5,loader:R5},q5=N5,e1="ishikawa",W5=C(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),z5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./DZxSFexp.js");return{diagram:t}},[],import.meta.url);return{id:e1,diagram:e}},"loader"),H5={id:e1,detector:W5,loader:z5},r1="venn",Y5=C(e=>/^\s*venn-beta/.test(e),"detector"),X5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./BA3fud46.js");return{diagram:t}},[],import.meta.url);return{id:r1,diagram:e}},"loader"),j5={id:r1,detector:Y5,loader:X5},G5=j5,i1="treemap",U5=C(e=>/^\s*treemap/.test(e),"detector"),V5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./CrfXhNNb.js");return{diagram:t}},__vite__mapDeps([82,16,60,61,3,4,63]),import.meta.url);return{id:i1,diagram:e}},"loader"),Z5={id:i1,detector:U5,loader:V5},o1="usecase",K5=C(e=>/^\s*usecase-beta(?:\s|$)/.test(e),"detector"),Q5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./VyOfhH-C.js");return{diagram:t}},__vite__mapDeps([83,15,16]),import.meta.url);return{id:o1,diagram:e}},"loader"),J5={id:o1,detector:K5,loader:Q5},a1="wardley",tF=C(e=>/^\s*wardley-beta/i.test(e),"detector"),eF=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./Dsmvkh8d.js");return{diagram:t}},__vite__mapDeps([84,60,61,3,4]),import.meta.url);return{id:a1,diagram:e}},"loader"),rF={id:a1,detector:tF,loader:eF},iF=rF,s1="cynefin",oF=C(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),aF=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./t_3vjEsA.js");return{diagram:t}},__vite__mapDeps([85,60,61,3,4]),import.meta.url);return{id:s1,diagram:e}},"loader"),sF={id:s1,detector:oF,loader:aF},n1="railroad",nF=C(e=>/^\s*railroad-beta/i.test(e),"detector"),lF=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./C-ZPZDJB.js");return{diagram:t}},__vite__mapDeps([86,87,60,61,3,4]),import.meta.url);return{id:n1,diagram:e}},"loader"),cF={id:n1,detector:nF,loader:lF},l1="railroadEbnf",hF=C(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),dF=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./BkbQGifa.js");return{diagram:t}},__vite__mapDeps([88,87,60,61,3,4]),import.meta.url);return{id:l1,diagram:e}},"loader"),uF={id:l1,detector:hF,loader:dF},c1="railroadAbnf",fF=C(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),gF=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./1MWULgfl.js");return{diagram:t}},__vite__mapDeps([89,87,60,61,3,4]),import.meta.url);return{id:c1,diagram:e}},"loader"),pF={id:c1,detector:fF,loader:gF},h1="railroadPeg",mF=C(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),yF=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./Bb-m1QhD.js");return{diagram:t}},__vite__mapDeps([90,87,60,61,3,4]),import.meta.url);return{id:h1,diagram:e}},"loader"),xF={id:h1,detector:mF,loader:yF},np=!1,dc=C(()=>{np||(np=!0,Sl("error",QA,e=>e.toLowerCase().trim()==="error"),Sl("---",{db:{clear:C(()=>{},"clear")},styles:{},renderer:{draw:C(()=>{},"draw")},parser:{parse:C(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:C(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),Bh(r5,h5,O5),Bh(ZL,zL,g5,RA,oA,uA,pA,xA,AA,PA,tA,jL,s5,lA,zA,jA,kA,x5,w5,TA,_5,q5,$5,v5,H5,Z5,cF,uF,pF,xF,G5,iF,sF,J5))},"addDiagrams"),bF=C(async()=>{Lt.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Ta).map(async([r,{detector:i,loader:o}])=>{if(o)try{$h(r)}catch{try{const{diagram:a,id:s}=await o();Sl(s,a,i)}catch(a){throw Lt.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Ta[r],a}}}))).filter(r=>r.status==="rejected");if(t.length>0){Lt.error(`Failed to load ${t.length} external diagrams`);for(const r of t)Lt.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),CF="graphics-document document";function d1(e,t){e.attr("role",CF),t!==""&&e.attr("aria-roledescription",t)}C(d1,"setA11yDiagramInfo");function u1(e,t,r,i){if(e.insert!==void 0){if(r){const o=`chart-desc-${i}`;e.attr("aria-describedby",o),e.insert("desc",":first-child").attr("id",o).text(r)}if(t){const o=`chart-title-${i}`;e.attr("aria-labelledby",o),e.insert("title",":first-child").attr("id",o).text(t)}}}C(u1,"addSVGa11yTitleDescription");var Ma,Xl=(Ma=class{constructor(t,r,i,o,a){this.type=t,this.text=r,this.db=i,this.parser=o,this.renderer=a}static async fromText(t,r={}){const i=typeof t=="string"?{cleaned:t}:t,o=Ar(),a=Zl(i.cleaned,o);try{$h(a)}catch{const u=C2(a);if(!u)throw new Jp(`Diagram ${a} not found.`);const{id:f,diagram:g}=await u();Sl(f,g)}const{db:s,parser:n,renderer:l,init:c}=$h(a);n.parser&&(n.parser.yy=s),s.clear?.(),c?.(o),r.title&&s.setDiagramTitle?.(r.title);let h=i.cleaned;if(s.preserveCommentsWhenParsing&&i.withComments){const u=o.maxTextSize??Ld.maxTextSize;i.withComments.length>u?Lt.warn(`Comment-preserving source exceeds maxTextSize (${i.withComments.length} > ${u}); parsing the comment-stripped text instead. Reported source positions will not account for comment lines.`):h=i.withComments}const d=TM(h)+`
301
+ L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),cL=C((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),hL=C((e,t,r)=>{const i=Ar(),{themeVariables:o}=i,{strokeWidth:a}=o,s=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");s.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),s.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),s.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),s.selectAll("*").attr("stroke-width",`${a}`)},"requirement_contains_neo"),dL=C((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-hierarchyEnd").attr("class","marker hierarchy "+t).attr("viewBox","0 0 12 10").attr("refX",10).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M 0 0 L 6 5 L 0 10 M 4 0 L 10 5 L 4 10").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0").style("fill","none"),e.append("marker").attr("id",r+"_"+t+"-hierarchyStart").attr("class","marker hierarchy "+t).attr("viewBox","0 0 12 10").attr("refX",2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M 12 0 L 6 5 L 12 10 M 8 0 L 2 5 L 8 10").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0").style("fill","none")},"hierarchy"),uL=C((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-openArrowEnd").attr("class","marker openArrow "+t).attr("viewBox","0 0 12 12").attr("refX",11).attr("refY",6).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1 1 L 11 6 L 1 11").attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-linecap","round").style("stroke-linejoin","round").style("stroke-dasharray","1,0").style("fill","none"),e.append("marker").attr("id",r+"_"+t+"-openArrowStart").attr("class","marker openArrow "+t).attr("viewBox","0 0 12 12").attr("refX",1).attr("refY",6).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 11 1 L 1 6 L 11 11").attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-linecap","round").style("stroke-linejoin","round").style("stroke-dasharray","1,0").style("fill","none")},"openArrow"),fL=C((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-hollowCircleStart").attr("class","marker hollowCircle "+t).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("circle").attr("cx",5).attr("cy",5).attr("r",3.6).attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-dasharray","1,0").style("fill","none"),e.append("marker").attr("id",r+"_"+t+"-hollowCircleEnd").attr("class","marker hollowCircle "+t).attr("viewBox","0 0 10 10").attr("refX",10).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("circle").attr("cx",5).attr("cy",5).attr("r",3.6).attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-dasharray","1,0").style("fill","none")},"hollowCircle"),gL={extension:H_,composition:Y_,aggregation:X_,dependency:j_,lollipop:G_,point:U_,circle:V_,cross:Z_,barb:K_,barbNeo:Q_,hierarchy:dL,only_one:J_,zero_or_one:tL,one_or_more:eL,zero_or_more:rL,only_one_neo:iL,zero_or_one_neo:oL,one_or_more_neo:aL,zero_or_more_neo:sL,requirement_arrow:nL,requirement_contains:cL,requirement_arrow_neo:lL,requirement_contains_neo:hL,openArrow:uL,hollowCircle:fL},pL=z_,mL={common:kn,getConfig:Ar,insertCluster:UB,insertEdge:W_,insertEdgeLabel:E_,insertMarkers:pL,insertNode:eb,interpolateToCurve:Vd,labelHelper:he,log:Lt,positionEdgeLabel:I_},yL=["elk.stress","elk.force","elk.mrtree","elk.sporeOverlap","elk.box","elk.rectpacking"],mn=Object.create(null),Cb=C(e=>{for(const t of e)mn[t.name]=t},"registerLayoutLoaders"),xL=C(()=>{const e=C(async()=>await Ve(()=>import("./DE8QOEZV.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url),"loader");return[{name:"elk",loader:e,algorithm:"elk.layered"},...yL.map(t=>({name:t,loader:e,algorithm:t}))]},"elkLayoutLoaders"),bL=C(()=>{Cb([{name:"dagre",loader:C(async()=>await Ve(()=>import("./BDZoh7yg.js"),__vite__mapDeps([7,2,3,4,5]),import.meta.url),"loader")},{name:"swimlane",loader:C(async()=>await Ve(()=>import("./Dj8J0eqI.js"),__vite__mapDeps([8,1,2,3,4,5]),import.meta.url),"loader")},{name:"cose-bilkent",loader:C(async()=>await Ve(()=>import("./Y4VeEPHl.js"),__vite__mapDeps([9,10,6]),import.meta.url),"loader")},...xL()])},"registerDefaultLayoutLoaders");bL();var LP=C(async(e,t)=>{if(!Object.hasOwn(mn,e.layoutAlgorithm))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const a of e.nodes){const s=a.domId||a.id;a.domId=`${e.diagramId}-${s}`}const r=mn[e.layoutAlgorithm],i=await r.loader();a2(t,e.config);const o=await i.render(e,t,mL,{algorithm:r.algorithm});return B_(t.node()),o},"render"),ch="dagre",AP=C((e="",{fallback:t=ch}={})=>{if(Object.hasOwn(mn,e))return e;for(const r of[t,ch])if(Object.hasOwn(mn,r))return Lt.warn(`Layout algorithm ${e} is not registered. Using ${r} as fallback.`),r;throw new Error(`Neither layout algorithm ${e}, ${t}, nor ${ch} is registered.`)},"getRegisteredLayoutAlgorithm"),CL=C(e=>{const{securityLevel:t}=Ge();let r=Ye("body");if(t==="sandbox"){const a=Ye(`#i${e}`).node()?.contentDocument??document;r=Ye(a.body)}return r.select(`#${e}`)},"selectSvgElement"),ku="comm",wb="rule",kb="decl",wL="@media",kL="@import",SL="@supports",vL="@namespace",td="@keyframes",Sb="@layer",ML="@scope",TL=Math.abs,hn=String.fromCharCode;function vb(e){return e.trim()}function ed(e,t,r){return e.replace(t,r)}function is(e,t){return e.charCodeAt(t)|0}function ks(e,t,r){return e.slice(t,r)}function oo(e){return e.length}function Mb(e){return e.length}function jn(e,t){return t.push(e),e}var cc=1,Ss=1,Tb=0,Ii=0,qr=0,Fs="";function Su(e,t,r,i,o,a,s,n){return{value:e,root:t,parent:r,type:i,props:o,children:a,line:cc,column:Ss,length:s,return:"",siblings:n}}function BL(){return qr}function _L(){return qr=Ii>0?is(Fs,--Ii):0,Ss--,qr===10&&(Ss=1,cc--),qr}function ji(){return qr=Ii<Tb?is(Fs,Ii++):0,Ss++,qr===10&&(Ss=1,cc++),qr}function Vo(){return is(Fs,Ii)}function fl(){return Ii}function hc(e,t){return ks(Fs,e,t)}function yn(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function LL(e){return cc=Ss=1,Tb=oo(Fs=e),Ii=0,[]}function AL(e){return Fs="",e}function hh(e){return vb(hc(Ii-1,rd(e===91?e+2:e===40?e+1:e)))}function FL(e){for(;(qr=Vo())&&qr<33;)ji();return yn(e)>2||yn(qr)>3?"":" "}function $L(e,t){for(;--t&&ji()&&!(qr<48||qr>102||qr>57&&qr<65||qr>70&&qr<97););return hc(e,fl()+(t<6&&Vo()==32&&ji()==32))}function rd(e){for(;ji();)switch(qr){case e:return Ii;case 34:case 39:e!==34&&e!==39&&rd(qr);break;case 40:e===41&&rd(e);break;case 92:ji();break}return Ii}function EL(e,t){for(;ji()&&e+qr!==57;)if(e+qr===84&&Vo()===47)break;return"/*"+hc(t,Ii-1)+"*"+hn(e===47?e:ji())}function PL(e){for(;!yn(Vo());)ji();return hc(e,Ii)}function IL(e){return AL(gl("",null,null,null,[""],e=LL(e),0,[0],e))}function gl(e,t,r,i,o,a,s,n,l){for(var c=0,h=0,d=s,u=0,f=0,g=0,p=1,m=1,y=1,x=0,b=0,S="",T=o,k=a,_=i,L=S;m;)switch(g=b,b=ji()){case 40:g!=108&&is(L,d-1)==58?(x++,L+="("):L+=hh(b);break;case 41:x--,L+=")";break;case 34:case 39:case 91:L+=hh(b);break;case 9:case 10:case 13:case 32:if(x>0){L+=hn(b);break}L+=FL(g);break;case 92:L+=$L(fl()-1,7);continue;case 47:switch(Vo()){case 42:case 47:jn(OL(EL(ji(),fl()),t,r,l),l),(yn(g||1)==5||yn(Vo()||1)==5)&&oo(L)&&ks(L,-1,void 0)!==" "&&(L+=" ");break;default:L+="/"}break;case 123*p:n[c++]=oo(L)*y;case 125*p:case 59:case 0:if(x>0&&b){L+=hn(b);break}switch(b){case 0:case 125:m=0;case 59+h:y==-1&&(L=ed(L,/\f/g,"")),f>0&&(oo(L)-d||p===0)&&jn(f>32?sp(L+";",i,r,d-1,l):sp(ed(L," ","")+";",i,r,d-2,l),l);break;case 59:L+=";";default:if(jn(_=ap(L,t,r,c,h,o,n,S,T=[],k=[],d,a),a),b===123)if(h===0)gl(L,t,_,_,T,a,d,n,k);else{switch(u){case 99:if(is(L,3)===110)break;case 108:if(is(L,2)===97)break;default:h=0;case 100:case 109:case 115:}h?gl(e,_,_,i&&jn(ap(e,_,_,0,0,o,n,S,o,T=[],d,k),k),o,k,d,n,i?T:k):gl(L,_,_,_,[""],k,0,n,k)}}c=h=f=0,p=y=1,S=L="",d=s;break;case 58:d=1+oo(L),f=g;default:if(p<1){if(b==123)--p;else if(b==125&&p++==0&&_L()==125)continue}switch(L+=hn(b),b*p){case 38:y=h>0?1:(L+="\f",-1);break;case 44:if(x>0)break;n[c++]=(oo(L)-1)*y,y=1;break;case 64:Vo()===45&&(L+=hh(ji())),u=Vo(),h=d=oo(S=L+=PL(fl())),b++;break;case 45:g===45&&oo(L)==2&&(p=0)}}return a}function ap(e,t,r,i,o,a,s,n,l,c,h,d){for(var u=o-1,f=o===0?a:[""],g=Mb(f),p=0,m=0,y=0;p<i;++p)for(var x=0,b=ks(e,u+1,u=TL(m=s[p])),S=e;x<g;++x)(S=vb(m>0?f[x]+" "+b:ed(b,/&\f/g,f[x])))&&(l[y++]=S);return Su(e,t,r,o===0?wb:n,l,c,h,d)}function OL(e,t,r,i){return Su(e,t,r,ku,hn(BL()),ks(e,2,-2),0,i)}function sp(e,t,r,i,o){return Su(e,t,r,kb,ks(e,0,i),ks(e,i+1,-1),i,o)}function id(e,t){for(var r="",i=0;i<e.length;i++)r+=t(e[i],i,e,t)||"";return r}function DL(e,t,r,i){switch(e.type){case Sb:if(e.children.length)break;case kL:case vL:case kb:return e.return=e.return||e.value;case ku:return"";case td:return e.return=e.value+"{"+id(e.children,i)+"}";case wb:if(!oo(e.value=e.props.join(",")))return""}return oo(r=id(e.children,i))?e.return=e.value+"{"+r+"}":""}function RL(e){var t=Mb(e);return function(r,i,o,a){for(var s="",n=0;n<t;n++)s+=e[n](r,i,o,a)||"";return s}}var Bb="c4",NL=C(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),qL=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./CvGEpOsC.js");return{diagram:t}},__vite__mapDeps([11,12]),import.meta.url);return{id:Bb,diagram:e}},"loader"),WL={id:Bb,detector:NL,loader:qL},zL=WL,_b="flowchart-v2",HL=C(e=>/^\s*(graph|flowchart)/.test(e),"detector"),YL=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./BlEwAz4v.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,6,52,53,54,55,56,57,58]),import.meta.url);return{id:_b,diagram:e}},"loader"),XL={id:_b,detector:HL,loader:YL},jL=XL,Lb="agentflow",GL=C(e=>/^\s*agentflow-beta\b/.test(e),"detector"),UL=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./s0TWEExr.js");return{diagram:t}},__vite__mapDeps([59,14,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,6,52,53,54,55,56,57,58]),import.meta.url);return{id:Lb,diagram:e}},"loader"),VL={id:Lb,detector:GL,loader:UL},ZL=VL,Ab="swimlane",KL=C(e=>/^\s*swimlane-beta\b/.test(e),"detector"),QL=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./CNT1n9YR.js");return{diagram:t}},__vite__mapDeps([60,13,14,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,6,52,53,54,55,56,57,58]),import.meta.url);return{id:Ab,diagram:e}},"loader"),JL={id:Ab,detector:KL,loader:QL},tA=JL,Fb="er",eA=C(e=>/^\s*erDiagram/.test(e),"detector"),rA=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./ClMg3ew2.js");return{diagram:t}},__vite__mapDeps([61,15,16]),import.meta.url);return{id:Fb,diagram:e}},"loader"),iA={id:Fb,detector:eA,loader:rA},oA=iA,$b="gitGraph",aA=C(e=>/^\s*gitGraph/.test(e),"detector"),sA=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./CJ_dtcmM.js");return{diagram:t}},__vite__mapDeps([62,63,64,65,3,4]),import.meta.url);return{id:$b,diagram:e}},"loader"),nA={id:$b,detector:aA,loader:sA},lA=nA,Eb="gantt",cA=C(e=>/^\s*gantt/.test(e),"detector"),hA=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./DdVIXVso.js");return{diagram:t}},__vite__mapDeps([66,6,67]),import.meta.url);return{id:Eb,diagram:e}},"loader"),dA={id:Eb,detector:cA,loader:hA},uA=dA,Pb="info",fA=C(e=>/^\s*info/.test(e),"detector"),gA=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./G_wYaln-.js");return{diagram:t}},__vite__mapDeps([68,65,3,4]),import.meta.url);return{id:Pb,diagram:e}},"loader"),pA={id:Pb,detector:fA,loader:gA},Ib="pie",mA=C(e=>/^\s*pie/.test(e),"detector"),yA=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./Zl17pAXX.js");return{diagram:t}},__vite__mapDeps([69,64,65,3,4,67]),import.meta.url);return{id:Ib,diagram:e}},"loader"),xA={id:Ib,detector:mA,loader:yA},Ob="quadrantChart",bA=C(e=>/^\s*quadrantChart/.test(e),"detector"),CA=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./CmoBwSCp.js");return{diagram:t}},__vite__mapDeps([70,67]),import.meta.url);return{id:Ob,diagram:e}},"loader"),wA={id:Ob,detector:bA,loader:CA},kA=wA,Db="xychart",SA=C(e=>/^\s*xychart(-beta)?/.test(e),"detector"),vA=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./CrjpdU4V.js");return{diagram:t}},__vite__mapDeps([71,67]),import.meta.url);return{id:Db,diagram:e}},"loader"),MA={id:Db,detector:SA,loader:vA},TA=MA,Rb="requirement",BA=C(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),_A=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./CQB76zlc.js");return{diagram:t}},__vite__mapDeps([72,15,16]),import.meta.url);return{id:Rb,diagram:e}},"loader"),LA={id:Rb,detector:BA,loader:_A},AA=LA,Nb="sequence",FA=C(e=>/^\s*sequenceDiagram/.test(e),"detector"),$A=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./BmEcZoA2.js");return{diagram:t}},__vite__mapDeps([73,63,12]),import.meta.url);return{id:Nb,diagram:e}},"loader"),EA={id:Nb,detector:FA,loader:$A},PA=EA,qb="classDiagram",IA=C(e=>/^\s*classDiagram/.test(e),"detector"),OA=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./CXpFRnSj.js");return{diagram:t}},__vite__mapDeps([74,14,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,6,52,53,54,55,56,57,58]),import.meta.url);return{id:qb,diagram:e}},"loader"),DA={id:qb,detector:IA,loader:OA},RA=DA,Wb="stateDiagram",NA=C(e=>/^\s*stateDiagram/.test(e),"detector"),qA=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./CjbCpI18.js");return{diagram:t}},__vite__mapDeps([75,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,6,52,53,54,55,56,57,58]),import.meta.url);return{id:Wb,diagram:e}},"loader"),WA={id:Wb,detector:NA,loader:qA},zA=WA,zb="journey",HA=C(e=>/^\s*journey/.test(e),"detector"),YA=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./BM7oCSp5.js");return{diagram:t}},__vite__mapDeps([76,14,12]),import.meta.url);return{id:zb,diagram:e}},"loader"),XA={id:zb,detector:HA,loader:YA},jA=XA,Gn=4,Hs=75,GA=C(e=>{const t=[];for(const o of e.split(/\s+/)){let a=[...o];for(;a.length>Hs;)t.push(a.slice(0,Hs).join("")),a=a.slice(Hs);a.length>0&&t.push(a.join(""))}const r=[];let i="";for(const o of t){const a=i?`${i} ${o}`:o;[...a].length>Hs?(r.push(i),i=o):i=a}if(i&&r.push(i),r.length>Gn){r.length=Gn;const o=r[Gn-1]??"";r[Gn-1]=`${[...o].slice(0,Hs-3).join("")}...`}return r},"wrapErrorMessage"),UA=C((e,t,r,i)=>{Lt.debug(`rendering svg for syntax error
302
+ `);const o=CL(t),a=o.append("g"),s=GA(i?.db.getErrorMessage?.()??""),n=s.length>0?500+s.length*56:512;o.attr("viewBox",`0 0 2412 ${n}`),um(o,100,n,!0),a.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),a.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),a.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),a.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),a.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),a.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),a.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),a.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`),s.forEach((l,c)=>{a.append("text").attr("class","error-text").attr("x",1440).attr("y",510+c*56).attr("font-size","42px").style("text-anchor","middle").text(l)})},"draw"),Hb={draw:UA},VA=Hb,dh,ZA={clear(){dh=void 0},setErrorMessage(e){dh=e},getErrorMessage(){return dh}},KA={db:ZA,renderer:Hb,parser:{parse:C(()=>{},"parse")}},QA=KA,Yb="flowchart-elk",JA=C((e,t={})=>/^\s*flowchart-elk/.test(e)?(t.layout="elk",!0):!1,"detector"),t5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./BlEwAz4v.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,6,52,53,54,55,56,57,58]),import.meta.url);return{id:Yb,diagram:e}},"loader"),e5={id:Yb,detector:JA,loader:t5},r5=e5,Xb="timeline",i5=C(e=>/^\s*timeline/.test(e),"detector"),o5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./CQyjMIYw.js");return{diagram:t}},[],import.meta.url);return{id:Xb,diagram:e}},"loader"),a5={id:Xb,detector:i5,loader:o5},s5=a5,jb="mindmap",n5=C(e=>/^\s*mindmap/.test(e),"detector"),l5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./CFs6uWH2.js");return{diagram:t}},__vite__mapDeps([77,15,16]),import.meta.url);return{id:jb,diagram:e}},"loader"),c5={id:jb,detector:n5,loader:l5},h5=c5,Gb="kanban",d5=C(e=>/^\s*kanban/.test(e),"detector"),u5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./Bxnf75xq.js");return{diagram:t}},__vite__mapDeps([78,14]),import.meta.url);return{id:Gb,diagram:e}},"loader"),f5={id:Gb,detector:d5,loader:u5},g5=f5,Ub="sankey",p5=C(e=>/^\s*sankey(-beta)?/.test(e),"detector"),m5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./eNHX5lds.js");return{diagram:t}},__vite__mapDeps([79,67]),import.meta.url);return{id:Ub,diagram:e}},"loader"),y5={id:Ub,detector:p5,loader:m5},x5=y5,Vb="packet",b5=C(e=>/^\s*packet(-beta)?/.test(e),"detector"),C5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./BJZ04Dji.js");return{diagram:t}},__vite__mapDeps([80,64,65,3,4]),import.meta.url);return{id:Vb,diagram:e}},"loader"),w5={id:Vb,detector:b5,loader:C5},Zb="radar",k5=C(e=>/^\s*radar-beta/.test(e),"detector"),S5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./D1CYDv8t.js");return{diagram:t}},__vite__mapDeps([81,64,65,3,4]),import.meta.url);return{id:Zb,diagram:e}},"loader"),v5={id:Zb,detector:k5,loader:S5},Kb="block",M5=C(e=>/^\s*block(-beta)?/.test(e),"detector"),T5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./Ckp5dOHW.js");return{diagram:t}},__vite__mapDeps([82,14,5]),import.meta.url);return{id:Kb,diagram:e}},"loader"),B5={id:Kb,detector:M5,loader:T5},_5=B5,Qb="treeView",L5=C(e=>/^\s*treeView-beta/.test(e),"detector"),A5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./jlJQSpH6.js");return{diagram:t}},__vite__mapDeps([83,63,64,65,3,4]),import.meta.url);return{id:Qb,diagram:e}},"loader"),F5={id:Qb,detector:L5,loader:A5},$5=F5,Jb="architecture",E5=C(e=>/^\s*architecture/.test(e),"detector"),P5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./CCm1BgPl.js");return{diagram:t}},__vite__mapDeps([84,64,65,3,4,10,6]),import.meta.url);return{id:Jb,diagram:e}},"loader"),I5={id:Jb,detector:E5,loader:P5},O5=I5,t1="eventmodeling",D5=C(e=>/^\s*eventmodeling/.test(e),"detector"),R5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./D31IcU1_.js");return{diagram:t}},__vite__mapDeps([85,64,65,3,4]),import.meta.url);return{id:t1,diagram:e}},"loader"),N5={id:t1,detector:D5,loader:R5},q5=N5,e1="ishikawa",W5=C(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),z5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./BYDvuR-h.js");return{diagram:t}},[],import.meta.url);return{id:e1,diagram:e}},"loader"),H5={id:e1,detector:W5,loader:z5},r1="venn",Y5=C(e=>/^\s*venn-beta/.test(e),"detector"),X5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./CtDj7gZD.js");return{diagram:t}},[],import.meta.url);return{id:r1,diagram:e}},"loader"),j5={id:r1,detector:Y5,loader:X5},G5=j5,i1="treemap",U5=C(e=>/^\s*treemap/.test(e),"detector"),V5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./WbTmlouE.js");return{diagram:t}},__vite__mapDeps([86,16,64,65,3,4,67]),import.meta.url);return{id:i1,diagram:e}},"loader"),Z5={id:i1,detector:U5,loader:V5},o1="usecase",K5=C(e=>/^\s*usecase-beta(?:\s|$)/.test(e),"detector"),Q5=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./B3D9gAmi.js");return{diagram:t}},__vite__mapDeps([87,15,16]),import.meta.url);return{id:o1,diagram:e}},"loader"),J5={id:o1,detector:K5,loader:Q5},a1="wardley",tF=C(e=>/^\s*wardley-beta/i.test(e),"detector"),eF=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./DW9MEQey.js");return{diagram:t}},__vite__mapDeps([88,64,65,3,4]),import.meta.url);return{id:a1,diagram:e}},"loader"),rF={id:a1,detector:tF,loader:eF},iF=rF,s1="cynefin",oF=C(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),aF=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./ouMKS3MA.js");return{diagram:t}},__vite__mapDeps([89,64,65,3,4]),import.meta.url);return{id:s1,diagram:e}},"loader"),sF={id:s1,detector:oF,loader:aF},n1="railroad",nF=C(e=>/^\s*railroad-beta/i.test(e),"detector"),lF=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./C8XrM-qb.js");return{diagram:t}},__vite__mapDeps([90,91,64,65,3,4]),import.meta.url);return{id:n1,diagram:e}},"loader"),cF={id:n1,detector:nF,loader:lF},l1="railroadEbnf",hF=C(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),dF=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./BLl22NdQ.js");return{diagram:t}},__vite__mapDeps([92,91,64,65,3,4]),import.meta.url);return{id:l1,diagram:e}},"loader"),uF={id:l1,detector:hF,loader:dF},c1="railroadAbnf",fF=C(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),gF=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./BLaIjbEF.js");return{diagram:t}},__vite__mapDeps([93,91,64,65,3,4]),import.meta.url);return{id:c1,diagram:e}},"loader"),pF={id:c1,detector:fF,loader:gF},h1="railroadPeg",mF=C(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),yF=C(async()=>{const{diagram:e}=await Ve(async()=>{const{diagram:t}=await import("./BnkmaA34.js");return{diagram:t}},__vite__mapDeps([94,91,64,65,3,4]),import.meta.url);return{id:h1,diagram:e}},"loader"),xF={id:h1,detector:mF,loader:yF},np=!1,dc=C(()=>{np||(np=!0,Sl("error",QA,e=>e.toLowerCase().trim()==="error"),Sl("---",{db:{clear:C(()=>{},"clear")},styles:{},renderer:{draw:C(()=>{},"draw")},parser:{parse:C(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:C(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),Bh(r5,h5,O5),Bh(ZL,zL,g5,RA,oA,uA,pA,xA,AA,PA,tA,jL,s5,lA,zA,jA,kA,x5,w5,TA,_5,q5,$5,v5,H5,Z5,cF,uF,pF,xF,G5,iF,sF,J5))},"addDiagrams"),bF=C(async()=>{Lt.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(Ta).map(async([r,{detector:i,loader:o}])=>{if(o)try{$h(r)}catch{try{const{diagram:a,id:s}=await o();Sl(s,a,i)}catch(a){throw Lt.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete Ta[r],a}}}))).filter(r=>r.status==="rejected");if(t.length>0){Lt.error(`Failed to load ${t.length} external diagrams`);for(const r of t)Lt.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),CF="graphics-document document";function d1(e,t){e.attr("role",CF),t!==""&&e.attr("aria-roledescription",t)}C(d1,"setA11yDiagramInfo");function u1(e,t,r,i){if(e.insert!==void 0){if(r){const o=`chart-desc-${i}`;e.attr("aria-describedby",o),e.insert("desc",":first-child").attr("id",o).text(r)}if(t){const o=`chart-title-${i}`;e.attr("aria-labelledby",o),e.insert("title",":first-child").attr("id",o).text(t)}}}C(u1,"addSVGa11yTitleDescription");var Ma,Xl=(Ma=class{constructor(t,r,i,o,a){this.type=t,this.text=r,this.db=i,this.parser=o,this.renderer=a}static async fromText(t,r={}){const i=typeof t=="string"?{cleaned:t}:t,o=Ar(),a=Zl(i.cleaned,o);try{$h(a)}catch{const u=C2(a);if(!u)throw new Jp(`Diagram ${a} not found.`);const{id:f,diagram:g}=await u();Sl(f,g)}const{db:s,parser:n,renderer:l,init:c}=$h(a);n.parser&&(n.parser.yy=s),s.clear?.(),c?.(o),r.title&&s.setDiagramTitle?.(r.title);let h=i.cleaned;if(s.preserveCommentsWhenParsing&&i.withComments){const u=o.maxTextSize??Ld.maxTextSize;i.withComments.length>u?Lt.warn(`Comment-preserving source exceeds maxTextSize (${i.withComments.length} > ${u}); parsing the comment-stripped text instead. Reported source positions will not account for comment lines.`):h=i.withComments}const d=TM(h)+`
303
303
  `;return i.frontmatterLineOffset&&s.setFrontmatterLineOffset?.(i.frontmatterLineOffset),await n.parse(d),new Ma(a,d,s,n,l)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},C(Ma,"Diagram"),Ma),lp=[],wF=C(()=>{lp.forEach(e=>{e()}),lp=[]},"attachFunctions"),kF=C(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function f1(e){const t=Qp(e);if(!t)return{text:e,metadata:{}};const r=t.indent,i=r?t.body.split(`
304
304
  `).map(s=>s.startsWith(r)?s.slice(r.length):s).join(`
305
305
  `):t.body;let o=o2(i,{schema:i2})??{};o=typeof o=="object"&&!Array.isArray(o)?o:{};const a={};return o.displayMode&&(a.displayMode=o.displayMode.toString()),o.title&&(a.title=o.title.toString()),o.config&&(a.config=o.config),{text:e.slice(t.length),metadata:a}}C(f1,"extractFrontMatter");var SF=C(e=>e.replace(/\r\n?/g,`
@@ -309,10 +309,10 @@ ${a.join(`
309
309
  ${RF}
310
310
  </iframe>`},"putIntoIFrame"),hp=C((e,t,r,i,o)=>{const a=e.append("div");a.attr("id",r),i&&a.attr("style",i);const s=a.append("svg").attr("id",t).attr("width","100%").attr("xmlns",AF);return o&&s.attr("xmlns:xlink",o),s.append("g"),e},"appendDivSvgG");function od(e,t){return e.append("iframe").attr("id",t).attr("style","width: 100%; height: 100%;").attr("sandbox","")}C(od,"sandboxedIframe");var jF=C((e,t,r,i)=>{e.getElementById(t)?.remove(),e.getElementById(r)?.remove(),e.getElementById(i)?.remove()},"removeExistingElements"),GF=C(async function(e,t,r){dc();const i=Mu(t);let o=i.code;t=o.cleaned;const a=Ar();Lt.debug(a),t.length>(a?.maxTextSize??TF)&&(t=BF,o={raw:t,cleaned:t});const s=`#${e}`,n="i"+e,l="#"+n,c="d"+e,h="#"+c,d=C(()=>{const I=Ye(f?l:h).node();I&&"remove"in I&&I.remove()},"removeTempElements");let u=Ye(document.body);const f=a.securityLevel===_F,g=a.securityLevel===LF,p=a.fontFamily;if(r!==void 0){if(r&&(r.innerHTML=""),f){const $=od(Ye(r),n);u=Ye($.nodes()[0].contentDocument.body),u.node().style.margin="0"}else u=Ye(r);hp(u,e,c,`font-family: ${p}`,FF)}else{if(jF(document,e,c,n),f){const $=od(Ye(document.body),n);u=Ye($.nodes()[0].contentDocument.body),u.node().style.margin="0"}else u=Ye("body");hp(u,e,c)}let m,y;try{m=await Xl.fromText(o,{title:i.title})}catch($){if(a.suppressErrorRendering)throw d(),$;m=await Xl.fromText("error"),y=$,m.db.setErrorMessage?.(By($))}const x=u.select(h).node(),b=m.type,S=x.firstChild,T=S.firstChild,k=m.renderer.getClasses?.(t,m),_=HF(a,b,k,s),L=document.createElement("style");L.innerHTML=_,S.insertBefore(L,T);try{await m.renderer.draw(t,e,"12.3.0",m)}catch($){throw a.suppressErrorRendering?d():VA.draw(t,e,"12.3.0"),$}const v=u.select(`${h} svg`),M=m.db.getAccTitle?.(),B=m.db.getAccDescription?.();y1(b,v,M,B);const O=C(()=>{u.select(`[id="${e}"]`).selectAll("foreignobject > *").attr("xmlns",$F);let $=u.select(h).node().innerHTML;if(Lt.debug("config.arrowMarkerAbsolute",a.arrowMarkerAbsolute),$=YF($,f,mo(a.arrowMarkerAbsolute)),f){const I=u.select(h+" svg").node();$=XF($,I)}else g||($=bs.sanitize($,{ADD_TAGS:NF,ADD_ATTR:qF,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));return wF(),$},"serializeSvg")();if(y)throw y;return d(),{diagramType:b,svg:O,bindFunctions:m.db.bindFunctions}},"renderDiagram"),UF=C(async function(e,t,r){try{return await GF(e,t,r)}finally{Ad(void 0)}},"render");function m1(e={}){const t=Wr({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||(t.themeVariables={}),t.themeVariables.fontFamily=t.fontFamily),tw(t);const r=Jo.theme;t?.theme&&Object.hasOwn($o,t.theme)?t.themeVariables=$o[t.theme].getThemeVariables(t.themeVariables):t&&(t.theme!=null&&t.theme!=="null"&&(t.theme=r),t.themeVariables=$o[r].getThemeVariables(t.themeVariables));const i=typeof t=="object"?J2(t):om();_d(i.logLevel),dc()}C(m1,"initialize");var VF=C((e,t={})=>{const{code:r}=vu(e);return Xl.fromText(r,t)},"getDiagramFromText");function y1(e,t,r,i){d1(t,e),u1(t,r,i,t.attr("id"))}C(y1,"addA11yInfo");var Aa=Object.freeze({render:UF,parse:p1,getDiagramFromText:VF,initialize:m1,getConfig:Ar,setConfig:am,getSiteConfig:om,updateSiteConfig:ew,reset:C(()=>{wl()},"reset"),globalReset:C(()=>{wl(Jo)},"globalReset"),defaultConfig:Jo});_d(Ar().logLevel);wl(Ar());var ZF=C((e,t,r)=>{Lt.warn(e),Jd(e)?(r&&r(e.str,e.hash),t.push({...e,message:e.str,error:e})):(r&&r(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},"handleError"),x1=C(async function(e={querySelector:".mermaid"}){try{await KF(e)}catch(t){if(Jd(t)&&Lt.error(t.str),Io.parseError&&Io.parseError(t),!e.suppressErrors)throw Lt.error("Use the suppressErrors option to suppress these errors"),t}},"run"),KF=C(async function({postRenderCallback:e,querySelector:t,nodes:r}={querySelector:".mermaid"}){const i=Aa.getConfig();Lt.debug(`${e?"":"No "}Callback function found`);let o;if(r)o=r;else if(t)o=document.querySelectorAll(t);else throw new Error("Nodes and querySelector are both undefined");Lt.debug(`Found ${o.length} diagrams`),i?.startOnLoad!==void 0&&(Lt.debug("Start On Load: "+i?.startOnLoad),Aa.updateSiteConfig({startOnLoad:i?.startOnLoad}));const a=new Si.InitIDGenerator(i.deterministicIds,i.deterministicIDSeed);let s;const n=[];for(const l of Array.from(o)){if(Lt.info("Rendering diagram: "+l.id),l.getAttribute("data-processed"))continue;l.setAttribute("data-processed","true");const c=`mermaid-${a.next()}`;s=l.innerHTML,s=qy(Si.entityDecode(s)).trim().replace(/<br\s*\/?>/gi,"<br/>");const h=Si.detectInit(s);h&&Lt.debug("Detected early reinit: ",h);try{const{svg:d,bindFunctions:u}=await k1(c,s,l);l.innerHTML=d,e&&await e(c),u&&u(l)}catch(d){ZF(d,n,Io.parseError)}}if(n.length>0)throw n[0]},"runThrowsErrors"),b1=C(function(e){Aa.initialize(e)},"initialize"),QF=C(async function(e,t,r){Lt.warn("mermaid.init is deprecated. Please use run instead."),e&&b1(e);const i={postRenderCallback:r,querySelector:".mermaid"};typeof t=="string"?i.querySelector=t:t&&(t instanceof HTMLElement?i.nodes=[t]:i.nodes=t),await x1(i)},"init"),JF=C(async(e,{lazyLoad:t=!0}={})=>{dc(),Bh(...e),t===!1&&await bF()},"registerExternalDiagrams"),C1=C(function(){if(Io.startOnLoad){const{startOnLoad:e}=Aa.getConfig();e&&Io.run().catch(t=>Lt.error("Mermaid failed to initialize",t))}},"contentLoaded");typeof document<"u"&&window.addEventListener("load",C1,!1);var t3=C(function(e){Io.parseError=e},"setParseErrorHandler"),jl=[],uh=!1,w1=C(async()=>{if(!uh){for(uh=!0;jl.length>0;){const e=jl.shift();if(e)try{await e()}catch(t){Lt.error("Error executing queue",t)}}uh=!1}},"executeQueue"),e3=C(async(e,t)=>new Promise((r,i)=>{const o=C(()=>new Promise((a,s)=>{Aa.parse(e,t).then(n=>{a(n),r(n)},n=>{Lt.error("Error parsing",n),Io.parseError?.(n),s(n),i(n)})}),"performCall");jl.push(o),w1().catch(i)}),"parse"),k1=C((e,t,r)=>new Promise((i,o)=>{const a=C(()=>new Promise((s,n)=>{Aa.render(e,t,r).then(l=>{s(l),i(l)},l=>{Lt.error("Error parsing",l),Io.parseError?.(l),n(l),o(l)})}),"performCall");jl.push(a),w1().catch(o)}),"render"),r3=C(()=>Object.keys(Ta).map(e=>({id:e})),"getRegisteredDiagramsMetadata"),Io={startOnLoad:!0,mermaidAPI:Aa,parse:e3,render:k1,init:QF,run:x1,registerExternalDiagrams:JF,registerLayoutLoaders:Cb,initialize:b1,parseError:void 0,contentLoaded:C1,setParseErrorHandler:t3,detectType:Zl,registerIconPacks:mm,getRegisteredDiagramsMetadata:r3},fh=Io;/*! Check if previously processed *//*!
311
311
  * Wait for document loaded before starting the execution
312
- */function i3(e,t=80){let r,i,o=!1,a=!1,s=0,n;async function l(){if(n=void 0,a||o||!i)return;const c=i,h=s;i=void 0,o=!0;try{await e(c,()=>!a&&h===s)}finally{o=!1,!a&&i&&(n=setTimeout(()=>void l(),t))}}return{update(c){a||r?.source===c.source&&r.isStreaming===c.isStreaming&&r.revision===c.revision||(r&&(!c.isStreaming||!r.isStreaming||c.revision!==r.revision||!c.source.startsWith(r.source))&&(s+=1),r=c,i=c,!o&&n===void 0&&l())},dispose(){a=!0,s+=1,i=void 0,n!==void 0&&clearTimeout(n)}}}const S1="http://www.w3.org/2000/svg",v1="http://www.w3.org/1999/xhtml",M1=["align-items","background","background-color","border","border-color","border-radius","border-style","border-width","box-sizing","color","display","fill","fill-opacity","flex","flex-direction","font-family","font-feature-settings","font-kerning","font-size","font-style","font-variant","font-variation-settings","font-weight","gap","height","justify-content","letter-spacing","line-height","margin","opacity","overflow","overflow-wrap","padding","rx","ry","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-opacity","stroke-width","text-align","text-anchor","text-transform","transform","transform-origin","vector-effect","white-space","-webkit-box-orient","-webkit-line-clamp","width","word-break"];function o3(e,t){const r=getComputedStyle(e);for(const i of M1){const o=r.getPropertyValue(i);o&&(t instanceof SVGElement||t instanceof HTMLElement)&&t.style.setProperty(i,o,"important")}}function a3(e,t){if(!(e instanceof HTMLElement)||e.dataset.storeNode!=="true"&&!e.matches("foreignObject.edge-label-surface > .labelBkg, .edge-label-html"))return;const r=getComputedStyle(e,"::before"),i=document.createElementNS(v1,"span");i.setAttribute("aria-hidden","true"),i.setAttribute("data-diagram-export-pseudo","before");for(const o of M1){const a=r.getPropertyValue(o);a&&i.style.setProperty(o,a)}for(const o of["position","z-index","top","right","bottom","left","pointer-events","mask-image","mask-composite","mask-size","mask-repeat"]){const a=r.getPropertyValue(o);a&&i.style.setProperty(o,a)}t.prepend(i)}function T1(e){const t=e.getAttribute("viewBox")?.trim().split(/[ ,]+/).map(Number),r=e.getBoundingClientRect(),i=t?.length===4?t[2]:0,o=t?.length===4?t[3]:0,a=e.getAttribute("width")??"",s=e.getAttribute("height")??"",n=/^\d+(?:\.\d+)?(?:px)?$/.test(a)?Number.parseFloat(a):0,l=/^\d+(?:\.\d+)?(?:px)?$/.test(s)?Number.parseFloat(s):0,c=e.classList.contains("diagram-svg-layer"),h=(c?n:0)||r.width||n||i||1,d=(c?l:0)||r.height||l||o||1;return{width:h,height:d}}function s3(e){let t=e;for(;t;){const r=getComputedStyle(t).backgroundColor;if(r&&r!=="transparent"&&r!=="rgba(0, 0, 0, 0)")return r;t=t.parentElement}return"transparent"}function uc(e){const t=e.querySelectorAll(".mermaid-svg > svg, svg.diagram-svg-layer"),r=t.length===1?t[0]:void 0,i=r?.closest(".mermaid-renderer, .diagram-renderer");if(!r||r.closest('[data-diagram-presentation-settled="false"]')||i?.getAttribute("data-render-settled")==="false"||i?.getAttribute("data-diagram-settled")==="false")throw new Error("Diagram SVG is unavailable");return r}function fc(e){const t=e.cloneNode(!0);t.setAttribute("xmlns",S1),t.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink");const r=[e,...e.querySelectorAll("*")],i=[t,...t.querySelectorAll("*")];r.forEach((s,n)=>{const l=i[n];if(l){if(o3(s,l),s.parentElement?.localName==="foreignObject"&&s instanceof HTMLElement&&l.setAttribute("xmlns",v1),s instanceof HTMLElement&&l instanceof HTMLElement)for(const c of["position","isolation","z-index"])l.style.setProperty(c,getComputedStyle(s).getPropertyValue(c));a3(s,l)}});const{width:o,height:a}=T1(e);return t.hasAttribute("viewBox")||t.setAttribute("viewBox",`0 0 ${o} ${a}`),t.setAttribute("width",String(o)),t.setAttribute("height",String(a)),t.style.setProperty("width",`${o}px`,"important"),t.style.setProperty("height",`${a}px`,"important"),t.style.setProperty("overflow","hidden","important"),t.style.removeProperty("position"),t.style.removeProperty("left"),t.style.removeProperty("top"),t.style.removeProperty("max-width"),t.style.removeProperty("min-width"),t.style.removeProperty("transform"),t}function _P(e){return new XMLSerializer().serializeToString(fc(uc(e)))}async function Tu(e){const t=n=>n.trim().replace(/^["']|["']$/g,"").toLowerCase(),r=new Set([e,...e.querySelectorAll("[style]")].flatMap(n=>n.style.fontFamily.split(",").map(t))),i=[],o=n=>{let l;try{l=n.cssRules}catch(c){if(c instanceof DOMException&&c.name==="SecurityError")return;throw c}for(const c of Array.from(l))c instanceof CSSFontFaceRule&&r.has(t(c.style.getPropertyValue("font-family")))?i.push(c):c instanceof CSSImportRule&&c.styleSheet?o(c.styleSheet):"cssRules"in c&&o(c)};for(const n of Array.from(e.ownerDocument.styleSheets))o(n);if(!i.length)return;const a=await Promise.all(i.map(async n=>{const l=[...n.cssText.matchAll(/url\(\s*(['"]?)(.*?)\1\s*\)/g)];let c=n.cssText;for(const[h,,d]of l){if(d.startsWith("data:"))continue;const u=await fetch(new URL(d,n.parentStyleSheet?.href??e.ownerDocument.baseURI));if(!u.ok)throw new Error("Diagram font is unavailable");const f=await u.blob(),g=await new Promise((p,m)=>{const y=new FileReader;y.onload=()=>p(String(y.result)),y.onerror=()=>m(y.error??new Error("Diagram font encoding failed")),y.readAsDataURL(f)});c=c.replace(h,`url("${g}")`)}return c})),s=document.createElementNS(S1,"style");s.textContent=a.join(`
312
+ */function i3(e,t=80){let r,i,o=!1,a=!1,s=0,n;async function l(){if(n=void 0,a||o||!i)return;const c=i,h=s;i=void 0,o=!0;try{await e(c,()=>!a&&h===s)}finally{o=!1,!a&&i&&(n=setTimeout(()=>void l(),t))}}return{update(c){a||r?.source===c.source&&r.isStreaming===c.isStreaming&&r.revision===c.revision||(r&&(!c.isStreaming||!r.isStreaming||c.revision!==r.revision||!c.source.startsWith(r.source))&&(s+=1),r=c,i=c,!o&&n===void 0&&l())},dispose(){a=!0,s+=1,i=void 0,n!==void 0&&clearTimeout(n)}}}const S1="http://www.w3.org/2000/svg",v1="http://www.w3.org/1999/xhtml",M1=["align-items","background","background-color","border","border-color","border-radius","border-style","border-width","box-sizing","color","display","fill","fill-opacity","flex","flex-direction","font-family","font-feature-settings","font-kerning","font-size","font-style","font-variant","font-variation-settings","font-weight","gap","height","justify-content","letter-spacing","line-height","margin","opacity","overflow","overflow-wrap","padding","rx","ry","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-opacity","stroke-width","text-align","text-anchor","text-transform","transform","transform-origin","vector-effect","white-space","-webkit-box-orient","-webkit-line-clamp","width","word-break"];function o3(e,t){const r=getComputedStyle(e);for(const i of M1){const o=r.getPropertyValue(i);o&&(t instanceof SVGElement||t instanceof HTMLElement)&&t.style.setProperty(i,o,"important")}}function a3(e,t){if(!(e instanceof HTMLElement)||e.dataset.storeNode!=="true"&&!e.matches("foreignObject.edge-label-surface > .labelBkg, .edge-label-html"))return;const r=getComputedStyle(e,"::before"),i=document.createElementNS(v1,"span");i.setAttribute("aria-hidden","true"),i.setAttribute("data-diagram-export-pseudo","before");for(const o of M1){const a=r.getPropertyValue(o);a&&i.style.setProperty(o,a)}for(const o of["position","z-index","top","right","bottom","left","pointer-events","mask-image","mask-composite","mask-size","mask-repeat"]){const a=r.getPropertyValue(o);a&&i.style.setProperty(o,a)}t.prepend(i)}function T1(e){const t=e.getAttribute("viewBox")?.trim().split(/[ ,]+/).map(Number),r=e.getBoundingClientRect(),i=t?.length===4?t[2]:0,o=t?.length===4?t[3]:0,a=e.getAttribute("width")??"",s=e.getAttribute("height")??"",n=/^\d+(?:\.\d+)?(?:px)?$/.test(a)?Number.parseFloat(a):0,l=/^\d+(?:\.\d+)?(?:px)?$/.test(s)?Number.parseFloat(s):0,c=e.classList.contains("diagram-svg-layer"),h=(c?n:0)||r.width||n||i||1,d=(c?l:0)||r.height||l||o||1;return{width:h,height:d}}function s3(e){let t=e;for(;t;){const r=getComputedStyle(t).backgroundColor;if(r&&r!=="transparent"&&r!=="rgba(0, 0, 0, 0)")return r;t=t.parentElement}return"transparent"}function uc(e){const t=e.querySelectorAll(".mermaid-svg > svg, svg.diagram-svg-layer"),r=t.length===1?t[0]:void 0,i=r?.closest(".mermaid-renderer, .diagram-renderer");if(!r||r.closest('[data-diagram-presentation-settled="false"]')||i?.getAttribute("data-render-settled")==="false"||i?.getAttribute("data-diagram-settled")==="false")throw new Error("Diagram SVG is unavailable");return r}function fc(e){const t=e.cloneNode(!0);t.setAttribute("xmlns",S1),t.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink");const r=[e,...e.querySelectorAll("*")],i=[t,...t.querySelectorAll("*")];r.forEach((s,n)=>{const l=i[n];if(l){if(o3(s,l),s.parentElement?.localName==="foreignObject"&&s instanceof HTMLElement&&l.setAttribute("xmlns",v1),s instanceof HTMLElement&&l instanceof HTMLElement)for(const c of["position","isolation","z-index"])l.style.setProperty(c,getComputedStyle(s).getPropertyValue(c));a3(s,l)}});const{width:o,height:a}=T1(e);return t.hasAttribute("viewBox")||t.setAttribute("viewBox",`0 0 ${o} ${a}`),t.setAttribute("width",String(o)),t.setAttribute("height",String(a)),t.style.setProperty("width",`${o}px`,"important"),t.style.setProperty("height",`${a}px`,"important"),t.style.setProperty("overflow","hidden","important"),t.style.removeProperty("position"),t.style.removeProperty("left"),t.style.removeProperty("top"),t.style.removeProperty("max-width"),t.style.removeProperty("min-width"),t.style.removeProperty("transform"),t}function FP(e){return new XMLSerializer().serializeToString(fc(uc(e)))}async function Tu(e){const t=n=>n.trim().replace(/^["']|["']$/g,"").toLowerCase(),r=new Set([e,...e.querySelectorAll("[style]")].flatMap(n=>n.style.fontFamily.split(",").map(t))),i=[],o=n=>{let l;try{l=n.cssRules}catch(c){if(c instanceof DOMException&&c.name==="SecurityError")return;throw c}for(const c of Array.from(l))c instanceof CSSFontFaceRule&&r.has(t(c.style.getPropertyValue("font-family")))?i.push(c):c instanceof CSSImportRule&&c.styleSheet?o(c.styleSheet):"cssRules"in c&&o(c)};for(const n of Array.from(e.ownerDocument.styleSheets))o(n);if(!i.length)return;const a=await Promise.all(i.map(async n=>{const l=[...n.cssText.matchAll(/url\(\s*(['"]?)(.*?)\1\s*\)/g)];let c=n.cssText;for(const[h,,d]of l){if(d.startsWith("data:"))continue;const u=await fetch(new URL(d,n.parentStyleSheet?.href??e.ownerDocument.baseURI));if(!u.ok)throw new Error("Diagram font is unavailable");const f=await u.blob(),g=await new Promise((p,m)=>{const y=new FileReader;y.onload=()=>p(String(y.result)),y.onerror=()=>m(y.error??new Error("Diagram font encoding failed")),y.readAsDataURL(f)});c=c.replace(h,`url("${g}")`)}return c})),s=document.createElementNS(S1,"style");s.textContent=a.join(`
313
313
  `),e.prepend(s)}async function n3(e){const t=fc(uc(e));await Tu(t),await QC(new XMLSerializer().serializeToString(t))}async function l3(e){const t=uc(e),r=fc(t),{width:i,height:o}=T1(t);await Tu(r);const a=2,s=new Image;try{s.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(r))}`,await s.decode();const n=document.createElement("canvas");n.width=Math.round(i*a),n.height=Math.round(o*a);const l=n.getContext("2d");if(!l)throw new Error("Canvas context is unavailable");l.fillStyle=s3(t),l.fillRect(0,0,n.width,n.height),l.drawImage(s,0,0,n.width,n.height);const c=await new Promise((h,d)=>{n.toBlob(u=>u?h(u):d(new Error("PNG encoding failed")),"image/png")});await navigator.clipboard.write([new ClipboardItem({"image/png":c})])}finally{s.src=""}}async function c3(e,t="diagram"){const r=fc(uc(e));await Tu(r);const i=new Blob([new XMLSerializer().serializeToString(r)],{type:"image/svg+xml"}),o=URL.createObjectURL(i),a=document.createElement("a");a.href=o,a.download=`${t.replace(/[^a-z0-9._-]+/gi,"-").replace(/^-|-$/g,"")||"diagram"}.svg`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(o)}var h3=ar("<!> <!> <!>",1),d3=ar("<!> <!>",1);function Bu(e,t){if(new.target)return Oo({component:Bu,...e});No(t,!0);let r=He(t,"container",7),i=He(t,"fileName",7,"diagram"),o=He(t,"compactTrigger",7,!1);async function a(){if(!r())return wo.error(je.diagram_actions_copyFailed_error());try{await l3(r()),wo.success(je.diagram_actions_imageCopied_label())}catch{wo.error(je.diagram_actions_copyFailed_error())}}async function s(){if(!r())return wo.error(je.diagram_actions_copyFailed_error());try{await n3(r()),wo.success(je.diagram_actions_svgCopied_label())}catch{wo.error(je.diagram_actions_copyFailed_error())}}async function n(){if(!r())return wo.error(je.diagram_actions_downloadFailed_error());try{await c3(r(),i()),wo.success(je.diagram_actions_svgDownloaded_label())}catch{wo.error(je.diagram_actions_downloadFailed_error())}}var l={get container(){return r()},set container(d){r(d),_e()},get fileName(){return i()},set fileName(d="diagram"){i(d),_e()},get compactTrigger(){return o()},set compactTrigger(d=!1){o(d),_e()},$set:Do,$on:(d,u)=>Ro(t,d,u)},c=Ko(),h=ui(c);return fa(h,()=>KC,(d,u)=>{u(d,{children:(f,g)=>{var p=d3(),m=ui(p);{let x=Dt(()=>je.diagram_actions_menu_ariaLabel()),b=Dt(()=>o()?"size-(--control-height-compact) p-0":void 0);fa(m,()=>UC,(S,T)=>{T(S,{get"aria-label"(){return A(x)},get class(){return A(b)},children:(k,_)=>{VC(k,{class:"size-3.5"})},$$slots:{default:!0}})})}var y=We(m,2);fa(y,()=>ZC,(x,b)=>{b(x,{align:"end",children:(S,T)=>{var k=h3(),_=ui(k);fa(_,()=>Cc,(M,B)=>{B(M,{onSelect:()=>void a(),children:(E,O)=>{en();var $=rl();cr(I=>br($,I),[()=>je.diagram_actions_copyImage_label()]),ge(E,$)},$$slots:{default:!0}})});var L=We(_,2);fa(L,()=>Cc,(M,B)=>{B(M,{onSelect:()=>void s(),children:(E,O)=>{en();var $=rl();cr(I=>br($,I),[()=>je.diagram_actions_copySvg_label()]),ge(E,$)},$$slots:{default:!0}})});var v=We(L,2);fa(v,()=>Cc,(M,B)=>{B(M,{onSelect:()=>void n(),children:(E,O)=>{en();var $=rl();cr(I=>br($,I),[()=>je.diagram_actions_downloadSvg_label()]),ge(E,$)},$$slots:{default:!0}})}),ge(S,k)},$$slots:{default:!0}})}),ge(f,p)},$$slots:{default:!0}})}),ge(e,c),qo(l)}const u3="Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",dp="Inter";function gc(e,t,r){const i=e.getPropertyValue(t).trim();if(!i&&r)return gc(e,r);if(!i)throw new Error(`Missing Mermaid design token: ${t}`);return i}function eo(e,t,r){const i=gc(e,t,r);if(i.startsWith("color-mix(")&&typeof document<"u"){const o=document.createElement("canvas");o.width=1,o.height=1;const a=o.getContext("2d");if(a){a.fillStyle=i,a.fillRect(0,0,1,1);const[s,n,l,c]=a.getImageData(0,0,1,1).data;return c===255?`rgb(${s}, ${n}, ${l})`:`rgba(${s}, ${n}, ${l}, ${c/255})`}}return/^(#|rgb|hsl|oklch|color(?:-mix)?\()/.test(i)?i:`hsl(${i})`}function f3(e,t,r){const i=gc(e,t,r);if(!i.endsWith("rem"))return i;const o=Number.parseFloat(e.fontSize);if(!Number.isFinite(o))throw new Error("Missing root font size for Mermaid");return`${Number.parseFloat(i)*o}px`}function g3(e,t=!0){const r=eo(e,"--foreground"),i=eo(e,"--card-foreground"),o=eo(e,"--muted"),a=eo(e,"--border"),s=eo(e,"--accent"),n=eo(e,"--accent-foreground"),l=eo(e,"--diagram-canvas","--background"),c=eo(e,"--diagram-node-surface","--card"),h=eo(e,"--diagram-connector","--muted-foreground"),d=eo(e,"--muted-foreground"),u=e.getPropertyValue("--font-ui").trim()||u3,f=f3(e,"--text-caption-size");return gc(e,"--radius-small"),{startOnLoad:!1,theme:"base",look:"classic",elk:{preset:"legacy",lineHops:!1,straightenEdges:!1,orientFeedbackEdges:!1},securityLevel:"loose",fontFamily:u,fontSize:Number.parseFloat(f),htmlLabels:t,themeCSS:[".label, foreignObject { transition-property: opacity, color, background-color !important; }",`.edgeLabel { font-family: ${u}; font-size: ${f}; font-weight: 500; line-height: 1.5; letter-spacing: normal; }`,".edgeLabel p { margin: 0; }",`.cluster-label text { fill: ${d}; }`,`.cluster-label span { color: ${d}; }`].join(`
314
314
  `),flowchart:{useMaxWidth:!1,curve:"stepAfter",diagramPadding:8,nodeSpacing:32,rankSpacing:40,wrappingWidth:200,minNodeWidth:0},sequence:{useMaxWidth:!1,wrap:!0,mirrorActors:!1,actorMargin:40,boxMargin:8,boxTextMargin:6,noteMargin:8,messageMargin:24,width:140,wrapPadding:6},class:{htmlLabels:!1},state:{minNodeWidth:0,wrappingWidth:200,nodeSpacing:48,rankSpacing:48,padding:8},themeVariables:{background:l,primaryColor:c,primaryTextColor:r,primaryBorderColor:c,secondaryColor:o,secondaryTextColor:r,secondaryBorderColor:o,tertiaryColor:l,tertiaryTextColor:r,tertiaryBorderColor:a,lineColor:h,arrowheadColor:h,textColor:r,mainBkg:c,nodeBkg:c,nodeBorder:c,nodeTextColor:i,clusterBkg:l,clusterBorder:a,defaultLinkColor:h,edgeLabelBackground:l,titleColor:r,actorBkg:c,actorBorder:c,actorTextColor:i,actorLineColor:a,signalColor:h,signalTextColor:r,labelBoxBkgColor:o,labelBoxBorderColor:a,labelTextColor:r,loopTextColor:r,activationBkgColor:s,activationBorderColor:a,noteBkgColor:s,noteBorderColor:a,noteTextColor:n,transitionColor:h,transitionLabelColor:d,stateBkg:c,stateLabelColor:i,labelBackgroundColor:l,compositeBackground:l,compositeTitleBackground:l,compositeBorder:a,classText:i,fillType0:c,fillType1:o,fontFamily:u}}}let up=Promise.resolve();function p3(e,t=()=>!0){const r=async()=>{if(t()&&(await new Promise(o=>setTimeout(o,0)),!!t()))return e()},i=up.then(r,r);return up=i.then(()=>{},()=>{}),i}const m3=/[./\\:_-]/;function pc(e){const t=[];let r="";const i=(o,a=!1)=>{r&&t.push({text:r,breakAfter:o,hardBreak:a}),r=""};for(let o=0;o<e.length;o+=1){const a=e[o],s=e[o-1]??"";if(r&&/[A-Z]/.test(a)&&/[a-z0-9]/.test(s)&&i(!0),a===`
315
- `){i(!0,!0);continue}r+=a,(/\s/.test(a)||m3.test(a))&&i(!0)}return i(!1),t}function fp(e){return pc(e).map(t=>t.text.trim()).filter(Boolean)}function _u(e){if(/\s/.test(e)||!/\.[A-Za-z][A-Za-z0-9]*$/.test(e))return null;const t=e.split(".");return t.length<=2?e.length<=21?[e]:[t[0],`.${t[1]}`]:[`${t.slice(0,-2).join(".")}.`,t.slice(-2).join(".")]}function y3(e){const t=_u(e);return t||e.split(/\s+/).flatMap(r=>r.match(/[^./\\]+[./\\]?/g)??[]).filter(Boolean)}const x3=new Intl.Segmenter(void 0,{granularity:"grapheme"});function ad(e){return Array.from(x3.segment(e),({segment:t})=>t)}function gp(e,t,r,i=!1){const o=Math.max(1,t);let a=1,s="";for(const[n,l]of e.entries()){const c=l.replace(/[\t\r\f ]+/g," "),h=`${s}${c}`.trimStart();if(r(h.trimEnd())<=o){s=h;continue}s.trim()&&(a+=1),s="";for(const d of ad(c.trimStart()))s&&r(`${s}${d}`.trimEnd())>o&&(a+=1,s=""),s+=d;i&&r(c.trim())>o&&n<e.length-1&&(a+=1,s="")}return a}function b3(e){const t=new Map(e.map(({id:i,nodes:o})=>[i,[...o]])),r=new Map;for(const i of t.keys()){const o=new Set,a=s=>{if(!(s===i||o.has(s))){o.add(s);for(const n of t.get(s)??[])a(n)}};for(const s of t.get(i)??[])a(s);r.set(i,o)}return r}function Lu(e,t){return t.has(e.id)?e.id:[...t.keys()].filter(r=>e.id.endsWith(`-${r}`)).toSorted((r,i)=>i.length-r.length)[0]}function B1(e,t,r){const i=document.createElementNS("http://www.w3.org/2000/svg","rect");i.classList.add("edge-label-knockout"),i.setAttribute("x",String(r.x-6)),i.setAttribute("y",String(r.y-4)),i.setAttribute("width",String(r.width+12)),i.setAttribute("height",String(r.height+8)),i.setAttribute("rx","2"),i.dataset.labelPaddingX="6",i.dataset.labelPaddingY="4",e.insertBefore(i,t)}function pp(e){const t=[];for(const r of e.querySelectorAll("g.edgeLabel")){if(r.querySelector(".edge-label-knockout, rect.background, foreignObject"))continue;const i=r.querySelector("text");i&&t.push({parent:r,before:r.firstElementChild,bounds:i.getBBox()})}for(const r of e.querySelectorAll("text.messageText, text.loopText")){if(r.dataset.labelKnockout==="true"||!r.textContent?.trim())continue;const i=r.parentElement;i&&t.push({parent:i,before:r,bounds:r.getBBox(),text:r})}for(const{parent:r,before:i,bounds:o,text:a}of t)B1(r,i,o),a&&(a.dataset.labelKnockout="true")}function C3(e){const t=getComputedStyle(e),r=t.font||`${t.fontStyle} ${t.fontWeight} ${t.fontSize} ${t.fontFamily}`;return document.fonts?.load(r,e.textContent??"")}const mp="rect, circle, ellipse, polygon, path",yp=new WeakMap;function w3(){const e=new Map;let t;return r=>{if(e.has(r))return e.get(r);let i=r==="none"?ao(0,0,0,0):Kl(r)?.rgb()??null;if(!i&&typeof CSS<"u"&&CSS.supports("color",r)){if(t===void 0){const o=document.createElement("canvas");o.width=o.height=1,t=o.getContext("2d")}if(t){t.clearRect(0,0,1,1),t.fillStyle=r,t.fillRect(0,0,1,1);const[o,a,s,n]=t.getImageData(0,0,1,1).data;i=ao(o,a,s,n/255)}}return i=i?.clamp()??null,e.set(r,i),i}}function Un(e,t){const r=e.opacity+t.opacity*(1-e.opacity);if(!r)return ao(0,0,0,0);const i=(o,a)=>(o*e.opacity+a*t.opacity*(1-e.opacity))/r;return ao(i(e.r,t.r),i(e.g,t.g),i(e.b,t.b),r)}function Vn(e){return e?e.endsWith("%")?Number.parseFloat(e)/100:Number(e):1}function k3(e,t){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;for(const d of yp.get(e)??[])d();const r=[];yp.set(e,r);const i=w3();let o=ao(0,0,0,0);for(let d=e;d;d=d.parentElement){const u=getComputedStyle(d);if(u.backgroundImage&&u.backgroundImage!=="none")return;const f=i(u.backgroundColor);if(!f)return;if(o=Un(o,f),o.opacity===1)break}if(o.opacity!==1)return;const a=[...e.querySelectorAll("g.cluster")],s=new Map(a.map(d=>[d,t?Lu(d,t):d.id])),n=d=>{const u=s.get(d)??d.id.match(/flowchart-(.+?)-\d+$/)?.[1]??d.id,f=a.filter(g=>{const p=s.get(g);return g!==d&&p&&t?.get(p)?.has(u)});return f.length?f.sort((g,p)=>t.get(s.get(g)).size-t.get(s.get(p)).size)[0]:d.parentElement?.closest("g.cluster")??void 0},l=new Map,c=(d,u=new Set)=>{if(l.has(d))return l.get(d);if(u.has(d))return null;u.add(d);const f=n(d),g=f?c(f,u):o;if(!g)return null;const p=d.querySelector(":scope > .label-container"),m=p?.matches(mp)?p:p?.querySelector(mp)??d.querySelector(":scope > rect, :scope > circle, :scope > ellipse, :scope > polygon, :scope > path");if(!m)return null;const y=getComputedStyle(m),x=i(y.fill),b=x?Un(ao(x.r,x.g,x.b,x.opacity*Vn(y.fillOpacity)*Vn(y.opacity)),g):null;return l.set(d,b),b},h=[];for(const d of e.querySelectorAll("g.node, g.cluster")){const u=c(d);if(!u)continue;const f=d.querySelector(":scope > .label, :scope > .cluster-label");if(f)for(const g of f.querySelectorAll("text, tspan, foreignObject *")){if(g.closest("svg")!==e||![...g.childNodes].some(v=>v.nodeType===3&&v.textContent?.trim()))continue;let p=!1,m=u;const y=[];for(let v=g;v&&v!==e;v=v.parentElement){const M=getComputedStyle(v);(M.display==="none"||M.visibility==="hidden"||Vn(M.opacity)!==1)&&(p=!0),v.namespaceURI==="http://www.w3.org/1999/xhtml"&&y.unshift(v)}if(p)continue;for(const v of y){const M=getComputedStyle(v),B=i(M.backgroundColor);if(!B||M.backgroundImage&&M.backgroundImage!=="none"){p=!0;break}m=Un(B,m)}if(p)continue;const x=getComputedStyle(g),b=g.namespaceURI==="http://www.w3.org/1999/xhtml"?"color":"fill",S=i(x.getPropertyValue(b)),T=b==="fill"?Vn(x.fillOpacity):1;if(!S||!S.opacity||!T)continue;const k=v=>HC(Un(ao(v.r,v.g,v.b,v.opacity*T),m).formatHex(),m.formatHex()).ratio;if(k(S)>=4.5)continue;const L=[i(getComputedStyle(e).color),ao(0,0,0),ao(255,255,255)].filter(v=>v!==null).filter(v=>k(v)>=4.55)[0];L&&h.push({element:g,property:b,value:L.formatRgb()})}}for(const{element:d,property:u,value:f}of h){const g=d.style.getPropertyValue(u),p=d.style.getPropertyPriority(u);r.push(()=>{g?d.style.setProperty(u,g,p):d.style.removeProperty(u)}),d.style.setProperty(u,f,"important")}}function S3(e,t,r,i){if(!/^(TB|TD)$/.test(i)||r.size<2||r.size>8||e.size>16||t.length>24||t.some(u=>!e.has(u.source)||!e.has(u.target)))return[];const o=new Map;for(const[u,f]of r){if(!f.members.length)return[];for(const g of f.members){if(!e.has(g)||o.has(g))return[];o.set(g,u)}}if(o.size!==e.size)return[];const a=(u,f)=>{const g=new Map,p=new Set(u);for(let m=0;p.size;m++){const y=[...p].filter(x=>f.every(b=>b.target!==x||!p.has(b.source)));if(!y.length)return;for(const x of y)g.set(x,m),p.delete(x)}return g},s=t.flatMap(u=>{const f=o.get(u.source),g=o.get(u.target);return f&&g&&f!==g?[{source:f,target:g}]:[]}),n=a([...r.keys()],s);if(!n)return[];const l={x:Math.min(...[...r.values()].map(u=>u.box.x)),y:Math.min(...[...r.values()].map(u=>u.box.y))},c=[],h=[...r.keys()].filter(u=>!s.some(f=>f.target===u)),d=a([...e.keys()],t);if(r.size===3&&h.length===1&&s.every(u=>u.source===h[0])&&d){const u=h[0],f=[...r.keys()].filter(p=>p!==u),g=new Map;for(const p of[...e.keys()].toSorted((m,y)=>Ce(d,y)-Ce(d,m)))g.set(p,Math.max(0,...t.filter(m=>m.source===p).map(m=>Ce(g,m.target)+1)));for(const p of[!1,!0])for(const m of[!1,!0]){const y=new Map;Ce(r,u).members.toSorted((v,M)=>Ce(g,M)-Ce(g,v)||(p?-1:1)*(Ce(e,v).x-Ce(e,M).x)).forEach((v,M)=>y.set(v,M));const x=new Map([...r.keys()].map(v=>[v,new Set]));for(const[v,M]of y)Ce(x,Ce(o,v)).add(M);for(const v of[...e.keys()].filter(M=>!y.has(M)).toSorted((M,B)=>Ce(g,B)-Ce(g,M)||Ce(e,M).y-Ce(e,B).y)){const M=t.filter(O=>O.target===v);let B=Math.max(1,...M.map(O=>Ce(y,O.source)+1));const E=Ce(x,Ce(o,v));for(;E.has(B);)B++;y.set(v,B),E.add(B)}const b=new Map;let S=l.y+Math.max(...[...r.values()].map(v=>v.headerHeight))+48;for(let v=0;v<=Math.max(...y.values());v++){const M=Math.max(0,...[...e].filter(([B])=>y.get(B)===v).map(([,B])=>B.height));b.set(v,S+M/2),S+=M+32}const T=m?[...f].reverse():f,k=new Map,_=new Map;let L=l.x;for(const v of[T[0],u,T[1]]){const M=Ce(r,v),B=Math.max(M.headerWidth+48,...M.members.map($=>Ce(e,$).width+64));for(const $ of M.members){const I=Ce(e,$);k.set($,{...I,x:L+(B-I.width)/2,y:Ce(b,Ce(y,$))-I.height/2})}const E=Math.min(...M.members.map($=>Ce(k,$).y))-Math.max(24,M.headerHeight)-28,O=Math.max(...M.members.map($=>{const I=Ce(k,$);return I.y+I.height}))+32;_.set(v,{x:L,y:E,width:B,height:O-E}),L+=B+48}c.push({nodes:k,groups:_})}}for(const u of[!1,!0])for(const f of[!1,!0])for(const g of[0,.5,1]){const p=new Map;for(const[_,L]of r){const v=a(L.members,t.filter(O=>o.get(O.source)===_&&o.get(O.target)===_));if(!v)return[];const M=new Map;let B=Math.max(24,L.headerHeight)+28,E=L.headerWidth+128;for(let O=0;O<=Math.max(...v.values());O++){const $=L.members.filter(R=>v.get(R)===O).toSorted((R,q)=>Ce(e,R).x-Ce(e,q).x);f&&$.reverse();let I=32;const F=Math.max(...$.map(R=>Ce(e,R).height));for(const R of $){const q=Ce(e,R);M.set(R,{...q,x:I,y:B+(F-q.height)/2}),I+=q.width+32}E=Math.max(E,I),B+=F+48}for(let O=0;O<=Math.max(...v.values());O++){const $=[...M].filter(([R])=>v.get(R)===O),I=Math.max(...$.map(([,R])=>R.x+R.width)),F=(E-32-I)*($.length===1?O%2:.5);for(const[,R]of $)R.x+=F}p.set(_,{box:{x:0,y:0,width:E,height:B-16},nodes:M})}const m=new Map,y=new Map,x=Math.max(...n.values()),b=Array.from({length:x+1},(_,L)=>{const v=[...r.keys()].filter(M=>n.get(M)===L).toSorted((M,B)=>Ce(r,M).box.x-Ce(r,B).box.x);return u?v.reverse():v}),S=Math.max(...b.map(_=>_.reduce((L,v)=>L+Ce(p,v).box.width,0)+(_.length-1)*48));let T=l.y;for(const _ of b){const L=_.reduce((M,B)=>M+Ce(p,B).box.width,0)+(_.length-1)*48;let v=l.x+(S-L)*g;for(const M of _){const B=Ce(p,M),E={...B.box,x:v,y:T};m.set(M,E);for(const[O,$]of B.nodes)y.set(O,{...$,x:v+$.x,y:T+$.y});v+=E.width+48}T+=Math.max(..._.map(M=>Ce(p,M).box.height))+64}const k=[...y.values()];k.some((_,L)=>k.slice(L+1).some(v=>_.x<v.x+v.width+16&&_.x+_.width+16>v.x&&_.y<v.y+v.height+16&&_.y+_.height+16>v.y))||c.push({nodes:y,groups:m})}return c}function Ce(e,t){const r=e.get(t);if(r===void 0)throw new Error("Compact flowchart references an unknown node");return r}function v3(e,t,r="TB"){if(e.size>48||t.some(m=>!e.has(m.source)||!e.has(m.target)))return[];const i=/^(LR|RL)$/.test(r),o=/^(RL|BT)$/.test(r)?-1:1,a=64,s=new Map([...e].map(([m,y])=>[m,{u:o*(i?y.x+y.width/2:y.y+y.height/2),v:i?y.y+y.height/2:y.x+y.width/2,width:i?y.width:y.height,height:i?y.height:y.width}])),n=m=>t.filter(y=>y.target===m),l=m=>t.filter(y=>y.source===m),c=(m,y=!1,x=new Set)=>{const b=new Set,S=[m];for(let T;(T=S.pop())!==void 0;)b.has(T)||x.has(T)||(b.add(T),S.push(...(y?n(T):l(T)).map(k=>y?k.source:k.target)));return b},h=new Map([...e.keys()].map(m=>[m,c(m)])),d=new Set,u=[...e.keys()].flatMap(m=>{if(d.has(m))return[];const y=[...e.keys()].filter(x=>h.get(m)?.has(x)&&h.get(x)?.has(m));return y.forEach(x=>d.add(x)),y.length>=3&&y.length<=8?[y]:[]}),f=[],g=m=>{const y=new Map([...m].map(([b,S])=>{const T=Ce(e,b);return[b,{...T,x:(i?o*S.u:S.v)-T.width/2,y:(i?S.v:o*S.u)-T.height/2}]})),x=[...y.values()];return x.some((b,S)=>x.slice(S+1).some(T=>b.x<T.x+T.width+16&&b.x+b.width+16>T.x&&b.y<T.y+T.height+16&&b.y+b.height+16>T.y))?void 0:y},p=[...e.keys()];for(let m=0;m<p.length&&f.length<8;m++)for(let y=m+1;y<p.length&&f.length<8;y++){const x=[p[m],p[y]],b=[...new Set(l(x[0]).map(F=>F.target))].filter(F=>!x.includes(F)&&l(x[1]).some(R=>R.target===F));if(b.length!==2)continue;const S=[...new Set(n(x[0]).map(F=>F.source))].filter(F=>!x.includes(F)&&!b.includes(F)&&n(x[1]).some(R=>R.source===F)),T=[...new Set(l(b[0]).map(F=>F.target))].filter(F=>!x.includes(F)&&!b.includes(F)&&l(b[1]).some(R=>R.target===F));if(S.length!==1||T.length!==1||new Set([...x,...b,...S,...T]).size!==6)continue;const k=new Map([...s].map(([F,R])=>[F,{...R}])),_=Ce(k,S[0]),L=x.toSorted((F,R)=>Ce(k,F).v-Ce(k,R).v),v=b.toSorted((F,R)=>l(F).filter(q=>x.includes(q.target)).length-l(R).filter(q=>x.includes(q.target)).length),M=Ce(k,v[0]),B=Ce(k,v[1]),E=Ce(k,T[0]),O=Math.max(Math.min(...x.map(F=>Ce(k,F).u)),_.u+_.width/2+a+Math.max(...x.map(F=>Ce(k,F).width/2))),$=Math.max(...x.map(F=>Ce(k,F).height/2))+M.height/2+a;L.forEach((F,R)=>Object.assign(Ce(k,F),{u:O,v:_.v+(R?1:-1)*$})),Object.assign(M,{u:O,v:_.v}),Object.assign(E,{u:O+M.width/2+a+E.width/2,v:_.v}),Object.assign(B,{u:E.u+E.width/2+a+B.width/2,v:_.v});const I=g(k);I&&f.push(I)}for(const m of u){const y=new Set(m),x=t.filter(M=>!y.has(M.source)&&y.has(M.target)),b=t.filter(M=>y.has(M.source)&&!y.has(M.target)),S=x.toSorted((M,B)=>c(B.source,!0,y).size-c(M.source,!0,y).size)[0],T=b.toSorted((M,B)=>c(B.target,!1,y).size/n(B.target).length-c(M.target,!1,y).size/n(M.target).length)[0];if(!S||!T)continue;const k=[S.target],_=new Map([[S.target,void 0]]);for(let M=0;M<k.length&&!_.has(T.source);M++){const B=k[M];for(const E of l(B))!y.has(E.target)||_.has(E.target)||(_.set(E.target,B),k.push(E.target))}if(!_.has(T.source))continue;const L=[];for(let M=T.source;M!==void 0;M=_.get(M))L.unshift(M);const v=m.filter(M=>!L.includes(M)).toSorted((M,B)=>{const E=O=>new Set(t.flatMap($=>$.source===O&&y.has($.target)?[$.target]:$.target===O&&y.has($.source)?[$.source]:[])).size;return E(B)-E(M)});for(const M of[-1,1]){const B=new Map([...s].map(([D,P])=>[D,{...P}])),E=Ce(B,S.source),O=Ce(B,L[0]);O.u=Math.max(O.u,E.u+E.width/2+a+O.width/2);const $=E.v;O.v=$;for(let D=1;D<L.length;D++){const P=Ce(B,L[D-1]),Y=Ce(B,L[D]);Y.u=P.u+P.width/2+a+Y.width/2,Y.v=$}const I=Math.max(...L.map(D=>Ce(B,D).height/2)),F=Math.max(0,...v.map(D=>Ce(B,D).height));for(const[D,P]of v.entries()){const Y=new Set(t.flatMap(U=>U.source===P?[U.target]:U.target===P?[U.source]:[]).filter(U=>L.includes(U))),X=Ce(B,P);X.u=Y.size?[...Y].reduce((U,j)=>U+Ce(B,j).u,0)/Y.size:O.u;const z=Math.max(0,...t.flatMap(U=>(U.source===P||U.target===P)&&U.labelBox?[i?U.labelBox.height:U.labelBox.width]:[]));X.v=$+M*(D%2===0?1:-1)*(I+a+z+X.height/2+Math.floor(D/2)*(F+a))}for(const D of x){if(n(D.source).length||l(D.source).length!==1)continue;const P=Ce(B,D.target),Y=Ce(B,D.source);Y.u=P.u,Y.v=P.v+(Math.sign(P.v-$)||M)*(P.height/2+a+Y.height/2)}const R=new Set(m);for(const D of b){let P=D.source,Y=D.target;for(;!R.has(Y)&&n(Y).length===1&&l(Y).length<=1;){const X=Ce(B,P),z=Ce(B,Y);z.u=X.u+X.width/2+a+z.width/2,z.v=X.v,R.add(Y);const U=l(Y)[0];if(!U)break;P=Y,Y=U.target}}let q=[B];for(const[D,P]of B){const Y=n(D);if(y.has(D)||l(D).length||Y.length<2||Y.length>4)continue;const X=[];for(const z of q){const U=Y.map(rt=>Ce(z,rt.source)),j=U.reduce((rt,ht)=>rt+ht.u,0)/U.length,V=Math.min(...U.map(rt=>rt.v-rt.height/2))-a-P.height/2,Q=Math.max(...U.map(rt=>rt.v+rt.height/2))+a+P.height/2;for(const rt of[V,Q,...U.map(ht=>ht.v),U.reduce((ht,H)=>ht+H.v,0)/U.length])for(const ht of[j,j-P.width/2,j+P.width/2,j-P.width,j+P.width,...U.map(H=>H.u)]){const H={...P,u:ht,v:rt};if([...z].some(([tt,ot])=>tt!==D&&Math.abs(ot.u-H.u)<(ot.width+H.width)/2+a/2&&Math.abs(ot.v-H.v)<(ot.height+H.height)/2+a/2))continue;const G=new Map(z);G.set(D,H);const K=U.reduce((tt,ot)=>tt+Math.hypot(ot.u-H.u,ot.v-H.v),0);X.push({positions:G,cost:K})}}X.length&&(q=X.toSorted((z,U)=>z.cost-U.cost).slice(0,3).map(z=>z.positions))}for(const D of q){const P=new Map([...D].map(([X,z])=>{const U=Ce(e,X),j=i?o*z.u:z.v,V=i?z.v:o*z.u;return[X,{...U,x:j-U.width/2,y:V-U.height/2}]})),Y=[...P.values()];Y.some((X,z)=>Y.slice(z+1).some(U=>X.x<U.x+U.width+16&&X.x+X.width+16>U.x&&X.y<U.y+U.height+16&&X.y+X.height+16>U.y))||f.push(P)}}}return f}const Ua=(e,t,r)=>(t.x-e.x)*(r.y-e.y)-(t.y-e.y)*(r.x-e.x);function M3(e,t,r){const i=e instanceof SVGGeometryElement?[e]:[...e.querySelectorAll("path,polygon,polyline,circle,ellipse,rect")],o=i.flatMap(h=>{const d=h.getScreenCTM();if(!d)return[];const u=h.getTotalLength(),f=Math.max(16,Math.min(256,Math.ceil(u/24)*4));return(h instanceof SVGPolygonElement||h instanceof SVGPolylineElement?Array.from({length:h.points.numberOfItems},(p,m)=>h.points.getItem(m)):Array.from({length:f},(p,m)=>h.getPointAtLength(u*m/f))).map(p=>{const m=new DOMPoint(p.x,p.y).matrixTransform(d).matrixTransform(r);return{x:m.x-t.x,y:m.y-t.y}})}).toSorted((h,d)=>h.x-d.x||h.y-d.y).filter((h,d,u)=>!d||Math.hypot(h.x-u[d-1].x,h.y-u[d-1].y)>.001);if(o.length<3)return[{x:0,y:0},{x:t.width,y:0},{x:t.width,y:t.height},{x:0,y:t.height}];const a=h=>{const d=[];for(const u of h){for(;d.length>1&&Ua(d[d.length-2],d[d.length-1],u)<=0;)d.pop();d.push(u)}return d.slice(0,-1)},s=[...a(o),...a([...o].reverse())],n=i.flatMap(h=>{const d=h.getScreenCTM();return d?[{geometry:h,inverse:d.inverse().multiply(r.inverse())}]:[]}),l=h=>n.some(({geometry:d,inverse:u})=>d.isPointInFill(new DOMPoint(t.x+h.x,t.y+h.y).matrixTransform(u))),c={x:t.width/2,y:t.height/2};return s.some((h,d)=>{const u=s[(d+1)%s.length];return[.25,.5,.75].some(f=>{const g={x:h.x+(u.x-h.x)*f,y:h.y+(u.y-h.y)*f},p=Math.hypot(c.x-g.x,c.y-g.y)||1;return!l({x:g.x+(c.x-g.x)/p*.1,y:g.y+(c.y-g.y)/p*.1})})})?[]:s}function Zn(e,t,r){const i={x:e.width/2,y:e.height/2},o={x:r.x-e.x-i.x,y:r.y-e.y-i.y};let a=-1/0,s={x:0,y:0};for(let c=0;c<t.length;c++){const h=t[c],d=t[(c+1)%t.length],u={x:d.x-h.x,y:d.y-h.y},f=o.x*u.y-o.y*u.x;if(Math.abs(f)<1e-6)continue;const g={x:h.x-i.x,y:h.y-i.y},p=(g.x*u.y-g.y*u.x)/f,m=(g.x*o.y-g.y*o.x)/f;if(p<0||m<-1e-5||m>1.00001||p<a-1e-5)continue;const y=Math.hypot(u.x,u.y),x={x:u.y/y,y:-u.x/y};Math.abs(p-a)<1e-5?(s.x+=x.x,s.y+=x.y):(a=p,s=x)}if(!Number.isFinite(a)||Math.hypot(s.x,s.y)<.001){const c=Math.hypot(o.x,o.y)||1;return[r,{x:r.x+o.x/c*32,y:r.y+o.y/c*32}]}const n=Math.hypot(s.x,s.y),l={x:e.x+i.x+o.x*a+s.x/n*.05,y:e.y+i.y+o.y*a+s.y/n*.05};return[l,{x:l.x+s.x/n*32,y:l.y+s.y/n*32}]}function Ys(e,t,r){const i=r.x-t.x,o=r.y-t.y,a=Math.max(0,Math.min(1,((e.x-t.x)*i+(e.y-t.y)*o)/(i*i+o*o||1)));return Math.hypot(e.x-t.x-a*i,e.y-t.y-a*o)}function T3(e,t,r,i){const o=e.map(s=>({x:s.x-t.x,y:s.y-t.y})),a=s=>r.every((n,l)=>Ua(n,r[(l+1)%r.length],s)>=0);for(let s=1;s<o.length;s++){const n=o[s-1],l=o[s];if(!(Math.max(n.x,l.x)<-Math.max(0,i)||Math.min(n.x,l.x)>t.width+Math.max(0,i)||Math.max(n.y,l.y)<-Math.max(0,i)||Math.min(n.y,l.y)>t.height+Math.max(0,i))){for(const c of[n,l])if(a(c)&&r.every((h,d)=>Ys(c,h,r[(d+1)%r.length])>-i))return!0;for(let c=0;c<r.length;c++){const h=r[c],d=r[(c+1)%r.length];if(Ua(n,l,h)*Ua(n,l,d)<-1e-6&&Ua(h,d,n)*Ua(h,d,l)<-1e-6||i>0&&Math.min(Ys(n,h,d),Ys(l,h,d),Ys(h,n,l),Ys(d,n,l))<i)return!0}}}return!1}const Xe=16,mr=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),er=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y),Gr=e=>e[e.length-1],Li=e=>e.points.slice(1).reduce((t,r,i)=>t+er(e.points[i],r),0);function xp(e){const t=mr(e);return[[{x:t.x,y:e.y},{x:t.x,y:e.y-Xe*2}],[{x:e.x+e.width,y:t.y},{x:e.x+e.width+Xe*2,y:t.y}],[{x:t.x,y:e.y+e.height},{x:t.x,y:e.y+e.height+Xe*2}],[{x:e.x,y:t.y},{x:e.x-Xe*2,y:t.y}]]}const _1=(e,t,r=0)=>e.x>t.x-r&&e.x<t.x+t.width+r&&e.y>t.y-r&&e.y<t.y+t.height+r,jo=(e,t,r=0)=>e.x<t.x+t.width+r&&e.x+e.width+r>t.x&&e.y<t.y+t.height+r&&e.y+e.height+r>t.y,gh=(e,t,r=0)=>t.x>=e.x+r&&t.y>=e.y+r&&t.x+t.width<=e.x+e.width-r&&t.y+t.height<=e.y+e.height-r;function L1(e,t,r,i,o=[]){if(Math.max(e.x,t.x)<Math.min(r.x,i.x)||Math.max(r.x,i.x)<Math.min(e.x,t.x)||Math.max(e.y,t.y)<Math.min(r.y,i.y)||Math.max(r.y,i.y)<Math.min(e.y,t.y))return!1;const a=(f,g)=>f.x*g.y-f.y*g.x,s={x:t.x-e.x,y:t.y-e.y},n={x:i.x-r.x,y:i.y-r.y},l=a(s,n),c={x:r.x-e.x,y:r.y-e.y};if(Math.abs(l)<1e-4){const f=s.x**2+s.y**2;if(f<1e-6||Math.abs(a(c,s))>1e-4*Math.sqrt(f))return!1;const g=x=>((x.x-e.x)*s.x+(x.y-e.y)*s.y)/f,p=Math.max(0,Math.min(g(r),g(i))),m=Math.min(1,Math.max(g(r),g(i)));if(m<p-1e-6)return!1;if((m-p)*Math.sqrt(f)>.05)return!0;const y={x:e.x+s.x*p,y:e.y+s.y*p};return!o.some(x=>er(y,x)<.05)}const h=a(c,n)/l,d=a(c,s)/l;if(h<-1e-6||h>1.000001||d<-1e-6||d>1.000001)return!1;const u={x:e.x+s.x*h,y:e.y+s.y*h};return!o.some(f=>er(u,f)<.05)}function qi(e,t){const r=[e[0],Gr(e)].filter(i=>[t[0],Gr(t)].some(o=>er(i,o)<.05));for(let i=1;i<e.length;i++)for(let o=1;o<t.length;o++)if(L1(e[i-1],e[i],t[o-1],t[o],r))return!0;return!1}function So(e,t,r=0){const i=[{x:t.x-r,y:t.y-r},{x:t.x+t.width+r,y:t.y-r},{x:t.x+t.width+r,y:t.y+t.height+r},{x:t.x-r,y:t.y+t.height+r}];return e.some(o=>_1(o,t,r))||e.slice(1).some((o,a)=>i.some((s,n)=>L1(e[a],o,s,i[(n+1)%4])))}function ph(e){const t=e[0],r=[t];let i=`M${t.x},${t.y}`;const o=(s,n,l,c,h,d,u)=>({x:(s.x*c+n.x*h+l.x*d)/u,y:(s.y*c+n.y*h+l.y*d)/u}),a=s=>{i+=`L${s.x},${s.y}`,r.push(s)};if(e.length<3)return a(Gr(e)),{d:i,points:r};a(o(t,e[1],t,5,1,0,6));for(let s=2;s<=e.length;s++){const n=e[s-2],l=e[s-1],c=e[Math.min(s,e.length-1)],h=Gr(r),d=o(n,l,c,2,1,0,3),u=o(n,l,c,1,2,0,3),f=o(n,l,c,1,4,1,6);i+=`C${d.x},${d.y} ${u.x},${u.y} ${f.x},${f.y}`;const g=Math.max(1,Math.min(16,Math.ceil(er(h,f)/12)));for(let p=1;p<=g;p++){const m=p/g,y=1-m;r.push({x:y**3*h.x+3*y**2*m*d.x+3*y*m**2*u.x+m**3*f.x,y:y**3*h.y+3*y**2*m*d.y+3*y*m**2*u.y+m**3*f.y})}}return a(Gr(e)),{d:i,points:r}}function Kn(e,t,r,i){const o=Math.max(12,Math.min(256,Math.ceil((er(e,t)+er(t,r)+er(r,i))/5)));return{d:`M${e.x},${e.y}C${t.x},${t.y} ${r.x},${r.y} ${i.x},${i.y}`,points:Array.from({length:o+1},(a,s)=>{const n=s/o,l=1-n;return{x:l**3*e.x+3*l**2*n*t.x+3*l*n**2*r.x+n**3*i.x,y:l**3*e.y+3*l**2*n*t.y+3*l*n**2*r.y+n**3*i.y}})}}function mh(e){let t=0;for(let r=1;r<e.points.length-1;r++){const i=e.points[r-1],o=e.points[r],a=e.points[r+1],s=er(i,o)*er(o,a)*er(a,i);s<.001||(t=Math.max(t,2*Math.abs((o.x-i.x)*(a.y-i.y)-(o.y-i.y)*(a.x-i.x))/s))}return t}function Xs(e){let t=0;for(let r=1;r<e.points.length-1;r++){const i=e.points[r-1],o=e.points[r],a=e.points[r+1],s=o.x-i.x,n=o.y-i.y,l=a.x-o.x,c=a.y-o.y;t+=Math.abs(Math.atan2(s*c-n*l,s*l+n*c))}return t}function B3(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const t=!!e.querySelector("g.cluster"),r=new Set,i=[...e.querySelectorAll("path.flowchart-link")];if(!i.some(k=>k.getAttribute("d")?.includes("C")))return;const o=i[0]?.getScreenCTM();if(!o||i.length>64)return;const a=o.inverse(),s=k=>{const _=k.getBoundingClientRect(),L=new DOMPoint(_.left,_.top).matrixTransform(a),v=new DOMPoint(_.right,_.bottom).matrixTransform(a);return{x:L.x,y:L.y,width:v.x-L.x,height:v.y-L.y}};let n=[...e.querySelectorAll("g.cluster > .cluster-label")].filter(k=>k.textContent?.trim()).map(s),l=[...e.querySelectorAll("g.cluster > rect")].map(s);const c=new Map([...e.querySelectorAll("g.node")].flatMap(k=>{const _=k.id.match(/flowchart-(.+)-\d+$/)?.[1],L=k.querySelector(":scope > .label-container");return _&&L?[[_,{box:s(L),rect:L.tagName.toLowerCase()==="rect",element:k,outline:M3(L,s(L),a)}]]:[]})),h=(k,_,L=!1)=>{const v=c.get(k);return xp(_).flatMap((B,E)=>{const O=E===0||E===2;return!L||(O?_.width:_.height)<Xe*5?[B]:[B,...[-Xe,Xe].map($=>B.map(I=>({x:I.x+(O?$:0),y:I.y+(O?0:$)})))]}).map(B=>v&&!v.rect?Zn(_,v.outline,B[0]):B)},d=[...e.querySelectorAll(".edgeLabels > .edgeLabel")].filter(k=>k.textContent?.trim()),u=i.flatMap(k=>{const _=k.id.match(/(?:^|-)L_(.*)_\d+$/)?.[1],L=_?[...c.keys()].flatMap(Y=>{const X=_.slice(Y.length+1);return _.startsWith(`${Y}_`)&&c.has(X)?[{source:Y,target:X}]:[]}):[],v=L.length===1?L[0]:void 0,M=[...k.classList].find(Y=>Y.startsWith("LS_"))?.slice(3)??v?.source,B=[...k.classList].find(Y=>Y.startsWith("LE_"))?.slice(3)??v?.target,E=k.getScreenCTM(),O=k.getAttribute("d"),$=M&&c.get(M),I=B&&c.get(B);if(!M||!B||!$||!I||!E||!O)return[];if(Math.abs(E.e-o.e)+Math.abs(E.f-o.f)>.01)return[];const F=k.getTotalLength(),R=Math.max(2,Math.min(256,Math.ceil(F/6))),q=Array.from({length:R+1},(Y,X)=>{const z=k.getPointAtLength(F*X/R);return{x:z.x,y:z.y}}),D=e.id&&k.id.startsWith(`${e.id}-`)?k.id.slice(e.id.length+1):k.id,P=d.find(Y=>Y.querySelector(":scope > .label[data-id]")?.getAttribute("data-id")===D);return[{path:k,source:M,target:B,sourceBox:$.box,targetBox:I.box,d:O,points:q,label:P,labelBox:P&&s(P)}]}),f=k=>{const _=c.get(k.source),L=c.get(k.target);if(!_?.outline.length||!L?.outline.length)return[];const v=mr(k.sourceBox),M=mr(k.targetBox),B=er(v,M);if(B<1)return[];const E={x:(M.x-v.x)/B,y:(M.y-v.y)/B},O={x:-E.y,y:E.x};return[0,-Xe,Xe,-Xe*2,Xe*2].flatMap($=>{const I=(q,D)=>{const P=mr(q),Y=Math.max(q.width,q.height);return{x:P.x+E.x*Y*D+O.x*$,y:P.y+E.y*Y*D+O.y*$}},[F]=Zn(k.sourceBox,_.outline,I(k.sourceBox,1)),[R]=Zn(k.targetBox,L.outline,I(k.targetBox,-1));return[0,-Xe,Xe,-Xe*2,Xe*2,-Xe*3,Xe*3].map(q=>Kn(F,{x:F.x+(R.x-F.x)/3+O.x*q,y:F.y+(R.y-F.y)/3+O.y*q},{x:R.x-(R.x-F.x)/3+O.x*q,y:R.y-(R.y-F.y)/3+O.y*q},R))})},g=(k,_,L=8)=>!n.some(v=>So(_.points,v,L))&&![...c].some(([v,M])=>{const B=v===k.source||v===k.target?-.1:L,E=_.points.slice(1,-1);return M.rect||M.outline.length<3?So(E,M.box,B):T3(E,M.box,M.outline,B)}),p=()=>u.reduce((k,_,L)=>k+u.slice(L+1).filter(v=>qi(_.points,v.points)).length,0),m=(k,_,L=l)=>{const v=L.filter(B=>gh(B,k.sourceBox,-.1)&&gh(B,k.targetBox,-.1)),M={..._};for(const B of v)M.x=Math.max(B.x+6,Math.min(M.x,B.x+B.width-_.width-6)),M.y=Math.max(B.y+6,Math.min(M.y,B.y+B.height-_.height-6));return _1(mr(_),M)&&er(mr(M),mr(_))<=Xe*2&&v.every(B=>gh(B,M,6))?M:void 0},y=(k,_,L=!0)=>{if(!k.labelBox)return;const v=k.labelBox;return[...L?[]:[mr(v)],..._.points.filter((B,E)=>E%3===0)].flatMap(B=>{const E=m(k,{...v,x:B.x-v.width/2,y:B.y-v.height/2});return E?[E]:[]}).filter(B=>![...c.values()].some(E=>jo(B,E.box,6))&&!n.some(E=>jo(B,E,6))&&!u.some(E=>E!==k&&(E.labelBox&&jo(B,E.labelBox,6)||So(E.points,B,6)))).toSorted((B,E)=>er(mr(B),mr(v))-er(mr(E),mr(v)))[0]},x=(k,_)=>u.filter(L=>L!==k&&((t?k.target===L.target&&er(Gr(_.points),Gr(L.points))<Xe/2:qi(_.points,L.points))||L.labelBox&&So(_.points,L.labelBox,6))).length+Number(t&&!g(k,_)),b=(k,_,L)=>{if(t&&r.add(k),k.d=_.d,k.points=_.points,k.path.setAttribute("d",_.d),delete k.path.dataset.terminalGapBasePath,delete k.path.dataset.terminalDirection,delete k.path.dataset.terminalTarget,!L||!k.label)return;const v=k.label.parentElement?.getScreenCTM();if(!v)return;const M=new DOMPoint(mr(L).x,mr(L).y).matrixTransform(o).matrixTransform(v.inverse()),B=k.label.getBBox();k.label.setAttribute("transform",`translate(${M.x-B.x-B.width/2},${M.y-B.y-B.height/2})`),k.labelBox=L};if(u.length===i.length&&u.every(k=>k.d.includes("C"))&&[...c.values()].every(k=>k.outline.length>=3)){const k=new Map(c),_=u.map(R=>({route:R,d:R.d,points:R.points,sourceBox:R.sourceBox,targetBox:R.targetBox,labelBox:R.labelBox})),L=u.reduce((R,q)=>R+Li(q),0),v=u.some(R=>x(R,R)>0),M=n,B=new Map([...e.querySelectorAll("g.cluster")].flatMap(R=>{const q=R.querySelector(":scope > rect"),D=R.querySelector(":scope > .cluster-label");if(!q||!D)return[];const P=s(q),Y=s(D),X=[...c].filter(([,z])=>z.box.x>=P.x&&z.box.y>=P.y&&z.box.x+z.box.width<=P.x+P.width+.1&&z.box.y+z.box.height<=P.y+P.height+.1).map(([z])=>z);return[[R.id,{box:P,members:X,headerWidth:Y.width,headerHeight:Y.height,header:Y,shape:q,label:D}]]})),E=new Map([...c].map(([R,q])=>[R,q.box])),O=t?S3(E,u,B,e.dataset.flowchartDirection??""):v3(E,u,e.dataset.flowchartDirection).map(R=>({nodes:R})),$=R=>R.reduce((q,D,P)=>q+Li(D.curve)+Xs(D.curve)*Xe*2+R.slice(P+1).filter(Y=>qi(D.curve.points,Y.curve.points)).length*128,0),I=$(u.map(R=>({curve:R})));let F;for(const R of O)for(const q of t?[!1]:[!1,!0]){const D=R.nodes,P=R.groups?[...R.groups.values()]:l,Y=R.groups?new Map([...R.groups].flatMap(([j,V])=>{const Q=B.get(j);if(!Q)return[];const rt=[(V.width-Q.header.width)/2,20,V.width-Q.header.width-20].map(H=>({...Q.header,x:V.x+H,y:V.y+12})),ht=H=>u.filter(G=>{const K=D.get(G.source),tt=D.get(G.target);return K&&tt&&So([mr(K),mr(tt)],H,Xe)}).length;return[[j,rt.toSorted((H,G)=>ht(H)-ht(G))[0]]]})):void 0;n=Y?[...Y.values()]:M;for(const[j,V]of k)c.set(j,{...V,box:D.get(j)??V.box});for(const j of u)j.sourceBox=D.get(j.source)??j.sourceBox,j.targetBox=D.get(j.target)??j.targetBox;const X=new Map;for(const[j,V]of D){const Q=[[],[],[],[]];for(const rt of u.filter(ht=>ht.source===j||ht.target===j)){const ht=mr(rt.source===j?rt.targetBox:rt.sourceBox),H=mr(V),G=ht.x-H.x,K=ht.y-H.y;Q[Math.abs(G)>Math.abs(K)?G>0?1:3:K>0?2:0].push(rt)}Q.forEach((rt,ht)=>{const H=ht===0||ht===2;rt.sort((K,tt)=>{const ot=vt=>mr(vt.source===j?vt.targetBox:vt.sourceBox);return(H?ot(K).x-ot(tt).x:ot(K).y-ot(tt).y)||u.indexOf(K)-u.indexOf(tt)});const G=rt.length>1?Math.min(Xe*1.5,((H?V.width:V.height)-Xe*2)/(rt.length-1)):0;rt.forEach((K,tt)=>{const ot=(tt-(rt.length-1)/2)*G,[vt,Ot]=xp(V)[ht],Pt={x:vt.x+(H?ot:0),y:vt.y+(H?0:ot)},Mt=c.get(j),[Bt,Rt]=Mt&&!Mt.rect?Zn(V,Mt.outline,Pt):[Pt,{x:Pt.x+Ot.x-vt.x,y:Pt.y+Ot.y-vt.y}],we=X.get(K)??{};Object.assign(we,K.source===j?{start:Bt,lead:Rt}:{end:Bt,tail:Rt}),X.set(K,we)})})}const z=[],U=u.toSorted((j,V)=>+!!V.label-+!!j.label||er(mr(j.sourceBox),mr(j.targetBox))-er(mr(V.sourceBox),mr(V.targetBox)));for(const j of U){const V=X.get(j);if(!V||!V.start||!V.lead||!V.end||!V.tail)break;let Q;const rt=H=>{const G=H.points[0],K=Gr(H.points);if(z.some(Mt=>Mt.route.source===j.source&&er(G,Mt.curve.points[0])<Xe/2||Mt.route.target===j.source&&er(G,Gr(Mt.curve.points))<Xe/2||Mt.route.source===j.target&&er(K,Mt.curve.points[0])<Xe/2||Mt.route.target===j.target&&er(K,Gr(Mt.curve.points))<Xe/2)||!g(j,H,Xe)||z.some(Mt=>Mt.labelBox&&So(H.points,Mt.labelBox,6)))return;const ot=z.filter(Mt=>qi(H.points,Mt.curve.points)).length;if(ot||t&&Xs(H)>Math.PI*.6)return;const vt=j.labelBox,Ot=vt?[.5,.35,.65].flatMap(Mt=>{const Bt=H.points[Math.round((H.points.length-1)*Mt)],Rt=m(j,{...vt,x:Bt.x-vt.width/2,y:Bt.y-vt.height/2},P);return Rt?[Rt]:[]}).find(Mt=>![...c.values()].some(Bt=>jo(Mt,Bt.box,6))&&!n.some(Bt=>jo(Mt,Bt,6))&&!z.some(Bt=>Bt.labelBox&&jo(Mt,Bt.labelBox,6)||So(Bt.curve.points,Mt,6))):void 0;if(j.labelBox&&!Ot)return;const Pt=Li(H)+(q?mh(H)*Xe**2:Xs(H)*Xe*2)+ot*128;(!Q||Pt<Q.cost)&&(Q={curve:H,cost:Pt,labelBox:Ot})};q||f(j).forEach(rt);const ht=[[[V.start,V.lead],[V.end,V.tail]],...h(j.source,j.sourceBox).flatMap(H=>h(j.target,j.targetBox).map(G=>[H,G])).toSorted((H,G)=>er(H[0][0],H[1][0])-er(G[0][0],G[1][0]))];for(const[[H,G],[K,tt]]of ht){const ot=(Ot,Pt)=>z.some(Mt=>Mt.route.source===Ot&&er(Pt,Mt.curve.points[0])<Xe/2||Mt.route.target===Ot&&er(Pt,Gr(Mt.curve.points))<Xe/2);if(ot(j.source,H)||ot(j.target,K))continue;const vt=er(H,K);for(const Ot of[.5,.35,.23])for(const Pt of[.5,.35,.23]){const Mt=Kn(H,{x:H.x+(G.x-H.x)*vt*Ot/(Xe*2),y:H.y+(G.y-H.y)*vt*Ot/(Xe*2)},{x:K.x+(tt.x-K.x)*vt*Pt/(Xe*2),y:K.y+(tt.y-K.y)*vt*Pt/(Xe*2)},K);rt(Mt)}if(q&&Q)break}if(!Q)break;z.push({route:j,curve:Q.curve,labelBox:Q.labelBox})}if(z.length===u.length){for(const{route:rt,curve:ht}of z)Object.assign(rt,ht);const j=z.every(rt=>!rt.route.label||!!rt.labelBox),V=z.reduce((rt,ht)=>rt+Li(ht.curve),0),Q=$(z);j&&V<L*(t?.99:v?1.4:.82)&&Q<(F?.cost??(v&&!t?1/0:I))&&(F={boxes:D,groups:R.groups,headers:Y,curves:z,cost:Q})}for(const[j,V]of k)c.set(j,V);for(const{route:j,...V}of _)Object.assign(j,V)}if(n=M,F){const R=[...k].flatMap(([D,P])=>{const Y=F.boxes.get(D),X=P.element.transform.baseVal.consolidate()?.matrix,z=P.element.parentElement?.getScreenCTM();return Y&&X&&z?[{id:D,box:Y,node:P,transform:X,parent:z}]:[]}),q=[...F.groups??[]].flatMap(([D,P])=>{const Y=B.get(D);if(!Y)return[];const X=Y.shape.getScreenCTM()?.inverse(),z=Y.label.parentElement?.getScreenCTM()?.inverse();return X&&z?[{id:D,box:P,cluster:Y,matrix:X,parent:z}]:[]});if(R.length===c.size&&q.length===(F.groups?.size??0)){for(const{id:D,box:P,cluster:Y,matrix:X,parent:z}of q){const U=new DOMPoint(P.x,P.y).matrixTransform(o).matrixTransform(X),j=new DOMPoint(P.x+P.width,P.y+P.height).matrixTransform(o).matrixTransform(X);for(const[ht,H]of Object.entries({x:U.x,y:U.y,width:j.x-U.x,height:j.y-U.y}))Y.shape.setAttribute(ht,String(H));const V=F.headers?.get(D),Q=new DOMPoint((V?.x??P.x+20)+Y.header.width/2,(V?.y??P.y+12)+Y.header.height/2).matrixTransform(o).matrixTransform(z),rt=Y.label.getBBox();Y.label.setAttribute("transform",`translate(${Q.x-rt.x-rt.width/2},${Q.y-rt.y-rt.height/2})`)}F.groups&&(n=[...B.values()].map(D=>s(D.label)),l=[...B.values()].map(D=>s(D.shape)));for(const{id:D,box:P,node:Y,transform:X,parent:z}of R){const U=new DOMPoint(0,0).matrixTransform(o).matrixTransform(z.inverse()),j=new DOMPoint(P.x-Y.box.x,P.y-Y.box.y).matrixTransform(o).matrixTransform(z.inverse());Y.element.setAttribute("transform",`matrix(${X.a},${X.b},${X.c},${X.d},${X.e+j.x-U.x},${X.f+j.y-U.y})`),c.set(D,{...Y,box:P})}for(const{route:D,curve:P,labelBox:Y}of F.curves)D.sourceBox=F.boxes.get(D.source)??D.sourceBox,D.targetBox=F.boxes.get(D.target)??D.targetBox,b(D,P,Y)}}}for(const[k,_]of c){const L=u.filter(j=>j.target===k);if(t||!_.rect||L.length<2||L.length>4||L.some(j=>j.label||!j.d.includes("C")||!c.get(j.source)?.outline.length)||u.some(j=>j.source===k))continue;const v=L.map(j=>mr(j.sourceBox)),M=/^(LR|RL)$/.test(e.dataset.flowchartDirection??"")?"x":"y",B=Math.max(...v.map(j=>j[M]))-Math.min(...v.map(j=>j[M])),E=v.map(j=>er(j,mr(_.box)));if(B<(M==="x"?_.box.width:_.box.height)*2||Math.max(...E)<Math.min(...E)*2.5)continue;const O=_.element.transform.baseVal.consolidate()?.matrix,$=_.element.parentElement?.getScreenCTM();if(!O||!$)continue;const I={x:v.reduce((j,V)=>j+V.x,0)/v.length,y:v.reduce((j,V)=>j+V.y,0)/v.length},F=u.filter(j=>!L.includes(j)),R=[...c].filter(([j])=>j!==k).map(([,j])=>j.box),q=R.filter(j=>j.x+j.width>=Math.min(...v.map(V=>V.x))&&j.x<=Math.max(...v.map(V=>V.x)));if(!q.length)continue;const D=Math.min(...q.map(j=>j.y))-_.box.height-Xe*3,P=Math.max(...q.map(j=>j.y+j.height))+Xe*3,Y=L.reduce((j,V)=>j+Li(V),0);let X;for(const j of[D,P,I.y-_.box.height/2])for(const V of[0,-_.box.width/2,_.box.width/2]){const Q={..._.box,x:I.x-_.box.width/2+V,y:j};if(R.some(H=>jo(Q,H,12))||F.some(H=>So(H.points,Q,8)||H.labelBox&&jo(Q,H.labelBox,8)))continue;c.set(k,{..._,box:Q});const rt=[];for(const H of L.toSorted((G,K)=>Li(K)-Li(G))){let G;for(const[K,tt]of h(H.source,H.sourceBox))for(const[ot,vt]of h(H.target,Q)){if(rt.some(Mt=>er(ot,Gr(Mt.curve.points))<Xe))continue;const Ot=ph([K,tt,vt,ot]);if(!g(H,Ot)||F.some(Mt=>qi(Ot.points,Mt.points)||Mt.labelBox&&So(Ot.points,Mt.labelBox,6))||rt.some(Mt=>qi(Ot.points,Mt.curve.points)))continue;const Pt=Li(Ot);(!G||Pt<G.length)&&(G={curve:Ot,length:Pt})}if(!G)break;rt.push({route:H,curve:G.curve})}if(c.set(k,_),rt.length!==L.length)continue;const ht=rt.reduce((H,G)=>H+Li(G.curve),0)+er(mr(Q),mr(_.box))*.15;ht<Y*.8&&(!X||ht<X.cost)&&(X={box:Q,planned:rt,cost:ht})}if(!X)continue;const z=new DOMPoint(0,0).matrixTransform(o).matrixTransform($.inverse()),U=new DOMPoint(X.box.x-_.box.x,X.box.y-_.box.y).matrixTransform(o).matrixTransform($.inverse());_.element.setAttribute("transform",`matrix(${O.a},${O.b},${O.c},${O.d},${O.e+U.x-z.x},${O.f+U.y-z.y})`),c.set(k,{..._,box:X.box});for(const{route:j,curve:V}of X.planned)j.targetBox=X.box,b(j,V)}for(const[k,_]of c)if(_.rect)for(const L of["left","right"]){const v=_.box.x+(L==="right"?_.box.width:0),M=u.filter(P=>P.d.includes("C")&&P.target===k&&Math.abs(Gr(P.points).x-v)<12);if(M.length<2||!M.some((P,Y)=>M.slice(Y+1).some(X=>qi(P.points,X.points))))continue;const B=M.toSorted((P,Y)=>mr(P.sourceBox).y-mr(Y.sourceBox).y),E=M.map(P=>Gr(P.points)).toSorted((P,Y)=>P.y-Y.y),O=M.map(P=>({route:P,d:P.d,points:P.points})),$=M.reduce((P,Y)=>P+x(Y,Y),0),I=t?p():0,F=B.map((P,Y)=>{const X=Gr(P.points);return{route:P,curve:ph(P.points.map((z,U)=>({x:z.x+(E[Y].x-X.x)*(U/(P.points.length-1))**2,y:z.y+(E[Y].y-X.y)*(U/(P.points.length-1))**2})))}});for(const{route:P,curve:Y}of F)Object.assign(P,Y);const R=F.map(({route:P,curve:Y})=>y(P,Y)),q=M.reduce((P,Y)=>P+x(Y,Y),0);if(F.every(({route:P,curve:Y},X)=>g(P,Y)&&(!P.label||R[X]))&&q<$&&(!t||p()<=I))F.forEach(({route:P,curve:Y},X)=>b(P,Y,R[X]));else for(const{route:P,d:Y,points:X}of O)Object.assign(P,{d:Y,points:X})}const S=[...c.values()].map(k=>k.box);if(!S.length)return;const T={left:Math.min(...S.map(k=>k.x))-64,right:Math.max(...S.map(k=>k.x+k.width))+64,top:Math.min(...S.map(k=>k.y))-64,bottom:Math.max(...S.map(k=>k.y+k.height))+64};for(const k of u.toSorted((_,L)=>L.path.getTotalLength()-_.path.getTotalLength())){const _=x(k,k);if(!_||!k.d.includes("C")||k.source===k.target||!c.get(k.source)?.outline.length||!c.get(k.target)?.outline.length)continue;let L;const v=t?u.filter(M=>M!==k&&qi(k.points,M.points)).length:0;for(const[M,B]of h(k.source,k.sourceBox))for(const[E,O]of h(k.target,k.targetBox,t)){const I=[[M,B,O,E],...[T.top,T.bottom].flatMap(F=>[[M,B,{x:B.x,y:F},{x:O.x,y:F},O,E],...[T.left,T.right].map(R=>[M,B,{x:B.x,y:F},{x:R,y:F},{x:R,y:O.y},O,E])])].map(ph);if(t){const F=er(M,E)/(Xe*2);for(const R of[.5,.35,.23])for(const q of[.5,.35,.23])I.unshift(Kn(M,{x:M.x+(B.x-M.x)*F*R,y:M.y+(B.y-M.y)*F*R},{x:E.x+(O.x-E.x)*F*q,y:E.y+(O.y-E.y)*F*q},E))}for(const F of I){if(t&&u.some(P=>P!==k&&k.target===P.target&&er(Gr(F.points),Gr(P.points))<Xe/2)||!g(k,F)||t&&u.filter(P=>P!==k&&qi(F.points,P.points)).length>v)continue;const R=x(k,F);if(R>=_||L&&R>L.conflicts)continue;const q=y(k,F);if(k.label&&!q)continue;const D=F.points.slice(1).reduce((P,Y,X)=>P+er(F.points[X],Y),0);(!L||R<L.conflicts||D<L.length)&&(L={curve:F,labelBox:q,conflicts:R,length:D})}}L&&b(k,L.curve,L.labelBox)}for(const k of u){if(t&&!r.has(k)||!k.d.includes("C")||k.source===k.target||!c.get(k.source)?.outline.length||!c.get(k.target)?.outline.length)continue;const _=k.points[0],L=Gr(k.points),v=k.points.find(P=>er(P,_)>1),M=k.points.findLast(P=>er(P,L)>1);if(!v||!M)continue;const B=er(_,L),E=Li(k),O=mh(k);if(O<1e-4)continue;const $=er(_,v),I=er(L,M),F=E+Xs(k)*Xe*2,R=u.filter(P=>P!==k&&qi(k.points,P.points)).length;let q;const D=f(k);for(const P of[.5,.35,.23,.15,.08])for(const Y of[.5,.35,.23,.15,.08]){const X=Kn(_,{x:_.x+(v.x-_.x)*B*P/$,y:_.y+(v.y-_.y)*B*P/$},{x:L.x+(M.x-L.x)*B*Y/I,y:L.y+(M.y-L.y)*B*Y/I},L);D.push(X)}for(const P of D){const Y=Li(P)+Xs(P)*Xe*2;if(Y>=(q?.cost??F*.98)||mh(P)>Math.max(O,1/Xe)||Li(P)>E+Xe/2||!g(k,P,Xe)||x(k,P)||t&&u.filter(z=>z!==k&&qi(P.points,z.points)).length>R)continue;const X=y(k,P,!0);k.label&&!X||(q={curve:P,labelBox:X,cost:Y})}q&&b(k,q.curve,q.labelBox)}}const A1=6,gi=16,_3=18,L3=4,Qn=7,F1=8,Au=8;function Yi(e,t){return t==="top"?Et(e,.5,0):t==="right"?Et(e,1,.5):t==="bottom"?Et(e,.5,1):Et(e,0,.5)}function A3(e,t){const r=e.x+e.width/2,i=t.filter(Number.isFinite).toSorted((s,n)=>s-n);if(!i.some(s=>Math.abs(s-r)<=1))return r;const o=i.length+1,a=Math.min(gi,e.width*.6/(o-1));return r-a*(o-1)/2}function F3(e,t){const r=e.x+e.width/2;if(!t.some(a=>a<r)||!t.some(a=>a>r)||t.every(a=>Math.abs(a-r)>=gi))return;const i=Math.min(...t)-gi,o=Math.min(e.width/2,e.corner?.x??0);return i>=e.x+o&&i<=e.x+e.width-o?i:void 0}function Fu(e,t,r){const i=e.getScreenCTM(),o=Math.hypot(r.x-t.x,r.y-t.y);if(!i||o<=0)return 1;const a=new DOMPoint(t.x,t.y).matrixTransform(i),s=new DOMPoint(r.x,r.y).matrixTransform(i);return Math.hypot(s.x-a.x,s.y-a.y)/o||1}const ai=24,$3=32;function xn(e){return Math.ceil(Math.max(e,18))+ai+$3}function E3(e,t,r,i,o=!1){if((!o||r==="upper")&&t.y>=e.y+e.height+16){const u=Yi(e,"bottom"),f=Yi(t,"top"),g=(u.y+f.y)/2,p=_r([u,{x:u.x,y:g},{x:f.x,y:g},f]),m=i.filter(y=>![e,t].some(x=>Math.abs(y.x-x.x)<.001&&Math.abs(y.y-x.y)<.001&&Math.abs(y.width-x.width)<.001&&Math.abs(y.height-x.height)<.001));if(nr(p).every(y=>!m.some(x=>Br(y,x,8))))return p}const a=r==="upper"&&t.y>=e.y+e.height,s=r==="upper"&&!a?"top":"right";if(o&&a){const u=Yi(e,"bottom"),f=Yi(t,"top"),g={x:Math.max(t.x,Math.min(u.x,t.x+t.width)),y:f.y},p=(x,b)=>Math.abs(x.x-b.x)<.001&&Math.abs(x.y-b.y)<.001&&Math.abs(x.width-b.width)<.001&&Math.abs(x.height-b.height)<.001,m={start:u,end:g};if(Math.abs(u.x-g.x)<.001&&!i.some(x=>!p(x,e)&&!p(x,t)&&Br(m,x,Au)))return[u,g]}const n=a?"right":r==="upper"?"top":t.x>=e.x+e.width?"left":"right",l=Yi(e,s),c=Yi(t,n),h=o?16:32;if(s==="top"){const u=Math.min(...i.map(f=>f.y),t.y,e.y)-h;if(Math.abs(l.x-c.x)<.001){const f=Math.max(e.x+e.width,t.x+t.width,...i.map(g=>g.x+g.width))+h;return _r([l,{x:l.x,y:u},{x:f,y:u},{x:f,y:c.y},c])}return _r([l,{x:l.x,y:u},{x:c.x,y:u},c])}if(n==="left"&&l.y>=t.y&&l.y<=t.y+t.height)return[l,{x:t.x,y:l.y}];if(n==="left"){if(Math.abs(l.y-c.y)<.001)return[l,c];const u=(l.x+c.x)/2;return[l,{x:u,y:l.y},{x:u,y:c.y},c]}const d=Math.max(...i.map(u=>u.x+u.width))+h*2;return _r([l,{x:d,y:l.y},{x:d,y:c.y},c])}function P3(e,t,r,i=!1){const o=Yi(e,"bottom"),a=Yi(t,i?"left":"bottom"),s=i?16:32,n=Math.max(...r.map(l=>l.y+l.height))+s;if(i){const l=Math.min(e.x,t.x,...r.map(h=>h.x))-s-12,c=o.y+12;return _r([o,{x:o.x,y:c},{x:l,y:c},{x:l,y:a.y},a])}return _r([o,{x:o.x,y:n},{x:a.x,y:n},a])}function I3(e,t,r,i=!1){const o=i?e.x+e.width+28:Math.max(...r.map(c=>c.x+c.width))+28,a=Math.min(...r.map(c=>c.x))-(i?12:28),s=Math.max(...r.map(c=>c.y+c.height))+(i?12:28),n=e.y+e.height/2,l=t.x+t.width/2;return[{x:e.x+e.width,y:n},{x:o,y:n},{x:o,y:s},{x:a,y:s},{x:a,y:t.y+t.height+12},{x:l,y:t.y+t.height+12},{x:l,y:t.y+t.height+.25}]}function O3(e,t,r,i=!1){const o=Math.max(...r.map(n=>n.x+n.width))+(i?18:28),a=e.y+e.height/2,s=t.y+t.height/2;return[{x:e.x+e.width,y:a},{x:o,y:a},{x:o,y:s},{x:t.x+t.width,y:s}]}function D3(e,t){if(e.length!==7||e[3].x!==e[4].x||e[3].y<=e[4].y)return e;const r=Math.min(e[3].x,...t.filter(i=>i.y<e[3].y&&i.y+i.height>e[4].y).map(i=>i.x-20));return r===e[3].x?e:e.map((i,o)=>o===3||o===4?{...i,x:r}:i)}function Ai(e,t,r=4){return e.x<t.x+t.width+r&&e.x+e.width+r>t.x&&e.y<t.y+t.height+r&&e.y+e.height+r>t.y}function Br(e,t,r=0){const i=t.x-r,o=t.x+t.width+r,a=t.y-r,s=t.y+t.height+r;return Math.abs(e.start.x-e.end.x)<.001?e.start.x>i&&e.start.x<o&&Math.max(e.start.y,e.end.y)>a&&Math.min(e.start.y,e.end.y)<s:Math.abs(e.start.y-e.end.y)>=.001?!1:e.start.y>a&&e.start.y<s&&Math.max(e.start.x,e.end.x)>i&&Math.min(e.start.x,e.end.x)<o}function R3(e,t,r=Au,i=[]){let o=_r(e);for(let a=0;a<t.length*2+1;a+=1){let s;for(let n=0;n<o.length-1&&!s;n+=1){const l={start:o[n],end:o[n+1]},c=t.find(m=>Br(l,m,r));if(!c)continue;const h=Math.abs(l.start.x-l.end.x)<.001,d=h?l.end.y>=l.start.y:l.end.x>=l.start.x,u=h?d?c.y-r:c.y+c.height+r:d?c.x-r:c.x+c.width+r,f=h?d?c.y+c.height+r:c.y-r:d?c.x+c.width+r:c.x-r,p=(h?[c.x-r,c.x+c.width+r]:[c.y-r,c.y+c.height+r]).map(m=>{const y=h?[l.start,{x:l.start.x,y:u},{x:m,y:u},{x:m,y:f},{x:l.end.x,y:f},l.end]:[l.start,{x:u,y:l.start.y},{x:u,y:m},{x:f,y:m},{x:f,y:l.end.y},l.end],x=nr(_r(y)),b=x.reduce((k,_)=>k+t.filter(L=>L!==c&&Br(_,L,r)).length,0),S=x.filter(k=>i.some(_=>vs(k,_))).length,T=x.reduce((k,_)=>k+Math.hypot(_.end.x-_.start.x,_.end.y-_.start.y),0);return{detour:y,score:b*1e6+S*1e4+T}});s={index:n,points:p.toSorted((m,y)=>m.score-y.score)[0].detour}}if(!s)break;o=_r([...o.slice(0,s.index),...s.points,...o.slice(s.index+2)])}return o}const Be={userSendsMessage:"User sends message",agentResponds:"Agent responds",toolStarts:"Tool starts",toolCompletes:"Tool completes",agentAsksUser:"Agent asks user",userReplies:"User replies",agentFinishes:"Agent finishes",requestFails:"Request fails",streamFails:"Stream fails",userRetries:"User retries"},bp={[Be.userSendsMessage]:["Idle","Starting"],[Be.agentResponds]:["Starting","Streaming"],[Be.toolStarts]:["Streaming","RunningTool"],[Be.toolCompletes]:["RunningTool","Streaming"],[Be.agentAsksUser]:["Streaming","NeedsInput"],[Be.userReplies]:["NeedsInput","Streaming"],[Be.agentFinishes]:["Streaming","Complete"],[Be.requestFails]:["Starting","Failed"],[Be.streamFails]:["Streaming","Failed"],[Be.userRetries]:["Failed","Starting"]};function N3(e){return{direction:e.direction,nodes:e.nodes.map(({id:t,domId:r,shape:i,isGroup:o,parentId:a})=>({id:t,domId:r,shape:i,isGroup:o,parentId:a})),edges:e.edges.map(({id:t,start:r,end:i,label:o})=>({id:t,start:r,end:i,label:o}))}}function sd(e,t){const r="-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[-+]?\\d+)?",i=e.match(new RegExp(`(${r})([\\s,]+)(${r})\\s*$`,"i"));if(!i||i.index===void 0)return null;const o=`${e.slice(0,i.index)}${t.x}${i[2]}${t.y}`,a=o.match(new RegExp(`L\\s*(${r})[\\s,]+(${r})\\s*$`,"i"));if(!a||a.index===void 0)return o;const s=o.slice(0,a.index).match(new RegExp(`(${r})[\\s,]+(${r})\\s*$`,"i"));return s&&Math.hypot(Number(s[1])-t.x,Number(s[2])-t.y)<.001?o.slice(0,a.index).trimEnd():o}function q3(e,t,r){const i=e.match(/[a-zA-Z]|-?(?:\d*\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/gi);if(!i)return null;const o={M:2,L:2,Q:4,C:6},a=[];let s={x:0,y:0};for(let g=0;g<i.length;){const p=i[g++],m=o[p];if(!m)return sd(e,t);const y=i.slice(g,g+m).map(Number);if(y.length!==m||!y.every(Number.isFinite))return null;g+=m;const x=Array.from({length:m/2},(b,S)=>({x:y[S*2],y:y[S*2+1]}));a.push({command:p,points:x,start:s}),s=x.at(-1)}const n=g=>(g.x-t.x)*r.x+(g.y-t.y)*r.y;let l=a.length-1;for(;l>0&&n(a[l].start)>=0;)l-=1;const c=a[l];if(!c||c.command==="M"||n(c.points.at(-1))<0)return sd(e,t);const h=g=>{let p=[c.start,...c.points];const m=[p[0]];for(;p.length>1;)p=p.slice(1).map((y,x)=>({x:p[x].x+(y.x-p[x].x)*g,y:p[x].y+(y.y-p[x].y)*g})),m.push(p[0]);return m.slice(1)};let d=0,u=1;for(let g=0;g<32;g++){const p=(d+u)/2;n(h(p).at(-1))<0?d=p:u=p}return[...a.slice(0,l),{...c,points:h((d+u)/2)}].map(({command:g,points:p})=>`${g} ${p.map(m=>`${m.x} ${m.y}`).join(" ")}`).join(" ")}function rr(e,t){const r=e.getScreenCTM(),i=t.getScreenCTM();if(!r||!i)return null;const o=i.inverse(),a=e.getBBox(),s=[new DOMPoint(a.x,a.y),new DOMPoint(a.x+a.width,a.y),new DOMPoint(a.x+a.width,a.y+a.height),new DOMPoint(a.x,a.y+a.height)].map(d=>d.matrixTransform(r).matrixTransform(o)),n=Math.min(...s.map(d=>d.x)),l=Math.min(...s.map(d=>d.y)),c=Math.max(...s.map(d=>d.x)),h=Math.max(...s.map(d=>d.y));return{x:n,y:l,width:c-n,height:h-l}}function kr(e,t){const r=t.getScreenCTM();if(!r)return rr(e,t);const i=r.inverse(),o=e.getBoundingClientRect(),a=[new DOMPoint(o.left,o.top),new DOMPoint(o.right,o.top),new DOMPoint(o.right,o.bottom),new DOMPoint(o.left,o.bottom)].map(h=>h.matrixTransform(i)),s=Math.min(...a.map(h=>h.x)),n=Math.min(...a.map(h=>h.y)),l=Math.max(...a.map(h=>h.x)),c=Math.max(...a.map(h=>h.y));return{x:s,y:n,width:l-s,height:c-n}}function $1(e,t,r,i=0){let o=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;for(const[s,n,l,c]of[[e.x,t.x,r.x,r.x+r.width],[e.y,t.y,r.y,r.y+r.height]]){if(Math.abs(n)<1e-4){if(s<l-i||s>c+i)return null;continue}const h=(l-s)/n,d=(c-s)/n;o=Math.max(o,Math.min(h,d)),a=Math.min(a,Math.max(h,d))}return o<0||o>a?null:{x:e.x+t.x*o,y:e.y+t.y*o}}function lo(e,t){return Math.hypot(Math.max(t.x-e.x,0,e.x-t.x-t.width),Math.max(t.y-e.y,0,e.y-t.y-t.height))}function W3(e,t,r){const i=r.x-t.x,o=r.y-t.y,a=i*i+o*o,s=a?Math.max(0,Math.min(1,((e.x-t.x)*i+(e.y-t.y)*o)/a)):0;return Math.hypot(e.x-t.x-i*s,e.y-t.y-o*s)}function z3(e,t){const r=Number.parseFloat(t.dataset.cylinderRimRatio??"0.14"),i=Math.max(1,Math.min(e.height/2,e.height*r)),o=e.x+e.width/2,a=e.width/2,s=[];for(let n=0;n<=32;n+=1){const l=Math.PI+Math.PI*n/32;s.push({x:o+Math.cos(l)*a,y:e.y+i+Math.sin(l)*i})}s.push({x:e.x+e.width,y:e.y+e.height-i});for(let n=0;n<=32;n+=1){const l=Math.PI*n/32;s.push({x:o+Math.cos(l)*a,y:e.y+e.height-i+Math.sin(l)*i})}return s.push({x:e.x,y:e.y+i}),s}function aa(e){return e.tagName.toLowerCase()!=="polygon"?!1:e.getAttribute("points")?.match(/-?(?:\d+(?:\.\d*)?|\.\d+)/g)?.map(Number)?.length===8}function E1(e){if(!(e instanceof SVGPolygonElement)||e.points.numberOfItems<3)return null;const t=e.getScreenCTM();return t?Array.from({length:e.points.numberOfItems},(r,i)=>{const o=e.points.getItem(i).matrixTransform(t);return{x:o.x,y:o.y}}):null}function H3(e,t,r){const i=(o,a)=>o.x*a.y-o.y*a.x;return r.map((o,a)=>({start:o,end:r[(a+1)%r.length]})).flatMap(({start:o,end:a})=>{const s={x:a.x-o.x,y:a.y-o.y},n=i(t,s);if(Math.abs(n)<1e-4)return[];const l={x:o.x-e.x,y:o.y-e.y},c=i(l,s)/n,h=i(l,t)/n;return c>=0&&h>=0&&h<=1?[{point:{x:e.x+t.x*c,y:e.y+t.y*c},rayProgress:c}]:[]}).toSorted((o,a)=>o.rayProgress-a.rayProgress)[0]?.point}function Cp(e,t,r){if(r.tagName.toLowerCase()==="rect"){const o=r.getScreenCTM(),a=getComputedStyle(r),s=r.getBBox(),n=h=>/^\d+(?:\.\d+)?(?:px)?$/.test(h)?Number.parseFloat(h):NaN,l=n(a.rx==="auto"?a.ry:a.rx),c=n(a.ry==="auto"?a.rx:a.ry);if(o&&Math.abs(o.b)<1e-8&&Math.abs(o.c)<1e-8){const h=Math.min(s.width/2,l)*Math.abs(o.a),d=Math.min(s.height/2,c)*Math.abs(o.d);if(h>0&&Math.abs(h-d)<1e-6){const u=Math.abs(e.x-t.x-t.width/2)-(t.width/2-h),f=Math.abs(e.y-t.y-t.height/2)-(t.height/2-h);return Math.max(0,Math.hypot(Math.max(0,u),Math.max(0,f))-h)}}}const i=E1(r)??(r.dataset.diagramCylinder==="true"?z3(t,r):null);return i?Math.min(...i.map((o,a)=>W3(e,o,i[(a+1)%i.length]))):lo(e,t)}function Y3(e,t,r,i,o=0){const a=$1(e,t,r,o);if(!a)return null;const s=E1(i);if(s)return H3(e,t,s)??a;if(i instanceof SVGRectElement){const f=i.getScreenCTM()?.inverse();if(f){const g=y=>i.isPointInFill(new DOMPoint(e.x+t.x*y,e.y+t.y*y).matrixTransform(f));let p=Math.hypot(a.x-e.x,a.y-e.y),m=(r.x+r.width/2-e.x)*t.x+(r.y+r.height/2-e.y)*t.y;if(g(m)){for(let y=0;y<24;y++){const x=(p+m)/2;g(x)?m=x:p=x}return{x:e.x+t.x*m,y:e.y+t.y*m}}}}if(i.dataset.diagramCylinder!=="true")return a;const n={x:r.x+r.width/2,y:r.y+r.height/2};let l=Math.hypot(a.x-e.x,a.y-e.y),c=(n.x-e.x)*t.x+(n.y-e.y)*t.y;const h=Number.parseFloat(i.dataset.cylinderRimRatio??"0.14"),d=Math.max(1,Math.min(r.height/2,r.height*h)),u=f=>{const g={x:e.x+t.x*f,y:e.y+t.y*f};if(g.y>=r.y+d&&g.y<=r.y+r.height-d)return g.x>=r.x&&g.x<=r.x+r.width;const p=g.y<r.y+d?r.y+d:r.y+r.height-d,m=(g.x-n.x)/(r.width/2),y=(g.y-p)/d;return m*m+y*y<=1};for(let f=0;f<24;f+=1){const g=(l+c)/2;u(g)?c=g:l=g}return{x:e.x+t.x*c,y:e.y+t.y*c}}function wp(e){if(!e.classList.contains("statediagram"))return;const t=[...e.querySelectorAll("g.node")].flatMap(r=>{const i=r.querySelector(":scope > .label-container, :scope > rect, :scope > circle, :scope > ellipse, :scope > polygon");return i?[{node:r,shape:i}]:[]});for(const r of e.querySelectorAll('.edgePaths path[marker-end], path.transition[data-edge="true"][marker-end]')){const i=r.getTotalLength();if(i<.25)continue;const o=r.getPointAtLength(i),a=r.getPointAtLength(Math.max(0,i-.1)),s=(r.dataset.terminalDirection??"").split(",").map(Number),n=s.length===2&&s.every(Number.isFinite)?{x:s[0],y:s[1]}:{x:o.x-a.x,y:o.y-a.y},l=Math.hypot(n.x,n.y);if(l<1e-4)continue;const c={x:n.x/l,y:n.y/l},h={x:o.x-c.x*256,y:o.y-c.y*256},d=r.dataset.terminalTarget,f=t.flatMap(({node:p,shape:m})=>{const y=kr(m,r);if(!y)return[];const x=y,b=$1(h,c,x,.5);if(!b)return[];const S=Math.hypot(b.x-o.x,b.y-o.y),T={x:x.x+x.width/2,y:x.y+x.height/2};return c.x*(T.x-b.x)+c.y*(T.y-b.y)>0&&(p.id===d||S<=L3)?[{node:p,intersection:b,correction:S}]:[]}).sort((p,m)=>p.correction-m.correction)[0];if(!f)continue;const g=sd(r.getAttribute("d")??"",f.intersection);g&&(r.setAttribute("d",g),r.dataset.terminalTarget=f.node.id,r.dataset.terminalDirection=`${c.x},${c.y}`)}}function kp(e,t){const i=(t.getAttribute("marker-end")??"").match(/#([^)'"]+)/)?.[1];return i?e.querySelector(`marker[id="${CSS.escape(i)}"]`):null}function js(e,t=5){const r=[...e.querySelectorAll("g.node")].flatMap(i=>{const o=Je(i);return o?[{node:i,shape:o}]:[]});for(const i of e.querySelectorAll(".edgePaths path[marker-end], .edges.edgePath path[marker-end]")){if(kp(e,i)?.dataset.diagramChevron!=="true")continue;const o=i.dataset.terminalGapBasePath??i.getAttribute("d");if(!o)continue;i.dataset.terminalGapBasePath=o,i.setAttribute("d",o);const a=i.getTotalLength();if(a<.25)continue;const s=i.getPointAtLength(a),n=i.getPointAtLength(Math.max(0,a-.1)),l=i.getScreenCTM();if(!l)continue;const c=new DOMPoint(s.x,s.y).matrixTransform(l),h=(i.dataset.manhattanPoints??"").trim().split(/\s+/).map(D=>D.split(",").map(Number)).filter(D=>D.length===2&&D.every(Number.isFinite)).map(([D,P])=>({x:D,y:P})),d=h.at(-2)??n,u=h.at(-1)??s,f=(i.dataset.terminalDirection??"").split(",").map(Number),g=h.length>=2?{x:u.x-d.x,y:u.y-d.y}:f.length===2&&f.every(Number.isFinite)?{x:f[0],y:f[1]}:{x:s.x-n.x,y:s.y-n.y},p=new DOMPoint(0,0).matrixTransform(l),m=new DOMPoint(g.x,g.y).matrixTransform(l),y=Math.hypot(m.x-p.x,m.y-p.y);if(y<=0)continue;const x={x:(m.x-p.x)/y,y:(m.y-p.y)/y},b=vr(i),S=i.dataset.terminalTarget??b?.target,T={x:c.x-x.x*256,y:c.y-x.y*256},_=r.flatMap(({node:D,shape:P})=>{if(S&&D.id!==S&&zr(D)!==S)return[];const Y=P.getBoundingClientRect(),X={x:Y.left,y:Y.top,width:Y.width,height:Y.height},z=Y3(T,x,X,P,e.classList.contains("statediagram")?.5:0);if(!z)return[];const U={x:X.x+X.width/2,y:X.y+X.height/2},j=x.x*(U.x-z.x)+x.y*(U.y-z.y)>0,V=Math.hypot(z.x-c.x,z.y-c.y);return j&&(S||V<=12)?[{node:D,shape:P,bounds:X,intersection:z,correction:V}]:[]}).sort((D,P)=>D.correction-P.correction)[0];if(!_)continue;const L=kp(e,i)?.querySelector("path"),v=Number.parseFloat(L?getComputedStyle(L).strokeWidth:"0"),M=t+(Number.isFinite(v)?v/2:0);let B=0,E=M;const O=D=>({x:_.intersection.x-x.x*D,y:_.intersection.y-x.y*D});for(;Cp(O(E),_.bounds,_.shape)<M&&E<256;)E*=2;for(let D=0;D<24;D+=1){const P=(B+E)/2;Cp(O(P),_.bounds,_.shape)<M?B=P:E=P}const $=O(E),I=new DOMPoint($.x,$.y).matrixTransform(l.inverse()),F=O(E+1),R=new DOMPoint(F.x,F.y).matrixTransform(l.inverse()),q=q3(i.getAttribute("d")??"",R,g);q&&(i.setAttribute("d",`${q} L ${I.x} ${I.y}`),i.dataset.terminalTarget=_.node.id,i.dataset.terminalGapCss=String(t))}}function $u(e,t=3){const r="-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[-+]?\\d+)?",i=e.match(new RegExp(`[ML]|${r}`,"gi")),o=e.replace(new RegExp(`[ML]|${r}|[\\s,]`,"gi"),"").trim();if(!i||o)return null;const a=[];let s="";for(let n=0;n<i.length;n+=1){const l=i[n];if(/^[ML]$/i.test(l)){s=l.toUpperCase();continue}const c=i[n+1];if(!s||!c||/^[ML]$/i.test(c))return null;a.push({x:Number(l),y:Number(c)}),n+=1,s="L"}return a.length<t?null:a.slice(1).every((n,l)=>{const c=a[l];return Math.abs(n.x-c.x)<.001||Math.abs(n.y-c.y)<.001})?a:null}function _r(e){const t=e.filter((i,o)=>!o||Math.hypot(i.x-e[o-1].x,i.y-e[o-1].y)>=.001),r=[];for(const i of t){const o=r.at(-1),a=r.at(-2);o&&a&&(Math.abs(a.x-o.x)<.001&&Math.abs(o.x-i.x)<.001||Math.abs(a.y-o.y)<.001&&Math.abs(o.y-i.y)<.001)?r[r.length-1]=i:r.push(i)}return r}function Eu(e,t=A1){const r=[`M ${e[0].x} ${e[0].y}`];for(let o=1;o<e.length-1;o+=1){const a=e[o-1],s=e[o],n=e[o+1],l=Math.hypot(s.x-a.x,s.y-a.y),c=Math.hypot(n.x-s.x,n.y-s.y),h=(s.x-a.x)*(n.y-s.y)-(s.y-a.y)*(n.x-s.x),d=Math.min(t,l/2,c/2);if(d<=0||Math.abs(h)<.001){r.push(`L ${s.x} ${s.y}`);continue}const u=s.x-(s.x-a.x)/l*d,f=s.y-(s.y-a.y)/l*d,g=s.x+(n.x-s.x)/c*d,p=s.y+(n.y-s.y)/c*d;r.push(`L ${u} ${f}`,`Q ${s.x} ${s.y} ${g} ${p}`)}const i=e[e.length-1];return r.push(`L ${i.x} ${i.y}`),r.join(" ")}function yh(e){for(const t of e.querySelectorAll('.flowchart-link, .edgePaths path, path.relation, path.transition[data-edge="true"]')){const r=$u(t.getAttribute("d")??"");if(!r)continue;const i=_r(r);t.dataset.manhattanPoints??=i.map(a=>`${a.x},${a.y}`).join(" ");const o=Eu(i);t.dataset.feedbackLane||(t.dataset.manhattanSegments=String(Math.max(0,i.length-1))),o.includes(" Q ")&&(t.setAttribute("d",o),t.dataset.cornerRadius=String(A1))}}function Je(e){return e.querySelector(":scope > .label-container, :scope > rect, :scope > circle, :scope > ellipse, :scope > .outer-path, :scope > .basic.label-container, :scope > polygon")}function X3(e){for(const t of e.querySelectorAll("g.node")){const r=t.querySelector(":scope > path.basic.label-container.outer-path[label-offset-y]");if(!r||r.dataset.diagramCylinder==="true")continue;const i=r.getBBox(),o=i.height,s=i.width/2,n=Math.min(8,o*.14),l=-o/2,c=o/2;r.setAttribute("d",`M ${-s} ${l+n} A ${s} ${n} 0 0 1 ${s} ${l+n} L ${s} ${c-n} A ${s} ${n} 0 0 1 ${-s} ${c-n} Z`),r.removeAttribute("transform"),r.dataset.diagramCylinder="true",r.dataset.cylinderRimRatio=String(n/o);const h=document.createElementNS("http://www.w3.org/2000/svg","path");h.setAttribute("d",`M ${-s} ${l+n} A ${s} ${n} 0 0 1 ${s} ${l+n} A ${s} ${n} 0 0 1 ${-s} ${l+n} Z`),h.setAttribute("class","diagram-cylinder-rim"),h.setAttribute("aria-hidden","true"),h.setAttribute("focusable","false"),r.after(h)}}function j3(e){if(e.getAttribute("aria-roledescription")==="flowchart-v2")for(const t of e.querySelectorAll("g.node")){t.querySelector(":scope > .flowchart-node-outline")?.remove();const r=Je(t);if(!r)continue;const i=r.cloneNode(!1);i.removeAttribute("id"),i.classList.add("flowchart-node-outline"),i.setAttribute("aria-hidden","true"),i.setAttribute("focusable","false"),i.style.setProperty("fill","none","important"),t.append(i)}}function G3(e){if(e.getAttribute("aria-roledescription")==="er")for(const t of e.querySelectorAll("g.node")){t.querySelectorAll(":scope > .er-negative-space-divider").forEach(d=>d.remove());const r=[...t.querySelectorAll(":scope > .row-rect-odd, :scope > .row-rect-even")].map(d=>d.getBBox());if(!r.length)continue;const i=[...t.querySelectorAll(":scope > .divider")],o=i.map(d=>d.getBBox()).filter(d=>d.height>d.width).toSorted((d,u)=>u.x-d.x);i.forEach(d=>d.remove());const a=Math.min(...r.map(d=>d.x)),s=Math.max(...r.map(d=>d.x+d.width)),n=Math.max(...r.map(d=>d.y+d.height)),l=(d,u,f)=>{const g=document.createElementNS("http://www.w3.org/2000/svg","line");g.classList.add("er-negative-space-divider"),g.dataset.dividerKind=d,g.setAttribute("x1",String(u.x)),g.setAttribute("y1",String(u.y)),g.setAttribute("x2",String(f.x)),g.setAttribute("y2",String(f.y)),g.setAttribute("aria-hidden","true"),t.insertBefore(g,t.querySelector(":scope > .label"))};for(const d of r.map(u=>u.y))l("row",{x:a,y:d},{x:s,y:d});const c=[...t.querySelectorAll(":scope > .label.attribute-keys")].some(d=>!!d.textContent?.trim()),h=o[0];if(c&&h){const d=h.x+h.width/2;l("key",{x:d,y:r[0].y},{x:d,y:n})}}}function Ha(e){for(const t of e.querySelectorAll("marker")){const r=t.querySelector("path"),i=t.id.endsWith("-arrowhead"),o=t.id.includes("pointEnd")||t.id.includes("barbEnd")||i,a=t.id.includes("pointStart");!r||!o&&!a||(t.setAttribute("viewBox",`0 0 ${Qn} ${Qn}`),t.setAttribute("markerWidth",String(Qn)),t.setAttribute("markerHeight",String(Qn)),t.setAttribute("refX",o?"6.5":"0.5"),t.setAttribute("refY","3.5"),t.setAttribute("orient",i?"auto-start-reverse":"auto"),t.setAttribute("markerUnits","userSpaceOnUse"),t.dataset.diagramChevron="true",r.setAttribute("d",o?"M 3.5 0.5 L 6.5 3.5 L 3.5 6.5":"M 3.5 0.5 L 0.5 3.5 L 3.5 6.5"),r.setAttribute("fill","none"),r.setAttribute("stroke","context-stroke"),r.setAttribute("stroke-width","1"),r.setAttribute("stroke-linecap","round"),r.setAttribute("stroke-linejoin","round"),r.setAttribute("vector-effect","non-scaling-stroke"))}}function vr(e){const t=e.id.match(/-L_([^_]+)_([^_]+)_\d+$/);return t?{source:t[1],target:t[2]}:null}function $i(e,t){const r=t.id.match(/-(L_.+)$/)?.[1];if(r)return[...e.querySelectorAll(".edgeLabels > .edgeLabel")].find(i=>i.querySelector(":scope > .label")?.getAttribute("data-id")===r)}function ir(e,t){return[...e.querySelectorAll("g.node")].find(r=>zr(r)===t)}function U3(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return!1;const t=[...e.querySelectorAll(".edgePaths path")].find(_=>{const L=vr(_);return L?.source==="Client"&&L.target==="Gateway"}),r=ir(e,"Client"),i=ir(e,"Gateway"),o=ir(e,"Queue"),a=[...e.querySelectorAll(".edgePaths path")].find(_=>{const L=vr(_);return L?.source==="Gateway"&&L.target==="Queue"}),s=t&&$i(e,t);let n=r&&Sr(r);const l=i&&Sr(i),c=o&&Sr(o),h=t&&s&&kr(s,t);if(!t||!r||!n||!l||!s||!h)return!1;const d=Et(l,.5,.5),u=[...e.querySelectorAll("g.cluster > rect")].flatMap(_=>{const L=kr(_,t);return L?[L]:[]}).filter(_=>d.x>_.x&&d.x<_.x+_.width&&d.y>_.y&&d.y<_.y+_.height).toSorted((_,L)=>L.width*L.height-_.width*_.height)[0];if(!u)return!1;const f=Math.max(52,h.height+24),g=u.y-(n.y+n.height),p=Math.max(0,f-g),m=r.transform.baseVal.consolidate()?.matrix;m&&p>0&&(r.setAttribute("transform",`translate(${m.e}, ${m.f-p})`),r.dataset.requestLaneRaised="true",r.dataset.requestLaneShift=String(Number(r.dataset.requestLaneShift??0)+p),n={...n,y:n.y-p});const y=Et(n,.5,1),x=Et(l,0,.35),b=(y.y+u.y)/2,S=u.x-Math.max(20,h.height/2+4),T=[y,{x:y.x,y:b},{x:S,y:b},{x:S,y:x.y},x];t.setAttribute("d",T.map((_,L)=>`${L?"L":"M"}${_.x},${_.y}`).join("")),t.dataset.clientRequestLane="downward",t.dataset.manhattanPoints=T.map(_=>`${_.x},${_.y}`).join(" "),fo(s,t,T,1);const k=a&&$i(e,a);if(a&&k&&c){const _=Et(l,0,.65),L=Et(c,0,.5),v=u.x+12,M=[_,{x:v,y:_.y},{x:v,y:L.y},L];a.setAttribute("d",M.map((B,E)=>`${E?"L":"M"}${B.x},${B.y}`).join("")),a.dataset.clientRequestLane="enqueue",a.dataset.manhattanPoints=M.map(B=>`${B.x},${B.y}`).join(" "),fo(k,a,M,1)}return P1(e,"Client",n),!0}function V3(e,t,r){if(!Ai(e,r,12))return{x:0,y:0};const i=[{x:e.x-r.x-r.width-12,y:0,clear:r.x+r.width<=t.x},{x:e.x+e.width-r.x+12,y:0,clear:r.x>=t.x+t.width},{x:0,y:e.y-r.y-r.height-12,clear:r.y+r.height<=t.y},{x:0,y:e.y+e.height-r.y+12,clear:r.y>=t.y+t.height}],{x:o,y:a}=i.toSorted((s,n)=>Number(n.clear)-Number(s.clear)||Math.hypot(s.x,s.y)-Math.hypot(n.x,n.y))[0];return{x:o,y:a}}function Sp(e){const t=Math.min(...e.map(i=>i.x)),r=Math.min(...e.map(i=>i.y));return{x:t,y:r,width:Math.max(...e.map(i=>i.x+i.width))-t,height:Math.max(...e.map(i=>i.y+i.height))-r}}function Z3(e,t,r){const i=e.parentElement?.getScreenCTM(),o=t.getScreenCTM();if(!i||!o)return;const a=new DOMPoint(0,0).matrixTransform(o).matrixTransform(i.inverse()),s=new DOMPoint(r.x,r.y).matrixTransform(o).matrixTransform(i.inverse()),n=e.getAttribute("transform")??"";e.setAttribute("transform",`translate(${s.x-a.x}, ${s.y-a.y}) ${n}`)}function K3(e,t){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const r=[...e.querySelectorAll("g.node")],i=[...e.querySelectorAll("g.cluster")].flatMap(s=>{const n=s.querySelector(":scope > rect"),l=s.querySelector(":scope > g.cluster-label");if(!n||!l)return[];const c=t&&Lu(s,t),h=c?t?.get(c):void 0;if(t&&!h)return[];const d=n.getBBox(),u=r.filter(f=>{if(h)return h.has(zr(f));const g=Sr(f);if(!g)return!1;const p=Et(g,.5,.5);return p.x>=d.x&&p.x<=d.x+d.width&&p.y>=d.y&&p.y<=d.y+d.height});return[{cluster:s,rect:n,label:l,frame:d,members:u,id:c,memberIds:h}]}),o=t?[...e.querySelectorAll(".edgePaths path")].flatMap(s=>{const n=vr(s),l=$u(s.getAttribute("d")??"",2);if(!n||!l)return[];const c=h=>{const d=ir(e,h),u=(d&&Je(d))??i.find(g=>g.id===h)?.rect,f=u&&rr(u,s);return u&&f?{shape:u,bounds:f}:null};return[{path:s,points:l,source:c(n.source),target:c(n.target)}]}):[],a=new Map;for(const s of i.toSorted((n,l)=>(n.memberIds?.size??0)-(l.memberIds?.size??0)||n.frame.width*n.frame.height-l.frame.width*l.frame.height)){const n=i.filter(E=>E!==s&&(s.memberIds?!!(E.id&&s.memberIds.has(E.id)):E.frame.x>=s.frame.x&&E.frame.y>=s.frame.y&&E.frame.x+E.frame.width<=s.frame.x+s.frame.width&&E.frame.y+E.frame.height<=s.frame.y+s.frame.height)).flatMap(({cluster:E,rect:O})=>{const $=t?rr(O,s.cluster):a.get(E);return $?[$]:[]}),c=[...s.members.flatMap(E=>{const O=Je(E),$=t&&O?rr(O,s.cluster):Sr(E);return $?[$]:[]}),...n];if(!c.length)continue;const h=s.label.querySelector("foreignObject"),d=h?.querySelector("div"),u=Sp(c),f=t?r.filter(E=>!s.members.includes(E)).flatMap(E=>{const O=Je(E),$=O&&rr(O,s.cluster);return $?[$]:[]}):[];let g=Math.ceil(Math.max(d?.getBoundingClientRect().height??0,d?.scrollHeight??0,s.label.getBBox().height,18)),p=xn(g);const m=Math.min(...c.map(({x:E})=>E)),y=Math.max(...c.map(({x:E,width:O})=>E+O)),x=Math.min(...c.map(({y:E})=>E)),b=Math.max(...c.map(({y:E,height:O})=>E+O));let S=Math.min(s.frame.x,m-ai),T=Math.min(s.frame.y,x-p),k=Math.max(s.frame.x+s.frame.width,y+ai),_=Math.max(s.frame.y+s.frame.height,b+20);if(t&&f.some(E=>Ai({x:S,y:T,width:k-S,height:_-T},E,12))){if(S=m-ai,k=y+ai,_=b+20,h&&d){const E=h.cloneNode(!0),O=E.querySelector("div");E.style.visibility="hidden",E.setAttribute("height","1"),E.setAttribute("width",String(k-S-ai*2)),O.style.setProperty("height","auto","important"),O.style.setProperty("width","100%","important"),s.label.append(E);try{const $=Math.max(u.width,O.scrollWidth);k=S+$+ai*2,E.setAttribute("width",String($)),g=Math.ceil(Math.max(18,O.scrollHeight))}finally{E.remove()}}else k=Math.max(k,S+s.label.getBBox().width+ai*2);p=xn(g),T=x-p}const L={x:S,y:T,width:k-S,height:_-T};if(s.rect.setAttribute("x",String(L.x)),s.rect.setAttribute("y",String(L.y)),s.rect.setAttribute("width",String(L.width)),s.rect.setAttribute("height",String(L.height)),s.cluster.dataset.headerHeight=String(p),h)h.setAttribute("x","0"),h.setAttribute("y","0"),h.setAttribute("width",String(Math.max(24,L.width-ai*2))),h.setAttribute("height",String(g)),s.label.setAttribute("transform",`translate(${L.x+ai}, ${L.y+ai})`);else{const E=s.label.getBBox();s.label.setAttribute("transform",`translate(${L.x+L.width/2-E.x-E.width/2}, ${L.y+ai-E.y})`)}if(a.set(s.cluster,L),!t)continue;const v=i.filter(E=>E!==s&&E.id&&s.id&&!s.memberIds?.has(E.id)&&!E.memberIds?.has(s.id)),M=v.filter(E=>!v.some(O=>O!==E&&E.id&&O.memberIds?.has(E.id))),B=M.map(E=>[E.cluster,...E.members,...i.filter(O=>O.id&&E.memberIds?.has(O.id)).map(O=>O.cluster)]);B.push(...r.filter(E=>!s.members.includes(E)&&!M.some(O=>O.members.includes(E))).map(E=>[E]));for(const E of B){const O=D=>{const P=D.flatMap(Y=>{const X=Y.matches("g.node")?Je(Y):Y.querySelector(":scope > rect"),z=X&&rr(X,s.cluster);return z?[z]:[]});return P.length?Sp(P):null},$=O(E);if(!$)continue;const I=V3(L,u,$);if(!I.x&&!I.y)continue;const F=I.x?"x":"y",R=I.x?"width":"height",q=B.filter(D=>{const P=O(D);return P&&(I[F]>0?P[F]+P[R]>$[F]:P[F]<$[F]+$[R])}).flat();for(const D of new Set(q))q.some(P=>P!==D&&P.contains(D))||Z3(D,s.cluster,I)}}for(const{path:s,points:n,source:l,target:c}of o){let h=!1;const d=(p,m)=>{const y=p&&rr(p.shape,s);if(!p||!y)return m;const x=p.bounds;return["x","y","width","height"].every(b=>Math.abs(y[b]-x[b])<.001)?m:(h=!0,{x:y.x+(m.x-x.x)*y.width/(x.width||1),y:y.y+(m.y-x.y)*y.height/(x.height||1)})},u=d(l,n[0]),f=d(c,n[n.length-1]);if(!h)continue;const g=mc(n,u,f,Math.abs(n[1].x-n[0].x)<.001);s.setAttribute("d",g.map((p,m)=>`${m?"L":"M"}${p.x},${p.y}`).join("")),s.dataset.manhattanPoints=g.map(p=>`${p.x},${p.y}`).join(" ")}}function xh(e,t=!1){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const i=[...e.querySelectorAll(".edgePaths path")].flatMap(y=>{const x=vr(y);return x?[{path:y,...x}]:[]}),o=new Map,a=new Map;for(const y of i.filter(({source:x,target:b})=>x!==b))o.set(y.target,(o.get(y.target)??0)+1),a.set(y.source,(a.get(y.source)??0)+1);const s=i.find(y=>y.source!==y.target&&(o.get(y.source)??0)>=2&&(a.get(y.source)??0)===1&&(a.get(y.target)??0)>=2);if(!s)return;if(!t&&s.path.dataset.feedbackLane==="outer")return s.path.getBBox();const n=ir(e,s.source),l=ir(e,s.target),c=n&&Je(n),h=l&&Je(l);if(!c||!h)return;const d=n&&Sr(n),u=l&&Sr(l),f=[...e.querySelectorAll("g.node")].flatMap(y=>{const x=Sr(y);return x?[x]:[]});if(!d||!u||!f.length)return;const g=[...e.querySelectorAll(".edgePaths path")].filter(y=>y!==s.path).map(y=>y.getBBox()),p=s.path.dataset.compactFlowchart==="true",m=I3(d,u,p?f:[...f,...g],p);s.path.setAttribute("d",m.map((y,x)=>`${x?"L":"M"}${y.x},${y.y}`).join("")),s.path.dataset.feedbackLane="outer",s.path.dataset.feedbackSource=s.source,s.path.dataset.feedbackTarget=s.target,s.path.dataset.manhattanSegments="4",s.path.dataset.manhattanPoints=m.map(y=>`${y.x},${y.y}`).join(" ")}function P1(e,t,r){if(e.getAttribute("aria-roledescription")!=="flowchart-v2"||!e.querySelector("g.cluster"))return;const i=[...e.querySelectorAll(".edgePaths path")],o=[...e.querySelectorAll(".edgeLabels > .edgeLabel")];i.forEach((a,s)=>{if(a.dataset.nestedDecisionRoute)return;const n=vr(a),l=n?i.filter(T=>vr(T)?.source===n.source).length:0,c=n&&ir(e,n.source),h=n&&ir(e,n.target),d=c&&rr(c,a),u=n?.target===t?r:h&&kr(h,a);if(!n||!d||!u||l>1||u.y>=d.y)return;const f=[...[...e.querySelectorAll("g.node")].flatMap(T=>{const k=rr(T,a);return k?[k]:[]}),...[...e.querySelectorAll("g.cluster > rect")].flatMap(T=>{const k=rr(T,a);return k?[k]:[]})],g=O3(d,u,f,a.dataset.compactFlowchart==="true");a.setAttribute("d",g.map((T,k)=>`${k?"L":"M"}${T.x},${T.y}`).join("")),a.dataset.groupedReturnLane="right",a.dataset.manhattanPoints=g.map(T=>`${T.x},${T.y}`).join(" ");const p=o[s];if(!p)return;const m={x:g[1].x,y:(g[1].y+g[2].y)/2},y=p.getBBox(),x=a.getCTM(),b=p.parentElement?.getCTM(),S=x&&b?new DOMPoint(m.x,m.y).matrixTransform(x).matrixTransform(b.inverse()):m;p.setAttribute("transform",`translate(${S.x-y.x-y.width/2}, ${S.y-y.y-y.height/2})`),p.dataset.finalPathCenter=`${m.x},${m.y}`})}function Q3(e){P1(e)}function vp(e){const t=e.querySelector('path[data-feedback-lane="outer"]'),r=t?.dataset.feedbackSource&&ir(e,t.dataset.feedbackSource),i=t?.dataset.feedbackTarget&&ir(e,t.dataset.feedbackTarget),o=t?.getScreenCTM(),a=(t?.dataset.manhattanPoints??"").split(" ").map(E=>E.split(",").map(Number)).filter(E=>E.length===2&&E.every(Number.isFinite)).map(([E,O])=>({x:E,y:O}));if(!t||!r||!i||!o||a.length<4)return;const s=o.inverse(),n=r.getBoundingClientRect(),l=i.getBoundingClientRect(),c=t.dataset.feedbackTarget,h=[...e.querySelectorAll(".edgePaths path")].flatMap(E=>{if(E===t)return[];const O=vr(E),$=(E.dataset.manhattanPoints??"").trim().split(/\s+/).map(Y=>Y.split(",").map(Number)).filter(Y=>Y.length===2&&Y.every(Number.isFinite)).map(([Y,X])=>({x:Y,y:X})),I=E.getScreenCTM();if(!O||!I||$.length<2)return[];const F=O.source===c?0:O.target===c?-1:null;if(F===null)return[];const R=$[F===0?0:$.length-1],q=$[F===0?1:$.length-2],D=new DOMPoint(R.x,R.y).matrixTransform(I),P=new DOMPoint(q.x,q.y).matrixTransform(I);return Math.abs(D.y-l.bottom)>1||Math.abs(D.x-P.x)>1?[]:[D.matrixTransform(s).x]}),d=new DOMPoint(l.left,l.bottom).matrixTransform(s).x,u=new DOMPoint(l.right,l.bottom).matrixTransform(s).x;let f=A3({x:Math.min(d,u),width:Math.abs(u-d)},h);const g=(d+u)/2,p=new DOMPoint(n.right,n.top+n.height/2).matrixTransform(s),m=Je(i),y=m&&rr(m,t),x=m?getComputedStyle(m).rx:"0",b=m?.getBBox().width??0,S=y&&b&&a.at(-2).y>y.y+y.height?F3({...y,corner:{x:(Number.parseFloat(x)||0)*(x.endsWith("%")?y.width/100:y.width/b),y:0}},h):void 0,T=S===void 0?[]:[{...a[a.length-3]},{x:S,y:a[a.length-2].y},{x:S,y:new DOMPoint(l.left,l.bottom).matrixTransform(s).y}],k=[...e.querySelectorAll("g.node")].filter(E=>E!==i).flatMap(E=>{const O=rr(E,t);return O?[O]:[]}),_=$i(e,t),L=[...e.querySelectorAll(".edgeLabels > .edgeLabel")].filter(E=>E!==_&&E.textContent?.trim()).flatMap(E=>{const O=kr(E,t);return O?[O]:[]}),v=Pu(e).filter(E=>E.path!==t).flatMap(E=>{const O=E.path.getScreenCTM();return O?nr(E.points.map(({x:$,y:I})=>new DOMPoint($,I).matrixTransform(O).matrixTransform(s))):[]}),M=T.length>0&&nr(T).every(E=>!k.some(O=>Br(E,O,8))&&!L.some(O=>Br(E,O,4))&&!v.some(({start:O,end:$})=>Br(E,{x:Math.min(O.x,$.x),y:Math.min(O.y,$.y),width:Math.abs($.x-O.x),height:Math.abs($.y-O.y)},6)));if(M&&(f=S),!M&&Math.abs(f-g)>1&&a.length>=7){const E=new DOMPoint(l.left+l.width/2,l.top-.25).matrixTransform(s),O=new DOMPoint(l.left+l.width/2,l.top-12).matrixTransform(s);a[0]={x:p.x,y:p.y},a[1].y=p.y,a[4]={x:a[3].x,y:O.y},a[5]={x:O.x,y:O.y},a[6]={x:E.x,y:E.y},t.dataset.feedbackTargetSide="top",t.dataset.manhattanPoints=a.map(({x:$,y:I})=>`${$},${I}`).join(" "),t.setAttribute("d",a.map(({x:$,y:I},F)=>`${F===0?"M":"L"}${$},${I}`).join("")),fo($i(e,t),t,a);return}const B=new DOMPoint(l.left+l.width/2,l.bottom+.25).matrixTransform(s);B.x=f,a[0]={x:p.x,y:p.y},a[1].y=p.y,a[a.length-2].x=B.x,a[a.length-1]={x:B.x,y:B.y},t.dataset.feedbackTargetSide="bottom",t.dataset.manhattanPoints=a.map(({x:E,y:O})=>`${E},${O}`).join(" "),t.setAttribute("d",a.map(({x:E,y:O},$)=>`${$===0?"M":"L"}${E},${O}`).join("")),fo($i(e,t),t,a)}function Mp(e){const t=[...e.querySelectorAll(".edgePaths path")].flatMap(i=>{if(i.dataset.clusterHeaderClearance||i.dataset.nestedDecisionRoute||i.dataset.decisionCycleRoute)return[];const o=vr(i),a=(i.dataset.manhattanPoints??"").trim().split(/\s+/).map(s=>s.split(",").map(Number)).filter(s=>s.length===2&&s.every(Number.isFinite)).map(([s,n])=>({x:s,y:n}));return o&&a.length>=2?[{path:i,points:a,...o}]:[]}),r=new Map;for(const i of t)r.set(i.source,[...r.get(i.source)??[],i]);for(const[i,o]of r){const a=o.length>=2&&ir(e,i),s=a&&Sr(a);if(!s)continue;const n=o.filter(({points:u})=>Math.abs(u[0].x-u[1].x)<.001);if(n.length<2)continue;const l=n.toSorted((u,f)=>{const g=ir(e,u.target),p=ir(e,f.target),m=g&&Sr(g),y=p&&Sr(p);return(m?.x??0)+(m?.width??0)/2-((y?.x??0)+(y?.width??0)/2)||(m?.y??0)+(m?.height??0)/2-((y?.y??0)+(y?.height??0)/2)||u.path.id.localeCompare(f.path.id)}),c=Math.min(_3,s.width*.4/(l.length-1)),d=s.x+s.width/2-c*(l.length-1)/2;l.forEach(({path:u,points:f},g)=>{const p={x:d+c*g,y:f[0].y},m=f.at(-1),y=mc(f,p,m,!0);u.dataset.fanoutPort=`${p.x},${p.y}`,u.dataset.manhattanPoints=y.map(({x,y:b})=>`${x},${b}`).join(" "),u.setAttribute("d",y.map(({x,y:b},S)=>`${S===0?"M":"L"}${x},${b}`).join(""))})}}function mc(e,t,r,i){if(e.length<2)return e;if(e.length===2){if(i&&Math.abs(t.x-r.x)>=.001){const s=(t.y+r.y)/2;return[t,{x:t.x,y:s},{x:r.x,y:s},r]}if(!i&&Math.abs(t.y-r.y)>=.001){const s=(t.x+r.x)/2;return[t,{x:s,y:t.y},{x:s,y:r.y},r]}return[t,r]}if(e.length===3){if(i&&Math.abs(t.x-r.x)>=.001){const s=(t.y+r.y)/2;return[t,{x:t.x,y:s},{x:r.x,y:s},r]}if(!i&&Math.abs(t.y-r.y)>=.001){const s=(t.x+r.x)/2;return[t,{x:s,y:t.y},{x:s,y:r.y},r]}return[t,r]}const o=e.map(s=>({...s}));return o[0]=t,o[o.length-1]=r,i?(o[1].x=t.x,o[o.length-2].x=r.x):(o[1].y=t.y,o[o.length-2].y=r.y),o.slice(1).some((s,n)=>{const l=o[n];return Math.abs(s.x-l.x)>=.001&&Math.abs(s.y-l.y)>=.001})?mc([t,r],t,r,i):o}function fo(e,t,r,i,o){if(!e?.textContent?.trim())return!0;if(r.length<2)return!1;const a=t.getScreenCTM(),s=e.parentElement?.getScreenCTM();if(!a||!s)return!1;const n=e.getBoundingClientRect(),l=kr(e,t);if(o&&!l)return!1;const c=new DOMPoint(n.left+n.width/2,n.top+n.height/2).matrixTransform(a.inverse()),h=e.getAttribute("transform");e.removeAttribute("transform");const d=e.getBBox();h&&e.setAttribute("transform",h);const u=[...t.ownerSVGElement?.querySelectorAll("g.edgeLabel")??[]].filter(x=>x!==e&&x.textContent?.trim()).map(x=>x.getBoundingClientRect()),f=[...t.ownerSVGElement?.querySelectorAll("g.node")??[]].map(x=>x.getBoundingClientRect()),g=(x,b)=>x.left<b.right+4&&x.right+4>b.left&&x.top<b.bottom+4&&x.bottom+4>b.top,m=r.slice(1).flatMap((x,b)=>{const S=r[b],T=Math.abs(S.y-x.y)<.001,k=Math.hypot(x.x-S.x,x.y-S.y),_=(T?d.width:d.height)+12;return k<_?[]:[.5,.35,.65,.2,.8].flatMap(L=>{if(k*Math.min(L,1-L)<_/2)return[];const v={x:S.x+(x.x-S.x)*L,y:S.y+(x.y-S.y)*L};if(o&&l){const O={x:v.x-l.width/2,y:v.y-l.height/2,width:l.width,height:l.height};if(o.obstacles.some($=>Ai(O,$,4))||o.occupied.some($=>Br($,O,4)))return[]}const M=new DOMPoint(v.x,v.y).matrixTransform(a),B=DOMRect.fromRect({x:M.x-n.width/2,y:M.y-n.height/2,width:n.width,height:n.height}),E=u.filter(O=>g(B,O)).length+f.filter(O=>g(B,O)).length;return[{start:S,end:x,center:v,preferred:b===i,collisions:E,distance:Math.hypot(v.x-c.x,v.y-c.y)}]})}).toSorted((x,b)=>Number(b.preferred)-Number(x.preferred)||x.collisions-b.collisions||x.distance-b.distance)[0];if(!m)return!1;const y=new DOMPoint(m.center.x,m.center.y).matrixTransform(a).matrixTransform(s.inverse());return e.setAttribute("transform",`translate(${y.x-d.x-d.width/2}, ${y.y-d.y-d.height/2})`),e.dataset.routePathId=t.id,e.dataset.finalPathCenter=`${m.center.x},${m.center.y}`,t.dataset.labelSegment=`${m.start.x},${m.start.y} ${m.end.x},${m.end.y}`,!0}function Tp(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const t=[...e.querySelectorAll(".edgePaths path")],r=[...e.querySelectorAll("g.node")].flatMap(o=>{const a=Je(o);return a?[{node:o,bounds:a.getBoundingClientRect()}]:[]}),i=new Map;for(const o of t){const a=vr(o);if(!a||a.source===a.target)continue;const s=[a.source,a.target].toSorted().join("\0");i.set(s,[...i.get(s)??[],o])}for(const o of t){if(o.dataset.feedbackLane||o.dataset.fanoutSource||o.dataset.groupedReturnLane||o.dataset.decisionBranch||o.dataset.decisionReturn||o.dataset.clientRequestLane||o.dataset.clusterHeaderClearance||o.dataset.compactGroupedRoute||o.dataset.decisionCycleRoute||o.dataset.nestedDecisionRoute)continue;const a=vr(o),s=a&&ir(e,a.source),n=a&&ir(e,a.target),l=s&&Je(s),c=n&&Je(n),h=o.getScreenCTM(),d=(o.dataset.manhattanPoints??"").trim().split(/\s+/).map(U=>U.split(",").map(Number)).filter(U=>U.length===2&&U.every(Number.isFinite)).map(([U,j])=>({x:U,y:j}));if(!l||!c||!h)continue;const u=l.getBoundingClientRect(),f=c.getBoundingClientRect(),g={x:u.x+u.width/2,y:u.y+u.height/2},p={x:f.x+f.width/2,y:f.y+f.height/2},m=f.top>=u.bottom||u.top>=f.bottom,y=f.left>=u.right||u.left>=f.right,x=m||!y&&Math.abs(p.y-g.y)>=Math.abs(p.x-g.x),b=p.y>=g.y,S=p.x>=g.x,T=Math.max(u.left,f.left),k=Math.min(u.right,f.right),_=Math.max(u.top,f.top),L=Math.min(u.bottom,f.bottom),v=T<=k?(T+k)/2:g.x,M=T<=k?v:p.x,B=_<=L?(_+L)/2:g.y,E=_<=L?B:p.y,O=x?{x:v,y:b?u.bottom:u.top}:{x:S?u.right:u.left,y:B},$=x?{x:M,y:b?f.top:f.bottom}:{x:S?f.left:f.right,y:E},I=h.inverse(),F=(U,j)=>{const V=new DOMPoint(U,j).matrixTransform(I);return{x:V.x,y:V.y}};let R=F(O.x,O.y),q=F($.x,$.y),D=null;if(a?.source===a?.target){const U=u.right+48;D=[F(u.right,u.top+u.height*.2),F(U,u.top+u.height*.2),F(U,u.top+u.height*.8),F(u.right,u.top+u.height*.8)],o.dataset.selfLoop="right"}else if(!o.dataset.compactFlowchart&&a){const U=[a.source,a.target].toSorted().join("\0"),j=i.get(U)??[],V=j.indexOf(o)-(j.length-1)/2;if(j.length>1){if(V===0&&x){const Q=(g.x+p.x)/2;D=[F(Q,b?u.bottom:u.top),F(Q,b?f.top:f.bottom)]}else if(V===0){const Q=(g.y+p.y)/2;D=[F(S?u.right:u.left,Q),F(S?f.left:f.right,Q)]}else if(x){const Q=24+(Math.ceil(Math.abs(V))-1)*16,rt=V<0,ht=Math.min(g.y,p.y),H=Math.max(g.y,p.y),G=r.filter(({node:vt,bounds:Ot})=>vt!==s&&vt!==n&&Ot.bottom>ht&&Ot.top<H),K=rt?Math.min(u.left,f.left,...G.map(({bounds:vt})=>vt.left))-Q:Math.max(u.right,f.right,...G.map(({bounds:vt})=>vt.right))+Q,tt=rt?u.left:u.right,ot=rt?f.left:f.right;D=[F(tt,g.y),F(K,g.y),F(K,p.y),F(ot,p.y)]}else{const Q=24+(Math.ceil(Math.abs(V))-1)*16,rt=V<0,ht=Math.min(g.x,p.x),H=Math.max(g.x,p.x),G=r.filter(({node:vt,bounds:Ot})=>vt!==s&&vt!==n&&Ot.right>ht&&Ot.left<H),K=rt?Math.min(u.top,f.top,...G.map(({bounds:vt})=>vt.top))-Q:Math.max(u.bottom,f.bottom,...G.map(({bounds:vt})=>vt.bottom))+Q,tt=rt?u.top:u.bottom,ot=rt?f.top:f.bottom;D=[F(g.x,tt),F(g.x,K),F(p.x,K),F(p.x,ot)]}o.dataset.parallelLane=V<0?"before":V>0?"after":"center"}}D&&(R=D[0],q=D[D.length-1]);const P=D??(d.length>=2?d:[R,q]),Y=P.slice(1).some((U,j)=>{const V=P[j];return Math.abs(U.x-V.x)>=.001&&Math.abs(U.y-V.y)>=.001}),X=D??mc(P,R,q,x),z=_r(X);Y&&(o.dataset.cardinalRepaired="true"),o.dataset.manhattanPoints=z.map(({x:U,y:j})=>`${U},${j}`).join(" "),o.setAttribute("d",z.map(({x:U,y:j},V)=>`${V===0?"M":"L"}${U},${j}`).join("")),o.dataset.compactFlowchart||fo($i(e,o),o,z)}}function $n(e,t,r,i){const o=Et(t,.5,.5),a=n=>!r.some(l=>Ai(n,l,4))&&!i.some(l=>Br(l,n,4));return nr(e).flatMap(({start:n,end:l})=>{const c=Math.abs(n.y-l.y)<.001,h=c?"x":"y",d=c?"y":"x",u=(c?t.width:t.height)/2,f=Math.min(n[h],l[h])+u+6,g=Math.max(n[h],l[h])-u-6;return f>g?[]:[o[h],(f+g)/2,f,g,f*.75+g*.25,f*.25+g*.75].flatMap(p=>{const m={[h]:Math.max(f,Math.min(g,p)),[d]:n[d]},y={...t,x:m.x-t.width/2,y:m.y-t.height/2};return a(y)?[{center:m,bounds:y,start:n,end:l,distance:Math.hypot(m.x-o.x,m.y-o.y)}]:[]})}).toSorted((n,l)=>n.distance-l.distance)[0]}function I1(e,t,r,i,o,a=[],s=[],n,l=!1,c=!1){if(e.length<2)return e;const h=v=>nr(v).some(M=>i.some(B=>Br(M,B,8))),d=v=>nr(v).some(M=>o.some(B=>vs(M,B))),u=v=>!n||$n(v,n.bounds,[t,r,...i,...n.obstacles],n.occupied);if(!c&&!h(e)&&!d(e)&&u(e))return e;const f=(v,M,B,E,O=!1)=>{const $=Fa(M,B),I=[{point:M,side:$}];for(const F of O?[]:["top","right","bottom","left"])for(const R of c?[.5,.25,.75,0,1]:[.5,.25,.75]){const q=F==="top"||F==="bottom"?Et(v,R,F==="top"?0:1):Et(v,F==="left"?0:1,R);if(F==="top"||F==="bottom"){const D=Math.min(v.width/2,v.corner?.x??0);q.x=Math.max(v.x+D,Math.min(v.x+v.width-D,q.x))}else{const D=Math.min(v.height/2,v.corner?.y??0);q.y=Math.max(v.y+D,Math.min(v.y+v.height-D,q.y))}E.every(D=>Math.hypot(D.x-q.x,D.y-q.y)>=(c?8:gi))&&I.push({point:q,side:F})}return I.map(F=>{const R={...F.point},q=Math.max(16,(n?.bounds.height??0)/2+(c?4:8)),D=Math.max(16,(n?.bounds.width??0)/2+(c?4:8));return F.side==="top"&&(R.y-=q),F.side==="bottom"&&(R.y+=q),F.side==="left"&&(R.x-=D),F.side==="right"&&(R.x+=D),{...F,lead:R}})},g=f(t,e[0],e[1],a,l),p=f(r,e.at(-1),e.at(-2),s),m=[t,r,...i,...o.map(({start:v,end:M})=>({x:Math.min(v.x,M.x),y:Math.min(v.y,M.y),width:Math.abs(v.x-M.x),height:Math.abs(v.y-M.y)}))],y=Math.max(16,(n?.bounds.width??0)/2+8),x=Math.max(16,(n?.bounds.height??0)/2+8),b=[Math.min(...m.map(v=>v.x))-y,Math.max(...m.map(v=>v.x+v.width))+y],S=[Math.min(...m.map(v=>v.y))-x,Math.max(...m.map(v=>v.y+v.height))+x];if(c){const v=(M,B)=>[...new Set(i.flatMap(E=>[E[M]-16,E[M]+E[B]+16]))].toSorted((E,O)=>Math.abs(E-t[M])-Math.abs(O-t[M])).slice(0,12);b.push(...v("x","width")),S.push(...v("y","height"))}const T=g.flatMap(v=>p.flatMap(M=>[[v.point,v.lead,{x:v.lead.x,y:M.lead.y},M.lead,M.point],[v.point,v.lead,{x:M.lead.x,y:v.lead.y},M.lead,M.point],...b.map(B=>[v.point,v.lead,{x:B,y:v.lead.y},{x:B,y:M.lead.y},M.lead,M.point]),...S.map(B=>[v.point,v.lead,{x:v.lead.x,y:B},{x:M.lead.x,y:B},M.lead,M.point])].map(_r))),k=v=>nr(v).reduce((M,B)=>M+Math.hypot(B.end.x-B.start.x,B.end.y-B.start.y),0);let _,L=1/0;for(const{candidate:v,length:M}of T.map(B=>({candidate:B,length:k(B)})).toSorted((B,E)=>B.length-E.length)){if(c&&(M>=k(e)-1||v.some(E=>E.y<Math.min(t.y,r.y)-x))||h(v)||!u(v)||nr(v).some(E=>Br(E,t)||Br(E,r)))continue;const B=nr(v).reduce((E,O)=>E+o.reduce(($,I)=>{const F={x:Math.min(I.start.x,I.end.x),y:Math.min(I.start.y,I.end.y),width:Math.abs(I.end.x-I.start.x),height:Math.abs(I.end.y-I.start.y)};return $+(vs(O,I)?100:Br(O,F,6)?1:0)},0),0);if(B<L&&(!c||B===0)&&(_=v,L=B),L===0)break}return _??e}function Pu(e){return[...e.querySelectorAll(".edgePaths path")].flatMap(t=>{const r=vr(t),i=(t.dataset.manhattanPoints??"").trim().split(/\s+/).map(o=>{const[a,s]=o.split(",").map(Number);return{x:a,y:s}});return r&&i.length>=2&&i.every(o=>Number.isFinite(o.x)&&Number.isFinite(o.y))?[{path:t,...r,points:i,label:$i(e,t)}]:[]})}function J3(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const t=Pu(e),r=t[0]?.path;if(!r)return;const i=new Map([...e.querySelectorAll("g.node")].flatMap(l=>{const c=Je(l),h=c&&rr(c,r);if(!c||!h)return[];const d=getComputedStyle(c),u=c.getBBox(),f=(p,m)=>(Number.parseFloat(p)||0)*(p.endsWith("%")?m/100:1),g={x:f(d.rx,u.width)*h.width/u.width,y:f(d.ry,u.height)*h.height/u.height};return[[zr(l),{bounds:{...h,corner:g},shape:c}]]})),o=new Map(t.flatMap(l=>{const c=l.label?.textContent?.trim()&&kr(l.label,r);return c?[[l,c]]:[]})),a=[...e.querySelectorAll("g.cluster > .cluster-label")].flatMap(l=>{const c=kr(l,r);return c?[c]:[]}),s=new Map,n=t.map(l=>{const c=i.get(l.source),h=i.get(l.target),d=!!(l.source===l.target||l.path.dataset.fanoutSource||l.path.dataset.feedbackLane||l.path.dataset.groupedReturnLane||l.path.dataset.decisionCycleRoute||l.path.dataset.nestedDecisionRoute||c?.shape.tagName.toLowerCase()!=="rect"||h?.shape.tagName.toLowerCase()!=="rect");return{route:l,source:c,target:h,fixed:d}}).sort((l,c)=>Number(c.fixed)-Number(l.fixed));for(const{route:l,source:c,target:h,fixed:d}of n){const u=t.filter(T=>T!==l),f=T=>u.flatMap(k=>[...k.source===T?[k.points[0]]:[],...k.target===T?[k.points.at(-1)]:[]]),g=u.filter(T=>T.source!==l.source||T.target===l.target).flatMap(T=>nr(T.points)),p=[...i].filter(([T])=>T!==l.source&&T!==l.target).map(([,T])=>T.bounds).concat(a,[...o].filter(([T])=>T!==l).map(([,T])=>T)),m=o.get(l),y=(T,k=!1)=>!d&&c&&h?I1(T,c.bounds,h.bounds,p,g,f(l.source),f(l.target),m?{bounds:m,obstacles:[...o].filter(([_])=>_!==l).map(([,_])=>_),occupied:u.flatMap(_=>nr(_.points))}:void 0,!!l.path.dataset.fanoutPort&&u.some(_=>_.source===l.source&&_.target!==l.target),k):T,x=e$(e,l.path,c?.bounds,h?.bounds),b=x?[Et(c.bounds,1,.5),{x:x.x,y:c.bounds.y+c.bounds.height/2},{x:x.x,y:h.bounds.y+h.bounds.height/2},Et(h.bounds,1,.5)]:l.points;let S=y(b);if(!d&&!x&&S.length>4&&(S=y(S,!0)),!d&&!x&&!e.querySelector("g.cluster")&&(S=t$(S,u.filter(T=>T.path.dataset.feedbackLane).flatMap(T=>nr(T.points)),p)),!d&&c&&h&&h.bounds.y>c.bounds.y&&u.some(T=>T.path.dataset.feedbackLane&&T.target===l.source&&nr(S).some(k=>nr(T.points).some(({start:_,end:L})=>Br(k,{x:Math.min(_.x,L.x),y:Math.min(_.y,L.y),width:Math.abs(L.x-_.x),height:Math.abs(L.y-_.y)}))))&&(S=y(S,!0)),m){const T=$n(S,m,[...[c,h].flatMap(k=>k?[k.bounds]:[]),...p],u.flatMap(k=>nr(k.points)));T&&(o.set(l,T.bounds),s.set(l.path.id,T.center))}S!==l.points&&(l.points=S,l.path.dataset.manhattanPoints=S.map(({x:T,y:k})=>`${T},${k}`).join(" "),l.path.setAttribute("d",S.map(({x:T,y:k},_)=>`${_?"L":"M"}${T},${k}`).join("")))}for(const l of t.filter(c=>c.path.dataset.feedbackLane==="outer")){const h=t.filter(u=>u!==l).flatMap(u=>nr(u.points).map(({start:f,end:g})=>({x:Math.min(f.x,g.x),y:Math.min(f.y,g.y),width:Math.abs(g.x-f.x),height:Math.abs(g.y-f.y)})));h.push(...[...o].filter(([u])=>u!==l).map(([,u])=>u));const d=D3(l.points,h);d!==l.points&&(l.path.dataset.manhattanPoints=d.map(({x:u,y:f})=>`${u},${f}`).join(" "),l.path.setAttribute("d",d.map(({x:u,y:f},g)=>`${g?"L":"M"}${u},${f}`).join("")),s.delete(l.path.id))}return s}function t$(e,t,r){for(let i=1;i<e.length-2;i++){const o=e[i],a=e[i+1];if(Math.abs(o.x-a.x)>.001||Math.abs(o.y-a.y)<32)continue;const s=t.filter(l=>Math.abs(l.start.x-l.end.x)<.001&&Math.abs(l.start.x-o.x)<20&&Math.abs(l.start.x-o.x)>.001&&Math.min(Math.max(o.y,a.y),Math.max(l.start.y,l.end.y))-Math.max(Math.min(o.y,a.y),Math.min(l.start.y,l.end.y))>20);if(!s.length)continue;const n=s.flatMap(l=>[l.start.x-20,l.start.x+20]).filter(l=>Math.abs(l-o.x)<=20).toSorted((l,c)=>Math.abs(l-o.x)-Math.abs(c-o.x));for(const l of n){const c=e.map((d,u)=>u===i||u===i+1?{...d,x:l}:d),h=nr(c).slice(i-1,i+2);if(!(s.some(d=>Math.abs(d.start.x-l)<19.99)||h.some(d=>r.some(u=>Br(d,u,4)))))return c}}return e}function e$(e,t,r,i){if(!r||!i||t.dataset.nestedDecisionRoute)return null;const o=(l,c)=>c.x>=l.x-.5&&c.x+c.width<=l.x+l.width+.5&&c.y>=l.y-.5&&c.y+c.height<=l.y+l.height+.5,a=[...e.querySelectorAll("g.cluster > rect")].flatMap(l=>{const c=rr(l,t);return c?[c]:[]}),s=a.filter(l=>o(l,i)&&!o(l,r)).toSorted((l,c)=>l.width*l.height-c.width*c.height)[0],n=s&&a.filter(l=>l!==s&&o(l,s)&&o(l,r)).toSorted((l,c)=>l.width*l.height-c.width*c.height)[0];return!s||!n||r.y+r.height>s.y?null:{x:(s.x+s.width+n.x+n.width)/2}}function r$(e,t){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const r=Pu(e),i=r[0]?.path;if(!i)return;const o=[...e.querySelectorAll("g.node, g.cluster > .cluster-label")].flatMap(s=>{const n=kr(s,i);return n?[n]:[]}),a=r.flatMap(s=>{const n=s.label;if(!n?.textContent?.trim())return[];const l=kr(n,i),c=t?.get(s.path.id);l&&c&&(l.x=c.x-l.width/2,l.y=c.y-l.height/2);const h=i.getScreenCTM(),d=n.parentElement?.getScreenCTM(),u=n.getBBox();return l&&h&&d?[{route:s,label:n,current:l,matrix:h,inverse:d.inverse(),local:u}]:[]});for(const s of a){const{route:n,label:l,current:c,matrix:h,inverse:d,local:u}=s,f=r.filter(m=>m!==n).flatMap(m=>nr(m.points)),g=$n(n.points,c,[...o,...a.filter(m=>m!==s).map(m=>m.current)],f);if(!g)continue;const p=new DOMPoint(g.center.x,g.center.y).matrixTransform(h).matrixTransform(d);l.setAttribute("transform",`translate(${p.x-u.x-u.width/2},${p.y-u.y-u.height/2})`),l.dataset.labelSegmentStart=`${g.start.x},${g.start.y}`,l.dataset.labelSegmentEnd=`${g.end.x},${g.end.y}`,s.current=g.bounds}}function i$(e,t,r,i,o=[],a=[],s=[],n=8){if({top:"bottom",right:"left",bottom:"top",left:"right"}[t.side]!==r.side)return e;const c=t.side==="left"||t.side==="right",h=c?"y":"x",d=c?"x":"y",u=t.side==="right"||t.side==="bottom"?1:-1;if((r.point[d]-t.point[d])*u<=0)return e;const f=t.range??[t.point[h],t.point[h]],g=r.range??[r.point[h],r.point[h]],p=Math.max(f[0],g[0]),m=Math.min(f[1],g[1]);if(p>m)return e;const y=b=>Math.max(p,Math.min(m,b)),x=[...new Set([y(t.point[h]),y(r.point[h]),p,m,(p+m)/2,...[...a,...s].flatMap(b=>[b[h]-gi,b[h]+gi]),...i.flatMap(b=>[b[h]-n,b[h]+(c?b.height:b.width)+n]),...o.flatMap(b=>[Math.min(b.start[h],b.end[h])-n,Math.max(b.start[h],b.end[h])+n])])].filter(b=>b>=p&&b<=m).toSorted((b,S)=>Math.abs(b-t.point[h])+Math.abs(b-r.point[h])-Math.abs(S-t.point[h])-Math.abs(S-r.point[h]));for(const b of x){const S={...t.point,[h]:b},T={...r.point,[h]:b};if(a.some(_=>Math.hypot(S.x-_.x,S.y-_.y)<gi-.001)||s.some(_=>Math.hypot(T.x-_.x,T.y-_.y)<gi-.001))continue;const k={start:S,end:T};if(!i.some(_=>Br(k,_,n))&&!o.some(_=>Br(k,{x:Math.min(_.start.x,_.end.x),y:Math.min(_.start.y,_.end.y),width:Math.abs(_.start.x-_.end.x),height:Math.abs(_.start.y-_.end.y)},n)))return[S,T]}return e}function Fa(e,t){const r=t.x-e.x,i=t.y-e.y;return Math.abs(r)>=Math.abs(i)?r>=0?"right":"left":i>=0?"bottom":"top"}function o$(e,t,r,i,o){const a=s=>nr(s).reduce((n,{start:l,end:c})=>n+Math.hypot(c.x-l.x,c.y-l.y),0);return t.map(_r).filter(s=>s.length<=e.length&&a(s)<a(e)-1).filter(s=>nr(s).every(n=>!r.some(l=>Br(n,l,8))&&!i.some(({start:l,end:c})=>Br(n,{x:Math.min(l.x,c.x),y:Math.min(l.y,c.y),width:Math.abs(c.x-l.x),height:Math.abs(c.y-l.y)},8)))).filter(s=>!o||$n(s,o.bounds,[...r,...o.obstacles],i)).sort((s,n)=>a(s)-a(n))[0]??e}function a$(e,t){const r=t.map(i=>({...i,points:(i.path.dataset.manhattanPoints??"").split(" ").map(o=>{const[a,s]=o.split(",").map(Number);return{x:a,y:s}})})).filter(({points:i})=>i.length>=2&&i.every(({x:o,y:a})=>Number.isFinite(o)&&Number.isFinite(a)));for(const i of r){if(i.source===i.target||i.points.length===2)continue;const{path:o,points:a}=i,s=y=>{const x=ir(e,i[y]),b=x&&Je(x),S=b&&rr(b,o);if(!b||!S)return;const T=y==="source"?a[0]:a[a.length-1],k=y==="source"?a[1]:a[a.length-2],_=Fa(T,k),L=_==="left"||_==="right",v=Math.max(8,Number(b.getAttribute(L?"ry":"rx"))||0),M=b.tagName.toLowerCase()==="rect"?L?[S.y+v,S.y+S.height-v]:[S.x+v,S.x+S.width-v]:void 0;return{point:T,side:_,range:M}},n=s("source"),l=s("target");if(!n||!l)continue;const c=r.filter(y=>y!==i),h=y=>c.flatMap(x=>[...x.source===y?[x.points[0]]:[],...x.target===y?[x.points[x.points.length-1]]:[]]),d=(y,x)=>x.x>=y.x&&x.x<=y.x+y.width&&x.y>=y.y&&x.y<=y.y+y.height,u=[...[...e.querySelectorAll("g.node")].filter(y=>![i.source,i.target].includes(zr(y))),...e.querySelectorAll("g.cluster > .cluster-label"),...[...e.querySelectorAll(".edgeLabels > .edgeLabel")].filter(y=>y!==i.label&&y.textContent?.trim())].map(y=>kr(y,o)).filter(y=>!!y);for(const y of e.querySelectorAll("g.cluster > rect")){const x=rr(y,o);x&&!d(x,n.point)&&!d(x,l.point)&&u.push(x)}const f=c.flatMap(y=>nr(y.points));let g=i$(a,n,l,u,f,h(i.source),h(i.target));if(g===a&&o.dataset.nestedDecisionRoute==="secondary-retry"){const y=ir(e,i.source),x=ir(e,i.target),b=y&&Je(y),S=x&&Je(x),T=b&&rr(b,o),k=S&&rr(S,o);if(b?.tagName.toLowerCase()==="rect"&&S&&aa(S)&&T&&k){const _=Et(T,.5,0),L=[];if(l.side==="bottom"&&_.y>k.y+k.height+8&&_.x>l.point.x){const O=(_.y+k.y+k.height)/2;L.push([_,{x:_.x,y:O},{x:l.point.x,y:O},l.point])}const v=Qr(k,"left",24);_.x<v.x&&_.y>v.y&&L.push([_,{x:_.x,y:v.y},v]);const M=Qr(k,"right",k.height*.32);_.x>M.x&&_.y>M.y&&L.push([_,{x:_.x,y:M.y},M]);const B=L.filter(O=>!h(i.source).some($=>Math.hypot($.x-_.x,$.y-_.y)<gi)&&!h(i.target).some($=>Math.hypot($.x-O.at(-1).x,$.y-O.at(-1).y)<gi)),E=i.label&&kr(i.label,o);g=o$(a,B,u,f,E?{bounds:E,obstacles:[T,k]}:void 0)}}if(g===a||!fo(i.label,o,g,void 0,{obstacles:u,occupied:f}))continue;i.points=g,o.dataset.manhattanPoints=g.map(({x:y,y:x})=>`${y},${x}`).join(" "),o.dataset.manhattanSegments=String(g.length-1);const p=g.at(-1),m=g.at(-2);o.dataset.terminalDirection=`${p.x-m.x},${p.y-m.y}`,o.dataset.nestedDecisionRoute==="secondary-retry"&&(o.dataset.diamondTargetSide=Fa(p,m)),o.setAttribute("d",g.map(({x:y,y:x},b)=>`${b?"L":"M"}${y},${x}`).join(""))}}function O1(e,t,r){const i=e.map(o=>({...o}));if(t){const o=i[1],a=i[0];i[0]=t.point;const s=t.side==="top"||t.side==="bottom";if(i.length>2&&(s&&Math.abs(a.x-o.x)<.001?o.x=t.point.x:!s&&Math.abs(a.y-o.y)<.001&&(o.y=t.point.y)),!(s?Math.abs(o.x-t.point.x)<.001:Math.abs(o.y-t.point.y)<.001))if(t.lead){const l=s?{x:o.x,y:t.lead.y}:{x:t.lead.x,y:o.y};i.splice(1,0,t.lead,l)}else{const l=s?{x:t.point.x,y:o.y}:{x:o.x,y:t.point.y};i.splice(1,0,l)}}if(r){const o=i[i.length-2],a=i[i.length-1];i[i.length-1]=r.point;const s=r.side==="top"||r.side==="bottom";if(i.length>2&&(s&&Math.abs(a.x-o.x)<.001?o.x=r.point.x:!s&&Math.abs(a.y-o.y)<.001&&(o.y=r.point.y)),!(s?Math.abs(o.x-r.point.x)<.001:Math.abs(o.y-r.point.y)<.001))if(r.lead){const l=s?{x:o.x,y:r.lead.y}:{x:r.lead.x,y:o.y};i.splice(i.length-1,0,l,r.lead)}else{const l=s?{x:r.point.x,y:o.y}:{x:o.x,y:r.point.y};i.splice(i.length-1,0,l)}}return _r(i)}function Qr(e,t,r=0){const i=Et(e,.5,.5),o=e.width/2,a=e.height/2;if(t==="top"||t==="bottom"){const l=Math.max(-o*.7,Math.min(o*.7,r)),c=a*(1-Math.abs(l)/o);return{x:i.x+l,y:i.y+(t==="top"?-c:c)}}const s=Math.max(-a*.7,Math.min(a*.7,r)),n=o*(1-Math.abs(s)/a);return{x:i.x+(t==="left"?-n:n),y:i.y+s}}function s$(e,t,r=0){const i=Qr(e,t,r),o={...i};return t==="top"?o.y-=12:t==="right"?o.x+=12:t==="bottom"?o.y+=12:o.x-=12,{point:i,side:t,lead:o}}function n$(e,t){const r=new Map(t.map(s=>[s,vr(s)])),i=[];for(const s of t){const n=r.get(s),l=(s.dataset.manhattanPoints??"").trim().split(/\s+/).map(f=>f.split(",").map(Number)).filter(f=>f.length===2&&f.every(Number.isFinite)).map(([f,g])=>({x:f,y:g}));if(!n||l.length<2)continue;const c=ir(e,n.source),h=c&&Je(c);if(h&&aa(h)){const f=rr(h,s);if(f){const g=Fa(Et(f,.5,.5),l[1]);i.push({path:s,role:"source",nodeId:n.source,bounds:f,side:g,adjacent:l[1]})}}const d=ir(e,n.target),u=d&&Je(d);if(u&&aa(u)){const f=rr(u,s);if(f){const g=t.some(m=>{const y=r.get(m);return m!==s&&y?.source===n.target&&y.target===n.source}),p=s.dataset.decisionReturn&&s.dataset.compactFlowchart==="true"?"left":s.dataset.decisionReturn||g?"bottom":Fa(Et(f,.5,.5),l[l.length-2]);i.push({path:s,role:"target",nodeId:n.target,bounds:f,side:p,adjacent:l[l.length-2]})}}}const o=new Map;for(const s of i){const n=`${s.nodeId}\0${s.side}`;o.set(n,[...o.get(n)??[],s])}const a=new Map;for(const s of o.values()){const n=s[0].side,l=n==="top"||n==="bottom",c=s.toSorted((u,f)=>(l?u.adjacent.x-f.adjacent.x:u.adjacent.y-f.adjacent.y)||u.path.id.localeCompare(f.path.id)||u.role.localeCompare(f.role)),h=(l?s[0].bounds.width:s[0].bounds.height)*.5,d=Math.min(gi,h/Math.max(1,s.length-1));c.forEach((u,f)=>{const g=s.length===1?0:(f-(s.length-1)/2)*d,p=a.get(u.path)??{};p[u.role]=s$(u.bounds,n,g),a.set(u.path,p)})}return a}function l$(e){const t=new Map;for(const i of e.querySelectorAll(".edgePaths path")){if(i.dataset.feedbackLane||i.dataset.groupedReturnLane||i.dataset.clientRequestLane||i.dataset.compactGroupedRoute||i.dataset.decisionCycleRoute||i.dataset.nestedDecisionRoute)continue;const o=vr(i),a=(i.dataset.manhattanPoints??"").trim().split(/\s+/).map(s=>s.split(",").map(Number)).filter(s=>s.length===2&&s.every(Number.isFinite)).map(([s,n])=>({x:s,y:n}));if(!(!o||a.length<2))for(const s of["source","target"]){if(s==="source"&&i.dataset.fanoutSource)continue;const n=o[s],l=ir(e,n),c=l&&Je(l),h=c&&rr(c,i);if(!c||!h||aa(c))continue;const d=s==="source"?a[0]:a[a.length-1],f=[["top",Math.abs(d.y-h.y)],["right",Math.abs(d.x-h.x-h.width)],["bottom",Math.abs(d.y-h.y-h.height)],["left",Math.abs(d.x-h.x)]].toSorted((p,m)=>p[1]-m[1])[0][0],g=`${n}\0${f}`;t.set(g,[...t.get(g)??[],{path:i,role:s,side:f,bounds:h,endpoint:d}])}}const r=new Map;for(const i of t.values()){if(i.length<2)continue;const o=i[0].side,a=o==="top"||o==="bottom",s=i.toSorted((c,h)=>(a?c.endpoint.x-h.endpoint.x:c.endpoint.y-h.endpoint.y)||c.path.id.localeCompare(h.path.id)||c.role.localeCompare(h.role)),n=(a?i[0].bounds.width:i[0].bounds.height)*.6,l=Math.min(gi,n/Math.max(1,i.length-1));s.forEach((c,h)=>{const d=(h-(i.length-1)/2)*l,u=Yi(c.bounds,o),f=a?{x:u.x+d,y:u.y}:{x:u.x,y:u.y+d},g=r.get(c.path)??{};g[c.role]={point:f,side:o},r.set(c.path,g)})}for(const[i,o]of r){const a=(i.dataset.manhattanPoints??"").trim().split(/\s+/).map(n=>n.split(",").map(Number)).filter(n=>n.length===2&&n.every(Number.isFinite)).map(([n,l])=>({x:n,y:l}));if(a.length<2)continue;const s=O1(a,o.source,o.target);i.dataset.manhattanPoints=s.map(({x:n,y:l})=>`${n},${l}`).join(" "),o.source&&(i.dataset.crowdedSourcePort=`${o.source.point.x},${o.source.point.y}`),o.target&&(i.dataset.crowdedTargetPort=`${o.target.point.x},${o.target.point.y}`),i.setAttribute("d",s.map(({x:n,y:l},c)=>`${c===0?"M":"L"}${n},${l}`).join(""))}}function c$(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;l$(e);const t=[...e.querySelectorAll(".edgePaths path")],r=n$(e,t);for(const i of t){if(i.dataset.nestedDecisionRoute||i.dataset.decisionCycleRoute)continue;const o=vr(i),a=o&&ir(e,o.source),s=o&&ir(e,o.target),n=a&&Je(a),l=s&&Je(s),c=(i.dataset.manhattanPoints??"").trim().split(/\s+/).map(m=>m.split(",").map(Number)).filter(m=>m.length===2&&m.every(Number.isFinite)).map(([m,y])=>({x:m,y}));if(c.length<2)continue;let h,d;const u=$i(e,i)?.textContent?.trim().toLocaleLowerCase();if(n&&aa(n)){const m=rr(n,i),y=r.get(i)?.source;if(m&&y){const x=Et(m,.5,.5),b=Fa(x,c[1]),{side:S}=y;if(u==="no"&&b!==S&&c.length>2){const k=c.slice(1).map((_,L)=>({index:L,length:Math.abs(c[L].y-_.y)<.001?Math.abs(c[L].x-_.x):0})).toSorted((_,L)=>L.length-_.length)[0];if(k?.length){const _=(c[k.index].y>=x.y?1:-1)*gi;c[k.index].y+=_,c[k.index+1].y+=_,i.dataset.decisionLane=String(c[k.index].y)}}const{point:T}=y;h=y,i.dataset.diamondSourcePort=`${T.x},${T.y}`,i.dataset.diamondSourceSide=S,i.dataset.decisionBranch&&(i.dataset.decisionPort=`${T.x},${T.y}`)}}if(l&&aa(l)){const m=r.get(i)?.target;if(m){const{side:y}=m,{point:x}=m;d=m,s&&(i.dataset.diamondTargetPort=`${x.x},${x.y}`,i.dataset.diamondTargetSide=y,i.dataset.terminalTarget=s.id)}}const f=O1(c,h,d),g=f[f.length-2],p=f[f.length-1];d&&(i.dataset.terminalDirection=`${p.x-g.x},${p.y-g.y}`),i.dataset.manhattanPoints=f.map(({x:m,y})=>`${m},${y}`).join(" "),i.dataset.manhattanSegments=String(f.length-1),i.setAttribute("d",f.map(({x:m,y},x)=>`${x===0?"M":"L"}${m},${y}`).join("")),i.dataset.compactFlowchart||fo($i(e,i),i,f)}}function h$(e,t,r,i){const a=Yi(e,"right");if(t.length!==2||[e,...t.map(({bounds:d})=>d),...r,...i].some(d=>!Object.values(d).every(Number.isFinite)||d.width<0||d.height<0)||t.some(({bounds:d,port:u})=>!Number.isFinite(u.x)||!Number.isFinite(u.y)||d.y<e.y+e.height+32||!(Math.abs(u.x-d.x)<.001&&Math.abs(u.y-d.y-d.height/2)<.001)&&(u.x<=a.x+16||Math.abs(u.y-d.y)>.001||u.x<d.x+8||u.x>d.x+d.width-8)))return null;const s={x:a.x+16,y:a.y},n=[];for(const{bounds:d,port:u,tail:f}of t){const m=(Math.abs(u.x-d.x)<.001?[[a,s,{x:s.x,y:e.y+e.height+16},{x:d.x-16,y:e.y+e.height+16},{x:d.x-16,y:u.y},u]]:[...f?.length===2&&Math.abs(f[0].x-u.x)<.001&&f[0].y>=e.y+e.height+8&&f[0].y<=d.y-16?[[a,s,{x:s.x,y:f[0].y},f[0],u]]:[],[a,s,{x:s.x,y:d.y-32},{x:u.x,y:d.y-32},u]]).map(_r).find(y=>nr(y).every((x,b)=>Math.abs(x.start.x-x.end.x)>=.001&&Math.abs(x.start.y-x.end.y)>=.001?!1:![...r,...i].some(S=>Br(x,S,8))&&!Br(x,e,b===0?0:8)&&!t.some(({bounds:S})=>Br(x,S,S===d&&b===y.length-2?0:8))));if(!m)return null;n.push(m)}const[l,c]=n.map(nr);let h=0;for(;h<Math.min(l.length,c.length);){const d=l[h],u=c[h];if(Math.hypot(d.start.x-u.start.x,d.start.y-u.start.y)>.001)break;if(Math.hypot(d.end.x-u.end.x,d.end.y-u.end.y)>.001){vs(d,u)&&((Math.hypot(d.end.x-d.start.x,d.end.y-d.start.y)<Math.hypot(u.end.x-u.start.x,u.end.y-u.start.y)?d:u)===d?c[h]={start:d.end,end:u.end}:l[h]={start:u.end,end:d.end});break}h++}for(const d of l.slice(h))for(const u of c.slice(h)){if(vs(d,u))return null;const f=Math.abs(d.start.y-d.end.y)<.001,g=Math.abs(u.start.y-u.end.y)<.001;if(f===g)continue;const p=f?d:u,m=f?u:d;if(m.start.x>Math.min(p.start.x,p.end.x)+.001&&m.start.x<Math.max(p.start.x,p.end.x)-.001&&p.start.y>Math.min(m.start.y,m.end.y)+.001&&p.start.y<Math.max(m.start.y,m.end.y)-.001)return null}return n}function d$(e,t,r){if(r.length!==2||e.querySelector("g.cluster")||r.some(({path:y})=>y.dataset.compactFlowchart||y.dataset.feedbackLane))return;const i=r[0].path,o=i.getScreenCTM();if(!o||o.a<=0||o.d<=0||Math.abs(o.b)>.001||Math.abs(o.c)>.001)return;const a=o.inverse(),s=[...e.querySelectorAll("g.node")].map(y=>{const x=Je(y);return{id:zr(y),shape:x,bounds:x&&rr(x,i)}});if(s.some(({bounds:y})=>!y)||new Set(s.map(({id:y})=>y)).size!==s.length)return;const n=s.find(({id:y})=>y===t);if(!n?.bounds||n.shape?.tagName.toLowerCase()!=="rect")return;const c=[...e.querySelectorAll(".edgePaths path")].filter(y=>!r.some(x=>x.path===y)).map(y=>{const x=y.getScreenCTM(),b=y.getTotalLength();if(!x||!b||!Number.isFinite(b)||b>16384)return null;const S=Math.ceil(b/2);return{path:y,points:Array.from({length:S+1},(T,k)=>y.getPointAtLength(b*k/S).matrixTransform(x).matrixTransform(a))}});if(c.some(y=>!y))return;const h=c.flatMap(y=>nr(y.points).map(({start:x,end:b})=>({x:Math.min(x.x,b.x),y:Math.min(x.y,b.y),width:Math.abs(b.x-x.x),height:Math.abs(b.y-x.y)}))),d=r.map(({path:y,target:x})=>{const b=s.find(({id:B})=>B===x),S=y.getScreenCTM();if(!b?.bounds||b.shape?.tagName.toLowerCase()!=="rect"||!S||["a","b","c","d","e","f"].some(B=>Math.abs(S[B]-o[B])>.001))return null;const T=b.bounds,k=c.filter(B=>vr(B.path)?.target===x);if(k.length>1||k.length&&T.width*.6<gi||k.some(B=>{const E=B.points.at(-1);return Math.abs(E.y-T.y)>8||E.x<T.x+T.width/2}))return null;const _=T.x<=n.bounds.x+n.bounds.width+16?Yi(T,"left"):{x:T.x+T.width/2-(k.length?gi/2:0),y:T.y},L=y.dataset.manhattanPoints?.split(" ").map((B,E)=>`${E?"L":"M"}${B}`).join(""),M=$u(L??y.getAttribute("d")??"")?.slice(-2);return{bounds:T,port:_,tail:M&&Math.abs(M[0].x-_.x)<.001&&Math.abs(M[1].y-_.y)<.001?[M[0],_]:void 0}});if(d.some(y=>!y))return;const u=r.map(({path:y})=>$i(e,y)),f=[...e.querySelectorAll(".edgeLabels > .edgeLabel")].filter(y=>y.textContent?.trim()&&!u.includes(y)).map(y=>kr(y,i));if(f.some(y=>!y))return;const g=[...s.filter(y=>y!==n&&!d.some(x=>x.bounds===y.bounds)).map(y=>y.bounds),...f],p=h$(n.bounds,d,g,h);if(!p)return;const m=[];for(const[y,x]of u.entries()){if(!x?.textContent?.trim())continue;const b=kr(x,i),S=x.parentElement?.getScreenCTM();if(!b||!S)return;const T=nr(p[y]).find(v=>{const M={x:(v.start.x+v.end.x)/2,y:(v.start.y+v.end.y)/2},B={x:M.x-b.width/2,y:M.y-b.height/2,width:b.width,height:b.height},E=Math.abs(v.start.y-v.end.y)<.001;return Math.hypot(v.end.x-v.start.x,v.end.y-v.start.y)>=(E?b.width:b.height)+16&&![...s.map(O=>O.bounds),...f,...h,...m.map(O=>O.bounds)].some(O=>Ai(B,O,8))&&!p.filter((O,$)=>$!==y).some(O=>nr(O).some($=>Br($,B,8)))});if(!T)return;const k={x:(T.start.x+T.end.x)/2,y:(T.start.y+T.end.y)/2},_=x.getBBox(),L=new DOMPoint(k.x,k.y).matrixTransform(o).matrixTransform(S.inverse());m.push({label:x,center:k,segment:T,bounds:{x:k.x-b.width/2,y:k.y-b.height/2,width:b.width,height:b.height},transform:`translate(${L.x-_.x-_.width/2}, ${L.y-_.y-_.height/2})`})}p.forEach((y,x)=>{const{path:b,target:S}=r[x];b.setAttribute("d",y.map(({x:T,y:k},_)=>`${_?"L":"M"}${T},${k}`).join("")),delete b.dataset.terminalGapBasePath,b.dataset.fanoutSource=t,b.dataset.fanoutTarget=S,b.dataset.fanoutTrunk=y.slice(0,2).map(({x:T,y:k})=>`${T},${k}`).join(" "),b.dataset.manhattanPoints=y.map(({x:T,y:k})=>`${T},${k}`).join(" ")}),m.forEach(({label:y,transform:x,center:b,segment:S})=>{y.setAttribute("transform",x);const T=r[u.indexOf(y)].path;y.dataset.routePathId=T.id,y.dataset.finalPathCenter=`${b.x},${b.y}`,T.dataset.labelSegment=`${S.start.x},${S.start.y} ${S.end.x},${S.end.y}`})}function Bp(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const t=[...e.querySelectorAll(".edgePaths path")].flatMap(i=>{const o=vr(i);return o?[{path:i,...o}]:[]}),r=new Map;for(const i of t)r.set(i.source,[...r.get(i.source)??[],i]);for(const[i,o]of r){if(o.length<2)continue;const a=ir(e,i);if(!a||a.querySelector(":scope > polygon.label-container"))continue;const s=o.flatMap(f=>{const g=Sr(a),p=ir(e,f.target),m=p&&Sr(p);return g&&m?[{...f,targetId:f.target,source:g,target:m}]:[]});if(s.length!==o.length||new Set(s.map(({targetId:f})=>f)).size!==s.length)continue;const n=s[0].source.x+s[0].source.width,l=s[0].source.y+s[0].source.height;if(s.length===3&&s.every(f=>f.target.y>=l+16)&&Math.max(...s.map(f=>f.target.y))-Math.min(...s.map(f=>f.target.y))<=8){const f=s.toSorted((y,x)=>y.target.x+y.target.width/2-(x.target.x+x.target.width/2)),g=f[0].source,p=g.y+g.height/2,m=[{x:g.x,y:p},{x:g.x+g.width/2,y:l},{x:n,y:p}];f.forEach((y,x)=>{const b=m[x],S=x===0?{x:b.x-16,y:b.y}:x===1?{x:b.x,y:b.y+16}:{x:b.x+16,y:b.y},T=y.target.x+y.target.width/2,k=y.target.y,_=k-16,L=[S,{x:S.x,y:_},{x:T,y:_}];L.unshift(b),L.push({x:T,y:k}),y.path.setAttribute("d",L.map((v,M)=>`${M?"L":"M"}${v.x},${v.y}`).join("")),y.path.dataset.fanoutSource=i,y.path.dataset.fanoutTarget=y.targetId,y.path.dataset.fanoutPort=`${b.x},${b.y}`,y.path.dataset.fanoutTrunk=`${b.x},${b.y} ${S.x},${S.y}`,y.path.dataset.manhattanPoints=L.map(v=>`${v.x},${v.y}`).join(" "),fo($i(e,y.path),y.path,L)});continue}if(s.some(f=>f.target.x<=n+16)){d$(e,i,o);continue}const h=Math.min(...s.map(f=>f.target.x)),d=n+Math.min(36,Math.max(16,(h-n)/2)),u=s[0].source.y+s[0].source.height/2;for(const f of s){const g=f.target.y+f.target.height/2,p=[{x:n,y:u},{x:d,y:u},{x:d,y:g},{x:f.target.x,y:g}];f.path.setAttribute("d",p.map((m,y)=>`${y?"L":"M"}${m.x},${m.y}`).join("")),f.path.dataset.fanoutSource=i,f.path.dataset.fanoutTarget=f.targetId,f.path.dataset.fanoutTrunk=`${n},${u} ${d},${u}`,f.path.dataset.manhattanPoints=p.map(m=>`${m.x},${m.y}`).join(" ")}}}function u$(e,t,r,i){if(!e.textContent?.trim())return;const o=e.getAttribute("transform");e.removeAttribute("transform");const a=e.getBBox();o&&e.setAttribute("transform",o);const s=t.getCTM(),n=e.parentElement?.getCTM();if(!s||!n)return;const l={x:r.x+(i.x-r.x)*.55,y:r.y+(i.y-r.y)*.55},c=new DOMPoint(l.x,l.y).matrixTransform(s).matrixTransform(n.inverse());e.setAttribute("transform",`translate(${c.x-a.x-a.width/2}, ${c.y-a.y-a.height/2})`),e.dataset.finalPathCenter=`${l.x},${l.y}`,e.dataset.routePathId=t.id,t.dataset.labelSegment=`${r.x},${r.y} ${i.x},${i.y}`}function D1(e,t,r){const i=Je(e),o=i&&rr(i,r),a=e.transform.baseVal.consolidate()?.matrix;!o||!a||(e.style.setProperty("transition-property","none","important"),e.setAttribute("transform",`translate(${a.e+t.x-o.x-o.width/2}, ${a.f+t.y-o.y-o.height/2})`))}function f$(e,t){const r=new Map;for(const i of e.toSorted((o,a)=>o.frame.width*o.frame.height-a.frame.width*a.frame.height)){const o=e.filter(f=>f!==i&&f.frame.x>=i.frame.x&&f.frame.y>=i.frame.y&&f.frame.x+f.frame.width<=i.frame.x+i.frame.width&&f.frame.y+f.frame.height<=i.frame.y+i.frame.height).flatMap(({cluster:f})=>{const g=r.get(f);return g?[g]:[]}),a=[...i.members.flatMap(f=>{const g=Je(f),p=g&&rr(g,t);return p?[p]:[]}),...o];if(!a.length)continue;const s=Number(i.cluster.dataset.headerHeight)||xn(18),n=Math.min(...a.map(f=>f.x))-24,l=Math.min(...a.map(f=>f.y))-s,c=Math.max(...a.map(f=>f.x+f.width))+24,h=Math.max(...a.map(f=>f.y+f.height))+24,d={x:n,y:l,width:c-n,height:h-l};i.rect.style.setProperty("transition-property","none","important");for(const[f,g]of Object.entries(d))i.rect.setAttribute(f,String(g));const u=i.label.querySelector("foreignObject");if(u)u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(Math.max(24,d.width-ai*2))),i.label.setAttribute("transform",`translate(${d.x+ai}, ${d.y+ai})`);else{const f=i.label.getBBox();i.label.setAttribute("transform",`translate(${d.x+d.width/2-f.x-f.width/2}, ${d.y+ai-f.y})`)}r.set(i.cluster,d)}}function g$(e,t){if(e.querySelectorAll("g.cluster").length<2)return!1;const r=t[0]?.path;if(!r)return!1;const i=D=>{const P=D&&Je(D);return P?rr(P,r):null},o=[...e.querySelectorAll("g.node")].flatMap(D=>{const P=zr(D),Y=Je(D);if(!Y||!aa(Y))return[];const X=t.filter(tt=>tt.source===P&&tt.target!==P),z=X.find(tt=>t.some(ot=>ot.source===tt.target&&ot.target===P))?.target;if(!z)return[];const U=X.find(tt=>tt.target!==z&&t.some(ot=>ot.source===z&&ot.target===tt.target)&&t.some(ot=>ot.source===tt.target&&ot.target===tt.target))?.target;if(!U)return[];const j=new Map;for(const tt of t.filter(ot=>ot.target===P&&ot.source!==z))j.set(tt.source,[...j.get(tt.source)??[],tt]);const V=[...j.values()].find(tt=>tt.length>=2),Q=t.filter(tt=>tt.source===P&&tt.target===U),rt=t.find(tt=>tt.source===P&&tt.target===z),ht=t.find(tt=>tt.source===z&&tt.target===P),H=t.find(tt=>tt.source===z&&tt.target===U),G=t.find(tt=>tt.source===U&&tt.target===U),K=t.find(tt=>tt.source===U&&tt.target!==U);return!V||Q.length<2||!rt||!ht||!H||!G||!K?[]:[{decisionId:P,secondary:z,merge:U,ingress:V,branches:Q,add:rt,retry:ht,done:H,loop:G,downstream:K}]})[0];if(!o)return!1;const a=o.ingress[0].source,s=o.downstream.target,n=new Set([o.decisionId,o.secondary,o.merge,a,s]),l=[...e.querySelectorAll("g.node")],c=new Map(l.filter(D=>n.has(zr(D))).map(D=>[zr(D),D]));if(c.size!==n.size)return!1;const h=[...e.querySelectorAll("g.cluster")].flatMap(D=>{const P=D.querySelector(":scope > rect"),Y=D.querySelector(":scope > g.cluster-label");if(!P||!Y)return[];const X=rr(P,r);if(!X)return[];const z=l.filter(U=>{const j=i(U);if(!j)return!1;const V=Et(j,.5,.5);return V.x>=X.x&&V.x<=X.x+X.width&&V.y>=X.y&&V.y<=X.y+X.height});return[{cluster:D,rect:P,label:Y,frame:X,members:z}]}),d=h.filter(D=>D.members.some(P=>zr(P)===o.decisionId)).toSorted((D,P)=>D.frame.width*D.frame.height-P.frame.width*P.frame.height)[0],u=d?h.filter(D=>D!==d&&d.frame.x>=D.frame.x&&d.frame.y>=D.frame.y&&d.frame.x+d.frame.width<=D.frame.x+D.frame.width&&d.frame.y+d.frame.height<=D.frame.y+D.frame.height).toSorted((D,P)=>D.frame.width*D.frame.height-P.frame.width*P.frame.height)[0]:void 0,f=(D,P)=>{const Y=c.get(P);D&&Y&&!D.members.includes(Y)&&D.members.push(Y)};f(d,o.decisionId),f(d,o.secondary),f(u,a),f(u,o.merge);const g=new Map([...c].flatMap(([D,P])=>{const Y=i(P);return Y?[[D,Y]]:[]}));if(g.size!==c.size)return!1;const p=t.some(({path:D})=>D.dataset.compactFlowchart==="true"),m=p?"compact":"wide",y=e.dataset.nestedDecisionLayout!==m,x=g.get(a),b=g.get(o.decisionId),S=g.get(o.secondary),T=g.get(o.merge),k=g.get(s),_=p?(()=>{const D=Et(b,.5,.5).x,P=Et(x,.5,.5).y,Y=Math.max(x.height,b.height,T.height,k.height)+94;return{intake:{x:D,y:P},decision:{x:D,y:P+Y},secondary:{x:D+S.width/2,y:P+Y*1.5},merge:{x:D,y:P+Y*2},registry:{x:D,y:P+Y*3}}})():(()=>{const D=Et(b,.5,.5).y,P=Et(x,.5,.5).x,Y=P+x.width/2+b.width/2+116,X=Y+b.width/2+T.width/2+184;return{intake:{x:P,y:D},decision:{x:Y,y:D},secondary:{x:(Y+X)/2+8,y:D+95},merge:{x:X,y:D},registry:{x:X+T.width/2+k.width/2+124,y:D}}})();if(y){for(const[D,P]of[[a,_.intake],[o.decisionId,_.decision],[o.secondary,_.secondary],[o.merge,_.merge],[s,_.registry]])D1(c.get(D),P,r);e.dataset.nestedDecisionLayout=m}f$(h,r);const L=D=>i(c.get(D)),v=L(a),M=L(o.decisionId),B=L(o.secondary),E=L(o.merge),O=L(s),[$,I]=o.ingress,[F,R]=o.branches,q=[];if(p){const D=Math.min(v.x,M.x,E.x,O.x)-16,P=Math.max(M.x+M.width,B.x+B.width)+12,Y=P+20,X=Qr(M,"top",-8),z=Qr(M,"left",-8),U=Qr(M,"top",8),j=Qr(M,"bottom",-8),V=Qr(M,"left",8);q.push({edge:$,role:"primary-ingress",points:[Et(v,.5,1),{x:X.x,y:Et(v,.5,1).y},X],targetSide:"top"},{edge:I,role:"metadata-return",points:[Et(v,0,.55),{x:D-22,y:Et(v,0,.55).y},{x:D-22,y:z.y},z],labelSegment:1,targetSide:"left"},{edge:o.add,role:"secondary-add",points:[Qr(M,"right",-8),{x:P,y:Qr(M,"right",-8).y},{x:P,y:Et(B,1,.35).y},Et(B,1,.35)],labelSegment:1,sourceSide:"right"},{edge:o.retry,role:"secondary-retry",points:[Et(B,1,.68),{x:Y,y:Et(B,1,.68).y},{x:Y,y:M.y-24},{x:U.x,y:M.y-24},U],labelSegment:1,targetSide:"top"},{edge:F,role:"primary-branch",points:[j,{x:j.x,y:M.y+M.height+12},{x:j.x-16,y:M.y+M.height+12},{x:j.x-16,y:E.y-12},{x:Et(E,.42,0).x,y:E.y-12},Et(E,.42,0)],labelSegment:2,sourceSide:"bottom"},{edge:R,role:"decision-return",points:[V,{x:D,y:V.y},{x:D,y:Et(E,0,.65).y},Et(E,0,.65)],labelSegment:1,sourceSide:"left"},{edge:o.done,role:"secondary-done",points:[Et(B,1,.65),{x:B.x+B.width,y:Et(E,1,.65).y},Et(E,1,.65)],labelSegment:0},{edge:o.downstream,role:"primary-save",points:[Et(E,.5,1),Et(O,.5,0)]})}else{const D=Math.min(v.y,M.y)-44,P=B.y+B.height+72,Y=Qr(M,"left",-8),X=Qr(M,"top",-8),z=Qr(M,"right",-8),U=Qr(M,"right",8),j={x:E.x,y:U.y},V=Qr(M,"bottom",-10),Q=Qr(M,"bottom",10),rt={x:E.x,y:z.y};q.push({edge:$,role:"primary-ingress",points:[{x:v.x+v.width,y:Y.y},Y],targetSide:"left"},{edge:I,role:"metadata-return",points:[Et(v,.5,0),{x:Et(v,.5,0).x,y:D},{x:X.x,y:D},X],labelSegment:1,targetSide:"top"},{edge:o.add,role:"secondary-add",points:[V,{x:V.x,y:Et(B,0,.38).y},Et(B,0,.38)],labelSegment:1,sourceSide:"bottom"},{edge:o.retry,role:"secondary-retry",points:[Et(B,.38,1),{x:Et(B,.38,1).x,y:P},{x:Q.x,y:P},Q],labelSegment:1,targetSide:"bottom"},{edge:F,role:"primary-branch",points:[z,rt],sourceSide:"right"},{edge:R,role:"decision-return",points:[U,j],sourceSide:"right"},{edge:o.done,role:"secondary-done",points:[Et(B,1,.62),{x:Et(E,.42,1).x,y:Et(B,1,.62).y},Et(E,.42,1)]},{edge:o.downstream,role:"primary-save",points:[Et(E,1,.64),{x:O.x,y:Et(E,1,.64).y}]})}q.push({edge:o.loop,role:"compact-loop",points:[Et(E,1,.16),{x:E.x+E.width+30,y:Et(E,1,.16).y},{x:E.x+E.width+30,y:Et(E,1,.4).y},Et(E,1,.4)]});for(const{edge:D,role:P,points:Y,labelSegment:X,sourceSide:z,targetSide:U}of q){const j=_r(Y);for(const rt of["feedbackLane","fanoutSource","groupedReturnLane","decisionBranch","decisionReturn","clusterHeaderClearance","compactGroupedRoute"])delete D.path.dataset[rt];D.path.dataset.nestedDecisionRoute=P,P==="compact-loop"?D.path.dataset.selfLoop="right":delete D.path.dataset.selfLoop,z?D.path.dataset.diamondSourceSide=z:delete D.path.dataset.diamondSourceSide,U?D.path.dataset.diamondTargetSide=U:delete D.path.dataset.diamondTargetSide,D.path.dataset.manhattanPoints=j.map(({x:rt,y:ht})=>`${rt},${ht}`).join(" "),D.path.dataset.manhattanSegments=String(j.length-1),D.path.dataset.terminalTarget=c.get(D.target)?.id??"";const V=j.at(-1),Q=j.at(-2);D.path.dataset.terminalDirection=`${V.x-Q.x},${V.y-Q.y}`,D.path.setAttribute("d",j.map(({x:rt,y:ht},H)=>`${H?"L":"M"}${rt},${ht}`).join("")),fo(D.label,D.path,j,X)}return a$(e,t),!0}function p$(e,t){if(t.length!==1)return null;const r=t[0],i=e.filter(c=>c.source===r);if(i.length!==2)return null;const o=i.filter(c=>e.some(h=>h.source===c.target&&h.target===r));if(o.length!==1)return null;const a=o[0].target;if(a===r||e.filter(c=>c.source===a||c.target===a).length!==2)return null;const s=e.filter(c=>c.source!==a&&c.target!==a),n=s.filter(c=>!s.some(h=>h.target===c.source));if(n.length!==1)return null;const l=[n[0].source];for(;;){const c=s.filter(h=>h.source===l.at(-1));if(!c.length)break;if(c.length!==1||l.includes(c[0].target))return null;l.push(c[0].target)}return l.length!==s.length+1||l.indexOf(r)<=0||l.at(-1)===r?null:{decision:r,retry:a,spine:l}}function m$(e,t){if(!["TD","TB"].includes(e.dataset.flowchartDirection??"")||e.querySelector("g.cluster"))return!1;const r=[...e.querySelectorAll("g.node")],i=p$(t,r.filter(g=>{const p=Je(g);return p&&aa(p)}).map(zr));if(!i||r.length!==i.spine.length+1)return!1;const o=t[0].path,a=new Map(r.flatMap(g=>{const p=Je(g),m=p&&rr(p,o);return m?[[zr(g),m]]:[]}));if(a.size!==r.length)return!1;const s=t.find(g=>g.source===i.decision&&g.target===i.retry),n=s.label?.getBBox(),l=a.get(i.spine[0]),c=l.x+l.width/2;let h=l.y;const d=o.dataset.compactFlowchart==="true";for(const g of i.spine){const p=a.get(g);p.x=c-p.width/2,p.y=h,h+=p.height+(d?100:64)}const u=a.get(i.decision),f=a.get(i.retry);f.x=u.x+u.width+Math.max(80,(n?.width??0)+48),f.y=u.y+(u.height-f.height)/2;for(const g of r)D1(g,Et(a.get(zr(g)),.5,.5),o);for(const g of t){const p=a.get(g.source),m=a.get(g.target),y=g.source===i.retry,x=g===s;let b;if(y){const S=Qr(m,"right",-Math.min(32,m.height/4)),T=Math.min(p.y,m.y)-32;b=[Et(p,.5,0),{x:p.x+p.width/2,y:T},{x:m.x+m.width+24,y:T},{x:m.x+m.width+24,y:S.y},S]}else x?b=[Et(p,1,.5),Et(m,0,.5)]:b=[Et(p,.5,1),Et(m,.5,0)];for(const S of["feedbackLane","fanoutSource","fanoutPort","parallelLane","decisionBranch","decisionReturn"])delete g.path.dataset[S];g.path.dataset.decisionCycleRoute=y?"return":x?"branch":"spine",g.path.dataset.manhattanPoints=b.map(({x:S,y:T})=>`${S},${T}`).join(" "),g.path.dataset.manhattanSegments=String(b.length-1),g.path.setAttribute("d",b.map(({x:S,y:T},k)=>`${k?"L":"M"}${S},${T}`).join("")),fo(g.label,g.path,b)}return e.dataset.decisionCycleLayout="vertical",!0}function Jn(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const t=[...e.querySelectorAll(".edgeLabels > .edgeLabel")],r=[...e.querySelectorAll(".edgePaths path")].flatMap((s,n)=>{const l=vr(s);return l?[{path:s,label:t[n],...l}]:[]}),i=r[0]?.path;if(!i||g$(e,r)||m$(e,r))return;const o=s=>{const n=s&&Je(s);return n?rr(n,i):null},a=[...e.querySelectorAll("g.node")].flatMap(s=>{const n=o(s);return n?[n]:[]});for(const s of new Set(r.map(({source:n})=>n))){const n=ir(e,s),l=o(n),c=r.filter(({source:m})=>m===s).flatMap(m=>{const y=ir(e,m.target),x=o(y);return x?[{...m,targetBounds:x}]:[]});if(!n?.querySelector(":scope > polygon.label-container")||!l||c.length!==2||!a.length)continue;const h=c.toSorted((m,y)=>+(y.label?.textContent?.trim()==="Yes")-+(m.label?.textContent?.trim()==="Yes"));if(new Set(h.map(({label:m})=>m?.textContent?.trim())).size!==2||!h.some(({label:m})=>m?.textContent?.trim()==="Yes")||!h.some(({label:m})=>m?.textContent?.trim()==="No"))continue;h.forEach((m,y)=>{const x=y===0?"upper":"lower",b=m.path.dataset.compactFlowchart==="true",S=E3(l,m.targetBounds,x,a,b);if(m.path.setAttribute("d",S.map((T,k)=>`${k?"L":"M"}${T.x},${T.y}`).join("")),m.path.dataset.decisionBranch=x,m.path.dataset.decisionSource=s,m.path.dataset.decisionTarget=m.target,m.path.dataset.decisionPort=`${S[0].x},${S[0].y}`,m.path.dataset.decisionLane=String(S[1].x),m.path.dataset.manhattanPoints=S.map(T=>`${T.x},${T.y}`).join(" "),m.label){const T=Math.hypot(S[1].x-S[0].x,S[1].y-S[0].y)<=12;u$(m.label,m.path,T&&S[2]?S[1]:S[0],T&&S[2]?S[2]:S[1])}});const d=new Set(h.map(({target:m})=>m)),u=r.find(({source:m,target:y})=>d.has(m)&&y===s),f=u&&ir(e,u.source),g=o(f);if(!u||!g)continue;const p=P3(g,l,a,u.path.dataset.compactFlowchart==="true");u.path.setAttribute("d",p.map((m,y)=>`${y?"L":"M"}${m.x},${m.y}`).join("")),u.path.dataset.decisionReturn="outer",u.path.dataset.decisionSource=u.source,u.path.dataset.decisionTarget=s,u.path.dataset.decisionLane=String(Math.max(...p.map(({y:m})=>m))),u.path.dataset.manhattanPoints=p.map(m=>`${m.x},${m.y}`).join(" ")}}function y$(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2"||!e.querySelector("g.cluster"))return!1;const t=[...e.querySelectorAll("g.node")].map(zr),r=new Set(t),i=new Map,o=new Set;for(const n of e.querySelectorAll(".edgePaths path")){const l=vr(n);if(!l||!r.has(l.source)||!r.has(l.target)||i.has(l.source)||o.has(l.target))return!1;i.set(l.source,l.target),o.add(l.target)}const a=t.filter(n=>!o.has(n));if(a.length<2||a.some(n=>!i.has(n)))return!1;const s=new Set;for(const n of a){let l=n;for(;l!==void 0;){if(s.has(l))return!1;s.add(l),l=i.get(l)}}return s.size===t.length}function bh(e,t=!0,r){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return null;const i=[...e.querySelectorAll("g.node")];if(e.querySelector("g.cluster"))return t?k$(e):w$(e,r),t?x$(e,i):null;if(i.length<2)return null;if(!t){let x=0;for(const b of i){const T=Je(b)?.getBBox()??b.getBBox();b.setAttribute("transform",`translate(${-T.x-T.width/2}, ${x-T.y})`),x+=T.height+100}return null}const o=[...e.querySelectorAll(".edgePaths path")],a=[...e.querySelectorAll(".edgeLabels > .edgeLabel")],s=new Map(i.map((x,b)=>[zr(x),b])),n=new Map,l=new Map;for(const x of o){const b=vr(x);if(!b)continue;const S=[b.source,b.target].toSorted().join("\0");n.set(S,(n.get(S)??0)+1),l.set(b.source,(l.get(b.source)??0)+1)}const c={left:0,right:0},h=new Map,d=new Map,u=[],f=i.flatMap(x=>{const b=x.transform.baseVal.consolidate()?.matrix;if(!b)return[];const S=x.getBBox();return[{x:S.x+b.e,y:S.y+b.f,width:S.width,height:S.height}]});if(o.forEach((x,b)=>{const S=vr(x),T=S&&ir(e,S.source),k=S&&ir(e,S.target),_=T&&Sr(T),L=k&&Sr(k);if(!S||!_||!L)return;f.push(_,L);const v=s.get(S.source)??0,M=s.get(S.target)??0,B=[S.source,S.target].toSorted().join("\0"),E=n.get(B)??0,O=d.get(B)??0;if(d.set(B,O+1),E>1){const Q=O-(E-1)/2;x.dataset.parallelLane=Q<0?"before":Q>0?"after":"center"}else delete x.dataset.parallelLane;let $;if(M===v+1&&n.get(B)===1&&l.get(S.source)===1)$=[Et(_,.5,1),Et(L,.5,0)];else{const Q=M<=v?"left":"right",rt=c[Q]++,ht=`${S.source}\0${Q}`,H=h.get(ht)??0;h.set(ht,H+1);const G=M>v,K=Et(_,.5,G?1:0),tt=Et(L,.5,G?0:1),ot=28+H*30,vt=K.y+(G?ot:-ot),Ot=tt.y+(G?-28:28),Pt=42+rt%2*6,Mt=Q==="left"?Math.min(_.x,L.x)-Pt:Math.max(_.x+_.width,L.x+L.width)+Pt;$=[K,{x:K.x,y:vt},{x:Mt,y:vt},{x:Mt,y:Ot},{x:tt.x,y:Ot},tt]}$=_r($);const I=Math.min(...$.map(Q=>Q.x)),F=Math.min(...$.map(Q=>Q.y)),R=Math.max(...$.map(Q=>Q.x)),q=Math.max(...$.map(Q=>Q.y));f.push({x:I,y:F,width:R-I,height:q-F}),x.setAttribute("d",$.map((Q,rt)=>`${rt?"L":"M"}${Q.x},${Q.y}`).join("")),x.dataset.compactFlowchart="true",x.dataset.manhattanPoints=$.map(Q=>`${Q.x},${Q.y}`).join(" ");const D=a[b];if(!D)return;const Y=$.slice(1).map((Q,rt)=>({start:$[rt],end:Q})).toSorted((Q,rt)=>+(Math.abs(rt.end.y-rt.start.y)<.001)-+(Math.abs(Q.end.y-Q.start.y)<.001)||Math.hypot(rt.end.x-rt.start.x,rt.end.y-rt.start.y)-Math.hypot(Q.end.x-Q.start.x,Q.end.y-Q.start.y)),X=D.getBBox(),z=Y.flatMap(Q=>[.5,.35,.65,.2,.8].map(rt=>({segment:Q,midpoint:{x:Q.start.x+(Q.end.x-Q.start.x)*rt,y:Q.start.y+(Q.end.y-Q.start.y)*rt}}))),U=z.find(({midpoint:Q})=>{const rt={x:Q.x-X.width/2,y:Q.y-X.height/2,width:X.width,height:X.height};return!u.some(ht=>Ai(rt,ht,4))})??z[0];if(!U)return;const{midpoint:j}=U;D.setAttribute("transform",`translate(${j.x-X.x-X.width/2}, ${j.y-X.y-X.height/2})`);const V={x:j.x-X.width/2,y:j.y-X.height/2,width:X.width,height:X.height};u.push(V),f.push(V)}),!f.length)return null;const g=Math.min(...f.map(x=>x.x)),p=Math.min(...f.map(x=>x.y)),m=Math.max(...f.map(x=>x.x+x.width)),y=Math.max(...f.map(x=>x.y+x.height));return{x:g,y:p,width:m-g,height:y-p}}function x$(e,t){const r=t.map(Sr).filter(n=>!!n);for(const n of e.querySelectorAll(".edgePaths path")){const l=n.getBBox();r.push({x:l.x,y:l.y,width:l.width,height:l.height})}if(!r.length)return null;const i=Math.min(...r.map(n=>n.x)),o=Math.min(...r.map(n=>n.y)),a=Math.max(...r.map(n=>n.x+n.width)),s=Math.max(...r.map(n=>n.y+n.height));return{x:i-6,y:o-46,width:a-i+12,height:s-o+54}}function b$(e){const t=e.querySelector(".edgePaths path");if(!t)return null;const i=[...[...e.querySelectorAll("g.node")].flatMap(l=>{const c=Je(l);return c?[c]:[]}),...e.querySelectorAll("g.cluster > rect"),...e.querySelectorAll(".edgePaths path")].flatMap(l=>{const c=rr(l,t);return c?[c]:[]});if(!i.length)return null;const o=Math.min(...i.map(l=>l.x)),a=Math.min(...i.map(l=>l.y)),s=Math.max(...i.map(l=>l.x+l.width)),n=Math.max(...i.map(l=>l.y+l.height));return{x:o,y:a,width:s-o,height:n-a}}function zr(e){return e.id.match(/flowchart-(.+?)-\d+$/)?.[1]??e.id}function Sr(e){const t=Je(e),r=e.transform.baseVal.consolidate()?.matrix;if(!t||!r)return null;const i=t.getBBox();return{x:i.x+r.e,y:i.y+r.f,width:i.width,height:i.height}}function C$(e,t,r){if(!e.length)return null;const i=Math.min(...e.map(l=>l.x))-20,o=Math.min(...e.map(l=>l.y))-r,a=Math.max(...e.map(l=>l.x+l.width))+20,s=Math.max(...e.map(l=>l.y+l.height))+20,n={x:i,y:o,width:a-i,height:s-o};return t.some(l=>Ai(n,l,4))?null:n}function w$(e,t){const r=[...e.querySelectorAll("g.node")],i=new Map(r.map(u=>[u,Sr(u)])),o=[...e.querySelectorAll("g.cluster")].flatMap(u=>{const f=u.querySelector(":scope > rect"),g=u.querySelector(":scope > g.cluster-label");if(!f||!g)return[];const p=f.getBBox(),m=t&&Lu(u,t),y=m?t?.get(m):void 0;if(t&&!y)return[];const x=r.filter(b=>{if(y)return y.has(zr(b));const S=i.get(b);if(!S)return!1;const T=Et(S,.5,.5);return T.x>=p.x&&T.x<=p.x+p.width&&T.y>=p.y&&T.y<=p.y+p.height});return[{cluster:u,rect:f,label:g,originalRect:p,members:x,id:m,memberIds:y}]}),a=new Map,s=(u,f,g)=>{let p=g;for(const m of u){const y=m.getBBox();a.set(m,{x:f-y.x-y.width/2,y:p-y.y}),p+=y.height+100}},n=Math.max(...r.map(u=>u.getBBox().width)),l=y$(e);let c=l;if(c){const u=new Map([...e.querySelectorAll(".edgePaths path")].map(x=>{const b=vr(x);return[b.source,b.target]})),f=new Set(u.values()),g=new Map(r.map(x=>[zr(x),x])),p=r.filter(x=>!f.has(zr(x))).map(x=>{const b=[x];let S=u.get(zr(x));for(;S!==void 0;)b.push(g.get(S)),S=u.get(S);return b}),m=Array.from({length:Math.max(...p.map(x=>x.length))},(x,b)=>Math.max(...p.map(S=>S[b]?.getBBox().height??0)));let y=0;for(const x of p){const b=Math.max(...x.map(T=>T.getBBox().width));let S=48;x.forEach((T,k)=>{const _=T.getBBox();a.set(T,{x:y+b/2-_.x-_.width/2,y:S+m[k]/2-_.y-_.height/2}),S+=m[k]+100}),y+=b+24}}else s(r,n/2,48);const h=()=>{const u=new Map(r.flatMap(g=>{const p=Je(g),m=a.get(g);if(!p||!m)return[];const y=p.getBBox();return[[g,{x:y.x+m.x,y:y.y+m.y,width:y.width,height:y.height}]]}));if(l&&(u.size!==r.length||o.length!==e.querySelectorAll("g.cluster").length||o.some(({members:g})=>!g.length)))return null;const f=new Map;for(const g of o.toSorted((p,m)=>(p.memberIds?.size??0)-(m.memberIds?.size??0)||p.originalRect.width*p.originalRect.height-m.originalRect.width*m.originalRect.height)){const p=g.members.flatMap(L=>{const v=u.get(L);return v?[v]:[]}),m=o.filter(L=>L!==g&&(g.memberIds?!!(L.id&&g.memberIds.has(L.id)):L.originalRect.x>=g.originalRect.x&&L.originalRect.y>=g.originalRect.y&&L.originalRect.x+L.originalRect.width<=g.originalRect.x+g.originalRect.width&&L.originalRect.y+L.originalRect.height<=g.originalRect.y+g.originalRect.height)).flatMap(({cluster:L})=>{const v=f.get(L);return v?[v.frame]:[]}),y=[...p,...m];if(!y.length)continue;const x=g.label.querySelector("foreignObject"),b=l&&x?x.cloneNode(!0):null;if(b){const L=Math.max(...y.map(M=>M.x+M.width))-Math.min(...y.map(M=>M.x));b.setAttribute("width",String(Math.max(24,L))),b.style.visibility="hidden";const v=b.querySelector("div");v&&(v.style.width="100%",v.style.whiteSpace="normal",v.style.overflowWrap="normal",v.style.wordBreak="normal"),g.label.append(b)}let S;try{const L=(b??x)?.querySelector("div");S=Math.ceil(Math.max(L?.getBoundingClientRect().height??0,L?.scrollHeight??0,18))}finally{b?.remove()}const T=xn(S),k=l?r.filter(L=>!g.members.includes(L)).flatMap(L=>{const v=u.get(L);return v?[v]:[]}):[],_=C$(y,k,T);if(!_)return null;f.set(g.cluster,{frame:_,measuredTitleHeight:S,headerHeight:T})}return f};let d=h();if(c&&!d&&(c=!1,s(r,n/2,48),d=h()),e.dataset.compactGroupedLayout=d?c?"parallel":"column":"original",!!d){for(const[u,f]of a)u.setAttribute("transform",`translate(${f.x}, ${f.y})`);for(const u of o){const f=d.get(u.cluster);if(!f)continue;const{frame:g,measuredTitleHeight:p,headerHeight:m}=f,y=g.x,x=g.x+g.width,b=g.y,S=u.label.querySelector("foreignObject"),T=S?.querySelector("div");if(u.rect.setAttribute("x",String(g.x)),u.rect.setAttribute("y",String(g.y)),u.rect.setAttribute("width",String(g.width)),u.rect.setAttribute("height",String(g.height)),u.cluster.dataset.headerHeight=String(m),S)S.setAttribute("x","0"),S.setAttribute("y","0"),S.setAttribute("width",String(Math.max(24,g.width-40))),S.setAttribute("height",String(p)),S.style.overflow="hidden",T&&(T.style.width="100%",T.style.whiteSpace="normal",T.style.overflowWrap="normal",T.style.wordBreak="normal"),u.label.setAttribute("transform",`translate(${y+20}, ${b+20})`);else{const k=u.label.getBBox();u.label.setAttribute("transform",`translate(${(y+x)/2-k.x-k.width/2}, ${b+20-k.y})`)}}}}function k$(e){if(e.dataset.compactGroupedLayout==="original")return;const t=[...e.querySelectorAll(".edgePaths path")],r=[...e.querySelectorAll("g.node")],i=e.dataset.compactGroupedLayout==="parallel",o=new Map(r.map((p,m)=>[zr(p),m])),a=t.flatMap(p=>{const m=vr(p);return m?[{path:p,...m}]:[]}),s=new Map;for(const p of a){const m=[p.source,p.target].toSorted().join("\0");s.set(m,[...s.get(m)??[],p])}const n={left:0,right:0},l=a.flatMap(p=>{if(p.source===p.target)return[{...p,side:"right"}];const m=[p.source,p.target].toSorted().join("\0"),y=s.get(m)??[];if(y.length>1)return[{...p,side:y.indexOf(p)%2?"right":"left"}];const x=o.get(p.source)??0,b=o.get(p.target)??0;return[{...p,side:i||Math.abs(b-x)===1?null:b<x?"left":"right"}]}),c=new Map;for(const p of l)if(!(!p.side||p.source===p.target))for(const m of[p.source,p.target]){const y=`${m}\0${p.side}`;c.set(y,(c.get(y)??0)+1)}const h=new Map,d=(p,m)=>{const y=`${p}\0${m}`,x=c.get(y)??1,b=h.get(y)??0;return h.set(y,b+1),x===1?.5:.25+b*.5/(x-1)},u=r.map(Sr).filter(p=>!!p),f=Math.min(...u.map(p=>p.x))-24,g=Math.max(...u.map(p=>p.x+p.width))+24;for(const p of l){const{path:m,source:y,target:x,side:b}=p,S=ir(e,y),T=ir(e,x),k=S&&Sr(S),_=T&&Sr(T);if(!k||!_)continue;let L;if(y===x){const v=k.x+k.width+24;L=[Et(k,1,.3),{x:v,y:k.y+k.height*.3},{x:v,y:k.y+k.height*.7},Et(k,1,.7)],m.dataset.selfLoop="right"}else if(b){const v=Et(k,b==="left"?0:1,d(y,b)),M=Et(_,b==="left"?0:1,d(x,b)),B=n[b]++,E=(b==="left"?f:g)+(b==="left"?-1:1)*B*12;L=[v,{x:E,y:v.y},{x:E,y:M.y},M],m.dataset.compactGroupedSide=b,m.dataset.compactGroupedPort=`${v.x},${v.y} ${M.x},${M.y}`}else if(_.x>=k.x+k.width||k.x>=_.x+_.width){const M=_.x>=k.x,B=Et(k,M?1:0,.5),E=Et(_,M?0:1,.5),O=(B.x+E.x)/2;L=_r([B,{x:O,y:B.y},{x:O,y:E.y},E])}else{const M=_.y>=k.y,B=Et(k,.5,M?1:0),E=Et(_,.5,M?0:1),O=(B.y+E.y)/2;L=_r([B,{x:B.x,y:O},{x:E.x,y:O},E])}L=_r(L),m.setAttribute("d",L.map((v,M)=>`${M?"L":"M"}${v.x},${v.y}`).join("")),m.dataset.compactFlowchart="true",m.dataset.compactGroupedRoute="true",m.dataset.manhattanPoints=L.map(v=>`${v.x},${v.y}`).join(" ")}for(const p of e.querySelectorAll("g.cluster")){const m=p.querySelector(":scope > rect"),y=p.querySelector(":scope > g.cluster-label");if(!m||!y)continue;const x=m.getBBox(),b=y.getBBox();y.setAttribute("transform",`translate(${x.x+x.width/2-b.x-b.width/2}, ${x.y+20-b.y})`)}}function S$(e){if(e.dataset.nestedDecisionLayout)return;const t=[...e.querySelectorAll("g.node")],r=[...e.querySelectorAll("g.cluster")].flatMap(o=>{const a=o.querySelector(":scope > rect");return a?[{cluster:o,rect:a,frame:{x:Number(a.getAttribute("x")),y:Number(a.getAttribute("y")),width:Number(a.getAttribute("width")),height:Number(a.getAttribute("height"))}}]:[]}),i=(o,a)=>a.x>=o.x&&a.x+a.width<=o.x+o.width&&a.y>=o.y&&a.y+a.height<=o.y+o.height;for(const o of r){const a=r.filter(p=>p!==o&&i(p.frame,o.frame)).toSorted((p,m)=>p.frame.width*p.frame.height-m.frame.width*m.frame.height)[0];if(!a)continue;const s=[...e.querySelectorAll(".edgePaths path")].flatMap(p=>{const m=vr(p),y=m&&ir(e,m.source),x=m&&ir(e,m.target),b=y&&Sr(y),S=x&&Sr(x),T=$i(e,p);return!b||!S||!i(o.frame,S)||i(o.frame,b)||!i(a.frame,b)||b.y+b.height>o.frame.y?[]:[{source:b,labelWidth:T?.getBBox().width??0}]});if(!s.length)continue;const n=24,l=Math.max(0,...s.map(({source:p})=>p.y+p.height+n-o.frame.y)),c=t.filter(p=>{const m=Sr(p);return m&&i(o.frame,m)}),h=t.filter(p=>!c.includes(p)).flatMap(p=>{const m=Sr(p);return m&&m.y>=o.frame.y+o.frame.height?[m.y]:[]}),d=Math.min(a.frame.y+a.frame.height,...h)-o.frame.y-o.frame.height-n,u=Math.min(l,Math.max(0,d));if(u>0){for(const p of c){const m=p.transform.baseVal.consolidate()?.matrix;m&&p.setAttribute("transform",`translate(${m.e}, ${m.f+u})`)}for(const p of r.filter(m=>i(o.frame,m.frame))){p.rect.setAttribute("y",String(p.frame.y+u));const m=p.cluster.querySelector(":scope > .cluster-label"),y=m?.transform.baseVal.consolidate()?.matrix;y&&m.setAttribute("transform",`translate(${y.e}, ${y.f+u})`)}}const f=Math.max(...s.map(({labelWidth:p})=>p+12)),g=Math.max(a.frame.x+a.frame.width,o.frame.x+o.frame.width+f);a.rect.setAttribute("width",String(g-a.frame.x))}}function Ch(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const t=[...e.querySelectorAll("g.cluster")];for(const r of e.querySelectorAll(".edgePaths path")){if(r.dataset.feedbackLane||r.dataset.nestedDecisionRoute)continue;const i=r.dataset.fanoutSource&&vr(r),o=i&&ir(e,i.source),a=i&&ir(e,i.target),s=o&&Sr(o),n=a&&Sr(a),l=M=>t.flatMap(B=>{const O=B.querySelector(":scope > rect")?.getBBox();return O?[{cluster:B,frame:O}]:[]}).filter(({frame:B})=>M.x+M.width/2>B.x&&M.x+M.width/2<B.x+B.width&&M.y+M.height/2>B.y&&M.y+M.height/2<B.y+B.height).toSorted((B,E)=>B.frame.width-E.frame.width)[0];if(s&&n){const M=l(s),B=l(n);if(M&&B&&M.cluster!==B.cluster){const E=Et(s,1,.5),O=Et(n,0,.5),$=(M.frame.x+M.frame.width+B.frame.x)/2,I=[E,{x:$,y:E.y},{x:$,y:O.y},O];r.setAttribute("d",I.map((F,R)=>`${R?"L":"M"}${F.x},${F.y}`).join("")),r.dataset.clusterHeaderClearance="true",r.dataset.clusterHeaderTargetPort="left",r.dataset.manhattanPoints=I.map(F=>`${F.x},${F.y}`).join(" ");continue}}const c=r.getTotalLength();if(!c)continue;const h=r.getPointAtLength(0),d=r.getPointAtLength(c);if(Math.abs(d.y-h.y)<=Math.abs(d.x-h.x))continue;const u=vr(r),f=u&&ir(e,u.source),g=u&&ir(e,u.target),p=f&&Je(f),m=g&&Je(g),y=p?rr(p,r):null,x=m?rr(m,r):null,b=M=>M?t.map(B=>{const E=B.querySelector(":scope > rect"),O=E&&kr(E,r),$=Number(B.dataset.headerHeight);return O?{bounds:O,protectedBottom:O.y+(Number.isFinite($)?$:48)+8}:null}).filter(B=>!!B).filter(({bounds:B})=>M.x+M.width/2>B.x&&M.x+M.width/2<B.x+B.width&&M.y+M.height/2>B.y&&M.y+M.height/2<B.y+B.height).toSorted((B,E)=>B.bounds.width-E.bounds.width)[0]:null,S=b(y),T=b(x);if(x&&T&&d.y<T.protectedBottom){const M=x.y+x.height/2,B=Math.abs(h.x-(T.bounds.x-8))<=Math.abs(h.x-(T.bounds.x+T.bounds.width+8)),E=B?T.bounds.x-8:T.bounds.x+T.bounds.width+8,O=B?x.x:x.x+x.width,$=y&&S&&(S.bounds.x!==T.bounds.x||S.bounds.y!==T.bounds.y),I=T.bounds.y-6,F=y?y.y+y.height/2:h.y,R=y?E<y.x+y.width/2?y.x:y.x+y.width:h.x,q=_r($?[{x:R,y:F},{x:E,y:F},{x:E,y:M},{x:O,y:M}]:[{x:h.x,y:h.y},{x:h.x,y:I},{x:E,y:I},{x:E,y:M},{x:O,y:M}]);r.setAttribute("d",q.map((D,P)=>`${P?"L":"M"}${D.x},${D.y}`).join("")),r.dataset.clusterHeaderClearance="true",r.dataset.clusterHeaderTargetPort=B?"left":"right",r.dataset.manhattanPoints=q.map(D=>`${D.x},${D.y}`).join(" ");continue}const k=t.flatMap(M=>{const B=M.querySelector(":scope > rect"),E=B&&kr(B,r);if(!E)return[];const O=Number(M.dataset.headerHeight),$={...E,height:Math.min(E.height,(Number.isFinite(O)?O:48)+8)};return Array.from({length:101},(F,R)=>r.getPointAtLength(c*R/100)).some(F=>F.x>$.x-6&&F.x<$.x+$.width+6&&F.y>$.y-6&&F.y<$.y+$.height+6)?[$]:[]}).sort((M,B)=>d.y>=h.y?M.y-B.y:B.y+B.height-(M.y+M.height));if(!k.length)continue;const _=d.y>=h.y,L=[{x:h.x,y:h.y}];for(const M of k){const B=_?M.y-6:M.y+M.height+6,E=_?M.y+M.height+6:M.y-6,O=M.x-8,$=M.x+M.width+8,I=Math.abs(h.x-O)<=Math.abs(h.x-$)?O:$;L.push({x:h.x,y:B},{x:I,y:B},{x:I,y:E},{x:h.x,y:E})}L.push({x:h.x,y:d.y},{x:d.x,y:d.y});const v=_r(L);r.setAttribute("d",v.map((M,B)=>`${B?"L":"M"}${M.x},${M.y}`).join("")),r.dataset.clusterHeaderClearance="true",r.dataset.manhattanPoints=v.map(M=>`${M.x},${M.y}`).join(" ")}}function Ya(e){if(!e.querySelector("g.cluster"))return;const t=[...e.querySelectorAll(".edgePaths path")],r=[...e.querySelectorAll(".edgeLabels > .edgeLabel")],i=[...e.querySelectorAll("g.cluster > g.cluster-label")],o=s=>{const n=s.getAttribute("transform");s.removeAttribute("transform");const l=s.getBBox();return n&&s.setAttribute("transform",n),l},a=[];t.forEach((s,n)=>{const l=r[n];if(s.dataset.nestedDecisionRoute&&l){const b=kr(l,s);b&&a.push(b);return}if(s.dataset.clientRequestLane==="downward"&&l){const b=kr(l,s);b&&a.push(b);return}const c=(s.dataset.manhattanPoints??"").trim().split(/\s+/).map(b=>b.split(",").map(Number)).filter(b=>b.length===2&&b.every(Number.isFinite)).map(([b,S])=>({x:b,y:S}));if(!l||c.length<2)return;const h=o(l),d=kr(l,s);if(!d)return;const u=[...[...e.querySelectorAll("g.node")].map(b=>kr(b,s)).filter(b=>!!b),...i.map(b=>kr(b,s)).filter(b=>!!b),...a],f=nr(c);let p=f.flatMap(b=>{const S=Math.abs(b.start.y-b.end.y)<.001,T=Math.hypot(b.end.x-b.start.x,b.end.y-b.start.y),k=(S?d.width:d.height)+12;return T<k?[]:[.5,.35,.65,.2,.8].map(_=>{const L={x:b.start.x+(b.end.x-b.start.x)*_,y:b.start.y+(b.end.y-b.start.y)*_},v={x:L.x-d.width/2,y:L.y-d.height/2,width:d.width,height:d.height};return{center:L,bounds:v,horizontal:S,capacity:T}})}).filter(({bounds:b})=>u.every(S=>!Ai(b,S,4))).sort((b,S)=>Number(S.horizontal)-Number(b.horizontal)||S.capacity-b.capacity)[0];if(!p){const b=f.map(L=>({...L,capacity:Math.hypot(L.end.x-L.start.x,L.end.y-L.start.y)})).sort((L,v)=>v.capacity-L.capacity)[0];if(!b)return;const S=Math.abs(b.end.y-b.start.y)>Math.abs(b.end.x-b.start.x),T={x:(b.start.x+b.end.x)/2,y:(b.start.y+b.end.y)/2},k=S?d.width/2:d.height/2,_=u.flatMap(L=>S?[{x:L.x-4-k,y:T.y},{x:L.x+L.width+4+k,y:T.y}]:[{x:T.x,y:L.y-4-k},{x:T.x,y:L.y+L.height+4+k}]);p=[S?{x:T.x+k+4,y:T.y}:{x:T.x,y:T.y+k+4},S?{x:T.x-k-4,y:T.y}:{x:T.x,y:T.y-k-4},..._].map(L=>({center:L,bounds:{x:L.x-d.width/2,y:L.y-d.height/2,width:d.width,height:d.height},horizontal:!S,capacity:b.capacity})).filter(({bounds:L})=>u.every(v=>!Ai(L,v,4))&&a.every(v=>!Ai(L,v,4))).toSorted((L,v)=>Math.hypot(L.center.x-T.x,L.center.y-T.y)-Math.hypot(v.center.x-T.x,v.center.y-T.y))[0]}if(!p)return;if(s.dataset.groupedReturnLane==="right"&&!p.horizontal){const b=h.width/2-6;p={...p,center:{...p.center,x:p.center.x-b},bounds:{...p.bounds,x:p.bounds.x-b}}}const m=s.getCTM(),y=l.parentElement?.getCTM(),x=m&&y?new DOMPoint(p.center.x,p.center.y).matrixTransform(m).matrixTransform(y.inverse()):p.center;l.setAttribute("transform",`translate(${x.x-h.x-h.width/2}, ${x.y-h.y-h.height/2})`),l.dataset.finalPathCenter=`${p.center.x},${p.center.y}`,a.push(p.bounds)}),t.forEach((s,n)=>{const l=r[n];if(s.dataset.nestedDecisionRoute||s.dataset.clientRequestLane==="downward")return;const c=l?.dataset.finalPathCenter,h=s.dataset.manhattanPoints;if(!l?.textContent?.trim()||!h)return;const d=kr(l,s);if(!d)return;const u=i.flatMap(M=>{const B=kr(M,s);return B?[B]:[]}),f=u.find(M=>Ai(d,M,4));if(!f)return;const g=M=>{const[B,E]=M.split(",").map(Number);return{x:B,y:E}},p=h.split(" ").map(g),m=p.slice(1).map((M,B)=>({start:p[B],end:M})),y=c?g(c):null,x=y?m.find(({start:M,end:B})=>{const E=Math.min(M.x,B.x)-1,O=Math.max(M.x,B.x)+1,$=Math.min(M.y,B.y)-1,I=Math.max(M.y,B.y)+1;return y.x>=E&&y.x<=O&&y.y>=$&&y.y<=I}):m.slice().sort((M,B)=>Math.hypot(B.end.x-B.start.x,B.end.y-B.start.y)-Math.hypot(M.end.x-M.start.x,M.end.y-M.start.y))[0];if(!x)return;const b=Math.abs(x.end.y-x.start.y)>Math.abs(x.end.x-x.start.x),S={x:(x.start.x+x.end.x)/2,y:(x.start.y+x.end.y)/2},T={...y??S};if(y)if(b){const M=d.height/2,B=f.y+f.height+4+M,E=f.y-4-M,O=Math.min(x.start.y,x.end.y)+M,$=Math.max(x.start.y,x.end.y)-M;T.y=B<=$?Math.max(O,B):Math.min($,E)}else{const M=d.width/2,B=f.x+f.width+4+M,E=f.x-4-M,O=Math.min(x.start.x,x.end.x)+M,$=Math.max(x.start.x,x.end.x)-M;T.x=B<=$?Math.max(O,B):Math.min($,E)}else{const M=b?d.width/2:d.height/2,B=[1,-1].map(E=>b?{x:S.x+E*(M+4),y:S.y}:{x:S.x,y:S.y+E*(M+4)}).find(E=>{const O={x:E.x-d.width/2,y:E.y-d.height/2,width:d.width,height:d.height};return u.every($=>!Ai(O,$,4))});if(!B)return;T.x=B.x,T.y=B.y}const k=o(l),_=s.getCTM(),L=l.parentElement?.getCTM();if(!_||!L)return;const v=new DOMPoint(T.x,T.y).matrixTransform(_).matrixTransform(L.inverse());l.setAttribute("transform",`translate(${v.x-k.x-k.width/2}, ${v.y-k.y-k.height/2})`),l.dataset.finalPathCenter=`${T.x},${T.y}`})}function Et(e,t,r){return{x:e.x+e.width*t,y:e.y+e.height*r}}function v$(e,t,r,i,o=!1){const a=Math.min(...i.map(f=>f.x)),s=Math.max(...i.map(f=>f.x+f.width)),n=Math.min(...i.map(f=>f.y)),l=Et(t,.5,1),c=Et(r,.5,0);if(e===Be.userSendsMessage)return[l,c];if(e===Be.agentResponds){const f=Et(t,.28,1),g=Et(r,.28,0),p=f.y+(o?38:50);return[f,{x:f.x,y:p},{x:g.x,y:p},g]}if(e===Be.toolStarts){if(o){const y=Math.min(t.x+t.width,r.x+r.width)-16;return[{x:y,y:t.y+t.height},{x:y,y:r.y}]}const f=r.y>=t.y,g=Et(t,.64,f?1:0),p=Et(r,.5,f?0:1),m=(g.y+p.y)/2;return[g,{x:g.x,y:m},{x:p.x,y:m},p]}if(e===Be.toolCompletes){if(o){const x=Math.max(t.x,r.x);return[{x,y:t.y},{x,y:r.y+r.height}]}const f=r.y>=t.y,g=Et(t,.72,f?1:0),p=Et(r,.8,f?0:1),m=92,y=g.y+(f?m:-m);return[g,{x:g.x,y},{x:p.x,y},p]}if(e===Be.agentAsksUser){const f=Et(t,0,o?.75:.35),g=Et(r,0,o?.25:.35),p=Math.min(f.x,g.x)-(o?60:50);return[f,{x:p,y:f.y},{x:p,y:g.y},g]}if(e===Be.userReplies){const f=Et(t,1,.65),g=Et(r,1,o?.95:.65),p=Math.max(f.x,g.x)+(o?32:30);return[f,{x:p,y:f.y},{x:p,y:g.y},g]}if(e===Be.agentFinishes){const f=Et(t,1,.35),g=Et(r,1,.35),p=o?Math.max(f.x,g.x)+40:s+90;return[f,{x:p,y:f.y},{x:p,y:g.y},g]}if(e===Be.requestFails){const f=Et(t,0,o?.9:.25),g=Et(r,0,o?.75:.25),p=a-(o?88:40);return[f,{x:p,y:f.y},{x:p,y:g.y},g]}if(e===Be.streamFails){if(o){const y=Et(t,0,.25),x=Et(r,0,.25),b=a-60;return[y,{x:b,y:y.y},{x:b,y:x.y},x]}const f=Et(t,.5,0),g=Et(r,0,.5),p=a-80,m=n-40;return[f,{x:f.x,y:m},{x:p,y:m},{x:p,y:g.y},g]}if(o){const f=Et(t,0,.9),g=Et(r,0,.1),p=a-92;return[f,{x:p,y:f.y},{x:p,y:g.y},g]}const h=Et(t,1,.75),d=Et(r,0,.75),u=(h.x+d.x)/2;return[h,{x:u,y:h.y},{x:u,y:d.y},d]}function nr(e){return e.slice(1).map((t,r)=>({start:e[r],end:t}))}function vs(e,t){const r=Math.abs(e.start.y-e.end.y)<.001,i=Math.abs(t.start.y-t.end.y)<.001;return r!==i?!1:r?Math.abs(e.start.y-t.start.y)>=.001?!1:Math.min(e.start.x,e.end.x)<Math.max(t.start.x,t.end.x)-.001&&Math.min(t.start.x,t.end.x)<Math.max(e.start.x,e.end.x)-.001:Math.abs(e.start.x-t.start.x)>=.001?!1:Math.min(e.start.y,e.end.y)<Math.max(t.start.y,t.end.y)-.001&&Math.min(t.start.y,t.end.y)<Math.max(e.start.y,e.end.y)-.001}function M$(e,t,r=[],i){return nr(e).flatMap((o,a)=>{const s=Math.abs(o.start.y-o.end.y)<.001,n=Math.hypot(o.end.x-o.start.x,o.end.y-o.start.y),l=i?Fu(i,o.start,o.end):1,c=(s?t.width:t.height)+F1*2/l;return n>=c&&!r.some(h=>vs(o,h))?[{segment:o,index:a,horizontal:s,capacity:n,excess:n-c}]:[]}).sort((o,a)=>Number(a.horizontal)-Number(o.horizontal)||a.excess-o.excess)[0]}function T$(e,t){if(!t||t.direction!=="TB"||!e.id)return;const r=Object.entries(bp),i=new Set(["root_start",...Object.values(bp).flat()]);if(t.nodes.length!==i.size||new Set(t.nodes.map(d=>d.id)).size!==i.size||new Set(t.nodes.map(d=>d.domId)).size!==i.size||t.nodes.some(d=>!i.has(d.id)||!d.domId||d.isGroup||d.parentId||d.shape!==(d.id==="root_start"?"stateStart":"rect"))||t.edges.length!==r.length+1||new Set(t.edges.map(d=>d.id)).size!==t.edges.length||t.edges.filter(d=>d.start==="root_start"&&d.end==="Idle").length!==1)return;const o=[...e.querySelectorAll('.edgePaths path, path.transition[data-edge="true"]')],a=[...e.querySelectorAll(".edgeLabels > .edgeLabel")],s=[...e.querySelectorAll("g.node")];if(o.length!==t.edges.length||s.length!==t.nodes.length)return;const n=new Map;for(const d of o){const u=d.dataset.id;if(!u||n.has(u)||d.id!==`${e.id}-${u}`||!t.edges.some(f=>f.id===u))return;n.set(u,d)}const l=new Map;for(const d of a){const u=d.querySelector(":scope > .label[data-id]")?.getAttribute("data-id");if(!u||l.has(u)||!n.has(u))return;l.set(u,d)}const c=new Map;for(const d of t.nodes){const u=s.filter(f=>f.id===`${e.id}-${d.domId}`);if(u.length!==1)return;c.set(d.id,u[0])}const h=[];for(const[d,[u,f]]of r){const g=t.edges.filter(x=>x.start===u&&x.end===f);if(g.length!==1)return;const p=g[0],m=n.get(p.id),y=l.get(p.id);if(!m||!y)return;h.push({edge:p,path:m,label:y,kind:d})}return{paths:o,labels:a,nodesById:c,routes:h,diagram:t}}function B$(e,t=!1,r){if(!e.classList.contains("statediagram"))return;for(const b of e.querySelectorAll("g.statediagram-cluster")){const S=b.querySelector(":scope > g > rect.outer"),T=b.querySelector(":scope > rect.inner"),k=b.querySelector(":scope > .cluster-label");if(!S||!T||!k)continue;const _=rr(k,b),L=k.transform.baseVal.consolidate()?.matrix;if(!_||!L)continue;const v=S.y.baseVal.value+6;k.setAttribute("transform",`translate(${L.e},${L.f+v-_.y})`);const M=Math.max(T.y.baseVal.value,v+_.height+6);T.setAttribute("height",String(Math.max(0,T.height.baseVal.value-(M-T.y.baseVal.value)))),T.setAttribute("y",String(M));for(const B of e.querySelectorAll("path.transition[data-points]")){let E;try{E=JSON.parse(atob(B.dataset.points))}catch{continue}if(E.length<4)continue;const[O,$,I]=E,F=rr(S,B);if(!F||Math.abs(O.y-F.y)>.5||O.x<F.x||O.x>F.x+F.width||O.x!==$.x||$.y!==I.y||Math.abs($.x-I.x)>8||I.x<F.x+8||I.x>F.x+F.width-8)continue;E[0]={x:I.x,y:O.y},E.splice(1,1),E=_r(E);const R=Eu(E);B.setAttribute("d",R),B.dataset.terminalGapBasePath=R,B.dataset.manhattanPoints=E.map(({x:q,y:D})=>`${q},${D}`).join(" ")}}let i;try{i=T$(e,r??JSON.parse(e.dataset.stateRouteGraph??"null"))}catch{return}if(!i)return;const{paths:o,labels:a,nodesById:s,routes:n}=i,l=o[0];if(!l)return;const c=new Map,h=new Map;for(const[b,S]of s){const T=Je(S),k=T&&rr(T,l);if(!T||!k||!Object.values(k).every(Number.isFinite)||t&&!S.transform.baseVal.consolidate()?.matrix)return;c.set(b,k),h.set(b,{node:S,shape:T})}e.dataset.stateRouteGraph=JSON.stringify({direction:i.diagram.direction,nodes:i.diagram.nodes.map(({id:b,domId:S,shape:T})=>({id:b,domId:S,shape:T})),edges:i.diagram.edges.map(({id:b,start:S,end:T})=>({id:b,start:S,end:T}))});for(const b of[...o,...a])b.style.setProperty("transition-property","none","important");if(t){const b=c.get("Idle");if(!b)return;const S=b.x+b.width/2;[{name:"Starting",centerOffset:0,yOffset:138},{name:"Streaming",centerOffset:0,yOffset:258},{name:"RunningTool",centerOffset:0,yOffset:396},{name:"NeedsInput",centerOffset:0,yOffset:578},{name:"Complete",centerOffset:0,yOffset:738},{name:"Failed",centerOffset:0,yOffset:898}].forEach(({name:k,centerOffset:_,yOffset:L})=>{const v=h.get(k),M=c.get(k),B=v?.node.transform.baseVal.consolidate()?.matrix;if(!v||!M||!B)return;const E={x:S+_-M.width/2,y:b.y+L};v.node.style.setProperty("transition-property","none","important"),v.node.setAttribute("transform",`translate(${B.e+E.x-M.x}, ${B.f+E.y-M.y})`),c.set(k,{...M,...E})})}const d=[...c].flatMap(([b,S])=>b==="root_start"?[]:[S]),u=[],f=[],g=[];n.forEach(({edge:b,path:S,label:T,kind:k})=>{T.dataset.routePathId=S.id,S.dataset.routeLabel=k;const _=c.get(b.start),L=c.get(b.end);if(!_||!L)return;const v=_r(v$(k,_,L,d,t)),M=v[1]?Fu(S,v[0],v[1]):1,B=R3(v,d.filter(F=>F!==_&&F!==L),Au/M,f);g.push(...B);const E=T.getBBox(),O=k===Be.agentFinishes?B.slice(1,3):B,$=M$(O,E,u,S)??O.slice(0,-1).map((F,R)=>{const q=O[R+1];return{segment:{start:F,end:q},capacity:Math.hypot(q.x-F.x,q.y-F.y)}}).sort((F,R)=>R.capacity-F.capacity)[0];if(!$)return;S.setAttribute("d",B.map((F,R)=>`${R?"L":"M"}${F.x},${F.y}`).join(""));const I=k===Be.toolStarts&&B[1]&&B[2]?{start:B[1],end:B[2]}:k===Be.agentAsksUser&&B[1]&&B[2]?{start:B[1],end:B[2]}:k===Be.agentFinishes&&B[1]&&B[2]?{start:B[1],end:B[2]}:!t&&k===Be.userReplies&&B[1]&&B[2]?{start:B[1],end:B[2]}:k===Be.requestFails&&B[1]&&B[2]?{start:B[1],end:B[2]}:t&&k===Be.userRetries&&B[2]&&B[3]?{start:B[2],end:B[3]}:$.segment;S.dataset.routeLabel=k,S.dataset.labelSegment=`${I.start.x},${I.start.y} ${I.end.x},${I.end.y}`,S.dataset.labelCapacity=String(Math.hypot(I.end.x-I.start.x,I.end.y-I.start.y)),S.dataset.manhattanSegments=String(B.length-1),S.dataset.manhattanPoints=B.map(F=>`${F.x},${F.y}`).join(" "),S.dataset.terminalTarget=h.get(b.end)?.node.id??b.end,T.dataset.routePathId=S.id,u.push(I),f.push(...nr(B))});const p=Math.min(...d.map(b=>b.x),...g.map(b=>b.x)),m=Math.min(2,...d.map(b=>b.y),...g.map(b=>b.y)),y=Math.max(...d.map(b=>b.x+b.width),...g.map(b=>b.x)),x=Math.max(...d.map(b=>b.y+b.height),...g.map(b=>b.y));return{x:p,y:m,width:y-p,height:x-m}}function _$(e,t,r,i,o=8){if(e.length<2)return e;const a=i.map(({start:f,end:g})=>({x:Math.min(f.x,g.x),y:Math.min(f.y,g.y),width:Math.abs(g.x-f.x),height:Math.abs(g.y-f.y)})),s=f=>nr(f).every(g=>!Br(g,t)&&[...r,...a].every(p=>!Br(g,p,o)));if(s(e))return e;const n=e[0],l=Fa(n,e[1]),c={...n},h=o*2;l==="top"&&(c.y-=h),l==="bottom"&&(c.y+=h),l==="left"&&(c.x-=h),l==="right"&&(c.x+=h);const d=[{point:Et(t,.5,0),dx:0,dy:-h},{point:Et(t,1,.5),dx:h,dy:0},{point:Et(t,.5,1),dx:0,dy:h},{point:Et(t,0,.5),dx:-h,dy:0}].flatMap(({point:f,dx:g,dy:p})=>{const m={x:f.x+g,y:f.y+p};return[[n,c,{x:c.x,y:m.y},m,f],[n,c,{x:m.x,y:c.y},m,f]].map(_r).filter(y=>{const x=y[1],b=y.at(-2);return(x.x-n.x)*(c.x-n.x)+(x.y-n.y)*(c.y-n.y)>0&&(b.x-f.x)*g+(b.y-f.y)*p>0&&s(y)})}),u=f=>nr(f).reduce((g,{start:p,end:m})=>g+Math.hypot(m.x-p.x,m.y-p.y),0);return d.toSorted((f,g)=>u(f)-u(g))[0]??e}function L$(e){if(!e.classList.contains("statediagram"))return;const t=[...e.querySelectorAll('.edgePaths path, path.transition[data-edge="true"]')],r=t[0];if(!r)return;const i=[...e.querySelectorAll("g.node")].flatMap(a=>{const s=Je(a),n=s&&rr(s,r);return s&&n?[{node:a,shape:s,bounds:n}]:[]}),o=t.flatMap(a=>{let s;try{s=a.dataset.manhattanPoints?a.dataset.manhattanPoints.split(" ").map(l=>{const[c,h]=l.split(",").map(Number);return{x:c,y:h}}):JSON.parse(atob(a.dataset.points??""))}catch{return[]}if(!Array.isArray(s)||s.length<2||s.some(l=>!l||!Number.isFinite(l.x)||!Number.isFinite(l.y)))return[];const n=l=>i.toSorted((c,h)=>lo(l,c.bounds)-lo(l,h.bounds))[0];return[{path:a,points:s,source:n(s[0]),target:n(s.at(-1))}]});for(const a of o){const{path:s,points:n,source:l,target:c}=a;if(!l||!c||l===c||l.shape.tagName!=="circle"||c.shape.tagName!=="rect"||o.some(p=>p.target===l))continue;const h=[...e.querySelectorAll(".edgeLabels > .edgeLabel")].flatMap(p=>{if(!p.textContent?.trim())return[];const m=kr(p,s);return m?[m]:[]}),d=_$(n,c.bounds,[...i.filter(p=>p!==l&&p!==c).map(p=>p.bounds),...h],o.filter(p=>p!==a).flatMap(p=>nr(p.points)));if(d===n)continue;const u=Eu(d);s.setAttribute("d",u),s.dataset.terminalGapBasePath=u,s.dataset.manhattanPoints=d.map(({x:p,y:m})=>`${p},${m}`).join(" "),s.dataset.manhattanSegments=String(d.length-1),s.dataset.terminalTarget=c.node.id;const f=d.at(-1),g=d.at(-2);s.dataset.terminalDirection=`${f.x-g.x},${f.y-g.y}`,a.points=d}}function A$(e){const t=[...e.querySelectorAll('.edgePaths path, path.transition[data-edge="true"]')],r=[...e.querySelectorAll(".edgeLabels > .edgeLabel")],i=t[0];if(!i)return;const o=[...e.querySelectorAll("g.node")].flatMap(s=>{const n=Je(s),l=n&&rr(n,i);if(!n||!l)return[];const c=getComputedStyle(n);return[{...l,corner:{x:Math.min(l.width/2,Number.parseFloat(c.rx)||0),y:Math.min(l.height/2,Number.parseFloat(c.ry)||0)}}]}),a=t.flatMap(s=>{const n=(s.dataset.manhattanPoints??"").split(" ").map(c=>{const[h,d]=c.split(",").map(Number);return{x:h,y:d}});if(n.length<2||n.some(({x:c,y:h})=>!Number.isFinite(c)||!Number.isFinite(h)))return[];const l=c=>o.toSorted((h,d)=>lo(c,h)-lo(c,d))[0];return[{path:s,points:n,source:l(n[0]),target:l(n.at(-1))}]});for(const s of a){const{path:n,points:l,source:c,target:h}=s;if(!c||!h||h.y<=c.y||l[1].y>=Math.min(c.y,h.y)-Math.max(c.height,h.height))continue;const d=r.find(v=>v.dataset.routePathId===n.id),u=d&&kr(d,n);if(!d||!u)continue;const f=a.filter(v=>v!==s),g=f.flatMap(v=>nr(v.points)),p=o.filter(v=>v!==c&&v!==h),m=r.filter(v=>v!==d).flatMap(v=>{const M=kr(v,n);return M?[M]:[]}),y=v=>f.flatMap(M=>[...M.source===v?[M.points[0]]:[],...M.target===v?[M.points.at(-1)]:[]]),x=I1(l,c,h,[...p,...m],g,y(c),y(h),{bounds:u,obstacles:m,occupied:g},!1,!0);if(x===l)continue;const b=$n(x,u,[...o,...m],g);if(!b)continue;s.points=x,n.setAttribute("d",x.map(({x:v,y:M},B)=>`${B?"L":"M"}${v},${M}`).join("")),n.dataset.manhattanPoints=x.map(({x:v,y:M})=>`${v},${M}`).join(" "),n.dataset.manhattanSegments=String(x.length-1),n.dataset.labelSegment=`${b.start.x},${b.start.y} ${b.end.x},${b.end.y}`;const S=x.at(-1),T=x.at(-2);n.dataset.terminalDirection=`${S.x-T.x},${S.y-T.y}`,delete n.dataset.terminalGapBasePath;const k=d.getBBox(),_=d.parentElement?.getCTM(),L=n.getCTM();if(_&&L){const v=new DOMPoint(b.center.x,b.center.y).matrixTransform(L).matrixTransform(_.inverse());d.setAttribute("transform",`translate(${v.x-k.x-k.width/2},${v.y-k.y-k.height/2})`),d.dataset.finalPathCenter=`${b.center.x},${b.center.y}`}}}function F$(e,t){if(e.nativeId){const i=t.flatMap((o,a)=>o.nativeId===e.nativeId?[a]:[]);if(i.length)return i.length===1?i[0]:null}if(e.routePathId){const i=t.flatMap((o,a)=>o.id===e.routePathId?[a]:[]);if(i.length)return i.length===1?i[0]:null}const r=t.flatMap((i,o)=>i.intersectsLabel?[o]:[]);return r.length===1?r[0]:null}function $$(e,t){const r=kr(t,e),i=e.getTotalLength();if(!r||!i)return!1;const o=Math.max(1,Math.min(r.width,r.height)/4),a=Math.max(16,Math.min(2048,Math.ceil(i/o)));return Array.from({length:a+1},(s,n)=>e.getPointAtLength(i*n/a)).some(s=>lo(s,r)<=.5)}function E$(e){if(!e.classList.contains("statediagram"))return;const t=[...e.querySelectorAll('.edgePaths path, path.transition[data-edge="true"]')],r=[...e.querySelectorAll(".edgeLabels > .edgeLabel")],i=new Set;r.forEach(o=>{if(o.textContent?.replace(/\s+/g," ").trim().toLowerCase()!=="fail")return;const a=o.querySelector(":scope > .label[data-id]")?.getAttribute("data-id"),s=F$({nativeId:a??void 0,routePathId:o.dataset.routePathId},t.map(L=>({id:L.id,nativeId:L.dataset.id,intersectsLabel:$$(L,o)}))),n=s===null?void 0:t[s];if(!n||i.has(n))return;const l=n.getTotalLength();if(!l)return;const c=n.getPointAtLength(0),h=n.getPointAtLength(l),d=[...e.querySelectorAll("g.node")].flatMap(L=>{const v=Je(L),M=v&&rr(v,n);return v&&M?[{node:L,shape:v,bounds:M}]:[]}),u=d.toSorted((L,v)=>lo(c,L.bounds)-lo(c,v.bounds))[0],f=d.toSorted((L,v)=>lo(h,L.bounds)-lo(h,v.bounds))[0];if(!u||!f||u===f||f.bounds.y>=u.bounds.y)return;const g=Math.max(u.bounds.x,f.bounds.x),p=Math.min(u.bounds.x+u.bounds.width,f.bounds.x+f.bounds.width);if(p<=g)return;const m=g+(p-g)*.75,y=getComputedStyle(u.shape),x=Math.min(u.bounds.width/2,Number.parseFloat(y.rx)||0),b=Math.min(u.bounds.height/2,Number.parseFloat(y.ry)||0),S=Math.max(u.bounds.x+x-m,m-(u.bounds.x+u.bounds.width-x),0),T=x>0?b*(1-Math.sqrt(Math.max(0,1-(S/x)**2))):0,k=[{x:m,y:u.bounds.y+T},{x:m,y:f.bounds.y+f.bounds.height}],_=`M${k[0].x},${k[0].y}L${k[1].x},${k[1].y}`;n.setAttribute("d",_),n.dataset.terminalGapBasePath=_,n.dataset.manhattanPoints=k.map(L=>`${L.x},${L.y}`).join(" "),n.dataset.manhattanSegments="1",n.dataset.labelSegment=`${k[0].x},${k[0].y} ${k[1].x},${k[1].y}`,n.dataset.routeLabel="fail",n.dataset.terminalTarget=f.node.id,n.dataset.terminalDirection="0,-1",o.dataset.routePathId=n.id,i.add(n)})}function P$(e,t=!1){if(!e.classList.contains("statediagram"))return null;const r=[],i=[...e.querySelectorAll("g.node")].flatMap(d=>{const u=d.transform.baseVal.consolidate()?.matrix,f=d.getBBox();return u?[{x:f.x+u.e,y:f.y+u.f,width:f.width,height:f.height}]:[]}),o=[...e.querySelectorAll('.edgePaths path, path.transition[data-edge="true"]')].map(d=>{const u=(d.dataset.manhattanPoints??"").split(" ").map(f=>f.split(",").map(Number)).filter(f=>f.length===2&&f.every(Number.isFinite)).map(([f,g])=>({x:f,y:g}));return{path:d,segments:u.slice(1).map((f,g)=>({start:u[g],end:f}))}}),a=(d,u,f=4)=>d.x<u.x+u.width+f&&d.x+d.width+f>u.x&&d.y<u.y+u.height+f&&d.y+d.height+f>u.y,s=(d,u)=>{if(Math.abs(d.start.x-d.end.x)<.5){const p=Math.min(d.start.y,d.end.y),m=Math.max(d.start.y,d.end.y);return d.start.x>u.x-3&&d.start.x<u.x+u.width+3&&m>u.y-3&&p<u.y+u.height+3}const f=Math.min(d.start.x,d.end.x),g=Math.max(d.start.x,d.end.x);return d.start.y>u.y-3&&d.start.y<u.y+u.height+3&&g>u.x-3&&f<u.x+u.width+3};for(const d of e.querySelectorAll(".edgeLabels > .edgeLabel")){const u=d.dataset.routePathId,f=u?e.querySelector(`#${CSS.escape(u)}`):null,g=f?.dataset.labelSegment?.match(/-?(?:\d+(?:\.\d*)?|\.\d+)/g)?.map(Number);if(!f||!g||g.length!==4)continue;const p=d.getBBox(),m=t?f.dataset.routeLabel===Be.requestFails?[.03]:[.5,.25,.75,.15,.35,.65,.85]:[.5,.25,.75],y=o.find($=>$.path===f)?.segments??[],x=t&&f.dataset.routeLabel===Be.userRetries?y.findLast($=>Math.abs($.start.y-$.end.y)<.5&&Math.abs($.start.x-$.end.x)>=p.width):void 0,b=t&&(f.dataset.routeLabel===Be.agentAsksUser||f.dataset.routeLabel===Be.toolStarts||f.dataset.routeLabel===Be.requestFails||f.dataset.routeLabel===Be.userRetries)||!t&&(f.dataset.routeLabel===Be.agentAsksUser||f.dataset.routeLabel===Be.agentFinishes||f.dataset.routeLabel===Be.toolStarts||f.dataset.routeLabel===Be.userReplies||f.dataset.routeLabel===Be.requestFails),T=[x?{x1:x.start.x,y1:x.start.y,x2:x.end.x,y2:x.end.y}:{x1:g[0],y1:g[1],x2:g[2],y2:g[3]},...b?[]:y.map(({start:$,end:I})=>({x1:$.x,y1:$.y,x2:I.x,y2:I.y}))].filter(($,I,F)=>F.findIndex(R=>R.x1===$.x1&&R.y1===$.y1&&R.x2===$.x2&&R.y2===$.y2)===I).flatMap($=>{const I={start:{x:$.x1,y:$.y1},end:{x:$.x2,y:$.y2}},F=Math.hypot(I.end.x-I.start.x,I.end.y-I.start.y),q=(Math.abs(I.start.y-I.end.y)<.5?p.width:p.height)/2,D=F1/Fu(f,I.start,I.end);return m.filter(P=>F*Math.max(P,1-P)>=q+D).map(P=>{const Y={x:$.x1+($.x2-$.x1)*P,y:$.y1+($.y2-$.y1)*P};if(t&&Math.abs($.x1-$.x2)<.5&&(f.dataset.routeLabel===Be.userReplies||f.dataset.routeLabel===Be.agentFinishes)&&(Y.x-=p.width/2-(f.dataset.routeLabel===Be.userReplies?0:6)),t&&Math.abs($.x1-$.x2)<.5&&f.dataset.routeLabel===Be.agentResponds&&(Y.y+=6),Math.abs($.x1-$.x2)<.5&&(t&&(f.dataset.routeLabel===Be.agentAsksUser||f.dataset.routeLabel===Be.requestFails||f.dataset.routeLabel===Be.streamFails)||!t&&f.dataset.routeLabel===Be.requestFails)){const K=f.dataset.routeLabel===Be.agentAsksUser?0:f.dataset.routeLabel===Be.streamFails?-26:0;Y.x+=p.width/2+K}t&&Math.abs($.y1-$.y2)<.5&&f.dataset.routeLabel===Be.userRetries&&(Y.x+=12,Y.y-=p.height/2-4),!t&&Math.abs($.x1-$.x2)<.5&&f.dataset.routeLabel===Be.toolCompletes&&(Y.x+=p.width/2-6);const Q={x:Y.x-p.width/2,y:Y.y-p.height/2,width:p.width,height:p.height},rt=r.filter(K=>a(Q,K)).length,ht=i.filter(K=>a(Q,K,5)).length,H=o.filter(K=>K.path!==f).flatMap(K=>K.segments).filter(K=>s(K,Q)).length,G=F*Math.min(P,1-P);return{midpoint:Y,bounds:Q,score:rt*1e4+ht*1e4+H*1e3+(G<q+D?100:0)+Math.abs(P-.5)}})});if(T.length===0)continue;const k=T;k.sort(($,I)=>{const F=Math.floor($.score/1e3)-Math.floor(I.score/1e3);if(F!==0)return F;if(t&&f.dataset.routeLabel===Be.toolStarts){const R=g[1]+(g[3]-g[1])*.65;return Math.abs($.midpoint.y-R)-Math.abs(I.midpoint.y-R)}if(t&&f.dataset.routeLabel===Be.agentAsksUser){const R=g[1]+(g[3]-g[1])*.65;return Math.abs($.midpoint.y-R)-Math.abs(I.midpoint.y-R)}if(t&&f.dataset.routeLabel===Be.requestFails){const R=g[1]+(g[3]-g[1])*.04;return Math.abs($.midpoint.y-R)-Math.abs(I.midpoint.y-R)}if(!t&&f.dataset.routeLabel===Be.agentAsksUser)return $.midpoint.x-I.midpoint.x;if(!t&&f.dataset.routeLabel===Be.agentFinishes){const R=(g[0]+g[2])/2;return Math.abs($.midpoint.x-R)-Math.abs(I.midpoint.x-R)}return!t&&f.dataset.routeLabel===Be.toolStarts?I.midpoint.y-$.midpoint.y:!t&&f.dataset.routeLabel===Be.userReplies?I.midpoint.x-$.midpoint.x:$.score-I.score});const _=k[0].midpoint,L={x:_.x-p.width/2,y:_.y-p.height/2,width:p.width,height:p.height},v=f.getCTM(),M=d.parentElement?.getCTM(),B=v&&M?new DOMPoint(_.x,_.y).matrixTransform(v).matrixTransform(M.inverse()):_,E=B.x-(p.x+p.width/2),O=B.y-(p.y+p.height/2);d.setAttribute("transform",`translate(${E}, ${O})`),d.dataset.finalPathCenter=`${_.x},${_.y}`,r.push(L)}if(A$(e),!r.length)return null;const n=Math.min(...r.map(d=>d.x)),l=Math.min(...r.map(d=>d.y)),c=Math.max(...r.map(d=>d.x+d.width)),h=Math.max(...r.map(d=>d.y+d.height));return{x:n,y:l,width:c-n,height:h-l}}var I$=ar('<div class="mermaid-error svelte-9cn23y"><div class="error-feedback svelte-9cn23y" role="alert"><strong class="svelte-9cn23y"> </strong> <p class="svelte-9cn23y"> </p></div> <details class="error-details svelte-9cn23y"><summary class="svelte-9cn23y"> </summary> <pre class="error-message svelte-9cn23y"> </pre> <strong class="svelte-9cn23y"> </strong> <pre class="error-source-code svelte-9cn23y"> </pre></details></div>'),O$=ar('<div role="toolbar"><!> <!> <!></div>'),D$=ar('<div class="mermaid-source svelte-9cn23y" role="region"><pre class="svelte-9cn23y"> </pre></div>'),R$=ar('<div class="mermaid-svg-container svelte-9cn23y"><div><div class="mermaid-svg mermaid-presentation svelte-9cn23y"></div></div> <!></div> <!>',1),N$=ar('<div class="mermaid-empty svelte-9cn23y" role="status"><strong class="svelte-9cn23y"> </strong> <span class="svelte-9cn23y"> </span></div>'),q$=ar('<div class="mermaid-loading svelte-9cn23y" role="status"> </div>'),W$=ar('<div class="fullscreen-diagram mermaid-presentation svelte-9cn23y" style="--mermaid-font-family: var(--font-ui)"></div>'),z$=ar('<div class="fullscreen-surface h-[90vh] w-[90vw] overflow-hidden rounded-lg shadow-2xl svelte-9cn23y" data-media-lightbox-content=""><!></div>'),H$=ar('<div style="--mermaid-font-family: var(--font-ui)"><span class="mermaid-actor-icon-template svelte-9cn23y" aria-hidden="true"><!></span> <!></div> <!>',1);function Y$(e,t){if(new.target)return Oo({component:Y$,...e});No(t,!0);const r=CC("MermaidRenderer"),i=12,o=16,a=["--background","--foreground","--card","--card-foreground","--muted","--muted-foreground","--border","--accent","--accent-foreground","--diagram-canvas","--diagram-node-surface","--diagram-connector","--font-ui","--text-caption-size","--radius-small"],s={streamFails:"Stream fails"};let n=He(t,"code",7),l=He(t,"isStreaming",7,!1),c=He(t,"className",7,""),h=He(t,"showExpandButton",7,!0),d=He(t,"showSourceButton",7,!0),u=He(t,"showExportButton",7,!1),f=He(t,"showSource",15,!1),g=He(t,"onRenderStateChange",7),p=ce(""),m=ce(null),y=ce(!1),x=ce(!1),b=ce(""),S=ce(null),T=ce(void 0),k=ce(void 0),_=ce(void 0),L=ce(void 0),v,M=ce(0),B=ce(!1),E=ce(!1),O=0,$=ce(0),I=0,F=ce(0),R=Dt(()=>z(P(n())));const q=wC(kC);function D(){const at=getComputedStyle(document.documentElement);return[at.fontSize,...a.map(ut=>at.getPropertyValue(ut).trim())].join("\0")}function P(at){try{return/^[A-Za-z0-9+/=]+$/.test(at.trim())?decodeURIComponent(escape(atob(at))):at}catch{return at}}function Y(at){return!/^\s*stateDiagram(?:-v2)?\b/m.test(at)||/^\s*direction\s+(?:LR|RL|TB|BT)\b/m.test(at)?at:at.replace(/^(\s*stateDiagram(?:-v2)?\b[^\n]*)/m,`$1
315
+ `){i(!0,!0);continue}r+=a,(/\s/.test(a)||m3.test(a))&&i(!0)}return i(!1),t}function fp(e){return pc(e).map(t=>t.text.trim()).filter(Boolean)}function _u(e){if(/\s/.test(e)||!/\.[A-Za-z][A-Za-z0-9]*$/.test(e))return null;const t=e.split(".");return t.length<=2?e.length<=21?[e]:[t[0],`.${t[1]}`]:[`${t.slice(0,-2).join(".")}.`,t.slice(-2).join(".")]}function y3(e){const t=_u(e);return t||e.split(/\s+/).flatMap(r=>r.match(/[^./\\]+[./\\]?/g)??[]).filter(Boolean)}const x3=new Intl.Segmenter(void 0,{granularity:"grapheme"});function ad(e){return Array.from(x3.segment(e),({segment:t})=>t)}function gp(e,t,r,i=!1){const o=Math.max(1,t);let a=1,s="";for(const[n,l]of e.entries()){const c=l.replace(/[\t\r\f ]+/g," "),h=`${s}${c}`.trimStart();if(r(h.trimEnd())<=o){s=h;continue}s.trim()&&(a+=1),s="";for(const d of ad(c.trimStart()))s&&r(`${s}${d}`.trimEnd())>o&&(a+=1,s=""),s+=d;i&&r(c.trim())>o&&n<e.length-1&&(a+=1,s="")}return a}function b3(e){const t=new Map(e.map(({id:i,nodes:o})=>[i,[...o]])),r=new Map;for(const i of t.keys()){const o=new Set,a=s=>{if(!(s===i||o.has(s))){o.add(s);for(const n of t.get(s)??[])a(n)}};for(const s of t.get(i)??[])a(s);r.set(i,o)}return r}function Lu(e,t){return t.has(e.id)?e.id:[...t.keys()].filter(r=>e.id.endsWith(`-${r}`)).toSorted((r,i)=>i.length-r.length)[0]}function B1(e,t,r){const i=document.createElementNS("http://www.w3.org/2000/svg","rect");i.classList.add("edge-label-knockout"),i.setAttribute("x",String(r.x-6)),i.setAttribute("y",String(r.y-4)),i.setAttribute("width",String(r.width+12)),i.setAttribute("height",String(r.height+8)),i.setAttribute("rx","2"),i.dataset.labelPaddingX="6",i.dataset.labelPaddingY="4",e.insertBefore(i,t)}function pp(e){const t=[];for(const r of e.querySelectorAll("g.edgeLabel")){if(r.querySelector(".edge-label-knockout, rect.background, foreignObject"))continue;const i=r.querySelector("text");i&&t.push({parent:r,before:r.firstElementChild,bounds:i.getBBox()})}for(const r of e.querySelectorAll("text.messageText, text.loopText")){if(r.dataset.labelKnockout==="true"||!r.textContent?.trim())continue;const i=r.parentElement;i&&t.push({parent:i,before:r,bounds:r.getBBox(),text:r})}for(const{parent:r,before:i,bounds:o,text:a}of t)B1(r,i,o),a&&(a.dataset.labelKnockout="true")}function C3(e){const t=getComputedStyle(e),r=t.font||`${t.fontStyle} ${t.fontWeight} ${t.fontSize} ${t.fontFamily}`;return document.fonts?.load(r,e.textContent??"")}const mp="rect, circle, ellipse, polygon, path",yp=new WeakMap;function w3(){const e=new Map;let t;return r=>{if(e.has(r))return e.get(r);let i=r==="none"?ao(0,0,0,0):Kl(r)?.rgb()??null;if(!i&&typeof CSS<"u"&&CSS.supports("color",r)){if(t===void 0){const o=document.createElement("canvas");o.width=o.height=1,t=o.getContext("2d")}if(t){t.clearRect(0,0,1,1),t.fillStyle=r,t.fillRect(0,0,1,1);const[o,a,s,n]=t.getImageData(0,0,1,1).data;i=ao(o,a,s,n/255)}}return i=i?.clamp()??null,e.set(r,i),i}}function Un(e,t){const r=e.opacity+t.opacity*(1-e.opacity);if(!r)return ao(0,0,0,0);const i=(o,a)=>(o*e.opacity+a*t.opacity*(1-e.opacity))/r;return ao(i(e.r,t.r),i(e.g,t.g),i(e.b,t.b),r)}function Vn(e){return e?e.endsWith("%")?Number.parseFloat(e)/100:Number(e):1}function k3(e,t){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;for(const d of yp.get(e)??[])d();const r=[];yp.set(e,r);const i=w3();let o=ao(0,0,0,0);for(let d=e;d;d=d.parentElement){const u=getComputedStyle(d);if(u.backgroundImage&&u.backgroundImage!=="none")return;const f=i(u.backgroundColor);if(!f)return;if(o=Un(o,f),o.opacity===1)break}if(o.opacity!==1)return;const a=[...e.querySelectorAll("g.cluster")],s=new Map(a.map(d=>[d,t?Lu(d,t):d.id])),n=d=>{const u=s.get(d)??d.id.match(/flowchart-(.+?)-\d+$/)?.[1]??d.id,f=a.filter(g=>{const p=s.get(g);return g!==d&&p&&t?.get(p)?.has(u)});return f.length?f.sort((g,p)=>t.get(s.get(g)).size-t.get(s.get(p)).size)[0]:d.parentElement?.closest("g.cluster")??void 0},l=new Map,c=(d,u=new Set)=>{if(l.has(d))return l.get(d);if(u.has(d))return null;u.add(d);const f=n(d),g=f?c(f,u):o;if(!g)return null;const p=d.querySelector(":scope > .label-container"),m=p?.matches(mp)?p:p?.querySelector(mp)??d.querySelector(":scope > rect, :scope > circle, :scope > ellipse, :scope > polygon, :scope > path");if(!m)return null;const y=getComputedStyle(m),x=i(y.fill),b=x?Un(ao(x.r,x.g,x.b,x.opacity*Vn(y.fillOpacity)*Vn(y.opacity)),g):null;return l.set(d,b),b},h=[];for(const d of e.querySelectorAll("g.node, g.cluster")){const u=c(d);if(!u)continue;const f=d.querySelector(":scope > .label, :scope > .cluster-label");if(f)for(const g of f.querySelectorAll("text, tspan, foreignObject *")){if(g.closest("svg")!==e||![...g.childNodes].some(v=>v.nodeType===3&&v.textContent?.trim()))continue;let p=!1,m=u;const y=[];for(let v=g;v&&v!==e;v=v.parentElement){const M=getComputedStyle(v);(M.display==="none"||M.visibility==="hidden"||Vn(M.opacity)!==1)&&(p=!0),v.namespaceURI==="http://www.w3.org/1999/xhtml"&&y.unshift(v)}if(p)continue;for(const v of y){const M=getComputedStyle(v),B=i(M.backgroundColor);if(!B||M.backgroundImage&&M.backgroundImage!=="none"){p=!0;break}m=Un(B,m)}if(p)continue;const x=getComputedStyle(g),b=g.namespaceURI==="http://www.w3.org/1999/xhtml"?"color":"fill",S=i(x.getPropertyValue(b)),T=b==="fill"?Vn(x.fillOpacity):1;if(!S||!S.opacity||!T)continue;const k=v=>HC(Un(ao(v.r,v.g,v.b,v.opacity*T),m).formatHex(),m.formatHex()).ratio;if(k(S)>=4.5)continue;const L=[i(getComputedStyle(e).color),ao(0,0,0),ao(255,255,255)].filter(v=>v!==null).filter(v=>k(v)>=4.55)[0];L&&h.push({element:g,property:b,value:L.formatRgb()})}}for(const{element:d,property:u,value:f}of h){const g=d.style.getPropertyValue(u),p=d.style.getPropertyPriority(u);r.push(()=>{g?d.style.setProperty(u,g,p):d.style.removeProperty(u)}),d.style.setProperty(u,f,"important")}}function S3(e,t,r,i){if(!/^(TB|TD)$/.test(i)||r.size<2||r.size>8||e.size>16||t.length>24||t.some(u=>!e.has(u.source)||!e.has(u.target)))return[];const o=new Map;for(const[u,f]of r){if(!f.members.length)return[];for(const g of f.members){if(!e.has(g)||o.has(g))return[];o.set(g,u)}}if(o.size!==e.size)return[];const a=(u,f)=>{const g=new Map,p=new Set(u);for(let m=0;p.size;m++){const y=[...p].filter(x=>f.every(b=>b.target!==x||!p.has(b.source)));if(!y.length)return;for(const x of y)g.set(x,m),p.delete(x)}return g},s=t.flatMap(u=>{const f=o.get(u.source),g=o.get(u.target);return f&&g&&f!==g?[{source:f,target:g}]:[]}),n=a([...r.keys()],s);if(!n)return[];const l={x:Math.min(...[...r.values()].map(u=>u.box.x)),y:Math.min(...[...r.values()].map(u=>u.box.y))},c=[],h=[...r.keys()].filter(u=>!s.some(f=>f.target===u)),d=a([...e.keys()],t);if(r.size===3&&h.length===1&&s.every(u=>u.source===h[0])&&d){const u=h[0],f=[...r.keys()].filter(p=>p!==u),g=new Map;for(const p of[...e.keys()].toSorted((m,y)=>Ce(d,y)-Ce(d,m)))g.set(p,Math.max(0,...t.filter(m=>m.source===p).map(m=>Ce(g,m.target)+1)));for(const p of[!1,!0])for(const m of[!1,!0]){const y=new Map;Ce(r,u).members.toSorted((v,M)=>Ce(g,M)-Ce(g,v)||(p?-1:1)*(Ce(e,v).x-Ce(e,M).x)).forEach((v,M)=>y.set(v,M));const x=new Map([...r.keys()].map(v=>[v,new Set]));for(const[v,M]of y)Ce(x,Ce(o,v)).add(M);for(const v of[...e.keys()].filter(M=>!y.has(M)).toSorted((M,B)=>Ce(g,B)-Ce(g,M)||Ce(e,M).y-Ce(e,B).y)){const M=t.filter(O=>O.target===v);let B=Math.max(1,...M.map(O=>Ce(y,O.source)+1));const E=Ce(x,Ce(o,v));for(;E.has(B);)B++;y.set(v,B),E.add(B)}const b=new Map;let S=l.y+Math.max(...[...r.values()].map(v=>v.headerHeight))+48;for(let v=0;v<=Math.max(...y.values());v++){const M=Math.max(0,...[...e].filter(([B])=>y.get(B)===v).map(([,B])=>B.height));b.set(v,S+M/2),S+=M+32}const T=m?[...f].reverse():f,k=new Map,_=new Map;let L=l.x;for(const v of[T[0],u,T[1]]){const M=Ce(r,v),B=Math.max(M.headerWidth+48,...M.members.map($=>Ce(e,$).width+64));for(const $ of M.members){const I=Ce(e,$);k.set($,{...I,x:L+(B-I.width)/2,y:Ce(b,Ce(y,$))-I.height/2})}const E=Math.min(...M.members.map($=>Ce(k,$).y))-Math.max(24,M.headerHeight)-28,O=Math.max(...M.members.map($=>{const I=Ce(k,$);return I.y+I.height}))+32;_.set(v,{x:L,y:E,width:B,height:O-E}),L+=B+48}c.push({nodes:k,groups:_})}}for(const u of[!1,!0])for(const f of[!1,!0])for(const g of[0,.5,1]){const p=new Map;for(const[_,L]of r){const v=a(L.members,t.filter(O=>o.get(O.source)===_&&o.get(O.target)===_));if(!v)return[];const M=new Map;let B=Math.max(24,L.headerHeight)+28,E=L.headerWidth+128;for(let O=0;O<=Math.max(...v.values());O++){const $=L.members.filter(R=>v.get(R)===O).toSorted((R,q)=>Ce(e,R).x-Ce(e,q).x);f&&$.reverse();let I=32;const F=Math.max(...$.map(R=>Ce(e,R).height));for(const R of $){const q=Ce(e,R);M.set(R,{...q,x:I,y:B+(F-q.height)/2}),I+=q.width+32}E=Math.max(E,I),B+=F+48}for(let O=0;O<=Math.max(...v.values());O++){const $=[...M].filter(([R])=>v.get(R)===O),I=Math.max(...$.map(([,R])=>R.x+R.width)),F=(E-32-I)*($.length===1?O%2:.5);for(const[,R]of $)R.x+=F}p.set(_,{box:{x:0,y:0,width:E,height:B-16},nodes:M})}const m=new Map,y=new Map,x=Math.max(...n.values()),b=Array.from({length:x+1},(_,L)=>{const v=[...r.keys()].filter(M=>n.get(M)===L).toSorted((M,B)=>Ce(r,M).box.x-Ce(r,B).box.x);return u?v.reverse():v}),S=Math.max(...b.map(_=>_.reduce((L,v)=>L+Ce(p,v).box.width,0)+(_.length-1)*48));let T=l.y;for(const _ of b){const L=_.reduce((M,B)=>M+Ce(p,B).box.width,0)+(_.length-1)*48;let v=l.x+(S-L)*g;for(const M of _){const B=Ce(p,M),E={...B.box,x:v,y:T};m.set(M,E);for(const[O,$]of B.nodes)y.set(O,{...$,x:v+$.x,y:T+$.y});v+=E.width+48}T+=Math.max(..._.map(M=>Ce(p,M).box.height))+64}const k=[...y.values()];k.some((_,L)=>k.slice(L+1).some(v=>_.x<v.x+v.width+16&&_.x+_.width+16>v.x&&_.y<v.y+v.height+16&&_.y+_.height+16>v.y))||c.push({nodes:y,groups:m})}return c}function Ce(e,t){const r=e.get(t);if(r===void 0)throw new Error("Compact flowchart references an unknown node");return r}function v3(e,t,r="TB"){if(e.size>48||t.some(m=>!e.has(m.source)||!e.has(m.target)))return[];const i=/^(LR|RL)$/.test(r),o=/^(RL|BT)$/.test(r)?-1:1,a=64,s=new Map([...e].map(([m,y])=>[m,{u:o*(i?y.x+y.width/2:y.y+y.height/2),v:i?y.y+y.height/2:y.x+y.width/2,width:i?y.width:y.height,height:i?y.height:y.width}])),n=m=>t.filter(y=>y.target===m),l=m=>t.filter(y=>y.source===m),c=(m,y=!1,x=new Set)=>{const b=new Set,S=[m];for(let T;(T=S.pop())!==void 0;)b.has(T)||x.has(T)||(b.add(T),S.push(...(y?n(T):l(T)).map(k=>y?k.source:k.target)));return b},h=new Map([...e.keys()].map(m=>[m,c(m)])),d=new Set,u=[...e.keys()].flatMap(m=>{if(d.has(m))return[];const y=[...e.keys()].filter(x=>h.get(m)?.has(x)&&h.get(x)?.has(m));return y.forEach(x=>d.add(x)),y.length>=3&&y.length<=8?[y]:[]}),f=[],g=m=>{const y=new Map([...m].map(([b,S])=>{const T=Ce(e,b);return[b,{...T,x:(i?o*S.u:S.v)-T.width/2,y:(i?S.v:o*S.u)-T.height/2}]})),x=[...y.values()];return x.some((b,S)=>x.slice(S+1).some(T=>b.x<T.x+T.width+16&&b.x+b.width+16>T.x&&b.y<T.y+T.height+16&&b.y+b.height+16>T.y))?void 0:y},p=[...e.keys()];for(let m=0;m<p.length&&f.length<8;m++)for(let y=m+1;y<p.length&&f.length<8;y++){const x=[p[m],p[y]],b=[...new Set(l(x[0]).map(F=>F.target))].filter(F=>!x.includes(F)&&l(x[1]).some(R=>R.target===F));if(b.length!==2)continue;const S=[...new Set(n(x[0]).map(F=>F.source))].filter(F=>!x.includes(F)&&!b.includes(F)&&n(x[1]).some(R=>R.source===F)),T=[...new Set(l(b[0]).map(F=>F.target))].filter(F=>!x.includes(F)&&!b.includes(F)&&l(b[1]).some(R=>R.target===F));if(S.length!==1||T.length!==1||new Set([...x,...b,...S,...T]).size!==6)continue;const k=new Map([...s].map(([F,R])=>[F,{...R}])),_=Ce(k,S[0]),L=x.toSorted((F,R)=>Ce(k,F).v-Ce(k,R).v),v=b.toSorted((F,R)=>l(F).filter(q=>x.includes(q.target)).length-l(R).filter(q=>x.includes(q.target)).length),M=Ce(k,v[0]),B=Ce(k,v[1]),E=Ce(k,T[0]),O=Math.max(Math.min(...x.map(F=>Ce(k,F).u)),_.u+_.width/2+a+Math.max(...x.map(F=>Ce(k,F).width/2))),$=Math.max(...x.map(F=>Ce(k,F).height/2))+M.height/2+a;L.forEach((F,R)=>Object.assign(Ce(k,F),{u:O,v:_.v+(R?1:-1)*$})),Object.assign(M,{u:O,v:_.v}),Object.assign(E,{u:O+M.width/2+a+E.width/2,v:_.v}),Object.assign(B,{u:E.u+E.width/2+a+B.width/2,v:_.v});const I=g(k);I&&f.push(I)}for(const m of u){const y=new Set(m),x=t.filter(M=>!y.has(M.source)&&y.has(M.target)),b=t.filter(M=>y.has(M.source)&&!y.has(M.target)),S=x.toSorted((M,B)=>c(B.source,!0,y).size-c(M.source,!0,y).size)[0],T=b.toSorted((M,B)=>c(B.target,!1,y).size/n(B.target).length-c(M.target,!1,y).size/n(M.target).length)[0];if(!S||!T)continue;const k=[S.target],_=new Map([[S.target,void 0]]);for(let M=0;M<k.length&&!_.has(T.source);M++){const B=k[M];for(const E of l(B))!y.has(E.target)||_.has(E.target)||(_.set(E.target,B),k.push(E.target))}if(!_.has(T.source))continue;const L=[];for(let M=T.source;M!==void 0;M=_.get(M))L.unshift(M);const v=m.filter(M=>!L.includes(M)).toSorted((M,B)=>{const E=O=>new Set(t.flatMap($=>$.source===O&&y.has($.target)?[$.target]:$.target===O&&y.has($.source)?[$.source]:[])).size;return E(B)-E(M)});for(const M of[-1,1]){const B=new Map([...s].map(([D,P])=>[D,{...P}])),E=Ce(B,S.source),O=Ce(B,L[0]);O.u=Math.max(O.u,E.u+E.width/2+a+O.width/2);const $=E.v;O.v=$;for(let D=1;D<L.length;D++){const P=Ce(B,L[D-1]),Y=Ce(B,L[D]);Y.u=P.u+P.width/2+a+Y.width/2,Y.v=$}const I=Math.max(...L.map(D=>Ce(B,D).height/2)),F=Math.max(0,...v.map(D=>Ce(B,D).height));for(const[D,P]of v.entries()){const Y=new Set(t.flatMap(U=>U.source===P?[U.target]:U.target===P?[U.source]:[]).filter(U=>L.includes(U))),X=Ce(B,P);X.u=Y.size?[...Y].reduce((U,j)=>U+Ce(B,j).u,0)/Y.size:O.u;const z=Math.max(0,...t.flatMap(U=>(U.source===P||U.target===P)&&U.labelBox?[i?U.labelBox.height:U.labelBox.width]:[]));X.v=$+M*(D%2===0?1:-1)*(I+a+z+X.height/2+Math.floor(D/2)*(F+a))}for(const D of x){if(n(D.source).length||l(D.source).length!==1)continue;const P=Ce(B,D.target),Y=Ce(B,D.source);Y.u=P.u,Y.v=P.v+(Math.sign(P.v-$)||M)*(P.height/2+a+Y.height/2)}const R=new Set(m);for(const D of b){let P=D.source,Y=D.target;for(;!R.has(Y)&&n(Y).length===1&&l(Y).length<=1;){const X=Ce(B,P),z=Ce(B,Y);z.u=X.u+X.width/2+a+z.width/2,z.v=X.v,R.add(Y);const U=l(Y)[0];if(!U)break;P=Y,Y=U.target}}let q=[B];for(const[D,P]of B){const Y=n(D);if(y.has(D)||l(D).length||Y.length<2||Y.length>4)continue;const X=[];for(const z of q){const U=Y.map(rt=>Ce(z,rt.source)),j=U.reduce((rt,ht)=>rt+ht.u,0)/U.length,V=Math.min(...U.map(rt=>rt.v-rt.height/2))-a-P.height/2,Q=Math.max(...U.map(rt=>rt.v+rt.height/2))+a+P.height/2;for(const rt of[V,Q,...U.map(ht=>ht.v),U.reduce((ht,H)=>ht+H.v,0)/U.length])for(const ht of[j,j-P.width/2,j+P.width/2,j-P.width,j+P.width,...U.map(H=>H.u)]){const H={...P,u:ht,v:rt};if([...z].some(([tt,ot])=>tt!==D&&Math.abs(ot.u-H.u)<(ot.width+H.width)/2+a/2&&Math.abs(ot.v-H.v)<(ot.height+H.height)/2+a/2))continue;const G=new Map(z);G.set(D,H);const K=U.reduce((tt,ot)=>tt+Math.hypot(ot.u-H.u,ot.v-H.v),0);X.push({positions:G,cost:K})}}X.length&&(q=X.toSorted((z,U)=>z.cost-U.cost).slice(0,3).map(z=>z.positions))}for(const D of q){const P=new Map([...D].map(([X,z])=>{const U=Ce(e,X),j=i?o*z.u:z.v,V=i?z.v:o*z.u;return[X,{...U,x:j-U.width/2,y:V-U.height/2}]})),Y=[...P.values()];Y.some((X,z)=>Y.slice(z+1).some(U=>X.x<U.x+U.width+16&&X.x+X.width+16>U.x&&X.y<U.y+U.height+16&&X.y+X.height+16>U.y))||f.push(P)}}}return f}const Ua=(e,t,r)=>(t.x-e.x)*(r.y-e.y)-(t.y-e.y)*(r.x-e.x);function M3(e,t,r){const i=e instanceof SVGGeometryElement?[e]:[...e.querySelectorAll("path,polygon,polyline,circle,ellipse,rect")],o=i.flatMap(h=>{const d=h.getScreenCTM();if(!d)return[];const u=h.getTotalLength(),f=Math.max(16,Math.min(256,Math.ceil(u/24)*4));return(h instanceof SVGPolygonElement||h instanceof SVGPolylineElement?Array.from({length:h.points.numberOfItems},(p,m)=>h.points.getItem(m)):Array.from({length:f},(p,m)=>h.getPointAtLength(u*m/f))).map(p=>{const m=new DOMPoint(p.x,p.y).matrixTransform(d).matrixTransform(r);return{x:m.x-t.x,y:m.y-t.y}})}).toSorted((h,d)=>h.x-d.x||h.y-d.y).filter((h,d,u)=>!d||Math.hypot(h.x-u[d-1].x,h.y-u[d-1].y)>.001);if(o.length<3)return[{x:0,y:0},{x:t.width,y:0},{x:t.width,y:t.height},{x:0,y:t.height}];const a=h=>{const d=[];for(const u of h){for(;d.length>1&&Ua(d[d.length-2],d[d.length-1],u)<=0;)d.pop();d.push(u)}return d.slice(0,-1)},s=[...a(o),...a([...o].reverse())],n=i.flatMap(h=>{const d=h.getScreenCTM();return d?[{geometry:h,inverse:d.inverse().multiply(r.inverse())}]:[]}),l=h=>n.some(({geometry:d,inverse:u})=>d.isPointInFill(new DOMPoint(t.x+h.x,t.y+h.y).matrixTransform(u))),c={x:t.width/2,y:t.height/2};return s.some((h,d)=>{const u=s[(d+1)%s.length];return[.25,.5,.75].some(f=>{const g={x:h.x+(u.x-h.x)*f,y:h.y+(u.y-h.y)*f},p=Math.hypot(c.x-g.x,c.y-g.y)||1;return!l({x:g.x+(c.x-g.x)/p*.1,y:g.y+(c.y-g.y)/p*.1})})})?[]:s}function Zn(e,t,r){const i={x:e.width/2,y:e.height/2},o={x:r.x-e.x-i.x,y:r.y-e.y-i.y};let a=-1/0,s={x:0,y:0};for(let c=0;c<t.length;c++){const h=t[c],d=t[(c+1)%t.length],u={x:d.x-h.x,y:d.y-h.y},f=o.x*u.y-o.y*u.x;if(Math.abs(f)<1e-6)continue;const g={x:h.x-i.x,y:h.y-i.y},p=(g.x*u.y-g.y*u.x)/f,m=(g.x*o.y-g.y*o.x)/f;if(p<0||m<-1e-5||m>1.00001||p<a-1e-5)continue;const y=Math.hypot(u.x,u.y),x={x:u.y/y,y:-u.x/y};Math.abs(p-a)<1e-5?(s.x+=x.x,s.y+=x.y):(a=p,s=x)}if(!Number.isFinite(a)||Math.hypot(s.x,s.y)<.001){const c=Math.hypot(o.x,o.y)||1;return[r,{x:r.x+o.x/c*32,y:r.y+o.y/c*32}]}const n=Math.hypot(s.x,s.y),l={x:e.x+i.x+o.x*a+s.x/n*.05,y:e.y+i.y+o.y*a+s.y/n*.05};return[l,{x:l.x+s.x/n*32,y:l.y+s.y/n*32}]}function Ys(e,t,r){const i=r.x-t.x,o=r.y-t.y,a=Math.max(0,Math.min(1,((e.x-t.x)*i+(e.y-t.y)*o)/(i*i+o*o||1)));return Math.hypot(e.x-t.x-a*i,e.y-t.y-a*o)}function T3(e,t,r,i){const o=e.map(s=>({x:s.x-t.x,y:s.y-t.y})),a=s=>r.every((n,l)=>Ua(n,r[(l+1)%r.length],s)>=0);for(let s=1;s<o.length;s++){const n=o[s-1],l=o[s];if(!(Math.max(n.x,l.x)<-Math.max(0,i)||Math.min(n.x,l.x)>t.width+Math.max(0,i)||Math.max(n.y,l.y)<-Math.max(0,i)||Math.min(n.y,l.y)>t.height+Math.max(0,i))){for(const c of[n,l])if(a(c)&&r.every((h,d)=>Ys(c,h,r[(d+1)%r.length])>-i))return!0;for(let c=0;c<r.length;c++){const h=r[c],d=r[(c+1)%r.length];if(Ua(n,l,h)*Ua(n,l,d)<-1e-6&&Ua(h,d,n)*Ua(h,d,l)<-1e-6||i>0&&Math.min(Ys(n,h,d),Ys(l,h,d),Ys(h,n,l),Ys(d,n,l))<i)return!0}}}return!1}const Xe=16,mr=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),er=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y),Gr=e=>e[e.length-1],Li=e=>e.points.slice(1).reduce((t,r,i)=>t+er(e.points[i],r),0);function xp(e){const t=mr(e);return[[{x:t.x,y:e.y},{x:t.x,y:e.y-Xe*2}],[{x:e.x+e.width,y:t.y},{x:e.x+e.width+Xe*2,y:t.y}],[{x:t.x,y:e.y+e.height},{x:t.x,y:e.y+e.height+Xe*2}],[{x:e.x,y:t.y},{x:e.x-Xe*2,y:t.y}]]}const _1=(e,t,r=0)=>e.x>t.x-r&&e.x<t.x+t.width+r&&e.y>t.y-r&&e.y<t.y+t.height+r,jo=(e,t,r=0)=>e.x<t.x+t.width+r&&e.x+e.width+r>t.x&&e.y<t.y+t.height+r&&e.y+e.height+r>t.y,gh=(e,t,r=0)=>t.x>=e.x+r&&t.y>=e.y+r&&t.x+t.width<=e.x+e.width-r&&t.y+t.height<=e.y+e.height-r;function L1(e,t,r,i,o=[]){if(Math.max(e.x,t.x)<Math.min(r.x,i.x)||Math.max(r.x,i.x)<Math.min(e.x,t.x)||Math.max(e.y,t.y)<Math.min(r.y,i.y)||Math.max(r.y,i.y)<Math.min(e.y,t.y))return!1;const a=(f,g)=>f.x*g.y-f.y*g.x,s={x:t.x-e.x,y:t.y-e.y},n={x:i.x-r.x,y:i.y-r.y},l=a(s,n),c={x:r.x-e.x,y:r.y-e.y};if(Math.abs(l)<1e-4){const f=s.x**2+s.y**2;if(f<1e-6||Math.abs(a(c,s))>1e-4*Math.sqrt(f))return!1;const g=x=>((x.x-e.x)*s.x+(x.y-e.y)*s.y)/f,p=Math.max(0,Math.min(g(r),g(i))),m=Math.min(1,Math.max(g(r),g(i)));if(m<p-1e-6)return!1;if((m-p)*Math.sqrt(f)>.05)return!0;const y={x:e.x+s.x*p,y:e.y+s.y*p};return!o.some(x=>er(y,x)<.05)}const h=a(c,n)/l,d=a(c,s)/l;if(h<-1e-6||h>1.000001||d<-1e-6||d>1.000001)return!1;const u={x:e.x+s.x*h,y:e.y+s.y*h};return!o.some(f=>er(u,f)<.05)}function qi(e,t){const r=[e[0],Gr(e)].filter(i=>[t[0],Gr(t)].some(o=>er(i,o)<.05));for(let i=1;i<e.length;i++)for(let o=1;o<t.length;o++)if(L1(e[i-1],e[i],t[o-1],t[o],r))return!0;return!1}function So(e,t,r=0){const i=[{x:t.x-r,y:t.y-r},{x:t.x+t.width+r,y:t.y-r},{x:t.x+t.width+r,y:t.y+t.height+r},{x:t.x-r,y:t.y+t.height+r}];return e.some(o=>_1(o,t,r))||e.slice(1).some((o,a)=>i.some((s,n)=>L1(e[a],o,s,i[(n+1)%4])))}function ph(e){const t=e[0],r=[t];let i=`M${t.x},${t.y}`;const o=(s,n,l,c,h,d,u)=>({x:(s.x*c+n.x*h+l.x*d)/u,y:(s.y*c+n.y*h+l.y*d)/u}),a=s=>{i+=`L${s.x},${s.y}`,r.push(s)};if(e.length<3)return a(Gr(e)),{d:i,points:r};a(o(t,e[1],t,5,1,0,6));for(let s=2;s<=e.length;s++){const n=e[s-2],l=e[s-1],c=e[Math.min(s,e.length-1)],h=Gr(r),d=o(n,l,c,2,1,0,3),u=o(n,l,c,1,2,0,3),f=o(n,l,c,1,4,1,6);i+=`C${d.x},${d.y} ${u.x},${u.y} ${f.x},${f.y}`;const g=Math.max(1,Math.min(16,Math.ceil(er(h,f)/12)));for(let p=1;p<=g;p++){const m=p/g,y=1-m;r.push({x:y**3*h.x+3*y**2*m*d.x+3*y*m**2*u.x+m**3*f.x,y:y**3*h.y+3*y**2*m*d.y+3*y*m**2*u.y+m**3*f.y})}}return a(Gr(e)),{d:i,points:r}}function Kn(e,t,r,i){const o=Math.max(12,Math.min(256,Math.ceil((er(e,t)+er(t,r)+er(r,i))/5)));return{d:`M${e.x},${e.y}C${t.x},${t.y} ${r.x},${r.y} ${i.x},${i.y}`,points:Array.from({length:o+1},(a,s)=>{const n=s/o,l=1-n;return{x:l**3*e.x+3*l**2*n*t.x+3*l*n**2*r.x+n**3*i.x,y:l**3*e.y+3*l**2*n*t.y+3*l*n**2*r.y+n**3*i.y}})}}function mh(e){let t=0;for(let r=1;r<e.points.length-1;r++){const i=e.points[r-1],o=e.points[r],a=e.points[r+1],s=er(i,o)*er(o,a)*er(a,i);s<.001||(t=Math.max(t,2*Math.abs((o.x-i.x)*(a.y-i.y)-(o.y-i.y)*(a.x-i.x))/s))}return t}function Xs(e){let t=0;for(let r=1;r<e.points.length-1;r++){const i=e.points[r-1],o=e.points[r],a=e.points[r+1],s=o.x-i.x,n=o.y-i.y,l=a.x-o.x,c=a.y-o.y;t+=Math.abs(Math.atan2(s*c-n*l,s*l+n*c))}return t}function B3(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const t=!!e.querySelector("g.cluster"),r=new Set,i=[...e.querySelectorAll("path.flowchart-link")];if(!i.some(k=>k.getAttribute("d")?.includes("C")))return;const o=i[0]?.getScreenCTM();if(!o||i.length>64)return;const a=o.inverse(),s=k=>{const _=k.getBoundingClientRect(),L=new DOMPoint(_.left,_.top).matrixTransform(a),v=new DOMPoint(_.right,_.bottom).matrixTransform(a);return{x:L.x,y:L.y,width:v.x-L.x,height:v.y-L.y}};let n=[...e.querySelectorAll("g.cluster > .cluster-label")].filter(k=>k.textContent?.trim()).map(s),l=[...e.querySelectorAll("g.cluster > rect")].map(s);const c=new Map([...e.querySelectorAll("g.node")].flatMap(k=>{const _=k.id.match(/flowchart-(.+)-\d+$/)?.[1],L=k.querySelector(":scope > .label-container");return _&&L?[[_,{box:s(L),rect:L.tagName.toLowerCase()==="rect",element:k,outline:M3(L,s(L),a)}]]:[]})),h=(k,_,L=!1)=>{const v=c.get(k);return xp(_).flatMap((B,E)=>{const O=E===0||E===2;return!L||(O?_.width:_.height)<Xe*5?[B]:[B,...[-Xe,Xe].map($=>B.map(I=>({x:I.x+(O?$:0),y:I.y+(O?0:$)})))]}).map(B=>v&&!v.rect?Zn(_,v.outline,B[0]):B)},d=[...e.querySelectorAll(".edgeLabels > .edgeLabel")].filter(k=>k.textContent?.trim()),u=i.flatMap(k=>{const _=k.id.match(/(?:^|-)L_(.*)_\d+$/)?.[1],L=_?[...c.keys()].flatMap(Y=>{const X=_.slice(Y.length+1);return _.startsWith(`${Y}_`)&&c.has(X)?[{source:Y,target:X}]:[]}):[],v=L.length===1?L[0]:void 0,M=[...k.classList].find(Y=>Y.startsWith("LS_"))?.slice(3)??v?.source,B=[...k.classList].find(Y=>Y.startsWith("LE_"))?.slice(3)??v?.target,E=k.getScreenCTM(),O=k.getAttribute("d"),$=M&&c.get(M),I=B&&c.get(B);if(!M||!B||!$||!I||!E||!O)return[];if(Math.abs(E.e-o.e)+Math.abs(E.f-o.f)>.01)return[];const F=k.getTotalLength(),R=Math.max(2,Math.min(256,Math.ceil(F/6))),q=Array.from({length:R+1},(Y,X)=>{const z=k.getPointAtLength(F*X/R);return{x:z.x,y:z.y}}),D=e.id&&k.id.startsWith(`${e.id}-`)?k.id.slice(e.id.length+1):k.id,P=d.find(Y=>Y.querySelector(":scope > .label[data-id]")?.getAttribute("data-id")===D);return[{path:k,source:M,target:B,sourceBox:$.box,targetBox:I.box,d:O,points:q,label:P,labelBox:P&&s(P)}]}),f=k=>{const _=c.get(k.source),L=c.get(k.target);if(!_?.outline.length||!L?.outline.length)return[];const v=mr(k.sourceBox),M=mr(k.targetBox),B=er(v,M);if(B<1)return[];const E={x:(M.x-v.x)/B,y:(M.y-v.y)/B},O={x:-E.y,y:E.x};return[0,-Xe,Xe,-Xe*2,Xe*2].flatMap($=>{const I=(q,D)=>{const P=mr(q),Y=Math.max(q.width,q.height);return{x:P.x+E.x*Y*D+O.x*$,y:P.y+E.y*Y*D+O.y*$}},[F]=Zn(k.sourceBox,_.outline,I(k.sourceBox,1)),[R]=Zn(k.targetBox,L.outline,I(k.targetBox,-1));return[0,-Xe,Xe,-Xe*2,Xe*2,-Xe*3,Xe*3].map(q=>Kn(F,{x:F.x+(R.x-F.x)/3+O.x*q,y:F.y+(R.y-F.y)/3+O.y*q},{x:R.x-(R.x-F.x)/3+O.x*q,y:R.y-(R.y-F.y)/3+O.y*q},R))})},g=(k,_,L=8)=>!n.some(v=>So(_.points,v,L))&&![...c].some(([v,M])=>{const B=v===k.source||v===k.target?-.1:L,E=_.points.slice(1,-1);return M.rect||M.outline.length<3?So(E,M.box,B):T3(E,M.box,M.outline,B)}),p=()=>u.reduce((k,_,L)=>k+u.slice(L+1).filter(v=>qi(_.points,v.points)).length,0),m=(k,_,L=l)=>{const v=L.filter(B=>gh(B,k.sourceBox,-.1)&&gh(B,k.targetBox,-.1)),M={..._};for(const B of v)M.x=Math.max(B.x+6,Math.min(M.x,B.x+B.width-_.width-6)),M.y=Math.max(B.y+6,Math.min(M.y,B.y+B.height-_.height-6));return _1(mr(_),M)&&er(mr(M),mr(_))<=Xe*2&&v.every(B=>gh(B,M,6))?M:void 0},y=(k,_,L=!0)=>{if(!k.labelBox)return;const v=k.labelBox;return[...L?[]:[mr(v)],..._.points.filter((B,E)=>E%3===0)].flatMap(B=>{const E=m(k,{...v,x:B.x-v.width/2,y:B.y-v.height/2});return E?[E]:[]}).filter(B=>![...c.values()].some(E=>jo(B,E.box,6))&&!n.some(E=>jo(B,E,6))&&!u.some(E=>E!==k&&(E.labelBox&&jo(B,E.labelBox,6)||So(E.points,B,6)))).toSorted((B,E)=>er(mr(B),mr(v))-er(mr(E),mr(v)))[0]},x=(k,_)=>u.filter(L=>L!==k&&((t?k.target===L.target&&er(Gr(_.points),Gr(L.points))<Xe/2:qi(_.points,L.points))||L.labelBox&&So(_.points,L.labelBox,6))).length+Number(t&&!g(k,_)),b=(k,_,L)=>{if(t&&r.add(k),k.d=_.d,k.points=_.points,k.path.setAttribute("d",_.d),delete k.path.dataset.terminalGapBasePath,delete k.path.dataset.terminalDirection,delete k.path.dataset.terminalTarget,!L||!k.label)return;const v=k.label.parentElement?.getScreenCTM();if(!v)return;const M=new DOMPoint(mr(L).x,mr(L).y).matrixTransform(o).matrixTransform(v.inverse()),B=k.label.getBBox();k.label.setAttribute("transform",`translate(${M.x-B.x-B.width/2},${M.y-B.y-B.height/2})`),k.labelBox=L};if(u.length===i.length&&u.every(k=>k.d.includes("C"))&&[...c.values()].every(k=>k.outline.length>=3)){const k=new Map(c),_=u.map(R=>({route:R,d:R.d,points:R.points,sourceBox:R.sourceBox,targetBox:R.targetBox,labelBox:R.labelBox})),L=u.reduce((R,q)=>R+Li(q),0),v=u.some(R=>x(R,R)>0),M=n,B=new Map([...e.querySelectorAll("g.cluster")].flatMap(R=>{const q=R.querySelector(":scope > rect"),D=R.querySelector(":scope > .cluster-label");if(!q||!D)return[];const P=s(q),Y=s(D),X=[...c].filter(([,z])=>z.box.x>=P.x&&z.box.y>=P.y&&z.box.x+z.box.width<=P.x+P.width+.1&&z.box.y+z.box.height<=P.y+P.height+.1).map(([z])=>z);return[[R.id,{box:P,members:X,headerWidth:Y.width,headerHeight:Y.height,header:Y,shape:q,label:D}]]})),E=new Map([...c].map(([R,q])=>[R,q.box])),O=t?S3(E,u,B,e.dataset.flowchartDirection??""):v3(E,u,e.dataset.flowchartDirection).map(R=>({nodes:R})),$=R=>R.reduce((q,D,P)=>q+Li(D.curve)+Xs(D.curve)*Xe*2+R.slice(P+1).filter(Y=>qi(D.curve.points,Y.curve.points)).length*128,0),I=$(u.map(R=>({curve:R})));let F;for(const R of O)for(const q of t?[!1]:[!1,!0]){const D=R.nodes,P=R.groups?[...R.groups.values()]:l,Y=R.groups?new Map([...R.groups].flatMap(([j,V])=>{const Q=B.get(j);if(!Q)return[];const rt=[(V.width-Q.header.width)/2,20,V.width-Q.header.width-20].map(H=>({...Q.header,x:V.x+H,y:V.y+12})),ht=H=>u.filter(G=>{const K=D.get(G.source),tt=D.get(G.target);return K&&tt&&So([mr(K),mr(tt)],H,Xe)}).length;return[[j,rt.toSorted((H,G)=>ht(H)-ht(G))[0]]]})):void 0;n=Y?[...Y.values()]:M;for(const[j,V]of k)c.set(j,{...V,box:D.get(j)??V.box});for(const j of u)j.sourceBox=D.get(j.source)??j.sourceBox,j.targetBox=D.get(j.target)??j.targetBox;const X=new Map;for(const[j,V]of D){const Q=[[],[],[],[]];for(const rt of u.filter(ht=>ht.source===j||ht.target===j)){const ht=mr(rt.source===j?rt.targetBox:rt.sourceBox),H=mr(V),G=ht.x-H.x,K=ht.y-H.y;Q[Math.abs(G)>Math.abs(K)?G>0?1:3:K>0?2:0].push(rt)}Q.forEach((rt,ht)=>{const H=ht===0||ht===2;rt.sort((K,tt)=>{const ot=vt=>mr(vt.source===j?vt.targetBox:vt.sourceBox);return(H?ot(K).x-ot(tt).x:ot(K).y-ot(tt).y)||u.indexOf(K)-u.indexOf(tt)});const G=rt.length>1?Math.min(Xe*1.5,((H?V.width:V.height)-Xe*2)/(rt.length-1)):0;rt.forEach((K,tt)=>{const ot=(tt-(rt.length-1)/2)*G,[vt,Ot]=xp(V)[ht],Pt={x:vt.x+(H?ot:0),y:vt.y+(H?0:ot)},Mt=c.get(j),[Bt,Rt]=Mt&&!Mt.rect?Zn(V,Mt.outline,Pt):[Pt,{x:Pt.x+Ot.x-vt.x,y:Pt.y+Ot.y-vt.y}],we=X.get(K)??{};Object.assign(we,K.source===j?{start:Bt,lead:Rt}:{end:Bt,tail:Rt}),X.set(K,we)})})}const z=[],U=u.toSorted((j,V)=>+!!V.label-+!!j.label||er(mr(j.sourceBox),mr(j.targetBox))-er(mr(V.sourceBox),mr(V.targetBox)));for(const j of U){const V=X.get(j);if(!V||!V.start||!V.lead||!V.end||!V.tail)break;let Q;const rt=H=>{const G=H.points[0],K=Gr(H.points);if(z.some(Mt=>Mt.route.source===j.source&&er(G,Mt.curve.points[0])<Xe/2||Mt.route.target===j.source&&er(G,Gr(Mt.curve.points))<Xe/2||Mt.route.source===j.target&&er(K,Mt.curve.points[0])<Xe/2||Mt.route.target===j.target&&er(K,Gr(Mt.curve.points))<Xe/2)||!g(j,H,Xe)||z.some(Mt=>Mt.labelBox&&So(H.points,Mt.labelBox,6)))return;const ot=z.filter(Mt=>qi(H.points,Mt.curve.points)).length;if(ot||t&&Xs(H)>Math.PI*.6)return;const vt=j.labelBox,Ot=vt?[.5,.35,.65].flatMap(Mt=>{const Bt=H.points[Math.round((H.points.length-1)*Mt)],Rt=m(j,{...vt,x:Bt.x-vt.width/2,y:Bt.y-vt.height/2},P);return Rt?[Rt]:[]}).find(Mt=>![...c.values()].some(Bt=>jo(Mt,Bt.box,6))&&!n.some(Bt=>jo(Mt,Bt,6))&&!z.some(Bt=>Bt.labelBox&&jo(Mt,Bt.labelBox,6)||So(Bt.curve.points,Mt,6))):void 0;if(j.labelBox&&!Ot)return;const Pt=Li(H)+(q?mh(H)*Xe**2:Xs(H)*Xe*2)+ot*128;(!Q||Pt<Q.cost)&&(Q={curve:H,cost:Pt,labelBox:Ot})};q||f(j).forEach(rt);const ht=[[[V.start,V.lead],[V.end,V.tail]],...h(j.source,j.sourceBox).flatMap(H=>h(j.target,j.targetBox).map(G=>[H,G])).toSorted((H,G)=>er(H[0][0],H[1][0])-er(G[0][0],G[1][0]))];for(const[[H,G],[K,tt]]of ht){const ot=(Ot,Pt)=>z.some(Mt=>Mt.route.source===Ot&&er(Pt,Mt.curve.points[0])<Xe/2||Mt.route.target===Ot&&er(Pt,Gr(Mt.curve.points))<Xe/2);if(ot(j.source,H)||ot(j.target,K))continue;const vt=er(H,K);for(const Ot of[.5,.35,.23])for(const Pt of[.5,.35,.23]){const Mt=Kn(H,{x:H.x+(G.x-H.x)*vt*Ot/(Xe*2),y:H.y+(G.y-H.y)*vt*Ot/(Xe*2)},{x:K.x+(tt.x-K.x)*vt*Pt/(Xe*2),y:K.y+(tt.y-K.y)*vt*Pt/(Xe*2)},K);rt(Mt)}if(q&&Q)break}if(!Q)break;z.push({route:j,curve:Q.curve,labelBox:Q.labelBox})}if(z.length===u.length){for(const{route:rt,curve:ht}of z)Object.assign(rt,ht);const j=z.every(rt=>!rt.route.label||!!rt.labelBox),V=z.reduce((rt,ht)=>rt+Li(ht.curve),0),Q=$(z);j&&V<L*(t?.99:v?1.4:.82)&&Q<(F?.cost??(v&&!t?1/0:I))&&(F={boxes:D,groups:R.groups,headers:Y,curves:z,cost:Q})}for(const[j,V]of k)c.set(j,V);for(const{route:j,...V}of _)Object.assign(j,V)}if(n=M,F){const R=[...k].flatMap(([D,P])=>{const Y=F.boxes.get(D),X=P.element.transform.baseVal.consolidate()?.matrix,z=P.element.parentElement?.getScreenCTM();return Y&&X&&z?[{id:D,box:Y,node:P,transform:X,parent:z}]:[]}),q=[...F.groups??[]].flatMap(([D,P])=>{const Y=B.get(D);if(!Y)return[];const X=Y.shape.getScreenCTM()?.inverse(),z=Y.label.parentElement?.getScreenCTM()?.inverse();return X&&z?[{id:D,box:P,cluster:Y,matrix:X,parent:z}]:[]});if(R.length===c.size&&q.length===(F.groups?.size??0)){for(const{id:D,box:P,cluster:Y,matrix:X,parent:z}of q){const U=new DOMPoint(P.x,P.y).matrixTransform(o).matrixTransform(X),j=new DOMPoint(P.x+P.width,P.y+P.height).matrixTransform(o).matrixTransform(X);for(const[ht,H]of Object.entries({x:U.x,y:U.y,width:j.x-U.x,height:j.y-U.y}))Y.shape.setAttribute(ht,String(H));const V=F.headers?.get(D),Q=new DOMPoint((V?.x??P.x+20)+Y.header.width/2,(V?.y??P.y+12)+Y.header.height/2).matrixTransform(o).matrixTransform(z),rt=Y.label.getBBox();Y.label.setAttribute("transform",`translate(${Q.x-rt.x-rt.width/2},${Q.y-rt.y-rt.height/2})`)}F.groups&&(n=[...B.values()].map(D=>s(D.label)),l=[...B.values()].map(D=>s(D.shape)));for(const{id:D,box:P,node:Y,transform:X,parent:z}of R){const U=new DOMPoint(0,0).matrixTransform(o).matrixTransform(z.inverse()),j=new DOMPoint(P.x-Y.box.x,P.y-Y.box.y).matrixTransform(o).matrixTransform(z.inverse());Y.element.setAttribute("transform",`matrix(${X.a},${X.b},${X.c},${X.d},${X.e+j.x-U.x},${X.f+j.y-U.y})`),c.set(D,{...Y,box:P})}for(const{route:D,curve:P,labelBox:Y}of F.curves)D.sourceBox=F.boxes.get(D.source)??D.sourceBox,D.targetBox=F.boxes.get(D.target)??D.targetBox,b(D,P,Y)}}}for(const[k,_]of c){const L=u.filter(j=>j.target===k);if(t||!_.rect||L.length<2||L.length>4||L.some(j=>j.label||!j.d.includes("C")||!c.get(j.source)?.outline.length)||u.some(j=>j.source===k))continue;const v=L.map(j=>mr(j.sourceBox)),M=/^(LR|RL)$/.test(e.dataset.flowchartDirection??"")?"x":"y",B=Math.max(...v.map(j=>j[M]))-Math.min(...v.map(j=>j[M])),E=v.map(j=>er(j,mr(_.box)));if(B<(M==="x"?_.box.width:_.box.height)*2||Math.max(...E)<Math.min(...E)*2.5)continue;const O=_.element.transform.baseVal.consolidate()?.matrix,$=_.element.parentElement?.getScreenCTM();if(!O||!$)continue;const I={x:v.reduce((j,V)=>j+V.x,0)/v.length,y:v.reduce((j,V)=>j+V.y,0)/v.length},F=u.filter(j=>!L.includes(j)),R=[...c].filter(([j])=>j!==k).map(([,j])=>j.box),q=R.filter(j=>j.x+j.width>=Math.min(...v.map(V=>V.x))&&j.x<=Math.max(...v.map(V=>V.x)));if(!q.length)continue;const D=Math.min(...q.map(j=>j.y))-_.box.height-Xe*3,P=Math.max(...q.map(j=>j.y+j.height))+Xe*3,Y=L.reduce((j,V)=>j+Li(V),0);let X;for(const j of[D,P,I.y-_.box.height/2])for(const V of[0,-_.box.width/2,_.box.width/2]){const Q={..._.box,x:I.x-_.box.width/2+V,y:j};if(R.some(H=>jo(Q,H,12))||F.some(H=>So(H.points,Q,8)||H.labelBox&&jo(Q,H.labelBox,8)))continue;c.set(k,{..._,box:Q});const rt=[];for(const H of L.toSorted((G,K)=>Li(K)-Li(G))){let G;for(const[K,tt]of h(H.source,H.sourceBox))for(const[ot,vt]of h(H.target,Q)){if(rt.some(Mt=>er(ot,Gr(Mt.curve.points))<Xe))continue;const Ot=ph([K,tt,vt,ot]);if(!g(H,Ot)||F.some(Mt=>qi(Ot.points,Mt.points)||Mt.labelBox&&So(Ot.points,Mt.labelBox,6))||rt.some(Mt=>qi(Ot.points,Mt.curve.points)))continue;const Pt=Li(Ot);(!G||Pt<G.length)&&(G={curve:Ot,length:Pt})}if(!G)break;rt.push({route:H,curve:G.curve})}if(c.set(k,_),rt.length!==L.length)continue;const ht=rt.reduce((H,G)=>H+Li(G.curve),0)+er(mr(Q),mr(_.box))*.15;ht<Y*.8&&(!X||ht<X.cost)&&(X={box:Q,planned:rt,cost:ht})}if(!X)continue;const z=new DOMPoint(0,0).matrixTransform(o).matrixTransform($.inverse()),U=new DOMPoint(X.box.x-_.box.x,X.box.y-_.box.y).matrixTransform(o).matrixTransform($.inverse());_.element.setAttribute("transform",`matrix(${O.a},${O.b},${O.c},${O.d},${O.e+U.x-z.x},${O.f+U.y-z.y})`),c.set(k,{..._,box:X.box});for(const{route:j,curve:V}of X.planned)j.targetBox=X.box,b(j,V)}for(const[k,_]of c)if(_.rect)for(const L of["left","right"]){const v=_.box.x+(L==="right"?_.box.width:0),M=u.filter(P=>P.d.includes("C")&&P.target===k&&Math.abs(Gr(P.points).x-v)<12);if(M.length<2||!M.some((P,Y)=>M.slice(Y+1).some(X=>qi(P.points,X.points))))continue;const B=M.toSorted((P,Y)=>mr(P.sourceBox).y-mr(Y.sourceBox).y),E=M.map(P=>Gr(P.points)).toSorted((P,Y)=>P.y-Y.y),O=M.map(P=>({route:P,d:P.d,points:P.points})),$=M.reduce((P,Y)=>P+x(Y,Y),0),I=t?p():0,F=B.map((P,Y)=>{const X=Gr(P.points);return{route:P,curve:ph(P.points.map((z,U)=>({x:z.x+(E[Y].x-X.x)*(U/(P.points.length-1))**2,y:z.y+(E[Y].y-X.y)*(U/(P.points.length-1))**2})))}});for(const{route:P,curve:Y}of F)Object.assign(P,Y);const R=F.map(({route:P,curve:Y})=>y(P,Y)),q=M.reduce((P,Y)=>P+x(Y,Y),0);if(F.every(({route:P,curve:Y},X)=>g(P,Y)&&(!P.label||R[X]))&&q<$&&(!t||p()<=I))F.forEach(({route:P,curve:Y},X)=>b(P,Y,R[X]));else for(const{route:P,d:Y,points:X}of O)Object.assign(P,{d:Y,points:X})}const S=[...c.values()].map(k=>k.box);if(!S.length)return;const T={left:Math.min(...S.map(k=>k.x))-64,right:Math.max(...S.map(k=>k.x+k.width))+64,top:Math.min(...S.map(k=>k.y))-64,bottom:Math.max(...S.map(k=>k.y+k.height))+64};for(const k of u.toSorted((_,L)=>L.path.getTotalLength()-_.path.getTotalLength())){const _=x(k,k);if(!_||!k.d.includes("C")||k.source===k.target||!c.get(k.source)?.outline.length||!c.get(k.target)?.outline.length)continue;let L;const v=t?u.filter(M=>M!==k&&qi(k.points,M.points)).length:0;for(const[M,B]of h(k.source,k.sourceBox))for(const[E,O]of h(k.target,k.targetBox,t)){const I=[[M,B,O,E],...[T.top,T.bottom].flatMap(F=>[[M,B,{x:B.x,y:F},{x:O.x,y:F},O,E],...[T.left,T.right].map(R=>[M,B,{x:B.x,y:F},{x:R,y:F},{x:R,y:O.y},O,E])])].map(ph);if(t){const F=er(M,E)/(Xe*2);for(const R of[.5,.35,.23])for(const q of[.5,.35,.23])I.unshift(Kn(M,{x:M.x+(B.x-M.x)*F*R,y:M.y+(B.y-M.y)*F*R},{x:E.x+(O.x-E.x)*F*q,y:E.y+(O.y-E.y)*F*q},E))}for(const F of I){if(t&&u.some(P=>P!==k&&k.target===P.target&&er(Gr(F.points),Gr(P.points))<Xe/2)||!g(k,F)||t&&u.filter(P=>P!==k&&qi(F.points,P.points)).length>v)continue;const R=x(k,F);if(R>=_||L&&R>L.conflicts)continue;const q=y(k,F);if(k.label&&!q)continue;const D=F.points.slice(1).reduce((P,Y,X)=>P+er(F.points[X],Y),0);(!L||R<L.conflicts||D<L.length)&&(L={curve:F,labelBox:q,conflicts:R,length:D})}}L&&b(k,L.curve,L.labelBox)}for(const k of u){if(t&&!r.has(k)||!k.d.includes("C")||k.source===k.target||!c.get(k.source)?.outline.length||!c.get(k.target)?.outline.length)continue;const _=k.points[0],L=Gr(k.points),v=k.points.find(P=>er(P,_)>1),M=k.points.findLast(P=>er(P,L)>1);if(!v||!M)continue;const B=er(_,L),E=Li(k),O=mh(k);if(O<1e-4)continue;const $=er(_,v),I=er(L,M),F=E+Xs(k)*Xe*2,R=u.filter(P=>P!==k&&qi(k.points,P.points)).length;let q;const D=f(k);for(const P of[.5,.35,.23,.15,.08])for(const Y of[.5,.35,.23,.15,.08]){const X=Kn(_,{x:_.x+(v.x-_.x)*B*P/$,y:_.y+(v.y-_.y)*B*P/$},{x:L.x+(M.x-L.x)*B*Y/I,y:L.y+(M.y-L.y)*B*Y/I},L);D.push(X)}for(const P of D){const Y=Li(P)+Xs(P)*Xe*2;if(Y>=(q?.cost??F*.98)||mh(P)>Math.max(O,1/Xe)||Li(P)>E+Xe/2||!g(k,P,Xe)||x(k,P)||t&&u.filter(z=>z!==k&&qi(P.points,z.points)).length>R)continue;const X=y(k,P,!0);k.label&&!X||(q={curve:P,labelBox:X,cost:Y})}q&&b(k,q.curve,q.labelBox)}}const A1=6,gi=16,_3=18,L3=4,Qn=7,F1=8,Au=8;function Yi(e,t){return t==="top"?Et(e,.5,0):t==="right"?Et(e,1,.5):t==="bottom"?Et(e,.5,1):Et(e,0,.5)}function A3(e,t){const r=e.x+e.width/2,i=t.filter(Number.isFinite).toSorted((s,n)=>s-n);if(!i.some(s=>Math.abs(s-r)<=1))return r;const o=i.length+1,a=Math.min(gi,e.width*.6/(o-1));return r-a*(o-1)/2}function F3(e,t){const r=e.x+e.width/2;if(!t.some(a=>a<r)||!t.some(a=>a>r)||t.every(a=>Math.abs(a-r)>=gi))return;const i=Math.min(...t)-gi,o=Math.min(e.width/2,e.corner?.x??0);return i>=e.x+o&&i<=e.x+e.width-o?i:void 0}function Fu(e,t,r){const i=e.getScreenCTM(),o=Math.hypot(r.x-t.x,r.y-t.y);if(!i||o<=0)return 1;const a=new DOMPoint(t.x,t.y).matrixTransform(i),s=new DOMPoint(r.x,r.y).matrixTransform(i);return Math.hypot(s.x-a.x,s.y-a.y)/o||1}const ai=24,$3=32;function xn(e){return Math.ceil(Math.max(e,18))+ai+$3}function E3(e,t,r,i,o=!1){if((!o||r==="upper")&&t.y>=e.y+e.height+16){const u=Yi(e,"bottom"),f=Yi(t,"top"),g=(u.y+f.y)/2,p=_r([u,{x:u.x,y:g},{x:f.x,y:g},f]),m=i.filter(y=>![e,t].some(x=>Math.abs(y.x-x.x)<.001&&Math.abs(y.y-x.y)<.001&&Math.abs(y.width-x.width)<.001&&Math.abs(y.height-x.height)<.001));if(nr(p).every(y=>!m.some(x=>Br(y,x,8))))return p}const a=r==="upper"&&t.y>=e.y+e.height,s=r==="upper"&&!a?"top":"right";if(o&&a){const u=Yi(e,"bottom"),f=Yi(t,"top"),g={x:Math.max(t.x,Math.min(u.x,t.x+t.width)),y:f.y},p=(x,b)=>Math.abs(x.x-b.x)<.001&&Math.abs(x.y-b.y)<.001&&Math.abs(x.width-b.width)<.001&&Math.abs(x.height-b.height)<.001,m={start:u,end:g};if(Math.abs(u.x-g.x)<.001&&!i.some(x=>!p(x,e)&&!p(x,t)&&Br(m,x,Au)))return[u,g]}const n=a?"right":r==="upper"?"top":t.x>=e.x+e.width?"left":"right",l=Yi(e,s),c=Yi(t,n),h=o?16:32;if(s==="top"){const u=Math.min(...i.map(f=>f.y),t.y,e.y)-h;if(Math.abs(l.x-c.x)<.001){const f=Math.max(e.x+e.width,t.x+t.width,...i.map(g=>g.x+g.width))+h;return _r([l,{x:l.x,y:u},{x:f,y:u},{x:f,y:c.y},c])}return _r([l,{x:l.x,y:u},{x:c.x,y:u},c])}if(n==="left"&&l.y>=t.y&&l.y<=t.y+t.height)return[l,{x:t.x,y:l.y}];if(n==="left"){if(Math.abs(l.y-c.y)<.001)return[l,c];const u=(l.x+c.x)/2;return[l,{x:u,y:l.y},{x:u,y:c.y},c]}const d=Math.max(...i.map(u=>u.x+u.width))+h*2;return _r([l,{x:d,y:l.y},{x:d,y:c.y},c])}function P3(e,t,r,i=!1){const o=Yi(e,"bottom"),a=Yi(t,i?"left":"bottom"),s=i?16:32,n=Math.max(...r.map(l=>l.y+l.height))+s;if(i){const l=Math.min(e.x,t.x,...r.map(h=>h.x))-s-12,c=o.y+12;return _r([o,{x:o.x,y:c},{x:l,y:c},{x:l,y:a.y},a])}return _r([o,{x:o.x,y:n},{x:a.x,y:n},a])}function I3(e,t,r,i=!1){const o=i?e.x+e.width+28:Math.max(...r.map(c=>c.x+c.width))+28,a=Math.min(...r.map(c=>c.x))-(i?12:28),s=Math.max(...r.map(c=>c.y+c.height))+(i?12:28),n=e.y+e.height/2,l=t.x+t.width/2;return[{x:e.x+e.width,y:n},{x:o,y:n},{x:o,y:s},{x:a,y:s},{x:a,y:t.y+t.height+12},{x:l,y:t.y+t.height+12},{x:l,y:t.y+t.height+.25}]}function O3(e,t,r,i=!1){const o=Math.max(...r.map(n=>n.x+n.width))+(i?18:28),a=e.y+e.height/2,s=t.y+t.height/2;return[{x:e.x+e.width,y:a},{x:o,y:a},{x:o,y:s},{x:t.x+t.width,y:s}]}function D3(e,t){if(e.length!==7||e[3].x!==e[4].x||e[3].y<=e[4].y)return e;const r=Math.min(e[3].x,...t.filter(i=>i.y<e[3].y&&i.y+i.height>e[4].y).map(i=>i.x-20));return r===e[3].x?e:e.map((i,o)=>o===3||o===4?{...i,x:r}:i)}function Ai(e,t,r=4){return e.x<t.x+t.width+r&&e.x+e.width+r>t.x&&e.y<t.y+t.height+r&&e.y+e.height+r>t.y}function Br(e,t,r=0){const i=t.x-r,o=t.x+t.width+r,a=t.y-r,s=t.y+t.height+r;return Math.abs(e.start.x-e.end.x)<.001?e.start.x>i&&e.start.x<o&&Math.max(e.start.y,e.end.y)>a&&Math.min(e.start.y,e.end.y)<s:Math.abs(e.start.y-e.end.y)>=.001?!1:e.start.y>a&&e.start.y<s&&Math.max(e.start.x,e.end.x)>i&&Math.min(e.start.x,e.end.x)<o}function R3(e,t,r=Au,i=[]){let o=_r(e);for(let a=0;a<t.length*2+1;a+=1){let s;for(let n=0;n<o.length-1&&!s;n+=1){const l={start:o[n],end:o[n+1]},c=t.find(m=>Br(l,m,r));if(!c)continue;const h=Math.abs(l.start.x-l.end.x)<.001,d=h?l.end.y>=l.start.y:l.end.x>=l.start.x,u=h?d?c.y-r:c.y+c.height+r:d?c.x-r:c.x+c.width+r,f=h?d?c.y+c.height+r:c.y-r:d?c.x+c.width+r:c.x-r,p=(h?[c.x-r,c.x+c.width+r]:[c.y-r,c.y+c.height+r]).map(m=>{const y=h?[l.start,{x:l.start.x,y:u},{x:m,y:u},{x:m,y:f},{x:l.end.x,y:f},l.end]:[l.start,{x:u,y:l.start.y},{x:u,y:m},{x:f,y:m},{x:f,y:l.end.y},l.end],x=nr(_r(y)),b=x.reduce((k,_)=>k+t.filter(L=>L!==c&&Br(_,L,r)).length,0),S=x.filter(k=>i.some(_=>vs(k,_))).length,T=x.reduce((k,_)=>k+Math.hypot(_.end.x-_.start.x,_.end.y-_.start.y),0);return{detour:y,score:b*1e6+S*1e4+T}});s={index:n,points:p.toSorted((m,y)=>m.score-y.score)[0].detour}}if(!s)break;o=_r([...o.slice(0,s.index),...s.points,...o.slice(s.index+2)])}return o}const Be={userSendsMessage:"User sends message",agentResponds:"Agent responds",toolStarts:"Tool starts",toolCompletes:"Tool completes",agentAsksUser:"Agent asks user",userReplies:"User replies",agentFinishes:"Agent finishes",requestFails:"Request fails",streamFails:"Stream fails",userRetries:"User retries"},bp={[Be.userSendsMessage]:["Idle","Starting"],[Be.agentResponds]:["Starting","Streaming"],[Be.toolStarts]:["Streaming","RunningTool"],[Be.toolCompletes]:["RunningTool","Streaming"],[Be.agentAsksUser]:["Streaming","NeedsInput"],[Be.userReplies]:["NeedsInput","Streaming"],[Be.agentFinishes]:["Streaming","Complete"],[Be.requestFails]:["Starting","Failed"],[Be.streamFails]:["Streaming","Failed"],[Be.userRetries]:["Failed","Starting"]};function N3(e){return{direction:e.direction,nodes:e.nodes.map(({id:t,domId:r,shape:i,isGroup:o,parentId:a})=>({id:t,domId:r,shape:i,isGroup:o,parentId:a})),edges:e.edges.map(({id:t,start:r,end:i,label:o})=>({id:t,start:r,end:i,label:o}))}}function sd(e,t){const r="-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[-+]?\\d+)?",i=e.match(new RegExp(`(${r})([\\s,]+)(${r})\\s*$`,"i"));if(!i||i.index===void 0)return null;const o=`${e.slice(0,i.index)}${t.x}${i[2]}${t.y}`,a=o.match(new RegExp(`L\\s*(${r})[\\s,]+(${r})\\s*$`,"i"));if(!a||a.index===void 0)return o;const s=o.slice(0,a.index).match(new RegExp(`(${r})[\\s,]+(${r})\\s*$`,"i"));return s&&Math.hypot(Number(s[1])-t.x,Number(s[2])-t.y)<.001?o.slice(0,a.index).trimEnd():o}function q3(e,t,r){const i=e.match(/[a-zA-Z]|-?(?:\d*\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/gi);if(!i)return null;const o={M:2,L:2,Q:4,C:6},a=[];let s={x:0,y:0};for(let g=0;g<i.length;){const p=i[g++],m=o[p];if(!m)return sd(e,t);const y=i.slice(g,g+m).map(Number);if(y.length!==m||!y.every(Number.isFinite))return null;g+=m;const x=Array.from({length:m/2},(b,S)=>({x:y[S*2],y:y[S*2+1]}));a.push({command:p,points:x,start:s}),s=x.at(-1)}const n=g=>(g.x-t.x)*r.x+(g.y-t.y)*r.y;let l=a.length-1;for(;l>0&&n(a[l].start)>=0;)l-=1;const c=a[l];if(!c||c.command==="M"||n(c.points.at(-1))<0)return sd(e,t);const h=g=>{let p=[c.start,...c.points];const m=[p[0]];for(;p.length>1;)p=p.slice(1).map((y,x)=>({x:p[x].x+(y.x-p[x].x)*g,y:p[x].y+(y.y-p[x].y)*g})),m.push(p[0]);return m.slice(1)};let d=0,u=1;for(let g=0;g<32;g++){const p=(d+u)/2;n(h(p).at(-1))<0?d=p:u=p}return[...a.slice(0,l),{...c,points:h((d+u)/2)}].map(({command:g,points:p})=>`${g} ${p.map(m=>`${m.x} ${m.y}`).join(" ")}`).join(" ")}function rr(e,t){const r=e.getScreenCTM(),i=t.getScreenCTM();if(!r||!i)return null;const o=i.inverse(),a=e.getBBox(),s=[new DOMPoint(a.x,a.y),new DOMPoint(a.x+a.width,a.y),new DOMPoint(a.x+a.width,a.y+a.height),new DOMPoint(a.x,a.y+a.height)].map(d=>d.matrixTransform(r).matrixTransform(o)),n=Math.min(...s.map(d=>d.x)),l=Math.min(...s.map(d=>d.y)),c=Math.max(...s.map(d=>d.x)),h=Math.max(...s.map(d=>d.y));return{x:n,y:l,width:c-n,height:h-l}}function kr(e,t){const r=t.getScreenCTM();if(!r)return rr(e,t);const i=r.inverse(),o=e.getBoundingClientRect(),a=[new DOMPoint(o.left,o.top),new DOMPoint(o.right,o.top),new DOMPoint(o.right,o.bottom),new DOMPoint(o.left,o.bottom)].map(h=>h.matrixTransform(i)),s=Math.min(...a.map(h=>h.x)),n=Math.min(...a.map(h=>h.y)),l=Math.max(...a.map(h=>h.x)),c=Math.max(...a.map(h=>h.y));return{x:s,y:n,width:l-s,height:c-n}}function $1(e,t,r,i=0){let o=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;for(const[s,n,l,c]of[[e.x,t.x,r.x,r.x+r.width],[e.y,t.y,r.y,r.y+r.height]]){if(Math.abs(n)<1e-4){if(s<l-i||s>c+i)return null;continue}const h=(l-s)/n,d=(c-s)/n;o=Math.max(o,Math.min(h,d)),a=Math.min(a,Math.max(h,d))}return o<0||o>a?null:{x:e.x+t.x*o,y:e.y+t.y*o}}function lo(e,t){return Math.hypot(Math.max(t.x-e.x,0,e.x-t.x-t.width),Math.max(t.y-e.y,0,e.y-t.y-t.height))}function W3(e,t,r){const i=r.x-t.x,o=r.y-t.y,a=i*i+o*o,s=a?Math.max(0,Math.min(1,((e.x-t.x)*i+(e.y-t.y)*o)/a)):0;return Math.hypot(e.x-t.x-i*s,e.y-t.y-o*s)}function z3(e,t){const r=Number.parseFloat(t.dataset.cylinderRimRatio??"0.14"),i=Math.max(1,Math.min(e.height/2,e.height*r)),o=e.x+e.width/2,a=e.width/2,s=[];for(let n=0;n<=32;n+=1){const l=Math.PI+Math.PI*n/32;s.push({x:o+Math.cos(l)*a,y:e.y+i+Math.sin(l)*i})}s.push({x:e.x+e.width,y:e.y+e.height-i});for(let n=0;n<=32;n+=1){const l=Math.PI*n/32;s.push({x:o+Math.cos(l)*a,y:e.y+e.height-i+Math.sin(l)*i})}return s.push({x:e.x,y:e.y+i}),s}function aa(e){return e.tagName.toLowerCase()!=="polygon"?!1:e.getAttribute("points")?.match(/-?(?:\d+(?:\.\d*)?|\.\d+)/g)?.map(Number)?.length===8}function E1(e){if(!(e instanceof SVGPolygonElement)||e.points.numberOfItems<3)return null;const t=e.getScreenCTM();return t?Array.from({length:e.points.numberOfItems},(r,i)=>{const o=e.points.getItem(i).matrixTransform(t);return{x:o.x,y:o.y}}):null}function H3(e,t,r){const i=(o,a)=>o.x*a.y-o.y*a.x;return r.map((o,a)=>({start:o,end:r[(a+1)%r.length]})).flatMap(({start:o,end:a})=>{const s={x:a.x-o.x,y:a.y-o.y},n=i(t,s);if(Math.abs(n)<1e-4)return[];const l={x:o.x-e.x,y:o.y-e.y},c=i(l,s)/n,h=i(l,t)/n;return c>=0&&h>=0&&h<=1?[{point:{x:e.x+t.x*c,y:e.y+t.y*c},rayProgress:c}]:[]}).toSorted((o,a)=>o.rayProgress-a.rayProgress)[0]?.point}function Cp(e,t,r){if(r.tagName.toLowerCase()==="rect"){const o=r.getScreenCTM(),a=getComputedStyle(r),s=r.getBBox(),n=h=>/^\d+(?:\.\d+)?(?:px)?$/.test(h)?Number.parseFloat(h):NaN,l=n(a.rx==="auto"?a.ry:a.rx),c=n(a.ry==="auto"?a.rx:a.ry);if(o&&Math.abs(o.b)<1e-8&&Math.abs(o.c)<1e-8){const h=Math.min(s.width/2,l)*Math.abs(o.a),d=Math.min(s.height/2,c)*Math.abs(o.d);if(h>0&&Math.abs(h-d)<1e-6){const u=Math.abs(e.x-t.x-t.width/2)-(t.width/2-h),f=Math.abs(e.y-t.y-t.height/2)-(t.height/2-h);return Math.max(0,Math.hypot(Math.max(0,u),Math.max(0,f))-h)}}}const i=E1(r)??(r.dataset.diagramCylinder==="true"?z3(t,r):null);return i?Math.min(...i.map((o,a)=>W3(e,o,i[(a+1)%i.length]))):lo(e,t)}function Y3(e,t,r,i,o=0){const a=$1(e,t,r,o);if(!a)return null;const s=E1(i);if(s)return H3(e,t,s)??a;if(i instanceof SVGRectElement){const f=i.getScreenCTM()?.inverse();if(f){const g=y=>i.isPointInFill(new DOMPoint(e.x+t.x*y,e.y+t.y*y).matrixTransform(f));let p=Math.hypot(a.x-e.x,a.y-e.y),m=(r.x+r.width/2-e.x)*t.x+(r.y+r.height/2-e.y)*t.y;if(g(m)){for(let y=0;y<24;y++){const x=(p+m)/2;g(x)?m=x:p=x}return{x:e.x+t.x*m,y:e.y+t.y*m}}}}if(i.dataset.diagramCylinder!=="true")return a;const n={x:r.x+r.width/2,y:r.y+r.height/2};let l=Math.hypot(a.x-e.x,a.y-e.y),c=(n.x-e.x)*t.x+(n.y-e.y)*t.y;const h=Number.parseFloat(i.dataset.cylinderRimRatio??"0.14"),d=Math.max(1,Math.min(r.height/2,r.height*h)),u=f=>{const g={x:e.x+t.x*f,y:e.y+t.y*f};if(g.y>=r.y+d&&g.y<=r.y+r.height-d)return g.x>=r.x&&g.x<=r.x+r.width;const p=g.y<r.y+d?r.y+d:r.y+r.height-d,m=(g.x-n.x)/(r.width/2),y=(g.y-p)/d;return m*m+y*y<=1};for(let f=0;f<24;f+=1){const g=(l+c)/2;u(g)?c=g:l=g}return{x:e.x+t.x*c,y:e.y+t.y*c}}function wp(e){if(!e.classList.contains("statediagram"))return;const t=[...e.querySelectorAll("g.node")].flatMap(r=>{const i=r.querySelector(":scope > .label-container, :scope > rect, :scope > circle, :scope > ellipse, :scope > polygon");return i?[{node:r,shape:i}]:[]});for(const r of e.querySelectorAll('.edgePaths path[marker-end], path.transition[data-edge="true"][marker-end]')){const i=r.getTotalLength();if(i<.25)continue;const o=r.getPointAtLength(i),a=r.getPointAtLength(Math.max(0,i-.1)),s=(r.dataset.terminalDirection??"").split(",").map(Number),n=s.length===2&&s.every(Number.isFinite)?{x:s[0],y:s[1]}:{x:o.x-a.x,y:o.y-a.y},l=Math.hypot(n.x,n.y);if(l<1e-4)continue;const c={x:n.x/l,y:n.y/l},h={x:o.x-c.x*256,y:o.y-c.y*256},d=r.dataset.terminalTarget,f=t.flatMap(({node:p,shape:m})=>{const y=kr(m,r);if(!y)return[];const x=y,b=$1(h,c,x,.5);if(!b)return[];const S=Math.hypot(b.x-o.x,b.y-o.y),T={x:x.x+x.width/2,y:x.y+x.height/2};return c.x*(T.x-b.x)+c.y*(T.y-b.y)>0&&(p.id===d||S<=L3)?[{node:p,intersection:b,correction:S}]:[]}).sort((p,m)=>p.correction-m.correction)[0];if(!f)continue;const g=sd(r.getAttribute("d")??"",f.intersection);g&&(r.setAttribute("d",g),r.dataset.terminalTarget=f.node.id,r.dataset.terminalDirection=`${c.x},${c.y}`)}}function kp(e,t){const i=(t.getAttribute("marker-end")??"").match(/#([^)'"]+)/)?.[1];return i?e.querySelector(`marker[id="${CSS.escape(i)}"]`):null}function js(e,t=5){const r=[...e.querySelectorAll("g.node")].flatMap(i=>{const o=Je(i);return o?[{node:i,shape:o}]:[]});for(const i of e.querySelectorAll(".edgePaths path[marker-end], .edges.edgePath path[marker-end]")){if(kp(e,i)?.dataset.diagramChevron!=="true")continue;const o=i.dataset.terminalGapBasePath??i.getAttribute("d");if(!o)continue;i.dataset.terminalGapBasePath=o,i.setAttribute("d",o);const a=i.getTotalLength();if(a<.25)continue;const s=i.getPointAtLength(a),n=i.getPointAtLength(Math.max(0,a-.1)),l=i.getScreenCTM();if(!l)continue;const c=new DOMPoint(s.x,s.y).matrixTransform(l),h=(i.dataset.manhattanPoints??"").trim().split(/\s+/).map(D=>D.split(",").map(Number)).filter(D=>D.length===2&&D.every(Number.isFinite)).map(([D,P])=>({x:D,y:P})),d=h.at(-2)??n,u=h.at(-1)??s,f=(i.dataset.terminalDirection??"").split(",").map(Number),g=h.length>=2?{x:u.x-d.x,y:u.y-d.y}:f.length===2&&f.every(Number.isFinite)?{x:f[0],y:f[1]}:{x:s.x-n.x,y:s.y-n.y},p=new DOMPoint(0,0).matrixTransform(l),m=new DOMPoint(g.x,g.y).matrixTransform(l),y=Math.hypot(m.x-p.x,m.y-p.y);if(y<=0)continue;const x={x:(m.x-p.x)/y,y:(m.y-p.y)/y},b=vr(i),S=i.dataset.terminalTarget??b?.target,T={x:c.x-x.x*256,y:c.y-x.y*256},_=r.flatMap(({node:D,shape:P})=>{if(S&&D.id!==S&&zr(D)!==S)return[];const Y=P.getBoundingClientRect(),X={x:Y.left,y:Y.top,width:Y.width,height:Y.height},z=Y3(T,x,X,P,e.classList.contains("statediagram")?.5:0);if(!z)return[];const U={x:X.x+X.width/2,y:X.y+X.height/2},j=x.x*(U.x-z.x)+x.y*(U.y-z.y)>0,V=Math.hypot(z.x-c.x,z.y-c.y);return j&&(S||V<=12)?[{node:D,shape:P,bounds:X,intersection:z,correction:V}]:[]}).sort((D,P)=>D.correction-P.correction)[0];if(!_)continue;const L=kp(e,i)?.querySelector("path"),v=Number.parseFloat(L?getComputedStyle(L).strokeWidth:"0"),M=t+(Number.isFinite(v)?v/2:0);let B=0,E=M;const O=D=>({x:_.intersection.x-x.x*D,y:_.intersection.y-x.y*D});for(;Cp(O(E),_.bounds,_.shape)<M&&E<256;)E*=2;for(let D=0;D<24;D+=1){const P=(B+E)/2;Cp(O(P),_.bounds,_.shape)<M?B=P:E=P}const $=O(E),I=new DOMPoint($.x,$.y).matrixTransform(l.inverse()),F=O(E+1),R=new DOMPoint(F.x,F.y).matrixTransform(l.inverse()),q=q3(i.getAttribute("d")??"",R,g);q&&(i.setAttribute("d",`${q} L ${I.x} ${I.y}`),i.dataset.terminalTarget=_.node.id,i.dataset.terminalGapCss=String(t))}}function $u(e,t=3){const r="-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[-+]?\\d+)?",i=e.match(new RegExp(`[ML]|${r}`,"gi")),o=e.replace(new RegExp(`[ML]|${r}|[\\s,]`,"gi"),"").trim();if(!i||o)return null;const a=[];let s="";for(let n=0;n<i.length;n+=1){const l=i[n];if(/^[ML]$/i.test(l)){s=l.toUpperCase();continue}const c=i[n+1];if(!s||!c||/^[ML]$/i.test(c))return null;a.push({x:Number(l),y:Number(c)}),n+=1,s="L"}return a.length<t?null:a.slice(1).every((n,l)=>{const c=a[l];return Math.abs(n.x-c.x)<.001||Math.abs(n.y-c.y)<.001})?a:null}function _r(e){const t=e.filter((i,o)=>!o||Math.hypot(i.x-e[o-1].x,i.y-e[o-1].y)>=.001),r=[];for(const i of t){const o=r.at(-1),a=r.at(-2);o&&a&&(Math.abs(a.x-o.x)<.001&&Math.abs(o.x-i.x)<.001||Math.abs(a.y-o.y)<.001&&Math.abs(o.y-i.y)<.001)?r[r.length-1]=i:r.push(i)}return r}function Eu(e,t=A1){const r=[`M ${e[0].x} ${e[0].y}`];for(let o=1;o<e.length-1;o+=1){const a=e[o-1],s=e[o],n=e[o+1],l=Math.hypot(s.x-a.x,s.y-a.y),c=Math.hypot(n.x-s.x,n.y-s.y),h=(s.x-a.x)*(n.y-s.y)-(s.y-a.y)*(n.x-s.x),d=Math.min(t,l/2,c/2);if(d<=0||Math.abs(h)<.001){r.push(`L ${s.x} ${s.y}`);continue}const u=s.x-(s.x-a.x)/l*d,f=s.y-(s.y-a.y)/l*d,g=s.x+(n.x-s.x)/c*d,p=s.y+(n.y-s.y)/c*d;r.push(`L ${u} ${f}`,`Q ${s.x} ${s.y} ${g} ${p}`)}const i=e[e.length-1];return r.push(`L ${i.x} ${i.y}`),r.join(" ")}function yh(e){for(const t of e.querySelectorAll('.flowchart-link, .edgePaths path, path.relation, path.transition[data-edge="true"]')){const r=$u(t.getAttribute("d")??"");if(!r)continue;const i=_r(r);t.dataset.manhattanPoints??=i.map(a=>`${a.x},${a.y}`).join(" ");const o=Eu(i);t.dataset.feedbackLane||(t.dataset.manhattanSegments=String(Math.max(0,i.length-1))),o.includes(" Q ")&&(t.setAttribute("d",o),t.dataset.cornerRadius=String(A1))}}function Je(e){return e.querySelector(":scope > .label-container, :scope > rect, :scope > circle, :scope > ellipse, :scope > .outer-path, :scope > .basic.label-container, :scope > polygon")}function X3(e){for(const t of e.querySelectorAll("g.node")){const r=t.querySelector(":scope > path.basic.label-container.outer-path[label-offset-y]");if(!r||r.dataset.diagramCylinder==="true")continue;const i=r.getBBox(),o=i.height,s=i.width/2,n=Math.min(8,o*.14),l=-o/2,c=o/2;r.setAttribute("d",`M ${-s} ${l+n} A ${s} ${n} 0 0 1 ${s} ${l+n} L ${s} ${c-n} A ${s} ${n} 0 0 1 ${-s} ${c-n} Z`),r.removeAttribute("transform"),r.dataset.diagramCylinder="true",r.dataset.cylinderRimRatio=String(n/o);const h=document.createElementNS("http://www.w3.org/2000/svg","path");h.setAttribute("d",`M ${-s} ${l+n} A ${s} ${n} 0 0 1 ${s} ${l+n} A ${s} ${n} 0 0 1 ${-s} ${l+n} Z`),h.setAttribute("class","diagram-cylinder-rim"),h.setAttribute("aria-hidden","true"),h.setAttribute("focusable","false"),r.after(h)}}function j3(e){if(e.getAttribute("aria-roledescription")==="flowchart-v2")for(const t of e.querySelectorAll("g.node")){t.querySelector(":scope > .flowchart-node-outline")?.remove();const r=Je(t);if(!r)continue;const i=r.cloneNode(!1);i.removeAttribute("id"),i.classList.add("flowchart-node-outline"),i.setAttribute("aria-hidden","true"),i.setAttribute("focusable","false"),i.style.setProperty("fill","none","important"),t.append(i)}}function G3(e){if(e.getAttribute("aria-roledescription")==="er")for(const t of e.querySelectorAll("g.node")){t.querySelectorAll(":scope > .er-negative-space-divider").forEach(d=>d.remove());const r=[...t.querySelectorAll(":scope > .row-rect-odd, :scope > .row-rect-even")].map(d=>d.getBBox());if(!r.length)continue;const i=[...t.querySelectorAll(":scope > .divider")],o=i.map(d=>d.getBBox()).filter(d=>d.height>d.width).toSorted((d,u)=>u.x-d.x);i.forEach(d=>d.remove());const a=Math.min(...r.map(d=>d.x)),s=Math.max(...r.map(d=>d.x+d.width)),n=Math.max(...r.map(d=>d.y+d.height)),l=(d,u,f)=>{const g=document.createElementNS("http://www.w3.org/2000/svg","line");g.classList.add("er-negative-space-divider"),g.dataset.dividerKind=d,g.setAttribute("x1",String(u.x)),g.setAttribute("y1",String(u.y)),g.setAttribute("x2",String(f.x)),g.setAttribute("y2",String(f.y)),g.setAttribute("aria-hidden","true"),t.insertBefore(g,t.querySelector(":scope > .label"))};for(const d of r.map(u=>u.y))l("row",{x:a,y:d},{x:s,y:d});const c=[...t.querySelectorAll(":scope > .label.attribute-keys")].some(d=>!!d.textContent?.trim()),h=o[0];if(c&&h){const d=h.x+h.width/2;l("key",{x:d,y:r[0].y},{x:d,y:n})}}}function Ha(e){for(const t of e.querySelectorAll("marker")){const r=t.querySelector("path"),i=t.id.endsWith("-arrowhead"),o=t.id.includes("pointEnd")||t.id.includes("barbEnd")||i,a=t.id.includes("pointStart");!r||!o&&!a||(t.setAttribute("viewBox",`0 0 ${Qn} ${Qn}`),t.setAttribute("markerWidth",String(Qn)),t.setAttribute("markerHeight",String(Qn)),t.setAttribute("refX",o?"6.5":"0.5"),t.setAttribute("refY","3.5"),t.setAttribute("orient",i?"auto-start-reverse":"auto"),t.setAttribute("markerUnits","userSpaceOnUse"),t.dataset.diagramChevron="true",r.setAttribute("d",o?"M 3.5 0.5 L 6.5 3.5 L 3.5 6.5":"M 3.5 0.5 L 0.5 3.5 L 3.5 6.5"),r.setAttribute("fill","none"),r.setAttribute("stroke","context-stroke"),r.setAttribute("stroke-width","1"),r.setAttribute("stroke-linecap","round"),r.setAttribute("stroke-linejoin","round"),r.setAttribute("vector-effect","non-scaling-stroke"))}}function vr(e){const t=e.id.match(/-L_([^_]+)_([^_]+)_\d+$/);return t?{source:t[1],target:t[2]}:null}function $i(e,t){const r=t.id.match(/-(L_.+)$/)?.[1];if(r)return[...e.querySelectorAll(".edgeLabels > .edgeLabel")].find(i=>i.querySelector(":scope > .label")?.getAttribute("data-id")===r)}function ir(e,t){return[...e.querySelectorAll("g.node")].find(r=>zr(r)===t)}function U3(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return!1;const t=[...e.querySelectorAll(".edgePaths path")].find(_=>{const L=vr(_);return L?.source==="Client"&&L.target==="Gateway"}),r=ir(e,"Client"),i=ir(e,"Gateway"),o=ir(e,"Queue"),a=[...e.querySelectorAll(".edgePaths path")].find(_=>{const L=vr(_);return L?.source==="Gateway"&&L.target==="Queue"}),s=t&&$i(e,t);let n=r&&Sr(r);const l=i&&Sr(i),c=o&&Sr(o),h=t&&s&&kr(s,t);if(!t||!r||!n||!l||!s||!h)return!1;const d=Et(l,.5,.5),u=[...e.querySelectorAll("g.cluster > rect")].flatMap(_=>{const L=kr(_,t);return L?[L]:[]}).filter(_=>d.x>_.x&&d.x<_.x+_.width&&d.y>_.y&&d.y<_.y+_.height).toSorted((_,L)=>L.width*L.height-_.width*_.height)[0];if(!u)return!1;const f=Math.max(52,h.height+24),g=u.y-(n.y+n.height),p=Math.max(0,f-g),m=r.transform.baseVal.consolidate()?.matrix;m&&p>0&&(r.setAttribute("transform",`translate(${m.e}, ${m.f-p})`),r.dataset.requestLaneRaised="true",r.dataset.requestLaneShift=String(Number(r.dataset.requestLaneShift??0)+p),n={...n,y:n.y-p});const y=Et(n,.5,1),x=Et(l,0,.35),b=(y.y+u.y)/2,S=u.x-Math.max(20,h.height/2+4),T=[y,{x:y.x,y:b},{x:S,y:b},{x:S,y:x.y},x];t.setAttribute("d",T.map((_,L)=>`${L?"L":"M"}${_.x},${_.y}`).join("")),t.dataset.clientRequestLane="downward",t.dataset.manhattanPoints=T.map(_=>`${_.x},${_.y}`).join(" "),fo(s,t,T,1);const k=a&&$i(e,a);if(a&&k&&c){const _=Et(l,0,.65),L=Et(c,0,.5),v=u.x+12,M=[_,{x:v,y:_.y},{x:v,y:L.y},L];a.setAttribute("d",M.map((B,E)=>`${E?"L":"M"}${B.x},${B.y}`).join("")),a.dataset.clientRequestLane="enqueue",a.dataset.manhattanPoints=M.map(B=>`${B.x},${B.y}`).join(" "),fo(k,a,M,1)}return P1(e,"Client",n),!0}function V3(e,t,r){if(!Ai(e,r,12))return{x:0,y:0};const i=[{x:e.x-r.x-r.width-12,y:0,clear:r.x+r.width<=t.x},{x:e.x+e.width-r.x+12,y:0,clear:r.x>=t.x+t.width},{x:0,y:e.y-r.y-r.height-12,clear:r.y+r.height<=t.y},{x:0,y:e.y+e.height-r.y+12,clear:r.y>=t.y+t.height}],{x:o,y:a}=i.toSorted((s,n)=>Number(n.clear)-Number(s.clear)||Math.hypot(s.x,s.y)-Math.hypot(n.x,n.y))[0];return{x:o,y:a}}function Sp(e){const t=Math.min(...e.map(i=>i.x)),r=Math.min(...e.map(i=>i.y));return{x:t,y:r,width:Math.max(...e.map(i=>i.x+i.width))-t,height:Math.max(...e.map(i=>i.y+i.height))-r}}function Z3(e,t,r){const i=e.parentElement?.getScreenCTM(),o=t.getScreenCTM();if(!i||!o)return;const a=new DOMPoint(0,0).matrixTransform(o).matrixTransform(i.inverse()),s=new DOMPoint(r.x,r.y).matrixTransform(o).matrixTransform(i.inverse()),n=e.getAttribute("transform")??"";e.setAttribute("transform",`translate(${s.x-a.x}, ${s.y-a.y}) ${n}`)}function K3(e,t){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const r=[...e.querySelectorAll("g.node")],i=[...e.querySelectorAll("g.cluster")].flatMap(s=>{const n=s.querySelector(":scope > rect"),l=s.querySelector(":scope > g.cluster-label");if(!n||!l)return[];const c=t&&Lu(s,t),h=c?t?.get(c):void 0;if(t&&!h)return[];const d=n.getBBox(),u=r.filter(f=>{if(h)return h.has(zr(f));const g=Sr(f);if(!g)return!1;const p=Et(g,.5,.5);return p.x>=d.x&&p.x<=d.x+d.width&&p.y>=d.y&&p.y<=d.y+d.height});return[{cluster:s,rect:n,label:l,frame:d,members:u,id:c,memberIds:h}]}),o=t?[...e.querySelectorAll(".edgePaths path")].flatMap(s=>{const n=vr(s),l=$u(s.getAttribute("d")??"",2);if(!n||!l)return[];const c=h=>{const d=ir(e,h),u=(d&&Je(d))??i.find(g=>g.id===h)?.rect,f=u&&rr(u,s);return u&&f?{shape:u,bounds:f}:null};return[{path:s,points:l,source:c(n.source),target:c(n.target)}]}):[],a=new Map;for(const s of i.toSorted((n,l)=>(n.memberIds?.size??0)-(l.memberIds?.size??0)||n.frame.width*n.frame.height-l.frame.width*l.frame.height)){const n=i.filter(E=>E!==s&&(s.memberIds?!!(E.id&&s.memberIds.has(E.id)):E.frame.x>=s.frame.x&&E.frame.y>=s.frame.y&&E.frame.x+E.frame.width<=s.frame.x+s.frame.width&&E.frame.y+E.frame.height<=s.frame.y+s.frame.height)).flatMap(({cluster:E,rect:O})=>{const $=t?rr(O,s.cluster):a.get(E);return $?[$]:[]}),c=[...s.members.flatMap(E=>{const O=Je(E),$=t&&O?rr(O,s.cluster):Sr(E);return $?[$]:[]}),...n];if(!c.length)continue;const h=s.label.querySelector("foreignObject"),d=h?.querySelector("div"),u=Sp(c),f=t?r.filter(E=>!s.members.includes(E)).flatMap(E=>{const O=Je(E),$=O&&rr(O,s.cluster);return $?[$]:[]}):[];let g=Math.ceil(Math.max(d?.getBoundingClientRect().height??0,d?.scrollHeight??0,s.label.getBBox().height,18)),p=xn(g);const m=Math.min(...c.map(({x:E})=>E)),y=Math.max(...c.map(({x:E,width:O})=>E+O)),x=Math.min(...c.map(({y:E})=>E)),b=Math.max(...c.map(({y:E,height:O})=>E+O));let S=Math.min(s.frame.x,m-ai),T=Math.min(s.frame.y,x-p),k=Math.max(s.frame.x+s.frame.width,y+ai),_=Math.max(s.frame.y+s.frame.height,b+20);if(t&&f.some(E=>Ai({x:S,y:T,width:k-S,height:_-T},E,12))){if(S=m-ai,k=y+ai,_=b+20,h&&d){const E=h.cloneNode(!0),O=E.querySelector("div");E.style.visibility="hidden",E.setAttribute("height","1"),E.setAttribute("width",String(k-S-ai*2)),O.style.setProperty("height","auto","important"),O.style.setProperty("width","100%","important"),s.label.append(E);try{const $=Math.max(u.width,O.scrollWidth);k=S+$+ai*2,E.setAttribute("width",String($)),g=Math.ceil(Math.max(18,O.scrollHeight))}finally{E.remove()}}else k=Math.max(k,S+s.label.getBBox().width+ai*2);p=xn(g),T=x-p}const L={x:S,y:T,width:k-S,height:_-T};if(s.rect.setAttribute("x",String(L.x)),s.rect.setAttribute("y",String(L.y)),s.rect.setAttribute("width",String(L.width)),s.rect.setAttribute("height",String(L.height)),s.cluster.dataset.headerHeight=String(p),h)h.setAttribute("x","0"),h.setAttribute("y","0"),h.setAttribute("width",String(Math.max(24,L.width-ai*2))),h.setAttribute("height",String(g)),s.label.setAttribute("transform",`translate(${L.x+ai}, ${L.y+ai})`);else{const E=s.label.getBBox();s.label.setAttribute("transform",`translate(${L.x+L.width/2-E.x-E.width/2}, ${L.y+ai-E.y})`)}if(a.set(s.cluster,L),!t)continue;const v=i.filter(E=>E!==s&&E.id&&s.id&&!s.memberIds?.has(E.id)&&!E.memberIds?.has(s.id)),M=v.filter(E=>!v.some(O=>O!==E&&E.id&&O.memberIds?.has(E.id))),B=M.map(E=>[E.cluster,...E.members,...i.filter(O=>O.id&&E.memberIds?.has(O.id)).map(O=>O.cluster)]);B.push(...r.filter(E=>!s.members.includes(E)&&!M.some(O=>O.members.includes(E))).map(E=>[E]));for(const E of B){const O=D=>{const P=D.flatMap(Y=>{const X=Y.matches("g.node")?Je(Y):Y.querySelector(":scope > rect"),z=X&&rr(X,s.cluster);return z?[z]:[]});return P.length?Sp(P):null},$=O(E);if(!$)continue;const I=V3(L,u,$);if(!I.x&&!I.y)continue;const F=I.x?"x":"y",R=I.x?"width":"height",q=B.filter(D=>{const P=O(D);return P&&(I[F]>0?P[F]+P[R]>$[F]:P[F]<$[F]+$[R])}).flat();for(const D of new Set(q))q.some(P=>P!==D&&P.contains(D))||Z3(D,s.cluster,I)}}for(const{path:s,points:n,source:l,target:c}of o){let h=!1;const d=(p,m)=>{const y=p&&rr(p.shape,s);if(!p||!y)return m;const x=p.bounds;return["x","y","width","height"].every(b=>Math.abs(y[b]-x[b])<.001)?m:(h=!0,{x:y.x+(m.x-x.x)*y.width/(x.width||1),y:y.y+(m.y-x.y)*y.height/(x.height||1)})},u=d(l,n[0]),f=d(c,n[n.length-1]);if(!h)continue;const g=mc(n,u,f,Math.abs(n[1].x-n[0].x)<.001);s.setAttribute("d",g.map((p,m)=>`${m?"L":"M"}${p.x},${p.y}`).join("")),s.dataset.manhattanPoints=g.map(p=>`${p.x},${p.y}`).join(" ")}}function xh(e,t=!1){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const i=[...e.querySelectorAll(".edgePaths path")].flatMap(y=>{const x=vr(y);return x?[{path:y,...x}]:[]}),o=new Map,a=new Map;for(const y of i.filter(({source:x,target:b})=>x!==b))o.set(y.target,(o.get(y.target)??0)+1),a.set(y.source,(a.get(y.source)??0)+1);const s=i.find(y=>y.source!==y.target&&(o.get(y.source)??0)>=2&&(a.get(y.source)??0)===1&&(a.get(y.target)??0)>=2);if(!s)return;if(!t&&s.path.dataset.feedbackLane==="outer")return s.path.getBBox();const n=ir(e,s.source),l=ir(e,s.target),c=n&&Je(n),h=l&&Je(l);if(!c||!h)return;const d=n&&Sr(n),u=l&&Sr(l),f=[...e.querySelectorAll("g.node")].flatMap(y=>{const x=Sr(y);return x?[x]:[]});if(!d||!u||!f.length)return;const g=[...e.querySelectorAll(".edgePaths path")].filter(y=>y!==s.path).map(y=>y.getBBox()),p=s.path.dataset.compactFlowchart==="true",m=I3(d,u,p?f:[...f,...g],p);s.path.setAttribute("d",m.map((y,x)=>`${x?"L":"M"}${y.x},${y.y}`).join("")),s.path.dataset.feedbackLane="outer",s.path.dataset.feedbackSource=s.source,s.path.dataset.feedbackTarget=s.target,s.path.dataset.manhattanSegments="4",s.path.dataset.manhattanPoints=m.map(y=>`${y.x},${y.y}`).join(" ")}function P1(e,t,r){if(e.getAttribute("aria-roledescription")!=="flowchart-v2"||!e.querySelector("g.cluster"))return;const i=[...e.querySelectorAll(".edgePaths path")],o=[...e.querySelectorAll(".edgeLabels > .edgeLabel")];i.forEach((a,s)=>{if(a.dataset.nestedDecisionRoute)return;const n=vr(a),l=n?i.filter(T=>vr(T)?.source===n.source).length:0,c=n&&ir(e,n.source),h=n&&ir(e,n.target),d=c&&rr(c,a),u=n?.target===t?r:h&&kr(h,a);if(!n||!d||!u||l>1||u.y>=d.y)return;const f=[...[...e.querySelectorAll("g.node")].flatMap(T=>{const k=rr(T,a);return k?[k]:[]}),...[...e.querySelectorAll("g.cluster > rect")].flatMap(T=>{const k=rr(T,a);return k?[k]:[]})],g=O3(d,u,f,a.dataset.compactFlowchart==="true");a.setAttribute("d",g.map((T,k)=>`${k?"L":"M"}${T.x},${T.y}`).join("")),a.dataset.groupedReturnLane="right",a.dataset.manhattanPoints=g.map(T=>`${T.x},${T.y}`).join(" ");const p=o[s];if(!p)return;const m={x:g[1].x,y:(g[1].y+g[2].y)/2},y=p.getBBox(),x=a.getCTM(),b=p.parentElement?.getCTM(),S=x&&b?new DOMPoint(m.x,m.y).matrixTransform(x).matrixTransform(b.inverse()):m;p.setAttribute("transform",`translate(${S.x-y.x-y.width/2}, ${S.y-y.y-y.height/2})`),p.dataset.finalPathCenter=`${m.x},${m.y}`})}function Q3(e){P1(e)}function vp(e){const t=e.querySelector('path[data-feedback-lane="outer"]'),r=t?.dataset.feedbackSource&&ir(e,t.dataset.feedbackSource),i=t?.dataset.feedbackTarget&&ir(e,t.dataset.feedbackTarget),o=t?.getScreenCTM(),a=(t?.dataset.manhattanPoints??"").split(" ").map(E=>E.split(",").map(Number)).filter(E=>E.length===2&&E.every(Number.isFinite)).map(([E,O])=>({x:E,y:O}));if(!t||!r||!i||!o||a.length<4)return;const s=o.inverse(),n=r.getBoundingClientRect(),l=i.getBoundingClientRect(),c=t.dataset.feedbackTarget,h=[...e.querySelectorAll(".edgePaths path")].flatMap(E=>{if(E===t)return[];const O=vr(E),$=(E.dataset.manhattanPoints??"").trim().split(/\s+/).map(Y=>Y.split(",").map(Number)).filter(Y=>Y.length===2&&Y.every(Number.isFinite)).map(([Y,X])=>({x:Y,y:X})),I=E.getScreenCTM();if(!O||!I||$.length<2)return[];const F=O.source===c?0:O.target===c?-1:null;if(F===null)return[];const R=$[F===0?0:$.length-1],q=$[F===0?1:$.length-2],D=new DOMPoint(R.x,R.y).matrixTransform(I),P=new DOMPoint(q.x,q.y).matrixTransform(I);return Math.abs(D.y-l.bottom)>1||Math.abs(D.x-P.x)>1?[]:[D.matrixTransform(s).x]}),d=new DOMPoint(l.left,l.bottom).matrixTransform(s).x,u=new DOMPoint(l.right,l.bottom).matrixTransform(s).x;let f=A3({x:Math.min(d,u),width:Math.abs(u-d)},h);const g=(d+u)/2,p=new DOMPoint(n.right,n.top+n.height/2).matrixTransform(s),m=Je(i),y=m&&rr(m,t),x=m?getComputedStyle(m).rx:"0",b=m?.getBBox().width??0,S=y&&b&&a.at(-2).y>y.y+y.height?F3({...y,corner:{x:(Number.parseFloat(x)||0)*(x.endsWith("%")?y.width/100:y.width/b),y:0}},h):void 0,T=S===void 0?[]:[{...a[a.length-3]},{x:S,y:a[a.length-2].y},{x:S,y:new DOMPoint(l.left,l.bottom).matrixTransform(s).y}],k=[...e.querySelectorAll("g.node")].filter(E=>E!==i).flatMap(E=>{const O=rr(E,t);return O?[O]:[]}),_=$i(e,t),L=[...e.querySelectorAll(".edgeLabels > .edgeLabel")].filter(E=>E!==_&&E.textContent?.trim()).flatMap(E=>{const O=kr(E,t);return O?[O]:[]}),v=Pu(e).filter(E=>E.path!==t).flatMap(E=>{const O=E.path.getScreenCTM();return O?nr(E.points.map(({x:$,y:I})=>new DOMPoint($,I).matrixTransform(O).matrixTransform(s))):[]}),M=T.length>0&&nr(T).every(E=>!k.some(O=>Br(E,O,8))&&!L.some(O=>Br(E,O,4))&&!v.some(({start:O,end:$})=>Br(E,{x:Math.min(O.x,$.x),y:Math.min(O.y,$.y),width:Math.abs($.x-O.x),height:Math.abs($.y-O.y)},6)));if(M&&(f=S),!M&&Math.abs(f-g)>1&&a.length>=7){const E=new DOMPoint(l.left+l.width/2,l.top-.25).matrixTransform(s),O=new DOMPoint(l.left+l.width/2,l.top-12).matrixTransform(s);a[0]={x:p.x,y:p.y},a[1].y=p.y,a[4]={x:a[3].x,y:O.y},a[5]={x:O.x,y:O.y},a[6]={x:E.x,y:E.y},t.dataset.feedbackTargetSide="top",t.dataset.manhattanPoints=a.map(({x:$,y:I})=>`${$},${I}`).join(" "),t.setAttribute("d",a.map(({x:$,y:I},F)=>`${F===0?"M":"L"}${$},${I}`).join("")),fo($i(e,t),t,a);return}const B=new DOMPoint(l.left+l.width/2,l.bottom+.25).matrixTransform(s);B.x=f,a[0]={x:p.x,y:p.y},a[1].y=p.y,a[a.length-2].x=B.x,a[a.length-1]={x:B.x,y:B.y},t.dataset.feedbackTargetSide="bottom",t.dataset.manhattanPoints=a.map(({x:E,y:O})=>`${E},${O}`).join(" "),t.setAttribute("d",a.map(({x:E,y:O},$)=>`${$===0?"M":"L"}${E},${O}`).join("")),fo($i(e,t),t,a)}function Mp(e){const t=[...e.querySelectorAll(".edgePaths path")].flatMap(i=>{if(i.dataset.clusterHeaderClearance||i.dataset.nestedDecisionRoute||i.dataset.decisionCycleRoute)return[];const o=vr(i),a=(i.dataset.manhattanPoints??"").trim().split(/\s+/).map(s=>s.split(",").map(Number)).filter(s=>s.length===2&&s.every(Number.isFinite)).map(([s,n])=>({x:s,y:n}));return o&&a.length>=2?[{path:i,points:a,...o}]:[]}),r=new Map;for(const i of t)r.set(i.source,[...r.get(i.source)??[],i]);for(const[i,o]of r){const a=o.length>=2&&ir(e,i),s=a&&Sr(a);if(!s)continue;const n=o.filter(({points:u})=>Math.abs(u[0].x-u[1].x)<.001);if(n.length<2)continue;const l=n.toSorted((u,f)=>{const g=ir(e,u.target),p=ir(e,f.target),m=g&&Sr(g),y=p&&Sr(p);return(m?.x??0)+(m?.width??0)/2-((y?.x??0)+(y?.width??0)/2)||(m?.y??0)+(m?.height??0)/2-((y?.y??0)+(y?.height??0)/2)||u.path.id.localeCompare(f.path.id)}),c=Math.min(_3,s.width*.4/(l.length-1)),d=s.x+s.width/2-c*(l.length-1)/2;l.forEach(({path:u,points:f},g)=>{const p={x:d+c*g,y:f[0].y},m=f.at(-1),y=mc(f,p,m,!0);u.dataset.fanoutPort=`${p.x},${p.y}`,u.dataset.manhattanPoints=y.map(({x,y:b})=>`${x},${b}`).join(" "),u.setAttribute("d",y.map(({x,y:b},S)=>`${S===0?"M":"L"}${x},${b}`).join(""))})}}function mc(e,t,r,i){if(e.length<2)return e;if(e.length===2){if(i&&Math.abs(t.x-r.x)>=.001){const s=(t.y+r.y)/2;return[t,{x:t.x,y:s},{x:r.x,y:s},r]}if(!i&&Math.abs(t.y-r.y)>=.001){const s=(t.x+r.x)/2;return[t,{x:s,y:t.y},{x:s,y:r.y},r]}return[t,r]}if(e.length===3){if(i&&Math.abs(t.x-r.x)>=.001){const s=(t.y+r.y)/2;return[t,{x:t.x,y:s},{x:r.x,y:s},r]}if(!i&&Math.abs(t.y-r.y)>=.001){const s=(t.x+r.x)/2;return[t,{x:s,y:t.y},{x:s,y:r.y},r]}return[t,r]}const o=e.map(s=>({...s}));return o[0]=t,o[o.length-1]=r,i?(o[1].x=t.x,o[o.length-2].x=r.x):(o[1].y=t.y,o[o.length-2].y=r.y),o.slice(1).some((s,n)=>{const l=o[n];return Math.abs(s.x-l.x)>=.001&&Math.abs(s.y-l.y)>=.001})?mc([t,r],t,r,i):o}function fo(e,t,r,i,o){if(!e?.textContent?.trim())return!0;if(r.length<2)return!1;const a=t.getScreenCTM(),s=e.parentElement?.getScreenCTM();if(!a||!s)return!1;const n=e.getBoundingClientRect(),l=kr(e,t);if(o&&!l)return!1;const c=new DOMPoint(n.left+n.width/2,n.top+n.height/2).matrixTransform(a.inverse()),h=e.getAttribute("transform");e.removeAttribute("transform");const d=e.getBBox();h&&e.setAttribute("transform",h);const u=[...t.ownerSVGElement?.querySelectorAll("g.edgeLabel")??[]].filter(x=>x!==e&&x.textContent?.trim()).map(x=>x.getBoundingClientRect()),f=[...t.ownerSVGElement?.querySelectorAll("g.node")??[]].map(x=>x.getBoundingClientRect()),g=(x,b)=>x.left<b.right+4&&x.right+4>b.left&&x.top<b.bottom+4&&x.bottom+4>b.top,m=r.slice(1).flatMap((x,b)=>{const S=r[b],T=Math.abs(S.y-x.y)<.001,k=Math.hypot(x.x-S.x,x.y-S.y),_=(T?d.width:d.height)+12;return k<_?[]:[.5,.35,.65,.2,.8].flatMap(L=>{if(k*Math.min(L,1-L)<_/2)return[];const v={x:S.x+(x.x-S.x)*L,y:S.y+(x.y-S.y)*L};if(o&&l){const O={x:v.x-l.width/2,y:v.y-l.height/2,width:l.width,height:l.height};if(o.obstacles.some($=>Ai(O,$,4))||o.occupied.some($=>Br($,O,4)))return[]}const M=new DOMPoint(v.x,v.y).matrixTransform(a),B=DOMRect.fromRect({x:M.x-n.width/2,y:M.y-n.height/2,width:n.width,height:n.height}),E=u.filter(O=>g(B,O)).length+f.filter(O=>g(B,O)).length;return[{start:S,end:x,center:v,preferred:b===i,collisions:E,distance:Math.hypot(v.x-c.x,v.y-c.y)}]})}).toSorted((x,b)=>Number(b.preferred)-Number(x.preferred)||x.collisions-b.collisions||x.distance-b.distance)[0];if(!m)return!1;const y=new DOMPoint(m.center.x,m.center.y).matrixTransform(a).matrixTransform(s.inverse());return e.setAttribute("transform",`translate(${y.x-d.x-d.width/2}, ${y.y-d.y-d.height/2})`),e.dataset.routePathId=t.id,e.dataset.finalPathCenter=`${m.center.x},${m.center.y}`,t.dataset.labelSegment=`${m.start.x},${m.start.y} ${m.end.x},${m.end.y}`,!0}function Tp(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const t=[...e.querySelectorAll(".edgePaths path")],r=[...e.querySelectorAll("g.node")].flatMap(o=>{const a=Je(o);return a?[{node:o,bounds:a.getBoundingClientRect()}]:[]}),i=new Map;for(const o of t){const a=vr(o);if(!a||a.source===a.target)continue;const s=[a.source,a.target].toSorted().join("\0");i.set(s,[...i.get(s)??[],o])}for(const o of t){if(o.dataset.feedbackLane||o.dataset.fanoutSource||o.dataset.groupedReturnLane||o.dataset.decisionBranch||o.dataset.decisionReturn||o.dataset.clientRequestLane||o.dataset.clusterHeaderClearance||o.dataset.compactGroupedRoute||o.dataset.decisionCycleRoute||o.dataset.nestedDecisionRoute)continue;const a=vr(o),s=a&&ir(e,a.source),n=a&&ir(e,a.target),l=s&&Je(s),c=n&&Je(n),h=o.getScreenCTM(),d=(o.dataset.manhattanPoints??"").trim().split(/\s+/).map(U=>U.split(",").map(Number)).filter(U=>U.length===2&&U.every(Number.isFinite)).map(([U,j])=>({x:U,y:j}));if(!l||!c||!h)continue;const u=l.getBoundingClientRect(),f=c.getBoundingClientRect(),g={x:u.x+u.width/2,y:u.y+u.height/2},p={x:f.x+f.width/2,y:f.y+f.height/2},m=f.top>=u.bottom||u.top>=f.bottom,y=f.left>=u.right||u.left>=f.right,x=m||!y&&Math.abs(p.y-g.y)>=Math.abs(p.x-g.x),b=p.y>=g.y,S=p.x>=g.x,T=Math.max(u.left,f.left),k=Math.min(u.right,f.right),_=Math.max(u.top,f.top),L=Math.min(u.bottom,f.bottom),v=T<=k?(T+k)/2:g.x,M=T<=k?v:p.x,B=_<=L?(_+L)/2:g.y,E=_<=L?B:p.y,O=x?{x:v,y:b?u.bottom:u.top}:{x:S?u.right:u.left,y:B},$=x?{x:M,y:b?f.top:f.bottom}:{x:S?f.left:f.right,y:E},I=h.inverse(),F=(U,j)=>{const V=new DOMPoint(U,j).matrixTransform(I);return{x:V.x,y:V.y}};let R=F(O.x,O.y),q=F($.x,$.y),D=null;if(a?.source===a?.target){const U=u.right+48;D=[F(u.right,u.top+u.height*.2),F(U,u.top+u.height*.2),F(U,u.top+u.height*.8),F(u.right,u.top+u.height*.8)],o.dataset.selfLoop="right"}else if(!o.dataset.compactFlowchart&&a){const U=[a.source,a.target].toSorted().join("\0"),j=i.get(U)??[],V=j.indexOf(o)-(j.length-1)/2;if(j.length>1){if(V===0&&x){const Q=(g.x+p.x)/2;D=[F(Q,b?u.bottom:u.top),F(Q,b?f.top:f.bottom)]}else if(V===0){const Q=(g.y+p.y)/2;D=[F(S?u.right:u.left,Q),F(S?f.left:f.right,Q)]}else if(x){const Q=24+(Math.ceil(Math.abs(V))-1)*16,rt=V<0,ht=Math.min(g.y,p.y),H=Math.max(g.y,p.y),G=r.filter(({node:vt,bounds:Ot})=>vt!==s&&vt!==n&&Ot.bottom>ht&&Ot.top<H),K=rt?Math.min(u.left,f.left,...G.map(({bounds:vt})=>vt.left))-Q:Math.max(u.right,f.right,...G.map(({bounds:vt})=>vt.right))+Q,tt=rt?u.left:u.right,ot=rt?f.left:f.right;D=[F(tt,g.y),F(K,g.y),F(K,p.y),F(ot,p.y)]}else{const Q=24+(Math.ceil(Math.abs(V))-1)*16,rt=V<0,ht=Math.min(g.x,p.x),H=Math.max(g.x,p.x),G=r.filter(({node:vt,bounds:Ot})=>vt!==s&&vt!==n&&Ot.right>ht&&Ot.left<H),K=rt?Math.min(u.top,f.top,...G.map(({bounds:vt})=>vt.top))-Q:Math.max(u.bottom,f.bottom,...G.map(({bounds:vt})=>vt.bottom))+Q,tt=rt?u.top:u.bottom,ot=rt?f.top:f.bottom;D=[F(g.x,tt),F(g.x,K),F(p.x,K),F(p.x,ot)]}o.dataset.parallelLane=V<0?"before":V>0?"after":"center"}}D&&(R=D[0],q=D[D.length-1]);const P=D??(d.length>=2?d:[R,q]),Y=P.slice(1).some((U,j)=>{const V=P[j];return Math.abs(U.x-V.x)>=.001&&Math.abs(U.y-V.y)>=.001}),X=D??mc(P,R,q,x),z=_r(X);Y&&(o.dataset.cardinalRepaired="true"),o.dataset.manhattanPoints=z.map(({x:U,y:j})=>`${U},${j}`).join(" "),o.setAttribute("d",z.map(({x:U,y:j},V)=>`${V===0?"M":"L"}${U},${j}`).join("")),o.dataset.compactFlowchart||fo($i(e,o),o,z)}}function $n(e,t,r,i){const o=Et(t,.5,.5),a=n=>!r.some(l=>Ai(n,l,4))&&!i.some(l=>Br(l,n,4));return nr(e).flatMap(({start:n,end:l})=>{const c=Math.abs(n.y-l.y)<.001,h=c?"x":"y",d=c?"y":"x",u=(c?t.width:t.height)/2,f=Math.min(n[h],l[h])+u+6,g=Math.max(n[h],l[h])-u-6;return f>g?[]:[o[h],(f+g)/2,f,g,f*.75+g*.25,f*.25+g*.75].flatMap(p=>{const m={[h]:Math.max(f,Math.min(g,p)),[d]:n[d]},y={...t,x:m.x-t.width/2,y:m.y-t.height/2};return a(y)?[{center:m,bounds:y,start:n,end:l,distance:Math.hypot(m.x-o.x,m.y-o.y)}]:[]})}).toSorted((n,l)=>n.distance-l.distance)[0]}function I1(e,t,r,i,o,a=[],s=[],n,l=!1,c=!1){if(e.length<2)return e;const h=v=>nr(v).some(M=>i.some(B=>Br(M,B,8))),d=v=>nr(v).some(M=>o.some(B=>vs(M,B))),u=v=>!n||$n(v,n.bounds,[t,r,...i,...n.obstacles],n.occupied);if(!c&&!h(e)&&!d(e)&&u(e))return e;const f=(v,M,B,E,O=!1)=>{const $=Fa(M,B),I=[{point:M,side:$}];for(const F of O?[]:["top","right","bottom","left"])for(const R of c?[.5,.25,.75,0,1]:[.5,.25,.75]){const q=F==="top"||F==="bottom"?Et(v,R,F==="top"?0:1):Et(v,F==="left"?0:1,R);if(F==="top"||F==="bottom"){const D=Math.min(v.width/2,v.corner?.x??0);q.x=Math.max(v.x+D,Math.min(v.x+v.width-D,q.x))}else{const D=Math.min(v.height/2,v.corner?.y??0);q.y=Math.max(v.y+D,Math.min(v.y+v.height-D,q.y))}E.every(D=>Math.hypot(D.x-q.x,D.y-q.y)>=(c?8:gi))&&I.push({point:q,side:F})}return I.map(F=>{const R={...F.point},q=Math.max(16,(n?.bounds.height??0)/2+(c?4:8)),D=Math.max(16,(n?.bounds.width??0)/2+(c?4:8));return F.side==="top"&&(R.y-=q),F.side==="bottom"&&(R.y+=q),F.side==="left"&&(R.x-=D),F.side==="right"&&(R.x+=D),{...F,lead:R}})},g=f(t,e[0],e[1],a,l),p=f(r,e.at(-1),e.at(-2),s),m=[t,r,...i,...o.map(({start:v,end:M})=>({x:Math.min(v.x,M.x),y:Math.min(v.y,M.y),width:Math.abs(v.x-M.x),height:Math.abs(v.y-M.y)}))],y=Math.max(16,(n?.bounds.width??0)/2+8),x=Math.max(16,(n?.bounds.height??0)/2+8),b=[Math.min(...m.map(v=>v.x))-y,Math.max(...m.map(v=>v.x+v.width))+y],S=[Math.min(...m.map(v=>v.y))-x,Math.max(...m.map(v=>v.y+v.height))+x];if(c){const v=(M,B)=>[...new Set(i.flatMap(E=>[E[M]-16,E[M]+E[B]+16]))].toSorted((E,O)=>Math.abs(E-t[M])-Math.abs(O-t[M])).slice(0,12);b.push(...v("x","width")),S.push(...v("y","height"))}const T=g.flatMap(v=>p.flatMap(M=>[[v.point,v.lead,{x:v.lead.x,y:M.lead.y},M.lead,M.point],[v.point,v.lead,{x:M.lead.x,y:v.lead.y},M.lead,M.point],...b.map(B=>[v.point,v.lead,{x:B,y:v.lead.y},{x:B,y:M.lead.y},M.lead,M.point]),...S.map(B=>[v.point,v.lead,{x:v.lead.x,y:B},{x:M.lead.x,y:B},M.lead,M.point])].map(_r))),k=v=>nr(v).reduce((M,B)=>M+Math.hypot(B.end.x-B.start.x,B.end.y-B.start.y),0);let _,L=1/0;for(const{candidate:v,length:M}of T.map(B=>({candidate:B,length:k(B)})).toSorted((B,E)=>B.length-E.length)){if(c&&(M>=k(e)-1||v.some(E=>E.y<Math.min(t.y,r.y)-x))||h(v)||!u(v)||nr(v).some(E=>Br(E,t)||Br(E,r)))continue;const B=nr(v).reduce((E,O)=>E+o.reduce(($,I)=>{const F={x:Math.min(I.start.x,I.end.x),y:Math.min(I.start.y,I.end.y),width:Math.abs(I.end.x-I.start.x),height:Math.abs(I.end.y-I.start.y)};return $+(vs(O,I)?100:Br(O,F,6)?1:0)},0),0);if(B<L&&(!c||B===0)&&(_=v,L=B),L===0)break}return _??e}function Pu(e){return[...e.querySelectorAll(".edgePaths path")].flatMap(t=>{const r=vr(t),i=(t.dataset.manhattanPoints??"").trim().split(/\s+/).map(o=>{const[a,s]=o.split(",").map(Number);return{x:a,y:s}});return r&&i.length>=2&&i.every(o=>Number.isFinite(o.x)&&Number.isFinite(o.y))?[{path:t,...r,points:i,label:$i(e,t)}]:[]})}function J3(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const t=Pu(e),r=t[0]?.path;if(!r)return;const i=new Map([...e.querySelectorAll("g.node")].flatMap(l=>{const c=Je(l),h=c&&rr(c,r);if(!c||!h)return[];const d=getComputedStyle(c),u=c.getBBox(),f=(p,m)=>(Number.parseFloat(p)||0)*(p.endsWith("%")?m/100:1),g={x:f(d.rx,u.width)*h.width/u.width,y:f(d.ry,u.height)*h.height/u.height};return[[zr(l),{bounds:{...h,corner:g},shape:c}]]})),o=new Map(t.flatMap(l=>{const c=l.label?.textContent?.trim()&&kr(l.label,r);return c?[[l,c]]:[]})),a=[...e.querySelectorAll("g.cluster > .cluster-label")].flatMap(l=>{const c=kr(l,r);return c?[c]:[]}),s=new Map,n=t.map(l=>{const c=i.get(l.source),h=i.get(l.target),d=!!(l.source===l.target||l.path.dataset.fanoutSource||l.path.dataset.feedbackLane||l.path.dataset.groupedReturnLane||l.path.dataset.decisionCycleRoute||l.path.dataset.nestedDecisionRoute||c?.shape.tagName.toLowerCase()!=="rect"||h?.shape.tagName.toLowerCase()!=="rect");return{route:l,source:c,target:h,fixed:d}}).sort((l,c)=>Number(c.fixed)-Number(l.fixed));for(const{route:l,source:c,target:h,fixed:d}of n){const u=t.filter(T=>T!==l),f=T=>u.flatMap(k=>[...k.source===T?[k.points[0]]:[],...k.target===T?[k.points.at(-1)]:[]]),g=u.filter(T=>T.source!==l.source||T.target===l.target).flatMap(T=>nr(T.points)),p=[...i].filter(([T])=>T!==l.source&&T!==l.target).map(([,T])=>T.bounds).concat(a,[...o].filter(([T])=>T!==l).map(([,T])=>T)),m=o.get(l),y=(T,k=!1)=>!d&&c&&h?I1(T,c.bounds,h.bounds,p,g,f(l.source),f(l.target),m?{bounds:m,obstacles:[...o].filter(([_])=>_!==l).map(([,_])=>_),occupied:u.flatMap(_=>nr(_.points))}:void 0,!!l.path.dataset.fanoutPort&&u.some(_=>_.source===l.source&&_.target!==l.target),k):T,x=e$(e,l.path,c?.bounds,h?.bounds),b=x?[Et(c.bounds,1,.5),{x:x.x,y:c.bounds.y+c.bounds.height/2},{x:x.x,y:h.bounds.y+h.bounds.height/2},Et(h.bounds,1,.5)]:l.points;let S=y(b);if(!d&&!x&&S.length>4&&(S=y(S,!0)),!d&&!x&&!e.querySelector("g.cluster")&&(S=t$(S,u.filter(T=>T.path.dataset.feedbackLane).flatMap(T=>nr(T.points)),p)),!d&&c&&h&&h.bounds.y>c.bounds.y&&u.some(T=>T.path.dataset.feedbackLane&&T.target===l.source&&nr(S).some(k=>nr(T.points).some(({start:_,end:L})=>Br(k,{x:Math.min(_.x,L.x),y:Math.min(_.y,L.y),width:Math.abs(L.x-_.x),height:Math.abs(L.y-_.y)}))))&&(S=y(S,!0)),m){const T=$n(S,m,[...[c,h].flatMap(k=>k?[k.bounds]:[]),...p],u.flatMap(k=>nr(k.points)));T&&(o.set(l,T.bounds),s.set(l.path.id,T.center))}S!==l.points&&(l.points=S,l.path.dataset.manhattanPoints=S.map(({x:T,y:k})=>`${T},${k}`).join(" "),l.path.setAttribute("d",S.map(({x:T,y:k},_)=>`${_?"L":"M"}${T},${k}`).join("")))}for(const l of t.filter(c=>c.path.dataset.feedbackLane==="outer")){const h=t.filter(u=>u!==l).flatMap(u=>nr(u.points).map(({start:f,end:g})=>({x:Math.min(f.x,g.x),y:Math.min(f.y,g.y),width:Math.abs(g.x-f.x),height:Math.abs(g.y-f.y)})));h.push(...[...o].filter(([u])=>u!==l).map(([,u])=>u));const d=D3(l.points,h);d!==l.points&&(l.path.dataset.manhattanPoints=d.map(({x:u,y:f})=>`${u},${f}`).join(" "),l.path.setAttribute("d",d.map(({x:u,y:f},g)=>`${g?"L":"M"}${u},${f}`).join("")),s.delete(l.path.id))}return s}function t$(e,t,r){for(let i=1;i<e.length-2;i++){const o=e[i],a=e[i+1];if(Math.abs(o.x-a.x)>.001||Math.abs(o.y-a.y)<32)continue;const s=t.filter(l=>Math.abs(l.start.x-l.end.x)<.001&&Math.abs(l.start.x-o.x)<20&&Math.abs(l.start.x-o.x)>.001&&Math.min(Math.max(o.y,a.y),Math.max(l.start.y,l.end.y))-Math.max(Math.min(o.y,a.y),Math.min(l.start.y,l.end.y))>20);if(!s.length)continue;const n=s.flatMap(l=>[l.start.x-20,l.start.x+20]).filter(l=>Math.abs(l-o.x)<=20).toSorted((l,c)=>Math.abs(l-o.x)-Math.abs(c-o.x));for(const l of n){const c=e.map((d,u)=>u===i||u===i+1?{...d,x:l}:d),h=nr(c).slice(i-1,i+2);if(!(s.some(d=>Math.abs(d.start.x-l)<19.99)||h.some(d=>r.some(u=>Br(d,u,4)))))return c}}return e}function e$(e,t,r,i){if(!r||!i||t.dataset.nestedDecisionRoute)return null;const o=(l,c)=>c.x>=l.x-.5&&c.x+c.width<=l.x+l.width+.5&&c.y>=l.y-.5&&c.y+c.height<=l.y+l.height+.5,a=[...e.querySelectorAll("g.cluster > rect")].flatMap(l=>{const c=rr(l,t);return c?[c]:[]}),s=a.filter(l=>o(l,i)&&!o(l,r)).toSorted((l,c)=>l.width*l.height-c.width*c.height)[0],n=s&&a.filter(l=>l!==s&&o(l,s)&&o(l,r)).toSorted((l,c)=>l.width*l.height-c.width*c.height)[0];return!s||!n||r.y+r.height>s.y?null:{x:(s.x+s.width+n.x+n.width)/2}}function r$(e,t){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const r=Pu(e),i=r[0]?.path;if(!i)return;const o=[...e.querySelectorAll("g.node, g.cluster > .cluster-label")].flatMap(s=>{const n=kr(s,i);return n?[n]:[]}),a=r.flatMap(s=>{const n=s.label;if(!n?.textContent?.trim())return[];const l=kr(n,i),c=t?.get(s.path.id);l&&c&&(l.x=c.x-l.width/2,l.y=c.y-l.height/2);const h=i.getScreenCTM(),d=n.parentElement?.getScreenCTM(),u=n.getBBox();return l&&h&&d?[{route:s,label:n,current:l,matrix:h,inverse:d.inverse(),local:u}]:[]});for(const s of a){const{route:n,label:l,current:c,matrix:h,inverse:d,local:u}=s,f=r.filter(m=>m!==n).flatMap(m=>nr(m.points)),g=$n(n.points,c,[...o,...a.filter(m=>m!==s).map(m=>m.current)],f);if(!g)continue;const p=new DOMPoint(g.center.x,g.center.y).matrixTransform(h).matrixTransform(d);l.setAttribute("transform",`translate(${p.x-u.x-u.width/2},${p.y-u.y-u.height/2})`),l.dataset.labelSegmentStart=`${g.start.x},${g.start.y}`,l.dataset.labelSegmentEnd=`${g.end.x},${g.end.y}`,s.current=g.bounds}}function i$(e,t,r,i,o=[],a=[],s=[],n=8){if({top:"bottom",right:"left",bottom:"top",left:"right"}[t.side]!==r.side)return e;const c=t.side==="left"||t.side==="right",h=c?"y":"x",d=c?"x":"y",u=t.side==="right"||t.side==="bottom"?1:-1;if((r.point[d]-t.point[d])*u<=0)return e;const f=t.range??[t.point[h],t.point[h]],g=r.range??[r.point[h],r.point[h]],p=Math.max(f[0],g[0]),m=Math.min(f[1],g[1]);if(p>m)return e;const y=b=>Math.max(p,Math.min(m,b)),x=[...new Set([y(t.point[h]),y(r.point[h]),p,m,(p+m)/2,...[...a,...s].flatMap(b=>[b[h]-gi,b[h]+gi]),...i.flatMap(b=>[b[h]-n,b[h]+(c?b.height:b.width)+n]),...o.flatMap(b=>[Math.min(b.start[h],b.end[h])-n,Math.max(b.start[h],b.end[h])+n])])].filter(b=>b>=p&&b<=m).toSorted((b,S)=>Math.abs(b-t.point[h])+Math.abs(b-r.point[h])-Math.abs(S-t.point[h])-Math.abs(S-r.point[h]));for(const b of x){const S={...t.point,[h]:b},T={...r.point,[h]:b};if(a.some(_=>Math.hypot(S.x-_.x,S.y-_.y)<gi-.001)||s.some(_=>Math.hypot(T.x-_.x,T.y-_.y)<gi-.001))continue;const k={start:S,end:T};if(!i.some(_=>Br(k,_,n))&&!o.some(_=>Br(k,{x:Math.min(_.start.x,_.end.x),y:Math.min(_.start.y,_.end.y),width:Math.abs(_.start.x-_.end.x),height:Math.abs(_.start.y-_.end.y)},n)))return[S,T]}return e}function Fa(e,t){const r=t.x-e.x,i=t.y-e.y;return Math.abs(r)>=Math.abs(i)?r>=0?"right":"left":i>=0?"bottom":"top"}function o$(e,t,r,i,o){const a=s=>nr(s).reduce((n,{start:l,end:c})=>n+Math.hypot(c.x-l.x,c.y-l.y),0);return t.map(_r).filter(s=>s.length<=e.length&&a(s)<a(e)-1).filter(s=>nr(s).every(n=>!r.some(l=>Br(n,l,8))&&!i.some(({start:l,end:c})=>Br(n,{x:Math.min(l.x,c.x),y:Math.min(l.y,c.y),width:Math.abs(c.x-l.x),height:Math.abs(c.y-l.y)},8)))).filter(s=>!o||$n(s,o.bounds,[...r,...o.obstacles],i)).sort((s,n)=>a(s)-a(n))[0]??e}function a$(e,t){const r=t.map(i=>({...i,points:(i.path.dataset.manhattanPoints??"").split(" ").map(o=>{const[a,s]=o.split(",").map(Number);return{x:a,y:s}})})).filter(({points:i})=>i.length>=2&&i.every(({x:o,y:a})=>Number.isFinite(o)&&Number.isFinite(a)));for(const i of r){if(i.source===i.target||i.points.length===2)continue;const{path:o,points:a}=i,s=y=>{const x=ir(e,i[y]),b=x&&Je(x),S=b&&rr(b,o);if(!b||!S)return;const T=y==="source"?a[0]:a[a.length-1],k=y==="source"?a[1]:a[a.length-2],_=Fa(T,k),L=_==="left"||_==="right",v=Math.max(8,Number(b.getAttribute(L?"ry":"rx"))||0),M=b.tagName.toLowerCase()==="rect"?L?[S.y+v,S.y+S.height-v]:[S.x+v,S.x+S.width-v]:void 0;return{point:T,side:_,range:M}},n=s("source"),l=s("target");if(!n||!l)continue;const c=r.filter(y=>y!==i),h=y=>c.flatMap(x=>[...x.source===y?[x.points[0]]:[],...x.target===y?[x.points[x.points.length-1]]:[]]),d=(y,x)=>x.x>=y.x&&x.x<=y.x+y.width&&x.y>=y.y&&x.y<=y.y+y.height,u=[...[...e.querySelectorAll("g.node")].filter(y=>![i.source,i.target].includes(zr(y))),...e.querySelectorAll("g.cluster > .cluster-label"),...[...e.querySelectorAll(".edgeLabels > .edgeLabel")].filter(y=>y!==i.label&&y.textContent?.trim())].map(y=>kr(y,o)).filter(y=>!!y);for(const y of e.querySelectorAll("g.cluster > rect")){const x=rr(y,o);x&&!d(x,n.point)&&!d(x,l.point)&&u.push(x)}const f=c.flatMap(y=>nr(y.points));let g=i$(a,n,l,u,f,h(i.source),h(i.target));if(g===a&&o.dataset.nestedDecisionRoute==="secondary-retry"){const y=ir(e,i.source),x=ir(e,i.target),b=y&&Je(y),S=x&&Je(x),T=b&&rr(b,o),k=S&&rr(S,o);if(b?.tagName.toLowerCase()==="rect"&&S&&aa(S)&&T&&k){const _=Et(T,.5,0),L=[];if(l.side==="bottom"&&_.y>k.y+k.height+8&&_.x>l.point.x){const O=(_.y+k.y+k.height)/2;L.push([_,{x:_.x,y:O},{x:l.point.x,y:O},l.point])}const v=Qr(k,"left",24);_.x<v.x&&_.y>v.y&&L.push([_,{x:_.x,y:v.y},v]);const M=Qr(k,"right",k.height*.32);_.x>M.x&&_.y>M.y&&L.push([_,{x:_.x,y:M.y},M]);const B=L.filter(O=>!h(i.source).some($=>Math.hypot($.x-_.x,$.y-_.y)<gi)&&!h(i.target).some($=>Math.hypot($.x-O.at(-1).x,$.y-O.at(-1).y)<gi)),E=i.label&&kr(i.label,o);g=o$(a,B,u,f,E?{bounds:E,obstacles:[T,k]}:void 0)}}if(g===a||!fo(i.label,o,g,void 0,{obstacles:u,occupied:f}))continue;i.points=g,o.dataset.manhattanPoints=g.map(({x:y,y:x})=>`${y},${x}`).join(" "),o.dataset.manhattanSegments=String(g.length-1);const p=g.at(-1),m=g.at(-2);o.dataset.terminalDirection=`${p.x-m.x},${p.y-m.y}`,o.dataset.nestedDecisionRoute==="secondary-retry"&&(o.dataset.diamondTargetSide=Fa(p,m)),o.setAttribute("d",g.map(({x:y,y:x},b)=>`${b?"L":"M"}${y},${x}`).join(""))}}function O1(e,t,r){const i=e.map(o=>({...o}));if(t){const o=i[1],a=i[0];i[0]=t.point;const s=t.side==="top"||t.side==="bottom";if(i.length>2&&(s&&Math.abs(a.x-o.x)<.001?o.x=t.point.x:!s&&Math.abs(a.y-o.y)<.001&&(o.y=t.point.y)),!(s?Math.abs(o.x-t.point.x)<.001:Math.abs(o.y-t.point.y)<.001))if(t.lead){const l=s?{x:o.x,y:t.lead.y}:{x:t.lead.x,y:o.y};i.splice(1,0,t.lead,l)}else{const l=s?{x:t.point.x,y:o.y}:{x:o.x,y:t.point.y};i.splice(1,0,l)}}if(r){const o=i[i.length-2],a=i[i.length-1];i[i.length-1]=r.point;const s=r.side==="top"||r.side==="bottom";if(i.length>2&&(s&&Math.abs(a.x-o.x)<.001?o.x=r.point.x:!s&&Math.abs(a.y-o.y)<.001&&(o.y=r.point.y)),!(s?Math.abs(o.x-r.point.x)<.001:Math.abs(o.y-r.point.y)<.001))if(r.lead){const l=s?{x:o.x,y:r.lead.y}:{x:r.lead.x,y:o.y};i.splice(i.length-1,0,l,r.lead)}else{const l=s?{x:r.point.x,y:o.y}:{x:o.x,y:r.point.y};i.splice(i.length-1,0,l)}}return _r(i)}function Qr(e,t,r=0){const i=Et(e,.5,.5),o=e.width/2,a=e.height/2;if(t==="top"||t==="bottom"){const l=Math.max(-o*.7,Math.min(o*.7,r)),c=a*(1-Math.abs(l)/o);return{x:i.x+l,y:i.y+(t==="top"?-c:c)}}const s=Math.max(-a*.7,Math.min(a*.7,r)),n=o*(1-Math.abs(s)/a);return{x:i.x+(t==="left"?-n:n),y:i.y+s}}function s$(e,t,r=0){const i=Qr(e,t,r),o={...i};return t==="top"?o.y-=12:t==="right"?o.x+=12:t==="bottom"?o.y+=12:o.x-=12,{point:i,side:t,lead:o}}function n$(e,t){const r=new Map(t.map(s=>[s,vr(s)])),i=[];for(const s of t){const n=r.get(s),l=(s.dataset.manhattanPoints??"").trim().split(/\s+/).map(f=>f.split(",").map(Number)).filter(f=>f.length===2&&f.every(Number.isFinite)).map(([f,g])=>({x:f,y:g}));if(!n||l.length<2)continue;const c=ir(e,n.source),h=c&&Je(c);if(h&&aa(h)){const f=rr(h,s);if(f){const g=Fa(Et(f,.5,.5),l[1]);i.push({path:s,role:"source",nodeId:n.source,bounds:f,side:g,adjacent:l[1]})}}const d=ir(e,n.target),u=d&&Je(d);if(u&&aa(u)){const f=rr(u,s);if(f){const g=t.some(m=>{const y=r.get(m);return m!==s&&y?.source===n.target&&y.target===n.source}),p=s.dataset.decisionReturn&&s.dataset.compactFlowchart==="true"?"left":s.dataset.decisionReturn||g?"bottom":Fa(Et(f,.5,.5),l[l.length-2]);i.push({path:s,role:"target",nodeId:n.target,bounds:f,side:p,adjacent:l[l.length-2]})}}}const o=new Map;for(const s of i){const n=`${s.nodeId}\0${s.side}`;o.set(n,[...o.get(n)??[],s])}const a=new Map;for(const s of o.values()){const n=s[0].side,l=n==="top"||n==="bottom",c=s.toSorted((u,f)=>(l?u.adjacent.x-f.adjacent.x:u.adjacent.y-f.adjacent.y)||u.path.id.localeCompare(f.path.id)||u.role.localeCompare(f.role)),h=(l?s[0].bounds.width:s[0].bounds.height)*.5,d=Math.min(gi,h/Math.max(1,s.length-1));c.forEach((u,f)=>{const g=s.length===1?0:(f-(s.length-1)/2)*d,p=a.get(u.path)??{};p[u.role]=s$(u.bounds,n,g),a.set(u.path,p)})}return a}function l$(e){const t=new Map;for(const i of e.querySelectorAll(".edgePaths path")){if(i.dataset.feedbackLane||i.dataset.groupedReturnLane||i.dataset.clientRequestLane||i.dataset.compactGroupedRoute||i.dataset.decisionCycleRoute||i.dataset.nestedDecisionRoute)continue;const o=vr(i),a=(i.dataset.manhattanPoints??"").trim().split(/\s+/).map(s=>s.split(",").map(Number)).filter(s=>s.length===2&&s.every(Number.isFinite)).map(([s,n])=>({x:s,y:n}));if(!(!o||a.length<2))for(const s of["source","target"]){if(s==="source"&&i.dataset.fanoutSource)continue;const n=o[s],l=ir(e,n),c=l&&Je(l),h=c&&rr(c,i);if(!c||!h||aa(c))continue;const d=s==="source"?a[0]:a[a.length-1],f=[["top",Math.abs(d.y-h.y)],["right",Math.abs(d.x-h.x-h.width)],["bottom",Math.abs(d.y-h.y-h.height)],["left",Math.abs(d.x-h.x)]].toSorted((p,m)=>p[1]-m[1])[0][0],g=`${n}\0${f}`;t.set(g,[...t.get(g)??[],{path:i,role:s,side:f,bounds:h,endpoint:d}])}}const r=new Map;for(const i of t.values()){if(i.length<2)continue;const o=i[0].side,a=o==="top"||o==="bottom",s=i.toSorted((c,h)=>(a?c.endpoint.x-h.endpoint.x:c.endpoint.y-h.endpoint.y)||c.path.id.localeCompare(h.path.id)||c.role.localeCompare(h.role)),n=(a?i[0].bounds.width:i[0].bounds.height)*.6,l=Math.min(gi,n/Math.max(1,i.length-1));s.forEach((c,h)=>{const d=(h-(i.length-1)/2)*l,u=Yi(c.bounds,o),f=a?{x:u.x+d,y:u.y}:{x:u.x,y:u.y+d},g=r.get(c.path)??{};g[c.role]={point:f,side:o},r.set(c.path,g)})}for(const[i,o]of r){const a=(i.dataset.manhattanPoints??"").trim().split(/\s+/).map(n=>n.split(",").map(Number)).filter(n=>n.length===2&&n.every(Number.isFinite)).map(([n,l])=>({x:n,y:l}));if(a.length<2)continue;const s=O1(a,o.source,o.target);i.dataset.manhattanPoints=s.map(({x:n,y:l})=>`${n},${l}`).join(" "),o.source&&(i.dataset.crowdedSourcePort=`${o.source.point.x},${o.source.point.y}`),o.target&&(i.dataset.crowdedTargetPort=`${o.target.point.x},${o.target.point.y}`),i.setAttribute("d",s.map(({x:n,y:l},c)=>`${c===0?"M":"L"}${n},${l}`).join(""))}}function c$(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;l$(e);const t=[...e.querySelectorAll(".edgePaths path")],r=n$(e,t);for(const i of t){if(i.dataset.nestedDecisionRoute||i.dataset.decisionCycleRoute)continue;const o=vr(i),a=o&&ir(e,o.source),s=o&&ir(e,o.target),n=a&&Je(a),l=s&&Je(s),c=(i.dataset.manhattanPoints??"").trim().split(/\s+/).map(m=>m.split(",").map(Number)).filter(m=>m.length===2&&m.every(Number.isFinite)).map(([m,y])=>({x:m,y}));if(c.length<2)continue;let h,d;const u=$i(e,i)?.textContent?.trim().toLocaleLowerCase();if(n&&aa(n)){const m=rr(n,i),y=r.get(i)?.source;if(m&&y){const x=Et(m,.5,.5),b=Fa(x,c[1]),{side:S}=y;if(u==="no"&&b!==S&&c.length>2){const k=c.slice(1).map((_,L)=>({index:L,length:Math.abs(c[L].y-_.y)<.001?Math.abs(c[L].x-_.x):0})).toSorted((_,L)=>L.length-_.length)[0];if(k?.length){const _=(c[k.index].y>=x.y?1:-1)*gi;c[k.index].y+=_,c[k.index+1].y+=_,i.dataset.decisionLane=String(c[k.index].y)}}const{point:T}=y;h=y,i.dataset.diamondSourcePort=`${T.x},${T.y}`,i.dataset.diamondSourceSide=S,i.dataset.decisionBranch&&(i.dataset.decisionPort=`${T.x},${T.y}`)}}if(l&&aa(l)){const m=r.get(i)?.target;if(m){const{side:y}=m,{point:x}=m;d=m,s&&(i.dataset.diamondTargetPort=`${x.x},${x.y}`,i.dataset.diamondTargetSide=y,i.dataset.terminalTarget=s.id)}}const f=O1(c,h,d),g=f[f.length-2],p=f[f.length-1];d&&(i.dataset.terminalDirection=`${p.x-g.x},${p.y-g.y}`),i.dataset.manhattanPoints=f.map(({x:m,y})=>`${m},${y}`).join(" "),i.dataset.manhattanSegments=String(f.length-1),i.setAttribute("d",f.map(({x:m,y},x)=>`${x===0?"M":"L"}${m},${y}`).join("")),i.dataset.compactFlowchart||fo($i(e,i),i,f)}}function h$(e,t,r,i){const a=Yi(e,"right");if(t.length!==2||[e,...t.map(({bounds:d})=>d),...r,...i].some(d=>!Object.values(d).every(Number.isFinite)||d.width<0||d.height<0)||t.some(({bounds:d,port:u})=>!Number.isFinite(u.x)||!Number.isFinite(u.y)||d.y<e.y+e.height+32||!(Math.abs(u.x-d.x)<.001&&Math.abs(u.y-d.y-d.height/2)<.001)&&(u.x<=a.x+16||Math.abs(u.y-d.y)>.001||u.x<d.x+8||u.x>d.x+d.width-8)))return null;const s={x:a.x+16,y:a.y},n=[];for(const{bounds:d,port:u,tail:f}of t){const m=(Math.abs(u.x-d.x)<.001?[[a,s,{x:s.x,y:e.y+e.height+16},{x:d.x-16,y:e.y+e.height+16},{x:d.x-16,y:u.y},u]]:[...f?.length===2&&Math.abs(f[0].x-u.x)<.001&&f[0].y>=e.y+e.height+8&&f[0].y<=d.y-16?[[a,s,{x:s.x,y:f[0].y},f[0],u]]:[],[a,s,{x:s.x,y:d.y-32},{x:u.x,y:d.y-32},u]]).map(_r).find(y=>nr(y).every((x,b)=>Math.abs(x.start.x-x.end.x)>=.001&&Math.abs(x.start.y-x.end.y)>=.001?!1:![...r,...i].some(S=>Br(x,S,8))&&!Br(x,e,b===0?0:8)&&!t.some(({bounds:S})=>Br(x,S,S===d&&b===y.length-2?0:8))));if(!m)return null;n.push(m)}const[l,c]=n.map(nr);let h=0;for(;h<Math.min(l.length,c.length);){const d=l[h],u=c[h];if(Math.hypot(d.start.x-u.start.x,d.start.y-u.start.y)>.001)break;if(Math.hypot(d.end.x-u.end.x,d.end.y-u.end.y)>.001){vs(d,u)&&((Math.hypot(d.end.x-d.start.x,d.end.y-d.start.y)<Math.hypot(u.end.x-u.start.x,u.end.y-u.start.y)?d:u)===d?c[h]={start:d.end,end:u.end}:l[h]={start:u.end,end:d.end});break}h++}for(const d of l.slice(h))for(const u of c.slice(h)){if(vs(d,u))return null;const f=Math.abs(d.start.y-d.end.y)<.001,g=Math.abs(u.start.y-u.end.y)<.001;if(f===g)continue;const p=f?d:u,m=f?u:d;if(m.start.x>Math.min(p.start.x,p.end.x)+.001&&m.start.x<Math.max(p.start.x,p.end.x)-.001&&p.start.y>Math.min(m.start.y,m.end.y)+.001&&p.start.y<Math.max(m.start.y,m.end.y)-.001)return null}return n}function d$(e,t,r){if(r.length!==2||e.querySelector("g.cluster")||r.some(({path:y})=>y.dataset.compactFlowchart||y.dataset.feedbackLane))return;const i=r[0].path,o=i.getScreenCTM();if(!o||o.a<=0||o.d<=0||Math.abs(o.b)>.001||Math.abs(o.c)>.001)return;const a=o.inverse(),s=[...e.querySelectorAll("g.node")].map(y=>{const x=Je(y);return{id:zr(y),shape:x,bounds:x&&rr(x,i)}});if(s.some(({bounds:y})=>!y)||new Set(s.map(({id:y})=>y)).size!==s.length)return;const n=s.find(({id:y})=>y===t);if(!n?.bounds||n.shape?.tagName.toLowerCase()!=="rect")return;const c=[...e.querySelectorAll(".edgePaths path")].filter(y=>!r.some(x=>x.path===y)).map(y=>{const x=y.getScreenCTM(),b=y.getTotalLength();if(!x||!b||!Number.isFinite(b)||b>16384)return null;const S=Math.ceil(b/2);return{path:y,points:Array.from({length:S+1},(T,k)=>y.getPointAtLength(b*k/S).matrixTransform(x).matrixTransform(a))}});if(c.some(y=>!y))return;const h=c.flatMap(y=>nr(y.points).map(({start:x,end:b})=>({x:Math.min(x.x,b.x),y:Math.min(x.y,b.y),width:Math.abs(b.x-x.x),height:Math.abs(b.y-x.y)}))),d=r.map(({path:y,target:x})=>{const b=s.find(({id:B})=>B===x),S=y.getScreenCTM();if(!b?.bounds||b.shape?.tagName.toLowerCase()!=="rect"||!S||["a","b","c","d","e","f"].some(B=>Math.abs(S[B]-o[B])>.001))return null;const T=b.bounds,k=c.filter(B=>vr(B.path)?.target===x);if(k.length>1||k.length&&T.width*.6<gi||k.some(B=>{const E=B.points.at(-1);return Math.abs(E.y-T.y)>8||E.x<T.x+T.width/2}))return null;const _=T.x<=n.bounds.x+n.bounds.width+16?Yi(T,"left"):{x:T.x+T.width/2-(k.length?gi/2:0),y:T.y},L=y.dataset.manhattanPoints?.split(" ").map((B,E)=>`${E?"L":"M"}${B}`).join(""),M=$u(L??y.getAttribute("d")??"")?.slice(-2);return{bounds:T,port:_,tail:M&&Math.abs(M[0].x-_.x)<.001&&Math.abs(M[1].y-_.y)<.001?[M[0],_]:void 0}});if(d.some(y=>!y))return;const u=r.map(({path:y})=>$i(e,y)),f=[...e.querySelectorAll(".edgeLabels > .edgeLabel")].filter(y=>y.textContent?.trim()&&!u.includes(y)).map(y=>kr(y,i));if(f.some(y=>!y))return;const g=[...s.filter(y=>y!==n&&!d.some(x=>x.bounds===y.bounds)).map(y=>y.bounds),...f],p=h$(n.bounds,d,g,h);if(!p)return;const m=[];for(const[y,x]of u.entries()){if(!x?.textContent?.trim())continue;const b=kr(x,i),S=x.parentElement?.getScreenCTM();if(!b||!S)return;const T=nr(p[y]).find(v=>{const M={x:(v.start.x+v.end.x)/2,y:(v.start.y+v.end.y)/2},B={x:M.x-b.width/2,y:M.y-b.height/2,width:b.width,height:b.height},E=Math.abs(v.start.y-v.end.y)<.001;return Math.hypot(v.end.x-v.start.x,v.end.y-v.start.y)>=(E?b.width:b.height)+16&&![...s.map(O=>O.bounds),...f,...h,...m.map(O=>O.bounds)].some(O=>Ai(B,O,8))&&!p.filter((O,$)=>$!==y).some(O=>nr(O).some($=>Br($,B,8)))});if(!T)return;const k={x:(T.start.x+T.end.x)/2,y:(T.start.y+T.end.y)/2},_=x.getBBox(),L=new DOMPoint(k.x,k.y).matrixTransform(o).matrixTransform(S.inverse());m.push({label:x,center:k,segment:T,bounds:{x:k.x-b.width/2,y:k.y-b.height/2,width:b.width,height:b.height},transform:`translate(${L.x-_.x-_.width/2}, ${L.y-_.y-_.height/2})`})}p.forEach((y,x)=>{const{path:b,target:S}=r[x];b.setAttribute("d",y.map(({x:T,y:k},_)=>`${_?"L":"M"}${T},${k}`).join("")),delete b.dataset.terminalGapBasePath,b.dataset.fanoutSource=t,b.dataset.fanoutTarget=S,b.dataset.fanoutTrunk=y.slice(0,2).map(({x:T,y:k})=>`${T},${k}`).join(" "),b.dataset.manhattanPoints=y.map(({x:T,y:k})=>`${T},${k}`).join(" ")}),m.forEach(({label:y,transform:x,center:b,segment:S})=>{y.setAttribute("transform",x);const T=r[u.indexOf(y)].path;y.dataset.routePathId=T.id,y.dataset.finalPathCenter=`${b.x},${b.y}`,T.dataset.labelSegment=`${S.start.x},${S.start.y} ${S.end.x},${S.end.y}`})}function Bp(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const t=[...e.querySelectorAll(".edgePaths path")].flatMap(i=>{const o=vr(i);return o?[{path:i,...o}]:[]}),r=new Map;for(const i of t)r.set(i.source,[...r.get(i.source)??[],i]);for(const[i,o]of r){if(o.length<2)continue;const a=ir(e,i);if(!a||a.querySelector(":scope > polygon.label-container"))continue;const s=o.flatMap(f=>{const g=Sr(a),p=ir(e,f.target),m=p&&Sr(p);return g&&m?[{...f,targetId:f.target,source:g,target:m}]:[]});if(s.length!==o.length||new Set(s.map(({targetId:f})=>f)).size!==s.length)continue;const n=s[0].source.x+s[0].source.width,l=s[0].source.y+s[0].source.height;if(s.length===3&&s.every(f=>f.target.y>=l+16)&&Math.max(...s.map(f=>f.target.y))-Math.min(...s.map(f=>f.target.y))<=8){const f=s.toSorted((y,x)=>y.target.x+y.target.width/2-(x.target.x+x.target.width/2)),g=f[0].source,p=g.y+g.height/2,m=[{x:g.x,y:p},{x:g.x+g.width/2,y:l},{x:n,y:p}];f.forEach((y,x)=>{const b=m[x],S=x===0?{x:b.x-16,y:b.y}:x===1?{x:b.x,y:b.y+16}:{x:b.x+16,y:b.y},T=y.target.x+y.target.width/2,k=y.target.y,_=k-16,L=[S,{x:S.x,y:_},{x:T,y:_}];L.unshift(b),L.push({x:T,y:k}),y.path.setAttribute("d",L.map((v,M)=>`${M?"L":"M"}${v.x},${v.y}`).join("")),y.path.dataset.fanoutSource=i,y.path.dataset.fanoutTarget=y.targetId,y.path.dataset.fanoutPort=`${b.x},${b.y}`,y.path.dataset.fanoutTrunk=`${b.x},${b.y} ${S.x},${S.y}`,y.path.dataset.manhattanPoints=L.map(v=>`${v.x},${v.y}`).join(" "),fo($i(e,y.path),y.path,L)});continue}if(s.some(f=>f.target.x<=n+16)){d$(e,i,o);continue}const h=Math.min(...s.map(f=>f.target.x)),d=n+Math.min(36,Math.max(16,(h-n)/2)),u=s[0].source.y+s[0].source.height/2;for(const f of s){const g=f.target.y+f.target.height/2,p=[{x:n,y:u},{x:d,y:u},{x:d,y:g},{x:f.target.x,y:g}];f.path.setAttribute("d",p.map((m,y)=>`${y?"L":"M"}${m.x},${m.y}`).join("")),f.path.dataset.fanoutSource=i,f.path.dataset.fanoutTarget=f.targetId,f.path.dataset.fanoutTrunk=`${n},${u} ${d},${u}`,f.path.dataset.manhattanPoints=p.map(m=>`${m.x},${m.y}`).join(" ")}}}function u$(e,t,r,i){if(!e.textContent?.trim())return;const o=e.getAttribute("transform");e.removeAttribute("transform");const a=e.getBBox();o&&e.setAttribute("transform",o);const s=t.getCTM(),n=e.parentElement?.getCTM();if(!s||!n)return;const l={x:r.x+(i.x-r.x)*.55,y:r.y+(i.y-r.y)*.55},c=new DOMPoint(l.x,l.y).matrixTransform(s).matrixTransform(n.inverse());e.setAttribute("transform",`translate(${c.x-a.x-a.width/2}, ${c.y-a.y-a.height/2})`),e.dataset.finalPathCenter=`${l.x},${l.y}`,e.dataset.routePathId=t.id,t.dataset.labelSegment=`${r.x},${r.y} ${i.x},${i.y}`}function D1(e,t,r){const i=Je(e),o=i&&rr(i,r),a=e.transform.baseVal.consolidate()?.matrix;!o||!a||(e.style.setProperty("transition-property","none","important"),e.setAttribute("transform",`translate(${a.e+t.x-o.x-o.width/2}, ${a.f+t.y-o.y-o.height/2})`))}function f$(e,t){const r=new Map;for(const i of e.toSorted((o,a)=>o.frame.width*o.frame.height-a.frame.width*a.frame.height)){const o=e.filter(f=>f!==i&&f.frame.x>=i.frame.x&&f.frame.y>=i.frame.y&&f.frame.x+f.frame.width<=i.frame.x+i.frame.width&&f.frame.y+f.frame.height<=i.frame.y+i.frame.height).flatMap(({cluster:f})=>{const g=r.get(f);return g?[g]:[]}),a=[...i.members.flatMap(f=>{const g=Je(f),p=g&&rr(g,t);return p?[p]:[]}),...o];if(!a.length)continue;const s=Number(i.cluster.dataset.headerHeight)||xn(18),n=Math.min(...a.map(f=>f.x))-24,l=Math.min(...a.map(f=>f.y))-s,c=Math.max(...a.map(f=>f.x+f.width))+24,h=Math.max(...a.map(f=>f.y+f.height))+24,d={x:n,y:l,width:c-n,height:h-l};i.rect.style.setProperty("transition-property","none","important");for(const[f,g]of Object.entries(d))i.rect.setAttribute(f,String(g));const u=i.label.querySelector("foreignObject");if(u)u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(Math.max(24,d.width-ai*2))),i.label.setAttribute("transform",`translate(${d.x+ai}, ${d.y+ai})`);else{const f=i.label.getBBox();i.label.setAttribute("transform",`translate(${d.x+d.width/2-f.x-f.width/2}, ${d.y+ai-f.y})`)}r.set(i.cluster,d)}}function g$(e,t){if(e.querySelectorAll("g.cluster").length<2)return!1;const r=t[0]?.path;if(!r)return!1;const i=D=>{const P=D&&Je(D);return P?rr(P,r):null},o=[...e.querySelectorAll("g.node")].flatMap(D=>{const P=zr(D),Y=Je(D);if(!Y||!aa(Y))return[];const X=t.filter(tt=>tt.source===P&&tt.target!==P),z=X.find(tt=>t.some(ot=>ot.source===tt.target&&ot.target===P))?.target;if(!z)return[];const U=X.find(tt=>tt.target!==z&&t.some(ot=>ot.source===z&&ot.target===tt.target)&&t.some(ot=>ot.source===tt.target&&ot.target===tt.target))?.target;if(!U)return[];const j=new Map;for(const tt of t.filter(ot=>ot.target===P&&ot.source!==z))j.set(tt.source,[...j.get(tt.source)??[],tt]);const V=[...j.values()].find(tt=>tt.length>=2),Q=t.filter(tt=>tt.source===P&&tt.target===U),rt=t.find(tt=>tt.source===P&&tt.target===z),ht=t.find(tt=>tt.source===z&&tt.target===P),H=t.find(tt=>tt.source===z&&tt.target===U),G=t.find(tt=>tt.source===U&&tt.target===U),K=t.find(tt=>tt.source===U&&tt.target!==U);return!V||Q.length<2||!rt||!ht||!H||!G||!K?[]:[{decisionId:P,secondary:z,merge:U,ingress:V,branches:Q,add:rt,retry:ht,done:H,loop:G,downstream:K}]})[0];if(!o)return!1;const a=o.ingress[0].source,s=o.downstream.target,n=new Set([o.decisionId,o.secondary,o.merge,a,s]),l=[...e.querySelectorAll("g.node")],c=new Map(l.filter(D=>n.has(zr(D))).map(D=>[zr(D),D]));if(c.size!==n.size)return!1;const h=[...e.querySelectorAll("g.cluster")].flatMap(D=>{const P=D.querySelector(":scope > rect"),Y=D.querySelector(":scope > g.cluster-label");if(!P||!Y)return[];const X=rr(P,r);if(!X)return[];const z=l.filter(U=>{const j=i(U);if(!j)return!1;const V=Et(j,.5,.5);return V.x>=X.x&&V.x<=X.x+X.width&&V.y>=X.y&&V.y<=X.y+X.height});return[{cluster:D,rect:P,label:Y,frame:X,members:z}]}),d=h.filter(D=>D.members.some(P=>zr(P)===o.decisionId)).toSorted((D,P)=>D.frame.width*D.frame.height-P.frame.width*P.frame.height)[0],u=d?h.filter(D=>D!==d&&d.frame.x>=D.frame.x&&d.frame.y>=D.frame.y&&d.frame.x+d.frame.width<=D.frame.x+D.frame.width&&d.frame.y+d.frame.height<=D.frame.y+D.frame.height).toSorted((D,P)=>D.frame.width*D.frame.height-P.frame.width*P.frame.height)[0]:void 0,f=(D,P)=>{const Y=c.get(P);D&&Y&&!D.members.includes(Y)&&D.members.push(Y)};f(d,o.decisionId),f(d,o.secondary),f(u,a),f(u,o.merge);const g=new Map([...c].flatMap(([D,P])=>{const Y=i(P);return Y?[[D,Y]]:[]}));if(g.size!==c.size)return!1;const p=t.some(({path:D})=>D.dataset.compactFlowchart==="true"),m=p?"compact":"wide",y=e.dataset.nestedDecisionLayout!==m,x=g.get(a),b=g.get(o.decisionId),S=g.get(o.secondary),T=g.get(o.merge),k=g.get(s),_=p?(()=>{const D=Et(b,.5,.5).x,P=Et(x,.5,.5).y,Y=Math.max(x.height,b.height,T.height,k.height)+94;return{intake:{x:D,y:P},decision:{x:D,y:P+Y},secondary:{x:D+S.width/2,y:P+Y*1.5},merge:{x:D,y:P+Y*2},registry:{x:D,y:P+Y*3}}})():(()=>{const D=Et(b,.5,.5).y,P=Et(x,.5,.5).x,Y=P+x.width/2+b.width/2+116,X=Y+b.width/2+T.width/2+184;return{intake:{x:P,y:D},decision:{x:Y,y:D},secondary:{x:(Y+X)/2+8,y:D+95},merge:{x:X,y:D},registry:{x:X+T.width/2+k.width/2+124,y:D}}})();if(y){for(const[D,P]of[[a,_.intake],[o.decisionId,_.decision],[o.secondary,_.secondary],[o.merge,_.merge],[s,_.registry]])D1(c.get(D),P,r);e.dataset.nestedDecisionLayout=m}f$(h,r);const L=D=>i(c.get(D)),v=L(a),M=L(o.decisionId),B=L(o.secondary),E=L(o.merge),O=L(s),[$,I]=o.ingress,[F,R]=o.branches,q=[];if(p){const D=Math.min(v.x,M.x,E.x,O.x)-16,P=Math.max(M.x+M.width,B.x+B.width)+12,Y=P+20,X=Qr(M,"top",-8),z=Qr(M,"left",-8),U=Qr(M,"top",8),j=Qr(M,"bottom",-8),V=Qr(M,"left",8);q.push({edge:$,role:"primary-ingress",points:[Et(v,.5,1),{x:X.x,y:Et(v,.5,1).y},X],targetSide:"top"},{edge:I,role:"metadata-return",points:[Et(v,0,.55),{x:D-22,y:Et(v,0,.55).y},{x:D-22,y:z.y},z],labelSegment:1,targetSide:"left"},{edge:o.add,role:"secondary-add",points:[Qr(M,"right",-8),{x:P,y:Qr(M,"right",-8).y},{x:P,y:Et(B,1,.35).y},Et(B,1,.35)],labelSegment:1,sourceSide:"right"},{edge:o.retry,role:"secondary-retry",points:[Et(B,1,.68),{x:Y,y:Et(B,1,.68).y},{x:Y,y:M.y-24},{x:U.x,y:M.y-24},U],labelSegment:1,targetSide:"top"},{edge:F,role:"primary-branch",points:[j,{x:j.x,y:M.y+M.height+12},{x:j.x-16,y:M.y+M.height+12},{x:j.x-16,y:E.y-12},{x:Et(E,.42,0).x,y:E.y-12},Et(E,.42,0)],labelSegment:2,sourceSide:"bottom"},{edge:R,role:"decision-return",points:[V,{x:D,y:V.y},{x:D,y:Et(E,0,.65).y},Et(E,0,.65)],labelSegment:1,sourceSide:"left"},{edge:o.done,role:"secondary-done",points:[Et(B,1,.65),{x:B.x+B.width,y:Et(E,1,.65).y},Et(E,1,.65)],labelSegment:0},{edge:o.downstream,role:"primary-save",points:[Et(E,.5,1),Et(O,.5,0)]})}else{const D=Math.min(v.y,M.y)-44,P=B.y+B.height+72,Y=Qr(M,"left",-8),X=Qr(M,"top",-8),z=Qr(M,"right",-8),U=Qr(M,"right",8),j={x:E.x,y:U.y},V=Qr(M,"bottom",-10),Q=Qr(M,"bottom",10),rt={x:E.x,y:z.y};q.push({edge:$,role:"primary-ingress",points:[{x:v.x+v.width,y:Y.y},Y],targetSide:"left"},{edge:I,role:"metadata-return",points:[Et(v,.5,0),{x:Et(v,.5,0).x,y:D},{x:X.x,y:D},X],labelSegment:1,targetSide:"top"},{edge:o.add,role:"secondary-add",points:[V,{x:V.x,y:Et(B,0,.38).y},Et(B,0,.38)],labelSegment:1,sourceSide:"bottom"},{edge:o.retry,role:"secondary-retry",points:[Et(B,.38,1),{x:Et(B,.38,1).x,y:P},{x:Q.x,y:P},Q],labelSegment:1,targetSide:"bottom"},{edge:F,role:"primary-branch",points:[z,rt],sourceSide:"right"},{edge:R,role:"decision-return",points:[U,j],sourceSide:"right"},{edge:o.done,role:"secondary-done",points:[Et(B,1,.62),{x:Et(E,.42,1).x,y:Et(B,1,.62).y},Et(E,.42,1)]},{edge:o.downstream,role:"primary-save",points:[Et(E,1,.64),{x:O.x,y:Et(E,1,.64).y}]})}q.push({edge:o.loop,role:"compact-loop",points:[Et(E,1,.16),{x:E.x+E.width+30,y:Et(E,1,.16).y},{x:E.x+E.width+30,y:Et(E,1,.4).y},Et(E,1,.4)]});for(const{edge:D,role:P,points:Y,labelSegment:X,sourceSide:z,targetSide:U}of q){const j=_r(Y);for(const rt of["feedbackLane","fanoutSource","groupedReturnLane","decisionBranch","decisionReturn","clusterHeaderClearance","compactGroupedRoute"])delete D.path.dataset[rt];D.path.dataset.nestedDecisionRoute=P,P==="compact-loop"?D.path.dataset.selfLoop="right":delete D.path.dataset.selfLoop,z?D.path.dataset.diamondSourceSide=z:delete D.path.dataset.diamondSourceSide,U?D.path.dataset.diamondTargetSide=U:delete D.path.dataset.diamondTargetSide,D.path.dataset.manhattanPoints=j.map(({x:rt,y:ht})=>`${rt},${ht}`).join(" "),D.path.dataset.manhattanSegments=String(j.length-1),D.path.dataset.terminalTarget=c.get(D.target)?.id??"";const V=j.at(-1),Q=j.at(-2);D.path.dataset.terminalDirection=`${V.x-Q.x},${V.y-Q.y}`,D.path.setAttribute("d",j.map(({x:rt,y:ht},H)=>`${H?"L":"M"}${rt},${ht}`).join("")),fo(D.label,D.path,j,X)}return a$(e,t),!0}function p$(e,t){if(t.length!==1)return null;const r=t[0],i=e.filter(c=>c.source===r);if(i.length!==2)return null;const o=i.filter(c=>e.some(h=>h.source===c.target&&h.target===r));if(o.length!==1)return null;const a=o[0].target;if(a===r||e.filter(c=>c.source===a||c.target===a).length!==2)return null;const s=e.filter(c=>c.source!==a&&c.target!==a),n=s.filter(c=>!s.some(h=>h.target===c.source));if(n.length!==1)return null;const l=[n[0].source];for(;;){const c=s.filter(h=>h.source===l.at(-1));if(!c.length)break;if(c.length!==1||l.includes(c[0].target))return null;l.push(c[0].target)}return l.length!==s.length+1||l.indexOf(r)<=0||l.at(-1)===r?null:{decision:r,retry:a,spine:l}}function m$(e,t){if(!["TD","TB"].includes(e.dataset.flowchartDirection??"")||e.querySelector("g.cluster"))return!1;const r=[...e.querySelectorAll("g.node")],i=p$(t,r.filter(g=>{const p=Je(g);return p&&aa(p)}).map(zr));if(!i||r.length!==i.spine.length+1)return!1;const o=t[0].path,a=new Map(r.flatMap(g=>{const p=Je(g),m=p&&rr(p,o);return m?[[zr(g),m]]:[]}));if(a.size!==r.length)return!1;const s=t.find(g=>g.source===i.decision&&g.target===i.retry),n=s.label?.getBBox(),l=a.get(i.spine[0]),c=l.x+l.width/2;let h=l.y;const d=o.dataset.compactFlowchart==="true";for(const g of i.spine){const p=a.get(g);p.x=c-p.width/2,p.y=h,h+=p.height+(d?100:64)}const u=a.get(i.decision),f=a.get(i.retry);f.x=u.x+u.width+Math.max(80,(n?.width??0)+48),f.y=u.y+(u.height-f.height)/2;for(const g of r)D1(g,Et(a.get(zr(g)),.5,.5),o);for(const g of t){const p=a.get(g.source),m=a.get(g.target),y=g.source===i.retry,x=g===s;let b;if(y){const S=Qr(m,"right",-Math.min(32,m.height/4)),T=Math.min(p.y,m.y)-32;b=[Et(p,.5,0),{x:p.x+p.width/2,y:T},{x:m.x+m.width+24,y:T},{x:m.x+m.width+24,y:S.y},S]}else x?b=[Et(p,1,.5),Et(m,0,.5)]:b=[Et(p,.5,1),Et(m,.5,0)];for(const S of["feedbackLane","fanoutSource","fanoutPort","parallelLane","decisionBranch","decisionReturn"])delete g.path.dataset[S];g.path.dataset.decisionCycleRoute=y?"return":x?"branch":"spine",g.path.dataset.manhattanPoints=b.map(({x:S,y:T})=>`${S},${T}`).join(" "),g.path.dataset.manhattanSegments=String(b.length-1),g.path.setAttribute("d",b.map(({x:S,y:T},k)=>`${k?"L":"M"}${S},${T}`).join("")),fo(g.label,g.path,b)}return e.dataset.decisionCycleLayout="vertical",!0}function Jn(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const t=[...e.querySelectorAll(".edgeLabels > .edgeLabel")],r=[...e.querySelectorAll(".edgePaths path")].flatMap((s,n)=>{const l=vr(s);return l?[{path:s,label:t[n],...l}]:[]}),i=r[0]?.path;if(!i||g$(e,r)||m$(e,r))return;const o=s=>{const n=s&&Je(s);return n?rr(n,i):null},a=[...e.querySelectorAll("g.node")].flatMap(s=>{const n=o(s);return n?[n]:[]});for(const s of new Set(r.map(({source:n})=>n))){const n=ir(e,s),l=o(n),c=r.filter(({source:m})=>m===s).flatMap(m=>{const y=ir(e,m.target),x=o(y);return x?[{...m,targetBounds:x}]:[]});if(!n?.querySelector(":scope > polygon.label-container")||!l||c.length!==2||!a.length)continue;const h=c.toSorted((m,y)=>+(y.label?.textContent?.trim()==="Yes")-+(m.label?.textContent?.trim()==="Yes"));if(new Set(h.map(({label:m})=>m?.textContent?.trim())).size!==2||!h.some(({label:m})=>m?.textContent?.trim()==="Yes")||!h.some(({label:m})=>m?.textContent?.trim()==="No"))continue;h.forEach((m,y)=>{const x=y===0?"upper":"lower",b=m.path.dataset.compactFlowchart==="true",S=E3(l,m.targetBounds,x,a,b);if(m.path.setAttribute("d",S.map((T,k)=>`${k?"L":"M"}${T.x},${T.y}`).join("")),m.path.dataset.decisionBranch=x,m.path.dataset.decisionSource=s,m.path.dataset.decisionTarget=m.target,m.path.dataset.decisionPort=`${S[0].x},${S[0].y}`,m.path.dataset.decisionLane=String(S[1].x),m.path.dataset.manhattanPoints=S.map(T=>`${T.x},${T.y}`).join(" "),m.label){const T=Math.hypot(S[1].x-S[0].x,S[1].y-S[0].y)<=12;u$(m.label,m.path,T&&S[2]?S[1]:S[0],T&&S[2]?S[2]:S[1])}});const d=new Set(h.map(({target:m})=>m)),u=r.find(({source:m,target:y})=>d.has(m)&&y===s),f=u&&ir(e,u.source),g=o(f);if(!u||!g)continue;const p=P3(g,l,a,u.path.dataset.compactFlowchart==="true");u.path.setAttribute("d",p.map((m,y)=>`${y?"L":"M"}${m.x},${m.y}`).join("")),u.path.dataset.decisionReturn="outer",u.path.dataset.decisionSource=u.source,u.path.dataset.decisionTarget=s,u.path.dataset.decisionLane=String(Math.max(...p.map(({y:m})=>m))),u.path.dataset.manhattanPoints=p.map(m=>`${m.x},${m.y}`).join(" ")}}function y$(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2"||!e.querySelector("g.cluster"))return!1;const t=[...e.querySelectorAll("g.node")].map(zr),r=new Set(t),i=new Map,o=new Set;for(const n of e.querySelectorAll(".edgePaths path")){const l=vr(n);if(!l||!r.has(l.source)||!r.has(l.target)||i.has(l.source)||o.has(l.target))return!1;i.set(l.source,l.target),o.add(l.target)}const a=t.filter(n=>!o.has(n));if(a.length<2||a.some(n=>!i.has(n)))return!1;const s=new Set;for(const n of a){let l=n;for(;l!==void 0;){if(s.has(l))return!1;s.add(l),l=i.get(l)}}return s.size===t.length}function bh(e,t=!0,r){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return null;const i=[...e.querySelectorAll("g.node")];if(e.querySelector("g.cluster"))return t?k$(e):w$(e,r),t?x$(e,i):null;if(i.length<2)return null;if(!t){let x=0;for(const b of i){const T=Je(b)?.getBBox()??b.getBBox();b.setAttribute("transform",`translate(${-T.x-T.width/2}, ${x-T.y})`),x+=T.height+100}return null}const o=[...e.querySelectorAll(".edgePaths path")],a=[...e.querySelectorAll(".edgeLabels > .edgeLabel")],s=new Map(i.map((x,b)=>[zr(x),b])),n=new Map,l=new Map;for(const x of o){const b=vr(x);if(!b)continue;const S=[b.source,b.target].toSorted().join("\0");n.set(S,(n.get(S)??0)+1),l.set(b.source,(l.get(b.source)??0)+1)}const c={left:0,right:0},h=new Map,d=new Map,u=[],f=i.flatMap(x=>{const b=x.transform.baseVal.consolidate()?.matrix;if(!b)return[];const S=x.getBBox();return[{x:S.x+b.e,y:S.y+b.f,width:S.width,height:S.height}]});if(o.forEach((x,b)=>{const S=vr(x),T=S&&ir(e,S.source),k=S&&ir(e,S.target),_=T&&Sr(T),L=k&&Sr(k);if(!S||!_||!L)return;f.push(_,L);const v=s.get(S.source)??0,M=s.get(S.target)??0,B=[S.source,S.target].toSorted().join("\0"),E=n.get(B)??0,O=d.get(B)??0;if(d.set(B,O+1),E>1){const Q=O-(E-1)/2;x.dataset.parallelLane=Q<0?"before":Q>0?"after":"center"}else delete x.dataset.parallelLane;let $;if(M===v+1&&n.get(B)===1&&l.get(S.source)===1)$=[Et(_,.5,1),Et(L,.5,0)];else{const Q=M<=v?"left":"right",rt=c[Q]++,ht=`${S.source}\0${Q}`,H=h.get(ht)??0;h.set(ht,H+1);const G=M>v,K=Et(_,.5,G?1:0),tt=Et(L,.5,G?0:1),ot=28+H*30,vt=K.y+(G?ot:-ot),Ot=tt.y+(G?-28:28),Pt=42+rt%2*6,Mt=Q==="left"?Math.min(_.x,L.x)-Pt:Math.max(_.x+_.width,L.x+L.width)+Pt;$=[K,{x:K.x,y:vt},{x:Mt,y:vt},{x:Mt,y:Ot},{x:tt.x,y:Ot},tt]}$=_r($);const I=Math.min(...$.map(Q=>Q.x)),F=Math.min(...$.map(Q=>Q.y)),R=Math.max(...$.map(Q=>Q.x)),q=Math.max(...$.map(Q=>Q.y));f.push({x:I,y:F,width:R-I,height:q-F}),x.setAttribute("d",$.map((Q,rt)=>`${rt?"L":"M"}${Q.x},${Q.y}`).join("")),x.dataset.compactFlowchart="true",x.dataset.manhattanPoints=$.map(Q=>`${Q.x},${Q.y}`).join(" ");const D=a[b];if(!D)return;const Y=$.slice(1).map((Q,rt)=>({start:$[rt],end:Q})).toSorted((Q,rt)=>+(Math.abs(rt.end.y-rt.start.y)<.001)-+(Math.abs(Q.end.y-Q.start.y)<.001)||Math.hypot(rt.end.x-rt.start.x,rt.end.y-rt.start.y)-Math.hypot(Q.end.x-Q.start.x,Q.end.y-Q.start.y)),X=D.getBBox(),z=Y.flatMap(Q=>[.5,.35,.65,.2,.8].map(rt=>({segment:Q,midpoint:{x:Q.start.x+(Q.end.x-Q.start.x)*rt,y:Q.start.y+(Q.end.y-Q.start.y)*rt}}))),U=z.find(({midpoint:Q})=>{const rt={x:Q.x-X.width/2,y:Q.y-X.height/2,width:X.width,height:X.height};return!u.some(ht=>Ai(rt,ht,4))})??z[0];if(!U)return;const{midpoint:j}=U;D.setAttribute("transform",`translate(${j.x-X.x-X.width/2}, ${j.y-X.y-X.height/2})`);const V={x:j.x-X.width/2,y:j.y-X.height/2,width:X.width,height:X.height};u.push(V),f.push(V)}),!f.length)return null;const g=Math.min(...f.map(x=>x.x)),p=Math.min(...f.map(x=>x.y)),m=Math.max(...f.map(x=>x.x+x.width)),y=Math.max(...f.map(x=>x.y+x.height));return{x:g,y:p,width:m-g,height:y-p}}function x$(e,t){const r=t.map(Sr).filter(n=>!!n);for(const n of e.querySelectorAll(".edgePaths path")){const l=n.getBBox();r.push({x:l.x,y:l.y,width:l.width,height:l.height})}if(!r.length)return null;const i=Math.min(...r.map(n=>n.x)),o=Math.min(...r.map(n=>n.y)),a=Math.max(...r.map(n=>n.x+n.width)),s=Math.max(...r.map(n=>n.y+n.height));return{x:i-6,y:o-46,width:a-i+12,height:s-o+54}}function b$(e){const t=e.querySelector(".edgePaths path");if(!t)return null;const i=[...[...e.querySelectorAll("g.node")].flatMap(l=>{const c=Je(l);return c?[c]:[]}),...e.querySelectorAll("g.cluster > rect"),...e.querySelectorAll(".edgePaths path")].flatMap(l=>{const c=rr(l,t);return c?[c]:[]});if(!i.length)return null;const o=Math.min(...i.map(l=>l.x)),a=Math.min(...i.map(l=>l.y)),s=Math.max(...i.map(l=>l.x+l.width)),n=Math.max(...i.map(l=>l.y+l.height));return{x:o,y:a,width:s-o,height:n-a}}function zr(e){return e.id.match(/flowchart-(.+?)-\d+$/)?.[1]??e.id}function Sr(e){const t=Je(e),r=e.transform.baseVal.consolidate()?.matrix;if(!t||!r)return null;const i=t.getBBox();return{x:i.x+r.e,y:i.y+r.f,width:i.width,height:i.height}}function C$(e,t,r){if(!e.length)return null;const i=Math.min(...e.map(l=>l.x))-20,o=Math.min(...e.map(l=>l.y))-r,a=Math.max(...e.map(l=>l.x+l.width))+20,s=Math.max(...e.map(l=>l.y+l.height))+20,n={x:i,y:o,width:a-i,height:s-o};return t.some(l=>Ai(n,l,4))?null:n}function w$(e,t){const r=[...e.querySelectorAll("g.node")],i=new Map(r.map(u=>[u,Sr(u)])),o=[...e.querySelectorAll("g.cluster")].flatMap(u=>{const f=u.querySelector(":scope > rect"),g=u.querySelector(":scope > g.cluster-label");if(!f||!g)return[];const p=f.getBBox(),m=t&&Lu(u,t),y=m?t?.get(m):void 0;if(t&&!y)return[];const x=r.filter(b=>{if(y)return y.has(zr(b));const S=i.get(b);if(!S)return!1;const T=Et(S,.5,.5);return T.x>=p.x&&T.x<=p.x+p.width&&T.y>=p.y&&T.y<=p.y+p.height});return[{cluster:u,rect:f,label:g,originalRect:p,members:x,id:m,memberIds:y}]}),a=new Map,s=(u,f,g)=>{let p=g;for(const m of u){const y=m.getBBox();a.set(m,{x:f-y.x-y.width/2,y:p-y.y}),p+=y.height+100}},n=Math.max(...r.map(u=>u.getBBox().width)),l=y$(e);let c=l;if(c){const u=new Map([...e.querySelectorAll(".edgePaths path")].map(x=>{const b=vr(x);return[b.source,b.target]})),f=new Set(u.values()),g=new Map(r.map(x=>[zr(x),x])),p=r.filter(x=>!f.has(zr(x))).map(x=>{const b=[x];let S=u.get(zr(x));for(;S!==void 0;)b.push(g.get(S)),S=u.get(S);return b}),m=Array.from({length:Math.max(...p.map(x=>x.length))},(x,b)=>Math.max(...p.map(S=>S[b]?.getBBox().height??0)));let y=0;for(const x of p){const b=Math.max(...x.map(T=>T.getBBox().width));let S=48;x.forEach((T,k)=>{const _=T.getBBox();a.set(T,{x:y+b/2-_.x-_.width/2,y:S+m[k]/2-_.y-_.height/2}),S+=m[k]+100}),y+=b+24}}else s(r,n/2,48);const h=()=>{const u=new Map(r.flatMap(g=>{const p=Je(g),m=a.get(g);if(!p||!m)return[];const y=p.getBBox();return[[g,{x:y.x+m.x,y:y.y+m.y,width:y.width,height:y.height}]]}));if(l&&(u.size!==r.length||o.length!==e.querySelectorAll("g.cluster").length||o.some(({members:g})=>!g.length)))return null;const f=new Map;for(const g of o.toSorted((p,m)=>(p.memberIds?.size??0)-(m.memberIds?.size??0)||p.originalRect.width*p.originalRect.height-m.originalRect.width*m.originalRect.height)){const p=g.members.flatMap(L=>{const v=u.get(L);return v?[v]:[]}),m=o.filter(L=>L!==g&&(g.memberIds?!!(L.id&&g.memberIds.has(L.id)):L.originalRect.x>=g.originalRect.x&&L.originalRect.y>=g.originalRect.y&&L.originalRect.x+L.originalRect.width<=g.originalRect.x+g.originalRect.width&&L.originalRect.y+L.originalRect.height<=g.originalRect.y+g.originalRect.height)).flatMap(({cluster:L})=>{const v=f.get(L);return v?[v.frame]:[]}),y=[...p,...m];if(!y.length)continue;const x=g.label.querySelector("foreignObject"),b=l&&x?x.cloneNode(!0):null;if(b){const L=Math.max(...y.map(M=>M.x+M.width))-Math.min(...y.map(M=>M.x));b.setAttribute("width",String(Math.max(24,L))),b.style.visibility="hidden";const v=b.querySelector("div");v&&(v.style.width="100%",v.style.whiteSpace="normal",v.style.overflowWrap="normal",v.style.wordBreak="normal"),g.label.append(b)}let S;try{const L=(b??x)?.querySelector("div");S=Math.ceil(Math.max(L?.getBoundingClientRect().height??0,L?.scrollHeight??0,18))}finally{b?.remove()}const T=xn(S),k=l?r.filter(L=>!g.members.includes(L)).flatMap(L=>{const v=u.get(L);return v?[v]:[]}):[],_=C$(y,k,T);if(!_)return null;f.set(g.cluster,{frame:_,measuredTitleHeight:S,headerHeight:T})}return f};let d=h();if(c&&!d&&(c=!1,s(r,n/2,48),d=h()),e.dataset.compactGroupedLayout=d?c?"parallel":"column":"original",!!d){for(const[u,f]of a)u.setAttribute("transform",`translate(${f.x}, ${f.y})`);for(const u of o){const f=d.get(u.cluster);if(!f)continue;const{frame:g,measuredTitleHeight:p,headerHeight:m}=f,y=g.x,x=g.x+g.width,b=g.y,S=u.label.querySelector("foreignObject"),T=S?.querySelector("div");if(u.rect.setAttribute("x",String(g.x)),u.rect.setAttribute("y",String(g.y)),u.rect.setAttribute("width",String(g.width)),u.rect.setAttribute("height",String(g.height)),u.cluster.dataset.headerHeight=String(m),S)S.setAttribute("x","0"),S.setAttribute("y","0"),S.setAttribute("width",String(Math.max(24,g.width-40))),S.setAttribute("height",String(p)),S.style.overflow="hidden",T&&(T.style.width="100%",T.style.whiteSpace="normal",T.style.overflowWrap="normal",T.style.wordBreak="normal"),u.label.setAttribute("transform",`translate(${y+20}, ${b+20})`);else{const k=u.label.getBBox();u.label.setAttribute("transform",`translate(${(y+x)/2-k.x-k.width/2}, ${b+20-k.y})`)}}}}function k$(e){if(e.dataset.compactGroupedLayout==="original")return;const t=[...e.querySelectorAll(".edgePaths path")],r=[...e.querySelectorAll("g.node")],i=e.dataset.compactGroupedLayout==="parallel",o=new Map(r.map((p,m)=>[zr(p),m])),a=t.flatMap(p=>{const m=vr(p);return m?[{path:p,...m}]:[]}),s=new Map;for(const p of a){const m=[p.source,p.target].toSorted().join("\0");s.set(m,[...s.get(m)??[],p])}const n={left:0,right:0},l=a.flatMap(p=>{if(p.source===p.target)return[{...p,side:"right"}];const m=[p.source,p.target].toSorted().join("\0"),y=s.get(m)??[];if(y.length>1)return[{...p,side:y.indexOf(p)%2?"right":"left"}];const x=o.get(p.source)??0,b=o.get(p.target)??0;return[{...p,side:i||Math.abs(b-x)===1?null:b<x?"left":"right"}]}),c=new Map;for(const p of l)if(!(!p.side||p.source===p.target))for(const m of[p.source,p.target]){const y=`${m}\0${p.side}`;c.set(y,(c.get(y)??0)+1)}const h=new Map,d=(p,m)=>{const y=`${p}\0${m}`,x=c.get(y)??1,b=h.get(y)??0;return h.set(y,b+1),x===1?.5:.25+b*.5/(x-1)},u=r.map(Sr).filter(p=>!!p),f=Math.min(...u.map(p=>p.x))-24,g=Math.max(...u.map(p=>p.x+p.width))+24;for(const p of l){const{path:m,source:y,target:x,side:b}=p,S=ir(e,y),T=ir(e,x),k=S&&Sr(S),_=T&&Sr(T);if(!k||!_)continue;let L;if(y===x){const v=k.x+k.width+24;L=[Et(k,1,.3),{x:v,y:k.y+k.height*.3},{x:v,y:k.y+k.height*.7},Et(k,1,.7)],m.dataset.selfLoop="right"}else if(b){const v=Et(k,b==="left"?0:1,d(y,b)),M=Et(_,b==="left"?0:1,d(x,b)),B=n[b]++,E=(b==="left"?f:g)+(b==="left"?-1:1)*B*12;L=[v,{x:E,y:v.y},{x:E,y:M.y},M],m.dataset.compactGroupedSide=b,m.dataset.compactGroupedPort=`${v.x},${v.y} ${M.x},${M.y}`}else if(_.x>=k.x+k.width||k.x>=_.x+_.width){const M=_.x>=k.x,B=Et(k,M?1:0,.5),E=Et(_,M?0:1,.5),O=(B.x+E.x)/2;L=_r([B,{x:O,y:B.y},{x:O,y:E.y},E])}else{const M=_.y>=k.y,B=Et(k,.5,M?1:0),E=Et(_,.5,M?0:1),O=(B.y+E.y)/2;L=_r([B,{x:B.x,y:O},{x:E.x,y:O},E])}L=_r(L),m.setAttribute("d",L.map((v,M)=>`${M?"L":"M"}${v.x},${v.y}`).join("")),m.dataset.compactFlowchart="true",m.dataset.compactGroupedRoute="true",m.dataset.manhattanPoints=L.map(v=>`${v.x},${v.y}`).join(" ")}for(const p of e.querySelectorAll("g.cluster")){const m=p.querySelector(":scope > rect"),y=p.querySelector(":scope > g.cluster-label");if(!m||!y)continue;const x=m.getBBox(),b=y.getBBox();y.setAttribute("transform",`translate(${x.x+x.width/2-b.x-b.width/2}, ${x.y+20-b.y})`)}}function S$(e){if(e.dataset.nestedDecisionLayout)return;const t=[...e.querySelectorAll("g.node")],r=[...e.querySelectorAll("g.cluster")].flatMap(o=>{const a=o.querySelector(":scope > rect");return a?[{cluster:o,rect:a,frame:{x:Number(a.getAttribute("x")),y:Number(a.getAttribute("y")),width:Number(a.getAttribute("width")),height:Number(a.getAttribute("height"))}}]:[]}),i=(o,a)=>a.x>=o.x&&a.x+a.width<=o.x+o.width&&a.y>=o.y&&a.y+a.height<=o.y+o.height;for(const o of r){const a=r.filter(p=>p!==o&&i(p.frame,o.frame)).toSorted((p,m)=>p.frame.width*p.frame.height-m.frame.width*m.frame.height)[0];if(!a)continue;const s=[...e.querySelectorAll(".edgePaths path")].flatMap(p=>{const m=vr(p),y=m&&ir(e,m.source),x=m&&ir(e,m.target),b=y&&Sr(y),S=x&&Sr(x),T=$i(e,p);return!b||!S||!i(o.frame,S)||i(o.frame,b)||!i(a.frame,b)||b.y+b.height>o.frame.y?[]:[{source:b,labelWidth:T?.getBBox().width??0}]});if(!s.length)continue;const n=24,l=Math.max(0,...s.map(({source:p})=>p.y+p.height+n-o.frame.y)),c=t.filter(p=>{const m=Sr(p);return m&&i(o.frame,m)}),h=t.filter(p=>!c.includes(p)).flatMap(p=>{const m=Sr(p);return m&&m.y>=o.frame.y+o.frame.height?[m.y]:[]}),d=Math.min(a.frame.y+a.frame.height,...h)-o.frame.y-o.frame.height-n,u=Math.min(l,Math.max(0,d));if(u>0){for(const p of c){const m=p.transform.baseVal.consolidate()?.matrix;m&&p.setAttribute("transform",`translate(${m.e}, ${m.f+u})`)}for(const p of r.filter(m=>i(o.frame,m.frame))){p.rect.setAttribute("y",String(p.frame.y+u));const m=p.cluster.querySelector(":scope > .cluster-label"),y=m?.transform.baseVal.consolidate()?.matrix;y&&m.setAttribute("transform",`translate(${y.e}, ${y.f+u})`)}}const f=Math.max(...s.map(({labelWidth:p})=>p+12)),g=Math.max(a.frame.x+a.frame.width,o.frame.x+o.frame.width+f);a.rect.setAttribute("width",String(g-a.frame.x))}}function Ch(e){if(e.getAttribute("aria-roledescription")!=="flowchart-v2")return;const t=[...e.querySelectorAll("g.cluster")];for(const r of e.querySelectorAll(".edgePaths path")){if(r.dataset.feedbackLane||r.dataset.nestedDecisionRoute)continue;const i=r.dataset.fanoutSource&&vr(r),o=i&&ir(e,i.source),a=i&&ir(e,i.target),s=o&&Sr(o),n=a&&Sr(a),l=M=>t.flatMap(B=>{const O=B.querySelector(":scope > rect")?.getBBox();return O?[{cluster:B,frame:O}]:[]}).filter(({frame:B})=>M.x+M.width/2>B.x&&M.x+M.width/2<B.x+B.width&&M.y+M.height/2>B.y&&M.y+M.height/2<B.y+B.height).toSorted((B,E)=>B.frame.width-E.frame.width)[0];if(s&&n){const M=l(s),B=l(n);if(M&&B&&M.cluster!==B.cluster){const E=Et(s,1,.5),O=Et(n,0,.5),$=(M.frame.x+M.frame.width+B.frame.x)/2,I=[E,{x:$,y:E.y},{x:$,y:O.y},O];r.setAttribute("d",I.map((F,R)=>`${R?"L":"M"}${F.x},${F.y}`).join("")),r.dataset.clusterHeaderClearance="true",r.dataset.clusterHeaderTargetPort="left",r.dataset.manhattanPoints=I.map(F=>`${F.x},${F.y}`).join(" ");continue}}const c=r.getTotalLength();if(!c)continue;const h=r.getPointAtLength(0),d=r.getPointAtLength(c);if(Math.abs(d.y-h.y)<=Math.abs(d.x-h.x))continue;const u=vr(r),f=u&&ir(e,u.source),g=u&&ir(e,u.target),p=f&&Je(f),m=g&&Je(g),y=p?rr(p,r):null,x=m?rr(m,r):null,b=M=>M?t.map(B=>{const E=B.querySelector(":scope > rect"),O=E&&kr(E,r),$=Number(B.dataset.headerHeight);return O?{bounds:O,protectedBottom:O.y+(Number.isFinite($)?$:48)+8}:null}).filter(B=>!!B).filter(({bounds:B})=>M.x+M.width/2>B.x&&M.x+M.width/2<B.x+B.width&&M.y+M.height/2>B.y&&M.y+M.height/2<B.y+B.height).toSorted((B,E)=>B.bounds.width-E.bounds.width)[0]:null,S=b(y),T=b(x);if(x&&T&&d.y<T.protectedBottom){const M=x.y+x.height/2,B=Math.abs(h.x-(T.bounds.x-8))<=Math.abs(h.x-(T.bounds.x+T.bounds.width+8)),E=B?T.bounds.x-8:T.bounds.x+T.bounds.width+8,O=B?x.x:x.x+x.width,$=y&&S&&(S.bounds.x!==T.bounds.x||S.bounds.y!==T.bounds.y),I=T.bounds.y-6,F=y?y.y+y.height/2:h.y,R=y?E<y.x+y.width/2?y.x:y.x+y.width:h.x,q=_r($?[{x:R,y:F},{x:E,y:F},{x:E,y:M},{x:O,y:M}]:[{x:h.x,y:h.y},{x:h.x,y:I},{x:E,y:I},{x:E,y:M},{x:O,y:M}]);r.setAttribute("d",q.map((D,P)=>`${P?"L":"M"}${D.x},${D.y}`).join("")),r.dataset.clusterHeaderClearance="true",r.dataset.clusterHeaderTargetPort=B?"left":"right",r.dataset.manhattanPoints=q.map(D=>`${D.x},${D.y}`).join(" ");continue}const k=t.flatMap(M=>{const B=M.querySelector(":scope > rect"),E=B&&kr(B,r);if(!E)return[];const O=Number(M.dataset.headerHeight),$={...E,height:Math.min(E.height,(Number.isFinite(O)?O:48)+8)};return Array.from({length:101},(F,R)=>r.getPointAtLength(c*R/100)).some(F=>F.x>$.x-6&&F.x<$.x+$.width+6&&F.y>$.y-6&&F.y<$.y+$.height+6)?[$]:[]}).sort((M,B)=>d.y>=h.y?M.y-B.y:B.y+B.height-(M.y+M.height));if(!k.length)continue;const _=d.y>=h.y,L=[{x:h.x,y:h.y}];for(const M of k){const B=_?M.y-6:M.y+M.height+6,E=_?M.y+M.height+6:M.y-6,O=M.x-8,$=M.x+M.width+8,I=Math.abs(h.x-O)<=Math.abs(h.x-$)?O:$;L.push({x:h.x,y:B},{x:I,y:B},{x:I,y:E},{x:h.x,y:E})}L.push({x:h.x,y:d.y},{x:d.x,y:d.y});const v=_r(L);r.setAttribute("d",v.map((M,B)=>`${B?"L":"M"}${M.x},${M.y}`).join("")),r.dataset.clusterHeaderClearance="true",r.dataset.manhattanPoints=v.map(M=>`${M.x},${M.y}`).join(" ")}}function Ya(e){if(!e.querySelector("g.cluster"))return;const t=[...e.querySelectorAll(".edgePaths path")],r=[...e.querySelectorAll(".edgeLabels > .edgeLabel")],i=[...e.querySelectorAll("g.cluster > g.cluster-label")],o=s=>{const n=s.getAttribute("transform");s.removeAttribute("transform");const l=s.getBBox();return n&&s.setAttribute("transform",n),l},a=[];t.forEach((s,n)=>{const l=r[n];if(s.dataset.nestedDecisionRoute&&l){const b=kr(l,s);b&&a.push(b);return}if(s.dataset.clientRequestLane==="downward"&&l){const b=kr(l,s);b&&a.push(b);return}const c=(s.dataset.manhattanPoints??"").trim().split(/\s+/).map(b=>b.split(",").map(Number)).filter(b=>b.length===2&&b.every(Number.isFinite)).map(([b,S])=>({x:b,y:S}));if(!l||c.length<2)return;const h=o(l),d=kr(l,s);if(!d)return;const u=[...[...e.querySelectorAll("g.node")].map(b=>kr(b,s)).filter(b=>!!b),...i.map(b=>kr(b,s)).filter(b=>!!b),...a],f=nr(c);let p=f.flatMap(b=>{const S=Math.abs(b.start.y-b.end.y)<.001,T=Math.hypot(b.end.x-b.start.x,b.end.y-b.start.y),k=(S?d.width:d.height)+12;return T<k?[]:[.5,.35,.65,.2,.8].map(_=>{const L={x:b.start.x+(b.end.x-b.start.x)*_,y:b.start.y+(b.end.y-b.start.y)*_},v={x:L.x-d.width/2,y:L.y-d.height/2,width:d.width,height:d.height};return{center:L,bounds:v,horizontal:S,capacity:T}})}).filter(({bounds:b})=>u.every(S=>!Ai(b,S,4))).sort((b,S)=>Number(S.horizontal)-Number(b.horizontal)||S.capacity-b.capacity)[0];if(!p){const b=f.map(L=>({...L,capacity:Math.hypot(L.end.x-L.start.x,L.end.y-L.start.y)})).sort((L,v)=>v.capacity-L.capacity)[0];if(!b)return;const S=Math.abs(b.end.y-b.start.y)>Math.abs(b.end.x-b.start.x),T={x:(b.start.x+b.end.x)/2,y:(b.start.y+b.end.y)/2},k=S?d.width/2:d.height/2,_=u.flatMap(L=>S?[{x:L.x-4-k,y:T.y},{x:L.x+L.width+4+k,y:T.y}]:[{x:T.x,y:L.y-4-k},{x:T.x,y:L.y+L.height+4+k}]);p=[S?{x:T.x+k+4,y:T.y}:{x:T.x,y:T.y+k+4},S?{x:T.x-k-4,y:T.y}:{x:T.x,y:T.y-k-4},..._].map(L=>({center:L,bounds:{x:L.x-d.width/2,y:L.y-d.height/2,width:d.width,height:d.height},horizontal:!S,capacity:b.capacity})).filter(({bounds:L})=>u.every(v=>!Ai(L,v,4))&&a.every(v=>!Ai(L,v,4))).toSorted((L,v)=>Math.hypot(L.center.x-T.x,L.center.y-T.y)-Math.hypot(v.center.x-T.x,v.center.y-T.y))[0]}if(!p)return;if(s.dataset.groupedReturnLane==="right"&&!p.horizontal){const b=h.width/2-6;p={...p,center:{...p.center,x:p.center.x-b},bounds:{...p.bounds,x:p.bounds.x-b}}}const m=s.getCTM(),y=l.parentElement?.getCTM(),x=m&&y?new DOMPoint(p.center.x,p.center.y).matrixTransform(m).matrixTransform(y.inverse()):p.center;l.setAttribute("transform",`translate(${x.x-h.x-h.width/2}, ${x.y-h.y-h.height/2})`),l.dataset.finalPathCenter=`${p.center.x},${p.center.y}`,a.push(p.bounds)}),t.forEach((s,n)=>{const l=r[n];if(s.dataset.nestedDecisionRoute||s.dataset.clientRequestLane==="downward")return;const c=l?.dataset.finalPathCenter,h=s.dataset.manhattanPoints;if(!l?.textContent?.trim()||!h)return;const d=kr(l,s);if(!d)return;const u=i.flatMap(M=>{const B=kr(M,s);return B?[B]:[]}),f=u.find(M=>Ai(d,M,4));if(!f)return;const g=M=>{const[B,E]=M.split(",").map(Number);return{x:B,y:E}},p=h.split(" ").map(g),m=p.slice(1).map((M,B)=>({start:p[B],end:M})),y=c?g(c):null,x=y?m.find(({start:M,end:B})=>{const E=Math.min(M.x,B.x)-1,O=Math.max(M.x,B.x)+1,$=Math.min(M.y,B.y)-1,I=Math.max(M.y,B.y)+1;return y.x>=E&&y.x<=O&&y.y>=$&&y.y<=I}):m.slice().sort((M,B)=>Math.hypot(B.end.x-B.start.x,B.end.y-B.start.y)-Math.hypot(M.end.x-M.start.x,M.end.y-M.start.y))[0];if(!x)return;const b=Math.abs(x.end.y-x.start.y)>Math.abs(x.end.x-x.start.x),S={x:(x.start.x+x.end.x)/2,y:(x.start.y+x.end.y)/2},T={...y??S};if(y)if(b){const M=d.height/2,B=f.y+f.height+4+M,E=f.y-4-M,O=Math.min(x.start.y,x.end.y)+M,$=Math.max(x.start.y,x.end.y)-M;T.y=B<=$?Math.max(O,B):Math.min($,E)}else{const M=d.width/2,B=f.x+f.width+4+M,E=f.x-4-M,O=Math.min(x.start.x,x.end.x)+M,$=Math.max(x.start.x,x.end.x)-M;T.x=B<=$?Math.max(O,B):Math.min($,E)}else{const M=b?d.width/2:d.height/2,B=[1,-1].map(E=>b?{x:S.x+E*(M+4),y:S.y}:{x:S.x,y:S.y+E*(M+4)}).find(E=>{const O={x:E.x-d.width/2,y:E.y-d.height/2,width:d.width,height:d.height};return u.every($=>!Ai(O,$,4))});if(!B)return;T.x=B.x,T.y=B.y}const k=o(l),_=s.getCTM(),L=l.parentElement?.getCTM();if(!_||!L)return;const v=new DOMPoint(T.x,T.y).matrixTransform(_).matrixTransform(L.inverse());l.setAttribute("transform",`translate(${v.x-k.x-k.width/2}, ${v.y-k.y-k.height/2})`),l.dataset.finalPathCenter=`${T.x},${T.y}`})}function Et(e,t,r){return{x:e.x+e.width*t,y:e.y+e.height*r}}function v$(e,t,r,i,o=!1){const a=Math.min(...i.map(f=>f.x)),s=Math.max(...i.map(f=>f.x+f.width)),n=Math.min(...i.map(f=>f.y)),l=Et(t,.5,1),c=Et(r,.5,0);if(e===Be.userSendsMessage)return[l,c];if(e===Be.agentResponds){const f=Et(t,.28,1),g=Et(r,.28,0),p=f.y+(o?38:50);return[f,{x:f.x,y:p},{x:g.x,y:p},g]}if(e===Be.toolStarts){if(o){const y=Math.min(t.x+t.width,r.x+r.width)-16;return[{x:y,y:t.y+t.height},{x:y,y:r.y}]}const f=r.y>=t.y,g=Et(t,.64,f?1:0),p=Et(r,.5,f?0:1),m=(g.y+p.y)/2;return[g,{x:g.x,y:m},{x:p.x,y:m},p]}if(e===Be.toolCompletes){if(o){const x=Math.max(t.x,r.x);return[{x,y:t.y},{x,y:r.y+r.height}]}const f=r.y>=t.y,g=Et(t,.72,f?1:0),p=Et(r,.8,f?0:1),m=92,y=g.y+(f?m:-m);return[g,{x:g.x,y},{x:p.x,y},p]}if(e===Be.agentAsksUser){const f=Et(t,0,o?.75:.35),g=Et(r,0,o?.25:.35),p=Math.min(f.x,g.x)-(o?60:50);return[f,{x:p,y:f.y},{x:p,y:g.y},g]}if(e===Be.userReplies){const f=Et(t,1,.65),g=Et(r,1,o?.95:.65),p=Math.max(f.x,g.x)+(o?32:30);return[f,{x:p,y:f.y},{x:p,y:g.y},g]}if(e===Be.agentFinishes){const f=Et(t,1,.35),g=Et(r,1,.35),p=o?Math.max(f.x,g.x)+40:s+90;return[f,{x:p,y:f.y},{x:p,y:g.y},g]}if(e===Be.requestFails){const f=Et(t,0,o?.9:.25),g=Et(r,0,o?.75:.25),p=a-(o?88:40);return[f,{x:p,y:f.y},{x:p,y:g.y},g]}if(e===Be.streamFails){if(o){const y=Et(t,0,.25),x=Et(r,0,.25),b=a-60;return[y,{x:b,y:y.y},{x:b,y:x.y},x]}const f=Et(t,.5,0),g=Et(r,0,.5),p=a-80,m=n-40;return[f,{x:f.x,y:m},{x:p,y:m},{x:p,y:g.y},g]}if(o){const f=Et(t,0,.9),g=Et(r,0,.1),p=a-92;return[f,{x:p,y:f.y},{x:p,y:g.y},g]}const h=Et(t,1,.75),d=Et(r,0,.75),u=(h.x+d.x)/2;return[h,{x:u,y:h.y},{x:u,y:d.y},d]}function nr(e){return e.slice(1).map((t,r)=>({start:e[r],end:t}))}function vs(e,t){const r=Math.abs(e.start.y-e.end.y)<.001,i=Math.abs(t.start.y-t.end.y)<.001;return r!==i?!1:r?Math.abs(e.start.y-t.start.y)>=.001?!1:Math.min(e.start.x,e.end.x)<Math.max(t.start.x,t.end.x)-.001&&Math.min(t.start.x,t.end.x)<Math.max(e.start.x,e.end.x)-.001:Math.abs(e.start.x-t.start.x)>=.001?!1:Math.min(e.start.y,e.end.y)<Math.max(t.start.y,t.end.y)-.001&&Math.min(t.start.y,t.end.y)<Math.max(e.start.y,e.end.y)-.001}function M$(e,t,r=[],i){return nr(e).flatMap((o,a)=>{const s=Math.abs(o.start.y-o.end.y)<.001,n=Math.hypot(o.end.x-o.start.x,o.end.y-o.start.y),l=i?Fu(i,o.start,o.end):1,c=(s?t.width:t.height)+F1*2/l;return n>=c&&!r.some(h=>vs(o,h))?[{segment:o,index:a,horizontal:s,capacity:n,excess:n-c}]:[]}).sort((o,a)=>Number(a.horizontal)-Number(o.horizontal)||a.excess-o.excess)[0]}function T$(e,t){if(!t||t.direction!=="TB"||!e.id)return;const r=Object.entries(bp),i=new Set(["root_start",...Object.values(bp).flat()]);if(t.nodes.length!==i.size||new Set(t.nodes.map(d=>d.id)).size!==i.size||new Set(t.nodes.map(d=>d.domId)).size!==i.size||t.nodes.some(d=>!i.has(d.id)||!d.domId||d.isGroup||d.parentId||d.shape!==(d.id==="root_start"?"stateStart":"rect"))||t.edges.length!==r.length+1||new Set(t.edges.map(d=>d.id)).size!==t.edges.length||t.edges.filter(d=>d.start==="root_start"&&d.end==="Idle").length!==1)return;const o=[...e.querySelectorAll('.edgePaths path, path.transition[data-edge="true"]')],a=[...e.querySelectorAll(".edgeLabels > .edgeLabel")],s=[...e.querySelectorAll("g.node")];if(o.length!==t.edges.length||s.length!==t.nodes.length)return;const n=new Map;for(const d of o){const u=d.dataset.id;if(!u||n.has(u)||d.id!==`${e.id}-${u}`||!t.edges.some(f=>f.id===u))return;n.set(u,d)}const l=new Map;for(const d of a){const u=d.querySelector(":scope > .label[data-id]")?.getAttribute("data-id");if(!u||l.has(u)||!n.has(u))return;l.set(u,d)}const c=new Map;for(const d of t.nodes){const u=s.filter(f=>f.id===`${e.id}-${d.domId}`);if(u.length!==1)return;c.set(d.id,u[0])}const h=[];for(const[d,[u,f]]of r){const g=t.edges.filter(x=>x.start===u&&x.end===f);if(g.length!==1)return;const p=g[0],m=n.get(p.id),y=l.get(p.id);if(!m||!y)return;h.push({edge:p,path:m,label:y,kind:d})}return{paths:o,labels:a,nodesById:c,routes:h,diagram:t}}function B$(e,t=!1,r){if(!e.classList.contains("statediagram"))return;for(const b of e.querySelectorAll("g.statediagram-cluster")){const S=b.querySelector(":scope > g > rect.outer"),T=b.querySelector(":scope > rect.inner"),k=b.querySelector(":scope > .cluster-label");if(!S||!T||!k)continue;const _=rr(k,b),L=k.transform.baseVal.consolidate()?.matrix;if(!_||!L)continue;const v=S.y.baseVal.value+6;k.setAttribute("transform",`translate(${L.e},${L.f+v-_.y})`);const M=Math.max(T.y.baseVal.value,v+_.height+6);T.setAttribute("height",String(Math.max(0,T.height.baseVal.value-(M-T.y.baseVal.value)))),T.setAttribute("y",String(M));for(const B of e.querySelectorAll("path.transition[data-points]")){let E;try{E=JSON.parse(atob(B.dataset.points))}catch{continue}if(E.length<4)continue;const[O,$,I]=E,F=rr(S,B);if(!F||Math.abs(O.y-F.y)>.5||O.x<F.x||O.x>F.x+F.width||O.x!==$.x||$.y!==I.y||Math.abs($.x-I.x)>8||I.x<F.x+8||I.x>F.x+F.width-8)continue;E[0]={x:I.x,y:O.y},E.splice(1,1),E=_r(E);const R=Eu(E);B.setAttribute("d",R),B.dataset.terminalGapBasePath=R,B.dataset.manhattanPoints=E.map(({x:q,y:D})=>`${q},${D}`).join(" ")}}let i;try{i=T$(e,r??JSON.parse(e.dataset.stateRouteGraph??"null"))}catch{return}if(!i)return;const{paths:o,labels:a,nodesById:s,routes:n}=i,l=o[0];if(!l)return;const c=new Map,h=new Map;for(const[b,S]of s){const T=Je(S),k=T&&rr(T,l);if(!T||!k||!Object.values(k).every(Number.isFinite)||t&&!S.transform.baseVal.consolidate()?.matrix)return;c.set(b,k),h.set(b,{node:S,shape:T})}e.dataset.stateRouteGraph=JSON.stringify({direction:i.diagram.direction,nodes:i.diagram.nodes.map(({id:b,domId:S,shape:T})=>({id:b,domId:S,shape:T})),edges:i.diagram.edges.map(({id:b,start:S,end:T})=>({id:b,start:S,end:T}))});for(const b of[...o,...a])b.style.setProperty("transition-property","none","important");if(t){const b=c.get("Idle");if(!b)return;const S=b.x+b.width/2;[{name:"Starting",centerOffset:0,yOffset:138},{name:"Streaming",centerOffset:0,yOffset:258},{name:"RunningTool",centerOffset:0,yOffset:396},{name:"NeedsInput",centerOffset:0,yOffset:578},{name:"Complete",centerOffset:0,yOffset:738},{name:"Failed",centerOffset:0,yOffset:898}].forEach(({name:k,centerOffset:_,yOffset:L})=>{const v=h.get(k),M=c.get(k),B=v?.node.transform.baseVal.consolidate()?.matrix;if(!v||!M||!B)return;const E={x:S+_-M.width/2,y:b.y+L};v.node.style.setProperty("transition-property","none","important"),v.node.setAttribute("transform",`translate(${B.e+E.x-M.x}, ${B.f+E.y-M.y})`),c.set(k,{...M,...E})})}const d=[...c].flatMap(([b,S])=>b==="root_start"?[]:[S]),u=[],f=[],g=[];n.forEach(({edge:b,path:S,label:T,kind:k})=>{T.dataset.routePathId=S.id,S.dataset.routeLabel=k;const _=c.get(b.start),L=c.get(b.end);if(!_||!L)return;const v=_r(v$(k,_,L,d,t)),M=v[1]?Fu(S,v[0],v[1]):1,B=R3(v,d.filter(F=>F!==_&&F!==L),Au/M,f);g.push(...B);const E=T.getBBox(),O=k===Be.agentFinishes?B.slice(1,3):B,$=M$(O,E,u,S)??O.slice(0,-1).map((F,R)=>{const q=O[R+1];return{segment:{start:F,end:q},capacity:Math.hypot(q.x-F.x,q.y-F.y)}}).sort((F,R)=>R.capacity-F.capacity)[0];if(!$)return;S.setAttribute("d",B.map((F,R)=>`${R?"L":"M"}${F.x},${F.y}`).join(""));const I=k===Be.toolStarts&&B[1]&&B[2]?{start:B[1],end:B[2]}:k===Be.agentAsksUser&&B[1]&&B[2]?{start:B[1],end:B[2]}:k===Be.agentFinishes&&B[1]&&B[2]?{start:B[1],end:B[2]}:!t&&k===Be.userReplies&&B[1]&&B[2]?{start:B[1],end:B[2]}:k===Be.requestFails&&B[1]&&B[2]?{start:B[1],end:B[2]}:t&&k===Be.userRetries&&B[2]&&B[3]?{start:B[2],end:B[3]}:$.segment;S.dataset.routeLabel=k,S.dataset.labelSegment=`${I.start.x},${I.start.y} ${I.end.x},${I.end.y}`,S.dataset.labelCapacity=String(Math.hypot(I.end.x-I.start.x,I.end.y-I.start.y)),S.dataset.manhattanSegments=String(B.length-1),S.dataset.manhattanPoints=B.map(F=>`${F.x},${F.y}`).join(" "),S.dataset.terminalTarget=h.get(b.end)?.node.id??b.end,T.dataset.routePathId=S.id,u.push(I),f.push(...nr(B))});const p=Math.min(...d.map(b=>b.x),...g.map(b=>b.x)),m=Math.min(2,...d.map(b=>b.y),...g.map(b=>b.y)),y=Math.max(...d.map(b=>b.x+b.width),...g.map(b=>b.x)),x=Math.max(...d.map(b=>b.y+b.height),...g.map(b=>b.y));return{x:p,y:m,width:y-p,height:x-m}}function _$(e,t,r,i,o=8){if(e.length<2)return e;const a=i.map(({start:f,end:g})=>({x:Math.min(f.x,g.x),y:Math.min(f.y,g.y),width:Math.abs(g.x-f.x),height:Math.abs(g.y-f.y)})),s=f=>nr(f).every(g=>!Br(g,t)&&[...r,...a].every(p=>!Br(g,p,o)));if(s(e))return e;const n=e[0],l=Fa(n,e[1]),c={...n},h=o*2;l==="top"&&(c.y-=h),l==="bottom"&&(c.y+=h),l==="left"&&(c.x-=h),l==="right"&&(c.x+=h);const d=[{point:Et(t,.5,0),dx:0,dy:-h},{point:Et(t,1,.5),dx:h,dy:0},{point:Et(t,.5,1),dx:0,dy:h},{point:Et(t,0,.5),dx:-h,dy:0}].flatMap(({point:f,dx:g,dy:p})=>{const m={x:f.x+g,y:f.y+p};return[[n,c,{x:c.x,y:m.y},m,f],[n,c,{x:m.x,y:c.y},m,f]].map(_r).filter(y=>{const x=y[1],b=y.at(-2);return(x.x-n.x)*(c.x-n.x)+(x.y-n.y)*(c.y-n.y)>0&&(b.x-f.x)*g+(b.y-f.y)*p>0&&s(y)})}),u=f=>nr(f).reduce((g,{start:p,end:m})=>g+Math.hypot(m.x-p.x,m.y-p.y),0);return d.toSorted((f,g)=>u(f)-u(g))[0]??e}function L$(e){if(!e.classList.contains("statediagram"))return;const t=[...e.querySelectorAll('.edgePaths path, path.transition[data-edge="true"]')],r=t[0];if(!r)return;const i=[...e.querySelectorAll("g.node")].flatMap(a=>{const s=Je(a),n=s&&rr(s,r);return s&&n?[{node:a,shape:s,bounds:n}]:[]}),o=t.flatMap(a=>{let s;try{s=a.dataset.manhattanPoints?a.dataset.manhattanPoints.split(" ").map(l=>{const[c,h]=l.split(",").map(Number);return{x:c,y:h}}):JSON.parse(atob(a.dataset.points??""))}catch{return[]}if(!Array.isArray(s)||s.length<2||s.some(l=>!l||!Number.isFinite(l.x)||!Number.isFinite(l.y)))return[];const n=l=>i.toSorted((c,h)=>lo(l,c.bounds)-lo(l,h.bounds))[0];return[{path:a,points:s,source:n(s[0]),target:n(s.at(-1))}]});for(const a of o){const{path:s,points:n,source:l,target:c}=a;if(!l||!c||l===c||l.shape.tagName!=="circle"||c.shape.tagName!=="rect"||o.some(p=>p.target===l))continue;const h=[...e.querySelectorAll(".edgeLabels > .edgeLabel")].flatMap(p=>{if(!p.textContent?.trim())return[];const m=kr(p,s);return m?[m]:[]}),d=_$(n,c.bounds,[...i.filter(p=>p!==l&&p!==c).map(p=>p.bounds),...h],o.filter(p=>p!==a).flatMap(p=>nr(p.points)));if(d===n)continue;const u=Eu(d);s.setAttribute("d",u),s.dataset.terminalGapBasePath=u,s.dataset.manhattanPoints=d.map(({x:p,y:m})=>`${p},${m}`).join(" "),s.dataset.manhattanSegments=String(d.length-1),s.dataset.terminalTarget=c.node.id;const f=d.at(-1),g=d.at(-2);s.dataset.terminalDirection=`${f.x-g.x},${f.y-g.y}`,a.points=d}}function A$(e){const t=[...e.querySelectorAll('.edgePaths path, path.transition[data-edge="true"]')],r=[...e.querySelectorAll(".edgeLabels > .edgeLabel")],i=t[0];if(!i)return;const o=[...e.querySelectorAll("g.node")].flatMap(s=>{const n=Je(s),l=n&&rr(n,i);if(!n||!l)return[];const c=getComputedStyle(n);return[{...l,corner:{x:Math.min(l.width/2,Number.parseFloat(c.rx)||0),y:Math.min(l.height/2,Number.parseFloat(c.ry)||0)}}]}),a=t.flatMap(s=>{const n=(s.dataset.manhattanPoints??"").split(" ").map(c=>{const[h,d]=c.split(",").map(Number);return{x:h,y:d}});if(n.length<2||n.some(({x:c,y:h})=>!Number.isFinite(c)||!Number.isFinite(h)))return[];const l=c=>o.toSorted((h,d)=>lo(c,h)-lo(c,d))[0];return[{path:s,points:n,source:l(n[0]),target:l(n.at(-1))}]});for(const s of a){const{path:n,points:l,source:c,target:h}=s;if(!c||!h||h.y<=c.y||l[1].y>=Math.min(c.y,h.y)-Math.max(c.height,h.height))continue;const d=r.find(v=>v.dataset.routePathId===n.id),u=d&&kr(d,n);if(!d||!u)continue;const f=a.filter(v=>v!==s),g=f.flatMap(v=>nr(v.points)),p=o.filter(v=>v!==c&&v!==h),m=r.filter(v=>v!==d).flatMap(v=>{const M=kr(v,n);return M?[M]:[]}),y=v=>f.flatMap(M=>[...M.source===v?[M.points[0]]:[],...M.target===v?[M.points.at(-1)]:[]]),x=I1(l,c,h,[...p,...m],g,y(c),y(h),{bounds:u,obstacles:m,occupied:g},!1,!0);if(x===l)continue;const b=$n(x,u,[...o,...m],g);if(!b)continue;s.points=x,n.setAttribute("d",x.map(({x:v,y:M},B)=>`${B?"L":"M"}${v},${M}`).join("")),n.dataset.manhattanPoints=x.map(({x:v,y:M})=>`${v},${M}`).join(" "),n.dataset.manhattanSegments=String(x.length-1),n.dataset.labelSegment=`${b.start.x},${b.start.y} ${b.end.x},${b.end.y}`;const S=x.at(-1),T=x.at(-2);n.dataset.terminalDirection=`${S.x-T.x},${S.y-T.y}`,delete n.dataset.terminalGapBasePath;const k=d.getBBox(),_=d.parentElement?.getCTM(),L=n.getCTM();if(_&&L){const v=new DOMPoint(b.center.x,b.center.y).matrixTransform(L).matrixTransform(_.inverse());d.setAttribute("transform",`translate(${v.x-k.x-k.width/2},${v.y-k.y-k.height/2})`),d.dataset.finalPathCenter=`${b.center.x},${b.center.y}`}}}function F$(e,t){if(e.nativeId){const i=t.flatMap((o,a)=>o.nativeId===e.nativeId?[a]:[]);if(i.length)return i.length===1?i[0]:null}if(e.routePathId){const i=t.flatMap((o,a)=>o.id===e.routePathId?[a]:[]);if(i.length)return i.length===1?i[0]:null}const r=t.flatMap((i,o)=>i.intersectsLabel?[o]:[]);return r.length===1?r[0]:null}function $$(e,t){const r=kr(t,e),i=e.getTotalLength();if(!r||!i)return!1;const o=Math.max(1,Math.min(r.width,r.height)/4),a=Math.max(16,Math.min(2048,Math.ceil(i/o)));return Array.from({length:a+1},(s,n)=>e.getPointAtLength(i*n/a)).some(s=>lo(s,r)<=.5)}function E$(e){if(!e.classList.contains("statediagram"))return;const t=[...e.querySelectorAll('.edgePaths path, path.transition[data-edge="true"]')],r=[...e.querySelectorAll(".edgeLabels > .edgeLabel")],i=new Set;r.forEach(o=>{if(o.textContent?.replace(/\s+/g," ").trim().toLowerCase()!=="fail")return;const a=o.querySelector(":scope > .label[data-id]")?.getAttribute("data-id"),s=F$({nativeId:a??void 0,routePathId:o.dataset.routePathId},t.map(L=>({id:L.id,nativeId:L.dataset.id,intersectsLabel:$$(L,o)}))),n=s===null?void 0:t[s];if(!n||i.has(n))return;const l=n.getTotalLength();if(!l)return;const c=n.getPointAtLength(0),h=n.getPointAtLength(l),d=[...e.querySelectorAll("g.node")].flatMap(L=>{const v=Je(L),M=v&&rr(v,n);return v&&M?[{node:L,shape:v,bounds:M}]:[]}),u=d.toSorted((L,v)=>lo(c,L.bounds)-lo(c,v.bounds))[0],f=d.toSorted((L,v)=>lo(h,L.bounds)-lo(h,v.bounds))[0];if(!u||!f||u===f||f.bounds.y>=u.bounds.y)return;const g=Math.max(u.bounds.x,f.bounds.x),p=Math.min(u.bounds.x+u.bounds.width,f.bounds.x+f.bounds.width);if(p<=g)return;const m=g+(p-g)*.75,y=getComputedStyle(u.shape),x=Math.min(u.bounds.width/2,Number.parseFloat(y.rx)||0),b=Math.min(u.bounds.height/2,Number.parseFloat(y.ry)||0),S=Math.max(u.bounds.x+x-m,m-(u.bounds.x+u.bounds.width-x),0),T=x>0?b*(1-Math.sqrt(Math.max(0,1-(S/x)**2))):0,k=[{x:m,y:u.bounds.y+T},{x:m,y:f.bounds.y+f.bounds.height}],_=`M${k[0].x},${k[0].y}L${k[1].x},${k[1].y}`;n.setAttribute("d",_),n.dataset.terminalGapBasePath=_,n.dataset.manhattanPoints=k.map(L=>`${L.x},${L.y}`).join(" "),n.dataset.manhattanSegments="1",n.dataset.labelSegment=`${k[0].x},${k[0].y} ${k[1].x},${k[1].y}`,n.dataset.routeLabel="fail",n.dataset.terminalTarget=f.node.id,n.dataset.terminalDirection="0,-1",o.dataset.routePathId=n.id,i.add(n)})}function P$(e,t=!1){if(!e.classList.contains("statediagram"))return null;const r=[],i=[...e.querySelectorAll("g.node")].flatMap(d=>{const u=d.transform.baseVal.consolidate()?.matrix,f=d.getBBox();return u?[{x:f.x+u.e,y:f.y+u.f,width:f.width,height:f.height}]:[]}),o=[...e.querySelectorAll('.edgePaths path, path.transition[data-edge="true"]')].map(d=>{const u=(d.dataset.manhattanPoints??"").split(" ").map(f=>f.split(",").map(Number)).filter(f=>f.length===2&&f.every(Number.isFinite)).map(([f,g])=>({x:f,y:g}));return{path:d,segments:u.slice(1).map((f,g)=>({start:u[g],end:f}))}}),a=(d,u,f=4)=>d.x<u.x+u.width+f&&d.x+d.width+f>u.x&&d.y<u.y+u.height+f&&d.y+d.height+f>u.y,s=(d,u)=>{if(Math.abs(d.start.x-d.end.x)<.5){const p=Math.min(d.start.y,d.end.y),m=Math.max(d.start.y,d.end.y);return d.start.x>u.x-3&&d.start.x<u.x+u.width+3&&m>u.y-3&&p<u.y+u.height+3}const f=Math.min(d.start.x,d.end.x),g=Math.max(d.start.x,d.end.x);return d.start.y>u.y-3&&d.start.y<u.y+u.height+3&&g>u.x-3&&f<u.x+u.width+3};for(const d of e.querySelectorAll(".edgeLabels > .edgeLabel")){const u=d.dataset.routePathId,f=u?e.querySelector(`#${CSS.escape(u)}`):null,g=f?.dataset.labelSegment?.match(/-?(?:\d+(?:\.\d*)?|\.\d+)/g)?.map(Number);if(!f||!g||g.length!==4)continue;const p=d.getBBox(),m=t?f.dataset.routeLabel===Be.requestFails?[.03]:[.5,.25,.75,.15,.35,.65,.85]:[.5,.25,.75],y=o.find($=>$.path===f)?.segments??[],x=t&&f.dataset.routeLabel===Be.userRetries?y.findLast($=>Math.abs($.start.y-$.end.y)<.5&&Math.abs($.start.x-$.end.x)>=p.width):void 0,b=t&&(f.dataset.routeLabel===Be.agentAsksUser||f.dataset.routeLabel===Be.toolStarts||f.dataset.routeLabel===Be.requestFails||f.dataset.routeLabel===Be.userRetries)||!t&&(f.dataset.routeLabel===Be.agentAsksUser||f.dataset.routeLabel===Be.agentFinishes||f.dataset.routeLabel===Be.toolStarts||f.dataset.routeLabel===Be.userReplies||f.dataset.routeLabel===Be.requestFails),T=[x?{x1:x.start.x,y1:x.start.y,x2:x.end.x,y2:x.end.y}:{x1:g[0],y1:g[1],x2:g[2],y2:g[3]},...b?[]:y.map(({start:$,end:I})=>({x1:$.x,y1:$.y,x2:I.x,y2:I.y}))].filter(($,I,F)=>F.findIndex(R=>R.x1===$.x1&&R.y1===$.y1&&R.x2===$.x2&&R.y2===$.y2)===I).flatMap($=>{const I={start:{x:$.x1,y:$.y1},end:{x:$.x2,y:$.y2}},F=Math.hypot(I.end.x-I.start.x,I.end.y-I.start.y),q=(Math.abs(I.start.y-I.end.y)<.5?p.width:p.height)/2,D=F1/Fu(f,I.start,I.end);return m.filter(P=>F*Math.max(P,1-P)>=q+D).map(P=>{const Y={x:$.x1+($.x2-$.x1)*P,y:$.y1+($.y2-$.y1)*P};if(t&&Math.abs($.x1-$.x2)<.5&&(f.dataset.routeLabel===Be.userReplies||f.dataset.routeLabel===Be.agentFinishes)&&(Y.x-=p.width/2-(f.dataset.routeLabel===Be.userReplies?0:6)),t&&Math.abs($.x1-$.x2)<.5&&f.dataset.routeLabel===Be.agentResponds&&(Y.y+=6),Math.abs($.x1-$.x2)<.5&&(t&&(f.dataset.routeLabel===Be.agentAsksUser||f.dataset.routeLabel===Be.requestFails||f.dataset.routeLabel===Be.streamFails)||!t&&f.dataset.routeLabel===Be.requestFails)){const K=f.dataset.routeLabel===Be.agentAsksUser?0:f.dataset.routeLabel===Be.streamFails?-26:0;Y.x+=p.width/2+K}t&&Math.abs($.y1-$.y2)<.5&&f.dataset.routeLabel===Be.userRetries&&(Y.x+=12,Y.y-=p.height/2-4),!t&&Math.abs($.x1-$.x2)<.5&&f.dataset.routeLabel===Be.toolCompletes&&(Y.x+=p.width/2-6);const Q={x:Y.x-p.width/2,y:Y.y-p.height/2,width:p.width,height:p.height},rt=r.filter(K=>a(Q,K)).length,ht=i.filter(K=>a(Q,K,5)).length,H=o.filter(K=>K.path!==f).flatMap(K=>K.segments).filter(K=>s(K,Q)).length,G=F*Math.min(P,1-P);return{midpoint:Y,bounds:Q,score:rt*1e4+ht*1e4+H*1e3+(G<q+D?100:0)+Math.abs(P-.5)}})});if(T.length===0)continue;const k=T;k.sort(($,I)=>{const F=Math.floor($.score/1e3)-Math.floor(I.score/1e3);if(F!==0)return F;if(t&&f.dataset.routeLabel===Be.toolStarts){const R=g[1]+(g[3]-g[1])*.65;return Math.abs($.midpoint.y-R)-Math.abs(I.midpoint.y-R)}if(t&&f.dataset.routeLabel===Be.agentAsksUser){const R=g[1]+(g[3]-g[1])*.65;return Math.abs($.midpoint.y-R)-Math.abs(I.midpoint.y-R)}if(t&&f.dataset.routeLabel===Be.requestFails){const R=g[1]+(g[3]-g[1])*.04;return Math.abs($.midpoint.y-R)-Math.abs(I.midpoint.y-R)}if(!t&&f.dataset.routeLabel===Be.agentAsksUser)return $.midpoint.x-I.midpoint.x;if(!t&&f.dataset.routeLabel===Be.agentFinishes){const R=(g[0]+g[2])/2;return Math.abs($.midpoint.x-R)-Math.abs(I.midpoint.x-R)}return!t&&f.dataset.routeLabel===Be.toolStarts?I.midpoint.y-$.midpoint.y:!t&&f.dataset.routeLabel===Be.userReplies?I.midpoint.x-$.midpoint.x:$.score-I.score});const _=k[0].midpoint,L={x:_.x-p.width/2,y:_.y-p.height/2,width:p.width,height:p.height},v=f.getCTM(),M=d.parentElement?.getCTM(),B=v&&M?new DOMPoint(_.x,_.y).matrixTransform(v).matrixTransform(M.inverse()):_,E=B.x-(p.x+p.width/2),O=B.y-(p.y+p.height/2);d.setAttribute("transform",`translate(${E}, ${O})`),d.dataset.finalPathCenter=`${_.x},${_.y}`,r.push(L)}if(A$(e),!r.length)return null;const n=Math.min(...r.map(d=>d.x)),l=Math.min(...r.map(d=>d.y)),c=Math.max(...r.map(d=>d.x+d.width)),h=Math.max(...r.map(d=>d.y+d.height));return{x:n,y:l,width:c-n,height:h-l}}var I$=ar('<div class="mermaid-error svelte-9cn23y"><div class="error-feedback svelte-9cn23y" role="alert"><strong class="svelte-9cn23y"> </strong> <p class="svelte-9cn23y"> </p></div> <details class="error-details svelte-9cn23y"><summary class="svelte-9cn23y"> </summary> <pre class="error-message svelte-9cn23y"> </pre> <strong class="svelte-9cn23y"> </strong> <pre class="error-source-code svelte-9cn23y"> </pre></details></div>'),O$=ar('<div role="toolbar"><!> <!> <!></div>'),D$=ar('<div class="mermaid-source svelte-9cn23y" role="region"><pre class="svelte-9cn23y"> </pre></div>'),R$=ar('<div class="mermaid-svg-container svelte-9cn23y"><div><div class="mermaid-svg mermaid-presentation svelte-9cn23y"></div></div> <!></div> <!>',1),N$=ar('<div class="mermaid-empty svelte-9cn23y" role="status"><strong class="svelte-9cn23y"> </strong> <span class="svelte-9cn23y"> </span></div>'),q$=ar('<div class="mermaid-loading svelte-9cn23y" role="status"> </div>'),W$=ar('<div class="fullscreen-diagram mermaid-presentation svelte-9cn23y" style="--mermaid-font-family: var(--font-ui)"></div>'),z$=ar('<div class="fullscreen-surface h-[90vh] w-[90vw] overflow-hidden rounded-lg shadow-2xl svelte-9cn23y" data-media-lightbox-content=""><!></div>'),H$=ar('<div style="--mermaid-font-family: var(--font-ui)"><span class="mermaid-actor-icon-template svelte-9cn23y" aria-hidden="true"><!></span> <!></div> <!>',1);function Y$(e,t){if(new.target)return Oo({component:Y$,...e});No(t,!0);const r=mC("MermaidRenderer"),i=12,o=16,a=["--background","--foreground","--card","--card-foreground","--muted","--muted-foreground","--border","--accent","--accent-foreground","--diagram-canvas","--diagram-node-surface","--diagram-connector","--font-ui","--text-caption-size","--radius-small"],s={streamFails:"Stream fails"};let n=He(t,"code",7),l=He(t,"isStreaming",7,!1),c=He(t,"className",7,""),h=He(t,"showExpandButton",7,!0),d=He(t,"showSourceButton",7,!0),u=He(t,"showExportButton",7,!1),f=He(t,"showSource",15,!1),g=He(t,"onRenderStateChange",7),p=ce(""),m=ce(null),y=ce(!1),x=ce(!1),b=ce(""),S=ce(null),T=ce(void 0),k=ce(void 0),_=ce(void 0),L=ce(void 0),v,M=ce(0),B=ce(!1),E=ce(!1),O=0,$=ce(0),I=0,F=ce(0),R=Dt(()=>z(P(n())));const q=yC(xC);function D(){const at=getComputedStyle(document.documentElement);return[at.fontSize,...a.map(ut=>at.getPropertyValue(ut).trim())].join("\0")}function P(at){try{return/^[A-Za-z0-9+/=]+$/.test(at.trim())?decodeURIComponent(escape(atob(at))):at}catch{return at}}function Y(at){return!/^\s*stateDiagram(?:-v2)?\b/m.test(at)||/^\s*direction\s+(?:LR|RL|TB|BT)\b/m.test(at)?at:at.replace(/^(\s*stateDiagram(?:-v2)?\b[^\n]*)/m,`$1
316
316
  direction TB`)}function X(at){return!A(B)||!A(E)||!/^\s*sequenceDiagram\b/m.test(at)?at:`---
317
317
  config:
318
318
  sequence:
@@ -326,10 +326,10 @@ config:
326
326
  ${at}`}function z(at){return at.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&#x27;/g,"'").replace(/&#x2F;/g,"/")}const U=12,j=10,V=6;function Q(at){const ut=at.transform.baseVal.consolidate()?.matrix;return ut?{x:ut.e,y:ut.f}:null}function rt(at){const ut=document.createTreeWalker(at,NodeFilter.SHOW_TEXT),Ct=[];for(;ut.nextNode();){if(!ut.currentNode.textContent?.trim())continue;const $t=document.createRange();$t.selectNodeContents(ut.currentNode),Ct.push(...Array.from($t.getClientRects()))}if(!Ct.length)return null;const Ft=Math.min(...Ct.map($t=>$t.left)),wt=Math.min(...Ct.map($t=>$t.top)),Z=Math.max(...Ct.map($t=>$t.right)),St=Math.max(...Ct.map($t=>$t.bottom));return new DOMRect(Ft,wt,Z-Ft,St-wt)}function ht(at){if(at.getAttribute("aria-roledescription")==="flowchart-v2")for(const ut of at.querySelectorAll("g.node .nodeLabel > p, g.cluster .nodeLabel > p")){if(ut.dataset.semanticBreaks==="true")continue;const Ct=ut.cloneNode(!0);Ct.querySelectorAll("br").forEach(wt=>wt.replaceWith(`
327
327
  `));const Ft=Ct.textContent?.replace(/[^\S\n]+/g," ").trim();if(Ft){ut.replaceChildren();for(const wt of pc(Ft))ut.append(document.createTextNode(wt.text)),wt.hardBreak?ut.append(document.createElement("br")):wt.breakAfter&&ut.append(document.createElement("wbr"));ut.dataset.semanticBreaks="true"}}}function H(at){for(const ut of at.querySelectorAll("g.edgeLabel"))ut.textContent?.trim()||(ut.style.display="none")}function G(at){if(at.getAttribute("aria-roledescription")==="flowchart-v2")for(const ut of at.querySelectorAll("g.node")){const Ct=ut.querySelector(":scope > .label"),Ft=Ct?.querySelector("foreignObject"),wt=Ft?.firstElementChild,Z=ut.querySelector(":scope > .label-container, :scope > .outer-path, :scope > .basic.label-container");if(!Ct||!Ft||!(wt instanceof HTMLElement)||!Z)continue;const St=Number.parseFloat(Ft.getAttribute("height")??"0"),$t=rt(Ct),Wt=Ct.getScreenCTM(),Ht=Wt&&Math.hypot(Wt.c,Wt.d)||1,Vt=Math.max(wt.scrollHeight,$t?$t.height/Ht:0);if(Vt>St+.5){const ie=Math.ceil(Vt+1);Ft.setAttribute("height",String(ie));const Ie=Q(Ct);if(Ie&&Ct.setAttribute("transform",`translate(${Ie.x}, ${-ie/2})`),Z instanceof SVGRectElement){const ve=Math.max(0,(Number(Z.getAttribute("height"))-St)/2);Z.setAttribute("y",String(-ie/2-ve)),Z.setAttribute("height",String(ie+ve*2))}}const de=Z.getBoundingClientRect(),Me=rt(Ct),zt=Q(Ct),Fe=Ct.getScreenCTM();if(!Me||!zt||!Fe)continue;const Ze=Math.hypot(Fe.a,Fe.b)||1,Le=Math.hypot(Fe.c,Fe.d)||1,ne=Me.x+Me.width/2-(de.x+de.width/2),It=Me.y+Me.height/2-(de.y+de.height/2);Ct.setAttribute("transform",`translate(${zt.x-ne/Ze}, ${zt.y-It/Le})`)}}function K(at){if(at.classList.contains("statediagram"))for(const ut of at.querySelectorAll("g.statediagram-state")){const Ct=ut.querySelector(":scope > rect.basic.label-container"),Ft=ut.querySelector(":scope > g.label");if(!Ct||!Ft||!ut.textContent?.trim())continue;const wt=Ct.getBoundingClientRect(),Z=rt(Ft),St=Q(Ft),$t=Ft.getScreenCTM();if(!Z||!St||!$t)continue;const Wt=Math.hypot($t.a,$t.b)||1,Ht=Z.x+Z.width/2-(wt.x+wt.width/2);Ft.setAttribute("transform",`translate(${St.x-Ht/Wt}, ${St.y})`)}}function tt(at){for(const ut of at.querySelectorAll("foreignObject:has(span.edgeLabel)")){if(ut.dataset.labelPadded==="true")continue;const Ct=ut.x.baseVal.value,Ft=ut.y.baseVal.value,wt=ut.width.baseVal.value,Z=ut.height.baseVal.value,St=ut.querySelector("span.edgeLabel");if(!St?.textContent?.trim())continue;const $t=St?.textContent?.trim()===s.streamFails;$t&&St&&(St.style.display="inline-block",St.style.width="40px",St.style.whiteSpace="normal");const Wt=$t?52:wt+12;ut.setAttribute("x",String(Ct+wt/2-Wt/2)),ut.setAttribute("y",String(Ft-4)),ut.setAttribute("width",String(Wt)),ut.setAttribute("height",String($t?Math.max(44,Z+8):Z+8)),ut.classList.add("edge-label-surface"),ut.dataset.labelPaddingX="6",ut.dataset.labelPaddingY="4",ut.dataset.labelPadded="true"}for(const ut of at.querySelectorAll(".edgeLabel rect.background:not([data-label-padded])")){const Ct=Number(ut.getAttribute("x")),Ft=Number(ut.getAttribute("y")),wt=Number(ut.getAttribute("width")),Z=Number(ut.getAttribute("height"));[Ct,Ft,wt,Z].every(Number.isFinite)&&(ut.setAttribute("x",String(Ct-6)),ut.setAttribute("y",String(Ft-5)),ut.setAttribute("width",String(wt+12)),ut.setAttribute("height",String(Z+10)),ut.setAttribute("rx","2"),ut.dataset.labelPaddingX="6",ut.dataset.labelPaddingY="5",ut.dataset.labelPadded="true")}}function ot(at){const ut=[...at.querySelectorAll(".edgeLabel rect.background[data-label-padded], .edge-label-knockout")];if(ut.length===0)return;const Ct=ut.map(Z=>[Z.getAttribute("x"),Z.getAttribute("y"),Z.getAttribute("width"),Z.getAttribute("height"),Z.dataset.labelPaddingX??"6",Z.dataset.labelPaddingY??"4"].join(",")).join(";"),Ft=at.querySelector(":scope > defs.edge-label-feather-defs");if(Ft?.dataset.signature===Ct&&ut.every(Z=>Z.hasAttribute("mask")))return;Ft?.remove();const wt=document.createElementNS("http://www.w3.org/2000/svg","defs");wt.classList.add("edge-label-feather-defs"),wt.dataset.signature=Ct,at.prepend(wt),ut.forEach((Z,St)=>{const $t=Number(Z.getAttribute("width")),Wt=Number(Z.getAttribute("height")),Ht=Number(Z.dataset.labelPaddingX??6),Vt=Number(Z.dataset.labelPaddingY??4);if(!Number.isFinite($t)||!Number.isFinite(Wt)||$t<=0||Wt<=0)return;const de=`${at.id||"mermaid"}-edge-label-feather-${St}`,Me=`${de}-blur`,zt=`${de}-mask`,Fe=Number(Z.getAttribute("x")??0),Ze=Number(Z.getAttribute("y")??0),Le=document.createElementNS("http://www.w3.org/2000/svg","filter");Le.id=Me,Le.setAttribute("filterUnits","userSpaceOnUse"),Le.setAttribute("x",String(Fe)),Le.setAttribute("y",String(Ze)),Le.setAttribute("width",String($t)),Le.setAttribute("height",String(Wt));const ne=document.createElementNS("http://www.w3.org/2000/svg","feGaussianBlur");ne.setAttribute("stdDeviation",`${Ht/6} ${Vt/6}`),Le.append(ne),wt.append(Le);const It=document.createElementNS("http://www.w3.org/2000/svg","mask");It.id=zt,It.setAttribute("maskContentUnits","userSpaceOnUse"),It.setAttribute("maskUnits","userSpaceOnUse"),It.setAttribute("mask-type","alpha"),It.setAttribute("x",String(Fe)),It.setAttribute("y",String(Ze)),It.setAttribute("width",String($t)),It.setAttribute("height",String(Wt));const ie=document.createElementNS("http://www.w3.org/2000/svg","rect");ie.setAttribute("x",String(Fe+Ht/2)),ie.setAttribute("y",String(Ze+Vt/2)),ie.setAttribute("width",String(Math.max(0,$t-Ht))),ie.setAttribute("height",String(Math.max(0,Wt-Vt))),ie.setAttribute("fill","hsl(var(--foreground))"),ie.setAttribute("filter",`url(#${Me})`),It.append(ie),wt.append(It),Z.setAttribute("mask",`url(#${zt})`),Z.dataset.labelFeathered="true"})}function vt(at){const Ct=document.createElement("canvas").getContext("2d");if(Ct)for(const Ft of at.querySelectorAll("span.edgeLabel")){const wt=Ft.querySelector("p");if(!wt)continue;const Z=getComputedStyle(wt);Ct.font=Z.font;const St=wt.innerText.split(`
328
328
  `).filter(Fe=>Fe.length>0);if(St.length===0)continue;const $t=Ct.measureText(St[0]),Wt=Ct.measureText(St.at(-1)),Ht=$t.fontBoundingBoxAscent||$t.actualBoundingBoxAscent,Vt=Wt.fontBoundingBoxDescent||Wt.actualBoundingBoxDescent,de=Ht-$t.actualBoundingBoxAscent,Me=Vt-Wt.actualBoundingBoxDescent,zt=(Me-de)/2;wt.style.transform=`translateY(${zt}px)`,Ft.dataset.opticalTopGap=String(3+de+zt),Ft.dataset.opticalBottomGap=String(3+Me-zt)}}function Ot(at){for(const ut of at.querySelectorAll("g.edgeLabel[data-route-path-id]")){const Ct=ut.dataset.finalPathCenter?.split(",").map(Number),wt=(ut.dataset.routePathId?at.querySelector(`#${CSS.escape(ut.dataset.routePathId)}`):null)?.getCTM(),Z=ut.parentElement?.getCTM();if(!Ct||Ct.length!==2||!wt||!Z)continue;const St=new DOMPoint(Ct[0],Ct[1]).matrixTransform(wt).matrixTransform(Z.inverse()),$t=ut.getBBox();ut.setAttribute("transform",`translate(${St.x-($t.x+$t.width/2)}, ${St.y-($t.y+$t.height/2)})`)}}function Pt(at){for(const ut of at.querySelectorAll("g.cluster")){const Ct=ut.querySelector(":scope > rect"),Ft=ut.querySelector(":scope > g.cluster-label"),wt=Ft?.querySelector("foreignObject");if(!Ct||!Ft||!wt)continue;const Z=Number(Ct.getAttribute("x")),St=Number(Ct.getAttribute("y")),$t=Number(Ct.getAttribute("width")),Wt=Number(Ct.getAttribute("height"));if(![Z,St,$t,Wt].every(Number.isFinite))continue;wt.setAttribute("x","0"),wt.setAttribute("y","0"),wt.setAttribute("width",String(Math.max(24,$t-40)));const Ht=wt.querySelector("div"),Vt=Math.ceil(Math.max(Ht?.getBoundingClientRect().height??0,Ht?.scrollHeight??0,18)),de=xn(Vt),Me=Number(ut.dataset.headerHeight)||de,zt=Math.max(0,de-Me),Fe=St-zt;wt.setAttribute("height",String(Vt)),Ct.setAttribute("y",String(Fe)),Ct.setAttribute("height",String(Wt+zt)),ut.dataset.headerHeight=String(Math.max(Me,de)),Ft.setAttribute("transform",`translate(${Z+20}, ${Fe+20})`)}}function Mt(at){if(at.getAttribute("aria-roledescription")!=="sequence")return;const ut=A(_)?.querySelector("svg");if(ut)for(const Ct of at.querySelectorAll("g.actor-man")){const Ft=Ct.querySelector(":scope > circle"),wt=Ct.querySelector(":scope > text.actor-man");if(!Ft||!wt)continue;const Z=Number(Ft.getAttribute("cx")),St=Number(Ft.getAttribute("cy"))-10,$t=wt.getBBox().height;Ct.querySelectorAll(":scope > line, :scope > circle").forEach(Ht=>Ht.remove());const Wt=ut.cloneNode(!0);Wt.classList.add("mermaid-actor-user-icon"),Wt.setAttribute("x",String(Z-15)),Wt.setAttribute("y",String(St+1)),Wt.setAttribute("width","30"),Wt.setAttribute("height","30"),Wt.setAttribute("aria-hidden","true"),Wt.setAttribute("focusable","false"),Wt.removeAttribute("role"),wt.setAttribute("y",String(St+37+$t/2)),Ct.insertBefore(Wt,wt)}}function Bt(at){const ut=at.toLowerCase();return/invalid|fail|error|denied|reject|unavailable/.test(ut)?"failure":/valid|success|accepted|ready|available|complete/.test(ut)?"success":"neutral"}function Rt(at,ut,Ct){const Ft=at.replace(/^\[|\]$/g,"").trim().split(/\s+/),wt=document.createElement("canvas").getContext("2d");if(!wt||Ft.length===0)return[at];const Z=getComputedStyle(Ct);wt.font=`${Z.fontWeight} ${Z.fontSize} ${Z.fontFamily}`;const St=[];for(const $t of Ft){const Wt=St.length?`${St.at(-1)} ${$t}`:$t;St.length&&wt.measureText(Wt).width>ut?St.push($t):St.length?St[St.length-1]=Wt:St.push($t)}return St}function we(at,ut,Ct){const Ft=at.trim().split(/\s+/),wt=document.createElement("canvas").getContext("2d");if(!wt||Ft.length===0)return[at];const Z=getComputedStyle(Ct);wt.font=`${Z.fontWeight} ${Z.fontSize} ${Z.fontFamily}`;const St=[];for(const $t of Ft){const Wt=St.length?`${St.at(-1)} ${$t}`:$t;St.length&&wt.measureText(Wt).width>ut?St.push($t):St.length?St[St.length-1]=Wt:St.push($t)}return St}function qt(at,ut,Ct){for(const wt of at.querySelectorAll("line"))for(const Z of["y1","y2"]){const St=Number(wt.getAttribute(Z));Number.isFinite(St)&&St>=ut&&wt.setAttribute(Z,String(St+Ct))}for(const wt of at.querySelectorAll("text")){if(wt.closest("g.actor-man"))continue;const Z=Number(wt.getAttribute("y"));Number.isFinite(Z)&&Z>=ut&&wt.setAttribute("y",String(Z+Ct))}for(const wt of at.querySelectorAll("rect")){const Z=Number(wt.getAttribute("y")),St=Number(wt.getAttribute("height"));[Z,St].every(Number.isFinite)&&(Z>=ut?wt.setAttribute("y",String(Z+Ct)):Z+St>=ut&&wt.setAttribute("height",String(St+Ct)))}const Ft=at.getScreenCTM();for(const wt of at.querySelectorAll("g.actor-man")){const Z=wt.getScreenCTM(),St=wt.parentElement?.getScreenCTM();if(!Ft||!Z||!St)continue;const $t=wt.getBBox();if(new DOMPoint($t.x,$t.y).matrixTransform(Z).matrixTransform(Ft.inverse()).y<ut)continue;const Ht=St.inverse().multiply(Ft),Vt=at.createSVGTransform();Vt.setTranslate(Ht.c*Ct,Ht.d*Ct),wt.transform.baseVal.insertItemBefore(Vt,0)}for(const wt of at.querySelectorAll("path, polygon, polyline")){if(wt.ownerSVGElement!==at||wt.closest("defs, marker"))continue;const Z=wt.transform.baseVal.consolidate()?.matrix;if(wt.getBBox().y+(Z?.f??0)<ut)continue;const $t=at.createSVGTransform();$t.setTranslate(0,Ct),wt.transform.baseVal.insertItemBefore($t,0)}}function ue(at,ut){const Ct=[...at.querySelectorAll(":scope > line.messageLine0, :scope > line.messageLine1")].filter(Ft=>Ft.y1.baseVal.value===Ft.y2.baseVal.value);if(Ct.length!==0)for(const Ft of ut){const wt=Ft.y.baseVal.value,Z=Ct.filter(Ht=>Ht.y1.baseVal.value<wt).sort((Ht,Vt)=>Vt.y1.baseVal.value-Ht.y1.baseVal.value)[0];if(!Z)continue;const St=Number.parseFloat(getComputedStyle(Z).strokeWidth)||0;let $t=St/2;for(const Ht of["marker-start","marker-end"]){const Vt=Z.getAttribute(Ht)?.match(/#([^)'"\s]+)/)?.[1],de=Vt?at.querySelector(`marker[id="${CSS.escape(Vt)}"]`):null;if(!de)continue;const Me=de.viewBox.baseVal.height||de.markerHeight.baseVal.value,zt=de.markerHeight.baseVal.value/Me,Fe=de.markerUnits.baseVal===SVGMarkerElement.SVG_MARKERUNITS_STROKEWIDTH?St:1,Ze=de.refY.baseVal.value-de.viewBox.baseVal.y;$t=Math.max($t,Math.max(Ze,Me-Ze)*zt*Fe)}const Wt=Z.y1.baseVal.value+$t+i-wt;Wt>0&&qt(at,wt,Wt)}}function Ee(at,ut){const Ct=[];let Ft=[];for(const wt of at.children){if(wt.matches("text.messageText")&&Ft.push(wt),wt.matches("path.messageLine0, path.messageLine1")){Ft=[];continue}wt.matches("line.messageLine0, line.messageLine1")&&(Ct.push({labels:Ft,line:wt}),Ft=[])}for(const wt of Ct){if(wt.labels.length===0)continue;const Z=Number(wt.line.getAttribute("x1")),St=Number(wt.line.getAttribute("x2")),$t=ut.reduce((ne,It)=>Math.abs(It-Z)<Math.abs(ne-Z)?It:ne),Wt=ut.reduce((ne,It)=>Math.abs(It-St)<Math.abs(ne-St)?It:ne),Ht=($t+Wt)/2,Vt=Math.abs(Wt-$t)-i*2,de=wt.labels.map(ne=>ne.textContent?.trim()).join(" "),Me=we(de,Vt,wt.labels[0]),zt=(Me.length-wt.labels.length)*o,Fe=Number(wt.line.getAttribute("y1"));zt>0&&Number.isFinite(Fe)&&qt(at,Fe,zt);const Ze=wt.labels[0],Le=Number(Ze.getAttribute("y"));for(const ne of wt.labels.slice(1))ne.remove();Me.forEach((ne,It)=>{const ie=It===0?Ze:Ze.cloneNode(!1);ie.textContent=ne,ie.setAttribute("x",String(Ht)),ie.setAttribute("y",String(Le+It*o)),ie.setAttribute("text-anchor","middle"),It>0&&wt.line.before(ie)})}}async function ke(at,ut){if(at.getAttribute("aria-roledescription")!=="sequence")return;const Ct={x:at.viewBox.baseVal.x,y:at.viewBox.baseVal.y,width:at.viewBox.baseVal.width,height:at.viewBox.baseVal.height},Ft=at.getBBox(),wt=Ct.y+Ct.height-(Ft.y+Ft.height),Z=[...at.querySelectorAll(".actor-line")].map(It=>Number(It.getAttribute("x1")));Ee(at,Z);for(const It of at.querySelectorAll(":scope > line.messageLine0, :scope > line.messageLine1")){const ie=Number(It.getAttribute("x1")),Ie=Number(It.getAttribute("x2")),ve=Number(It.getAttribute("y1")),Oe=Number(It.getAttribute("y2")),Ke=Math.sign(Ie-ie);if(![ie,Ie,ve,Oe].every(Number.isFinite)||ve!==Oe||Ke===0)continue;const De=Z.reduce((Te,me)=>Math.abs(me-Ie)<Math.abs(Te-Ie)?me:Te);Math.abs(De-Ie)>12||It.setAttribute("x2",String(De-Ke*5))}for(const It of at.querySelectorAll(":scope > g")){const ie=[...It.querySelectorAll(":scope > line.loopLine")],Ie=It.querySelector(":scope > text.labelText");if(ie.length<4||!Ie)continue;const ve=Ie.textContent?.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-")||"group";It.classList.add("sequence-construct",`sequence-construct-${ve}`),Ie.classList.add("sequence-construct-label-text"),It.querySelector(":scope > .labelBox")?.classList.add("sequence-construct-label");const Oe=ie.flatMap(lr=>[Number(lr.getAttribute("x1")),Number(lr.getAttribute("x2"))]),Ke=ie.flatMap(lr=>[Number(lr.getAttribute("y1")),Number(lr.getAttribute("y2"))]),De=Math.min(...Oe),Te=Math.max(...Oe),me=Math.min(...Ke),Ue=Math.max(...Ke);if(![De,Te,me,Ue].every(Number.isFinite))continue;const Jt=[];for(const lr of ie){const ni=Number(lr.getAttribute("x1")),Xr=Number(lr.getAttribute("x2")),ti=Number(lr.getAttribute("y1")),li=Number(lr.getAttribute("y2")),Pa=ni===Xr&&(ni===De||ni===Te)||ti===li&&(ti===me||ti===Ue);lr.classList.add(Pa?"sequence-frame-line":"sequence-branch-divider"),!Pa&&ti===li&&Jt.push(ti)}const tr=[...It.querySelectorAll(":scope > text.loopText, :scope > text.sectionTitle")],Cr=It.querySelector(":scope > .sequence-construct-label")?.getBBox(),hr=Math.max(De+12,(Cr?.x??De)+(Cr?.width??42)+12),Fr=[me,...Jt.sort((lr,ni)=>lr-ni),Ue],$r=Fr.slice(0,-1).map(()=>[]);tr.forEach(lr=>{lr.classList.add("sequence-branch-condition"),lr.setAttribute("x",String(hr)),lr.setAttribute("text-anchor","start");const ni=Number(lr.getAttribute("y")),Xr=Math.max(0,Math.min($r.length-1,Fr.findIndex((ti,li)=>li>0&&ni<ti)-1));$r[Xr].push(lr)}),$r.forEach((lr,ni)=>{if(lr.length===0)return;const Xr=lr.map(Ri=>Ri.textContent??"").join(" ").replace(/-\s+/g,"").replace(/\[\s+/g,"[").replace(/\s+\]/g,"]").replace(/\]\s+\[/g," "),ti=Bt(Xr),li=lr[0];for(const Ri of lr)Ri.previousElementSibling?.classList.contains("edge-label-knockout")&&Ri.previousElementSibling.remove(),Ri!==li&&Ri.remove();li.replaceChildren();const Pa=Rt(Xr,Math.max(48,Te-hr-12),li);li.setAttribute("aria-label",Xr.replace(/^\[|\]$/g,"").trim()),li.dataset.sequenceBranch=ti;for(const[Ri,yc]of Pa.entries()){const Ia=document.createElementNS("http://www.w3.org/2000/svg","tspan");Ia.setAttribute("x",String(hr)),Ia.setAttribute("dy",Ri===0?"0":"1.15em"),Ia.textContent=yc,li.append(Ia)}B1(It,li,li.getBBox());const Zi=Fr[ni],la=Fr[ni+1],Ki=document.createElementNS("http://www.w3.org/2000/svg","rect");Ki.classList.add("sequence-branch-surface"),Ki.setAttribute("x",String(De+4)),Ki.setAttribute("y",String(Zi+4)),Ki.setAttribute("width",String(Math.max(0,Te-De-8))),Ki.setAttribute("height",String(Math.max(0,la-Zi-8))),Ki.setAttribute("rx","6"),Ki.dataset.sequenceBranch="neutral";const Di=document.createElementNS("http://www.w3.org/2000/svg","line");Di.classList.add("sequence-branch-cue",`sequence-branch-${ti}`),Di.setAttribute("x1",String(De+8)),Di.setAttribute("x2",String(De+8)),Di.setAttribute("y1",String(Zi+12)),Di.setAttribute("y2",String(la-10)),Di.dataset.sequenceBranch=ti,It.insertBefore(Di,It.firstElementChild),It.insertBefore(Ki,It.firstElementChild)})}const St=[...at.querySelectorAll(":scope > .sequence-construct")];St.sort((It,ie)=>{const Ie=It.getBBox(),ve=ie.getBBox();return ve.width*ve.height-Ie.width*Ie.height});const $t=[...at.children].filter(It=>It.matches("rect.rect")||It.matches("g")&&It.querySelector(":scope > rect.rect"));at.prepend(...$t,...St);const Wt=It=>It.replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim(),Ht=(It,ie)=>{const Ie=[];let ve=0;for(const Oe of ie){const Ke=Wt(Oe);let De="";for(;ve<It.length&&Wt(De)!==Ke;){const Te=[De,It[ve]].filter(Boolean).join(" ");if(!Ke.startsWith(Wt(Te)))return It;De=Te,ve+=1}if(Wt(De)!==Ke)return It;Ie.push(De)}return ve===It.length?Ie:It},Vt=ut.split(`
329
- `).map(It=>/^\s*note\s+(?:left of|right of|over)\s+[^:]+:\s*(.*)$/i.exec(It)?.[1]).filter(It=>It!==void 0).map(It=>It.split(/<br\s*\/?>/i)),Me=[...at.querySelectorAll(":scope > g")].flatMap(It=>{const ie=It.querySelector(":scope > rect.note"),Ie=[...It.querySelectorAll(":scope > text.noteText")];return ie&&Ie.length?[{group:It,note:ie,lines:Ie}]:[]}).map(({group:It,note:ie,lines:Ie},ve)=>{const Oe=Ie.map(me=>me.textContent?.trim()).filter(Boolean),Ke=Vt[ve]??[],De=Ke.length>1?Ht(Oe,Ke):[Oe.join(" ")];De.forEach((me,Ue)=>{const Jt=Ie[Ue],tr=Jt.querySelector("tspan")?.getAttribute("x")??Jt.getAttribute("x"),Cr=document.createElementNS("http://www.w3.org/2000/svg","tspan");tr&&Cr.setAttribute("x",tr),Cr.textContent=me,Jt.replaceChildren(Cr)}),Ie.slice(De.length).forEach(me=>me.remove());const Te=Ie.slice(0,De.length);return{group:It,note:ie,texts:Te}});for(const{group:It,texts:ie}of Me){It.classList.add("sequence-note");for(const Ie of ie)Ie.style.setProperty("transition-property","none","important"),Ie.classList.add("sequence-note-text")}Me.length&&await Promise.all(Me.flatMap(({texts:It})=>It.map(C3)));for(const{note:It,texts:ie}of Me){const Ie=ie.map(hr=>hr.getBBox()),ve=Math.min(...Ie.map(hr=>hr.x)),Oe=Math.min(...Ie.map(hr=>hr.y)),Ke=Math.max(...Ie.map(hr=>hr.x+hr.width)),De=Math.max(...Ie.map(hr=>hr.y+hr.height)),Te=document.createElement("canvas").getContext("2d"),Ue=Math.max(...ie.map((hr,Fr)=>{const $r=getComputedStyle(hr);return Te&&(Te.font=`${$r.fontWeight} ${$r.fontSize} ${$r.fontFamily}`),Te?.measureText(hr.textContent??"").width??Ie[Fr].width}))+20,Jt=Math.max(28,De-Oe+12),tr=Number(ie[0].getAttribute("x")),Cr=Number.isFinite(tr)?tr:(ve+Ke)/2;It.style.setProperty("transition-property","none","important"),It.setAttribute("x",String(Cr-Ue/2)),It.setAttribute("y",String(Oe-6)),It.setAttribute("width",String(Ue)),It.setAttribute("height",String(Jt)),It.setAttribute("rx","6")}ue(at,Me.map(({note:It})=>It));const zt=at.getBBox(),Fe=Math.min(Ct.x,Math.floor(zt.x)),Le=Math.max(Ct.x+Ct.width,Math.ceil(zt.x+zt.width))-Fe,ne=Math.ceil(zt.y+zt.height+wt-Ct.y);(Le>Ct.width||ne>Ct.height)&&(at.setAttribute("viewBox",`${Fe} ${Ct.y} ${Le} ${Math.max(Ct.height,ne)}`),at.setAttribute("width",String(Le)),at.setAttribute("height",String(Math.max(Ct.height,ne))))}function Se(at){if(!at)return null;const ut=Array.from(at.children).filter(Z=>Z instanceof SVGGElement&&Z.classList.contains("label")&&!!Z.textContent?.trim());if(!ut.length)return at.style.display="none",null;at.style.removeProperty("display");let Ct=0,Ft=Number.POSITIVE_INFINITY,wt=Number.NEGATIVE_INFINITY;for(const[Z,St]of ut.entries()){const $t=St.getBBox();St.setAttribute("transform",`translate(0, ${Ct-$t.y})`),Ft=Math.min(Ft,$t.x),wt=Math.max(wt,$t.x+$t.width),Ct+=$t.height,Z<ut.length-1&&(Ct+=V)}return{element:at,bounds:new DOMRect(Ft,0,wt-Ft,Ct)}}function _t(at){if(!at.classList.contains("classDiagram"))return null;const ut=Array.from(at.querySelectorAll("g.node")).flatMap(Ht=>{const Vt=Ht.querySelector(".outer-path"),de=Q(Ht);if(!Vt||!de)return[];const Me=Vt.getBBox();Ht.querySelectorAll(":scope > .divider").forEach(Jt=>Jt.remove()),Ht.querySelector(":scope > .class-box-outline")?.remove();const zt=Se(Ht.querySelector(":scope > .annotation-group")),Fe=Se(Ht.querySelector(":scope > .label-group")),Ze=Se(Ht.querySelector(":scope > .members-group")),Le=Se(Ht.querySelector(":scope > .methods-group")),ne=[zt,Fe].filter(Jt=>Jt!==null),It=[{groups:ne,centered:!0},...Ze?[{groups:[Ze],centered:!1}]:[],...Le?[{groups:[Le],centered:!1}]:[]];if(!ne.length)return[];const ie=It.map(({groups:Jt})=>Jt.reduce((tr,Cr,hr)=>tr+Cr.bounds.height+(hr?V:0),0)),Ie=Math.max(...It.flatMap(({groups:Jt})=>Jt.map(tr=>tr.bounds.width))),ve=Math.max(Me.width,Ie+U*2),Oe=-ve/2,Ke=-(ie[0]+j*2)/2;let De=Ke+j;const Te=[];for(const[Jt,tr]of It.entries()){for(const[Cr,hr]of tr.groups.entries()){Cr&&(De+=V);const Fr=tr.centered?-hr.bounds.width/2-hr.bounds.x:Oe+U-hr.bounds.x;hr.element.setAttribute("transform",`translate(${Fr}, ${De-hr.bounds.y})`),De+=hr.bounds.height}if(De+=j,Jt<It.length-1){const Cr=document.createElementNS("http://www.w3.org/2000/svg","line");Cr.classList.add("class-box-divider"),Cr.setAttribute("x1",String(Oe)),Cr.setAttribute("x2",String(Oe+ve)),Cr.setAttribute("y1",String(De)),Cr.setAttribute("y2",String(De)),Te.push(Cr),De+=j}}const me=document.createElementNS("http://www.w3.org/2000/svg","rect");me.classList.add("class-box-outline"),me.setAttribute("x",String(Oe)),me.setAttribute("y",String(Ke)),me.setAttribute("width",String(ve)),me.setAttribute("height",String(De-Ke)),Ht.insertBefore(me,Vt),Vt.style.display="none";const Ue=Ht.querySelector(":scope > .annotation-group, :scope > .label-group, :scope > .members-group, :scope > .methods-group");for(const Jt of Te)Ht.insertBefore(Jt,Ue);return[{element:Ht,name:Fe.element.textContent?.trim()??"",...de,box:me.getBBox(),originalBox:Me,deltaX:0,deltaY:0}]}),Ct=()=>{const Ht=Math.min(...ut.map(zt=>zt.x+zt.deltaX+zt.box.x)),Vt=Math.min(...ut.map(zt=>zt.y+zt.deltaY+zt.box.y)),de=Math.max(...ut.map(zt=>zt.x+zt.deltaX+zt.box.x+zt.box.width)),Me=Math.max(...ut.map(zt=>zt.y+zt.deltaY+zt.box.y+zt.box.height));return new DOMRect(Ht,Vt,de-Ht,Me-Vt)};if(ut.length<2)return ut.length?Ct():null;const Ft=Math.max(...ut.map(Ht=>Ht.x))-Math.min(...ut.map(Ht=>Ht.x)),Z=Math.max(...ut.map(Ht=>Ht.y))-Math.min(...ut.map(Ht=>Ht.y))>=Ft,St=Ht=>Z?Ht.y:Ht.x,$t=[];for(const Ht of ut.toSorted((Vt,de)=>St(Vt)-St(de))){const Vt=$t.at(-1);Vt&&Math.abs(St(Vt[0])-St(Ht))<1?Vt.push(Ht):$t.push([Ht])}let Wt=Number.NEGATIVE_INFINITY;for(const Ht of $t){const Vt=Math.min(...Ht.map(zt=>St(zt)+(Z?zt.box.y:zt.box.x))),de=Math.max(...Ht.map(zt=>St(zt)+(Z?zt.box.y+zt.box.height:zt.box.x+zt.box.width))),Me=Number.isFinite(Wt)?Math.max(0,Wt+24-Vt):0;for(const zt of Ht)Z?zt.deltaY=Me:zt.deltaX=Me,zt.element.setAttribute("transform",`translate(${zt.x+zt.deltaX}, ${zt.y+zt.deltaY})`);Wt=de+Me}for(const Ht of at.querySelectorAll('.edgePaths path[data-edge="true"]')){const Vt=Ht.getTotalLength();if(!Vt)continue;const de=Ht.getPointAtLength(0),Me=Ht.getPointAtLength(Vt),zt=ve=>ut.toSorted((Oe,Ke)=>{const De=Te=>{const{originalBox:me}=Te,Ue=Math.max(Te.x+me.x-ve.x,0,ve.x-Te.x-me.x-me.width),Jt=Math.max(Te.y+me.y-ve.y,0,ve.y-Te.y-me.y-me.height);return Math.hypot(Ue,Jt)};return De(Oe)-De(Ke)})[0],Fe=Ht.dataset.id??"",Ze=ut.flatMap(ve=>ut.filter(Oe=>Oe!==ve).map(Oe=>({source:ve,target:Oe}))).find(({source:ve,target:Oe})=>Fe.startsWith(`id_${ve.name}_${Oe.name}_`)),Le=Ze?.source??zt(de),ne=Ze?.target??zt(Me);if(!Le||!ne||Le===ne)continue;const It={x:Le.x+Le.deltaX+Le.box.x+Le.box.width/2,y:Le.y+Le.deltaY+Le.box.y+Le.box.height/2},ie={x:ne.x+ne.deltaX+ne.box.x+ne.box.width/2,y:ne.y+ne.deltaY+ne.box.y+ne.box.height/2};if(Math.abs(ie.x-It.x)>Math.abs(ie.y-It.y)){const ve=Math.sign(ie.x-It.x)||1,Oe=Le.x+Le.deltaX+(ve>0?Le.box.x+Le.box.width:Le.box.x),Ke=ne.x+ne.deltaX+(ve>0?ne.box.x:ne.box.x+ne.box.width),De=(Oe+Ke)/2,Te=[{x:Oe,y:It.y},{x:De,y:It.y},{x:De,y:ie.y},{x:Ke,y:ie.y}];Ht.setAttribute("d",Te.map((me,Ue)=>`${Ue?"L":"M"}${me.x},${me.y}`).join("")),Ht.dataset.manhattanPoints=Te.map(me=>`${me.x},${me.y}`).join(" ")}else{const ve=Math.sign(ie.y-It.y)||1,Oe=Le.y+Le.deltaY+(ve>0?Le.box.y+Le.box.height:Le.box.y),Ke=ne.y+ne.deltaY+(ve>0?ne.box.y:ne.box.y+ne.box.height),De=(Oe+Ke)/2,Te=[{x:It.x,y:Oe},{x:It.x,y:De},{x:ie.x,y:De},{x:ie.x,y:Ke}];Ht.setAttribute("d",Te.map((me,Ue)=>`${Ue?"L":"M"}${me.x},${me.y}`).join("")),Ht.dataset.manhattanPoints=Te.map(me=>`${me.x},${me.y}`).join(" ")}}return Ct()}function Xt(at,ut){const Ct=Number.parseFloat(getComputedStyle(at).fontSize),Ft=ut*(12/(Number.isFinite(Ct)?Ct:13));at.style.setProperty("--mermaid-readable-width",`${Ft.toFixed(3)}px`)}function w(at){const ut=at.getBBox(),Ft=at.querySelector(".edgePaths path, g.node")?.getScreenCTM()?.inverse();if(!Ft)return ut;const wt=[...at.querySelectorAll(".edgeLabels > .edgeLabel")].flatMap(Vt=>{if(!Vt.textContent?.trim())return[];const de=Vt.getBoundingClientRect(),Me=[new DOMPoint(de.left,de.top),new DOMPoint(de.right,de.top),new DOMPoint(de.right,de.bottom),new DOMPoint(de.left,de.bottom)].map(ne=>ne.matrixTransform(Ft)),zt=Math.min(...Me.map(ne=>ne.x)),Fe=Math.min(...Me.map(ne=>ne.y)),Ze=Math.max(...Me.map(ne=>ne.x)),Le=Math.max(...Me.map(ne=>ne.y));return[{x:zt,y:Fe,width:Ze-zt,height:Le-Fe}]}),Z=[ut,...wt],St=Math.min(...Z.map(Vt=>Vt.x)),$t=Math.min(...Z.map(Vt=>Vt.y)),Wt=Math.max(...Z.map(Vt=>Vt.x+Vt.width)),Ht=Math.max(...Z.map(Vt=>Vt.y+Vt.height));return{x:St,y:$t,width:Wt-St,height:Ht-$t}}async function J(at,ut,Ct,Ft){const wt=++I;if(await Th(),await document.fonts?.ready,at!==O)return!1;const Z=A(k)?.querySelector(".mermaid-svg svg");if(!Z||(k3(Z,Ct),typeof Z.getBBox!="function"))return!1;if(delete Z.dataset.layoutSettled,Mt(Z),Ha(Z),Z.getAttribute("aria-roledescription")==="sequence")return await ke(Z,ut),at!==O||wt!==I?!1:(pp(Z),ot(Z),Xt(Z,Z.viewBox.baseVal.width),Z.dataset.layoutGeneration=String(at),Z.dataset.layoutSettled="true",!0);ht(Z),H(Z),G(Z),K(Z),vt(Z),tt(Z),pp(Z),ot(Z),Z.getAttribute("aria-roledescription")!=="flowchart-v2"&&K3(Z,Ct),G3(Z),X3(Z),j3(Z);const St=Z.getAttribute("aria-roledescription")==="flowchart-v2";if(St&&(Z.dataset.flowchartDirection=ut.match(/^\s*(?:flowchart|graph)\s+(\w+)\b/m)?.[1]??""),St){B3(Z);const Jt=Z.getBBox(),tr=16,Cr=Math.ceil(Jt.width+tr*2),hr=Math.ceil(Jt.height+tr*2);if(Z.setAttribute("viewBox",`${Jt.x-tr} ${Jt.y-tr} ${Cr} ${hr}`),Z.setAttribute("width",String(Cr)),Z.setAttribute("height",String(hr)),Xt(Z,Cr),js(Z),rn(Z.ownerDocument)||await new Promise(lr=>setTimeout(lr,64)),at!==O||wt!==I)return!1;const Fr=w(Z),$r=Z.viewBox.baseVal;if(Fr.x<$r.x||Fr.y<$r.y||Fr.x+Fr.width>$r.x+$r.width||Fr.y+Fr.height>$r.y+$r.height){const lr=Math.min($r.x,Fr.x-tr),ni=Math.min($r.y,Fr.y-tr),Xr=Math.ceil(Math.max($r.x+$r.width,Fr.x+Fr.width+tr)-lr),ti=Math.ceil(Math.max($r.y+$r.height,Fr.y+Fr.height+tr)-ni);Z.setAttribute("viewBox",`${lr} ${ni} ${Xr} ${ti}`),Z.setAttribute("width",String(Xr)),Z.setAttribute("height",String(ti)),Xt(Z,Xr)}return Z.dataset.layoutGeneration=String(at),Z.dataset.layoutSettled="true",!0}const $t=A(k)?.clientWidth??0,Wt=$t>0?$t<=620:A(B);St&&!Wt&&Z.querySelectorAll("g.cluster").length>=2&&Jn(Z);const Ht=Z.dataset.nestedDecisionLayout==="wide"?b$(Z)??Z.getBBox():Z.getBBox(),Vt=Number.parseFloat(getComputedStyle(Z).fontSize),de=12/(Number.isFinite(Vt)?Vt:13),zt=!/^\s*(?:flowchart|graph)\s+(?:LR|RL|BT)\b/m.test(ut)&&(Wt||St&&Ht.width*de>$t);if(zt&&(bh(Z,!1,Ct),bh(Z,!0,Ct)),await new Promise(Jt=>requestAnimationFrame(()=>requestAnimationFrame(()=>Jt()))),at!==O)return!1;Z.getBoundingClientRect(),zt&&Pt(Z),St&&S$(Z),xh(Z),Bp(Z),Jn(Z);let Fe=null;zt?(bh(Z,!0,Ct),xh(Z,!0),Bp(Z),Jn(Z),Pt(Z),Ch(Z),Ya(Z),Fe=Z.getBBox()):(Ch(Z),Z.querySelector("g.cluster")&&Ya(Z));const Ze=Z.classList.contains("statediagram"),Le=A(E)?"compact":"wide",It=(!Ze||Z.dataset.stateRouteLayout!==Le)&&B$(Z,A(E),Ft);E$(Z),L$(Z),Ze&&It&&(Z.dataset.stateRouteLayout=Le);const ie=_t(Z);if(yh(Z),Ha(Z),wp(Z),P$(Z,A(E)),await new Promise(Jt=>requestAnimationFrame(()=>requestAnimationFrame(()=>Jt()))),at!==O)return!1;Ot(Z),Jn(Z),yh(Z),Ha(Z),Z.querySelector("g.cluster")&&Ya(Z);const Ie=Z.getBBox(),ve=[ie,Fe].filter(Jt=>!!Jt),Oe=Ie,Ke=ve.length?DOMRect.fromRect({x:Math.min(Oe.x,...ve.map(Jt=>Jt.x)),y:Math.min(Oe.y,...ve.map(Jt=>Jt.y)),width:Math.max(Oe.x+Oe.width,...ve.map(Jt=>Jt.x+Jt.width))-Math.min(Oe.x,...ve.map(Jt=>Jt.x)),height:Math.max(Oe.y+Oe.height,...ve.map(Jt=>Jt.y+Jt.height))-Math.min(Oe.y,...ve.map(Jt=>Jt.y))}):Oe;if(![Ke.x,Ke.y,Ke.width,Ke.height].every(Number.isFinite))return!1;const De=!!Z.querySelector("g.cluster");let Te=St?zt?Z.querySelector("g.cluster")?14:20:28:De?24:A(B)?Ze?10:8:10,me=Math.ceil(Ke.width+Te*2),Ue=Math.ceil(Ke.height+Te*2);if(Z.setAttribute("viewBox",`${Ke.x-Te} ${Ke.y-Te} ${me} ${Ue}`),Z.style.removeProperty("width"),Z.setAttribute("width",String(me)),Z.setAttribute("height",String(Ue)),Ze){if(await new Promise(tr=>requestAnimationFrame(()=>tr())),at!==O)return!1;const Jt=Z.getBBox();me=Math.ceil(Jt.width+Te*2),Ue=Math.ceil(Jt.height+Te*2),Z.setAttribute("viewBox",`${Jt.x-Te} ${Jt.y-Te} ${me} ${Ue}`),Z.setAttribute("width",String(me)),Z.setAttribute("height",String(Ue))}if(Xt(Z,me),rn(Z.ownerDocument)||await new Promise(Jt=>setTimeout(Jt,64)),at!==O)return!1;if(!zt&&Z.getAttribute("aria-roledescription")==="flowchart-v2"){xh(Z,!0),Ha(Z);const Jt=w(Z);me=Math.ceil(Jt.width+Te*2),Ue=Math.ceil(Jt.height+Te*2),Z.setAttribute("viewBox",`${Jt.x-Te} ${Jt.y-Te} ${me} ${Ue}`),Z.setAttribute("width",String(me)),Z.setAttribute("height",String(Ue)),Xt(Z,me)}if(Z.getAttribute("aria-roledescription")==="flowchart-v2"){if(await new Promise(Jt=>requestAnimationFrame(()=>Jt())),at!==O)return!1;Tp(Z),Mp(Z),vp(Z),Q3(Z),Ha(Z),zt&&Z.querySelector("g.cluster")&&Ya(Z)}if(zt&&(Pt(Z),Ch(Z),Ya(Z)),Z.getAttribute("aria-roledescription")==="flowchart-v2"){Tp(Z),Mp(Z),vp(Z),U3(Z),c$(Z);const Jt=J3(Z);yh(Z),De&&Ya(Z),r$(Z,Jt),Ha(Z),zt&&Z.querySelector('path[data-grouped-return-lane="right"]')&&(Te=Math.max(Te,23));const tr=w(Z);me=Math.ceil(tr.width+Te*2),Ue=Math.ceil(tr.height+Te*2),Z.setAttribute("viewBox",`${tr.x-Te} ${tr.y-Te} ${me} ${Ue}`),Z.setAttribute("width",String(me)),Z.setAttribute("height",String(Ue)),Xt(Z,me)}if((Ze||zt&&St&&!De&&!Z.dataset.decisionCycleLayout)&&(Z.style.setProperty("--mermaid-readable-width","0px"),Z.style.setProperty("max-width","100%")),Ze&&wp(Z),js(Z),rn(Z.ownerDocument)||await new Promise(Jt=>setTimeout(Jt,120)),at!==O||wt!==I)return!1;if(Z.getAttribute("aria-roledescription")==="flowchart-v2"){const Jt=w(Z);if(me=Math.ceil(Jt.width+Te*2),Ue=Math.ceil(Jt.height+Te*2),Z.setAttribute("viewBox",`${Jt.x-Te} ${Jt.y-Te} ${me} ${Ue}`),Z.setAttribute("width",String(me)),Z.setAttribute("height",String(Ue)),Xt(Z,me),await new Promise(tr=>requestAnimationFrame(()=>tr())),at!==O||wt!==I)return!1}return js(Z),Z.dataset.layoutGeneration=String(at),Z.dataset.layoutSettled="true",!0}async function dt(at,ut,Ct){const Ft=++O;gt($,Ft,!0),gt(F,0);const wt=P(at),Z=z(wt);if(!Z?.trim()){ut||gt(p,""),gt(m,null),gt(F,Ft,!0);return}try{const St=X(Y(Z)),$t=/(?:^|\n)\s*(?:flowchart|graph)\s/i.test(St),Wt=g3(getComputedStyle(document.documentElement),$t);Wt.suppressErrorRendering=!0;const Ht=/^\s*stateDiagram(?:-v2)?\b/m.test(St),Vt=/^\s*erDiagram\b/m.test(St);if(Wt.layout=Ht||Vt?"elk":"dagre",$t&&(Wt.flowchart={...Wt.flowchart,curve:"basis",nodeSpacing:48,rankSpacing:64}),A(B)&&(Wt.flowchart={...Wt.flowchart,nodeSpacing:48,padding:9,rankSpacing:48,wrappingWidth:A(E)&&/\bsubgraph\b/.test(St)?80:120},A(E)&&(Wt.sequence={...Wt.sequence,actorMargin:0,diagramMarginX:0,messageMargin:24,noteMargin:4,width:96,wrap:!0})),Wt.state={...Wt.state,wrappingWidth:Wt.flowchart?.wrappingWidth},await document.fonts?.load(`400 ${Wt.fontSize}px "${dp}"`),$t&&await document.fonts?.load(`500 ${Wt.fontSize}px "${dp}"`),!Ct())return;const de=await p3(async()=>{fh.initialize(Wt);const zt=`mermaid-${Date.now()}-${Math.random().toString(36).slice(2,11)}`,{svg:Fe}=await fh.render(zt,St);if(Ft!==O||!Ct())return;let Ze,Le;if(Ht||$t&&/class="[^"]*\bcluster\b/.test(Fe)){const ne=await fh.mermaidAPI.getDiagramFromText(St);if(Ft!==O||!Ct())return;ne.type==="flowchart-v2"&&(Ze=b3(ne.db.getSubGraphs())),ne.type==="stateDiagram"&&(Le=N3(ne.db.getData()))}return{svg:Fe,clusterMembership:Ze,stateDiagram:Le}},()=>Ft===O&&Ct());if(!de||Ft!==O||!Ct())return;gt(p,de.svg,!0),gt(m,null),await J(Ft,St,de.clusterMembership,de.stateDiagram)&&Ft===O&&gt(F,Ft,!0)}catch(St){if(Ft!==O||!Ct())return;if(ut){gt(m,null),gt(F,Ft,!0);return}r.error("Failed to render mermaid diagram:",St),gt(m,St instanceof Error?St.message:je.markdown_mermaid_renderFailed_error(),!0),gt(p,""),gt(F,Ft,!0)}}const mt=i3((at,ut)=>dt(at.source,at.isStreaming,ut));function ft(at){at.stopPropagation(),at.preventDefault(),gt(S,at.currentTarget,!0),document.activeElement instanceof HTMLElement&&document.activeElement.blur(),gt(b,A(k)?.querySelector(".mermaid-svg svg")?.outerHTML??A(p),!0),gt(x,!0)}function N(at){at.stopPropagation(),at.preventDefault(),f(!f())}function et(){gt(x,!1),gt(b,"")}function it(at){at.defaultPrevented||A(T)?.handleKeydown(at)}function ct(){v!==void 0&&cancelAnimationFrame(v),v=requestAnimationFrame(()=>{v=void 0;const at=A(L)?.querySelector("svg");at&&js(at)})}hd(()=>{gt(y,!0);const at=A(k)?.closest(".node-mermaidBlock"),ut=at??A(k),Ct=()=>at?.clientWidth??A(k)?.clientWidth??0;let Ft,wt;const Z=typeof ResizeObserver>"u"?void 0:new ResizeObserver(()=>{const Wt=Ct();Wt!==Ft&&(Ft=Wt,gt(B,Wt<=620),gt(E,A(E)?Wt<440:Wt<=420,!0));const Ht=A(k)?.clientWidth;if(Ht===wt)return;wt=Ht;const Vt=A(k)?.querySelector(".mermaid-svg svg");Vt?.dataset.layoutSettled==="true"&&js(Vt)});ut&&Z&&(Ft=Ct(),gt(B,Ft<=620),gt(E,Ft<=420),Z.observe(ut),A(k)&&A(k)!==ut&&Z.observe(A(k)));let St=D();const $t=new MutationObserver(()=>{const Wt=D();Wt!==St&&(St=Wt,gt(M,A(M)+1))});return $t.observe(document.documentElement,{attributes:!0,attributeFilter:["class","style"]}),()=>{$t.disconnect(),Z?.disconnect(),v!==void 0&&cancelAnimationFrame(v),mt.dispose(),O+=1}}),Bo(()=>{const at={source:n(),isStreaming:l(),revision:`${A(M)}:${A(B)}:${A(E)}`};A(y)&&A(k)&&pl(()=>mt.update(at))});let xt=Dt(()=>A(m)?"error":A(p)?"rendered":!n()?.trim()&&!l()?"empty":"pending");Bo(()=>{g()?.(A(xt))});var Tt={get code(){return n()},set code(at){n(at),_e()},get isStreaming(){return l()},set isStreaming(at=!1){l(at),_e()},get className(){return c()},set className(at=""){c(at),_e()},get showExpandButton(){return h()},set showExpandButton(at=!0){h(at),_e()},get showSourceButton(){return d()},set showSourceButton(at=!0){d(at),_e()},get showExportButton(){return u()},set showExportButton(at=!1){u(at),_e()},get showSource(){return f()},set showSource(at=!1){f(at),_e()},get onRenderStateChange(){return g()},set onRenderStateChange(at){g(at),_e()},$set:Do,$on:(at,ut)=>Ro(t,at,ut)},st=H$(),kt=ui(st);let jt;var re=qe(kt),Kt=qe(re);q(Kt,{size:30,weight:"light"}),$e(re),no(re,at=>gt(_,at),()=>A(_));var xe=We(re,2);{var Pe=at=>{var ut=I$(),Ct=qe(ut),Ft=qe(Ct),wt=Tr(Ft,!0),Z=We(Ft,2),St=Tr(Z,!0);$e(Ct);var $t=We(Ct,2),Wt=qe($t),Ht=Tr(Wt,!0),Vt=We(Wt,2),de=Tr(Vt,!0),Me=We(Vt,2),zt=Tr(Me,!0),Fe=We(Me,2),Ze=Tr(Fe,!0);$e($t),$e(ut),cr((Le,ne,It,ie)=>{br(wt,Le),br(St,ne),br(Ht,It),br(de,A(m)),br(zt,ie),br(Ze,A(R))},[()=>je.markdown_mermaid_renderFailed_error(),()=>je.markdown_mermaid_invalid_description(),()=>je.markdown_mermaid_errorDetails_label(),()=>je.markdown_mermaid_viewSource_label()]),ge(at,ut)},mi=at=>{var ut=R$(),Ct=ui(ut),Ft=qe(Ct);let wt;var Z=qe(Ft);zu(Z,()=>A(p),!0),$e(Z),$e(Ft);var St=We(Ft,2);{var $t=Vt=>{var de=O$();let Me;var zt=qe(de);{var Fe=ie=>{{let Ie=Dt(()=>je.markdown_mermaid_viewSource_label()),ve=Dt(()=>je.markdown_mermaid_viewSource_label());Ja(ie,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"mermaid-action-button",onclick:N,get"aria-pressed"(){return f()},get"aria-label"(){return A(Ie)},get tooltip(){return A(ve)},children:(Oe,Ke)=>{dn(Oe,{get icon(){return SC},size:"sm"})},$$slots:{default:!0}})}};yr(zt,ie=>{d()&&ie(Fe)})}var Ze=We(zt,2);{var Le=ie=>{{let Ie=Dt(()=>je.markdown_mermaid_expand_ariaLabel()),ve=Dt(()=>je.markdown_mermaid_expand_tooltip());Ja(ie,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"mermaid-action-button expand-button",onclick:ft,get"aria-label"(){return A(Ie)},get tooltip(){return A(ve)},children:(Oe,Ke)=>{dn(Oe,{get icon(){return zp},size:"sm"})},$$slots:{default:!0}})}};yr(Ze,ie=>{h()&&ie(Le)})}var ne=We(Ze,2);{var It=ie=>{Bu(ie,{get container(){return A(k)},compactTrigger:!0})};yr(ne,ie=>{u()&&ie(It)})}$e(de),cr(ie=>{Me=co(de,1,"mermaid-actions svelte-9cn23y",null,Me,{"with-export":u()}),fe(de,"aria-label",ie)},[()=>je.markdown_mermaid_actions_ariaLabel()]),ge(Vt,de)};yr(St,Vt=>{(d()||h()||u())&&Vt($t)})}$e(Ct);var Wt=We(Ct,2);{var Ht=Vt=>{var de=D$(),Me=qe(de),zt=Tr(Me,!0);$e(de),cr(Fe=>{fe(de,"aria-label",Fe),br(zt,A(R))},[()=>je.markdown_mermaid_viewSource_label()]),ge(Vt,de)};yr(Wt,Vt=>{f()&&Vt(Ht)})}cr(()=>wt=co(Ft,1,"mermaid-svg-viewport svelte-9cn23y",null,wt,{"without-actions":!d()&&!h()&&!u()})),ge(at,ut)},xo=at=>{var ut=N$(),Ct=qe(ut),Ft=Tr(Ct,!0),wt=We(Ct,2),Z=Tr(wt,!0);$e(ut),cr((St,$t)=>{br(Ft,St),br(Z,$t)},[()=>je.markdown_mermaid_noCode_label(),()=>je.markdown_mermaid_noCode_description()]),ge(at,ut)},bo=Dt(()=>!n()?.trim()&&!l()),$s=at=>{var ut=q$(),Ct=Tr(ut,!0);cr(Ft=>br(Ct,Ft),[()=>je.ui_spinner_loading_ariaLabel()]),ge(at,ut)};yr(xe,at=>{A(m)?at(Pe):A(p)?at(mi,1):A(bo)?at(xo,2):at($s,-1)})}$e(kt),no(kt,at=>gt(k,at),()=>A(k));var Es=We(kt,2);{let at=Dt(()=>je.markdown_mermaid_fullscreenView_ariaLabel()),ut=Dt(()=>je.markdown_mermaid_closeFullscreen_ariaLabel());WC(Es,{get ariaLabel(){return A(at)},get closeLabel(){return A(ut)},onClose:et,get openerElement(){return A(S)},onKeydown:it,get open(){return A(x)},set open(Ct){gt(x,Ct,!0)},children:(Ct,Ft)=>{var wt=z$(),Z=qe(wt);no(zC(Z,{onScaleChange:ct,children:(St,$t)=>{var Wt=W$();zu(Wt,()=>A(b),!0),$e(Wt),no(Wt,Ht=>gt(L,Ht),()=>A(L)),ge(St,Wt)},$$slots:{default:!0}}),St=>gt(T,St,!0),()=>A(T)),$e(wt),ge(Ct,wt)},$$slots:{default:!0}})}return cr(at=>{jt=co(kt,1,`mermaid-renderer ${c()??""}`,"svelte-9cn23y",jt,{"has-diagram":at}),fe(kt,"data-render-generation",A($)),fe(kt,"data-render-settled-generation",A(F)),fe(kt,"data-render-settled",A($)>0&&A(F)===A($))},[()=>!!A(p)]),ge(e,st),qo(Tt)}const Gi={labelFontSize:13,labelCharWidthRatio:.6,labelLineHeight:1.26,kindFontSize:11,kindCharWidthRatio:.88,kindLineHeight:1,paddingX:16,paddingY:12,gap:4,maxLines:3,maxWidth:250},Fi=Object.freeze({fontSize:Gi.kindFontSize,lineHeight:Gi.labelLineHeight,paddingX:6,paddingY:4}),X$={architecture:{defaultNodeKinds:["service","db","queue","actor","ui_component"],defaultEdgeKinds:["request","response","event","data"],defaultLayout:{type:"layered",direction:"LR",spacing:30,edgeRouting:"orthogonal"},nodeDefaults:{width:80,height:40}},sequence:{defaultNodeKinds:["actor"],defaultEdgeKinds:["message","return"],defaultLayout:{type:"layered",direction:"TB",spacing:50,edgeRouting:"polyline"},nodeDefaults:{width:75,height:32}},state_machine:{defaultNodeKinds:["state","start","end"],defaultEdgeKinds:["transition"],defaultLayout:{type:"layered",direction:"LR",spacing:35,edgeRouting:"curved"},nodeDefaults:{width:75,height:38}},data_flow:{defaultNodeKinds:["process","data_store","external"],defaultEdgeKinds:["flow"],defaultLayout:{type:"layered",direction:"LR",spacing:30,edgeRouting:"polyline"},nodeDefaults:{width:80,height:40}},network:{defaultNodeKinds:["node","router","switch","server"],defaultEdgeKinds:["connection"],defaultLayout:{type:"force",spacing:60,edgeRouting:"polyline"},nodeDefaults:{width:60,height:60}},flowchart:{defaultNodeKinds:["process","decision","start","end","data"],defaultEdgeKinds:["flow"],defaultLayout:{type:"layered",direction:"TB",spacing:50,edgeRouting:"orthogonal"},nodeDefaults:{width:80,height:40}},timeline:{defaultNodeKinds:["event","milestone"],defaultEdgeKinds:["sequence"],defaultLayout:{type:"layered",direction:"LR",spacing:60,edgeRouting:"polyline"},nodeDefaults:{width:75,height:38}},dependency_graph:{defaultNodeKinds:["module","package","file"],defaultEdgeKinds:["depends_on","imports"],defaultLayout:{type:"layered",direction:"TB",spacing:40,edgeRouting:"polyline"},nodeDefaults:{width:75,height:38}}},j$=1.78,G$=900,U$=30,V$=300,Zo=6,Z$=112,_p=32,K$=Fi.fontSize*Gi.labelCharWidthRatio,Qa=Fi.paddingX*2,Q$=Fi.paddingY*2,wh=0,J$=Fi.fontSize*Fi.lineHeight,tE=14,eE=8,rE=32,nd=500,iE=.84,Uo=16,Sa=Object.freeze({centerY:24,headerHeight:68,horizontalPadding:24});function bn(e,t=Number.POSITIVE_INFINITY){if(e.length>=48)return 100;const r=di(e,60);return r.lines>=3&&t<r.height+16?80:60}let ma,kh;function va(e,t){return typeof document>"u"?t:getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t}function Gl(e,t,r,i,o=0,a=va("--font-ui","Inter, system-ui, sans-serif")){return ma===void 0&&(ma=typeof document<"u"&&typeof CanvasRenderingContext2D<"u"?document.createElement("canvas").getContext("2d"):null),ma?(ma.font=`${r} ${t}px ${a}`,ma.measureText(e).width+Math.max(0,e.length-1)*o):e.length*i}function Iu(e){const t=Fi.fontSize,r=va("--text-caption-weight","500"),i=va("--text-caption-tracking","-0.01em"),o=Number.parseFloat(i),a=Number.isFinite(o)?i.endsWith("em")?o*t:o:t*-.01,s=Math.max(...e.split(`
329
+ `).map(It=>/^\s*note\s+(?:left of|right of|over)\s+[^:]+:\s*(.*)$/i.exec(It)?.[1]).filter(It=>It!==void 0).map(It=>It.split(/<br\s*\/?>/i)),Me=[...at.querySelectorAll(":scope > g")].flatMap(It=>{const ie=It.querySelector(":scope > rect.note"),Ie=[...It.querySelectorAll(":scope > text.noteText")];return ie&&Ie.length?[{group:It,note:ie,lines:Ie}]:[]}).map(({group:It,note:ie,lines:Ie},ve)=>{const Oe=Ie.map(me=>me.textContent?.trim()).filter(Boolean),Ke=Vt[ve]??[],De=Ke.length>1?Ht(Oe,Ke):[Oe.join(" ")];De.forEach((me,Ue)=>{const Jt=Ie[Ue],tr=Jt.querySelector("tspan")?.getAttribute("x")??Jt.getAttribute("x"),Cr=document.createElementNS("http://www.w3.org/2000/svg","tspan");tr&&Cr.setAttribute("x",tr),Cr.textContent=me,Jt.replaceChildren(Cr)}),Ie.slice(De.length).forEach(me=>me.remove());const Te=Ie.slice(0,De.length);return{group:It,note:ie,texts:Te}});for(const{group:It,texts:ie}of Me){It.classList.add("sequence-note");for(const Ie of ie)Ie.style.setProperty("transition-property","none","important"),Ie.classList.add("sequence-note-text")}Me.length&&await Promise.all(Me.flatMap(({texts:It})=>It.map(C3)));for(const{note:It,texts:ie}of Me){const Ie=ie.map(hr=>hr.getBBox()),ve=Math.min(...Ie.map(hr=>hr.x)),Oe=Math.min(...Ie.map(hr=>hr.y)),Ke=Math.max(...Ie.map(hr=>hr.x+hr.width)),De=Math.max(...Ie.map(hr=>hr.y+hr.height)),Te=document.createElement("canvas").getContext("2d"),Ue=Math.max(...ie.map((hr,Fr)=>{const $r=getComputedStyle(hr);return Te&&(Te.font=`${$r.fontWeight} ${$r.fontSize} ${$r.fontFamily}`),Te?.measureText(hr.textContent??"").width??Ie[Fr].width}))+20,Jt=Math.max(28,De-Oe+12),tr=Number(ie[0].getAttribute("x")),Cr=Number.isFinite(tr)?tr:(ve+Ke)/2;It.style.setProperty("transition-property","none","important"),It.setAttribute("x",String(Cr-Ue/2)),It.setAttribute("y",String(Oe-6)),It.setAttribute("width",String(Ue)),It.setAttribute("height",String(Jt)),It.setAttribute("rx","6")}ue(at,Me.map(({note:It})=>It));const zt=at.getBBox(),Fe=Math.min(Ct.x,Math.floor(zt.x)),Le=Math.max(Ct.x+Ct.width,Math.ceil(zt.x+zt.width))-Fe,ne=Math.ceil(zt.y+zt.height+wt-Ct.y);(Le>Ct.width||ne>Ct.height)&&(at.setAttribute("viewBox",`${Fe} ${Ct.y} ${Le} ${Math.max(Ct.height,ne)}`),at.setAttribute("width",String(Le)),at.setAttribute("height",String(Math.max(Ct.height,ne))))}function Se(at){if(!at)return null;const ut=Array.from(at.children).filter(Z=>Z instanceof SVGGElement&&Z.classList.contains("label")&&!!Z.textContent?.trim());if(!ut.length)return at.style.display="none",null;at.style.removeProperty("display");let Ct=0,Ft=Number.POSITIVE_INFINITY,wt=Number.NEGATIVE_INFINITY;for(const[Z,St]of ut.entries()){const $t=St.getBBox();St.setAttribute("transform",`translate(0, ${Ct-$t.y})`),Ft=Math.min(Ft,$t.x),wt=Math.max(wt,$t.x+$t.width),Ct+=$t.height,Z<ut.length-1&&(Ct+=V)}return{element:at,bounds:new DOMRect(Ft,0,wt-Ft,Ct)}}function _t(at){if(!at.classList.contains("classDiagram"))return null;const ut=Array.from(at.querySelectorAll("g.node")).flatMap(Ht=>{const Vt=Ht.querySelector(".outer-path"),de=Q(Ht);if(!Vt||!de)return[];const Me=Vt.getBBox();Ht.querySelectorAll(":scope > .divider").forEach(Jt=>Jt.remove()),Ht.querySelector(":scope > .class-box-outline")?.remove();const zt=Se(Ht.querySelector(":scope > .annotation-group")),Fe=Se(Ht.querySelector(":scope > .label-group")),Ze=Se(Ht.querySelector(":scope > .members-group")),Le=Se(Ht.querySelector(":scope > .methods-group")),ne=[zt,Fe].filter(Jt=>Jt!==null),It=[{groups:ne,centered:!0},...Ze?[{groups:[Ze],centered:!1}]:[],...Le?[{groups:[Le],centered:!1}]:[]];if(!ne.length)return[];const ie=It.map(({groups:Jt})=>Jt.reduce((tr,Cr,hr)=>tr+Cr.bounds.height+(hr?V:0),0)),Ie=Math.max(...It.flatMap(({groups:Jt})=>Jt.map(tr=>tr.bounds.width))),ve=Math.max(Me.width,Ie+U*2),Oe=-ve/2,Ke=-(ie[0]+j*2)/2;let De=Ke+j;const Te=[];for(const[Jt,tr]of It.entries()){for(const[Cr,hr]of tr.groups.entries()){Cr&&(De+=V);const Fr=tr.centered?-hr.bounds.width/2-hr.bounds.x:Oe+U-hr.bounds.x;hr.element.setAttribute("transform",`translate(${Fr}, ${De-hr.bounds.y})`),De+=hr.bounds.height}if(De+=j,Jt<It.length-1){const Cr=document.createElementNS("http://www.w3.org/2000/svg","line");Cr.classList.add("class-box-divider"),Cr.setAttribute("x1",String(Oe)),Cr.setAttribute("x2",String(Oe+ve)),Cr.setAttribute("y1",String(De)),Cr.setAttribute("y2",String(De)),Te.push(Cr),De+=j}}const me=document.createElementNS("http://www.w3.org/2000/svg","rect");me.classList.add("class-box-outline"),me.setAttribute("x",String(Oe)),me.setAttribute("y",String(Ke)),me.setAttribute("width",String(ve)),me.setAttribute("height",String(De-Ke)),Ht.insertBefore(me,Vt),Vt.style.display="none";const Ue=Ht.querySelector(":scope > .annotation-group, :scope > .label-group, :scope > .members-group, :scope > .methods-group");for(const Jt of Te)Ht.insertBefore(Jt,Ue);return[{element:Ht,name:Fe.element.textContent?.trim()??"",...de,box:me.getBBox(),originalBox:Me,deltaX:0,deltaY:0}]}),Ct=()=>{const Ht=Math.min(...ut.map(zt=>zt.x+zt.deltaX+zt.box.x)),Vt=Math.min(...ut.map(zt=>zt.y+zt.deltaY+zt.box.y)),de=Math.max(...ut.map(zt=>zt.x+zt.deltaX+zt.box.x+zt.box.width)),Me=Math.max(...ut.map(zt=>zt.y+zt.deltaY+zt.box.y+zt.box.height));return new DOMRect(Ht,Vt,de-Ht,Me-Vt)};if(ut.length<2)return ut.length?Ct():null;const Ft=Math.max(...ut.map(Ht=>Ht.x))-Math.min(...ut.map(Ht=>Ht.x)),Z=Math.max(...ut.map(Ht=>Ht.y))-Math.min(...ut.map(Ht=>Ht.y))>=Ft,St=Ht=>Z?Ht.y:Ht.x,$t=[];for(const Ht of ut.toSorted((Vt,de)=>St(Vt)-St(de))){const Vt=$t.at(-1);Vt&&Math.abs(St(Vt[0])-St(Ht))<1?Vt.push(Ht):$t.push([Ht])}let Wt=Number.NEGATIVE_INFINITY;for(const Ht of $t){const Vt=Math.min(...Ht.map(zt=>St(zt)+(Z?zt.box.y:zt.box.x))),de=Math.max(...Ht.map(zt=>St(zt)+(Z?zt.box.y+zt.box.height:zt.box.x+zt.box.width))),Me=Number.isFinite(Wt)?Math.max(0,Wt+24-Vt):0;for(const zt of Ht)Z?zt.deltaY=Me:zt.deltaX=Me,zt.element.setAttribute("transform",`translate(${zt.x+zt.deltaX}, ${zt.y+zt.deltaY})`);Wt=de+Me}for(const Ht of at.querySelectorAll('.edgePaths path[data-edge="true"]')){const Vt=Ht.getTotalLength();if(!Vt)continue;const de=Ht.getPointAtLength(0),Me=Ht.getPointAtLength(Vt),zt=ve=>ut.toSorted((Oe,Ke)=>{const De=Te=>{const{originalBox:me}=Te,Ue=Math.max(Te.x+me.x-ve.x,0,ve.x-Te.x-me.x-me.width),Jt=Math.max(Te.y+me.y-ve.y,0,ve.y-Te.y-me.y-me.height);return Math.hypot(Ue,Jt)};return De(Oe)-De(Ke)})[0],Fe=Ht.dataset.id??"",Ze=ut.flatMap(ve=>ut.filter(Oe=>Oe!==ve).map(Oe=>({source:ve,target:Oe}))).find(({source:ve,target:Oe})=>Fe.startsWith(`id_${ve.name}_${Oe.name}_`)),Le=Ze?.source??zt(de),ne=Ze?.target??zt(Me);if(!Le||!ne||Le===ne)continue;const It={x:Le.x+Le.deltaX+Le.box.x+Le.box.width/2,y:Le.y+Le.deltaY+Le.box.y+Le.box.height/2},ie={x:ne.x+ne.deltaX+ne.box.x+ne.box.width/2,y:ne.y+ne.deltaY+ne.box.y+ne.box.height/2};if(Math.abs(ie.x-It.x)>Math.abs(ie.y-It.y)){const ve=Math.sign(ie.x-It.x)||1,Oe=Le.x+Le.deltaX+(ve>0?Le.box.x+Le.box.width:Le.box.x),Ke=ne.x+ne.deltaX+(ve>0?ne.box.x:ne.box.x+ne.box.width),De=(Oe+Ke)/2,Te=[{x:Oe,y:It.y},{x:De,y:It.y},{x:De,y:ie.y},{x:Ke,y:ie.y}];Ht.setAttribute("d",Te.map((me,Ue)=>`${Ue?"L":"M"}${me.x},${me.y}`).join("")),Ht.dataset.manhattanPoints=Te.map(me=>`${me.x},${me.y}`).join(" ")}else{const ve=Math.sign(ie.y-It.y)||1,Oe=Le.y+Le.deltaY+(ve>0?Le.box.y+Le.box.height:Le.box.y),Ke=ne.y+ne.deltaY+(ve>0?ne.box.y:ne.box.y+ne.box.height),De=(Oe+Ke)/2,Te=[{x:It.x,y:Oe},{x:It.x,y:De},{x:ie.x,y:De},{x:ie.x,y:Ke}];Ht.setAttribute("d",Te.map((me,Ue)=>`${Ue?"L":"M"}${me.x},${me.y}`).join("")),Ht.dataset.manhattanPoints=Te.map(me=>`${me.x},${me.y}`).join(" ")}}return Ct()}function Xt(at,ut){const Ct=Number.parseFloat(getComputedStyle(at).fontSize),Ft=ut*(12/(Number.isFinite(Ct)?Ct:13));at.style.setProperty("--mermaid-readable-width",`${Ft.toFixed(3)}px`)}function w(at){const ut=at.getBBox(),Ft=at.querySelector(".edgePaths path, g.node")?.getScreenCTM()?.inverse();if(!Ft)return ut;const wt=[...at.querySelectorAll(".edgeLabels > .edgeLabel")].flatMap(Vt=>{if(!Vt.textContent?.trim())return[];const de=Vt.getBoundingClientRect(),Me=[new DOMPoint(de.left,de.top),new DOMPoint(de.right,de.top),new DOMPoint(de.right,de.bottom),new DOMPoint(de.left,de.bottom)].map(ne=>ne.matrixTransform(Ft)),zt=Math.min(...Me.map(ne=>ne.x)),Fe=Math.min(...Me.map(ne=>ne.y)),Ze=Math.max(...Me.map(ne=>ne.x)),Le=Math.max(...Me.map(ne=>ne.y));return[{x:zt,y:Fe,width:Ze-zt,height:Le-Fe}]}),Z=[ut,...wt],St=Math.min(...Z.map(Vt=>Vt.x)),$t=Math.min(...Z.map(Vt=>Vt.y)),Wt=Math.max(...Z.map(Vt=>Vt.x+Vt.width)),Ht=Math.max(...Z.map(Vt=>Vt.y+Vt.height));return{x:St,y:$t,width:Wt-St,height:Ht-$t}}async function J(at,ut,Ct,Ft){const wt=++I;if(await Th(),await document.fonts?.ready,at!==O)return!1;const Z=A(k)?.querySelector(".mermaid-svg svg");if(!Z||(k3(Z,Ct),typeof Z.getBBox!="function"))return!1;if(delete Z.dataset.layoutSettled,Mt(Z),Ha(Z),Z.getAttribute("aria-roledescription")==="sequence")return await ke(Z,ut),at!==O||wt!==I?!1:(pp(Z),ot(Z),Xt(Z,Z.viewBox.baseVal.width),Z.dataset.layoutGeneration=String(at),Z.dataset.layoutSettled="true",!0);ht(Z),H(Z),G(Z),K(Z),vt(Z),tt(Z),pp(Z),ot(Z),Z.getAttribute("aria-roledescription")!=="flowchart-v2"&&K3(Z,Ct),G3(Z),X3(Z),j3(Z);const St=Z.getAttribute("aria-roledescription")==="flowchart-v2";if(St&&(Z.dataset.flowchartDirection=ut.match(/^\s*(?:flowchart|graph)\s+(\w+)\b/m)?.[1]??""),St){B3(Z);const Jt=Z.getBBox(),tr=16,Cr=Math.ceil(Jt.width+tr*2),hr=Math.ceil(Jt.height+tr*2);if(Z.setAttribute("viewBox",`${Jt.x-tr} ${Jt.y-tr} ${Cr} ${hr}`),Z.setAttribute("width",String(Cr)),Z.setAttribute("height",String(hr)),Xt(Z,Cr),js(Z),rn(Z.ownerDocument)||await new Promise(lr=>setTimeout(lr,64)),at!==O||wt!==I)return!1;const Fr=w(Z),$r=Z.viewBox.baseVal;if(Fr.x<$r.x||Fr.y<$r.y||Fr.x+Fr.width>$r.x+$r.width||Fr.y+Fr.height>$r.y+$r.height){const lr=Math.min($r.x,Fr.x-tr),ni=Math.min($r.y,Fr.y-tr),Xr=Math.ceil(Math.max($r.x+$r.width,Fr.x+Fr.width+tr)-lr),ti=Math.ceil(Math.max($r.y+$r.height,Fr.y+Fr.height+tr)-ni);Z.setAttribute("viewBox",`${lr} ${ni} ${Xr} ${ti}`),Z.setAttribute("width",String(Xr)),Z.setAttribute("height",String(ti)),Xt(Z,Xr)}return Z.dataset.layoutGeneration=String(at),Z.dataset.layoutSettled="true",!0}const $t=A(k)?.clientWidth??0,Wt=$t>0?$t<=620:A(B);St&&!Wt&&Z.querySelectorAll("g.cluster").length>=2&&Jn(Z);const Ht=Z.dataset.nestedDecisionLayout==="wide"?b$(Z)??Z.getBBox():Z.getBBox(),Vt=Number.parseFloat(getComputedStyle(Z).fontSize),de=12/(Number.isFinite(Vt)?Vt:13),zt=!/^\s*(?:flowchart|graph)\s+(?:LR|RL|BT)\b/m.test(ut)&&(Wt||St&&Ht.width*de>$t);if(zt&&(bh(Z,!1,Ct),bh(Z,!0,Ct)),await new Promise(Jt=>requestAnimationFrame(()=>requestAnimationFrame(()=>Jt()))),at!==O)return!1;Z.getBoundingClientRect(),zt&&Pt(Z),St&&S$(Z),xh(Z),Bp(Z),Jn(Z);let Fe=null;zt?(bh(Z,!0,Ct),xh(Z,!0),Bp(Z),Jn(Z),Pt(Z),Ch(Z),Ya(Z),Fe=Z.getBBox()):(Ch(Z),Z.querySelector("g.cluster")&&Ya(Z));const Ze=Z.classList.contains("statediagram"),Le=A(E)?"compact":"wide",It=(!Ze||Z.dataset.stateRouteLayout!==Le)&&B$(Z,A(E),Ft);E$(Z),L$(Z),Ze&&It&&(Z.dataset.stateRouteLayout=Le);const ie=_t(Z);if(yh(Z),Ha(Z),wp(Z),P$(Z,A(E)),await new Promise(Jt=>requestAnimationFrame(()=>requestAnimationFrame(()=>Jt()))),at!==O)return!1;Ot(Z),Jn(Z),yh(Z),Ha(Z),Z.querySelector("g.cluster")&&Ya(Z);const Ie=Z.getBBox(),ve=[ie,Fe].filter(Jt=>!!Jt),Oe=Ie,Ke=ve.length?DOMRect.fromRect({x:Math.min(Oe.x,...ve.map(Jt=>Jt.x)),y:Math.min(Oe.y,...ve.map(Jt=>Jt.y)),width:Math.max(Oe.x+Oe.width,...ve.map(Jt=>Jt.x+Jt.width))-Math.min(Oe.x,...ve.map(Jt=>Jt.x)),height:Math.max(Oe.y+Oe.height,...ve.map(Jt=>Jt.y+Jt.height))-Math.min(Oe.y,...ve.map(Jt=>Jt.y))}):Oe;if(![Ke.x,Ke.y,Ke.width,Ke.height].every(Number.isFinite))return!1;const De=!!Z.querySelector("g.cluster");let Te=St?zt?Z.querySelector("g.cluster")?14:20:28:De?24:A(B)?Ze?10:8:10,me=Math.ceil(Ke.width+Te*2),Ue=Math.ceil(Ke.height+Te*2);if(Z.setAttribute("viewBox",`${Ke.x-Te} ${Ke.y-Te} ${me} ${Ue}`),Z.style.removeProperty("width"),Z.setAttribute("width",String(me)),Z.setAttribute("height",String(Ue)),Ze){if(await new Promise(tr=>requestAnimationFrame(()=>tr())),at!==O)return!1;const Jt=Z.getBBox();me=Math.ceil(Jt.width+Te*2),Ue=Math.ceil(Jt.height+Te*2),Z.setAttribute("viewBox",`${Jt.x-Te} ${Jt.y-Te} ${me} ${Ue}`),Z.setAttribute("width",String(me)),Z.setAttribute("height",String(Ue))}if(Xt(Z,me),rn(Z.ownerDocument)||await new Promise(Jt=>setTimeout(Jt,64)),at!==O)return!1;if(!zt&&Z.getAttribute("aria-roledescription")==="flowchart-v2"){xh(Z,!0),Ha(Z);const Jt=w(Z);me=Math.ceil(Jt.width+Te*2),Ue=Math.ceil(Jt.height+Te*2),Z.setAttribute("viewBox",`${Jt.x-Te} ${Jt.y-Te} ${me} ${Ue}`),Z.setAttribute("width",String(me)),Z.setAttribute("height",String(Ue)),Xt(Z,me)}if(Z.getAttribute("aria-roledescription")==="flowchart-v2"){if(await new Promise(Jt=>requestAnimationFrame(()=>Jt())),at!==O)return!1;Tp(Z),Mp(Z),vp(Z),Q3(Z),Ha(Z),zt&&Z.querySelector("g.cluster")&&Ya(Z)}if(zt&&(Pt(Z),Ch(Z),Ya(Z)),Z.getAttribute("aria-roledescription")==="flowchart-v2"){Tp(Z),Mp(Z),vp(Z),U3(Z),c$(Z);const Jt=J3(Z);yh(Z),De&&Ya(Z),r$(Z,Jt),Ha(Z),zt&&Z.querySelector('path[data-grouped-return-lane="right"]')&&(Te=Math.max(Te,23));const tr=w(Z);me=Math.ceil(tr.width+Te*2),Ue=Math.ceil(tr.height+Te*2),Z.setAttribute("viewBox",`${tr.x-Te} ${tr.y-Te} ${me} ${Ue}`),Z.setAttribute("width",String(me)),Z.setAttribute("height",String(Ue)),Xt(Z,me)}if((Ze||zt&&St&&!De&&!Z.dataset.decisionCycleLayout)&&(Z.style.setProperty("--mermaid-readable-width","0px"),Z.style.setProperty("max-width","100%")),Ze&&wp(Z),js(Z),rn(Z.ownerDocument)||await new Promise(Jt=>setTimeout(Jt,120)),at!==O||wt!==I)return!1;if(Z.getAttribute("aria-roledescription")==="flowchart-v2"){const Jt=w(Z);if(me=Math.ceil(Jt.width+Te*2),Ue=Math.ceil(Jt.height+Te*2),Z.setAttribute("viewBox",`${Jt.x-Te} ${Jt.y-Te} ${me} ${Ue}`),Z.setAttribute("width",String(me)),Z.setAttribute("height",String(Ue)),Xt(Z,me),await new Promise(tr=>requestAnimationFrame(()=>tr())),at!==O||wt!==I)return!1}return js(Z),Z.dataset.layoutGeneration=String(at),Z.dataset.layoutSettled="true",!0}async function dt(at,ut,Ct){const Ft=++O;gt($,Ft,!0),gt(F,0);const wt=P(at),Z=z(wt);if(!Z?.trim()){ut||gt(p,""),gt(m,null),gt(F,Ft,!0);return}try{const St=X(Y(Z)),$t=/(?:^|\n)\s*(?:flowchart|graph)\s/i.test(St),Wt=g3(getComputedStyle(document.documentElement),$t);Wt.suppressErrorRendering=!0;const Ht=/^\s*stateDiagram(?:-v2)?\b/m.test(St),Vt=/^\s*erDiagram\b/m.test(St);if(Wt.layout=Ht||Vt?"elk":"dagre",$t&&(Wt.flowchart={...Wt.flowchart,curve:"basis",nodeSpacing:48,rankSpacing:64}),A(B)&&(Wt.flowchart={...Wt.flowchart,nodeSpacing:48,padding:9,rankSpacing:48,wrappingWidth:A(E)&&/\bsubgraph\b/.test(St)?80:120},A(E)&&(Wt.sequence={...Wt.sequence,actorMargin:0,diagramMarginX:0,messageMargin:24,noteMargin:4,width:96,wrap:!0})),Wt.state={...Wt.state,wrappingWidth:Wt.flowchart?.wrappingWidth},await document.fonts?.load(`400 ${Wt.fontSize}px "${dp}"`),$t&&await document.fonts?.load(`500 ${Wt.fontSize}px "${dp}"`),!Ct())return;const de=await p3(async()=>{fh.initialize(Wt);const zt=`mermaid-${Date.now()}-${Math.random().toString(36).slice(2,11)}`,{svg:Fe}=await fh.render(zt,St);if(Ft!==O||!Ct())return;let Ze,Le;if(Ht||$t&&/class="[^"]*\bcluster\b/.test(Fe)){const ne=await fh.mermaidAPI.getDiagramFromText(St);if(Ft!==O||!Ct())return;ne.type==="flowchart-v2"&&(Ze=b3(ne.db.getSubGraphs())),ne.type==="stateDiagram"&&(Le=N3(ne.db.getData()))}return{svg:Fe,clusterMembership:Ze,stateDiagram:Le}},()=>Ft===O&&Ct());if(!de||Ft!==O||!Ct())return;gt(p,de.svg,!0),gt(m,null),await J(Ft,St,de.clusterMembership,de.stateDiagram)&&Ft===O&&gt(F,Ft,!0)}catch(St){if(Ft!==O||!Ct())return;if(ut){gt(m,null),gt(F,Ft,!0);return}r.error("Failed to render mermaid diagram:",St),gt(m,St instanceof Error?St.message:je.markdown_mermaid_renderFailed_error(),!0),gt(p,""),gt(F,Ft,!0)}}const mt=i3((at,ut)=>dt(at.source,at.isStreaming,ut));function ft(at){at.stopPropagation(),at.preventDefault(),gt(S,at.currentTarget,!0),document.activeElement instanceof HTMLElement&&document.activeElement.blur(),gt(b,A(k)?.querySelector(".mermaid-svg svg")?.outerHTML??A(p),!0),gt(x,!0)}function N(at){at.stopPropagation(),at.preventDefault(),f(!f())}function et(){gt(x,!1),gt(b,"")}function it(at){at.defaultPrevented||A(T)?.handleKeydown(at)}function ct(){v!==void 0&&cancelAnimationFrame(v),v=requestAnimationFrame(()=>{v=void 0;const at=A(L)?.querySelector("svg");at&&js(at)})}hd(()=>{gt(y,!0);const at=A(k)?.closest(".node-mermaidBlock"),ut=at??A(k),Ct=()=>at?.clientWidth??A(k)?.clientWidth??0;let Ft,wt;const Z=typeof ResizeObserver>"u"?void 0:new ResizeObserver(()=>{const Wt=Ct();Wt!==Ft&&(Ft=Wt,gt(B,Wt<=620),gt(E,A(E)?Wt<440:Wt<=420,!0));const Ht=A(k)?.clientWidth;if(Ht===wt)return;wt=Ht;const Vt=A(k)?.querySelector(".mermaid-svg svg");Vt?.dataset.layoutSettled==="true"&&js(Vt)});ut&&Z&&(Ft=Ct(),gt(B,Ft<=620),gt(E,Ft<=420),Z.observe(ut),A(k)&&A(k)!==ut&&Z.observe(A(k)));let St=D();const $t=new MutationObserver(()=>{const Wt=D();Wt!==St&&(St=Wt,gt(M,A(M)+1))});return $t.observe(document.documentElement,{attributes:!0,attributeFilter:["class","style"]}),()=>{$t.disconnect(),Z?.disconnect(),v!==void 0&&cancelAnimationFrame(v),mt.dispose(),O+=1}}),Bo(()=>{const at={source:n(),isStreaming:l(),revision:`${A(M)}:${A(B)}:${A(E)}`};A(y)&&A(k)&&pl(()=>mt.update(at))});let xt=Dt(()=>A(m)?"error":A(p)?"rendered":!n()?.trim()&&!l()?"empty":"pending");Bo(()=>{g()?.(A(xt))});var Tt={get code(){return n()},set code(at){n(at),_e()},get isStreaming(){return l()},set isStreaming(at=!1){l(at),_e()},get className(){return c()},set className(at=""){c(at),_e()},get showExpandButton(){return h()},set showExpandButton(at=!0){h(at),_e()},get showSourceButton(){return d()},set showSourceButton(at=!0){d(at),_e()},get showExportButton(){return u()},set showExportButton(at=!1){u(at),_e()},get showSource(){return f()},set showSource(at=!1){f(at),_e()},get onRenderStateChange(){return g()},set onRenderStateChange(at){g(at),_e()},$set:Do,$on:(at,ut)=>Ro(t,at,ut)},st=H$(),kt=ui(st);let jt;var re=qe(kt),Kt=qe(re);q(Kt,{size:30,weight:"light"}),$e(re),no(re,at=>gt(_,at),()=>A(_));var xe=We(re,2);{var Pe=at=>{var ut=I$(),Ct=qe(ut),Ft=qe(Ct),wt=Tr(Ft,!0),Z=We(Ft,2),St=Tr(Z,!0);$e(Ct);var $t=We(Ct,2),Wt=qe($t),Ht=Tr(Wt,!0),Vt=We(Wt,2),de=Tr(Vt,!0),Me=We(Vt,2),zt=Tr(Me,!0),Fe=We(Me,2),Ze=Tr(Fe,!0);$e($t),$e(ut),cr((Le,ne,It,ie)=>{br(wt,Le),br(St,ne),br(Ht,It),br(de,A(m)),br(zt,ie),br(Ze,A(R))},[()=>je.markdown_mermaid_renderFailed_error(),()=>je.markdown_mermaid_invalid_description(),()=>je.markdown_mermaid_errorDetails_label(),()=>je.markdown_mermaid_viewSource_label()]),ge(at,ut)},mi=at=>{var ut=R$(),Ct=ui(ut),Ft=qe(Ct);let wt;var Z=qe(Ft);zu(Z,()=>A(p),!0),$e(Z),$e(Ft);var St=We(Ft,2);{var $t=Vt=>{var de=O$();let Me;var zt=qe(de);{var Fe=ie=>{{let Ie=Dt(()=>je.markdown_mermaid_viewSource_label()),ve=Dt(()=>je.markdown_mermaid_viewSource_label());Ja(ie,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"mermaid-action-button",onclick:N,get"aria-pressed"(){return f()},get"aria-label"(){return A(Ie)},get tooltip(){return A(ve)},children:(Oe,Ke)=>{dn(Oe,{get icon(){return bC},size:"sm"})},$$slots:{default:!0}})}};yr(zt,ie=>{d()&&ie(Fe)})}var Ze=We(zt,2);{var Le=ie=>{{let Ie=Dt(()=>je.markdown_mermaid_expand_ariaLabel()),ve=Dt(()=>je.markdown_mermaid_expand_tooltip());Ja(ie,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"mermaid-action-button expand-button",onclick:ft,get"aria-label"(){return A(Ie)},get tooltip(){return A(ve)},children:(Oe,Ke)=>{dn(Oe,{get icon(){return zp},size:"sm"})},$$slots:{default:!0}})}};yr(Ze,ie=>{h()&&ie(Le)})}var ne=We(Ze,2);{var It=ie=>{Bu(ie,{get container(){return A(k)},compactTrigger:!0})};yr(ne,ie=>{u()&&ie(It)})}$e(de),cr(ie=>{Me=co(de,1,"mermaid-actions svelte-9cn23y",null,Me,{"with-export":u()}),fe(de,"aria-label",ie)},[()=>je.markdown_mermaid_actions_ariaLabel()]),ge(Vt,de)};yr(St,Vt=>{(d()||h()||u())&&Vt($t)})}$e(Ct);var Wt=We(Ct,2);{var Ht=Vt=>{var de=D$(),Me=qe(de),zt=Tr(Me,!0);$e(de),cr(Fe=>{fe(de,"aria-label",Fe),br(zt,A(R))},[()=>je.markdown_mermaid_viewSource_label()]),ge(Vt,de)};yr(Wt,Vt=>{f()&&Vt(Ht)})}cr(()=>wt=co(Ft,1,"mermaid-svg-viewport svelte-9cn23y",null,wt,{"without-actions":!d()&&!h()&&!u()})),ge(at,ut)},xo=at=>{var ut=N$(),Ct=qe(ut),Ft=Tr(Ct,!0),wt=We(Ct,2),Z=Tr(wt,!0);$e(ut),cr((St,$t)=>{br(Ft,St),br(Z,$t)},[()=>je.markdown_mermaid_noCode_label(),()=>je.markdown_mermaid_noCode_description()]),ge(at,ut)},bo=Dt(()=>!n()?.trim()&&!l()),$s=at=>{var ut=q$(),Ct=Tr(ut,!0);cr(Ft=>br(Ct,Ft),[()=>je.ui_spinner_loading_ariaLabel()]),ge(at,ut)};yr(xe,at=>{A(m)?at(Pe):A(p)?at(mi,1):A(bo)?at(xo,2):at($s,-1)})}$e(kt),no(kt,at=>gt(k,at),()=>A(k));var Es=We(kt,2);{let at=Dt(()=>je.markdown_mermaid_fullscreenView_ariaLabel()),ut=Dt(()=>je.markdown_mermaid_closeFullscreen_ariaLabel());DC(Es,{get ariaLabel(){return A(at)},get closeLabel(){return A(ut)},onClose:et,get openerElement(){return A(S)},onKeydown:it,get open(){return A(x)},set open(Ct){gt(x,Ct,!0)},children:(Ct,Ft)=>{var wt=z$(),Z=qe(wt);no(RC(Z,{onScaleChange:ct,children:(St,$t)=>{var Wt=W$();zu(Wt,()=>A(b),!0),$e(Wt),no(Wt,Ht=>gt(L,Ht),()=>A(L)),ge(St,Wt)},$$slots:{default:!0}}),St=>gt(T,St,!0),()=>A(T)),$e(wt),ge(Ct,wt)},$$slots:{default:!0}})}return cr(at=>{jt=co(kt,1,`mermaid-renderer ${c()??""}`,"svelte-9cn23y",jt,{"has-diagram":at}),fe(kt,"data-render-generation",A($)),fe(kt,"data-render-settled-generation",A(F)),fe(kt,"data-render-settled",A($)>0&&A(F)===A($))},[()=>!!A(p)]),ge(e,st),qo(Tt)}const Gi={labelFontSize:13,labelCharWidthRatio:.6,labelLineHeight:1.26,kindFontSize:11,kindCharWidthRatio:.88,kindLineHeight:1,paddingX:16,paddingY:12,gap:4,maxLines:3,maxWidth:250},Fi=Object.freeze({fontSize:Gi.kindFontSize,lineHeight:Gi.labelLineHeight,paddingX:6,paddingY:4}),X$={architecture:{defaultNodeKinds:["service","db","queue","actor","ui_component"],defaultEdgeKinds:["request","response","event","data"],defaultLayout:{type:"layered",direction:"LR",spacing:30,edgeRouting:"orthogonal"},nodeDefaults:{width:80,height:40}},sequence:{defaultNodeKinds:["actor"],defaultEdgeKinds:["message","return"],defaultLayout:{type:"layered",direction:"TB",spacing:50,edgeRouting:"polyline"},nodeDefaults:{width:75,height:32}},state_machine:{defaultNodeKinds:["state","start","end"],defaultEdgeKinds:["transition"],defaultLayout:{type:"layered",direction:"LR",spacing:35,edgeRouting:"curved"},nodeDefaults:{width:75,height:38}},data_flow:{defaultNodeKinds:["process","data_store","external"],defaultEdgeKinds:["flow"],defaultLayout:{type:"layered",direction:"LR",spacing:30,edgeRouting:"polyline"},nodeDefaults:{width:80,height:40}},network:{defaultNodeKinds:["node","router","switch","server"],defaultEdgeKinds:["connection"],defaultLayout:{type:"force",spacing:60,edgeRouting:"polyline"},nodeDefaults:{width:60,height:60}},flowchart:{defaultNodeKinds:["process","decision","start","end","data"],defaultEdgeKinds:["flow"],defaultLayout:{type:"layered",direction:"TB",spacing:50,edgeRouting:"orthogonal"},nodeDefaults:{width:80,height:40}},timeline:{defaultNodeKinds:["event","milestone"],defaultEdgeKinds:["sequence"],defaultLayout:{type:"layered",direction:"LR",spacing:60,edgeRouting:"polyline"},nodeDefaults:{width:75,height:38}},dependency_graph:{defaultNodeKinds:["module","package","file"],defaultEdgeKinds:["depends_on","imports"],defaultLayout:{type:"layered",direction:"TB",spacing:40,edgeRouting:"polyline"},nodeDefaults:{width:75,height:38}}},j$=1.78,G$=900,U$=30,V$=300,Zo=6,Z$=112,_p=32,K$=Fi.fontSize*Gi.labelCharWidthRatio,Qa=Fi.paddingX*2,Q$=Fi.paddingY*2,wh=0,J$=Fi.fontSize*Fi.lineHeight,tE=14,eE=8,rE=32,nd=500,iE=.84,Uo=16,Sa=Object.freeze({centerY:24,headerHeight:68,horizontalPadding:24});function bn(e,t=Number.POSITIVE_INFINITY){if(e.length>=48)return 100;const r=di(e,60);return r.lines>=3&&t<r.height+16?80:60}let ma,kh;function va(e,t){return typeof document>"u"?t:getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t}function Gl(e,t,r,i,o=0,a=va("--font-ui","Inter, system-ui, sans-serif")){return ma===void 0&&(ma=typeof document<"u"&&typeof CanvasRenderingContext2D<"u"?document.createElement("canvas").getContext("2d"):null),ma?(ma.font=`${r} ${t}px ${a}`,ma.measureText(e).width+Math.max(0,e.length-1)*o):e.length*i}function Iu(e){const t=Fi.fontSize,r=va("--text-caption-weight","500"),i=va("--text-caption-tracking","-0.01em"),o=Number.parseFloat(i),a=Number.isFinite(o)?i.endsWith("em")?o*t:o:t*-.01,s=Math.max(...e.split(`
330
330
  `).map(n=>Gl(n,t,r,t*.5,a)));return Math.ceil(s)+Sa.horizontalPadding*2}function ld(e){const t=Iu(e.label)-Sa.horizontalPadding*2,r=Fi.fontSize;return{left:e.x+(e.width-t)/2-Zo,right:e.x+(e.width+t)/2+Zo,top:e.y+Sa.centerY-r,bottom:e.y+Sa.centerY+r}}function di(e,t=Z$){const r=Fi.fontSize,i=va("--text-body-weight","400"),o=va("--text-caption-tracking","-0.01em"),a=Number.parseFloat(o),s=Number.isFinite(a)?o.endsWith("em")?a*r:a:-.01*r;kh===void 0&&(kh=typeof document<"u"&&typeof CanvasRenderingContext2D<"u"?document.createElement("canvas").getContext("2d"):null);const n=kh;n&&(n.font=`${i} ${r}px ${va("--font-ui","Inter, system-ui, sans-serif")}`,n.letterSpacing=`${s}px`);const l=m=>n?.measureText(m).width??Gl(m,r,i,K$,s),c=e.split(`
331
331
  `),h=Math.max(...c.map(l))+Qa+wh,d=Math.max(...e.split(/\s+/).map(l),_p-Qa)+Qa+wh,u=Math.max(t,d),f=Math.ceil(Math.max(_p,Math.min(h,u))),g=f-Qa-wh,p=c.reduce((m,y)=>{const x=y.trim().split(/\s+/).filter(Boolean);if(!x.length)return m+1;let b=1,S="";for(const T of x){const k=l(T);if(k>g){S&&(b+=1),b+=Math.max(1,Math.ceil(k/g))-1,S="";continue}const _=S?`${S} ${T}`:T;S&&l(_)>g?(b+=1,S=T):S=_}return m+b},0);return{width:f,height:Math.min(p,3)*J$+Q$,lines:p}}function Sh(e){return di(e).width}function Cn(e,t=Zo){if(e.length===0)return"";const r=[`M ${e[0].x} ${e[0].y}`];for(let o=1;o<e.length-1;o+=1){const a=e[o-1],s=e[o],n=e[o+1],l=Math.hypot(s.x-a.x,s.y-a.y),c=Math.hypot(n.x-s.x,n.y-s.y),h=(s.x-a.x)*(n.y-s.y)-(s.y-a.y)*(n.x-s.x),d=Math.min(t,l/2,c/2);if(d<=0||Math.abs(h)<.001){r.push(`L ${s.x} ${s.y}`);continue}const u={x:s.x-(s.x-a.x)/l*d,y:s.y-(s.y-a.y)/l*d},f={x:s.x+(n.x-s.x)/c*d,y:s.y+(n.y-s.y)/c*d};r.push(`L ${u.x} ${u.y}`,`Q ${s.x} ${s.y} ${f.x} ${f.y}`)}const i=e[e.length-1];return r.push(`L ${i.x} ${i.y}`),r.join(" ")}function Ms(e,t=80){return Math.max(U$,Math.min(V$,e??t))}function oE(e,t,r,i=Gi,o=G$){const a=new Set(e.nodes.map(g=>g.id)),s={...e,edges:e.edges.filter(g=>a.has(g.from)&&a.has(g.to))},n=X$[r],l=n?.nodeDefaults||{width:100,height:60},c=s.nodes.map(g=>({...g,size:g.size||N1(g,l,i)})),h={...n?.defaultLayout,...t.layout,edgeRouting:t.layout.edgeRouting||t.edgeRouting||n?.defaultLayout?.edgeRouting},d=t.layout.direction;if(!d&&["layered","tree"].includes(h.type)){const g={...h,direction:"LR"},p={...h,direction:"TB"},m=vh(c,s,g,l),y=vh(c,s,p,l),x=aE(m,y,o),b=x===m?g:p;return o<nd||x.bounds.width>o?Ap(x,o,Ms(h.spacing,80),b,l,i):x}const u=vh(c,s,h,l);return d==="LR"||d==="RL"?u:o<nd||!s.groups?.length&&(u.bounds.width>o||u.bounds.height>0&&u.bounds.width/u.bounds.height>j$)?Ap(u,o,Ms(h.spacing,80),h,l,i):u}function aE(e,t,r){if(r<nd)return t;const i=Lp(e,r),o=Lp(t,r);return i.unreadable!==o.unreadable?i.unreadable?t:e:i.collisions!==o.collisions?i.collisions<o.collisions?e:t:i.overlaps!==o.overlaps?i.overlaps<o.overlaps?e:t:i.crossings>o.crossings+1||i.overflow>o.overflow+.1?t:e}function Lp(e,t){const r=e.edges.flatMap(n=>R1(n.points??[]));let i=0,o=0,a=0;for(let n=0;n<r.length;n+=1){for(let l=n+1;l<r.length;l+=1){const c=sE(r[n],r[l]);c==="crossing"&&(i+=1),c==="overlap"&&(o+=1)}a+=e.nodes.filter(l=>nE(r[n],l)).length}const s=Math.min(1,t/Math.max(e.bounds.width,1));return{crossings:i,overlaps:o,collisions:a,unreadable:s<iE,overflow:Math.max(0,e.bounds.width/Math.max(t,1)-1)}}function R1(e){return e.slice(1).flatMap((t,r)=>{const i=e[r],o=Math.abs(i.y-t.y)<.001,a=Math.abs(i.x-t.x)<.001;return o||a?[{start:i,end:t,horizontal:o}]:[]})}function sE(e,t){const r=(c,h)=>[Math.min(c,h),Math.max(c,h)];if(e.horizontal===t.horizontal){const c=e.horizontal?e.start.y:e.start.x,h=t.horizontal?t.start.y:t.start.x;if(Math.abs(c-h)>=.001)return"none";const[d,u]=e.horizontal?r(e.start.x,e.end.x):r(e.start.y,e.end.y),[f,g]=t.horizontal?r(t.start.x,t.end.x):r(t.start.y,t.end.y);return Math.min(u,g)-Math.max(d,f)>.5?"overlap":"none"}const i=e.horizontal?e:t,o=e.horizontal?t:e,[a,s]=r(i.start.x,i.end.x),[n,l]=r(o.start.y,o.end.y);return o.start.x>a+.5&&o.start.x<s-.5&&i.start.y>n+.5&&i.start.y<l-.5?"crossing":"none"}function nE(e,t){if(e.horizontal){const o=Math.min(e.start.x,e.end.x),a=Math.max(e.start.x,e.end.x);return e.start.y>t.y+.5&&e.start.y<t.y+t.height-.5&&a>t.x+.5&&o<t.x+t.width-.5}const r=Math.min(e.start.y,e.end.y),i=Math.max(e.start.y,e.end.y);return e.start.x>t.x+.5&&e.start.x<t.x+t.width-.5&&i>t.y+.5&&r<t.y+t.height-.5}function Ap(e,t,r,i,o,a){const s=e.edges.some(x=>!!x.label)||e.nodes.some(x=>x.width>t),n=i.type==="manual"&&e.bounds.width>t;if(t<500&&s||n){const x=Math.max(150,Math.min(260,t)),b=e.nodes.map(M=>{const B=Math.min(M.width,x),E=N1(M,o,a,B).height;return{...M,width:B,height:M.size?Math.max(M.size.height,E):E}}),S=Math.max(...b.map(M=>M.width)),T=new Map;for(const M of e.edges)M.label&&T.set(M.from,(T.get(M.from)??0)+1);let k=0;const _=b.map(M=>{const B={...M,x:(S-M.width)/2,y:k},E=T.get(M.id)??0;return k+=M.height+Math.max(140,E*62+60,r*.65),B}),L=e.groups?Fp(e.groups,_):void 0,v=xE(e.edges,_,L);return{nodes:_,groups:L,edges:v,bounds:$p(_,L,v)}}if(e.bounds.width<=t)return e;const l=[...e.nodes],c=Math.max(...l.map(x=>x.height))+r,h=[...l].sort((x,b)=>x.x-b.x),d=new Map;let u=0,f=0;h.forEach(x=>{const b=x.x-e.bounds.minX-f;b+x.width>t&&b>0&&(f=x.x-e.bounds.minX,u+=c+r),d.set(x.id,{dx:-f,dy:u})});const g=l.map(x=>{const b=d.get(x.id)||{dx:0,dy:0};return{...x,x:x.x+b.dx,y:x.y+b.dy}}),p=e.groups?Fp(e.groups,g):void 0,m=W1(e.edges,g,i,p),y=$p(g,p,m);return{nodes:g,edges:m,groups:p,bounds:y}}function Fp(e,t){return e.map(r=>{const i=new Set(r.nodeIds??[]),o=t.filter(g=>g.group===r.id||i.has(g.id));if(o.length===0)return r;const a=30,s=Sa.headerHeight,n=30,l=Math.min(...o.map(g=>g.x)),c=Math.max(...o.map(g=>g.x+g.width)),h=Math.max(c-l+a*2,Iu(r.label)),d=(l+c-h)/2,u=Math.min(...o.map(g=>g.y))-s,f=Math.max(...o.map(g=>g.y+g.height))+n;return{...r,x:d,y:u,width:h,height:f-u}})}function $p(e,t,r){if(e.length===0)return{minX:0,minY:0,maxX:0,maxY:0,width:0,height:0};let i=Math.min(...e.map(n=>n.x)),o=Math.min(...e.map(n=>n.y)),a=Math.max(...e.map(n=>n.x+n.width)),s=Math.max(...e.map(n=>n.y+n.height));if(t&&t.length>0&&(i=Math.min(i,...t.map(n=>n.x)),o=Math.min(o,...t.map(n=>n.y)),a=Math.max(a,...t.map(n=>n.x+n.width)),s=Math.max(s,...t.map(n=>n.y+n.height))),r&&r.length>0){for(const n of r)if(n.points)for(const l of n.points)i=Math.min(i,l.x),o=Math.min(o,l.y),a=Math.max(a,l.x),s=Math.max(s,l.y)}return{minX:i,minY:o,maxX:a,maxY:s,width:a-i,height:s-o}}function vh(e,t,r,i){const o=lE(e,t.edges,r,i,t.groups);if((r.type==="layered"||r.type==="tree")&&r.direction==="RL"){const c=Math.min(...o.map(({x:d})=>d)),h=Math.max(...o.map(({x:d,width:u})=>d+u));for(const d of o)d.x=c+h-d.x-d.width}if((r.type==="layered"||r.type==="tree")&&r.direction==="BT"){const c=Math.min(...o.map(({y:d})=>d)),h=Math.max(...o.map(({y:d,height:u})=>d+u));for(const d of o)d.y=c+h-d.y-d.height}const a=t.groups?wE(t.groups,o):void 0,s=gE(t.edges,o,r,a),n=new Map;for(const c of s){const h=c.id,d=n.get(h)??0;d>0&&(c.id=`${h}-${d}`),n.set(h,d+1)}const l=kE(o,a,s);return{nodes:o,edges:s,groups:a,bounds:l}}function N1(e,t,r,i=r.maxWidth){const o=r===Gi,a=["db","store","data_store"].includes(e.kind??""),s=(o?10:r.paddingX)+(a?8:0),n=o?7:r.paddingY,l=o?2:r.gap,c=o?11:r.kindFontSize,h=tE+eE,d=0,u=Math.min(r.maxWidth,i),f=/[^\x00-\x7f]/.test(e.label)?10:8,g=.6,p=r.labelFontSize*(o?g:r.labelCharWidthRatio),m=c*(o?g:r.kindCharWidthRatio),y=e.label.split(/\r\n?|\n/),b=fp(e.label).length<=2&&e.label.length<=20,S="600",T=va("--font-editorial","Georgia, Times New Roman, serif"),k=j=>Gl(j,r.labelFontSize,S,p,-.01*r.labelFontSize,T)+(ma?(j.length-ad(j).length)*.01*r.labelFontSize:0),_=j=>Gl(j,c,"500",m,.015*c)-(ma?(j.length-ad(j).length)*.015*c:0),L=y.map(k),v=Math.max(...L),M=Math.max(...y3(e.label).map(k),0),B=M>u,E=Math.max(1,u-s*2-h-d-f,B?0:M);let O,$=1;if(b&&!B)O=v,$=y.length;else{const j=Math.min(v,E),V=Math.min(E,Math.max(j,M));O=V,$=y.reduce((rt,ht)=>{const H=_u(ht);if(M>E||/[^\x00-\x7f]/.test(ht))return rt+gp(H??pc(ht).map(({text:ot})=>ot),V,k,H!==null);const G=H??fp(ht);if(!G.length)return rt+1;let K=1,tt="";for(const ot of G){const vt=k(ot);if(vt>V+.5){tt&&(K+=1),K+=Math.max(1,Math.ceil((vt-.5)/V))-1,tt="";continue}const Ot=tt?`${tt}${H?"":" "}${ot}`:ot;tt&&k(Ot)>V+.5?(K+=1,tt=ot):tt=Ot}return rt+K},0)}const I=r.labelFontSize*r.labelLineHeight*$;let F=0,R=0;if(e.kind){const j=e.kind.split(`
332
- `);F=Math.min(E,Math.max(...j.map(_))),R=c*r.kindLineHeight*j.reduce((V,Q)=>V+gp(Q.match(/\S+[\t ]*|[\t ]+/g)??[],E,_),0)}const q=e.kind?1:0,D=Math.max(O+f,F+q)+h,P=I+(e.kind?l+R:0),Y=Math.max(b?72:t.width*.6,a?112:0),X=h+s*2+d,z=Math.max(Math.min(Math.max(D+s*2+d,Y),u),Math.min(M,E)+X+f),U=Math.max(P+n*2+d,rE,a?90:0);return{width:z,height:U}}function lE(e,t,r,i,o){if(e.some(s=>s.position)||r.type==="manual"){const s=[],n=[];for(const u of e){const f=u.size?.width??i.width,g=u.size?.height??i.height;if(u.position){const p={...u,x:u.position.x,y:u.position.y,width:f,height:g};n.push(p),s.push(p)}else n.push({...u,x:0,y:0,width:f,height:g})}const l=Ms(r.spacing,80);for(let u=0;u<n.length;u++){if(e[u].position)continue;const g=n[u].width,p=n[u].height;let m=0,y=0,x=!1;for(let b=0;b<20&&!x;b++)for(let S=0;S<20&&!x;S++){const T=S*(g+l),k=b*(p+l);s.some(L=>!(T+g+l*.3<L.x||T>L.x+L.width+l*.3||k+p+l*.3<L.y||k>L.y+L.height+l*.3))||(m=T,y=k,x=!0)}n[u]={...n[u],x:m,y},s.push({x:m,y,width:g,height:p})}const c=new Map;for(const u of n){const f=e.find(({id:m})=>m===u.id)?.position;if(!f)continue;const g=[...c.keys()].find(m=>Math.abs(m-f.x)<=8),p=c.get(g??f.x)??[];p.push(u),c.set(g??f.x,p)}const h=Math.min(...n.map(u=>u.x)),d=new Set;for(const[u,f]of c){if(f.length<2)continue;const g=Math.max(...f.map(m=>m.width)),p=h+(u+g/2-h)*.89;for(const m of f)m.x=p-m.width/2,d.add(m.id)}for(const u of n)d.has(u.id)||(u.x=h+(u.x-h)*.89);return n}switch(r.type){case"layered":return Ep(e,t,r,i,o);case"force":return dE(e,t,r,i,o);case"circular":return uE(e,r,i);case"tree":return fE(e,t,r,i);default:return Ep(e,t,r,i,o)}}function Ep(e,t,r,i,o){const a=Ms(r.spacing,80),s=r.direction??"LR",n=s==="LR"||s==="RL",l=new Map;o&&(o.forEach(u=>{Array.isArray(u.nodeIds)&&u.nodeIds.forEach(f=>l.set(f,u.id))}),e.forEach(u=>{u.group&&l.set(u.id,u.group)}));const c=new Map,h=new Map;e.forEach(u=>{c.set(u.id,[]),h.set(u.id,[])}),t.forEach(u=>{c.get(u.from)?.push(u.to),h.get(u.to)?.push(u.from)});const d=new Map;return e.forEach(u=>{d.set(u.id,{width:u.size?.width??i.width,height:u.size?.height??i.height})}),o&&o.length>0?cE(e,t,o,d,l,c,h,a,n):hE(e,t,d,a,n)}function cE(e,t,r,i,o,a,s,n,l){const c="__ungrouped__",d=n<=40,u=Math.max(d?35:48,n*.75),f=Math.max(20,n*.32),g=new Map;r.forEach($=>g.set($.id,[])),g.set(c,[]),e.forEach($=>{const I=o.get($.id)||c;let F=g.get(I);F||(F=[],g.set(I,F)),F.push($.id)});const p=new Map,m=new Map,y=[...r.map($=>$.id),c];y.forEach($=>{p.set($,new Set),m.set($,new Set)}),t.forEach($=>{const I=o.get($.from)||c,F=o.get($.to)||c;I!==F&&(p.get(I)?.add(F),m.get(F)?.add(I))});const x=new Map,b=new Set;function S($){const I=x.get($);if(I!==void 0)return I;if(b.has($))return 0;b.add($);const F=y.indexOf($),R=[...m.get($)||new Set].filter(P=>!(p.get($)?.has(P)??!1)||y.indexOf(P)<F);let q=-1;R.forEach(P=>{q=Math.max(q,S(P))});const D=q+1;return x.set($,D),D}y.forEach($=>{(g.get($)?.length??0)>0&&S($)});const T=Math.max(...Array.from(x.values()),0),k=Array.from({length:T+1},()=>[]);x.forEach(($,I)=>{(g.get(I)?.length??0)>0&&k[$].push(I)});const _=new Map,L=new Map,v=new Map,M=new Map;e.forEach($=>{v.set($.id,[]),M.set($.id,[])}),t.forEach($=>{const I=o.get($.from)||c,F=o.get($.to)||c;I===F&&(v.get($.from)?.push($.to),M.get($.to)?.push($.from))}),y.forEach($=>{const I=g.get($)||[];if(I.length===0){L.set($,{width:0,height:0}),_.set($,{layers:[],nodeLayer:new Map,layerSpacing:[]});return}const F=new Set(I),R=new Map,q=new Set;function D(Q){const rt=R.get(Q);if(rt!==void 0)return rt;if(q.has(Q))return 0;q.add(Q);const ht=(M.get(Q)||[]).filter(K=>F.has(K));let H=-1;ht.forEach(K=>{H=Math.max(H,D(K))});const G=H+1;return R.set(Q,G),G}I.forEach(Q=>D(Q));const P=Math.max(...Array.from(R.values()),0),Y=Array.from({length:P+1},()=>[]);R.forEach((Q,rt)=>{F.has(rt)&&Y[Q].push(rt)});for(let Q=0;Q<4;Q++){for(let rt=1;rt<Y.length;rt++){const ht=Y[rt],H=Y[rt-1],G=new Map;ht.forEach(K=>{const ot=(M.get(K)||[]).filter(vt=>F.has(vt)).map(vt=>H.indexOf(vt)).filter(vt=>vt!==-1);ot.length>0?G.set(K,ot.reduce((vt,Ot)=>vt+Ot,0)/ot.length):G.set(K,ht.indexOf(K))}),ht.sort((K,tt)=>(G.get(K)??0)-(G.get(tt)??0))}for(let rt=Y.length-2;rt>=0;rt--){const ht=Y[rt],H=Y[rt+1],G=new Map;ht.forEach(K=>{const ot=(v.get(K)||[]).filter(vt=>F.has(vt)).map(vt=>H.indexOf(vt)).filter(vt=>vt!==-1);ot.length>0?G.set(K,ot.reduce((vt,Ot)=>vt+Ot,0)/ot.length):G.set(K,ht.indexOf(K))}),ht.sort((K,tt)=>(G.get(K)??0)-(G.get(tt)??0))}}const X=Y.slice(0,-1).map((Q,rt)=>{const ht=t.reduce((H,G)=>{if(!G.label||o.get(G.from)!==$||o.get(G.to)!==$||R.get(G.from)!==rt||R.get(G.to)!==rt+1)return H;const K=di(G.label);return Math.max(H,(l?K.width:K.height)+(d?18:24))},0);return Math.max(n*.5,ht)});_.set($,{layers:Y,nodeLayer:R,layerSpacing:X});let z=0,U=0;Y.forEach((Q,rt)=>{let ht=0,H=0;Q.forEach(G=>{const K=i.get(G);K&&(l?(H+=K.height+f,ht=Math.max(ht,K.width)):(H+=K.width+f,ht=Math.max(ht,K.height)))}),H-=f,U=Math.max(U,H),z+=ht,rt>0&&(z+=X[rt-1]??n*.5)});const j=l?z+64:U+64,V=l?U+64:z+64;L.set($,{width:j,height:V})});for(let $=0;$<4;$++){for(let I=1;I<k.length;I++){const F=k[I],R=k[I-1],q=new Map;F.forEach(D=>{const Y=Array.from(m.get(D)||[]).map(X=>R.indexOf(X)).filter(X=>X!==-1);Y.length>0?q.set(D,Y.reduce((X,z)=>X+z,0)/Y.length):q.set(D,F.indexOf(D))}),F.sort((D,P)=>(q.get(D)??0)-(q.get(P)??0))}for(let I=k.length-2;I>=0;I--){const F=k[I],R=k[I+1],q=new Map;F.forEach(D=>{const Y=Array.from(p.get(D)||[]).map(X=>R.indexOf(X)).filter(X=>X!==-1);Y.length>0?q.set(D,Y.reduce((X,z)=>X+z,0)/Y.length):q.set(D,F.indexOf(D))}),F.sort((D,P)=>(q.get(D)??0)-(q.get(P)??0))}}const B=new Map;let E=0;if(k.forEach($=>{let I=0,F=0;$.forEach(R=>{const q=L.get(R);q&&(l?(B.set(R,{x:E,y:I}),I+=q.height+u,F=Math.max(F,q.width)):(B.set(R,{x:I,y:E}),I+=q.width+u,F=Math.max(F,q.height)))}),E+=F+u}),!l){const $=[];for(const[I,F]of B){const R=$.find(q=>Math.abs(q.x-F.x)<.5);R?R.groupIds.push(I):$.push({x:F.x,groupIds:[I]})}for(const I of $){const F=Math.max(...I.groupIds.map(R=>L.get(R)?.width??0));for(const R of I.groupIds){const q=B.get(R),D=L.get(R)?.width;!q||D===void 0||B.set(R,{...q,x:q.x+(F-D)/2})}}}const O=[];return y.forEach($=>{const I=g.get($)||[],F=B.get($),R=_.get($);if(!F||I.length===0||!R)return;const{layers:q,layerSpacing:D}=R;let P=32;q.forEach((Y,X)=>{let z=0;Y.forEach(rt=>{const ht=i.get(rt);ht&&(z+=(l?ht.height:ht.width)+f)}),z-=f;const U=L.get($);if(!U)return;let V=32+((l?U.height:U.width)-64-z)/2,Q=0;Y.forEach(rt=>{const ht=e.find(tt=>tt.id===rt),H=i.get(rt);if(!ht||!H)return;let G,K;l?(G=F.x+P,K=F.y+V,V+=H.height+f,Q=Math.max(Q,H.width)):(G=F.x+V,K=F.y+P,V+=H.width+f,Q=Math.max(Q,H.height)),O.push({...ht,x:G,y:K,width:H.width,height:H.height})}),P+=Q+(D[X]??n*.5)})}),O}function hE(e,t,r,i,o){const a=new Map(e.map((S,T)=>[S.id,T])),s=new Set,n=new Map;for(const S of t){const T=n.get(S.from)??[];T.push(S),n.set(S.from,T)}const l=(S,T,k)=>{const _=[S],L=new Set;for(;_.length;){const v=_.pop();if(v){if(v===T)return!0;if(!L.has(v)){L.add(v);for(const M of n.get(v)??[])M.id!==k&&_.push(M.to)}}}return!1};for(const S of t){const T=a.get(S.from)??0,k=a.get(S.to)??0;T>k&&l(S.to,S.from,S.id)&&s.add(S.id)}const c=new Map,h=new Map;for(const S of t)s.has(S.id)||(c.set(S.to,[...c.get(S.to)??[],S.from]),h.set(S.from,[...h.get(S.from)??[],S.to]));const d=new Map,u=new Set;function f(S){const T=d.get(S);if(T!==void 0)return T;if(u.has(S))return 0;u.add(S);const k=c.get(S)||[];let _=-1;k.forEach(v=>{_=Math.max(_,f(v))});const L=_+1;return d.set(S,L),L}e.forEach(S=>f(S.id));const g=Math.max(...Array.from(d.values()),0),p=Array.from({length:g+1},()=>[]);d.forEach((S,T)=>{p[S].push(T)});for(let S=0;S<4;S++){for(let T=1;T<p.length;T++){const k=p[T],_=p[T-1],L=new Map;k.forEach(v=>{const B=(c.get(v)||[]).map(E=>_.indexOf(E)).filter(E=>E!==-1);B.length>0?L.set(v,B.reduce((E,O)=>E+O,0)/B.length):L.set(v,k.indexOf(v))}),k.sort((v,M)=>(L.get(v)??0)-(L.get(M)??0))}for(let T=p.length-2;T>=0;T--){const k=p[T],_=p[T+1],L=new Map;k.forEach(v=>{const B=(h.get(v)||[]).map(E=>_.indexOf(E)).filter(E=>E!==-1);B.length>0?L.set(v,B.reduce((E,O)=>E+O,0)/B.length):L.set(v,k.indexOf(v))}),k.sort((v,M)=>(L.get(v)??0)-(L.get(M)??0))}}const m=[],y=i*.4,x=p.slice(0,-1).map((S,T)=>{const k=t.reduce((_,L)=>{const v=d.get(L.from),M=d.get(L.to);if(!L.label||s.has(L.id)||v!==T||M!==T+1)return _;const B=di(L.label);return Math.max(_,(o?B.width:B.height)+36)},0);return Math.max(i*.65,k)});let b=0;return p.forEach((S,T)=>{let k=0,_=0;_=-S.reduce((v,M)=>{const B=r.get(M);return B?v+(o?B.height:B.width)+y:v},-y)/2,S.forEach(v=>{const M=e.find($=>$.id===v),B=r.get(v);if(!M||!B)return;let E,O;o?(E=b,O=_,_+=B.height+y,k=Math.max(k,B.width)):(E=_,O=b,_+=B.width+y,k=Math.max(k,B.height)),m.push({...M,x:E,y:O,width:B.width,height:B.height})}),b+=k+(x[T]??i*.8)}),m}function dE(e,t,r,i,o){const a=Ms(r.spacing,100),s=r.direction??"LR",n=s==="LR"||s==="RL",l=150,c=a*a*8,h=.04,d=1.5,u=.7,f=new Map;o&&(o.forEach(I=>{Array.isArray(I.nodeIds)&&I.nodeIds.forEach(F=>{f.set(F,I.id)})}),e.forEach(I=>{I.group&&f.set(I.id,I.group)}));const g=new Map,p=new Map;e.forEach(I=>{g.set(I.id,[]),p.set(I.id,[])}),t.forEach(I=>{g.get(I.from)?.push(I.to),p.get(I.to)?.push(I.from)});const m=new Map,y=new Set,x=e.filter(I=>(p.get(I.id)?.length??0)===0),S=(x.length>0?x:[e[0]]).map(I=>({id:I.id,depth:0}));let T=0;for(;S.length>0;){const I=S.shift();if(!I)break;const{id:F,depth:R}=I;if(y.has(F))continue;y.add(F),m.set(F,R),T=Math.max(T,R),(g.get(F)??[]).forEach(D=>{y.has(D)||S.push({id:D,depth:R+1})})}e.forEach(I=>{m.has(I.id)||m.set(I.id,0)});const k=new Map;m.forEach(I=>{k.set(I,(k.get(I)??0)+1)});const _=new Map,L=new Map;if(o&&o.length>0){const I=o.length;let F,R;n?(F=I,R=1):(F=1,R=I);const q=a*.8;o.forEach((D,P)=>{const Y=P%F,X=Math.floor(P/F),z=(Y-(F-1)/2)*q,U=(X-(R-1)/2)*q;L.set(D.id,{x:n?z:U,y:n?U:z,vx:0,vy:0})})}const v=e.map(I=>{const F=m.get(I.id)??0,R=k.get(F)??1,q=_.get(F)??0;_.set(F,q+1);const D=n?2:1.5,P=n?1:1.2,Y=F/Math.max(T,1)*a*D;let X=(q-R/2)/Math.max(R,1)*a*P;const z=f.get(I.id),U=z?L.get(z):void 0;U&&(n?X=U.y+X*.2:X=U.x+X*.2);const j=I.id.split("").reduce((rt,ht)=>rt+ht.charCodeAt(0),0),V=(j%100/100-.5)*a*.1,Q=(j*7%100/100-.5)*a*.1;return{node:I,x:(n?Y:X)+V,y:(n?X:Y)+Q,vx:0,vy:0,width:I.size?.width??i.width,height:I.size?.height??i.height}}),M=I=>v.find(F=>F.node.id===I);for(let I=0;I<l;I++){v.forEach(F=>{F.vx=0,F.vy=0});for(let F=0;F<v.length;F++)for(let R=F+1;R<v.length;R++){const q=v[R].x-v[F].x,D=v[R].y-v[F].y,P=q*q+D*D+.01,Y=Math.sqrt(P),X=(v[F].width+v[R].width)/2+a*.25,z=(v[F].height+v[R].height)/2+a*.25,U=Math.sqrt(X*X+z*z),j=Y<U?c*3/P:c*1/P;let V=q/Y*j,Q=D/Y*j;n?(V*=1.5,Q*=.6):(V*=.6,Q*=1.5),v[F].vx-=V,v[F].vy-=Q,v[R].vx+=V,v[R].vy+=Q}t.forEach(F=>{const R=M(F.from),q=M(F.to);if(!R||!q)return;const D=q.x-R.x,P=q.y-R.y,Y=Math.sqrt(D*D+P*P+.01),X=h*Y,z=D/Y*X,U=P/Y*X;R.vx+=z,R.vy+=U,q.vx-=z,q.vy-=U}),v.forEach(F=>{t.forEach(R=>{if(R.from===F.node.id||R.to===F.node.id)return;const q=M(R.from),D=M(R.to);if(!q||!D)return;const P=D.x-q.x,Y=D.y-q.y,X=P*P+Y*Y;if(X<.01)return;const z=Math.max(0,Math.min(1,((F.x-q.x)*P+(F.y-q.y)*Y)/X));if(z<.1||z>.9)return;const U=q.x+z*P,j=q.y+z*Y,V=F.x-U,Q=F.y-j,rt=V*V+Q*Q+.01,ht=Math.sqrt(rt),G=Math.max(F.width,F.height)/2+a*.1;if(ht<G){const K=ht/G,tt=d*(1-K)*(1-K)*a;F.vx+=V/ht*tt,F.vy+=Q/ht*tt}})});for(let F=0;F<t.length;F++)for(let R=F+1;R<t.length;R++){const q=t[F],D=t[R];if(q.from===D.from||q.from===D.to||q.to===D.from||q.to===D.to)continue;const P=M(q.from),Y=M(q.to),X=M(D.from),z=M(D.to);if(!P||!Y||!X||!z)continue;const U=(Y.x-P.x)*(z.y-X.y)-(Y.y-P.y)*(z.x-X.x);if(Math.abs(U)<.01)continue;const j=((X.x-P.x)*(z.y-X.y)-(X.y-P.y)*(z.x-X.x))/U,V=((X.x-P.x)*(Y.y-P.y)-(X.y-P.y)*(Y.x-P.x))/U;if(j>.1&&j<.9&&V>.1&&V<.9){const Q=d*a*.15,rt=z.x-X.x,ht=z.y-X.y,H=Math.sqrt(rt*rt+ht*ht),G=-ht/H,K=rt/H,ot=(z.x-X.x)*(P.y-X.y)-(z.y-X.y)*(P.x-X.x)>0?1:-1;P.vx+=G*Q*ot,P.vy+=K*Q*ot,Y.vx+=G*Q*ot,Y.vy+=K*Q*ot,X.vx-=G*Q*ot,X.vy-=K*Q*ot,z.vx-=G*Q*ot,z.vy-=K*Q*ot}}if(o&&o.length>0&&L.size>0){L.forEach(P=>{P.vx=0,P.vy=0});const F=a*a*5,R=Array.from(L.entries());for(let P=0;P<R.length;P++)for(let Y=P+1;Y<R.length;Y++){const[,X]=R[P],[,z]=R[Y],U=z.x-X.x,j=z.y-X.y,V=U*U+j*j+.01,Q=Math.sqrt(V),rt=F/V,ht=U/Q*rt,H=j/Q*rt;X.vx-=ht,X.vy-=H,z.vx+=ht,z.vy+=H}const q=.05;v.forEach(P=>{const Y=f.get(P.node.id),X=Y?L.get(Y):void 0;if(X){const z=X.x-P.x,U=X.y-P.y;P.vx+=z*q,P.vy+=U*q,X.vx-=z*q*.1,X.vy-=U*q*.1}});const D=a*2;for(let P=0;P<v.length;P++)for(let Y=P+1;Y<v.length;Y++){const X=f.get(v[P].node.id),z=f.get(v[Y].node.id);if(X&&z&&X!==z||(X&&!z||!X&&z)){const V=v[Y].x-v[P].x,Q=v[Y].y-v[P].y,rt=Math.sqrt(V*V+Q*Q+.01),ht=D/(rt*1+a*.5),H=V/rt*ht,G=Q/rt*ht;v[P].vx-=H,v[P].vy-=G,v[Y].vx+=H,v[Y].vy+=G}}L.forEach(P=>{P.x+=P.vx*u,P.y+=P.vy*u})}v.forEach(F=>{F.x+=F.vx*u,F.y+=F.vy*u})}for(let I=0;I<10;I++){let F=!1;for(let R=0;R<v.length;R++)for(let q=R+1;q<v.length;q++){const D=(v[R].width+v[q].width)/2+a*.15-Math.abs(v[q].x-v[R].x),P=(v[R].height+v[q].height)/2+a*.15-Math.abs(v[q].y-v[R].y);if(D>0&&P>0)if(F=!0,D<P){const Y=D/2+1;v[q].x>=v[R].x?(v[R].x-=Y,v[q].x+=Y):(v[R].x+=Y,v[q].x-=Y)}else{const Y=P/2+1;v[q].y>=v[R].y?(v[R].y-=Y,v[q].y+=Y):(v[R].y+=Y,v[q].y-=Y)}}if(!F)break}const B=60,E=new Map;v.forEach(I=>E.set(I.node.id,new Set)),t.forEach(I=>{E.get(I.from)?.add(I.to),E.get(I.to)?.add(I.from)});const O=new Map;let $=0;if(v.forEach(I=>{if(O.has(I.node.id))return;const F=$++,R=[I.node.id];for(;R.length>0;){const q=R.pop();if(q===void 0)break;O.has(q)||(O.set(q,F),E.get(q)?.forEach(D=>{O.has(D)||R.push(D)}))}}),$>1){const I=new Map;v.forEach(X=>{const z=O.get(X.node.id);if(z===void 0)return;const U=I.get(z);U?(U.minX=Math.min(U.minX,X.x),U.minY=Math.min(U.minY,X.y),U.maxX=Math.max(U.maxX,X.x+X.width),U.maxY=Math.max(U.maxY,X.y+X.height)):I.set(z,{minX:X.x,minY:X.y,maxX:X.x+X.width,maxY:X.y+X.height})});const F=Array.from(I.keys()).sort((X,z)=>{const U=I.get(X),j=I.get(z);return!U||!j?0:(j.maxX-j.minX)*(j.maxY-j.minY)-(U.maxX-U.minX)*(U.maxY-U.minY)}),R=Math.ceil(Math.sqrt(F.length));let q=0,D=0,P=0,Y=0;for(const X of F){const z=I.get(X);if(!z)continue;const U=z.maxX-z.minX,j=z.maxY-z.minY,V=q-z.minX,Q=D-z.minY;v.forEach(rt=>{O.get(rt.node.id)===X&&(rt.x+=V,rt.y+=Q)}),q+=U+B,P=Math.max(P,j),Y++,Y>=R&&(Y=0,q=0,D+=P+B,P=0)}}return v.map(I=>({...I.node,x:I.x,y:I.y,width:I.width,height:I.height}))}function uE(e,t,r){const o=2*Math.PI/e.length;return e.map((a,s)=>{const n=s*o,l=200*Math.cos(n),c=200*Math.sin(n),h=a.size?.width??r.width,d=a.size?.height??r.height;return{...a,x:l,y:c,width:h,height:d}})}function fE(e,t,r,i){const o=Ms(r.spacing,60),a=r.direction??"TB",s=a==="TB"||a==="BT",n=new Map,l=new Map;t.forEach(f=>{let g=n.get(f.from);g||(g=[],n.set(f.from,g)),g.push(f.to),l.set(f.to,f.from)});const c=e.filter(f=>!l.has(f.id));c.length===0&&e.length>0&&c.push(e[0]);const h=new Map;let d=0;function u(f,g){const p=e.find(v=>v.id===f);if(!p)return{width:0,height:0};const m=p.size?.width??i.width,y=p.size?.height??i.height,x=n.get(f)||[];if(x.length===0){const v=s?d:g*(m+o),M=s?g*(y+o):d;return h.set(f,{x:v,y:M,width:m,height:y}),d+=(s?m:y)+o,{width:m,height:y}}const b=[];x.forEach(v=>{const M=u(v,g+1);b.push(s?M.width:M.height)});const k=(d-b.reduce((v,M)=>v+M,0)-o*(b.length-1)+d)/2,_=s?k:g*(m+o),L=s?g*(y+o):k;return h.set(f,{x:_,y:L,width:m,height:y}),{width:m,height:y}}return c.forEach(f=>{u(f.id,0)}),e.map(f=>{const g=h.get(f.id)||{x:0,y:0,width:i.width,height:i.height};return{...f,x:g.x,y:g.y,width:g.width,height:g.height}})}function gE(e,t,r,i){const o=r.edgeRouting||"polyline";return r.type==="circular"?Ip(e,t):o==="orthogonal"||o==="curved"?W1(e,t,r,i):Ip(e,t)}const pE=32,mE=6;function yE(e,t){return Math.max(pE,(e+t)/4+mE/2)}function q1(e,t){const r=new Map,i=new Map(t.map(s=>[s.id,s])),o=new Map;for(const s of e){if(s.from===s.to)continue;const n=`${s.from}::${s.to}`;let l=o.get(n);l||(l=[],o.set(n,l)),l.push(s)}const a=new Set;for(const[s]of o){const[n,l]=s.split("::"),c=`${l}::${n}`,h=[n,l].sort().join("::");if(a.has(h)||!o.has(c))continue;a.add(h);const d=o.get(s),u=o.get(c);if(!d||!u)continue;const f=i.get(n),g=i.get(l),p=f&&g?Math.abs(g.x+g.width/2-(f.x+f.width/2))>=Math.abs(g.y+g.height/2-(f.y+f.height/2)):!1,m=x=>Math.max(0,...x.map(b=>{if(!b.label)return 0;const S=di(b.label);return p?S.height:S.width})),y=yE(m(d),m(u));for(const x of d)r.set(x.id,y);for(const x of u)r.set(x.id,y)}return r}function Pp(e,t,r,i){const o=r.x-t.x,a=r.y-t.y,s=Math.sqrt(o*o+a*a);if(s===0)return e;const n=-a/s,l=o/s;return{x:e.x+n*i,y:e.y+l*i}}function Ip(e,t){const r=new Map(t.map(a=>[a.id,a])),i=q1(e,t),o=new Map;return e.map(a=>{const s=r.get(a.from),n=r.get(a.to);if(!s||!n)return{...a,path:"",points:[]};if(s.id===n.id){const v=o.get(a.from)??0;o.set(a.from,v+1);const{path:M,points:B}=z1(s,v);return{...a,path:M,points:B}}const l=s.x+s.width/2,c=s.y+s.height/2,h=n.x+n.width/2,d=n.y+n.height/2,u=h-l,f=d-c;let g,p;const m=Math.atan2(f,u),y=Math.abs(m);y<Math.PI/4?(g={x:s.x+s.width,y:c},p={x:n.x,y:d}):y>3*Math.PI/4?(g={x:s.x,y:c},p={x:n.x+n.width,y:d}):m>0?(g={x:l,y:s.y+s.height},p={x:h,y:n.y}):(g={x:l,y:s.y},p={x:h,y:n.y+n.height});const x=2,b=p.x-g.x,S=p.y-g.y,T=Math.sqrt(b*b+S*S);if(T>x*2){const v=b/T,M=S/T;g={x:g.x+v*x,y:g.y+M*x}}const k=i.get(a.id);if(k){const v={x:l,y:c},M={x:h,y:d};g=Pp(g,v,M,k),p=Pp(p,v,M,k)}const _=`M ${g.x} ${g.y} L ${p.x} ${p.y}`,L=[g,{x:(g.x+p.x)/2,y:(g.y+p.y)/2},p];return{...a,path:_,points:L}})}function W1(e,t,r,i){const o=new Map(t.map(H=>[H.id,H])),a=new Map(t.flatMap(H=>H.group?[[H.id,H.group]]:[]));i?.forEach(H=>H.nodeIds?.forEach(G=>a.set(G,H.id)));const s=q1(e,t),n=r.direction||"TB",l=n==="TB"||n==="BT",c=16,h=24,d=32,u=10,f=12,g=10,p=12;let m=1/0,y=-1/0,x=-1/0;for(const H of t)m=Math.min(m,H.x),y=Math.max(y,H.x+H.width),x=Math.max(x,H.y+H.height);const b=[],S=[],T=new Map;for(const[H,G]of e.entries()){const K=o.get(G.from),tt=o.get(G.to);if(!K||!tt)continue;if(K.id===tt.id){const Mt=T.get(G.from)??0;T.set(G.from,Mt+1);const{path:Bt,points:Rt}=z1(K,Mt);S.push({...G,path:Bt,points:Rt});continue}const{fromSide:ot,toSide:vt}=CE(K,tt,l),Pt=(r.type==="layered"||r.type==="tree")&&(l?K.y+K.height/2>tt.y+tt.height/2:K.x+K.width/2>tt.x+tt.width/2);b.push({index:H,edge:G,fromNode:K,toNode:tt,fromSide:ot,toSide:vt,goesBackward:Pt})}const k=ht(b),_=new Map;b.forEach(H=>{const{fromNode:G,toNode:K,fromSide:tt,toSide:ot}=H,vt=tt==="top"||tt==="bottom",Ot=ot==="top"||ot==="bottom",Pt=G.x+G.width/2,Mt=G.y+G.height/2,Bt=K.x+K.width/2,Rt=K.y+K.height/2;let we=!1,qt=!1,ue;if(tt==="bottom"&&ot==="top"){const ke=G.y+G.height,Se=K.y;ue=(ke+Se)/2,ue=Math.max(ue,ke+h),ue=Math.min(ue,Se-h)}else if(tt==="top"&&ot==="bottom"){const ke=G.y,Se=K.y+K.height;ue=(ke+Se)/2,ue=Math.min(ue,ke-h),ue=Math.max(ue,Se+h)}else ue=(Mt+Rt)/2;let Ee;if(tt==="right"&&ot==="left"){const ke=G.x+G.width,Se=K.x;Ee=(ke+Se)/2}else if(tt==="left"&&ot==="right"){const ke=G.x,Se=K.x+K.width;Ee=(ke+Se)/2}else Ee=(Pt+Bt)/2;vt&&Ot&&Math.abs(Pt-Bt)>5?we=!0:!vt&&!Ot&&(qt=!0),_.set(H.edge.id,{needsHorizontalChannel:we,needsVerticalChannel:qt,horizontalY:ue,verticalX:Ee})});const L=b.filter(H=>_.get(H.edge.id)?.needsHorizontalChannel),v=b.filter(H=>_.get(H.edge.id)?.needsVerticalChannel);L.sort((H,G)=>{const K=_.get(H.edge.id),tt=_.get(G.edge.id);return!K||!tt?0:K.horizontalY-tt.horizontalY}),v.sort((H,G)=>{const K=_.get(H.edge.id),tt=_.get(G.edge.id);return!K||!tt?0:K.verticalX-tt.verticalX});const M=new Map,B=new Map,E=()=>{const H=[];L.forEach(G=>{const{fromNode:K,toNode:tt}=G,ot=_.get(G.edge.id);if(!ot)return;const vt=ot.horizontalY,Ot=Math.min(K.x,tt.x),Pt=Math.max(K.x+K.width,tt.x+tt.width),Mt=H.filter(Rt=>!(Pt<Rt.minX-10||Ot>Rt.maxX+10)&&(Rt.sourceId!==G.edge.from||Rt.targetId===G.edge.to));let Bt=vt;if(Mt.length>0){const Rt=Mt.map(qt=>qt.y).sort((qt,ue)=>qt-ue);let we=!1;for(let qt=0;qt<=Mt.length;qt++){const ue=vt+qt*c;if(!Rt.some(_t=>Math.abs(_t-ue)<c-1)){Bt=ue,we=!0;break}const ke=vt-qt*c;if(!Rt.some(_t=>Math.abs(_t-ke)<c-1)&&qt>0){Bt=ke,we=!0;break}}we||(Bt=vt+Mt.length*c)}H.push({minX:Ot,maxX:Pt,y:Bt,edgeId:G.edge.id,sourceId:G.edge.from,targetId:G.edge.to}),M.set(G.edge.id,Bt)})},O=()=>{const H=[];v.forEach(G=>{const{fromNode:K,toNode:tt}=G,ot=_.get(G.edge.id);if(!ot)return;const vt=ot.verticalX,Ot=Math.min(K.y,tt.y),Pt=Math.max(K.y+K.height,tt.y+tt.height),Mt=H.filter(Rt=>!(Pt<Rt.minY-10||Ot>Rt.maxY+10));let Bt=vt;if(Mt.length>0){const Rt=Mt.map(qt=>qt.x).sort((qt,ue)=>qt-ue);let we=!1;for(let qt=0;qt<=Mt.length;qt++){const ue=vt+qt*c;if(!Rt.some(_t=>Math.abs(_t-ue)<c-1)){Bt=ue,we=!0;break}const ke=vt-qt*c;if(!Rt.some(_t=>Math.abs(_t-ke)<c-1)&&qt>0){Bt=ke,we=!0;break}}we||(Bt=vt+Mt.length*c)}H.push({minY:Ot,maxY:Pt,x:Bt,edgeId:G.edge.id}),B.set(G.edge.id,Bt)})};E(),O();const $=b.filter(H=>H.goesBackward);$.sort((H,G)=>{const K=Math.abs(l?H.fromNode.y-H.toNode.y:H.fromNode.x-H.toNode.x);return Math.abs(l?G.fromNode.y-G.toNode.y:G.fromNode.x-G.toNode.x)-K});const I=new Map;$.forEach((H,G)=>{I.set(H.edge.id,G)});const F=ht(l?$.map(H=>({...H,fromSide:"left",toSide:"left"})):[]),R=new Map;if(l)for(const H of $){const G=Math.max(i?.length?0:32,H.edge.label?Sh(H.edge.label)/2+4:0),K=Math.min(H.fromNode.y,H.toNode.y),tt=Math.max(H.fromNode.y+H.fromNode.height,H.toNode.y+H.toNode.height),ot=Math.min(...[...t,...i??[]].filter(Pt=>Pt.y<tt&&Pt.y+Pt.height>K).map(Pt=>Pt.x));let vt=i?.length?m-h-G-((I.get(H.edge.id)??0)+1)*c:ot-h-G-c;const Ot=$.filter(Pt=>{const Mt=Math.min(Pt.fromNode.y,Pt.toNode.y),Bt=Math.max(Pt.fromNode.y+Pt.fromNode.height,Pt.toNode.y+Pt.toNode.height);return Mt<=tt&&Bt>=K}).flatMap(Pt=>R.has(Pt.edge.id)?[R.get(Pt.edge.id)]:[]).sort((Pt,Mt)=>Mt-Pt);for(const Pt of Ot)Math.abs(vt-Pt)<c&&(vt=Pt-c);R.set(H.edge.id,vt)}const q=new Map,D=new Map;for(const H of b){const G=`${H.edge.from}->${H.edge.to}`,K=D.get(G)??[];K.push(H),D.set(G,K)}for(const H of D.values())H.forEach((G,K)=>q.set(G.edge.id,{index:K,count:H.length}));const P=H=>{const G=(H.fromNode.x+H.fromNode.width/2+H.toNode.x+H.toNode.width/2)/2,K=Math.min(H.fromNode.y+H.fromNode.height,H.toNode.y+H.toNode.height),tt=Math.max(H.fromNode.y,H.toNode.y);return tt<=K?!1:t.some(ot=>ot.id!==H.fromNode.id&&ot.id!==H.toNode.id&&G>=ot.x-d&&G<=ot.x+ot.width+d&&ot.y<tt&&ot.y+ot.height>K)},Y=H=>{if(!H.edge.label)return!1;const G=Math.max(0,Math.max(H.fromNode.y,H.toNode.y)-Math.min(H.fromNode.y+H.fromNode.height,H.toNode.y+H.toNode.height)),K=di(H.edge.label,bn(H.edge.label,G));return K.lines>=3&&G<K.height+16},X=(H,G,K)=>Math.abs(H.x-G.x)<.001?H.x>K.left&&H.x<K.right&&Math.max(H.y,G.y)>K.top&&Math.min(H.y,G.y)<K.bottom:H.y>K.top&&H.y<K.bottom&&Math.max(H.x,G.x)>K.left&&Math.min(H.x,G.x)<K.right,z=(H,G)=>H.slice(1).some((K,tt)=>G.some(ot=>X(H[tt],K,ot))),U=(H,G)=>Math.abs(G.x-H.x)>=Math.abs(G.y-H.y)?{x:H.x+Math.sign(G.x-H.x)*d,y:H.y}:{x:H.x,y:H.y+Math.sign(G.y-H.y)*d},j=H=>H.slice(1).reduce((G,K,tt)=>G+Math.abs(K.x-H[tt].x)+Math.abs(K.y-H[tt].y),0),V=(H,G)=>{const K=(et,it)=>Math.abs(it.x-et.x)>=Math.abs(it.y-et.y)?`${Math.sign(it.x-et.x)},0`:`0,${Math.sign(it.y-et.y)}`,tt=new Set([a.get(H.fromNode.id),a.get(H.toNode.id)].filter(et=>et!==void 0)),ot=t.map(et=>{const it=et.id===H.fromNode.id||et.id===H.toNode.id?0:u;return{left:et.x-it,right:et.x+et.width+it,top:et.y-it,bottom:et.y+et.height+it}}),vt=(i??[]).filter(et=>!tt.has(et.id)&&et.width>0&&et.height>0).map(et=>({left:et.x-f,right:et.x+et.width+f,top:et.y-f,bottom:et.y+et.height+f})),Ot=(i??[]).map(ld),Pt=[...ot,...vt,...Ot],Mt=tn(G);if(!z(Mt,Pt))return Mt;const Bt=H.edge.label?di(H.edge.label):void 0,Rt=[...Ot,...t.map(et=>({left:et.x,right:et.x+et.width,top:et.y,bottom:et.y+et.height})),...(i??[]).filter(et=>!tt.has(et.id)&&et.width>0&&et.height>0).map(et=>({left:et.x,right:et.x+et.width,top:et.y,bottom:et.y+et.height}))],we=et=>{if(!Bt)return Number.POSITIVE_INFINITY;const it=[.5,.25,.75,.125,.875];return et.slice(1).reduce((ct,xt,Tt)=>{const st=et[Tt];return ct+it.filter(kt=>{const jt=st.x+(xt.x-st.x)*kt,re=st.y+(xt.y-st.y)*kt,Kt={left:jt-Bt.width/2-g,right:jt+Bt.width/2+g,top:re-Bt.height/2-g,bottom:re+Bt.height/2+g};return!Rt.some(xe=>Kt.left<xe.right&&Kt.right>xe.left&&Kt.top<xe.bottom&&Kt.bottom>xe.top)}).length},0)},qt=et=>we(et)>=3,ue=Mt[0],Ee=Mt[Mt.length-1],ke=K(ue,G[1]),Se=K(G[G.length-2],Ee),_t=U(ue,Mt[1]),Xt=U(Ee,Mt[Mt.length-2]),w=et=>[...new Set(et)].sort((it,ct)=>it-ct),J=w([...Pt.flatMap(({left:et,right:it})=>[et,it]),...Bt?Rt.flatMap(({left:et,right:it})=>[et-Bt.width/2-p,it+Bt.width/2+p]):[]]),dt=w([...Pt.flatMap(({top:et,bottom:it})=>[et,it]),...Bt?Rt.flatMap(({top:et,bottom:it})=>[et-Bt.height/2-p,it+Bt.height/2+p]):[]]),mt=[...J.map(et=>tn([ue,_t,{x:et,y:_t.y},{x:et,y:Xt.y},Xt,Ee])),...dt.map(et=>tn([ue,_t,{x:_t.x,y:et},{x:Xt.x,y:et},Xt,Ee]))].filter(et=>!z(et,Pt)&&K(et[0],et[1])===ke&&K(et[et.length-2],et[et.length-1])===Se),ft=mt.filter(qt);return(ft.length>0?ft:mt).toSorted((et,it)=>{const ct=xt=>j(xt)+xt.length*c;return ct(et)-ct(it)||JSON.stringify(et).localeCompare(JSON.stringify(it))})[0]??Mt},Q=b.map(H=>{const{index:G,edge:K,fromNode:tt,toNode:ot,fromSide:vt,toSide:Ot,goesBackward:Pt}=H,Mt=(_t,Xt)=>{switch(Xt){case"top":return{x:_t.x+_t.width/2,y:_t.y};case"bottom":return{x:_t.x+_t.width/2,y:_t.y+_t.height};case"left":return{x:_t.x,y:_t.y+_t.height/2};case"right":return{x:_t.x+_t.width,y:_t.y+_t.height/2}}},Bt=k.get(`${G}:from`)??Mt(tt,vt);let Rt=k.get(`${G}:to`)??Mt(ot,Ot);const we=s.get(K.id),qt=[Bt],ue=vt==="top"||vt==="bottom",Ee=Ot==="top"||Ot==="bottom",ke=(()=>{if(ue||Ee||we||k.has(`${G}:from`)||k.has(`${G}:to`))return null;const _t=st=>Math.min(st.height/4,["db","store","data_store"].includes(st.kind??"")?10:6),Xt=Math.max(tt.y+_t(tt),ot.y+_t(ot)),w=Math.min(tt.y+tt.height-_t(tt),ot.y+ot.height-_t(ot));if(Xt>w)return null;const J=Math.max(Xt,Math.min(w,(tt.y+tt.height/2+ot.y+ot.height/2)/2)),dt={x:vt==="right"?tt.x+tt.width:tt.x,y:J},mt={x:Ot==="left"?ot.x:ot.x+ot.width,y:J},ft=Math.min(dt.x,mt.x),N=Math.max(dt.x,mt.x),et=new Set([a.get(tt.id),a.get(ot.id)].filter(st=>st!==void 0)),it=t.some(st=>st.id!==tt.id&&st.id!==ot.id&&st.x<N&&st.x+st.width>ft&&J>st.y-u&&J<st.y+st.height+u),ct=(i??[]).some(st=>!et.has(st.id)&&st.x<N&&st.x+st.width>ft&&J>st.y-f&&J<st.y+st.height+f),xt=K.label?di(K.label).width:0,Tt=N-ft>=xt+g*2;return it||ct||!Tt?null:{source:dt,target:mt}})();if(tt.id===ot.id){const _t={x:tt.x+tt.width,y:tt.y+tt.height/2},Xt={x:tt.x+tt.width/2,y:tt.y+tt.height},w=_t.x+h+c+80,J=Xt.y+h+c;qt[0]=_t,qt.push({x:w,y:_t.y},{x:w,y:J},{x:Xt.x,y:J}),Rt=Xt}else if(t.length<=6&&K.dashed&&e.some(_t=>_t.id!==K.id&&_t.from===K.from&&_t.to===K.to)){const _t={x:tt.x+tt.width,y:tt.y+tt.height/2},Xt={x:ot.x+ot.width,y:ot.y+ot.height/2},w=Math.max(_t.x,Xt.x)+h+c;qt[0]=_t,qt.push({x:w,y:_t.y},{x:w,y:Xt.y}),Rt=Xt}else if(Pt){const _t=I.get(K.id)??0;if(l){const Xt=R.get(K.id),w=F.get(`${G}:from`)??{x:tt.x,y:tt.y+tt.height/2},J=F.get(`${G}:to`)??{x:ot.x,y:ot.y+ot.height/2};qt[0]=w,qt.push({x:Xt,y:w.y},{x:Xt,y:J.y}),Rt=J}else{const Xt=x+h+(_t+1)*c,w=d+_t*c,J=vt==="right"?Bt.x+w:Bt.x-w,dt=Ot==="left"?Rt.x-w:Rt.x+w;qt.push({x:J,y:Bt.y}),qt.push({x:J,y:Xt}),qt.push({x:dt,y:Xt}),qt.push({x:dt,y:Rt.y})}}else if(l&&ue&&Ee&&a.has(tt.id)&&a.has(ot.id)&&a.get(tt.id)!==a.get(ot.id)){const _t=K.label?Sh(K.label):0,Xt=new Set([a.get(tt.id),a.get(ot.id)].filter(ct=>ct!==void 0)),w=(i??[]).filter(ct=>Xt.has(ct.id)),J=Math.max(tt.x+tt.width,ot.x+ot.width,...w.map(ct=>ct.x+ct.width)),dt=Math.min(tt.y,ot.y),mt=Math.max(tt.y+tt.height,ot.y+ot.height),ft=(i??[]).some(ct=>!Xt.has(ct.id)&&ct.x>=J&&ct.y<mt&&ct.y+ct.height>dt),N=tt.x+tt.width/2,et=ot.x+ot.width/2;if((i?.length??0)>=3&&Math.abs(N-et)<12&&!P(H)&&!ft){const ct=Mt(tt,vt),xt=Mt(ot,Ot);if(qt[0]=ct,Math.abs(ct.x-xt.x)>=.5){const Tt=(ct.y+xt.y)/2;qt.push({x:ct.x,y:Tt},{x:xt.x,y:Tt})}Rt=xt}else if(ft){const ct={x:tt.x,y:tt.y+tt.height/2},xt={x:ot.x,y:ot.y+ot.height/2},st=Math.min(ct.x,xt.x,...w.map(kt=>kt.x))-h-_t/2-g;qt[0]=ct,qt.push({x:st,y:ct.y},{x:st,y:xt.y}),Rt=xt}else{const ct={x:tt.x+tt.width,y:tt.y+tt.height/2},xt={x:ot.x+ot.width,y:ot.y+ot.height/2},Tt=Math.max(y+h+d,ct.x+d,xt.x+d);qt[0]=ct,qt.push({x:Tt,y:ct.y},{x:Tt,y:xt.y}),Rt=xt}}else if(l&&ue&&Ee&&(P(H)||Y(H))){const _t=K.label?Sh(K.label):0,Xt={x:tt.x+tt.width,y:tt.y+tt.height/2},w={x:ot.x+ot.width,y:ot.y+ot.height/2},J=Math.max(y+h+_t/2+c,Xt.x+Math.max(_t+Qa,d),w.x+Math.max(_t+Qa,d));qt[0]=Xt,qt.push({x:J,y:Xt.y},{x:J,y:w.y}),Rt=w}else if(ue&&Ee){const _t=tt.x+tt.width/2,Xt=ot.x+ot.width/2,w=Math.abs(Bt.x-Rt.x)<1;if(Math.abs(_t-Xt)<5&&!we&&w){const J=(_t+Xt)/2;qt[0]={x:J,y:Bt.y},Rt={x:J,y:Rt.y}}else if(Math.abs(_t-Xt)<5&&!we){const J=(_t+Xt)/2;qt[0]={x:J,y:Bt.y},Rt={x:J,y:Rt.y}}else if(Math.abs(_t-Xt)<5){const J=Bt.y<=Rt.y?1:-1,dt=(_t+Xt)/2+J*Math.abs(we??0);qt[0]={x:dt,y:Bt.y},Rt={x:dt,y:Rt.y}}else{const J=M.get(K.id)??(Bt.y+Rt.y)/2,dt=vt==="bottom"?Math.max(Bt.y+d,J):Math.min(Bt.y-d,J),mt=Ot==="top"?Math.min(Rt.y-d,J):Math.max(Rt.y+d,J);Math.abs(dt-J)>2&&qt.push({x:Bt.x,y:dt}),qt.push({x:Bt.x,y:J}),qt.push({x:Rt.x,y:J}),Math.abs(mt-J)>2&&qt.push({x:Rt.x,y:mt})}}else if(!ue&&!Ee&&we){const _t=Bt.x<Rt.x,Xt=_t?Math.max(tt.y+tt.height,ot.y+ot.height)+h+Math.abs(we)/2+(K.dashed?28:0):Math.min(tt.y,ot.y)-h-Math.abs(we)/2-(K.dashed?28:0);if(_t){const w={x:tt.x+tt.width*.65,y:tt.y+tt.height},J={x:ot.x+ot.width*.35,y:ot.y+ot.height};qt[0]=w,qt.push({x:w.x,y:Xt},{x:J.x,y:Xt}),Rt=J}else{const w=Mt(tt,vt),J=Mt(ot,Ot),dt=vt==="right"?w.x+d:w.x-d,mt=Ot==="left"?J.x-d:J.x+d;qt[0]=w,qt.push({x:dt,y:w.y},{x:dt,y:Xt},{x:mt,y:Xt},{x:mt,y:J.y}),Rt=J}}else if(ke)qt[0]=ke.source,Rt=ke.target;else if(!ue&&!Ee){const _t=B.get(K.id)??(Bt.x+Rt.x)/2,Xt=vt==="right"?Math.max(Bt.x+d,_t):Math.min(Bt.x-d,_t),w=Ot==="left"?Math.min(Rt.x-d,_t):Math.max(Rt.x+d,_t);Math.abs(Xt-_t)>2&&qt.push({x:Xt,y:Bt.y}),qt.push({x:_t,y:Bt.y}),qt.push({x:_t,y:Rt.y}),Math.abs(w-_t)>2&&qt.push({x:w,y:Rt.y})}else if(ue){const _t=vt==="bottom"?Bt.y+d:Bt.y-d;Math.abs(_t-Rt.y)>5?(qt.push({x:Bt.x,y:_t}),qt.push({x:Rt.x,y:_t})):qt.push({x:Bt.x,y:Rt.y})}else{const _t=vt==="right"?Bt.x+d:Bt.x-d;Math.abs(_t-Rt.x)>5?(qt.push({x:_t,y:Bt.y}),qt.push({x:_t,y:Rt.y})):qt.push({x:Rt.x,y:Bt.y})}qt.push(Rt);const Se=V(H,qt);return{...K,path:Cn(Se),points:Se}}),rt=b.map((H,G)=>({info:H,route:Q[G]})).toSorted((H,G)=>+(H.info.fromNode.x<H.info.toNode.x)-+(G.info.fromNode.x<G.info.toNode.x)||H.info.fromNode.x-G.info.fromNode.x||H.info.fromNode.y-G.info.fromNode.y||H.info.toNode.x-G.info.toNode.x||H.info.toNode.y-G.info.toNode.y);for(const{info:H,route:G}of rt){const{fromNode:K,toNode:tt,fromSide:ot,toSide:vt}=H;if(l||!["left","right"].includes(ot)||!["left","right"].includes(vt)||(q.get(G.id)?.count??1)>1||!G.points||G.points.length<=2)continue;const Ot=K.x<tt.x,Pt=Ot?K.x+K.width:K.x,Mt=Ot?tt.x:tt.x+tt.width;if((Mt-Pt)*(Ot?1:-1)<=0)continue;const Bt=G.label?di(G.label):void 0,Rt=new Set([a.get(K.id),a.get(tt.id)]),we=[...t.map(it=>({node:it,clearance:it.id===K.id||it.id===tt.id?0:u})),...(i??[]).filter(it=>!Rt.has(it.id)).map(it=>({node:it,clearance:f}))].map(({node:it,clearance:ct})=>({left:it.x-ct,right:it.x+it.width+ct,top:it.y-ct,bottom:it.y+it.height+ct}));we.push(...(i??[]).map(ld));const qt=[...t.map(it=>({left:it.x,right:it.x+it.width,top:it.y,bottom:it.y+it.height})),...we.slice(t.length)],ue=[...S,...Q].filter(it=>it!==G).flatMap(it=>{const ct=it.label?di(it.label):void 0,xt=(it.points??[]).slice(1).map((st,kt)=>({start:it.points[kt],end:st})),Tt=ct&&xt.some(({start:st,end:kt})=>{if(st.y!==kt.y||Math.abs(kt.x-st.x)<ct.width+16||xt.some(Kt=>Math.abs(Kt.end.y-Kt.start.y)>Math.abs(kt.x-st.x)))return!1;const jt=(st.x+kt.x)/2,re={left:jt-ct.width/2-8,right:jt+ct.width/2+8,top:st.y-ct.height/2-8,bottom:st.y+ct.height/2+8};return!qt.some(Kt=>re.left<Kt.right&&re.right>Kt.left&&re.top<Kt.bottom&&re.bottom>Kt.top)&&![...S,...Q].some(Kt=>Kt!==it&&Kt!==G&&z(Kt.points??[],[re]))});return xt.map(({start:st,end:kt})=>{const jt=Math.abs(st.y-kt.y)<.001,re=ct&&(jt||!Tt)&&Math.hypot(kt.x-st.x,kt.y-st.y)>=(jt?ct.width:ct.height)+16,Kt=Math.max(c,re&&!jt?ct.width/2+2:0),xe=Math.max(c,re&&jt?ct.height/2+2:0);return{left:Math.min(st.x,kt.x)-Kt,right:Math.max(st.x,kt.x)+Kt,top:Math.min(st.y,kt.y)-xe,bottom:Math.max(st.y,kt.y)+xe}})}),Ee=[...we,...ue],ke=[...qt,...ue],Se=[],_t=it=>Math.min(it.height/4,["db","store","data_store"].includes(it.kind??"")?10:6),Xt=Math.max(K.y+_t(K),tt.y+_t(tt)),w=Math.min(K.y+K.height-_t(K),tt.y+tt.height-_t(tt));if(Xt<=w)for(const it of[(Xt+w)/2,Xt,w])Se.push([{x:Pt,y:it},{x:Mt,y:it}]);const J=it=>[it.y+it.height/2,it.y+_t(it),it.y+it.height-_t(it)],dt=Ot?1:-1;if(Math.abs(Mt-Pt)>=c*2){const it=[(Pt+Mt)/2,Pt+dt*d,Mt-dt*d,Pt+dt*c,Mt-dt*c].filter(ct=>(ct-Pt)*dt>=c&&(Mt-ct)*dt>=c);for(const ct of J(K))for(const xt of J(tt))for(const Tt of it)Se.push([{x:Pt,y:ct},{x:Tt,y:ct},{x:Tt,y:xt},{x:Mt,y:xt}])}for(const it of[!1,!0]){const ct={x:K.x+K.width/2,y:K.y+(it?K.height:0)},xt={x:tt.x+tt.width/2,y:tt.y+(it?tt.height:0)},Tt=Math.max(d,(Bt?.height??0)/2+g),st=it?Math.max(ct.y,xt.y)+Tt:Math.min(ct.y,xt.y)-Tt;Se.push([ct,{x:ct.x,y:st},{x:xt.x,y:st},xt])}const mt=(it,ct=!1)=>{if(!Bt)return!0;const xt=R1(it);return(ct?xt.filter(({horizontal:st})=>st).toSorted((st,kt)=>Math.abs(kt.end.x-kt.start.x)-Math.abs(st.end.x-st.start.x)).slice(0,1):xt).some(({start:st,end:kt})=>{const jt=st.y===kt.y?Bt.width:Bt.height;return Math.hypot(kt.x-st.x,kt.y-st.y)<jt+16?!1:(ct?[.5]:[.5,.25,.75]).some(re=>{const Kt=st.x+(kt.x-st.x)*re,xe=st.y+(kt.y-st.y)*re;return!ke.some(Pe=>Kt-Bt.width/2-8<Pe.right&&Kt+Bt.width/2+8>Pe.left&&xe-Bt.height/2-8<Pe.bottom&&xe+Bt.height/2+8>Pe.top)})})},ft=z(G.points,we),N=mt(G.points,!0),et=Se.map(tn).map(it=>({points:it,centeredLabel:mt(it,!0)})).filter(({points:it,centeredLabel:ct})=>(ft||it.length<G.points.length||it.length===G.points.length&&(ct&&!N||ct===N&&j(it)<j(G.points)))&&!z(it,Ee)&&mt(it)).toSorted((it,ct)=>it.points.length-ct.points.length||Number(ct.centeredLabel)-Number(it.centeredLabel)||j(it.points)-j(ct.points))[0]?.points;et&&(G.points=et,G.path=Cn(et))}return[...S,...Q];function ht(H){const G=new Map,K=ot=>{const vt=`${ot.node.id}:${ot.side}`;G.set(vt,[...G.get(vt)??[],ot])};for(const ot of H){const vt=ot.fromSide==="top"||ot.fromSide==="bottom",Ot=ot.toSide==="top"||ot.toSide==="bottom";K({key:`${ot.index}:from`,node:ot.fromNode,side:ot.fromSide,desired:vt?ot.toNode.x+ot.toNode.width/2:ot.toNode.y+ot.toNode.height/2,role:"from",edgeId:ot.edge.id}),K({key:`${ot.index}:to`,node:ot.toNode,side:ot.toSide,desired:Ot?ot.fromNode.x+ot.fromNode.width/2:ot.fromNode.y+ot.fromNode.height/2,role:"to",edgeId:ot.edge.id})}const tt=new Map;for(const ot of G.values()){const vt=new Set(ot.map(({role:w})=>w)),Ot=new Set(ot.map(w=>{const J=H.find(dt=>dt.index===Number(w.key.split(":")[0]));return w.role==="from"?J?.toNode.id:J?.fromNode.id}));if(!(ot.length>=2&&(vt.size>1||Ot.size>1)))continue;const Mt=ot.toSorted((w,J)=>w.desired-J.desired||w.role.localeCompare(J.role)||w.edgeId.localeCompare(J.edgeId)||w.key.localeCompare(J.key)),{node:Bt,side:Rt}=Mt[0],we=Rt==="top"||Rt==="bottom",qt=we?Bt.width:Bt.height,ue=we?Bt.x+Bt.width/2:Bt.y+Bt.height/2,Ee=Math.max(0,qt-Math.min(32,qt*.4)),ke=Mt.map(w=>{const J=H.find(mt=>mt.edge.id===w.edgeId)?.edge,dt=J?.label?di(J.label):void 0;return dt?we?dt.width:dt.height:0}),Se=vt.size===1?Math.max(Uo,...ke.slice(1).map((w,J)=>(w+ke[J])/2+g)):Uo,_t=Mt.length>1?Math.min(Se,Ee/(Mt.length-1)):0,Xt=ue-_t*(Mt.length-1)/2;Mt.forEach((w,J)=>{const dt=Xt+J*_t;tt.set(w.key,we?{x:dt,y:Rt==="top"?Bt.y:Bt.y+Bt.height}:{x:Rt==="left"?Bt.x:Bt.x+Bt.width,y:dt})})}return tt}}function xE(e,t,r){const i=new Map(t.map((u,f)=>[u.id,{node:u,index:f}])),o=new Map,a=[],s=(r??[]).map(ld),n=Math.max(...t.map(u=>u.x+u.width)),l=(e.length>=t.length*1.5?24:32)+Zo,c=u=>{const f=i.get(u.from),g=i.get(u.to);if(!f||!g||f.index===g.index)return!1;if(g.index!==f.index+1)return!0;const p=u.label?di(u.label,bn(u.label)):null,m=f.node.x+f.node.width/2;return!!(p&&p.height+16>g.node.y-(f.node.y+f.node.height))||s.some(y=>m>y.left&&m<y.right&&f.node.y+f.node.height<y.bottom&&g.node.y>y.top)},h=e.filter(c),d=(u,f,g)=>{const p=h.flatMap(x=>{const b=i.get(x.from),S=i.get(x.to);return!b||!S?[]:S.index>b.index!==g?[]:x.from===u.id?[{edge:x,opposite:S.index,role:"from"}]:x.to===u.id?[{edge:x,opposite:b.index,role:"to"}]:[]}).sort((x,b)=>x.opposite-b.opposite||x.role.localeCompare(b.role)||x.edge.id.localeCompare(b.edge.id)),m=p.findIndex(x=>x.edge.id===f.id),y=p.length>1?Math.min(Uo,u.height*.6/(p.length-1)):0;return u.y+u.height/2+(m-(p.length-1)/2)*y};return e.flatMap(u=>{const f=i.get(u.from),g=i.get(u.to);if(!f||!g)return[];const{node:p,index:m}=f,{node:y,index:x}=g,b=o.get(u.from)??0;o.set(u.from,b+1);const S=u.label?di(u.label,bn(u.label)):null,T=c(u);let k;if(u.from===u.to){const L=u.label?64:28,v={x:p.x+p.width/2,y:p.y},M={x:p.x+p.width,y:p.y+p.height/2},B=n+L,E=p.y-32-b*26;k=[v,{x:v.x,y:E},{x:B,y:E},{x:B,y:M.y},M]}else if(x===m+1&&!T)k=[{x:p.x+p.width/2,y:p.y+p.height},{x:y.x+y.width/2,y:y.y}];else{const L=x>m,v={x:L?p.x+p.width:p.x,y:d(p,u,L)},M={x:L?y.x+y.width:y.x,y:d(y,u,L)},B=Math.max(l,(S?.width??0)/2+10),E=Math.min(v.y,M.y),O=Math.max(v.y,M.y),$=t.filter(P=>P.id!==p.id&&P.id!==y.id&&P.y<O&&P.y+P.height>E),I=Math.max(p.x+p.width+l,y.x+y.width+l,...$.map(P=>P.x+P.width+(S?.width??0)/2+10),...s.filter(P=>P.top<O&&P.bottom>E).map(P=>P.right+B)),F=Math.min(p.x,y.x,...$.map(P=>P.x),...s.filter(P=>P.top<O&&P.bottom>E).map(P=>P.left))-B,R=(S?.width??0)/2,q=a.filter(P=>P.downward===L&&P.top<O&&P.bottom>E);let D=L?Math.max(I,...q.map(P=>P.x+P.halfWidth+R+Zo)):Math.min(F,...q.map(P=>P.x-P.halfWidth-R-Zo));if(!L){const P=a.filter(X=>!X.downward&&(X.from===u.to||X.to===u.from)).toSorted((X,z)=>z.x-X.x),Y=X=>{if(q.length||Math.min(v.x,M.x)-X<Uo+Zo||O-E<(S?.height??0)+Uo)return!1;const z=(G,K)=>({left:Math.min(G.x,K.x),right:Math.max(G.x,K.x),top:Math.min(G.y,K.y),bottom:Math.max(G.y,K.y)}),U=(G,K,tt)=>G.left<K.right+tt&&G.right>K.left-tt&&G.top<K.bottom+tt&&G.bottom>K.top-tt,j=(G,K,tt)=>[z(K,{x:G,y:K.y}),z({x:G,y:K.y},{x:G,y:tt.y}),z({x:G,y:tt.y},tt)],V=t.map(G=>({...z(G,{x:G.x+G.width,y:G.y+G.height}),id:G.id})),Q=(r??[]).map(G=>z(G,{x:G.x+G.width,y:G.y+G.height})),rt=j(X,v,M),ht=[...V.filter(G=>G.id!==p.id&&G.id!==y.id),...Q,...s];if(rt.some(G=>ht.some(K=>U(G,K,10))))return!1;const H={left:X-R,right:X+R,top:(E+O-(S?.height??0))/2,bottom:(E+O+(S?.height??0))/2};return[...V,...Q,...s].some(G=>U(H,G,8))||H.right+10>Math.min(...t.map(G=>G.x+G.width/2))?!1:a.every(G=>{const K=j(G.x,G.start,G.end),tt={left:G.x-G.halfWidth,right:G.x+G.halfWidth,top:(G.top+G.bottom)/2-G.halfHeight,bottom:(G.top+G.bottom)/2+G.halfHeight};return rt.every(ot=>K.every(vt=>!U(ot,vt,10)))&&(!S||K.every(ot=>!U(H,ot,10)))&&(!G.halfWidth||rt.every(ot=>!U(tt,ot,10)))&&(!S||!G.halfWidth||!U(H,tt,6))})};for(const X of P)if(Math.abs(D-X.x)<Uo){const z=X.x+Uo;D=Y(z)?z:X.x-Uo}}a.push({x:D,top:E,bottom:O,halfWidth:R,downward:L,from:u.from,to:u.to,start:v,end:M,halfHeight:(S?.height??0)/2}),k=[v,{x:v.x+(L?l:-l),y:v.y},{x:D,y:v.y},{x:D,y:M.y},{x:M.x+(L?l:-l),y:M.y},M]}const _=tn(k);return[{...u,path:bE(_),points:_}]})}function bE(e,t=Zo){if(e.length===0)return"";const r=[`M ${e[0].x} ${e[0].y}`];let i=e[0],o=!1;const a=s=>{o?Math.abs(s.y-i.y)<.001?r.push(`H ${s.x}`):r.push(`V ${s.y}`):(r.push(`L ${s.x} ${s.y}`),o=!0),i=s};for(let s=1;s<e.length-1;s+=1){const n=e[s-1],l=e[s],c=e[s+1],h=Math.hypot(l.x-n.x,l.y-n.y),d=Math.hypot(c.x-l.x,c.y-l.y),u=Math.min(t,h/2,d/2),f={x:l.x-(l.x-n.x)/h*u,y:l.y-(l.y-n.y)/h*u},g={x:l.x+(c.x-l.x)/d*u,y:l.y+(c.y-l.y)/d*u};a(f),r.push(`Q ${l.x} ${l.y} ${g.x} ${g.y}`),i=g}return a(e[e.length-1]),r.join(" ")}function tn(e){const t=[],r=(i,o)=>Math.abs(i-o)<.001;for(const i of e){const o=t[t.length-1];if(!(o&&r(o.x,i.x)&&r(o.y,i.y))){for(;t.length>=2;){const a=t[t.length-2],s=t[t.length-1];if(!(r(a.x,s.x)&&r(s.x,i.x)||r(a.y,s.y)&&r(s.y,i.y)))break;t.pop()}t.push(i)}}return t}function CE(e,t,r){const i=e.x+e.width/2,o=e.y+e.height/2,a=t.x+t.width/2,s=t.y+t.height/2,n=a-i,l=s-o;return r?e.y+e.height<=t.y?{fromSide:"bottom",toSide:"top"}:t.y+t.height<=e.y?{fromSide:"top",toSide:"bottom"}:n>0?{fromSide:"right",toSide:"left"}:{fromSide:"left",toSide:"right"}:Math.abs(n)>10?n>0?{fromSide:"right",toSide:"left"}:{fromSide:"left",toSide:"right"}:l>0?{fromSide:"bottom",toSide:"top"}:{fromSide:"top",toSide:"bottom"}}function z1(e,t=0){const r=e.y,i=Math.max(Math.min(e.width,e.height)*.4,28),o=t*12,a=r-i-o,s=e.x+e.width+i+o,n={x:e.x+e.width/2,y:r},l={x:e.x+e.width,y:e.y+e.height/2},c=[n,{x:n.x,y:a},{x:s,y:a},{x:s,y:l.y},l];return{path:Cn(c),points:c}}function wE(e,t){const r=new Map(t.map(i=>[i.id,i]));return e.map(i=>{const o=Array.isArray(i.nodeIds)?[...i.nodeIds]:[];t.forEach(p=>{p.group===i.id&&!o.includes(p.id)&&o.push(p.id)});const a=o.map(p=>r.get(p)).filter(Boolean);if(a.length===0)return{...i,x:0,y:0,width:0,height:0};const s=Math.min(...a.map(p=>p.x)),n=Math.min(...a.map(p=>p.y)),l=Math.max(...a.map(p=>p.x+p.width)),c=Math.max(...a.map(p=>p.y+p.height)),h=30,d=Sa.headerHeight,u=30,f=Math.max(l-s+h*2,Iu(i.label)),g=(s+l-f)/2;return{...i,x:g,y:n-d,width:f,height:c-n+d+u}})}function kE(e,t,r){if(e.length===0)return{minX:0,minY:0,maxX:0,maxY:0,width:0,height:0};let i=Math.min(...e.map(n=>n.x)),o=Math.min(...e.map(n=>n.y)),a=Math.max(...e.map(n=>n.x+n.width)),s=Math.max(...e.map(n=>n.y+n.height));if(t&&t.length>0&&(i=Math.min(i,...t.map(n=>n.x)),o=Math.min(o,...t.map(n=>n.y)),a=Math.max(a,...t.map(n=>n.x+n.width)),s=Math.max(s,...t.map(n=>n.y+n.height))),r&&r.length>0){for(const n of r)if(n.points)for(const l of n.points)i=Math.min(i,l.x),o=Math.min(o,l.y),a=Math.max(a,l.x),s=Math.max(s,l.y)}return{minX:i,minY:o,maxX:a,maxY:s,width:a-i,height:s-o}}var SE=new Set(["$$slots","$$events","$$legacy","children"]),vE=pi('<path d="M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,187a113.4,113.4,0,0,1-20.39-35h40.82a116.94,116.94,0,0,1-10,20.77A108.61,108.61,0,0,1,128,207Zm-26.49-59a135.42,135.42,0,0,1,0-40h53a135.42,135.42,0,0,1,0,40ZM44,128a83.49,83.49,0,0,1,2.43-20H77.25a160.63,160.63,0,0,0,0,40H46.43A83.49,83.49,0,0,1,44,128Zm84-79a113.4,113.4,0,0,1,20.39,35H107.59a116.94,116.94,0,0,1,10-20.77A108.61,108.61,0,0,1,128,49Zm50.73,59h30.82a83.52,83.52,0,0,1,0,40H178.75a160.63,160.63,0,0,0,0-40Zm20.77-24H173.71a140.82,140.82,0,0,0-15.5-34.36A84.51,84.51,0,0,1,199.52,84ZM97.79,49.64A140.82,140.82,0,0,0,82.29,84H56.48A84.51,84.51,0,0,1,97.79,49.64ZM56.48,172H82.29a140.82,140.82,0,0,0,15.5,34.36A84.51,84.51,0,0,1,56.48,172Zm101.73,34.36A140.82,140.82,0,0,0,173.71,172h25.81A84.51,84.51,0,0,1,158.21,206.36Z"></path>'),ME=pi('<path d="M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z" opacity="0.2"></path><path d="M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"></path>',1),TE=pi('<path d="M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm78.36,64H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM216,128a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM128,43a115.27,115.27,0,0,1,26,45H102A115.11,115.11,0,0,1,128,43ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48Zm50.35,61.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"></path>'),BE=pi('<path d="M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm81.57,64H169.19a132.58,132.58,0,0,0-25.73-50.67A90.29,90.29,0,0,1,209.57,90ZM218,128a89.7,89.7,0,0,1-3.83,26H171.81a155.43,155.43,0,0,0,0-52h42.36A89.7,89.7,0,0,1,218,128Zm-90,87.83a110,110,0,0,1-15.19-19.45A124.24,124.24,0,0,1,99.35,166h57.3a124.24,124.24,0,0,1-13.46,30.38A110,110,0,0,1,128,215.83ZM96.45,154a139.18,139.18,0,0,1,0-52h63.1a139.18,139.18,0,0,1,0,52ZM38,128a89.7,89.7,0,0,1,3.83-26H84.19a155.43,155.43,0,0,0,0,52H41.83A89.7,89.7,0,0,1,38,128Zm90-87.83a110,110,0,0,1,15.19,19.45A124.24,124.24,0,0,1,156.65,90H99.35a124.24,124.24,0,0,1,13.46-30.38A110,110,0,0,1,128,40.17Zm-15.46-.84A132.58,132.58,0,0,0,86.81,90H46.43A90.29,90.29,0,0,1,112.54,39.33ZM46.43,166H86.81a132.58,132.58,0,0,0,25.73,50.67A90.29,90.29,0,0,1,46.43,166Zm97,50.67A132.58,132.58,0,0,0,169.19,166h40.38A90.29,90.29,0,0,1,143.46,216.67Z"></path>'),_E=pi('<path d="M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"></path>'),LE=pi('<path d="M128,28h0A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,190.61c-6.33-6.09-23-24.41-31.27-54.61h62.54C151,194.2,134.33,212.52,128,218.61ZM94.82,156a140.42,140.42,0,0,1,0-56h66.36a140.42,140.42,0,0,1,0,56ZM128,37.39c6.33,6.09,23,24.41,31.27,54.61H96.73C105,61.8,121.67,43.48,128,37.39ZM169.41,100h46.23a92.09,92.09,0,0,1,0,56H169.41a152.65,152.65,0,0,0,0-56Zm43.25-8h-45a129.39,129.39,0,0,0-29.19-55.4A92.25,92.25,0,0,1,212.66,92ZM117.54,36.6A129.39,129.39,0,0,0,88.35,92h-45A92.25,92.25,0,0,1,117.54,36.6ZM40.36,100H86.59a152.65,152.65,0,0,0,0,56H40.36a92.09,92.09,0,0,1,0-56Zm3,64h45a129.39,129.39,0,0,0,29.19,55.4A92.25,92.25,0,0,1,43.34,164Zm95.12,55.4A129.39,129.39,0,0,0,167.65,164h45A92.25,92.25,0,0,1,138.46,219.4Z"></path>'),AE=pi('<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>');function H1(e,t){if(new.target)return Oo({component:H1,...e});No(t,!0);const r=mC();let i=He(t,"children",7),o=hC(t,SE),a=Dt(()=>t.weight??r.weight??"regular"),s=Dt(()=>t.color??r.color??"currentColor"),n=Dt(()=>t.size??r.size??"1em"),l=Dt(()=>t.mirrored??r.mirrored??!1);function c(k){let{weight:_,color:L,size:v,mirrored:M,...B}=k;return B}var h={get children(){return i()},set children(k){i(k),_e()},$set:Do,$on:(k,_)=>Ro(t,k,_)},d=AE();qp(d,(k,_)=>({xmlns:"http://www.w3.org/2000/svg",role:"img",width:A(n),height:A(n),fill:A(s),transform:A(l)?"scale(-1, 1)":void 0,viewBox:"0 0 256 256",...k,..._}),[()=>c(r),()=>c(o)]);var u=qe(d);{var f=k=>{var _=Ko(),L=ui(_);il(L,i),ge(k,_)};yr(u,k=>{i()&&k(f)})}var g=We(u,2);{var p=k=>{var _=vE();ge(k,_)},m=k=>{var _=ME();en(),ge(k,_)},y=k=>{var _=TE();ge(k,_)},x=k=>{var _=BE();ge(k,_)},b=k=>{var _=_E();ge(k,_)},S=k=>{var _=LE();ge(k,_)},T=k=>{var _=rl();_.nodeValue=(console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'),""),ge(k,_)};yr(g,k=>{A(a)==="bold"?k(p):A(a)==="duotone"?k(m,1):A(a)==="fill"?k(y,2):A(a)==="light"?k(x,3):A(a)==="regular"?k(b,4):A(a)==="thin"?k(S,5):k(T,-1)})}return $e(d),ge(e,d),qo(h)}const Ir=(e,t)=>({name:e,component:t}),cd=Ir("cube",vC),FE={actor:Ir("user",OC),data:Ir("database",ju),data_store:Ir("hard-drive",IC),db:Ir("database",ju),decision:Ir("code-branch",Xu),end:Ir("stop",xC),event:Ir("clock",PC),external:Ir("globe",H1),file:Ir("file-lines",EC),interface:Ir("plug",$C),milestone:Ir("flag",FC),module:cd,node:cd,package:Ir("box",AC),process:Ir("gear",LC),queue:Ir("message",_C),router:Ir("code-branch",Xu),server:Ir("server",Yu),service:Ir("server",Yu),start:Ir("play",yC),state:Ir("circle",BC),switch:Ir("right-left",TC),ui_component:Ir("desktop",MC)};function $E(e){return e&&FE[e]||cd}var Op=ar("<wbr/>"),EE=ar('<span class="semantic-filename-unit svelte-u4m0nr"> </span><!>',1),PE=ar("<br/>"),IE=ar(" <!>",1),OE=ar('<div class="node-kind-label svelte-u4m0nr"> </div>'),DE=ar('<div class="node-content svelte-u4m0nr"><div class="node-row svelte-u4m0nr"><span class="node-icon svelte-u4m0nr" data-node-icon="" aria-hidden="true"><!></span> <div class="node-copy svelte-u4m0nr"><div class="node-label svelte-u4m0nr"><!></div> <!></div></div></div>');function Y1(e,t){if(new.target)return Oo({component:Y1,...e});No(t,!0);let r=He(t,"node",7),i=He(t,"editable",7,!1),o=He(t,"dimmed",7,!1),a=He(t,"highlighted",7,!1),s=He(t,"styleConfig",7,Gi),n=He(t,"onMove",7),l=He(t,"onHover",7),c=He(t,"onBindingClick",7),h=ce(!1),d=ce(0),u=ce(0),f=ce(void 0);function g(D,P){const Y=A(f)?.closest("svg");if(Y){const X=Y.getScreenCTM();if(X){const z=X.inverse();return{x:z.a*D+z.c*P+z.e,y:z.b*D+z.d*P+z.f}}}return{x:D,y:P}}function p(D){if(!i())return;gt(h,!0);const P=g(D.clientX,D.clientY);gt(d,P.x-r().x),gt(u,P.y-r().y)}function m(D){if(!A(h)||!i())return;const P=g(D.clientX,D.clientY),Y=P.x-A(d),X=P.y-A(u);n()?.(Y,X)}function y(){gt(h,!1)}function x(){return r().binding?r().binding:r().bindings&&r().bindings.length>0?r().bindings[0]:null}let b=Dt(()=>!!x()),S=Dt(()=>s()===Gi),T=Dt(()=>$E(r().kind)),k=Dt(()=>A(T).component),_=Dt(()=>A(S)?10:s().paddingX),L=Dt(()=>A(S)?7:s().paddingY),v=Dt(()=>A(S)?2:s().gap),M=Dt(()=>A(S)?11:s().kindFontSize),B=Dt(()=>["db","store","data_store"].includes(r().kind??"")),E=Dt(()=>_u(r().label)),O=Dt(()=>{const D=x();if(D)return je.diagram_node_openBinding_ariaLabel({label:r().label,type:D.type})});function $(D){const P=x();P&&c()&&c()(D,P)}let I=Dt(()=>{const D=["diagram-node-html"];return r().semanticStyle&&D.push(`node-${r().semanticStyle}`),r().kind&&D.push(`node-kind-${r().kind}`),A(b)&&D.push("node-clickable"),i()&&D.push("node-editable"),o()&&D.push("node-dimmed"),a()&&D.push("node-state-highlighted"),D.join(" ")});var F={get node(){return r()},set node(D){r(D),_e()},get editable(){return i()},set editable(D=!1){i(D),_e()},get dimmed(){return o()},set dimmed(D=!1){o(D),_e()},get highlighted(){return a()},set highlighted(D=!1){a(D),_e()},get styleConfig(){return s()},set styleConfig(D=Gi){s(D),_e()},get onMove(){return n()},set onMove(D){n(D),_e()},get onHover(){return l()},set onHover(D){l(D),_e()},get onBindingClick(){return c()},set onBindingClick(D){c(D),_e()},$set:Do,$on:(D,P)=>Ro(t,D,P)},R=Ko();ml("mousemove",Wu,m),ml("mouseup",Wu,y);var q=ui(R);return XC(q,()=>A(b)?"button":"div",!1,(D,P)=>{no(D,Ot=>gt(f,Ot,!0),()=>A(f));var Y=()=>l()?.(r().id),X=()=>l()?.(null),z=()=>l()?.(r().id),U=()=>l()?.(null);qp(D,()=>({type:A(b)?"button":void 0,role:A(b)?"button":void 0,class:A(I),"data-semantic-style":r().semanticStyle??"default","data-default-style":A(S),"data-state-highlighted":a(),"data-dimmed":o(),"data-store-node":A(B),"aria-label":A(O),style:`
332
+ `);F=Math.min(E,Math.max(...j.map(_))),R=c*r.kindLineHeight*j.reduce((V,Q)=>V+gp(Q.match(/\S+[\t ]*|[\t ]+/g)??[],E,_),0)}const q=e.kind?1:0,D=Math.max(O+f,F+q)+h,P=I+(e.kind?l+R:0),Y=Math.max(b?72:t.width*.6,a?112:0),X=h+s*2+d,z=Math.max(Math.min(Math.max(D+s*2+d,Y),u),Math.min(M,E)+X+f),U=Math.max(P+n*2+d,rE,a?90:0);return{width:z,height:U}}function lE(e,t,r,i,o){if(e.some(s=>s.position)||r.type==="manual"){const s=[],n=[];for(const u of e){const f=u.size?.width??i.width,g=u.size?.height??i.height;if(u.position){const p={...u,x:u.position.x,y:u.position.y,width:f,height:g};n.push(p),s.push(p)}else n.push({...u,x:0,y:0,width:f,height:g})}const l=Ms(r.spacing,80);for(let u=0;u<n.length;u++){if(e[u].position)continue;const g=n[u].width,p=n[u].height;let m=0,y=0,x=!1;for(let b=0;b<20&&!x;b++)for(let S=0;S<20&&!x;S++){const T=S*(g+l),k=b*(p+l);s.some(L=>!(T+g+l*.3<L.x||T>L.x+L.width+l*.3||k+p+l*.3<L.y||k>L.y+L.height+l*.3))||(m=T,y=k,x=!0)}n[u]={...n[u],x:m,y},s.push({x:m,y,width:g,height:p})}const c=new Map;for(const u of n){const f=e.find(({id:m})=>m===u.id)?.position;if(!f)continue;const g=[...c.keys()].find(m=>Math.abs(m-f.x)<=8),p=c.get(g??f.x)??[];p.push(u),c.set(g??f.x,p)}const h=Math.min(...n.map(u=>u.x)),d=new Set;for(const[u,f]of c){if(f.length<2)continue;const g=Math.max(...f.map(m=>m.width)),p=h+(u+g/2-h)*.89;for(const m of f)m.x=p-m.width/2,d.add(m.id)}for(const u of n)d.has(u.id)||(u.x=h+(u.x-h)*.89);return n}switch(r.type){case"layered":return Ep(e,t,r,i,o);case"force":return dE(e,t,r,i,o);case"circular":return uE(e,r,i);case"tree":return fE(e,t,r,i);default:return Ep(e,t,r,i,o)}}function Ep(e,t,r,i,o){const a=Ms(r.spacing,80),s=r.direction??"LR",n=s==="LR"||s==="RL",l=new Map;o&&(o.forEach(u=>{Array.isArray(u.nodeIds)&&u.nodeIds.forEach(f=>l.set(f,u.id))}),e.forEach(u=>{u.group&&l.set(u.id,u.group)}));const c=new Map,h=new Map;e.forEach(u=>{c.set(u.id,[]),h.set(u.id,[])}),t.forEach(u=>{c.get(u.from)?.push(u.to),h.get(u.to)?.push(u.from)});const d=new Map;return e.forEach(u=>{d.set(u.id,{width:u.size?.width??i.width,height:u.size?.height??i.height})}),o&&o.length>0?cE(e,t,o,d,l,c,h,a,n):hE(e,t,d,a,n)}function cE(e,t,r,i,o,a,s,n,l){const c="__ungrouped__",d=n<=40,u=Math.max(d?35:48,n*.75),f=Math.max(20,n*.32),g=new Map;r.forEach($=>g.set($.id,[])),g.set(c,[]),e.forEach($=>{const I=o.get($.id)||c;let F=g.get(I);F||(F=[],g.set(I,F)),F.push($.id)});const p=new Map,m=new Map,y=[...r.map($=>$.id),c];y.forEach($=>{p.set($,new Set),m.set($,new Set)}),t.forEach($=>{const I=o.get($.from)||c,F=o.get($.to)||c;I!==F&&(p.get(I)?.add(F),m.get(F)?.add(I))});const x=new Map,b=new Set;function S($){const I=x.get($);if(I!==void 0)return I;if(b.has($))return 0;b.add($);const F=y.indexOf($),R=[...m.get($)||new Set].filter(P=>!(p.get($)?.has(P)??!1)||y.indexOf(P)<F);let q=-1;R.forEach(P=>{q=Math.max(q,S(P))});const D=q+1;return x.set($,D),D}y.forEach($=>{(g.get($)?.length??0)>0&&S($)});const T=Math.max(...Array.from(x.values()),0),k=Array.from({length:T+1},()=>[]);x.forEach(($,I)=>{(g.get(I)?.length??0)>0&&k[$].push(I)});const _=new Map,L=new Map,v=new Map,M=new Map;e.forEach($=>{v.set($.id,[]),M.set($.id,[])}),t.forEach($=>{const I=o.get($.from)||c,F=o.get($.to)||c;I===F&&(v.get($.from)?.push($.to),M.get($.to)?.push($.from))}),y.forEach($=>{const I=g.get($)||[];if(I.length===0){L.set($,{width:0,height:0}),_.set($,{layers:[],nodeLayer:new Map,layerSpacing:[]});return}const F=new Set(I),R=new Map,q=new Set;function D(Q){const rt=R.get(Q);if(rt!==void 0)return rt;if(q.has(Q))return 0;q.add(Q);const ht=(M.get(Q)||[]).filter(K=>F.has(K));let H=-1;ht.forEach(K=>{H=Math.max(H,D(K))});const G=H+1;return R.set(Q,G),G}I.forEach(Q=>D(Q));const P=Math.max(...Array.from(R.values()),0),Y=Array.from({length:P+1},()=>[]);R.forEach((Q,rt)=>{F.has(rt)&&Y[Q].push(rt)});for(let Q=0;Q<4;Q++){for(let rt=1;rt<Y.length;rt++){const ht=Y[rt],H=Y[rt-1],G=new Map;ht.forEach(K=>{const ot=(M.get(K)||[]).filter(vt=>F.has(vt)).map(vt=>H.indexOf(vt)).filter(vt=>vt!==-1);ot.length>0?G.set(K,ot.reduce((vt,Ot)=>vt+Ot,0)/ot.length):G.set(K,ht.indexOf(K))}),ht.sort((K,tt)=>(G.get(K)??0)-(G.get(tt)??0))}for(let rt=Y.length-2;rt>=0;rt--){const ht=Y[rt],H=Y[rt+1],G=new Map;ht.forEach(K=>{const ot=(v.get(K)||[]).filter(vt=>F.has(vt)).map(vt=>H.indexOf(vt)).filter(vt=>vt!==-1);ot.length>0?G.set(K,ot.reduce((vt,Ot)=>vt+Ot,0)/ot.length):G.set(K,ht.indexOf(K))}),ht.sort((K,tt)=>(G.get(K)??0)-(G.get(tt)??0))}}const X=Y.slice(0,-1).map((Q,rt)=>{const ht=t.reduce((H,G)=>{if(!G.label||o.get(G.from)!==$||o.get(G.to)!==$||R.get(G.from)!==rt||R.get(G.to)!==rt+1)return H;const K=di(G.label);return Math.max(H,(l?K.width:K.height)+(d?18:24))},0);return Math.max(n*.5,ht)});_.set($,{layers:Y,nodeLayer:R,layerSpacing:X});let z=0,U=0;Y.forEach((Q,rt)=>{let ht=0,H=0;Q.forEach(G=>{const K=i.get(G);K&&(l?(H+=K.height+f,ht=Math.max(ht,K.width)):(H+=K.width+f,ht=Math.max(ht,K.height)))}),H-=f,U=Math.max(U,H),z+=ht,rt>0&&(z+=X[rt-1]??n*.5)});const j=l?z+64:U+64,V=l?U+64:z+64;L.set($,{width:j,height:V})});for(let $=0;$<4;$++){for(let I=1;I<k.length;I++){const F=k[I],R=k[I-1],q=new Map;F.forEach(D=>{const Y=Array.from(m.get(D)||[]).map(X=>R.indexOf(X)).filter(X=>X!==-1);Y.length>0?q.set(D,Y.reduce((X,z)=>X+z,0)/Y.length):q.set(D,F.indexOf(D))}),F.sort((D,P)=>(q.get(D)??0)-(q.get(P)??0))}for(let I=k.length-2;I>=0;I--){const F=k[I],R=k[I+1],q=new Map;F.forEach(D=>{const Y=Array.from(p.get(D)||[]).map(X=>R.indexOf(X)).filter(X=>X!==-1);Y.length>0?q.set(D,Y.reduce((X,z)=>X+z,0)/Y.length):q.set(D,F.indexOf(D))}),F.sort((D,P)=>(q.get(D)??0)-(q.get(P)??0))}}const B=new Map;let E=0;if(k.forEach($=>{let I=0,F=0;$.forEach(R=>{const q=L.get(R);q&&(l?(B.set(R,{x:E,y:I}),I+=q.height+u,F=Math.max(F,q.width)):(B.set(R,{x:I,y:E}),I+=q.width+u,F=Math.max(F,q.height)))}),E+=F+u}),!l){const $=[];for(const[I,F]of B){const R=$.find(q=>Math.abs(q.x-F.x)<.5);R?R.groupIds.push(I):$.push({x:F.x,groupIds:[I]})}for(const I of $){const F=Math.max(...I.groupIds.map(R=>L.get(R)?.width??0));for(const R of I.groupIds){const q=B.get(R),D=L.get(R)?.width;!q||D===void 0||B.set(R,{...q,x:q.x+(F-D)/2})}}}const O=[];return y.forEach($=>{const I=g.get($)||[],F=B.get($),R=_.get($);if(!F||I.length===0||!R)return;const{layers:q,layerSpacing:D}=R;let P=32;q.forEach((Y,X)=>{let z=0;Y.forEach(rt=>{const ht=i.get(rt);ht&&(z+=(l?ht.height:ht.width)+f)}),z-=f;const U=L.get($);if(!U)return;let V=32+((l?U.height:U.width)-64-z)/2,Q=0;Y.forEach(rt=>{const ht=e.find(tt=>tt.id===rt),H=i.get(rt);if(!ht||!H)return;let G,K;l?(G=F.x+P,K=F.y+V,V+=H.height+f,Q=Math.max(Q,H.width)):(G=F.x+V,K=F.y+P,V+=H.width+f,Q=Math.max(Q,H.height)),O.push({...ht,x:G,y:K,width:H.width,height:H.height})}),P+=Q+(D[X]??n*.5)})}),O}function hE(e,t,r,i,o){const a=new Map(e.map((S,T)=>[S.id,T])),s=new Set,n=new Map;for(const S of t){const T=n.get(S.from)??[];T.push(S),n.set(S.from,T)}const l=(S,T,k)=>{const _=[S],L=new Set;for(;_.length;){const v=_.pop();if(v){if(v===T)return!0;if(!L.has(v)){L.add(v);for(const M of n.get(v)??[])M.id!==k&&_.push(M.to)}}}return!1};for(const S of t){const T=a.get(S.from)??0,k=a.get(S.to)??0;T>k&&l(S.to,S.from,S.id)&&s.add(S.id)}const c=new Map,h=new Map;for(const S of t)s.has(S.id)||(c.set(S.to,[...c.get(S.to)??[],S.from]),h.set(S.from,[...h.get(S.from)??[],S.to]));const d=new Map,u=new Set;function f(S){const T=d.get(S);if(T!==void 0)return T;if(u.has(S))return 0;u.add(S);const k=c.get(S)||[];let _=-1;k.forEach(v=>{_=Math.max(_,f(v))});const L=_+1;return d.set(S,L),L}e.forEach(S=>f(S.id));const g=Math.max(...Array.from(d.values()),0),p=Array.from({length:g+1},()=>[]);d.forEach((S,T)=>{p[S].push(T)});for(let S=0;S<4;S++){for(let T=1;T<p.length;T++){const k=p[T],_=p[T-1],L=new Map;k.forEach(v=>{const B=(c.get(v)||[]).map(E=>_.indexOf(E)).filter(E=>E!==-1);B.length>0?L.set(v,B.reduce((E,O)=>E+O,0)/B.length):L.set(v,k.indexOf(v))}),k.sort((v,M)=>(L.get(v)??0)-(L.get(M)??0))}for(let T=p.length-2;T>=0;T--){const k=p[T],_=p[T+1],L=new Map;k.forEach(v=>{const B=(h.get(v)||[]).map(E=>_.indexOf(E)).filter(E=>E!==-1);B.length>0?L.set(v,B.reduce((E,O)=>E+O,0)/B.length):L.set(v,k.indexOf(v))}),k.sort((v,M)=>(L.get(v)??0)-(L.get(M)??0))}}const m=[],y=i*.4,x=p.slice(0,-1).map((S,T)=>{const k=t.reduce((_,L)=>{const v=d.get(L.from),M=d.get(L.to);if(!L.label||s.has(L.id)||v!==T||M!==T+1)return _;const B=di(L.label);return Math.max(_,(o?B.width:B.height)+36)},0);return Math.max(i*.65,k)});let b=0;return p.forEach((S,T)=>{let k=0,_=0;_=-S.reduce((v,M)=>{const B=r.get(M);return B?v+(o?B.height:B.width)+y:v},-y)/2,S.forEach(v=>{const M=e.find($=>$.id===v),B=r.get(v);if(!M||!B)return;let E,O;o?(E=b,O=_,_+=B.height+y,k=Math.max(k,B.width)):(E=_,O=b,_+=B.width+y,k=Math.max(k,B.height)),m.push({...M,x:E,y:O,width:B.width,height:B.height})}),b+=k+(x[T]??i*.8)}),m}function dE(e,t,r,i,o){const a=Ms(r.spacing,100),s=r.direction??"LR",n=s==="LR"||s==="RL",l=150,c=a*a*8,h=.04,d=1.5,u=.7,f=new Map;o&&(o.forEach(I=>{Array.isArray(I.nodeIds)&&I.nodeIds.forEach(F=>{f.set(F,I.id)})}),e.forEach(I=>{I.group&&f.set(I.id,I.group)}));const g=new Map,p=new Map;e.forEach(I=>{g.set(I.id,[]),p.set(I.id,[])}),t.forEach(I=>{g.get(I.from)?.push(I.to),p.get(I.to)?.push(I.from)});const m=new Map,y=new Set,x=e.filter(I=>(p.get(I.id)?.length??0)===0),S=(x.length>0?x:[e[0]]).map(I=>({id:I.id,depth:0}));let T=0;for(;S.length>0;){const I=S.shift();if(!I)break;const{id:F,depth:R}=I;if(y.has(F))continue;y.add(F),m.set(F,R),T=Math.max(T,R),(g.get(F)??[]).forEach(D=>{y.has(D)||S.push({id:D,depth:R+1})})}e.forEach(I=>{m.has(I.id)||m.set(I.id,0)});const k=new Map;m.forEach(I=>{k.set(I,(k.get(I)??0)+1)});const _=new Map,L=new Map;if(o&&o.length>0){const I=o.length;let F,R;n?(F=I,R=1):(F=1,R=I);const q=a*.8;o.forEach((D,P)=>{const Y=P%F,X=Math.floor(P/F),z=(Y-(F-1)/2)*q,U=(X-(R-1)/2)*q;L.set(D.id,{x:n?z:U,y:n?U:z,vx:0,vy:0})})}const v=e.map(I=>{const F=m.get(I.id)??0,R=k.get(F)??1,q=_.get(F)??0;_.set(F,q+1);const D=n?2:1.5,P=n?1:1.2,Y=F/Math.max(T,1)*a*D;let X=(q-R/2)/Math.max(R,1)*a*P;const z=f.get(I.id),U=z?L.get(z):void 0;U&&(n?X=U.y+X*.2:X=U.x+X*.2);const j=I.id.split("").reduce((rt,ht)=>rt+ht.charCodeAt(0),0),V=(j%100/100-.5)*a*.1,Q=(j*7%100/100-.5)*a*.1;return{node:I,x:(n?Y:X)+V,y:(n?X:Y)+Q,vx:0,vy:0,width:I.size?.width??i.width,height:I.size?.height??i.height}}),M=I=>v.find(F=>F.node.id===I);for(let I=0;I<l;I++){v.forEach(F=>{F.vx=0,F.vy=0});for(let F=0;F<v.length;F++)for(let R=F+1;R<v.length;R++){const q=v[R].x-v[F].x,D=v[R].y-v[F].y,P=q*q+D*D+.01,Y=Math.sqrt(P),X=(v[F].width+v[R].width)/2+a*.25,z=(v[F].height+v[R].height)/2+a*.25,U=Math.sqrt(X*X+z*z),j=Y<U?c*3/P:c*1/P;let V=q/Y*j,Q=D/Y*j;n?(V*=1.5,Q*=.6):(V*=.6,Q*=1.5),v[F].vx-=V,v[F].vy-=Q,v[R].vx+=V,v[R].vy+=Q}t.forEach(F=>{const R=M(F.from),q=M(F.to);if(!R||!q)return;const D=q.x-R.x,P=q.y-R.y,Y=Math.sqrt(D*D+P*P+.01),X=h*Y,z=D/Y*X,U=P/Y*X;R.vx+=z,R.vy+=U,q.vx-=z,q.vy-=U}),v.forEach(F=>{t.forEach(R=>{if(R.from===F.node.id||R.to===F.node.id)return;const q=M(R.from),D=M(R.to);if(!q||!D)return;const P=D.x-q.x,Y=D.y-q.y,X=P*P+Y*Y;if(X<.01)return;const z=Math.max(0,Math.min(1,((F.x-q.x)*P+(F.y-q.y)*Y)/X));if(z<.1||z>.9)return;const U=q.x+z*P,j=q.y+z*Y,V=F.x-U,Q=F.y-j,rt=V*V+Q*Q+.01,ht=Math.sqrt(rt),G=Math.max(F.width,F.height)/2+a*.1;if(ht<G){const K=ht/G,tt=d*(1-K)*(1-K)*a;F.vx+=V/ht*tt,F.vy+=Q/ht*tt}})});for(let F=0;F<t.length;F++)for(let R=F+1;R<t.length;R++){const q=t[F],D=t[R];if(q.from===D.from||q.from===D.to||q.to===D.from||q.to===D.to)continue;const P=M(q.from),Y=M(q.to),X=M(D.from),z=M(D.to);if(!P||!Y||!X||!z)continue;const U=(Y.x-P.x)*(z.y-X.y)-(Y.y-P.y)*(z.x-X.x);if(Math.abs(U)<.01)continue;const j=((X.x-P.x)*(z.y-X.y)-(X.y-P.y)*(z.x-X.x))/U,V=((X.x-P.x)*(Y.y-P.y)-(X.y-P.y)*(Y.x-P.x))/U;if(j>.1&&j<.9&&V>.1&&V<.9){const Q=d*a*.15,rt=z.x-X.x,ht=z.y-X.y,H=Math.sqrt(rt*rt+ht*ht),G=-ht/H,K=rt/H,ot=(z.x-X.x)*(P.y-X.y)-(z.y-X.y)*(P.x-X.x)>0?1:-1;P.vx+=G*Q*ot,P.vy+=K*Q*ot,Y.vx+=G*Q*ot,Y.vy+=K*Q*ot,X.vx-=G*Q*ot,X.vy-=K*Q*ot,z.vx-=G*Q*ot,z.vy-=K*Q*ot}}if(o&&o.length>0&&L.size>0){L.forEach(P=>{P.vx=0,P.vy=0});const F=a*a*5,R=Array.from(L.entries());for(let P=0;P<R.length;P++)for(let Y=P+1;Y<R.length;Y++){const[,X]=R[P],[,z]=R[Y],U=z.x-X.x,j=z.y-X.y,V=U*U+j*j+.01,Q=Math.sqrt(V),rt=F/V,ht=U/Q*rt,H=j/Q*rt;X.vx-=ht,X.vy-=H,z.vx+=ht,z.vy+=H}const q=.05;v.forEach(P=>{const Y=f.get(P.node.id),X=Y?L.get(Y):void 0;if(X){const z=X.x-P.x,U=X.y-P.y;P.vx+=z*q,P.vy+=U*q,X.vx-=z*q*.1,X.vy-=U*q*.1}});const D=a*2;for(let P=0;P<v.length;P++)for(let Y=P+1;Y<v.length;Y++){const X=f.get(v[P].node.id),z=f.get(v[Y].node.id);if(X&&z&&X!==z||(X&&!z||!X&&z)){const V=v[Y].x-v[P].x,Q=v[Y].y-v[P].y,rt=Math.sqrt(V*V+Q*Q+.01),ht=D/(rt*1+a*.5),H=V/rt*ht,G=Q/rt*ht;v[P].vx-=H,v[P].vy-=G,v[Y].vx+=H,v[Y].vy+=G}}L.forEach(P=>{P.x+=P.vx*u,P.y+=P.vy*u})}v.forEach(F=>{F.x+=F.vx*u,F.y+=F.vy*u})}for(let I=0;I<10;I++){let F=!1;for(let R=0;R<v.length;R++)for(let q=R+1;q<v.length;q++){const D=(v[R].width+v[q].width)/2+a*.15-Math.abs(v[q].x-v[R].x),P=(v[R].height+v[q].height)/2+a*.15-Math.abs(v[q].y-v[R].y);if(D>0&&P>0)if(F=!0,D<P){const Y=D/2+1;v[q].x>=v[R].x?(v[R].x-=Y,v[q].x+=Y):(v[R].x+=Y,v[q].x-=Y)}else{const Y=P/2+1;v[q].y>=v[R].y?(v[R].y-=Y,v[q].y+=Y):(v[R].y+=Y,v[q].y-=Y)}}if(!F)break}const B=60,E=new Map;v.forEach(I=>E.set(I.node.id,new Set)),t.forEach(I=>{E.get(I.from)?.add(I.to),E.get(I.to)?.add(I.from)});const O=new Map;let $=0;if(v.forEach(I=>{if(O.has(I.node.id))return;const F=$++,R=[I.node.id];for(;R.length>0;){const q=R.pop();if(q===void 0)break;O.has(q)||(O.set(q,F),E.get(q)?.forEach(D=>{O.has(D)||R.push(D)}))}}),$>1){const I=new Map;v.forEach(X=>{const z=O.get(X.node.id);if(z===void 0)return;const U=I.get(z);U?(U.minX=Math.min(U.minX,X.x),U.minY=Math.min(U.minY,X.y),U.maxX=Math.max(U.maxX,X.x+X.width),U.maxY=Math.max(U.maxY,X.y+X.height)):I.set(z,{minX:X.x,minY:X.y,maxX:X.x+X.width,maxY:X.y+X.height})});const F=Array.from(I.keys()).sort((X,z)=>{const U=I.get(X),j=I.get(z);return!U||!j?0:(j.maxX-j.minX)*(j.maxY-j.minY)-(U.maxX-U.minX)*(U.maxY-U.minY)}),R=Math.ceil(Math.sqrt(F.length));let q=0,D=0,P=0,Y=0;for(const X of F){const z=I.get(X);if(!z)continue;const U=z.maxX-z.minX,j=z.maxY-z.minY,V=q-z.minX,Q=D-z.minY;v.forEach(rt=>{O.get(rt.node.id)===X&&(rt.x+=V,rt.y+=Q)}),q+=U+B,P=Math.max(P,j),Y++,Y>=R&&(Y=0,q=0,D+=P+B,P=0)}}return v.map(I=>({...I.node,x:I.x,y:I.y,width:I.width,height:I.height}))}function uE(e,t,r){const o=2*Math.PI/e.length;return e.map((a,s)=>{const n=s*o,l=200*Math.cos(n),c=200*Math.sin(n),h=a.size?.width??r.width,d=a.size?.height??r.height;return{...a,x:l,y:c,width:h,height:d}})}function fE(e,t,r,i){const o=Ms(r.spacing,60),a=r.direction??"TB",s=a==="TB"||a==="BT",n=new Map,l=new Map;t.forEach(f=>{let g=n.get(f.from);g||(g=[],n.set(f.from,g)),g.push(f.to),l.set(f.to,f.from)});const c=e.filter(f=>!l.has(f.id));c.length===0&&e.length>0&&c.push(e[0]);const h=new Map;let d=0;function u(f,g){const p=e.find(v=>v.id===f);if(!p)return{width:0,height:0};const m=p.size?.width??i.width,y=p.size?.height??i.height,x=n.get(f)||[];if(x.length===0){const v=s?d:g*(m+o),M=s?g*(y+o):d;return h.set(f,{x:v,y:M,width:m,height:y}),d+=(s?m:y)+o,{width:m,height:y}}const b=[];x.forEach(v=>{const M=u(v,g+1);b.push(s?M.width:M.height)});const k=(d-b.reduce((v,M)=>v+M,0)-o*(b.length-1)+d)/2,_=s?k:g*(m+o),L=s?g*(y+o):k;return h.set(f,{x:_,y:L,width:m,height:y}),{width:m,height:y}}return c.forEach(f=>{u(f.id,0)}),e.map(f=>{const g=h.get(f.id)||{x:0,y:0,width:i.width,height:i.height};return{...f,x:g.x,y:g.y,width:g.width,height:g.height}})}function gE(e,t,r,i){const o=r.edgeRouting||"polyline";return r.type==="circular"?Ip(e,t):o==="orthogonal"||o==="curved"?W1(e,t,r,i):Ip(e,t)}const pE=32,mE=6;function yE(e,t){return Math.max(pE,(e+t)/4+mE/2)}function q1(e,t){const r=new Map,i=new Map(t.map(s=>[s.id,s])),o=new Map;for(const s of e){if(s.from===s.to)continue;const n=`${s.from}::${s.to}`;let l=o.get(n);l||(l=[],o.set(n,l)),l.push(s)}const a=new Set;for(const[s]of o){const[n,l]=s.split("::"),c=`${l}::${n}`,h=[n,l].sort().join("::");if(a.has(h)||!o.has(c))continue;a.add(h);const d=o.get(s),u=o.get(c);if(!d||!u)continue;const f=i.get(n),g=i.get(l),p=f&&g?Math.abs(g.x+g.width/2-(f.x+f.width/2))>=Math.abs(g.y+g.height/2-(f.y+f.height/2)):!1,m=x=>Math.max(0,...x.map(b=>{if(!b.label)return 0;const S=di(b.label);return p?S.height:S.width})),y=yE(m(d),m(u));for(const x of d)r.set(x.id,y);for(const x of u)r.set(x.id,y)}return r}function Pp(e,t,r,i){const o=r.x-t.x,a=r.y-t.y,s=Math.sqrt(o*o+a*a);if(s===0)return e;const n=-a/s,l=o/s;return{x:e.x+n*i,y:e.y+l*i}}function Ip(e,t){const r=new Map(t.map(a=>[a.id,a])),i=q1(e,t),o=new Map;return e.map(a=>{const s=r.get(a.from),n=r.get(a.to);if(!s||!n)return{...a,path:"",points:[]};if(s.id===n.id){const v=o.get(a.from)??0;o.set(a.from,v+1);const{path:M,points:B}=z1(s,v);return{...a,path:M,points:B}}const l=s.x+s.width/2,c=s.y+s.height/2,h=n.x+n.width/2,d=n.y+n.height/2,u=h-l,f=d-c;let g,p;const m=Math.atan2(f,u),y=Math.abs(m);y<Math.PI/4?(g={x:s.x+s.width,y:c},p={x:n.x,y:d}):y>3*Math.PI/4?(g={x:s.x,y:c},p={x:n.x+n.width,y:d}):m>0?(g={x:l,y:s.y+s.height},p={x:h,y:n.y}):(g={x:l,y:s.y},p={x:h,y:n.y+n.height});const x=2,b=p.x-g.x,S=p.y-g.y,T=Math.sqrt(b*b+S*S);if(T>x*2){const v=b/T,M=S/T;g={x:g.x+v*x,y:g.y+M*x}}const k=i.get(a.id);if(k){const v={x:l,y:c},M={x:h,y:d};g=Pp(g,v,M,k),p=Pp(p,v,M,k)}const _=`M ${g.x} ${g.y} L ${p.x} ${p.y}`,L=[g,{x:(g.x+p.x)/2,y:(g.y+p.y)/2},p];return{...a,path:_,points:L}})}function W1(e,t,r,i){const o=new Map(t.map(H=>[H.id,H])),a=new Map(t.flatMap(H=>H.group?[[H.id,H.group]]:[]));i?.forEach(H=>H.nodeIds?.forEach(G=>a.set(G,H.id)));const s=q1(e,t),n=r.direction||"TB",l=n==="TB"||n==="BT",c=16,h=24,d=32,u=10,f=12,g=10,p=12;let m=1/0,y=-1/0,x=-1/0;for(const H of t)m=Math.min(m,H.x),y=Math.max(y,H.x+H.width),x=Math.max(x,H.y+H.height);const b=[],S=[],T=new Map;for(const[H,G]of e.entries()){const K=o.get(G.from),tt=o.get(G.to);if(!K||!tt)continue;if(K.id===tt.id){const Mt=T.get(G.from)??0;T.set(G.from,Mt+1);const{path:Bt,points:Rt}=z1(K,Mt);S.push({...G,path:Bt,points:Rt});continue}const{fromSide:ot,toSide:vt}=CE(K,tt,l),Pt=(r.type==="layered"||r.type==="tree")&&(l?K.y+K.height/2>tt.y+tt.height/2:K.x+K.width/2>tt.x+tt.width/2);b.push({index:H,edge:G,fromNode:K,toNode:tt,fromSide:ot,toSide:vt,goesBackward:Pt})}const k=ht(b),_=new Map;b.forEach(H=>{const{fromNode:G,toNode:K,fromSide:tt,toSide:ot}=H,vt=tt==="top"||tt==="bottom",Ot=ot==="top"||ot==="bottom",Pt=G.x+G.width/2,Mt=G.y+G.height/2,Bt=K.x+K.width/2,Rt=K.y+K.height/2;let we=!1,qt=!1,ue;if(tt==="bottom"&&ot==="top"){const ke=G.y+G.height,Se=K.y;ue=(ke+Se)/2,ue=Math.max(ue,ke+h),ue=Math.min(ue,Se-h)}else if(tt==="top"&&ot==="bottom"){const ke=G.y,Se=K.y+K.height;ue=(ke+Se)/2,ue=Math.min(ue,ke-h),ue=Math.max(ue,Se+h)}else ue=(Mt+Rt)/2;let Ee;if(tt==="right"&&ot==="left"){const ke=G.x+G.width,Se=K.x;Ee=(ke+Se)/2}else if(tt==="left"&&ot==="right"){const ke=G.x,Se=K.x+K.width;Ee=(ke+Se)/2}else Ee=(Pt+Bt)/2;vt&&Ot&&Math.abs(Pt-Bt)>5?we=!0:!vt&&!Ot&&(qt=!0),_.set(H.edge.id,{needsHorizontalChannel:we,needsVerticalChannel:qt,horizontalY:ue,verticalX:Ee})});const L=b.filter(H=>_.get(H.edge.id)?.needsHorizontalChannel),v=b.filter(H=>_.get(H.edge.id)?.needsVerticalChannel);L.sort((H,G)=>{const K=_.get(H.edge.id),tt=_.get(G.edge.id);return!K||!tt?0:K.horizontalY-tt.horizontalY}),v.sort((H,G)=>{const K=_.get(H.edge.id),tt=_.get(G.edge.id);return!K||!tt?0:K.verticalX-tt.verticalX});const M=new Map,B=new Map,E=()=>{const H=[];L.forEach(G=>{const{fromNode:K,toNode:tt}=G,ot=_.get(G.edge.id);if(!ot)return;const vt=ot.horizontalY,Ot=Math.min(K.x,tt.x),Pt=Math.max(K.x+K.width,tt.x+tt.width),Mt=H.filter(Rt=>!(Pt<Rt.minX-10||Ot>Rt.maxX+10)&&(Rt.sourceId!==G.edge.from||Rt.targetId===G.edge.to));let Bt=vt;if(Mt.length>0){const Rt=Mt.map(qt=>qt.y).sort((qt,ue)=>qt-ue);let we=!1;for(let qt=0;qt<=Mt.length;qt++){const ue=vt+qt*c;if(!Rt.some(_t=>Math.abs(_t-ue)<c-1)){Bt=ue,we=!0;break}const ke=vt-qt*c;if(!Rt.some(_t=>Math.abs(_t-ke)<c-1)&&qt>0){Bt=ke,we=!0;break}}we||(Bt=vt+Mt.length*c)}H.push({minX:Ot,maxX:Pt,y:Bt,edgeId:G.edge.id,sourceId:G.edge.from,targetId:G.edge.to}),M.set(G.edge.id,Bt)})},O=()=>{const H=[];v.forEach(G=>{const{fromNode:K,toNode:tt}=G,ot=_.get(G.edge.id);if(!ot)return;const vt=ot.verticalX,Ot=Math.min(K.y,tt.y),Pt=Math.max(K.y+K.height,tt.y+tt.height),Mt=H.filter(Rt=>!(Pt<Rt.minY-10||Ot>Rt.maxY+10));let Bt=vt;if(Mt.length>0){const Rt=Mt.map(qt=>qt.x).sort((qt,ue)=>qt-ue);let we=!1;for(let qt=0;qt<=Mt.length;qt++){const ue=vt+qt*c;if(!Rt.some(_t=>Math.abs(_t-ue)<c-1)){Bt=ue,we=!0;break}const ke=vt-qt*c;if(!Rt.some(_t=>Math.abs(_t-ke)<c-1)&&qt>0){Bt=ke,we=!0;break}}we||(Bt=vt+Mt.length*c)}H.push({minY:Ot,maxY:Pt,x:Bt,edgeId:G.edge.id}),B.set(G.edge.id,Bt)})};E(),O();const $=b.filter(H=>H.goesBackward);$.sort((H,G)=>{const K=Math.abs(l?H.fromNode.y-H.toNode.y:H.fromNode.x-H.toNode.x);return Math.abs(l?G.fromNode.y-G.toNode.y:G.fromNode.x-G.toNode.x)-K});const I=new Map;$.forEach((H,G)=>{I.set(H.edge.id,G)});const F=ht(l?$.map(H=>({...H,fromSide:"left",toSide:"left"})):[]),R=new Map;if(l)for(const H of $){const G=Math.max(i?.length?0:32,H.edge.label?Sh(H.edge.label)/2+4:0),K=Math.min(H.fromNode.y,H.toNode.y),tt=Math.max(H.fromNode.y+H.fromNode.height,H.toNode.y+H.toNode.height),ot=Math.min(...[...t,...i??[]].filter(Pt=>Pt.y<tt&&Pt.y+Pt.height>K).map(Pt=>Pt.x));let vt=i?.length?m-h-G-((I.get(H.edge.id)??0)+1)*c:ot-h-G-c;const Ot=$.filter(Pt=>{const Mt=Math.min(Pt.fromNode.y,Pt.toNode.y),Bt=Math.max(Pt.fromNode.y+Pt.fromNode.height,Pt.toNode.y+Pt.toNode.height);return Mt<=tt&&Bt>=K}).flatMap(Pt=>R.has(Pt.edge.id)?[R.get(Pt.edge.id)]:[]).sort((Pt,Mt)=>Mt-Pt);for(const Pt of Ot)Math.abs(vt-Pt)<c&&(vt=Pt-c);R.set(H.edge.id,vt)}const q=new Map,D=new Map;for(const H of b){const G=`${H.edge.from}->${H.edge.to}`,K=D.get(G)??[];K.push(H),D.set(G,K)}for(const H of D.values())H.forEach((G,K)=>q.set(G.edge.id,{index:K,count:H.length}));const P=H=>{const G=(H.fromNode.x+H.fromNode.width/2+H.toNode.x+H.toNode.width/2)/2,K=Math.min(H.fromNode.y+H.fromNode.height,H.toNode.y+H.toNode.height),tt=Math.max(H.fromNode.y,H.toNode.y);return tt<=K?!1:t.some(ot=>ot.id!==H.fromNode.id&&ot.id!==H.toNode.id&&G>=ot.x-d&&G<=ot.x+ot.width+d&&ot.y<tt&&ot.y+ot.height>K)},Y=H=>{if(!H.edge.label)return!1;const G=Math.max(0,Math.max(H.fromNode.y,H.toNode.y)-Math.min(H.fromNode.y+H.fromNode.height,H.toNode.y+H.toNode.height)),K=di(H.edge.label,bn(H.edge.label,G));return K.lines>=3&&G<K.height+16},X=(H,G,K)=>Math.abs(H.x-G.x)<.001?H.x>K.left&&H.x<K.right&&Math.max(H.y,G.y)>K.top&&Math.min(H.y,G.y)<K.bottom:H.y>K.top&&H.y<K.bottom&&Math.max(H.x,G.x)>K.left&&Math.min(H.x,G.x)<K.right,z=(H,G)=>H.slice(1).some((K,tt)=>G.some(ot=>X(H[tt],K,ot))),U=(H,G)=>Math.abs(G.x-H.x)>=Math.abs(G.y-H.y)?{x:H.x+Math.sign(G.x-H.x)*d,y:H.y}:{x:H.x,y:H.y+Math.sign(G.y-H.y)*d},j=H=>H.slice(1).reduce((G,K,tt)=>G+Math.abs(K.x-H[tt].x)+Math.abs(K.y-H[tt].y),0),V=(H,G)=>{const K=(et,it)=>Math.abs(it.x-et.x)>=Math.abs(it.y-et.y)?`${Math.sign(it.x-et.x)},0`:`0,${Math.sign(it.y-et.y)}`,tt=new Set([a.get(H.fromNode.id),a.get(H.toNode.id)].filter(et=>et!==void 0)),ot=t.map(et=>{const it=et.id===H.fromNode.id||et.id===H.toNode.id?0:u;return{left:et.x-it,right:et.x+et.width+it,top:et.y-it,bottom:et.y+et.height+it}}),vt=(i??[]).filter(et=>!tt.has(et.id)&&et.width>0&&et.height>0).map(et=>({left:et.x-f,right:et.x+et.width+f,top:et.y-f,bottom:et.y+et.height+f})),Ot=(i??[]).map(ld),Pt=[...ot,...vt,...Ot],Mt=tn(G);if(!z(Mt,Pt))return Mt;const Bt=H.edge.label?di(H.edge.label):void 0,Rt=[...Ot,...t.map(et=>({left:et.x,right:et.x+et.width,top:et.y,bottom:et.y+et.height})),...(i??[]).filter(et=>!tt.has(et.id)&&et.width>0&&et.height>0).map(et=>({left:et.x,right:et.x+et.width,top:et.y,bottom:et.y+et.height}))],we=et=>{if(!Bt)return Number.POSITIVE_INFINITY;const it=[.5,.25,.75,.125,.875];return et.slice(1).reduce((ct,xt,Tt)=>{const st=et[Tt];return ct+it.filter(kt=>{const jt=st.x+(xt.x-st.x)*kt,re=st.y+(xt.y-st.y)*kt,Kt={left:jt-Bt.width/2-g,right:jt+Bt.width/2+g,top:re-Bt.height/2-g,bottom:re+Bt.height/2+g};return!Rt.some(xe=>Kt.left<xe.right&&Kt.right>xe.left&&Kt.top<xe.bottom&&Kt.bottom>xe.top)}).length},0)},qt=et=>we(et)>=3,ue=Mt[0],Ee=Mt[Mt.length-1],ke=K(ue,G[1]),Se=K(G[G.length-2],Ee),_t=U(ue,Mt[1]),Xt=U(Ee,Mt[Mt.length-2]),w=et=>[...new Set(et)].sort((it,ct)=>it-ct),J=w([...Pt.flatMap(({left:et,right:it})=>[et,it]),...Bt?Rt.flatMap(({left:et,right:it})=>[et-Bt.width/2-p,it+Bt.width/2+p]):[]]),dt=w([...Pt.flatMap(({top:et,bottom:it})=>[et,it]),...Bt?Rt.flatMap(({top:et,bottom:it})=>[et-Bt.height/2-p,it+Bt.height/2+p]):[]]),mt=[...J.map(et=>tn([ue,_t,{x:et,y:_t.y},{x:et,y:Xt.y},Xt,Ee])),...dt.map(et=>tn([ue,_t,{x:_t.x,y:et},{x:Xt.x,y:et},Xt,Ee]))].filter(et=>!z(et,Pt)&&K(et[0],et[1])===ke&&K(et[et.length-2],et[et.length-1])===Se),ft=mt.filter(qt);return(ft.length>0?ft:mt).toSorted((et,it)=>{const ct=xt=>j(xt)+xt.length*c;return ct(et)-ct(it)||JSON.stringify(et).localeCompare(JSON.stringify(it))})[0]??Mt},Q=b.map(H=>{const{index:G,edge:K,fromNode:tt,toNode:ot,fromSide:vt,toSide:Ot,goesBackward:Pt}=H,Mt=(_t,Xt)=>{switch(Xt){case"top":return{x:_t.x+_t.width/2,y:_t.y};case"bottom":return{x:_t.x+_t.width/2,y:_t.y+_t.height};case"left":return{x:_t.x,y:_t.y+_t.height/2};case"right":return{x:_t.x+_t.width,y:_t.y+_t.height/2}}},Bt=k.get(`${G}:from`)??Mt(tt,vt);let Rt=k.get(`${G}:to`)??Mt(ot,Ot);const we=s.get(K.id),qt=[Bt],ue=vt==="top"||vt==="bottom",Ee=Ot==="top"||Ot==="bottom",ke=(()=>{if(ue||Ee||we||k.has(`${G}:from`)||k.has(`${G}:to`))return null;const _t=st=>Math.min(st.height/4,["db","store","data_store"].includes(st.kind??"")?10:6),Xt=Math.max(tt.y+_t(tt),ot.y+_t(ot)),w=Math.min(tt.y+tt.height-_t(tt),ot.y+ot.height-_t(ot));if(Xt>w)return null;const J=Math.max(Xt,Math.min(w,(tt.y+tt.height/2+ot.y+ot.height/2)/2)),dt={x:vt==="right"?tt.x+tt.width:tt.x,y:J},mt={x:Ot==="left"?ot.x:ot.x+ot.width,y:J},ft=Math.min(dt.x,mt.x),N=Math.max(dt.x,mt.x),et=new Set([a.get(tt.id),a.get(ot.id)].filter(st=>st!==void 0)),it=t.some(st=>st.id!==tt.id&&st.id!==ot.id&&st.x<N&&st.x+st.width>ft&&J>st.y-u&&J<st.y+st.height+u),ct=(i??[]).some(st=>!et.has(st.id)&&st.x<N&&st.x+st.width>ft&&J>st.y-f&&J<st.y+st.height+f),xt=K.label?di(K.label).width:0,Tt=N-ft>=xt+g*2;return it||ct||!Tt?null:{source:dt,target:mt}})();if(tt.id===ot.id){const _t={x:tt.x+tt.width,y:tt.y+tt.height/2},Xt={x:tt.x+tt.width/2,y:tt.y+tt.height},w=_t.x+h+c+80,J=Xt.y+h+c;qt[0]=_t,qt.push({x:w,y:_t.y},{x:w,y:J},{x:Xt.x,y:J}),Rt=Xt}else if(t.length<=6&&K.dashed&&e.some(_t=>_t.id!==K.id&&_t.from===K.from&&_t.to===K.to)){const _t={x:tt.x+tt.width,y:tt.y+tt.height/2},Xt={x:ot.x+ot.width,y:ot.y+ot.height/2},w=Math.max(_t.x,Xt.x)+h+c;qt[0]=_t,qt.push({x:w,y:_t.y},{x:w,y:Xt.y}),Rt=Xt}else if(Pt){const _t=I.get(K.id)??0;if(l){const Xt=R.get(K.id),w=F.get(`${G}:from`)??{x:tt.x,y:tt.y+tt.height/2},J=F.get(`${G}:to`)??{x:ot.x,y:ot.y+ot.height/2};qt[0]=w,qt.push({x:Xt,y:w.y},{x:Xt,y:J.y}),Rt=J}else{const Xt=x+h+(_t+1)*c,w=d+_t*c,J=vt==="right"?Bt.x+w:Bt.x-w,dt=Ot==="left"?Rt.x-w:Rt.x+w;qt.push({x:J,y:Bt.y}),qt.push({x:J,y:Xt}),qt.push({x:dt,y:Xt}),qt.push({x:dt,y:Rt.y})}}else if(l&&ue&&Ee&&a.has(tt.id)&&a.has(ot.id)&&a.get(tt.id)!==a.get(ot.id)){const _t=K.label?Sh(K.label):0,Xt=new Set([a.get(tt.id),a.get(ot.id)].filter(ct=>ct!==void 0)),w=(i??[]).filter(ct=>Xt.has(ct.id)),J=Math.max(tt.x+tt.width,ot.x+ot.width,...w.map(ct=>ct.x+ct.width)),dt=Math.min(tt.y,ot.y),mt=Math.max(tt.y+tt.height,ot.y+ot.height),ft=(i??[]).some(ct=>!Xt.has(ct.id)&&ct.x>=J&&ct.y<mt&&ct.y+ct.height>dt),N=tt.x+tt.width/2,et=ot.x+ot.width/2;if((i?.length??0)>=3&&Math.abs(N-et)<12&&!P(H)&&!ft){const ct=Mt(tt,vt),xt=Mt(ot,Ot);if(qt[0]=ct,Math.abs(ct.x-xt.x)>=.5){const Tt=(ct.y+xt.y)/2;qt.push({x:ct.x,y:Tt},{x:xt.x,y:Tt})}Rt=xt}else if(ft){const ct={x:tt.x,y:tt.y+tt.height/2},xt={x:ot.x,y:ot.y+ot.height/2},st=Math.min(ct.x,xt.x,...w.map(kt=>kt.x))-h-_t/2-g;qt[0]=ct,qt.push({x:st,y:ct.y},{x:st,y:xt.y}),Rt=xt}else{const ct={x:tt.x+tt.width,y:tt.y+tt.height/2},xt={x:ot.x+ot.width,y:ot.y+ot.height/2},Tt=Math.max(y+h+d,ct.x+d,xt.x+d);qt[0]=ct,qt.push({x:Tt,y:ct.y},{x:Tt,y:xt.y}),Rt=xt}}else if(l&&ue&&Ee&&(P(H)||Y(H))){const _t=K.label?Sh(K.label):0,Xt={x:tt.x+tt.width,y:tt.y+tt.height/2},w={x:ot.x+ot.width,y:ot.y+ot.height/2},J=Math.max(y+h+_t/2+c,Xt.x+Math.max(_t+Qa,d),w.x+Math.max(_t+Qa,d));qt[0]=Xt,qt.push({x:J,y:Xt.y},{x:J,y:w.y}),Rt=w}else if(ue&&Ee){const _t=tt.x+tt.width/2,Xt=ot.x+ot.width/2,w=Math.abs(Bt.x-Rt.x)<1;if(Math.abs(_t-Xt)<5&&!we&&w){const J=(_t+Xt)/2;qt[0]={x:J,y:Bt.y},Rt={x:J,y:Rt.y}}else if(Math.abs(_t-Xt)<5&&!we){const J=(_t+Xt)/2;qt[0]={x:J,y:Bt.y},Rt={x:J,y:Rt.y}}else if(Math.abs(_t-Xt)<5){const J=Bt.y<=Rt.y?1:-1,dt=(_t+Xt)/2+J*Math.abs(we??0);qt[0]={x:dt,y:Bt.y},Rt={x:dt,y:Rt.y}}else{const J=M.get(K.id)??(Bt.y+Rt.y)/2,dt=vt==="bottom"?Math.max(Bt.y+d,J):Math.min(Bt.y-d,J),mt=Ot==="top"?Math.min(Rt.y-d,J):Math.max(Rt.y+d,J);Math.abs(dt-J)>2&&qt.push({x:Bt.x,y:dt}),qt.push({x:Bt.x,y:J}),qt.push({x:Rt.x,y:J}),Math.abs(mt-J)>2&&qt.push({x:Rt.x,y:mt})}}else if(!ue&&!Ee&&we){const _t=Bt.x<Rt.x,Xt=_t?Math.max(tt.y+tt.height,ot.y+ot.height)+h+Math.abs(we)/2+(K.dashed?28:0):Math.min(tt.y,ot.y)-h-Math.abs(we)/2-(K.dashed?28:0);if(_t){const w={x:tt.x+tt.width*.65,y:tt.y+tt.height},J={x:ot.x+ot.width*.35,y:ot.y+ot.height};qt[0]=w,qt.push({x:w.x,y:Xt},{x:J.x,y:Xt}),Rt=J}else{const w=Mt(tt,vt),J=Mt(ot,Ot),dt=vt==="right"?w.x+d:w.x-d,mt=Ot==="left"?J.x-d:J.x+d;qt[0]=w,qt.push({x:dt,y:w.y},{x:dt,y:Xt},{x:mt,y:Xt},{x:mt,y:J.y}),Rt=J}}else if(ke)qt[0]=ke.source,Rt=ke.target;else if(!ue&&!Ee){const _t=B.get(K.id)??(Bt.x+Rt.x)/2,Xt=vt==="right"?Math.max(Bt.x+d,_t):Math.min(Bt.x-d,_t),w=Ot==="left"?Math.min(Rt.x-d,_t):Math.max(Rt.x+d,_t);Math.abs(Xt-_t)>2&&qt.push({x:Xt,y:Bt.y}),qt.push({x:_t,y:Bt.y}),qt.push({x:_t,y:Rt.y}),Math.abs(w-_t)>2&&qt.push({x:w,y:Rt.y})}else if(ue){const _t=vt==="bottom"?Bt.y+d:Bt.y-d;Math.abs(_t-Rt.y)>5?(qt.push({x:Bt.x,y:_t}),qt.push({x:Rt.x,y:_t})):qt.push({x:Bt.x,y:Rt.y})}else{const _t=vt==="right"?Bt.x+d:Bt.x-d;Math.abs(_t-Rt.x)>5?(qt.push({x:_t,y:Bt.y}),qt.push({x:_t,y:Rt.y})):qt.push({x:Rt.x,y:Bt.y})}qt.push(Rt);const Se=V(H,qt);return{...K,path:Cn(Se),points:Se}}),rt=b.map((H,G)=>({info:H,route:Q[G]})).toSorted((H,G)=>+(H.info.fromNode.x<H.info.toNode.x)-+(G.info.fromNode.x<G.info.toNode.x)||H.info.fromNode.x-G.info.fromNode.x||H.info.fromNode.y-G.info.fromNode.y||H.info.toNode.x-G.info.toNode.x||H.info.toNode.y-G.info.toNode.y);for(const{info:H,route:G}of rt){const{fromNode:K,toNode:tt,fromSide:ot,toSide:vt}=H;if(l||!["left","right"].includes(ot)||!["left","right"].includes(vt)||(q.get(G.id)?.count??1)>1||!G.points||G.points.length<=2)continue;const Ot=K.x<tt.x,Pt=Ot?K.x+K.width:K.x,Mt=Ot?tt.x:tt.x+tt.width;if((Mt-Pt)*(Ot?1:-1)<=0)continue;const Bt=G.label?di(G.label):void 0,Rt=new Set([a.get(K.id),a.get(tt.id)]),we=[...t.map(it=>({node:it,clearance:it.id===K.id||it.id===tt.id?0:u})),...(i??[]).filter(it=>!Rt.has(it.id)).map(it=>({node:it,clearance:f}))].map(({node:it,clearance:ct})=>({left:it.x-ct,right:it.x+it.width+ct,top:it.y-ct,bottom:it.y+it.height+ct}));we.push(...(i??[]).map(ld));const qt=[...t.map(it=>({left:it.x,right:it.x+it.width,top:it.y,bottom:it.y+it.height})),...we.slice(t.length)],ue=[...S,...Q].filter(it=>it!==G).flatMap(it=>{const ct=it.label?di(it.label):void 0,xt=(it.points??[]).slice(1).map((st,kt)=>({start:it.points[kt],end:st})),Tt=ct&&xt.some(({start:st,end:kt})=>{if(st.y!==kt.y||Math.abs(kt.x-st.x)<ct.width+16||xt.some(Kt=>Math.abs(Kt.end.y-Kt.start.y)>Math.abs(kt.x-st.x)))return!1;const jt=(st.x+kt.x)/2,re={left:jt-ct.width/2-8,right:jt+ct.width/2+8,top:st.y-ct.height/2-8,bottom:st.y+ct.height/2+8};return!qt.some(Kt=>re.left<Kt.right&&re.right>Kt.left&&re.top<Kt.bottom&&re.bottom>Kt.top)&&![...S,...Q].some(Kt=>Kt!==it&&Kt!==G&&z(Kt.points??[],[re]))});return xt.map(({start:st,end:kt})=>{const jt=Math.abs(st.y-kt.y)<.001,re=ct&&(jt||!Tt)&&Math.hypot(kt.x-st.x,kt.y-st.y)>=(jt?ct.width:ct.height)+16,Kt=Math.max(c,re&&!jt?ct.width/2+2:0),xe=Math.max(c,re&&jt?ct.height/2+2:0);return{left:Math.min(st.x,kt.x)-Kt,right:Math.max(st.x,kt.x)+Kt,top:Math.min(st.y,kt.y)-xe,bottom:Math.max(st.y,kt.y)+xe}})}),Ee=[...we,...ue],ke=[...qt,...ue],Se=[],_t=it=>Math.min(it.height/4,["db","store","data_store"].includes(it.kind??"")?10:6),Xt=Math.max(K.y+_t(K),tt.y+_t(tt)),w=Math.min(K.y+K.height-_t(K),tt.y+tt.height-_t(tt));if(Xt<=w)for(const it of[(Xt+w)/2,Xt,w])Se.push([{x:Pt,y:it},{x:Mt,y:it}]);const J=it=>[it.y+it.height/2,it.y+_t(it),it.y+it.height-_t(it)],dt=Ot?1:-1;if(Math.abs(Mt-Pt)>=c*2){const it=[(Pt+Mt)/2,Pt+dt*d,Mt-dt*d,Pt+dt*c,Mt-dt*c].filter(ct=>(ct-Pt)*dt>=c&&(Mt-ct)*dt>=c);for(const ct of J(K))for(const xt of J(tt))for(const Tt of it)Se.push([{x:Pt,y:ct},{x:Tt,y:ct},{x:Tt,y:xt},{x:Mt,y:xt}])}for(const it of[!1,!0]){const ct={x:K.x+K.width/2,y:K.y+(it?K.height:0)},xt={x:tt.x+tt.width/2,y:tt.y+(it?tt.height:0)},Tt=Math.max(d,(Bt?.height??0)/2+g),st=it?Math.max(ct.y,xt.y)+Tt:Math.min(ct.y,xt.y)-Tt;Se.push([ct,{x:ct.x,y:st},{x:xt.x,y:st},xt])}const mt=(it,ct=!1)=>{if(!Bt)return!0;const xt=R1(it);return(ct?xt.filter(({horizontal:st})=>st).toSorted((st,kt)=>Math.abs(kt.end.x-kt.start.x)-Math.abs(st.end.x-st.start.x)).slice(0,1):xt).some(({start:st,end:kt})=>{const jt=st.y===kt.y?Bt.width:Bt.height;return Math.hypot(kt.x-st.x,kt.y-st.y)<jt+16?!1:(ct?[.5]:[.5,.25,.75]).some(re=>{const Kt=st.x+(kt.x-st.x)*re,xe=st.y+(kt.y-st.y)*re;return!ke.some(Pe=>Kt-Bt.width/2-8<Pe.right&&Kt+Bt.width/2+8>Pe.left&&xe-Bt.height/2-8<Pe.bottom&&xe+Bt.height/2+8>Pe.top)})})},ft=z(G.points,we),N=mt(G.points,!0),et=Se.map(tn).map(it=>({points:it,centeredLabel:mt(it,!0)})).filter(({points:it,centeredLabel:ct})=>(ft||it.length<G.points.length||it.length===G.points.length&&(ct&&!N||ct===N&&j(it)<j(G.points)))&&!z(it,Ee)&&mt(it)).toSorted((it,ct)=>it.points.length-ct.points.length||Number(ct.centeredLabel)-Number(it.centeredLabel)||j(it.points)-j(ct.points))[0]?.points;et&&(G.points=et,G.path=Cn(et))}return[...S,...Q];function ht(H){const G=new Map,K=ot=>{const vt=`${ot.node.id}:${ot.side}`;G.set(vt,[...G.get(vt)??[],ot])};for(const ot of H){const vt=ot.fromSide==="top"||ot.fromSide==="bottom",Ot=ot.toSide==="top"||ot.toSide==="bottom";K({key:`${ot.index}:from`,node:ot.fromNode,side:ot.fromSide,desired:vt?ot.toNode.x+ot.toNode.width/2:ot.toNode.y+ot.toNode.height/2,role:"from",edgeId:ot.edge.id}),K({key:`${ot.index}:to`,node:ot.toNode,side:ot.toSide,desired:Ot?ot.fromNode.x+ot.fromNode.width/2:ot.fromNode.y+ot.fromNode.height/2,role:"to",edgeId:ot.edge.id})}const tt=new Map;for(const ot of G.values()){const vt=new Set(ot.map(({role:w})=>w)),Ot=new Set(ot.map(w=>{const J=H.find(dt=>dt.index===Number(w.key.split(":")[0]));return w.role==="from"?J?.toNode.id:J?.fromNode.id}));if(!(ot.length>=2&&(vt.size>1||Ot.size>1)))continue;const Mt=ot.toSorted((w,J)=>w.desired-J.desired||w.role.localeCompare(J.role)||w.edgeId.localeCompare(J.edgeId)||w.key.localeCompare(J.key)),{node:Bt,side:Rt}=Mt[0],we=Rt==="top"||Rt==="bottom",qt=we?Bt.width:Bt.height,ue=we?Bt.x+Bt.width/2:Bt.y+Bt.height/2,Ee=Math.max(0,qt-Math.min(32,qt*.4)),ke=Mt.map(w=>{const J=H.find(mt=>mt.edge.id===w.edgeId)?.edge,dt=J?.label?di(J.label):void 0;return dt?we?dt.width:dt.height:0}),Se=vt.size===1?Math.max(Uo,...ke.slice(1).map((w,J)=>(w+ke[J])/2+g)):Uo,_t=Mt.length>1?Math.min(Se,Ee/(Mt.length-1)):0,Xt=ue-_t*(Mt.length-1)/2;Mt.forEach((w,J)=>{const dt=Xt+J*_t;tt.set(w.key,we?{x:dt,y:Rt==="top"?Bt.y:Bt.y+Bt.height}:{x:Rt==="left"?Bt.x:Bt.x+Bt.width,y:dt})})}return tt}}function xE(e,t,r){const i=new Map(t.map((u,f)=>[u.id,{node:u,index:f}])),o=new Map,a=[],s=(r??[]).map(ld),n=Math.max(...t.map(u=>u.x+u.width)),l=(e.length>=t.length*1.5?24:32)+Zo,c=u=>{const f=i.get(u.from),g=i.get(u.to);if(!f||!g||f.index===g.index)return!1;if(g.index!==f.index+1)return!0;const p=u.label?di(u.label,bn(u.label)):null,m=f.node.x+f.node.width/2;return!!(p&&p.height+16>g.node.y-(f.node.y+f.node.height))||s.some(y=>m>y.left&&m<y.right&&f.node.y+f.node.height<y.bottom&&g.node.y>y.top)},h=e.filter(c),d=(u,f,g)=>{const p=h.flatMap(x=>{const b=i.get(x.from),S=i.get(x.to);return!b||!S?[]:S.index>b.index!==g?[]:x.from===u.id?[{edge:x,opposite:S.index,role:"from"}]:x.to===u.id?[{edge:x,opposite:b.index,role:"to"}]:[]}).sort((x,b)=>x.opposite-b.opposite||x.role.localeCompare(b.role)||x.edge.id.localeCompare(b.edge.id)),m=p.findIndex(x=>x.edge.id===f.id),y=p.length>1?Math.min(Uo,u.height*.6/(p.length-1)):0;return u.y+u.height/2+(m-(p.length-1)/2)*y};return e.flatMap(u=>{const f=i.get(u.from),g=i.get(u.to);if(!f||!g)return[];const{node:p,index:m}=f,{node:y,index:x}=g,b=o.get(u.from)??0;o.set(u.from,b+1);const S=u.label?di(u.label,bn(u.label)):null,T=c(u);let k;if(u.from===u.to){const L=u.label?64:28,v={x:p.x+p.width/2,y:p.y},M={x:p.x+p.width,y:p.y+p.height/2},B=n+L,E=p.y-32-b*26;k=[v,{x:v.x,y:E},{x:B,y:E},{x:B,y:M.y},M]}else if(x===m+1&&!T)k=[{x:p.x+p.width/2,y:p.y+p.height},{x:y.x+y.width/2,y:y.y}];else{const L=x>m,v={x:L?p.x+p.width:p.x,y:d(p,u,L)},M={x:L?y.x+y.width:y.x,y:d(y,u,L)},B=Math.max(l,(S?.width??0)/2+10),E=Math.min(v.y,M.y),O=Math.max(v.y,M.y),$=t.filter(P=>P.id!==p.id&&P.id!==y.id&&P.y<O&&P.y+P.height>E),I=Math.max(p.x+p.width+l,y.x+y.width+l,...$.map(P=>P.x+P.width+(S?.width??0)/2+10),...s.filter(P=>P.top<O&&P.bottom>E).map(P=>P.right+B)),F=Math.min(p.x,y.x,...$.map(P=>P.x),...s.filter(P=>P.top<O&&P.bottom>E).map(P=>P.left))-B,R=(S?.width??0)/2,q=a.filter(P=>P.downward===L&&P.top<O&&P.bottom>E);let D=L?Math.max(I,...q.map(P=>P.x+P.halfWidth+R+Zo)):Math.min(F,...q.map(P=>P.x-P.halfWidth-R-Zo));if(!L){const P=a.filter(X=>!X.downward&&(X.from===u.to||X.to===u.from)).toSorted((X,z)=>z.x-X.x),Y=X=>{if(q.length||Math.min(v.x,M.x)-X<Uo+Zo||O-E<(S?.height??0)+Uo)return!1;const z=(G,K)=>({left:Math.min(G.x,K.x),right:Math.max(G.x,K.x),top:Math.min(G.y,K.y),bottom:Math.max(G.y,K.y)}),U=(G,K,tt)=>G.left<K.right+tt&&G.right>K.left-tt&&G.top<K.bottom+tt&&G.bottom>K.top-tt,j=(G,K,tt)=>[z(K,{x:G,y:K.y}),z({x:G,y:K.y},{x:G,y:tt.y}),z({x:G,y:tt.y},tt)],V=t.map(G=>({...z(G,{x:G.x+G.width,y:G.y+G.height}),id:G.id})),Q=(r??[]).map(G=>z(G,{x:G.x+G.width,y:G.y+G.height})),rt=j(X,v,M),ht=[...V.filter(G=>G.id!==p.id&&G.id!==y.id),...Q,...s];if(rt.some(G=>ht.some(K=>U(G,K,10))))return!1;const H={left:X-R,right:X+R,top:(E+O-(S?.height??0))/2,bottom:(E+O+(S?.height??0))/2};return[...V,...Q,...s].some(G=>U(H,G,8))||H.right+10>Math.min(...t.map(G=>G.x+G.width/2))?!1:a.every(G=>{const K=j(G.x,G.start,G.end),tt={left:G.x-G.halfWidth,right:G.x+G.halfWidth,top:(G.top+G.bottom)/2-G.halfHeight,bottom:(G.top+G.bottom)/2+G.halfHeight};return rt.every(ot=>K.every(vt=>!U(ot,vt,10)))&&(!S||K.every(ot=>!U(H,ot,10)))&&(!G.halfWidth||rt.every(ot=>!U(tt,ot,10)))&&(!S||!G.halfWidth||!U(H,tt,6))})};for(const X of P)if(Math.abs(D-X.x)<Uo){const z=X.x+Uo;D=Y(z)?z:X.x-Uo}}a.push({x:D,top:E,bottom:O,halfWidth:R,downward:L,from:u.from,to:u.to,start:v,end:M,halfHeight:(S?.height??0)/2}),k=[v,{x:v.x+(L?l:-l),y:v.y},{x:D,y:v.y},{x:D,y:M.y},{x:M.x+(L?l:-l),y:M.y},M]}const _=tn(k);return[{...u,path:bE(_),points:_}]})}function bE(e,t=Zo){if(e.length===0)return"";const r=[`M ${e[0].x} ${e[0].y}`];let i=e[0],o=!1;const a=s=>{o?Math.abs(s.y-i.y)<.001?r.push(`H ${s.x}`):r.push(`V ${s.y}`):(r.push(`L ${s.x} ${s.y}`),o=!0),i=s};for(let s=1;s<e.length-1;s+=1){const n=e[s-1],l=e[s],c=e[s+1],h=Math.hypot(l.x-n.x,l.y-n.y),d=Math.hypot(c.x-l.x,c.y-l.y),u=Math.min(t,h/2,d/2),f={x:l.x-(l.x-n.x)/h*u,y:l.y-(l.y-n.y)/h*u},g={x:l.x+(c.x-l.x)/d*u,y:l.y+(c.y-l.y)/d*u};a(f),r.push(`Q ${l.x} ${l.y} ${g.x} ${g.y}`),i=g}return a(e[e.length-1]),r.join(" ")}function tn(e){const t=[],r=(i,o)=>Math.abs(i-o)<.001;for(const i of e){const o=t[t.length-1];if(!(o&&r(o.x,i.x)&&r(o.y,i.y))){for(;t.length>=2;){const a=t[t.length-2],s=t[t.length-1];if(!(r(a.x,s.x)&&r(s.x,i.x)||r(a.y,s.y)&&r(s.y,i.y)))break;t.pop()}t.push(i)}}return t}function CE(e,t,r){const i=e.x+e.width/2,o=e.y+e.height/2,a=t.x+t.width/2,s=t.y+t.height/2,n=a-i,l=s-o;return r?e.y+e.height<=t.y?{fromSide:"bottom",toSide:"top"}:t.y+t.height<=e.y?{fromSide:"top",toSide:"bottom"}:n>0?{fromSide:"right",toSide:"left"}:{fromSide:"left",toSide:"right"}:Math.abs(n)>10?n>0?{fromSide:"right",toSide:"left"}:{fromSide:"left",toSide:"right"}:l>0?{fromSide:"bottom",toSide:"top"}:{fromSide:"top",toSide:"bottom"}}function z1(e,t=0){const r=e.y,i=Math.max(Math.min(e.width,e.height)*.4,28),o=t*12,a=r-i-o,s=e.x+e.width+i+o,n={x:e.x+e.width/2,y:r},l={x:e.x+e.width,y:e.y+e.height/2},c=[n,{x:n.x,y:a},{x:s,y:a},{x:s,y:l.y},l];return{path:Cn(c),points:c}}function wE(e,t){const r=new Map(t.map(i=>[i.id,i]));return e.map(i=>{const o=Array.isArray(i.nodeIds)?[...i.nodeIds]:[];t.forEach(p=>{p.group===i.id&&!o.includes(p.id)&&o.push(p.id)});const a=o.map(p=>r.get(p)).filter(Boolean);if(a.length===0)return{...i,x:0,y:0,width:0,height:0};const s=Math.min(...a.map(p=>p.x)),n=Math.min(...a.map(p=>p.y)),l=Math.max(...a.map(p=>p.x+p.width)),c=Math.max(...a.map(p=>p.y+p.height)),h=30,d=Sa.headerHeight,u=30,f=Math.max(l-s+h*2,Iu(i.label)),g=(s+l-f)/2;return{...i,x:g,y:n-d,width:f,height:c-n+d+u}})}function kE(e,t,r){if(e.length===0)return{minX:0,minY:0,maxX:0,maxY:0,width:0,height:0};let i=Math.min(...e.map(n=>n.x)),o=Math.min(...e.map(n=>n.y)),a=Math.max(...e.map(n=>n.x+n.width)),s=Math.max(...e.map(n=>n.y+n.height));if(t&&t.length>0&&(i=Math.min(i,...t.map(n=>n.x)),o=Math.min(o,...t.map(n=>n.y)),a=Math.max(a,...t.map(n=>n.x+n.width)),s=Math.max(s,...t.map(n=>n.y+n.height))),r&&r.length>0){for(const n of r)if(n.points)for(const l of n.points)i=Math.min(i,l.x),o=Math.min(o,l.y),a=Math.max(a,l.x),s=Math.max(s,l.y)}return{minX:i,minY:o,maxX:a,maxY:s,width:a-i,height:s-o}}var SE=new Set(["$$slots","$$events","$$legacy","children"]),vE=pi('<path d="M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,187a113.4,113.4,0,0,1-20.39-35h40.82a116.94,116.94,0,0,1-10,20.77A108.61,108.61,0,0,1,128,207Zm-26.49-59a135.42,135.42,0,0,1,0-40h53a135.42,135.42,0,0,1,0,40ZM44,128a83.49,83.49,0,0,1,2.43-20H77.25a160.63,160.63,0,0,0,0,40H46.43A83.49,83.49,0,0,1,44,128Zm84-79a113.4,113.4,0,0,1,20.39,35H107.59a116.94,116.94,0,0,1,10-20.77A108.61,108.61,0,0,1,128,49Zm50.73,59h30.82a83.52,83.52,0,0,1,0,40H178.75a160.63,160.63,0,0,0,0-40Zm20.77-24H173.71a140.82,140.82,0,0,0-15.5-34.36A84.51,84.51,0,0,1,199.52,84ZM97.79,49.64A140.82,140.82,0,0,0,82.29,84H56.48A84.51,84.51,0,0,1,97.79,49.64ZM56.48,172H82.29a140.82,140.82,0,0,0,15.5,34.36A84.51,84.51,0,0,1,56.48,172Zm101.73,34.36A140.82,140.82,0,0,0,173.71,172h25.81A84.51,84.51,0,0,1,158.21,206.36Z"></path>'),ME=pi('<path d="M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z" opacity="0.2"></path><path d="M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"></path>',1),TE=pi('<path d="M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm78.36,64H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM216,128a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM128,43a115.27,115.27,0,0,1,26,45H102A115.11,115.11,0,0,1,128,43ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48Zm50.35,61.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"></path>'),BE=pi('<path d="M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm81.57,64H169.19a132.58,132.58,0,0,0-25.73-50.67A90.29,90.29,0,0,1,209.57,90ZM218,128a89.7,89.7,0,0,1-3.83,26H171.81a155.43,155.43,0,0,0,0-52h42.36A89.7,89.7,0,0,1,218,128Zm-90,87.83a110,110,0,0,1-15.19-19.45A124.24,124.24,0,0,1,99.35,166h57.3a124.24,124.24,0,0,1-13.46,30.38A110,110,0,0,1,128,215.83ZM96.45,154a139.18,139.18,0,0,1,0-52h63.1a139.18,139.18,0,0,1,0,52ZM38,128a89.7,89.7,0,0,1,3.83-26H84.19a155.43,155.43,0,0,0,0,52H41.83A89.7,89.7,0,0,1,38,128Zm90-87.83a110,110,0,0,1,15.19,19.45A124.24,124.24,0,0,1,156.65,90H99.35a124.24,124.24,0,0,1,13.46-30.38A110,110,0,0,1,128,40.17Zm-15.46-.84A132.58,132.58,0,0,0,86.81,90H46.43A90.29,90.29,0,0,1,112.54,39.33ZM46.43,166H86.81a132.58,132.58,0,0,0,25.73,50.67A90.29,90.29,0,0,1,46.43,166Zm97,50.67A132.58,132.58,0,0,0,169.19,166h40.38A90.29,90.29,0,0,1,143.46,216.67Z"></path>'),_E=pi('<path d="M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"></path>'),LE=pi('<path d="M128,28h0A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,190.61c-6.33-6.09-23-24.41-31.27-54.61h62.54C151,194.2,134.33,212.52,128,218.61ZM94.82,156a140.42,140.42,0,0,1,0-56h66.36a140.42,140.42,0,0,1,0,56ZM128,37.39c6.33,6.09,23,24.41,31.27,54.61H96.73C105,61.8,121.67,43.48,128,37.39ZM169.41,100h46.23a92.09,92.09,0,0,1,0,56H169.41a152.65,152.65,0,0,0,0-56Zm43.25-8h-45a129.39,129.39,0,0,0-29.19-55.4A92.25,92.25,0,0,1,212.66,92ZM117.54,36.6A129.39,129.39,0,0,0,88.35,92h-45A92.25,92.25,0,0,1,117.54,36.6ZM40.36,100H86.59a152.65,152.65,0,0,0,0,56H40.36a92.09,92.09,0,0,1,0-56Zm3,64h45a129.39,129.39,0,0,0,29.19,55.4A92.25,92.25,0,0,1,43.34,164Zm95.12,55.4A129.39,129.39,0,0,0,167.65,164h45A92.25,92.25,0,0,1,138.46,219.4Z"></path>'),AE=pi('<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>');function H1(e,t){if(new.target)return Oo({component:H1,...e});No(t,!0);const r=NC();let i=He(t,"children",7),o=hC(t,SE),a=Dt(()=>t.weight??r.weight??"regular"),s=Dt(()=>t.color??r.color??"currentColor"),n=Dt(()=>t.size??r.size??"1em"),l=Dt(()=>t.mirrored??r.mirrored??!1);function c(k){let{weight:_,color:L,size:v,mirrored:M,...B}=k;return B}var h={get children(){return i()},set children(k){i(k),_e()},$set:Do,$on:(k,_)=>Ro(t,k,_)},d=AE();qp(d,(k,_)=>({xmlns:"http://www.w3.org/2000/svg",role:"img",width:A(n),height:A(n),fill:A(s),transform:A(l)?"scale(-1, 1)":void 0,viewBox:"0 0 256 256",...k,..._}),[()=>c(r),()=>c(o)]);var u=qe(d);{var f=k=>{var _=Ko(),L=ui(_);il(L,i),ge(k,_)};yr(u,k=>{i()&&k(f)})}var g=We(u,2);{var p=k=>{var _=vE();ge(k,_)},m=k=>{var _=ME();en(),ge(k,_)},y=k=>{var _=TE();ge(k,_)},x=k=>{var _=BE();ge(k,_)},b=k=>{var _=_E();ge(k,_)},S=k=>{var _=LE();ge(k,_)},T=k=>{var _=rl();_.nodeValue=(console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'),""),ge(k,_)};yr(g,k=>{A(a)==="bold"?k(p):A(a)==="duotone"?k(m,1):A(a)==="fill"?k(y,2):A(a)==="light"?k(x,3):A(a)==="regular"?k(b,4):A(a)==="thin"?k(S,5):k(T,-1)})}return $e(d),ge(e,d),qo(h)}const Ir=(e,t)=>({name:e,component:t}),cd=Ir("cube",CC),FE={actor:Ir("user",$C),data:Ir("database",Xu),data_store:Ir("hard-drive",FC),db:Ir("database",Xu),decision:Ir("code-branch",Yu),end:Ir("stop",WC),event:Ir("clock",AC),external:Ir("globe",H1),file:Ir("file-lines",LC),interface:Ir("plug",_C),milestone:Ir("flag",BC),module:cd,node:cd,package:Ir("box",TC),process:Ir("gear",MC),queue:Ir("message",vC),router:Ir("code-branch",Yu),server:Ir("server",Hu),service:Ir("server",Hu),start:Ir("play",qC),state:Ir("circle",SC),switch:Ir("right-left",kC),ui_component:Ir("desktop",wC)};function $E(e){return e&&FE[e]||cd}var Op=ar("<wbr/>"),EE=ar('<span class="semantic-filename-unit svelte-u4m0nr"> </span><!>',1),PE=ar("<br/>"),IE=ar(" <!>",1),OE=ar('<div class="node-kind-label svelte-u4m0nr"> </div>'),DE=ar('<div class="node-content svelte-u4m0nr"><div class="node-row svelte-u4m0nr"><span class="node-icon svelte-u4m0nr" data-node-icon="" aria-hidden="true"><!></span> <div class="node-copy svelte-u4m0nr"><div class="node-label svelte-u4m0nr"><!></div> <!></div></div></div>');function Y1(e,t){if(new.target)return Oo({component:Y1,...e});No(t,!0);let r=He(t,"node",7),i=He(t,"editable",7,!1),o=He(t,"dimmed",7,!1),a=He(t,"highlighted",7,!1),s=He(t,"styleConfig",7,Gi),n=He(t,"onMove",7),l=He(t,"onHover",7),c=He(t,"onBindingClick",7),h=ce(!1),d=ce(0),u=ce(0),f=ce(void 0);function g(D,P){const Y=A(f)?.closest("svg");if(Y){const X=Y.getScreenCTM();if(X){const z=X.inverse();return{x:z.a*D+z.c*P+z.e,y:z.b*D+z.d*P+z.f}}}return{x:D,y:P}}function p(D){if(!i())return;gt(h,!0);const P=g(D.clientX,D.clientY);gt(d,P.x-r().x),gt(u,P.y-r().y)}function m(D){if(!A(h)||!i())return;const P=g(D.clientX,D.clientY),Y=P.x-A(d),X=P.y-A(u);n()?.(Y,X)}function y(){gt(h,!1)}function x(){return r().binding?r().binding:r().bindings&&r().bindings.length>0?r().bindings[0]:null}let b=Dt(()=>!!x()),S=Dt(()=>s()===Gi),T=Dt(()=>$E(r().kind)),k=Dt(()=>A(T).component),_=Dt(()=>A(S)?10:s().paddingX),L=Dt(()=>A(S)?7:s().paddingY),v=Dt(()=>A(S)?2:s().gap),M=Dt(()=>A(S)?11:s().kindFontSize),B=Dt(()=>["db","store","data_store"].includes(r().kind??"")),E=Dt(()=>_u(r().label)),O=Dt(()=>{const D=x();if(D)return je.diagram_node_openBinding_ariaLabel({label:r().label,type:D.type})});function $(D){const P=x();P&&c()&&c()(D,P)}let I=Dt(()=>{const D=["diagram-node-html"];return r().semanticStyle&&D.push(`node-${r().semanticStyle}`),r().kind&&D.push(`node-kind-${r().kind}`),A(b)&&D.push("node-clickable"),i()&&D.push("node-editable"),o()&&D.push("node-dimmed"),a()&&D.push("node-state-highlighted"),D.join(" ")});var F={get node(){return r()},set node(D){r(D),_e()},get editable(){return i()},set editable(D=!1){i(D),_e()},get dimmed(){return o()},set dimmed(D=!1){o(D),_e()},get highlighted(){return a()},set highlighted(D=!1){a(D),_e()},get styleConfig(){return s()},set styleConfig(D=Gi){s(D),_e()},get onMove(){return n()},set onMove(D){n(D),_e()},get onHover(){return l()},set onHover(D){l(D),_e()},get onBindingClick(){return c()},set onBindingClick(D){c(D),_e()},$set:Do,$on:(D,P)=>Ro(t,D,P)},R=Ko();ml("mousemove",Wu,m),ml("mouseup",Wu,y);var q=ui(R);return XC(q,()=>A(b)?"button":"div",!1,(D,P)=>{no(D,Ot=>gt(f,Ot,!0),()=>A(f));var Y=()=>l()?.(r().id),X=()=>l()?.(null),z=()=>l()?.(r().id),U=()=>l()?.(null);qp(D,()=>({type:A(b)?"button":void 0,role:A(b)?"button":void 0,class:A(I),"data-semantic-style":r().semanticStyle??"default","data-default-style":A(S),"data-state-highlighted":a(),"data-dimmed":o(),"data-store-node":A(B),"aria-label":A(O),style:`
333
333
  --label-font-size: ${s().labelFontSize??""}px;
334
334
  --label-line-height: ${s().labelLineHeight??""};
335
335
  --kind-font-size: ${A(M)??""}px;
@@ -337,8 +337,8 @@ ${at}`}function z(at){return at.replace(/&lt;/g,"<").replace(/&gt;/g,">").replac
337
337
  --padding-x: ${A(_)??""}px;
338
338
  --padding-y: ${A(L)??""}px;
339
339
  --gap: ${A(v)??""}px;
340
- `,onmousedown:p,onclick:$,onmouseenter:Y,onmouseleave:X,onfocus:z,onblur:U}),void 0,void 0,void 0,"svelte-u4m0nr");var j=DE(),V=qe(j),Q=qe(V),rt=qe(Q);fa(rt,()=>A(k),(Ot,Pt)=>{Pt(Ot,{size:14,weight:"regular",get"data-icon"(){return A(T).name},"data-weight":"regular","aria-hidden":"true"})}),$e(Q);var ht=We(Q,2),H=qe(ht),G=qe(H);{var K=Ot=>{var Pt=Ko(),Mt=ui(Pt);ya(Mt,17,()=>A(E),Hu,(Bt,Rt,we)=>{var qt=EE(),ue=ui(qt),Ee=Tr(ue,!0),ke=We(ue);{var Se=_t=>{var Xt=Op();ge(_t,Xt)};yr(ke,_t=>{we<A(E).length-1&&_t(Se)})}cr(()=>br(Ee,A(Rt))),ge(Bt,qt)}),ge(Ot,Pt)},tt=Ot=>{var Pt=Ko(),Mt=ui(Pt);ya(Mt,17,()=>pc(r().label),Hu,(Bt,Rt)=>{en();var we=IE(),qt=ui(we,!0),ue=We(qt);{var Ee=Se=>{var _t=PE();ge(Se,_t)},ke=Se=>{var _t=Op();ge(Se,_t)};yr(ue,Se=>{A(Rt).hardBreak?Se(Ee):A(Rt).breakAfter&&Se(ke,1)})}cr(()=>br(qt,A(Rt).text)),ge(Bt,we)}),ge(Ot,Pt)};yr(G,Ot=>{A(E)?Ot(K):Ot(tt,-1)})}$e(H),bC(H,(Ot,Pt)=>jC?.(Ot,Pt),()=>r().label);var ot=We(H,2);{var vt=Ot=>{var Pt=OE(),Mt=Tr(Pt,!0);cr(()=>br(Mt,r().kind)),ge(Ot,Pt)};yr(ot,Ot=>{r().kind&&Ot(vt)})}$e(ht),$e(V),$e(j),ge(P,j)}),ge(e,R),qo(F)}var RE=pi('<circle class="edge-origin" r="1.5" aria-hidden="true"></circle>'),NE=pi('<g><defs><mask maskUnits="userSpaceOnUse" maskContentUnits="userSpaceOnUse" style="mask-type: alpha;"><path class="edge-reveal-mask-path" pathLength="1" fill="none" stroke="white" stroke-linecap="round" stroke-linejoin="round"></path></mask></defs><g><path class="edge-path" vector-effect="non-scaling-stroke"></path><!></g></g>');function X1(e,t){if(new.target)return Oo({component:X1,...e});No(t,!0);let r=He(t,"edge",7),i=He(t,"dimmed",7,!1),o=He(t,"highlighted",7,!1),a=He(t,"markerScope",7,""),s=He(t,"terminalGap",7,0),n=He(t,"motionDelay",7,0),l=He(t,"onmotionchange",7),c=ce(""),h=ce(1),d=[],u="",f,g="",p,m=Dt(()=>`edge-reveal-${a()}-${r().id}`),y=Dt(()=>{A(c);const z=[...r().points??[],...d],U=Math.max(16,s()*3),j=z.map(G=>G.x),V=z.map(G=>G.y),Q=j.length>0?Math.min(...j):0,rt=V.length>0?Math.min(...V):0,ht=j.length>0?Math.max(...j):1,H=V.length>0?Math.max(...V):1;return{x:Q-U,y:rt-U,width:Math.max(1,ht-Q)+U*2,height:Math.max(1,H-rt)+U*2}});function x(z,U){if(z.length<2||U<=0)return z;const j=z.map(ht=>({...ht})),V=j.at(-1),Q=j.at(-2),rt=Math.hypot(V.x-Q.x,V.y-Q.y);return rt<=U?z:(V.x-=(V.x-Q.x)/rt*U,V.y-=(V.y-Q.y)/rt*U,j)}function b(z){pl(()=>l()?.(r().id,z))}function S(z){return p?.ownerSVGElement?.querySelector(`[data-node-id="${CSS.escape(z)}"]`)}function T(z){if(!z)return null;const U=getComputedStyle(z),j=(V,Q)=>{const rt=Number.parseFloat(U.getPropertyValue(V));return Number.isFinite(rt)?rt:Q};return{x:j("x",z.x.baseVal.value),y:j("y",z.y.baseVal.value),width:j("width",z.width.baseVal.value),height:j("height",z.height.baseVal.value)}}function k(z,U,j=0){if(!U)return z;const V=U.x+U.width/2,Q=U.y+U.height/2,rt=U.width/2,ht=U.height/2,H=z.x-V,G=z.y-Q;if(Math.hypot(H,G)<.001)return z;const tt=Math.abs(H)<.001?1/0:rt/Math.abs(H),ot=Math.abs(G)<.001?1/0:ht/Math.abs(G);return tt<=ot?{x:V+Math.sign(H)*(rt+j),y:Q+G*tt}:{x:V+H*ot,y:Q+Math.sign(G)*(ht+j)}}function _(z,U,j){const V=1-j;return 3*V*V*j*z+3*V*j*j*U+j**3}function L(z){let U=0,j=1,V=z;for(let Q=0;Q<12;Q+=1)_(.16,.3,V)<z?U=V:j=V,V=(U+j)/2;return _(1,1,V)}function v(z,U){if(z.length<2)return Array.from({length:U},()=>z[0]??{x:0,y:0});const j=z.slice(1).map((Q,rt)=>Math.hypot(Q.x-z[rt].x,Q.y-z[rt].y)),V=j.reduce((Q,rt)=>Q+rt,0);return Array.from({length:U},(Q,rt)=>{let ht=V*rt/(U-1),H=0;for(;H<j.length-1&&ht>j[H];)ht-=j[H],H+=1;const G=z[H],K=z[H+1],tt=j[H]?ht/j[H]:0;return{x:G.x+(K.x-G.x)*tt,y:G.y+(K.y-G.y)*tt}})}Bo(()=>{const z=x(r().points??[],s()),U=s()>0?Cn(z):r().path;if(rn()||u===U&&f===r()||d.length<2||z.length<2){gt(c,U,!0),d=z,u=U,f=r(),g=r().id,gt(h,1),b(!1);return}const V=v(d,24),Q=v(z,24),rt=g===r().id,ht=d[0],H=d[d.length-1],G=z[0],K=z[z.length-1],tt=S(r().from),ot=S(r().to),vt=rt&&Math.abs(G.x-ht.x-(K.x-H.x))<1&&Math.abs(G.y-ht.y-(K.y-H.y))<1;u=U,f=r(),g=r().id;let Ot=0,Pt;gt(h,0),b(!0);const Mt=we=>{const ue=Math.max(0,Math.min(1,(we-Bt)/220)),Ee=L(ue),ke=V.map((Se,_t)=>({x:Se.x+(Q[_t].x-Se.x)*Ee,y:Se.y+(Q[_t].y-Se.y)*Ee}));vt&&(ke[0]=z[0],ke[ke.length-1]=z[z.length-1]),ke[0]=k(ke[0],T(tt)),ke[ke.length-1]=k(ke[ke.length-1],T(ot),s()),d=ke,gt(h,ue,!0),gt(c,Cn(ke),!0),ue<1?Ot=requestAnimationFrame(Mt):(gt(c,U,!0),d=z,gt(h,1),b(!1))};let Bt;const Rt=()=>{Bt=performance.now(),Ot=requestAnimationFrame(Mt)};return n()>0?Pt=window.setTimeout(Rt,n()):Rt(),()=>{Pt!==void 0&&window.clearTimeout(Pt),cancelAnimationFrame(Ot),b(!1)}});let M=Dt(()=>{const z=["diagram-edge"];return r().semanticStyle&&z.push(`edge-${r().semanticStyle}`),r().animated&&z.push("edge-animated"),r().dashed&&z.push("edge-dashed"),i()&&z.push("edge-dimmed"),o()&&z.push("edge-state-highlighted"),z.join(" ")});const B=new Set(["danger","success","warning","muted","inactive","highlighted","active"]);let E=Dt(()=>a()?`-${a()}`:""),O=Dt(()=>r().semanticStyle&&B.has(r().semanticStyle)?`url(#arrowhead-${r().semanticStyle}${A(E)})`:`url(#arrowhead${A(E)})`);var $={get edge(){return r()},set edge(z){r(z),_e()},get dimmed(){return i()},set dimmed(z=!1){i(z),_e()},get highlighted(){return o()},set highlighted(z=!1){o(z),_e()},get markerScope(){return a()},set markerScope(z=""){a(z),_e()},get terminalGap(){return s()},set terminalGap(z=0){s(z),_e()},get motionDelay(){return n()},set motionDelay(z=0){n(z),_e()},get onmotionchange(){return l()},set onmotionchange(z){l(z),_e()},$set:Do,$on:(z,U)=>Ro(t,z,U)},I=NE(),F=qe(I),R=qe(F),q=Tr(R);$e(F);var D=We(F),P=qe(D),Y=We(P);{var X=z=>{var U=RE();cr(()=>{fe(U,"cx",r().points[0].x),fe(U,"cy",r().points[0].y)}),ge(z,U)};yr(Y,z=>{(r().animated||r().dashed)&&r().points?.[0]&&z(X)})}return $e(D),$e(I),no(I,z=>p=z,()=>p),cr(z=>{co(I,0,Wp(A(M))),fe(I,"data-edge-id",r().id),fe(I,"data-edge-from",r().from),fe(I,"data-edge-to",r().to),fe(I,"data-edge-motion-progress",A(h)),fe(R,"id",A(m)),fe(R,"x",A(y).x),fe(R,"y",A(y).y),fe(R,"width",A(y).width),fe(R,"height",A(y).height),fe(q,"d",A(c)),fe(q,"stroke-width",z),fe(D,"mask",`url(#${A(m)})`),fe(P,"d",A(c)),fe(P,"marker-end",A(O))},[()=>Math.max(12,s()*3)]),ge(e,I),qo($)}var qE=pi('<g><rect class="group-bg"></rect><text text-anchor="middle" dominant-baseline="middle" class="group-label"> </text></g>');function j1(e,t){if(new.target)return Oo({component:j1,...e});No(t,!0);let r=He(t,"group",7),i=He(t,"dimmed",7,!1),o=He(t,"onHover",7),a=Dt(()=>{const f=["diagram-group"];return r().semanticStyle&&f.push(`group-${r().semanticStyle}`),i()&&f.push("group-dimmed"),f.join(" ")});function s(){o()?.(r().id)}function n(){o()?.(null)}var l={get group(){return r()},set group(f){r(f),_e()},get dimmed(){return i()},set dimmed(f=!1){i(f),_e()},get onHover(){return o()},set onHover(f){o(f),_e()},$set:Do,$on:(f,g)=>Ro(t,f,g)},c=qE(),h=qe(c),d=We(h),u=Tr(d,!0);return $e(c),cr(()=>{co(c,0,Wp(A(a))),fe(c,"data-group-id",r().id),fe(h,"x",r().x),fe(h,"y",r().y),fe(h,"width",r().width),fe(h,"height",r().height),fe(d,"x",r().x+r().width/2),fe(d,"y",r().y+Sa.centerY),br(u,r().label)}),ml("mouseenter",c,s),ml("mouseleave",c,n),ge(e,c),qo(l)}var WE=ar('<div class="narrative-title svelte-1v8paz2"> </div>'),zE=ar('<div class="narrative-text svelte-1v8paz2"> </div>'),HE=ar('<div class="narrative svelte-1v8paz2"><!> <!></div>'),YE=ar('<div class="text-xs font-medium mb-0.5"> </div>'),XE=ar('<div class="text-ui text-subtle leading-snug"> </div>'),jE=ar('<div class="p-2.5"><!> <!></div>'),GE=ar("<!> <!>",1),UE=ar('<div class="navigation-buttons svelte-1v8paz2"><!> <!></div>'),VE=ar('<div class="diagram-controls svelte-1v8paz2"><div class="controls-inner svelte-1v8paz2"><div class="narrative-region svelte-1v8paz2" aria-live="polite" aria-atomic="true"><!></div> <div class="state-navigation svelte-1v8paz2" role="group"><div class="stepper svelte-1v8paz2"></div> <span class="step-counter svelte-1v8paz2"> </span> <!></div></div></div>');function G1(e,t){if(new.target)return Oo({component:G1,...e});No(t,!0);let r=He(t,"states",7),i=He(t,"currentStateId",7),o=He(t,"onStateChange",7);function a($){return $?typeof $=="string"?{text:$}:$:null}let s=Dt(()=>i()?r().findIndex($=>$.id===i()):-1),n=Dt(()=>A(s)>=0?r()[A(s)]:null),l=ce(-1),c=Dt(()=>A(l)<A(s)?"left":"right"),h=ce(null),d=ce(null),u;function f(){gt(l,A(s),!0),A(s)>0&&o()(r()[A(s)-1].id)}function g(){gt(l,A(s),!0),A(s)<r().length-1&&o()(r()[A(s)+1].id)}function p($){gt(l,A(s),!0),gt(h,null),o()(r()[$].id)}function m($){u!==void 0&&cancelAnimationFrame(u);const I=r()[$]?.id,F=r(),R=A(d);u=requestAnimationFrame(()=>{u=void 0,!(R!==A(d)||I!==i()||F!==r())&&A(d)?.querySelector(`[data-diagram-step-index="${$}"]`)?.focus({preventScroll:!0})})}function y($,I){if(r().length<=1)return;let F=I;if($.key==="ArrowLeft")F=Math.max(0,I-1);else if($.key==="ArrowRight")F=Math.min(r().length-1,I+1);else if($.key==="Home")F=0;else if($.key==="End")F=r().length-1;else return;$.preventDefault(),F!==I&&(p(F),m(F))}Np(()=>{u!==void 0&&cancelAnimationFrame(u)});var x={get states(){return r()},set states($){r($),_e()},get currentStateId(){return i()},set currentStateId($){i($),_e()},get onStateChange(){return o()},set onStateChange($){o($),_e()},$set:Do,$on:($,I)=>Ro(t,$,I)},b=VE(),S=qe(b),T=qe(S),k=qe(T);{var _=$=>{const I=Dt(()=>a(A(n).narrative));var F=Ko(),R=ui(F);Hp(R,()=>A(s),q=>{var D=HE(),P=qe(D);{var Y=U=>{var j=WE(),V=Tr(j,!0);cr(()=>br(V,A(I).title)),ge(U,j)};yr(P,U=>{A(I)?.title&&U(Y)})}var X=We(P,2);{var z=U=>{var j=zE(),V=Tr(j,!0);cr(()=>br(V,A(I).text)),ge(U,j)};yr(X,U=>{A(I)?.text&&U(z)})}$e(D),To(1,D,()=>Gu,()=>({axis:"x",distance:A(c)==="left"?8:-8,tier:"fast"})),To(2,D,()=>Gu,()=>({axis:"x",distance:A(c)==="left"?-8:8,tier:"fast"})),ge(q,D)}),ge($,F)};yr(k,$=>{A(n)?.narrative&&$(_)})}$e(T);var L=We(T,2),v=qe(L);ya(v,23,r,$=>$.id,($,I,F)=>{const R=Dt(()=>a(A(I).narrative));var q=GE(),D=ui(q);{let X=Dt(()=>A(F)===A(s)?"active":""),z=Dt(()=>A(F)<A(s)?"completed":""),U=Dt(()=>A(F)===A(s)?"step":void 0),j=Dt(()=>A(F)===A(s)?0:-1),V=Dt(()=>je.diagram_controls_state_ariaLabel({number:A(F)+1,title:A(R)?.title||je.diagram_controls_stateNumber_label({number:A(F)+1})}));Ja(D,{variant:"ghost",size:"icon-compact",iconOnly:!0,get class(){return`stepper-dot ${A(X)??""} ${A(z)??""}`},get"data-diagram-step-index"(){return A(F)},get style(){return`anchor-name: --segment-${A(F)??""};`},onclick:()=>p(A(F)),onkeydown:Q=>y(Q,A(F)),onmouseenter:()=>gt(h,A(F),!0),onmouseleave:()=>gt(h,null),get"aria-current"(){return A(U)},get tabindex(){return A(j)},get"aria-label"(){return A(V)}})}var P=We(D,2);{var Y=X=>{YC(X,{get anchor(){return`--segment-${A(F)??""}`},position:"top",class:"rounded-md !pointer-events-none",children:(z,U)=>{var j=jE(),V=qe(j);{var Q=H=>{var G=YE(),K=Tr(G,!0);cr(()=>br(K,A(R).title)),ge(H,G)};yr(V,H=>{A(R).title&&H(Q)})}var rt=We(V,2);{var ht=H=>{var G=XE(),K=Tr(G,!0);cr(()=>br(K,A(R).text)),ge(H,G)};yr(rt,H=>{A(R).text&&H(ht)})}$e(j),ge(z,j)},$$slots:{default:!0}})};yr(P,X=>{A(h)===A(F)&&A(R)&&X(Y)})}ge($,q)}),$e(v);var M=We(v,2),B=Tr(M),E=We(M,2);{var O=$=>{var I=UE(),F=qe(I);{let q=Dt(()=>A(s)<=0),D=Dt(()=>je.diagram_controls_previousStep_ariaLabel());Ja(F,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"diagram-nav-button",onclick:f,get disabled(){return A(q)},get"aria-label"(){return A(D)},children:(P,Y)=>{dn(P,{get icon(){return DC},class:"text-ui"})},$$slots:{default:!0}})}var R=We(F,2);{let q=Dt(()=>A(s)>=r().length-1),D=Dt(()=>je.diagram_controls_nextStep_ariaLabel());Ja(R,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"diagram-nav-button",onclick:g,get disabled(){return A(q)},get"aria-label"(){return A(D)},children:(P,Y)=>{dn(P,{get icon(){return RC},class:"text-ui"})},$$slots:{default:!0}})}$e(I),ge($,I)};yr(E,$=>{r().length>1&&$(O)})}return $e(L),no(L,$=>gt(d,$),()=>A(d)),$e(S),$e(b),cr(($,I)=>{fe(L,"aria-label",$),fe(M,"aria-label",I),br(B,`${A(s)+1}/${r().length??""}`)},[()=>je.diagram_controls_walkthrough_ariaLabel(),()=>je.diagram_controls_stepCounter_ariaLabel({current:A(s)+1,total:r().length})]),ge(e,b),qo(x)}function Mh(e,t){const r=new Set(e),i=new Set(t);return{shared:t.filter(o=>r.has(o)),departing:e.filter(o=>!i.has(o)),entering:t.filter(o=>!r.has(o))}}function Dp(e){const t=e.match(/-?(?:\d+(?:\.\d*)?|\.\d+)/g)?.map(Number);return t?.every(Number.isFinite)?t:null}function ZE(e,t){if(e===t)return!0;const r=Dp(e),i=Dp(t);return r!==null&&i!==null&&r.length===i.length&&r.every((o,a)=>Math.abs(o-i[a])<.001)}function KE(e,t){return ZE(e,t)?[]:[{transform:e},{transform:t}]}function QE(e,t,r,i,o){const a=t.x-e.x,s=t.y-e.y,n=Math.hypot(a,s),l=Math.abs(a)>=Math.abs(s)?r.width:r.height;if(n<=l+2*o)return[];const c=(l/2+o)/n,h=1-c,d=[];for(const g of i){const p=g.padding??0,m=[[e.x,a,g.x-r.width/2-p,g.x+g.width+r.width/2+p],[e.y,s,g.y-r.height/2-p,g.y+g.height+r.height/2+p]];let y=c,x=h;for(const[b,S,T,k]of m)if(S===0)(b<T||b>k)&&(x=-1);else{const _=(T-b)/S,L=(k-b)/S;y=Math.max(y,Math.min(_,L)),x=Math.min(x,Math.max(_,L))}y<=x&&d.push([y,x])}d.sort((g,p)=>g[0]-p[0]);const u=[];let f=c;for(const[g,p]of d)g>f&&u.push((f+g)/2),f=Math.max(f,p);return f<h&&u.push((f+h)/2),u}function JE(e,t){return(e===null||typeof e!="object"&&typeof e!="function")&&Object.is(e,t)}function ua(e,t,r=[]){const i=Reflect.ownKeys(e);return i.length===Reflect.ownKeys(t).length&&i.every(o=>Object.hasOwn(t,o)&&(r.includes(o)||JE(Reflect.get(e,o),Reflect.get(t,o))))}function tl(e,t,r){return e===void 0&&t===void 0||!!e&&!!t&&e.length===t.length&&e.every((i,o)=>r(i,t[o]))}function t4(e,t){return e!==null&&ua(e,t,["nodes","edges","groups","bounds"])&&ua(e.bounds,t.bounds)&&tl(e.nodes,t.nodes,(r,i)=>ua(r,i,["size"])&&(r.size===void 0&&i.size===void 0||!!r.size&&!!i.size&&ua(r.size,i.size)))&&tl(e.edges,t.edges,(r,i)=>ua(r,i,["points"])&&tl(r.points,i.points,ua))&&tl(e.groups,t.groups,ua)}var e4=ar('<div class="diagram-actions svelte-10vg205" role="toolbar"><!></div>'),r4=ar('<div class="diagram-feedback svelte-10vg205" role="alert"><strong class="svelte-10vg205"> </strong> <span> </span></div>'),i4=ar('<div class="diagram-feedback svelte-10vg205" role="status"><strong class="svelte-10vg205"> </strong> <span> </span></div>'),o4=pi("<g><!></g>"),a4=pi('<g class="edge-reveal"><!></g>'),Rp=ar('<div class="edge-label-html"><span class="edge-label-text"> </span></div>'),s4=pi("<foreignObject><!></foreignObject>"),n4=pi('<foreignObject class="diagram-geometry-motion svelte-10vg205"><!></foreignObject>'),l4=pi('<g class="diagram-geometry-motion svelte-10vg205"><!><!><!><!></g>'),c4=ar('<div class="diagram-content svelte-10vg205"><svg class="diagram-svg-layer svelte-10vg205"><defs><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker></defs><!></svg></div>'),h4=ar('<div class="diagram-footer svelte-10vg205"><!></div>'),d4=ar("<div><!> <div><!></div> <!></div>");function u4(e,t){if(new.target)return Oo({component:u4,...e});No(t,!0);let r=He(t,"diagram",7),i=He(t,"onUpdate",7),o=He(t,"editable",7,!1),a=He(t,"styleConfig",7,Gi),s=He(t,"onBindingClick",7),n=He(t,"viewResetKey",7);const l=32,c=12,h=10,d=5,u=.5;let f=ce(!1),g=ce(0),p,m;function y(nt){return A(f)||rn(A(v)?.ownerDocument)?0:nt}let x=ce(null),b=null,S=ce(!1),T=ce(!1),k=ce(1),_=ce(900),L=ce(900),v=ce(null),M=ce(null),B=ce(null),E=ce(void 0),O=ce(!1),$,I,F=ce(0);hd(()=>{let nt=!1;return document.fonts?.ready.then(()=>{nt||gt(F,A(F)+1)}),()=>{nt=!0}});let R=ce(wi(r().currentStateId??(r().states&&r().states.length>0?r().states[0].id:void 0))),q=Dt(()=>r().states?.find(nt=>nt.id===A(R))??null),D=ce(wi(A(R))),P,Y=Dt(()=>r().states?.find(nt=>nt.id===A(D))??A(q)),X=Dt(()=>A(q)?.camera?.zoom??1),z=Dt(()=>A(q)!==null),U=Dt(()=>A(M)!==null&&A(M)>0?A(M):A(v)?.clientWidth??null),j=Dt(()=>A(L)<500||A(z)&&(A(B)??A(U)??0)>0&&(A(B)??A(U)??0)<500),V=Dt(()=>A(j)?4:l),Q=Dt(()=>A(j)?{...a(),maxWidth:Math.min(a().maxWidth,150),maxLines:Math.max(a().maxLines,5),paddingX:Math.min(a().paddingX,10)}:a()),rt=Dt(()=>A(X)*(A(T)||A(z)?A(k):1)),ht=Dt(()=>Math.max(c/A(Q).labelFontSize,h/(a()===Gi?11:A(Q).kindFontSize))),H=Dt(()=>(d+u)/A(rt)),G=Dt(()=>8/A(rt)),K=ce(!1),tt=ce(wi([])),ot=ce(wi([])),vt=ce(wi([])),Ot=ce(wi([])),Pt=ce(wi([])),Mt=ce(wi([])),Bt=ce(wi(new Map)),Rt=ce(wi([])),we=ce(wi([])),qt=ce(wi([])),ue=ce(wi(new Map)),Ee=ce(!1),ke=ce(!1),Se=ce(!0);const _t=new Set;let Xt=ce(void 0),w=ce(!0),J=0,dt,mt=0,ft=ce("settled"),N=[];const et=180,it="cubic-bezier(0.65, 0, 0.35, 1)",ct=220,xt=160,Tt=180,st=180,kt=60,jt=st-kt;function re(){const nt=A(Xt)?.querySelector(".diagram-svg-layer"),Nt=A(Xt)?.querySelector(".diagram-geometry-motion")?.getScreenCTM?.();return{camera:nt?getComputedStyle(nt).transform:null,screenMatrix:Nt?new DOMMatrix([Nt.a,Nt.b,Nt.c,Nt.d,Nt.e,Nt.f]):null}}function Kt(nt){if(y(1)===0||!A(Xt))return[];const bt=A(Xt).querySelector(".diagram-svg-layer"),Nt=A(Xt).querySelector(".diagram-svg-layer > g");if(!bt||!Nt||!nt.camera)return[];for(const ae of bt.getAnimations({subtree:!1}))ae.cancel();const Qt=getComputedStyle(bt).transform;let te=nt.camera;const At=nt.screenMatrix?bt.getScreenCTM():null;if(At&&nt.screenMatrix){const ae=new DOMMatrix([At.a,At.b,At.c,At.d,At.e,At.f]),pe=new DOMMatrix(getComputedStyle(Nt).transform);te=new DOMMatrix(Qt).multiply(ae.inverse()).multiply(nt.screenMatrix).multiply(pe.inverse()).toString()}const le=KE(te,Qt);if(le.length===0)return[];const oe=bt.animate(le,{duration:et,easing:it});return oe.finished.catch(()=>{}),[oe]}function xe(nt,{delay:bt=0,duration:Nt}){return{delay:bt,duration:y(Nt),easing:Uu,css:Qt=>`--edge-reveal-progress: ${Qt};`}}function Pe(){return A(Xt)?.getAnimations?A(Xt).getAnimations({subtree:!0}).filter(nt=>{const bt=Number(nt.effect?.getComputedTiming().endTime);return Number.isFinite(bt)&&nt.playState!=="finished"&&nt.playState!=="idle"}):[]}async function mi(nt){if(await Th(),await new Promise(Nt=>requestAnimationFrame(()=>Nt())),nt!==mt)return!1;const bt=Pe();return await Promise.allSettled(bt.map(Nt=>Nt.finished)),nt===mt}async function xo(nt,bt,Nt){if(Nt.length>0&&(await Promise.allSettled(Nt.map(te=>te.finished)),nt!==mt)||A(Rt).length===0&&A(zt).length>0&&(gt(ft,"scene"),gt(Se,!0),_e(),!await mi(nt))||(gt(ft,"exit"),gt(Ee,!1),gt(ke,!1),gt(D,bt,!0),_e(),!await mi(nt)))return;const Qt=re();gt(Ot,[],!0),gt(Pt,[],!0),gt(Mt,[],!0),gt(Bt,new Map,!0),gt(Rt,[],!0),gt(we,[],!0),gt(qt,[],!0),gt(ue,new Map,!0),gt(ft,"camera"),_e(),N=Kt(Qt),await mi(nt)&&(gt(ft,"scene"),gt(Se,!0),_e())}function bo(){if(!A(Xt))return"";const nt=A(Xt).getBoundingClientRect(),bt=[".diagram-content",".diagram-svg-layer",".diagram-geometry-motion","[data-group-id]",".group-bg",".group-label",".diagram-edge",".edge-path",".edge-label-container","[data-node-id]",".diagram-node-html"].join(",");return[...A(Xt).querySelectorAll(bt)].map(Nt=>{const Qt=Nt.getBoundingClientRect(),te=getComputedStyle(Nt);return[Nt.tagName,Nt.getAttribute("data-node-id"),Nt.getAttribute("data-edge-id"),Nt.getAttribute("data-group-id"),Nt.getAttribute("class"),Nt.getAttribute("d"),(Qt.x-nt.x).toFixed(3),(Qt.y-nt.y).toFixed(3),Qt.width.toFixed(3),Qt.height.toFixed(3),te.opacity,te.transform].join("|")}).join(`
341
- `)}function $s(nt,bt){dt=requestAnimationFrame(()=>{if(nt!==J)return;I?.();const Nt=bo(),Qt=A(ft)==="camera"||A(ft)==="exit"||_t.size>0||Pe().length>0;if(!Qt&&bt!==void 0&&Nt===bt){if(A(K)){gt(K,!1),dt=void 0,Th().then(()=>{nt===J&&$s(nt)});return}gt(w,!0),gt(ft,"settled"),Xr(),dt=void 0;return}$s(nt,Qt?void 0:Nt)})}function Es(){J+=1;const nt=J;dt!==void 0&&cancelAnimationFrame(dt),dt=void 0,y(1)===0&&gt(K,!1),gt(w,!1),queueMicrotask(()=>{nt===J&&$s(nt)})}Np(()=>{Xr(),mt+=1,J+=1,dt!==void 0&&cancelAnimationFrame(dt),p!==void 0&&cancelAnimationFrame(p),la();for(const nt of N)nt.cancel();N=[],_t.clear()});let at=ce(null),ut=ce(null),Ct=Dt(()=>{if(!A(at))return new Set;const nt=new Set;return nt.add(A(at)),r().model.edges.forEach(bt=>{bt.from===A(at)&&nt.add(bt.to),bt.to===A(at)&&nt.add(bt.from)}),nt}),Ft=Dt(()=>{if(!A(at))return new Set;const nt=new Set;return r().model.edges.forEach(bt=>{(bt.from===A(at)||bt.to===A(at))&&nt.add(bt.id)}),nt}),wt=Dt(()=>{if(!A(ut))return new Set;const nt=new Set;if(r().model.groups){const bt=r().model.groups.find(Nt=>Nt.id===A(ut));bt?.nodeIds&&bt.nodeIds.forEach(Nt=>nt.add(Nt))}return r().model.nodes.forEach(bt=>{bt.group===A(ut)&&nt.add(bt.id)}),nt}),Z=Dt(()=>{if(!A(ut))return new Set;const nt=A(wt),bt=new Set;return r().model.edges.forEach(Nt=>{(nt.has(Nt.from)||nt.has(Nt.to))&&bt.add(Nt.id)}),bt}),St=Dt(()=>A(Y)?.highlightedNodes&&A(Y).highlightedNodes.length>0?new Set(A(Y).highlightedNodes):null),$t=Dt(()=>A(Y)?.highlightedEdges&&A(Y).highlightedEdges.length>0?new Set(A(Y).highlightedEdges):null),Wt=Dt(()=>A(St)!==null||A($t)!==null),Ht=Dt(()=>A(q)?.visibleNodes??r().model.nodes.map(nt=>nt.id)),Vt=Dt(()=>new Set(A(Ht))),de=Dt(()=>A(q)?.visibleEdges??r().model.edges.map(nt=>nt.id)),Me=Dt(()=>A(de).filter(nt=>{const bt=r().model.edges.find(Nt=>Nt.id===nt);return bt&&A(Vt).has(bt.from)&&A(Vt).has(bt.to)})),zt=Dt(()=>A(x)?.nodes.filter(nt=>A(Ht).includes(nt.id))??[]),Fe=Dt(()=>A(x)?.edges.filter(nt=>A(Me).includes(nt.id))??[]),Ze=Dt(()=>{A(F);const nt=new Map,bt=[],Nt=(le,oe,ae,pe,be=0)=>A(zt).some(ye=>!(le+ae+be<ye.x||le-be>ye.x+ye.width||oe+pe+be<ye.y||oe-be>ye.y+ye.height)),Qt=(le,oe,ae,pe,be=6)=>bt.some(ye=>!(le+ae+be<ye.x||le-be>ye.x+ye.width||oe+pe+be<ye.y||oe-be>ye.y+ye.height)),te=(le,oe,ae,pe)=>(A(x)?.groups??[]).some(be=>le<be.x+be.width&&le+ae>be.x&&oe<be.y+34&&oe+pe>be.y),At=(le,oe,ae,pe,be,ye=2)=>A(Fe).some(Rr=>Rr.id!==be&&(Rr.points??[]).slice(0,-1).some((Ti,zo)=>{const Ci=Rr.points[zo+1],ci=Math.max(1,Math.ceil(Math.hypot(Ci.x-Ti.x,Ci.y-Ti.y)/4));for(let Bi=0;Bi<=ci;Bi+=1){const Ho=Ti.x+(Ci.x-Ti.x)*Bi/ci,wr=Ti.y+(Ci.y-Ti.y)*Bi/ci;if(Ho>le-ye&&Ho<le+ae+ye&&wr>oe-ye&&wr<oe+pe+ye)return!0}return!1}));for(const le of A(Fe)){if(!le.label||!le.points||le.points.length<2)continue;const oe=le.points,ae=oe.length===2&&Math.abs(oe[0].x-oe[1].x)<.5?Math.abs(oe[0].y-oe[1].y):void 0,{width:pe,height:be,lines:ye}=di(le.label,A(j)?bn(le.label??"",ae):void 0),Rr=ye>3,Ti=r().model.edges.find(({id:wr})=>wr===le.id),zo=Ti&&r().model.edges.find(wr=>wr.from===Ti.to&&wr.to===Ti.from);if(zo&&oe.length===2){const wr=di(zo.label??"",A(j)?bn(zo.label??""):void 0),Qe=Math.abs(oe[1].x-oe[0].x),dr=Math.abs(oe[1].y-oe[0].y),Er=Math.max(Qe,dr),or=Qe>=dr?(pe+wr.width)/2:(be+wr.height)/2,Ae=A(Me).includes(zo.id)?Math.max(.05,Math.min(.35,(1-(or+6)/Er)/2)):.35,Mr=Qe>=dr?pe:be,Nr=Math.min(.5,(Mr/2+4/A(rt))/Er),gr=Math.max(Nr,Math.min(1-Nr,Ae)),pr=oe[0].x+(oe[1].x-oe[0].x)*gr-pe/2,jr=oe[0].y+(oe[1].y-oe[0].y)*gr-be/2;if(!Nt(pr,jr,pe,be,8)&&!te(pr,jr,pe,be)&&!At(pr,jr,pe,be,le.id)&&!Qt(pr,jr,pe,be,1)){nt.set(le.id,{x:pr,y:jr,width:pe,height:be,truncated:Rr}),bt.push({x:pr,y:jr,width:pe,height:be});continue}}const Ci=[],ci=[],Bi=[],Ho=(wr,Qe,dr,Er=Ci)=>{const or=wr-pe/2,Ae=Qe-be/2;if(Nt(or,Ae,pe,be,8)||te(or,Ae,pe,be)||At(or,Ae,pe,be,le.id))return;const Mr={x:or,y:Ae,score:dr};if(Qt(or,Ae,pe,be)){Qt(or,Ae,pe,be,1)||ci.push(Mr);return}Er.push(Mr)};for(let wr=0;wr<oe.length-1;wr++){const Qe=oe[wr],dr=oe[wr+1],Er=Math.abs(dr.x-Qe.x),or=Math.abs(dr.y-Qe.y),Ae=Math.hypot(Er,or);if(Ae<8)continue;const Mr=Er>=or,Nr=Mr?pe:be,gr=[.5,.25,.75,.2,.3,.4,.6,.7,.8,.125,.875,.05,.1,.15,.85,.9,.95];for(const pr of gr){const jr=Ae*Math.min(pr,1-pr);if(Ae*Math.max(pr,1-pr)<Nr/2+A(G))continue;const Ps=Qe.x+(dr.x-Qe.x)*pr,yi=Qe.y+(dr.y-Qe.y)*pr;Ho(Ps,yi,Ae+(Mr?1e3:0)-Math.abs(pr-.5)*16,jr>=Nr/2+A(G)?Ci:Bi)}}if(!Ci.length&&!ci.length&&!Bi.length){const wr=[...A(zt).map(Qe=>({...Qe,padding:8})),...(A(x)?.groups??[]).map(Qe=>({...Qe,height:34,padding:0})),...bt.map(Qe=>({...Qe,padding:1})),...A(Fe).filter(Qe=>Qe.id!==le.id).flatMap(Qe=>(Qe.points??[]).slice(1).map((dr,Er)=>{const or=Qe.points[Er];return{x:Math.min(or.x,dr.x),y:Math.min(or.y,dr.y),width:Math.abs(dr.x-or.x),height:Math.abs(dr.y-or.y),padding:2}}))];for(let Qe=1;Qe<oe.length;Qe+=1){const dr=oe[Qe-1],Er=oe[Qe],or=Math.hypot(Er.x-dr.x,Er.y-dr.y),Ae=Math.abs(Er.x-dr.x)>=Math.abs(Er.y-dr.y)?1e3:0;for(const Mr of QE(dr,Er,{width:pe,height:be},wr,A(G)))Ho(dr.x+(Er.x-dr.x)*Mr,dr.y+(Er.y-dr.y)*Mr,or+Ae-Math.abs(Mr-.5)*16)}}if(Ci.length>0||ci.length>0||Bi.length>0){const wr=Ci.length>0?Ci:ci.length>0?ci:Bi;wr.sort((dr,Er)=>Er.score-dr.score);const Qe=wr[0];nt.set(le.id,{x:Qe.x,y:Qe.y,width:pe,height:be,truncated:Rr}),bt.push({x:Qe.x,y:Qe.y,width:pe,height:be})}else if(oe.length>=2){const[wr,Qe]=oe.slice(0,-1).map((Mr,Nr)=>[Mr,oe[Nr+1]]).toSorted(([Mr,Nr],[gr,pr])=>Math.hypot(pr.x-gr.x,pr.y-gr.y)-Math.hypot(Nr.x-Mr.x,Nr.y-Mr.y))[0],dr=(wr.x+Qe.x)/2,Er=(wr.y+Qe.y)/2,or=dr-pe/2,Ae=Er-be/2;nt.set(le.id,{x:or,y:Ae,width:pe,height:be,truncated:Rr}),bt.push({x:or,y:Ae,width:pe,height:be})}}return nt}),Le=Dt(()=>{const nt=new Set(A(tt)),bt=A(Se)?A(zt):A(zt).filter(At=>!nt.has(At.id)),Nt=new Map(A(Rt).map(At=>[At.id,At])),Qt=A(Ee)?bt.map(At=>Nt.get(At.id)??At):bt;if(!A(ke))return Qt;const te=new Set(Qt.map(At=>At.id));return[...Qt,...A(Ot).filter(At=>!te.has(At.id))]}),ne=Dt(()=>{const nt=new Set(A(ot)),bt=A(Se)?A(Ie):A(Ie).filter(At=>!nt.has(At.id)),Nt=new Map(A(we).map(At=>[At.id,At])),Qt=A(Ee)?bt.map(At=>Nt.get(At.id)??At):bt;if(!A(ke))return Qt;const te=new Set(Qt.map(At=>At.id));return[...Qt,...A(Pt).filter(At=>!te.has(At.id))]}),It=Dt(()=>{const nt=new Set(A(vt)),bt=A(Se)?A(Fe):A(Fe).filter(At=>!nt.has(At.id)),Nt=new Map(A(qt).map(At=>[At.id,At])),Qt=A(Ee)?bt.map(At=>Nt.get(At.id)??At):bt;if(!A(ke))return Qt;const te=new Set(Qt.map(At=>At.id));return[...Qt,...A(Mt).filter(At=>!te.has(At.id))]}),ie=Dt(()=>{const nt=A(ke)?new Map(A(Bt)):new Map;for(const[bt,Nt]of A(Ze))nt.set(bt,Nt);if(A(Ee))for(const[bt,Nt]of A(ue))nt.set(bt,Nt);return nt}),Ie=Dt(()=>{if(!A(x)?.groups)return[];if(A(q)?.visibleGroups)return A(x).groups.filter(nt=>A(q).visibleGroups.includes(nt.id));if(A(q)?.highlightedNodes&&A(q).highlightedNodes.length>0){const nt=new Set(A(q).highlightedNodes);return A(x).groups.filter(bt=>Array.isArray(bt.nodeIds)&&bt.nodeIds.some(Nt=>nt.has(Nt)))}return A(x).groups.filter(nt=>Array.isArray(nt.nodeIds)&&nt.nodeIds.some(bt=>A(Ht).includes(bt)))});Bo(()=>{A(F);try{const nt=A(q)?r().model.groups?.filter(te=>{if(A(q).visibleGroups)return A(q).visibleGroups.includes(te.id);const At=A(q).highlightedNodes?.length?A(q).highlightedNodes:A(Ht);return te.nodeIds?.some(le=>At.includes(le)&&A(Vt).has(le))}).map(te=>({...te,nodeIds:te.nodeIds?.filter(At=>A(Vt).has(At))})):r().model.groups,bt=new Set(nt?.map(te=>te.id)),Nt=A(q)?{...r().model,nodes:r().model.nodes.filter(te=>A(Vt).has(te.id)).map(te=>te.group&&!bt.has(te.group)?{...te,group:void 0}:te),edges:r().model.edges.filter(te=>A(Me).includes(te.id)),groups:nt}:r().model,Qt=oE(Nt,A(q)?{...r().baseView,layout:{...r().baseView.layout,spacing:Math.min(r().baseView.layout.spacing??80,A(j)?40:56)}}:r().baseView,r().grammar,A(Q),A(_));t4(b,Qt)||(b=Qt,gt(x,Qt,!0)),gt(S,!1),Es()}catch{b=null,gt(x,null),gt(S,!0)}});let ve=Dt(()=>A(q)?.camera?.pan??null),Oe=Dt(()=>A(q)?.camera?.focus??null),Ke=ce(!1);function De(){gt(K,!1),gt(ft,"scene"),gt(Ee,!1),gt(ke,!1),gt(Se,!0),gt(tt,[],!0),gt(ot,[],!0),gt(vt,[],!0),gt(Ot,[],!0),gt(Pt,[],!0),gt(Mt,[],!0),gt(Bt,new Map,!0),gt(Rt,[],!0),gt(we,[],!0),gt(qt,[],!0),gt(ue,new Map,!0),gt(D,A(R),!0)}gC(()=>{const nt=r().id,bt=r().states?.map(Qt=>Qt.id)??[],Nt=r().currentStateId;pl(()=>{if(P===void 0){P=nt;return}const Qt=At=>At===void 0?bt.length===0:bt.includes(At);if(nt===P&&Qt(A(R))&&Qt(A(D)))return;const te=nt===P&&Qt(A(R));P=nt,mt+=1;for(const At of N)At.cancel();N=[],la(),Xr(),_t.clear(),te||gt(R,bt.find(At=>At===Nt)??bt[0],!0),De(),gt(g,A(g)+1)})}),Bo(()=>{if(!A(v))return;const nt=A(v).closest(".node-diagram_block"),bt=nt??A(Xt)??A(v);let Nt=bt.clientWidth;pl(()=>{gt(B,nt?.clientWidth??null,!0),gt(M,A(v).clientWidth,!0),Zi()});const Qt=new ResizeObserver(()=>{if(A(z)&&A(M)!==null&&Math.abs(bt.clientWidth-Nt)>.5){gt(f,!0),Xr(),mt+=1;for(const te of N)te.cancel();N=[],_t.clear(),De()}if(Nt=bt.clientWidth,gt(B,nt?.clientWidth??null,!0),gt(M,A(v).clientWidth,!0),Zi(),_e(),A(f)){gt(g,A(g)+1),_e();for(const te of Pe())te.finish();p!==void 0&&cancelAnimationFrame(p),p=requestAnimationFrame(()=>{gt(f,!1),p=void 0})}});return Qt.observe(A(v)),bt!==A(v)&&Qt.observe(bt),()=>Qt.disconnect()});let Te=Dt(()=>{const nt=A(ve)?.x??0,bt=A(ve)?.y??0;if(A(z))return`scale(${A(rt)}) translate(calc(-50% + ${nt/A(rt)}px), calc(-50% + ${bt/A(rt)}px))`;const Nt=[];return A(ve)&&Nt.push(`translate(${nt}px, ${bt}px)`),A(rt)!==1&&Nt.push(`scale(${A(rt)})`),Nt.length>0?Nt.join(" "):void 0});Bo(()=>{if(!A(Oe)||!A(x)||!A(v))return;const nt=A(x).nodes.find(be=>be.id===A(Oe));if(!nt)return;const bt=A(Ue)??A(x).bounds,Nt=nt.x+nt.width/2-(bt.minX-A(V)),Qt=nt.y+nt.height/2-(bt.minY-A(V)),te=Nt*A(X),At=Qt*A(X),le=A(v).clientWidth,oe=A(v).clientHeight,ae=A(ve)?.x??0,pe=A(ve)?.y??0;A(v).scrollTo({left:Math.max(0,te+ae*A(X)-le/2),top:Math.max(0,At+pe*A(X)-oe/2),behavior:y(1)===0?"auto":"smooth"})});function me(nt=!0){if(!A(x))return null;if(!A(q)){let{minX:ae,minY:pe,maxX:be,maxY:ye}=A(x).bounds;for(const Rr of A(Ze).values())ae=Math.min(ae,Rr.x),pe=Math.min(pe,Rr.y),be=Math.max(be,Rr.x+Rr.width),ye=Math.max(ye,Rr.y+Rr.height);return{minX:ae,minY:pe,maxX:be,maxY:ye,width:be-ae,height:ye-pe}}const bt=nt?[...A(zt),...A(Ot),...A(Rt)]:A(zt),Nt=nt?[...A(Fe),...A(Mt),...A(qt)]:A(Fe),Qt=nt?[...A(Ie),...A(Pt),...A(we)]:A(Ie);if(bt.length===0)return{minX:0,minY:0,maxX:0,maxY:0,width:0,height:0};let te=Math.min(...bt.map(ae=>ae.x)),At=Math.min(...bt.map(ae=>ae.y)),le=Math.max(...bt.map(ae=>ae.x+ae.width)),oe=Math.max(...bt.map(ae=>ae.y+ae.height));for(const ae of Qt)te=Math.min(te,ae.x),At=Math.min(At,ae.y),le=Math.max(le,ae.x+ae.width),oe=Math.max(oe,ae.y+ae.height);for(const ae of Nt)if(ae.points)for(const pe of ae.points)te=Math.min(te,pe.x-4),At=Math.min(At,pe.y-4),le=Math.max(le,pe.x+4),oe=Math.max(oe,pe.y+4);for(const ae of[...A(Ze).values(),...nt?A(Bt).values():[],...nt?A(ue).values():[]])te=Math.min(te,ae.x),At=Math.min(At,ae.y),le=Math.max(le,ae.x+ae.width),oe=Math.max(oe,ae.y+ae.height);return{minX:te,minY:At,maxX:le,maxY:oe,width:le-te,height:oe-At}}let Ue=Dt(()=>me(!0)),Jt=Dt(()=>A(Ue)?A(Ue).width+A(V)*2:800),tr=Dt(()=>A(Ue)?A(Ue).height+A(V)*2:600),Cr=Dt(()=>A(Jt)*A(rt)),hr=Dt(()=>(A(x)?A(Jt)*A(X)*Math.max(1,A(ht)):0)+16),Fr=Dt(()=>(A(tr)+6)*A(rt)),$r=Dt(()=>Math.ceil((A(tr)+6)*A(rt)+20)),lr=Dt(()=>A($r)),ni=Dt(()=>A(z)&&(A(E)!==void 0&&A(lr)>A(E)*.9+1||A(U)!==null&&A(Cr)+16>A(U)+1));function Xr(){gt(O,!1),I=void 0,$?.(),$=void 0}function ti(){if(Xr(),!A(Xt))return;gt(O,!0);const nt=A(Xt),bt=[];for(let At=nt.parentElement;At;At=At.parentElement)/(auto|scroll)/.test(getComputedStyle(At).overflowY)&&bt.push(At);const Nt=document.scrollingElement;Nt&&!bt.includes(Nt)&&bt.push(Nt);const Qt=bt.map(At=>({element:At,value:At.style.getPropertyValue("overflow-anchor"),priority:At.style.getPropertyPriority("overflow-anchor")}));for(const{element:At}of Qt)At.style.setProperty("overflow-anchor","none");const te=()=>{I=void 0};for(const At of["wheel","touchstart","keydown"])window.addEventListener(At,te,{capture:!0,passive:!0});$=()=>{for(const{element:At,value:le,priority:oe}of Qt)le?At.style.setProperty("overflow-anchor",le,oe):At.style.removeProperty("overflow-anchor");for(const At of["wheel","touchstart","keydown"])window.removeEventListener(At,te,!0)},I=()=>{const At=nt.querySelector(".diagram-footer");if(At)for(const le of bt){const oe=le.getBoundingClientRect(),ae=le===Nt?0:Math.max(0,oe.top+le.clientTop),pe=le===Nt?window.innerHeight:Math.min(window.innerHeight,oe.top+le.clientTop+le.clientHeight);if(pe<=ae)continue;const be=At.getBoundingClientRect(),ye=be.height<=pe-ae?be:At.querySelector(".state-navigation").getBoundingClientRect(),Rr=ye.bottom>pe?ye.bottom-pe:ye.top<ae?ye.top-ae:0;Math.abs(Rr)>.5&&le.scrollBy({top:Rr,behavior:"instant"})}}}let li=Dt(()=>A(Ue)?`translate(${-A(Ue).minX+A(V)}px, ${-A(Ue).minY+A(V)}px)`:"translate(0, 0)"),Pa=Dt(()=>A(Ue)?`translate(${-A(Ue).minX+A(V)}, ${-A(Ue).minY+A(V)})`:"translate(0, 0)");function Zi(){if(!A(T)&&!A(z)||!A(v)){gt(k,1);return}const nt=Math.max(1,A(v).clientWidth-16),bt=Math.max(1,(A(B)??A(v).clientWidth)-16),Nt=A(z)?Number.POSITIVE_INFINITY:Math.max(1,A(v).clientHeight-16),Qt=Math.max(1,A(Jt)*A(X)),te=Math.max(1,A(tr)*A(X)),At=A(z)&&bt>=500&&["TB","BT"].includes(r().baseView.layout.direction??"")?500:160;gt(L,Math.max(At,bt/A(ht)-l*2),!0),gt(_,Math.max(At,bt/A(ht)-A(V)*2),!0),gt(k,Math.min(A(B)===null?1.25:Math.max(1,A(ht)),Math.max(A(ht),Math.min(nt/Qt,Nt/te))),!0)}function la(){m!==void 0&&cancelAnimationFrame(m),m=void 0}function Ki(){la(),gt(T,!A(T)),Zi(),m=requestAnimationFrame(()=>{m=void 0,Zi(),A(v)?.scrollTo({left:0,top:0,behavior:y(1)===0?"auto":"smooth"})})}Bo(()=>{A(Jt),A(tr),A(X),(A(T)||A(z))&&Zi()}),Bo(()=>{if(A(Ke)||!A(x)||!A(v))return;const nt=A(v).clientWidth-16;nt<=0||(A(Jt)*A(X)>nt&&(gt(T,!0),Zi()),gt(Ke,!0))});let Di=ce(void 0),Ri=ce(!1);Bo(()=>{const nt=n();if(!A(Ri)){gt(Di,nt,!0),gt(Ri,!0);return}nt!==A(Di)&&(gt(Di,nt,!0),la(),Xr(),gt(T,!1),gt(k,1),A(v)?.scrollTo({left:0,top:0,behavior:"auto"}))});function yc(nt){if(nt===A(R))return;ti();const bt=re();mt+=1;const Nt=mt,Qt=A(Le),te=A(ne),At=A(It),le=new Map(A(ie)),oe=y(1)>0;if(gt(K,oe),gt(ft,oe?"camera":"scene",!0),Es(),oe&&(gt(Ee,!0),gt(Se,!1),gt(ke,!0),gt(Rt,Qt,!0),gt(we,te,!0),gt(qt,At,!0),gt(ue,le,!0),gt(tt,r().model.nodes.map(ae=>ae.id).filter(ae=>!Qt.some(pe=>pe.id===ae)),!0),gt(ot,(r().model.groups??[]).map(ae=>ae.id).filter(ae=>!te.some(pe=>pe.id===ae)),!0),gt(vt,r().model.edges.map(ae=>ae.id).filter(ae=>!At.some(pe=>pe.id===ae)),!0),gt(Ot,Qt,!0),gt(Pt,te,!0),gt(Mt,At,!0),gt(Bt,le,!0)),gt(R,nt,!0),_e(),oe){const ae=Mh(Qt.map(ye=>ye.id),A(zt).map(ye=>ye.id)),pe=Mh(te.map(ye=>ye.id),A(Ie).map(ye=>ye.id)),be=Mh(At.map(ye=>ye.id),A(Fe).map(ye=>ye.id));gt(tt,ae.entering,!0),gt(ot,pe.entering,!0),gt(vt,be.entering,!0),gt(Rt,Qt.filter(ye=>ae.shared.includes(ye.id)),!0),gt(we,te.filter(ye=>pe.shared.includes(ye.id)),!0),gt(qt,At.filter(ye=>be.shared.includes(ye.id)),!0),gt(ue,new Map([...le].filter(([ye])=>be.shared.includes(ye))),!0),gt(Ot,Qt.filter(ye=>ae.departing.includes(ye.id)),!0),gt(Pt,te.filter(ye=>pe.departing.includes(ye.id)),!0),gt(Mt,At.filter(ye=>be.departing.includes(ye.id)),!0),gt(Bt,new Map([...le].filter(([ye])=>be.departing.includes(ye))),!0),_e()}else De();N=Kt(bt),oe&&(N.length===0&&gt(ft,"exit"),xo(Nt,nt,N)),i()?.({currentStateId:nt}),I?.()}function Ia(nt,bt){(bt?!_t.has(nt):_t.has(nt))&&(bt?_t.add(nt):_t.delete(nt),bt&&Es())}function U1(nt,bt,Nt){if(!o()||!i())return;const Qt=r().model.nodes.map(te=>te.id===nt?{...te,position:{x:bt,y:Nt}}:te);i()({model:{...r().model,nodes:Qt}})}var V1={get diagram(){return r()},set diagram(nt){r(nt),_e()},get onUpdate(){return i()},set onUpdate(nt){i(nt),_e()},get editable(){return o()},set editable(nt=!1){o(nt),_e()},get styleConfig(){return a()},set styleConfig(nt=Gi){a(nt),_e()},get onBindingClick(){return s()},set onBindingClick(nt){s(nt),_e()},get viewResetKey(){return n()},set viewResetKey(nt){n(nt),_e()},$set:Do,$on:(nt,bt)=>Ro(t,nt,bt)},Qi=d4();let Ou,Du;var Ru=qe(Qi);{var Z1=nt=>{var bt=e4(),Nt=qe(bt);{let Qt=Dt(()=>A(T)?je.diagram_renderer_actualSize_ariaLabel():je.diagram_renderer_fitToWidth_ariaLabel()),te=Dt(()=>A(T)?je.diagram_renderer_actualSize_ariaLabel():je.diagram_renderer_fitToWidth_ariaLabel());Ja(Nt,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"diagram-fit-button",onclick:Ki,get"aria-pressed"(){return A(T)},get"aria-label"(){return A(Qt)},get tooltip(){return A(te)},children:(At,le)=>{{let oe=Dt(()=>A(T)?zp:NC);dn(At,{get icon(){return A(oe)},size:"sm"})}},$$slots:{default:!0}})}$e(bt),cr(Qt=>fe(bt,"aria-label",Qt),[()=>je.diagram_renderer_actions_ariaLabel()]),ge(nt,bt)};yr(Ru,nt=>{A(x)&&r().model.nodes.length>0&&nt(Z1)})}var Co=We(Ru,2);let Nu,qu;var K1=qe(Co);{var Q1=nt=>{var bt=r4(),Nt=qe(bt),Qt=Tr(Nt,!0),te=We(Nt,2),At=Tr(te,!0);$e(bt),cr((le,oe)=>{br(Qt,le),br(At,oe)},[()=>je.markdown_mermaid_renderFailed_error(),()=>je.diagram_renderer_error_description()]),ge(nt,bt)},J1=nt=>{var bt=i4(),Nt=qe(bt),Qt=Tr(Nt,!0),te=We(Nt,2),At=Tr(te,!0);$e(bt),cr((le,oe)=>{br(Qt,le),br(At,oe)},[()=>je.diagram_validator_noNodes_warning(),()=>je.diagram_renderer_empty_description()]),ge(nt,bt)},tC=nt=>{var bt=c4();let Nt;var Qt=qe(bt);let te;var At=qe(Qt),le=qe(At),oe=We(le),ae=We(oe),pe=We(ae),be=We(pe),ye=We(be),Rr=We(ye),Ti=We(Rr);$e(At);var zo=We(At);Hp(zo,()=>A(g),Ci=>{var ci=l4();let Bi;var Ho=qe(ci);{var wr=or=>{var Ae=Ko(),Mr=ui(Ae);ya(Mr,17,()=>A(ne),Nr=>Nr.id,(Nr,gr)=>{var pr=o4(),jr=qe(pr);{let Ni=Dt(()=>A(ut)!==null&&A(ut)!==A(gr).id);j1(jr,{get group(){return A(gr)},get dimmed(){return A(Ni)},onHover:Ps=>gt(ut,Ps,!0)})}$e(pr),To(1,pr,()=>Is,()=>({delay:0,duration:y(st)})),To(2,pr,()=>Is,()=>({duration:y(xt)})),ge(Nr,pr)}),ge(or,Ae)};yr(Ho,or=>{A(ne)&&or(wr)})}var Qe=We(Ho);ya(Qe,17,()=>A(It),or=>or.id,(or,Ae)=>{const Mr=Dt(()=>A(at)!==null&&!A(Ft).has(A(Ae).id)||A(ut)!==null&&!A(Z).has(A(Ae).id)||A(Wt)&&A($t)!==null&&!A($t).has(A(Ae).id)),Nr=Dt(()=>A($t)!==null&&A($t).has(A(Ae).id));var gr=a4(),pr=qe(gr);X1(pr,{get edge(){return A(Ae)},get dimmed(){return A(Mr)},get highlighted(){return A(Nr)},get markerScope(){return r().id},get terminalGap(){return A(H)},motionDelay:0,onmotionchange:Ia}),$e(gr),To(1,gr,()=>xe,()=>({duration:st})),To(2,gr,()=>xe,()=>({duration:Tt})),ge(or,gr)});var dr=We(Qe);ya(dr,17,()=>A(It),or=>or.id,(or,Ae)=>{var Mr=Ko(),Nr=ui(Mr);{var gr=jr=>{const Ni=Dt(()=>A(ie).get(A(Ae).id)),Ps=Dt(()=>A(at)!==null&&!A(Ft).has(A(Ae).id)||A(ut)!==null&&!A(Z).has(A(Ae).id)||A(Wt)&&A($t)!==null&&!A($t).has(A(Ae).id));var yi=s4();let xc;var iC=qe(yi);{var oC=Yo=>{qC(Yo,{get content(){return A(Ae).label},side:"top",class:"edge-label-tooltip",trigger:bc=>{var Oa=Rp(),sC=qe(Oa),nC=Tr(sC,!0);$e(Oa),cr(()=>{fe(Oa,"aria-label",A(Ae).label),br(nC,A(Ae).label)}),ge(bc,Oa)},$$slots:{trigger:!0}})},aC=Yo=>{var En=Rp(),bc=qe(En),Oa=Tr(bc,!0);$e(En),cr(()=>br(Oa,A(Ae).label)),ge(Yo,En)};yr(iC,Yo=>{A(Ni).truncated?Yo(oC):Yo(aC,-1)})}$e(yi),cr(Yo=>{fe(yi,"x",A(Ni).x),fe(yi,"y",A(Ni).y),fe(yi,"width",A(Ni).width),fe(yi,"height",A(Ni).height),xc=co(yi,0,`edge-label-container diagram-geometry-motion ${A(Ps)?"edge-label-dimmed":""}`,null,xc,{"edge-label-entry":Yo}),fe(yi,"data-edge-id",A(Ae).id),fe(yi,"data-semantic-style",A(Ae).semanticStyle??"default"),fe(yi,"data-truncated",A(Ni).truncated)},[()=>A(K)&&A(vt).includes(A(Ae).id)]),To(2,yi,()=>Is,()=>({duration:y(xt/2)})),ge(jr,yi)},pr=Dt(()=>A(Ae).label&&A(ie).has(A(Ae).id));yr(Nr,jr=>{A(pr)&&jr(gr)})}ge(or,Mr)});var Er=We(dr);ya(Er,17,()=>A(Le),or=>or.id,(or,Ae)=>{const Mr=Dt(()=>A(at)!==null&&!A(Ct).has(A(Ae).id)||A(ut)!==null&&!A(wt).has(A(Ae).id)||A(Wt)&&A(St)!==null&&!A(St).has(A(Ae).id)),Nr=Dt(()=>A(St)!==null&&A(St).has(A(Ae).id));var gr=n4(),pr=qe(gr);Y1(pr,{get node(){return A(Ae)},get editable(){return o()},get styleConfig(){return A(Q)},get dimmed(){return A(Mr)},get highlighted(){return A(Nr)},onMove:(jr,Ni)=>U1(A(Ae).id,jr,Ni),onHover:jr=>gt(at,jr,!0),get onBindingClick(){return s()}}),$e(gr),cr(()=>{fe(gr,"data-node-id",A(Ae).id),fe(gr,"x",A(Ae).x),fe(gr,"y",A(Ae).y),fe(gr,"width",A(Ae).width),fe(gr,"height",A(Ae).height)}),To(1,gr,()=>Is,()=>({delay:0,duration:A(K)?y(st):0,easing:Uu})),To(2,gr,()=>Is,()=>({duration:y(xt)})),ge(or,gr)}),$e(ci),cr(()=>{fe(ci,"transform",A(Pa)),Bi=Xa(ci,"",Bi,{transform:A(li)})}),ge(Ci,ci)}),$e(Qt),$e(bt),cr(()=>{Nt=Xa(bt,"",Nt,{width:A(z)?`max(100%, ${A(Cr)+16}px)`:`${A(Cr)}px`,height:A(z)?`max(100%, ${A(lr)}px)`:`${A(Fr)}px`}),fe(Qt,"width",A(Jt)),fe(Qt,"height",A(tr)+6),te=Xa(Qt,"",te,{top:A(z)?`${A($r)/2}px`:void 0,transform:A(Te)}),fe(le,"id",`arrowhead-${r().id??""}`),fe(oe,"id",`arrowhead-danger-${r().id??""}`),fe(ae,"id",`arrowhead-success-${r().id??""}`),fe(pe,"id",`arrowhead-warning-${r().id??""}`),fe(be,"id",`arrowhead-muted-${r().id??""}`),fe(ye,"id",`arrowhead-inactive-${r().id??""}`),fe(Rr,"id",`arrowhead-highlighted-${r().id??""}`),fe(Ti,"id",`arrowhead-active-${r().id??""}`)}),ge(nt,bt)};yr(K1,nt=>{A(S)?nt(Q1):r().model.nodes.length===0?nt(J1,1):nt(tC,-1)})}$e(Co),no(Co,nt=>gt(v,nt),()=>A(v));var eC=We(Co,2);{var rC=nt=>{var bt=h4(),Nt=qe(bt);G1(Nt,{get states(){return r().states},get currentStateId(){return A(R)},onStateChange:yc}),$e(bt),ge(nt,bt)};yr(eC,nt=>{!A(S)&&r().model.nodes.length>0&&r().states&&r().states.length>0&&nt(rC)})}return $e(Qi),no(Qi,nt=>gt(Xt,nt),()=>A(Xt)),cr((nt,bt,Nt,Qt,te,At,le,oe)=>{Ou=co(Qi,1,"diagram-renderer svelte-10vg205",null,Ou,{"has-content":nt,"compact-diagram":A(j),"fitted-diagram":A(T),"stateful-diagram":bt,"camera-stage":A(ft)==="camera",resizing:A(f)}),fe(Qi,"data-diagram-intrinsic-width",A(hr)),Du=Xa(Qi,`--diagram-edge-label-font-size: ${Fi.fontSize}px;
340
+ `,onmousedown:p,onclick:$,onmouseenter:Y,onmouseleave:X,onfocus:z,onblur:U}),void 0,void 0,void 0,"svelte-u4m0nr");var j=DE(),V=qe(j),Q=qe(V),rt=qe(Q);fa(rt,()=>A(k),(Ot,Pt)=>{Pt(Ot,{size:14,weight:"regular",get"data-icon"(){return A(T).name},"data-weight":"regular","aria-hidden":"true"})}),$e(Q);var ht=We(Q,2),H=qe(ht),G=qe(H);{var K=Ot=>{var Pt=Ko(),Mt=ui(Pt);ya(Mt,17,()=>A(E),ju,(Bt,Rt,we)=>{var qt=EE(),ue=ui(qt),Ee=Tr(ue,!0),ke=We(ue);{var Se=_t=>{var Xt=Op();ge(_t,Xt)};yr(ke,_t=>{we<A(E).length-1&&_t(Se)})}cr(()=>br(Ee,A(Rt))),ge(Bt,qt)}),ge(Ot,Pt)},tt=Ot=>{var Pt=Ko(),Mt=ui(Pt);ya(Mt,17,()=>pc(r().label),ju,(Bt,Rt)=>{en();var we=IE(),qt=ui(we,!0),ue=We(qt);{var Ee=Se=>{var _t=PE();ge(Se,_t)},ke=Se=>{var _t=Op();ge(Se,_t)};yr(ue,Se=>{A(Rt).hardBreak?Se(Ee):A(Rt).breakAfter&&Se(ke,1)})}cr(()=>br(qt,A(Rt).text)),ge(Bt,we)}),ge(Ot,Pt)};yr(G,Ot=>{A(E)?Ot(K):Ot(tt,-1)})}$e(H),zC(H,(Ot,Pt)=>jC?.(Ot,Pt),()=>r().label);var ot=We(H,2);{var vt=Ot=>{var Pt=OE(),Mt=Tr(Pt,!0);cr(()=>br(Mt,r().kind)),ge(Ot,Pt)};yr(ot,Ot=>{r().kind&&Ot(vt)})}$e(ht),$e(V),$e(j),ge(P,j)}),ge(e,R),qo(F)}var RE=pi('<circle class="edge-origin" r="1.5" aria-hidden="true"></circle>'),NE=pi('<g><defs><mask maskUnits="userSpaceOnUse" maskContentUnits="userSpaceOnUse" style="mask-type: alpha;"><path class="edge-reveal-mask-path" pathLength="1" fill="none" stroke="white" stroke-linecap="round" stroke-linejoin="round"></path></mask></defs><g><path class="edge-path" vector-effect="non-scaling-stroke"></path><!></g></g>');function X1(e,t){if(new.target)return Oo({component:X1,...e});No(t,!0);let r=He(t,"edge",7),i=He(t,"dimmed",7,!1),o=He(t,"highlighted",7,!1),a=He(t,"markerScope",7,""),s=He(t,"terminalGap",7,0),n=He(t,"motionDelay",7,0),l=He(t,"onmotionchange",7),c=ce(""),h=ce(1),d=[],u="",f,g="",p,m=Dt(()=>`edge-reveal-${a()}-${r().id}`),y=Dt(()=>{A(c);const z=[...r().points??[],...d],U=Math.max(16,s()*3),j=z.map(G=>G.x),V=z.map(G=>G.y),Q=j.length>0?Math.min(...j):0,rt=V.length>0?Math.min(...V):0,ht=j.length>0?Math.max(...j):1,H=V.length>0?Math.max(...V):1;return{x:Q-U,y:rt-U,width:Math.max(1,ht-Q)+U*2,height:Math.max(1,H-rt)+U*2}});function x(z,U){if(z.length<2||U<=0)return z;const j=z.map(ht=>({...ht})),V=j.at(-1),Q=j.at(-2),rt=Math.hypot(V.x-Q.x,V.y-Q.y);return rt<=U?z:(V.x-=(V.x-Q.x)/rt*U,V.y-=(V.y-Q.y)/rt*U,j)}function b(z){pl(()=>l()?.(r().id,z))}function S(z){return p?.ownerSVGElement?.querySelector(`[data-node-id="${CSS.escape(z)}"]`)}function T(z){if(!z)return null;const U=getComputedStyle(z),j=(V,Q)=>{const rt=Number.parseFloat(U.getPropertyValue(V));return Number.isFinite(rt)?rt:Q};return{x:j("x",z.x.baseVal.value),y:j("y",z.y.baseVal.value),width:j("width",z.width.baseVal.value),height:j("height",z.height.baseVal.value)}}function k(z,U,j=0){if(!U)return z;const V=U.x+U.width/2,Q=U.y+U.height/2,rt=U.width/2,ht=U.height/2,H=z.x-V,G=z.y-Q;if(Math.hypot(H,G)<.001)return z;const tt=Math.abs(H)<.001?1/0:rt/Math.abs(H),ot=Math.abs(G)<.001?1/0:ht/Math.abs(G);return tt<=ot?{x:V+Math.sign(H)*(rt+j),y:Q+G*tt}:{x:V+H*ot,y:Q+Math.sign(G)*(ht+j)}}function _(z,U,j){const V=1-j;return 3*V*V*j*z+3*V*j*j*U+j**3}function L(z){let U=0,j=1,V=z;for(let Q=0;Q<12;Q+=1)_(.16,.3,V)<z?U=V:j=V,V=(U+j)/2;return _(1,1,V)}function v(z,U){if(z.length<2)return Array.from({length:U},()=>z[0]??{x:0,y:0});const j=z.slice(1).map((Q,rt)=>Math.hypot(Q.x-z[rt].x,Q.y-z[rt].y)),V=j.reduce((Q,rt)=>Q+rt,0);return Array.from({length:U},(Q,rt)=>{let ht=V*rt/(U-1),H=0;for(;H<j.length-1&&ht>j[H];)ht-=j[H],H+=1;const G=z[H],K=z[H+1],tt=j[H]?ht/j[H]:0;return{x:G.x+(K.x-G.x)*tt,y:G.y+(K.y-G.y)*tt}})}Bo(()=>{const z=x(r().points??[],s()),U=s()>0?Cn(z):r().path;if(rn()||u===U&&f===r()||d.length<2||z.length<2){gt(c,U,!0),d=z,u=U,f=r(),g=r().id,gt(h,1),b(!1);return}const V=v(d,24),Q=v(z,24),rt=g===r().id,ht=d[0],H=d[d.length-1],G=z[0],K=z[z.length-1],tt=S(r().from),ot=S(r().to),vt=rt&&Math.abs(G.x-ht.x-(K.x-H.x))<1&&Math.abs(G.y-ht.y-(K.y-H.y))<1;u=U,f=r(),g=r().id;let Ot=0,Pt;gt(h,0),b(!0);const Mt=we=>{const ue=Math.max(0,Math.min(1,(we-Bt)/220)),Ee=L(ue),ke=V.map((Se,_t)=>({x:Se.x+(Q[_t].x-Se.x)*Ee,y:Se.y+(Q[_t].y-Se.y)*Ee}));vt&&(ke[0]=z[0],ke[ke.length-1]=z[z.length-1]),ke[0]=k(ke[0],T(tt)),ke[ke.length-1]=k(ke[ke.length-1],T(ot),s()),d=ke,gt(h,ue,!0),gt(c,Cn(ke),!0),ue<1?Ot=requestAnimationFrame(Mt):(gt(c,U,!0),d=z,gt(h,1),b(!1))};let Bt;const Rt=()=>{Bt=performance.now(),Ot=requestAnimationFrame(Mt)};return n()>0?Pt=window.setTimeout(Rt,n()):Rt(),()=>{Pt!==void 0&&window.clearTimeout(Pt),cancelAnimationFrame(Ot),b(!1)}});let M=Dt(()=>{const z=["diagram-edge"];return r().semanticStyle&&z.push(`edge-${r().semanticStyle}`),r().animated&&z.push("edge-animated"),r().dashed&&z.push("edge-dashed"),i()&&z.push("edge-dimmed"),o()&&z.push("edge-state-highlighted"),z.join(" ")});const B=new Set(["danger","success","warning","muted","inactive","highlighted","active"]);let E=Dt(()=>a()?`-${a()}`:""),O=Dt(()=>r().semanticStyle&&B.has(r().semanticStyle)?`url(#arrowhead-${r().semanticStyle}${A(E)})`:`url(#arrowhead${A(E)})`);var $={get edge(){return r()},set edge(z){r(z),_e()},get dimmed(){return i()},set dimmed(z=!1){i(z),_e()},get highlighted(){return o()},set highlighted(z=!1){o(z),_e()},get markerScope(){return a()},set markerScope(z=""){a(z),_e()},get terminalGap(){return s()},set terminalGap(z=0){s(z),_e()},get motionDelay(){return n()},set motionDelay(z=0){n(z),_e()},get onmotionchange(){return l()},set onmotionchange(z){l(z),_e()},$set:Do,$on:(z,U)=>Ro(t,z,U)},I=NE(),F=qe(I),R=qe(F),q=Tr(R);$e(F);var D=We(F),P=qe(D),Y=We(P);{var X=z=>{var U=RE();cr(()=>{fe(U,"cx",r().points[0].x),fe(U,"cy",r().points[0].y)}),ge(z,U)};yr(Y,z=>{(r().animated||r().dashed)&&r().points?.[0]&&z(X)})}return $e(D),$e(I),no(I,z=>p=z,()=>p),cr(z=>{co(I,0,Wp(A(M))),fe(I,"data-edge-id",r().id),fe(I,"data-edge-from",r().from),fe(I,"data-edge-to",r().to),fe(I,"data-edge-motion-progress",A(h)),fe(R,"id",A(m)),fe(R,"x",A(y).x),fe(R,"y",A(y).y),fe(R,"width",A(y).width),fe(R,"height",A(y).height),fe(q,"d",A(c)),fe(q,"stroke-width",z),fe(D,"mask",`url(#${A(m)})`),fe(P,"d",A(c)),fe(P,"marker-end",A(O))},[()=>Math.max(12,s()*3)]),ge(e,I),qo($)}var qE=pi('<g><rect class="group-bg"></rect><text text-anchor="middle" dominant-baseline="middle" class="group-label"> </text></g>');function j1(e,t){if(new.target)return Oo({component:j1,...e});No(t,!0);let r=He(t,"group",7),i=He(t,"dimmed",7,!1),o=He(t,"onHover",7),a=Dt(()=>{const f=["diagram-group"];return r().semanticStyle&&f.push(`group-${r().semanticStyle}`),i()&&f.push("group-dimmed"),f.join(" ")});function s(){o()?.(r().id)}function n(){o()?.(null)}var l={get group(){return r()},set group(f){r(f),_e()},get dimmed(){return i()},set dimmed(f=!1){i(f),_e()},get onHover(){return o()},set onHover(f){o(f),_e()},$set:Do,$on:(f,g)=>Ro(t,f,g)},c=qE(),h=qe(c),d=We(h),u=Tr(d,!0);return $e(c),cr(()=>{co(c,0,Wp(A(a))),fe(c,"data-group-id",r().id),fe(h,"x",r().x),fe(h,"y",r().y),fe(h,"width",r().width),fe(h,"height",r().height),fe(d,"x",r().x+r().width/2),fe(d,"y",r().y+Sa.centerY),br(u,r().label)}),ml("mouseenter",c,s),ml("mouseleave",c,n),ge(e,c),qo(l)}var WE=ar('<div class="narrative-title svelte-1v8paz2"> </div>'),zE=ar('<div class="narrative-text svelte-1v8paz2"> </div>'),HE=ar('<div class="narrative svelte-1v8paz2"><!> <!></div>'),YE=ar('<div class="text-xs font-medium mb-0.5"> </div>'),XE=ar('<div class="text-ui text-subtle leading-snug"> </div>'),jE=ar('<div class="p-2.5"><!> <!></div>'),GE=ar("<!> <!>",1),UE=ar('<div class="navigation-buttons svelte-1v8paz2"><!> <!></div>'),VE=ar('<div class="diagram-controls svelte-1v8paz2"><div class="controls-inner svelte-1v8paz2"><div class="narrative-region svelte-1v8paz2" aria-live="polite" aria-atomic="true"><!></div> <div class="state-navigation svelte-1v8paz2" role="group"><div class="stepper svelte-1v8paz2"></div> <span class="step-counter svelte-1v8paz2"> </span> <!></div></div></div>');function G1(e,t){if(new.target)return Oo({component:G1,...e});No(t,!0);let r=He(t,"states",7),i=He(t,"currentStateId",7),o=He(t,"onStateChange",7);function a($){return $?typeof $=="string"?{text:$}:$:null}let s=Dt(()=>i()?r().findIndex($=>$.id===i()):-1),n=Dt(()=>A(s)>=0?r()[A(s)]:null),l=ce(-1),c=Dt(()=>A(l)<A(s)?"left":"right"),h=ce(null),d=ce(null),u;function f(){gt(l,A(s),!0),A(s)>0&&o()(r()[A(s)-1].id)}function g(){gt(l,A(s),!0),A(s)<r().length-1&&o()(r()[A(s)+1].id)}function p($){gt(l,A(s),!0),gt(h,null),o()(r()[$].id)}function m($){u!==void 0&&cancelAnimationFrame(u);const I=r()[$]?.id,F=r(),R=A(d);u=requestAnimationFrame(()=>{u=void 0,!(R!==A(d)||I!==i()||F!==r())&&A(d)?.querySelector(`[data-diagram-step-index="${$}"]`)?.focus({preventScroll:!0})})}function y($,I){if(r().length<=1)return;let F=I;if($.key==="ArrowLeft")F=Math.max(0,I-1);else if($.key==="ArrowRight")F=Math.min(r().length-1,I+1);else if($.key==="Home")F=0;else if($.key==="End")F=r().length-1;else return;$.preventDefault(),F!==I&&(p(F),m(F))}Np(()=>{u!==void 0&&cancelAnimationFrame(u)});var x={get states(){return r()},set states($){r($),_e()},get currentStateId(){return i()},set currentStateId($){i($),_e()},get onStateChange(){return o()},set onStateChange($){o($),_e()},$set:Do,$on:($,I)=>Ro(t,$,I)},b=VE(),S=qe(b),T=qe(S),k=qe(T);{var _=$=>{const I=Dt(()=>a(A(n).narrative));var F=Ko(),R=ui(F);Hp(R,()=>A(s),q=>{var D=HE(),P=qe(D);{var Y=U=>{var j=WE(),V=Tr(j,!0);cr(()=>br(V,A(I).title)),ge(U,j)};yr(P,U=>{A(I)?.title&&U(Y)})}var X=We(P,2);{var z=U=>{var j=zE(),V=Tr(j,!0);cr(()=>br(V,A(I).text)),ge(U,j)};yr(X,U=>{A(I)?.text&&U(z)})}$e(D),To(1,D,()=>Gu,()=>({axis:"x",distance:A(c)==="left"?8:-8,tier:"fast"})),To(2,D,()=>Gu,()=>({axis:"x",distance:A(c)==="left"?-8:8,tier:"fast"})),ge(q,D)}),ge($,F)};yr(k,$=>{A(n)?.narrative&&$(_)})}$e(T);var L=We(T,2),v=qe(L);ya(v,23,r,$=>$.id,($,I,F)=>{const R=Dt(()=>a(A(I).narrative));var q=GE(),D=ui(q);{let X=Dt(()=>A(F)===A(s)?"active":""),z=Dt(()=>A(F)<A(s)?"completed":""),U=Dt(()=>A(F)===A(s)?"step":void 0),j=Dt(()=>A(F)===A(s)?0:-1),V=Dt(()=>je.diagram_controls_state_ariaLabel({number:A(F)+1,title:A(R)?.title||je.diagram_controls_stateNumber_label({number:A(F)+1})}));Ja(D,{variant:"ghost",size:"icon-compact",iconOnly:!0,get class(){return`stepper-dot ${A(X)??""} ${A(z)??""}`},get"data-diagram-step-index"(){return A(F)},get style(){return`anchor-name: --segment-${A(F)??""};`},onclick:()=>p(A(F)),onkeydown:Q=>y(Q,A(F)),onmouseenter:()=>gt(h,A(F),!0),onmouseleave:()=>gt(h,null),get"aria-current"(){return A(U)},get tabindex(){return A(j)},get"aria-label"(){return A(V)}})}var P=We(D,2);{var Y=X=>{YC(X,{get anchor(){return`--segment-${A(F)??""}`},position:"top",class:"rounded-md !pointer-events-none",children:(z,U)=>{var j=jE(),V=qe(j);{var Q=H=>{var G=YE(),K=Tr(G,!0);cr(()=>br(K,A(R).title)),ge(H,G)};yr(V,H=>{A(R).title&&H(Q)})}var rt=We(V,2);{var ht=H=>{var G=XE(),K=Tr(G,!0);cr(()=>br(K,A(R).text)),ge(H,G)};yr(rt,H=>{A(R).text&&H(ht)})}$e(j),ge(z,j)},$$slots:{default:!0}})};yr(P,X=>{A(h)===A(F)&&A(R)&&X(Y)})}ge($,q)}),$e(v);var M=We(v,2),B=Tr(M),E=We(M,2);{var O=$=>{var I=UE(),F=qe(I);{let q=Dt(()=>A(s)<=0),D=Dt(()=>je.diagram_controls_previousStep_ariaLabel());Ja(F,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"diagram-nav-button",onclick:f,get disabled(){return A(q)},get"aria-label"(){return A(D)},children:(P,Y)=>{dn(P,{get icon(){return EC},class:"text-ui"})},$$slots:{default:!0}})}var R=We(F,2);{let q=Dt(()=>A(s)>=r().length-1),D=Dt(()=>je.diagram_controls_nextStep_ariaLabel());Ja(R,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"diagram-nav-button",onclick:g,get disabled(){return A(q)},get"aria-label"(){return A(D)},children:(P,Y)=>{dn(P,{get icon(){return PC},class:"text-ui"})},$$slots:{default:!0}})}$e(I),ge($,I)};yr(E,$=>{r().length>1&&$(O)})}return $e(L),no(L,$=>gt(d,$),()=>A(d)),$e(S),$e(b),cr(($,I)=>{fe(L,"aria-label",$),fe(M,"aria-label",I),br(B,`${A(s)+1}/${r().length??""}`)},[()=>je.diagram_controls_walkthrough_ariaLabel(),()=>je.diagram_controls_stepCounter_ariaLabel({current:A(s)+1,total:r().length})]),ge(e,b),qo(x)}function Mh(e,t){const r=new Set(e),i=new Set(t);return{shared:t.filter(o=>r.has(o)),departing:e.filter(o=>!i.has(o)),entering:t.filter(o=>!r.has(o))}}function Dp(e){const t=e.match(/-?(?:\d+(?:\.\d*)?|\.\d+)/g)?.map(Number);return t?.every(Number.isFinite)?t:null}function ZE(e,t){if(e===t)return!0;const r=Dp(e),i=Dp(t);return r!==null&&i!==null&&r.length===i.length&&r.every((o,a)=>Math.abs(o-i[a])<.001)}function KE(e,t){return ZE(e,t)?[]:[{transform:e},{transform:t}]}function QE(e,t,r,i,o){const a=t.x-e.x,s=t.y-e.y,n=Math.hypot(a,s),l=Math.abs(a)>=Math.abs(s)?r.width:r.height;if(n<=l+2*o)return[];const c=(l/2+o)/n,h=1-c,d=[];for(const g of i){const p=g.padding??0,m=[[e.x,a,g.x-r.width/2-p,g.x+g.width+r.width/2+p],[e.y,s,g.y-r.height/2-p,g.y+g.height+r.height/2+p]];let y=c,x=h;for(const[b,S,T,k]of m)if(S===0)(b<T||b>k)&&(x=-1);else{const _=(T-b)/S,L=(k-b)/S;y=Math.max(y,Math.min(_,L)),x=Math.min(x,Math.max(_,L))}y<=x&&d.push([y,x])}d.sort((g,p)=>g[0]-p[0]);const u=[];let f=c;for(const[g,p]of d)g>f&&u.push((f+g)/2),f=Math.max(f,p);return f<h&&u.push((f+h)/2),u}function JE(e,t){return(e===null||typeof e!="object"&&typeof e!="function")&&Object.is(e,t)}function ua(e,t,r=[]){const i=Reflect.ownKeys(e);return i.length===Reflect.ownKeys(t).length&&i.every(o=>Object.hasOwn(t,o)&&(r.includes(o)||JE(Reflect.get(e,o),Reflect.get(t,o))))}function tl(e,t,r){return e===void 0&&t===void 0||!!e&&!!t&&e.length===t.length&&e.every((i,o)=>r(i,t[o]))}function t4(e,t){return e!==null&&ua(e,t,["nodes","edges","groups","bounds"])&&ua(e.bounds,t.bounds)&&tl(e.nodes,t.nodes,(r,i)=>ua(r,i,["size"])&&(r.size===void 0&&i.size===void 0||!!r.size&&!!i.size&&ua(r.size,i.size)))&&tl(e.edges,t.edges,(r,i)=>ua(r,i,["points"])&&tl(r.points,i.points,ua))&&tl(e.groups,t.groups,ua)}var e4=ar('<div class="diagram-actions svelte-10vg205" role="toolbar"><!></div>'),r4=ar('<div class="diagram-feedback svelte-10vg205" role="alert"><strong class="svelte-10vg205"> </strong> <span> </span></div>'),i4=ar('<div class="diagram-feedback svelte-10vg205" role="status"><strong class="svelte-10vg205"> </strong> <span> </span></div>'),o4=pi("<g><!></g>"),a4=pi('<g class="edge-reveal"><!></g>'),Rp=ar('<div class="edge-label-html"><span class="edge-label-text"> </span></div>'),s4=pi("<foreignObject><!></foreignObject>"),n4=pi('<foreignObject class="diagram-geometry-motion svelte-10vg205"><!></foreignObject>'),l4=pi('<g class="diagram-geometry-motion svelte-10vg205"><!><!><!><!></g>'),c4=ar('<div class="diagram-content svelte-10vg205"><svg class="diagram-svg-layer svelte-10vg205"><defs><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker><marker markerWidth="7" markerHeight="7" refX="6.5" refY="3.5" orient="auto" markerUnits="userSpaceOnUse"><path d="M 3.5 0.5 L 6.5 3.5 L 3.5 6.5" fill="none" stroke="context-stroke" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke"></path></marker></defs><!></svg></div>'),h4=ar('<div class="diagram-footer svelte-10vg205"><!></div>'),d4=ar("<div><!> <div><!></div> <!></div>");function u4(e,t){if(new.target)return Oo({component:u4,...e});No(t,!0);let r=He(t,"diagram",7),i=He(t,"onUpdate",7),o=He(t,"editable",7,!1),a=He(t,"styleConfig",7,Gi),s=He(t,"onBindingClick",7),n=He(t,"viewResetKey",7);const l=32,c=12,h=10,d=5,u=.5;let f=ce(!1),g=ce(0),p,m;function y(nt){return A(f)||rn(A(v)?.ownerDocument)?0:nt}let x=ce(null),b=null,S=ce(!1),T=ce(!1),k=ce(1),_=ce(900),L=ce(900),v=ce(null),M=ce(null),B=ce(null),E=ce(void 0),O=ce(!1),$,I,F=ce(0);hd(()=>{let nt=!1;return document.fonts?.ready.then(()=>{nt||gt(F,A(F)+1)}),()=>{nt=!0}});let R=ce(wi(r().currentStateId??(r().states&&r().states.length>0?r().states[0].id:void 0))),q=Dt(()=>r().states?.find(nt=>nt.id===A(R))??null),D=ce(wi(A(R))),P,Y=Dt(()=>r().states?.find(nt=>nt.id===A(D))??A(q)),X=Dt(()=>A(q)?.camera?.zoom??1),z=Dt(()=>A(q)!==null),U=Dt(()=>A(M)!==null&&A(M)>0?A(M):A(v)?.clientWidth??null),j=Dt(()=>A(L)<500||A(z)&&(A(B)??A(U)??0)>0&&(A(B)??A(U)??0)<500),V=Dt(()=>A(j)?4:l),Q=Dt(()=>A(j)?{...a(),maxWidth:Math.min(a().maxWidth,150),maxLines:Math.max(a().maxLines,5),paddingX:Math.min(a().paddingX,10)}:a()),rt=Dt(()=>A(X)*(A(T)||A(z)?A(k):1)),ht=Dt(()=>Math.max(c/A(Q).labelFontSize,h/(a()===Gi?11:A(Q).kindFontSize))),H=Dt(()=>(d+u)/A(rt)),G=Dt(()=>8/A(rt)),K=ce(!1),tt=ce(wi([])),ot=ce(wi([])),vt=ce(wi([])),Ot=ce(wi([])),Pt=ce(wi([])),Mt=ce(wi([])),Bt=ce(wi(new Map)),Rt=ce(wi([])),we=ce(wi([])),qt=ce(wi([])),ue=ce(wi(new Map)),Ee=ce(!1),ke=ce(!1),Se=ce(!0);const _t=new Set;let Xt=ce(void 0),w=ce(!0),J=0,dt,mt=0,ft=ce("settled"),N=[];const et=180,it="cubic-bezier(0.65, 0, 0.35, 1)",ct=220,xt=160,Tt=180,st=180,kt=60,jt=st-kt;function re(){const nt=A(Xt)?.querySelector(".diagram-svg-layer"),Nt=A(Xt)?.querySelector(".diagram-geometry-motion")?.getScreenCTM?.();return{camera:nt?getComputedStyle(nt).transform:null,screenMatrix:Nt?new DOMMatrix([Nt.a,Nt.b,Nt.c,Nt.d,Nt.e,Nt.f]):null}}function Kt(nt){if(y(1)===0||!A(Xt))return[];const bt=A(Xt).querySelector(".diagram-svg-layer"),Nt=A(Xt).querySelector(".diagram-svg-layer > g");if(!bt||!Nt||!nt.camera)return[];for(const ae of bt.getAnimations({subtree:!1}))ae.cancel();const Qt=getComputedStyle(bt).transform;let te=nt.camera;const At=nt.screenMatrix?bt.getScreenCTM():null;if(At&&nt.screenMatrix){const ae=new DOMMatrix([At.a,At.b,At.c,At.d,At.e,At.f]),pe=new DOMMatrix(getComputedStyle(Nt).transform);te=new DOMMatrix(Qt).multiply(ae.inverse()).multiply(nt.screenMatrix).multiply(pe.inverse()).toString()}const le=KE(te,Qt);if(le.length===0)return[];const oe=bt.animate(le,{duration:et,easing:it});return oe.finished.catch(()=>{}),[oe]}function xe(nt,{delay:bt=0,duration:Nt}){return{delay:bt,duration:y(Nt),easing:Uu,css:Qt=>`--edge-reveal-progress: ${Qt};`}}function Pe(){return A(Xt)?.getAnimations?A(Xt).getAnimations({subtree:!0}).filter(nt=>{const bt=Number(nt.effect?.getComputedTiming().endTime);return Number.isFinite(bt)&&nt.playState!=="finished"&&nt.playState!=="idle"}):[]}async function mi(nt){if(await Th(),await new Promise(Nt=>requestAnimationFrame(()=>Nt())),nt!==mt)return!1;const bt=Pe();return await Promise.allSettled(bt.map(Nt=>Nt.finished)),nt===mt}async function xo(nt,bt,Nt){if(Nt.length>0&&(await Promise.allSettled(Nt.map(te=>te.finished)),nt!==mt)||A(Rt).length===0&&A(zt).length>0&&(gt(ft,"scene"),gt(Se,!0),_e(),!await mi(nt))||(gt(ft,"exit"),gt(Ee,!1),gt(ke,!1),gt(D,bt,!0),_e(),!await mi(nt)))return;const Qt=re();gt(Ot,[],!0),gt(Pt,[],!0),gt(Mt,[],!0),gt(Bt,new Map,!0),gt(Rt,[],!0),gt(we,[],!0),gt(qt,[],!0),gt(ue,new Map,!0),gt(ft,"camera"),_e(),N=Kt(Qt),await mi(nt)&&(gt(ft,"scene"),gt(Se,!0),_e())}function bo(){if(!A(Xt))return"";const nt=A(Xt).getBoundingClientRect(),bt=[".diagram-content",".diagram-svg-layer",".diagram-geometry-motion","[data-group-id]",".group-bg",".group-label",".diagram-edge",".edge-path",".edge-label-container","[data-node-id]",".diagram-node-html"].join(",");return[...A(Xt).querySelectorAll(bt)].map(Nt=>{const Qt=Nt.getBoundingClientRect(),te=getComputedStyle(Nt);return[Nt.tagName,Nt.getAttribute("data-node-id"),Nt.getAttribute("data-edge-id"),Nt.getAttribute("data-group-id"),Nt.getAttribute("class"),Nt.getAttribute("d"),(Qt.x-nt.x).toFixed(3),(Qt.y-nt.y).toFixed(3),Qt.width.toFixed(3),Qt.height.toFixed(3),te.opacity,te.transform].join("|")}).join(`
341
+ `)}function $s(nt,bt){dt=requestAnimationFrame(()=>{if(nt!==J)return;I?.();const Nt=bo(),Qt=A(ft)==="camera"||A(ft)==="exit"||_t.size>0||Pe().length>0;if(!Qt&&bt!==void 0&&Nt===bt){if(A(K)){gt(K,!1),dt=void 0,Th().then(()=>{nt===J&&$s(nt)});return}gt(w,!0),gt(ft,"settled"),Xr(),dt=void 0;return}$s(nt,Qt?void 0:Nt)})}function Es(){J+=1;const nt=J;dt!==void 0&&cancelAnimationFrame(dt),dt=void 0,y(1)===0&&gt(K,!1),gt(w,!1),queueMicrotask(()=>{nt===J&&$s(nt)})}Np(()=>{Xr(),mt+=1,J+=1,dt!==void 0&&cancelAnimationFrame(dt),p!==void 0&&cancelAnimationFrame(p),la();for(const nt of N)nt.cancel();N=[],_t.clear()});let at=ce(null),ut=ce(null),Ct=Dt(()=>{if(!A(at))return new Set;const nt=new Set;return nt.add(A(at)),r().model.edges.forEach(bt=>{bt.from===A(at)&&nt.add(bt.to),bt.to===A(at)&&nt.add(bt.from)}),nt}),Ft=Dt(()=>{if(!A(at))return new Set;const nt=new Set;return r().model.edges.forEach(bt=>{(bt.from===A(at)||bt.to===A(at))&&nt.add(bt.id)}),nt}),wt=Dt(()=>{if(!A(ut))return new Set;const nt=new Set;if(r().model.groups){const bt=r().model.groups.find(Nt=>Nt.id===A(ut));bt?.nodeIds&&bt.nodeIds.forEach(Nt=>nt.add(Nt))}return r().model.nodes.forEach(bt=>{bt.group===A(ut)&&nt.add(bt.id)}),nt}),Z=Dt(()=>{if(!A(ut))return new Set;const nt=A(wt),bt=new Set;return r().model.edges.forEach(Nt=>{(nt.has(Nt.from)||nt.has(Nt.to))&&bt.add(Nt.id)}),bt}),St=Dt(()=>A(Y)?.highlightedNodes&&A(Y).highlightedNodes.length>0?new Set(A(Y).highlightedNodes):null),$t=Dt(()=>A(Y)?.highlightedEdges&&A(Y).highlightedEdges.length>0?new Set(A(Y).highlightedEdges):null),Wt=Dt(()=>A(St)!==null||A($t)!==null),Ht=Dt(()=>A(q)?.visibleNodes??r().model.nodes.map(nt=>nt.id)),Vt=Dt(()=>new Set(A(Ht))),de=Dt(()=>A(q)?.visibleEdges??r().model.edges.map(nt=>nt.id)),Me=Dt(()=>A(de).filter(nt=>{const bt=r().model.edges.find(Nt=>Nt.id===nt);return bt&&A(Vt).has(bt.from)&&A(Vt).has(bt.to)})),zt=Dt(()=>A(x)?.nodes.filter(nt=>A(Ht).includes(nt.id))??[]),Fe=Dt(()=>A(x)?.edges.filter(nt=>A(Me).includes(nt.id))??[]),Ze=Dt(()=>{A(F);const nt=new Map,bt=[],Nt=(le,oe,ae,pe,be=0)=>A(zt).some(ye=>!(le+ae+be<ye.x||le-be>ye.x+ye.width||oe+pe+be<ye.y||oe-be>ye.y+ye.height)),Qt=(le,oe,ae,pe,be=6)=>bt.some(ye=>!(le+ae+be<ye.x||le-be>ye.x+ye.width||oe+pe+be<ye.y||oe-be>ye.y+ye.height)),te=(le,oe,ae,pe)=>(A(x)?.groups??[]).some(be=>le<be.x+be.width&&le+ae>be.x&&oe<be.y+34&&oe+pe>be.y),At=(le,oe,ae,pe,be,ye=2)=>A(Fe).some(Rr=>Rr.id!==be&&(Rr.points??[]).slice(0,-1).some((Ti,zo)=>{const Ci=Rr.points[zo+1],ci=Math.max(1,Math.ceil(Math.hypot(Ci.x-Ti.x,Ci.y-Ti.y)/4));for(let Bi=0;Bi<=ci;Bi+=1){const Ho=Ti.x+(Ci.x-Ti.x)*Bi/ci,wr=Ti.y+(Ci.y-Ti.y)*Bi/ci;if(Ho>le-ye&&Ho<le+ae+ye&&wr>oe-ye&&wr<oe+pe+ye)return!0}return!1}));for(const le of A(Fe)){if(!le.label||!le.points||le.points.length<2)continue;const oe=le.points,ae=oe.length===2&&Math.abs(oe[0].x-oe[1].x)<.5?Math.abs(oe[0].y-oe[1].y):void 0,{width:pe,height:be,lines:ye}=di(le.label,A(j)?bn(le.label??"",ae):void 0),Rr=ye>3,Ti=r().model.edges.find(({id:wr})=>wr===le.id),zo=Ti&&r().model.edges.find(wr=>wr.from===Ti.to&&wr.to===Ti.from);if(zo&&oe.length===2){const wr=di(zo.label??"",A(j)?bn(zo.label??""):void 0),Qe=Math.abs(oe[1].x-oe[0].x),dr=Math.abs(oe[1].y-oe[0].y),Er=Math.max(Qe,dr),or=Qe>=dr?(pe+wr.width)/2:(be+wr.height)/2,Ae=A(Me).includes(zo.id)?Math.max(.05,Math.min(.35,(1-(or+6)/Er)/2)):.35,Mr=Qe>=dr?pe:be,Nr=Math.min(.5,(Mr/2+4/A(rt))/Er),gr=Math.max(Nr,Math.min(1-Nr,Ae)),pr=oe[0].x+(oe[1].x-oe[0].x)*gr-pe/2,jr=oe[0].y+(oe[1].y-oe[0].y)*gr-be/2;if(!Nt(pr,jr,pe,be,8)&&!te(pr,jr,pe,be)&&!At(pr,jr,pe,be,le.id)&&!Qt(pr,jr,pe,be,1)){nt.set(le.id,{x:pr,y:jr,width:pe,height:be,truncated:Rr}),bt.push({x:pr,y:jr,width:pe,height:be});continue}}const Ci=[],ci=[],Bi=[],Ho=(wr,Qe,dr,Er=Ci)=>{const or=wr-pe/2,Ae=Qe-be/2;if(Nt(or,Ae,pe,be,8)||te(or,Ae,pe,be)||At(or,Ae,pe,be,le.id))return;const Mr={x:or,y:Ae,score:dr};if(Qt(or,Ae,pe,be)){Qt(or,Ae,pe,be,1)||ci.push(Mr);return}Er.push(Mr)};for(let wr=0;wr<oe.length-1;wr++){const Qe=oe[wr],dr=oe[wr+1],Er=Math.abs(dr.x-Qe.x),or=Math.abs(dr.y-Qe.y),Ae=Math.hypot(Er,or);if(Ae<8)continue;const Mr=Er>=or,Nr=Mr?pe:be,gr=[.5,.25,.75,.2,.3,.4,.6,.7,.8,.125,.875,.05,.1,.15,.85,.9,.95];for(const pr of gr){const jr=Ae*Math.min(pr,1-pr);if(Ae*Math.max(pr,1-pr)<Nr/2+A(G))continue;const Ps=Qe.x+(dr.x-Qe.x)*pr,yi=Qe.y+(dr.y-Qe.y)*pr;Ho(Ps,yi,Ae+(Mr?1e3:0)-Math.abs(pr-.5)*16,jr>=Nr/2+A(G)?Ci:Bi)}}if(!Ci.length&&!ci.length&&!Bi.length){const wr=[...A(zt).map(Qe=>({...Qe,padding:8})),...(A(x)?.groups??[]).map(Qe=>({...Qe,height:34,padding:0})),...bt.map(Qe=>({...Qe,padding:1})),...A(Fe).filter(Qe=>Qe.id!==le.id).flatMap(Qe=>(Qe.points??[]).slice(1).map((dr,Er)=>{const or=Qe.points[Er];return{x:Math.min(or.x,dr.x),y:Math.min(or.y,dr.y),width:Math.abs(dr.x-or.x),height:Math.abs(dr.y-or.y),padding:2}}))];for(let Qe=1;Qe<oe.length;Qe+=1){const dr=oe[Qe-1],Er=oe[Qe],or=Math.hypot(Er.x-dr.x,Er.y-dr.y),Ae=Math.abs(Er.x-dr.x)>=Math.abs(Er.y-dr.y)?1e3:0;for(const Mr of QE(dr,Er,{width:pe,height:be},wr,A(G)))Ho(dr.x+(Er.x-dr.x)*Mr,dr.y+(Er.y-dr.y)*Mr,or+Ae-Math.abs(Mr-.5)*16)}}if(Ci.length>0||ci.length>0||Bi.length>0){const wr=Ci.length>0?Ci:ci.length>0?ci:Bi;wr.sort((dr,Er)=>Er.score-dr.score);const Qe=wr[0];nt.set(le.id,{x:Qe.x,y:Qe.y,width:pe,height:be,truncated:Rr}),bt.push({x:Qe.x,y:Qe.y,width:pe,height:be})}else if(oe.length>=2){const[wr,Qe]=oe.slice(0,-1).map((Mr,Nr)=>[Mr,oe[Nr+1]]).toSorted(([Mr,Nr],[gr,pr])=>Math.hypot(pr.x-gr.x,pr.y-gr.y)-Math.hypot(Nr.x-Mr.x,Nr.y-Mr.y))[0],dr=(wr.x+Qe.x)/2,Er=(wr.y+Qe.y)/2,or=dr-pe/2,Ae=Er-be/2;nt.set(le.id,{x:or,y:Ae,width:pe,height:be,truncated:Rr}),bt.push({x:or,y:Ae,width:pe,height:be})}}return nt}),Le=Dt(()=>{const nt=new Set(A(tt)),bt=A(Se)?A(zt):A(zt).filter(At=>!nt.has(At.id)),Nt=new Map(A(Rt).map(At=>[At.id,At])),Qt=A(Ee)?bt.map(At=>Nt.get(At.id)??At):bt;if(!A(ke))return Qt;const te=new Set(Qt.map(At=>At.id));return[...Qt,...A(Ot).filter(At=>!te.has(At.id))]}),ne=Dt(()=>{const nt=new Set(A(ot)),bt=A(Se)?A(Ie):A(Ie).filter(At=>!nt.has(At.id)),Nt=new Map(A(we).map(At=>[At.id,At])),Qt=A(Ee)?bt.map(At=>Nt.get(At.id)??At):bt;if(!A(ke))return Qt;const te=new Set(Qt.map(At=>At.id));return[...Qt,...A(Pt).filter(At=>!te.has(At.id))]}),It=Dt(()=>{const nt=new Set(A(vt)),bt=A(Se)?A(Fe):A(Fe).filter(At=>!nt.has(At.id)),Nt=new Map(A(qt).map(At=>[At.id,At])),Qt=A(Ee)?bt.map(At=>Nt.get(At.id)??At):bt;if(!A(ke))return Qt;const te=new Set(Qt.map(At=>At.id));return[...Qt,...A(Mt).filter(At=>!te.has(At.id))]}),ie=Dt(()=>{const nt=A(ke)?new Map(A(Bt)):new Map;for(const[bt,Nt]of A(Ze))nt.set(bt,Nt);if(A(Ee))for(const[bt,Nt]of A(ue))nt.set(bt,Nt);return nt}),Ie=Dt(()=>{if(!A(x)?.groups)return[];if(A(q)?.visibleGroups)return A(x).groups.filter(nt=>A(q).visibleGroups.includes(nt.id));if(A(q)?.highlightedNodes&&A(q).highlightedNodes.length>0){const nt=new Set(A(q).highlightedNodes);return A(x).groups.filter(bt=>Array.isArray(bt.nodeIds)&&bt.nodeIds.some(Nt=>nt.has(Nt)))}return A(x).groups.filter(nt=>Array.isArray(nt.nodeIds)&&nt.nodeIds.some(bt=>A(Ht).includes(bt)))});Bo(()=>{A(F);try{const nt=A(q)?r().model.groups?.filter(te=>{if(A(q).visibleGroups)return A(q).visibleGroups.includes(te.id);const At=A(q).highlightedNodes?.length?A(q).highlightedNodes:A(Ht);return te.nodeIds?.some(le=>At.includes(le)&&A(Vt).has(le))}).map(te=>({...te,nodeIds:te.nodeIds?.filter(At=>A(Vt).has(At))})):r().model.groups,bt=new Set(nt?.map(te=>te.id)),Nt=A(q)?{...r().model,nodes:r().model.nodes.filter(te=>A(Vt).has(te.id)).map(te=>te.group&&!bt.has(te.group)?{...te,group:void 0}:te),edges:r().model.edges.filter(te=>A(Me).includes(te.id)),groups:nt}:r().model,Qt=oE(Nt,A(q)?{...r().baseView,layout:{...r().baseView.layout,spacing:Math.min(r().baseView.layout.spacing??80,A(j)?40:56)}}:r().baseView,r().grammar,A(Q),A(_));t4(b,Qt)||(b=Qt,gt(x,Qt,!0)),gt(S,!1),Es()}catch{b=null,gt(x,null),gt(S,!0)}});let ve=Dt(()=>A(q)?.camera?.pan??null),Oe=Dt(()=>A(q)?.camera?.focus??null),Ke=ce(!1);function De(){gt(K,!1),gt(ft,"scene"),gt(Ee,!1),gt(ke,!1),gt(Se,!0),gt(tt,[],!0),gt(ot,[],!0),gt(vt,[],!0),gt(Ot,[],!0),gt(Pt,[],!0),gt(Mt,[],!0),gt(Bt,new Map,!0),gt(Rt,[],!0),gt(we,[],!0),gt(qt,[],!0),gt(ue,new Map,!0),gt(D,A(R),!0)}gC(()=>{const nt=r().id,bt=r().states?.map(Qt=>Qt.id)??[],Nt=r().currentStateId;pl(()=>{if(P===void 0){P=nt;return}const Qt=At=>At===void 0?bt.length===0:bt.includes(At);if(nt===P&&Qt(A(R))&&Qt(A(D)))return;const te=nt===P&&Qt(A(R));P=nt,mt+=1;for(const At of N)At.cancel();N=[],la(),Xr(),_t.clear(),te||gt(R,bt.find(At=>At===Nt)??bt[0],!0),De(),gt(g,A(g)+1)})}),Bo(()=>{if(!A(v))return;const nt=A(v).closest(".node-diagram_block"),bt=nt??A(Xt)??A(v);let Nt=bt.clientWidth;pl(()=>{gt(B,nt?.clientWidth??null,!0),gt(M,A(v).clientWidth,!0),Zi()});const Qt=new ResizeObserver(()=>{if(A(z)&&A(M)!==null&&Math.abs(bt.clientWidth-Nt)>.5){gt(f,!0),Xr(),mt+=1;for(const te of N)te.cancel();N=[],_t.clear(),De()}if(Nt=bt.clientWidth,gt(B,nt?.clientWidth??null,!0),gt(M,A(v).clientWidth,!0),Zi(),_e(),A(f)){gt(g,A(g)+1),_e();for(const te of Pe())te.finish();p!==void 0&&cancelAnimationFrame(p),p=requestAnimationFrame(()=>{gt(f,!1),p=void 0})}});return Qt.observe(A(v)),bt!==A(v)&&Qt.observe(bt),()=>Qt.disconnect()});let Te=Dt(()=>{const nt=A(ve)?.x??0,bt=A(ve)?.y??0;if(A(z))return`scale(${A(rt)}) translate(calc(-50% + ${nt/A(rt)}px), calc(-50% + ${bt/A(rt)}px))`;const Nt=[];return A(ve)&&Nt.push(`translate(${nt}px, ${bt}px)`),A(rt)!==1&&Nt.push(`scale(${A(rt)})`),Nt.length>0?Nt.join(" "):void 0});Bo(()=>{if(!A(Oe)||!A(x)||!A(v))return;const nt=A(x).nodes.find(be=>be.id===A(Oe));if(!nt)return;const bt=A(Ue)??A(x).bounds,Nt=nt.x+nt.width/2-(bt.minX-A(V)),Qt=nt.y+nt.height/2-(bt.minY-A(V)),te=Nt*A(X),At=Qt*A(X),le=A(v).clientWidth,oe=A(v).clientHeight,ae=A(ve)?.x??0,pe=A(ve)?.y??0;A(v).scrollTo({left:Math.max(0,te+ae*A(X)-le/2),top:Math.max(0,At+pe*A(X)-oe/2),behavior:y(1)===0?"auto":"smooth"})});function me(nt=!0){if(!A(x))return null;if(!A(q)){let{minX:ae,minY:pe,maxX:be,maxY:ye}=A(x).bounds;for(const Rr of A(Ze).values())ae=Math.min(ae,Rr.x),pe=Math.min(pe,Rr.y),be=Math.max(be,Rr.x+Rr.width),ye=Math.max(ye,Rr.y+Rr.height);return{minX:ae,minY:pe,maxX:be,maxY:ye,width:be-ae,height:ye-pe}}const bt=nt?[...A(zt),...A(Ot),...A(Rt)]:A(zt),Nt=nt?[...A(Fe),...A(Mt),...A(qt)]:A(Fe),Qt=nt?[...A(Ie),...A(Pt),...A(we)]:A(Ie);if(bt.length===0)return{minX:0,minY:0,maxX:0,maxY:0,width:0,height:0};let te=Math.min(...bt.map(ae=>ae.x)),At=Math.min(...bt.map(ae=>ae.y)),le=Math.max(...bt.map(ae=>ae.x+ae.width)),oe=Math.max(...bt.map(ae=>ae.y+ae.height));for(const ae of Qt)te=Math.min(te,ae.x),At=Math.min(At,ae.y),le=Math.max(le,ae.x+ae.width),oe=Math.max(oe,ae.y+ae.height);for(const ae of Nt)if(ae.points)for(const pe of ae.points)te=Math.min(te,pe.x-4),At=Math.min(At,pe.y-4),le=Math.max(le,pe.x+4),oe=Math.max(oe,pe.y+4);for(const ae of[...A(Ze).values(),...nt?A(Bt).values():[],...nt?A(ue).values():[]])te=Math.min(te,ae.x),At=Math.min(At,ae.y),le=Math.max(le,ae.x+ae.width),oe=Math.max(oe,ae.y+ae.height);return{minX:te,minY:At,maxX:le,maxY:oe,width:le-te,height:oe-At}}let Ue=Dt(()=>me(!0)),Jt=Dt(()=>A(Ue)?A(Ue).width+A(V)*2:800),tr=Dt(()=>A(Ue)?A(Ue).height+A(V)*2:600),Cr=Dt(()=>A(Jt)*A(rt)),hr=Dt(()=>(A(x)?A(Jt)*A(X)*Math.max(1,A(ht)):0)+16),Fr=Dt(()=>(A(tr)+6)*A(rt)),$r=Dt(()=>Math.ceil((A(tr)+6)*A(rt)+20)),lr=Dt(()=>A($r)),ni=Dt(()=>A(z)&&(A(E)!==void 0&&A(lr)>A(E)*.9+1||A(U)!==null&&A(Cr)+16>A(U)+1));function Xr(){gt(O,!1),I=void 0,$?.(),$=void 0}function ti(){if(Xr(),!A(Xt))return;gt(O,!0);const nt=A(Xt),bt=[];for(let At=nt.parentElement;At;At=At.parentElement)/(auto|scroll)/.test(getComputedStyle(At).overflowY)&&bt.push(At);const Nt=document.scrollingElement;Nt&&!bt.includes(Nt)&&bt.push(Nt);const Qt=bt.map(At=>({element:At,value:At.style.getPropertyValue("overflow-anchor"),priority:At.style.getPropertyPriority("overflow-anchor")}));for(const{element:At}of Qt)At.style.setProperty("overflow-anchor","none");const te=()=>{I=void 0};for(const At of["wheel","touchstart","keydown"])window.addEventListener(At,te,{capture:!0,passive:!0});$=()=>{for(const{element:At,value:le,priority:oe}of Qt)le?At.style.setProperty("overflow-anchor",le,oe):At.style.removeProperty("overflow-anchor");for(const At of["wheel","touchstart","keydown"])window.removeEventListener(At,te,!0)},I=()=>{const At=nt.querySelector(".diagram-footer");if(At)for(const le of bt){const oe=le.getBoundingClientRect(),ae=le===Nt?0:Math.max(0,oe.top+le.clientTop),pe=le===Nt?window.innerHeight:Math.min(window.innerHeight,oe.top+le.clientTop+le.clientHeight);if(pe<=ae)continue;const be=At.getBoundingClientRect(),ye=be.height<=pe-ae?be:At.querySelector(".state-navigation").getBoundingClientRect(),Rr=ye.bottom>pe?ye.bottom-pe:ye.top<ae?ye.top-ae:0;Math.abs(Rr)>.5&&le.scrollBy({top:Rr,behavior:"instant"})}}}let li=Dt(()=>A(Ue)?`translate(${-A(Ue).minX+A(V)}px, ${-A(Ue).minY+A(V)}px)`:"translate(0, 0)"),Pa=Dt(()=>A(Ue)?`translate(${-A(Ue).minX+A(V)}, ${-A(Ue).minY+A(V)})`:"translate(0, 0)");function Zi(){if(!A(T)&&!A(z)||!A(v)){gt(k,1);return}const nt=Math.max(1,A(v).clientWidth-16),bt=Math.max(1,(A(B)??A(v).clientWidth)-16),Nt=A(z)?Number.POSITIVE_INFINITY:Math.max(1,A(v).clientHeight-16),Qt=Math.max(1,A(Jt)*A(X)),te=Math.max(1,A(tr)*A(X)),At=A(z)&&bt>=500&&["TB","BT"].includes(r().baseView.layout.direction??"")?500:160;gt(L,Math.max(At,bt/A(ht)-l*2),!0),gt(_,Math.max(At,bt/A(ht)-A(V)*2),!0),gt(k,Math.min(A(B)===null?1.25:Math.max(1,A(ht)),Math.max(A(ht),Math.min(nt/Qt,Nt/te))),!0)}function la(){m!==void 0&&cancelAnimationFrame(m),m=void 0}function Ki(){la(),gt(T,!A(T)),Zi(),m=requestAnimationFrame(()=>{m=void 0,Zi(),A(v)?.scrollTo({left:0,top:0,behavior:y(1)===0?"auto":"smooth"})})}Bo(()=>{A(Jt),A(tr),A(X),(A(T)||A(z))&&Zi()}),Bo(()=>{if(A(Ke)||!A(x)||!A(v))return;const nt=A(v).clientWidth-16;nt<=0||(A(Jt)*A(X)>nt&&(gt(T,!0),Zi()),gt(Ke,!0))});let Di=ce(void 0),Ri=ce(!1);Bo(()=>{const nt=n();if(!A(Ri)){gt(Di,nt,!0),gt(Ri,!0);return}nt!==A(Di)&&(gt(Di,nt,!0),la(),Xr(),gt(T,!1),gt(k,1),A(v)?.scrollTo({left:0,top:0,behavior:"auto"}))});function yc(nt){if(nt===A(R))return;ti();const bt=re();mt+=1;const Nt=mt,Qt=A(Le),te=A(ne),At=A(It),le=new Map(A(ie)),oe=y(1)>0;if(gt(K,oe),gt(ft,oe?"camera":"scene",!0),Es(),oe&&(gt(Ee,!0),gt(Se,!1),gt(ke,!0),gt(Rt,Qt,!0),gt(we,te,!0),gt(qt,At,!0),gt(ue,le,!0),gt(tt,r().model.nodes.map(ae=>ae.id).filter(ae=>!Qt.some(pe=>pe.id===ae)),!0),gt(ot,(r().model.groups??[]).map(ae=>ae.id).filter(ae=>!te.some(pe=>pe.id===ae)),!0),gt(vt,r().model.edges.map(ae=>ae.id).filter(ae=>!At.some(pe=>pe.id===ae)),!0),gt(Ot,Qt,!0),gt(Pt,te,!0),gt(Mt,At,!0),gt(Bt,le,!0)),gt(R,nt,!0),_e(),oe){const ae=Mh(Qt.map(ye=>ye.id),A(zt).map(ye=>ye.id)),pe=Mh(te.map(ye=>ye.id),A(Ie).map(ye=>ye.id)),be=Mh(At.map(ye=>ye.id),A(Fe).map(ye=>ye.id));gt(tt,ae.entering,!0),gt(ot,pe.entering,!0),gt(vt,be.entering,!0),gt(Rt,Qt.filter(ye=>ae.shared.includes(ye.id)),!0),gt(we,te.filter(ye=>pe.shared.includes(ye.id)),!0),gt(qt,At.filter(ye=>be.shared.includes(ye.id)),!0),gt(ue,new Map([...le].filter(([ye])=>be.shared.includes(ye))),!0),gt(Ot,Qt.filter(ye=>ae.departing.includes(ye.id)),!0),gt(Pt,te.filter(ye=>pe.departing.includes(ye.id)),!0),gt(Mt,At.filter(ye=>be.departing.includes(ye.id)),!0),gt(Bt,new Map([...le].filter(([ye])=>be.departing.includes(ye))),!0),_e()}else De();N=Kt(bt),oe&&(N.length===0&&gt(ft,"exit"),xo(Nt,nt,N)),i()?.({currentStateId:nt}),I?.()}function Ia(nt,bt){(bt?!_t.has(nt):_t.has(nt))&&(bt?_t.add(nt):_t.delete(nt),bt&&Es())}function U1(nt,bt,Nt){if(!o()||!i())return;const Qt=r().model.nodes.map(te=>te.id===nt?{...te,position:{x:bt,y:Nt}}:te);i()({model:{...r().model,nodes:Qt}})}var V1={get diagram(){return r()},set diagram(nt){r(nt),_e()},get onUpdate(){return i()},set onUpdate(nt){i(nt),_e()},get editable(){return o()},set editable(nt=!1){o(nt),_e()},get styleConfig(){return a()},set styleConfig(nt=Gi){a(nt),_e()},get onBindingClick(){return s()},set onBindingClick(nt){s(nt),_e()},get viewResetKey(){return n()},set viewResetKey(nt){n(nt),_e()},$set:Do,$on:(nt,bt)=>Ro(t,nt,bt)},Qi=d4();let Ou,Du;var Ru=qe(Qi);{var Z1=nt=>{var bt=e4(),Nt=qe(bt);{let Qt=Dt(()=>A(T)?je.diagram_renderer_actualSize_ariaLabel():je.diagram_renderer_fitToWidth_ariaLabel()),te=Dt(()=>A(T)?je.diagram_renderer_actualSize_ariaLabel():je.diagram_renderer_fitToWidth_ariaLabel());Ja(Nt,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"diagram-fit-button",onclick:Ki,get"aria-pressed"(){return A(T)},get"aria-label"(){return A(Qt)},get tooltip(){return A(te)},children:(At,le)=>{{let oe=Dt(()=>A(T)?zp:IC);dn(At,{get icon(){return A(oe)},size:"sm"})}},$$slots:{default:!0}})}$e(bt),cr(Qt=>fe(bt,"aria-label",Qt),[()=>je.diagram_renderer_actions_ariaLabel()]),ge(nt,bt)};yr(Ru,nt=>{A(x)&&r().model.nodes.length>0&&nt(Z1)})}var Co=We(Ru,2);let Nu,qu;var K1=qe(Co);{var Q1=nt=>{var bt=r4(),Nt=qe(bt),Qt=Tr(Nt,!0),te=We(Nt,2),At=Tr(te,!0);$e(bt),cr((le,oe)=>{br(Qt,le),br(At,oe)},[()=>je.markdown_mermaid_renderFailed_error(),()=>je.diagram_renderer_error_description()]),ge(nt,bt)},J1=nt=>{var bt=i4(),Nt=qe(bt),Qt=Tr(Nt,!0),te=We(Nt,2),At=Tr(te,!0);$e(bt),cr((le,oe)=>{br(Qt,le),br(At,oe)},[()=>je.diagram_validator_noNodes_warning(),()=>je.diagram_renderer_empty_description()]),ge(nt,bt)},tC=nt=>{var bt=c4();let Nt;var Qt=qe(bt);let te;var At=qe(Qt),le=qe(At),oe=We(le),ae=We(oe),pe=We(ae),be=We(pe),ye=We(be),Rr=We(ye),Ti=We(Rr);$e(At);var zo=We(At);Hp(zo,()=>A(g),Ci=>{var ci=l4();let Bi;var Ho=qe(ci);{var wr=or=>{var Ae=Ko(),Mr=ui(Ae);ya(Mr,17,()=>A(ne),Nr=>Nr.id,(Nr,gr)=>{var pr=o4(),jr=qe(pr);{let Ni=Dt(()=>A(ut)!==null&&A(ut)!==A(gr).id);j1(jr,{get group(){return A(gr)},get dimmed(){return A(Ni)},onHover:Ps=>gt(ut,Ps,!0)})}$e(pr),To(1,pr,()=>Is,()=>({delay:0,duration:y(st)})),To(2,pr,()=>Is,()=>({duration:y(xt)})),ge(Nr,pr)}),ge(or,Ae)};yr(Ho,or=>{A(ne)&&or(wr)})}var Qe=We(Ho);ya(Qe,17,()=>A(It),or=>or.id,(or,Ae)=>{const Mr=Dt(()=>A(at)!==null&&!A(Ft).has(A(Ae).id)||A(ut)!==null&&!A(Z).has(A(Ae).id)||A(Wt)&&A($t)!==null&&!A($t).has(A(Ae).id)),Nr=Dt(()=>A($t)!==null&&A($t).has(A(Ae).id));var gr=a4(),pr=qe(gr);X1(pr,{get edge(){return A(Ae)},get dimmed(){return A(Mr)},get highlighted(){return A(Nr)},get markerScope(){return r().id},get terminalGap(){return A(H)},motionDelay:0,onmotionchange:Ia}),$e(gr),To(1,gr,()=>xe,()=>({duration:st})),To(2,gr,()=>xe,()=>({duration:Tt})),ge(or,gr)});var dr=We(Qe);ya(dr,17,()=>A(It),or=>or.id,(or,Ae)=>{var Mr=Ko(),Nr=ui(Mr);{var gr=jr=>{const Ni=Dt(()=>A(ie).get(A(Ae).id)),Ps=Dt(()=>A(at)!==null&&!A(Ft).has(A(Ae).id)||A(ut)!==null&&!A(Z).has(A(Ae).id)||A(Wt)&&A($t)!==null&&!A($t).has(A(Ae).id));var yi=s4();let xc;var iC=qe(yi);{var oC=Yo=>{OC(Yo,{get content(){return A(Ae).label},side:"top",class:"edge-label-tooltip",trigger:bc=>{var Oa=Rp(),sC=qe(Oa),nC=Tr(sC,!0);$e(Oa),cr(()=>{fe(Oa,"aria-label",A(Ae).label),br(nC,A(Ae).label)}),ge(bc,Oa)},$$slots:{trigger:!0}})},aC=Yo=>{var En=Rp(),bc=qe(En),Oa=Tr(bc,!0);$e(En),cr(()=>br(Oa,A(Ae).label)),ge(Yo,En)};yr(iC,Yo=>{A(Ni).truncated?Yo(oC):Yo(aC,-1)})}$e(yi),cr(Yo=>{fe(yi,"x",A(Ni).x),fe(yi,"y",A(Ni).y),fe(yi,"width",A(Ni).width),fe(yi,"height",A(Ni).height),xc=co(yi,0,`edge-label-container diagram-geometry-motion ${A(Ps)?"edge-label-dimmed":""}`,null,xc,{"edge-label-entry":Yo}),fe(yi,"data-edge-id",A(Ae).id),fe(yi,"data-semantic-style",A(Ae).semanticStyle??"default"),fe(yi,"data-truncated",A(Ni).truncated)},[()=>A(K)&&A(vt).includes(A(Ae).id)]),To(2,yi,()=>Is,()=>({duration:y(xt/2)})),ge(jr,yi)},pr=Dt(()=>A(Ae).label&&A(ie).has(A(Ae).id));yr(Nr,jr=>{A(pr)&&jr(gr)})}ge(or,Mr)});var Er=We(dr);ya(Er,17,()=>A(Le),or=>or.id,(or,Ae)=>{const Mr=Dt(()=>A(at)!==null&&!A(Ct).has(A(Ae).id)||A(ut)!==null&&!A(wt).has(A(Ae).id)||A(Wt)&&A(St)!==null&&!A(St).has(A(Ae).id)),Nr=Dt(()=>A(St)!==null&&A(St).has(A(Ae).id));var gr=n4(),pr=qe(gr);Y1(pr,{get node(){return A(Ae)},get editable(){return o()},get styleConfig(){return A(Q)},get dimmed(){return A(Mr)},get highlighted(){return A(Nr)},onMove:(jr,Ni)=>U1(A(Ae).id,jr,Ni),onHover:jr=>gt(at,jr,!0),get onBindingClick(){return s()}}),$e(gr),cr(()=>{fe(gr,"data-node-id",A(Ae).id),fe(gr,"x",A(Ae).x),fe(gr,"y",A(Ae).y),fe(gr,"width",A(Ae).width),fe(gr,"height",A(Ae).height)}),To(1,gr,()=>Is,()=>({delay:0,duration:A(K)?y(st):0,easing:Uu})),To(2,gr,()=>Is,()=>({duration:y(xt)})),ge(or,gr)}),$e(ci),cr(()=>{fe(ci,"transform",A(Pa)),Bi=Xa(ci,"",Bi,{transform:A(li)})}),ge(Ci,ci)}),$e(Qt),$e(bt),cr(()=>{Nt=Xa(bt,"",Nt,{width:A(z)?`max(100%, ${A(Cr)+16}px)`:`${A(Cr)}px`,height:A(z)?`max(100%, ${A(lr)}px)`:`${A(Fr)}px`}),fe(Qt,"width",A(Jt)),fe(Qt,"height",A(tr)+6),te=Xa(Qt,"",te,{top:A(z)?`${A($r)/2}px`:void 0,transform:A(Te)}),fe(le,"id",`arrowhead-${r().id??""}`),fe(oe,"id",`arrowhead-danger-${r().id??""}`),fe(ae,"id",`arrowhead-success-${r().id??""}`),fe(pe,"id",`arrowhead-warning-${r().id??""}`),fe(be,"id",`arrowhead-muted-${r().id??""}`),fe(ye,"id",`arrowhead-inactive-${r().id??""}`),fe(Rr,"id",`arrowhead-highlighted-${r().id??""}`),fe(Ti,"id",`arrowhead-active-${r().id??""}`)}),ge(nt,bt)};yr(K1,nt=>{A(S)?nt(Q1):r().model.nodes.length===0?nt(J1,1):nt(tC,-1)})}$e(Co),no(Co,nt=>gt(v,nt),()=>A(v));var eC=We(Co,2);{var rC=nt=>{var bt=h4(),Nt=qe(bt);G1(Nt,{get states(){return r().states},get currentStateId(){return A(R)},onStateChange:yc}),$e(bt),ge(nt,bt)};yr(eC,nt=>{!A(S)&&r().model.nodes.length>0&&r().states&&r().states.length>0&&nt(rC)})}return $e(Qi),no(Qi,nt=>gt(Xt,nt),()=>A(Xt)),cr((nt,bt,Nt,Qt,te,At,le,oe)=>{Ou=co(Qi,1,"diagram-renderer svelte-10vg205",null,Ou,{"has-content":nt,"compact-diagram":A(j),"fitted-diagram":A(T),"stateful-diagram":bt,"camera-stage":A(ft)==="camera",resizing:A(f)}),fe(Qi,"data-diagram-intrinsic-width",A(hr)),Du=Xa(Qi,`--diagram-edge-label-font-size: ${Fi.fontSize}px;
342
342
  --diagram-edge-label-line-height: ${Fi.lineHeight};
343
343
  --diagram-edge-label-padding-x: ${Fi.paddingX}px;
344
- --diagram-edge-label-padding-y: ${Fi.paddingY}px;`,Du,{"--diagram-camera-duration":Nt,"--diagram-camera-easing":it,"--diagram-move-exit-duration":Qt,"--diagram-label-entry-delay":te,"--diagram-label-entry-duration":At}),fe(Qi,"data-diagram-settled",A(w)),fe(Qi,"data-diagram-state",A(R)),fe(Qi,"data-diagram-motion-phase",A(ft)),Nu=co(Co,1,"diagram-scroll-container svelte-10vg205",null,Nu,{"stepping-viewport":A(O)}),fe(Co,"role",A(z)?"region":void 0),fe(Co,"aria-label",le),fe(Co,"tabindex",A(ni)?0:void 0),qu=Xa(Co,"",qu,{height:oe})},[()=>!!(A(x)&&r().model.nodes.length>0),()=>!!r().states?.length,()=>`${y(et)}ms`,()=>`${y(ct)}ms`,()=>`${y(kt)}ms`,()=>`${y(jt)}ms`,()=>A(z)?je.diagram_controls_walkthrough_ariaLabel():void 0,()=>A(z)?`${Math.min(A(lr),(A(E)??1/0)*.9)}px`:void 0]),JC("innerHeight",nt=>gt(E,nt,!0)),ge(e,Qi),qo(V1)}var f4=ar('<header class="diagram-presentation-header svelte-1rsrotk" data-diagram-presentation-header=""><!></header>'),g4=ar('<div data-diagram-presentation-actions=""><!> <!></div>'),p4=ar('<section data-diagram-presentation=""><!> <!> <div class="diagram-presentation-content svelte-1rsrotk" data-diagram-presentation-content=""><!></div></section>');function m4(e,t){if(new.target)return Oo({component:m4,...e});No(t,!0);let r=He(t,"kind",7),i=He(t,"children",7),o=He(t,"header",7),a=He(t,"actions",7),s=He(t,"actionsInTopMargin",7,!1),n=He(t,"rendererOwnsActions",7,!1),l=He(t,"selected",7,!1),c=He(t,"exportable",7,!0),h=He(t,"fileName",7),d=ce(void 0),u=ce(void 0),f=ce(void 0),g=ce(!1),p=ce(!1);hd(()=>{const M=A(d)?.closest(".node-mermaidBlock, .node-diagram_block"),B=M?.parentElement;if(!M||!B?.matches(".tiptap-editor.ProseMirror")||!A(d)){gt(g,!0);return}const E=A(d);gt(p,!0);let O=0,$=0,I=!1,F,R;const q=()=>{F=void 0;const X=$,z=E.querySelector("[data-diagram-intrinsic-width]"),U=E.querySelector(".mermaid-svg > svg");z?.dataset.diagramSettled==="true"?O=Number(z.dataset.diagramIntrinsicWidth):U?.dataset.layoutSettled==="true"?O=U.viewBox.baseVal.width+16:!z&&!U&&(O=0);const j=M.clientWidth,V=B.clientWidth,Q=Math.min(j,Math.max(V,O)),rt=Math.min(j,V),ht=z?z.dataset.diagramSettled==="true":U?U.dataset.layoutSettled==="true":!E.querySelector('[data-render-settled="false"]');R=GC(()=>{if(I||$!==X)return;R=void 0;const H=A(u)!==Q;gt(u,Q,!0),gt(f,rt,!0),gt(g,ht,!0),A(p)&&ht&&j>0&&V>0&&(H?F??=Vu(q):gt(p,!1))})},D=()=>{$+=1,gt(g,!1),R?.(),R=void 0,F??=Vu(q)},P=new ResizeObserver(D);P.observe(M),P.observe(B);const Y=new MutationObserver(D);return Y.observe(E,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-diagram-settled","data-diagram-intrinsic-width","data-layout-settled","data-render-settled"]}),D(),()=>{I=!0,P.disconnect(),Y.disconnect(),F?.(),R?.()}});var m={get kind(){return r()},set kind(M){r(M),_e()},get children(){return i()},set children(M){i(M),_e()},get header(){return o()},set header(M){o(M),_e()},get actions(){return a()},set actions(M){a(M),_e()},get actionsInTopMargin(){return s()},set actionsInTopMargin(M=!1){s(M),_e()},get rendererOwnsActions(){return n()},set rendererOwnsActions(M=!1){n(M),_e()},get selected(){return l()},set selected(M=!1){l(M),_e()},get exportable(){return c()},set exportable(M=!0){c(M),_e()},get fileName(){return h()},set fileName(M){h(M),_e()},$set:Do,$on:(M,B)=>Ro(t,M,B)},y=p4();let x,b;var S=qe(y);{var T=M=>{var B=f4(),E=qe(B);il(E,o),$e(B),ge(M,B)};yr(S,M=>{o()&&M(T)})}var k=We(S,2);{var _=M=>{var B=g4();let E;var O=qe(B);il(O,()=>a()??pC);var $=We(O,2);{var I=F=>{Bu(F,{get container(){return A(d)},get fileName(){return h()},get compactTrigger(){return s()}})};yr($,F=>{c()&&F(I)})}$e(B),cr(()=>E=co(B,1,"diagram-presentation-actions svelte-1rsrotk",null,E,{"actions-in-top-margin":s()})),ge(M,B)};yr(k,M=>{!n()&&(a()||c())&&M(_)})}var L=We(k,2),v=qe(L);return il(v,i),$e(L),no(L,M=>gt(d,M),()=>A(d)),$e(y),cr(()=>{x=co(y,1,"diagram-presentation svelte-1rsrotk",null,x,{selected:l(),initializing:A(p),"renderer-owns-actions":n()}),y.inert=A(p),fe(y,"data-diagram-presentation-settled",A(g)),fe(y,"data-diagram-presentation-initializing",A(p)),fe(y,"data-diagram-kind",r()),b=Xa(y,A(f)===void 0?void 0:`--diagram-controls-width: ${A(f)}px`,b,{width:A(u)===void 0?void 0:`${A(u)}px`,"min-width":A(u)===void 0?void 0:"0"})}),ge(e,y),qo(m)}export{nP as $,mT as A,um as B,yT as C,m4 as D,vi as E,lv as F,ln as G,yt as H,Hv as I,i2 as J,Dv as K,c2 as L,Y$ as M,oP as N,Ld as O,lk as P,Yl as Q,Kv as R,Qv as S,yM as T,_w as U,Tw as V,Ar as W,Ge as X,Aw as Y,cM as Z,t2 as _,u4 as a,iP as a$,$a as a0,BP as a1,ZB as a2,vy as a3,Fn as a4,Xd as a5,T2 as a6,uw as a7,eP as a8,MP as a9,Hy as aA,Ur as aB,jg as aC,pL as aD,py as aE,zv as aF,tx as aG,ec as aH,Tf as aI,sP as aJ,I_ as aK,wP as aL,xM as aM,Iv as aN,mm as aO,TP as aP,dm as aQ,P_ as aR,ao as aS,Qo as aT,yP as aU,Ei as aV,Ye as aW,CL as aX,_P as aY,Bw as aZ,Mw as a_,un as aa,du as ab,sv as ac,UB as ad,W_ as ae,E_ as af,a2 as ag,eb as ah,Vv as ai,Zv as aj,Uv as ak,Yt as al,CT as am,bi as an,gm as ao,Gd as ap,Cu as aq,cl as ar,IB as as,he as at,pt as au,Sv as av,wn as aw,o2 as ax,Lt as ay,Rv as az,C as b,Lw as b0,bP as b1,Nv as b2,Cw as b3,$w as b4,tb as b5,Oi as b6,gy as b7,Ut as b8,Ov as b9,Jr as ba,jv as bb,Gv as bc,Yv as bd,Xv as be,ok as bf,ee as bg,Si as bh,wM as bi,Kp as c,aP as d,yy as e,Wv as f,qv as g,Wr as h,Zt as i,JC as j,my as k,rP as l,Qd as m,Ty as n,Po as o,g2 as p,tu as q,vw as r,CP as s,vP as t,SP as u,kP as v,Kl as w,xP as x,fm as y,kn as z};
344
+ --diagram-edge-label-padding-y: ${Fi.paddingY}px;`,Du,{"--diagram-camera-duration":Nt,"--diagram-camera-easing":it,"--diagram-move-exit-duration":Qt,"--diagram-label-entry-delay":te,"--diagram-label-entry-duration":At}),fe(Qi,"data-diagram-settled",A(w)),fe(Qi,"data-diagram-state",A(R)),fe(Qi,"data-diagram-motion-phase",A(ft)),Nu=co(Co,1,"diagram-scroll-container svelte-10vg205",null,Nu,{"stepping-viewport":A(O)}),fe(Co,"role",A(z)?"region":void 0),fe(Co,"aria-label",le),fe(Co,"tabindex",A(ni)?0:void 0),qu=Xa(Co,"",qu,{height:oe})},[()=>!!(A(x)&&r().model.nodes.length>0),()=>!!r().states?.length,()=>`${y(et)}ms`,()=>`${y(ct)}ms`,()=>`${y(kt)}ms`,()=>`${y(jt)}ms`,()=>A(z)?je.diagram_controls_walkthrough_ariaLabel():void 0,()=>A(z)?`${Math.min(A(lr),(A(E)??1/0)*.9)}px`:void 0]),JC("innerHeight",nt=>gt(E,nt,!0)),ge(e,Qi),qo(V1)}var f4=ar('<header class="diagram-presentation-header svelte-1rsrotk" data-diagram-presentation-header=""><!></header>'),g4=ar('<div data-diagram-presentation-actions=""><!> <!></div>'),p4=ar('<section data-diagram-presentation=""><!> <!> <div class="diagram-presentation-content svelte-1rsrotk" data-diagram-presentation-content=""><!></div></section>');function m4(e,t){if(new.target)return Oo({component:m4,...e});No(t,!0);let r=He(t,"kind",7),i=He(t,"children",7),o=He(t,"header",7),a=He(t,"actions",7),s=He(t,"actionsInTopMargin",7,!1),n=He(t,"rendererOwnsActions",7,!1),l=He(t,"selected",7,!1),c=He(t,"exportable",7,!0),h=He(t,"fileName",7),d=ce(void 0),u=ce(void 0),f=ce(void 0),g=ce(!1),p=ce(!1);hd(()=>{const M=A(d)?.closest(".node-mermaidBlock, .node-diagram_block"),B=M?.parentElement;if(!M||!B?.matches(".tiptap-editor.ProseMirror")||!A(d)){gt(g,!0);return}const E=A(d);gt(p,!0);let O=0,$=0,I=!1,F,R;const q=()=>{F=void 0;const X=$,z=E.querySelector("[data-diagram-intrinsic-width]"),U=E.querySelector(".mermaid-svg > svg");z?.dataset.diagramSettled==="true"?O=Number(z.dataset.diagramIntrinsicWidth):U?.dataset.layoutSettled==="true"?O=U.viewBox.baseVal.width+16:!z&&!U&&(O=0);const j=M.clientWidth,V=B.clientWidth,Q=Math.min(j,Math.max(V,O)),rt=Math.min(j,V),ht=z?z.dataset.diagramSettled==="true":U?U.dataset.layoutSettled==="true":!E.querySelector('[data-render-settled="false"]');R=GC(()=>{if(I||$!==X)return;R=void 0;const H=A(u)!==Q;gt(u,Q,!0),gt(f,rt,!0),gt(g,ht,!0),A(p)&&ht&&j>0&&V>0&&(H?F??=Vu(q):gt(p,!1))})},D=()=>{$+=1,gt(g,!1),R?.(),R=void 0,F??=Vu(q)},P=new ResizeObserver(D);P.observe(M),P.observe(B);const Y=new MutationObserver(D);return Y.observe(E,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-diagram-settled","data-diagram-intrinsic-width","data-layout-settled","data-render-settled"]}),D(),()=>{I=!0,P.disconnect(),Y.disconnect(),F?.(),R?.()}});var m={get kind(){return r()},set kind(M){r(M),_e()},get children(){return i()},set children(M){i(M),_e()},get header(){return o()},set header(M){o(M),_e()},get actions(){return a()},set actions(M){a(M),_e()},get actionsInTopMargin(){return s()},set actionsInTopMargin(M=!1){s(M),_e()},get rendererOwnsActions(){return n()},set rendererOwnsActions(M=!1){n(M),_e()},get selected(){return l()},set selected(M=!1){l(M),_e()},get exportable(){return c()},set exportable(M=!0){c(M),_e()},get fileName(){return h()},set fileName(M){h(M),_e()},$set:Do,$on:(M,B)=>Ro(t,M,B)},y=p4();let x,b;var S=qe(y);{var T=M=>{var B=f4(),E=qe(B);il(E,o),$e(B),ge(M,B)};yr(S,M=>{o()&&M(T)})}var k=We(S,2);{var _=M=>{var B=g4();let E;var O=qe(B);il(O,()=>a()??pC);var $=We(O,2);{var I=F=>{Bu(F,{get container(){return A(d)},get fileName(){return h()},get compactTrigger(){return s()}})};yr($,F=>{c()&&F(I)})}$e(B),cr(()=>E=co(B,1,"diagram-presentation-actions svelte-1rsrotk",null,E,{"actions-in-top-margin":s()})),ge(M,B)};yr(k,M=>{!n()&&(a()||c())&&M(_)})}var L=We(k,2),v=qe(L);return il(v,i),$e(L),no(L,M=>gt(d,M),()=>A(d)),$e(y),cr(()=>{x=co(y,1,"diagram-presentation svelte-1rsrotk",null,x,{selected:l(),initializing:A(p),"renderer-owns-actions":n()}),y.inert=A(p),fe(y,"data-diagram-presentation-settled",A(g)),fe(y,"data-diagram-presentation-initializing",A(p)),fe(y,"data-diagram-kind",r()),b=Xa(y,A(f)===void 0?void 0:`--diagram-controls-width: ${A(f)}px`,b,{width:A(u)===void 0?void 0:`${A(u)}px`,"min-width":A(u)===void 0?void 0:"0"})}),ge(e,y),qo(m)}export{hP as $,mT as A,um as B,yT as C,m4 as D,vi as E,lv as F,ln as G,yt as H,Hv as I,i2 as J,Dv as K,c2 as L,Y$ as M,nP as N,Ld as O,lk as P,Yl as Q,Kv as R,Qv as S,yM as T,_w as U,Tw as V,Ar as W,Ge as X,Aw as Y,cM as Z,t2 as _,u4 as a,sP as a$,$a as a0,AP as a1,ZB as a2,vy as a3,Fn as a4,Xd as a5,T2 as a6,uw as a7,oP as a8,_P as a9,Hy as aA,Ur as aB,jg as aC,pL as aD,py as aE,zv as aF,tx as aG,ec as aH,Tf as aI,cP as aJ,I_ as aK,vP as aL,xM as aM,Iv as aN,mm as aO,LP as aP,dm as aQ,P_ as aR,ao as aS,Qo as aT,CP as aU,Ei as aV,Ye as aW,CL as aX,FP as aY,Bw as aZ,Mw as a_,un as aa,du as ab,sv as ac,UB as ad,W_ as ae,E_ as af,a2 as ag,eb as ah,Vv as ai,Zv as aj,Uv as ak,Yt as al,CT as am,bi as an,gm as ao,Gd as ap,Cu as aq,cl as ar,IB as as,he as at,pt as au,Sv as av,wn as aw,o2 as ax,Lt as ay,Rv as az,C as b,Lw as b0,kP as b1,Nv as b2,Cw as b3,$w as b4,tb as b5,Oi as b6,gy as b7,Ut as b8,Ov as b9,Jr as ba,jv as bb,Gv as bc,Yv as bd,Xv as be,ok as bf,ee as bg,Si as bh,wM as bi,Kp as c,lP as d,yy as e,Wv as f,qv as g,Wr as h,Zt as i,JC as j,my as k,aP as l,Qd as m,Ty as n,Po as o,g2 as p,tu as q,vw as r,SP as s,BP as t,TP as u,MP as v,Kl as w,wP as x,fm as y,kn as z};