@inkeep/open-knowledge 0.36.0-beta.13 → 0.36.0-beta.15

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 (343) hide show
  1. package/dist/{acp-harness-probe-BDFEqzUe.mjs → acp-harness-probe-Bnvb7ua4.mjs} +2 -2
  2. package/dist/assets/skills/discovery/SKILL.md +1 -1
  3. package/dist/assets/skills/project/SKILL.md +1 -1
  4. package/dist/cli.mjs +18 -18
  5. package/dist/constants-BrGdVPKq.mjs +2 -0
  6. package/dist/{fs-traced-DamTBe_K.mjs → fs-traced-BISd_YTv.mjs} +2 -2
  7. package/dist/fs-traced-Bs45d5A7.mjs +1 -0
  8. package/dist/git-handle-CXXBHz9N.mjs +1 -0
  9. package/dist/{git-handle-BNHoFrny.mjs → git-handle-Dp8hOAlv.mjs} +2 -2
  10. package/dist/index.mjs +1 -1
  11. package/dist/init-3QFJUy8t.mjs +1 -0
  12. package/dist/{init-Ci5EIZrx.mjs → init-C3jpGOYs.mjs} +36 -36
  13. package/dist/{launch-json-removal-DVIXh_iU.mjs → launch-json-removal-CCAXFA3I.mjs} +2 -2
  14. package/dist/{loader-DI9EEepK.mjs → loader-CfKl2x_G.mjs} +2 -2
  15. package/dist/loader-D3A2BZ8z.mjs +1 -0
  16. package/dist/{logger-CKwqZfxD.mjs → logger-CFNLuVy2.mjs} +2 -2
  17. package/dist/{open-browser-DGOoelb3.mjs → open-browser-Dx3Crg67.mjs} +2 -2
  18. package/dist/preview-ChCmRCBi.mjs +1 -0
  19. package/dist/{preview-Bj8bprAP.mjs → preview-DPZgu98f.mjs} +2 -2
  20. package/dist/public/assets/{ActivityModeContent-Cgqa56C2.js → ActivityModeContent-qrbfN_hT.js} +1 -1
  21. package/dist/public/assets/{AgentDiffPane-BnvGYsRG.js → AgentDiffPane-Cvfawhbk.js} +2 -2
  22. package/dist/public/assets/{AgentThreadClientBinder-Dzf4FbOU.js → AgentThreadClientBinder-bJx9SPAk.js} +1 -1
  23. package/dist/public/assets/{CodeMirrorPropInput-Cx9FW420.js → CodeMirrorPropInput-FVyKUYn4.js} +3 -3
  24. package/dist/public/assets/{ConsentDialogBody-BBNmWOXY.js → ConsentDialogBody-BBq760Wj.js} +1 -1
  25. package/dist/public/assets/{CopyButton-QEk6fd73.js → CopyButton-qbOI-WUC.js} +1 -1
  26. package/dist/public/assets/{DocumentContext-Dog3N-Wc.js → DocumentContext-CqohW6HK.js} +11 -11
  27. package/dist/public/assets/{EnableSyncConfirmDialog-DtYm7V_O.js → EnableSyncConfirmDialog-CcgSvQ6A.js} +1 -1
  28. package/dist/public/assets/FeedbackForm-DBvah19I.js +1 -0
  29. package/dist/public/assets/{GraphPanel-CvqA9xnU.js → GraphPanel-Mjv-X5q3.js} +1 -1
  30. package/dist/public/assets/{ManagedArtifactProperties-67a94DaU.js → ManagedArtifactProperties-Bo2SKCvD.js} +1 -1
  31. package/dist/public/assets/{McpConsentDialogBody-KLslh1LR.js → McpConsentDialogBody-CHwk8X9A.js} +1 -1
  32. package/dist/public/assets/{MermaidDocEditor-DH7WRAfL.js → MermaidDocEditor-Lc_wkeTk.js} +1 -1
  33. package/dist/public/assets/{PropertyPanel-BoKsESSi.js → PropertyPanel-CWk7Owsh.js} +2 -2
  34. package/dist/public/assets/{RegisteredAgentIcon-DlQ6ljJ9.js → RegisteredAgentIcon-C0f9xsZD.js} +1 -1
  35. package/dist/public/assets/ReportBugDialogBody-CK-DnyaL.js +2 -0
  36. package/dist/public/assets/SettingsDialogBody-ze-PiYXj.js +7 -0
  37. package/dist/public/assets/{ShareBranchSwitchDialog-l3OatXNl.js → ShareBranchSwitchDialog-DpaA3c73.js} +1 -1
  38. package/dist/public/assets/{ShareReceiveDialog-DuvJdcqg.js → ShareReceiveDialog-YFTm0V7j.js} +1 -1
  39. package/dist/public/assets/{ShareReceiveMissDialog-DLNWM2Pm.js → ShareReceiveMissDialog-BKohygIN.js} +1 -1
  40. package/dist/public/assets/{SkillEditorActions-B5cWxK9p.js → SkillEditorActions-NFgoTzth.js} +1 -1
  41. package/dist/public/assets/{SourceEditor-yoaSx3d8.js → SourceEditor-SkmtOPTX.js} +1 -1
  42. package/dist/public/assets/{TerminalPanel-D3vyvoTf.js → TerminalPanel-Cnb9VX0H.js} +1 -1
  43. package/dist/public/assets/{TerminalSessionsHost-D500Eh7g.js → TerminalSessionsHost-CvmeW7ge.js} +2 -2
  44. package/dist/public/assets/{TerminalWindowApp-aWCNBKLz.js → TerminalWindowApp-ffE-YlAF.js} +1 -1
  45. package/dist/public/assets/ThreadView-CPK3cy1g.js +4 -0
  46. package/dist/public/assets/{TimelineDiffPane-B7O4osuT.js → TimelineDiffPane-C0-96_f4.js} +2 -2
  47. package/dist/public/assets/{abnfDiagram-VRR7QNED-AQQppE-0.js → abnfDiagram-VRR7QNED-Duddj45o.js} +1 -1
  48. package/dist/public/assets/{agent-diff-store-DuUxJBjU.js → agent-diff-store-FqhWnB1D.js} +1 -1
  49. package/dist/public/assets/{agent-visibility-D2Mr5Jzk.js → agent-visibility-DBtc7Shk.js} +1 -1
  50. package/dist/public/assets/{arc-fffho335.js → arc-fumooNjA.js} +1 -1
  51. package/dist/public/assets/architecture-TIHT7OUA-B1GVwxkr.js +1 -0
  52. package/dist/public/assets/{architectureDiagram-ZJ3FMSHR-B495PosD.js → architectureDiagram-ZJ3FMSHR-BrsCDGuM.js} +1 -1
  53. package/dist/public/assets/auth-state-cache-B1bVTqEC.js +11 -0
  54. package/dist/public/assets/{blockDiagram-677ZJIJ3-RlMmF5eE.js → blockDiagram-677ZJIJ3-Bk7LRKYe.js} +1 -1
  55. package/dist/public/assets/{c4Diagram-LMCZKHZV-BykmMrJC.js → c4Diagram-LMCZKHZV-DAutbVAH.js} +1 -1
  56. package/dist/public/assets/{calendar-BcVXRcqj.js → calendar-B7N9zcYm.js} +1 -1
  57. package/dist/public/assets/channel-CGxczyb8.js +1 -0
  58. package/dist/public/assets/chunk-2Q5K7J3B-bH6Oyzw8.js +1 -0
  59. package/dist/public/assets/{chunk-32BRIVSS-BnShc_MN.js → chunk-32BRIVSS-DX1ynr3d.js} +1 -1
  60. package/dist/public/assets/{chunk-52WLFC77-CAqzDxN8.js → chunk-52WLFC77-BNU-NZPu.js} +1 -1
  61. package/dist/public/assets/{chunk-5FCAYU7R-DJD80l2g.js → chunk-5FCAYU7R-BZbSx9vA.js} +1 -1
  62. package/dist/public/assets/{chunk-5HE753X5-MIm0xzdx.js → chunk-5HE753X5-B2Flc7i4.js} +1 -1
  63. package/dist/public/assets/{chunk-5JV3BV7I-BDOEjZuf.js → chunk-5JV3BV7I-B6P7lOib.js} +1 -1
  64. package/dist/public/assets/{chunk-5TONJI2A-bScr_YUR.js → chunk-5TONJI2A-Bx2IxKM5.js} +1 -1
  65. package/dist/public/assets/{chunk-5VM5RSS4-Bs94kGRI.js → chunk-5VM5RSS4-CBRY9PuO.js} +1 -1
  66. package/dist/public/assets/{chunk-7BUUIJ7U-CwRX8pNw.js → chunk-7BUUIJ7U-DZTqq57u.js} +1 -1
  67. package/dist/public/assets/{chunk-BIQX33UG-BNCF8otP.js → chunk-BIQX33UG-BK09YW6f.js} +1 -1
  68. package/dist/public/assets/{chunk-BO2N2NFS-DqBCaVoN.js → chunk-BO2N2NFS-BPDRSPns.js} +3 -3
  69. package/dist/public/assets/{chunk-C7G6YPKG-DiEZYczS.js → chunk-C7G6YPKG-Bdrc0gou.js} +1 -1
  70. package/dist/public/assets/{chunk-CQNSW5MT-Dmr8HJLl.js → chunk-CQNSW5MT-BAtlNSBX.js} +1 -1
  71. package/dist/public/assets/{chunk-CYSBUYHQ-Csbe9fna.js → chunk-CYSBUYHQ-D8hsDORv.js} +1 -1
  72. package/dist/public/assets/{chunk-EMLP6XTP-DDMkBd0U.js → chunk-EMLP6XTP-ChQSYJxh.js} +1 -1
  73. package/dist/public/assets/{chunk-EX3LRPZG-cQgQ_qMi.js → chunk-EX3LRPZG-D3UtyaOq.js} +1 -1
  74. package/dist/public/assets/{chunk-FWX5IMBZ-CycPJPIw.js → chunk-FWX5IMBZ-Cm5B2p1m.js} +2 -2
  75. package/dist/public/assets/{chunk-HOUHSVGY-CzmtdbDE.js → chunk-HOUHSVGY-BE3Sb9uV.js} +1 -1
  76. package/dist/public/assets/{chunk-ICXQ74PX-KggQe_uj.js → chunk-ICXQ74PX-BpNEoAVh.js} +1 -1
  77. package/dist/public/assets/{chunk-JG7HCLWE-CTmM6IgF.js → chunk-JG7HCLWE-Biog_J3i.js} +1 -1
  78. package/dist/public/assets/{chunk-JWPE2WC7-hvMh92rM.js → chunk-JWPE2WC7-BgE53Vu-.js} +1 -1
  79. package/dist/public/assets/{chunk-MOJQB5TN-CEvxZH1g.js → chunk-MOJQB5TN-cvLW-l3m.js} +1 -1
  80. package/dist/public/assets/{chunk-MOZMSUNE-By7aES38.js → chunk-MOZMSUNE-CPb1eEls.js} +1 -1
  81. package/dist/public/assets/{chunk-OGEWGWER-BdUJLKJ4.js → chunk-OGEWGWER-DX8HZf6i.js} +1 -1
  82. package/dist/public/assets/{chunk-OSBZ3O6U-BxW58z2v.js → chunk-OSBZ3O6U-DLOl9lpV.js} +1 -1
  83. package/dist/public/assets/{chunk-PUDLZKDR-Bcf4-42x.js → chunk-PUDLZKDR-3P-xc6dG.js} +1 -1
  84. package/dist/public/assets/{chunk-Q4XR5HBZ-Cv4eUXId.js → chunk-Q4XR5HBZ-Bcm3Q652.js} +1 -1
  85. package/dist/public/assets/{chunk-QBLGF6JB-DohMxE1j.js → chunk-QBLGF6JB-CXHeFNVR.js} +1 -1
  86. package/dist/public/assets/{chunk-R7FJI6CG-BdrK0RR2.js → chunk-R7FJI6CG-C16CHt3a.js} +1 -1
  87. package/dist/public/assets/{chunk-RYQCIY6F-DLe8m_V9.js → chunk-RYQCIY6F-B_hRCs61.js} +1 -1
  88. package/dist/public/assets/{chunk-U6XO7XAA-BdtYSS4d.js → chunk-U6XO7XAA-DbjPtJON.js} +1 -1
  89. package/dist/public/assets/{chunk-V7JOEXUC-DDql7_HQ.js → chunk-V7JOEXUC-akE77yTM.js} +1 -1
  90. package/dist/public/assets/chunk-VAUOI2AC-CkyNJUsp.js +1 -0
  91. package/dist/public/assets/{chunk-VR4S4FIN-tzilHVyz.js → chunk-VR4S4FIN-CNK8NKh7.js} +1 -1
  92. package/dist/public/assets/{chunk-WYO6CB5R-D_W2G_ln.js → chunk-WYO6CB5R-xIUZBSf_.js} +1 -1
  93. package/dist/public/assets/chunk-XXDRQBXY-CvQ64iI9.js +1 -0
  94. package/dist/public/assets/{chunk-YOTPTUD7-B9Rv2d2p.js → chunk-YOTPTUD7-CI44npHy.js} +1 -1
  95. package/dist/public/assets/{chunk-ZGVPDNZ5-BHyYvp09.js → chunk-ZGVPDNZ5-VN0M3NDz.js} +1 -1
  96. package/dist/public/assets/{chunk-ZIRB5QZD-szY7Ifjh.js → chunk-ZIRB5QZD-BSOfd5kg.js} +1 -1
  97. package/dist/public/assets/classDiagram-OUVF2IWQ-XY5Y-Pax.js +1 -0
  98. package/dist/public/assets/classDiagram-v2-EOCWNBFH-AHzfp_Z-.js +1 -0
  99. package/dist/public/assets/client-version-CQymDMCB.js +1 -0
  100. package/dist/public/assets/config-provider-DI7r73Nd.js +4 -0
  101. package/dist/public/assets/{cose-bilkent-JH36ORCC-GfwINyqd.js → cose-bilkent-JH36ORCC-D6bdooKu.js} +1 -1
  102. package/dist/public/assets/cynefin-VYW2F7L2-IoPsg8uT.js +1 -0
  103. package/dist/public/assets/{cynefinDiagram-TSTJHNR4-b5UWy9rB.js → cynefinDiagram-TSTJHNR4-tqreQ4yh.js} +1 -1
  104. package/dist/public/assets/{dagre-b33DKOno.js → dagre-Ixpc9-jS.js} +1 -1
  105. package/dist/public/assets/{dagre-VKFMJZFB-CdHTaGCL.js → dagre-VKFMJZFB-BSGkHWF2.js} +1 -1
  106. package/dist/public/assets/{diagram-FQU43EPY-DSL9x4Zo.js → diagram-FQU43EPY-CfGaj_W6.js} +1 -1
  107. package/dist/public/assets/{diagram-G47NLZAW-Bw-jUsVu.js → diagram-G47NLZAW-YUFYM2Yp.js} +1 -1
  108. package/dist/public/assets/{diagram-NH7WQ7WH-qlfnLzBG.js → diagram-NH7WQ7WH-B3NM7sI5.js} +1 -1
  109. package/dist/public/assets/{diagram-OA4YK3LP-tVTzrke9.js → diagram-OA4YK3LP-k_hmsb8X.js} +1 -1
  110. package/dist/public/assets/{diagram-WEI45ONY-CBToOVJX.js → diagram-WEI45ONY-CA44yAo1.js} +1 -1
  111. package/dist/public/assets/{dialog-DRODJICP.js → dialog-BBtU0IVW.js} +1 -1
  112. package/dist/public/assets/{dist-DnO8qtot.js → dist-B4Y0W_jh.js} +1 -1
  113. package/dist/public/assets/{dist-B4DKV9vn.js → dist-BEVTL7PL.js} +1 -1
  114. package/dist/public/assets/{dist-B-jgtgaa.js → dist-BOzNNR8f.js} +1 -1
  115. package/dist/public/assets/{dist-D3of0Vsw.js → dist-BS_ATzpF.js} +1 -1
  116. package/dist/public/assets/{dist-zc03OoUp.js → dist-BkWgKwL8.js} +59 -59
  117. package/dist/public/assets/{dist-D-0XDT8C.js → dist-C0Htc0JY.js} +1 -1
  118. package/dist/public/assets/{dist-CAKhzFlX.js → dist-CSrqIZCL.js} +1 -1
  119. package/dist/public/assets/{dist-CKy30nZu.js → dist-DJ3NnI7U.js} +1 -1
  120. package/dist/public/assets/{dist-Bu_FO_5U.js → dist-DNBUYY7W.js} +1 -1
  121. package/dist/public/assets/{dist-DZ_OIHsD.js → dist-DxFAhXtF.js} +1 -1
  122. package/dist/public/assets/{dist-BDsgGCY7.js → dist-Fyh5Pc-m.js} +1 -1
  123. package/dist/public/assets/{dist-B7Cr1CkJ.js → dist-mDKWywQU.js} +1 -1
  124. package/dist/public/assets/{dist-B2n3Sqo0.js → dist-xYEU8sma.js} +1 -1
  125. package/dist/public/assets/{doc-hash-D8EI7kHA.js → doc-hash-C2yzLzvC.js} +1 -1
  126. package/dist/public/assets/{documents-events-BTDcCELc.js → documents-events-DFEJCEAH.js} +1 -1
  127. package/dist/public/assets/{ebnfDiagram-CCIWWBDH-BgI0uh5a.js → ebnfDiagram-CCIWWBDH-BnwF0Tu5.js} +1 -1
  128. package/dist/public/assets/{erDiagram-Q63AITRT-SBeX1ZJR.js → erDiagram-Q63AITRT-RoWPI4T3.js} +1 -1
  129. package/dist/public/assets/eventmodeling-45OFAUF4-Miu5EHpe.js +1 -0
  130. package/dist/public/assets/{file-tree-adapter-BJqJ74LH.js → file-tree-adapter-DsS-GlIJ.js} +1 -1
  131. package/dist/public/assets/flowDiagram-23GEKE2U-DBQc4eNG.js +1 -0
  132. package/dist/public/assets/follow-file-DCQtfdGM.js +1 -0
  133. package/dist/public/assets/form-CpH-4-8v.js +1 -0
  134. package/dist/public/assets/{ganttDiagram-NO4QXBWP-Cg8Vdckl.js → ganttDiagram-NO4QXBWP-Z6zeNWv4.js} +1 -1
  135. package/dist/public/assets/gitGraph-TEB2WS4Q-OmjugmYN.js +1 -0
  136. package/dist/public/assets/{gitGraphDiagram-IHSO6WYX-BsC27b-3.js → gitGraphDiagram-IHSO6WYX-D03dJgY6.js} +1 -1
  137. package/dist/public/assets/{graphlib-jhk_RBO9.js → graphlib-BiF2idur.js} +1 -1
  138. package/dist/public/assets/{highlighted-body-OFNGDK62-RMfwG7gX.js → highlighted-body-OFNGDK62-D7A3VgRB.js} +1 -1
  139. package/dist/public/assets/index-BZRvvGVa.css +1 -0
  140. package/dist/public/assets/index-DfsjrLRd.js +1995 -0
  141. package/dist/public/assets/index.esm-Bn2Z9bGZ.js +1 -0
  142. package/dist/public/assets/info-DKCQHKI2-BNI5cXhn.js +1 -0
  143. package/dist/public/assets/{infoDiagram-FWYZ7A6U-C9kErujh.js → infoDiagram-FWYZ7A6U-CRYuDbs7.js} +1 -1
  144. package/dist/public/assets/{ishikawaDiagram-FXEZZL3T-DLC9h5ZV.js → ishikawaDiagram-FXEZZL3T-C-3EZ2QK.js} +1 -1
  145. package/dist/public/assets/{journeyDiagram-5HDEW3XC-Svp6Q4LS.js → journeyDiagram-5HDEW3XC-BTjuMwup.js} +1 -1
  146. package/dist/public/assets/{kanban-definition-HUTT4EX6-w_9-n-53.js → kanban-definition-HUTT4EX6-B7wtXd4s.js} +1 -1
  147. package/dist/public/assets/{keyboard-shortcuts-g08DUgcY.js → keyboard-shortcuts-BGMZ9cie.js} +1 -1
  148. package/dist/public/assets/{line-CWGXARts.js → line-C4Cs_vf3.js} +1 -1
  149. package/dist/public/assets/{linear-Cq--A9yu.js → linear-CmZ4evs2.js} +1 -1
  150. package/dist/public/assets/{lint-config-client-BcxnEgHO.js → lint-config-client-CZn0-gAF.js} +1 -1
  151. package/dist/public/assets/{map-BLmlK8WX.js → map-JB1BgNUL.js} +1 -1
  152. package/dist/public/assets/mermaid-GHXKKRXX-gZpelEAS.js +1 -0
  153. package/dist/public/assets/{mermaid-parser.core-BKNMxYic.js → mermaid-parser.core-DYtbeah1.js} +2 -2
  154. package/dist/public/assets/{mermaid.core-xN2oVupn.js → mermaid.core-BzbtPOAa.js} +3 -3
  155. package/dist/public/assets/{mindmap-definition-LN4V7U3C-FMRIuRb7.js → mindmap-definition-LN4V7U3C-DR3VZ6BP.js} +1 -1
  156. package/dist/public/assets/{navigation-targets-DUt4VF6E.js → navigation-targets-Cpyiq5H8.js} +1 -1
  157. package/dist/public/assets/{now-BmXIX3AR.js → now-C4jFUOx4.js} +1 -1
  158. package/dist/public/assets/{open-managed-artifact-tab-CRLFq4-B.js → open-managed-artifact-tab-CQh16KDe.js} +1 -1
  159. package/dist/public/assets/{ordinal-93FS4LJb.js → ordinal-B05IBbop.js} +1 -1
  160. package/dist/public/assets/packet-7NZHBO7P-B_5BB2Lm.js +1 -0
  161. package/dist/public/assets/paperclip-Kh-WYeO9.js +1 -0
  162. package/dist/public/assets/{pegDiagram-2B236MQR-QV3axN0_.js → pegDiagram-2B236MQR-D3wdHf5o.js} +1 -1
  163. package/dist/public/assets/{pending-receive-nav-store-C4eKkzcx.js → pending-receive-nav-store-DqtCdodL.js} +1 -1
  164. package/dist/public/assets/pie-RZYD4A2V-DN_XCApP.js +1 -0
  165. package/dist/public/assets/{pieDiagram-ENE6RG2P-COGcB4ON.js → pieDiagram-ENE6RG2P-D3JAQnl1.js} +1 -1
  166. package/dist/public/assets/{project-paths-D0uldNcZ.js → project-paths-GbLi10Mg.js} +1 -1
  167. package/dist/public/assets/{prop-types-CBBOToAL.js → prop-types-RdE5afNb.js} +1 -1
  168. package/dist/public/assets/{quadrantDiagram-ABIIQ3AL-Bceyzxbg.js → quadrantDiagram-ABIIQ3AL-v_Zo7IIT.js} +1 -1
  169. package/dist/public/assets/radar-I7S5WNFK-KdS1Y0nk.js +1 -0
  170. package/dist/public/assets/{radio-group-DGMMq4Dp.js → radio-group-CiO86NOC.js} +1 -1
  171. package/dist/public/assets/railroad-3IZDKUUU-CargXMo2.js +1 -0
  172. package/dist/public/assets/railroad-abnf-AHOZXSZD-rKz-719h.js +1 -0
  173. package/dist/public/assets/railroad-ebnf-EBAXGLYW-BwxcIuUm.js +1 -0
  174. package/dist/public/assets/railroad-peg-LSFZ7HO6-D-qfZOX5.js +1 -0
  175. package/dist/public/assets/{railroadDiagram-RFXS5EU6-2gH3OKTc.js → railroadDiagram-RFXS5EU6-_YTlvWWH.js} +1 -1
  176. package/dist/public/assets/{receive-store-nuIidOiz.js → receive-store-Ee26DxGG.js} +1 -1
  177. package/dist/public/assets/{requirementDiagram-TGXJPOKE-DcLnQ6fS.js → requirementDiagram-TGXJPOKE-C8hrZEc6.js} +1 -1
  178. package/dist/public/assets/{sankeyDiagram-HTMAVEWB-7C-thulT.js → sankeyDiagram-HTMAVEWB-DtmmYuLI.js} +1 -1
  179. package/dist/public/assets/{selection-context-DgIDY04o.js → selection-context-CMx7CxBa.js} +1 -1
  180. package/dist/public/assets/{sequenceDiagram-DBY2YBRQ-BAG_NsCH.js → sequenceDiagram-DBY2YBRQ-BDxdZPVx.js} +1 -1
  181. package/dist/public/assets/{sizeCapture-X5ZJPWSS-DymUdRBQ.js → sizeCapture-X5ZJPWSS-DWy0HAH9.js} +1 -1
  182. package/dist/public/assets/{skill-actions-DzaHqGRg.js → skill-actions-CQXOnr4t.js} +1 -1
  183. package/dist/public/assets/{skills-api-BOe6s3mN.js → skills-api-C96PbajH.js} +1 -1
  184. package/dist/public/assets/{src-gANoUa2-.js → src-Cagh2-BH.js} +2 -2
  185. package/dist/public/assets/{src-UM8T_rSX.js → src-CqbXKF1x.js} +1 -1
  186. package/dist/public/assets/{stateDiagram-2N3HPSRC-qW1gnMx8.js → stateDiagram-2N3HPSRC-D4vMSgee.js} +1 -1
  187. package/dist/public/assets/stateDiagram-v2-6OUMAXLB-DXUq8v6n.js +1 -0
  188. package/dist/public/assets/{swimlanes-5IMT3BWC-C5wvMvBa.js → swimlanes-5IMT3BWC-6QrzVCir.js} +2 -2
  189. package/dist/public/assets/swimlanesDiagram-G3AALYLV-YBuvJGfc.js +8 -0
  190. package/dist/public/assets/{target-navigation-intent-DzXHO48d.js → target-navigation-intent-DzipyQZ8.js} +1 -1
  191. package/dist/public/assets/{telemetry-impl-ClWP6_iI.js → telemetry-impl-C1p8zbTK.js} +2 -2
  192. package/dist/public/assets/{telemetry-startup-D0otGNQT.js → telemetry-startup-CbuEORkt.js} +1 -1
  193. package/dist/public/assets/{terminal-launch-events-BcKnMQ0G.js → terminal-launch-events-Bl2a7__w.js} +1 -1
  194. package/dist/public/assets/{terminal-telemetry-B-c91nRO.js → terminal-telemetry-CVI6nvoX.js} +1 -1
  195. package/dist/public/assets/{thread-client-Bfo6R90e.js → thread-client-7xKk6T8R.js} +1 -1
  196. package/dist/public/assets/{timeline-definition-FHXFAJF6-_Vu8h-ll.js → timeline-definition-FHXFAJF6-DazFRaq9.js} +1 -1
  197. package/dist/public/assets/treeView-QDETBFTQ-ocdjjjzR.js +1 -0
  198. package/dist/public/assets/treemap-6X3UGDF4-PQZ2TLFo.js +1 -0
  199. package/dist/public/assets/{typing-burst-detector-B_jwquxb.js → typing-burst-detector-BrJ0HHfX.js} +1 -1
  200. package/dist/public/assets/{use-activity-panel-Ds1FSy22.js → use-activity-panel-D9QIVAJd.js} +1 -1
  201. package/dist/public/assets/{use-apply-config-color-theme-CTTOdBYC.js → use-apply-config-color-theme-C5vmf6FI.js} +1 -1
  202. package/dist/public/assets/{use-collab-url-DJN-Eh99.js → use-collab-url-Cxq57E64.js} +1 -1
  203. package/dist/public/assets/{use-live-xterm-theme-BVrjqV4f.js → use-live-xterm-theme-BPIU0Cdf.js} +1 -1
  204. package/dist/public/assets/{use-terminal-enabled-WZKABQLf.js → use-terminal-enabled-ZRX9c0vL.js} +1 -1
  205. package/dist/public/assets/{use-timeline-entry-diff-DD8d8a6p.js → use-timeline-entry-diff-oV4K3ZWd.js} +1 -1
  206. package/dist/public/assets/{use-workspace-CqL9iZdQ.js → use-workspace-DARs7MLm.js} +1 -1
  207. package/dist/public/assets/{vennDiagram-L72KCM5P-BgnBAbwy.js → vennDiagram-L72KCM5P-qhcoBJ7A.js} +1 -1
  208. package/dist/public/assets/wardley-OPB4EBWU-CAyNEwcQ.js +1 -0
  209. package/dist/public/assets/{wardleyDiagram-EHGQE667-C7-BUrsv.js → wardleyDiagram-EHGQE667-DIGrOwKg.js} +1 -1
  210. package/dist/public/assets/{workspace-paths-d9KyFHx6.js → workspace-paths-CVu5q0EP.js} +1 -1
  211. package/dist/public/assets/{xychartDiagram-FW5EYKEG-5pDk4ZmX.js → xychartDiagram-FW5EYKEG-BVlcxtlc.js} +1 -1
  212. package/dist/public/assets/zod-D8hNdqFI.js +1 -0
  213. package/dist/public/index.html +89 -85
  214. package/dist/{repair-launch-json-27fNg7dY.mjs → repair-launch-json-Dy4nREXI.mjs} +2 -2
  215. package/dist/{repair-mcp-configs-pzywI6NO.mjs → repair-mcp-configs-ja6pIUMT.mjs} +2 -2
  216. package/dist/repair-skills-BBG-4ItM.mjs +1 -0
  217. package/dist/{repair-skills-M9d8MZVm.mjs → repair-skills-CZjmMjTB.mjs} +2 -2
  218. package/dist/server-lock-BePZlSZd.mjs +1 -0
  219. package/dist/{server-lock-DfCsjalw.mjs → server-lock-DgdIEzts.mjs} +2 -2
  220. package/dist/src-Bc_bdKMc.mjs +22 -0
  221. package/dist/{src-CXOotH7J.mjs → src-CRlKbuFA.mjs} +19 -19
  222. package/dist/{src-CDixjEaS.mjs → src-CwNeaL2o.mjs} +355 -355
  223. package/dist/src-DgjDoDRg.mjs +1 -0
  224. package/dist/{start-DDxDC8Rc.mjs → start-DZRKuQEt.mjs} +2 -2
  225. package/dist/start-DposfovG.mjs +1 -0
  226. package/dist/{write-project-skill-B7oIs3rt.mjs → write-project-skill-BaE3Xh74.mjs} +4 -4
  227. package/package.json +5 -5
  228. package/dist/constants-B5hUzOh-.mjs +0 -2
  229. package/dist/fs-traced-Bp3la-hF.mjs +0 -1
  230. package/dist/git-handle-CBwvOa-O.mjs +0 -1
  231. package/dist/init-0xNEPPTZ.mjs +0 -1
  232. package/dist/loader-BCUUlt7h.mjs +0 -1
  233. package/dist/preview-DS1cLCdt.mjs +0 -1
  234. package/dist/public/assets/ReportBugDialogBody-Dg8V3ei2.js +0 -2
  235. package/dist/public/assets/SettingsDialogBody-DVTTk_BU.js +0 -7
  236. package/dist/public/assets/ThreadView-nnZWrgGO.js +0 -4
  237. package/dist/public/assets/architecture-TIHT7OUA-BnJf87gh.js +0 -1
  238. package/dist/public/assets/auth-state-cache-CEBkZrQO.js +0 -11
  239. package/dist/public/assets/channel-B2yEPAKX.js +0 -1
  240. package/dist/public/assets/chunk-2Q5K7J3B-_3LuVoTR.js +0 -1
  241. package/dist/public/assets/chunk-VAUOI2AC-D7b3rQ3R.js +0 -1
  242. package/dist/public/assets/chunk-XXDRQBXY-Cs3ju84Q.js +0 -1
  243. package/dist/public/assets/classDiagram-OUVF2IWQ-w-w-v6Vy.js +0 -1
  244. package/dist/public/assets/classDiagram-v2-EOCWNBFH-BEIAmSiI.js +0 -1
  245. package/dist/public/assets/config-provider-pXCSDe7I.js +0 -4
  246. package/dist/public/assets/cynefin-VYW2F7L2-Dz1rkaGc.js +0 -1
  247. package/dist/public/assets/eventmodeling-45OFAUF4-5jDb9A_M.js +0 -1
  248. package/dist/public/assets/flowDiagram-23GEKE2U-C_ltHViy.js +0 -1
  249. package/dist/public/assets/follow-file-CvDGfGAe.js +0 -1
  250. package/dist/public/assets/gitGraph-TEB2WS4Q-k6CcZ9qd.js +0 -1
  251. package/dist/public/assets/index-1TeKfA3W.js +0 -1995
  252. package/dist/public/assets/index-CJ_7DqKn.css +0 -1
  253. package/dist/public/assets/info-DKCQHKI2-mtcpGMon.js +0 -1
  254. package/dist/public/assets/mermaid-GHXKKRXX-CErYzI62.js +0 -1
  255. package/dist/public/assets/packet-7NZHBO7P-CIayJ4AF.js +0 -1
  256. package/dist/public/assets/pie-RZYD4A2V-clJPJ98Z.js +0 -1
  257. package/dist/public/assets/radar-I7S5WNFK-BsNLYhdS.js +0 -1
  258. package/dist/public/assets/railroad-3IZDKUUU-CdpDsAnc.js +0 -1
  259. package/dist/public/assets/railroad-abnf-AHOZXSZD-BdDWoYy2.js +0 -1
  260. package/dist/public/assets/railroad-ebnf-EBAXGLYW-D1W7c5VA.js +0 -1
  261. package/dist/public/assets/railroad-peg-LSFZ7HO6-DSxHGFNN.js +0 -1
  262. package/dist/public/assets/stateDiagram-v2-6OUMAXLB-C9Jn-axK.js +0 -1
  263. package/dist/public/assets/swimlanesDiagram-G3AALYLV-BkjKSql-.js +0 -8
  264. package/dist/public/assets/treeView-QDETBFTQ-BzozXU4_.js +0 -1
  265. package/dist/public/assets/treemap-6X3UGDF4-CO3Ptkr9.js +0 -1
  266. package/dist/public/assets/wardley-OPB4EBWU-3j0WbuQ1.js +0 -1
  267. package/dist/repair-skills-DXhO-R2J.mjs +0 -1
  268. package/dist/server-lock-3eYo5zvq.mjs +0 -1
  269. package/dist/src-CL0d0X9t.mjs +0 -1
  270. package/dist/src-D9rhCkf5.mjs +0 -21
  271. package/dist/start-49GGKYX0.mjs +0 -1
  272. /package/dist/public/assets/{ActivityPanelDiffView-DYswxsgP.js → ActivityPanelDiffView-PnYjeFM6.js} +0 -0
  273. /package/dist/public/assets/{__vite-browser-external-Cmpvl7lZ.js → __vite-browser-external-iWYML0_D.js} +0 -0
  274. /package/dist/public/assets/{agent-presence-DNKEv-BU.js → agent-presence-CD4PApzx.js} +0 -0
  275. /package/dist/public/assets/{array-C4GDHIbt.js → array-DqL5cYTK.js} +0 -0
  276. /package/dist/public/assets/{badge-B-uIQQXR.js → badge-C06MOXpY.js} +0 -0
  277. /package/dist/public/assets/{chunk-KEIR6QF5-RwKQMTbT.js → chunk-KEIR6QF5-dYt3HMDt.js} +0 -0
  278. /package/dist/public/assets/{chunk-Y2CYZVJY-hd2lHHXF.js → chunk-Y2CYZVJY-CdjK8XQ9.js} +0 -0
  279. /package/dist/public/assets/{clike-DFqs1mSt.js → clike-C9qWGfXK.js} +0 -0
  280. /package/dist/public/assets/{clipboard-adapter-CJiewFjG.js → clipboard-adapter-DR_qsIO4.js} +0 -0
  281. /package/dist/public/assets/{colors-BAGWj83E.js → colors-DXmM_6VA.js} +0 -0
  282. /package/dist/public/assets/{config-context-DOXKMLrN.js → config-context-2ksv1vz_.js} +0 -0
  283. /package/dist/public/assets/{copilot-BgFaW6kA.js → copilot-HsbS__XJ.js} +0 -0
  284. /package/dist/public/assets/{copy-KDLrwpxR.js → copy-D-_fqnuu.js} +0 -0
  285. /package/dist/public/assets/{cursor-DRnBWpfs.js → cursor-pCYbL_rL.js} +0 -0
  286. /package/dist/public/assets/{cytoscape.esm-Cr10MCGj.js → cytoscape.esm-gSzd5sJY.js} +0 -0
  287. /package/dist/public/assets/{defaultLocale-jLKxvA7_.js → defaultLocale-B9zQw6Mp.js} +0 -0
  288. /package/dist/public/assets/{desktop-bridge-types-DsM2SoMG.js → desktop-bridge-types-zlQAgqGz.js} +0 -0
  289. /package/dist/public/assets/{diff-CIwI2ulc.js → diff-DEIIpD5k.js} +0 -0
  290. /package/dist/public/assets/{dist-Bdw_F3kx.js → dist-B01sLV4V.js} +0 -0
  291. /package/dist/public/assets/{dist-CJlHyj0Z.js → dist-CRN2pmti.js} +0 -0
  292. /package/dist/public/assets/{dist-DEkFedhu.js → dist-CskSF9JJ.js} +0 -0
  293. /package/dist/public/assets/{dist-BGCO-t3g.js → dist-CuPBmG_K.js} +0 -0
  294. /package/dist/public/assets/{dist-pkKXEO3Q.js → dist-p50TwYT_.js} +0 -0
  295. /package/dist/public/assets/{documents-fetch-DINufYLx.js → documents-fetch-07Gajc_o.js} +0 -0
  296. /package/dist/public/assets/{download-CL345-2o.js → download-jD3uts1E.js} +0 -0
  297. /package/dist/public/assets/{external-link-CbUrsN1c.js → external-link-DrhH9f_B.js} +0 -0
  298. /package/dist/public/assets/{eye-C7gDqBlg.js → eye-DQ9zE2I2.js} +0 -0
  299. /package/dist/public/assets/{file-tree-rename-validation-DzchvQFr.js → file-tree-rename-validation-CtBCHwuu.js} +0 -0
  300. /package/dist/public/assets/{folder-open-CIPS7Z9_.js → folder-open-BHTTAVt4.js} +0 -0
  301. /package/dist/public/assets/{format-O_AAsmsR.js → format--eXD4GYO.js} +0 -0
  302. /package/dist/public/assets/{go-CJQVmV1M.js → go-Dsd-Sgdq.js} +0 -0
  303. /package/dist/public/assets/{info-jz24-qK8.js → info-BF99XGpb.js} +0 -0
  304. /package/dist/public/assets/{init-6tx6Dvs6.js → init-BxsvY7Hg.js} +0 -0
  305. /package/dist/public/assets/{input-CKzGvkzv.js → input-DjOmYBC1.js} +0 -0
  306. /package/dist/public/assets/{isObject-BYHnrap4.js → isObject-D9R1MIKv.js} +0 -0
  307. /package/dist/public/assets/{libesm-ypyqdUL5.js → libesm-CJ1t-ici.js} +0 -0
  308. /package/dist/public/assets/{loader-circle-DZ77ilW4.js → loader-circle-DfTbe55q.js} +0 -0
  309. /package/dist/public/assets/{lru-string-cache-DfQjUEBK.js → lru-string-cache-DShn2dWs.js} +0 -0
  310. /package/dist/public/assets/{lua-CjAsya6E.js → lua-zAXZAEH2.js} +0 -0
  311. /package/dist/public/assets/{mcp-consent-store-CzGu2kbQ.js → mcp-consent-store-DKS2gYyG.js} +0 -0
  312. /package/dist/public/assets/{min-CeuF_SNX.js → min-CcurEWmb.js} +0 -0
  313. /package/dist/public/assets/{miss-dialog-store-Mtb10VyW.js → miss-dialog-store-hBMZdjFy.js} +0 -0
  314. /package/dist/public/assets/{panel-Bv3jN3z_.js → panel-D5Ag_0pG.js} +0 -0
  315. /package/dist/public/assets/{panel-right-open-D3S56Aig.js → panel-right-open-FMbRVVs4.js} +0 -0
  316. /package/dist/public/assets/{panzoom.es-CYqsBcJG.js → panzoom.es-DSQCRJbU.js} +0 -0
  317. /package/dist/public/assets/{parse-api-error-QYXuYti5.js → parse-api-error-B4SdjOhg.js} +0 -0
  318. /package/dist/public/assets/{path-CyByVAkN.js → path-OOD7aCgH.js} +0 -0
  319. /package/dist/public/assets/{pdf-Bz2vusPV.js → pdf-Hynmq7d7.js} +0 -0
  320. /package/dist/public/assets/{pdf.worker-BuRLhwMr.js → pdf.worker-BEQTx13W.js} +0 -0
  321. /package/dist/public/assets/{perl-B8grZGAZ.js → perl-C7iNkbFR.js} +0 -0
  322. /package/dist/public/assets/{properties-DK1cZUXK.js → properties-D2NT3vka.js} +0 -0
  323. /package/dist/public/assets/{r-BX4b9hhn.js → r-CamSUgTA.js} +0 -0
  324. /package/dist/public/assets/{rough.esm-COvN6db3.js → rough.esm-BVsMQsy4.js} +0 -0
  325. /package/dist/public/assets/{ruby-C_Hj_59H.js → ruby-Bt5hkQB2.js} +0 -0
  326. /package/dist/public/assets/{share-metadata-rows-DlAMhLyh.js → share-metadata-rows-DwvzmjaU.js} +0 -0
  327. /package/dist/public/assets/{shell-B6VlGeB7.js → shell-DchLwGs2.js} +0 -0
  328. /package/dist/public/assets/{skeleton-CeeznyYx.js → skeleton-Dz9bw7Q7.js} +0 -0
  329. /package/dist/public/assets/{sortable.esm-BxXYH0I3.js → sortable.esm-Bie05fZN.js} +0 -0
  330. /package/dist/public/assets/{sql-pOOK55Ea.js → sql-eX1e30K4.js} +0 -0
  331. /package/dist/public/assets/{src-CiR3sVeF.js → src-DKi9i97E.js} +0 -0
  332. /package/dist/public/assets/{startup-marks-DfgPoe-6.js → startup-marks-CAL9-20X.js} +0 -0
  333. /package/dist/public/assets/{stex-Byamk_Lw.js → stex-CCFzi2aM.js} +0 -0
  334. /package/dist/public/assets/{swift-BCnZs72K.js → swift-BGKCo7Qw.js} +0 -0
  335. /package/dist/public/assets/{textarea-C0WUaoe-.js → textarea-NKR77MbA.js} +0 -0
  336. /package/dist/public/assets/{timeline-diff-store-CXVaqDRQ.js → timeline-diff-store-BwBks-iZ.js} +0 -0
  337. /package/dist/public/assets/{toml-CPm00ZmB.js → toml-CVlQmuRv.js} +0 -0
  338. /package/dist/public/assets/{trash-2-CArNk5fT.js → trash-2-Ch8dKStF.js} +0 -0
  339. /package/dist/public/assets/{triangle-alert-COtjZrcH.js → triangle-alert-DDdzFNcQ.js} +0 -0
  340. /package/dist/public/assets/{use-installed-clis-NoEewRwT.js → use-installed-clis-B-sRZdK5.js} +0 -0
  341. /package/dist/public/assets/{worktree-store-B8MUHpD8.js → worktree-store-CK-mqjDq.js} +0 -0
  342. /package/dist/public/assets/{wrench-Dw0hMVJv.js → wrench-gRMjxCUZ.js} +0 -0
  343. /package/dist/public/assets/{x-C4-oii3_.js → x-CKgH-ywH.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./jsx-runtime-DyiINK0N.js";import{n}from"./DocumentContext-Dog3N-Wc.js";import{t as r}from"./react-JNybMug3.js";import{n as i,r as a}from"./dist-DBENJeML.js";import{r as o,t as s}from"./useQuery-NsPxD6kI.js";import{t as c}from"./compiler-runtime-dQcBxOhn.js";import{n as l,u}from"./createLucideIcon-B5DNg1uu.js";import{n as d,r as f,t as p}from"./collapsible-LTmyJCqZ.js";import{B as m,I as h}from"./CodeMirrorPropInput-Cx9FW420.js";import{n as g,t as _}from"./toggle-group-yZ3ty6OO.js";import{Yr as v,fr as y,gt as b,pt as x}from"./dist-zc03OoUp.js";import{t as S}from"./chevron-right-BzFyqeC2.js";import{n as C}from"./CopyButton-QEk6fd73.js";import{i as w}from"./prop-types-CBBOToAL.js";import{l as T}from"./workspace-paths-d9KyFHx6.js";import{t as E}from"./refresh-cw-GU9JlNjj.js";import{t as D}from"./triangle-alert-COtjZrcH.js";import{t as O}from"./wrench-Dw0hMVJv.js";import{n as k}from"./dist-pkKXEO3Q.js";import{t as A}from"./dist-DEkFedhu.js";import{i as j}from"./startup-marks-DfgPoe-6.js";import{a as M,s as N}from"./doc-hash-D8EI7kHA.js";import{t as P}from"./badge-B-uIQQXR.js";import{a as ee,i as F,n as te,o as ne,r as re,s as ie,t as ae}from"./panel-Bv3jN3z_.js";import{t as I}from"./skeleton-CeeznyYx.js";import{i as L,r as R}from"./lint-config-client-BcxnEgHO.js";var z=e(r(),1),B=c(),V=3e4,H=new Map;function U(e){return e?Date.now()-e.rememberedAt>V?null:e.navigation:null}function W(e,t){H.set(e,{navigation:t,rememberedAt:Date.now()})}function G(e){return U(H.get(e))}function K(e){let t=H.get(e);return H.delete(e),U(t)}function q(e){H.delete(e)}function oe(e,t){let n=(0,B.c)(4),r=t===void 0?!1:t,[i,a]=(0,z.useState)(void 0),o=(0,z.useRef)(null),s,c;return n[0]!==r||n[1]!==e?(s=()=>{if(r||e.length===0){a(void 0);return}let t=function(){let t=window.innerHeight/2,n,r;for(let i of e){let e=document.getElementById(i);if(!e)continue;let a=e.getBoundingClientRect().top;a<0?n=i:r===void 0&&a<t&&(r=i)}a(r??n??e[0])},n=function(){o.current===null&&(o.current=requestAnimationFrame(()=>{o.current=null,t()}))};return document.addEventListener(`scroll`,n,{capture:!0,passive:!0}),t(),()=>{document.removeEventListener(`scroll`,n,{capture:!0}),o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)}},c=[e,r],n[0]=r,n[1]=e,n[2]=s,n[3]=c):(s=n[2],c=n[3]),(0,z.useEffect)(s,c),i}var J=t(),se=300;async function ce(e){let t=await fetch(`/api/page-headings?docName=${encodeURIComponent(e)}`),n;try{n=await t.json()}catch(e){throw new m(A._({id:`qAQVSD`}),{cause:e,status:t.status})}if(!t.ok){let e=b.safeParse(n);throw e.success?Error(e.data.title):new m(A._({id:`zlErBl`}),{status:t.status})}let r=x.safeParse(n);if(!r.success)throw new m(A._({id:`XW18jo`}),{status:t.status});return r.data.headings??[]}var le=32,Y=12,X=6,ue=`open-knowledge:outline-nav`;function Z(e){let t=(0,B.c)(2),n;return t[0]===e?n=t[1]:(n=(0,J.jsx)(j,{name:`outline-panel`,children:(0,J.jsx)(de,{...e})}),t[0]=e,t[1]=n),n}function de(e){let t=(0,B.c)(50),{docName:r,isSourceMode:c,className:l}=e,d=l===void 0?``:l,{_:f}=a(),{pages:p,loading:m}=w(),h=o(),{activeProvider:g,activeDocName:_}=n(),v,b;t[0]===r?(v=t[1],b=t[2]):(v=[`page-headings`,r],b=()=>ce(r),t[0]=r,t[1]=v,t[2]=b);let x;t[3]!==r||t[4]!==m||t[5]!==p?(x=!m&&(p.has(r)||y(r)),t[3]=r,t[4]=m,t[5]=p,t[6]=x):x=t[6];let S;t[7]!==v||t[8]!==b||t[9]!==x?(S={queryKey:v,queryFn:b,enabled:x,staleTime:1/0},t[7]=v,t[8]=b,t[9]=x,t[10]=S):S=t[10];let{data:C,isLoading:T,error:E}=s(S),D;t[11]===C?D=t[12]:(D=C===void 0?[]:C,t[11]=C,t[12]=D);let O=D,k,A;t[13]!==_||t[14]!==g||t[15]!==r||t[16]!==h?(k=()=>{if(!g||_!==r)return;let e=g.document,t=null,n=()=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{t=null,h.invalidateQueries({queryKey:[`page-headings`,r]})},se)};return e.on(`update`,n),()=>{e.off(`update`,n),t!==null&&clearTimeout(t)}},A=[g,_,r,h],t[13]=_,t[14]=g,t[15]=r,t[16]=h,t[17]=k,t[18]=A):(k=t[17],A=t[18]),(0,z.useEffect)(k,A);let j;t[19]===O?j=t[20]:(j=O.map(fe),t[19]=O,t[20]=j);let M=oe(j,c),N;t[21]!==M||t[22]!==O?(N=M?O.findIndex(e=>e.slug===M):-1,t[21]=M,t[22]=O,t[23]=N):N=t[23];let P=N,I;t[24]!==r||t[25]!==c?(I=function(e,t){let n={index:e,slug:t,mode:c?`source`:`wysiwyg`};n.mode===`source`&&W(r,{kind:`outline`,detail:n}),window.dispatchEvent(new CustomEvent(ue,{detail:n}))},t[24]=r,t[25]=c,t[26]=I):I=t[26];let L=I,R=((P>=0?O[P].level:1)-1)*Y+(Y-X)/2,V=P*le+(le-X)/2,H;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,J.jsx)(ie,{children:(0,J.jsx)(i,{id:`dD7NPy`})}),t[27]=H):H=t[27];let U;t[28]!==O.length||t[29]!==T?(U=!T&&(0,J.jsx)(re,{children:O.length}),t[28]=O.length,t[29]=T,t[30]=U):U=t[30];let G;t[31]===U?G=t[32]:(G=(0,J.jsxs)(ne,{children:[H,U]}),t[31]=U,t[32]=G);let K;t[33]!==f||t[34]!==P||t[35]!==M||t[36]!==E||t[37]!==L||t[38]!==O||t[39]!==T||t[40]!==R||t[41]!==V?(K=E?(0,J.jsx)(ee,{className:`px-2`,children:E instanceof Error?E.message:f({id:`GuqOb1`})}):O.length===0&&!T?(0,J.jsx)(F,{className:`px-2`,children:(0,J.jsx)(i,{id:`0BB9ID`})}):(0,J.jsxs)(`nav`,{"aria-label":f({id:`BymzO4`}),className:`relative`,children:[P>=0&&(0,J.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute left-0 top-0 rounded-full bg-primary motion-safe:[transition:transform_0.25s_var(--ease-out-strong)]`,style:{width:X,height:X,transform:`translate(${R}px, ${V}px)`}}),O.map((e,t)=>{let n=e.slug===M;return(0,J.jsx)(`button`,{type:`button`,"aria-current":n?`location`:void 0,onClick:()=>L(t,e.slug),className:u(`w-full cursor-pointer truncate py-1.5 pe-2 text-left text-sm transition-colors`,n?`font-medium text-primary`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${(e.level-1)*Y+20}px`},title:e.text,children:e.text},t)})]}),t[33]=f,t[34]=P,t[35]=M,t[36]=E,t[37]=L,t[38]=O,t[39]=T,t[40]=R,t[41]=V,t[42]=K):K=t[42];let q;t[43]!==T||t[44]!==K?(q=(0,J.jsx)(te,{className:`px-3 py-2`,"aria-busy":T,children:K}),t[43]=T,t[44]=K,t[45]=q):q=t[45];let Z;return t[46]!==d||t[47]!==G||t[48]!==q?(Z=(0,J.jsxs)(ae,{className:d,children:[G,q]}),t[46]=d,t[47]=G,t[48]=q,t[49]=Z):Z=t[49],Z}function fe(e){return e.slug}function pe(e){let t=(0,B.c)(10),{scope:n,onScopeChange:r}=e,{_:o}=a(),s;t[0]===r?s=t[1]:(s=e=>{e&&r(e)},t[0]=r,t[1]=s);let c;t[2]===o?c=t[3]:(c=o({id:`aBgwis`}),t[2]=o,t[3]=c);let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,J.jsx)(g,{value:`doc`,className:`flex-1`,"data-testid":`panel-scope-doc`,children:(0,J.jsx)(i,{id:`UpCz01`})}),t[4]=l):l=t[4];let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,J.jsx)(g,{value:`project`,className:`flex-1`,"data-testid":`panel-scope-project`,children:(0,J.jsx)(i,{id:`e0NrBM`})}),t[5]=u):u=t[5];let d;return t[6]!==n||t[7]!==s||t[8]!==c?(d=(0,J.jsx)(`div`,{className:`shrink-0 px-4 pb-2`,children:(0,J.jsxs)(_,{type:`single`,variant:`segmented`,size:`sm`,spacing:1,value:n,onValueChange:s,"aria-label":c,className:`w-full rounded-md bg-muted p-0.5 dark:bg-background`,children:[l,u]})}),t[6]=n,t[7]=s,t[8]=c,t[9]=d):d=t[9],d}var me=`open-knowledge:lint-nav`;function he(e,t){return e.range.start.line-t.range.start.line||e.range.start.character-t.range.start.character}function ge(e){return{line:e.range.start.line+1,column:e.range.start.character+1}}function _e(e){let t=(0,B.c)(19),{diagnostic:n}=e,{_:r}=a(),i=n.severity===`error`?C:D,o=`${n.source}/${n.code}`,s=n.range.start.line+1,c=n.severity===`error`?`text-destructive`:`text-amber-500`,l;t[0]===c?l=t[1]:(l=u(`mt-0.5 size-3.5 shrink-0`,c),t[0]=c,t[1]=l);let d;t[2]!==i||t[3]!==l?(d=(0,J.jsx)(i,{"aria-hidden":`true`,className:l}),t[2]=i,t[3]=l,t[4]=d):d=t[4];let f;t[5]===n.message?f=t[6]:(f=(0,J.jsx)(`span`,{className:`text-foreground`,children:n.message}),t[5]=n.message,t[6]=f);let p;t[7]!==d||t[8]!==f?(p=(0,J.jsxs)(`span`,{className:`flex items-start gap-1.5 text-sm`,children:[d,f]}),t[7]=d,t[8]=f,t[9]=p):p=t[9];let m;t[10]!==r||t[11]!==s?(m=r({id:`enPTnx`,values:{displayLine:s}}),t[10]=r,t[11]=s,t[12]=m):m=t[12];let h;t[13]!==o||t[14]!==m?(h=(0,J.jsxs)(`span`,{className:`ps-5 font-mono text-xs text-muted-foreground`,children:[o,` · `,m]}),t[13]=o,t[14]=m,t[15]=h):h=t[15];let g;return t[16]!==p||t[17]!==h?(g=(0,J.jsxs)(J.Fragment,{children:[p,h]}),t[16]=p,t[17]=h,t[18]=g):g=t[18],g}function ve(e){return`${e.source}/${e.code}-${e.range.start.line}-${e.range.start.character}-${e.message}`}function ye(e){return e.reduce((e,t)=>e+ +((t.fixes?.length??0)>0),0)}function be(e){let t=(0,B.c)(13),{count:n,disabled:r,onClick:o,children:s}=e,{_:c}=a(),u;t[0]!==c||t[1]!==s||t[2]!==n?(u=s===void 0?c({id:`Izb10l`,values:{count:n}}):void 0,t[0]=c,t[1]=s,t[2]=n,t[3]=u):u=t[3];let d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,J.jsx)(O,{"aria-hidden":`true`,className:`size-3`}),t[4]=d):d=t[4];let f;t[5]!==s||t[6]!==n?(f=s??(0,J.jsx)(i,{id:`5_8TCr`,values:{count:n}}),t[5]=s,t[6]=n,t[7]=f):f=t[7];let p;return t[8]!==r||t[9]!==o||t[10]!==u||t[11]!==f?(p=(0,J.jsxs)(l,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,disabled:r,onClick:o,"aria-label":u,"data-testid":`problems-fix-all`,children:[d,f]}),t[8]=r,t[9]=o,t[10]=u,t[11]=f,t[12]=p):p=t[12],p}function xe(e){let t=(0,B.c)(21),{docName:n,diagnostics:r,onFix:o,onFixAll:s,onAskAi:c}=e,{_:u}=a(),[d,f]=(0,z.useState)(`doc`),p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p={status:`idle`},t[0]=p):p=t[0];let[m,h]=(0,z.useState)(p),[g,_]=(0,z.useState)(null),v=(0,z.useRef)(!0),y,b;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>(v.current=!0,()=>{v.current=!1}),b=[],t[1]=y,t[2]=b):(y=t[1],b=t[2]),(0,z.useEffect)(y,b);let x;if(t[3]!==u||t[4]!==m||t[5]!==r||t[6]!==n||t[7]!==c||t[8]!==o||t[9]!==s||t[10]!==g||t[11]!==d){let e=[...r].sort(he),a=async function(){h({status:`loading`});let e=await L();v.current&&h(e===null?{status:`failed`}:{status:`loaded`,result:e})},p=m.status===`loaded`?m.result.files.filter(we):[],y=async function(){if(g!==null||p.length===0)return;_({done:0,total:p.length});let e=[];for(let t of p){let n=await R(M(t.file));if(!v.current)return;n.ok||e.push({file:t.file,detail:n.errorDetail}),_(Ce)}if(_(null),e.length>0){let t=e[0];k.error(u({id:`fru3T7`,values:{0:e.length,1:p.length}}),{description:t===void 0?void 0:`${t.file}${t.detail===null?``:` — ${t.detail}`}`})}try{await a()}catch{v.current&&h({status:`failed`})}},b=function(e){f(e),e===`project`&&m.status===`idle`&&a()},S;t[13]===n?S=t[14]:(S=function(e){let t=ge(e);W(n,{kind:`lint`,detail:t}),window.dispatchEvent(new CustomEvent(me,{detail:t}))},t[13]=n,t[14]=S);let C=S,w;t[15]!==n||t[16]!==C?(w=function(e,t){let r=M(e);if(r===n){C(t);return}W(r,{kind:`lint`,detail:ge(t)}),window.location.hash=N(r)},t[15]=n,t[16]=C,t[17]=w):w=t[17];let E=w,D;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,J.jsx)(ie,{children:(0,J.jsx)(i,{id:`OXdGnd`})}),t[18]=D):D=t[18];let A=d===`doc`&&e.length>0&&(0,J.jsx)(re,{children:e.length}),j;t[19]===A?j=t[20]:(j=(0,J.jsxs)(ne,{children:[D,A]}),t[19]=A,t[20]=j),x=(0,J.jsxs)(ae,{children:[j,(0,J.jsx)(pe,{scope:d,onScopeChange:b}),d===`doc`?(0,J.jsx)(te,{className:`px-2 py-2`,children:e.length===0?(0,J.jsx)(F,{className:`px-2`,children:(0,J.jsx)(i,{id:`ZI8uvA`})}):(0,J.jsxs)(J.Fragment,{children:[s!==void 0&&(0,J.jsx)(`div`,{className:`flex items-center justify-end gap-2 px-2 pb-1`,children:(0,J.jsx)(be,{count:ye(e),disabled:ye(e)===0,onClick:s})}),(0,J.jsx)(`ul`,{"aria-label":u({id:`OXdGnd`}),className:`flex flex-col gap-0.5`,children:e.map(e=>{let t=e.range.start.line+1,n=o!==void 0&&(e.fixes?.length??0)>0,r=`${e.source}/${e.code}`;return(0,J.jsxs)(`li`,{className:`group relative rounded transition-colors hover:bg-muted`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>C(e),className:`flex w-full cursor-pointer flex-col gap-0.5 rounded px-2 py-1.5 text-left`,title:u({id:`aHPdYV`,values:{displayLine:t}}),children:(0,J.jsx)(_e,{diagnostic:e})}),n||c!==void 0?(0,J.jsxs)(`div`,{className:`absolute bottom-1 right-1 flex items-center gap-1 rounded bg-muted opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100 motion-reduce:transition-none`,children:[n?(0,J.jsxs)(l,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,onClick:()=>o?.(e),"aria-label":u({id:`fZj9em`,values:{flatId:r}}),"data-testid":`problems-fix`,children:[(0,J.jsx)(O,{"aria-hidden":`true`,className:`size-3`}),(0,J.jsx)(i,{id:`c4fVUV`})]}):null,c===void 0?null:(0,J.jsxs)(l,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,onClick:()=>c(e),"aria-label":u({id:`hh4mVC`,values:{flatId:r}}),"data-testid":`problems-ask-ai`,children:[(0,J.jsx)(T,{"aria-hidden":`true`,className:`size-3`}),(0,J.jsx)(i,{id:`xWEvuo`})]})]}):null]},ve(e))})})]})}):(0,J.jsx)(Ee,{audit:m,onRefresh:()=>void a(),onNavigate:E,fixableCount:p.reduce(Se,0),fixing:g,onFixAll:()=>void y()})]}),t[3]=u,t[4]=m,t[5]=r,t[6]=n,t[7]=c,t[8]=o,t[9]=s,t[10]=g,t[11]=d,t[12]=x}else x=t[12];return x}function Se(e,t){return e+ye(t.diagnostics)}function Ce(e){return e===null?e:{...e,done:e.done+1}}function we(e){return e.diagnostics.some(Te)}function Te(e){return(e.fixes?.length??0)>0}function Ee(e){let t=(0,B.c)(43),{audit:n,onRefresh:r,onNavigate:o,fixableCount:s,fixing:c,onFixAll:u}=e,{_:d}=a(),f=n.status===`loading`||n.status===`idle`,p;t[0]!==n.result||t[1]!==n.status?(p=n.status===`loaded`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(i,{id:`DsDwR-`,values:{0:n.result.errorCount}}),` · `,(0,J.jsx)(i,{id:`W1SI2K`,values:{0:n.result.warningCount}})]}),t[0]=n.result,t[1]=n.status,t[2]=p):p=t[2];let m;t[3]===p?m=t[4]:(m=(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`problems-audit-summary`,children:p}),t[3]=p,t[4]=m);let h;t[5]!==d||t[6]!==c?(h=c===null?null:(0,J.jsx)(`span`,{className:`sr-only`,role:`status`,children:d({id:`gZElfU`,values:{0:c.done,1:c.total}})}),t[5]=d,t[6]=c,t[7]=h):h=t[7];let g=f||c!==null||s===0,_;t[8]===c?_=t[9]:(_=c===null?void 0:(0,J.jsx)(i,{id:`S9t1PI`,values:{0:c.done,1:c.total}}),t[8]=c,t[9]=_);let v;t[10]!==s||t[11]!==u||t[12]!==g||t[13]!==_?(v=(0,J.jsx)(be,{count:s,disabled:g,onClick:u,children:_}),t[10]=s,t[11]=u,t[12]=g,t[13]=_,t[14]=v):v=t[14];let y;t[15]===d?y=t[16]:(y=d({id:`WRdYfS`}),t[15]=d,t[16]=y);let b=f||c!==null,x;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,J.jsx)(E,{"aria-hidden":`true`,className:`size-3.5`}),t[17]=x):x=t[17];let S;t[18]!==r||t[19]!==y||t[20]!==b?(S=(0,J.jsx)(l,{variant:`ghost`,size:`icon`,className:`size-6 shrink-0 text-muted-foreground`,"aria-label":y,"data-testid":`problems-audit-refresh`,disabled:b,onClick:r,children:x}),t[18]=r,t[19]=y,t[20]=b,t[21]=S):S=t[21];let C;t[22]!==S||t[23]!==h||t[24]!==v?(C=(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[h,v,S]}),t[22]=S,t[23]=h,t[24]=v,t[25]=C):C=t[25];let w;t[26]!==C||t[27]!==m?(w=(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-2 pb-1`,children:[m,C]}),t[26]=C,t[27]=m,t[28]=w):w=t[28];let T;t[29]!==d||t[30]!==f?(T=f&&(0,J.jsx)(`div`,{className:`flex flex-col gap-1`,role:`status`,"aria-busy":`true`,"aria-label":d({id:`dx-TwN`}),children:[1,2,3].map(De)}),t[29]=d,t[30]=f,t[31]=T):T=t[31];let D;t[32]===n.status?D=t[33]:(D=n.status===`failed`&&(0,J.jsx)(ee,{className:`px-2 text-xs`,children:(0,J.jsx)(i,{id:`IFezUv`})}),t[32]=n.status,t[33]=D);let O;t[34]!==n.result||t[35]!==n.status||t[36]!==o?(O=n.status===`loaded`&&(0,J.jsx)(Oe,{result:n.result,onNavigate:o}),t[34]=n.result,t[35]=n.status,t[36]=o,t[37]=O):O=t[37];let k;return t[38]!==w||t[39]!==T||t[40]!==D||t[41]!==O?(k=(0,J.jsxs)(te,{className:`px-2 py-2`,"data-testid":`problems-project-scope`,children:[w,T,D,O]}),t[38]=w,t[39]=T,t[40]=D,t[41]=O,t[42]=k):k=t[42],k}function De(e){return(0,J.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded px-2 py-1.5`,children:[(0,J.jsx)(I,{className:`mt-0.5 size-3.5 shrink-0 rounded`}),(0,J.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,J.jsx)(I,{className:`h-3 w-28`}),(0,J.jsx)(I,{className:`h-3 w-40`})]})]},e)}function Oe(e){let t=(0,B.c)(10),{result:n,onNavigate:r}=e,{_:o}=a(),s;t[0]!==o||t[1]!==n.warnings?(s=n.warnings.length>0&&(0,J.jsx)(`ul`,{"aria-label":o({id:`Rsdhj9`}),className:`flex flex-col gap-0.5 pb-1`,children:n.warnings.map(ke)}),t[0]=o,t[1]=n.warnings,t[2]=s):s=t[2];let c;t[3]!==r||t[4]!==n.fileCount||t[5]!==n.files?(c=n.files.length===0?(0,J.jsx)(F,{className:`px-2`,children:(0,J.jsx)(i,{id:`k_Dqw1`,values:{0:n.fileCount}})}):n.files.map(e=>(0,J.jsx)(Ae,{file:e,onNavigate:r},e.file)),t[3]=r,t[4]=n.fileCount,t[5]=n.files,t[6]=c):c=t[6];let l;return t[7]!==s||t[8]!==c?(l=(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function ke(e,t){return(0,J.jsxs)(`li`,{className:`flex items-start gap-1.5 px-2 text-xs`,children:[(0,J.jsx)(D,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-amber-500`}),(0,J.jsx)(`span`,{className:`min-w-0 text-foreground`,children:e})]},`${t}-${e}`)}function Ae(e){let t=(0,B.c)(37),{file:n,onNavigate:r}=e,{_:i}=a(),o,s,c,l,u,m,h,g,_;if(t[0]!==i||t[1]!==n.diagnostics||t[2]!==n.file||t[3]!==r){let e=[...n.diagnostics].sort(he);s=p,h=!0,g=`problems-audit-group`;let a;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,J.jsx)(S,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90 motion-reduce:transition-none`}),t[13]=a):a=t[13];let v;t[14]===n.file?v=t[15]:(v=(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-foreground`,title:n.file,children:n.file}),t[14]=n.file,t[15]=v),_=(0,J.jsxs)(f,{className:`group flex w-full cursor-pointer items-center gap-1.5 rounded px-2 py-1.5 text-left transition-colors hover:bg-muted`,children:[a,v,(0,J.jsx)(P,{variant:`gray`,"data-testid":`problems-audit-file-count`,className:`shrink-0`,children:e.length})]}),o=d,m=`overflow-hidden data-[state=open]:animate-[collapsible-down_150ms_ease-out] data-[state=closed]:animate-[collapsible-up_150ms_ease-in]`,t[16]!==i||t[17]!==n.file?(c=i({id:`zAJzIg`,values:{0:n.file}}),t[16]=i,t[17]=n.file,t[18]=c):c=t[18],l=`flex flex-col gap-0.5 pb-1 ps-3`;let y;t[19]!==i||t[20]!==n.file||t[21]!==r?(y=e=>{let t=e.range.start.line+1;return(0,J.jsx)(`li`,{children:(0,J.jsx)(`button`,{type:`button`,onClick:()=>r(n.file,e),className:`flex w-full cursor-pointer flex-col gap-0.5 rounded px-2 py-1.5 text-left transition-colors hover:bg-muted`,title:i({id:`kDwcbW`,values:{0:n.file,displayLine:t}}),children:(0,J.jsx)(_e,{diagnostic:e})})},ve(e))},t[19]=i,t[20]=n.file,t[21]=r,t[22]=y):y=t[22],u=e.map(y),t[0]=i,t[1]=n.diagnostics,t[2]=n.file,t[3]=r,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=m,t[10]=h,t[11]=g,t[12]=_}else o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],m=t[9],h=t[10],g=t[11],_=t[12];let v;t[23]!==c||t[24]!==l||t[25]!==u?(v=(0,J.jsx)(`ul`,{"aria-label":c,className:l,children:u}),t[23]=c,t[24]=l,t[25]=u,t[26]=v):v=t[26];let y;t[27]!==o||t[28]!==m||t[29]!==v?(y=(0,J.jsx)(o,{className:m,children:v}),t[27]=o,t[28]=m,t[29]=v,t[30]=y):y=t[30];let b;return t[31]!==s||t[32]!==h||t[33]!==g||t[34]!==_||t[35]!==y?(b=(0,J.jsxs)(s,{defaultOpen:h,"data-testid":g,children:[_,y]}),t[31]=s,t[32]=h,t[33]=g,t[34]=_,t[35]=y,t[36]=b):b=t[36],b}var je={words:0,chars:0,tokens:0},Me=/[ -〿぀-ゟ゠-ヿ㐀-䶿一-鿿豈-﫿＀-￯฀-๿ក-៿]/,Ne=/[\p{L}\p{N}]/u,Pe=new Set([`text`,`inlineCode`,`code`,`tag`]),Fe=new Set([`html`,`definition`,`footnoteDefinition`,`yaml`,`toml`,`image`,`imageReference`,`mdxFlowExpression`,`mdxTextExpression`,`mdxjsEsm`,`rawMdxFallback`,`rawMdxFallbackMdast`]),Ie=new Set([`paragraph`,`heading`,`blockquote`,`list`,`listItem`,`thematicBreak`,`table`,`tableRow`,`tableCell`,`mdxJsxFlowElement`,`commentBlock`]);function Le(e,t){if(!e)return;let n=e.type;if(!Fe.has(n)){if(Pe.has(n)){e.value&&(t.push(e.value),n===`code`&&t.push(`
1
+ import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./jsx-runtime-DyiINK0N.js";import{n}from"./DocumentContext-CqohW6HK.js";import{t as r}from"./react-JNybMug3.js";import{n as i,r as a}from"./dist-DBENJeML.js";import{r as o,t as s}from"./useQuery-NsPxD6kI.js";import{t as c}from"./compiler-runtime-dQcBxOhn.js";import{n as l,u}from"./createLucideIcon-B5DNg1uu.js";import{n as d,r as f,t as p}from"./collapsible-LTmyJCqZ.js";import{B as m,I as h}from"./CodeMirrorPropInput-FVyKUYn4.js";import{n as g,t as _}from"./toggle-group-yZ3ty6OO.js";import{Yr as v,fr as y,gt as b,pt as x}from"./dist-BkWgKwL8.js";import{t as S}from"./chevron-right-BzFyqeC2.js";import{n as C}from"./CopyButton-qbOI-WUC.js";import{i as w}from"./prop-types-RdE5afNb.js";import{l as T}from"./workspace-paths-CVu5q0EP.js";import{t as E}from"./refresh-cw-GU9JlNjj.js";import{t as D}from"./triangle-alert-DDdzFNcQ.js";import{t as O}from"./wrench-gRMjxCUZ.js";import{n as k}from"./dist-p50TwYT_.js";import{t as A}from"./dist-CskSF9JJ.js";import{i as j}from"./startup-marks-CAL9-20X.js";import{a as M,s as N}from"./doc-hash-C2yzLzvC.js";import{t as P}from"./badge-C06MOXpY.js";import{a as ee,i as F,n as te,o as ne,r as re,s as ie,t as ae}from"./panel-D5Ag_0pG.js";import{t as I}from"./skeleton-Dz9bw7Q7.js";import{i as L,r as R}from"./lint-config-client-CZn0-gAF.js";var z=e(r(),1),B=c(),V=3e4,H=new Map;function U(e){return e?Date.now()-e.rememberedAt>V?null:e.navigation:null}function W(e,t){H.set(e,{navigation:t,rememberedAt:Date.now()})}function G(e){return U(H.get(e))}function K(e){let t=H.get(e);return H.delete(e),U(t)}function q(e){H.delete(e)}function oe(e,t){let n=(0,B.c)(4),r=t===void 0?!1:t,[i,a]=(0,z.useState)(void 0),o=(0,z.useRef)(null),s,c;return n[0]!==r||n[1]!==e?(s=()=>{if(r||e.length===0){a(void 0);return}let t=function(){let t=window.innerHeight/2,n,r;for(let i of e){let e=document.getElementById(i);if(!e)continue;let a=e.getBoundingClientRect().top;a<0?n=i:r===void 0&&a<t&&(r=i)}a(r??n??e[0])},n=function(){o.current===null&&(o.current=requestAnimationFrame(()=>{o.current=null,t()}))};return document.addEventListener(`scroll`,n,{capture:!0,passive:!0}),t(),()=>{document.removeEventListener(`scroll`,n,{capture:!0}),o.current!==null&&(cancelAnimationFrame(o.current),o.current=null)}},c=[e,r],n[0]=r,n[1]=e,n[2]=s,n[3]=c):(s=n[2],c=n[3]),(0,z.useEffect)(s,c),i}var J=t(),se=300;async function ce(e){let t=await fetch(`/api/page-headings?docName=${encodeURIComponent(e)}`),n;try{n=await t.json()}catch(e){throw new m(A._({id:`qAQVSD`}),{cause:e,status:t.status})}if(!t.ok){let e=b.safeParse(n);throw e.success?Error(e.data.title):new m(A._({id:`zlErBl`}),{status:t.status})}let r=x.safeParse(n);if(!r.success)throw new m(A._({id:`XW18jo`}),{status:t.status});return r.data.headings??[]}var le=32,Y=12,X=6,ue=`open-knowledge:outline-nav`;function Z(e){let t=(0,B.c)(2),n;return t[0]===e?n=t[1]:(n=(0,J.jsx)(j,{name:`outline-panel`,children:(0,J.jsx)(de,{...e})}),t[0]=e,t[1]=n),n}function de(e){let t=(0,B.c)(50),{docName:r,isSourceMode:c,className:l}=e,d=l===void 0?``:l,{_:f}=a(),{pages:p,loading:m}=w(),h=o(),{activeProvider:g,activeDocName:_}=n(),v,b;t[0]===r?(v=t[1],b=t[2]):(v=[`page-headings`,r],b=()=>ce(r),t[0]=r,t[1]=v,t[2]=b);let x;t[3]!==r||t[4]!==m||t[5]!==p?(x=!m&&(p.has(r)||y(r)),t[3]=r,t[4]=m,t[5]=p,t[6]=x):x=t[6];let S;t[7]!==v||t[8]!==b||t[9]!==x?(S={queryKey:v,queryFn:b,enabled:x,staleTime:1/0},t[7]=v,t[8]=b,t[9]=x,t[10]=S):S=t[10];let{data:C,isLoading:T,error:E}=s(S),D;t[11]===C?D=t[12]:(D=C===void 0?[]:C,t[11]=C,t[12]=D);let O=D,k,A;t[13]!==_||t[14]!==g||t[15]!==r||t[16]!==h?(k=()=>{if(!g||_!==r)return;let e=g.document,t=null,n=()=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{t=null,h.invalidateQueries({queryKey:[`page-headings`,r]})},se)};return e.on(`update`,n),()=>{e.off(`update`,n),t!==null&&clearTimeout(t)}},A=[g,_,r,h],t[13]=_,t[14]=g,t[15]=r,t[16]=h,t[17]=k,t[18]=A):(k=t[17],A=t[18]),(0,z.useEffect)(k,A);let j;t[19]===O?j=t[20]:(j=O.map(fe),t[19]=O,t[20]=j);let M=oe(j,c),N;t[21]!==M||t[22]!==O?(N=M?O.findIndex(e=>e.slug===M):-1,t[21]=M,t[22]=O,t[23]=N):N=t[23];let P=N,I;t[24]!==r||t[25]!==c?(I=function(e,t){let n={index:e,slug:t,mode:c?`source`:`wysiwyg`};n.mode===`source`&&W(r,{kind:`outline`,detail:n}),window.dispatchEvent(new CustomEvent(ue,{detail:n}))},t[24]=r,t[25]=c,t[26]=I):I=t[26];let L=I,R=((P>=0?O[P].level:1)-1)*Y+(Y-X)/2,V=P*le+(le-X)/2,H;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,J.jsx)(ie,{children:(0,J.jsx)(i,{id:`dD7NPy`})}),t[27]=H):H=t[27];let U;t[28]!==O.length||t[29]!==T?(U=!T&&(0,J.jsx)(re,{children:O.length}),t[28]=O.length,t[29]=T,t[30]=U):U=t[30];let G;t[31]===U?G=t[32]:(G=(0,J.jsxs)(ne,{children:[H,U]}),t[31]=U,t[32]=G);let K;t[33]!==f||t[34]!==P||t[35]!==M||t[36]!==E||t[37]!==L||t[38]!==O||t[39]!==T||t[40]!==R||t[41]!==V?(K=E?(0,J.jsx)(ee,{className:`px-2`,children:E instanceof Error?E.message:f({id:`GuqOb1`})}):O.length===0&&!T?(0,J.jsx)(F,{className:`px-2`,children:(0,J.jsx)(i,{id:`0BB9ID`})}):(0,J.jsxs)(`nav`,{"aria-label":f({id:`BymzO4`}),className:`relative`,children:[P>=0&&(0,J.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute left-0 top-0 rounded-full bg-primary motion-safe:[transition:transform_0.25s_var(--ease-out-strong)]`,style:{width:X,height:X,transform:`translate(${R}px, ${V}px)`}}),O.map((e,t)=>{let n=e.slug===M;return(0,J.jsx)(`button`,{type:`button`,"aria-current":n?`location`:void 0,onClick:()=>L(t,e.slug),className:u(`w-full cursor-pointer truncate py-1.5 pe-2 text-left text-sm transition-colors`,n?`font-medium text-primary`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${(e.level-1)*Y+20}px`},title:e.text,children:e.text},t)})]}),t[33]=f,t[34]=P,t[35]=M,t[36]=E,t[37]=L,t[38]=O,t[39]=T,t[40]=R,t[41]=V,t[42]=K):K=t[42];let q;t[43]!==T||t[44]!==K?(q=(0,J.jsx)(te,{className:`px-3 py-2`,"aria-busy":T,children:K}),t[43]=T,t[44]=K,t[45]=q):q=t[45];let Z;return t[46]!==d||t[47]!==G||t[48]!==q?(Z=(0,J.jsxs)(ae,{className:d,children:[G,q]}),t[46]=d,t[47]=G,t[48]=q,t[49]=Z):Z=t[49],Z}function fe(e){return e.slug}function pe(e){let t=(0,B.c)(10),{scope:n,onScopeChange:r}=e,{_:o}=a(),s;t[0]===r?s=t[1]:(s=e=>{e&&r(e)},t[0]=r,t[1]=s);let c;t[2]===o?c=t[3]:(c=o({id:`aBgwis`}),t[2]=o,t[3]=c);let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,J.jsx)(g,{value:`doc`,className:`flex-1`,"data-testid":`panel-scope-doc`,children:(0,J.jsx)(i,{id:`UpCz01`})}),t[4]=l):l=t[4];let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,J.jsx)(g,{value:`project`,className:`flex-1`,"data-testid":`panel-scope-project`,children:(0,J.jsx)(i,{id:`e0NrBM`})}),t[5]=u):u=t[5];let d;return t[6]!==n||t[7]!==s||t[8]!==c?(d=(0,J.jsx)(`div`,{className:`shrink-0 px-4 pb-2`,children:(0,J.jsxs)(_,{type:`single`,variant:`segmented`,size:`sm`,spacing:1,value:n,onValueChange:s,"aria-label":c,className:`w-full rounded-md bg-muted p-0.5 dark:bg-background`,children:[l,u]})}),t[6]=n,t[7]=s,t[8]=c,t[9]=d):d=t[9],d}var me=`open-knowledge:lint-nav`;function he(e,t){return e.range.start.line-t.range.start.line||e.range.start.character-t.range.start.character}function ge(e){return{line:e.range.start.line+1,column:e.range.start.character+1}}function _e(e){let t=(0,B.c)(19),{diagnostic:n}=e,{_:r}=a(),i=n.severity===`error`?C:D,o=`${n.source}/${n.code}`,s=n.range.start.line+1,c=n.severity===`error`?`text-destructive`:`text-amber-500`,l;t[0]===c?l=t[1]:(l=u(`mt-0.5 size-3.5 shrink-0`,c),t[0]=c,t[1]=l);let d;t[2]!==i||t[3]!==l?(d=(0,J.jsx)(i,{"aria-hidden":`true`,className:l}),t[2]=i,t[3]=l,t[4]=d):d=t[4];let f;t[5]===n.message?f=t[6]:(f=(0,J.jsx)(`span`,{className:`text-foreground`,children:n.message}),t[5]=n.message,t[6]=f);let p;t[7]!==d||t[8]!==f?(p=(0,J.jsxs)(`span`,{className:`flex items-start gap-1.5 text-sm`,children:[d,f]}),t[7]=d,t[8]=f,t[9]=p):p=t[9];let m;t[10]!==r||t[11]!==s?(m=r({id:`enPTnx`,values:{displayLine:s}}),t[10]=r,t[11]=s,t[12]=m):m=t[12];let h;t[13]!==o||t[14]!==m?(h=(0,J.jsxs)(`span`,{className:`ps-5 font-mono text-xs text-muted-foreground`,children:[o,` · `,m]}),t[13]=o,t[14]=m,t[15]=h):h=t[15];let g;return t[16]!==p||t[17]!==h?(g=(0,J.jsxs)(J.Fragment,{children:[p,h]}),t[16]=p,t[17]=h,t[18]=g):g=t[18],g}function ve(e){return`${e.source}/${e.code}-${e.range.start.line}-${e.range.start.character}-${e.message}`}function ye(e){return e.reduce((e,t)=>e+ +((t.fixes?.length??0)>0),0)}function be(e){let t=(0,B.c)(13),{count:n,disabled:r,onClick:o,children:s}=e,{_:c}=a(),u;t[0]!==c||t[1]!==s||t[2]!==n?(u=s===void 0?c({id:`Izb10l`,values:{count:n}}):void 0,t[0]=c,t[1]=s,t[2]=n,t[3]=u):u=t[3];let d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,J.jsx)(O,{"aria-hidden":`true`,className:`size-3`}),t[4]=d):d=t[4];let f;t[5]!==s||t[6]!==n?(f=s??(0,J.jsx)(i,{id:`5_8TCr`,values:{count:n}}),t[5]=s,t[6]=n,t[7]=f):f=t[7];let p;return t[8]!==r||t[9]!==o||t[10]!==u||t[11]!==f?(p=(0,J.jsxs)(l,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,disabled:r,onClick:o,"aria-label":u,"data-testid":`problems-fix-all`,children:[d,f]}),t[8]=r,t[9]=o,t[10]=u,t[11]=f,t[12]=p):p=t[12],p}function xe(e){let t=(0,B.c)(21),{docName:n,diagnostics:r,onFix:o,onFixAll:s,onAskAi:c}=e,{_:u}=a(),[d,f]=(0,z.useState)(`doc`),p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p={status:`idle`},t[0]=p):p=t[0];let[m,h]=(0,z.useState)(p),[g,_]=(0,z.useState)(null),v=(0,z.useRef)(!0),y,b;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>(v.current=!0,()=>{v.current=!1}),b=[],t[1]=y,t[2]=b):(y=t[1],b=t[2]),(0,z.useEffect)(y,b);let x;if(t[3]!==u||t[4]!==m||t[5]!==r||t[6]!==n||t[7]!==c||t[8]!==o||t[9]!==s||t[10]!==g||t[11]!==d){let e=[...r].sort(he),a=async function(){h({status:`loading`});let e=await L();v.current&&h(e===null?{status:`failed`}:{status:`loaded`,result:e})},p=m.status===`loaded`?m.result.files.filter(we):[],y=async function(){if(g!==null||p.length===0)return;_({done:0,total:p.length});let e=[];for(let t of p){let n=await R(M(t.file));if(!v.current)return;n.ok||e.push({file:t.file,detail:n.errorDetail}),_(Ce)}if(_(null),e.length>0){let t=e[0];k.error(u({id:`fru3T7`,values:{0:e.length,1:p.length}}),{description:t===void 0?void 0:`${t.file}${t.detail===null?``:` — ${t.detail}`}`})}try{await a()}catch{v.current&&h({status:`failed`})}},b=function(e){f(e),e===`project`&&m.status===`idle`&&a()},S;t[13]===n?S=t[14]:(S=function(e){let t=ge(e);W(n,{kind:`lint`,detail:t}),window.dispatchEvent(new CustomEvent(me,{detail:t}))},t[13]=n,t[14]=S);let C=S,w;t[15]!==n||t[16]!==C?(w=function(e,t){let r=M(e);if(r===n){C(t);return}W(r,{kind:`lint`,detail:ge(t)}),window.location.hash=N(r)},t[15]=n,t[16]=C,t[17]=w):w=t[17];let E=w,D;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,J.jsx)(ie,{children:(0,J.jsx)(i,{id:`OXdGnd`})}),t[18]=D):D=t[18];let A=d===`doc`&&e.length>0&&(0,J.jsx)(re,{children:e.length}),j;t[19]===A?j=t[20]:(j=(0,J.jsxs)(ne,{children:[D,A]}),t[19]=A,t[20]=j),x=(0,J.jsxs)(ae,{children:[j,(0,J.jsx)(pe,{scope:d,onScopeChange:b}),d===`doc`?(0,J.jsx)(te,{className:`px-2 py-2`,children:e.length===0?(0,J.jsx)(F,{className:`px-2`,children:(0,J.jsx)(i,{id:`ZI8uvA`})}):(0,J.jsxs)(J.Fragment,{children:[s!==void 0&&(0,J.jsx)(`div`,{className:`flex items-center justify-end gap-2 px-2 pb-1`,children:(0,J.jsx)(be,{count:ye(e),disabled:ye(e)===0,onClick:s})}),(0,J.jsx)(`ul`,{"aria-label":u({id:`OXdGnd`}),className:`flex flex-col gap-0.5`,children:e.map(e=>{let t=e.range.start.line+1,n=o!==void 0&&(e.fixes?.length??0)>0,r=`${e.source}/${e.code}`;return(0,J.jsxs)(`li`,{className:`group relative rounded transition-colors hover:bg-muted`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>C(e),className:`flex w-full cursor-pointer flex-col gap-0.5 rounded px-2 py-1.5 text-left`,title:u({id:`aHPdYV`,values:{displayLine:t}}),children:(0,J.jsx)(_e,{diagnostic:e})}),n||c!==void 0?(0,J.jsxs)(`div`,{className:`absolute bottom-1 right-1 flex items-center gap-1 rounded bg-muted opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100 motion-reduce:transition-none`,children:[n?(0,J.jsxs)(l,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,onClick:()=>o?.(e),"aria-label":u({id:`fZj9em`,values:{flatId:r}}),"data-testid":`problems-fix`,children:[(0,J.jsx)(O,{"aria-hidden":`true`,className:`size-3`}),(0,J.jsx)(i,{id:`c4fVUV`})]}):null,c===void 0?null:(0,J.jsxs)(l,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,onClick:()=>c(e),"aria-label":u({id:`hh4mVC`,values:{flatId:r}}),"data-testid":`problems-ask-ai`,children:[(0,J.jsx)(T,{"aria-hidden":`true`,className:`size-3`}),(0,J.jsx)(i,{id:`xWEvuo`})]})]}):null]},ve(e))})})]})}):(0,J.jsx)(Ee,{audit:m,onRefresh:()=>void a(),onNavigate:E,fixableCount:p.reduce(Se,0),fixing:g,onFixAll:()=>void y()})]}),t[3]=u,t[4]=m,t[5]=r,t[6]=n,t[7]=c,t[8]=o,t[9]=s,t[10]=g,t[11]=d,t[12]=x}else x=t[12];return x}function Se(e,t){return e+ye(t.diagnostics)}function Ce(e){return e===null?e:{...e,done:e.done+1}}function we(e){return e.diagnostics.some(Te)}function Te(e){return(e.fixes?.length??0)>0}function Ee(e){let t=(0,B.c)(43),{audit:n,onRefresh:r,onNavigate:o,fixableCount:s,fixing:c,onFixAll:u}=e,{_:d}=a(),f=n.status===`loading`||n.status===`idle`,p;t[0]!==n.result||t[1]!==n.status?(p=n.status===`loaded`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(i,{id:`DsDwR-`,values:{0:n.result.errorCount}}),` · `,(0,J.jsx)(i,{id:`W1SI2K`,values:{0:n.result.warningCount}})]}),t[0]=n.result,t[1]=n.status,t[2]=p):p=t[2];let m;t[3]===p?m=t[4]:(m=(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,"data-testid":`problems-audit-summary`,children:p}),t[3]=p,t[4]=m);let h;t[5]!==d||t[6]!==c?(h=c===null?null:(0,J.jsx)(`span`,{className:`sr-only`,role:`status`,children:d({id:`gZElfU`,values:{0:c.done,1:c.total}})}),t[5]=d,t[6]=c,t[7]=h):h=t[7];let g=f||c!==null||s===0,_;t[8]===c?_=t[9]:(_=c===null?void 0:(0,J.jsx)(i,{id:`S9t1PI`,values:{0:c.done,1:c.total}}),t[8]=c,t[9]=_);let v;t[10]!==s||t[11]!==u||t[12]!==g||t[13]!==_?(v=(0,J.jsx)(be,{count:s,disabled:g,onClick:u,children:_}),t[10]=s,t[11]=u,t[12]=g,t[13]=_,t[14]=v):v=t[14];let y;t[15]===d?y=t[16]:(y=d({id:`WRdYfS`}),t[15]=d,t[16]=y);let b=f||c!==null,x;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,J.jsx)(E,{"aria-hidden":`true`,className:`size-3.5`}),t[17]=x):x=t[17];let S;t[18]!==r||t[19]!==y||t[20]!==b?(S=(0,J.jsx)(l,{variant:`ghost`,size:`icon`,className:`size-6 shrink-0 text-muted-foreground`,"aria-label":y,"data-testid":`problems-audit-refresh`,disabled:b,onClick:r,children:x}),t[18]=r,t[19]=y,t[20]=b,t[21]=S):S=t[21];let C;t[22]!==S||t[23]!==h||t[24]!==v?(C=(0,J.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[h,v,S]}),t[22]=S,t[23]=h,t[24]=v,t[25]=C):C=t[25];let w;t[26]!==C||t[27]!==m?(w=(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-2 pb-1`,children:[m,C]}),t[26]=C,t[27]=m,t[28]=w):w=t[28];let T;t[29]!==d||t[30]!==f?(T=f&&(0,J.jsx)(`div`,{className:`flex flex-col gap-1`,role:`status`,"aria-busy":`true`,"aria-label":d({id:`dx-TwN`}),children:[1,2,3].map(De)}),t[29]=d,t[30]=f,t[31]=T):T=t[31];let D;t[32]===n.status?D=t[33]:(D=n.status===`failed`&&(0,J.jsx)(ee,{className:`px-2 text-xs`,children:(0,J.jsx)(i,{id:`IFezUv`})}),t[32]=n.status,t[33]=D);let O;t[34]!==n.result||t[35]!==n.status||t[36]!==o?(O=n.status===`loaded`&&(0,J.jsx)(Oe,{result:n.result,onNavigate:o}),t[34]=n.result,t[35]=n.status,t[36]=o,t[37]=O):O=t[37];let k;return t[38]!==w||t[39]!==T||t[40]!==D||t[41]!==O?(k=(0,J.jsxs)(te,{className:`px-2 py-2`,"data-testid":`problems-project-scope`,children:[w,T,D,O]}),t[38]=w,t[39]=T,t[40]=D,t[41]=O,t[42]=k):k=t[42],k}function De(e){return(0,J.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded px-2 py-1.5`,children:[(0,J.jsx)(I,{className:`mt-0.5 size-3.5 shrink-0 rounded`}),(0,J.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,J.jsx)(I,{className:`h-3 w-28`}),(0,J.jsx)(I,{className:`h-3 w-40`})]})]},e)}function Oe(e){let t=(0,B.c)(10),{result:n,onNavigate:r}=e,{_:o}=a(),s;t[0]!==o||t[1]!==n.warnings?(s=n.warnings.length>0&&(0,J.jsx)(`ul`,{"aria-label":o({id:`Rsdhj9`}),className:`flex flex-col gap-0.5 pb-1`,children:n.warnings.map(ke)}),t[0]=o,t[1]=n.warnings,t[2]=s):s=t[2];let c;t[3]!==r||t[4]!==n.fileCount||t[5]!==n.files?(c=n.files.length===0?(0,J.jsx)(F,{className:`px-2`,children:(0,J.jsx)(i,{id:`k_Dqw1`,values:{0:n.fileCount}})}):n.files.map(e=>(0,J.jsx)(Ae,{file:e,onNavigate:r},e.file)),t[3]=r,t[4]=n.fileCount,t[5]=n.files,t[6]=c):c=t[6];let l;return t[7]!==s||t[8]!==c?(l=(0,J.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function ke(e,t){return(0,J.jsxs)(`li`,{className:`flex items-start gap-1.5 px-2 text-xs`,children:[(0,J.jsx)(D,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-amber-500`}),(0,J.jsx)(`span`,{className:`min-w-0 text-foreground`,children:e})]},`${t}-${e}`)}function Ae(e){let t=(0,B.c)(37),{file:n,onNavigate:r}=e,{_:i}=a(),o,s,c,l,u,m,h,g,_;if(t[0]!==i||t[1]!==n.diagnostics||t[2]!==n.file||t[3]!==r){let e=[...n.diagnostics].sort(he);s=p,h=!0,g=`problems-audit-group`;let a;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,J.jsx)(S,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90 motion-reduce:transition-none`}),t[13]=a):a=t[13];let v;t[14]===n.file?v=t[15]:(v=(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-foreground`,title:n.file,children:n.file}),t[14]=n.file,t[15]=v),_=(0,J.jsxs)(f,{className:`group flex w-full cursor-pointer items-center gap-1.5 rounded px-2 py-1.5 text-left transition-colors hover:bg-muted`,children:[a,v,(0,J.jsx)(P,{variant:`gray`,"data-testid":`problems-audit-file-count`,className:`shrink-0`,children:e.length})]}),o=d,m=`overflow-hidden data-[state=open]:animate-[collapsible-down_150ms_ease-out] data-[state=closed]:animate-[collapsible-up_150ms_ease-in]`,t[16]!==i||t[17]!==n.file?(c=i({id:`zAJzIg`,values:{0:n.file}}),t[16]=i,t[17]=n.file,t[18]=c):c=t[18],l=`flex flex-col gap-0.5 pb-1 ps-3`;let y;t[19]!==i||t[20]!==n.file||t[21]!==r?(y=e=>{let t=e.range.start.line+1;return(0,J.jsx)(`li`,{children:(0,J.jsx)(`button`,{type:`button`,onClick:()=>r(n.file,e),className:`flex w-full cursor-pointer flex-col gap-0.5 rounded px-2 py-1.5 text-left transition-colors hover:bg-muted`,title:i({id:`kDwcbW`,values:{0:n.file,displayLine:t}}),children:(0,J.jsx)(_e,{diagnostic:e})})},ve(e))},t[19]=i,t[20]=n.file,t[21]=r,t[22]=y):y=t[22],u=e.map(y),t[0]=i,t[1]=n.diagnostics,t[2]=n.file,t[3]=r,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=m,t[10]=h,t[11]=g,t[12]=_}else o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],m=t[9],h=t[10],g=t[11],_=t[12];let v;t[23]!==c||t[24]!==l||t[25]!==u?(v=(0,J.jsx)(`ul`,{"aria-label":c,className:l,children:u}),t[23]=c,t[24]=l,t[25]=u,t[26]=v):v=t[26];let y;t[27]!==o||t[28]!==m||t[29]!==v?(y=(0,J.jsx)(o,{className:m,children:v}),t[27]=o,t[28]=m,t[29]=v,t[30]=y):y=t[30];let b;return t[31]!==s||t[32]!==h||t[33]!==g||t[34]!==_||t[35]!==y?(b=(0,J.jsxs)(s,{defaultOpen:h,"data-testid":g,children:[_,y]}),t[31]=s,t[32]=h,t[33]=g,t[34]=_,t[35]=y,t[36]=b):b=t[36],b}var je={words:0,chars:0,tokens:0},Me=/[ -〿぀-ゟ゠-ヿ㐀-䶿一-鿿豈-﫿＀-￯฀-๿ក-៿]/,Ne=/[\p{L}\p{N}]/u,Pe=new Set([`text`,`inlineCode`,`code`,`tag`]),Fe=new Set([`html`,`definition`,`footnoteDefinition`,`yaml`,`toml`,`image`,`imageReference`,`mdxFlowExpression`,`mdxTextExpression`,`mdxjsEsm`,`rawMdxFallback`,`rawMdxFallbackMdast`]),Ie=new Set([`paragraph`,`heading`,`blockquote`,`list`,`listItem`,`thematicBreak`,`table`,`tableRow`,`tableCell`,`mdxJsxFlowElement`,`commentBlock`]);function Le(e,t){if(!e)return;let n=e.type;if(!Fe.has(n)){if(Pe.has(n)){e.value&&(t.push(e.value),n===`code`&&t.push(`
2
2
  `));return}if(n===`wikiLink`||n===`wikiLinkEmbed`){let n=e.data?.alias??e.value??``;n&&t.push(n);return}if(Array.isArray(e.children)){for(let n of e.children)Le(n,t);if(Ie.has(n)&&t.length>0){let e=t[t.length-1];e&&!e.endsWith(`
3
3
  `)&&t.push(`
4
4
  `)}}}}function Re(e){try{let t=h().parseToMdast(e),n=[];return Le(t,n),n.join(``).trim()}catch(t){return console.warn(`[document-stats] mdast parse failed, falling back to raw text`,t),e.trim()}}function ze(e){if(!e)return 0;let t=0;for(let n of e.split(/\s+/))Ne.test(n)&&t++;return t}function Be(e){let t=globalThis.Intl.Segmenter;if(!t)return ze(e);let n=new t(void 0,{granularity:`word`}),r=0;for(let t of n.segment(e))t.isWordLike&&r++;return r}function Ve(e){let t=Me.test(e)?1.5:4;return Math.ceil(e.length/t)}function He(e){return e?{words:Me.test(e)?Be(e):ze(e),chars:e.length,tokens:Ve(e)}:{words:0,chars:0,tokens:0}}function Ue(e){if(!e)return{words:0,chars:0,tokens:0};let{body:t}=v(e);return t.trim()?He(Re(t)):{words:0,chars:0,tokens:0}}function We(e,{isMarkdown:t}){let n=e.trim();return n?He(t?Re(e):n):je}var Q=new Map,$=new Set,Ge=(e,t)=>`${t}:${e}`;function Ke(){for(let e of $)e()}function qe(e,t,n){let r=Ge(e,t);if(n===null){Q.delete(r)&&Ke();return}let i=Q.get(r);i&&i.words===n.words&&i.chars===n.chars&&i.tokens===n.tokens||(Q.set(r,n),Ke())}function Je(e,t){return e===null?null:Q.get(Ge(e,t))??null}function Ye(e){return $.add(e),()=>{$.delete(e)}}function Xe(e){let{from:t,to:n,empty:r}=e.state.selection;if(r)return null;let i=e.state.doc.textBetween(t,n,`
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{n as t}from"./DocumentContext-Dog3N-Wc.js";import{t as n}from"./react-JNybMug3.js";import{t as r}from"./compiler-runtime-dQcBxOhn.js";import{B as i}from"./CodeMirrorPropInput-Cx9FW420.js";import{a,gt as o,i as s}from"./dist-zc03OoUp.js";import{o as c}from"./documents-events-BTDcCELc.js";import{n as l}from"./agent-presence-DNKEv-BU.js";import{t as u}from"./lru-string-cache-DfQjUEBK.js";var d=r(),f=e(n(),1),p=500,m=64;async function h(e){let t=`/api/agent-activity?agentId=${encodeURIComponent(e)}`,n=await fetch(t),r;try{r=await n.json()}catch(e){throw new i(`Could not parse /api/agent-activity response.`,{cause:e,status:n.status})}if(!n.ok){let e=o.safeParse(r);throw e.success?Error(e.data.title):new i(`/api/agent-activity returned a non-RFC-9457 error response.`,{cause:e.error,status:n.status})}let a=s.safeParse(r);if(!a.success)throw new i(`/api/agent-activity returned a body that did not match AgentActivitySuccessSchema.`,{cause:a.error,status:n.status});return a.data}async function g(e,t,n){let r=`/api/agent-burst-diff?agentId=${encodeURIComponent(e)}&docName=${encodeURIComponent(t)}&keptCount=${n}`,s=await fetch(r),c;try{c=await s.json()}catch(e){throw new i(`Could not parse /api/agent-burst-diff response.`,{cause:e,status:s.status})}if(!s.ok){let e=o.safeParse(c);throw e.success?Error(e.data.title):new i(`/api/agent-burst-diff returned a non-RFC-9457 error response.`,{cause:e.error,status:s.status})}let l=a.safeParse(c);if(!l.success)throw new i(`/api/agent-burst-diff returned a body that did not match AgentBurstDiffSuccessSchema.`,{cause:l.error,status:s.status});let{diff:u,before:d,after:f}=l.data;return{diff:u,before:d,after:f}}function _(e){let n=(0,d.c)(23),{systemProvider:r}=t(),[i,a]=(0,f.useState)(null),[o,s]=(0,f.useState)(`idle`),[l,_]=(0,f.useState)(null),b;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(b=new u(m),n[0]=b):b=n[0];let x=(0,f.useRef)(b),S=(0,f.useRef)(0),C;n[1]===r?C=n[2]:(C=e=>{let t=S.current+=1;s(`loading`),_(null),h(e).then(n=>{if(S.current!==t)return;let i=y(r,e);a({...n,writingDocs:i}),s(`ready`)}).catch(e=>{S.current===t&&(_(e instanceof Error?e.message:String(e)),s(`error`))})},n[1]=r,n[2]=C);let w=C,T;n[3]!==e||n[4]!==w?(T=()=>{if(!e){S.current+=1,a(null),s(`idle`),_(null),x.current.clear();return}x.current.clear(),w(e);let t=null,n=c(n=>{n.includes(`session-activity`)&&(t&&clearTimeout(t),t=setTimeout(()=>{t=null,w(e)},p))});return()=>{t&&clearTimeout(t),n()}},n[3]=e,n[4]=w,n[5]=T):T=n[5];let E;n[6]===e?E=n[7]:(E=[e],n[6]=e,n[7]=E),(0,f.useEffect)(T,E);let D,O;n[8]!==e||n[9]!==r?(D=()=>{if(!e||!r)return;let t=()=>{if(!r.awareness)return;let t=y(r,e);a(e=>!e||v(e.writingDocs,t)?e:{...e,writingDocs:t})},n=r.awareness;if(!n||typeof n.on!=`function`){t();return}n.on(`update`,t),t();let i=setInterval(t,1e3);return()=>{clearInterval(i),typeof n.off==`function`&&n.off(`update`,t)}},O=[e,r],n[8]=e,n[9]=r,n[10]=D,n[11]=O):(D=n[10],O=n[11]),(0,f.useEffect)(D,O);let k;n[12]===e?k=n[13]:(k=async(t,n)=>{if(!e)return``;let r=`${t}\0${n}`,i=x.current.get(r);if(i!==void 0)return i;let{diff:a}=await g(e,t,n);return x.current.set(r,a),a},n[12]=e,n[13]=k);let A=k,j;n[14]!==e||n[15]!==w?(j=()=>{e&&w(e)},n[14]=e,n[15]=w,n[16]=j):j=n[16];let M=j,N;return n[17]!==i||n[18]!==l||n[19]!==A||n[20]!==M||n[21]!==o?(N={data:i,status:o,error:l,reload:M,fetchBurstDiff:A},n[17]=i,n[18]=l,n[19]=A,n[20]=M,n[21]=o,n[22]=N):N=n[22],N}function v(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function y(e,t){let n=new Set;if(!e)return n;let r=e.awareness;if(!l(r))return n;let i=[t,t.startsWith(`agent-`)?t.slice(6):`agent-${t}`];for(let e of r.getStates().values()){let t=e.agentPresence;if(t)for(let e of i){let r=t[e];r&&r.mode===`writing`&&r.currentDoc&&n.add(r.currentDoc)}}return n}export{_ as n,g as t};
1
+ import{i as e}from"./chunk-DseTPa7n.js";import{n as t}from"./DocumentContext-CqohW6HK.js";import{t as n}from"./react-JNybMug3.js";import{t as r}from"./compiler-runtime-dQcBxOhn.js";import{B as i}from"./CodeMirrorPropInput-FVyKUYn4.js";import{a,gt as o,i as s}from"./dist-BkWgKwL8.js";import{o as c}from"./documents-events-DFEJCEAH.js";import{n as l}from"./agent-presence-CD4PApzx.js";import{t as u}from"./lru-string-cache-DShn2dWs.js";var d=r(),f=e(n(),1),p=500,m=64;async function h(e){let t=`/api/agent-activity?agentId=${encodeURIComponent(e)}`,n=await fetch(t),r;try{r=await n.json()}catch(e){throw new i(`Could not parse /api/agent-activity response.`,{cause:e,status:n.status})}if(!n.ok){let e=o.safeParse(r);throw e.success?Error(e.data.title):new i(`/api/agent-activity returned a non-RFC-9457 error response.`,{cause:e.error,status:n.status})}let a=s.safeParse(r);if(!a.success)throw new i(`/api/agent-activity returned a body that did not match AgentActivitySuccessSchema.`,{cause:a.error,status:n.status});return a.data}async function g(e,t,n){let r=`/api/agent-burst-diff?agentId=${encodeURIComponent(e)}&docName=${encodeURIComponent(t)}&keptCount=${n}`,s=await fetch(r),c;try{c=await s.json()}catch(e){throw new i(`Could not parse /api/agent-burst-diff response.`,{cause:e,status:s.status})}if(!s.ok){let e=o.safeParse(c);throw e.success?Error(e.data.title):new i(`/api/agent-burst-diff returned a non-RFC-9457 error response.`,{cause:e.error,status:s.status})}let l=a.safeParse(c);if(!l.success)throw new i(`/api/agent-burst-diff returned a body that did not match AgentBurstDiffSuccessSchema.`,{cause:l.error,status:s.status});let{diff:u,before:d,after:f}=l.data;return{diff:u,before:d,after:f}}function _(e){let n=(0,d.c)(23),{systemProvider:r}=t(),[i,a]=(0,f.useState)(null),[o,s]=(0,f.useState)(`idle`),[l,_]=(0,f.useState)(null),b;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(b=new u(m),n[0]=b):b=n[0];let x=(0,f.useRef)(b),S=(0,f.useRef)(0),C;n[1]===r?C=n[2]:(C=e=>{let t=S.current+=1;s(`loading`),_(null),h(e).then(n=>{if(S.current!==t)return;let i=y(r,e);a({...n,writingDocs:i}),s(`ready`)}).catch(e=>{S.current===t&&(_(e instanceof Error?e.message:String(e)),s(`error`))})},n[1]=r,n[2]=C);let w=C,T;n[3]!==e||n[4]!==w?(T=()=>{if(!e){S.current+=1,a(null),s(`idle`),_(null),x.current.clear();return}x.current.clear(),w(e);let t=null,n=c(n=>{n.includes(`session-activity`)&&(t&&clearTimeout(t),t=setTimeout(()=>{t=null,w(e)},p))});return()=>{t&&clearTimeout(t),n()}},n[3]=e,n[4]=w,n[5]=T):T=n[5];let E;n[6]===e?E=n[7]:(E=[e],n[6]=e,n[7]=E),(0,f.useEffect)(T,E);let D,O;n[8]!==e||n[9]!==r?(D=()=>{if(!e||!r)return;let t=()=>{if(!r.awareness)return;let t=y(r,e);a(e=>!e||v(e.writingDocs,t)?e:{...e,writingDocs:t})},n=r.awareness;if(!n||typeof n.on!=`function`){t();return}n.on(`update`,t),t();let i=setInterval(t,1e3);return()=>{clearInterval(i),typeof n.off==`function`&&n.off(`update`,t)}},O=[e,r],n[8]=e,n[9]=r,n[10]=D,n[11]=O):(D=n[10],O=n[11]),(0,f.useEffect)(D,O);let k;n[12]===e?k=n[13]:(k=async(t,n)=>{if(!e)return``;let r=`${t}\0${n}`,i=x.current.get(r);if(i!==void 0)return i;let{diff:a}=await g(e,t,n);return x.current.set(r,a),a},n[12]=e,n[13]=k);let A=k,j;n[14]!==e||n[15]!==w?(j=()=>{e&&w(e)},n[14]=e,n[15]=w,n[16]=j):j=n[16];let M=j,N;return n[17]!==i||n[18]!==l||n[19]!==A||n[20]!==M||n[21]!==o?(N={data:i,status:o,error:l,reload:M,fetchBurstDiff:A},n[17]=i,n[18]=l,n[19]=A,n[20]=M,n[21]=o,n[22]=N):N=n[22],N}function v(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function y(e,t){let n=new Set;if(!e)return n;let r=e.awareness;if(!l(r))return n;let i=[t,t.startsWith(`agent-`)?t.slice(6):`agent-${t}`];for(let e of r.getStates().values()){let t=e.agentPresence;if(t)for(let e of i){let r=t[e];r&&r.mode===`writing`&&r.currentDoc&&n.add(r.currentDoc)}}return n}export{_ as n,g as t};
@@ -1,2 +1,2 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{Oa as r,ba as i}from"./dist-zc03OoUp.js";var a=e(t(),1),o=n(),s=/^#[0-9a-fA-F]{6}$/,c={background:`#0f172a`,surface:`#1e293b`,foreground:`#e2e8f0`,primary:`#6366f1`,accent:`#22d3ee`,border:`#334155`};function l(e){return typeof e==`string`&&s.test(e)}function u(e){let t={...c};if(e)for(let n of Object.keys(c)){let r=e[n];l(r)&&(t[n]=r)}return t}function d(e){let t=l(e)?e:`#000000`,n=e=>{let n=Number.parseInt(t.slice(1+e*2,3+e*2),16)/255;return n<=.03928?n/12.92:((n+.055)/1.055)**2.4};return .2126*n(0)+.7152*n(1)+.0722*n(2)}function f(e){return d(e.background)<.5?`dark`:`light`}function p(e){return d(e)<.5?`#ffffff`:`#0a0a0a`}function m(e){return{bg:e.background,bgElevated:e.surface,bgSubtle:e.surface,fg:e.foreground,fgMuted:`color-mix(in oklab, ${e.foreground} 55%, ${e.background})`,border:e.border,primary:e.primary,primaryFg:p(e.primary),red:`#e5534b`,green:`#3fb950`,yellow:`#d29922`,blue:e.accent,cyan:e.accent,orange:`#db8d3f`,purple:e.accent}}function h(e){let t=i(m(e)),n=Object.entries(t).map(([e,t])=>` --${e}: ${t};`);return`html[data-color-theme="custom"] {\n color-scheme: ${f(e)};\n${n.join(`
1
+ import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{Oa as r,ba as i}from"./dist-BkWgKwL8.js";var a=e(t(),1),o=n(),s=/^#[0-9a-fA-F]{6}$/,c={background:`#0f172a`,surface:`#1e293b`,foreground:`#e2e8f0`,primary:`#6366f1`,accent:`#22d3ee`,border:`#334155`};function l(e){return typeof e==`string`&&s.test(e)}function u(e){let t={...c};if(e)for(let n of Object.keys(c)){let r=e[n];l(r)&&(t[n]=r)}return t}function d(e){let t=l(e)?e:`#000000`,n=e=>{let n=Number.parseInt(t.slice(1+e*2,3+e*2),16)/255;return n<=.03928?n/12.92:((n+.055)/1.055)**2.4};return .2126*n(0)+.7152*n(1)+.0722*n(2)}function f(e){return d(e.background)<.5?`dark`:`light`}function p(e){return d(e)<.5?`#ffffff`:`#0a0a0a`}function m(e){return{bg:e.background,bgElevated:e.surface,bgSubtle:e.surface,fg:e.foreground,fgMuted:`color-mix(in oklab, ${e.foreground} 55%, ${e.background})`,border:e.border,primary:e.primary,primaryFg:p(e.primary),red:`#e5534b`,green:`#3fb950`,yellow:`#d29922`,blue:e.accent,cyan:e.accent,orange:`#db8d3f`,purple:e.accent}}function h(e){let t=i(m(e)),n=Object.entries(t).map(([e,t])=>` --${e}: ${t};`);return`html[data-color-theme="custom"] {\n color-scheme: ${f(e)};\n${n.join(`
2
2
  `)}\n}`}var g=`ok-color-theme-v1`,_=`ok-custom-theme-v1`,v=`data-color-theme`,y=`ok-custom-theme`;function b(e){let t=document.getElementById(y);t||(t=document.createElement(`style`),t.id=y,document.head.appendChild(t)),t.textContent!==e&&(t.textContent=e)}function x(){document.getElementById(y)?.remove()}function S(e,t,n=!0){if(typeof document>`u`)return;let i=r(n?e:`default`),a=document.documentElement;i.id===`default`?a.removeAttribute(v):a.setAttribute(v,i.id);let o=null;if(i.id===`custom`){let e=u(t),n=h(e);b(n),o=JSON.stringify({css:n,dark:f(e)===`dark`})}else x();try{i.id===`default`?localStorage.removeItem(g):localStorage.setItem(g,i.id),o?localStorage.setItem(_,o):localStorage.removeItem(_)}catch{}}function C(e,t,n){let r=(0,o.c)(12),i=n===void 0?!0:n,s;r[0]!==e||r[1]!==t||r[2]!==i?(s=i&&e===`custom`?JSON.stringify(t??null):``,r[0]=e,r[1]=t,r[2]=i,r[3]=s):s=r[3];let c=s,l;r[4]!==e||r[5]!==t||r[6]!==i?(l=()=>{S(e,t,i)},r[4]=e,r[5]=t,r[6]=i,r[7]=l):l=r[7];let u;r[8]!==e||r[9]!==i||r[10]!==c?(u=[e,c,i],r[8]=e,r[9]=i,r[10]=c,r[11]=u):u=r[11],(0,a.useEffect)(l,u)}export{f as a,u as c,c as i,S as n,m as o,C as r,l as s,v as t};
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{d as r,f as i,l as a,m as o,p as s,u as c}from"./dist-zc03OoUp.js";var l=e(t(),1),u=n();async function d(e){let t;try{t=await fetch(`/api/config`,{signal:e,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return{status:`error`,code:`network`}}if(t.status===404||t.status===501)return{status:`absent`};if(!t.ok)return{status:`error`,code:t.status};let n;try{n=await t.json()}catch{return{status:`error`,code:`invalid-body`}}if(typeof n!=`object`||!n||Array.isArray(n))return{status:`error`,code:`invalid-body`};let r=n;return{status:`ok`,config:{collabUrl:typeof r.collabUrl==`string`?r.collabUrl:null,previewUrl:typeof r.previewUrl==`string`?r.previewUrl:null,port:typeof r.port==`number`?r.port:0,singleFile:r.singleFile===!0}}}function f(e){return b(e,i)}function p(e){return b(e,o)}function m(e){return b(e,a)}function h(e){return b(e,r)}function g(e){return b(e,c)}function _(e){let t=b(e,s);if(!t)return null;try{return{docName:t.docName,sv:v(t.sv)}}catch{return null}}function v(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function y(e,t){let n=p(e);if(n){t.onServerInfo?.(n);return}let r=m(e);if(r){t.onBranchSwitched?.(r);return}let i=_(e);if(i){t.onDiskAck?.(i);return}let a=f(e);if(a){t.onDerivedView?.(a);return}let o=h(e);if(o){t.onConfigValidationRejected?.(o);return}let s=g(e);if(s){t.onConfigIgnoreNestedError?.(s);return}t.onUnknown?.(e)}function b(e,t){let n;try{n=JSON.parse(e)}catch{return null}let r=t.safeParse(n);return r.success?r.data:null}function x(){return typeof location>`u`?`ws://localhost/collab`:`${location.protocol===`https:`?`wss`:`ws`}://${location.host}/collab`}function S(e){if(e===void 0)return null;let t=e.okDesktop;return!t||!t.config.collabUrl||t.config.collabUrl.length===0?null:t}function C(e){return{collabUrl:e.collabUrl,attempts:0,terminal:!1,lastError:null}}var w=2e3,T=15e3;function E(e){let t=e.terminalAfterMs??3e4,n=e.initialDelayMs??w,r=e.maxDelayMs??T,i=e.log??{info:console.info,warn:console.warn},a=new AbortController,o=null,s=n,c=0,l=!1,u=!1,d=null,f=e.now(),p=async()=>{c+=1;let n=null;try{let t=await e.fetchConfig(a.signal);t.status===`absent`?(n=e.fallbackUrl(),d=null):t.status===`ok`&&t.config.collabUrl!==null?(n=t.config.collabUrl,d=null):t.status===`ok`?(u||(u=!0,i.info(`[collab-url] ok ui responded but server.lock has no port yet — retrying`)),d={kind:`null-collab`}):t.status===`error`&&(i.warn(`[collab-url] /api/config error (${t.code}) — retrying in ${s}ms`),d={kind:`error`,code:t.code})}catch(e){if(e.name===`AbortError`)return;d={kind:`error`,code:`network`}}if(!l){if(n!==null){e.onStateChange({collabUrl:n,attempts:c,terminal:!1,lastError:null});return}if(e.now()-f>=t){e.onStateChange({collabUrl:null,attempts:c,terminal:!0,lastError:d});return}e.onStateChange({collabUrl:null,attempts:c,terminal:!1,lastError:d}),o=e.setTimeout(()=>{p()},s),s=Math.min(s*2,r)}};return p(),{cancel:()=>{l=!0,a.abort(),o!==null&&(e.clearTimeout(o),o=null)}}}function D(){let e=(0,u.c)(8),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={collabUrl:null,attempts:0,terminal:!1,lastError:null},e[0]=t):t=e[0];let[n,r]=(0,l.useState)(t),i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i={token:0},e[1]=i):i=e[1];let a=(0,l.useRef)(i),[o,s]=(0,l.useState)(0),c;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=a.current.token=a.current.token+1,t=S(window);if(t){r(C(t.config));let n=t.onProjectSwitched(t=>{e===a.current.token&&r(C(t))});return()=>{n()}}let n=E({fetchConfig:d,fallbackUrl:x,now:Date.now,setTimeout:j,clearTimeout:A,onStateChange:t=>{e===a.current.token&&r(t)}});return()=>{n.cancel()}},e[2]=c):c=e[2];let f;e[3]===o?f=e[4]:(f=[o],e[3]=o,e[4]=f),(0,l.useEffect)(c,f);let p;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>{a.current.token=a.current.token+1,r(k),s(O)},e[5]=p):p=e[5];let m=p,h;return e[6]===n?h=e[7]:(h={...n,retry:m},e[6]=n,e[7]=h),h}function O(e){return e+1}function k(e){return{...e,terminal:!1,lastError:null}}function A(e){return globalThis.clearTimeout(e)}function j(e,t){return globalThis.setTimeout(e,t)}export{d as i,D as n,y as r,S as t};
1
+ import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{d as r,f as i,l as a,m as o,p as s,u as c}from"./dist-BkWgKwL8.js";var l=e(t(),1),u=n();async function d(e){let t;try{t=await fetch(`/api/config`,{signal:e,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return{status:`error`,code:`network`}}if(t.status===404||t.status===501)return{status:`absent`};if(!t.ok)return{status:`error`,code:t.status};let n;try{n=await t.json()}catch{return{status:`error`,code:`invalid-body`}}if(typeof n!=`object`||!n||Array.isArray(n))return{status:`error`,code:`invalid-body`};let r=n;return{status:`ok`,config:{collabUrl:typeof r.collabUrl==`string`?r.collabUrl:null,previewUrl:typeof r.previewUrl==`string`?r.previewUrl:null,port:typeof r.port==`number`?r.port:0,singleFile:r.singleFile===!0}}}function f(e){return b(e,i)}function p(e){return b(e,o)}function m(e){return b(e,a)}function h(e){return b(e,r)}function g(e){return b(e,c)}function _(e){let t=b(e,s);if(!t)return null;try{return{docName:t.docName,sv:v(t.sv)}}catch{return null}}function v(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function y(e,t){let n=p(e);if(n){t.onServerInfo?.(n);return}let r=m(e);if(r){t.onBranchSwitched?.(r);return}let i=_(e);if(i){t.onDiskAck?.(i);return}let a=f(e);if(a){t.onDerivedView?.(a);return}let o=h(e);if(o){t.onConfigValidationRejected?.(o);return}let s=g(e);if(s){t.onConfigIgnoreNestedError?.(s);return}t.onUnknown?.(e)}function b(e,t){let n;try{n=JSON.parse(e)}catch{return null}let r=t.safeParse(n);return r.success?r.data:null}function x(){return typeof location>`u`?`ws://localhost/collab`:`${location.protocol===`https:`?`wss`:`ws`}://${location.host}/collab`}function S(e){if(e===void 0)return null;let t=e.okDesktop;return!t||!t.config.collabUrl||t.config.collabUrl.length===0?null:t}function C(e){return{collabUrl:e.collabUrl,attempts:0,terminal:!1,lastError:null}}var w=2e3,T=15e3;function E(e){let t=e.terminalAfterMs??3e4,n=e.initialDelayMs??w,r=e.maxDelayMs??T,i=e.log??{info:console.info,warn:console.warn},a=new AbortController,o=null,s=n,c=0,l=!1,u=!1,d=null,f=e.now(),p=async()=>{c+=1;let n=null;try{let t=await e.fetchConfig(a.signal);t.status===`absent`?(n=e.fallbackUrl(),d=null):t.status===`ok`&&t.config.collabUrl!==null?(n=t.config.collabUrl,d=null):t.status===`ok`?(u||(u=!0,i.info(`[collab-url] ok ui responded but server.lock has no port yet — retrying`)),d={kind:`null-collab`}):t.status===`error`&&(i.warn(`[collab-url] /api/config error (${t.code}) — retrying in ${s}ms`),d={kind:`error`,code:t.code})}catch(e){if(e.name===`AbortError`)return;d={kind:`error`,code:`network`}}if(!l){if(n!==null){e.onStateChange({collabUrl:n,attempts:c,terminal:!1,lastError:null});return}if(e.now()-f>=t){e.onStateChange({collabUrl:null,attempts:c,terminal:!0,lastError:d});return}e.onStateChange({collabUrl:null,attempts:c,terminal:!1,lastError:d}),o=e.setTimeout(()=>{p()},s),s=Math.min(s*2,r)}};return p(),{cancel:()=>{l=!0,a.abort(),o!==null&&(e.clearTimeout(o),o=null)}}}function D(){let e=(0,u.c)(8),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={collabUrl:null,attempts:0,terminal:!1,lastError:null},e[0]=t):t=e[0];let[n,r]=(0,l.useState)(t),i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i={token:0},e[1]=i):i=e[1];let a=(0,l.useRef)(i),[o,s]=(0,l.useState)(0),c;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=a.current.token=a.current.token+1,t=S(window);if(t){r(C(t.config));let n=t.onProjectSwitched(t=>{e===a.current.token&&r(C(t))});return()=>{n()}}let n=E({fetchConfig:d,fallbackUrl:x,now:Date.now,setTimeout:j,clearTimeout:A,onStateChange:t=>{e===a.current.token&&r(t)}});return()=>{n.cancel()}},e[2]=c):c=e[2];let f;e[3]===o?f=e[4]:(f=[o],e[3]=o,e[4]=f),(0,l.useEffect)(c,f);let p;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>{a.current.token=a.current.token+1,r(k),s(O)},e[5]=p):p=e[5];let m=p,h;return e[6]===n?h=e[7]:(h={...n,retry:m},e[6]=n,e[7]=h),h}function O(e){return e+1}function k(e){return{...e,terminal:!1,lastError:null}}function A(e){return globalThis.clearTimeout(e)}function j(e,t){return globalThis.setTimeout(e,t)}export{d as i,D as n,y as r,S as t};
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{t as r}from"./use-apply-config-color-theme-CTTOdBYC.js";var i=e(t(),1),a=n(),o={background:`#171717`,foreground:`#e5e5e5`,cursor:`#e5e5e5`,cursorAccent:`#171717`,selectionBackground:`#3a3d41`,black:`#000000`,red:`#cd3131`,green:`#0dbc79`,yellow:`#e5e510`,blue:`#2472c8`,magenta:`#bc3fbc`,cyan:`#11a8cd`,white:`#e5e5e5`,brightBlack:`#666666`,brightRed:`#f14c4c`,brightGreen:`#23d18b`,brightYellow:`#f5f543`,brightBlue:`#3b8eea`,brightMagenta:`#d670d6`,brightCyan:`#29b8db`,brightWhite:`#ffffff`},s={background:`#ffffff`,foreground:`#262626`,cursor:`#262626`,cursorAccent:`#ffffff`,selectionBackground:`#add6ff`,black:`#000000`,red:`#cd3131`,green:`#00bc00`,yellow:`#949800`,blue:`#0451a5`,magenta:`#bc05bc`,cyan:`#0598bc`,white:`#555555`,brightBlack:`#666666`,brightRed:`#cd3131`,brightGreen:`#14ce14`,brightYellow:`#b5ba00`,brightBlue:`#0451a5`,brightMagenta:`#bc05bc`,brightCyan:`#0598bc`,brightWhite:`#a5a5a5`};function c(e){return e===`dark`?o:s}function l(e){try{let t=document.createElement(`span`);t.style.display=`none`,t.style.backgroundColor=`var(${e})`,document.body.appendChild(t);try{let e=getComputedStyle(t).backgroundColor;return!e||e===`rgba(0, 0, 0, 0)`||e===`transparent`||e.includes(`var(`)?null:e}finally{t.remove()}}catch{return null}}function u(e,t=l){let n=c(e),r=t(`--background`)??n.background,i=t(`--foreground`)??n.foreground;return{...n,background:r,foreground:i,cursor:i,cursorAccent:r,selectionBackground:t(`--selection-soft`)??n.selectionBackground}}function d(e,t){let n=new Set([...Object.keys(e),...Object.keys(t)]);for(let r of n)if(e[r]!==t[r])return!1;return!0}function f(e){let t=(0,a.c)(5),n;t[0]===e?n=t[1]:(n=()=>u(e),t[0]=e,t[1]=n);let[o,s]=(0,i.useState)(n),c,l;return t[2]===e?(c=t[3],l=t[4]):(c=()=>{let t=()=>{let t=u(e);s(e=>d(e,t)?e:t)};t();let n=new MutationObserver(t);return n.observe(document.documentElement,{attributes:!0,attributeFilter:[r,`class`]}),n.observe(document.head,{childList:!0,subtree:!0,characterData:!0}),()=>n.disconnect()},l=[e],t[2]=e,t[3]=c,t[4]=l),(0,i.useEffect)(c,l),o}export{f as t};
1
+ import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{t as r}from"./use-apply-config-color-theme-C5vmf6FI.js";var i=e(t(),1),a=n(),o={background:`#171717`,foreground:`#e5e5e5`,cursor:`#e5e5e5`,cursorAccent:`#171717`,selectionBackground:`#3a3d41`,black:`#000000`,red:`#cd3131`,green:`#0dbc79`,yellow:`#e5e510`,blue:`#2472c8`,magenta:`#bc3fbc`,cyan:`#11a8cd`,white:`#e5e5e5`,brightBlack:`#666666`,brightRed:`#f14c4c`,brightGreen:`#23d18b`,brightYellow:`#f5f543`,brightBlue:`#3b8eea`,brightMagenta:`#d670d6`,brightCyan:`#29b8db`,brightWhite:`#ffffff`},s={background:`#ffffff`,foreground:`#262626`,cursor:`#262626`,cursorAccent:`#ffffff`,selectionBackground:`#add6ff`,black:`#000000`,red:`#cd3131`,green:`#00bc00`,yellow:`#949800`,blue:`#0451a5`,magenta:`#bc05bc`,cyan:`#0598bc`,white:`#555555`,brightBlack:`#666666`,brightRed:`#cd3131`,brightGreen:`#14ce14`,brightYellow:`#b5ba00`,brightBlue:`#0451a5`,brightMagenta:`#bc05bc`,brightCyan:`#0598bc`,brightWhite:`#a5a5a5`};function c(e){return e===`dark`?o:s}function l(e){try{let t=document.createElement(`span`);t.style.display=`none`,t.style.backgroundColor=`var(${e})`,document.body.appendChild(t);try{let e=getComputedStyle(t).backgroundColor;return!e||e===`rgba(0, 0, 0, 0)`||e===`transparent`||e.includes(`var(`)?null:e}finally{t.remove()}}catch{return null}}function u(e,t=l){let n=c(e),r=t(`--background`)??n.background,i=t(`--foreground`)??n.foreground;return{...n,background:r,foreground:i,cursor:i,cursorAccent:r,selectionBackground:t(`--selection-soft`)??n.selectionBackground}}function d(e,t){let n=new Set([...Object.keys(e),...Object.keys(t)]);for(let r of n)if(e[r]!==t[r])return!1;return!0}function f(e){let t=(0,a.c)(5),n;t[0]===e?n=t[1]:(n=()=>u(e),t[0]=e,t[1]=n);let[o,s]=(0,i.useState)(n),c,l;return t[2]===e?(c=t[3],l=t[4]):(c=()=>{let t=()=>{let t=u(e);s(e=>d(e,t)?e:t)};t();let n=new MutationObserver(t);return n.observe(document.documentElement,{attributes:!0,attributeFilter:[r,`class`]}),n.observe(document.head,{childList:!0,subtree:!0,characterData:!0}),()=>n.disconnect()},l=[e],t[2]=e,t[3]=c,t[4]=l),(0,i.useEffect)(c,l),o}export{f as t};
@@ -1 +1 @@
1
- import{t as e}from"./compiler-runtime-dQcBxOhn.js";import{t}from"./terminal-telemetry-B-c91nRO.js";import{Sa as n}from"./dist-zc03OoUp.js";import"./config-provider-pXCSDe7I.js";import{n as r}from"./config-context-DOXKMLrN.js";var i=e();function a(){let e=(0,i.c)(3),{projectLocalConfig:t,projectLocalSynced:n}=r(),a=t?.terminal?.enabled??null,o;return e[0]!==n||e[1]!==a?(o={enabled:a,synced:n},e[0]=n,e[1]=a,e[2]=o):o=e[2],o}function o(){let e=(0,i.c)(2),{projectLocalBinding:a}=r();if(a===null)return null;let o;return e[0]===a?o=e[1]:(o=e=>{let r=a.patch({terminal:{enabled:e}});return r.ok&&e&&t(),r.ok?{ok:!0}:{ok:!1,error:n(r.error)}},e[0]=a,e[1]=o),o}export{o as n,a as t};
1
+ import{t as e}from"./compiler-runtime-dQcBxOhn.js";import{t}from"./terminal-telemetry-CVI6nvoX.js";import{Sa as n}from"./dist-BkWgKwL8.js";import"./config-provider-DI7r73Nd.js";import{n as r}from"./config-context-2ksv1vz_.js";var i=e();function a(){let e=(0,i.c)(3),{projectLocalConfig:t,projectLocalSynced:n}=r(),a=t?.terminal?.enabled??null,o;return e[0]!==n||e[1]!==a?(o={enabled:a,synced:n},e[0]=n,e[1]=a,e[2]=o):o=e[2],o}function o(){let e=(0,i.c)(2),{projectLocalBinding:a}=r();if(a===null)return null;let o;return e[0]===a?o=e[1]:(o=e=>{let r=a.patch({terminal:{enabled:e}});return r.ok&&e&&t(),r.ok?{ok:!0}:{ok:!1,error:n(r.error)}},e[0]=a,e[1]=o),o}export{o as n,a as t};
@@ -1,4 +1,4 @@
1
- import{i as e,t}from"./chunk-DseTPa7n.js";import{t as n}from"./jsx-runtime-DyiINK0N.js";import{n as r,p as i}from"./DocumentContext-Dog3N-Wc.js";import{t as a}from"./react-JNybMug3.js";import{t as o}from"./react-dom-Db7zF7dM.js";import{t as s}from"./compiler-runtime-dQcBxOhn.js";import{I as c,et as l,st as u}from"./CodeMirrorPropInput-Cx9FW420.js";import{Bi as d,Gi as f,K as p,Ki as m,Oi as h,Qi as g,Vi as _,Xi as v,Yr as y,ea as b,hi as x,na as S,ta as C}from"./dist-zc03OoUp.js";import{t as ee}from"./libesm-ypyqdUL5.js";var w=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Pointer=void 0,e.unescapeToken=t,e.escapeToken=n;function t(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function n(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}e.Pointer=function(){function e(e){e===void 0&&(e=[``]),this.tokens=e}return e.fromJSON=function(n){var r=n.split(`/`).map(t);if(r[0]!==``)throw Error(`Invalid JSON Pointer: ${n}`);return new e(r)},e.prototype.toString=function(){return this.tokens.map(n).join(`/`)},e.prototype.evaluate=function(e){for(var t=null,n=``,r=e,i=1,a=this.tokens.length;i<a;i++)t=r,n=this.tokens[i],!(n==`__proto__`||n==`constructor`||n==`prototype`)&&(r=(t||{})[n]);return{parent:t,key:n,value:r}},e.prototype.get=function(e){return this.evaluate(e).value},e.prototype.set=function(e,t){var n=this.evaluate(e);n.parent&&(n.parent[n.key]=t)},e.prototype.push=function(e){this.tokens.push(e)},e.prototype.add=function(t){return new e(this.tokens.concat(String(t)))},e.prototype.parent=function(){return new e(this.tokens.length>1?this.tokens.slice(0,-1):[``])},e}()})),T=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.hasOwnProperty=void 0,e.objectType=t,e.clone=r,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(e){return e===void 0?`undefined`:e===null?`null`:Array.isArray(e)?`array`:typeof e}function n(e){return typeof e==`object`&&!!e}function r(t){if(!n(t))return t;if(t.constructor==Array){for(var i=t.length,a=Array(i),o=0;o<i;o++)a[o]=r(t[o]);return a}if(t.constructor==Date)return new Date(+t);var s={};for(var c in t)e.hasOwnProperty.call(t,c)&&(s[c]=r(t[c]));return s}})),E=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isDestructive=n,e.subtract=r,e.intersection=i,e.diffArrays=l,e.diffObjects=u,e.diffAny=d;var t=T();function n(e){var t=e.op;return t===`remove`||t===`replace`||t===`copy`||t===`move`}function r(e,n){var r=[];for(var i in e)t.hasOwnProperty.call(e,i)&&e[i]!==void 0&&!(t.hasOwnProperty.call(n,i)&&n[i]!==void 0)&&r.push(i);return r}function i(e){for(var n=e.length,r={},i=0;i<n;i++){var a=e[i];for(var o in a)t.hasOwnProperty.call(a,o)&&a[o]!==void 0&&(r[o]=(r[o]||0)+1)}for(var o in r)r[o]<n&&delete r[o];return Object.keys(r)}function a(e,n){var r=[];for(var i in e)t.hasOwnProperty.call(e,i)&&e[i]!==void 0&&t.hasOwnProperty.call(n,i)&&n[i]!==void 0&&r.push(i);return r}function o(e){return e.op===`add`}function s(e){return e.op===`remove`}function c(e,t){return{operations:e.operations.concat(t),cost:e.cost+1}}function l(e,t,n,r){r===void 0&&(r=d);var i=Math.max(e.length,t.length),a=new Map([[0,{operations:[],cost:0}]]);function l(o,s){var u=o*i+s,d=a.get(u);if(d===void 0){if(o>0&&s>0&&!r(e[o-1],t[s-1],n.add(String(o-1))).length)d=l(o-1,s-1);else{var f=[];if(o>0){var p=l(o-1,s),m={op:`remove`,index:o-1};f.push(c(p,m))}if(s>0){var h=l(o,s-1),g={op:`add`,index:o-1,value:t[s-1]};f.push(c(h,g))}if(o>0&&s>0){var _=l(o-1,s-1),v={op:`replace`,index:o-1,original:e[o-1],value:t[s-1]};f.push(c(_,v))}d=f.sort(function(e,t){return e.cost-t.cost})[0]}a.set(u,d)}return d}var u=isNaN(e.length)||e.length<=0?0:e.length;return l(u,isNaN(t.length)||t.length<=0?0:t.length).operations.reduce(function(e,t){var i=e[0],a=e[1];if(o(t)){var c=t.index+1+a,l=c<u+a?String(c):`-`,d={op:t.op,path:n.add(l).toString(),value:t.value};return[i.concat(d),a+1]}else if(s(t)){var d={op:t.op,path:n.add(String(t.index+a)).toString()};return[i.concat(d),a-1]}else{var f=n.add(String(t.index+a)),p=r(t.original,t.value,f);return[i.concat.apply(i,p),a]}},[[],0])[0]}function u(e,t,n,i){i===void 0&&(i=d);var o=[];return r(e,t).forEach(function(e){o.push({op:`remove`,path:n.add(e).toString()})}),r(t,e).forEach(function(e){o.push({op:`add`,path:n.add(e).toString(),value:t[e]})}),a(e,t).forEach(function(r){o.push.apply(o,i(e[r],t[r],n.add(r)))}),o}function d(e,n,r,i){if(i===void 0&&(i=d),e===n)return[];var a=(0,t.objectType)(e),o=(0,t.objectType)(n);return a==`array`&&o==`array`?l(e,n,r,i):a==`object`&&o==`object`?u(e,n,r,i):[{op:`replace`,path:r.toString(),value:n}]}})),te=t((e=>{var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.InvalidOperationError=e.TestError=e.MissingError=void 0,e.add=l,e.remove=u,e.replace=d,e.move=f,e.copy=p,e.test=m,e.apply=g;var n=w(),r=T(),i=E(),a=function(e){t(n,e);function n(t){var n=e.call(this,`Value required at path: ${t}`)||this;return n.path=t,n.name=`MissingError`,n}return n}(Error);e.MissingError=a;var o=function(e){t(n,e);function n(t,n){var r=e.call(this,`Test failed: ${t} != ${n}`)||this;return r.actual=t,r.expected=n,r.name=`TestError`,r}return n}(Error);e.TestError=o;function s(e,t,n){if(Array.isArray(e))if(t==`-`)e.push(n);else{var r=parseInt(t,10);e.splice(r,0,n)}else e[t]=n}function c(e,t){if(Array.isArray(e)){var n=parseInt(t,10);e.splice(n,1)}else delete e[t]}function l(e,t,i){var o=n.Pointer.fromJSON(t.path);if(i?.implicitArrayCreation&&o.tokens[o.tokens.length-1]===`-`){var c=o.parent().evaluate(e);c.value===void 0&&(0,r.objectType)(c.parent)===`object`&&(c.parent[c.key]=[])}var l=o.evaluate(e);return l.parent===void 0||i?.implicitArrayCreation&&l.key===`-`&&!Array.isArray(l.parent)?new a(t.path):(s(l.parent,l.key,(0,r.clone)(t.value)),null)}function u(e,t,r){var i=n.Pointer.fromJSON(t.path).evaluate(e);return i.value===void 0?new a(t.path):(c(i.parent,i.key),null)}function d(e,t,i){var o=n.Pointer.fromJSON(t.path).evaluate(e);if(o.parent===null)return new a(t.path);if(Array.isArray(o.parent)){if(parseInt(o.key,10)>=o.parent.length)return new a(t.path)}else if(o.value===void 0)return new a(t.path);return o.parent[o.key]=(0,r.clone)(t.value),null}function f(e,t,r){var i=n.Pointer.fromJSON(t.from).evaluate(e);if(i.value===void 0)return new a(t.from);var o=n.Pointer.fromJSON(t.path).evaluate(e);return o.parent===void 0?new a(t.path):(c(i.parent,i.key),s(o.parent,o.key,i.value),null)}function p(e,t,i){var o=n.Pointer.fromJSON(t.from).evaluate(e);if(o.value===void 0)return new a(t.from);var c=n.Pointer.fromJSON(t.path).evaluate(e);return c.parent===void 0?new a(t.path):(s(c.parent,c.key,(0,r.clone)(o.value)),null)}function m(e,t,r){var a=n.Pointer.fromJSON(t.path).evaluate(e);return(0,i.diffAny)(a.value,t.value,new n.Pointer).length?new o(a.value,t.value):null}var h=function(e){t(n,e);function n(t){var n=e.call(this,`Invalid operation: ${t.op}`)||this;return n.operation=t,n.name=`InvalidOperationError`,n}return n}(Error);e.InvalidOperationError=h;function g(e,t,n){switch(t.op){case`add`:return l(e,t,n);case`remove`:return u(e,t,n);case`replace`:return d(e,t,n);case`move`:return f(e,t,n);case`copy`:return p(e,t,n);case`test`:return m(e,t,n)}return new h(t)}})),ne=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Pointer=void 0,e.applyPatch=i,e.createPatch=o;var t=w();Object.defineProperty(e,`Pointer`,{enumerable:!0,get:function(){return t.Pointer}});var n=te(),r=E();function i(e,t,r){return t.map(function(t){return(0,n.apply)(e,t,r)})}function a(e){function t(n,i,a){var o=e(n,i,a);return Array.isArray(o)?o:(0,r.diffAny)(n,i,a,t)}return t}function o(e,n,i){var o=new t.Pointer;return(i?a(i):r.diffAny)(e,n,o)}})),D=e(a(),1),re=e(o(),1),O=s(),k=ne();function A(){}A.prototype={diff:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.callback;typeof n==`function`&&(r=n,n={}),this.options=n;var i=this;function a(e){return r?(setTimeout(function(){r(void 0,e)},0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e)),t=this.removeEmpty(this.tokenize(t));var o=t.length,s=e.length,c=1,l=o+s;n.maxEditLength&&(l=Math.min(l,n.maxEditLength));var u=n.timeout??1/0,d=Date.now()+u,f=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(f[0],t,e,0);if(f[0].oldPos+1>=s&&p+1>=o)return a([{value:this.join(t),count:t.length}]);var m=-1/0,h=1/0;function g(){for(var n=Math.max(m,-c);n<=Math.min(h,c);n+=2){var r=void 0,l=f[n-1],u=f[n+1];l&&(f[n-1]=void 0);var d=!1;if(u){var g=u.oldPos-n;d=u&&0<=g&&g<o}var _=l&&l.oldPos+1<s;if(!d&&!_){f[n]=void 0;continue}if(r=!_||d&&l.oldPos+1<u.oldPos?i.addToPath(u,!0,void 0,0):i.addToPath(l,void 0,!0,1),p=i.extractCommon(r,t,e,n),r.oldPos+1>=s&&p+1>=o)return a(ie(i,r.lastComponent,t,e,i.useLongestToken));f[n]=r,r.oldPos+1>=s&&(h=Math.min(h,n-1)),p+1>=o&&(m=Math.max(m,n+1))}c++}if(r)(function e(){setTimeout(function(){if(c>l||Date.now()>d)return r();g()||e()},0)})();else for(;c<=l&&Date.now()<=d;){var _=g();if(_)return _}},addToPath:function(e,t,n,r){var i=e.lastComponent;return i&&i.added===t&&i.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:i.count+1,added:t,removed:n,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:i}}},extractCommon:function(e,t,n,r){for(var i=t.length,a=n.length,o=e.oldPos,s=o-r,c=0;s+1<i&&o+1<a&&this.equals(t[s+1],n[o+1]);)s++,o++,c++;return c&&(e.lastComponent={count:c,previousComponent:e.lastComponent}),e.oldPos=o,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split(``)},join:function(e){return e.join(``)}};function ie(e,t,n,r,i){for(var a=[],o;t;)a.push(t),o=t.previousComponent,delete t.previousComponent,t=o;a.reverse();for(var s=0,c=a.length,l=0,u=0;s<c;s++){var d=a[s];if(!d.removed){if(!d.added&&i){var f=n.slice(l,l+d.count);f=f.map(function(e,t){var n=r[u+t];return n.length>e.length?n:e}),d.value=e.join(f)}else d.value=e.join(n.slice(l,l+d.count));l+=d.count,d.added||(u+=d.count)}else if(d.value=e.join(r.slice(u,u+d.count)),u+=d.count,s&&a[s-1].added){var p=a[s-1];a[s-1]=a[s],a[s]=p}}var m=a[c-1];return c>1&&typeof m.value==`string`&&(m.added||m.removed)&&e.equals(``,m.value)&&(a[c-2].value+=m.value,a.pop()),a}var j=new A;function ae(e,t,n){return j.diff(e,t,n)}var M=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,N=/\S/,P=new A;P.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!N.test(e)&&!N.test(t)},P.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&M.test(t[n])&&M.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};function oe(e,t,n){return P.diff(e,t,n)}var F=new A;F.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
1
+ import{i as e,t}from"./chunk-DseTPa7n.js";import{t as n}from"./jsx-runtime-DyiINK0N.js";import{n as r,p as i}from"./DocumentContext-CqohW6HK.js";import{t as a}from"./react-JNybMug3.js";import{t as o}from"./react-dom-Db7zF7dM.js";import{t as s}from"./compiler-runtime-dQcBxOhn.js";import{I as c,et as l,st as u}from"./CodeMirrorPropInput-FVyKUYn4.js";import{Bi as d,Gi as f,K as p,Ki as m,Oi as h,Qi as g,Vi as _,Xi as v,Yr as y,ea as b,hi as x,na as S,ta as C}from"./dist-BkWgKwL8.js";import{t as ee}from"./libesm-CJ1t-ici.js";var w=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Pointer=void 0,e.unescapeToken=t,e.escapeToken=n;function t(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function n(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}e.Pointer=function(){function e(e){e===void 0&&(e=[``]),this.tokens=e}return e.fromJSON=function(n){var r=n.split(`/`).map(t);if(r[0]!==``)throw Error(`Invalid JSON Pointer: ${n}`);return new e(r)},e.prototype.toString=function(){return this.tokens.map(n).join(`/`)},e.prototype.evaluate=function(e){for(var t=null,n=``,r=e,i=1,a=this.tokens.length;i<a;i++)t=r,n=this.tokens[i],!(n==`__proto__`||n==`constructor`||n==`prototype`)&&(r=(t||{})[n]);return{parent:t,key:n,value:r}},e.prototype.get=function(e){return this.evaluate(e).value},e.prototype.set=function(e,t){var n=this.evaluate(e);n.parent&&(n.parent[n.key]=t)},e.prototype.push=function(e){this.tokens.push(e)},e.prototype.add=function(t){return new e(this.tokens.concat(String(t)))},e.prototype.parent=function(){return new e(this.tokens.length>1?this.tokens.slice(0,-1):[``])},e}()})),T=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.hasOwnProperty=void 0,e.objectType=t,e.clone=r,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(e){return e===void 0?`undefined`:e===null?`null`:Array.isArray(e)?`array`:typeof e}function n(e){return typeof e==`object`&&!!e}function r(t){if(!n(t))return t;if(t.constructor==Array){for(var i=t.length,a=Array(i),o=0;o<i;o++)a[o]=r(t[o]);return a}if(t.constructor==Date)return new Date(+t);var s={};for(var c in t)e.hasOwnProperty.call(t,c)&&(s[c]=r(t[c]));return s}})),E=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isDestructive=n,e.subtract=r,e.intersection=i,e.diffArrays=l,e.diffObjects=u,e.diffAny=d;var t=T();function n(e){var t=e.op;return t===`remove`||t===`replace`||t===`copy`||t===`move`}function r(e,n){var r=[];for(var i in e)t.hasOwnProperty.call(e,i)&&e[i]!==void 0&&!(t.hasOwnProperty.call(n,i)&&n[i]!==void 0)&&r.push(i);return r}function i(e){for(var n=e.length,r={},i=0;i<n;i++){var a=e[i];for(var o in a)t.hasOwnProperty.call(a,o)&&a[o]!==void 0&&(r[o]=(r[o]||0)+1)}for(var o in r)r[o]<n&&delete r[o];return Object.keys(r)}function a(e,n){var r=[];for(var i in e)t.hasOwnProperty.call(e,i)&&e[i]!==void 0&&t.hasOwnProperty.call(n,i)&&n[i]!==void 0&&r.push(i);return r}function o(e){return e.op===`add`}function s(e){return e.op===`remove`}function c(e,t){return{operations:e.operations.concat(t),cost:e.cost+1}}function l(e,t,n,r){r===void 0&&(r=d);var i=Math.max(e.length,t.length),a=new Map([[0,{operations:[],cost:0}]]);function l(o,s){var u=o*i+s,d=a.get(u);if(d===void 0){if(o>0&&s>0&&!r(e[o-1],t[s-1],n.add(String(o-1))).length)d=l(o-1,s-1);else{var f=[];if(o>0){var p=l(o-1,s),m={op:`remove`,index:o-1};f.push(c(p,m))}if(s>0){var h=l(o,s-1),g={op:`add`,index:o-1,value:t[s-1]};f.push(c(h,g))}if(o>0&&s>0){var _=l(o-1,s-1),v={op:`replace`,index:o-1,original:e[o-1],value:t[s-1]};f.push(c(_,v))}d=f.sort(function(e,t){return e.cost-t.cost})[0]}a.set(u,d)}return d}var u=isNaN(e.length)||e.length<=0?0:e.length;return l(u,isNaN(t.length)||t.length<=0?0:t.length).operations.reduce(function(e,t){var i=e[0],a=e[1];if(o(t)){var c=t.index+1+a,l=c<u+a?String(c):`-`,d={op:t.op,path:n.add(l).toString(),value:t.value};return[i.concat(d),a+1]}else if(s(t)){var d={op:t.op,path:n.add(String(t.index+a)).toString()};return[i.concat(d),a-1]}else{var f=n.add(String(t.index+a)),p=r(t.original,t.value,f);return[i.concat.apply(i,p),a]}},[[],0])[0]}function u(e,t,n,i){i===void 0&&(i=d);var o=[];return r(e,t).forEach(function(e){o.push({op:`remove`,path:n.add(e).toString()})}),r(t,e).forEach(function(e){o.push({op:`add`,path:n.add(e).toString(),value:t[e]})}),a(e,t).forEach(function(r){o.push.apply(o,i(e[r],t[r],n.add(r)))}),o}function d(e,n,r,i){if(i===void 0&&(i=d),e===n)return[];var a=(0,t.objectType)(e),o=(0,t.objectType)(n);return a==`array`&&o==`array`?l(e,n,r,i):a==`object`&&o==`object`?u(e,n,r,i):[{op:`replace`,path:r.toString(),value:n}]}})),te=t((e=>{var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.InvalidOperationError=e.TestError=e.MissingError=void 0,e.add=l,e.remove=u,e.replace=d,e.move=f,e.copy=p,e.test=m,e.apply=g;var n=w(),r=T(),i=E(),a=function(e){t(n,e);function n(t){var n=e.call(this,`Value required at path: ${t}`)||this;return n.path=t,n.name=`MissingError`,n}return n}(Error);e.MissingError=a;var o=function(e){t(n,e);function n(t,n){var r=e.call(this,`Test failed: ${t} != ${n}`)||this;return r.actual=t,r.expected=n,r.name=`TestError`,r}return n}(Error);e.TestError=o;function s(e,t,n){if(Array.isArray(e))if(t==`-`)e.push(n);else{var r=parseInt(t,10);e.splice(r,0,n)}else e[t]=n}function c(e,t){if(Array.isArray(e)){var n=parseInt(t,10);e.splice(n,1)}else delete e[t]}function l(e,t,i){var o=n.Pointer.fromJSON(t.path);if(i?.implicitArrayCreation&&o.tokens[o.tokens.length-1]===`-`){var c=o.parent().evaluate(e);c.value===void 0&&(0,r.objectType)(c.parent)===`object`&&(c.parent[c.key]=[])}var l=o.evaluate(e);return l.parent===void 0||i?.implicitArrayCreation&&l.key===`-`&&!Array.isArray(l.parent)?new a(t.path):(s(l.parent,l.key,(0,r.clone)(t.value)),null)}function u(e,t,r){var i=n.Pointer.fromJSON(t.path).evaluate(e);return i.value===void 0?new a(t.path):(c(i.parent,i.key),null)}function d(e,t,i){var o=n.Pointer.fromJSON(t.path).evaluate(e);if(o.parent===null)return new a(t.path);if(Array.isArray(o.parent)){if(parseInt(o.key,10)>=o.parent.length)return new a(t.path)}else if(o.value===void 0)return new a(t.path);return o.parent[o.key]=(0,r.clone)(t.value),null}function f(e,t,r){var i=n.Pointer.fromJSON(t.from).evaluate(e);if(i.value===void 0)return new a(t.from);var o=n.Pointer.fromJSON(t.path).evaluate(e);return o.parent===void 0?new a(t.path):(c(i.parent,i.key),s(o.parent,o.key,i.value),null)}function p(e,t,i){var o=n.Pointer.fromJSON(t.from).evaluate(e);if(o.value===void 0)return new a(t.from);var c=n.Pointer.fromJSON(t.path).evaluate(e);return c.parent===void 0?new a(t.path):(s(c.parent,c.key,(0,r.clone)(o.value)),null)}function m(e,t,r){var a=n.Pointer.fromJSON(t.path).evaluate(e);return(0,i.diffAny)(a.value,t.value,new n.Pointer).length?new o(a.value,t.value):null}var h=function(e){t(n,e);function n(t){var n=e.call(this,`Invalid operation: ${t.op}`)||this;return n.operation=t,n.name=`InvalidOperationError`,n}return n}(Error);e.InvalidOperationError=h;function g(e,t,n){switch(t.op){case`add`:return l(e,t,n);case`remove`:return u(e,t,n);case`replace`:return d(e,t,n);case`move`:return f(e,t,n);case`copy`:return p(e,t,n);case`test`:return m(e,t,n)}return new h(t)}})),ne=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Pointer=void 0,e.applyPatch=i,e.createPatch=o;var t=w();Object.defineProperty(e,`Pointer`,{enumerable:!0,get:function(){return t.Pointer}});var n=te(),r=E();function i(e,t,r){return t.map(function(t){return(0,n.apply)(e,t,r)})}function a(e){function t(n,i,a){var o=e(n,i,a);return Array.isArray(o)?o:(0,r.diffAny)(n,i,a,t)}return t}function o(e,n,i){var o=new t.Pointer;return(i?a(i):r.diffAny)(e,n,o)}})),D=e(a(),1),re=e(o(),1),O=s(),k=ne();function A(){}A.prototype={diff:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.callback;typeof n==`function`&&(r=n,n={}),this.options=n;var i=this;function a(e){return r?(setTimeout(function(){r(void 0,e)},0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e)),t=this.removeEmpty(this.tokenize(t));var o=t.length,s=e.length,c=1,l=o+s;n.maxEditLength&&(l=Math.min(l,n.maxEditLength));var u=n.timeout??1/0,d=Date.now()+u,f=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(f[0],t,e,0);if(f[0].oldPos+1>=s&&p+1>=o)return a([{value:this.join(t),count:t.length}]);var m=-1/0,h=1/0;function g(){for(var n=Math.max(m,-c);n<=Math.min(h,c);n+=2){var r=void 0,l=f[n-1],u=f[n+1];l&&(f[n-1]=void 0);var d=!1;if(u){var g=u.oldPos-n;d=u&&0<=g&&g<o}var _=l&&l.oldPos+1<s;if(!d&&!_){f[n]=void 0;continue}if(r=!_||d&&l.oldPos+1<u.oldPos?i.addToPath(u,!0,void 0,0):i.addToPath(l,void 0,!0,1),p=i.extractCommon(r,t,e,n),r.oldPos+1>=s&&p+1>=o)return a(ie(i,r.lastComponent,t,e,i.useLongestToken));f[n]=r,r.oldPos+1>=s&&(h=Math.min(h,n-1)),p+1>=o&&(m=Math.max(m,n+1))}c++}if(r)(function e(){setTimeout(function(){if(c>l||Date.now()>d)return r();g()||e()},0)})();else for(;c<=l&&Date.now()<=d;){var _=g();if(_)return _}},addToPath:function(e,t,n,r){var i=e.lastComponent;return i&&i.added===t&&i.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:i.count+1,added:t,removed:n,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:i}}},extractCommon:function(e,t,n,r){for(var i=t.length,a=n.length,o=e.oldPos,s=o-r,c=0;s+1<i&&o+1<a&&this.equals(t[s+1],n[o+1]);)s++,o++,c++;return c&&(e.lastComponent={count:c,previousComponent:e.lastComponent}),e.oldPos=o,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split(``)},join:function(e){return e.join(``)}};function ie(e,t,n,r,i){for(var a=[],o;t;)a.push(t),o=t.previousComponent,delete t.previousComponent,t=o;a.reverse();for(var s=0,c=a.length,l=0,u=0;s<c;s++){var d=a[s];if(!d.removed){if(!d.added&&i){var f=n.slice(l,l+d.count);f=f.map(function(e,t){var n=r[u+t];return n.length>e.length?n:e}),d.value=e.join(f)}else d.value=e.join(n.slice(l,l+d.count));l+=d.count,d.added||(u+=d.count)}else if(d.value=e.join(r.slice(u,u+d.count)),u+=d.count,s&&a[s-1].added){var p=a[s-1];a[s-1]=a[s],a[s]=p}}var m=a[c-1];return c>1&&typeof m.value==`string`&&(m.added||m.removed)&&e.equals(``,m.value)&&(a[c-2].value+=m.value,a.pop()),a}var j=new A;function ae(e,t,n){return j.diff(e,t,n)}var M=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,N=/\S/,P=new A;P.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!N.test(e)&&!N.test(t)},P.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&M.test(t[n])&&M.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};function oe(e,t,n){return P.diff(e,t,n)}var F=new A;F.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
2
2
  `));var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var i=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),t.push(i))}return t};var I=new A;I.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var se=new A;se.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function L(e){"@babel/helpers - typeof";return L=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},L(e)}var ce=Object.prototype.toString,R=new A;R.useLongestToken=!0,R.tokenize=F.tokenize,R.castInput=function(e){var t=this.options,n=t.undefinedReplacement,r=t.stringifyReplacer,i=r===void 0?function(e,t){return t===void 0?n:t}:r;return typeof e==`string`?e:JSON.stringify(z(e,null,null,i),i,` `)},R.equals=function(e,t){return A.prototype.equals.call(R,e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`))};function z(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i,e));var a;for(a=0;a<t.length;a+=1)if(t[a]===e)return n[a];var o;if(ce.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=z(e[a],t,n,r,i);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),L(e)===`object`&&e!==null){t.push(e),o={},n.push(o);var s=[],c;for(c in e)e.hasOwnProperty(c)&&s.push(c);for(s.sort(),a=0;a<s.length;a+=1)c=s[a],o[c]=z(e[c],t,n,r,c);t.pop(),n.pop()}else o=e;return o}var B=new A;B.tokenize=function(e){return e.slice()},B.join=B.removeEmpty=function(e){return e};function V(e,t){let n=t.content.findDiffStart(e.content);if(n===null)return!1;let{a:r,b:i}=t.content.findDiffEnd(e.content),a=n-Math.min(r,i);return a>0&&(e.resolve(n-a).depth<t.resolve(r+a).depth?n-=a:(r+=a,i+=a)),new b(n,i,t.slice(n,r))}function le(e){if(!e.steps.length)return;let t=new C(e.docs[0]),n=e.steps.slice();for(;n.length;){let e=n.shift();for(;n.length&&e.merge(n[0]);){let r=n.shift();e=e instanceof b&&r instanceof b?V(t.doc,r.apply(e.apply(t.doc).doc).doc):e.merge(r)}t.step(e)}return t}function H(e){let t=new C(e);return t.removeMark(0,e.nodeSize-2),t.doc}function U(e,t){let n=t.split(`/`);for(n.shift();n.length;){if(typeof e!=`object`)throw Error();let t=n.shift();e=e[t]}return e}function W(e){return JSON.parse(JSON.stringify(e))}var ue=class{fromDoc;toDoc;complexSteps;wordDiffs;simplifyDiff;schema;tr;currentJSON;finalJSON;ops;constructor(e,t,n={}){let r={complexSteps:!0,wordDiffs:!1,simplifyDiff:!0,...n};this.fromDoc=e,this.toDoc=t,this.complexSteps=r.complexSteps,this.wordDiffs=r.wordDiffs,this.simplifyDiff=r.simplifyDiff,this.schema=e.type.schema,this.tr=new C(e),this.currentJSON={},this.finalJSON={},this.ops=[]}init(){return this.complexSteps?(this.currentJSON=H(this.fromDoc).toJSON(),this.finalJSON=H(this.toDoc).toJSON(),this.ops=(0,k.createPatch)(this.currentJSON,this.finalJSON),this.recreateChangeContentSteps(),this.recreateChangeMarkSteps()):(this.currentJSON=this.fromDoc.toJSON(),this.finalJSON=this.toDoc.toJSON(),this.ops=(0,k.createPatch)(this.currentJSON,this.finalJSON),this.recreateChangeContentSteps()),this.simplifyDiff&&(this.tr=le(this.tr)||this.tr),this.tr}recreateChangeContentSteps(){let e=[];for(;this.ops.length;){let t=this.ops.shift();e.push(t);let n,r=W(this.currentJSON),i=t.path.split(`/`);for(;n==null;){(0,k.applyPatch)(r,[t]);try{n=this.schema.nodeFromJSON(r),n.check()}catch{if(n=null,this.ops.length>0)t=this.ops.shift(),e.push(t);else throw Error(`No valid diff possible applying ${t.path}`)}}this.complexSteps&&e.length===1&&(i.includes(`attrs`)||i.includes(`type`))?(this.addSetNodeMarkup(),e=[]):e.length===1&&t.op===`replace`&&i[i.length-1]===`text`?(this.addReplaceTextSteps(t,r),e=[]):this.addReplaceStep(n,r)&&(e=[])}}addSetNodeMarkup(){let e=this.schema.nodeFromJSON(this.currentJSON),t=this.schema.nodeFromJSON(this.finalJSON),n=t.content.findDiffStart(e.content),r=e.nodeAt(n),i=t.nodeAt(n);if(n!=null){let e=r.type===i.type?null:i.type;try{this.tr.setNodeMarkup(n,e,i.attrs,i.marks)}catch(t){if(e&&t.message.includes(`Invalid content`))this.tr.replaceWith(n,n+r.nodeSize,i);else throw t}return this.currentJSON=H(this.tr.doc).toJSON(),this.ops=(0,k.createPatch)(this.currentJSON,this.finalJSON),!0}return!1}recreateChangeMarkSteps(){this.toDoc.descendants((e,t)=>{if(!e.isInline)return!0;this.tr.doc.nodesBetween(t,t+e.nodeSize,(n,r)=>{if(!n.isInline)return!0;let i=Math.max(t,r),a=Math.min(t+e.nodeSize,r+n.nodeSize);n.marks.forEach(t=>{t.isInSet(e.marks)||this.tr.removeMark(i,a,t)}),e.marks.forEach(e=>{e.isInSet(n.marks)||this.tr.addMark(i,a,e)})})})}addReplaceStep(e,t){let n=V(this.schema.nodeFromJSON(this.currentJSON),e);if(!n)return!1;if(!this.tr.maybeStep(n).failed)return this.currentJSON=t,!0;throw Error(`No valid step found.`)}addReplaceTextSteps(e,t){let n={...e,value:`xx`},r={...e,value:`yy`},i=W(this.currentJSON),a=W(this.currentJSON);(0,k.applyPatch)(i,[n]),(0,k.applyPatch)(a,[r]);let o=this.schema.nodeFromJSON(i),s=this.schema.nodeFromJSON(a),c=e.value,l=U(this.currentJSON,e.path),u=this.wordDiffs?oe(l,c):ae(l,c),d=o.content.findDiffStart(s.content),f=o.resolve(d+1).marks();for(;u.length;){let e=u.shift();if(e.added){let t=this.schema.nodeFromJSON({type:`text`,text:e.value}).mark(f);if(u.length&&u[0].removed){let e=u.shift();this.tr.replaceWith(d,d+e.value.length,t)}else this.tr.insert(d,t);d+=e.value.length}else if(e.removed)if(u.length&&u[0].added){let t=u.shift(),n=this.schema.nodeFromJSON({type:`text`,text:t.value}).mark(f);this.tr.replaceWith(d,d+e.value.length,n),d+=t.value.length}else this.tr.delete(d,d+e.value.length);else d+=e.value.length}this.currentJSON=t}};function de(e,t,n={}){return new ue(e,t,n).init()}var G=new Set([`list`,`bulletList`,`orderedList`,`taskList`]);function K(e){let t=[];return e.forEach((e,n)=>{if(G.has(e.type.name)){let r=n+1,i=0;e.forEach(e=>{let n=r+i;t.push({from:n,to:n+e.nodeSize,key:`${e.type.name}:${e.textContent}`}),i+=e.nodeSize})}else t.push({from:n,to:n+e.nodeSize,key:`${e.type.name}:${e.textContent}`})}),t}function fe(e,t){let n=e.length,r=t.length,i=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let a=n-1;a>=0;a--)for(let n=r-1;n>=0;n--)i[a][n]=e[a].key===t[n].key?i[a+1][n+1]+1:Math.max(i[a+1][n],i[a][n+1]);let a=[],o=0,s=0;for(;o<n&&s<r;)e[o].key===t[s].key?(a.push({type:`same`,b:t[s]}),o++,s++):i[o+1][s]>=i[o][s+1]?(a.push({type:`del`,a:e[o]}),o++):(a.push({type:`ins`,b:t[s]}),s++);for(;o<n;)a.push({type:`del`,a:e[o++]});for(;s<r;)a.push({type:`ins`,b:t[s++]});return a}function pe(e,t){let n=fe(K(e),K(t)),r=[],i=0;for(let e of n)e.type===`same`?i=e.b.to:e.type===`ins`?(r.push({fromA:0,toA:0,fromB:e.b.from,toB:e.b.to}),i=e.b.to):r.push({fromA:e.a.from,toA:e.a.to,fromB:i,toB:i});return r}var me=400;function q(e,t,n){return t.nodeFromJSON(e.parseWithFallback(n))}function he(e,t){let n=t.filter(e=>e.toB>e.fromB),r=[];return e.steps.forEach((t,i)=>{let a=t instanceof v?`add`:t instanceof g?`remove`:null;if(a===null)return;let o=t,s=e.mapping.slice(i+1),c=s.map(o.from,-1),l=s.map(o.to,1);if(l<=c||n.some(e=>e.fromB<=c&&l<=e.toB))return;let u=e.mapping.slice(0,i).invert(),d=u.map(o.from),f=u.map(o.to);f<=d||r.push({fromA:d,toA:f,fromB:c,toB:l,markName:o.mark.type.name,kind:a})}),r}function ge(e,t,n,r){if(e.length>2e5||t.length>2e5)return{ok:!1,reason:`ceiling`};let i,a;try{i=q(r,n,e),a=q(r,n,t)}catch{return{ok:!1,reason:`parse`}}let o=a,s=null;try{s=de(i,a,{complexSteps:!0,wordDiffs:!0,simplifyDiff:!0}),o=s.doc}catch{}let c=pe(i,o),l=s?he(s,c):[];return c.length+l.length>me?{ok:!1,reason:`ceiling`}:{ok:!0,afterDoc:o,beforeDoc:i,changes:c,markChanges:l}}var _e=`.ok-diff-ins, .ok-diff-ins-block, [data-diff-deleted]`;function ve(e){return e.changes.length+2*e.markChanges.length}function J(e){let t=!1;return e.forEach(e=>{e.isBlock&&(t=!0)}),t}function ye(e){if(e.childCount===0)return!1;let t=!0;return e.forEach(e=>{e.type.name!==`listItem`&&e.type.name!==`taskItem`&&(t=!1)}),t}function Y(e,t,n){let r=document.createElement(n?`div`:`span`);r.className=n?`ok-diff-del ok-diff-del-block`:`ok-diff-del`,r.setAttribute(`data-diff-deleted`,``);let i=e.serializeFragment(t);if(n&&ye(t)){let e=document.createElement(`ul`);e.appendChild(i),r.appendChild(e)}else r.appendChild(i);return r}function be(e,t,n,r,i){let a=S.fromSchema(i),o=[];for(let e of r){let n=t.slice(e.fromA,e.toA),r=J(n.content);o.push(d.widget(e.fromB,()=>Y(a,n.content,r),{side:-1,ignoreSelection:!0,marks:[]})),o.push(d.inline(e.fromB,e.toB,{class:`ok-diff-ins`},{inclusiveEnd:!0}))}for(let e of n)if(e.toB>e.fromB&&o.push(d.node(e.fromB,e.toB,{class:`ok-diff-ins-block`})),e.toA>e.fromA){let n=t.slice(e.fromA,e.toA),r=J(n.content);o.push(d.widget(e.fromB,()=>Y(a,n.content,r),{side:-1,ignoreSelection:!0,marks:[]}))}return _.create(e,o)}var xe=new Set([`slashCommand`,`blockDragHandle`,`blockMover`,`tableInsertControls`,`fileHandler`,`gfmAutolink`,`inlineLinkInputRule`,`keyboardNav`,`tiptapFindReplace`,`selectionState`,`sourceDirtyObserver`,`tabFocusTrap`]),X=i.filter(e=>!xe.has(e.name)).map(e=>e.name===`jsxComponent`?p:e),Z=n(),Q=h(X);function Se(e,t){return ge(e,t,Q,c())}var Ce=x.create({name:`renderedDiffDecorations`,addOptions(){return{decorations:_.empty}},addProseMirrorPlugins(){let e=this.options.decorations;return[new f({key:new m(`renderedDiffDecorations`),props:{decorations:()=>e}})]}});function we(e){let t=(0,O.c)(31),{diff:n}=e,r,i,a,o;if(t[0]!==n.afterDoc||t[1]!==n.beforeDoc||t[2]!==n.changes||t[3]!==n.markChanges){let e=be(n.afterDoc,n.beforeDoc,n.changes,n.markChanges,Q);o=u,a=!1,r=X,i=Ce.configure({decorations:e}),t[0]=n.afterDoc,t[1]=n.beforeDoc,t[2]=n.changes,t[3]=n.markChanges,t[4]=r,t[5]=i,t[6]=a,t[7]=o}else r=t[4],i=t[5],a=t[6],o=t[7];let s;t[8]!==r||t[9]!==i?(s=[...r,i],t[8]=r,t[9]=i,t[10]=s):s=t[10];let c;t[11]===n.afterDoc?c=t[12]:(c=n.afterDoc.toJSON(),t[11]=n.afterDoc,t[12]=c);let d;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(d={attributes:{class:`pt-4 pb-4`}},t[13]=d):d=t[13];let f;t[14]!==a||t[15]!==s||t[16]!==c?(f={editable:a,extensions:s,content:c,editorProps:d},t[14]=a,t[15]=s,t[16]=c,t[17]=f):f=t[17];let p;t[18]===n?p=t[19]:(p=[n],t[18]=n,t[19]=p);let m=o(f,p),[h]=(0,D.useState)(Te),g=(0,D.useRef)(null),_,v;t[20]===h?(_=t[21],v=t[22]):(_=()=>{let e=g.current;if(e)return e.appendChild(h),()=>{h.parentNode===e&&e.removeChild(h)}},v=[h],t[20]=h,t[21]=_,t[22]=v),(0,D.useLayoutEffect)(_,v);let y;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(`div`,{className:`tiptap-editor`,children:(0,Z.jsx)(`div`,{ref:g,style:{display:`contents`}})}),t[23]=y):y=t[23];let b;t[24]===m?b=t[25]:(b=(0,Z.jsx)(l,{editor:m,className:`tiptap-editor-portal-content`}),t[24]=m,t[25]=b);let x;t[26]!==h||t[27]!==b?(x=(0,re.createPortal)(b,h),t[26]=h,t[27]=b,t[28]=x):x=t[28];let S;return t[29]===x?S=t[30]:(S=(0,Z.jsxs)(`div`,{className:`editor-doc-scroll min-h-0 flex-1`,"data-testid":`rendered-diff-view`,children:[y,x]}),t[29]=x,t[30]=S),S}function Te(){let e=document.createElement(`div`);return e.style.display=`contents`,e}function Ee(e){let t=0,n=!1;for(let r of e.split(`
3
3
  `)){let e=r.startsWith(`+`)&&!r.startsWith(`+++`)||r.startsWith(`-`)&&!r.startsWith(`---`);e&&!n&&(t+=1),n=e}return t}function De(e){let t=Array.from(e.querySelectorAll(`.diff-code-insert, .diff-code-delete`)),n=[],r=null;for(let e of t){let t=e.closest(`tr`);t&&((r===null||t.previousElementSibling!==r)&&n.push(e),r=t)}return n}function $(e){let t=0,n=0;for(let r of e.split(`
4
4
  `))r.startsWith(`+`)&&!r.startsWith(`+++`)?t++:r.startsWith(`-`)&&!r.startsWith(`---`)&&n++;return{additions:t,deletions:n}}function Oe(e,t){return`${e}\u0000${t}`}function ke(e,t,n){let r=y(e).body,i=y(t).body;return r===i?``:ee(n,r,i,``,``,{context:Math.max(r.split(`
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{Gt as r}from"./dist-zc03OoUp.js";var i=n(),a=e(t(),1);function o(){let e=(0,i.c)(3),[t,n]=(0,a.useState)(l),o,u;return e[0]===t?(o=e[1],u=e[2]):(o=()=>{if(t!==null||window.okDesktop)return;let e=!0;return fetch(`/api/workspace`).then(async t=>{let i=await t.json().catch(c);if(!e||!t.ok)return;let a=r.safeParse(i);a.success&&n({contentDir:a.data.contentDir,pathSeparator:a.data.pathSeparator})}).catch(s),()=>{e=!1}},u=[t],e[0]=t,e[1]=o,e[2]=u),(0,a.useEffect)(o,u),t}function s(e){console.warn(`[useWorkspace] /api/workspace fetch failed:`,e)}function c(){return null}function l(){return u()}function u(e=typeof window>`u`?void 0:window){if(!e)return null;let t=e.okDesktop;return t?{contentDir:t.config.projectPath,pathSeparator:t.platform===`win32`?`\\`:`/`}:null}export{o as t};
1
+ import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{t as n}from"./compiler-runtime-dQcBxOhn.js";import{Gt as r}from"./dist-BkWgKwL8.js";var i=n(),a=e(t(),1);function o(){let e=(0,i.c)(3),[t,n]=(0,a.useState)(l),o,u;return e[0]===t?(o=e[1],u=e[2]):(o=()=>{if(t!==null||window.okDesktop)return;let e=!0;return fetch(`/api/workspace`).then(async t=>{let i=await t.json().catch(c);if(!e||!t.ok)return;let a=r.safeParse(i);a.success&&n({contentDir:a.data.contentDir,pathSeparator:a.data.pathSeparator})}).catch(s),()=>{e=!1}},u=[t],e[0]=t,e[1]=o,e[2]=u),(0,a.useEffect)(o,u),t}function s(e){console.warn(`[useWorkspace] /api/workspace fetch failed:`,e)}function c(){return null}function l(){return u()}function u(e=typeof window>`u`?void 0:window){if(!e)return null;let t=e.okDesktop;return t?{contentDir:t.config.projectPath,pathSeparator:t.platform===`win32`?`\\`:`/`}:null}export{o as t};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-hd2lHHXF.js";import"./src-UM8T_rSX.js";import{H as t,K as n,U as r,a as i,b as a,c as o,et as s,f as c,nt as l,rt as u,tt as d,v as f,w as p,y as m}from"./chunk-WYO6CB5R-D_W2G_ln.js";import{C as h}from"./src-CiR3sVeF.js";import{i as g}from"./chunk-ICXQ74PX-KggQe_uj.js";import{t as _}from"./chunk-VAUOI2AC-D7b3rQ3R.js";import{t as v}from"./rough.esm-COvN6db3.js";var y=(e,t)=>l(e,`a`,-t),b=1e-10;function x(e,t){let n=C(e),r=n.filter(t=>S(t,e)),i=0,a=0,o=[];if(r.length>1){let t=O(r);for(let e=0;e<r.length;++e){let n=r[e];n.angle=Math.atan2(n.x-t.x,n.y-t.y)}r.sort((e,t)=>t.angle-e.angle);let n=r[r.length-1];for(let t=0;t<r.length;++t){let s=r[t];a+=(n.x+s.x)*(s.y-n.y);let c={x:(s.x+n.x)/2,y:(s.y+n.y)/2},l=null;for(let t=0;t<s.parentIndex.length;++t)if(n.parentIndex.includes(s.parentIndex[t])){let r=e[s.parentIndex[t]],i=Math.atan2(s.x-r.x,s.y-r.y),a=Math.atan2(n.x-r.x,n.y-r.y),o=a-i;o<0&&(o+=2*Math.PI);let u=a-o/2,d=T(c,{x:r.x+r.radius*Math.sin(u),y:r.y+r.radius*Math.cos(u)});d>r.radius*2&&(d=r.radius*2),(l==null||l.width>d)&&(l={circle:r,width:d,p1:s,p2:n,large:d>r.radius,sweep:!0})}l!=null&&(o.push(l),i+=w(l.circle.radius,l.width),n=s)}}else{let t=e[0];for(let n=1;n<e.length;++n)e[n].radius<t.radius&&(t=e[n]);let n=!1;for(let r=0;r<e.length;++r)if(T(e[r],t)>Math.abs(t.radius-e[r].radius)){n=!0;break}n?i=a=0:(i=t.radius*t.radius*Math.PI,o.push({circle:t,p1:{x:t.x,y:t.y+t.radius},p2:{x:t.x-b,y:t.y+t.radius},width:t.radius*2,large:!0,sweep:!0}))}return a/=2,t&&(t.area=i+a,t.arcArea=i,t.polygonArea=a,t.arcs=o,t.innerPoints=r,t.intersectionPoints=n),i+a}function S(e,t){return t.every(t=>T(e,t)<t.radius+b)}function C(e){let t=[];for(let n=0;n<e.length;++n)for(let r=n+1;r<e.length;++r){let i=D(e[n],e[r]);for(let e of i)e.parentIndex=[n,r],t.push(e)}return t}function w(e,t){return e*e*Math.acos(1-t/e)-(e-t)*Math.sqrt(t*(2*e-t))}function T(e,t){return Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y))}function E(e,t,n){if(n>=e+t)return 0;if(n<=Math.abs(e-t))return Math.PI*Math.min(e,t)*Math.min(e,t);let r=e-(n*n-t*t+e*e)/(2*n),i=t-(n*n-e*e+t*t)/(2*n);return w(e,r)+w(t,i)}function D(e,t){let n=T(e,t),r=e.radius,i=t.radius;if(n>=r+i||n<=Math.abs(r-i))return[];let a=(r*r-i*i+n*n)/(2*n),o=Math.sqrt(r*r-a*a),s=e.x+a*(t.x-e.x)/n,c=e.y+a*(t.y-e.y)/n,l=-(t.y-e.y)*(o/n),u=-(t.x-e.x)*(o/n);return[{x:s+l,y:c-u},{x:s-l,y:c+u}]}function O(e){let t={x:0,y:0};for(let n of e)t.x+=n.x,t.y+=n.y;return t.x/=e.length,t.y/=e.length,t}function k(e,t,n,r){r||={};let i=r.maxIterations||100,a=r.tolerance||1e-10,o=e(t),s=e(n),c=n-t;if(o*s>0)throw`Initial bisect points must have opposite signs`;if(o===0)return t;if(s===0)return n;for(let n=0;n<i;++n){c/=2;let n=t+c,r=e(n);if(r*o>=0&&(t=n),Math.abs(c)<a||r===0)return n}return t+c}function A(e){let t=Array(e);for(let n=0;n<e;++n)t[n]=0;return t}function j(e,t){return A(e).map(()=>A(t))}function M(e,t){let n=0;for(let r=0;r<e.length;++r)n+=e[r]*t[r];return n}function N(e){return Math.sqrt(M(e,e))}function P(e,t,n){for(let r=0;r<t.length;++r)e[r]=t[r]*n}function F(e,t,n,r,i){for(let a=0;a<e.length;++a)e[a]=t*n[a]+r*i[a]}function I(e,t,n){n||={};let r=n.maxIterations||t.length*200,i=n.nonZeroDelta||1.05,a=n.zeroDelta||.001,o=n.minErrorDelta||1e-6,s=n.minErrorDelta||1e-5,c=n.rho===void 0?1:n.rho,l=n.chi===void 0?2:n.chi,u=n.psi===void 0?-.5:n.psi,d=n.sigma===void 0?.5:n.sigma,f,p=t.length,m=Array(p+1);m[0]=t,m[0].fx=e(t),m[0].id=0;for(let n=0;n<p;++n){let r=t.slice();r[n]=r[n]?r[n]*i:a,m[n+1]=r,m[n+1].fx=e(r),m[n+1].id=n+1}function h(e){for(let t=0;t<e.length;t++)m[p][t]=e[t];m[p].fx=e.fx}let g=(e,t)=>e.fx-t.fx,_=t.slice(),v=t.slice(),y=t.slice(),b=t.slice();for(let t=0;t<r;++t){if(m.sort(g),n.history){let e=m.map(e=>{let t=e.slice();return t.fx=e.fx,t.id=e.id,t});e.sort((e,t)=>e.id-t.id),n.history.push({x:m[0].slice(),fx:m[0].fx,simplex:e})}f=0;for(let e=0;e<p;++e)f=Math.max(f,Math.abs(m[0][e]-m[1][e]));if(Math.abs(m[0].fx-m[p].fx)<o&&f<s)break;for(let e=0;e<p;++e){_[e]=0;for(let t=0;t<p;++t)_[e]+=m[t][e];_[e]/=p}let t=m[p];if(F(v,1+c,_,-c,t),v.fx=e(v),v.fx<m[0].fx)F(b,1+l,_,-l,t),b.fx=e(b),b.fx<v.fx?h(b):h(v);else if(v.fx>=m[p-1].fx){let n=!1;if(v.fx>t.fx?(F(y,1+u,_,-u,t),y.fx=e(y),y.fx<t.fx?h(y):n=!0):(F(y,1-u*c,_,u*c,t),y.fx=e(y),y.fx<v.fx?h(y):n=!0),n){if(d>=1)break;for(let t=1;t<m.length;++t)F(m[t],1-d,m[0],d,m[t]),m[t].fx=e(m[t])}}else h(v)}return m.sort(g),{fx:m[0].fx,x:m[0]}}function L(e,t,n,r,i,a,o){let s=n.fx,c=M(n.fxprime,t),l=s,u=s,d=c,f=0;i||=1,a||=1e-6,o||=.1;function p(u,f,p){for(let m=0;m<16;++m)if(i=(u+f)/2,F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||l>=p)f=i;else{if(Math.abs(d)<=-o*c)return i;d*(f-u)>=0&&(f=u),u=i,p=l}return 0}for(let m=0;m<10;++m){if(F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||m&&l>=u)return p(f,i,u);if(Math.abs(d)<=-o*c)return i;if(d>=0)return p(i,f,l);u=l,f=i,i*=2}return i}function R(e,t,n){let r={x:t.slice(),fx:0,fxprime:t.slice()},i={x:t.slice(),fx:0,fxprime:t.slice()},a=t.slice(),o,s,c=1,l;n||={},l=n.maxIterations||t.length*20,r.fx=e(r.x,r.fxprime),o=r.fxprime.slice(),P(o,r.fxprime,-1);for(let t=0;t<l;++t){if(c=L(e,o,r,i,c),n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),!c)P(o,r.fxprime,-1);else{F(a,1,i.fxprime,-1,r.fxprime);let e=M(r.fxprime,r.fxprime),t=Math.max(0,M(a,i.fxprime)/e);F(o,t,o,-1,i.fxprime),s=r,r=i,i=s}if(N(r.fxprime)<=1e-5)break}return n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),r}function ee(e,t={}){t.maxIterations=t.maxIterations||500;let n=t.initialLayout||ae,r=t.lossFunction||B,i=ne(e,t),a=n(i,t),o=Object.keys(a),s=[];for(let e of o)s.push(a[e].x),s.push(a[e].y);let c=I(e=>{let t={};for(let n=0;n<o.length;++n){let r=o[n];t[r]={x:e[2*n],y:e[2*n+1],radius:a[r].radius}}return r(t,i)},s,t).x;for(let e=0;e<o.length;++e){let t=o[e];a[t].x=c[2*e],a[t].y=c[2*e+1]}return a}var te=1e-10;function z(e,t,n){return Math.min(e,t)*Math.min(e,t)*Math.PI<=n+te?Math.abs(e-t):k(r=>E(e,t,r)-n,0,e+t)}function ne(e,t={}){let n=t.distinct,r=e.map(e=>Object.assign({},e));function i(e){return e.join(`;`)}if(n){let e=new Map;for(let t of r)for(let n=0;n<t.sets.length;n++){let r=String(t.sets[n]);e.set(r,t.size+(e.get(r)||0));for(let i=n+1;i<t.sets.length;i++){let n=String(t.sets[i]),a=`${r};${n}`,o=`${n};${r}`;e.set(a,t.size+(e.get(a)||0)),e.set(o,t.size+(e.get(o)||0))}}for(let t of r)t.sets.length<3&&(t.size=e.get(i(t.sets)))}let a=[],o=new Set;for(let e of r)if(e.sets.length===1)a.push(e.sets[0]);else if(e.sets.length===2){let t=e.sets[0],n=e.sets[1];o.add(i(e.sets)),o.add(i([n,t]))}a.sort((e,t)=>e===t?0:e<t?-1:1);for(let e=0;e<a.length;++e){let t=a[e];for(let n=e+1;n<a.length;++n){let e=a[n];o.has(i([t,e]))||r.push({sets:[t,e],size:0})}}return r}function re(e,t,n){let r=j(t.length,t.length),i=j(t.length,t.length);return e.filter(e=>e.sets.length===2).forEach(e=>{let a=n[e.sets[0]],o=n[e.sets[1]],s=z(Math.sqrt(t[a].size/Math.PI),Math.sqrt(t[o].size/Math.PI),e.size);r[a][o]=r[o][a]=s;let c=0;e.size+1e-10>=Math.min(t[a].size,t[o].size)?c=1:e.size<=1e-10&&(c=-1),i[a][o]=i[o][a]=c}),{distances:r,constraints:i}}function ie(e,t,n,r){for(let e=0;e<t.length;++e)t[e]=0;let i=0;for(let a=0;a<n.length;++a){let o=e[2*a],s=e[2*a+1];for(let c=a+1;c<n.length;++c){let l=e[2*c],u=e[2*c+1],d=n[a][c],f=r[a][c],p=(l-o)*(l-o)+(u-s)*(u-s),m=Math.sqrt(p),h=p-d*d;f>0&&m<=d||f<0&&m>=d||(i+=2*h*h,t[2*a]+=4*h*(o-l),t[2*a+1]+=4*h*(s-u),t[2*c]+=4*h*(l-o),t[2*c+1]+=4*h*(u-s))}}return i}function ae(e,t={}){let n=se(e,t),r=t.lossFunction||B;if(e.length>=8){let i=oe(e,t),a=r(i,e),o=r(n,e);a+1e-8<o&&(n=i)}return n}function oe(e,t={}){let n=t.restarts||10,r=[],i={};for(let t of e)t.sets.length===1&&(i[t.sets[0]]=r.length,r.push(t));let{distances:a,constraints:o}=re(e,r,i),s=N(a.map(N))/a.length;a=a.map(e=>e.map(e=>e/s));let c=(e,t)=>ie(e,t,a,o),l=null;for(let e=0;e<n;++e){let e=R(c,A(a.length*2).map(Math.random),t);(!l||e.fx<l.fx)&&(l=e)}let u=l.x,d={};for(let e=0;e<r.length;++e){let t=r[e];d[t.sets[0]]={x:u[2*e]*s,y:u[2*e+1]*s,radius:Math.sqrt(t.size/Math.PI)}}if(t.history)for(let e of t.history)P(e.x,s);return d}function se(e,t){let n=t&&t.lossFunction?t.lossFunction:B,r={},i={};for(let t of e)if(t.sets.length===1){let e=t.sets[0];r[e]={x:1e10,y:1e10,rowid:r.length,size:t.size,radius:Math.sqrt(t.size/Math.PI)},i[e]=[]}e=e.filter(e=>e.sets.length===2);for(let t of e){let e=t.weight==null?1:t.weight,n=t.sets[0],a=t.sets[1];t.size+te>=Math.min(r[n].size,r[a].size)&&(e=0),i[n].push({set:a,size:t.size,weight:e}),i[a].push({set:n,size:t.size,weight:e})}let a=[];Object.keys(i).forEach(e=>{let t=0;for(let n=0;n<i[e].length;++n)t+=i[e][n].size*i[e][n].weight;a.push({set:e,size:t})});function o(e,t){return t.size-e.size}a.sort(o);let s={};function c(e){return e.set in s}function l(e,t){r[t].x=e.x,r[t].y=e.y,s[t]=!0}l({x:0,y:0},a[0].set);for(let t=1;t<a.length;++t){let s=a[t].set,d=i[s].filter(c),f=r[s];if(d.sort(o),d.length===0)throw`ERROR: missing pairwise overlap information`;let p=[];for(var u=0;u<d.length;++u){let e=r[d[u].set],t=z(f.radius,e.radius,d[u].size);p.push({x:e.x+t,y:e.y}),p.push({x:e.x-t,y:e.y}),p.push({y:e.y+t,x:e.x}),p.push({y:e.y-t,x:e.x});for(let n=u+1;n<d.length;++n){let i=r[d[n].set],a=z(f.radius,i.radius,d[n].size),o=D({x:e.x,y:e.y,radius:t},{x:i.x,y:i.y,radius:a});p.push(...o)}}let m=1e50,h=p[0];for(let t of p){r[s].x=t.x,r[s].y=t.y;let i=n(r,e);i<m&&(m=i,h=t)}l(h,s)}return r}function B(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight;n+=i*(t-r.size)*(t-r.size)}return n}function ce(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight,a=Math.log((t+1)/(r.size+1));n+=i*a*a}return n}function le(e,t,n){if(n==null?e.sort((e,t)=>t.radius-e.radius):e.sort(n),e.length>0){let t=e[0].x,n=e[0].y;for(let r of e)r.x-=t,r.y-=n}if(e.length===2&&T(e[0],e[1])<Math.abs(e[1].radius-e[0].radius)&&(e[1].x=e[0].x+e[0].radius-e[1].radius-1e-10,e[1].y=e[0].y),e.length>1){let n=Math.atan2(e[1].x,e[1].y)-t,r=Math.cos(n),i=Math.sin(n);for(let t of e){let e=t.x,n=t.y;t.x=r*e-i*n,t.y=i*e+r*n}}if(e.length>2){let n=Math.atan2(e[2].x,e[2].y)-t;for(;n<0;)n+=2*Math.PI;for(;n>2*Math.PI;)n-=2*Math.PI;if(n>Math.PI){let t=e[1].y/(1e-10+e[1].x);for(let n of e){var r=(n.x+t*n.y)/(1+t*t);n.x=2*r-n.x,n.y=2*r*t-n.y}}}}function ue(e){e.forEach(e=>{e.parent=e});function t(e){return e.parent!==e&&(e.parent=t(e.parent)),e.parent}function n(e,n){let r=t(e);r.parent=t(n)}for(let t=0;t<e.length;++t)for(let r=t+1;r<e.length;++r){let i=e[t].radius+e[r].radius;T(e[t],e[r])+1e-10<i&&n(e[r],e[t])}let r=new Map;for(let n=0;n<e.length;++n){let i=t(e[n]).parent.setid;r.has(i)||r.set(i,[]),r.get(i).push(e[n])}return e.forEach(e=>{delete e.parent}),Array.from(r.values())}function V(e){let t=t=>({max:e.reduce((e,n)=>Math.max(e,n[t]+n.radius),-1/0),min:e.reduce((e,n)=>Math.min(e,n[t]-n.radius),1/0)});return{xRange:t(`x`),yRange:t(`y`)}}function de(e,t,n){t??=Math.PI/2;let r=me(e).map(e=>Object.assign({},e)),i=ue(r);for(let e of i){le(e,t,n);let r=V(e);e.size=(r.xRange.max-r.xRange.min)*(r.yRange.max-r.yRange.min),e.bounds=r}i.sort((e,t)=>t.size-e.size),r=i[0];let a=r.bounds,o=(a.xRange.max-a.xRange.min)/50;function s(e,t,n){if(!e)return;let i=e.bounds,s,c;if(t)s=a.xRange.max-i.xRange.min+o;else{s=a.xRange.max-i.xRange.max;let e=(i.xRange.max-i.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;e<0&&(s+=e)}if(n)c=a.yRange.max-i.yRange.min+o;else{c=a.yRange.max-i.yRange.max;let e=(i.yRange.max-i.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;e<0&&(c+=e)}for(let t of e)t.x+=s,t.y+=c,r.push(t)}let c=1;for(;c<i.length;)s(i[c],!0,!1),s(i[c+1],!1,!0),s(i[c+2],!0,!0),c+=3,a=V(r);return pe(r)}function fe(e,t,n,r,i){let a=me(e);t-=2*r,n-=2*r;let{xRange:o,yRange:s}=V(a);if(o.max===o.min||s.max===s.min)return console.log(`not scaling solution: zero size detected`),e;let c,l;if(i){let e=Math.sqrt(i/Math.PI)*2;c=t/e,l=n/e}else c=t/(o.max-o.min),l=n/(s.max-s.min);let u=Math.min(l,c),d=(t-(o.max-o.min)*u)/2,f=(n-(s.max-s.min)*u)/2;return pe(a.map(e=>({radius:u*e.radius,x:r+d+(e.x-o.min)*u,y:r+f+(e.y-s.min)*u,setid:e.setid})))}function pe(e){let t={};for(let n of e)t[n.setid]=n;return t}function me(e){return Object.keys(e).map(t=>Object.assign(e[t],{setid:t}))}function he(e={}){let t=!1,n=600,r=350,i=15,a=1e3,o=Math.PI/2,s=!0,c=null,l=!0,u=!0,d=null,f=null,p=!1,m=null,h=e&&e.symmetricalTextCentre?e.symmetricalTextCentre:!1,g={},_=e&&e.colourScheme?e.colourScheme:e&&e.colorScheme?e.colorScheme:[`#1f77b4`,`#ff7f0e`,`#2ca02c`,`#d62728`,`#9467bd`,`#8c564b`,`#e377c2`,`#7f7f7f`,`#bcbd22`,`#17becf`],v=0,y=function(e){if(e in g)return g[e];var t=g[e]=_[v];return v+=1,v>=_.length&&(v=0),t},b=ee,x=B;function S(g){let _=g.datum(),v=new Set;_.forEach(e=>{e.size==0&&e.sets.length==1&&v.add(e.sets[0])}),_=_.filter(e=>!e.sets.some(e=>v.has(e)));let S={},C={};if(_.length>0){let e=b(_,{lossFunction:x,distinct:p});s&&(e=de(e,o,f)),S=fe(e,n,r,i,c),C=ve(S,_,h)}let w={};_.forEach(e=>{e.label&&(w[e.sets]=e.label)});function T(e){if(e.sets in w)return w[e.sets];if(e.sets.length==1)return``+e.sets[0]}g.selectAll(`svg`).data([S]).enter().append(`svg`);let E=g.select(`svg`);t?E.attr(`viewBox`,`0 0 ${n} ${r}`):E.attr(`width`,n).attr(`height`,r);let D={},O=!1;E.selectAll(`.venn-area path`).each(function(e){let t=this.getAttribute(`d`);e.sets.length==1&&t&&!p&&(O=!0,D[e.sets[0]]=be(t))});function k(e){return t=>Ce(e.sets.map(e=>{let i=D[e],a=S[e];return i||={x:n/2,y:r/2,radius:1},a||={x:n/2,y:r/2,radius:1},{x:i.x*(1-t)+a.x*t,y:i.y*(1-t)+a.y*t,radius:i.radius*(1-t)+a.radius*t}}),m)}let A=E.selectAll(`.venn-area`).data(_,e=>e.sets),j=A.enter().append(`g`).attr(`class`,e=>`venn-area venn-${e.sets.length==1?`circle`:`intersection`}${e.colour||e.color?` venn-coloured`:``}`).attr(`data-venn-sets`,e=>e.sets.join(`_`)),M=j.append(`path`),N=j.append(`text`).attr(`class`,`label`).text(e=>T(e)).attr(`text-anchor`,`middle`).attr(`dy`,`.35em`).attr(`x`,n/2).attr(`y`,r/2);u&&(M.style(`fill-opacity`,`0`).filter(e=>e.sets.length==1).style(`fill`,e=>e.colour?e.colour:e.color?e.color:y(e.sets)).style(`fill-opacity`,`.25`),N.style(`fill`,t=>t.colour||t.color?`#FFF`:e.textFill?e.textFill:t.sets.length==1?y(t.sets):`#444`));function P(e){return typeof e.transition==`function`?e.transition(`venn`).duration(a):e}let F=g;O&&typeof F.transition==`function`?(F=P(g),F.selectAll(`path`).attrTween(`d`,k)):F.selectAll(`path`).attr(`d`,e=>Ce(e.sets.map(e=>S[e])),m);let I=F.selectAll(`text`).filter(e=>e.sets in C).text(e=>T(e)).attr(`x`,e=>Math.floor(C[e.sets].x)).attr(`y`,e=>Math.floor(C[e.sets].y));l&&(O?`on`in I?I.on(`end`,H(S,T)):I.each(`end`,H(S,T)):I.each(H(S,T)));let L=P(A.exit()).remove();typeof A.transition==`function`&&L.selectAll(`path`).attrTween(`d`,k);let R=L.selectAll(`text`).attr(`x`,n/2).attr(`y`,r/2);return d!==null&&(N.style(`font-size`,`0px`),I.style(`font-size`,d),R.style(`font-size`,`0px`)),{circles:S,textCentres:C,nodes:A,enter:j,update:F,exit:L}}return S.wrap=function(e){return arguments.length?(l=e,S):l},S.useViewBox=function(){return t=!0,S},S.width=function(e){return arguments.length?(n=e,S):n},S.height=function(e){return arguments.length?(r=e,S):r},S.padding=function(e){return arguments.length?(i=e,S):i},S.distinct=function(e){return arguments.length?(p=e,S):p},S.colours=function(e){return arguments.length?(y=e,S):y},S.colors=function(e){return arguments.length?(y=e,S):y},S.fontSize=function(e){return arguments.length?(d=e,S):d},S.round=function(e){return arguments.length?(m=e,S):m},S.duration=function(e){return arguments.length?(a=e,S):a},S.layoutFunction=function(e){return arguments.length?(b=e,S):b},S.normalize=function(e){return arguments.length?(s=e,S):s},S.scaleToFit=function(e){return arguments.length?(c=e,S):c},S.styled=function(e){return arguments.length?(u=e,S):u},S.orientation=function(e){return arguments.length?(o=e,S):o},S.orientationOrder=function(e){return arguments.length?(f=e,S):f},S.lossFunction=function(e){return arguments.length?(x=e===`default`?B:e===`logRatio`?ce:e,S):x},S}function H(e,t){return function(n){let r=this,i=e[n.sets[0]].radius||50,a=t(n)||``,o=a.split(/\s+/).reverse(),s=(a.length+o.length)/3,c=o.pop(),l=[c],u=0,d=1.1;r.textContent=null;let f=[];function p(e){let t=r.ownerDocument.createElementNS(r.namespaceURI,`tspan`);return t.textContent=e,f.push(t),r.append(t),t}let m=p(c);for(;c=o.pop(),c;){l.push(c);let e=l.join(` `);m.textContent=e,e.length>s&&m.getComputedTextLength()>i&&(l.pop(),m.textContent=l.join(` `),l=[c],m=p(c),u++)}let h=.35-u*d/2,g=r.getAttribute(`x`),_=r.getAttribute(`y`);f.forEach((e,t)=>{e.setAttribute(`x`,g),e.setAttribute(`y`,_),e.setAttribute(`dy`,`${h+t*d}em`)})}}function U(e,t,n){let r=t[0].radius-T(t[0],e);for(let n=1;n<t.length;++n){let i=t[n].radius-T(t[n],e);i<=r&&(r=i)}for(let t=0;t<n.length;++t){let i=T(n[t],e)-n[t].radius;i<=r&&(r=i)}return r}function ge(e,t,n){let r=[];for(let t of e)r.push({x:t.x,y:t.y}),r.push({x:t.x+t.radius/2,y:t.y}),r.push({x:t.x-t.radius/2,y:t.y}),r.push({x:t.x,y:t.y+t.radius/2}),r.push({x:t.x,y:t.y-t.radius/2});let i=r[0],a=U(r[0],e,t);for(let n=1;n<r.length;++n){let o=U(r[n],e,t);o>=a&&(i=r[n],a=o)}let o=I(n=>-1*U({x:n[0],y:n[1]},e,t),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,s={x:n?0:o[0],y:o[1]},c=!0;for(let t of e)if(T(s,t)>t.radius){c=!1;break}for(let e of t)if(T(s,e)<e.radius){c=!1;break}if(c)return s;if(e.length==1)return{x:e[0].x,y:e[0].y};let l={};return x(e,l),l.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:l.arcs.length==1?{x:l.arcs[0].circle.x,y:l.arcs[0].circle.y}:t.length?ge(e,[]):O(l.arcs.map(e=>e.p1))}function _e(e){let t={},n=Object.keys(e);for(let e of n)t[e]=[];for(let r=0;r<n.length;r++){let i=n[r],a=e[i];for(let o=r+1;o<n.length;++o){let r=n[o],s=e[r],c=T(a,s);c+s.radius<=a.radius+1e-10?t[r].push(i):c+a.radius<=s.radius+1e-10&&t[i].push(r)}}return t}function ve(e,t,n){let r={},i=_e(e);for(let a=0;a<t.length;++a){let o=t[a].sets,s={},c={};for(let e=0;e<o.length;++e){s[o[e]]=!0;let t=i[o[e]];for(let e=0;e<t.length;++e)c[t[e]]=!0}let l=[],u=[];for(let t in e)t in s?l.push(e[t]):t in c||u.push(e[t]);let d=ge(l,u,n);r[o]=d,d.disjoint&&t[a].size>0&&console.log(`WARNING: area `+o+` not represented on screen`)}return r}function ye(e,t,n){let r=[];return r.push(`
1
+ import{n as e}from"./chunk-Y2CYZVJY-CdjK8XQ9.js";import"./src-CqbXKF1x.js";import{H as t,K as n,U as r,a as i,b as a,c as o,et as s,f as c,nt as l,rt as u,tt as d,v as f,w as p,y as m}from"./chunk-WYO6CB5R-xIUZBSf_.js";import{C as h}from"./src-DKi9i97E.js";import{i as g}from"./chunk-ICXQ74PX-BpNEoAVh.js";import{t as _}from"./chunk-VAUOI2AC-CkyNJUsp.js";import{t as v}from"./rough.esm-BVsMQsy4.js";var y=(e,t)=>l(e,`a`,-t),b=1e-10;function x(e,t){let n=C(e),r=n.filter(t=>S(t,e)),i=0,a=0,o=[];if(r.length>1){let t=O(r);for(let e=0;e<r.length;++e){let n=r[e];n.angle=Math.atan2(n.x-t.x,n.y-t.y)}r.sort((e,t)=>t.angle-e.angle);let n=r[r.length-1];for(let t=0;t<r.length;++t){let s=r[t];a+=(n.x+s.x)*(s.y-n.y);let c={x:(s.x+n.x)/2,y:(s.y+n.y)/2},l=null;for(let t=0;t<s.parentIndex.length;++t)if(n.parentIndex.includes(s.parentIndex[t])){let r=e[s.parentIndex[t]],i=Math.atan2(s.x-r.x,s.y-r.y),a=Math.atan2(n.x-r.x,n.y-r.y),o=a-i;o<0&&(o+=2*Math.PI);let u=a-o/2,d=T(c,{x:r.x+r.radius*Math.sin(u),y:r.y+r.radius*Math.cos(u)});d>r.radius*2&&(d=r.radius*2),(l==null||l.width>d)&&(l={circle:r,width:d,p1:s,p2:n,large:d>r.radius,sweep:!0})}l!=null&&(o.push(l),i+=w(l.circle.radius,l.width),n=s)}}else{let t=e[0];for(let n=1;n<e.length;++n)e[n].radius<t.radius&&(t=e[n]);let n=!1;for(let r=0;r<e.length;++r)if(T(e[r],t)>Math.abs(t.radius-e[r].radius)){n=!0;break}n?i=a=0:(i=t.radius*t.radius*Math.PI,o.push({circle:t,p1:{x:t.x,y:t.y+t.radius},p2:{x:t.x-b,y:t.y+t.radius},width:t.radius*2,large:!0,sweep:!0}))}return a/=2,t&&(t.area=i+a,t.arcArea=i,t.polygonArea=a,t.arcs=o,t.innerPoints=r,t.intersectionPoints=n),i+a}function S(e,t){return t.every(t=>T(e,t)<t.radius+b)}function C(e){let t=[];for(let n=0;n<e.length;++n)for(let r=n+1;r<e.length;++r){let i=D(e[n],e[r]);for(let e of i)e.parentIndex=[n,r],t.push(e)}return t}function w(e,t){return e*e*Math.acos(1-t/e)-(e-t)*Math.sqrt(t*(2*e-t))}function T(e,t){return Math.sqrt((e.x-t.x)*(e.x-t.x)+(e.y-t.y)*(e.y-t.y))}function E(e,t,n){if(n>=e+t)return 0;if(n<=Math.abs(e-t))return Math.PI*Math.min(e,t)*Math.min(e,t);let r=e-(n*n-t*t+e*e)/(2*n),i=t-(n*n-e*e+t*t)/(2*n);return w(e,r)+w(t,i)}function D(e,t){let n=T(e,t),r=e.radius,i=t.radius;if(n>=r+i||n<=Math.abs(r-i))return[];let a=(r*r-i*i+n*n)/(2*n),o=Math.sqrt(r*r-a*a),s=e.x+a*(t.x-e.x)/n,c=e.y+a*(t.y-e.y)/n,l=-(t.y-e.y)*(o/n),u=-(t.x-e.x)*(o/n);return[{x:s+l,y:c-u},{x:s-l,y:c+u}]}function O(e){let t={x:0,y:0};for(let n of e)t.x+=n.x,t.y+=n.y;return t.x/=e.length,t.y/=e.length,t}function k(e,t,n,r){r||={};let i=r.maxIterations||100,a=r.tolerance||1e-10,o=e(t),s=e(n),c=n-t;if(o*s>0)throw`Initial bisect points must have opposite signs`;if(o===0)return t;if(s===0)return n;for(let n=0;n<i;++n){c/=2;let n=t+c,r=e(n);if(r*o>=0&&(t=n),Math.abs(c)<a||r===0)return n}return t+c}function A(e){let t=Array(e);for(let n=0;n<e;++n)t[n]=0;return t}function j(e,t){return A(e).map(()=>A(t))}function M(e,t){let n=0;for(let r=0;r<e.length;++r)n+=e[r]*t[r];return n}function N(e){return Math.sqrt(M(e,e))}function P(e,t,n){for(let r=0;r<t.length;++r)e[r]=t[r]*n}function F(e,t,n,r,i){for(let a=0;a<e.length;++a)e[a]=t*n[a]+r*i[a]}function I(e,t,n){n||={};let r=n.maxIterations||t.length*200,i=n.nonZeroDelta||1.05,a=n.zeroDelta||.001,o=n.minErrorDelta||1e-6,s=n.minErrorDelta||1e-5,c=n.rho===void 0?1:n.rho,l=n.chi===void 0?2:n.chi,u=n.psi===void 0?-.5:n.psi,d=n.sigma===void 0?.5:n.sigma,f,p=t.length,m=Array(p+1);m[0]=t,m[0].fx=e(t),m[0].id=0;for(let n=0;n<p;++n){let r=t.slice();r[n]=r[n]?r[n]*i:a,m[n+1]=r,m[n+1].fx=e(r),m[n+1].id=n+1}function h(e){for(let t=0;t<e.length;t++)m[p][t]=e[t];m[p].fx=e.fx}let g=(e,t)=>e.fx-t.fx,_=t.slice(),v=t.slice(),y=t.slice(),b=t.slice();for(let t=0;t<r;++t){if(m.sort(g),n.history){let e=m.map(e=>{let t=e.slice();return t.fx=e.fx,t.id=e.id,t});e.sort((e,t)=>e.id-t.id),n.history.push({x:m[0].slice(),fx:m[0].fx,simplex:e})}f=0;for(let e=0;e<p;++e)f=Math.max(f,Math.abs(m[0][e]-m[1][e]));if(Math.abs(m[0].fx-m[p].fx)<o&&f<s)break;for(let e=0;e<p;++e){_[e]=0;for(let t=0;t<p;++t)_[e]+=m[t][e];_[e]/=p}let t=m[p];if(F(v,1+c,_,-c,t),v.fx=e(v),v.fx<m[0].fx)F(b,1+l,_,-l,t),b.fx=e(b),b.fx<v.fx?h(b):h(v);else if(v.fx>=m[p-1].fx){let n=!1;if(v.fx>t.fx?(F(y,1+u,_,-u,t),y.fx=e(y),y.fx<t.fx?h(y):n=!0):(F(y,1-u*c,_,u*c,t),y.fx=e(y),y.fx<v.fx?h(y):n=!0),n){if(d>=1)break;for(let t=1;t<m.length;++t)F(m[t],1-d,m[0],d,m[t]),m[t].fx=e(m[t])}}else h(v)}return m.sort(g),{fx:m[0].fx,x:m[0]}}function L(e,t,n,r,i,a,o){let s=n.fx,c=M(n.fxprime,t),l=s,u=s,d=c,f=0;i||=1,a||=1e-6,o||=.1;function p(u,f,p){for(let m=0;m<16;++m)if(i=(u+f)/2,F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||l>=p)f=i;else{if(Math.abs(d)<=-o*c)return i;d*(f-u)>=0&&(f=u),u=i,p=l}return 0}for(let m=0;m<10;++m){if(F(r.x,1,n.x,i,t),l=r.fx=e(r.x,r.fxprime),d=M(r.fxprime,t),l>s+a*i*c||m&&l>=u)return p(f,i,u);if(Math.abs(d)<=-o*c)return i;if(d>=0)return p(i,f,l);u=l,f=i,i*=2}return i}function R(e,t,n){let r={x:t.slice(),fx:0,fxprime:t.slice()},i={x:t.slice(),fx:0,fxprime:t.slice()},a=t.slice(),o,s,c=1,l;n||={},l=n.maxIterations||t.length*20,r.fx=e(r.x,r.fxprime),o=r.fxprime.slice(),P(o,r.fxprime,-1);for(let t=0;t<l;++t){if(c=L(e,o,r,i,c),n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),!c)P(o,r.fxprime,-1);else{F(a,1,i.fxprime,-1,r.fxprime);let e=M(r.fxprime,r.fxprime),t=Math.max(0,M(a,i.fxprime)/e);F(o,t,o,-1,i.fxprime),s=r,r=i,i=s}if(N(r.fxprime)<=1e-5)break}return n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:c}),r}function ee(e,t={}){t.maxIterations=t.maxIterations||500;let n=t.initialLayout||ae,r=t.lossFunction||B,i=ne(e,t),a=n(i,t),o=Object.keys(a),s=[];for(let e of o)s.push(a[e].x),s.push(a[e].y);let c=I(e=>{let t={};for(let n=0;n<o.length;++n){let r=o[n];t[r]={x:e[2*n],y:e[2*n+1],radius:a[r].radius}}return r(t,i)},s,t).x;for(let e=0;e<o.length;++e){let t=o[e];a[t].x=c[2*e],a[t].y=c[2*e+1]}return a}var te=1e-10;function z(e,t,n){return Math.min(e,t)*Math.min(e,t)*Math.PI<=n+te?Math.abs(e-t):k(r=>E(e,t,r)-n,0,e+t)}function ne(e,t={}){let n=t.distinct,r=e.map(e=>Object.assign({},e));function i(e){return e.join(`;`)}if(n){let e=new Map;for(let t of r)for(let n=0;n<t.sets.length;n++){let r=String(t.sets[n]);e.set(r,t.size+(e.get(r)||0));for(let i=n+1;i<t.sets.length;i++){let n=String(t.sets[i]),a=`${r};${n}`,o=`${n};${r}`;e.set(a,t.size+(e.get(a)||0)),e.set(o,t.size+(e.get(o)||0))}}for(let t of r)t.sets.length<3&&(t.size=e.get(i(t.sets)))}let a=[],o=new Set;for(let e of r)if(e.sets.length===1)a.push(e.sets[0]);else if(e.sets.length===2){let t=e.sets[0],n=e.sets[1];o.add(i(e.sets)),o.add(i([n,t]))}a.sort((e,t)=>e===t?0:e<t?-1:1);for(let e=0;e<a.length;++e){let t=a[e];for(let n=e+1;n<a.length;++n){let e=a[n];o.has(i([t,e]))||r.push({sets:[t,e],size:0})}}return r}function re(e,t,n){let r=j(t.length,t.length),i=j(t.length,t.length);return e.filter(e=>e.sets.length===2).forEach(e=>{let a=n[e.sets[0]],o=n[e.sets[1]],s=z(Math.sqrt(t[a].size/Math.PI),Math.sqrt(t[o].size/Math.PI),e.size);r[a][o]=r[o][a]=s;let c=0;e.size+1e-10>=Math.min(t[a].size,t[o].size)?c=1:e.size<=1e-10&&(c=-1),i[a][o]=i[o][a]=c}),{distances:r,constraints:i}}function ie(e,t,n,r){for(let e=0;e<t.length;++e)t[e]=0;let i=0;for(let a=0;a<n.length;++a){let o=e[2*a],s=e[2*a+1];for(let c=a+1;c<n.length;++c){let l=e[2*c],u=e[2*c+1],d=n[a][c],f=r[a][c],p=(l-o)*(l-o)+(u-s)*(u-s),m=Math.sqrt(p),h=p-d*d;f>0&&m<=d||f<0&&m>=d||(i+=2*h*h,t[2*a]+=4*h*(o-l),t[2*a+1]+=4*h*(s-u),t[2*c]+=4*h*(l-o),t[2*c+1]+=4*h*(u-s))}}return i}function ae(e,t={}){let n=se(e,t),r=t.lossFunction||B;if(e.length>=8){let i=oe(e,t),a=r(i,e),o=r(n,e);a+1e-8<o&&(n=i)}return n}function oe(e,t={}){let n=t.restarts||10,r=[],i={};for(let t of e)t.sets.length===1&&(i[t.sets[0]]=r.length,r.push(t));let{distances:a,constraints:o}=re(e,r,i),s=N(a.map(N))/a.length;a=a.map(e=>e.map(e=>e/s));let c=(e,t)=>ie(e,t,a,o),l=null;for(let e=0;e<n;++e){let e=R(c,A(a.length*2).map(Math.random),t);(!l||e.fx<l.fx)&&(l=e)}let u=l.x,d={};for(let e=0;e<r.length;++e){let t=r[e];d[t.sets[0]]={x:u[2*e]*s,y:u[2*e+1]*s,radius:Math.sqrt(t.size/Math.PI)}}if(t.history)for(let e of t.history)P(e.x,s);return d}function se(e,t){let n=t&&t.lossFunction?t.lossFunction:B,r={},i={};for(let t of e)if(t.sets.length===1){let e=t.sets[0];r[e]={x:1e10,y:1e10,rowid:r.length,size:t.size,radius:Math.sqrt(t.size/Math.PI)},i[e]=[]}e=e.filter(e=>e.sets.length===2);for(let t of e){let e=t.weight==null?1:t.weight,n=t.sets[0],a=t.sets[1];t.size+te>=Math.min(r[n].size,r[a].size)&&(e=0),i[n].push({set:a,size:t.size,weight:e}),i[a].push({set:n,size:t.size,weight:e})}let a=[];Object.keys(i).forEach(e=>{let t=0;for(let n=0;n<i[e].length;++n)t+=i[e][n].size*i[e][n].weight;a.push({set:e,size:t})});function o(e,t){return t.size-e.size}a.sort(o);let s={};function c(e){return e.set in s}function l(e,t){r[t].x=e.x,r[t].y=e.y,s[t]=!0}l({x:0,y:0},a[0].set);for(let t=1;t<a.length;++t){let s=a[t].set,d=i[s].filter(c),f=r[s];if(d.sort(o),d.length===0)throw`ERROR: missing pairwise overlap information`;let p=[];for(var u=0;u<d.length;++u){let e=r[d[u].set],t=z(f.radius,e.radius,d[u].size);p.push({x:e.x+t,y:e.y}),p.push({x:e.x-t,y:e.y}),p.push({y:e.y+t,x:e.x}),p.push({y:e.y-t,x:e.x});for(let n=u+1;n<d.length;++n){let i=r[d[n].set],a=z(f.radius,i.radius,d[n].size),o=D({x:e.x,y:e.y,radius:t},{x:i.x,y:i.y,radius:a});p.push(...o)}}let m=1e50,h=p[0];for(let t of p){r[s].x=t.x,r[s].y=t.y;let i=n(r,e);i<m&&(m=i,h=t)}l(h,s)}return r}function B(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight;n+=i*(t-r.size)*(t-r.size)}return n}function ce(e,t){let n=0;for(let r of t){if(r.sets.length===1)continue;let t;if(r.sets.length===2){let n=e[r.sets[0]],i=e[r.sets[1]];t=E(n.radius,i.radius,T(n,i))}else t=x(r.sets.map(t=>e[t]));let i=r.weight==null?1:r.weight,a=Math.log((t+1)/(r.size+1));n+=i*a*a}return n}function le(e,t,n){if(n==null?e.sort((e,t)=>t.radius-e.radius):e.sort(n),e.length>0){let t=e[0].x,n=e[0].y;for(let r of e)r.x-=t,r.y-=n}if(e.length===2&&T(e[0],e[1])<Math.abs(e[1].radius-e[0].radius)&&(e[1].x=e[0].x+e[0].radius-e[1].radius-1e-10,e[1].y=e[0].y),e.length>1){let n=Math.atan2(e[1].x,e[1].y)-t,r=Math.cos(n),i=Math.sin(n);for(let t of e){let e=t.x,n=t.y;t.x=r*e-i*n,t.y=i*e+r*n}}if(e.length>2){let n=Math.atan2(e[2].x,e[2].y)-t;for(;n<0;)n+=2*Math.PI;for(;n>2*Math.PI;)n-=2*Math.PI;if(n>Math.PI){let t=e[1].y/(1e-10+e[1].x);for(let n of e){var r=(n.x+t*n.y)/(1+t*t);n.x=2*r-n.x,n.y=2*r*t-n.y}}}}function ue(e){e.forEach(e=>{e.parent=e});function t(e){return e.parent!==e&&(e.parent=t(e.parent)),e.parent}function n(e,n){let r=t(e);r.parent=t(n)}for(let t=0;t<e.length;++t)for(let r=t+1;r<e.length;++r){let i=e[t].radius+e[r].radius;T(e[t],e[r])+1e-10<i&&n(e[r],e[t])}let r=new Map;for(let n=0;n<e.length;++n){let i=t(e[n]).parent.setid;r.has(i)||r.set(i,[]),r.get(i).push(e[n])}return e.forEach(e=>{delete e.parent}),Array.from(r.values())}function V(e){let t=t=>({max:e.reduce((e,n)=>Math.max(e,n[t]+n.radius),-1/0),min:e.reduce((e,n)=>Math.min(e,n[t]-n.radius),1/0)});return{xRange:t(`x`),yRange:t(`y`)}}function de(e,t,n){t??=Math.PI/2;let r=me(e).map(e=>Object.assign({},e)),i=ue(r);for(let e of i){le(e,t,n);let r=V(e);e.size=(r.xRange.max-r.xRange.min)*(r.yRange.max-r.yRange.min),e.bounds=r}i.sort((e,t)=>t.size-e.size),r=i[0];let a=r.bounds,o=(a.xRange.max-a.xRange.min)/50;function s(e,t,n){if(!e)return;let i=e.bounds,s,c;if(t)s=a.xRange.max-i.xRange.min+o;else{s=a.xRange.max-i.xRange.max;let e=(i.xRange.max-i.xRange.min)/2-(a.xRange.max-a.xRange.min)/2;e<0&&(s+=e)}if(n)c=a.yRange.max-i.yRange.min+o;else{c=a.yRange.max-i.yRange.max;let e=(i.yRange.max-i.yRange.min)/2-(a.yRange.max-a.yRange.min)/2;e<0&&(c+=e)}for(let t of e)t.x+=s,t.y+=c,r.push(t)}let c=1;for(;c<i.length;)s(i[c],!0,!1),s(i[c+1],!1,!0),s(i[c+2],!0,!0),c+=3,a=V(r);return pe(r)}function fe(e,t,n,r,i){let a=me(e);t-=2*r,n-=2*r;let{xRange:o,yRange:s}=V(a);if(o.max===o.min||s.max===s.min)return console.log(`not scaling solution: zero size detected`),e;let c,l;if(i){let e=Math.sqrt(i/Math.PI)*2;c=t/e,l=n/e}else c=t/(o.max-o.min),l=n/(s.max-s.min);let u=Math.min(l,c),d=(t-(o.max-o.min)*u)/2,f=(n-(s.max-s.min)*u)/2;return pe(a.map(e=>({radius:u*e.radius,x:r+d+(e.x-o.min)*u,y:r+f+(e.y-s.min)*u,setid:e.setid})))}function pe(e){let t={};for(let n of e)t[n.setid]=n;return t}function me(e){return Object.keys(e).map(t=>Object.assign(e[t],{setid:t}))}function he(e={}){let t=!1,n=600,r=350,i=15,a=1e3,o=Math.PI/2,s=!0,c=null,l=!0,u=!0,d=null,f=null,p=!1,m=null,h=e&&e.symmetricalTextCentre?e.symmetricalTextCentre:!1,g={},_=e&&e.colourScheme?e.colourScheme:e&&e.colorScheme?e.colorScheme:[`#1f77b4`,`#ff7f0e`,`#2ca02c`,`#d62728`,`#9467bd`,`#8c564b`,`#e377c2`,`#7f7f7f`,`#bcbd22`,`#17becf`],v=0,y=function(e){if(e in g)return g[e];var t=g[e]=_[v];return v+=1,v>=_.length&&(v=0),t},b=ee,x=B;function S(g){let _=g.datum(),v=new Set;_.forEach(e=>{e.size==0&&e.sets.length==1&&v.add(e.sets[0])}),_=_.filter(e=>!e.sets.some(e=>v.has(e)));let S={},C={};if(_.length>0){let e=b(_,{lossFunction:x,distinct:p});s&&(e=de(e,o,f)),S=fe(e,n,r,i,c),C=ve(S,_,h)}let w={};_.forEach(e=>{e.label&&(w[e.sets]=e.label)});function T(e){if(e.sets in w)return w[e.sets];if(e.sets.length==1)return``+e.sets[0]}g.selectAll(`svg`).data([S]).enter().append(`svg`);let E=g.select(`svg`);t?E.attr(`viewBox`,`0 0 ${n} ${r}`):E.attr(`width`,n).attr(`height`,r);let D={},O=!1;E.selectAll(`.venn-area path`).each(function(e){let t=this.getAttribute(`d`);e.sets.length==1&&t&&!p&&(O=!0,D[e.sets[0]]=be(t))});function k(e){return t=>Ce(e.sets.map(e=>{let i=D[e],a=S[e];return i||={x:n/2,y:r/2,radius:1},a||={x:n/2,y:r/2,radius:1},{x:i.x*(1-t)+a.x*t,y:i.y*(1-t)+a.y*t,radius:i.radius*(1-t)+a.radius*t}}),m)}let A=E.selectAll(`.venn-area`).data(_,e=>e.sets),j=A.enter().append(`g`).attr(`class`,e=>`venn-area venn-${e.sets.length==1?`circle`:`intersection`}${e.colour||e.color?` venn-coloured`:``}`).attr(`data-venn-sets`,e=>e.sets.join(`_`)),M=j.append(`path`),N=j.append(`text`).attr(`class`,`label`).text(e=>T(e)).attr(`text-anchor`,`middle`).attr(`dy`,`.35em`).attr(`x`,n/2).attr(`y`,r/2);u&&(M.style(`fill-opacity`,`0`).filter(e=>e.sets.length==1).style(`fill`,e=>e.colour?e.colour:e.color?e.color:y(e.sets)).style(`fill-opacity`,`.25`),N.style(`fill`,t=>t.colour||t.color?`#FFF`:e.textFill?e.textFill:t.sets.length==1?y(t.sets):`#444`));function P(e){return typeof e.transition==`function`?e.transition(`venn`).duration(a):e}let F=g;O&&typeof F.transition==`function`?(F=P(g),F.selectAll(`path`).attrTween(`d`,k)):F.selectAll(`path`).attr(`d`,e=>Ce(e.sets.map(e=>S[e])),m);let I=F.selectAll(`text`).filter(e=>e.sets in C).text(e=>T(e)).attr(`x`,e=>Math.floor(C[e.sets].x)).attr(`y`,e=>Math.floor(C[e.sets].y));l&&(O?`on`in I?I.on(`end`,H(S,T)):I.each(`end`,H(S,T)):I.each(H(S,T)));let L=P(A.exit()).remove();typeof A.transition==`function`&&L.selectAll(`path`).attrTween(`d`,k);let R=L.selectAll(`text`).attr(`x`,n/2).attr(`y`,r/2);return d!==null&&(N.style(`font-size`,`0px`),I.style(`font-size`,d),R.style(`font-size`,`0px`)),{circles:S,textCentres:C,nodes:A,enter:j,update:F,exit:L}}return S.wrap=function(e){return arguments.length?(l=e,S):l},S.useViewBox=function(){return t=!0,S},S.width=function(e){return arguments.length?(n=e,S):n},S.height=function(e){return arguments.length?(r=e,S):r},S.padding=function(e){return arguments.length?(i=e,S):i},S.distinct=function(e){return arguments.length?(p=e,S):p},S.colours=function(e){return arguments.length?(y=e,S):y},S.colors=function(e){return arguments.length?(y=e,S):y},S.fontSize=function(e){return arguments.length?(d=e,S):d},S.round=function(e){return arguments.length?(m=e,S):m},S.duration=function(e){return arguments.length?(a=e,S):a},S.layoutFunction=function(e){return arguments.length?(b=e,S):b},S.normalize=function(e){return arguments.length?(s=e,S):s},S.scaleToFit=function(e){return arguments.length?(c=e,S):c},S.styled=function(e){return arguments.length?(u=e,S):u},S.orientation=function(e){return arguments.length?(o=e,S):o},S.orientationOrder=function(e){return arguments.length?(f=e,S):f},S.lossFunction=function(e){return arguments.length?(x=e===`default`?B:e===`logRatio`?ce:e,S):x},S}function H(e,t){return function(n){let r=this,i=e[n.sets[0]].radius||50,a=t(n)||``,o=a.split(/\s+/).reverse(),s=(a.length+o.length)/3,c=o.pop(),l=[c],u=0,d=1.1;r.textContent=null;let f=[];function p(e){let t=r.ownerDocument.createElementNS(r.namespaceURI,`tspan`);return t.textContent=e,f.push(t),r.append(t),t}let m=p(c);for(;c=o.pop(),c;){l.push(c);let e=l.join(` `);m.textContent=e,e.length>s&&m.getComputedTextLength()>i&&(l.pop(),m.textContent=l.join(` `),l=[c],m=p(c),u++)}let h=.35-u*d/2,g=r.getAttribute(`x`),_=r.getAttribute(`y`);f.forEach((e,t)=>{e.setAttribute(`x`,g),e.setAttribute(`y`,_),e.setAttribute(`dy`,`${h+t*d}em`)})}}function U(e,t,n){let r=t[0].radius-T(t[0],e);for(let n=1;n<t.length;++n){let i=t[n].radius-T(t[n],e);i<=r&&(r=i)}for(let t=0;t<n.length;++t){let i=T(n[t],e)-n[t].radius;i<=r&&(r=i)}return r}function ge(e,t,n){let r=[];for(let t of e)r.push({x:t.x,y:t.y}),r.push({x:t.x+t.radius/2,y:t.y}),r.push({x:t.x-t.radius/2,y:t.y}),r.push({x:t.x,y:t.y+t.radius/2}),r.push({x:t.x,y:t.y-t.radius/2});let i=r[0],a=U(r[0],e,t);for(let n=1;n<r.length;++n){let o=U(r[n],e,t);o>=a&&(i=r[n],a=o)}let o=I(n=>-1*U({x:n[0],y:n[1]},e,t),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,s={x:n?0:o[0],y:o[1]},c=!0;for(let t of e)if(T(s,t)>t.radius){c=!1;break}for(let e of t)if(T(s,e)<e.radius){c=!1;break}if(c)return s;if(e.length==1)return{x:e[0].x,y:e[0].y};let l={};return x(e,l),l.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:l.arcs.length==1?{x:l.arcs[0].circle.x,y:l.arcs[0].circle.y}:t.length?ge(e,[]):O(l.arcs.map(e=>e.p1))}function _e(e){let t={},n=Object.keys(e);for(let e of n)t[e]=[];for(let r=0;r<n.length;r++){let i=n[r],a=e[i];for(let o=r+1;o<n.length;++o){let r=n[o],s=e[r],c=T(a,s);c+s.radius<=a.radius+1e-10?t[r].push(i):c+a.radius<=s.radius+1e-10&&t[i].push(r)}}return t}function ve(e,t,n){let r={},i=_e(e);for(let a=0;a<t.length;++a){let o=t[a].sets,s={},c={};for(let e=0;e<o.length;++e){s[o[e]]=!0;let t=i[o[e]];for(let e=0;e<t.length;++e)c[t[e]]=!0}let l=[],u=[];for(let t in e)t in s?l.push(e[t]):t in c||u.push(e[t]);let d=ge(l,u,n);r[o]=d,d.disjoint&&t[a].size>0&&console.log(`WARNING: area `+o+` not represented on screen`)}return r}function ye(e,t,n){let r=[];return r.push(`
2
2
  M`,e,t),r.push(`
3
3
  m`,-n,0),r.push(`
4
4
  a`,n,n,0,1,0,n*2,0),r.push(`
@@ -0,0 +1 @@
1
+ import"./chunk-KEIR6QF5-dYt3HMDt.js";import{n as e}from"./chunk-5FCAYU7R-BZbSx9vA.js";export{e as createWardleyServices};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-hd2lHHXF.js";import{t}from"./src-UM8T_rSX.js";import{D as n,H as r,K as i,U as a,a as o,b as s,c,v as l,w as u,x as d,y as f}from"./chunk-WYO6CB5R-D_W2G_ln.js";import{i as p}from"./chunk-ICXQ74PX-KggQe_uj.js";import{t as m}from"./chunk-VAUOI2AC-D7b3rQ3R.js";import{t as h}from"./chunk-JWPE2WC7-hvMh92rM.js";import{n as g}from"./mermaid-parser.core-BKNMxYic.js";var _=e((e,t)=>{let n=e<=1?e*100:e;if(n<0||n>100)throw Error(`${t} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`);return n},`toPercent`),v=e((e,t,n)=>({x:_(t,`${n} evolution`),y:_(e,`${n} visibility`)}),`toCoordinates`),y=e(e=>{if(e){if(e===`+<>`)return`bidirectional`;if(e===`+<`)return`backward`;if(e===`+>`)return`forward`}},`getFlowFromPort`),b=e(e=>{if(!e?.startsWith(`+`))return{};let t=/^\+'([^']*)'/.exec(e)?.[1];return e.includes(`<>`)?{flow:`bidirectional`,label:t}:e.includes(`<`)?{flow:`backward`,label:t}:e.includes(`>`)?{flow:`forward`,label:t}:{label:t}},`extractFlowFromArrow`),x=e((e,t)=>{if(h(e,t),e.size&&t.setSize(e.size.width,e.size.height),e.evolution){let n=e.evolution.stages.map(e=>e.secondName?`${e.name.trim()} / ${e.secondName.trim()}`:e.name.trim()),r=e.evolution.stages.filter(e=>e.boundary!==void 0).map(e=>e.boundary);t.updateAxes({stages:n,stageBoundaries:r})}if(e.anchors.forEach(e=>{let n=v(e.visibility,e.evolution,`Anchor "${e.name}"`);t.addNode(e.name,e.name,n.x,n.y,`anchor`)}),e.components.forEach(e=>{let n=v(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,i=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,a=e.decorator?.strategy;t.addNode(e.name,e.name,n.x,n.y,`component`,r,i,e.inertia,a)}),e.notes.forEach(e=>{let n=v(e.visibility,e.evolution,`Note "${e.text}"`);t.addNote(e.text,n.x,n.y)}),e.pipelines.forEach(e=>{let n=t.getNode(e.parent);if(!n||typeof n.y!=`number`)throw Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);let r=n.y;t.startPipeline(e.parent),e.components.forEach(n=>{let i=`${e.parent}_${n.name}`,a=n.label?(n.label.negX?-1:1)*n.label.offsetX:void 0,o=n.label?(n.label.negY?-1:1)*n.label.offsetY:void 0,s=_(n.evolution,`Pipeline component "${n.name}" evolution`);t.addNode(i,n.name,s,r,`pipeline-component`,a,o),t.addPipelineComponent(e.parent,i)})}),e.links.forEach(e=>{let n=!!e.arrow&&(e.arrow.includes(`-.->`)||e.arrow.includes(`.-.`)),r=y(e.fromPort)??y(e.toPort),{flow:i,label:a}=b(e.arrow);!r&&i&&(r=i);let o=e.linkLabel,s=a??o;t.addLink(t.resolveNodeId(e.from),t.resolveNodeId(e.to),n,s,r)}),e.evolves.forEach(e=>{let n=t.getNode(e.component);if(n?.y!==void 0){let r=_(e.target,`Evolve target for "${e.component}"`);t.addTrend(e.component,r,n.y)}}),e.annotations.length>0){let n=e.annotations[0],r=v(n.x,n.y,`Annotations box`);t.setAnnotationsBox(r.x,r.y)}e.annotation.forEach(e=>{let n=v(e.x,e.y,`Annotation ${e.number}`);t.addAnnotation(e.number,[{x:n.x,y:n.y}],e.text)}),e.accelerators.forEach(e=>{let n=v(e.x,e.y,`Accelerator "${e.name}"`);t.addAccelerator(e.name,n.x,n.y)}),e.deaccelerators.forEach(e=>{let n=v(e.x,e.y,`Deaccelerator "${e.name}"`);t.addDeaccelerator(e.name,n.x,n.y)})},`populateDb`),S={parser:{yy:void 0},parse:e(async e=>{let n=await g(`wardley`,e);t.debug(n);let r=S.parser?.yy;if(!r||typeof r.addNode!=`function`)throw 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.`);x(n,r)},`parse`)},C=new 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={}}static{e(this,`WardleyBuilder`)}addNode(e){let t=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...t,...e,className:e.className??t.className,labelOffsetX:e.labelOffsetX??t.labelOffsetX,labelOffsetY:e.labelOffsetY??t.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});let t=this.nodes.get(e);t&&(t.isPipelineParent=!0)}addPipelineComponent(e,t){let n=this.pipelines.get(e);n&&n.componentIds.push(t);let r=this.nodes.get(t);r&&(r.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,t){this.annotationsBox={x:e,y:t}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,t){this.size={width:e,height:t}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(let[t,n]of this.nodes)if(n.label===e)return t;return e}build(){let e=[];for(let t of this.nodes.values()){if(typeof t.x!=`number`||typeof t.y!=`number`)throw Error(`Node "${t.label}" is missing coordinates`);e.push(t)}return{nodes:e,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}};function w(){return d()[`wardley-beta`]}e(w,`getConfig`);function T(e,t,n,r,i,a,o,s,c){C.addNode({id:e,label:t,x:n,y:r,className:i,labelOffsetX:a,labelOffsetY:o,inertia:s,sourceStrategy:c})}e(T,`addNode`);function E(e,t,n=!1,r,i){C.addLink({source:e,target:t,dashed:n,label:r,flow:i})}e(E,`addLink`);function D(e,t,n){C.addTrend({nodeId:e,targetX:t,targetY:n})}e(D,`addTrend`);function O(e,t,n){C.addAnnotation({number:e,coordinates:t,text:n})}e(O,`addAnnotation`);function k(e,t,n){C.addNote({text:e,x:t,y:n})}e(k,`addNote`);function A(e,t,n){C.addAccelerator({name:e,x:t,y:n})}e(A,`addAccelerator`);function j(e,t,n){C.addDeaccelerator({name:e,x:t,y:n})}e(j,`addDeaccelerator`);function M(e,t){C.setAnnotationsBox(e,t)}e(M,`setAnnotationsBox`);function N(e,t){C.setSize(e,t)}e(N,`setSize`);function P(e){C.startPipeline(e)}e(P,`startPipeline`);function F(e,t){C.addPipelineComponent(e,t)}e(F,`addPipelineComponent`);function I(e){C.setAxes(e)}e(I,`updateAxes`);function L(e){return C.getNode(e)}e(L,`getNode`);function R(e){return C.resolveNodeId(e)}e(R,`resolveNodeId`);function z(){return C.build()}e(z,`getWardleyData`);function B(){C.clear(),o()}e(B,`clear`);var V={getConfig:w,addNode:T,addLink:E,addTrend:D,addAnnotation:O,addNote:k,addAccelerator:A,addDeaccelerator:j,setAnnotationsBox:M,setSize:N,startPipeline:P,addPipelineComponent:F,updateAxes:I,getNode:L,resolveNodeId:R,getWardleyData:z,clear:B,setAccTitle:a,getAccTitle:f,setDiagramTitle:i,getDiagramTitle:u,getAccDescription:l,setAccDescription:r},H=[`Genesis`,`Custom Built`,`Product`,`Commodity`],U=e(()=>{let{themeVariables:e}=d();return{backgroundColor:e.wardley?.backgroundColor??e.background??`#fff`,axisColor:e.wardley?.axisColor??`#000`,axisTextColor:e.wardley?.axisTextColor??e.primaryTextColor??`#222`,gridColor:e.wardley?.gridColor??`rgba(100, 100, 100, 0.2)`,componentFill:e.wardley?.componentFill??`#fff`,componentStroke:e.wardley?.componentStroke??`#000`,componentLabelColor:e.wardley?.componentLabelColor??e.primaryTextColor??`#222`,linkStroke:e.wardley?.linkStroke??`#000`,evolutionStroke:e.wardley?.evolutionStroke??`#dc3545`,annotationStroke:e.wardley?.annotationStroke??`#000`,annotationTextColor:e.wardley?.annotationTextColor??e.primaryTextColor??`#222`,annotationFill:e.wardley?.annotationFill??e.background??`#fff`}},`getTheme`),W=e(()=>{let e=d()[`wardley-beta`];return{width:e?.width??900,height:e?.height??600,padding:e?.padding??48,nodeRadius:e?.nodeRadius??6,nodeLabelOffset:e?.nodeLabelOffset??8,axisFontSize:e?.axisFontSize??12,labelFontSize:e?.labelFontSize??10,showGrid:e?.showGrid??!1,useMaxWidth:e?.useMaxWidth??!0}},`getConfigValues`),G={parser:S,db:V,renderer:{draw:e((n,r,i,a)=>{t.debug(`Rendering Wardley map
1
+ import{n as e}from"./chunk-Y2CYZVJY-CdjK8XQ9.js";import{t}from"./src-CqbXKF1x.js";import{D as n,H as r,K as i,U as a,a as o,b as s,c,v as l,w as u,x as d,y as f}from"./chunk-WYO6CB5R-xIUZBSf_.js";import{i as p}from"./chunk-ICXQ74PX-BpNEoAVh.js";import{t as m}from"./chunk-VAUOI2AC-CkyNJUsp.js";import{t as h}from"./chunk-JWPE2WC7-BgE53Vu-.js";import{n as g}from"./mermaid-parser.core-DYtbeah1.js";var _=e((e,t)=>{let n=e<=1?e*100:e;if(n<0||n>100)throw Error(`${t} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${e}`);return n},`toPercent`),v=e((e,t,n)=>({x:_(t,`${n} evolution`),y:_(e,`${n} visibility`)}),`toCoordinates`),y=e(e=>{if(e){if(e===`+<>`)return`bidirectional`;if(e===`+<`)return`backward`;if(e===`+>`)return`forward`}},`getFlowFromPort`),b=e(e=>{if(!e?.startsWith(`+`))return{};let t=/^\+'([^']*)'/.exec(e)?.[1];return e.includes(`<>`)?{flow:`bidirectional`,label:t}:e.includes(`<`)?{flow:`backward`,label:t}:e.includes(`>`)?{flow:`forward`,label:t}:{label:t}},`extractFlowFromArrow`),x=e((e,t)=>{if(h(e,t),e.size&&t.setSize(e.size.width,e.size.height),e.evolution){let n=e.evolution.stages.map(e=>e.secondName?`${e.name.trim()} / ${e.secondName.trim()}`:e.name.trim()),r=e.evolution.stages.filter(e=>e.boundary!==void 0).map(e=>e.boundary);t.updateAxes({stages:n,stageBoundaries:r})}if(e.anchors.forEach(e=>{let n=v(e.visibility,e.evolution,`Anchor "${e.name}"`);t.addNode(e.name,e.name,n.x,n.y,`anchor`)}),e.components.forEach(e=>{let n=v(e.visibility,e.evolution,`Component "${e.name}"`),r=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,i=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,a=e.decorator?.strategy;t.addNode(e.name,e.name,n.x,n.y,`component`,r,i,e.inertia,a)}),e.notes.forEach(e=>{let n=v(e.visibility,e.evolution,`Note "${e.text}"`);t.addNote(e.text,n.x,n.y)}),e.pipelines.forEach(e=>{let n=t.getNode(e.parent);if(!n||typeof n.y!=`number`)throw Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);let r=n.y;t.startPipeline(e.parent),e.components.forEach(n=>{let i=`${e.parent}_${n.name}`,a=n.label?(n.label.negX?-1:1)*n.label.offsetX:void 0,o=n.label?(n.label.negY?-1:1)*n.label.offsetY:void 0,s=_(n.evolution,`Pipeline component "${n.name}" evolution`);t.addNode(i,n.name,s,r,`pipeline-component`,a,o),t.addPipelineComponent(e.parent,i)})}),e.links.forEach(e=>{let n=!!e.arrow&&(e.arrow.includes(`-.->`)||e.arrow.includes(`.-.`)),r=y(e.fromPort)??y(e.toPort),{flow:i,label:a}=b(e.arrow);!r&&i&&(r=i);let o=e.linkLabel,s=a??o;t.addLink(t.resolveNodeId(e.from),t.resolveNodeId(e.to),n,s,r)}),e.evolves.forEach(e=>{let n=t.getNode(e.component);if(n?.y!==void 0){let r=_(e.target,`Evolve target for "${e.component}"`);t.addTrend(e.component,r,n.y)}}),e.annotations.length>0){let n=e.annotations[0],r=v(n.x,n.y,`Annotations box`);t.setAnnotationsBox(r.x,r.y)}e.annotation.forEach(e=>{let n=v(e.x,e.y,`Annotation ${e.number}`);t.addAnnotation(e.number,[{x:n.x,y:n.y}],e.text)}),e.accelerators.forEach(e=>{let n=v(e.x,e.y,`Accelerator "${e.name}"`);t.addAccelerator(e.name,n.x,n.y)}),e.deaccelerators.forEach(e=>{let n=v(e.x,e.y,`Deaccelerator "${e.name}"`);t.addDeaccelerator(e.name,n.x,n.y)})},`populateDb`),S={parser:{yy:void 0},parse:e(async e=>{let n=await g(`wardley`,e);t.debug(n);let r=S.parser?.yy;if(!r||typeof r.addNode!=`function`)throw 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.`);x(n,r)},`parse`)},C=new 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={}}static{e(this,`WardleyBuilder`)}addNode(e){let t=this.nodes.get(e.id)??{id:e.id,label:e.label},n={...t,...e,className:e.className??t.className,labelOffsetX:e.labelOffsetX??t.labelOffsetX,labelOffsetY:e.labelOffsetY??t.labelOffsetY};this.nodes.set(e.id,n)}addLink(e){this.links.push(e)}addTrend(e){this.trends.set(e.nodeId,e)}startPipeline(e){this.pipelines.set(e,{nodeId:e,componentIds:[]});let t=this.nodes.get(e);t&&(t.isPipelineParent=!0)}addPipelineComponent(e,t){let n=this.pipelines.get(e);n&&n.componentIds.push(t);let r=this.nodes.get(t);r&&(r.inPipeline=!0)}addAnnotation(e){this.annotations.push(e)}addNote(e){this.notes.push(e)}addAccelerator(e){this.accelerators.push(e)}addDeaccelerator(e){this.deaccelerators.push(e)}setAnnotationsBox(e,t){this.annotationsBox={x:e,y:t}}setAxes(e){this.axes={...this.axes,...e}}setSize(e,t){this.size={width:e,height:t}}getNode(e){return this.nodes.get(e)}resolveNodeId(e){if(this.nodes.has(e))return e;for(let[t,n]of this.nodes)if(n.label===e)return t;return e}build(){let e=[];for(let t of this.nodes.values()){if(typeof t.x!=`number`||typeof t.y!=`number`)throw Error(`Node "${t.label}" is missing coordinates`);e.push(t)}return{nodes:e,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}};function w(){return d()[`wardley-beta`]}e(w,`getConfig`);function T(e,t,n,r,i,a,o,s,c){C.addNode({id:e,label:t,x:n,y:r,className:i,labelOffsetX:a,labelOffsetY:o,inertia:s,sourceStrategy:c})}e(T,`addNode`);function E(e,t,n=!1,r,i){C.addLink({source:e,target:t,dashed:n,label:r,flow:i})}e(E,`addLink`);function D(e,t,n){C.addTrend({nodeId:e,targetX:t,targetY:n})}e(D,`addTrend`);function O(e,t,n){C.addAnnotation({number:e,coordinates:t,text:n})}e(O,`addAnnotation`);function k(e,t,n){C.addNote({text:e,x:t,y:n})}e(k,`addNote`);function A(e,t,n){C.addAccelerator({name:e,x:t,y:n})}e(A,`addAccelerator`);function j(e,t,n){C.addDeaccelerator({name:e,x:t,y:n})}e(j,`addDeaccelerator`);function M(e,t){C.setAnnotationsBox(e,t)}e(M,`setAnnotationsBox`);function N(e,t){C.setSize(e,t)}e(N,`setSize`);function P(e){C.startPipeline(e)}e(P,`startPipeline`);function F(e,t){C.addPipelineComponent(e,t)}e(F,`addPipelineComponent`);function I(e){C.setAxes(e)}e(I,`updateAxes`);function L(e){return C.getNode(e)}e(L,`getNode`);function R(e){return C.resolveNodeId(e)}e(R,`resolveNodeId`);function z(){return C.build()}e(z,`getWardleyData`);function B(){C.clear(),o()}e(B,`clear`);var V={getConfig:w,addNode:T,addLink:E,addTrend:D,addAnnotation:O,addNote:k,addAccelerator:A,addDeaccelerator:j,setAnnotationsBox:M,setSize:N,startPipeline:P,addPipelineComponent:F,updateAxes:I,getNode:L,resolveNodeId:R,getWardleyData:z,clear:B,setAccTitle:a,getAccTitle:f,setDiagramTitle:i,getDiagramTitle:u,getAccDescription:l,setAccDescription:r},H=[`Genesis`,`Custom Built`,`Product`,`Commodity`],U=e(()=>{let{themeVariables:e}=d();return{backgroundColor:e.wardley?.backgroundColor??e.background??`#fff`,axisColor:e.wardley?.axisColor??`#000`,axisTextColor:e.wardley?.axisTextColor??e.primaryTextColor??`#222`,gridColor:e.wardley?.gridColor??`rgba(100, 100, 100, 0.2)`,componentFill:e.wardley?.componentFill??`#fff`,componentStroke:e.wardley?.componentStroke??`#000`,componentLabelColor:e.wardley?.componentLabelColor??e.primaryTextColor??`#222`,linkStroke:e.wardley?.linkStroke??`#000`,evolutionStroke:e.wardley?.evolutionStroke??`#dc3545`,annotationStroke:e.wardley?.annotationStroke??`#000`,annotationTextColor:e.wardley?.annotationTextColor??e.primaryTextColor??`#222`,annotationFill:e.wardley?.annotationFill??e.background??`#fff`}},`getTheme`),W=e(()=>{let e=d()[`wardley-beta`];return{width:e?.width??900,height:e?.height??600,padding:e?.padding??48,nodeRadius:e?.nodeRadius??6,nodeLabelOffset:e?.nodeLabelOffset??8,axisFontSize:e?.axisFontSize??12,labelFontSize:e?.labelFontSize??10,showGrid:e?.showGrid??!1,useMaxWidth:e?.useMaxWidth??!0}},`getConfigValues`),G={parser:S,db:V,renderer:{draw:e((n,r,i,a)=>{t.debug(`Rendering Wardley map
2
2
  `+n);let o=W(),s=U(),l=o.nodeRadius*1.6,u=a.db,d=u.getWardleyData(),f=u.getDiagramTitle(),p=d.size?.width??o.width,h=d.size?.height??o.height,g=m(r);g.selectAll(`*`).remove(),c(g,h,p,o.useMaxWidth),g.attr(`viewBox`,`0 0 ${p} ${h}`);let _=g.append(`g`).attr(`class`,`wardley-map`),v=g.append(`defs`);v.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`,s.evolutionStroke).attr(`stroke`,`none`),v.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`,s.linkStroke).attr(`stroke`,`none`),v.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`,s.linkStroke).attr(`stroke`,`none`),_.append(`rect`).attr(`class`,`wardley-background`).attr(`width`,p).attr(`height`,h).attr(`fill`,s.backgroundColor);let y=p-o.padding*2,b=h-o.padding*2;f&&_.append(`text`).attr(`class`,`wardley-title`).attr(`x`,p/2).attr(`y`,o.padding/2).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize*1.05).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(f);let x=e(e=>o.padding+e/100*y,`projectX`),S=e(e=>h-o.padding-e/100*b,`projectY`),C=_.append(`g`).attr(`class`,`wardley-axes`);C.append(`line`).attr(`x1`,o.padding).attr(`x2`,p-o.padding).attr(`y1`,h-o.padding).attr(`y2`,h-o.padding).attr(`stroke`,s.axisColor).attr(`stroke-width`,1),C.append(`line`).attr(`x1`,o.padding).attr(`x2`,o.padding).attr(`y1`,o.padding).attr(`y2`,h-o.padding).attr(`stroke`,s.axisColor).attr(`stroke-width`,1);let w=d.axes.xLabel??`Evolution`,T=d.axes.yLabel??`Visibility`;C.append(`text`).attr(`class`,`wardley-axis-label wardley-axis-label-x`).attr(`x`,o.padding+y/2).attr(`y`,h-o.padding/4).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).text(w),C.append(`text`).attr(`class`,`wardley-axis-label wardley-axis-label-y`).attr(`x`,o.padding/3).attr(`y`,o.padding+b/2).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize).attr(`font-weight`,`bold`).attr(`text-anchor`,`middle`).attr(`transform`,`rotate(-90 ${o.padding/3} ${o.padding+b/2})`).text(T);let E=d.axes.stages&&d.axes.stages.length>0?d.axes.stages:H;if(E.length>0){let e=_.append(`g`).attr(`class`,`wardley-stages`),t=d.axes.stageBoundaries,n=[];if(t&&t.length===E.length){let e=0;t.forEach(t=>{n.push({start:e,end:t}),e=t})}else{let e=1/E.length;E.forEach((t,r)=>{n.push({start:r*e,end:(r+1)*e})})}E.forEach((t,r)=>{let i=n[r],a=o.padding+i.start*y,c=(a+(o.padding+i.end*y))/2;r>0&&e.append(`line`).attr(`x1`,a).attr(`x2`,a).attr(`y1`,o.padding).attr(`y2`,h-o.padding).attr(`stroke`,`#000`).attr(`stroke-width`,1).attr(`stroke-dasharray`,`5 5`).attr(`opacity`,.8),e.append(`text`).attr(`class`,`wardley-stage-label`).attr(`x`,c).attr(`y`,h-o.padding/1.5).attr(`fill`,s.axisTextColor).attr(`font-size`,o.axisFontSize-2).attr(`text-anchor`,`middle`).text(t)})}if(o.showGrid){let e=_.append(`g`).attr(`class`,`wardley-grid`);for(let t=1;t<4;t++){let n=t/4,r=o.padding+y*n;e.append(`line`).attr(`x1`,r).attr(`x2`,r).attr(`y1`,o.padding).attr(`y2`,h-o.padding).attr(`stroke`,s.gridColor).attr(`stroke-dasharray`,`2 6`),e.append(`line`).attr(`x1`,o.padding).attr(`x2`,p-o.padding).attr(`y1`,h-o.padding-b*n).attr(`y2`,h-o.padding-b*n).attr(`stroke`,s.gridColor).attr(`stroke-dasharray`,`2 6`)}}let D=new Map;if(d.nodes.forEach(e=>{D.set(e.id,{x:x(e.x),y:S(e.y),node:e})}),d.pipelines.length>0){let e=_.append(`g`).attr(`class`,`wardley-pipelines`),t=_.append(`g`).attr(`class`,`wardley-pipeline-links`);d.pipelines.forEach(n=>{if(n.componentIds.length===0)return;let r=n.componentIds.map(e=>({id:e,pos:D.get(e),node:d.nodes.find(t=>t.id===e)})).filter(e=>e.pos&&e.node).sort((e,t)=>e.node.x-t.node.x);for(let e=0;e<r.length-1;e++){let n=r[e],i=r[e+1];t.append(`line`).attr(`class`,`wardley-pipeline-evolution-link`).attr(`x1`,n.pos.x).attr(`y1`,n.pos.y).attr(`x2`,i.pos.x).attr(`y2`,i.pos.y).attr(`stroke`,s.linkStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,`4 4`)}let i=1/0,a=-1/0,c=0;if(n.componentIds.forEach(e=>{let t=D.get(e);t&&(i=Math.min(i,t.x),a=Math.max(a,t.x),c=t.y)}),i!==1/0&&a!==-1/0){let t=o.nodeRadius*4,r=c-t/2,u=D.get(n.nodeId);u&&(u.x=(i+a)/2,u.y=r-l/6),e.append(`rect`).attr(`class`,`wardley-pipeline-box`).attr(`x`,i-15).attr(`y`,r).attr(`width`,a-i+30).attr(`height`,t).attr(`fill`,`none`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`rx`,4).attr(`ry`,4)}})}let O=_.append(`g`).attr(`class`,`wardley-links`),k=new Map;d.pipelines.forEach(e=>{k.set(e.nodeId,new Set(e.componentIds))});let A=d.links.filter(e=>!(!D.has(e.source)||!D.has(e.target)||k.get(e.target)?.has(e.source)));O.selectAll(`line`).data(A).enter().append(`line`).attr(`class`,e=>`wardley-link${e.dashed?` wardley-link--dashed`:``}`).attr(`x1`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.source).isPipelineParent?l/Math.sqrt(2):o.nodeRadius,i=n.x-t.x,a=n.y-t.y,s=Math.sqrt(i*i+a*a);return t.x+i/s*r}).attr(`y1`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.source).isPipelineParent?l/Math.sqrt(2):o.nodeRadius,i=n.x-t.x,a=n.y-t.y,s=Math.sqrt(i*i+a*a);return t.y+a/s*r}).attr(`x2`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.target).isPipelineParent?l/Math.sqrt(2):o.nodeRadius,i=t.x-n.x,a=t.y-n.y,s=Math.sqrt(i*i+a*a);return n.x+i/s*r}).attr(`y2`,e=>{let t=D.get(e.source),n=D.get(e.target),r=d.nodes.find(t=>t.id===e.target).isPipelineParent?l/Math.sqrt(2):o.nodeRadius,i=t.x-n.x,a=t.y-n.y,s=Math.sqrt(i*i+a*a);return n.y+a/s*r}).attr(`stroke`,s.linkStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,e=>e.dashed?`6 6`:null).attr(`marker-end`,e=>e.flow===`forward`||e.flow===`bidirectional`?`url(#link-arrow-end-${r})`:null).attr(`marker-start`,e=>e.flow===`backward`||e.flow===`bidirectional`?`url(#link-arrow-start-${r})`:null),O.selectAll(`text`).data(A.filter(e=>e.label)).enter().append(`text`).attr(`class`,`wardley-link-label`).attr(`x`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.x+n.x)/2,i=n.y-t.y,a=n.x-t.x;return r+i/Math.sqrt(a*a+i*i)*8}).attr(`y`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.y+n.y)/2,i=n.x-t.x,a=n.y-t.y,o=Math.sqrt(i*i+a*a);return r+-i/o*8}).attr(`fill`,s.axisTextColor).attr(`font-size`,o.labelFontSize).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).attr(`transform`,e=>{let t=D.get(e.source),n=D.get(e.target),r=(t.x+n.x)/2,i=(t.y+n.y)/2,a=n.x-t.x,o=n.y-t.y,s=Math.sqrt(a*a+o*o),c=o/s,l=-a/s,u=r+c*8,d=i+l*8,f=Math.atan2(o,a)*180/Math.PI;return(f>90||f<-90)&&(f+=180),`rotate(${f} ${u} ${d})`}).text(e=>e.label);let j=_.append(`g`).attr(`class`,`wardley-trends`),M=d.trends.map(e=>{let t=D.get(e.nodeId);if(!t)return null;let n=x(e.targetX),r=S(e.targetY),i=n-t.x,a=r-t.y,s=Math.sqrt(i*i+a*a),c=o.nodeRadius+2;return{origin:t,targetX:n,targetY:r,adjustedX2:s>c?n-i/s*c:n,adjustedY2:s>c?r-a/s*c:r}}).filter(e=>e!==null);j.selectAll(`line`).data(M).enter().append(`line`).attr(`class`,`wardley-trend`).attr(`x1`,e=>e.origin.x).attr(`y1`,e=>e.origin.y).attr(`x2`,e=>e.adjustedX2).attr(`y2`,e=>e.adjustedY2).attr(`stroke`,s.evolutionStroke).attr(`stroke-width`,1).attr(`stroke-dasharray`,`4 4`).attr(`marker-end`,`url(#arrow-${r})`);let N=_.append(`g`).attr(`class`,`wardley-nodes`).selectAll(`g`).data(d.nodes).enter().append(`g`).attr(`class`,e=>[`wardley-node`,e.className?`wardley-node--${e.className}`:``].filter(Boolean).join(` `));N.filter(e=>e.sourceStrategy===`outsource`).append(`circle`).attr(`class`,`wardley-outsource-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#666`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.sourceStrategy===`buy`).append(`circle`).attr(`class`,`wardley-buy-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#ccc`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.sourceStrategy===`build`).append(`circle`).attr(`class`,`wardley-build-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`#eee`).attr(`stroke`,`#000`).attr(`stroke-width`,1);let P=N.filter(e=>e.sourceStrategy===`market`);P.append(`circle`).attr(`class`,`wardley-market-overlay`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius*2).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>!e.isPipelineParent&&e.sourceStrategy!==`market`&&e.className!==`anchor`).append(`circle`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y).attr(`r`,o.nodeRadius).attr(`fill`,s.componentFill).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1);let F=o.nodeRadius*.7,I=o.nodeRadius*1.2;if(P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x).attr(`y1`,e=>D.get(e.id).y-I).attr(`x2`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`y2`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`y1`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`x2`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`y2`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`line`).attr(`class`,`wardley-market-line`).attr(`x1`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`y1`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`x2`,e=>D.get(e.id).x).attr(`y2`,e=>D.get(e.id).y-I).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x).attr(`cy`,e=>D.get(e.id).y-I).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x-I*Math.cos(Math.PI/6)).attr(`cy`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),P.append(`circle`).attr(`class`,`wardley-market-dot`).attr(`cx`,e=>D.get(e.id).x+I*Math.cos(Math.PI/6)).attr(`cy`,e=>D.get(e.id).y+I*Math.sin(Math.PI/6)).attr(`r`,F).attr(`fill`,`white`).attr(`stroke`,s.componentStroke).attr(`stroke-width`,2),N.filter(e=>e.isPipelineParent===!0).append(`rect`).attr(`x`,e=>D.get(e.id).x-l/2).attr(`y`,e=>D.get(e.id).y-l/2).attr(`width`,l).attr(`height`,l).attr(`fill`,s.componentFill).attr(`stroke`,s.componentStroke).attr(`stroke-width`,1),N.filter(e=>e.inertia===!0).append(`line`).attr(`class`,`wardley-inertia`).attr(`x1`,e=>{let t=D.get(e.id),n=e.isPipelineParent?l/2+15:o.nodeRadius+15;return e.sourceStrategy&&(n+=o.nodeRadius+10),t.x+n}).attr(`y1`,e=>{let t=D.get(e.id),n=e.isPipelineParent?l:o.nodeRadius*2;return t.y-n/2}).attr(`x2`,e=>{let t=D.get(e.id),n=e.isPipelineParent?l/2+15:o.nodeRadius+15;return e.sourceStrategy&&(n+=o.nodeRadius+10),t.x+n}).attr(`y2`,e=>{let t=D.get(e.id),n=e.isPipelineParent?l:o.nodeRadius*2;return t.y+n/2}).attr(`stroke`,s.componentStroke).attr(`stroke-width`,6),N.append(`text`).attr(`x`,e=>{let t=D.get(e.id);if(e.className===`anchor`)return e.labelOffsetX===void 0?t.x:t.x+e.labelOffsetX;let n=o.nodeLabelOffset;e.sourceStrategy&&e.labelOffsetX===void 0&&(n+=10);let r=e.labelOffsetX??n;return t.x+r}).attr(`y`,e=>{let t=D.get(e.id);if(e.className===`anchor`)return e.labelOffsetY===void 0?t.y-3:t.y+e.labelOffsetY;let n=-o.nodeLabelOffset;e.sourceStrategy&&e.labelOffsetY===void 0&&(n-=10);let r=e.labelOffsetY??n;return t.y+r}).attr(`class`,`wardley-node-label`).attr(`fill`,e=>e.className===`evolved`?s.evolutionStroke:e.className===`anchor`?`#000`:s.componentLabelColor).attr(`font-size`,o.labelFontSize).attr(`font-weight`,e=>e.className===`anchor`?`bold`:`normal`).attr(`text-anchor`,e=>e.className===`anchor`?`middle`:`start`).attr(`dominant-baseline`,e=>e.className===`anchor`?`middle`:`auto`).text(e=>e.label),d.annotations.length>0){let e=_.append(`g`).attr(`class`,`wardley-annotations`);if(d.annotations.forEach(t=>{let n=t.coordinates.map(e=>({x:x(e.x),y:S(e.y)}));if(n.length>1)for(let t=0;t<n.length-1;t++)e.append(`line`).attr(`class`,`wardley-annotation-line`).attr(`x1`,n[t].x).attr(`y1`,n[t].y).attr(`x2`,n[t+1].x).attr(`y2`,n[t+1].y).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`stroke-dasharray`,`4 4`);n.forEach(n=>{let r=e.append(`g`).attr(`class`,`wardley-annotation`);r.append(`circle`).attr(`cx`,n.x).attr(`cy`,n.y).attr(`r`,10).attr(`fill`,`white`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5),r.append(`text`).attr(`x`,n.x).attr(`y`,n.y).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`central`).attr(`font-size`,10).attr(`fill`,s.axisTextColor).attr(`font-weight`,`bold`).text(t.number)})}),d.annotationsBox){let t=x(d.annotationsBox.x),n=S(d.annotationsBox.y),r=e.append(`g`).attr(`class`,`wardley-annotations-box`),i=[...d.annotations].filter(e=>e.text).sort((e,t)=>e.number-t.number),a=[];if(i.forEach((e,i)=>{let o=r.append(`text`).attr(`x`,t+10).attr(`y`,n+10+(i+1)*16).attr(`font-size`,11).attr(`fill`,s.axisTextColor).attr(`text-anchor`,`start`).attr(`dominant-baseline`,`middle`).text(`${e.number}. ${e.text}`);a.push(o)}),a.length>0){let e=0,c=0;a.forEach(t=>{let n=t.node(),r=n.getComputedTextLength();e=Math.max(e,r);let i=n.getBBox();c=Math.max(c,i.height)});let l=e+20+105,u=i.length*16+20+c/2,d=o.padding,f=p-o.padding-l,m=o.padding,g=h-o.padding-u;t=Math.max(d,Math.min(t,f)),n=Math.max(m,Math.min(n,g)),a.forEach((e,r)=>{e.attr(`x`,t+10).attr(`y`,n+10+(r+1)*16)}),r.insert(`rect`,`text`).attr(`x`,t).attr(`y`,n).attr(`width`,l).attr(`height`,u).attr(`fill`,`white`).attr(`stroke`,s.axisColor).attr(`stroke-width`,1.5).attr(`rx`,4).attr(`ry`,4)}}}if(d.notes.length>0){let e=_.append(`g`).attr(`class`,`wardley-notes`);d.notes.forEach(t=>{let n=x(t.x),r=S(t.y);e.append(`text`).attr(`x`,n).attr(`y`,r).attr(`text-anchor`,`start`).attr(`font-size`,11).attr(`fill`,s.axisTextColor).attr(`font-weight`,`bold`).text(t.text)})}if(d.accelerators.length>0){let e=_.append(`g`).attr(`class`,`wardley-accelerators`);d.accelerators.forEach(t=>{let n=x(t.x),r=S(t.y),i=`
3
3
  M ${n} ${r-30/2}
4
4
  L ${n+60-20} ${r-30/2}
@@ -1 +1 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{r as n}from"./dist-DBENJeML.js";import{t as r}from"./createLucideIcon-B5DNg1uu.js";import{On as i}from"./dist-zc03OoUp.js";var a=r(`copy-plus`,[[`line`,{x1:`15`,x2:`15`,y1:`12`,y2:`18`,key:`1p7wdc`}],[`line`,{x1:`12`,x2:`18`,y1:`15`,y2:`15`,key:`1nscbv`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),o=r(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),s=r(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),c=[`global`,`project`];function l(e){return{project:new Set(e.filter(e=>e.scope===`project`).map(e=>e.name)),global:new Set(e.filter(e=>e.scope===`global`).map(e=>e.name))}}var u=`open-knowledge-pack-`;function d(e){return e.startsWith(u)?e.slice(20):e}function f(){let{_:e}=n();return{project:e({id:`e0NrBM`}),global:e({id:`2GT3Hf`})}}function p(){let{_:e}=n();return{project:e({id:`HyvSqq`}),global:e({id:`C7XjNB`})}}var m=e(t(),1);function h(){let[e]=(0,m.useState)(g);return e}function g(){return i()!=null}function _(e,t,n){let r=n===`\\`?t.replaceAll(`/`,`\\`):t;return`${e.endsWith(n)?e.slice(0,-1):e}${n}${r}`}var v=/\.(md|mdx)$/i;function y(e){return v.test(e)?e:`${e}.md`}export{d as a,p as c,a as d,c as i,s as l,_ as n,l as o,h as r,f as s,y as t,o as u};
1
+ import{i as e}from"./chunk-DseTPa7n.js";import{t}from"./react-JNybMug3.js";import{r as n}from"./dist-DBENJeML.js";import{t as r}from"./createLucideIcon-B5DNg1uu.js";import{On as i}from"./dist-BkWgKwL8.js";var a=r(`copy-plus`,[[`line`,{x1:`15`,x2:`15`,y1:`12`,y2:`18`,key:`1p7wdc`}],[`line`,{x1:`12`,x2:`18`,y1:`15`,y2:`15`,key:`1nscbv`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),o=r(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),s=r(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),c=[`global`,`project`];function l(e){return{project:new Set(e.filter(e=>e.scope===`project`).map(e=>e.name)),global:new Set(e.filter(e=>e.scope===`global`).map(e=>e.name))}}var u=`open-knowledge-pack-`;function d(e){return e.startsWith(u)?e.slice(20):e}function f(){let{_:e}=n();return{project:e({id:`e0NrBM`}),global:e({id:`2GT3Hf`})}}function p(){let{_:e}=n();return{project:e({id:`HyvSqq`}),global:e({id:`C7XjNB`})}}var m=e(t(),1);function h(){let[e]=(0,m.useState)(g);return e}function g(){return i()!=null}function _(e,t,n){let r=n===`\\`?t.replaceAll(`/`,`\\`):t;return`${e.endsWith(n)?e.slice(0,-1):e}${n}${r}`}var v=/\.(md|mdx)$/i;function y(e){return v.test(e)?e:`${e}.md`}export{d as a,p as c,a as d,c as i,s as l,_ as n,l as o,h as r,f as s,y as t,o as u};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-hd2lHHXF.js";import{t}from"./src-UM8T_rSX.js";import{D as n,H as r,K as i,U as a,a as o,b as s,c,f as l,v as u,w as d,y as f,z as p}from"./chunk-WYO6CB5R-D_W2G_ln.js";import{t as m}from"./linear-Cq--A9yu.js";import{t as h}from"./ordinal-93FS4LJb.js";import{t as g}from"./init-6tx6Dvs6.js";import{i as _}from"./chunk-ICXQ74PX-KggQe_uj.js";import{t as v}from"./line-CWGXARts.js";import{t as y}from"./chunk-VAUOI2AC-D7b3rQ3R.js";import"./chunk-HOUHSVGY-CzmtdbDE.js";import{t as b}from"./chunk-Q4XR5HBZ-Cv4eUXId.js";function x(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function S(){var e=h().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=x(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return S(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},g.apply(d(),arguments)}var C=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,10,12,14,16,18,19,21,23],r=[2,6],i=[1,3],a=[1,5],o=[1,6],s=[1,7],c=[1,5,10,12,14,16,18,19,21,23,36,37,38],l=[1,25],u=[1,26],d=[1,28],f=[1,29],p=[1,30],m=[1,31],h=[1,32],g=[1,33],_=[1,34],v=[1,35],y=[1,36],b=[1,37],x=[1,43],S=[1,42],C=[1,47],w=[1,50],T=[1,10,12,14,16,18,19,21,23,36,37,38],E=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],D=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],O=[1,65],k=[26,28],A={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:`error`,5:`XYCHART`,8:`CHART_ORIENTATION`,10:`title`,12:`X_AXIS`,14:`Y_AXIS`,16:`LINE`,18:`BAR`,19:`acc_title`,20:`acc_title_value`,21:`acc_descr`,22:`acc_descr_value`,23:`acc_descr_multiline_value`,24:`SQUARE_BRACES_START`,26:`SQUARE_BRACES_END`,28:`COMMA`,29:`NUMBER_WITH_DECIMAL`,30:`STR`,33:`ARROW_DELIMITER`,36:`NEWLINE`,37:`SEMI`,38:`EOF`,40:`MD_STR`,42:`AMP`,43:`NUM`,44:`ALPHA`,45:`PLUS`,46:`EQUALS`,47:`MULT`,48:`DOT`,49:`BRKT`,50:`MINUS`,51:`UNDERSCORE`},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 5:r.setOrientation(a[s]);break;case 9:r.setDiagramTitle(a[s].text.trim());break;case 12:r.setLineData({text:``,type:`text`},a[s]);break;case 13:r.setLineData(a[s-1],a[s]);break;case 14:r.setBarData({text:``,type:`text`},a[s]);break;case 15:r.setBarData(a[s-1],a[s]);break;case 16:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 19:this.$=a[s-1];break;case 20:case 30:this.$=[a[s-2],...a[s]];break;case 21:case 31:this.$=[a[s]];break;case 22:this.$={value:Number(a[s-1]),label:a[s]};break;case 23:this.$={value:Number(a[s]),label:``};break;case 24:r.setXAxisTitle(a[s]);break;case 25:r.setXAxisTitle(a[s-1]);break;case 26:r.setXAxisTitle({type:`text`,text:``});break;case 27:r.setXAxisBand(a[s]);break;case 28:r.setXAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 29:this.$=a[s-1];break;case 32:r.setYAxisTitle(a[s]);break;case 33:r.setYAxisTitle(a[s-1]);break;case 34:r.setYAxisTitle({type:`text`,text:``});break;case 35:r.setYAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 39:this.$={text:a[s],type:`text`};break;case 40:this.$={text:a[s],type:`text`};break;case 41:this.$={text:a[s],type:`markdown`};break;case 42:this.$=a[s];break;case 43:this.$=a[s-1]+``+a[s];break}},`anonymous`),table:[t(n,r,{3:1,4:2,7:4,5:i,36:a,37:o,38:s}),{1:[3]},t(n,r,{4:2,7:4,3:8,5:i,36:a,37:o,38:s}),t(n,r,{4:2,7:4,6:9,3:10,5:i,8:[1,11],36:a,37:o,38:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(c,[2,36]),t(c,[2,37]),t(c,[2,38]),{1:[2,1]},t(n,r,{4:2,7:4,3:21,5:i,36:a,37:o,38:s}),{1:[2,3]},t(c,[2,5]),t(n,[2,7],{4:22,36:a,37:o,38:s}),{11:23,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:39,13:38,24:x,29:S,30:l,31:40,32:41,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:45,15:44,29:C,30:l,35:46,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:49,17:48,24:w,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:52,17:51,24:w,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{20:[1,53]},{22:[1,54]},t(T,[2,18]),{1:[2,2]},t(T,[2,8]),t(T,[2,9]),t(E,[2,39],{41:55,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b}),t(E,[2,40]),t(E,[2,41]),t(D,[2,42]),t(D,[2,44]),t(D,[2,45]),t(D,[2,46]),t(D,[2,47]),t(D,[2,48]),t(D,[2,49]),t(D,[2,50]),t(D,[2,51]),t(D,[2,52]),t(D,[2,53]),t(T,[2,10]),t(T,[2,24],{32:41,31:56,24:x,29:S}),t(T,[2,26]),t(T,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},t(T,[2,11]),t(T,[2,32],{35:60,29:C}),t(T,[2,34]),{33:[1,61]},t(T,[2,12]),{17:62,24:w},{25:63,27:64,29:O},t(T,[2,14]),{17:66,24:w},t(T,[2,16]),t(T,[2,17]),t(D,[2,43]),t(T,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},t(T,[2,33]),{29:[1,70]},t(T,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},t(k,[2,23],{30:[1,73]}),t(T,[2,15]),t(T,[2,28]),t(T,[2,29]),{11:59,30:l,34:74,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},t(T,[2,35]),t(T,[2,19]),{25:75,27:64,29:O},t(k,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
1
+ import{n as e}from"./chunk-Y2CYZVJY-CdjK8XQ9.js";import{t}from"./src-CqbXKF1x.js";import{D as n,H as r,K as i,U as a,a as o,b as s,c,f as l,v as u,w as d,y as f,z as p}from"./chunk-WYO6CB5R-xIUZBSf_.js";import{t as m}from"./linear-CmZ4evs2.js";import{t as h}from"./ordinal-B05IBbop.js";import{t as g}from"./init-BxsvY7Hg.js";import{i as _}from"./chunk-ICXQ74PX-BpNEoAVh.js";import{t as v}from"./line-C4Cs_vf3.js";import{t as y}from"./chunk-VAUOI2AC-CkyNJUsp.js";import"./chunk-HOUHSVGY-BE3Sb9uV.js";import{t as b}from"./chunk-Q4XR5HBZ-Bcm3Q652.js";function x(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function S(){var e=h().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=x(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return S(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},g.apply(d(),arguments)}var C=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,10,12,14,16,18,19,21,23],r=[2,6],i=[1,3],a=[1,5],o=[1,6],s=[1,7],c=[1,5,10,12,14,16,18,19,21,23,36,37,38],l=[1,25],u=[1,26],d=[1,28],f=[1,29],p=[1,30],m=[1,31],h=[1,32],g=[1,33],_=[1,34],v=[1,35],y=[1,36],b=[1,37],x=[1,43],S=[1,42],C=[1,47],w=[1,50],T=[1,10,12,14,16,18,19,21,23,36,37,38],E=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],D=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],O=[1,65],k=[26,28],A={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:`error`,5:`XYCHART`,8:`CHART_ORIENTATION`,10:`title`,12:`X_AXIS`,14:`Y_AXIS`,16:`LINE`,18:`BAR`,19:`acc_title`,20:`acc_title_value`,21:`acc_descr`,22:`acc_descr_value`,23:`acc_descr_multiline_value`,24:`SQUARE_BRACES_START`,26:`SQUARE_BRACES_END`,28:`COMMA`,29:`NUMBER_WITH_DECIMAL`,30:`STR`,33:`ARROW_DELIMITER`,36:`NEWLINE`,37:`SEMI`,38:`EOF`,40:`MD_STR`,42:`AMP`,43:`NUM`,44:`ALPHA`,45:`PLUS`,46:`EQUALS`,47:`MULT`,48:`DOT`,49:`BRKT`,50:`MINUS`,51:`UNDERSCORE`},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 5:r.setOrientation(a[s]);break;case 9:r.setDiagramTitle(a[s].text.trim());break;case 12:r.setLineData({text:``,type:`text`},a[s]);break;case 13:r.setLineData(a[s-1],a[s]);break;case 14:r.setBarData({text:``,type:`text`},a[s]);break;case 15:r.setBarData(a[s-1],a[s]);break;case 16:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 17:case 18:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 19:this.$=a[s-1];break;case 20:case 30:this.$=[a[s-2],...a[s]];break;case 21:case 31:this.$=[a[s]];break;case 22:this.$={value:Number(a[s-1]),label:a[s]};break;case 23:this.$={value:Number(a[s]),label:``};break;case 24:r.setXAxisTitle(a[s]);break;case 25:r.setXAxisTitle(a[s-1]);break;case 26:r.setXAxisTitle({type:`text`,text:``});break;case 27:r.setXAxisBand(a[s]);break;case 28:r.setXAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 29:this.$=a[s-1];break;case 32:r.setYAxisTitle(a[s]);break;case 33:r.setYAxisTitle(a[s-1]);break;case 34:r.setYAxisTitle({type:`text`,text:``});break;case 35:r.setYAxisRangeData(Number(a[s-2]),Number(a[s]));break;case 39:this.$={text:a[s],type:`text`};break;case 40:this.$={text:a[s],type:`text`};break;case 41:this.$={text:a[s],type:`markdown`};break;case 42:this.$=a[s];break;case 43:this.$=a[s-1]+``+a[s];break}},`anonymous`),table:[t(n,r,{3:1,4:2,7:4,5:i,36:a,37:o,38:s}),{1:[3]},t(n,r,{4:2,7:4,3:8,5:i,36:a,37:o,38:s}),t(n,r,{4:2,7:4,6:9,3:10,5:i,8:[1,11],36:a,37:o,38:s}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(c,[2,36]),t(c,[2,37]),t(c,[2,38]),{1:[2,1]},t(n,r,{4:2,7:4,3:21,5:i,36:a,37:o,38:s}),{1:[2,3]},t(c,[2,5]),t(n,[2,7],{4:22,36:a,37:o,38:s}),{11:23,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:39,13:38,24:x,29:S,30:l,31:40,32:41,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:45,15:44,29:C,30:l,35:46,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:49,17:48,24:w,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{11:52,17:51,24:w,30:l,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},{20:[1,53]},{22:[1,54]},t(T,[2,18]),{1:[2,2]},t(T,[2,8]),t(T,[2,9]),t(E,[2,39],{41:55,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b}),t(E,[2,40]),t(E,[2,41]),t(D,[2,42]),t(D,[2,44]),t(D,[2,45]),t(D,[2,46]),t(D,[2,47]),t(D,[2,48]),t(D,[2,49]),t(D,[2,50]),t(D,[2,51]),t(D,[2,52]),t(D,[2,53]),t(T,[2,10]),t(T,[2,24],{32:41,31:56,24:x,29:S}),t(T,[2,26]),t(T,[2,27]),{33:[1,57]},{11:59,30:l,34:58,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},t(T,[2,11]),t(T,[2,32],{35:60,29:C}),t(T,[2,34]),{33:[1,61]},t(T,[2,12]),{17:62,24:w},{25:63,27:64,29:O},t(T,[2,14]),{17:66,24:w},t(T,[2,16]),t(T,[2,17]),t(D,[2,43]),t(T,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},t(T,[2,33]),{29:[1,70]},t(T,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},t(k,[2,23],{30:[1,73]}),t(T,[2,15]),t(T,[2,28]),t(T,[2,29]),{11:59,30:l,34:74,39:24,40:u,41:27,42:d,43:f,44:p,45:m,46:h,47:g,48:_,49:v,50:y,51:b},t(T,[2,35]),t(T,[2,19]),{25:75,27:64,29:O},t(k,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
2
  `+h.showPosition()+`
3
3
  Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};A.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
@@ -0,0 +1 @@
1
+ import{La as e,Ra as t,za as n}from"./dist-BkWgKwL8.js";import{a as r,i,r as a}from"./index.esm-Bn2Z9bGZ.js";var o=(e,t,n)=>{if(e&&`reportValidity`in e){let r=i(n,t);e.setCustomValidity(r&&r.message||``),e.reportValidity()}},s=(e,t)=>{for(let n in t.fields){let r=t.fields[n];r&&r.ref&&`reportValidity`in r.ref?o(r.ref,n,e):r&&r.refs&&r.refs.forEach(t=>o(t,n,e))}},c=(e,t)=>{t.shouldUseNativeValidation&&s(e,t);let n={};for(let a in e){let o=i(t.fields,a),s=Object.assign(e[a]||{},{ref:o&&o.ref});if(l(t.names||Object.keys(e),a)){let e=Object.assign({},i(n,a));r(e,`root`,s),r(n,a,e)}else r(n,a,s)}return n},l=(e,t)=>{let n=u(t).replace(/[.*+?^${}()|\\]/g,`\\$&`);return e.some(e=>u(e).match(`^${n}\\.\\d+`))};function u(e){return e.replace(/[\[\]]/g,``)}function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d.apply(null,arguments)}function f(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function p(e,t){for(var n={};e.length;){var r=e[0],i=r.code,o=r.message,s=r.path.join(`.`);if(!n[s])if(`unionErrors`in r){var c=r.unionErrors[0].errors[0];n[s]={message:c.message,type:c.code}}else n[s]={message:o,type:i};if(`unionErrors`in r&&r.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var l=n[s].types,u=l&&l[r.code];n[s]=a(s,t,n,i,u?[].concat(u,r.message):r.message)}e.shift()}return n}function m(e,t){for(var n={},r=function(){var r=e[0],i=r.code,o=r.message,s=r.path.join(`.`);if(!n[s])if(r.code===`invalid_union`&&r.errors.length>0){var c=r.errors[0][0];n[s]={message:c.message,type:c.code}}else n[s]={message:o,type:i};if(r.code===`invalid_union`&&r.errors.forEach(function(t){return t.forEach(function(t){return e.push(d({},t,{path:[].concat(r.path,t.path)}))})}),t){var l=n[s].types,u=l&&l[r.code];n[s]=a(s,t,n,i,u?[].concat(u,r.message):r.message)}e.shift()};e.length;)r();return n}function h(r,i,a){if(a===void 0&&(a={}),function(e){return`_def`in e&&typeof e._def==`object`&&`typeName`in e._def}(r))return function(e,t,n){try{return Promise.resolve(f(function(){return Promise.resolve(r[a.mode===`sync`?`parse`:`parseAsync`](e,i)).then(function(t){return n.shouldUseNativeValidation&&s({},n),{errors:{},values:a.raw?Object.assign({},e):t}})},function(e){if(function(e){return Array.isArray(e?.issues)}(e))return{values:{},errors:c(p(e.errors,!n.shouldUseNativeValidation&&n.criteriaMode===`all`),n)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return`_zod`in e&&typeof e._zod==`object`}(r))return function(o,l,u){try{return Promise.resolve(f(function(){return Promise.resolve((a.mode===`sync`?e:t)(r,o,i)).then(function(e){return u.shouldUseNativeValidation&&s({},u),{errors:{},values:a.raw?Object.assign({},o):e}})},function(e){if(function(e){return e instanceof n}(e))return{values:{},errors:c(m(e.issues,!u.shouldUseNativeValidation&&u.criteriaMode===`all`),u)};throw e}))}catch(e){return Promise.reject(e)}};throw Error(`Invalid input: not a Zod schema`)}export{h as t};