@myagentroam/server 0.15.41 → 0.15.42

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 (396) hide show
  1. package/node_modules/@myagentroam/protocol/package.json +1 -1
  2. package/node_modules/@myagentroam/server-core/package.json +2 -2
  3. package/node_modules/@myagentroam-enterprise/server-implementation/package.json +3 -3
  4. package/package.json +5 -5
  5. package/web/assets/AuditManagementPage-GD6tI0QN.js +1 -0
  6. package/web/assets/AuthEntryPanel-BtstFCQi.css +1 -0
  7. package/web/assets/{AuthEntryPanel-PefnSyv3.js → AuthEntryPanel-DUEFdLFh.js} +32 -32
  8. package/web/assets/{CodeFileEditor-BvjTB2D_.js → CodeFileEditor-umNSWDW0.js} +3 -3
  9. package/web/assets/ConversationTemplateManagementPage-mC6V6jMs.js +1 -0
  10. package/web/assets/ConversationTemplateManagementPage-vyV6XqHC.js +1 -0
  11. package/web/assets/DocxPreview-Bae_J_ch.js +5 -0
  12. package/web/assets/DocxPreview-ncIL_Pso.css +1 -0
  13. package/web/assets/EnterpriseUserManagementPage-CaY6-1FE.js +1 -0
  14. package/web/assets/EnvironmentSecretManager-h9CkmhSR.js +1 -0
  15. package/web/assets/FilePreviewState-B5i6_Hbj.js +7 -0
  16. package/web/assets/{FilePreviewState-D6LhvU1O.css → FilePreviewState-CUlULrug.css} +1 -1
  17. package/web/assets/ImagePreview-8ECKq1Qs.js +1 -0
  18. package/web/assets/ImagePreviewViewport-DLzQ76L_.js +1 -0
  19. package/web/assets/ImagePreviewViewport-PRd-zxR4.css +1 -0
  20. package/web/assets/{LicenseManagementPage-BlLyAMWq.js → LicenseManagementPage-BAF5Yb5F.js} +1 -1
  21. package/web/assets/ManagementPagination-CMRG-882.js +1 -0
  22. package/web/assets/MarAgentModelManagementPage-B46PnJ0-.js +1 -0
  23. package/web/assets/MarAgentModelManagementPage-DMjsatig.js +1 -0
  24. package/web/assets/MarAlert-DIUpIxCI.js +1 -0
  25. package/web/assets/MarCascader-CvJulIGZ.js +1 -0
  26. package/web/assets/{MarCheckTag-BfCf1m6w.js → MarCheckTag-C4OCmrU_.js} +1 -1
  27. package/web/assets/{MarCheckboxGroup-D-LSYqWc.js → MarCheckboxGroup-BhkiQZ_Z.js} +1 -1
  28. package/web/assets/MarCheckboxGroup.vue_vue_type_style_index_0_scoped_3769668f_lang-C6Wa8qEQ.js +1 -0
  29. package/web/assets/MarDatePicker-CNtRhc8Q.js +1 -0
  30. package/web/assets/{MarDescriptionsItem-CATbgWMr.js → MarDescriptionsItem-CwaEq38I.js} +1 -1
  31. package/web/assets/{MarFormItem.vue_vue_type_script_setup_true_lang-BVHNyoCI.js → MarFormItem.vue_vue_type_script_setup_true_lang-CGvKTIHO.js} +2 -2
  32. package/web/assets/MarInputNumber-rlobtDMg.js +1 -0
  33. package/web/assets/MarOptionGroup.vue_vue_type_style_index_0_scoped_0cdd846e_lang-vAli1jXG.js +1 -0
  34. package/web/assets/{MarSwitch-D5LoiKKA.js → MarSwitch-o4SRMGth.js} +1 -1
  35. package/web/assets/MarTableColumn.vue_vue_type_script_setup_true_lang-BzUQnt8U.js +1 -0
  36. package/web/assets/MarTabs-DhT4CHFq.js +1 -0
  37. package/web/assets/{MarTag-XZGjfVpY.js → MarTag-D6FhFOig.js} +1 -1
  38. package/web/assets/MarkdownFilePreview-BSvpIFIl.js +1 -0
  39. package/web/assets/MarkdownFilePreview.vue_vue_type_script_setup_true_lang-Vz3GPOpF.js +1 -0
  40. package/web/assets/MarkdownPreview-BgP1mldZ.js +2 -0
  41. package/web/assets/MarkdownPreview-Dl92la6C.css +1 -0
  42. package/web/assets/McpDetailsDialog-D4Qnb7Or.js +1 -0
  43. package/web/assets/McpSourceManagementPage-D8v57iT4.js +1 -0
  44. package/web/assets/{McpSourceManagementPage-UuYYO-pq.js → McpSourceManagementPage-DwFYz78x.js} +1 -1
  45. package/web/assets/MediaPreview-BBIgmKm0.js +1 -0
  46. package/web/assets/MediaPreview-CaAn8ccD.css +1 -0
  47. package/web/assets/NodeDetailsDialogs-BNIA6azG.js +1 -0
  48. package/web/assets/NodeManagementPage-C1RFFoNg.js +1 -0
  49. package/web/assets/NodeManagementPage-CEe1ue0v.js +1 -0
  50. package/web/assets/{OAuthManagementPage-EWDnSTOv.js → OAuthManagementPage-CKPMouaD.js} +1 -1
  51. package/web/assets/{OrganizationManagementPage-Ce9efifj.js → OrganizationManagementPage-BO5WCgZ4.js} +1 -1
  52. package/web/assets/PdfPreview-0U8rcAWR.js +1 -0
  53. package/web/assets/PdfPreview-DfFbYhbD.css +1 -0
  54. package/web/assets/PptxPreview--mU-YW98.js +2 -0
  55. package/web/assets/PptxPreview-DoFiCcnf.css +1 -0
  56. package/web/assets/RemoteDesktopPage-vvWogaQ5.js +1 -0
  57. package/web/assets/{ResourceManagementPanel-PKgXDQ0p.js → ResourceManagementPanel-CpXDTdcH.js} +2 -2
  58. package/web/assets/ResourceManagementPanel.vue_vue_type_script_setup_true_lang-Cx5U35uD.js +1 -0
  59. package/web/assets/SecretManagementPage-Ctsm8yQc.js +1 -0
  60. package/web/assets/{SecretManagementPage-LwxTX0Gu.js → SecretManagementPage-DgCcJ0M3.js} +1 -1
  61. package/web/assets/{SecretManagementPage.vue_vue_type_script_setup_true_lang-Cn3t2U36.js → SecretManagementPage.vue_vue_type_script_setup_true_lang-DnB3OcKU.js} +1 -1
  62. package/web/assets/SessionSharePage-CnaP0W3z.js +2 -0
  63. package/web/assets/SettingsContent-BvwwnmIS.js +1 -0
  64. package/web/assets/SettingsContent-D6Qg9F6i.js +1 -0
  65. package/web/assets/SkillCenterPage-B5X0nJNy.js +1 -0
  66. package/web/assets/SkillCenterPage-BntG8FpL.js +1 -0
  67. package/web/assets/{SkillDetailsDialog-CrYyaNwM.js → SkillDetailsDialog-CkFhw1Dr.js} +1 -1
  68. package/web/assets/{SkillSourceManagementPage-DdPc8D1e.js → SkillSourceManagementPage-sCGn2BPm.js} +1 -1
  69. package/web/assets/SkillSourceManagementPage-xPVcHwnx.js +1 -0
  70. package/web/assets/StandaloneFilePreviewPage-C7O_aEPr.js +1 -0
  71. package/web/assets/{SystemConfigurationPage-DPWg14TQ.js → SystemConfigurationPage-DVMnnBTe.js} +1 -1
  72. package/web/assets/SystemConfigurationPage-SF9nHlk4.js +1 -0
  73. package/web/assets/{SystemInformationPage-DGfikj8T.js → SystemInformationPage-BzP9kAFS.js} +1 -1
  74. package/web/assets/{TerminalTabView-u2aSGZ04.js → TerminalTabView-D77AsuLv.js} +12 -12
  75. package/web/assets/{UTIF-Cbbg5qD8.js → UTIF-BH2SxhT2.js} +1 -1
  76. package/web/assets/{WorkbenchPage-CTxS7s7-.js → WorkbenchPage-D-Fz12dJ.js} +11 -11
  77. package/web/assets/WorkspaceManagementPage-C26b9iy0.js +1 -0
  78. package/web/assets/WorkspaceManagementPage-DcXT04AI.js +1 -0
  79. package/web/assets/XlsxPreview-CinViUaq.js +2 -0
  80. package/web/assets/XlsxPreview-CqIzgJ6j.css +1 -0
  81. package/web/assets/abnfDiagram-VCTEODGH-BvreeKsg.js +1 -0
  82. package/web/assets/{arc-CwgKK-qk.js → arc-D1U5Fp_3.js} +1 -1
  83. package/web/assets/architectureDiagram-5GKGNRK7-DRBVeOBW.js +36 -0
  84. package/web/assets/{blockDiagram-OSKFZWR5-TTIR4KiU.js → blockDiagram-OSKFZWR5-Bq6UwP9V.js} +2 -2
  85. package/web/assets/{c4Diagram-7LVT6UL2-BHbKh2eo.js → c4Diagram-7LVT6UL2-Dm_Waf1p.js} +2 -2
  86. package/web/assets/{catalog-ownership-service-CD2lV1ja.js → catalog-ownership-service-Bn7Vc8ps.js} +1 -1
  87. package/web/assets/{catalog-page-service-B39AbhzD.js → catalog-page-service-CzaLfAec.js} +1 -1
  88. package/web/assets/channel-Xetf-jB4.js +1 -0
  89. package/web/assets/{chunk-2Q5K7J3B-yN3KUNPC.js → chunk-2Q5K7J3B-CM_CkiL_.js} +1 -1
  90. package/web/assets/{chunk-5VM5RSS4-oBVvflCb.js → chunk-5VM5RSS4-CzbOR7Ui.js} +1 -1
  91. package/web/assets/{chunk-F27PBJKO-B_RmcT8S.js → chunk-F27PBJKO-Cnx-FlhK.js} +1 -1
  92. package/web/assets/{chunk-HLEWEB6X-DeVoR5aT.js → chunk-HLEWEB6X-BSamV0mz.js} +1 -1
  93. package/web/assets/{chunk-JWPE2WC7-C7l8TuXz.js → chunk-JWPE2WC7-C0cCj49K.js} +1 -1
  94. package/web/assets/{chunk-POPQ4Y6H-D3Mbe-WC.js → chunk-POPQ4Y6H-Djanjaue.js} +1 -1
  95. package/web/assets/{chunk-SVP7TREG-C3MIPi5v.js → chunk-SVP7TREG-CJqcm5kp.js} +1 -1
  96. package/web/assets/{chunk-XXDRQBXY-C2exIkCS.js → chunk-XXDRQBXY-Dn5nMVNA.js} +1 -1
  97. package/web/assets/{chunk-ZLD2IHE6-BCNum6mZ.js → chunk-ZLD2IHE6-DYYT9bFH.js} +1 -1
  98. package/web/assets/classDiagram-CYGNFDIV-D5krxbsF.js +1 -0
  99. package/web/assets/classDiagram-v2-TLXNO2FR-D5krxbsF.js +1 -0
  100. package/web/assets/{conversation-history-CVtz4OTR.js → conversation-history-VXCklnxD.js} +1 -1
  101. package/web/assets/cose-bilkent-JH36ORCC-DHyQXVaw.js +1 -0
  102. package/web/assets/{cynefin-OW5HDTMX-MPH1NFcC.js → cynefin-OW5HDTMX-21CD-a02.js} +1 -1
  103. package/web/assets/cynefinDiagram-5FMLGOSQ-B_h6zDF2.js +62 -0
  104. package/web/assets/{dagre-OS7QT2EB-73sAmr86.js → dagre-OS7QT2EB-SLvIykdp.js} +2 -2
  105. package/web/assets/{diagram-S7CK7UJ4-BYilVZhO.js → diagram-S7CK7UJ4-DPD7ZZjQ.js} +6 -6
  106. package/web/assets/diagram-UQ7AKVKN-B80W4_w8.js +41 -0
  107. package/web/assets/{diagram-VSXAHHWV-B90CZCUL.js → diagram-VSXAHHWV-C9j3BXmW.js} +2 -2
  108. package/web/assets/diagram-VX7I27RA-C5X1CBwy.js +24 -0
  109. package/web/assets/diagram-Z3DM3KII-CtGdTcuR.js +24 -0
  110. package/web/assets/{docx-preview-D442GZjV.js → docx-preview-BNPbDiFD.js} +1 -1
  111. package/web/assets/ebnfDiagram-PWID7BFC-IoMkoDSF.js +1 -0
  112. package/web/assets/{enterprise-management-service-bHedVTxj.js → enterprise-management-service-BYCyS_wt.js} +1 -1
  113. package/web/assets/{erDiagram-2YWLMYGG-BGdP_8ns.js → erDiagram-2YWLMYGG-DSxgebHv.js} +2 -2
  114. package/web/assets/{error-presentation-BIHskbsq.js → error-presentation-BOjTqu52.js} +1 -1
  115. package/web/assets/{flowDiagram-T62WH6J4-DX0etIF8.js → flowDiagram-T62WH6J4-DIF8eXMf.js} +1 -1
  116. package/web/assets/{ganttDiagram-EL5Y4UJY-Bck1rVWu.js → ganttDiagram-EL5Y4UJY-Dsf_NATv.js} +2 -2
  117. package/web/assets/gitGraphDiagram-WWUBYQGX-dXL-FkTK.js +106 -0
  118. package/web/assets/{hosted-conversation-template-client-DnvfGRBu.js → hosted-conversation-template-client-DKrQxlf9.js} +1 -1
  119. package/web/assets/{image-DPXM5XRl.js → image-CO2JJS1F.js} +1 -1
  120. package/web/assets/{index-fhQa0qRd.js → index--NLnU-PC.js} +1 -1
  121. package/web/assets/{index-BoSfb6cp.js → index-B1LolMrk.js} +1 -1
  122. package/web/assets/{index-BkreGCD-.js → index-BXb60ljb.js} +1 -1
  123. package/web/assets/{index-1ztxY10Q.js → index-BgZrQr9P.js} +2 -2
  124. package/web/assets/{index-dWh-elpj.js → index-BujjAa6S.js} +1 -1
  125. package/web/assets/{index-m-Vth8Lp.js → index-CKNeNsn1.js} +13 -13
  126. package/web/assets/{index-DVEJoNxp.js → index-CgMN-tQB.js} +1 -1
  127. package/web/assets/{index-CDFzYuLy.js → index-CkdmiFrP.js} +1 -1
  128. package/web/assets/{index-CKWELYQv.js → index-CkxFb7tB.js} +1 -1
  129. package/web/assets/{index-ClwT8-YD.js → index-CltK9KPF.js} +1 -1
  130. package/web/assets/{index-BVbociOE.js → index-D6UYzpvs.js} +1 -1
  131. package/web/assets/{index-bJjuQE-R.js → index-DHv95HPL.js} +1 -1
  132. package/web/assets/index-DZaMF5Cc.js +18 -0
  133. package/web/assets/{index-CqCoigmP.js → index-DaJyxpF_.js} +1 -1
  134. package/web/assets/{index-B7xWc-56.js → index-DfNKIFX7.js} +1 -1
  135. package/web/assets/{index-CchTHxH1.js → index-DkjcSLJ0.js} +1 -1
  136. package/web/assets/{index-DMDVPzzz.js → index-Dl2kwehD.js} +1 -1
  137. package/web/assets/{index-CK-BLN5B.js → index-Dp34xr7S.js} +1 -1
  138. package/web/assets/{index-DLMF9w63.js → index-DqIkoUqw.js} +1 -1
  139. package/web/assets/{index-CUcE1S0f.js → index-WGQA4iL6.js} +1 -1
  140. package/web/assets/{index-BvmAaESL.js → index-Xj6Um3Pu.js} +1 -1
  141. package/web/assets/{index-D_P0Kggk.js → index-ek3kRrpC.js} +1 -1
  142. package/web/assets/{index-C5XTyLQT.js → index-i59E-3bY.js} +1 -1
  143. package/web/assets/{index-p7vgCUSU.js → index-vcTqaF8o.js} +1 -1
  144. package/web/assets/{index-xznheEQN.js → index-y9N5piQy.js} +1 -1
  145. package/web/assets/{index.esm-QsCqOWi6.js → index.esm-jzsMp9Zo.js} +1 -1
  146. package/web/assets/infoDiagram-FKFFQAWI-DCtICqXj.js +2 -0
  147. package/web/assets/{ishikawaDiagram-5VMMS53U-B3gZgpzh.js → ishikawaDiagram-5VMMS53U-CSQpfhMS.js} +2 -2
  148. package/web/assets/{journeyDiagram-EYS64GPL-D_w8JGjX.js → journeyDiagram-EYS64GPL-W80U_Ccw.js} +2 -2
  149. package/web/assets/{jszip.min-CsvkqY8t.js → jszip.min-BVrMMDrm.js} +1 -1
  150. package/web/assets/{kanban-definition-UXKFOSKX-BdARDTj5.js → kanban-definition-UXKFOSKX-wK7OIhpr.js} +2 -2
  151. package/web/assets/{layout-Cjpr9Phn.js → layout-DxHdeJb6.js} +1 -1
  152. package/web/assets/{linear-rvpNqaxZ.js → linear-DcWs93MI.js} +1 -1
  153. package/web/assets/{management-url-service-BuO_Rkc1.js → management-url-service-5WvTQNzC.js} +1 -1
  154. package/web/assets/{mar-agent-reasoning-effort-oFpgtNhz.js → mar-agent-reasoning-effort-nGNzKJZF.js} +1 -1
  155. package/web/assets/mcp-center-service-CvE7d83L.js +1 -0
  156. package/web/assets/{mermaid.core-C1A7sX2Q.js → mermaid.core-D0YHAXWX.js} +10 -10
  157. package/web/assets/{mindmap-definition-THT77NOG-nLwbpZ2C.js → mindmap-definition-THT77NOG-CtoLe01d.js} +2 -2
  158. package/web/assets/{mobile-dialog-return-service-8c0Hdszs.js → mobile-dialog-return-service-szw78Fb_.js} +1 -1
  159. package/web/assets/{oauth-callback-DyBB-p_5.js → oauth-callback-kRY1gWjG.js} +1 -1
  160. package/web/assets/office-preview-content-D0ZXuRcd.js +1 -0
  161. package/web/assets/{parser-9MSNX3kG.js → parser-DQIjcH1-.js} +1 -1
  162. package/web/assets/pegDiagram-XKGWAZYB-Ciz0vkWP.js +1 -0
  163. package/web/assets/pie-B21f3Jcw.js +1 -0
  164. package/web/assets/{pieDiagram-E7YTZNPT-CBRKd2je.js → pieDiagram-E7YTZNPT-B5CIq0Lf.js} +3 -3
  165. package/web/assets/{quadrantDiagram-AXDQQJYC-B78h4Jcp.js → quadrantDiagram-AXDQQJYC-By7ER2U2.js} +2 -2
  166. package/web/assets/railroadDiagram-O6MQD6OU-CuRWrWkF.js +1 -0
  167. package/web/assets/{requirementDiagram-IS5BZ75X-Cv6oz6T-.js → requirementDiagram-IS5BZ75X-Dm-8x0xg.js} +2 -2
  168. package/web/assets/{runner-presentation-BjEVsVDR.js → runner-presentation-CqR6RZ2f.js} +1 -1
  169. package/web/assets/{sankeyDiagram-P5KCCOFB-DMdnaPyY.js → sankeyDiagram-P5KCCOFB-CKF82NHc.js} +2 -2
  170. package/web/assets/{scoped-http-service-BVzLlWqo.css → scoped-http-service-DndsZGnK.css} +1 -1
  171. package/web/assets/scoped-http-service-hGJUOrzj.js +7 -0
  172. package/web/assets/{sequenceDiagram-WJ2MYXX4-Dat0PaJ8.js → sequenceDiagram-WJ2MYXX4-C2vuuSXZ.js} +2 -2
  173. package/web/assets/{session-share-client-service-Dei7sXZO.js → session-share-client-service--097i0dw.js} +1 -1
  174. package/web/assets/sizeCapture-INFHLROL-BLrfm-2B.js +1 -0
  175. package/web/assets/{spreadsheet-CliGFPUB.js → spreadsheet-BzSEg54w.js} +4 -4
  176. package/web/assets/stateDiagram-XQSTLZYL-BHs6Prnk.js +1 -0
  177. package/web/assets/stateDiagram-v2-IH3M54BS-DV6maewS.js +1 -0
  178. package/web/assets/swimlanes-V6O3JKXN-qyWgYGXC.js +1 -0
  179. package/web/assets/swimlanesDiagram-JKAHXJPX-BxGFH_8w.js +8 -0
  180. package/web/assets/{time-DC3Mg0i2.js → time-DjKvo7nM.js} +1 -1
  181. package/web/assets/{time-presentation-pOQ1ZO_U.js → time-presentation-B5QAWtBf.js} +1 -1
  182. package/web/assets/{timeline-definition-24CTP7MA-86vVFEkd.js → timeline-definition-24CTP7MA-DVUo_Z66.js} +2 -2
  183. package/web/assets/{transform-CXma_uU-.js → transform-YfG62m2h.js} +1 -1
  184. package/web/assets/{vennDiagram-4TSXK5OY-D1q8T4f-.js → vennDiagram-4TSXK5OY-hexhULHW.js} +2 -2
  185. package/web/assets/{wardleyDiagram-VM6X3IG4-GeKVLSox.js → wardleyDiagram-VM6X3IG4-gdqzyrOZ.js} +2 -2
  186. package/web/assets/{workbench-live-service-B89IkMyd.js → workbench-live-service-Mn3Hb6LP.js} +1 -1
  187. package/web/assets/workbench-presentation-D8FQswdV.js +1 -0
  188. package/web/assets/{workspace-direct-transfer-service-Drc-w6o5.js → workspace-direct-transfer-service-DV-cgEer.js} +1 -1
  189. package/web/assets/{xychartDiagram-S5SC5T6Z-D78O3RsI.js → xychartDiagram-S5SC5T6Z-BExraG4Q.js} +2 -2
  190. package/web/docs/404.html +1 -1
  191. package/web/docs/administration/account.html +2 -2
  192. package/web/docs/administration/audit.html +2 -2
  193. package/web/docs/administration/conversation-templates.html +2 -2
  194. package/web/docs/administration/email-notifications.html +2 -2
  195. package/web/docs/administration/license.html +2 -2
  196. package/web/docs/administration/nodes-workspaces.html +2 -2
  197. package/web/docs/administration/oauth.html +2 -2
  198. package/web/docs/administration/secrets.html +2 -2
  199. package/web/docs/administration/template-workspace-maintenance.html +2 -2
  200. package/web/docs/administration/users-organizations.html +2 -2
  201. package/web/docs/assets/{app.IG6cdLVL.js → app.qSEvwjJn.js} +1 -1
  202. package/web/docs/assets/chunks/{@localSearchIndexen-US.C05wTUcn.js → @localSearchIndexen-US.T1F90Fmq.js} +1 -1
  203. package/web/docs/assets/chunks/{@localSearchIndexroot.WReEePz8.js → @localSearchIndexroot.DokTaNKc.js} +1 -1
  204. package/web/docs/assets/chunks/{VPLocalSearchBox.0cBFdZWo.js → VPLocalSearchBox.BX5_fH81.js} +1 -1
  205. package/web/docs/assets/chunks/{theme.D-ifa0oj.js → theme.COkmiT5c.js} +2 -2
  206. package/web/docs/concepts/architecture.html +2 -2
  207. package/web/docs/concepts/data-and-security.html +2 -2
  208. package/web/docs/concepts/files-git-terminal.html +2 -2
  209. package/web/docs/concepts/node-and-workspace.html +2 -2
  210. package/web/docs/concepts/permissions-and-sharing.html +2 -2
  211. package/web/docs/concepts/runner-control.html +2 -2
  212. package/web/docs/concepts/secrets.html +2 -2
  213. package/web/docs/concepts/session-run-turn.html +2 -2
  214. package/web/docs/deployment/backup-restore.html +2 -2
  215. package/web/docs/deployment/network.html +2 -2
  216. package/web/docs/deployment/node-installation.html +2 -2
  217. package/web/docs/deployment/node-linux.html +2 -2
  218. package/web/docs/deployment/node-macos.html +2 -2
  219. package/web/docs/deployment/node-windows.html +2 -2
  220. package/web/docs/deployment/production.html +2 -2
  221. package/web/docs/deployment/security-checklist.html +2 -2
  222. package/web/docs/deployment/upgrade.html +2 -2
  223. package/web/docs/en-US/administration/account.html +2 -2
  224. package/web/docs/en-US/administration/audit.html +2 -2
  225. package/web/docs/en-US/administration/conversation-templates.html +2 -2
  226. package/web/docs/en-US/administration/email-notifications.html +2 -2
  227. package/web/docs/en-US/administration/license.html +2 -2
  228. package/web/docs/en-US/administration/nodes-workspaces.html +2 -2
  229. package/web/docs/en-US/administration/oauth.html +2 -2
  230. package/web/docs/en-US/administration/secrets.html +2 -2
  231. package/web/docs/en-US/administration/template-workspace-maintenance.html +2 -2
  232. package/web/docs/en-US/administration/users-organizations.html +2 -2
  233. package/web/docs/en-US/concepts/architecture.html +2 -2
  234. package/web/docs/en-US/concepts/data-and-security.html +2 -2
  235. package/web/docs/en-US/concepts/files-git-terminal.html +2 -2
  236. package/web/docs/en-US/concepts/node-and-workspace.html +2 -2
  237. package/web/docs/en-US/concepts/permissions-and-sharing.html +2 -2
  238. package/web/docs/en-US/concepts/runner-control.html +2 -2
  239. package/web/docs/en-US/concepts/secrets.html +2 -2
  240. package/web/docs/en-US/concepts/session-run-turn.html +2 -2
  241. package/web/docs/en-US/deployment/backup-restore.html +2 -2
  242. package/web/docs/en-US/deployment/network.html +2 -2
  243. package/web/docs/en-US/deployment/node-installation.html +2 -2
  244. package/web/docs/en-US/deployment/node-linux.html +2 -2
  245. package/web/docs/en-US/deployment/node-macos.html +2 -2
  246. package/web/docs/en-US/deployment/node-windows.html +2 -2
  247. package/web/docs/en-US/deployment/production.html +2 -2
  248. package/web/docs/en-US/deployment/security-checklist.html +2 -2
  249. package/web/docs/en-US/deployment/upgrade.html +2 -2
  250. package/web/docs/en-US/getting-started/connect-node.html +2 -2
  251. package/web/docs/en-US/getting-started/first-agent-session.html +2 -2
  252. package/web/docs/en-US/getting-started/first-login.html +2 -2
  253. package/web/docs/en-US/getting-started/next-steps.html +2 -2
  254. package/web/docs/en-US/getting-started/npm-quick-start.html +2 -2
  255. package/web/docs/en-US/getting-started/overview.html +2 -2
  256. package/web/docs/en-US/getting-started/prerequisites.html +2 -2
  257. package/web/docs/en-US/getting-started/register-workspace.html +2 -2
  258. package/web/docs/en-US/getting-started/server-installation.html +2 -2
  259. package/web/docs/en-US/operations/marctl.html +2 -2
  260. package/web/docs/en-US/reference/configuration.html +2 -2
  261. package/web/docs/en-US/reference/keyboard-shortcuts.html +2 -2
  262. package/web/docs/en-US/reference/limits.html +2 -2
  263. package/web/docs/en-US/reference/ports-paths-data.html +2 -2
  264. package/web/docs/en-US/reference/status-and-errors.html +2 -2
  265. package/web/docs/en-US/runners/claude-code.html +2 -2
  266. package/web/docs/en-US/runners/codex.html +2 -2
  267. package/web/docs/en-US/runners/mar-agent.html +2 -2
  268. package/web/docs/en-US/runners/opencode.html +2 -2
  269. package/web/docs/en-US/runners/overview.html +2 -2
  270. package/web/docs/en-US/runners/runner-troubleshooting.html +2 -2
  271. package/web/docs/en-US/troubleshooting/node-offline.html +2 -2
  272. package/web/docs/en-US/troubleshooting/quick-diagnosis.html +2 -2
  273. package/web/docs/en-US/troubleshooting/session-run.html +2 -2
  274. package/web/docs/en-US/troubleshooting/terminal.html +2 -2
  275. package/web/docs/en-US/troubleshooting/workspace-files.html +2 -2
  276. package/web/docs/en-US/workbench/browser.html +2 -2
  277. package/web/docs/en-US/workbench/composer.html +2 -2
  278. package/web/docs/en-US/workbench/context-and-plan.html +2 -2
  279. package/web/docs/en-US/workbench/conversation.html +2 -2
  280. package/web/docs/en-US/workbench/file-reference-and-attachment.html +2 -2
  281. package/web/docs/en-US/workbench/files.html +2 -2
  282. package/web/docs/en-US/workbench/git-changes.html +2 -2
  283. package/web/docs/en-US/workbench/git-history.html +2 -2
  284. package/web/docs/en-US/workbench/hosted-conversations.html +2 -2
  285. package/web/docs/en-US/workbench/mobile.html +2 -2
  286. package/web/docs/en-US/workbench/navigation.html +2 -2
  287. package/web/docs/en-US/workbench/remote-desktop.html +2 -2
  288. package/web/docs/en-US/workbench/sessions.html +2 -2
  289. package/web/docs/en-US/workbench/skills.html +2 -2
  290. package/web/docs/en-US/workbench/terminal.html +2 -2
  291. package/web/docs/getting-started/connect-node.html +2 -2
  292. package/web/docs/getting-started/first-agent-session.html +2 -2
  293. package/web/docs/getting-started/first-login.html +2 -2
  294. package/web/docs/getting-started/next-steps.html +2 -2
  295. package/web/docs/getting-started/npm-quick-start.html +2 -2
  296. package/web/docs/getting-started/overview.html +2 -2
  297. package/web/docs/getting-started/prerequisites.html +2 -2
  298. package/web/docs/getting-started/register-workspace.html +2 -2
  299. package/web/docs/getting-started/server-installation.html +2 -2
  300. package/web/docs/operations/marctl.html +2 -2
  301. package/web/docs/reference/configuration.html +2 -2
  302. package/web/docs/reference/keyboard-shortcuts.html +2 -2
  303. package/web/docs/reference/limits.html +2 -2
  304. package/web/docs/reference/ports-paths-data.html +2 -2
  305. package/web/docs/reference/status-and-errors.html +2 -2
  306. package/web/docs/runners/claude-code.html +2 -2
  307. package/web/docs/runners/codex.html +2 -2
  308. package/web/docs/runners/mar-agent.html +2 -2
  309. package/web/docs/runners/opencode.html +2 -2
  310. package/web/docs/runners/overview.html +2 -2
  311. package/web/docs/runners/runner-troubleshooting.html +2 -2
  312. package/web/docs/troubleshooting/node-offline.html +2 -2
  313. package/web/docs/troubleshooting/quick-diagnosis.html +2 -2
  314. package/web/docs/troubleshooting/session-run.html +2 -2
  315. package/web/docs/troubleshooting/terminal.html +2 -2
  316. package/web/docs/troubleshooting/workspace-files.html +2 -2
  317. package/web/docs/workbench/browser.html +2 -2
  318. package/web/docs/workbench/composer.html +2 -2
  319. package/web/docs/workbench/context-and-plan.html +2 -2
  320. package/web/docs/workbench/conversation.html +2 -2
  321. package/web/docs/workbench/file-reference-and-attachment.html +2 -2
  322. package/web/docs/workbench/files.html +2 -2
  323. package/web/docs/workbench/git-changes.html +2 -2
  324. package/web/docs/workbench/git-history.html +2 -2
  325. package/web/docs/workbench/hosted-conversations.html +2 -2
  326. package/web/docs/workbench/mobile.html +2 -2
  327. package/web/docs/workbench/navigation.html +2 -2
  328. package/web/docs/workbench/remote-desktop.html +2 -2
  329. package/web/docs/workbench/sessions.html +2 -2
  330. package/web/docs/workbench/skills.html +2 -2
  331. package/web/docs/workbench/terminal.html +2 -2
  332. package/web/index.html +2 -2
  333. package/web/service-worker.js +1 -1
  334. package/web/web-version.json +1 -1
  335. package/web/assets/AuditManagementPage-zwPBs-Ce.js +0 -1
  336. package/web/assets/AuthEntryPanel-Cjjl18ym.css +0 -1
  337. package/web/assets/ConversationTemplateManagementPage-CPOXegFa.js +0 -1
  338. package/web/assets/ConversationTemplateManagementPage-DF0i1Cs1.js +0 -1
  339. package/web/assets/EnterpriseUserManagementPage-DLLDJNkU.js +0 -1
  340. package/web/assets/EnvironmentSecretManager-ZNomBsD1.js +0 -1
  341. package/web/assets/FilePreviewState-pYNEkUjZ.js +0 -24
  342. package/web/assets/ManagementPagination-iGAGnhIO.js +0 -1
  343. package/web/assets/MarAgentModelManagementPage-DKflhYMH.js +0 -1
  344. package/web/assets/MarAgentModelManagementPage-PVLZn_dL.js +0 -1
  345. package/web/assets/MarAlert-_tcVNzIU.js +0 -1
  346. package/web/assets/MarCascader-BYIWt0sQ.js +0 -1
  347. package/web/assets/MarCheckboxGroup.vue_vue_type_style_index_0_scoped_3769668f_lang-BTYujnMk.js +0 -1
  348. package/web/assets/MarDatePicker-DOd41mfH.js +0 -1
  349. package/web/assets/MarInputNumber-10vTwsKI.js +0 -1
  350. package/web/assets/MarOptionGroup.vue_vue_type_style_index_0_scoped_0cdd846e_lang-DyF6NqNF.js +0 -1
  351. package/web/assets/MarTableColumn.vue_vue_type_script_setup_true_lang-D19MPZhF.js +0 -1
  352. package/web/assets/MarTabs-BjfW3mGn.js +0 -1
  353. package/web/assets/MarkdownFilePreview-B3vmpJ_r.css +0 -1
  354. package/web/assets/MarkdownFilePreview-DgKOCHSz.js +0 -2
  355. package/web/assets/McpDetailsDialog-BMIxE9bH.js +0 -1
  356. package/web/assets/McpSourceManagementPage-2Uyo1wAD.js +0 -1
  357. package/web/assets/NodeDetailsDialogs-BFhSvz5U.js +0 -1
  358. package/web/assets/NodeManagementPage-67BVOr7i.js +0 -1
  359. package/web/assets/NodeManagementPage-XVXLHVza.js +0 -1
  360. package/web/assets/RemoteDesktopPage-DbhQwrsT.js +0 -1
  361. package/web/assets/ResourceManagementPanel.vue_vue_type_script_setup_true_lang-vLSuFGUT.js +0 -1
  362. package/web/assets/SecretManagementPage-DWEnFHaU.js +0 -1
  363. package/web/assets/SessionSharePage-_33GkXBz.js +0 -2
  364. package/web/assets/SettingsContent-CNd6x354.js +0 -1
  365. package/web/assets/SettingsContent-CPLjVTvX.js +0 -1
  366. package/web/assets/SkillCenterPage-DBhCMEgw.js +0 -1
  367. package/web/assets/SkillCenterPage-DIKNNNiP.js +0 -1
  368. package/web/assets/SkillSourceManagementPage-7Anj4ewB.js +0 -1
  369. package/web/assets/StandaloneFilePreviewPage-BY0PaVUk.js +0 -1
  370. package/web/assets/SystemConfigurationPage-BoWrS3cV.js +0 -1
  371. package/web/assets/WorkspaceManagementPage-cnTVpL3X.js +0 -1
  372. package/web/assets/WorkspaceManagementPage-g0O9u1XQ.js +0 -1
  373. package/web/assets/abnfDiagram-VCTEODGH-BAGlleHn.js +0 -1
  374. package/web/assets/architectureDiagram-5GKGNRK7-CvVqnRUV.js +0 -36
  375. package/web/assets/channel-B9YzXmoh.js +0 -1
  376. package/web/assets/classDiagram-CYGNFDIV-ZzVe_iSa.js +0 -1
  377. package/web/assets/classDiagram-v2-TLXNO2FR-ZzVe_iSa.js +0 -1
  378. package/web/assets/cose-bilkent-JH36ORCC-DvgtaUEo.js +0 -1
  379. package/web/assets/cynefinDiagram-5FMLGOSQ-C5JpE3Gi.js +0 -62
  380. package/web/assets/diagram-UQ7AKVKN-FWbYdMBn.js +0 -41
  381. package/web/assets/diagram-VX7I27RA-BuHhC6bF.js +0 -24
  382. package/web/assets/diagram-Z3DM3KII-B4kjdH0n.js +0 -24
  383. package/web/assets/ebnfDiagram-PWID7BFC-BIKv5E-d.js +0 -1
  384. package/web/assets/gitGraphDiagram-WWUBYQGX-j8eLeKlH.js +0 -106
  385. package/web/assets/infoDiagram-FKFFQAWI-B-2gAPSJ.js +0 -2
  386. package/web/assets/mcp-center-service-DilPQiPa.js +0 -1
  387. package/web/assets/pegDiagram-XKGWAZYB-Bha_zpMx.js +0 -1
  388. package/web/assets/pie-CALWOQR1.js +0 -1
  389. package/web/assets/railroadDiagram-O6MQD6OU-CIDBmt0c.js +0 -1
  390. package/web/assets/scoped-http-service-DAqwVDhi.js +0 -10
  391. package/web/assets/sizeCapture-INFHLROL-B4UowqbS.js +0 -1
  392. package/web/assets/stateDiagram-XQSTLZYL-WtARd8Pr.js +0 -1
  393. package/web/assets/stateDiagram-v2-IH3M54BS-Kf89TbDo.js +0 -1
  394. package/web/assets/swimlanes-V6O3JKXN-SrACAKI4.js +0 -1
  395. package/web/assets/swimlanesDiagram-JKAHXJPX-gtv67fR8.js +0 -8
  396. package/web/assets/workbench-presentation-BKp2r7v0.js +0 -1
@@ -1 +1 @@
1
- var vt="http://www.w3.org/1999/xhtml";const Xt={svg:"http://www.w3.org/2000/svg",xhtml:vt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ct(t){var n=t+="",i=n.indexOf(":");return i>=0&&(n=t.slice(0,i))!=="xmlns"&&(t=t.slice(i+1)),Xt.hasOwnProperty(n)?{space:Xt[n],local:t}:t}function Kn(t){return function(){var n=this.ownerDocument,i=this.namespaceURI;return i===vt&&n.documentElement.namespaceURI===vt?n.createElement(t):n.createElementNS(i,t)}}function Gn(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function un(t){var n=ct(t);return(n.local?Gn:Kn)(n)}function Zn(){}function St(t){return t==null?Zn:function(){return this.querySelector(t)}}function Qn(t){typeof t!="function"&&(t=St(t));for(var n=this._groups,i=n.length,e=new Array(i),r=0;r<i;++r)for(var s=n[r],o=s.length,a=e[r]=new Array(o),h,u,l=0;l<o;++l)(h=s[l])&&(u=t.call(h,h.__data__,l,s))&&("__data__"in h&&(u.__data__=h.__data__),a[l]=u);return new y(e,this._parents)}function Wn(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Jn(){return[]}function ln(t){return t==null?Jn:function(){return this.querySelectorAll(t)}}function jn(t){return function(){return Wn(t.apply(this,arguments))}}function ti(t){typeof t=="function"?t=jn(t):t=ln(t);for(var n=this._groups,i=n.length,e=[],r=[],s=0;s<i;++s)for(var o=n[s],a=o.length,h,u=0;u<a;++u)(h=o[u])&&(e.push(t.call(h,h.__data__,u,o)),r.push(h));return new y(e,r)}function cn(t){return function(){return this.matches(t)}}function fn(t){return function(n){return n.matches(t)}}var ni=Array.prototype.find;function ii(t){return function(){return ni.call(this.children,t)}}function ei(){return this.firstElementChild}function ri(t){return this.select(t==null?ei:ii(typeof t=="function"?t:fn(t)))}var si=Array.prototype.filter;function oi(){return Array.from(this.children)}function ai(t){return function(){return si.call(this.children,t)}}function hi(t){return this.selectAll(t==null?oi:ai(typeof t=="function"?t:fn(t)))}function ui(t){typeof t!="function"&&(t=cn(t));for(var n=this._groups,i=n.length,e=new Array(i),r=0;r<i;++r)for(var s=n[r],o=s.length,a=e[r]=[],h,u=0;u<o;++u)(h=s[u])&&t.call(h,h.__data__,u,s)&&a.push(h);return new y(e,this._parents)}function _n(t){return new Array(t.length)}function li(){return new y(this._enter||this._groups.map(_n),this._parents)}function it(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}it.prototype={constructor:it,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function ci(t){return function(){return t}}function fi(t,n,i,e,r,s){for(var o=0,a,h=n.length,u=s.length;o<u;++o)(a=n[o])?(a.__data__=s[o],e[o]=a):i[o]=new it(t,s[o]);for(;o<h;++o)(a=n[o])&&(r[o]=a)}function _i(t,n,i,e,r,s,o){var a,h,u=new Map,l=n.length,c=s.length,f=new Array(l),_;for(a=0;a<l;++a)(h=n[a])&&(f[a]=_=o.call(h,h.__data__,a,n)+"",u.has(_)?r[a]=h:u.set(_,h));for(a=0;a<c;++a)_=o.call(t,s[a],a,s)+"",(h=u.get(_))?(e[a]=h,h.__data__=s[a],u.delete(_)):i[a]=new it(t,s[a]);for(a=0;a<l;++a)(h=n[a])&&u.get(f[a])===h&&(r[a]=h)}function pi(t){return t.__data__}function xi(t,n){if(!arguments.length)return Array.from(this,pi);var i=n?_i:fi,e=this._parents,r=this._groups;typeof t!="function"&&(t=ci(t));for(var s=r.length,o=new Array(s),a=new Array(s),h=new Array(s),u=0;u<s;++u){var l=e[u],c=r[u],f=c.length,_=di(t.call(l,l&&l.__data__,u,e)),p=_.length,x=a[u]=new Array(p),b=o[u]=new Array(p),Z=h[u]=new Array(f);i(l,c,x,b,Z,_,n);for(var $=0,S=0,P,X;$<p;++$)if(P=x[$]){for($>=S&&(S=$+1);!(X=b[S])&&++S<p;);P._next=X||null}}return o=new y(o,e),o._enter=a,o._exit=h,o}function di(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function yi(){return new y(this._exit||this._groups.map(_n),this._parents)}function wi(t,n,i){var e=this.enter(),r=this,s=this.exit();return typeof t=="function"?(e=t(e),e&&(e=e.selection())):e=e.append(t+""),n!=null&&(r=n(r),r&&(r=r.selection())),i==null?s.remove():i(s),e&&r?e.merge(r).order():r}function vi(t){for(var n=t.selection?t.selection():t,i=this._groups,e=n._groups,r=i.length,s=e.length,o=Math.min(r,s),a=new Array(r),h=0;h<o;++h)for(var u=i[h],l=e[h],c=u.length,f=a[h]=new Array(c),_,p=0;p<c;++p)(_=u[p]||l[p])&&(f[p]=_);for(;h<r;++h)a[h]=i[h];return new y(a,this._parents)}function gi(){for(var t=this._groups,n=-1,i=t.length;++n<i;)for(var e=t[n],r=e.length-1,s=e[r],o;--r>=0;)(o=e[r])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function mi(t){t||(t=bi);function n(c,f){return c&&f?t(c.__data__,f.__data__):!c-!f}for(var i=this._groups,e=i.length,r=new Array(e),s=0;s<e;++s){for(var o=i[s],a=o.length,h=r[s]=new Array(a),u,l=0;l<a;++l)(u=o[l])&&(h[l]=u);h.sort(n)}return new y(r,this._parents).order()}function bi(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function Ni(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function ki(){return Array.from(this)}function $i(){for(var t=this._groups,n=0,i=t.length;n<i;++n)for(var e=t[n],r=0,s=e.length;r<s;++r){var o=e[r];if(o)return o}return null}function Ti(){let t=0;for(const n of this)++t;return t}function Ei(){return!this.node()}function Si(t){for(var n=this._groups,i=0,e=n.length;i<e;++i)for(var r=n[i],s=0,o=r.length,a;s<o;++s)(a=r[s])&&t.call(a,a.__data__,s,r);return this}function Ai(t){return function(){this.removeAttribute(t)}}function Mi(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ci(t,n){return function(){this.setAttribute(t,n)}}function Ri(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function Pi(t,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttribute(t):this.setAttribute(t,i)}}function Ii(t,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,i)}}function qi(t,n){var i=ct(t);if(arguments.length<2){var e=this.node();return i.local?e.getAttributeNS(i.space,i.local):e.getAttribute(i)}return this.each((n==null?i.local?Mi:Ai:typeof n=="function"?i.local?Ii:Pi:i.local?Ri:Ci)(i,n))}function pn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Fi(t){return function(){this.style.removeProperty(t)}}function Li(t,n,i){return function(){this.style.setProperty(t,n,i)}}function Oi(t,n,i){return function(){var e=n.apply(this,arguments);e==null?this.style.removeProperty(t):this.style.setProperty(t,e,i)}}function Hi(t,n,i){return arguments.length>1?this.each((n==null?Fi:typeof n=="function"?Oi:Li)(t,n,i??"")):L(this.node(),t)}function L(t,n){return t.style.getPropertyValue(n)||pn(t).getComputedStyle(t,null).getPropertyValue(n)}function Xi(t){return function(){delete this[t]}}function Di(t,n){return function(){this[t]=n}}function zi(t,n){return function(){var i=n.apply(this,arguments);i==null?delete this[t]:this[t]=i}}function Bi(t,n){return arguments.length>1?this.each((n==null?Xi:typeof n=="function"?zi:Di)(t,n)):this.node()[t]}function xn(t){return t.trim().split(/^|\s+/)}function At(t){return t.classList||new dn(t)}function dn(t){this._node=t,this._names=xn(t.getAttribute("class")||"")}dn.prototype={add:function(t){var n=this._names.indexOf(t);n<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function yn(t,n){for(var i=At(t),e=-1,r=n.length;++e<r;)i.add(n[e])}function wn(t,n){for(var i=At(t),e=-1,r=n.length;++e<r;)i.remove(n[e])}function Yi(t){return function(){yn(this,t)}}function Vi(t){return function(){wn(this,t)}}function Ui(t,n){return function(){(n.apply(this,arguments)?yn:wn)(this,t)}}function Ki(t,n){var i=xn(t+"");if(arguments.length<2){for(var e=At(this.node()),r=-1,s=i.length;++r<s;)if(!e.contains(i[r]))return!1;return!0}return this.each((typeof n=="function"?Ui:n?Yi:Vi)(i,n))}function Gi(){this.textContent=""}function Zi(t){return function(){this.textContent=t}}function Qi(t){return function(){var n=t.apply(this,arguments);this.textContent=n??""}}function Wi(t){return arguments.length?this.each(t==null?Gi:(typeof t=="function"?Qi:Zi)(t)):this.node().textContent}function Ji(){this.innerHTML=""}function ji(t){return function(){this.innerHTML=t}}function te(t){return function(){var n=t.apply(this,arguments);this.innerHTML=n??""}}function ne(t){return arguments.length?this.each(t==null?Ji:(typeof t=="function"?te:ji)(t)):this.node().innerHTML}function ie(){this.nextSibling&&this.parentNode.appendChild(this)}function ee(){return this.each(ie)}function re(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function se(){return this.each(re)}function oe(t){var n=typeof t=="function"?t:un(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function ae(){return null}function he(t,n){var i=typeof t=="function"?t:un(t),e=n==null?ae:typeof n=="function"?n:St(n);return this.select(function(){return this.insertBefore(i.apply(this,arguments),e.apply(this,arguments)||null)})}function ue(){var t=this.parentNode;t&&t.removeChild(this)}function le(){return this.each(ue)}function ce(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function fe(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function _e(t){return this.select(t?fe:ce)}function pe(t){return arguments.length?this.property("__data__",t):this.node().__data__}function xe(t){return function(n){t.call(this,n,this.__data__)}}function de(t){return t.trim().split(/^|\s+/).map(function(n){var i="",e=n.indexOf(".");return e>=0&&(i=n.slice(e+1),n=n.slice(0,e)),{type:n,name:i}})}function ye(t){return function(){var n=this.__on;if(n){for(var i=0,e=-1,r=n.length,s;i<r;++i)s=n[i],(!t.type||s.type===t.type)&&s.name===t.name?this.removeEventListener(s.type,s.listener,s.options):n[++e]=s;++e?n.length=e:delete this.__on}}}function we(t,n,i){return function(){var e=this.__on,r,s=xe(n);if(e){for(var o=0,a=e.length;o<a;++o)if((r=e[o]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=s,r.options=i),r.value=n;return}}this.addEventListener(t.type,s,i),r={type:t.type,name:t.name,value:n,listener:s,options:i},e?e.push(r):this.__on=[r]}}function ve(t,n,i){var e=de(t+""),r,s=e.length,o;if(arguments.length<2){var a=this.node().__on;if(a){for(var h=0,u=a.length,l;h<u;++h)for(r=0,l=a[h];r<s;++r)if((o=e[r]).type===l.type&&o.name===l.name)return l.value}return}for(a=n?we:ye,r=0;r<s;++r)this.each(a(e[r],n,i));return this}function vn(t,n,i){var e=pn(t),r=e.CustomEvent;typeof r=="function"?r=new r(n,i):(r=e.document.createEvent("Event"),i?(r.initEvent(n,i.bubbles,i.cancelable),r.detail=i.detail):r.initEvent(n,!1,!1)),t.dispatchEvent(r)}function ge(t,n){return function(){return vn(this,t,n)}}function me(t,n){return function(){return vn(this,t,n.apply(this,arguments))}}function be(t,n){return this.each((typeof n=="function"?me:ge)(t,n))}function*Ne(){for(var t=this._groups,n=0,i=t.length;n<i;++n)for(var e=t[n],r=0,s=e.length,o;r<s;++r)(o=e[r])&&(yield o)}var gn=[null];function y(t,n){this._groups=t,this._parents=n}function H(){return new y([[document.documentElement]],gn)}function ke(){return this}y.prototype=H.prototype={constructor:y,select:Qn,selectAll:ti,selectChild:ri,selectChildren:hi,filter:ui,data:xi,enter:li,exit:yi,join:wi,merge:vi,selection:ke,order:gi,sort:mi,call:Ni,nodes:ki,node:$i,size:Ti,empty:Ei,each:Si,attr:qi,style:Hi,property:Bi,classed:Ki,text:Wi,html:ne,raise:ee,lower:se,append:oe,insert:he,remove:le,clone:_e,datum:pe,on:ve,dispatch:be,[Symbol.iterator]:Ne};function ws(t){return typeof t=="string"?new y([[document.querySelector(t)]],[document.documentElement]):new y([[t]],gn)}var $e={value:()=>{}};function mn(){for(var t=0,n=arguments.length,i={},e;t<n;++t){if(!(e=arguments[t]+"")||e in i||/[\s.]/.test(e))throw new Error("illegal type: "+e);i[e]=[]}return new j(i)}function j(t){this._=t}function Te(t,n){return t.trim().split(/^|\s+/).map(function(i){var e="",r=i.indexOf(".");if(r>=0&&(e=i.slice(r+1),i=i.slice(0,r)),i&&!n.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:e}})}j.prototype=mn.prototype={constructor:j,on:function(t,n){var i=this._,e=Te(t+"",i),r,s=-1,o=e.length;if(arguments.length<2){for(;++s<o;)if((r=(t=e[s]).type)&&(r=Ee(i[r],t.name)))return r;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++s<o;)if(r=(t=e[s]).type)i[r]=Dt(i[r],t.name,n);else if(n==null)for(r in i)i[r]=Dt(i[r],t.name,null);return this},copy:function(){var t={},n=this._;for(var i in n)t[i]=n[i].slice();return new j(t)},call:function(t,n){if((r=arguments.length-2)>0)for(var i=new Array(r),e=0,r,s;e<r;++e)i[e]=arguments[e+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],e=0,r=s.length;e<r;++e)s[e].value.apply(n,i)},apply:function(t,n,i){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var e=this._[t],r=0,s=e.length;r<s;++r)e[r].value.apply(n,i)}};function Ee(t,n){for(var i=0,e=t.length,r;i<e;++i)if((r=t[i]).name===n)return r.value}function Dt(t,n,i){for(var e=0,r=t.length;e<r;++e)if(t[e].name===n){t[e]=$e,t=t.slice(0,e).concat(t.slice(e+1));break}return i!=null&&t.push({name:n,value:i}),t}function Mt(t,n,i){t.prototype=n.prototype=i,i.constructor=t}function bn(t,n){var i=Object.create(t.prototype);for(var e in n)i[e]=n[e];return i}function G(){}var Y=.7,et=1/Y,F="\\s*([+-]?\\d+)\\s*",V="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",g="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Se=/^#([0-9a-f]{3,8})$/,Ae=new RegExp(`^rgb\\(${F},${F},${F}\\)$`),Me=new RegExp(`^rgb\\(${g},${g},${g}\\)$`),Ce=new RegExp(`^rgba\\(${F},${F},${F},${V}\\)$`),Re=new RegExp(`^rgba\\(${g},${g},${g},${V}\\)$`),Pe=new RegExp(`^hsl\\(${V},${g},${g}\\)$`),Ie=new RegExp(`^hsla\\(${V},${g},${g},${V}\\)$`),zt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Mt(G,U,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Bt,formatHex:Bt,formatHex8:qe,formatHsl:Fe,formatRgb:Yt,toString:Yt});function Bt(){return this.rgb().formatHex()}function qe(){return this.rgb().formatHex8()}function Fe(){return Nn(this).formatHsl()}function Yt(){return this.rgb().formatRgb()}function U(t){var n,i;return t=(t+"").trim().toLowerCase(),(n=Se.exec(t))?(i=n[1].length,n=parseInt(n[1],16),i===6?Vt(n):i===3?new d(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):i===8?Q(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):i===4?Q(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=Ae.exec(t))?new d(n[1],n[2],n[3],1):(n=Me.exec(t))?new d(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=Ce.exec(t))?Q(n[1],n[2],n[3],n[4]):(n=Re.exec(t))?Q(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=Pe.exec(t))?Gt(n[1],n[2]/100,n[3]/100,1):(n=Ie.exec(t))?Gt(n[1],n[2]/100,n[3]/100,n[4]):zt.hasOwnProperty(t)?Vt(zt[t]):t==="transparent"?new d(NaN,NaN,NaN,0):null}function Vt(t){return new d(t>>16&255,t>>8&255,t&255,1)}function Q(t,n,i,e){return e<=0&&(t=n=i=NaN),new d(t,n,i,e)}function Le(t){return t instanceof G||(t=U(t)),t?(t=t.rgb(),new d(t.r,t.g,t.b,t.opacity)):new d}function gt(t,n,i,e){return arguments.length===1?Le(t):new d(t,n,i,e??1)}function d(t,n,i,e){this.r=+t,this.g=+n,this.b=+i,this.opacity=+e}Mt(d,gt,bn(G,{brighter(t){return t=t==null?et:Math.pow(et,t),new d(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Y:Math.pow(Y,t),new d(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new d(C(this.r),C(this.g),C(this.b),rt(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ut,formatHex:Ut,formatHex8:Oe,formatRgb:Kt,toString:Kt}));function Ut(){return`#${M(this.r)}${M(this.g)}${M(this.b)}`}function Oe(){return`#${M(this.r)}${M(this.g)}${M(this.b)}${M((isNaN(this.opacity)?1:this.opacity)*255)}`}function Kt(){const t=rt(this.opacity);return`${t===1?"rgb(":"rgba("}${C(this.r)}, ${C(this.g)}, ${C(this.b)}${t===1?")":`, ${t})`}`}function rt(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function C(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function M(t){return t=C(t),(t<16?"0":"")+t.toString(16)}function Gt(t,n,i,e){return e<=0?t=n=i=NaN:i<=0||i>=1?t=n=NaN:n<=0&&(t=NaN),new w(t,n,i,e)}function Nn(t){if(t instanceof w)return new w(t.h,t.s,t.l,t.opacity);if(t instanceof G||(t=U(t)),!t)return new w;if(t instanceof w)return t;t=t.rgb();var n=t.r/255,i=t.g/255,e=t.b/255,r=Math.min(n,i,e),s=Math.max(n,i,e),o=NaN,a=s-r,h=(s+r)/2;return a?(n===s?o=(i-e)/a+(i<e)*6:i===s?o=(e-n)/a+2:o=(n-i)/a+4,a/=h<.5?s+r:2-s-r,o*=60):a=h>0&&h<1?0:o,new w(o,a,h,t.opacity)}function He(t,n,i,e){return arguments.length===1?Nn(t):new w(t,n,i,e??1)}function w(t,n,i,e){this.h=+t,this.s=+n,this.l=+i,this.opacity=+e}Mt(w,He,bn(G,{brighter(t){return t=t==null?et:Math.pow(et,t),new w(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Y:Math.pow(Y,t),new w(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,n=isNaN(t)||isNaN(this.s)?0:this.s,i=this.l,e=i+(i<.5?i:1-i)*n,r=2*i-e;return new d(dt(t>=240?t-240:t+120,r,e),dt(t,r,e),dt(t<120?t+240:t-120,r,e),this.opacity)},clamp(){return new w(Zt(this.h),W(this.s),W(this.l),rt(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=rt(this.opacity);return`${t===1?"hsl(":"hsla("}${Zt(this.h)}, ${W(this.s)*100}%, ${W(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Zt(t){return t=(t||0)%360,t<0?t+360:t}function W(t){return Math.max(0,Math.min(1,t||0))}function dt(t,n,i){return(t<60?n+(i-n)*t/60:t<180?i:t<240?n+(i-n)*(240-t)/60:n)*255}const Ct=t=>()=>t;function kn(t,n){return function(i){return t+i*n}}function Xe(t,n,i){return t=Math.pow(t,i),n=Math.pow(n,i)-t,i=1/i,function(e){return Math.pow(t+e*n,i)}}function vs(t,n){var i=n-t;return i?kn(t,i>180||i<-180?i-360*Math.round(i/360):i):Ct(isNaN(t)?n:t)}function De(t){return(t=+t)==1?$n:function(n,i){return i-n?Xe(n,i,t):Ct(isNaN(n)?i:n)}}function $n(t,n){var i=n-t;return i?kn(t,i):Ct(isNaN(t)?n:t)}const Qt=(function t(n){var i=De(n);function e(r,s){var o=i((r=gt(r)).r,(s=gt(s)).r),a=i(r.g,s.g),h=i(r.b,s.b),u=$n(r.opacity,s.opacity);return function(l){return r.r=o(l),r.g=a(l),r.b=h(l),r.opacity=u(l),r+""}}return e.gamma=t,e})(1);function T(t,n){return t=+t,n=+n,function(i){return t*(1-i)+n*i}}var mt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,yt=new RegExp(mt.source,"g");function ze(t){return function(){return t}}function Be(t){return function(n){return t(n)+""}}function Ye(t,n){var i=mt.lastIndex=yt.lastIndex=0,e,r,s,o=-1,a=[],h=[];for(t=t+"",n=n+"";(e=mt.exec(t))&&(r=yt.exec(n));)(s=r.index)>i&&(s=n.slice(i,s),a[o]?a[o]+=s:a[++o]=s),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,h.push({i:o,x:T(e,r)})),i=yt.lastIndex;return i<n.length&&(s=n.slice(i),a[o]?a[o]+=s:a[++o]=s),a.length<2?h[0]?Be(h[0].x):ze(n):(n=h.length,function(u){for(var l=0,c;l<n;++l)a[(c=h[l]).i]=c.x(u);return a.join("")})}var Wt=180/Math.PI,bt={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Tn(t,n,i,e,r,s){var o,a,h;return(o=Math.sqrt(t*t+n*n))&&(t/=o,n/=o),(h=t*i+n*e)&&(i-=t*h,e-=n*h),(a=Math.sqrt(i*i+e*e))&&(i/=a,e/=a,h/=a),t*e<n*i&&(t=-t,n=-n,h=-h,o=-o),{translateX:r,translateY:s,rotate:Math.atan2(n,t)*Wt,skewX:Math.atan(h)*Wt,scaleX:o,scaleY:a}}var J;function Ve(t){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return n.isIdentity?bt:Tn(n.a,n.b,n.c,n.d,n.e,n.f)}function Ue(t){return t==null||(J||(J=document.createElementNS("http://www.w3.org/2000/svg","g")),J.setAttribute("transform",t),!(t=J.transform.baseVal.consolidate()))?bt:(t=t.matrix,Tn(t.a,t.b,t.c,t.d,t.e,t.f))}function En(t,n,i,e){function r(u){return u.length?u.pop()+" ":""}function s(u,l,c,f,_,p){if(u!==c||l!==f){var x=_.push("translate(",null,n,null,i);p.push({i:x-4,x:T(u,c)},{i:x-2,x:T(l,f)})}else(c||f)&&_.push("translate("+c+n+f+i)}function o(u,l,c,f){u!==l?(u-l>180?l+=360:l-u>180&&(u+=360),f.push({i:c.push(r(c)+"rotate(",null,e)-2,x:T(u,l)})):l&&c.push(r(c)+"rotate("+l+e)}function a(u,l,c,f){u!==l?f.push({i:c.push(r(c)+"skewX(",null,e)-2,x:T(u,l)}):l&&c.push(r(c)+"skewX("+l+e)}function h(u,l,c,f,_,p){if(u!==c||l!==f){var x=_.push(r(_)+"scale(",null,",",null,")");p.push({i:x-4,x:T(u,c)},{i:x-2,x:T(l,f)})}else(c!==1||f!==1)&&_.push(r(_)+"scale("+c+","+f+")")}return function(u,l){var c=[],f=[];return u=t(u),l=t(l),s(u.translateX,u.translateY,l.translateX,l.translateY,c,f),o(u.rotate,l.rotate,c,f),a(u.skewX,l.skewX,c,f),h(u.scaleX,u.scaleY,l.scaleX,l.scaleY,c,f),u=l=null,function(_){for(var p=-1,x=f.length,b;++p<x;)c[(b=f[p]).i]=b.x(_);return c.join("")}}}var Ke=En(Ve,"px, ","px)","deg)"),Ge=En(Ue,", ",")",")"),O=0,z=0,D=0,Sn=1e3,st,B,ot=0,R=0,ft=0,K=typeof performance=="object"&&performance.now?performance:Date,An=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Rt(){return R||(An(Ze),R=K.now()+ft)}function Ze(){R=0}function at(){this._call=this._time=this._next=null}at.prototype=Mn.prototype={constructor:at,restart:function(t,n,i){if(typeof t!="function")throw new TypeError("callback is not a function");i=(i==null?Rt():+i)+(n==null?0:+n),!this._next&&B!==this&&(B?B._next=this:st=this,B=this),this._call=t,this._time=i,Nt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Nt())}};function Mn(t,n,i){var e=new at;return e.restart(t,n,i),e}function Qe(){Rt(),++O;for(var t=st,n;t;)(n=R-t._time)>=0&&t._call.call(void 0,n),t=t._next;--O}function Jt(){R=(ot=K.now())+ft,O=z=0;try{Qe()}finally{O=0,Je(),R=0}}function We(){var t=K.now(),n=t-ot;n>Sn&&(ft-=n,ot=t)}function Je(){for(var t,n=st,i,e=1/0;n;)n._call?(e>n._time&&(e=n._time),t=n,n=n._next):(i=n._next,n._next=null,n=t?t._next=i:st=i);B=t,Nt(e)}function Nt(t){if(!O){z&&(z=clearTimeout(z));var n=t-R;n>24?(t<1/0&&(z=setTimeout(Jt,t-K.now()-ft)),D&&(D=clearInterval(D))):(D||(ot=K.now(),D=setInterval(We,Sn)),O=1,An(Jt))}}function jt(t,n,i){var e=new at;return n=n==null?0:+n,e.restart(r=>{e.stop(),t(r+n)},n,i),e}var je=mn("start","end","cancel","interrupt"),tr=[],Cn=0,tn=1,kt=2,tt=3,nn=4,$t=5,nt=6;function _t(t,n,i,e,r,s){var o=t.__transition;if(!o)t.__transition={};else if(i in o)return;nr(t,i,{name:n,index:e,group:r,on:je,tween:tr,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Cn})}function Pt(t,n){var i=v(t,n);if(i.state>Cn)throw new Error("too late; already scheduled");return i}function m(t,n){var i=v(t,n);if(i.state>tt)throw new Error("too late; already running");return i}function v(t,n){var i=t.__transition;if(!i||!(i=i[n]))throw new Error("transition not found");return i}function nr(t,n,i){var e=t.__transition,r;e[n]=i,i.timer=Mn(s,0,i.time);function s(u){i.state=tn,i.timer.restart(o,i.delay,i.time),i.delay<=u&&o(u-i.delay)}function o(u){var l,c,f,_;if(i.state!==tn)return h();for(l in e)if(_=e[l],_.name===i.name){if(_.state===tt)return jt(o);_.state===nn?(_.state=nt,_.timer.stop(),_.on.call("interrupt",t,t.__data__,_.index,_.group),delete e[l]):+l<n&&(_.state=nt,_.timer.stop(),_.on.call("cancel",t,t.__data__,_.index,_.group),delete e[l])}if(jt(function(){i.state===tt&&(i.state=nn,i.timer.restart(a,i.delay,i.time),a(u))}),i.state=kt,i.on.call("start",t,t.__data__,i.index,i.group),i.state===kt){for(i.state=tt,r=new Array(f=i.tween.length),l=0,c=-1;l<f;++l)(_=i.tween[l].value.call(t,t.__data__,i.index,i.group))&&(r[++c]=_);r.length=c+1}}function a(u){for(var l=u<i.duration?i.ease.call(null,u/i.duration):(i.timer.restart(h),i.state=$t,1),c=-1,f=r.length;++c<f;)r[c].call(t,l);i.state===$t&&(i.on.call("end",t,t.__data__,i.index,i.group),h())}function h(){i.state=nt,i.timer.stop(),delete e[n];for(var u in e)return;delete t.__transition}}function ir(t,n){var i=t.__transition,e,r,s=!0,o;if(i){n=n==null?null:n+"";for(o in i){if((e=i[o]).name!==n){s=!1;continue}r=e.state>kt&&e.state<$t,e.state=nt,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete i[o]}s&&delete t.__transition}}function er(t){return this.each(function(){ir(this,t)})}function rr(t,n){var i,e;return function(){var r=m(this,t),s=r.tween;if(s!==i){e=i=s;for(var o=0,a=e.length;o<a;++o)if(e[o].name===n){e=e.slice(),e.splice(o,1);break}}r.tween=e}}function sr(t,n,i){var e,r;if(typeof i!="function")throw new Error;return function(){var s=m(this,t),o=s.tween;if(o!==e){r=(e=o).slice();for(var a={name:n,value:i},h=0,u=r.length;h<u;++h)if(r[h].name===n){r[h]=a;break}h===u&&r.push(a)}s.tween=r}}function or(t,n){var i=this._id;if(t+="",arguments.length<2){for(var e=v(this.node(),i).tween,r=0,s=e.length,o;r<s;++r)if((o=e[r]).name===t)return o.value;return null}return this.each((n==null?rr:sr)(i,t,n))}function It(t,n,i){var e=t._id;return t.each(function(){var r=m(this,e);(r.value||(r.value={}))[n]=i.apply(this,arguments)}),function(r){return v(r,e).value[n]}}function Rn(t,n){var i;return(typeof n=="number"?T:n instanceof U?Qt:(i=U(n))?(n=i,Qt):Ye)(t,n)}function ar(t){return function(){this.removeAttribute(t)}}function hr(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ur(t,n,i){var e,r=i+"",s;return function(){var o=this.getAttribute(t);return o===r?null:o===e?s:s=n(e=o,i)}}function lr(t,n,i){var e,r=i+"",s;return function(){var o=this.getAttributeNS(t.space,t.local);return o===r?null:o===e?s:s=n(e=o,i)}}function cr(t,n,i){var e,r,s;return function(){var o,a=i(this),h;return a==null?void this.removeAttribute(t):(o=this.getAttribute(t),h=a+"",o===h?null:o===e&&h===r?s:(r=h,s=n(e=o,a)))}}function fr(t,n,i){var e,r,s;return function(){var o,a=i(this),h;return a==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),h=a+"",o===h?null:o===e&&h===r?s:(r=h,s=n(e=o,a)))}}function _r(t,n){var i=ct(t),e=i==="transform"?Ge:Rn;return this.attrTween(t,typeof n=="function"?(i.local?fr:cr)(i,e,It(this,"attr."+t,n)):n==null?(i.local?hr:ar)(i):(i.local?lr:ur)(i,e,n))}function pr(t,n){return function(i){this.setAttribute(t,n.call(this,i))}}function xr(t,n){return function(i){this.setAttributeNS(t.space,t.local,n.call(this,i))}}function dr(t,n){var i,e;function r(){var s=n.apply(this,arguments);return s!==e&&(i=(e=s)&&xr(t,s)),i}return r._value=n,r}function yr(t,n){var i,e;function r(){var s=n.apply(this,arguments);return s!==e&&(i=(e=s)&&pr(t,s)),i}return r._value=n,r}function wr(t,n){var i="attr."+t;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;var e=ct(t);return this.tween(i,(e.local?dr:yr)(e,n))}function vr(t,n){return function(){Pt(this,t).delay=+n.apply(this,arguments)}}function gr(t,n){return n=+n,function(){Pt(this,t).delay=n}}function mr(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?vr:gr)(n,t)):v(this.node(),n).delay}function br(t,n){return function(){m(this,t).duration=+n.apply(this,arguments)}}function Nr(t,n){return n=+n,function(){m(this,t).duration=n}}function kr(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?br:Nr)(n,t)):v(this.node(),n).duration}function $r(t,n){if(typeof n!="function")throw new Error;return function(){m(this,t).ease=n}}function Tr(t){var n=this._id;return arguments.length?this.each($r(n,t)):v(this.node(),n).ease}function Er(t,n){return function(){var i=n.apply(this,arguments);if(typeof i!="function")throw new Error;m(this,t).ease=i}}function Sr(t){if(typeof t!="function")throw new Error;return this.each(Er(this._id,t))}function Ar(t){typeof t!="function"&&(t=cn(t));for(var n=this._groups,i=n.length,e=new Array(i),r=0;r<i;++r)for(var s=n[r],o=s.length,a=e[r]=[],h,u=0;u<o;++u)(h=s[u])&&t.call(h,h.__data__,u,s)&&a.push(h);return new k(e,this._parents,this._name,this._id)}function Mr(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,i=t._groups,e=n.length,r=i.length,s=Math.min(e,r),o=new Array(e),a=0;a<s;++a)for(var h=n[a],u=i[a],l=h.length,c=o[a]=new Array(l),f,_=0;_<l;++_)(f=h[_]||u[_])&&(c[_]=f);for(;a<e;++a)o[a]=n[a];return new k(o,this._parents,this._name,this._id)}function Cr(t){return(t+"").trim().split(/^|\s+/).every(function(n){var i=n.indexOf(".");return i>=0&&(n=n.slice(0,i)),!n||n==="start"})}function Rr(t,n,i){var e,r,s=Cr(n)?Pt:m;return function(){var o=s(this,t),a=o.on;a!==e&&(r=(e=a).copy()).on(n,i),o.on=r}}function Pr(t,n){var i=this._id;return arguments.length<2?v(this.node(),i).on.on(t):this.each(Rr(i,t,n))}function Ir(t){return function(){var n=this.parentNode;for(var i in this.__transition)if(+i!==t)return;n&&n.removeChild(this)}}function qr(){return this.on("end.remove",Ir(this._id))}function Fr(t){var n=this._name,i=this._id;typeof t!="function"&&(t=St(t));for(var e=this._groups,r=e.length,s=new Array(r),o=0;o<r;++o)for(var a=e[o],h=a.length,u=s[o]=new Array(h),l,c,f=0;f<h;++f)(l=a[f])&&(c=t.call(l,l.__data__,f,a))&&("__data__"in l&&(c.__data__=l.__data__),u[f]=c,_t(u[f],n,i,f,u,v(l,i)));return new k(s,this._parents,n,i)}function Lr(t){var n=this._name,i=this._id;typeof t!="function"&&(t=ln(t));for(var e=this._groups,r=e.length,s=[],o=[],a=0;a<r;++a)for(var h=e[a],u=h.length,l,c=0;c<u;++c)if(l=h[c]){for(var f=t.call(l,l.__data__,c,h),_,p=v(l,i),x=0,b=f.length;x<b;++x)(_=f[x])&&_t(_,n,i,x,f,p);s.push(f),o.push(l)}return new k(s,o,n,i)}var Or=H.prototype.constructor;function Hr(){return new Or(this._groups,this._parents)}function Xr(t,n){var i,e,r;return function(){var s=L(this,t),o=(this.style.removeProperty(t),L(this,t));return s===o?null:s===i&&o===e?r:r=n(i=s,e=o)}}function Pn(t){return function(){this.style.removeProperty(t)}}function Dr(t,n,i){var e,r=i+"",s;return function(){var o=L(this,t);return o===r?null:o===e?s:s=n(e=o,i)}}function zr(t,n,i){var e,r,s;return function(){var o=L(this,t),a=i(this),h=a+"";return a==null&&(h=a=(this.style.removeProperty(t),L(this,t))),o===h?null:o===e&&h===r?s:(r=h,s=n(e=o,a))}}function Br(t,n){var i,e,r,s="style."+n,o="end."+s,a;return function(){var h=m(this,t),u=h.on,l=h.value[s]==null?a||(a=Pn(n)):void 0;(u!==i||r!==l)&&(e=(i=u).copy()).on(o,r=l),h.on=e}}function Yr(t,n,i){var e=(t+="")=="transform"?Ke:Rn;return n==null?this.styleTween(t,Xr(t,e)).on("end.style."+t,Pn(t)):typeof n=="function"?this.styleTween(t,zr(t,e,It(this,"style."+t,n))).each(Br(this._id,t)):this.styleTween(t,Dr(t,e,n),i).on("end.style."+t,null)}function Vr(t,n,i){return function(e){this.style.setProperty(t,n.call(this,e),i)}}function Ur(t,n,i){var e,r;function s(){var o=n.apply(this,arguments);return o!==r&&(e=(r=o)&&Vr(t,o,i)),e}return s._value=n,s}function Kr(t,n,i){var e="style."+(t+="");if(arguments.length<2)return(e=this.tween(e))&&e._value;if(n==null)return this.tween(e,null);if(typeof n!="function")throw new Error;return this.tween(e,Ur(t,n,i??""))}function Gr(t){return function(){this.textContent=t}}function Zr(t){return function(){var n=t(this);this.textContent=n??""}}function Qr(t){return this.tween("text",typeof t=="function"?Zr(It(this,"text",t)):Gr(t==null?"":t+""))}function Wr(t){return function(n){this.textContent=t.call(this,n)}}function Jr(t){var n,i;function e(){var r=t.apply(this,arguments);return r!==i&&(n=(i=r)&&Wr(r)),n}return e._value=t,e}function jr(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,Jr(t))}function ts(){for(var t=this._name,n=this._id,i=In(),e=this._groups,r=e.length,s=0;s<r;++s)for(var o=e[s],a=o.length,h,u=0;u<a;++u)if(h=o[u]){var l=v(h,n);_t(h,t,i,u,o,{time:l.time+l.delay+l.duration,delay:0,duration:l.duration,ease:l.ease})}return new k(e,this._parents,t,i)}function ns(){var t,n,i=this,e=i._id,r=i.size();return new Promise(function(s,o){var a={value:o},h={value:function(){--r===0&&s()}};i.each(function(){var u=m(this,e),l=u.on;l!==t&&(n=(t=l).copy(),n._.cancel.push(a),n._.interrupt.push(a),n._.end.push(h)),u.on=n}),r===0&&s()})}var is=0;function k(t,n,i,e){this._groups=t,this._parents=n,this._name=i,this._id=e}function es(t){return H().transition(t)}function In(){return++is}var N=H.prototype;k.prototype=es.prototype={constructor:k,select:Fr,selectAll:Lr,selectChild:N.selectChild,selectChildren:N.selectChildren,filter:Ar,merge:Mr,selection:Hr,transition:ts,call:N.call,nodes:N.nodes,node:N.node,size:N.size,empty:N.empty,each:N.each,on:Pr,attr:_r,attrTween:wr,style:Yr,styleTween:Kr,text:Qr,textTween:jr,remove:qr,tween:or,delay:mr,duration:kr,ease:Tr,easeVarying:Sr,end:ns,[Symbol.iterator]:N[Symbol.iterator]};function rs(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var ss={time:null,delay:0,duration:250,ease:rs};function os(t,n){for(var i;!(i=t.__transition)||!(i=i[n]);)if(!(t=t.parentNode))throw new Error(`transition ${n} not found`);return i}function as(t){var n,i;t instanceof k?(n=t._id,t=t._name):(n=In(),(i=ss).time=Rt(),t=t==null?null:t+"");for(var e=this._groups,r=e.length,s=0;s<r;++s)for(var o=e[s],a=o.length,h,u=0;u<a;++u)(h=o[u])&&_t(h,t,n,u,o,i||os(h,n));return new k(e,this._parents,t,n)}H.prototype.interrupt=er;H.prototype.transition=as;function I(t){return function(){return t}}const gs=Math.abs,ms=Math.atan2,bs=Math.cos,Ns=Math.max,ks=Math.min,$s=Math.sin,Ts=Math.sqrt,en=1e-12,qt=Math.PI,rn=qt/2,Es=2*qt;function Ss(t){return t>1?0:t<-1?qt:Math.acos(t)}function As(t){return t>=1?rn:t<=-1?-rn:Math.asin(t)}const Tt=Math.PI,Et=2*Tt,A=1e-6,hs=Et-A;function qn(t){this._+=t[0];for(let n=1,i=t.length;n<i;++n)this._+=arguments[n]+t[n]}function us(t){let n=Math.floor(t);if(!(n>=0))throw new Error(`invalid digits: ${t}`);if(n>15)return qn;const i=10**n;return function(e){this._+=e[0];for(let r=1,s=e.length;r<s;++r)this._+=Math.round(arguments[r]*i)/i+e[r]}}class ls{constructor(n){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=n==null?qn:us(n)}moveTo(n,i){this._append`M${this._x0=this._x1=+n},${this._y0=this._y1=+i}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(n,i){this._append`L${this._x1=+n},${this._y1=+i}`}quadraticCurveTo(n,i,e,r){this._append`Q${+n},${+i},${this._x1=+e},${this._y1=+r}`}bezierCurveTo(n,i,e,r,s,o){this._append`C${+n},${+i},${+e},${+r},${this._x1=+s},${this._y1=+o}`}arcTo(n,i,e,r,s){if(n=+n,i=+i,e=+e,r=+r,s=+s,s<0)throw new Error(`negative radius: ${s}`);let o=this._x1,a=this._y1,h=e-n,u=r-i,l=o-n,c=a-i,f=l*l+c*c;if(this._x1===null)this._append`M${this._x1=n},${this._y1=i}`;else if(f>A)if(!(Math.abs(c*h-u*l)>A)||!s)this._append`L${this._x1=n},${this._y1=i}`;else{let _=e-o,p=r-a,x=h*h+u*u,b=_*_+p*p,Z=Math.sqrt(x),$=Math.sqrt(f),S=s*Math.tan((Tt-Math.acos((x+f-b)/(2*Z*$)))/2),P=S/$,X=S/Z;Math.abs(P-1)>A&&this._append`L${n+P*l},${i+P*c}`,this._append`A${s},${s},0,0,${+(c*_>l*p)},${this._x1=n+X*h},${this._y1=i+X*u}`}}arc(n,i,e,r,s,o){if(n=+n,i=+i,e=+e,o=!!o,e<0)throw new Error(`negative radius: ${e}`);let a=e*Math.cos(r),h=e*Math.sin(r),u=n+a,l=i+h,c=1^o,f=o?r-s:s-r;this._x1===null?this._append`M${u},${l}`:(Math.abs(this._x1-u)>A||Math.abs(this._y1-l)>A)&&this._append`L${u},${l}`,e&&(f<0&&(f=f%Et+Et),f>hs?this._append`A${e},${e},0,1,${c},${n-a},${i-h}A${e},${e},0,1,${c},${this._x1=u},${this._y1=l}`:f>A&&this._append`A${e},${e},0,${+(f>=Tt)},${c},${this._x1=n+e*Math.cos(s)},${this._y1=i+e*Math.sin(s)}`)}rect(n,i,e,r){this._append`M${this._x0=this._x1=+n},${this._y0=this._y1=+i}h${e=+e}v${+r}h${-e}Z`}toString(){return this._}}function cs(t){let n=3;return t.digits=function(i){if(!arguments.length)return n;if(i==null)n=null;else{const e=Math.floor(i);if(!(e>=0))throw new RangeError(`invalid digits: ${i}`);n=e}return t},()=>new ls(n)}function fs(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Fn(t){this._context=t}Fn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n);break}}};function _s(t){return new Fn(t)}function ps(t){return t[0]}function xs(t){return t[1]}function Ms(t,n){var i=I(!0),e=null,r=_s,s=null,o=cs(a);t=typeof t=="function"?t:t===void 0?ps:I(t),n=typeof n=="function"?n:n===void 0?xs:I(n);function a(h){var u,l=(h=fs(h)).length,c,f=!1,_;for(e==null&&(s=r(_=o())),u=0;u<=l;++u)!(u<l&&i(c=h[u],u,h))===f&&((f=!f)?s.lineStart():s.lineEnd()),f&&s.point(+t(c,u,h),+n(c,u,h));if(_)return s=null,_+""||null}return a.x=function(h){return arguments.length?(t=typeof h=="function"?h:I(+h),a):t},a.y=function(h){return arguments.length?(n=typeof h=="function"?h:I(+h),a):n},a.defined=function(h){return arguments.length?(i=typeof h=="function"?h:I(!!h),a):i},a.curve=function(h){return arguments.length?(r=h,e!=null&&(s=r(e)),a):r},a.context=function(h){return arguments.length?(h==null?e=s=null:s=r(e=h),a):e},a}function E(){}function ht(t,n,i){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+i)/6)}function pt(t){this._context=t}pt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ht(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ht(this,t,n);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};function Cs(t){return new pt(t)}function Ln(t){this._context=t}Ln.prototype={areaStart:E,areaEnd:E,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:ht(this,t,n);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};function Rs(t){return new Ln(t)}function On(t){this._context=t}On.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var i=(this._x0+4*this._x1+t)/6,e=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(i,e):this._context.moveTo(i,e);break;case 3:this._point=4;default:ht(this,t,n);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};function Ps(t){return new On(t)}function Hn(t,n){this._basis=new pt(t),this._beta=n}Hn.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,i=t.length-1;if(i>0)for(var e=t[0],r=n[0],s=t[i]-e,o=n[i]-r,a=-1,h;++a<=i;)h=a/i,this._basis.point(this._beta*t[a]+(1-this._beta)*(e+h*s),this._beta*n[a]+(1-this._beta)*(r+h*o));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};const Is=(function t(n){function i(e){return n===1?new pt(e):new Hn(e,n)}return i.beta=function(e){return t(+e)},i})(.85);function ut(t,n,i){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-i),t._x2,t._y2)}function Ft(t,n){this._context=t,this._k=(1-n)/6}Ft.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ut(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:ut(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};const qs=(function t(n){function i(e){return new Ft(e,n)}return i.tension=function(e){return t(+e)},i})(0);function Lt(t,n){this._context=t,this._k=(1-n)/6}Lt.prototype={areaStart:E,areaEnd:E,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:ut(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};const Fs=(function t(n){function i(e){return new Lt(e,n)}return i.tension=function(e){return t(+e)},i})(0);function Ot(t,n){this._context=t,this._k=(1-n)/6}Ot.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ut(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};const Ls=(function t(n){function i(e){return new Ot(e,n)}return i.tension=function(e){return t(+e)},i})(0);function Ht(t,n,i){var e=t._x1,r=t._y1,s=t._x2,o=t._y2;if(t._l01_a>en){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,h=3*t._l01_a*(t._l01_a+t._l12_a);e=(e*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/h,r=(r*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/h}if(t._l23_a>en){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);s=(s*u+t._x1*t._l23_2a-n*t._l12_2a)/l,o=(o*u+t._y1*t._l23_2a-i*t._l12_2a)/l}t._context.bezierCurveTo(e,r,s,o,t._x2,t._y2)}function Xn(t,n){this._context=t,this._alpha=n}Xn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var i=this._x2-t,e=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+e*e,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:Ht(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};const Os=(function t(n){function i(e){return n?new Xn(e,n):new Ft(e,0)}return i.alpha=function(e){return t(+e)},i})(.5);function Dn(t,n){this._context=t,this._alpha=n}Dn.prototype={areaStart:E,areaEnd:E,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,n){if(t=+t,n=+n,this._point){var i=this._x2-t,e=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+e*e,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Ht(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};const Hs=(function t(n){function i(e){return n?new Dn(e,n):new Lt(e,0)}return i.alpha=function(e){return t(+e)},i})(.5);function zn(t,n){this._context=t,this._alpha=n}zn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var i=this._x2-t,e=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+e*e,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ht(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};const Xs=(function t(n){function i(e){return n?new zn(e,n):new Ot(e,0)}return i.alpha=function(e){return t(+e)},i})(.5);function Bn(t){this._context=t}Bn.prototype={areaStart:E,areaEnd:E,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,n){t=+t,n=+n,this._point?this._context.lineTo(t,n):(this._point=1,this._context.moveTo(t,n))}};function Ds(t){return new Bn(t)}function sn(t){return t<0?-1:1}function on(t,n,i){var e=t._x1-t._x0,r=n-t._x1,s=(t._y1-t._y0)/(e||r<0&&-0),o=(i-t._y1)/(r||e<0&&-0),a=(s*r+o*e)/(e+r);return(sn(s)+sn(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function an(t,n){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-n)/2:n}function wt(t,n,i){var e=t._x0,r=t._y0,s=t._x1,o=t._y1,a=(s-e)/3;t._context.bezierCurveTo(e+a,r+a*n,s-a,o-a*i,s,o)}function lt(t){this._context=t}lt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:wt(this,this._t0,an(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){var i=NaN;if(t=+t,n=+n,!(t===this._x1&&n===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,wt(this,an(this,i=on(this,t,n)),i);break;default:wt(this,this._t0,i=on(this,t,n));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n,this._t0=i}}};function Yn(t){this._context=new Vn(t)}(Yn.prototype=Object.create(lt.prototype)).point=function(t,n){lt.prototype.point.call(this,n,t)};function Vn(t){this._context=t}Vn.prototype={moveTo:function(t,n){this._context.moveTo(n,t)},closePath:function(){this._context.closePath()},lineTo:function(t,n){this._context.lineTo(n,t)},bezierCurveTo:function(t,n,i,e,r,s){this._context.bezierCurveTo(n,t,e,i,s,r)}};function zs(t){return new lt(t)}function Bs(t){return new Yn(t)}function Un(t){this._context=t}Un.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,n=this._y,i=t.length;if(i)if(this._line?this._context.lineTo(t[0],n[0]):this._context.moveTo(t[0],n[0]),i===2)this._context.lineTo(t[1],n[1]);else for(var e=hn(t),r=hn(n),s=0,o=1;o<i;++s,++o)this._context.bezierCurveTo(e[0][s],r[0][s],e[1][s],r[1][s],t[o],n[o]);(this._line||this._line!==0&&i===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,n){this._x.push(+t),this._y.push(+n)}};function hn(t){var n,i=t.length-1,e,r=new Array(i),s=new Array(i),o=new Array(i);for(r[0]=0,s[0]=2,o[0]=t[0]+2*t[1],n=1;n<i-1;++n)r[n]=1,s[n]=4,o[n]=4*t[n]+2*t[n+1];for(r[i-1]=2,s[i-1]=7,o[i-1]=8*t[i-1]+t[i],n=1;n<i;++n)e=r[n]/s[n-1],s[n]-=e,o[n]-=e*o[n-1];for(r[i-1]=o[i-1]/s[i-1],n=i-2;n>=0;--n)r[n]=(o[n]-r[n+1])/s[n];for(s[i-1]=(t[i]+r[i-1])/2,n=0;n<i-1;++n)s[n]=2*t[n+1]-r[n+1];return[r,s]}function Ys(t){return new Un(t)}function xt(t,n){this._context=t,this._t=n}xt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var i=this._x*(1-this._t)+t*this._t;this._context.lineTo(i,this._y),this._context.lineTo(i,n)}break}}this._x=t,this._y=n}};function Vs(t){return new xt(t,.5)}function Us(t){return new xt(t,0)}function Ks(t){return new xt(t,1)}function q(t,n,i){this.k=t,this.x=n,this.y=i}q.prototype={constructor:q,scale:function(t){return t===1?this:new q(this.k*t,this.x,this.y)},translate:function(t,n){return t===0&n===0?this:new q(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ds=new q(1,0,0);ys.prototype=q.prototype;function ys(t){for(;!t.__zoom;)if(!(t=t.parentNode))return ds;return t.__zoom}export{qs as $,bn as A,$n as B,G as C,vs as D,gn as E,Wn as F,mn as G,ir as H,Xt as I,es as J,_s as K,ps as L,xs as M,Us as N,Ks as O,Vs as P,Ds as Q,d as R,y as S,Ys as T,Bs as U,zs as V,Xs as W,Hs as X,Os as Y,Ls as Z,Fs as _,I as a,Is as a0,Ps as a1,Rs as a2,ds as a3,q as a4,ys as a5,Ts as b,bs as c,gs as d,en as e,ms as f,Ns as g,rn as h,As as i,Ss as j,ws as k,Ms as l,ks as m,Cs as n,fs as o,qt as p,Ct as q,T as r,$s as s,Es as t,U as u,Qt as v,cs as w,Ye as x,Le as y,Mt as z};
1
+ var vt="http://www.w3.org/1999/xhtml";const Xt={svg:"http://www.w3.org/2000/svg",xhtml:vt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ct(t){var n=t+="",i=n.indexOf(":");return i>=0&&(n=t.slice(0,i))!=="xmlns"&&(t=t.slice(i+1)),Xt.hasOwnProperty(n)?{space:Xt[n],local:t}:t}function Kn(t){return function(){var n=this.ownerDocument,i=this.namespaceURI;return i===vt&&n.documentElement.namespaceURI===vt?n.createElement(t):n.createElementNS(i,t)}}function Gn(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function un(t){var n=ct(t);return(n.local?Gn:Kn)(n)}function Zn(){}function St(t){return t==null?Zn:function(){return this.querySelector(t)}}function Qn(t){typeof t!="function"&&(t=St(t));for(var n=this._groups,i=n.length,e=new Array(i),r=0;r<i;++r)for(var s=n[r],o=s.length,a=e[r]=new Array(o),h,u,l=0;l<o;++l)(h=s[l])&&(u=t.call(h,h.__data__,l,s))&&("__data__"in h&&(u.__data__=h.__data__),a[l]=u);return new y(e,this._parents)}function Wn(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Jn(){return[]}function ln(t){return t==null?Jn:function(){return this.querySelectorAll(t)}}function jn(t){return function(){return Wn(t.apply(this,arguments))}}function ti(t){typeof t=="function"?t=jn(t):t=ln(t);for(var n=this._groups,i=n.length,e=[],r=[],s=0;s<i;++s)for(var o=n[s],a=o.length,h,u=0;u<a;++u)(h=o[u])&&(e.push(t.call(h,h.__data__,u,o)),r.push(h));return new y(e,r)}function cn(t){return function(){return this.matches(t)}}function fn(t){return function(n){return n.matches(t)}}var ni=Array.prototype.find;function ii(t){return function(){return ni.call(this.children,t)}}function ei(){return this.firstElementChild}function ri(t){return this.select(t==null?ei:ii(typeof t=="function"?t:fn(t)))}var si=Array.prototype.filter;function oi(){return Array.from(this.children)}function ai(t){return function(){return si.call(this.children,t)}}function hi(t){return this.selectAll(t==null?oi:ai(typeof t=="function"?t:fn(t)))}function ui(t){typeof t!="function"&&(t=cn(t));for(var n=this._groups,i=n.length,e=new Array(i),r=0;r<i;++r)for(var s=n[r],o=s.length,a=e[r]=[],h,u=0;u<o;++u)(h=s[u])&&t.call(h,h.__data__,u,s)&&a.push(h);return new y(e,this._parents)}function _n(t){return new Array(t.length)}function li(){return new y(this._enter||this._groups.map(_n),this._parents)}function it(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}it.prototype={constructor:it,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function ci(t){return function(){return t}}function fi(t,n,i,e,r,s){for(var o=0,a,h=n.length,u=s.length;o<u;++o)(a=n[o])?(a.__data__=s[o],e[o]=a):i[o]=new it(t,s[o]);for(;o<h;++o)(a=n[o])&&(r[o]=a)}function _i(t,n,i,e,r,s,o){var a,h,u=new Map,l=n.length,c=s.length,f=new Array(l),_;for(a=0;a<l;++a)(h=n[a])&&(f[a]=_=o.call(h,h.__data__,a,n)+"",u.has(_)?r[a]=h:u.set(_,h));for(a=0;a<c;++a)_=o.call(t,s[a],a,s)+"",(h=u.get(_))?(e[a]=h,h.__data__=s[a],u.delete(_)):i[a]=new it(t,s[a]);for(a=0;a<l;++a)(h=n[a])&&u.get(f[a])===h&&(r[a]=h)}function pi(t){return t.__data__}function xi(t,n){if(!arguments.length)return Array.from(this,pi);var i=n?_i:fi,e=this._parents,r=this._groups;typeof t!="function"&&(t=ci(t));for(var s=r.length,o=new Array(s),a=new Array(s),h=new Array(s),u=0;u<s;++u){var l=e[u],c=r[u],f=c.length,_=di(t.call(l,l&&l.__data__,u,e)),p=_.length,x=a[u]=new Array(p),b=o[u]=new Array(p),Z=h[u]=new Array(f);i(l,c,x,b,Z,_,n);for(var $=0,S=0,P,X;$<p;++$)if(P=x[$]){for($>=S&&(S=$+1);!(X=b[S])&&++S<p;);P._next=X||null}}return o=new y(o,e),o._enter=a,o._exit=h,o}function di(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function yi(){return new y(this._exit||this._groups.map(_n),this._parents)}function wi(t,n,i){var e=this.enter(),r=this,s=this.exit();return typeof t=="function"?(e=t(e),e&&(e=e.selection())):e=e.append(t+""),n!=null&&(r=n(r),r&&(r=r.selection())),i==null?s.remove():i(s),e&&r?e.merge(r).order():r}function vi(t){for(var n=t.selection?t.selection():t,i=this._groups,e=n._groups,r=i.length,s=e.length,o=Math.min(r,s),a=new Array(r),h=0;h<o;++h)for(var u=i[h],l=e[h],c=u.length,f=a[h]=new Array(c),_,p=0;p<c;++p)(_=u[p]||l[p])&&(f[p]=_);for(;h<r;++h)a[h]=i[h];return new y(a,this._parents)}function gi(){for(var t=this._groups,n=-1,i=t.length;++n<i;)for(var e=t[n],r=e.length-1,s=e[r],o;--r>=0;)(o=e[r])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function mi(t){t||(t=bi);function n(c,f){return c&&f?t(c.__data__,f.__data__):!c-!f}for(var i=this._groups,e=i.length,r=new Array(e),s=0;s<e;++s){for(var o=i[s],a=o.length,h=r[s]=new Array(a),u,l=0;l<a;++l)(u=o[l])&&(h[l]=u);h.sort(n)}return new y(r,this._parents).order()}function bi(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function Ni(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function ki(){return Array.from(this)}function $i(){for(var t=this._groups,n=0,i=t.length;n<i;++n)for(var e=t[n],r=0,s=e.length;r<s;++r){var o=e[r];if(o)return o}return null}function Ti(){let t=0;for(const n of this)++t;return t}function Ei(){return!this.node()}function Si(t){for(var n=this._groups,i=0,e=n.length;i<e;++i)for(var r=n[i],s=0,o=r.length,a;s<o;++s)(a=r[s])&&t.call(a,a.__data__,s,r);return this}function Ai(t){return function(){this.removeAttribute(t)}}function Mi(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ci(t,n){return function(){this.setAttribute(t,n)}}function Ri(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function Pi(t,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttribute(t):this.setAttribute(t,i)}}function Ii(t,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,i)}}function qi(t,n){var i=ct(t);if(arguments.length<2){var e=this.node();return i.local?e.getAttributeNS(i.space,i.local):e.getAttribute(i)}return this.each((n==null?i.local?Mi:Ai:typeof n=="function"?i.local?Ii:Pi:i.local?Ri:Ci)(i,n))}function pn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Fi(t){return function(){this.style.removeProperty(t)}}function Li(t,n,i){return function(){this.style.setProperty(t,n,i)}}function Oi(t,n,i){return function(){var e=n.apply(this,arguments);e==null?this.style.removeProperty(t):this.style.setProperty(t,e,i)}}function Hi(t,n,i){return arguments.length>1?this.each((n==null?Fi:typeof n=="function"?Oi:Li)(t,n,i??"")):L(this.node(),t)}function L(t,n){return t.style.getPropertyValue(n)||pn(t).getComputedStyle(t,null).getPropertyValue(n)}function Xi(t){return function(){delete this[t]}}function Di(t,n){return function(){this[t]=n}}function zi(t,n){return function(){var i=n.apply(this,arguments);i==null?delete this[t]:this[t]=i}}function Bi(t,n){return arguments.length>1?this.each((n==null?Xi:typeof n=="function"?zi:Di)(t,n)):this.node()[t]}function xn(t){return t.trim().split(/^|\s+/)}function At(t){return t.classList||new dn(t)}function dn(t){this._node=t,this._names=xn(t.getAttribute("class")||"")}dn.prototype={add:function(t){var n=this._names.indexOf(t);n<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function yn(t,n){for(var i=At(t),e=-1,r=n.length;++e<r;)i.add(n[e])}function wn(t,n){for(var i=At(t),e=-1,r=n.length;++e<r;)i.remove(n[e])}function Yi(t){return function(){yn(this,t)}}function Vi(t){return function(){wn(this,t)}}function Ui(t,n){return function(){(n.apply(this,arguments)?yn:wn)(this,t)}}function Ki(t,n){var i=xn(t+"");if(arguments.length<2){for(var e=At(this.node()),r=-1,s=i.length;++r<s;)if(!e.contains(i[r]))return!1;return!0}return this.each((typeof n=="function"?Ui:n?Yi:Vi)(i,n))}function Gi(){this.textContent=""}function Zi(t){return function(){this.textContent=t}}function Qi(t){return function(){var n=t.apply(this,arguments);this.textContent=n??""}}function Wi(t){return arguments.length?this.each(t==null?Gi:(typeof t=="function"?Qi:Zi)(t)):this.node().textContent}function Ji(){this.innerHTML=""}function ji(t){return function(){this.innerHTML=t}}function te(t){return function(){var n=t.apply(this,arguments);this.innerHTML=n??""}}function ne(t){return arguments.length?this.each(t==null?Ji:(typeof t=="function"?te:ji)(t)):this.node().innerHTML}function ie(){this.nextSibling&&this.parentNode.appendChild(this)}function ee(){return this.each(ie)}function re(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function se(){return this.each(re)}function oe(t){var n=typeof t=="function"?t:un(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function ae(){return null}function he(t,n){var i=typeof t=="function"?t:un(t),e=n==null?ae:typeof n=="function"?n:St(n);return this.select(function(){return this.insertBefore(i.apply(this,arguments),e.apply(this,arguments)||null)})}function ue(){var t=this.parentNode;t&&t.removeChild(this)}function le(){return this.each(ue)}function ce(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function fe(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function _e(t){return this.select(t?fe:ce)}function pe(t){return arguments.length?this.property("__data__",t):this.node().__data__}function xe(t){return function(n){t.call(this,n,this.__data__)}}function de(t){return t.trim().split(/^|\s+/).map(function(n){var i="",e=n.indexOf(".");return e>=0&&(i=n.slice(e+1),n=n.slice(0,e)),{type:n,name:i}})}function ye(t){return function(){var n=this.__on;if(n){for(var i=0,e=-1,r=n.length,s;i<r;++i)s=n[i],(!t.type||s.type===t.type)&&s.name===t.name?this.removeEventListener(s.type,s.listener,s.options):n[++e]=s;++e?n.length=e:delete this.__on}}}function we(t,n,i){return function(){var e=this.__on,r,s=xe(n);if(e){for(var o=0,a=e.length;o<a;++o)if((r=e[o]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=s,r.options=i),r.value=n;return}}this.addEventListener(t.type,s,i),r={type:t.type,name:t.name,value:n,listener:s,options:i},e?e.push(r):this.__on=[r]}}function ve(t,n,i){var e=de(t+""),r,s=e.length,o;if(arguments.length<2){var a=this.node().__on;if(a){for(var h=0,u=a.length,l;h<u;++h)for(r=0,l=a[h];r<s;++r)if((o=e[r]).type===l.type&&o.name===l.name)return l.value}return}for(a=n?we:ye,r=0;r<s;++r)this.each(a(e[r],n,i));return this}function vn(t,n,i){var e=pn(t),r=e.CustomEvent;typeof r=="function"?r=new r(n,i):(r=e.document.createEvent("Event"),i?(r.initEvent(n,i.bubbles,i.cancelable),r.detail=i.detail):r.initEvent(n,!1,!1)),t.dispatchEvent(r)}function ge(t,n){return function(){return vn(this,t,n)}}function me(t,n){return function(){return vn(this,t,n.apply(this,arguments))}}function be(t,n){return this.each((typeof n=="function"?me:ge)(t,n))}function*Ne(){for(var t=this._groups,n=0,i=t.length;n<i;++n)for(var e=t[n],r=0,s=e.length,o;r<s;++r)(o=e[r])&&(yield o)}var gn=[null];function y(t,n){this._groups=t,this._parents=n}function H(){return new y([[document.documentElement]],gn)}function ke(){return this}y.prototype=H.prototype={constructor:y,select:Qn,selectAll:ti,selectChild:ri,selectChildren:hi,filter:ui,data:xi,enter:li,exit:yi,join:wi,merge:vi,selection:ke,order:gi,sort:mi,call:Ni,nodes:ki,node:$i,size:Ti,empty:Ei,each:Si,attr:qi,style:Hi,property:Bi,classed:Ki,text:Wi,html:ne,raise:ee,lower:se,append:oe,insert:he,remove:le,clone:_e,datum:pe,on:ve,dispatch:be,[Symbol.iterator]:Ne};function ws(t){return typeof t=="string"?new y([[document.querySelector(t)]],[document.documentElement]):new y([[t]],gn)}var $e={value:()=>{}};function mn(){for(var t=0,n=arguments.length,i={},e;t<n;++t){if(!(e=arguments[t]+"")||e in i||/[\s.]/.test(e))throw new Error("illegal type: "+e);i[e]=[]}return new j(i)}function j(t){this._=t}function Te(t,n){return t.trim().split(/^|\s+/).map(function(i){var e="",r=i.indexOf(".");if(r>=0&&(e=i.slice(r+1),i=i.slice(0,r)),i&&!n.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:e}})}j.prototype=mn.prototype={constructor:j,on:function(t,n){var i=this._,e=Te(t+"",i),r,s=-1,o=e.length;if(arguments.length<2){for(;++s<o;)if((r=(t=e[s]).type)&&(r=Ee(i[r],t.name)))return r;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++s<o;)if(r=(t=e[s]).type)i[r]=Dt(i[r],t.name,n);else if(n==null)for(r in i)i[r]=Dt(i[r],t.name,null);return this},copy:function(){var t={},n=this._;for(var i in n)t[i]=n[i].slice();return new j(t)},call:function(t,n){if((r=arguments.length-2)>0)for(var i=new Array(r),e=0,r,s;e<r;++e)i[e]=arguments[e+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],e=0,r=s.length;e<r;++e)s[e].value.apply(n,i)},apply:function(t,n,i){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var e=this._[t],r=0,s=e.length;r<s;++r)e[r].value.apply(n,i)}};function Ee(t,n){for(var i=0,e=t.length,r;i<e;++i)if((r=t[i]).name===n)return r.value}function Dt(t,n,i){for(var e=0,r=t.length;e<r;++e)if(t[e].name===n){t[e]=$e,t=t.slice(0,e).concat(t.slice(e+1));break}return i!=null&&t.push({name:n,value:i}),t}function Mt(t,n,i){t.prototype=n.prototype=i,i.constructor=t}function bn(t,n){var i=Object.create(t.prototype);for(var e in n)i[e]=n[e];return i}function G(){}var Y=.7,et=1/Y,F="\\s*([+-]?\\d+)\\s*",V="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",g="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Se=/^#([0-9a-f]{3,8})$/,Ae=new RegExp(`^rgb\\(${F},${F},${F}\\)$`),Me=new RegExp(`^rgb\\(${g},${g},${g}\\)$`),Ce=new RegExp(`^rgba\\(${F},${F},${F},${V}\\)$`),Re=new RegExp(`^rgba\\(${g},${g},${g},${V}\\)$`),Pe=new RegExp(`^hsl\\(${V},${g},${g}\\)$`),Ie=new RegExp(`^hsla\\(${V},${g},${g},${V}\\)$`),zt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Mt(G,U,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Bt,formatHex:Bt,formatHex8:qe,formatHsl:Fe,formatRgb:Yt,toString:Yt});function Bt(){return this.rgb().formatHex()}function qe(){return this.rgb().formatHex8()}function Fe(){return Nn(this).formatHsl()}function Yt(){return this.rgb().formatRgb()}function U(t){var n,i;return t=(t+"").trim().toLowerCase(),(n=Se.exec(t))?(i=n[1].length,n=parseInt(n[1],16),i===6?Vt(n):i===3?new d(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):i===8?Q(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):i===4?Q(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=Ae.exec(t))?new d(n[1],n[2],n[3],1):(n=Me.exec(t))?new d(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=Ce.exec(t))?Q(n[1],n[2],n[3],n[4]):(n=Re.exec(t))?Q(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=Pe.exec(t))?Gt(n[1],n[2]/100,n[3]/100,1):(n=Ie.exec(t))?Gt(n[1],n[2]/100,n[3]/100,n[4]):zt.hasOwnProperty(t)?Vt(zt[t]):t==="transparent"?new d(NaN,NaN,NaN,0):null}function Vt(t){return new d(t>>16&255,t>>8&255,t&255,1)}function Q(t,n,i,e){return e<=0&&(t=n=i=NaN),new d(t,n,i,e)}function Le(t){return t instanceof G||(t=U(t)),t?(t=t.rgb(),new d(t.r,t.g,t.b,t.opacity)):new d}function gt(t,n,i,e){return arguments.length===1?Le(t):new d(t,n,i,e??1)}function d(t,n,i,e){this.r=+t,this.g=+n,this.b=+i,this.opacity=+e}Mt(d,gt,bn(G,{brighter(t){return t=t==null?et:Math.pow(et,t),new d(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Y:Math.pow(Y,t),new d(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new d(C(this.r),C(this.g),C(this.b),rt(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ut,formatHex:Ut,formatHex8:Oe,formatRgb:Kt,toString:Kt}));function Ut(){return`#${M(this.r)}${M(this.g)}${M(this.b)}`}function Oe(){return`#${M(this.r)}${M(this.g)}${M(this.b)}${M((isNaN(this.opacity)?1:this.opacity)*255)}`}function Kt(){const t=rt(this.opacity);return`${t===1?"rgb(":"rgba("}${C(this.r)}, ${C(this.g)}, ${C(this.b)}${t===1?")":`, ${t})`}`}function rt(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function C(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function M(t){return t=C(t),(t<16?"0":"")+t.toString(16)}function Gt(t,n,i,e){return e<=0?t=n=i=NaN:i<=0||i>=1?t=n=NaN:n<=0&&(t=NaN),new w(t,n,i,e)}function Nn(t){if(t instanceof w)return new w(t.h,t.s,t.l,t.opacity);if(t instanceof G||(t=U(t)),!t)return new w;if(t instanceof w)return t;t=t.rgb();var n=t.r/255,i=t.g/255,e=t.b/255,r=Math.min(n,i,e),s=Math.max(n,i,e),o=NaN,a=s-r,h=(s+r)/2;return a?(n===s?o=(i-e)/a+(i<e)*6:i===s?o=(e-n)/a+2:o=(n-i)/a+4,a/=h<.5?s+r:2-s-r,o*=60):a=h>0&&h<1?0:o,new w(o,a,h,t.opacity)}function He(t,n,i,e){return arguments.length===1?Nn(t):new w(t,n,i,e??1)}function w(t,n,i,e){this.h=+t,this.s=+n,this.l=+i,this.opacity=+e}Mt(w,He,bn(G,{brighter(t){return t=t==null?et:Math.pow(et,t),new w(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Y:Math.pow(Y,t),new w(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,n=isNaN(t)||isNaN(this.s)?0:this.s,i=this.l,e=i+(i<.5?i:1-i)*n,r=2*i-e;return new d(dt(t>=240?t-240:t+120,r,e),dt(t,r,e),dt(t<120?t+240:t-120,r,e),this.opacity)},clamp(){return new w(Zt(this.h),W(this.s),W(this.l),rt(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=rt(this.opacity);return`${t===1?"hsl(":"hsla("}${Zt(this.h)}, ${W(this.s)*100}%, ${W(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Zt(t){return t=(t||0)%360,t<0?t+360:t}function W(t){return Math.max(0,Math.min(1,t||0))}function dt(t,n,i){return(t<60?n+(i-n)*t/60:t<180?i:t<240?n+(i-n)*(240-t)/60:n)*255}const Ct=t=>()=>t;function kn(t,n){return function(i){return t+i*n}}function Xe(t,n,i){return t=Math.pow(t,i),n=Math.pow(n,i)-t,i=1/i,function(e){return Math.pow(t+e*n,i)}}function vs(t,n){var i=n-t;return i?kn(t,i>180||i<-180?i-360*Math.round(i/360):i):Ct(isNaN(t)?n:t)}function De(t){return(t=+t)==1?$n:function(n,i){return i-n?Xe(n,i,t):Ct(isNaN(n)?i:n)}}function $n(t,n){var i=n-t;return i?kn(t,i):Ct(isNaN(t)?n:t)}const Qt=(function t(n){var i=De(n);function e(r,s){var o=i((r=gt(r)).r,(s=gt(s)).r),a=i(r.g,s.g),h=i(r.b,s.b),u=$n(r.opacity,s.opacity);return function(l){return r.r=o(l),r.g=a(l),r.b=h(l),r.opacity=u(l),r+""}}return e.gamma=t,e})(1);function T(t,n){return t=+t,n=+n,function(i){return t*(1-i)+n*i}}var mt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,yt=new RegExp(mt.source,"g");function ze(t){return function(){return t}}function Be(t){return function(n){return t(n)+""}}function Ye(t,n){var i=mt.lastIndex=yt.lastIndex=0,e,r,s,o=-1,a=[],h=[];for(t=t+"",n=n+"";(e=mt.exec(t))&&(r=yt.exec(n));)(s=r.index)>i&&(s=n.slice(i,s),a[o]?a[o]+=s:a[++o]=s),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,h.push({i:o,x:T(e,r)})),i=yt.lastIndex;return i<n.length&&(s=n.slice(i),a[o]?a[o]+=s:a[++o]=s),a.length<2?h[0]?Be(h[0].x):ze(n):(n=h.length,function(u){for(var l=0,c;l<n;++l)a[(c=h[l]).i]=c.x(u);return a.join("")})}var Wt=180/Math.PI,bt={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Tn(t,n,i,e,r,s){var o,a,h;return(o=Math.sqrt(t*t+n*n))&&(t/=o,n/=o),(h=t*i+n*e)&&(i-=t*h,e-=n*h),(a=Math.sqrt(i*i+e*e))&&(i/=a,e/=a,h/=a),t*e<n*i&&(t=-t,n=-n,h=-h,o=-o),{translateX:r,translateY:s,rotate:Math.atan2(n,t)*Wt,skewX:Math.atan(h)*Wt,scaleX:o,scaleY:a}}var J;function Ve(t){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return n.isIdentity?bt:Tn(n.a,n.b,n.c,n.d,n.e,n.f)}function Ue(t){return t==null||(J||(J=document.createElementNS("http://www.w3.org/2000/svg","g")),J.setAttribute("transform",t),!(t=J.transform.baseVal.consolidate()))?bt:(t=t.matrix,Tn(t.a,t.b,t.c,t.d,t.e,t.f))}function En(t,n,i,e){function r(u){return u.length?u.pop()+" ":""}function s(u,l,c,f,_,p){if(u!==c||l!==f){var x=_.push("translate(",null,n,null,i);p.push({i:x-4,x:T(u,c)},{i:x-2,x:T(l,f)})}else(c||f)&&_.push("translate("+c+n+f+i)}function o(u,l,c,f){u!==l?(u-l>180?l+=360:l-u>180&&(u+=360),f.push({i:c.push(r(c)+"rotate(",null,e)-2,x:T(u,l)})):l&&c.push(r(c)+"rotate("+l+e)}function a(u,l,c,f){u!==l?f.push({i:c.push(r(c)+"skewX(",null,e)-2,x:T(u,l)}):l&&c.push(r(c)+"skewX("+l+e)}function h(u,l,c,f,_,p){if(u!==c||l!==f){var x=_.push(r(_)+"scale(",null,",",null,")");p.push({i:x-4,x:T(u,c)},{i:x-2,x:T(l,f)})}else(c!==1||f!==1)&&_.push(r(_)+"scale("+c+","+f+")")}return function(u,l){var c=[],f=[];return u=t(u),l=t(l),s(u.translateX,u.translateY,l.translateX,l.translateY,c,f),o(u.rotate,l.rotate,c,f),a(u.skewX,l.skewX,c,f),h(u.scaleX,u.scaleY,l.scaleX,l.scaleY,c,f),u=l=null,function(_){for(var p=-1,x=f.length,b;++p<x;)c[(b=f[p]).i]=b.x(_);return c.join("")}}}var Ke=En(Ve,"px, ","px)","deg)"),Ge=En(Ue,", ",")",")"),O=0,z=0,D=0,Sn=1e3,st,B,ot=0,R=0,ft=0,K=typeof performance=="object"&&performance.now?performance:Date,An=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Rt(){return R||(An(Ze),R=K.now()+ft)}function Ze(){R=0}function at(){this._call=this._time=this._next=null}at.prototype=Mn.prototype={constructor:at,restart:function(t,n,i){if(typeof t!="function")throw new TypeError("callback is not a function");i=(i==null?Rt():+i)+(n==null?0:+n),!this._next&&B!==this&&(B?B._next=this:st=this,B=this),this._call=t,this._time=i,Nt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Nt())}};function Mn(t,n,i){var e=new at;return e.restart(t,n,i),e}function Qe(){Rt(),++O;for(var t=st,n;t;)(n=R-t._time)>=0&&t._call.call(void 0,n),t=t._next;--O}function Jt(){R=(ot=K.now())+ft,O=z=0;try{Qe()}finally{O=0,Je(),R=0}}function We(){var t=K.now(),n=t-ot;n>Sn&&(ft-=n,ot=t)}function Je(){for(var t,n=st,i,e=1/0;n;)n._call?(e>n._time&&(e=n._time),t=n,n=n._next):(i=n._next,n._next=null,n=t?t._next=i:st=i);B=t,Nt(e)}function Nt(t){if(!O){z&&(z=clearTimeout(z));var n=t-R;n>24?(t<1/0&&(z=setTimeout(Jt,t-K.now()-ft)),D&&(D=clearInterval(D))):(D||(ot=K.now(),D=setInterval(We,Sn)),O=1,An(Jt))}}function jt(t,n,i){var e=new at;return n=n==null?0:+n,e.restart(r=>{e.stop(),t(r+n)},n,i),e}var je=mn("start","end","cancel","interrupt"),tr=[],Cn=0,tn=1,kt=2,tt=3,nn=4,$t=5,nt=6;function _t(t,n,i,e,r,s){var o=t.__transition;if(!o)t.__transition={};else if(i in o)return;nr(t,i,{name:n,index:e,group:r,on:je,tween:tr,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Cn})}function Pt(t,n){var i=v(t,n);if(i.state>Cn)throw new Error("too late; already scheduled");return i}function m(t,n){var i=v(t,n);if(i.state>tt)throw new Error("too late; already running");return i}function v(t,n){var i=t.__transition;if(!i||!(i=i[n]))throw new Error("transition not found");return i}function nr(t,n,i){var e=t.__transition,r;e[n]=i,i.timer=Mn(s,0,i.time);function s(u){i.state=tn,i.timer.restart(o,i.delay,i.time),i.delay<=u&&o(u-i.delay)}function o(u){var l,c,f,_;if(i.state!==tn)return h();for(l in e)if(_=e[l],_.name===i.name){if(_.state===tt)return jt(o);_.state===nn?(_.state=nt,_.timer.stop(),_.on.call("interrupt",t,t.__data__,_.index,_.group),delete e[l]):+l<n&&(_.state=nt,_.timer.stop(),_.on.call("cancel",t,t.__data__,_.index,_.group),delete e[l])}if(jt(function(){i.state===tt&&(i.state=nn,i.timer.restart(a,i.delay,i.time),a(u))}),i.state=kt,i.on.call("start",t,t.__data__,i.index,i.group),i.state===kt){for(i.state=tt,r=new Array(f=i.tween.length),l=0,c=-1;l<f;++l)(_=i.tween[l].value.call(t,t.__data__,i.index,i.group))&&(r[++c]=_);r.length=c+1}}function a(u){for(var l=u<i.duration?i.ease.call(null,u/i.duration):(i.timer.restart(h),i.state=$t,1),c=-1,f=r.length;++c<f;)r[c].call(t,l);i.state===$t&&(i.on.call("end",t,t.__data__,i.index,i.group),h())}function h(){i.state=nt,i.timer.stop(),delete e[n];for(var u in e)return;delete t.__transition}}function ir(t,n){var i=t.__transition,e,r,s=!0,o;if(i){n=n==null?null:n+"";for(o in i){if((e=i[o]).name!==n){s=!1;continue}r=e.state>kt&&e.state<$t,e.state=nt,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete i[o]}s&&delete t.__transition}}function er(t){return this.each(function(){ir(this,t)})}function rr(t,n){var i,e;return function(){var r=m(this,t),s=r.tween;if(s!==i){e=i=s;for(var o=0,a=e.length;o<a;++o)if(e[o].name===n){e=e.slice(),e.splice(o,1);break}}r.tween=e}}function sr(t,n,i){var e,r;if(typeof i!="function")throw new Error;return function(){var s=m(this,t),o=s.tween;if(o!==e){r=(e=o).slice();for(var a={name:n,value:i},h=0,u=r.length;h<u;++h)if(r[h].name===n){r[h]=a;break}h===u&&r.push(a)}s.tween=r}}function or(t,n){var i=this._id;if(t+="",arguments.length<2){for(var e=v(this.node(),i).tween,r=0,s=e.length,o;r<s;++r)if((o=e[r]).name===t)return o.value;return null}return this.each((n==null?rr:sr)(i,t,n))}function It(t,n,i){var e=t._id;return t.each(function(){var r=m(this,e);(r.value||(r.value={}))[n]=i.apply(this,arguments)}),function(r){return v(r,e).value[n]}}function Rn(t,n){var i;return(typeof n=="number"?T:n instanceof U?Qt:(i=U(n))?(n=i,Qt):Ye)(t,n)}function ar(t){return function(){this.removeAttribute(t)}}function hr(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ur(t,n,i){var e,r=i+"",s;return function(){var o=this.getAttribute(t);return o===r?null:o===e?s:s=n(e=o,i)}}function lr(t,n,i){var e,r=i+"",s;return function(){var o=this.getAttributeNS(t.space,t.local);return o===r?null:o===e?s:s=n(e=o,i)}}function cr(t,n,i){var e,r,s;return function(){var o,a=i(this),h;return a==null?void this.removeAttribute(t):(o=this.getAttribute(t),h=a+"",o===h?null:o===e&&h===r?s:(r=h,s=n(e=o,a)))}}function fr(t,n,i){var e,r,s;return function(){var o,a=i(this),h;return a==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),h=a+"",o===h?null:o===e&&h===r?s:(r=h,s=n(e=o,a)))}}function _r(t,n){var i=ct(t),e=i==="transform"?Ge:Rn;return this.attrTween(t,typeof n=="function"?(i.local?fr:cr)(i,e,It(this,"attr."+t,n)):n==null?(i.local?hr:ar)(i):(i.local?lr:ur)(i,e,n))}function pr(t,n){return function(i){this.setAttribute(t,n.call(this,i))}}function xr(t,n){return function(i){this.setAttributeNS(t.space,t.local,n.call(this,i))}}function dr(t,n){var i,e;function r(){var s=n.apply(this,arguments);return s!==e&&(i=(e=s)&&xr(t,s)),i}return r._value=n,r}function yr(t,n){var i,e;function r(){var s=n.apply(this,arguments);return s!==e&&(i=(e=s)&&pr(t,s)),i}return r._value=n,r}function wr(t,n){var i="attr."+t;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;var e=ct(t);return this.tween(i,(e.local?dr:yr)(e,n))}function vr(t,n){return function(){Pt(this,t).delay=+n.apply(this,arguments)}}function gr(t,n){return n=+n,function(){Pt(this,t).delay=n}}function mr(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?vr:gr)(n,t)):v(this.node(),n).delay}function br(t,n){return function(){m(this,t).duration=+n.apply(this,arguments)}}function Nr(t,n){return n=+n,function(){m(this,t).duration=n}}function kr(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?br:Nr)(n,t)):v(this.node(),n).duration}function $r(t,n){if(typeof n!="function")throw new Error;return function(){m(this,t).ease=n}}function Tr(t){var n=this._id;return arguments.length?this.each($r(n,t)):v(this.node(),n).ease}function Er(t,n){return function(){var i=n.apply(this,arguments);if(typeof i!="function")throw new Error;m(this,t).ease=i}}function Sr(t){if(typeof t!="function")throw new Error;return this.each(Er(this._id,t))}function Ar(t){typeof t!="function"&&(t=cn(t));for(var n=this._groups,i=n.length,e=new Array(i),r=0;r<i;++r)for(var s=n[r],o=s.length,a=e[r]=[],h,u=0;u<o;++u)(h=s[u])&&t.call(h,h.__data__,u,s)&&a.push(h);return new k(e,this._parents,this._name,this._id)}function Mr(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,i=t._groups,e=n.length,r=i.length,s=Math.min(e,r),o=new Array(e),a=0;a<s;++a)for(var h=n[a],u=i[a],l=h.length,c=o[a]=new Array(l),f,_=0;_<l;++_)(f=h[_]||u[_])&&(c[_]=f);for(;a<e;++a)o[a]=n[a];return new k(o,this._parents,this._name,this._id)}function Cr(t){return(t+"").trim().split(/^|\s+/).every(function(n){var i=n.indexOf(".");return i>=0&&(n=n.slice(0,i)),!n||n==="start"})}function Rr(t,n,i){var e,r,s=Cr(n)?Pt:m;return function(){var o=s(this,t),a=o.on;a!==e&&(r=(e=a).copy()).on(n,i),o.on=r}}function Pr(t,n){var i=this._id;return arguments.length<2?v(this.node(),i).on.on(t):this.each(Rr(i,t,n))}function Ir(t){return function(){var n=this.parentNode;for(var i in this.__transition)if(+i!==t)return;n&&n.removeChild(this)}}function qr(){return this.on("end.remove",Ir(this._id))}function Fr(t){var n=this._name,i=this._id;typeof t!="function"&&(t=St(t));for(var e=this._groups,r=e.length,s=new Array(r),o=0;o<r;++o)for(var a=e[o],h=a.length,u=s[o]=new Array(h),l,c,f=0;f<h;++f)(l=a[f])&&(c=t.call(l,l.__data__,f,a))&&("__data__"in l&&(c.__data__=l.__data__),u[f]=c,_t(u[f],n,i,f,u,v(l,i)));return new k(s,this._parents,n,i)}function Lr(t){var n=this._name,i=this._id;typeof t!="function"&&(t=ln(t));for(var e=this._groups,r=e.length,s=[],o=[],a=0;a<r;++a)for(var h=e[a],u=h.length,l,c=0;c<u;++c)if(l=h[c]){for(var f=t.call(l,l.__data__,c,h),_,p=v(l,i),x=0,b=f.length;x<b;++x)(_=f[x])&&_t(_,n,i,x,f,p);s.push(f),o.push(l)}return new k(s,o,n,i)}var Or=H.prototype.constructor;function Hr(){return new Or(this._groups,this._parents)}function Xr(t,n){var i,e,r;return function(){var s=L(this,t),o=(this.style.removeProperty(t),L(this,t));return s===o?null:s===i&&o===e?r:r=n(i=s,e=o)}}function Pn(t){return function(){this.style.removeProperty(t)}}function Dr(t,n,i){var e,r=i+"",s;return function(){var o=L(this,t);return o===r?null:o===e?s:s=n(e=o,i)}}function zr(t,n,i){var e,r,s;return function(){var o=L(this,t),a=i(this),h=a+"";return a==null&&(h=a=(this.style.removeProperty(t),L(this,t))),o===h?null:o===e&&h===r?s:(r=h,s=n(e=o,a))}}function Br(t,n){var i,e,r,s="style."+n,o="end."+s,a;return function(){var h=m(this,t),u=h.on,l=h.value[s]==null?a||(a=Pn(n)):void 0;(u!==i||r!==l)&&(e=(i=u).copy()).on(o,r=l),h.on=e}}function Yr(t,n,i){var e=(t+="")=="transform"?Ke:Rn;return n==null?this.styleTween(t,Xr(t,e)).on("end.style."+t,Pn(t)):typeof n=="function"?this.styleTween(t,zr(t,e,It(this,"style."+t,n))).each(Br(this._id,t)):this.styleTween(t,Dr(t,e,n),i).on("end.style."+t,null)}function Vr(t,n,i){return function(e){this.style.setProperty(t,n.call(this,e),i)}}function Ur(t,n,i){var e,r;function s(){var o=n.apply(this,arguments);return o!==r&&(e=(r=o)&&Vr(t,o,i)),e}return s._value=n,s}function Kr(t,n,i){var e="style."+(t+="");if(arguments.length<2)return(e=this.tween(e))&&e._value;if(n==null)return this.tween(e,null);if(typeof n!="function")throw new Error;return this.tween(e,Ur(t,n,i??""))}function Gr(t){return function(){this.textContent=t}}function Zr(t){return function(){var n=t(this);this.textContent=n??""}}function Qr(t){return this.tween("text",typeof t=="function"?Zr(It(this,"text",t)):Gr(t==null?"":t+""))}function Wr(t){return function(n){this.textContent=t.call(this,n)}}function Jr(t){var n,i;function e(){var r=t.apply(this,arguments);return r!==i&&(n=(i=r)&&Wr(r)),n}return e._value=t,e}function jr(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,Jr(t))}function ts(){for(var t=this._name,n=this._id,i=In(),e=this._groups,r=e.length,s=0;s<r;++s)for(var o=e[s],a=o.length,h,u=0;u<a;++u)if(h=o[u]){var l=v(h,n);_t(h,t,i,u,o,{time:l.time+l.delay+l.duration,delay:0,duration:l.duration,ease:l.ease})}return new k(e,this._parents,t,i)}function ns(){var t,n,i=this,e=i._id,r=i.size();return new Promise(function(s,o){var a={value:o},h={value:function(){--r===0&&s()}};i.each(function(){var u=m(this,e),l=u.on;l!==t&&(n=(t=l).copy(),n._.cancel.push(a),n._.interrupt.push(a),n._.end.push(h)),u.on=n}),r===0&&s()})}var is=0;function k(t,n,i,e){this._groups=t,this._parents=n,this._name=i,this._id=e}function es(t){return H().transition(t)}function In(){return++is}var N=H.prototype;k.prototype=es.prototype={constructor:k,select:Fr,selectAll:Lr,selectChild:N.selectChild,selectChildren:N.selectChildren,filter:Ar,merge:Mr,selection:Hr,transition:ts,call:N.call,nodes:N.nodes,node:N.node,size:N.size,empty:N.empty,each:N.each,on:Pr,attr:_r,attrTween:wr,style:Yr,styleTween:Kr,text:Qr,textTween:jr,remove:qr,tween:or,delay:mr,duration:kr,ease:Tr,easeVarying:Sr,end:ns,[Symbol.iterator]:N[Symbol.iterator]};function rs(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var ss={time:null,delay:0,duration:250,ease:rs};function os(t,n){for(var i;!(i=t.__transition)||!(i=i[n]);)if(!(t=t.parentNode))throw new Error(`transition ${n} not found`);return i}function as(t){var n,i;t instanceof k?(n=t._id,t=t._name):(n=In(),(i=ss).time=Rt(),t=t==null?null:t+"");for(var e=this._groups,r=e.length,s=0;s<r;++s)for(var o=e[s],a=o.length,h,u=0;u<a;++u)(h=o[u])&&_t(h,t,n,u,o,i||os(h,n));return new k(e,this._parents,t,n)}H.prototype.interrupt=er;H.prototype.transition=as;function I(t){return function(){return t}}const gs=Math.abs,ms=Math.atan2,bs=Math.cos,Ns=Math.max,ks=Math.min,$s=Math.sin,Ts=Math.sqrt,en=1e-12,qt=Math.PI,rn=qt/2,Es=2*qt;function Ss(t){return t>1?0:t<-1?qt:Math.acos(t)}function As(t){return t>=1?rn:t<=-1?-rn:Math.asin(t)}const Tt=Math.PI,Et=2*Tt,A=1e-6,hs=Et-A;function qn(t){this._+=t[0];for(let n=1,i=t.length;n<i;++n)this._+=arguments[n]+t[n]}function us(t){let n=Math.floor(t);if(!(n>=0))throw new Error(`invalid digits: ${t}`);if(n>15)return qn;const i=10**n;return function(e){this._+=e[0];for(let r=1,s=e.length;r<s;++r)this._+=Math.round(arguments[r]*i)/i+e[r]}}class ls{constructor(n){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=n==null?qn:us(n)}moveTo(n,i){this._append`M${this._x0=this._x1=+n},${this._y0=this._y1=+i}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(n,i){this._append`L${this._x1=+n},${this._y1=+i}`}quadraticCurveTo(n,i,e,r){this._append`Q${+n},${+i},${this._x1=+e},${this._y1=+r}`}bezierCurveTo(n,i,e,r,s,o){this._append`C${+n},${+i},${+e},${+r},${this._x1=+s},${this._y1=+o}`}arcTo(n,i,e,r,s){if(n=+n,i=+i,e=+e,r=+r,s=+s,s<0)throw new Error(`negative radius: ${s}`);let o=this._x1,a=this._y1,h=e-n,u=r-i,l=o-n,c=a-i,f=l*l+c*c;if(this._x1===null)this._append`M${this._x1=n},${this._y1=i}`;else if(f>A)if(!(Math.abs(c*h-u*l)>A)||!s)this._append`L${this._x1=n},${this._y1=i}`;else{let _=e-o,p=r-a,x=h*h+u*u,b=_*_+p*p,Z=Math.sqrt(x),$=Math.sqrt(f),S=s*Math.tan((Tt-Math.acos((x+f-b)/(2*Z*$)))/2),P=S/$,X=S/Z;Math.abs(P-1)>A&&this._append`L${n+P*l},${i+P*c}`,this._append`A${s},${s},0,0,${+(c*_>l*p)},${this._x1=n+X*h},${this._y1=i+X*u}`}}arc(n,i,e,r,s,o){if(n=+n,i=+i,e=+e,o=!!o,e<0)throw new Error(`negative radius: ${e}`);let a=e*Math.cos(r),h=e*Math.sin(r),u=n+a,l=i+h,c=1^o,f=o?r-s:s-r;this._x1===null?this._append`M${u},${l}`:(Math.abs(this._x1-u)>A||Math.abs(this._y1-l)>A)&&this._append`L${u},${l}`,e&&(f<0&&(f=f%Et+Et),f>hs?this._append`A${e},${e},0,1,${c},${n-a},${i-h}A${e},${e},0,1,${c},${this._x1=u},${this._y1=l}`:f>A&&this._append`A${e},${e},0,${+(f>=Tt)},${c},${this._x1=n+e*Math.cos(s)},${this._y1=i+e*Math.sin(s)}`)}rect(n,i,e,r){this._append`M${this._x0=this._x1=+n},${this._y0=this._y1=+i}h${e=+e}v${+r}h${-e}Z`}toString(){return this._}}function cs(t){let n=3;return t.digits=function(i){if(!arguments.length)return n;if(i==null)n=null;else{const e=Math.floor(i);if(!(e>=0))throw new RangeError(`invalid digits: ${i}`);n=e}return t},()=>new ls(n)}function fs(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Fn(t){this._context=t}Fn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n);break}}};function _s(t){return new Fn(t)}function ps(t){return t[0]}function xs(t){return t[1]}function Ms(t,n){var i=I(!0),e=null,r=_s,s=null,o=cs(a);t=typeof t=="function"?t:t===void 0?ps:I(t),n=typeof n=="function"?n:n===void 0?xs:I(n);function a(h){var u,l=(h=fs(h)).length,c,f=!1,_;for(e==null&&(s=r(_=o())),u=0;u<=l;++u)!(u<l&&i(c=h[u],u,h))===f&&((f=!f)?s.lineStart():s.lineEnd()),f&&s.point(+t(c,u,h),+n(c,u,h));if(_)return s=null,_+""||null}return a.x=function(h){return arguments.length?(t=typeof h=="function"?h:I(+h),a):t},a.y=function(h){return arguments.length?(n=typeof h=="function"?h:I(+h),a):n},a.defined=function(h){return arguments.length?(i=typeof h=="function"?h:I(!!h),a):i},a.curve=function(h){return arguments.length?(r=h,e!=null&&(s=r(e)),a):r},a.context=function(h){return arguments.length?(h==null?e=s=null:s=r(e=h),a):e},a}function E(){}function ht(t,n,i){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+i)/6)}function pt(t){this._context=t}pt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ht(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ht(this,t,n);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};function Cs(t){return new pt(t)}function Ln(t){this._context=t}Ln.prototype={areaStart:E,areaEnd:E,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:ht(this,t,n);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};function Rs(t){return new Ln(t)}function On(t){this._context=t}On.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var i=(this._x0+4*this._x1+t)/6,e=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(i,e):this._context.moveTo(i,e);break;case 3:this._point=4;default:ht(this,t,n);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}};function Ps(t){return new On(t)}function Hn(t,n){this._basis=new pt(t),this._beta=n}Hn.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,i=t.length-1;if(i>0)for(var e=t[0],r=n[0],s=t[i]-e,o=n[i]-r,a=-1,h;++a<=i;)h=a/i,this._basis.point(this._beta*t[a]+(1-this._beta)*(e+h*s),this._beta*n[a]+(1-this._beta)*(r+h*o));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};const Is=(function t(n){function i(e){return n===1?new pt(e):new Hn(e,n)}return i.beta=function(e){return t(+e)},i})(.85);function ut(t,n,i){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-i),t._x2,t._y2)}function Ft(t,n){this._context=t,this._k=(1-n)/6}Ft.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ut(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:ut(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};const qs=(function t(n){function i(e){return new Ft(e,n)}return i.tension=function(e){return t(+e)},i})(0);function Lt(t,n){this._context=t,this._k=(1-n)/6}Lt.prototype={areaStart:E,areaEnd:E,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:ut(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};const Fs=(function t(n){function i(e){return new Lt(e,n)}return i.tension=function(e){return t(+e)},i})(0);function Ot(t,n){this._context=t,this._k=(1-n)/6}Ot.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ut(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};const Ls=(function t(n){function i(e){return new Ot(e,n)}return i.tension=function(e){return t(+e)},i})(0);function Ht(t,n,i){var e=t._x1,r=t._y1,s=t._x2,o=t._y2;if(t._l01_a>en){var a=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,h=3*t._l01_a*(t._l01_a+t._l12_a);e=(e*a-t._x0*t._l12_2a+t._x2*t._l01_2a)/h,r=(r*a-t._y0*t._l12_2a+t._y2*t._l01_2a)/h}if(t._l23_a>en){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);s=(s*u+t._x1*t._l23_2a-n*t._l12_2a)/l,o=(o*u+t._y1*t._l23_2a-i*t._l12_2a)/l}t._context.bezierCurveTo(e,r,s,o,t._x2,t._y2)}function Xn(t,n){this._context=t,this._alpha=n}Xn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var i=this._x2-t,e=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+e*e,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:Ht(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};const Os=(function t(n){function i(e){return n?new Xn(e,n):new Ft(e,0)}return i.alpha=function(e){return t(+e)},i})(.5);function Dn(t,n){this._context=t,this._alpha=n}Dn.prototype={areaStart:E,areaEnd:E,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,n){if(t=+t,n=+n,this._point){var i=this._x2-t,e=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+e*e,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Ht(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};const Hs=(function t(n){function i(e){return n?new Dn(e,n):new Lt(e,0)}return i.alpha=function(e){return t(+e)},i})(.5);function zn(t,n){this._context=t,this._alpha=n}zn.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var i=this._x2-t,e=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+e*e,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ht(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};const Xs=(function t(n){function i(e){return n?new zn(e,n):new Ot(e,0)}return i.alpha=function(e){return t(+e)},i})(.5);function Bn(t){this._context=t}Bn.prototype={areaStart:E,areaEnd:E,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,n){t=+t,n=+n,this._point?this._context.lineTo(t,n):(this._point=1,this._context.moveTo(t,n))}};function Ds(t){return new Bn(t)}function sn(t){return t<0?-1:1}function on(t,n,i){var e=t._x1-t._x0,r=n-t._x1,s=(t._y1-t._y0)/(e||r<0&&-0),o=(i-t._y1)/(r||e<0&&-0),a=(s*r+o*e)/(e+r);return(sn(s)+sn(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function an(t,n){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-n)/2:n}function wt(t,n,i){var e=t._x0,r=t._y0,s=t._x1,o=t._y1,a=(s-e)/3;t._context.bezierCurveTo(e+a,r+a*n,s-a,o-a*i,s,o)}function lt(t){this._context=t}lt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:wt(this,this._t0,an(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){var i=NaN;if(t=+t,n=+n,!(t===this._x1&&n===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,wt(this,an(this,i=on(this,t,n)),i);break;default:wt(this,this._t0,i=on(this,t,n));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n,this._t0=i}}};function Yn(t){this._context=new Vn(t)}(Yn.prototype=Object.create(lt.prototype)).point=function(t,n){lt.prototype.point.call(this,n,t)};function Vn(t){this._context=t}Vn.prototype={moveTo:function(t,n){this._context.moveTo(n,t)},closePath:function(){this._context.closePath()},lineTo:function(t,n){this._context.lineTo(n,t)},bezierCurveTo:function(t,n,i,e,r,s){this._context.bezierCurveTo(n,t,e,i,s,r)}};function zs(t){return new lt(t)}function Bs(t){return new Yn(t)}function Un(t){this._context=t}Un.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,n=this._y,i=t.length;if(i)if(this._line?this._context.lineTo(t[0],n[0]):this._context.moveTo(t[0],n[0]),i===2)this._context.lineTo(t[1],n[1]);else for(var e=hn(t),r=hn(n),s=0,o=1;o<i;++s,++o)this._context.bezierCurveTo(e[0][s],r[0][s],e[1][s],r[1][s],t[o],n[o]);(this._line||this._line!==0&&i===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,n){this._x.push(+t),this._y.push(+n)}};function hn(t){var n,i=t.length-1,e,r=new Array(i),s=new Array(i),o=new Array(i);for(r[0]=0,s[0]=2,o[0]=t[0]+2*t[1],n=1;n<i-1;++n)r[n]=1,s[n]=4,o[n]=4*t[n]+2*t[n+1];for(r[i-1]=2,s[i-1]=7,o[i-1]=8*t[i-1]+t[i],n=1;n<i;++n)e=r[n]/s[n-1],s[n]-=e,o[n]-=e*o[n-1];for(r[i-1]=o[i-1]/s[i-1],n=i-2;n>=0;--n)r[n]=(o[n]-r[n+1])/s[n];for(s[i-1]=(t[i]+r[i-1])/2,n=0;n<i-1;++n)s[n]=2*t[n+1]-r[n+1];return[r,s]}function Ys(t){return new Un(t)}function xt(t,n){this._context=t,this._t=n}xt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var i=this._x*(1-this._t)+t*this._t;this._context.lineTo(i,this._y),this._context.lineTo(i,n)}break}}this._x=t,this._y=n}};function Vs(t){return new xt(t,.5)}function Us(t){return new xt(t,0)}function Ks(t){return new xt(t,1)}function q(t,n,i){this.k=t,this.x=n,this.y=i}q.prototype={constructor:q,scale:function(t){return t===1?this:new q(this.k*t,this.x,this.y)},translate:function(t,n){return t===0&n===0?this:new q(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ds=new q(1,0,0);ys.prototype=q.prototype;function ys(t){for(;!t.__zoom;)if(!(t=t.parentNode))return ds;return t.__zoom}export{qs as $,bn as A,$n as B,G as C,vs as D,gn as E,Wn as F,mn as G,ir as H,Xt as I,es as J,_s as K,ps as L,xs as M,Us as N,Ks as O,Vs as P,Ds as Q,d as R,y as S,Ys as T,Bs as U,zs as V,Xs as W,Hs as X,Os as Y,Ls as Z,Fs as _,gs as a,Is as a0,Ps as a1,Rs as a2,ds as a3,q as a4,ys as a5,Ts as b,bs as c,ms as d,en as e,I as f,As as g,rn as h,Ss as i,Ns as j,ws as k,Ms as l,ks as m,Cs as n,fs as o,qt as p,Ct as q,T as r,$s as s,Es as t,U as u,Qt as v,cs as w,Ye as x,Le as y,Mt as z};
@@ -1,4 +1,4 @@
1
- import{aN as Wt,s as Kt,g as Ht,p as Yt,o as Xt,a as Zt,b as Jt,_ as w,z as wt,F as Qt,a4 as $t,S as te,T as ee,V as ne,d as se,q as ie,B as oe,D as re}from"./mermaid.core-C1A7sX2Q.js";import{k as ot}from"./transform-CXma_uU-.js";import"./index-m-Vth8Lp.js";import"./FilePreviewState-pYNEkUjZ.js";import"./workbench-live-service-B89IkMyd.js";import"./mobile-dialog-return-service-8c0Hdszs.js";const It=(t,n)=>Wt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,o=0;const r=[];if(e.length>1){const l=Et(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let f=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];o+=(f.x+a.x)*(a.y-f.y);const y={x:(a.x+f.x)/2,y:(a.y+f.y)/2};let h=null;for(let b=0;b<a.parentIndex.length;++b)if(f.parentIndex.includes(a.parentIndex[b])){const p=t[a.parentIndex[b]],M=Math.atan2(a.x-p.x,a.y-p.y),E=Math.atan2(f.x-p.x,f.y-p.y);let _=E-M;_<0&&(_+=2*Math.PI);const S=E-_/2;let g=q(y,{x:p.x+p.radius*Math.sin(S),y:p.y+p.radius*Math.cos(S)});g>p.radius*2&&(g=p.radius*2),(h==null||h.width>g)&&(h={circle:p,width:g,p1:a,p2:f,large:g>p.radius,sweep:!0})}h!=null&&(r.push(h),i+=lt(h.circle.radius,h.width),f=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let f=!1;for(let u=0;u<t.length;++u)if(q(t[u],l)>Math.abs(l.radius-t[u].radius)){f=!0;break}f?i=o=0:(i=l.radius*l.radius*Math.PI,r.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=r,n.innerPoints=e,n.intersectionPoints=s),i+o}function ae(t,n){return n.every(s=>q(t,s)<s.radius+_t)}function le(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Tt(t[s],t[e]);for(const o of i)o.parentIndex=[s,e],n.push(o)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function q(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),r=Math.sqrt(e*e-o*o),l=t.x+o*(n.x-t.x)/s,f=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(r/s),a=-(n.x-t.x)*(r/s);return[{x:l+u,y:f-a},{x:l-u,y:f+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,r=t(n),l=t(s);let f=s-n;if(r*l>0)throw"Initial bisect points must have opposite signs";if(r===0)return n;if(l===0)return s;for(let u=0;u<i;++u){f/=2;const a=n+f,y=t(a);if(y*r>=0&&(n=a),Math.abs(f)<o||y===0)return a}return n+f}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function $(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt($(t,t))}function ft(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function J(t,n,s,e,i){for(let o=0;o<t.length;++o)t[o]=n*s[o]+e*i[o]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,o=s.zeroDelta||.001,r=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,f=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,y=s.sigma!==void 0?s.sigma:.5;let h;const b=n.length,p=new Array(b+1);p[0]=n,p[0].fx=t(n),p[0].id=0;for(let v=0;v<b;++v){const c=n.slice();c[v]=c[v]?c[v]*i:o,p[v+1]=c,p[v+1].fx=t(c),p[v+1].id=v+1}function M(v){for(let c=0;c<v.length;c++)p[b][c]=v[c];p[b].fx=v.fx}const E=(v,c)=>v.fx-c.fx,_=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v<e;++v){if(p.sort(E),s.history){const x=p.map(d=>{const D=d.slice();return D.fx=d.fx,D.id=d.id,D});x.sort((d,D)=>d.id-D.id),s.history.push({x:p[0].slice(),fx:p[0].fx,simplex:x})}h=0;for(let x=0;x<b;++x)h=Math.max(h,Math.abs(p[0][x]-p[1][x]));if(Math.abs(p[0].fx-p[b].fx)<r&&h<l)break;for(let x=0;x<b;++x){_[x]=0;for(let d=0;d<b;++d)_[x]+=p[d][x];_[x]/=b}const c=p[b];if(J(S,1+f,_,-f,c),S.fx=t(S),S.fx<p[0].fx)J(m,1+u,_,-u,c),m.fx=t(m),m.fx<S.fx?M(m):M(S);else if(S.fx>=p[b-1].fx){let x=!1;if(S.fx>c.fx?(J(g,1+a,_,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(J(g,1-a*f,_,a*f,c),g.fx=t(g),g.fx<S.fx?M(g):x=!0),x){if(y>=1)break;for(let d=1;d<p.length;++d)J(p[d],1-y,p[0],y,p[d]),p[d].fx=t(p[d])}}else M(S)}return p.sort(E),{fx:p[0].fx,x:p[0]}}function ue(t,n,s,e,i,o,r){const l=s.fx,f=$(s.fxprime,n);let u=l,a=l,y=f,h=0;i=i||1,o=o||1e-6,r=r||.1;function b(p,M,E){for(let _=0;_<16;++_)if(i=(p+M)/2,J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||u>=E)M=i;else{if(Math.abs(y)<=-r*f)return i;y*(M-p)>=0&&(M=p),p=i,E=u}return 0}for(let p=0;p<10;++p){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||p&&u>=a)return b(h,i,a);if(Math.abs(y)<=-r*f)return i;if(y>=0)return b(i,h,u);a=u,h=i,i*=2}return i}function fe(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let r,l,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),r=e.fxprime.slice(),ft(r,e.fxprime,-1);for(let a=0;a<u;++a){if(f=ue(t,r,e,i,f),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),!f)ft(r,e.fxprime,-1);else{J(o,1,i.fxprime,-1,e.fxprime);const y=$(e.fxprime,e.fxprime),h=Math.max(0,$(o,i.fxprime)/y);J(r,h,r,-1,i.fxprime),l=e,e=i,i=l}if(ut(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),e}function At(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||xe,e=n.lossFunction||tt,i=he(t,n),o=s(i,n),r=Object.keys(o),l=[];for(const a of r)l.push(o[a].x),l.push(o[a].y);const u=zt(a=>{const y={};for(let h=0;h<r.length;++h){const b=r[h];y[b]={x:a[2*h],y:a[2*h+1],radius:o[b].radius}}return e(y,i)},l,n).x;for(let a=0;a<r.length;++a){const y=r[a];o[y].x=u[2*a],o[y].y=u[2*a+1]}return o}const Rt=1e-10;function ht(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):ce(e=>xt(t,n,e)-s,0,t+n)}function he(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const f of e)for(let u=0;u<f.sets.length;u++){const a=String(f.sets[u]);l.set(a,f.size+(l.get(a)||0));for(let y=u+1;y<f.sets.length;y++){const h=String(f.sets[y]),b=`${a};${h}`,p=`${h};${a}`;l.set(b,f.size+(l.get(b)||0)),l.set(p,f.size+(l.get(p)||0))}}for(const f of e)f.sets.length<3&&(f.size=l.get(i(f.sets)))}const o=[],r=new Set;for(const l of e)if(l.sets.length===1)o.push(l.sets[0]);else if(l.sets.length===2){const f=l.sets[0],u=l.sets[1];r.add(i(l.sets)),r.add(i([u,f]))}o.sort((l,f)=>l===f?0:l<f?-1:1);for(let l=0;l<o.length;++l){const f=o[l];for(let u=l+1;u<o.length;++u){const a=o[u];r.has(i([f,a]))||e.push({sets:[f,a],size:0})}}return e}function de(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(o=>o.sets.length===2).forEach(o=>{const r=s[o.sets[0]],l=s[o.sets[1]],f=Math.sqrt(n[r].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ht(f,u,o.size);e[r][l]=e[l][r]=a;let y=0;o.size+1e-10>=Math.min(n[r].size,n[l].size)?y=1:o.size<=1e-10&&(y=-1),i[r][l]=i[l][r]=y}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let o=0;o<n.length;++o)n[o]=0;let i=0;for(let o=0;o<s.length;++o){const r=t[2*o],l=t[2*o+1];for(let f=o+1;f<s.length;++f){const u=t[2*f],a=t[2*f+1],y=s[o][f],h=e[o][f],b=(u-r)*(u-r)+(a-l)*(a-l),p=Math.sqrt(b),M=b-y*y;h>0&&p<=y||h<0&&p>=y||(i+=2*M*M,n[2*o]+=4*M*(r-u),n[2*o+1]+=4*M*(l-a),n[2*f]+=4*M*(u-r),n[2*f+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=ye(t,n),o=e(i,t),r=e(s,t);o+1e-8<r&&(s=i)}return s}function ye(t,n={}){const s=n.restarts||10,e=[],i={};for(const h of t)h.sets.length===1&&(i[h.sets[0]]=e.length,e.push(h));let{distances:o,constraints:r}=de(t,e,i);const l=ut(o.map(ut))/o.length;o=o.map(h=>h.map(b=>b/l));const f=(h,b)=>ge(h,b,o,r);let u=null;for(let h=0;h<s;++h){const b=ct(o.length*2).map(Math.random),p=fe(f,b,n);(!u||p.fx<u.fx)&&(u=p)}const a=u.x,y={};for(let h=0;h<e.length;++h){const b=e[h];y[b.sets[0]]={x:a[2*h]*l,y:a[2*h+1]*l,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const h of n.history)ft(h.x,l);return y}function pe(t,n){const s=n&&n.lossFunction?n.lossFunction:tt,e={},i={};for(const y of t)if(y.sets.length===1){const h=y.sets[0];e[h]={x:1e10,y:1e10,rowid:e.length,size:y.size,radius:Math.sqrt(y.size/Math.PI)},i[h]=[]}t=t.filter(y=>y.sets.length===2);for(const y of t){let h=y.weight!=null?y.weight:1;const b=y.sets[0],p=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[p].size)&&(h=0),i[b].push({set:p,size:y.size,weight:h}),i[p].push({set:b,size:y.size,weight:h})}const o=[];Object.keys(i).forEach(y=>{let h=0;for(let b=0;b<i[y].length;++b)h+=i[y][b].size*i[y][b].weight;o.push({set:y,size:h})});function r(y,h){return h.size-y.size}o.sort(r);const l={};function f(y){return y.set in l}function u(y,h){e[h].x=y.x,e[h].y=y.y,l[h]=!0}u({x:0,y:0},o[0].set);for(let y=1;y<o.length;++y){const h=o[y].set,b=i[h].filter(f),p=e[h];if(b.sort(r),b.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var a=0;a<b.length;++a){const S=e[b[a].set],g=ht(p.radius,S.radius,b[a].size);M.push({x:S.x+g,y:S.y}),M.push({x:S.x-g,y:S.y}),M.push({y:S.y+g,x:S.x}),M.push({y:S.y-g,x:S.x});for(let m=a+1;m<b.length;++m){const v=e[b[m].set],c=ht(p.radius,v.radius,b[m].size),x=Tt({x:S.x,y:S.y,radius:g},{x:v.x,y:v.y,radius:c});M.push(...x)}}let E=1e50,_=M[0];for(const S of M){e[h].x=S.x,e[h].y=S.y;const g=s(e,t);g<E&&(E=g,_=S)}u(_,h)}return e}function tt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const r=t[e.sets[0]],l=t[e.sets[1]];i=xt(r.radius,l.radius,q(r,l))}else i=st(e.sets.map(r=>t[r]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function Dt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],f=t[e.sets[1]];i=xt(l.radius,f.radius,q(l,f))}else i=st(e.sets.map(l=>t[l]));const o=e.weight!=null?e.weight:1,r=Math.log((i+1)/(e.size+1));s+=o*r*r}return s}function me(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const r of t)r.x-=i,r.y-=o}if(t.length===2&&q(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),r=Math.sin(i);for(const l of t){const f=l.x,u=l.y;l.x=o*f-r*u,l.y=r*f+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const r of t){var e=(r.x+o*r.y)/(1+o*o);r.x=2*e-r.x,r.y=2*e*o-r.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const r=n(i),l=n(o);r.parent=l}for(let i=0;i<t.length;++i)for(let o=i+1;o<t.length;++o){const r=t[i].radius+t[o].radius;q(t[i],t[o])+1e-10<r&&s(t[o],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const o=n(t[i]).parent.setid;e.has(o)||e.set(o,[]),e.get(o).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,r)=>Math.max(o,r[s]+r.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,r)=>Math.min(o,r[s]-r.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Ct(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let o=e.bounds;const r=(o.xRange.max-o.xRange.min)/50;function l(u,a,y){if(!u)return;const h=u.bounds;let b,p;if(a)b=o.xRange.max-h.xRange.min+r;else{b=o.xRange.max-h.xRange.max;const M=(h.xRange.max-h.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)p=o.yRange.max-h.yRange.min+r;else{p=o.yRange.max-h.yRange.max;const M=(h.yRange.max-h.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(p+=M)}for(const M of u)M.x+=b,M.y+=p,e.push(M)}let f=1;for(;f<i.length;)l(i[f],!0,!1),l(i[f+1],!1,!0),l(i[f+2],!0,!0),f+=3,o=dt(e);return Ot(e)}function Nt(t,n,s,e,i){const o=Ft(t);n-=2*e,s-=2*e;const{xRange:r,yRange:l}=dt(o);if(r.max===r.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let f,u;if(i){const b=Math.sqrt(i/Math.PI)*2;f=n/b,u=s/b}else f=n/(r.max-r.min),u=s/(l.max-l.min);const a=Math.min(u,f),y=(n-(r.max-r.min)*a)/2,h=(s-(l.max-l.min)*a)/2;return Ot(o.map(b=>({radius:a*b.radius,x:e+y+(b.x-r.min)*a,y:e+h+(b.y-l.min)*a,setid:b.setid})))}function Ot(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,o=1e3,r=Math.PI/2,l=!0,f=null,u=!0,a=!0,y=null,h=null,b=!1,p=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},_=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(x){if(x in E)return E[x];var d=E[x]=_[S];return S+=1,S>=_.length&&(S=0),d},m=At,v=tt;function c(x){let d=x.datum();const D=new Set;d.forEach(I=>{I.size==0&&I.sets.length==1&&D.add(I.sets[0])}),d=d.filter(I=>!I.sets.some(F=>D.has(F)));let k={},C={};if(d.length>0){let I=m(d,{lossFunction:v,distinct:b});l&&(I=Ct(I,r,h)),k=Nt(I,s,e,i,f),C=Lt(k,d,M)}const U={};d.forEach(I=>{I.label&&(U[I.sets]=I.label)});function V(I){if(I.sets in U)return U[I.sets];if(I.sets.length==1)return""+I.sets[0]}x.selectAll("svg").data([k]).enter().append("svg");const O=x.select("svg");n?O.attr("viewBox",`0 0 ${s} ${e}`):O.attr("width",s).attr("height",e);const R={};let T=!1;O.selectAll(".venn-area path").each(function(I){const F=this.getAttribute("d");I.sets.length==1&&F&&!b&&(T=!0,R[I.sets[0]]=Me(F))});function A(I){return F=>{const H=I.sets.map(et=>{let Y=R[et],Z=k[et];return Y||(Y={x:s/2,y:e/2,radius:1}),Z||(Z={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-F)+Z.x*F,y:Y.y*(1-F)+Z.y*F,radius:Y.radius*(1-F)+Z.radius*F}});return St(H,p)}}const G=O.selectAll(".venn-area").data(d,I=>I.sets),P=G.enter().append("g").attr("class",I=>`venn-area venn-${I.sets.length==1?"circle":"intersection"}${I.colour||I.color?" venn-coloured":""}`).attr("data-venn-sets",I=>I.sets.join("_")),B=P.append("path"),L=P.append("text").attr("class","label").text(I=>V(I)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(B.style("fill-opacity","0").filter(I=>I.sets.length==1).style("fill",I=>I.colour?I.colour:I.color?I.color:g(I.sets)).style("fill-opacity",".25"),L.style("fill",I=>I.colour||I.color?"#FFF":t.textFill?t.textFill:I.sets.length==1?g(I.sets):"#444"));function K(I){return typeof I.transition=="function"?I.transition("venn").duration(o):I}let z=x;T&&typeof z.transition=="function"?(z=K(x),z.selectAll("path").attrTween("d",A)):z.selectAll("path").attr("d",I=>St(I.sets.map(F=>k[F])),p);const N=z.selectAll("text").filter(I=>I.sets in C).text(I=>V(I)).attr("x",I=>Math.floor(C[I.sets].x)).attr("y",I=>Math.floor(C[I.sets].y));u&&(T?"on"in N?N.on("end",rt(k,V)):N.each("end",rt(k,V)):N.each(rt(k,V)));const j=K(G.exit()).remove();typeof G.transition=="function"&&j.selectAll("path").attrTween("d",A);const X=j.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(L.style("font-size","0px"),N.style("font-size",y),X.style("font-size","0px")),{circles:k,textCentres:C,nodes:G,enter:P,update:z,exit:j}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(b=x,c):b},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(y=x,c):y},c.round=function(x){return arguments.length?(p=x,c):p},c.duration=function(x){return arguments.length?(o=x,c):o},c.layoutFunction=function(x){return arguments.length?(m=x,c):m},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(f=x,c):f},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(r=x,c):r},c.orientationOrder=function(x){return arguments.length?(h=x,c):h},c.lossFunction=function(x){return arguments.length?(v=x==="default"?tt:x==="logRatio"?Dt:x,c):v},c}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",r=o.split(/\s+/).reverse(),f=(o.length+r.length)/3;let u=r.pop(),a=[u],y=0;const h=1.1;e.textContent=null;const b=[];function p(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=p(u);for(;u=r.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>f&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=p(u),y++)}const E=.35-y*h/2,_=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",_),g.setAttribute("y",S),g.setAttribute("dy",`${E+m*h}em`)})}}function at(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i<n.length;++i){const o=n[i].radius-q(n[i],t);o<=e&&(e=o)}for(let i=0;i<s.length;++i){const o=q(s[i],t)-s[i].radius;o<=e&&(e=o)}return e}function jt(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],o=at(e[0],t,n);for(let a=1;a<e.length;++a){const y=at(e[a],t,n);y>=o&&(i=e[a],o=y)}const r=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:r[0],y:r[1]};let f=!0;for(const a of t)if(q(l,a)>a.radius){f=!1;break}for(const a of n)if(q(l,a)<a.radius){f=!1;break}if(f)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?jt(t,[]):Et(u.arcs.map(a=>a.p1))}function ke(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],o=t[i];for(let r=e+1;r<s.length;++r){const l=s[r],f=t[l],u=q(o,f);u+f.radius<=o.radius+1e-10?n[l].push(i):u+o.radius<=f.radius+1e-10&&n[i].push(l)}}return n}function Lt(t,n,s){const e={},i=ke(t);for(let o=0;o<n.length;++o){const r=n[o].sets,l={},f={};for(let h=0;h<r.length;++h){l[r[h]]=!0;const b=i[r[h]];for(let p=0;p<b.length;++p)f[b[p]]=!0}const u=[],a=[];for(let h in t)h in l?u.push(t[h]):h in f||a.push(t[h]);const y=jt(u,a,s);e[r]=y,y.disjoint&&n[o].size>0&&console.log("WARNING: area "+r+" not represented on screen")}return e}function Ie(t,n,s){const e=[];return e.push(`
1
+ import{aN as Wt,s as Kt,g as Ht,p as Yt,o as Xt,a as Zt,b as Jt,_ as w,z as wt,F as Qt,a4 as $t,S as te,T as ee,V as ne,d as se,q as ie,B as oe,D as re}from"./mermaid.core-D0YHAXWX.js";import{k as ot}from"./transform-YfG62m2h.js";import"./index-CKNeNsn1.js";import"./FilePreviewState-B5i6_Hbj.js";import"./workbench-live-service-Mn3Hb6LP.js";import"./mobile-dialog-return-service-szw78Fb_.js";import"./index-DZaMF5Cc.js";const It=(t,n)=>Wt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,o=0;const r=[];if(e.length>1){const l=Et(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let f=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];o+=(f.x+a.x)*(a.y-f.y);const y={x:(a.x+f.x)/2,y:(a.y+f.y)/2};let h=null;for(let b=0;b<a.parentIndex.length;++b)if(f.parentIndex.includes(a.parentIndex[b])){const p=t[a.parentIndex[b]],M=Math.atan2(a.x-p.x,a.y-p.y),E=Math.atan2(f.x-p.x,f.y-p.y);let _=E-M;_<0&&(_+=2*Math.PI);const S=E-_/2;let g=q(y,{x:p.x+p.radius*Math.sin(S),y:p.y+p.radius*Math.cos(S)});g>p.radius*2&&(g=p.radius*2),(h==null||h.width>g)&&(h={circle:p,width:g,p1:a,p2:f,large:g>p.radius,sweep:!0})}h!=null&&(r.push(h),i+=lt(h.circle.radius,h.width),f=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let f=!1;for(let u=0;u<t.length;++u)if(q(t[u],l)>Math.abs(l.radius-t[u].radius)){f=!0;break}f?i=o=0:(i=l.radius*l.radius*Math.PI,r.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=r,n.innerPoints=e,n.intersectionPoints=s),i+o}function ae(t,n){return n.every(s=>q(t,s)<s.radius+_t)}function le(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Tt(t[s],t[e]);for(const o of i)o.parentIndex=[s,e],n.push(o)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function q(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),r=Math.sqrt(e*e-o*o),l=t.x+o*(n.x-t.x)/s,f=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(r/s),a=-(n.x-t.x)*(r/s);return[{x:l+u,y:f-a},{x:l-u,y:f+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,r=t(n),l=t(s);let f=s-n;if(r*l>0)throw"Initial bisect points must have opposite signs";if(r===0)return n;if(l===0)return s;for(let u=0;u<i;++u){f/=2;const a=n+f,y=t(a);if(y*r>=0&&(n=a),Math.abs(f)<o||y===0)return a}return n+f}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function $(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt($(t,t))}function ft(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function J(t,n,s,e,i){for(let o=0;o<t.length;++o)t[o]=n*s[o]+e*i[o]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,o=s.zeroDelta||.001,r=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,f=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,y=s.sigma!==void 0?s.sigma:.5;let h;const b=n.length,p=new Array(b+1);p[0]=n,p[0].fx=t(n),p[0].id=0;for(let v=0;v<b;++v){const c=n.slice();c[v]=c[v]?c[v]*i:o,p[v+1]=c,p[v+1].fx=t(c),p[v+1].id=v+1}function M(v){for(let c=0;c<v.length;c++)p[b][c]=v[c];p[b].fx=v.fx}const E=(v,c)=>v.fx-c.fx,_=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v<e;++v){if(p.sort(E),s.history){const x=p.map(d=>{const D=d.slice();return D.fx=d.fx,D.id=d.id,D});x.sort((d,D)=>d.id-D.id),s.history.push({x:p[0].slice(),fx:p[0].fx,simplex:x})}h=0;for(let x=0;x<b;++x)h=Math.max(h,Math.abs(p[0][x]-p[1][x]));if(Math.abs(p[0].fx-p[b].fx)<r&&h<l)break;for(let x=0;x<b;++x){_[x]=0;for(let d=0;d<b;++d)_[x]+=p[d][x];_[x]/=b}const c=p[b];if(J(S,1+f,_,-f,c),S.fx=t(S),S.fx<p[0].fx)J(m,1+u,_,-u,c),m.fx=t(m),m.fx<S.fx?M(m):M(S);else if(S.fx>=p[b-1].fx){let x=!1;if(S.fx>c.fx?(J(g,1+a,_,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(J(g,1-a*f,_,a*f,c),g.fx=t(g),g.fx<S.fx?M(g):x=!0),x){if(y>=1)break;for(let d=1;d<p.length;++d)J(p[d],1-y,p[0],y,p[d]),p[d].fx=t(p[d])}}else M(S)}return p.sort(E),{fx:p[0].fx,x:p[0]}}function ue(t,n,s,e,i,o,r){const l=s.fx,f=$(s.fxprime,n);let u=l,a=l,y=f,h=0;i=i||1,o=o||1e-6,r=r||.1;function b(p,M,E){for(let _=0;_<16;++_)if(i=(p+M)/2,J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||u>=E)M=i;else{if(Math.abs(y)<=-r*f)return i;y*(M-p)>=0&&(M=p),p=i,E=u}return 0}for(let p=0;p<10;++p){if(J(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||p&&u>=a)return b(h,i,a);if(Math.abs(y)<=-r*f)return i;if(y>=0)return b(i,h,u);a=u,h=i,i*=2}return i}function fe(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let r,l,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),r=e.fxprime.slice(),ft(r,e.fxprime,-1);for(let a=0;a<u;++a){if(f=ue(t,r,e,i,f),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),!f)ft(r,e.fxprime,-1);else{J(o,1,i.fxprime,-1,e.fxprime);const y=$(e.fxprime,e.fxprime),h=Math.max(0,$(o,i.fxprime)/y);J(r,h,r,-1,i.fxprime),l=e,e=i,i=l}if(ut(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),e}function At(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||xe,e=n.lossFunction||tt,i=he(t,n),o=s(i,n),r=Object.keys(o),l=[];for(const a of r)l.push(o[a].x),l.push(o[a].y);const u=zt(a=>{const y={};for(let h=0;h<r.length;++h){const b=r[h];y[b]={x:a[2*h],y:a[2*h+1],radius:o[b].radius}}return e(y,i)},l,n).x;for(let a=0;a<r.length;++a){const y=r[a];o[y].x=u[2*a],o[y].y=u[2*a+1]}return o}const Rt=1e-10;function ht(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):ce(e=>xt(t,n,e)-s,0,t+n)}function he(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const f of e)for(let u=0;u<f.sets.length;u++){const a=String(f.sets[u]);l.set(a,f.size+(l.get(a)||0));for(let y=u+1;y<f.sets.length;y++){const h=String(f.sets[y]),b=`${a};${h}`,p=`${h};${a}`;l.set(b,f.size+(l.get(b)||0)),l.set(p,f.size+(l.get(p)||0))}}for(const f of e)f.sets.length<3&&(f.size=l.get(i(f.sets)))}const o=[],r=new Set;for(const l of e)if(l.sets.length===1)o.push(l.sets[0]);else if(l.sets.length===2){const f=l.sets[0],u=l.sets[1];r.add(i(l.sets)),r.add(i([u,f]))}o.sort((l,f)=>l===f?0:l<f?-1:1);for(let l=0;l<o.length;++l){const f=o[l];for(let u=l+1;u<o.length;++u){const a=o[u];r.has(i([f,a]))||e.push({sets:[f,a],size:0})}}return e}function de(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(o=>o.sets.length===2).forEach(o=>{const r=s[o.sets[0]],l=s[o.sets[1]],f=Math.sqrt(n[r].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ht(f,u,o.size);e[r][l]=e[l][r]=a;let y=0;o.size+1e-10>=Math.min(n[r].size,n[l].size)?y=1:o.size<=1e-10&&(y=-1),i[r][l]=i[l][r]=y}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let o=0;o<n.length;++o)n[o]=0;let i=0;for(let o=0;o<s.length;++o){const r=t[2*o],l=t[2*o+1];for(let f=o+1;f<s.length;++f){const u=t[2*f],a=t[2*f+1],y=s[o][f],h=e[o][f],b=(u-r)*(u-r)+(a-l)*(a-l),p=Math.sqrt(b),M=b-y*y;h>0&&p<=y||h<0&&p>=y||(i+=2*M*M,n[2*o]+=4*M*(r-u),n[2*o+1]+=4*M*(l-a),n[2*f]+=4*M*(u-r),n[2*f+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=ye(t,n),o=e(i,t),r=e(s,t);o+1e-8<r&&(s=i)}return s}function ye(t,n={}){const s=n.restarts||10,e=[],i={};for(const h of t)h.sets.length===1&&(i[h.sets[0]]=e.length,e.push(h));let{distances:o,constraints:r}=de(t,e,i);const l=ut(o.map(ut))/o.length;o=o.map(h=>h.map(b=>b/l));const f=(h,b)=>ge(h,b,o,r);let u=null;for(let h=0;h<s;++h){const b=ct(o.length*2).map(Math.random),p=fe(f,b,n);(!u||p.fx<u.fx)&&(u=p)}const a=u.x,y={};for(let h=0;h<e.length;++h){const b=e[h];y[b.sets[0]]={x:a[2*h]*l,y:a[2*h+1]*l,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const h of n.history)ft(h.x,l);return y}function pe(t,n){const s=n&&n.lossFunction?n.lossFunction:tt,e={},i={};for(const y of t)if(y.sets.length===1){const h=y.sets[0];e[h]={x:1e10,y:1e10,rowid:e.length,size:y.size,radius:Math.sqrt(y.size/Math.PI)},i[h]=[]}t=t.filter(y=>y.sets.length===2);for(const y of t){let h=y.weight!=null?y.weight:1;const b=y.sets[0],p=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[p].size)&&(h=0),i[b].push({set:p,size:y.size,weight:h}),i[p].push({set:b,size:y.size,weight:h})}const o=[];Object.keys(i).forEach(y=>{let h=0;for(let b=0;b<i[y].length;++b)h+=i[y][b].size*i[y][b].weight;o.push({set:y,size:h})});function r(y,h){return h.size-y.size}o.sort(r);const l={};function f(y){return y.set in l}function u(y,h){e[h].x=y.x,e[h].y=y.y,l[h]=!0}u({x:0,y:0},o[0].set);for(let y=1;y<o.length;++y){const h=o[y].set,b=i[h].filter(f),p=e[h];if(b.sort(r),b.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var a=0;a<b.length;++a){const S=e[b[a].set],g=ht(p.radius,S.radius,b[a].size);M.push({x:S.x+g,y:S.y}),M.push({x:S.x-g,y:S.y}),M.push({y:S.y+g,x:S.x}),M.push({y:S.y-g,x:S.x});for(let m=a+1;m<b.length;++m){const v=e[b[m].set],c=ht(p.radius,v.radius,b[m].size),x=Tt({x:S.x,y:S.y,radius:g},{x:v.x,y:v.y,radius:c});M.push(...x)}}let E=1e50,_=M[0];for(const S of M){e[h].x=S.x,e[h].y=S.y;const g=s(e,t);g<E&&(E=g,_=S)}u(_,h)}return e}function tt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const r=t[e.sets[0]],l=t[e.sets[1]];i=xt(r.radius,l.radius,q(r,l))}else i=st(e.sets.map(r=>t[r]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function Dt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],f=t[e.sets[1]];i=xt(l.radius,f.radius,q(l,f))}else i=st(e.sets.map(l=>t[l]));const o=e.weight!=null?e.weight:1,r=Math.log((i+1)/(e.size+1));s+=o*r*r}return s}function me(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const r of t)r.x-=i,r.y-=o}if(t.length===2&&q(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),r=Math.sin(i);for(const l of t){const f=l.x,u=l.y;l.x=o*f-r*u,l.y=r*f+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const r of t){var e=(r.x+o*r.y)/(1+o*o);r.x=2*e-r.x,r.y=2*e*o-r.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const r=n(i),l=n(o);r.parent=l}for(let i=0;i<t.length;++i)for(let o=i+1;o<t.length;++o){const r=t[i].radius+t[o].radius;q(t[i],t[o])+1e-10<r&&s(t[o],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const o=n(t[i]).parent.setid;e.has(o)||e.set(o,[]),e.get(o).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,r)=>Math.max(o,r[s]+r.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,r)=>Math.min(o,r[s]-r.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Ct(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let o=e.bounds;const r=(o.xRange.max-o.xRange.min)/50;function l(u,a,y){if(!u)return;const h=u.bounds;let b,p;if(a)b=o.xRange.max-h.xRange.min+r;else{b=o.xRange.max-h.xRange.max;const M=(h.xRange.max-h.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)p=o.yRange.max-h.yRange.min+r;else{p=o.yRange.max-h.yRange.max;const M=(h.yRange.max-h.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(p+=M)}for(const M of u)M.x+=b,M.y+=p,e.push(M)}let f=1;for(;f<i.length;)l(i[f],!0,!1),l(i[f+1],!1,!0),l(i[f+2],!0,!0),f+=3,o=dt(e);return Ot(e)}function Nt(t,n,s,e,i){const o=Ft(t);n-=2*e,s-=2*e;const{xRange:r,yRange:l}=dt(o);if(r.max===r.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let f,u;if(i){const b=Math.sqrt(i/Math.PI)*2;f=n/b,u=s/b}else f=n/(r.max-r.min),u=s/(l.max-l.min);const a=Math.min(u,f),y=(n-(r.max-r.min)*a)/2,h=(s-(l.max-l.min)*a)/2;return Ot(o.map(b=>({radius:a*b.radius,x:e+y+(b.x-r.min)*a,y:e+h+(b.y-l.min)*a,setid:b.setid})))}function Ot(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,o=1e3,r=Math.PI/2,l=!0,f=null,u=!0,a=!0,y=null,h=null,b=!1,p=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},_=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(x){if(x in E)return E[x];var d=E[x]=_[S];return S+=1,S>=_.length&&(S=0),d},m=At,v=tt;function c(x){let d=x.datum();const D=new Set;d.forEach(I=>{I.size==0&&I.sets.length==1&&D.add(I.sets[0])}),d=d.filter(I=>!I.sets.some(F=>D.has(F)));let k={},C={};if(d.length>0){let I=m(d,{lossFunction:v,distinct:b});l&&(I=Ct(I,r,h)),k=Nt(I,s,e,i,f),C=Lt(k,d,M)}const U={};d.forEach(I=>{I.label&&(U[I.sets]=I.label)});function V(I){if(I.sets in U)return U[I.sets];if(I.sets.length==1)return""+I.sets[0]}x.selectAll("svg").data([k]).enter().append("svg");const O=x.select("svg");n?O.attr("viewBox",`0 0 ${s} ${e}`):O.attr("width",s).attr("height",e);const R={};let T=!1;O.selectAll(".venn-area path").each(function(I){const F=this.getAttribute("d");I.sets.length==1&&F&&!b&&(T=!0,R[I.sets[0]]=Me(F))});function A(I){return F=>{const H=I.sets.map(et=>{let Y=R[et],Z=k[et];return Y||(Y={x:s/2,y:e/2,radius:1}),Z||(Z={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-F)+Z.x*F,y:Y.y*(1-F)+Z.y*F,radius:Y.radius*(1-F)+Z.radius*F}});return St(H,p)}}const G=O.selectAll(".venn-area").data(d,I=>I.sets),P=G.enter().append("g").attr("class",I=>`venn-area venn-${I.sets.length==1?"circle":"intersection"}${I.colour||I.color?" venn-coloured":""}`).attr("data-venn-sets",I=>I.sets.join("_")),B=P.append("path"),L=P.append("text").attr("class","label").text(I=>V(I)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(B.style("fill-opacity","0").filter(I=>I.sets.length==1).style("fill",I=>I.colour?I.colour:I.color?I.color:g(I.sets)).style("fill-opacity",".25"),L.style("fill",I=>I.colour||I.color?"#FFF":t.textFill?t.textFill:I.sets.length==1?g(I.sets):"#444"));function K(I){return typeof I.transition=="function"?I.transition("venn").duration(o):I}let z=x;T&&typeof z.transition=="function"?(z=K(x),z.selectAll("path").attrTween("d",A)):z.selectAll("path").attr("d",I=>St(I.sets.map(F=>k[F])),p);const N=z.selectAll("text").filter(I=>I.sets in C).text(I=>V(I)).attr("x",I=>Math.floor(C[I.sets].x)).attr("y",I=>Math.floor(C[I.sets].y));u&&(T?"on"in N?N.on("end",rt(k,V)):N.each("end",rt(k,V)):N.each(rt(k,V)));const j=K(G.exit()).remove();typeof G.transition=="function"&&j.selectAll("path").attrTween("d",A);const X=j.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(L.style("font-size","0px"),N.style("font-size",y),X.style("font-size","0px")),{circles:k,textCentres:C,nodes:G,enter:P,update:z,exit:j}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(b=x,c):b},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(y=x,c):y},c.round=function(x){return arguments.length?(p=x,c):p},c.duration=function(x){return arguments.length?(o=x,c):o},c.layoutFunction=function(x){return arguments.length?(m=x,c):m},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(f=x,c):f},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(r=x,c):r},c.orientationOrder=function(x){return arguments.length?(h=x,c):h},c.lossFunction=function(x){return arguments.length?(v=x==="default"?tt:x==="logRatio"?Dt:x,c):v},c}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",r=o.split(/\s+/).reverse(),f=(o.length+r.length)/3;let u=r.pop(),a=[u],y=0;const h=1.1;e.textContent=null;const b=[];function p(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=p(u);for(;u=r.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>f&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=p(u),y++)}const E=.35-y*h/2,_=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",_),g.setAttribute("y",S),g.setAttribute("dy",`${E+m*h}em`)})}}function at(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i<n.length;++i){const o=n[i].radius-q(n[i],t);o<=e&&(e=o)}for(let i=0;i<s.length;++i){const o=q(s[i],t)-s[i].radius;o<=e&&(e=o)}return e}function jt(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],o=at(e[0],t,n);for(let a=1;a<e.length;++a){const y=at(e[a],t,n);y>=o&&(i=e[a],o=y)}const r=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:r[0],y:r[1]};let f=!0;for(const a of t)if(q(l,a)>a.radius){f=!1;break}for(const a of n)if(q(l,a)<a.radius){f=!1;break}if(f)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?jt(t,[]):Et(u.arcs.map(a=>a.p1))}function ke(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],o=t[i];for(let r=e+1;r<s.length;++r){const l=s[r],f=t[l],u=q(o,f);u+f.radius<=o.radius+1e-10?n[l].push(i):u+o.radius<=f.radius+1e-10&&n[i].push(l)}}return n}function Lt(t,n,s){const e={},i=ke(t);for(let o=0;o<n.length;++o){const r=n[o].sets,l={},f={};for(let h=0;h<r.length;++h){l[r[h]]=!0;const b=i[r[h]];for(let p=0;p<b.length;++p)f[b[p]]=!0}const u=[],a=[];for(let h in t)h in l?u.push(t[h]):h in f||a.push(t[h]);const y=jt(u,a,s);e[r]=y,y.disjoint&&n[o].size>0&&console.log("WARNING: area "+r+" not represented on screen")}return e}function Ie(t,n,s){const e=[];return e.push(`
2
2
  M`,t,n),e.push(`
3
3
  m`,-s,0),e.push(`
4
4
  a`,s,s,0,1,0,s*2,0),e.push(`
@@ -31,4 +31,4 @@ Expecting `+Y.join(", ")+", got '"+(this.terminals_[z]||z)+"'":Z="Parse error on
31
31
  font-family: ${t.fontFamily};
32
32
  color: ${t.vennSetTextColor};
33
33
  }
34
- `,"getStyles"),Ve=Be;function qt(t){const n=new Map;for(const s of t){const e=s.targets.join("|"),i=n.get(e);i?Object.assign(i,s.styles):n.set(e,{...s.styles})}return n}w(qt,"buildStyleByKey");var qe=w((t,n,s,e)=>{const i=e.db,o=i.getConfig?.(),{themeVariables:r,look:l,handDrawnSeed:f}=wt(),u=l==="handDrawn",a=[r.venn1,r.venn2,r.venn3,r.venn4,r.venn5,r.venn6,r.venn7,r.venn8].filter(Boolean),y=i.getDiagramTitle?.(),h=i.getSubsetData(),b=i.getTextData(),p=qt(i.getStyleData()),M=Gt(h),E=o?.width??800,_=o?.height??450,g=E/1600,m=y?48*g:0,v=r.primaryTextColor??r.textColor,c=Qt(n);c.attr("viewBox",`0 0 ${E} ${_}`),y&&c.append("text").text(y).attr("class","venn-title").attr("font-size",`${32*g}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*g).style("fill",r.vennTitleTextColor||r.titleColor);const x=ot(document.createElement("div")),d=ve().width(E).height(_-m);x.datum(M).call(d);const D=u?$t.svg(x.select("svg").node()):void 0,k=Se(M,{width:E,height:_-m,padding:o?.padding??15}),C=new Map;for(const R of k){const T=Q([...R.data.sets].sort());C.set(T,R)}b.length>0&&Ut(o,C,x,b,g,p);const U=te(r.background||"#f4f4f4");x.selectAll(".venn-circle").each(function(R,T){const A=ot(this),P=Q([...R.sets].sort()),B=p.get(P),L=B?.fill||a[T%a.length]||r.primaryColor;A.classed(`venn-set-${T%8}`,!0);const K=B?.["fill-opacity"]??.1,z=B?.stroke||L,N=B?.["stroke-width"]||`${5*g}`;if(u&&D){const X=C.get(P);if(X&&X.circles.length>0){const I=X.circles[0],F=D.circle(I.x,I.y,I.radius*2,{roughness:.7,seed:f,fill:It(L,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+T*60,stroke:z,strokeWidth:parseFloat(String(N))});A.select("path").remove(),A.node()?.insertBefore(F,A.select("text").node())}}else A.select("path").style("fill",L).style("fill-opacity",K).style("stroke",z).style("stroke-width",N).style("stroke-opacity",.95);const j=B?.color||(U?ee(L,30):ne(L,30));A.select("text").style("font-size",`${48*g}px`).style("fill",j)}),u&&D?x.selectAll(".venn-intersection").each(function(R){const T=ot(this),G=Q([...R.sets].sort()),P=p.get(G),B=P?.fill;if(B){const L=T.select("path"),K=L.attr("d");if(K){const z=D.path(K,{roughness:.7,seed:f,fill:It(B,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),N=L.node();N?.parentNode?.insertBefore(z,N),L.remove()}}else T.select("path").style("fill-opacity",0);T.select("text").style("font-size",`${48*g}px`).style("fill",P?.color??r.vennSetTextColor??v)}):(x.selectAll(".venn-intersection text").style("font-size",`${48*g}px`).style("fill",R=>{const A=Q([...R.sets].sort());return p.get(A)?.color??r.vennSetTextColor??v}),x.selectAll(".venn-intersection path").style("fill-opacity",R=>{const A=Q([...R.sets].sort());return p.get(A)?.fill?1:0}).style("fill",R=>{const A=Q([...R.sets].sort());return p.get(A)?.fill??"transparent"}));const V=c.append("g").attr("transform",`translate(0, ${m})`),O=x.select("svg").node();if(O&&"childNodes"in O)for(const R of[...O.childNodes])V.node()?.appendChild(R);se(c,_,E,o?.useMaxWidth??!0)},"draw");function Q(t){return t.join("|")}w(Q,"stableSetsKey");function Ut(t,n,s,e,i,o){const r=t?.useDebugLayout??!1,f=s.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const a of e){const y=Q(a.sets),h=u.get(y);h?h.push(a):u.set(y,[a])}for(const[a,y]of u.entries()){const h=n.get(a);if(!h?.text)continue;const b=h.text.x,p=h.text.y,M=Math.min(...h.circles.map(O=>O.radius)),E=Math.min(...h.circles.map(O=>O.radius-Math.hypot(b-O.x,p-O.y)));let _=Number.isFinite(E)?Math.max(0,E):0;_===0&&Number.isFinite(M)&&(_=M*.6);const S=f.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);r&&S.append("circle").attr("class","venn-text-debug-circle").attr("cx",b).attr("cy",p).attr("r",_).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const g=Math.max(80*i,_*2*.95),m=Math.max(60*i,_*2*.95),x=(h.data.label&&h.data.label.length>0?Math.min(32*i,_*.25):0)+(y.length<=2?30*i:0),d=b-g/2,D=p-m/2+x,k=Math.max(1,Math.ceil(Math.sqrt(y.length))),C=Math.max(1,Math.ceil(y.length/k)),U=g/k,V=m/C;for(const[O,R]of y.entries()){const T=O%k,A=Math.floor(O/k),G=d+U*(T+.5),P=D+V*(A+.5);r&&S.append("rect").attr("class","venn-text-debug-cell").attr("x",d+U*T).attr("y",D+V*A).attr("width",U).attr("height",V).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const B=U*.9,L=V*.9,K=S.append("foreignObject").attr("class","venn-text-node-fo").attr("width",B).attr("height",L).attr("x",G-B/2).attr("y",P-L/2).attr("overflow","visible"),z=o.get(R.id)?.color,N=K.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(R.label??R.id);z&&N.style("color",z)}}}w(Ut,"renderTextNodes");function Gt(t){const n=new Set(t.map(i=>[...i.sets].sort().join("|"))),s=new Map(t.filter(i=>i.sets.length===1&&i.size!==void 0).map(i=>[i.sets[0],i.size])),e=[];for(const i of t){if(i.sets.length<3)continue;const o=[...i.sets].sort();for(let r=0;r<o.length-1;r++)for(let l=r+1;l<o.length;l++){const f=[o[r],o[l]],u=f.join("|");if(!n.has(u)){n.add(u);const a=s.get(f[0]),y=s.get(f[1]),h=a!==void 0&&y!==void 0?Math.min(a,y)/4:2.5;e.push({sets:f,size:h,label:""})}}}return e.length>0?[...t,...e]:t}w(Gt,"ensurePairwiseSubsets");var Ue={draw:qe},Ze={parser:we,db:Pe,renderer:Ue,styles:Ve};export{Ze as diagram};
34
+ `,"getStyles"),Ve=Be;function qt(t){const n=new Map;for(const s of t){const e=s.targets.join("|"),i=n.get(e);i?Object.assign(i,s.styles):n.set(e,{...s.styles})}return n}w(qt,"buildStyleByKey");var qe=w((t,n,s,e)=>{const i=e.db,o=i.getConfig?.(),{themeVariables:r,look:l,handDrawnSeed:f}=wt(),u=l==="handDrawn",a=[r.venn1,r.venn2,r.venn3,r.venn4,r.venn5,r.venn6,r.venn7,r.venn8].filter(Boolean),y=i.getDiagramTitle?.(),h=i.getSubsetData(),b=i.getTextData(),p=qt(i.getStyleData()),M=Gt(h),E=o?.width??800,_=o?.height??450,g=E/1600,m=y?48*g:0,v=r.primaryTextColor??r.textColor,c=Qt(n);c.attr("viewBox",`0 0 ${E} ${_}`),y&&c.append("text").text(y).attr("class","venn-title").attr("font-size",`${32*g}px`).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("x","50%").attr("y",32*g).style("fill",r.vennTitleTextColor||r.titleColor);const x=ot(document.createElement("div")),d=ve().width(E).height(_-m);x.datum(M).call(d);const D=u?$t.svg(x.select("svg").node()):void 0,k=Se(M,{width:E,height:_-m,padding:o?.padding??15}),C=new Map;for(const R of k){const T=Q([...R.data.sets].sort());C.set(T,R)}b.length>0&&Ut(o,C,x,b,g,p);const U=te(r.background||"#f4f4f4");x.selectAll(".venn-circle").each(function(R,T){const A=ot(this),P=Q([...R.sets].sort()),B=p.get(P),L=B?.fill||a[T%a.length]||r.primaryColor;A.classed(`venn-set-${T%8}`,!0);const K=B?.["fill-opacity"]??.1,z=B?.stroke||L,N=B?.["stroke-width"]||`${5*g}`;if(u&&D){const X=C.get(P);if(X&&X.circles.length>0){const I=X.circles[0],F=D.circle(I.x,I.y,I.radius*2,{roughness:.7,seed:f,fill:It(L,.7),fillStyle:"hachure",fillWeight:2,hachureGap:8,hachureAngle:-41+T*60,stroke:z,strokeWidth:parseFloat(String(N))});A.select("path").remove(),A.node()?.insertBefore(F,A.select("text").node())}}else A.select("path").style("fill",L).style("fill-opacity",K).style("stroke",z).style("stroke-width",N).style("stroke-opacity",.95);const j=B?.color||(U?ee(L,30):ne(L,30));A.select("text").style("font-size",`${48*g}px`).style("fill",j)}),u&&D?x.selectAll(".venn-intersection").each(function(R){const T=ot(this),G=Q([...R.sets].sort()),P=p.get(G),B=P?.fill;if(B){const L=T.select("path"),K=L.attr("d");if(K){const z=D.path(K,{roughness:.7,seed:f,fill:It(B,.3),fillStyle:"cross-hatch",fillWeight:2,hachureGap:6,hachureAngle:60,stroke:"none"}),N=L.node();N?.parentNode?.insertBefore(z,N),L.remove()}}else T.select("path").style("fill-opacity",0);T.select("text").style("font-size",`${48*g}px`).style("fill",P?.color??r.vennSetTextColor??v)}):(x.selectAll(".venn-intersection text").style("font-size",`${48*g}px`).style("fill",R=>{const A=Q([...R.sets].sort());return p.get(A)?.color??r.vennSetTextColor??v}),x.selectAll(".venn-intersection path").style("fill-opacity",R=>{const A=Q([...R.sets].sort());return p.get(A)?.fill?1:0}).style("fill",R=>{const A=Q([...R.sets].sort());return p.get(A)?.fill??"transparent"}));const V=c.append("g").attr("transform",`translate(0, ${m})`),O=x.select("svg").node();if(O&&"childNodes"in O)for(const R of[...O.childNodes])V.node()?.appendChild(R);se(c,_,E,o?.useMaxWidth??!0)},"draw");function Q(t){return t.join("|")}w(Q,"stableSetsKey");function Ut(t,n,s,e,i,o){const r=t?.useDebugLayout??!1,f=s.select("svg").append("g").attr("class","venn-text-nodes"),u=new Map;for(const a of e){const y=Q(a.sets),h=u.get(y);h?h.push(a):u.set(y,[a])}for(const[a,y]of u.entries()){const h=n.get(a);if(!h?.text)continue;const b=h.text.x,p=h.text.y,M=Math.min(...h.circles.map(O=>O.radius)),E=Math.min(...h.circles.map(O=>O.radius-Math.hypot(b-O.x,p-O.y)));let _=Number.isFinite(E)?Math.max(0,E):0;_===0&&Number.isFinite(M)&&(_=M*.6);const S=f.append("g").attr("class","venn-text-area").attr("font-size",`${40*i}px`);r&&S.append("circle").attr("class","venn-text-debug-circle").attr("cx",b).attr("cy",p).attr("r",_).attr("fill","none").attr("stroke","purple").attr("stroke-width",1.5*i).attr("stroke-dasharray",`${6*i} ${4*i}`);const g=Math.max(80*i,_*2*.95),m=Math.max(60*i,_*2*.95),x=(h.data.label&&h.data.label.length>0?Math.min(32*i,_*.25):0)+(y.length<=2?30*i:0),d=b-g/2,D=p-m/2+x,k=Math.max(1,Math.ceil(Math.sqrt(y.length))),C=Math.max(1,Math.ceil(y.length/k)),U=g/k,V=m/C;for(const[O,R]of y.entries()){const T=O%k,A=Math.floor(O/k),G=d+U*(T+.5),P=D+V*(A+.5);r&&S.append("rect").attr("class","venn-text-debug-cell").attr("x",d+U*T).attr("y",D+V*A).attr("width",U).attr("height",V).attr("fill","none").attr("stroke","teal").attr("stroke-width",1*i).attr("stroke-dasharray",`${4*i} ${3*i}`);const B=U*.9,L=V*.9,K=S.append("foreignObject").attr("class","venn-text-node-fo").attr("width",B).attr("height",L).attr("x",G-B/2).attr("y",P-L/2).attr("overflow","visible"),z=o.get(R.id)?.color,N=K.append("xhtml:span").attr("class","venn-text-node").style("display","flex").style("width","100%").style("height","100%").style("white-space","normal").style("align-items","center").style("justify-content","center").style("text-align","center").style("overflow-wrap","normal").style("word-break","normal").text(R.label??R.id);z&&N.style("color",z)}}}w(Ut,"renderTextNodes");function Gt(t){const n=new Set(t.map(i=>[...i.sets].sort().join("|"))),s=new Map(t.filter(i=>i.sets.length===1&&i.size!==void 0).map(i=>[i.sets[0],i.size])),e=[];for(const i of t){if(i.sets.length<3)continue;const o=[...i.sets].sort();for(let r=0;r<o.length-1;r++)for(let l=r+1;l<o.length;l++){const f=[o[r],o[l]],u=f.join("|");if(!n.has(u)){n.add(u);const a=s.get(f[0]),y=s.get(f[1]),h=a!==void 0&&y!==void 0?Math.min(a,y)/4:2.5;e.push({sets:f,size:h,label:""})}}}return e.length>0?[...t,...e]:t}w(Gt,"ensurePairwiseSubsets");var Ue={draw:qe},Je={parser:we,db:Pe,renderer:Ue,styles:Ve};export{Je as diagram};
@@ -1,4 +1,4 @@
1
- import{p as Mt}from"./chunk-JWPE2WC7-C7l8TuXz.js";import{s as Nt,g as zt,p as Lt,o as Tt,a as At,b as Xt,_ as u,H as Et,z as Yt,B as J,l as Q,F as It,d as Bt,q as Ft,c as V}from"./mermaid.core-C1A7sX2Q.js";import{p as Rt}from"./cynefin-OW5HDTMX-MPH1NFcC.js";import"./index-m-Vth8Lp.js";import"./FilePreviewState-pYNEkUjZ.js";import"./workbench-live-service-B89IkMyd.js";import"./mobile-dialog-return-service-8c0Hdszs.js";import"./transform-CXma_uU-.js";var G=u((o,r)=>{const e=o<=1?o*100:o;if(e<0||e>100)throw new Error(`${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`);return e},"toPercent"),A=u((o,r,e)=>({x:G(r,`${e} evolution`),y:G(o,`${e} visibility`)}),"toCoordinates"),K=u(o=>{if(o){if(o==="+<>")return"bidirectional";if(o==="+<")return"backward";if(o==="+>")return"forward"}},"getFlowFromPort"),Ot=u(o=>{if(!o?.startsWith("+"))return{};const e=/^\+'([^']*)'/.exec(o)?.[1];return o.includes("<>")?{flow:"bidirectional",label:e}:o.includes("<")?{flow:"backward",label:e}:o.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Wt=u((o,r)=>{if(Mt(o,r),o.size&&r.setSize(o.size.width,o.size.height),o.evolution){const e=o.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),h=o.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);r.updateAxes({stages:e,stageBoundaries:h})}if(o.anchors.forEach(e=>{const h=A(e.visibility,e.evolution,`Anchor "${e.name}"`);r.addNode(e.name,e.name,h.x,h.y,"anchor")}),o.components.forEach(e=>{const h=A(e.visibility,e.evolution,`Component "${e.name}"`),a=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,w=e.decorator?.strategy;r.addNode(e.name,e.name,h.x,h.y,"component",a,d,e.inertia,w)}),o.notes.forEach(e=>{const h=A(e.visibility,e.evolution,`Note "${e.text}"`);r.addNote(e.text,h.x,h.y)}),o.pipelines.forEach(e=>{const h=r.getNode(e.parent);if(!h||typeof h.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const a=h.y;r.startPipeline(e.parent),e.components.forEach(d=>{const w=`${e.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,R=G(d.evolution,`Pipeline component "${d.name}" evolution`);r.addNode(w,d.name,R,a,"pipeline-component",C,g),r.addPipelineComponent(e.parent,w)})}),o.links.forEach(e=>{const h=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let a=K(e.fromPort)??K(e.toPort);const{flow:d,label:w}=Ot(e.arrow);!a&&d&&(a=d);const C=e.linkLabel,g=w??C;r.addLink(r.resolveNodeId(e.from),r.resolveNodeId(e.to),h,g,a)}),o.evolves.forEach(e=>{const h=r.getNode(e.component);if(h?.y!==void 0){const a=G(e.target,`Evolve target for "${e.component}"`);r.addTrend(e.component,a,h.y)}}),o.annotations.length>0){const e=o.annotations[0],h=A(e.x,e.y,"Annotations box");r.setAnnotationsBox(h.x,h.y)}o.annotation.forEach(e=>{const h=A(e.x,e.y,`Annotation ${e.number}`);r.addAnnotation(e.number,[{x:h.x,y:h.y}],e.text)}),o.accelerators.forEach(e=>{const h=A(e.x,e.y,`Accelerator "${e.name}"`);r.addAccelerator(e.name,h.x,h.y)}),o.deaccelerators.forEach(e=>{const h=A(e.x,e.y,`Deaccelerator "${e.name}"`);r.addDeaccelerator(e.name,h.x,h.y)})},"populateDb"),tt={parser:{yy:void 0},parse:u(async o=>{const r=await Rt("wardley",o);Q.debug(r);const e=tt.parser?.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Wt(r,e)},"parse")},E,Dt=(E=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(r){const e=this.nodes.get(r.id)??{id:r.id,label:r.label},h={...e,...r,className:r.className??e.className,labelOffsetX:r.labelOffsetX??e.labelOffsetX,labelOffsetY:r.labelOffsetY??e.labelOffsetY};this.nodes.set(r.id,h)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});const e=this.nodes.get(r);e&&(e.isPipelineParent=!0)}addPipelineComponent(r,e){const h=this.pipelines.get(r);h&&h.componentIds.push(e);const a=this.nodes.get(e);a&&(a.inPipeline=!0)}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,e){this.annotationsBox={x:r,y:e}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,e){this.size={width:r,height:e}}getNode(r){return this.nodes.get(r)}resolveNodeId(r){if(this.nodes.has(r))return r;for(const[e,h]of this.nodes)if(h.label===r)return e;return r}build(){const r=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);r.push(e)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},u(E,"WardleyBuilder"),E),k=new Dt;function et(){return V()["wardley-beta"]}u(et,"getConfig");function at(o,r,e,h,a,d,w,C,g){k.addNode({id:o,label:r,x:e,y:h,className:a,labelOffsetX:d,labelOffsetY:w,inertia:C,sourceStrategy:g})}u(at,"addNode");function rt(o,r,e=!1,h,a){k.addLink({source:o,target:r,dashed:e,label:h,flow:a})}u(rt,"addLink");function ot(o,r,e){k.addTrend({nodeId:o,targetX:r,targetY:e})}u(ot,"addTrend");function nt(o,r,e){k.addAnnotation({number:o,coordinates:r,text:e})}u(nt,"addAnnotation");function st(o,r,e){k.addNote({text:o,x:r,y:e})}u(st,"addNote");function it(o,r,e){k.addAccelerator({name:o,x:r,y:e})}u(it,"addAccelerator");function dt(o,r,e){k.addDeaccelerator({name:o,x:r,y:e})}u(dt,"addDeaccelerator");function lt(o,r){k.setAnnotationsBox(o,r)}u(lt,"setAnnotationsBox");function ct(o,r){k.setSize(o,r)}u(ct,"setSize");function pt(o){k.startPipeline(o)}u(pt,"startPipeline");function ft(o,r){k.addPipelineComponent(o,r)}u(ft,"addPipelineComponent");function ht(o){k.setAxes(o)}u(ht,"updateAxes");function xt(o){return k.getNode(o)}u(xt,"getNode");function gt(o){return k.resolveNodeId(o)}u(gt,"resolveNodeId");function yt(){return k.build()}u(yt,"getWardleyData");function ut(){k.clear(),Ft()}u(ut,"clear");var Gt={getConfig:et,addNode:at,addLink:rt,addTrend:ot,addAnnotation:nt,addNote:st,addAccelerator:it,addDeaccelerator:dt,setAnnotationsBox:lt,setSize:ct,startPipeline:pt,addPipelineComponent:ft,updateAxes:ht,getNode:xt,resolveNodeId:gt,getWardleyData:yt,clear:ut,setAccTitle:Xt,getAccTitle:At,setDiagramTitle:Tt,getDiagramTitle:Lt,getAccDescription:zt,setAccDescription:Nt},qt=["Genesis","Custom Built","Product","Commodity"],Ht=u(()=>{const{themeVariables:o}=V();return{backgroundColor:o.wardley?.backgroundColor??o.background??"#fff",axisColor:o.wardley?.axisColor??"#000",axisTextColor:o.wardley?.axisTextColor??o.primaryTextColor??"#222",gridColor:o.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:o.wardley?.componentFill??"#fff",componentStroke:o.wardley?.componentStroke??"#000",componentLabelColor:o.wardley?.componentLabelColor??o.primaryTextColor??"#222",linkStroke:o.wardley?.linkStroke??"#000",evolutionStroke:o.wardley?.evolutionStroke??"#dc3545",annotationStroke:o.wardley?.annotationStroke??"#000",annotationTextColor:o.wardley?.annotationTextColor??o.primaryTextColor??"#222",annotationFill:o.wardley?.annotationFill??o.background??"#fff"}},"getTheme"),jt=u(()=>{const o=V()["wardley-beta"];return{width:o?.width??900,height:o?.height??600,padding:o?.padding??48,nodeRadius:o?.nodeRadius??6,nodeLabelOffset:o?.nodeLabelOffset??8,axisFontSize:o?.axisFontSize??12,labelFontSize:o?.labelFontSize??10,showGrid:o?.showGrid??!1,useMaxWidth:o?.useMaxWidth??!0}},"getConfigValues"),Vt=u((o,r,e,h)=>{Q.debug(`Rendering Wardley map
1
+ import{p as Mt}from"./chunk-JWPE2WC7-C0cCj49K.js";import{s as Nt,g as zt,p as Lt,o as Tt,a as At,b as Xt,_ as u,H as Et,z as Yt,B as J,l as Q,F as It,d as Bt,q as Ft,c as V}from"./mermaid.core-D0YHAXWX.js";import{p as Rt}from"./cynefin-OW5HDTMX-21CD-a02.js";import"./index-CKNeNsn1.js";import"./FilePreviewState-B5i6_Hbj.js";import"./workbench-live-service-Mn3Hb6LP.js";import"./mobile-dialog-return-service-szw78Fb_.js";import"./index-DZaMF5Cc.js";import"./transform-YfG62m2h.js";var G=u((o,r)=>{const e=o<=1?o*100:o;if(e<0||e>100)throw new Error(`${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`);return e},"toPercent"),A=u((o,r,e)=>({x:G(r,`${e} evolution`),y:G(o,`${e} visibility`)}),"toCoordinates"),K=u(o=>{if(o){if(o==="+<>")return"bidirectional";if(o==="+<")return"backward";if(o==="+>")return"forward"}},"getFlowFromPort"),Ot=u(o=>{if(!o?.startsWith("+"))return{};const e=/^\+'([^']*)'/.exec(o)?.[1];return o.includes("<>")?{flow:"bidirectional",label:e}:o.includes("<")?{flow:"backward",label:e}:o.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Wt=u((o,r)=>{if(Mt(o,r),o.size&&r.setSize(o.size.width,o.size.height),o.evolution){const e=o.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),h=o.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);r.updateAxes({stages:e,stageBoundaries:h})}if(o.anchors.forEach(e=>{const h=A(e.visibility,e.evolution,`Anchor "${e.name}"`);r.addNode(e.name,e.name,h.x,h.y,"anchor")}),o.components.forEach(e=>{const h=A(e.visibility,e.evolution,`Component "${e.name}"`),a=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,w=e.decorator?.strategy;r.addNode(e.name,e.name,h.x,h.y,"component",a,d,e.inertia,w)}),o.notes.forEach(e=>{const h=A(e.visibility,e.evolution,`Note "${e.text}"`);r.addNote(e.text,h.x,h.y)}),o.pipelines.forEach(e=>{const h=r.getNode(e.parent);if(!h||typeof h.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const a=h.y;r.startPipeline(e.parent),e.components.forEach(d=>{const w=`${e.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,R=G(d.evolution,`Pipeline component "${d.name}" evolution`);r.addNode(w,d.name,R,a,"pipeline-component",C,g),r.addPipelineComponent(e.parent,w)})}),o.links.forEach(e=>{const h=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let a=K(e.fromPort)??K(e.toPort);const{flow:d,label:w}=Ot(e.arrow);!a&&d&&(a=d);const C=e.linkLabel,g=w??C;r.addLink(r.resolveNodeId(e.from),r.resolveNodeId(e.to),h,g,a)}),o.evolves.forEach(e=>{const h=r.getNode(e.component);if(h?.y!==void 0){const a=G(e.target,`Evolve target for "${e.component}"`);r.addTrend(e.component,a,h.y)}}),o.annotations.length>0){const e=o.annotations[0],h=A(e.x,e.y,"Annotations box");r.setAnnotationsBox(h.x,h.y)}o.annotation.forEach(e=>{const h=A(e.x,e.y,`Annotation ${e.number}`);r.addAnnotation(e.number,[{x:h.x,y:h.y}],e.text)}),o.accelerators.forEach(e=>{const h=A(e.x,e.y,`Accelerator "${e.name}"`);r.addAccelerator(e.name,h.x,h.y)}),o.deaccelerators.forEach(e=>{const h=A(e.x,e.y,`Deaccelerator "${e.name}"`);r.addDeaccelerator(e.name,h.x,h.y)})},"populateDb"),tt={parser:{yy:void 0},parse:u(async o=>{const r=await Rt("wardley",o);Q.debug(r);const e=tt.parser?.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Wt(r,e)},"parse")},E,Dt=(E=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(r){const e=this.nodes.get(r.id)??{id:r.id,label:r.label},h={...e,...r,className:r.className??e.className,labelOffsetX:r.labelOffsetX??e.labelOffsetX,labelOffsetY:r.labelOffsetY??e.labelOffsetY};this.nodes.set(r.id,h)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});const e=this.nodes.get(r);e&&(e.isPipelineParent=!0)}addPipelineComponent(r,e){const h=this.pipelines.get(r);h&&h.componentIds.push(e);const a=this.nodes.get(e);a&&(a.inPipeline=!0)}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,e){this.annotationsBox={x:r,y:e}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,e){this.size={width:r,height:e}}getNode(r){return this.nodes.get(r)}resolveNodeId(r){if(this.nodes.has(r))return r;for(const[e,h]of this.nodes)if(h.label===r)return e;return r}build(){const r=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);r.push(e)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},u(E,"WardleyBuilder"),E),k=new Dt;function et(){return V()["wardley-beta"]}u(et,"getConfig");function at(o,r,e,h,a,d,w,C,g){k.addNode({id:o,label:r,x:e,y:h,className:a,labelOffsetX:d,labelOffsetY:w,inertia:C,sourceStrategy:g})}u(at,"addNode");function rt(o,r,e=!1,h,a){k.addLink({source:o,target:r,dashed:e,label:h,flow:a})}u(rt,"addLink");function ot(o,r,e){k.addTrend({nodeId:o,targetX:r,targetY:e})}u(ot,"addTrend");function nt(o,r,e){k.addAnnotation({number:o,coordinates:r,text:e})}u(nt,"addAnnotation");function st(o,r,e){k.addNote({text:o,x:r,y:e})}u(st,"addNote");function it(o,r,e){k.addAccelerator({name:o,x:r,y:e})}u(it,"addAccelerator");function dt(o,r,e){k.addDeaccelerator({name:o,x:r,y:e})}u(dt,"addDeaccelerator");function lt(o,r){k.setAnnotationsBox(o,r)}u(lt,"setAnnotationsBox");function ct(o,r){k.setSize(o,r)}u(ct,"setSize");function pt(o){k.startPipeline(o)}u(pt,"startPipeline");function ft(o,r){k.addPipelineComponent(o,r)}u(ft,"addPipelineComponent");function ht(o){k.setAxes(o)}u(ht,"updateAxes");function xt(o){return k.getNode(o)}u(xt,"getNode");function gt(o){return k.resolveNodeId(o)}u(gt,"resolveNodeId");function yt(){return k.build()}u(yt,"getWardleyData");function ut(){k.clear(),Ft()}u(ut,"clear");var Gt={getConfig:et,addNode:at,addLink:rt,addTrend:ot,addAnnotation:nt,addNote:st,addAccelerator:it,addDeaccelerator:dt,setAnnotationsBox:lt,setSize:ct,startPipeline:pt,addPipelineComponent:ft,updateAxes:ht,getNode:xt,resolveNodeId:gt,getWardleyData:yt,clear:ut,setAccTitle:Xt,getAccTitle:At,setDiagramTitle:Tt,getDiagramTitle:Lt,getAccDescription:zt,setAccDescription:Nt},qt=["Genesis","Custom Built","Product","Commodity"],Ht=u(()=>{const{themeVariables:o}=V();return{backgroundColor:o.wardley?.backgroundColor??o.background??"#fff",axisColor:o.wardley?.axisColor??"#000",axisTextColor:o.wardley?.axisTextColor??o.primaryTextColor??"#222",gridColor:o.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:o.wardley?.componentFill??"#fff",componentStroke:o.wardley?.componentStroke??"#000",componentLabelColor:o.wardley?.componentLabelColor??o.primaryTextColor??"#222",linkStroke:o.wardley?.linkStroke??"#000",evolutionStroke:o.wardley?.evolutionStroke??"#dc3545",annotationStroke:o.wardley?.annotationStroke??"#000",annotationTextColor:o.wardley?.annotationTextColor??o.primaryTextColor??"#222",annotationFill:o.wardley?.annotationFill??o.background??"#fff"}},"getTheme"),jt=u(()=>{const o=V()["wardley-beta"];return{width:o?.width??900,height:o?.height??600,padding:o?.padding??48,nodeRadius:o?.nodeRadius??6,nodeLabelOffset:o?.nodeLabelOffset??8,axisFontSize:o?.axisFontSize??12,labelFontSize:o?.labelFontSize??10,showGrid:o?.showGrid??!1,useMaxWidth:o?.useMaxWidth??!0}},"getConfigValues"),Vt=u((o,r,e,h)=>{Q.debug(`Rendering Wardley map
2
2
  `+o);const a=jt(),d=Ht(),w=a.nodeRadius*1.6,C=h.db,g=C.getWardleyData(),R=C.getDiagramTitle(),S=g.size?.width??a.width,b=g.size?.height??a.height,Y=It(r);Y.selectAll("*").remove(),Bt(Y,b,S,a.useMaxWidth),Y.attr("viewBox",`0 0 ${S} ${b}`);const v=Y.append("g").attr("class","wardley-map"),q=Y.append("defs");q.append("marker").attr("id",`arrow-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.evolutionStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-end-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-start-${r}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),v.append("rect").attr("class","wardley-background").attr("width",S).attr("height",b).attr("fill",d.backgroundColor);const I=S-a.padding*2,B=b-a.padding*2;R&&v.append("text").attr("class","wardley-title").attr("x",S/2).attr("y",a.padding/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(R);const z=u(t=>a.padding+t/100*I,"projectX"),L=u(t=>b-a.padding-t/100*B,"projectY"),O=v.append("g").attr("class","wardley-axes");O.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1),O.append("line").attr("x1",a.padding).attr("x2",a.padding).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const wt=g.axes.xLabel??"Evolution",mt=g.axes.yLabel??"Visibility";O.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",a.padding+I/2).attr("y",b-a.padding/4).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(wt),O.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",a.padding/3).attr("y",a.padding+B/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${a.padding/3} ${a.padding+B/2})`).text(mt);const F=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:qt;if(F.length>0){const t=v.append("g").attr("class","wardley-stages"),s=g.axes.stageBoundaries,n=[];if(s&&s.length===F.length){let i=0;s.forEach(p=>{n.push({start:i,end:p}),i=p})}else{const i=1/F.length;F.forEach((p,l)=>{n.push({start:l*i,end:(l+1)*i})})}F.forEach((i,p)=>{const l=n[p],f=a.padding+l.start*I,x=a.padding+l.end*I,y=(f+x)/2;p>0&&t.append("line").attr("x1",f).attr("x2",f).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",y).attr("y",b-a.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(a.showGrid){const t=v.append("g").attr("class","wardley-grid");for(let s=1;s<4;s++){const n=s/4,i=a.padding+I*n;t.append("line").attr("x1",i).attr("x2",i).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding-B*n).attr("y2",b-a.padding-B*n).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:z(t.x),y:L(t.y),node:t})}),g.pipelines.length>0){const t=v.append("g").attr("class","wardley-pipelines"),s=v.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(n=>{if(n.componentIds.length===0)return;const i=n.componentIds.map(x=>({id:x,pos:c.get(x),node:g.nodes.find(y=>y.id===x)})).filter(x=>x.pos&&x.node).sort((x,y)=>x.node.x-y.node.x);for(let x=0;x<i.length-1;x++){const y=i[x],m=i[x+1];s.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",y.pos.x).attr("y1",y.pos.y).attr("x2",m.pos.x).attr("y2",m.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let p=1/0,l=-1/0,f=0;if(n.componentIds.forEach(x=>{const y=c.get(x);y&&(p=Math.min(p,y.x),l=Math.max(l,y.x),f=y.y)}),p!==1/0&&l!==-1/0){const y=a.nodeRadius*4,m=f-y/2,P=c.get(n.nodeId);if(P){const N=(p+l)/2;P.x=N,P.y=m-w/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",p-15).attr("y",m).attr("width",l-p+30).attr("height",y).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=v.append("g").attr("class","wardley-links"),Z=new Map;g.pipelines.forEach(t=>{Z.set(t.nodeId,new Set(t.componentIds))});const U=g.links.filter(t=>!(!c.has(t.source)||!c.has(t.target)||Z.get(t.target)?.has(t.source)));_.selectAll("line").data(U).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.x+l/x*p}).attr("y1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.y+f/x*p}).attr("x2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.x+l/x*p}).attr("y2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.y+f/x*p}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${r})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${r})`:null),_.selectAll("text").data(U.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=n.y-s.y,l=n.x-s.x,f=Math.sqrt(l*l+p*p),x=8,y=p/f;return i+y*x}).attr("y",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.y+n.y)/2,p=n.x-s.x,l=n.y-s.y,f=Math.sqrt(p*p+l*l),x=8,y=-p/f;return i+y*x}).attr("fill",d.axisTextColor).attr("font-size",a.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=(s.y+n.y)/2,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f),y=8,m=f/x,P=-l/x,N=i+m*y,W=p+P*y;let X=Math.atan2(f,l)*180/Math.PI;return(X>90||X<-90)&&(X+=180),`rotate(${X} ${N} ${W})`}).text(t=>t.label);const kt=v.append("g").attr("class","wardley-trends"),bt=g.trends.map(t=>{const s=c.get(t.nodeId);if(!s)return null;const n=z(t.targetX),i=L(t.targetY),p=n-s.x,l=i-s.y,f=Math.sqrt(p*p+l*l),x=a.nodeRadius+2,y=f>x?n-p/f*x:n,m=f>x?i-l/f*x:i;return{origin:s,targetX:n,targetY:i,adjustedX2:y,adjustedY2:m}}).filter(t=>t!==null);kt.selectAll("line").data(bt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${r})`);const M=v.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));M.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const T=M.filter(t=>t.sourceStrategy==="market");T.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const H=a.nodeRadius*.7,$=a.nodeRadius*1.2;if(T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),M.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-w/2).attr("y",t=>c.get(t.id).y-w/2).attr("width",w).attr("height",w).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const s=c.get(t.id);let n=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y1",t=>{const s=c.get(t.id),n=t.isPipelineParent?w:a.nodeRadius*2;return s.y-n/2}).attr("x2",t=>{const s=c.get(t.id);let n=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y2",t=>{const s=c.get(t.id),n=t.isPipelineParent?w:a.nodeRadius*2;return s.y+n/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),M.append("text").attr("x",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?s.x+t.labelOffsetX:s.x;let n=a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(n+=10);const i=t.labelOffsetX??n;return s.x+i}).attr("y",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?s.y+t.labelOffsetY:s.y-3;let n=-a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(n-=10);const i=t.labelOffsetY??n;return s.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",a.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){const t=v.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(s=>{const n=s.coordinates.map(i=>({x:z(i.x),y:L(i.y)}));if(n.length>1)for(let i=0;i<n.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",n[i].x).attr("y1",n[i].y).attr("x2",n[i+1].x).attr("y2",n[i+1].y).attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");n.forEach(i=>{const p=t.append("g").attr("class","wardley-annotation");p.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),p.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.number)})}),g.annotationsBox){let s=z(g.annotationsBox.x),n=L(g.annotationsBox.y);const i=10,p=16,l=11,f=t.append("g").attr("class","wardley-annotations-box"),x=[...g.annotations].filter(m=>m.text).sort((m,P)=>m.number-P.number),y=[];if(x.forEach((m,P)=>{const N=f.append("text").attr("x",s+i).attr("y",n+i+(P+1)*p).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${m.number}. ${m.text}`);y.push(N)}),y.length>0){let m=0,P=0;y.forEach(j=>{const D=j.node(),Ct=D.getComputedTextLength();m=Math.max(m,Ct);const St=D.getBBox();P=Math.max(P,St.height)});const N=m+i*2+105,W=x.length*p+i*2+P/2,X=a.padding,$t=S-a.padding-N,vt=a.padding,Pt=b-a.padding-W;s=Math.max(X,Math.min(s,$t)),n=Math.max(vt,Math.min(n,Pt)),y.forEach((j,D)=>{j.attr("x",s+i).attr("y",n+i+(D+1)*p)}),f.insert("rect","text").attr("x",s).attr("y",n).attr("width",N).attr("height",W).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=v.append("g").attr("class","wardley-notes");g.notes.forEach(s=>{const n=z(s.x),i=L(s.y);t.append("text").attr("x",n).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.text)})}if(g.accelerators.length>0){const t=v.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(s=>{const n=z(s.x),i=L(s.y),p=60,l=30,f=20,x=`
3
3
  M ${n} ${i-l/2}
4
4
  L ${n+p-f} ${i-l/2}
@@ -75,4 +75,4 @@ import{p as Mt}from"./chunk-JWPE2WC7-C7l8TuXz.js";import{s as Nt,g as zt,p as Lt
75
75
  .wardley-notes text {
76
76
  fill: ${a.axisTextColor};
77
77
  }
78
- `},"styles"),ne={parser:tt,db:Gt,renderer:_t,styles:Zt};export{ne as diagram};
78
+ `},"styles"),se={parser:tt,db:Gt,renderer:_t,styles:Zt};export{se as diagram};
@@ -1 +1 @@
1
- import{aw as $,ax as P,ay as E,az as p,aA as y,aB as F,aC as Q,aD as X,aE as ee,aF as te,aG as re,aH as ne,a as se,aI as ie,aJ as oe,aK as ae,aL as ce,aM as de}from"./index-m-Vth8Lp.js";const W=32*1024,A=256*1024,_=1024,Se=4004,b=r=>Math.ceil(r/_)*_,T=new $(W),fe=P("type",[E({type:y("RELAY_AUTH"),nodeId:p().min(1).max(128),credential:p().min(1).max(1024),controlBinding:p().min(1).max(128)}).strict(),E({type:y("RELAY_READY")}).strict()]);function De(r){const{metadata:t,payload:n}=T.decode(r);if(n.byteLength!==0)throw new Error("NODE_RELAY_HANDSHAKE_INVALID");return fe.parse(t)}const I=F().int().min(1).max(4294967295),M=P("type",[E({type:y("OPEN"),streamId:I,kind:p().max(64).regex(/^[a-z][a-z0-9.-]*$/u),grant:p().min(1).max(2048)}).strict(),E({type:y("OPENED"),streamId:I}).strict(),E({type:y("DATA"),streamId:I}).strict(),E({type:y("WINDOW"),streamId:I,bytes:F().int().min(_).max(A).multipleOf(_)}).strict(),E({type:y("FIN"),streamId:I}).strict(),E({type:y("RESET"),streamId:I,code:p().max(96).regex(/^[A-Z][A-Z0-9_]*$/u)}).strict()]);function he(r){if(r.type==="DATA"){const{bytes:t,...n}=r;if(t.byteLength===0)throw new Error("NODE_STREAM_FRAME_INVALID");return T.encode(M.parse(n),t)}return T.encode(M.parse(r))}function ue(r){const{metadata:t,payload:n}=T.decode(r),e=M.parse(t);if(e.type==="DATA"){if(n.byteLength===0)throw new Error("NODE_STREAM_FRAME_INVALID");return{...e,bytes:n}}if(n.byteLength!==0)throw new Error("NODE_STREAM_FRAME_INVALID");return e}class k extends Error{code;constructor(t){super(t),this.code=t}}class le{id;send;release;#n=[];#s=Promise.withResolvers();#t=A;#o=A;#r=!1;#i=!1;#d=!1;#u=!1;#e;#a;#c;constructor(t,n,e){this.id=t,this.send=n,this.release=e}get finished(){return this.#s.promise}get failed(){return this.#e!==void 0}async write(t){if(this.#e!==void 0)throw this.#e;if(this.#i||this.#d)throw new Error("NODE_STREAM_WRITE_STATE");this.#d=!0;try{for(let n=0;n<t.length;){if(this.#e!==void 0)throw this.#e;if(this.#t===0&&(this.#c=Promise.withResolvers(),await this.#c.promise,this.#c=void 0),this.#e!==void 0)throw this.#e;const e=Math.min(t.length-n,this.#t,W);this.#t-=b(e),await this.#h({type:"DATA",streamId:this.id,bytes:t.subarray(n,n+e)}),n+=e}}finally{this.#d=!1}}async endWrite(){if(this.#e!==void 0)throw this.#e;if(!this.#i){if(this.#d)throw new Error("NODE_STREAM_WRITE_STATE");this.#i=!0,await this.#h({type:"FIN",streamId:this.id}),this.#r&&this.#f()}}close(){this.reset("NODE_STREAM_CANCELLED")}reset(t){this.#e!==void 0||this.#r&&this.#i||(this.fail(new k(t)),this.send({type:"RESET",streamId:this.id,code:t}).catch(()=>{}))}receive(t){switch(t.type){case"DATA":{const n=b(t.bytes.length);if(this.#r||n>this.#o){this.reset("NODE_STREAM_FLOW_INVALID");return}this.#o-=n,this.#n.push(t.bytes),this.#a?.resolve();return}case"WINDOW":if(this.#t+t.bytes>A){this.reset("NODE_STREAM_FLOW_INVALID");return}this.#t+=t.bytes,this.#c?.resolve();return;case"FIN":if(this.#r){this.reset("NODE_STREAM_STATE_INVALID");return}this.#r=!0,this.#a?.resolve(),this.#i&&this.#f();return;case"RESET":this.fail(new k(t.code))}}fail(t){this.#e===void 0&&(this.#e=t,this.#n.length=0,this.#a?.resolve(),this.#c?.resolve(),this.#f(t))}#f(t){this.release(t),this.#s.resolve()}async*[Symbol.asyncIterator](){if(this.#u)throw new Error("NODE_STREAM_READ_STATE");this.#u=!0;let t=!1;try{for(;;){if(this.#e!==void 0)throw this.#e;const n=this.#n.shift();if(n!==void 0){if(yield n,!this.#r&&this.#e===void 0){const e=b(n.length);this.#o+=e,await this.#h({type:"WINDOW",streamId:this.id,bytes:e})}}else if(this.#r){t=!0;return}else this.#a=Promise.withResolvers(),await this.#a.promise,this.#a=void 0}}finally{t||this.close()}}async#h(t){try{await this.send(t)}catch(n){const e=n instanceof Error?n:new Error("NODE_STREAM_DISCONNECTED");throw this.fail(e),e}}}class Ee{options;#n=new Map;#s=0;#t;constructor(t){this.options=t}get closed(){return this.#t!==void 0}async openStream(t,n){if(n?.throwIfAborted(),this.#t!==void 0)return;if(this.options.accept!==void 0)throw new Error("NODE_STREAM_DIRECTION_INVALID");if(this.#s===4294967295||this.#n.size>=this.options.maxStreams)throw new Error("NODE_STREAM_LIMIT");const e=++this.#s,a=this.#o(e),o=a.pending=Promise.withResolvers(),c=()=>a.stream.close();n?.addEventListener("abort",c,{once:!0}),this.#r({type:"OPEN",streamId:e,kind:t.kind,grant:t.grant}).catch(()=>a.stream.fail(new Error("NODE_STREAM_DISCONNECTED")));try{return await o.promise}finally{n?.removeEventListener("abort",c)}}receive(t){if(this.#t!==void 0)return;const n=ue(t);if(n.type==="OPEN"){const a=this.options.accept;if(a===void 0||n.streamId<=this.#s)throw new Error("NODE_STREAM_OPEN_INVALID");if(this.#s=n.streamId,this.#n.size>=this.options.maxStreams)this.#r({type:"RESET",streamId:n.streamId,code:"NODE_STREAM_LIMIT"}).catch(()=>{});else{const o=this.#o(n.streamId);o.scope=new AbortController,this.#i(n,o,o.scope.signal,a)}return}if(n.streamId>this.#s)throw new Error("NODE_STREAM_ID_INVALID");const e=this.#n.get(n.streamId);e!==void 0&&(n.type==="OPENED"&&e.pending!==void 0?(e.pending.resolve(e.stream),delete e.pending):n.type==="RESET"?e.stream.receive(n):n.type==="OPENED"||e.pending!==void 0||e.accepting?e.stream.reset("NODE_STREAM_STATE_INVALID"):e.stream.receive(n))}disconnect(){if(this.#t===void 0){this.#t=new Error("NODE_STREAM_DISCONNECTED");for(const{stream:t}of this.#n.values())t.fail(this.#t)}}#o(t){const n={stream:new le(t,e=>this.#r(e),e=>{this.#n.delete(t),e!==void 0&&(n.pending?.reject(e),n.scope?.abort(e))})};return this.#n.set(t,n),n}async#r(t){if(this.#t!==void 0)throw this.#t;await this.options.send(he(t))}async#i(t,n,e,a){n.accepting=!0;try{const o=await a({kind:t.kind,grant:t.grant},e);if(e.aborted)return;if(o===void 0){n.stream.reset("RESOURCE_DENIED");return}n.accepting=!1,await this.#r({type:"OPENED",streamId:t.streamId}),e.aborted||await o(n.stream,e)}catch{e.aborted||n.stream.reset("NODE_STREAM_HANDLER_FAILED")}}}const ge="mar-node-stream";function ve(r){return r.binaryType="arraybuffer",r.addEventListener("error",()=>r.close(),{once:!0}),{async send(t){r.send(t)},close:()=>r.close(),onMessage:t=>r.addEventListener("message",n=>t(n.data)),onClose:t=>r.addEventListener("close",t,{once:!0})}}function ye(r){const{carrier:t,accept:n}=r,e=new Ee({maxStreams:r.maxStreams,send:async c=>{try{await t.send(c)}catch(h){throw a(),h}},...n===void 0?{}:{accept:n}}),a=()=>{e.closed||(e.disconnect(),t.close())};return{path:{get closed(){return e.closed},close:a,openStream:(c,h)=>e.openStream(c,h)},receive(c){try{e.receive(c)}catch{a()}},disconnect:()=>e.disconnect()}}function Ae(r){const t=ye(r);return r.carrier.onClose(t.disconnect),r.carrier.onMessage(t.receive),t.path}async function _e(r,t,n,e,a){try{const o=await r(),c=()=>o.close();e.addEventListener("abort",c,{once:!0});try{e.throwIfAborted(),await we(o,t,n,e,a)}catch(h){throw o.close(),h}finally{e.removeEventListener("abort",c)}}catch(o){throw await t.abort().catch(()=>{}),o}}async function we(r,t,n,e,a){let o=0;for await(const c of r){if(e.throwIfAborted(),o+=c.byteLength,o>n)throw new Error("DIRECT_INTEGRITY_FAILED");await t.write(c),a?.(o)}if(e.throwIfAborted(),o!==n)throw new Error("DIRECT_INTEGRITY_FAILED");await t.close(),e.throwIfAborted(),await r.endWrite()}const O=8;async function*Ie(r){const t=new Uint8Array(O),n=new DataView(t.buffer);let e=0;for await(const a of r)for(let o=0;o<a.length;){const c=Math.min(O-e,a.length-o);if(t.set(a.subarray(o,o+c),e),e+=c,o+=c,e!==O)continue;const h=Number(n.getBigUint64(0));if(!Number.isSafeInteger(h))throw new Error("DIRECT_OFFSET_INVALID");e=0,yield h}if(e!==0)throw new Error("DIRECT_FRAME_INVALID")}async function Te(r,t,n,e,a){const o=()=>r.close();n.addEventListener("abort",o,{once:!0});try{n.throwIfAborted(),a?.(),await pe(r,t,n,e)}catch(c){throw r.close(),c}finally{n.removeEventListener("abort",o)}}async function pe(r,t,n,e){const a=Ie(r),o=await a.next();if(o.done||o.value>t.size)throw new Error("DIRECT_OFFSET_INVALID");let c=o.value;n.throwIfAborted(),e?.(c),await Promise.all([h(c),m()]);async function h(u){for(;u<t.size;){const f=Math.min(t.size,u+262144),w=await t.slice(u,f).arrayBuffer();n.throwIfAborted(),await r.write(new Uint8Array(w)),u=f}n.throwIfAborted(),await r.endWrite()}async function m(){for await(const u of a){if(n.throwIfAborted(),u<=c||u>t.size)throw new Error("DIRECT_OFFSET_INVALID");c=u,e?.(u)}if(c!==t.size)throw new Error("DIRECT_INTEGRITY_FAILED")}}const me=1e4;function Re(r){const t=new Map,n=new Set;let e,a,o=500,c=!1,h,m,u=!1;const f=se(!1);let w,D,x=0;const N=new Map;function g(){D!==void 0&&clearInterval(D),D=void 0,N.clear()}function L(){if(e===void 0||e.readyState!==WebSocket.OPEN)return;if(N.size>0){C();return}const i=String(++x);N.set(i,performance.now()),e.send(JSON.stringify({type:"ping",id:i}))}function V(){g(),L(),D=setInterval(L,me)}function B(){const i=new URL(r.endpoint?.()??"/api/workbench/live",window.location.origin);return i.protocol=i.protocol==="https:"?"wss:":"ws:",i.toString()}function U(){}function z(){if(f.value)return Promise.resolve(!0);if(w===void 0){let i;w={promise:new Promise(l=>{i=l}),resolve:i}}return w.promise}function v(i){const s=w;w=void 0,s?.resolve(i)}function Y(i){if(typeof i!="object"||i===null||Array.isArray(i))return;const s=i;if(s.type==="workbench.ready"&&typeof s.workbenchConnectionId=="string"&&typeof s.workbenchResumeToken=="string"){r.diagnostics?.setConnectionState("connected"),h=s.workbenchConnectionId,m=s.workbenchResumeToken;const d=s.resumed===!0;f.value=!0,r.onReady?.(h,d),v(!0),u&&r.onConnectionRestored?.(d),u&&d&&r.onReconnect(),u=!1,V();return}if(s.type==="pong"&&typeof s.id=="string"){const d=N.get(s.id);d!==void 0&&(N.delete(s.id),r.diagnostics?.setPingLatency?.(performance.now()-d));return}if(s.type==="watch.event"&&s.event!==void 0){r.onWatchEvent?.(s.event);return}if(s.type==="browser.response"){const d=ie.safeParse(s);d.success?r.onBrowserMessage?.(d.data):r.onInvalidMessage();return}if(typeof s.type=="string"&&s.type.startsWith("direct.")){const d=oe.safeParse(s);if(!d.success){r.onInvalidMessage();return}r.onDirectMessage?.(d.data);return}if(typeof s.type=="string"&&s.type.startsWith("terminal.direct.")){const d=ae.safeParse(s);if(!d.success){r.onInvalidMessage();return}r.onTerminalDirectMessage?.(d.data);return}if(typeof s.type=="string"&&s.type.startsWith("desktop.direct.")){const d=ce.safeParse(s);d.success?r.onDesktopDirectMessage?.(d.data):r.onInvalidMessage();return}if(typeof s.type=="string"&&s.type.startsWith("desktop.relay.")){const d=de.safeParse(s);d.success?r.onDesktopRelayMessage?.(d.data):r.onInvalidMessage();return}if(r.onNotificationMessage?.(s))return;if(s.type==="resync-required"&&typeof s.nodeId=="string"){r.diagnostics?.resetActiveRuns(),t.delete(s.nodeId),r.onResyncRequired(s.nodeId);return}if(s.type==="node.upgrade"&&typeof s.nodeId=="string"){r.onNodeUpgrade?.(s.nodeId,s.snapshot);return}if(s.type==="node"&&typeof s.nodeId=="string"&&typeof s.connected=="boolean"){let d=!1;s.connected?n.delete(s.nodeId)&&(t.delete(s.nodeId),d=!0):(n.add(s.nodeId),t.delete(s.nodeId)),r.onNodeConnection(s.nodeId,s.connected),s.reason==="CONNECTION_REPLACED"&&(r.diagnostics?.resetActiveRuns(),t.delete(s.nodeId),r.onNodeReplaced(s.nodeId),d=!0),d&&r.onResyncRequired(s.nodeId);return}if(s.type!=="event"||typeof s.event!="object"||s.event===null)return;const l=s.event;if(typeof l.nodeId!="string"||!Number.isInteger(l.sequence)||typeof l.category!="string")return;const S=l.sequence;S<=(t.get(l.nodeId)??0)||(t.set(l.nodeId,S),r.onEvent(l))}function R(){if(!r.canConnect()||e!==void 0)return;r.diagnostics?.setConnectionState("connecting");const i=new WebSocket(B());e=i,i.addEventListener("open",()=>{if(e!==i)return;const s=c;c=!0,o=500,t.clear(),u=s,f.value=!1,i.send(JSON.stringify({type:"resume",...h===void 0?{}:{workbenchConnectionId:h},...m===void 0?{}:{workbenchResumeToken:m}}))}),i.addEventListener("message",s=>{if(e!==i)return;const l=performance.now(),S=String(s.data);let d;try{d=JSON.parse(S),Y(d)}catch{r.onInvalidMessage()}finally{r.diagnostics?.observeFrame({contentLength:S.length,durationMs:performance.now()-l,message:d})}}),i.addEventListener("close",s=>{if(e===i){if(e=void 0,f.value=!1,g(),r.diagnostics?.setConnectionState("disconnected"),s.code===4001&&s.reason==="UNAUTHENTICATED"){v(!1),r.onUnauthenticated(),r.onDisconnected?.();return}if(r.onDisconnected?.(),!r.canConnect()){v(!1);return}a=setTimeout(()=>{a=void 0,R()},o),o=Math.min(o*2,3e4)}})}function H(){a!==void 0&&clearTimeout(a),a=void 0;const i=e;e=void 0,f.value=!1,v(!1),g(),r.diagnostics?.setConnectionState("disconnected"),i?.close(1e3,"PAGE_CLOSED")}function C(){if(!r.canConnect())return;a!==void 0&&clearTimeout(a),a=void 0;const i=e;e=void 0,f.value=!1,g(),r.diagnostics?.setConnectionState("connecting"),i?.close(4e3,"PAGE_VISIBLE_RECONNECT"),R()}function J(i){const s=ne.safeParse(i);return!s.success||!f.value||e===void 0||e.readyState!==WebSocket.OPEN?!1:(e.send(JSON.stringify(s.data)),!0)}function q(i){const s=re.safeParse(i);return!s.success||!f.value||e?.readyState!==WebSocket.OPEN?!1:(e.send(JSON.stringify(s.data)),!0)}function G(i){const s=te.safeParse(i);return!s.success||!f.value||e===void 0||e.readyState!==WebSocket.OPEN?!1:(e.send(JSON.stringify(s.data)),!0)}function j(i){const s=ee.safeParse(i);return!s.success||!f.value||e?.readyState!==WebSocket.OPEN?!1:(e.send(JSON.stringify(s.data)),!0)}function K(i){const s=X.safeParse(i);return!s.success||!f.value||e?.readyState!==WebSocket.OPEN?!1:(e.send(JSON.stringify(s.data)),!0)}function Z(i){f.value&&e?.readyState===WebSocket.OPEN&&e.send(JSON.stringify({type:"session-share.visitor",visitor:i}))}return{connected:Q(f),waitForReady:z,restore:U,connect:R,reconnect:C,close:H,sendDirect:J,sendBrowser:q,sendTerminalDirect:G,sendDesktopDirect:j,sendDesktopRelay:K,updateShareVisitor:Z}}export{ge as N,ve as a,Ae as b,Re as c,k as d,_e as e,De as f,ye as g,Se as h,Te as i,we as r,pe as s};
1
+ import{ay as $,az as P,aA as E,aB as p,aC as y,aD as F,aE as Q,aF as X,aG as ee,aH as te,aI as re,aJ as ne,a as se,aK as ie,aL as oe,aM as ae,aN as ce,aO as de}from"./index-CKNeNsn1.js";const W=32*1024,A=256*1024,_=1024,Se=4004,b=r=>Math.ceil(r/_)*_,T=new $(W),fe=P("type",[E({type:y("RELAY_AUTH"),nodeId:p().min(1).max(128),credential:p().min(1).max(1024),controlBinding:p().min(1).max(128)}).strict(),E({type:y("RELAY_READY")}).strict()]);function De(r){const{metadata:t,payload:n}=T.decode(r);if(n.byteLength!==0)throw new Error("NODE_RELAY_HANDSHAKE_INVALID");return fe.parse(t)}const I=F().int().min(1).max(4294967295),M=P("type",[E({type:y("OPEN"),streamId:I,kind:p().max(64).regex(/^[a-z][a-z0-9.-]*$/u),grant:p().min(1).max(2048)}).strict(),E({type:y("OPENED"),streamId:I}).strict(),E({type:y("DATA"),streamId:I}).strict(),E({type:y("WINDOW"),streamId:I,bytes:F().int().min(_).max(A).multipleOf(_)}).strict(),E({type:y("FIN"),streamId:I}).strict(),E({type:y("RESET"),streamId:I,code:p().max(96).regex(/^[A-Z][A-Z0-9_]*$/u)}).strict()]);function he(r){if(r.type==="DATA"){const{bytes:t,...n}=r;if(t.byteLength===0)throw new Error("NODE_STREAM_FRAME_INVALID");return T.encode(M.parse(n),t)}return T.encode(M.parse(r))}function ue(r){const{metadata:t,payload:n}=T.decode(r),e=M.parse(t);if(e.type==="DATA"){if(n.byteLength===0)throw new Error("NODE_STREAM_FRAME_INVALID");return{...e,bytes:n}}if(n.byteLength!==0)throw new Error("NODE_STREAM_FRAME_INVALID");return e}class k extends Error{code;constructor(t){super(t),this.code=t}}class le{id;send;release;#n=[];#s=Promise.withResolvers();#t=A;#o=A;#r=!1;#i=!1;#d=!1;#u=!1;#e;#a;#c;constructor(t,n,e){this.id=t,this.send=n,this.release=e}get finished(){return this.#s.promise}get failed(){return this.#e!==void 0}async write(t){if(this.#e!==void 0)throw this.#e;if(this.#i||this.#d)throw new Error("NODE_STREAM_WRITE_STATE");this.#d=!0;try{for(let n=0;n<t.length;){if(this.#e!==void 0)throw this.#e;if(this.#t===0&&(this.#c=Promise.withResolvers(),await this.#c.promise,this.#c=void 0),this.#e!==void 0)throw this.#e;const e=Math.min(t.length-n,this.#t,W);this.#t-=b(e),await this.#h({type:"DATA",streamId:this.id,bytes:t.subarray(n,n+e)}),n+=e}}finally{this.#d=!1}}async endWrite(){if(this.#e!==void 0)throw this.#e;if(!this.#i){if(this.#d)throw new Error("NODE_STREAM_WRITE_STATE");this.#i=!0,await this.#h({type:"FIN",streamId:this.id}),this.#r&&this.#f()}}close(){this.reset("NODE_STREAM_CANCELLED")}reset(t){this.#e!==void 0||this.#r&&this.#i||(this.fail(new k(t)),this.send({type:"RESET",streamId:this.id,code:t}).catch(()=>{}))}receive(t){switch(t.type){case"DATA":{const n=b(t.bytes.length);if(this.#r||n>this.#o){this.reset("NODE_STREAM_FLOW_INVALID");return}this.#o-=n,this.#n.push(t.bytes),this.#a?.resolve();return}case"WINDOW":if(this.#t+t.bytes>A){this.reset("NODE_STREAM_FLOW_INVALID");return}this.#t+=t.bytes,this.#c?.resolve();return;case"FIN":if(this.#r){this.reset("NODE_STREAM_STATE_INVALID");return}this.#r=!0,this.#a?.resolve(),this.#i&&this.#f();return;case"RESET":this.fail(new k(t.code))}}fail(t){this.#e===void 0&&(this.#e=t,this.#n.length=0,this.#a?.resolve(),this.#c?.resolve(),this.#f(t))}#f(t){this.release(t),this.#s.resolve()}async*[Symbol.asyncIterator](){if(this.#u)throw new Error("NODE_STREAM_READ_STATE");this.#u=!0;let t=!1;try{for(;;){if(this.#e!==void 0)throw this.#e;const n=this.#n.shift();if(n!==void 0){if(yield n,!this.#r&&this.#e===void 0){const e=b(n.length);this.#o+=e,await this.#h({type:"WINDOW",streamId:this.id,bytes:e})}}else if(this.#r){t=!0;return}else this.#a=Promise.withResolvers(),await this.#a.promise,this.#a=void 0}}finally{t||this.close()}}async#h(t){try{await this.send(t)}catch(n){const e=n instanceof Error?n:new Error("NODE_STREAM_DISCONNECTED");throw this.fail(e),e}}}class Ee{options;#n=new Map;#s=0;#t;constructor(t){this.options=t}get closed(){return this.#t!==void 0}async openStream(t,n){if(n?.throwIfAborted(),this.#t!==void 0)return;if(this.options.accept!==void 0)throw new Error("NODE_STREAM_DIRECTION_INVALID");if(this.#s===4294967295||this.#n.size>=this.options.maxStreams)throw new Error("NODE_STREAM_LIMIT");const e=++this.#s,a=this.#o(e),o=a.pending=Promise.withResolvers(),c=()=>a.stream.close();n?.addEventListener("abort",c,{once:!0}),this.#r({type:"OPEN",streamId:e,kind:t.kind,grant:t.grant}).catch(()=>a.stream.fail(new Error("NODE_STREAM_DISCONNECTED")));try{return await o.promise}finally{n?.removeEventListener("abort",c)}}receive(t){if(this.#t!==void 0)return;const n=ue(t);if(n.type==="OPEN"){const a=this.options.accept;if(a===void 0||n.streamId<=this.#s)throw new Error("NODE_STREAM_OPEN_INVALID");if(this.#s=n.streamId,this.#n.size>=this.options.maxStreams)this.#r({type:"RESET",streamId:n.streamId,code:"NODE_STREAM_LIMIT"}).catch(()=>{});else{const o=this.#o(n.streamId);o.scope=new AbortController,this.#i(n,o,o.scope.signal,a)}return}if(n.streamId>this.#s)throw new Error("NODE_STREAM_ID_INVALID");const e=this.#n.get(n.streamId);e!==void 0&&(n.type==="OPENED"&&e.pending!==void 0?(e.pending.resolve(e.stream),delete e.pending):n.type==="RESET"?e.stream.receive(n):n.type==="OPENED"||e.pending!==void 0||e.accepting?e.stream.reset("NODE_STREAM_STATE_INVALID"):e.stream.receive(n))}disconnect(){if(this.#t===void 0){this.#t=new Error("NODE_STREAM_DISCONNECTED");for(const{stream:t}of this.#n.values())t.fail(this.#t)}}#o(t){const n={stream:new le(t,e=>this.#r(e),e=>{this.#n.delete(t),e!==void 0&&(n.pending?.reject(e),n.scope?.abort(e))})};return this.#n.set(t,n),n}async#r(t){if(this.#t!==void 0)throw this.#t;await this.options.send(he(t))}async#i(t,n,e,a){n.accepting=!0;try{const o=await a({kind:t.kind,grant:t.grant},e);if(e.aborted)return;if(o===void 0){n.stream.reset("RESOURCE_DENIED");return}n.accepting=!1,await this.#r({type:"OPENED",streamId:t.streamId}),e.aborted||await o(n.stream,e)}catch{e.aborted||n.stream.reset("NODE_STREAM_HANDLER_FAILED")}}}const ge="mar-node-stream";function ve(r){return r.binaryType="arraybuffer",r.addEventListener("error",()=>r.close(),{once:!0}),{async send(t){r.send(t)},close:()=>r.close(),onMessage:t=>r.addEventListener("message",n=>t(n.data)),onClose:t=>r.addEventListener("close",t,{once:!0})}}function ye(r){const{carrier:t,accept:n}=r,e=new Ee({maxStreams:r.maxStreams,send:async c=>{try{await t.send(c)}catch(h){throw a(),h}},...n===void 0?{}:{accept:n}}),a=()=>{e.closed||(e.disconnect(),t.close())};return{path:{get closed(){return e.closed},close:a,openStream:(c,h)=>e.openStream(c,h)},receive(c){try{e.receive(c)}catch{a()}},disconnect:()=>e.disconnect()}}function Ae(r){const t=ye(r);return r.carrier.onClose(t.disconnect),r.carrier.onMessage(t.receive),t.path}async function _e(r,t,n,e,a){try{const o=await r(),c=()=>o.close();e.addEventListener("abort",c,{once:!0});try{e.throwIfAborted(),await we(o,t,n,e,a)}catch(h){throw o.close(),h}finally{e.removeEventListener("abort",c)}}catch(o){throw await t.abort().catch(()=>{}),o}}async function we(r,t,n,e,a){let o=0;for await(const c of r){if(e.throwIfAborted(),o+=c.byteLength,o>n)throw new Error("DIRECT_INTEGRITY_FAILED");await t.write(c),a?.(o)}if(e.throwIfAborted(),o!==n)throw new Error("DIRECT_INTEGRITY_FAILED");await t.close(),e.throwIfAborted(),await r.endWrite()}const O=8;async function*Ie(r){const t=new Uint8Array(O),n=new DataView(t.buffer);let e=0;for await(const a of r)for(let o=0;o<a.length;){const c=Math.min(O-e,a.length-o);if(t.set(a.subarray(o,o+c),e),e+=c,o+=c,e!==O)continue;const h=Number(n.getBigUint64(0));if(!Number.isSafeInteger(h))throw new Error("DIRECT_OFFSET_INVALID");e=0,yield h}if(e!==0)throw new Error("DIRECT_FRAME_INVALID")}async function Te(r,t,n,e,a){const o=()=>r.close();n.addEventListener("abort",o,{once:!0});try{n.throwIfAborted(),a?.(),await pe(r,t,n,e)}catch(c){throw r.close(),c}finally{n.removeEventListener("abort",o)}}async function pe(r,t,n,e){const a=Ie(r),o=await a.next();if(o.done||o.value>t.size)throw new Error("DIRECT_OFFSET_INVALID");let c=o.value;n.throwIfAborted(),e?.(c),await Promise.all([h(c),m()]);async function h(u){for(;u<t.size;){const f=Math.min(t.size,u+262144),w=await t.slice(u,f).arrayBuffer();n.throwIfAborted(),await r.write(new Uint8Array(w)),u=f}n.throwIfAborted(),await r.endWrite()}async function m(){for await(const u of a){if(n.throwIfAborted(),u<=c||u>t.size)throw new Error("DIRECT_OFFSET_INVALID");c=u,e?.(u)}if(c!==t.size)throw new Error("DIRECT_INTEGRITY_FAILED")}}const me=1e4;function Re(r){const t=new Map,n=new Set;let e,a,o=500,c=!1,h,m,u=!1;const f=se(!1);let w,D,x=0;const N=new Map;function g(){D!==void 0&&clearInterval(D),D=void 0,N.clear()}function L(){if(e===void 0||e.readyState!==WebSocket.OPEN)return;if(N.size>0){C();return}const i=String(++x);N.set(i,performance.now()),e.send(JSON.stringify({type:"ping",id:i}))}function V(){g(),L(),D=setInterval(L,me)}function B(){const i=new URL(r.endpoint?.()??"/api/workbench/live",window.location.origin);return i.protocol=i.protocol==="https:"?"wss:":"ws:",i.toString()}function U(){}function z(){if(f.value)return Promise.resolve(!0);if(w===void 0){let i;w={promise:new Promise(l=>{i=l}),resolve:i}}return w.promise}function v(i){const s=w;w=void 0,s?.resolve(i)}function Y(i){if(typeof i!="object"||i===null||Array.isArray(i))return;const s=i;if(s.type==="workbench.ready"&&typeof s.workbenchConnectionId=="string"&&typeof s.workbenchResumeToken=="string"){r.diagnostics?.setConnectionState("connected"),h=s.workbenchConnectionId,m=s.workbenchResumeToken;const d=s.resumed===!0;f.value=!0,r.onReady?.(h,d),v(!0),u&&r.onConnectionRestored?.(d),u&&d&&r.onReconnect(),u=!1,V();return}if(s.type==="pong"&&typeof s.id=="string"){const d=N.get(s.id);d!==void 0&&(N.delete(s.id),r.diagnostics?.setPingLatency?.(performance.now()-d));return}if(s.type==="watch.event"&&s.event!==void 0){r.onWatchEvent?.(s.event);return}if(s.type==="browser.response"){const d=ie.safeParse(s);d.success?r.onBrowserMessage?.(d.data):r.onInvalidMessage();return}if(typeof s.type=="string"&&s.type.startsWith("direct.")){const d=oe.safeParse(s);if(!d.success){r.onInvalidMessage();return}r.onDirectMessage?.(d.data);return}if(typeof s.type=="string"&&s.type.startsWith("terminal.direct.")){const d=ae.safeParse(s);if(!d.success){r.onInvalidMessage();return}r.onTerminalDirectMessage?.(d.data);return}if(typeof s.type=="string"&&s.type.startsWith("desktop.direct.")){const d=ce.safeParse(s);d.success?r.onDesktopDirectMessage?.(d.data):r.onInvalidMessage();return}if(typeof s.type=="string"&&s.type.startsWith("desktop.relay.")){const d=de.safeParse(s);d.success?r.onDesktopRelayMessage?.(d.data):r.onInvalidMessage();return}if(r.onNotificationMessage?.(s))return;if(s.type==="resync-required"&&typeof s.nodeId=="string"){r.diagnostics?.resetActiveRuns(),t.delete(s.nodeId),r.onResyncRequired(s.nodeId);return}if(s.type==="node.upgrade"&&typeof s.nodeId=="string"){r.onNodeUpgrade?.(s.nodeId,s.snapshot);return}if(s.type==="node"&&typeof s.nodeId=="string"&&typeof s.connected=="boolean"){let d=!1;s.connected?n.delete(s.nodeId)&&(t.delete(s.nodeId),d=!0):(n.add(s.nodeId),t.delete(s.nodeId)),r.onNodeConnection(s.nodeId,s.connected),s.reason==="CONNECTION_REPLACED"&&(r.diagnostics?.resetActiveRuns(),t.delete(s.nodeId),r.onNodeReplaced(s.nodeId),d=!0),d&&r.onResyncRequired(s.nodeId);return}if(s.type!=="event"||typeof s.event!="object"||s.event===null)return;const l=s.event;if(typeof l.nodeId!="string"||!Number.isInteger(l.sequence)||typeof l.category!="string")return;const S=l.sequence;S<=(t.get(l.nodeId)??0)||(t.set(l.nodeId,S),r.onEvent(l))}function R(){if(!r.canConnect()||e!==void 0)return;r.diagnostics?.setConnectionState("connecting");const i=new WebSocket(B());e=i,i.addEventListener("open",()=>{if(e!==i)return;const s=c;c=!0,o=500,t.clear(),u=s,f.value=!1,i.send(JSON.stringify({type:"resume",...h===void 0?{}:{workbenchConnectionId:h},...m===void 0?{}:{workbenchResumeToken:m}}))}),i.addEventListener("message",s=>{if(e!==i)return;const l=performance.now(),S=String(s.data);let d;try{d=JSON.parse(S),Y(d)}catch{r.onInvalidMessage()}finally{r.diagnostics?.observeFrame({contentLength:S.length,durationMs:performance.now()-l,message:d})}}),i.addEventListener("close",s=>{if(e===i){if(e=void 0,f.value=!1,g(),r.diagnostics?.setConnectionState("disconnected"),s.code===4001&&s.reason==="UNAUTHENTICATED"){v(!1),r.onUnauthenticated(),r.onDisconnected?.();return}if(r.onDisconnected?.(),!r.canConnect()){v(!1);return}a=setTimeout(()=>{a=void 0,R()},o),o=Math.min(o*2,3e4)}})}function H(){a!==void 0&&clearTimeout(a),a=void 0;const i=e;e=void 0,f.value=!1,v(!1),g(),r.diagnostics?.setConnectionState("disconnected"),i?.close(1e3,"PAGE_CLOSED")}function C(){if(!r.canConnect())return;a!==void 0&&clearTimeout(a),a=void 0;const i=e;e=void 0,f.value=!1,g(),r.diagnostics?.setConnectionState("connecting"),i?.close(4e3,"PAGE_VISIBLE_RECONNECT"),R()}function J(i){const s=ne.safeParse(i);return!s.success||!f.value||e===void 0||e.readyState!==WebSocket.OPEN?!1:(e.send(JSON.stringify(s.data)),!0)}function q(i){const s=re.safeParse(i);return!s.success||!f.value||e?.readyState!==WebSocket.OPEN?!1:(e.send(JSON.stringify(s.data)),!0)}function G(i){const s=te.safeParse(i);return!s.success||!f.value||e===void 0||e.readyState!==WebSocket.OPEN?!1:(e.send(JSON.stringify(s.data)),!0)}function j(i){const s=ee.safeParse(i);return!s.success||!f.value||e?.readyState!==WebSocket.OPEN?!1:(e.send(JSON.stringify(s.data)),!0)}function K(i){const s=X.safeParse(i);return!s.success||!f.value||e?.readyState!==WebSocket.OPEN?!1:(e.send(JSON.stringify(s.data)),!0)}function Z(i){f.value&&e?.readyState===WebSocket.OPEN&&e.send(JSON.stringify({type:"session-share.visitor",visitor:i}))}return{connected:Q(f),waitForReady:z,restore:U,connect:R,reconnect:C,close:H,sendDirect:J,sendBrowser:q,sendTerminalDirect:G,sendDesktopDirect:j,sendDesktopRelay:K,updateShareVisitor:Z}}export{ge as N,ve as a,Ae as b,Re as c,k as d,_e as e,De as f,ye as g,Se as h,Te as i,we as r,pe as s};