@marimo-team/frontend 0.24.1-dev80 → 0.24.1-dev82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/dist/assets/{CellStatus-DMQfH9wD.js → CellStatus-GcHBZKLm.js} +1 -1
  2. package/dist/assets/{JsonOutput-B7sDhGzR.js → JsonOutput-CUJlEdsN.js} +8 -8
  3. package/dist/assets/{MarimoErrorOutput-C0vk393J.js → MarimoErrorOutput-DCAezqcJ.js} +2 -2
  4. package/dist/assets/{RenderHTML-BnMaGpV8.js → RenderHTML-D9-75ltP.js} +1 -1
  5. package/dist/assets/{RunButton-nocIODpS.js → RunButton-plSsbubG.js} +1 -1
  6. package/dist/assets/{add-cell-with-ai-B_TSaqjJ.js → add-cell-with-ai-Cfby28hZ.js} +14 -14
  7. package/dist/assets/{add-connection-dialog-DOuojDa-.js → add-connection-dialog-By0i0Fq5.js} +42 -42
  8. package/dist/assets/{agent-panel-CkKCGjDp.js → agent-panel-Cf482jaA.js} +4 -4
  9. package/dist/assets/ai-model-dropdown-DMfaGQ8o.js +3 -0
  10. package/dist/assets/app-config-button-93unbEYx.js +1 -0
  11. package/dist/assets/{blob-CYM8xQsK.js → blob-yxfhyyvD.js} +1 -1
  12. package/dist/assets/cell-editor-CZmqG6aB.js +21 -0
  13. package/dist/assets/{cell-link-DCOAqVkE.js → cell-link-hHrWcozB.js} +1 -1
  14. package/dist/assets/{cells-C6lBv8kg.js → cells-yuYDzbAy.js} +51 -51
  15. package/dist/assets/{chat-display-B6GBZDq8.js → chat-display-CnhvADgL.js} +1 -1
  16. package/dist/assets/{chat-panel-wWuBXhXw.js → chat-panel-CdE97AxM.js} +2 -2
  17. package/dist/assets/{chat-ui-CQ7A3qdB.js → chat-ui-BD3rpULw.js} +2 -2
  18. package/dist/assets/{column-preview-CatwdUda.js → column-preview-BEmcYaKl.js} +1 -1
  19. package/dist/assets/{command-palette-DcPM_WiO.js → command-palette-BGRRw0sn.js} +1 -1
  20. package/dist/assets/{common-B4aMxphz.js → common-Bs2kaOs2.js} +1 -1
  21. package/dist/assets/{components-D8-ffQsq.js → components-ByyAzQxP.js} +1 -1
  22. package/dist/assets/{datasource-D-_jFtGs.js → datasource-DeZYq5UY.js} +2 -2
  23. package/dist/assets/{dependency-graph-panel-BQli6zxh.js → dependency-graph-panel-g10osAFc.js} +4 -4
  24. package/dist/assets/{documentation-panel-_QE3nPOg.js → documentation-panel-CZ1mKkDh.js} +1 -1
  25. package/dist/assets/{download-Cqjqrhzo.js → download-D1crMjD8.js} +1 -1
  26. package/dist/assets/edit-page-Bk1sT7Wb.js +9 -0
  27. package/dist/assets/{error-entries-c5sIySli.js → error-entries-B6XTLRyE.js} +1 -1
  28. package/dist/assets/{error-panel-CXKrWK_u.js → error-panel-lexB3L6f.js} +1 -1
  29. package/dist/assets/{file-explorer-panel-BZiAb4x_.js → file-explorer-panel-DHRH2J-3.js} +1 -1
  30. package/dist/assets/{file-icons-uUY_hGYm.js → file-icons-Dx3v6lMu.js} +1 -1
  31. package/dist/assets/{file-name-input-DWUKg4LS.js → file-name-input-DzL8D_7x.js} +1 -1
  32. package/dist/assets/{floating-outline-DhGtHg6T.js → floating-outline-3rQEbxxk.js} +1 -1
  33. package/dist/assets/{home-page-Bka_7H02.js → home-page-Dnz4tfZB.js} +1 -1
  34. package/dist/assets/index-BID9w87A.js +29 -0
  35. package/dist/assets/layout-qHVpnnQT.js +9 -0
  36. package/dist/assets/{logs-panel-ragZa1sf.js → logs-panel-CSbUhhRo.js} +1 -1
  37. package/dist/assets/{markdown-renderer-B-uA_6mP.js → markdown-renderer-BgUTGtM0.js} +1 -1
  38. package/dist/assets/{name-cell-input-gC1flbyT.js → name-cell-input-pEE4FGAL.js} +1 -1
  39. package/dist/assets/{outline-panel-D7H7bhOh.js → outline-panel-BgnjEQWg.js} +1 -1
  40. package/dist/assets/{packages-panel-BZnsUm4S.js → packages-panel-BprfUOzZ.js} +1 -1
  41. package/dist/assets/panel-accordion-state-vpqEc3Kd.js +1 -0
  42. package/dist/assets/panels-3h7Cf8xJ.js +4 -0
  43. package/dist/assets/{process-output-DQQ8T5gv.js → process-output-siRm_lza.js} +1 -1
  44. package/dist/assets/{readonly-code-display-Bc0VX9i6.js → readonly-code-display-CLWV76FT.js} +1 -1
  45. package/dist/assets/readonly-python-code-Bor9b9pV.js +1 -0
  46. package/dist/assets/reveal-component-DNPksvzT.js +1069 -0
  47. package/dist/assets/run-page-C4aONLoP.js +1 -0
  48. package/dist/assets/{scratchpad-panel-BJHlMBZV.js → scratchpad-panel-BQSoRQvQ.js} +1 -1
  49. package/dist/assets/session-panel-DB5qEYqt.js +1 -0
  50. package/dist/assets/skeleton-BSxwEE0h.js +1 -0
  51. package/dist/assets/{snippets-panel-2jq36DdG.js → snippets-panel-B8Yi81tz.js} +1 -1
  52. package/dist/assets/state-D1N9_41P.js +3 -0
  53. package/dist/assets/state-O8w98G11.js +1 -0
  54. package/dist/assets/{tracing-91_akEkv.js → tracing-DuLkr7ts.js} +1 -1
  55. package/dist/assets/{tracing-panel-BvE81RYx.js → tracing-panel-CeLKVG8M.js} +2 -2
  56. package/dist/assets/{tree-actions-CGkbUSfG.js → tree-actions-Bh-Nnaub.js} +1 -1
  57. package/dist/assets/useAddCell-_JRYhAFd.js +1 -0
  58. package/dist/assets/useBoolean-Cu7Eado1.js +1 -0
  59. package/dist/assets/{useCellActionButton-cv6xOsnc.js → useCellActionButton-Bi8Lnv3F.js} +1 -1
  60. package/dist/assets/{useDeleteCell-DB-bhhnO.js → useDeleteCell-CBQiavzs.js} +1 -1
  61. package/dist/assets/{useDependencyPanelTab-BDnVzNV-.js → useDependencyPanelTab-BOn3UJ07.js} +1 -1
  62. package/dist/assets/useNotebookActions--pblpIWF.js +10 -0
  63. package/dist/assets/{useRunCells-GCTS1YFv.js → useRunCells-BFQfLlUl.js} +1 -1
  64. package/dist/assets/{useSplitCell-DhT9BA2_.js → useSplitCell-Ig9P6lAn.js} +1 -1
  65. package/dist/index.html +20 -20
  66. package/package.json +1 -1
  67. package/src/__tests__/mount.test.ts +54 -2
  68. package/src/components/editor/__tests__/viewer-banner.test.tsx +1 -1
  69. package/src/components/editor/actions/export-dialog/__tests__/export-notebook.test.ts +9 -0
  70. package/src/components/editor/actions/export-dialog/export-notebook.ts +8 -1
  71. package/src/components/editor/actions/export-dialog/use-export-dialog.ts +2 -0
  72. package/src/components/editor/actions/useNotebookActions.tsx +1 -1
  73. package/src/components/editor/controls/__tests__/notebook-menu-dropdown.test.tsx +1 -1
  74. package/src/components/editor/renderers/__tests__/cells-renderer.test.tsx +1 -1
  75. package/src/components/editor/renderers/cells-renderer.tsx +15 -28
  76. package/src/components/editor/renderers/grid-layout/__tests__/plugin.test.ts +42 -0
  77. package/src/components/editor/renderers/grid-layout/plugin.tsx +20 -10
  78. package/src/components/editor/renderers/layout-select.tsx +1 -1
  79. package/src/components/editor/renderers/plugins.ts +7 -1
  80. package/src/components/editor/renderers/slides-layout/__tests__/plugin.test.ts +49 -15
  81. package/src/components/editor/renderers/slides-layout/slides-layout.tsx +16 -2
  82. package/src/components/editor/renderers/slides-layout/types.ts +15 -11
  83. package/src/components/editor/renderers/types.ts +5 -5
  84. package/src/components/editor/viewer-banner.tsx +1 -1
  85. package/src/components/pages/run-page.tsx +16 -7
  86. package/src/components/slides/__tests__/reveal-component.test.ts +33 -8
  87. package/src/components/slides/__tests__/speaker-view.test.ts +27 -0
  88. package/src/components/slides/reveal-component.tsx +110 -45
  89. package/src/components/slides/speaker-view.ts +22 -0
  90. package/src/components/static-html/share-modal.tsx +2 -0
  91. package/src/core/cells/__tests__/document-changes.test.ts +343 -26
  92. package/src/core/cells/document-changes.ts +181 -4
  93. package/src/core/export/hooks.ts +2 -0
  94. package/src/core/export/layout.ts +9 -0
  95. package/src/core/kernel/handlers.ts +7 -16
  96. package/src/core/kernel/state.ts +2 -0
  97. package/src/core/layout/__tests__/layout.test.ts +95 -0
  98. package/src/core/layout/layout.ts +59 -65
  99. package/src/core/layout/state.ts +121 -0
  100. package/src/core/meta/__tests__/code-visibility.test.tsx +28 -0
  101. package/src/core/meta/code-visibility.ts +3 -1
  102. package/src/core/run-app.tsx +6 -2
  103. package/src/core/saving/__tests__/save-component.test.ts +31 -1
  104. package/src/core/saving/save-component.tsx +39 -29
  105. package/src/core/saving/state.ts +1 -1
  106. package/src/core/static/download-html.ts +2 -0
  107. package/src/core/websocket/__tests__/useMarimoKernelConnection.hook.test.tsx +47 -14
  108. package/src/core/websocket/useMarimoKernelConnection.tsx +7 -2
  109. package/src/mount.tsx +24 -6
  110. package/dist/assets/ai-model-dropdown-CfWMIzjl.js +0 -3
  111. package/dist/assets/app-config-button-ii-Hj5CZ.js +0 -1
  112. package/dist/assets/cell-editor-BVb6iKbw.js +0 -21
  113. package/dist/assets/edit-page-RuyN164g.js +0 -9
  114. package/dist/assets/index-ChbtcNW2.js +0 -29
  115. package/dist/assets/layout-Uv1ZP5XB.js +0 -9
  116. package/dist/assets/panel-accordion-state-BLU7OiMD.js +0 -1
  117. package/dist/assets/panels-B3Y6fue9.js +0 -4
  118. package/dist/assets/readonly-python-code-D2HXwAfT.js +0 -1
  119. package/dist/assets/reveal-component-BN1C8zFu.js +0 -1069
  120. package/dist/assets/run-page-ByVvsH9G.js +0 -1
  121. package/dist/assets/session-panel-CdCKWAOf.js +0 -1
  122. package/dist/assets/skeleton-DirOIQrj.js +0 -1
  123. package/dist/assets/state-C9O-2hQL.js +0 -3
  124. package/dist/assets/state-DyxPdcEa.js +0 -1
  125. package/dist/assets/types-CoHi_MQq.js +0 -1
  126. package/dist/assets/useAddCell-DqvY2ulx.js +0 -1
  127. package/dist/assets/useBoolean-DWBCpKfT.js +0 -1
  128. package/dist/assets/useNotebookActions-Dxp4gTEa.js +0 -10
@@ -0,0 +1,10 @@
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,f as n,l as r,r as i,u as a}from"./useEvent-xfs0Sn4r.js";import{t as o}from"./react-CBDbhulC.js";import{$i as s,$r as c,Co as l,D as u,E as d,Hi as f,Jr as p,Kn as m,La as h,Po as g,Qi as _,Qr as v,Rt as y,Tt as b,Vi as x,_ as S,aa as C,b as ee,di as w,dn as T,ea as E,ei as te,h as ne,la as re,mo as D,ni as O,or as k,ra as A,ri as j,t as ie,un as M,yo as N}from"./cells-yuYDzbAy.js";import{Cn as P,kt as F,vt as I}from"./schemas-aTUejmFi.js";import{t as L}from"./compiler-runtime-CYIjoINj.js";import{r as ae,w as R}from"./utils-CUZQNAWJ.js";import{C as z,n as B,r as V}from"./ai-model-dropdown-DMfaGQ8o.js";import{g as H,n as U}from"./useEventListener-D27Dii_l.js";import{t as oe}from"./objects-snlMn4yk.js";import{n as W,t as G}from"./constants-BDbGiS7O.js";import{A as K,M as se,N as q,O as ce,T as le,j as ue,k as de,v as fe}from"./config-DaNyNpZL.js";import{t as pe}from"./switch-Gl6cozkm.js";import{g as me,h as he,m as ge,y as _e}from"./readonly-python-code-Bor9b9pV.js";import{t as ve}from"./cn-ldLVeaqm.js";import{t as ye}from"./jsx-runtime-B74pBk57.js";import{o as be}from"./alert-dialog-BVi_GyOB.js";import{i as xe,n as Se,r as Ce,t as we}from"./tabs-c6mpccpH.js";import{a as Te,c as Ee,i as De,n as Oe,r as ke,s as Ae,t as je}from"./select-czJLm6jf.js";import{Pt as Me,X as Ne}from"./JsonOutput-CUJlEdsN.js";import{a as Pe,c as J,o as Fe,p as Ie,t as Le}from"./download-D1crMjD8.js";import{t as Re}from"./tooltip-D7dq6bnc.js";import{n as ze,r as Be,t as Ve}from"./button-Btj6GXNy.js";import{i as He,r as Ue,t as We}from"./strings-CpYReX2Q.js";import{r as Ge}from"./requests-C6_IaFh7.js";import{t as Y}from"./createLucideIcon-B7HeEoG2.js";import{L as Ke,R as qe,c as Je,l as Ye,t as Xe,z as Ze}from"./layout-qHVpnnQT.js";import{t as Qe}from"./check-BoA6XBpj.js";import{r as $e}from"./useCellActionButton-Bi8Lnv3F.js";import{t as et}from"./code-CF0HKE9K.js";import{t as tt}from"./copy-BMXKNElG.js";import{t as nt}from"./eye-off-CFuPxa9F.js";import{t as rt}from"./external-link-Bp3BxyRA.js";import{t as it}from"./file-DF8n85RA.js";import{t as at}from"./globe-BQf75qV_.js";import{n as ot,r as st,t as ct}from"./youtube-DCJ-ihUU.js";import{n as lt}from"./components-ib4asSo7.js";import{i as ut,n as dt,r as ft}from"./markdown-export-0rLbaq8b.js";import{t as pt}from"./image-ab13yGv4.js";import{D as mt,E as ht,O as gt,T as _t,b as vt,j as yt}from"./write-secret-modal-lNU_7c2x.js";import{t as bt}from"./link-Cap-MZiw.js";import{t as xt}from"./spinner-Ck-Hgfvj.js";import{r as St}from"./input-Daz6sk8l.js";import{t as Ct}from"./settings-C-cYas75.js";import{t as wt}from"./square-B58Ib8Ir.js";import{t as Tt}from"./triangle-alert-MihykDYG.js";import{t as Et}from"./use-toast-DpWHUGuF.js";import{n as Dt,t as Ot}from"./paths-zcL04qUW.js";import{o as kt}from"./session-CEdta5_Q.js";import{n as At}from"./useAsyncData-Buhk-UgR.js";import{n as jt}from"./copy-Cg05mM3C.js";import{t as Mt}from"./copy-icon-CRxVZTJ9.js";import{r as Nt}from"./useRunCells-BFQfLlUl.js";import{r as Pt,t as Ft}from"./share-C2MPy_VX.js";import{n as It,t as Lt}from"./alert-dmKwNsrp.js";import{a as Rt}from"./cell-link-hHrWcozB.js";import{t as zt}from"./icons-CjLa9BiH.js";import{i as Bt,n as Vt}from"./error-entries-B6XTLRyE.js";import{n as Ht,t as Ut}from"./pair-with-agent-modal-Gg8MZHWW.js";import{n as Wt}from"./add-connection-dialog-By0i0Fq5.js";import{t as Gt}from"./github-YRgb6LMu.js";import{n as Kt}from"./marimo-icons-C3KxMV9A.js";import{t as qt}from"./links-DPh7yoP-.js";import{i as Jt,n as Yt,t as Xt}from"./skeleton-BSxwEE0h.js";var Zt=Y(`circle-chevron-down`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 10-4 4-4-4`,key:`894hmk`}]]),Qt=Y(`circle-chevron-right`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m10 8 4 4-4 4`,key:`1wy4r4`}]]),$t=Y(`clipboard-copy`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2`,key:`4jdomd`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v4`,key:`3hqy98`}],[`path`,{d:`M21 14H11`,key:`1bme5i`}],[`path`,{d:`m15 10-4 4 4 4`,key:`5dvupr`}]]),en=Y(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),tn=Y(`command`,[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]),nn=Y(`diamond-plus`,[[`path`,{d:`M12 8v8`,key:`napkw2`}],[`path`,{d:`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41L13.7 2.71a2.41 2.41 0 0 0-3.41 0z`,key:`1ey20j`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]]),rn=Y(`fast-forward`,[[`path`,{d:`M12 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 12 18z`,key:`b19h5q`}],[`path`,{d:`M2 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 2 18z`,key:`h7h5ge`}]]),an=Y(`files`,[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`,key:`14sh0y`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`,key:`1970lx`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]]),on=Y(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),sn=Y(`message-circle-question-mark`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),cn=Y(`notebook`,[[`path`,{d:`M2 6h4`,key:`aawbzj`}],[`path`,{d:`M2 10h4`,key:`l0bgd4`}],[`path`,{d:`M2 14h4`,key:`1gsvsf`}],[`path`,{d:`M2 18h4`,key:`1bu2t1`}],[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,key:`1nb95v`}],[`path`,{d:`M16 2v20`,key:`rotuqe`}]]),ln=Y(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),un=Y(`presentation`,[[`path`,{d:`M2 3h20`,key:`91anmk`}],[`path`,{d:`M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3`,key:`2k9sn8`}],[`path`,{d:`m7 21 5-5 5 5`,key:`bip4we`}]]),dn=Y(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),fn=Y(`square-power`,[[`path`,{d:`M12 7v4`,key:`xawao1`}],[`path`,{d:`M7.998 9.003a5 5 0 1 0 8-.005`,key:`1pek45`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),pn=Y(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),X=ye(),Z=L(),Q=e(o(),1);function mn(e,t){let n=(0,Z.c)(11),r;n[0]===t?r=n[1]:(r=new D(t),n[0]=t,n[1]=r);let i=r,a;n[2]!==e||n[3]!==i?(a=()=>i.get(e),n[2]=e,n[3]=i,n[4]=a):a=n[4];let[o,s]=(0,Q.useState)(a),c;n[5]!==e||n[6]!==i?(c=t=>{s(t),i.set(e,t)},n[5]=e,n[6]=i,n[7]=c):c=n[7];let l=c,u;return n[8]!==l||n[9]!==o?(u=[o,l],n[8]=l,n[9]=o,n[10]=u):u=n[10],u}function hn(e,t){return{...e,Binaries:{...e.Binaries,Browser:t}}}function gn(e,t,n,r){return{marimo:e,Locale:n||void 0,Binaries:{Browser:t},"Environment Collection Error":r}}function _n(e,t){let n=Math.max(2,...Array.from(t.matchAll(/`+/g),e=>e[0].length)),r="`".repeat(n+1);return`${r}${e}\n${t}\n${r}`}function vn(e,t){let n=e.includes(`?`)?`&`:`?`,r=[],i=e,a=0;for(let[e,o]of Object.entries(t)){if(o.length===0)continue;let t=`${e}=${encodeURIComponent(o)}`,s=`${i}${a===0?n:`&`}${t}`;if(s.length>6e3){r.push(e);continue}i=s,a+=1}return{url:i,omitted:r}}function yn(e,t){return[`<details>`,`<summary>${We.htmlEscape(e)??``}</summary>`,``,t,``,`</details>`].join(`
2
+ `)}function bn(e){return yn(`Environment`,_n(`json`,JSON.stringify(e,null,2)))}function xn(e){return yn(`Errors`,_n(`text`,e.map(Vt).join(`
3
+
4
+ ---
5
+
6
+ `)))}function Sn(e){return yn(`Code`,_n(`python`,e))}var Cn=U,wn=e=>{let t=(0,Z.c)(16),{content:n}=e,[r,i]=(0,Q.useState)(!1),a=!r&&`max-h-24 overflow-hidden`,o;t[0]===a?o=t[1]:(o=ve(`text-xs bg-muted rounded p-2 overflow-x-auto whitespace-pre-wrap`,a),t[0]=a,t[1]=o);let s;t[2]!==n||t[3]!==o?(s=(0,X.jsx)(`pre`,{className:o,children:n}),t[2]=n,t[3]=o,t[4]=s):s=t[4];let c;t[5]===r?c=t[6]:(c=!r&&(0,X.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-0 h-10 rounded-b bg-gradient-to-b from-transparent to-muted`}),t[5]=r,t[6]=c);let l;t[7]!==s||t[8]!==c?(l=(0,X.jsxs)(`div`,{className:`relative`,children:[s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9];let u;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>i(Dn),t[10]=u):u=t[10];let d=r?`Show less`:`Show more`,f;t[11]===d?f=t[12]:(f=(0,X.jsx)(Ve,{type:`button`,variant:`link`,size:`xs`,className:`self-start`,onClick:u,children:d}),t[11]=d,t[12]=f);let p;return t[13]!==l||t[14]!==f?(p=(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[l,f]}),t[13]=l,t[14]=f,t[15]=p):p=t[15],p},Tn=e=>{let t=(0,Z.c)(6),{children:n}=e,{openModal:r,closeModal:i}=vt(),a;t[0]!==i||t[1]!==r?(a=()=>r((0,X.jsx)(En,{onClose:i})),t[0]=i,t[1]=r,t[2]=a):a=t[2];let o;return t[3]!==n||t[4]!==a?(o=(0,X.jsx)(Cn,{onClick:a,children:n}),t[3]=n,t[4]=a,t[5]=o):o=t[5],o},En=()=>{let e=(0,Z.c)(84),{getEnvironmentInfo:t,readCode:n}=Ge(),a,o;e[0]===t?(a=e[1],o=e[2]):(a=async()=>t(),o=[t],e[0]=t,e[1]=a,e[2]=o);let s=At(a,o),c=r(ee),l;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=Bt(i),e[3]=l):l=e[3];let u=l,d;if(e[4]!==c.cellData||e[5]!==c.cellIds.inOrderIds){let t;e[7]===c.cellData?t=e[8]:(t=e=>c.cellData[e],e[7]=c.cellData,e[8]=t),d=c.cellIds.inOrderIds.map(t),e[4]=c.cellData,e[5]=c.cellIds.inOrderIds,e[6]=d}else d=e[6];let f=Ye(d),p=r(N),h=r(fe),g=p!==null&&f&&h.state===le.OPEN,_=g?void 0:p===null?`Save the notebook first.`:f?`Connect the notebook to include its source.`:`Notebook source is hidden in this view.`,[v,y]=mn(`marimo:issue-report:include-errors`,!1),[b,x]=mn(`marimo:issue-report:include-code`,!1),S;e[9]!==s.data||e[10]!==s.status?(S=s.data?hn(s.data,navigator.userAgent):s.status===`error`?gn(_e(),navigator.userAgent,navigator.language,`Server environment information unavailable`):void 0,e[9]=s.data,e[10]=s.status,e[11]=S):S=e[11];let C=S,w,T;e[12]!==b||e[13]!==g||e[14]!==n?(w=async()=>{if(!b||!g)return;let{contents:e}=await n();return e},T=[b,g,n],e[12]=b,e[13]=g,e[14]=n,e[15]=w,e[16]=T):(w=e[15],T=e[16]);let E=At(w,T),te;bb0:{if(!C){let t;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[17]=t):t=e[17];let n;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(n={url:W.bugReportUrl,omitted:t},e[18]=n):n=e[18],te=n;break bb0}let t;if(e[19]!==E.data||e[20]!==C||e[21]!==b||e[22]!==v){let n={env:bn(C)};v&&u.length>0&&(n[`bug-description`]=xn(u)),b&&E.data&&(n[`reproduction-code`]=Sn(E.data)),t=vn(W.bugReportUrl,n),e[19]=E.data,e[20]=C,e[21]=b,e[22]=v,e[23]=t}else t=e[23];te=t}let{url:ne,omitted:re}=te,D;e[24]===re?D=e[25]:(D=re.map(On).join(`, `),e[24]=re,e[25]=D);let O=D,k;e[26]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,X.jsxs)(gt,{children:[(0,X.jsx)(yt,{children:`Report an issue`}),(0,X.jsx)(ht,{children:`Open a GitHub bug report prefilled with your environment, and optionally your current errors and notebook code. Nothing is uploaded automatically; review the details before posting.`})]}),e[26]=k):k=e[26];let A;e[27]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,X.jsx)(rt,{className:`w-4 h-4 mr-2`}),e[27]=A):A=e[27];let j;e[28]===ne?j=e[29]:(j=(0,X.jsx)(Ve,{type:`button`,variant:`default`,size:`xs`,asChild:!0,className:`self-start`,children:(0,X.jsxs)(`a`,{href:ne,target:`_blank`,rel:`noreferrer`,children:[A,`Open GitHub issue`]})}),e[28]=ne,e[29]=j);let ie;e[30]===y?ie=e[31]:(ie=e=>y(e===!0),e[30]=y,e[31]=ie);let M;e[32]!==v||e[33]!==ie?(M=(0,X.jsx)(m,{id:`issue-include-errors`,checked:v,disabled:u.length===0,onCheckedChange:ie,"aria-label":`Include errors`}),e[32]=v,e[33]=ie,e[34]=M):M=e[34];let P;e[35]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,X.jsx)(`label`,{htmlFor:`issue-include-errors`,children:`Include errors`}),e[35]=P):P=e[35];let F;e[36]===M?F=e[37]:(F=(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[M,P]}),e[36]=M,e[37]=F);let I=!g,L;e[38]===x?L=e[39]:(L=e=>x(e===!0),e[38]=x,e[39]=L);let ae;e[40]!==b||e[41]!==I||e[42]!==L?(ae=(0,X.jsx)(m,{id:`issue-include-code`,checked:b,disabled:I,onCheckedChange:L,"aria-label":`Include notebook code`}),e[40]=b,e[41]=I,e[42]=L,e[43]=ae):ae=e[43];let R;e[44]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,X.jsx)(`label`,{htmlFor:`issue-include-code`,children:`Include notebook code`}),e[44]=R):R=e[44];let z;e[45]===ae?z=e[46]:(z=(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[ae,R]}),e[45]=ae,e[46]=z);let B;e[47]===_?B=e[48]:(B=_&&(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground ml-6`,children:_}),e[47]=_,e[48]=B);let V;e[49]!==E.status||e[50]!==b?(V=b&&E.status===`error`&&(0,X.jsx)(`span`,{className:`text-xs text-(--red-11) ml-6`,children:`Notebook source could not be loaded.`}),e[49]=E.status,e[50]=b,e[51]=V):V=e[51];let H;e[52]!==z||e[53]!==B||e[54]!==V?(H=(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[z,B,V]}),e[52]=z,e[53]=B,e[54]=V,e[55]=H):H=e[55];let U;e[56]!==F||e[57]!==H?(U=(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[F,H]}),e[56]=F,e[57]=H,e[58]=U):U=e[58];let oe;e[59]===O?oe=e[60]:(oe=O?(0,X.jsxs)(`div`,{className:`flex items-start gap-2 text-xs text-(--yellow-11)`,children:[(0,X.jsx)(Tt,{className:`w-3.5 h-3.5 shrink-0 mt-0.5`}),(0,X.jsxs)(`span`,{children:[`Too large to prefill and left out of the link: `,O,`. Paste them into the issue manually.`]})]}):(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Your environment is always included.`}),e[59]=O,e[60]=oe);let G;e[61]!==j||e[62]!==U||e[63]!==oe?(G=(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[j,U,oe]}),e[61]=j,e[62]=U,e[63]=oe,e[64]=G):G=e[64];let K;e[65]===s.status?K=e[66]:(K=s.status===`pending`&&(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Loading environment details…`}),(0,X.jsx)(Xt,{className:`h-4 w-full`}),(0,X.jsx)(Xt,{className:`h-4 w-3/4`}),(0,X.jsx)(Xt,{className:`h-4 w-1/2`})]}),e[65]=s.status,e[66]=K);let se;e[67]===s?se=e[68]:(se=s.status===`error`&&(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,X.jsx)(Tt,{className:`w-4 h-4 text-(--yellow-11) shrink-0`}),(0,X.jsx)(`span`,{children:`Server environment information unavailable`}),(0,X.jsx)(Ve,{type:`button`,variant:`link`,size:`xs`,onClick:()=>s.refetch(),children:`Retry`})]}),e[67]=s,e[68]=se);let q;e[69]===C?q=e[70]:(q=C&&(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,X.jsx)(`span`,{className:`text-sm font-medium`,children:`Environment details`}),(0,X.jsx)(Mt,{className:`w-3.5 h-3.5`,value:JSON.stringify(C,null,2),ariaLabel:`Copy environment JSON`,toastTitle:`Environment details copied`})]}),(0,X.jsx)(wn,{content:JSON.stringify(C,null,2)})]}),e[69]=C,e[70]=q);let ce;e[71]===C?ce=e[72]:(ce=C&&u.length>0&&(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,X.jsx)(`span`,{className:`text-sm font-medium`,children:`Errors`}),(0,X.jsx)(Mt,{className:`w-3.5 h-3.5`,value:xn(u),ariaLabel:`Copy errors`,toastTitle:`Errors copied`})]}),(0,X.jsx)(wn,{content:u.map(Vt).join(`
7
+
8
+ ---
9
+
10
+ `)})]}),e[71]=C,e[72]=ce);let ue;e[73]===C?ue=e[74]:(ue=C&&u.length===0&&(0,X.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`No errors detected.`}),e[73]=C,e[74]=ue);let de;e[75]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,X.jsx)(`a`,{href:W.feedbackForm,target:`_blank`,rel:`noreferrer`,className:`underline`,children:`two-minute survey`}),e[75]=de):de=e[75];let pe;e[76]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,X.jsx)(`div`,{className:`border-t pt-3`,children:(0,X.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Other feedback? Take our`,` `,de,` `,`or chat with us on`,` `,(0,X.jsx)(`a`,{href:W.discordLink,target:`_blank`,rel:`noreferrer`,className:`underline`,children:`Discord`}),`.`]})}),e[76]=pe):pe=e[76];let me;return e[77]!==G||e[78]!==K||e[79]!==se||e[80]!==q||e[81]!==ce||e[82]!==ue?(me=(0,X.jsxs)(_t,{className:`w-[540px] max-w-[90vw]`,children:[k,(0,X.jsxs)(`div`,{className:`flex flex-col gap-4 max-h-[60vh] overflow-y-auto`,children:[G,K,se,q,ce,ue,pe]})]}),e[77]=G,e[78]=K,e[79]=se,e[80]=q,e[81]=ce,e[82]=ue,e[83]=me):me=e[83],me};function Dn(e){return!e}function On(e){return e===`bug-description`?`errors`:e===`reproduction-code`?`code`:e}var kn=`https://static.marimo.app`,An=e=>{let t=(0,Z.c)(26),{onClose:n}=e,[r,i]=(0,Q.useState)(``),{exportAsHTML:a}=Ge(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=Math.random().toString(36).slice(2,6),t[0]=o):o=t[0];let s=`${r}-${o}`,c=`${kn}/static/${s}`,l;t[1]!==a||t[2]!==n||t[3]!==s?(l=async e=>{e.preventDefault(),n();let{contents:t}=await a({download:!1,includeCode:!0,files:Je.INSTANCE.filenames(),layout:await Xe()}),r=Et({title:`Uploading static notebook...`,description:`Please wait.`});await fetch(`${kn}/api/static`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({html:t,path:s})}).catch(()=>{r.dismiss(),Et({title:`Error uploading static page`,description:(0,X.jsxs)(`div`,{children:[`Please try again later. If the problem persists, please file a bug report on`,` `,(0,X.jsx)(`a`,{href:W.issuesPage,target:`_blank`,className:`underline`,children:`GitHub`}),`.`]})})}),r.dismiss(),Et({title:`Static page uploaded!`,description:(0,X.jsxs)(`div`,{children:[`The URL has been copied to your clipboard.`,(0,X.jsx)(`br`,{}),`You can share it with anyone.`]})})},t[1]=a,t[2]=n,t[3]=s,t[4]=l):l=t[4];let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,X.jsx)(yt,{children:`Share static notebook`}),t[5]=u):u=t[5];let d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,X.jsxs)(gt,{children:[u,(0,X.jsxs)(ht,{children:[`You can publish a static, non-interactive version of this notebook to the public web. We will create a link for you that lives on`,` `,(0,X.jsx)(`a`,{href:kn,target:`_blank`,children:kn}),`.`]})]}),t[6]=d):d=t[6];let f;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>{let t=e.target.value.toLowerCase().replaceAll(/\s/g,`-`).replaceAll(/[^\da-z-]/g,``);i(t)},t[7]=f):f=t[7];let p;t[8]===r?p=t[9]:(p=(0,X.jsx)(St,{"data-testid":`slug-input`,id:`slug`,autoFocus:!0,value:r,placeholder:`Notebook slug`,onChange:f,required:!0,autoComplete:`off`}),t[8]=r,t[9]=p);let m;t[10]===c?m=t[11]:(m=(0,X.jsxs)(`div`,{className:`font-semibold text-sm text-muted-foreground gap-2 flex flex-col`,children:[`Anyone will be able to access your notebook at this URL:`,(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(jn,{text:c}),(0,X.jsx)(`span`,{className:`text-primary`,children:c})]})]}),t[10]=c,t[11]=m);let h;t[12]!==p||t[13]!==m?(h=(0,X.jsxs)(`div`,{className:`flex flex-col gap-6 py-4`,children:[p,m]}),t[12]=p,t[13]=m,t[14]=h):h=t[14];let g;t[15]===n?g=t[16]:(g=(0,X.jsx)(Ve,{"data-testid":`cancel-share-static-notebook-button`,variant:`secondary`,onClick:n,children:`Cancel`}),t[15]=n,t[16]=g);let _;t[17]===c?_=t[18]:(_=(0,X.jsx)(Ve,{"data-testid":`share-static-notebook-button`,"aria-label":`Save`,variant:`default`,type:`submit`,onClick:async()=>{await jt(c)},children:`Create`}),t[17]=c,t[18]=_);let v;t[19]!==_||t[20]!==g?(v=(0,X.jsxs)(mt,{children:[g,_]}),t[19]=_,t[20]=g,t[21]=v):v=t[21];let y;return t[22]!==v||t[23]!==l||t[24]!==h?(y=(0,X.jsx)(_t,{className:`w-fit`,children:(0,X.jsxs)(`form`,{onSubmit:l,children:[d,h,v]})}),t[22]=v,t[23]=l,t[24]=h,t[25]=y):y=t[25],y},jn=e=>{let t=(0,Z.c)(8),[n,r]=Q.useState(!1),i;t[0]===e.text?i=t[1]:(i=Be.stopPropagation(async t=>{t.preventDefault(),await jt(e.text),r(!0),setTimeout(()=>r(!1),2e3)}),t[0]=e.text,t[1]=i);let a=i,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsx)(tt,{size:14,strokeWidth:1.5}),t[2]=o):o=t[2];let s;t[3]===a?s=t[4]:(s=(0,X.jsx)(Ve,{"data-testid":`copy-static-notebook-url-button`,onClick:a,size:`xs`,variant:`secondary`,children:o}),t[3]=a,t[4]=s);let c;return t[5]!==n||t[6]!==s?(c=(0,X.jsx)(Re,{content:`Copied!`,open:n,children:s}),t[5]=n,t[6]=s,t[7]=c):c=t[7],c};function Mn(){let e=document.getElementsByClassName(G.outputArea);for(let t of e){let e=t.getBoundingClientRect();if(e.bottom>0&&e.top<window.innerHeight){let e=g.findElement(t);if(!e){H.warn(`Could not find HTMLCellId for visible output area`,t);continue}return{cellId:g.parse(e.id)}}}return H.warn(`No visible output area found for scroll anchor`),null}function Nn(e){if(!e){H.warn(`No scroll anchor provided to restore scroll position`);return}let t=document.getElementById(g.create(e.cellId));if(!t){H.warn(`Could not find cell element to restore scroll position`,e.cellId);return}if(!t.querySelector(`.${G.outputArea}`)){H.warn(`Could not find output area to restore scroll position`,e.cellId);return}t.scrollIntoView({block:`start`,behavior:`auto`})}function Pn(){let e=(0,Z.c)(2),t=a(se),n;return e[0]===t?n=e[1]:(n=()=>{let e=Mn();t(t=>({mode:K(t.mode),cellAnchor:e?.cellId??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Nn(e)})})},e[0]=t,e[1]=n),n}var Fn=n(!1),In=()=>{let e=(0,Z.c)(7),{selectedLayout:t}=he(),{setLayoutView:n}=ge();if(q()&&!w(`wasm_layouts`))return null;let r;e[0]===n?r=e[1]:(r=e=>n(e),e[0]=n,e[1]=r);let i;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,X.jsx)(Ae,{className:`min-w-[110px] border-border bg-background`,"data-testid":`layout-select`,children:(0,X.jsx)(Ee,{placeholder:`Select a view`})}),e[2]=i):i=e[2];let a;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(Oe,{children:(0,X.jsxs)(ke,{children:[(0,X.jsx)(Te,{children:`View as`}),me.map(Bn)]})}),e[3]=a):a=e[3];let o;return e[4]!==t||e[5]!==r?(o=(0,X.jsxs)(je,{"data-testid":`layout-select`,value:t,onValueChange:r,children:[i,a]}),e[4]=t,e[5]=r,e[6]=o):o=e[6],o};function Ln(e){let t=Rn(e);return(0,X.jsx)(t,{className:`h-4 w-4`})}function Rn(e){switch(e){case`vertical`:return on;case`grid`:return st;case`slides`:return un;default:return He(e),wt}}function zn(e){return We.startCase(e)}function Bn(e){return(0,X.jsx)(De,{value:e,children:(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5 leading-5`,children:[Ln(e),(0,X.jsx)(`span`,{children:zn(e)})]})},e)}var Vn=[`html`,`markdown`,`ipynb`,`pdf`,`script`,`png`],Hn=[`pymdown`,`qmd`,`mystmd`,`mdx`],Un=[`topological`,`top-down`],Wn=[`document`,`slides`],Gn=[`source`,`flat`];function Kn(e){return typeof e==`string`&&Vn.some(t=>t===e)}var $={html:{includeCode:!0},markdown:{flavor:null},ipynb:{sortMode:`topological`,includeOutputs:!1},pdf:{preset:`document`,includeInputs:!0,includeOutputs:!0,webpdf:!0},script:{type:`source`}};function qn(e,t){return e.default(t).catch(t)}function Jn(e){return P(e).optional().catch(void 0)}var Yn=P({html:Jn({includeCode:qn(F(),$.html.includeCode)}),markdown:Jn({flavor:qn(I(Hn).nullable(),$.markdown.flavor)}),ipynb:Jn({sortMode:qn(I(Un),$.ipynb.sortMode),includeOutputs:qn(F(),$.ipynb.includeOutputs)}),pdf:Jn({preset:qn(I(Wn),$.pdf.preset),includeInputs:qn(F(),$.pdf.includeInputs),includeOutputs:qn(F(),$.pdf.includeOutputs),webpdf:qn(F(),$.pdf.webpdf)}),script:Jn({type:qn(I(Gn),$.script.type)})}).catch({});function Xn(e,t){let n={...e},r=r=>{n[r]={...e[r],...t[r]}};for(let e of Object.keys(t))r(e);return n}function Zn(e){return Xn($,Yn.parse(e))}var Qn=j({toSerializable:e=>e,fromSerializable:Zn}),$n=l(`marimo:export:options:v1`,$,Qn,{getOnInit:!0}),er=l(`marimo:export:last-format:v1`,`html`,j({toSerializable:e=>e,fromSerializable:e=>Kn(e)?e:`html`}),{getOnInit:!0}),tr={html:{requiresNamedNotebookOnServer:!0,requiresServerRuntime:!1,checksServerAvailability:!1},markdown:{requiresNamedNotebookOnServer:!0,requiresServerRuntime:!1,checksServerAvailability:!1},ipynb:{requiresNamedNotebookOnServer:!0,requiresServerRuntime:!0,checksServerAvailability:!0},pdf:{requiresNamedNotebookOnServer:!0,requiresServerRuntime:!0,checksServerAvailability:!0},script:{requiresNamedNotebookOnServer:!1,requiresServerRuntime:!1,checksServerAvailability:!1},png:{requiresNamedNotebookOnServer:!1,requiresServerRuntime:!1,checksServerAvailability:!1}};function nr(e,t){return e===`wasm`&&t===`pdf`}function rr({format:e,options:t,runtime:n,filename:r,availability:i}){let a=e===`script`&&t.script.type===`source`?{...tr.script,requiresNamedNotebookOnServer:!0}:tr[e],o=nr(n,e);if(n===`wasm`&&a.requiresServerRuntime)return{available:o,reason:{type:`wasm-runtime`}};if(n===`server`&&a.requiresNamedNotebookOnServer&&!r)return{available:!1,reason:{type:`notebook-must-be-named`}};if(n===`wasm`||!a.checksServerAvailability)return{available:!0};if(i.status===`pending`)return{available:!1,reason:{type:`checking-requirements`}};if(i.status===`error`||!i.data)return{available:!0,availabilityCheckFailed:!0};let s=i.data.formats.find(t=>t.format===e);return s?s.dependenciesAvailable?{available:!0}:s.missingPackages.length>0?{available:!1,reason:{type:`missing-packages`,packages:s.missingPackages}}:s.missingSetup.length>0?{available:!1,reason:{type:`missing-setup`,requirements:s.missingSetup}}:{available:!0,availabilityCheckFailed:!0}:{available:!0,availabilityCheckFailed:!0}}function ir(e,t){return e.map(e=>({value:e,...t[e]}))}var ar=ir([`automatic`,...Hn],{automatic:{label:`Automatic`,description:`Chooses a format from the notebook filename. Defaults to Markdown (.md).`},pymdown:{label:`Markdown (.md)`,description:`Creates a .md file with Python code blocks.`},qmd:{label:`Quarto (.qmd)`,description:`Creates a .qmd file for Quarto.`},mystmd:{label:`MyST (.myst.md)`,description:`Creates a .myst.md file for MyST.`},mdx:{label:`MDX (.mdx)`,description:`Creates a .mdx file for MDX.`}}),or=ir(Un,{"top-down":{label:`Top to bottom`,description:`Keeps cells in the same order as this notebook.`},topological:{label:`Dependency order`,description:`Reorders cells so each cell appears after the cells it depends on.`}}),sr=ir(Wn,{document:{label:`Document`,description:`Creates pages for reading or printing.`},slides:{label:`Slides`,description:`Creates presentation slides from the notebook.`}}),cr=ir([`browser`,`latex`],{browser:{label:`Browser`,description:`Uses browser rendering to preserve the notebook's visual output.`},latex:{label:`LaTeX first`,description:`Uses Pandoc and TeX when available, then falls back to browser rendering.`}}),lr=ir(Gn,{source:{label:`Notebook source`,description:`Downloads the saved notebook source for continued editing in marimo.`},flat:{label:`Flat script`,description:`Reorders cells so the Python script runs from top to bottom.`}}),ur={html:{label:`HTML`,actionLabel:`Export HTML`,description:`Save the current notebook as an HTML page.`,Icon:at,Options:dr},markdown:{label:`Markdown`,actionLabel:`Export Markdown`,description:`Save code and text in a Markdown-based file. Cell outputs are not included.`,Icon:_,Options:fr},ipynb:{label:`Jupyter`,actionLabel:`Export Jupyter notebook`,description:`Open the notebook in Jupyter and other compatible tools.`,Icon:cn,Options:pr},pdf:{label:`PDF`,actionLabel:`Export PDF`,description:`Save the notebook as a PDF for printing or sharing.`,Icon:it,Options:mr},script:{label:`Python`,actionLabel:`Export flat script`,description:`Save the notebook as a Python file.`,Icon:et,Options:hr},png:{label:`PNG`,actionLabel:`Export PNG`,description:`Capture the current app view as an image.`,Icon:pt,Options:gr}};function dr(e){let t=(0,Z.c)(7),{options:n,updateOptions:r,disabled:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={checked:`Includes code cells in the webpage.`,unchecked:`Leaves code cells out of the webpage.`},t[0]=a):a=t[0];let o;t[1]===r?o=t[2]:(o=e=>r(`html`,{includeCode:e}),t[1]=r,t[2]=o);let s;return t[3]!==i||t[4]!==n.html.includeCode||t[5]!==o?(s=(0,X.jsx)(_r,{children:(0,X.jsx)(vr,{label:`Include code`,descriptions:a,checked:n.html.includeCode,disabled:i,onCheckedChange:o})}),t[3]=i,t[4]=n.html.includeCode,t[5]=o,t[6]=s):s=t[6],s}function fr(e){let t=(0,Z.c)(6),{options:n,updateOptions:r,disabled:i}=e,a=n.markdown.flavor??`automatic`,o;t[0]===r?o=t[1]:(o=e=>r(`markdown`,{flavor:e===`automatic`?null:e}),t[0]=r,t[1]=o);let s;return t[2]!==i||t[3]!==a||t[4]!==o?(s=(0,X.jsx)(_r,{children:(0,X.jsx)(xr,{label:`Format`,value:a,disabled:i,onValueChange:o,options:ar})}),t[2]=i,t[3]=a,t[4]=o,t[5]=s):s=t[5],s}function pr(e){let t=(0,Z.c)(16),{options:n,updateOptions:r,disabled:i}=e,a;t[0]===r?a=t[1]:(a=e=>r(`ipynb`,{sortMode:e}),t[0]=r,t[1]=a);let o;t[2]!==i||t[3]!==n.ipynb.sortMode||t[4]!==a?(o=(0,X.jsx)(yr,{label:`Cell order`,value:n.ipynb.sortMode,disabled:i,onValueChange:a,options:or}),t[2]=i,t[3]=n.ipynb.sortMode,t[4]=a,t[5]=o):o=t[5];let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s={checked:`Keeps the outputs currently shown in the notebook.`,unchecked:`Leaves cell outputs out of the Jupyter notebook.`},t[6]=s):s=t[6];let c;t[7]===r?c=t[8]:(c=e=>r(`ipynb`,{includeOutputs:e}),t[7]=r,t[8]=c);let l;t[9]!==i||t[10]!==n.ipynb.includeOutputs||t[11]!==c?(l=(0,X.jsx)(vr,{label:`Include outputs`,descriptions:s,checked:n.ipynb.includeOutputs,disabled:i,onCheckedChange:c}),t[9]=i,t[10]=n.ipynb.includeOutputs,t[11]=c,t[12]=l):l=t[12];let u;return t[13]!==o||t[14]!==l?(u=(0,X.jsxs)(_r,{children:[o,l]}),t[13]=o,t[14]=l,t[15]=u):u=t[15],u}function mr(e){let t=(0,Z.c)(30),{options:n,updateOptions:r,disabled:i}=e,a;t[0]===r?a=t[1]:(a=e=>r(`pdf`,{preset:e}),t[0]=r,t[1]=a);let o;t[2]!==i||t[3]!==n.pdf.preset||t[4]!==a?(o=(0,X.jsx)(yr,{label:`Layout`,value:n.pdf.preset,disabled:i,onValueChange:a,options:sr}),t[2]=i,t[3]=n.pdf.preset,t[4]=a,t[5]=o):o=t[5];let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s={checked:`Includes code cells in the PDF.`,unchecked:`Leaves code cells out of the PDF.`},t[6]=s):s=t[6];let c;t[7]===r?c=t[8]:(c=e=>r(`pdf`,{includeInputs:e}),t[7]=r,t[8]=c);let l;t[9]!==i||t[10]!==n.pdf.includeInputs||t[11]!==c?(l=(0,X.jsx)(vr,{label:`Include code`,descriptions:s,checked:n.pdf.includeInputs,disabled:i,onCheckedChange:c}),t[9]=i,t[10]=n.pdf.includeInputs,t[11]=c,t[12]=l):l=t[12];let u;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(u={checked:`Keeps the outputs currently shown in the notebook.`,unchecked:`Leaves cell outputs out of the PDF.`},t[13]=u):u=t[13];let d;t[14]===r?d=t[15]:(d=e=>r(`pdf`,{includeOutputs:e}),t[14]=r,t[15]=d);let f;t[16]!==i||t[17]!==n.pdf.includeOutputs||t[18]!==d?(f=(0,X.jsx)(vr,{label:`Include outputs`,descriptions:u,checked:n.pdf.includeOutputs,disabled:i,onCheckedChange:d}),t[16]=i,t[17]=n.pdf.includeOutputs,t[18]=d,t[19]=f):f=t[19];let p;t[20]!==i||t[21]!==n.pdf.preset||t[22]!==n.pdf.webpdf||t[23]!==r?(p=n.pdf.preset===`document`?(0,X.jsx)(yr,{label:`Method`,value:n.pdf.webpdf?`browser`:`latex`,disabled:i,onValueChange:e=>r(`pdf`,{webpdf:e===`browser`}),options:cr}):null,t[20]=i,t[21]=n.pdf.preset,t[22]=n.pdf.webpdf,t[23]=r,t[24]=p):p=t[24];let m;return t[25]!==o||t[26]!==l||t[27]!==f||t[28]!==p?(m=(0,X.jsxs)(_r,{children:[o,l,f,p]}),t[25]=o,t[26]=l,t[27]=f,t[28]=p,t[29]=m):m=t[29],m}function hr(e){let t=(0,Z.c)(6),{options:n,updateOptions:r,disabled:i}=e,a;t[0]===r?a=t[1]:(a=e=>r(`script`,{type:e}),t[0]=r,t[1]=a);let o;return t[2]!==i||t[3]!==n.script.type||t[4]!==a?(o=(0,X.jsx)(_r,{children:(0,X.jsx)(yr,{label:`Format`,value:n.script.type,disabled:i,onValueChange:a,options:lr})}),t[2]=i,t[3]=n.script.type,t[4]=a,t[5]=o):o=t[5],o}function gr(){return null}function _r(e){let t=(0,Z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,X.jsx)(`div`,{className:`divide-y rounded-md border`,children:n}),t[0]=n,t[1]=r),r}function vr(e){let t=(0,Z.c)(26),{label:n,descriptions:r,descriptionOverride:i,checked:a,disabled:o,onCheckedChange:s}=e,c=(0,Q.useId)(),l=`${c}-description`,u=i??(a?r.checked:r.unchecked),d;t[0]===i?d=t[1]:(d=i?[i]:[],t[0]=i,t[1]=d);let f;t[2]!==r.checked||t[3]!==r.unchecked||t[4]!==d?(f=[r.checked,r.unchecked,...d],t[2]=r.checked,t[3]=r.unchecked,t[4]=d,t[5]=f):f=t[5];let p=f,m;t[6]!==c||t[7]!==n?(m=(0,X.jsx)(`label`,{htmlFor:c,className:`text-sm font-medium leading-5`,children:n}),t[6]=c,t[7]=n,t[8]=m):m=t[8];let h;t[9]!==u||t[10]!==l||t[11]!==p?(h=(0,X.jsx)(wr,{id:l,description:u,possibleDescriptions:p}),t[9]=u,t[10]=l,t[11]=p,t[12]=h):h=t[12];let g;t[13]!==m||t[14]!==h?(g=(0,X.jsxs)(`div`,{className:`min-w-0`,children:[m,h]}),t[13]=m,t[14]=h,t[15]=g):g=t[15];let _;t[16]!==a||t[17]!==l||t[18]!==o||t[19]!==c||t[20]!==n||t[21]!==s?(_=(0,X.jsx)(pe,{id:c,size:`sm`,checked:a,disabled:o,onCheckedChange:s,"aria-label":n,"aria-describedby":l}),t[16]=a,t[17]=l,t[18]=o,t[19]=c,t[20]=n,t[21]=s,t[22]=_):_=t[22];let v;return t[23]!==g||t[24]!==_?(v=(0,X.jsxs)(`div`,{className:`flex min-h-14 items-center justify-between gap-4 px-3 py-2`,children:[g,_]}),t[23]=g,t[24]=_,t[25]=v):v=t[25],v}function yr(e){let t=(0,Z.c)(31),{label:n,value:r,disabled:i,onValueChange:a,options:o}=e,s=(0,Q.useId)(),c=`${s}-description`,l;t[0]!==o||t[1]!==r?(l=o.find(e=>e.value===r)?.description,t[0]=o,t[1]=r,t[2]=l):l=t[2];let u=l,d;t[3]===n?d=t[4]:(d=(0,X.jsx)(`div`,{className:`text-sm font-medium leading-5`,children:n}),t[3]=n,t[4]=d);let f=u??``,p;t[5]===o?p=t[6]:(p=o.map(br),t[5]=o,t[6]=p);let m;t[7]!==c||t[8]!==f||t[9]!==p?(m=(0,X.jsx)(wr,{id:c,description:f,possibleDescriptions:p}),t[7]=c,t[8]=f,t[9]=p,t[10]=m):m=t[10];let h;t[11]!==d||t[12]!==m?(h=(0,X.jsxs)(`div`,{className:`min-w-0`,children:[d,m]}),t[11]=d,t[12]=m,t[13]=h):h=t[13];let g;t[14]===a?g=t[15]:(g=e=>a(e),t[14]=a,t[15]=g);let _;if(t[16]!==s||t[17]!==o){let e;t[19]===s?e=t[20]:(e=(e,t)=>{let n=`${s}-${t}`;return(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(T,{id:n,value:e.value}),(0,X.jsx)(`label`,{htmlFor:n,className:`text-sm`,children:e.label})]},e.value)},t[19]=s,t[20]=e),_=o.map(e),t[16]=s,t[17]=o,t[18]=_}else _=t[18];let v;t[21]!==c||t[22]!==i||t[23]!==n||t[24]!==g||t[25]!==_||t[26]!==r?(v=(0,X.jsx)(M,{value:r,onValueChange:g,className:`flex shrink-0 flex-wrap gap-x-5 gap-y-2 sm:justify-end`,"aria-label":n,"aria-describedby":c,disabled:i,children:_}),t[21]=c,t[22]=i,t[23]=n,t[24]=g,t[25]=_,t[26]=r,t[27]=v):v=t[27];let y;return t[28]!==h||t[29]!==v?(y=(0,X.jsxs)(`div`,{className:`flex min-h-14 flex-col items-stretch gap-2 px-3 py-2 sm:flex-row sm:items-center sm:justify-between sm:gap-4`,children:[h,v]}),t[28]=h,t[29]=v,t[30]=y):y=t[30],y}function br(e){return e.description}function xr(e){let t=(0,Z.c)(34),{label:n,value:r,disabled:i,onValueChange:a,options:o}=e,s=(0,Q.useId)(),c=`${s}-description`,l;t[0]!==o||t[1]!==r?(l=o.find(e=>e.value===r)?.description,t[0]=o,t[1]=r,t[2]=l):l=t[2];let u=l,d;t[3]!==s||t[4]!==n?(d=(0,X.jsx)(`label`,{htmlFor:s,className:`text-sm font-medium leading-5`,children:n}),t[3]=s,t[4]=n,t[5]=d):d=t[5];let f=u??``,p;t[6]===o?p=t[7]:(p=o.map(Cr),t[6]=o,t[7]=p);let m;t[8]!==c||t[9]!==f||t[10]!==p?(m=(0,X.jsx)(wr,{id:c,description:f,possibleDescriptions:p}),t[8]=c,t[9]=f,t[10]=p,t[11]=m):m=t[11];let h;t[12]!==d||t[13]!==m?(h=(0,X.jsxs)(`div`,{className:`min-w-0`,children:[d,m]}),t[12]=d,t[13]=m,t[14]=h):h=t[14];let g;t[15]===a?g=t[16]:(g=e=>a(e),t[15]=a,t[16]=g);let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,X.jsx)(Ee,{}),t[17]=_):_=t[17];let v;t[18]!==c||t[19]!==s?(v=(0,X.jsx)(Ae,{id:s,"aria-describedby":c,className:`h-8 w-full shrink-0 sm:w-44`,children:_}),t[18]=c,t[19]=s,t[20]=v):v=t[20];let y;t[21]===o?y=t[22]:(y=o.map(Sr),t[21]=o,t[22]=y);let b;t[23]===y?b=t[24]:(b=(0,X.jsx)(Oe,{children:y}),t[23]=y,t[24]=b);let x;t[25]!==i||t[26]!==b||t[27]!==g||t[28]!==v||t[29]!==r?(x=(0,X.jsxs)(je,{value:r,disabled:i,onValueChange:g,children:[v,b]}),t[25]=i,t[26]=b,t[27]=g,t[28]=v,t[29]=r,t[30]=x):x=t[30];let S;return t[31]!==x||t[32]!==h?(S=(0,X.jsxs)(`div`,{className:`flex min-h-14 flex-col items-stretch gap-2 px-3 py-2 sm:flex-row sm:items-center sm:justify-between sm:gap-4`,children:[h,x]}),t[31]=x,t[32]=h,t[33]=S):S=t[33],S}function Sr(e){return(0,X.jsx)(De,{value:e.value,children:e.label},e.value)}function Cr(e){return e.description}function wr(e){let t=(0,Z.c)(15),{id:n,description:r,possibleDescriptions:i}=e,a;t[0]===i?a=t[1]:(a=new Set(i),t[0]=i,t[1]=a);let o;t[2]===a?o=t[3]:(o=[...a],t[2]=a,t[3]=o);let s;t[4]!==r||t[5]!==o?(s=o.filter(e=>e!==r),t[4]=r,t[5]=o,t[6]=s):s=t[6];let c=s,l;t[7]!==r||t[8]!==n?(l=(0,X.jsx)(`p`,{id:n,"aria-live":`polite`,className:`col-start-1 row-start-1`,children:r}),t[7]=r,t[8]=n,t[9]=l):l=t[9];let u;t[10]===c?u=t[11]:(u=c.map(Tr),t[10]=c,t[11]=u);let d;return t[12]!==l||t[13]!==u?(d=(0,X.jsxs)(`div`,{className:`mt-0.5 grid text-xs leading-4 text-muted-foreground`,children:[l,u]}),t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function Tr(e){return(0,X.jsx)(`p`,{"aria-hidden":!0,className:`invisible col-start-1 row-start-1`,children:e},e)}var Er={"playwright-chromium":{description:`PDF export requires Playwright Chromium.`}};function Dr(e){let t=(0,Z.c)(10),{status:n}=e;if(n.available&&!n.availabilityCheckFailed)return null;if(n.reason?.type===`checking-requirements`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsxs)(`span`,{className:`ml-auto flex shrink-0`,children:[(0,X.jsx)(xt,{size:`small`,className:`size-3`}),(0,X.jsx)(`span`,{className:`sr-only`,children:`Checking requirements`})]}),t[0]=e):e=t[0],e}let r=n.availabilityCheckFailed?`Requirements unknown`:`Unavailable`,i=n.availabilityCheckFailed?`text-muted-foreground`:`text-(--yellow-11)`,a;t[1]===i?a=t[2]:(a=ve(`size-3`,i),t[1]=i,t[2]=a);let o;t[3]===a?o=t[4]:(o=(0,X.jsx)(C,{className:a}),t[3]=a,t[4]=o);let s;t[5]===r?s=t[6]:(s=(0,X.jsx)(`span`,{className:`sr-only`,children:r}),t[5]=r,t[6]=s);let c;return t[7]!==o||t[8]!==s?(c=(0,X.jsxs)(`span`,{className:`ml-auto flex shrink-0`,children:[o,s]}),t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function Or(e){let t=(0,Z.c)(7),{format:n,formatLabel:r,status:i,onInstall:a,isInstalling:o}=e,s=o!==void 0&&o;if(i.availabilityCheckFailed){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(`div`,{className:`mb-2.5`,children:(0,X.jsx)(kr,{children:`Couldn't check whether this export is available. You can still try it.`})}),t[0]=e):e=t[0],e}if(!i.reason)return null;let c;return t[1]!==n||t[2]!==r||t[3]!==s||t[4]!==a||t[5]!==i.reason?(c=(0,X.jsx)(`div`,{className:`mb-2.5`,children:(0,X.jsx)(Ar,{format:n,formatLabel:r,reason:i.reason,onInstall:a,isInstalling:s})}),t[1]=n,t[2]=r,t[3]=s,t[4]=a,t[5]=i.reason,t[6]=c):c=t[6],c}function kr(e){let t=(0,Z.c)(9),{children:n,onInstall:r,isInstalling:i}=e,a=i!==void 0&&i,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsx)(C,{className:`size-4 shrink-0`}),t[0]=o):o=t[0];let s;t[1]===n?s=t[2]:(s=(0,X.jsx)(`span`,{className:`min-w-0 flex-1`,children:n}),t[1]=n,t[2]=s);let c;t[3]!==a||t[4]!==r?(c=r?(0,X.jsxs)(Ve,{type:`button`,variant:`outline`,size:`xs`,className:`shrink-0 border-input bg-background text-foreground hover:border-input hover:bg-muted hover:text-foreground`,disabled:a,"aria-busy":a,onClick:r,children:[a?(0,X.jsx)(xt,{size:`small`,className:`mr-1.5 size-3.5`}):(0,X.jsx)(en,{className:`mr-1.5 size-3.5`}),`Install`]}):null,t[3]=a,t[4]=r,t[5]=c):c=t[5];let l;return t[6]!==s||t[7]!==c?(l=(0,X.jsxs)(Lt,{variant:`warning`,className:`flex items-center gap-2.5 px-3 py-2 text-(--yellow-12) has-[svg]:pl-3 [&>svg]:static [&>svg+div]:translate-y-0`,children:[o,(0,X.jsxs)(It,{className:`flex min-w-0 flex-1 items-center gap-3 text-sm leading-5`,children:[s,c]})]}),t[6]=s,t[7]=c,t[8]=l):l=t[8],l}function Ar(e){let t=(0,Z.c)(22),{format:n,formatLabel:r,reason:i,onInstall:a,isInstalling:o}=e;switch(i.type){case`checking-requirements`:{let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(xt,{className:`size-4 shrink-0`,size:`small`}),t[0]=e):e=t[0];let n;return t[1]===r?n=t[2]:(n=(0,X.jsxs)(Lt,{role:`status`,variant:`info`,className:`flex items-center gap-2.5 p-3 has-[svg]:pl-3 [&>svg]:static [&>svg+div]:translate-y-0`,children:[e,(0,X.jsxs)(It,{className:`min-w-0 flex-1 text-sm leading-5`,children:[`Checking `,r,` requirements…`]})]}),t[1]=r,t[2]=n),n}case`notebook-must-be-named`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(kr,{children:`Name and save this notebook before exporting.`}),t[3]=e):e=t[3],e}case`missing-packages`:{let e;t[4]===i.packages?e=t[5]:(e=i.packages.join(`, `),t[4]=i.packages,t[5]=e);let n;t[6]===e?n=t[7]:(n=(0,X.jsx)(`code`,{className:`break-words font-mono`,children:e}),t[6]=e,t[7]=n);let s;return t[8]!==r||t[9]!==o||t[10]!==a||t[11]!==n?(s=(0,X.jsxs)(kr,{onInstall:a,isInstalling:o,children:[r,` export requires`,` `,n,`.`]}),t[8]=r,t[9]=o,t[10]=a,t[11]=n,t[12]=s):s=t[12],s}case`missing-setup`:{let e;t[13]!==a||t[14]!==i.requirements?(e=a?i.requirements.map(Mr).join(` `):(0,X.jsx)(`span`,{className:`block min-w-0`,children:i.requirements.map(jr)}),t[13]=a,t[14]=i.requirements,t[15]=e):e=t[15];let n;return t[16]!==o||t[17]!==a||t[18]!==e?(n=(0,X.jsx)(kr,{onInstall:a,isInstalling:o,children:e}),t[16]=o,t[17]=a,t[18]=e,t[19]=n):n=t[19],n}case`wasm-runtime`:{let e=n===`pdf`?`Use your browser's print dialog to save the current app view as a PDF.`:`Open this notebook in a local marimo session to use this export.`,r;return t[20]===e?r=t[21]:(r=(0,X.jsx)(kr,{children:e}),t[20]=e,t[21]=r),r}default:Ue(i)}}function jr(e){let t=Er[e.name];return(0,X.jsxs)(`span`,{className:`block`,children:[t.description,(0,X.jsx)(`code`,{className:`mt-1 block break-all font-mono`,children:e.command})]},e.name)}function Mr(e){return Er[e.name].description}function Nr(e){return e.endsWith(`.myst.md`)?`mystmd`:e.endsWith(`.qmd`)?`qmd`:e.endsWith(`.mdx`)?`mdx`:`pymdown`}function Pr(e,t){let n=t??Nr(e),r=dt[n],i=ft.find(t=>e.endsWith(t)),a=Ie.withoutExtension(e);i&&(a=e.slice(0,-i.length));let o=`${a}.${r}`;return o===e?`${e.slice(0,-(r.length+1))}.export.${r}`:o}function Fr(e){return Object.entries(e).flatMap(([e,t])=>t===null?[]:t===!0?[`--${e}`]:t===!1?[`--no-${e}`]:[`--${e}=${t}`])}function Ir(e){return e.preset===`document`?e.webpdf:null}var Lr={html:{subcommand:`html`,flags:({html:e})=>({"include-code":e.includeCode}),outputFilename:e=>Ie.toHTML(e)},markdown:{subcommand:`md`,flags:({markdown:e})=>({flavor:e.flavor}),outputFilename:(e,{markdown:t})=>Pr(e,t.flavor)},ipynb:{subcommand:`ipynb`,flags:({ipynb:e})=>({sort:e.sortMode,"include-outputs":e.includeOutputs}),outputFilename:e=>Ie.toIPYNB(e)},pdf:{subcommand:`pdf`,flags:({pdf:e})=>({as:e.preset,"include-inputs":e.includeInputs,"include-outputs":e.includeOutputs,webpdf:Ir(e)}),outputFilename:e=>Ie.toPDF(e)},script:{subcommand:`script`,flags:()=>({}),outputFilename:e=>`${Ie.withoutExtension(e)}.script.py`}};function Rr({format:e,filename:t,options:n}){if(e===`png`||e===`script`&&n.script.type===`source`||!t)return null;let r=Lr[e];return[`marimo`,`export`,r.subcommand,Ht(t),...Fr(r.flags(n)),`-o`,Ht(r.outputFilename(t,n))].join(` `)}async function zr(e){let{exportOptions:t,captureOutputs:n,downloadPDF:r}=e;t.includeOutputs&&await n(),await r(t)}async function Br({format:e,options:t,requests:n,sourceFilename:r,htmlFiles:i,getLayout:a,captureOutputs:o,capturePNG:s,downloadFile:c}){switch(e){case`html`:c(await n.exportAsHTML({download:!1,files:i,includeCode:t.html.includeCode,layout:await a()}));return;case`markdown`:c(await n.exportAsMarkdown({download:!1,flavor:t.markdown.flavor}));return;case`ipynb`:t.ipynb.includeOutputs&&await o(),c(await n.exportAsIPYNB({download:!1,sortMode:t.ipynb.sortMode,includeOutputs:t.ipynb.includeOutputs}));return;case`pdf`:await zr({exportOptions:t.pdf,captureOutputs:o,downloadPDF:async e=>{c(await n.exportAsPDF(e))}});return;case`script`:if(t.script.type===`source`){c({contents:(await n.readCode()).contents,filename:r,mediaType:`text/plain`});return}c(await n.exportAsScript({download:!1}));return;case`png`:await s();return;default:Ue(e)}}var Vr={source:{actionLabel:`Export notebook source`,progressLabel:`notebook source`},flat:{actionLabel:`Export flat script`,progressLabel:`flat script`}};function Hr(e,t){if(e===`wasm`)return{status:`success`,data:null};switch(t.status){case`pending`:case`loading`:return{status:`pending`};case`error`:return{status:`error`};case`success`:return{status:`success`,data:t.data}}}function Ur(e,t){return e===`server`&&t?Dt.basename(t):Ie.toPY(document.title)}function Wr({usesBrowserPrint:e,hasCommand:t,format:n,isNotebookSource:r}){return e?`Uses the browser's print settings for page size and filename.`:t?`Uses the current session state. The copied command exports the saved notebook.`:n!==`png`&&!r?`Save the notebook to copy an equivalent shell command.`:null}function Gr(e){let n=Rt(),[r,i]=t($n),[a,o]=t(er),[s,c]=(0,Q.useState)(e??a),l=q()?`wasm`:`server`,u=Ge(),d=ue(),[f,p]=(0,Q.useState)(!1),m=At(async()=>l===`wasm`?null:u.getExportAvailability(),[l,u]),h=Hr(l,m),g=e=>rr({format:e,options:r,runtime:l,filename:n,availability:h}),_=g(s),v=d&&(_.reason?.type===`missing-packages`||_.reason?.type===`missing-setup`),y=Vn.map(e=>({format:e,status:g(e)})),b=nr(l,s),x=ur[s],S=s===`script`&&r.script.type===`source`,{actionLabel:C,progressLabel:ee}=s===`script`?Vr[r.script.type]:{actionLabel:x.actionLabel,progressLabel:x.label},w=b?null:Rr({format:s,filename:n,options:r}),T=Wr({usesBrowserPrint:b,hasCommand:!!w,format:s,isNotebookSource:S});return(0,Q.useEffect)(()=>{e&&o(e)},[e,o]),{formats:y,options:r,selected:{format:s,status:_,usesBrowserPrint:b,actionLabel:C,command:w,footerDescription:T},exportRequest:{format:s,options:r,sourceFilename:Ur(l,n),available:_.available,usesBrowserPrint:b,progressLabel:ee},selectFormat:e=>{Kn(e)&&(c(e),o(e))},updateOptions:(e,t)=>{i(n=>{let r={...n};return r[e]={...n[e],...t},r})},canInstall:v,isInstalling:f,installRequirements:async()=>{if(!(!v||f||s===`png`)){p(!0);try{let e=await u.installExportRequirements({format:s});m.setData(e)}catch{}finally{p(!1)}}}}}async function Kr(e){let t=document.getElementById(`App`);if(!t){let e=`The current app view could not be captured.`;throw Et({title:`Failed to download as PNG`,description:e,variant:`danger`}),Error(e)}let n=e?.style.visibility,r=e?.classList.contains(`print:hidden`);if(!await Fe({element:t,filename:document.title,prepare:()=>{let t=Le();return e&&(e.classList.add(`print:hidden`),e.style.visibility=`hidden`),()=>{t(),e&&(r||e.classList.remove(`print:hidden`),e.style.visibility=n??``)}}}))throw Error(`Failed to capture the current app view.`)}function qr(e){e(),requestAnimationFrame(()=>{setTimeout(()=>{window.print()},0)})}function Jr({format:e,options:t,sourceFilename:n,available:r,usesBrowserPrint:i,progressLabel:a,onClose:o}){let s=Ge(),c=Jt(),[l,u]=(0,Q.useState)(!1),d=(0,Q.useRef)(null),f=(0,Q.useRef)(!0);(0,Q.useEffect)(()=>(f.current=!0,()=>{f.current=!1}),[]);let p=async e=>{await Yt({takeScreenshots:()=>c({progress:e}),updateCellOutputs:s.updateCellOutputs})},m=async()=>{await de(()=>Kr(d.current?.parentElement??null))};return{dialogRef:d,isExporting:l,submit:async()=>{if(!(!r||l)){if(i){qr(o);return}u(!0);try{await J(`Exporting ${a}…`,async r=>{await Br({format:e,options:t,requests:s,sourceFilename:n,htmlFiles:Je.INSTANCE.filenames(),getLayout:Xe,captureOutputs:()=>p(r),capturePNG:m,downloadFile:Pe})}),f.current&&o()}catch(e){H.error(`Export failed`,e)}finally{f.current&&u(!1)}}}}}function Yr(e){let t=(0,Z.c)(15),{initialFormat:n,onClose:r}=e,i=Gr(n),a,o,s;t[0]===i?(a=t[1],o=t[2],s=t[3]):({exportRequest:a,selectFormat:o,...s}=i,t[0]=i,t[1]=a,t[2]=o,t[3]=s);let c;t[4]!==a||t[5]!==r?(c={...a,onClose:r},t[4]=a,t[5]=r,t[6]=c):c=t[6];let l=Jr(c),u;t[7]!==l||t[8]!==o||t[9]!==s?(u=e=>{!l.isExporting&&!s.isInstalling&&o(e)},t[7]=l,t[8]=o,t[9]=s,t[10]=u):u=t[10];let d;return t[11]!==l||t[12]!==s||t[13]!==u?(d={...s,...l,selectFormat:u},t[11]=l,t[12]=s,t[13]=u,t[14]=d):d=t[14],d}var Xr=`(min-width: 640px)`,Zr=e=>{let t=(0,Z.c)(75),{initialFormat:n,onClose:r,returnFocusRef:i}=e,a;t[0]!==n||t[1]!==r?(a={initialFormat:n,onClose:r},t[0]=n,t[1]=r,t[2]=a):a=t[2];let{dialogRef:o,isExporting:s,isInstalling:c,canInstall:l,formats:u,options:d,selected:f,selectFormat:p,updateOptions:m,installRequirements:h,submit:g}=Yr(a),_=s||c,v=Ne(Xr),{format:y,status:b,usesBrowserPrint:x,actionLabel:S,command:C,footerDescription:ee}=f,w=ur[y],T=w.Options,E;t[3]===i?E=t[4]:(E=i?{onCloseAutoFocus:e=>{e.preventDefault(),i.current?.focus()}}:{},t[3]=i,t[4]=E);let te=E,ne;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,X.jsxs)(gt,{className:`border-b px-5 py-4 pr-12`,children:[(0,X.jsx)(yt,{children:`Export notebook`}),(0,X.jsx)(ht,{children:`Choose a format and adjust its options.`})]}),t[5]=ne):ne=t[5];let re=v?`vertical`:`horizontal`,D;if(t[6]!==u||t[7]!==_){let e;t[9]===_?e=t[10]:(e=e=>{let{format:t,status:n}=e,r=ur[t];return(0,X.jsxs)(xe,{value:t,disabled:_,className:`min-w-0 justify-start gap-2 px-2.5 py-2 text-xs data-[state=active]:shadow-xs sm:w-full sm:text-sm`,"data-testid":`export-format-${t}`,children:[(0,X.jsx)(r.Icon,{className:`size-3.5 shrink-0`,strokeWidth:1.5}),(0,X.jsx)(`span`,{className:`truncate`,children:r.label}),(0,X.jsx)(Dr,{status:n})]},t)},t[9]=_,t[10]=e),D=u.map(e),t[6]=u,t[7]=_,t[8]=D}else D=t[8];let O;t[11]===D?O=t[12]:(O=(0,X.jsx)(Ce,{"aria-label":`Export format`,className:`grid max-h-none shrink-0 grid-cols-2 items-stretch justify-start gap-1 overflow-auto rounded-none border-b bg-muted/20 p-2 min-[360px]:grid-cols-3 sm:flex sm:h-full sm:flex-col sm:border-b-0 sm:border-r`,children:D}),t[11]=D,t[12]=O);let k;if(t[13]!==T||t[14]!==l||t[15]!==w.description||t[16]!==w.label||t[17]!==y||t[18]!==u||t[19]!==h||t[20]!==_||t[21]!==c||t[22]!==d||t[23]!==b||t[24]!==m||t[25]!==x){let e;t[27]!==T||t[28]!==l||t[29]!==w.description||t[30]!==w.label||t[31]!==y||t[32]!==h||t[33]!==_||t[34]!==c||t[35]!==d||t[36]!==b||t[37]!==m||t[38]!==x?(e=e=>{let{format:t}=e;return(0,X.jsxs)(Se,{value:t,className:`mt-0 min-h-0 min-w-0 overflow-y-auto px-4 py-3`,children:[(0,X.jsxs)(`div`,{className:`mb-3`,children:[(0,X.jsx)(`h3`,{className:`text-base font-semibold`,children:w.label}),(0,X.jsx)(`p`,{className:`mt-0.5 text-sm text-muted-foreground`,children:w.description})]}),(0,X.jsx)(Or,{format:y,formatLabel:w.label,status:b,onInstall:l?h:void 0,isInstalling:c}),x?null:(0,X.jsx)(T,{options:d,updateOptions:m,disabled:_})]},t)},t[27]=T,t[28]=l,t[29]=w.description,t[30]=w.label,t[31]=y,t[32]=h,t[33]=_,t[34]=c,t[35]=d,t[36]=b,t[37]=m,t[38]=x,t[39]=e):e=t[39],k=u.map(e),t[13]=T,t[14]=l,t[15]=w.description,t[16]=w.label,t[17]=y,t[18]=u,t[19]=h,t[20]=_,t[21]=c,t[22]=d,t[23]=b,t[24]=m,t[25]=x,t[26]=k}else k=t[26];let A;t[40]!==y||t[41]!==p||t[42]!==re||t[43]!==O||t[44]!==k?(A=(0,X.jsxs)(we,{value:y,onValueChange:p,orientation:re,className:`flex min-h-0 min-w-0 flex-col overflow-hidden sm:grid sm:grid-cols-[168px_minmax(0,1fr)]`,children:[O,k]}),t[40]=y,t[41]=p,t[42]=re,t[43]=O,t[44]=k,t[45]=A):A=t[45];let j;t[46]===C?j=t[47]:(j=C?(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 rounded-md border bg-background px-2.5 py-2 font-mono text-xs`,children:[(0,X.jsx)(`span`,{className:`select-none text-muted-foreground`,"aria-hidden":!0,children:`$`}),(0,X.jsx)(`code`,{className:`min-w-0 flex-1 overflow-x-auto whitespace-nowrap`,"data-testid":`export-cli-command`,"aria-label":`Equivalent POSIX shell command`,children:C}),(0,X.jsx)(Mt,{value:C,className:`size-3.5`,buttonClassName:ve(ze({variant:`ghost`,size:`icon`}),`shrink-0`),tooltip:`Copy POSIX shell command`,ariaLabel:`Copy POSIX shell command`,toastTitle:`Command copied`})]}):null,t[46]=C,t[47]=j);let ie=C&&`mt-3`,M;t[48]===ie?M=t[49]:(M=ve(`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,ie),t[48]=ie,t[49]=M);let N;t[50]===ee?N=t[51]:(N=ee?(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:ee}):null,t[50]=ee,t[51]=N);let P=!b.available||_,F=!ee&&`sm:ml-auto`,I;t[52]===F?I=t[53]:(I=ve(`border-(--blue-11) bg-(--blue-11) hover:border-(--blue-12) hover:bg-(--blue-12) sm:min-w-36 dark:border-(--blue-7) dark:bg-(--blue-5) dark:text-(--blue-12) dark:hover:border-(--blue-8) dark:hover:bg-(--blue-6)`,F),t[52]=F,t[53]=I);let L;t[54]===s?L=t[55]:(L=s&&(0,X.jsx)(xt,{size:`small`,className:`mr-2`,"aria-hidden":!0}),t[54]=s,t[55]=L);let ae=x?`Print to PDF`:S,R;t[56]!==s||t[57]!==g||t[58]!==P||t[59]!==I||t[60]!==L||t[61]!==ae?(R=(0,X.jsxs)(Ve,{type:`button`,disabled:P,"aria-busy":s,onClick:g,className:I,"data-testid":`export-submit`,children:[L,ae]}),t[56]=s,t[57]=g,t[58]=P,t[59]=I,t[60]=L,t[61]=ae,t[62]=R):R=t[62];let z;t[63]!==M||t[64]!==N||t[65]!==R?(z=(0,X.jsxs)(`div`,{className:M,children:[N,R]}),t[63]=M,t[64]=N,t[65]=R,t[66]=z):z=t[66];let B;t[67]!==z||t[68]!==j?(B=(0,X.jsxs)(`footer`,{className:`min-w-0 border-t bg-muted/20 px-4 py-3`,children:[j,z]}),t[67]=z,t[68]=j,t[69]=B):B=t[69];let V;return t[70]!==o||t[71]!==te||t[72]!==B||t[73]!==A?(V=(0,X.jsxs)(_t,{ref:o,className:`grid h-dvh max-h-[760px] min-w-0 w-[calc(100vw-2rem)] grid-rows-[auto_minmax(0,1fr)_auto] gap-0 overflow-hidden p-0 sm:top-[5vh] sm:h-[90vh] sm:max-h-[640px] sm:max-w-3xl`,"data-testid":`export-dialog`,...te,children:[ne,A,B]}),t[70]=o,t[71]=te,t[72]=B,t[73]=A,t[74]=V):V=t[74],V};function Qr(e){let t=(0,Z.c)(5),{openPrompt:n,closeModal:r}=vt(),{sendCopy:i}=Ge(),a;return t[0]!==r||t[1]!==n||t[2]!==i||t[3]!==e?(a=()=>{if(!e)return null;let t=Ot.guessDeliminator(e),a=Dt.basename(e);n({title:`Copy notebook`,description:`Enter a new filename for the notebook copy.`,defaultValue:`_${a}`,confirmText:`Copy notebook`,spellCheck:!1,onConfirm:n=>{let a=t.join(Dt.dirname(e),n);i({source:e,destination:a}).then(()=>{r(),Et({title:`Notebook copied`,description:`A copy of the notebook has been created.`}),qt(a)})}})},t[0]=r,t[1]=n,t[2]=i,t[3]=e,t[4]=a):a=t[4],a}function $r(){let e=(0,Z.c)(4),{openConfirm:t}=vt(),n=a(fe),{sendRestart:r}=Ge(),i;return e[0]!==t||e[1]!==r||e[2]!==n?(i=()=>{t({title:`Restart Kernel`,description:`This will restart the Python kernel. You'll lose all data that's in memory. You will also lose any unsaved changes, so make sure to save your work before restarting.`,variant:`destructive`,confirmAction:(0,X.jsx)(be,{onClick:async()=>{n({state:le.CLOSING}),await r(),Pt()},"aria-label":`Confirm Restart`,children:`Restart`})})},e[0]=t,e[1]=r,e[2]=n,e[3]=i):i=e[3],i}var ei=new k,ti=e=>ei.isSupported(e)?`markdown`:`code`,ni=()=>{let e=(0,Z.c)(3),{updateCellConfig:t}=u(),{saveCellConfig:n}=Ge(),r;return e[0]!==n||e[1]!==t?(r=async(e,r)=>{let i=ne(),a={};for(let t of i.cellIds.inOrderIds){let n=i.cellData[t];n!==void 0&&n.config.hide_code!==e&&ti(n.code)===r&&(a[t]={hide_code:e})}let o=oe.entries(a);if(o.length!==0){await n({configs:a});for(let[e,n]of o)t({cellId:e,config:n})}},e[0]=n,e[1]=t,e[2]=r):r=e[2],r},ri=e=>{e?.preventDefault(),e?.stopPropagation()};function ii(e){let n=(0,Z.c)(48),i;n[0]===e?i=n[1]:(i=e===void 0?{}:e,n[0]=e,n[1]=i);let{exportDialogReturnFocusRef:o}=i,l=Rt(),{openModal:m,closeModal:g}=vt(),{toggleApplication:C}=v(),{selectedPanel:ee}=c(),[w]=t(se),T=r(ce),D=ni(),[k]=R(),j=r(p),M=r(ae),{updateCellConfig:N,undoDeleteCell:P,clearAllCellOutputs:F,addSetupCellIfDoesntExist:I,collapseAllCells:L,expandAllCells:H}=u(),U=$r(),G=Nt(),K=Qr(l),le=a(Fn),ue=a(B),{handleClick:de}=V(),fe=a(z),pe=a($n),{readCode:_e,saveCellConfig:ve}=Ge(),ye=b(`database`),be=b(`storage`),xe=y(),Se=r(S),Ce=r(ie),we=r(d),{selectedLayout:Te}=he(),{setLayoutView:Ee}=ge(),De=Pn(),Oe=k.sharing?.html??!0,ke=k.sharing?.wasm??!0,Ae=k.sharing?.molab??!0,je=Te===`slides`,Ne=yi,Pe;n[2]!==g||n[3]!==o||n[4]!==m||n[5]!==pe?(Pe=(e,t)=>{t&&pe(e=>Xn(e,t)),m((0,X.jsx)(Zr,{initialFormat:e,onClose:g,returnFocusRef:o}))},n[2]=g,n[3]=o,n[4]=m,n[5]=pe,n[6]=Pe):Pe=n[6];let J=Pe,Fe;n[7]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=(0,X.jsx)(Me,{size:14,strokeWidth:1.5}),n[7]=Fe):Fe=n[7];let Ie;return n[8]!==xe||n[9]!==I||n[10]!==M||n[11]!==Ce||n[12]!==j||n[13]!==F||n[14]!==g||n[15]!==L||n[16]!==K||n[17]!==ye||n[18]!==be||n[19]!==H||n[20]!==l||n[21]!==Se||n[22]!==je||n[23]!==T||n[24]!==J||n[25]!==m||n[26]!==de||n[27]!==_e||n[28]!==U||n[29]!==G||n[30]!==ve||n[31]!==Te||n[32]!==ee||n[33]!==D||n[34]!==le||n[35]!==fe||n[36]!==Ee||n[37]!==ue||n[38]!==Oe||n[39]!==Ae||n[40]!==ke||n[41]!==C||n[42]!==De||n[43]!==P||n[44]!==we||n[45]!==N||n[46]!==w.mode?(Ie=[{icon:Fe,label:`Export…`,additionalKeywords:[`download`,`html`,`markdown`,`ipynb`,`pdf`,`script`,`png`],handle:()=>J()},{icon:(0,X.jsx)(Me,{size:14,strokeWidth:1.5}),label:`Download`,redundant:!0,handle:ri,dropdown:[{icon:(0,X.jsx)(Ze,{size:14,strokeWidth:1.5}),label:`Download as HTML`,handle:()=>J(`html`,{html:{includeCode:!0}})},{icon:(0,X.jsx)(Ze,{size:14,strokeWidth:1.5}),label:`Download as HTML (exclude code)`,handle:()=>J(`html`,{html:{includeCode:!1}})},{icon:(0,X.jsx)(zt,{strokeWidth:1.5,style:{width:14,height:14}}),label:`Download as Markdown`,handle:()=>J(`markdown`)},{icon:(0,X.jsx)(cn,{size:14,strokeWidth:1.5}),label:`Download as ipynb`,handle:()=>J(`ipynb`)},{icon:(0,X.jsx)(et,{size:14,strokeWidth:1.5}),label:`Download notebook source`,handle:()=>J(`script`,{script:{type:`source`}})},{icon:(0,X.jsx)(et,{size:14,strokeWidth:1.5}),label:`Download flat script`,handle:()=>J(`script`,{script:{type:`flat`}})},{divider:!0,icon:(0,X.jsx)(pt,{size:14,strokeWidth:1.5}),label:`Download as PNG`,handle:()=>J(`png`)},je?{divider:!0,icon:(0,X.jsx)(it,{size:14,strokeWidth:1.5}),label:`Download as PDF`,handle:ri,dropdown:[{icon:(0,X.jsx)(it,{size:14,strokeWidth:1.5}),label:`Document Layout`,handle:()=>J(`pdf`,{pdf:{preset:`document`}})},{icon:(0,X.jsx)(it,{size:14,strokeWidth:1.5}),label:`Slides Layout`,hidden:q(),rightElement:(0,X.jsx)(`span`,{className:`ml-3 shrink-0 rounded-full border border-emerald-200 bg-emerald-50 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-emerald-700`,children:`Recommended`}),handle:()=>J(`pdf`,{pdf:{preset:`slides`}})}]}:{divider:!0,icon:(0,X.jsx)(it,{size:14,strokeWidth:1.5}),label:`Download as PDF`,handle:()=>J(`pdf`,{pdf:{preset:`document`}})}]},{icon:(0,X.jsx)(f,{size:14,strokeWidth:1.5}),label:`Pair with an agent`,hidden:q(),handle:async()=>{m((0,X.jsx)(Ut,{onClose:g}))}},{icon:(0,X.jsx)(dn,{size:14,strokeWidth:1.5}),label:`Share`,handle:ri,hidden:!Oe&&!ke&&!Ae,dropdown:[{icon:(0,X.jsx)(at,{size:14,strokeWidth:1.5}),label:`Publish HTML to web`,hidden:!Oe,handle:async()=>{m((0,X.jsx)(An,{onClose:g}))}},{icon:(0,X.jsx)(bt,{size:14,strokeWidth:1.5}),label:`Create WebAssembly link`,hidden:!ke,handle:async()=>{let e=await _e(),t=Ft({code:e.contents});await jt(t),Et({title:`Copied`,description:`Link copied to clipboard.`})}},{icon:(0,X.jsx)(Kt,{size:14,strokeWidth:1.5}),label:`Create molab notebook`,hidden:!Ae,handle:async()=>{let e=await _e(),t=Ft({code:e.contents,baseUrl:`${W.molab}/new`});window.open(t,`_blank`)}}]},{icon:(0,X.jsx)(ln,{size:14,strokeWidth:1.5}),label:`Helper panel`,redundant:!0,handle:ri,dropdown:te.flatMap(e=>{let t=e.type===`ai`&&!M;if(O({panel:e,capabilities:j,aiEnabled:M})&&!t)return[];let{type:n,Icon:r,additionalKeywords:i}=e;return{label:We.startCase(n),rightElement:Ne(ee===n),icon:(0,X.jsx)(r,{size:14,strokeWidth:1.5}),handle:()=>{if(t){de(`ai`,`ai-features`);return}C(n)},additionalKeywords:i}})},{icon:(0,X.jsx)(un,{size:14,strokeWidth:1.5}),label:`Present as`,handle:ri,dropdown:[{icon:w.mode===`present`?(0,X.jsx)(x,{size:14,strokeWidth:1.5}):(0,X.jsx)(Ke,{size:14,strokeWidth:1.5}),label:`Toggle app view`,hotkey:`global.hideCode`,handle:()=>{De()}},...me.map((e,t)=>{let n=Rn(e);return{divider:t===0,label:zn(e),icon:(0,X.jsx)(n,{size:14,strokeWidth:1.5}),rightElement:(0,X.jsx)(`div`,{className:`w-8 flex justify-end`,children:Te===e&&(0,X.jsx)(Qe,{size:14})}),handle:()=>{Ee(e),w.mode===`edit`&&De()}}})]},{icon:(0,X.jsx)(an,{size:14,strokeWidth:1.5}),label:`Duplicate notebook`,hidden:!l||q(),handle:K},{icon:(0,X.jsx)($t,{size:14,strokeWidth:1.5}),label:`Copy code to clipboard`,hidden:!l,handle:async()=>{let e=await _e();await jt(e.contents),Et({title:`Copied`,description:`Code copied to clipboard.`})}},{icon:(0,X.jsx)($e,{size:14,strokeWidth:1.5}),label:`Enable all cells`,hidden:!Se||T,handle:async()=>{let e=ne(),t=h(e),n=oe.fromEntries(t.map(vi));await ve({configs:n});for(let e of t)N({cellId:e,config:{disabled:!1}})}},{divider:!0,icon:(0,X.jsx)(nn,{size:14,strokeWidth:1.5}),label:`Add setup cell`,handle:()=>{I({})}},{icon:(0,X.jsx)(E,{size:14,strokeWidth:1.5}),label:`Add database connection`,handle:()=>{m((0,X.jsx)(Wt,{onClose:g}))},dropdown:ye.length===0?void 0:[...ye.map(e=>({icon:(0,X.jsx)(f,{size:14,strokeWidth:1.5}),label:`Add ${e.displayName}`,description:`Detected in your environment`,handle:()=>xe(e)})),{divider:!0,icon:(0,X.jsx)(E,{size:14,strokeWidth:1.5}),label:`Browse all connections`,handle:()=>{m((0,X.jsx)(Wt,{onClose:g}))}}]},{icon:(0,X.jsx)(lt,{size:14,strokeWidth:1.5}),label:`Add remote storage`,handle:()=>{m((0,X.jsx)(Wt,{defaultTab:`storage`,onClose:g}))},dropdown:be.length===0?void 0:[...be.map(e=>({icon:(0,X.jsx)(f,{size:14,strokeWidth:1.5}),label:`Add ${e.displayName}`,description:`Detected in your environment`,handle:()=>xe(e)})),{divider:!0,icon:(0,X.jsx)(lt,{size:14,strokeWidth:1.5}),label:`Browse all connections`,handle:()=>{m((0,X.jsx)(Wt,{defaultTab:`storage`,onClose:g}))}}]},{icon:(0,X.jsx)(pn,{size:14,strokeWidth:1.5}),label:we,hidden:!Ce||T,handle:()=>{P()}},{icon:(0,X.jsx)(fn,{size:14,strokeWidth:1.5}),label:`Restart kernel`,variant:`danger`,handle:U,additionalKeywords:[`reset`,`reload`,`restart`]},{icon:(0,X.jsx)(rn,{size:14,strokeWidth:1.5}),label:`Re-run all cells`,redundant:!0,hotkey:`global.runAll`,handle:async()=>{G()}},{icon:(0,X.jsx)(A,{size:14,strokeWidth:1.5}),label:`Clear all outputs`,redundant:!0,handle:()=>{F()}},{icon:(0,X.jsx)(s,{size:14,strokeWidth:1.5}),label:`Show all code`,hotkey:`global.showAllCode`,handle:()=>D(!1,`code`),redundant:!0},{icon:(0,X.jsx)(nt,{size:14,strokeWidth:1.5}),label:`Hide all code`,hotkey:`global.hideAllCode`,handle:()=>D(!0,`code`),redundant:!0},{icon:(0,X.jsx)(s,{size:14,strokeWidth:1.5}),label:`Show all markdown code`,hotkey:`global.showAllMarkdownCode`,handle:()=>D(!1,`markdown`),redundant:!0},{icon:(0,X.jsx)(nt,{size:14,strokeWidth:1.5}),label:`Hide all markdown code`,hotkey:`global.hideAllMarkdownCode`,handle:()=>D(!0,`markdown`),redundant:!0},{icon:(0,X.jsx)(Qt,{size:14,strokeWidth:1.5}),label:`Collapse all sections`,hotkey:`global.collapseAllSections`,handle:L,redundant:!0},{icon:(0,X.jsx)(Zt,{size:14,strokeWidth:1.5}),label:`Expand all sections`,hotkey:`global.expandAllSections`,handle:H,redundant:!0},{divider:!0,icon:(0,X.jsx)(tn,{size:14,strokeWidth:1.5}),label:`Command palette`,hotkey:`global.commandPalette`,handle:()=>le(_i)},{icon:(0,X.jsx)(qe,{size:14,strokeWidth:1.5}),label:`Keyboard shortcuts`,hotkey:`global.showHelp`,handle:()=>fe(gi)},{icon:(0,X.jsx)(Ct,{size:14,strokeWidth:1.5}),label:`User settings`,handle:()=>ue(hi),redundant:!0,additionalKeywords:[`preferences`,`options`,`configuration`]},{icon:(0,X.jsx)(sn,{size:14,strokeWidth:1.5}),label:`Report an issue`,additionalKeywords:[`feedback`,`bug`,`issue`,`report`,`diagnostics`],handle:()=>m((0,X.jsx)(En,{onClose:g}))},{icon:(0,X.jsx)(rt,{size:14,strokeWidth:1.5}),label:`Resources`,handle:ri,dropdown:[{icon:(0,X.jsx)(re,{size:14,strokeWidth:1.5}),label:`Documentation`,handle:mi},{icon:(0,X.jsx)(Gt,{className:`h-3.5 w-3.5`}),label:`GitHub`,handle:pi},{icon:(0,X.jsx)(ot,{size:14,strokeWidth:1.5}),label:`Discord Community`,handle:fi},{icon:(0,X.jsx)(ct,{className:`h-3.5 w-3.5`}),label:`YouTube`,handle:di},{icon:(0,X.jsx)(_,{size:14,strokeWidth:1.5}),label:`Changelog`,handle:ui}]},{divider:!0,icon:(0,X.jsx)(ut,{size:14,strokeWidth:1.5}),label:`Open home`,hidden:!location.search.includes(`file`),handle:li},{icon:(0,X.jsx)(Kt,{size:14,strokeWidth:1.5}),label:`New notebook`,hidden:!location.search.includes(`file`),handle:ci}].filter(si).map(ai),n[8]=xe,n[9]=I,n[10]=M,n[11]=Ce,n[12]=j,n[13]=F,n[14]=g,n[15]=L,n[16]=K,n[17]=ye,n[18]=be,n[19]=H,n[20]=l,n[21]=Se,n[22]=je,n[23]=T,n[24]=J,n[25]=m,n[26]=de,n[27]=_e,n[28]=U,n[29]=G,n[30]=ve,n[31]=Te,n[32]=ee,n[33]=D,n[34]=le,n[35]=fe,n[36]=Ee,n[37]=ue,n[38]=Oe,n[39]=Ae,n[40]=ke,n[41]=C,n[42]=De,n[43]=P,n[44]=we,n[45]=N,n[46]=w.mode,n[47]=Ie):Ie=n[47],Ie}function ai(e){return e.dropdown?{...e,dropdown:e.dropdown.filter(oi)}:e}function oi(e){return!e.hidden}function si(e){return!e.hidden}function ci(){let e=kt();window.open(e,`_blank`)}function li(){let e=document.baseURI.split(`?`)[0];window.open(e,`_blank`,`noopener`)}function ui(){window.open(W.releasesPage,`_blank`)}function di(){window.open(W.youtube,`_blank`)}function fi(){window.open(W.discordLink,`_blank`)}function pi(){window.open(W.githubPage,`_blank`)}function mi(){window.open(W.docsPage,`_blank`)}function hi(e){return!e}function gi(e){return!e}function _i(e){return!e}function vi(e){return[e,{disabled:!1}]}function yi(e){return(0,X.jsx)(`div`,{className:`w-8 flex justify-end`,children:e&&(0,X.jsx)(Qe,{size:14})})}export{Fn as a,mn as c,nn as d,tn as f,In as i,pn as l,$t as m,ni as n,Pn as o,en as p,$r as r,Tn as s,ii as t,sn as u};
@@ -1 +1 @@
1
- import{f as e,t,u as n}from"./useEvent-xfs0Sn4r.js";import{D as r,Ia as i,Ua as a,h as o,ht as s,si as c}from"./cells-C6lBv8kg.js";import{t as l}from"./compiler-runtime-CYIjoINj.js";import{g as u}from"./useEventListener-D27Dii_l.js";import{o as d}from"./dist-Dz_04liz.js";import{r as f}from"./requests-C6_IaFh7.js";var p=l(),m=e(!1);function h(){let e=(0,p.c)(2),n=v(),r;return e[0]===n?r=e[1]:(r=()=>n(a(o())),e[0]=n,e[1]=r),t(r)}function g(e){let n=(0,p.c)(3),r=v(),i;return n[0]!==e||n[1]!==r?(i=()=>{e!==void 0&&r([e])},n[0]=e,n[1]=r,n[2]=i):i=n[2],t(i)}function _(){let e=(0,p.c)(2),n=v(),r;return e[0]===n?r=e[1]:(r=()=>n(i(o())),e[0]=n,e[1]=r),t(r)}function v(){let e=(0,p.c)(4),{prepareForRun:i}=r(),{sendRun:a}=f(),s=n(m),c;return e[0]!==i||e[1]!==a||e[2]!==s?(c=async e=>{if(e.length===0)return;let t=o();return s(!0),y({cellIds:e,sendRun:a,prepareForRun:i,notebook:t})},e[0]=i,e[1]=a,e[2]=s,e[3]=c):c=e[3],t(c)}async function y({cellIds:e,sendRun:t,prepareForRun:n,notebook:r}){if(e.length===0)return;let{cellHandles:i,cellData:a}=r,o=[];for(let t of e){let e=i[t]?.current?.editorView,r;e?(c(e)!==`markdown`&&d(e),r=s(e)):r=a[t]?.code||``,o.push(r),n({cellId:t})}await t({cellIds:e,codes:o}).catch(e=>{u.error(e)})}export{v as a,g as i,y as n,h as o,_ as r,m as t};
1
+ import{f as e,t,u as n}from"./useEvent-xfs0Sn4r.js";import{D as r,Ga as i,Ra as a,_t as o,h as s,li as c}from"./cells-yuYDzbAy.js";import{t as l}from"./compiler-runtime-CYIjoINj.js";import{g as u}from"./useEventListener-D27Dii_l.js";import{o as d}from"./dist-Dz_04liz.js";import{r as f}from"./requests-C6_IaFh7.js";var p=l(),m=e(!1);function h(){let e=(0,p.c)(2),n=v(),r;return e[0]===n?r=e[1]:(r=()=>n(i(s())),e[0]=n,e[1]=r),t(r)}function g(e){let n=(0,p.c)(3),r=v(),i;return n[0]!==e||n[1]!==r?(i=()=>{e!==void 0&&r([e])},n[0]=e,n[1]=r,n[2]=i):i=n[2],t(i)}function _(){let e=(0,p.c)(2),n=v(),r;return e[0]===n?r=e[1]:(r=()=>n(a(s())),e[0]=n,e[1]=r),t(r)}function v(){let e=(0,p.c)(4),{prepareForRun:i}=r(),{sendRun:a}=f(),o=n(m),c;return e[0]!==i||e[1]!==a||e[2]!==o?(c=async e=>{if(e.length===0)return;let t=s();return o(!0),y({cellIds:e,sendRun:a,prepareForRun:i,notebook:t})},e[0]=i,e[1]=a,e[2]=o,e[3]=c):c=e[3],t(c)}async function y({cellIds:e,sendRun:t,prepareForRun:n,notebook:r}){if(e.length===0)return;let{cellHandles:i,cellData:a}=r,s=[];for(let t of e){let e=i[t]?.current?.editorView,r;e?(c(e)!==`markdown`&&d(e),r=o(e)):r=a[t]?.code||``,s.push(r),n({cellId:t})}await t({cellIds:e,codes:s}).catch(e=>{u.error(e)})}export{v as a,g as i,y as n,h as o,_ as r,m as t};
@@ -1 +1 @@
1
- import{t as e}from"./useEvent-xfs0Sn4r.js";import{D as t,f as n,ht as r}from"./cells-C6lBv8kg.js";import{t as i}from"./compiler-runtime-CYIjoINj.js";import{t as a}from"./jsx-runtime-B74pBk57.js";import{r as o}from"./useDeleteCell-DB-bhhnO.js";import{t as s}from"./use-toast-DpWHUGuF.js";var c=i(),l=a();function u(){let i=(0,c.c)(3),{splitCell:a,undoSplitCell:u}=t(),d;return i[0]!==a||i[1]!==u?(d=e=>{let t=n(e.cellId);if(!t)return;let i=r(t);a(e);let{dismiss:c}=s({title:`Cell split`,action:(0,l.jsx)(o,{"data-testid":`undo-split-button`,size:`sm`,variant:`outline`,onClick:()=>{u({...e,snapshot:i}),d()},children:`Undo`})}),d=c},i[0]=a,i[1]=u,i[2]=d):d=i[2],e(d)}export{u as t};
1
+ import{t as e}from"./useEvent-xfs0Sn4r.js";import{D as t,_t as n,f as r}from"./cells-yuYDzbAy.js";import{t as i}from"./compiler-runtime-CYIjoINj.js";import{t as a}from"./jsx-runtime-B74pBk57.js";import{r as o}from"./useDeleteCell-CBQiavzs.js";import{t as s}from"./use-toast-DpWHUGuF.js";var c=i(),l=a();function u(){let i=(0,c.c)(3),{splitCell:a,undoSplitCell:u}=t(),d;return i[0]!==a||i[1]!==u?(d=e=>{let t=r(e.cellId);if(!t)return;let i=n(t);a(e);let{dismiss:c}=s({title:`Cell split`,action:(0,l.jsx)(o,{"data-testid":`undo-split-button`,size:`sm`,variant:`outline`,onClick:()=>{u({...e,snapshot:i}),d()},children:`Undo`})}),d=c},i[0]=a,i[1]=u,i[2]=d):d=i[2],e(d)}export{u as t};
package/dist/index.html CHANGED
@@ -66,7 +66,7 @@
66
66
  <marimo-server-token data-token="{{ server_token }}" hidden></marimo-server-token>
67
67
  <!-- /TODO -->
68
68
  <title>{{ title }}</title>
69
- <script type="module" crossorigin src="./assets/index-ChbtcNW2.js"></script>
69
+ <script type="module" crossorigin src="./assets/index-BID9w87A.js"></script>
70
70
  <link rel="modulepreload" crossorigin href="./assets/rolldown-runtime-B0Z9INg1.js">
71
71
  <link rel="modulepreload" crossorigin href="./assets/react-CBDbhulC.js">
72
72
  <link rel="modulepreload" crossorigin href="./assets/compiler-runtime-CYIjoINj.js">
@@ -138,7 +138,7 @@
138
138
  <link rel="modulepreload" crossorigin href="./assets/useTheme-D3zvxdF3.js">
139
139
  <link rel="modulepreload" crossorigin href="./assets/useAsyncData-Buhk-UgR.js">
140
140
  <link rel="modulepreload" crossorigin href="./assets/purify.es-DrVcFY1Q.js">
141
- <link rel="modulepreload" crossorigin href="./assets/cells-C6lBv8kg.js">
141
+ <link rel="modulepreload" crossorigin href="./assets/cells-yuYDzbAy.js">
142
142
  <link rel="modulepreload" crossorigin href="./assets/get-DjNf4SIX.js">
143
143
  <link rel="modulepreload" crossorigin href="./assets/_hasPath-BmRQipI0.js">
144
144
  <link rel="modulepreload" crossorigin href="./assets/hasIn-yw4sIeJR.js">
@@ -151,42 +151,42 @@
151
151
  <link rel="modulepreload" crossorigin href="./assets/copy-Cg05mM3C.js">
152
152
  <link rel="modulepreload" crossorigin href="./assets/extends-CvVTau-c.js">
153
153
  <link rel="modulepreload" crossorigin href="./assets/esm-Dw0vvSg2.js">
154
- <link rel="modulepreload" crossorigin href="./assets/useAddCell-DqvY2ulx.js">
155
- <link rel="modulepreload" crossorigin href="./assets/readonly-python-code-D2HXwAfT.js">
154
+ <link rel="modulepreload" crossorigin href="./assets/useAddCell-_JRYhAFd.js">
155
+ <link rel="modulepreload" crossorigin href="./assets/readonly-python-code-Bor9b9pV.js">
156
156
  <link rel="modulepreload" crossorigin href="./assets/LazyAnyLanguageCodeMirror-zSwE3dvU.js">
157
157
  <link rel="modulepreload" crossorigin href="./assets/micromark-factory-space-D9Dr-k4J.js">
158
158
  <link rel="modulepreload" crossorigin href="./assets/chunk-5FQGJX7Z-CRg4xQWg.js">
159
- <link rel="modulepreload" crossorigin href="./assets/markdown-renderer-B-uA_6mP.js">
159
+ <link rel="modulepreload" crossorigin href="./assets/markdown-renderer-BgUTGtM0.js">
160
160
  <link rel="modulepreload" crossorigin href="./assets/copy-icon-CRxVZTJ9.js">
161
- <link rel="modulepreload" crossorigin href="./assets/useRunCells-GCTS1YFv.js">
162
- <link rel="modulepreload" crossorigin href="./assets/RenderHTML-BnMaGpV8.js">
163
- <link rel="modulepreload" crossorigin href="./assets/blob-CYM8xQsK.js">
161
+ <link rel="modulepreload" crossorigin href="./assets/useRunCells-BFQfLlUl.js">
162
+ <link rel="modulepreload" crossorigin href="./assets/RenderHTML-D9-75ltP.js">
163
+ <link rel="modulepreload" crossorigin href="./assets/blob-yxfhyyvD.js">
164
164
  <link rel="modulepreload" crossorigin href="./assets/share-C2MPy_VX.js">
165
165
  <link rel="modulepreload" crossorigin href="./assets/events-CbeVJ6OD.js">
166
- <link rel="modulepreload" crossorigin href="./assets/state-C9O-2hQL.js">
166
+ <link rel="modulepreload" crossorigin href="./assets/state-D1N9_41P.js">
167
167
  <link rel="modulepreload" crossorigin href="./assets/ErrorBoundary-npvnLp9x.js">
168
168
  <link rel="modulepreload" crossorigin href="./assets/config-Cl3eMWxb.js">
169
169
  <link rel="modulepreload" crossorigin href="./assets/tabs-c6mpccpH.js">
170
170
  <link rel="modulepreload" crossorigin href="./assets/chevron-right-CKA5zVsM.js">
171
171
  <link rel="modulepreload" crossorigin href="./assets/dropdown-menu-CqNabM1f.js">
172
172
  <link rel="modulepreload" crossorigin href="./assets/html-to-image-DMn_7CCA.js">
173
- <link rel="modulepreload" crossorigin href="./assets/download-Cqjqrhzo.js">
173
+ <link rel="modulepreload" crossorigin href="./assets/download-D1crMjD8.js">
174
174
  <link rel="modulepreload" crossorigin href="./assets/table-CUK1W5bI.js">
175
175
  <link rel="modulepreload" crossorigin href="./assets/refresh-cw-Bf-rx_aV.js">
176
- <link rel="modulepreload" crossorigin href="./assets/tree-actions-CGkbUSfG.js">
176
+ <link rel="modulepreload" crossorigin href="./assets/tree-actions-Bh-Nnaub.js">
177
177
  <link rel="modulepreload" crossorigin href="./assets/ellipsis-Dfik_tuW.js">
178
178
  <link rel="modulepreload" crossorigin href="./assets/external-link-Bp3BxyRA.js">
179
179
  <link rel="modulepreload" crossorigin href="./assets/spinner-Ck-Hgfvj.js">
180
180
  <link rel="modulepreload" crossorigin href="./assets/message-circle-BQB1AIAg.js">
181
181
  <link rel="modulepreload" crossorigin href="./assets/hat-glasses-C8LSY3HT.js">
182
182
  <link rel="modulepreload" crossorigin href="./assets/package-DPlscLzt.js">
183
- <link rel="modulepreload" crossorigin href="./assets/datasource-D-_jFtGs.js">
183
+ <link rel="modulepreload" crossorigin href="./assets/datasource-DeZYq5UY.js">
184
184
  <link rel="modulepreload" crossorigin href="./assets/kbd-Cwh96ZBE.js">
185
185
  <link rel="modulepreload" crossorigin href="./assets/alert-dmKwNsrp.js">
186
186
  <link rel="modulepreload" crossorigin href="./assets/useInstallPackage-u7d0wo79.js">
187
- <link rel="modulepreload" crossorigin href="./assets/state-DyxPdcEa.js">
188
- <link rel="modulepreload" crossorigin href="./assets/cell-link-DCOAqVkE.js">
189
- <link rel="modulepreload" crossorigin href="./assets/MarimoErrorOutput-C0vk393J.js">
187
+ <link rel="modulepreload" crossorigin href="./assets/state-O8w98G11.js">
188
+ <link rel="modulepreload" crossorigin href="./assets/cell-link-hHrWcozB.js">
189
+ <link rel="modulepreload" crossorigin href="./assets/MarimoErrorOutput-DCAezqcJ.js">
190
190
  <link rel="modulepreload" crossorigin href="./assets/VisuallyHidden-SChAyKIQ.js">
191
191
  <link rel="modulepreload" crossorigin href="./assets/useDateFormatter-BiqAQ-zI.js">
192
192
  <link rel="modulepreload" crossorigin href="./assets/en-US-yTIMUO13.js">
@@ -205,23 +205,23 @@
205
205
  <link rel="modulepreload" crossorigin href="./assets/formats-DSzGCKeO.js">
206
206
  <link rel="modulepreload" crossorigin href="./assets/table-DmqOOjfe.js">
207
207
  <link rel="modulepreload" crossorigin href="./assets/react-resizable-panels.browser.esm-BSRAHC4P.js">
208
- <link rel="modulepreload" crossorigin href="./assets/JsonOutput-B7sDhGzR.js">
208
+ <link rel="modulepreload" crossorigin href="./assets/JsonOutput-CUJlEdsN.js">
209
209
  <link rel="modulepreload" crossorigin href="./assets/chart-no-axes-column-ChZdjJhj.js">
210
210
  <link rel="modulepreload" crossorigin href="./assets/square-function-DkZweMAs.js">
211
211
  <link rel="modulepreload" crossorigin href="./assets/spec-CUFquO6R.js">
212
212
  <link rel="modulepreload" crossorigin href="./assets/semaphore-BjoL5P0h.js">
213
213
  <link rel="modulepreload" crossorigin href="./assets/fileToBase64-NhpNrK5l.js">
214
- <link rel="modulepreload" crossorigin href="./assets/useBoolean-DWBCpKfT.js">
214
+ <link rel="modulepreload" crossorigin href="./assets/useBoolean-Cu7Eado1.js">
215
215
  <link rel="modulepreload" crossorigin href="./assets/code-xml-B7x62Eeh.js">
216
216
  <link rel="modulepreload" crossorigin href="./assets/file-headphone-rFCxFRI8.js">
217
217
  <link rel="modulepreload" crossorigin href="./assets/file-DF8n85RA.js">
218
218
  <link rel="modulepreload" crossorigin href="./assets/image-ab13yGv4.js">
219
- <link rel="modulepreload" crossorigin href="./assets/file-icons-uUY_hGYm.js">
219
+ <link rel="modulepreload" crossorigin href="./assets/file-icons-Dx3v6lMu.js">
220
220
  <link rel="modulepreload" crossorigin href="./assets/globe-BQf75qV_.js">
221
221
  <link rel="modulepreload" crossorigin href="./assets/markdown-export-0rLbaq8b.js">
222
222
  <link rel="modulepreload" crossorigin href="./assets/data-grid-types-DgHVN_Zz.js">
223
223
  <link rel="modulepreload" crossorigin href="./assets/glide-utils-CR1sWLZU.js">
224
- <link rel="modulepreload" crossorigin href="./assets/column-preview-CatwdUda.js">
224
+ <link rel="modulepreload" crossorigin href="./assets/column-preview-BEmcYaKl.js">
225
225
  <link rel="modulepreload" crossorigin href="./assets/square-B58Ib8Ir.js">
226
226
  <link rel="modulepreload" crossorigin href="./assets/triangle-alert-MihykDYG.js">
227
227
  <link rel="modulepreload" crossorigin href="./assets/prop-types-Djf4O40e.js">
@@ -231,7 +231,7 @@
231
231
  <link rel="modulepreload" crossorigin href="./assets/icons-CjLa9BiH.js">
232
232
  <link rel="modulepreload" crossorigin href="./assets/useDeepCompareMemoize-CLytDdMl.js">
233
233
  <link rel="modulepreload" crossorigin href="./assets/pathUtils-Cryrlpma.js">
234
- <link rel="modulepreload" crossorigin href="./assets/floating-outline-DhGtHg6T.js">
234
+ <link rel="modulepreload" crossorigin href="./assets/floating-outline-3rQEbxxk.js">
235
235
  <link rel="stylesheet" crossorigin href="./assets/cells-D-c15Ks-.css">
236
236
  <link rel="stylesheet" crossorigin href="./assets/markdown-renderer-B7zTpxjS.css">
237
237
  <link rel="stylesheet" crossorigin href="./assets/JsonOutput-BQtz7-np.css">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/frontend",
3
- "version": "0.24.1-dev80",
3
+ "version": "0.24.1-dev82",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -1,8 +1,12 @@
1
1
  /* Copyright 2026 Marimo. All rights reserved. */
2
2
 
3
3
  import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
4
+ import { getSerializedLayout } from "@/core/layout/layout";
5
+ import { initialLayoutState, layoutStateAtom } from "@/core/layout/state";
6
+ import { kioskModeAtom } from "@/core/mode";
4
7
  import { connectionAtom } from "@/core/network/connection";
5
8
  import { store } from "@/core/state/jotai";
9
+ import { isStaticNotebook } from "@/core/static/static-state";
6
10
  import { WebSocketState } from "@/core/websocket/types";
7
11
  import { mount, visibleForTesting } from "../mount";
8
12
 
@@ -15,6 +19,8 @@ vi.mock("react-dom/client", () => ({
15
19
 
16
20
  // Mock static state
17
21
  vi.mock("@/core/static/static-state", () => ({
22
+ getStaticModelNotifications: vi.fn(() => undefined),
23
+ getStaticVirtualFiles: vi.fn(() => ({})),
18
24
  isStaticNotebook: vi.fn(() => false),
19
25
  }));
20
26
 
@@ -46,6 +52,10 @@ describe("mount", () => {
46
52
 
47
53
  beforeEach(() => {
48
54
  visibleForTesting.reset();
55
+ window.history.replaceState({}, "", "/");
56
+ vi.mocked(isStaticNotebook).mockReturnValue(false);
57
+ store.set(layoutStateAtom, initialLayoutState());
58
+ store.set(kioskModeAtom, false);
49
59
  // Reset connection atom to initial state
50
60
  store.set(connectionAtom, { state: WebSocketState.NOT_STARTED });
51
61
  });
@@ -66,6 +76,12 @@ describe("mount", () => {
66
76
  serverToken: "",
67
77
  };
68
78
 
79
+ const mountRead = (options: Record<string, unknown> = {}) =>
80
+ mount(
81
+ { ...baseOptions, mode: "read", runtimeConfig: [], ...options },
82
+ mockElement,
83
+ );
84
+
69
85
  describe("connection state initialization", () => {
70
86
  it("should set connection to CONNECTING when runtimeConfig has lazy=false", () => {
71
87
  mount(
@@ -106,8 +122,7 @@ describe("mount", () => {
106
122
  expect(connection.state).toBe(WebSocketState.NOT_STARTED);
107
123
  });
108
124
 
109
- it("should keep connection as NOT_STARTED for static notebooks even with lazy=false", async () => {
110
- const { isStaticNotebook } = await import("@/core/static/static-state");
125
+ it("should keep connection as NOT_STARTED for static notebooks even with lazy=false", () => {
111
126
  vi.mocked(isStaticNotebook).mockReturnValue(true);
112
127
 
113
128
  // Reset mount state to allow another mount
@@ -125,4 +140,41 @@ describe("mount", () => {
125
140
  expect(connection.state).toBe(WebSocketState.NOT_STARTED);
126
141
  });
127
142
  });
143
+
144
+ it("hydrates the layout embedded in the mount config", () => {
145
+ const layout = {
146
+ type: "slides",
147
+ data: {
148
+ deck: { transition: "fade", verticalAlign: "center" },
149
+ },
150
+ };
151
+ const error = mountRead({ layout });
152
+
153
+ expect(error).toBeUndefined();
154
+ const layoutState = store.get(layoutStateAtom);
155
+ expect(layoutState.selectedLayout).toBe("slides");
156
+ expect(getSerializedLayout()).toEqual({
157
+ type: "slides",
158
+ data: {
159
+ cells: [],
160
+ deck: { transition: "fade", verticalAlign: "center" },
161
+ },
162
+ });
163
+ });
164
+
165
+ it("uses vertical layout for malformed mount data", () => {
166
+ const error = mountRead({ layout: { data: {} } });
167
+
168
+ expect(error).toBeUndefined();
169
+ expect(store.get(layoutStateAtom)).toEqual(initialLayoutState());
170
+ });
171
+
172
+ it("starts kiosk clients in kiosk mode", () => {
173
+ window.history.replaceState({}, "", "/?kiosk=true");
174
+
175
+ const error = mountRead();
176
+
177
+ expect(error).toBeUndefined();
178
+ expect(store.get(kioskModeAtom)).toBe(true);
179
+ });
128
180
  });
@@ -3,7 +3,7 @@ import { render, screen } from "@testing-library/react";
3
3
  import { createStore, Provider } from "jotai";
4
4
  import { describe, expect, it, vi } from "vitest";
5
5
  import { TooltipProvider } from "@/components/ui/tooltip";
6
- import { layoutStateAtom } from "@/core/layout/layout";
6
+ import { layoutStateAtom } from "@/core/layout/state";
7
7
  import { kioskModeAtom, viewStateAtom } from "@/core/mode";
8
8
  import { API } from "@/core/network/api";
9
9
  import { ViewerBanner } from "../viewer-banner";
@@ -43,12 +43,17 @@ describe("exportNotebook", () => {
43
43
  let captureOutputs: Mock<() => Promise<void>>;
44
44
  let capturePNG: Mock<() => Promise<void>>;
45
45
  let downloadFile: Mock<(file: ExportedFile) => void>;
46
+ let getLayout: Mock;
46
47
 
47
48
  beforeEach(() => {
48
49
  requests = makeRequests();
49
50
  captureOutputs = vi.fn().mockResolvedValue(undefined);
50
51
  capturePNG = vi.fn().mockResolvedValue(undefined);
51
52
  downloadFile = vi.fn();
53
+ getLayout = vi.fn().mockResolvedValue({
54
+ type: "slides",
55
+ data: { deck: { transition: "fade" } },
56
+ });
52
57
  });
53
58
 
54
59
  const run = (
@@ -61,6 +66,7 @@ describe("exportNotebook", () => {
61
66
  requests,
62
67
  sourceFilename: "notebook.py",
63
68
  htmlFiles: ["data.csv"],
69
+ getLayout,
64
70
  captureOutputs,
65
71
  capturePNG,
66
72
  downloadFile,
@@ -73,8 +79,10 @@ describe("exportNotebook", () => {
73
79
  download: false,
74
80
  files: ["data.csv"],
75
81
  includeCode: false,
82
+ layout: { type: "slides", data: { deck: { transition: "fade" } } },
76
83
  });
77
84
  expect(downloadFile).toHaveBeenCalledWith(FILE);
85
+ expect(getLayout).toHaveBeenCalledOnce();
78
86
  });
79
87
 
80
88
  it("passes the selected Markdown flavor through the session API", async () => {
@@ -84,6 +92,7 @@ describe("exportNotebook", () => {
84
92
  download: false,
85
93
  flavor: "qmd",
86
94
  });
95
+ expect(getLayout).not.toHaveBeenCalled();
87
96
  expect(downloadFile).toHaveBeenCalledWith(FILE);
88
97
  });
89
98
 
@@ -1,6 +1,10 @@
1
1
  /* Copyright 2026 Marimo. All rights reserved. */
2
2
 
3
- import type { EditRequests, ExportedFile } from "@/core/network/types";
3
+ import type {
4
+ EditRequests,
5
+ ExportAsHTMLRequest,
6
+ ExportedFile,
7
+ } from "@/core/network/types";
4
8
  import { assertNever } from "@/utils/assertNever";
5
9
  import { runServerSidePDFDownload } from "../pdf-export";
6
10
  import type { ExportFormat, ExportOptions } from "./state";
@@ -21,6 +25,7 @@ export async function exportNotebook({
21
25
  requests,
22
26
  sourceFilename,
23
27
  htmlFiles,
28
+ getLayout,
24
29
  captureOutputs,
25
30
  capturePNG,
26
31
  downloadFile,
@@ -30,6 +35,7 @@ export async function exportNotebook({
30
35
  requests: ExportRequests;
31
36
  sourceFilename: string;
32
37
  htmlFiles: string[];
38
+ getLayout: () => Promise<ExportAsHTMLRequest["layout"]>;
33
39
  captureOutputs: () => Promise<void>;
34
40
  capturePNG: () => Promise<void>;
35
41
  downloadFile: (file: ExportedFile) => void;
@@ -40,6 +46,7 @@ export async function exportNotebook({
40
46
  download: false,
41
47
  files: htmlFiles,
42
48
  includeCode: options.html.includeCode,
49
+ layout: await getLayout(),
43
50
  });
44
51
  downloadFile(file);
45
52
  return;
@@ -7,6 +7,7 @@ import {
7
7
  updateCellOutputsWithScreenshots,
8
8
  useEnrichCellOutputs,
9
9
  } from "@/core/export/hooks";
10
+ import { getExportLayout } from "@/core/export/layout";
10
11
  import { runDuringPresentMode, useInstallAllowed } from "@/core/mode";
11
12
  import { useRequestClient } from "@/core/network/requests";
12
13
  import type { ExportAvailabilityResponse } from "@/core/network/types";
@@ -349,6 +350,7 @@ function useExportDialogAction({
349
350
  requests,
350
351
  sourceFilename,
351
352
  htmlFiles: VirtualFileTracker.INSTANCE.filenames(),
353
+ getLayout: getExportLayout,
352
354
  captureOutputs: () => captureOutputs(progress),
353
355
  capturePNG,
354
356
  downloadFile: downloadExportedFile,
@@ -66,7 +66,7 @@ import { disabledCellIds } from "@/core/cells/utils";
66
66
  import { capabilitiesAtom } from "@/core/config/capabilities";
67
67
  import { aiEnabledAtom, useResolvedMarimoConfig } from "@/core/config/config";
68
68
  import { Constants } from "@/core/constants";
69
- import { useLayoutActions, useLayoutState } from "@/core/layout/layout";
69
+ import { useLayoutActions, useLayoutState } from "@/core/layout/state";
70
70
  import { useTogglePresenting } from "@/core/layout/useTogglePresenting";
71
71
  import { kioskModeAtom, viewStateAtom } from "@/core/mode";
72
72
  import { useRequestClient } from "@/core/network/requests";
@@ -18,7 +18,7 @@ import {
18
18
  invalidateDataSourceDiscovery,
19
19
  } from "@/core/datasets/data-source-discovery";
20
20
  import { DiscoverDataSources } from "@/core/datasets/request-registry";
21
- import { layoutStateAtom } from "@/core/layout/layout";
21
+ import { layoutStateAtom } from "@/core/layout/state";
22
22
  import { kioskModeAtom, viewStateAtom } from "@/core/mode";
23
23
  import { connectionAtom } from "@/core/network/connection";
24
24
  import { requestClientAtom } from "@/core/network/requests";
@@ -4,7 +4,7 @@ import { createStore, Provider } from "jotai";
4
4
  import { describe, expect, it } from "vitest";
5
5
  import { MockRequestClient } from "@/__mocks__/requests";
6
6
  import { parseAppConfig } from "@/core/config/config-schema";
7
- import { initialLayoutState, layoutStateAtom } from "@/core/layout/layout";
7
+ import { initialLayoutState, layoutStateAtom } from "@/core/layout/state";
8
8
  import { type AppMode, kioskModeAtom } from "@/core/mode";
9
9
  import { requestClientAtom } from "@/core/network/requests";
10
10
  import { CellsRenderer } from "../cells-renderer";