@marimo-team/frontend 0.25.1-dev90 → 0.25.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 (365) hide show
  1. package/dist/assets/{ConnectedDataExplorerComponent-Bdak5-o8.js → ConnectedDataExplorerComponent-DJ5jwKfp.js} +1 -1
  2. package/dist/assets/{ErrorBoundary-DrliQ_7g.js → ErrorBoundary-BeE1cdgM.js} +2 -2
  3. package/dist/assets/{ImageComparisonComponent-DLxkuRy3.js → ImageComparisonComponent-pCLPT6RA.js} +1 -1
  4. package/dist/assets/LazyAnyLanguageCodeMirror-B_IYTCX5.js +2 -0
  5. package/dist/assets/{RunButton-qknEPbRR.js → RunButton-C2kFUhyO.js} +10 -10
  6. package/dist/assets/{abnfDiagram-VCTEODGH-dm832Yw9.js → abnfDiagram-VCTEODGH-CSPJSGaM.js} +1 -1
  7. package/dist/assets/add-cell-with-ai-BFgdVPaN.js +76 -0
  8. package/dist/assets/{agent-panel-CJva58SL.js → agent-panel-Dh7yWh9P.js} +5 -5
  9. package/dist/assets/ai-model-dropdown-DJ2elMLM.js +5 -0
  10. package/dist/assets/{any-language-editor-B7QvjaYO.js → any-language-editor-Cj_HzlZY.js} +1 -1
  11. package/dist/assets/app-config-button-DBCTefOX.js +1 -0
  12. package/dist/assets/{architectureDiagram-5GKGNRK7-CiRaYU5G.js → architectureDiagram-5GKGNRK7-7iukRoC9.js} +1 -1
  13. package/dist/assets/{blockDiagram-I7D4REHJ-BK3JcsXA.js → blockDiagram-I7D4REHJ-cuhpQB60.js} +1 -1
  14. package/dist/assets/{c4Diagram-7LVT6UL2-BbMz-zwF.js → c4Diagram-7LVT6UL2-CMQEYn6T.js} +1 -1
  15. package/dist/assets/{cache-panel-DxdmvFwH.js → cache-panel-C0oB1kE2.js} +1 -1
  16. package/dist/assets/{cells-BcQ8Tm3j.js → cells-CzugpTQu.js} +33 -33
  17. package/dist/assets/channel-CGdeorQk.js +1 -0
  18. package/dist/assets/{chat-display-TI342pMF.js → chat-display-DevO4F8W.js} +1 -1
  19. package/dist/assets/chat-panel-BGw0bqDk.js +4 -0
  20. package/dist/assets/{chat-ui-B1aeiWdr.js → chat-ui-CZZFGlZi.js} +4 -4
  21. package/dist/assets/{chunk-4HAMMTFA-F3WVmmmo.js → chunk-4HAMMTFA-C6Tl7kEY.js} +1 -1
  22. package/dist/assets/{chunk-75Z2AOVW-DA_lihEi.js → chunk-75Z2AOVW-BzzYECN7.js} +1 -1
  23. package/dist/assets/{chunk-DU6HZSFF-J-califE.js → chunk-DU6HZSFF-BlpgvKzl.js} +2 -2
  24. package/dist/assets/{chunk-F27PBJKO-BzJrz4xx.js → chunk-F27PBJKO-BVIgLGPF.js} +1 -1
  25. package/dist/assets/{chunk-GMAD6QVW-mXoq4V-T.js → chunk-GMAD6QVW-hv6IsAru.js} +1 -1
  26. package/dist/assets/{chunk-GVQU2GXP-B-87l3Xt.js → chunk-GVQU2GXP-Duv4ZYb-.js} +1 -1
  27. package/dist/assets/{chunk-IMKFNOWR-yy9Ec7ZM.js → chunk-IMKFNOWR-BIILwBhp.js} +1 -1
  28. package/dist/assets/{chunk-L3NEJ4N5-DLeZO9l0.js → chunk-L3NEJ4N5-B2hafvRU.js} +1 -1
  29. package/dist/assets/{chunk-OSK3NFVY-PWoOtECb.js → chunk-OSK3NFVY-SNGRdtNA.js} +1 -1
  30. package/dist/assets/{chunk-P2QGCYS3-DsJshZeL.js → chunk-P2QGCYS3-_SeE0QXb.js} +1 -1
  31. package/dist/assets/{chunk-POPQ4Y6H-CCg5TpSp.js → chunk-POPQ4Y6H-BB5NNJFE.js} +1 -1
  32. package/dist/assets/{chunk-PWAF6VOD-CrFPAGFi.js → chunk-PWAF6VOD-BZoBqp8x.js} +1 -1
  33. package/dist/assets/{chunk-SHT3W25Y-lri4OQTX.js → chunk-SHT3W25Y-BtLGdeDB.js} +1 -1
  34. package/dist/assets/{chunk-SVP7TREG-B3ISFgJc.js → chunk-SVP7TREG-B0UfxhUP.js} +1 -1
  35. package/dist/assets/{chunk-TICWLB2K-CJ7ETjY3.js → chunk-TICWLB2K-BP7vel_P.js} +1 -1
  36. package/dist/assets/classDiagram-ZZMXUADV-CoNXKNMZ.js +1 -0
  37. package/dist/assets/classDiagram-v2-VYDZK3BY-CoNXKNMZ.js +1 -0
  38. package/dist/assets/code-visibility-BFNYI7hr.js +1 -0
  39. package/dist/assets/command-palette-DN4JoOLD.js +1 -0
  40. package/dist/assets/{common-cDzShymV.js → common-DUCPhoyP.js} +1 -1
  41. package/dist/assets/{components-B3KlHXnD.js → components-CK7CeYlo.js} +1 -1
  42. package/dist/assets/components-DAmFBASm.js +1 -0
  43. package/dist/assets/config-B4VJJibu.js +1 -0
  44. package/dist/assets/{utils-B3E7otfg.js → config-BxZgoFvi.js} +1 -1
  45. package/dist/assets/config-DpGPGznL.js +1 -0
  46. package/dist/assets/{cynefinDiagram-5FMLGOSQ-1zl1wSTB.js → cynefinDiagram-5FMLGOSQ-BARZRQBb.js} +1 -1
  47. package/dist/assets/{dagre-DM-Ch8wC.js → dagre-DVyyr7Cb.js} +1 -1
  48. package/dist/assets/{dagre-GXQ25YYZ-BqoUeivc.js → dagre-GXQ25YYZ-79s0lOP0.js} +1 -1
  49. package/dist/assets/data-grid-overlay-editor-DPfnIudL.js +1 -0
  50. package/dist/assets/{dependency-graph-panel-C-SFFOPF.js → dependency-graph-panel-BN4CLayU.js} +3 -3
  51. package/dist/assets/{diagram-S7CK7UJ4-CF90sb1m.js → diagram-S7CK7UJ4-BCviGhvd.js} +1 -1
  52. package/dist/assets/{diagram-UQ7AKVKN-DgbZAUCH.js → diagram-UQ7AKVKN-Ds-BT46T.js} +1 -1
  53. package/dist/assets/{diagram-VSXAHHWV-DOQllF_r.js → diagram-VSXAHHWV-CK4GkM-q.js} +1 -1
  54. package/dist/assets/{diagram-VX7I27RA-6dC0a_-i.js → diagram-VX7I27RA-BtL2eh0t.js} +1 -1
  55. package/dist/assets/{diagram-Z3DM3KII-C1OXYmlB.js → diagram-Z3DM3KII-C6SmbLBS.js} +1 -1
  56. package/dist/assets/{dist-0HQ0BMF5.js → dist-CQvJDryh.js} +1 -1
  57. package/dist/assets/{documentation-panel-idK3s0j3.js → documentation-panel-CzRbXV5u.js} +1 -1
  58. package/dist/assets/{ebnfDiagram-PWID7BFC-7gC3cuC7.js → ebnfDiagram-PWID7BFC-D_JU4cMQ.js} +1 -1
  59. package/dist/assets/edit-page-jGNYBqQo.js +174 -0
  60. package/dist/assets/{erDiagram-RLTQ6QDP-BsE87b_i.js → erDiagram-RLTQ6QDP-Z9MJ6X-r.js} +1 -1
  61. package/dist/assets/{error-entries-C-LFkdXb.js → error-entries-CDSsy76p.js} +1 -1
  62. package/dist/assets/{error-panel-YAFgCest.js → error-panel-ABvjFG3p.js} +1 -1
  63. package/dist/assets/{feedback-button-sRQQL2TH.js → feedback-button-CZhLiwkO.js} +2 -2
  64. package/dist/assets/file-explorer-panel-DTiEpmVE.js +1 -0
  65. package/dist/assets/file-name-input-C1C8xrjA.js +3 -0
  66. package/dist/assets/filename-fxG7K_MU.js +1 -0
  67. package/dist/assets/flowDiagram-HODETNUW-ncLciK2K.js +1 -0
  68. package/dist/assets/{gallery-page-CH8TM7bV.js → gallery-page-Moi4ZdJ0.js} +1 -1
  69. package/dist/assets/{ganttDiagram-EL5Y4UJY-d9Qqbnau.js → ganttDiagram-EL5Y4UJY-Cgy11k0G.js} +1 -1
  70. package/dist/assets/{gitGraphDiagram-WWUBYQGX-DBunV_fz.js → gitGraphDiagram-WWUBYQGX-CVH8fay_.js} +1 -1
  71. package/dist/assets/glide-data-editor-CbsCWu-K.js +131 -0
  72. package/dist/assets/{graphlib-DDJ8O6ZH.js → graphlib-3maKwbRO.js} +1 -1
  73. package/dist/assets/has-cJsIKK9t.js +1 -0
  74. package/dist/assets/home-page-UAgVOkCZ.js +4 -0
  75. package/dist/assets/index--sT8xf-8.css +2 -0
  76. package/dist/assets/index-DafnX1Xx.js +62 -0
  77. package/dist/assets/{infoDiagram-27XIBGKW-FE7De1I6.js → infoDiagram-27XIBGKW-Dk8U81nJ.js} +1 -1
  78. package/dist/assets/{ishikawaDiagram-5VMMS53U-CSEGYrJ-.js → ishikawaDiagram-5VMMS53U-CzHQlMUQ.js} +1 -1
  79. package/dist/assets/{journeyDiagram-3NMN7TZE-Cp4mxQrE.js → journeyDiagram-3NMN7TZE-DRc8ACzh.js} +1 -1
  80. package/dist/assets/{kanban-definition-UXKFOSKX-d7iAZsOb.js → kanban-definition-UXKFOSKX-CVyVYiI6.js} +1 -1
  81. package/dist/assets/katex-DkE0ukCy.js +257 -0
  82. package/dist/assets/{logs-panel-xMj01DRN.js → logs-panel-Bz5ysVX4.js} +1 -1
  83. package/dist/assets/{mermaid-CNjXdDrA.js → mermaid-D_jPUVqz.js} +4 -4
  84. package/dist/assets/mhchem-CmzEtQj8.js +1 -0
  85. package/dist/assets/{mindmap-definition-YA3MSWOX-CddM9_uP.js → mindmap-definition-YA3MSWOX-D5t6Aq5Z.js} +1 -1
  86. package/dist/assets/{number-overlay-editor-N57if5NT.js → number-overlay-editor-FAD8sjFU.js} +1 -1
  87. package/dist/assets/{outline-panel-Garp-f5k.js → outline-panel-85oiQ0XX.js} +1 -1
  88. package/dist/assets/packages-panel-ClKIaP5S.js +1 -0
  89. package/dist/assets/{panels-CnbmgzkS.js → panels-B48zp96D.js} +9 -9
  90. package/dist/assets/{pegDiagram-XKGWAZYB-CEns8d-M.js → pegDiagram-XKGWAZYB-BTkTm4ej.js} +1 -1
  91. package/dist/assets/{pieDiagram-E7YTZNPT-wyb0xQ0R.js → pieDiagram-E7YTZNPT-Bq6X88M1.js} +1 -1
  92. package/dist/assets/{process-output-ObDfw1uu.js → process-output-Cg2ta3vY.js} +1 -1
  93. package/dist/assets/{quadrantDiagram-AXDQQJYC-BE-xlTLH.js → quadrantDiagram-AXDQQJYC-D_wrOwLk.js} +1 -1
  94. package/dist/assets/{railroadDiagram-O6MQD6OU-DZZVHmr2.js → railroadDiagram-O6MQD6OU-fv8HXW_g.js} +1 -1
  95. package/dist/assets/{requirementDiagram-BXWQKSXE-C3Bf4dd5.js → requirementDiagram-BXWQKSXE-DDOOMUfC.js} +1 -1
  96. package/dist/assets/{reveal-component-DgrXq3Kv.js → reveal-component-CR43gpTZ.js} +3 -3
  97. package/dist/assets/run-page-NR_KFWk8.js +1 -0
  98. package/dist/assets/{sankeyDiagram-P5KCCOFB-BWLQCyjK.js → sankeyDiagram-P5KCCOFB-CvvUY6tS.js} +1 -1
  99. package/dist/assets/scratchpad-panel-DHc-oVb1.js +1 -0
  100. package/dist/assets/{secrets-panel-4dRIaZfY.js → secrets-panel-C-65ZjnM.js} +1 -1
  101. package/dist/assets/{sequenceDiagram-WJ2MYXX4-BIY0mgX7.js → sequenceDiagram-WJ2MYXX4-DdpBhQaS.js} +1 -1
  102. package/dist/assets/session-DXKMv4Bs.js +1 -0
  103. package/dist/assets/session-panel-DiwQqIbt.js +1 -0
  104. package/dist/assets/{SelectionIndicator-DLJBcP4e.js → shell-BSnvn9t7.js} +1 -1
  105. package/dist/assets/snippets-panel-BLmXrneD.js +1 -0
  106. package/dist/assets/{stateDiagram-D77RDMKH-D_xRHRLf.js → stateDiagram-D77RDMKH-D3p19fac.js} +1 -1
  107. package/dist/assets/stateDiagram-v2-MP3YSRHH-CplsDaDl.js +1 -0
  108. package/dist/assets/{swimlanes-42K2YHIH-CDQzpfz0.js → swimlanes-42K2YHIH-CLxCSvU4.js} +1 -1
  109. package/dist/assets/swimlanesDiagram-VR7AAH4N-DPoIFx8T.js +8 -0
  110. package/dist/assets/{swiper-component-j-Lk25wW.js → swiper-component-rqJChT_P.js} +1 -1
  111. package/dist/assets/{terminal-BToH-U1t.js → terminal-CY4h1UmO.js} +1 -1
  112. package/dist/assets/{timeline-definition-24CTP7MA-D5Jgj1fz.js → timeline-definition-24CTP7MA-Cw2PY--x.js} +1 -1
  113. package/dist/assets/tooltip-PLkI_UfK.js +61 -0
  114. package/dist/assets/{tracing-DtKLmNHj.js → tracing-Q8NAdlrA.js} +1 -1
  115. package/dist/assets/tracing-panel-Ci4kY4dr.js +2 -0
  116. package/dist/assets/useCellActionButton-DpYtVfFe.js +1 -0
  117. package/dist/assets/useTheme-DcnXlv0_.js +1 -0
  118. package/dist/assets/{constants-BDbGiS7O.js → utils-B4K466FK.js} +1 -1
  119. package/dist/assets/{vega-component-DVSvu4vP.js → vega-component-BpoSew4K.js} +1 -1
  120. package/dist/assets/{vega-embed-container-QM1zZmYi.js → vega-embed-container-BOJG8mCA.js} +1 -1
  121. package/dist/assets/{vennDiagram-4TSXK5OY-Cv6jxbpX.js → vennDiagram-4TSXK5OY-D8bN6lVl.js} +1 -1
  122. package/dist/assets/{wardleyDiagram-VM6X3IG4-lwv-YoWo.js → wardleyDiagram-VM6X3IG4-CbZdo0SA.js} +1 -1
  123. package/dist/assets/{write-secret-modal-CBUZw27N.js → write-secret-modal-BiG2tahJ.js} +1 -1
  124. package/dist/assets/{xychartDiagram-S5SC5T6Z-CGM4LlFN.js → xychartDiagram-S5SC5T6Z-DUUQ9tau.js} +1 -1
  125. package/dist/assets/youtube-A9VT7NHb.js +1 -0
  126. package/dist/index.html +14 -13
  127. package/package.json +1 -2
  128. package/src/__mocks__/common.ts +3 -3
  129. package/src/__tests__/CellStatus.test.tsx +1 -1
  130. package/src/__tests__/setup.ts +7 -7
  131. package/src/components/app-config/ai-config.tsx +2 -0
  132. package/src/components/app-config/optional-features.tsx +1 -1
  133. package/src/components/chat/chat-panel.tsx +19 -8
  134. package/src/components/data-table/TableTopBar.tsx +2 -2
  135. package/src/components/data-table/__tests__/export-actions.test.tsx +662 -0
  136. package/src/components/data-table/charts/__tests__/chart-panel.test.tsx +286 -0
  137. package/src/components/data-table/charts/charts.tsx +26 -13
  138. package/src/components/data-table/column-summary/chart-spec-model.tsx +4 -4
  139. package/src/components/data-table/data-table.tsx +1 -1
  140. package/src/components/data-table/export-actions.tsx +642 -176
  141. package/src/components/data-table/schemas.ts +25 -3
  142. package/src/components/dependency-graph/elements.ts +2 -2
  143. package/src/components/editor/__tests__/package-alert.test.tsx +140 -0
  144. package/src/components/editor/actions/__tests__/pair-with-agent.test.tsx +107 -0
  145. package/src/components/editor/actions/pair-with-agent.tsx +119 -0
  146. package/src/components/editor/actions/useNotebookActions.tsx +2 -1
  147. package/src/components/editor/ai/add-cell-with-ai.tsx +2 -0
  148. package/src/components/editor/ai/staged-cell-submission.ts +2 -2
  149. package/src/components/editor/ai/transport/chat-transport.tsx +1 -1
  150. package/src/components/editor/chrome/components/contribute-snippet-button.tsx +6 -1
  151. package/src/components/editor/connections/database/as-code.ts +44 -44
  152. package/src/components/editor/connections/storage/as-code.ts +3 -3
  153. package/src/components/editor/file-tree/requesting-tree.tsx +16 -13
  154. package/src/components/editor/navigation/clipboard.ts +2 -2
  155. package/src/components/editor/notebook-cell.tsx +2 -2
  156. package/src/components/editor/output/MarimoTracebackOutput.tsx +1 -1
  157. package/src/components/editor/output/VideoOutput.tsx +1 -1
  158. package/src/components/editor/output/ansi-reduce.ts +21 -17
  159. package/src/components/editor/output/console/ConsoleOutput.tsx +3 -3
  160. package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +59 -0
  161. package/src/components/editor/output/console/text-rendering.tsx +3 -1
  162. package/src/components/editor/package-alert.tsx +20 -7
  163. package/src/components/home/components.tsx +1 -0
  164. package/src/components/markdown/markdown-renderer.css +1 -1
  165. package/src/components/pages/run-page.tsx +1 -0
  166. package/src/components/slides/__tests__/minimap-actions.test.tsx +7 -7
  167. package/src/components/slides/__tests__/minimap.test.ts +12 -12
  168. package/src/components/slides/__tests__/slide-scroll-hint.test.tsx +8 -8
  169. package/src/components/static-html/__tests__/share-modal.test.tsx +154 -0
  170. package/src/components/static-html/__tests__/stage-for-publish.test.ts +111 -0
  171. package/src/components/static-html/share-modal.tsx +114 -144
  172. package/src/components/static-html/stage-for-publish.ts +56 -0
  173. package/src/components/static-html/static-banner.tsx +2 -2
  174. package/src/components/ui/links.tsx +6 -1
  175. package/src/components/ui/typography.tsx +16 -8
  176. package/src/core/ai/context/__tests__/registry.test.ts +31 -28
  177. package/src/core/ai/context/providers/cell-output.ts +8 -8
  178. package/src/core/ai/context/providers/datasource.ts +10 -7
  179. package/src/core/ai/context/providers/error.ts +7 -7
  180. package/src/core/ai/context/providers/file.ts +8 -8
  181. package/src/core/ai/context/providers/tables.ts +7 -7
  182. package/src/core/ai/context/providers/variable.ts +7 -7
  183. package/src/core/ai/context/registry.ts +18 -18
  184. package/src/core/ai/ids/ids.ts +5 -5
  185. package/src/core/ai/model-registry.ts +12 -9
  186. package/src/core/ai/staged-cells.ts +6 -6
  187. package/src/core/ai/tools/base.ts +6 -6
  188. package/src/core/ai/tools/edit-notebook-tool.ts +6 -6
  189. package/src/core/ai/tools/registry.ts +4 -4
  190. package/src/core/ai/tools/run-cells-tool.ts +7 -7
  191. package/src/core/ai/tools/sample-tool.ts +6 -6
  192. package/src/core/cells/__tests__/cells.test.ts +27 -0
  193. package/src/core/cells/cells.ts +2 -1
  194. package/src/core/codemirror/cells/debugger-decorations.ts +13 -7
  195. package/src/core/codemirror/cells/line-timing-decorations.ts +9 -9
  196. package/src/core/codemirror/cells/traceback-decorations.ts +7 -4
  197. package/src/core/codemirror/code-lens/extension.ts +13 -13
  198. package/src/core/codemirror/copilot/__tests__/language-server.test.ts +6 -6
  199. package/src/core/codemirror/copilot/__tests__/transport.test.ts +12 -12
  200. package/src/core/codemirror/copilot/language-server.ts +13 -13
  201. package/src/core/codemirror/copilot/transport.ts +1 -1
  202. package/src/core/codemirror/find-replace/search-highlight.ts +5 -5
  203. package/src/core/codemirror/go-to-definition/underline.ts +3 -3
  204. package/src/core/codemirror/keymaps/vim.ts +3 -3
  205. package/src/core/codemirror/language/languages/markdown.ts +8 -8
  206. package/src/core/codemirror/language/languages/python.ts +7 -7
  207. package/src/core/codemirror/language/languages/sql/completion-builder.ts +5 -5
  208. package/src/core/codemirror/language/languages/sql/completion-store.ts +4 -4
  209. package/src/core/codemirror/language/languages/sql/sql.ts +21 -21
  210. package/src/core/codemirror/lsp/__tests__/transports.test.ts +10 -10
  211. package/src/core/codemirror/lsp/federated-lsp.ts +29 -27
  212. package/src/core/codemirror/lsp/notebook-lsp.ts +21 -21
  213. package/src/core/codemirror/misc/__tests__/dnd.test.ts +10 -10
  214. package/src/core/codemirror/misc/__tests__/paste.test.ts +7 -4
  215. package/src/core/codemirror/reactive-references/extension.ts +3 -3
  216. package/src/core/codemirror/rtc/loro/awareness.ts +12 -12
  217. package/src/core/codemirror/rtc/loro/sync.ts +5 -5
  218. package/src/core/codemirror/vim/cursor-visibility.ts +3 -3
  219. package/src/core/dom/ui-element.ts +5 -5
  220. package/src/core/dom/uiregistry.ts +10 -10
  221. package/src/core/hotkeys/hotkeys.ts +9 -9
  222. package/src/core/islands/__tests__/bridge.test.ts +4 -4
  223. package/src/core/islands/__tests__/test-utils.tsx +4 -4
  224. package/src/core/islands/bridge.ts +85 -82
  225. package/src/core/islands/components/web-components.tsx +7 -7
  226. package/src/core/islands/worker/__tests__/controller.test.ts +1 -1
  227. package/src/core/islands/worker/controller.ts +6 -3
  228. package/src/core/islands/worker-factory.ts +2 -2
  229. package/src/core/kernel/RuntimeState.ts +4 -4
  230. package/src/core/kernel/__tests__/session.test.ts +110 -1
  231. package/src/core/kernel/session.ts +46 -15
  232. package/src/core/lsp/__tests__/transport.test.ts +19 -19
  233. package/src/core/lsp/transport.ts +5 -5
  234. package/src/core/network/CachingRequestRegistry.ts +2 -2
  235. package/src/core/network/DeferredRequestRegistry.ts +4 -4
  236. package/src/core/network/__tests__/export-asset-url.test.ts +45 -0
  237. package/src/core/network/export-asset-url.ts +19 -0
  238. package/src/core/network/requests-network.ts +2 -7
  239. package/src/core/runtime/runtime.ts +25 -20
  240. package/src/core/static/virtual-file-tracker.ts +5 -5
  241. package/src/core/wasm/__tests__/bridge.test.ts +2 -2
  242. package/src/core/wasm/bridge.ts +132 -133
  243. package/src/core/wasm/router.ts +5 -5
  244. package/src/core/wasm/store.ts +4 -4
  245. package/src/core/wasm/worker/bootstrap.ts +8 -5
  246. package/src/core/wasm/worker/message-buffer.ts +3 -3
  247. package/src/core/websocket/transports/__tests__/ws.test.ts +8 -8
  248. package/src/core/websocket/transports/basic.ts +15 -8
  249. package/src/core/websocket/transports/sse.ts +7 -7
  250. package/src/core/websocket/transports/transport.ts +3 -3
  251. package/src/core/websocket/transports/ws.ts +9 -7
  252. package/src/css/globals.css +18 -21
  253. package/src/css/katex.min.css +260 -241
  254. package/src/hooks/__tests__/useOverflowDetection.test.tsx +5 -5
  255. package/src/hooks/__tests__/useResizeObserver.test.tsx +12 -12
  256. package/src/plugins/core/registerReactComponent.tsx +5 -5
  257. package/src/plugins/core/sidebar-element.tsx +2 -2
  258. package/src/plugins/impl/ButtonPlugin.tsx +3 -3
  259. package/src/plugins/impl/CheckboxPlugin.tsx +3 -3
  260. package/src/plugins/impl/CodeEditorPlugin.tsx +3 -3
  261. package/src/plugins/impl/DatePickerPlugin.tsx +3 -3
  262. package/src/plugins/impl/DateRangePlugin.tsx +3 -3
  263. package/src/plugins/impl/DateTimePickerPlugin.tsx +3 -3
  264. package/src/plugins/impl/DictPlugin.tsx +3 -3
  265. package/src/plugins/impl/DropdownPlugin.tsx +3 -3
  266. package/src/plugins/impl/FileUploadPlugin.tsx +3 -3
  267. package/src/plugins/impl/MatrixPlugin.tsx +4 -4
  268. package/src/plugins/impl/MicrophonePlugin.tsx +3 -3
  269. package/src/plugins/impl/MultiselectPlugin.tsx +3 -3
  270. package/src/plugins/impl/NumberPlugin.tsx +3 -3
  271. package/src/plugins/impl/RadioPlugin.tsx +9 -5
  272. package/src/plugins/impl/RangeSliderPlugin.tsx +3 -3
  273. package/src/plugins/impl/RefreshPlugin.tsx +3 -3
  274. package/src/plugins/impl/SliderPlugin.tsx +3 -3
  275. package/src/plugins/impl/SwitchPlugin.tsx +3 -3
  276. package/src/plugins/impl/TabsPlugin.tsx +3 -3
  277. package/src/plugins/impl/TextAreaPlugin.tsx +3 -3
  278. package/src/plugins/impl/TextInputPlugin.tsx +3 -3
  279. package/src/plugins/impl/__tests__/MatrixPlugin.test.tsx +2 -2
  280. package/src/plugins/impl/anywidget/model.ts +10 -10
  281. package/src/plugins/impl/anywidget/registry.ts +12 -9
  282. package/src/plugins/impl/anywidget/runtime.ts +11 -9
  283. package/src/plugins/impl/anywidget/widget-binding.ts +6 -6
  284. package/src/plugins/impl/image-comparison/ImageComparisonComponent.tsx +7 -6
  285. package/src/plugins/impl/matplotlib/MatplotlibPlugin.tsx +3 -3
  286. package/src/plugins/impl/matplotlib/__tests__/matplotlib-renderer.test.ts +2 -2
  287. package/src/plugins/impl/matplotlib/matplotlib-renderer.ts +2 -2
  288. package/src/plugins/impl/mpl-interactive/mpl-websocket-shim.ts +10 -10
  289. package/src/plugins/impl/panel/utils.ts +5 -5
  290. package/src/plugins/impl/plotly/PlotlyPlugin.tsx +3 -3
  291. package/src/plugins/impl/vega/VegaPlugin.tsx +3 -3
  292. package/src/plugins/impl/vega/__tests__/use-vega-container-remeasure.test.ts +7 -7
  293. package/src/plugins/impl/vega/__tests__/utils.test.ts +16 -1
  294. package/src/plugins/impl/vega/__tests__/vega.test.ts +37 -0
  295. package/src/plugins/impl/vega/loader.ts +23 -1
  296. package/src/plugins/impl/vega/utils.ts +5 -4
  297. package/src/plugins/layout/AccordionPlugin.tsx +3 -3
  298. package/src/plugins/layout/CalloutPlugin.tsx +3 -3
  299. package/src/plugins/layout/ImageComparisonPlugin.tsx +5 -3
  300. package/src/plugins/layout/JsonOutputPlugin.tsx +3 -3
  301. package/src/plugins/layout/MimeRenderPlugin.tsx +3 -3
  302. package/src/plugins/layout/NavigationMenuPlugin.tsx +3 -3
  303. package/src/plugins/layout/OutlinePlugin.tsx +3 -3
  304. package/src/plugins/layout/ProgressPlugin.tsx +3 -3
  305. package/src/plugins/layout/RoutesPlugin.tsx +6 -8
  306. package/src/plugins/layout/StatPlugin.tsx +3 -3
  307. package/src/plugins/layout/TexPlugin.tsx +3 -3
  308. package/src/plugins/layout/carousel/CarouselPlugin.tsx +4 -4
  309. package/src/plugins/layout/mermaid/MermaidPlugin.tsx +3 -3
  310. package/src/utils/Deferred.ts +6 -6
  311. package/src/utils/async-capture-tracker.ts +10 -7
  312. package/src/utils/errors.ts +5 -5
  313. package/src/utils/id-tree.tsx +83 -80
  314. package/src/utils/lru.ts +1 -1
  315. package/src/utils/multi-map.ts +14 -12
  316. package/src/utils/paths.ts +6 -6
  317. package/src/utils/pluralize.ts +3 -3
  318. package/src/utils/progress.ts +6 -6
  319. package/src/utils/python-poet/poet.ts +14 -14
  320. package/src/utils/routes.ts +4 -2
  321. package/src/utils/semaphore.ts +6 -6
  322. package/src/utils/storage/storage.ts +6 -6
  323. package/src/utils/storage/typed.ts +16 -12
  324. package/src/utils/time.ts +9 -9
  325. package/src/utils/timed-cache.ts +4 -4
  326. package/src/utils/tracer.ts +9 -6
  327. package/dist/assets/LazyAnyLanguageCodeMirror-EBegnOE0.js +0 -2
  328. package/dist/assets/add-cell-with-ai-Ovbsj95O.js +0 -76
  329. package/dist/assets/ai-model-dropdown-1t7m1iFc.js +0 -3
  330. package/dist/assets/app-config-button-vCxNGhe2.js +0 -1
  331. package/dist/assets/channel-ni7ei-yz.js +0 -1
  332. package/dist/assets/chat-panel-CzdR8RG_.js +0 -4
  333. package/dist/assets/classDiagram-ZZMXUADV-CIEFh40S.js +0 -1
  334. package/dist/assets/classDiagram-v2-VYDZK3BY-CIEFh40S.js +0 -1
  335. package/dist/assets/code-visibility-G0W4ym3Y.js +0 -1
  336. package/dist/assets/command-palette-DhdK67bL.js +0 -1
  337. package/dist/assets/components-CQVZgYvR.js +0 -1
  338. package/dist/assets/config-CMqNngzA.js +0 -1
  339. package/dist/assets/config-CmBpjGXk.js +0 -1
  340. package/dist/assets/data-grid-overlay-editor-DbqMOWZn.js +0 -1
  341. package/dist/assets/edit-page-_D_Nv3dJ.js +0 -176
  342. package/dist/assets/file-explorer-panel-LAa-LxTN.js +0 -1
  343. package/dist/assets/file-name-input-BXq6eIDs.js +0 -3
  344. package/dist/assets/flowDiagram-HODETNUW-B4xRBXB1.js +0 -1
  345. package/dist/assets/glide-data-editor-DPMjaN4R.js +0 -131
  346. package/dist/assets/has-CanCEarv.js +0 -1
  347. package/dist/assets/home-page-vDWLpS4F.js +0 -4
  348. package/dist/assets/index-2TQenOiQ.css +0 -2
  349. package/dist/assets/index-CgQsZfww.js +0 -62
  350. package/dist/assets/katex-mNPPSsir.js +0 -257
  351. package/dist/assets/katex-ukvJUC1e.js +0 -257
  352. package/dist/assets/mhchem-DcHTrqjv.js +0 -1
  353. package/dist/assets/packages-panel-B8HU9FAM.js +0 -1
  354. package/dist/assets/run-page-E0qMru0p.js +0 -1
  355. package/dist/assets/scratchpad-panel-CCFyaegO.js +0 -1
  356. package/dist/assets/session-C8nQMsOE.js +0 -1
  357. package/dist/assets/session-panel-CR3BHLhQ.js +0 -1
  358. package/dist/assets/snippets-panel-Dn22yTr_.js +0 -1
  359. package/dist/assets/stateDiagram-v2-MP3YSRHH-BQvYFx_a.js +0 -1
  360. package/dist/assets/swimlanesDiagram-VR7AAH4N-BAn2JKhB.js +0 -8
  361. package/dist/assets/tooltip-B1vGi-z4.js +0 -61
  362. package/dist/assets/tracing-panel-C5ybTQyJ.js +0 -2
  363. package/dist/assets/useCellActionButton-Bm9OZdcq.js +0 -1
  364. package/dist/assets/useTheme-Ho3YdAx3.js +0 -1
  365. package/dist/assets/youtube-ELpGJEdR.js +0 -1
@@ -0,0 +1,3 @@
1
+ import{a as e,r as t,t as n}from"./rolldown-runtime-B0Z9INg1.js";import{t as r}from"./useEvent-Dc9HkKI2.js";import{t as i}from"./react-CUdNIagt.js";import{t as a}from"./compiler-runtime-BQ9S8nyo.js";import{ot as o}from"./ai-model-dropdown-DJ2elMLM.js";import{_ as s}from"./useEventListener-BdZUApHd.js";import{t as c}from"./jsx-runtime-B74pBk57.js";import{o as l}from"./alert-dialog-CeE3i3Qa.js";import{a as u,p as d,r as f,t as p}from"./dropdown-menu-VuyoeQOD.js";import{t as m}from"./createLucideIcon-rHn2EdoM.js";import{t as h}from"./paths-CzfpItSz.js";import{t as g}from"./copy-RyCOE8jo.js";import{b as _}from"./write-secret-modal-BiG2tahJ.js";import{t as ee}from"./trash-2-BJG-7Qob.js";import{t as v}from"./use-toast-CC89xOwH.js";import{r as y}from"./requests-yTHMxhVa.js";import{a as te}from"./errors-D9vyuMar.js";import{d as ne,en as b,l as re,s as ie,tn as x,u as S,zr as ae}from"./index-DafnX1Xx.js";var oe=m(`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`}]]),se=n(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),C=c(),w=e(i(),1),ce=(0,w.createContext)({dragDropManager:void 0});function T(e){return`Minified Redux error #`+e+`; visit https://redux.js.org/Errors?code=`+e+` for the full message or use the non-minified dev environment for full errors. `}var le=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})(),ue=function(){return Math.random().toString(36).substring(7).split(``).join(`.`)},de={INIT:`@@redux/INIT`+ue(),REPLACE:`@@redux/REPLACE`+ue(),PROBE_UNKNOWN_ACTION:function(){return`@@redux/PROBE_UNKNOWN_ACTION`+ue()}};function fe(e){if(typeof e!=`object`||!e)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function pe(e,t,n){var r;if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(T(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(T(1));return n(pe)(e,t)}if(typeof e!=`function`)throw Error(T(2));var i=e,a=t,o=[],s=o,c=!1;function l(){s===o&&(s=o.slice())}function u(){if(c)throw Error(T(3));return a}function d(e){if(typeof e!=`function`)throw Error(T(4));if(c)throw Error(T(5));var t=!0;return l(),s.push(e),function(){if(t){if(c)throw Error(T(6));t=!1,l();var n=s.indexOf(e);s.splice(n,1),o=null}}}function f(e){if(!fe(e))throw Error(T(7));if(e.type===void 0)throw Error(T(8));if(c)throw Error(T(9));try{c=!0,a=i(a,e)}finally{c=!1}for(var t=o=s,n=0;n<t.length;n++){var r=t[n];r()}return e}function p(e){if(typeof e!=`function`)throw Error(T(10));i=e,f({type:de.REPLACE})}function m(){var e,t=d;return e={subscribe:function(e){if(typeof e!=`object`||!e)throw Error(T(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}},e[le]=function(){return this},e}return f({type:de.INIT}),r={dispatch:f,subscribe:d,getState:u,replaceReducer:p},r[le]=m,r}function E(e,t,...n){if(me()&&t===void 0)throw Error(`invariant requires an error message argument`);if(!e){let e;if(t===void 0)e=Error(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{let r=0;e=Error(t.replace(/%s/g,function(){return n[r++]})),e.name=`Invariant Violation`}throw e.framesToPop=1,e}}function me(){return typeof process<`u`&&!0}function he(e,t,n){return t.split(`.`).reduce((e,t)=>e&&e[t]?e[t]:n||null,e)}function ge(e,t){return e.filter(e=>e!==t)}function _e(e){return typeof e==`object`}function ve(e,t){let n=new Map,r=e=>{n.set(e,n.has(e)?n.get(e)+1:1)};e.forEach(r),t.forEach(r);let i=[];return n.forEach((e,t)=>{e===1&&i.push(t)}),i}function ye(e,t){return e.filter(e=>t.indexOf(e)>-1)}var be=`dnd-core/INIT_COORDS`,D=`dnd-core/BEGIN_DRAG`,xe=`dnd-core/PUBLISH_DRAG_SOURCE`,Se=`dnd-core/HOVER`,Ce=`dnd-core/DROP`,we=`dnd-core/END_DRAG`;function Te(e,t){return{type:be,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}var Ee={type:be,payload:{clientOffset:null,sourceClientOffset:null}};function De(e){return function(t=[],n={publishSource:!0}){let{publishSource:r=!0,clientOffset:i,getSourceClientOffset:a}=n,o=e.getMonitor(),s=e.getRegistry();e.dispatch(Te(i)),Oe(t,o,s);let c=je(t,o);if(c==null){e.dispatch(Ee);return}let l=null;if(i){if(!a)throw Error(`getSourceClientOffset must be defined`);ke(a),l=a(c)}e.dispatch(Te(i,l));let u=s.getSource(c).beginDrag(o,c);return u==null?void 0:(Ae(u),s.pinSource(c),{type:D,payload:{itemType:s.getSourceType(c),item:u,sourceId:c,clientOffset:i||null,sourceClientOffset:l||null,isSourcePublic:!!r}})}}function Oe(e,t,n){E(!t.isDragging(),`Cannot call beginDrag while dragging.`),e.forEach(function(e){E(n.getSource(e),`Expected sourceIds to be registered.`)})}function ke(e){E(typeof e==`function`,`When clientOffset is provided, getSourceClientOffset must be a function.`)}function Ae(e){E(_e(e),`Item must be an object.`)}function je(e,t){let n=null;for(let r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}function Me(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ne(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Me(e,t,n[t])})}return e}function Pe(e){return function(t={}){let n=e.getMonitor(),r=e.getRegistry();Fe(n),Re(n).forEach((i,a)=>{let o={type:Ce,payload:{dropResult:Ne({},t,Ie(i,a,r,n))}};e.dispatch(o)})}}function Fe(e){E(e.isDragging(),`Cannot call drop while not dragging.`),E(!e.didDrop(),`Cannot call drop twice during one drag operation.`)}function Ie(e,t,n,r){let i=n.getTarget(e),a=i?i.drop(r,e):void 0;return Le(a),a===void 0&&(a=t===0?{}:r.getDropResult()),a}function Le(e){E(e===void 0||_e(e),`Drop result must either be an object or undefined.`)}function Re(e){let t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function ze(e){return function(){let t=e.getMonitor(),n=e.getRegistry();Be(t);let r=t.getSourceId();return r!=null&&(n.getSource(r,!0).endDrag(t,r),n.unpinSource()),{type:we}}}function Be(e){E(e.isDragging(),`Cannot call endDrag while not dragging.`)}function Ve(e,t){return t===null?e===null:Array.isArray(e)?e.some(e=>e===t):e===t}function He(e){return function(t,{clientOffset:n}={}){Ue(t);let r=t.slice(0),i=e.getMonitor(),a=e.getRegistry();return Ge(r,a,i.getItemType()),We(r,i,a),Ke(r,i,a),{type:Se,payload:{targetIds:r,clientOffset:n||null}}}}function Ue(e){E(Array.isArray(e),`Expected targetIds to be an array.`)}function We(e,t,n){E(t.isDragging(),`Cannot call hover while not dragging.`),E(!t.didDrop(),`Cannot call hover after drop.`);for(let t=0;t<e.length;t++){let r=e[t];E(e.lastIndexOf(r)===t,`Expected targetIds to be unique in the passed array.`),E(n.getTarget(r),`Expected targetIds to be registered.`)}}function Ge(e,t,n){for(let r=e.length-1;r>=0;r--){let i=e[r];Ve(t.getTargetType(i),n)||e.splice(r,1)}}function Ke(e,t,n){e.forEach(function(e){n.getTarget(e).hover(t,e)})}function qe(e){return function(){if(e.getMonitor().isDragging())return{type:xe}}}function Je(e){return{beginDrag:De(e),publishDragSource:qe(e),hover:He(e),drop:Pe(e),endDrag:ze(e)}}var Ye=class{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){let e=this,{dispatch:t}=this.store;function n(n){return(...r)=>{let i=n.apply(e,r);i!==void 0&&t(i)}}let r=Je(this);return Object.keys(r).reduce((e,t)=>{let i=r[t];return e[t]=n(i),e},{})}dispatch(e){this.store.dispatch(e)}constructor(e,t){this.isSetUp=!1,this.handleRefCountChange=()=>{let e=this.store.getState().refCount>0;this.backend&&(e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=t,e.subscribe(this.handleRefCountChange)}};function Xe(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Ze(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Qe(e){let{clientOffset:t,initialClientOffset:n,initialSourceClientOffset:r}=e;return!t||!n||!r?null:Ze(Xe(t,r),n)}function $e(e){let{clientOffset:t,initialClientOffset:n}=e;return!t||!n?null:Ze(t,n)}var O=[],et=[];O.__IS_NONE__=!0,et.__IS_ALL__=!0;function tt(e,t){return e===O?!1:e===et||t===void 0||ye(t,e).length>0}var nt=class{subscribeToStateChange(e,t={}){let{handlerIds:n}=t;E(typeof e==`function`,`listener must be a function.`),E(n===void 0||Array.isArray(n),`handlerIds, when specified, must be an array of strings.`);let r=this.store.getState().stateId;return this.store.subscribe(()=>{let t=this.store.getState(),i=t.stateId;try{i===r||i===r+1&&!tt(t.dirtyHandlerIds,n)||e()}finally{r=i}})}subscribeToOffsetChange(e){E(typeof e==`function`,`listener must be a function.`);let t=this.store.getState().dragOffset;return this.store.subscribe(()=>{let n=this.store.getState().dragOffset;n!==t&&(t=n,e())})}canDragSource(e){if(!e)return!1;let t=this.registry.getSource(e);return E(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()&&t.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;let t=this.registry.getTarget(e);return E(t,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop()?!1:Ve(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;let t=this.registry.getSource(e,!0);return E(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic()||this.registry.getSourceType(e)!==this.getItemType()?!1:t.isDragging(this,e)}isOverTarget(e,t={shallow:!1}){if(!e)return!1;let{shallow:n}=t;if(!this.isDragging())return!1;let r=this.registry.getTargetType(e),i=this.getItemType();if(i&&!Ve(r,i))return!1;let a=this.getTargetIds();if(!a.length)return!1;let o=a.indexOf(e);return n?o===a.length-1:o>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return Qe(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return $e(this.store.getState().dragOffset)}constructor(e,t){this.store=e,this.registry=t}},rt=typeof global<`u`?global:self,it=rt.MutationObserver||rt.WebKitMutationObserver;function at(e){return function(){let t=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(t),clearInterval(n),e()}}}function ot(e){let t=1,n=new it(e),r=document.createTextNode(``);return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}var st=typeof it==`function`?ot:at,ct=class{enqueueTask(e){let{queue:t,requestFlush:n}=this;t.length||(n(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{let{queue:e}=this;for(;this.index<e.length;){let t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let t=0,n=e.length-this.index;t<n;t++)e[t]=e[t+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=st(this.flush),this.requestErrorThrow=at(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},lt=class{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}},ut=class{create(e){let t=this.freeTasks,n=t.length?t.pop():new lt(this.onError,e=>t[t.length]=e);return n.task=e,n}constructor(e){this.onError=e,this.freeTasks=[]}},dt=new ct,ft=new ut(dt.registerPendingError);function pt(e){dt.enqueueTask(ft.create(e))}var mt=`dnd-core/ADD_SOURCE`,ht=`dnd-core/ADD_TARGET`,gt=`dnd-core/REMOVE_SOURCE`,_t=`dnd-core/REMOVE_TARGET`;function vt(e){return{type:mt,payload:{sourceId:e}}}function yt(e){return{type:ht,payload:{targetId:e}}}function bt(e){return{type:gt,payload:{sourceId:e}}}function xt(e){return{type:_t,payload:{targetId:e}}}function St(e){E(typeof e.canDrag==`function`,`Expected canDrag to be a function.`),E(typeof e.beginDrag==`function`,`Expected beginDrag to be a function.`),E(typeof e.endDrag==`function`,`Expected endDrag to be a function.`)}function Ct(e){E(typeof e.canDrop==`function`,`Expected canDrop to be a function.`),E(typeof e.hover==`function`,`Expected hover to be a function.`),E(typeof e.drop==`function`,`Expected beginDrag to be a function.`)}function wt(e,t){if(t&&Array.isArray(e)){e.forEach(e=>wt(e,!1));return}E(typeof e==`string`||typeof e==`symbol`,t?`Type can only be a string, a symbol, or an array of either.`:`Type can only be a string or a symbol.`)}var k;(function(e){e.SOURCE=`SOURCE`,e.TARGET=`TARGET`})(k||={});var Tt=0;function Et(){return Tt++}function Dt(e){let t=Et().toString();switch(e){case k.SOURCE:return`S${t}`;case k.TARGET:return`T${t}`;default:throw Error(`Unknown Handler Role: ${e}`)}}function Ot(e){switch(e[0]){case`S`:return k.SOURCE;case`T`:return k.TARGET;default:throw Error(`Cannot parse handler ID: ${e}`)}}function kt(e,t){let n=e.entries(),r=!1;do{let{done:e,value:[,i]}=n.next();if(i===t)return!0;r=!!e}while(!r);return!1}var At=class{addSource(e,t){wt(e),St(t);let n=this.addHandler(k.SOURCE,e,t);return this.store.dispatch(vt(n)),n}addTarget(e,t){wt(e,!0),Ct(t);let n=this.addHandler(k.TARGET,e,t);return this.store.dispatch(yt(n)),n}containsHandler(e){return kt(this.dragSources,e)||kt(this.dropTargets,e)}getSource(e,t=!1){return E(this.isSourceId(e),`Expected a valid source ID.`),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return E(this.isTargetId(e),`Expected a valid target ID.`),this.dropTargets.get(e)}getSourceType(e){return E(this.isSourceId(e),`Expected a valid source ID.`),this.types.get(e)}getTargetType(e){return E(this.isTargetId(e),`Expected a valid target ID.`),this.types.get(e)}isSourceId(e){return Ot(e)===k.SOURCE}isTargetId(e){return Ot(e)===k.TARGET}removeSource(e){E(this.getSource(e),`Expected an existing source.`),this.store.dispatch(bt(e)),pt(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){E(this.getTarget(e),`Expected an existing target.`),this.store.dispatch(xt(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){let t=this.getSource(e);E(t,`Expected an existing source.`),this.pinnedSourceId=e,this.pinnedSource=t}unpinSource(){E(this.pinnedSource,`No source is pinned at the time.`),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,t,n){let r=Dt(e);return this.types.set(r,t),e===k.SOURCE?this.dragSources.set(r,n):e===k.TARGET&&this.dropTargets.set(r,n),r}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}},jt=(e,t)=>e===t;function Mt(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function Nt(e,t,n=jt){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!n(e[r],t[r]))return!1;return!0}function Pt(e=O,t){switch(t.type){case Se:break;case mt:case ht:case _t:case gt:return O;case D:case xe:case we:case Ce:default:return et}let{targetIds:n=[],prevTargetIds:r=[]}=t.payload,i=ve(n,r);if(!(i.length>0||!Nt(n,r)))return O;let a=r[r.length-1],o=n[n.length-1];return a!==o&&(a&&i.push(a),o&&i.push(o)),i}function Ft(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function It(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Ft(e,t,n[t])})}return e}var Lt={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Rt(e=Lt,t){let{payload:n}=t;switch(t.type){case be:case D:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case Se:return Mt(e.clientOffset,n.clientOffset)?e:It({},e,{clientOffset:n.clientOffset});case we:case Ce:return Lt;default:return e}}function zt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){zt(e,t,n[t])})}return e}var Bt={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Vt(e=Bt,t){let{payload:n}=t;switch(t.type){case D:return A({},e,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case xe:return A({},e,{isSourcePublic:!0});case Se:return A({},e,{targetIds:n.targetIds});case _t:return e.targetIds.indexOf(n.targetId)===-1?e:A({},e,{targetIds:ge(e.targetIds,n.targetId)});case Ce:return A({},e,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case we:return A({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function Ht(e=0,t){switch(t.type){case mt:case ht:return e+1;case gt:case _t:return e-1;default:return e}}function Ut(e=0){return e+1}function Wt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){Wt(e,t,n[t])})}return e}function Kt(e={},t){return{dirtyHandlerIds:Pt(e.dirtyHandlerIds,{type:t.type,payload:Gt({},t.payload,{prevTargetIds:he(e,`dragOperation.targetIds`,[])})}),dragOffset:Rt(e.dragOffset,t),refCount:Ht(e.refCount,t),dragOperation:Vt(e.dragOperation,t),stateId:Ut(e.stateId)}}function qt(e,t=void 0,n={},r=!1){let i=Jt(r),a=new Ye(i,new nt(i,new At(i))),o=e(a,t,n);return a.receiveBackend(o),a}function Jt(e){let t=typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__;return pe(Kt,e&&t&&t({name:`dnd-core`,instanceId:`dnd-core`}))}function Yt(e,t){if(e==null)return{};var n=Xt(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Xt(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Zt=0,j=Symbol.for(`__REACT_DND_CONTEXT_INSTANCE__`),Qt=(0,w.memo)(function(e){var{children:t}=e;let[n,r]=$t(Yt(e,[`children`]));return(0,w.useEffect)(()=>{if(r){let e=tn();return++Zt,()=>{--Zt===0&&(e[j]=null)}}},[]),(0,C.jsx)(ce.Provider,{value:n,children:t})});function $t(e){return`manager`in e?[{dragDropManager:e.manager},!1]:[en(e.backend,e.context,e.options,e.debugMode),!e.context]}function en(e,t=tn(),n,r){let i=t;return i[j]||(i[j]={dragDropManager:qt(e,t,n,r)}),i[j]}function tn(){return typeof global<`u`?global:window}var nn=e(se(),1),M=typeof window<`u`?w.useLayoutEffect:w.useEffect;function rn(e,t,n){let[r,i]=(0,w.useState)(()=>t(e)),a=(0,w.useCallback)(()=>{let a=t(e);(0,nn.default)(r,a)||(i(a),n&&n())},[r,e,n]);return M(a),[r,a]}function an(e,t,n){let[r,i]=rn(e,t,n);return M(function(){let t=e.getHandlerId();if(t!=null)return e.subscribeToStateChange(i,{handlerIds:[t]})},[e,i]),r}function on(e,t,n){return an(t,e||(()=>({})),()=>n.reconnect())}function sn(e,t){let n=[...t||[]];return t==null&&typeof e!=`function`&&n.push(e),(0,w.useMemo)(()=>typeof e==`function`?e():e,n)}function cn(e){return(0,w.useMemo)(()=>e.hooks.dragSource(),[e])}function ln(e){return(0,w.useMemo)(()=>e.hooks.dragPreview(),[e])}var un=!1,dn=!1,fn=class{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){E(!un,`You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor`);try{return un=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{un=!1}}isDragging(){if(!this.sourceId)return!1;E(!dn,`You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor`);try{return dn=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{dn=!1}}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,t){return this.internalMonitor.isOverTarget(e,t)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}},pn=!1,mn=class{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}canDrop(){if(!this.targetId)return!1;E(!pn,`You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor`);try{return pn=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{pn=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}};function hn(e,t,n){let r=n.getRegistry(),i=r.addTarget(e,t);return[i,()=>r.removeTarget(i)]}function gn(e,t,n){let r=n.getRegistry(),i=r.addSource(e,t);return[i,()=>r.removeSource(i)]}function _n(e,t,n,r){let i=n?n.call(r,e,t):void 0;if(i!==void 0)return!!i;if(e===t)return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let a=Object.keys(e),o=Object.keys(t);if(a.length!==o.length)return!1;let s=Object.prototype.hasOwnProperty.bind(t);for(let o=0;o<a.length;o++){let c=a[o];if(!s(c))return!1;let l=e[c],u=t[c];if(i=n?n.call(r,l,u,c):void 0,i===!1||i===void 0&&l!==u)return!1}return!0}function vn(e){return typeof e==`object`&&!!e&&Object.prototype.hasOwnProperty.call(e,`current`)}function yn(e){if(typeof e.type==`string`)return;let t=e.type.displayName||e.type.name||`the component`;throw Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}function bn(e){return(t=null,n=null)=>{if(!(0,w.isValidElement)(t)){let r=t;return e(r,n),r}let r=t;return yn(r),Cn(r,n?t=>e(t,n):e)}}function xn(e){let t={};return Object.keys(e).forEach(n=>{let r=e[n];if(n.endsWith(`Ref`))t[n]=e[n];else{let e=bn(r);t[n]=()=>e}}),t}function Sn(e,t){typeof e==`function`?e(t):e.current=t}function Cn(e,t){let n=e.ref;return E(typeof n!=`string`,`Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs`),n?(0,w.cloneElement)(e,{ref:e=>{Sn(n,e),Sn(t,e)}}):(0,w.cloneElement)(e,{ref:t})}var wn=class{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){let e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){let e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return t&&this.disconnectDragSource(),this.handlerId?e?(t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),t):(this.lastConnectedDragSource=e,t):t}reconnectDragPreview(e=!1){let t=this.dragPreview,n=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(n&&this.disconnectDragPreview(),this.handlerId){if(!t){this.lastConnectedDragPreview=t;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=t,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,t,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!_n(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!_n(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&=(this.dragSourceUnsubscribe(),void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=xn({dragSource:(e,t)=>{this.clearDragSource(),this.dragSourceOptions=t||null,vn(e)?this.dragSourceRef=e:this.dragSourceNode=e,this.reconnectDragSource()},dragPreview:(e,t)=>{this.clearDragPreview(),this.dragPreviewOptions=t||null,vn(e)?this.dragPreviewRef=e:this.dragPreviewNode=e,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}},Tn=class{get connectTarget(){return this.dropTarget}reconnect(){let e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();let t=this.dropTarget;if(this.handlerId){if(!t){this.lastConnectedDropTarget=t;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!_n(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&=(this.unsubscribeDropTarget(),void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=xn({dropTarget:(e,t)=>{this.clearDropTarget(),this.dropTargetOptions=t,vn(e)?this.dropTargetRef=e:this.dropTargetNode=e,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}};function N(){let{dragDropManager:e}=(0,w.useContext)(ce);return E(e!=null,`Expected drag drop context`),e}function En(e,t){let n=N(),r=(0,w.useMemo)(()=>new wn(n.getBackend()),[n]);return M(()=>(r.dragSourceOptions=e||null,r.reconnect(),()=>r.disconnectDragSource()),[r,e]),M(()=>(r.dragPreviewOptions=t||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,t]),r}function Dn(){let e=N();return(0,w.useMemo)(()=>new fn(e),[e])}var On=class{beginDrag(){let e=this.spec,t=this.monitor,n=null;return n=typeof e.item==`object`?e.item:typeof e.item==`function`?e.item(t):{},n??null}canDrag(){let e=this.spec,t=this.monitor;return typeof e.canDrag==`boolean`?e.canDrag:typeof e.canDrag!=`function`||e.canDrag(t)}isDragging(e,t){let n=this.spec,r=this.monitor,{isDragging:i}=n;return i?i(r):t===e.getSourceId()}endDrag(){let e=this.spec,t=this.monitor,n=this.connector,{end:r}=e;r&&r(t.getItem(),t),n.reconnect()}constructor(e,t,n){this.spec=e,this.monitor=t,this.connector=n}};function kn(e,t,n){let r=(0,w.useMemo)(()=>new On(e,t,n),[t,n]);return(0,w.useEffect)(()=>{r.spec=e},[e]),r}function An(e){return(0,w.useMemo)(()=>{let t=e.type;return E(t!=null,`spec.type must be defined`),t},[e])}function jn(e,t,n){let r=N(),i=kn(e,t,n),a=An(e);M(function(){if(a!=null){let[e,o]=gn(a,i,r);return t.receiveHandlerId(e),n.receiveHandlerId(e),o}},[r,t,n,i,a])}function Mn(e,t){let n=sn(e,t);E(!n.begin,`useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)`);let r=Dn(),i=En(n.options,n.previewOptions);return jn(n,r,i),[on(n.collect,r,i),cn(i),ln(i)]}function Nn(e){let t=N().getMonitor(),[n,r]=rn(t,e);return(0,w.useEffect)(()=>t.subscribeToOffsetChange(r)),(0,w.useEffect)(()=>t.subscribeToStateChange(r)),n}function Pn(e){return(0,w.useMemo)(()=>e.hooks.dropTarget(),[e])}function Fn(e){let t=N(),n=(0,w.useMemo)(()=>new Tn(t.getBackend()),[t]);return M(()=>(n.dropTargetOptions=e||null,n.reconnect(),()=>n.disconnectDropTarget()),[e]),n}function In(){let e=N();return(0,w.useMemo)(()=>new mn(e),[e])}function Ln(e){let{accept:t}=e;return(0,w.useMemo)(()=>(E(e.accept!=null,`accept must be defined`),Array.isArray(t)?t:[t]),[t])}var Rn=class{canDrop(){let e=this.spec,t=this.monitor;return!e.canDrop||e.canDrop(t.getItem(),t)}hover(){let e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)}drop(){let e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)}constructor(e,t){this.spec=e,this.monitor=t}};function zn(e,t){let n=(0,w.useMemo)(()=>new Rn(e,t),[t]);return(0,w.useEffect)(()=>{n.spec=e},[e]),n}function Bn(e,t,n){let r=N(),i=zn(e,t),a=Ln(e);M(function(){let[e,o]=hn(a,i,r);return t.receiveHandlerId(e),n.receiveHandlerId(e),o},[r,t,i,n,a.map(e=>e.toString()).join(`|`)])}function Vn(e,t){let n=sn(e,t),r=In(),i=Fn(n.options);return Bn(n,r,i),[on(n.collect,r,i),Pn(i)]}var Hn=o();function Un(e){let t=null;return()=>(t??=e(),t)}function Wn(e,t){return e.filter(e=>e!==t)}function Gn(e,t){let n=new Set,r=e=>n.add(e);e.forEach(r),t.forEach(r);let i=[];return n.forEach(e=>i.push(e)),i}var Kn=class{enter(e){let t=this.entered.length,n=t=>this.isNodeInDocument(t)&&(!t.contains||t.contains(e));return this.entered=Gn(this.entered.filter(n),[e]),t===0&&this.entered.length>0}leave(e){let t=this.entered.length;return this.entered=Wn(this.entered.filter(this.isNodeInDocument),e),t>0&&this.entered.length===0}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}},qn=class{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null}})})}loadDataTransfer(e){if(e){let t={};Object.keys(this.config.exposeProperties).forEach(n=>{let r=this.config.exposeProperties[n];r!=null&&(t[n]={value:r(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,t)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,t){return t===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}},Jn=t({FILE:()=>Yn,HTML:()=>Qn,TEXT:()=>Zn,URL:()=>Xn}),Yn=`__NATIVE_FILE__`,Xn=`__NATIVE_URL__`,Zn=`__NATIVE_TEXT__`,Qn=`__NATIVE_HTML__`;function $n(e,t,n){return t.reduce((t,n)=>t||e.getData(n),``)??n}var er={[Yn]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:[`Files`]},[Qn]:{exposeProperties:{html:(e,t)=>$n(e,t,``),dataTransfer:e=>e},matchesTypes:[`Html`,`text/html`]},[Xn]:{exposeProperties:{urls:(e,t)=>$n(e,t,``).split(`
2
+ `),dataTransfer:e=>e},matchesTypes:[`Url`,`text/uri-list`]},[Zn]:{exposeProperties:{text:(e,t)=>$n(e,t,``),dataTransfer:e=>e},matchesTypes:[`Text`,`text/plain`]}};function tr(e,t){let n=er[e];if(!n)throw Error(`native type ${e} has no configuration`);let r=new qn(n);return r.loadDataTransfer(t),r}function nr(e){if(!e)return null;let t=Array.prototype.slice.call(e.types||[]);return Object.keys(er).filter(e=>{let n=er[e];return n?.matchesTypes?n.matchesTypes.some(e=>t.indexOf(e)>-1):!1})[0]||null}var rr=Un(()=>/firefox/i.test(navigator.userAgent)),ir=Un(()=>!!window.safari),ar=class{interpolate(e){let{xs:t,ys:n,c1s:r,c2s:i,c3s:a}=this,o=t.length-1;if(e===t[o])return n[o];let s=0,c=a.length-1,l;for(;s<=c;){l=Math.floor(.5*(s+c));let r=t[l];if(r<e)s=l+1;else if(r>e)c=l-1;else return n[l]}o=Math.max(0,c);let u=e-t[o],d=u*u;return n[o]+r[o]*u+i[o]*d+a[o]*u*d}constructor(e,t){let{length:n}=e,r=[];for(let e=0;e<n;e++)r.push(e);r.sort((t,n)=>e[t]<e[n]?-1:1);let i=[],a=[],o=[],s,c;for(let r=0;r<n-1;r++)s=e[r+1]-e[r],c=t[r+1]-t[r],a.push(s),i.push(c),o.push(c/s);let l=[o[0]];for(let e=0;e<a.length-1;e++){let t=o[e],n=o[e+1];if(t*n<=0)l.push(0);else{s=a[e];let r=a[e+1],i=s+r;l.push(3*i/((i+r)/t+(i+s)/n))}}l.push(o[o.length-1]);let u=[],d=[],f;for(let e=0;e<l.length-1;e++){f=o[e];let t=l[e],n=1/a[e],r=t+l[e+1]-f-f;u.push((f-t-r)*n),d.push(r*n*n)}this.xs=e,this.ys=t,this.c1s=l,this.c2s=u,this.c3s=d}},or=1;function sr(e){let t=e.nodeType===or?e:e.parentElement;if(!t)return null;let{top:n,left:r}=t.getBoundingClientRect();return{x:r,y:n}}function P(e){return{x:e.clientX,y:e.clientY}}function cr(e){return e.nodeName===`IMG`&&(rr()||!document.documentElement?.contains(e))}function lr(e,t,n,r){let i=e?t.width:n,a=e?t.height:r;return ir()&&e&&(a/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:a}}function ur(e,t,n,r,i){let a=cr(t),o=sr(a?e:t),s={x:n.x-o.x,y:n.y-o.y},{offsetWidth:c,offsetHeight:l}=e,{anchorX:u,anchorY:d}=r,{dragPreviewWidth:f,dragPreviewHeight:p}=lr(a,t,c,l),m=()=>{let e=new ar([0,.5,1],[s.y,s.y/l*p,s.y+p-l]).interpolate(d);return ir()&&a&&(e+=(window.devicePixelRatio-1)*p),e},h=()=>new ar([0,.5,1],[s.x,s.x/c*f,s.x+f-c]).interpolate(u),{offsetX:g,offsetY:_}=i,ee=g===0||g,v=_===0||_;return{x:ee?g:h(),y:v?_:m()}}var dr=class{get window(){if(this.globalContext)return this.globalContext;if(typeof window<`u`)return window}get document(){if(this.globalContext?.document)return this.globalContext.document;if(this.window)return this.window.document}get rootElement(){return this.optionsArgs?.rootElement||this.window}constructor(e,t){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=t}};function fr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t],r=Object.keys(n);typeof Object.getOwnPropertySymbols==`function`&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){fr(e,t,n[t])})}return e}var mr=class{profile(){return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:this.dragStartSourceIds?.length||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:this.dragOverTargetIds?.length||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){let e=this.rootElement;if(e!==void 0){if(e.__isReactDndBackendSetUp)throw Error(`Cannot have two HTML5 backends at the same time.`);e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){let e=this.rootElement;if(e!==void 0&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var t;(t=this.window)==null||t.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(e,t,n){return this.sourcePreviewNodeOptions.set(e,n),this.sourcePreviewNodes.set(e,t),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,t,n){this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,n);let r=t=>this.handleDragStart(t,e),i=e=>this.handleSelectStart(e);return t.setAttribute(`draggable`,`true`),t.addEventListener(`dragstart`,r),t.addEventListener(`selectstart`,i),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),t.removeEventListener(`dragstart`,r),t.removeEventListener(`selectstart`,i),t.setAttribute(`draggable`,`false`)}}connectDropTarget(e,t){let n=t=>this.handleDragEnter(t,e),r=t=>this.handleDragOver(t,e),i=t=>this.handleDrop(t,e);return t.addEventListener(`dragenter`,n),t.addEventListener(`dragover`,r),t.addEventListener(`drop`,i),()=>{t.removeEventListener(`dragenter`,n),t.removeEventListener(`dragover`,r),t.removeEventListener(`drop`,i)}}addEventListeners(e){e.addEventListener&&(e.addEventListener(`dragstart`,this.handleTopDragStart),e.addEventListener(`dragstart`,this.handleTopDragStartCapture,!0),e.addEventListener(`dragend`,this.handleTopDragEndCapture,!0),e.addEventListener(`dragenter`,this.handleTopDragEnter),e.addEventListener(`dragenter`,this.handleTopDragEnterCapture,!0),e.addEventListener(`dragleave`,this.handleTopDragLeaveCapture,!0),e.addEventListener(`dragover`,this.handleTopDragOver),e.addEventListener(`dragover`,this.handleTopDragOverCapture,!0),e.addEventListener(`drop`,this.handleTopDrop),e.addEventListener(`drop`,this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener(`dragstart`,this.handleTopDragStart),e.removeEventListener(`dragstart`,this.handleTopDragStartCapture,!0),e.removeEventListener(`dragend`,this.handleTopDragEndCapture,!0),e.removeEventListener(`dragenter`,this.handleTopDragEnter),e.removeEventListener(`dragenter`,this.handleTopDragEnterCapture,!0),e.removeEventListener(`dragleave`,this.handleTopDragLeaveCapture,!0),e.removeEventListener(`dragover`,this.handleTopDragOver),e.removeEventListener(`dragover`,this.handleTopDragOverCapture,!0),e.removeEventListener(`drop`,this.handleTopDrop),e.removeEventListener(`drop`,this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){let e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return pr({dropEffect:this.altKeyPressed?`copy`:`move`},t||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?`copy`:this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){let e=this.monitor.getSourceId();return pr({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}isDraggingNativeItem(){let e=this.monitor.getItemType();return Object.keys(Jn).some(t=>Jn[t]===e)}beginDragNativeItem(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=tr(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.mouseMoveTimeoutTimer=setTimeout(()=>this.rootElement?.addEventListener(`mousemove`,this.endDragIfSourceWasRemovedFromDOM,!0),1e3)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var e;(e=this.window)==null||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener(`mousemove`,this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,t){e.defaultPrevented||(this.dragStartSourceIds||=[],this.dragStartSourceIds.unshift(t))}handleDragEnter(e,t){this.dragEnterTargetIds.unshift(t)}handleDragOver(e,t){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}handleDrop(e,t){this.dropTargetIds.unshift(t)}constructor(e,t,n){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=e=>{let t=this.sourceNodes.get(e);return t&&sr(t)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=e=>!!(e&&this.document&&this.document.body&&this.document.body.contains(e)),this.endDragIfSourceWasRemovedFromDOM=()=>{let e=this.currentDragSourceNode;e==null||this.isNodeInDocument(e)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=e=>{this.hoverRafId===null&&typeof requestAnimationFrame<`u`&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(e||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<`u`&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=e=>{if(e.defaultPrevented)return;let{dragStartSourceIds:t}=this;this.dragStartSourceIds=null;let n=P(e);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(t||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:n});let{dataTransfer:r}=e,i=nr(r);if(this.monitor.isDragging()){if(r&&typeof r.setDragImage==`function`){let e=this.monitor.getSourceId(),t=this.sourceNodes.get(e),i=this.sourcePreviewNodes.get(e)||t;if(i){let{anchorX:e,anchorY:a,offsetX:o,offsetY:s}=this.getCurrentSourcePreviewNodeOptions(),c=ur(t,i,n,{anchorX:e,anchorY:a},{offsetX:o,offsetY:s});r.setDragImage(i,c.x,c.y)}}try{r?.setData(`application/json`,{})}catch{}this.setCurrentDragSourceNode(e.target);let{captureDraggingState:t}=this.getCurrentSourcePreviewNodeOptions();t?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(i)this.beginDragNativeItem(i);else if(r&&!r.types&&(e.target&&!e.target.hasAttribute||!e.target.hasAttribute(`draggable`)))return;else e.preventDefault()},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=e=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var t;(t=this.currentNativeSource)==null||t.loadDataTransfer(e.dataTransfer)}if(!this.enterLeaveCounter.enter(e.target)||this.monitor.isDragging())return;let{dataTransfer:n}=e,r=nr(n);r&&this.beginDragNativeItem(r,n)},this.handleTopDragEnter=e=>{let{dragEnterTargetIds:t}=this;this.dragEnterTargetIds=[],this.monitor.isDragging()&&(this.altKeyPressed=e.altKey,t.length>0&&this.actions.hover(t,{clientOffset:P(e)}),t.some(e=>this.monitor.canDropOnTarget(e))&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect())))},this.handleTopDragOverCapture=e=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var t;(t=this.currentNativeSource)==null||t.loadDataTransfer(e.dataTransfer)}},this.handleTopDragOver=e=>{let{dragOverTargetIds:t}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`none`);return}this.altKeyPressed=e.altKey,this.lastClientOffset=P(e),this.scheduleHover(t),(t||[]).some(e=>this.monitor.canDropOnTarget(e))?(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?e.preventDefault():(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`none`))},this.handleTopDragLeaveCapture=e=>{this.isDraggingNativeItem()&&e.preventDefault(),this.enterLeaveCounter.leave(e.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=e=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var t;e.preventDefault(),(t=this.currentNativeSource)==null||t.loadDataTransfer(e.dataTransfer)}else nr(e.dataTransfer)&&e.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=e=>{let{dropTargetIds:t}=this;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:P(e)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=e=>{let t=e.target;typeof t.dragDrop==`function`&&(t.tagName===`INPUT`||t.tagName===`SELECT`||t.tagName===`TEXTAREA`||t.isContentEditable||(e.preventDefault(),t.dragDrop()))},this.options=new dr(t,n),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new Kn(this.isNodeInDocument)}},F;function hr(){return F||(F=new Image,F.src=`data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==`),F}var gr=function(e,t,n){return new mr(e,t,n)},_r=(0,w.createContext)(null);function I(){let e=(0,w.useContext)(_r);if(e===null)throw Error(`No Tree Api Provided`);return e}var vr=(0,w.createContext)(null);function yr(){let e=(0,w.useContext)(vr);if(e===null)throw Error(`Provide a NodesContext`);return e}var br=(0,w.createContext)(null);function xr(){let e=(0,w.useContext)(br);if(e===null)throw Error(`Provide a DnDContext`);return e}var Sr=(0,w.createContext)(0);function Cr(){(0,w.useContext)(Sr)}var wr=t({access:()=>z,bound:()=>L,dfs:()=>jr,focusNextElement:()=>Mr,focusPrevElement:()=>Nr,getInsertIndex:()=>Br,getInsertParentId:()=>Ur,getTreeLinePrefix:()=>Hr,indexOf:()=>kr,isClosed:()=>Er,isDescendant:()=>Or,isItem:()=>Tr,isOpenWithEmptyChildren:()=>Dr,mergeRefs:()=>Lr,noop:()=>Ar,safeRun:()=>Rr,waitFor:()=>zr,walk:()=>R});function L(e,t,n){return Math.max(Math.min(e,n),t)}function Tr(e){return e&&e.isLeaf}function Er(e){return e&&e.isInternal&&!e.isOpen}function Dr(e){return e&&e.isOpen&&!e.children?.length}var Or=(e,t)=>{let n=e;for(;n;){if(n.id===t.id)return!0;n=n.parent}return!1},kr=e=>{if(!e.parent)throw Error(`Node does not have a parent`);return e.parent.children.findIndex(t=>t.id===e.id)};function Ar(){}function jr(e,t){if(!e)return null;if(e.id===t)return e;if(e.children)for(let n of e.children){let e=jr(n,t);if(e)return e}return null}function R(e,t){if(t(e),e.children)for(let n of e.children)R(n,t)}function Mr(e){let t=Ir(e),n;for(let r=0;r<t.length;++r)if(t[r]===e){n=Pr(t,r);break}n?.focus()}function Nr(e){let t=Ir(e),n;for(let r=0;r<t.length;++r)if(t[r]===e){n=Fr(t,r);break}n?.focus()}function Pr(e,t){return t+1<e.length?e[t+1]:e[0]}function Fr(e,t){return t-1>=0?e[t-1]:e[e.length-1]}function Ir(e){return Array.from(document.querySelectorAll(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), details:not([disabled]), summary:not(:disabled)`)).filter(t=>t===e||!e.contains(t))}function z(e,t){return typeof t==`boolean`?t:typeof t==`string`?e[t]:t(e)}function Lr(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}function Rr(e,...t){if(e)return e(...t)}function zr(e){return new Promise((t,n)=>{let r=0;function i(){r+=1,r===100&&n(),e()?t():setTimeout(i,10)}i()})}function Br(e){let t=e.focusedNode;return t?t.isOpen?0:t.parent?t.childIndex+1:0:e.root.children?.length??0}var Vr={last:`└ `,middle:`├ `,pipe:`│ `,blank:`  `};function Hr(e,t={}){let n=Object.assign(Object.assign({},Vr),t);if(e.level===0)return``;let r=e.nextSibling===null?n.last:n.middle,i=e.parent;for(;i&&i.level>0;)r=(i.nextSibling===null?n.blank:n.pipe)+r,i=i.parent;return r}function Ur(e){let t=e.focusedNode;return t?t.isOpen?t.id:t.parent&&!t.parent.isRoot?t.parent.id:null:null}var Wr={display:`flex`,alignItems:`center`,zIndex:1},Gr={flex:1,height:`2px`,background:`#4B91E2`,borderRadius:`1px`},Kr={width:`4px`,height:`4px`,boxShadow:`0 0 0 3px #4B91E2`,borderRadius:`50%`},qr=w.memo(function({top:e,left:t,indent:n}){let r={position:`absolute`,pointerEvents:`none`,top:e-2+`px`,left:t+`px`,right:n+`px`};return(0,C.jsxs)(`div`,{style:Object.assign(Object.assign({},Wr),r),children:[(0,C.jsx)(`div`,{style:Object.assign({},Kr)}),(0,C.jsx)(`div`,{style:Object.assign({},Gr)})]})});function Jr({node:e,attrs:t,innerRef:n,children:r}){return(0,C.jsx)(`div`,Object.assign({},t,{ref:n,onFocus:e=>e.stopPropagation(),onClick:e.handleClick,children:r}))}function Yr(e){return(0,C.jsxs)(`div`,{ref:e.dragHandle,style:e.style,children:[(0,C.jsx)(`span`,{onClick:t=>{t.stopPropagation(),e.node.toggle()},children:e.node.isLeaf?`🌳`:e.node.isOpen?`🗁`:`🗀`}),` `,e.node.isEditing?(0,C.jsx)(Zr,Object.assign({},e)):(0,C.jsx)(Xr,Object.assign({},e))]})}function Xr(e){return(0,C.jsx)(C.Fragment,{children:(0,C.jsx)(`span`,{children:e.node.data.name})})}function Zr({node:e}){let t=(0,w.useRef)();return(0,w.useEffect)(()=>{var e,n;(e=t.current)==null||e.focus(),(n=t.current)==null||n.select()},[]),(0,C.jsx)(`input`,{ref:t,defaultValue:e.data.name,onBlur:()=>e.reset(),onKeyDown:n=>{n.key===`Escape`&&e.reset(),n.key===`Enter`&&e.submit(t.current?.value||``)}})}var Qr=`__REACT_ARBORIST_INTERNAL_ROOT__`;function $r(e){function t(n,r,i){let a=new ei({tree:e,data:n,level:r,parent:i,id:e.accessId(n),children:null,isDraggable:e.isDraggable(n),rowIndex:null}),o=e.accessChildren(n);return o&&(a.children=o.map(e=>t(e,r+1,a))),a}let n=new ei({tree:e,id:Qr,data:{id:Qr},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null});return n.children=(e.props.data??[]).map(e=>t(e,0,n)),n}var ei=class e{constructor(e){this.handleClick=e=>{(e.metaKey||e.ctrlKey)&&!this.tree.props.disableMultiSelection?this.isSelected?this.deselect():this.selectMulti():e.shiftKey&&!this.tree.props.disableMultiSelection?this.selectContiguous():(this.select(),this.activate())},this.tree=e.tree,this.id=e.id,this.data=e.data,this.level=e.level,this.children=e.children,this.parent=e.parent,this.isDraggable=e.isDraggable,this.rowIndex=e.rowIndex,this.select=this.select.bind(this),this.deselect=this.deselect.bind(this),this.selectMulti=this.selectMulti.bind(this),this.selectContiguous=this.selectContiguous.bind(this),this.activate=this.activate.bind(this),this.focus=this.focus.bind(this),this.toggle=this.toggle.bind(this),this.open=this.open.bind(this),this.openParents=this.openParents.bind(this),this.close=this.close.bind(this),this.submit=this.submit.bind(this),this.reset=this.reset.bind(this),this.edit=this.edit.bind(this)}get isRoot(){return this.id===Qr}get isLeaf(){return!Array.isArray(this.children)}get isInternal(){return!this.isLeaf}get isOpen(){return!this.isLeaf&&this.tree.isOpen(this.id)}get isClosed(){return!this.isLeaf&&!this.tree.isOpen(this.id)}get isEditable(){return this.tree.isEditable(this.data)}get isSelectable(){return this.tree.isSelectable(this.data)}get isEditing(){return this.tree.editingId===this.id}get isSelected(){return this.tree.isSelected(this.id)}get isOnlySelection(){return this.isSelected&&this.tree.hasOneSelection}get isSelectedStart(){return this.isSelected&&!this.prev?.isSelected}get isSelectedEnd(){return this.isSelected&&!this.next?.isSelected}get isFocused(){return this.tree.isFocused(this.id)}get isDragging(){return this.tree.isDragging(this.id)}get willReceiveDrop(){return this.tree.willReceiveDrop(this.id)}get state(){return{isClosed:this.isClosed,isDragging:this.isDragging,isEditing:this.isEditing,isFocused:this.isFocused,isInternal:this.isInternal,isLeaf:this.isLeaf,isOpen:this.isOpen,isSelected:this.isSelected,isSelectedEnd:this.isSelectedEnd,isSelectedStart:this.isSelectedStart,willReceiveDrop:this.willReceiveDrop}}get childIndex(){return this.parent&&this.parent.children?this.parent.children.findIndex(e=>e.id===this.id):-1}get next(){return this.rowIndex===null?null:this.tree.at(this.rowIndex+1)}get prev(){return this.rowIndex===null?null:this.tree.at(this.rowIndex-1)}get nextSibling(){let e=this.childIndex;return this.parent?.children[e+1]??null}isAncestorOf(e){if(!e)return!1;let t=e;for(;t;){if(t.id===this.id)return!0;t=t.parent}return!1}select(){this.tree.select(this)}deselect(){this.tree.deselect(this)}selectMulti(){this.tree.selectMulti(this)}selectContiguous(){this.tree.selectContiguous(this)}activate(){this.tree.activate(this)}focus(){this.tree.focus(this)}toggle(){this.tree.toggle(this)}open(){this.tree.open(this)}openParents(){this.tree.openParents(this)}close(){this.tree.close(this)}submit(e){this.tree.submit(this,e)}reset(){this.tree.reset()}clone(){return new e(Object.assign({},this))}edit(){return this.tree.edit(this)}};function ti(e){return{type:`EDIT`,id:e}}function ni(e={id:null},t){return t.type===`EDIT`?Object.assign(Object.assign({},e),{id:t.id}):e}function B(e){return{type:`FOCUS`,id:e}}function ri(){return{type:`TREE_BLUR`}}function ii(e={id:null,treeFocused:!1},t){return t.type===`FOCUS`?Object.assign(Object.assign({},e),{id:t.id,treeFocused:!0}):t.type===`TREE_BLUR`?Object.assign(Object.assign({},e),{treeFocused:!1}):e}var ai={open(e,t){return{type:`VISIBILITY_OPEN`,id:e,filtered:t}},close(e,t){return{type:`VISIBILITY_CLOSE`,id:e,filtered:t}},toggle(e,t){return{type:`VISIBILITY_TOGGLE`,id:e,filtered:t}},clear(e){return{type:`VISIBILITY_CLEAR`,filtered:e}}};function oi(e={},t){if(t.type===`VISIBILITY_OPEN`)return Object.assign(Object.assign({},e),{[t.id]:!0});if(t.type===`VISIBILITY_CLOSE`)return Object.assign(Object.assign({},e),{[t.id]:!1});if(t.type===`VISIBILITY_TOGGLE`){let n=e[t.id];return Object.assign(Object.assign({},e),{[t.id]:!n})}return t.type===`VISIBILITY_CLEAR`?{}:e}function si(e={filtered:{},unfiltered:{}},t){return t.type.startsWith(`VISIBILITY`)?t.filtered?Object.assign(Object.assign({},e),{filtered:oi(e.filtered,t)}):Object.assign(Object.assign({},e),{unfiltered:oi(e.unfiltered,t)}):e}var V=e=>({nodes:{open:{filtered:{},unfiltered:e?.initialOpenState??{}},focus:{id:null,treeFocused:!1},edit:{id:null},drag:{id:null,selectedIds:[],destinationParentId:null,destinationIndex:null},selection:{ids:new Set,anchor:null,mostRecent:null}},dnd:{cursor:{type:`none`},dragId:null,dragIds:[],parentId:null,index:-1}}),H={clear:()=>({type:`SELECTION_CLEAR`}),only:e=>({type:`SELECTION_ONLY`,id:e}),add:e=>({type:`SELECTION_ADD`,ids:Array.isArray(e)?e:[e]}),remove:e=>({type:`SELECTION_REMOVE`,ids:Array.isArray(e)?e:[e]}),set:e=>Object.assign({type:`SELECTION_SET`},e),mostRecent:e=>({type:`SELECTION_MOST_RECENT`,id:e}),anchor:e=>({type:`SELECTION_ANCHOR`,id:e})};function ci(e=V().nodes.selection,t){let n=e.ids;switch(t.type){case`SELECTION_CLEAR`:return Object.assign(Object.assign({},e),{ids:new Set});case`SELECTION_ONLY`:return Object.assign(Object.assign({},e),{ids:new Set([t.id])});case`SELECTION_ADD`:return t.ids.length===0?e:(t.ids.forEach(e=>n.add(e)),Object.assign(Object.assign({},e),{ids:new Set(n)}));case`SELECTION_REMOVE`:return t.ids.length===0?e:(t.ids.forEach(e=>n.delete(e)),Object.assign(Object.assign({},e),{ids:new Set(n)}));case`SELECTION_SET`:return Object.assign(Object.assign({},e),{ids:t.ids,mostRecent:t.mostRecent,anchor:t.anchor});case`SELECTION_MOST_RECENT`:return Object.assign(Object.assign({},e),{mostRecent:t.id});case`SELECTION_ANCHOR`:return Object.assign(Object.assign({},e),{anchor:t.id});default:return e}}var U={cursor(e){return{type:`DND_CURSOR`,cursor:e}},dragStart(e,t){return{type:`DND_DRAG_START`,id:e,dragIds:t}},dragEnd(){return{type:`DND_DRAG_END`}},hovering(e,t){return{type:`DND_HOVERING`,parentId:e,index:t}},setDestination(e,t){return{type:`DND_DESTINATION`,parentId:e,index:t}}};function li(e=V().dnd,t){switch(t.type){case`DND_CURSOR`:return Object.assign(Object.assign({},e),{cursor:t.cursor});case`DND_DRAG_START`:return Object.assign(Object.assign({},e),{dragId:t.id,dragIds:t.dragIds});case`DND_DRAG_END`:return V().dnd;case`DND_HOVERING`:return Object.assign(Object.assign({},e),{parentId:t.parentId,index:t.index});default:return e}}var ui={position:`fixed`,pointerEvents:`none`,zIndex:100,left:0,top:0,width:`100%`,height:`100%`},di=e=>{if(!e)return{display:`none`};let{x:t,y:n}=e;return{transform:`translate(${t}px, ${n}px)`}},fi=e=>{if(!e)return{display:`none`};let{x:t,y:n}=e;return{transform:`translate(${t+10}px, ${n+10}px)`}};function pi({offset:e,mouse:t,id:n,dragIds:r,isDragging:i}){return(0,C.jsxs)(mi,{isDragging:i,children:[(0,C.jsx)(hi,{offset:e,children:(0,C.jsx)(_i,{id:n,dragIds:r})}),(0,C.jsx)(gi,{mouse:t,count:r.length})]})}var mi=(0,w.memo)(function(e){return e.isDragging?(0,C.jsx)(`div`,{style:ui,children:e.children}):null});function hi(e){return(0,C.jsx)(`div`,{className:`row preview`,style:di(e.offset),children:e.children})}function gi(e){let{count:t,mouse:n}=e;return t>1?(0,C.jsx)(`div`,{className:`selected-count`,style:fi(n),children:t}):null}var _i=(0,w.memo)(function(e){let t=I(),n=t.get(e.id);return n?(0,C.jsx)(t.renderNode,{preview:!0,node:n,style:{paddingLeft:n.level*t.indent,opacity:.2,background:`transparent`},tree:t}):null});function vi(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function yi(e,t){return yi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},yi(e,t)}function bi(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,yi(e,t)}var xi=Number.isNaN||function(e){return typeof e==`number`&&e!==e};function Si(e,t){return!!(e===t||xi(e)&&xi(t))}function Ci(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Si(e[n],t[n]))return!1;return!0}function wi(e,t){t===void 0&&(t=Ci);var n,r=[],i,a=!1;function o(){var o=[...arguments];return a&&n===this&&t(o,r)?i:(i=e.apply(this,o),a=!0,n=this,r=o,i)}return o}var Ti=typeof performance==`object`&&typeof performance.now==`function`?function(){return performance.now()}:function(){return Date.now()};function Ei(e){cancelAnimationFrame(e.id)}function Di(e,t){var n=Ti();function r(){Ti()-n>=t?e.call(null):i.id=requestAnimationFrame(r)}var i={id:requestAnimationFrame(r)};return i}var Oi=-1;function ki(e){if(e===void 0&&(e=!1),Oi===-1||e){var t=document.createElement(`div`),n=t.style;n.width=`50px`,n.height=`50px`,n.overflow=`scroll`,document.body.appendChild(t),Oi=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Oi}var W=null;function Ai(e){if(e===void 0&&(e=!1),W===null||e){var t=document.createElement(`div`),n=t.style;n.width=`50px`,n.height=`50px`,n.overflow=`scroll`,n.direction=`rtl`;var r=document.createElement(`div`),i=r.style;return i.width=`100px`,i.height=`100px`,t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?W=`positive-descending`:(t.scrollLeft=1,W=t.scrollLeft===0?`negative`:`positive-ascending`),document.body.removeChild(t),W}return W}var ji=150,Mi=function(e,t){return e};function Ni(e){var t,n=e.getItemOffset,r=e.getEstimatedTotalSize,i=e.getItemSize,a=e.getOffsetForIndexAndAlignment,o=e.getStartIndexForOffset,s=e.getStopIndexForStartIndex,c=e.initInstanceProps,l=e.shouldResetStyleCacheOnItemSizeChange,u=e.validateProps;return t=function(e){bi(t,e);function t(t){var r=e.call(this,t)||this;return r._instanceProps=c(r.props,vi(r)),r._outerRef=void 0,r._resetIsScrollingTimeoutId=null,r.state={instance:vi(r),isScrolling:!1,scrollDirection:`forward`,scrollOffset:typeof r.props.initialScrollOffset==`number`?r.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},r._callOnItemsRendered=void 0,r._callOnItemsRendered=wi(function(e,t,n,i){return r.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:i})}),r._callOnScroll=void 0,r._callOnScroll=wi(function(e,t,n){return r.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n})}),r._getItemStyle=void 0,r._getItemStyle=function(e){var t=r.props,a=t.direction,o=t.itemSize,s=t.layout,c=r._getItemStyleCache(l&&o,l&&s,l&&a),u;if(c.hasOwnProperty(e))u=c[e];else{var d=n(r.props,e,r._instanceProps),f=i(r.props,e,r._instanceProps),p=a===`horizontal`||s===`horizontal`,m=a===`rtl`,h=p?d:0;c[e]=u={position:`absolute`,left:m?void 0:h,right:m?h:void 0,top:p?0:d,height:p?`100%`:f,width:p?f:`100%`}}return u},r._getItemStyleCache=void 0,r._getItemStyleCache=wi(function(e,t,n){return{}}),r._onScrollHorizontal=function(e){var t=e.currentTarget,n=t.clientWidth,i=t.scrollLeft,a=t.scrollWidth;r.setState(function(e){if(e.scrollOffset===i)return null;var t=r.props.direction,o=i;if(t===`rtl`)switch(Ai()){case`negative`:o=-i;break;case`positive-descending`:o=a-n-i}return o=Math.max(0,Math.min(o,a-n)),{isScrolling:!0,scrollDirection:e.scrollOffset<o?`forward`:`backward`,scrollOffset:o,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._onScrollVertical=function(e){var t=e.currentTarget,n=t.clientHeight,i=t.scrollHeight,a=t.scrollTop;r.setState(function(e){if(e.scrollOffset===a)return null;var t=Math.max(0,Math.min(a,i-n));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?`forward`:`backward`,scrollOffset:t,scrollUpdateWasRequested:!1}},r._resetIsScrollingDebounced)},r._outerRefSetter=function(e){var t=r.props.outerRef;r._outerRef=e,typeof t==`function`?t(e):typeof t==`object`&&t&&t.hasOwnProperty(`current`)&&(t.current=e)},r._resetIsScrollingDebounced=function(){r._resetIsScrollingTimeoutId!==null&&Ei(r._resetIsScrollingTimeoutId),r._resetIsScrollingTimeoutId=Di(r._resetIsScrolling,ji)},r._resetIsScrolling=function(){r._resetIsScrollingTimeoutId=null,r.setState({isScrolling:!1},function(){r._getItemStyleCache(-1,null)})},r}t.getDerivedStateFromProps=function(e,t){return Pi(e,t),u(e),null};var d=t.prototype;return d.scrollTo=function(e){e=Math.max(0,e),this.setState(function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?`forward`:`backward`,scrollOffset:e,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},d.scrollToItem=function(e,t){t===void 0&&(t=`auto`);var n=this.props,r=n.itemCount,i=n.layout,o=this.state.scrollOffset;e=Math.max(0,Math.min(e,r-1));var s=0;if(this._outerRef){var c=this._outerRef;s=i===`vertical`?c.scrollWidth>c.clientWidth?ki():0:c.scrollHeight>c.clientHeight?ki():0}this.scrollTo(a(this.props,e,t,o,this._instanceProps,s))},d.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if(typeof n==`number`&&this._outerRef!=null){var i=this._outerRef;t===`horizontal`||r===`horizontal`?i.scrollLeft=n:i.scrollTop=n}this._callPropsCallbacks()},d.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,i=r.scrollOffset;if(r.scrollUpdateWasRequested&&this._outerRef!=null){var a=this._outerRef;if(t===`horizontal`||n===`horizontal`){if(t===`rtl`)switch(Ai()){case`negative`:a.scrollLeft=-i;break;case`positive-ascending`:a.scrollLeft=i;break;default:var o=a.clientWidth;a.scrollLeft=a.scrollWidth-o-i}else a.scrollLeft=i}else a.scrollTop=i}this._callPropsCallbacks()},d.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&Ei(this._resetIsScrollingTimeoutId)},d.render=function(){var e=this.props,t=e.children,n=e.className,i=e.direction,a=e.height,o=e.innerRef,s=e.innerElementType,c=e.innerTagName,l=e.itemCount,u=e.itemData,d=e.itemKey,f=d===void 0?Mi:d,p=e.layout,m=e.outerElementType,h=e.outerTagName,g=e.style,_=e.useIsScrolling,ee=e.width,v=this.state.isScrolling,y=i===`horizontal`||p===`horizontal`,te=y?this._onScrollHorizontal:this._onScrollVertical,ne=this._getRangeToRender(),b=ne[0],re=ne[1],ie=[];if(l>0)for(var x=b;x<=re;x++)ie.push((0,w.createElement)(t,{data:u,key:f(x,u),index:x,isScrolling:_?v:void 0,style:this._getItemStyle(x)}));var S=r(this.props,this._instanceProps);return(0,w.createElement)(m||h||`div`,{className:n,onScroll:te,ref:this._outerRefSetter,style:ae({position:`relative`,height:a,width:ee,overflow:`auto`,WebkitOverflowScrolling:`touch`,willChange:`transform`,direction:i},g)},(0,w.createElement)(s||c||`div`,{children:ie,ref:o,style:{height:y?`100%`:S,pointerEvents:v?`none`:void 0,width:y?S:`100%`}}))},d._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered==`function`&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],i=e[3];this._callOnItemsRendered(t,n,r,i)}if(typeof this.props.onScroll==`function`){var a=this.state,o=a.scrollDirection,s=a.scrollOffset,c=a.scrollUpdateWasRequested;this._callOnScroll(o,s,c)}},d._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,i=r.isScrolling,a=r.scrollDirection,c=r.scrollOffset;if(t===0)return[0,0,0,0];var l=o(this.props,c,this._instanceProps),u=s(this.props,l,c,this._instanceProps),d=!i||a===`backward`?Math.max(1,n):1,f=!i||a===`forward`?Math.max(1,n):1;return[Math.max(0,l-d),Math.max(0,Math.min(t-1,u+f)),l,u]},t}(w.PureComponent),t.defaultProps={direction:`ltr`,itemData:void 0,layout:`vertical`,overscanCount:2,useIsScrolling:!1},t}var Pi=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},Fi=50,G=function(e,t,n){var r=e.itemSize,i=n.itemMetadataMap,a=n.lastMeasuredIndex;if(t>a){var o=0;if(a>=0){var s=i[a];o=s.offset+s.size}for(var c=a+1;c<=t;c++){var l=r(c);i[c]={offset:o,size:l},o+=l}n.lastMeasuredIndex=t}return i[t]},Ii=function(e,t,n){var r=t.itemMetadataMap,i=t.lastMeasuredIndex;return(i>0?r[i].offset:0)>=n?Li(e,t,i,0,n):Ri(e,t,Math.max(0,i),n)},Li=function(e,t,n,r,i){for(;r<=n;){var a=r+Math.floor((n-r)/2),o=G(e,a,t).offset;if(o===i)return a;o<i?r=a+1:o>i&&(n=a-1)}return r>0?r-1:0},Ri=function(e,t,n,r){for(var i=e.itemCount,a=1;n<i&&G(e,n,t).offset<r;)n+=a,a*=2;return Li(e,t,Math.min(n,i-1),Math.floor(n/2),r)},zi=function(e,t){var n=e.itemCount,r=t.itemMetadataMap,i=t.estimatedItemSize,a=t.lastMeasuredIndex,o=0;if(a>=n&&(a=n-1),a>=0){var s=r[a];o=s.offset+s.size}var c=(n-a-1)*i;return o+c},Bi=Ni({getItemOffset:function(e,t,n){return G(e,t,n).offset},getItemSize:function(e,t,n){return n.itemMetadataMap[t].size},getEstimatedTotalSize:zi,getOffsetForIndexAndAlignment:function(e,t,n,r,i,a){var o=e.direction,s=e.height,c=e.layout,l=e.width,u=o===`horizontal`||c===`horizontal`?l:s,d=G(e,t,i),f=zi(e,i),p=Math.max(0,Math.min(f-u,d.offset)),m=Math.max(0,d.offset-u+d.size+a);switch(n===`smart`&&(n=r>=m-u&&r<=p+u?`auto`:`center`),n){case`start`:return p;case`end`:return m;case`center`:return Math.round(m+(p-m)/2);default:return r>=m&&r<=p?r:r<m?m:p}},getStartIndexForOffset:function(e,t,n){return Ii(e,n,t)},getStopIndexForStartIndex:function(e,t,n,r){for(var i=e.direction,a=e.height,o=e.itemCount,s=e.layout,c=e.width,l=i===`horizontal`||s===`horizontal`?c:a,u=G(e,t,r),d=n+l,f=u.offset+u.size,p=t;p<o-1&&f<d;)p++,f+=G(e,p,r).size;return p},initInstanceProps:function(e,t){var n={itemMetadataMap:{},estimatedItemSize:e.estimatedItemSize||Fi,lastMeasuredIndex:-1};return t.resetAfterIndex=function(e,r){r===void 0&&(r=!0),n.lastMeasuredIndex=Math.min(n.lastMeasuredIndex,e-1),t._getItemStyleCache(-1),r&&t.forceUpdate()},n},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(e){e.itemSize}}),Vi=Ni({getItemOffset:function(e,t){return t*e.itemSize},getItemSize:function(e,t){return e.itemSize},getEstimatedTotalSize:function(e){var t=e.itemCount;return e.itemSize*t},getOffsetForIndexAndAlignment:function(e,t,n,r,i,a){var o=e.direction,s=e.height,c=e.itemCount,l=e.itemSize,u=e.layout,d=e.width,f=o===`horizontal`||u===`horizontal`?d:s,p=Math.max(0,c*l-f),m=Math.min(p,t*l),h=Math.max(0,t*l-f+l+a);switch(n===`smart`&&(n=r>=h-f&&r<=m+f?`auto`:`center`),n){case`start`:return m;case`end`:return h;case`center`:var g=Math.round(h+(m-h)/2);return g<Math.ceil(f/2)?0:g>p+Math.floor(f/2)?p:g;default:return r>=h&&r<=m?r:r<h?h:m}},getStartIndexForOffset:function(e,t){var n=e.itemCount,r=e.itemSize;return Math.max(0,Math.min(n-1,Math.floor(t/r)))},getStopIndexForStartIndex:function(e,t,n){var r=e.direction,i=e.height,a=e.itemCount,o=e.itemSize,s=e.layout,c=e.width,l=r===`horizontal`||s===`horizontal`,u=t*o,d=Math.ceil(((l?c:i)+n-u)/o);return Math.max(0,Math.min(a-1,t+d-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){e.itemSize}});function Hi(){let e=I(),t=xr().cursor;if(!t||t.type!==`line`)return null;let n=e.indent,r=e.rowTopPosition(t.index)+(e.props.padding??e.props.paddingTop??0),i=n*t.level,a=e.renderCursor;return(0,C.jsx)(a,{top:r,left:i,indent:n})}var Ui=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},Wi=(0,w.forwardRef)(function(e,t){let{children:n}=e,r=Ui(e,[`children`]),i=I();return(0,C.jsxs)(`div`,Object.assign({ref:t},r,{onClick:e=>{i.props.disableDeselectOnClick||e.currentTarget===e.target&&i.deselectAll()},children:[(0,C.jsx)(Gi,{}),n]}))}),Gi=()=>{let e=I();return(0,C.jsx)(`div`,{style:{height:e.rowTopPosition(e.visibleNodes.length),width:`100%`,position:`absolute`,left:`0`,right:`0`},children:(0,C.jsx)(Hi,{})})},Ki=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},qi=(0,w.forwardRef)(function(e,t){var{style:n}=e,r=Ki(e,[`style`]);let i=I(),a=i.props.padding??i.props.paddingTop??0,o=i.props.padding??i.props.paddingBottom??0;return(0,C.jsx)(`div`,Object.assign({ref:t,style:Object.assign(Object.assign({},n),{height:`${parseFloat(n.height)+a+o}px`})},r))});function Ji(e,t){return typeof e==`function`?e(t):e??`NODE`}function Yi(e){return e.isDraggable&&!e.isEditing}function Xi(e){let t=I(),n=t.selectedIds,[r,i,a]=Mn(()=>({canDrag:()=>Yi(e),type:Ji(t.props.dragType,e),item:()=>{let r=t.isSelected(e.id)?Array.from(n):[e.id];return t.dispatch(U.dragStart(e.id,r)),{id:e.id,dragIds:r,data:e.data}},end:()=>{t.hideCursor(),t.redrawList(),t.dispatch(U.dragEnd())}}),[n,e,t.props.dragType]);return(0,w.useEffect)(()=>{a(hr())},[a]),i}function Zi(e,t){let n=e.getBoundingClientRect(),r=t.x-Math.round(n.x),i=t.y-Math.round(n.y),a=n.height,o=i<a/2,s=!o,c=a/4,l=i>c&&i<a-c;return{x:r,inTopHalf:o,inBottomHalf:s,inMiddle:l,atTop:!l&&o,atBottom:!l&&s}}function Qi(e,t,n,r){return e?e.isInternal?r.atTop?[t,e]:r.inMiddle?[e,e]:[e,n]:r.inTopHalf?[t,e]:[e,n]:[t,null]}function $i(e,t){return{parentId:e||null,index:t}}function K(e,t){return{type:`line`,index:e,level:t}}function ea(e){return{type:`highlight`,id:e}}function ta(e,t){let n=e;for(;n.parent&&n.level>t;)n=n.parent;return{parentId:n.parent?.id||null,index:kr(n)+1}}function na(e){let t=Zi(e.element,e.offset),n=e.indent,r=Math.round(Math.max(0,t.x-n)/n),{node:i,nextNode:a,prevNode:o}=e,[s,c]=Qi(i,o,a,t);if(i&&i.isInternal&&t.inMiddle)return{drop:$i(i.id,null),cursor:ea(i.id)};if(!s)return{drop:$i(c?.parent?.id,0),cursor:K(0,0)};if(Tr(s)){let e=L(r,c?.level||0,s.level);return{drop:ta(s,e),cursor:K(s.rowIndex+1,e)}}if(Er(s)){let e=L(r,c?.level||0,s.level);return{drop:ta(s,e),cursor:K(s.rowIndex+1,e)}}let l=L(r,0,s.level+1);return l>s.level?{drop:$i(s.id,0),cursor:K(s.rowIndex+1,l)}:{drop:ta(s,l),cursor:K(s.rowIndex+1,l)}}function ra(e,t){let n=I(),[r,i]=Vn(()=>({accept:`NODE`,canDrop:()=>n.canDrop(),hover:(r,i)=>{let a=i.getClientOffset();if(!e.current||!a)return;let{cursor:o,drop:s}=na({element:e.current,offset:a,indent:n.indent,node:t,prevNode:t.prev,nextNode:t.next});n.hover(s,o)},drop:(e,t)=>{if(!t.canDrop())return null;n.drop()}}),[t,e.current,n.props]);return i}function ia(e){let t=I(),n=t.at(e);if(!n)throw Error(`Could not find node for index: ${e}`);return(0,w.useMemo)(()=>{let r=n.clone();return t.visibleNodes[e]=r,r},[...Object.values(n.state),n])}var aa=w.memo(function({index:e,style:t}){Cr(),yr();let n=I(),r=ia(e),i=(0,w.useRef)(null),a=Xi(r),o=ra(i,r),s=(0,w.useCallback)(e=>{i.current=e,o(e)},[o]),c=n.indent*r.level,l=(0,w.useMemo)(()=>({paddingLeft:c}),[c]),u=(0,w.useMemo)(()=>Object.assign(Object.assign({},t),{top:parseFloat(t.top)+(n.props.padding??n.props.paddingTop??0),minWidth:`max-content`}),[t,n.props.padding,n.props.paddingTop]),d={role:`treeitem`,"aria-level":r.level+1,"aria-selected":r.isSelected,"aria-expanded":r.isOpen,style:u,tabIndex:-1,className:n.props.rowClassName};(0,w.useEffect)(()=>{var e;!r.isEditing&&r.isFocused&&((e=i.current)==null||e.focus({preventScroll:!0}))},[r.isEditing,r.isFocused,i.current]);let f=n.renderNode,p=n.renderRow;return(0,C.jsx)(p,{node:r,innerRef:s,attrs:d,children:(0,C.jsx)(f,{node:r,tree:n,style:l,dragHandle:a})})}),oa=``,sa=null;function ca(){Cr();let e=I();return(0,C.jsx)(`div`,{role:`tree`,"aria-label":e.props[`aria-label`],"aria-labelledby":e.props[`aria-labelledby`],"aria-multiselectable":!e.props.disableMultiSelection||void 0,style:{height:e.height,width:e.width,minHeight:0,minWidth:0},onContextMenu:e.props.onContextMenu,onClick:e.props.onClick,tabIndex:0,onFocus:t=>{t.currentTarget.contains(t.relatedTarget)||e.onFocus()},onBlur:t=>{t.currentTarget.contains(t.relatedTarget)||e.onBlur()},onKeyDown:t=>{if(e.isEditing)return;let n=t.target;if(n instanceof Element&&n!==t.currentTarget&&n.closest(`input, textarea, select, [contenteditable]:not([contenteditable='false'])`))return;if(t.key===`Backspace`){if(!e.props.onDelete)return;let t=Array.from(e.selectedIds);if(t.length>1){let n=e.mostRecentNode;for(;n&&n.isSelected;)n=n.nextSibling;n||=e.lastNode,e.focus(n,{scroll:!1}),e.delete(Array.from(t))}else{let t=e.focusedNode;if(t){let n=t.nextSibling,r=t.parent;e.focus(n||r,{scroll:!1}),e.delete(t)}}return}if(t.key===`Tab`&&!t.shiftKey){t.preventDefault(),Mr(t.currentTarget);return}if(t.key===`Tab`&&t.shiftKey){t.preventDefault(),Nr(t.currentTarget);return}if(t.key===`ArrowDown`){t.preventDefault();let n=e.nextNode;if(t.metaKey){e.select(e.focusedNode),e.activate(e.focusedNode);return}if(!t.shiftKey||e.props.disableMultiSelection){e.focus(n);return}{if(!n)return;let t=e.focusedNode;t?t.isSelected?e.selectContiguous(n):e.selectMulti(n):e.focus(e.firstNode);return}}if(t.key===`ArrowUp`){t.preventDefault();let n=e.prevNode;if(!t.shiftKey||e.props.disableMultiSelection){e.focus(n);return}{if(!n)return;let t=e.focusedNode;t?t.isSelected?e.selectContiguous(n):e.selectMulti(n):e.focus(e.lastNode);return}}if(t.key===`ArrowRight`){let t=e.focusedNode;if(!t)return;t.isInternal&&t.isOpen?e.focus(e.nextNode):t.isInternal&&e.open(t.id);return}if(t.key===`ArrowLeft`){let t=e.focusedNode;if(!t||t.isRoot)return;t.isInternal&&t.isOpen?e.close(t.id):t.parent?.isRoot||e.focus(t.parent);return}if(t.key===`a`&&(t.metaKey||t.ctrlKey)&&!e.props.disableMultiSelection){t.preventDefault(),e.selectAll();return}if(t.key===`a`&&!t.metaKey&&!t.ctrlKey&&e.props.onCreate){e.createLeaf();return}if(t.key===`A`&&!t.metaKey&&!t.ctrlKey){if(!e.props.onCreate)return;e.createInternal();return}if(t.key===`Home`){t.preventDefault(),e.focus(e.firstNode);return}if(t.key===`End`){t.preventDefault(),e.focus(e.lastNode);return}if(t.key===`Enter`){let t=e.focusedNode;if(!t||!t.isEditable||!e.props.onRename)return;setTimeout(()=>{t&&e.edit(t)});return}if(t.key===` `){t.preventDefault();let n=e.focusedNode;if(!n)return;n.isLeaf?(n.select(),n.activate()):n.toggle();return}if(t.key===`*`){let t=e.focusedNode;if(!t)return;e.openSiblings(t);return}if(t.key===`PageUp`){t.preventDefault(),e.pageUp();return}t.key===`PageDown`&&(t.preventDefault(),e.pageDown()),clearTimeout(sa),oa+=t.key,sa=setTimeout(()=>{oa=``},600);let r=e.visibleNodes.find(e=>{let t=e.data.name;return typeof t==`string`&&t.toLowerCase().startsWith(oa)});r&&e.focus(r.id)},children:(0,C.jsx)(la,{})})}function la(){let e=I(),t={className:e.props.className,outerRef:e.listEl,itemCount:e.visibleNodes.length,height:e.height,width:e.width,overscanCount:e.overscanCount,itemKey:t=>e.visibleNodes[t]?.id||t,outerElementType:e.props.outerElementType??Wi,innerElementType:e.props.innerElementType??qi,onScroll:e.props.onScroll,onItemsRendered:e.onItemsRendered.bind(e)};return typeof e.props.rowHeight==`function`?(0,C.jsx)(Bi,Object.assign({},t,{itemSize:e.rowHeightAt,ref:e.list,children:aa})):(0,C.jsx)(Vi,Object.assign({},t,{itemSize:e.rowHeight,ref:e.list,children:aa}))}function ua(e){return e.isFiltered?fa(e.root,e.isMatch.bind(e)):{list:da(e.root),matchCount:0}}function da(e){let t=[];function n(e){var r;e.level>=0&&t.push(e),e.isOpen&&((r=e.children)==null||r.forEach(n))}return n(e),t.forEach(pa),t}function fa(e,t){let n={},r=[],i=0;function a(e){if(!e.isRoot&&t(e)){i++,n[e.id]=!0;let t=e.parent;for(;t;)n[t.id]=!0,t=t.parent}if(e.children)for(let t of e.children)a(t)}function o(e){var t;e.level>=0&&n[e.id]&&r.push(e),e.isOpen&&((t=e.children)==null||t.forEach(o))}return a(e),o(e),r.forEach(pa),{list:r,matchCount:i}}function pa(e,t){e.rowIndex=t}var ma=e=>e.reduce((e,t,n)=>(e[t.id]=n,e),{}),ha=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},{safeRun:q}=wr,ga=class e{constructor(e,t,n,r){this.store=e,this.props=t,this.list=n,this.listEl=r,this.matchCount=0,this.visibleStartIndex=0,this.visibleStopIndex=0,this.rowOffsets=null,this.rowHeightAt=e=>{let t=this.props.rowHeight;if(typeof t==`function`){let n=this.at(e);return n?t(n):this.rowHeight}return t??24},this.rowTopPosition=e=>{if(typeof this.props.rowHeight!=`function`)return e*this.rowHeight;let t=this.getRowOffsets();return t[Math.max(0,Math.min(e,t.length-1))]},this.redrawList=(e=0)=>{this.rowOffsets=null;let t=this.list.current;t&&`resetAfterIndex`in t&&t.resetAfterIndex(Math.max(0,e))},this.root=$r(this);let{list:i,matchCount:a}=ua(this);this.visibleNodes=i,this.matchCount=a,this.idToIndex=ma(this.visibleNodes)}update(e){this.props=e,this.root=$r(this);let{list:t,matchCount:n}=ua(this);this.visibleNodes=t,this.matchCount=n,this.idToIndex=ma(this.visibleNodes),this.rowOffsets=null;let r=this.list.current;r&&`resetAfterIndex`in r&&r.resetAfterIndex(0,!1)}dispatch(e){return this.store.dispatch(e)}get state(){return this.store.getState()}get openState(){return this.state.nodes.open.unfiltered}get width(){return this.props.width??300}get height(){return this.props.height??500}get indent(){return this.props.indent??24}get rowHeight(){return typeof this.props.rowHeight==`number`?this.props.rowHeight:24}getRowOffsets(){if(this.rowOffsets)return this.rowOffsets;let e=[0];for(let t=0;t<this.visibleNodes.length;t++)e.push(e[t]+this.rowHeightAt(t));return this.rowOffsets=e,e}get overscanCount(){return this.props.overscanCount??1}get searchTerm(){return(this.props.searchTerm||``).trim()}get matchFn(){let e=this.props.searchMatch??((e,t)=>{let n=this.accessChildren(e.data),r=Object.values(e.data).filter(e=>n===null||e!==n);return JSON.stringify(r).toLocaleLowerCase().includes(t.toLocaleLowerCase())});return t=>e(t,this.searchTerm)}accessChildren(e){return z(e,this.props.childrenAccessor||`children`)??null}accessId(e){let t=z(e,this.props.idAccessor||`id`);if(!t)throw Error(`Data must contain an 'id' property or props.idAccessor must return a string`);return t}identify(e){return typeof e==`string`?e:e instanceof ei?e.id:z(e,this.props.idAccessor||`id`)}identifyNull(e){return e==null?null:this.identify(e)}get firstNode(){return this.visibleNodes[0]??null}get lastNode(){return this.visibleNodes[this.visibleNodes.length-1]??null}get focusedNode(){return this.get(this.state.nodes.focus.id)??null}get mostRecentNode(){return this.get(this.state.nodes.selection.mostRecent)??null}get nextNode(){let e=this.indexOf(this.focusedNode);return e===null?null:this.at(e+1)}get prevNode(){let e=this.indexOf(this.focusedNode);return e===null?null:this.at(e-1)}get(e){return e&&e in this.idToIndex&&this.visibleNodes[this.idToIndex[e]]||null}at(e){return this.visibleNodes[e]||null}nodesBetween(e,t){if(e===null||t===null)return[];let n=this.indexOf(e)??0,r=this.indexOf(t);if(r===null)return[];let i=Math.min(n,r),a=Math.max(n,r);return this.visibleNodes.slice(i,a+1)}indexOf(e){let t=this.identifyNull(e);return t?this.idToIndex[t]:null}get editingId(){return this.state.nodes.edit.id}createInternal(){return this.create({type:`internal`})}createLeaf(){return this.create({type:`leaf`})}create(){return ha(this,arguments,void 0,function*(e={}){let t=e.parentId===void 0?Ur(this):e.parentId,n=e.index??Br(this),r=e.type??`leaf`,i=yield q(this.props.onCreate,{type:r,parentId:t,index:n,parentNode:this.get(t)});i&&(this.focus(i),setTimeout(()=>{this.edit(i).then(()=>{this.select(i),this.activate(i)})}))})}delete(e){return ha(this,void 0,void 0,function*(){if(!e)return;let t=(Array.isArray(e)?e:[e]).map(e=>this.identify(e)),n=t.map(e=>this.get(e)).filter(e=>!!e),r=n.length?Math.min(...n.map(e=>e.rowIndex??0)):0;yield q(this.props.onDelete,{nodes:n,ids:t}),this.redrawList(r)})}edit(t){let n=this.identify(t);return this.resolveEdit({cancelled:!0}),this.scrollTo(n),this.dispatch(ti(n)),this.redrawList(this.get(n)?.rowIndex??0),new Promise(t=>{e.editPromise=t})}submit(e,t){return ha(this,void 0,void 0,function*(){if(!e)return;let n=this.identify(e);yield q(this.props.onRename,{id:n,name:t,node:this.get(n)}),this.dispatch(ti(null)),this.resolveEdit({cancelled:!1,value:t}),this.redrawList(this.get(n)?.rowIndex??0),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(ti(null)),this.resolveEdit({cancelled:!0}),this.redrawList(),setTimeout(()=>this.onFocus())}activate(e){let t=this.get(this.identifyNull(e));t&&q(this.props.onActivate,t)}resolveEdit(t){let n=e.editPromise;n&&n(t),e.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let e=[];for(let t of Array.from(this.selectedIds)){let n=this.get(t);n&&e.push(n)}return e}focus(e,t={}){e&&(this.props.selectionFollowsFocus?this.select(e):(this.dispatch(B(this.identify(e))),t.scroll!==!1&&this.scrollTo(e),this.focusedNode&&q(this.props.onFocus,this.focusedNode)))}pageUp(){let e=this.visibleStartIndex,t=this.visibleStopIndex-e,n=this.focusedNode?.rowIndex??0;n=n>e?e:Math.max(e-t,0),this.focus(this.at(n))}pageDown(){let e=this.visibleStartIndex,t=this.visibleStopIndex,n=t-e,r=this.focusedNode?.rowIndex??0;r=r<t?t:Math.min(r+n,this.visibleNodes.length-1),this.focus(this.at(r))}select(e,t={}){if(!e)return;let n=t.focus!==!1,r=this.identify(e);n&&this.dispatch(B(r)),this.get(r)?.isSelectable&&this.setSelection({ids:[r],anchor:r,mostRecent:r}),this.scrollTo(r,t.align),this.focusedNode&&n&&q(this.props.onFocus,this.focusedNode)}deselect(e){if(!e)return;let t=this.identify(e);this.dispatch(H.remove(t)),q(this.props.onSelect,this.selectedNodes)}selectMulti(e,t={}){let n=this.get(this.identifyNull(e));if(!n)return;let r=t.focus!==!1;r&&this.dispatch(B(n.id)),n.isSelectable&&(this.dispatch(H.add(n.id)),this.dispatch(H.anchor(n.id)),this.dispatch(H.mostRecent(n.id))),this.scrollTo(n,t.align),this.focusedNode&&r&&q(this.props.onFocus,this.focusedNode),q(this.props.onSelect,this.selectedNodes)}selectContiguous(e){if(!e)return;let t=this.identify(e);if(this.dispatch(B(t)),this.get(t)?.isSelectable){let{anchor:e,mostRecent:n}=this.state.nodes.selection,r=this.filterSelectableNodes(this.nodesBetween(e,this.identifyNull(t)));this.dispatch(H.remove(this.nodesBetween(e,n).map(e=>e.id))),this.dispatch(H.add(r.map(e=>e.id))),this.dispatch(H.mostRecent(t))}this.scrollTo(t),this.focusedNode&&q(this.props.onFocus,this.focusedNode),q(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null})}selectAll(){let e=this.filterSelectableNodes(Object.keys(this.idToIndex));this.setSelection({ids:e,anchor:e[0]??null,mostRecent:e[e.length-1]??null}),this.dispatch(B(this.lastNode?.id)),this.focusedNode&&q(this.props.onFocus,this.focusedNode)}filterSelectableNodes(e){return e.map(e=>this.get(this.identify(e))).filter(e=>!!e&&e.isSelectable)}setSelection(e){let t=new Set(e.ids?.map(e=>this.identify(e))),n=this.identifyNull(e.anchor),r=this.identifyNull(e.mostRecent);this.dispatch(H.set({ids:t,anchor:n,mostRecent:r})),q(this.props.onSelect,this.selectedNodes)}get cursorParentId(){let{cursor:e}=this.state.dnd;switch(e.type){case`highlight`:return e.id;default:return null}}get cursorOverFolder(){return this.state.dnd.cursor.type===`highlight`}get dragNodes(){return this.state.dnd.dragIds.map(e=>this.get(e)).filter(e=>!!e)}get dragNode(){return this.get(this.state.nodes.drag.id)}get dragDestinationParent(){return this.get(this.state.nodes.drag.destinationParentId)}get dragDestinationIndex(){return this.state.nodes.drag.destinationIndex}canDrop(){if(this.isFiltered)return!1;let e=this.get(this.state.dnd.parentId)??this.root,t=this.dragNodes,n=this.props.disableDrop;for(let n of t)if(!n||!e||n.isInternal&&Or(e,n))return!1;return typeof n==`function`?!n({parentNode:e,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):typeof n==`string`?!e.data[n]:typeof n!=`boolean`||!n}hover(e,t){e&&this.dispatch(U.hovering(e.parentId,e.index)),e&&this.canDrop()?(this.dispatch(U.setDestination(e.parentId,e.index)),t&&this.showCursor(t)):(this.dispatch(U.setDestination(null,null)),this.hideCursor())}drop(){let{parentId:e,index:t,dragIds:n}=this.state.dnd;q(this.props.onMove,{dragIds:n,parentId:e===`__REACT_ARBORIST_INTERNAL_ROOT__`?null:e,index:t===null?0:t,dragNodes:this.dragNodes,parentNode:this.get(e)}),this.open(e)}hideCursor(){this.dispatch(U.cursor({type:`none`}))}showCursor(e){this.dispatch(U.cursor(e))}open(e,t=!0){let n=this.identifyNull(e);n&&(this.isOpen(n)||(this.dispatch(ai.open(n,this.isFiltered)),t&&this.redrawList(this.get(n)?.rowIndex??0),q(this.props.onToggle,n)))}close(e,t=!0){let n=this.identifyNull(e);n&&this.isOpen(n)&&(this.dispatch(ai.close(n,this.isFiltered)),t&&this.redrawList(this.get(n)?.rowIndex??0),q(this.props.onToggle,n))}toggle(e){let t=this.identifyNull(e);if(t)return this.isOpen(t)?this.close(t):this.open(t)}openParents(e){let t=this.identifyNull(e);if(!t)return;let n=jr(this.root,t)?.parent;for(;n;)this.open(n.id,!1),n=n.parent;this.redrawList()}openSiblings(e){let t=e.parent;if(!t)this.toggle(e.id);else if(t.children){let n=e.isOpen;for(let e of t.children)e.isInternal&&(n?this.close(e.id,!1):this.open(e.id,!1));this.redrawList(),this.scrollTo(this.focusedNode)}}openAll(){R(this.root,e=>{e.isInternal&&this.open(e.id,!1)}),this.redrawList()}closeAll(){R(this.root,e=>{e.isInternal&&this.close(e.id,!1)}),this.redrawList()}scrollTo(e,t=`smart`){if(!e)return;let n=this.identify(e);return this.openParents(n),zr(()=>n in this.idToIndex).then(()=>{var e;let r=this.idToIndex[n];r!==void 0&&((e=this.list.current)==null||e.scrollToItem(r,t),this.scrollToNodeHorizontally(this.get(n)))}).catch(()=>{})}scrollToNodeHorizontally(e){let t=this.listEl.current;if(!e||!t)return;let n=t.scrollWidth-t.clientWidth;if(n<=0)return;let r=e.level*this.indent,i=t.scrollLeft,a=t.scrollLeft+t.clientWidth;(r<i||r>=a)&&(t.scrollLeft=Math.max(0,Math.min(r,n)))}scrollToOffset(e){var t;let n=Number.isFinite(e)?Math.max(0,e):0;(t=this.list.current)==null||t.scrollTo(n)}get scrollOffset(){return this.listEl.current?.scrollTop??0}get isEditing(){return this.state.nodes.edit.id!==null}get isFiltered(){return!!this.props.searchTerm?.trim()}get filteredCount(){return this.matchCount}get hasFocus(){return this.state.nodes.focus.treeFocused}get hasNoSelection(){return this.state.nodes.selection.ids.size===0}get hasOneSelection(){return this.state.nodes.selection.ids.size===1}get hasMultipleSelections(){return this.state.nodes.selection.ids.size>1}isSelected(e){return e?this.state.nodes.selection.ids.has(e):!1}isOpen(e){if(!e)return!1;if(e===`__REACT_ARBORIST_INTERNAL_ROOT__`)return!0;let t=this.props.openByDefault??!0;return this.isFiltered?this.state.nodes.open.filtered[e]??!0:this.state.nodes.open.unfiltered[e]??t}isEditable(e){return this.isActionPossible(e,this.props.disableEdit)}isDraggable(e){return this.isActionPossible(e,this.props.disableDrag)}isSelectable(e){return this.isActionPossible(e,this.props.disableSelect)}isActionPossible(e,t=()=>!1){return!z(e,t)}isDragging(e){let t=this.identifyNull(e);return t?this.state.nodes.drag.id===t:!1}isFocused(e){return this.hasFocus&&this.state.nodes.focus.id===e}isMatch(e){return this.matchFn(e)}willReceiveDrop(e){let t=this.identifyNull(e);if(!t)return!1;let{destinationParentId:n,destinationIndex:r}=this.state.nodes.drag;return t===n&&r===null}onFocus(){let e=this.focusedNode||this.firstNode;e&&this.dispatch(B(e.id))}onBlur(){this.dispatch(ri())}onItemsRendered(e){this.visibleStartIndex=e.visibleStartIndex,this.visibleStopIndex=e.visibleStopIndex}get renderContainer(){return this.props.renderContainer||ca}get renderRow(){return this.props.renderRow||Jr}get renderNode(){return this.props.children||Yr}get renderDragPreview(){return this.props.renderDragPreview||pi}get renderCursor(){return this.props.renderCursor||qr}};function J(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var _a=typeof Symbol==`function`&&Symbol.observable||`@@observable`,va=()=>Math.random().toString(36).substring(7).split(``).join(`.`),Y={INIT:`@@redux/INIT${va()}`,REPLACE:`@@redux/REPLACE${va()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${va()}`};function ya(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function ba(e,t,n){if(typeof e!=`function`)throw Error(J(2));if(typeof t==`function`&&typeof n==`function`||typeof n==`function`&&typeof arguments[3]==`function`)throw Error(J(0));if(typeof t==`function`&&n===void 0&&(n=t,t=void 0),n!==void 0){if(typeof n!=`function`)throw Error(J(1));return n(ba)(e,t)}let r=e,i=t,a=new Map,o=a,s=0,c=!1;function l(){o===a&&(o=new Map,a.forEach((e,t)=>{o.set(t,e)}))}function u(){if(c)throw Error(J(3));return i}function d(e){if(typeof e!=`function`)throw Error(J(4));if(c)throw Error(J(5));let t=!0;l();let n=s++;return o.set(n,e),function(){if(t){if(c)throw Error(J(6));t=!1,l(),o.delete(n),a=null}}}function f(e){if(!ya(e))throw Error(J(7));if(e.type===void 0)throw Error(J(8));if(typeof e.type!=`string`)throw Error(J(17));if(c)throw Error(J(9));try{c=!0,i=r(i,e)}finally{c=!1}return(a=o).forEach(e=>{e()}),e}function p(e){if(typeof e!=`function`)throw Error(J(10));r=e,f({type:Y.REPLACE})}function m(){let e=d;return{subscribe(t){if(typeof t!=`object`||!t)throw Error(J(11));function n(){let e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[_a](){return this}}}return f({type:Y.INIT}),{dispatch:f,subscribe:d,getState:u,replaceReducer:p,[_a]:m}}function xa(e){Object.keys(e).forEach(t=>{let n=e[t];if(n(void 0,{type:Y.INIT})===void 0)throw Error(J(12));if(n(void 0,{type:Y.PROBE_UNKNOWN_ACTION()})===void 0)throw Error(J(13))})}function Sa(e){let t=Object.keys(e),n={};for(let r=0;r<t.length;r++){let i=t[r];typeof e[i]==`function`&&(n[i]=e[i])}let r=Object.keys(n),i;try{xa(n)}catch(e){i=e}return function(e={},t){if(i)throw i;let a=!1,o={};for(let i=0;i<r.length;i++){let s=r[i],c=n[s],l=e[s],u=c(l,t);if(u===void 0)throw t&&t.type,Error(J(14));o[s]=u,a||=u!==l}return a||=r.length!==Object.keys(e).length,a?o:e}}function Ca(e=V().nodes.drag,t){switch(t.type){case`DND_DRAG_START`:return Object.assign(Object.assign({},e),{id:t.id,selectedIds:t.dragIds});case`DND_DRAG_END`:return Object.assign(Object.assign({},e),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case`DND_DESTINATION`:return t.parentId!==e.destinationParentId||t.index!=e.destinationIndex?Object.assign(Object.assign({},e),{destinationParentId:t.parentId,destinationIndex:t.index}):e;default:return e}}var wa=Sa({nodes:Sa({focus:ii,edit:ni,open:si,selection:ci,drag:Ca}),dnd:li}),Ta=V();function Ea({treeProps:e,imperativeHandle:t,children:n}){let r=(0,w.useRef)(null),i=(0,w.useRef)(null),a=(0,w.useRef)(ba(wa,V(e))),o=(0,Hn.useSyncExternalStore)(a.current.subscribe,a.current.getState,()=>Ta),s=(0,w.useMemo)(()=>new ga(a.current,e,r,i),[]),c=(0,w.useRef)(0);return(0,w.useMemo)(()=>{c.current+=1,s.update(e)},Object.values(e)),(0,w.useMemo)(()=>{c.current+=1,s.update(s.props)},[o.nodes.open]),(0,w.useImperativeHandle)(t,()=>s),(0,w.useEffect)(()=>{s.props.selection?s.select(s.props.selection,{focus:!1}):s.deselectAll()},[s.props.selection]),(0,w.useEffect)(()=>{s.props.searchTerm||a.current.dispatch(ai.clear(!0))},[s.props.searchTerm]),(0,C.jsx)(_r.Provider,{value:s,children:(0,C.jsx)(Sr.Provider,{value:c.current,children:(0,C.jsx)(vr.Provider,{value:o.nodes,children:(0,C.jsx)(br.Provider,{value:o.dnd,children:(0,C.jsx)(Qt,Object.assign({},e.dndManager?{manager:e.dndManager}:{backend:e.dndBackend||gr,options:{rootElement:s.props.dndRootElement||void 0}},{children:n}))})})})})}function Da(){let e=I(),[,t]=Vn(()=>({accept:`NODE`,canDrop:(t,n)=>n.isOver({shallow:!0})?e.canDrop():!1,hover:(t,n)=>{if(!n.isOver({shallow:!0}))return;let r=n.getClientOffset();if(!e.listEl.current||!r)return;let{cursor:i,drop:a}=na({element:e.listEl.current,offset:r,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});e.hover(a,i)},drop:(t,n)=>{if(!n.isOver({shallow:!0})||!n.canDrop())return null;e.drop()}}),[e]);t(e.listEl)}function Oa(e){return Da(),e.children}function ka(){let e=I().props.renderContainer||ca;return(0,C.jsx)(C.Fragment,{children:(0,C.jsx)(e,{})})}function Aa(){let e=I(),{offset:t,mouse:n,item:r,isDragging:i}=Nn(e=>({offset:e.getSourceClientOffset(),mouse:e.getClientOffset(),item:e.getItem(),isDragging:e.isDragging()})),a=e.props.renderDragPreview||pi;return(0,C.jsx)(a,{offset:t,mouse:n,id:r?.id||null,dragIds:r?.dragIds||[],isDragging:i})}function ja(e={}){let t=e.idAccessor??`id`,n=e.childrenAccessor??`children`;return{getId:typeof t==`function`?t:e=>e[t],getChildren:typeof n==`function`?n:e=>e[n],childrenKey:typeof n==`string`?n:`children`}}var Ma=class{constructor(e,t={}){this.accessors=ja(t),this.root=Na(e,this.accessors)}get data(){return this.root.children?.map(e=>e.data)??[]}create(e){let t=e.parentId?this.find(e.parentId):this.root;if(!t)return null;t.addChild(e.data,e.index)}move(e){let t=this.find(e.id),n=e.parentId?this.find(e.parentId):this.root;!t||!n||(n.addChild(t.data,e.index),t.drop())}update(e){let t=this.find(e.id);t&&t.update(e.changes)}drop(e){let t=this.find(e.id);t&&t.drop()}find(e,t=this.root){if(!t)return null;if(t.id===e)return t;if(t.children){for(let n of t.children){let t=this.find(e,n);if(t)return t}return null}return null}};function Na(e,t){let n=new Fa({},null,t,`ROOT`);return n.children=e.map(e=>Pa(e,n,t)),n}function Pa(e,t,n){let r=new Fa(e,t,n),i=n.getChildren(e);return i&&(r.children=i.map(e=>Pa(e,r,n))),r}var Fa=class{constructor(e,t,n,r){this.data=e,this.parent=t,this.accessors=n,this.id=r??n.getId(e)}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(e,t){let n=Pa(e,this,this.accessors);this.children=this.children??[],this.children.splice(t,0,n);let r=this.accessors.childrenKey,i=this.data;i[r]=i[r]??[],i[r].splice(t,0,e)}removeChild(e){var t,n;(t=this.children)==null||t.splice(e,1),(n=this.data[this.accessors.childrenKey])==null||n.splice(e,1)}update(e){if(this.hasParent()){let t=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),e),t),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}},Ia=0;function La(e,t={}){let[n,r]=(0,w.useState)(e),i=t.idAccessor,a=t.childrenAccessor,o=t.onChange,s=(0,w.useMemo)(()=>new Ma(n,{idAccessor:i,childrenAccessor:a}),[n,i,a]),c=()=>{let e=s.data;r(e),o?.(e)},l=e=>{for(let t of e.dragIds)s.move({id:t,parentId:e.parentId,index:e.index});c()},u=({name:e,id:t})=>{s.update({id:t,changes:{name:e}}),c()},d=typeof i==`string`?i:`id`,f=typeof a==`string`?a:`children`;return[n,{onMove:l,onRename:u,onCreate:({parentId:e,index:t,type:n})=>{if(typeof i==`function`)throw Error("React Arborist => initialData can't create nodes when idAccessor is a function: the generated id can't be written under a key the accessor reads. Use a string idAccessor, or the controlled `data` prop with your own onCreate.");if(n===`internal`&&typeof a==`function`)throw Error("React Arborist => initialData can't create folder nodes when childrenAccessor is a function: the new children array can't be written under a key the accessor reads. Use a string childrenAccessor, or the controlled `data` prop with your own onCreate.");let r={[d]:`simple-tree-id-${Ia++}`,name:``};return n===`internal`&&(r[f]=[]),s.create({parentId:e,index:t,data:r}),c(),r},onDelete:e=>{e.ids.forEach(e=>s.drop({id:e})),c()}}]}function Ra(e){if(e.initialData&&e.data)throw Error(`React Arborist Tree => Provide either a data or initialData prop, but not both.`);if(e.initialData&&(e.onCreate||e.onDelete||e.onMove||e.onRename))throw Error(`React Arborist Tree => You passed the initialData prop along with a data handler.
3
+ Use the data prop if you want to provide your own handlers.`);if(e.initialData){let[t,n]=La(e.initialData,{idAccessor:e.idAccessor,childrenAccessor:e.childrenAccessor});return Object.assign(Object.assign(Object.assign({},e),n),{data:t})}return e}function za(e,t){let n=Ra(e);return(0,C.jsxs)(Ea,{treeProps:n,imperativeHandle:t,children:[(0,C.jsx)(Oa,{children:(0,C.jsx)(ka,{})}),(0,C.jsx)(Aa,{})]})}var Ba=(0,w.forwardRef)(za),X=a(),Va=5,Ha=/^[A-Za-z]:[/\\]/,Ua=/^\\\\/;function Z(e){return e.success?e:(v({title:`Failed`,description:e.message}),null)}var Wa=class{delegate=new Ma([]);callbacks;constructor(e){this.callbacks=e}roots=[];pendingExpansions=new Map;onChange=s.NOOP;path=new h(`/`);initialize=async e=>{if(this.onChange=e,this.delegate.data.length===0)try{let{roots:e}=await this.callbacks.getRoots(),t=e.find(e=>e.isPrimary);if(!t)throw Error(`File browser response is missing a primary root`);if(this.roots=e,this.path=h.guessDeliminator(t.path),this.delegate=new Ma(e.map(qa)),e.length===1){let e=await this.callbacks.listFiles({path:t.path});this.updateDirectory(this.getPrimaryRootId(),e.files)}}catch(e){v({title:`Failed`,description:te(e)})}this.emitChange()};expand(e){return this.requestDirectory(e)}requestDirectory(e,t=!1){let n=this.pendingExpansions.get(e);if(n)return n;let r=this.delegate.find(e);if(!r?.data.isDirectory)return Promise.resolve(!1);if(!t&&r.data.loadState===`loaded`)return Promise.resolve(!0);let i=this.loadDirectory(e,r.data).finally(()=>{this.pendingExpansions.delete(e)});return this.pendingExpansions.set(e,i),i}async loadDirectory(e,t){this.delegate.update({id:e,changes:{loadState:`loading`}}),this.emitChange();try{let n=await this.callbacks.listFiles({path:t.path});return this.updateDirectory(e,n.files),!0}catch(n){return this.delegate.update({id:e,changes:{loadState:`error`}}),v({title:`Could not load ${t.name}`,description:te(n)}),!1}finally{this.emitChange()}}getRoots(){return this.roots}async reveal(e){let t=$(e.path,e.rootPath);if(t===null)return!1;let n=e.rootPath,r=t.split(Qa(e.rootPath)).filter(Boolean);e.isDirectory||r.pop();for(let t of[null,...r]){if(t!==null){let r=Q(e.rootPath,n);if(n=Xa(n,t),!this.delegate.find(Q(e.rootPath,n))&&!await this.requestDirectory(r,!0))return!1}let r=Q(e.rootPath,n);if(!this.delegate.find(r))return v({title:`Could not reveal folder`,description:`The folder may have moved or been deleted: ${n}`}),!1;if(!await this.expand(r))return!1}return!0}async copy(e,t){let n=this.getMutableNode(e);if(!n)return;let r=n.data.path,i=this.getParentPath(n.data),a=Xa(i,t);await this.callbacks.copyFileOrFolder({path:r,newPath:a}).then(Z)&&await this.refreshPath(i)}async rename(e,t){let n=this.getMutableNode(e);if(!n)return;let r=n.data.path,i=this.getParentPath(n.data),a=Xa(i,t);await this.callbacks.renameFileOrFolder({path:r,newPath:a}).then(Z)&&await this.refreshPath(i)}async move(e,t){let n=t??this.getPrimaryRootId(),r=this.delegate.find(n);if(!r?.data.isDirectory)return;let i=new Set;await ie(e,Va,async e=>{let t=this.getMutableNode(e,!1);if(!t)return;let n=t.data.path,a=this.getParentPath(t.data),o=Xa(r.data.path,this.path.basename(n));await this.callbacks.renameFileOrFolder({path:n,newPath:o}).then(Z)&&(i.add(r.data.path),i.add(a))}),await this.refreshPaths([...i])}async createFile({name:e,parentId:t,type:n=`file`}){let r=this.getParentNode(t);r&&await this.callbacks.createFileOrFolder({path:r.data.path,type:n,name:e}).then(Z)&&await this.refreshPath(r.data.path)}async createFolder(e,t){let n=this.getParentNode(t);n&&await this.callbacks.createFileOrFolder({path:n.data.path,type:`directory`,name:e}).then(Z)&&await this.refreshPath(n.data.path)}async delete(e){let t=this.getMutableNode(e);if(!t)return;let n=this.getParentPath(t.data);await this.callbacks.deleteFileOrFolder({path:t.data.path}).then(Z)&&await this.refreshPath(n)}refreshAll=async e=>{let t=[...this.roots.map(e=>e.path),...e.map(e=>this.delegate.find(e)?.data.path).filter(e=>!!e)];await this.refreshPaths(t,new Set([...this.roots.map(e=>Q(e.path,e.path)),...e]))};refreshPath=async e=>{await this.refreshPaths([e])};getPrimaryRelativePath=e=>{let t=this.getPrimaryRoot();return t?$(e,t.path):null};getPrimaryRootPath=()=>this.getPrimaryRoot()?.path??``;getPrimaryRootId=()=>{let e=this.getPrimaryRoot()?.path??``;return Q(e,e)};isPrimaryNode=e=>e.isPrimaryRoot;getDisplayPath=e=>{let t=this.getRootForPath(e);if(!t)return e;let n=$(e,t.path);return n?t.isPrimary?n:`${t.name}/${n}`:t.name};isRootPath=e=>this.roots.some(t=>Ya(e,t.path));getPrimaryRoot(){return this.roots.find(e=>e.isPrimary)}getRootForNode(e){return this.roots.find(t=>Ya(t.path,e.rootPath))??this.getPrimaryRoot()??{path:e.rootPath,name:e.rootPath,isPrimary:e.isPrimaryRoot}}getRootForPath(e){return this.roots.filter(t=>$(e,t.path)!==null).toSorted((e,t)=>t.path.length-e.path.length)[0]}getParentNode(e){let t=e??this.getPrimaryRootId(),n=this.delegate.find(t);return n?.data.isDirectory?n:null}getParentPath(e){return(this.delegate.find(e.id)?.parent)?.data.path??e.rootPath}getMutableNode(e,t=!0){let n=this.delegate.find(e);return!n||n.data.isRoot?(t&&v({title:`Failed`,description:n?`File browser roots cannot be modified`:`Node with id ${e} not found in the tree`}),null):n}refreshPaths=async(e,t)=>{let n=[...new Set(e)].toSorted((e,t)=>e.length-t.length);if(n.length===0)return;let r=await ie(n,Va,e=>this.callbacks.listFiles({path:e}).catch(()=>null));for(let[e,i]of n.entries()){let n=r[e];if(n)for(let e of this.roots){let r=Q(e.path,i);(!t||t.has(r))&&this.updateDirectory(r,n.files,t)}}this.emitChange()};updateDirectory(e,t,n){let r=this.delegate.find(e)?.data;if(!r?.isDirectory)return;let i=Ga(Ja(t,this.getRootForNode(r)),r.children);this.delegate.update({id:e,changes:{children:n?Ka(i,n):i,loadState:`loaded`}})}emitChange(){let e=this.delegate.data;this.onChange(this.roots.length===1?[...e[0]?.children??[]]:e)}};function Ga(e,t){let n=new Map(t.map(e=>[e.id,e]));return e.map(e=>{let t=n.get(e.id);return!e.isDirectory||!t?.isDirectory?e:{...e,children:t.children,loadState:t.loadState}})}function Ka(e,t){return e.map(e=>e.isDirectory?t.has(e.id)?{...e,children:Ka(e.children,t)}:{...e,children:[],loadState:`unloaded`}:e)}function qa(e){return{id:Q(e.path,e.path),path:e.path,name:e.name,isDirectory:!0,isMarimoFile:!1,children:[],isRoot:!0,rootPath:e.path,isPrimaryRoot:e.isPrimary,loadState:`unloaded`}}function Ja(e,t){return e.map(e=>({...e,id:Q(t.path,e.path),children:Ja(e.children??[],t),loadState:e.children?.length?`loaded`:`unloaded`,isRoot:!1,rootPath:t.path,isPrimaryRoot:t.isPrimary}))}function Q(e,t){return`${encodeURIComponent(e)}:${encodeURIComponent(t)}`}function $(e,t){let n=Za(t),r=e=>n?e.toLowerCase():e,i=r(e);if(i===r(t))return``;let a=Qa(t),o=t.endsWith(a)?t:`${t}${a}`,s=r(o);return i.startsWith(s)?e.slice(o.length):null}function Ya(e,t){return $(e,t)===``}function Xa(e,t){let n=Qa(e);return`${e}${e.endsWith(n)?``:n}${t}`}function Za(e){return Ha.test(e)||Ua.test(e)}function Qa(e){return Ua.test(e)||/^[A-Za-z]:\\/.test(e)?`\\`:`/`}function $a(e){let t=(0,X.c)(13),{root:n}=e,{sendRenameFileOrFolder:r,sendCopyFileOrFolder:i,sendDeleteFileOrFolder:a}=y(),o;t[0]!==n||t[1]!==r?(o=async(e,t)=>{let{path:i,newPath:a}=S({path:e.path,name:t,root:n});return Z(await r({path:i,newPath:a}))},t[0]=n,t[1]=r,t[2]=o):o=t[2];let s=o,c;t[3]!==n||t[4]!==i?(c=async e=>{let{path:t,newPath:r}=S({path:e.path,name:re(e.name),root:n});return Z(await i({path:t,newPath:r}))},t[3]=n,t[4]=i,t[5]=c):c=t[5];let l=c,u;t[6]!==n||t[7]!==a?(u=async e=>Z(await a({path:ne(e.path,n)})),t[6]=n,t[7]=a,t[8]=u):u=t[8];let d=u,f;return t[9]!==d||t[10]!==l||t[11]!==s?(f={renameFile:s,duplicateFile:l,deleteFile:d},t[9]=d,t[10]=l,t[11]=s,t[12]=f):f=t[12],f}var eo={file:`Delete file`,folder:`Delete folder`,notebook:`Delete notebook`};function to(){let e=(0,X.c)(2),{openConfirm:t}=_(),n;return e[0]===t?n=e[1]:(n=(e,n)=>{let r=e.kind??`file`;t({title:eo[r],description:`Are you sure you want to delete ${e.name}?`,confirmAction:(0,C.jsx)(l,{onClick:async()=>{await n()},"aria-label":`Confirm`,children:`Delete`})})},e[0]=t,e[1]=n),n}function no(e){let t=(0,X.c)(17),{node:n,root:i,onAfterChange:a}=e,o;t[0]===i?o=t[1]:(o={root:i},t[0]=i,t[1]=o);let{duplicateFile:s,deleteFile:c}=$a(o),l=to(),u;t[2]===n?u=t[3]:(u=()=>{n.edit()},t[2]=n,t[3]=u);let d=r(u),f;t[4]!==s||t[5]!==n.data||t[6]!==a?(f=async()=>{await s(n.data)&&a?.()},t[4]=s,t[5]=n.data,t[6]=a,t[7]=f):f=t[7];let p=r(f),m;t[8]!==l||t[9]!==c||t[10]!==n.data||t[11]!==a?(m=()=>{let e=n.data.isDirectory?`folder`:n.data.isMarimoFile?`notebook`:`file`;l({name:n.data.name,kind:e},async()=>{await c(n.data)&&a?.()})},t[8]=l,t[9]=c,t[10]=n.data,t[11]=a,t[12]=m):m=t[12];let h=r(m),g;return t[13]!==h||t[14]!==p||t[15]!==d?(g={handleRename:d,handleDuplicate:p,handleDelete:h},t[13]=h,t[14]=p,t[15]=d,t[16]=g):g=t[16],g}var ro=e=>{let t=(0,X.c)(15),{testId:n,buttonClassName:r,iconClassName:i,contentClassName:a,preventDefaultOnTrigger:o,children:s}=e,c=o!==void 0&&o,l;t[0]===c?l=t[1]:(l=e=>{e.stopPropagation(),c&&e.preventDefault()},t[0]=c,t[1]=l);let u;t[2]!==r||t[3]!==i||t[4]!==n?(u=(0,C.jsx)(x,{"data-testid":n,className:r,iconClassName:i}),t[2]=r,t[3]=i,t[4]=n,t[5]=u):u=t[5];let m;t[6]!==l||t[7]!==u?(m=(0,C.jsx)(d,{asChild:!0,tabIndex:-1,onClick:l,children:u}),t[6]=l,t[7]=u,t[8]=m):m=t[8];let h=a??`print:hidden w-[240px]`,g;t[9]!==s||t[10]!==h?(g=(0,C.jsx)(f,{align:`end`,className:h,onClick:so,onCloseAutoFocus:co,children:s}),t[9]=s,t[10]=h,t[11]=g):g=t[11];let _;return t[12]!==m||t[13]!==g?(_=(0,C.jsxs)(p,{modal:!1,children:[m,g]}),t[12]=m,t[13]=g,t[14]=_):_=t[14],_},io=e=>{let t=(0,X.c)(6),{onSelect:n,disabled:r,title:i,testId:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,C.jsx)(oe,{className:b}),t[0]=o):o=t[0];let s;return t[1]!==r||t[2]!==n||t[3]!==a||t[4]!==i?(s=(0,C.jsxs)(u,{onSelect:n,disabled:r,title:i,"data-testid":a,children:[o,`Rename`]}),t[1]=r,t[2]=n,t[3]=a,t[4]=i,t[5]=s):s=t[5],s},ao=e=>{let t=(0,X.c)(6),{onSelect:n,disabled:r,title:i,testId:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,C.jsx)(g,{className:b}),t[0]=o):o=t[0];let s;return t[1]!==r||t[2]!==n||t[3]!==a||t[4]!==i?(s=(0,C.jsxs)(u,{onSelect:n,disabled:r,title:i,"data-testid":a,children:[o,`Duplicate`]}),t[1]=r,t[2]=n,t[3]=a,t[4]=i,t[5]=s):s=t[5],s},oo=e=>{let t=(0,X.c)(6),{onSelect:n,disabled:r,title:i,testId:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,C.jsx)(ee,{className:b}),t[0]=o):o=t[0];let s;return t[1]!==r||t[2]!==n||t[3]!==a||t[4]!==i?(s=(0,C.jsxs)(u,{onSelect:n,variant:`danger`,disabled:r,title:i,"data-testid":a,children:[o,`Delete`]}),t[1]=r,t[2]=n,t[3]=a,t[4]=i,t[5]=s):s=t[5],s};function so(e){return e.stopPropagation()}function co(e){return e.preventDefault()}var lo=e=>{let t=(0,X.c)(10),{node:n}=e,r=(0,w.useRef)(null),i,a;t[0]===n.data.name?(i=t[1],a=t[2]):(i=()=>{r.current?.focus();let e=n.data.name,t=e.lastIndexOf(`.`),i=t>0?t:e.length;r.current?.setSelectionRange(0,i)},a=[n.data.name],t[0]=n.data.name,t[1]=i,t[2]=a),(0,w.useEffect)(i,a);let o,s;t[3]===n?(o=t[4],s=t[5]):(o=()=>n.reset(),s=e=>{e.key===`Escape`&&n.reset(),e.key===`Enter`&&n.submit(e.currentTarget.value)},t[3]=n,t[4]=o,t[5]=s);let c;return t[6]!==n.data.name||t[7]!==o||t[8]!==s?(c=(0,C.jsx)(`input`,{ref:r,className:`flex-1 bg-transparent border border-border text-muted-foreground`,defaultValue:n.data.name,onClick:uo,onBlur:o,onKeyDown:s}),t[6]=n.data.name,t[7]=o,t[8]=s,t[9]=c):c=t[9],c};function uo(e){return e.stopPropagation()}export{io as a,Wa as c,gr as d,Vn as f,ro as i,Q as l,Qt as m,oo as n,$a as o,N as p,ao as r,no as s,lo as t,Ba as u};
@@ -0,0 +1 @@
1
+ import{c as e,l as t,t as n,u as r}from"./useEvent-Dc9HkKI2.js";import{za as i}from"./cells-CzugpTQu.js";import{t as a}from"./compiler-runtime-BQ9S8nyo.js";import{p as o}from"./config-BxZgoFvi.js";import{i as s}from"./utils-B4K466FK.js";import{s as c}from"./session-DXKMv4Bs.js";import{T as l,_ as u}from"./config-DpGPGznL.js";import{n as d}from"./paths-CzfpItSz.js";import{b as f}from"./write-secret-modal-BiG2tahJ.js";import{r as p}from"./requests-yTHMxhVa.js";var m=a();function h(){return t(i)}function g(){let t=(0,m.c)(5),[a]=e(u),h=r(i),{openAlert:g}=f(),{sendRename:_}=p(),v;return t[0]!==a.state||t[1]!==g||t[2]!==_||t[3]!==h?(v=async e=>{let t=o();return a.state===l.OPEN?(c(t=>{e===null?t.delete(s.filePath):t.set(s.filePath,e)}),_({filename:e}).then(()=>(h(e),document.title=t.app_title||d.basename(e)||`Untitled Notebook`,e)).catch(e=>(g(e.message),null))):(g(`Failed to save notebook: not connected to a kernel.`),null)},t[0]=a.state,t[1]=g,t[2]=_,t[3]=h,t[4]=v):v=t[4],n(v)}export{g as n,h as t};
@@ -0,0 +1 @@
1
+ import"./chunk-75Z2AOVW-BzzYECN7.js";import"./src-Cyu5G-Tr.js";import"./chunk-DU6HZSFF-BlpgvKzl.js";import"./chunk-P2QGCYS3-_SeE0QXb.js";import"./chunk-PWAF6VOD-BZoBqp8x.js";import"./chunk-GMAD6QVW-hv6IsAru.js";import"./chunk-4HAMMTFA-C6Tl7kEY.js";import"./chunk-GVQU2GXP-Duv4ZYb-.js";import"./chunk-L3NEJ4N5-B2hafvRU.js";import"./chunk-OSK3NFVY-SNGRdtNA.js";import"./mermaid-D_jPUVqz.js";import"./chunk-F27PBJKO-BVIgLGPF.js";import"./chunk-XXDRQBXY-BwqwIlJV.js";import"./chunk-POPQ4Y6H-BB5NNJFE.js";import{n as e}from"./chunk-SHT3W25Y-BtLGdeDB.js";export{e as diagram};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CUdNIagt.js";import{t as n}from"./compiler-runtime-BQ9S8nyo.js";import{t as r}from"./ErrorBoundary-DrliQ_7g.js";import{t as i}from"./jsx-runtime-B74pBk57.js";import{n as a,t as o}from"./paths-CzfpItSz.js";import{i as s}from"./components-CQVZgYvR.js";import{Qt as c,r as l}from"./input-BDakodZ2.js";import{r as u}from"./requests-yTHMxhVa.js";import{c as d,t as f}from"./session-C8nQMsOE.js";import{n as p}from"./useAsyncData-DucTwMkf.js";import{a as m}from"./errors-D9vyuMar.js";import{Vn as h,ei as g}from"./index-CgQsZfww.js";import{n as _,t as v}from"./card-BYZGhhhx.js";var y=n(),b=e(t(),1),x=i(),S=e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase(),C=e=>{let t=o.guessDeliminator(e).deliminator;return e.replace(/\.[^./]+$/,``).split(t).filter(Boolean).map(e=>e.split(/[_-]/).map(S).join(` `)).join(` > `)},w=e=>`${f()}-${encodeURIComponent(e)}`,T=e=>{try{return new URL(e).protocol===`https:`}catch{return!1}},E=10,D=()=>{let e=(0,y.c)(32),{getWorkspaceFiles:t}=u(),[n,i]=(0,b.useState)(``),o;e[0]===t?o=e[1]:(o=()=>t({includeMarkdown:!1}),e[0]=t,e[1]=o);let f;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=[],e[2]=f):f=e[2];let _=p(o,f),v=_.data;v?.files,v?.root;let S;e[3]===v?.files?S=e[4]:(S=v?.files??[],e[3]=v?.files,e[4]=S);let w=S,D=v?.root??``,j;if(e[5]!==w||e[6]!==D){let t;e[8]===D?t=e[9]:(t=e=>{let t=D&&a.isAbsolute(e.path)&&e.path.startsWith(D)?a.rest(e.path,D):e.path,n=e.opengraph?.title??C(a.basename(t)),r=C(a.dirname(t)),i=e.opengraph?.description??``,o=e.opengraph?.image,s=o&&T(o)?o:d(`og/thumbnail?file=${encodeURIComponent(t)}`).toString();return{...e,relativePath:t,title:n,subtitle:r,description:i,thumbnailUrl:s}},e[8]=D,e[9]=t),j=w.filter(O).map(t).toSorted(k),e[5]=w,e[6]=D,e[7]=j}else j=e[7];let M=j,N;bb0:{if(!n){N=M;break bb0}let t;if(e[10]!==M||e[11]!==n){let r=n.toLowerCase();t=M.filter(e=>e.title.toLowerCase().includes(r)),e[10]=M,e[11]=n,e[12]=t}else t=e[12];N=t}let P=N;if(_.isPending){let t;return e[13]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,x.jsx)(g,{centered:!0,size:`xlarge`,className:`mt-6`}),e[13]=t):t=e[13],t}if(_.error){let t;e[14]===_.error?t=e[15]:(t=m(_.error),e[14]=_.error,e[15]=t);let n;return e[16]===t?n=e[17]:(n=(0,x.jsx)(h,{kind:`danger`,className:`rounded p-4`,children:t}),e[16]=t,e[17]=n),n}if(!v){let t;return e[18]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,x.jsx)(g,{centered:!0,size:`xlarge`,className:`mt-6`}),e[18]=t):t=e[18],t}let F;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,x.jsx)(`img`,{src:`logo.png`,alt:`marimo logo`,className:`w-48 mb-2`}),e[19]=F):F=e[19];let I;e[20]!==v.fileCount||e[21]!==v.hasMore?(I=v.hasMore&&(0,x.jsx)(s,{fileCount:v.fileCount}),e[20]=v.fileCount,e[21]=v.hasMore,e[22]=I):I=e[22];let L;e[23]!==M.length||e[24]!==n?(L=M.length>E&&(0,x.jsx)(l,{id:`search`,value:n,icon:(0,x.jsx)(c,{className:`h-4 w-4`}),onChange:e=>i(e.target.value),placeholder:`Search`,rootClassName:`mb-3`,className:`mb-0 border-border`}),e[23]=M.length,e[24]=n,e[25]=L):L=e[25];let R;e[26]===P?R=e[27]:(R=P.length===0?(0,x.jsx)(h,{kind:`warn`,className:`rounded p-4`,children:`No marimo apps found.`}):(0,x.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4`,children:P.map(A)}),e[26]=P,e[27]=R);let z;return e[28]!==I||e[29]!==L||e[30]!==R?(z=(0,x.jsx)(b.Suspense,{children:(0,x.jsxs)(`div`,{className:`flex flex-col gap-6 max-w-6xl container pt-5 pb-20 z-10`,children:[F,(0,x.jsx)(r,{children:(0,x.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[I,L,R]})})]})}),e[28]=I,e[29]=L,e[30]=R,e[31]=z):z=e[31],z};function O(e){return!e.isDirectory}function k(e,t){return e.relativePath.localeCompare(t.relativePath)}function A(e){return(0,x.jsx)(`a`,{href:d(`?file=${encodeURIComponent(e.relativePath)}`).toString(),target:w(e.path),className:`no-underline`,children:(0,x.jsxs)(v,{className:`h-full overflow-hidden hover:bg-accent/20 transition-colors`,children:[(0,x.jsx)(`img`,{src:e.thumbnailUrl,alt:e.title,loading:`lazy`,className:`w-full aspect-1200/630 object-cover border-b border-border/60`}),(0,x.jsx)(_,{className:`p-6 pt-4`,children:(0,x.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e.subtitle&&(0,x.jsx)(`div`,{className:`text-sm font-semibold text-muted-foreground`,children:e.subtitle}),(0,x.jsx)(`div`,{className:`text-lg font-medium`,children:e.title}),e.description&&(0,x.jsx)(`div`,{className:`text-sm text-muted-foreground line-clamp-3 mt-1`,children:e.description})]})})]})},e.path)}export{D as default};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CUdNIagt.js";import{t as n}from"./compiler-runtime-BQ9S8nyo.js";import{c as r,t as i}from"./session-DXKMv4Bs.js";import{t as a}from"./ErrorBoundary-BeE1cdgM.js";import{t as o}from"./jsx-runtime-B74pBk57.js";import{n as s,t as c}from"./paths-CzfpItSz.js";import{i as l}from"./components-DAmFBASm.js";import{Qt as u,r as d}from"./input-BDakodZ2.js";import{r as f}from"./requests-yTHMxhVa.js";import{n as p}from"./useAsyncData-DucTwMkf.js";import{a as m}from"./errors-D9vyuMar.js";import{Qr as h,Vn as g}from"./index-DafnX1Xx.js";import{n as _,t as v}from"./card-BYZGhhhx.js";var y=n(),b=e(t(),1),x=o(),S=e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase(),C=e=>{let t=c.guessDeliminator(e).deliminator;return e.replace(/\.[^./]+$/,``).split(t).filter(Boolean).map(e=>e.split(/[_-]/).map(S).join(` `)).join(` > `)},w=e=>`${i()}-${encodeURIComponent(e)}`,T=e=>{try{return new URL(e).protocol===`https:`}catch{return!1}},E=10,D=()=>{let e=(0,y.c)(32),{getWorkspaceFiles:t}=f(),[n,i]=(0,b.useState)(``),o;e[0]===t?o=e[1]:(o=()=>t({includeMarkdown:!1}),e[0]=t,e[1]=o);let c;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=[],e[2]=c):c=e[2];let _=p(o,c),v=_.data;v?.files,v?.root;let S;e[3]===v?.files?S=e[4]:(S=v?.files??[],e[3]=v?.files,e[4]=S);let w=S,D=v?.root??``,j;if(e[5]!==w||e[6]!==D){let t;e[8]===D?t=e[9]:(t=e=>{let t=D&&s.isAbsolute(e.path)&&e.path.startsWith(D)?s.rest(e.path,D):e.path,n=e.opengraph?.title??C(s.basename(t)),i=C(s.dirname(t)),a=e.opengraph?.description??``,o=e.opengraph?.image,c=o&&T(o)?o:r(`og/thumbnail?file=${encodeURIComponent(t)}`).toString();return{...e,relativePath:t,title:n,subtitle:i,description:a,thumbnailUrl:c}},e[8]=D,e[9]=t),j=w.filter(O).map(t).toSorted(k),e[5]=w,e[6]=D,e[7]=j}else j=e[7];let M=j,N;bb0:{if(!n){N=M;break bb0}let t;if(e[10]!==M||e[11]!==n){let r=n.toLowerCase();t=M.filter(e=>e.title.toLowerCase().includes(r)),e[10]=M,e[11]=n,e[12]=t}else t=e[12];N=t}let P=N;if(_.isPending){let t;return e[13]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,x.jsx)(h,{centered:!0,size:`xlarge`,className:`mt-6`}),e[13]=t):t=e[13],t}if(_.error){let t;e[14]===_.error?t=e[15]:(t=m(_.error),e[14]=_.error,e[15]=t);let n;return e[16]===t?n=e[17]:(n=(0,x.jsx)(g,{kind:`danger`,className:`rounded p-4`,children:t}),e[16]=t,e[17]=n),n}if(!v){let t;return e[18]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,x.jsx)(h,{centered:!0,size:`xlarge`,className:`mt-6`}),e[18]=t):t=e[18],t}let F;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,x.jsx)(`img`,{src:`logo.png`,alt:`marimo logo`,className:`w-48 mb-2`}),e[19]=F):F=e[19];let I;e[20]!==v.fileCount||e[21]!==v.hasMore?(I=v.hasMore&&(0,x.jsx)(l,{fileCount:v.fileCount}),e[20]=v.fileCount,e[21]=v.hasMore,e[22]=I):I=e[22];let L;e[23]!==M.length||e[24]!==n?(L=M.length>E&&(0,x.jsx)(d,{id:`search`,value:n,icon:(0,x.jsx)(u,{className:`h-4 w-4`}),onChange:e=>i(e.target.value),placeholder:`Search`,rootClassName:`mb-3`,className:`mb-0 border-border`}),e[23]=M.length,e[24]=n,e[25]=L):L=e[25];let R;e[26]===P?R=e[27]:(R=P.length===0?(0,x.jsx)(g,{kind:`warn`,className:`rounded p-4`,children:`No marimo apps found.`}):(0,x.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4`,children:P.map(A)}),e[26]=P,e[27]=R);let z;return e[28]!==I||e[29]!==L||e[30]!==R?(z=(0,x.jsx)(b.Suspense,{children:(0,x.jsxs)(`div`,{className:`flex flex-col gap-6 max-w-6xl container pt-5 pb-20 z-10`,children:[F,(0,x.jsx)(a,{children:(0,x.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[I,L,R]})})]})}),e[28]=I,e[29]=L,e[30]=R,e[31]=z):z=e[31],z};function O(e){return!e.isDirectory}function k(e,t){return e.relativePath.localeCompare(t.relativePath)}function A(e){return(0,x.jsx)(`a`,{href:r(`?file=${encodeURIComponent(e.relativePath)}`).toString(),target:w(e.path),className:`no-underline`,children:(0,x.jsxs)(v,{className:`h-full overflow-hidden hover:bg-accent/20 transition-colors`,children:[(0,x.jsx)(`img`,{src:e.thumbnailUrl,alt:e.title,loading:`lazy`,className:`w-full aspect-1200/630 object-cover border-b border-border/60`}),(0,x.jsx)(_,{className:`p-6 pt-4`,children:(0,x.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e.subtitle&&(0,x.jsx)(`div`,{className:`text-sm font-semibold text-muted-foreground`,children:e.subtitle}),(0,x.jsx)(`div`,{className:`text-lg font-medium`,children:e.title}),e.description&&(0,x.jsx)(`div`,{className:`text-sm text-muted-foreground line-clamp-3 mt-1`,children:e.description})]})})]})},e.path)}export{D as default};
@@ -1,4 +1,4 @@
1
- import{a as e,t}from"./rolldown-runtime-B0Z9INg1.js";import{t as n}from"./linear-0eij_aAG.js";import{a as r,f as i,n as a,p as o}from"./time-MgToa8VM.js";import{E as s,P as c,S as l,c as u,d,f,g as p,h as m,m as h,p as g,t as _,u as v,w as y,y as b}from"./defaultLocale-D5bOh7g6.js";import{g as x}from"./chunk-75Z2AOVW-DA_lihEi.js";import{u as S}from"./src-BpnPuKEN.js";import{n as C}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{r as w,t as T}from"./src-Cyu5G-Tr.js";import{H as E,K as D,U as O,a as k,c as ee,s as A,v as j,w as M,x as N,y as te}from"./chunk-DU6HZSFF-J-califE.js";import{t as ne}from"./dist-CeoU7cfW.js";function re(e){return e}var P=1,F=2,I=3,L=4,R=1e-6;function ie(e){return`translate(`+e+`,0)`}function ae(e){return`translate(0,`+e+`)`}function oe(e){return t=>+e(t)}function se(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function ce(){return!this.__axis}function le(e,t){var n=[],r=null,i=null,a=6,o=6,s=3,c=typeof window<`u`&&window.devicePixelRatio>1?0:.5,l=e===P||e===L?-1:1,u=e===L||e===F?`x`:`y`,d=e===P||e===I?ie:ae;function f(f){var p=r??(t.ticks?t.ticks.apply(t,n):t.domain()),m=i??(t.tickFormat?t.tickFormat.apply(t,n):re),h=Math.max(a,0)+s,g=t.range(),_=+g[0]+c,v=+g[g.length-1]+c,y=(t.bandwidth?se:oe)(t.copy(),c),b=f.selection?f.selection():f,x=b.selectAll(`.domain`).data([null]),S=b.selectAll(`.tick`).data(p,t).order(),C=S.exit(),w=S.enter().append(`g`).attr(`class`,`tick`),T=S.select(`line`),E=S.select(`text`);x=x.merge(x.enter().insert(`path`,`.tick`).attr(`class`,`domain`).attr(`stroke`,`currentColor`)),S=S.merge(w),T=T.merge(w.append(`line`).attr(`stroke`,`currentColor`).attr(u+`2`,l*a)),E=E.merge(w.append(`text`).attr(`fill`,`currentColor`).attr(u,l*h).attr(`dy`,e===P?`0em`:e===I?`0.71em`:`0.32em`)),f!==b&&(x=x.transition(f),S=S.transition(f),T=T.transition(f),E=E.transition(f),C=C.transition(f).attr(`opacity`,R).attr(`transform`,function(e){return isFinite(e=y(e))?d(e+c):this.getAttribute(`transform`)}),w.attr(`opacity`,R).attr(`transform`,function(e){var t=this.parentNode.__axis;return d((t&&isFinite(t=t(e))?t:y(e))+c)})),C.remove(),x.attr(`d`,e===L||e===F?o?`M`+l*o+`,`+_+`H`+c+`V`+v+`H`+l*o:`M`+c+`,`+_+`V`+v:o?`M`+_+`,`+l*o+`V`+c+`H`+v+`V`+l*o:`M`+_+`,`+c+`H`+v),S.attr(`opacity`,1).attr(`transform`,function(e){return d(y(e)+c)}),T.attr(u+`2`,l*a),E.attr(u,l*h).text(m),b.filter(ce).attr(`fill`,`none`).attr(`font-size`,10).attr(`font-family`,`sans-serif`).attr(`text-anchor`,e===F?`start`:e===L?`end`:`middle`),b.each(function(){this.__axis=y})}return f.scale=function(e){return arguments.length?(t=e,f):t},f.ticks=function(){return n=Array.from(arguments),f},f.tickArguments=function(e){return arguments.length?(n=e==null?[]:Array.from(e),f):n.slice()},f.tickValues=function(e){return arguments.length?(r=e==null?null:Array.from(e),f):r&&r.slice()},f.tickFormat=function(e){return arguments.length?(i=e,f):i},f.tickSize=function(e){return arguments.length?(a=o=+e,f):a},f.tickSizeInner=function(e){return arguments.length?(a=+e,f):a},f.tickSizeOuter=function(e){return arguments.length?(o=+e,f):o},f.tickPadding=function(e){return arguments.length?(s=+e,f):s},f.offset=function(e){return arguments.length?(c=+e,f):c},f}function ue(e){return le(P,e)}function de(e){return le(I,e)}var fe=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_isoWeek=r()})(e,(function(){return function(e,t,n){var r=function(e){return e.add(4-e.isoWeekday(),`day`)},i=t.prototype;i.isoWeekYear=function(){return r(this).year()},i.isoWeek=function(e){if(!this.$utils().u(e))return this.add(7*(e-this.isoWeek()),`day`);var t,i,a,o,s=r(this),c=(t=this.isoWeekYear(),i=this.$u,a=(i?n.utc:n)().year(t).startOf(`year`),o=4-a.isoWeekday(),a.isoWeekday()>4&&(o+=7),a.add(o,`day`));return s.diff(c,`week`)+1},i.isoWeekday=function(e){return this.$utils().u(e)?this.day()||7:this.day(this.day()%7?e:e-7)};var a=i.startOf;i.startOf=function(e,t){var n=this.$utils(),r=!!n.u(t)||t;return n.p(e)===`isoweek`?r?this.date(this.date()-(this.isoWeekday()-1)).startOf(`day`):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf(`day`):a.bind(this)(e,t)}}}))})),pe=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_customParseFormat=r()})(e,(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`},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},c=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||={}).offset=function(e){if(!e||e===`Z`)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return n===0?0:t[0]===`+`?-n:n}(e)}],u=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?`pm`:`PM`);return n},f={A:[a,function(e){this.afternoon=d(e,!1)}],a:[a,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*e}],SS:[r,function(e){this.milliseconds=10*e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,c(`seconds`)],ss:[i,c(`seconds`)],m:[i,c(`minutes`)],mm:[i,c(`minutes`)],H:[i,c(`hours`)],h:[i,c(`hours`)],HH:[i,c(`hours`)],hh:[i,c(`hours`)],D:[i,c(`day`)],DD:[r,c(`day`)],Do:[a,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,``)===e&&(this.day=r)}],w:[i,c(`week`)],ww:[r,c(`week`)],M:[i,c(`month`)],MM:[r,c(`month`)],MMM:[a,function(e){var t=u(`months`),n=(u(`monthsShort`)||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw Error();this.month=n%12||n}],MMMM:[a,function(e){var t=u(`months`).indexOf(e)+1;if(t<1)throw Error();this.month=t%12||t}],Y:[/[+-]?\d+/,c(`year`)],YY:[r,function(e){this.year=s(e)}],YYYY:[/\d{4}/,c(`year`)],Z:l,ZZ:l};function p(n){for(var r=n,i=o&&o.formats,a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var a=r&&r.toUpperCase();return n||i[r]||e[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=a.length,c=0;c<s;c+=1){var l=a[c],u=f[l],d=u&&u[0],p=u&&u[1];a[c]=p?{regex:d,parser:p}:l.replace(/^\[|\]$/g,``)}return function(e){for(var t={},n=0,r=0;n<s;n+=1){var i=a[n];if(typeof i==`string`)r+=i.length;else{var o=i.regex,c=i.parser,l=e.slice(r),u=o.exec(l)[0];c.call(t,u),e=e.replace(u,``)}}return function(e){var t=e.afternoon;if(t!==void 0){var n=e.hours;t?n<12&&(e.hours+=12):n===12&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,a=e.args;this.$u=r;var s=a[1];if(typeof s==`string`){var c=!0===a[2],l=!0===a[3],u=c||l,d=a[2];l&&(d=a[2]),o=this.$locale(),!c&&d&&(o=n.Ls[d]),this.$d=function(e,t,n,r){try{if([`x`,`X`].indexOf(t)>-1)return new Date((t===`X`?1e3:1)*e);var i=p(t)(e),a=i.year,o=i.month,s=i.day,c=i.hours,l=i.minutes,u=i.seconds,d=i.milliseconds,f=i.zone,m=i.week,h=new Date,g=s||(a||o?1:h.getDate()),_=a||h.getFullYear(),v=0;a&&!o||(v=o>0?o-1:h.getMonth());var y,b=c||0,x=l||0,S=u||0,C=d||0;return f?new Date(Date.UTC(_,v,g,b,x,S,C+60*f.offset*1e3)):n?new Date(Date.UTC(_,v,g,b,x,S,C)):(y=new Date(_,v,g,b,x,S,C),m&&(y=r(y).week(m).toDate()),y)}catch{return new Date(``)}}(t,s,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(s)&&(this.$d=new Date(``)),o={}}else if(s instanceof Array)for(var f=s.length,m=1;m<=f;m+=1){a[1]=s[m-1];var h=n.apply(this,a);if(h.isValid()){this.$d=h.$d,this.$L=h.$L,this.init();break}m===f&&(this.$d=new Date(``))}else i.call(this,e)}}}))})),me=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_advancedFormat=r()})(e,(function(){return function(e,t){var n=t.prototype,r=n.format;n.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return r.bind(this)(e);var i=this.$utils(),a=(e||`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(e){switch(e){case`Q`:return Math.ceil((t.$M+1)/3);case`Do`:return n.ordinal(t.$D);case`gggg`:return t.weekYear();case`GGGG`:return t.isoWeekYear();case`wo`:return n.ordinal(t.week(),`W`);case`w`:case`ww`:return i.s(t.week(),e===`w`?1:2,`0`);case`W`:case`WW`:return i.s(t.isoWeek(),e===`W`?1:2,`0`);case`k`:case`kk`:return i.s(String(t.$H===0?24:t.$H),e===`k`?1:2,`0`);case`X`:return Math.floor(t.$d.getTime()/1e3);case`x`:return t.$d.getTime();case`z`:return`[`+t.offsetName()+`]`;case`zzz`:return`[`+t.offsetName(`long`)+`]`;default:return e}}));return r.bind(this)(a)}}}))})),he=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_duration=r()})(e,(function(){var e,t,n=1e3,r=6e4,i=36e5,a=864e5,o=31536e6,s=2628e6,c=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,l=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,u={years:o,months:s,days:a,hours:i,minutes:r,seconds:n,milliseconds:1,weeks:6048e5},d=function(e){return e instanceof v},f=function(e,t,n){return new v(e,n,t.$l)},p=function(e){return t.p(e)+`s`},m=function(e){return e<0},h=function(e){return m(e)?Math.ceil(e):Math.floor(e)},g=function(e){return Math.abs(e)},_=function(e,t){return e?m(e)?{negative:!0,format:``+g(e)+t}:{negative:!1,format:``+e+t}:{negative:!1,format:``}},v=function(){function m(e,t,n){var r=this;if(this.$d={},this.$l=n,e===void 0&&(this.$ms=0,this.parseFromMilliseconds()),t)return f(e*u[p(t)],this);if(typeof e==`number`)return this.$ms=e,this.parseFromMilliseconds(),this;if(typeof e==`object`)return Object.keys(e).forEach((function(t){r.$d[p(t)]=e[t]})),this.calMilliseconds(),this;if(typeof e==`string`){var i=e.match(c);if(i){var a=i.slice(2).map((function(e){return e==null?0:Number(e)}));return this.$d.years=a[0],this.$d.months=a[1],this.$d.weeks=a[2],this.$d.days=a[3],this.$d.hours=a[4],this.$d.minutes=a[5],this.$d.seconds=a[6],this.calMilliseconds(),this}}return this}var g=m.prototype;return g.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce((function(t,n){return t+(e.$d[n]||0)*u[n]}),0)},g.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=h(e/o),e%=o,this.$d.months=h(e/s),e%=s,this.$d.days=h(e/a),e%=a,this.$d.hours=h(e/i),e%=i,this.$d.minutes=h(e/r),e%=r,this.$d.seconds=h(e/n),e%=n,this.$d.milliseconds=e},g.toISOString=function(){var e=_(this.$d.years,`Y`),t=_(this.$d.months,`M`),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var r=_(n,`D`),i=_(this.$d.hours,`H`),a=_(this.$d.minutes,`M`),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var s=_(o,`S`),c=e.negative||t.negative||r.negative||i.negative||a.negative||s.negative,l=i.format||a.format||s.format?`T`:``,u=(c?`-`:``)+`P`+e.format+t.format+r.format+l+i.format+a.format+s.format;return u===`P`||u===`-P`?`P0D`:u},g.toJSON=function(){return this.toISOString()},g.format=function(e){var n=e||`YYYY-MM-DDTHH:mm:ss`,r={Y:this.$d.years,YY:t.s(this.$d.years,2,`0`),YYYY:t.s(this.$d.years,4,`0`),M:this.$d.months,MM:t.s(this.$d.months,2,`0`),D:this.$d.days,DD:t.s(this.$d.days,2,`0`),H:this.$d.hours,HH:t.s(this.$d.hours,2,`0`),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,`0`),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,`0`),SSS:t.s(this.$d.milliseconds,3,`0`)};return n.replace(l,(function(e,t){return t||String(r[e])}))},g.as=function(e){return this.$ms/u[p(e)]},g.get=function(e){var t=this.$ms,n=p(e);return n===`milliseconds`?t%=1e3:t=n===`weeks`?h(t/u[n]):this.$d[n],t||0},g.add=function(e,t,n){var r;return r=t?e*u[p(t)]:d(e)?e.$ms:f(e,this).$ms,f(this.$ms+r*(n?-1:1),this)},g.subtract=function(e,t){return this.add(e,t,!0)},g.locale=function(e){var t=this.clone();return t.$l=e,t},g.clone=function(){return f(this.$ms,this)},g.humanize=function(t){return e().add(this.$ms,`ms`).locale(this.$l).fromNow(!t)},g.valueOf=function(){return this.asMilliseconds()},g.milliseconds=function(){return this.get(`milliseconds`)},g.asMilliseconds=function(){return this.as(`milliseconds`)},g.seconds=function(){return this.get(`seconds`)},g.asSeconds=function(){return this.as(`seconds`)},g.minutes=function(){return this.get(`minutes`)},g.asMinutes=function(){return this.as(`minutes`)},g.hours=function(){return this.get(`hours`)},g.asHours=function(){return this.as(`hours`)},g.days=function(){return this.get(`days`)},g.asDays=function(){return this.as(`days`)},g.weeks=function(){return this.get(`weeks`)},g.asWeeks=function(){return this.as(`weeks`)},g.months=function(){return this.get(`months`)},g.asMonths=function(){return this.as(`months`)},g.years=function(){return this.get(`years`)},g.asYears=function(){return this.as(`years`)},m}(),y=function(e,t,n){return e.add(t.years()*n,`y`).add(t.months()*n,`M`).add(t.days()*n,`d`).add(t.hours()*n,`h`).add(t.minutes()*n,`m`).add(t.seconds()*n,`s`).add(t.milliseconds()*n,`ms`)};return function(n,r,i){e=i,t=i().$utils(),i.duration=function(e,t){return f(e,{$l:i.locale()},t)},i.isDuration=d;var a=r.prototype.add,o=r.prototype.subtract;r.prototype.add=function(e,t){return d(e)?y(this,e,1):a.bind(this)(e,t)},r.prototype.subtract=function(e,t){return d(e)?y(this,e,-1):o.bind(this)(e,t)}}}))})),ge=ne(),z=e(w(),1),_e=e(fe(),1),ve=e(pe(),1),ye=e(me(),1),be=e(he(),1),xe=(function(){var e=C(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[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],n=[1,26],r=[1,27],i=[1,28],a=[1,29],o=[1,30],s=[1,31],c=[1,32],l=[1,33],u=[1,34],d=[1,9],f=[1,10],p=[1,11],m=[1,12],h=[1,13],g=[1,14],_=[1,15],v=[1,16],y=[1,19],b=[1,20],x=[1,21],S=[1,22],w=[1,23],T=[1,25],E=[1,35],D={trace:C(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:C(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 2:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 6:case 7:this.$=[];break;case 8:r.setWeekday(`monday`);break;case 9:r.setWeekday(`tuesday`);break;case 10:r.setWeekday(`wednesday`);break;case 11:r.setWeekday(`thursday`);break;case 12:r.setWeekday(`friday`);break;case 13:r.setWeekday(`saturday`);break;case 14:r.setWeekday(`sunday`);break;case 15:r.setWeekend(`friday`);break;case 16:r.setWeekend(`saturday`);break;case 17:r.setDateFormat(a[s].substr(11)),this.$=a[s].substr(11);break;case 18:r.enableInclusiveEndDates(),this.$=a[s].substr(18);break;case 19:r.TopAxis(),this.$=a[s].substr(8);break;case 20:r.setAxisFormat(a[s].substr(11)),this.$=a[s].substr(11);break;case 21:r.setTickInterval(a[s].substr(13)),this.$=a[s].substr(13);break;case 22:r.setExcludes(a[s].substr(9)),this.$=a[s].substr(9);break;case 23:r.setIncludes(a[s].substr(9)),this.$=a[s].substr(9);break;case 24:r.setTodayMarker(a[s].substr(12)),this.$=a[s].substr(12);break;case 27:r.setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 28:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 29:case 30:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 31:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 33:r.addTask(a[s-1],a[s]),this.$=`task`;break;case 34:this.$=a[s-1],r.setClickEvent(a[s-1],a[s],null);break;case 35:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 36:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],null),r.setLink(a[s-2],a[s]);break;case 37:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-2],a[s-1]),r.setLink(a[s-3],a[s]);break;case 38:this.$=a[s-2],r.setClickEvent(a[s-2],a[s],null),r.setLink(a[s-2],a[s-1]);break;case 39:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-1],a[s]),r.setLink(a[s-3],a[s-2]);break;case 40:this.$=a[s-1],r.setLink(a[s-1],a[s]);break;case 41:case 47:this.$=a[s-1]+` `+a[s];break;case 42:case 43:case 45:this.$=a[s-2]+` `+a[s-1]+` `+a[s];break;case 44:case 46:this.$=a[s-3]+` `+a[s-2]+` `+a[s-1]+` `+a[s]}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},e(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:a,16:o,17:s,18:c,19:18,20:l,21:u,22:d,23:f,24:p,25:m,26:h,27:g,28:_,29:v,30:y,31:b,33:x,35:S,36:w,37:24,38:T,40:E},e(t,[2,7],{1:[2,1]}),e(t,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:a,16:o,17:s,18:c,19:18,20:l,21:u,22:d,23:f,24:p,25:m,26:h,27:g,28:_,29:v,30:y,31:b,33:x,35:S,36:w,37:24,38:T,40:E},e(t,[2,5]),e(t,[2,6]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,20]),e(t,[2,21]),e(t,[2,22]),e(t,[2,23]),e(t,[2,24]),e(t,[2,25]),e(t,[2,26]),e(t,[2,27]),{32:[1,37]},{34:[1,38]},e(t,[2,30]),e(t,[2,31]),e(t,[2,32]),{39:[1,39]},e(t,[2,8]),e(t,[2,9]),e(t,[2,10]),e(t,[2,11]),e(t,[2,12]),e(t,[2,13]),e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),{41:[1,40],43:[1,41]},e(t,[2,4]),e(t,[2,28]),e(t,[2,29]),e(t,[2,33]),e(t,[2,34],{42:[1,42],43:[1,43]}),e(t,[2,40],{41:[1,44]}),e(t,[2,35],{43:[1,45]}),e(t,[2,36]),e(t,[2,38],{42:[1,46]}),e(t,[2,37]),e(t,[2,39])],defaultActions:{},parseError:C(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:C(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,c=0,l=0,u=0,d=2,f=1,p=a.slice.call(arguments,1),m=Object.create(this.lexer),h={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(h.yy[g]=this.yy[g]);m.setInput(e,h.yy),h.yy.lexer=m,h.yy.parser=this,m.yylloc===void 0&&(m.yylloc={});var _=m.yylloc;a.push(_);var v=m.options&&m.options.ranges;this.parseError=typeof h.yy.parseError==`function`?h.yy.parseError:Object.getPrototypeOf(this).parseError;function y(e){n.length-=2*e,i.length-=e,a.length-=e}C(y,`popStack`);function b(){var e=r.pop()||m.lex()||f;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}C(b,`lex`);for(var x,S,w,T,E,D={},O,k,ee,A;;){if(w=n[n.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(x??=b(),T=o[w]&&o[w][x]),T===void 0||!T.length||!T[0]){var j=``;for(O in A=[],o[w])this.terminals_[O]&&O>d&&A.push(`'`+this.terminals_[O]+`'`);j=m.showPosition?`Parse error on line `+(c+1)+`:
1
+ import{a as e,t}from"./rolldown-runtime-B0Z9INg1.js";import{t as n}from"./linear-0eij_aAG.js";import{a as r,f as i,n as a,p as o}from"./time-MgToa8VM.js";import{E as s,P as c,S as l,c as u,d,f,g as p,h as m,m as h,p as g,t as _,u as v,w as y,y as b}from"./defaultLocale-D5bOh7g6.js";import{g as x}from"./chunk-75Z2AOVW-BzzYECN7.js";import{u as S}from"./src-BpnPuKEN.js";import{n as C}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{r as w,t as T}from"./src-Cyu5G-Tr.js";import{H as E,K as D,U as O,a as k,c as ee,s as A,v as j,w as M,x as N,y as te}from"./chunk-DU6HZSFF-BlpgvKzl.js";import{t as ne}from"./dist-CeoU7cfW.js";function re(e){return e}var P=1,F=2,I=3,L=4,R=1e-6;function ie(e){return`translate(`+e+`,0)`}function ae(e){return`translate(0,`+e+`)`}function oe(e){return t=>+e(t)}function se(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function ce(){return!this.__axis}function le(e,t){var n=[],r=null,i=null,a=6,o=6,s=3,c=typeof window<`u`&&window.devicePixelRatio>1?0:.5,l=e===P||e===L?-1:1,u=e===L||e===F?`x`:`y`,d=e===P||e===I?ie:ae;function f(f){var p=r??(t.ticks?t.ticks.apply(t,n):t.domain()),m=i??(t.tickFormat?t.tickFormat.apply(t,n):re),h=Math.max(a,0)+s,g=t.range(),_=+g[0]+c,v=+g[g.length-1]+c,y=(t.bandwidth?se:oe)(t.copy(),c),b=f.selection?f.selection():f,x=b.selectAll(`.domain`).data([null]),S=b.selectAll(`.tick`).data(p,t).order(),C=S.exit(),w=S.enter().append(`g`).attr(`class`,`tick`),T=S.select(`line`),E=S.select(`text`);x=x.merge(x.enter().insert(`path`,`.tick`).attr(`class`,`domain`).attr(`stroke`,`currentColor`)),S=S.merge(w),T=T.merge(w.append(`line`).attr(`stroke`,`currentColor`).attr(u+`2`,l*a)),E=E.merge(w.append(`text`).attr(`fill`,`currentColor`).attr(u,l*h).attr(`dy`,e===P?`0em`:e===I?`0.71em`:`0.32em`)),f!==b&&(x=x.transition(f),S=S.transition(f),T=T.transition(f),E=E.transition(f),C=C.transition(f).attr(`opacity`,R).attr(`transform`,function(e){return isFinite(e=y(e))?d(e+c):this.getAttribute(`transform`)}),w.attr(`opacity`,R).attr(`transform`,function(e){var t=this.parentNode.__axis;return d((t&&isFinite(t=t(e))?t:y(e))+c)})),C.remove(),x.attr(`d`,e===L||e===F?o?`M`+l*o+`,`+_+`H`+c+`V`+v+`H`+l*o:`M`+c+`,`+_+`V`+v:o?`M`+_+`,`+l*o+`V`+c+`H`+v+`V`+l*o:`M`+_+`,`+c+`H`+v),S.attr(`opacity`,1).attr(`transform`,function(e){return d(y(e)+c)}),T.attr(u+`2`,l*a),E.attr(u,l*h).text(m),b.filter(ce).attr(`fill`,`none`).attr(`font-size`,10).attr(`font-family`,`sans-serif`).attr(`text-anchor`,e===F?`start`:e===L?`end`:`middle`),b.each(function(){this.__axis=y})}return f.scale=function(e){return arguments.length?(t=e,f):t},f.ticks=function(){return n=Array.from(arguments),f},f.tickArguments=function(e){return arguments.length?(n=e==null?[]:Array.from(e),f):n.slice()},f.tickValues=function(e){return arguments.length?(r=e==null?null:Array.from(e),f):r&&r.slice()},f.tickFormat=function(e){return arguments.length?(i=e,f):i},f.tickSize=function(e){return arguments.length?(a=o=+e,f):a},f.tickSizeInner=function(e){return arguments.length?(a=+e,f):a},f.tickSizeOuter=function(e){return arguments.length?(o=+e,f):o},f.tickPadding=function(e){return arguments.length?(s=+e,f):s},f.offset=function(e){return arguments.length?(c=+e,f):c},f}function ue(e){return le(P,e)}function de(e){return le(I,e)}var fe=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_isoWeek=r()})(e,(function(){return function(e,t,n){var r=function(e){return e.add(4-e.isoWeekday(),`day`)},i=t.prototype;i.isoWeekYear=function(){return r(this).year()},i.isoWeek=function(e){if(!this.$utils().u(e))return this.add(7*(e-this.isoWeek()),`day`);var t,i,a,o,s=r(this),c=(t=this.isoWeekYear(),i=this.$u,a=(i?n.utc:n)().year(t).startOf(`year`),o=4-a.isoWeekday(),a.isoWeekday()>4&&(o+=7),a.add(o,`day`));return s.diff(c,`week`)+1},i.isoWeekday=function(e){return this.$utils().u(e)?this.day()||7:this.day(this.day()%7?e:e-7)};var a=i.startOf;i.startOf=function(e,t){var n=this.$utils(),r=!!n.u(t)||t;return n.p(e)===`isoweek`?r?this.date(this.date()-(this.isoWeekday()-1)).startOf(`day`):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf(`day`):a.bind(this)(e,t)}}}))})),pe=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_customParseFormat=r()})(e,(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`},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},c=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||={}).offset=function(e){if(!e||e===`Z`)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return n===0?0:t[0]===`+`?-n:n}(e)}],u=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?`pm`:`PM`);return n},f={A:[a,function(e){this.afternoon=d(e,!1)}],a:[a,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*e}],SS:[r,function(e){this.milliseconds=10*e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,c(`seconds`)],ss:[i,c(`seconds`)],m:[i,c(`minutes`)],mm:[i,c(`minutes`)],H:[i,c(`hours`)],h:[i,c(`hours`)],HH:[i,c(`hours`)],hh:[i,c(`hours`)],D:[i,c(`day`)],DD:[r,c(`day`)],Do:[a,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,``)===e&&(this.day=r)}],w:[i,c(`week`)],ww:[r,c(`week`)],M:[i,c(`month`)],MM:[r,c(`month`)],MMM:[a,function(e){var t=u(`months`),n=(u(`monthsShort`)||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw Error();this.month=n%12||n}],MMMM:[a,function(e){var t=u(`months`).indexOf(e)+1;if(t<1)throw Error();this.month=t%12||t}],Y:[/[+-]?\d+/,c(`year`)],YY:[r,function(e){this.year=s(e)}],YYYY:[/\d{4}/,c(`year`)],Z:l,ZZ:l};function p(n){for(var r=n,i=o&&o.formats,a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var a=r&&r.toUpperCase();return n||i[r]||e[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=a.length,c=0;c<s;c+=1){var l=a[c],u=f[l],d=u&&u[0],p=u&&u[1];a[c]=p?{regex:d,parser:p}:l.replace(/^\[|\]$/g,``)}return function(e){for(var t={},n=0,r=0;n<s;n+=1){var i=a[n];if(typeof i==`string`)r+=i.length;else{var o=i.regex,c=i.parser,l=e.slice(r),u=o.exec(l)[0];c.call(t,u),e=e.replace(u,``)}}return function(e){var t=e.afternoon;if(t!==void 0){var n=e.hours;t?n<12&&(e.hours+=12):n===12&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,a=e.args;this.$u=r;var s=a[1];if(typeof s==`string`){var c=!0===a[2],l=!0===a[3],u=c||l,d=a[2];l&&(d=a[2]),o=this.$locale(),!c&&d&&(o=n.Ls[d]),this.$d=function(e,t,n,r){try{if([`x`,`X`].indexOf(t)>-1)return new Date((t===`X`?1e3:1)*e);var i=p(t)(e),a=i.year,o=i.month,s=i.day,c=i.hours,l=i.minutes,u=i.seconds,d=i.milliseconds,f=i.zone,m=i.week,h=new Date,g=s||(a||o?1:h.getDate()),_=a||h.getFullYear(),v=0;a&&!o||(v=o>0?o-1:h.getMonth());var y,b=c||0,x=l||0,S=u||0,C=d||0;return f?new Date(Date.UTC(_,v,g,b,x,S,C+60*f.offset*1e3)):n?new Date(Date.UTC(_,v,g,b,x,S,C)):(y=new Date(_,v,g,b,x,S,C),m&&(y=r(y).week(m).toDate()),y)}catch{return new Date(``)}}(t,s,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(s)&&(this.$d=new Date(``)),o={}}else if(s instanceof Array)for(var f=s.length,m=1;m<=f;m+=1){a[1]=s[m-1];var h=n.apply(this,a);if(h.isValid()){this.$d=h.$d,this.$L=h.$L,this.init();break}m===f&&(this.$d=new Date(``))}else i.call(this,e)}}}))})),me=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_advancedFormat=r()})(e,(function(){return function(e,t){var n=t.prototype,r=n.format;n.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return r.bind(this)(e);var i=this.$utils(),a=(e||`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(e){switch(e){case`Q`:return Math.ceil((t.$M+1)/3);case`Do`:return n.ordinal(t.$D);case`gggg`:return t.weekYear();case`GGGG`:return t.isoWeekYear();case`wo`:return n.ordinal(t.week(),`W`);case`w`:case`ww`:return i.s(t.week(),e===`w`?1:2,`0`);case`W`:case`WW`:return i.s(t.isoWeek(),e===`W`?1:2,`0`);case`k`:case`kk`:return i.s(String(t.$H===0?24:t.$H),e===`k`?1:2,`0`);case`X`:return Math.floor(t.$d.getTime()/1e3);case`x`:return t.$d.getTime();case`z`:return`[`+t.offsetName()+`]`;case`zzz`:return`[`+t.offsetName(`long`)+`]`;default:return e}}));return r.bind(this)(a)}}}))})),he=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_duration=r()})(e,(function(){var e,t,n=1e3,r=6e4,i=36e5,a=864e5,o=31536e6,s=2628e6,c=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,l=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,u={years:o,months:s,days:a,hours:i,minutes:r,seconds:n,milliseconds:1,weeks:6048e5},d=function(e){return e instanceof v},f=function(e,t,n){return new v(e,n,t.$l)},p=function(e){return t.p(e)+`s`},m=function(e){return e<0},h=function(e){return m(e)?Math.ceil(e):Math.floor(e)},g=function(e){return Math.abs(e)},_=function(e,t){return e?m(e)?{negative:!0,format:``+g(e)+t}:{negative:!1,format:``+e+t}:{negative:!1,format:``}},v=function(){function m(e,t,n){var r=this;if(this.$d={},this.$l=n,e===void 0&&(this.$ms=0,this.parseFromMilliseconds()),t)return f(e*u[p(t)],this);if(typeof e==`number`)return this.$ms=e,this.parseFromMilliseconds(),this;if(typeof e==`object`)return Object.keys(e).forEach((function(t){r.$d[p(t)]=e[t]})),this.calMilliseconds(),this;if(typeof e==`string`){var i=e.match(c);if(i){var a=i.slice(2).map((function(e){return e==null?0:Number(e)}));return this.$d.years=a[0],this.$d.months=a[1],this.$d.weeks=a[2],this.$d.days=a[3],this.$d.hours=a[4],this.$d.minutes=a[5],this.$d.seconds=a[6],this.calMilliseconds(),this}}return this}var g=m.prototype;return g.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce((function(t,n){return t+(e.$d[n]||0)*u[n]}),0)},g.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=h(e/o),e%=o,this.$d.months=h(e/s),e%=s,this.$d.days=h(e/a),e%=a,this.$d.hours=h(e/i),e%=i,this.$d.minutes=h(e/r),e%=r,this.$d.seconds=h(e/n),e%=n,this.$d.milliseconds=e},g.toISOString=function(){var e=_(this.$d.years,`Y`),t=_(this.$d.months,`M`),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var r=_(n,`D`),i=_(this.$d.hours,`H`),a=_(this.$d.minutes,`M`),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var s=_(o,`S`),c=e.negative||t.negative||r.negative||i.negative||a.negative||s.negative,l=i.format||a.format||s.format?`T`:``,u=(c?`-`:``)+`P`+e.format+t.format+r.format+l+i.format+a.format+s.format;return u===`P`||u===`-P`?`P0D`:u},g.toJSON=function(){return this.toISOString()},g.format=function(e){var n=e||`YYYY-MM-DDTHH:mm:ss`,r={Y:this.$d.years,YY:t.s(this.$d.years,2,`0`),YYYY:t.s(this.$d.years,4,`0`),M:this.$d.months,MM:t.s(this.$d.months,2,`0`),D:this.$d.days,DD:t.s(this.$d.days,2,`0`),H:this.$d.hours,HH:t.s(this.$d.hours,2,`0`),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,`0`),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,`0`),SSS:t.s(this.$d.milliseconds,3,`0`)};return n.replace(l,(function(e,t){return t||String(r[e])}))},g.as=function(e){return this.$ms/u[p(e)]},g.get=function(e){var t=this.$ms,n=p(e);return n===`milliseconds`?t%=1e3:t=n===`weeks`?h(t/u[n]):this.$d[n],t||0},g.add=function(e,t,n){var r;return r=t?e*u[p(t)]:d(e)?e.$ms:f(e,this).$ms,f(this.$ms+r*(n?-1:1),this)},g.subtract=function(e,t){return this.add(e,t,!0)},g.locale=function(e){var t=this.clone();return t.$l=e,t},g.clone=function(){return f(this.$ms,this)},g.humanize=function(t){return e().add(this.$ms,`ms`).locale(this.$l).fromNow(!t)},g.valueOf=function(){return this.asMilliseconds()},g.milliseconds=function(){return this.get(`milliseconds`)},g.asMilliseconds=function(){return this.as(`milliseconds`)},g.seconds=function(){return this.get(`seconds`)},g.asSeconds=function(){return this.as(`seconds`)},g.minutes=function(){return this.get(`minutes`)},g.asMinutes=function(){return this.as(`minutes`)},g.hours=function(){return this.get(`hours`)},g.asHours=function(){return this.as(`hours`)},g.days=function(){return this.get(`days`)},g.asDays=function(){return this.as(`days`)},g.weeks=function(){return this.get(`weeks`)},g.asWeeks=function(){return this.as(`weeks`)},g.months=function(){return this.get(`months`)},g.asMonths=function(){return this.as(`months`)},g.years=function(){return this.get(`years`)},g.asYears=function(){return this.as(`years`)},m}(),y=function(e,t,n){return e.add(t.years()*n,`y`).add(t.months()*n,`M`).add(t.days()*n,`d`).add(t.hours()*n,`h`).add(t.minutes()*n,`m`).add(t.seconds()*n,`s`).add(t.milliseconds()*n,`ms`)};return function(n,r,i){e=i,t=i().$utils(),i.duration=function(e,t){return f(e,{$l:i.locale()},t)},i.isDuration=d;var a=r.prototype.add,o=r.prototype.subtract;r.prototype.add=function(e,t){return d(e)?y(this,e,1):a.bind(this)(e,t)},r.prototype.subtract=function(e,t){return d(e)?y(this,e,-1):o.bind(this)(e,t)}}}))})),ge=ne(),z=e(w(),1),_e=e(fe(),1),ve=e(pe(),1),ye=e(me(),1),be=e(he(),1),xe=(function(){var e=C(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[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],n=[1,26],r=[1,27],i=[1,28],a=[1,29],o=[1,30],s=[1,31],c=[1,32],l=[1,33],u=[1,34],d=[1,9],f=[1,10],p=[1,11],m=[1,12],h=[1,13],g=[1,14],_=[1,15],v=[1,16],y=[1,19],b=[1,20],x=[1,21],S=[1,22],w=[1,23],T=[1,25],E=[1,35],D={trace:C(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:C(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 2:this.$=[];break;case 3:a[s-1].push(a[s]),this.$=a[s-1];break;case 4:case 5:this.$=a[s];break;case 6:case 7:this.$=[];break;case 8:r.setWeekday(`monday`);break;case 9:r.setWeekday(`tuesday`);break;case 10:r.setWeekday(`wednesday`);break;case 11:r.setWeekday(`thursday`);break;case 12:r.setWeekday(`friday`);break;case 13:r.setWeekday(`saturday`);break;case 14:r.setWeekday(`sunday`);break;case 15:r.setWeekend(`friday`);break;case 16:r.setWeekend(`saturday`);break;case 17:r.setDateFormat(a[s].substr(11)),this.$=a[s].substr(11);break;case 18:r.enableInclusiveEndDates(),this.$=a[s].substr(18);break;case 19:r.TopAxis(),this.$=a[s].substr(8);break;case 20:r.setAxisFormat(a[s].substr(11)),this.$=a[s].substr(11);break;case 21:r.setTickInterval(a[s].substr(13)),this.$=a[s].substr(13);break;case 22:r.setExcludes(a[s].substr(9)),this.$=a[s].substr(9);break;case 23:r.setIncludes(a[s].substr(9)),this.$=a[s].substr(9);break;case 24:r.setTodayMarker(a[s].substr(12)),this.$=a[s].substr(12);break;case 27:r.setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 28:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 29:case 30:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 31:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 33:r.addTask(a[s-1],a[s]),this.$=`task`;break;case 34:this.$=a[s-1],r.setClickEvent(a[s-1],a[s],null);break;case 35:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],a[s]);break;case 36:this.$=a[s-2],r.setClickEvent(a[s-2],a[s-1],null),r.setLink(a[s-2],a[s]);break;case 37:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-2],a[s-1]),r.setLink(a[s-3],a[s]);break;case 38:this.$=a[s-2],r.setClickEvent(a[s-2],a[s],null),r.setLink(a[s-2],a[s-1]);break;case 39:this.$=a[s-3],r.setClickEvent(a[s-3],a[s-1],a[s]),r.setLink(a[s-3],a[s-2]);break;case 40:this.$=a[s-1],r.setLink(a[s-1],a[s]);break;case 41:case 47:this.$=a[s-1]+` `+a[s];break;case 42:case 43:case 45:this.$=a[s-2]+` `+a[s-1]+` `+a[s];break;case 44:case 46:this.$=a[s-3]+` `+a[s-2]+` `+a[s-1]+` `+a[s]}},`anonymous`),table:[{3:1,4:[1,2]},{1:[3]},e(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:i,15:a,16:o,17:s,18:c,19:18,20:l,21:u,22:d,23:f,24:p,25:m,26:h,27:g,28:_,29:v,30:y,31:b,33:x,35:S,36:w,37:24,38:T,40:E},e(t,[2,7],{1:[2,1]}),e(t,[2,3]),{9:36,11:17,12:n,13:r,14:i,15:a,16:o,17:s,18:c,19:18,20:l,21:u,22:d,23:f,24:p,25:m,26:h,27:g,28:_,29:v,30:y,31:b,33:x,35:S,36:w,37:24,38:T,40:E},e(t,[2,5]),e(t,[2,6]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,20]),e(t,[2,21]),e(t,[2,22]),e(t,[2,23]),e(t,[2,24]),e(t,[2,25]),e(t,[2,26]),e(t,[2,27]),{32:[1,37]},{34:[1,38]},e(t,[2,30]),e(t,[2,31]),e(t,[2,32]),{39:[1,39]},e(t,[2,8]),e(t,[2,9]),e(t,[2,10]),e(t,[2,11]),e(t,[2,12]),e(t,[2,13]),e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),{41:[1,40],43:[1,41]},e(t,[2,4]),e(t,[2,28]),e(t,[2,29]),e(t,[2,33]),e(t,[2,34],{42:[1,42],43:[1,43]}),e(t,[2,40],{41:[1,44]}),e(t,[2,35],{43:[1,45]}),e(t,[2,36]),e(t,[2,38],{42:[1,46]}),e(t,[2,37]),e(t,[2,39])],defaultActions:{},parseError:C(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:C(function(e){var t=this,n=[0],r=[],i=[null],a=[],o=this.table,s=``,c=0,l=0,u=0,d=2,f=1,p=a.slice.call(arguments,1),m=Object.create(this.lexer),h={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(h.yy[g]=this.yy[g]);m.setInput(e,h.yy),h.yy.lexer=m,h.yy.parser=this,m.yylloc===void 0&&(m.yylloc={});var _=m.yylloc;a.push(_);var v=m.options&&m.options.ranges;this.parseError=typeof h.yy.parseError==`function`?h.yy.parseError:Object.getPrototypeOf(this).parseError;function y(e){n.length-=2*e,i.length-=e,a.length-=e}C(y,`popStack`);function b(){var e=r.pop()||m.lex()||f;return typeof e!=`number`&&(e instanceof Array&&(r=e,e=r.pop()),e=t.symbols_[e]||e),e}C(b,`lex`);for(var x,S,w,T,E,D={},O,k,ee,A;;){if(w=n[n.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(x??=b(),T=o[w]&&o[w][x]),T===void 0||!T.length||!T[0]){var j=``;for(O in A=[],o[w])this.terminals_[O]&&O>d&&A.push(`'`+this.terminals_[O]+`'`);j=m.showPosition?`Parse error on line `+(c+1)+`:
2
2
  `+m.showPosition()+`
3
3
  Expecting `+A.join(`, `)+`, got '`+(this.terminals_[x]||x)+`'`:`Parse error on line `+(c+1)+`: Unexpected `+(x==f?`end of input`:`'`+(this.terminals_[x]||x)+`'`),this.parseError(j,{text:m.match,token:this.terminals_[x]||x,line:m.yylineno,loc:_,expected:A})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+x);switch(T[0]){case 1:n.push(x),i.push(m.yytext),a.push(m.yylloc),n.push(T[1]),x=null,S?(x=S,S=null):(l=m.yyleng,s=m.yytext,c=m.yylineno,_=m.yylloc,u>0&&u--);break;case 2:if(k=this.productions_[T[1]][1],D.$=i[i.length-k],D._$={first_line:a[a.length-(k||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(k||1)].first_column,last_column:a[a.length-1].last_column},v&&(D._$.range=[a[a.length-(k||1)].range[0],a[a.length-1].range[1]]),E=this.performAction.apply(D,[s,l,c,h.yy,T[1],i,a].concat(p)),E!==void 0)return E;k&&(n=n.slice(0,-1*k*2),i=i.slice(0,-1*k),a=a.slice(0,-1*k)),n.push(this.productions_[T[1]][0]),i.push(D.$),a.push(D._$),ee=o[n[n.length-2]][n[n.length-1]],n.push(ee);break;case 3:return!0}}return!0},`parse`)};D.lexer=(function(){return{EOF:1,parseError:C(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:C(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:C(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:C(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:C(function(){return this._more=!0,this},`more`),reject:C(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:C(function(e){this.unput(this.match.slice(e))},`less`),pastInput:C(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:C(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:C(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{g as e,i as t,m as n}from"./chunk-75Z2AOVW-DA_lihEi.js";import{u as r}from"./src-BpnPuKEN.js";import{n as i}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t as a}from"./src-Cyu5G-Tr.js";import{H as o,K as s,U as c,Y as l,a as u,b as d,f,s as p,v as m,w as h,x as g,y as _}from"./chunk-DU6HZSFF-J-califE.js";import{n as v}from"./mermaid-parser.core-3RKOfUXB.js";import{t as y}from"./chunk-JWPE2WC7-DVXcaiue.js";import{t as b}from"./chunk-2Q5K7J3B-C1jixKkw.js";var x={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},ee=f.gitGraph,S=i(()=>t({...ee,...d().gitGraph}),`getConfig`),C=new b(()=>{let e=S(),t=e.mainBranchName,n=e.mainBranchOrder;return{mainBranchName:t,commits:new Map,head:null,branchConfig:new Map([[t,{name:t,order:n}]]),branches:new Map([[t,null]]),currBranch:t,direction:`LR`,seq:0,options:{}}});function w(){return n({length:7})}i(w,`getID`);function T(e,t){let n=Object.create(null);return e.reduce((e,r)=>{let i=t(r);return n[i]||(n[i]=!0,e.push(r)),e},[])}i(T,`uniqBy`);var te=i(function(e){C.records.direction=e},`setDirection`),ne=i(function(e){a.debug(`options str`,e),e=e?.trim(),e||=`{}`;try{C.records.options=JSON.parse(e)}catch(e){a.error(`error while parsing gitGraph options`,e.message)}},`setOptions`),re=i(function(){return C.records.options},`getOptions`),ie=i(function(e){let t=e.msg,n=e.id,r=e.type,i=e.tags;a.info(`commit`,t,n,r,i),a.debug(`Entering commit:`,t,n,r,i);let o=S();n=p.sanitizeText(n,o),t=p.sanitizeText(t,o),i=i?.map(e=>p.sanitizeText(e,o));let s={id:n||C.records.seq+`-`+w(),message:t,seq:C.records.seq++,type:r??x.NORMAL,tags:i??[],parents:C.records.head==null?[]:[C.records.head.id],branch:C.records.currBranch};C.records.head=s,a.info(`main branch`,o.mainBranchName),C.records.commits.has(s.id)&&a.warn(`Commit ID ${s.id} already exists`),C.records.commits.set(s.id,s),C.records.branches.set(C.records.currBranch,s.id),a.debug(`in pushCommit `+s.id)},`commit`),ae=i(function(e){let t=e.name,n=e.order;if(t=p.sanitizeText(t,S()),C.records.branches.has(t))throw Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${t}")`);C.records.branches.set(t,C.records.head==null?null:C.records.head.id),C.records.branchConfig.set(t,{name:t,order:n}),E(t),a.debug(`in createBranch`)},`branch`),oe=i(e=>{let t=e.branch,n=e.id,r=e.type,i=e.tags,o=S();t=p.sanitizeText(t,o),n&&=p.sanitizeText(n,o);let s=C.records.branches.get(C.records.currBranch),c=C.records.branches.get(t),l=s?C.records.commits.get(s):void 0,u=c?C.records.commits.get(c):void 0;if(l&&u&&l.branch===t)throw Error(`Cannot merge branch '${t}' into itself.`);if(C.records.currBranch===t){let e=Error(`Incorrect usage of "merge". Cannot merge a branch to itself`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch abc`]},e}if(l===void 0||!l){let e=Error(`Incorrect usage of "merge". Current branch (${C.records.currBranch})has no commits`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`commit`]},e}if(!C.records.branches.has(t)){let e=Error(`Incorrect usage of "merge". Branch to be merged (`+t+`) does not exist`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch ${t}`]},e}if(u===void 0||!u){let e=Error(`Incorrect usage of "merge". Branch to be merged (`+t+`) has no commits`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`"commit"`]},e}if(l===u){let e=Error(`Incorrect usage of "merge". Both branches have same head`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch abc`]},e}if(n&&C.records.commits.has(n)){let e=Error(`Incorrect usage of "merge". Commit with id:`+n+` already exists, use different custom id`);throw e.hash={text:`merge ${t} ${n} ${r} ${i?.join(` `)}`,token:`merge ${t} ${n} ${r} ${i?.join(` `)}`,expected:[`merge ${t} ${n}_UNIQUE ${r} ${i?.join(` `)}`]},e}let d=c||``,f={id:n||`${C.records.seq}-${w()}`,message:`merged branch ${t} into ${C.records.currBranch}`,seq:C.records.seq++,parents:C.records.head==null?[]:[C.records.head.id,d],branch:C.records.currBranch,type:x.MERGE,customType:r,customId:!!n,tags:i??[]};C.records.head=f,C.records.commits.set(f.id,f),C.records.branches.set(C.records.currBranch,f.id),a.debug(C.records.branches),a.debug(`in mergeBranch`)},`merge`),se=i(function(e){let t=e.id,n=e.targetId,r=e.tags,i=e.parent;a.debug(`Entering cherryPick:`,t,n,r);let o=S();if(t=p.sanitizeText(t,o),n=p.sanitizeText(n,o),r=r?.map(e=>p.sanitizeText(e,o)),i=p.sanitizeText(i,o),!t||!C.records.commits.has(t)){let e=Error(`Incorrect usage of "cherryPick". Source commit id should exist and provided`);throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:[`cherry-pick abc`]},e}let s=C.records.commits.get(t);if(s===void 0||!s)throw Error(`Incorrect usage of "cherryPick". Source commit id should exist and provided`);if(i&&!(Array.isArray(s.parents)&&s.parents.includes(i)))throw Error(`Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.`);let c=s.branch;if(s.type===x.MERGE&&!i)throw Error(`Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.`);if(!n||!C.records.commits.has(n)){if(c===C.records.currBranch){let e=Error(`Incorrect usage of "cherryPick". Source commit is already on current branch`);throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:[`cherry-pick abc`]},e}let e=C.records.branches.get(C.records.currBranch);if(e===void 0||!e){let e=Error(`Incorrect usage of "cherry-pick". Current branch (${C.records.currBranch})has no commits`);throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:[`cherry-pick abc`]},e}let o=C.records.commits.get(e);if(o===void 0||!o){let e=Error(`Incorrect usage of "cherry-pick". Current branch (${C.records.currBranch})has no commits`);throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:[`cherry-pick abc`]},e}let l={id:C.records.seq+`-`+w(),message:`cherry-picked ${s?.message} into ${C.records.currBranch}`,seq:C.records.seq++,parents:C.records.head==null?[]:[C.records.head.id,s.id],branch:C.records.currBranch,type:x.CHERRY_PICK,tags:r?r.filter(Boolean):[`cherry-pick:${s.id}${s.type===x.MERGE?`|parent:${i}`:``}`]};C.records.head=l,C.records.commits.set(l.id,l),C.records.branches.set(C.records.currBranch,l.id),a.debug(C.records.branches),a.debug(`in cherryPick`)}},`cherryPick`),E=i(function(e){if(e=p.sanitizeText(e,S()),C.records.branches.has(e)){C.records.currBranch=e;let t=C.records.branches.get(C.records.currBranch);t===void 0||!t?C.records.head=null:C.records.head=C.records.commits.get(t)??null}else{let t=Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw t.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},t}},`checkout`);function D(e,t,n){let r=e.indexOf(t);r===-1?e.push(n):e.splice(r,1,n)}i(D,`upsert`);function O(e){let t=e.reduce((e,t)=>e.seq>t.seq?e:t,e[0]),n=``;e.forEach(function(e){n+=e===t?` *`:` |`});let r=[n,t.id,t.seq];for(let e in C.records.branches)C.records.branches.get(e)===t.id&&r.push(e);if(a.debug(r.join(` `)),t.parents&&t.parents.length==2&&t.parents[0]&&t.parents[1]){let n=C.records.commits.get(t.parents[0]);D(e,t,n),t.parents[1]&&e.push(C.records.commits.get(t.parents[1]))}else if(t.parents.length==0)return;else if(t.parents[0]){let n=C.records.commits.get(t.parents[0]);D(e,t,n)}e=T(e,e=>e.id),O(e)}i(O,`prettyPrintCommitHistory`);var ce=i(function(){a.debug(C.records.commits);let e=k()[0];O([e])},`prettyPrint`),le=i(function(){C.reset(),u()},`clear`),ue=i(function(){return[...C.records.branchConfig.values()].map((e,t)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${t}`)}).sort((e,t)=>(e.order??0)-(t.order??0)).map(({name:e})=>({name:e}))},`getBranchesAsObjArray`),de=i(function(){return C.records.branches},`getBranches`),fe=i(function(){return C.records.commits},`getCommits`),k=i(function(){let e=[...C.records.commits.values()];return e.forEach(function(e){a.debug(e.id)}),e.sort((e,t)=>e.seq-t.seq),e},`getCommitsArray`),A={commitType:x,getConfig:S,setDirection:te,setOptions:ne,getOptions:re,commit:ie,branch:ae,merge:oe,cherryPick:se,checkout:E,prettyPrint:ce,clear:le,getBranchesAsObjArray:ue,getBranches:de,getCommits:fe,getCommitsArray:k,getCurrentBranch:i(function(){return C.records.currBranch},`getCurrentBranch`),getDirection:i(function(){return C.records.direction},`getDirection`),getHead:i(function(){return C.records.head},`getHead`),setAccTitle:c,getAccTitle:_,getAccDescription:m,setAccDescription:o,setDiagramTitle:s,getDiagramTitle:h},pe=i((e,t)=>{y(e,t),e.dir&&t.setDirection(e.dir);for(let n of e.statements)me(n,t)},`populate`),me=i((e,t)=>{let n={Commit:i(e=>t.commit(he(e)),`Commit`),Branch:i(e=>t.branch(ge(e)),`Branch`),Merge:i(e=>t.merge(_e(e)),`Merge`),Checkout:i(e=>t.checkout(ve(e)),`Checkout`),CherryPicking:i(e=>t.cherryPick(ye(e)),`CherryPicking`)}[e.$type];n?n(e):a.error(`Unknown statement type: ${e.$type}`)},`parseStatement`),he=i(e=>({id:e.id,msg:e.message??``,type:e.type===void 0?x.NORMAL:x[e.type],tags:e.tags??void 0}),`parseCommit`),ge=i(e=>({name:e.name,order:e.order??0}),`parseBranch`),_e=i(e=>({branch:e.branch,id:e.id??``,type:e.type===void 0?void 0:x[e.type],tags:e.tags??void 0}),`parseMerge`),ve=i(e=>e.branch,`parseCheckout`),ye=i(e=>({id:e.id,targetId:``,tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),`parseCherryPicking`),be={parse:i(async e=>{let t=await v(`gitGraph`,e);a.debug(t),pe(t,A)},`parse`)},j=10,M=40,N=4,P=2,F=8,I=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`]),L=12,R=new Set([`redux-color`,`redux-dark-color`]),xe=new Set([`dark`,`redux-dark`,`redux-dark-color`,`neo-dark`]),z=i((e,t,n=!1)=>n&&e>0?(e-1)%(t-1)+1:e%t,`calcColorIndex`),B=new Map,V=new Map,H=30,U=new Map,W=[],G=0,K=`LR`,q=i(()=>{B.clear(),V.clear(),U.clear(),G=0,W=[],K=`LR`},`clear`),J=i(e=>{let t=document.createElementNS(`http://www.w3.org/2000/svg`,`text`);return(typeof e==`string`?e.split(/\\n|\n|<br\s*\/?>/gi):e).forEach(e=>{let n=document.createElementNS(`http://www.w3.org/2000/svg`,`tspan`);n.setAttributeNS(`http://www.w3.org/XML/1998/namespace`,`xml:space`,`preserve`),n.setAttribute(`dy`,`1em`),n.setAttribute(`x`,`0`),n.setAttribute(`class`,`row`),n.textContent=e.trim(),t.appendChild(n)}),t},`drawText`),Y=i(e=>{let t,n,r;return K===`BT`?(n=i((e,t)=>e<=t,`comparisonFunc`),r=1/0):(n=i((e,t)=>e>=t,`comparisonFunc`),r=0),e.forEach(e=>{let i=K===`TB`||K==`BT`?V.get(e)?.y:V.get(e)?.x;i!==void 0&&n(i,r)&&(t=e,r=i)}),t},`findClosestParent`),Se=i(e=>{let t=``,n=1/0;return e.forEach(e=>{let r=V.get(e).y;r<=n&&(t=e,n=r)}),t||void 0},`findClosestParentBT`),Ce=i((e,t,n)=>{let r=n,i=n,a=[];e.forEach(e=>{let n=t.get(e);if(!n)throw Error(`Commit not found for key ${e}`);n.parents.length?(r=Te(n),i=Math.max(r,i)):a.push(n),Ee(n,r)}),r=i,a.forEach(e=>{De(e,r,n)}),e.forEach(e=>{let n=t.get(e);if(n?.parents.length){let e=Se(n.parents);r=V.get(e).y-M,r<=i&&(i=r);let t=B.get(n.branch).pos,a=r-j;V.set(n.id,{x:t,y:a})}})},`setParallelBTPos`),we=i(e=>{let t=Y(e.parents.filter(e=>e!==null));if(!t)throw Error(`Closest parent not found for commit ${e.id}`);let n=V.get(t)?.y;if(n===void 0)throw Error(`Closest parent position not found for commit ${e.id}`);return n},`findClosestParentPos`),Te=i(e=>we(e)+M,`calculateCommitPosition`),Ee=i((e,t)=>{let n=B.get(e.branch);if(!n)throw Error(`Branch not found for commit ${e.id}`);let r=n.pos,i=t+j;return V.set(e.id,{x:r,y:i}),{x:r,y:i}},`setCommitPosition`),De=i((e,t,n)=>{let r=B.get(e.branch);if(!r)throw Error(`Branch not found for commit ${e.id}`);let i=t+n,a=r.pos;V.set(e.id,{x:a,y:i})},`setRootPosition`),Oe=i((e,t,n,r,i,a)=>{let{theme:o}=g(),s=I.has(o??``),c=R.has(o??``),l=xe.has(o??``);if(a===x.HIGHLIGHT)e.append(`rect`).attr(`x`,n.x-10+(s?3:0)).attr(`y`,n.y-10+(s?3:0)).attr(`width`,s?14:20).attr(`height`,s?14:20).attr(`class`,`commit ${t.id} commit-highlight${z(i,F,c)} ${r}-outer`),e.append(`rect`).attr(`x`,n.x-6+(s?2:0)).attr(`y`,n.y-6+(s?2:0)).attr(`width`,s?8:12).attr(`height`,s?8:12).attr(`class`,`commit ${t.id} commit${z(i,F,c)} ${r}-inner`);else if(a===x.CHERRY_PICK)e.append(`circle`).attr(`cx`,n.x).attr(`cy`,n.y).attr(`r`,s?7:10).attr(`class`,`commit ${t.id} ${r}`),e.append(`circle`).attr(`cx`,n.x-3).attr(`cy`,n.y+2).attr(`r`,s?2.5:2.75).attr(`fill`,l?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`),e.append(`circle`).attr(`cx`,n.x+3).attr(`cy`,n.y+2).attr(`r`,s?2.5:2.75).attr(`fill`,l?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`),e.append(`line`).attr(`x1`,n.x+3).attr(`y1`,n.y+1).attr(`x2`,n.x).attr(`y2`,n.y-5).attr(`stroke`,l?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`),e.append(`line`).attr(`x1`,n.x-3).attr(`y1`,n.y+1).attr(`x2`,n.x).attr(`y2`,n.y-5).attr(`stroke`,l?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`);else{let o=e.append(`circle`);if(o.attr(`cx`,n.x),o.attr(`cy`,n.y),o.attr(`r`,s?7:10),o.attr(`class`,`commit ${t.id} commit${z(i,F,c)}`),a===x.MERGE){let a=e.append(`circle`);a.attr(`cx`,n.x),a.attr(`cy`,n.y),a.attr(`r`,s?5:6),a.attr(`class`,`commit ${r} ${t.id} commit${z(i,F,c)}`)}if(a===x.REVERSE){let a=e.append(`path`),o=s?4:5;a.attr(`d`,`M ${n.x-o},${n.y-o}L${n.x+o},${n.y+o}M${n.x-o},${n.y+o}L${n.x+o},${n.y-o}`).attr(`class`,`commit ${r} ${t.id} commit${z(i,F,c)}`)}}},`drawCommitBullet`),ke=i((e,t,n,r,i)=>{if(t.type!==x.CHERRY_PICK&&(t.customId&&t.type===x.MERGE||t.type!==x.MERGE)&&i.showCommitLabel){let a=e.append(`g`),o=a.insert(`rect`).attr(`class`,`commit-label-bkg`),s=a.append(`text`).attr(`x`,r).attr(`y`,n.y+25).attr(`class`,`commit-label`).text(t.id),c=s.node()?.getBBox();if(c&&(o.attr(`x`,n.posWithOffset-c.width/2-P).attr(`y`,n.y+13.5).attr(`width`,c.width+2*P).attr(`height`,c.height+2*P),K===`TB`||K===`BT`?(o.attr(`x`,n.x-(c.width+4*N+5)).attr(`y`,n.y-12),s.attr(`x`,n.x-(c.width+4*N)).attr(`y`,n.y+c.height-12)):s.attr(`x`,n.posWithOffset-c.width/2),i.rotateCommitLabel)){if(K===`TB`||K===`BT`)s.attr(`transform`,`rotate(-45, `+n.x+`, `+n.y+`)`),o.attr(`transform`,`rotate(-45, `+n.x+`, `+n.y+`)`);else{let e=-7.5-(c.width+10)/25*9.5,t=10+c.width/25*8.5;a.attr(`transform`,`translate(`+e+`, `+t+`) rotate(-45, `+r+`, `+n.y+`)`)}}}},`drawCommitLabel`),Ae=i((e,t,n,r)=>{if(t.tags.length>0){let i=0,a=0,o=0,s=[];for(let r of t.tags.reverse()){let t=e.insert(`polygon`),c=e.append(`circle`),l=e.append(`text`).attr(`y`,n.y-16-i).attr(`class`,`tag-label`).text(r),u=l.node()?.getBBox();if(!u)throw Error(`Tag bbox not found`);a=Math.max(a,u.width),o=Math.max(o,u.height),l.attr(`x`,n.posWithOffset-u.width/2),s.push({tag:l,hole:c,rect:t,yOffset:i}),i+=20}for(let{tag:e,hole:t,rect:i,yOffset:c}of s){let s=o/2,l=n.y-19.2-c;if(i.attr(`class`,`tag-label-bkg`).attr(`points`,`
1
+ import{g as e,i as t,m as n}from"./chunk-75Z2AOVW-BzzYECN7.js";import{u as r}from"./src-BpnPuKEN.js";import{n as i}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{t as a}from"./src-Cyu5G-Tr.js";import{H as o,K as s,U as c,Y as l,a as u,b as d,f,s as p,v as m,w as h,x as g,y as _}from"./chunk-DU6HZSFF-BlpgvKzl.js";import{n as v}from"./mermaid-parser.core-3RKOfUXB.js";import{t as y}from"./chunk-JWPE2WC7-DVXcaiue.js";import{t as b}from"./chunk-2Q5K7J3B-C1jixKkw.js";var x={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},ee=f.gitGraph,S=i(()=>t({...ee,...d().gitGraph}),`getConfig`),C=new b(()=>{let e=S(),t=e.mainBranchName,n=e.mainBranchOrder;return{mainBranchName:t,commits:new Map,head:null,branchConfig:new Map([[t,{name:t,order:n}]]),branches:new Map([[t,null]]),currBranch:t,direction:`LR`,seq:0,options:{}}});function w(){return n({length:7})}i(w,`getID`);function T(e,t){let n=Object.create(null);return e.reduce((e,r)=>{let i=t(r);return n[i]||(n[i]=!0,e.push(r)),e},[])}i(T,`uniqBy`);var te=i(function(e){C.records.direction=e},`setDirection`),ne=i(function(e){a.debug(`options str`,e),e=e?.trim(),e||=`{}`;try{C.records.options=JSON.parse(e)}catch(e){a.error(`error while parsing gitGraph options`,e.message)}},`setOptions`),re=i(function(){return C.records.options},`getOptions`),ie=i(function(e){let t=e.msg,n=e.id,r=e.type,i=e.tags;a.info(`commit`,t,n,r,i),a.debug(`Entering commit:`,t,n,r,i);let o=S();n=p.sanitizeText(n,o),t=p.sanitizeText(t,o),i=i?.map(e=>p.sanitizeText(e,o));let s={id:n||C.records.seq+`-`+w(),message:t,seq:C.records.seq++,type:r??x.NORMAL,tags:i??[],parents:C.records.head==null?[]:[C.records.head.id],branch:C.records.currBranch};C.records.head=s,a.info(`main branch`,o.mainBranchName),C.records.commits.has(s.id)&&a.warn(`Commit ID ${s.id} already exists`),C.records.commits.set(s.id,s),C.records.branches.set(C.records.currBranch,s.id),a.debug(`in pushCommit `+s.id)},`commit`),ae=i(function(e){let t=e.name,n=e.order;if(t=p.sanitizeText(t,S()),C.records.branches.has(t))throw Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${t}")`);C.records.branches.set(t,C.records.head==null?null:C.records.head.id),C.records.branchConfig.set(t,{name:t,order:n}),E(t),a.debug(`in createBranch`)},`branch`),oe=i(e=>{let t=e.branch,n=e.id,r=e.type,i=e.tags,o=S();t=p.sanitizeText(t,o),n&&=p.sanitizeText(n,o);let s=C.records.branches.get(C.records.currBranch),c=C.records.branches.get(t),l=s?C.records.commits.get(s):void 0,u=c?C.records.commits.get(c):void 0;if(l&&u&&l.branch===t)throw Error(`Cannot merge branch '${t}' into itself.`);if(C.records.currBranch===t){let e=Error(`Incorrect usage of "merge". Cannot merge a branch to itself`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch abc`]},e}if(l===void 0||!l){let e=Error(`Incorrect usage of "merge". Current branch (${C.records.currBranch})has no commits`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`commit`]},e}if(!C.records.branches.has(t)){let e=Error(`Incorrect usage of "merge". Branch to be merged (`+t+`) does not exist`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch ${t}`]},e}if(u===void 0||!u){let e=Error(`Incorrect usage of "merge". Branch to be merged (`+t+`) has no commits`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`"commit"`]},e}if(l===u){let e=Error(`Incorrect usage of "merge". Both branches have same head`);throw e.hash={text:`merge ${t}`,token:`merge ${t}`,expected:[`branch abc`]},e}if(n&&C.records.commits.has(n)){let e=Error(`Incorrect usage of "merge". Commit with id:`+n+` already exists, use different custom id`);throw e.hash={text:`merge ${t} ${n} ${r} ${i?.join(` `)}`,token:`merge ${t} ${n} ${r} ${i?.join(` `)}`,expected:[`merge ${t} ${n}_UNIQUE ${r} ${i?.join(` `)}`]},e}let d=c||``,f={id:n||`${C.records.seq}-${w()}`,message:`merged branch ${t} into ${C.records.currBranch}`,seq:C.records.seq++,parents:C.records.head==null?[]:[C.records.head.id,d],branch:C.records.currBranch,type:x.MERGE,customType:r,customId:!!n,tags:i??[]};C.records.head=f,C.records.commits.set(f.id,f),C.records.branches.set(C.records.currBranch,f.id),a.debug(C.records.branches),a.debug(`in mergeBranch`)},`merge`),se=i(function(e){let t=e.id,n=e.targetId,r=e.tags,i=e.parent;a.debug(`Entering cherryPick:`,t,n,r);let o=S();if(t=p.sanitizeText(t,o),n=p.sanitizeText(n,o),r=r?.map(e=>p.sanitizeText(e,o)),i=p.sanitizeText(i,o),!t||!C.records.commits.has(t)){let e=Error(`Incorrect usage of "cherryPick". Source commit id should exist and provided`);throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:[`cherry-pick abc`]},e}let s=C.records.commits.get(t);if(s===void 0||!s)throw Error(`Incorrect usage of "cherryPick". Source commit id should exist and provided`);if(i&&!(Array.isArray(s.parents)&&s.parents.includes(i)))throw Error(`Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.`);let c=s.branch;if(s.type===x.MERGE&&!i)throw Error(`Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.`);if(!n||!C.records.commits.has(n)){if(c===C.records.currBranch){let e=Error(`Incorrect usage of "cherryPick". Source commit is already on current branch`);throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:[`cherry-pick abc`]},e}let e=C.records.branches.get(C.records.currBranch);if(e===void 0||!e){let e=Error(`Incorrect usage of "cherry-pick". Current branch (${C.records.currBranch})has no commits`);throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:[`cherry-pick abc`]},e}let o=C.records.commits.get(e);if(o===void 0||!o){let e=Error(`Incorrect usage of "cherry-pick". Current branch (${C.records.currBranch})has no commits`);throw e.hash={text:`cherryPick ${t} ${n}`,token:`cherryPick ${t} ${n}`,expected:[`cherry-pick abc`]},e}let l={id:C.records.seq+`-`+w(),message:`cherry-picked ${s?.message} into ${C.records.currBranch}`,seq:C.records.seq++,parents:C.records.head==null?[]:[C.records.head.id,s.id],branch:C.records.currBranch,type:x.CHERRY_PICK,tags:r?r.filter(Boolean):[`cherry-pick:${s.id}${s.type===x.MERGE?`|parent:${i}`:``}`]};C.records.head=l,C.records.commits.set(l.id,l),C.records.branches.set(C.records.currBranch,l.id),a.debug(C.records.branches),a.debug(`in cherryPick`)}},`cherryPick`),E=i(function(e){if(e=p.sanitizeText(e,S()),C.records.branches.has(e)){C.records.currBranch=e;let t=C.records.branches.get(C.records.currBranch);t===void 0||!t?C.records.head=null:C.records.head=C.records.commits.get(t)??null}else{let t=Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${e}")`);throw t.hash={text:`checkout ${e}`,token:`checkout ${e}`,expected:[`branch ${e}`]},t}},`checkout`);function D(e,t,n){let r=e.indexOf(t);r===-1?e.push(n):e.splice(r,1,n)}i(D,`upsert`);function O(e){let t=e.reduce((e,t)=>e.seq>t.seq?e:t,e[0]),n=``;e.forEach(function(e){n+=e===t?` *`:` |`});let r=[n,t.id,t.seq];for(let e in C.records.branches)C.records.branches.get(e)===t.id&&r.push(e);if(a.debug(r.join(` `)),t.parents&&t.parents.length==2&&t.parents[0]&&t.parents[1]){let n=C.records.commits.get(t.parents[0]);D(e,t,n),t.parents[1]&&e.push(C.records.commits.get(t.parents[1]))}else if(t.parents.length==0)return;else if(t.parents[0]){let n=C.records.commits.get(t.parents[0]);D(e,t,n)}e=T(e,e=>e.id),O(e)}i(O,`prettyPrintCommitHistory`);var ce=i(function(){a.debug(C.records.commits);let e=k()[0];O([e])},`prettyPrint`),le=i(function(){C.reset(),u()},`clear`),ue=i(function(){return[...C.records.branchConfig.values()].map((e,t)=>e.order!==null&&e.order!==void 0?e:{...e,order:parseFloat(`0.${t}`)}).sort((e,t)=>(e.order??0)-(t.order??0)).map(({name:e})=>({name:e}))},`getBranchesAsObjArray`),de=i(function(){return C.records.branches},`getBranches`),fe=i(function(){return C.records.commits},`getCommits`),k=i(function(){let e=[...C.records.commits.values()];return e.forEach(function(e){a.debug(e.id)}),e.sort((e,t)=>e.seq-t.seq),e},`getCommitsArray`),A={commitType:x,getConfig:S,setDirection:te,setOptions:ne,getOptions:re,commit:ie,branch:ae,merge:oe,cherryPick:se,checkout:E,prettyPrint:ce,clear:le,getBranchesAsObjArray:ue,getBranches:de,getCommits:fe,getCommitsArray:k,getCurrentBranch:i(function(){return C.records.currBranch},`getCurrentBranch`),getDirection:i(function(){return C.records.direction},`getDirection`),getHead:i(function(){return C.records.head},`getHead`),setAccTitle:c,getAccTitle:_,getAccDescription:m,setAccDescription:o,setDiagramTitle:s,getDiagramTitle:h},pe=i((e,t)=>{y(e,t),e.dir&&t.setDirection(e.dir);for(let n of e.statements)me(n,t)},`populate`),me=i((e,t)=>{let n={Commit:i(e=>t.commit(he(e)),`Commit`),Branch:i(e=>t.branch(ge(e)),`Branch`),Merge:i(e=>t.merge(_e(e)),`Merge`),Checkout:i(e=>t.checkout(ve(e)),`Checkout`),CherryPicking:i(e=>t.cherryPick(ye(e)),`CherryPicking`)}[e.$type];n?n(e):a.error(`Unknown statement type: ${e.$type}`)},`parseStatement`),he=i(e=>({id:e.id,msg:e.message??``,type:e.type===void 0?x.NORMAL:x[e.type],tags:e.tags??void 0}),`parseCommit`),ge=i(e=>({name:e.name,order:e.order??0}),`parseBranch`),_e=i(e=>({branch:e.branch,id:e.id??``,type:e.type===void 0?void 0:x[e.type],tags:e.tags??void 0}),`parseMerge`),ve=i(e=>e.branch,`parseCheckout`),ye=i(e=>({id:e.id,targetId:``,tags:e.tags?.length===0?void 0:e.tags,parent:e.parent}),`parseCherryPicking`),be={parse:i(async e=>{let t=await v(`gitGraph`,e);a.debug(t),pe(t,A)},`parse`)},j=10,M=40,N=4,P=2,F=8,I=new Set([`redux`,`redux-dark`,`redux-color`,`redux-dark-color`]),L=12,R=new Set([`redux-color`,`redux-dark-color`]),xe=new Set([`dark`,`redux-dark`,`redux-dark-color`,`neo-dark`]),z=i((e,t,n=!1)=>n&&e>0?(e-1)%(t-1)+1:e%t,`calcColorIndex`),B=new Map,V=new Map,H=30,U=new Map,W=[],G=0,K=`LR`,q=i(()=>{B.clear(),V.clear(),U.clear(),G=0,W=[],K=`LR`},`clear`),J=i(e=>{let t=document.createElementNS(`http://www.w3.org/2000/svg`,`text`);return(typeof e==`string`?e.split(/\\n|\n|<br\s*\/?>/gi):e).forEach(e=>{let n=document.createElementNS(`http://www.w3.org/2000/svg`,`tspan`);n.setAttributeNS(`http://www.w3.org/XML/1998/namespace`,`xml:space`,`preserve`),n.setAttribute(`dy`,`1em`),n.setAttribute(`x`,`0`),n.setAttribute(`class`,`row`),n.textContent=e.trim(),t.appendChild(n)}),t},`drawText`),Y=i(e=>{let t,n,r;return K===`BT`?(n=i((e,t)=>e<=t,`comparisonFunc`),r=1/0):(n=i((e,t)=>e>=t,`comparisonFunc`),r=0),e.forEach(e=>{let i=K===`TB`||K==`BT`?V.get(e)?.y:V.get(e)?.x;i!==void 0&&n(i,r)&&(t=e,r=i)}),t},`findClosestParent`),Se=i(e=>{let t=``,n=1/0;return e.forEach(e=>{let r=V.get(e).y;r<=n&&(t=e,n=r)}),t||void 0},`findClosestParentBT`),Ce=i((e,t,n)=>{let r=n,i=n,a=[];e.forEach(e=>{let n=t.get(e);if(!n)throw Error(`Commit not found for key ${e}`);n.parents.length?(r=Te(n),i=Math.max(r,i)):a.push(n),Ee(n,r)}),r=i,a.forEach(e=>{De(e,r,n)}),e.forEach(e=>{let n=t.get(e);if(n?.parents.length){let e=Se(n.parents);r=V.get(e).y-M,r<=i&&(i=r);let t=B.get(n.branch).pos,a=r-j;V.set(n.id,{x:t,y:a})}})},`setParallelBTPos`),we=i(e=>{let t=Y(e.parents.filter(e=>e!==null));if(!t)throw Error(`Closest parent not found for commit ${e.id}`);let n=V.get(t)?.y;if(n===void 0)throw Error(`Closest parent position not found for commit ${e.id}`);return n},`findClosestParentPos`),Te=i(e=>we(e)+M,`calculateCommitPosition`),Ee=i((e,t)=>{let n=B.get(e.branch);if(!n)throw Error(`Branch not found for commit ${e.id}`);let r=n.pos,i=t+j;return V.set(e.id,{x:r,y:i}),{x:r,y:i}},`setCommitPosition`),De=i((e,t,n)=>{let r=B.get(e.branch);if(!r)throw Error(`Branch not found for commit ${e.id}`);let i=t+n,a=r.pos;V.set(e.id,{x:a,y:i})},`setRootPosition`),Oe=i((e,t,n,r,i,a)=>{let{theme:o}=g(),s=I.has(o??``),c=R.has(o??``),l=xe.has(o??``);if(a===x.HIGHLIGHT)e.append(`rect`).attr(`x`,n.x-10+(s?3:0)).attr(`y`,n.y-10+(s?3:0)).attr(`width`,s?14:20).attr(`height`,s?14:20).attr(`class`,`commit ${t.id} commit-highlight${z(i,F,c)} ${r}-outer`),e.append(`rect`).attr(`x`,n.x-6+(s?2:0)).attr(`y`,n.y-6+(s?2:0)).attr(`width`,s?8:12).attr(`height`,s?8:12).attr(`class`,`commit ${t.id} commit${z(i,F,c)} ${r}-inner`);else if(a===x.CHERRY_PICK)e.append(`circle`).attr(`cx`,n.x).attr(`cy`,n.y).attr(`r`,s?7:10).attr(`class`,`commit ${t.id} ${r}`),e.append(`circle`).attr(`cx`,n.x-3).attr(`cy`,n.y+2).attr(`r`,s?2.5:2.75).attr(`fill`,l?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`),e.append(`circle`).attr(`cx`,n.x+3).attr(`cy`,n.y+2).attr(`r`,s?2.5:2.75).attr(`fill`,l?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`),e.append(`line`).attr(`x1`,n.x+3).attr(`y1`,n.y+1).attr(`x2`,n.x).attr(`y2`,n.y-5).attr(`stroke`,l?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`),e.append(`line`).attr(`x1`,n.x-3).attr(`y1`,n.y+1).attr(`x2`,n.x).attr(`y2`,n.y-5).attr(`stroke`,l?`#000000`:`#fff`).attr(`class`,`commit ${t.id} ${r}`);else{let o=e.append(`circle`);if(o.attr(`cx`,n.x),o.attr(`cy`,n.y),o.attr(`r`,s?7:10),o.attr(`class`,`commit ${t.id} commit${z(i,F,c)}`),a===x.MERGE){let a=e.append(`circle`);a.attr(`cx`,n.x),a.attr(`cy`,n.y),a.attr(`r`,s?5:6),a.attr(`class`,`commit ${r} ${t.id} commit${z(i,F,c)}`)}if(a===x.REVERSE){let a=e.append(`path`),o=s?4:5;a.attr(`d`,`M ${n.x-o},${n.y-o}L${n.x+o},${n.y+o}M${n.x-o},${n.y+o}L${n.x+o},${n.y-o}`).attr(`class`,`commit ${r} ${t.id} commit${z(i,F,c)}`)}}},`drawCommitBullet`),ke=i((e,t,n,r,i)=>{if(t.type!==x.CHERRY_PICK&&(t.customId&&t.type===x.MERGE||t.type!==x.MERGE)&&i.showCommitLabel){let a=e.append(`g`),o=a.insert(`rect`).attr(`class`,`commit-label-bkg`),s=a.append(`text`).attr(`x`,r).attr(`y`,n.y+25).attr(`class`,`commit-label`).text(t.id),c=s.node()?.getBBox();if(c&&(o.attr(`x`,n.posWithOffset-c.width/2-P).attr(`y`,n.y+13.5).attr(`width`,c.width+2*P).attr(`height`,c.height+2*P),K===`TB`||K===`BT`?(o.attr(`x`,n.x-(c.width+4*N+5)).attr(`y`,n.y-12),s.attr(`x`,n.x-(c.width+4*N)).attr(`y`,n.y+c.height-12)):s.attr(`x`,n.posWithOffset-c.width/2),i.rotateCommitLabel)){if(K===`TB`||K===`BT`)s.attr(`transform`,`rotate(-45, `+n.x+`, `+n.y+`)`),o.attr(`transform`,`rotate(-45, `+n.x+`, `+n.y+`)`);else{let e=-7.5-(c.width+10)/25*9.5,t=10+c.width/25*8.5;a.attr(`transform`,`translate(`+e+`, `+t+`) rotate(-45, `+r+`, `+n.y+`)`)}}}},`drawCommitLabel`),Ae=i((e,t,n,r)=>{if(t.tags.length>0){let i=0,a=0,o=0,s=[];for(let r of t.tags.reverse()){let t=e.insert(`polygon`),c=e.append(`circle`),l=e.append(`text`).attr(`y`,n.y-16-i).attr(`class`,`tag-label`).text(r),u=l.node()?.getBBox();if(!u)throw Error(`Tag bbox not found`);a=Math.max(a,u.width),o=Math.max(o,u.height),l.attr(`x`,n.posWithOffset-u.width/2),s.push({tag:l,hole:c,rect:t,yOffset:i}),i+=20}for(let{tag:e,hole:t,rect:i,yOffset:c}of s){let s=o/2,l=n.y-19.2-c;if(i.attr(`class`,`tag-label-bkg`).attr(`points`,`
2
2
  ${r-a/2-N/2},${l+P}
3
3
  ${r-a/2-N/2},${l-P}
4
4
  ${n.posWithOffset-a/2-N},${l-s-P}