@marimo-team/frontend 0.23.4-dev0 → 0.23.4-dev10

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 (89) hide show
  1. package/dist/assets/{CellStatus-BTL_sgUY.js → CellStatus-PIeZtHEl.js} +1 -1
  2. package/dist/assets/JsonOutput-D5TiQGJ4.js +49 -0
  3. package/dist/assets/{MarimoErrorOutput-BBD405a6.js → MarimoErrorOutput-B9_RO5eX.js} +2 -2
  4. package/dist/assets/{RenderHTML-BT9obKLc.js → RenderHTML-DR6lqJGS.js} +1 -1
  5. package/dist/assets/{add-cell-with-ai-qEfAzC8R.js → add-cell-with-ai-DjfY8mF1.js} +9 -9
  6. package/dist/assets/{add-connection-dialog-HCShSlr3.js → add-connection-dialog-Dg6K--Uw.js} +2 -2
  7. package/dist/assets/{agent-panel-CoBHxHpJ.js → agent-panel-oPuvVsjs.js} +3 -3
  8. package/dist/assets/{ai-model-dropdown-CYx9ZfdS.js → ai-model-dropdown-By4Ohb0R.js} +3 -3
  9. package/dist/assets/{app-config-button-DC5UlXZA.js → app-config-button-YS8lpoUa.js} +1 -1
  10. package/dist/assets/{cell-editor-BMjfXh0J.js → cell-editor-CdyZleud.js} +11 -11
  11. package/dist/assets/{cell-link-BA7Demf0.js → cell-link-d38hFEon.js} +1 -1
  12. package/dist/assets/{cells-CJlo_hG2.js → cells-A-ljPpuj.js} +55 -55
  13. package/dist/assets/{chat-display-DbztpRD4.js → chat-display-Be0U92hE.js} +1 -1
  14. package/dist/assets/{chat-panel-H-xFzATI.js → chat-panel-BEz970S3.js} +1 -1
  15. package/dist/assets/{chat-ui-CFqAy2ck.js → chat-ui-CdW7awFa.js} +1 -1
  16. package/dist/assets/{column-preview-DzN2QumC.js → column-preview-B1KZjh-X.js} +1 -1
  17. package/dist/assets/command-CXDOCJwp.js +1 -0
  18. package/dist/assets/{command-palette-DSSR50KF.js → command-palette-C7AbtCWz.js} +1 -1
  19. package/dist/assets/{common-CquNY-ok.js → common-DC9LEIym.js} +1 -1
  20. package/dist/assets/{components-BXKuiPiF.js → components-BDnRtsA5.js} +1 -1
  21. package/dist/assets/{components-BiBOcq1x.js → components-FepcpFGL.js} +1 -1
  22. package/dist/assets/{datasource-BKDU-4D5.js → datasource-BCnGIjqn.js} +2 -2
  23. package/dist/assets/{dependency-graph-panel-ayo-Mm2j.js → dependency-graph-panel-k1WQZ4m-.js} +1 -1
  24. package/dist/assets/{documentation-panel-ph6755dz.js → documentation-panel-BMrGuByB.js} +1 -1
  25. package/dist/assets/{download-mzsKQgiy.js → download-Iyng0xCz.js} +4 -4
  26. package/dist/assets/{edit-page-Bxa5DWoE.js → edit-page-CbGDoOay.js} +6 -6
  27. package/dist/assets/{error-panel-BfG_JeMA.js → error-panel-CHSsnRFF.js} +1 -1
  28. package/dist/assets/{file-explorer-panel-D7-d0Puf.js → file-explorer-panel-Cjlf3QNa.js} +3 -3
  29. package/dist/assets/{file-icons-BNrh8MRG.js → file-icons-DTNZv05h.js} +1 -1
  30. package/dist/assets/{floating-outline-BMB4_phA.js → floating-outline-CSNGDMAm.js} +1 -1
  31. package/dist/assets/{focus-BX3gXJxx.js → focus-Baz7rlo0.js} +1 -1
  32. package/dist/assets/form-D1abghOq.js +2 -0
  33. package/dist/assets/{home-page-B1ELDhn8.js → home-page-QvO22-4u.js} +1 -1
  34. package/dist/assets/{hooks-b3J1eFE-.js → hooks-4gSLiehn.js} +1 -1
  35. package/dist/assets/{html-to-image-Cz8lDF-Y.js → html-to-image-tbPEMBJg.js} +1 -1
  36. package/dist/assets/index-DH5UUBE4.css +2 -0
  37. package/dist/assets/{index-BjiE1T38.js → index-rjcv10Dv.js} +8 -8
  38. package/dist/assets/{kiosk-mode-Dxbs5i5g.js → kiosk-mode-cWTXpegb.js} +1 -1
  39. package/dist/assets/{layout-lxwMDUgI.js → layout-C4u-1iTo.js} +5 -5
  40. package/dist/assets/{logs-panel-BW6S5AI1.js → logs-panel-Dgkr6V7q.js} +1 -1
  41. package/dist/assets/loro_wasm_bg-Bu4Ofw1K.js +2 -0
  42. package/dist/assets/{loro_wasm_bg-DXuHQ2hl.js → loro_wasm_bg-DWJCS9pK.js} +1 -1
  43. package/dist/assets/{markdown-renderer-CeHY2KoQ.js → markdown-renderer-CFrgiLqu.js} +1 -1
  44. package/dist/assets/{name-cell-input-B1BCybeo.js → name-cell-input-C5LXTI3T.js} +1 -1
  45. package/dist/assets/{outline-panel-DgMz83Mx.js → outline-panel-0lyts6z4.js} +1 -1
  46. package/dist/assets/{packages-panel-CbjavFh2.js → packages-panel-BhI1lbfw.js} +1 -1
  47. package/dist/assets/{panels-BPzk3EbR.js → panels-CpvbcuTn.js} +1 -1
  48. package/dist/assets/{process-output-CggRIZ6s.js → process-output-BwZ5VxXO.js} +1 -1
  49. package/dist/assets/{readonly-python-code-Ccd8HM-7.js → readonly-python-code-B0nrQE3U.js} +1 -1
  50. package/dist/assets/{reveal-component-BamXsTkr.js → reveal-component-C2X5QJAC.js} +1 -1
  51. package/dist/assets/{run-page-C5cZvltI.js → run-page-BYdI3kiE.js} +1 -1
  52. package/dist/assets/{scratchpad-panel-PMFH4Ktp.js → scratchpad-panel-BP6-rZV6.js} +1 -1
  53. package/dist/assets/{session-panel-CUTSr9rt.js → session-panel-YGK2D21A.js} +1 -1
  54. package/dist/assets/{slide-form-Bi8ZYBHP.js → slide-form-BE8M6oJo.js} +1 -1
  55. package/dist/assets/{snippets-panel-CdhDsAII.js → snippets-panel-CnN632Ki.js} +1 -1
  56. package/dist/assets/{state-C5AUgyZT.js → state-Bsz477is.js} +1 -1
  57. package/dist/assets/{state-DHlRrwyY.js → state-CoUA-8Ay.js} +2 -2
  58. package/dist/assets/{textarea-BXPC1-kb.js → textarea-Dd0InTQJ.js} +1 -1
  59. package/dist/assets/{tracing-wSufGcF9.js → tracing-DjZGgWTo.js} +1 -1
  60. package/dist/assets/{tracing-panel-BO6MMAXa.js → tracing-panel-8eFzEjG0.js} +2 -2
  61. package/dist/assets/{useAddCell-CqBbGhrY.js → useAddCell-De9xD63_.js} +1 -1
  62. package/dist/assets/{useCellActionButton-DYwx4pGE.js → useCellActionButton-Bjxun3wK.js} +1 -1
  63. package/dist/assets/{useDeleteCell-BJlGbsbV.js → useDeleteCell-C2Stbb6Q.js} +1 -1
  64. package/dist/assets/{useDependencyPanelTab-rkAIQ6zL.js → useDependencyPanelTab-8WaMRWbo.js} +1 -1
  65. package/dist/assets/useNotebookActions-bCZiRDS-.js +1 -0
  66. package/dist/assets/{useRunCells-B531RIUE.js → useRunCells-DU1tawR-.js} +1 -1
  67. package/dist/assets/{useSplitCell-BnuJW5uo.js → useSplitCell-BZPuhd8z.js} +1 -1
  68. package/dist/index.html +25 -25
  69. package/package.json +4 -4
  70. package/src/components/data-table/__tests__/column-header.test.ts +63 -0
  71. package/src/components/data-table/column-header.tsx +50 -159
  72. package/src/components/data-table/data-table.tsx +11 -2
  73. package/src/components/data-table/filter-by-values-picker.tsx +241 -0
  74. package/src/components/data-table/filter-pill-editor.tsx +470 -0
  75. package/src/components/data-table/filter-pills.tsx +177 -41
  76. package/src/components/editor/actions/pair-with-agent-modal.tsx +1 -1
  77. package/src/components/editor/actions/useNotebookActions.tsx +1 -0
  78. package/src/components/ui/checkbox.tsx +8 -4
  79. package/src/components/ui/combobox.tsx +3 -0
  80. package/src/css/app/Cell.css +4 -0
  81. package/src/plugins/impl/DataTablePlugin.tsx +1 -0
  82. package/src/plugins/impl/data-frames/forms/__tests__/__snapshots__/form.test.tsx.snap +15 -15
  83. package/src/utils/sets.ts +13 -0
  84. package/dist/assets/JsonOutput-DXnOS_Hk.js +0 -49
  85. package/dist/assets/command-DbT_zkRP.js +0 -1
  86. package/dist/assets/form-CPDlIjdV.js +0 -2
  87. package/dist/assets/index-BYLYJcAY.css +0 -2
  88. package/dist/assets/loro_wasm_bg-Ds40eH8K.js +0 -2
  89. package/dist/assets/useNotebookActions-Dga3qEHF.js +0 -1
@@ -1 +1 @@
1
- import{s as z}from"./chunk-LvLJmgfZ.js";import{l as X}from"./useEvent-D91BmmQi.js";import{t as Z}from"./react-Bj1aDYRI.js";import{Rt as I}from"./cells-CJlo_hG2.js";import{t as H}from"./compiler-runtime-B3qBwwSJ.js";import{S as $,c as ee,i as te,l as se,n as le,u as ae}from"./ai-model-dropdown-CYx9ZfdS.js";import{C as oe,v as ne,w as R}from"./utils-DIGrmLDO.js";import{S as re}from"./config-ChCHm539.js";import{t as ie}from"./jsx-runtime-BqBOg78p.js";import{o as ce}from"./alert-dialog-BGBdrcqJ.js";import{i as de,r as he,t as me}from"./popover-UExmgBsf.js";import{l as Q}from"./select-5i7URBEn.js";import{t as U}from"./tooltip-Gcwqb_SK.js";import{t as xe}from"./button-D9nb17Rw.js";import{s as B}from"./arrays-DYDL-3-i.js";import{r as Y}from"./requests-DIwGYs0l.js";import{t as pe}from"./createLucideIcon-D5guW7EU.js";import{t as fe}from"./x-C-6liIBr.js";import{r as D}from"./input-DyPS_GiK.js";import{t as K}from"./settings-DfFe0dWD.js";import{a as M,c as A,d as L,g as ue,i as je,l as P,o as q,p as ve,u as S}from"./textarea-BXPC1-kb.js";import{t as ge}from"./use-toast-BDYuj3zG.js";import{i as be}from"./RSPContexts-BeHIgT4C.js";import{n as we}from"./useDebounce-BDIglWmG.js";import{c as ye,l as Ne,n as Ce,t as V}from"./dialog-EekxpBBM.js";import{n as ke}from"./ImperativeModal-BBqcKmmk.js";import{t as O}from"./kbd-CGShmG7L.js";import{t as _e}from"./links-C-rLiK3d.js";import{t as G}from"./Inputs-BdyX096j.js";var Se=pe("power-off",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),Te=H(),s=z(ie(),1);const Me=t=>{let e=(0,Te.c)(15),{description:a,disabled:f,tooltip:r}=t,i=f===void 0?!1:f,u=r===void 0?"Shutdown":r,{openConfirm:b,closeModal:l}=ke(),{sendShutdown:o}=Y(),w;e[0]===o?w=e[1]:(w=()=>{o(),setTimeout(Ae,200)},e[0]=o,e[1]=w);let j=w;if(re())return null;let m=i?"disabled":"red",c;e[2]!==l||e[3]!==a||e[4]!==j||e[5]!==b?(c=h=>{h.stopPropagation(),b({title:"Shutdown",description:a,variant:"destructive",confirmAction:(0,s.jsx)(ce,{onClick:()=>{j(),l()},"aria-label":"Confirm Shutdown",children:"Shutdown"})})},e[2]=l,e[3]=a,e[4]=j,e[5]=b,e[6]=c):c=e[6];let n;e[7]===Symbol.for("react.memo_cache_sentinel")?(n=(0,s.jsx)(fe,{strokeWidth:1}),e[7]=n):n=e[7];let d;e[8]!==i||e[9]!==m||e[10]!==c?(d=(0,s.jsx)(G,{"aria-label":"Shutdown","data-testid":"shutdown-button",shape:"circle",size:"small",color:m,className:"h-[27px] w-[27px]",disabled:i,onClick:c,children:n}),e[8]=i,e[9]=m,e[10]=c,e[11]=d):d=e[11];let x;return e[12]!==d||e[13]!==u?(x=(0,s.jsx)(U,{content:u,children:d}),e[12]=d,e[13]=u,e[14]=x):x=e[14],x};function Ae(){window.close()}var J=H(),W=z(Z(),1),Le=100;const Pe=()=>{let t=(0,J.c)(37),[e,a]=ne(),{saveAppConfig:f}=Y(),r=(0,W.useId)(),i=(0,W.useId)(),u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=ve(oe),t[0]=u):u=t[0];let b;t[1]===e?b=t[2]:(b={resolver:u,defaultValues:e},t[1]=e,t[2]=b);let l=ue(b),o;t[3]!==f||t[4]!==a?(o=async p=>{await f({config:p}).then(()=>{a(p)}).catch(()=>{a(p)})},t[3]=f,t[4]=a,t[5]=o):o=t[5];let w=o,j;t[6]===w?j=t[7]:(j=p=>{w(p)},t[6]=w,t[7]=j);let m=we(j,Le),c;t[8]===e.width?c=t[9]:(c=[e.width],t[8]=e.width,t[9]=c),(0,W.useEffect)(qe,c);let n;t[10]!==m||t[11]!==l?(n=l.handleSubmit(m),t[10]=m,t[11]=l,t[12]=n):n=t[12];let d;t[13]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsxs)("div",{children:[(0,s.jsx)(ae,{children:"Notebook Settings"}),(0,s.jsx)(se,{children:"Configure how your notebook or application looks and behaves."})]}),t[13]=d):d=t[13];let x;t[14]===l.control?x=t[15]:(x=(0,s.jsxs)(F,{title:"Display",children:[(0,s.jsx)(A,{control:l.control,name:"width",render:Fe}),(0,s.jsx)(A,{control:l.control,name:"app_title",render:He})]}),t[14]=l.control,t[15]=x);let h;t[16]===l.control?h=t[17]:(h=(0,s.jsxs)(F,{title:"Custom Files",children:[(0,s.jsx)(A,{control:l.control,name:"css_file",render:De}),(0,s.jsx)(A,{control:l.control,name:"html_head_file",render:Oe})]}),t[16]=l.control,t[17]=h);let y;t[18]===l.control?y=t[19]:(y=(0,s.jsx)(F,{title:"Data",children:(0,s.jsx)(A,{control:l.control,name:"sql_output",render:ze})}),t[18]=l.control,t[19]=y);let N;t[20]!==r||t[21]!==i?(N=p=>{let{field:_}=p;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(P,{className:"flex flex-col gap-2",children:[(0,s.jsx)(M,{children:(0,s.jsxs)("div",{className:"flex gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(I,{id:r,"data-testid":"html-checkbox",checked:_.value.includes("html"),onCheckedChange:()=>{_.onChange(B(_.value,"html"))}}),(0,s.jsx)(S,{htmlFor:r,children:"HTML"})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(I,{id:i,"data-testid":"ipynb-checkbox",checked:_.value.includes("ipynb"),onCheckedChange:()=>{_.onChange(B(_.value,"ipynb"))}}),(0,s.jsx)(S,{htmlFor:i,children:"IPYNB"})]})]})}),(0,s.jsx)(L,{})]}),(0,s.jsxs)(q,{children:["When enabled, marimo will periodically save this notebook in your selected formats (HTML, IPYNB) to a folder named"," ",(0,s.jsx)(O,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})},t[20]=r,t[21]=i,t[22]=N):N=t[22];let v;t[23]!==l.control||t[24]!==N?(v=(0,s.jsx)(F,{title:"Exporting outputs",children:(0,s.jsx)(A,{control:l.control,name:"auto_download",render:N})}),t[23]=l.control,t[24]=N,t[25]=v):v=t[25];let C;t[26]!==v||t[27]!==x||t[28]!==h||t[29]!==y?(C=(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-x-8 gap-y-4",children:[x,h,y,v]}),t[26]=v,t[27]=x,t[28]=h,t[29]=y,t[30]=C):C=t[30];let g;t[31]!==C||t[32]!==n?(g=(0,s.jsxs)("form",{onChange:n,className:"flex flex-col gap-6",children:[d,C]}),t[31]=C,t[32]=n,t[33]=g):g=t[33];let k;return t[34]!==l||t[35]!==g?(k=(0,s.jsx)(je,{...l,children:g}),t[34]=l,t[35]=g,t[36]=k):k=t[36],k};var F=t=>{let e=(0,J.c)(5),{title:a,children:f}=t,r;e[0]===a?r=e[1]:(r=(0,s.jsx)("h3",{className:"text-base font-semibold mb-1",children:a}),e[0]=a,e[1]=r);let i;return e[2]!==f||e[3]!==r?(i=(0,s.jsxs)("div",{className:"flex flex-col gap-y-2",children:[r,f]}),e[2]=f,e[3]=r,e[4]=i):i=e[4],i};function qe(){window.dispatchEvent(new Event("resize"))}function Ee(t){return(0,s.jsx)("option",{value:t,children:t},t)}function Fe(t){let{field:e}=t;return(0,s.jsxs)(P,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{children:"Width"}),(0,s.jsx)(M,{children:(0,s.jsx)(Q,{"data-testid":"app-width-select",onChange:a=>e.onChange(a.target.value),value:e.value,disabled:e.disabled,className:"inline-flex mr-2",children:$().map(Ee)})}),(0,s.jsx)(L,{})]})}function He(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(P,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{children:"App title"}),(0,s.jsx)(M,{children:(0,s.jsx)(D,{...e,value:e.value??"",onChange:a=>{e.onChange(a.target.value),R.safeParse(a.target.value).success&&(document.title=a.target.value)}})}),(0,s.jsx)(L,{})]}),(0,s.jsx)(q,{children:"The application title is put in the title tag in the HTML code and typically displayed in the title bar of the browser window."})]})}function De(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(P,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{className:"shrink-0",children:"Custom CSS"}),(0,s.jsx)(M,{children:(0,s.jsx)(D,{...e,value:e.value??"",placeholder:"custom.css",onChange:a=>{e.onChange(a.target.value),R.safeParse(a.target.value).success&&(document.title=a.target.value)}})}),(0,s.jsx)(L,{})]}),(0,s.jsx)(q,{children:"A filepath to a custom css file to be injected into the notebook."})]})}function Oe(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(P,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{className:"shrink-0",children:"HTML Head"}),(0,s.jsx)(M,{children:(0,s.jsx)(D,{...e,value:e.value??"",placeholder:"head.html",onChange:a=>{e.onChange(a.target.value)}})}),(0,s.jsx)(L,{})]}),(0,s.jsxs)(q,{children:["A filepath to an HTML file to be injected into the"," ",(0,s.jsx)(O,{className:"inline",children:"<head/>"})," section of the notebook. Use this to add analytics, custom fonts, meta tags, or external scripts."]})]})}function We(t){return(0,s.jsx)("option",{value:t.value,children:t.label},t.value)}function ze(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(P,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{children:"SQL Output Type"}),(0,s.jsx)(M,{children:(0,s.jsx)(Q,{"data-testid":"sql-output-select",onChange:a=>{e.onChange(a.target.value),ge({title:"Kernel Restart Required",description:"This change requires a kernel restart to take effect."})},value:e.value,disabled:e.disabled,className:"inline-flex mr-2",children:ee.map(We)})}),(0,s.jsx)(L,{})]}),(0,s.jsxs)(q,{children:["The Python type returned by a SQL cell. For best performance with large datasets, we recommend using"," ",(0,s.jsx)(O,{className:"inline",children:"native"}),". See the"," ",(0,s.jsx)(_e,{href:"https://docs.marimo.io/guides/working_with_data/sql",children:"SQL guide"})," ","for more information."]})]})}var Ie=H();const Re=t=>{let e=(0,Ie.c)(32),{showAppConfig:a,disabled:f,tooltip:r}=t,i=a===void 0?!0:a,u=f===void 0?!1:f,b=r===void 0?"Settings":r,[l,o]=X(le),w=u?"disabled":"hint-green",j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j=(0,s.jsx)(K,{strokeWidth:1.8}),e[0]=j):j=e[0];let m;e[1]===b?m=e[2]:(m=(0,s.jsx)(U,{content:b,children:j}),e[1]=b,e[2]=m);let c;e[3]!==u||e[4]!==w||e[5]!==m?(c=(0,s.jsx)(G,{"aria-label":"Config","data-testid":"app-config-button",shape:"circle",size:"small",className:"h-[27px] w-[27px]",disabled:u,color:w,children:m}),e[3]=u,e[4]=w,e[5]=m,e[6]=c):c=e[6];let n=c,d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsxs)(Ce,{className:"w-[90vw] h-[90vh] overflow-hidden sm:max-w-5xl top-[5vh] p-0",children:[(0,s.jsx)(be,{children:(0,s.jsx)(ye,{children:"User settings"})}),(0,s.jsx)(te,{})]}),e[7]=d):d=e[7];let x=d;if(!i){let T;e[8]===n?T=e[9]:(T=(0,s.jsx)(Ne,{children:n}),e[8]=n,e[9]=T);let E;return e[10]!==o||e[11]!==l||e[12]!==T?(E=(0,s.jsxs)(V,{open:l,onOpenChange:o,children:[T,x]}),e[10]=o,e[11]=l,e[12]=T,e[13]=E):E=e[13],E}let h;e[14]===n?h=e[15]:(h=(0,s.jsx)(de,{asChild:!0,children:n}),e[14]=n,e[15]=h);let y,N;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=(0,s.jsx)(Pe,{}),N=(0,s.jsx)("div",{className:"h-px bg-border my-2"}),e[16]=y,e[17]=N):(y=e[16],N=e[17]);let v;e[18]===o?v=e[19]:(v=()=>o(!0),e[18]=o,e[19]=v);let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=(0,s.jsx)(K,{strokeWidth:1.8,className:"w-4 h-4 mr-2"}),e[20]=C):C=e[20];let g;e[21]===v?g=e[22]:(g=(0,s.jsxs)(he,{className:"w-[650px] overflow-auto max-h-[80vh] max-w-[80vw]",align:"end",side:"bottom",onFocusOutside:Qe,children:[y,N,(0,s.jsxs)(xe,{onClick:v,variant:"link",className:"px-0",children:[C,"User settings"]})]}),e[21]=v,e[22]=g);let k;e[23]!==g||e[24]!==h?(k=(0,s.jsxs)(me,{children:[h,g]}),e[23]=g,e[24]=h,e[25]=k):k=e[25];let p;e[26]!==o||e[27]!==l?(p=(0,s.jsx)(V,{open:l,onOpenChange:o,children:x}),e[26]=o,e[27]=l,e[28]=p):p=e[28];let _;return e[29]!==k||e[30]!==p?(_=(0,s.jsxs)(s.Fragment,{children:[k,p]}),e[29]=k,e[30]=p,e[31]=_):_=e[31],_};function Qe(t){return t.preventDefault()}export{Me as n,Se as r,Re as t};
1
+ import{s as z}from"./chunk-LvLJmgfZ.js";import{l as X}from"./useEvent-D91BmmQi.js";import{t as Z}from"./react-Bj1aDYRI.js";import{Rt as I}from"./cells-A-ljPpuj.js";import{t as H}from"./compiler-runtime-B3qBwwSJ.js";import{S as $,c as ee,i as te,l as se,n as le,u as ae}from"./ai-model-dropdown-By4Ohb0R.js";import{C as oe,v as ne,w as R}from"./utils-DIGrmLDO.js";import{S as re}from"./config-ChCHm539.js";import{t as ie}from"./jsx-runtime-BqBOg78p.js";import{o as ce}from"./alert-dialog-BGBdrcqJ.js";import{i as de,r as he,t as me}from"./popover-UExmgBsf.js";import{l as Q}from"./select-5i7URBEn.js";import{t as U}from"./tooltip-Gcwqb_SK.js";import{t as xe}from"./button-D9nb17Rw.js";import{s as B}from"./arrays-DYDL-3-i.js";import{r as Y}from"./requests-DIwGYs0l.js";import{t as pe}from"./createLucideIcon-D5guW7EU.js";import{t as fe}from"./x-C-6liIBr.js";import{r as D}from"./input-DyPS_GiK.js";import{t as K}from"./settings-DfFe0dWD.js";import{a as M,c as A,d as L,g as ue,i as je,l as P,o as q,p as ve,u as S}from"./textarea-Dd0InTQJ.js";import{t as ge}from"./use-toast-BDYuj3zG.js";import{i as be}from"./RSPContexts-BeHIgT4C.js";import{n as we}from"./useDebounce-BDIglWmG.js";import{c as ye,l as Ne,n as Ce,t as V}from"./dialog-EekxpBBM.js";import{n as ke}from"./ImperativeModal-BBqcKmmk.js";import{t as O}from"./kbd-CGShmG7L.js";import{t as _e}from"./links-C-rLiK3d.js";import{t as G}from"./Inputs-BdyX096j.js";var Se=pe("power-off",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),Te=H(),s=z(ie(),1);const Me=t=>{let e=(0,Te.c)(15),{description:a,disabled:f,tooltip:r}=t,i=f===void 0?!1:f,u=r===void 0?"Shutdown":r,{openConfirm:b,closeModal:l}=ke(),{sendShutdown:o}=Y(),w;e[0]===o?w=e[1]:(w=()=>{o(),setTimeout(Ae,200)},e[0]=o,e[1]=w);let j=w;if(re())return null;let m=i?"disabled":"red",c;e[2]!==l||e[3]!==a||e[4]!==j||e[5]!==b?(c=h=>{h.stopPropagation(),b({title:"Shutdown",description:a,variant:"destructive",confirmAction:(0,s.jsx)(ce,{onClick:()=>{j(),l()},"aria-label":"Confirm Shutdown",children:"Shutdown"})})},e[2]=l,e[3]=a,e[4]=j,e[5]=b,e[6]=c):c=e[6];let n;e[7]===Symbol.for("react.memo_cache_sentinel")?(n=(0,s.jsx)(fe,{strokeWidth:1}),e[7]=n):n=e[7];let d;e[8]!==i||e[9]!==m||e[10]!==c?(d=(0,s.jsx)(G,{"aria-label":"Shutdown","data-testid":"shutdown-button",shape:"circle",size:"small",color:m,className:"h-[27px] w-[27px]",disabled:i,onClick:c,children:n}),e[8]=i,e[9]=m,e[10]=c,e[11]=d):d=e[11];let x;return e[12]!==d||e[13]!==u?(x=(0,s.jsx)(U,{content:u,children:d}),e[12]=d,e[13]=u,e[14]=x):x=e[14],x};function Ae(){window.close()}var J=H(),W=z(Z(),1),Le=100;const Pe=()=>{let t=(0,J.c)(37),[e,a]=ne(),{saveAppConfig:f}=Y(),r=(0,W.useId)(),i=(0,W.useId)(),u;t[0]===Symbol.for("react.memo_cache_sentinel")?(u=ve(oe),t[0]=u):u=t[0];let b;t[1]===e?b=t[2]:(b={resolver:u,defaultValues:e},t[1]=e,t[2]=b);let l=ue(b),o;t[3]!==f||t[4]!==a?(o=async p=>{await f({config:p}).then(()=>{a(p)}).catch(()=>{a(p)})},t[3]=f,t[4]=a,t[5]=o):o=t[5];let w=o,j;t[6]===w?j=t[7]:(j=p=>{w(p)},t[6]=w,t[7]=j);let m=we(j,Le),c;t[8]===e.width?c=t[9]:(c=[e.width],t[8]=e.width,t[9]=c),(0,W.useEffect)(qe,c);let n;t[10]!==m||t[11]!==l?(n=l.handleSubmit(m),t[10]=m,t[11]=l,t[12]=n):n=t[12];let d;t[13]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsxs)("div",{children:[(0,s.jsx)(ae,{children:"Notebook Settings"}),(0,s.jsx)(se,{children:"Configure how your notebook or application looks and behaves."})]}),t[13]=d):d=t[13];let x;t[14]===l.control?x=t[15]:(x=(0,s.jsxs)(F,{title:"Display",children:[(0,s.jsx)(A,{control:l.control,name:"width",render:Fe}),(0,s.jsx)(A,{control:l.control,name:"app_title",render:He})]}),t[14]=l.control,t[15]=x);let h;t[16]===l.control?h=t[17]:(h=(0,s.jsxs)(F,{title:"Custom Files",children:[(0,s.jsx)(A,{control:l.control,name:"css_file",render:De}),(0,s.jsx)(A,{control:l.control,name:"html_head_file",render:Oe})]}),t[16]=l.control,t[17]=h);let y;t[18]===l.control?y=t[19]:(y=(0,s.jsx)(F,{title:"Data",children:(0,s.jsx)(A,{control:l.control,name:"sql_output",render:ze})}),t[18]=l.control,t[19]=y);let N;t[20]!==r||t[21]!==i?(N=p=>{let{field:_}=p;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(P,{className:"flex flex-col gap-2",children:[(0,s.jsx)(M,{children:(0,s.jsxs)("div",{className:"flex gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(I,{id:r,"data-testid":"html-checkbox",checked:_.value.includes("html"),onCheckedChange:()=>{_.onChange(B(_.value,"html"))}}),(0,s.jsx)(S,{htmlFor:r,children:"HTML"})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(I,{id:i,"data-testid":"ipynb-checkbox",checked:_.value.includes("ipynb"),onCheckedChange:()=>{_.onChange(B(_.value,"ipynb"))}}),(0,s.jsx)(S,{htmlFor:i,children:"IPYNB"})]})]})}),(0,s.jsx)(L,{})]}),(0,s.jsxs)(q,{children:["When enabled, marimo will periodically save this notebook in your selected formats (HTML, IPYNB) to a folder named"," ",(0,s.jsx)(O,{className:"inline",children:"__marimo__"})," next to your notebook file."]})]})},t[20]=r,t[21]=i,t[22]=N):N=t[22];let v;t[23]!==l.control||t[24]!==N?(v=(0,s.jsx)(F,{title:"Exporting outputs",children:(0,s.jsx)(A,{control:l.control,name:"auto_download",render:N})}),t[23]=l.control,t[24]=N,t[25]=v):v=t[25];let C;t[26]!==v||t[27]!==x||t[28]!==h||t[29]!==y?(C=(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-x-8 gap-y-4",children:[x,h,y,v]}),t[26]=v,t[27]=x,t[28]=h,t[29]=y,t[30]=C):C=t[30];let g;t[31]!==C||t[32]!==n?(g=(0,s.jsxs)("form",{onChange:n,className:"flex flex-col gap-6",children:[d,C]}),t[31]=C,t[32]=n,t[33]=g):g=t[33];let k;return t[34]!==l||t[35]!==g?(k=(0,s.jsx)(je,{...l,children:g}),t[34]=l,t[35]=g,t[36]=k):k=t[36],k};var F=t=>{let e=(0,J.c)(5),{title:a,children:f}=t,r;e[0]===a?r=e[1]:(r=(0,s.jsx)("h3",{className:"text-base font-semibold mb-1",children:a}),e[0]=a,e[1]=r);let i;return e[2]!==f||e[3]!==r?(i=(0,s.jsxs)("div",{className:"flex flex-col gap-y-2",children:[r,f]}),e[2]=f,e[3]=r,e[4]=i):i=e[4],i};function qe(){window.dispatchEvent(new Event("resize"))}function Ee(t){return(0,s.jsx)("option",{value:t,children:t},t)}function Fe(t){let{field:e}=t;return(0,s.jsxs)(P,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{children:"Width"}),(0,s.jsx)(M,{children:(0,s.jsx)(Q,{"data-testid":"app-width-select",onChange:a=>e.onChange(a.target.value),value:e.value,disabled:e.disabled,className:"inline-flex mr-2",children:$().map(Ee)})}),(0,s.jsx)(L,{})]})}function He(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(P,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{children:"App title"}),(0,s.jsx)(M,{children:(0,s.jsx)(D,{...e,value:e.value??"",onChange:a=>{e.onChange(a.target.value),R.safeParse(a.target.value).success&&(document.title=a.target.value)}})}),(0,s.jsx)(L,{})]}),(0,s.jsx)(q,{children:"The application title is put in the title tag in the HTML code and typically displayed in the title bar of the browser window."})]})}function De(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(P,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{className:"shrink-0",children:"Custom CSS"}),(0,s.jsx)(M,{children:(0,s.jsx)(D,{...e,value:e.value??"",placeholder:"custom.css",onChange:a=>{e.onChange(a.target.value),R.safeParse(a.target.value).success&&(document.title=a.target.value)}})}),(0,s.jsx)(L,{})]}),(0,s.jsx)(q,{children:"A filepath to a custom css file to be injected into the notebook."})]})}function Oe(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(P,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{className:"shrink-0",children:"HTML Head"}),(0,s.jsx)(M,{children:(0,s.jsx)(D,{...e,value:e.value??"",placeholder:"head.html",onChange:a=>{e.onChange(a.target.value)}})}),(0,s.jsx)(L,{})]}),(0,s.jsxs)(q,{children:["A filepath to an HTML file to be injected into the"," ",(0,s.jsx)(O,{className:"inline",children:"<head/>"})," section of the notebook. Use this to add analytics, custom fonts, meta tags, or external scripts."]})]})}function We(t){return(0,s.jsx)("option",{value:t.value,children:t.label},t.value)}function ze(t){let{field:e}=t;return(0,s.jsxs)("div",{className:"flex flex-col gap-y-1",children:[(0,s.jsxs)(P,{className:"flex flex-row items-center space-x-1 space-y-0",children:[(0,s.jsx)(S,{children:"SQL Output Type"}),(0,s.jsx)(M,{children:(0,s.jsx)(Q,{"data-testid":"sql-output-select",onChange:a=>{e.onChange(a.target.value),ge({title:"Kernel Restart Required",description:"This change requires a kernel restart to take effect."})},value:e.value,disabled:e.disabled,className:"inline-flex mr-2",children:ee.map(We)})}),(0,s.jsx)(L,{})]}),(0,s.jsxs)(q,{children:["The Python type returned by a SQL cell. For best performance with large datasets, we recommend using"," ",(0,s.jsx)(O,{className:"inline",children:"native"}),". See the"," ",(0,s.jsx)(_e,{href:"https://docs.marimo.io/guides/working_with_data/sql",children:"SQL guide"})," ","for more information."]})]})}var Ie=H();const Re=t=>{let e=(0,Ie.c)(32),{showAppConfig:a,disabled:f,tooltip:r}=t,i=a===void 0?!0:a,u=f===void 0?!1:f,b=r===void 0?"Settings":r,[l,o]=X(le),w=u?"disabled":"hint-green",j;e[0]===Symbol.for("react.memo_cache_sentinel")?(j=(0,s.jsx)(K,{strokeWidth:1.8}),e[0]=j):j=e[0];let m;e[1]===b?m=e[2]:(m=(0,s.jsx)(U,{content:b,children:j}),e[1]=b,e[2]=m);let c;e[3]!==u||e[4]!==w||e[5]!==m?(c=(0,s.jsx)(G,{"aria-label":"Config","data-testid":"app-config-button",shape:"circle",size:"small",className:"h-[27px] w-[27px]",disabled:u,color:w,children:m}),e[3]=u,e[4]=w,e[5]=m,e[6]=c):c=e[6];let n=c,d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=(0,s.jsxs)(Ce,{className:"w-[90vw] h-[90vh] overflow-hidden sm:max-w-5xl top-[5vh] p-0",children:[(0,s.jsx)(be,{children:(0,s.jsx)(ye,{children:"User settings"})}),(0,s.jsx)(te,{})]}),e[7]=d):d=e[7];let x=d;if(!i){let T;e[8]===n?T=e[9]:(T=(0,s.jsx)(Ne,{children:n}),e[8]=n,e[9]=T);let E;return e[10]!==o||e[11]!==l||e[12]!==T?(E=(0,s.jsxs)(V,{open:l,onOpenChange:o,children:[T,x]}),e[10]=o,e[11]=l,e[12]=T,e[13]=E):E=e[13],E}let h;e[14]===n?h=e[15]:(h=(0,s.jsx)(de,{asChild:!0,children:n}),e[14]=n,e[15]=h);let y,N;e[16]===Symbol.for("react.memo_cache_sentinel")?(y=(0,s.jsx)(Pe,{}),N=(0,s.jsx)("div",{className:"h-px bg-border my-2"}),e[16]=y,e[17]=N):(y=e[16],N=e[17]);let v;e[18]===o?v=e[19]:(v=()=>o(!0),e[18]=o,e[19]=v);let C;e[20]===Symbol.for("react.memo_cache_sentinel")?(C=(0,s.jsx)(K,{strokeWidth:1.8,className:"w-4 h-4 mr-2"}),e[20]=C):C=e[20];let g;e[21]===v?g=e[22]:(g=(0,s.jsxs)(he,{className:"w-[650px] overflow-auto max-h-[80vh] max-w-[80vw]",align:"end",side:"bottom",onFocusOutside:Qe,children:[y,N,(0,s.jsxs)(xe,{onClick:v,variant:"link",className:"px-0",children:[C,"User settings"]})]}),e[21]=v,e[22]=g);let k;e[23]!==g||e[24]!==h?(k=(0,s.jsxs)(me,{children:[h,g]}),e[23]=g,e[24]=h,e[25]=k):k=e[25];let p;e[26]!==o||e[27]!==l?(p=(0,s.jsx)(V,{open:l,onOpenChange:o,children:x}),e[26]=o,e[27]=l,e[28]=p):p=e[28];let _;return e[29]!==k||e[30]!==p?(_=(0,s.jsxs)(s.Fragment,{children:[k,p]}),e[29]=k,e[30]=p,e[31]=_):_=e[31],_};function Qe(t){return t.preventDefault()}export{Me as n,Se as r,Re as t};