collabmd 0.1.40 → 0.1.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (634) hide show
  1. package/README.md +68 -0
  2. package/dist/client/assets/CodeMirrorEditor-UCMRAMCV-Fb3TgxXK.js +1 -0
  3. package/dist/client/assets/abnfDiagram-VRR7QNED-C-CM0mGi.js +1 -0
  4. package/dist/client/assets/{apl-C1JYSI8J.js → apl-gfMMiTNf.js} +1 -1
  5. package/dist/client/assets/ar-SA-YLAB6A27-B9ogj_Jh.js +8 -0
  6. package/dist/client/assets/{arc-B59iLcOr.js → arc-DqK6O3qL.js} +1 -1
  7. package/dist/client/assets/architecture-TIHT7OUA-BWqzHezU.js +1 -0
  8. package/dist/client/assets/architectureDiagram-ZJ3FMSHR-DL35gHTu.js +36 -0
  9. package/dist/client/assets/az-AZ-5JXPK2I2-C6Se5-4R.js +1 -0
  10. package/dist/client/assets/bases-preview-controller-CBHDzzot.js +143 -0
  11. package/dist/client/assets/bg-BG-NIQ2RVNG-xrf33IaO.js +5 -0
  12. package/dist/client/assets/blockDiagram-677ZJIJ3-BLomrZyt.js +132 -0
  13. package/dist/client/assets/bn-BD-BN65R3DE-YVZWNN-c.js +3 -0
  14. package/dist/client/assets/bn-IN-2YT4KVKB-YVZWNN-c.js +3 -0
  15. package/dist/client/assets/button-2ZnWQkWV.js +1 -0
  16. package/dist/client/assets/{c4Diagram-AAUBKEIU-DMK9WIWS.js → c4Diagram-LMCZKHZV-al3Umu1D.js} +6 -6
  17. package/dist/client/assets/ca-ES-KSERGC3M-CoMtV4dM.js +8 -0
  18. package/dist/client/assets/channel-XzBGGMWh.js +1 -0
  19. package/dist/client/assets/chunk-2Q5K7J3B-C1jixKkw.js +1 -0
  20. package/dist/client/assets/chunk-32BRIVSS-BD6LQmvI.js +1 -0
  21. package/dist/client/assets/chunk-52WLFC77-BjzXVnqm.js +10 -0
  22. package/dist/client/assets/chunk-5FCAYU7R-DNtJmW0j.js +1 -0
  23. package/dist/client/assets/chunk-5HE753X5-o8-OCfIL.js +1 -0
  24. package/dist/client/assets/{chunk-N66VUXT2-CZ58QOjk.js → chunk-5JV3BV7I-DKfYBAeY.js} +1 -1
  25. package/dist/client/assets/chunk-5TONJI2A-DOX2waSJ.js +2 -0
  26. package/dist/client/assets/{chunk-FMBD7UC4-DD6CIukb.js → chunk-5VM5RSS4-ZNzvKenW.js} +1 -1
  27. package/dist/client/assets/chunk-6GK3VUBP-ChzWImvX.js +41 -0
  28. package/dist/client/assets/chunk-7BUUIJ7U-Bb538aSH.js +1 -0
  29. package/dist/client/assets/chunk-BIQX33UG-CuPbkyWp.js +1 -0
  30. package/dist/client/assets/chunk-C7G6YPKG-C97QUAKv.js +1 -0
  31. package/dist/client/assets/chunk-CJTDIR4C-DvUbqeGR.js +1 -0
  32. package/dist/client/assets/chunk-CQNSW5MT-BbEh_krl.js +1 -0
  33. package/dist/client/assets/chunk-CYSBUYHQ-CbOq7Rc1.js +1 -0
  34. package/dist/client/assets/chunk-EMLP6XTP-BoneA0Uo.js +1 -0
  35. package/dist/client/assets/chunk-EX3LRPZG-DNVm3Wj1.js +231 -0
  36. package/dist/client/assets/chunk-FWX5IMBZ-Ch9_j2qF.js +2 -0
  37. package/dist/client/assets/chunk-HOUHSVGY-DX1huN9x.js +1 -0
  38. package/dist/client/assets/chunk-ICXQ74PX-DGYhuP6g.js +2 -0
  39. package/dist/client/assets/chunk-JG7HCLWE-Dk4_aECj.js +2 -0
  40. package/dist/client/assets/chunk-JWPE2WC7-DVXcaiue.js +1 -0
  41. package/dist/client/assets/chunk-KEIR6QF5-Dj-OpFgW.js +161 -0
  42. package/dist/client/assets/chunk-MOJQB5TN-BEEcDvmL.js +88 -0
  43. package/dist/client/assets/chunk-MOZMSUNE-BgA8jCvb.js +1 -0
  44. package/dist/client/assets/chunk-OGEWGWER-Xh5bvoYs.js +1 -0
  45. package/dist/client/assets/chunk-OSBZ3O6U-CX9EQ5t2.js +1 -0
  46. package/dist/client/assets/chunk-PUDLZKDR-C-JwZaMh.js +156 -0
  47. package/dist/client/assets/{chunk-O5CBEL6O-BFgstMja.js → chunk-Q4XR5HBZ-Dyewsidf.js} +17 -17
  48. package/dist/client/assets/chunk-QBLGF6JB-C9zGMqvP.js +1 -0
  49. package/dist/client/assets/chunk-R7FJI6CG-BpBhcF6R.js +1 -0
  50. package/dist/client/assets/chunk-RYQCIY6F-Dtr3kkSR.js +1 -0
  51. package/dist/client/assets/chunk-SRAX5OIU-Bpn6XoyU.js +1 -0
  52. package/dist/client/assets/chunk-U6XO7XAA-CR0BSRFR.js +2 -0
  53. package/dist/client/assets/{chunk-727SXJPM-DNANnyAn.js → chunk-V7JOEXUC-Bo_5WqHt.js} +6 -6
  54. package/dist/client/assets/chunk-VAUOI2AC-EcvKeBKU.js +1 -0
  55. package/dist/client/assets/chunk-VR4S4FIN-uXjSaaA7.js +1 -0
  56. package/dist/client/assets/chunk-WYO6CB5R-HgTPu1OL.js +127 -0
  57. package/dist/client/assets/chunk-XXDRQBXY-Bq6zMMOx.js +1 -0
  58. package/dist/client/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +1 -0
  59. package/dist/client/assets/chunk-YOTPTUD7-CjHV8V6f.js +1 -0
  60. package/dist/client/assets/{chunk-LOOWOR4L-C5BUwXgZ.js → chunk-Z24UKHUO-BQ6-bK37.js} +3 -3
  61. package/dist/client/assets/{chunk-Z5NKEFVG-GcpeeLo6.js → chunk-Z5NKEFVG-DC2Lcs-4.js} +7 -7
  62. package/dist/client/assets/chunk-ZGVPDNZ5-Bmet6b46.js +62 -0
  63. package/dist/client/assets/{chunk-XPW4576I-D5FnFhOk.js → chunk-ZIRB5QZD-C6fEPe3t.js} +2 -2
  64. package/dist/client/assets/classDiagram-OUVF2IWQ-vy5bnN3c.js +1 -0
  65. package/dist/client/assets/classDiagram-v2-EOCWNBFH-vy5bnN3c.js +1 -0
  66. package/dist/client/assets/clike-CVjTFI47.js +1 -0
  67. package/dist/client/assets/cobol-DHLQUbN7.js +1 -0
  68. package/dist/client/assets/controls-LYQrRFSF.css +1 -0
  69. package/dist/client/assets/cose-bilkent-JH36ORCC-ClqQrHIF.js +1 -0
  70. package/dist/client/assets/cs-CZ-EOMS3IHD-Bo0hDCLX.js +7 -0
  71. package/dist/client/assets/cynefin-VYW2F7L2-4m18BxUG.js +1 -0
  72. package/dist/client/assets/cynefinDiagram-TSTJHNR4-BNlZcGFF.js +62 -0
  73. package/dist/client/assets/cytoscape.esm-CQFVGiJu.js +321 -0
  74. package/dist/client/assets/da-DK-AVL3DJQK-s5-TpkxN.js +2 -0
  75. package/dist/client/assets/dagre-VKFMJZFB-CSQjHsP2.js +4 -0
  76. package/dist/client/assets/dagre-dpRSp0QF.js +1 -0
  77. package/dist/client/assets/de-CH-M25HCZK4-B0r4rx6B.js +7 -0
  78. package/dist/client/assets/de-DE-BEN6XGXY-B0r4rx6B.js +7 -0
  79. package/dist/client/assets/diagram-FQU43EPY-D0RPbiE5.js +3 -0
  80. package/dist/client/assets/diagram-G47NLZAW-XriksZQN.js +24 -0
  81. package/dist/client/assets/diagram-NH7WQ7WH-CaTayrXM.js +24 -0
  82. package/dist/client/assets/diagram-OA4YK3LP-ruJmRhl8.js +30 -0
  83. package/dist/client/assets/diagram-WEI45ONY-C18MNAQv.js +41 -0
  84. package/dist/client/assets/diagram-action-icons-aa_KOv9h.js +36 -0
  85. package/dist/client/assets/{dist-CJMPm6rd.js → dist-0x9D2TFD.js} +1 -1
  86. package/dist/client/assets/{dist-BsTc7qjG.js → dist-B0NFuQC3.js} +1 -1
  87. package/dist/client/assets/{dist-DSehUDUA.js → dist-BA633xb4.js} +1 -1
  88. package/dist/client/assets/{dist-D5hPoFa5.js → dist-BUxzPC-Q.js} +4 -4
  89. package/dist/client/assets/dist-Bx-T__Lj.js +1 -0
  90. package/dist/client/assets/dist-ByYtm-FJ.js +1 -0
  91. package/dist/client/assets/{dist-CAlqrzaF.js → dist-CCrwHjeP.js} +1 -1
  92. package/dist/client/assets/dist-CHJCI2AN.js +1 -0
  93. package/dist/client/assets/dist-CHokDUN_.js +1 -0
  94. package/dist/client/assets/dist-CI1X-CJ2.js +9 -0
  95. package/dist/client/assets/{dist-BOA6xeuH.js → dist-CPim1xdZ.js} +1 -1
  96. package/dist/client/assets/{dist-q3smPWAL.js → dist-CQTo4Y46.js} +1 -1
  97. package/dist/client/assets/{dist-wA96SVn6.js → dist-CZG184W2.js} +1 -1
  98. package/dist/client/assets/{dist-D5BVeoD4.js → dist-C__bPRpd.js} +1 -1
  99. package/dist/client/assets/{dist-BBsYBvEp.js → dist-Cd1BXkVC.js} +1 -1
  100. package/dist/client/assets/dist-CeEU6QwA.js +2 -0
  101. package/dist/client/assets/{dist-CDsAhnoa.js → dist-CzNyYE-S.js} +1 -1
  102. package/dist/client/assets/{dist-x4M0Qd0y.js → dist-D1W8XQvM.js} +1 -1
  103. package/dist/client/assets/{dist-CtHMYO6t.js → dist-D3Tmtejd.js} +1 -1
  104. package/dist/client/assets/{dist-Dv_PLWtE.js → dist-D4MWz_rC.js} +1 -1
  105. package/dist/client/assets/{dist-DCqHC6ts.js → dist-D7-13adP.js} +1 -1
  106. package/dist/client/assets/{dist-Bhn_Fiol.js → dist-DG2HpWvu.js} +1 -1
  107. package/dist/client/assets/dist-DUj7Xwud.js +13 -0
  108. package/dist/client/assets/{dist-DFzJ8okV.js → dist-DXTgEdvE.js} +1 -1
  109. package/dist/client/assets/{dist-U35xPXYU.js → dist-DnbVQL2z.js} +1 -1
  110. package/dist/client/assets/dist-QiKOmE2-.js +1 -0
  111. package/dist/client/assets/{dist-Dx8yU-RA.js → dist-YCtFk_v0.js} +1 -1
  112. package/dist/client/assets/dist-du6QqIs42.js +1 -0
  113. package/dist/client/assets/dist-gGmuzNio.js +1 -0
  114. package/dist/client/assets/dist-qx0Iv9vM.js +1 -0
  115. package/dist/client/assets/dist-snK6kYA_.js +1 -0
  116. package/dist/client/assets/{dockerfile-D8_6_FRV.js → dockerfile-BLkNEvjs.js} +1 -1
  117. package/dist/client/assets/drawio-editor-Z2u5UkLg.js +9 -0
  118. package/dist/client/assets/drawio-embed-controller-BtzURctK.js +1 -0
  119. package/dist/client/assets/drawio-room-yBUzk-vg.js +1 -0
  120. package/dist/client/assets/drawioEditor-B_kenUdu.js +2 -0
  121. package/dist/client/assets/ebnfDiagram-CCIWWBDH-exNgBUy6.js +1 -0
  122. package/dist/client/assets/editor-session-MbnP-AVK.js +16 -0
  123. package/dist/client/assets/el-GR-UBGIF2NW-DRoYAN8w.js +7 -0
  124. package/dist/client/assets/embedded-editor-base-DziW8fkY.css +1 -0
  125. package/dist/client/assets/{en-CMP6EMR6-Bfz_MnNa.js → en-PCJ7LJZ2-1SKiH5y3.js} +1 -1
  126. package/dist/client/assets/erDiagram-Q63AITRT-CoYS49kY.js +85 -0
  127. package/dist/client/assets/es-ES-SQEM5MNY-D5EtY06q.js +7 -0
  128. package/dist/client/assets/eu-ES-YG5N2JAG-CZ0xKIU4.js +7 -0
  129. package/dist/client/assets/eventmodeling-45OFAUF4-Dp0gpjhg.js +1 -0
  130. package/dist/client/assets/excalidraw-editor-CN3Wpa0D.css +1 -0
  131. package/dist/client/assets/{excalidraw-editor-DzL1T9D9.js → excalidraw-editor-kQEbzoXi.js} +4 -4
  132. package/dist/client/assets/excalidraw-embed-controller-BKx05cjZ.js +1 -0
  133. package/dist/client/assets/excalidraw-embed-reconciler-DGiagExg.js +1 -0
  134. package/dist/client/assets/{excalidraw-mermaid-stub-B5sWezsO.js → excalidraw-mermaid-stub-DE5FTiZB.js} +1 -1
  135. package/dist/client/assets/excalidraw-scene-qiXFUZvq.js +176 -0
  136. package/dist/client/assets/excalidrawEditor-fUB8lhQG.js +2 -0
  137. package/dist/client/assets/{export-page-BkCqT_2s.js → export-page-CbIrJ_oK.js} +4 -4
  138. package/dist/client/assets/exportDocument-DdfKM4AY.js +2 -0
  139. package/dist/client/assets/exportDocument-cl8dlTx1.css +1 -0
  140. package/dist/client/assets/fa-IR-EVNM7MAJ-olht-LEH.js +9 -0
  141. package/dist/client/assets/{factor-Cz-hzBGH.js → factor-D7LVTn2l.js} +1 -1
  142. package/dist/client/assets/fi-FI-MW7ZEZ64-D1PIXbLy.js +6 -0
  143. package/dist/client/assets/file-history-view-controller-CK3oHDCT.js +112 -0
  144. package/dist/client/assets/flowDiagram-23GEKE2U-DgaZtMXJ.js +1 -0
  145. package/dist/client/assets/fr-FR-Q7ZPXBDE-B0DjjyfT.js +12 -0
  146. package/dist/client/assets/ganttDiagram-NO4QXBWP-DaBgmYw5.js +292 -0
  147. package/dist/client/assets/git-diff-view-controller-qorJ_Quo.js +150 -0
  148. package/dist/client/assets/git-panel-controller-CzgJWqbB.js +207 -0
  149. package/dist/client/assets/gitGraph-TEB2WS4Q-Do0SQOtM.js +1 -0
  150. package/dist/client/assets/gitGraphDiagram-IHSO6WYX-x3NetpXU.js +106 -0
  151. package/dist/client/assets/gl-ES-O5B74VQL-DH5u_ADp.js +6 -0
  152. package/dist/client/assets/{graphlib-Dduz6oB8.js → graphlib-DS17s2tU.js} +1 -1
  153. package/dist/client/assets/{haxe-CcPA1xnA.js → haxe-DjVOVvNP.js} +1 -1
  154. package/dist/client/assets/he-IL-QGC2WXJA-BSBR1RcG.js +8 -0
  155. package/dist/client/assets/hi-IN-DEZ33NMQ-CorD0_d0.js +3 -0
  156. package/dist/client/assets/hu-HU-2ZPNVYSC-BlqNXhNG.js +3 -0
  157. package/dist/client/assets/id-ID-W65WM5EO-SkLgeJLx.js +8 -0
  158. package/dist/client/assets/image-QEDDDPDB-DtzL4Wgr.js +1 -0
  159. package/dist/client/assets/{image-blob-reduce.esm-CRyv8pnU.js → image-blob-reduce.esm-DLFdRAwc.js} +1 -1
  160. package/dist/client/assets/index-Burthu48.js +2 -0
  161. package/dist/client/assets/index-CYVmRVJX.css +1 -0
  162. package/dist/client/assets/info-DKCQHKI2-DIc7uC4I.js +1 -0
  163. package/dist/client/assets/infoDiagram-FWYZ7A6U-DyfGrH8z.js +2 -0
  164. package/dist/client/assets/input-CXk9Zxz9.js +1 -0
  165. package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-BPqURwBR.js → ishikawaDiagram-FXEZZL3T-BOts527_.js} +2 -2
  166. package/dist/client/assets/it-IT-GAWJM2XW-CDZugsE0.js +12 -0
  167. package/dist/client/assets/ja-JP-FOAUPTH5-DkKXnwj8.js +12 -0
  168. package/dist/client/assets/{javascript-gTK9fxz6.js → javascript-B9TABJff.js} +1 -1
  169. package/dist/client/assets/javascript-BRzqD9BA.js +1 -0
  170. package/dist/client/assets/{journeyDiagram-JHISSGLW-CvxY2Fte.js → journeyDiagram-5HDEW3XC-DF37OVrZ.js} +3 -3
  171. package/dist/client/assets/jsx-runtime-DKdBMi_L.js +1 -0
  172. package/dist/client/assets/kaa-UEDB54S7-C0Sv0drM.js +1 -0
  173. package/dist/client/assets/kab-KAB-CTLMBVE3-QfxUgzL5.js +4 -0
  174. package/dist/client/assets/{kanban-definition-UN3LZRKU-Ex7702dO.js → kanban-definition-HUTT4EX6-nCjbm1T6.js} +24 -24
  175. package/dist/client/assets/katex-B7rAX3Vi.js +257 -0
  176. package/dist/client/assets/keyboard-shortcuts-CLixkZxp.css +1 -0
  177. package/dist/client/assets/keyboard-shortcuts-CLyuDeFZ.js +1 -0
  178. package/dist/client/assets/kk-KZ-XZK63ADD-CMZObxxP.js +1 -0
  179. package/dist/client/assets/km-KH-PBSJLZ2M-Bh1DsarT.js +7 -0
  180. package/dist/client/assets/ko-KR-YNTPN6WQ-DPBaHnwT.js +5 -0
  181. package/dist/client/assets/ku-TR-XUD5BUEU-75pMUQoD.js +6 -0
  182. package/dist/client/assets/{line-DRJILpPI.js → line-h44YiLOQ.js} +1 -1
  183. package/dist/client/assets/{linear-rFRiXd2u.js → linear-DhAcoVP9.js} +1 -1
  184. package/dist/client/assets/lt-LT-LYCDYH7O-BeKUsKuy.js +3 -0
  185. package/dist/client/assets/lv-LV-7ROPDEEI-CrA6QOtq.js +4 -0
  186. package/dist/client/assets/main-DdqVKzQ4.js +813 -0
  187. package/dist/client/assets/map-BaFkSB1l.js +1 -0
  188. package/dist/client/assets/mermaid-parser.core-ygm3cZ_w.js +4 -0
  189. package/dist/client/assets/mermaid-runtime-2fJoRo49.js +11 -0
  190. package/dist/client/assets/{mindmap-definition-RKZ34NQL-D4pwLdMH.js → mindmap-definition-LN4V7U3C-CTpHMYFE.js} +8 -8
  191. package/dist/client/assets/mr-IN-TU6BXRKP-mIvXG0bt.js +9 -0
  192. package/dist/client/assets/my-MM-SJ3RWIEQ-CeEN5n4z.js +1 -0
  193. package/dist/client/assets/navigation-ChYBdSlq.css +1 -0
  194. package/dist/client/assets/nb-NO-GONF2AKR-IChp6OiI.js +8 -0
  195. package/dist/client/assets/nl-NL-UZF6UEKB-DfPPXXjo.js +13 -0
  196. package/dist/client/assets/nn-NO-ZVFRXEEO-BtpjNSGp.js +4 -0
  197. package/dist/client/assets/{nsis-QPGhLAeY.js → nsis-AQ_alPln.js} +1 -1
  198. package/dist/client/assets/oc-FR-MBF2Z56W-CBl14QBM.js +4 -0
  199. package/dist/client/assets/{ordinal-De-qfORd.js → ordinal-hYBb2elL.js} +1 -1
  200. package/dist/client/assets/pa-IN-3JCDVKKL-D95A1XFb.js +4 -0
  201. package/dist/client/assets/packet-7NZHBO7P-D2duWGIK.js +1 -0
  202. package/dist/client/assets/pegDiagram-2B236MQR-Bq9qITsk.js +1 -0
  203. package/dist/client/assets/percentages-WBIPKLEE-bhlTAhiB.js +1 -0
  204. package/dist/client/assets/pica-D0pwGKw7.js +2 -0
  205. package/dist/client/assets/pie-RZYD4A2V-CynqTUkZ.js +1 -0
  206. package/dist/client/assets/pieDiagram-ENE6RG2P--ax2FUc8.js +39 -0
  207. package/dist/client/assets/pl-PL-EERMMCTN-dIzrbxJt.js +12 -0
  208. package/dist/client/assets/preload-helper-HclGiUj8.js +1 -0
  209. package/dist/client/assets/preview-diagram-utils-BPaXsmlV.js +1 -0
  210. package/dist/client/assets/preview-render-compiler-C8wbmTyE.js +1 -0
  211. package/dist/client/assets/preview-render-compiler-CrQBxqqa.js +35 -0
  212. package/dist/client/assets/preview-render-profile-C89_PyT3.js +23 -0
  213. package/dist/client/assets/preview-render-worker-D84F1vpn.js +59 -0
  214. package/dist/client/assets/pt-BR-W4AF5QMX-DIJs8D4M.js +6 -0
  215. package/dist/client/assets/pt-PT-GNPUWAHX-BopN284Y.js +8 -0
  216. package/dist/client/assets/{pug-lkTEco3G.js → pug-Ck0YjsGM.js} +1 -1
  217. package/dist/client/assets/python-2zlmcyof.js +1 -0
  218. package/dist/client/assets/{quadrantDiagram-W4KKPZXB-CD77Rny0.js → quadrantDiagram-ABIIQ3AL-f0PUv7DH.js} +6 -6
  219. package/dist/client/assets/{quick-switcher-controller-CVJBt6V9.js → quick-switcher-controller-CVRUPEKp.js} +1 -1
  220. package/dist/client/assets/radar-I7S5WNFK-fIKE12aT.js +1 -0
  221. package/dist/client/assets/railroad-3IZDKUUU-Bgx8HJTj.js +1 -0
  222. package/dist/client/assets/railroad-abnf-AHOZXSZD-Nh6k60mH.js +1 -0
  223. package/dist/client/assets/railroad-ebnf-EBAXGLYW-C74h3s_I.js +1 -0
  224. package/dist/client/assets/railroad-peg-LSFZ7HO6-0hT-lN-u.js +1 -0
  225. package/dist/client/assets/railroadDiagram-RFXS5EU6-CZD_9g-4.js +1 -0
  226. package/dist/client/assets/react-lCSYwAWP.js +1 -0
  227. package/dist/client/assets/{requirementDiagram-4Y6WPE33-DdKM6ZWI.js → requirementDiagram-TGXJPOKE-C4Jwr3TE.js} +7 -7
  228. package/dist/client/assets/ro-RO-DXHP33S5-PGxfl-ng.js +12 -0
  229. package/dist/client/assets/{room-Cha55fQg.js → room-BhC-3iml.js} +1 -1
  230. package/dist/client/assets/ru-RU-TTW2P7NF-Dwnn0sc5.js +10 -0
  231. package/dist/client/assets/runtime-config-CDgeuPWN.js +1 -0
  232. package/dist/client/assets/runtime-paths-DvpihCEq.js +1 -0
  233. package/dist/client/assets/{sankeyDiagram-5OEKKPKP-BH3_LNkI.js → sankeyDiagram-HTMAVEWB-B2B2mdB6.js} +2 -2
  234. package/dist/client/assets/scheme-tChLYBuY.js +1 -0
  235. package/dist/client/assets/segmented-control-DhUkW6ro.js +1 -0
  236. package/dist/client/assets/sequenceDiagram-DBY2YBRQ-DonUqDnp.js +162 -0
  237. package/dist/client/assets/si-LK-BE6O7LVF-QO9nybVB.js +1 -0
  238. package/dist/client/assets/sizeCapture-X5ZJPWSS-B0uUizjq.js +1 -0
  239. package/dist/client/assets/sk-SK-OI3KJLWQ-BAKIEIig.js +7 -0
  240. package/dist/client/assets/sl-SI-HF74RBGV-CnS5z7V_.js +6 -0
  241. package/dist/client/assets/src-UMNXGZaF.js +1 -0
  242. package/dist/client/assets/stateDiagram-2N3HPSRC-B1niwAq-.js +1 -0
  243. package/dist/client/assets/stateDiagram-v2-6OUMAXLB-C4YrlXQg.js +1 -0
  244. package/dist/client/assets/states-DYMshUe2.css +1 -0
  245. package/dist/client/assets/subset-shared.chunk-D3olxosN.js +1 -0
  246. package/dist/client/assets/{subset-worker.chunk-BW_EF59g.js → subset-worker.chunk-Cuw2UvhD.js} +1 -1
  247. package/dist/client/assets/sv-SE-TXR2SQGA-CNgv7xeJ.js +8 -0
  248. package/dist/client/assets/swimlanes-5IMT3BWC-DP1GREXh.js +2 -0
  249. package/dist/client/assets/swimlanesDiagram-G3AALYLV-CN_iOXin.js +8 -0
  250. package/dist/client/assets/ta-IN-Y2DOZGBR-DYzsfax7.js +6 -0
  251. package/dist/client/assets/textile-CyzeGT9J.js +1 -0
  252. package/dist/client/assets/th-TH-JUAISFQR-BAZHUCM7.js +1 -0
  253. package/dist/client/assets/timeline-definition-FHXFAJF6-C-QK9sME.js +120 -0
  254. package/dist/client/assets/tr-TR-U3HGKQXH-DTYupb_4.js +4 -0
  255. package/dist/client/assets/treeView-QDETBFTQ-CygwzEgj.js +1 -0
  256. package/dist/client/assets/treemap-6X3UGDF4-BbCXbaXr.js +1 -0
  257. package/dist/client/assets/turtle-Cx3rYX2g.js +1 -0
  258. package/dist/client/assets/uk-UA-FP2TKAFK-Bcxd6wgd.js +6 -0
  259. package/dist/client/assets/uz-UZ-WY5QKWXJ-B5N6xPud.js +1 -0
  260. package/dist/client/assets/vault-api-client-BPVNCJZC.js +1 -0
  261. package/dist/client/assets/vault-api-client-VAfZ8okg.js +1 -0
  262. package/dist/client/assets/{vault-utils-BbJUHPCf.js → vault-utils-kIbqyWPm.js} +1 -1
  263. package/dist/client/assets/vennDiagram-L72KCM5P-DPQ9kbN2.js +34 -0
  264. package/dist/client/assets/{verilog-DSARZZPc.js → verilog-BKSQ5RMB.js} +1 -1
  265. package/dist/client/assets/vhdl-CBDDcIJ_.js +1 -0
  266. package/dist/client/assets/vi-VN-DE5I4H6K-BdlcTH5l.js +7 -0
  267. package/dist/client/assets/wardley-OPB4EBWU-BjXxCRf_.js +1 -0
  268. package/dist/client/assets/{wardleyDiagram-YWT4CUSO-EdTzLQiR.js → wardleyDiagram-EHGQE667-5VW6_Csg.js} +3 -3
  269. package/dist/client/assets/{xquery-CEDTd8qs.js → xquery-Cda5K8Gy.js} +1 -1
  270. package/dist/client/assets/xychartDiagram-FW5EYKEG-Bj0UwltS.js +7 -0
  271. package/dist/client/assets/{yjs-provider-reset-guard-CNmMf4Qd.js → yjs-provider-reset-guard-DSfwdXS9.js} +2 -2
  272. package/dist/client/assets/zh-CN-VWHOHS7G-b12eD2L4.js +11 -0
  273. package/dist/client/assets/zh-HK-KQF7FW7H-Bvr6xExo.js +1 -0
  274. package/dist/client/assets/zh-TW-6VHVWZKW-B-KCOPyt.js +13 -0
  275. package/dist/client/drawio-editor.html +3 -3
  276. package/dist/client/excalidraw-editor.html +3 -3
  277. package/dist/client/export-document.html +5 -5
  278. package/dist/client/index.html +5 -5
  279. package/package.json +25 -25
  280. package/src/client/application/app-shell/chat-feature.js +2 -2
  281. package/src/client/application/app-shell/comments-feature.js +108 -0
  282. package/src/client/application/app-shell/git-feature.js +6 -1
  283. package/src/client/application/app-shell/presence-feature.js +4 -1
  284. package/src/client/application/app-shell/ui-feature-shell.js +11 -4
  285. package/src/client/application/app-shell/ui-feature-sidebar.js +22 -4
  286. package/src/client/application/app-shell-elements.js +3 -0
  287. package/src/client/application/diagram-chrome.js +708 -0
  288. package/src/client/application/markdown-frontmatter.js +2 -2
  289. package/src/client/application/mermaid-preview-hydrator.js +30 -528
  290. package/src/client/application/plantuml-preview-hydrator.js +22 -518
  291. package/src/client/application/preview-renderer.js +15 -4
  292. package/src/client/application/workspace-route-controller.js +11 -1
  293. package/src/client/bootstrap/app-shell-feature-surface.js +67 -0
  294. package/src/client/bootstrap/collabmd-app-shell.js +111 -356
  295. package/src/client/bootstrap/lazy-controller-feature.js +434 -0
  296. package/src/client/infrastructure/vault-api-client.js +5 -0
  297. package/src/client/presentation/app-shell-template.js +64 -27
  298. package/src/client/presentation/bases-preview-controller.js +33 -16
  299. package/src/client/presentation/comment-overview-controller.js +263 -0
  300. package/src/client/presentation/comment-ui/comment-ui-state.js +23 -0
  301. package/src/client/presentation/file-explorer-controller.js +9 -0
  302. package/src/client/presentation/file-explorer-view.js +11 -1
  303. package/src/client/presentation/git-panel-controller.js +5 -1
  304. package/src/client/presentation/outline-controller.js +4 -0
  305. package/src/client/styles/components/feedback.css +4 -4
  306. package/src/client/styles/components/navigation.css +50 -11
  307. package/src/client/styles/components/scrollbars.css +5 -0
  308. package/src/client/styles/components/states.css +39 -1
  309. package/src/client/styles/components/surfaces.css +5 -2
  310. package/src/client/styles/features/auth-gate.css +5 -5
  311. package/src/client/styles/features/backlinks.css +12 -12
  312. package/src/client/styles/features/collaboration-chat.css +7 -8
  313. package/src/client/styles/features/collaboration-dialogs.css +6 -5
  314. package/src/client/styles/features/collaboration-presence.css +7 -7
  315. package/src/client/styles/features/comment-card.css +12 -10
  316. package/src/client/styles/features/comment-overview.css +193 -0
  317. package/src/client/styles/features/comments-drawer.css +14 -18
  318. package/src/client/styles/features/comments.css +1 -0
  319. package/src/client/styles/features/diagram-preview.css +4 -4
  320. package/src/client/styles/features/diff-commit.css +15 -16
  321. package/src/client/styles/features/diff-toolbar.css +4 -5
  322. package/src/client/styles/features/git-branch.css +1 -1
  323. package/src/client/styles/features/git-files.css +2 -2
  324. package/src/client/styles/features/git-history.css +23 -26
  325. package/src/client/styles/features/media-lightbox.css +5 -5
  326. package/src/client/styles/features/outline.css +13 -2
  327. package/src/client/styles/features/quick-switcher.css +77 -20
  328. package/src/client/styles/foundation/themes.css +79 -78
  329. package/src/client/styles/foundation/tokens.css +5 -4
  330. package/src/client/styles/layout/editor-page.css +49 -16
  331. package/src/client/styles/layout/overlays.css +2 -2
  332. package/src/client/styles/layout/responsive.css +25 -6
  333. package/src/client/styles/layout/shell.css +5 -5
  334. package/src/client/styles/layout/sidebar.css +34 -13
  335. package/src/client/styles/layout/view-modes.css +1 -1
  336. package/src/client/styles/primitives/controls.css +17 -9
  337. package/src/domain/yaml-frontmatter.js +2 -3
  338. package/src/server/application/workspace-reconciliation.js +446 -0
  339. package/src/server/config/env.js +73 -0
  340. package/src/server/create-app-server.js +39 -32
  341. package/src/server/domain/bases/base-definition.js +12 -3
  342. package/src/server/domain/bases/base-expression-runtime.js +183 -147
  343. package/src/server/domain/bases/base-index-snapshot-store.js +53 -2
  344. package/src/server/domain/bases/base-query-service.js +55 -38
  345. package/src/server/domain/bases/base-transform.js +4 -3
  346. package/src/server/domain/collaboration/collaboration-document-store.js +6 -2
  347. package/src/server/domain/collaboration/collaboration-room.js +66 -2
  348. package/src/server/domain/comment-overview.js +108 -0
  349. package/src/server/domain/hosted-workspace-contract.js +18 -0
  350. package/src/server/domain/hosted-workspace.js +744 -0
  351. package/src/server/domain/workspace-state.js +848 -2
  352. package/src/server/infrastructure/github/github-app-client.js +205 -0
  353. package/src/server/infrastructure/github/github-setup-flow.js +86 -0
  354. package/src/server/infrastructure/http/create-git-api-command-handler.js +1 -1
  355. package/src/server/infrastructure/http/create-hosted-api-handler.js +200 -0
  356. package/src/server/infrastructure/http/create-request-handler.js +20 -0
  357. package/src/server/infrastructure/http/create-static-handler.js +4 -0
  358. package/src/server/infrastructure/http/create-vault-api-command-handler.js +44 -119
  359. package/src/server/infrastructure/http/create-vault-api-query-handler.js +18 -33
  360. package/src/server/infrastructure/http/request-body.js +12 -2
  361. package/src/server/infrastructure/persistence/hosted-metadata-store.js +500 -0
  362. package/src/server/infrastructure/persistence/sidecar-store.js +53 -2
  363. package/src/server/infrastructure/persistence/vault-content-adapter.js +8 -8
  364. package/src/server/infrastructure/persistence/vault-file-store.js +64 -135
  365. package/src/server/infrastructure/websocket/attach-collaboration-gateway.js +49 -5
  366. package/src/server/infrastructure/workspace/file-system-sync-service.js +24 -411
  367. package/src/server/infrastructure/workspace/workspace-mutation-coordinator.js +13 -621
  368. package/src/server/infrastructure/workspace/workspace-state-file-system-adapter.js +37 -0
  369. package/dist/client/assets/CodeMirrorEditor-UCMRAMCV-CjJV4GGp.js +0 -1
  370. package/dist/client/assets/ar-SA-NXDWD63E-BfWwfLiP.js +0 -8
  371. package/dist/client/assets/architecture-7EHR7CIX-M1SFnuBJ.js +0 -1
  372. package/dist/client/assets/architectureDiagram-3BPJPVTR-Cs4u0ty-.js +0 -36
  373. package/dist/client/assets/az-AZ-MXSORGZV-D3w9H6nC.js +0 -1
  374. package/dist/client/assets/bg-BG-O6MV2KSF-CqITeIE6.js +0 -5
  375. package/dist/client/assets/blockDiagram-GPEHLZMM-C4RLg7wo.js +0 -132
  376. package/dist/client/assets/bn-BD-T2VJNT7N-DRxwOMG_.js +0 -3
  377. package/dist/client/assets/bn-IN-MMW2ORAC-BZcsVFhS.js +0 -3
  378. package/dist/client/assets/ca-ES-MKBCGNOG-D2cujUJ7.js +0 -8
  379. package/dist/client/assets/channel-E9SBQ9z6.js +0 -1
  380. package/dist/client/assets/chunk-2J33WTMH-Beqll06X.js +0 -1
  381. package/dist/client/assets/chunk-3OPIFGDE-Kf30X6bZ.js +0 -62
  382. package/dist/client/assets/chunk-3PELD44J-DymL2rGq.js +0 -1
  383. package/dist/client/assets/chunk-4BX2VUAB-BVNkn9EH.js +0 -1
  384. package/dist/client/assets/chunk-4EGX6M5U-6L36_8q8.js +0 -1
  385. package/dist/client/assets/chunk-55IACEB6-CaPPZbdp.js +0 -1
  386. package/dist/client/assets/chunk-5DO6E6H7-BpgUf0HE.js +0 -1
  387. package/dist/client/assets/chunk-5ZQYHXKU-BJyABJSy.js +0 -2
  388. package/dist/client/assets/chunk-A66AFZZU-BFHL744F.js +0 -7
  389. package/dist/client/assets/chunk-AQP2D5EJ-D-ou9vaq.js +0 -231
  390. package/dist/client/assets/chunk-BR22UD5L-CHoFxkAQ.js +0 -1
  391. package/dist/client/assets/chunk-BSJP7CBP-AmT6zI00.js +0 -1
  392. package/dist/client/assets/chunk-CSCIHK7Q-BIoF4mTy.js +0 -123
  393. package/dist/client/assets/chunk-FHYWG6QK-qLbgayZT.js +0 -1
  394. package/dist/client/assets/chunk-KSCS5N6A-DSHzBB4H.js +0 -10
  395. package/dist/client/assets/chunk-L5ZTLDWV-Ca0loQr2.js +0 -1
  396. package/dist/client/assets/chunk-LZXEDZCA-D4QboL2E.js +0 -2
  397. package/dist/client/assets/chunk-MPE355IW-BGGMthoR.js +0 -1
  398. package/dist/client/assets/chunk-MZUSXYTE-CXyCvcyW.js +0 -1
  399. package/dist/client/assets/chunk-ND2GUHAM-3Xs0Awks.js +0 -1
  400. package/dist/client/assets/chunk-NNHCCRGN--8l6bbR-.js +0 -159
  401. package/dist/client/assets/chunk-NZK2D7GU-w2jXiKa6.js +0 -1
  402. package/dist/client/assets/chunk-PUPMXCY4-JvkUXyIj.js +0 -1
  403. package/dist/client/assets/chunk-QZHKN3VN-9NMPSwDX.js +0 -1
  404. package/dist/client/assets/chunk-SRAX5OIU-C_UPA-vt.js +0 -1
  405. package/dist/client/assets/chunk-UIBZB4QT-B4OybPy_.js +0 -1
  406. package/dist/client/assets/chunk-WCWK7LTN-BOL8a2ua.js +0 -1
  407. package/dist/client/assets/chunk-WMDFGAFD-EzVSth95.js +0 -35
  408. package/dist/client/assets/chunk-WU5MYG2G-Bl8VQmZH.js +0 -1
  409. package/dist/client/assets/classDiagram-4FO5ZUOK-D7YhYDLZ.js +0 -1
  410. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-COI4atGv.js +0 -1
  411. package/dist/client/assets/clike-BFTLRaGS.js +0 -1
  412. package/dist/client/assets/cobol-DP4QggbL.js +0 -1
  413. package/dist/client/assets/controls-CLpueX2m.css +0 -1
  414. package/dist/client/assets/cose-bilkent-S5V4N54A-Cx3Qt7pR.js +0 -1
  415. package/dist/client/assets/cs-CZ-V77HGUP7-BXqhmWZb.js +0 -7
  416. package/dist/client/assets/cytoscape.esm-B_ygTtvl.js +0 -321
  417. package/dist/client/assets/da-DK-I5RFNTM4-raD_lQnT.js +0 -2
  418. package/dist/client/assets/dagre-BM42HDAG-BpURvxT4.js +0 -4
  419. package/dist/client/assets/dagre-BcZLxzJJ.js +0 -1
  420. package/dist/client/assets/de-CH-WLRDEVBV-CyNG_YAO.js +0 -7
  421. package/dist/client/assets/de-DE-DTI4WUSC-BAnqlByT.js +0 -7
  422. package/dist/client/assets/diagram-2AECGRRQ-DJH0JVlq.js +0 -43
  423. package/dist/client/assets/diagram-5GNKFQAL-DQG4Q1eS.js +0 -10
  424. package/dist/client/assets/diagram-KO2AKTUF-hx21Lv-5.js +0 -3
  425. package/dist/client/assets/diagram-LMA3HP47--QODJMa9.js +0 -24
  426. package/dist/client/assets/diagram-OG6HWLK6-CB30hX1a.js +0 -24
  427. package/dist/client/assets/dist-6oqNX0NJ.js +0 -1
  428. package/dist/client/assets/dist-B0U2pnHE.js +0 -1
  429. package/dist/client/assets/dist-B1BRR2vO.js +0 -1
  430. package/dist/client/assets/dist-B48_21rM.js +0 -1
  431. package/dist/client/assets/dist-BNDWUlMx.js +0 -9
  432. package/dist/client/assets/dist-BQuic6-d.js +0 -1
  433. package/dist/client/assets/dist-BoCYrsTA.js +0 -1
  434. package/dist/client/assets/dist-C-W89K9S.js +0 -1
  435. package/dist/client/assets/dist-CBTadfRi2.js +0 -1
  436. package/dist/client/assets/dist-D4DGyOvV.js +0 -1
  437. package/dist/client/assets/dist-UnjH15yg.js +0 -13
  438. package/dist/client/assets/dist-ihRjPW1T.js +0 -2
  439. package/dist/client/assets/drawio-editor-BHYoSlR7.js +0 -9
  440. package/dist/client/assets/drawio-room-DrZ-gy4N.js +0 -1
  441. package/dist/client/assets/drawioEditor-B-Ssnq_p.js +0 -2
  442. package/dist/client/assets/editor-session-BTPe8PEu.js +0 -16
  443. package/dist/client/assets/el-GR-ZXDJ2OS4-De6xlnXD.js +0 -7
  444. package/dist/client/assets/embedded-editor-base-Bb8ywn1e.css +0 -1
  445. package/dist/client/assets/erDiagram-TEJ5UH35-BvMeaml9.js +0 -85
  446. package/dist/client/assets/es-ES-DYQHAD43-EVQAeFTZ.js +0 -7
  447. package/dist/client/assets/eu-ES-QDSYU5Y3-O5XEQp0x.js +0 -7
  448. package/dist/client/assets/eventmodeling-FCH6USID-DKkN-EFL.js +0 -1
  449. package/dist/client/assets/excalidraw-editor-mKBCIvNR.css +0 -1
  450. package/dist/client/assets/excalidraw-scene-i7oBzgH8.js +0 -176
  451. package/dist/client/assets/excalidrawEditor-DRxzpbJ-.js +0 -2
  452. package/dist/client/assets/exportDocument-BAqaHlIn.css +0 -1
  453. package/dist/client/assets/exportDocument-Dj7w1hDJ.js +0 -2
  454. package/dist/client/assets/fa-IR-26LZG4PM-BlqI3v_N.js +0 -9
  455. package/dist/client/assets/fi-FI-6YS4KDE4-af5Lkv-j.js +0 -6
  456. package/dist/client/assets/flowDiagram-I6XJVG4X-DgXXcK8y.js +0 -162
  457. package/dist/client/assets/fr-FR-BRLLPTZC-CwQyur9E.js +0 -12
  458. package/dist/client/assets/ganttDiagram-6RSMTGT7-BMpbo3vT.js +0 -292
  459. package/dist/client/assets/gitGraph-WXDBUCRP-BIQYiPEj.js +0 -1
  460. package/dist/client/assets/gitGraphDiagram-PVQCEYII-CCdpTNJZ.js +0 -106
  461. package/dist/client/assets/gl-ES-OKUZTLYG-BNEoLCI4.js +0 -6
  462. package/dist/client/assets/he-IL-26MGYIU7-WnVF9HP3.js +0 -8
  463. package/dist/client/assets/hi-IN-Q4ZOGTP2-DcU7ec07.js +0 -3
  464. package/dist/client/assets/hu-HU-P2OXPSN5-wmJyK1Wq.js +0 -3
  465. package/dist/client/assets/id-ID-2EIKXYN6-BTvn0aFf.js +0 -8
  466. package/dist/client/assets/image-KGGK4BDN-BtStV6c9.js +0 -1
  467. package/dist/client/assets/index-Cnyy977t.css +0 -1
  468. package/dist/client/assets/index-DxQmPZ_f.js +0 -2
  469. package/dist/client/assets/info-J43DQDTF-CO2Z2J7J.js +0 -1
  470. package/dist/client/assets/infoDiagram-5YYISTIA-oYw2qnNY.js +0 -2
  471. package/dist/client/assets/it-IT-4CFKVXI2-CC_iQxXu.js +0 -12
  472. package/dist/client/assets/ja-JP-MAND2Z4V-ConJI8GA.js +0 -7
  473. package/dist/client/assets/javascript-qUBHINSy.js +0 -1
  474. package/dist/client/assets/jsx-runtime-IB1e1gmy.js +0 -1
  475. package/dist/client/assets/kaa-HQRTCXTJ-Caqwh_Qr.js +0 -1
  476. package/dist/client/assets/kab-KAB-JKIKKTGH-DQBmYNc9.js +0 -4
  477. package/dist/client/assets/katex-Beiidjxi.js +0 -261
  478. package/dist/client/assets/kk-KZ-HXQ63ZFC-O5qp74q-.js +0 -1
  479. package/dist/client/assets/km-KH-PKL3LSGX-2wUYTyyo.js +0 -7
  480. package/dist/client/assets/ko-KR-KXLREZX3-CYtUnW5t.js +0 -5
  481. package/dist/client/assets/ku-TR-MJ4IER3X-DtEKOAU3.js +0 -6
  482. package/dist/client/assets/lt-LT-H6WFQ6FJ-Cs17Ppdf.js +0 -3
  483. package/dist/client/assets/lv-LV-GOCK6SJW-DYuTyosz.js +0 -4
  484. package/dist/client/assets/main-iuYcGt-A.js +0 -1414
  485. package/dist/client/assets/mermaid-parser.core-BD_OCbyj.js +0 -4
  486. package/dist/client/assets/mermaid-runtime-CEgpdpwB.js +0 -9
  487. package/dist/client/assets/mr-IN-IXVLDMEQ-CIJFnklt.js +0 -9
  488. package/dist/client/assets/my-MM-YG6MYTTD-em_7TGWX.js +0 -1
  489. package/dist/client/assets/navigation-Du6CLhvs.css +0 -1
  490. package/dist/client/assets/nb-NO-XGWJISD2-BLNgPVDj.js +0 -8
  491. package/dist/client/assets/nl-NL-XVDVCPNC-CComxzvg.js +0 -13
  492. package/dist/client/assets/nn-NO-EMX5MJX5-Cekj8s_-.js +0 -4
  493. package/dist/client/assets/oc-FR-ROEINTVO-DW-kHJ81.js +0 -4
  494. package/dist/client/assets/pa-IN-ZYN6SUDY-CnhULOGp.js +0 -4
  495. package/dist/client/assets/packet-YPE3B663-VxGcYggl.js +0 -1
  496. package/dist/client/assets/percentages-5DKR754L-Ug3UfchV.js +0 -1
  497. package/dist/client/assets/pica-DcQ1xKp1.js +0 -2
  498. package/dist/client/assets/pie-LRSECV5Y-7RrvmmEk.js +0 -1
  499. package/dist/client/assets/pieDiagram-4H26LBE5-C6MCExtR.js +0 -30
  500. package/dist/client/assets/pl-PL-6VTG7PHC-C9rBsz9v.js +0 -12
  501. package/dist/client/assets/preload-helper-Bo9GmnuQ.js +0 -1
  502. package/dist/client/assets/preview-diagram-utils-D94KrSQH.js +0 -1
  503. package/dist/client/assets/preview-render-compiler-CSggyCbw.js +0 -35
  504. package/dist/client/assets/preview-render-compiler-TPMesM_L.js +0 -1
  505. package/dist/client/assets/preview-render-profile-CQR0o67h.js +0 -23
  506. package/dist/client/assets/preview-render-worker-CifbXdlx.js +0 -59
  507. package/dist/client/assets/pt-BR-5YFKRR5G-BVyxOCjg.js +0 -6
  508. package/dist/client/assets/pt-PT-GEIXXZ67-5CbVaVay.js +0 -8
  509. package/dist/client/assets/python-BUyhM0Ew.js +0 -1
  510. package/dist/client/assets/radar-GUYGQ44K-2SBnfFng.js +0 -1
  511. package/dist/client/assets/ro-RO-E2P6TFZI-DANwkfep.js +0 -12
  512. package/dist/client/assets/ru-RU-YBIIY43T-BWZSxhA5.js +0 -10
  513. package/dist/client/assets/runtime-config-CM_2pVYD.js +0 -1
  514. package/dist/client/assets/scheme-C3elI80V.js +0 -1
  515. package/dist/client/assets/sequenceDiagram-3UESZ5HK-CCGL7FMW.js +0 -162
  516. package/dist/client/assets/si-LK-673C2CI2-Bqr808AJ.js +0 -1
  517. package/dist/client/assets/sk-SK-CKZHQ4AP-B2PvXXeU.js +0 -7
  518. package/dist/client/assets/sl-SI-557H2GWM-IPVDhzgb.js +0 -6
  519. package/dist/client/assets/src-BshjqEL2.js +0 -1
  520. package/dist/client/assets/stateDiagram-AJRCARHV-ljJcYRX4.js +0 -1
  521. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-DXm0ynOB.js +0 -1
  522. package/dist/client/assets/states-P2LsGDDn.css +0 -1
  523. package/dist/client/assets/subset-shared.chunk-C9mEHUfV.js +0 -1
  524. package/dist/client/assets/sv-SE-XOPKKDWS-CQipq9Nf.js +0 -8
  525. package/dist/client/assets/ta-IN-XBH7DQI3-Cj2o89vS.js +0 -6
  526. package/dist/client/assets/textile-C48beRus.js +0 -1
  527. package/dist/client/assets/th-TH-TOCWH3R4-IOX-l13w.js +0 -1
  528. package/dist/client/assets/timeline-definition-PNZ67QCA-CUVPem2o.js +0 -120
  529. package/dist/client/assets/tr-TR-GXW6CYY5-DBVLEsZg.js +0 -4
  530. package/dist/client/assets/treeView-BLDUP644-DItqHrxu.js +0 -1
  531. package/dist/client/assets/treemap-LRROVOQU-DD1ESKp7.js +0 -1
  532. package/dist/client/assets/turtle-BkP3ExOG.js +0 -1
  533. package/dist/client/assets/uk-UA-IJKTNUDG-C5kaymku.js +0 -6
  534. package/dist/client/assets/uz-UZ-TBZZEA4V-lMna4tx1.js +0 -1
  535. package/dist/client/assets/vault-api-client-D7Ck0CvR.css +0 -1
  536. package/dist/client/assets/vault-api-client-Fa51l2lE.js +0 -1
  537. package/dist/client/assets/vennDiagram-CIIHVFJN-Bb1KSPKA.js +0 -34
  538. package/dist/client/assets/vhdl-CnYyYTpa.js +0 -1
  539. package/dist/client/assets/vi-VN-MULSGNVB-BAcoCjsz.js +0 -7
  540. package/dist/client/assets/wardley-L42UT6IY-BoSI-SvR.js +0 -1
  541. package/dist/client/assets/xychartDiagram-2RQKCTM6-BoQFrGlt.js +0 -7
  542. package/dist/client/assets/zh-CN-MVX3E32U-sW-DCFHP.js +0 -11
  543. package/dist/client/assets/zh-HK-JNU5RLIE-Duqu8EG_.js +0 -1
  544. package/dist/client/assets/zh-TW-LENVCA6T-BHC0OLnd.js +0 -9
  545. /package/dist/client/assets/{array-7rJMcyYQ.js → array-BifhSqXX.js} +0 -0
  546. /package/dist/client/assets/{asciiarmor-DHW75j1s.js → asciiarmor-qTkVPQu6.js} +0 -0
  547. /package/dist/client/assets/{asn1-CQiG40kG.js → asn1-Dr8qZg38.js} +0 -0
  548. /package/dist/client/assets/{asterisk-BWExh0n4.js → asterisk-Bja0s6e1.js} +0 -0
  549. /package/dist/client/assets/{base-h1uscjTi.js → base-CxPEiHuy.js} +0 -0
  550. /package/dist/client/assets/{brainfuck-CTNFyOLg.js → brainfuck-D5EjA2JK.js} +0 -0
  551. /package/dist/client/assets/{clojure-D-DYVqu7.js → clojure-BflJGmDX.js} +0 -0
  552. /package/dist/client/assets/{cmake-DtGL-Unu.js → cmake-CyVbuzPu.js} +0 -0
  553. /package/dist/client/assets/{coffeescript-B7GZajzV.js → coffeescript-B2pKbFk8.js} +0 -0
  554. /package/dist/client/assets/{commonlisp-COlJYiQT.js → commonlisp-CcllspGY.js} +0 -0
  555. /package/dist/client/assets/{crystal-I_dE9xG-.js → crystal-M5-qzICs.js} +0 -0
  556. /package/dist/client/assets/{css-CmhPNxBE.js → css-CYpP4FRV.js} +0 -0
  557. /package/dist/client/assets/{cypher-DEGl2llJ.js → cypher-p9eYesGn.js} +0 -0
  558. /package/dist/client/assets/{d-BspB0dox.js → d-BhMjBjQP.js} +0 -0
  559. /package/dist/client/assets/{defaultLocale-DKHHE2Ij.js → defaultLocale-C8Fc0cco.js} +0 -0
  560. /package/dist/client/assets/{diff-BWuPUsEo.js → diff-ChtP43wD.js} +0 -0
  561. /package/dist/client/assets/{dtd-C6brJFPg.js → dtd-DTF72YNO.js} +0 -0
  562. /package/dist/client/assets/{dylan-Bft86ZSB.js → dylan-C6jEEEk-.js} +0 -0
  563. /package/dist/client/assets/{ebnf-D6ifG44A.js → ebnf-D4c0_ac3.js} +0 -0
  564. /package/dist/client/assets/{ecl-D9rhJ9-u.js → ecl-BSZaIHnp.js} +0 -0
  565. /package/dist/client/assets/{eiffel-DwxtewZF.js → eiffel-BEjRio4Q.js} +0 -0
  566. /package/dist/client/assets/{elm-B1TncobV.js → elm-Cshzl8qu.js} +0 -0
  567. /package/dist/client/assets/{erlang-BDJZNtt8.js → erlang-DaB2Rkuy.js} +0 -0
  568. /package/dist/client/assets/{excalidraw-mermaid-stub-Co4Okjfg.js → excalidraw-mermaid-stub-BNckbX2n.js} +0 -0
  569. /package/dist/client/assets/{fcl-CUXJFJn1.js → fcl-ClOhbFR7.js} +0 -0
  570. /package/dist/client/assets/{file-kind-DLz-bCzA.js → file-kind-BKPOIRPE.js} +0 -0
  571. /package/dist/client/assets/{forth-nvhcMz63.js → forth-Cezjo90N.js} +0 -0
  572. /package/dist/client/assets/{fortran-BZID-z10.js → fortran-Bt6PBEDR.js} +0 -0
  573. /package/dist/client/assets/{gas-DjQsZDGE.js → gas-BHEdbvp9.js} +0 -0
  574. /package/dist/client/assets/{gherkin-S0kHlzux.js → gherkin-oBAE_ms0.js} +0 -0
  575. /package/dist/client/assets/{groovy-Di--Vb9Z.js → groovy-BC3IOsC8.js} +0 -0
  576. /package/dist/client/assets/{haskell-C6qH3-aI.js → haskell-BRsoo5mP.js} +0 -0
  577. /package/dist/client/assets/{http-DG1Y9fpK.js → http-CLVgA2GD.js} +0 -0
  578. /package/dist/client/assets/{idl-B64p3NTJ.js → idl-BUZw3wgd.js} +0 -0
  579. /package/dist/client/assets/{init-EmgYNkpL.js → init-D6jRqBbL.js} +0 -0
  580. /package/dist/client/assets/{julia-B22G9Bym.js → julia-CQfgDRfP.js} +0 -0
  581. /package/dist/client/assets/{livescript-CkcuHqeS.js → livescript-BXxG0Yva.js} +0 -0
  582. /package/dist/client/assets/{lua-Cg0FqIlO.js → lua-CL1SqxuB.js} +0 -0
  583. /package/dist/client/assets/{mathematica-CKVhKnoY.js → mathematica-u8YMmbU0.js} +0 -0
  584. /package/dist/client/assets/{mbox-DANyzFJ2.js → mbox-BEMVcqjs.js} +0 -0
  585. /package/dist/client/assets/{mirc-BVG2S5rO.js → mirc-C9zpzAZU.js} +0 -0
  586. /package/dist/client/assets/{mllike-C0p7lv48.js → mllike-B45xgp2S.js} +0 -0
  587. /package/dist/client/assets/{modelica-vJ-Qa9jV.js → modelica-CqHI_q-D.js} +0 -0
  588. /package/dist/client/assets/{mscgen-vUD-SWGJ.js → mscgen-qgSLujhx.js} +0 -0
  589. /package/dist/client/assets/{mumps-D0KfUTSd.js → mumps-CW_TBmxz.js} +0 -0
  590. /package/dist/client/assets/{nginx-DkVceJrH.js → nginx-BMaDbqW3.js} +0 -0
  591. /package/dist/client/assets/{ntriples-BBuCIfS0.js → ntriples-d28e9m0E.js} +0 -0
  592. /package/dist/client/assets/{octave-BTv2CqSQ.js → octave-D2Q8cUp1.js} +0 -0
  593. /package/dist/client/assets/{oz-D8SjVDNU.js → oz-BwTct_5T.js} +0 -0
  594. /package/dist/client/assets/{pascal-T-tfhVyx.js → pascal-Dp_KdFgX.js} +0 -0
  595. /package/dist/client/assets/{path-vqW-z8T-.js → path-BWPyau1x.js} +0 -0
  596. /package/dist/client/assets/{perl-BDrCkHRd.js → perl-CdEHsPfU.js} +0 -0
  597. /package/dist/client/assets/{pig-BEyI4fPq.js → pig-AF4Hwhju.js} +0 -0
  598. /package/dist/client/assets/{powershell-DtnFc6GG.js → powershell-CzG71I4L.js} +0 -0
  599. /package/dist/client/assets/{properties-DWUvbxV9.js → properties-C357ku5U.js} +0 -0
  600. /package/dist/client/assets/{protobuf-CQGoYyfE.js → protobuf-D1ij_kNL.js} +0 -0
  601. /package/dist/client/assets/{puppet-Dd-qWO3p.js → puppet-B4hC2X4m.js} +0 -0
  602. /package/dist/client/assets/{q-Dls1OX0D.js → q-B9NhS7L_.js} +0 -0
  603. /package/dist/client/assets/{r-DeZ8Mdev.js → r-DADKenSm.js} +0 -0
  604. /package/dist/client/assets/{chunk-tBc3Ke6Z.js → rolldown-runtime-aKtaBQYM.js} +0 -0
  605. /package/dist/client/assets/{rough.esm-DE_lJ5Ge.js → rough.esm-CSKSodPl.js} +0 -0
  606. /package/dist/client/assets/{roundRect-BMsJLtvm.js → roundRect-D01gJrlt.js} +0 -0
  607. /package/dist/client/assets/{rpm-CjWxLM68.js → rpm-gpDK5sbt.js} +0 -0
  608. /package/dist/client/assets/{ruby-CB34f2Gf.js → ruby-DsYpTuWg.js} +0 -0
  609. /package/dist/client/assets/{runtime-config-loader-_D2KZKn-.js → runtime-config-loader-BUK56BZz.js} +0 -0
  610. /package/dist/client/assets/{sas-Bji4HDQq.js → sas-C2OyD2Y6.js} +0 -0
  611. /package/dist/client/assets/{shell-DUveK2Hb.js → shell-Du5Qg9im.js} +0 -0
  612. /package/dist/client/assets/{sieve-2ogwMVx4.js → sieve-BAxa3IjF.js} +0 -0
  613. /package/dist/client/assets/{simple-mode-pOKc0mfx.js → simple-mode-DRpGK0lJ.js} +0 -0
  614. /package/dist/client/assets/{smalltalk-BuGhc6lW.js → smalltalk-BLp5-jwC.js} +0 -0
  615. /package/dist/client/assets/{solr-DTxshpm8.js → solr-BBopId9w.js} +0 -0
  616. /package/dist/client/assets/{sparql-vm8qNO8J.js → sparql-Dz-mlCAC.js} +0 -0
  617. /package/dist/client/assets/{spreadsheet-C6Vbtl9-.js → spreadsheet-CTIncYxj.js} +0 -0
  618. /package/dist/client/assets/{sql-GL7dVWcd.js → sql-DcCJ9jop.js} +0 -0
  619. /package/dist/client/assets/{stex-CEwW0Q_0.js → stex-sDrdk2BW.js} +0 -0
  620. /package/dist/client/assets/{stylus-D1SZIMDs.js → stylus-DLLZ8dgm.js} +0 -0
  621. /package/dist/client/assets/{swift-CKcKnWv9.js → swift-DKB6_1j6.js} +0 -0
  622. /package/dist/client/assets/{tcl-SPk7uiDB.js → tcl-BGfruO1u.js} +0 -0
  623. /package/dist/client/assets/{tiddlywiki-CiImjFLN.js → tiddlywiki-VlUiK86J.js} +0 -0
  624. /package/dist/client/assets/{tiki-HkXZ4BIW.js → tiki-CxVlf5KZ.js} +0 -0
  625. /package/dist/client/assets/{toml-BmfpMy1_.js → toml-LvoKBwCs.js} +0 -0
  626. /package/dist/client/assets/{troff-BjbEOT5E.js → troff-C2dAgh7P.js} +0 -0
  627. /package/dist/client/assets/{ttcn-NA-V4KnY.js → ttcn-BePYh-hG.js} +0 -0
  628. /package/dist/client/assets/{ttcn-cfg-TPHncdGN.js → ttcn-cfg-CY0aot7Q.js} +0 -0
  629. /package/dist/client/assets/{vb-C19AQWqO.js → vb-BthdM_4N.js} +0 -0
  630. /package/dist/client/assets/{vbscript-CHJk3s95.js → vbscript-D9f6rSsU.js} +0 -0
  631. /package/dist/client/assets/{velocity-Ya0P4sQU.js → velocity-CqftRsjg.js} +0 -0
  632. /package/dist/client/assets/{webidl-DttrYZRT.js → webidl-D5jiJvOU.js} +0 -0
  633. /package/dist/client/assets/{yacas-C7dxlPB0.js → yacas-CXXgtw0p.js} +0 -0
  634. /package/dist/client/assets/{z80-BqEfFSnA.js → z80-CL1naaMV.js} +0 -0
@@ -0,0 +1,150 @@
1
+ import{n as e}from"./vault-utils-kIbqyWPm.js";import{t}from"./button-2ZnWQkWV.js";function n(e){return String(e??``).split(`/`).pop()||``}function r(e){let t=String(e??``).split(`/`);return t.pop(),t.join(`/`)}function i(e){return`diff-section-${encodeURIComponent(String(e??``)).replace(/%/g,`_`)}`}function a(e){switch(e){case`added`:case`untracked`:return`ui-status-badge--success`;case`deleted`:return`ui-status-badge--danger`;case`renamed`:return`ui-status-badge--accent`;default:return`ui-status-badge--warning`}}function o(e=!1){return`<svg class="diff-section-chevron${e?` collapsed`:``}" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" aria-hidden="true"><polyline points="6 9 12 15 18 9"/></svg>`}function s(e,t){let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n+=1;return n}function c(e,t,n){let r=0,i=Math.min(e.length,t.length)-n;for(;r<i;){let n=e.length-1-r,i=t.length-1-r;if(e[n]!==t[i])break;r+=1}return r}function l(t,n){let r=s(t,n),i=c(t,n,r),a=Math.max(r,t.length-i),o=Math.max(r,n.length-i);return{leftHtml:`${e(t.slice(0,r))}${a>r?`<span class="diff-highlight-del">${e(t.slice(r,a))}</span>`:``}${e(t.slice(a))}`,rightHtml:`${e(n.slice(0,r))}${o>r?`<span class="diff-highlight-add">${e(n.slice(r,o))}</span>`:``}${e(n.slice(o))}`}}function u(e=[]){let t=[];for(let n=0;n<e.length;n+=1){let r=e[n];if(r.type===`context`||r.type===`note`){t.push({additions:[],context:[r],deletions:[]});continue}if(r.type!==`deletion`&&r.type!==`addition`)continue;let i=[],a=[];for(;n<e.length&&e[n].type===`deletion`;)i.push(e[n]),n+=1;for(;n<e.length&&e[n].type===`addition`;)a.push(e[n]),n+=1;--n,t.push({additions:a,context:[],deletions:i})}return t}function d(t,n,r){let i=Number.isInteger(t.oldLine)?t.oldLine:``,a=Number.isInteger(t.newLine)?t.newLine:``;return`
2
+ <div class="diff-line ${t.type===`note`?`note`:t.type}">
3
+ <div class="diff-line-numbers">
4
+ <span class="diff-line-num">${i}</span>
5
+ <span class="diff-line-num">${a}</span>
6
+ </div>
7
+ <div class="diff-line-prefix">${e(t.type===`context`||t.type===`note`?` `:n)}</div>
8
+ <div class="diff-line-content">${r}</div>
9
+ </div>
10
+ `}function f(t,n){let r=t?e(t.content):``,i=n?e(n.content):``;if(t&&n&&t.type===`deletion`&&n.type===`addition`){let e=l(t.content,n.content);r=e.leftHtml,i=e.rightHtml}return`
11
+ <div class="diff-split-row">
12
+ <div class="diff-split-line ${t?.type||`empty`}">
13
+ <span class="diff-split-num">${Number.isInteger(t?.oldLine)?t.oldLine:``}</span>
14
+ <span class="diff-split-content">${r}</span>
15
+ </div>
16
+ <div class="diff-split-line ${n?.type||`empty`}">
17
+ <span class="diff-split-num">${Number.isInteger(n?.newLine)?n.newLine:``}</span>
18
+ <span class="diff-split-content">${i}</span>
19
+ </div>
20
+ </div>
21
+ `}var p=class{constructor({gitApiClient:e=null,onBackToHistory:t=null,onCommitStaged:n=null,onOpenFile:r=null,onStageFile:i=null,onUnstageFile:a=null,toastController:o=null}={}){this.gitApiClient=e,this.onBackToHistory=t,this.onCommitStaged=n,this.onOpenFile=r,this.onStageFile=i,this.onUnstageFile=a,this.toastController=o,this.page=document.getElementById(`diff-page`),this.content=document.getElementById(`diffContent`),this.scrollContainer=document.getElementById(`diffScroll`),this.fileIndicator=document.getElementById(`diffFileIndicator`),this.openEditorButton=document.getElementById(`diffOpenEditorBtn`),this.primaryActionButton=document.getElementById(`diffPrimaryActionBtn`),this.commitButton=document.getElementById(`diffCommitBtn`),this.backToHistoryButton=document.getElementById(`diffBackToHistoryBtn`),this.gitActionsGroup=document.getElementById(`diffGitActionsGroup`),this.editorActionsGroup=document.getElementById(`diffEditorActionsGroup`),this.actionsDivider=document.getElementById(`diffToolbarDivider`),this.stats=document.getElementById(`diffStats`),this.prevButton=document.getElementById(`diffPrevBtn`),this.nextButton=document.getElementById(`diffNextBtn`),this.layoutToggle=document.getElementById(`diffLayoutToggle`),this.modeButtons=Array.from(document.querySelectorAll(`[data-diff-mode]`)),this.layoutButtons=Array.from(document.querySelectorAll(`[data-diff-layout]`)),this.isActive=!1,this.mode=`unified`,this.layoutMode=`focused`,this.source=`workspace`,this.data=null,this.currentIndex=0,this.activeFilePath=null,this.fileCache=new Map,this.fileErrors=new Map,this.loadingFiles=new Set,this.collapsedFiles=new Set,this.fileLoadPromises=new Map,this.requestScope=`all`,this.commitHash=null,this.commitMeta=null,this.historyFilePath=null,this.pendingAction=null,this.repoStatus=null}initialize(){this.prevButton?.addEventListener(`click`,()=>{this.isActive&&this.navigateFile(-1)}),this.nextButton?.addEventListener(`click`,()=>{this.isActive&&this.navigateFile(1)}),this.backToHistoryButton?.addEventListener(`click`,()=>{this.isActive&&this.commitMeta?.hash&&this.onBackToHistory?.({hash:this.commitMeta.hash,historyFilePath:this.historyFilePath})}),this.openEditorButton?.addEventListener(`click`,()=>{if(!this.isActive||this.source!==`workspace`)return;let e=this.getCurrentFile();e?.path&&this.onOpenFile?.(e.path)}),this.primaryActionButton?.addEventListener(`click`,()=>{if(!this.isActive)return;let e=this.getPrimaryAction();e&&this.handleFileAction(e)}),this.commitButton?.addEventListener(`click`,()=>{this.isActive&&this.handleFileAction(`commit`)}),this.content?.addEventListener(`click`,e=>{if(!this.isActive)return;let t=e.target instanceof Element?e.target.closest(`[data-load-full-diff]`):null;if(t){let e=t.getAttribute(`data-diff-file-path`)||this.activeFilePath;e&&this.loadFileForPath(e,{forceFullPatch:!0});return}let n=e.target instanceof Element?e.target.closest(`[data-diff-section-toggle]`):null;if(n){let e=n.getAttribute(`data-diff-section-toggle`);e&&this.toggleFileSection(e);return}let r=e.target instanceof Element?e.target.closest(`[data-diff-index-path]`):null;if(r){let e=r.getAttribute(`data-diff-index-path`);e&&this.handleIndexSelection(e)}}),this.modeButtons.forEach(e=>{e.addEventListener(`click`,()=>{if(!this.isActive)return;let t=e.getAttribute(`data-diff-mode`);!t||t===this.mode||(this.mode=t,this.render())})}),this.layoutButtons.forEach(e=>{e.addEventListener(`click`,()=>{if(!this.isActive)return;let t=e.getAttribute(`data-diff-layout`);!t||t===this.layoutMode||this.setLayoutMode(t)})}),this.scrollContainer?.addEventListener(`scroll`,()=>{this.isActive&&this.handleScrollSelection()})}hide(){this.isActive=!1,this.page?.classList.add(`hidden`),this.content&&(this.content.innerHTML=``),this.data=null,this.source=`workspace`,this.layoutMode=`focused`,this.currentIndex=0,this.activeFilePath=null,this.fileCache.clear(),this.fileErrors.clear(),this.loadingFiles.clear(),this.collapsedFiles.clear(),this.fileLoadPromises.clear(),this.requestScope=`all`,this.commitHash=null,this.commitMeta=null,this.historyFilePath=null,this.pendingAction=null,this.repoStatus=null}async openWorkspaceDiff({filePath:e=null,scope:t=`all`}={}){this.isActive=!0,this.source=`workspace`,this.layoutMode=`focused`,this.commitHash=null,this.commitMeta=null,this.historyFilePath=null,this.activeFilePath=e,this.fileCache.clear(),this.fileErrors.clear(),this.loadingFiles.clear(),this.collapsedFiles.clear(),this.fileLoadPromises.clear(),this.requestScope=t,this.renderLoading(`Loading diff summary...`);try{let n=await this.gitApiClient.readDiff({metaOnly:!0,path:e,scope:t});this.data=n;let r=e?Math.max(0,n.files.findIndex(t=>t.path===e)):0;return this.currentIndex=r,this.activeFilePath=n.files?.[r]?.path??null,(n.files?.length??0)===0?(this.render(),n):(await this.loadCurrentFile(),n)}catch(e){return console.error(`[git-diff] Failed to load diff:`,e),this.toastController?.show(`Failed to load git diff`),this.data={files:[],metaOnly:!1,source:`workspace`,summary:{additions:0,deletions:0,filesChanged:0}},this.renderEmpty(`Failed to load git diff`),this.data}}async openCommitDiff({hash:e,path:t=null,historyFilePath:n=null}={}){this.isActive=!0,this.source=`commit`,this.layoutMode=`stacked`,this.commitHash=String(e??``).trim()||null,this.commitMeta=null,this.historyFilePath=String(n??``).trim()||null,this.activeFilePath=t||null,this.fileCache.clear(),this.fileErrors.clear(),this.loadingFiles.clear(),this.collapsedFiles.clear(),this.fileLoadPromises.clear(),this.requestScope=`all`,this.renderLoading(`Loading commit summary...`);try{let e=await this.gitApiClient.readCommit({hash:this.commitHash||``,metaOnly:!0});this.data=e,this.commitMeta=e.commit??null;let n=t?Math.max(0,e.files.findIndex(e=>e.path===t)):0;return this.currentIndex=n,this.activeFilePath=e.files?.[n]?.path??null,this.collapsedFiles=new Set((e.files??[]).map(e=>e.path).filter(e=>e&&e!==this.activeFilePath)),(e.files?.length??0)===0?(this.render(),e):(this.activeFilePath&&await this.loadFileForPath(this.activeFilePath,{render:!1}),this.render(),e)}catch(e){return console.error(`[git-diff] Failed to load commit:`,e),this.toastController?.show(`Failed to load git commit`),this.data={commit:null,files:[],metaOnly:!1,source:`commit`,summary:{additions:0,deletions:0,filesChanged:0}},this.commitMeta=null,this.renderEmpty(`Failed to load git commit`),this.data}}async open(e={}){return this.openWorkspaceDiff(e)}async setLayoutMode(e){let t=e===`stacked`?`stacked`:`focused`;if(this.source!==`commit`){this.layoutMode=`focused`,this.render();return}if(this.layoutMode=t,this.activeFilePath&&this.setActiveFilePath(this.activeFilePath),this.layoutMode===`focused`){await this.loadCurrentFile();return}this.activeFilePath&&(this.collapsedFiles.delete(this.activeFilePath),await this.loadFileForPath(this.activeFilePath,{render:!1})),this.render()}navigateFile(e){if(!this.data?.files?.length||this.source===`commit`&&this.layoutMode===`stacked`)return;let t=Math.max(0,Math.min(this.currentIndex+e,this.data.files.length-1));t!==this.currentIndex&&(this.currentIndex=t,this.activeFilePath=this.data.files[t]?.path??null,this.scrollContainer?.scrollTo({top:0,behavior:`auto`}),this.loadCurrentFile())}renderLoading(t=`Loading git diff...`){this.isActive&&(this.page?.classList.remove(`hidden`),this.content&&(this.content.innerHTML=`<div class="diff-empty-state">${e(t)}</div>`),this.data=null,this.syncToolbar())}renderEmpty(t){this.isActive&&(this.page?.classList.remove(`hidden`),this.content&&(this.content.innerHTML=`<div class="diff-empty-state">${e(t)}</div>`),this.syncToolbar())}renderUnifiedHunk(t){let n=[];for(let r of u(t.lines)){if(r.context.length>0){for(let t of r.context)n.push(d(t,` `,e(t.content)));continue}let t=Math.max(r.deletions.length,r.additions.length);for(let i=0;i<t;i+=1){let t=r.deletions[i]??null,a=r.additions[i]??null,o=t&&a?l(t.content,a.content):null;t&&n.push(d(t,`-`,o?.leftHtml??e(t.content))),a&&n.push(d(a,`+`,o?.rightHtml??e(a.content)))}}return`
22
+ <div class="diff-hunk-header">${e(t.header)}</div>
23
+ ${n.join(``)}
24
+ `}renderFileHeader(t){return`
25
+ <div class="diff-file-header">
26
+ <span class="diff-file-path">${e(t.path)}</span>
27
+ <span class="ui-status-badge ${a(t.status)}">${e(t.status)}</span>
28
+ <span class="diff-file-header-stats"><span class="ui-stat-token ui-stat-token--add diff-stats-add">+${t.stats?.additions??0}</span><span class="ui-stat-token ui-stat-token--del diff-stats-del">-${t.stats?.deletions??0}</span></span>
29
+ </div>
30
+ `}renderUnifiedFileBody(t){return`
31
+ ${t.isBinary?`<div class="diff-binary-message">${e(t.binaryMessage||`Binary file changed`)}</div>`:``}
32
+ ${t.hunks.map(e=>this.renderUnifiedHunk(e)).join(``)}
33
+ `}renderSplitFileBody(t){return`
34
+ <div class="diff-split">
35
+ <div class="diff-split-pane">
36
+ <div class="diff-split-pane-header">Before</div>
37
+ ${t.hunks.map(t=>{let n=[];for(let e of u(t.lines)){if(e.context.length>0){for(let t of e.context)n.push(f(t,t));continue}let t=Math.max(e.deletions.length,e.additions.length);for(let r=0;r<t;r+=1)n.push(f(e.deletions[r]??null,e.additions[r]??null))}return`
38
+ <div class="diff-split-hunk">${e(t.header)}</div>
39
+ ${n.join(``)}
40
+ `}).join(``)}
41
+ </div>
42
+ </div>
43
+ `}renderDiffDetail(n,r,{includeHeader:i=!0}={}){if(!n)return`<div class="diff-empty-state">Select a file to load its diff.</div>`;if(n.tooLarge)return`
44
+ ${i?this.renderFileHeader(n):``}
45
+ <div class="diff-limit-card">
46
+ <strong>Large diff withheld</strong>
47
+ <span>This file diff is large enough to impact rendering performance.</span>
48
+ <button class="${t({variant:`secondary`,extra:`diff-load-full-btn`})}" type="button" data-load-full-diff data-diff-file-path="${e(n.path)}">Load full diff</button>
49
+ </div>
50
+ `;let a=this.mode===`split`?this.renderSplitFileBody(n,r):this.renderUnifiedFileBody(n,r);return`${i?this.renderFileHeader(n):``}${a}`}renderFocusedFileBody(){let t=this.getCurrentFile();if(!t)return`<div class="diff-empty-state">No changes to display.</div>`;if(this.isFileLoading(t.path))return`
51
+ <section class="diff-file-block">
52
+ ${this.renderFileHeader(t)}
53
+ <div class="diff-empty-state">Loading file diff...</div>
54
+ </section>
55
+ `;let n=this.fileErrors.get(t.path);return n?`
56
+ <section class="diff-file-block">
57
+ ${this.renderFileHeader(t)}
58
+ <div class="diff-empty-state">${e(n)}</div>
59
+ </section>
60
+ `:`
61
+ <section class="diff-file-block" data-diff-file-index="${this.currentIndex}">
62
+ ${this.renderDiffDetail(this.getFileDetail(t.path)??t,this.currentIndex)}
63
+ </section>
64
+ `}renderCommitHeader(){return this.source!==`commit`||!this.commitMeta?``:`
65
+ <section class="diff-commit-header">
66
+ <div class="diff-commit-subject">${e(this.commitMeta.subject||this.commitMeta.shortHash||`Commit`)}</div>
67
+ <div class="diff-commit-meta">
68
+ <span>${e(this.commitMeta.shortHash||``)}</span>
69
+ <span>${e(this.commitMeta.authorName||`Unknown`)}</span>
70
+ <span title="${e(this.commitMeta.authoredAt||``)}">${e(this.commitMeta.relativeDateLabel||``)}</span>
71
+ ${this.commitMeta.isMergeCommit?`<span>Merge commit</span>`:``}
72
+ </div>
73
+ <div class="diff-commit-meta diff-commit-meta-secondary">
74
+ <span>${e(this.commitMeta.hash||``)}</span>
75
+ <span>${Number(this.data?.summary?.filesChanged||0)} file${Number(this.data?.summary?.filesChanged||0)===1?``:`s`}</span>
76
+ </div>
77
+ </section>
78
+ `}renderCommitIndex(){return`
79
+ <aside class="diff-commit-index" aria-label="Changed files in commit">
80
+ <div class="diff-commit-index-header">Changed Files</div>
81
+ <div class="diff-commit-index-list">
82
+ ${(this.data?.files??[]).map((t,i)=>{let o=this.activeFilePath===t.path,s=r(t.path);return`
83
+ <button
84
+ class="ui-record-surface diff-index-item${o?` active`:``}"
85
+ type="button"
86
+ data-diff-index-path="${e(t.path)}"
87
+ aria-current="${o?`true`:`false`}"
88
+ >
89
+ <span class="ui-record-header diff-index-item-top">
90
+ <span class="ui-record-title diff-index-item-name">${e(n(t.path))}</span>
91
+ <span class="ui-status-badge ${a(t.status)}">${e(t.status)}</span>
92
+ </span>
93
+ ${s?`<span class="ui-record-subtitle diff-index-item-path">${e(s)}</span>`:``}
94
+ <span class="ui-record-meta diff-index-item-meta">
95
+ <span>${i+1}</span>
96
+ <span class="ui-stat-token ui-stat-token--add diff-stats-add">+${t.stats?.additions??0}</span>
97
+ <span class="ui-stat-token ui-stat-token--del diff-stats-del">-${t.stats?.deletions??0}</span>
98
+ </span>
99
+ </button>
100
+ `}).join(``)}
101
+ </div>
102
+ </aside>
103
+ `}renderStackedSection(t,s){let c=this.isFileCollapsed(t.path),l=this.activeFilePath===t.path,u=this.isFileLoading(t.path),d=this.fileErrors.get(t.path),f=this.getFileDetail(t.path)??t,p=c?``:u?`<div class="diff-empty-state">Loading file diff...</div>`:d?`<div class="diff-empty-state">${e(d)}</div>`:this.renderDiffDetail(f,s,{includeHeader:!1});return`
104
+ <section
105
+ class="diff-commit-section${l?` active`:``}${c?` collapsed`:``}"
106
+ id="${i(t.path)}"
107
+ data-diff-section-path="${e(t.path)}"
108
+ >
109
+ <button
110
+ class="diff-commit-section-header"
111
+ type="button"
112
+ data-diff-section-toggle="${e(t.path)}"
113
+ >
114
+ <span class="diff-commit-section-main">
115
+ ${o(c)}
116
+ <span class="diff-commit-section-copy">
117
+ <span class="diff-commit-section-name">${e(n(t.path))}</span>
118
+ ${r(t.path)?`<span class="diff-commit-section-path">${e(r(t.path))}</span>`:``}
119
+ </span>
120
+ </span>
121
+ <span class="diff-commit-section-meta">
122
+ <span class="ui-status-badge ${a(t.status)}">${e(t.status)}</span>
123
+ <span class="ui-stat-token ui-stat-token--add diff-stats-add">+${t.stats?.additions??0}</span>
124
+ <span class="ui-stat-token ui-stat-token--del diff-stats-del">-${t.stats?.deletions??0}</span>
125
+ </span>
126
+ </button>
127
+ <div class="diff-commit-section-body${c?` hidden`:``}">
128
+ ${p}
129
+ </div>
130
+ </section>
131
+ `}renderCommitBody(){return this.layoutMode===`focused`?`
132
+ <div class="diff-commit-shell diff-commit-shell-focused">
133
+ ${this.renderCommitIndex()}
134
+ <div class="diff-commit-main">
135
+ ${this.renderFocusedFileBody()}
136
+ </div>
137
+ </div>
138
+ `:`
139
+ <div class="diff-commit-shell diff-commit-shell-stacked">
140
+ ${this.renderCommitIndex()}
141
+ <div class="diff-commit-main">
142
+ <div class="diff-commit-sections">
143
+ ${(this.data?.files??[]).map((e,t)=>this.renderStackedSection(e,t)).join(``)}
144
+ </div>
145
+ </div>
146
+ </div>
147
+ `}getCurrentFile(){let e=this.data?.files??[];return e.length===0?null:e[this.currentIndex]??e[0]??null}getFileByPath(e){return(this.data?.files??[]).find(t=>t.path===e)??null}setActiveFilePath(e,{syncIndex:t=!0}={}){if(this.activeFilePath=e,!t)return;let n=Math.max(0,(this.data?.files??[]).findIndex(t=>t.path===e));n>=0&&(this.currentIndex=n)}getCacheKeyForPath(e){return e?this.source===`commit`?`commit:${this.commitHash}:${e}`:`workspace:${this.requestScope}:${e}`:null}getCurrentCacheKey(){return this.getCacheKeyForPath(this.getCurrentFile()?.path??null)}getCurrentFileDetail(){let e=this.getCurrentCacheKey();return e?this.fileCache.get(e):null}getFileDetail(e){let t=this.getCacheKeyForPath(e);return t?this.fileCache.get(t):null}isFileCollapsed(e){return this.collapsedFiles.has(e)}isFileLoading(e){return this.loadingFiles.has(e)}getCurrentActionState(){if(this.source===`commit`)return{canCommit:!1,canStage:!1,canUnstage:!1};let e=this.getCurrentFile(),t=this.getCurrentFileDetail()??e,n=Number(this.repoStatus?.summary?.staged||0);return t?.path?{canCommit:n>0,canStage:!!(t.hasWorkingTreeChanges||t.hasUntrackedChanges),canUnstage:!!t.hasStagedChanges}:{canCommit:n>0,canStage:!1,canUnstage:!1}}getPrimaryAction(){if(this.source===`commit`)return null;let e=this.getCurrentActionState();return e.canStage&&!e.canUnstage?`stage`:e.canUnstage&&!e.canStage||this.requestScope===`staged`&&e.canUnstage?`unstage`:e.canStage?`stage`:e.canUnstage?`unstage`:null}async handleFileAction(e){if(this.source===`commit`)return;let t=this.getCurrentFile();if(!(!t?.path||this.pendingAction)){this.pendingAction=e,this.syncToolbar();try{e===`stage`?await this.onStageFile?.(t.path,{scope:this.requestScope}):e===`unstage`?await this.onUnstageFile?.(t.path,{scope:this.requestScope}):e===`commit`&&await this.onCommitStaged?.()}finally{this.pendingAction=null,this.syncToolbar()}}}setRepoStatus(e){this.repoStatus=e,this.syncToolbar()}async handleIndexSelection(e){if(this.getFileByPath(e)){if(this.setActiveFilePath(e),this.source===`commit`&&this.layoutMode===`stacked`){this.collapsedFiles.delete(e),await this.loadFileForPath(e,{render:!1}),this.render(),this.scrollToFileSection(e);return}await this.loadFileForPath(e)}}async toggleFileSection(e){if(!(this.source!==`commit`||this.layoutMode!==`stacked`)){if(this.setActiveFilePath(e),this.collapsedFiles.has(e)){this.collapsedFiles.delete(e),await this.loadFileForPath(e,{render:!1}),this.render(),this.scrollToFileSection(e);return}this.collapsedFiles.add(e),this.render()}}scrollToFileSection(e){if(!this.content)return;let t=i(e),n=()=>{let e=document.getElementById?.(t)??null;if(e){if(this.scrollContainer?.scrollTo&&this.scrollContainer.getBoundingClientRect&&e.getBoundingClientRect){let t=this.scrollContainer.getBoundingClientRect(),n=e.getBoundingClientRect(),r=Number(this.scrollContainer.scrollTop)||0,i=Math.max(0,r+(n.top-t.top)-8);this.scrollContainer.scrollTo({top:i,behavior:`smooth`});return}e.scrollIntoView?.({behavior:`smooth`,block:`start`})}};if(typeof requestAnimationFrame==`function`){requestAnimationFrame(n);return}setTimeout(n,0)}handleScrollSelection(){if(this.source!==`commit`||this.layoutMode!==`stacked`||!this.scrollContainer||!this.content)return;let e=Array.from(this.content.querySelectorAll?.(`[data-diff-section-path]`)??[]);if(e.length===0)return;let t=this.scrollContainer.getBoundingClientRect?.();if(!t)return;let n=t.top+120,r=null;for(let t of e){let e=t.getBoundingClientRect?.();if(!e)continue;let i=t.getAttribute?.(`data-diff-section-path`);if(i)if(e.top<=n)r=i;else if(r)break;else{r=i;break}}r&&r!==this.activeFilePath&&(this.setActiveFilePath(r),this.render())}async loadCurrentFile({forceFullPatch:e=!1}={}){let t=this.getCurrentFile();return t?.path?this.loadFileForPath(t.path,{forceFullPatch:e}):(this.render(),null)}async loadFileForPath(e,{forceFullPatch:t=!1,render:n=!0}={}){let r=this.getFileByPath(e);if(!r?.path)return n&&this.render(),null;this.setActiveFilePath(e);let i=this.getCacheKeyForPath(e),a=i?this.fileCache.get(i):null;if(a&&(!a.tooLarge||!t))return n&&this.render(),a;let o=`${e}:${t?`full`:`partial`}`;if(this.fileLoadPromises.has(o))return this.fileLoadPromises.get(o);this.loadingFiles.add(e),this.fileErrors.delete(e),n&&this.render();let s=(async()=>{try{let n;if(this.source===`commit`){let i=await this.gitApiClient.readCommit({allowLargePatch:t,hash:this.commitHash||``,path:e});n={...r,...i.files?.[0]??{}}}else{let i=await this.gitApiClient.readDiff({allowLargePatch:t,path:e,scope:this.requestScope});n={...r,...i.files?.[0]??{}}}return i&&this.fileCache.set(i,n),this.fileErrors.delete(e),n}catch(t){console.error(`[git-diff] Failed to load file diff:`,t);let n=this.source===`commit`?`Failed to load commit file diff`:`Failed to load file diff`;return this.fileErrors.set(e,n),this.toastController?.show(n),null}finally{this.loadingFiles.delete(e),this.fileLoadPromises.delete(o),this.render()}})();return this.fileLoadPromises.set(o,s),s}syncToolbar(){let e=this.data?.files?.length??0,t=e===0?0:this.currentIndex+1,n=this.source===`commit`,r=n&&this.layoutMode===`stacked`;if(this.fileIndicator&&(r?this.fileIndicator.textContent=`${e} file${e===1?``:`s`}`:this.fileIndicator.textContent=e>0?`${t} / ${e} files`:`0 / 0 files`),this.stats){let e=this.data?.summary?.additions??0,t=this.data?.summary?.deletions??0;this.stats.innerHTML=`
148
+ <span class="ui-stat-token ui-stat-token--add diff-stats-add">+${e}</span>
149
+ <span class="ui-stat-token ui-stat-token--del diff-stats-del">-${t}</span>
150
+ `}this.modeButtons.forEach(e=>{e.classList.remove(`hidden`),e.classList.toggle(`active`,e.getAttribute(`data-diff-mode`)===this.mode)}),this.layoutButtons.forEach(e=>{e.classList.toggle(`active`,e.getAttribute(`data-diff-layout`)===this.layoutMode)});let i=!!this.getCurrentFile()?.path,a=this.getCurrentActionState(),o=this.getPrimaryAction();this.backToHistoryButton?.classList.toggle(`hidden`,!n),this.gitActionsGroup?.classList.toggle(`hidden`,n),this.editorActionsGroup?.classList.toggle(`hidden`,n),this.actionsDivider?.classList.toggle(`hidden`,n),this.layoutToggle?.classList.toggle(`hidden`,!n),this.stats?.classList.remove(`hidden`),this.openEditorButton&&(this.openEditorButton.textContent=`Open in Editor`),this.openEditorButton?.toggleAttribute(`disabled`,!i||n),this.primaryActionButton&&(this.primaryActionButton.textContent=this.pendingAction===o?`Working...`:o===`unstage`?`Unstage`:`Stage`,this.primaryActionButton.toggleAttribute(`disabled`,n||!i||!o||!!this.pendingAction)),this.commitButton&&(this.commitButton.textContent=this.pendingAction===`commit`?`Working...`:`Commit Staged`),this.commitButton?.toggleAttribute(`disabled`,n||!a.canCommit||!!this.pendingAction),this.prevButton?.classList.remove(`hidden`),this.nextButton?.classList.remove(`hidden`),this.prevButton?.classList.toggle(`hidden`,r),this.nextButton?.classList.toggle(`hidden`,r),this.prevButton?.toggleAttribute(`disabled`,r||this.currentIndex<=0),this.nextButton?.toggleAttribute(`disabled`,r||e===0||this.currentIndex>=e-1)}render(){if(this.isActive){if(this.page?.classList.remove(`hidden`),(this.data?.files??[]).length===0){this.renderEmpty(this.source===`commit`?`No commit changes to display.`:`No changes to display.`);return}this.content&&(this.source===`commit`?this.content.innerHTML=`${this.renderCommitHeader()}${this.renderCommitBody()}`:this.content.innerHTML=this.renderFocusedFileBody(),this.syncToolbar())}}getToolbarTitle({commitHash:e=null,filePath:t=null,path:r=null,scope:i=`all`,source:a=`workspace`}={}){return a===`commit`||this.source===`commit`?this.layoutMode===`stacked`?this.commitMeta?.shortHash?`Commit ${this.commitMeta.shortHash}`:e?`Commit ${String(e).slice(0,7)}`:`Commit Diff`:r?n(r):this.activeFilePath?n(this.activeFilePath):this.commitMeta?.shortHash?`Commit ${this.commitMeta.shortHash}`:e?`Commit ${String(e).slice(0,7)}`:`Commit Diff`:t?n(t):i===`staged`?`Staged Changes`:i===`working-tree`?`Working Tree Changes`:`All Changes`}};export{p as GitDiffViewController};
@@ -0,0 +1,207 @@
1
+ import{n as e}from"./vault-utils-kIbqyWPm.js";import{t}from"./button-2ZnWQkWV.js";import{n,t as r}from"./segmented-control-DhUkW6ro.js";var i=30,a=1e4;function o(e){let t=String(e??``).split(`/`);return t.pop(),t.join(`/`)}function s(e){return String(e??``).split(`/`).pop()||``}function c(){return`<svg class="git-file-icon" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>`}function l(){return`<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="18" cy="18" r="3"/><circle cx="6" cy="6" r="3"/><path d="M13 6h3a2 2 0 0 1 2 2v7"/><path d="M6 9v12"/></svg>`}function u(e){return`<svg class="git-section-chevron${e?` collapsed`:``}" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" aria-hidden="true"><polyline points="6 9 12 15 18 9"/></svg>`}function d(e){switch(e){case`commit`:return`<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg>`;case`pull`:return`<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 5v14"/><path d="m18 13-6 6-6-6"/></svg>`;case`push`:return`<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 19V5"/><path d="m6 11 6-6 6 6"/></svg>`;case`unstage`:return`<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 12H8"/><path d="m12 16-4-4 4-4"/></svg>`;case`reset`:return`<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 12a9 9 0 1 0 3-6.7"/><path d="M3 4v5h5"/></svg>`;default:return`<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 5v14"/><path d="M5 12h14"/></svg>`}}function f(e){switch(e){case`added`:return`ui-status-badge--success`;case`deleted`:return`ui-status-badge--danger`;case`renamed`:return`ui-status-badge--accent`;case`untracked`:return`ui-status-badge--muted`;default:return`ui-status-badge--warning`}}function p(e={},t={}){let n=Number(e.additions||0),r=Number(e.deletions||0);return Number(e.changedFiles||0)>0||n>0||r>0?`
2
+ <span class="git-change-stats" aria-label="Local diff summary">
3
+ <span class="git-change-add">+${n}</span>
4
+ <span class="git-change-del">-${r}</span>
5
+ </span>
6
+ `:t.upstream||Number(t.ahead||0)>0||Number(t.behind||0)>0?`
7
+ <span class="git-sync-info" aria-label="Remote sync status">
8
+ <span class="git-sync-metric git-sync-metric--ahead">&#8593;${Number(t.ahead||0)}</span>
9
+ <span class="git-sync-metric git-sync-metric--behind">&#8595;${Number(t.behind||0)}</span>
10
+ </span>
11
+ `:`<span class="git-sync-info git-sync-info-muted">Clean</span>`}function m(t={}){return e(String(t.subject||``).trim()||t.shortHash||`Commit`)}var h=class{constructor({enabled:e=!0,gitApiClient:t=null,onCommitStaged:n=()=>{},onOpenPullBackup:r=()=>{},onPullBranch:i=()=>{},onPushBranch:a=()=>{},onRepoChange:o=()=>{},onResetFile:s=()=>{},onSelectCommit:c=()=>{},onSelectDiff:l=()=>{},onStageFile:u=()=>{},onUnstageFile:d=()=>{},onViewAllDiff:f=()=>{},searchInput:p=null,toastController:m=null}={}){this.enabled=e,this.gitApiClient=t,this.onCommitStaged=n,this.onOpenPullBackup=r,this.onPullBranch=i,this.onPushBranch=a,this.onRepoChange=o,this.onResetFile=s,this.onSelectCommit=c,this.onSelectDiff=l,this.onStageFile=u,this.onUnstageFile=d,this.onViewAllDiff=f,this.searchInput=p,this.toastController=m,this.panel=document.getElementById(`gitPanel`),this.pullBackups=[],this.status=null,this.active=!1,this.refreshTimer=null,this.searchQuery=``,this.panelMode=`changes`,this.collapsedSections=new Set,this.selection={commitHash:null,path:null,scope:null,source:`workspace`},this.pendingActionKey=null,this.history={commits:[],error:``,hasMore:!1,loaded:!1,loading:!1,loadingMore:!1,offset:0}}_handlePanelModeClick(e){let t=e.target instanceof Element?e.target.closest(`[data-git-panel-mode]`):null;if(t){let e=t.getAttribute(`data-git-panel-mode`);return(e===`changes`||e===`history`)&&this.setMode(e),!0}return!1}_handleSectionToggleClick(e){let t=e.target instanceof Element?e.target.closest(`[data-git-section-toggle]`):null;return t?(this.toggleSection(t.getAttribute(`data-git-section-toggle`)),!0):!1}_handleCommitHistoryClick(e){let t=e.target instanceof Element?e.target.closest(`[data-git-commit-hash]`):null;if(t&&!e.target.closest(`[data-git-history-load-more]`)){let e=t.getAttribute(`data-git-commit-hash`);return e&&this.onSelectCommit(e,{path:this.selection.commitHash===e?this.selection.path:null}),!0}return!1}_handleFileSelectionClick(e){let t=e.target instanceof Element?e.target.closest(`[data-git-path]`):null;if(t&&!e.target.closest(`[data-git-file-action]`)){let e=t.getAttribute(`data-git-path`);return e&&this.onSelectDiff(e,{scope:t.getAttribute(`data-git-scope`)||`working-tree`}),!0}return!1}_handleFileActionClick(e){let t=e.target instanceof Element?e.target.closest(`[data-git-file-action]`):null;if(t){let n=t.getAttribute(`data-git-file-action`),r=t.getAttribute(`data-git-path`);return n&&r&&(e.preventDefault(),e.stopPropagation(),this.handleFileAction(n,r,t.getAttribute(`data-git-scope`)||`working-tree`)),!0}return!1}_handlePanelClick(e){if(this._handlePanelModeClick(e)||this._handleSectionToggleClick(e)||this._handleCommitHistoryClick(e))return;if(e.target instanceof Element&&e.target.closest(`[data-git-history-load-more]`)){this.loadMoreHistory();return}if(this._handleFileSelectionClick(e))return;let t=e.target instanceof Element?e.target.closest(`[data-git-pull-backup-path]`):null;if(t){let e=t.getAttribute(`data-git-pull-backup-path`);e&&this.onOpenPullBackup(e);return}if(this._handleFileActionClick(e))return;if(e.target instanceof Element&&e.target.closest(`[data-git-view-all]`)){this.onViewAllDiff();return}if(e.target instanceof Element&&e.target.closest(`[data-git-commit-staged]`)){this.handleCommitStaged();return}let n=e.target instanceof Element?e.target.closest(`[data-git-sync-action]`):null;if(n){let e=n.getAttribute(`data-git-sync-action`);(e===`pull`||e===`push`)&&this.handleSyncAction(e)}}initialize(){this.panel?.addEventListener(`click`,e=>{this._handlePanelClick(e)}),this.searchInput?.addEventListener(`input`,e=>{this.searchQuery=String(e.target?.value??``).trim().toLowerCase(),this.render()}),this.syncSearchUi()}setActive(e){let t=!!e;if(!(this.active===t&&(!t||this.refreshTimer||this.panelMode===`history`))){if(this.active=t,!this.active){this.stopStatusPolling();return}this.syncSearchUi(),this.refresh({force:!1,includeHistory:this.panelMode===`history`}),this.panelMode===`changes`?this.ensureStatusPolling():this.stopStatusPolling()}}async setMode(e,{forceHistoryRefresh:t=!1}={}){let n=e===`history`?`history`:`changes`,r=this.panelMode!==n;if(this.panelMode=n,this.syncSearchUi(),this.render(),this.active){if(this.panelMode===`changes`){this.ensureStatusPolling(),r&&await this.refresh({force:!1,includeHistory:!1});return}this.stopStatusPolling(),(t||r||!this.history.loaded)&&await this.refreshHistory({force:t||r})}}setSelection({commitHash:e=null,path:t=null,scope:n=null,source:r=`workspace`}={}){this.selection={commitHash:e,path:t,scope:n,source:r},(r===`commit`||e)&&(this.panelMode=`history`,this.syncSearchUi()),this.render()}toggleSection(e){e&&(this.collapsedSections.has(e)?this.collapsedSections.delete(e):this.collapsedSections.add(e),this.render())}ensureStatusPolling(){this.refreshTimer||!this.active||this.panelMode!==`changes`||(this.refreshTimer=setInterval(()=>{this.refresh({force:!1,includeHistory:!1})},a))}stopStatusPolling(){clearInterval(this.refreshTimer),this.refreshTimer=null}syncSearchUi(){this.searchInput&&(this.searchInput.setAttribute(`placeholder`,this.panelMode===`history`?`Filter loaded commits...`:`Search changes...`),this.searchInput.setAttribute(`aria-label`,this.panelMode===`history`?`Filter loaded commits`:`Search changed files`))}async refresh({force:e=!1,includeHistory:t=this.panelMode===`history`}={}){let n=await this.refreshStatus({force:e});return t&&n.isGitRepo&&await this.refreshHistory({force:e}),n}async refreshStatus({force:e=!1}={}){if(!this.enabled)return this.status={isGitRepo:!1,sections:[],summary:{changedFiles:0}},this.pullBackups=[],this.history={...this.history,commits:[],error:``,hasMore:!1,loaded:!1,loading:!1,loadingMore:!1,offset:0},this.onRepoChange(!1,this.status),this.render(),this.status;try{let t=await this.gitApiClient.readStatus({force:e});if(this.status=t,this.pullBackups=[],t.isGitRepo)try{let e=await this.gitApiClient.readPullBackups();this.pullBackups=Array.isArray(e.backups)?e.backups:[]}catch(e){console.error(`[git-panel] Failed to load pull backups:`,e)}else this.history={...this.history,commits:[],error:``,hasMore:!1,loaded:!1,loading:!1,loadingMore:!1,offset:0};return this.onRepoChange(!!t.isGitRepo,t),this.render(),t}catch(e){return console.error(`[git-panel] Failed to load git status:`,e),this.toastController?.show(`Failed to load git status`),this.status={isGitRepo:!1,sections:[],summary:{changedFiles:0}},this.pullBackups=[],this.history={...this.history,commits:[],error:``,hasMore:!1,loaded:!1,loading:!1,loadingMore:!1,offset:0},this.onRepoChange(!1,this.status),this.render(),this.status}}async refreshHistory({force:e=!1}={}){if(!this.status?.isGitRepo)return this.history={...this.history,commits:[],error:``,hasMore:!1,loaded:!1,loading:!1,loadingMore:!1,offset:0},this.render(),this.history;if(this.history.loading&&!e)return this.history;this.history={...this.history,error:``,loading:!0,loadingMore:!1},e&&(this.history={...this.history,commits:[],hasMore:!1,loaded:!1,offset:0}),this.render();try{let e=await this.gitApiClient.readHistory({limit:i,offset:0});return this.history={commits:Array.isArray(e.commits)?e.commits:[],error:``,hasMore:!!e.hasMore,loaded:!0,loading:!1,loadingMore:!1,offset:Array.isArray(e.commits)?e.commits.length:0},this.render(),this.history}catch(e){return console.error(`[git-panel] Failed to load git history:`,e),this.toastController?.show(`Failed to load git history`),this.history={...this.history,error:`Failed to load git history`,loading:!1,loadingMore:!1},this.render(),this.history}}async loadMoreHistory(){if(!(!this.status?.isGitRepo||this.history.loading||this.history.loadingMore||!this.history.hasMore)){this.history={...this.history,error:``,loadingMore:!0},this.render();try{let e=await this.gitApiClient.readHistory({limit:i,offset:this.history.offset}),t=Array.isArray(e.commits)?e.commits:[];this.history={commits:[...this.history.commits,...t],error:``,hasMore:!!e.hasMore,loaded:!0,loading:!1,loadingMore:!1,offset:this.history.offset+t.length},this.render()}catch(e){console.error(`[git-panel] Failed to load more git history:`,e),this.toastController?.show(`Failed to load git history`),this.history={...this.history,error:`Failed to load git history`,loadingMore:!1},this.render()}}}filterFiles(e=[]){return this.searchQuery?e.filter(e=>e.path.toLowerCase().includes(this.searchQuery)||String(e.oldPath||``).toLowerCase().includes(this.searchQuery)):e}filterCommits(e=[]){return this.searchQuery?e.filter(e=>String(e.subject||``).toLowerCase().includes(this.searchQuery)||String(e.shortHash||``).toLowerCase().includes(this.searchQuery)||String(e.authorName||``).toLowerCase().includes(this.searchQuery)):e}async handleFileAction(e,t,n){let r=`${e}:${n}:${t}`;if(this.pendingActionKey!==r){this.pendingActionKey=r,this.render();try{e===`stage`?await this.onStageFile(t,{scope:n}):e===`unstage`?await this.onUnstageFile(t,{scope:n}):e===`reset`&&await this.onResetFile(t,{scope:n})}finally{this.pendingActionKey=null,this.render()}}}async handleCommitStaged(){let e=`commit-staged`;if(this.pendingActionKey!==e){this.pendingActionKey=e,this.render();try{await this.onCommitStaged()}finally{this.pendingActionKey=null,this.render()}}}async handleSyncAction(e){let t=`sync:${e}`;if(this.pendingActionKey!==t){this.pendingActionKey=t,this.render();try{e===`pull`?await this.onPullBranch():e===`push`&&await this.onPushBranch()}finally{this.pendingActionKey=null,this.render()}}}renderSection(t){let n=this.filterFiles(t.files);if(n.length===0)return``;let r=this.collapsedSections.has(t.key);return`
12
+ <section class="git-section">
13
+ <button class="git-section-header" type="button" data-git-section-toggle="${e(t.key)}">
14
+ ${u(r)}
15
+ ${e(t.label)}
16
+ <span class="ui-pill-badge ui-pill-badge--count ui-pill-badge--muted git-section-count">${n.length}</span>
17
+ </button>
18
+ <div class="git-file-list${r?` hidden`:``}">
19
+ ${n.map(e=>this.renderFile(e)).join(``)}
20
+ </div>
21
+ </section>
22
+ `}renderPullBackupsSection(){return!Array.isArray(this.pullBackups)||this.pullBackups.length===0?``:`
23
+ <section class="git-section">
24
+ <button class="git-section-header" type="button" data-git-section-toggle="pull-backups">
25
+ ${u(this.collapsedSections.has(`pull-backups`))}
26
+ Pull Backups
27
+ <span class="ui-pill-badge ui-pill-badge--count ui-pill-badge--muted git-section-count">${this.pullBackups.length}</span>
28
+ </button>
29
+ <div class="git-file-list${this.collapsedSections.has(`pull-backups`)?` hidden`:``}">
30
+ ${this.pullBackups.map(e=>this.renderPullBackup(e)).join(``)}
31
+ </div>
32
+ </section>
33
+ `}renderPullBackup(t){let n=String(t?.createdAt||``).replace(`T`,` `).replace(/\.\d+Z?$/u,`Z`),r=Number(t?.fileCount||0);return`
34
+ <div class="ui-item-row git-file-row">
35
+ <button
36
+ class="ui-item-main git-file-item"
37
+ type="button"
38
+ data-git-pull-backup-path="${e(t.summaryPath||``)}"
39
+ >
40
+ ${c()}
41
+ <span class="ui-item-copy git-file-copy">
42
+ <span class="ui-item-title git-file-name">Pull backup ${e(t.id||``)}</span>
43
+ <span class="ui-item-subtitle git-file-path">${e(`${n} · ${t.branch||`HEAD`} · ${r} file${r===1?``:`s`}`)}</span>
44
+ </span>
45
+ <span class="ui-status-badge ui-status-badge--warning">BK</span>
46
+ </button>
47
+ </div>
48
+ `}renderFile(t){let n=this.selection.source===`workspace`&&this.selection.path===t.path&&this.selection.scope===t.scope,r=o(t.path),i=s(t.path),a=String(t.path||``),l=f(t.status),u=t.scope===`staged`?{label:`Unstage`,value:`unstage`}:{label:`Stage`,value:`stage`},p=`${u.value}:${t.scope}:${t.path}`,m=this.pendingActionKey===p,h=`reset:${t.scope}:${t.path}`,g=this.pendingActionKey===h;return`
49
+ <div class="ui-item-row git-file-row${n?` active`:``}">
50
+ <button
51
+ class="ui-item-main git-file-item${n?` active`:``}"
52
+ type="button"
53
+ data-git-path="${e(t.path)}"
54
+ data-git-scope="${e(t.scope)}"
55
+ title="${e(a)}"
56
+ >
57
+ ${c()}
58
+ <span class="ui-item-copy git-file-copy">
59
+ <span class="ui-item-title git-file-name">${e(i)}</span>
60
+ ${r?`<span class="ui-item-subtitle git-file-path">${e(r)}</span>`:``}
61
+ </span>
62
+ <span class="ui-status-badge ${l}">${e(t.code)}</span>
63
+ </button>
64
+ <div class="ui-item-actions git-file-actions">
65
+ <button
66
+ class="ui-icon-button ui-action-icon ui-action-icon--surface"
67
+ type="button"
68
+ data-git-file-action="reset"
69
+ data-git-path="${e(t.path)}"
70
+ data-git-scope="${e(t.scope)}"
71
+ aria-label="Reset ${e(i)}"
72
+ title="Reset to current branch"
73
+ ${g?`disabled`:``}
74
+ >
75
+ ${g?`...`:d(`reset`)}
76
+ </button>
77
+ <button
78
+ class="ui-icon-button ui-action-icon ui-action-icon--surface"
79
+ type="button"
80
+ data-git-file-action="${u.value}"
81
+ data-git-path="${e(t.path)}"
82
+ data-git-scope="${e(t.scope)}"
83
+ aria-label="${e(u.label)} ${e(i)}"
84
+ title="${e(u.label)}"
85
+ ${m?`disabled`:``}
86
+ >
87
+ ${m?`...`:d(u.value)}
88
+ </button>
89
+ </div>
90
+ </div>
91
+ `}renderPanelModes(){return`
92
+ <div class="${n({pill:!0,extra:`git-panel-mode-switch`})}" role="tablist" aria-label="Git panel modes">
93
+ <button
94
+ class="${r({active:this.panelMode===`changes`,extra:`git-panel-mode-btn`})}"
95
+ type="button"
96
+ data-git-panel-mode="changes"
97
+ aria-selected="${this.panelMode===`changes`}"
98
+ >
99
+ Changes
100
+ </button>
101
+ <button
102
+ class="${r({active:this.panelMode===`history`,extra:`git-panel-mode-btn`})}"
103
+ type="button"
104
+ data-git-panel-mode="history"
105
+ aria-selected="${this.panelMode===`history`}"
106
+ >
107
+ History
108
+ </button>
109
+ </div>
110
+ `}renderHistoryRow(t){let n=this.selection.source===`commit`&&this.selection.commitHash===t.hash,r=Number(t.filesChanged||0);return`
111
+ <button
112
+ class="ui-record-surface git-history-row${n?` active`:``}"
113
+ type="button"
114
+ data-git-commit-hash="${e(t.hash||``)}"
115
+ title="${e(t.authoredAt||``)}"
116
+ >
117
+ <span class="ui-record-header git-history-row-top">
118
+ <span class="ui-record-title git-history-subject">${m(t)}</span>
119
+ <span class="ui-pill-badge ui-pill-badge--code git-history-hash">${e(t.shortHash||``)}</span>
120
+ </span>
121
+ <span class="ui-record-meta git-history-row-meta">
122
+ <span>${e(t.authorName||`Unknown`)}</span>
123
+ <span>${e(t.relativeDateLabel||``)}</span>
124
+ <span>${r} file${r===1?``:`s`}</span>
125
+ ${t.isMergeCommit?`<span>Merge</span>`:``}
126
+ </span>
127
+ <span class="ui-record-meta git-history-row-stats">
128
+ <span class="git-change-add">+${Number(t.additions||0)}</span>
129
+ <span class="git-change-del">-${Number(t.deletions||0)}</span>
130
+ </span>
131
+ </button>
132
+ `}renderHistoryPanel(){let n=this.filterCommits(this.history.commits);return this.history.loading&&!this.history.loaded?`<div class="git-panel-empty">Loading git history...</div>`:this.history.error&&!this.history.loaded?`<div class="git-panel-empty">${e(this.history.error)}</div>`:this.history.loaded&&n.length===0&&this.history.commits.length===0?`<div class="git-panel-empty">No commits yet on this branch.</div>`:this.history.loaded&&n.length===0?`<div class="git-panel-empty">No loaded commits match your filter.</div>`:`
133
+ <div class="git-history-list">
134
+ ${n.map(e=>this.renderHistoryRow(e)).join(``)}
135
+ </div>
136
+ ${this.history.hasMore?`
137
+ <div class="git-history-footer">
138
+ <button
139
+ class="${t({variant:`secondary`,size:`compact`,action:!0,surface:!0,extra:`git-history-load-more`})}"
140
+ type="button"
141
+ data-git-history-load-more
142
+ ${this.history.loadingMore?`disabled`:``}
143
+ >
144
+ ${this.history.loadingMore?`Loading...`:`Load More`}
145
+ </button>
146
+ </div>
147
+ `:``}
148
+ `}renderChangesPanel(){let e=this.renderPullBackupsSection(),n=(this.status.sections??[]).map(e=>this.renderSection(e)).filter(Boolean).join(``),r=!!this.status.summary?.changedFiles,i=Number(this.status.summary?.staged||0)>0,a=this.pendingActionKey===`commit-staged`;return`
149
+ ${e}
150
+ ${n||`<div class="git-panel-empty">No local changes</div>`}
151
+ ${r?`
152
+ <div class="git-panel-footer">
153
+ <div class="git-panel-footer-actions">
154
+ <button class="${t({variant:`secondary`,size:`compact`,action:!0,surface:!0})}" type="button" data-git-view-all>
155
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M2 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>
156
+ View Full Diff
157
+ </button>
158
+ <button
159
+ class="${t({variant:`primary`,action:!0,wide:!0,extra:`git-footer-commit-btn`})}"
160
+ type="button"
161
+ data-git-commit-staged
162
+ ${!i||a?`disabled`:``}
163
+ >
164
+ ${a?`Working...`:`Commit Staged`}
165
+ </button>
166
+ </div>
167
+ </div>
168
+ `:``}
169
+ `}renderEmpty(t){this.panel&&(this.panel.innerHTML=`
170
+ <div class="git-panel-empty ui-empty-state ui-empty-state--compact">
171
+ <p class="ui-empty-state-copy">${e(t)}</p>
172
+ </div>
173
+ `)}render(){if(!this.panel)return;if(!this.status){this.renderEmpty(`Loading git status...`);return}if(!this.status.isGitRepo){this.renderEmpty(`Git is unavailable for this vault.`);return}let n=this.status.branch??{},r=!!n.upstream,i=this.pendingActionKey===`sync:pull`,a=this.pendingActionKey===`sync:push`;this.panel.innerHTML=`
174
+ <div class="git-branch-bar">
175
+ <div class="git-branch-meta">
176
+ <span class="git-branch-name">
177
+ ${l()}
178
+ ${e(n.name||`HEAD`)}
179
+ </span>
180
+ ${p(this.status.summary,n)}
181
+ </div>
182
+ <div class="git-branch-actions" role="group" aria-label="Remote sync actions">
183
+ <button
184
+ class="${t({variant:`secondary`,size:`compact`,pill:!0,surface:!0,extra:`ui-action-pill`})}"
185
+ type="button"
186
+ data-git-sync-action="pull"
187
+ title="${r?`Pull remote changes (fast-forward only)`:`No upstream branch configured`}"
188
+ aria-label="Pull branch"
189
+ ${!r||i?`disabled`:``}
190
+ >
191
+ ${i?`...`:`${d(`pull`)}<span>Pull</span>`}
192
+ </button>
193
+ <button
194
+ class="${t({variant:`secondary`,size:`compact`,pill:!0,surface:!0,extra:`ui-action-pill`})}"
195
+ type="button"
196
+ data-git-sync-action="push"
197
+ title="${r?`Push local commits`:`No upstream branch configured`}"
198
+ aria-label="Push branch"
199
+ ${!r||a?`disabled`:``}
200
+ >
201
+ ${a?`...`:`${d(`push`)}<span>Push</span>`}
202
+ </button>
203
+ </div>
204
+ ${this.renderPanelModes()}
205
+ </div>
206
+ ${this.panelMode===`history`?this.renderHistoryPanel():this.renderChangesPanel()}
207
+ `}};export{h as GitPanelController};
@@ -0,0 +1 @@
1
+ import"./chunk-KEIR6QF5-Dj-OpFgW.js";import{n as e}from"./chunk-CYSBUYHQ-CbOq7Rc1.js";export{e as createGitGraphServices};
@@ -0,0 +1,106 @@
1
+ import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-UMNXGZaF.js";import{H as r,K as i,U as a,Y as o,a as s,b as c,f as l,s as u,v as d,w as f,x as p,y as m}from"./chunk-WYO6CB5R-HgTPu1OL.js";import{g as h,i as g,m as _}from"./chunk-ICXQ74PX-DGYhuP6g.js";import{t as v}from"./chunk-JWPE2WC7-DVXcaiue.js";import{n as y}from"./mermaid-parser.core-ygm3cZ_w.js";import{t as b}from"./chunk-2Q5K7J3B-C1jixKkw.js";var x={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},ee=l.gitGraph,S=e(()=>g({...ee,...c().gitGraph}),`getConfig`),C=new b(()=>{let e=S(),t=e.mainBranchName,n=e.mainBranchOrder;return{mainBranchName:t,commits:new Map,head:null,branchConfig:new Map([[t,{name:t,order:n}]]),branches:new Map([[t,null]]),currBranch:t,direction:`LR`,seq:0,options:{}}});function w(){return _({length:7})}e(w,`getID`);function T(e,t){let n=Object.create(null);return e.reduce((e,r)=>{let i=t(r);return n[i]||(n[i]=!0,e.push(r)),e},[])}e(T,`uniqBy`);var te=e(function(e){C.records.direction=e},`setDirection`),ne=e(function(e){t.debug(`options str`,e),e=e?.trim(),e||=`{}`;try{C.records.options=JSON.parse(e)}catch(e){t.error(`error while parsing gitGraph options`,e.message)}},`setOptions`),re=e(function(){return C.records.options},`getOptions`),ie=e(function(e){let n=e.msg,r=e.id,i=e.type,a=e.tags;t.info(`commit`,n,r,i,a),t.debug(`Entering commit:`,n,r,i,a);let o=S();r=u.sanitizeText(r,o),n=u.sanitizeText(n,o),a=a?.map(e=>u.sanitizeText(e,o));let s={id:r||C.records.seq+`-`+w(),message:n,seq:C.records.seq++,type:i??x.NORMAL,tags:a??[],parents:C.records.head==null?[]:[C.records.head.id],branch:C.records.currBranch};C.records.head=s,t.info(`main branch`,o.mainBranchName),C.records.commits.has(s.id)&&t.warn(`Commit ID ${s.id} already exists`),C.records.commits.set(s.id,s),C.records.branches.set(C.records.currBranch,s.id),t.debug(`in pushCommit `+s.id)},`commit`),ae=e(function(e){let n=e.name,r=e.order;if(n=u.sanitizeText(n,S()),C.records.branches.has(n))throw Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${n}")`);C.records.branches.set(n,C.records.head==null?null:C.records.head.id),C.records.branchConfig.set(n,{name:n,order:r}),E(n),t.debug(`in createBranch`)},`branch`),oe=e(e=>{let n=e.branch,r=e.id,i=e.type,a=e.tags,o=S();n=u.sanitizeText(n,o),r&&=u.sanitizeText(r,o);let s=C.records.branches.get(C.records.currBranch),c=C.records.branches.get(n),l=s?C.records.commits.get(s):void 0,d=c?C.records.commits.get(c):void 0;if(l&&d&&l.branch===n)throw Error(`Cannot merge branch '${n}' into itself.`);if(C.records.currBranch===n){let e=Error(`Incorrect usage of "merge". Cannot merge a branch to itself`);throw e.hash={text:`merge ${n}`,token:`merge ${n}`,expected:[`branch abc`]},e}if(l===void 0||!l){let e=Error(`Incorrect usage of "merge". Current branch (${C.records.currBranch})has no commits`);throw e.hash={text:`merge ${n}`,token:`merge ${n}`,expected:[`commit`]},e}if(!C.records.branches.has(n)){let e=Error(`Incorrect usage of "merge". Branch to be merged (`+n+`) does not exist`);throw e.hash={text:`merge ${n}`,token:`merge ${n}`,expected:[`branch ${n}`]},e}if(d===void 0||!d){let e=Error(`Incorrect usage of "merge". Branch to be merged (`+n+`) has no commits`);throw e.hash={text:`merge ${n}`,token:`merge ${n}`,expected:[`"commit"`]},e}if(l===d){let e=Error(`Incorrect usage of "merge". Both branches have same head`);throw e.hash={text:`merge ${n}`,token:`merge ${n}`,expected:[`branch abc`]},e}if(r&&C.records.commits.has(r)){let e=Error(`Incorrect usage of "merge". Commit with id:`+r+` already exists, use different custom id`);throw e.hash={text:`merge ${n} ${r} ${i} ${a?.join(` `)}`,token:`merge ${n} ${r} ${i} ${a?.join(` `)}`,expected:[`merge ${n} ${r}_UNIQUE ${i} ${a?.join(` `)}`]},e}let f=c||``,p={id:r||`${C.records.seq}-${w()}`,message:`merged branch ${n} into ${C.records.currBranch}`,seq:C.records.seq++,parents:C.records.head==null?[]:[C.records.head.id,f],branch:C.records.currBranch,type:x.MERGE,customType:i,customId:!!r,tags:a??[]};C.records.head=p,C.records.commits.set(p.id,p),C.records.branches.set(C.records.currBranch,p.id),t.debug(C.records.branches),t.debug(`in mergeBranch`)},`merge`),se=e(function(e){let n=e.id,r=e.targetId,i=e.tags,a=e.parent;t.debug(`Entering cherryPick:`,n,r,i);let o=S();if(n=u.sanitizeText(n,o),r=u.sanitizeText(r,o),i=i?.map(e=>u.sanitizeText(e,o)),a=u.sanitizeText(a,o),!n||!C.records.commits.has(n)){let e=Error(`Incorrect usage of "cherryPick". Source commit id should exist and provided`);throw e.hash={text:`cherryPick ${n} ${r}`,token:`cherryPick ${n} ${r}`,expected:[`cherry-pick abc`]},e}let s=C.records.commits.get(n);if(s===void 0||!s)throw Error(`Incorrect usage of "cherryPick". Source commit id should exist and provided`);if(a&&!(Array.isArray(s.parents)&&s.parents.includes(a)))throw Error(`Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.`);let c=s.branch;if(s.type===x.MERGE&&!a)throw Error(`Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.`);if(!r||!C.records.commits.has(r)){if(c===C.records.currBranch){let e=Error(`Incorrect usage of "cherryPick". Source commit is already on current branch`);throw e.hash={text:`cherryPick ${n} ${r}`,token:`cherryPick ${n} ${r}`,expected:[`cherry-pick abc`]},e}let e=C.records.branches.get(C.records.currBranch);if(e===void 0||!e){let e=Error(`Incorrect usage of "cherry-pick". Current branch (${C.records.currBranch})has no commits`);throw e.hash={text:`cherryPick ${n} ${r}`,token:`cherryPick ${n} ${r}`,expected:[`cherry-pick abc`]},e}let o=C.records.commits.get(e);if(o===void 0||!o){let e=Error(`Incorrect usage of "cherry-pick". Current branch (${C.records.currBranch})has no commits`);throw e.hash={text:`cherryPick ${n} ${r}`,token:`cherryPick ${n} ${r}`,expected:[`cherry-pick abc`]},e}let l={id:C.records.seq+`-`+w(),message:`cherry-picked ${s?.message} into ${C.records.currBranch}`,seq:C.records.seq++,parents:C.records.head==null?[]:[C.records.head.id,s.id],branch:C.records.currBranch,type:x.CHERRY_PICK,tags:i?i.filter(Boolean):[`cherry-pick:${s.id}${s.type===x.MERGE?`|parent:${a}`:``}`]};C.records.head=l,C.records.commits.set(l.id,l),C.records.branches.set(C.records.currBranch,l.id),t.debug(C.records.branches),t.debug(`in cherryPick`)}},`cherryPick`),E=e(function(e){if(e=u.sanitizeText(e,S()),C.records.branches.has(e)){C.records.currBranch=e;let t=C.records.branches.get(C.records.currBranch);t===void 0||!t?C.records.head=null:C.records.head=C.records.commits.get(t)??null}else{let t=Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw t.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},t}},`checkout`);function D(e,t,n){let r=e.indexOf(t);r===-1?e.push(n):e.splice(r,1,n)}e(D,`upsert`);function O(e){let n=e.reduce((e,t)=>e.seq>t.seq?e:t,e[0]),r=``;e.forEach(function(e){e===n?r+=` *`:r+=` |`});let i=[r,n.id,n.seq];for(let e in C.records.branches)C.records.branches.get(e)===n.id&&i.push(e);if(t.debug(i.join(` `)),n.parents&&n.parents.length==2&&n.parents[0]&&n.parents[1]){let t=C.records.commits.get(n.parents[0]);D(e,n,t),n.parents[1]&&e.push(C.records.commits.get(n.parents[1]))}else if(n.parents.length==0)return;else if(n.parents[0]){let t=C.records.commits.get(n.parents[0]);D(e,n,t)}e=T(e,e=>e.id),O(e)}e(O,`prettyPrintCommitHistory`);var ce=e(function(){t.debug(C.records.commits);let e=k()[0];O([e])},`prettyPrint`),le=e(function(){C.reset(),s()},`clear`),ue=e(function(){return[...C.records.branchConfig.values()].map((e,t)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${t}`)}).sort((e,t)=>(e.order??0)-(t.order??0)).map(({name:e})=>({name:e}))},`getBranchesAsObjArray`),de=e(function(){return C.records.branches},`getBranches`),fe=e(function(){return C.records.commits},`getCommits`),k=e(function(){let e=[...C.records.commits.values()];return e.forEach(function(e){t.debug(e.id)}),e.sort((e,t)=>e.seq-t.seq),e},`getCommitsArray`),A={commitType:x,getConfig:S,setDirection:te,setOptions:ne,getOptions:re,commit:ie,branch:ae,merge:oe,cherryPick:se,checkout:E,prettyPrint:ce,clear:le,getBranchesAsObjArray:ue,getBranches:de,getCommits:fe,getCommitsArray:k,getCurrentBranch:e(function(){return C.records.currBranch},`getCurrentBranch`),getDirection:e(function(){return C.records.direction},`getDirection`),getHead:e(function(){return C.records.head},`getHead`),setAccTitle:a,getAccTitle:m,getAccDescription:d,setAccDescription:r,setDiagramTitle:i,getDiagramTitle:f},pe=e((e,t)=>{v(e,t),e.dir&&t.setDirection(e.dir);for(let n of e.statements)me(n,t)},`populate`),me=e((n,r)=>{let i={Commit:e(e=>r.commit(he(e)),`Commit`),Branch:e(e=>r.branch(ge(e)),`Branch`),Merge:e(e=>r.merge(_e(e)),`Merge`),Checkout:e(e=>r.checkout(ve(e)),`Checkout`),CherryPicking:e(e=>r.cherryPick(ye(e)),`CherryPicking`)}[n.$type];i?i(n):t.error(`Unknown statement type: ${n.$type}`)},`parseStatement`),he=e(e=>({id:e.id,msg:e.message??``,type:e.type===void 0?x.NORMAL:x[e.type],tags:e.tags??void 0}),`parseCommit`),ge=e(e=>({name:e.name,order:e.order??0}),`parseBranch`),_e=e(e=>({branch:e.branch,id:e.id??``,type:e.type===void 0?void 0:x[e.type],tags:e.tags??void 0}),`parseMerge`),ve=e(e=>e.branch,`parseCheckout`),ye=e(e=>({id:e.id,targetId:``,tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),`parseCherryPicking`),be={parse:e(async e=>{let n=await y(`gitGraph`,e);t.debug(n),pe(n,A)},`parse`)},j=10,M=40,N=4,P=2,F=8,I=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`]),L=12,R=new Set([`redux-color`,`redux-dark-color`]),xe=new Set([`dark`,`redux-dark`,`redux-dark-color`,`neo-dark`]),z=e((e,t,n=!1)=>n&&e>0?(e-1)%(t-1)+1:e%t,`calcColorIndex`),B=new Map,V=new Map,H=30,U=new Map,W=[],G=0,K=`LR`,q=e(()=>{B.clear(),V.clear(),U.clear(),G=0,W=[],K=`LR`},`clear`),J=e(e=>{let t=document.createElementNS(`http://www.w3.org/2000/svg`,`text`);return(typeof e==`string`?e.split(/\\n|\n|<br\s*\/?>/gi):e).forEach(e=>{let n=document.createElementNS(`http://www.w3.org/2000/svg`,`tspan`);n.setAttributeNS(`http://www.w3.org/XML/1998/namespace`,`xml:space`,`preserve`),n.setAttribute(`dy`,`1em`),n.setAttribute(`x`,`0`),n.setAttribute(`class`,`row`),n.textContent=e.trim(),t.appendChild(n)}),t},`drawText`),Y=e(t=>{let n,r,i;return K===`BT`?(r=e((e,t)=>e<=t,`comparisonFunc`),i=1/0):(r=e((e,t)=>e>=t,`comparisonFunc`),i=0),t.forEach(e=>{let t=K===`TB`||K==`BT`?V.get(e)?.y:V.get(e)?.x;t!==void 0&&r(t,i)&&(n=e,i=t)}),n},`findClosestParent`),Se=e(e=>{let t=``,n=1/0;return e.forEach(e=>{let r=V.get(e).y;r<=n&&(t=e,n=r)}),t||void 0},`findClosestParentBT`),Ce=e((e,t,n)=>{let r=n,i=n,a=[];e.forEach(e=>{let n=t.get(e);if(!n)throw Error(`Commit not found for key ${e}`);n.parents.length?(r=Te(n),i=Math.max(r,i)):a.push(n),Ee(n,r)}),r=i,a.forEach(e=>{De(e,r,n)}),e.forEach(e=>{let n=t.get(e);if(n?.parents.length){let e=Se(n.parents);r=V.get(e).y-M,r<=i&&(i=r);let t=B.get(n.branch).pos,a=r-j;V.set(n.id,{x:t,y:a})}})},`setParallelBTPos`),we=e(e=>{let t=Y(e.parents.filter(e=>e!==null));if(!t)throw Error(`Closest parent not found for commit ${e.id}`);let n=V.get(t)?.y;if(n===void 0)throw Error(`Closest parent position not found for commit ${e.id}`);return n},`findClosestParentPos`),Te=e(e=>we(e)+M,`calculateCommitPosition`),Ee=e((e,t)=>{let n=B.get(e.branch);if(!n)throw Error(`Branch not found for commit ${e.id}`);let r=n.pos,i=t+j;return V.set(e.id,{x:r,y:i}),{x:r,y:i}},`setCommitPosition`),De=e((e,t,n)=>{let r=B.get(e.branch);if(!r)throw Error(`Branch not found for commit ${e.id}`);let i=t+n,a=r.pos;V.set(e.id,{x:a,y:i})},`setRootPosition`),Oe=e((e,t,n,r,i,a)=>{let{theme:o}=p(),s=I.has(o??``),c=R.has(o??``),l=xe.has(o??``);if(a===x.HIGHLIGHT)e.append(`rect`).attr(`x`,n.x-10+(s?3:0)).attr(`y`,n.y-10+(s?3:0)).attr(`width`,s?14:20).attr(`height`,s?14:20).attr(`class`,`commit ${t.id} commit-highlight${z(i,F,c)} ${r}-outer`),e.append(`rect`).attr(`x`,n.x-6+(s?2:0)).attr(`y`,n.y-6+(s?2:0)).attr(`width`,s?8:12).attr(`height`,s?8:12).attr(`class`,`commit ${t.id} commit${z(i,F,c)} ${r}-inner`);else if(a===x.CHERRY_PICK)e.append(`circle`).attr(`cx`,n.x).attr(`cy`,n.y).attr(`r`,s?7:10).attr(`class`,`commit ${t.id} ${r}`),e.append(`circle`).attr(`cx`,n.x-3).attr(`cy`,n.y+2).attr(`r`,s?2.5:2.75).attr(`fill`,l?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`),e.append(`circle`).attr(`cx`,n.x+3).attr(`cy`,n.y+2).attr(`r`,s?2.5:2.75).attr(`fill`,l?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`),e.append(`line`).attr(`x1`,n.x+3).attr(`y1`,n.y+1).attr(`x2`,n.x).attr(`y2`,n.y-5).attr(`stroke`,l?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`),e.append(`line`).attr(`x1`,n.x-3).attr(`y1`,n.y+1).attr(`x2`,n.x).attr(`y2`,n.y-5).attr(`stroke`,l?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`);else{let o=e.append(`circle`);if(o.attr(`cx`,n.x),o.attr(`cy`,n.y),o.attr(`r`,s?7:10),o.attr(`class`,`commit ${t.id} commit${z(i,F,c)}`),a===x.MERGE){let a=e.append(`circle`);a.attr(`cx`,n.x),a.attr(`cy`,n.y),a.attr(`r`,s?5:6),a.attr(`class`,`commit ${r} ${t.id} commit${z(i,F,c)}`)}if(a===x.REVERSE){let a=e.append(`path`),o=s?4:5;a.attr(`d`,`M ${n.x-o},${n.y-o}L${n.x+o},${n.y+o}M${n.x-o},${n.y+o}L${n.x+o},${n.y-o}`).attr(`class`,`commit ${r} ${t.id} commit${z(i,F,c)}`)}}},`drawCommitBullet`),ke=e((e,t,n,r,i)=>{if(t.type!==x.CHERRY_PICK&&(t.customId&&t.type===x.MERGE||t.type!==x.MERGE)&&i.showCommitLabel){let a=e.append(`g`),o=a.insert(`rect`).attr(`class`,`commit-label-bkg`),s=a.append(`text`).attr(`x`,r).attr(`y`,n.y+25).attr(`class`,`commit-label`).text(t.id),c=s.node()?.getBBox();if(c&&(o.attr(`x`,n.posWithOffset-c.width/2-P).attr(`y`,n.y+13.5).attr(`width`,c.width+2*P).attr(`height`,c.height+2*P),K===`TB`||K===`BT`?(o.attr(`x`,n.x-(c.width+4*N+5)).attr(`y`,n.y-12),s.attr(`x`,n.x-(c.width+4*N)).attr(`y`,n.y+c.height-12)):s.attr(`x`,n.posWithOffset-c.width/2),i.rotateCommitLabel))if(K===`TB`||K===`BT`)s.attr(`transform`,`rotate(-45, `+n.x+`, `+n.y+`)`),o.attr(`transform`,`rotate(-45, `+n.x+`, `+n.y+`)`);else{let e=-7.5-(c.width+10)/25*9.5,t=10+c.width/25*8.5;a.attr(`transform`,`translate(`+e+`, `+t+`) rotate(-45, `+r+`, `+n.y+`)`)}}},`drawCommitLabel`),Ae=e((e,t,n,r)=>{if(t.tags.length>0){let i=0,a=0,o=0,s=[];for(let r of t.tags.reverse()){let t=e.insert(`polygon`),c=e.append(`circle`),l=e.append(`text`).attr(`y`,n.y-16-i).attr(`class`,`tag-label`).text(r),u=l.node()?.getBBox();if(!u)throw Error(`Tag bbox not found`);a=Math.max(a,u.width),o=Math.max(o,u.height),l.attr(`x`,n.posWithOffset-u.width/2),s.push({tag:l,hole:c,rect:t,yOffset:i}),i+=20}for(let{tag:e,hole:t,rect:i,yOffset:c}of s){let s=o/2,l=n.y-19.2-c;if(i.attr(`class`,`tag-label-bkg`).attr(`points`,`
2
+ ${r-a/2-N/2},${l+P}
3
+ ${r-a/2-N/2},${l-P}
4
+ ${n.posWithOffset-a/2-N},${l-s-P}
5
+ ${n.posWithOffset+a/2+N},${l-s-P}
6
+ ${n.posWithOffset+a/2+N},${l+s+P}
7
+ ${n.posWithOffset-a/2-N},${l+s+P}`),t.attr(`cy`,l).attr(`cx`,r-a/2+N/2).attr(`r`,1.5).attr(`class`,`tag-hole`),K===`TB`||K===`BT`){let o=r+c;i.attr(`class`,`tag-label-bkg`).attr(`points`,`
8
+ ${n.x},${o+2}
9
+ ${n.x},${o-2}
10
+ ${n.x+j},${o-s-2}
11
+ ${n.x+j+a+4},${o-s-2}
12
+ ${n.x+j+a+4},${o+s+2}
13
+ ${n.x+j},${o+s+2}`).attr(`transform`,`translate(12,12) rotate(45, `+n.x+`,`+r+`)`),t.attr(`cx`,n.x+N/2).attr(`cy`,o).attr(`transform`,`translate(12,12) rotate(45, `+n.x+`,`+r+`)`),e.attr(`x`,n.x+5).attr(`y`,o+3).attr(`transform`,`translate(14,14) rotate(45, `+n.x+`,`+r+`)`)}}}},`drawCommitTags`),je=e(e=>{switch(e.customType??e.type){case x.NORMAL:return`commit-normal`;case x.REVERSE:return`commit-reverse`;case x.HIGHLIGHT:return`commit-highlight`;case x.MERGE:return`commit-merge`;case x.CHERRY_PICK:return`commit-cherry-pick`;default:return`commit-normal`}},`getCommitClassType`),Me=e((e,t,n,r)=>{let i={x:0,y:0};if(e.parents.length>0){let n=Y(e.parents);if(n){let a=r.get(n)??i;return t===`TB`?a.y+M:t===`BT`?(r.get(e.id)??i).y-M:a.x+M}}else if(t===`TB`)return H;else if(t===`BT`)return(r.get(e.id)??i).y-M;else return 0;return 0},`calculatePosition`),Ne=e((e,t,n)=>{let r=K===`BT`&&n?t:t+j,i=B.get(e.branch)?.pos,a=K===`TB`||K===`BT`?B.get(e.branch)?.pos:r;if(a===void 0||i===void 0)throw Error(`Position were undefined for commit ${e.id}`);let o=I.has(p().theme??``);return{x:a,y:K===`TB`||K===`BT`?r:i+(o?L/2+1:-2),posWithOffset:r}},`getCommitPosition`),X=e((t,n,r,i)=>{let a=t.append(`g`).attr(`class`,`commit-bullets`),o=t.append(`g`).attr(`class`,`commit-labels`),s=K===`TB`||K===`BT`?H:0,c=[...n.keys()],l=i.parallelCommits??!1,u=e((e,t)=>{let r=n.get(e)?.seq,i=n.get(t)?.seq;return r!==void 0&&i!==void 0?r-i:0},`sortKeys`),d=c.sort(u);K===`BT`&&(l&&Ce(d,n,s),d=d.reverse()),d.forEach(e=>{let t=n.get(e);if(!t)throw Error(`Commit not found for key ${e}`);l&&(s=Me(t,K,s,V));let c=Ne(t,s,l);if(r){let e=je(t),n=t.customType??t.type,r=B.get(t.branch)?.index??0;Oe(a,t,c,e,r,n),ke(o,t,c,s,i),Ae(o,t,c,s)}K===`TB`||K===`BT`?V.set(t.id,{x:c.x,y:c.posWithOffset}):V.set(t.id,{x:c.posWithOffset,y:c.y}),s=K===`BT`&&l?s+M:s+M+j,s>G&&(G=s)})},`drawCommits`),Pe=e((t,n,r,i,a)=>{let o=(K===`TB`||K===`BT`?r.x<i.x:r.y<i.y)?n.branch:t.branch,s=e(e=>e.branch===o,`isOnBranchToGetCurve`),c=e(e=>e.seq>t.seq&&e.seq<n.seq,`isBetweenCommits`);return[...a.values()].some(e=>c(e)&&s(e))},`shouldRerouteArrow`),Z=e((e,t,n=0)=>{let r=e+Math.abs(e-t)/2;return n>5?r:W.every(e=>Math.abs(e-r)>=10)?(W.push(r),r):Z(e,t-Math.abs(e-t)/5,n+1)},`findLane`),Fe=e((e,t,n,r)=>{let{theme:i}=p(),a=R.has(i??``),o=V.get(t.id),s=V.get(n.id);if(o===void 0||s===void 0)throw Error(`Commit positions not found for commits ${t.id} and ${n.id}`);let c=Pe(t,n,o,s,r),l=``,u=``,d=0,f=0,m=B.get(n.branch)?.index;n.type===x.MERGE&&t.id!==n.parents[0]&&(m=B.get(t.branch)?.index);let h;if(c){l=`A 10 10, 0, 0, 0,`,u=`A 10 10, 0, 0, 1,`,d=10,f=10;let e=o.y<s.y?Z(o.y,s.y):Z(s.y,o.y),n=o.x<s.x?Z(o.x,s.x):Z(s.x,o.x);K===`TB`?o.x<s.x?h=`M ${o.x} ${o.y} L ${n-d} ${o.y} ${u} ${n} ${o.y+f} L ${n} ${s.y-d} ${l} ${n+f} ${s.y} L ${s.x} ${s.y}`:(m=B.get(t.branch)?.index,h=`M ${o.x} ${o.y} L ${n+d} ${o.y} ${l} ${n} ${o.y+f} L ${n} ${s.y-d} ${u} ${n-f} ${s.y} L ${s.x} ${s.y}`):K===`BT`?o.x<s.x?h=`M ${o.x} ${o.y} L ${n-d} ${o.y} ${l} ${n} ${o.y-f} L ${n} ${s.y+d} ${u} ${n+f} ${s.y} L ${s.x} ${s.y}`:(m=B.get(t.branch)?.index,h=`M ${o.x} ${o.y} L ${n+d} ${o.y} ${u} ${n} ${o.y-f} L ${n} ${s.y+d} ${l} ${n-f} ${s.y} L ${s.x} ${s.y}`):o.y<s.y?h=`M ${o.x} ${o.y} L ${o.x} ${e-d} ${l} ${o.x+f} ${e} L ${s.x-d} ${e} ${u} ${s.x} ${e+f} L ${s.x} ${s.y}`:(m=B.get(t.branch)?.index,h=`M ${o.x} ${o.y} L ${o.x} ${e+d} ${u} ${o.x+f} ${e} L ${s.x-d} ${e} ${l} ${s.x} ${e-f} L ${s.x} ${s.y}`)}else l=`A 20 20, 0, 0, 0,`,u=`A 20 20, 0, 0, 1,`,d=20,f=20,K===`TB`?(o.x<s.x&&(h=n.type===x.MERGE&&t.id!==n.parents[0]?`M ${o.x} ${o.y} L ${o.x} ${s.y-d} ${l} ${o.x+f} ${s.y} L ${s.x} ${s.y}`:`M ${o.x} ${o.y} L ${s.x-d} ${o.y} ${u} ${s.x} ${o.y+f} L ${s.x} ${s.y}`),o.x>s.x&&(l=`A 20 20, 0, 0, 0,`,u=`A 20 20, 0, 0, 1,`,d=20,f=20,h=n.type===x.MERGE&&t.id!==n.parents[0]?`M ${o.x} ${o.y} L ${o.x} ${s.y-d} ${u} ${o.x-f} ${s.y} L ${s.x} ${s.y}`:`M ${o.x} ${o.y} L ${s.x+d} ${o.y} ${l} ${s.x} ${o.y+f} L ${s.x} ${s.y}`),o.x===s.x&&(h=`M ${o.x} ${o.y} L ${s.x} ${s.y}`)):K===`BT`?(o.x<s.x&&(h=n.type===x.MERGE&&t.id!==n.parents[0]?`M ${o.x} ${o.y} L ${o.x} ${s.y+d} ${u} ${o.x+f} ${s.y} L ${s.x} ${s.y}`:`M ${o.x} ${o.y} L ${s.x-d} ${o.y} ${l} ${s.x} ${o.y-f} L ${s.x} ${s.y}`),o.x>s.x&&(l=`A 20 20, 0, 0, 0,`,u=`A 20 20, 0, 0, 1,`,d=20,f=20,h=n.type===x.MERGE&&t.id!==n.parents[0]?`M ${o.x} ${o.y} L ${o.x} ${s.y+d} ${l} ${o.x-f} ${s.y} L ${s.x} ${s.y}`:`M ${o.x} ${o.y} L ${s.x+d} ${o.y} ${u} ${s.x} ${o.y-f} L ${s.x} ${s.y}`),o.x===s.x&&(h=`M ${o.x} ${o.y} L ${s.x} ${s.y}`)):(o.y<s.y&&(h=n.type===x.MERGE&&t.id!==n.parents[0]?`M ${o.x} ${o.y} L ${s.x-d} ${o.y} ${u} ${s.x} ${o.y+f} L ${s.x} ${s.y}`:`M ${o.x} ${o.y} L ${o.x} ${s.y-d} ${l} ${o.x+f} ${s.y} L ${s.x} ${s.y}`),o.y>s.y&&(h=n.type===x.MERGE&&t.id!==n.parents[0]?`M ${o.x} ${o.y} L ${s.x-d} ${o.y} ${l} ${s.x} ${o.y-f} L ${s.x} ${s.y}`:`M ${o.x} ${o.y} L ${o.x} ${s.y+d} ${u} ${o.x+f} ${s.y} L ${s.x} ${s.y}`),o.y===s.y&&(h=`M ${o.x} ${o.y} L ${s.x} ${s.y}`));if(h===void 0)throw Error(`Line definition not found`);e.append(`path`).attr(`d`,h).attr(`class`,`arrow arrow`+z(m,F,a))},`drawArrow`),Ie=e((e,t)=>{let n=e.append(`g`).attr(`class`,`commit-arrows`);[...t.keys()].forEach(e=>{let r=t.get(e);r.parents&&r.parents.length>0&&r.parents.forEach(e=>{Fe(n,t.get(e),r,t)})})},`drawArrows`),Le=e((e,t,n,r)=>{let{look:i,theme:a,themeVariables:o}=p(),{dropShadow:s,THEME_COLOR_LIMIT:c}=o,l=I.has(a??``),u=R.has(a??``),d=e.append(`g`);t.forEach((e,t)=>{let a=z(t,l?c:F,u),o=B.get(e.name)?.pos;if(o===void 0)throw Error(`Position not found for branch ${e.name}`);let f=K===`TB`||K===`BT`?o:l?o+L/2+1:o-2,p=d.append(`line`);p.attr(`x1`,0),p.attr(`y1`,f),p.attr(`x2`,G),p.attr(`y2`,f),p.attr(`class`,`branch branch`+a),K===`TB`?(p.attr(`y1`,H),p.attr(`x1`,o),p.attr(`y2`,G),p.attr(`x2`,o)):K===`BT`&&(p.attr(`y1`,G),p.attr(`x1`,o),p.attr(`y2`,H),p.attr(`x2`,o)),W.push(f);let m=e.name,h=J(m),g=d.insert(`rect`),_=d.insert(`g`).attr(`class`,`branchLabel`).insert(`g`).attr(`class`,`label branch-label`+a);_.node().appendChild(h);let v=h.getBBox(),y=l?0:4,b=l?16:0,x=l?L:0;i===`neo`&&g.attr(`data-look`,`neo`),g.attr(`class`,`branchLabelBkg label`+a).attr(`style`,i===`neo`?`filter:${l?`url(#${r}-drop-shadow)`:s}`:``).attr(`rx`,y).attr(`ry`,y).attr(`x`,-v.width-4-(n.rotateCommitLabel===!0?30:0)).attr(`y`,-v.height/2+10).attr(`width`,v.width+18+b).attr(`height`,v.height+4+x),_.attr(`transform`,`translate(`+(-v.width-14-(n.rotateCommitLabel===!0?30:0)+b/2)+`, `+(f-v.height/2-2)+`)`),K===`TB`?(g.attr(`x`,o-v.width/2-10).attr(`y`,0),_.attr(`transform`,`translate(`+(o-v.width/2-5)+`, 0)`),l&&(g.attr(`transform`,`translate(${-b/2-3}, ${-x-10})`),_.attr(`transform`,`translate(`+(o-v.width/2-5)+`, `+(-x*2+7)+`)`))):K===`BT`?(g.attr(`x`,o-v.width/2-10).attr(`y`,G),_.attr(`transform`,`translate(`+(o-v.width/2-5)+`, `+G+`)`),l&&(g.attr(`transform`,`translate(${-b/2-3}, ${x+10})`),_.attr(`transform`,`translate(`+(o-v.width/2-5)+`, `+(G+x*2+4)+`)`))):g.attr(`transform`,`translate(-19, `+(f-12-x/2)+`)`)})},`drawBranches`),Re=e(function(e,t,n,r,i){return B.set(e,{pos:t,index:n}),t+=50+(i?40:0)+(K===`TB`||K===`BT`?r.width/2:0),t},`setBranchPosition`),ze={draw:e(function(e,r,i,a){q(),t.debug(`in gitgraph renderer`,e+`
14
+ `,`id:`,r,i);let s=a.db;if(!s.getConfig){t.error(`getConfig method is not available on db`);return}let c=s.getConfig(),l=c.rotateCommitLabel??!1;U=s.getCommits();let u=s.getBranchesAsObjArray();K=s.getDirection();let d=n(`[id="${r}"]`),{look:f,theme:m,themeVariables:g}=p(),{useGradient:_,gradientStart:v,gradientStop:y,filterColor:b}=g;if(_){let e=d.append(`defs`).append(`linearGradient`).attr(`id`,r+`-gradient`).attr(`gradientUnits`,`objectBoundingBox`).attr(`x1`,`0%`).attr(`y1`,`0%`).attr(`x2`,`100%`).attr(`y2`,`0%`);e.append(`stop`).attr(`offset`,`0%`).attr(`stop-color`,v).attr(`stop-opacity`,1),e.append(`stop`).attr(`offset`,`100%`).attr(`stop-color`,y).attr(`stop-opacity`,1)}f===`neo`&&I.has(m??``)&&d.append(`defs`).append(`filter`).attr(`id`,r+`-drop-shadow`).attr(`height`,`130%`).attr(`width`,`130%`).append(`feDropShadow`).attr(`dx`,`4`).attr(`dy`,`4`).attr(`stdDeviation`,0).attr(`flood-opacity`,`0.06`).attr(`flood-color`,b);let x=0;u.forEach((e,t)=>{let n=J(e.name),r=d.append(`g`),i=r.insert(`g`).attr(`class`,`branchLabel`),a=i.insert(`g`).attr(`class`,`label branch-label`);a.node()?.appendChild(n);let o=n.getBBox();x=Re(e.name,x,t,o,l),a.remove(),i.remove(),r.remove()}),X(d,U,!1,c),c.showBranches&&Le(d,u,c,r),Ie(d,U),X(d,U,!0,c),h.insertTitle(d,`gitTitleText`,c.titleTopMargin??0,s.getDiagramTitle()),o(void 0,d,c.diagramPadding,c.useMaxWidth)},`draw`)},Q=8,$=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`]),Be=new Set([`redux-color`,`redux-dark-color`]),Ve=new Set([`neo`,`neo-dark`]),He=new Set([`dark`,`redux-dark`,`redux-dark-color`,`neo-dark`]),Ue=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`,`neo`,`neo-dark`]),We=e(e=>{let{svgId:t}=e,n=``;if(e.useGradient&&t)for(let r=0;r<e.THEME_COLOR_LIMIT;r++)n+=`
15
+ .label${r} { fill: ${e.mainBkg}; stroke: url(${t}-gradient); stroke-width: ${e.strokeWidth};}
16
+ `;return n},`genGitGraphGradient`),Ge=e(e=>{let{theme:t,themeVariables:n}=c(),{borderColorArray:r}=n,i=$.has(t);if(Ve.has(t)){let t=``;for(let n=0;n<e.THEME_COLOR_LIMIT;n++)if(n===0)t+=`
17
+ .branch-label${n} { fill: ${e.nodeBorder};}
18
+ .commit${n} { stroke: ${e.nodeBorder}; }
19
+ .commit-highlight${n} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }
20
+ .arrow${n} { stroke: ${e.nodeBorder}; }
21
+ .commit-bullets { fill: ${e.nodeBorder}; }
22
+ .commit-cherry-pick${n} { stroke: ${e.nodeBorder}; }
23
+ ${We(e)}`;else{let r=n%Q;t+=`
24
+ .branch-label${n} { fill: ${e[`gitBranchLabel`+r]}; }
25
+ .commit${n} { stroke: ${e[`git`+r]}; fill: ${e[`git`+r]}; }
26
+ .commit-highlight${n} { stroke: ${e[`gitInv`+r]}; fill: ${e[`gitInv`+r]}; }
27
+ .arrow${n} { stroke: ${e[`git`+r]}; }
28
+ `}return t}else if(Be.has(t)){let n=``;for(let a=0;a<e.THEME_COLOR_LIMIT;a++)if(a===0)n+=`
29
+ .branch-label${a} { fill: ${e.nodeBorder}; ${i?`font-weight:${e.noteFontWeight}`:``} }
30
+ .commit${a} { stroke: ${e.nodeBorder}; }
31
+ .commit-highlight${a} { stroke: ${e.nodeBorder}; fill: ${e.mainBkg}; }
32
+ .label${a} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${i?`font-weight:${e.noteFontWeight}`:``} }
33
+ .arrow${a} { stroke: ${e.nodeBorder}; }
34
+ .commit-bullets { fill: ${e.nodeBorder}; }
35
+ `;else{let o=a%r.length;n+=`
36
+ .branch-label${a} { fill: ${e.nodeBorder}; ${i?`font-weight:${e.noteFontWeight}`:``} }
37
+ .commit${a} { stroke: ${r[o]}; fill: ${r[o]}; }
38
+ .commit-highlight${a} { stroke: ${r[o]}; fill: ${r[o]}; }
39
+ .label${a} { fill: ${He.has(t)?e.mainBkg:r[o]}; stroke: ${r[o]}; stroke-width: ${e.strokeWidth}; }
40
+ .arrow${a} { stroke: ${r[o]}; }
41
+ `}return n}else{let t=``;for(let n=0;n<e.THEME_COLOR_LIMIT;n++)t+=`
42
+ .branch-label${n} { fill: ${e.nodeBorder}; ${i?`font-weight:${e.noteFontWeight}`:``} }
43
+ .commit${n} { stroke: ${e.nodeBorder}; }
44
+ .commit-highlight${n} { stroke: ${e.nodeBorder}; fill: ${e.nodeBorder}; }
45
+ .label${n} { fill: ${e.mainBkg}; stroke: ${e.nodeBorder}; stroke-width: ${e.strokeWidth}; ${i?`font-weight:${e.noteFontWeight}`:``}}
46
+ .arrow${n} { stroke: ${e.nodeBorder}; }
47
+ .commit-bullets { fill: ${e.nodeBorder}; }
48
+ .commit-cherry-pick${n} { stroke: ${e.nodeBorder}; }
49
+ `;return t}},`genColor`),Ke=e(e=>`${Array.from({length:e.THEME_COLOR_LIMIT},(e,t)=>t).map(t=>{let n=t%Q;return`
50
+ .branch-label${t} { fill: ${e[`gitBranchLabel`+n]}; }
51
+ .commit${t} { stroke: ${e[`git`+n]}; fill: ${e[`git`+n]}; }
52
+ .commit-highlight${t} { stroke: ${e[`gitInv`+n]}; fill: ${e[`gitInv`+n]}; }
53
+ .label${t} { fill: ${e[`git`+n]}; }
54
+ .arrow${t} { stroke: ${e[`git`+n]}; }
55
+ `}).join(`
56
+ `)}`,`normalTheme`),qe={parser:be,db:A,renderer:ze,styles:e(e=>{let{theme:t}=c(),n=Ue.has(t);return`
57
+ .commit-id,
58
+ .commit-msg,
59
+ .branch-label {
60
+ fill: lightgrey;
61
+ color: lightgrey;
62
+ font-family: 'trebuchet ms', verdana, arial, sans-serif;
63
+ font-family: var(--mermaid-font-family);
64
+ }
65
+
66
+ ${n?Ge(e):Ke(e)}
67
+
68
+ .branch {
69
+ stroke-width: ${e.strokeWidth};
70
+ stroke: ${e.commitLineColor??e.lineColor};
71
+ stroke-dasharray: ${n?`4 2`:`2`};
72
+ }
73
+ .commit-label { font-size: ${e.commitLabelFontSize}; fill: ${n?e.nodeBorder:e.commitLabelColor}; ${n?`font-weight:${e.noteFontWeight};`:``}}
74
+ .commit-label-bkg { font-size: ${e.commitLabelFontSize}; fill: ${n?`transparent`:e.commitLabelBackground}; opacity: ${n?``:.5}; }
75
+ .tag-label { font-size: ${e.tagLabelFontSize}; fill: ${e.tagLabelColor};}
76
+ .tag-label-bkg { fill: ${n?e.mainBkg:e.tagLabelBackground}; stroke: ${n?e.nodeBorder:e.tagLabelBorder}; ${n?`filter:${e.dropShadow}`:``} }
77
+ .tag-hole { fill: ${e.textColor}; }
78
+
79
+ .commit-merge {
80
+ stroke: ${n?e.mainBkg:e.primaryColor};
81
+ fill: ${n?e.mainBkg:e.primaryColor};
82
+ }
83
+ .commit-reverse {
84
+ stroke: ${n?e.mainBkg:e.primaryColor};
85
+ fill: ${n?e.mainBkg:e.primaryColor};
86
+ stroke-width: ${n?e.strokeWidth:3};
87
+ }
88
+ .commit-highlight-outer {
89
+ }
90
+ .commit-highlight-inner {
91
+ stroke: ${n?e.mainBkg:e.primaryColor};
92
+ fill: ${n?e.mainBkg:e.primaryColor};
93
+ }
94
+
95
+ .arrow {
96
+ /* Intentional: neo themes keep the bold 8px arrow (like classic themes); only redux-geometry themes use the thinner options.strokeWidth. */
97
+ stroke-width: ${$.has(t)?e.strokeWidth:8};
98
+ stroke-linecap: round;
99
+ fill: none
100
+ }
101
+ .gitTitleText {
102
+ text-anchor: middle;
103
+ font-size: 18px;
104
+ fill: ${e.textColor};
105
+ }
106
+ `},`getStyles`)};export{qe as diagram};