@marimo-team/frontend 0.16.0-dev96986 → 0.16.1

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 (128) hide show
  1. package/dist/assets/{ConnectedDataExplorerComponent-CNLoZkWr.js → ConnectedDataExplorerComponent-2wVcyvDj.js} +1 -1
  2. package/dist/assets/{ImageComparisonComponent-SX7fDaTK.js → ImageComparisonComponent-D2j6i0hv.js} +1 -1
  3. package/dist/assets/{VegaLite-MJUW3b7C.js → VegaLite-BckFaf2D.js} +1 -1
  4. package/dist/assets/{_baseEach-9_logFrf.js → _baseEach-CvTX9w0Y.js} +1 -1
  5. package/dist/assets/_baseMap-CtlwA90f.js +1 -0
  6. package/dist/assets/{_baseUniq-C5LFcyNC.js → _baseUniq-BKktIGQ1.js} +1 -1
  7. package/dist/assets/{_createAggregator-ZRm2b6Zm.js → _createAggregator-C5CVY-0t.js} +1 -1
  8. package/dist/assets/{agent-panel-BBd11wNX.js → agent-panel-RGLNjkYe.js} +1 -1
  9. package/dist/assets/{any-language-editor-DwAaEQfS.js → any-language-editor-DjuXwGCA.js} +1 -1
  10. package/dist/assets/{architectureDiagram-W76B3OCA-BJmVXUoW.js → architectureDiagram-W76B3OCA-Dyj4ds_R.js} +1 -1
  11. package/dist/assets/{between-horizontal-start-KiwU-a3C.js → between-horizontal-start-Dt2aKpPf.js} +1 -1
  12. package/dist/assets/{blockDiagram-QIGZ2CNN-DzxZjE7B.js → blockDiagram-QIGZ2CNN-o-i7DDvN.js} +1 -1
  13. package/dist/assets/{c4Diagram-FPNF74CW-DjmldG_J.js → c4Diagram-FPNF74CW-DGHEwWrx.js} +1 -1
  14. package/dist/assets/channel-Co6iMgWq.js +1 -0
  15. package/dist/assets/{chat-panel-DgJZr0eS.js → chat-panel-9alr8FS4.js} +1 -1
  16. package/dist/assets/{chunk-4BX2VUAB-EUTQThiZ.js → chunk-4BX2VUAB-BJecb-Ri.js} +1 -1
  17. package/dist/assets/{chunk-55IACEB6-DZAiDJxy.js → chunk-55IACEB6-CAATkc4w.js} +1 -1
  18. package/dist/assets/{chunk-FMBD7UC4-Bd0Czs-J.js → chunk-FMBD7UC4-DPuNbQ-f.js} +1 -1
  19. package/dist/assets/{chunk-K7UQS3LO-DEKMIknX.js → chunk-K7UQS3LO-C8TWVLiH.js} +1 -1
  20. package/dist/assets/{chunk-QN33PNHL-E0jwHU_n.js → chunk-QN33PNHL-DiZZ09q4.js} +1 -1
  21. package/dist/assets/{chunk-QZHKN3VN-BzaIHJbq.js → chunk-QZHKN3VN-BIUM7usu.js} +1 -1
  22. package/dist/assets/{chunk-TVAH2DTR-CZFYvqnm.js → chunk-TVAH2DTR-vGTArPBG.js} +1 -1
  23. package/dist/assets/{chunk-TZMSLE5B-BNqnFjtv.js → chunk-TZMSLE5B-D2KRqp_x.js} +1 -1
  24. package/dist/assets/{circle-play-D3J_mYrF.js → circle-play-cjeNez0N.js} +1 -1
  25. package/dist/assets/classDiagram-KNZD7YFC-BbJ0rY3y.js +1 -0
  26. package/dist/assets/classDiagram-v2-RKCZMP56-BbJ0rY3y.js +1 -0
  27. package/dist/assets/{clear-button-ifzRuAR3.js → clear-button-C97JtAez.js} +1 -1
  28. package/dist/assets/clone-BMP0PsTa.js +1 -0
  29. package/dist/assets/{command-palette-D2fdVSET.js → command-palette-B93Pjcky.js} +1 -1
  30. package/dist/assets/{common-Ku-cF_2J.js → common-Du9rSOwD.js} +1 -1
  31. package/dist/assets/{compile-BgZlHW1c.js → compile-CZXqyOxa.js} +1 -1
  32. package/dist/assets/{cose-bilkent-S5V4N54A-CVM83SqK.js → cose-bilkent-S5V4N54A-CqUN5Y9b.js} +1 -1
  33. package/dist/assets/{dagre-5GWH7T2D-ouQPkxT3.js → dagre-5GWH7T2D-RJqTI9DM.js} +1 -1
  34. package/dist/assets/{data-grid-overlay-editor-B47j5GJJ.js → data-grid-overlay-editor-DZN0q1LV.js} +1 -1
  35. package/dist/assets/{datasources-panel-Bt41Zir-.js → datasources-panel-v7H3cR0p.js} +1 -1
  36. package/dist/assets/{dependency-graph-panel-CZC_B7pK.js → dependency-graph-panel-CEog_O7V.js} +1 -1
  37. package/dist/assets/{diagram-N5W7TBWH-CQ817ZdR.js → diagram-N5W7TBWH-D-l4zZ9d.js} +1 -1
  38. package/dist/assets/{diagram-QEK2KX5R-DOK_psUO.js → diagram-QEK2KX5R-CCOmBUt-.js} +1 -1
  39. package/dist/assets/{diagram-S2PKOQOG-CVljmOW8.js → diagram-S2PKOQOG-C_I_9jnZ.js} +1 -1
  40. package/dist/assets/{documentation-panel-C7yIvGg1.js → documentation-panel-C1BtMZ3M.js} +1 -1
  41. package/dist/assets/{edit-page-CyTMQV2u.js → edit-page-B-oevUZ9.js} +3 -3
  42. package/dist/assets/{ellipsis-vertical-C7FjlUsY.js → ellipsis-vertical-BEb-J8z6.js} +1 -1
  43. package/dist/assets/{empty-state-DIOGM_CU.js → empty-state-C99UyDE3.js} +1 -1
  44. package/dist/assets/{erDiagram-AWTI2OKA-DYu8cEdc.js → erDiagram-AWTI2OKA-BePOLi5M.js} +1 -1
  45. package/dist/assets/{error-panel-Ddb8RkFG.js → error-panel-Bs34jXFh.js} +1 -1
  46. package/dist/assets/{file-explorer-panel-Oy9DbyFP.js → file-explorer-panel-Ck6UL861.js} +1 -1
  47. package/dist/assets/{flowDiagram-PVAE7QVJ-CmvW5iTb.js → flowDiagram-PVAE7QVJ-BgjFu5l7.js} +1 -1
  48. package/dist/assets/{ganttDiagram-OWAHRB6G-BaKQlCaT.js → ganttDiagram-OWAHRB6G-YOPb3XSV.js} +1 -1
  49. package/dist/assets/{gitGraphDiagram-NY62KEGX-CWO24eP6.js → gitGraphDiagram-NY62KEGX-CGhqaDTy.js} +1 -1
  50. package/dist/assets/{glide-data-editor-CNDLEJ9a.js → glide-data-editor-9QUH6iso.js} +4 -4
  51. package/dist/assets/{graph-BZKTtxsc.js → graph-DQQFGrho.js} +1 -1
  52. package/dist/assets/{home-page-Bvwppn9N.js → home-page-DRKpPCrF.js} +1 -1
  53. package/dist/assets/{index-CZaurnA9.js → index-2252nrk6.js} +1 -1
  54. package/dist/assets/{index-BJVyzkx5.js → index-Aeo6WiK7.js} +1 -1
  55. package/dist/assets/{index-0XOUPdwT.js → index-B8jXZ12t.js} +1 -1
  56. package/dist/assets/{index-WXJFkQHg.js → index-BAbIIxHU.js} +1 -1
  57. package/dist/assets/{index-Brf2DwUM.js → index-BJNCMUmG.js} +1 -1
  58. package/dist/assets/{index-D-tZfElD.js → index-BW3k9Gss.js} +1 -1
  59. package/dist/assets/{index-DkntzpX4.js → index-BjgnbONl.js} +1 -1
  60. package/dist/assets/{index-BH7f3aiU.js → index-BprjMYH5.js} +1 -1
  61. package/dist/assets/{index-zrSUQXha.js → index-C1ez98sk.js} +1 -1
  62. package/dist/assets/{index-D3PqGupX.js → index-C2MD0vgD.js} +1 -1
  63. package/dist/assets/{index-PmY0x4Zd.js → index-C7CoaNFb.js} +124 -124
  64. package/dist/assets/{index-DZhOPkOB.js → index-CFKO7WXI.js} +1 -1
  65. package/dist/assets/{index-qE8lHQ-N.js → index-CUFv_thQ.js} +1 -1
  66. package/dist/assets/{index-CXrWwFX6.js → index-C_tkBKNO.js} +1 -1
  67. package/dist/assets/{index-B_d_JZGI.js → index-CfaDbEdi.js} +1 -1
  68. package/dist/assets/{index-BgXbBA39.js → index-ClzeQrN7.js} +1 -1
  69. package/dist/assets/{index-DCkzth56.js → index-DdnKZNxM.js} +1 -1
  70. package/dist/assets/{index-DFrGFNW1.js → index-G5QZppK2.js} +1 -1
  71. package/dist/assets/{index-DmgwT3sx.js → index-SGLNXrGP.js} +1 -1
  72. package/dist/assets/{index-CerjupfZ.js → index-aE43R74q.js} +1 -1
  73. package/dist/assets/infoDiagram-STP46IZ2-CJLOpSAf.js +2 -0
  74. package/dist/assets/{isEmpty-D1t7Gran.js → isEmpty-D-4c7sMv.js} +1 -1
  75. package/dist/assets/{journeyDiagram-BIP6EPQ6-D4Rp6H_h.js → journeyDiagram-BIP6EPQ6-C94u3Mv3.js} +1 -1
  76. package/dist/assets/{kanban-definition-6OIFK2YF-DFt9DftA.js → kanban-definition-6OIFK2YF-BEXYFzz7.js} +1 -1
  77. package/dist/assets/{layout-D8WXi2_g.js → layout-Bz2BJ2ru.js} +1 -1
  78. package/dist/assets/{linear-BwY8e5hA.js → linear-D8s7K76e.js} +1 -1
  79. package/dist/assets/{links-4B6ldZ5P.js → links-BpXlz1GG.js} +1 -1
  80. package/dist/assets/{logs-panel-Dxiyt7dO.js → logs-panel-DC7wpmPz.js} +1 -1
  81. package/dist/assets/{markdown-renderer-VDu-NBKB.js → markdown-renderer-DRdSWR9X.js} +3 -3
  82. package/dist/assets/{mermaid-B-O-Puyi.js → mermaid-Y3x4hmD0.js} +1 -1
  83. package/dist/assets/{mermaid.core-BFFCqfOn.js → mermaid.core-DzthE35Y.js} +4 -4
  84. package/dist/assets/{min-DtVSfYKl.js → min-BBO3-1Hg.js} +1 -1
  85. package/dist/assets/{mindmap-definition-Q6HEUPPD-kyvIY8Dg.js → mindmap-definition-Q6HEUPPD-DktvuLe1.js} +1 -1
  86. package/dist/assets/{number-overlay-editor-GjLB2UK4.js → number-overlay-editor-BEfwI1IT.js} +1 -1
  87. package/dist/assets/{outline-panel-CMJjOoN7.js → outline-panel-CdsnAy2w.js} +1 -1
  88. package/dist/assets/{packages-panel-nfXB-bKW.js → packages-panel-DiTA-d_D.js} +1 -1
  89. package/dist/assets/{pieDiagram-ADFJNKIX-D8JFQcWR.js → pieDiagram-ADFJNKIX-DQDNQ-de.js} +1 -1
  90. package/dist/assets/{quadrantDiagram-LMRXKWRM-Nf8GzxXG.js → quadrantDiagram-LMRXKWRM-0kgIXc2-.js} +1 -1
  91. package/dist/assets/{react-plotly-CnW9p7ZA.js → react-plotly-DJqqfM7c.js} +1 -1
  92. package/dist/assets/{requirementDiagram-4UW4RH46-CCUxF8BZ.js → requirementDiagram-4UW4RH46-B5rb0ypd.js} +1 -1
  93. package/dist/assets/{run-page-Bl4p3AbZ.js → run-page-CFmLrv1R.js} +1 -1
  94. package/dist/assets/{sankeyDiagram-GR3RE2ED-Sr8kDwP1.js → sankeyDiagram-GR3RE2ED-Dom7IlnF.js} +1 -1
  95. package/dist/assets/{scratchpad-panel-Ja1Mu-W3.js → scratchpad-panel-CuHWpHO8.js} +1 -1
  96. package/dist/assets/{secrets-panel-B-3fcSyP.js → secrets-panel-CfHc5YD0.js} +1 -1
  97. package/dist/assets/{sequenceDiagram-C3RYC4MD-CBJ152Q3.js → sequenceDiagram-C3RYC4MD-PNJWXQbw.js} +1 -1
  98. package/dist/assets/{slides-component-DGtsVP5o.js → slides-component-CJgaTRZ0.js} +1 -1
  99. package/dist/assets/{snippets-panel-ClNnwKBM.js → snippets-panel-B2EC1txM.js} +1 -1
  100. package/dist/assets/{sortBy-D47H6Vyl.js → sortBy-DZnlX29-.js} +1 -1
  101. package/dist/assets/{state-B_RCHTH5.js → state-CWict9RU.js} +1 -1
  102. package/dist/assets/{stateDiagram-KXAO66HF-BlBFSAZr.js → stateDiagram-KXAO66HF-BE58aJnr.js} +1 -1
  103. package/dist/assets/stateDiagram-v2-UMBNRL4Z-CdThjimL.js +1 -0
  104. package/dist/assets/{storage-BNcWOH3-.js → storage-DRaR04wR.js} +3 -3
  105. package/dist/assets/{terminal-CATzv5Hd.js → terminal-BX3Su5q7.js} +1 -1
  106. package/dist/assets/{time-CsYqILfB.js → time-hUzZfpNE.js} +1 -1
  107. package/dist/assets/{timeline-definition-XQNQX7LJ-CGrhjuAs.js → timeline-definition-XQNQX7LJ-CqQP9t51.js} +1 -1
  108. package/dist/assets/{tracing-DUbJtOyq.js → tracing-B10Q1n-L.js} +2 -2
  109. package/dist/assets/{tracing-panel-DmzqPUtc.js → tracing-panel-Du8WCnno.js} +2 -2
  110. package/dist/assets/{trash-rxdjLzkf.js → trash-B81GTiv6.js} +1 -1
  111. package/dist/assets/{tree-C2Ul1h1C.js → tree-6vW2ogkh.js} +1 -1
  112. package/dist/assets/{treemap-75Q7IDZK-N9hyUpyj.js → treemap-75Q7IDZK-CdwDwwsz.js} +1 -1
  113. package/dist/assets/{variable-panel-BbgupOdG.js → variable-panel-D5qgJI7k.js} +1 -1
  114. package/dist/assets/{vega-component-CR_MHOBT.js → vega-component-DJaJWMJM.js} +1 -1
  115. package/dist/assets/{xychartDiagram-6GGTOJPD-jdLZsMb2.js → xychartDiagram-6GGTOJPD-WFtXqaM9.js} +1 -1
  116. package/dist/index.html +1 -1
  117. package/package.json +1 -1
  118. package/src/core/ai/staged-cells.ts +34 -1
  119. package/src/core/cells/__tests__/add-missing-import.test.ts +67 -22
  120. package/src/core/cells/add-missing-import.ts +24 -7
  121. package/src/core/cells/cells.ts +26 -27
  122. package/dist/assets/_baseMap-NzEbKt5c.js +0 -1
  123. package/dist/assets/channel-DHcKBVM4.js +0 -1
  124. package/dist/assets/classDiagram-KNZD7YFC-D-xwLnlX.js +0 -1
  125. package/dist/assets/classDiagram-v2-RKCZMP56-D-xwLnlX.js +0 -1
  126. package/dist/assets/clone-CSxIll62.js +0 -1
  127. package/dist/assets/infoDiagram-STP46IZ2-CAuVVehw.js +0 -2
  128. package/dist/assets/stateDiagram-v2-UMBNRL4Z-DbA-iToo.js +0 -1
@@ -1,4 +1,4 @@
1
- import{c as r,a as d,ao as o,j as t,ap as p,aq as h}from"./index-PmY0x4Zd.js";import{P as m}from"./empty-state-DIOGM_CU.js";/**
1
+ import{c as r,a as d,ao as o,j as t,ap as p,aq as h}from"./index-C7CoaNFb.js";import{P as m}from"./empty-state-C99UyDE3.js";/**
2
2
  * @license lucide-react v0.542.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{c as T,u as Ze,ax as ae,K as Xe,cs as Ge,r as P,b as fe,j as a,E as xe,aA as Z,aB as D,e8 as se,b4 as ue,a8 as ge,$ as X,cO as Je,eU as Qe,eV as et,eW as tt,eX as at,eY as st,bS as it,p as nt,eZ as rt,e_ as ot,e$ as lt,b3 as je,cP as ct,f0 as ie,a0 as O,e5 as dt,ba as ht,av as ye,f1 as pt,f2 as mt,a as M,f3 as ft,L as xt,f4 as ut,d as gt,cp as be,X as ve,cM as z,a1 as jt,a_ as V,f5 as yt,e6 as bt,S as vt,by as kt,f6 as wt,T as ne,e7 as Ft,d$ as Ct,dZ as _t,aG as Nt,aH as St,f7 as Pt,eg as Dt,e0 as Ot,dY as C,f8 as L,f9 as ke,fa as Mt,fb as zt,e9 as At,c6 as Rt,__tla as Wt}from"./index-PmY0x4Zd.js";import{e as G,o as It}from"./links-4B6ldZ5P.js";import{m as Et}from"./icon-32x32-DHZerVul.js";import{h as Bt,i as Ht,F as we,__tla as $t}from"./edit-page-CyTMQV2u.js";import{S as re,T as qt}from"./tree-C2Ul1h1C.js";import{E as Tt}from"./ellipsis-vertical-C7FjlUsY.js";import{B as Vt}from"./between-horizontal-start-KiwU-a3C.js";import{__tla as Lt}from"./storage-BNcWOH3-.js";import"./index-BJVyzkx5.js";import"./index-B_d_JZGI.js";import"./index-DkntzpX4.js";import"./index-qE8lHQ-N.js";import"./index-DCkzth56.js";import"./index-CXrWwFX6.js";import"./index-Brf2DwUM.js";import"./index-DZhOPkOB.js";import"./index-CerjupfZ.js";import"./index-WXJFkQHg.js";import"./index-BgXbBA39.js";import"./index-DFrGFNW1.js";import"./index-D3PqGupX.js";import"./apl-CXdQSnD-.js";import"./asciiarmor-D5V0T9Cu.js";import"./asn1-DWPaVWf6.js";import"./brainfuck-CtZaYBKt.js";import"./cobol-stawOqaz.js";import"./clike-BgBwzOhw.js";import"./clojure-DiuoqK-z.js";import"./css-ZjFoif2m.js";import"./cmake-DXn5xaP-.js";import"./coffeescript-BTDxI-eT.js";import"./commonlisp-vq6DHwts.js";import"./cypher-gJDei3ni.js";import"./python-DD-Q2bae.js";import"./crystal-CRzZ78HM.js";import"./d-BShv7fp-.js";import"./diff-UJJ5BM9S.js";import"./dtd-DI9Herc-.js";import"./dylan-DkEP81N9.js";import"./ecl-DPFc0Uaf.js";import"./eiffel-DR5c0IrL.js";import"./elm-DompmV0j.js";import"./erlang-BuqgqA5h.js";import"./factor-CFXhaUWb.js";import"./simple-mode-C3vEBAcb.js";import"./forth-POgR1ypr.js";import"./fortran-DL7KluxX.js";import"./mllike-3c2dg9RT.js";import"./gas-bV0CklSb.js";import"./gherkin-B6X1vGSW.js";import"./groovy-DnIzCrpZ.js";import"./haskell-CLQs6EAM.js";import"./haxe-D25e-2l-.js";import"./idl-pcmmZuaN.js";import"./javascript-BpzJj0-u.js";import"./jinja2-DhgKlfW7.js";import"./julia-DjdwvFuI.js";import"./livescript-HO6ttBFx.js";import"./lua-8DXOpKDz.js";import"./mirc-DkvFAiy5.js";import"./mathematica-IIbmv7SK.js";import"./modelica-DSrSSXCg.js";import"./mumps-zvxmGV4l.js";import"./mbox-z_N2Mo3d.js";import"./nsis-BvKfQ9lQ.js";import"./ntriples-BSwWqoLa.js";import"./octave-C4hdQ5Hf.js";import"./oz-qQq7irPq.js";import"./pascal-CafrKXZF.js";import"./perl-tdMlh9QA.js";import"./pig-CwGJVRC4.js";import"./powershell-D1ly3AHC.js";import"./properties-_nPj978X.js";import"./protobuf-B4y9do6W.js";import"./pug-BTvK5tSS.js";import"./puppet-Bc-yJKzi.js";import"./q-B0kTJ4cI.js";import"./r-BA4EbLKE.js";import"./rpm-DI_rRufH.js";import"./ruby-CR-u2WLS.js";import"./sas-Bqaci40L.js";import"./scheme-qjP0V5Ag.js";import"./shell-BLav31RL.js";import"./sieve-r025o_jW.js";import"./smalltalk-C7J3IyEP.js";import"./sparql-BRLJFz69.js";import"./stylus-Bdo_Aemu.js";import"./swift-B_XXVlXX.js";import"./verilog-B4LBqg_1.js";import"./tcl-B2fODqDH.js";import"./textile-BuVhTOzU.js";import"./toml-wcPdHu67.js";import"./troff-Ce85hlLp.js";import"./ttcn-BxnYHtq8.js";import"./ttcn-cfg-CKJxb-l2.js";import"./turtle-BkSuIpt-.js";import"./webidl-CGwyPRYs.js";import"./vb-BHgjm0DN.js";import"./vbscript-Dawdd5GZ.js";import"./velocity-BdD_26Jv.js";import"./vhdl-CWWH2SUo.js";import"./xquery-CVDBqZPY.js";import"./yacas-I8QjZlxf.js";import"./z80-D8p3gKXp.js";import"./mscgen-B2igx18G.js";import"./index-zrSUQXha.js";import"./trash-rxdjLzkf.js";import"./_createAggregator-ZRm2b6Zm.js";import"./_baseEach-9_logFrf.js";import{__tla as Ut}from"./loro_wasm_bg-C1ks32Vm.js";import"./index-0XOUPdwT.js";let Fe,Kt=Promise.all([(()=>{try{return Wt}catch{}})(),(()=>{try{return $t}catch{}})(),(()=>{try{return Lt}catch{}})(),(()=>{try{return Ut}catch{}})()]).then(async()=>{const Ce=T("copy-minus",[["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),oe=T("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]),le=T("list-tree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]),_e=T("pen-line",[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]),Ne=T("square-play",[["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}]]),Se=T("view",[["path",{d:"M21 17v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2",key:"mrq65r"}],["path",{d:"M21 7V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2",key:"be3xqs"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0",key:"11ak4c"}]]),J=new Map,Pe=({file:t,onOpenNotebook:e})=>{const{theme:s}=Ze(),{sendFileDetails:r,sendUpdateFile:i}=ae(),o=Xe(Ge),[l,m]=P.useState(""),{data:n,isPending:u,error:f,setData:x}=fe(async()=>{const g=await r({path:t.path}),c=g.contents||"";return m(J.get(t.path)||c),g},[t.path]),d=async()=>{l!==(n==null?void 0:n.contents)&&await i({path:t.path,contents:l}).then(g=>{g.success&&(x(c=>({...c,contents:l})),m(l))})},j=P.useRef(l);if(j.current=l,P.useEffect(()=>()=>{if(!(n!=null&&n.contents))return;const g=j.current;g===n.contents?J.delete(t.path):J.set(t.path,g)},[t.path,n==null?void 0:n.contents]),f)return a.jsx(xe,{error:f});if(u||!n)return null;const h=n.mimeType||"text/plain",w=h in Q;if(!n.contents&&!w)return a.jsxs("div",{className:"grid grid-cols-2 gap-2 p-6",children:[a.jsx("div",{className:"font-bold text-muted-foreground",children:"Name"}),a.jsx("div",{children:n.file.name}),a.jsx("div",{className:"font-bold text-muted-foreground",children:"Type"}),a.jsx("div",{children:h})]});const b=a.jsxs("div",{className:"text-xs text-muted-foreground p-1 flex justify-end gap-2 border-b",children:[t.isMarimoFile&&!Z()&&a.jsx(D,{content:"Open notebook",children:a.jsx(G,{size:"small",onClick:g=>e(g),children:a.jsx(se,{})})}),a.jsx(D,{content:"Download",children:a.jsx(G,{size:"small",onClick:()=>{if(ce(h)){const g=ot(n.contents,h);return void lt(g,n.file.name)}je(new Blob([n.contents||l],{type:h}),n.file.name)},children:a.jsx(ue,{})})}),!ce(h)&&a.jsxs(a.Fragment,{children:[a.jsx(D,{content:"Copy contents to clipboard",children:a.jsx(G,{size:"small",onClick:async()=>{await X(l)},children:a.jsx(ge,{})})}),a.jsx(D,{content:Je("global.save"),children:a.jsx(G,{size:"small",color:l===n.contents?void 0:"green",onClick:d,disabled:l===n.contents,children:a.jsx(Bt,{})})})]})]});return h.startsWith("image/")?a.jsxs(a.Fragment,{children:[b,a.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:a.jsx(Qe,{base64:n.contents,mime:h})})]}):h==="text/csv"&&n.contents?a.jsxs(a.Fragment,{children:[b,a.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:a.jsx(et,{contents:n.contents})})]}):h.startsWith("audio/")?a.jsxs(a.Fragment,{children:[b,a.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:a.jsx(tt,{base64:n.contents,mime:h})})]}):h.startsWith("video/")?a.jsxs(a.Fragment,{children:[b,a.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:a.jsx(at,{base64:n.contents,mime:h})})]}):h.startsWith("application/pdf")?a.jsxs(a.Fragment,{children:[b,a.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:a.jsx(st,{base64:n.contents,mime:h})})]}):a.jsxs(a.Fragment,{children:[b,a.jsx("div",{className:"flex-1 overflow-auto",children:a.jsx(P.Suspense,{children:a.jsx(it,{theme:s==="dark"?"dark":"light",language:Q[h]||Q.default,className:"border-b",extensions:[nt.lineWrapping,rt.of([{key:o.getHotkey("global.save").key,stopPropagation:!0,run:()=>l!==n.contents&&(d(),!0)}])],value:l,onChange:m})})})]})},ce=t=>t.startsWith("image/")||t.startsWith("audio/")||t.startsWith("video/")||t.startsWith("application/pdf"),Q={"application/javascript":"javascript","text/markdown":"markdown","text/html":"html","text/css":"css","text/x-python":"python","application/json":"json","application/xml":"xml","text/x-yaml":"yaml","text/csv":"markdown","text/plain":"markdown",default:"markdown"};class De{constructor(e){this.delegate=new re([]),this.callbacks=void 0,this.rootPath="",this.onChange=ct.NOOP,this.path=new ie("/"),this.initialize=async s=>{if(this.onChange=s,this.delegate.data.length===0)try{const r=await this.callbacks.listFiles({path:this.rootPath});this.delegate=new re(r.files),this.rootPath=r.root,this.path=ie.guessDeliminator(r.root)}catch(r){O({title:"Failed",description:dt(r)})}this.onChange(this.delegate.data)},this.refreshAll=async s=>{const r=[this.rootPath,...s.map(o=>{var l;return(l=this.delegate.find(o))==null?void 0:l.data.path})].filter(Boolean),i=await Promise.all(r.map(o=>this.callbacks.listFiles({path:o}).catch(()=>({files:[]}))));for(const[o,l]of r.entries()){const m=i[o];l===this.rootPath?this.delegate=new re(m.files):this.delegate.update({id:l,changes:{children:m.files}})}this.onChange(this.delegate.data)},this.relativeFromRoot=s=>{const r=this.rootPath.endsWith(this.path.deliminator)?this.rootPath:`${this.rootPath}${this.path.deliminator}`;return s.startsWith(r)?s.slice(r.length):s},this.handleResponse=s=>s.success?s:(O({title:"Failed",description:s.message}),null),this.callbacks=e}async expand(e){const s=this.delegate.find(e);if(!s||!s.data.isDirectory)return!1;if(s.children&&s.children.length>0)return!0;const r=await this.callbacks.listFiles({path:s.data.path});return this.delegate.update({id:e,changes:{children:r.files}}),this.onChange(this.delegate.data),!0}async rename(e,s){const r=this.delegate.find(e);if(!r)return;const i=r.data.path,o=this.path.join(this.path.dirname(i),s);await this.callbacks.renameFileOrFolder({path:i,newPath:o}).then(this.handleResponse),this.delegate.update({id:e,changes:{name:s,path:o}}),this.onChange(this.delegate.data),await this.refreshAll([o])}async move(e,s){var i;const r=s?((i=this.delegate.find(s))==null?void 0:i.data.path)??s:this.rootPath;await Promise.all(e.map(o=>{this.delegate.move({id:o,parentId:s,index:0});const l=this.delegate.find(o);if(!l)return Promise.resolve();const m=this.path.join(r,this.path.basename(l.data.path));return this.delegate.update({id:o,changes:{path:m}}),this.callbacks.renameFileOrFolder({path:l.data.path,newPath:m}).then(this.handleResponse)})),this.onChange(this.delegate.data),await this.refreshAll([r])}async createFile(e,s){var o;const r=s?((o=this.delegate.find(s))==null?void 0:o.data.path)??s:this.rootPath,i=await this.callbacks.createFileOrFolder({path:r,type:"file",name:e}).then(this.handleResponse);i!=null&&i.info&&(this.delegate.create({parentId:s,index:0,data:i.info}),this.onChange(this.delegate.data),await this.refreshAll([r]))}async createFolder(e,s){var o;const r=s?((o=this.delegate.find(s))==null?void 0:o.data.path)??s:this.rootPath,i=await this.callbacks.createFileOrFolder({path:r,type:"directory",name:e}).then(this.handleResponse);i!=null&&i.info&&(this.delegate.create({parentId:s,index:0,data:i.info}),this.onChange(this.delegate.data),await this.refreshAll([r]))}async delete(e){const s=this.delegate.find(e);s&&(await this.callbacks.deleteFileOrFolder({path:s.data.path}).then(this.handleResponse),this.delegate.drop({id:e}),this.onChange(this.delegate.data))}}const de=ye(t=>{const e=t(pt);return mt(e,"no requestClientAtom set"),new De({listFiles:e.sendListFiles,createFileOrFolder:e.sendCreateFileOrFolder,deleteFileOrFolder:e.sendDeleteFileOrFolder,renameFileOrFolder:e.sendRenameFileOrFolder})}),Oe=ye({});function he(t){const e=M.c(7);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const r=s,{sendCreateFileOrFolder:i}=ae();let o,l;return e[2]!==i?(o=async m=>{for(const n of m){const u=Ie(We(n));let f="";u&&(f=ie.guessDeliminator(u).dirname(u));const x=(await ut(n)).split(",")[1];await i({path:f,type:"file",name:n.name,contents:x})}await(async function(){await ht.get(de).refreshAll([])})()},e[2]=i,e[3]=o):o=e[3],e[4]!==r||e[5]!==o?(l={multiple:!0,maxSize:104857600,onError:Re,onDropRejected:Me,onDrop:o,...r},e[4]=r,e[5]=o,e[6]=l):l=e[6],ft(l)}function Me(t){O({title:"File upload failed",description:a.jsx("div",{className:"flex flex-col gap-1",children:t.map(ze)}),variant:"danger"})}function ze(t){return a.jsxs("div",{children:[t.file.name," (",t.errors.map(Ae).join(", "),")"]},t.file.name)}function Ae(t){return t.message}function Re(t){xt.error(t),O({title:"File upload failed",description:t.message,variant:"danger"})}function We(t){return t.webkitRelativePath?t.webkitRelativePath:"path"in t&&typeof t.path=="string"?t.path:"relativePath"in t&&typeof t.relativePath=="string"?t.relativePath:void 0}function Ie(t){if(t)return t.replace(/^\/+/,"")}const pe=gt.createContext(null),Ee=t=>{const e=M.c(60),{height:s}=t,r=P.useRef(null),[i]=be(de);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],e[0]=o):o=e[0];const[l,m]=P.useState(o),[n,u]=P.useState(null),{openPrompt:f}=ve(),[x,d]=be(Oe);let j,h;e[1]!==i?(j=()=>i.initialize(m),e[1]=i,e[2]=j):j=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(h=[],e[3]=h):h=e[3];const{isPending:w,error:b}=fe(j,h);let g;e[4]!==x||e[5]!==i?(g=()=>{i.refreshAll(Object.keys(x).filter(p=>x[p]))},e[4]=x,e[5]=i,e[6]=g):g=e[6];const c=z(g);let y;e[7]!==f||e[8]!==i?(y=async()=>{f({title:"Folder name",onConfirm:async p=>{i.createFolder(p,null)}})},e[7]=f,e[8]=i,e[9]=y):y=e[9];const v=z(y);let _;e[10]!==f||e[11]!==i?(_=async()=>{f({title:"File name",onConfirm:async p=>{i.createFile(p,null)}})},e[10]=f,e[11]=i,e[12]=_):_=e[12];const F=z(_);let N;e[13]!==d?(N=()=>{var p;(p=r.current)==null||p.closeAll(),d({})},e[13]=d,e[14]=N):N=e[14];const ee=z(N);if(w){let p;return e[15]===Symbol.for("react.memo_cache_sentinel")?(p=a.jsx(jt,{size:"medium",centered:!0}),e[15]=p):p=e[15],p}if(b){let p;return e[16]!==b?(p=a.jsx(xe,{error:b}),e[16]=b,e[17]=p):p=e[17],p}if(n){let p,k,S,$,q,Y;return e[18]===Symbol.for("react.memo_cache_sentinel")?(p=()=>u(null),e[18]=p):p=e[18],e[19]===Symbol.for("react.memo_cache_sentinel")?(k=a.jsx(V,{onClick:p,"data-testid":"file-explorer-back-button",variant:"text",size:"xs",className:"mb-0",children:a.jsx(Ht,{size:16})}),e[19]=k):k=e[19],e[20]!==n.name?(S=a.jsxs("div",{className:"flex items-center pl-1 pr-3 shrink-0 border-b justify-between",children:[k,a.jsx("span",{className:"font-bold",children:n.name})]}),e[20]=n.name,e[21]=S):S=e[21],e[22]!==n.path||e[23]!==i?($=Ye=>me(Ye,i.relativeFromRoot(n.path)),e[22]=n.path,e[23]=i,e[24]=$):$=e[24],e[25]!==n||e[26]!==$?(q=a.jsx(P.Suspense,{children:a.jsx(Pe,{onOpenNotebook:$,file:n})}),e[25]=n,e[26]=$,e[27]=q):q=e[27],e[28]!==S||e[29]!==q?(Y=a.jsxs(a.Fragment,{children:[S,q]}),e[28]=S,e[29]=q,e[30]=Y):Y=e[30],Y}let A;e[31]!==ee||e[32]!==F||e[33]!==v||e[34]!==c||e[35]!==i?(A=a.jsx(He,{onRefresh:c,onCreateFile:F,onCreateFolder:v,onCollapseAll:ee,tree:i}),e[31]=ee,e[32]=F,e[33]=v,e[34]=c,e[35]=i,e[36]=A):A=e[36];const te=s-33;let R,W,I,U,E,B,H,K;return e[37]!==i?(R=async p=>{const{ids:k}=p;for(const S of k)await i.delete(S)},W=async p=>{const{id:k,name:S}=p;await i.rename(k,S)},I=async p=>{const{dragIds:k,parentId:S}=p;await i.move(k,S)},e[37]=i,e[38]=R,e[39]=W,e[40]=I):(R=e[38],W=e[39],I=e[40]),e[41]===Symbol.for("react.memo_cache_sentinel")?(U=p=>{const k=p[0];k&&(k.data.isDirectory||u(k.data))},e[41]=U):U=e[41],e[42]!==x||e[43]!==d||e[44]!==i?(E=async p=>{if(await i.expand(p)){const k=x[p]??!1;d({...x,[p]:!k})}},e[42]=x,e[43]=d,e[44]=i,e[45]=E):E=e[45],e[46]!==l||e[47]!==x||e[48]!==R||e[49]!==W||e[50]!==I||e[51]!==E||e[52]!==te?(B=a.jsx(qt,{width:"100%",ref:r,height:te,className:"h-full",data:l,initialOpenState:x,openByDefault:!1,renderCursor:Le,disableDrop:Ue,onDelete:R,onRename:W,onMove:I,onSelect:U,onToggle:E,padding:15,rowHeight:30,indent:Be,overscanCount:1e3,disableMultiSelection:!0,children:Te}),e[46]=l,e[47]=x,e[48]=R,e[49]=W,e[50]=I,e[51]=E,e[52]=te,e[53]=B):B=e[53],e[54]!==B||e[55]!==i?(H=a.jsx(pe,{value:i,children:B}),e[54]=B,e[55]=i,e[56]=H):H=e[56],e[57]!==H||e[58]!==A?(K=a.jsxs(a.Fragment,{children:[A,H]}),e[57]=H,e[58]=A,e[59]=K):K=e[59],K},Be=15,He=t=>{const e=M.c(30),{onRefresh:s,onCreateFile:r,onCreateFolder:i,onCollapseAll:o}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={noDrag:!0,noDragEventsBubbling:!0},e[0]=l):l=e[0];const{getRootProps:m,getInputProps:n}=he(l);let u,f,x,d,j,h,w,b,g,c,y,v,_,F,N;return e[1]===Symbol.for("react.memo_cache_sentinel")?(u=a.jsx(we,{size:16}),e[1]=u):u=e[1],e[2]!==r?(f=a.jsx(D,{content:"Add file",children:a.jsx(V,{"data-testid":"file-explorer-add-file-button",onClick:r,variant:"text",size:"xs",children:u})}),e[2]=r,e[3]=f):f=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(x=a.jsx(oe,{size:16}),e[4]=x):x=e[4],e[5]!==i?(d=a.jsx(D,{content:"Add folder",children:a.jsx(V,{"data-testid":"file-explorer-add-folder-button",onClick:i,variant:"text",size:"xs",children:x})}),e[5]=i,e[6]=d):d=e[6],e[7]!==m?(j=m({}),e[7]=m,e[8]=j):j=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(h=yt({variant:"text",size:"xs"}),w=a.jsx(Pt,{size:16}),e[9]=h,e[10]=w):(h=e[9],w=e[10]),e[11]!==j?(b=a.jsx(D,{content:"Upload file",children:a.jsx("button",{"data-testid":"file-explorer-upload-button",...j,className:h,children:w})}),e[11]=j,e[12]=b):b=e[12],e[13]!==n?(g=n({}),e[13]=n,e[14]=g):g=e[14],e[15]!==g?(c=a.jsx("input",{...g,type:"file"}),e[15]=g,e[16]=c):c=e[16],e[17]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(Dt,{size:16}),e[17]=y):y=e[17],e[18]!==s?(v=a.jsx(D,{content:"Refresh",children:a.jsx(V,{"data-testid":"file-explorer-refresh-button",onClick:s,variant:"text",size:"xs",children:y})}),e[18]=s,e[19]=v):v=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(_=a.jsx(Ce,{size:16}),e[20]=_):_=e[20],e[21]!==o?(F=a.jsx(D,{content:"Collapse all folders",children:a.jsx(V,{"data-testid":"file-explorer-collapse-button",onClick:o,variant:"text",size:"xs",children:_})}),e[21]=o,e[22]=F):F=e[22],e[23]!==c||e[24]!==v||e[25]!==F||e[26]!==f||e[27]!==d||e[28]!==b?(N=a.jsxs("div",{className:"flex items-center justify-end px-2 shrink-0 border-b",children:[f,d,b,c,v,F]}),e[23]=c,e[24]=v,e[25]=F,e[26]=f,e[27]=d,e[28]=b,e[29]=N):N=e[29],N},$e=t=>{const e=M.c(9),{node:s,onOpenMarimoFile:r}=t;let i,o,l;return e[0]!==s?(i=m=>{s.data.isDirectory||(m.stopPropagation(),s.select())},e[0]=s,e[1]=i):i=e[1],e[2]!==s.data.isMarimoFile||e[3]!==r?(o=s.data.isMarimoFile&&!Z()&&a.jsxs("span",{className:"shrink-0 ml-2 text-sm hidden group-hover:inline hover:underline",onClick:r,children:["open ",a.jsx(se,{className:"inline ml-1",size:12})]}),e[2]=s.data.isMarimoFile,e[3]=r,e[4]=o):o=e[4],e[5]!==s.data.name||e[6]!==i||e[7]!==o?(l=a.jsxs("span",{className:"flex-1 overflow-hidden text-ellipsis",onClick:i,children:[s.data.name,o]}),e[5]=s.data.name,e[6]=i,e[7]=o,e[8]=l):l=e[8],l},qe=t=>{const e=M.c(10),{node:s}=t,r=P.useRef(null);let i,o,l,m,n;return e[0]!==s.data.name?(i=()=>{var u,f;(u=r.current)==null||u.focus(),(f=r.current)==null||f.setSelectionRange(0,s.data.name.lastIndexOf("."))},o=[s.data.name],e[0]=s.data.name,e[1]=i,e[2]=o):(i=e[1],o=e[2]),P.useEffect(i,o),e[3]!==s?(l=()=>s.reset(),m=u=>{u.key==="Escape"&&s.reset(),u.key==="Enter"&&s.submit(u.currentTarget.value)},e[3]=s,e[4]=l,e[5]=m):(l=e[4],m=e[5]),e[6]!==s.data.name||e[7]!==l||e[8]!==m?(n=a.jsx("input",{ref:r,className:"flex-1 bg-transparent border border-border text-muted-foreground",defaultValue:s.data.name,onClick:Ke,onBlur:l,onKeyDown:m}),e[6]=s.data.name,e[7]=l,e[8]=m,e[9]=n):n=e[9],n},Te=({node:t,style:e,dragHandle:s})=>{const{openFile:r,sendCreateFileOrFolder:i,sendFileDetails:o}=ae(),l=t.data.isDirectory?"directory":bt(t.data.name),m=Ft[l],{openConfirm:n,openPrompt:u}=ve(),{createNewCell:f}=vt(),x=kt(),d=P.use(pe),j=async c=>{me(c,d?d.relativeFromRoot(t.data.path):t.data.path)},h=async c=>{c.stopPropagation(),c.preventDefault(),n({title:"Delete file",description:`Are you sure you want to delete ${t.data.name}?`,confirmAction:a.jsx(At,{onClick:async()=>{await t.tree.delete(t.id)},"aria-label":"Confirm",children:"Delete"})})},w=z(async()=>{t.open(),u({title:"Folder name",onConfirm:async c=>{d==null||d.createFolder(c,t.id)}})}),b=z(async()=>{t.open(),u({title:"File name",onConfirm:async c=>{d==null||d.createFile(c,t.id)}})}),g=z(async()=>{var _;if(!d||t.data.isDirectory)return;const[c,y]=wt(t.data.name),v=`${c}_copy${y}`;try{const F=await o({path:t.data.path}),N=((_=t.parent)==null?void 0:_.data.path)||"";await i({path:N,type:"file",name:v,contents:F.contents?btoa(F.contents):void 0}),await d.refreshAll([N])}catch{O({title:"Failed to duplicate file",description:"Unable to create a duplicate of the file",variant:"danger"})}});return a.jsxs("div",{style:e,ref:s,className:ne("flex items-center cursor-pointer ml-1 text-muted-foreground whitespace-nowrap group"),draggable:!0,onClick:c=>{c.stopPropagation(),t.data.isDirectory&&t.toggle()},children:[a.jsx(Ve,{node:t}),a.jsxs("span",{className:ne("flex items-center pl-1 py-1 cursor-pointer hover:bg-accent/50 hover:text-accent-foreground rounded-l flex-1 overflow-hidden group",t.willReceiveDrop&&t.data.isDirectory&&"bg-accent/80 hover:bg-accent/80 text-accent-foreground"),children:[t.data.isMarimoFile?a.jsx("img",{src:Et,className:"w-5 h-5 shrink-0 mr-2 filter grayscale",alt:"Marimo"}):a.jsx(m,{className:"w-5 h-5 shrink-0 mr-2",strokeWidth:1.5}),t.isEditing?a.jsx(qe,{node:t}):a.jsx($e,{node:t,onOpenMarimoFile:j}),a.jsxs(Ct,{modal:!1,children:[a.jsx(_t,{asChild:!0,tabIndex:-1,onClick:c=>c.stopPropagation(),children:a.jsx(V,{"data-testid":"file-explorer-more-button",variant:"text",tabIndex:-1,size:"xs",className:"mb-0","aria-label":"More options",children:a.jsx(Tt,{strokeWidth:2,className:"w-5 h-5 hidden group-hover:block"})})}),(()=>{const c={size:14,strokeWidth:1.5,className:"mr-2"};return a.jsxs(Ot,{align:"end",className:"no-print w-[220px]",onClick:y=>y.stopPropagation(),onCloseAutoFocus:y=>y.preventDefault(),children:[!t.data.isDirectory&&a.jsxs(C,{onSelect:()=>t.select(),children:[a.jsx(Se,{...c}),"Open file"]}),!t.data.isDirectory&&!Z()&&a.jsxs(C,{onSelect:()=>{r({path:t.data.path})},children:[a.jsx(se,{...c}),"Open file in external editor"]}),t.data.isDirectory&&a.jsxs(a.Fragment,{children:[a.jsxs(C,{onSelect:()=>b(),children:[a.jsx(we,{...c}),"Create file"]}),a.jsxs(C,{onSelect:()=>w(),children:[a.jsx(oe,{...c}),"Create folder"]}),a.jsx(L,{})]}),a.jsxs(C,{onSelect:()=>t.edit(),children:[a.jsx(_e,{...c}),"Rename"]}),!t.data.isDirectory&&a.jsxs(C,{onSelect:g,children:[a.jsx(ge,{...c}),"Duplicate"]}),a.jsxs(C,{onSelect:async()=>{await X(t.data.path),O({title:"Copied to clipboard"})},children:[a.jsx(le,{...c}),"Copy path"]}),d&&a.jsxs(C,{onSelect:async()=>{await X(d.relativeFromRoot(t.data.path)),O({title:"Copied to clipboard"})},children:[a.jsx(le,{...c}),"Copy relative path"]}),a.jsx(L,{}),a.jsxs(C,{onSelect:()=>{const{path:y}=t.data,v=ke[l](y);f({code:v,before:!1,cellId:x??"__end__"})},children:[a.jsx(Vt,{...c}),"Insert snippet for reading file"]}),a.jsxs(C,{onSelect:async()=>{O({title:"Copied to clipboard",description:"Code to open the file has been copied to your clipboard. You can also drag and drop this file into the editor"});const{path:y}=t.data,v=ke[l](y);await X(v)},children:[a.jsx(Mt,{...c}),"Copy snippet for reading file"]}),t.data.isMarimoFile&&!Z()&&a.jsxs(a.Fragment,{children:[a.jsx(L,{}),a.jsxs(C,{onSelect:j,children:[a.jsx(Ne,{...c}),"Open notebook"]})]}),a.jsx(L,{}),!t.data.isDirectory&&a.jsxs(a.Fragment,{children:[a.jsxs(C,{onSelect:async()=>{const y=(await o({path:t.data.path})).contents||"";je(new Blob([y]),t.data.name)},children:[a.jsx(ue,{...c}),"Download"]}),a.jsx(L,{})]}),a.jsxs(C,{onSelect:h,variant:"danger",children:[a.jsx(zt,{...c}),"Delete"]})]})})()]})]})]})},Ve=t=>{const e=M.c(3),{node:s}=t;if(!s.data.isDirectory){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx("span",{className:"w-5 h-5 shrink-0"}),e[0]=i):i=e[0],i}let r;return e[1]!==s.isOpen?(r=s.isOpen?a.jsx(Nt,{className:"w-5 h-5 shrink-0"}):a.jsx(St,{className:"w-5 h-5 shrink-0"}),e[1]=s.isOpen,e[2]=r):r=e[2],r};function me(t,e){t.stopPropagation(),t.preventDefault(),It(e)}function Le(){return null}function Ue(t){const{parentNode:e}=t;return!e.data.isDirectory}function Ke(t){return t.stopPropagation()}Fe=()=>{const t=M.c(20),{ref:e,height:s}=Rt(),r=s===void 0?1:s;let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={noClick:!0,noKeyboard:!0},t[0]=i):i=t[0];const{getRootProps:o,getInputProps:l,isDragActive:m}=he(i);let n,u,f,x,d,j,h,w;return t[1]!==o?(n=o(),t[1]=o,t[2]=n):n=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(u=ne("flex flex-col flex-1 overflow-hidden relative"),t[3]=u):u=t[3],t[4]!==l?(f=l(),t[4]=l,t[5]=f):f=t[5],t[6]!==f?(x=a.jsx("input",{...f}),t[6]=f,t[7]=x):x=t[7],t[8]!==m?(d=m&&a.jsx("div",{className:"absolute inset-0 flex items-center uppercase justify-center text-xl font-bold text-primary/90 bg-accent/85 z-10 border-2 border-dashed border-primary/90 rounded-lg pointer-events-none",children:"Drop files here"}),t[8]=m,t[9]=d):d=t[9],t[10]!==r?(j=a.jsx(Ee,{height:r}),t[10]=r,t[11]=j):j=t[11],t[12]!==e||t[13]!==j?(h=a.jsx("div",{ref:e,className:"flex flex-col flex-1 overflow-hidden",children:j}),t[12]=e,t[13]=j,t[14]=h):h=t[14],t[15]!==n||t[16]!==x||t[17]!==d||t[18]!==h?(w=a.jsxs("div",{...n,className:u,children:[x,d,h]}),t[15]=n,t[16]=x,t[17]=d,t[18]=h,t[19]=w):w=t[19],w}});export{Kt as __tla,Fe as default};
1
+ import{c as T,u as Ze,ax as ae,K as Xe,cs as Ge,r as P,b as fe,j as a,E as xe,aA as Z,aB as D,e8 as se,b4 as ue,a8 as ge,$ as X,cO as Je,eU as Qe,eV as et,eW as tt,eX as at,eY as st,bS as it,p as nt,eZ as rt,e_ as ot,e$ as lt,b3 as je,cP as ct,f0 as ie,a0 as O,e5 as dt,ba as ht,av as ye,f1 as pt,f2 as mt,a as M,f3 as ft,L as xt,f4 as ut,d as gt,cp as be,X as ve,cM as z,a1 as jt,a_ as V,f5 as yt,e6 as bt,S as vt,by as kt,f6 as wt,T as ne,e7 as Ft,d$ as Ct,dZ as _t,aG as Nt,aH as St,f7 as Pt,eg as Dt,e0 as Ot,dY as C,f8 as L,f9 as ke,fa as Mt,fb as zt,e9 as At,c6 as Rt,__tla as Wt}from"./index-C7CoaNFb.js";import{e as G,o as It}from"./links-BpXlz1GG.js";import{m as Et}from"./icon-32x32-DHZerVul.js";import{h as Bt,i as Ht,F as we,__tla as $t}from"./edit-page-B-oevUZ9.js";import{S as re,T as qt}from"./tree-6vW2ogkh.js";import{E as Tt}from"./ellipsis-vertical-BEb-J8z6.js";import{B as Vt}from"./between-horizontal-start-Dt2aKpPf.js";import{__tla as Lt}from"./storage-DRaR04wR.js";import"./index-Aeo6WiK7.js";import"./index-CfaDbEdi.js";import"./index-BjgnbONl.js";import"./index-CUFv_thQ.js";import"./index-DdnKZNxM.js";import"./index-C_tkBKNO.js";import"./index-BJNCMUmG.js";import"./index-CFKO7WXI.js";import"./index-aE43R74q.js";import"./index-BAbIIxHU.js";import"./index-ClzeQrN7.js";import"./index-G5QZppK2.js";import"./index-C2MD0vgD.js";import"./apl-CXdQSnD-.js";import"./asciiarmor-D5V0T9Cu.js";import"./asn1-DWPaVWf6.js";import"./brainfuck-CtZaYBKt.js";import"./cobol-stawOqaz.js";import"./clike-BgBwzOhw.js";import"./clojure-DiuoqK-z.js";import"./css-ZjFoif2m.js";import"./cmake-DXn5xaP-.js";import"./coffeescript-BTDxI-eT.js";import"./commonlisp-vq6DHwts.js";import"./cypher-gJDei3ni.js";import"./python-DD-Q2bae.js";import"./crystal-CRzZ78HM.js";import"./d-BShv7fp-.js";import"./diff-UJJ5BM9S.js";import"./dtd-DI9Herc-.js";import"./dylan-DkEP81N9.js";import"./ecl-DPFc0Uaf.js";import"./eiffel-DR5c0IrL.js";import"./elm-DompmV0j.js";import"./erlang-BuqgqA5h.js";import"./factor-CFXhaUWb.js";import"./simple-mode-C3vEBAcb.js";import"./forth-POgR1ypr.js";import"./fortran-DL7KluxX.js";import"./mllike-3c2dg9RT.js";import"./gas-bV0CklSb.js";import"./gherkin-B6X1vGSW.js";import"./groovy-DnIzCrpZ.js";import"./haskell-CLQs6EAM.js";import"./haxe-D25e-2l-.js";import"./idl-pcmmZuaN.js";import"./javascript-BpzJj0-u.js";import"./jinja2-DhgKlfW7.js";import"./julia-DjdwvFuI.js";import"./livescript-HO6ttBFx.js";import"./lua-8DXOpKDz.js";import"./mirc-DkvFAiy5.js";import"./mathematica-IIbmv7SK.js";import"./modelica-DSrSSXCg.js";import"./mumps-zvxmGV4l.js";import"./mbox-z_N2Mo3d.js";import"./nsis-BvKfQ9lQ.js";import"./ntriples-BSwWqoLa.js";import"./octave-C4hdQ5Hf.js";import"./oz-qQq7irPq.js";import"./pascal-CafrKXZF.js";import"./perl-tdMlh9QA.js";import"./pig-CwGJVRC4.js";import"./powershell-D1ly3AHC.js";import"./properties-_nPj978X.js";import"./protobuf-B4y9do6W.js";import"./pug-BTvK5tSS.js";import"./puppet-Bc-yJKzi.js";import"./q-B0kTJ4cI.js";import"./r-BA4EbLKE.js";import"./rpm-DI_rRufH.js";import"./ruby-CR-u2WLS.js";import"./sas-Bqaci40L.js";import"./scheme-qjP0V5Ag.js";import"./shell-BLav31RL.js";import"./sieve-r025o_jW.js";import"./smalltalk-C7J3IyEP.js";import"./sparql-BRLJFz69.js";import"./stylus-Bdo_Aemu.js";import"./swift-B_XXVlXX.js";import"./verilog-B4LBqg_1.js";import"./tcl-B2fODqDH.js";import"./textile-BuVhTOzU.js";import"./toml-wcPdHu67.js";import"./troff-Ce85hlLp.js";import"./ttcn-BxnYHtq8.js";import"./ttcn-cfg-CKJxb-l2.js";import"./turtle-BkSuIpt-.js";import"./webidl-CGwyPRYs.js";import"./vb-BHgjm0DN.js";import"./vbscript-Dawdd5GZ.js";import"./velocity-BdD_26Jv.js";import"./vhdl-CWWH2SUo.js";import"./xquery-CVDBqZPY.js";import"./yacas-I8QjZlxf.js";import"./z80-D8p3gKXp.js";import"./mscgen-B2igx18G.js";import"./index-C1ez98sk.js";import"./trash-B81GTiv6.js";import"./_createAggregator-C5CVY-0t.js";import"./_baseEach-CvTX9w0Y.js";import{__tla as Ut}from"./loro_wasm_bg-C1ks32Vm.js";import"./index-B8jXZ12t.js";let Fe,Kt=Promise.all([(()=>{try{return Wt}catch{}})(),(()=>{try{return $t}catch{}})(),(()=>{try{return Lt}catch{}})(),(()=>{try{return Ut}catch{}})()]).then(async()=>{const Ce=T("copy-minus",[["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),oe=T("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]),le=T("list-tree",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]),_e=T("pen-line",[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]),Ne=T("square-play",[["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}]]),Se=T("view",[["path",{d:"M21 17v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2",key:"mrq65r"}],["path",{d:"M21 7V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2",key:"be3xqs"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0",key:"11ak4c"}]]),J=new Map,Pe=({file:t,onOpenNotebook:e})=>{const{theme:s}=Ze(),{sendFileDetails:r,sendUpdateFile:i}=ae(),o=Xe(Ge),[l,m]=P.useState(""),{data:n,isPending:u,error:f,setData:x}=fe(async()=>{const g=await r({path:t.path}),c=g.contents||"";return m(J.get(t.path)||c),g},[t.path]),d=async()=>{l!==(n==null?void 0:n.contents)&&await i({path:t.path,contents:l}).then(g=>{g.success&&(x(c=>({...c,contents:l})),m(l))})},j=P.useRef(l);if(j.current=l,P.useEffect(()=>()=>{if(!(n!=null&&n.contents))return;const g=j.current;g===n.contents?J.delete(t.path):J.set(t.path,g)},[t.path,n==null?void 0:n.contents]),f)return a.jsx(xe,{error:f});if(u||!n)return null;const h=n.mimeType||"text/plain",w=h in Q;if(!n.contents&&!w)return a.jsxs("div",{className:"grid grid-cols-2 gap-2 p-6",children:[a.jsx("div",{className:"font-bold text-muted-foreground",children:"Name"}),a.jsx("div",{children:n.file.name}),a.jsx("div",{className:"font-bold text-muted-foreground",children:"Type"}),a.jsx("div",{children:h})]});const b=a.jsxs("div",{className:"text-xs text-muted-foreground p-1 flex justify-end gap-2 border-b",children:[t.isMarimoFile&&!Z()&&a.jsx(D,{content:"Open notebook",children:a.jsx(G,{size:"small",onClick:g=>e(g),children:a.jsx(se,{})})}),a.jsx(D,{content:"Download",children:a.jsx(G,{size:"small",onClick:()=>{if(ce(h)){const g=ot(n.contents,h);return void lt(g,n.file.name)}je(new Blob([n.contents||l],{type:h}),n.file.name)},children:a.jsx(ue,{})})}),!ce(h)&&a.jsxs(a.Fragment,{children:[a.jsx(D,{content:"Copy contents to clipboard",children:a.jsx(G,{size:"small",onClick:async()=>{await X(l)},children:a.jsx(ge,{})})}),a.jsx(D,{content:Je("global.save"),children:a.jsx(G,{size:"small",color:l===n.contents?void 0:"green",onClick:d,disabled:l===n.contents,children:a.jsx(Bt,{})})})]})]});return h.startsWith("image/")?a.jsxs(a.Fragment,{children:[b,a.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:a.jsx(Qe,{base64:n.contents,mime:h})})]}):h==="text/csv"&&n.contents?a.jsxs(a.Fragment,{children:[b,a.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:a.jsx(et,{contents:n.contents})})]}):h.startsWith("audio/")?a.jsxs(a.Fragment,{children:[b,a.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:a.jsx(tt,{base64:n.contents,mime:h})})]}):h.startsWith("video/")?a.jsxs(a.Fragment,{children:[b,a.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:a.jsx(at,{base64:n.contents,mime:h})})]}):h.startsWith("application/pdf")?a.jsxs(a.Fragment,{children:[b,a.jsx("div",{className:"flex-1 overflow-hidden flex flex-col",children:a.jsx(st,{base64:n.contents,mime:h})})]}):a.jsxs(a.Fragment,{children:[b,a.jsx("div",{className:"flex-1 overflow-auto",children:a.jsx(P.Suspense,{children:a.jsx(it,{theme:s==="dark"?"dark":"light",language:Q[h]||Q.default,className:"border-b",extensions:[nt.lineWrapping,rt.of([{key:o.getHotkey("global.save").key,stopPropagation:!0,run:()=>l!==n.contents&&(d(),!0)}])],value:l,onChange:m})})})]})},ce=t=>t.startsWith("image/")||t.startsWith("audio/")||t.startsWith("video/")||t.startsWith("application/pdf"),Q={"application/javascript":"javascript","text/markdown":"markdown","text/html":"html","text/css":"css","text/x-python":"python","application/json":"json","application/xml":"xml","text/x-yaml":"yaml","text/csv":"markdown","text/plain":"markdown",default:"markdown"};class De{constructor(e){this.delegate=new re([]),this.callbacks=void 0,this.rootPath="",this.onChange=ct.NOOP,this.path=new ie("/"),this.initialize=async s=>{if(this.onChange=s,this.delegate.data.length===0)try{const r=await this.callbacks.listFiles({path:this.rootPath});this.delegate=new re(r.files),this.rootPath=r.root,this.path=ie.guessDeliminator(r.root)}catch(r){O({title:"Failed",description:dt(r)})}this.onChange(this.delegate.data)},this.refreshAll=async s=>{const r=[this.rootPath,...s.map(o=>{var l;return(l=this.delegate.find(o))==null?void 0:l.data.path})].filter(Boolean),i=await Promise.all(r.map(o=>this.callbacks.listFiles({path:o}).catch(()=>({files:[]}))));for(const[o,l]of r.entries()){const m=i[o];l===this.rootPath?this.delegate=new re(m.files):this.delegate.update({id:l,changes:{children:m.files}})}this.onChange(this.delegate.data)},this.relativeFromRoot=s=>{const r=this.rootPath.endsWith(this.path.deliminator)?this.rootPath:`${this.rootPath}${this.path.deliminator}`;return s.startsWith(r)?s.slice(r.length):s},this.handleResponse=s=>s.success?s:(O({title:"Failed",description:s.message}),null),this.callbacks=e}async expand(e){const s=this.delegate.find(e);if(!s||!s.data.isDirectory)return!1;if(s.children&&s.children.length>0)return!0;const r=await this.callbacks.listFiles({path:s.data.path});return this.delegate.update({id:e,changes:{children:r.files}}),this.onChange(this.delegate.data),!0}async rename(e,s){const r=this.delegate.find(e);if(!r)return;const i=r.data.path,o=this.path.join(this.path.dirname(i),s);await this.callbacks.renameFileOrFolder({path:i,newPath:o}).then(this.handleResponse),this.delegate.update({id:e,changes:{name:s,path:o}}),this.onChange(this.delegate.data),await this.refreshAll([o])}async move(e,s){var i;const r=s?((i=this.delegate.find(s))==null?void 0:i.data.path)??s:this.rootPath;await Promise.all(e.map(o=>{this.delegate.move({id:o,parentId:s,index:0});const l=this.delegate.find(o);if(!l)return Promise.resolve();const m=this.path.join(r,this.path.basename(l.data.path));return this.delegate.update({id:o,changes:{path:m}}),this.callbacks.renameFileOrFolder({path:l.data.path,newPath:m}).then(this.handleResponse)})),this.onChange(this.delegate.data),await this.refreshAll([r])}async createFile(e,s){var o;const r=s?((o=this.delegate.find(s))==null?void 0:o.data.path)??s:this.rootPath,i=await this.callbacks.createFileOrFolder({path:r,type:"file",name:e}).then(this.handleResponse);i!=null&&i.info&&(this.delegate.create({parentId:s,index:0,data:i.info}),this.onChange(this.delegate.data),await this.refreshAll([r]))}async createFolder(e,s){var o;const r=s?((o=this.delegate.find(s))==null?void 0:o.data.path)??s:this.rootPath,i=await this.callbacks.createFileOrFolder({path:r,type:"directory",name:e}).then(this.handleResponse);i!=null&&i.info&&(this.delegate.create({parentId:s,index:0,data:i.info}),this.onChange(this.delegate.data),await this.refreshAll([r]))}async delete(e){const s=this.delegate.find(e);s&&(await this.callbacks.deleteFileOrFolder({path:s.data.path}).then(this.handleResponse),this.delegate.drop({id:e}),this.onChange(this.delegate.data))}}const de=ye(t=>{const e=t(pt);return mt(e,"no requestClientAtom set"),new De({listFiles:e.sendListFiles,createFileOrFolder:e.sendCreateFileOrFolder,deleteFileOrFolder:e.sendDeleteFileOrFolder,renameFileOrFolder:e.sendRenameFileOrFolder})}),Oe=ye({});function he(t){const e=M.c(7);let s;e[0]!==t?(s=t===void 0?{}:t,e[0]=t,e[1]=s):s=e[1];const r=s,{sendCreateFileOrFolder:i}=ae();let o,l;return e[2]!==i?(o=async m=>{for(const n of m){const u=Ie(We(n));let f="";u&&(f=ie.guessDeliminator(u).dirname(u));const x=(await ut(n)).split(",")[1];await i({path:f,type:"file",name:n.name,contents:x})}await(async function(){await ht.get(de).refreshAll([])})()},e[2]=i,e[3]=o):o=e[3],e[4]!==r||e[5]!==o?(l={multiple:!0,maxSize:104857600,onError:Re,onDropRejected:Me,onDrop:o,...r},e[4]=r,e[5]=o,e[6]=l):l=e[6],ft(l)}function Me(t){O({title:"File upload failed",description:a.jsx("div",{className:"flex flex-col gap-1",children:t.map(ze)}),variant:"danger"})}function ze(t){return a.jsxs("div",{children:[t.file.name," (",t.errors.map(Ae).join(", "),")"]},t.file.name)}function Ae(t){return t.message}function Re(t){xt.error(t),O({title:"File upload failed",description:t.message,variant:"danger"})}function We(t){return t.webkitRelativePath?t.webkitRelativePath:"path"in t&&typeof t.path=="string"?t.path:"relativePath"in t&&typeof t.relativePath=="string"?t.relativePath:void 0}function Ie(t){if(t)return t.replace(/^\/+/,"")}const pe=gt.createContext(null),Ee=t=>{const e=M.c(60),{height:s}=t,r=P.useRef(null),[i]=be(de);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],e[0]=o):o=e[0];const[l,m]=P.useState(o),[n,u]=P.useState(null),{openPrompt:f}=ve(),[x,d]=be(Oe);let j,h;e[1]!==i?(j=()=>i.initialize(m),e[1]=i,e[2]=j):j=e[2],e[3]===Symbol.for("react.memo_cache_sentinel")?(h=[],e[3]=h):h=e[3];const{isPending:w,error:b}=fe(j,h);let g;e[4]!==x||e[5]!==i?(g=()=>{i.refreshAll(Object.keys(x).filter(p=>x[p]))},e[4]=x,e[5]=i,e[6]=g):g=e[6];const c=z(g);let y;e[7]!==f||e[8]!==i?(y=async()=>{f({title:"Folder name",onConfirm:async p=>{i.createFolder(p,null)}})},e[7]=f,e[8]=i,e[9]=y):y=e[9];const v=z(y);let _;e[10]!==f||e[11]!==i?(_=async()=>{f({title:"File name",onConfirm:async p=>{i.createFile(p,null)}})},e[10]=f,e[11]=i,e[12]=_):_=e[12];const F=z(_);let N;e[13]!==d?(N=()=>{var p;(p=r.current)==null||p.closeAll(),d({})},e[13]=d,e[14]=N):N=e[14];const ee=z(N);if(w){let p;return e[15]===Symbol.for("react.memo_cache_sentinel")?(p=a.jsx(jt,{size:"medium",centered:!0}),e[15]=p):p=e[15],p}if(b){let p;return e[16]!==b?(p=a.jsx(xe,{error:b}),e[16]=b,e[17]=p):p=e[17],p}if(n){let p,k,S,$,q,Y;return e[18]===Symbol.for("react.memo_cache_sentinel")?(p=()=>u(null),e[18]=p):p=e[18],e[19]===Symbol.for("react.memo_cache_sentinel")?(k=a.jsx(V,{onClick:p,"data-testid":"file-explorer-back-button",variant:"text",size:"xs",className:"mb-0",children:a.jsx(Ht,{size:16})}),e[19]=k):k=e[19],e[20]!==n.name?(S=a.jsxs("div",{className:"flex items-center pl-1 pr-3 shrink-0 border-b justify-between",children:[k,a.jsx("span",{className:"font-bold",children:n.name})]}),e[20]=n.name,e[21]=S):S=e[21],e[22]!==n.path||e[23]!==i?($=Ye=>me(Ye,i.relativeFromRoot(n.path)),e[22]=n.path,e[23]=i,e[24]=$):$=e[24],e[25]!==n||e[26]!==$?(q=a.jsx(P.Suspense,{children:a.jsx(Pe,{onOpenNotebook:$,file:n})}),e[25]=n,e[26]=$,e[27]=q):q=e[27],e[28]!==S||e[29]!==q?(Y=a.jsxs(a.Fragment,{children:[S,q]}),e[28]=S,e[29]=q,e[30]=Y):Y=e[30],Y}let A;e[31]!==ee||e[32]!==F||e[33]!==v||e[34]!==c||e[35]!==i?(A=a.jsx(He,{onRefresh:c,onCreateFile:F,onCreateFolder:v,onCollapseAll:ee,tree:i}),e[31]=ee,e[32]=F,e[33]=v,e[34]=c,e[35]=i,e[36]=A):A=e[36];const te=s-33;let R,W,I,U,E,B,H,K;return e[37]!==i?(R=async p=>{const{ids:k}=p;for(const S of k)await i.delete(S)},W=async p=>{const{id:k,name:S}=p;await i.rename(k,S)},I=async p=>{const{dragIds:k,parentId:S}=p;await i.move(k,S)},e[37]=i,e[38]=R,e[39]=W,e[40]=I):(R=e[38],W=e[39],I=e[40]),e[41]===Symbol.for("react.memo_cache_sentinel")?(U=p=>{const k=p[0];k&&(k.data.isDirectory||u(k.data))},e[41]=U):U=e[41],e[42]!==x||e[43]!==d||e[44]!==i?(E=async p=>{if(await i.expand(p)){const k=x[p]??!1;d({...x,[p]:!k})}},e[42]=x,e[43]=d,e[44]=i,e[45]=E):E=e[45],e[46]!==l||e[47]!==x||e[48]!==R||e[49]!==W||e[50]!==I||e[51]!==E||e[52]!==te?(B=a.jsx(qt,{width:"100%",ref:r,height:te,className:"h-full",data:l,initialOpenState:x,openByDefault:!1,renderCursor:Le,disableDrop:Ue,onDelete:R,onRename:W,onMove:I,onSelect:U,onToggle:E,padding:15,rowHeight:30,indent:Be,overscanCount:1e3,disableMultiSelection:!0,children:Te}),e[46]=l,e[47]=x,e[48]=R,e[49]=W,e[50]=I,e[51]=E,e[52]=te,e[53]=B):B=e[53],e[54]!==B||e[55]!==i?(H=a.jsx(pe,{value:i,children:B}),e[54]=B,e[55]=i,e[56]=H):H=e[56],e[57]!==H||e[58]!==A?(K=a.jsxs(a.Fragment,{children:[A,H]}),e[57]=H,e[58]=A,e[59]=K):K=e[59],K},Be=15,He=t=>{const e=M.c(30),{onRefresh:s,onCreateFile:r,onCreateFolder:i,onCollapseAll:o}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={noDrag:!0,noDragEventsBubbling:!0},e[0]=l):l=e[0];const{getRootProps:m,getInputProps:n}=he(l);let u,f,x,d,j,h,w,b,g,c,y,v,_,F,N;return e[1]===Symbol.for("react.memo_cache_sentinel")?(u=a.jsx(we,{size:16}),e[1]=u):u=e[1],e[2]!==r?(f=a.jsx(D,{content:"Add file",children:a.jsx(V,{"data-testid":"file-explorer-add-file-button",onClick:r,variant:"text",size:"xs",children:u})}),e[2]=r,e[3]=f):f=e[3],e[4]===Symbol.for("react.memo_cache_sentinel")?(x=a.jsx(oe,{size:16}),e[4]=x):x=e[4],e[5]!==i?(d=a.jsx(D,{content:"Add folder",children:a.jsx(V,{"data-testid":"file-explorer-add-folder-button",onClick:i,variant:"text",size:"xs",children:x})}),e[5]=i,e[6]=d):d=e[6],e[7]!==m?(j=m({}),e[7]=m,e[8]=j):j=e[8],e[9]===Symbol.for("react.memo_cache_sentinel")?(h=yt({variant:"text",size:"xs"}),w=a.jsx(Pt,{size:16}),e[9]=h,e[10]=w):(h=e[9],w=e[10]),e[11]!==j?(b=a.jsx(D,{content:"Upload file",children:a.jsx("button",{"data-testid":"file-explorer-upload-button",...j,className:h,children:w})}),e[11]=j,e[12]=b):b=e[12],e[13]!==n?(g=n({}),e[13]=n,e[14]=g):g=e[14],e[15]!==g?(c=a.jsx("input",{...g,type:"file"}),e[15]=g,e[16]=c):c=e[16],e[17]===Symbol.for("react.memo_cache_sentinel")?(y=a.jsx(Dt,{size:16}),e[17]=y):y=e[17],e[18]!==s?(v=a.jsx(D,{content:"Refresh",children:a.jsx(V,{"data-testid":"file-explorer-refresh-button",onClick:s,variant:"text",size:"xs",children:y})}),e[18]=s,e[19]=v):v=e[19],e[20]===Symbol.for("react.memo_cache_sentinel")?(_=a.jsx(Ce,{size:16}),e[20]=_):_=e[20],e[21]!==o?(F=a.jsx(D,{content:"Collapse all folders",children:a.jsx(V,{"data-testid":"file-explorer-collapse-button",onClick:o,variant:"text",size:"xs",children:_})}),e[21]=o,e[22]=F):F=e[22],e[23]!==c||e[24]!==v||e[25]!==F||e[26]!==f||e[27]!==d||e[28]!==b?(N=a.jsxs("div",{className:"flex items-center justify-end px-2 shrink-0 border-b",children:[f,d,b,c,v,F]}),e[23]=c,e[24]=v,e[25]=F,e[26]=f,e[27]=d,e[28]=b,e[29]=N):N=e[29],N},$e=t=>{const e=M.c(9),{node:s,onOpenMarimoFile:r}=t;let i,o,l;return e[0]!==s?(i=m=>{s.data.isDirectory||(m.stopPropagation(),s.select())},e[0]=s,e[1]=i):i=e[1],e[2]!==s.data.isMarimoFile||e[3]!==r?(o=s.data.isMarimoFile&&!Z()&&a.jsxs("span",{className:"shrink-0 ml-2 text-sm hidden group-hover:inline hover:underline",onClick:r,children:["open ",a.jsx(se,{className:"inline ml-1",size:12})]}),e[2]=s.data.isMarimoFile,e[3]=r,e[4]=o):o=e[4],e[5]!==s.data.name||e[6]!==i||e[7]!==o?(l=a.jsxs("span",{className:"flex-1 overflow-hidden text-ellipsis",onClick:i,children:[s.data.name,o]}),e[5]=s.data.name,e[6]=i,e[7]=o,e[8]=l):l=e[8],l},qe=t=>{const e=M.c(10),{node:s}=t,r=P.useRef(null);let i,o,l,m,n;return e[0]!==s.data.name?(i=()=>{var u,f;(u=r.current)==null||u.focus(),(f=r.current)==null||f.setSelectionRange(0,s.data.name.lastIndexOf("."))},o=[s.data.name],e[0]=s.data.name,e[1]=i,e[2]=o):(i=e[1],o=e[2]),P.useEffect(i,o),e[3]!==s?(l=()=>s.reset(),m=u=>{u.key==="Escape"&&s.reset(),u.key==="Enter"&&s.submit(u.currentTarget.value)},e[3]=s,e[4]=l,e[5]=m):(l=e[4],m=e[5]),e[6]!==s.data.name||e[7]!==l||e[8]!==m?(n=a.jsx("input",{ref:r,className:"flex-1 bg-transparent border border-border text-muted-foreground",defaultValue:s.data.name,onClick:Ke,onBlur:l,onKeyDown:m}),e[6]=s.data.name,e[7]=l,e[8]=m,e[9]=n):n=e[9],n},Te=({node:t,style:e,dragHandle:s})=>{const{openFile:r,sendCreateFileOrFolder:i,sendFileDetails:o}=ae(),l=t.data.isDirectory?"directory":bt(t.data.name),m=Ft[l],{openConfirm:n,openPrompt:u}=ve(),{createNewCell:f}=vt(),x=kt(),d=P.use(pe),j=async c=>{me(c,d?d.relativeFromRoot(t.data.path):t.data.path)},h=async c=>{c.stopPropagation(),c.preventDefault(),n({title:"Delete file",description:`Are you sure you want to delete ${t.data.name}?`,confirmAction:a.jsx(At,{onClick:async()=>{await t.tree.delete(t.id)},"aria-label":"Confirm",children:"Delete"})})},w=z(async()=>{t.open(),u({title:"Folder name",onConfirm:async c=>{d==null||d.createFolder(c,t.id)}})}),b=z(async()=>{t.open(),u({title:"File name",onConfirm:async c=>{d==null||d.createFile(c,t.id)}})}),g=z(async()=>{var _;if(!d||t.data.isDirectory)return;const[c,y]=wt(t.data.name),v=`${c}_copy${y}`;try{const F=await o({path:t.data.path}),N=((_=t.parent)==null?void 0:_.data.path)||"";await i({path:N,type:"file",name:v,contents:F.contents?btoa(F.contents):void 0}),await d.refreshAll([N])}catch{O({title:"Failed to duplicate file",description:"Unable to create a duplicate of the file",variant:"danger"})}});return a.jsxs("div",{style:e,ref:s,className:ne("flex items-center cursor-pointer ml-1 text-muted-foreground whitespace-nowrap group"),draggable:!0,onClick:c=>{c.stopPropagation(),t.data.isDirectory&&t.toggle()},children:[a.jsx(Ve,{node:t}),a.jsxs("span",{className:ne("flex items-center pl-1 py-1 cursor-pointer hover:bg-accent/50 hover:text-accent-foreground rounded-l flex-1 overflow-hidden group",t.willReceiveDrop&&t.data.isDirectory&&"bg-accent/80 hover:bg-accent/80 text-accent-foreground"),children:[t.data.isMarimoFile?a.jsx("img",{src:Et,className:"w-5 h-5 shrink-0 mr-2 filter grayscale",alt:"Marimo"}):a.jsx(m,{className:"w-5 h-5 shrink-0 mr-2",strokeWidth:1.5}),t.isEditing?a.jsx(qe,{node:t}):a.jsx($e,{node:t,onOpenMarimoFile:j}),a.jsxs(Ct,{modal:!1,children:[a.jsx(_t,{asChild:!0,tabIndex:-1,onClick:c=>c.stopPropagation(),children:a.jsx(V,{"data-testid":"file-explorer-more-button",variant:"text",tabIndex:-1,size:"xs",className:"mb-0","aria-label":"More options",children:a.jsx(Tt,{strokeWidth:2,className:"w-5 h-5 hidden group-hover:block"})})}),(()=>{const c={size:14,strokeWidth:1.5,className:"mr-2"};return a.jsxs(Ot,{align:"end",className:"no-print w-[220px]",onClick:y=>y.stopPropagation(),onCloseAutoFocus:y=>y.preventDefault(),children:[!t.data.isDirectory&&a.jsxs(C,{onSelect:()=>t.select(),children:[a.jsx(Se,{...c}),"Open file"]}),!t.data.isDirectory&&!Z()&&a.jsxs(C,{onSelect:()=>{r({path:t.data.path})},children:[a.jsx(se,{...c}),"Open file in external editor"]}),t.data.isDirectory&&a.jsxs(a.Fragment,{children:[a.jsxs(C,{onSelect:()=>b(),children:[a.jsx(we,{...c}),"Create file"]}),a.jsxs(C,{onSelect:()=>w(),children:[a.jsx(oe,{...c}),"Create folder"]}),a.jsx(L,{})]}),a.jsxs(C,{onSelect:()=>t.edit(),children:[a.jsx(_e,{...c}),"Rename"]}),!t.data.isDirectory&&a.jsxs(C,{onSelect:g,children:[a.jsx(ge,{...c}),"Duplicate"]}),a.jsxs(C,{onSelect:async()=>{await X(t.data.path),O({title:"Copied to clipboard"})},children:[a.jsx(le,{...c}),"Copy path"]}),d&&a.jsxs(C,{onSelect:async()=>{await X(d.relativeFromRoot(t.data.path)),O({title:"Copied to clipboard"})},children:[a.jsx(le,{...c}),"Copy relative path"]}),a.jsx(L,{}),a.jsxs(C,{onSelect:()=>{const{path:y}=t.data,v=ke[l](y);f({code:v,before:!1,cellId:x??"__end__"})},children:[a.jsx(Vt,{...c}),"Insert snippet for reading file"]}),a.jsxs(C,{onSelect:async()=>{O({title:"Copied to clipboard",description:"Code to open the file has been copied to your clipboard. You can also drag and drop this file into the editor"});const{path:y}=t.data,v=ke[l](y);await X(v)},children:[a.jsx(Mt,{...c}),"Copy snippet for reading file"]}),t.data.isMarimoFile&&!Z()&&a.jsxs(a.Fragment,{children:[a.jsx(L,{}),a.jsxs(C,{onSelect:j,children:[a.jsx(Ne,{...c}),"Open notebook"]})]}),a.jsx(L,{}),!t.data.isDirectory&&a.jsxs(a.Fragment,{children:[a.jsxs(C,{onSelect:async()=>{const y=(await o({path:t.data.path})).contents||"";je(new Blob([y]),t.data.name)},children:[a.jsx(ue,{...c}),"Download"]}),a.jsx(L,{})]}),a.jsxs(C,{onSelect:h,variant:"danger",children:[a.jsx(zt,{...c}),"Delete"]})]})})()]})]})]})},Ve=t=>{const e=M.c(3),{node:s}=t;if(!s.data.isDirectory){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=a.jsx("span",{className:"w-5 h-5 shrink-0"}),e[0]=i):i=e[0],i}let r;return e[1]!==s.isOpen?(r=s.isOpen?a.jsx(Nt,{className:"w-5 h-5 shrink-0"}):a.jsx(St,{className:"w-5 h-5 shrink-0"}),e[1]=s.isOpen,e[2]=r):r=e[2],r};function me(t,e){t.stopPropagation(),t.preventDefault(),It(e)}function Le(){return null}function Ue(t){const{parentNode:e}=t;return!e.data.isDirectory}function Ke(t){return t.stopPropagation()}Fe=()=>{const t=M.c(20),{ref:e,height:s}=Rt(),r=s===void 0?1:s;let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={noClick:!0,noKeyboard:!0},t[0]=i):i=t[0];const{getRootProps:o,getInputProps:l,isDragActive:m}=he(i);let n,u,f,x,d,j,h,w;return t[1]!==o?(n=o(),t[1]=o,t[2]=n):n=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(u=ne("flex flex-col flex-1 overflow-hidden relative"),t[3]=u):u=t[3],t[4]!==l?(f=l(),t[4]=l,t[5]=f):f=t[5],t[6]!==f?(x=a.jsx("input",{...f}),t[6]=f,t[7]=x):x=t[7],t[8]!==m?(d=m&&a.jsx("div",{className:"absolute inset-0 flex items-center uppercase justify-center text-xl font-bold text-primary/90 bg-accent/85 z-10 border-2 border-dashed border-primary/90 rounded-lg pointer-events-none",children:"Drop files here"}),t[8]=m,t[9]=d):d=t[9],t[10]!==r?(j=a.jsx(Ee,{height:r}),t[10]=r,t[11]=j):j=t[11],t[12]!==e||t[13]!==j?(h=a.jsx("div",{ref:e,className:"flex flex-col flex-1 overflow-hidden",children:j}),t[12]=e,t[13]=j,t[14]=h):h=t[14],t[15]!==n||t[16]!==x||t[17]!==d||t[18]!==h?(w=a.jsxs("div",{...n,className:u,children:[x,d,h]}),t[15]=n,t[16]=x,t[17]=d,t[18]=h,t[19]=w):w=t[19],w}});export{Kt as __tla,Fe as default};
@@ -1,4 +1,4 @@
1
- var P1;import{g as Wt}from"./chunk-FMBD7UC4-Bd0Czs-J.js";import{_ as y,o as Pt,l as J,c as p1,p as jt,r as zt,u as Z1,b as Kt,s as Yt,q as Ht,a as qt,g as Xt,t as Qt,j as Jt,v as Zt,J as te,x as ee,y as tt,z as se,A as ie,B as ne}from"./mermaid.core-BFFCqfOn.js";import{g as ae}from"./chunk-55IACEB6-DZAiDJxy.js";import{s as ue}from"./chunk-QN33PNHL-E0jwHU_n.js";import{s as E1}from"./transform-D9VCJYws.js";import{c as re}from"./channel-DHcKBVM4.js";import"./index-PmY0x4Zd.js";import"./step-BwsUM5iJ.js";import"./isEmpty-D1t7Gran.js";import"./timer-Bqd5yn_a.js";var oe=(P1=class{constructor(){this.vertexCounter=0,this.config=p1(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=Kt,this.setAccDescription=Yt,this.setDiagramTitle=Ht,this.getAccTitle=qt,this.getAccDescription=Xt,this.getDiagramTitle=Qt,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(i){return Jt.sanitizeText(i,this.config)}lookUpDomId(i){for(const a of this.vertices.values())if(a.id===i)return a.domId;return i}addVertex(i,a,n,r,u,g,p={},c){var j,k;if(!i||i.trim().length===0)return;let o;if(c!==void 0){let d;d=c.includes(`
1
+ var P1;import{g as Wt}from"./chunk-FMBD7UC4-DPuNbQ-f.js";import{_ as y,o as Pt,l as J,c as p1,p as jt,r as zt,u as Z1,b as Kt,s as Yt,q as Ht,a as qt,g as Xt,t as Qt,j as Jt,v as Zt,J as te,x as ee,y as tt,z as se,A as ie,B as ne}from"./mermaid.core-DzthE35Y.js";import{g as ae}from"./chunk-55IACEB6-CAATkc4w.js";import{s as ue}from"./chunk-QN33PNHL-DiZZ09q4.js";import{s as E1}from"./transform-D9VCJYws.js";import{c as re}from"./channel-Co6iMgWq.js";import"./index-C7CoaNFb.js";import"./step-BwsUM5iJ.js";import"./isEmpty-D-4c7sMv.js";import"./timer-Bqd5yn_a.js";var oe=(P1=class{constructor(){this.vertexCounter=0,this.config=p1(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=Kt,this.setAccDescription=Yt,this.setDiagramTitle=Ht,this.getAccTitle=qt,this.getAccDescription=Xt,this.getDiagramTitle=Qt,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(i){return Jt.sanitizeText(i,this.config)}lookUpDomId(i){for(const a of this.vertices.values())if(a.id===i)return a.domId;return i}addVertex(i,a,n,r,u,g,p={},c){var j,k;if(!i||i.trim().length===0)return;let o;if(c!==void 0){let d;d=c.includes(`
2
2
  `)?c+`
3
3
  `:`{
4
4
  `+c+`
@@ -1,4 +1,4 @@
1
- import{_ as l,g as le,s as de,t as ue,q as he,a as fe,b as me,c as ot,d as ye,aq as V,l as mt,j as ke,i as pe,z as ge,u as xe}from"./mermaid.core-BFFCqfOn.js";import{ai as gt,eG as Wt,eE as Ot,eD as be,fc as ve,fd as Te,fe as we,ff as _e,fg as De,fh as $e,eC as Pt,eB as zt,eA as Bt,ek as Ht,et as Nt}from"./index-PmY0x4Zd.js";import{s as xt}from"./transform-D9VCJYws.js";import{t as Se,m as Ce,a as Ee,i as Me}from"./time-CsYqILfB.js";import{l as Ae}from"./linear-BwY8e5hA.js";import"./step-BwsUM5iJ.js";import"./isEmpty-D1t7Gran.js";import"./timer-Bqd5yn_a.js";import"./init-DLRA0X12.js";function Le(e){return e}var Gt=1e-6;function Ye(e){return"translate("+e+",0)"}function Ie(e){return"translate(0,"+e+")"}function Fe(e){return n=>+e(n)}function We(e,n){return n=Math.max(0,e.bandwidth()-2*n)/2,e.round()&&(n=Math.round(n)),s=>+e(s)+n}function Oe(){return!this.__axis}function jt(e,n){var s=[],r=null,i=null,c=6,u=6,A=3,v=typeof window<"u"&&window.devicePixelRatio>1?0:.5,$=e===1||e===4?-1:1,L=e===4||e===2?"x":"y",F=e===1||e===3?Ye:Ie;function C(D){var g=r??(n.ticks?n.ticks.apply(n,s):n.domain()),k=i??(n.tickFormat?n.tickFormat.apply(n,s):Le),E=Math.max(c,0)+A,M=n.range(),P=+M[0]+v,z=+M[M.length-1]+v,j=(n.bandwidth?We:Fe)(n.copy(),v),B=D.selection?D.selection():D,W=B.selectAll(".domain").data([null]),I=B.selectAll(".tick").data(g,n).order(),p=I.exit(),w=I.enter().append("g").attr("class","tick"),b=I.select("line"),x=I.select("text");W=W.merge(W.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),I=I.merge(w),b=b.merge(w.append("line").attr("stroke","currentColor").attr(L+"2",$*c)),x=x.merge(w.append("text").attr("fill","currentColor").attr(L,$*E).attr("dy",e===1?"0em":e===3?"0.71em":"0.32em")),D!==B&&(W=W.transition(D),I=I.transition(D),b=b.transition(D),x=x.transition(D),p=p.transition(D).attr("opacity",Gt).attr("transform",function(y){return isFinite(y=j(y))?F(y+v):this.getAttribute("transform")}),w.attr("opacity",Gt).attr("transform",function(y){var o=this.parentNode.__axis;return F((o&&isFinite(o=o(y))?o:j(y))+v)})),p.remove(),W.attr("d",e===4||e===2?u?"M"+$*u+","+P+"H"+v+"V"+z+"H"+$*u:"M"+v+","+P+"V"+z:u?"M"+P+","+$*u+"V"+v+"H"+z+"V"+$*u:"M"+P+","+v+"H"+z),I.attr("opacity",1).attr("transform",function(y){return F(j(y)+v)}),b.attr(L+"2",$*c),x.attr(L,$*E).text(k),B.filter(Oe).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===2?"start":e===4?"end":"middle"),B.each(function(){this.__axis=j})}return C.scale=function(D){return arguments.length?(n=D,C):n},C.ticks=function(){return s=Array.from(arguments),C},C.tickArguments=function(D){return arguments.length?(s=D==null?[]:Array.from(D),C):s.slice()},C.tickValues=function(D){return arguments.length?(r=D==null?null:Array.from(D),C):r&&r.slice()},C.tickFormat=function(D){return arguments.length?(i=D,C):i},C.tickSize=function(D){return arguments.length?(c=u=+D,C):c},C.tickSizeInner=function(D){return arguments.length?(c=+D,C):c},C.tickSizeOuter=function(D){return arguments.length?(u=+D,C):u},C.tickPadding=function(D){return arguments.length?(A=+D,C):A},C.offset=function(D){return arguments.length?(v=+D,C):v},C}var Vt,yt,Rt={exports:{}};const Pe=gt(Vt?Rt.exports:(Vt=1,Rt.exports=(yt="day",function(e,n,s){var r=function(u){return u.add(4-u.isoWeekday(),yt)},i=n.prototype;i.isoWeekYear=function(){return r(this).year()},i.isoWeek=function(u){if(!this.$utils().u(u))return this.add(7*(u-this.isoWeek()),yt);var A,v,$,L=r(this),F=(A=this.isoWeekYear(),$=4-(v=(this.$u?s.utc:s)().year(A).startOf("year")).isoWeekday(),v.isoWeekday()>4&&($+=7),v.add($,yt));return L.diff(F,"week")+1},i.isoWeekday=function(u){return this.$utils().u(u)?this.day()||7:this.day(this.day()%7?u:u-7)};var c=i.startOf;i.startOf=function(u,A){var v=this.$utils(),$=!!v.u(A)||A;return v.p(u)==="isoweek"?$?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):c.bind(this)(u,A)}})));var Zt,qt={exports:{}},ze=(Zt||(Zt=1,qt.exports=(function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},n=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,s=/\d/,r=/\d\d/,i=/\d\d?/,c=/\d*[^-_:/,()\s\d]+/,u={},A=function(g){return(g=+g)+(g>68?1900:2e3)},v=function(g){return function(k){this[g]=+k}},$=[/[+-]\d\d:?(\d\d)?|Z/,function(g){(this.zone||(this.zone={})).offset=(function(k){if(!k||k==="Z")return 0;var E=k.match(/([+-]|\d\d)/g),M=60*E[1]+(+E[2]||0);return M===0?0:E[0]==="+"?-M:M})(g)}],L=function(g){var k=u[g];return k&&(k.indexOf?k:k.s.concat(k.f))},F=function(g,k){var E,M=u.meridiem;if(M){for(var P=1;P<=24;P+=1)if(g.indexOf(M(P,0,k))>-1){E=P>12;break}}else E=g===(k?"pm":"PM");return E},C={A:[c,function(g){this.afternoon=F(g,!1)}],a:[c,function(g){this.afternoon=F(g,!0)}],Q:[s,function(g){this.month=3*(g-1)+1}],S:[s,function(g){this.milliseconds=100*+g}],SS:[r,function(g){this.milliseconds=10*+g}],SSS:[/\d{3}/,function(g){this.milliseconds=+g}],s:[i,v("seconds")],ss:[i,v("seconds")],m:[i,v("minutes")],mm:[i,v("minutes")],H:[i,v("hours")],h:[i,v("hours")],HH:[i,v("hours")],hh:[i,v("hours")],D:[i,v("day")],DD:[r,v("day")],Do:[c,function(g){var k=u.ordinal,E=g.match(/\d+/);if(this.day=E[0],k)for(var M=1;M<=31;M+=1)k(M).replace(/\[|\]/g,"")===g&&(this.day=M)}],w:[i,v("week")],ww:[r,v("week")],M:[i,v("month")],MM:[r,v("month")],MMM:[c,function(g){var k=L("months"),E=(L("monthsShort")||k.map(function(M){return M.slice(0,3)})).indexOf(g)+1;if(E<1)throw new Error;this.month=E%12||E}],MMMM:[c,function(g){var k=L("months").indexOf(g)+1;if(k<1)throw new Error;this.month=k%12||k}],Y:[/[+-]?\d+/,v("year")],YY:[r,function(g){this.year=A(g)}],YYYY:[/\d{4}/,v("year")],Z:$,ZZ:$};function D(g){var k,E;k=g,E=u&&u.formats;for(var M=(g=k.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(p,w,b){var x=b&&b.toUpperCase();return w||E[b]||e[b]||E[x].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(y,o,m){return o||m.slice(1)})})).match(n),P=M.length,z=0;z<P;z+=1){var j=M[z],B=C[j],W=B&&B[0],I=B&&B[1];M[z]=I?{regex:W,parser:I}:j.replace(/^\[|\]$/g,"")}return function(p){for(var w={},b=0,x=0;b<P;b+=1){var y=M[b];if(typeof y=="string")x+=y.length;else{var o=y.regex,m=y.parser,h=p.slice(x),d=o.exec(h)[0];m.call(w,d),p=p.replace(d,"")}}return(function(T){var t=T.afternoon;if(t!==void 0){var f=T.hours;t?f<12&&(T.hours+=12):f===12&&(T.hours=0),delete T.afternoon}})(w),w}}return function(g,k,E){E.p.customParseFormat=!0,g&&g.parseTwoDigitYear&&(A=g.parseTwoDigitYear);var M=k.prototype,P=M.parse;M.parse=function(z){var j=z.date,B=z.utc,W=z.args;this.$u=B;var I=W[1];if(typeof I=="string"){var p=W[2]===!0,w=W[3]===!0,b=p||w,x=W[2];w&&(x=W[2]),u=this.$locale(),!p&&x&&(u=E.Ls[x]),this.$d=(function(h,d,T,t){try{if(["x","X"].indexOf(d)>-1)return new Date((d==="X"?1e3:1)*h);var f=D(d)(h),a=f.year,_=f.month,Y=f.day,O=f.hours,S=f.minutes,q=f.seconds,tt=f.milliseconds,rt=f.zone,ft=f.week,st=new Date,N=Y||(a||_?1:st.getDate()),U=a||st.getFullYear(),G=0;a&&!_||(G=_>0?_-1:st.getMonth());var et,X=O||0,R=S||0,at=q||0,J=tt||0;return rt?new Date(Date.UTC(U,G,N,X,R,at,J+60*rt.offset*1e3)):T?new Date(Date.UTC(U,G,N,X,R,at,J)):(et=new Date(U,G,N,X,R,at,J),ft&&(et=t(et).week(ft).toDate()),et)}catch{return new Date("")}})(j,I,B,E),this.init(),x&&x!==!0&&(this.$L=this.locale(x).$L),b&&j!=this.format(I)&&(this.$d=new Date("")),u={}}else if(I instanceof Array)for(var y=I.length,o=1;o<=y;o+=1){W[1]=I[o-1];var m=E.apply(this,W);if(m.isValid()){this.$d=m.$d,this.$L=m.$L,this.init();break}o===y&&(this.$d=new Date(""))}else P.call(this,z)}}})()),qt.exports);const Be=gt(ze);var Ut,Qt={exports:{}},He=(Ut||(Ut=1,Qt.exports=function(e,n){var s=n.prototype,r=s.format;s.format=function(i){var c=this,u=this.$locale();if(!this.isValid())return r.bind(this)(i);var A=this.$utils(),v=(i||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function($){switch($){case"Q":return Math.ceil((c.$M+1)/3);case"Do":return u.ordinal(c.$D);case"gggg":return c.weekYear();case"GGGG":return c.isoWeekYear();case"wo":return u.ordinal(c.week(),"W");case"w":case"ww":return A.s(c.week(),$==="w"?1:2,"0");case"W":case"WW":return A.s(c.isoWeek(),$==="W"?1:2,"0");case"k":case"kk":return A.s(String(c.$H===0?24:c.$H),$==="k"?1:2,"0");case"X":return Math.floor(c.$d.getTime()/1e3);case"x":return c.$d.getTime();case"z":return"["+c.offsetName()+"]";case"zzz":return"["+c.offsetName("long")+"]";default:return $}});return r.bind(this)(v)}}),Qt.exports);const Ne=gt(He);var bt=(function(){var e=l(function(o,m,h,d){for(h=h||{},d=o.length;d--;h[o[d]]=m);return h},"o"),n=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],s=[1,26],r=[1,27],i=[1,28],c=[1,29],u=[1,30],A=[1,31],v=[1,32],$=[1,33],L=[1,34],F=[1,9],C=[1,10],D=[1,11],g=[1,12],k=[1,13],E=[1,14],M=[1,15],P=[1,16],z=[1,19],j=[1,20],B=[1,21],W=[1,22],I=[1,23],p=[1,25],w=[1,35],b={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:l(function(o,m,h,d,T,t,f){var a=t.length-1;switch(T){case 1:return t[a-1];case 2:case 6:case 7:this.$=[];break;case 3:t[a-1].push(t[a]),this.$=t[a-1];break;case 4:case 5:this.$=t[a];break;case 8:d.setWeekday("monday");break;case 9:d.setWeekday("tuesday");break;case 10:d.setWeekday("wednesday");break;case 11:d.setWeekday("thursday");break;case 12:d.setWeekday("friday");break;case 13:d.setWeekday("saturday");break;case 14:d.setWeekday("sunday");break;case 15:d.setWeekend("friday");break;case 16:d.setWeekend("saturday");break;case 17:d.setDateFormat(t[a].substr(11)),this.$=t[a].substr(11);break;case 18:d.enableInclusiveEndDates(),this.$=t[a].substr(18);break;case 19:d.TopAxis(),this.$=t[a].substr(8);break;case 20:d.setAxisFormat(t[a].substr(11)),this.$=t[a].substr(11);break;case 21:d.setTickInterval(t[a].substr(13)),this.$=t[a].substr(13);break;case 22:d.setExcludes(t[a].substr(9)),this.$=t[a].substr(9);break;case 23:d.setIncludes(t[a].substr(9)),this.$=t[a].substr(9);break;case 24:d.setTodayMarker(t[a].substr(12)),this.$=t[a].substr(12);break;case 27:d.setDiagramTitle(t[a].substr(6)),this.$=t[a].substr(6);break;case 28:this.$=t[a].trim(),d.setAccTitle(this.$);break;case 29:case 30:this.$=t[a].trim(),d.setAccDescription(this.$);break;case 31:d.addSection(t[a].substr(8)),this.$=t[a].substr(8);break;case 33:d.addTask(t[a-1],t[a]),this.$="task";break;case 34:this.$=t[a-1],d.setClickEvent(t[a-1],t[a],null);break;case 35:this.$=t[a-2],d.setClickEvent(t[a-2],t[a-1],t[a]);break;case 36:this.$=t[a-2],d.setClickEvent(t[a-2],t[a-1],null),d.setLink(t[a-2],t[a]);break;case 37:this.$=t[a-3],d.setClickEvent(t[a-3],t[a-2],t[a-1]),d.setLink(t[a-3],t[a]);break;case 38:this.$=t[a-2],d.setClickEvent(t[a-2],t[a],null),d.setLink(t[a-2],t[a-1]);break;case 39:this.$=t[a-3],d.setClickEvent(t[a-3],t[a-1],t[a]),d.setLink(t[a-3],t[a-2]);break;case 40:this.$=t[a-1],d.setLink(t[a-1],t[a]);break;case 41:case 47:this.$=t[a-1]+" "+t[a];break;case 42:case 43:case 45:this.$=t[a-2]+" "+t[a-1]+" "+t[a];break;case 44:case 46:this.$=t[a-3]+" "+t[a-2]+" "+t[a-1]+" "+t[a]}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(n,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:s,13:r,14:i,15:c,16:u,17:A,18:v,19:18,20:$,21:L,22:F,23:C,24:D,25:g,26:k,27:E,28:M,29:P,30:z,31:j,33:B,35:W,36:I,37:24,38:p,40:w},e(n,[2,7],{1:[2,1]}),e(n,[2,3]),{9:36,11:17,12:s,13:r,14:i,15:c,16:u,17:A,18:v,19:18,20:$,21:L,22:F,23:C,24:D,25:g,26:k,27:E,28:M,29:P,30:z,31:j,33:B,35:W,36:I,37:24,38:p,40:w},e(n,[2,5]),e(n,[2,6]),e(n,[2,17]),e(n,[2,18]),e(n,[2,19]),e(n,[2,20]),e(n,[2,21]),e(n,[2,22]),e(n,[2,23]),e(n,[2,24]),e(n,[2,25]),e(n,[2,26]),e(n,[2,27]),{32:[1,37]},{34:[1,38]},e(n,[2,30]),e(n,[2,31]),e(n,[2,32]),{39:[1,39]},e(n,[2,8]),e(n,[2,9]),e(n,[2,10]),e(n,[2,11]),e(n,[2,12]),e(n,[2,13]),e(n,[2,14]),e(n,[2,15]),e(n,[2,16]),{41:[1,40],43:[1,41]},e(n,[2,4]),e(n,[2,28]),e(n,[2,29]),e(n,[2,33]),e(n,[2,34],{42:[1,42],43:[1,43]}),e(n,[2,40],{41:[1,44]}),e(n,[2,35],{43:[1,45]}),e(n,[2,36]),e(n,[2,38],{42:[1,46]}),e(n,[2,37]),e(n,[2,39])],defaultActions:{},parseError:l(function(o,m){if(!m.recoverable){var h=new Error(o);throw h.hash=m,h}this.trace(o)},"parseError"),parse:l(function(o){var m=this,h=[0],d=[],T=[null],t=[],f=this.table,a="",_=0,Y=0,O=t.slice.call(arguments,1),S=Object.create(this.lexer),q={yy:{}};for(var tt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,tt)&&(q.yy[tt]=this.yy[tt]);S.setInput(o,q.yy),q.yy.lexer=S,q.yy.parser=this,S.yylloc===void 0&&(S.yylloc={});var rt=S.yylloc;t.push(rt);var ft=S.options&&S.options.ranges;function st(){var Z;return typeof(Z=d.pop()||S.lex()||1)!="number"&&(Z instanceof Array&&(Z=(d=Z).pop()),Z=m.symbols_[Z]||Z),Z}typeof q.yy.parseError=="function"?this.parseError=q.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,l(function(Z){h.length=h.length-2*Z,T.length=T.length-Z,t.length=t.length-Z},"popStack"),l(st,"lex");for(var N,U,G,et,X,R,at,J,nt={};;){if(U=h[h.length-1],this.defaultActions[U]?G=this.defaultActions[U]:(N==null&&(N=st()),G=f[U]&&f[U][N]),G===void 0||!G.length||!G[0]){var Ft="";for(X in J=[],f[U])this.terminals_[X]&&X>2&&J.push("'"+this.terminals_[X]+"'");Ft=S.showPosition?"Parse error on line "+(_+1)+`:
1
+ import{_ as l,g as le,s as de,t as ue,q as he,a as fe,b as me,c as ot,d as ye,aq as V,l as mt,j as ke,i as pe,z as ge,u as xe}from"./mermaid.core-DzthE35Y.js";import{ai as gt,eG as Wt,eE as Ot,eD as be,fc as ve,fd as Te,fe as we,ff as _e,fg as De,fh as $e,eC as Pt,eB as zt,eA as Bt,ek as Ht,et as Nt}from"./index-C7CoaNFb.js";import{s as xt}from"./transform-D9VCJYws.js";import{t as Se,m as Ce,a as Ee,i as Me}from"./time-hUzZfpNE.js";import{l as Ae}from"./linear-D8s7K76e.js";import"./step-BwsUM5iJ.js";import"./isEmpty-D-4c7sMv.js";import"./timer-Bqd5yn_a.js";import"./init-DLRA0X12.js";function Le(e){return e}var Gt=1e-6;function Ye(e){return"translate("+e+",0)"}function Ie(e){return"translate(0,"+e+")"}function Fe(e){return n=>+e(n)}function We(e,n){return n=Math.max(0,e.bandwidth()-2*n)/2,e.round()&&(n=Math.round(n)),s=>+e(s)+n}function Oe(){return!this.__axis}function jt(e,n){var s=[],r=null,i=null,c=6,u=6,A=3,v=typeof window<"u"&&window.devicePixelRatio>1?0:.5,$=e===1||e===4?-1:1,L=e===4||e===2?"x":"y",F=e===1||e===3?Ye:Ie;function C(D){var g=r??(n.ticks?n.ticks.apply(n,s):n.domain()),k=i??(n.tickFormat?n.tickFormat.apply(n,s):Le),E=Math.max(c,0)+A,M=n.range(),P=+M[0]+v,z=+M[M.length-1]+v,j=(n.bandwidth?We:Fe)(n.copy(),v),B=D.selection?D.selection():D,W=B.selectAll(".domain").data([null]),I=B.selectAll(".tick").data(g,n).order(),p=I.exit(),w=I.enter().append("g").attr("class","tick"),b=I.select("line"),x=I.select("text");W=W.merge(W.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),I=I.merge(w),b=b.merge(w.append("line").attr("stroke","currentColor").attr(L+"2",$*c)),x=x.merge(w.append("text").attr("fill","currentColor").attr(L,$*E).attr("dy",e===1?"0em":e===3?"0.71em":"0.32em")),D!==B&&(W=W.transition(D),I=I.transition(D),b=b.transition(D),x=x.transition(D),p=p.transition(D).attr("opacity",Gt).attr("transform",function(y){return isFinite(y=j(y))?F(y+v):this.getAttribute("transform")}),w.attr("opacity",Gt).attr("transform",function(y){var o=this.parentNode.__axis;return F((o&&isFinite(o=o(y))?o:j(y))+v)})),p.remove(),W.attr("d",e===4||e===2?u?"M"+$*u+","+P+"H"+v+"V"+z+"H"+$*u:"M"+v+","+P+"V"+z:u?"M"+P+","+$*u+"V"+v+"H"+z+"V"+$*u:"M"+P+","+v+"H"+z),I.attr("opacity",1).attr("transform",function(y){return F(j(y)+v)}),b.attr(L+"2",$*c),x.attr(L,$*E).text(k),B.filter(Oe).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===2?"start":e===4?"end":"middle"),B.each(function(){this.__axis=j})}return C.scale=function(D){return arguments.length?(n=D,C):n},C.ticks=function(){return s=Array.from(arguments),C},C.tickArguments=function(D){return arguments.length?(s=D==null?[]:Array.from(D),C):s.slice()},C.tickValues=function(D){return arguments.length?(r=D==null?null:Array.from(D),C):r&&r.slice()},C.tickFormat=function(D){return arguments.length?(i=D,C):i},C.tickSize=function(D){return arguments.length?(c=u=+D,C):c},C.tickSizeInner=function(D){return arguments.length?(c=+D,C):c},C.tickSizeOuter=function(D){return arguments.length?(u=+D,C):u},C.tickPadding=function(D){return arguments.length?(A=+D,C):A},C.offset=function(D){return arguments.length?(v=+D,C):v},C}var Vt,yt,Rt={exports:{}};const Pe=gt(Vt?Rt.exports:(Vt=1,Rt.exports=(yt="day",function(e,n,s){var r=function(u){return u.add(4-u.isoWeekday(),yt)},i=n.prototype;i.isoWeekYear=function(){return r(this).year()},i.isoWeek=function(u){if(!this.$utils().u(u))return this.add(7*(u-this.isoWeek()),yt);var A,v,$,L=r(this),F=(A=this.isoWeekYear(),$=4-(v=(this.$u?s.utc:s)().year(A).startOf("year")).isoWeekday(),v.isoWeekday()>4&&($+=7),v.add($,yt));return L.diff(F,"week")+1},i.isoWeekday=function(u){return this.$utils().u(u)?this.day()||7:this.day(this.day()%7?u:u-7)};var c=i.startOf;i.startOf=function(u,A){var v=this.$utils(),$=!!v.u(A)||A;return v.p(u)==="isoweek"?$?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):c.bind(this)(u,A)}})));var Zt,qt={exports:{}},ze=(Zt||(Zt=1,qt.exports=(function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},n=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,s=/\d/,r=/\d\d/,i=/\d\d?/,c=/\d*[^-_:/,()\s\d]+/,u={},A=function(g){return(g=+g)+(g>68?1900:2e3)},v=function(g){return function(k){this[g]=+k}},$=[/[+-]\d\d:?(\d\d)?|Z/,function(g){(this.zone||(this.zone={})).offset=(function(k){if(!k||k==="Z")return 0;var E=k.match(/([+-]|\d\d)/g),M=60*E[1]+(+E[2]||0);return M===0?0:E[0]==="+"?-M:M})(g)}],L=function(g){var k=u[g];return k&&(k.indexOf?k:k.s.concat(k.f))},F=function(g,k){var E,M=u.meridiem;if(M){for(var P=1;P<=24;P+=1)if(g.indexOf(M(P,0,k))>-1){E=P>12;break}}else E=g===(k?"pm":"PM");return E},C={A:[c,function(g){this.afternoon=F(g,!1)}],a:[c,function(g){this.afternoon=F(g,!0)}],Q:[s,function(g){this.month=3*(g-1)+1}],S:[s,function(g){this.milliseconds=100*+g}],SS:[r,function(g){this.milliseconds=10*+g}],SSS:[/\d{3}/,function(g){this.milliseconds=+g}],s:[i,v("seconds")],ss:[i,v("seconds")],m:[i,v("minutes")],mm:[i,v("minutes")],H:[i,v("hours")],h:[i,v("hours")],HH:[i,v("hours")],hh:[i,v("hours")],D:[i,v("day")],DD:[r,v("day")],Do:[c,function(g){var k=u.ordinal,E=g.match(/\d+/);if(this.day=E[0],k)for(var M=1;M<=31;M+=1)k(M).replace(/\[|\]/g,"")===g&&(this.day=M)}],w:[i,v("week")],ww:[r,v("week")],M:[i,v("month")],MM:[r,v("month")],MMM:[c,function(g){var k=L("months"),E=(L("monthsShort")||k.map(function(M){return M.slice(0,3)})).indexOf(g)+1;if(E<1)throw new Error;this.month=E%12||E}],MMMM:[c,function(g){var k=L("months").indexOf(g)+1;if(k<1)throw new Error;this.month=k%12||k}],Y:[/[+-]?\d+/,v("year")],YY:[r,function(g){this.year=A(g)}],YYYY:[/\d{4}/,v("year")],Z:$,ZZ:$};function D(g){var k,E;k=g,E=u&&u.formats;for(var M=(g=k.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(p,w,b){var x=b&&b.toUpperCase();return w||E[b]||e[b]||E[x].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(y,o,m){return o||m.slice(1)})})).match(n),P=M.length,z=0;z<P;z+=1){var j=M[z],B=C[j],W=B&&B[0],I=B&&B[1];M[z]=I?{regex:W,parser:I}:j.replace(/^\[|\]$/g,"")}return function(p){for(var w={},b=0,x=0;b<P;b+=1){var y=M[b];if(typeof y=="string")x+=y.length;else{var o=y.regex,m=y.parser,h=p.slice(x),d=o.exec(h)[0];m.call(w,d),p=p.replace(d,"")}}return(function(T){var t=T.afternoon;if(t!==void 0){var f=T.hours;t?f<12&&(T.hours+=12):f===12&&(T.hours=0),delete T.afternoon}})(w),w}}return function(g,k,E){E.p.customParseFormat=!0,g&&g.parseTwoDigitYear&&(A=g.parseTwoDigitYear);var M=k.prototype,P=M.parse;M.parse=function(z){var j=z.date,B=z.utc,W=z.args;this.$u=B;var I=W[1];if(typeof I=="string"){var p=W[2]===!0,w=W[3]===!0,b=p||w,x=W[2];w&&(x=W[2]),u=this.$locale(),!p&&x&&(u=E.Ls[x]),this.$d=(function(h,d,T,t){try{if(["x","X"].indexOf(d)>-1)return new Date((d==="X"?1e3:1)*h);var f=D(d)(h),a=f.year,_=f.month,Y=f.day,O=f.hours,S=f.minutes,q=f.seconds,tt=f.milliseconds,rt=f.zone,ft=f.week,st=new Date,N=Y||(a||_?1:st.getDate()),U=a||st.getFullYear(),G=0;a&&!_||(G=_>0?_-1:st.getMonth());var et,X=O||0,R=S||0,at=q||0,J=tt||0;return rt?new Date(Date.UTC(U,G,N,X,R,at,J+60*rt.offset*1e3)):T?new Date(Date.UTC(U,G,N,X,R,at,J)):(et=new Date(U,G,N,X,R,at,J),ft&&(et=t(et).week(ft).toDate()),et)}catch{return new Date("")}})(j,I,B,E),this.init(),x&&x!==!0&&(this.$L=this.locale(x).$L),b&&j!=this.format(I)&&(this.$d=new Date("")),u={}}else if(I instanceof Array)for(var y=I.length,o=1;o<=y;o+=1){W[1]=I[o-1];var m=E.apply(this,W);if(m.isValid()){this.$d=m.$d,this.$L=m.$L,this.init();break}o===y&&(this.$d=new Date(""))}else P.call(this,z)}}})()),qt.exports);const Be=gt(ze);var Ut,Qt={exports:{}},He=(Ut||(Ut=1,Qt.exports=function(e,n){var s=n.prototype,r=s.format;s.format=function(i){var c=this,u=this.$locale();if(!this.isValid())return r.bind(this)(i);var A=this.$utils(),v=(i||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function($){switch($){case"Q":return Math.ceil((c.$M+1)/3);case"Do":return u.ordinal(c.$D);case"gggg":return c.weekYear();case"GGGG":return c.isoWeekYear();case"wo":return u.ordinal(c.week(),"W");case"w":case"ww":return A.s(c.week(),$==="w"?1:2,"0");case"W":case"WW":return A.s(c.isoWeek(),$==="W"?1:2,"0");case"k":case"kk":return A.s(String(c.$H===0?24:c.$H),$==="k"?1:2,"0");case"X":return Math.floor(c.$d.getTime()/1e3);case"x":return c.$d.getTime();case"z":return"["+c.offsetName()+"]";case"zzz":return"["+c.offsetName("long")+"]";default:return $}});return r.bind(this)(v)}}),Qt.exports);const Ne=gt(He);var bt=(function(){var e=l(function(o,m,h,d){for(h=h||{},d=o.length;d--;h[o[d]]=m);return h},"o"),n=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],s=[1,26],r=[1,27],i=[1,28],c=[1,29],u=[1,30],A=[1,31],v=[1,32],$=[1,33],L=[1,34],F=[1,9],C=[1,10],D=[1,11],g=[1,12],k=[1,13],E=[1,14],M=[1,15],P=[1,16],z=[1,19],j=[1,20],B=[1,21],W=[1,22],I=[1,23],p=[1,25],w=[1,35],b={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:l(function(o,m,h,d,T,t,f){var a=t.length-1;switch(T){case 1:return t[a-1];case 2:case 6:case 7:this.$=[];break;case 3:t[a-1].push(t[a]),this.$=t[a-1];break;case 4:case 5:this.$=t[a];break;case 8:d.setWeekday("monday");break;case 9:d.setWeekday("tuesday");break;case 10:d.setWeekday("wednesday");break;case 11:d.setWeekday("thursday");break;case 12:d.setWeekday("friday");break;case 13:d.setWeekday("saturday");break;case 14:d.setWeekday("sunday");break;case 15:d.setWeekend("friday");break;case 16:d.setWeekend("saturday");break;case 17:d.setDateFormat(t[a].substr(11)),this.$=t[a].substr(11);break;case 18:d.enableInclusiveEndDates(),this.$=t[a].substr(18);break;case 19:d.TopAxis(),this.$=t[a].substr(8);break;case 20:d.setAxisFormat(t[a].substr(11)),this.$=t[a].substr(11);break;case 21:d.setTickInterval(t[a].substr(13)),this.$=t[a].substr(13);break;case 22:d.setExcludes(t[a].substr(9)),this.$=t[a].substr(9);break;case 23:d.setIncludes(t[a].substr(9)),this.$=t[a].substr(9);break;case 24:d.setTodayMarker(t[a].substr(12)),this.$=t[a].substr(12);break;case 27:d.setDiagramTitle(t[a].substr(6)),this.$=t[a].substr(6);break;case 28:this.$=t[a].trim(),d.setAccTitle(this.$);break;case 29:case 30:this.$=t[a].trim(),d.setAccDescription(this.$);break;case 31:d.addSection(t[a].substr(8)),this.$=t[a].substr(8);break;case 33:d.addTask(t[a-1],t[a]),this.$="task";break;case 34:this.$=t[a-1],d.setClickEvent(t[a-1],t[a],null);break;case 35:this.$=t[a-2],d.setClickEvent(t[a-2],t[a-1],t[a]);break;case 36:this.$=t[a-2],d.setClickEvent(t[a-2],t[a-1],null),d.setLink(t[a-2],t[a]);break;case 37:this.$=t[a-3],d.setClickEvent(t[a-3],t[a-2],t[a-1]),d.setLink(t[a-3],t[a]);break;case 38:this.$=t[a-2],d.setClickEvent(t[a-2],t[a],null),d.setLink(t[a-2],t[a-1]);break;case 39:this.$=t[a-3],d.setClickEvent(t[a-3],t[a-1],t[a]),d.setLink(t[a-3],t[a-2]);break;case 40:this.$=t[a-1],d.setLink(t[a-1],t[a]);break;case 41:case 47:this.$=t[a-1]+" "+t[a];break;case 42:case 43:case 45:this.$=t[a-2]+" "+t[a-1]+" "+t[a];break;case 44:case 46:this.$=t[a-3]+" "+t[a-2]+" "+t[a-1]+" "+t[a]}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(n,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:s,13:r,14:i,15:c,16:u,17:A,18:v,19:18,20:$,21:L,22:F,23:C,24:D,25:g,26:k,27:E,28:M,29:P,30:z,31:j,33:B,35:W,36:I,37:24,38:p,40:w},e(n,[2,7],{1:[2,1]}),e(n,[2,3]),{9:36,11:17,12:s,13:r,14:i,15:c,16:u,17:A,18:v,19:18,20:$,21:L,22:F,23:C,24:D,25:g,26:k,27:E,28:M,29:P,30:z,31:j,33:B,35:W,36:I,37:24,38:p,40:w},e(n,[2,5]),e(n,[2,6]),e(n,[2,17]),e(n,[2,18]),e(n,[2,19]),e(n,[2,20]),e(n,[2,21]),e(n,[2,22]),e(n,[2,23]),e(n,[2,24]),e(n,[2,25]),e(n,[2,26]),e(n,[2,27]),{32:[1,37]},{34:[1,38]},e(n,[2,30]),e(n,[2,31]),e(n,[2,32]),{39:[1,39]},e(n,[2,8]),e(n,[2,9]),e(n,[2,10]),e(n,[2,11]),e(n,[2,12]),e(n,[2,13]),e(n,[2,14]),e(n,[2,15]),e(n,[2,16]),{41:[1,40],43:[1,41]},e(n,[2,4]),e(n,[2,28]),e(n,[2,29]),e(n,[2,33]),e(n,[2,34],{42:[1,42],43:[1,43]}),e(n,[2,40],{41:[1,44]}),e(n,[2,35],{43:[1,45]}),e(n,[2,36]),e(n,[2,38],{42:[1,46]}),e(n,[2,37]),e(n,[2,39])],defaultActions:{},parseError:l(function(o,m){if(!m.recoverable){var h=new Error(o);throw h.hash=m,h}this.trace(o)},"parseError"),parse:l(function(o){var m=this,h=[0],d=[],T=[null],t=[],f=this.table,a="",_=0,Y=0,O=t.slice.call(arguments,1),S=Object.create(this.lexer),q={yy:{}};for(var tt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,tt)&&(q.yy[tt]=this.yy[tt]);S.setInput(o,q.yy),q.yy.lexer=S,q.yy.parser=this,S.yylloc===void 0&&(S.yylloc={});var rt=S.yylloc;t.push(rt);var ft=S.options&&S.options.ranges;function st(){var Z;return typeof(Z=d.pop()||S.lex()||1)!="number"&&(Z instanceof Array&&(Z=(d=Z).pop()),Z=m.symbols_[Z]||Z),Z}typeof q.yy.parseError=="function"?this.parseError=q.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,l(function(Z){h.length=h.length-2*Z,T.length=T.length-Z,t.length=t.length-Z},"popStack"),l(st,"lex");for(var N,U,G,et,X,R,at,J,nt={};;){if(U=h[h.length-1],this.defaultActions[U]?G=this.defaultActions[U]:(N==null&&(N=st()),G=f[U]&&f[U][N]),G===void 0||!G.length||!G[0]){var Ft="";for(X in J=[],f[U])this.terminals_[X]&&X>2&&J.push("'"+this.terminals_[X]+"'");Ft=S.showPosition?"Parse error on line "+(_+1)+`:
2
2
  `+S.showPosition()+`
3
3
  Expecting `+J.join(", ")+", got '"+(this.terminals_[N]||N)+"'":"Parse error on line "+(_+1)+": Unexpected "+(N==1?"end of input":"'"+(this.terminals_[N]||N)+"'"),this.parseError(Ft,{text:S.match,token:this.terminals_[N]||N,line:S.yylineno,loc:rt,expected:J})}if(G[0]instanceof Array&&G.length>1)throw new Error("Parse Error: multiple actions possible at state: "+U+", token: "+N);switch(G[0]){case 1:h.push(N),T.push(S.yytext),t.push(S.yylloc),h.push(G[1]),N=null,Y=S.yyleng,a=S.yytext,_=S.yylineno,rt=S.yylloc;break;case 2:if(R=this.productions_[G[1]][1],nt.$=T[T.length-R],nt._$={first_line:t[t.length-(R||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(R||1)].first_column,last_column:t[t.length-1].last_column},ft&&(nt._$.range=[t[t.length-(R||1)].range[0],t[t.length-1].range[1]]),(et=this.performAction.apply(nt,[a,Y,_,q.yy,G[1],T,t].concat(O)))!==void 0)return et;R&&(h=h.slice(0,-1*R*2),T=T.slice(0,-1*R),t=t.slice(0,-1*R)),h.push(this.productions_[G[1]][0]),T.push(nt.$),t.push(nt._$),at=f[h[h.length-2]][h[h.length-1]],h.push(at);break;case 3:return!0}}return!0},"parse")},x=(function(){return{EOF:1,parseError:l(function(o,m){if(!this.yy.parser)throw new Error(o);this.yy.parser.parseError(o,m)},"parseError"),setInput:l(function(o,m){return this.yy=m||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:l(function(){var o=this._input[0];return this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o,o.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:l(function(o){var m=o.length,h=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-m),this.offset-=m;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var T=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===d.length?this.yylloc.first_column:0)+d[d.length-h.length].length-h[0].length:this.yylloc.first_column-m},this.options.ranges&&(this.yylloc.range=[T[0],T[0]+this.yyleng-m]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:l(function(o){this.unput(this.match.slice(o))},"less"),pastInput:l(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var o=this.pastInput(),m=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{p as Y}from"./chunk-4BX2VUAB-EUTQThiZ.js";import{I as U}from"./chunk-QZHKN3VN-BzaIHJbq.js";import{_ as d,t as V,q as Q,s as X,g as Z,a as J,b as tt,l as u,c as rt,u as et,E as ot,z as nt,j as k,F as at,G as st,H as ct,I as it}from"./mermaid.core-BFFCqfOn.js";import{p as ht}from"./treemap-75Q7IDZK-N9hyUpyj.js";import{s as dt}from"./transform-D9VCJYws.js";import"./index-PmY0x4Zd.js";import"./step-BwsUM5iJ.js";import"./isEmpty-D1t7Gran.js";import"./_baseEach-9_logFrf.js";import"./_baseUniq-C5LFcyNC.js";import"./min-DtVSfYKl.js";import"./_baseMap-NzEbKt5c.js";import"./clone-CSxIll62.js";import"./_createAggregator-ZRm2b6Zm.js";import"./timer-Bqd5yn_a.js";var p={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},mt=ct.gitGraph,R=d(()=>at({...mt,...st().gitGraph}),"getConfig"),i=new U(()=>{const e=R(),t=e.mainBranchName,o=e.mainBranchOrder;return{mainBranchName:t,commits:new Map,head:null,branchConfig:new Map([[t,{name:t,order:o}]]),branches:new Map([[t,null]]),currBranch:t,direction:"LR",seq:0,options:{}}});function G(){return it({length:7})}function D(e,t){const o=Object.create(null);return e.reduce((a,r)=>{const n=t(r);return o[n]||(o[n]=!0,a.push(r)),a},[])}d(G,"getID"),d(D,"uniqBy");var $t=d(function(e){i.records.direction=e},"setDirection"),lt=d(function(e){u.debug("options str",e),e=e==null?void 0:e.trim(),e=e||"{}";try{i.records.options=JSON.parse(e)}catch(t){u.error("error while parsing gitGraph options",t.message)}},"setOptions"),yt=d(function(){return i.records.options},"getOptions"),gt=d(function(e){let t=e.msg,o=e.id;const a=e.type;let r=e.tags;u.info("commit",t,o,a,r),u.debug("Entering commit:",t,o,a,r);const n=R();o=k.sanitizeText(o,n),t=k.sanitizeText(t,n),r=r==null?void 0:r.map(s=>k.sanitizeText(s,n));const c={id:o||i.records.seq+"-"+G(),message:t,seq:i.records.seq++,type:a??p.NORMAL,tags:r??[],parents:i.records.head==null?[]:[i.records.head.id],branch:i.records.currBranch};i.records.head=c,u.info("main branch",n.mainBranchName),i.records.commits.has(c.id)&&u.warn(`Commit ID ${c.id} already exists`),i.records.commits.set(c.id,c),i.records.branches.set(i.records.currBranch,c.id),u.debug("in pushCommit "+c.id)},"commit"),pt=d(function(e){let t=e.name;const o=e.order;if(t=k.sanitizeText(t,R()),i.records.branches.has(t))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${t}")`);i.records.branches.set(t,i.records.head!=null?i.records.head.id:null),i.records.branchConfig.set(t,{name:t,order:o}),N(t),u.debug("in createBranch")},"branch"),xt=d(e=>{let t=e.branch,o=e.id;const a=e.type,r=e.tags,n=R();t=k.sanitizeText(t,n),o&&(o=k.sanitizeText(o,n));const c=i.records.branches.get(i.records.currBranch),s=i.records.branches.get(t),m=c?i.records.commits.get(c):void 0,y=s?i.records.commits.get(s):void 0;if(m&&y&&m.branch===t)throw new Error(`Cannot merge branch '${t}' into itself.`);if(i.records.currBranch===t){const l=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw l.hash={text:`merge ${t}`,token:`merge ${t}`,expected:["branch abc"]},l}if(m===void 0||!m){const l=new Error(`Incorrect usage of "merge". Current branch (${i.records.currBranch})has no commits`);throw l.hash={text:`merge ${t}`,token:`merge ${t}`,expected:["commit"]},l}if(!i.records.branches.has(t)){const l=new Error('Incorrect usage of "merge". Branch to be merged ('+t+") does not exist");throw l.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch ${t}`]},l}if(y===void 0||!y){const l=new Error('Incorrect usage of "merge". Branch to be merged ('+t+") has no commits");throw l.hash={text:`merge ${t}`,token:`merge ${t}`,expected:['"commit"']},l}if(m===y){const l=new Error('Incorrect usage of "merge". Both branches have same head');throw l.hash={text:`merge ${t}`,token:`merge ${t}`,expected:["branch abc"]},l}if(o&&i.records.commits.has(o)){const l=new Error('Incorrect usage of "merge". Commit with id:'+o+" already exists, use different custom id");throw l.hash={text:`merge ${t} ${o} ${a} ${r==null?void 0:r.join(" ")}`,token:`merge ${t} ${o} ${a} ${r==null?void 0:r.join(" ")}`,expected:[`merge ${t} ${o}_UNIQUE ${a} ${r==null?void 0:r.join(" ")}`]},l}const $=s||"",h={id:o||`${i.records.seq}-${G()}`,message:`merged branch ${t} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,$],branch:i.records.currBranch,type:p.MERGE,customType:a,customId:!!o,tags:r??[]};i.records.head=h,i.records.commits.set(h.id,h),i.records.branches.set(i.records.currBranch,h.id),u.debug(i.records.branches),u.debug("in mergeBranch")},"merge"),ft=d(function(e){let t=e.id,o=e.targetId,a=e.tags,r=e.parent;u.debug("Entering cherryPick:",t,o,a);const n=R();if(t=k.sanitizeText(t,n),o=k.sanitizeText(o,n),a=a==null?void 0:a.map(m=>k.sanitizeText(m,n)),r=k.sanitizeText(r,n),!t||!i.records.commits.has(t)){const m=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw m.hash={text:`cherryPick ${t} ${o}`,token:`cherryPick ${t} ${o}`,expected:["cherry-pick abc"]},m}const c=i.records.commits.get(t);if(c===void 0||!c)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(r&&(!Array.isArray(c.parents)||!c.parents.includes(r)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const s=c.branch;if(c.type===p.MERGE&&!r)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!o||!i.records.commits.has(o)){if(s===i.records.currBranch){const h=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw h.hash={text:`cherryPick ${t} ${o}`,token:`cherryPick ${t} ${o}`,expected:["cherry-pick abc"]},h}const m=i.records.branches.get(i.records.currBranch);if(m===void 0||!m){const h=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw h.hash={text:`cherryPick ${t} ${o}`,token:`cherryPick ${t} ${o}`,expected:["cherry-pick abc"]},h}const y=i.records.commits.get(m);if(y===void 0||!y){const h=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw h.hash={text:`cherryPick ${t} ${o}`,token:`cherryPick ${t} ${o}`,expected:["cherry-pick abc"]},h}const $={id:i.records.seq+"-"+G(),message:`cherry-picked ${c==null?void 0:c.message} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,c.id],branch:i.records.currBranch,type:p.CHERRY_PICK,tags:a?a.filter(Boolean):[`cherry-pick:${c.id}${c.type===p.MERGE?`|parent:${r}`:""}`]};i.records.head=$,i.records.commits.set($.id,$),i.records.branches.set(i.records.currBranch,$.id),u.debug(i.records.branches),u.debug("in cherryPick")}},"cherryPick"),N=d(function(e){if(e=k.sanitizeText(e,R()),!i.records.branches.has(e)){const t=new 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}{i.records.currBranch=e;const t=i.records.branches.get(i.records.currBranch);i.records.head=t!==void 0&&t?i.records.commits.get(t)??null:null}},"checkout");function q(e,t,o){const a=e.indexOf(t);a===-1?e.push(o):e.splice(a,1,o)}function H(e){const t=e.reduce((r,n)=>r.seq>n.seq?r:n,e[0]);let o="";e.forEach(function(r){o+=r===t?" *":" |"});const a=[o,t.id,t.seq];for(const r in i.records.branches)i.records.branches.get(r)===t.id&&a.push(r);if(u.debug(a.join(" ")),t.parents&&t.parents.length==2&&t.parents[0]&&t.parents[1]){const r=i.records.commits.get(t.parents[0]);q(e,t,r),t.parents[1]&&e.push(i.records.commits.get(t.parents[1]))}else{if(t.parents.length==0)return;if(t.parents[0]){const r=i.records.commits.get(t.parents[0]);q(e,t,r)}}H(e=D(e,r=>r.id))}d(q,"upsert"),d(H,"prettyPrintCommitHistory");var ut=d(function(){u.debug(i.records.commits),H([W()[0]])},"prettyPrint"),bt=d(function(){i.reset(),nt()},"clear"),wt=d(function(){return[...i.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"),Bt=d(function(){return i.records.branches},"getBranches"),Et=d(function(){return i.records.commits},"getCommits"),W=d(function(){const e=[...i.records.commits.values()];return e.forEach(function(t){u.debug(t.id)}),e.sort((t,o)=>t.seq-o.seq),e},"getCommitsArray"),j={commitType:p,getConfig:R,setDirection:$t,setOptions:lt,getOptions:yt,commit:gt,branch:pt,merge:xt,cherryPick:ft,checkout:N,prettyPrint:ut,clear:bt,getBranchesAsObjArray:wt,getBranches:Bt,getCommits:Et,getCommitsArray:W,getCurrentBranch:d(function(){return i.records.currBranch},"getCurrentBranch"),getDirection:d(function(){return i.records.direction},"getDirection"),getHead:d(function(){return i.records.head},"getHead"),setAccTitle:tt,getAccTitle:J,getAccDescription:Z,setAccDescription:X,setDiagramTitle:Q,getDiagramTitle:V},Ct=d((e,t)=>{Y(e,t),e.dir&&t.setDirection(e.dir);for(const o of e.statements)kt(o,t)},"populate"),kt=d((e,t)=>{const o={Commit:d(a=>t.commit(Lt(a)),"Commit"),Branch:d(a=>t.branch(Tt(a)),"Branch"),Merge:d(a=>t.merge(Mt(a)),"Merge"),Checkout:d(a=>t.checkout(vt(a)),"Checkout"),CherryPicking:d(a=>t.cherryPick(Pt(a)),"CherryPicking")}[e.$type];o?o(e):u.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),Lt=d(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?p[e.type]:p.NORMAL,tags:e.tags??void 0}),"parseCommit"),Tt=d(e=>({name:e.name,order:e.order??0}),"parseBranch"),Mt=d(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?p[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),vt=d(e=>e.branch,"parseCheckout"),Pt=d(e=>{var t;return{id:e.id,targetId:"",tags:((t=e.tags)==null?void 0:t.length)===0?void 0:e.tags,parent:e.parent}},"parseCherryPicking"),Rt={parse:d(async e=>{const t=await ht("gitGraph",e);u.debug(t),Ct(t,j)},"parse")},z=rt(),f=z==null?void 0:z.gitGraph,T=10,M=40,E=new Map,C=new Map,I=new Map,O=[],v=0,g="LR",It=d(()=>{E.clear(),C.clear(),I.clear(),v=0,O=[],g="LR"},"clear"),F=d(e=>{const t=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|<br\s*\/?>/gi):e).forEach(o=>{const a=document.createElementNS("http://www.w3.org/2000/svg","tspan");a.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),a.setAttribute("dy","1em"),a.setAttribute("x","0"),a.setAttribute("class","row"),a.textContent=o.trim(),t.appendChild(a)}),t},"drawText"),_=d(e=>{let t,o,a;return g==="BT"?(o=d((r,n)=>r<=n,"comparisonFunc"),a=1/0):(o=d((r,n)=>r>=n,"comparisonFunc"),a=0),e.forEach(r=>{var c,s;const n=g==="TB"||g=="BT"?(c=C.get(r))==null?void 0:c.y:(s=C.get(r))==null?void 0:s.x;n!==void 0&&o(n,a)&&(t=r,a=n)}),t},"findClosestParent"),At=d(e=>{let t="",o=1/0;return e.forEach(a=>{const r=C.get(a).y;r<=o&&(t=a,o=r)}),t||void 0},"findClosestParentBT"),Gt=d((e,t,o)=>{let a=o,r=o;const n=[];e.forEach(c=>{const s=t.get(c);if(!s)throw new Error(`Commit not found for key ${c}`);s.parents.length?(a=qt(s),r=Math.max(a,r)):n.push(s),Ht(s,a)}),a=r,n.forEach(c=>{zt(c,a,o)}),e.forEach(c=>{const s=t.get(c);if(s!=null&&s.parents.length){const m=At(s.parents);a=C.get(m).y-M,a<=r&&(r=a);const y=E.get(s.branch).pos,$=a-T;C.set(s.id,{x:y,y:$})}})},"setParallelBTPos"),Ot=d(e=>{var a;const t=_(e.parents.filter(r=>r!==null));if(!t)throw new Error(`Closest parent not found for commit ${e.id}`);const o=(a=C.get(t))==null?void 0:a.y;if(o===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return o},"findClosestParentPos"),qt=d(e=>Ot(e)+M,"calculateCommitPosition"),Ht=d((e,t)=>{const o=E.get(e.branch);if(!o)throw new Error(`Branch not found for commit ${e.id}`);const a=o.pos,r=t+T;return C.set(e.id,{x:a,y:r}),{x:a,y:r}},"setCommitPosition"),zt=d((e,t,o)=>{const a=E.get(e.branch);if(!a)throw new Error(`Branch not found for commit ${e.id}`);const r=t+o,n=a.pos;C.set(e.id,{x:n,y:r})},"setRootPosition"),St=d((e,t,o,a,r,n)=>{if(n===p.HIGHLIGHT)e.append("rect").attr("x",o.x-10).attr("y",o.y-10).attr("width",20).attr("height",20).attr("class",`commit ${t.id} commit-highlight${r%8} ${a}-outer`),e.append("rect").attr("x",o.x-6).attr("y",o.y-6).attr("width",12).attr("height",12).attr("class",`commit ${t.id} commit${r%8} ${a}-inner`);else if(n===p.CHERRY_PICK)e.append("circle").attr("cx",o.x).attr("cy",o.y).attr("r",10).attr("class",`commit ${t.id} ${a}`),e.append("circle").attr("cx",o.x-3).attr("cy",o.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${t.id} ${a}`),e.append("circle").attr("cx",o.x+3).attr("cy",o.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${t.id} ${a}`),e.append("line").attr("x1",o.x+3).attr("y1",o.y+1).attr("x2",o.x).attr("y2",o.y-5).attr("stroke","#fff").attr("class",`commit ${t.id} ${a}`),e.append("line").attr("x1",o.x-3).attr("y1",o.y+1).attr("x2",o.x).attr("y2",o.y-5).attr("stroke","#fff").attr("class",`commit ${t.id} ${a}`);else{const c=e.append("circle");if(c.attr("cx",o.x),c.attr("cy",o.y),c.attr("r",t.type===p.MERGE?9:10),c.attr("class",`commit ${t.id} commit${r%8}`),n===p.MERGE){const s=e.append("circle");s.attr("cx",o.x),s.attr("cy",o.y),s.attr("r",6),s.attr("class",`commit ${a} ${t.id} commit${r%8}`)}n===p.REVERSE&&e.append("path").attr("d",`M ${o.x-5},${o.y-5}L${o.x+5},${o.y+5}M${o.x-5},${o.y+5}L${o.x+5},${o.y-5}`).attr("class",`commit ${a} ${t.id} commit${r%8}`)}},"drawCommitBullet"),Dt=d((e,t,o,a)=>{var r;if(t.type!==p.CHERRY_PICK&&(t.customId&&t.type===p.MERGE||t.type!==p.MERGE)&&(f!=null&&f.showCommitLabel)){const n=e.append("g"),c=n.insert("rect").attr("class","commit-label-bkg"),s=n.append("text").attr("x",a).attr("y",o.y+25).attr("class","commit-label").text(t.id),m=(r=s.node())==null?void 0:r.getBBox();if(m&&(c.attr("x",o.posWithOffset-m.width/2-2).attr("y",o.y+13.5).attr("width",m.width+4).attr("height",m.height+4),g==="TB"||g==="BT"?(c.attr("x",o.x-(m.width+16+5)).attr("y",o.y-12),s.attr("x",o.x-(m.width+16)).attr("y",o.y+m.height-12)):s.attr("x",o.posWithOffset-m.width/2),f.rotateCommitLabel))if(g==="TB"||g==="BT")s.attr("transform","rotate(-45, "+o.x+", "+o.y+")"),c.attr("transform","rotate(-45, "+o.x+", "+o.y+")");else{const y=-7.5-(m.width+10)/25*9.5,$=10+m.width/25*8.5;n.attr("transform","translate("+y+", "+$+") rotate(-45, "+a+", "+o.y+")")}}},"drawCommitLabel"),Nt=d((e,t,o,a)=>{var r;if(t.tags.length>0){let n=0,c=0,s=0;const m=[];for(const y of t.tags.reverse()){const $=e.insert("polygon"),h=e.append("circle"),l=e.append("text").attr("y",o.y-16-n).attr("class","tag-label").text(y),x=(r=l.node())==null?void 0:r.getBBox();if(!x)throw new Error("Tag bbox not found");c=Math.max(c,x.width),s=Math.max(s,x.height),l.attr("x",o.posWithOffset-x.width/2),m.push({tag:l,hole:h,rect:$,yOffset:n}),n+=20}for(const{tag:y,hole:$,rect:h,yOffset:l}of m){const x=s/2,b=o.y-19.2-l;if(h.attr("class","tag-label-bkg").attr("points",`
1
+ import{p as Y}from"./chunk-4BX2VUAB-BJecb-Ri.js";import{I as U}from"./chunk-QZHKN3VN-BIUM7usu.js";import{_ as d,t as V,q as Q,s as X,g as Z,a as J,b as tt,l as u,c as rt,u as et,E as ot,z as nt,j as k,F as at,G as st,H as ct,I as it}from"./mermaid.core-DzthE35Y.js";import{p as ht}from"./treemap-75Q7IDZK-CdwDwwsz.js";import{s as dt}from"./transform-D9VCJYws.js";import"./index-C7CoaNFb.js";import"./step-BwsUM5iJ.js";import"./isEmpty-D-4c7sMv.js";import"./_baseEach-CvTX9w0Y.js";import"./_baseUniq-BKktIGQ1.js";import"./min-BBO3-1Hg.js";import"./_baseMap-CtlwA90f.js";import"./clone-BMP0PsTa.js";import"./_createAggregator-C5CVY-0t.js";import"./timer-Bqd5yn_a.js";var p={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},mt=ct.gitGraph,R=d(()=>at({...mt,...st().gitGraph}),"getConfig"),i=new U(()=>{const e=R(),t=e.mainBranchName,o=e.mainBranchOrder;return{mainBranchName:t,commits:new Map,head:null,branchConfig:new Map([[t,{name:t,order:o}]]),branches:new Map([[t,null]]),currBranch:t,direction:"LR",seq:0,options:{}}});function G(){return it({length:7})}function D(e,t){const o=Object.create(null);return e.reduce((a,r)=>{const n=t(r);return o[n]||(o[n]=!0,a.push(r)),a},[])}d(G,"getID"),d(D,"uniqBy");var $t=d(function(e){i.records.direction=e},"setDirection"),lt=d(function(e){u.debug("options str",e),e=e==null?void 0:e.trim(),e=e||"{}";try{i.records.options=JSON.parse(e)}catch(t){u.error("error while parsing gitGraph options",t.message)}},"setOptions"),yt=d(function(){return i.records.options},"getOptions"),gt=d(function(e){let t=e.msg,o=e.id;const a=e.type;let r=e.tags;u.info("commit",t,o,a,r),u.debug("Entering commit:",t,o,a,r);const n=R();o=k.sanitizeText(o,n),t=k.sanitizeText(t,n),r=r==null?void 0:r.map(s=>k.sanitizeText(s,n));const c={id:o||i.records.seq+"-"+G(),message:t,seq:i.records.seq++,type:a??p.NORMAL,tags:r??[],parents:i.records.head==null?[]:[i.records.head.id],branch:i.records.currBranch};i.records.head=c,u.info("main branch",n.mainBranchName),i.records.commits.has(c.id)&&u.warn(`Commit ID ${c.id} already exists`),i.records.commits.set(c.id,c),i.records.branches.set(i.records.currBranch,c.id),u.debug("in pushCommit "+c.id)},"commit"),pt=d(function(e){let t=e.name;const o=e.order;if(t=k.sanitizeText(t,R()),i.records.branches.has(t))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${t}")`);i.records.branches.set(t,i.records.head!=null?i.records.head.id:null),i.records.branchConfig.set(t,{name:t,order:o}),N(t),u.debug("in createBranch")},"branch"),xt=d(e=>{let t=e.branch,o=e.id;const a=e.type,r=e.tags,n=R();t=k.sanitizeText(t,n),o&&(o=k.sanitizeText(o,n));const c=i.records.branches.get(i.records.currBranch),s=i.records.branches.get(t),m=c?i.records.commits.get(c):void 0,y=s?i.records.commits.get(s):void 0;if(m&&y&&m.branch===t)throw new Error(`Cannot merge branch '${t}' into itself.`);if(i.records.currBranch===t){const l=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw l.hash={text:`merge ${t}`,token:`merge ${t}`,expected:["branch abc"]},l}if(m===void 0||!m){const l=new Error(`Incorrect usage of "merge". Current branch (${i.records.currBranch})has no commits`);throw l.hash={text:`merge ${t}`,token:`merge ${t}`,expected:["commit"]},l}if(!i.records.branches.has(t)){const l=new Error('Incorrect usage of "merge". Branch to be merged ('+t+") does not exist");throw l.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch ${t}`]},l}if(y===void 0||!y){const l=new Error('Incorrect usage of "merge". Branch to be merged ('+t+") has no commits");throw l.hash={text:`merge ${t}`,token:`merge ${t}`,expected:['"commit"']},l}if(m===y){const l=new Error('Incorrect usage of "merge". Both branches have same head');throw l.hash={text:`merge ${t}`,token:`merge ${t}`,expected:["branch abc"]},l}if(o&&i.records.commits.has(o)){const l=new Error('Incorrect usage of "merge". Commit with id:'+o+" already exists, use different custom id");throw l.hash={text:`merge ${t} ${o} ${a} ${r==null?void 0:r.join(" ")}`,token:`merge ${t} ${o} ${a} ${r==null?void 0:r.join(" ")}`,expected:[`merge ${t} ${o}_UNIQUE ${a} ${r==null?void 0:r.join(" ")}`]},l}const $=s||"",h={id:o||`${i.records.seq}-${G()}`,message:`merged branch ${t} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,$],branch:i.records.currBranch,type:p.MERGE,customType:a,customId:!!o,tags:r??[]};i.records.head=h,i.records.commits.set(h.id,h),i.records.branches.set(i.records.currBranch,h.id),u.debug(i.records.branches),u.debug("in mergeBranch")},"merge"),ft=d(function(e){let t=e.id,o=e.targetId,a=e.tags,r=e.parent;u.debug("Entering cherryPick:",t,o,a);const n=R();if(t=k.sanitizeText(t,n),o=k.sanitizeText(o,n),a=a==null?void 0:a.map(m=>k.sanitizeText(m,n)),r=k.sanitizeText(r,n),!t||!i.records.commits.has(t)){const m=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw m.hash={text:`cherryPick ${t} ${o}`,token:`cherryPick ${t} ${o}`,expected:["cherry-pick abc"]},m}const c=i.records.commits.get(t);if(c===void 0||!c)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(r&&(!Array.isArray(c.parents)||!c.parents.includes(r)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const s=c.branch;if(c.type===p.MERGE&&!r)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!o||!i.records.commits.has(o)){if(s===i.records.currBranch){const h=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw h.hash={text:`cherryPick ${t} ${o}`,token:`cherryPick ${t} ${o}`,expected:["cherry-pick abc"]},h}const m=i.records.branches.get(i.records.currBranch);if(m===void 0||!m){const h=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw h.hash={text:`cherryPick ${t} ${o}`,token:`cherryPick ${t} ${o}`,expected:["cherry-pick abc"]},h}const y=i.records.commits.get(m);if(y===void 0||!y){const h=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw h.hash={text:`cherryPick ${t} ${o}`,token:`cherryPick ${t} ${o}`,expected:["cherry-pick abc"]},h}const $={id:i.records.seq+"-"+G(),message:`cherry-picked ${c==null?void 0:c.message} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,c.id],branch:i.records.currBranch,type:p.CHERRY_PICK,tags:a?a.filter(Boolean):[`cherry-pick:${c.id}${c.type===p.MERGE?`|parent:${r}`:""}`]};i.records.head=$,i.records.commits.set($.id,$),i.records.branches.set(i.records.currBranch,$.id),u.debug(i.records.branches),u.debug("in cherryPick")}},"cherryPick"),N=d(function(e){if(e=k.sanitizeText(e,R()),!i.records.branches.has(e)){const t=new 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}{i.records.currBranch=e;const t=i.records.branches.get(i.records.currBranch);i.records.head=t!==void 0&&t?i.records.commits.get(t)??null:null}},"checkout");function q(e,t,o){const a=e.indexOf(t);a===-1?e.push(o):e.splice(a,1,o)}function H(e){const t=e.reduce((r,n)=>r.seq>n.seq?r:n,e[0]);let o="";e.forEach(function(r){o+=r===t?" *":" |"});const a=[o,t.id,t.seq];for(const r in i.records.branches)i.records.branches.get(r)===t.id&&a.push(r);if(u.debug(a.join(" ")),t.parents&&t.parents.length==2&&t.parents[0]&&t.parents[1]){const r=i.records.commits.get(t.parents[0]);q(e,t,r),t.parents[1]&&e.push(i.records.commits.get(t.parents[1]))}else{if(t.parents.length==0)return;if(t.parents[0]){const r=i.records.commits.get(t.parents[0]);q(e,t,r)}}H(e=D(e,r=>r.id))}d(q,"upsert"),d(H,"prettyPrintCommitHistory");var ut=d(function(){u.debug(i.records.commits),H([W()[0]])},"prettyPrint"),bt=d(function(){i.reset(),nt()},"clear"),wt=d(function(){return[...i.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"),Bt=d(function(){return i.records.branches},"getBranches"),Et=d(function(){return i.records.commits},"getCommits"),W=d(function(){const e=[...i.records.commits.values()];return e.forEach(function(t){u.debug(t.id)}),e.sort((t,o)=>t.seq-o.seq),e},"getCommitsArray"),j={commitType:p,getConfig:R,setDirection:$t,setOptions:lt,getOptions:yt,commit:gt,branch:pt,merge:xt,cherryPick:ft,checkout:N,prettyPrint:ut,clear:bt,getBranchesAsObjArray:wt,getBranches:Bt,getCommits:Et,getCommitsArray:W,getCurrentBranch:d(function(){return i.records.currBranch},"getCurrentBranch"),getDirection:d(function(){return i.records.direction},"getDirection"),getHead:d(function(){return i.records.head},"getHead"),setAccTitle:tt,getAccTitle:J,getAccDescription:Z,setAccDescription:X,setDiagramTitle:Q,getDiagramTitle:V},Ct=d((e,t)=>{Y(e,t),e.dir&&t.setDirection(e.dir);for(const o of e.statements)kt(o,t)},"populate"),kt=d((e,t)=>{const o={Commit:d(a=>t.commit(Lt(a)),"Commit"),Branch:d(a=>t.branch(Tt(a)),"Branch"),Merge:d(a=>t.merge(Mt(a)),"Merge"),Checkout:d(a=>t.checkout(vt(a)),"Checkout"),CherryPicking:d(a=>t.cherryPick(Pt(a)),"CherryPicking")}[e.$type];o?o(e):u.error(`Unknown statement type: ${e.$type}`)},"parseStatement"),Lt=d(e=>({id:e.id,msg:e.message??"",type:e.type!==void 0?p[e.type]:p.NORMAL,tags:e.tags??void 0}),"parseCommit"),Tt=d(e=>({name:e.name,order:e.order??0}),"parseBranch"),Mt=d(e=>({branch:e.branch,id:e.id??"",type:e.type!==void 0?p[e.type]:void 0,tags:e.tags??void 0}),"parseMerge"),vt=d(e=>e.branch,"parseCheckout"),Pt=d(e=>{var t;return{id:e.id,targetId:"",tags:((t=e.tags)==null?void 0:t.length)===0?void 0:e.tags,parent:e.parent}},"parseCherryPicking"),Rt={parse:d(async e=>{const t=await ht("gitGraph",e);u.debug(t),Ct(t,j)},"parse")},z=rt(),f=z==null?void 0:z.gitGraph,T=10,M=40,E=new Map,C=new Map,I=new Map,O=[],v=0,g="LR",It=d(()=>{E.clear(),C.clear(),I.clear(),v=0,O=[],g="LR"},"clear"),F=d(e=>{const t=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof e=="string"?e.split(/\\n|\n|<br\s*\/?>/gi):e).forEach(o=>{const a=document.createElementNS("http://www.w3.org/2000/svg","tspan");a.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),a.setAttribute("dy","1em"),a.setAttribute("x","0"),a.setAttribute("class","row"),a.textContent=o.trim(),t.appendChild(a)}),t},"drawText"),_=d(e=>{let t,o,a;return g==="BT"?(o=d((r,n)=>r<=n,"comparisonFunc"),a=1/0):(o=d((r,n)=>r>=n,"comparisonFunc"),a=0),e.forEach(r=>{var c,s;const n=g==="TB"||g=="BT"?(c=C.get(r))==null?void 0:c.y:(s=C.get(r))==null?void 0:s.x;n!==void 0&&o(n,a)&&(t=r,a=n)}),t},"findClosestParent"),At=d(e=>{let t="",o=1/0;return e.forEach(a=>{const r=C.get(a).y;r<=o&&(t=a,o=r)}),t||void 0},"findClosestParentBT"),Gt=d((e,t,o)=>{let a=o,r=o;const n=[];e.forEach(c=>{const s=t.get(c);if(!s)throw new Error(`Commit not found for key ${c}`);s.parents.length?(a=qt(s),r=Math.max(a,r)):n.push(s),Ht(s,a)}),a=r,n.forEach(c=>{zt(c,a,o)}),e.forEach(c=>{const s=t.get(c);if(s!=null&&s.parents.length){const m=At(s.parents);a=C.get(m).y-M,a<=r&&(r=a);const y=E.get(s.branch).pos,$=a-T;C.set(s.id,{x:y,y:$})}})},"setParallelBTPos"),Ot=d(e=>{var a;const t=_(e.parents.filter(r=>r!==null));if(!t)throw new Error(`Closest parent not found for commit ${e.id}`);const o=(a=C.get(t))==null?void 0:a.y;if(o===void 0)throw new Error(`Closest parent position not found for commit ${e.id}`);return o},"findClosestParentPos"),qt=d(e=>Ot(e)+M,"calculateCommitPosition"),Ht=d((e,t)=>{const o=E.get(e.branch);if(!o)throw new Error(`Branch not found for commit ${e.id}`);const a=o.pos,r=t+T;return C.set(e.id,{x:a,y:r}),{x:a,y:r}},"setCommitPosition"),zt=d((e,t,o)=>{const a=E.get(e.branch);if(!a)throw new Error(`Branch not found for commit ${e.id}`);const r=t+o,n=a.pos;C.set(e.id,{x:n,y:r})},"setRootPosition"),St=d((e,t,o,a,r,n)=>{if(n===p.HIGHLIGHT)e.append("rect").attr("x",o.x-10).attr("y",o.y-10).attr("width",20).attr("height",20).attr("class",`commit ${t.id} commit-highlight${r%8} ${a}-outer`),e.append("rect").attr("x",o.x-6).attr("y",o.y-6).attr("width",12).attr("height",12).attr("class",`commit ${t.id} commit${r%8} ${a}-inner`);else if(n===p.CHERRY_PICK)e.append("circle").attr("cx",o.x).attr("cy",o.y).attr("r",10).attr("class",`commit ${t.id} ${a}`),e.append("circle").attr("cx",o.x-3).attr("cy",o.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${t.id} ${a}`),e.append("circle").attr("cx",o.x+3).attr("cy",o.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${t.id} ${a}`),e.append("line").attr("x1",o.x+3).attr("y1",o.y+1).attr("x2",o.x).attr("y2",o.y-5).attr("stroke","#fff").attr("class",`commit ${t.id} ${a}`),e.append("line").attr("x1",o.x-3).attr("y1",o.y+1).attr("x2",o.x).attr("y2",o.y-5).attr("stroke","#fff").attr("class",`commit ${t.id} ${a}`);else{const c=e.append("circle");if(c.attr("cx",o.x),c.attr("cy",o.y),c.attr("r",t.type===p.MERGE?9:10),c.attr("class",`commit ${t.id} commit${r%8}`),n===p.MERGE){const s=e.append("circle");s.attr("cx",o.x),s.attr("cy",o.y),s.attr("r",6),s.attr("class",`commit ${a} ${t.id} commit${r%8}`)}n===p.REVERSE&&e.append("path").attr("d",`M ${o.x-5},${o.y-5}L${o.x+5},${o.y+5}M${o.x-5},${o.y+5}L${o.x+5},${o.y-5}`).attr("class",`commit ${a} ${t.id} commit${r%8}`)}},"drawCommitBullet"),Dt=d((e,t,o,a)=>{var r;if(t.type!==p.CHERRY_PICK&&(t.customId&&t.type===p.MERGE||t.type!==p.MERGE)&&(f!=null&&f.showCommitLabel)){const n=e.append("g"),c=n.insert("rect").attr("class","commit-label-bkg"),s=n.append("text").attr("x",a).attr("y",o.y+25).attr("class","commit-label").text(t.id),m=(r=s.node())==null?void 0:r.getBBox();if(m&&(c.attr("x",o.posWithOffset-m.width/2-2).attr("y",o.y+13.5).attr("width",m.width+4).attr("height",m.height+4),g==="TB"||g==="BT"?(c.attr("x",o.x-(m.width+16+5)).attr("y",o.y-12),s.attr("x",o.x-(m.width+16)).attr("y",o.y+m.height-12)):s.attr("x",o.posWithOffset-m.width/2),f.rotateCommitLabel))if(g==="TB"||g==="BT")s.attr("transform","rotate(-45, "+o.x+", "+o.y+")"),c.attr("transform","rotate(-45, "+o.x+", "+o.y+")");else{const y=-7.5-(m.width+10)/25*9.5,$=10+m.width/25*8.5;n.attr("transform","translate("+y+", "+$+") rotate(-45, "+a+", "+o.y+")")}}},"drawCommitLabel"),Nt=d((e,t,o,a)=>{var r;if(t.tags.length>0){let n=0,c=0,s=0;const m=[];for(const y of t.tags.reverse()){const $=e.insert("polygon"),h=e.append("circle"),l=e.append("text").attr("y",o.y-16-n).attr("class","tag-label").text(y),x=(r=l.node())==null?void 0:r.getBBox();if(!x)throw new Error("Tag bbox not found");c=Math.max(c,x.width),s=Math.max(s,x.height),l.attr("x",o.posWithOffset-x.width/2),m.push({tag:l,hole:h,rect:$,yOffset:n}),n+=20}for(const{tag:y,hole:$,rect:h,yOffset:l}of m){const x=s/2,b=o.y-19.2-l;if(h.attr("class","tag-label-bkg").attr("points",`
2
2
  ${a-c/2-2},${b+2}
3
3
  ${a-c/2-2},${b-2}
4
4
  ${o.posWithOffset-c/2-4},${b-x-2}