@marimo-team/frontend 0.23.16-dev36 → 0.23.16-dev37
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.
- package/dist/assets/{CellStatus-Dua-Q5qp.js → CellStatus-C6Cj3oJc.js} +1 -1
- package/dist/assets/{JsonOutput-BjTsPSAI.js → JsonOutput-CyzvjIjx.js} +6 -6
- package/dist/assets/{MarimoErrorOutput-BSyqD6Hg.js → MarimoErrorOutput-CIuzXFFo.js} +8 -8
- package/dist/assets/{RenderHTML-DG0Fm01X.js → RenderHTML-Cd-PP5ZR.js} +1 -1
- package/dist/assets/{RunButton-DFs1N-c9.js → RunButton-CnYWedW4.js} +1 -1
- package/dist/assets/{add-cell-with-ai-C6Kxfu_D.js → add-cell-with-ai-ByOBQT99.js} +10 -10
- package/dist/assets/{add-connection-dialog-DAqIrB2O.js → add-connection-dialog-C97ylgk0.js} +1 -1
- package/dist/assets/{agent-panel-GtkUm7qc.js → agent-panel-Dxo9WUKV.js} +5 -5
- package/dist/assets/{ai-model-dropdown-UEHQ_Tx0.js → ai-model-dropdown-Bvqy98cI.js} +3 -3
- package/dist/assets/{app-config-button-BmBlROBo.js → app-config-button-v1lG63C2.js} +1 -1
- package/dist/assets/{cell-editor-DKzBZjFa.js → cell-editor-BKrHbyX_.js} +16 -16
- package/dist/assets/cell-link-w5IbCQV4.js +1 -0
- package/dist/assets/{cells-C-9Qa_6_.js → cells-DzyDERZy.js} +57 -57
- package/dist/assets/{chat-display-CqB9H1kF.js → chat-display-Ccgk4vbE.js} +1 -1
- package/dist/assets/{chat-panel-C3wpuHtk.js → chat-panel--53TIc3t.js} +4 -4
- package/dist/assets/{chat-ui-DF2nZlBy.js → chat-ui-B5rBxgsw.js} +4 -4
- package/dist/assets/{column-preview-Bp4QHPE2.js → column-preview-Cb8R9kfl.js} +1 -1
- package/dist/assets/{command-palette-DaJdKaQz.js → command-palette-B1S9PjZi.js} +1 -1
- package/dist/assets/{common-DeheUlBO.js → common-CJ3baa6D.js} +1 -1
- package/dist/assets/{components-Dk-7Tn_8.js → components-DpUIWGaj.js} +1 -1
- package/dist/assets/{datasource-D-oZZRFN.js → datasource-D_VcQMEn.js} +2 -2
- package/dist/assets/{dependency-graph-panel-JK4qjNID.js → dependency-graph-panel-DY5lvPDx.js} +4 -4
- package/dist/assets/{documentation-panel-C_TxLeX8.js → documentation-panel-CGhwxsXK.js} +1 -1
- package/dist/assets/{download-QhwPYWYu.js → download-DpS57jyt.js} +2 -2
- package/dist/assets/{edit-page-C8yy6X_7.js → edit-page-DA765yQV.js} +6 -6
- package/dist/assets/error-entries-CTYMwfsh.js +8 -0
- package/dist/assets/{error-panel-BOBOm9wN.js → error-panel-DGAkG5kW.js} +1 -1
- package/dist/assets/{file-explorer-panel-CQOFpuIG.js → file-explorer-panel-BKUo-MDh.js} +3 -3
- package/dist/assets/{file-icons-DoBeqg86.js → file-icons-DfWENcb8.js} +1 -1
- package/dist/assets/{file-name-input-B8d-QPzY.js → file-name-input-CNVZtm5K.js} +1 -1
- package/dist/assets/{floating-outline-ylNOBTvA.js → floating-outline-LitP0wCD.js} +1 -1
- package/dist/assets/{focus-CJzSyxLL.js → focus-CNKbm-Xz.js} +1 -1
- package/dist/assets/{form-C2_p_FeE.js → form-nHzLTU1m.js} +2 -2
- package/dist/assets/{home-page-D_6eKuGc.js → home-page-DM9Z_IJ7.js} +1 -1
- package/dist/assets/{html-to-image-DfyxinVN.js → html-to-image-JaxFFZcr.js} +2 -2
- package/dist/assets/{index-D-wPCBTa.js → index-C7_REKh1.js} +6 -6
- package/dist/assets/{layout-BWV4OadK.js → layout-B29hqiiK.js} +5 -5
- package/dist/assets/{logs-panel-DpMLUEOB.js → logs-panel-CQRPYS8j.js} +1 -1
- package/dist/assets/{markdown-renderer-DtzxgcfB.js → markdown-renderer-sEayY9-m.js} +2 -2
- package/dist/assets/{name-cell-input-SbknxDvi.js → name-cell-input-B-aj1KH3.js} +1 -1
- package/dist/assets/{outline-panel-kV7ARoXE.js → outline-panel-BOryk60D.js} +1 -1
- package/dist/assets/{packages-panel-B3biBPQ1.js → packages-panel-DoYDLty3.js} +1 -1
- package/dist/assets/{panels-BsrSW0bC.js → panels-Bb4fIHgH.js} +2 -2
- package/dist/assets/{process-output-DCAOrKEU.js → process-output-d-LEMtGI.js} +1 -1
- package/dist/assets/{radio-group-BWAhJtjV.js → radio-group-DfioQthW.js} +1 -1
- package/dist/assets/readonly-code-display-C9fu8tvK.js +1 -0
- package/dist/assets/{readonly-python-code-B5ABqdqK.js → readonly-python-code-DHxOnQGj.js} +1 -1
- package/dist/assets/{reveal-component-CrcdxGl_.js → reveal-component-5jf0W625.js} +2 -2
- package/dist/assets/{run-page-DFHpKr66.js → run-page-BMKx9ld_.js} +1 -1
- package/dist/assets/scratchpad-panel-C8z8vzBX.js +1 -0
- package/dist/assets/{session-panel-DWS61Z1x.js → session-panel-BVVk-02h.js} +1 -1
- package/dist/assets/{skeleton-PJnQ2_IA.js → skeleton-Bubr9pIj.js} +1 -1
- package/dist/assets/{snippets-panel-D1eovB0O.js → snippets-panel-U2-iok-c.js} +1 -1
- package/dist/assets/{state-Bu-aMpIc.js → state-DtziTd1T.js} +3 -3
- package/dist/assets/{state-BjouLTuw.js → state-DxQhUsG9.js} +1 -1
- package/dist/assets/{textarea-DhPaQ0wx.js → textarea-Bmzmbbpo.js} +1 -1
- package/dist/assets/{tracing-B2ux60rQ.js → tracing-B5XFvMmV.js} +1 -1
- package/dist/assets/{tracing-panel-CF8H5wRv.js → tracing-panel-DnR2bYDe.js} +2 -2
- package/dist/assets/{tree-actions-CPSDN4eE.js → tree-actions-Dx9CDaxV.js} +1 -1
- package/dist/assets/{useCellActionButton-k2OXllYI.js → useCellActionButton-DypR3yDt.js} +1 -1
- package/dist/assets/{useDeleteCell-C3nmnuxK.js → useDeleteCell-vMXAr3rY.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-D14Lna3z.js → useDependencyPanelTab-CwdwKf7A.js} +1 -1
- package/dist/assets/{useNotebookActions-CHM0Ardg.js → useNotebookActions-jWIcmpv0.js} +3 -3
- package/dist/assets/useRunCells-C2dvU2jA.js +1 -0
- package/dist/assets/useSplitCell-C1tubdNi.js +1 -0
- package/dist/index.html +22 -22
- package/package.json +1 -1
- package/src/components/editor/cell/code/__tests__/cell-editor-activity-lifecycle.test.ts +250 -0
- package/src/components/editor/cell/code/cell-editor.tsx +13 -7
- package/src/core/cells/cells.ts +4 -4
- package/src/core/rtc/state.ts +9 -0
- package/dist/assets/cell-link-CRHwRCw2.js +0 -1
- package/dist/assets/error-entries-B8hPG61B.js +0 -8
- package/dist/assets/readonly-code-display-D_rgEfAm.js +0 -1
- package/dist/assets/scratchpad-panel-CfqnZK3C.js +0 -1
- package/dist/assets/useRunCells-C4qD32Ix.js +0 -1
- package/dist/assets/useSplitCell-BEebdldD.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as ae}from"./chunk-LvLJmgfZ.js";import{d as ie,u as b}from"./useEvent-D91BmmQi.js";import{
|
|
1
|
+
import{s as ae}from"./chunk-LvLJmgfZ.js";import{d as ie,u as b}from"./useEvent-D91BmmQi.js";import{E as de,Er as ne,Gn as se,Or as re,St as F,Tr as ce,Wn as he,_ as me,ar as pe,ea as ke,wr as fe}from"./cells-DzyDERZy.js";import{t as ue}from"./compiler-runtime-B3qBwwSJ.js";import{c as ye,i as be,s as xe}from"./utils-BWBBpCkT.js";import{O as je}from"./config-B-Q7J_6d.js";import{t as ve}from"./jsx-runtime-Blw4afVn.js";import{t as we}from"./label-CqjrpwRC.js";import{a as Ce,g as ge}from"./download-DpS57jyt.js";import{r as Ie}from"./requests-9-v2bhoi.js";import{t as f}from"./createLucideIcon-w-Qo9n0R.js";import{n as G,r as K}from"./x-C-Eq0ag8.js";import{t as ze}from"./chevron-right-BS_NcSch.js";import{t as Q}from"./circle-plus-BluydVNx.js";import{t as We}from"./code-xml-aSiY8T7C.js";import{t as Me}from"./eye-off-BOZA7gbn.js";import{t as _e}from"./image-5XI2VU-q.js";import{t as Se}from"./link-CHdiBDr5.js";import{i as Ae,t as Te}from"./useDeleteCell-vMXAr3rY.js";import{t as Ee}from"./sparkles-DUCpRFlS.js";import{t as Oe}from"./trash-2-72W0TZ3L.js";import{t as De}from"./use-toast-BwJoaaDM.js";import{n as Ne}from"./copy-Bxb1_Gtw.js";import{i as Re}from"./useRunCells-C2dvU2jA.js";import{a as Be,c as He,n as Le}from"./dialog-BCVepWLJ.js";import{n as qe}from"./ImperativeModal-fY-ZfT0b.js";import{n as Pe}from"./state-DxQhUsG9.js";import{r as V}from"./html-to-image-JaxFFZcr.js";import{n as Ue,t as Fe}from"./icons-CIPE8AIY.js";import{n as $}from"./name-cell-input-B-aj1KH3.js";import{t as J}from"./multi-icon-nrKPWjDU.js";import{t as Ge}from"./useSplitCell-C1tubdNi.js";var X=f("chevrons-down",[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]]),Y=f("chevrons-up",[["path",{d:"m17 11-5-5-5 5",key:"e8nh98"}],["path",{d:"m17 18-5-5-5 5",key:"2avn1x"}]]),Z=f("scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]),Ke=f("text-cursor-input",[["path",{d:"M12 20h-1a2 2 0 0 1-2-2 2 2 0 0 1-2 2H6",key:"1528k5"}],["path",{d:"M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7",key:"13ksps"}],["path",{d:"M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1",key:"1n9rhb"}],["path",{d:"M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1",key:"1mj8rg"}],["path",{d:"M9 6v12",key:"velyjx"}]]),ee=f("zap-off",[["path",{d:"M10.513 4.856 13.12 2.17a.5.5 0 0 1 .86.46l-1.377 4.317",key:"193nxd"}],["path",{d:"M15.656 10H20a1 1 0 0 1 .78 1.63l-1.72 1.773",key:"27a7lr"}],["path",{d:"M16.273 16.273 10.88 21.83a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14H4a1 1 0 0 1-.78-1.63l4.507-4.643",key:"1e0qe9"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),le=f("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function Qe(a){let e=new URL(window.location.href);return e.hash=`scrollTo=${encodeURIComponent(a)}`,e.toString()}function Ve(a){var c;let e=(c=a.match(/scrollTo=([^&]+)/))==null?void 0:c[1];return e?decodeURIComponent(e.split("&")[0]):null}function oe(a){return a==="_"?!1:!!(a&&a.trim().length>0)}var $e=ue(),l=ae(ve(),1);function Je(a){let e=(0,$e.c)(47),{cell:c,closePopover:u}=a,{createNewCell:m,updateCellConfig:s,updateCellName:x,moveCell:p,sendToTop:W,sendToBottom:M,addColumnBreakpoint:_,clearCellOutput:S,markUntouched:A}=de(),T=Ge(),E=Re(c==null?void 0:c.cellId),O=!b(me),D=Te(),{openModal:j}=qe(),N=ie(Pe),R=b(be),v=b(ye),te=b(je),y=b(xe),{saveCellConfig:r}=Ie();if(!c||te){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=[],e[0]=o):o=e[0],o}let{cellId:t,config:i,getEditorView:n,name:h,hasOutput:w,hasConsoleOutput:B,status:H}=c,C;e[1]!==t||e[2]!==i.disabled||e[3]!==r||e[4]!==s?(C=async()=>{let o={disabled:!i.disabled};await r({configs:{[t]:o}}),s({cellId:t,config:o})},e[1]=t,e[2]=i.disabled,e[3]=r,e[4]=s,e[5]=C):C=e[5];let L=C,g;e[6]!==t||e[7]!==i.hide_code||e[8]!==n||e[9]!==r||e[10]!==s?(g=async()=>{let o={hide_code:!i.hide_code};await r({configs:{[t]:o}}),s({cellId:t,config:o});let U=n();U&&(o.hide_code?U.contentDOM.blur():U.focus())},e[6]=t,e[7]=i.hide_code,e[8]=n,e[9]=r,e[10]=s,e[11]=g):g=e[11];let q=g,d=t===ke,I;e[12]===Symbol.for("react.memo_cache_sentinel")?(I=(0,l.jsx)(Ae,{size:13,strokeWidth:1.5}),e[12]=I):I=e[12];let P=H==="running"||H==="queued"||H==="disabled-transitively"||i.disabled,k;e[13]===E?k=e[14]:(k=()=>E(),e[13]=E,e[14]=k);let z;return e[15]!==_||e[16]!==R||e[17]!==y||e[18]!==v||e[19]!==O||e[20]!==t||e[21]!==S||e[22]!==u||e[23]!==i.disabled||e[24]!==i.hide_code||e[25]!==m||e[26]!==D||e[27]!==n||e[28]!==B||e[29]!==w||e[30]!==d||e[31]!==A||e[32]!==p||e[33]!==h||e[34]!==j||e[35]!==r||e[36]!==M||e[37]!==W||e[38]!==N||e[39]!==T||e[40]!==P||e[41]!==k||e[42]!==L||e[43]!==q||e[44]!==s||e[45]!==x?(z=[[{icon:I,label:"Run cell",hotkey:"cell.run",hidden:P,redundant:!0,handle:k},{icon:(0,l.jsx)(Ee,{size:13,strokeWidth:1.5}),label:"Refactor with AI",hidden:!R,handle:()=>{N(o=>(o==null?void 0:o.cellId)===t?null:{cellId:t})},hotkey:"cell.aiCompletion"},{icon:(0,l.jsx)(Z,{size:13,strokeWidth:1.5}),label:"Split",hotkey:"cell.splitCell",handle:()=>T({cellId:t})},{icon:(0,l.jsx)(We,{size:13,strokeWidth:1.5}),label:"Format",hotkey:"cell.format",handle:()=>{let o=n();o&&pe({[t]:o})}},{icon:i.hide_code?(0,l.jsx)(fe,{size:13,strokeWidth:1.5}):(0,l.jsx)(Me,{size:13,strokeWidth:1.5}),label:i.hide_code?"Show code":"Hide code",handle:q,hotkey:"cell.hideCode"},{icon:i.disabled?(0,l.jsx)(ee,{size:13,strokeWidth:1.5}):(0,l.jsx)(le,{size:13,strokeWidth:1.5}),label:i.disabled?"Enable execution":"Disable execution",handle:L,hidden:d}],[{icon:(0,l.jsx)(Fe,{}),label:"Convert to Markdown",hotkey:"cell.viewAsMarkdown",handle:async()=>{let o=n();o&&(V({autoInstantiate:v,createNewCell:m}),F(o,{language:"markdown",keepCodeAsIs:!1}),i.hide_code||(await r({configs:{[t]:{hide_code:!0}}}),s({cellId:t,config:{hide_code:!0}}),A({cellId:t})))},hidden:d},he(n())==="sql"?{icon:(0,l.jsx)(Ue,{}),label:"View as Python",hotkey:"cell.viewAsSQL",handle:()=>{let o=n();o&&se(o,"python",{force:!0})},hidden:d}:{icon:(0,l.jsx)(ce,{size:13,strokeWidth:1.5}),label:"Convert to SQL",hotkey:"cell.viewAsSQL",handle:()=>{let o=n();o&&(V({autoInstantiate:v,createNewCell:m}),F(o,{language:"sql",keepCodeAsIs:!1}))},hidden:d}],[{icon:(0,l.jsxs)(J,{children:[(0,l.jsx)(Q,{size:13,strokeWidth:1.5}),(0,l.jsx)(G,{size:8,strokeWidth:2})]}),label:"Create cell above",hotkey:"cell.createAbove",handle:()=>m({cellId:t,before:!0}),hidden:d,redundant:!0},{icon:(0,l.jsxs)(J,{children:[(0,l.jsx)(Q,{size:13,strokeWidth:1.5}),(0,l.jsx)(K,{size:8,strokeWidth:2})]}),label:"Create cell below",hotkey:"cell.createBelow",handle:()=>m({cellId:t,before:!1}),redundant:!0},{icon:(0,l.jsx)(G,{size:13,strokeWidth:1.5}),label:"Move cell up",hotkey:"cell.moveUp",handle:()=>p({cellId:t,before:!0}),hidden:d},{icon:(0,l.jsx)(K,{size:13,strokeWidth:1.5}),label:"Move cell down",hotkey:"cell.moveDown",handle:()=>p({cellId:t,before:!1}),hidden:d},{icon:(0,l.jsx)(ge,{size:13,strokeWidth:1.5}),label:"Move cell left",hotkey:"cell.moveLeft",handle:()=>p({cellId:t,direction:"left"}),hidden:y!=="columns"||d},{icon:(0,l.jsx)(ze,{size:13,strokeWidth:1.5}),label:"Move cell right",hotkey:"cell.moveRight",handle:()=>p({cellId:t,direction:"right"}),hidden:y!=="columns"||d},{icon:(0,l.jsx)(Y,{size:13,strokeWidth:1.5}),label:"Send to top",hotkey:"cell.sendToTop",handle:()=>W({cellId:t,scroll:!1}),hidden:d},{icon:(0,l.jsx)(X,{size:13,strokeWidth:1.5}),label:"Send to bottom",hotkey:"cell.sendToBottom",handle:()=>M({cellId:t,scroll:!1}),hidden:d},{icon:(0,l.jsx)(ne,{size:13,strokeWidth:1.5}),label:"Break into new column",hotkey:"cell.addColumnBreakpoint",handle:()=>_({cellId:t}),hidden:y!=="columns"||d}],[{icon:(0,l.jsx)(_e,{size:13,strokeWidth:1.5}),label:"Export output as PNG",hidden:!w,handle:()=>Ce(t,"result")},{icon:(0,l.jsx)(re,{size:13,strokeWidth:1.5}),label:"Clear output",hidden:!(w||B),handle:()=>{S({cellId:t})}}],[{icon:(0,l.jsx)(Ke,{size:13,strokeWidth:1.5}),label:"Name",disableClick:!0,handle:el,handleHeadless:()=>{j((0,l.jsxs)(Le,{children:[(0,l.jsx)(Be,{children:(0,l.jsx)(He,{children:"Rename cell"})}),(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)(we,{htmlFor:"cell-name",children:"Cell name"}),(0,l.jsx)($,{placeholder:"cell name",value:h,onKeyDown:o=>{o.key==="Enter"&&(o.preventDefault(),o.stopPropagation(),j(null))},onChange:o=>x({cellId:t,name:o})})]})]}))},rightElement:(0,l.jsx)($,{placeholder:"cell name",value:h,onChange:o=>x({cellId:t,name:o}),onEnterKey:()=>u==null?void 0:u()}),hidden:d},{icon:(0,l.jsx)(Se,{size:13,strokeWidth:1.5}),label:"Copy link to cell",disabled:!oe(h),tooltip:oe(h)?void 0:"Only named cells can be linked to",handle:async()=>{await Ne(Qe(h)),De({description:"Link copied to clipboard"})}}],[{label:"Delete",hidden:!O,variant:"danger",icon:(0,l.jsx)(Oe,{size:13,strokeWidth:1.5}),handle:()=>{D({cellId:t})}}]].map(Ye).filter(Xe),e[15]=_,e[16]=R,e[17]=y,e[18]=v,e[19]=O,e[20]=t,e[21]=S,e[22]=u,e[23]=i.disabled,e[24]=i.hide_code,e[25]=m,e[26]=D,e[27]=n,e[28]=B,e[29]=w,e[30]=d,e[31]=A,e[32]=p,e[33]=h,e[34]=j,e[35]=r,e[36]=M,e[37]=W,e[38]=N,e[39]=T,e[40]=P,e[41]=k,e[42]=L,e[43]=q,e[44]=s,e[45]=x,e[46]=z):z=e[46],z}function Xe(a){return a.length>0}function Ye(a){return a.filter(Ze)}function Ze(a){return!a.hidden}function el(a){a==null||a.stopPropagation(),a==null||a.preventDefault()}export{Z as a,ee as i,Ve as n,Y as o,le as r,X as s,Je as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as D}from"./chunk-LvLJmgfZ.js";import{i as m,n as u}from"./useEvent-D91BmmQi.js";import{E as p,_ as h,y as I}from"./cells-
|
|
1
|
+
import{s as D}from"./chunk-LvLJmgfZ.js";import{i as m,n as u}from"./useEvent-D91BmmQi.js";import{E as p,_ as h,y as I}from"./cells-DzyDERZy.js";import{t as y}from"./compiler-runtime-B3qBwwSJ.js";import{t as _}from"./useEventListener-C0195JsF.js";import{t as v}from"./jsx-runtime-Blw4afVn.js";import{t as x}from"./button-DDGiD1NW.js";import{r as C}from"./requests-9-v2bhoi.js";import{t as j}from"./createLucideIcon-w-Qo9n0R.js";import{t as b}from"./use-toast-BwJoaaDM.js";import{n as w}from"./renderShortcut-Bl8_FVn8.js";var z=j("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]),K=y(),d=D(v(),1);const f=e=>{let t=(0,K.c)(7),l;t[0]===e?l=t[1]:(l=i=>{var s;(i.ctrlKey||i.metaKey)&&i.key==="z"&&(i.preventDefault(),i.stopPropagation(),(s=e.onClick)==null||s.call(e,i))},t[0]=e,t[1]=l);let r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r={capture:!0},t[2]=r):r=t[2],_(window,"keydown",l,r);let o=e.children??"Undo",n;t[3]===Symbol.for("react.memo_cache_sentinel")?(n=(0,d.jsx)(w,{className:"ml-2",shortcut:"cmd-z"}),t[3]=n):n=t[3];let a;return t[4]!==o||t[5]!==e?(a=(0,d.jsxs)(x,{"data-testid":"undo-button",size:"sm",variant:"outline",...e,children:[o," ",n]}),t[4]=o,t[5]=e,t[6]=a):a=t[6],a};var k=y();function S(){let e=(0,k.c)(4),{deleteCell:t,undoDeleteCell:l}=p(),{sendDeleteCell:r}=C(),o;return e[0]!==t||e[1]!==r||e[2]!==l?(o=n=>{var s;if(m.get(h))return;let{cellId:a}=n,i=(((s=m.get(I).cellData[a])==null?void 0:s.code)??"").trim()==="";if(t({cellId:a}),r({cellId:a}).catch(()=>{l()}),!i){let{dismiss:c}=b({title:"Cell deleted",description:"You can bring it back by clicking undo or through the command palette.",action:(0,d.jsx)(f,{"data-testid":"undo-delete-button",onClick:()=>{l(),g()}})}),g=c}},e[0]=t,e[1]=r,e[2]=l,e[3]=o):o=e[3],u(o)}function A(){let e=(0,k.c)(4),{deleteCell:t,undoDeleteCell:l}=p(),{sendDeleteCell:r}=C(),o;return e[0]!==t||e[1]!==r||e[2]!==l?(o=async n=>{if(m.get(h))return;let{cellIds:a}=n;for(let c of a)await r({cellId:c}).then(()=>{t({cellId:c})});let{dismiss:i}=b({title:"Cells deleted",action:(0,d.jsx)(f,{"data-testid":"undo-delete-button",onClick:()=>{for(let c of a)l();s()}})}),s=i},e[0]=t,e[1]=r,e[2]=l,e[3]=o):o=e[3],u(o)}export{z as i,A as n,f as r,S as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as V}from"./chunk-LvLJmgfZ.js";import{d as X,l as Y,n as q,p as Z,u as $}from"./useEvent-D91BmmQi.js";import{t as ee}from"./react-Bj1aDYRI.js";import{
|
|
1
|
+
import{s as V}from"./chunk-LvLJmgfZ.js";import{d as X,l as Y,n as q,p as Z,u as $}from"./useEvent-D91BmmQi.js";import{t as ee}from"./react-Bj1aDYRI.js";import{Dt as te,K as re}from"./cells-DzyDERZy.js";import{t as z}from"./compiler-runtime-B3qBwwSJ.js";import{t as le}from"./cn-DYvqRARy.js";import{t as ne}from"./jsx-runtime-Blw4afVn.js";import{d as se}from"./alert-dialog-Bb8Lz8ko.js";import{i as B,r as ae,t as G}from"./popover-Bcz1Zikb.js";import{a as oe,n as ie,o as ce,t as me}from"./tooltip-4bZlU7jl.js";import{t as de}from"./useCellActionButton-DypR3yDt.js";import{n as he}from"./focus-CNKbm-Xz.js";import{a as fe,c as pe,f as ue,i as xe,o as je,r as be,t as ve}from"./command-Dqxie4gq.js";import{a as ye,i as Ne}from"./renderShortcut-Bl8_FVn8.js";var J=z(),h=V(ee(),1),t=V(ne(),1);const L=h.memo(h.forwardRef((r,n)=>{let e=(0,J.c)(39),{children:s,showTooltip:c,...m}=r,f=c===void 0?!0:c,[d,k]=(0,h.useState)(!1),N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N=()=>k(!1),e[0]=N):N=e[0];let W=N,I=(0,h.useRef)(null),M=de({cell:m,closePopover:W}).map(we).filter(_e),T=se(),g;e[1]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{re(()=>{I.current&&I.current.scrollIntoView({behavior:"auto",block:"nearest"})})},e[1]=g):g=e[1];let P=q(g),w;e[2]===P?w=e[3]:(w=a=>{k(o=>{let l=typeof a=="function"?a(o):a;return l&&P(),l})},e[2]=P,e[3]=w);let i=q(w),_;e[4]===i?_=e[5]:(_=()=>({toggle:()=>i(Ce)}),e[4]=i,e[5]=_),(0,h.useImperativeHandle)(n,_);let A=ae,E=ve,H=te(m.cellId),p;e[6]===H?p=e[7]:(p=(0,t.jsx)(fe,{placeholder:"Search actions...",className:"h-6 m-1",...H}),e[6]=H,e[7]=p);let O=ue,u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=(0,t.jsx)(be,{children:"No results"}),e[8]=u):u=e[8];let R=M.map((a,o)=>(0,t.jsxs)(h.Fragment,{children:[(0,t.jsx)(xe,{children:a.map(l=>{let K=(0,t.jsxs)("div",{className:"flex items-center flex-1",children:[l.icon&&(0,t.jsx)("div",{className:"mr-2 w-5 text-muted-foreground",children:l.icon}),(0,t.jsx)("div",{className:"flex-1",children:l.label}),(0,t.jsxs)("div",{className:"shrink-0 text-sm",children:[l.hotkey&&Ne(l.hotkey),l.rightElement]})]});return l.tooltip&&(K=(0,t.jsx)(me,{content:l.tooltip,delayDuration:100,children:K})),(0,t.jsx)(je,{className:le(l.disabled&&"opacity-50!"),onSelect:()=>{l.disableClick||l.disabled||(l.handle(),k(!1))},variant:l.variant,children:K},l.label)})},o),o<M.length-1&&(0,t.jsx)(pe,{})]},o)),x;e[9]!==O||e[10]!==u||e[11]!==R?(x=(0,t.jsxs)(O,{children:[u,R]}),e[9]=O,e[10]=u,e[11]=R,e[12]=x):x=e[12];let j;e[13]!==E||e[14]!==x||e[15]!==p?(j=(0,t.jsxs)(E,{children:[p,x]}),e[13]=E,e[14]=x,e[15]=p,e[16]=j):j=e[16];let C;e[17]!==A||e[18]!==T||e[19]!==j?(C=(0,t.jsx)(A,{className:"w-[300px] p-0 pt-1 overflow-auto",scrollable:!0,...T,children:j}),e[17]=A,e[18]=T,e[19]=j,e[20]=C):C=e[20];let b=C;if(!f){let a;e[21]===s?a=e[22]:(a=(0,t.jsx)(B,{asChild:!0,children:s}),e[21]=s,e[22]=a);let o;return e[23]!==b||e[24]!==i||e[25]!==d||e[26]!==a?(o=(0,t.jsxs)(G,{open:d,onOpenChange:i,children:[a,b]}),e[23]=b,e[24]=i,e[25]=d,e[26]=a,e[27]=o):o=e[27],o}let S;e[28]===Symbol.for("react.memo_cache_sentinel")?(S=(0,t.jsx)(ie,{tabIndex:-1,children:ye("cell.cellActions")}),e[28]=S):S=e[28];let F=!d&&S,v;e[29]===s?v=e[30]:(v=(0,t.jsx)(ce,{ref:I,children:(0,t.jsx)(B,{className:"flex",children:s})}),e[29]=s,e[30]=v);let y;e[31]!==F||e[32]!==v?(y=(0,t.jsxs)(oe,{delayDuration:200,disableHoverableContent:!0,children:[F,v]}),e[31]=F,e[32]=v,e[33]=y):y=e[33];let D;return e[34]!==b||e[35]!==i||e[36]!==d||e[37]!==y?(D=(0,t.jsxs)(G,{open:d,onOpenChange:i,children:[y,b]}),e[34]=b,e[35]=i,e[36]=d,e[37]=y,e[38]=D):D=e[38],D})),Q=h.memo(r=>{let n=(0,J.c)(5),{children:e,cellId:s}=r,c;n[0]===s?c=n[1]:(c=he(s),n[0]=s,n[1]=c);let m=$(c);if(!m)return null;let f;return n[2]!==e||n[3]!==m?(f=(0,t.jsx)(L,{showTooltip:!1,...m,children:e}),n[2]=e,n[3]=m,n[4]=f):f=n[4],f});Q.displayName="ConnectionCellActionsDropdown";function ge(r){return!r.redundant}function we(r){return r.filter(ge)}function _e(r){return r.length>0}function Ce(r){return!r}var Se=z();const U=Z("minimap");function De(){let r=(0,Se.c)(3),[n,e]=Y(U),s;return r[0]!==n||r[1]!==e?(s={dependencyPanelTab:n,setDependencyPanelTab:e},r[0]=n,r[1]=e,r[2]=s):s=r[2],s}function ke(){return X(U)}export{Q as i,ke as n,L as r,De as t};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{s as Se}from"./chunk-LvLJmgfZ.js";import{d as R,i as Wt,l as St,p as At,u as N}from"./useEvent-D91BmmQi.js";import{t as _t}from"./react-Bj1aDYRI.js";import{
|
|
1
|
+
import{s as Se}from"./chunk-LvLJmgfZ.js";import{d as R,i as Wt,l as St,p as At,u as N}from"./useEvent-D91BmmQi.js";import{t as _t}from"./react-Bj1aDYRI.js";import{An as Dt,Bi as Et,Cr as It,E as Ae,Fi as Pt,Fn as Tt,Kn as Lt,Ln as Ot,Nn as Ht,Nr as Rt,Nt as _e,Or as Ft,Pn as $t,Qi as ke,T as qt,Tr as Bt,g as Ut,m as De,qt as Yt,si as Kt,t as Vt,wr as Ee,y as Gt}from"./cells-DzyDERZy.js";import{t as z}from"./compiler-runtime-B3qBwwSJ.js";import{n as Jt,r as Qt,x as Xt}from"./ai-model-dropdown-Bvqy98cI.js";import{g as F,n as Zt}from"./useEventListener-C0195JsF.js";import{t as Ie}from"./objects-BlG0ZrO0.js";import{C as ea,r as ta}from"./utils-BWBBpCkT.js";import{n as v,t as Pe}from"./constants-CDyU_g2F.js";import{M as ee,O as aa,T as Te,j as Le,k as na,v as Oe}from"./config-B-Q7J_6d.js";import{c as oa}from"./readonly-python-code-DHxOnQGj.js";import{t as sa}from"./cn-DYvqRARy.js";import{t as ra}from"./jsx-runtime-Blw4afVn.js";import{o as la}from"./alert-dialog-Bb8Lz8ko.js";import{a as ia,c as da,i as ca,n as ha,r as ma,s as ua,t as pa}from"./select-BP75_5jJ.js";import{Ft as fa}from"./JsonOutput-CyzvjIjx.js";import{f as xa,l as He,n as ba,o as Re,r as ya,s as ka,t as wa}from"./download-DpS57jyt.js";import{t as ga}from"./tooltip-4bZlU7jl.js";import{r as ja,t as P}from"./button-DDGiD1NW.js";import{i as va,t as we}from"./strings--BknHX9C.js";import{r as T}from"./requests-9-v2bhoi.js";import{t as k}from"./createLucideIcon-w-Qo9n0R.js";import{F as Ca,I as Na,L as za,R as Fe,a as $e,d as Ma,i as qe,u as Be}from"./layout-B29hqiiK.js";import{t as Ue}from"./check-rzLRd0j9.js";import{r as Wa}from"./useCellActionButton-DypR3yDt.js";import{t as Sa}from"./code-B2aKtXoe.js";import{t as Aa}from"./copy-3iHFdt22.js";import{t as Ye}from"./eye-off-BOZA7gbn.js";import{t as Ke}from"./external-link-BOlXZUla.js";import{t as te}from"./file-CJH9JNGH.js";import{u as _a}from"./form-nHzLTU1m.js";import{n as Da,r as Ea,t as Ia}from"./youtube-OwaksuQt.js";import{i as Pa,n as Ve}from"./add-connection-dialog-C97ylgk0.js";import{t as Ta}from"./house-DS0r7dNZ.js";import{t as La}from"./image-5XI2VU-q.js";import{t as Oa}from"./link-CHdiBDr5.js";import{r as Ha}from"./input-JxFwu-3G.js";import{t as Ra}from"./settings-D_PiwXwo.js";import{t as Fa}from"./sparkles-DUCpRFlS.js";import{y as $a}from"./textarea-Bmzmbbpo.js";import{t as qa}from"./square-DFICx2Qv.js";import{t as Ge}from"./triangle-alert-BL4YVsPy.js";import{t as W}from"./use-toast-BwJoaaDM.js";import{n as Je,t as Ba}from"./paths-BKO-pHK6.js";import{o as Ua}from"./session-BmukRjSi.js";import{n as ae}from"./copy-Bxb1_Gtw.js";import{t as Qe}from"./copy-icon-neDQUo4Q.js";import{r as Ya}from"./useRunCells-C2dvU2jA.js";import{a as Xe,c as Ze,i as Ka,n as et,r as tt}from"./dialog-BCVepWLJ.js";import{n as ne}from"./ImperativeModal-fY-ZfT0b.js";import{r as Va,t as at}from"./share-852X_cqy.js";import{a as Ga}from"./cell-link-w5IbCQV4.js";import{n as nt}from"./useAsyncData-Bg5iAViP.js";import{a as Ja}from"./renderShortcut-Bl8_FVn8.js";import{t as Qa}from"./icons-CIPE8AIY.js";import{i as Xa,n as ot}from"./error-entries-CTYMwfsh.js";import{t as Za}from"./pair-with-agent-modal-BCRSACei.js";import{t as en}from"./github-_JH-0hIO.js";import{n as st}from"./marimo-icons-C_nFooxr.js";import{t as tn}from"./links-CZr5bjvo.js";import{i as an,n as rt,t as ge}from"./skeleton-Bubr9pIj.js";import{t as lt}from"./types-Da7lA5YC.js";var nn=k("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),on=k("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),it=k("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"}]]),dt=k("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"}]]),ct=k("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"}]]),sn=k("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"}]]),rn=k("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"}]]),ln=k("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"}]]),ht=k("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"}]]),dn=k("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"}]]),cn=k("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),mt=k("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"}]]),hn=k("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"}]]),mn=k("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"}]]),ut=k("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"}]]),un=z(),L=Se(_t(),1);function je(e,t){let n=(0,un.c)(11),o;n[0]===t?o=n[1]:(o=new Pt(t),n[0]=t,n[1]=o);let s=o,l;n[2]!==e||n[3]!==s?(l=()=>s.get(e),n[2]=e,n[3]=s,n[4]=l):l=n[4];let[r,d]=(0,L.useState)(l),i;n[5]!==e||n[6]!==s?(i=x=>{d(x),s.set(e,x)},n[5]=e,n[6]=s,n[7]=i):i=n[7];let c=i,h;return n[8]!==c||n[9]!==r?(h=[r,c],n[8]=c,n[9]=r,n[10]=h):h=n[10],h}function pn(e,t){return{...e,Binaries:{...e.Binaries,Browser:t}}}function fn(e,t,n,o){return{marimo:e,Locale:n||void 0,Binaries:{Browser:t},"Environment Collection Error":o}}function ve(e,t){let n=Math.max(2,...Array.from(t.matchAll(/`+/g),s=>s[0].length)),o="`".repeat(n+1);return`${o}${e}
|
|
2
2
|
${t}
|
|
3
3
|
${o}`}function xn(e,t){let n=e.includes("?")?"&":"?",o=[],s=e,l=0;for(let[r,d]of Object.entries(t)){if(d.length===0)continue;let i=`${r}=${encodeURIComponent(d)}`,c=`${s}${l===0?n:"&"}${i}`;if(c.length>6e3){o.push(r);continue}s=c,l+=1}return{url:s,omitted:o}}function Ce(e,t){return["<details>",`<summary>${we.htmlEscape(e)??""}</summary>`,"",t,"","</details>"].join(`
|
|
4
4
|
`)}function bn(e){return Ce("Environment",ve("json",JSON.stringify(e,null,2)))}function pt(e){return Ce("Errors",ve("text",e.map(ot).join(`
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
`)))}function yn(e){return Ce("Code",ve("python",e))}var ft=z(),a=Se(ra(),1),kn=
|
|
8
|
+
`)))}function yn(e){return Ce("Code",ve("python",e))}var ft=z(),a=Se(ra(),1),kn=Zt,xt=e=>{let t=(0,ft.c)(16),{content:n}=e,[o,s]=(0,L.useState)(!1),l=!o&&"max-h-24 overflow-hidden",r;t[0]===l?r=t[1]:(r=sa("text-xs bg-muted rounded p-2 overflow-x-auto whitespace-pre-wrap",l),t[0]=l,t[1]=r);let d;t[2]!==n||t[3]!==r?(d=(0,a.jsx)("pre",{className:r,children:n}),t[2]=n,t[3]=r,t[4]=d):d=t[4];let i;t[5]===o?i=t[6]:(i=!o&&(0,a.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]=o,t[6]=i);let c;t[7]!==d||t[8]!==i?(c=(0,a.jsxs)("div",{className:"relative",children:[d,i]}),t[7]=d,t[8]=i,t[9]=c):c=t[9];let h;t[10]===Symbol.for("react.memo_cache_sentinel")?(h=()=>s(gn),t[10]=h):h=t[10];let x=o?"Show less":"Show more",m;t[11]===x?m=t[12]:(m=(0,a.jsx)(P,{type:"button",variant:"link",size:"xs",className:"self-start",onClick:h,children:x}),t[11]=x,t[12]=m);let b;return t[13]!==c||t[14]!==m?(b=(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[c,m]}),t[13]=c,t[14]=m,t[15]=b):b=t[15],b};const wn=e=>{let t=(0,ft.c)(6),{children:n}=e,{openModal:o,closeModal:s}=ne(),l;t[0]!==s||t[1]!==o?(l=()=>o((0,a.jsx)(bt,{onClose:s})),t[0]=s,t[1]=o,t[2]=l):l=t[2];let r;return t[3]!==n||t[4]!==l?(r=(0,a.jsx)(kn,{onClick:l,children:n}),t[3]=n,t[4]=l,t[5]=r):r=t[5],r},bt=()=>{let{getEnvironmentInfo:e,readCode:t}=T(),n=nt(async()=>e(),[e]),o=N(Gt),s=(0,L.useMemo)(()=>Xa(Wt),[o]),l=Ma(o.cellIds.inOrderIds.map(u=>o.cellData[u])),r=N(Et),d=N(Oe),i=r!==null&&l&&d.state===Te.OPEN,c=i?void 0:r===null?"Save the notebook first.":l?"Connect the notebook to include its source.":"Notebook source is hidden in this view.",[h,x]=je("marimo:issue-report:include-errors",!1),[m,b]=je("marimo:issue-report:include-code",!1),f=n.data?pn(n.data,navigator.userAgent):n.status==="error"?fn(oa(),navigator.userAgent,navigator.language,"Server environment information unavailable"):void 0,y=nt(async()=>{if(!m||!i)return;let{contents:u}=await t();return u},[m,i,t]),{url:w,omitted:g}=(0,L.useMemo)(()=>{if(!f)return{url:v.bugReportUrl,omitted:[]};let u={env:bn(f)};return h&&s.length>0&&(u["bug-description"]=pt(s)),m&&y.data&&(u["reproduction-code"]=yn(y.data)),xn(v.bugReportUrl,u)},[f,s,h,m,y.data]),j=g.map(u=>u==="bug-description"?"errors":u==="reproduction-code"?"code":u).join(", ");return(0,a.jsxs)(et,{className:"w-[540px] max-w-[90vw]",children:[(0,a.jsxs)(Xe,{children:[(0,a.jsx)(Ze,{children:"Report an issue"}),(0,a.jsx)(tt,{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."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4 max-h-[60vh] overflow-y-auto",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(P,{type:"button",variant:"default",size:"xs",asChild:!0,className:"self-start",children:(0,a.jsxs)("a",{href:w,target:"_blank",rel:"noreferrer",children:[(0,a.jsx)(Ke,{className:"w-4 h-4 mr-2"}),"Open GitHub issue"]})}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)(_e,{id:"issue-include-errors",checked:h,disabled:s.length===0,onCheckedChange:u=>x(u===!0),"aria-label":"Include errors"}),(0,a.jsx)("label",{htmlFor:"issue-include-errors",children:"Include errors"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)(_e,{id:"issue-include-code",checked:m,disabled:!i,onCheckedChange:u=>b(u===!0),"aria-label":"Include notebook code"}),(0,a.jsx)("label",{htmlFor:"issue-include-code",children:"Include notebook code"})]}),c&&(0,a.jsx)("span",{className:"text-xs text-muted-foreground ml-6",children:c}),m&&y.status==="error"&&(0,a.jsx)("span",{className:"text-xs text-(--red-11) ml-6",children:"Notebook source could not be loaded."})]})]}),j?(0,a.jsxs)("div",{className:"flex items-start gap-2 text-xs text-(--yellow-11)",children:[(0,a.jsx)(Ge,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),(0,a.jsxs)("span",{children:["Too large to prefill and left out of the link: ",j,". Paste them into the issue manually."]})]}):(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Your environment is always included."})]}),n.status==="pending"&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("span",{className:"text-sm text-muted-foreground",children:"Loading environment details\u2026"}),(0,a.jsx)(ge,{className:"h-4 w-full"}),(0,a.jsx)(ge,{className:"h-4 w-3/4"}),(0,a.jsx)(ge,{className:"h-4 w-1/2"})]}),n.status==="error"&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)(Ge,{className:"w-4 h-4 text-(--yellow-11) shrink-0"}),(0,a.jsx)("span",{children:"Server environment information unavailable"}),(0,a.jsx)(P,{type:"button",variant:"link",size:"xs",onClick:()=>n.refetch(),children:"Retry"})]}),f&&(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"Environment details"}),(0,a.jsx)(Qe,{className:"w-3.5 h-3.5",value:JSON.stringify(f,null,2),ariaLabel:"Copy environment JSON",toastTitle:"Environment details copied"})]}),(0,a.jsx)(xt,{content:JSON.stringify(f,null,2)})]}),f&&s.length>0&&(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"Errors"}),(0,a.jsx)(Qe,{className:"w-3.5 h-3.5",value:pt(s),ariaLabel:"Copy errors",toastTitle:"Errors copied"})]}),(0,a.jsx)(xt,{content:s.map(ot).join(`
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
`)})]}),f&&s.length===0&&(0,a.jsx)("span",{className:"text-sm text-muted-foreground",children:"No errors detected."}),(0,a.jsx)("div",{className:"border-t pt-3",children:(0,a.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Other feedback? Take our"," ",(0,a.jsx)("a",{href:v.feedbackForm,target:"_blank",rel:"noreferrer",className:"underline",children:"two-minute survey"})," ","or chat with us on"," ",(0,a.jsx)("a",{href:v.discordLink,target:"_blank",rel:"noreferrer",className:"underline",children:"Discord"}),"."]})})]})]})};function gn(e){return!e}var yt=z(),oe="https://static.marimo.app";const jn=e=>{let t=(0,yt.c)(25),{onClose:n}=e,[o,s]=(0,T.useState)(""),{exportAsHTML:l}=L(),r=`${o}-${Math.random().toString(36).slice(2,6)}`,d=`${oe}/static/${r}`,i;t[0]!==l||t[1]!==n||t[2]!==r?(i=async u=>{u.preventDefault(),n();let{contents:H}=await l({download:!1,includeCode:!0,files:Ca.INSTANCE.filenames()}),S=W({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${oe}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:H,path:r})}).catch(()=>{S.dismiss(),W({title:"Error uploading static page",description:(0,a.jsxs)("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",(0,a.jsx)("a",{href:v.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),S.dismiss(),W({title:"Static page uploaded!",description:(0,a.jsxs)("div",{children:["The URL has been copied to your clipboard.",(0,a.jsx)("br",{}),"You can share it with anyone."]})})},t[0]=l,t[1]=n,t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=(0,a.jsx)(Qe,{children:"Share static notebook"}),t[4]=c):c=t[4];let h;t[5]===Symbol.for("react.memo_cache_sentinel")?(h=(0,a.jsxs)(Ze,{children:[c,(0,a.jsxs)(tt,{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,a.jsx)("a",{href:oe,target:"_blank",children:oe}),"."]})]}),t[5]=h):h=t[5];let x;t[6]===Symbol.for("react.memo_cache_sentinel")?(x=u=>{s(u.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,""))},t[6]=x):x=t[6];let m;t[7]===o?m=t[8]:(m=(0,a.jsx)(Ha,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:x,required:!0,autoComplete:"off"}),t[7]=o,t[8]=m);let b;t[9]===d?b=t[10]:(b=(0,a.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,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(vn,{text:d}),(0,a.jsx)("span",{className:"text-primary",children:d})]})]}),t[9]=d,t[10]=b);let f;t[11]!==m||t[12]!==b?(f=(0,a.jsxs)("div",{className:"flex flex-col gap-6 py-4",children:[m,b]}),t[11]=m,t[12]=b,t[13]=f):f=t[13];let y;t[14]===n?y=t[15]:(y=(0,a.jsx)(P,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),t[14]=n,t[15]=y);let w;t[16]===d?w=t[17]:(w=(0,a.jsx)(P,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await ae(d)},children:"Create"}),t[16]=d,t[17]=w);let g;t[18]!==y||t[19]!==w?(g=(0,a.jsxs)(Ka,{children:[y,w]}),t[18]=y,t[19]=w,t[20]=g):g=t[20];let j;return t[21]!==i||t[22]!==g||t[23]!==f?(j=(0,a.jsx)(et,{className:"w-fit",children:(0,a.jsxs)("form",{onSubmit:i,children:[h,f,g]})}),t[21]=i,t[22]=g,t[23]=f,t[24]=j):j=t[24],j};var vn=e=>{let t=(0,yt.c)(8),[n,o]=T.useState(!1),s;t[0]===e.text?s=t[1]:(s=ja.stopPropagation(async c=>{c.preventDefault(),await ae(e.text),o(!0),setTimeout(()=>o(!1),2e3)}),t[0]=e.text,t[1]=s);let l=s,r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(Aa,{size:14,strokeWidth:1.5}),t[2]=r):r=t[2];let d;t[3]===l?d=t[4]:(d=(0,a.jsx)(P,{"data-testid":"copy-static-notebook-url-button",onClick:l,size:"xs",variant:"secondary",children:r}),t[3]=l,t[4]=d);let i;return t[5]!==n||t[6]!==d?(i=(0,a.jsx)(ga,{content:"Copied!",open:n,children:d}),t[5]=n,t[6]=d,t[7]=i):i=t[7],i},Cn=z();function Nn(){let e=document.getElementsByClassName(Pe.outputArea);for(let t of e){let n=t.getBoundingClientRect();if(n.bottom>0&&n.top<window.innerHeight){let o=ke.findElement(t);if(!o){$.warn("Could not find HTMLCellId for visible output area",t);continue}return{cellId:ke.parse(o.id)}}}return $.warn("No visible output area found for scroll anchor"),null}function zn(e){if(!e){$.warn("No scroll anchor provided to restore scroll position");return}let t=document.getElementById(ke.create(e.cellId));if(!t){$.warn("Could not find cell element to restore scroll position",e.cellId);return}if(!t.querySelector(`.${Pe.outputArea}`)){$.warn("Could not find output area to restore scroll position",e.cellId);return}t.scrollIntoView({block:"start",behavior:"auto"})}function kt(){let e=(0,Cn.c)(2),t=R(Te),n;return e[0]===t?n=e[1]:(n=()=>{let o=Nn();t(s=>({mode:na(s.mode),cellAnchor:(o==null?void 0:o.cellId)??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{zn(o)})})},e[0]=t,e[1]=n),n}const wt=At(!1);var Mn=z();const Wn=()=>{let e=(0,Mn.c)(7),{selectedLayout:t}=Fe(),{setLayoutView:n}=qe();if(ee()&&!Et("wasm_layouts"))return null;let o;e[0]===n?o=e[1]:(o=d=>n(d),e[0]=n,e[1]=o);let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsx)(ua,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:(0,a.jsx)(da,{placeholder:"Select a view"})}),e[2]=s):s=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsx)(ha,{children:(0,a.jsxs)(ma,{children:[(0,a.jsx)(ia,{children:"View as"}),lt.map(An)]})}),e[3]=l):l=e[3];let r;return e[4]!==t||e[5]!==o?(r=(0,a.jsxs)(pa,{"data-testid":"layout-select",value:t,onValueChange:o,children:[s,l]}),e[4]=t,e[5]=o,e[6]=r):r=e[6],r};function Sn(e){return(0,a.jsx)(gt(e),{className:"h-4 w-4"})}function gt(e){switch(e){case"vertical":return ln;case"grid":return Ea;case"slides":return mt;default:return va(e),qa}}function jt(e){return we.startCase(e)}function An(e){return(0,a.jsx)(ca,{value:e,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 leading-5",children:[Sn(e),(0,a.jsx)("span",{children:jt(e)})]})},e)}async function _n(e){let{preset:t,downloadPDF:n}=e;await n({webpdf:!1,preset:t,includeInputs:!0,rasterServer:"static"})}var Dn=z();function En(e){let t=(0,Dn.c)(5),{openPrompt:n,closeModal:o}=ne(),{sendCopy:s}=L(),l;return t[0]!==o||t[1]!==n||t[2]!==s||t[3]!==e?(l=()=>{if(!e)return null;let r=Ba.guessDeliminator(e);n({title:"Copy notebook",description:"Enter a new filename for the notebook copy.",defaultValue:`_${Je.basename(e)}`,confirmText:"Copy notebook",spellCheck:!1,onConfirm:d=>{let i=r.join(Je.dirname(e),d);s({source:e,destination:i}).then(()=>{o(),W({title:"Notebook copied",description:"A copy of the notebook has been created."}),tn(i)})}})},t[0]=o,t[1]=n,t[2]=s,t[3]=e,t[4]=l):l=t[4],l}var In=z();function vt(){let e=(0,In.c)(4),{openConfirm:t}=ne(),n=R(Oe),{sendRestart:o}=L(),s;return e[0]!==t||e[1]!==o||e[2]!==n?(s=()=>{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,a.jsx)(la,{onClick:async()=>{n({state:Le.CLOSING}),await o(),Va()},"aria-label":"Confirm Restart",children:"Restart"})})},e[0]=t,e[1]=o,e[2]=n,e[3]=s):s=e[3],s}var Pn=z(),Ln=new Pt,Tn=e=>Ln.isSupported(e)?"markdown":"code";const Ct=()=>{let e=(0,Pn.c)(3),{updateCellConfig:t}=_e(),{saveCellConfig:n}=L(),o;return e[0]!==n||e[1]!==t?(o=async(s,l)=>{let r=Ee(),d={};for(let c of r.cellIds.inOrderIds){let h=r.cellData[c];h===void 0||h.config.hide_code===s||Tn(h.code)===l&&(d[c]={hide_code:s})}let i=Ie.entries(d);if(i.length!==0){await n({configs:d});for(let[c,h]of i)t({cellId:c,config:h})}},e[0]=n,e[1]=t,e[2]=o):o=e[2],o};var On=z(),O=e=>{e==null||e.preventDefault(),e==null||e.stopPropagation()};function Hn(){var ze,Me,We;let e=(0,On.c)(56),t=Ga(),{openModal:n,closeModal:o}=ne(),{toggleApplication:s}=Lt(),{selectedPanel:l}=Ot(),[r]=St(Te),d=N(aa),i=Ct(),[c]=ea(),h=N(Bt),x=N(ta),{updateCellConfig:m,undoDeleteCell:b,clearAllCellOutputs:f,addSetupCellIfDoesntExist:y,collapseAllCells:w,expandAllCells:g}=_e(),j=vt(),u=Ya(),H=En(t),S=R(wt),re=R(Jt),{handleClick:le}=Xt(),ie=R(Zt),{exportAsIPYNB:de,exportAsMarkdown:ce,readCode:A,saveCellConfig:he,updateCellOutputs:_}=L(),D=an(),me=N(qt),ue=N(Yt),pe=N(Ft),{selectedLayout:F}=Fe(),{setLayoutView:fe}=qe(),q=kt(),B=((ze=c.sharing)==null?void 0:ze.html)??!0,U=((Me=c.sharing)==null?void 0:Me.wasm)??!0,Y=((We=c.sharing)==null?void 0:We.molab)??!0,Ne=!ee(),xe=F==="slides",Nt=no,zt=ao,K;e[0]!==t||e[1]!==D||e[2]!==_?(K=async p=>{let{preset:C,title:M}=p;if(!t){se();return}await He(M,async ye=>{await rt({takeScreenshots:()=>D({progress:ye}),updateCellOutputs:_}),await _n({preset:C,downloadPDF:ba})})},e[0]=t,e[1]=D,e[2]=_,e[3]=K):K=e[3];let E=K,V;e[4]===E?V=e[5]:(V=async()=>{if(Ne){await E({preset:"document",title:"Downloading Document PDF..."});return}let p=new Event("export-beforeprint"),C=new Event("export-afterprint");window.dispatchEvent(p),setTimeout(to,0),setTimeout(()=>window.dispatchEvent(C),0)},e[4]=E,e[5]=V);let G=V,J;e[6]!==de||e[7]!==t||e[8]!==D||e[9]!==_?(J=async()=>{if(!t){se();return}await He("Downloading IPYNB...",async p=>{await rt({takeScreenshots:()=>D({progress:p}),updateCellOutputs:_}),Re(await de({download:!1}))})},e[6]=de,e[7]=t,e[8]=D,e[9]=_,e[10]=J):J=e[10];let be=J,X;e[11]===Symbol.for("react.memo_cache_sentinel")?(X=(0,a.jsx)(fa,{size:14,strokeWidth:1.5}),e[11]=X):X=e[11];let Z;e[12]===Symbol.for("react.memo_cache_sentinel")?(Z=(0,a.jsx)($e,{size:14,strokeWidth:1.5}),e[12]=Z):Z=e[12];let I;e[13]===t?I=e[14]:(I=async()=>{if(!t){se();return}await Be({includeCode:!0})},e[13]=t,e[14]=I);let Q;return e[15]!==y||e[16]!==x||e[17]!==ue||e[18]!==h||e[19]!==f||e[20]!==o||e[21]!==w||e[22]!==H||e[23]!==E||e[24]!==g||e[25]!==ce||e[26]!==t||e[27]!==G||e[28]!==be||e[29]!==me||e[30]!==xe||e[31]!==d||e[32]!==n||e[33]!==le||e[34]!==A||e[35]!==j||e[36]!==u||e[37]!==he||e[38]!==F||e[39]!==l||e[40]!==i||e[41]!==S||e[42]!==ie||e[43]!==fe||e[44]!==re||e[45]!==B||e[46]!==Y||e[47]!==U||e[48]!==I||e[49]!==s||e[50]!==q||e[51]!==b||e[52]!==pe||e[53]!==m||e[54]!==r.mode?(Q=[{icon:X,label:"Download",handle:O,dropdown:[{icon:Z,label:"Download as HTML",handle:I},{icon:(0,a.jsx)($e,{size:14,strokeWidth:1.5}),label:"Download as HTML (exclude code)",handle:async()=>{if(!t){se();return}await Be({includeCode:!1})}},{icon:(0,a.jsx)(Xa,{strokeWidth:1.5,style:{width:14,height:14}}),label:"Download as Markdown",handle:async()=>{Re(await ce({download:!1}))}},{icon:(0,a.jsx)(dn,{size:14,strokeWidth:1.5}),label:"Download as ipynb",handle:be},{icon:(0,a.jsx)(Sa,{size:14,strokeWidth:1.5}),label:"Download Python code",handle:async()=>{let p=await A();ya(new Blob([p.contents],{type:"text/plain"}),xa.toPY(document.title))}},{divider:!0,icon:(0,a.jsx)(Ta,{size:14,strokeWidth:1.5}),label:"Download as PNG",disabled:r.mode!=="present",tooltip:r.mode==="present"?void 0:(0,a.jsxs)("span",{children:["Only available in app view. ",(0,a.jsx)("br",{}),"Toggle with: ",Ja("global.hideCode",!1)]}),handle:eo},xe?{divider:!0,icon:(0,a.jsx)(te,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:O,dropdown:[{icon:(0,a.jsx)(te,{size:14,strokeWidth:1.5}),label:"Document Layout",handle:G},{icon:(0,a.jsx)(te,{size:14,strokeWidth:1.5}),label:"Slides Layout",rightElement:zt(!0),hidden:!Ne,handle:async()=>{await E({preset:"slides",title:"Downloading Slides PDF..."})}}]}:{divider:!0,icon:(0,a.jsx)(te,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:G}]},{icon:(0,a.jsx)($a,{size:14,strokeWidth:1.5}),label:"Pair with an agent",hidden:ee(),handle:async()=>{n((0,a.jsx)(Qa,{onClose:o}))}},{icon:(0,a.jsx)(hn,{size:14,strokeWidth:1.5}),label:"Share",handle:O,hidden:!B&&!U&&!Y,dropdown:[{icon:(0,a.jsx)(_a,{size:14,strokeWidth:1.5}),label:"Publish HTML to web",hidden:!B,handle:async()=>{n((0,a.jsx)(jn,{onClose:o}))}},{icon:(0,a.jsx)(Oa,{size:14,strokeWidth:1.5}),label:"Create WebAssembly link",hidden:!U,handle:async()=>{await ae(at({code:(await A()).contents})),W({title:"Copied",description:"Link copied to clipboard."})}},{icon:(0,a.jsx)(st,{size:14,strokeWidth:1.5}),label:"Create molab notebook",hidden:!Y,handle:async()=>{let p=at({code:(await A()).contents,baseUrl:`${v.molab}/new`});window.open(p,"_blank")}}]},{icon:(0,a.jsx)(cn,{size:14,strokeWidth:1.5}),label:"Helper panel",redundant:!0,handle:O,dropdown:Rt.flatMap(p=>{let C=p.type==="ai"&&!x;if(It({panel:p,capabilities:h,aiEnabled:x})&&!C)return[];let{type:M,Icon:ye,additionalKeywords:Mt}=p;return{label:we.startCase(M),rightElement:Nt(l===M),icon:(0,a.jsx)(ye,{size:14,strokeWidth:1.5}),handle:()=>{if(C){le("ai","ai-features");return}s(M)},additionalKeywords:Mt}})},{icon:(0,a.jsx)(mt,{size:14,strokeWidth:1.5}),label:"Present as",handle:O,dropdown:[{icon:r.mode==="present"?(0,a.jsx)(Fa,{size:14,strokeWidth:1.5}):(0,a.jsx)(Na,{size:14,strokeWidth:1.5}),label:"Toggle app view",hotkey:"global.hideCode",handle:()=>{q()}},...lt.map((p,C)=>{let M=gt(p);return{divider:C===0,label:jt(p),icon:(0,a.jsx)(M,{size:14,strokeWidth:1.5}),rightElement:(0,a.jsx)("div",{className:"w-8 flex justify-end",children:F===p&&(0,a.jsx)(Ue,{size:14})}),handle:()=>{fe(p),r.mode==="edit"&&q()}}})]},{icon:(0,a.jsx)(rn,{size:14,strokeWidth:1.5}),label:"Duplicate notebook",hidden:!t||ee(),handle:H},{icon:(0,a.jsx)(it,{size:14,strokeWidth:1.5}),label:"Copy code to clipboard",hidden:!t,handle:async()=>{await ae((await A()).contents),W({title:"Copied",description:"Code copied to clipboard."})}},{icon:(0,a.jsx)(Wa,{size:14,strokeWidth:1.5}),label:"Enable all cells",hidden:!me||d,handle:async()=>{let p=Ut(Ee());await he({configs:Ie.fromEntries(p.map(Qn))});for(let C of p)m({cellId:C,config:{disabled:!1}})}},{divider:!0,icon:(0,a.jsx)(ct,{size:14,strokeWidth:1.5}),label:"Add setup cell",handle:()=>{y({})}},{icon:(0,a.jsx)(Kt,{size:14,strokeWidth:1.5}),label:"Add database connection",handle:()=>{n((0,a.jsx)(Ve,{onClose:o}))}},{icon:(0,a.jsx)(Pa,{size:14,strokeWidth:1.5}),label:"Add remote storage",handle:()=>{n((0,a.jsx)(Ve,{defaultTab:"storage",onClose:o}))}},{icon:(0,a.jsx)(ut,{size:14,strokeWidth:1.5}),label:pe,hidden:!ue||d,handle:()=>{b()}},{icon:(0,a.jsx)(mn,{size:14,strokeWidth:1.5}),label:"Restart kernel",variant:"danger",handle:j,additionalKeywords:["reset","reload","restart"]},{icon:(0,a.jsx)(sn,{size:14,strokeWidth:1.5}),label:"Re-run all cells",redundant:!0,hotkey:"global.runAll",handle:async()=>{u()}},{icon:(0,a.jsx)(Dt,{size:14,strokeWidth:1.5}),label:"Clear all outputs",redundant:!0,handle:()=>{f()}},{icon:(0,a.jsx)(Ae,{size:14,strokeWidth:1.5}),label:"Show all code",hotkey:"global.showAllCode",handle:()=>i(!1,"code"),redundant:!0},{icon:(0,a.jsx)(Ye,{size:14,strokeWidth:1.5}),label:"Hide all code",hotkey:"global.hideAllCode",handle:()=>i(!0,"code"),redundant:!0},{icon:(0,a.jsx)(Ae,{size:14,strokeWidth:1.5}),label:"Show all markdown code",hotkey:"global.showAllMarkdownCode",handle:()=>i(!1,"markdown"),redundant:!0},{icon:(0,a.jsx)(Ye,{size:14,strokeWidth:1.5}),label:"Hide all markdown code",hotkey:"global.hideAllMarkdownCode",handle:()=>i(!0,"markdown"),redundant:!0},{icon:(0,a.jsx)(on,{size:14,strokeWidth:1.5}),label:"Collapse all sections",hotkey:"global.collapseAllSections",handle:w,redundant:!0},{icon:(0,a.jsx)(nn,{size:14,strokeWidth:1.5}),label:"Expand all sections",hotkey:"global.expandAllSections",handle:g,redundant:!0},{divider:!0,icon:(0,a.jsx)(dt,{size:14,strokeWidth:1.5}),label:"Command palette",hotkey:"global.commandPalette",handle:()=>S(Zn)},{icon:(0,a.jsx)(za,{size:14,strokeWidth:1.5}),label:"Keyboard shortcuts",hotkey:"global.showHelp",handle:()=>ie(Xn)},{icon:(0,a.jsx)(Ra,{size:14,strokeWidth:1.5}),label:"User settings",handle:()=>re(Jn),redundant:!0,additionalKeywords:["preferences","options","configuration"]},{icon:(0,a.jsx)(ht,{size:14,strokeWidth:1.5}),label:"Report an issue",additionalKeywords:["feedback","bug","issue","report","diagnostics"],handle:()=>n((0,a.jsx)(bt,{onClose:o}))},{icon:(0,a.jsx)(Ke,{size:14,strokeWidth:1.5}),label:"Resources",handle:O,dropdown:[{icon:(0,a.jsx)(Tt,{size:14,strokeWidth:1.5}),label:"Documentation",handle:Gn},{icon:(0,a.jsx)(en,{className:"h-3.5 w-3.5"}),label:"GitHub",handle:Vn},{icon:(0,a.jsx)(Da,{size:14,strokeWidth:1.5}),label:"Discord Community",handle:Kn},{icon:(0,a.jsx)(Ia,{className:"h-3.5 w-3.5"}),label:"YouTube",handle:Yn},{icon:(0,a.jsx)($t,{size:14,strokeWidth:1.5}),label:"Changelog",handle:Un}]},{divider:!0,icon:(0,a.jsx)(La,{size:14,strokeWidth:1.5}),label:"Open home",hidden:!location.search.includes("file"),handle:Bn},{icon:(0,a.jsx)(st,{size:14,strokeWidth:1.5}),label:"New notebook",hidden:!location.search.includes("file"),handle:qn}].filter(Fn).map(Rn),e[15]=y,e[16]=x,e[17]=ue,e[18]=h,e[19]=f,e[20]=o,e[21]=w,e[22]=H,e[23]=E,e[24]=g,e[25]=ce,e[26]=t,e[27]=G,e[28]=be,e[29]=me,e[30]=xe,e[31]=d,e[32]=n,e[33]=le,e[34]=A,e[35]=j,e[36]=u,e[37]=he,e[38]=F,e[39]=l,e[40]=i,e[41]=S,e[42]=ie,e[43]=fe,e[44]=re,e[45]=B,e[46]=Y,e[47]=U,e[48]=I,e[49]=s,e[50]=q,e[51]=b,e[52]=pe,e[53]=m,e[54]=r.mode,e[55]=Q):Q=e[55],Q}function Rn(e){return e.dropdown?{...e,dropdown:e.dropdown.filter($n)}:e}function $n(e){return!e.hidden}function Fn(e){return!e.hidden}function qn(){let e=Ua();window.open(e,"_blank")}function Bn(){let e=document.baseURI.split("?")[0];window.open(e,"_blank","noopener")}function Un(){window.open(v.releasesPage,"_blank")}function Yn(){window.open(v.youtube,"_blank")}function Kn(){window.open(v.discordLink,"_blank")}function Vn(){window.open(v.githubPage,"_blank")}function Gn(){window.open(v.docsPage,"_blank")}function Jn(e){return!e}function Xn(e){return!e}function Zn(e){return!e}function Qn(e){return[e,{disabled:!1}]}async function eo(){let e=document.getElementById("App");e&&await ka({element:e,filename:document.title,prepare:wa})}function to(){return window.print()}function ao(e){return e?(0,a.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"}):null}function no(e){return(0,a.jsx)("div",{className:"w-8 flex justify-end",children:e&&(0,a.jsx)(Ue,{size:14})})}function se(){W({title:"Error",description:"Notebooks must be named to be exported.",variant:"danger"})}export{wt as a,je as c,ct as d,dt as f,Wn as i,ut as l,Ct as n,kt as o,it as p,vt as r,wn as s,Hn as t,ht as u};
|
|
12
|
+
`)})]}),f&&s.length===0&&(0,a.jsx)("span",{className:"text-sm text-muted-foreground",children:"No errors detected."}),(0,a.jsx)("div",{className:"border-t pt-3",children:(0,a.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Other feedback? Take our"," ",(0,a.jsx)("a",{href:v.feedbackForm,target:"_blank",rel:"noreferrer",className:"underline",children:"two-minute survey"})," ","or chat with us on"," ",(0,a.jsx)("a",{href:v.discordLink,target:"_blank",rel:"noreferrer",className:"underline",children:"Discord"}),"."]})})]})]})};function gn(e){return!e}var yt=z(),oe="https://static.marimo.app";const jn=e=>{let t=(0,yt.c)(25),{onClose:n}=e,[o,s]=(0,L.useState)(""),{exportAsHTML:l}=T(),r=`${o}-${Math.random().toString(36).slice(2,6)}`,d=`${oe}/static/${r}`,i;t[0]!==l||t[1]!==n||t[2]!==r?(i=async u=>{u.preventDefault(),n();let{contents:H}=await l({download:!1,includeCode:!0,files:Ca.INSTANCE.filenames()}),S=W({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${oe}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:H,path:r})}).catch(()=>{S.dismiss(),W({title:"Error uploading static page",description:(0,a.jsxs)("div",{children:["Please try again later. If the problem persists, please file a bug report on"," ",(0,a.jsx)("a",{href:v.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),S.dismiss(),W({title:"Static page uploaded!",description:(0,a.jsxs)("div",{children:["The URL has been copied to your clipboard.",(0,a.jsx)("br",{}),"You can share it with anyone."]})})},t[0]=l,t[1]=n,t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=(0,a.jsx)(Ze,{children:"Share static notebook"}),t[4]=c):c=t[4];let h;t[5]===Symbol.for("react.memo_cache_sentinel")?(h=(0,a.jsxs)(Xe,{children:[c,(0,a.jsxs)(tt,{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,a.jsx)("a",{href:oe,target:"_blank",children:oe}),"."]})]}),t[5]=h):h=t[5];let x;t[6]===Symbol.for("react.memo_cache_sentinel")?(x=u=>{s(u.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,""))},t[6]=x):x=t[6];let m;t[7]===o?m=t[8]:(m=(0,a.jsx)(Ha,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:x,required:!0,autoComplete:"off"}),t[7]=o,t[8]=m);let b;t[9]===d?b=t[10]:(b=(0,a.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,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(vn,{text:d}),(0,a.jsx)("span",{className:"text-primary",children:d})]})]}),t[9]=d,t[10]=b);let f;t[11]!==m||t[12]!==b?(f=(0,a.jsxs)("div",{className:"flex flex-col gap-6 py-4",children:[m,b]}),t[11]=m,t[12]=b,t[13]=f):f=t[13];let y;t[14]===n?y=t[15]:(y=(0,a.jsx)(P,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),t[14]=n,t[15]=y);let w;t[16]===d?w=t[17]:(w=(0,a.jsx)(P,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await ae(d)},children:"Create"}),t[16]=d,t[17]=w);let g;t[18]!==y||t[19]!==w?(g=(0,a.jsxs)(Ka,{children:[y,w]}),t[18]=y,t[19]=w,t[20]=g):g=t[20];let j;return t[21]!==i||t[22]!==g||t[23]!==f?(j=(0,a.jsx)(et,{className:"w-fit",children:(0,a.jsxs)("form",{onSubmit:i,children:[h,f,g]})}),t[21]=i,t[22]=g,t[23]=f,t[24]=j):j=t[24],j};var vn=e=>{let t=(0,yt.c)(8),[n,o]=L.useState(!1),s;t[0]===e.text?s=t[1]:(s=ja.stopPropagation(async c=>{c.preventDefault(),await ae(e.text),o(!0),setTimeout(()=>o(!1),2e3)}),t[0]=e.text,t[1]=s);let l=s,r;t[2]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(Aa,{size:14,strokeWidth:1.5}),t[2]=r):r=t[2];let d;t[3]===l?d=t[4]:(d=(0,a.jsx)(P,{"data-testid":"copy-static-notebook-url-button",onClick:l,size:"xs",variant:"secondary",children:r}),t[3]=l,t[4]=d);let i;return t[5]!==n||t[6]!==d?(i=(0,a.jsx)(ga,{content:"Copied!",open:n,children:d}),t[5]=n,t[6]=d,t[7]=i):i=t[7],i},Cn=z();function Nn(){let e=document.getElementsByClassName(Pe.outputArea);for(let t of e){let n=t.getBoundingClientRect();if(n.bottom>0&&n.top<window.innerHeight){let o=ke.findElement(t);if(!o){F.warn("Could not find HTMLCellId for visible output area",t);continue}return{cellId:ke.parse(o.id)}}}return F.warn("No visible output area found for scroll anchor"),null}function zn(e){if(!e){F.warn("No scroll anchor provided to restore scroll position");return}let t=document.getElementById(ke.create(e.cellId));if(!t){F.warn("Could not find cell element to restore scroll position",e.cellId);return}if(!t.querySelector(`.${Pe.outputArea}`)){F.warn("Could not find output area to restore scroll position",e.cellId);return}t.scrollIntoView({block:"start",behavior:"auto"})}function kt(){let e=(0,Cn.c)(2),t=R(Le),n;return e[0]===t?n=e[1]:(n=()=>{let o=Nn();t(s=>({mode:na(s.mode),cellAnchor:(o==null?void 0:o.cellId)??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{zn(o)})})},e[0]=t,e[1]=n),n}const wt=At(!1);var Mn=z();const Wn=()=>{let e=(0,Mn.c)(7),{selectedLayout:t}=$e(),{setLayoutView:n}=qe();if(ee()&&!Lt("wasm_layouts"))return null;let o;e[0]===n?o=e[1]:(o=d=>n(d),e[0]=n,e[1]=o);let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsx)(ua,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:(0,a.jsx)(da,{placeholder:"Select a view"})}),e[2]=s):s=e[2];let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsx)(ha,{children:(0,a.jsxs)(ma,{children:[(0,a.jsx)(ia,{children:"View as"}),lt.map(An)]})}),e[3]=l):l=e[3];let r;return e[4]!==t||e[5]!==o?(r=(0,a.jsxs)(pa,{"data-testid":"layout-select",value:t,onValueChange:o,children:[s,l]}),e[4]=t,e[5]=o,e[6]=r):r=e[6],r};function Sn(e){return(0,a.jsx)(gt(e),{className:"h-4 w-4"})}function gt(e){switch(e){case"vertical":return ln;case"grid":return Ea;case"slides":return mt;default:return va(e),qa}}function jt(e){return we.startCase(e)}function An(e){return(0,a.jsx)(ca,{value:e,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 leading-5",children:[Sn(e),(0,a.jsx)("span",{children:jt(e)})]})},e)}async function _n(e){let{preset:t,downloadPDF:n}=e;await n({webpdf:!1,preset:t,includeInputs:!0,rasterServer:"static"})}var Dn=z();function En(e){let t=(0,Dn.c)(5),{openPrompt:n,closeModal:o}=ne(),{sendCopy:s}=T(),l;return t[0]!==o||t[1]!==n||t[2]!==s||t[3]!==e?(l=()=>{if(!e)return null;let r=Ba.guessDeliminator(e);n({title:"Copy notebook",description:"Enter a new filename for the notebook copy.",defaultValue:`_${Je.basename(e)}`,confirmText:"Copy notebook",spellCheck:!1,onConfirm:d=>{let i=r.join(Je.dirname(e),d);s({source:e,destination:i}).then(()=>{o(),W({title:"Notebook copied",description:"A copy of the notebook has been created."}),tn(i)})}})},t[0]=o,t[1]=n,t[2]=s,t[3]=e,t[4]=l):l=t[4],l}var In=z();function vt(){let e=(0,In.c)(4),{openConfirm:t}=ne(),n=R(Oe),{sendRestart:o}=T(),s;return e[0]!==t||e[1]!==o||e[2]!==n?(s=()=>{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,a.jsx)(la,{onClick:async()=>{n({state:Te.CLOSING}),await o(),Va()},"aria-label":"Confirm Restart",children:"Restart"})})},e[0]=t,e[1]=o,e[2]=n,e[3]=s):s=e[3],s}var Pn=z(),Tn=new Yt,Ln=e=>Tn.isSupported(e)?"markdown":"code";const Ct=()=>{let e=(0,Pn.c)(3),{updateCellConfig:t}=Ae(),{saveCellConfig:n}=T(),o;return e[0]!==n||e[1]!==t?(o=async(s,l)=>{let r=De(),d={};for(let c of r.cellIds.inOrderIds){let h=r.cellData[c];h===void 0||h.config.hide_code===s||Ln(h.code)===l&&(d[c]={hide_code:s})}let i=Ie.entries(d);if(i.length!==0){await n({configs:d});for(let[c,h]of i)t({cellId:c,config:h})}},e[0]=n,e[1]=t,e[2]=o):o=e[2],o};var On=z(),O=e=>{e==null||e.preventDefault(),e==null||e.stopPropagation()};function Hn(){var ze,Me,We;let e=(0,On.c)(56),t=Ga(),{openModal:n,closeModal:o}=ne(),{toggleApplication:s}=Ht(),{selectedPanel:l}=$t(),[r]=St(Le),d=N(aa),i=Ct(),[c]=ea(),h=N(Dt),x=N(ta),{updateCellConfig:m,undoDeleteCell:b,clearAllCellOutputs:f,addSetupCellIfDoesntExist:y,collapseAllCells:w,expandAllCells:g}=Ae(),j=vt(),u=Ya(),H=En(t),S=R(wt),re=R(Jt),{handleClick:le}=Qt(),ie=R(Xt),{exportAsIPYNB:de,exportAsMarkdown:ce,readCode:A,saveCellConfig:he,updateCellOutputs:_}=T(),D=an(),me=N(Ut),ue=N(Vt),pe=N(qt),{selectedLayout:$}=$e(),{setLayoutView:fe}=qe(),q=kt(),B=((ze=c.sharing)==null?void 0:ze.html)??!0,U=((Me=c.sharing)==null?void 0:Me.wasm)??!0,Y=((We=c.sharing)==null?void 0:We.molab)??!0,Ne=!ee(),xe=$==="slides",Nt=no,zt=ao,K;e[0]!==t||e[1]!==D||e[2]!==_?(K=async p=>{let{preset:C,title:M}=p;if(!t){se();return}await He(M,async ye=>{await rt({takeScreenshots:()=>D({progress:ye}),updateCellOutputs:_}),await _n({preset:C,downloadPDF:ba})})},e[0]=t,e[1]=D,e[2]=_,e[3]=K):K=e[3];let E=K,V;e[4]===E?V=e[5]:(V=async()=>{if(Ne){await E({preset:"document",title:"Downloading Document PDF..."});return}let p=new Event("export-beforeprint"),C=new Event("export-afterprint");window.dispatchEvent(p),setTimeout(to,0),setTimeout(()=>window.dispatchEvent(C),0)},e[4]=E,e[5]=V);let G=V,J;e[6]!==de||e[7]!==t||e[8]!==D||e[9]!==_?(J=async()=>{if(!t){se();return}await He("Downloading IPYNB...",async p=>{await rt({takeScreenshots:()=>D({progress:p}),updateCellOutputs:_}),Re(await de({download:!1}))})},e[6]=de,e[7]=t,e[8]=D,e[9]=_,e[10]=J):J=e[10];let be=J,Q;e[11]===Symbol.for("react.memo_cache_sentinel")?(Q=(0,a.jsx)(fa,{size:14,strokeWidth:1.5}),e[11]=Q):Q=e[11];let X;e[12]===Symbol.for("react.memo_cache_sentinel")?(X=(0,a.jsx)(Fe,{size:14,strokeWidth:1.5}),e[12]=X):X=e[12];let I;e[13]===t?I=e[14]:(I=async()=>{if(!t){se();return}await Be({includeCode:!0})},e[13]=t,e[14]=I);let Z;return e[15]!==y||e[16]!==x||e[17]!==ue||e[18]!==h||e[19]!==f||e[20]!==o||e[21]!==w||e[22]!==H||e[23]!==E||e[24]!==g||e[25]!==ce||e[26]!==t||e[27]!==G||e[28]!==be||e[29]!==me||e[30]!==xe||e[31]!==d||e[32]!==n||e[33]!==le||e[34]!==A||e[35]!==j||e[36]!==u||e[37]!==he||e[38]!==$||e[39]!==l||e[40]!==i||e[41]!==S||e[42]!==ie||e[43]!==fe||e[44]!==re||e[45]!==B||e[46]!==Y||e[47]!==U||e[48]!==I||e[49]!==s||e[50]!==q||e[51]!==b||e[52]!==pe||e[53]!==m||e[54]!==r.mode?(Z=[{icon:Q,label:"Download",handle:O,dropdown:[{icon:X,label:"Download as HTML",handle:I},{icon:(0,a.jsx)(Fe,{size:14,strokeWidth:1.5}),label:"Download as HTML (exclude code)",handle:async()=>{if(!t){se();return}await Be({includeCode:!1})}},{icon:(0,a.jsx)(Qa,{strokeWidth:1.5,style:{width:14,height:14}}),label:"Download as Markdown",handle:async()=>{Re(await ce({download:!1}))}},{icon:(0,a.jsx)(dn,{size:14,strokeWidth:1.5}),label:"Download as ipynb",handle:be},{icon:(0,a.jsx)(Sa,{size:14,strokeWidth:1.5}),label:"Download Python code",handle:async()=>{let p=await A();ya(new Blob([p.contents],{type:"text/plain"}),xa.toPY(document.title))}},{divider:!0,icon:(0,a.jsx)(La,{size:14,strokeWidth:1.5}),label:"Download as PNG",disabled:r.mode!=="present",tooltip:r.mode==="present"?void 0:(0,a.jsxs)("span",{children:["Only available in app view. ",(0,a.jsx)("br",{}),"Toggle with: ",Ja("global.hideCode",!1)]}),handle:eo},xe?{divider:!0,icon:(0,a.jsx)(te,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:O,dropdown:[{icon:(0,a.jsx)(te,{size:14,strokeWidth:1.5}),label:"Document Layout",handle:G},{icon:(0,a.jsx)(te,{size:14,strokeWidth:1.5}),label:"Slides Layout",rightElement:zt(!0),hidden:!Ne,handle:async()=>{await E({preset:"slides",title:"Downloading Slides PDF..."})}}]}:{divider:!0,icon:(0,a.jsx)(te,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:G}]},{icon:(0,a.jsx)(Fa,{size:14,strokeWidth:1.5}),label:"Pair with an agent",hidden:ee(),handle:async()=>{n((0,a.jsx)(Za,{onClose:o}))}},{icon:(0,a.jsx)(hn,{size:14,strokeWidth:1.5}),label:"Share",handle:O,hidden:!B&&!U&&!Y,dropdown:[{icon:(0,a.jsx)(_a,{size:14,strokeWidth:1.5}),label:"Publish HTML to web",hidden:!B,handle:async()=>{n((0,a.jsx)(jn,{onClose:o}))}},{icon:(0,a.jsx)(Oa,{size:14,strokeWidth:1.5}),label:"Create WebAssembly link",hidden:!U,handle:async()=>{await ae(at({code:(await A()).contents})),W({title:"Copied",description:"Link copied to clipboard."})}},{icon:(0,a.jsx)(st,{size:14,strokeWidth:1.5}),label:"Create molab notebook",hidden:!Y,handle:async()=>{let p=at({code:(await A()).contents,baseUrl:`${v.molab}/new`});window.open(p,"_blank")}}]},{icon:(0,a.jsx)(cn,{size:14,strokeWidth:1.5}),label:"Helper panel",redundant:!0,handle:O,dropdown:Tt.flatMap(p=>{let C=p.type==="ai"&&!x;if(Ot({panel:p,capabilities:h,aiEnabled:x})&&!C)return[];let{type:M,Icon:ye,additionalKeywords:Mt}=p;return{label:we.startCase(M),rightElement:Nt(l===M),icon:(0,a.jsx)(ye,{size:14,strokeWidth:1.5}),handle:()=>{if(C){le("ai","ai-features");return}s(M)},additionalKeywords:Mt}})},{icon:(0,a.jsx)(mt,{size:14,strokeWidth:1.5}),label:"Present as",handle:O,dropdown:[{icon:r.mode==="present"?(0,a.jsx)($a,{size:14,strokeWidth:1.5}):(0,a.jsx)(Na,{size:14,strokeWidth:1.5}),label:"Toggle app view",hotkey:"global.hideCode",handle:()=>{q()}},...lt.map((p,C)=>{let M=gt(p);return{divider:C===0,label:jt(p),icon:(0,a.jsx)(M,{size:14,strokeWidth:1.5}),rightElement:(0,a.jsx)("div",{className:"w-8 flex justify-end",children:$===p&&(0,a.jsx)(Ue,{size:14})}),handle:()=>{fe(p),r.mode==="edit"&&q()}}})]},{icon:(0,a.jsx)(rn,{size:14,strokeWidth:1.5}),label:"Duplicate notebook",hidden:!t||ee(),handle:H},{icon:(0,a.jsx)(it,{size:14,strokeWidth:1.5}),label:"Copy code to clipboard",hidden:!t,handle:async()=>{await ae((await A()).contents),W({title:"Copied",description:"Code copied to clipboard."})}},{icon:(0,a.jsx)(Wa,{size:14,strokeWidth:1.5}),label:"Enable all cells",hidden:!me||d,handle:async()=>{let p=Kt(De());await he({configs:Ie.fromEntries(p.map(Zn))});for(let C of p)m({cellId:C,config:{disabled:!1}})}},{divider:!0,icon:(0,a.jsx)(ct,{size:14,strokeWidth:1.5}),label:"Add setup cell",handle:()=>{y({})}},{icon:(0,a.jsx)(Bt,{size:14,strokeWidth:1.5}),label:"Add database connection",handle:()=>{n((0,a.jsx)(Ve,{onClose:o}))}},{icon:(0,a.jsx)(Pa,{size:14,strokeWidth:1.5}),label:"Add remote storage",handle:()=>{n((0,a.jsx)(Ve,{defaultTab:"storage",onClose:o}))}},{icon:(0,a.jsx)(ut,{size:14,strokeWidth:1.5}),label:pe,hidden:!ue||d,handle:()=>{b()}},{icon:(0,a.jsx)(mn,{size:14,strokeWidth:1.5}),label:"Restart kernel",variant:"danger",handle:j,additionalKeywords:["reset","reload","restart"]},{icon:(0,a.jsx)(sn,{size:14,strokeWidth:1.5}),label:"Re-run all cells",redundant:!0,hotkey:"global.runAll",handle:async()=>{u()}},{icon:(0,a.jsx)(Ft,{size:14,strokeWidth:1.5}),label:"Clear all outputs",redundant:!0,handle:()=>{f()}},{icon:(0,a.jsx)(Ee,{size:14,strokeWidth:1.5}),label:"Show all code",hotkey:"global.showAllCode",handle:()=>i(!1,"code"),redundant:!0},{icon:(0,a.jsx)(Ye,{size:14,strokeWidth:1.5}),label:"Hide all code",hotkey:"global.hideAllCode",handle:()=>i(!0,"code"),redundant:!0},{icon:(0,a.jsx)(Ee,{size:14,strokeWidth:1.5}),label:"Show all markdown code",hotkey:"global.showAllMarkdownCode",handle:()=>i(!1,"markdown"),redundant:!0},{icon:(0,a.jsx)(Ye,{size:14,strokeWidth:1.5}),label:"Hide all markdown code",hotkey:"global.hideAllMarkdownCode",handle:()=>i(!0,"markdown"),redundant:!0},{icon:(0,a.jsx)(on,{size:14,strokeWidth:1.5}),label:"Collapse all sections",hotkey:"global.collapseAllSections",handle:w,redundant:!0},{icon:(0,a.jsx)(nn,{size:14,strokeWidth:1.5}),label:"Expand all sections",hotkey:"global.expandAllSections",handle:g,redundant:!0},{divider:!0,icon:(0,a.jsx)(dt,{size:14,strokeWidth:1.5}),label:"Command palette",hotkey:"global.commandPalette",handle:()=>S(Xn)},{icon:(0,a.jsx)(za,{size:14,strokeWidth:1.5}),label:"Keyboard shortcuts",hotkey:"global.showHelp",handle:()=>ie(Qn)},{icon:(0,a.jsx)(Ra,{size:14,strokeWidth:1.5}),label:"User settings",handle:()=>re(Jn),redundant:!0,additionalKeywords:["preferences","options","configuration"]},{icon:(0,a.jsx)(ht,{size:14,strokeWidth:1.5}),label:"Report an issue",additionalKeywords:["feedback","bug","issue","report","diagnostics"],handle:()=>n((0,a.jsx)(bt,{onClose:o}))},{icon:(0,a.jsx)(Ke,{size:14,strokeWidth:1.5}),label:"Resources",handle:O,dropdown:[{icon:(0,a.jsx)(Rt,{size:14,strokeWidth:1.5}),label:"Documentation",handle:Gn},{icon:(0,a.jsx)(en,{className:"h-3.5 w-3.5"}),label:"GitHub",handle:Vn},{icon:(0,a.jsx)(Da,{size:14,strokeWidth:1.5}),label:"Discord Community",handle:Kn},{icon:(0,a.jsx)(Ia,{className:"h-3.5 w-3.5"}),label:"YouTube",handle:Yn},{icon:(0,a.jsx)(It,{size:14,strokeWidth:1.5}),label:"Changelog",handle:Un}]},{divider:!0,icon:(0,a.jsx)(Ta,{size:14,strokeWidth:1.5}),label:"Open home",hidden:!location.search.includes("file"),handle:Bn},{icon:(0,a.jsx)(st,{size:14,strokeWidth:1.5}),label:"New notebook",hidden:!location.search.includes("file"),handle:qn}].filter($n).map(Rn),e[15]=y,e[16]=x,e[17]=ue,e[18]=h,e[19]=f,e[20]=o,e[21]=w,e[22]=H,e[23]=E,e[24]=g,e[25]=ce,e[26]=t,e[27]=G,e[28]=be,e[29]=me,e[30]=xe,e[31]=d,e[32]=n,e[33]=le,e[34]=A,e[35]=j,e[36]=u,e[37]=he,e[38]=$,e[39]=l,e[40]=i,e[41]=S,e[42]=ie,e[43]=fe,e[44]=re,e[45]=B,e[46]=Y,e[47]=U,e[48]=I,e[49]=s,e[50]=q,e[51]=b,e[52]=pe,e[53]=m,e[54]=r.mode,e[55]=Z):Z=e[55],Z}function Rn(e){return e.dropdown?{...e,dropdown:e.dropdown.filter(Fn)}:e}function Fn(e){return!e.hidden}function $n(e){return!e.hidden}function qn(){let e=Ua();window.open(e,"_blank")}function Bn(){let e=document.baseURI.split("?")[0];window.open(e,"_blank","noopener")}function Un(){window.open(v.releasesPage,"_blank")}function Yn(){window.open(v.youtube,"_blank")}function Kn(){window.open(v.discordLink,"_blank")}function Vn(){window.open(v.githubPage,"_blank")}function Gn(){window.open(v.docsPage,"_blank")}function Jn(e){return!e}function Qn(e){return!e}function Xn(e){return!e}function Zn(e){return[e,{disabled:!1}]}async function eo(){let e=document.getElementById("App");e&&await ka({element:e,filename:document.title,prepare:wa})}function to(){return window.print()}function ao(e){return e?(0,a.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"}):null}function no(e){return(0,a.jsx)("div",{className:"w-8 flex justify-end",children:e&&(0,a.jsx)(Ue,{size:14})})}function se(){W({title:"Error",description:"Notebooks must be named to be exported.",variant:"danger"})}export{wt as a,je as c,ct as d,dt as f,Wn as i,ut as l,Ct as n,kt as o,it as p,vt as r,wn as s,Hn as t,ht as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as k,n as i,p as v}from"./useEvent-D91BmmQi.js";import{E as w,Wn as y,ci as F,hi as b,ht as x,m as d}from"./cells-DzyDERZy.js";import{t as D}from"./compiler-runtime-B3qBwwSJ.js";import{g as E}from"./useEventListener-C0195JsF.js";import{o as H}from"./dist-DYEuVkEX.js";import{r as V}from"./requests-9-v2bhoi.js";var u=D();const g=v(!1);function W(){let r=(0,u.c)(2),n=f(),t;return r[0]===n?t=r[1]:(t=()=>n(b(d())),r[0]=n,r[1]=t),i(t)}function _(r){let n=(0,u.c)(3),t=f(),o;return n[0]!==r||n[1]!==t?(o=()=>{r!==void 0&&t([r])},n[0]=r,n[1]=t,n[2]=o):o=n[2],i(o)}function j(){let r=(0,u.c)(2),n=f(),t;return r[0]===n?t=r[1]:(t=()=>n(F(d())),r[0]=n,r[1]=t),i(t)}function f(){let r=(0,u.c)(4),{prepareForRun:n}=w(),{sendRun:t}=V(),o=k(g),e;return r[0]!==n||r[1]!==t||r[2]!==o?(e=async s=>{if(s.length===0)return;let c=d();return o(!0),I({cellIds:s,sendRun:t,prepareForRun:n,notebook:c})},r[0]=n,r[1]=t,r[2]=o,r[3]=e):e=r[3],i(e)}async function I({cellIds:r,sendRun:n,prepareForRun:t,notebook:o}){var m,h,R;if(r.length===0)return;let{cellHandles:e,cellData:s}=o,c=[];for(let a of r){let l=(h=(m=e[a])==null?void 0:m.current)==null?void 0:h.editorView,p;l?(y(l)!=="markdown"&&H(l),p=x(l)):p=((R=s[a])==null?void 0:R.code)||"",c.push(p),t({cellId:a})}await n({cellIds:r,codes:c}).catch(a=>{E.error(a)})}export{f as a,_ as i,I as n,W as o,j as r,g as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as m}from"./chunk-LvLJmgfZ.js";import{n as p}from"./useEvent-D91BmmQi.js";import{E as d,d as f,ht as u}from"./cells-DzyDERZy.js";import{t as c}from"./compiler-runtime-B3qBwwSJ.js";import{t as C}from"./jsx-runtime-Blw4afVn.js";import{r as h}from"./useDeleteCell-vMXAr3rY.js";import{t as v}from"./use-toast-BwJoaaDM.js";var x=c(),b=m(C(),1);function j(){let t=(0,x.c)(3),{splitCell:i,undoSplitCell:r}=d(),o;return t[0]!==i||t[1]!==r?(o=s=>{let l=f(s.cellId);if(!l)return;let a=u(l);i(s);let{dismiss:n}=v({title:"Cell split",action:(0,b.jsx)(h,{"data-testid":"undo-split-button",size:"sm",variant:"outline",onClick:()=>{r({...s,snapshot:a}),e()},children:"Undo"})}),e=n},t[0]=i,t[1]=r,t[2]=o):o=t[2],p(o)}export{j 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-
|
|
69
|
+
<script type="module" crossorigin src="./assets/index-C7_REKh1.js"></script>
|
|
70
70
|
<link rel="modulepreload" crossorigin href="./assets/preload-helper-TXkS1QI3.js">
|
|
71
71
|
<link rel="modulepreload" crossorigin href="./assets/objects-BlG0ZrO0.js">
|
|
72
72
|
<link rel="modulepreload" crossorigin href="./assets/chunk-LvLJmgfZ.js">
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
<link rel="modulepreload" crossorigin href="./assets/debounce-OiXznToA.js">
|
|
135
135
|
<link rel="modulepreload" crossorigin href="./assets/database-zap-CKO8g4BU.js">
|
|
136
136
|
<link rel="modulepreload" crossorigin href="./assets/main-BNL5rxQw.js">
|
|
137
|
-
<link rel="modulepreload" crossorigin href="./assets/cells-
|
|
137
|
+
<link rel="modulepreload" crossorigin href="./assets/cells-DzyDERZy.js">
|
|
138
138
|
<link rel="modulepreload" crossorigin href="./assets/kbd-C5HnBH5U.js">
|
|
139
139
|
<link rel="modulepreload" crossorigin href="./assets/useInstallPackage-WiYBwhUO.js">
|
|
140
140
|
<link rel="modulepreload" crossorigin href="./assets/alert-dialog-Bb8Lz8ko.js">
|
|
@@ -147,40 +147,40 @@
|
|
|
147
147
|
<link rel="modulepreload" crossorigin href="./assets/usePress-5hBv4sjD.js">
|
|
148
148
|
<link rel="modulepreload" crossorigin href="./assets/input-JxFwu-3G.js">
|
|
149
149
|
<link rel="modulepreload" crossorigin href="./assets/ImperativeModal-fY-ZfT0b.js">
|
|
150
|
-
<link rel="modulepreload" crossorigin href="./assets/cell-link-
|
|
150
|
+
<link rel="modulepreload" crossorigin href="./assets/cell-link-w5IbCQV4.js">
|
|
151
151
|
<link rel="modulepreload" crossorigin href="./assets/config-BJVx3eBW.js">
|
|
152
152
|
<link rel="modulepreload" crossorigin href="./assets/alert-jlwhGxSb.js">
|
|
153
153
|
<link rel="modulepreload" crossorigin href="./assets/chevron-right-BS_NcSch.js">
|
|
154
154
|
<link rel="modulepreload" crossorigin href="./assets/dropdown-menu-dHmZR8bI.js">
|
|
155
155
|
<link rel="modulepreload" crossorigin href="./assets/links-wcQA1Np1.js">
|
|
156
|
-
<link rel="modulepreload" crossorigin href="./assets/useRunCells-
|
|
156
|
+
<link rel="modulepreload" crossorigin href="./assets/useRunCells-C2dvU2jA.js">
|
|
157
157
|
<link rel="modulepreload" crossorigin href="./assets/copy-Bxb1_Gtw.js">
|
|
158
158
|
<link rel="modulepreload" crossorigin href="./assets/copy-3iHFdt22.js">
|
|
159
159
|
<link rel="modulepreload" crossorigin href="./assets/copy-icon-neDQUo4Q.js">
|
|
160
|
-
<link rel="modulepreload" crossorigin href="./assets/RenderHTML-
|
|
161
|
-
<link rel="modulepreload" crossorigin href="./assets/datasource-
|
|
162
|
-
<link rel="modulepreload" crossorigin href="./assets/state-
|
|
160
|
+
<link rel="modulepreload" crossorigin href="./assets/RenderHTML-Cd-PP5ZR.js">
|
|
161
|
+
<link rel="modulepreload" crossorigin href="./assets/datasource-D_VcQMEn.js">
|
|
162
|
+
<link rel="modulepreload" crossorigin href="./assets/state-DxQhUsG9.js">
|
|
163
163
|
<link rel="modulepreload" crossorigin href="./assets/hat-glasses-BttHlyvs.js">
|
|
164
164
|
<link rel="modulepreload" crossorigin href="./assets/package-Bxz_8e44.js">
|
|
165
165
|
<link rel="modulepreload" crossorigin href="./assets/sparkles-DUCpRFlS.js">
|
|
166
|
-
<link rel="modulepreload" crossorigin href="./assets/MarimoErrorOutput-
|
|
166
|
+
<link rel="modulepreload" crossorigin href="./assets/MarimoErrorOutput-CIuzXFFo.js">
|
|
167
167
|
<link rel="modulepreload" crossorigin href="./assets/ErrorBoundary-DzTD8LVq.js">
|
|
168
168
|
<link rel="modulepreload" crossorigin href="./assets/eye-off-BOZA7gbn.js">
|
|
169
169
|
<link rel="modulepreload" crossorigin href="./assets/refresh-cw-CYq4mK5a.js">
|
|
170
|
-
<link rel="modulepreload" crossorigin href="./assets/tree-actions-
|
|
170
|
+
<link rel="modulepreload" crossorigin href="./assets/tree-actions-Dx9CDaxV.js">
|
|
171
171
|
<link rel="modulepreload" crossorigin href="./assets/spinner-D-V4psAa.js">
|
|
172
|
-
<link rel="modulepreload" crossorigin href="./assets/html-to-image-
|
|
173
|
-
<link rel="modulepreload" crossorigin href="./assets/focus-
|
|
172
|
+
<link rel="modulepreload" crossorigin href="./assets/html-to-image-JaxFFZcr.js">
|
|
173
|
+
<link rel="modulepreload" crossorigin href="./assets/focus-CNKbm-Xz.js">
|
|
174
174
|
<link rel="modulepreload" crossorigin href="./assets/useAsyncData-Bg5iAViP.js">
|
|
175
175
|
<link rel="modulepreload" crossorigin href="./assets/LazyAnyLanguageCodeMirror-B2JvSXP-.js">
|
|
176
176
|
<link rel="modulepreload" crossorigin href="./assets/micromark-factory-space-Dx_STMJD.js">
|
|
177
177
|
<link rel="modulepreload" crossorigin href="./assets/chunk-5FQGJX7Z-Cp0LZT-a.js">
|
|
178
|
-
<link rel="modulepreload" crossorigin href="./assets/markdown-renderer-
|
|
178
|
+
<link rel="modulepreload" crossorigin href="./assets/markdown-renderer-sEayY9-m.js">
|
|
179
179
|
<link rel="modulepreload" crossorigin href="./assets/command-Dqxie4gq.js">
|
|
180
180
|
<link rel="modulepreload" crossorigin href="./assets/field-BsxD35VE.js">
|
|
181
181
|
<link rel="modulepreload" crossorigin href="./assets/popover-Bcz1Zikb.js">
|
|
182
182
|
<link rel="modulepreload" crossorigin href="./assets/errors-PgHhDa-M.js">
|
|
183
|
-
<link rel="modulepreload" crossorigin href="./assets/download-
|
|
183
|
+
<link rel="modulepreload" crossorigin href="./assets/download-DpS57jyt.js">
|
|
184
184
|
<link rel="modulepreload" crossorigin href="./assets/table-CH2plyy9.js">
|
|
185
185
|
<link rel="modulepreload" crossorigin href="./assets/useIframeCapabilities-j6fR_dBA.js">
|
|
186
186
|
<link rel="modulepreload" crossorigin href="./assets/error-banner-BSxEOIn2.js">
|
|
@@ -201,33 +201,33 @@
|
|
|
201
201
|
<link rel="modulepreload" crossorigin href="./assets/plus-AgXtozBz.js">
|
|
202
202
|
<link rel="modulepreload" crossorigin href="./assets/trash-2-72W0TZ3L.js">
|
|
203
203
|
<link rel="modulepreload" crossorigin href="./assets/react-resizable-panels.browser.esm-Z-MD3n3J.js">
|
|
204
|
-
<link rel="modulepreload" crossorigin href="./assets/JsonOutput-
|
|
204
|
+
<link rel="modulepreload" crossorigin href="./assets/JsonOutput-CyzvjIjx.js">
|
|
205
205
|
<link rel="modulepreload" crossorigin href="./assets/chart-no-axes-column-iDRxid4h.js">
|
|
206
206
|
<link rel="modulepreload" crossorigin href="./assets/square-function-DNNRTPQJ.js">
|
|
207
207
|
<link rel="modulepreload" crossorigin href="./assets/spec-C7opZZRp.js">
|
|
208
|
-
<link rel="modulepreload" crossorigin href="./assets/column-preview-
|
|
208
|
+
<link rel="modulepreload" crossorigin href="./assets/column-preview-Cb8R9kfl.js">
|
|
209
209
|
<link rel="modulepreload" crossorigin href="./assets/icons-CIPE8AIY.js">
|
|
210
|
-
<link rel="modulepreload" crossorigin href="./assets/radio-group-
|
|
211
|
-
<link rel="modulepreload" crossorigin href="./assets/floating-outline-
|
|
210
|
+
<link rel="modulepreload" crossorigin href="./assets/radio-group-DfioQthW.js">
|
|
211
|
+
<link rel="modulepreload" crossorigin href="./assets/floating-outline-LitP0wCD.js">
|
|
212
212
|
<link rel="modulepreload" crossorigin href="./assets/switch-OVajJBPR.js">
|
|
213
213
|
<link rel="modulepreload" crossorigin href="./assets/objectWithoutPropertiesLoose-CboCOq4o.js">
|
|
214
214
|
<link rel="modulepreload" crossorigin href="./assets/esm-B30N1GS0.js">
|
|
215
|
-
<link rel="modulepreload" crossorigin href="./assets/readonly-python-code-
|
|
215
|
+
<link rel="modulepreload" crossorigin href="./assets/readonly-python-code-DHxOnQGj.js">
|
|
216
216
|
<link rel="modulepreload" crossorigin href="./assets/file-headphone-DAu6VO6j.js">
|
|
217
217
|
<link rel="modulepreload" crossorigin href="./assets/file-CJH9JNGH.js">
|
|
218
218
|
<link rel="modulepreload" crossorigin href="./assets/image-5XI2VU-q.js">
|
|
219
|
-
<link rel="modulepreload" crossorigin href="./assets/file-icons-
|
|
219
|
+
<link rel="modulepreload" crossorigin href="./assets/file-icons-DfWENcb8.js">
|
|
220
220
|
<link rel="modulepreload" crossorigin href="./assets/events-90X9nql5.js">
|
|
221
221
|
<link rel="modulepreload" crossorigin href="./assets/share-852X_cqy.js">
|
|
222
222
|
<link rel="modulepreload" crossorigin href="./assets/blob-C3EfaMOb.js">
|
|
223
223
|
<link rel="modulepreload" crossorigin href="./assets/memoize-Tp7rARFe.js">
|
|
224
224
|
<link rel="modulepreload" crossorigin href="./assets/get-C-qh_et5.js">
|
|
225
225
|
<link rel="modulepreload" crossorigin href="./assets/_baseSet-CsW0tABf.js">
|
|
226
|
-
<link rel="modulepreload" crossorigin href="./assets/state-
|
|
226
|
+
<link rel="modulepreload" crossorigin href="./assets/state-DtziTd1T.js">
|
|
227
227
|
<link rel="modulepreload" crossorigin href="./assets/label-CqjrpwRC.js">
|
|
228
|
-
<link rel="modulepreload" crossorigin href="./assets/textarea-
|
|
228
|
+
<link rel="modulepreload" crossorigin href="./assets/textarea-Bmzmbbpo.js">
|
|
229
229
|
<link rel="modulepreload" crossorigin href="./assets/refresh-ccw-sLaKP2vj.js">
|
|
230
|
-
<link rel="modulepreload" crossorigin href="./assets/form-
|
|
230
|
+
<link rel="modulepreload" crossorigin href="./assets/form-nHzLTU1m.js">
|
|
231
231
|
<link rel="modulepreload" crossorigin href="./assets/renderShortcut-Bl8_FVn8.js">
|
|
232
232
|
<link rel="modulepreload" crossorigin href="./assets/useBoolean-CFj86iac.js">
|
|
233
233
|
<link rel="modulepreload" crossorigin href="./assets/useDeepCompareMemoize-CSMoa-ga.js">
|