@marimo-team/frontend 0.23.11-dev18 → 0.23.11-dev19

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 (23) hide show
  1. package/dist/assets/{add-cell-with-ai-C0lcHMau.js → add-cell-with-ai-D1HMdh52.js} +1 -1
  2. package/dist/assets/{agent-panel-qD32ezKc.js → agent-panel-HJKRcCdY.js} +1 -1
  3. package/dist/assets/{ai-model-dropdown-BQfNdQVc.js → ai-model-dropdown-BUVX-tXn.js} +4 -4
  4. package/dist/assets/{app-config-button-BwxaElpE.js → app-config-button-9PxT1i98.js} +1 -1
  5. package/dist/assets/{cell-editor-Bn2sVqG7.js → cell-editor-Bx7gOPwL.js} +1 -1
  6. package/dist/assets/{chat-display-B8HeYOzn.js → chat-display-DEePQXjB.js} +1 -1
  7. package/dist/assets/{chat-panel-BrUMpJ4A.js → chat-panel-CgoxbsMi.js} +1 -1
  8. package/dist/assets/{chat-ui-BGavxhon.js → chat-ui-D2QkwjKU.js} +1 -1
  9. package/dist/assets/{command-palette-CDiij39L.js → command-palette-IMHTYfai.js} +1 -1
  10. package/dist/assets/{edit-page-Bws6ukXz.js → edit-page-BBtiKJhO.js} +4 -4
  11. package/dist/assets/{home-page-hiaFhmz6.js → home-page-CaZNGTTU.js} +1 -1
  12. package/dist/assets/{hooks-C4imqjqn.js → hooks-CY4KeAYS.js} +1 -1
  13. package/dist/assets/{index-CWJFLSxG.js → index-CjSc3ZEy.js} +3 -3
  14. package/dist/assets/{layout-BM5fVTRN.js → layout-B093uDWH.js} +2 -2
  15. package/dist/assets/{packages-panel-Dxgmfsb3.js → packages-panel-J5zHBH5Z.js} +1 -1
  16. package/dist/assets/{panels-CMqUTzwe.js → panels-CtE4FsFt.js} +1 -1
  17. package/dist/assets/{reveal-component-B-2Vs_FH.js → reveal-component-CYeSojfe.js} +1 -1
  18. package/dist/assets/{run-page-D538bsUE.js → run-page-Hxusxawi.js} +1 -1
  19. package/dist/assets/{scratchpad-panel--Yzhajt3.js → scratchpad-panel-Cs-2Mtyy.js} +1 -1
  20. package/dist/assets/{useNotebookActions-EMa_IfTV.js → useNotebookActions-3Vk8OfKI.js} +1 -1
  21. package/dist/index.html +1 -1
  22. package/package.json +1 -1
  23. package/src/components/app-config/ai-config.tsx +6 -1
@@ -1 +1 @@
1
- import{s as We}from"./chunk-LvLJmgfZ.js";import{d as L,l as it,p as st,u as P}from"./useEvent-D91BmmQi.js";import{t as lt}from"./react-Bj1aDYRI.js";import{An as rt,Cr as dt,D as Me,E as ct,Mn as ht,Nn as pt,On as mt,Or as ut,Qt as ft,Tn as bt,Ui as be,_ as yt,br as kt,ct as xt,dt as De,h as _e,kn as wt,lt as gt,ni as jt,t as vt,vr as Ct}from"./cells-a44D37GV.js";import{t as I}from"./compiler-runtime-B3qBwwSJ.js";import{n as zt,r as Wt,x as Mt}from"./ai-model-dropdown-BQfNdQVc.js";import{_ as H,d as Se}from"./useEventListener-BfYriKqt.js";import{r as Dt,x as _t}from"./utils-BGFUZat2.js";import{n as z,t as Ae}from"./constants-B9JJ72XE.js";import{T as X,v as St,w as At}from"./config-Fh_0wwfW.js";import{t as Nt}from"./jsx-runtime-PbYoItBR.js";import{o as Pt}from"./alert-dialog-V2tySmFn.js";import{a as It,c as Et,i as Tt,n as Lt,r as Ht,s as Rt,t as qt}from"./select-sS-2VQvj.js";import{Nt as Ot}from"./JsonOutput-BP1BF3ok.js";import{c as Ne,d as ye,n as Bt,o as Ft,r as ke,t as Vt}from"./download-YFYBUFlh.js";import{t as Yt}from"./tooltip-CWSr2PfE.js";import{r as Ut,t as xe}from"./button-Db07tdz7.js";import{i as $t,t as Pe}from"./strings-B-yaq2o7.js";import{r as R}from"./requests-KshNNAOp.js";import{t as h}from"./createLucideIcon-BTp1tQDO.js";import{F as Kt,I as Gt,L as Ie,P as Jt,R as Qt,a as Ee,i as Te,u as Le}from"./layout-BM5fVTRN.js";import{t as He}from"./check-DQmqoJgr.js";import{r as Xt}from"./useCellActionButton-B8YCBRJi.js";import{t as Zt}from"./copy-CFO636Td.js";import{t as ea}from"./eye-off-6RDlHoCz.js";import{t as ta}from"./external-link-mfK38Tpg.js";import{t as Z}from"./file-ZPWSptQF.js";import{t as aa}from"./github-BZsqHbeC.js";import{u as oa}from"./form-b6jUTUMx.js";import{n as na,r as ia,t as sa}from"./youtube-DER9xpF0.js";import{i as la,n as Re}from"./add-connection-dialog-B60ibI0N.js";import{t as ra}from"./house-DTijHETb.js";import{t as da}from"./image-CzV694oU.js";import{t as ca}from"./link-D215MpkN.js";import{r as ha}from"./input-DiAad2nt.js";import{t as pa}from"./settings-CP-IXCzQ.js";import{t as ma}from"./sparkles-DctOjjEz.js";import{y as ua}from"./textarea-D1Q7dFo2.js";import{t as fa}from"./square-DPWHdF_-.js";import{t as W}from"./use-toast-BH8bU9Xf.js";import{n as qe,t as ba}from"./paths-kNeJ8nbe.js";import{o as ya}from"./session-DF0gSADo.js";import{n as ee}from"./copy-DlC1PYY-.js";import{r as ka}from"./useRunCells-BRYGWDtj.js";import{a as xa,c as wa,i as ga,n as ja,r as va}from"./dialog-CNmqslzW.js";import{n as we}from"./ImperativeModal-CEtvKaPt.js";import{r as Ca,t as Oe}from"./share-CDUcBp99.js";import{a as za}from"./cell-link-Bia8_3oN.js";import{a as Wa}from"./renderShortcut-BV7Qf4L2.js";import{t as Ma}from"./icons-D3YFXNmD.js";import{t as Da}from"./pair-with-agent-modal-DHxMYnfm.js";import{n as Be}from"./marimo-icons-D6kVaIsS.js";import{t as _a}from"./links-DYp0FOur.js";import{r as Sa,t as Fe}from"./hooks-C4imqjqn.js";import{t as Ve}from"./types-DZmRsGZN.js";var Aa=h("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),Na=h("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),Ye=h("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"}]]),Ue=h("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"}]]),$e=h("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"}]]),Pa=h("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"}]]),Ia=h("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"}]]),Ea=h("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"}]]),Ta=h("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"}]]),La=h("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Ke=h("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"}]]),Ha=h("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"}]]),Ra=h("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"}]]),Ge=h("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"}]]),Je=I(),ge=We(lt(),1),a=We(Nt(),1),te="https://static.marimo.app";const qa=e=>{let t=(0,Je.c)(25),{onClose:n}=e,[o,s]=(0,ge.useState)(""),{exportAsHTML:r}=R(),l=`${o}-${Math.random().toString(36).slice(2,6)}`,i=`${te}/static/${l}`,c;t[0]!==r||t[1]!==n||t[2]!==l?(c=async v=>{v.preventDefault(),n();let T=await r({download:!1,includeCode:!0,files:Jt.INSTANCE.filenames()}),M=W({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${te}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:T,path:l})}).catch(()=>{M.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:z.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),M.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]=r,t[1]=n,t[2]=l,t[3]=c):c=t[3];let p;t[4]===Symbol.for("react.memo_cache_sentinel")?(p=(0,a.jsx)(wa,{children:"Share static notebook"}),t[4]=p):p=t[4];let g;t[5]===Symbol.for("react.memo_cache_sentinel")?(g=(0,a.jsxs)(xa,{children:[p,(0,a.jsxs)(va,{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:te,target:"_blank",children:te}),"."]})]}),t[5]=g):g=t[5];let w;t[6]===Symbol.for("react.memo_cache_sentinel")?(w=v=>{s(v.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,""))},t[6]=w):w=t[6];let u;t[7]===o?u=t[8]:(u=(0,a.jsx)(ha,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:w,required:!0,autoComplete:"off"}),t[7]=o,t[8]=u);let f;t[9]===i?f=t[10]:(f=(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)(Oa,{text:i}),(0,a.jsx)("span",{className:"text-primary",children:i})]})]}),t[9]=i,t[10]=f);let b;t[11]!==u||t[12]!==f?(b=(0,a.jsxs)("div",{className:"flex flex-col gap-6 py-4",children:[u,f]}),t[11]=u,t[12]=f,t[13]=b):b=t[13];let y;t[14]===n?y=t[15]:(y=(0,a.jsx)(xe,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),t[14]=n,t[15]=y);let k;t[16]===i?k=t[17]:(k=(0,a.jsx)(xe,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await ee(i)},children:"Create"}),t[16]=i,t[17]=k);let x;t[18]!==y||t[19]!==k?(x=(0,a.jsxs)(ga,{children:[y,k]}),t[18]=y,t[19]=k,t[20]=x):x=t[20];let j;return t[21]!==c||t[22]!==x||t[23]!==b?(j=(0,a.jsx)(ja,{className:"w-fit",children:(0,a.jsxs)("form",{onSubmit:c,children:[g,b,x]})}),t[21]=c,t[22]=x,t[23]=b,t[24]=j):j=t[24],j};var Oa=e=>{let t=(0,Je.c)(8),[n,o]=ge.useState(!1),s;t[0]===e.text?s=t[1]:(s=Ut.stopPropagation(async p=>{p.preventDefault(),await ee(e.text),o(!0),setTimeout(()=>o(!1),2e3)}),t[0]=e.text,t[1]=s);let r=s,l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsx)(Zt,{size:14,strokeWidth:1.5}),t[2]=l):l=t[2];let i;t[3]===r?i=t[4]:(i=(0,a.jsx)(xe,{"data-testid":"copy-static-notebook-url-button",onClick:r,size:"xs",variant:"secondary",children:l}),t[3]=r,t[4]=i);let c;return t[5]!==n||t[6]!==i?(c=(0,a.jsx)(Yt,{content:"Copied!",open:n,children:i}),t[5]=n,t[6]=i,t[7]=c):c=t[7],c},Ba=I();function Fa(){let e=document.getElementsByClassName(Ae.outputArea);for(let t of e){let n=t.getBoundingClientRect();if(n.bottom>0&&n.top<window.innerHeight){let o=be.findElement(t);if(!o){H.warn("Could not find HTMLCellId for visible output area",t);continue}return{cellId:be.parse(o.id)}}}return H.warn("No visible output area found for scroll anchor"),null}function Va(e){if(!e){H.warn("No scroll anchor provided to restore scroll position");return}let t=document.getElementById(be.create(e.cellId));if(!t){H.warn("Could not find cell element to restore scroll position",e.cellId);return}if(!t.querySelector(`.${Ae.outputArea}`)){H.warn("Could not find output area to restore scroll position",e.cellId);return}t.scrollIntoView({block:"start",behavior:"auto"})}function Qe(){let e=(0,Ba.c)(2),t=L(De),n;return e[0]===t?n=e[1]:(n=()=>{let o=Fa();t(s=>({mode:gt(s.mode),cellAnchor:(o==null?void 0:o.cellId)??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Va(o)})})},e[0]=t,e[1]=n),n}const Xe=st(!1);var Ya=I();const Ua=()=>{let e=(0,Ya.c)(7),{selectedLayout:t}=Ee(),{setLayoutView:n}=Te();if(X()&&!pt("wasm_layouts"))return null;let o;e[0]===n?o=e[1]:(o=i=>n(i),e[0]=n,e[1]=o);let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsx)(Rt,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:(0,a.jsx)(Et,{placeholder:"Select a view"})}),e[2]=s):s=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(Lt,{children:(0,a.jsxs)(Ht,{children:[(0,a.jsx)(It,{children:"View as"}),Ve.map(Ka)]})}),e[3]=r):r=e[3];let l;return e[4]!==t||e[5]!==o?(l=(0,a.jsxs)(qt,{"data-testid":"layout-select",value:t,onValueChange:o,children:[s,r]}),e[4]=t,e[5]=o,e[6]=l):l=e[6],l};function $a(e){return(0,a.jsx)(Ze(e),{className:"h-4 w-4"})}function Ze(e){switch(e){case"vertical":return Ea;case"grid":return ia;case"slides":return Ke;default:return $t(e),fa}}function et(e){return Pe.startCase(e)}function Ka(e){return(0,a.jsx)(Tt,{value:e,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 leading-5",children:[$a(e),(0,a.jsx)("span",{children:et(e)})]})},e)}async function Ga(e){let{filename:t,preset:n,downloadPDF:o}=e;await o({filename:t,webpdf:!1,preset:n,includeInputs:!0,rasterServer:"static"})}var Ja=I();function Qa(e){let t=(0,Ja.c)(5),{openPrompt:n,closeModal:o}=we(),{sendCopy:s}=R(),r;return t[0]!==o||t[1]!==n||t[2]!==s||t[3]!==e?(r=()=>{if(!e)return null;let l=ba.guessDeliminator(e);n({title:"Copy notebook",description:"Enter a new filename for the notebook copy.",defaultValue:`_${qe.basename(e)}`,confirmText:"Copy notebook",spellCheck:!1,onConfirm:i=>{let c=l.join(qe.dirname(e),i);s({source:e,destination:c}).then(()=>{o(),W({title:"Notebook copied",description:"A copy of the notebook has been created."}),_a(c)})}})},t[0]=o,t[1]=n,t[2]=s,t[3]=e,t[4]=r):r=t[4],r}const Xa=()=>{let{updateCellConfig:e}=Me(),{saveCellConfig:t}=R();return(0,ge.useCallback)(async()=>{let n=new ft,o=_e(),s=o.cellIds.inOrderIds,r={};for(let i of s){if(o.cellData[i]===void 0)continue;let{code:c,config:p}=o.cellData[i];p.hide_code||n.isSupported(c)&&(r[i]={hide_code:!0})}let l=Se.entries(r);if(l.length!==0){await t({configs:r});for(let[i,c]of l)e({cellId:i,config:c})}},[e])};var Za=I();function tt(){let e=(0,Za.c)(4),{openConfirm:t}=we(),n=L(St),{sendRestart:o}=R(),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)(Pt,{onClick:async()=>{n({state:At.CLOSING}),await o(),Ca()},"aria-label":"Confirm Restart",children:"Restart"})})},e[0]=t,e[1]=o,e[2]=n,e[3]=s):s=e[3],s}var eo=I(),E=e=>{e==null||e.preventDefault(),e==null||e.stopPropagation()};function to(){var ve,Ce,ze;let e=(0,eo.c)(56),t=za(),{openModal:n,closeModal:o}=we(),{toggleApplication:s}=mt(),{selectedPanel:r}=wt(),[l]=it(De),i=P(xt),c=Xa(),[p]=_t(),g=P(bt),w=P(Dt),{updateCellConfig:u,undoDeleteCell:f,clearAllCellOutputs:b,addSetupCellIfDoesntExist:y,collapseAllCells:k,expandAllCells:x}=Me(),j=tt(),v=ka(),T=Qa(t),M=L(Xe),oe=L(zt),{handleClick:ne}=Wt(),ie=L(Mt),{exportAsIPYNB:se,exportAsMarkdown:le,readCode:D,saveCellConfig:re,updateCellOutputs:_}=R(),S=Sa(),de=P(yt),ce=P(vt),he=P(ct),{selectedLayout:q}=Ee(),{setLayoutView:pe}=Te(),O=Qe(),B=((ve=p.sharing)==null?void 0:ve.html)??!0,F=((Ce=p.sharing)==null?void 0:Ce.wasm)??!0,V=((ze=p.sharing)==null?void 0:ze.molab)??!0,je=!X(),me=q==="slides",at=wo,ot=xo,Y;e[0]!==t||e[1]!==S||e[2]!==_?(Y=async d=>{let{preset:m,title:C}=d;if(!t){ae();return}await Ne(C,async fe=>{await Fe({takeScreenshots:()=>S({progress:fe}),updateCellOutputs:_}),await Ga({filename:t,preset:m,downloadPDF:Bt})})},e[0]=t,e[1]=S,e[2]=_,e[3]=Y):Y=e[3];let A=Y,U;e[4]===A?U=e[5]:(U=async()=>{if(je){await A({preset:"document",title:"Downloading Document PDF..."});return}let d=new Event("export-beforeprint"),m=new Event("export-afterprint");window.dispatchEvent(d),setTimeout(ko,0),setTimeout(()=>window.dispatchEvent(m),0)},e[4]=A,e[5]=U);let $=U,K;e[6]!==se||e[7]!==t||e[8]!==S||e[9]!==_?(K=async()=>{if(!t){ae();return}await Ne("Downloading IPYNB...",async d=>{await Fe({takeScreenshots:()=>S({progress:d}),updateCellOutputs:_});let m=await se({download:!1});ke(new Blob([m],{type:"application/x-ipynb+json"}),ye.toIPYNB(document.title))})},e[6]=se,e[7]=t,e[8]=S,e[9]=_,e[10]=K):K=e[10];let ue=K,G;e[11]===Symbol.for("react.memo_cache_sentinel")?(G=(0,a.jsx)(Ot,{size:14,strokeWidth:1.5}),e[11]=G):G=e[11];let J;e[12]===Symbol.for("react.memo_cache_sentinel")?(J=(0,a.jsx)(Ie,{size:14,strokeWidth:1.5}),e[12]=J):J=e[12];let N;e[13]===t?N=e[14]:(N=async()=>{if(!t){ae();return}await Le({filename:t,includeCode:!0})},e[13]=t,e[14]=N);let Q;return e[15]!==y||e[16]!==w||e[17]!==ce||e[18]!==g||e[19]!==b||e[20]!==o||e[21]!==k||e[22]!==T||e[23]!==A||e[24]!==x||e[25]!==le||e[26]!==t||e[27]!==$||e[28]!==ue||e[29]!==de||e[30]!==c||e[31]!==me||e[32]!==i||e[33]!==n||e[34]!==ne||e[35]!==D||e[36]!==j||e[37]!==v||e[38]!==re||e[39]!==q||e[40]!==r||e[41]!==M||e[42]!==ie||e[43]!==pe||e[44]!==oe||e[45]!==B||e[46]!==V||e[47]!==F||e[48]!==N||e[49]!==s||e[50]!==O||e[51]!==f||e[52]!==he||e[53]!==u||e[54]!==l.mode?(Q=[{icon:G,label:"Download",handle:E,dropdown:[{icon:J,label:"Download as HTML",handle:N},{icon:(0,a.jsx)(Ie,{size:14,strokeWidth:1.5}),label:"Download as HTML (exclude code)",handle:async()=>{if(!t){ae();return}await Le({filename:t,includeCode:!1})}},{icon:(0,a.jsx)(Ma,{strokeWidth:1.5,style:{width:14,height:14}}),label:"Download as Markdown",handle:async()=>{let d=await le({download:!1});ke(new Blob([d],{type:"text/plain"}),ye.toMarkdown(document.title))}},{icon:(0,a.jsx)(Ta,{size:14,strokeWidth:1.5}),label:"Download as ipynb",handle:ue},{icon:(0,a.jsx)(Qt,{size:14,strokeWidth:1.5}),label:"Download Python code",handle:async()=>{let d=await D();ke(new Blob([d.contents],{type:"text/plain"}),ye.toPY(document.title))}},{divider:!0,icon:(0,a.jsx)(da,{size:14,strokeWidth:1.5}),label:"Download as PNG",disabled:l.mode!=="present",tooltip:l.mode==="present"?void 0:(0,a.jsxs)("span",{children:["Only available in app view. ",(0,a.jsx)("br",{}),"Toggle with: ",Wa("global.hideCode",!1)]}),handle:yo},me?{divider:!0,icon:(0,a.jsx)(Z,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:E,dropdown:[{icon:(0,a.jsx)(Z,{size:14,strokeWidth:1.5}),label:"Document Layout",handle:$},{icon:(0,a.jsx)(Z,{size:14,strokeWidth:1.5}),label:"Slides Layout",rightElement:ot(!0),hidden:!je,handle:async()=>{await A({preset:"slides",title:"Downloading Slides PDF..."})}}]}:{divider:!0,icon:(0,a.jsx)(Z,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:$}]},{icon:(0,a.jsx)(ma,{size:14,strokeWidth:1.5}),label:"Pair with an agent",hidden:X(),handle:async()=>{n((0,a.jsx)(Da,{onClose:o}))}},{icon:(0,a.jsx)(Ha,{size:14,strokeWidth:1.5}),label:"Share",handle:E,hidden:!B&&!F&&!V,dropdown:[{icon:(0,a.jsx)(oa,{size:14,strokeWidth:1.5}),label:"Publish HTML to web",hidden:!B,handle:async()=>{n((0,a.jsx)(qa,{onClose:o}))}},{icon:(0,a.jsx)(ca,{size:14,strokeWidth:1.5}),label:"Create WebAssembly link",hidden:!F,handle:async()=>{await ee(Oe({code:(await D()).contents})),W({title:"Copied",description:"Link copied to clipboard."})}},{icon:(0,a.jsx)(Be,{size:14,strokeWidth:1.5}),label:"Create molab notebook",hidden:!V,handle:async()=>{let d=Oe({code:(await D()).contents,baseUrl:`${z.molab}/new`});window.open(d,"_blank")}}]},{icon:(0,a.jsx)(La,{size:14,strokeWidth:1.5}),label:"Helper panel",redundant:!0,handle:E,dropdown:rt.flatMap(d=>{let m=d.type==="ai"&&!w;if(ht({panel:d,capabilities:g,aiEnabled:w})&&!m)return[];let{type:C,Icon:fe,additionalKeywords:nt}=d;return{label:Pe.startCase(C),rightElement:at(r===C),icon:(0,a.jsx)(fe,{size:14,strokeWidth:1.5}),handle:()=>{if(m){ne("ai","ai-features");return}s(C)},additionalKeywords:nt}})},{icon:(0,a.jsx)(Ke,{size:14,strokeWidth:1.5}),label:"Present as",handle:E,dropdown:[{icon:l.mode==="present"?(0,a.jsx)(ua,{size:14,strokeWidth:1.5}):(0,a.jsx)(Kt,{size:14,strokeWidth:1.5}),label:"Toggle app view",hotkey:"global.hideCode",handle:()=>{O()}},...Ve.map((d,m)=>{let C=Ze(d);return{divider:m===0,label:et(d),icon:(0,a.jsx)(C,{size:14,strokeWidth:1.5}),rightElement:(0,a.jsx)("div",{className:"w-8 flex justify-end",children:q===d&&(0,a.jsx)(He,{size:14})}),handle:()=>{pe(d),l.mode==="edit"&&O()}}})]},{icon:(0,a.jsx)(Ia,{size:14,strokeWidth:1.5}),label:"Duplicate notebook",hidden:!t||X(),handle:T},{icon:(0,a.jsx)(Ye,{size:14,strokeWidth:1.5}),label:"Copy code to clipboard",hidden:!t,handle:async()=>{await ee((await D()).contents),W({title:"Copied",description:"Code copied to clipboard."})}},{icon:(0,a.jsx)(Xt,{size:14,strokeWidth:1.5}),label:"Enable all cells",hidden:!de||i,handle:async()=>{let d=jt(_e());await re({configs:Se.fromEntries(d.map(bo))});for(let m of d)u({cellId:m,config:{disabled:!1}})}},{divider:!0,icon:(0,a.jsx)($e,{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)(Re,{onClose:o}))}},{icon:(0,a.jsx)(la,{size:14,strokeWidth:1.5}),label:"Add remote storage",handle:()=>{n((0,a.jsx)(Re,{defaultTab:"storage",onClose:o}))}},{icon:(0,a.jsx)(Ge,{size:14,strokeWidth:1.5}),label:he,hidden:!ce||i,handle:()=>{f()}},{icon:(0,a.jsx)(Ra,{size:14,strokeWidth:1.5}),label:"Restart kernel",variant:"danger",handle:j,additionalKeywords:["reset","reload","restart"]},{icon:(0,a.jsx)(Pa,{size:14,strokeWidth:1.5}),label:"Re-run all cells",redundant:!0,hotkey:"global.runAll",handle:async()=>{v()}},{icon:(0,a.jsx)(dt,{size:14,strokeWidth:1.5}),label:"Clear all outputs",redundant:!0,handle:()=>{b()}},{icon:(0,a.jsx)(ea,{size:14,strokeWidth:1.5}),label:"Hide all markdown code",handle:c,redundant:!0},{icon:(0,a.jsx)(Na,{size:14,strokeWidth:1.5}),label:"Collapse all sections",hotkey:"global.collapseAllSections",handle:k,redundant:!0},{icon:(0,a.jsx)(Aa,{size:14,strokeWidth:1.5}),label:"Expand all sections",hotkey:"global.expandAllSections",handle:x,redundant:!0},{divider:!0,icon:(0,a.jsx)(Ue,{size:14,strokeWidth:1.5}),label:"Command palette",hotkey:"global.commandPalette",handle:()=>M(fo)},{icon:(0,a.jsx)(Gt,{size:14,strokeWidth:1.5}),label:"Keyboard shortcuts",hotkey:"global.showHelp",handle:()=>ie(uo)},{icon:(0,a.jsx)(pa,{size:14,strokeWidth:1.5}),label:"User settings",handle:()=>oe(mo),redundant:!0,additionalKeywords:["preferences","options","configuration"]},{icon:(0,a.jsx)(ta,{size:14,strokeWidth:1.5}),label:"Resources",handle:E,dropdown:[{icon:(0,a.jsx)(ut,{size:14,strokeWidth:1.5}),label:"Documentation",handle:po},{icon:(0,a.jsx)(aa,{size:14,strokeWidth:1.5}),label:"GitHub",handle:ho},{icon:(0,a.jsx)(na,{size:14,strokeWidth:1.5}),label:"Discord Community",handle:co},{icon:(0,a.jsx)(sa,{size:14,strokeWidth:1.5}),label:"YouTube",handle:ro},{icon:(0,a.jsx)(Ct,{size:14,strokeWidth:1.5}),label:"Changelog",handle:lo}]},{divider:!0,icon:(0,a.jsx)(ra,{size:14,strokeWidth:1.5}),label:"Return home",hidden:!location.search.includes("file"),handle:so},{icon:(0,a.jsx)(Be,{size:14,strokeWidth:1.5}),label:"New notebook",hidden:!location.search.includes("file"),handle:io}].filter(no).map(ao),e[15]=y,e[16]=w,e[17]=ce,e[18]=g,e[19]=b,e[20]=o,e[21]=k,e[22]=T,e[23]=A,e[24]=x,e[25]=le,e[26]=t,e[27]=$,e[28]=ue,e[29]=de,e[30]=c,e[31]=me,e[32]=i,e[33]=n,e[34]=ne,e[35]=D,e[36]=j,e[37]=v,e[38]=re,e[39]=q,e[40]=r,e[41]=M,e[42]=ie,e[43]=pe,e[44]=oe,e[45]=B,e[46]=V,e[47]=F,e[48]=N,e[49]=s,e[50]=O,e[51]=f,e[52]=he,e[53]=u,e[54]=l.mode,e[55]=Q):Q=e[55],Q}function ao(e){return e.dropdown?{...e,dropdown:e.dropdown.filter(oo)}:e}function oo(e){return!e.hidden}function no(e){return!e.hidden}function io(){let e=ya();window.open(e,"_blank")}function so(){let e=document.baseURI.split("?")[0];window.open(e,"_self")}function lo(){window.open(z.releasesPage,"_blank")}function ro(){window.open(z.youtube,"_blank")}function co(){window.open(z.discordLink,"_blank")}function ho(){window.open(z.githubPage,"_blank")}function po(){window.open(z.docsPage,"_blank")}function mo(e){return!e}function uo(e){return!e}function fo(e){return!e}function bo(e){return[e,{disabled:!1}]}async function yo(){let e=document.getElementById("App");e&&await Ft({element:e,filename:document.title,prepare:Vt})}function ko(){return window.print()}function xo(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 wo(e){return(0,a.jsx)("div",{className:"w-8 flex justify-end",children:e&&(0,a.jsx)(He,{size:14})})}function ae(){W({title:"Error",description:"Notebooks must be named to be exported.",variant:"danger"})}export{Qe as a,Ue as c,Xe as i,Ye as l,tt as n,Ge as o,Ua as r,$e as s,to as t};
1
+ import{s as We}from"./chunk-LvLJmgfZ.js";import{d as L,l as it,p as st,u as P}from"./useEvent-D91BmmQi.js";import{t as lt}from"./react-Bj1aDYRI.js";import{An as rt,Cr as dt,D as Me,E as ct,Mn as ht,Nn as pt,On as mt,Or as ut,Qt as ft,Tn as bt,Ui as be,_ as yt,br as kt,ct as xt,dt as De,h as _e,kn as wt,lt as gt,ni as jt,t as vt,vr as Ct}from"./cells-a44D37GV.js";import{t as I}from"./compiler-runtime-B3qBwwSJ.js";import{n as zt,r as Wt,x as Mt}from"./ai-model-dropdown-BUVX-tXn.js";import{_ as H,d as Se}from"./useEventListener-BfYriKqt.js";import{r as Dt,x as _t}from"./utils-BGFUZat2.js";import{n as z,t as Ae}from"./constants-B9JJ72XE.js";import{T as X,v as St,w as At}from"./config-Fh_0wwfW.js";import{t as Nt}from"./jsx-runtime-PbYoItBR.js";import{o as Pt}from"./alert-dialog-V2tySmFn.js";import{a as It,c as Et,i as Tt,n as Lt,r as Ht,s as Rt,t as qt}from"./select-sS-2VQvj.js";import{Nt as Ot}from"./JsonOutput-BP1BF3ok.js";import{c as Ne,d as ye,n as Bt,o as Ft,r as ke,t as Vt}from"./download-YFYBUFlh.js";import{t as Yt}from"./tooltip-CWSr2PfE.js";import{r as Ut,t as xe}from"./button-Db07tdz7.js";import{i as $t,t as Pe}from"./strings-B-yaq2o7.js";import{r as R}from"./requests-KshNNAOp.js";import{t as h}from"./createLucideIcon-BTp1tQDO.js";import{F as Kt,I as Gt,L as Ie,P as Jt,R as Qt,a as Ee,i as Te,u as Le}from"./layout-B093uDWH.js";import{t as He}from"./check-DQmqoJgr.js";import{r as Xt}from"./useCellActionButton-B8YCBRJi.js";import{t as Zt}from"./copy-CFO636Td.js";import{t as ea}from"./eye-off-6RDlHoCz.js";import{t as ta}from"./external-link-mfK38Tpg.js";import{t as Z}from"./file-ZPWSptQF.js";import{t as aa}from"./github-BZsqHbeC.js";import{u as oa}from"./form-b6jUTUMx.js";import{n as na,r as ia,t as sa}from"./youtube-DER9xpF0.js";import{i as la,n as Re}from"./add-connection-dialog-B60ibI0N.js";import{t as ra}from"./house-DTijHETb.js";import{t as da}from"./image-CzV694oU.js";import{t as ca}from"./link-D215MpkN.js";import{r as ha}from"./input-DiAad2nt.js";import{t as pa}from"./settings-CP-IXCzQ.js";import{t as ma}from"./sparkles-DctOjjEz.js";import{y as ua}from"./textarea-D1Q7dFo2.js";import{t as fa}from"./square-DPWHdF_-.js";import{t as W}from"./use-toast-BH8bU9Xf.js";import{n as qe,t as ba}from"./paths-kNeJ8nbe.js";import{o as ya}from"./session-DF0gSADo.js";import{n as ee}from"./copy-DlC1PYY-.js";import{r as ka}from"./useRunCells-BRYGWDtj.js";import{a as xa,c as wa,i as ga,n as ja,r as va}from"./dialog-CNmqslzW.js";import{n as we}from"./ImperativeModal-CEtvKaPt.js";import{r as Ca,t as Oe}from"./share-CDUcBp99.js";import{a as za}from"./cell-link-Bia8_3oN.js";import{a as Wa}from"./renderShortcut-BV7Qf4L2.js";import{t as Ma}from"./icons-D3YFXNmD.js";import{t as Da}from"./pair-with-agent-modal-DHxMYnfm.js";import{n as Be}from"./marimo-icons-D6kVaIsS.js";import{t as _a}from"./links-DYp0FOur.js";import{r as Sa,t as Fe}from"./hooks-CY4KeAYS.js";import{t as Ve}from"./types-DZmRsGZN.js";var Aa=h("circle-chevron-down",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]]),Na=h("circle-chevron-right",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m10 8 4 4-4 4",key:"1wy4r4"}]]),Ye=h("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"}]]),Ue=h("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"}]]),$e=h("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"}]]),Pa=h("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"}]]),Ia=h("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"}]]),Ea=h("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"}]]),Ta=h("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"}]]),La=h("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Ke=h("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"}]]),Ha=h("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"}]]),Ra=h("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"}]]),Ge=h("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"}]]),Je=I(),ge=We(lt(),1),a=We(Nt(),1),te="https://static.marimo.app";const qa=e=>{let t=(0,Je.c)(25),{onClose:n}=e,[o,s]=(0,ge.useState)(""),{exportAsHTML:r}=R(),l=`${o}-${Math.random().toString(36).slice(2,6)}`,i=`${te}/static/${l}`,c;t[0]!==r||t[1]!==n||t[2]!==l?(c=async v=>{v.preventDefault(),n();let T=await r({download:!1,includeCode:!0,files:Jt.INSTANCE.filenames()}),M=W({title:"Uploading static notebook...",description:"Please wait."});await fetch(`${te}/api/static`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:T,path:l})}).catch(()=>{M.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:z.issuesPage,target:"_blank",className:"underline",children:"GitHub"}),"."]})})}),M.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]=r,t[1]=n,t[2]=l,t[3]=c):c=t[3];let p;t[4]===Symbol.for("react.memo_cache_sentinel")?(p=(0,a.jsx)(wa,{children:"Share static notebook"}),t[4]=p):p=t[4];let g;t[5]===Symbol.for("react.memo_cache_sentinel")?(g=(0,a.jsxs)(xa,{children:[p,(0,a.jsxs)(va,{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:te,target:"_blank",children:te}),"."]})]}),t[5]=g):g=t[5];let w;t[6]===Symbol.for("react.memo_cache_sentinel")?(w=v=>{s(v.target.value.toLowerCase().replaceAll(/\s/g,"-").replaceAll(/[^\da-z-]/g,""))},t[6]=w):w=t[6];let u;t[7]===o?u=t[8]:(u=(0,a.jsx)(ha,{"data-testid":"slug-input",id:"slug",autoFocus:!0,value:o,placeholder:"Notebook slug",onChange:w,required:!0,autoComplete:"off"}),t[7]=o,t[8]=u);let f;t[9]===i?f=t[10]:(f=(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)(Oa,{text:i}),(0,a.jsx)("span",{className:"text-primary",children:i})]})]}),t[9]=i,t[10]=f);let b;t[11]!==u||t[12]!==f?(b=(0,a.jsxs)("div",{className:"flex flex-col gap-6 py-4",children:[u,f]}),t[11]=u,t[12]=f,t[13]=b):b=t[13];let y;t[14]===n?y=t[15]:(y=(0,a.jsx)(xe,{"data-testid":"cancel-share-static-notebook-button",variant:"secondary",onClick:n,children:"Cancel"}),t[14]=n,t[15]=y);let k;t[16]===i?k=t[17]:(k=(0,a.jsx)(xe,{"data-testid":"share-static-notebook-button","aria-label":"Save",variant:"default",type:"submit",onClick:async()=>{await ee(i)},children:"Create"}),t[16]=i,t[17]=k);let x;t[18]!==y||t[19]!==k?(x=(0,a.jsxs)(ga,{children:[y,k]}),t[18]=y,t[19]=k,t[20]=x):x=t[20];let j;return t[21]!==c||t[22]!==x||t[23]!==b?(j=(0,a.jsx)(ja,{className:"w-fit",children:(0,a.jsxs)("form",{onSubmit:c,children:[g,b,x]})}),t[21]=c,t[22]=x,t[23]=b,t[24]=j):j=t[24],j};var Oa=e=>{let t=(0,Je.c)(8),[n,o]=ge.useState(!1),s;t[0]===e.text?s=t[1]:(s=Ut.stopPropagation(async p=>{p.preventDefault(),await ee(e.text),o(!0),setTimeout(()=>o(!1),2e3)}),t[0]=e.text,t[1]=s);let r=s,l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=(0,a.jsx)(Zt,{size:14,strokeWidth:1.5}),t[2]=l):l=t[2];let i;t[3]===r?i=t[4]:(i=(0,a.jsx)(xe,{"data-testid":"copy-static-notebook-url-button",onClick:r,size:"xs",variant:"secondary",children:l}),t[3]=r,t[4]=i);let c;return t[5]!==n||t[6]!==i?(c=(0,a.jsx)(Yt,{content:"Copied!",open:n,children:i}),t[5]=n,t[6]=i,t[7]=c):c=t[7],c},Ba=I();function Fa(){let e=document.getElementsByClassName(Ae.outputArea);for(let t of e){let n=t.getBoundingClientRect();if(n.bottom>0&&n.top<window.innerHeight){let o=be.findElement(t);if(!o){H.warn("Could not find HTMLCellId for visible output area",t);continue}return{cellId:be.parse(o.id)}}}return H.warn("No visible output area found for scroll anchor"),null}function Va(e){if(!e){H.warn("No scroll anchor provided to restore scroll position");return}let t=document.getElementById(be.create(e.cellId));if(!t){H.warn("Could not find cell element to restore scroll position",e.cellId);return}if(!t.querySelector(`.${Ae.outputArea}`)){H.warn("Could not find output area to restore scroll position",e.cellId);return}t.scrollIntoView({block:"start",behavior:"auto"})}function Qe(){let e=(0,Ba.c)(2),t=L(De),n;return e[0]===t?n=e[1]:(n=()=>{let o=Fa();t(s=>({mode:gt(s.mode),cellAnchor:(o==null?void 0:o.cellId)??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Va(o)})})},e[0]=t,e[1]=n),n}const Xe=st(!1);var Ya=I();const Ua=()=>{let e=(0,Ya.c)(7),{selectedLayout:t}=Ee(),{setLayoutView:n}=Te();if(X()&&!pt("wasm_layouts"))return null;let o;e[0]===n?o=e[1]:(o=i=>n(i),e[0]=n,e[1]=o);let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,a.jsx)(Rt,{className:"min-w-[110px] border-border bg-background","data-testid":"layout-select",children:(0,a.jsx)(Et,{placeholder:"Select a view"})}),e[2]=s):s=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsx)(Lt,{children:(0,a.jsxs)(Ht,{children:[(0,a.jsx)(It,{children:"View as"}),Ve.map(Ka)]})}),e[3]=r):r=e[3];let l;return e[4]!==t||e[5]!==o?(l=(0,a.jsxs)(qt,{"data-testid":"layout-select",value:t,onValueChange:o,children:[s,r]}),e[4]=t,e[5]=o,e[6]=l):l=e[6],l};function $a(e){return(0,a.jsx)(Ze(e),{className:"h-4 w-4"})}function Ze(e){switch(e){case"vertical":return Ea;case"grid":return ia;case"slides":return Ke;default:return $t(e),fa}}function et(e){return Pe.startCase(e)}function Ka(e){return(0,a.jsx)(Tt,{value:e,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 leading-5",children:[$a(e),(0,a.jsx)("span",{children:et(e)})]})},e)}async function Ga(e){let{filename:t,preset:n,downloadPDF:o}=e;await o({filename:t,webpdf:!1,preset:n,includeInputs:!0,rasterServer:"static"})}var Ja=I();function Qa(e){let t=(0,Ja.c)(5),{openPrompt:n,closeModal:o}=we(),{sendCopy:s}=R(),r;return t[0]!==o||t[1]!==n||t[2]!==s||t[3]!==e?(r=()=>{if(!e)return null;let l=ba.guessDeliminator(e);n({title:"Copy notebook",description:"Enter a new filename for the notebook copy.",defaultValue:`_${qe.basename(e)}`,confirmText:"Copy notebook",spellCheck:!1,onConfirm:i=>{let c=l.join(qe.dirname(e),i);s({source:e,destination:c}).then(()=>{o(),W({title:"Notebook copied",description:"A copy of the notebook has been created."}),_a(c)})}})},t[0]=o,t[1]=n,t[2]=s,t[3]=e,t[4]=r):r=t[4],r}const Xa=()=>{let{updateCellConfig:e}=Me(),{saveCellConfig:t}=R();return(0,ge.useCallback)(async()=>{let n=new ft,o=_e(),s=o.cellIds.inOrderIds,r={};for(let i of s){if(o.cellData[i]===void 0)continue;let{code:c,config:p}=o.cellData[i];p.hide_code||n.isSupported(c)&&(r[i]={hide_code:!0})}let l=Se.entries(r);if(l.length!==0){await t({configs:r});for(let[i,c]of l)e({cellId:i,config:c})}},[e])};var Za=I();function tt(){let e=(0,Za.c)(4),{openConfirm:t}=we(),n=L(St),{sendRestart:o}=R(),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)(Pt,{onClick:async()=>{n({state:At.CLOSING}),await o(),Ca()},"aria-label":"Confirm Restart",children:"Restart"})})},e[0]=t,e[1]=o,e[2]=n,e[3]=s):s=e[3],s}var eo=I(),E=e=>{e==null||e.preventDefault(),e==null||e.stopPropagation()};function to(){var ve,Ce,ze;let e=(0,eo.c)(56),t=za(),{openModal:n,closeModal:o}=we(),{toggleApplication:s}=mt(),{selectedPanel:r}=wt(),[l]=it(De),i=P(xt),c=Xa(),[p]=_t(),g=P(bt),w=P(Dt),{updateCellConfig:u,undoDeleteCell:f,clearAllCellOutputs:b,addSetupCellIfDoesntExist:y,collapseAllCells:k,expandAllCells:x}=Me(),j=tt(),v=ka(),T=Qa(t),M=L(Xe),oe=L(zt),{handleClick:ne}=Wt(),ie=L(Mt),{exportAsIPYNB:se,exportAsMarkdown:le,readCode:D,saveCellConfig:re,updateCellOutputs:_}=R(),S=Sa(),de=P(yt),ce=P(vt),he=P(ct),{selectedLayout:q}=Ee(),{setLayoutView:pe}=Te(),O=Qe(),B=((ve=p.sharing)==null?void 0:ve.html)??!0,F=((Ce=p.sharing)==null?void 0:Ce.wasm)??!0,V=((ze=p.sharing)==null?void 0:ze.molab)??!0,je=!X(),me=q==="slides",at=wo,ot=xo,Y;e[0]!==t||e[1]!==S||e[2]!==_?(Y=async d=>{let{preset:m,title:C}=d;if(!t){ae();return}await Ne(C,async fe=>{await Fe({takeScreenshots:()=>S({progress:fe}),updateCellOutputs:_}),await Ga({filename:t,preset:m,downloadPDF:Bt})})},e[0]=t,e[1]=S,e[2]=_,e[3]=Y):Y=e[3];let A=Y,U;e[4]===A?U=e[5]:(U=async()=>{if(je){await A({preset:"document",title:"Downloading Document PDF..."});return}let d=new Event("export-beforeprint"),m=new Event("export-afterprint");window.dispatchEvent(d),setTimeout(ko,0),setTimeout(()=>window.dispatchEvent(m),0)},e[4]=A,e[5]=U);let $=U,K;e[6]!==se||e[7]!==t||e[8]!==S||e[9]!==_?(K=async()=>{if(!t){ae();return}await Ne("Downloading IPYNB...",async d=>{await Fe({takeScreenshots:()=>S({progress:d}),updateCellOutputs:_});let m=await se({download:!1});ke(new Blob([m],{type:"application/x-ipynb+json"}),ye.toIPYNB(document.title))})},e[6]=se,e[7]=t,e[8]=S,e[9]=_,e[10]=K):K=e[10];let ue=K,G;e[11]===Symbol.for("react.memo_cache_sentinel")?(G=(0,a.jsx)(Ot,{size:14,strokeWidth:1.5}),e[11]=G):G=e[11];let J;e[12]===Symbol.for("react.memo_cache_sentinel")?(J=(0,a.jsx)(Ie,{size:14,strokeWidth:1.5}),e[12]=J):J=e[12];let N;e[13]===t?N=e[14]:(N=async()=>{if(!t){ae();return}await Le({filename:t,includeCode:!0})},e[13]=t,e[14]=N);let Q;return e[15]!==y||e[16]!==w||e[17]!==ce||e[18]!==g||e[19]!==b||e[20]!==o||e[21]!==k||e[22]!==T||e[23]!==A||e[24]!==x||e[25]!==le||e[26]!==t||e[27]!==$||e[28]!==ue||e[29]!==de||e[30]!==c||e[31]!==me||e[32]!==i||e[33]!==n||e[34]!==ne||e[35]!==D||e[36]!==j||e[37]!==v||e[38]!==re||e[39]!==q||e[40]!==r||e[41]!==M||e[42]!==ie||e[43]!==pe||e[44]!==oe||e[45]!==B||e[46]!==V||e[47]!==F||e[48]!==N||e[49]!==s||e[50]!==O||e[51]!==f||e[52]!==he||e[53]!==u||e[54]!==l.mode?(Q=[{icon:G,label:"Download",handle:E,dropdown:[{icon:J,label:"Download as HTML",handle:N},{icon:(0,a.jsx)(Ie,{size:14,strokeWidth:1.5}),label:"Download as HTML (exclude code)",handle:async()=>{if(!t){ae();return}await Le({filename:t,includeCode:!1})}},{icon:(0,a.jsx)(Ma,{strokeWidth:1.5,style:{width:14,height:14}}),label:"Download as Markdown",handle:async()=>{let d=await le({download:!1});ke(new Blob([d],{type:"text/plain"}),ye.toMarkdown(document.title))}},{icon:(0,a.jsx)(Ta,{size:14,strokeWidth:1.5}),label:"Download as ipynb",handle:ue},{icon:(0,a.jsx)(Qt,{size:14,strokeWidth:1.5}),label:"Download Python code",handle:async()=>{let d=await D();ke(new Blob([d.contents],{type:"text/plain"}),ye.toPY(document.title))}},{divider:!0,icon:(0,a.jsx)(da,{size:14,strokeWidth:1.5}),label:"Download as PNG",disabled:l.mode!=="present",tooltip:l.mode==="present"?void 0:(0,a.jsxs)("span",{children:["Only available in app view. ",(0,a.jsx)("br",{}),"Toggle with: ",Wa("global.hideCode",!1)]}),handle:yo},me?{divider:!0,icon:(0,a.jsx)(Z,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:E,dropdown:[{icon:(0,a.jsx)(Z,{size:14,strokeWidth:1.5}),label:"Document Layout",handle:$},{icon:(0,a.jsx)(Z,{size:14,strokeWidth:1.5}),label:"Slides Layout",rightElement:ot(!0),hidden:!je,handle:async()=>{await A({preset:"slides",title:"Downloading Slides PDF..."})}}]}:{divider:!0,icon:(0,a.jsx)(Z,{size:14,strokeWidth:1.5}),label:"Download as PDF",handle:$}]},{icon:(0,a.jsx)(ma,{size:14,strokeWidth:1.5}),label:"Pair with an agent",hidden:X(),handle:async()=>{n((0,a.jsx)(Da,{onClose:o}))}},{icon:(0,a.jsx)(Ha,{size:14,strokeWidth:1.5}),label:"Share",handle:E,hidden:!B&&!F&&!V,dropdown:[{icon:(0,a.jsx)(oa,{size:14,strokeWidth:1.5}),label:"Publish HTML to web",hidden:!B,handle:async()=>{n((0,a.jsx)(qa,{onClose:o}))}},{icon:(0,a.jsx)(ca,{size:14,strokeWidth:1.5}),label:"Create WebAssembly link",hidden:!F,handle:async()=>{await ee(Oe({code:(await D()).contents})),W({title:"Copied",description:"Link copied to clipboard."})}},{icon:(0,a.jsx)(Be,{size:14,strokeWidth:1.5}),label:"Create molab notebook",hidden:!V,handle:async()=>{let d=Oe({code:(await D()).contents,baseUrl:`${z.molab}/new`});window.open(d,"_blank")}}]},{icon:(0,a.jsx)(La,{size:14,strokeWidth:1.5}),label:"Helper panel",redundant:!0,handle:E,dropdown:rt.flatMap(d=>{let m=d.type==="ai"&&!w;if(ht({panel:d,capabilities:g,aiEnabled:w})&&!m)return[];let{type:C,Icon:fe,additionalKeywords:nt}=d;return{label:Pe.startCase(C),rightElement:at(r===C),icon:(0,a.jsx)(fe,{size:14,strokeWidth:1.5}),handle:()=>{if(m){ne("ai","ai-features");return}s(C)},additionalKeywords:nt}})},{icon:(0,a.jsx)(Ke,{size:14,strokeWidth:1.5}),label:"Present as",handle:E,dropdown:[{icon:l.mode==="present"?(0,a.jsx)(ua,{size:14,strokeWidth:1.5}):(0,a.jsx)(Kt,{size:14,strokeWidth:1.5}),label:"Toggle app view",hotkey:"global.hideCode",handle:()=>{O()}},...Ve.map((d,m)=>{let C=Ze(d);return{divider:m===0,label:et(d),icon:(0,a.jsx)(C,{size:14,strokeWidth:1.5}),rightElement:(0,a.jsx)("div",{className:"w-8 flex justify-end",children:q===d&&(0,a.jsx)(He,{size:14})}),handle:()=>{pe(d),l.mode==="edit"&&O()}}})]},{icon:(0,a.jsx)(Ia,{size:14,strokeWidth:1.5}),label:"Duplicate notebook",hidden:!t||X(),handle:T},{icon:(0,a.jsx)(Ye,{size:14,strokeWidth:1.5}),label:"Copy code to clipboard",hidden:!t,handle:async()=>{await ee((await D()).contents),W({title:"Copied",description:"Code copied to clipboard."})}},{icon:(0,a.jsx)(Xt,{size:14,strokeWidth:1.5}),label:"Enable all cells",hidden:!de||i,handle:async()=>{let d=jt(_e());await re({configs:Se.fromEntries(d.map(bo))});for(let m of d)u({cellId:m,config:{disabled:!1}})}},{divider:!0,icon:(0,a.jsx)($e,{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)(Re,{onClose:o}))}},{icon:(0,a.jsx)(la,{size:14,strokeWidth:1.5}),label:"Add remote storage",handle:()=>{n((0,a.jsx)(Re,{defaultTab:"storage",onClose:o}))}},{icon:(0,a.jsx)(Ge,{size:14,strokeWidth:1.5}),label:he,hidden:!ce||i,handle:()=>{f()}},{icon:(0,a.jsx)(Ra,{size:14,strokeWidth:1.5}),label:"Restart kernel",variant:"danger",handle:j,additionalKeywords:["reset","reload","restart"]},{icon:(0,a.jsx)(Pa,{size:14,strokeWidth:1.5}),label:"Re-run all cells",redundant:!0,hotkey:"global.runAll",handle:async()=>{v()}},{icon:(0,a.jsx)(dt,{size:14,strokeWidth:1.5}),label:"Clear all outputs",redundant:!0,handle:()=>{b()}},{icon:(0,a.jsx)(ea,{size:14,strokeWidth:1.5}),label:"Hide all markdown code",handle:c,redundant:!0},{icon:(0,a.jsx)(Na,{size:14,strokeWidth:1.5}),label:"Collapse all sections",hotkey:"global.collapseAllSections",handle:k,redundant:!0},{icon:(0,a.jsx)(Aa,{size:14,strokeWidth:1.5}),label:"Expand all sections",hotkey:"global.expandAllSections",handle:x,redundant:!0},{divider:!0,icon:(0,a.jsx)(Ue,{size:14,strokeWidth:1.5}),label:"Command palette",hotkey:"global.commandPalette",handle:()=>M(fo)},{icon:(0,a.jsx)(Gt,{size:14,strokeWidth:1.5}),label:"Keyboard shortcuts",hotkey:"global.showHelp",handle:()=>ie(uo)},{icon:(0,a.jsx)(pa,{size:14,strokeWidth:1.5}),label:"User settings",handle:()=>oe(mo),redundant:!0,additionalKeywords:["preferences","options","configuration"]},{icon:(0,a.jsx)(ta,{size:14,strokeWidth:1.5}),label:"Resources",handle:E,dropdown:[{icon:(0,a.jsx)(ut,{size:14,strokeWidth:1.5}),label:"Documentation",handle:po},{icon:(0,a.jsx)(aa,{size:14,strokeWidth:1.5}),label:"GitHub",handle:ho},{icon:(0,a.jsx)(na,{size:14,strokeWidth:1.5}),label:"Discord Community",handle:co},{icon:(0,a.jsx)(sa,{size:14,strokeWidth:1.5}),label:"YouTube",handle:ro},{icon:(0,a.jsx)(Ct,{size:14,strokeWidth:1.5}),label:"Changelog",handle:lo}]},{divider:!0,icon:(0,a.jsx)(ra,{size:14,strokeWidth:1.5}),label:"Return home",hidden:!location.search.includes("file"),handle:so},{icon:(0,a.jsx)(Be,{size:14,strokeWidth:1.5}),label:"New notebook",hidden:!location.search.includes("file"),handle:io}].filter(no).map(ao),e[15]=y,e[16]=w,e[17]=ce,e[18]=g,e[19]=b,e[20]=o,e[21]=k,e[22]=T,e[23]=A,e[24]=x,e[25]=le,e[26]=t,e[27]=$,e[28]=ue,e[29]=de,e[30]=c,e[31]=me,e[32]=i,e[33]=n,e[34]=ne,e[35]=D,e[36]=j,e[37]=v,e[38]=re,e[39]=q,e[40]=r,e[41]=M,e[42]=ie,e[43]=pe,e[44]=oe,e[45]=B,e[46]=V,e[47]=F,e[48]=N,e[49]=s,e[50]=O,e[51]=f,e[52]=he,e[53]=u,e[54]=l.mode,e[55]=Q):Q=e[55],Q}function ao(e){return e.dropdown?{...e,dropdown:e.dropdown.filter(oo)}:e}function oo(e){return!e.hidden}function no(e){return!e.hidden}function io(){let e=ya();window.open(e,"_blank")}function so(){let e=document.baseURI.split("?")[0];window.open(e,"_self")}function lo(){window.open(z.releasesPage,"_blank")}function ro(){window.open(z.youtube,"_blank")}function co(){window.open(z.discordLink,"_blank")}function ho(){window.open(z.githubPage,"_blank")}function po(){window.open(z.docsPage,"_blank")}function mo(e){return!e}function uo(e){return!e}function fo(e){return!e}function bo(e){return[e,{disabled:!1}]}async function yo(){let e=document.getElementById("App");e&&await Ft({element:e,filename:document.title,prepare:Vt})}function ko(){return window.print()}function xo(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 wo(e){return(0,a.jsx)("div",{className:"w-8 flex justify-end",children:e&&(0,a.jsx)(He,{size:14})})}function ae(){W({title:"Error",description:"Notebooks must be named to be exported.",variant:"danger"})}export{Qe as a,Ue as c,Xe as i,Ye as l,tt as n,Ge as o,Ua as r,$e as s,to 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-CWJFLSxG.js"></script>
69
+ <script type="module" crossorigin src="./assets/index-CjSc3ZEy.js"></script>
70
70
  <link rel="modulepreload" crossorigin href="./assets/preload-helper-y72bE5iF.js">
71
71
  <link rel="modulepreload" crossorigin href="./assets/chunk-LvLJmgfZ.js">
72
72
  <link rel="modulepreload" crossorigin href="./assets/react-Bj1aDYRI.js">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/frontend",
3
- "version": "0.23.11-dev18",
3
+ "version": "0.23.11-dev19",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -103,6 +103,11 @@ interface CustomProviderConfig {
103
103
  base_url?: string;
104
104
  }
105
105
 
106
+ const SUPPORTED_PROVIDERS_UI = new Set(KNOWN_PROVIDERS);
107
+ // We use deepseek as an example of a custom provider in our docs, so we don't show it in the UI.
108
+ // Else, we would need to wire up the UI and config for it. Consider if many users request.
109
+ SUPPORTED_PROVIDERS_UI.delete("deepseek");
110
+
106
111
  export const AiProviderTitle: React.FC<AiProviderTitleProps> = ({
107
112
  provider,
108
113
  children,
@@ -622,7 +627,7 @@ export const CustomProvidersConfig: React.FC<AiConfigProps> = ({
622
627
  const normalizedName = newProviderName.toLowerCase().replaceAll(/\s+/g, "_");
623
628
  const customProviders = form.watch("ai.custom_providers");
624
629
  const isDuplicate =
625
- KNOWN_PROVIDERS.includes(normalizedName as KnownProviderId) ||
630
+ SUPPORTED_PROVIDERS_UI.has(normalizedName as KnownProviderId) ||
626
631
  (customProviders && Object.keys(customProviders).includes(normalizedName));
627
632
  const hasInvalidChars = normalizedName.includes(".");
628
633