openclaw-cortex 3.2.6 → 3.3.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 (257) hide show
  1. package/dist/{accounts-6btx_LVr.js → accounts-B3MIBUxY.js} +14 -14
  2. package/dist/{accounts-Cg6z7lKw.js → accounts-Doecg-Pe.js} +1 -1
  3. package/dist/{accounts-BOYxuJ9C.js → accounts-X5YWm9b7.js} +1 -1
  4. package/dist/{active-listener-BhL5jMd9.js → active-listener-DI-5r3l7.js} +1 -1
  5. package/dist/{agent-scope-fNLAHxGF.js → agent-scope-Eh54NB14.js} +3 -3
  6. package/dist/{audio-preflight-DgmMV8p-.js → audio-preflight-BT6BcGi_.js} +4 -4
  7. package/dist/{audio-preflight-oJZolUYt.js → audio-preflight-TVmfRTgf.js} +30 -30
  8. package/dist/{bindings-DdWLXM-y.js → bindings-C6TS0yEe.js} +2 -2
  9. package/dist/build-info.json +3 -3
  10. package/dist/bundled/boot-md/handler.js +53 -53
  11. package/dist/bundled/bootstrap-extra-files/handler.js +5 -5
  12. package/dist/bundled/command-logger/handler.js +1 -1
  13. package/dist/bundled/session-memory/handler.js +53 -53
  14. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  15. package/dist/{channel-activity-LT3oBvO7.js → channel-activity-By7mU0Ld.js} +1 -1
  16. package/dist/{chrome-DxhUHYxR.js → chrome-CBhKqm1e.js} +7 -7
  17. package/dist/{chrome-BxjGg3Ji.js → chrome-Dvy8C6LZ.js} +13 -13
  18. package/dist/{chunk-TRVny4T1.js → chunk-DoTNWpve.js} +1 -1
  19. package/dist/{command-format-D1Crrvey.js → command-format--87BbJbN.js} +1 -1
  20. package/dist/{command-registry-CN383dzr.js → command-registry-DRaOk1jG.js} +4 -4
  21. package/dist/{commands-registry-CASS36zB.js → commands-registry-kwpFg3sO.js} +3 -3
  22. package/dist/{plugin-sdk/common-xLIrQlvS.js → common-D2vcaiue.js} +2 -2
  23. package/dist/{completion-cli-DiUpyj8K.js → completion-cli-CaMCaGeg.js} +1 -1
  24. package/dist/{completion-cli-DWog-ATG.js → completion-cli-Cq0-yq4r.js} +2 -2
  25. package/dist/{config-BXrj6C49.js → config-YM0DHrFa.js} +12 -12
  26. package/dist/control-ui/_app/immutable/chunks/{CTWxnwAC.js → A8Xp3VCv.js} +1 -1
  27. package/dist/control-ui/_app/immutable/chunks/{D6TmrqPb.js → B26luS__.js} +4 -4
  28. package/dist/control-ui/_app/immutable/chunks/{DRMrozhP.js → B2bAh5Q1.js} +1 -1
  29. package/dist/control-ui/_app/immutable/chunks/{X1MNi0qp.js → B2hZObCg.js} +1 -1
  30. package/dist/control-ui/_app/immutable/chunks/{YH-SwxLT.js → B9jIaMGe.js} +1 -1
  31. package/dist/control-ui/_app/immutable/chunks/{L9tM3YT2.js → BAw4ath1.js} +1 -1
  32. package/dist/control-ui/_app/immutable/chunks/{XUyUXXap.js → BGv0vpQT.js} +1 -1
  33. package/dist/control-ui/_app/immutable/chunks/{C_KVsgu8.js → BSoyQ_R5.js} +1 -1
  34. package/dist/control-ui/_app/immutable/chunks/{DFN8J1NF.js → BVUk3tWa.js} +1 -1
  35. package/dist/control-ui/_app/immutable/chunks/{BwY8sfED.js → BeZ-nXK1.js} +1 -1
  36. package/dist/control-ui/_app/immutable/chunks/Bh70dShK.js +1 -0
  37. package/dist/control-ui/_app/immutable/chunks/{DA25TLUp.js → BseClIFT.js} +1 -1
  38. package/dist/control-ui/_app/immutable/chunks/{C1Eymii5.js → BuTRGpGL.js} +1 -1
  39. package/dist/control-ui/_app/immutable/chunks/{BR-s7H7s.js → C-sMwVJq.js} +1 -1
  40. package/dist/control-ui/_app/immutable/chunks/{CToOwI3J.js → CA2Fqmpq.js} +1 -1
  41. package/dist/control-ui/_app/immutable/chunks/{BpdIPI45.js → CF2DLLi1.js} +1 -1
  42. package/dist/control-ui/_app/immutable/chunks/{HSq6Z-Ri.js → CFmcBGqp.js} +1 -1
  43. package/dist/control-ui/_app/immutable/chunks/{CjRaiADz.js → CN4OLKrr.js} +1 -1
  44. package/dist/control-ui/_app/immutable/chunks/{DBlwFnJd.js → CQBY9X6E.js} +1 -1
  45. package/dist/control-ui/_app/immutable/chunks/{Dp0CT_qn.js → CT8t8-J1.js} +1 -1
  46. package/dist/control-ui/_app/immutable/chunks/{CtgLaeta.js → CcGwJm6c.js} +1 -1
  47. package/dist/control-ui/_app/immutable/chunks/{CMAgoL0b.js → CgoZPVeh.js} +1 -1
  48. package/dist/control-ui/_app/immutable/chunks/{c7C9Q4bC.js → CpgMrl7C.js} +1 -1
  49. package/dist/control-ui/_app/immutable/chunks/D3iU0WXt.js +5 -0
  50. package/dist/control-ui/_app/immutable/chunks/{CTNPOj0C.js → D5-Leoub.js} +1 -1
  51. package/dist/control-ui/_app/immutable/chunks/{qjmh8Sgh.js → DCmPRZMl.js} +1 -1
  52. package/dist/control-ui/_app/immutable/chunks/{FrknC80A.js → DDlWCD6s.js} +1 -1
  53. package/dist/control-ui/_app/immutable/chunks/{Mcnmm_vJ.js → DLh1OHbt.js} +1 -1
  54. package/dist/control-ui/_app/immutable/chunks/{f2z7Vhzy.js → DP56tnrP.js} +1 -1
  55. package/dist/control-ui/_app/immutable/chunks/{DvXEWbFO.js → DTaVu539.js} +1 -1
  56. package/dist/control-ui/_app/immutable/chunks/{BQKxqYwa.js → DUYD8zIj.js} +1 -1
  57. package/dist/control-ui/_app/immutable/chunks/{DeOOVYCg.js → DXEhjiCw.js} +2 -2
  58. package/dist/control-ui/_app/immutable/chunks/{DN-9aXEU.js → DYGYDwS0.js} +1 -1
  59. package/dist/control-ui/_app/immutable/chunks/{Dr9WtqlZ.js → DaqZ8F7d.js} +1 -1
  60. package/dist/control-ui/_app/immutable/chunks/{DcdYjMti.js → DlgMBTXO.js} +1 -1
  61. package/dist/control-ui/_app/immutable/chunks/{C4FsZxvN.js → Dox5Ke1c.js} +1 -1
  62. package/dist/control-ui/_app/immutable/chunks/{CmisPrPB.js → Dp6rzy9s.js} +1 -1
  63. package/dist/control-ui/_app/immutable/chunks/{xY7vVkih.js → FLe1BQLx.js} +1 -1
  64. package/dist/control-ui/_app/immutable/chunks/{BFumT5Y0.js → IZSoudUT.js} +35 -35
  65. package/dist/control-ui/_app/immutable/chunks/{Dgn5d0KE.js → LV_KoVeT.js} +1 -1
  66. package/dist/control-ui/_app/immutable/chunks/{CRqxfK8Q.js → PNoU9iVn.js} +1 -1
  67. package/dist/control-ui/_app/immutable/chunks/{DVR5y4oH.js → UuW2ZfGw.js} +1 -1
  68. package/dist/control-ui/_app/immutable/chunks/{BwK9WVrR.js → ecD8_m48.js} +1 -1
  69. package/dist/control-ui/_app/immutable/chunks/{BLM6VoLO.js → gowA3Z9N.js} +1 -1
  70. package/dist/control-ui/_app/immutable/chunks/{DLqjuVZy.js → j5wpLmOt.js} +1 -1
  71. package/dist/control-ui/_app/immutable/chunks/{D3i-icoF.js → lwt7gw4R.js} +1 -1
  72. package/dist/control-ui/_app/immutable/chunks/pbkj8eYC.js +1 -0
  73. package/dist/control-ui/_app/immutable/chunks/{DREM5LJO.js → ppjADO0n.js} +1 -1
  74. package/dist/control-ui/_app/immutable/chunks/{DkQuM6_3.js → r2Nt9SxP.js} +1 -1
  75. package/dist/control-ui/_app/immutable/chunks/{xiH5_-XQ.js → s1JCCdcW.js} +1 -1
  76. package/dist/control-ui/_app/immutable/chunks/{XzWkBa-Y.js → sya67AFr.js} +1 -1
  77. package/dist/control-ui/_app/immutable/chunks/{CGNab0sK.js → wegGCVaW.js} +1 -1
  78. package/dist/control-ui/_app/immutable/entry/{app.BP81uCNW.js → app.Fto7AlG1.js} +2 -2
  79. package/dist/control-ui/_app/immutable/entry/start.BisB9g6B.js +1 -0
  80. package/dist/control-ui/_app/immutable/nodes/{0.BobSoCVT.js → 0.UVUABpvE.js} +2 -2
  81. package/dist/control-ui/_app/immutable/nodes/{1.DXqGuW0y.js → 1.D-BcAijP.js} +1 -1
  82. package/dist/control-ui/_app/immutable/nodes/{10.BDapaGMa.js → 10.DCWCeB7T.js} +1 -1
  83. package/dist/control-ui/_app/immutable/nodes/{11.DBYtQZHB.js → 11.DhEjys02.js} +1 -1
  84. package/dist/control-ui/_app/immutable/nodes/{12.D8XUK_lu.js → 12.DSYRsOVI.js} +1 -1
  85. package/dist/control-ui/_app/immutable/nodes/{13.BDfcMPWD.js → 13.eYK8pE6F.js} +1 -1
  86. package/dist/control-ui/_app/immutable/nodes/{14.CRNfMLjf.js → 14.BXh21cYH.js} +1 -1
  87. package/dist/control-ui/_app/immutable/nodes/{15.BcW25Cjx.js → 15.BFU0eVY_.js} +1 -1
  88. package/dist/control-ui/_app/immutable/nodes/{16.C4l7NDBm.js → 16.DBHG2mB-.js} +1 -1
  89. package/dist/control-ui/_app/immutable/nodes/{17.BkTX8oXe.js → 17.CyrSC_X9.js} +1 -1
  90. package/dist/control-ui/_app/immutable/nodes/{18.B5ULV77i.js → 18.Bf01kDE6.js} +1 -1
  91. package/dist/control-ui/_app/immutable/nodes/2.-1WNqW3J.js +1 -0
  92. package/dist/control-ui/_app/immutable/nodes/{3.CAwDlZXX.js → 3.DkKyJn61.js} +1 -1
  93. package/dist/control-ui/_app/immutable/nodes/{4.UqbCNSjq.js → 4.B2rWu0jt.js} +1 -1
  94. package/dist/control-ui/_app/immutable/nodes/{5.fyz3FwUS.js → 5.DFem5Aji.js} +1 -1
  95. package/dist/control-ui/_app/immutable/nodes/{6.Dico67qE.js → 6.7jHvlHW1.js} +1 -1
  96. package/dist/control-ui/_app/immutable/nodes/{7.CTGW4yVr.js → 7.DrqcqVUQ.js} +1 -1
  97. package/dist/control-ui/_app/immutable/nodes/{8.B4g5dpji.js → 8.Cs1y6ZIY.js} +1 -1
  98. package/dist/control-ui/_app/immutable/nodes/{9.BzrUr7aI.js → 9.m08xA4oj.js} +1 -1
  99. package/dist/control-ui/_app/version.json +1 -1
  100. package/dist/control-ui/index.html +6 -6
  101. package/dist/{deliver-Brnl4HfK.js → deliver-6ybd_3jT.js} +1 -1
  102. package/dist/{deliver-Cj9AtdCD.js → deliver-CzlDovgN.js} +20 -20
  103. package/dist/{diagnostic-CoT2YQH4.js → diagnostic-D8zLma7p.js} +1 -1
  104. package/dist/{doctor-completion-C10-HEge.js → doctor-completion-DucI70Ne.js} +1 -1
  105. package/dist/{doctor-completion-QnooXNE2.js → doctor-completion-vGK1q4Ye.js} +1 -1
  106. package/dist/entry.js +1 -1
  107. package/dist/extensionAPI.js +6 -6
  108. package/dist/{frontmatter-BT4H5SZG.js → frontmatter-D07uaEbx.js} +2 -2
  109. package/dist/{fs-safe-C_CYPw9r.js → fs-safe-CIZ43-83.js} +1 -1
  110. package/dist/{gateway-cli-BckfYcm_.js → gateway-cli-CvQSDvm3.js} +2 -2
  111. package/dist/{gateway-cli-EerfyXJc.js → gateway-cli-DXjkd0k0.js} +2 -2
  112. package/dist/{gemini-auth-DumDbrQC.js → gemini-auth-Bj7vQfrk.js} +1 -1
  113. package/dist/{github-copilot-token-BQ98eazZ.js → github-copilot-token-Bu5FPDAY.js} +7 -7
  114. package/dist/{image-4JNpzCjn.js → image-BccL3ngs.js} +1 -1
  115. package/dist/{image-BWAaAO2H.js → image-D7-aybgX.js} +4 -4
  116. package/dist/index.js +1 -1
  117. package/dist/{ir-ibDQZVBL.js → ir-rhivtCTu.js} +4 -4
  118. package/dist/llm-slug-generator.js +53 -53
  119. package/dist/{local-roots-BgXHvzfc.js → local-roots-Bt7xv1V2.js} +5 -5
  120. package/dist/{login-DlnaqDqy.js → login-BPfI6TLW.js} +7 -7
  121. package/dist/{login-qr-CAaBBzm5.js → login-qr-C9i5PuWG.js} +12 -12
  122. package/dist/{manager-DfEENlRy.js → manager-CuDUtoEb.js} +13 -13
  123. package/dist/{manifest-registry-Dovhiqzt.js → manifest-registry-CpMEl7vN.js} +19 -19
  124. package/dist/{markdown-tables-DO9qAEKa.js → markdown-tables-1wSxjPR8.js} +1 -1
  125. package/dist/{message-channel-BDlvrUZF.js → message-channel-CW_Jr8qx.js} +1 -1
  126. package/dist/{model-auth-BZOnizY6.js → model-auth-D56n6qom.js} +9 -9
  127. package/dist/{normalize-C3cb7hCc.js → normalize-O7CagPR-.js} +9 -9
  128. package/dist/{onboard-B-Y124zt.js → onboard-CNYoHyW0.js} +1 -1
  129. package/dist/{onboard-C_8S5h5L.js → onboard-m7GmQI89.js} +1 -1
  130. package/dist/{onboarding-fEEZIbzq.js → onboarding-CjjXl4IO.js} +1 -1
  131. package/dist/{onboarding-DGH1xg-b.js → onboarding-DB_nNcp7.js} +1 -1
  132. package/dist/{onboarding.finalize-BDkEi13n.js → onboarding.finalize-C0TCYGuN.js} +3 -3
  133. package/dist/{onboarding.finalize-DG5b4KjH.js → onboarding.finalize-ChIElmdD.js} +4 -4
  134. package/dist/{outbound-DlR1v-S7.js → outbound-Y1aXeGg2.js} +7 -7
  135. package/dist/{outbound-attachment-CjHKg7c1.js → outbound-attachment-Qu3GEH7P.js} +2 -2
  136. package/dist/{paths-gnW-md4M.js → paths-B4zRLe0K.js} +1 -1
  137. package/dist/{paths-CyR9Pa1R.js → paths-CkkDESQ2.js} +5 -5
  138. package/dist/{pi-auth-json-DpaHuKnz.js → pi-auth-json-CDC723lK.js} +8 -8
  139. package/dist/{pi-embedded-DiF5uNsJ.js → pi-embedded-BSutTOmE.js} +154 -154
  140. package/dist/{pi-embedded-DCp1o-Q-.js → pi-embedded-BgUNEKQv.js} +16 -16
  141. package/dist/{pi-embedded-helpers-6DRwyFRK.js → pi-embedded-helpers-BWG1sdJc.js} +52 -52
  142. package/dist/{pi-embedded-helpers-OUBsvbo7.js → pi-embedded-helpers-Dh6fWzG0.js} +4 -4
  143. package/dist/plugin-sdk/{accounts-uAqOguyH.js → accounts-LxMkgia0.js} +1 -1
  144. package/dist/plugin-sdk/{accounts-b1Cok6r_.js → accounts-iN-dbgw4.js} +3 -3
  145. package/dist/plugin-sdk/{accounts-CRs7kbLB.js → accounts-vV5Gfd26.js} +1 -1
  146. package/dist/plugin-sdk/{active-listener-BdVTYHTN.js → active-listener-Bh0LXjEI.js} +1 -1
  147. package/dist/plugin-sdk/{agent-scope-Bs92YR2y.js → agent-scope-CbyigN8s.js} +2 -2
  148. package/dist/plugin-sdk/{api-key-rotation-wd2Jnynp.js → api-key-rotation--_SHlBvO.js} +1 -1
  149. package/dist/plugin-sdk/{audio-preflight-CblfMzuT.js → audio-preflight-Cs-ml8zg.js} +25 -25
  150. package/dist/plugin-sdk/{bindings-BiEEaTNG.js → bindings-EiVe9I7R.js} +2 -2
  151. package/dist/plugin-sdk/{channel-activity-DHI8R5Xg.js → channel-activity-PV3vhwo2.js} +1 -1
  152. package/dist/plugin-sdk/{channel-web-B06HVGIL.js → channel-web-21Mv-TmV.js} +22 -22
  153. package/dist/plugin-sdk/{chrome-ORXV3sOi.js → chrome-DY36v1wL.js} +3 -3
  154. package/dist/plugin-sdk/{chunk-C9J4kyVw.js → chunk-CyOBR4uk.js} +1 -1
  155. package/dist/plugin-sdk/{command-format-BTciq6Gg.js → command-format-C5kdEGEu.js} +1 -1
  156. package/dist/plugin-sdk/{commands-registry-B03cVRjI.js → commands-registry-OichNmLJ.js} +3 -3
  157. package/dist/{common-bBB_AQl2.js → plugin-sdk/common-BnJL1iD6.js} +2 -2
  158. package/dist/plugin-sdk/{config-gGD5Rkaw.js → config-BG3Dq3SQ.js} +9 -9
  159. package/dist/plugin-sdk/{deliver-DrIvPqH5.js → deliver-BtCdGBea.js} +10 -10
  160. package/dist/plugin-sdk/{diagnostic-oBxO5N68.js → diagnostic-DFXnVf2I.js} +1 -1
  161. package/dist/plugin-sdk/{fs-safe--E2UxVCE.js → fs-safe-D3UMk9-G.js} +1 -1
  162. package/dist/plugin-sdk/{image-psst3EfB.js → image-CcHh2-91.js} +4 -4
  163. package/dist/plugin-sdk/index.js +52 -52
  164. package/dist/plugin-sdk/{ir-B7KEB-SH.js → ir-CyBaWJwF.js} +4 -4
  165. package/dist/plugin-sdk/{local-roots-BCWc25rb.js → local-roots-BO0Dyqgm.js} +3 -3
  166. package/dist/plugin-sdk/{login-B3Mf_yyo.js → login-gAP1E9vw.js} +7 -7
  167. package/dist/plugin-sdk/{login-qr-BwyNiRRo.js → login-qr-C_TnVe07.js} +9 -9
  168. package/dist/plugin-sdk/{manager-Dv8oeW8Q.js → manager-CC6jXeB-.js} +8 -8
  169. package/dist/plugin-sdk/{manifest-registry-Lzj-fZNH.js → manifest-registry-BgkX6ON4.js} +1 -1
  170. package/dist/plugin-sdk/{markdown-tables-JToF08xk.js → markdown-tables-Q9Bw5OWT.js} +1 -1
  171. package/dist/plugin-sdk/{message-channel-C3OrO29D.js → message-channel-DxNExIdv.js} +1 -1
  172. package/dist/plugin-sdk/{model-selection-BP-yZfgL.js → model-selection-CcOKuG2n.js} +4 -4
  173. package/dist/plugin-sdk/{normalize-CALo0r3J.js → normalize-DQzsuqr8.js} +4 -4
  174. package/dist/plugin-sdk/{outbound-Xv_dXAwT.js → outbound-BNo9XNzM.js} +7 -7
  175. package/dist/plugin-sdk/{outbound-attachment-BcrG8SHW.js → outbound-attachment-CisuJmNV.js} +2 -2
  176. package/dist/plugin-sdk/{pi-auth-json-cJTtFNw1.js → pi-auth-json-BHnQjxub.js} +5 -5
  177. package/dist/plugin-sdk/{pi-embedded-helpers-DjyrCaOR.js → pi-embedded-helpers-D5mU_VuV.js} +17 -17
  178. package/dist/plugin-sdk/{plugins-DkDfsqpU.js → plugins-DZx_qlHO.js} +3 -3
  179. package/dist/plugin-sdk/{pw-ai-DzpfUQcL.js → pw-ai-DYABE96f.js} +8 -8
  180. package/dist/plugin-sdk/{qmd-manager-CJcPR4Tl.js → qmd-manager-B3_LuPWI.js} +4 -4
  181. package/dist/plugin-sdk/{registry-C8pj8ctW.js → registry-BECEtj9n.js} +2 -2
  182. package/dist/plugin-sdk/{replies-D70UX9el.js → replies-DYi7SN77.js} +3 -3
  183. package/dist/plugin-sdk/{reply-Bd2hTqt2.js → reply-Cjk7LMy5.js} +78 -78
  184. package/dist/plugin-sdk/{reply-prefix-C4uKnJw5.js → reply-prefix-CjyfQ_d1.js} +1 -1
  185. package/dist/plugin-sdk/{resolve-route-D3KbwzED.js → resolve-route-DcFELQ2A.js} +3 -3
  186. package/dist/plugin-sdk/{retry-B8Oq5mgi.js → retry-Bkj1k1me.js} +1 -1
  187. package/dist/plugin-sdk/{runner-eN6avbf7.js → runner-DpYDxpAW.js} +9 -9
  188. package/dist/plugin-sdk/{send-DbftCLdT.js → send-BZCJA8cX.js} +11 -11
  189. package/dist/plugin-sdk/{send-NfHYBhul.js → send-DZKSn0On.js} +7 -7
  190. package/dist/plugin-sdk/{send-g2G5-BE1.js → send-DstsvZrR.js} +7 -7
  191. package/dist/plugin-sdk/{send-DTQ35K1k.js → send-L7Qzaw1k.js} +11 -11
  192. package/dist/plugin-sdk/{send-CYWWJEcn.js → send-ydtZKtPY.js} +6 -6
  193. package/dist/plugin-sdk/{session-BS3El_89.js → session-hN4eOpFg.js} +4 -4
  194. package/dist/plugin-sdk/{skill-commands-Cle2Lzhm.js → skill-commands-BI1wVtHZ.js} +5 -5
  195. package/dist/plugin-sdk/{skills-BKSekIbi.js → skills-Xz3Fbq-R.js} +7 -7
  196. package/dist/plugin-sdk/{sqlite-Yn48izJ_.js → sqlite-DtIiUWZr.js} +1 -1
  197. package/dist/plugin-sdk/{store-Cz4sBcdW.js → store-w9NR0-ll.js} +2 -2
  198. package/dist/plugin-sdk/{subsystem-BfLMZ8kW.js → subsystem-Ck27y_6W.js} +1 -1
  199. package/dist/plugin-sdk/{tables-gytp5jHK.js → tables-CmVJrzl_.js} +1 -1
  200. package/dist/plugin-sdk/{thinking-BOKrkVfN.js → thinking-DIWJ8ngy.js} +5 -5
  201. package/dist/plugin-sdk/{tokens-D1LxPszt.js → tokens-B6GWdF_0.js} +1 -1
  202. package/dist/plugin-sdk/{tool-loop-detection-CYSptBsl.js → tool-loop-detection-CbPwu1_R.js} +2 -2
  203. package/dist/plugin-sdk/web-DV9s3A0M.js +65 -0
  204. package/dist/plugin-sdk/{whatsapp-actions-Cxf0P-Zz.js → whatsapp-actions-DdnRWwJa.js} +20 -20
  205. package/dist/{plugins-CJYXNO4s.js → plugins-CLJ0iOl0.js} +1 -1
  206. package/dist/{program-DadI_6OM.js → program-CVLtKnfR.js} +2 -2
  207. package/dist/{program-context-Cj0DZ4-w.js → program-context-tjPv_pMM.js} +6 -6
  208. package/dist/{prompt-select-styled-SU9h5tPd.js → prompt-select-styled-4UgZMl1u.js} +2 -2
  209. package/dist/{prompt-select-styled-_rVIdUqN.js → prompt-select-styled-lWJwdNOt.js} +2 -2
  210. package/dist/{pw-ai-ByDR1q8k.js → pw-ai-Bp7tQXP7.js} +1 -1
  211. package/dist/{pw-ai-BrMJUJAV.js → pw-ai-DvWHo51A.js} +11 -11
  212. package/dist/{qmd-manager-DTtrEBXO.js → qmd-manager-DLZCCfAl.js} +7 -7
  213. package/dist/{register.maintenance-lcYGhRfn.js → register.maintenance-Be6mgKHS.js} +5 -5
  214. package/dist/{register.maintenance-CKkRbcT9.js → register.maintenance-CXdFRu0F.js} +6 -6
  215. package/dist/{register.onboard-7yDtMX-p.js → register.onboard-DBC7puPE.js} +2 -2
  216. package/dist/{register.onboard-DWWcPpQm.js → register.onboard-o3lH_CIx.js} +2 -2
  217. package/dist/{register.setup-DQ2pAYjq.js → register.setup-4Bh1tPhz.js} +2 -2
  218. package/dist/{register.setup-pmtj5F29.js → register.setup-CdGVt-tp.js} +2 -2
  219. package/dist/{register.subclis-BjYBzftC.js → register.subclis-Db-mOleG.js} +3 -3
  220. package/dist/{registry-BmY4gNy6.js → registry-CXBAJGac.js} +17 -17
  221. package/dist/{replies-CpfV6teD.js → replies-Dst9shzA.js} +3 -3
  222. package/dist/{reply-prefix-ImxHFIBV.js → reply-prefix-Bi0kA6w2.js} +1 -1
  223. package/dist/{resolve-route-B6jAofkW.js → resolve-route-BUh-vL4u.js} +4 -4
  224. package/dist/{retry-BxB_D6Pn.js → retry-BwVcNQB0.js} +1 -1
  225. package/dist/{run-main-C9QTrYeQ.js → run-main-BNrhYed3.js} +3 -3
  226. package/dist/{runner-xrbh4KIj.js → runner-C3yJ8DJi.js} +9 -9
  227. package/dist/{runner-BYhtaPKn.js → runner-j4Bfr_LY.js} +1 -1
  228. package/dist/{send-e_SdAJeq.js → send-Br3A9kpZ.js} +19 -19
  229. package/dist/{send-C-XCIJuC.js → send-BzIvr4Z_.js} +6 -6
  230. package/dist/{send-CiDdpmzA.js → send-CDciUPAf.js} +6 -6
  231. package/dist/{send-sBat2Hk3.js → send-CJ2zw6gd.js} +7 -7
  232. package/dist/{send-oQqEPZFE.js → send-CtOVbiqN.js} +10 -10
  233. package/dist/{session-Br88pwYq.js → session-DaH2NktH.js} +8 -8
  234. package/dist/{session-dirs-DV_qZ5wI.js → session-dirs-BtvMQvd2.js} +1 -1
  235. package/dist/{session-dirs-DGhcLUEt.js → session-dirs-Dp66oMuK.js} +1 -1
  236. package/dist/{skill-commands-L55X--Ff.js → skill-commands-CQlQjOjc.js} +9 -9
  237. package/dist/{skills-0iSdpmyU.js → skills-CEwsiFJU.js} +21 -21
  238. package/dist/{sqlite-DJh2xLr6.js → sqlite-BY19hYgD.js} +4 -4
  239. package/dist/{store-DHkrtQed.js → store-DXYMQMY7.js} +2 -2
  240. package/dist/{subsystem-B5g771Td.js → subsystem-BFaeHXzD.js} +1 -1
  241. package/dist/{tables-D5EnkI03.js → tables-CuY2NO6I.js} +1 -1
  242. package/dist/{thinking-cSNbxycr.js → thinking-BM9OL9gE.js} +5 -5
  243. package/dist/{tokens-BRx7o_ZS.js → tokens-CC-Nd7t2.js} +1 -1
  244. package/dist/{tool-loop-detection-BjQsVGUc.js → tool-loop-detection-DDnbw1kC.js} +3 -3
  245. package/dist/{update-cli-BJkEpOzH.js → update-cli-1QGSqP3Y.js} +7 -7
  246. package/dist/{update-cli-CijRWAjm.js → update-cli-CmLe-3UM.js} +6 -6
  247. package/dist/{web-CVGYB15Z.js → web-DN0Lf8sf.js} +57 -57
  248. package/dist/{web-ZW9Geotk.js → web-y3J71ECd.js} +6 -6
  249. package/dist/{whatsapp-actions-n2AzHm58.js → whatsapp-actions-Bhzconsy.js} +23 -23
  250. package/dist/{workspace-B32hQFzW.js → workspace-DRkjyTds.js} +6 -6
  251. package/package.json +1 -1
  252. package/dist/control-ui/_app/immutable/chunks/2UnHt_9K.js +0 -1
  253. package/dist/control-ui/_app/immutable/chunks/B4GbTqhO.js +0 -1
  254. package/dist/control-ui/_app/immutable/chunks/DM2PI6Ub.js +0 -5
  255. package/dist/control-ui/_app/immutable/entry/start.BkyZMPcP.js +0 -1
  256. package/dist/control-ui/_app/immutable/nodes/2.BbOfUph1.js +0 -1
  257. package/dist/plugin-sdk/web-CHrq1191.js +0 -65
@@ -1 +1 @@
1
- import{aV as j,aW as p,aX as w,aY as k,aZ as q}from"./D6TmrqPb.js";import{i as D}from"./Gi6I4Gst.js";import{e as g,f as F,a as V,b as z}from"./DX6XiGOO.js";function M(n,r){return n==null||r==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function B(n,r){return n==null||r==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=M,t=(o,c)=>M(n(o),c),e=(o,c)=>n(o)-c):(r=n===M||n===B?n:I,t=n,e=n);function u(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<0?i=l+1:h=l}while(i<h)}return i}function f(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<=0?i=l+1:h=l}while(i<h)}return i}function a(o,c,i=0,h=o.length){const l=u(o,c,i,h-1);return l>i&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function I(){return 0}function P(n){return n===null?NaN:+n}const $=R(M),x=$.right;R(P).center;const O=Math.sqrt(50),T=Math.sqrt(10),W=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=O?10:f>=T?5:f>=W?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/i<n&&++o,c/i>r&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*i<n&&++o,c*i>r&&--c),c<o&&.5<=t&&t<2?v(n,r,t*2):[o,c,i]}function X(n,r,t){if(r=+r,n=+n,t=+t,!(t>0))return[];if(n===r)return[n];const e=r<n,[u,f,a]=e?v(r,n,t):v(n,r,t);if(!(f>=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;i<o;++i)c[i]=(f-i)/-a;else for(let i=0;i<o;++i)c[i]=(f-i)*a;else if(a<0)for(let i=0;i<o;++i)c[i]=(u+i)/-a;else for(let i=0;i<o;++i)c[i]=(u+i)*a;return c}function y(n,r,t){return r=+r,n=+n,t=+t,v(n,r,t)[2]}function Y(n,r,t){r=+r,n=+n,t=+t;const e=r<n,u=e?y(r,n,t):y(n,r,t);return(e?-1:1)*(u<0?1/-u:u)}function Z(n,r){r||(r=[]);var t=n?Math.min(r.length,n.length):0,e=r.slice(),u;return function(f){for(u=0;u<t;++u)e[u]=n[u]*(1-f)+r[u]*f;return e}}function C(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function E(n,r){var t=r?r.length:0,e=n?Math.min(t,n.length):0,u=new Array(e),f=new Array(t),a;for(a=0;a<e;++a)u[a]=d(n[a],r[a]);for(;a<t;++a)f[a]=r[a];return function(o){for(a=0;a<e;++a)f[a]=u[a](o);return f}}function G(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function H(n,r){var t={},e={},u;(n===null||typeof n!="object")&&(n={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in n?t[u]=d(n[u],r[u]):e[u]=r[u];return function(f){for(u in t)e[u]=t[u](f);return e}}function d(n,r){var t=typeof r,e;return r==null||t==="boolean"?j(r):(t==="number"?p:t==="string"?(e=w(r))?(r=e,k):q:r instanceof w?k:r instanceof Date?G:C(r)?Z:Array.isArray(r)?E:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?H:p)(n,r)}function J(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function K(n){return Math.max(0,-g(Math.abs(n)))}function L(n,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(g(r)/3)))*3-g(Math.abs(n)))}function Q(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,g(r)-g(n))+1}function U(n){return function(){return n}}function _(n){return+n}var A=[0,1];function m(n){return n}function N(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:U(isNaN(r)?NaN:.5)}function b(n,r){var t;return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u<e?(e=N(u,e),f=t(a,f)):(e=N(e,u),f=t(f,a)),function(o){return f(e(o))}}function rn(n,r,t){var e=Math.min(n.length,r.length)-1,u=new Array(e),f=new Array(e),a=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++a<e;)u[a]=N(n[a],n[a+1]),f[a]=t(r[a],r[a+1]);return function(o){var c=x(n,o,1,e)-1;return f[c](u[c](o))}}function en(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function tn(){var n=A,r=A,t=d,e,u,f,a=m,o,c,i;function h(){var s=Math.min(n.length,r.length);return a!==m&&(a=b(n[0],n[s-1])),o=s>2?rn:nn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),p)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,_),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=J,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,S){return e=s,u=S,h()}}function un(){return tn()(m,m)}function an(n,r,t,e){var u=Y(n,r,t),f;switch(e=F(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=L(u,a))&&(e.precision=f),V(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Q(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=K(u))&&(e.precision=f-(e.type==="%")*2);break}}return z(e)}function on(n){var r=n.domain;return n.ticks=function(t){var e=r();return X(e[0],e[e.length-1],t??10)},n.tickFormat=function(t,e){var u=r();return an(u[0],u[u.length-1],t??10,e)},n.nice=function(t){t==null&&(t=10);var e=r(),u=0,f=e.length-1,a=e[u],o=e[f],c,i,h=10;for(o<a&&(i=a,a=o,o=i,i=u,u=f,f=i);h-- >0;){if(i=y(a,o,t),i===c)return e[u]=a,e[f]=o,r(e);if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else if(i<0)a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i;else break;c=i}return n},n}function fn(){var n=un();return n.copy=function(){return en(n,fn())},D.apply(n,arguments),on(n)}export{en as a,R as b,un as c,fn as l,Y as t};
1
+ import{aV as j,aW as p,aX as w,aY as k,aZ as q}from"./B26luS__.js";import{i as D}from"./Gi6I4Gst.js";import{e as g,f as F,a as V,b as z}from"./DX6XiGOO.js";function M(n,r){return n==null||r==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function B(n,r){return n==null||r==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=M,t=(o,c)=>M(n(o),c),e=(o,c)=>n(o)-c):(r=n===M||n===B?n:I,t=n,e=n);function u(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<0?i=l+1:h=l}while(i<h)}return i}function f(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<=0?i=l+1:h=l}while(i<h)}return i}function a(o,c,i=0,h=o.length){const l=u(o,c,i,h-1);return l>i&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function I(){return 0}function P(n){return n===null?NaN:+n}const $=R(M),x=$.right;R(P).center;const O=Math.sqrt(50),T=Math.sqrt(10),W=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=O?10:f>=T?5:f>=W?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/i<n&&++o,c/i>r&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*i<n&&++o,c*i>r&&--c),c<o&&.5<=t&&t<2?v(n,r,t*2):[o,c,i]}function X(n,r,t){if(r=+r,n=+n,t=+t,!(t>0))return[];if(n===r)return[n];const e=r<n,[u,f,a]=e?v(r,n,t):v(n,r,t);if(!(f>=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;i<o;++i)c[i]=(f-i)/-a;else for(let i=0;i<o;++i)c[i]=(f-i)*a;else if(a<0)for(let i=0;i<o;++i)c[i]=(u+i)/-a;else for(let i=0;i<o;++i)c[i]=(u+i)*a;return c}function y(n,r,t){return r=+r,n=+n,t=+t,v(n,r,t)[2]}function Y(n,r,t){r=+r,n=+n,t=+t;const e=r<n,u=e?y(r,n,t):y(n,r,t);return(e?-1:1)*(u<0?1/-u:u)}function Z(n,r){r||(r=[]);var t=n?Math.min(r.length,n.length):0,e=r.slice(),u;return function(f){for(u=0;u<t;++u)e[u]=n[u]*(1-f)+r[u]*f;return e}}function C(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function E(n,r){var t=r?r.length:0,e=n?Math.min(t,n.length):0,u=new Array(e),f=new Array(t),a;for(a=0;a<e;++a)u[a]=d(n[a],r[a]);for(;a<t;++a)f[a]=r[a];return function(o){for(a=0;a<e;++a)f[a]=u[a](o);return f}}function G(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function H(n,r){var t={},e={},u;(n===null||typeof n!="object")&&(n={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in n?t[u]=d(n[u],r[u]):e[u]=r[u];return function(f){for(u in t)e[u]=t[u](f);return e}}function d(n,r){var t=typeof r,e;return r==null||t==="boolean"?j(r):(t==="number"?p:t==="string"?(e=w(r))?(r=e,k):q:r instanceof w?k:r instanceof Date?G:C(r)?Z:Array.isArray(r)?E:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?H:p)(n,r)}function J(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function K(n){return Math.max(0,-g(Math.abs(n)))}function L(n,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(g(r)/3)))*3-g(Math.abs(n)))}function Q(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,g(r)-g(n))+1}function U(n){return function(){return n}}function _(n){return+n}var A=[0,1];function m(n){return n}function N(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:U(isNaN(r)?NaN:.5)}function b(n,r){var t;return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u<e?(e=N(u,e),f=t(a,f)):(e=N(e,u),f=t(f,a)),function(o){return f(e(o))}}function rn(n,r,t){var e=Math.min(n.length,r.length)-1,u=new Array(e),f=new Array(e),a=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++a<e;)u[a]=N(n[a],n[a+1]),f[a]=t(r[a],r[a+1]);return function(o){var c=x(n,o,1,e)-1;return f[c](u[c](o))}}function en(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function tn(){var n=A,r=A,t=d,e,u,f,a=m,o,c,i;function h(){var s=Math.min(n.length,r.length);return a!==m&&(a=b(n[0],n[s-1])),o=s>2?rn:nn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),p)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,_),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=J,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,S){return e=s,u=S,h()}}function un(){return tn()(m,m)}function an(n,r,t,e){var u=Y(n,r,t),f;switch(e=F(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=L(u,a))&&(e.precision=f),V(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Q(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=K(u))&&(e.precision=f-(e.type==="%")*2);break}}return z(e)}function on(n){var r=n.domain;return n.ticks=function(t){var e=r();return X(e[0],e[e.length-1],t??10)},n.tickFormat=function(t,e){var u=r();return an(u[0],u[u.length-1],t??10,e)},n.nice=function(t){t==null&&(t=10);var e=r(),u=0,f=e.length-1,a=e[u],o=e[f],c,i,h=10;for(o<a&&(i=a,a=o,o=i,i=u,u=f,f=i);h-- >0;){if(i=y(a,o,t),i===c)return e[u]=a,e[f]=o,r(e);if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else if(i<0)a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i;else break;c=i}return n},n}function fn(){var n=un();return n.copy=function(){return en(n,fn())},D.apply(n,arguments),on(n)}export{en as a,R as b,un as c,fn as l,Y as t};
@@ -1,4 +1,4 @@
1
- import{Q as S,T as z,aG as j,g as q,s as K,a as Q,b as Z,t as H,q as J,_ as p,l as F,c as X,F as Y,K as ee,a4 as te,e as ae,z as re,G as ne}from"./D6TmrqPb.js";import{p as ie}from"./C_KVsgu8.js";import{p as se}from"./XzWkBa-Y.js";import{d as I}from"./c7C9Q4bC.js";import{o as le}from"./CmKTTxBW.js";function oe(e,a){return a<e?-1:a>e?1:a>=e?0:NaN}function ce(e){return e}function ue(){var e=ce,a=oe,f=null,x=S(0),s=S(z),o=S(0);function l(t){var n,c=(t=j(t)).length,d,y,m=0,u=new Array(c),i=new Array(c),v=+x.apply(this,arguments),w=Math.min(z,Math.max(-z,s.apply(this,arguments)-v)),h,C=Math.min(Math.abs(w)/c,o.apply(this,arguments)),$=C*(w<0?-1:1),g;for(n=0;n<c;++n)(g=i[u[n]=n]=+e(t[n],n,t))>0&&(m+=g);for(a!=null?u.sort(function(A,D){return a(i[A],i[D])}):f!=null&&u.sort(function(A,D){return f(t[A],t[D])}),n=0,y=m?(w-c*$)/m:0;n<c;++n,v=h)d=u[n],g=i[d],h=v+(g>0?g*y:0)+$,i[d]={data:t[d],index:n,value:g,startAngle:v,endAngle:h,padAngle:C};return i}return l.value=function(t){return arguments.length?(e=typeof t=="function"?t:S(+t),l):e},l.sortValues=function(t){return arguments.length?(a=t,f=null,l):a},l.sort=function(t){return arguments.length?(f=t,a=null,l):f},l.startAngle=function(t){return arguments.length?(x=typeof t=="function"?t:S(+t),l):x},l.endAngle=function(t){return arguments.length?(s=typeof t=="function"?t:S(+t),l):s},l.padAngle=function(t){return arguments.length?(o=typeof t=="function"?t:S(+t),l):o},l}var pe=ne.pie,G={sections:new Map,showData:!1},T=G.sections,N=G.showData,de=structuredClone(pe),ge=p(()=>structuredClone(de),"getConfig"),fe=p(()=>{T=new Map,N=G.showData,re()},"clear"),he=p(({label:e,value:a})=>{if(a<0)throw new Error(`"${e}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);T.has(e)||(T.set(e,a),F.debug(`added new section: ${e}, with value: ${a}`))},"addSection"),me=p(()=>T,"getSections"),ve=p(e=>{N=e},"setShowData"),Se=p(()=>N,"getShowData"),L={getConfig:ge,clear:fe,setDiagramTitle:J,getDiagramTitle:H,setAccTitle:Z,getAccTitle:Q,setAccDescription:K,getAccDescription:q,addSection:he,getSections:me,setShowData:ve,getShowData:Se},xe=p((e,a)=>{ie(e,a),a.setShowData(e.showData),e.sections.map(a.addSection)},"populateDb"),ye={parse:p(async e=>{const a=await se("pie",e);F.debug(a),xe(a,L)},"parse")},we=p(e=>`
1
+ import{Q as S,T as z,aG as j,g as q,s as K,a as Q,b as Z,t as H,q as J,_ as p,l as F,c as X,F as Y,K as ee,a4 as te,e as ae,z as re,G as ne}from"./B26luS__.js";import{p as ie}from"./BSoyQ_R5.js";import{p as se}from"./sya67AFr.js";import{d as I}from"./CpgMrl7C.js";import{o as le}from"./CmKTTxBW.js";function oe(e,a){return a<e?-1:a>e?1:a>=e?0:NaN}function ce(e){return e}function ue(){var e=ce,a=oe,f=null,x=S(0),s=S(z),o=S(0);function l(t){var n,c=(t=j(t)).length,d,y,m=0,u=new Array(c),i=new Array(c),v=+x.apply(this,arguments),w=Math.min(z,Math.max(-z,s.apply(this,arguments)-v)),h,C=Math.min(Math.abs(w)/c,o.apply(this,arguments)),$=C*(w<0?-1:1),g;for(n=0;n<c;++n)(g=i[u[n]=n]=+e(t[n],n,t))>0&&(m+=g);for(a!=null?u.sort(function(A,D){return a(i[A],i[D])}):f!=null&&u.sort(function(A,D){return f(t[A],t[D])}),n=0,y=m?(w-c*$)/m:0;n<c;++n,v=h)d=u[n],g=i[d],h=v+(g>0?g*y:0)+$,i[d]={data:t[d],index:n,value:g,startAngle:v,endAngle:h,padAngle:C};return i}return l.value=function(t){return arguments.length?(e=typeof t=="function"?t:S(+t),l):e},l.sortValues=function(t){return arguments.length?(a=t,f=null,l):a},l.sort=function(t){return arguments.length?(f=t,a=null,l):f},l.startAngle=function(t){return arguments.length?(x=typeof t=="function"?t:S(+t),l):x},l.endAngle=function(t){return arguments.length?(s=typeof t=="function"?t:S(+t),l):s},l.padAngle=function(t){return arguments.length?(o=typeof t=="function"?t:S(+t),l):o},l}var pe=ne.pie,G={sections:new Map,showData:!1},T=G.sections,N=G.showData,de=structuredClone(pe),ge=p(()=>structuredClone(de),"getConfig"),fe=p(()=>{T=new Map,N=G.showData,re()},"clear"),he=p(({label:e,value:a})=>{if(a<0)throw new Error(`"${e}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);T.has(e)||(T.set(e,a),F.debug(`added new section: ${e}, with value: ${a}`))},"addSection"),me=p(()=>T,"getSections"),ve=p(e=>{N=e},"setShowData"),Se=p(()=>N,"getShowData"),L={getConfig:ge,clear:fe,setDiagramTitle:J,getDiagramTitle:H,setAccTitle:Z,getAccTitle:Q,setAccDescription:K,getAccDescription:q,addSection:he,getSections:me,setShowData:ve,getShowData:Se},xe=p((e,a)=>{ie(e,a),a.setShowData(e.showData),e.sections.map(a.addSection)},"populateDb"),ye={parse:p(async e=>{const a=await se("pie",e);F.debug(a),xe(a,L)},"parse")},we=p(e=>`
2
2
  .pieCircle{
3
3
  stroke: ${e.pieStrokeColor};
4
4
  stroke-width : ${e.pieStrokeWidth};
@@ -1,4 +1,4 @@
1
- import{_ as b,F as m,K as B,e as C,l as w,b as S,a as D,q as T,t as z,g as F,s as P,G as E,H as A,z as W}from"./D6TmrqPb.js";import{p as _}from"./C_KVsgu8.js";import{p as N}from"./XzWkBa-Y.js";var L=E.packet,u,v=(u=class{constructor(){this.packet=[],this.setAccTitle=S,this.getAccTitle=D,this.setDiagramTitle=T,this.getDiagramTitle=z,this.getAccDescription=F,this.setAccDescription=P}getConfig(){const t=m({...L,...A().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){W(),this.packet=[]}},b(u,"PacketDB"),u),M=1e4,Y=b((e,t)=>{_(e,t);let r=-1,s=[],n=1;const{bitsPerRow:l}=t.getConfig();for(let{start:a,end:i,bits:d,label:c}of e.blocks){if(a!==void 0&&i!==void 0&&i<a)throw new Error(`Packet block ${a} - ${i} is invalid. End must be greater than start.`);if(a??=r+1,a!==r+1)throw new Error(`Packet block ${a} - ${i??a} is not contiguous. It should start from ${r+1}.`);if(d===0)throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);for(i??=a+(d??1)-1,d??=i-a+1,r=i,w.debug(`Packet block ${a} - ${r} with label ${c}`);s.length<=l+1&&t.getPacket().length<M;){const[p,o]=G({start:a,end:i,bits:d,label:c},n,l);if(s.push(p),p.end+1===n*l&&(t.pushWord(s),s=[],n++),!o)break;({start:a,end:i,bits:d,label:c}=o)}}t.pushWord(s)},"populate"),G=b((e,t,r)=>{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*r)return[e,void 0];const s=t*r-1,n=t*r;return[{start:e.start,end:s,label:e.label,bits:s-e.start},{start:n,end:e.end,label:e.label,bits:e.end-n}]},"getNextFittingBlock"),x={parser:{yy:void 0},parse:b(async e=>{const t=await N("packet",e),r=x.parser?.yy;if(!(r instanceof v))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");w.debug(t),Y(t,r)},"parse")},H=b((e,t,r,s)=>{const n=s.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),o=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(o?0:a),k=d*c+2,f=B(t);f.attr("viewbox",`0 0 ${k} ${g}`),C(f,g,k,l.useMaxWidth);for(const[y,$]of p.entries())I(f,$,y,l);f.append("text").text(o).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),I=b((e,t,r,{rowHeight:s,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=e.append("g"),p=r*(s+l)+l;for(const o of t){const h=o.start%i*a+1,g=(o.end-o.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",s).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+s/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(o.label),!d)continue;const k=o.end===o.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(o.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(o.end)}},"drawWord"),K={draw:H},O={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},j=b(({packet:e}={})=>{const t=m(O,e);return`
1
+ import{_ as b,F as m,K as B,e as C,l as w,b as S,a as D,q as T,t as z,g as F,s as P,G as E,H as A,z as W}from"./B26luS__.js";import{p as _}from"./BSoyQ_R5.js";import{p as N}from"./sya67AFr.js";var L=E.packet,u,v=(u=class{constructor(){this.packet=[],this.setAccTitle=S,this.getAccTitle=D,this.setDiagramTitle=T,this.getDiagramTitle=z,this.getAccDescription=F,this.setAccDescription=P}getConfig(){const t=m({...L,...A().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){W(),this.packet=[]}},b(u,"PacketDB"),u),M=1e4,Y=b((e,t)=>{_(e,t);let r=-1,s=[],n=1;const{bitsPerRow:l}=t.getConfig();for(let{start:a,end:i,bits:d,label:c}of e.blocks){if(a!==void 0&&i!==void 0&&i<a)throw new Error(`Packet block ${a} - ${i} is invalid. End must be greater than start.`);if(a??=r+1,a!==r+1)throw new Error(`Packet block ${a} - ${i??a} is not contiguous. It should start from ${r+1}.`);if(d===0)throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);for(i??=a+(d??1)-1,d??=i-a+1,r=i,w.debug(`Packet block ${a} - ${r} with label ${c}`);s.length<=l+1&&t.getPacket().length<M;){const[p,o]=G({start:a,end:i,bits:d,label:c},n,l);if(s.push(p),p.end+1===n*l&&(t.pushWord(s),s=[],n++),!o)break;({start:a,end:i,bits:d,label:c}=o)}}t.pushWord(s)},"populate"),G=b((e,t,r)=>{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*r)return[e,void 0];const s=t*r-1,n=t*r;return[{start:e.start,end:s,label:e.label,bits:s-e.start},{start:n,end:e.end,label:e.label,bits:e.end-n}]},"getNextFittingBlock"),x={parser:{yy:void 0},parse:b(async e=>{const t=await N("packet",e),r=x.parser?.yy;if(!(r instanceof v))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");w.debug(t),Y(t,r)},"parse")},H=b((e,t,r,s)=>{const n=s.db,l=n.getConfig(),{rowHeight:a,paddingY:i,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),o=n.getDiagramTitle(),h=a+i,g=h*(p.length+1)-(o?0:a),k=d*c+2,f=B(t);f.attr("viewbox",`0 0 ${k} ${g}`),C(f,g,k,l.useMaxWidth);for(const[y,$]of p.entries())I(f,$,y,l);f.append("text").text(o).attr("x",k/2).attr("y",g-h/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),I=b((e,t,r,{rowHeight:s,paddingX:n,paddingY:l,bitWidth:a,bitsPerRow:i,showBits:d})=>{const c=e.append("g"),p=r*(s+l)+l;for(const o of t){const h=o.start%i*a+1,g=(o.end-o.start+1)*a-n;if(c.append("rect").attr("x",h).attr("y",p).attr("width",g).attr("height",s).attr("class","packetBlock"),c.append("text").attr("x",h+g/2).attr("y",p+s/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(o.label),!d)continue;const k=o.end===o.start,f=p-2;c.append("text").attr("x",h+(k?g/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(o.start),k||c.append("text").attr("x",h+g).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(o.end)}},"drawWord"),K={draw:H},O={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},j=b(({packet:e}={})=>{const t=m(O,e);return`
2
2
  .packetByte {
3
3
  font-size: ${t.byteFontSize};
4
4
  }
@@ -1 +1 @@
1
- import{M as ln,N as an,O as Y,P as O,Q,R as un,S as y,T as tn,V as j,W as _,X as rn,Y as o,Z as on,$ as sn,a0 as fn}from"./D6TmrqPb.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,D,S,v,R,V,a){var E=D-l,i=S-h,n=V-v,d=a-R,u=d*E-n*i;if(!(u*u<y))return u=(n*(h-R)-d*(l-v))/u,[l+u*E,h+u*i]}function H(l,h,D,S,v,R,V){var a=l-D,E=h-S,i=(V?R:-R)/j(a*a+E*E),n=i*E,d=-i*a,u=l+n,s=h+d,f=D+n,c=S+d,W=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,A=m*m+g*g,T=v-R,P=u*c-f*s,I=(g<0?-1:1)*j(on(0,T*T*A-P*P)),M=(P*g-m*I)/A,N=(-P*m-g*I)/A,w=(P*g+m*I)/A,p=(-P*m+g*I)/A,x=M-W,e=N-t,r=w-W,X=p-t;return x*x+e*e>r*r+X*X&&(M=w,N=p),{cx:M,cy:N,x01:-n,y01:-d,x11:M*(v/T-1),y11:N*(v/T-1)}}function hn(){var l=cn,h=yn,D=Q(0),S=null,v=gn,R=dn,V=mn,a=null,E=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=R.apply(this,arguments)-un,W=rn(c-f),t=c>f;if(a||(a=n=E()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(W>tn-y)a.moveTo(s*Y(f),s*O(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*Y(c),u*O(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,A=f,T=c,P=W,I=W,M=V.apply(this,arguments)/2,N=M>y&&(S?+S.apply(this,arguments):j(u*u+s*s)),w=_(rn(s-u)/2,+D.apply(this,arguments)),p=w,x=w,e,r;if(N>y){var X=sn(N/u*O(M)),z=sn(N/s*O(M));(P-=X*2)>y?(X*=t?1:-1,A+=X,T-=X):(P=0,A=T=(f+c)/2),(I-=z*2)>y?(z*=t?1:-1,m+=z,g-=z):(I=0,m=g=(f+c)/2)}var Z=s*Y(m),$=s*O(m),B=u*Y(T),C=u*O(T);if(w>y){var F=s*Y(g),G=s*O(g),J=u*Y(A),K=u*O(A),q;if(W<an)if(q=pn(Z,$,J,K,F,G,B,C)){var L=Z-q[0],U=$-q[1],k=F-q[0],b=G-q[1],nn=1/O(fn((L*k+U*b)/(j(L*L+U*U)*j(k*k+b*b)))/2),en=j(q[0]*q[0]+q[1]*q[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}I>y?x>y?(e=H(J,K,Z,$,s,x,t),r=H(F,G,B,C,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(Z,$),a.arc(0,0,s,m,g,!t)):a.moveTo(Z,$),!(u>y)||!(P>y)?a.lineTo(B,C):p>y?(e=H(B,C,F,G,u,-p,t),r=H(Z,$,J,K,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,A,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +R.apply(this,arguments))/2-an/2;return[Y(d)*n,O(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:Q(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:Q(+n),i):h},i.cornerRadius=function(n){return arguments.length?(D=typeof n=="function"?n:Q(+n),i):D},i.padRadius=function(n){return arguments.length?(S=n==null?null:typeof n=="function"?n:Q(+n),i):S},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:Q(+n),i):v},i.endAngle=function(n){return arguments.length?(R=typeof n=="function"?n:Q(+n),i):R},i.padAngle=function(n){return arguments.length?(V=typeof n=="function"?n:Q(+n),i):V},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
1
+ import{M as ln,N as an,O as Y,P as O,Q,R as un,S as y,T as tn,V as j,W as _,X as rn,Y as o,Z as on,$ as sn,a0 as fn}from"./B26luS__.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,D,S,v,R,V,a){var E=D-l,i=S-h,n=V-v,d=a-R,u=d*E-n*i;if(!(u*u<y))return u=(n*(h-R)-d*(l-v))/u,[l+u*E,h+u*i]}function H(l,h,D,S,v,R,V){var a=l-D,E=h-S,i=(V?R:-R)/j(a*a+E*E),n=i*E,d=-i*a,u=l+n,s=h+d,f=D+n,c=S+d,W=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,A=m*m+g*g,T=v-R,P=u*c-f*s,I=(g<0?-1:1)*j(on(0,T*T*A-P*P)),M=(P*g-m*I)/A,N=(-P*m-g*I)/A,w=(P*g+m*I)/A,p=(-P*m+g*I)/A,x=M-W,e=N-t,r=w-W,X=p-t;return x*x+e*e>r*r+X*X&&(M=w,N=p),{cx:M,cy:N,x01:-n,y01:-d,x11:M*(v/T-1),y11:N*(v/T-1)}}function hn(){var l=cn,h=yn,D=Q(0),S=null,v=gn,R=dn,V=mn,a=null,E=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=R.apply(this,arguments)-un,W=rn(c-f),t=c>f;if(a||(a=n=E()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(W>tn-y)a.moveTo(s*Y(f),s*O(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*Y(c),u*O(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,A=f,T=c,P=W,I=W,M=V.apply(this,arguments)/2,N=M>y&&(S?+S.apply(this,arguments):j(u*u+s*s)),w=_(rn(s-u)/2,+D.apply(this,arguments)),p=w,x=w,e,r;if(N>y){var X=sn(N/u*O(M)),z=sn(N/s*O(M));(P-=X*2)>y?(X*=t?1:-1,A+=X,T-=X):(P=0,A=T=(f+c)/2),(I-=z*2)>y?(z*=t?1:-1,m+=z,g-=z):(I=0,m=g=(f+c)/2)}var Z=s*Y(m),$=s*O(m),B=u*Y(T),C=u*O(T);if(w>y){var F=s*Y(g),G=s*O(g),J=u*Y(A),K=u*O(A),q;if(W<an)if(q=pn(Z,$,J,K,F,G,B,C)){var L=Z-q[0],U=$-q[1],k=F-q[0],b=G-q[1],nn=1/O(fn((L*k+U*b)/(j(L*L+U*U)*j(k*k+b*b)))/2),en=j(q[0]*q[0]+q[1]*q[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}I>y?x>y?(e=H(J,K,Z,$,s,x,t),r=H(F,G,B,C,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(Z,$),a.arc(0,0,s,m,g,!t)):a.moveTo(Z,$),!(u>y)||!(P>y)?a.lineTo(B,C):p>y?(e=H(B,C,F,G,u,-p,t),r=H(Z,$,J,K,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,A,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +R.apply(this,arguments))/2-an/2;return[Y(d)*n,O(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:Q(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:Q(+n),i):h},i.cornerRadius=function(n){return arguments.length?(D=typeof n=="function"?n:Q(+n),i):D},i.padRadius=function(n){return arguments.length?(S=n==null?null:typeof n=="function"?n:Q(+n),i):S},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:Q(+n),i):v},i.endAngle=function(n){return arguments.length?(R=typeof n=="function"?n:Q(+n),i):R},i.padAngle=function(n){return arguments.length?(V=typeof n=="function"?n:Q(+n),i):V},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
@@ -0,0 +1,5 @@
1
+ import{d as st,b as i,f as v,s as b,a as U,t as ot}from"./B2A7gHtL.js";import{p as ct,u as z,b as F,d as l,t as g,c as it,s as R,g as r,q as V,h as x,f as d,r as _,i as lt,n as dt,j as ut}from"./qR_TM3YX.js";import{i as u}from"./DpBBTLWw.js";import{g as vt,s as A,b as ft}from"./DXEhjiCw.js";import{g as pt}from"./Be_uRYmX.js";var gt=v("<span></span>"),xt=v('<span class="text-text-muted"> <!>)</span>'),_t=v('<span class="text-text-muted"> </span>'),mt=v('<span class="text-text-muted font-mono text-xs"> </span>'),bt=v('<span class="text-accent-green text-xs"> </span>'),ht=v('<!> <!> <!> <button class="ml-2 p-1 rounded hover:bg-bg-hover text-text-muted hover:text-accent-red transition-colors" title="Disconnect"><svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg></button>',1),wt=v('<span class="text-red-400 truncate max-w-48"> </span>'),yt=v(`<button class="ml-2 px-2 py-1 text-xs rounded border border-border-default hover:border-accent-cyan
2
+ text-text-muted hover:text-accent-cyan transition-colors" title="Retry connection">Retry</button>`),$t=v('<div><div class="relative flex items-center"><span></span> <!></div> <span> </span> <!> <!> <!> <!></div>');function Rt(G,H){ct(H,!0);const e=vt(),h=pt(),q={disconnected:{color:"bg-red-500",pulse:!1,label:"Disconnected"},connecting:{color:"bg-amber-500",pulse:!0,label:"Connecting..."},authenticating:{color:"bg-amber-500",pulse:!0,label:"Authenticating..."},connected:{color:"bg-accent-green",pulse:!1,label:"Connected"},error:{color:"bg-red-500",pulse:!0,label:"Error"}};let k=lt(()=>q[e.state.status]??q.disconnected),s=R(0),m=R(0),f=null,I=R(""),j=R(0);z(()=>{const t=e.state.status;F(()=>{if(t==="connected"){const n=r(s)>0;l(s,0),l(m,0),l(j,Date.now(),!0),f&&(clearInterval(f),f=null),n&&h.success("Reconnected","Connection restored successfully")}else t==="connecting"&&r(s)>0?J(5):t==="error"?(V(s),e.state.error&&h.error("Connection Error",e.state.error)):t==="disconnected"&&r(s)===0&&(h.warning("Disconnected","Connection lost, attempting to reconnect..."),l(s,1))})}),z(()=>{const t=e.state.status,n=F(()=>r(j));if(t==="connected"&&n>0){const a=setInterval(()=>{l(I,K(Date.now()-n),!0)},1e3);return()=>clearInterval(a)}});function J(t){l(m,t,!0),f&&clearInterval(f),f=setInterval(()=>{V(m,-1),r(m)<=0&&(clearInterval(f),f=null)},1e3)}function K(t){const n=Math.floor(t/1e3);if(n<60)return`${n}s`;const a=Math.floor(n/60);if(a<60)return`${a}m`;const p=Math.floor(a/60);return p<24?`${p}h ${a%60}m`:`${Math.floor(p/24)}d ${p%24}h`}function N(){e.url&&e.token&&(V(s),e.connect(e.url,e.token),h.info("Retrying","Attempting to reconnect..."))}function O(){e.disconnect(),l(s,0),l(m,0),l(I,""),l(j,0),h.info("Disconnected","Manually disconnected from gateway")}var D=$t(),E=x(D),B=x(E),P=d(B,2);{var Q=t=>{var n=gt();g(()=>A(n,1,`absolute block w-2 h-2 rounded-full ${r(k).color??""} animate-ping opacity-75`)),i(t,n)};u(P,t=>{r(k).pulse&&t(Q)})}_(E);var M=d(E,2),W=x(M,!0);_(M);var L=d(M,2);{var X=t=>{var n=xt(),a=x(n),p=d(a);{var w=y=>{var $=ot();g(()=>b($,`, retry in ${r(m)??""}s`)),i(y,$)};u(p,y=>{r(m)>0&&y(w)})}dt(),_(n),g(()=>b(a,`(#${r(s)??""}`)),i(t,n)};u(L,t=>{r(s)>0&&e.state.status!=="connected"&&t(X)})}var S=d(L,2);{var Y=t=>{var n=ht(),a=ut(n);{var p=o=>{var c=_t(),C=x(c);_(c),g(()=>b(C,`v${e.state.serverVersion??""}`)),i(o,c)};u(a,o=>{e.state.serverVersion&&o(p)})}var w=d(a,2);{var y=o=>{var c=mt(),C=x(c,!0);_(c),g(at=>b(C,at),[()=>e.state.connId.substring(0,8)]),i(o,c)};u(w,o=>{e.state.connId&&o(y)})}var $=d(w,2);{var nt=o=>{var c=bt(),C=x(c);_(c),g(()=>b(C,`↑${r(I)??""}`)),i(o,c)};u($,o=>{r(I)&&o(nt)})}var rt=d($,2);U("click",rt,O),i(t,n)};u(S,t=>{e.state.status==="connected"&&t(Y)})}var T=d(S,2);{var Z=t=>{var n=wt(),a=x(n,!0);_(n),g(()=>{ft(n,"title",e.state.error),b(a,e.state.error)}),i(t,n)};u(T,t=>{e.state.status==="error"&&e.state.error&&t(Z)})}var tt=d(T,2);{var et=t=>{var n=yt();U("click",n,N),i(t,n)};u(tt,t=>{(e.state.status==="error"||e.state.status==="disconnected")&&r(s)>0&&t(et)})}_(D),g(()=>{A(D,1,`flex items-center gap-2 px-3 py-1.5 rounded-lg glass text-xs transition-all duration-300
3
+ ${e.state.status==="connected"?"gradient-bg glow-green":""}`),A(B,1,`block w-2 h-2 rounded-full ${r(k).color??""} transition-colors duration-300
4
+ ${e.state.status==="connected"?"glow-green":""}`),A(M,1,`text-text-secondary transition-colors duration-300
5
+ ${e.state.status==="connected"?"text-accent-green":""}`),b(W,r(k).label)}),i(G,D),it()}st(["click"]);export{Rt as C};
@@ -1,4 +1,4 @@
1
- import{_ as w,aw as F,ax as Y,ay as _,az as H,l as i,c as V,aA as z,aB as U,ai as $,an as q,aj as P,ah as K,aC as Q,aD as W,aE as Z}from"./D6TmrqPb.js";import{G as B}from"./xiH5_-XQ.js";import{l as I}from"./f2z7Vhzy.js";import{i as b}from"./YH-SwxLT.js";import{c as L}from"./2UnHt_9K.js";import{m as A}from"./BwY8sfED.js";function h(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:ee(e),edges:ne(e)};return b(e.graph())||(t.value=L(e.graph())),t}function ee(e){return A(e.nodes(),function(t){var n=e.node(t),a=e.parent(t),r={v:t};return b(n)||(r.value=n),b(a)||(r.parent=a),r})}function ne(e){return A(e.edges(),function(t){var n=e.edge(t),a={v:t.v,w:t.w};return b(t.name)||(a.name=t.name),b(n)||(a.value=n),a})}var d=new Map,y=new Map,J=new Map,te=w(()=>{y.clear(),J.clear(),d.clear()},"clear"),D=w((e,t)=>{const n=y.get(t)||[];return i.trace("In isDescendant",t," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),se=w((e,t)=>{const n=y.get(t)||[];return i.info("Descendants of ",t," is ",n),i.info("Edge is ",e),e.v===t||e.w===t?!1:n?n.includes(e.v)||D(e.v,t)||D(e.w,t)||n.includes(e.w):(i.debug("Tilt, ",t,",not in descendants"),!1)},"edgeInCluster"),G=w((e,t,n,a)=>{i.warn("Copying children of ",e,"root",a,"data",t.node(e),a);const r=t.children(e)||[];e!==a&&r.push(e),i.warn("Copying (nodes) clusterId",e,"nodes",r),r.forEach(o=>{if(t.children(o).length>0)G(o,t,n,a);else{const l=t.node(o);i.info("cp ",o," to ",a," with parent ",e),n.setNode(o,l),a!==t.parent(o)&&(i.warn("Setting parent",o,t.parent(o)),n.setParent(o,t.parent(o))),e!==a&&o!==e?(i.debug("Setting parent",o,e),n.setParent(o,e)):(i.info("In copy ",e,"root",a,"data",t.node(e),a),i.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==a,"node!==clusterId",o!==e));const u=t.edges(o);i.debug("Copying Edges",u),u.forEach(c=>{i.info("Edge",c);const m=t.edge(c.v,c.w,c.name);i.info("Edge data",m,a);try{se(c,a)?(i.info("Copying as ",c.v,c.w,m,c.name),n.setEdge(c.v,c.w,m,c.name),i.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):i.info("Skipping copy of edge ",c.v,"-->",c.w," rootId: ",a," clusterId:",e)}catch(v){i.error(v)}})}i.debug("Removing node",o),t.removeNode(o)})},"copy"),R=w((e,t)=>{const n=t.children(e);let a=[...n];for(const r of n)J.set(r,e),a=[...a,...R(r,t)];return a},"extractDescendants"),ie=w((e,t,n)=>{const a=e.edges().filter(c=>c.v===t||c.w===t),r=e.edges().filter(c=>c.v===n||c.w===n),o=a.map(c=>({v:c.v===t?n:c.v,w:c.w===t?t:c.w})),l=r.map(c=>({v:c.v,w:c.w}));return o.filter(c=>l.some(m=>c.v===m.v&&c.w===m.w))},"findCommonEdges"),C=w((e,t,n)=>{const a=t.children(e);if(i.trace("Searching children of id ",e,a),a.length<1)return e;let r;for(const o of a){const l=C(o,t,n),u=ie(t,n,l);if(l)if(u.length>0)r=l;else return l}return r},"findNonClusterChild"),k=w(e=>!d.has(e)||!d.get(e).externalConnections?e:d.has(e)?d.get(e).id:e,"getAnchorId"),re=w((e,t)=>{if(!e||t>10){i.debug("Opting out, no graph ");return}else i.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(i.warn("Cluster identified",n," Replacement id in edges: ",C(n,e,n)),y.set(n,R(n,e)),d.set(n,{id:C(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const a=e.children(n),r=e.edges();a.length>0?(i.debug("Cluster identified",n,y),r.forEach(o=>{const l=D(o.v,n),u=D(o.w,n);l^u&&(i.warn("Edge: ",o," leaves cluster ",n),i.warn("Descendants of XXX ",n,": ",y.get(n)),d.get(n).externalConnections=!0)})):i.debug("Not a cluster ",n,y)});for(let n of d.keys()){const a=d.get(n).id,r=e.parent(a);r!==n&&d.has(r)&&!d.get(r).externalConnections&&(d.get(n).id=r)}e.edges().forEach(function(n){const a=e.edge(n);i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let r=n.v,o=n.w;if(i.warn("Fix XXX",d,"ids:",n.v,n.w,"Translating: ",d.get(n.v)," --- ",d.get(n.w)),d.get(n.v)||d.get(n.w)){if(i.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),r=k(n.v),o=k(n.w),e.removeEdge(n.v,n.w,n.name),r!==n.v){const l=e.parent(r);d.get(l).externalConnections=!0,a.fromCluster=n.v}if(o!==n.w){const l=e.parent(o);d.get(l).externalConnections=!0,a.toCluster=n.w}i.warn("Fix Replacing with XXX",r,o,n.name),e.setEdge(r,o,a,n.name)}}),i.warn("Adjusted Graph",h(e)),T(e,0),i.trace(d)},"adjustClustersAndEdges"),T=w((e,t)=>{if(i.warn("extractor - ",t,h(e),e.children("D")),t>10){i.error("Bailing out");return}let n=e.nodes(),a=!1;for(const r of n){const o=e.children(r);a=a||o.length>0}if(!a){i.debug("Done, no node has children",e.nodes());return}i.debug("Nodes = ",n,t);for(const r of n)if(i.debug("Extracting node",r,d,d.has(r)&&!d.get(r).externalConnections,!e.parent(r),e.node(r),e.children("D")," Depth ",t),!d.has(r))i.debug("Not a cluster",r,t);else if(!d.get(r).externalConnections&&e.children(r)&&e.children(r).length>0){i.warn("Cluster without external connections, without a parent and with children",r,t);let l=e.graph().rankdir==="TB"?"LR":"TB";d.get(r)?.clusterData?.dir&&(l=d.get(r).clusterData.dir,i.warn("Fixing dir",d.get(r).clusterData.dir,l));const u=new B({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});i.warn("Old graph before copy",h(e)),G(r,e,u,r),e.setNode(r,{clusterNode:!0,id:r,clusterData:d.get(r).clusterData,label:d.get(r).label,graph:u}),i.warn("New graph after copy node: (",r,")",h(u)),i.debug("Old graph after copy",h(e))}else i.warn("Cluster ** ",r," **not meeting the criteria !externalConnections:",!d.get(r).externalConnections," no parent: ",!e.parent(r)," children ",e.children(r)&&e.children(r).length>0,e.children("D"),t),i.debug(d);n=e.nodes(),i.warn("New list of nodes",n);for(const r of n){const o=e.node(r);i.warn(" Now next level",r,o),o?.clusterNode&&T(o.graph,t+1)}},"extractor"),M=w((e,t)=>{if(t.length===0)return[];let n=Object.assign([],t);return t.forEach(a=>{const r=e.children(a),o=M(e,r);n=[...n,...o]}),n},"sorter"),oe=w(e=>M(e,e.children()),"sortNodesByHierarchy"),j=w(async(e,t,n,a,r,o)=>{i.warn("Graph in recursive render:XAX",h(t),r);const l=t.graph().rankdir;i.trace("Dir in recursive render - dir:",l);const u=e.insert("g").attr("class","root");t.nodes()?i.info("Recursive render XXX",t.nodes()):i.info("No nodes found for",t),t.edges().length>0&&i.info("Recursive edges",t.edge(t.edges()[0]));const c=u.insert("g").attr("class","clusters"),m=u.insert("g").attr("class","edgePaths"),v=u.insert("g").attr("class","edgeLabels"),X=u.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(f){const s=t.node(f);if(r!==void 0){const g=JSON.parse(JSON.stringify(r.clusterData));i.trace(`Setting data for parent cluster XXX
1
+ import{_ as w,aw as F,ax as Y,ay as _,az as H,l as i,c as V,aA as z,aB as U,ai as $,an as q,aj as P,ah as K,aC as Q,aD as W,aE as Z}from"./B26luS__.js";import{G as B}from"./s1JCCdcW.js";import{l as I}from"./DP56tnrP.js";import{i as b}from"./B9jIaMGe.js";import{c as L}from"./pbkj8eYC.js";import{m as A}from"./BeZ-nXK1.js";function h(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:ee(e),edges:ne(e)};return b(e.graph())||(t.value=L(e.graph())),t}function ee(e){return A(e.nodes(),function(t){var n=e.node(t),a=e.parent(t),r={v:t};return b(n)||(r.value=n),b(a)||(r.parent=a),r})}function ne(e){return A(e.edges(),function(t){var n=e.edge(t),a={v:t.v,w:t.w};return b(t.name)||(a.name=t.name),b(n)||(a.value=n),a})}var d=new Map,y=new Map,J=new Map,te=w(()=>{y.clear(),J.clear(),d.clear()},"clear"),D=w((e,t)=>{const n=y.get(t)||[];return i.trace("In isDescendant",t," ",e," = ",n.includes(e)),n.includes(e)},"isDescendant"),se=w((e,t)=>{const n=y.get(t)||[];return i.info("Descendants of ",t," is ",n),i.info("Edge is ",e),e.v===t||e.w===t?!1:n?n.includes(e.v)||D(e.v,t)||D(e.w,t)||n.includes(e.w):(i.debug("Tilt, ",t,",not in descendants"),!1)},"edgeInCluster"),G=w((e,t,n,a)=>{i.warn("Copying children of ",e,"root",a,"data",t.node(e),a);const r=t.children(e)||[];e!==a&&r.push(e),i.warn("Copying (nodes) clusterId",e,"nodes",r),r.forEach(o=>{if(t.children(o).length>0)G(o,t,n,a);else{const l=t.node(o);i.info("cp ",o," to ",a," with parent ",e),n.setNode(o,l),a!==t.parent(o)&&(i.warn("Setting parent",o,t.parent(o)),n.setParent(o,t.parent(o))),e!==a&&o!==e?(i.debug("Setting parent",o,e),n.setParent(o,e)):(i.info("In copy ",e,"root",a,"data",t.node(e),a),i.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==a,"node!==clusterId",o!==e));const u=t.edges(o);i.debug("Copying Edges",u),u.forEach(c=>{i.info("Edge",c);const m=t.edge(c.v,c.w,c.name);i.info("Edge data",m,a);try{se(c,a)?(i.info("Copying as ",c.v,c.w,m,c.name),n.setEdge(c.v,c.w,m,c.name),i.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):i.info("Skipping copy of edge ",c.v,"-->",c.w," rootId: ",a," clusterId:",e)}catch(v){i.error(v)}})}i.debug("Removing node",o),t.removeNode(o)})},"copy"),R=w((e,t)=>{const n=t.children(e);let a=[...n];for(const r of n)J.set(r,e),a=[...a,...R(r,t)];return a},"extractDescendants"),ie=w((e,t,n)=>{const a=e.edges().filter(c=>c.v===t||c.w===t),r=e.edges().filter(c=>c.v===n||c.w===n),o=a.map(c=>({v:c.v===t?n:c.v,w:c.w===t?t:c.w})),l=r.map(c=>({v:c.v,w:c.w}));return o.filter(c=>l.some(m=>c.v===m.v&&c.w===m.w))},"findCommonEdges"),C=w((e,t,n)=>{const a=t.children(e);if(i.trace("Searching children of id ",e,a),a.length<1)return e;let r;for(const o of a){const l=C(o,t,n),u=ie(t,n,l);if(l)if(u.length>0)r=l;else return l}return r},"findNonClusterChild"),k=w(e=>!d.has(e)||!d.get(e).externalConnections?e:d.has(e)?d.get(e).id:e,"getAnchorId"),re=w((e,t)=>{if(!e||t>10){i.debug("Opting out, no graph ");return}else i.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(i.warn("Cluster identified",n," Replacement id in edges: ",C(n,e,n)),y.set(n,R(n,e)),d.set(n,{id:C(n,e,n),clusterData:e.node(n)}))}),e.nodes().forEach(function(n){const a=e.children(n),r=e.edges();a.length>0?(i.debug("Cluster identified",n,y),r.forEach(o=>{const l=D(o.v,n),u=D(o.w,n);l^u&&(i.warn("Edge: ",o," leaves cluster ",n),i.warn("Descendants of XXX ",n,": ",y.get(n)),d.get(n).externalConnections=!0)})):i.debug("Not a cluster ",n,y)});for(let n of d.keys()){const a=d.get(n).id,r=e.parent(a);r!==n&&d.has(r)&&!d.get(r).externalConnections&&(d.get(n).id=r)}e.edges().forEach(function(n){const a=e.edge(n);i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),i.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let r=n.v,o=n.w;if(i.warn("Fix XXX",d,"ids:",n.v,n.w,"Translating: ",d.get(n.v)," --- ",d.get(n.w)),d.get(n.v)||d.get(n.w)){if(i.warn("Fixing and trying - removing XXX",n.v,n.w,n.name),r=k(n.v),o=k(n.w),e.removeEdge(n.v,n.w,n.name),r!==n.v){const l=e.parent(r);d.get(l).externalConnections=!0,a.fromCluster=n.v}if(o!==n.w){const l=e.parent(o);d.get(l).externalConnections=!0,a.toCluster=n.w}i.warn("Fix Replacing with XXX",r,o,n.name),e.setEdge(r,o,a,n.name)}}),i.warn("Adjusted Graph",h(e)),T(e,0),i.trace(d)},"adjustClustersAndEdges"),T=w((e,t)=>{if(i.warn("extractor - ",t,h(e),e.children("D")),t>10){i.error("Bailing out");return}let n=e.nodes(),a=!1;for(const r of n){const o=e.children(r);a=a||o.length>0}if(!a){i.debug("Done, no node has children",e.nodes());return}i.debug("Nodes = ",n,t);for(const r of n)if(i.debug("Extracting node",r,d,d.has(r)&&!d.get(r).externalConnections,!e.parent(r),e.node(r),e.children("D")," Depth ",t),!d.has(r))i.debug("Not a cluster",r,t);else if(!d.get(r).externalConnections&&e.children(r)&&e.children(r).length>0){i.warn("Cluster without external connections, without a parent and with children",r,t);let l=e.graph().rankdir==="TB"?"LR":"TB";d.get(r)?.clusterData?.dir&&(l=d.get(r).clusterData.dir,i.warn("Fixing dir",d.get(r).clusterData.dir,l));const u=new B({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});i.warn("Old graph before copy",h(e)),G(r,e,u,r),e.setNode(r,{clusterNode:!0,id:r,clusterData:d.get(r).clusterData,label:d.get(r).label,graph:u}),i.warn("New graph after copy node: (",r,")",h(u)),i.debug("Old graph after copy",h(e))}else i.warn("Cluster ** ",r," **not meeting the criteria !externalConnections:",!d.get(r).externalConnections," no parent: ",!e.parent(r)," children ",e.children(r)&&e.children(r).length>0,e.children("D"),t),i.debug(d);n=e.nodes(),i.warn("New list of nodes",n);for(const r of n){const o=e.node(r);i.warn(" Now next level",r,o),o?.clusterNode&&T(o.graph,t+1)}},"extractor"),M=w((e,t)=>{if(t.length===0)return[];let n=Object.assign([],t);return t.forEach(a=>{const r=e.children(a),o=M(e,r);n=[...n,...o]}),n},"sorter"),oe=w(e=>M(e,e.children()),"sortNodesByHierarchy"),j=w(async(e,t,n,a,r,o)=>{i.warn("Graph in recursive render:XAX",h(t),r);const l=t.graph().rankdir;i.trace("Dir in recursive render - dir:",l);const u=e.insert("g").attr("class","root");t.nodes()?i.info("Recursive render XXX",t.nodes()):i.info("No nodes found for",t),t.edges().length>0&&i.info("Recursive edges",t.edge(t.edges()[0]));const c=u.insert("g").attr("class","clusters"),m=u.insert("g").attr("class","edgePaths"),v=u.insert("g").attr("class","edgeLabels"),X=u.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(f){const s=t.node(f);if(r!==void 0){const g=JSON.parse(JSON.stringify(r.clusterData));i.trace(`Setting data for parent cluster XXX
2
2
  Node.id = `,f,`
3
3
  data=`,g.height,`
4
4
  Parent cluster`,r.height),t.setNode(r.id,g),t.parent(f)||(i.trace("Setting parent",f,r.id),t.setParent(f,r.id,g))}if(i.info("(Insert) Node XXX"+f+": "+JSON.stringify(t.node(f))),s?.clusterNode){i.info("Cluster identified XBX",f,s.width,t.node(f));const{ranksep:g,nodesep:E}=t.graph();s.graph.setGraph({...s.graph.graph(),ranksep:g+25,nodesep:E});const N=await j(X,s.graph,n,a,t.node(f),o),x=N.elem;z(s,x),s.diff=N.diff||0,i.info("New compound node after recursive render XAX",f,"width",s.width,"height",s.height),U(x,s)}else t.children(f).length>0?(i.trace("Cluster - the non recursive path XBX",f,s.id,s,s.width,"Graph:",t),i.trace(C(s.id,t)),d.set(s.id,{id:C(s.id,t),node:s})):(i.trace("Node - the non recursive path XAX",f,X,t.node(f),l),await $(X,t.node(f),{config:o,dir:l}))})),await w(async()=>{const f=t.edges().map(async function(s){const g=t.edge(s.v,s.w,s.name);i.info("Edge "+s.v+" -> "+s.w+": "+JSON.stringify(s)),i.info("Edge "+s.v+" -> "+s.w+": ",s," ",JSON.stringify(t.edge(s))),i.info("Fix",d,"ids:",s.v,s.w,"Translating: ",d.get(s.v),d.get(s.w)),await Z(v,g)});await Promise.all(f)},"processEdges")(),i.info("Graph before layout:",JSON.stringify(h(t))),i.info("############################################# XXX"),i.info("### Layout ### XXX"),i.info("############################################# XXX"),I(t),i.info("Graph after layout:",JSON.stringify(h(t)));let O=0,{subGraphTitleTotalMargin:S}=q(o);return await Promise.all(oe(t).map(async function(f){const s=t.node(f);if(i.info("Position XBX => "+f+": ("+s.x,","+s.y,") width: ",s.width," height: ",s.height),s?.clusterNode)s.y+=S,i.info("A tainted cluster node XBX1",f,s.id,s.width,s.height,s.x,s.y,t.parent(f)),d.get(s.id).node=s,P(s);else if(t.children(f).length>0){i.info("A pure cluster node XBX1",f,s.id,s.x,s.y,s.width,s.height,t.parent(f)),s.height+=S,t.node(s.parentId);const g=s?.padding/2||0,E=s?.labelBBox?.height||0,N=E-g||0;i.debug("OffsetY",N,"labelHeight",E,"halfPadding",g),await K(c,s),d.get(s.id).node=s}else{const g=t.node(s.parentId);s.y+=S/2,i.info("A regular node XBX1 - using the padding",s.id,"parent",s.parentId,s.width,s.height,s.x,s.y,"offsetY",s.offsetY,"parent",g,g?.offsetY,s),P(s)}})),t.edges().forEach(function(f){const s=t.edge(f);i.info("Edge "+f.v+" -> "+f.w+": "+JSON.stringify(s),s),s.points.forEach(x=>x.y+=S/2);const g=t.node(f.v);var E=t.node(f.w);const N=Q(m,s,d,n,g,E,a);W(s,N)}),t.nodes().forEach(function(f){const s=t.node(f);i.info(f,s.type,s.diff),s.isGroup&&(O=s.diff)}),i.warn("Returning from recursive render XAX",u,O),{elem:u,diff:O}},"recursiveRender"),ge=w(async(e,t)=>{const n=new B({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.config?.flowchart?.nodeSpacing||e.nodeSpacing,ranksep:e.config?.rankSpacing||e.config?.flowchart?.rankSpacing||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),a=t.select("g");F(a,e.markers,e.type,e.diagramId),Y(),_(),H(),te(),e.nodes.forEach(o=>{n.setNode(o.id,{...o}),o.parentId&&n.setParent(o.id,o.parentId)}),i.debug("Edges:",e.edges),e.edges.forEach(o=>{if(o.start===o.end){const l=o.start,u=l+"---"+l+"---1",c=l+"---"+l+"---2",m=n.node(l);n.setNode(u,{domId:u,id:u,parentId:m.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),n.setParent(u,m.parentId),n.setNode(c,{domId:c,id:c,parentId:m.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),n.setParent(c,m.parentId);const v=structuredClone(o),X=structuredClone(o),p=structuredClone(o);v.label="",v.arrowTypeEnd="none",v.id=l+"-cyclic-special-1",X.arrowTypeStart="none",X.arrowTypeEnd="none",X.id=l+"-cyclic-special-mid",p.label="",m.isGroup&&(v.fromCluster=l,p.toCluster=l),p.id=l+"-cyclic-special-2",p.arrowTypeStart="none",n.setEdge(l,u,v,l+"-cyclic-special-0"),n.setEdge(u,c,X,l+"-cyclic-special-1"),n.setEdge(c,l,p,l+"-cyc<lic-special-2")}else n.setEdge(o.start,o.end,{...o},o.id)}),i.warn("Graph at first:",JSON.stringify(h(n))),re(n),i.warn("Graph after XAX:",JSON.stringify(h(n)));const r=V();await j(a,n,e.type,e.diagramId,void 0,r)},"render");export{ge as render};
@@ -1,4 +1,4 @@
1
- import{g as le}from"./BQKxqYwa.js";import{s as he}from"./BwK9WVrR.js";import{_ as l,l as I,p as de,r as ge,G as B,c as z,i as V,aH as ue,ad as pe,ae as fe,af as ye}from"./D6TmrqPb.js";const E=[];for(let t=0;t<256;++t)E.push((t+256).toString(16).slice(1));function me(t,e=0){return(E[t[e+0]]+E[t[e+1]]+E[t[e+2]]+E[t[e+3]]+"-"+E[t[e+4]]+E[t[e+5]]+"-"+E[t[e+6]]+E[t[e+7]]+"-"+E[t[e+8]]+E[t[e+9]]+"-"+E[t[e+10]]+E[t[e+11]]+E[t[e+12]]+E[t[e+13]]+E[t[e+14]]+E[t[e+15]]).toLowerCase()}let W;const Ee=new Uint8Array(16);function _e(){if(!W){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");W=crypto.getRandomValues.bind(crypto)}return W(Ee)}const be=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ne={randomUUID:be};function Se(t,e,n){if(ne.randomUUID&&!t)return ne.randomUUID();t=t||{};const c=t.random??t.rng?.()??_e();if(c.length<16)throw new Error("Random bytes length must be >= 16");return c[6]=c[6]&15|64,c[8]=c[8]&63|128,me(c)}var X=(function(){var t=l(function(x,s,i,o){for(i=i||{},o=x.length;o--;i[x[o]]=s);return i},"o"),e=[1,4],n=[1,13],c=[1,12],f=[1,15],h=[1,16],p=[1,20],m=[1,19],u=[6,7,8],N=[1,26],Y=[1,24],q=[1,25],b=[6,7,11],J=[1,6,13,15,16,19,22],K=[1,33],Q=[1,34],R=[1,6,7,11,13,15,16,19,22],F={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:l(function(s,i,o,a,g,r,w){var d=r.length-1;switch(g){case 6:case 7:return a;case 8:a.getLogger().trace("Stop NL ");break;case 9:a.getLogger().trace("Stop EOF ");break;case 11:a.getLogger().trace("Stop NL2 ");break;case 12:a.getLogger().trace("Stop EOF2 ");break;case 15:a.getLogger().info("Node: ",r[d].id),a.addNode(r[d-1].length,r[d].id,r[d].descr,r[d].type);break;case 16:a.getLogger().trace("Icon: ",r[d]),a.decorateNode({icon:r[d]});break;case 17:case 21:a.decorateNode({class:r[d]});break;case 18:a.getLogger().trace("SPACELIST");break;case 19:a.getLogger().trace("Node: ",r[d].id),a.addNode(0,r[d].id,r[d].descr,r[d].type);break;case 20:a.decorateNode({icon:r[d]});break;case 25:a.getLogger().trace("node found ..",r[d-2]),this.$={id:r[d-1],descr:r[d-1],type:a.getType(r[d-2],r[d])};break;case 26:this.$={id:r[d],descr:r[d],type:a.nodeType.DEFAULT};break;case 27:a.getLogger().trace("node found ..",r[d-3]),this.$={id:r[d-3],descr:r[d-1],type:a.getType(r[d-2],r[d])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:n,7:[1,10],9:9,12:11,13:c,14:14,15:f,16:h,17:17,18:18,19:p,22:m},t(u,[2,3]),{1:[2,2]},t(u,[2,4]),t(u,[2,5]),{1:[2,6],6:n,12:21,13:c,14:14,15:f,16:h,17:17,18:18,19:p,22:m},{6:n,9:22,12:11,13:c,14:14,15:f,16:h,17:17,18:18,19:p,22:m},{6:N,7:Y,10:23,11:q},t(b,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:p,22:m}),t(b,[2,18]),t(b,[2,19]),t(b,[2,20]),t(b,[2,21]),t(b,[2,23]),t(b,[2,24]),t(b,[2,26],{19:[1,30]}),{20:[1,31]},{6:N,7:Y,10:32,11:q},{1:[2,7],6:n,12:21,13:c,14:14,15:f,16:h,17:17,18:18,19:p,22:m},t(J,[2,14],{7:K,11:Q}),t(R,[2,8]),t(R,[2,9]),t(R,[2,10]),t(b,[2,15]),t(b,[2,16]),t(b,[2,17]),{20:[1,35]},{21:[1,36]},t(J,[2,13],{7:K,11:Q}),t(R,[2,11]),t(R,[2,12]),{21:[1,37]},t(b,[2,25]),t(b,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:l(function(s,i){if(i.recoverable)this.trace(s);else{var o=new Error(s);throw o.hash=i,o}},"parseError"),parse:l(function(s){var i=this,o=[0],a=[],g=[null],r=[],w=this.table,d="",U=0,Z=0,re=2,ee=1,oe=r.slice.call(arguments,1),y=Object.create(this.lexer),v={yy:{}};for(var G in this.yy)Object.prototype.hasOwnProperty.call(this.yy,G)&&(v.yy[G]=this.yy[G]);y.setInput(s,v.yy),v.yy.lexer=y,v.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var j=y.yylloc;r.push(j);var ae=y.options&&y.options.ranges;typeof v.yy.parseError=="function"?this.parseError=v.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ce(S){o.length=o.length-2*S,g.length=g.length-S,r.length=r.length-S}l(ce,"popStack");function te(){var S;return S=a.pop()||y.lex()||ee,typeof S!="number"&&(S instanceof Array&&(a=S,S=a.pop()),S=i.symbols_[S]||S),S}l(te,"lex");for(var _,T,D,H,O={},P,k,ie,M;;){if(T=o[o.length-1],this.defaultActions[T]?D=this.defaultActions[T]:((_===null||typeof _>"u")&&(_=te()),D=w[T]&&w[T][_]),typeof D>"u"||!D.length||!D[0]){var $="";M=[];for(P in w[T])this.terminals_[P]&&P>re&&M.push("'"+this.terminals_[P]+"'");y.showPosition?$="Parse error on line "+(U+1)+`:
1
+ import{g as le}from"./DUYD8zIj.js";import{s as he}from"./ecD8_m48.js";import{_ as l,l as I,p as de,r as ge,G as B,c as z,i as V,aH as ue,ad as pe,ae as fe,af as ye}from"./B26luS__.js";const E=[];for(let t=0;t<256;++t)E.push((t+256).toString(16).slice(1));function me(t,e=0){return(E[t[e+0]]+E[t[e+1]]+E[t[e+2]]+E[t[e+3]]+"-"+E[t[e+4]]+E[t[e+5]]+"-"+E[t[e+6]]+E[t[e+7]]+"-"+E[t[e+8]]+E[t[e+9]]+"-"+E[t[e+10]]+E[t[e+11]]+E[t[e+12]]+E[t[e+13]]+E[t[e+14]]+E[t[e+15]]).toLowerCase()}let W;const Ee=new Uint8Array(16);function _e(){if(!W){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");W=crypto.getRandomValues.bind(crypto)}return W(Ee)}const be=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ne={randomUUID:be};function Se(t,e,n){if(ne.randomUUID&&!t)return ne.randomUUID();t=t||{};const c=t.random??t.rng?.()??_e();if(c.length<16)throw new Error("Random bytes length must be >= 16");return c[6]=c[6]&15|64,c[8]=c[8]&63|128,me(c)}var X=(function(){var t=l(function(x,s,i,o){for(i=i||{},o=x.length;o--;i[x[o]]=s);return i},"o"),e=[1,4],n=[1,13],c=[1,12],f=[1,15],h=[1,16],p=[1,20],m=[1,19],u=[6,7,8],N=[1,26],Y=[1,24],q=[1,25],b=[6,7,11],J=[1,6,13,15,16,19,22],K=[1,33],Q=[1,34],R=[1,6,7,11,13,15,16,19,22],F={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:l(function(s,i,o,a,g,r,w){var d=r.length-1;switch(g){case 6:case 7:return a;case 8:a.getLogger().trace("Stop NL ");break;case 9:a.getLogger().trace("Stop EOF ");break;case 11:a.getLogger().trace("Stop NL2 ");break;case 12:a.getLogger().trace("Stop EOF2 ");break;case 15:a.getLogger().info("Node: ",r[d].id),a.addNode(r[d-1].length,r[d].id,r[d].descr,r[d].type);break;case 16:a.getLogger().trace("Icon: ",r[d]),a.decorateNode({icon:r[d]});break;case 17:case 21:a.decorateNode({class:r[d]});break;case 18:a.getLogger().trace("SPACELIST");break;case 19:a.getLogger().trace("Node: ",r[d].id),a.addNode(0,r[d].id,r[d].descr,r[d].type);break;case 20:a.decorateNode({icon:r[d]});break;case 25:a.getLogger().trace("node found ..",r[d-2]),this.$={id:r[d-1],descr:r[d-1],type:a.getType(r[d-2],r[d])};break;case 26:this.$={id:r[d],descr:r[d],type:a.nodeType.DEFAULT};break;case 27:a.getLogger().trace("node found ..",r[d-3]),this.$={id:r[d-3],descr:r[d-1],type:a.getType(r[d-2],r[d])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:n,7:[1,10],9:9,12:11,13:c,14:14,15:f,16:h,17:17,18:18,19:p,22:m},t(u,[2,3]),{1:[2,2]},t(u,[2,4]),t(u,[2,5]),{1:[2,6],6:n,12:21,13:c,14:14,15:f,16:h,17:17,18:18,19:p,22:m},{6:n,9:22,12:11,13:c,14:14,15:f,16:h,17:17,18:18,19:p,22:m},{6:N,7:Y,10:23,11:q},t(b,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:p,22:m}),t(b,[2,18]),t(b,[2,19]),t(b,[2,20]),t(b,[2,21]),t(b,[2,23]),t(b,[2,24]),t(b,[2,26],{19:[1,30]}),{20:[1,31]},{6:N,7:Y,10:32,11:q},{1:[2,7],6:n,12:21,13:c,14:14,15:f,16:h,17:17,18:18,19:p,22:m},t(J,[2,14],{7:K,11:Q}),t(R,[2,8]),t(R,[2,9]),t(R,[2,10]),t(b,[2,15]),t(b,[2,16]),t(b,[2,17]),{20:[1,35]},{21:[1,36]},t(J,[2,13],{7:K,11:Q}),t(R,[2,11]),t(R,[2,12]),{21:[1,37]},t(b,[2,25]),t(b,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:l(function(s,i){if(i.recoverable)this.trace(s);else{var o=new Error(s);throw o.hash=i,o}},"parseError"),parse:l(function(s){var i=this,o=[0],a=[],g=[null],r=[],w=this.table,d="",U=0,Z=0,re=2,ee=1,oe=r.slice.call(arguments,1),y=Object.create(this.lexer),v={yy:{}};for(var G in this.yy)Object.prototype.hasOwnProperty.call(this.yy,G)&&(v.yy[G]=this.yy[G]);y.setInput(s,v.yy),v.yy.lexer=y,v.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var j=y.yylloc;r.push(j);var ae=y.options&&y.options.ranges;typeof v.yy.parseError=="function"?this.parseError=v.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ce(S){o.length=o.length-2*S,g.length=g.length-S,r.length=r.length-S}l(ce,"popStack");function te(){var S;return S=a.pop()||y.lex()||ee,typeof S!="number"&&(S instanceof Array&&(a=S,S=a.pop()),S=i.symbols_[S]||S),S}l(te,"lex");for(var _,T,D,H,O={},P,k,ie,M;;){if(T=o[o.length-1],this.defaultActions[T]?D=this.defaultActions[T]:((_===null||typeof _>"u")&&(_=te()),D=w[T]&&w[T][_]),typeof D>"u"||!D.length||!D[0]){var $="";M=[];for(P in w[T])this.terminals_[P]&&P>re&&M.push("'"+this.terminals_[P]+"'");y.showPosition?$="Parse error on line "+(U+1)+`:
2
2
  `+y.showPosition()+`
3
3
  Expecting `+M.join(", ")+", got '"+(this.terminals_[_]||_)+"'":$="Parse error on line "+(U+1)+": Unexpected "+(_==ee?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError($,{text:y.match,token:this.terminals_[_]||_,line:y.yylineno,loc:j,expected:M})}if(D[0]instanceof Array&&D.length>1)throw new Error("Parse Error: multiple actions possible at state: "+T+", token: "+_);switch(D[0]){case 1:o.push(_),g.push(y.yytext),r.push(y.yylloc),o.push(D[1]),_=null,Z=y.yyleng,d=y.yytext,U=y.yylineno,j=y.yylloc;break;case 2:if(k=this.productions_[D[1]][1],O.$=g[g.length-k],O._$={first_line:r[r.length-(k||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(k||1)].first_column,last_column:r[r.length-1].last_column},ae&&(O._$.range=[r[r.length-(k||1)].range[0],r[r.length-1].range[1]]),H=this.performAction.apply(O,[d,Z,U,v.yy,D[1],g,r].concat(oe)),typeof H<"u")return H;k&&(o=o.slice(0,-1*k*2),g=g.slice(0,-1*k),r=r.slice(0,-1*k)),o.push(this.productions_[D[1]][0]),g.push(O.$),r.push(O._$),ie=w[o[o.length-2]][o[o.length-1]],o.push(ie);break;case 3:return!0}}return!0},"parse")},se=(function(){var x={EOF:1,parseError:l(function(i,o){if(this.yy.parser)this.yy.parser.parseError(i,o);else throw new Error(i)},"parseError"),setInput:l(function(s,i){return this.yy=i||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:l(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var i=s.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:l(function(s){var i=s.length,o=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var a=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var g=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===a.length?this.yylloc.first_column:0)+a[a.length-o.length].length-o[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[g[0],g[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(s){this.unput(this.match.slice(s))},"less"),pastInput:l(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var s=this.pastInput(),i=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
@@ -1 +1 @@
1
- import{s as a,b as t,a as r,S as s}from"./BR-s7H7s.js";import{_ as i}from"./D6TmrqPb.js";var _={parser:r,get db(){return new s(2)},renderer:t,styles:a,init:i(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{_ as diagram};
1
+ import{s as a,b as t,a as r,S as s}from"./C-sMwVJq.js";import{_ as i}from"./B26luS__.js";var _={parser:r,get db(){return new s(2)},renderer:t,styles:a,init:i(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{_ as diagram};
@@ -1,4 +1,4 @@
1
- import{g as qt}from"./C1Eymii5.js";import{_ as m,o as Ot,l as $,c as b1,d as E1,p as Ht,r as Xt,u as it,b as Qt,s as Jt,q as Zt,a as $t,g as te,t as ee,k as se,v as ie,J as re,x as ae,y as st,z as ne,A as ue,B as oe}from"./D6TmrqPb.js";import{g as le}from"./BQKxqYwa.js";import{s as ce}from"./BwK9WVrR.js";import{c as he}from"./B4GbTqhO.js";var de="flowchart-",G1,pe=(G1=class{constructor(){this.vertexCounter=0,this.config=b1(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=Qt,this.setAccDescription=Jt,this.setDiagramTitle=Zt,this.getAccTitle=$t,this.getAccDescription=te,this.getDiagramTitle=ee,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(i){return se.sanitizeText(i,this.config)}lookUpDomId(i){for(const r of this.vertices.values())if(r.id===i)return r.domId;return i}addVertex(i,r,a,n,l,g,c={},b){if(!i||i.trim().length===0)return;let u;if(b!==void 0){let k;b.includes(`
1
+ import{g as qt}from"./BuTRGpGL.js";import{_ as m,o as Ot,l as $,c as b1,d as E1,p as Ht,r as Xt,u as it,b as Qt,s as Jt,q as Zt,a as $t,g as te,t as ee,k as se,v as ie,J as re,x as ae,y as st,z as ne,A as ue,B as oe}from"./B26luS__.js";import{g as le}from"./DUYD8zIj.js";import{s as ce}from"./ecD8_m48.js";import{c as he}from"./Bh70dShK.js";var de="flowchart-",G1,pe=(G1=class{constructor(){this.vertexCounter=0,this.config=b1(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=Qt,this.setAccDescription=Jt,this.setDiagramTitle=Zt,this.getAccTitle=$t,this.getAccDescription=te,this.getDiagramTitle=ee,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(i){return se.sanitizeText(i,this.config)}lookUpDomId(i){for(const r of this.vertices.values())if(r.id===i)return r.domId;return i}addVertex(i,r,a,n,l,g,c={},b){if(!i||i.trim().length===0)return;let u;if(b!==void 0){let k;b.includes(`
2
2
  `)?k=b+`
3
3
  `:k=`{
4
4
  `+b+`
@@ -1 +1 @@
1
- import{G as g}from"./xiH5_-XQ.js";import{b as Te,p as ce,q as le,g as z,e as ee,l as F,o as Ie,s as Me,c as Se,u as je,d as f,i as m,f as _,v as x,r as M}from"./YH-SwxLT.js";import{f as O,b as he,a as Fe,c as Ve,d as Ae,t as V,m as w,e as P,h as ve,g as U,l as T,i as Be}from"./BwY8sfED.js";import{b8 as Ge,b9 as Ye,ba as De,aO as qe,bb as $e,aS as pe,aR as we,bc as We,aN as q,ar as ze,aU as Ue,at as Xe,bd as $}from"./D6TmrqPb.js";function He(e){return Ge(Ye(e,void 0,O),e+"")}var Je=1,Ze=4;function Ke(e){return Te(e,Je|Ze)}function Qe(e,n){return e==null?e:De(e,ce(n),qe)}function en(e,n){return e&&le(e,ce(n))}function nn(e,n){return e>n}function S(e,n){var r={};return n=z(n),le(e,function(t,a,i){$e(r,a,n(t,a,i))}),r}function y(e){return e&&e.length?he(e,pe,nn):void 0}function X(e,n){return e&&e.length?he(e,z(n),Fe):void 0}function rn(e,n){var r=e.length;for(e.sort(n);r--;)e[r]=e[r].value;return e}function tn(e,n){if(e!==n){var r=e!==void 0,t=e===null,a=e===e,i=ee(e),o=n!==void 0,u=n===null,d=n===n,s=ee(n);if(!u&&!s&&!i&&e>n||i&&o&&d&&!u&&!s||t&&o&&d||!r&&d||!a)return 1;if(!t&&!i&&!s&&e<n||s&&r&&a&&!t&&!i||u&&r&&a||!o&&a||!d)return-1}return 0}function an(e,n,r){for(var t=-1,a=e.criteria,i=n.criteria,o=a.length,u=r.length;++t<o;){var d=tn(a[t],i[t]);if(d){if(t>=u)return d;var s=r[t];return d*(s=="desc"?-1:1)}}return e.index-n.index}function on(e,n,r){n.length?n=F(n,function(i){return we(i)?function(o){return Ie(o,i.length===1?i[0]:i)}:i}):n=[pe];var t=-1;n=F(n,We(z));var a=Ve(e,function(i,o,u){var d=F(n,function(s){return s(i)});return{criteria:d,index:++t,value:i}});return rn(a,function(i,o){return an(i,o,r)})}function un(e,n){return Ae(e,n,function(r,t){return Me(e,t)})}var I=He(function(e,n){return e==null?{}:un(e,n)}),dn=Math.ceil,sn=Math.max;function fn(e,n,r,t){for(var a=-1,i=sn(dn((n-e)/(r||1)),0),o=Array(i);i--;)o[++a]=e,e+=r;return o}function cn(e){return function(n,r,t){return t&&typeof t!="number"&&q(n,r,t)&&(r=t=void 0),n=V(n),r===void 0?(r=n,n=0):r=V(r),t=t===void 0?n<r?1:-1:V(t),fn(n,r,t)}}var E=cn(),R=ze(function(e,n){if(e==null)return[];var r=n.length;return r>1&&q(e,n[0],n[1])?n=[]:r>2&&q(n[0],n[1],n[2])&&(n=[n[0]]),on(e,Se(n),[])}),ln=0;function H(e){var n=++ln;return je(e)+n}function hn(e,n,r){for(var t=-1,a=e.length,i=n.length,o={};++t<a;){var u=t<i?n[t]:void 0;r(o,e[t],u)}return o}function vn(e,n){return hn(e||[],n||[],Ue)}class pn{constructor(){var n={};n._next=n._prev=n,this._sentinel=n}dequeue(){var n=this._sentinel,r=n._prev;if(r!==n)return ne(r),r}enqueue(n){var r=this._sentinel;n._prev&&n._next&&ne(n),n._next=r._next,r._next._prev=n,r._next=n,n._prev=r}toString(){for(var n=[],r=this._sentinel,t=r._prev;t!==r;)n.push(JSON.stringify(t,wn)),t=t._prev;return"["+n.join(", ")+"]"}}function ne(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function wn(e,n){if(e!=="_next"&&e!=="_prev")return n}var bn=Xe(1);function mn(e,n){if(e.nodeCount()<=1)return[];var r=yn(e,n||bn),t=gn(r.graph,r.buckets,r.zeroIdx);return O(w(t,function(a){return e.outEdges(a.v,a.w)}))}function gn(e,n,r){for(var t=[],a=n[n.length-1],i=n[0],o;e.nodeCount();){for(;o=i.dequeue();)A(e,n,r,o);for(;o=a.dequeue();)A(e,n,r,o);if(e.nodeCount()){for(var u=n.length-2;u>0;--u)if(o=n[u].dequeue(),o){t=t.concat(A(e,n,r,o,!0));break}}}return t}function A(e,n,r,t,a){var i=a?[]:void 0;return f(e.inEdges(t.v),function(o){var u=e.edge(o),d=e.node(o.v);a&&i.push({v:o.v,w:o.w}),d.out-=u,W(n,r,d)}),f(e.outEdges(t.v),function(o){var u=e.edge(o),d=o.w,s=e.node(d);s.in-=u,W(n,r,s)}),e.removeNode(t.v),i}function yn(e,n){var r=new g,t=0,a=0;f(e.nodes(),function(u){r.setNode(u,{v:u,in:0,out:0})}),f(e.edges(),function(u){var d=r.edge(u.v,u.w)||0,s=n(u),c=d+s;r.setEdge(u.v,u.w,c),a=Math.max(a,r.node(u.v).out+=s),t=Math.max(t,r.node(u.w).in+=s)});var i=E(a+t+3).map(function(){return new pn}),o=t+1;return f(r.nodes(),function(u){W(i,o,r.node(u))}),{graph:r,buckets:i,zeroIdx:o}}function W(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function kn(e){var n=e.graph().acyclicer==="greedy"?mn(e,r(e)):xn(e);f(n,function(t){var a=e.edge(t);e.removeEdge(t),a.forwardName=t.name,a.reversed=!0,e.setEdge(t.w,t.v,a,H("rev"))});function r(t){return function(a){return t.edge(a).weight}}}function xn(e){var n=[],r={},t={};function a(i){Object.prototype.hasOwnProperty.call(t,i)||(t[i]=!0,r[i]=!0,f(e.outEdges(i),function(o){Object.prototype.hasOwnProperty.call(r,o.w)?n.push(o):a(o.w)}),delete r[i])}return f(e.nodes(),a),n}function En(e){f(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}})}function L(e,n,r,t){var a;do a=H(t);while(e.hasNode(a));return r.dummy=n,e.setNode(a,r),a}function On(e){var n=new g().setGraph(e.graph());return f(e.nodes(),function(r){n.setNode(r,e.node(r))}),f(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},a=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+a.weight,minlen:Math.max(t.minlen,a.minlen)})}),n}function be(e){var n=new g({multigraph:e.isMultigraph()}).setGraph(e.graph());return f(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),f(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n}function re(e,n){var r=e.x,t=e.y,a=n.x-r,i=n.y-t,o=e.width/2,u=e.height/2;if(!a&&!i)throw new Error("Not possible to find intersection inside of the rectangle");var d,s;return Math.abs(i)*o>Math.abs(a)*u?(i<0&&(u=-u),d=u*a/i,s=u):(a<0&&(o=-o),d=o,s=o*i/a),{x:r+d,y:t+s}}function j(e){var n=w(E(me(e)+1),function(){return[]});return f(e.nodes(),function(r){var t=e.node(r),a=t.rank;m(a)||(n[a][t.order]=r)}),n}function Ln(e){var n=P(w(e.nodes(),function(r){return e.node(r).rank}));f(e.nodes(),function(r){var t=e.node(r);ve(t,"rank")&&(t.rank-=n)})}function Nn(e){var n=P(w(e.nodes(),function(i){return e.node(i).rank})),r=[];f(e.nodes(),function(i){var o=e.node(i).rank-n;r[o]||(r[o]=[]),r[o].push(i)});var t=0,a=e.graph().nodeRankFactor;f(r,function(i,o){m(i)&&o%a!==0?--t:t&&f(i,function(u){e.node(u).rank+=t})})}function te(e,n,r,t){var a={width:0,height:0};return arguments.length>=4&&(a.rank=r,a.order=t),L(e,"border",a,n)}function me(e){return y(w(e.nodes(),function(n){var r=e.node(n).rank;if(!m(r))return r}))}function Pn(e,n){var r={lhs:[],rhs:[]};return f(e,function(t){n(t)?r.lhs.push(t):r.rhs.push(t)}),r}function Cn(e,n){return n()}function _n(e){function n(r){var t=e.children(r),a=e.node(r);if(t.length&&f(t,n),Object.prototype.hasOwnProperty.call(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var i=a.minRank,o=a.maxRank+1;i<o;++i)ae(e,"borderLeft","_bl",r,a,i),ae(e,"borderRight","_br",r,a,i)}}f(e.children(),n)}function ae(e,n,r,t,a,i){var o={width:0,height:0,rank:i,borderType:n},u=a[n][i-1],d=L(e,"border",o,r);a[n][i]=d,e.setParent(d,t),u&&e.setEdge(u,d,{weight:1})}function Rn(e){var n=e.graph().rankdir.toLowerCase();(n==="lr"||n==="rl")&&ge(e)}function Tn(e){var n=e.graph().rankdir.toLowerCase();(n==="bt"||n==="rl")&&In(e),(n==="lr"||n==="rl")&&(Mn(e),ge(e))}function ge(e){f(e.nodes(),function(n){ie(e.node(n))}),f(e.edges(),function(n){ie(e.edge(n))})}function ie(e){var n=e.width;e.width=e.height,e.height=n}function In(e){f(e.nodes(),function(n){B(e.node(n))}),f(e.edges(),function(n){var r=e.edge(n);f(r.points,B),Object.prototype.hasOwnProperty.call(r,"y")&&B(r)})}function B(e){e.y=-e.y}function Mn(e){f(e.nodes(),function(n){G(e.node(n))}),f(e.edges(),function(n){var r=e.edge(n);f(r.points,G),Object.prototype.hasOwnProperty.call(r,"x")&&G(r)})}function G(e){var n=e.x;e.x=e.y,e.y=n}function Sn(e){e.graph().dummyChains=[],f(e.edges(),function(n){jn(e,n)})}function jn(e,n){var r=n.v,t=e.node(r).rank,a=n.w,i=e.node(a).rank,o=n.name,u=e.edge(n),d=u.labelRank;if(i!==t+1){e.removeEdge(n);var s=void 0,c,l;for(l=0,++t;t<i;++l,++t)u.points=[],s={width:0,height:0,edgeLabel:u,edgeObj:n,rank:t},c=L(e,"edge",s,"_d"),t===d&&(s.width=u.width,s.height=u.height,s.dummy="edge-label",s.labelpos=u.labelpos),e.setEdge(r,c,{weight:u.weight},o),l===0&&e.graph().dummyChains.push(c),r=c;e.setEdge(r,a,{weight:u.weight},o)}}function Fn(e){f(e.graph().dummyChains,function(n){var r=e.node(n),t=r.edgeLabel,a;for(e.setEdge(r.edgeObj,t);r.dummy;)a=e.successors(n)[0],e.removeNode(n),t.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height),n=a,r=e.node(n)})}function J(e){var n={};function r(t){var a=e.node(t);if(Object.prototype.hasOwnProperty.call(n,t))return a.rank;n[t]=!0;var i=P(w(e.outEdges(t),function(o){return r(o.w)-e.edge(o).minlen}));return(i===Number.POSITIVE_INFINITY||i===void 0||i===null)&&(i=0),a.rank=i}f(e.sources(),r)}function C(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function ye(e){var n=new g({directed:!1}),r=e.nodes()[0],t=e.nodeCount();n.setNode(r,{});for(var a,i;Vn(n,e)<t;)a=An(n,e),i=n.hasNode(a.v)?C(e,a):-C(e,a),Bn(n,e,i);return n}function Vn(e,n){function r(t){f(n.nodeEdges(t),function(a){var i=a.v,o=t===i?a.w:i;!e.hasNode(o)&&!C(n,a)&&(e.setNode(o,{}),e.setEdge(t,o,{}),r(o))})}return f(e.nodes(),r),e.nodeCount()}function An(e,n){return X(n.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return C(n,r)})}function Bn(e,n,r){f(e.nodes(),function(t){n.node(t).rank+=r})}function Gn(){}Gn.prototype=new Error;function ke(e,n,r){we(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],i={};return f(n,function(o){if(!e.hasNode(o))throw new Error("Graph does not have node: "+o);xe(e,o,r==="post",i,t,a)}),a}function xe(e,n,r,t,a,i){Object.prototype.hasOwnProperty.call(t,n)||(t[n]=!0,r||i.push(n),f(a(n),function(o){xe(e,o,r,t,a,i)}),r&&i.push(n))}function Yn(e,n){return ke(e,n,"post")}function Dn(e,n){return ke(e,n,"pre")}k.initLowLimValues=K;k.initCutValues=Z;k.calcCutValue=Ee;k.leaveEdge=Le;k.enterEdge=Ne;k.exchangeEdges=Pe;function k(e){e=On(e),J(e);var n=ye(e);K(n),Z(n,e);for(var r,t;r=Le(n);)t=Ne(n,e,r),Pe(n,e,r,t)}function Z(e,n){var r=Yn(e,e.nodes());r=r.slice(0,r.length-1),f(r,function(t){qn(e,n,t)})}function qn(e,n,r){var t=e.node(r),a=t.parent;e.edge(r,a).cutvalue=Ee(e,n,r)}function Ee(e,n,r){var t=e.node(r),a=t.parent,i=!0,o=n.edge(r,a),u=0;return o||(i=!1,o=n.edge(a,r)),u=o.weight,f(n.nodeEdges(r),function(d){var s=d.v===r,c=s?d.w:d.v;if(c!==a){var l=s===i,h=n.edge(d).weight;if(u+=l?h:-h,Wn(e,r,c)){var v=e.edge(r,c).cutvalue;u+=l?-v:v}}}),u}function K(e,n){arguments.length<2&&(n=e.nodes()[0]),Oe(e,{},1,n)}function Oe(e,n,r,t,a){var i=r,o=e.node(t);return n[t]=!0,f(e.neighbors(t),function(u){Object.prototype.hasOwnProperty.call(n,u)||(r=Oe(e,n,r,u,t))}),o.low=i,o.lim=r++,a?o.parent=a:delete o.parent,r}function Le(e){return U(e.edges(),function(n){return e.edge(n).cutvalue<0})}function Ne(e,n,r){var t=r.v,a=r.w;n.hasEdge(t,a)||(t=r.w,a=r.v);var i=e.node(t),o=e.node(a),u=i,d=!1;i.lim>o.lim&&(u=o,d=!0);var s=_(n.edges(),function(c){return d===oe(e,e.node(c.v),u)&&d!==oe(e,e.node(c.w),u)});return X(s,function(c){return C(n,c)})}function Pe(e,n,r,t){var a=r.v,i=r.w;e.removeEdge(a,i),e.setEdge(t.v,t.w,{}),K(e),Z(e,n),$n(e,n)}function $n(e,n){var r=U(e.nodes(),function(a){return!n.node(a).parent}),t=Dn(e,r);t=t.slice(1),f(t,function(a){var i=e.node(a).parent,o=n.edge(a,i),u=!1;o||(o=n.edge(i,a),u=!0),n.node(a).rank=n.node(i).rank+(u?o.minlen:-o.minlen)})}function Wn(e,n,r){return e.hasEdge(n,r)}function oe(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function zn(e){switch(e.graph().ranker){case"network-simplex":ue(e);break;case"tight-tree":Xn(e);break;case"longest-path":Un(e);break;default:ue(e)}}var Un=J;function Xn(e){J(e),ye(e)}function ue(e){k(e)}function Hn(e){var n=L(e,"root",{},"_root"),r=Jn(e),t=y(x(r))-1,a=2*t+1;e.graph().nestingRoot=n,f(e.edges(),function(o){e.edge(o).minlen*=a});var i=Zn(e)+1;f(e.children(),function(o){Ce(e,n,a,i,t,r,o)}),e.graph().nodeRankFactor=a}function Ce(e,n,r,t,a,i,o){var u=e.children(o);if(!u.length){o!==n&&e.setEdge(n,o,{weight:0,minlen:r});return}var d=te(e,"_bt"),s=te(e,"_bb"),c=e.node(o);e.setParent(d,o),c.borderTop=d,e.setParent(s,o),c.borderBottom=s,f(u,function(l){Ce(e,n,r,t,a,i,l);var h=e.node(l),v=h.borderTop?h.borderTop:l,p=h.borderBottom?h.borderBottom:l,b=h.borderTop?t:2*t,N=v!==p?1:a-i[o]+1;e.setEdge(d,v,{weight:b,minlen:N,nestingEdge:!0}),e.setEdge(p,s,{weight:b,minlen:N,nestingEdge:!0})}),e.parent(o)||e.setEdge(n,d,{weight:0,minlen:a+i[o]})}function Jn(e){var n={};function r(t,a){var i=e.children(t);i&&i.length&&f(i,function(o){r(o,a+1)}),n[t]=a}return f(e.children(),function(t){r(t,1)}),n}function Zn(e){return M(e.edges(),function(n,r){return n+e.edge(r).weight},0)}function Kn(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,f(e.edges(),function(r){var t=e.edge(r);t.nestingEdge&&e.removeEdge(r)})}function Qn(e,n,r){var t={},a;f(r,function(i){for(var o=e.parent(i),u,d;o;){if(u=e.parent(o),u?(d=t[u],t[u]=o):(d=a,a=o),d&&d!==o){n.setEdge(d,o);return}o=u}})}function er(e,n,r){var t=nr(e),a=new g({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(i){return e.node(i)});return f(e.nodes(),function(i){var o=e.node(i),u=e.parent(i);(o.rank===n||o.minRank<=n&&n<=o.maxRank)&&(a.setNode(i),a.setParent(i,u||t),f(e[r](i),function(d){var s=d.v===i?d.w:d.v,c=a.edge(s,i),l=m(c)?0:c.weight;a.setEdge(s,i,{weight:e.edge(d).weight+l})}),Object.prototype.hasOwnProperty.call(o,"minRank")&&a.setNode(i,{borderLeft:o.borderLeft[n],borderRight:o.borderRight[n]}))}),a}function nr(e){for(var n;e.hasNode(n=H("_root")););return n}function rr(e,n){for(var r=0,t=1;t<n.length;++t)r+=tr(e,n[t-1],n[t]);return r}function tr(e,n,r){for(var t=vn(r,w(r,function(s,c){return c})),a=O(w(n,function(s){return R(w(e.outEdges(s),function(c){return{pos:t[c.w],weight:e.edge(c).weight}}),"pos")})),i=1;i<r.length;)i<<=1;var o=2*i-1;i-=1;var u=w(new Array(o),function(){return 0}),d=0;return f(a.forEach(function(s){var c=s.pos+i;u[c]+=s.weight;for(var l=0;c>0;)c%2&&(l+=u[c+1]),c=c-1>>1,u[c]+=s.weight;d+=s.weight*l})),d}function ar(e){var n={},r=_(e.nodes(),function(u){return!e.children(u).length}),t=y(w(r,function(u){return e.node(u).rank})),a=w(E(t+1),function(){return[]});function i(u){if(!ve(n,u)){n[u]=!0;var d=e.node(u);a[d.rank].push(u),f(e.successors(u),i)}}var o=R(r,function(u){return e.node(u).rank});return f(o,i),a}function ir(e,n){return w(n,function(r){var t=e.inEdges(r);if(t.length){var a=M(t,function(i,o){var u=e.edge(o),d=e.node(o.v);return{sum:i.sum+u.weight*d.order,weight:i.weight+u.weight}},{sum:0,weight:0});return{v:r,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:r}})}function or(e,n){var r={};f(e,function(a,i){var o=r[a.v]={indegree:0,in:[],out:[],vs:[a.v],i};m(a.barycenter)||(o.barycenter=a.barycenter,o.weight=a.weight)}),f(n.edges(),function(a){var i=r[a.v],o=r[a.w];!m(i)&&!m(o)&&(o.indegree++,i.out.push(r[a.w]))});var t=_(r,function(a){return!a.indegree});return ur(t)}function ur(e){var n=[];function r(i){return function(o){o.merged||(m(o.barycenter)||m(i.barycenter)||o.barycenter>=i.barycenter)&&dr(i,o)}}function t(i){return function(o){o.in.push(i),--o.indegree===0&&e.push(o)}}for(;e.length;){var a=e.pop();n.push(a),f(a.in.reverse(),r(a)),f(a.out,t(a))}return w(_(n,function(i){return!i.merged}),function(i){return I(i,["vs","i","barycenter","weight"])})}function dr(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}function sr(e,n){var r=Pn(e,function(c){return Object.prototype.hasOwnProperty.call(c,"barycenter")}),t=r.lhs,a=R(r.rhs,function(c){return-c.i}),i=[],o=0,u=0,d=0;t.sort(fr(!!n)),d=de(i,a,d),f(t,function(c){d+=c.vs.length,i.push(c.vs),o+=c.barycenter*c.weight,u+=c.weight,d=de(i,a,d)});var s={vs:O(i)};return u&&(s.barycenter=o/u,s.weight=u),s}function de(e,n,r){for(var t;n.length&&(t=T(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function fr(e){return function(n,r){return n.barycenter<r.barycenter?-1:n.barycenter>r.barycenter?1:e?r.i-n.i:n.i-r.i}}function _e(e,n,r,t){var a=e.children(n),i=e.node(n),o=i?i.borderLeft:void 0,u=i?i.borderRight:void 0,d={};o&&(a=_(a,function(p){return p!==o&&p!==u}));var s=ir(e,a);f(s,function(p){if(e.children(p.v).length){var b=_e(e,p.v,r,t);d[p.v]=b,Object.prototype.hasOwnProperty.call(b,"barycenter")&&lr(p,b)}});var c=or(s,r);cr(c,d);var l=sr(c,t);if(o&&(l.vs=O([o,l.vs,u]),e.predecessors(o).length)){var h=e.node(e.predecessors(o)[0]),v=e.node(e.predecessors(u)[0]);Object.prototype.hasOwnProperty.call(l,"barycenter")||(l.barycenter=0,l.weight=0),l.barycenter=(l.barycenter*l.weight+h.order+v.order)/(l.weight+2),l.weight+=2}return l}function cr(e,n){f(e,function(r){r.vs=O(r.vs.map(function(t){return n[t]?n[t].vs:t}))})}function lr(e,n){m(e.barycenter)?(e.barycenter=n.barycenter,e.weight=n.weight):(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight)}function hr(e){var n=me(e),r=se(e,E(1,n+1),"inEdges"),t=se(e,E(n-1,-1,-1),"outEdges"),a=ar(e);fe(e,a);for(var i=Number.POSITIVE_INFINITY,o,u=0,d=0;d<4;++u,++d){vr(u%2?r:t,u%4>=2),a=j(e);var s=rr(e,a);s<i&&(d=0,o=Ke(a),i=s)}fe(e,o)}function se(e,n,r){return w(n,function(t){return er(e,t,r)})}function vr(e,n){var r=new g;f(e,function(t){var a=t.graph().root,i=_e(t,a,r,n);f(i.vs,function(o,u){t.node(o).order=u}),Qn(t,r,i.vs)})}function fe(e,n){f(n,function(r){f(r,function(t,a){e.node(t).order=a})})}function pr(e){var n=br(e);f(e.graph().dummyChains,function(r){for(var t=e.node(r),a=t.edgeObj,i=wr(e,n,a.v,a.w),o=i.path,u=i.lca,d=0,s=o[d],c=!0;r!==a.w;){if(t=e.node(r),c){for(;(s=o[d])!==u&&e.node(s).maxRank<t.rank;)d++;s===u&&(c=!1)}if(!c){for(;d<o.length-1&&e.node(s=o[d+1]).minRank<=t.rank;)d++;s=o[d]}e.setParent(r,s),r=e.successors(r)[0]}})}function wr(e,n,r,t){var a=[],i=[],o=Math.min(n[r].low,n[t].low),u=Math.max(n[r].lim,n[t].lim),d,s;d=r;do d=e.parent(d),a.push(d);while(d&&(n[d].low>o||u>n[d].lim));for(s=d,d=t;(d=e.parent(d))!==s;)i.push(d);return{path:a.concat(i.reverse()),lca:s}}function br(e){var n={},r=0;function t(a){var i=r;f(e.children(a),t),n[a]={low:i,lim:r++}}return f(e.children(),t),n}function mr(e,n){var r={};function t(a,i){var o=0,u=0,d=a.length,s=T(i);return f(i,function(c,l){var h=yr(e,c),v=h?e.node(h).order:d;(h||c===s)&&(f(i.slice(u,l+1),function(p){f(e.predecessors(p),function(b){var N=e.node(b),Q=N.order;(Q<o||v<Q)&&!(N.dummy&&e.node(p).dummy)&&Re(r,b,p)})}),u=l+1,o=v)}),i}return M(n,t),r}function gr(e,n){var r={};function t(i,o,u,d,s){var c;f(E(o,u),function(l){c=i[l],e.node(c).dummy&&f(e.predecessors(c),function(h){var v=e.node(h);v.dummy&&(v.order<d||v.order>s)&&Re(r,h,c)})})}function a(i,o){var u=-1,d,s=0;return f(o,function(c,l){if(e.node(c).dummy==="border"){var h=e.predecessors(c);h.length&&(d=e.node(h[0]).order,t(o,s,l,u,d),s=l,u=d)}t(o,s,o.length,d,i.length)}),o}return M(n,a),r}function yr(e,n){if(e.node(n).dummy)return U(e.predecessors(n),function(r){return e.node(r).dummy})}function Re(e,n,r){if(n>r){var t=n;n=r,r=t}Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,configurable:!0,value:{},writable:!0});var a=e[n];Object.defineProperty(a,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function kr(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function xr(e,n,r,t){var a={},i={},o={};return f(n,function(u){f(u,function(d,s){a[d]=d,i[d]=d,o[d]=s})}),f(n,function(u){var d=-1;f(u,function(s){var c=t(s);if(c.length){c=R(c,function(b){return o[b]});for(var l=(c.length-1)/2,h=Math.floor(l),v=Math.ceil(l);h<=v;++h){var p=c[h];i[s]===s&&d<o[p]&&!kr(r,s,p)&&(i[p]=s,i[s]=a[s]=a[p],d=o[p])}}})}),{root:a,align:i}}function Er(e,n,r,t,a){var i={},o=Or(e,n,r,a),u=a?"borderLeft":"borderRight";function d(l,h){for(var v=o.nodes(),p=v.pop(),b={};p;)b[p]?l(p):(b[p]=!0,v.push(p),v=v.concat(h(p))),p=v.pop()}function s(l){i[l]=o.inEdges(l).reduce(function(h,v){return Math.max(h,i[v.v]+o.edge(v))},0)}function c(l){var h=o.outEdges(l).reduce(function(p,b){return Math.min(p,i[b.w]-o.edge(b))},Number.POSITIVE_INFINITY),v=e.node(l);h!==Number.POSITIVE_INFINITY&&v.borderType!==u&&(i[l]=Math.max(i[l],h))}return d(s,o.predecessors.bind(o)),d(c,o.successors.bind(o)),f(t,function(l){i[l]=i[r[l]]}),i}function Or(e,n,r,t){var a=new g,i=e.graph(),o=_r(i.nodesep,i.edgesep,t);return f(n,function(u){var d;f(u,function(s){var c=r[s];if(a.setNode(c),d){var l=r[d],h=a.edge(l,c);a.setEdge(l,c,Math.max(o(e,s,d),h||0))}d=s})}),a}function Lr(e,n){return X(x(n),function(r){var t=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return Qe(r,function(i,o){var u=Rr(e,o)/2;t=Math.max(i+u,t),a=Math.min(i-u,a)}),t-a})}function Nr(e,n){var r=x(n),t=P(r),a=y(r);f(["u","d"],function(i){f(["l","r"],function(o){var u=i+o,d=e[u],s;if(d!==n){var c=x(d);s=o==="l"?t-P(c):a-y(c),s&&(e[u]=S(d,function(l){return l+s}))}})})}function Pr(e,n){return S(e.ul,function(r,t){if(n)return e[n.toLowerCase()][t];var a=R(w(e,t));return(a[1]+a[2])/2})}function Cr(e){var n=j(e),r=$(mr(e,n),gr(e,n)),t={},a;f(["u","d"],function(o){a=o==="u"?n:x(n).reverse(),f(["l","r"],function(u){u==="r"&&(a=w(a,function(l){return x(l).reverse()}));var d=(o==="u"?e.predecessors:e.successors).bind(e),s=xr(e,a,r,d),c=Er(e,a,s.root,s.align,u==="r");u==="r"&&(c=S(c,function(l){return-l})),t[o+u]=c})});var i=Lr(e,t);return Nr(t,i),Pr(t,e.graph().align)}function _r(e,n,r){return function(t,a,i){var o=t.node(a),u=t.node(i),d=0,s;if(d+=o.width/2,Object.prototype.hasOwnProperty.call(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":s=-o.width/2;break;case"r":s=o.width/2;break}if(s&&(d+=r?s:-s),s=0,d+=(o.dummy?n:e)/2,d+=(u.dummy?n:e)/2,d+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":s=u.width/2;break;case"r":s=-u.width/2;break}return s&&(d+=r?s:-s),s=0,d}}function Rr(e,n){return e.node(n).width}function Tr(e){e=be(e),Ir(e),en(Cr(e),function(n,r){e.node(r).x=n})}function Ir(e){var n=j(e),r=e.graph().ranksep,t=0;f(n,function(a){var i=y(w(a,function(o){return e.node(o).height}));f(a,function(o){e.node(o).y=t+i/2}),t+=i+r})}function ot(e,n){var r=Cn;r("layout",()=>{var t=r(" buildLayoutGraph",()=>qr(e));r(" runLayout",()=>Mr(t,r)),r(" updateInputGraph",()=>Sr(e,t))})}function Mr(e,n){n(" makeSpaceForEdgeLabels",()=>$r(e)),n(" removeSelfEdges",()=>Qr(e)),n(" acyclic",()=>kn(e)),n(" nestingGraph.run",()=>Hn(e)),n(" rank",()=>zn(be(e))),n(" injectEdgeLabelProxies",()=>Wr(e)),n(" removeEmptyRanks",()=>Nn(e)),n(" nestingGraph.cleanup",()=>Kn(e)),n(" normalizeRanks",()=>Ln(e)),n(" assignRankMinMax",()=>zr(e)),n(" removeEdgeLabelProxies",()=>Ur(e)),n(" normalize.run",()=>Sn(e)),n(" parentDummyChains",()=>pr(e)),n(" addBorderSegments",()=>_n(e)),n(" order",()=>hr(e)),n(" insertSelfEdges",()=>et(e)),n(" adjustCoordinateSystem",()=>Rn(e)),n(" position",()=>Tr(e)),n(" positionSelfEdges",()=>nt(e)),n(" removeBorderNodes",()=>Kr(e)),n(" normalize.undo",()=>Fn(e)),n(" fixupEdgeLabelCoords",()=>Jr(e)),n(" undoCoordinateSystem",()=>Tn(e)),n(" translateGraph",()=>Xr(e)),n(" assignNodeIntersects",()=>Hr(e)),n(" reversePoints",()=>Zr(e)),n(" acyclic.undo",()=>En(e))}function Sr(e,n){f(e.nodes(),function(r){var t=e.node(r),a=n.node(r);t&&(t.x=a.x,t.y=a.y,n.children(r).length&&(t.width=a.width,t.height=a.height))}),f(e.edges(),function(r){var t=e.edge(r),a=n.edge(r);t.points=a.points,Object.prototype.hasOwnProperty.call(a,"x")&&(t.x=a.x,t.y=a.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}var jr=["nodesep","edgesep","ranksep","marginx","marginy"],Fr={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Vr=["acyclicer","ranker","rankdir","align"],Ar=["width","height"],Br={width:0,height:0},Gr=["minlen","weight","width","height","labeloffset"],Yr={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Dr=["labelpos"];function qr(e){var n=new g({multigraph:!0,compound:!0}),r=D(e.graph());return n.setGraph($({},Fr,Y(r,jr),I(r,Vr))),f(e.nodes(),function(t){var a=D(e.node(t));n.setNode(t,Be(Y(a,Ar),Br)),n.setParent(t,e.parent(t))}),f(e.edges(),function(t){var a=D(e.edge(t));n.setEdge(t,$({},Yr,Y(a,Gr),I(a,Dr)))}),n}function $r(e){var n=e.graph();n.ranksep/=2,f(e.edges(),function(r){var t=e.edge(r);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function Wr(e){f(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),a=e.node(n.w),i={rank:(a.rank-t.rank)/2+t.rank,e:n};L(e,"edge-proxy",i,"_ep")}})}function zr(e){var n=0;f(e.nodes(),function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=y(n,t.maxRank))}),e.graph().maxRank=n}function Ur(e){f(e.nodes(),function(n){var r=e.node(n);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}function Xr(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,a=0,i=e.graph(),o=i.marginx||0,u=i.marginy||0;function d(s){var c=s.x,l=s.y,h=s.width,v=s.height;n=Math.min(n,c-h/2),r=Math.max(r,c+h/2),t=Math.min(t,l-v/2),a=Math.max(a,l+v/2)}f(e.nodes(),function(s){d(e.node(s))}),f(e.edges(),function(s){var c=e.edge(s);Object.prototype.hasOwnProperty.call(c,"x")&&d(c)}),n-=o,t-=u,f(e.nodes(),function(s){var c=e.node(s);c.x-=n,c.y-=t}),f(e.edges(),function(s){var c=e.edge(s);f(c.points,function(l){l.x-=n,l.y-=t}),Object.prototype.hasOwnProperty.call(c,"x")&&(c.x-=n),Object.prototype.hasOwnProperty.call(c,"y")&&(c.y-=t)}),i.width=r-n+o,i.height=a-t+u}function Hr(e){f(e.edges(),function(n){var r=e.edge(n),t=e.node(n.v),a=e.node(n.w),i,o;r.points?(i=r.points[0],o=r.points[r.points.length-1]):(r.points=[],i=a,o=t),r.points.unshift(re(t,i)),r.points.push(re(a,o))})}function Jr(e){f(e.edges(),function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function Zr(e){f(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}function Kr(e){f(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),a=e.node(r.borderBottom),i=e.node(T(r.borderLeft)),o=e.node(T(r.borderRight));r.width=Math.abs(o.x-i.x),r.height=Math.abs(a.y-t.y),r.x=i.x+r.width/2,r.y=t.y+r.height/2}}),f(e.nodes(),function(n){e.node(n).dummy==="border"&&e.removeNode(n)})}function Qr(e){f(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}function et(e){var n=j(e);f(n,function(r){var t=0;f(r,function(a,i){var o=e.node(a);o.order=i+t,f(o.selfEdges,function(u){L(e,"selfedge",{width:u.label.width,height:u.label.height,rank:o.rank,order:i+ ++t,e:u.e,label:u.label},"_se")}),delete o.selfEdges})})}function nt(e){f(e.nodes(),function(n){var r=e.node(n);if(r.dummy==="selfedge"){var t=e.node(r.e.v),a=t.x+t.width/2,i=t.y,o=r.x-a,u=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:a+2*o/3,y:i-u},{x:a+5*o/6,y:i-u},{x:a+o,y:i},{x:a+5*o/6,y:i+u},{x:a+2*o/3,y:i+u}],r.label.x=r.x,r.label.y=r.y}})}function Y(e,n){return S(I(e,n),Number)}function D(e){var n={};return f(e,function(r,t){n[t.toLowerCase()]=r}),n}export{ot as l};
1
+ import{G as g}from"./s1JCCdcW.js";import{b as Te,p as ce,q as le,g as z,e as ee,l as F,o as Ie,s as Me,c as Se,u as je,d as f,i as m,f as _,v as x,r as M}from"./B9jIaMGe.js";import{f as O,b as he,a as Fe,c as Ve,d as Ae,t as V,m as w,e as P,h as ve,g as U,l as T,i as Be}from"./BeZ-nXK1.js";import{b8 as Ge,b9 as Ye,ba as De,aO as qe,bb as $e,aS as pe,aR as we,bc as We,aN as q,ar as ze,aU as Ue,at as Xe,bd as $}from"./B26luS__.js";function He(e){return Ge(Ye(e,void 0,O),e+"")}var Je=1,Ze=4;function Ke(e){return Te(e,Je|Ze)}function Qe(e,n){return e==null?e:De(e,ce(n),qe)}function en(e,n){return e&&le(e,ce(n))}function nn(e,n){return e>n}function S(e,n){var r={};return n=z(n),le(e,function(t,a,i){$e(r,a,n(t,a,i))}),r}function y(e){return e&&e.length?he(e,pe,nn):void 0}function X(e,n){return e&&e.length?he(e,z(n),Fe):void 0}function rn(e,n){var r=e.length;for(e.sort(n);r--;)e[r]=e[r].value;return e}function tn(e,n){if(e!==n){var r=e!==void 0,t=e===null,a=e===e,i=ee(e),o=n!==void 0,u=n===null,d=n===n,s=ee(n);if(!u&&!s&&!i&&e>n||i&&o&&d&&!u&&!s||t&&o&&d||!r&&d||!a)return 1;if(!t&&!i&&!s&&e<n||s&&r&&a&&!t&&!i||u&&r&&a||!o&&a||!d)return-1}return 0}function an(e,n,r){for(var t=-1,a=e.criteria,i=n.criteria,o=a.length,u=r.length;++t<o;){var d=tn(a[t],i[t]);if(d){if(t>=u)return d;var s=r[t];return d*(s=="desc"?-1:1)}}return e.index-n.index}function on(e,n,r){n.length?n=F(n,function(i){return we(i)?function(o){return Ie(o,i.length===1?i[0]:i)}:i}):n=[pe];var t=-1;n=F(n,We(z));var a=Ve(e,function(i,o,u){var d=F(n,function(s){return s(i)});return{criteria:d,index:++t,value:i}});return rn(a,function(i,o){return an(i,o,r)})}function un(e,n){return Ae(e,n,function(r,t){return Me(e,t)})}var I=He(function(e,n){return e==null?{}:un(e,n)}),dn=Math.ceil,sn=Math.max;function fn(e,n,r,t){for(var a=-1,i=sn(dn((n-e)/(r||1)),0),o=Array(i);i--;)o[++a]=e,e+=r;return o}function cn(e){return function(n,r,t){return t&&typeof t!="number"&&q(n,r,t)&&(r=t=void 0),n=V(n),r===void 0?(r=n,n=0):r=V(r),t=t===void 0?n<r?1:-1:V(t),fn(n,r,t)}}var E=cn(),R=ze(function(e,n){if(e==null)return[];var r=n.length;return r>1&&q(e,n[0],n[1])?n=[]:r>2&&q(n[0],n[1],n[2])&&(n=[n[0]]),on(e,Se(n),[])}),ln=0;function H(e){var n=++ln;return je(e)+n}function hn(e,n,r){for(var t=-1,a=e.length,i=n.length,o={};++t<a;){var u=t<i?n[t]:void 0;r(o,e[t],u)}return o}function vn(e,n){return hn(e||[],n||[],Ue)}class pn{constructor(){var n={};n._next=n._prev=n,this._sentinel=n}dequeue(){var n=this._sentinel,r=n._prev;if(r!==n)return ne(r),r}enqueue(n){var r=this._sentinel;n._prev&&n._next&&ne(n),n._next=r._next,r._next._prev=n,r._next=n,n._prev=r}toString(){for(var n=[],r=this._sentinel,t=r._prev;t!==r;)n.push(JSON.stringify(t,wn)),t=t._prev;return"["+n.join(", ")+"]"}}function ne(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function wn(e,n){if(e!=="_next"&&e!=="_prev")return n}var bn=Xe(1);function mn(e,n){if(e.nodeCount()<=1)return[];var r=yn(e,n||bn),t=gn(r.graph,r.buckets,r.zeroIdx);return O(w(t,function(a){return e.outEdges(a.v,a.w)}))}function gn(e,n,r){for(var t=[],a=n[n.length-1],i=n[0],o;e.nodeCount();){for(;o=i.dequeue();)A(e,n,r,o);for(;o=a.dequeue();)A(e,n,r,o);if(e.nodeCount()){for(var u=n.length-2;u>0;--u)if(o=n[u].dequeue(),o){t=t.concat(A(e,n,r,o,!0));break}}}return t}function A(e,n,r,t,a){var i=a?[]:void 0;return f(e.inEdges(t.v),function(o){var u=e.edge(o),d=e.node(o.v);a&&i.push({v:o.v,w:o.w}),d.out-=u,W(n,r,d)}),f(e.outEdges(t.v),function(o){var u=e.edge(o),d=o.w,s=e.node(d);s.in-=u,W(n,r,s)}),e.removeNode(t.v),i}function yn(e,n){var r=new g,t=0,a=0;f(e.nodes(),function(u){r.setNode(u,{v:u,in:0,out:0})}),f(e.edges(),function(u){var d=r.edge(u.v,u.w)||0,s=n(u),c=d+s;r.setEdge(u.v,u.w,c),a=Math.max(a,r.node(u.v).out+=s),t=Math.max(t,r.node(u.w).in+=s)});var i=E(a+t+3).map(function(){return new pn}),o=t+1;return f(r.nodes(),function(u){W(i,o,r.node(u))}),{graph:r,buckets:i,zeroIdx:o}}function W(e,n,r){r.out?r.in?e[r.out-r.in+n].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}function kn(e){var n=e.graph().acyclicer==="greedy"?mn(e,r(e)):xn(e);f(n,function(t){var a=e.edge(t);e.removeEdge(t),a.forwardName=t.name,a.reversed=!0,e.setEdge(t.w,t.v,a,H("rev"))});function r(t){return function(a){return t.edge(a).weight}}}function xn(e){var n=[],r={},t={};function a(i){Object.prototype.hasOwnProperty.call(t,i)||(t[i]=!0,r[i]=!0,f(e.outEdges(i),function(o){Object.prototype.hasOwnProperty.call(r,o.w)?n.push(o):a(o.w)}),delete r[i])}return f(e.nodes(),a),n}function En(e){f(e.edges(),function(n){var r=e.edge(n);if(r.reversed){e.removeEdge(n);var t=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(n.w,n.v,r,t)}})}function L(e,n,r,t){var a;do a=H(t);while(e.hasNode(a));return r.dummy=n,e.setNode(a,r),a}function On(e){var n=new g().setGraph(e.graph());return f(e.nodes(),function(r){n.setNode(r,e.node(r))}),f(e.edges(),function(r){var t=n.edge(r.v,r.w)||{weight:0,minlen:1},a=e.edge(r);n.setEdge(r.v,r.w,{weight:t.weight+a.weight,minlen:Math.max(t.minlen,a.minlen)})}),n}function be(e){var n=new g({multigraph:e.isMultigraph()}).setGraph(e.graph());return f(e.nodes(),function(r){e.children(r).length||n.setNode(r,e.node(r))}),f(e.edges(),function(r){n.setEdge(r,e.edge(r))}),n}function re(e,n){var r=e.x,t=e.y,a=n.x-r,i=n.y-t,o=e.width/2,u=e.height/2;if(!a&&!i)throw new Error("Not possible to find intersection inside of the rectangle");var d,s;return Math.abs(i)*o>Math.abs(a)*u?(i<0&&(u=-u),d=u*a/i,s=u):(a<0&&(o=-o),d=o,s=o*i/a),{x:r+d,y:t+s}}function j(e){var n=w(E(me(e)+1),function(){return[]});return f(e.nodes(),function(r){var t=e.node(r),a=t.rank;m(a)||(n[a][t.order]=r)}),n}function Ln(e){var n=P(w(e.nodes(),function(r){return e.node(r).rank}));f(e.nodes(),function(r){var t=e.node(r);ve(t,"rank")&&(t.rank-=n)})}function Nn(e){var n=P(w(e.nodes(),function(i){return e.node(i).rank})),r=[];f(e.nodes(),function(i){var o=e.node(i).rank-n;r[o]||(r[o]=[]),r[o].push(i)});var t=0,a=e.graph().nodeRankFactor;f(r,function(i,o){m(i)&&o%a!==0?--t:t&&f(i,function(u){e.node(u).rank+=t})})}function te(e,n,r,t){var a={width:0,height:0};return arguments.length>=4&&(a.rank=r,a.order=t),L(e,"border",a,n)}function me(e){return y(w(e.nodes(),function(n){var r=e.node(n).rank;if(!m(r))return r}))}function Pn(e,n){var r={lhs:[],rhs:[]};return f(e,function(t){n(t)?r.lhs.push(t):r.rhs.push(t)}),r}function Cn(e,n){return n()}function _n(e){function n(r){var t=e.children(r),a=e.node(r);if(t.length&&f(t,n),Object.prototype.hasOwnProperty.call(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var i=a.minRank,o=a.maxRank+1;i<o;++i)ae(e,"borderLeft","_bl",r,a,i),ae(e,"borderRight","_br",r,a,i)}}f(e.children(),n)}function ae(e,n,r,t,a,i){var o={width:0,height:0,rank:i,borderType:n},u=a[n][i-1],d=L(e,"border",o,r);a[n][i]=d,e.setParent(d,t),u&&e.setEdge(u,d,{weight:1})}function Rn(e){var n=e.graph().rankdir.toLowerCase();(n==="lr"||n==="rl")&&ge(e)}function Tn(e){var n=e.graph().rankdir.toLowerCase();(n==="bt"||n==="rl")&&In(e),(n==="lr"||n==="rl")&&(Mn(e),ge(e))}function ge(e){f(e.nodes(),function(n){ie(e.node(n))}),f(e.edges(),function(n){ie(e.edge(n))})}function ie(e){var n=e.width;e.width=e.height,e.height=n}function In(e){f(e.nodes(),function(n){B(e.node(n))}),f(e.edges(),function(n){var r=e.edge(n);f(r.points,B),Object.prototype.hasOwnProperty.call(r,"y")&&B(r)})}function B(e){e.y=-e.y}function Mn(e){f(e.nodes(),function(n){G(e.node(n))}),f(e.edges(),function(n){var r=e.edge(n);f(r.points,G),Object.prototype.hasOwnProperty.call(r,"x")&&G(r)})}function G(e){var n=e.x;e.x=e.y,e.y=n}function Sn(e){e.graph().dummyChains=[],f(e.edges(),function(n){jn(e,n)})}function jn(e,n){var r=n.v,t=e.node(r).rank,a=n.w,i=e.node(a).rank,o=n.name,u=e.edge(n),d=u.labelRank;if(i!==t+1){e.removeEdge(n);var s=void 0,c,l;for(l=0,++t;t<i;++l,++t)u.points=[],s={width:0,height:0,edgeLabel:u,edgeObj:n,rank:t},c=L(e,"edge",s,"_d"),t===d&&(s.width=u.width,s.height=u.height,s.dummy="edge-label",s.labelpos=u.labelpos),e.setEdge(r,c,{weight:u.weight},o),l===0&&e.graph().dummyChains.push(c),r=c;e.setEdge(r,a,{weight:u.weight},o)}}function Fn(e){f(e.graph().dummyChains,function(n){var r=e.node(n),t=r.edgeLabel,a;for(e.setEdge(r.edgeObj,t);r.dummy;)a=e.successors(n)[0],e.removeNode(n),t.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height),n=a,r=e.node(n)})}function J(e){var n={};function r(t){var a=e.node(t);if(Object.prototype.hasOwnProperty.call(n,t))return a.rank;n[t]=!0;var i=P(w(e.outEdges(t),function(o){return r(o.w)-e.edge(o).minlen}));return(i===Number.POSITIVE_INFINITY||i===void 0||i===null)&&(i=0),a.rank=i}f(e.sources(),r)}function C(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function ye(e){var n=new g({directed:!1}),r=e.nodes()[0],t=e.nodeCount();n.setNode(r,{});for(var a,i;Vn(n,e)<t;)a=An(n,e),i=n.hasNode(a.v)?C(e,a):-C(e,a),Bn(n,e,i);return n}function Vn(e,n){function r(t){f(n.nodeEdges(t),function(a){var i=a.v,o=t===i?a.w:i;!e.hasNode(o)&&!C(n,a)&&(e.setNode(o,{}),e.setEdge(t,o,{}),r(o))})}return f(e.nodes(),r),e.nodeCount()}function An(e,n){return X(n.edges(),function(r){if(e.hasNode(r.v)!==e.hasNode(r.w))return C(n,r)})}function Bn(e,n,r){f(e.nodes(),function(t){n.node(t).rank+=r})}function Gn(){}Gn.prototype=new Error;function ke(e,n,r){we(n)||(n=[n]);var t=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],i={};return f(n,function(o){if(!e.hasNode(o))throw new Error("Graph does not have node: "+o);xe(e,o,r==="post",i,t,a)}),a}function xe(e,n,r,t,a,i){Object.prototype.hasOwnProperty.call(t,n)||(t[n]=!0,r||i.push(n),f(a(n),function(o){xe(e,o,r,t,a,i)}),r&&i.push(n))}function Yn(e,n){return ke(e,n,"post")}function Dn(e,n){return ke(e,n,"pre")}k.initLowLimValues=K;k.initCutValues=Z;k.calcCutValue=Ee;k.leaveEdge=Le;k.enterEdge=Ne;k.exchangeEdges=Pe;function k(e){e=On(e),J(e);var n=ye(e);K(n),Z(n,e);for(var r,t;r=Le(n);)t=Ne(n,e,r),Pe(n,e,r,t)}function Z(e,n){var r=Yn(e,e.nodes());r=r.slice(0,r.length-1),f(r,function(t){qn(e,n,t)})}function qn(e,n,r){var t=e.node(r),a=t.parent;e.edge(r,a).cutvalue=Ee(e,n,r)}function Ee(e,n,r){var t=e.node(r),a=t.parent,i=!0,o=n.edge(r,a),u=0;return o||(i=!1,o=n.edge(a,r)),u=o.weight,f(n.nodeEdges(r),function(d){var s=d.v===r,c=s?d.w:d.v;if(c!==a){var l=s===i,h=n.edge(d).weight;if(u+=l?h:-h,Wn(e,r,c)){var v=e.edge(r,c).cutvalue;u+=l?-v:v}}}),u}function K(e,n){arguments.length<2&&(n=e.nodes()[0]),Oe(e,{},1,n)}function Oe(e,n,r,t,a){var i=r,o=e.node(t);return n[t]=!0,f(e.neighbors(t),function(u){Object.prototype.hasOwnProperty.call(n,u)||(r=Oe(e,n,r,u,t))}),o.low=i,o.lim=r++,a?o.parent=a:delete o.parent,r}function Le(e){return U(e.edges(),function(n){return e.edge(n).cutvalue<0})}function Ne(e,n,r){var t=r.v,a=r.w;n.hasEdge(t,a)||(t=r.w,a=r.v);var i=e.node(t),o=e.node(a),u=i,d=!1;i.lim>o.lim&&(u=o,d=!0);var s=_(n.edges(),function(c){return d===oe(e,e.node(c.v),u)&&d!==oe(e,e.node(c.w),u)});return X(s,function(c){return C(n,c)})}function Pe(e,n,r,t){var a=r.v,i=r.w;e.removeEdge(a,i),e.setEdge(t.v,t.w,{}),K(e),Z(e,n),$n(e,n)}function $n(e,n){var r=U(e.nodes(),function(a){return!n.node(a).parent}),t=Dn(e,r);t=t.slice(1),f(t,function(a){var i=e.node(a).parent,o=n.edge(a,i),u=!1;o||(o=n.edge(i,a),u=!0),n.node(a).rank=n.node(i).rank+(u?o.minlen:-o.minlen)})}function Wn(e,n,r){return e.hasEdge(n,r)}function oe(e,n,r){return r.low<=n.lim&&n.lim<=r.lim}function zn(e){switch(e.graph().ranker){case"network-simplex":ue(e);break;case"tight-tree":Xn(e);break;case"longest-path":Un(e);break;default:ue(e)}}var Un=J;function Xn(e){J(e),ye(e)}function ue(e){k(e)}function Hn(e){var n=L(e,"root",{},"_root"),r=Jn(e),t=y(x(r))-1,a=2*t+1;e.graph().nestingRoot=n,f(e.edges(),function(o){e.edge(o).minlen*=a});var i=Zn(e)+1;f(e.children(),function(o){Ce(e,n,a,i,t,r,o)}),e.graph().nodeRankFactor=a}function Ce(e,n,r,t,a,i,o){var u=e.children(o);if(!u.length){o!==n&&e.setEdge(n,o,{weight:0,minlen:r});return}var d=te(e,"_bt"),s=te(e,"_bb"),c=e.node(o);e.setParent(d,o),c.borderTop=d,e.setParent(s,o),c.borderBottom=s,f(u,function(l){Ce(e,n,r,t,a,i,l);var h=e.node(l),v=h.borderTop?h.borderTop:l,p=h.borderBottom?h.borderBottom:l,b=h.borderTop?t:2*t,N=v!==p?1:a-i[o]+1;e.setEdge(d,v,{weight:b,minlen:N,nestingEdge:!0}),e.setEdge(p,s,{weight:b,minlen:N,nestingEdge:!0})}),e.parent(o)||e.setEdge(n,d,{weight:0,minlen:a+i[o]})}function Jn(e){var n={};function r(t,a){var i=e.children(t);i&&i.length&&f(i,function(o){r(o,a+1)}),n[t]=a}return f(e.children(),function(t){r(t,1)}),n}function Zn(e){return M(e.edges(),function(n,r){return n+e.edge(r).weight},0)}function Kn(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,f(e.edges(),function(r){var t=e.edge(r);t.nestingEdge&&e.removeEdge(r)})}function Qn(e,n,r){var t={},a;f(r,function(i){for(var o=e.parent(i),u,d;o;){if(u=e.parent(o),u?(d=t[u],t[u]=o):(d=a,a=o),d&&d!==o){n.setEdge(d,o);return}o=u}})}function er(e,n,r){var t=nr(e),a=new g({compound:!0}).setGraph({root:t}).setDefaultNodeLabel(function(i){return e.node(i)});return f(e.nodes(),function(i){var o=e.node(i),u=e.parent(i);(o.rank===n||o.minRank<=n&&n<=o.maxRank)&&(a.setNode(i),a.setParent(i,u||t),f(e[r](i),function(d){var s=d.v===i?d.w:d.v,c=a.edge(s,i),l=m(c)?0:c.weight;a.setEdge(s,i,{weight:e.edge(d).weight+l})}),Object.prototype.hasOwnProperty.call(o,"minRank")&&a.setNode(i,{borderLeft:o.borderLeft[n],borderRight:o.borderRight[n]}))}),a}function nr(e){for(var n;e.hasNode(n=H("_root")););return n}function rr(e,n){for(var r=0,t=1;t<n.length;++t)r+=tr(e,n[t-1],n[t]);return r}function tr(e,n,r){for(var t=vn(r,w(r,function(s,c){return c})),a=O(w(n,function(s){return R(w(e.outEdges(s),function(c){return{pos:t[c.w],weight:e.edge(c).weight}}),"pos")})),i=1;i<r.length;)i<<=1;var o=2*i-1;i-=1;var u=w(new Array(o),function(){return 0}),d=0;return f(a.forEach(function(s){var c=s.pos+i;u[c]+=s.weight;for(var l=0;c>0;)c%2&&(l+=u[c+1]),c=c-1>>1,u[c]+=s.weight;d+=s.weight*l})),d}function ar(e){var n={},r=_(e.nodes(),function(u){return!e.children(u).length}),t=y(w(r,function(u){return e.node(u).rank})),a=w(E(t+1),function(){return[]});function i(u){if(!ve(n,u)){n[u]=!0;var d=e.node(u);a[d.rank].push(u),f(e.successors(u),i)}}var o=R(r,function(u){return e.node(u).rank});return f(o,i),a}function ir(e,n){return w(n,function(r){var t=e.inEdges(r);if(t.length){var a=M(t,function(i,o){var u=e.edge(o),d=e.node(o.v);return{sum:i.sum+u.weight*d.order,weight:i.weight+u.weight}},{sum:0,weight:0});return{v:r,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:r}})}function or(e,n){var r={};f(e,function(a,i){var o=r[a.v]={indegree:0,in:[],out:[],vs:[a.v],i};m(a.barycenter)||(o.barycenter=a.barycenter,o.weight=a.weight)}),f(n.edges(),function(a){var i=r[a.v],o=r[a.w];!m(i)&&!m(o)&&(o.indegree++,i.out.push(r[a.w]))});var t=_(r,function(a){return!a.indegree});return ur(t)}function ur(e){var n=[];function r(i){return function(o){o.merged||(m(o.barycenter)||m(i.barycenter)||o.barycenter>=i.barycenter)&&dr(i,o)}}function t(i){return function(o){o.in.push(i),--o.indegree===0&&e.push(o)}}for(;e.length;){var a=e.pop();n.push(a),f(a.in.reverse(),r(a)),f(a.out,t(a))}return w(_(n,function(i){return!i.merged}),function(i){return I(i,["vs","i","barycenter","weight"])})}function dr(e,n){var r=0,t=0;e.weight&&(r+=e.barycenter*e.weight,t+=e.weight),n.weight&&(r+=n.barycenter*n.weight,t+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=r/t,e.weight=t,e.i=Math.min(n.i,e.i),n.merged=!0}function sr(e,n){var r=Pn(e,function(c){return Object.prototype.hasOwnProperty.call(c,"barycenter")}),t=r.lhs,a=R(r.rhs,function(c){return-c.i}),i=[],o=0,u=0,d=0;t.sort(fr(!!n)),d=de(i,a,d),f(t,function(c){d+=c.vs.length,i.push(c.vs),o+=c.barycenter*c.weight,u+=c.weight,d=de(i,a,d)});var s={vs:O(i)};return u&&(s.barycenter=o/u,s.weight=u),s}function de(e,n,r){for(var t;n.length&&(t=T(n)).i<=r;)n.pop(),e.push(t.vs),r++;return r}function fr(e){return function(n,r){return n.barycenter<r.barycenter?-1:n.barycenter>r.barycenter?1:e?r.i-n.i:n.i-r.i}}function _e(e,n,r,t){var a=e.children(n),i=e.node(n),o=i?i.borderLeft:void 0,u=i?i.borderRight:void 0,d={};o&&(a=_(a,function(p){return p!==o&&p!==u}));var s=ir(e,a);f(s,function(p){if(e.children(p.v).length){var b=_e(e,p.v,r,t);d[p.v]=b,Object.prototype.hasOwnProperty.call(b,"barycenter")&&lr(p,b)}});var c=or(s,r);cr(c,d);var l=sr(c,t);if(o&&(l.vs=O([o,l.vs,u]),e.predecessors(o).length)){var h=e.node(e.predecessors(o)[0]),v=e.node(e.predecessors(u)[0]);Object.prototype.hasOwnProperty.call(l,"barycenter")||(l.barycenter=0,l.weight=0),l.barycenter=(l.barycenter*l.weight+h.order+v.order)/(l.weight+2),l.weight+=2}return l}function cr(e,n){f(e,function(r){r.vs=O(r.vs.map(function(t){return n[t]?n[t].vs:t}))})}function lr(e,n){m(e.barycenter)?(e.barycenter=n.barycenter,e.weight=n.weight):(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight)}function hr(e){var n=me(e),r=se(e,E(1,n+1),"inEdges"),t=se(e,E(n-1,-1,-1),"outEdges"),a=ar(e);fe(e,a);for(var i=Number.POSITIVE_INFINITY,o,u=0,d=0;d<4;++u,++d){vr(u%2?r:t,u%4>=2),a=j(e);var s=rr(e,a);s<i&&(d=0,o=Ke(a),i=s)}fe(e,o)}function se(e,n,r){return w(n,function(t){return er(e,t,r)})}function vr(e,n){var r=new g;f(e,function(t){var a=t.graph().root,i=_e(t,a,r,n);f(i.vs,function(o,u){t.node(o).order=u}),Qn(t,r,i.vs)})}function fe(e,n){f(n,function(r){f(r,function(t,a){e.node(t).order=a})})}function pr(e){var n=br(e);f(e.graph().dummyChains,function(r){for(var t=e.node(r),a=t.edgeObj,i=wr(e,n,a.v,a.w),o=i.path,u=i.lca,d=0,s=o[d],c=!0;r!==a.w;){if(t=e.node(r),c){for(;(s=o[d])!==u&&e.node(s).maxRank<t.rank;)d++;s===u&&(c=!1)}if(!c){for(;d<o.length-1&&e.node(s=o[d+1]).minRank<=t.rank;)d++;s=o[d]}e.setParent(r,s),r=e.successors(r)[0]}})}function wr(e,n,r,t){var a=[],i=[],o=Math.min(n[r].low,n[t].low),u=Math.max(n[r].lim,n[t].lim),d,s;d=r;do d=e.parent(d),a.push(d);while(d&&(n[d].low>o||u>n[d].lim));for(s=d,d=t;(d=e.parent(d))!==s;)i.push(d);return{path:a.concat(i.reverse()),lca:s}}function br(e){var n={},r=0;function t(a){var i=r;f(e.children(a),t),n[a]={low:i,lim:r++}}return f(e.children(),t),n}function mr(e,n){var r={};function t(a,i){var o=0,u=0,d=a.length,s=T(i);return f(i,function(c,l){var h=yr(e,c),v=h?e.node(h).order:d;(h||c===s)&&(f(i.slice(u,l+1),function(p){f(e.predecessors(p),function(b){var N=e.node(b),Q=N.order;(Q<o||v<Q)&&!(N.dummy&&e.node(p).dummy)&&Re(r,b,p)})}),u=l+1,o=v)}),i}return M(n,t),r}function gr(e,n){var r={};function t(i,o,u,d,s){var c;f(E(o,u),function(l){c=i[l],e.node(c).dummy&&f(e.predecessors(c),function(h){var v=e.node(h);v.dummy&&(v.order<d||v.order>s)&&Re(r,h,c)})})}function a(i,o){var u=-1,d,s=0;return f(o,function(c,l){if(e.node(c).dummy==="border"){var h=e.predecessors(c);h.length&&(d=e.node(h[0]).order,t(o,s,l,u,d),s=l,u=d)}t(o,s,o.length,d,i.length)}),o}return M(n,a),r}function yr(e,n){if(e.node(n).dummy)return U(e.predecessors(n),function(r){return e.node(r).dummy})}function Re(e,n,r){if(n>r){var t=n;n=r,r=t}Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,configurable:!0,value:{},writable:!0});var a=e[n];Object.defineProperty(a,r,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function kr(e,n,r){if(n>r){var t=n;n=r,r=t}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],r)}function xr(e,n,r,t){var a={},i={},o={};return f(n,function(u){f(u,function(d,s){a[d]=d,i[d]=d,o[d]=s})}),f(n,function(u){var d=-1;f(u,function(s){var c=t(s);if(c.length){c=R(c,function(b){return o[b]});for(var l=(c.length-1)/2,h=Math.floor(l),v=Math.ceil(l);h<=v;++h){var p=c[h];i[s]===s&&d<o[p]&&!kr(r,s,p)&&(i[p]=s,i[s]=a[s]=a[p],d=o[p])}}})}),{root:a,align:i}}function Er(e,n,r,t,a){var i={},o=Or(e,n,r,a),u=a?"borderLeft":"borderRight";function d(l,h){for(var v=o.nodes(),p=v.pop(),b={};p;)b[p]?l(p):(b[p]=!0,v.push(p),v=v.concat(h(p))),p=v.pop()}function s(l){i[l]=o.inEdges(l).reduce(function(h,v){return Math.max(h,i[v.v]+o.edge(v))},0)}function c(l){var h=o.outEdges(l).reduce(function(p,b){return Math.min(p,i[b.w]-o.edge(b))},Number.POSITIVE_INFINITY),v=e.node(l);h!==Number.POSITIVE_INFINITY&&v.borderType!==u&&(i[l]=Math.max(i[l],h))}return d(s,o.predecessors.bind(o)),d(c,o.successors.bind(o)),f(t,function(l){i[l]=i[r[l]]}),i}function Or(e,n,r,t){var a=new g,i=e.graph(),o=_r(i.nodesep,i.edgesep,t);return f(n,function(u){var d;f(u,function(s){var c=r[s];if(a.setNode(c),d){var l=r[d],h=a.edge(l,c);a.setEdge(l,c,Math.max(o(e,s,d),h||0))}d=s})}),a}function Lr(e,n){return X(x(n),function(r){var t=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return Qe(r,function(i,o){var u=Rr(e,o)/2;t=Math.max(i+u,t),a=Math.min(i-u,a)}),t-a})}function Nr(e,n){var r=x(n),t=P(r),a=y(r);f(["u","d"],function(i){f(["l","r"],function(o){var u=i+o,d=e[u],s;if(d!==n){var c=x(d);s=o==="l"?t-P(c):a-y(c),s&&(e[u]=S(d,function(l){return l+s}))}})})}function Pr(e,n){return S(e.ul,function(r,t){if(n)return e[n.toLowerCase()][t];var a=R(w(e,t));return(a[1]+a[2])/2})}function Cr(e){var n=j(e),r=$(mr(e,n),gr(e,n)),t={},a;f(["u","d"],function(o){a=o==="u"?n:x(n).reverse(),f(["l","r"],function(u){u==="r"&&(a=w(a,function(l){return x(l).reverse()}));var d=(o==="u"?e.predecessors:e.successors).bind(e),s=xr(e,a,r,d),c=Er(e,a,s.root,s.align,u==="r");u==="r"&&(c=S(c,function(l){return-l})),t[o+u]=c})});var i=Lr(e,t);return Nr(t,i),Pr(t,e.graph().align)}function _r(e,n,r){return function(t,a,i){var o=t.node(a),u=t.node(i),d=0,s;if(d+=o.width/2,Object.prototype.hasOwnProperty.call(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":s=-o.width/2;break;case"r":s=o.width/2;break}if(s&&(d+=r?s:-s),s=0,d+=(o.dummy?n:e)/2,d+=(u.dummy?n:e)/2,d+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":s=u.width/2;break;case"r":s=-u.width/2;break}return s&&(d+=r?s:-s),s=0,d}}function Rr(e,n){return e.node(n).width}function Tr(e){e=be(e),Ir(e),en(Cr(e),function(n,r){e.node(r).x=n})}function Ir(e){var n=j(e),r=e.graph().ranksep,t=0;f(n,function(a){var i=y(w(a,function(o){return e.node(o).height}));f(a,function(o){e.node(o).y=t+i/2}),t+=i+r})}function ot(e,n){var r=Cn;r("layout",()=>{var t=r(" buildLayoutGraph",()=>qr(e));r(" runLayout",()=>Mr(t,r)),r(" updateInputGraph",()=>Sr(e,t))})}function Mr(e,n){n(" makeSpaceForEdgeLabels",()=>$r(e)),n(" removeSelfEdges",()=>Qr(e)),n(" acyclic",()=>kn(e)),n(" nestingGraph.run",()=>Hn(e)),n(" rank",()=>zn(be(e))),n(" injectEdgeLabelProxies",()=>Wr(e)),n(" removeEmptyRanks",()=>Nn(e)),n(" nestingGraph.cleanup",()=>Kn(e)),n(" normalizeRanks",()=>Ln(e)),n(" assignRankMinMax",()=>zr(e)),n(" removeEdgeLabelProxies",()=>Ur(e)),n(" normalize.run",()=>Sn(e)),n(" parentDummyChains",()=>pr(e)),n(" addBorderSegments",()=>_n(e)),n(" order",()=>hr(e)),n(" insertSelfEdges",()=>et(e)),n(" adjustCoordinateSystem",()=>Rn(e)),n(" position",()=>Tr(e)),n(" positionSelfEdges",()=>nt(e)),n(" removeBorderNodes",()=>Kr(e)),n(" normalize.undo",()=>Fn(e)),n(" fixupEdgeLabelCoords",()=>Jr(e)),n(" undoCoordinateSystem",()=>Tn(e)),n(" translateGraph",()=>Xr(e)),n(" assignNodeIntersects",()=>Hr(e)),n(" reversePoints",()=>Zr(e)),n(" acyclic.undo",()=>En(e))}function Sr(e,n){f(e.nodes(),function(r){var t=e.node(r),a=n.node(r);t&&(t.x=a.x,t.y=a.y,n.children(r).length&&(t.width=a.width,t.height=a.height))}),f(e.edges(),function(r){var t=e.edge(r),a=n.edge(r);t.points=a.points,Object.prototype.hasOwnProperty.call(a,"x")&&(t.x=a.x,t.y=a.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}var jr=["nodesep","edgesep","ranksep","marginx","marginy"],Fr={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Vr=["acyclicer","ranker","rankdir","align"],Ar=["width","height"],Br={width:0,height:0},Gr=["minlen","weight","width","height","labeloffset"],Yr={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Dr=["labelpos"];function qr(e){var n=new g({multigraph:!0,compound:!0}),r=D(e.graph());return n.setGraph($({},Fr,Y(r,jr),I(r,Vr))),f(e.nodes(),function(t){var a=D(e.node(t));n.setNode(t,Be(Y(a,Ar),Br)),n.setParent(t,e.parent(t))}),f(e.edges(),function(t){var a=D(e.edge(t));n.setEdge(t,$({},Yr,Y(a,Gr),I(a,Dr)))}),n}function $r(e){var n=e.graph();n.ranksep/=2,f(e.edges(),function(r){var t=e.edge(r);t.minlen*=2,t.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?t.width+=t.labeloffset:t.height+=t.labeloffset)})}function Wr(e){f(e.edges(),function(n){var r=e.edge(n);if(r.width&&r.height){var t=e.node(n.v),a=e.node(n.w),i={rank:(a.rank-t.rank)/2+t.rank,e:n};L(e,"edge-proxy",i,"_ep")}})}function zr(e){var n=0;f(e.nodes(),function(r){var t=e.node(r);t.borderTop&&(t.minRank=e.node(t.borderTop).rank,t.maxRank=e.node(t.borderBottom).rank,n=y(n,t.maxRank))}),e.graph().maxRank=n}function Ur(e){f(e.nodes(),function(n){var r=e.node(n);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(n))})}function Xr(e){var n=Number.POSITIVE_INFINITY,r=0,t=Number.POSITIVE_INFINITY,a=0,i=e.graph(),o=i.marginx||0,u=i.marginy||0;function d(s){var c=s.x,l=s.y,h=s.width,v=s.height;n=Math.min(n,c-h/2),r=Math.max(r,c+h/2),t=Math.min(t,l-v/2),a=Math.max(a,l+v/2)}f(e.nodes(),function(s){d(e.node(s))}),f(e.edges(),function(s){var c=e.edge(s);Object.prototype.hasOwnProperty.call(c,"x")&&d(c)}),n-=o,t-=u,f(e.nodes(),function(s){var c=e.node(s);c.x-=n,c.y-=t}),f(e.edges(),function(s){var c=e.edge(s);f(c.points,function(l){l.x-=n,l.y-=t}),Object.prototype.hasOwnProperty.call(c,"x")&&(c.x-=n),Object.prototype.hasOwnProperty.call(c,"y")&&(c.y-=t)}),i.width=r-n+o,i.height=a-t+u}function Hr(e){f(e.edges(),function(n){var r=e.edge(n),t=e.node(n.v),a=e.node(n.w),i,o;r.points?(i=r.points[0],o=r.points[r.points.length-1]):(r.points=[],i=a,o=t),r.points.unshift(re(t,i)),r.points.push(re(a,o))})}function Jr(e){f(e.edges(),function(n){var r=e.edge(n);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function Zr(e){f(e.edges(),function(n){var r=e.edge(n);r.reversed&&r.points.reverse()})}function Kr(e){f(e.nodes(),function(n){if(e.children(n).length){var r=e.node(n),t=e.node(r.borderTop),a=e.node(r.borderBottom),i=e.node(T(r.borderLeft)),o=e.node(T(r.borderRight));r.width=Math.abs(o.x-i.x),r.height=Math.abs(a.y-t.y),r.x=i.x+r.width/2,r.y=t.y+r.height/2}}),f(e.nodes(),function(n){e.node(n).dummy==="border"&&e.removeNode(n)})}function Qr(e){f(e.edges(),function(n){if(n.v===n.w){var r=e.node(n.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}function et(e){var n=j(e);f(n,function(r){var t=0;f(r,function(a,i){var o=e.node(a);o.order=i+t,f(o.selfEdges,function(u){L(e,"selfedge",{width:u.label.width,height:u.label.height,rank:o.rank,order:i+ ++t,e:u.e,label:u.label},"_se")}),delete o.selfEdges})})}function nt(e){f(e.nodes(),function(n){var r=e.node(n);if(r.dummy==="selfedge"){var t=e.node(r.e.v),a=t.x+t.width/2,i=t.y,o=r.x-a,u=t.height/2;e.setEdge(r.e,r.label),e.removeNode(n),r.label.points=[{x:a+2*o/3,y:i-u},{x:a+5*o/6,y:i-u},{x:a+o,y:i},{x:a+5*o/6,y:i+u},{x:a+2*o/3,y:i+u}],r.label.x=r.x,r.label.y=r.y}})}function Y(e,n){return S(I(e,n),Number)}function D(e){var n={};return f(e,function(r,t){n[t.toLowerCase()]=r}),n}export{ot as l};
@@ -1,4 +1,4 @@
1
- import{q as _t,t as xt,s as vt,g as bt,b as wt,a as St,_ as g,c as lt,A as Lt,d as H,ac as Et,z as At,k as Tt}from"./D6TmrqPb.js";import{o as Mt}from"./CmKTTxBW.js";function Nt(t){for(var e=t.length/6|0,i=new Array(e),a=0;a<e;)i[a]="#"+t.slice(a*6,++a*6);return i}const It=Nt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function ct(t,e){let i;if(e===void 0)for(const a of t)a!=null&&(i<a||i===void 0&&a>=a)&&(i=a);else{let a=-1;for(let h of t)(h=e(h,++a,t))!=null&&(i<h||i===void 0&&h>=h)&&(i=h)}return i}function pt(t,e){let i;if(e===void 0)for(const a of t)a!=null&&(i>a||i===void 0&&a>=a)&&(i=a);else{let a=-1;for(let h of t)(h=e(h,++a,t))!=null&&(i>h||i===void 0&&h>=h)&&(i=h)}return i}function nt(t,e){let i=0;if(e===void 0)for(let a of t)(a=+a)&&(i+=a);else{let a=-1;for(let h of t)(h=+e(h,++a,t))&&(i+=h)}return i}function Pt(t){return t.target.depth}function Ct(t){return t.depth}function Ot(t,e){return e-1-t.height}function mt(t,e){return t.sourceLinks.length?t.depth:e-1}function zt(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?pt(t.sourceLinks,Pt)-1:0}function X(t){return function(){return t}}function ut(t,e){return Q(t.source,e.source)||t.index-e.index}function ht(t,e){return Q(t.target,e.target)||t.index-e.index}function Q(t,e){return t.y0-e.y0}function it(t){return t.value}function Dt(t){return t.index}function $t(t){return t.nodes}function jt(t){return t.links}function ft(t,e){const i=t.get(e);if(!i)throw new Error("missing: "+e);return i}function yt({nodes:t}){for(const e of t){let i=e.y0,a=i;for(const h of e.sourceLinks)h.y0=i+h.width/2,i+=h.width;for(const h of e.targetLinks)h.y1=a+h.width/2,a+=h.width}}function Bt(){let t=0,e=0,i=1,a=1,h=24,b=8,p,k=Dt,s=mt,o,l,_=$t,x=jt,y=6;function v(){const n={nodes:_.apply(null,arguments),links:x.apply(null,arguments)};return M(n),T(n),N(n),C(n),S(n),yt(n),n}v.update=function(n){return yt(n),n},v.nodeId=function(n){return arguments.length?(k=typeof n=="function"?n:X(n),v):k},v.nodeAlign=function(n){return arguments.length?(s=typeof n=="function"?n:X(n),v):s},v.nodeSort=function(n){return arguments.length?(o=n,v):o},v.nodeWidth=function(n){return arguments.length?(h=+n,v):h},v.nodePadding=function(n){return arguments.length?(b=p=+n,v):b},v.nodes=function(n){return arguments.length?(_=typeof n=="function"?n:X(n),v):_},v.links=function(n){return arguments.length?(x=typeof n=="function"?n:X(n),v):x},v.linkSort=function(n){return arguments.length?(l=n,v):l},v.size=function(n){return arguments.length?(t=e=0,i=+n[0],a=+n[1],v):[i-t,a-e]},v.extent=function(n){return arguments.length?(t=+n[0][0],i=+n[1][0],e=+n[0][1],a=+n[1][1],v):[[t,e],[i,a]]},v.iterations=function(n){return arguments.length?(y=+n,v):y};function M({nodes:n,links:f}){for(const[c,r]of n.entries())r.index=c,r.sourceLinks=[],r.targetLinks=[];const u=new Map(n.map((c,r)=>[k(c,r,n),c]));for(const[c,r]of f.entries()){r.index=c;let{source:m,target:w}=r;typeof m!="object"&&(m=r.source=ft(u,m)),typeof w!="object"&&(w=r.target=ft(u,w)),m.sourceLinks.push(r),w.targetLinks.push(r)}if(l!=null)for(const{sourceLinks:c,targetLinks:r}of n)c.sort(l),r.sort(l)}function T({nodes:n}){for(const f of n)f.value=f.fixedValue===void 0?Math.max(nt(f.sourceLinks,it),nt(f.targetLinks,it)):f.fixedValue}function N({nodes:n}){const f=n.length;let u=new Set(n),c=new Set,r=0;for(;u.size;){for(const m of u){m.depth=r;for(const{target:w}of m.sourceLinks)c.add(w)}if(++r>f)throw new Error("circular link");u=c,c=new Set}}function C({nodes:n}){const f=n.length;let u=new Set(n),c=new Set,r=0;for(;u.size;){for(const m of u){m.height=r;for(const{source:w}of m.targetLinks)c.add(w)}if(++r>f)throw new Error("circular link");u=c,c=new Set}}function D({nodes:n}){const f=ct(n,r=>r.depth)+1,u=(i-t-h)/(f-1),c=new Array(f);for(const r of n){const m=Math.max(0,Math.min(f-1,Math.floor(s.call(null,r,f))));r.layer=m,r.x0=t+m*u,r.x1=r.x0+h,c[m]?c[m].push(r):c[m]=[r]}if(o)for(const r of c)r.sort(o);return c}function R(n){const f=pt(n,u=>(a-e-(u.length-1)*p)/nt(u,it));for(const u of n){let c=e;for(const r of u){r.y0=c,r.y1=c+r.value*f,c=r.y1+p;for(const m of r.sourceLinks)m.width=m.value*f}c=(a-c+p)/(u.length+1);for(let r=0;r<u.length;++r){const m=u[r];m.y0+=c*(r+1),m.y1+=c*(r+1)}A(u)}}function S(n){const f=D(n);p=Math.min(b,(a-e)/(ct(f,u=>u.length)-1)),R(f);for(let u=0;u<y;++u){const c=Math.pow(.99,u),r=Math.max(1-c,(u+1)/y);B(f,c,r),P(f,c,r)}}function P(n,f,u){for(let c=1,r=n.length;c<r;++c){const m=n[c];for(const w of m){let L=0,F=0;for(const{source:Y,value:et}of w.targetLinks){let q=et*(w.layer-Y.layer);L+=$(Y,w)*q,F+=q}if(!(F>0))continue;let G=(L/F-w.y0)*f;w.y0+=G,w.y1+=G,E(w)}o===void 0&&m.sort(Q),O(m,u)}}function B(n,f,u){for(let c=n.length,r=c-2;r>=0;--r){const m=n[r];for(const w of m){let L=0,F=0;for(const{target:Y,value:et}of w.sourceLinks){let q=et*(Y.layer-w.layer);L+=I(w,Y)*q,F+=q}if(!(F>0))continue;let G=(L/F-w.y0)*f;w.y0+=G,w.y1+=G,E(w)}o===void 0&&m.sort(Q),O(m,u)}}function O(n,f){const u=n.length>>1,c=n[u];d(n,c.y0-p,u-1,f),z(n,c.y1+p,u+1,f),d(n,a,n.length-1,f),z(n,e,0,f)}function z(n,f,u,c){for(;u<n.length;++u){const r=n[u],m=(f-r.y0)*c;m>1e-6&&(r.y0+=m,r.y1+=m),f=r.y1+p}}function d(n,f,u,c){for(;u>=0;--u){const r=n[u],m=(r.y1-f)*c;m>1e-6&&(r.y0-=m,r.y1-=m),f=r.y0-p}}function E({sourceLinks:n,targetLinks:f}){if(l===void 0){for(const{source:{sourceLinks:u}}of f)u.sort(ht);for(const{target:{targetLinks:u}}of n)u.sort(ut)}}function A(n){if(l===void 0)for(const{sourceLinks:f,targetLinks:u}of n)f.sort(ht),u.sort(ut)}function $(n,f){let u=n.y0-(n.sourceLinks.length-1)*p/2;for(const{target:c,width:r}of n.sourceLinks){if(c===f)break;u+=r+p}for(const{source:c,width:r}of f.targetLinks){if(c===n)break;u-=r}return u}function I(n,f){let u=f.y0-(f.targetLinks.length-1)*p/2;for(const{source:c,width:r}of f.targetLinks){if(c===n)break;u+=r+p}for(const{target:c,width:r}of n.sourceLinks){if(c===f)break;u-=r}return u}return v}var st=Math.PI,rt=2*st,V=1e-6,Rt=rt-V;function ot(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function kt(){return new ot}ot.prototype=kt.prototype={constructor:ot,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,i,a){this._+="Q"+ +t+","+ +e+","+(this._x1=+i)+","+(this._y1=+a)},bezierCurveTo:function(t,e,i,a,h,b){this._+="C"+ +t+","+ +e+","+ +i+","+ +a+","+(this._x1=+h)+","+(this._y1=+b)},arcTo:function(t,e,i,a,h){t=+t,e=+e,i=+i,a=+a,h=+h;var b=this._x1,p=this._y1,k=i-t,s=a-e,o=b-t,l=p-e,_=o*o+l*l;if(h<0)throw new Error("negative radius: "+h);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(_>V)if(!(Math.abs(l*k-s*o)>V)||!h)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var x=i-b,y=a-p,v=k*k+s*s,M=x*x+y*y,T=Math.sqrt(v),N=Math.sqrt(_),C=h*Math.tan((st-Math.acos((v+_-M)/(2*T*N)))/2),D=C/N,R=C/T;Math.abs(D-1)>V&&(this._+="L"+(t+D*o)+","+(e+D*l)),this._+="A"+h+","+h+",0,0,"+ +(l*x>o*y)+","+(this._x1=t+R*k)+","+(this._y1=e+R*s)}},arc:function(t,e,i,a,h,b){t=+t,e=+e,i=+i,b=!!b;var p=i*Math.cos(a),k=i*Math.sin(a),s=t+p,o=e+k,l=1^b,_=b?a-h:h-a;if(i<0)throw new Error("negative radius: "+i);this._x1===null?this._+="M"+s+","+o:(Math.abs(this._x1-s)>V||Math.abs(this._y1-o)>V)&&(this._+="L"+s+","+o),i&&(_<0&&(_=_%rt+rt),_>Rt?this._+="A"+i+","+i+",0,1,"+l+","+(t-p)+","+(e-k)+"A"+i+","+i+",0,1,"+l+","+(this._x1=s)+","+(this._y1=o):_>V&&(this._+="A"+i+","+i+",0,"+ +(_>=st)+","+l+","+(this._x1=t+i*Math.cos(h))+","+(this._y1=e+i*Math.sin(h))))},rect:function(t,e,i,a){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +i+"v"+ +a+"h"+-i+"Z"},toString:function(){return this._}};function dt(t){return function(){return t}}function Ft(t){return t[0]}function Vt(t){return t[1]}var Wt=Array.prototype.slice;function Ut(t){return t.source}function Gt(t){return t.target}function Yt(t){var e=Ut,i=Gt,a=Ft,h=Vt,b=null;function p(){var k,s=Wt.call(arguments),o=e.apply(this,s),l=i.apply(this,s);if(b||(b=k=kt()),t(b,+a.apply(this,(s[0]=o,s)),+h.apply(this,s),+a.apply(this,(s[0]=l,s)),+h.apply(this,s)),k)return b=null,k+""||null}return p.source=function(k){return arguments.length?(e=k,p):e},p.target=function(k){return arguments.length?(i=k,p):i},p.x=function(k){return arguments.length?(a=typeof k=="function"?k:dt(+k),p):a},p.y=function(k){return arguments.length?(h=typeof k=="function"?k:dt(+k),p):h},p.context=function(k){return arguments.length?(b=k??null,p):b},p}function qt(t,e,i,a,h){t.moveTo(e,i),t.bezierCurveTo(e=(e+a)/2,i,e,h,a,h)}function Ht(){return Yt(qt)}function Xt(t){return[t.source.x1,t.y0]}function Qt(t){return[t.target.x0,t.y1]}function Kt(){return Ht().source(Xt).target(Qt)}var at=(function(){var t=g(function(k,s,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=s);return o},"o"),e=[1,9],i=[1,10],a=[1,5,10,12],h={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:g(function(s,o,l,_,x,y,v){var M=y.length-1;switch(x){case 7:const T=_.findOrCreateNode(y[M-4].trim().replaceAll('""','"')),N=_.findOrCreateNode(y[M-2].trim().replaceAll('""','"')),C=parseFloat(y[M].trim());_.addLink(T,N,C);break;case 8:case 9:case 11:this.$=y[M];break;case 10:this.$=y[M-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:e,20:i},{1:[2,6],7:11,10:[1,12]},t(i,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(a,[2,8]),t(a,[2,9]),{19:[1,16]},t(a,[2,11]),{1:[2,1]},{1:[2,5]},t(i,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:i},{15:18,16:7,17:8,18:e,20:i},{18:[1,19]},t(i,[2,3]),{12:[1,20]},t(a,[2,10]),{15:21,16:7,17:8,18:e,20:i},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:g(function(s,o){if(o.recoverable)this.trace(s);else{var l=new Error(s);throw l.hash=o,l}},"parseError"),parse:g(function(s){var o=this,l=[0],_=[],x=[null],y=[],v=this.table,M="",T=0,N=0,C=2,D=1,R=y.slice.call(arguments,1),S=Object.create(this.lexer),P={yy:{}};for(var B in this.yy)Object.prototype.hasOwnProperty.call(this.yy,B)&&(P.yy[B]=this.yy[B]);S.setInput(s,P.yy),P.yy.lexer=S,P.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var O=S.yylloc;y.push(O);var z=S.options&&S.options.ranges;typeof P.yy.parseError=="function"?this.parseError=P.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function d(L){l.length=l.length-2*L,x.length=x.length-L,y.length=y.length-L}g(d,"popStack");function E(){var L;return L=_.pop()||S.lex()||D,typeof L!="number"&&(L instanceof Array&&(_=L,L=_.pop()),L=o.symbols_[L]||L),L}g(E,"lex");for(var A,$,I,n,f={},u,c,r,m;;){if($=l[l.length-1],this.defaultActions[$]?I=this.defaultActions[$]:((A===null||typeof A>"u")&&(A=E()),I=v[$]&&v[$][A]),typeof I>"u"||!I.length||!I[0]){var w="";m=[];for(u in v[$])this.terminals_[u]&&u>C&&m.push("'"+this.terminals_[u]+"'");S.showPosition?w="Parse error on line "+(T+1)+`:
1
+ import{q as _t,t as xt,s as vt,g as bt,b as wt,a as St,_ as g,c as lt,A as Lt,d as H,ac as Et,z as At,k as Tt}from"./B26luS__.js";import{o as Mt}from"./CmKTTxBW.js";function Nt(t){for(var e=t.length/6|0,i=new Array(e),a=0;a<e;)i[a]="#"+t.slice(a*6,++a*6);return i}const It=Nt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function ct(t,e){let i;if(e===void 0)for(const a of t)a!=null&&(i<a||i===void 0&&a>=a)&&(i=a);else{let a=-1;for(let h of t)(h=e(h,++a,t))!=null&&(i<h||i===void 0&&h>=h)&&(i=h)}return i}function pt(t,e){let i;if(e===void 0)for(const a of t)a!=null&&(i>a||i===void 0&&a>=a)&&(i=a);else{let a=-1;for(let h of t)(h=e(h,++a,t))!=null&&(i>h||i===void 0&&h>=h)&&(i=h)}return i}function nt(t,e){let i=0;if(e===void 0)for(let a of t)(a=+a)&&(i+=a);else{let a=-1;for(let h of t)(h=+e(h,++a,t))&&(i+=h)}return i}function Pt(t){return t.target.depth}function Ct(t){return t.depth}function Ot(t,e){return e-1-t.height}function mt(t,e){return t.sourceLinks.length?t.depth:e-1}function zt(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?pt(t.sourceLinks,Pt)-1:0}function X(t){return function(){return t}}function ut(t,e){return Q(t.source,e.source)||t.index-e.index}function ht(t,e){return Q(t.target,e.target)||t.index-e.index}function Q(t,e){return t.y0-e.y0}function it(t){return t.value}function Dt(t){return t.index}function $t(t){return t.nodes}function jt(t){return t.links}function ft(t,e){const i=t.get(e);if(!i)throw new Error("missing: "+e);return i}function yt({nodes:t}){for(const e of t){let i=e.y0,a=i;for(const h of e.sourceLinks)h.y0=i+h.width/2,i+=h.width;for(const h of e.targetLinks)h.y1=a+h.width/2,a+=h.width}}function Bt(){let t=0,e=0,i=1,a=1,h=24,b=8,p,k=Dt,s=mt,o,l,_=$t,x=jt,y=6;function v(){const n={nodes:_.apply(null,arguments),links:x.apply(null,arguments)};return M(n),T(n),N(n),C(n),S(n),yt(n),n}v.update=function(n){return yt(n),n},v.nodeId=function(n){return arguments.length?(k=typeof n=="function"?n:X(n),v):k},v.nodeAlign=function(n){return arguments.length?(s=typeof n=="function"?n:X(n),v):s},v.nodeSort=function(n){return arguments.length?(o=n,v):o},v.nodeWidth=function(n){return arguments.length?(h=+n,v):h},v.nodePadding=function(n){return arguments.length?(b=p=+n,v):b},v.nodes=function(n){return arguments.length?(_=typeof n=="function"?n:X(n),v):_},v.links=function(n){return arguments.length?(x=typeof n=="function"?n:X(n),v):x},v.linkSort=function(n){return arguments.length?(l=n,v):l},v.size=function(n){return arguments.length?(t=e=0,i=+n[0],a=+n[1],v):[i-t,a-e]},v.extent=function(n){return arguments.length?(t=+n[0][0],i=+n[1][0],e=+n[0][1],a=+n[1][1],v):[[t,e],[i,a]]},v.iterations=function(n){return arguments.length?(y=+n,v):y};function M({nodes:n,links:f}){for(const[c,r]of n.entries())r.index=c,r.sourceLinks=[],r.targetLinks=[];const u=new Map(n.map((c,r)=>[k(c,r,n),c]));for(const[c,r]of f.entries()){r.index=c;let{source:m,target:w}=r;typeof m!="object"&&(m=r.source=ft(u,m)),typeof w!="object"&&(w=r.target=ft(u,w)),m.sourceLinks.push(r),w.targetLinks.push(r)}if(l!=null)for(const{sourceLinks:c,targetLinks:r}of n)c.sort(l),r.sort(l)}function T({nodes:n}){for(const f of n)f.value=f.fixedValue===void 0?Math.max(nt(f.sourceLinks,it),nt(f.targetLinks,it)):f.fixedValue}function N({nodes:n}){const f=n.length;let u=new Set(n),c=new Set,r=0;for(;u.size;){for(const m of u){m.depth=r;for(const{target:w}of m.sourceLinks)c.add(w)}if(++r>f)throw new Error("circular link");u=c,c=new Set}}function C({nodes:n}){const f=n.length;let u=new Set(n),c=new Set,r=0;for(;u.size;){for(const m of u){m.height=r;for(const{source:w}of m.targetLinks)c.add(w)}if(++r>f)throw new Error("circular link");u=c,c=new Set}}function D({nodes:n}){const f=ct(n,r=>r.depth)+1,u=(i-t-h)/(f-1),c=new Array(f);for(const r of n){const m=Math.max(0,Math.min(f-1,Math.floor(s.call(null,r,f))));r.layer=m,r.x0=t+m*u,r.x1=r.x0+h,c[m]?c[m].push(r):c[m]=[r]}if(o)for(const r of c)r.sort(o);return c}function R(n){const f=pt(n,u=>(a-e-(u.length-1)*p)/nt(u,it));for(const u of n){let c=e;for(const r of u){r.y0=c,r.y1=c+r.value*f,c=r.y1+p;for(const m of r.sourceLinks)m.width=m.value*f}c=(a-c+p)/(u.length+1);for(let r=0;r<u.length;++r){const m=u[r];m.y0+=c*(r+1),m.y1+=c*(r+1)}A(u)}}function S(n){const f=D(n);p=Math.min(b,(a-e)/(ct(f,u=>u.length)-1)),R(f);for(let u=0;u<y;++u){const c=Math.pow(.99,u),r=Math.max(1-c,(u+1)/y);B(f,c,r),P(f,c,r)}}function P(n,f,u){for(let c=1,r=n.length;c<r;++c){const m=n[c];for(const w of m){let L=0,F=0;for(const{source:Y,value:et}of w.targetLinks){let q=et*(w.layer-Y.layer);L+=$(Y,w)*q,F+=q}if(!(F>0))continue;let G=(L/F-w.y0)*f;w.y0+=G,w.y1+=G,E(w)}o===void 0&&m.sort(Q),O(m,u)}}function B(n,f,u){for(let c=n.length,r=c-2;r>=0;--r){const m=n[r];for(const w of m){let L=0,F=0;for(const{target:Y,value:et}of w.sourceLinks){let q=et*(Y.layer-w.layer);L+=I(w,Y)*q,F+=q}if(!(F>0))continue;let G=(L/F-w.y0)*f;w.y0+=G,w.y1+=G,E(w)}o===void 0&&m.sort(Q),O(m,u)}}function O(n,f){const u=n.length>>1,c=n[u];d(n,c.y0-p,u-1,f),z(n,c.y1+p,u+1,f),d(n,a,n.length-1,f),z(n,e,0,f)}function z(n,f,u,c){for(;u<n.length;++u){const r=n[u],m=(f-r.y0)*c;m>1e-6&&(r.y0+=m,r.y1+=m),f=r.y1+p}}function d(n,f,u,c){for(;u>=0;--u){const r=n[u],m=(r.y1-f)*c;m>1e-6&&(r.y0-=m,r.y1-=m),f=r.y0-p}}function E({sourceLinks:n,targetLinks:f}){if(l===void 0){for(const{source:{sourceLinks:u}}of f)u.sort(ht);for(const{target:{targetLinks:u}}of n)u.sort(ut)}}function A(n){if(l===void 0)for(const{sourceLinks:f,targetLinks:u}of n)f.sort(ht),u.sort(ut)}function $(n,f){let u=n.y0-(n.sourceLinks.length-1)*p/2;for(const{target:c,width:r}of n.sourceLinks){if(c===f)break;u+=r+p}for(const{source:c,width:r}of f.targetLinks){if(c===n)break;u-=r}return u}function I(n,f){let u=f.y0-(f.targetLinks.length-1)*p/2;for(const{source:c,width:r}of f.targetLinks){if(c===n)break;u+=r+p}for(const{target:c,width:r}of n.sourceLinks){if(c===f)break;u-=r}return u}return v}var st=Math.PI,rt=2*st,V=1e-6,Rt=rt-V;function ot(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function kt(){return new ot}ot.prototype=kt.prototype={constructor:ot,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,i,a){this._+="Q"+ +t+","+ +e+","+(this._x1=+i)+","+(this._y1=+a)},bezierCurveTo:function(t,e,i,a,h,b){this._+="C"+ +t+","+ +e+","+ +i+","+ +a+","+(this._x1=+h)+","+(this._y1=+b)},arcTo:function(t,e,i,a,h){t=+t,e=+e,i=+i,a=+a,h=+h;var b=this._x1,p=this._y1,k=i-t,s=a-e,o=b-t,l=p-e,_=o*o+l*l;if(h<0)throw new Error("negative radius: "+h);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(_>V)if(!(Math.abs(l*k-s*o)>V)||!h)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var x=i-b,y=a-p,v=k*k+s*s,M=x*x+y*y,T=Math.sqrt(v),N=Math.sqrt(_),C=h*Math.tan((st-Math.acos((v+_-M)/(2*T*N)))/2),D=C/N,R=C/T;Math.abs(D-1)>V&&(this._+="L"+(t+D*o)+","+(e+D*l)),this._+="A"+h+","+h+",0,0,"+ +(l*x>o*y)+","+(this._x1=t+R*k)+","+(this._y1=e+R*s)}},arc:function(t,e,i,a,h,b){t=+t,e=+e,i=+i,b=!!b;var p=i*Math.cos(a),k=i*Math.sin(a),s=t+p,o=e+k,l=1^b,_=b?a-h:h-a;if(i<0)throw new Error("negative radius: "+i);this._x1===null?this._+="M"+s+","+o:(Math.abs(this._x1-s)>V||Math.abs(this._y1-o)>V)&&(this._+="L"+s+","+o),i&&(_<0&&(_=_%rt+rt),_>Rt?this._+="A"+i+","+i+",0,1,"+l+","+(t-p)+","+(e-k)+"A"+i+","+i+",0,1,"+l+","+(this._x1=s)+","+(this._y1=o):_>V&&(this._+="A"+i+","+i+",0,"+ +(_>=st)+","+l+","+(this._x1=t+i*Math.cos(h))+","+(this._y1=e+i*Math.sin(h))))},rect:function(t,e,i,a){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +i+"v"+ +a+"h"+-i+"Z"},toString:function(){return this._}};function dt(t){return function(){return t}}function Ft(t){return t[0]}function Vt(t){return t[1]}var Wt=Array.prototype.slice;function Ut(t){return t.source}function Gt(t){return t.target}function Yt(t){var e=Ut,i=Gt,a=Ft,h=Vt,b=null;function p(){var k,s=Wt.call(arguments),o=e.apply(this,s),l=i.apply(this,s);if(b||(b=k=kt()),t(b,+a.apply(this,(s[0]=o,s)),+h.apply(this,s),+a.apply(this,(s[0]=l,s)),+h.apply(this,s)),k)return b=null,k+""||null}return p.source=function(k){return arguments.length?(e=k,p):e},p.target=function(k){return arguments.length?(i=k,p):i},p.x=function(k){return arguments.length?(a=typeof k=="function"?k:dt(+k),p):a},p.y=function(k){return arguments.length?(h=typeof k=="function"?k:dt(+k),p):h},p.context=function(k){return arguments.length?(b=k??null,p):b},p}function qt(t,e,i,a,h){t.moveTo(e,i),t.bezierCurveTo(e=(e+a)/2,i,e,h,a,h)}function Ht(){return Yt(qt)}function Xt(t){return[t.source.x1,t.y0]}function Qt(t){return[t.target.x0,t.y1]}function Kt(){return Ht().source(Xt).target(Qt)}var at=(function(){var t=g(function(k,s,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=s);return o},"o"),e=[1,9],i=[1,10],a=[1,5,10,12],h={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:g(function(s,o,l,_,x,y,v){var M=y.length-1;switch(x){case 7:const T=_.findOrCreateNode(y[M-4].trim().replaceAll('""','"')),N=_.findOrCreateNode(y[M-2].trim().replaceAll('""','"')),C=parseFloat(y[M].trim());_.addLink(T,N,C);break;case 8:case 9:case 11:this.$=y[M];break;case 10:this.$=y[M-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:e,20:i},{1:[2,6],7:11,10:[1,12]},t(i,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(a,[2,8]),t(a,[2,9]),{19:[1,16]},t(a,[2,11]),{1:[2,1]},{1:[2,5]},t(i,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:i},{15:18,16:7,17:8,18:e,20:i},{18:[1,19]},t(i,[2,3]),{12:[1,20]},t(a,[2,10]),{15:21,16:7,17:8,18:e,20:i},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:g(function(s,o){if(o.recoverable)this.trace(s);else{var l=new Error(s);throw l.hash=o,l}},"parseError"),parse:g(function(s){var o=this,l=[0],_=[],x=[null],y=[],v=this.table,M="",T=0,N=0,C=2,D=1,R=y.slice.call(arguments,1),S=Object.create(this.lexer),P={yy:{}};for(var B in this.yy)Object.prototype.hasOwnProperty.call(this.yy,B)&&(P.yy[B]=this.yy[B]);S.setInput(s,P.yy),P.yy.lexer=S,P.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var O=S.yylloc;y.push(O);var z=S.options&&S.options.ranges;typeof P.yy.parseError=="function"?this.parseError=P.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function d(L){l.length=l.length-2*L,x.length=x.length-L,y.length=y.length-L}g(d,"popStack");function E(){var L;return L=_.pop()||S.lex()||D,typeof L!="number"&&(L instanceof Array&&(_=L,L=_.pop()),L=o.symbols_[L]||L),L}g(E,"lex");for(var A,$,I,n,f={},u,c,r,m;;){if($=l[l.length-1],this.defaultActions[$]?I=this.defaultActions[$]:((A===null||typeof A>"u")&&(A=E()),I=v[$]&&v[$][A]),typeof I>"u"||!I.length||!I[0]){var w="";m=[];for(u in v[$])this.terminals_[u]&&u>C&&m.push("'"+this.terminals_[u]+"'");S.showPosition?w="Parse error on line "+(T+1)+`:
2
2
  `+S.showPosition()+`
3
3
  Expecting `+m.join(", ")+", got '"+(this.terminals_[A]||A)+"'":w="Parse error on line "+(T+1)+": Unexpected "+(A==D?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(w,{text:S.match,token:this.terminals_[A]||A,line:S.yylineno,loc:O,expected:m})}if(I[0]instanceof Array&&I.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+A);switch(I[0]){case 1:l.push(A),x.push(S.yytext),y.push(S.yylloc),l.push(I[1]),A=null,N=S.yyleng,M=S.yytext,T=S.yylineno,O=S.yylloc;break;case 2:if(c=this.productions_[I[1]][1],f.$=x[x.length-c],f._$={first_line:y[y.length-(c||1)].first_line,last_line:y[y.length-1].last_line,first_column:y[y.length-(c||1)].first_column,last_column:y[y.length-1].last_column},z&&(f._$.range=[y[y.length-(c||1)].range[0],y[y.length-1].range[1]]),n=this.performAction.apply(f,[M,N,T,P.yy,I[1],x,y].concat(R)),typeof n<"u")return n;c&&(l=l.slice(0,-1*c*2),x=x.slice(0,-1*c),y=y.slice(0,-1*c)),l.push(this.productions_[I[1]][0]),x.push(f.$),y.push(f._$),r=v[l[l.length-2]][l[l.length-1]],l.push(r);break;case 3:return!0}}return!0},"parse")},b=(function(){var k={EOF:1,parseError:g(function(o,l){if(this.yy.parser)this.yy.parser.parseError(o,l);else throw new Error(o)},"parseError"),setInput:g(function(s,o){return this.yy=o||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:g(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var o=s.match(/(?:\r\n?|\n).*/g);return o?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:g(function(s){var o=s.length,l=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var _=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var x=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===_.length?this.yylloc.first_column:0)+_[_.length-l.length].length-l[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[x[0],x[0]+this.yyleng-o]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:g(function(s){this.unput(this.match.slice(s))},"less"),pastInput:g(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:g(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:g(function(){var s=this.pastInput(),o=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
@@ -1 +1 @@
1
- import{_ as a,d as o}from"./D6TmrqPb.js";var d=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g};
1
+ import{_ as a,d as o}from"./B26luS__.js";var d=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g};
@@ -1,2 +1,2 @@
1
- import{G,H as me,aq as oe,x as k,N as K,P as ye,ak as Te,g as S,al as ke,an as Se,ao as Z,M as z,O as x,K as Ce,ar as be,as as ee,z as Ee,at as C,ah as W,au as Ae,aj as Ie,a6 as Ne,B as Me,av as V,aw as De,ax as Re,_ as Oe,ay as te,az as He,ae as ce,ag as le,aA as $,w as ue,aB as Fe,aC as Le,aD as Pe,af as xe,L as Ue,aE as qe,aF as Ge,aG as Ke,aH as ze,aI as de,aJ as $e,s as q,a as je,d as y}from"./qR_TM3YX.js";import{_ as ne}from"./DpBBTLWw.js";function lt(t,e){return e}function We(t,e,n){for(var i=[],s=e.length,o,a=e.length,d=0;d<s;d++){let g=e[d];le(g,()=>{if(o){if(o.pending.delete(g),o.done.add(g),o.pending.size===0){var h=t.outrogroups;B(V(o.done)),h.delete(o),h.size===0&&(t.outrogroups=null)}}else a-=1},!1)}if(a===0){var c=i.length===0&&n!==null;if(c){var f=n,l=f.parentNode;Pe(l),l.append(f),t.items.clear()}B(e,!c)}else o={pending:new Set(e),done:new Set},(t.outrogroups??=new Set).add(o)}function B(t,e=!0){for(var n=0;n<t.length;n++)xe(t[n],e)}var ie;function ut(t,e,n,i,s,o=null){var a=t,d=new Map,c=(e&oe)!==0;if(c){var f=t;a=k?K(ye(f)):f.appendChild(G())}k&&Te();var l=null,g=Ne(()=>{var u=n();return Me(u)?u:u==null?[]:V(u)}),h,p=!0;function T(){r.fallback=l,Be(r,h,a,e,i),l!==null&&(h.length===0?(l.f&C)===0?ce(l):(l.f^=C,L(l,null,a)):le(l,()=>{l=null}))}var b=me(()=>{h=S(g);var u=h.length;let E=!1;if(k){var A=ke(a)===Se;A!==(u===0)&&(a=Z(),K(a),z(!1),E=!0)}for(var w=new Set,N=Ee,D=Ie(),_=0;_<u;_+=1){k&&x.nodeType===Ce&&x.data===be&&(a=x,E=!0,z(!1));var M=h[_],R=i(M,_),v=p?null:d.get(R);v?(v.v&&ee(v.v,M),v.i&&ee(v.i,_),D&&N.unskip_effect(v.e)):(v=Je(d,p?a:ie??=G(),M,R,_,s,e,n),p||(v.e.f|=C),d.set(R,v)),w.add(R)}if(u===0&&o&&!l&&(p?l=W(()=>o(a)):(l=W(()=>o(ie??=G())),l.f|=C)),u>w.size&&Ae(),k&&u>0&&K(Z()),!p)if(D){for(const[we,_e]of d)w.has(we)||N.skip_effect(_e.e);N.oncommit(T),N.ondiscard(()=>{})}else T();E&&z(!0),S(g)}),r={effect:b,items:d,outrogroups:null,fallback:l};p=!1,k&&(a=x)}function F(t){for(;t!==null&&(t.f&Fe)===0;)t=t.next;return t}function Be(t,e,n,i,s){var o=(i&Le)!==0,a=e.length,d=t.items,c=F(t.effect.first),f,l=null,g,h=[],p=[],T,b,r,u;if(o)for(u=0;u<a;u+=1)T=e[u],b=s(T,u),r=d.get(b).e,(r.f&C)===0&&(r.nodes?.a?.measure(),(g??=new Set).add(r));for(u=0;u<a;u+=1){if(T=e[u],b=s(T,u),r=d.get(b).e,t.outrogroups!==null)for(const v of t.outrogroups)v.pending.delete(r),v.done.delete(r);if((r.f&C)!==0)if(r.f^=C,r===c)L(r,null,n);else{var E=l?l.next:c;r===t.effect.last&&(t.effect.last=r.prev),r.prev&&(r.prev.next=r.next),r.next&&(r.next.prev=r.prev),I(t,l,r),I(t,r,E),L(r,E,n),l=r,h=[],p=[],c=F(l.next);continue}if((r.f&$)!==0&&(ce(r),o&&(r.nodes?.a?.unfix(),(g??=new Set).delete(r))),r!==c){if(f!==void 0&&f.has(r)){if(h.length<p.length){var A=p[0],w;l=A.prev;var N=h[0],D=h[h.length-1];for(w=0;w<h.length;w+=1)L(h[w],A,n);for(w=0;w<p.length;w+=1)f.delete(p[w]);I(t,N.prev,D.next),I(t,l,N),I(t,D,A),c=A,l=D,u-=1,h=[],p=[]}else f.delete(r),L(r,c,n),I(t,r.prev,r.next),I(t,r,l===null?t.effect.first:l.next),I(t,l,r),l=r;continue}for(h=[],p=[];c!==null&&c!==r;)(f??=new Set).add(c),p.push(c),c=F(c.next);if(c===null)continue}(r.f&C)===0&&h.push(r),l=r,c=F(r.next)}if(t.outrogroups!==null){for(const v of t.outrogroups)v.pending.size===0&&(B(V(v.done)),t.outrogroups?.delete(v));t.outrogroups.size===0&&(t.outrogroups=null)}if(c!==null||f!==void 0){var _=[];if(f!==void 0)for(r of f)(r.f&$)===0&&_.push(r);for(;c!==null;)(c.f&$)===0&&c!==t.fallback&&_.push(c),c=F(c.next);var M=_.length;if(M>0){var R=(i&oe)!==0&&a===0?n:null;if(o){for(u=0;u<M;u+=1)_[u].nodes?.a?.measure();for(u=0;u<M;u+=1)_[u].nodes?.a?.fix()}We(t,_,R)}}o&&ue(()=>{if(g!==void 0)for(r of g)r.nodes?.a?.apply()})}function Je(t,e,n,i,s,o,a,d){var c=(a&De)!==0?(a&Re)===0?Oe(n,!1,!1):te(n):null,f=(a&He)!==0?te(s):null;return{v:c,i:f,e:W(()=>(o(e,c??n,f??s,d),()=>{t.delete(i)}))}}function L(t,e,n){if(t.nodes)for(var i=t.nodes.start,s=t.nodes.end,o=e&&(e.f&C)===0?e.nodes.start:n;i!==null;){var a=Ue(i);if(o.before(i),i===s)return;i=a}}function I(t,e,n){e===null?t.effect.first=n:e.next=n,n===null?t.effect.last=e:n.prev=e}const re=[...`
2
- \r\f \v\uFEFF`];function Ve(t,e,n){var i=t==null?"":""+t;if(e&&(i=i?i+" "+e:e),n){for(var s of Object.keys(n))if(n[s])i=i?i+" "+s:s;else if(i.length)for(var o=s.length,a=0;(a=i.indexOf(s,a))>=0;){var d=a+o;(a===0||re.includes(i[a-1]))&&(d===i.length||re.includes(i[d]))?i=(a===0?"":i.substring(0,a))+i.substring(d+1):a=d}}return i===""?null:i}function dt(t,e){return t==null?null:String(t)}function ft(t,e,n,i,s,o){var a=t.__className;if(k||a!==n||a===void 0){var d=Ve(n,i,o);(!k||d!==t.getAttribute("class"))&&(d==null?t.removeAttribute("class"):e?t.className=d:t.setAttribute("class",d)),t.__className=n}else if(o&&s!==o)for(var c in o){var f=!!o[c];(s==null||f!==!!s[c])&&t.classList.toggle(c,f)}return o}const Ye=Symbol("is custom element"),Qe=Symbol("is html"),Xe=de?"link":"LINK",Ze=de?"progress":"PROGRESS";function ht(t){if(k){var e=!1,n=()=>{if(!e){if(e=!0,t.hasAttribute("value")){var i=t.value;se(t,"value",null),t.value=i}if(t.hasAttribute("checked")){var s=t.checked;se(t,"checked",null),t.checked=s}}};t.__on_r=n,ue(n),ze()}}function pt(t,e){var n=Y(t);n.value===(n.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!==Ze)||(t.value=e??"")}function gt(t,e){var n=Y(t);n.checked!==(n.checked=e??void 0)&&(t.checked=e)}function se(t,e,n,i){var s=Y(t);k&&(s[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName===Xe)||s[e]!==(s[e]=n)&&(e==="loading"&&(t[$e]=n),n==null?t.removeAttribute(e):typeof n!="string"&&et(t).includes(e)?t[e]=n:t.setAttribute(e,n))}function Y(t){return t.__attributes??={[Ye]:t.nodeName.includes("-"),[Qe]:t.namespaceURI===qe}}var ae=new Map;function et(t){var e=t.getAttribute("is")||t.nodeName,n=ae.get(e);if(n)return n;ae.set(e,n=[]);for(var i,s=t,o=Element.prototype;o!==s;){i=Ke(s);for(var a in i)i[a].set&&n.push(a);s=Ge(s)}return n}class tt{ws=null;url="";token="";pendingRequests=new Map;eventHandlers=new Map;reconnectTimer=null;reconnectAttempt=0;tickTimer=null;tickIntervalMs=3e4;intentionalDisconnect=!1;reqCounter=0;connectNonce=null;connectSent=!1;connectFallbackTimer=null;connectionState={status:"disconnected"};stateChangeCallbacks=new Set;reconnectConfig={initialMs:1e3,maxMs:3e4,factor:2,jitter:.1,maxAttempts:0};constructor(){}connect(e,n){this.url=e,this.token=n,this.intentionalDisconnect=!1,this.reconnectAttempt=0,this.doConnect()}disconnect(){this.intentionalDisconnect=!0,this.clearTimers(),this.ws&&(this.ws.close(1e3,"client disconnect"),this.ws=null),this.updateState({status:"disconnected"})}get connected(){return this.connectionState.status==="connected"}async call(e,n){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new Error("Not connected");const i=`req-${++this.reqCounter}-${Date.now()}`,s={type:"req",id:i,method:e,params:n};return new Promise((o,a)=>{const d=setTimeout(()=>{this.pendingRequests.delete(i),a(new Error(`Request ${e} timed out`))},3e4);this.pendingRequests.set(i,{resolve:o,reject:a,timeout:d}),this.ws.send(JSON.stringify(s))})}on(e,n){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Set),this.eventHandlers.get(e).add(n),()=>this.off(e,n)}off(e,n){this.eventHandlers.get(e)?.delete(n)}onStateChange(e){return this.stateChangeCallbacks.add(e),()=>this.stateChangeCallbacks.delete(e)}async chatSend(e,n,i){const s=i?.idempotencyKey??crypto.randomUUID(),o={sessionKey:e,message:n,idempotencyKey:s,deliver:!1};return i?.attachments?.length&&(o.attachments=i.attachments),this.call("chat.send",o)}async chatHistory(e,n){const i=await this.call("chat.history",{sessionKey:e,limit:n??500});return i.messages??i.transcript??[]}async chatAbort(e,n){await this.call("chat.abort",{sessionKey:e,runId:n})}async sessionsList(e){const n=await this.call("sessions.list",{limit:e?.limit??50,includeDerivedTitles:e?.includeDerivedTitles??!0,includeLastMessage:e?.includeLastMessage??!0,activeMinutes:e?.activeMinutes});return n.sessions??n.list??[]}doConnect(){this.ws&&(this.ws.close(),this.ws=null),this.updateState({status:"connecting"});try{this.ws=new WebSocket(this.url)}catch(e){this.updateState({status:"error",error:`Failed to create WebSocket: ${e}`}),this.scheduleReconnect();return}this.ws.onopen=()=>{this.connectNonce=null,this.connectSent=!1,this.updateState({status:"authenticating"}),this.connectFallbackTimer&&clearTimeout(this.connectFallbackTimer),this.connectFallbackTimer=setTimeout(()=>{this.connectFallbackTimer=null,this.sendConnect()},750)},this.ws.onmessage=e=>{try{const n=JSON.parse(e.data);this.handleFrame(n)}catch{}},this.ws.onerror=()=>{},this.ws.onclose=e=>{if(this.clearTimers(),e.code===1008&&e.reason?.includes("pairing")){this.updateState({status:"error",error:"Device pairing required. Run: openclaw devices approve <requestId>"});return}this.intentionalDisconnect||(this.updateState({status:"disconnected",error:e.reason||void 0}),this.scheduleReconnect())}}handleFrame(e){e.type==="res"?this.handleResponse(e):e.type==="event"&&this.handleEvent(e)}handleResponse(e){const n=this.pendingRequests.get(e.id);if(n){clearTimeout(n.timeout),this.pendingRequests.delete(e.id),e.ok?n.resolve(e.payload??{}):n.reject(new Error(e.error?.message??"Unknown error"));return}if(e.id==="connect"){if(e.ok&&e.payload&&typeof e.payload=="object"&&"type"in e.payload){const i=e.payload;i.type==="hello-ok"&&this.handleHelloOk(i)}else if(!e.ok){const i=e.error?.message||"Connection rejected",s=i.toLowerCase().includes("pair")||e.error?.code==="PAIRING_REQUIRED"||e.error?.code==="AUTH_REQUIRED";this.updateState({status:"error",error:s?"Device pairing required — waiting for gateway owner to approve this device":i}),s&&(this.reconnectAttempt=5)}return}if(e.ok&&e.payload&&typeof e.payload=="object"&&"type"in e.payload){const i=e.payload;i.type==="hello-ok"&&this.handleHelloOk(i)}}handleEvent(e){if(e.event==="connect.challenge"){const n=e.payload;this.connectNonce=n?.nonce??null,this.connectSent=!1,this.connectFallbackTimer&&(clearTimeout(this.connectFallbackTimer),this.connectFallbackTimer=null),this.sendConnect();return}else if(e.event==="tick")this.sendTick();else{const n=this.eventHandlers.get(e.event);if(n)for(const i of n)try{i(e.payload)}catch{}}}async sendConnect(){if(this.connectSent)return;this.connectSent=!0;const e="operator",n=["operator.admin","operator.approvals","operator.pairing"];let i=this.token==="__device_auth__"?"":this.token,s;if(typeof crypto<"u"&&!!crypto.subtle)try{const{loadOrCreateDeviceIdentity:d,signDevicePayload:c,buildDeviceAuthPayload:f,loadDeviceAuthToken:l}=await ne(async()=>{const{loadOrCreateDeviceIdentity:u,signDevicePayload:E,buildDeviceAuthPayload:A,loadDeviceAuthToken:w}=await import("./B5Fyld5U.js");return{loadOrCreateDeviceIdentity:u,signDevicePayload:E,buildDeviceAuthPayload:A,loadDeviceAuthToken:w}},[],import.meta.url),g=await d(),h=l(g.deviceId,e);h&&(i=h);const p=Date.now(),T=this.connectNonce??void 0,b=f({deviceId:g.deviceId,clientId:"openclaw-control-ui",clientMode:"webchat",role:e,scopes:n,signedAtMs:p,token:i||null,nonce:T}),r=await c(g.privateKey,b);s={id:g.deviceId,publicKey:g.publicKey,signature:r,signedAt:p,nonce:T}}catch{}const a={type:"req",id:"connect",method:"connect",params:{minProtocol:3,maxProtocol:3,client:{id:"openclaw-control-ui",displayName:"Cortex",version:"1.1.0",platform:navigator.platform||"web",mode:"webchat"},role:e,scopes:n,device:s,auth:i?{token:i}:void 0,userAgent:navigator.userAgent,locale:navigator.language}};this.ws?.send(JSON.stringify(a))}handleHelloOk(e){this.reconnectAttempt=0,this.tickIntervalMs=e.policy.tickIntervalMs;const n=e;n.auth?.deviceToken&&typeof crypto<"u"&&crypto.subtle&&ne(async()=>{const{loadOrCreateDeviceIdentity:s,storeDeviceAuthToken:o}=await import("./B5Fyld5U.js");return{loadOrCreateDeviceIdentity:s,storeDeviceAuthToken:o}},[],import.meta.url).then(({loadOrCreateDeviceIdentity:s,storeDeviceAuthToken:o})=>{s().then(a=>{o({deviceId:a.deviceId,role:n.auth.role??"operator",token:n.auth.deviceToken,scopes:n.auth.scopes??[]})})}).catch(()=>{}),this.updateState({status:"connected",serverVersion:e.server.version,protocol:e.protocol,connId:e.server.connId,mainSessionKey:e.snapshot.sessionDefaults?.mainSessionKey,error:void 0}),this.startTickTimer();const i=this.eventHandlers.get("hello");if(i)for(const s of i)try{s(e)}catch{}}sendTick(){this.ws?.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"req",id:`tick-${Date.now()}`,method:"tick"}))}startTickTimer(){this.tickTimer&&clearInterval(this.tickTimer),this.tickTimer=setInterval(()=>this.sendTick(),this.tickIntervalMs)}scheduleReconnect(){if(this.intentionalDisconnect)return;if(this.reconnectConfig.maxAttempts>0&&this.reconnectAttempt>=this.reconnectConfig.maxAttempts){this.updateState({status:"error",error:"Max reconnection attempts reached"});return}const e=Math.min(this.reconnectConfig.initialMs*Math.pow(this.reconnectConfig.factor,this.reconnectAttempt),this.reconnectConfig.maxMs),n=e*this.reconnectConfig.jitter*(Math.random()*2-1),i=Math.max(0,e+n);this.reconnectAttempt++,this.reconnectTimer=setTimeout(()=>this.doConnect(),i)}clearTimers(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.tickTimer&&(clearInterval(this.tickTimer),this.tickTimer=null),this.connectFallbackTimer&&(clearTimeout(this.connectFallbackTimer),this.connectFallbackTimer=null)}updateState(e){this.connectionState={...this.connectionState,...e};for(const n of this.stateChangeCallbacks)try{n(this.connectionState)}catch{}}}const P=new tt,j={gateway:{url:"",ws:""},branding:{title:"Cortex",subtitle:"OpenClaw Command Center"}};let m=null;async function vt(){if(m)return m;try{const t=await fetch("/__openclaw/control-ui-config.json",{cache:"no-store"});if(!t.ok)return console.warn(`[config] /__openclaw/control-ui-config.json returned ${t.status}, using defaults`),m={...j},m;const e=await t.json();if(m={gateway:{url:e?.basePath||"",ws:""},branding:{title:e?.assistantName||j.branding.title,subtitle:"OpenClaw Command Center"}},typeof window<"u"&&!m.gateway.ws){const i=window.location.protocol==="https:"?"wss:":"ws:";m.gateway.ws=`${i}//${window.location.host}`}return m}catch(t){return console.warn("[config] Failed to load /__control__/bootstrap.json:",t),m={...j},m}}function wt(){return m}function nt(){return m?.gateway?.ws||""}const Q="cortex:gatewayUrl",X="cortex:gatewayToken";let U=q(je({status:"disconnected"})),O=q(""),H=q(""),J=q(!1);P.onStateChange(t=>{y(U,t,!0)});function fe(){if(typeof window>"u")return{url:"",token:""};const t=localStorage.getItem(Q)||"",e=localStorage.getItem(X)||"";return{url:t,token:e}}function it(){return nt()}function he(t,e){typeof window>"u"||(localStorage.setItem(Q,t),localStorage.setItem(X,e))}function pe(t){try{const e=new URL(t);return e.protocol==="ws:"||e.protocol==="wss:"}catch{return!1}}function ge(t){return t.trim()==="__device_auth__"?!0:/^[a-f0-9]{32,128}$/i.test(t.trim())}function ve(t,e){const n=(t??S(O)).trim(),i=(e??S(H)).trim();if(!(!n||!i)){if(!pe(n)){y(U,{status:"error",error:"Invalid gateway URL. Must start with ws:// or wss://"},!0);return}if(!ge(i)){y(U,{status:"error",error:"Invalid token format. Expected hex string."},!0);return}y(O,n,!0),y(H,i,!0),he(n,i),P.connect(n,i)}}function rt(){typeof window>"u"||(localStorage.removeItem(Q),localStorage.removeItem(X),y(O,""),y(H,""))}function st(){P.disconnect()}function at(){if(S(J))return;y(J,!0);const{url:t,token:e}=fe();y(O,t,!0),y(H,e,!0),t&&e&&ve(t,e)}function _t(){return{get state(){return S(U)},get url(){return S(O)},set url(t){y(O,t,!0)},get token(){return S(H)},set token(t){y(H,t,!0)},get initialized(){return S(J)},connect:ve,disconnect:st,init:at,saveSettings:he,loadSettings:fe,clearCredentials:rt,validateUrl:pe,validateToken:ge,getConfiguredWsUrl:it,onStateChange:P.onStateChange.bind(P)}}export{P as a,se as b,pt as c,gt as d,ut as e,wt as f,_t as g,lt as i,vt as l,ht as r,ft as s,dt as t};
1
+ import{G,H as _e,aq as oe,x as k,N as K,P as ye,ak as Te,g as S,al as ke,an as Se,ao as Z,M as z,O as x,K as Ce,ar as Ee,as as ee,z as be,at as C,ah as W,au as Ae,aj as Ie,a6 as Ne,B as Me,av as V,aw as De,ax as Re,_ as Oe,ay as te,az as He,ae as ce,ag as le,aA as $,w as ue,aB as Fe,aC as Le,aD as Pe,af as xe,L as Ue,aE as qe,aF as Ge,aG as Ke,aH as ze,aI as de,aJ as $e,s as q,a as je,d as y}from"./qR_TM3YX.js";import{_ as ne}from"./DpBBTLWw.js";function lt(t,e){return e}function We(t,e,n){for(var i=[],s=e.length,o,a=e.length,d=0;d<s;d++){let g=e[d];le(g,()=>{if(o){if(o.pending.delete(g),o.done.add(g),o.pending.size===0){var h=t.outrogroups;B(V(o.done)),h.delete(o),h.size===0&&(t.outrogroups=null)}}else a-=1},!1)}if(a===0){var c=i.length===0&&n!==null;if(c){var f=n,l=f.parentNode;Pe(l),l.append(f),t.items.clear()}B(e,!c)}else o={pending:new Set(e),done:new Set},(t.outrogroups??=new Set).add(o)}function B(t,e=!0){for(var n=0;n<t.length;n++)xe(t[n],e)}var ie;function ut(t,e,n,i,s,o=null){var a=t,d=new Map,c=(e&oe)!==0;if(c){var f=t;a=k?K(ye(f)):f.appendChild(G())}k&&Te();var l=null,g=Ne(()=>{var u=n();return Me(u)?u:u==null?[]:V(u)}),h,p=!0;function T(){r.fallback=l,Be(r,h,a,e,i),l!==null&&(h.length===0?(l.f&C)===0?ce(l):(l.f^=C,L(l,null,a)):le(l,()=>{l=null}))}var E=_e(()=>{h=S(g);var u=h.length;let b=!1;if(k){var A=ke(a)===Se;A!==(u===0)&&(a=Z(),K(a),z(!1),b=!0)}for(var w=new Set,N=be,D=Ie(),m=0;m<u;m+=1){k&&x.nodeType===Ce&&x.data===Ee&&(a=x,b=!0,z(!1));var M=h[m],R=i(M,m),v=p?null:d.get(R);v?(v.v&&ee(v.v,M),v.i&&ee(v.i,m),D&&N.unskip_effect(v.e)):(v=Je(d,p?a:ie??=G(),M,R,m,s,e,n),p||(v.e.f|=C),d.set(R,v)),w.add(R)}if(u===0&&o&&!l&&(p?l=W(()=>o(a)):(l=W(()=>o(ie??=G())),l.f|=C)),u>w.size&&Ae(),k&&u>0&&K(Z()),!p)if(D){for(const[we,me]of d)w.has(we)||N.skip_effect(me.e);N.oncommit(T),N.ondiscard(()=>{})}else T();b&&z(!0),S(g)}),r={effect:E,items:d,outrogroups:null,fallback:l};p=!1,k&&(a=x)}function F(t){for(;t!==null&&(t.f&Fe)===0;)t=t.next;return t}function Be(t,e,n,i,s){var o=(i&Le)!==0,a=e.length,d=t.items,c=F(t.effect.first),f,l=null,g,h=[],p=[],T,E,r,u;if(o)for(u=0;u<a;u+=1)T=e[u],E=s(T,u),r=d.get(E).e,(r.f&C)===0&&(r.nodes?.a?.measure(),(g??=new Set).add(r));for(u=0;u<a;u+=1){if(T=e[u],E=s(T,u),r=d.get(E).e,t.outrogroups!==null)for(const v of t.outrogroups)v.pending.delete(r),v.done.delete(r);if((r.f&C)!==0)if(r.f^=C,r===c)L(r,null,n);else{var b=l?l.next:c;r===t.effect.last&&(t.effect.last=r.prev),r.prev&&(r.prev.next=r.next),r.next&&(r.next.prev=r.prev),I(t,l,r),I(t,r,b),L(r,b,n),l=r,h=[],p=[],c=F(l.next);continue}if((r.f&$)!==0&&(ce(r),o&&(r.nodes?.a?.unfix(),(g??=new Set).delete(r))),r!==c){if(f!==void 0&&f.has(r)){if(h.length<p.length){var A=p[0],w;l=A.prev;var N=h[0],D=h[h.length-1];for(w=0;w<h.length;w+=1)L(h[w],A,n);for(w=0;w<p.length;w+=1)f.delete(p[w]);I(t,N.prev,D.next),I(t,l,N),I(t,D,A),c=A,l=D,u-=1,h=[],p=[]}else f.delete(r),L(r,c,n),I(t,r.prev,r.next),I(t,r,l===null?t.effect.first:l.next),I(t,l,r),l=r;continue}for(h=[],p=[];c!==null&&c!==r;)(f??=new Set).add(c),p.push(c),c=F(c.next);if(c===null)continue}(r.f&C)===0&&h.push(r),l=r,c=F(r.next)}if(t.outrogroups!==null){for(const v of t.outrogroups)v.pending.size===0&&(B(V(v.done)),t.outrogroups?.delete(v));t.outrogroups.size===0&&(t.outrogroups=null)}if(c!==null||f!==void 0){var m=[];if(f!==void 0)for(r of f)(r.f&$)===0&&m.push(r);for(;c!==null;)(c.f&$)===0&&c!==t.fallback&&m.push(c),c=F(c.next);var M=m.length;if(M>0){var R=(i&oe)!==0&&a===0?n:null;if(o){for(u=0;u<M;u+=1)m[u].nodes?.a?.measure();for(u=0;u<M;u+=1)m[u].nodes?.a?.fix()}We(t,m,R)}}o&&ue(()=>{if(g!==void 0)for(r of g)r.nodes?.a?.apply()})}function Je(t,e,n,i,s,o,a,d){var c=(a&De)!==0?(a&Re)===0?Oe(n,!1,!1):te(n):null,f=(a&He)!==0?te(s):null;return{v:c,i:f,e:W(()=>(o(e,c??n,f??s,d),()=>{t.delete(i)}))}}function L(t,e,n){if(t.nodes)for(var i=t.nodes.start,s=t.nodes.end,o=e&&(e.f&C)===0?e.nodes.start:n;i!==null;){var a=Ue(i);if(o.before(i),i===s)return;i=a}}function I(t,e,n){e===null?t.effect.first=n:e.next=n,n===null?t.effect.last=e:n.prev=e}const re=[...`
2
+ \r\f \v\uFEFF`];function Ve(t,e,n){var i=t==null?"":""+t;if(e&&(i=i?i+" "+e:e),n){for(var s of Object.keys(n))if(n[s])i=i?i+" "+s:s;else if(i.length)for(var o=s.length,a=0;(a=i.indexOf(s,a))>=0;){var d=a+o;(a===0||re.includes(i[a-1]))&&(d===i.length||re.includes(i[d]))?i=(a===0?"":i.substring(0,a))+i.substring(d+1):a=d}}return i===""?null:i}function dt(t,e){return t==null?null:String(t)}function ft(t,e,n,i,s,o){var a=t.__className;if(k||a!==n||a===void 0){var d=Ve(n,i,o);(!k||d!==t.getAttribute("class"))&&(d==null?t.removeAttribute("class"):e?t.className=d:t.setAttribute("class",d)),t.__className=n}else if(o&&s!==o)for(var c in o){var f=!!o[c];(s==null||f!==!!s[c])&&t.classList.toggle(c,f)}return o}const Ye=Symbol("is custom element"),Qe=Symbol("is html"),Xe=de?"link":"LINK",Ze=de?"progress":"PROGRESS";function ht(t){if(k){var e=!1,n=()=>{if(!e){if(e=!0,t.hasAttribute("value")){var i=t.value;se(t,"value",null),t.value=i}if(t.hasAttribute("checked")){var s=t.checked;se(t,"checked",null),t.checked=s}}};t.__on_r=n,ue(n),ze()}}function pt(t,e){var n=Y(t);n.value===(n.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!==Ze)||(t.value=e??"")}function gt(t,e){var n=Y(t);n.checked!==(n.checked=e??void 0)&&(t.checked=e)}function se(t,e,n,i){var s=Y(t);k&&(s[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName===Xe)||s[e]!==(s[e]=n)&&(e==="loading"&&(t[$e]=n),n==null?t.removeAttribute(e):typeof n!="string"&&et(t).includes(e)?t[e]=n:t.setAttribute(e,n))}function Y(t){return t.__attributes??={[Ye]:t.nodeName.includes("-"),[Qe]:t.namespaceURI===qe}}var ae=new Map;function et(t){var e=t.getAttribute("is")||t.nodeName,n=ae.get(e);if(n)return n;ae.set(e,n=[]);for(var i,s=t,o=Element.prototype;o!==s;){i=Ke(s);for(var a in i)i[a].set&&n.push(a);s=Ge(s)}return n}class tt{ws=null;url="";token="";pendingRequests=new Map;eventHandlers=new Map;reconnectTimer=null;reconnectAttempt=0;tickTimer=null;tickIntervalMs=3e4;intentionalDisconnect=!1;reqCounter=0;connectNonce=null;connectSent=!1;connectFallbackTimer=null;connectionState={status:"disconnected"};stateChangeCallbacks=new Set;reconnectConfig={initialMs:1e3,maxMs:3e4,factor:2,jitter:.1,maxAttempts:0};constructor(){}connect(e,n){this.url=e,this.token=n,this.intentionalDisconnect=!1,this.reconnectAttempt=0,this.doConnect()}disconnect(){this.intentionalDisconnect=!0,this.clearTimers(),this.ws&&(this.ws.close(1e3,"client disconnect"),this.ws=null),this.updateState({status:"disconnected"})}get connected(){return this.connectionState.status==="connected"}async call(e,n){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new Error("Not connected");const i=`req-${++this.reqCounter}-${Date.now()}`,s={type:"req",id:i,method:e,params:n};return new Promise((o,a)=>{const d=setTimeout(()=>{this.pendingRequests.delete(i),a(new Error(`Request ${e} timed out`))},3e4);this.pendingRequests.set(i,{resolve:o,reject:a,timeout:d}),this.ws.send(JSON.stringify(s))})}on(e,n){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Set),this.eventHandlers.get(e).add(n),()=>this.off(e,n)}off(e,n){this.eventHandlers.get(e)?.delete(n)}onStateChange(e){return this.stateChangeCallbacks.add(e),()=>this.stateChangeCallbacks.delete(e)}async chatSend(e,n,i){const s=i?.idempotencyKey??crypto.randomUUID(),o={sessionKey:e,message:n,idempotencyKey:s,deliver:!1};return i?.attachments?.length&&(o.attachments=i.attachments),this.call("chat.send",o)}async chatHistory(e,n){const i=await this.call("chat.history",{sessionKey:e,limit:n??500});return i.messages??i.transcript??[]}async chatAbort(e,n){await this.call("chat.abort",{sessionKey:e,runId:n})}async sessionsList(e){const n=await this.call("sessions.list",{limit:e?.limit??50,includeDerivedTitles:e?.includeDerivedTitles??!0,includeLastMessage:e?.includeLastMessage??!0,activeMinutes:e?.activeMinutes});return n.sessions??n.list??[]}doConnect(){this.ws&&(this.ws.close(),this.ws=null),this.updateState({status:"connecting"});try{this.ws=new WebSocket(this.url)}catch(e){this.updateState({status:"error",error:`Failed to create WebSocket: ${e}`}),this.scheduleReconnect();return}this.ws.onopen=()=>{this.connectNonce=null,this.connectSent=!1,this.updateState({status:"authenticating"}),this.connectFallbackTimer&&clearTimeout(this.connectFallbackTimer),this.connectFallbackTimer=setTimeout(()=>{this.connectFallbackTimer=null,this.sendConnect()},750)},this.ws.onmessage=e=>{try{const n=JSON.parse(e.data);this.handleFrame(n)}catch{}},this.ws.onerror=()=>{},this.ws.onclose=e=>{if(this.clearTimers(),e.code===1008&&e.reason?.includes("pairing")){this.updateState({status:"error",error:"Device pairing required. Run: openclaw devices approve <requestId>"});return}this.intentionalDisconnect||(this.updateState({status:"disconnected",error:e.reason||void 0}),this.scheduleReconnect())}}handleFrame(e){e.type==="res"?this.handleResponse(e):e.type==="event"&&this.handleEvent(e)}handleResponse(e){const n=this.pendingRequests.get(e.id);if(n){clearTimeout(n.timeout),this.pendingRequests.delete(e.id),e.ok?n.resolve(e.payload??{}):n.reject(new Error(e.error?.message??"Unknown error"));return}if(e.id==="connect"){if(e.ok&&e.payload&&typeof e.payload=="object"&&"type"in e.payload){const i=e.payload;i.type==="hello-ok"&&this.handleHelloOk(i)}else if(!e.ok){const i=e.error?.message||"Connection rejected",s=i.toLowerCase().includes("pair")||e.error?.code==="PAIRING_REQUIRED"||e.error?.code==="AUTH_REQUIRED";this.updateState({status:"error",error:s?"Device pairing required — waiting for gateway owner to approve this device":i}),s&&(this.reconnectAttempt=5)}return}if(e.ok&&e.payload&&typeof e.payload=="object"&&"type"in e.payload){const i=e.payload;i.type==="hello-ok"&&this.handleHelloOk(i)}}handleEvent(e){if(e.event==="connect.challenge"){const n=e.payload;this.connectNonce=n?.nonce??null,this.connectSent=!1,this.connectFallbackTimer&&(clearTimeout(this.connectFallbackTimer),this.connectFallbackTimer=null),this.sendConnect();return}else if(e.event==="tick")this.sendTick();else{const n=this.eventHandlers.get(e.event);if(n)for(const i of n)try{i(e.payload)}catch{}}}async sendConnect(){if(this.connectSent)return;this.connectSent=!0;const e="operator",n=["operator.admin","operator.approvals","operator.pairing"];let i=this.token==="__device_auth__"?"":this.token,s;if(typeof crypto<"u"&&!!crypto.subtle)try{const{loadOrCreateDeviceIdentity:d,signDevicePayload:c,buildDeviceAuthPayload:f,loadDeviceAuthToken:l}=await ne(async()=>{const{loadOrCreateDeviceIdentity:u,signDevicePayload:b,buildDeviceAuthPayload:A,loadDeviceAuthToken:w}=await import("./B5Fyld5U.js");return{loadOrCreateDeviceIdentity:u,signDevicePayload:b,buildDeviceAuthPayload:A,loadDeviceAuthToken:w}},[],import.meta.url),g=await d(),h=l(g.deviceId,e);h&&(i=h);const p=Date.now(),T=this.connectNonce??void 0,E=f({deviceId:g.deviceId,clientId:"openclaw-control-ui",clientMode:"webchat",role:e,scopes:n,signedAtMs:p,token:i||null,nonce:T}),r=await c(g.privateKey,E);s={id:g.deviceId,publicKey:g.publicKey,signature:r,signedAt:p,nonce:T}}catch{}const a={type:"req",id:"connect",method:"connect",params:{minProtocol:3,maxProtocol:3,client:{id:"openclaw-control-ui",displayName:"Cortex",version:"1.1.0",platform:navigator.platform||"web",mode:"webchat"},role:e,scopes:n,device:s,auth:i?{token:i}:void 0,userAgent:navigator.userAgent,locale:navigator.language}};this.ws?.send(JSON.stringify(a))}handleHelloOk(e){this.reconnectAttempt=0,this.tickIntervalMs=e.policy.tickIntervalMs;const n=e;n.auth?.deviceToken&&typeof crypto<"u"&&crypto.subtle&&ne(async()=>{const{loadOrCreateDeviceIdentity:s,storeDeviceAuthToken:o}=await import("./B5Fyld5U.js");return{loadOrCreateDeviceIdentity:s,storeDeviceAuthToken:o}},[],import.meta.url).then(({loadOrCreateDeviceIdentity:s,storeDeviceAuthToken:o})=>{s().then(a=>{o({deviceId:a.deviceId,role:n.auth.role??"operator",token:n.auth.deviceToken,scopes:n.auth.scopes??[]})})}).catch(()=>{}),this.updateState({status:"connected",serverVersion:e.server.version,protocol:e.protocol,connId:e.server.connId,mainSessionKey:e.snapshot.sessionDefaults?.mainSessionKey,error:void 0}),this.startTickTimer();const i=this.eventHandlers.get("hello");if(i)for(const s of i)try{s(e)}catch{}}sendTick(){this.ws?.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"req",id:`tick-${Date.now()}`,method:"tick"}))}startTickTimer(){this.tickTimer&&clearInterval(this.tickTimer),this.tickTimer=setInterval(()=>this.sendTick(),this.tickIntervalMs)}scheduleReconnect(){if(this.intentionalDisconnect)return;if(this.reconnectConfig.maxAttempts>0&&this.reconnectAttempt>=this.reconnectConfig.maxAttempts){this.updateState({status:"error",error:"Max reconnection attempts reached"});return}const e=Math.min(this.reconnectConfig.initialMs*Math.pow(this.reconnectConfig.factor,this.reconnectAttempt),this.reconnectConfig.maxMs),n=e*this.reconnectConfig.jitter*(Math.random()*2-1),i=Math.max(0,e+n);this.reconnectAttempt++,this.reconnectTimer=setTimeout(()=>this.doConnect(),i)}clearTimers(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.tickTimer&&(clearInterval(this.tickTimer),this.tickTimer=null),this.connectFallbackTimer&&(clearTimeout(this.connectFallbackTimer),this.connectFallbackTimer=null)}updateState(e){this.connectionState={...this.connectionState,...e};for(const n of this.stateChangeCallbacks)try{n(this.connectionState)}catch{}}}const P=new tt,j={gateway:{url:"",ws:""},branding:{title:"Cortex",subtitle:"Cortex Command Center"}};let _=null;async function vt(){if(_)return _;try{const t=await fetch("/__openclaw/control-ui-config.json",{cache:"no-store"});if(!t.ok)return console.warn(`[config] /__openclaw/control-ui-config.json returned ${t.status}, using defaults`),_={...j},_;const e=await t.json();if(_={gateway:{url:e?.basePath||"",ws:""},branding:{title:e?.assistantName||j.branding.title,subtitle:"Cortex Command Center"}},typeof window<"u"&&!_.gateway.ws){const i=window.location.protocol==="https:"?"wss:":"ws:";_.gateway.ws=`${i}//${window.location.host}`}return _}catch(t){return console.warn("[config] Failed to load /__openclaw/control-ui-config.json:",t),_={...j},_}}function wt(){return _}function nt(){return _?.gateway?.ws||""}const Q="cortex:gatewayUrl",X="cortex:gatewayToken";let U=q(je({status:"disconnected"})),O=q(""),H=q(""),J=q(!1);P.onStateChange(t=>{y(U,t,!0)});function fe(){if(typeof window>"u")return{url:"",token:""};const t=localStorage.getItem(Q)||"",e=localStorage.getItem(X)||"";return{url:t,token:e}}function it(){return nt()}function he(t,e){typeof window>"u"||(localStorage.setItem(Q,t),localStorage.setItem(X,e))}function pe(t){try{const e=new URL(t);return e.protocol==="ws:"||e.protocol==="wss:"}catch{return!1}}function ge(t){return t.trim()==="__device_auth__"?!0:/^[a-f0-9]{32,128}$/i.test(t.trim())}function ve(t,e){const n=(t??S(O)).trim(),i=(e??S(H)).trim();if(!(!n||!i)){if(!pe(n)){y(U,{status:"error",error:"Invalid gateway URL. Must start with ws:// or wss://"},!0);return}if(!ge(i)){y(U,{status:"error",error:"Invalid token format. Expected hex string."},!0);return}y(O,n,!0),y(H,i,!0),he(n,i),P.connect(n,i)}}function rt(){typeof window>"u"||(localStorage.removeItem(Q),localStorage.removeItem(X),y(O,""),y(H,""))}function st(){P.disconnect()}function at(){if(S(J))return;y(J,!0);const{url:t,token:e}=fe();y(O,t,!0),y(H,e,!0),t&&e&&ve(t,e)}function mt(){return{get state(){return S(U)},get url(){return S(O)},set url(t){y(O,t,!0)},get token(){return S(H)},set token(t){y(H,t,!0)},get initialized(){return S(J)},connect:ve,disconnect:st,init:at,saveSettings:he,loadSettings:fe,clearCredentials:rt,validateUrl:pe,validateToken:ge,getConfiguredWsUrl:it,onStateChange:P.onStateChange.bind(P)}}export{P as a,se as b,pt as c,gt as d,ut as e,wt as f,mt as g,lt as i,vt as l,ht as r,ft as s,dt as t};