@marimo-team/frontend 0.24.3-dev10 → 0.24.3-dev14
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-DXkwkuL9.js → CellStatus-LChlPuPv.js} +1 -1
- package/dist/assets/{JsonOutput-izmGhjov.js → JsonOutput-DCgOfk7t.js} +1 -1
- package/dist/assets/{MarimoErrorOutput-CdmP3ZHL.js → MarimoErrorOutput-DwGwWsxV.js} +1 -1
- package/dist/assets/{RenderHTML-DlYXvh8D.js → RenderHTML-B73ExmWb.js} +1 -1
- package/dist/assets/{RunButton-Bieadi9w.js → RunButton-iPopny2V.js} +1 -1
- package/dist/assets/{add-cell-with-ai-ZpV9L4qe.js → add-cell-with-ai-Zmna5Pnz.js} +1 -1
- package/dist/assets/{add-connection-dialog-a8mkIeXa.js → add-connection-dialog-1fPdJRRj.js} +1 -1
- package/dist/assets/{agent-panel-rVtDSi07.js → agent-panel-5XpCdNT3.js} +1 -1
- package/dist/assets/{ai-model-dropdown-C8IztRe2.js → ai-model-dropdown-DyZHVnJV.js} +1 -1
- package/dist/assets/{app-config-button-DLr-6jwI.js → app-config-button-hAuVQs8P.js} +1 -1
- package/dist/assets/{blob-B2Qs47Zi.js → blob-B6ayJpoQ.js} +1 -1
- package/dist/assets/{cell-editor-3VpJI5EQ.js → cell-editor-BF03RXUX.js} +6 -6
- package/dist/assets/{cell-link-DEXHmwy1.js → cell-link-B7ZVGcSl.js} +1 -1
- package/dist/assets/{cells--Hh9voS5.js → cells-CMLP1Dld.js} +2 -2
- package/dist/assets/{chat-display-DtQ0tOGK.js → chat-display-DITGvVMs.js} +1 -1
- package/dist/assets/{chat-panel-DLgUUTdo.js → chat-panel-DkD3HUqU.js} +1 -1
- package/dist/assets/{chat-ui-DIXDoCsM.js → chat-ui-Dbm1pCa-.js} +1 -1
- package/dist/assets/{column-preview-H8rmRiii.js → column-preview-oex3TMfq.js} +1 -1
- package/dist/assets/{command-palette-Pmg3QxZ0.js → command-palette-Bur8AlZ8.js} +1 -1
- package/dist/assets/{common-CrhvbKbI.js → common-BN-k-WsU.js} +1 -1
- package/dist/assets/{components-rCVlCccf.js → components-BPyy3wXe.js} +1 -1
- package/dist/assets/{datasource-DgkQfSw3.js → datasource-DDYaCFxh.js} +1 -1
- package/dist/assets/{dependency-graph-panel-D1BZdQJH.js → dependency-graph-panel-XotpvJGU.js} +1 -1
- package/dist/assets/{documentation-panel-DzNGB1Zx.js → documentation-panel-pxfRAT4P.js} +1 -1
- package/dist/assets/{download-DtQweFN1.js → download-BRrPmrl5.js} +1 -1
- package/dist/assets/{edit-page-fb5fV9UA.js → edit-page-C7Rr28Uh.js} +4 -4
- package/dist/assets/{error-entries-CMsalXvZ.js → error-entries-Bc5lubx5.js} +1 -1
- package/dist/assets/{error-panel-D6kqFA9f.js → error-panel-n7jAw6zx.js} +1 -1
- package/dist/assets/{file-explorer-panel-D3APtOiy.js → file-explorer-panel-BOBUXkRd.js} +1 -1
- package/dist/assets/{file-name-input-CdDGwb85.js → file-name-input-Brf4MYj_.js} +1 -1
- package/dist/assets/{floating-outline-D2WpILR-.js → floating-outline-CG-zTB22.js} +1 -1
- package/dist/assets/{home-page-BXgJYrZ5.js → home-page-CiNzhCq5.js} +1 -1
- package/dist/assets/{index-B4Fq20-p.js → index-DTkztl_B.js} +6 -6
- package/dist/assets/{layout-VgriO3Ll.js → layout-DUWWt2Qy.js} +3 -3
- package/dist/assets/{logs-panel-DsbX3K3h.js → logs-panel-Dpw-vNvJ.js} +1 -1
- package/dist/assets/{markdown-renderer-DD7ui8RW.js → markdown-renderer-C_dn-F0h.js} +1 -1
- package/dist/assets/{name-cell-input-EjA-eGvA.js → name-cell-input-DQ1AN_b1.js} +1 -1
- package/dist/assets/{outline-panel-DeDFCw9s.js → outline-panel-CANEwLJ7.js} +1 -1
- package/dist/assets/{packages-panel-B__MaP9u.js → packages-panel-Brdj0VxX.js} +1 -1
- package/dist/assets/{panel-accordion-state-CwLKISCL.js → panel-accordion-state-CJxJh72n.js} +1 -1
- package/dist/assets/{panels-c3iYYVuV.js → panels-viysxgE7.js} +1 -1
- package/dist/assets/{process-output-DQoLxPra.js → process-output-DTlZ_jDn.js} +1 -1
- package/dist/assets/{readonly-code-display-DuFy8860.js → readonly-code-display-DWORkymT.js} +1 -1
- package/dist/assets/{readonly-python-code-yR65TOiM.js → readonly-python-code-Cvz_-5Jh.js} +1 -1
- package/dist/assets/{reveal-component-CgskYNVn.js → reveal-component-sEYLer4J.js} +1 -1
- package/dist/assets/{run-page-C_mciAdT.js → run-page-grpBV-DF.js} +1 -1
- package/dist/assets/{scratchpad-panel-Bj4yxnuS.js → scratchpad-panel-CBxmZReo.js} +1 -1
- package/dist/assets/{session-panel-NQyDQouJ.js → session-panel-2w7efICk.js} +1 -1
- package/dist/assets/{skeleton-CUFHwpIk.js → skeleton-SCiqCq0i.js} +1 -1
- package/dist/assets/{snippets-panel-Bx2wFck8.js → snippets-panel-CvdCemOl.js} +1 -1
- package/dist/assets/{state-CdjswcRf.js → state-CJnYkzhz.js} +1 -1
- package/dist/assets/{state-CiPrV156.js → state-DuyHh3Fk.js} +1 -1
- package/dist/assets/{tracing-Qjfb3Qm1.js → tracing-CnQSHm2x.js} +1 -1
- package/dist/assets/{tracing-panel-Cj_-LD2X.js → tracing-panel-BZHx8nXa.js} +2 -2
- package/dist/assets/tree-actions-5rg4Zqxe.js +1 -0
- package/dist/assets/{useAddCell-Bvb-C_H5.js → useAddCell-4vmbxGw5.js} +1 -1
- package/dist/assets/{useCellActionButton-Df4qSnWR.js → useCellActionButton-BQY2nyr_.js} +1 -1
- package/dist/assets/{useDeleteCell-eNMTvg8D.js → useDeleteCell-CM1QzkEs.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-BusYWoB8.js → useDependencyPanelTab-BsALWNfv.js} +1 -1
- package/dist/assets/{useInstallPackage-ClaR_nYb.js → useInstallPackage-Cr0TevQm.js} +1 -1
- package/dist/assets/useNotebookActions-BzEheQzj.js +10 -0
- package/dist/assets/{useRunCells-D8B7UNsg.js → useRunCells-C2e26LhV.js} +1 -1
- package/dist/assets/{useSplitCell-Cy7fCcQW.js → useSplitCell-CJ8nGq_h.js} +1 -1
- package/dist/index.html +19 -19
- package/package.json +1 -1
- package/src/components/data-table/column-explorer-panel/column-explorer.tsx +2 -6
- package/src/components/editor/chrome/components/feedback-button.tsx +10 -9
- package/src/components/editor/code/__tests__/readonly-diff.test.tsx +65 -0
- package/src/components/editor/code/readonly-diff.tsx +1 -1
- package/src/components/editor/file-tree/__tests__/tree-actions.test.tsx +54 -0
- package/src/components/editor/file-tree/tree-actions.tsx +11 -14
- package/src/core/cells/pending-delete-service.ts +12 -16
- package/src/core/codemirror/language/__tests__/sql.test.ts +70 -2
- package/src/core/codemirror/language/languages/sql/sql.ts +16 -1
- package/src/core/datasets/__tests__/data-source.test.ts +2 -0
- package/src/core/datasets/data-source-connections.ts +15 -10
- package/src/plugins/layout/AccordionPlugin.tsx +7 -2
- package/src/plugins/layout/__test__/AccordionPlugin.test.tsx +66 -0
- package/dist/assets/tree-actions-CmY9PFuu.js +0 -1
- package/dist/assets/useNotebookActions-bWJW4dS_.js +0 -10
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./tracing-
|
|
2
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CBDbhulC.js";import{t as n}from"./compiler-runtime-CYIjoINj.js";import{t as r}from"./jsx-runtime-B74pBk57.js";import{t as i}from"./spinner-Ck-Hgfvj.js";import{t as a}from"./preload-helper-HclGiUj8.js";var o=n(),s=e(t(),1),c=r(),l=s.lazy(()=>a(()=>import(`./tracing-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./tracing-CnQSHm2x.js","./rolldown-runtime-B0Z9INg1.js","./useEvent-xfs0Sn4r.js","./react-CBDbhulC.js","./compiler-runtime-CYIjoINj.js","./cells-CMLP1Dld.js","./react-dom-BQrReHnR.js","./schemas-aTUejmFi.js","./debounce-aFmHgJZY.js","./isObject-BCaOs5rp.js","./now-Cmx0b_zA.js","./isSymbol-oX0TOjjx.js","./utils-D5Ywm7-q.js","./_baseMerge-DLqSVasz.js","./isArrayLikeObject-DnwgSs_Z.js","./_initCloneObject-CM3WilQg.js","./useEventListener-92uWqz-P.js","./objects-snlMn4yk.js","./jsx-runtime-B74pBk57.js","./invariant-Ci2dTZ72.js","./config-BuGkUPaK.js","./constants-BDbGiS7O.js","./Deferred-CrTnjj37.js","./session-Sz5nSFku.js","./cn-ldLVeaqm.js","./clsx-DB0hHKMi.js","./fullscreen-BH2jz-F4.js","./dist-CLXTUtr2.js","./menu-items-BSRA2YI9.js","./alert-dialog-CA-2mBs3.js","./button-Dh8EwhsF.js","./select-C1IYgK48.js","./dist-0lSCnrrf.js","./check-BoA6XBpj.js","./createLucideIcon-B7HeEoG2.js","./useNumberFormatter-DHJ9s6Vk.js","./context-Do8M9TDF.js","./circle-ByJdIf5p.js","./tooltip-BvU0ko_d.js","./dist-BtC9ym6k.js","./dist-CZNULd6Z.js","./arrays-BqUx5USx.js","./once-Haz_uxEL.js","./capabilities-D8kPgMKr.js","./cjs-C49f7GXV.js","./createReducer-B_XmHROl.js","./dist-DiYjQAhI.js","./marked.esm-B_3iMIUq.js","./strings-CReV1AYG.js","./requests-C6_IaFh7.js","./dist-B8pdsUrS.js","./paths-ClYq6Exe.js","./useLifecycle-BUaJcygz.js","./toDate-hGYJX0Ha.js","./database-zap-CloO6gbw.js","./write-secret-modal-CSWlDX_Z.js","./input-DEbY281O.js","./numbers-Bc-r3jsC.js","./useDebounce-DgpSQhrP.js","./uuid-k9DpjH68.js","./use-toast-DpWHUGuF.js","./plus-C4J9gIE1.js","./trash-2-D_HX-0qx.js","./badge-BSgtkC2e.js","./preload-helper-HclGiUj8.js","./dist-Cx4BE7jC.js","./dist-B0RXffUm.js","./dist-DkPPv0FB.js","./dist-Dw9YRsCU.js","./dist-CKUpxYGQ.js","./stex-Dc5bKD4z.js","./useTheme-C-ri8BtY.js","./useAsyncData-Buhk-UgR.js","./purify.es-DrVcFY1Q.js","./cells-D-c15Ks-.css","./chevron-right-CKA5zVsM.js","./circle-check-CUWv70QX.js","./circle-play-CQiat61_.js","./CellStatus-LChlPuPv.js","./ban-CwXfMsC1.js","./ellipsis-Dfik_tuW.js","./refresh-cw-Bf-rx_aV.js","./workflow-SJ9KZapt.js","./useDateFormatter-BiqAQ-zI.js","./en-US-yTIMUO13.js","./multi-icon-COhkNiC1.js","./multi-icon-CW3_9bja.css","./CellStatus-2Psjnl5F.css","./react-vega-C3-Qk46W.js","./vega-loader.browser-AQmjV9CX.js","./precisionRound-Bq_nmf5u.js","./defaultLocale-CNPGWpMu.js","./defaultLocale-Dm4DaIgg.js","./linear-BMUPXU7z.js","./init-ZlXS9mIS.js","./timer-DnhpN6F0.js","./ordinal-BdBDtYTt.js","./time-BWPrZCK3.js","./range-EplFIxc7.js","./path-BCdg30Y0.js","./math-Bi_r_ZWc.js","./arc-Yxk2k_uq.js","./array-BifhSqXX.js","./step-CqgdNM3U.js","./line-io_go0HI.js","./colors-Cg5Vh3br.js","./treemap-BfjIY-m6.js","./cell-link-B7ZVGcSl.js","./react-resizable-panels.browser.esm-BSRAHC4P.js","./bundle.esm-DzY74mzC.js","./empty-state-kWyb5dCS.js","./panel-context-CiVjnt80.js","./clear-button-ChT6NFcB.js","./runs-euHSzlw_.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CBDbhulC.js";import{t as n}from"./compiler-runtime-CYIjoINj.js";import{t as r}from"./jsx-runtime-B74pBk57.js";import{t as i}from"./spinner-Ck-Hgfvj.js";import{t as a}from"./preload-helper-HclGiUj8.js";var o=n(),s=e(t(),1),c=r(),l=s.lazy(()=>a(()=>import(`./tracing-CnQSHm2x.js`).then(e=>({default:e.Tracing})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113]),import.meta.url)),u=()=>{let e=(0,o.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,c.jsx)(s.Suspense,{fallback:(0,c.jsx)(d,{}),children:(0,c.jsx)(l,{})}),e[0]=t):t=e[0],t},d=()=>{let e=(0,o.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,c.jsx)(`div`,{className:`flex flex-col items-center justify-center h-full`,children:(0,c.jsx)(i,{})}),e[0]=t):t=e[0],t};export{u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CBDbhulC.js";import{$i as n}from"./cells-CMLP1Dld.js";import{t as r}from"./compiler-runtime-CYIjoINj.js";import{g as i}from"./useEventListener-92uWqz-P.js";import{t as a}from"./cn-ldLVeaqm.js";import{t as o}from"./jsx-runtime-B74pBk57.js";import{t as s}from"./tooltip-BvU0ko_d.js";import{t as c}from"./button-Dh8EwhsF.js";import{t as l}from"./createLucideIcon-B7HeEoG2.js";import{t as u}from"./chevron-right-CKA5zVsM.js";import{n as d,t as f}from"./eye-off-CFuPxa9F.js";import{t as p}from"./refresh-cw-Bf-rx_aV.js";var m=l(`chevrons-down-up`,[[`path`,{d:`m7 20 5-5 5 5`,key:`13a0gw`}],[`path`,{d:`m7 4 5 5 5-5`,key:`1kwcof`}]]),h={keyBy(e,t){let n=new Map,r=new Set;for(let i of e){let e=t(i);n.has(e)&&r.add(e),n.set(e,i)}return r.size>0&&i.trace(`Duplicate keys: ${[...r].join(`, `)}`),n},collect(e,t,n){return h.mapValues(h.keyBy(e,t),n)},filterMap(e,t){let n=new Map;for(let[r,i]of e)t(i,r)&&n.set(r,i);return n},mapValues(e,t){let n=new Map;for(let[r,i]of e)n.set(r,t(i,r));return n}},g=r(),_=e(t(),1),v=o(),y=e=>{let t=(0,g.c)(5),{isExpanded:n,className:r}=e,i=n&&`rotate-90`,o;t[0]!==r||t[1]!==i?(o=a(`shrink-0 transition-transform`,i,r),t[0]=r,t[1]=i,t[2]=o):o=t[2];let s;return t[3]===o?s=t[4]:(s=(0,v.jsx)(u,{className:o}),t[3]=o,t[4]=s),s},b=({onClick:e,tooltip:t=`Refresh`,className:n,iconClassName:r})=>{let[i,o]=(0,_.useState)(!1),l=(0,v.jsx)(c,{variant:`text`,size:`xs`,className:n,onClick:async t=>{o(!0);let n=new Promise(e=>setTimeout(e,500));try{await Promise.all([e(t),n])}finally{o(!1)}},children:(0,v.jsx)(p,{className:a(`h-4 w-4`,r,i&&`animate-[spin_0.5s]`)})});return(0,v.jsx)(s,{content:t,children:l})},x=e=>{let t=(0,g.c)(15),{isVisible:r,onToggle:i,showTooltip:o,hideTooltip:l,size:u,className:d,iconClassName:p,"data-testid":m}=e,h=u===void 0?`xs`:u,_=r?n:f,y=r?l:o,b=r&&`text-primary`,x;t[0]!==p||t[1]!==b?(x=a(`h-4 w-4`,b,p),t[0]=p,t[1]=b,t[2]=x):x=t[2];let S;t[3]!==_||t[4]!==x?(S=(0,v.jsx)(_,{className:x}),t[3]=_,t[4]=x,t[5]=S):S=t[5];let C;t[6]!==d||t[7]!==m||t[8]!==i||t[9]!==h||t[10]!==S?(C=(0,v.jsx)(c,{"data-testid":m,variant:`text`,size:h,className:d,onClick:i,children:S}),t[6]=d,t[7]=m,t[8]=i,t[9]=h,t[10]=S,t[11]=C):C=t[11];let w;return t[12]!==y||t[13]!==C?(w=(0,v.jsx)(s,{content:y,children:C}),t[12]=y,t[13]=C,t[14]=w):w=t[14],w},S=_.forwardRef((e,t)=>{let n=(0,g.c)(15),r,i,o;n[0]===e?(r=n[1],i=n[2],o=n[3]):({className:r,iconClassName:i,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=o);let s;n[4]===r?s=n[5]:(s=a(`mb-0 opacity-0 group-hover:opacity-100 transition-opacity`,r),n[4]=r,n[5]=s);let l;n[6]===i?l=n[7]:(l=a(`w-4 h-4`,i),n[6]=i,n[7]=l);let u;n[8]===l?u=n[9]:(u=(0,v.jsx)(d,{className:l}),n[8]=l,n[9]=u);let f;return n[10]!==o||n[11]!==t||n[12]!==s||n[13]!==u?(f=(0,v.jsx)(c,{ref:t,variant:`text`,tabIndex:-1,size:`xs`,className:s,"aria-label":`More options`,...o,children:u}),n[10]=o,n[11]=t,n[12]=s,n[13]=u,n[14]=f):f=n[14],f});S.displayName=`MoreActionsButton`;var C=`h-3.5 w-3.5 mr-2`;export{x as a,y as i,S as n,h as o,b as r,m as s,C as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e}from"./useEvent-xfs0Sn4r.js";import{D as t,Gt as n,Kt as r}from"./cells
|
|
1
|
+
import{l as e}from"./useEvent-xfs0Sn4r.js";import{D as t,Gt as n,Kt as r}from"./cells-CMLP1Dld.js";import{t as i}from"./compiler-runtime-CYIjoINj.js";import{c as a}from"./utils-D5Ywm7-q.js";var o=i();function s(){let i=(0,o.c)(4),s=e(a),c=n(),{createNewCell:l}=t(),u;return i[0]!==s||i[1]!==l||i[2]!==c?(u=e=>{e.includes(`alt`)&&r({autoInstantiate:s,createNewCell:l,fromCellId:c}),l({code:e,before:!1,cellId:c??`__end__`})},i[0]=s,i[1]=l,i[2]=c,i[3]=u):u=i[3],u}export{s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e,u as t}from"./useEvent-xfs0Sn4r.js";import{$i as ee,D as te,No as ne,Ti as re,Tt as n,Ui as ie,di as ae,ea as oe,na as se,qt as r,ra as i,ui as ce,v as le}from"./cells
|
|
1
|
+
import{l as e,u as t}from"./useEvent-xfs0Sn4r.js";import{$i as ee,D as te,No as ne,Ti as re,Tt as n,Ui as ie,di as ae,ea as oe,na as se,qt as r,ra as i,ui as ce,v as le}from"./cells-CMLP1Dld.js";import{t as a}from"./compiler-runtime-CYIjoINj.js";import{c as ue,i as de,s as fe}from"./utils-D5Ywm7-q.js";import{O as pe}from"./config-BuGkUPaK.js";import{t as o}from"./jsx-runtime-B74pBk57.js";import{d as me}from"./select-C1IYgK48.js";import{h as he,i as ge}from"./download-BRrPmrl5.js";import{r as _e}from"./requests-C6_IaFh7.js";import{t as s}from"./createLucideIcon-B7HeEoG2.js";import{i as ve}from"./paths-ClYq6Exe.js";import{a as ye,i as c}from"./useNumberFormatter-DHJ9s6Vk.js";import{t as be}from"./chevron-right-CKA5zVsM.js";import{t as xe}from"./code-xml-B7x62Eeh.js";import{t as Se}from"./eye-off-CFuPxa9F.js";import{t as Ce}from"./image-ab13yGv4.js";import{O as we,T as Te,b as Ee,j as De}from"./write-secret-modal-CSWlDX_Z.js";import{t as Oe}from"./link-Cap-MZiw.js";import{i as ke,t as Ae}from"./useDeleteCell-CM1QzkEs.js";import{t as je}from"./trash-2-D_HX-0qx.js";import{t as Me}from"./use-toast-DpWHUGuF.js";import{n as Ne}from"./copy-DlEomWzI.js";import{i as Pe}from"./useRunCells-C2e26LhV.js";import{n as Fe}from"./state-CJnYkzhz.js";import{n as Ie,t as Le}from"./icons-CjLa9BiH.js";import{n as l}from"./name-cell-input-DQ1AN_b1.js";import{t as u}from"./multi-icon-COhkNiC1.js";import{t as Re}from"./useSplitCell-CJ8nGq_h.js";var d=s(`chevrons-down`,[[`path`,{d:`m7 6 5 5 5-5`,key:`1lc07p`}],[`path`,{d:`m7 13 5 5 5-5`,key:`1d48rs`}]]),f=s(`chevrons-up`,[[`path`,{d:`m17 11-5-5-5 5`,key:`e8nh98`}],[`path`,{d:`m17 18-5-5-5 5`,key:`2avn1x`}]]),p=s(`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`}]]),ze=s(`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`}]]),m=s(`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`}]]),h=s(`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`}]]),Be=a();function Ve(e){let t=new URL(window.location.href);return t.hash=`scrollTo=${encodeURIComponent(e)}`,t.toString()}function g(e){let t=e.match(/scrollTo=([^&]+)/)?.[1];return t?decodeURIComponent(t.split(`&`)[0]):null}function _(e){return e!==`_`&&!!(e&&e.trim().length>0)}var v=o();function y(a){let o=(0,Be.c)(47),{cell:s,closePopover:g}=a,{createNewCell:y,updateCellConfig:b,updateCellName:x,moveCell:S,sendToTop:C,sendToBottom:w,addColumnBreakpoint:T,clearCellOutput:E,markUntouched:D}=te(),O=Re(),k=Pe(s?.cellId),A=!e(le),j=Ae(),{openModal:M}=Ee(),N=t(Fe),P=e(de),F=e(ue),Ge=e(pe),I=e(fe),{saveCellConfig:L}=_e();if(!s||Ge){let e;return o[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],o[0]=e):e=o[0],e}let{cellId:R,config:z,getEditorView:B,name:V,hasOutput:H,hasConsoleOutput:U,status:W}=s,G;o[1]!==R||o[2]!==z.disabled||o[3]!==L||o[4]!==b?(G=async()=>{let e={disabled:!z.disabled};await L({configs:{[R]:e}}),b({cellId:R,config:e})},o[1]=R,o[2]=z.disabled,o[3]=L,o[4]=b,o[5]=G):G=o[5];let K=G,q;o[6]!==R||o[7]!==z.hide_code||o[8]!==B||o[9]!==L||o[10]!==b?(q=async()=>{let e={hide_code:!z.hide_code};await L({configs:{[R]:e}}),b({cellId:R,config:e});let t=B();t&&(e.hide_code?t.contentDOM.blur():t.focus())},o[6]=R,o[7]=z.hide_code,o[8]=B,o[9]=L,o[10]=b,o[11]=q):q=o[11];let J=q,Y=R===ne,X;o[12]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,v.jsx)(ke,{size:13,strokeWidth:1.5}),o[12]=X):X=o[12];let Z=W===`running`||W===`queued`||W===`disabled-transitively`||z.disabled,Q;o[13]===k?Q=o[14]:(Q=()=>k(),o[13]=k,o[14]=Q);let $;return o[15]!==T||o[16]!==P||o[17]!==I||o[18]!==F||o[19]!==A||o[20]!==R||o[21]!==E||o[22]!==g||o[23]!==z.disabled||o[24]!==z.hide_code||o[25]!==y||o[26]!==j||o[27]!==B||o[28]!==U||o[29]!==H||o[30]!==Y||o[31]!==D||o[32]!==S||o[33]!==V||o[34]!==M||o[35]!==L||o[36]!==w||o[37]!==C||o[38]!==N||o[39]!==O||o[40]!==Z||o[41]!==Q||o[42]!==K||o[43]!==J||o[44]!==b||o[45]!==x?($=[[{icon:X,label:`Run cell`,hotkey:`cell.run`,hidden:Z,redundant:!0,handle:Q},{icon:(0,v.jsx)(ie,{size:13,strokeWidth:1.5}),label:`Refactor with AI`,hidden:!P,handle:()=>{N(e=>e?.cellId===R?null:{cellId:R})},hotkey:`cell.aiCompletion`},{icon:(0,v.jsx)(p,{size:13,strokeWidth:1.5}),label:`Split`,hotkey:`cell.splitCell`,handle:()=>O({cellId:R})},{icon:(0,v.jsx)(xe,{size:13,strokeWidth:1.5}),label:`Format`,hotkey:`cell.format`,handle:()=>{let e=B();e&&re({[R]:e})}},{icon:z.hide_code?(0,v.jsx)(ee,{size:13,strokeWidth:1.5}):(0,v.jsx)(Se,{size:13,strokeWidth:1.5}),label:z.hide_code?`Show code`:`Hide code`,handle:J,hotkey:`cell.hideCode`},{icon:z.disabled?(0,v.jsx)(m,{size:13,strokeWidth:1.5}):(0,v.jsx)(h,{size:13,strokeWidth:1.5}),label:z.disabled?`Enable execution`:`Disable execution`,handle:K,hidden:Y}],[{icon:(0,v.jsx)(Le,{}),label:`Convert to Markdown`,hotkey:`cell.viewAsMarkdown`,handle:async()=>{let e=B();e&&(r({autoInstantiate:F,createNewCell:y}),n(e,{language:`markdown`,keepCodeAsIs:!1}),z.hide_code||(await L({configs:{[R]:{hide_code:!0}}}),b({cellId:R,config:{hide_code:!0}}),D({cellId:R})))},hidden:Y},ce(B())===`sql`?{icon:(0,v.jsx)(Ie,{}),label:`View as Python`,hotkey:`cell.viewAsSQL`,handle:()=>{let e=B();e&&ae(e,`python`,{force:!0})},hidden:Y}:{icon:(0,v.jsx)(ve,{size:13,strokeWidth:1.5}),label:`Convert to SQL`,hotkey:`cell.viewAsSQL`,handle:()=>{let e=B();e&&(r({autoInstantiate:F,createNewCell:y}),n(e,{language:`sql`,keepCodeAsIs:!1}))},hidden:Y}],[{icon:(0,v.jsxs)(u,{children:[(0,v.jsx)(i,{size:13,strokeWidth:1.5}),(0,v.jsx)(c,{size:8,strokeWidth:2})]}),label:`Create cell above`,hotkey:`cell.createAbove`,handle:()=>y({cellId:R,before:!0}),hidden:Y,redundant:!0},{icon:(0,v.jsxs)(u,{children:[(0,v.jsx)(i,{size:13,strokeWidth:1.5}),(0,v.jsx)(ye,{size:8,strokeWidth:2})]}),label:`Create cell below`,hotkey:`cell.createBelow`,handle:()=>y({cellId:R,before:!1}),redundant:!0},{icon:(0,v.jsx)(c,{size:13,strokeWidth:1.5}),label:`Move cell up`,hotkey:`cell.moveUp`,handle:()=>S({cellId:R,before:!0}),hidden:Y},{icon:(0,v.jsx)(ye,{size:13,strokeWidth:1.5}),label:`Move cell down`,hotkey:`cell.moveDown`,handle:()=>S({cellId:R,before:!1}),hidden:Y},{icon:(0,v.jsx)(he,{size:13,strokeWidth:1.5}),label:`Move cell left`,hotkey:`cell.moveLeft`,handle:()=>S({cellId:R,direction:`left`}),hidden:I!==`columns`||Y},{icon:(0,v.jsx)(be,{size:13,strokeWidth:1.5}),label:`Move cell right`,hotkey:`cell.moveRight`,handle:()=>S({cellId:R,direction:`right`}),hidden:I!==`columns`||Y},{icon:(0,v.jsx)(f,{size:13,strokeWidth:1.5}),label:`Send to top`,hotkey:`cell.sendToTop`,handle:()=>C({cellId:R,scroll:!1}),hidden:Y},{icon:(0,v.jsx)(d,{size:13,strokeWidth:1.5}),label:`Send to bottom`,hotkey:`cell.sendToBottom`,handle:()=>w({cellId:R,scroll:!1}),hidden:Y},{icon:(0,v.jsx)(oe,{size:13,strokeWidth:1.5}),label:`Break into new column`,hotkey:`cell.addColumnBreakpoint`,handle:()=>T({cellId:R}),hidden:I!==`columns`||Y}],[{icon:(0,v.jsx)(Ce,{size:13,strokeWidth:1.5}),label:`Export output as PNG`,hidden:!H,handle:()=>ge(R,`result`)},{icon:(0,v.jsx)(se,{size:13,strokeWidth:1.5}),label:`Clear output`,hidden:!(H||U),handle:()=>{E({cellId:R})}}],[{icon:(0,v.jsx)(ze,{size:13,strokeWidth:1.5}),label:`Name`,disableClick:!0,handle:We,handleHeadless:()=>{M((0,v.jsxs)(Te,{children:[(0,v.jsx)(we,{children:(0,v.jsx)(De,{children:`Rename cell`})}),(0,v.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,v.jsx)(me,{htmlFor:`cell-name`,children:`Cell name`}),(0,v.jsx)(l,{placeholder:`cell name`,value:V,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),M(null))},onChange:e=>x({cellId:R,name:e})})]})]}))},rightElement:(0,v.jsx)(l,{placeholder:`cell name`,value:V,onChange:e=>x({cellId:R,name:e}),onEnterKey:()=>g?.()}),hidden:Y},{icon:(0,v.jsx)(Oe,{size:13,strokeWidth:1.5}),label:`Copy link to cell`,disabled:!_(V),tooltip:_(V)?void 0:`Only named cells can be linked to`,handle:async()=>{await Ne(Ve(V)),Me({description:`Link copied to clipboard`})}}],[{label:`Delete`,hidden:!A,variant:`danger`,icon:(0,v.jsx)(je,{size:13,strokeWidth:1.5}),handle:()=>{j({cellId:R})}}]].map(Ue).filter(He),o[15]=T,o[16]=P,o[17]=I,o[18]=F,o[19]=A,o[20]=R,o[21]=E,o[22]=g,o[23]=z.disabled,o[24]=z.hide_code,o[25]=y,o[26]=j,o[27]=B,o[28]=U,o[29]=H,o[30]=Y,o[31]=D,o[32]=S,o[33]=V,o[34]=M,o[35]=L,o[36]=w,o[37]=C,o[38]=N,o[39]=O,o[40]=Z,o[41]=Q,o[42]=K,o[43]=J,o[44]=b,o[45]=x,o[46]=$):$=o[46],$}function He(e){return e.length>0}function Ue(e){return e.filter(b)}function b(e){return!e.hidden}function We(e){e?.stopPropagation(),e?.preventDefault()}export{p as a,m as i,g as n,f as o,h as r,d as s,y as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,t}from"./useEvent-xfs0Sn4r.js";import{D as n,b as r,v as i}from"./cells
|
|
1
|
+
import{r as e,t}from"./useEvent-xfs0Sn4r.js";import{D as n,b as r,v as i}from"./cells-CMLP1Dld.js";import{t as a}from"./compiler-runtime-CYIjoINj.js";import{t as o}from"./useEventListener-92uWqz-P.js";import{t as s}from"./jsx-runtime-B74pBk57.js";import{t as c}from"./button-Dh8EwhsF.js";import{r as l}from"./requests-C6_IaFh7.js";import{t as u}from"./createLucideIcon-B7HeEoG2.js";import{t as d}from"./use-toast-DpWHUGuF.js";import{n as f}from"./renderShortcut-BE8QI9Yi.js";var p=u(`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`}]]),m=a(),h=s(),g=e=>{let t=(0,m.c)(7),n;t[0]===e?n=t[1]:(n=t=>{(t.ctrlKey||t.metaKey)&&t.key===`z`&&(t.preventDefault(),t.stopPropagation(),e.onClick?.(t))},t[0]=e,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r={capture:!0},t[2]=r):r=t[2],o(window,`keydown`,n,r);let i=e.children??`Undo`,a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,h.jsx)(f,{className:`ml-2`,shortcut:`cmd-z`}),t[3]=a):a=t[3];let s;return t[4]!==i||t[5]!==e?(s=(0,h.jsxs)(c,{"data-testid":`undo-button`,size:`sm`,variant:`outline`,...e,children:[i,` `,a]}),t[4]=i,t[5]=e,t[6]=s):s=t[6],s};function _(){let a=(0,m.c)(4),{deleteCell:o,undoDeleteCell:s}=n(),{sendDeleteCell:c}=l(),u;return a[0]!==o||a[1]!==c||a[2]!==s?(u=t=>{if(e.get(i))return;let{cellId:n}=t,a=(e.get(r).cellData[n]?.code??``).trim()===``;if(o({cellId:n}),c({cellId:n}).catch(()=>{s()}),!a){let{dismiss:e}=d({title:`Cell deleted`,description:`You can bring it back by clicking undo or through the command palette.`,action:(0,h.jsx)(g,{"data-testid":`undo-delete-button`,onClick:()=>{s(),t()}})}),t=e}},a[0]=o,a[1]=c,a[2]=s,a[3]=u):u=a[3],t(u)}function v(){let r=(0,m.c)(4),{deleteCell:a,undoDeleteCell:o}=n(),{sendDeleteCell:s}=l(),c;return r[0]!==a||r[1]!==s||r[2]!==o?(c=async t=>{if(e.get(i))return;let{cellIds:n}=t;for(let e of n)await s({cellId:e}).then(()=>{a({cellId:e})});let{dismiss:r}=d({title:`Cells deleted`,action:(0,h.jsx)(g,{"data-testid":`undo-delete-button`,onClick:()=>{for(let e of n)o();c()}})}),c=r},r[0]=a,r[1]=s,r[2]=o,r[3]=c):c=r[3],t(c)}export{p as i,v as n,g as r,_ as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,f as n,l as r,t as i,u as a}from"./useEvent-xfs0Sn4r.js";import{t as o}from"./react-CBDbhulC.js";import{An as s,Cn as c,En as ee,Hn as l,K as u,Sn as d,Vt as f,_n as p,hn as m,vn as h,wn as g,xn as _,yn as v}from"./cells
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,f as n,l as r,t as i,u as a}from"./useEvent-xfs0Sn4r.js";import{t as o}from"./react-CBDbhulC.js";import{An as s,Cn as c,En as ee,Hn as l,K as u,Sn as d,Vt as f,_n as p,hn as m,vn as h,wn as g,xn as _,yn as v}from"./cells-CMLP1Dld.js";import{t as y}from"./compiler-runtime-CYIjoINj.js";import{t as b}from"./cn-ldLVeaqm.js";import{t as x}from"./jsx-runtime-B74pBk57.js";import{d as te}from"./alert-dialog-CA-2mBs3.js";import{a as ne,n as re,o as ie,t as ae}from"./tooltip-BvU0ko_d.js";import{t as oe}from"./useCellActionButton-BQY2nyr_.js";import{a as se,i as ce}from"./renderShortcut-BE8QI9Yi.js";var S=y(),C=e(o(),1),w=x(),T=C.memo(C.forwardRef((e,t)=>{let n=(0,S.c)(39),{children:r,showTooltip:a,...o}=e,f=a===void 0||a,[y,x]=(0,C.useState)(!1),T;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>x(!1),n[0]=T):T=n[0];let E=T,D=(0,C.useRef)(null),j=oe({cell:o,closePopover:E}).map(O).filter(k),M=te(),N;n[1]===Symbol.for(`react.memo_cache_sentinel`)?(N=()=>{u(()=>{D.current&&D.current.scrollIntoView({behavior:`auto`,block:`nearest`})})},n[1]=N):N=n[1];let P=i(N),F;n[2]===P?F=n[3]:(F=e=>{x(t=>{let n=typeof e==`function`?e(t):e;return n&&P(),n})},n[2]=P,n[3]=F);let I=i(F),L;n[4]===I?L=n[5]:(L=()=>({toggle:()=>I(A)}),n[4]=I,n[5]=L),(0,C.useImperativeHandle)(t,L);let R=p,z=v,B=l(o.cellId),V;n[6]===B?V=n[7]:(V=(0,w.jsx)(c,{placeholder:`Search actions...`,className:`h-6 m-1`,...B}),n[6]=B,n[7]=V);let H=s,U;n[8]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,w.jsx)(_,{children:`No results`}),n[8]=U):U=n[8];let W=j.map((e,t)=>(0,w.jsxs)(C.Fragment,{children:[(0,w.jsx)(d,{children:e.map(e=>{let t=(0,w.jsxs)(`div`,{className:`flex items-center flex-1`,children:[e.icon&&(0,w.jsx)(`div`,{className:`mr-2 w-5 text-muted-foreground`,children:e.icon}),(0,w.jsx)(`div`,{className:`flex-1`,children:e.label}),(0,w.jsxs)(`div`,{className:`shrink-0 text-sm`,children:[e.hotkey&&ce(e.hotkey),e.rightElement]})]});return e.tooltip&&(t=(0,w.jsx)(ae,{content:e.tooltip,delayDuration:100,children:t})),(0,w.jsx)(g,{className:b(e.disabled&&`opacity-50!`),onSelect:()=>{e.disableClick||e.disabled||(e.handle(),x(!1))},variant:e.variant,children:t},e.label)})},t),t<j.length-1&&(0,w.jsx)(ee,{})]},t)),G;n[9]!==H||n[10]!==U||n[11]!==W?(G=(0,w.jsxs)(H,{children:[U,W]}),n[9]=H,n[10]=U,n[11]=W,n[12]=G):G=n[12];let K;n[13]!==z||n[14]!==G||n[15]!==V?(K=(0,w.jsxs)(z,{children:[V,G]}),n[13]=z,n[14]=G,n[15]=V,n[16]=K):K=n[16];let q;n[17]!==R||n[18]!==M||n[19]!==K?(q=(0,w.jsx)(R,{className:`w-[300px] p-0 pt-1 overflow-auto`,scrollable:!0,...M,children:K}),n[17]=R,n[18]=M,n[19]=K,n[20]=q):q=n[20];let J=q;if(!f){let e;n[21]===r?e=n[22]:(e=(0,w.jsx)(h,{asChild:!0,children:r}),n[21]=r,n[22]=e);let t;return n[23]!==J||n[24]!==I||n[25]!==y||n[26]!==e?(t=(0,w.jsxs)(m,{open:y,onOpenChange:I,children:[e,J]}),n[23]=J,n[24]=I,n[25]=y,n[26]=e,n[27]=t):t=n[27],t}let Y;n[28]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,w.jsx)(re,{tabIndex:-1,children:se(`cell.cellActions`)}),n[28]=Y):Y=n[28];let X=!y&&Y,Z;n[29]===r?Z=n[30]:(Z=(0,w.jsx)(ie,{ref:D,children:(0,w.jsx)(h,{className:`flex`,children:r})}),n[29]=r,n[30]=Z);let Q;n[31]!==X||n[32]!==Z?(Q=(0,w.jsxs)(ne,{delayDuration:200,disableHoverableContent:!0,children:[X,Z]}),n[31]=X,n[32]=Z,n[33]=Q):Q=n[33];let $;return n[34]!==J||n[35]!==I||n[36]!==y||n[37]!==Q?($=(0,w.jsxs)(m,{open:y,onOpenChange:I,children:[Q,J]}),n[34]=J,n[35]=I,n[36]=y,n[37]=Q,n[38]=$):$=n[38],$})),E=C.memo(e=>{let t=(0,S.c)(5),{children:n,cellId:i}=e,a;t[0]===i?a=t[1]:(a=f(i),t[0]=i,t[1]=a);let o=r(a);if(!o)return null;let s;return t[2]!==n||t[3]!==o?(s=(0,w.jsx)(T,{showTooltip:!1,...o,children:n}),t[2]=n,t[3]=o,t[4]=s):s=t[4],s});E.displayName=`ConnectionCellActionsDropdown`;function D(e){return!e.redundant}function O(e){return e.filter(D)}function k(e){return e.length>0}function A(e){return!e}var j=n(`minimap`);function M(){let e=(0,S.c)(3),[n,r]=t(j),i;return e[0]!==n||e[1]!==r?(i={dependencyPanelTab:n,setDependencyPanelTab:r},e[0]=n,e[1]=r,e[2]=i):i=e[2],i}function N(){return a(j)}export{E as i,N as n,T as r,M as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{f as t,u as n}from"./useEvent-xfs0Sn4r.js";import{t as r}from"./react-CBDbhulC.js";import{X as i}from"./cells
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{f as t,u as n}from"./useEvent-xfs0Sn4r.js";import{t as r}from"./react-CBDbhulC.js";import{X as i}from"./cells-CMLP1Dld.js";import{t as a}from"./compiler-runtime-CYIjoINj.js";import{g as o}from"./useEventListener-92uWqz-P.js";import{T as s,v as c}from"./config-BuGkUPaK.js";import{t as l}from"./jsx-runtime-B74pBk57.js";import{o as u}from"./alert-dialog-CA-2mBs3.js";import{r as d}from"./requests-C6_IaFh7.js";import{b as f}from"./write-secret-modal-CSWlDX_Z.js";import{t as p}from"./use-toast-DpWHUGuF.js";import{t as m}from"./kbd-Cwh96ZBE.js";var h=e(r(),1),g=a();function _(){try{window.location.reload()}catch(e){o.error(`Failed to reload page`,e),p({title:`Failed to reload page`,description:`Please refresh the page manually.`})}}var v=t(null),y=`packages-install-input`,b=()=>{requestAnimationFrame(()=>{let e=document.getElementById(y);e&&e.focus()})},x=e=>{e.openApplication(`packages`),b()},S=l();function C(){let e=(0,g.c)(4),{openConfirm:t}=f(),r=n(c),{sendRestart:i}=d(),a;return e[0]!==t||e[1]!==i||e[2]!==r?(a=()=>{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,S.jsx)(u,{onClick:async()=>{r({state:s.CLOSING}),await i(),_()},"aria-label":`Confirm Restart`,children:`Restart`})})},e[0]=t,e[1]=i,e[2]=r,e[3]=a):a=e[3],a}var w=`Your dependency changes are saved. Restart the kernel to use the updated environment. Restarting clears in-memory variables.`,T=()=>{let e=(0,g.c)(2),t=C(),n;return e[0]===t?n=e[1]:(n=(0,S.jsx)(i,{altText:`Restart the kernel to use the updated dependencies`,onClick:t,children:`Restart Kernel`}),e[0]=t,e[1]=n),n},E=()=>{p({title:`Changes saved — restart required`,description:w,duration:1/0,action:(0,S.jsx)(T,{})})},D=(e,t)=>{let n=Array.isArray(e)?e:[e];p(t?{title:n.length>1?`Failed to add packages`:`Failed to add package`,description:t,variant:`danger`}:{title:n.length>1?`Packages added`:`Package added`,description:(0,S.jsxs)(`div`,{children:[(0,S.jsxs)(`div`,{children:[n.length>1?`The packages `:`The package `,n.map((e,t)=>(0,S.jsxs)(`span`,{children:[t>0&&`, `,(0,S.jsx)(m,{className:`inline`,children:e})]},e)),` `,`and `,n.length>1?`their`:`its`,` dependencies have been added to your environment.`]}),(0,S.jsx)(`div`,{className:`text-xs text-muted-foreground mt-1`,children:`Some Python packages may require a kernel restart to see changes.`})]})})},O=(e,t)=>{p(t?{title:`Failed to upgrade package`,description:t,variant:`danger`}:{title:`Package upgraded`,description:(0,S.jsxs)(`div`,{children:[(0,S.jsxs)(`div`,{children:[`The package `,(0,S.jsx)(m,{className:`inline`,children:e}),` has been upgraded.`]}),(0,S.jsx)(`div`,{className:`text-xs text-muted-foreground mt-1`,children:`Some Python packages may require a kernel restart to see changes.`})]})})},k=(e,t)=>{p(t?{title:`Failed to remove package`,description:t,variant:`danger`}:{title:`Package removed`,description:(0,S.jsxs)(`div`,{children:[(0,S.jsxs)(`div`,{children:[`The package `,(0,S.jsx)(m,{className:`inline`,children:e}),` has been removed from your environment.`]}),(0,S.jsx)(`div`,{className:`text-xs text-muted-foreground mt-1`,children:`Some Python packages may require a kernel restart to see changes.`})]})})};function A(){let[e,t]=(0,h.useState)(!1),{addPackage:n}=d();return{loading:e,handleInstallPackages:async(e,r)=>{t(!0);try{let t=await n({package:e.join(` `)});t.restartRequired?E():t.success?D(e):D(e,t.error),r?.()}catch(e){o.error(e)}finally{t(!1)}}}}export{O as a,b as c,_ as d,k as i,x as l,w as n,C as o,E as r,y as s,A as t,v as u};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,f as n,l as r,r as i,u as a}from"./useEvent-xfs0Sn4r.js";import{t as o}from"./react-CBDbhulC.js";import{$i as s,$r as c,D as l,E as u,Et as d,Hi as f,Pa as p,Ui as m,Yr as h,_ as g,b as _,bo as v,dn as y,do as b,ei as x,fi as S,fn as C,go as w,h as T,ia as E,ii as D,jo as O,na as k,qn as A,ri as j,sr as M,t as N,ti as P,zt as F}from"./cells-CMLP1Dld.js";import{Cn as I,kt as L,vt as R}from"./schemas-aTUejmFi.js";import{t as z}from"./compiler-runtime-CYIjoINj.js";import{r as ee,w as B}from"./utils-D5Ywm7-q.js";import{C as V,n as H,r as U}from"./ai-model-dropdown-DyZHVnJV.js";import{g as W,n as G}from"./useEventListener-92uWqz-P.js";import{t as K}from"./objects-snlMn4yk.js";import{n as q,t as J}from"./constants-BDbGiS7O.js";import{A as te,M as ne,N as re,O as ie,T as ae,j as oe,k as se,v as ce}from"./config-BuGkUPaK.js";import{t as le}from"./switch-DhPDzMo3.js";import{g as ue,h as de,m as fe,y as pe}from"./readonly-python-code-Cvz_-5Jh.js";import{t as me}from"./cn-ldLVeaqm.js";import{t as he}from"./jsx-runtime-B74pBk57.js";import{i as ge,n as _e,r as ve,t as ye}from"./tabs-Cy1qXLzH.js";import{a as be,c as xe,i as Se,n as Ce,r as we,s as Te,t as Ee}from"./select-C1IYgK48.js";import{$ as De,Lt as Oe}from"./JsonOutput-DCgOfk7t.js";import{a as ke,c as Ae,o as je,p as Me,t as Ne}from"./download-BRrPmrl5.js";import{t as Pe}from"./tooltip-BvU0ko_d.js";import{n as Fe,r as Ie,t as Le}from"./button-Dh8EwhsF.js";import{i as Re,r as ze,t as Be}from"./strings-CReV1AYG.js";import{r as Ve}from"./requests-C6_IaFh7.js";import{t as Y}from"./createLucideIcon-B7HeEoG2.js";import{a as He,i as Ue,n as We,r as Ge,t as Ke}from"./paths-ClYq6Exe.js";import{L as qe,R as Je,c as Ye,l as Xe,t as Ze,z as Qe}from"./layout-DUWWt2Qy.js";import{t as $e}from"./check-BoA6XBpj.js";import{r as et}from"./useCellActionButton-BQY2nyr_.js";import{t as tt}from"./code-CF0HKE9K.js";import{t as nt}from"./copy-BMXKNElG.js";import{t as rt}from"./eye-off-CFuPxa9F.js";import{t as it}from"./external-link-Bp3BxyRA.js";import{t as at}from"./file-DF8n85RA.js";import{t as ot}from"./globe-BQf75qV_.js";import{n as st,r as ct,t as lt}from"./youtube-DCJ-ihUU.js";import{n as ut}from"./components-DUYCXngU.js";import{i as dt,n as ft,r as pt}from"./markdown-export-0rLbaq8b.js";import{t as mt}from"./image-ab13yGv4.js";import{D as ht,E as gt,O as _t,T as vt,b as yt,j as bt}from"./write-secret-modal-CSWlDX_Z.js";import{t as xt}from"./link-Cap-MZiw.js";import{t as St}from"./spinner-Ck-Hgfvj.js";import{r as Ct}from"./input-DEbY281O.js";import{t as wt}from"./settings-C-cYas75.js";import{t as Tt}from"./square-B58Ib8Ir.js";import{t as Et}from"./triangle-alert-MihykDYG.js";import{t as Dt}from"./use-toast-DpWHUGuF.js";import{o as Ot}from"./session-Sz5nSFku.js";import{n as kt}from"./useAsyncData-Buhk-UgR.js";import{n as At}from"./copy-DlEomWzI.js";import{t as jt}from"./copy-icon-BUOcnUgJ.js";import{r as Mt}from"./useRunCells-C2e26LhV.js";import{o as Nt}from"./useInstallPackage-Cr0TevQm.js";import{t as Pt}from"./share-BZW3tzEX.js";import{n as Ft,t as It}from"./alert-dmKwNsrp.js";import{a as Lt}from"./cell-link-B7ZVGcSl.js";import{t as Rt}from"./icons-CjLa9BiH.js";import{i as zt,n as Bt}from"./error-entries-Bc5lubx5.js";import{t as Vt}from"./shell-DLpUCctE.js";import{t as Ht}from"./pair-with-agent-modal-DYvcjx3q.js";import{i as Ut,n as Wt,r as Gt}from"./add-connection-dialog-1fPdJRRj.js";import{t as Kt}from"./github-YRgb6LMu.js";import{n as qt}from"./marimo-icons-C3KxMV9A.js";import{t as Jt}from"./links-DLvOXyO_.js";import{i as Yt,n as Xt,t as Zt}from"./skeleton-SCiqCq0i.js";var Qt=Y(`circle-chevron-down`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 10-4 4-4-4`,key:`894hmk`}]]),$t=Y(`circle-chevron-right`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m10 8 4 4-4 4`,key:`1wy4r4`}]]),en=Y(`clipboard-copy`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2`,key:`4jdomd`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v4`,key:`3hqy98`}],[`path`,{d:`M21 14H11`,key:`1bme5i`}],[`path`,{d:`m15 10-4 4 4 4`,key:`5dvupr`}]]),tn=Y(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),nn=Y(`command`,[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]),rn=Y(`diamond-plus`,[[`path`,{d:`M12 8v8`,key:`napkw2`}],[`path`,{d:`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41L13.7 2.71a2.41 2.41 0 0 0-3.41 0z`,key:`1ey20j`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]]),an=Y(`fast-forward`,[[`path`,{d:`M12 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 12 18z`,key:`b19h5q`}],[`path`,{d:`M2 6a2 2 0 0 1 3.414-1.414l6 6a2 2 0 0 1 0 2.828l-6 6A2 2 0 0 1 2 18z`,key:`h7h5ge`}]]),on=Y(`files`,[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`,key:`14sh0y`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`,key:`1970lx`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]]),sn=Y(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),cn=Y(`message-circle-question-mark`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),ln=Y(`notebook`,[[`path`,{d:`M2 6h4`,key:`aawbzj`}],[`path`,{d:`M2 10h4`,key:`l0bgd4`}],[`path`,{d:`M2 14h4`,key:`1gsvsf`}],[`path`,{d:`M2 18h4`,key:`1bu2t1`}],[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,key:`1nb95v`}],[`path`,{d:`M16 2v20`,key:`rotuqe`}]]),un=Y(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),dn=Y(`presentation`,[[`path`,{d:`M2 3h20`,key:`91anmk`}],[`path`,{d:`M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3`,key:`2k9sn8`}],[`path`,{d:`m7 21 5-5 5 5`,key:`bip4we`}]]),fn=Y(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),pn=Y(`square-power`,[[`path`,{d:`M12 7v4`,key:`xawao1`}],[`path`,{d:`M7.998 9.003a5 5 0 1 0 8-.005`,key:`1pek45`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),mn=Y(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),X=he(),Z=z(),Q=e(o(),1);function hn(e,t){let n=(0,Z.c)(11),r;n[0]===t?r=n[1]:(r=new b(t),n[0]=t,n[1]=r);let i=r,a;n[2]!==e||n[3]!==i?(a=()=>i.get(e),n[2]=e,n[3]=i,n[4]=a):a=n[4];let[o,s]=(0,Q.useState)(a),c;n[5]!==e||n[6]!==i?(c=t=>{s(t),i.set(e,t)},n[5]=e,n[6]=i,n[7]=c):c=n[7];let l=c,u;return n[8]!==l||n[9]!==o?(u=[o,l],n[8]=l,n[9]=o,n[10]=u):u=n[10],u}function gn(e,t){return{...e,Binaries:{...e.Binaries,Browser:t}}}function _n(e,t,n,r){return{marimo:e,Locale:n||void 0,Binaries:{Browser:t},"Environment Collection Error":r}}function vn(e,t){let n=Math.max(2,...Array.from(t.matchAll(/`+/g),e=>e[0].length)),r="`".repeat(n+1);return`${r}${e}\n${t}\n${r}`}function yn(e,t){let n=e.includes(`?`)?`&`:`?`,r=[],i=e,a=0;for(let[e,o]of Object.entries(t)){if(o.length===0)continue;let t=`${e}=${encodeURIComponent(o)}`,s=`${i}${a===0?n:`&`}${t}`;if(s.length>6e3){r.push(e);continue}i=s,a+=1}return{url:i,omitted:r}}function bn(e,t){return[`<details>`,`<summary>${Be.htmlEscape(e)??``}</summary>`,``,t,``,`</details>`].join(`
|
|
2
|
+
`)}function xn(e){return bn(`Environment`,vn(`json`,JSON.stringify(e,null,2)))}function Sn(e){return bn(`Errors`,vn(`text`,e.map(Bt).join(`
|
|
3
|
+
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
`)))}function Cn(e){return bn(`Code`,vn(`python`,e))}var wn=G,Tn=e=>{let t=(0,Z.c)(16),{content:n}=e,[r,i]=(0,Q.useState)(!1),a=!r&&`max-h-24 overflow-hidden`,o;t[0]===a?o=t[1]:(o=me(`text-xs bg-muted rounded p-2 overflow-x-auto whitespace-pre-wrap`,a),t[0]=a,t[1]=o);let s;t[2]!==n||t[3]!==o?(s=(0,X.jsx)(`pre`,{className:o,children:n}),t[2]=n,t[3]=o,t[4]=s):s=t[4];let c;t[5]===r?c=t[6]:(c=!r&&(0,X.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-0 h-10 rounded-b bg-gradient-to-b from-transparent to-muted`}),t[5]=r,t[6]=c);let l;t[7]!==s||t[8]!==c?(l=(0,X.jsxs)(`div`,{className:`relative`,children:[s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9];let u;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>i(On),t[10]=u):u=t[10];let d=r?`Show less`:`Show more`,f;t[11]===d?f=t[12]:(f=(0,X.jsx)(Le,{type:`button`,variant:`link`,size:`xs`,className:`self-start`,onClick:u,children:d}),t[11]=d,t[12]=f);let p;return t[13]!==l||t[14]!==f?(p=(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[l,f]}),t[13]=l,t[14]=f,t[15]=p):p=t[15],p},En=e=>{let t=(0,Z.c)(6),{children:n}=e,{openModal:r,closeModal:i}=yt(),a;t[0]!==i||t[1]!==r?(a=()=>r((0,X.jsx)(Dn,{onClose:i})),t[0]=i,t[1]=r,t[2]=a):a=t[2];let o;return t[3]!==n||t[4]!==a?(o=(0,X.jsx)(wn,{onClick:a,children:n}),t[3]=n,t[4]=a,t[5]=o):o=t[5],o},Dn=()=>{let e=(0,Z.c)(54),{getEnvironmentInfo:t,readCode:n}=Ve(),a,o;e[0]===t?(a=e[1],o=e[2]):(a=async()=>t(),o=[t],e[0]=t,e[1]=a,e[2]=o);let s=kt(a,o),c=r(_),l=zt(i),u;if(e[3]!==c.cellData||e[4]!==c.cellIds.inOrderIds){let t;e[6]===c.cellData?t=e[7]:(t=e=>c.cellData[e],e[6]=c.cellData,e[7]=t),u=c.cellIds.inOrderIds.map(t),e[3]=c.cellData,e[4]=c.cellIds.inOrderIds,e[5]=u}else u=e[5];let d=Xe(u),f=r(w),p=r(ce),m=f!==null&&d&&p.state===ae.OPEN,h=m?void 0:f===null?`Save the notebook first.`:d?`Connect the notebook to include its source.`:`Notebook source is hidden in this view.`,[g,v]=hn(`marimo:issue-report:include-errors`,!1),[y,b]=hn(`marimo:issue-report:include-code`,!1),x=s.data?gn(s.data,navigator.userAgent):s.status===`error`?_n(pe(),navigator.userAgent,navigator.language,`Server environment information unavailable`):void 0,S,C;e[8]!==y||e[9]!==m||e[10]!==n?(S=async()=>{if(!y||!m)return;let{contents:e}=await n();return e},C=[y,m,n],e[8]=y,e[9]=m,e[10]=n,e[11]=S,e[12]=C):(S=e[11],C=e[12]);let T=kt(S,C),E=q.bugReportUrl,D=[];if(x){let e={env:xn(x)};g&&l.length>0&&(e[`bug-description`]=Sn(l)),y&&T.data&&(e[`reproduction-code`]=Cn(T.data)),{url:E,omitted:D}=yn(q.bugReportUrl,e)}let O=D.map(kn).join(`, `),k;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,X.jsxs)(_t,{children:[(0,X.jsx)(bt,{children:`Report an issue`}),(0,X.jsx)(gt,{children:`Open a GitHub bug report prefilled with your environment, and optionally your current errors and notebook code. Nothing is uploaded automatically; review the details before posting.`})]}),e[13]=k):k=e[13];let j;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,X.jsx)(it,{className:`w-4 h-4 mr-2`}),e[14]=j):j=e[14];let M=l.length===0,N;e[15]===v?N=e[16]:(N=e=>v(e===!0),e[15]=v,e[16]=N);let P;e[17]!==g||e[18]!==M||e[19]!==N?(P=(0,X.jsx)(A,{id:`issue-include-errors`,checked:g,disabled:M,onCheckedChange:N,"aria-label":`Include errors`}),e[17]=g,e[18]=M,e[19]=N,e[20]=P):P=e[20];let F;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,X.jsx)(`label`,{htmlFor:`issue-include-errors`,children:`Include errors`}),e[21]=F):F=e[21];let I;e[22]===P?I=e[23]:(I=(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[P,F]}),e[22]=P,e[23]=I);let L=!m,R;e[24]===b?R=e[25]:(R=e=>b(e===!0),e[24]=b,e[25]=R);let z;e[26]!==y||e[27]!==L||e[28]!==R?(z=(0,X.jsx)(A,{id:`issue-include-code`,checked:y,disabled:L,onCheckedChange:R,"aria-label":`Include notebook code`}),e[26]=y,e[27]=L,e[28]=R,e[29]=z):z=e[29];let ee;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,X.jsx)(`label`,{htmlFor:`issue-include-code`,children:`Include notebook code`}),e[30]=ee):ee=e[30];let B;e[31]===z?B=e[32]:(B=(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[z,ee]}),e[31]=z,e[32]=B);let V;e[33]===h?V=e[34]:(V=h&&(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground ml-6`,children:h}),e[33]=h,e[34]=V);let H;e[35]!==T||e[36]!==y?(H=y&&T.status===`error`&&(0,X.jsx)(`span`,{className:`text-xs text-(--red-11) ml-6`,children:`Notebook source could not be loaded.`}),e[35]=T,e[36]=y,e[37]=H):H=e[37];let U;e[38]!==B||e[39]!==V||e[40]!==H?(U=(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[B,V,H]}),e[38]=B,e[39]=V,e[40]=H,e[41]=U):U=e[41];let W;e[42]!==I||e[43]!==U?(W=(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[I,U]}),e[42]=I,e[43]=U,e[44]=W):W=e[44];let G;e[45]===s.status?G=e[46]:(G=s.status===`pending`&&(0,X.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,X.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Loading environment details…`}),(0,X.jsx)(Zt,{className:`h-4 w-full`}),(0,X.jsx)(Zt,{className:`h-4 w-3/4`}),(0,X.jsx)(Zt,{className:`h-4 w-1/2`})]}),e[45]=s.status,e[46]=G);let K;e[47]===s?K=e[48]:(K=s.status===`error`&&(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,X.jsx)(Et,{className:`w-4 h-4 text-(--yellow-11) shrink-0`}),(0,X.jsx)(`span`,{children:`Server environment information unavailable`}),(0,X.jsx)(Le,{type:`button`,variant:`link`,size:`xs`,onClick:()=>s.refetch(),children:`Retry`})]}),e[47]=s,e[48]=K);let J;e[49]!==x||e[50]!==l?(J=x&&l.length===0&&(0,X.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`No errors detected.`}),e[49]=x,e[50]=l,e[51]=J):J=e[51];let te;e[52]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,X.jsx)(`a`,{href:q.feedbackForm,target:`_blank`,rel:`noreferrer`,className:`underline`,children:`two-minute survey`}),e[52]=te):te=e[52];let ne;return e[53]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,X.jsx)(`div`,{className:`border-t pt-3`,children:(0,X.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Other feedback? Take our`,` `,te,` `,`or chat with us on`,` `,(0,X.jsx)(`a`,{href:q.discordLink,target:`_blank`,rel:`noreferrer`,className:`underline`,children:`Discord`}),`.`]})}),e[53]=ne):ne=e[53],(0,X.jsxs)(vt,{className:`w-[540px] max-w-[90vw]`,children:[k,(0,X.jsxs)(`div`,{className:`flex flex-col gap-4 max-h-[60vh] overflow-y-auto`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,X.jsx)(Le,{type:`button`,variant:`default`,size:`xs`,asChild:!0,className:`self-start`,children:(0,X.jsxs)(`a`,{href:E,target:`_blank`,rel:`noreferrer`,children:[j,`Open GitHub issue`]})}),W,O?(0,X.jsxs)(`div`,{className:`flex items-start gap-2 text-xs text-(--yellow-11)`,children:[(0,X.jsx)(Et,{className:`w-3.5 h-3.5 shrink-0 mt-0.5`}),(0,X.jsxs)(`span`,{children:[`Too large to prefill and left out of the link: `,O,`. Paste them into the issue manually.`]})]}):(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Your environment is always included.`})]}),G,K,x&&(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,X.jsx)(`span`,{className:`text-sm font-medium`,children:`Environment details`}),(0,X.jsx)(jt,{className:`w-3.5 h-3.5`,value:JSON.stringify(x,null,2),ariaLabel:`Copy environment JSON`,toastTitle:`Environment details copied`})]}),(0,X.jsx)(Tn,{content:JSON.stringify(x,null,2)})]}),x&&l.length>0&&(0,X.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,X.jsx)(`span`,{className:`text-sm font-medium`,children:`Errors`}),(0,X.jsx)(jt,{className:`w-3.5 h-3.5`,value:Sn(l),ariaLabel:`Copy errors`,toastTitle:`Errors copied`})]}),(0,X.jsx)(Tn,{content:l.map(Bt).join(`
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
`)})]}),J,ne]})]})};function On(e){return!e}function kn(e){return e===`bug-description`?`errors`:e===`reproduction-code`?`code`:e}var An=`https://static.marimo.app`,jn=e=>{let t=(0,Z.c)(26),{onClose:n}=e,[r,i]=(0,Q.useState)(``),{exportAsHTML:a}=Ve(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=Math.random().toString(36).slice(2,6),t[0]=o):o=t[0];let s=`${r}-${o}`,c=`${An}/static/${s}`,l;t[1]!==a||t[2]!==n||t[3]!==s?(l=async e=>{e.preventDefault(),n();let{contents:t}=await a({download:!1,includeCode:!0,files:Ye.INSTANCE.filenames(),layout:await Ze()}),r=Dt({title:`Uploading static notebook...`,description:`Please wait.`});await fetch(`${An}/api/static`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({html:t,path:s})}).catch(()=>{r.dismiss(),Dt({title:`Error uploading static page`,description:(0,X.jsxs)(`div`,{children:[`Please try again later. If the problem persists, please file a bug report on`,` `,(0,X.jsx)(`a`,{href:q.issuesPage,target:`_blank`,className:`underline`,children:`GitHub`}),`.`]})})}),r.dismiss(),Dt({title:`Static page uploaded!`,description:(0,X.jsxs)(`div`,{children:[`The URL has been copied to your clipboard.`,(0,X.jsx)(`br`,{}),`You can share it with anyone.`]})})},t[1]=a,t[2]=n,t[3]=s,t[4]=l):l=t[4];let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,X.jsx)(bt,{children:`Share static notebook`}),t[5]=u):u=t[5];let d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,X.jsxs)(_t,{children:[u,(0,X.jsxs)(gt,{children:[`You can publish a static, non-interactive version of this notebook to the public web. We will create a link for you that lives on`,` `,(0,X.jsx)(`a`,{href:An,target:`_blank`,children:An}),`.`]})]}),t[6]=d):d=t[6];let f;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>{let t=e.target.value.toLowerCase().replaceAll(/\s/g,`-`).replaceAll(/[^\da-z-]/g,``);i(t)},t[7]=f):f=t[7];let p;t[8]===r?p=t[9]:(p=(0,X.jsx)(Ct,{"data-testid":`slug-input`,id:`slug`,autoFocus:!0,value:r,placeholder:`Notebook slug`,onChange:f,required:!0,autoComplete:`off`}),t[8]=r,t[9]=p);let m;t[10]===c?m=t[11]:(m=(0,X.jsxs)(`div`,{className:`font-semibold text-sm text-muted-foreground gap-2 flex flex-col`,children:[`Anyone will be able to access your notebook at this URL:`,(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(Mn,{text:c}),(0,X.jsx)(`span`,{className:`text-primary`,children:c})]})]}),t[10]=c,t[11]=m);let h;t[12]!==p||t[13]!==m?(h=(0,X.jsxs)(`div`,{className:`flex flex-col gap-6 py-4`,children:[p,m]}),t[12]=p,t[13]=m,t[14]=h):h=t[14];let g;t[15]===n?g=t[16]:(g=(0,X.jsx)(Le,{"data-testid":`cancel-share-static-notebook-button`,variant:`secondary`,onClick:n,children:`Cancel`}),t[15]=n,t[16]=g);let _;t[17]===c?_=t[18]:(_=(0,X.jsx)(Le,{"data-testid":`share-static-notebook-button`,"aria-label":`Save`,variant:`default`,type:`submit`,onClick:async()=>{await At(c)},children:`Create`}),t[17]=c,t[18]=_);let v;t[19]!==_||t[20]!==g?(v=(0,X.jsxs)(ht,{children:[g,_]}),t[19]=_,t[20]=g,t[21]=v):v=t[21];let y;return t[22]!==v||t[23]!==l||t[24]!==h?(y=(0,X.jsx)(vt,{className:`w-fit`,children:(0,X.jsxs)(`form`,{onSubmit:l,children:[d,h,v]})}),t[22]=v,t[23]=l,t[24]=h,t[25]=y):y=t[25],y},Mn=e=>{let t=(0,Z.c)(8),[n,r]=Q.useState(!1),i;t[0]===e.text?i=t[1]:(i=Ie.stopPropagation(async t=>{t.preventDefault(),await At(e.text),r(!0),setTimeout(()=>r(!1),2e3)}),t[0]=e.text,t[1]=i);let a=i,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsx)(nt,{size:14,strokeWidth:1.5}),t[2]=o):o=t[2];let s;t[3]===a?s=t[4]:(s=(0,X.jsx)(Le,{"data-testid":`copy-static-notebook-url-button`,onClick:a,size:`xs`,variant:`secondary`,children:o}),t[3]=a,t[4]=s);let c;return t[5]!==n||t[6]!==s?(c=(0,X.jsx)(Pe,{content:`Copied!`,open:n,children:s}),t[5]=n,t[6]=s,t[7]=c):c=t[7],c};function Nn(){let e=document.getElementsByClassName(J.outputArea);for(let t of e){let e=t.getBoundingClientRect();if(e.bottom>0&&e.top<window.innerHeight){let e=O.findElement(t);if(!e){W.warn(`Could not find HTMLCellId for visible output area`,t);continue}return{cellId:O.parse(e.id)}}}return W.warn(`No visible output area found for scroll anchor`),null}function Pn(e){if(!e){W.warn(`No scroll anchor provided to restore scroll position`);return}let t=document.getElementById(O.create(e.cellId));if(!t){W.warn(`Could not find cell element to restore scroll position`,e.cellId);return}if(!t.querySelector(`.${J.outputArea}`)){W.warn(`Could not find output area to restore scroll position`,e.cellId);return}t.scrollIntoView({block:`start`,behavior:`auto`})}function Fn(){let e=(0,Z.c)(2),t=a(ne),n;return e[0]===t?n=e[1]:(n=()=>{let e=Nn();t(t=>({mode:te(t.mode),cellAnchor:e?.cellId??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{Pn(e)})})},e[0]=t,e[1]=n),n}var In=n(!1),Ln=()=>{let e=(0,Z.c)(7),{selectedLayout:t}=de(),{setLayoutView:n}=fe();if(re()&&!S(`wasm_layouts`))return null;let r;e[0]===n?r=e[1]:(r=e=>n(e),e[0]=n,e[1]=r);let i;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,X.jsx)(Te,{className:`min-w-[110px] border-border bg-background`,"data-testid":`layout-select`,children:(0,X.jsx)(xe,{placeholder:`Select a view`})}),e[2]=i):i=e[2];let a;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(Ce,{children:(0,X.jsxs)(we,{children:[(0,X.jsx)(be,{children:`View as`}),ue.map(Vn)]})}),e[3]=a):a=e[3];let o;return e[4]!==t||e[5]!==r?(o=(0,X.jsxs)(Ee,{"data-testid":`layout-select`,value:t,onValueChange:r,children:[i,a]}),e[4]=t,e[5]=r,e[6]=o):o=e[6],o};function Rn(e){let t=zn(e);return(0,X.jsx)(t,{className:`h-4 w-4`})}function zn(e){switch(e){case`vertical`:return sn;case`grid`:return ct;case`slides`:return dn;default:return Re(e),Tt}}function Bn(e){return Be.startCase(e)}function Vn(e){return(0,X.jsx)(Se,{value:e,children:(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5 leading-5`,children:[Rn(e),(0,X.jsx)(`span`,{children:Bn(e)})]})},e)}var Hn=[`html`,`markdown`,`ipynb`,`pdf`,`script`,`png`],Un=[`pymdown`,`qmd`,`mystmd`,`mdx`],Wn=[`topological`,`top-down`],Gn=[`document`,`slides`],Kn=[`source`,`flat`];function qn(e){return typeof e==`string`&&Hn.some(t=>t===e)}var $={html:{includeCode:!0},markdown:{flavor:null},ipynb:{sortMode:`topological`,includeOutputs:!1},pdf:{preset:`document`,includeInputs:!0,includeOutputs:!0,webpdf:!0},script:{type:`source`}};function Jn(e,t){return e.default(t).catch(t)}function Yn(e){return I(e).optional().catch(void 0)}var Xn=I({html:Yn({includeCode:Jn(L(),$.html.includeCode)}),markdown:Yn({flavor:Jn(R(Un).nullable(),$.markdown.flavor)}),ipynb:Yn({sortMode:Jn(R(Wn),$.ipynb.sortMode),includeOutputs:Jn(L(),$.ipynb.includeOutputs)}),pdf:Yn({preset:Jn(R(Gn),$.pdf.preset),includeInputs:Jn(L(),$.pdf.includeInputs),includeOutputs:Jn(L(),$.pdf.includeOutputs),webpdf:Jn(L(),$.pdf.webpdf)}),script:Yn({type:Jn(R(Kn),$.script.type)})}).catch({});function Zn(e,t){let n={...e},r=r=>{n[r]={...e[r],...t[r]}};for(let e of Object.keys(t))r(e);return n}function Qn(e){return Zn($,Xn.parse(e))}var $n=D({toSerializable:e=>e,fromSerializable:Qn}),er=v(`marimo:export:options:v1`,$,$n,{getOnInit:!0}),tr=v(`marimo:export:last-format:v1`,`html`,D({toSerializable:e=>e,fromSerializable:e=>qn(e)?e:`html`}),{getOnInit:!0}),nr={html:{requiresNamedNotebookOnServer:!0,requiresServerRuntime:!1,checksServerAvailability:!1},markdown:{requiresNamedNotebookOnServer:!0,requiresServerRuntime:!1,checksServerAvailability:!1},ipynb:{requiresNamedNotebookOnServer:!0,requiresServerRuntime:!0,checksServerAvailability:!0},pdf:{requiresNamedNotebookOnServer:!0,requiresServerRuntime:!0,checksServerAvailability:!0},script:{requiresNamedNotebookOnServer:!1,requiresServerRuntime:!1,checksServerAvailability:!1},png:{requiresNamedNotebookOnServer:!1,requiresServerRuntime:!1,checksServerAvailability:!1}};function rr(e,t){return e===`wasm`&&t===`pdf`}function ir({format:e,options:t,runtime:n,filename:r,availability:i}){let a=e===`script`&&t.script.type===`source`?{...nr.script,requiresNamedNotebookOnServer:!0}:nr[e],o=rr(n,e);if(n===`wasm`&&a.requiresServerRuntime)return{available:o,reason:{type:`wasm-runtime`}};if(n===`server`&&a.requiresNamedNotebookOnServer&&!r)return{available:!1,reason:{type:`notebook-must-be-named`}};if(n===`wasm`||!a.checksServerAvailability)return{available:!0};if(i.status===`pending`)return{available:!1,reason:{type:`checking-requirements`}};if(i.status===`error`||!i.data)return{available:!0,availabilityCheckFailed:!0};let s=i.data.formats.find(t=>t.format===e);return s?s.dependenciesAvailable?{available:!0}:s.missingPackages.length>0?{available:!1,reason:{type:`missing-packages`,packages:s.missingPackages}}:s.missingSetup.length>0?{available:!1,reason:{type:`missing-setup`,requirements:s.missingSetup}}:{available:!0,availabilityCheckFailed:!0}:{available:!0,availabilityCheckFailed:!0}}function ar(e,t){return e.map(e=>({value:e,...t[e]}))}var or=ar([`automatic`,...Un],{automatic:{label:`Automatic`,description:`Chooses a format from the notebook filename. Defaults to Markdown (.md).`},pymdown:{label:`Markdown (.md)`,description:`Creates a .md file with Python code blocks.`},qmd:{label:`Quarto (.qmd)`,description:`Creates a .qmd file for Quarto.`},mystmd:{label:`MyST (.myst.md)`,description:`Creates a .myst.md file for MyST.`},mdx:{label:`MDX (.mdx)`,description:`Creates a .mdx file for MDX.`}}),sr=ar(Wn,{"top-down":{label:`Top to bottom`,description:`Keeps cells in the same order as this notebook.`},topological:{label:`Dependency order`,description:`Reorders cells so each cell appears after the cells it depends on.`}}),cr=ar(Gn,{document:{label:`Document`,description:`Creates pages for reading or printing.`},slides:{label:`Slides`,description:`Creates presentation slides from the notebook.`}}),lr=ar([`browser`,`latex`],{browser:{label:`Browser`,description:`Uses browser rendering to preserve the notebook's visual output.`},latex:{label:`LaTeX first`,description:`Uses Pandoc and TeX when available, then falls back to browser rendering.`}}),ur=ar(Kn,{source:{label:`Notebook source`,description:`Downloads the saved notebook source for continued editing in marimo.`},flat:{label:`Flat script`,description:`Reorders cells so the Python script runs from top to bottom.`}}),dr={html:{label:`HTML`,actionLabel:`Export HTML`,description:`Save the current notebook as an HTML page.`,Icon:ot,Options:fr},markdown:{label:`Markdown`,actionLabel:`Export Markdown`,description:`Save code and text in a Markdown-based file. Cell outputs are not included.`,Icon:Ge,Options:pr},ipynb:{label:`Jupyter`,actionLabel:`Export Jupyter notebook`,description:`Open the notebook in Jupyter and other compatible tools.`,Icon:ln,Options:mr},pdf:{label:`PDF`,actionLabel:`Export PDF`,description:`Save the notebook as a PDF for printing or sharing.`,Icon:at,Options:hr},script:{label:`Python`,actionLabel:`Export flat script`,description:`Save the notebook as a Python file.`,Icon:tt,Options:gr},png:{label:`PNG`,actionLabel:`Export PNG`,description:`Capture the current app view as an image.`,Icon:mt,Options:_r}};function fr(e){let t=(0,Z.c)(7),{options:n,updateOptions:r,disabled:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={checked:`Includes code cells in the webpage.`,unchecked:`Leaves code cells out of the webpage.`},t[0]=a):a=t[0];let o;t[1]===r?o=t[2]:(o=e=>r(`html`,{includeCode:e}),t[1]=r,t[2]=o);let s;return t[3]!==i||t[4]!==n.html.includeCode||t[5]!==o?(s=(0,X.jsx)(vr,{children:(0,X.jsx)(yr,{label:`Include code`,descriptions:a,checked:n.html.includeCode,disabled:i,onCheckedChange:o})}),t[3]=i,t[4]=n.html.includeCode,t[5]=o,t[6]=s):s=t[6],s}function pr(e){let t=(0,Z.c)(6),{options:n,updateOptions:r,disabled:i}=e,a=n.markdown.flavor??`automatic`,o;t[0]===r?o=t[1]:(o=e=>r(`markdown`,{flavor:e===`automatic`?null:e}),t[0]=r,t[1]=o);let s;return t[2]!==i||t[3]!==a||t[4]!==o?(s=(0,X.jsx)(vr,{children:(0,X.jsx)(Sr,{label:`Format`,value:a,disabled:i,onValueChange:o,options:or})}),t[2]=i,t[3]=a,t[4]=o,t[5]=s):s=t[5],s}function mr(e){let t=(0,Z.c)(16),{options:n,updateOptions:r,disabled:i}=e,a;t[0]===r?a=t[1]:(a=e=>r(`ipynb`,{sortMode:e}),t[0]=r,t[1]=a);let o;t[2]!==i||t[3]!==n.ipynb.sortMode||t[4]!==a?(o=(0,X.jsx)(br,{label:`Cell order`,value:n.ipynb.sortMode,disabled:i,onValueChange:a,options:sr}),t[2]=i,t[3]=n.ipynb.sortMode,t[4]=a,t[5]=o):o=t[5];let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s={checked:`Keeps the outputs currently shown in the notebook.`,unchecked:`Leaves cell outputs out of the Jupyter notebook.`},t[6]=s):s=t[6];let c;t[7]===r?c=t[8]:(c=e=>r(`ipynb`,{includeOutputs:e}),t[7]=r,t[8]=c);let l;t[9]!==i||t[10]!==n.ipynb.includeOutputs||t[11]!==c?(l=(0,X.jsx)(yr,{label:`Include outputs`,descriptions:s,checked:n.ipynb.includeOutputs,disabled:i,onCheckedChange:c}),t[9]=i,t[10]=n.ipynb.includeOutputs,t[11]=c,t[12]=l):l=t[12];let u;return t[13]!==o||t[14]!==l?(u=(0,X.jsxs)(vr,{children:[o,l]}),t[13]=o,t[14]=l,t[15]=u):u=t[15],u}function hr(e){let t=(0,Z.c)(30),{options:n,updateOptions:r,disabled:i}=e,a;t[0]===r?a=t[1]:(a=e=>r(`pdf`,{preset:e}),t[0]=r,t[1]=a);let o;t[2]!==i||t[3]!==n.pdf.preset||t[4]!==a?(o=(0,X.jsx)(br,{label:`Layout`,value:n.pdf.preset,disabled:i,onValueChange:a,options:cr}),t[2]=i,t[3]=n.pdf.preset,t[4]=a,t[5]=o):o=t[5];let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s={checked:`Includes code cells in the PDF.`,unchecked:`Leaves code cells out of the PDF.`},t[6]=s):s=t[6];let c;t[7]===r?c=t[8]:(c=e=>r(`pdf`,{includeInputs:e}),t[7]=r,t[8]=c);let l;t[9]!==i||t[10]!==n.pdf.includeInputs||t[11]!==c?(l=(0,X.jsx)(yr,{label:`Include code`,descriptions:s,checked:n.pdf.includeInputs,disabled:i,onCheckedChange:c}),t[9]=i,t[10]=n.pdf.includeInputs,t[11]=c,t[12]=l):l=t[12];let u;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(u={checked:`Keeps the outputs currently shown in the notebook.`,unchecked:`Leaves cell outputs out of the PDF.`},t[13]=u):u=t[13];let d;t[14]===r?d=t[15]:(d=e=>r(`pdf`,{includeOutputs:e}),t[14]=r,t[15]=d);let f;t[16]!==i||t[17]!==n.pdf.includeOutputs||t[18]!==d?(f=(0,X.jsx)(yr,{label:`Include outputs`,descriptions:u,checked:n.pdf.includeOutputs,disabled:i,onCheckedChange:d}),t[16]=i,t[17]=n.pdf.includeOutputs,t[18]=d,t[19]=f):f=t[19];let p;t[20]!==i||t[21]!==n.pdf.preset||t[22]!==n.pdf.webpdf||t[23]!==r?(p=n.pdf.preset===`document`?(0,X.jsx)(br,{label:`Method`,value:n.pdf.webpdf?`browser`:`latex`,disabled:i,onValueChange:e=>r(`pdf`,{webpdf:e===`browser`}),options:lr}):null,t[20]=i,t[21]=n.pdf.preset,t[22]=n.pdf.webpdf,t[23]=r,t[24]=p):p=t[24];let m;return t[25]!==o||t[26]!==l||t[27]!==f||t[28]!==p?(m=(0,X.jsxs)(vr,{children:[o,l,f,p]}),t[25]=o,t[26]=l,t[27]=f,t[28]=p,t[29]=m):m=t[29],m}function gr(e){let t=(0,Z.c)(6),{options:n,updateOptions:r,disabled:i}=e,a;t[0]===r?a=t[1]:(a=e=>r(`script`,{type:e}),t[0]=r,t[1]=a);let o;return t[2]!==i||t[3]!==n.script.type||t[4]!==a?(o=(0,X.jsx)(vr,{children:(0,X.jsx)(br,{label:`Format`,value:n.script.type,disabled:i,onValueChange:a,options:ur})}),t[2]=i,t[3]=n.script.type,t[4]=a,t[5]=o):o=t[5],o}function _r(){return null}function vr(e){let t=(0,Z.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,X.jsx)(`div`,{className:`divide-y rounded-md border`,children:n}),t[0]=n,t[1]=r),r}function yr(e){let t=(0,Z.c)(26),{label:n,descriptions:r,descriptionOverride:i,checked:a,disabled:o,onCheckedChange:s}=e,c=(0,Q.useId)(),l=`${c}-description`,u=i??(a?r.checked:r.unchecked),d;t[0]===i?d=t[1]:(d=i?[i]:[],t[0]=i,t[1]=d);let f;t[2]!==r.checked||t[3]!==r.unchecked||t[4]!==d?(f=[r.checked,r.unchecked,...d],t[2]=r.checked,t[3]=r.unchecked,t[4]=d,t[5]=f):f=t[5];let p=f,m;t[6]!==c||t[7]!==n?(m=(0,X.jsx)(`label`,{htmlFor:c,className:`text-sm font-medium leading-5`,children:n}),t[6]=c,t[7]=n,t[8]=m):m=t[8];let h;t[9]!==u||t[10]!==l||t[11]!==p?(h=(0,X.jsx)(Tr,{id:l,description:u,possibleDescriptions:p}),t[9]=u,t[10]=l,t[11]=p,t[12]=h):h=t[12];let g;t[13]!==m||t[14]!==h?(g=(0,X.jsxs)(`div`,{className:`min-w-0`,children:[m,h]}),t[13]=m,t[14]=h,t[15]=g):g=t[15];let _;t[16]!==a||t[17]!==l||t[18]!==o||t[19]!==c||t[20]!==n||t[21]!==s?(_=(0,X.jsx)(le,{id:c,size:`sm`,checked:a,disabled:o,onCheckedChange:s,"aria-label":n,"aria-describedby":l}),t[16]=a,t[17]=l,t[18]=o,t[19]=c,t[20]=n,t[21]=s,t[22]=_):_=t[22];let v;return t[23]!==g||t[24]!==_?(v=(0,X.jsxs)(`div`,{className:`flex min-h-14 items-center justify-between gap-4 px-3 py-2`,children:[g,_]}),t[23]=g,t[24]=_,t[25]=v):v=t[25],v}function br(e){let t=(0,Z.c)(31),{label:n,value:r,disabled:i,onValueChange:a,options:o}=e,s=(0,Q.useId)(),c=`${s}-description`,l;t[0]!==o||t[1]!==r?(l=o.find(e=>e.value===r)?.description,t[0]=o,t[1]=r,t[2]=l):l=t[2];let u=l,d;t[3]===n?d=t[4]:(d=(0,X.jsx)(`div`,{className:`text-sm font-medium leading-5`,children:n}),t[3]=n,t[4]=d);let f=u??``,p;t[5]===o?p=t[6]:(p=o.map(xr),t[5]=o,t[6]=p);let m;t[7]!==c||t[8]!==f||t[9]!==p?(m=(0,X.jsx)(Tr,{id:c,description:f,possibleDescriptions:p}),t[7]=c,t[8]=f,t[9]=p,t[10]=m):m=t[10];let h;t[11]!==d||t[12]!==m?(h=(0,X.jsxs)(`div`,{className:`min-w-0`,children:[d,m]}),t[11]=d,t[12]=m,t[13]=h):h=t[13];let g;t[14]===a?g=t[15]:(g=e=>a(e),t[14]=a,t[15]=g);let _;if(t[16]!==s||t[17]!==o){let e;t[19]===s?e=t[20]:(e=(e,t)=>{let n=`${s}-${t}`;return(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(C,{id:n,value:e.value}),(0,X.jsx)(`label`,{htmlFor:n,className:`text-sm`,children:e.label})]},e.value)},t[19]=s,t[20]=e),_=o.map(e),t[16]=s,t[17]=o,t[18]=_}else _=t[18];let v;t[21]!==c||t[22]!==i||t[23]!==n||t[24]!==g||t[25]!==_||t[26]!==r?(v=(0,X.jsx)(y,{value:r,onValueChange:g,className:`flex shrink-0 flex-wrap gap-x-5 gap-y-2 sm:justify-end`,"aria-label":n,"aria-describedby":c,disabled:i,children:_}),t[21]=c,t[22]=i,t[23]=n,t[24]=g,t[25]=_,t[26]=r,t[27]=v):v=t[27];let b;return t[28]!==h||t[29]!==v?(b=(0,X.jsxs)(`div`,{className:`flex min-h-14 flex-col items-stretch gap-2 px-3 py-2 sm:flex-row sm:items-center sm:justify-between sm:gap-4`,children:[h,v]}),t[28]=h,t[29]=v,t[30]=b):b=t[30],b}function xr(e){return e.description}function Sr(e){let t=(0,Z.c)(34),{label:n,value:r,disabled:i,onValueChange:a,options:o}=e,s=(0,Q.useId)(),c=`${s}-description`,l;t[0]!==o||t[1]!==r?(l=o.find(e=>e.value===r)?.description,t[0]=o,t[1]=r,t[2]=l):l=t[2];let u=l,d;t[3]!==s||t[4]!==n?(d=(0,X.jsx)(`label`,{htmlFor:s,className:`text-sm font-medium leading-5`,children:n}),t[3]=s,t[4]=n,t[5]=d):d=t[5];let f=u??``,p;t[6]===o?p=t[7]:(p=o.map(wr),t[6]=o,t[7]=p);let m;t[8]!==c||t[9]!==f||t[10]!==p?(m=(0,X.jsx)(Tr,{id:c,description:f,possibleDescriptions:p}),t[8]=c,t[9]=f,t[10]=p,t[11]=m):m=t[11];let h;t[12]!==d||t[13]!==m?(h=(0,X.jsxs)(`div`,{className:`min-w-0`,children:[d,m]}),t[12]=d,t[13]=m,t[14]=h):h=t[14];let g;t[15]===a?g=t[16]:(g=e=>a(e),t[15]=a,t[16]=g);let _;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,X.jsx)(xe,{}),t[17]=_):_=t[17];let v;t[18]!==c||t[19]!==s?(v=(0,X.jsx)(Te,{id:s,"aria-describedby":c,className:`h-8 w-full shrink-0 sm:w-44`,children:_}),t[18]=c,t[19]=s,t[20]=v):v=t[20];let y;t[21]===o?y=t[22]:(y=o.map(Cr),t[21]=o,t[22]=y);let b;t[23]===y?b=t[24]:(b=(0,X.jsx)(Ce,{children:y}),t[23]=y,t[24]=b);let x;t[25]!==i||t[26]!==b||t[27]!==g||t[28]!==v||t[29]!==r?(x=(0,X.jsxs)(Ee,{value:r,disabled:i,onValueChange:g,children:[v,b]}),t[25]=i,t[26]=b,t[27]=g,t[28]=v,t[29]=r,t[30]=x):x=t[30];let S;return t[31]!==x||t[32]!==h?(S=(0,X.jsxs)(`div`,{className:`flex min-h-14 flex-col items-stretch gap-2 px-3 py-2 sm:flex-row sm:items-center sm:justify-between sm:gap-4`,children:[h,x]}),t[31]=x,t[32]=h,t[33]=S):S=t[33],S}function Cr(e){return(0,X.jsx)(Se,{value:e.value,children:e.label},e.value)}function wr(e){return e.description}function Tr(e){let t=(0,Z.c)(15),{id:n,description:r,possibleDescriptions:i}=e,a;t[0]===i?a=t[1]:(a=new Set(i),t[0]=i,t[1]=a);let o;t[2]===a?o=t[3]:(o=[...a],t[2]=a,t[3]=o);let s;t[4]!==r||t[5]!==o?(s=o.filter(e=>e!==r),t[4]=r,t[5]=o,t[6]=s):s=t[6];let c=s,l;t[7]!==r||t[8]!==n?(l=(0,X.jsx)(`p`,{id:n,"aria-live":`polite`,className:`col-start-1 row-start-1`,children:r}),t[7]=r,t[8]=n,t[9]=l):l=t[9];let u;t[10]===c?u=t[11]:(u=c.map(Er),t[10]=c,t[11]=u);let d;return t[12]!==l||t[13]!==u?(d=(0,X.jsxs)(`div`,{className:`mt-0.5 grid text-xs leading-4 text-muted-foreground`,children:[l,u]}),t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function Er(e){return(0,X.jsx)(`p`,{"aria-hidden":!0,className:`invisible col-start-1 row-start-1`,children:e},e)}var Dr={"playwright-chromium":{description:`PDF export requires Playwright Chromium.`}};function Or(e){let t=(0,Z.c)(10),{status:n}=e;if(n.available&&!n.availabilityCheckFailed)return null;if(n.reason?.type===`checking-requirements`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsxs)(`span`,{className:`ml-auto flex shrink-0`,children:[(0,X.jsx)(St,{size:`small`,className:`size-3`}),(0,X.jsx)(`span`,{className:`sr-only`,children:`Checking requirements`})]}),t[0]=e):e=t[0],e}let r=n.availabilityCheckFailed?`Requirements unknown`:`Unavailable`,i=n.availabilityCheckFailed?`text-muted-foreground`:`text-(--yellow-11)`,a;t[1]===i?a=t[2]:(a=me(`size-3`,i),t[1]=i,t[2]=a);let o;t[3]===a?o=t[4]:(o=(0,X.jsx)(E,{className:a}),t[3]=a,t[4]=o);let s;t[5]===r?s=t[6]:(s=(0,X.jsx)(`span`,{className:`sr-only`,children:r}),t[5]=r,t[6]=s);let c;return t[7]!==o||t[8]!==s?(c=(0,X.jsxs)(`span`,{className:`ml-auto flex shrink-0`,children:[o,s]}),t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function kr(e){let t=(0,Z.c)(7),{format:n,formatLabel:r,status:i,onInstall:a,isInstalling:o}=e,s=o!==void 0&&o;if(i.availabilityCheckFailed){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(`div`,{className:`mb-2.5`,children:(0,X.jsx)(Ar,{children:`Couldn't check whether this export is available. You can still try it.`})}),t[0]=e):e=t[0],e}if(!i.reason)return null;let c;return t[1]!==n||t[2]!==r||t[3]!==s||t[4]!==a||t[5]!==i.reason?(c=(0,X.jsx)(`div`,{className:`mb-2.5`,children:(0,X.jsx)(jr,{format:n,formatLabel:r,reason:i.reason,onInstall:a,isInstalling:s})}),t[1]=n,t[2]=r,t[3]=s,t[4]=a,t[5]=i.reason,t[6]=c):c=t[6],c}function Ar(e){let t=(0,Z.c)(9),{children:n,onInstall:r,isInstalling:i}=e,a=i!==void 0&&i,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsx)(E,{className:`size-4 shrink-0`}),t[0]=o):o=t[0];let s;t[1]===n?s=t[2]:(s=(0,X.jsx)(`span`,{className:`min-w-0 flex-1`,children:n}),t[1]=n,t[2]=s);let c;t[3]!==a||t[4]!==r?(c=r?(0,X.jsxs)(Le,{type:`button`,variant:`outline`,size:`xs`,className:`shrink-0 border-input bg-background text-foreground hover:border-input hover:bg-muted hover:text-foreground`,disabled:a,"aria-busy":a,onClick:r,children:[a?(0,X.jsx)(St,{size:`small`,className:`mr-1.5 size-3.5`}):(0,X.jsx)(tn,{className:`mr-1.5 size-3.5`}),`Install`]}):null,t[3]=a,t[4]=r,t[5]=c):c=t[5];let l;return t[6]!==s||t[7]!==c?(l=(0,X.jsxs)(It,{variant:`warning`,className:`flex items-center gap-2.5 px-3 py-2 text-(--yellow-12) has-[svg]:pl-3 [&>svg]:static [&>svg+div]:translate-y-0`,children:[o,(0,X.jsxs)(Ft,{className:`flex min-w-0 flex-1 items-center gap-3 text-sm leading-5`,children:[s,c]})]}),t[6]=s,t[7]=c,t[8]=l):l=t[8],l}function jr(e){let t=(0,Z.c)(22),{format:n,formatLabel:r,reason:i,onInstall:a,isInstalling:o}=e;switch(i.type){case`checking-requirements`:{let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(St,{className:`size-4 shrink-0`,size:`small`}),t[0]=e):e=t[0];let n;return t[1]===r?n=t[2]:(n=(0,X.jsxs)(It,{role:`status`,variant:`info`,className:`flex items-center gap-2.5 p-3 has-[svg]:pl-3 [&>svg]:static [&>svg+div]:translate-y-0`,children:[e,(0,X.jsxs)(Ft,{className:`min-w-0 flex-1 text-sm leading-5`,children:[`Checking `,r,` requirements…`]})]}),t[1]=r,t[2]=n),n}case`notebook-must-be-named`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(Ar,{children:`Name and save this notebook before exporting.`}),t[3]=e):e=t[3],e}case`missing-packages`:{let e;t[4]===i.packages?e=t[5]:(e=i.packages.join(`, `),t[4]=i.packages,t[5]=e);let n;t[6]===e?n=t[7]:(n=(0,X.jsx)(`code`,{className:`break-words font-mono`,children:e}),t[6]=e,t[7]=n);let s;return t[8]!==r||t[9]!==o||t[10]!==a||t[11]!==n?(s=(0,X.jsxs)(Ar,{onInstall:a,isInstalling:o,children:[r,` export requires`,` `,n,`.`]}),t[8]=r,t[9]=o,t[10]=a,t[11]=n,t[12]=s):s=t[12],s}case`missing-setup`:{let e;t[13]!==a||t[14]!==i.requirements?(e=a?i.requirements.map(Nr).join(` `):(0,X.jsx)(`span`,{className:`block min-w-0`,children:i.requirements.map(Mr)}),t[13]=a,t[14]=i.requirements,t[15]=e):e=t[15];let n;return t[16]!==o||t[17]!==a||t[18]!==e?(n=(0,X.jsx)(Ar,{onInstall:a,isInstalling:o,children:e}),t[16]=o,t[17]=a,t[18]=e,t[19]=n):n=t[19],n}case`wasm-runtime`:{let e=n===`pdf`?`Use your browser's print dialog to save the current app view as a PDF.`:`Open this notebook in a local marimo session to use this export.`,r;return t[20]===e?r=t[21]:(r=(0,X.jsx)(Ar,{children:e}),t[20]=e,t[21]=r),r}default:ze(i)}}function Mr(e){let t=Dr[e.name];return(0,X.jsxs)(`span`,{className:`block`,children:[t.description,(0,X.jsx)(`code`,{className:`mt-1 block break-all font-mono`,children:e.command})]},e.name)}function Nr(e){return Dr[e.name].description}function Pr(e){return e.endsWith(`.myst.md`)?`mystmd`:e.endsWith(`.qmd`)?`qmd`:e.endsWith(`.mdx`)?`mdx`:`pymdown`}function Fr(e,t){let n=t??Pr(e),r=ft[n],i=pt.find(t=>e.endsWith(t)),a=Me.withoutExtension(e);i&&(a=e.slice(0,-i.length));let o=`${a}.${r}`;return o===e?`${e.slice(0,-(r.length+1))}.export.${r}`:o}function Ir(e){return Object.entries(e).flatMap(([e,t])=>t===null?[]:t===!0?[`--${e}`]:t===!1?[`--no-${e}`]:[`--${e}=${t}`])}function Lr(e){return e.preset===`document`?e.webpdf:null}var Rr={html:{subcommand:`html`,flags:({html:e})=>({"include-code":e.includeCode}),outputFilename:e=>Me.toHTML(e)},markdown:{subcommand:`md`,flags:({markdown:e})=>({flavor:e.flavor}),outputFilename:(e,{markdown:t})=>Fr(e,t.flavor)},ipynb:{subcommand:`ipynb`,flags:({ipynb:e})=>({sort:e.sortMode,"include-outputs":e.includeOutputs}),outputFilename:e=>Me.toIPYNB(e)},pdf:{subcommand:`pdf`,flags:({pdf:e})=>({as:e.preset,"include-inputs":e.includeInputs,"include-outputs":e.includeOutputs,webpdf:Lr(e)}),outputFilename:e=>Me.toPDF(e)},script:{subcommand:`script`,flags:()=>({}),outputFilename:e=>`${Me.withoutExtension(e)}.script.py`}};function zr({format:e,filename:t,options:n}){if(e===`png`||e===`script`&&n.script.type===`source`||!t)return null;let r=Rr[e];return[`marimo`,`export`,r.subcommand,Vt(t),...Ir(r.flags(n)),`-o`,Vt(r.outputFilename(t,n))].join(` `)}async function Br(e){let{exportOptions:t,captureOutputs:n,downloadPDF:r}=e;t.includeOutputs&&await n(),await r(t)}async function Vr({format:e,options:t,requests:n,sourceFilename:r,htmlFiles:i,getLayout:a,captureOutputs:o,capturePNG:s,downloadFile:c}){switch(e){case`html`:c(await n.exportAsHTML({download:!1,files:i,includeCode:t.html.includeCode,layout:await a()}));return;case`markdown`:c(await n.exportAsMarkdown({download:!1,flavor:t.markdown.flavor}));return;case`ipynb`:t.ipynb.includeOutputs&&await o(),c(await n.exportAsIPYNB({download:!1,sortMode:t.ipynb.sortMode,includeOutputs:t.ipynb.includeOutputs}));return;case`pdf`:await Br({exportOptions:t.pdf,captureOutputs:o,downloadPDF:async e=>{c(await n.exportAsPDF(e))}});return;case`script`:if(t.script.type===`source`){c({contents:(await n.readCode()).contents,filename:r,mediaType:`text/plain`});return}c(await n.exportAsScript({download:!1}));return;case`png`:await s();return;default:ze(e)}}var Hr={source:{actionLabel:`Export notebook source`,progressLabel:`notebook source`},flat:{actionLabel:`Export flat script`,progressLabel:`flat script`}};function Ur(e,t){if(e===`wasm`)return{status:`success`,data:null};switch(t.status){case`pending`:case`loading`:return{status:`pending`};case`error`:return{status:`error`};case`success`:return{status:`success`,data:t.data}}}function Wr(e,t){return e===`server`&&t?We.basename(t):Me.toPY(document.title)}function Gr({usesBrowserPrint:e,hasCommand:t,format:n,isNotebookSource:r}){return e?`Uses the browser's print settings for page size and filename.`:t?`Uses the current session state. The copied command exports the saved notebook.`:n!==`png`&&!r?`Save the notebook to copy an equivalent shell command.`:null}function Kr(e){let n=Lt(),[r,i]=t(er),[a,o]=t(tr),[s,c]=(0,Q.useState)(e??a),l=re()?`wasm`:`server`,u=Ve(),d=oe(),[f,p]=(0,Q.useState)(!1),m=kt(async()=>l===`wasm`?null:u.getExportAvailability(),[l,u]),h=Ur(l,m),g=e=>ir({format:e,options:r,runtime:l,filename:n,availability:h}),_=g(s),v=d&&(_.reason?.type===`missing-packages`||_.reason?.type===`missing-setup`),y=Hn.map(e=>({format:e,status:g(e)})),b=rr(l,s),x=dr[s],S=s===`script`&&r.script.type===`source`,{actionLabel:C,progressLabel:w}=s===`script`?Hr[r.script.type]:{actionLabel:x.actionLabel,progressLabel:x.label},T=b?null:zr({format:s,filename:n,options:r}),E=Gr({usesBrowserPrint:b,hasCommand:!!T,format:s,isNotebookSource:S});return(0,Q.useEffect)(()=>{e&&o(e)},[e,o]),{formats:y,options:r,selected:{format:s,status:_,usesBrowserPrint:b,actionLabel:C,command:T,footerDescription:E},exportRequest:{format:s,options:r,sourceFilename:Wr(l,n),available:_.available,usesBrowserPrint:b,progressLabel:w},selectFormat:e=>{qn(e)&&(c(e),o(e))},updateOptions:(e,t)=>{i(n=>{let r={...n};return r[e]={...n[e],...t},r})},canInstall:v,isInstalling:f,installRequirements:async()=>{if(!(!v||f||s===`png`)){p(!0);try{let e=await u.installExportRequirements({format:s});m.setData(e)}catch{}finally{p(!1)}}}}}async function qr(e){let t=document.getElementById(`App`);if(!t){let e=`The current app view could not be captured.`;throw Dt({title:`Failed to download as PNG`,description:e,variant:`danger`}),Error(e)}let n=e?.style.visibility,r=e?.classList.contains(`print:hidden`);if(!await je({element:t,filename:document.title,prepare:()=>{let t=Ne();return e&&(e.classList.add(`print:hidden`),e.style.visibility=`hidden`),()=>{t(),e&&(r||e.classList.remove(`print:hidden`),e.style.visibility=n??``)}}}))throw Error(`Failed to capture the current app view.`)}function Jr(e){e(),requestAnimationFrame(()=>{setTimeout(()=>{window.print()},0)})}function Yr({format:e,options:t,sourceFilename:n,available:r,usesBrowserPrint:i,progressLabel:a,onClose:o}){let s=Ve(),c=Yt(),[l,u]=(0,Q.useState)(!1),d=(0,Q.useRef)(null),f=(0,Q.useRef)(!0);(0,Q.useEffect)(()=>(f.current=!0,()=>{f.current=!1}),[]);let p=async e=>{await Xt({takeScreenshots:()=>c({progress:e}),updateCellOutputs:s.updateCellOutputs})},m=async()=>{await se(()=>qr(d.current?.parentElement??null))};return{dialogRef:d,isExporting:l,submit:async()=>{if(!(!r||l)){if(i){Jr(o);return}u(!0);try{await Ae(`Exporting ${a}…`,async r=>{await Vr({format:e,options:t,requests:s,sourceFilename:n,htmlFiles:Ye.INSTANCE.filenames(),getLayout:Ze,captureOutputs:()=>p(r),capturePNG:m,downloadFile:ke})}),f.current&&o()}catch(e){W.error(`Export failed`,e)}finally{f.current&&u(!1)}}}}}function Xr(e){let t=(0,Z.c)(15),{initialFormat:n,onClose:r}=e,i=Kr(n),a,o,s;t[0]===i?(a=t[1],o=t[2],s=t[3]):({exportRequest:a,selectFormat:o,...s}=i,t[0]=i,t[1]=a,t[2]=o,t[3]=s);let c;t[4]!==a||t[5]!==r?(c={...a,onClose:r},t[4]=a,t[5]=r,t[6]=c):c=t[6];let l=Yr(c),u;t[7]!==l||t[8]!==o||t[9]!==s?(u=e=>{!l.isExporting&&!s.isInstalling&&o(e)},t[7]=l,t[8]=o,t[9]=s,t[10]=u):u=t[10];let d;return t[11]!==l||t[12]!==s||t[13]!==u?(d={...s,...l,selectFormat:u},t[11]=l,t[12]=s,t[13]=u,t[14]=d):d=t[14],d}var Zr=`(min-width: 640px)`,Qr=e=>{let t=(0,Z.c)(75),{initialFormat:n,onClose:r,returnFocusRef:i}=e,a;t[0]!==n||t[1]!==r?(a={initialFormat:n,onClose:r},t[0]=n,t[1]=r,t[2]=a):a=t[2];let{dialogRef:o,isExporting:s,isInstalling:c,canInstall:l,formats:u,options:d,selected:f,selectFormat:p,updateOptions:m,installRequirements:h,submit:g}=Xr(a),_=s||c,v=De(Zr),{format:y,status:b,usesBrowserPrint:x,actionLabel:S,command:C,footerDescription:w}=f,T=dr[y],E=T.Options,D;t[3]===i?D=t[4]:(D=i?{onCloseAutoFocus:e=>{e.preventDefault(),i.current?.focus()}}:{},t[3]=i,t[4]=D);let O=D,k;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,X.jsxs)(_t,{className:`border-b px-5 py-4 pr-12`,children:[(0,X.jsx)(bt,{children:`Export notebook`}),(0,X.jsx)(gt,{children:`Choose a format and adjust its options.`})]}),t[5]=k):k=t[5];let A=v?`vertical`:`horizontal`,j;if(t[6]!==u||t[7]!==_){let e;t[9]===_?e=t[10]:(e=e=>{let{format:t,status:n}=e,r=dr[t];return(0,X.jsxs)(ge,{value:t,disabled:_,className:`min-w-0 justify-start gap-2 px-2.5 py-2 text-xs data-[state=active]:shadow-xs sm:w-full sm:text-sm`,"data-testid":`export-format-${t}`,children:[(0,X.jsx)(r.Icon,{className:`size-3.5 shrink-0`,strokeWidth:1.5}),(0,X.jsx)(`span`,{className:`truncate`,children:r.label}),(0,X.jsx)(Or,{status:n})]},t)},t[9]=_,t[10]=e),j=u.map(e),t[6]=u,t[7]=_,t[8]=j}else j=t[8];let M;t[11]===j?M=t[12]:(M=(0,X.jsx)(ve,{"aria-label":`Export format`,className:`grid max-h-none shrink-0 grid-cols-2 items-stretch justify-start gap-1 overflow-auto rounded-none border-b bg-muted/20 p-2 min-[360px]:grid-cols-3 sm:flex sm:h-full sm:flex-col sm:border-b-0 sm:border-r`,children:j}),t[11]=j,t[12]=M);let N;if(t[13]!==E||t[14]!==l||t[15]!==T.description||t[16]!==T.label||t[17]!==y||t[18]!==u||t[19]!==h||t[20]!==_||t[21]!==c||t[22]!==d||t[23]!==b||t[24]!==m||t[25]!==x){let e;t[27]!==E||t[28]!==l||t[29]!==T.description||t[30]!==T.label||t[31]!==y||t[32]!==h||t[33]!==_||t[34]!==c||t[35]!==d||t[36]!==b||t[37]!==m||t[38]!==x?(e=e=>{let{format:t}=e;return(0,X.jsxs)(_e,{value:t,className:`mt-0 min-h-0 min-w-0 overflow-y-auto px-4 py-3`,children:[(0,X.jsxs)(`div`,{className:`mb-3`,children:[(0,X.jsx)(`h3`,{className:`text-base font-semibold`,children:T.label}),(0,X.jsx)(`p`,{className:`mt-0.5 text-sm text-muted-foreground`,children:T.description})]}),(0,X.jsx)(kr,{format:y,formatLabel:T.label,status:b,onInstall:l?h:void 0,isInstalling:c}),x?null:(0,X.jsx)(E,{options:d,updateOptions:m,disabled:_})]},t)},t[27]=E,t[28]=l,t[29]=T.description,t[30]=T.label,t[31]=y,t[32]=h,t[33]=_,t[34]=c,t[35]=d,t[36]=b,t[37]=m,t[38]=x,t[39]=e):e=t[39],N=u.map(e),t[13]=E,t[14]=l,t[15]=T.description,t[16]=T.label,t[17]=y,t[18]=u,t[19]=h,t[20]=_,t[21]=c,t[22]=d,t[23]=b,t[24]=m,t[25]=x,t[26]=N}else N=t[26];let P;t[40]!==y||t[41]!==p||t[42]!==A||t[43]!==M||t[44]!==N?(P=(0,X.jsxs)(ye,{value:y,onValueChange:p,orientation:A,className:`flex min-h-0 min-w-0 flex-col overflow-hidden sm:grid sm:grid-cols-[168px_minmax(0,1fr)]`,children:[M,N]}),t[40]=y,t[41]=p,t[42]=A,t[43]=M,t[44]=N,t[45]=P):P=t[45];let F;t[46]===C?F=t[47]:(F=C?(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 rounded-md border bg-background px-2.5 py-2 font-mono text-xs`,children:[(0,X.jsx)(`span`,{className:`select-none text-muted-foreground`,"aria-hidden":!0,children:`$`}),(0,X.jsx)(`code`,{className:`min-w-0 flex-1 overflow-x-auto whitespace-nowrap`,"data-testid":`export-cli-command`,"aria-label":`Equivalent POSIX shell command`,children:C}),(0,X.jsx)(jt,{value:C,className:`size-3.5`,buttonClassName:me(Fe({variant:`ghost`,size:`icon`}),`shrink-0`),tooltip:`Copy POSIX shell command`,ariaLabel:`Copy POSIX shell command`,toastTitle:`Command copied`})]}):null,t[46]=C,t[47]=F);let I=C&&`mt-3`,L;t[48]===I?L=t[49]:(L=me(`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,I),t[48]=I,t[49]=L);let R;t[50]===w?R=t[51]:(R=w?(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:w}):null,t[50]=w,t[51]=R);let z=!b.available||_,ee=!w&&`sm:ml-auto`,B;t[52]===ee?B=t[53]:(B=me(`border-(--blue-11) bg-(--blue-11) hover:border-(--blue-12) hover:bg-(--blue-12) sm:min-w-36 dark:border-(--blue-7) dark:bg-(--blue-5) dark:text-(--blue-12) dark:hover:border-(--blue-8) dark:hover:bg-(--blue-6)`,ee),t[52]=ee,t[53]=B);let V;t[54]===s?V=t[55]:(V=s&&(0,X.jsx)(St,{size:`small`,className:`mr-2`,"aria-hidden":!0}),t[54]=s,t[55]=V);let H=x?`Print to PDF`:S,U;t[56]!==s||t[57]!==g||t[58]!==z||t[59]!==B||t[60]!==V||t[61]!==H?(U=(0,X.jsxs)(Le,{type:`button`,disabled:z,"aria-busy":s,onClick:g,className:B,"data-testid":`export-submit`,children:[V,H]}),t[56]=s,t[57]=g,t[58]=z,t[59]=B,t[60]=V,t[61]=H,t[62]=U):U=t[62];let W;t[63]!==L||t[64]!==R||t[65]!==U?(W=(0,X.jsxs)(`div`,{className:L,children:[R,U]}),t[63]=L,t[64]=R,t[65]=U,t[66]=W):W=t[66];let G;t[67]!==W||t[68]!==F?(G=(0,X.jsxs)(`footer`,{className:`min-w-0 border-t bg-muted/20 px-4 py-3`,children:[F,W]}),t[67]=W,t[68]=F,t[69]=G):G=t[69];let K;return t[70]!==o||t[71]!==O||t[72]!==G||t[73]!==P?(K=(0,X.jsxs)(vt,{ref:o,className:`grid h-dvh max-h-[760px] min-w-0 w-[calc(100vw-2rem)] grid-rows-[auto_minmax(0,1fr)_auto] gap-0 overflow-hidden p-0 sm:top-[5vh] sm:h-[90vh] sm:max-h-[640px] sm:max-w-3xl`,"data-testid":`export-dialog`,...O,children:[k,P,G]}),t[70]=o,t[71]=O,t[72]=G,t[73]=P,t[74]=K):K=t[74],K};function $r(e){let t=(0,Z.c)(5),{openPrompt:n,closeModal:r}=yt(),{sendCopy:i}=Ve(),a;return t[0]!==r||t[1]!==n||t[2]!==i||t[3]!==e?(a=()=>{if(!e)return null;let t=Ke.guessDeliminator(e),a=We.basename(e);n({title:`Copy notebook`,description:`Enter a new filename for the notebook copy.`,defaultValue:`_${a}`,confirmText:`Copy notebook`,spellCheck:!1,onConfirm:n=>{let a=t.join(We.dirname(e),n);i({source:e,destination:a}).then(()=>{r(),Dt({title:`Notebook copied`,description:`A copy of the notebook has been created.`}),Jt(a)})}})},t[0]=r,t[1]=n,t[2]=i,t[3]=e,t[4]=a):a=t[4],a}var ei=new M,ti=e=>ei.isSupported(e)?`markdown`:`code`,ni=()=>{let e=(0,Z.c)(3),{updateCellConfig:t}=l(),{saveCellConfig:n}=Ve(),r;return e[0]!==n||e[1]!==t?(r=async(e,r)=>{let i=T(),a={};for(let t of i.cellIds.inOrderIds){let n=i.cellData[t];n!==void 0&&n.config.hide_code!==e&&ti(n.code)===r&&(a[t]={hide_code:e})}let o=K.entries(a);if(o.length!==0){await n({configs:a});for(let[e,n]of o)t({cellId:e,config:n})}},e[0]=n,e[1]=t,e[2]=r):r=e[2],r},ri=e=>{e?.preventDefault(),e?.stopPropagation()};function ii(e){let n=(0,Z.c)(43),i;n[0]===e?i=n[1]:(i=e===void 0?{}:e,n[0]=e,n[1]=i);let{exportDialogReturnFocusRef:o}=i,_=Lt(),{openModal:v,closeModal:y}=yt(),{toggleApplication:b}=c(),{selectedPanel:S}=x(),[C]=t(ne),w=r(ie),E=ni(),[D]=B(),O=r(h),A=r(ee),{updateCellConfig:M,undoDeleteCell:I,clearAllCellOutputs:L,addSetupCellIfDoesntExist:R,collapseAllCells:z,expandAllCells:W}=l(),G=Nt(),J=Mt(),te=$r(_),ae=a(In),oe=a(H),{handleClick:se}=U(),ce=a(V),le=a(er),{readCode:pe,saveCellConfig:me}=Ve(),he=d(`database`),ge=d(`storage`),_e=F(),ve=r(g),ye=r(N),be=r(u),{selectedLayout:xe}=de(),{setLayoutView:Se}=fe(),Ce=Fn(),we=D.sharing?.html??!0,Te=D.sharing?.wasm??!0,Ee=D.sharing?.molab??!0,De=xe===`slides`,ke;if(n[2]!==_e||n[3]!==R||n[4]!==A||n[5]!==ye||n[6]!==O||n[7]!==L||n[8]!==y||n[9]!==z||n[10]!==te||n[11]!==he||n[12]!==ge||n[13]!==W||n[14]!==o||n[15]!==_||n[16]!==ve||n[17]!==De||n[18]!==w||n[19]!==v||n[20]!==se||n[21]!==pe||n[22]!==G||n[23]!==J||n[24]!==me||n[25]!==xe||n[26]!==S||n[27]!==E||n[28]!==ae||n[29]!==le||n[30]!==ce||n[31]!==Se||n[32]!==oe||n[33]!==we||n[34]!==Ee||n[35]!==Te||n[36]!==b||n[37]!==Ce||n[38]!==I||n[39]!==be||n[40]!==M||n[41]!==C.mode){let e=[`db`,`sql`,...Ut],t=[`bucket`,`object storage`,...Gt],r=yi,i=(e,t)=>{t&&le(e=>Zn(e,t)),v((0,X.jsx)(Qr,{initialFormat:e,onClose:y,returnFocusRef:o}))};ke=[{icon:(0,X.jsx)(Oe,{size:14,strokeWidth:1.5}),label:`Export…`,additionalKeywords:[`download`,`html`,`markdown`,`ipynb`,`pdf`,`script`,`png`],handle:()=>i()},{icon:(0,X.jsx)(Oe,{size:14,strokeWidth:1.5}),label:`Download`,redundant:!0,handle:ri,dropdown:[{icon:(0,X.jsx)(Qe,{size:14,strokeWidth:1.5}),label:`Download as HTML`,handle:()=>i(`html`,{html:{includeCode:!0}})},{icon:(0,X.jsx)(Qe,{size:14,strokeWidth:1.5}),label:`Download as HTML (exclude code)`,handle:()=>i(`html`,{html:{includeCode:!1}})},{icon:(0,X.jsx)(Rt,{strokeWidth:1.5,style:{width:14,height:14}}),label:`Download as Markdown`,handle:()=>i(`markdown`)},{icon:(0,X.jsx)(ln,{size:14,strokeWidth:1.5}),label:`Download as ipynb`,handle:()=>i(`ipynb`)},{icon:(0,X.jsx)(tt,{size:14,strokeWidth:1.5}),label:`Download notebook source`,handle:()=>i(`script`,{script:{type:`source`}})},{icon:(0,X.jsx)(tt,{size:14,strokeWidth:1.5}),label:`Download flat script`,handle:()=>i(`script`,{script:{type:`flat`}})},{divider:!0,icon:(0,X.jsx)(mt,{size:14,strokeWidth:1.5}),label:`Download as PNG`,handle:()=>i(`png`)},De?{divider:!0,icon:(0,X.jsx)(at,{size:14,strokeWidth:1.5}),label:`Download as PDF`,handle:ri,dropdown:[{icon:(0,X.jsx)(at,{size:14,strokeWidth:1.5}),label:`Document Layout`,handle:()=>i(`pdf`,{pdf:{preset:`document`}})},{icon:(0,X.jsx)(at,{size:14,strokeWidth:1.5}),label:`Slides Layout`,hidden:re(),rightElement:(0,X.jsx)(`span`,{className:`ml-3 shrink-0 rounded-full border border-emerald-200 bg-emerald-50 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-emerald-700`,children:`Recommended`}),handle:()=>i(`pdf`,{pdf:{preset:`slides`}})}]}:{divider:!0,icon:(0,X.jsx)(at,{size:14,strokeWidth:1.5}),label:`Download as PDF`,handle:()=>i(`pdf`,{pdf:{preset:`document`}})}]},{icon:(0,X.jsx)(m,{size:14,strokeWidth:1.5}),label:`Pair with an agent`,hidden:re(),handle:async()=>{v((0,X.jsx)(Ht,{onClose:y}))}},{icon:(0,X.jsx)(fn,{size:14,strokeWidth:1.5}),label:`Share`,handle:ri,hidden:!we&&!Te&&!Ee,dropdown:[{icon:(0,X.jsx)(ot,{size:14,strokeWidth:1.5}),label:`Publish HTML to web`,hidden:!we,handle:async()=>{v((0,X.jsx)(jn,{onClose:y}))}},{icon:(0,X.jsx)(xt,{size:14,strokeWidth:1.5}),label:`Create WebAssembly link`,hidden:!Te,handle:async()=>{let e=await pe(),t=Pt({code:e.contents});await At(t),Dt({title:`Copied`,description:`Link copied to clipboard.`})}},{icon:(0,X.jsx)(qt,{size:14,strokeWidth:1.5}),label:`Create molab notebook`,hidden:!Ee,handle:async()=>{let e=await pe(),t=Pt({code:e.contents,baseUrl:`${q.molab}/new`});window.open(t,`_blank`)}}]},{icon:(0,X.jsx)(un,{size:14,strokeWidth:1.5}),label:`Helper panel`,redundant:!0,handle:ri,dropdown:P.flatMap(e=>{let t=e.type===`ai`&&!A;if(j({panel:e,capabilities:O,aiEnabled:A})&&!t)return[];let{type:n,Icon:i,additionalKeywords:a}=e;return{label:Be.startCase(n),rightElement:r(S===n),icon:(0,X.jsx)(i,{size:14,strokeWidth:1.5}),handle:()=>{if(t){se(`ai`,`ai-features`);return}b(n)},additionalKeywords:a}})},{icon:(0,X.jsx)(dn,{size:14,strokeWidth:1.5}),label:`Present as`,handle:ri,dropdown:[{icon:C.mode===`present`?(0,X.jsx)(f,{size:14,strokeWidth:1.5}):(0,X.jsx)(qe,{size:14,strokeWidth:1.5}),label:`Toggle app view`,hotkey:`global.hideCode`,handle:()=>{Ce()}},...ue.map((e,t)=>{let n=zn(e);return{divider:t===0,label:Bn(e),icon:(0,X.jsx)(n,{size:14,strokeWidth:1.5}),rightElement:(0,X.jsx)(`div`,{className:`w-8 flex justify-end`,children:xe===e&&(0,X.jsx)($e,{size:14})}),handle:()=>{Se(e),C.mode===`edit`&&Ce()}}})]},{icon:(0,X.jsx)(on,{size:14,strokeWidth:1.5}),label:`Duplicate notebook`,hidden:!_||re(),handle:te},{icon:(0,X.jsx)(en,{size:14,strokeWidth:1.5}),label:`Copy code to clipboard`,hidden:!_,handle:async()=>{let e=await pe();await At(e.contents),Dt({title:`Copied`,description:`Code copied to clipboard.`})}},{icon:(0,X.jsx)(et,{size:14,strokeWidth:1.5}),label:`Enable all cells`,hidden:!ve||w,handle:async()=>{let e=T(),t=p(e),n=K.fromEntries(t.map(vi));await me({configs:n});for(let e of t)M({cellId:e,config:{disabled:!1}})}},{divider:!0,icon:(0,X.jsx)(rn,{size:14,strokeWidth:1.5}),label:`Add setup cell`,handle:()=>{R({})}},{icon:(0,X.jsx)(Ue,{size:14,strokeWidth:1.5}),label:`Add database connection`,additionalKeywords:e,handle:()=>{v((0,X.jsx)(Wt,{onClose:y}))},dropdown:he.length===0?void 0:[...he.map(e=>({icon:(0,X.jsx)(m,{size:14,strokeWidth:1.5}),label:`Add ${e.displayName}`,description:`Detected in your environment`,handle:()=>_e(e)})),{divider:!0,icon:(0,X.jsx)(Ue,{size:14,strokeWidth:1.5}),label:`Browse all connections`,additionalKeywords:e,handle:()=>{v((0,X.jsx)(Wt,{onClose:y}))}}]},{icon:(0,X.jsx)(ut,{size:14,strokeWidth:1.5}),label:`Add remote storage`,additionalKeywords:t,handle:()=>{v((0,X.jsx)(Wt,{defaultTab:`storage`,onClose:y}))},dropdown:ge.length===0?void 0:[...ge.map(e=>({icon:(0,X.jsx)(m,{size:14,strokeWidth:1.5}),label:`Add ${e.displayName}`,description:`Detected in your environment`,handle:()=>_e(e)})),{divider:!0,icon:(0,X.jsx)(ut,{size:14,strokeWidth:1.5}),label:`Browse all connections`,additionalKeywords:t,handle:()=>{v((0,X.jsx)(Wt,{defaultTab:`storage`,onClose:y}))}}]},{icon:(0,X.jsx)(mn,{size:14,strokeWidth:1.5}),label:be,hidden:!ye||w,handle:()=>{I()}},{icon:(0,X.jsx)(pn,{size:14,strokeWidth:1.5}),label:`Restart kernel`,variant:`danger`,handle:G,additionalKeywords:[`reset`,`reload`,`restart`]},{icon:(0,X.jsx)(an,{size:14,strokeWidth:1.5}),label:`Re-run all cells`,redundant:!0,hotkey:`global.runAll`,handle:async()=>{J()}},{icon:(0,X.jsx)(k,{size:14,strokeWidth:1.5}),label:`Clear all outputs`,redundant:!0,handle:()=>{L()}},{icon:(0,X.jsx)(s,{size:14,strokeWidth:1.5}),label:`Show all code`,hotkey:`global.showAllCode`,handle:()=>E(!1,`code`),redundant:!0},{icon:(0,X.jsx)(rt,{size:14,strokeWidth:1.5}),label:`Hide all code`,hotkey:`global.hideAllCode`,handle:()=>E(!0,`code`),redundant:!0},{icon:(0,X.jsx)(s,{size:14,strokeWidth:1.5}),label:`Show all markdown code`,hotkey:`global.showAllMarkdownCode`,handle:()=>E(!1,`markdown`),redundant:!0},{icon:(0,X.jsx)(rt,{size:14,strokeWidth:1.5}),label:`Hide all markdown code`,hotkey:`global.hideAllMarkdownCode`,handle:()=>E(!0,`markdown`),redundant:!0},{icon:(0,X.jsx)($t,{size:14,strokeWidth:1.5}),label:`Collapse all sections`,hotkey:`global.collapseAllSections`,handle:z,redundant:!0},{icon:(0,X.jsx)(Qt,{size:14,strokeWidth:1.5}),label:`Expand all sections`,hotkey:`global.expandAllSections`,handle:W,redundant:!0},{divider:!0,icon:(0,X.jsx)(nn,{size:14,strokeWidth:1.5}),label:`Command palette`,hotkey:`global.commandPalette`,handle:()=>ae(_i)},{icon:(0,X.jsx)(Je,{size:14,strokeWidth:1.5}),label:`Keyboard shortcuts`,hotkey:`global.showHelp`,handle:()=>ce(gi)},{icon:(0,X.jsx)(wt,{size:14,strokeWidth:1.5}),label:`User settings`,handle:()=>oe(hi),redundant:!0,additionalKeywords:[`preferences`,`options`,`configuration`]},{icon:(0,X.jsx)(cn,{size:14,strokeWidth:1.5}),label:`Report an issue`,additionalKeywords:[`feedback`,`bug`,`issue`,`report`,`diagnostics`],handle:()=>v((0,X.jsx)(Dn,{onClose:y}))},{icon:(0,X.jsx)(it,{size:14,strokeWidth:1.5}),label:`Resources`,handle:ri,dropdown:[{icon:(0,X.jsx)(He,{size:14,strokeWidth:1.5}),label:`Documentation`,handle:mi},{icon:(0,X.jsx)(Kt,{className:`h-3.5 w-3.5`}),label:`GitHub`,handle:pi},{icon:(0,X.jsx)(st,{size:14,strokeWidth:1.5}),label:`Discord Community`,handle:fi},{icon:(0,X.jsx)(lt,{className:`h-3.5 w-3.5`}),label:`YouTube`,handle:di},{icon:(0,X.jsx)(Ge,{size:14,strokeWidth:1.5}),label:`Changelog`,handle:ui}]},{divider:!0,icon:(0,X.jsx)(dt,{size:14,strokeWidth:1.5}),label:`Open home`,hidden:!location.search.includes(`file`),handle:li},{icon:(0,X.jsx)(qt,{size:14,strokeWidth:1.5}),label:`New notebook`,hidden:!location.search.includes(`file`),handle:ci}].filter(si).map(ai),n[2]=_e,n[3]=R,n[4]=A,n[5]=ye,n[6]=O,n[7]=L,n[8]=y,n[9]=z,n[10]=te,n[11]=he,n[12]=ge,n[13]=W,n[14]=o,n[15]=_,n[16]=ve,n[17]=De,n[18]=w,n[19]=v,n[20]=se,n[21]=pe,n[22]=G,n[23]=J,n[24]=me,n[25]=xe,n[26]=S,n[27]=E,n[28]=ae,n[29]=le,n[30]=ce,n[31]=Se,n[32]=oe,n[33]=we,n[34]=Ee,n[35]=Te,n[36]=b,n[37]=Ce,n[38]=I,n[39]=be,n[40]=M,n[41]=C.mode,n[42]=ke}else ke=n[42];return ke}function ai(e){return e.dropdown?{...e,dropdown:e.dropdown.filter(oi)}:e}function oi(e){return!e.hidden}function si(e){return!e.hidden}function ci(){let e=Ot();window.open(e,`_blank`)}function li(){let e=document.baseURI.split(`?`)[0];window.open(e,`_blank`,`noopener`)}function ui(){window.open(q.releasesPage,`_blank`)}function di(){window.open(q.youtube,`_blank`)}function fi(){window.open(q.discordLink,`_blank`)}function pi(){window.open(q.githubPage,`_blank`)}function mi(){window.open(q.docsPage,`_blank`)}function hi(e){return!e}function gi(e){return!e}function _i(e){return!e}function vi(e){return[e,{disabled:!1}]}function yi(e){return(0,X.jsx)(`div`,{className:`w-8 flex justify-end`,children:e&&(0,X.jsx)($e,{size:14})})}export{Fn as a,mn as c,nn as d,tn as f,In as i,cn as l,ni as n,En as o,en as p,Ln as r,hn as s,ii as t,rn as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e,t,u as n}from"./useEvent-xfs0Sn4r.js";import{D as r,Fa as i,Ha as a,h as o,ui as s,vt as c}from"./cells
|
|
1
|
+
import{f as e,t,u as n}from"./useEvent-xfs0Sn4r.js";import{D as r,Fa as i,Ha as a,h as o,ui as s,vt as c}from"./cells-CMLP1Dld.js";import{t as l}from"./compiler-runtime-CYIjoINj.js";import{g as u}from"./useEventListener-92uWqz-P.js";import{o as d}from"./dist-DiYjQAhI.js";import{r as f}from"./requests-C6_IaFh7.js";var p=l(),m=e(!1);function h(){let e=(0,p.c)(2),n=v(),r;return e[0]===n?r=e[1]:(r=()=>n(a(o())),e[0]=n,e[1]=r),t(r)}function g(e){let n=(0,p.c)(3),r=v(),i;return n[0]!==e||n[1]!==r?(i=()=>{e!==void 0&&r([e])},n[0]=e,n[1]=r,n[2]=i):i=n[2],t(i)}function _(){let e=(0,p.c)(2),n=v(),r;return e[0]===n?r=e[1]:(r=()=>n(i(o())),e[0]=n,e[1]=r),t(r)}function v(){let e=(0,p.c)(4),{prepareForRun:i}=r(),{sendRun:a}=f(),s=n(m),c;return e[0]!==i||e[1]!==a||e[2]!==s?(c=async e=>{if(e.length===0)return;let t=o();return s(!0),y({cellIds:e,sendRun:a,prepareForRun:i,notebook:t})},e[0]=i,e[1]=a,e[2]=s,e[3]=c):c=e[3],t(c)}async function y({cellIds:e,sendRun:t,prepareForRun:n,notebook:r}){if(e.length===0)return;let{cellHandles:i,cellData:a}=r,o=[];for(let t of e){let e=i[t]?.current?.editorView,r;e?(s(e)!==`markdown`&&d(e),r=c(e)):r=a[t]?.code||``,o.push(r),n({cellId:t})}await t({cellIds:e,codes:o}).catch(e=>{u.error(e)})}export{v as a,g as i,y as n,h as o,_ as r,m as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./useEvent-xfs0Sn4r.js";import{D as t,f as n,vt as r}from"./cells
|
|
1
|
+
import{t as e}from"./useEvent-xfs0Sn4r.js";import{D as t,f as n,vt as r}from"./cells-CMLP1Dld.js";import{t as i}from"./compiler-runtime-CYIjoINj.js";import{t as a}from"./jsx-runtime-B74pBk57.js";import{r as o}from"./useDeleteCell-CM1QzkEs.js";import{t as s}from"./use-toast-DpWHUGuF.js";var c=i(),l=a();function u(){let i=(0,c.c)(3),{splitCell:a,undoSplitCell:u}=t(),d;return i[0]!==a||i[1]!==u?(d=e=>{let t=n(e.cellId);if(!t)return;let i=r(t);a(e);let{dismiss:c}=s({title:`Cell split`,action:(0,l.jsx)(o,{"data-testid":`undo-split-button`,size:`sm`,variant:`outline`,onClick:()=>{u({...e,snapshot:i}),d()},children:`Undo`})}),d=c},i[0]=a,i[1]=u,i[2]=d):d=i[2],e(d)}export{u as t};
|
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-DTkztl_B.js"></script>
|
|
70
70
|
<link rel="modulepreload" crossorigin href="./assets/rolldown-runtime-B0Z9INg1.js">
|
|
71
71
|
<link rel="modulepreload" crossorigin href="./assets/react-CBDbhulC.js">
|
|
72
72
|
<link rel="modulepreload" crossorigin href="./assets/compiler-runtime-CYIjoINj.js">
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
<link rel="modulepreload" crossorigin href="./assets/useTheme-C-ri8BtY.js">
|
|
140
140
|
<link rel="modulepreload" crossorigin href="./assets/useAsyncData-Buhk-UgR.js">
|
|
141
141
|
<link rel="modulepreload" crossorigin href="./assets/purify.es-DrVcFY1Q.js">
|
|
142
|
-
<link rel="modulepreload" crossorigin href="./assets/cells
|
|
142
|
+
<link rel="modulepreload" crossorigin href="./assets/cells-CMLP1Dld.js">
|
|
143
143
|
<link rel="modulepreload" crossorigin href="./assets/get-DjNf4SIX.js">
|
|
144
144
|
<link rel="modulepreload" crossorigin href="./assets/_hasPath-BmRQipI0.js">
|
|
145
145
|
<link rel="modulepreload" crossorigin href="./assets/hasIn-yw4sIeJR.js">
|
|
@@ -152,42 +152,42 @@
|
|
|
152
152
|
<link rel="modulepreload" crossorigin href="./assets/copy-DlEomWzI.js">
|
|
153
153
|
<link rel="modulepreload" crossorigin href="./assets/extends-CvVTau-c.js">
|
|
154
154
|
<link rel="modulepreload" crossorigin href="./assets/esm-BHMOvJzM.js">
|
|
155
|
-
<link rel="modulepreload" crossorigin href="./assets/useAddCell-
|
|
156
|
-
<link rel="modulepreload" crossorigin href="./assets/readonly-python-code-
|
|
155
|
+
<link rel="modulepreload" crossorigin href="./assets/useAddCell-4vmbxGw5.js">
|
|
156
|
+
<link rel="modulepreload" crossorigin href="./assets/readonly-python-code-Cvz_-5Jh.js">
|
|
157
157
|
<link rel="modulepreload" crossorigin href="./assets/LazyAnyLanguageCodeMirror-C_cwGmDg.js">
|
|
158
158
|
<link rel="modulepreload" crossorigin href="./assets/micromark-factory-space-D9Dr-k4J.js">
|
|
159
159
|
<link rel="modulepreload" crossorigin href="./assets/chunk-5FQGJX7Z-CRg4xQWg.js">
|
|
160
|
-
<link rel="modulepreload" crossorigin href="./assets/markdown-renderer-
|
|
160
|
+
<link rel="modulepreload" crossorigin href="./assets/markdown-renderer-C_dn-F0h.js">
|
|
161
161
|
<link rel="modulepreload" crossorigin href="./assets/copy-icon-BUOcnUgJ.js">
|
|
162
|
-
<link rel="modulepreload" crossorigin href="./assets/useRunCells-
|
|
163
|
-
<link rel="modulepreload" crossorigin href="./assets/RenderHTML-
|
|
164
|
-
<link rel="modulepreload" crossorigin href="./assets/blob-
|
|
162
|
+
<link rel="modulepreload" crossorigin href="./assets/useRunCells-C2e26LhV.js">
|
|
163
|
+
<link rel="modulepreload" crossorigin href="./assets/RenderHTML-B73ExmWb.js">
|
|
164
|
+
<link rel="modulepreload" crossorigin href="./assets/blob-B6ayJpoQ.js">
|
|
165
165
|
<link rel="modulepreload" crossorigin href="./assets/kbd-Cwh96ZBE.js">
|
|
166
|
-
<link rel="modulepreload" crossorigin href="./assets/useInstallPackage-
|
|
166
|
+
<link rel="modulepreload" crossorigin href="./assets/useInstallPackage-Cr0TevQm.js">
|
|
167
167
|
<link rel="modulepreload" crossorigin href="./assets/share-BZW3tzEX.js">
|
|
168
168
|
<link rel="modulepreload" crossorigin href="./assets/events-CbeVJ6OD.js">
|
|
169
|
-
<link rel="modulepreload" crossorigin href="./assets/state-
|
|
169
|
+
<link rel="modulepreload" crossorigin href="./assets/state-DuyHh3Fk.js">
|
|
170
170
|
<link rel="modulepreload" crossorigin href="./assets/ErrorBoundary-CDVGFYfr.js">
|
|
171
171
|
<link rel="modulepreload" crossorigin href="./assets/config-B-r81uZ6.js">
|
|
172
172
|
<link rel="modulepreload" crossorigin href="./assets/tabs-Cy1qXLzH.js">
|
|
173
173
|
<link rel="modulepreload" crossorigin href="./assets/chevron-right-CKA5zVsM.js">
|
|
174
174
|
<link rel="modulepreload" crossorigin href="./assets/dropdown-menu-DnvwbPho.js">
|
|
175
175
|
<link rel="modulepreload" crossorigin href="./assets/html-to-image-D6GUC5q6.js">
|
|
176
|
-
<link rel="modulepreload" crossorigin href="./assets/download-
|
|
176
|
+
<link rel="modulepreload" crossorigin href="./assets/download-BRrPmrl5.js">
|
|
177
177
|
<link rel="modulepreload" crossorigin href="./assets/table-CUK1W5bI.js">
|
|
178
178
|
<link rel="modulepreload" crossorigin href="./assets/refresh-cw-Bf-rx_aV.js">
|
|
179
|
-
<link rel="modulepreload" crossorigin href="./assets/tree-actions-
|
|
179
|
+
<link rel="modulepreload" crossorigin href="./assets/tree-actions-5rg4Zqxe.js">
|
|
180
180
|
<link rel="modulepreload" crossorigin href="./assets/ellipsis-Dfik_tuW.js">
|
|
181
181
|
<link rel="modulepreload" crossorigin href="./assets/external-link-Bp3BxyRA.js">
|
|
182
182
|
<link rel="modulepreload" crossorigin href="./assets/spinner-Ck-Hgfvj.js">
|
|
183
183
|
<link rel="modulepreload" crossorigin href="./assets/message-circle-BQB1AIAg.js">
|
|
184
184
|
<link rel="modulepreload" crossorigin href="./assets/hat-glasses-C8LSY3HT.js">
|
|
185
185
|
<link rel="modulepreload" crossorigin href="./assets/package-DPlscLzt.js">
|
|
186
|
-
<link rel="modulepreload" crossorigin href="./assets/datasource-
|
|
186
|
+
<link rel="modulepreload" crossorigin href="./assets/datasource-DDYaCFxh.js">
|
|
187
187
|
<link rel="modulepreload" crossorigin href="./assets/alert-dmKwNsrp.js">
|
|
188
|
-
<link rel="modulepreload" crossorigin href="./assets/state-
|
|
189
|
-
<link rel="modulepreload" crossorigin href="./assets/cell-link-
|
|
190
|
-
<link rel="modulepreload" crossorigin href="./assets/MarimoErrorOutput-
|
|
188
|
+
<link rel="modulepreload" crossorigin href="./assets/state-CJnYkzhz.js">
|
|
189
|
+
<link rel="modulepreload" crossorigin href="./assets/cell-link-B7ZVGcSl.js">
|
|
190
|
+
<link rel="modulepreload" crossorigin href="./assets/MarimoErrorOutput-DwGwWsxV.js">
|
|
191
191
|
<link rel="modulepreload" crossorigin href="./assets/VisuallyHidden-CBMDmozt.js">
|
|
192
192
|
<link rel="modulepreload" crossorigin href="./assets/useDateFormatter-BiqAQ-zI.js">
|
|
193
193
|
<link rel="modulepreload" crossorigin href="./assets/en-US-yTIMUO13.js">
|
|
@@ -206,7 +206,7 @@
|
|
|
206
206
|
<link rel="modulepreload" crossorigin href="./assets/formats-C6s96nu2.js">
|
|
207
207
|
<link rel="modulepreload" crossorigin href="./assets/table-DmqOOjfe.js">
|
|
208
208
|
<link rel="modulepreload" crossorigin href="./assets/react-resizable-panels.browser.esm-BSRAHC4P.js">
|
|
209
|
-
<link rel="modulepreload" crossorigin href="./assets/JsonOutput-
|
|
209
|
+
<link rel="modulepreload" crossorigin href="./assets/JsonOutput-DCgOfk7t.js">
|
|
210
210
|
<link rel="modulepreload" crossorigin href="./assets/chart-no-axes-column-ChZdjJhj.js">
|
|
211
211
|
<link rel="modulepreload" crossorigin href="./assets/square-function-DkZweMAs.js">
|
|
212
212
|
<link rel="modulepreload" crossorigin href="./assets/spec-DKsAmLTi.js">
|
|
@@ -222,7 +222,7 @@
|
|
|
222
222
|
<link rel="modulepreload" crossorigin href="./assets/markdown-export-0rLbaq8b.js">
|
|
223
223
|
<link rel="modulepreload" crossorigin href="./assets/data-grid-types-DgHVN_Zz.js">
|
|
224
224
|
<link rel="modulepreload" crossorigin href="./assets/glide-utils-UGsrRHYj.js">
|
|
225
|
-
<link rel="modulepreload" crossorigin href="./assets/column-preview-
|
|
225
|
+
<link rel="modulepreload" crossorigin href="./assets/column-preview-oex3TMfq.js">
|
|
226
226
|
<link rel="modulepreload" crossorigin href="./assets/square-B58Ib8Ir.js">
|
|
227
227
|
<link rel="modulepreload" crossorigin href="./assets/triangle-alert-MihykDYG.js">
|
|
228
228
|
<link rel="modulepreload" crossorigin href="./assets/prop-types-Djf4O40e.js">
|
|
@@ -232,7 +232,7 @@
|
|
|
232
232
|
<link rel="modulepreload" crossorigin href="./assets/icons-CjLa9BiH.js">
|
|
233
233
|
<link rel="modulepreload" crossorigin href="./assets/useDeepCompareMemoize-CLytDdMl.js">
|
|
234
234
|
<link rel="modulepreload" crossorigin href="./assets/pathUtils-D7lk2rYQ.js">
|
|
235
|
-
<link rel="modulepreload" crossorigin href="./assets/floating-outline-
|
|
235
|
+
<link rel="modulepreload" crossorigin href="./assets/floating-outline-CG-zTB22.js">
|
|
236
236
|
<link rel="stylesheet" crossorigin href="./assets/cells-D-c15Ks-.css">
|
|
237
237
|
<link rel="stylesheet" crossorigin href="./assets/markdown-renderer-B7zTpxjS.css">
|
|
238
238
|
<link rel="stylesheet" crossorigin href="./assets/JsonOutput-BQtz7-np.css">
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
EyeIcon,
|
|
11
11
|
EyeOffIcon,
|
|
12
12
|
} from "lucide-react";
|
|
13
|
-
import {
|
|
13
|
+
import { useState } from "react";
|
|
14
14
|
import { useLocale } from "react-aria";
|
|
15
15
|
import {
|
|
16
16
|
AddDataframeChart,
|
|
@@ -98,11 +98,7 @@ export function ColumnExplorerPanel<TData>({
|
|
|
98
98
|
hiddenColumns: hiddenColumnCount,
|
|
99
99
|
} = getColumnCountForDisplay(table, totalColumns);
|
|
100
100
|
const { visible: visibleColumnCount } = getUserColumnVisibilityCounts(table);
|
|
101
|
-
const
|
|
102
|
-
const showOnlyColumnState = useMemo(
|
|
103
|
-
() => getShowOnlyColumnState(table),
|
|
104
|
-
[table, columnVisibility],
|
|
105
|
-
);
|
|
101
|
+
const showOnlyColumnState = getShowOnlyColumnState(table);
|
|
106
102
|
|
|
107
103
|
const { rowsAndColumns, hiddenSuffix } = prettifyRowColumnCount({
|
|
108
104
|
numRows: totalRows,
|
|
@@ -6,7 +6,7 @@ const Slot = SlotPrimitive.Slot;
|
|
|
6
6
|
|
|
7
7
|
import { useAtomValue } from "jotai";
|
|
8
8
|
import { ExternalLinkIcon, TriangleAlertIcon } from "lucide-react";
|
|
9
|
-
import React, { type PropsWithChildren,
|
|
9
|
+
import React, { type PropsWithChildren, useState } from "react";
|
|
10
10
|
import { CopyClipboardIcon } from "@/components/icons/copy-icon";
|
|
11
11
|
import { useImperativeModal } from "@/components/modal/ImperativeModal";
|
|
12
12
|
import { Button } from "@/components/ui/button";
|
|
@@ -94,8 +94,7 @@ export const FeedbackModal: React.FC<{
|
|
|
94
94
|
);
|
|
95
95
|
|
|
96
96
|
const notebook = useAtomValue(notebookAtom);
|
|
97
|
-
|
|
98
|
-
const errors = useMemo(() => getCellErrorEntries(store), [notebook]);
|
|
97
|
+
const errors = getCellErrorEntries(store);
|
|
99
98
|
|
|
100
99
|
const cells = notebook.cellIds.inOrderIds.map(
|
|
101
100
|
(cellId) => notebook.cellData[cellId],
|
|
@@ -145,10 +144,9 @@ export const FeedbackModal: React.FC<{
|
|
|
145
144
|
return contents;
|
|
146
145
|
}, [includeCode, notebookSourceAvailable, readCode]);
|
|
147
146
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}
|
|
147
|
+
let githubIssueUrl = Constants.bugReportUrl;
|
|
148
|
+
let omitted: string[] = [];
|
|
149
|
+
if (environment) {
|
|
152
150
|
const fields: Record<string, string> = {
|
|
153
151
|
env: formatEnvironmentSection(environment),
|
|
154
152
|
};
|
|
@@ -158,8 +156,11 @@ export const FeedbackModal: React.FC<{
|
|
|
158
156
|
if (includeCode && codeRequest.data) {
|
|
159
157
|
fields["reproduction-code"] = formatCodeSection(codeRequest.data);
|
|
160
158
|
}
|
|
161
|
-
|
|
162
|
-
|
|
159
|
+
({ url: githubIssueUrl, omitted } = buildBugReportUrl(
|
|
160
|
+
Constants.bugReportUrl,
|
|
161
|
+
fields,
|
|
162
|
+
));
|
|
163
|
+
}
|
|
163
164
|
|
|
164
165
|
const omittedLabels = omitted
|
|
165
166
|
.map((field) =>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import { render, screen } from "@testing-library/react";
|
|
4
|
+
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
5
|
+
import { ReadonlyDiff } from "../readonly-diff";
|
|
6
|
+
|
|
7
|
+
const mocks = vi.hoisted(() => ({
|
|
8
|
+
mergeView: vi.fn(),
|
|
9
|
+
useTheme: vi.fn(),
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
vi.mock("@codemirror/merge", () => ({
|
|
13
|
+
unifiedMergeView: mocks.mergeView,
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
vi.mock("@uiw/react-codemirror", () => ({
|
|
17
|
+
default: ({ theme, value }: { theme: string; value: string }) => (
|
|
18
|
+
<div data-testid="code-mirror" data-theme={theme} data-value={value} />
|
|
19
|
+
),
|
|
20
|
+
}));
|
|
21
|
+
|
|
22
|
+
vi.mock("@/theme/useTheme", () => ({
|
|
23
|
+
useTheme: mocks.useTheme,
|
|
24
|
+
}));
|
|
25
|
+
|
|
26
|
+
describe("ReadonlyDiff", () => {
|
|
27
|
+
beforeEach(() => {
|
|
28
|
+
mocks.mergeView.mockReset();
|
|
29
|
+
mocks.mergeView.mockReturnValue([]);
|
|
30
|
+
mocks.useTheme.mockReturnValue({ theme: "light" });
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it("updates modified code without rebuilding the diff extensions", () => {
|
|
34
|
+
const { rerender } = render(
|
|
35
|
+
<ReadonlyDiff original="before" modified="first revision" />,
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
expect(screen.getByTestId("code-mirror")).toHaveAttribute(
|
|
39
|
+
"data-value",
|
|
40
|
+
"first revision",
|
|
41
|
+
);
|
|
42
|
+
expect(mocks.mergeView).toHaveBeenCalledTimes(1);
|
|
43
|
+
|
|
44
|
+
rerender(<ReadonlyDiff original="before" modified="second revision" />);
|
|
45
|
+
|
|
46
|
+
expect(screen.getByTestId("code-mirror")).toHaveAttribute(
|
|
47
|
+
"data-value",
|
|
48
|
+
"second revision",
|
|
49
|
+
);
|
|
50
|
+
expect(mocks.mergeView).toHaveBeenCalledTimes(1);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it("rebuilds diff extensions when the original code changes", () => {
|
|
54
|
+
const { rerender } = render(
|
|
55
|
+
<ReadonlyDiff original="before" modified="after" />,
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
rerender(<ReadonlyDiff original="earlier" modified="after" />);
|
|
59
|
+
|
|
60
|
+
expect(mocks.mergeView).toHaveBeenCalledTimes(2);
|
|
61
|
+
expect(mocks.mergeView).toHaveBeenLastCalledWith(
|
|
62
|
+
expect.objectContaining({ original: "earlier" }),
|
|
63
|
+
);
|
|
64
|
+
});
|
|
65
|
+
});
|