@marimo-team/frontend 0.25.2-dev106 → 0.25.2-dev109
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-y7gb1pfn.js → CellStatus-B4z-D5H1.js} +1 -1
- package/dist/assets/{ErrorBoundary-BaJR01Nz.js → ErrorBoundary-R-fjO4Cz.js} +2 -2
- package/dist/assets/{JsonOutput-vAkP2zUe.js → JsonOutput-BeLVZDXh.js} +1 -1
- package/dist/assets/{MarimoErrorOutput-3mDkRE60.js → MarimoErrorOutput-B2Ajs_V-.js} +1 -1
- package/dist/assets/{RenderHTML-By5MgTmt.js → RenderHTML-Chx9oQ4S.js} +1 -1
- package/dist/assets/{RunButton-B7SvGNMi.js → RunButton-DnSopQoo.js} +1 -1
- package/dist/assets/{add-cell-with-ai-D7aEUdUW.js → add-cell-with-ai-9oZmQ0tX.js} +1 -1
- package/dist/assets/{add-connection-dialog-C05Sy6Em.js → add-connection-dialog-C82vMzr5.js} +1 -1
- package/dist/assets/{agent-panel-DestmNKB.js → agent-panel-8bu-4RMv.js} +1 -1
- package/dist/assets/{ai-model-dropdown-CB0zKJVn.js → ai-model-dropdown-BKQARUae.js} +1 -1
- package/dist/assets/{app-config-button-h0kocVn3.js → app-config-button-DKoDBgwu.js} +1 -1
- package/dist/assets/{blob-Cvmfh5O4.js → blob-BJi30p8H.js} +1 -1
- package/dist/assets/{cell-editor-9QWD4Eoi.js → cell-editor-CKwmt_18.js} +1 -1
- package/dist/assets/{cell-link-DbRcdG3a.js → cell-link-BI2FitQ_.js} +1 -1
- package/dist/assets/{cells-B6il7NvU.js → cells-D73Y_xmw.js} +52 -52
- package/dist/assets/{chat-display-BytbDkjp.js → chat-display-CqK2mMHm.js} +1 -1
- package/dist/assets/{chat-panel-Dn0i8IDu.js → chat-panel-BgJcxa4q.js} +1 -1
- package/dist/assets/{chat-ui-C2vsp5te.js → chat-ui-CK-mgi6S.js} +1 -1
- package/dist/assets/{column-preview-BHkXVDRB.js → column-preview-biRDE_Oz.js} +1 -1
- package/dist/assets/{command-palette-CRbI5lmZ.js → command-palette-CHUS5_VG.js} +1 -1
- package/dist/assets/{common-BBoeGRjW.js → common-8ezkeamF.js} +1 -1
- package/dist/assets/{components-BJxtRyNP.js → components-FsfAPhUd.js} +1 -1
- package/dist/assets/{datasource-DY_Q9gCe.js → datasource-Dniq1d2k.js} +1 -1
- package/dist/assets/{dependency-graph-panel-e1M0eCTG.js → dependency-graph-panel-Ci62Tv1x.js} +1 -1
- package/dist/assets/{documentation-panel-KPshYHWI.js → documentation-panel-B-0JfpSn.js} +1 -1
- package/dist/assets/{download-DKJ7bLP9.js → download-CEG5vQri.js} +1 -1
- package/dist/assets/{edit-page-BLjefdmz.js → edit-page-VV7jun46.js} +4 -4
- package/dist/assets/{error-entries-BonnEKm-.js → error-entries-Frq0QZL-.js} +1 -1
- package/dist/assets/{error-panel-SKl73j_w.js → error-panel-BeSB6k3e.js} +1 -1
- package/dist/assets/feedback-button-CrqeO2wx.js +1 -0
- package/dist/assets/{feedback-button-C_PtEG12.js → feedback-button-DALE40Cq.js} +1 -1
- package/dist/assets/{file-explorer-panel-BTmHy6bB.js → file-explorer-panel-DkhJMce7.js} +1 -1
- package/dist/assets/{file-name-input-L5-MM5IK.js → file-name-input-DsLb3kUE.js} +1 -1
- package/dist/assets/{floating-outline-Cj_Zfo0m.js → floating-outline-Bivo15Ee.js} +1 -1
- package/dist/assets/{gallery-page-1CBmiJsq.js → gallery-page-BipSEe8i.js} +1 -1
- package/dist/assets/{glide-data-editor-CfN8_71N.js → glide-data-editor-DWxXZHhh.js} +1 -1
- package/dist/assets/{home-page-my0-GXpR.js → home-page-4xyvW9LC.js} +1 -1
- package/dist/assets/{hooks-CpM5Nux7.js → hooks-B7y2bbmR.js} +1 -1
- package/dist/assets/{index-BBfc1T4f.js → index-DLi7reLY.js} +3 -3
- package/dist/assets/{layout-D7t0uMv2.js → layout-B5DZz9ah.js} +3 -3
- package/dist/assets/{logs-panel-BQ7r0B3O.js → logs-panel-CswvaDqE.js} +1 -1
- package/dist/assets/{markdown-renderer-BGhL7GlA.js → markdown-renderer-CErbddaa.js} +1 -1
- package/dist/assets/{name-cell-input-gZHMbMFa.js → name-cell-input-DXf9tZ25.js} +1 -1
- package/dist/assets/{outline-panel-CSc24F_g.js → outline-panel-BPlLwpVm.js} +1 -1
- package/dist/assets/{packages-panel-1lOO--8d.js → packages-panel-CoIvCGdp.js} +1 -1
- package/dist/assets/{panel-accordion-state-DR9dzoVf.js → panel-accordion-state-B50Y_3hb.js} +1 -1
- package/dist/assets/{panels-B-362w2o.js → panels-j8cWK9B8.js} +1 -1
- package/dist/assets/{process-output-GdDkGBd4.js → process-output-Bfoxbqpj.js} +1 -1
- package/dist/assets/{readonly-code-display-DvCqBdEx.js → readonly-code-display-BusLGSPF.js} +1 -1
- package/dist/assets/{readonly-python-code-D61HNA9A.js → readonly-python-code-CTbOf95g.js} +1 -1
- package/dist/assets/{reveal-component-DOrRaoYo.js → reveal-component-D3wlU8v1.js} +1 -1
- package/dist/assets/{run-page-BdD-nBNW.js → run-page-B03JZs0U.js} +1 -1
- package/dist/assets/{runtime-details-state-DOSWTLDN.js → runtime-details-state-Ddpsoriz.js} +1 -1
- package/dist/assets/{scratchpad-panel-P0IUu7X-.js → scratchpad-panel-B9RdvhAM.js} +1 -1
- package/dist/assets/{session-panel-BfsjtxYG.js → session-panel-D3E0Ag30.js} +1 -1
- package/dist/assets/{snippets-panel-Bj5bokY-.js → snippets-panel-Bby1zIJE.js} +1 -1
- package/dist/assets/{state-CZOWsp3e.js → state-ENE4B_JH.js} +1 -1
- package/dist/assets/{state-CKlS-nyB.js → state-zdyODrb0.js} +1 -1
- package/dist/assets/{tracing-DpWBRQfq.js → tracing-De9k9D6u.js} +1 -1
- package/dist/assets/{tracing-panel-N0dAe1M7.js → tracing-panel-DvISFiEI.js} +2 -2
- package/dist/assets/{tree-actions-6YzAxpKB.js → tree-actions-D5HC2yfb.js} +1 -1
- package/dist/assets/{useAddCell-DwSNezIU.js → useAddCell-DAJ9Wd-E.js} +1 -1
- package/dist/assets/{useCellActionButton-9U0UBP8q.js → useCellActionButton-CWhycKft.js} +1 -1
- package/dist/assets/{useDeleteCell-Dyusf6t2.js → useDeleteCell-8ByYNceO.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-DNn4Dq9X.js → useDependencyPanelTab-Dz37hZtr.js} +1 -1
- package/dist/assets/{useNotebookActions-DxslFCyH.js → useNotebookActions-CYbHF8MU.js} +1 -1
- package/dist/assets/{useRunCells-BpLdDZbV.js → useRunCells-BVoQp_ne.js} +1 -1
- package/dist/assets/{useSplitCell-FDzqmtiG.js → useSplitCell-Ba_Zm0ID.js} +1 -1
- package/dist/index.html +19 -19
- package/package.json +1 -1
- package/src/core/cells/__tests__/document-roundtrip.test.ts +16 -0
- package/src/core/codemirror/language/embedded/__tests__/embedded-python.test.ts +138 -26
- package/src/core/codemirror/language/embedded/embedded-python.ts +47 -13
- package/src/core/codemirror/language/embedded/latex.ts +20 -13
- package/dist/assets/feedback-button-BCK8Ksty.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{f as t,l as n,u as r}from"./useEvent-Dfcbgjhg.js";import{t as i}from"./react-DVplv7_D.js";import{M as a,dr as o,oo as s,q as c}from"./cells-B6il7NvU.js";import{t as l}from"./compiler-runtime-BrajqUja.js";import{t as u}from"./cn-ldLVeaqm.js";import{t as d}from"./jsx-runtime-B74pBk57.js";import{t as f}from"./tooltip-C9TuY18o.js";import{t as p}from"./createLucideIcon-DfJ2oMlA.js";import{o as m}from"./paths-bkIFVj8h.js";import{a as h}from"./useNumberFormatter-D7O_26UI.js";import{t as g}from"./chevron-right-eAtVhbNZ.js";import{t as _}from"./circle-check-BCurAHEb.js";import{t as v}from"./circle-play-CYIb0qT6.js";import{r as y}from"./useTheme-COhSHkCj.js";import{n as b}from"./CellStatus-y7gb1pfn.js";import{r as x,t as S}from"./react-vega-C3rYGtP6.js";import{t as C}from"./cell-link-DbRcdG3a.js";import{n as w,r as T,t as E}from"./react-resizable-panels.browser.esm-Dbe0MrFr.js";import{t as D}from"./bundle.esm-D3tw5rqW.js";import{t as O}from"./empty-state-BaCKb7o3.js";import{r as k}from"./panel-context-C2QXpKfx.js";import{t as A}from"./clear-button-p6YcvzLy.js";import{n as j,t as M}from"./runs-BLp5jezv.js";var N=p(`circle-ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M17 12h.01`,key:`1m0b6t`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M7 12h.01`,key:`eqddd0`}]]),P=e(i(),1),F=l(),I=`hoveredCellId`,L=`cellHover`,R=`cellNum`,z=`cell`,B=`startTimestamp`,V=`endTimestamp`,H=`status`;function U(e,t,n,r){let i=`hoursminutessecondsmilliseconds`;return{$schema:`https://vega.github.io/schema/vega-lite/v6.json`,background:r===`dark`?`black`:void 0,mark:{type:`bar`,cornerRadius:2},params:[{name:I,bind:{element:`#${t}`}},{name:L,select:{type:`point`,on:`mouseover`,fields:[z],clear:`mouseout`}}],height:{step:n===`sideBySide`?26:21},encoding:{y:{field:R,scale:{paddingInner:.2},sort:{field:`sortPriority`},title:`cell`,axis:n===`sideBySide`?null:void 0},x:{field:B,type:`temporal`,axis:{orient:`top`,title:null}},x2:{field:V,type:`temporal`},tooltip:[{field:B,type:`temporal`,timeUnit:i,title:`Start`},{field:V,type:`temporal`,timeUnit:i,title:`End`}],size:{value:{expr:`${I} == toString(datum.${z}) ? 19.5 : 18`}},color:{field:H,scale:{domain:[`success`,`error`],range:[`#37BE5F`,`red`]},legend:null}},data:{values:e},transform:[{calculate:`datum.${H} === 'queued' ? 9999999999999 : datum.${B}`,as:`sortPriority`}],config:{view:{stroke:`transparent`}}}}function W(e){try{let t=new Date(e*1e3);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}.${String(t.getMilliseconds()).padStart(3,`0`)}`}catch{return``}}var G=d(),K=t(new Map),q=()=>{let e=(0,F.c)(34),{runIds:t,runMap:r}=n(M),i=n(K),{clearRuns:a}=j(),{theme:o}=y(),[s,c]=(0,P.useState)(`above`),l=k(),u;e[0]===s?u=e[1]:(u=()=>{c(s===`above`?`sideBySide`:`above`)},e[0]=s,e[1]=u);let d=u;if(t.length===0){let t;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsx)(O,{title:`No traces`,description:(0,G.jsx)(`span`,{children:`Cells that have ran will appear here.`}),icon:(0,G.jsx)(m,{})}),e[2]=t):t=e[2],t}let f;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,G.jsx)(`label`,{htmlFor:`chartPosition`,className:`text-xs`,children:`Inline chart`}),e[3]=f):f=e[3];let p=s===`sideBySide`,h;e[4]!==p||e[5]!==d?(h=(0,G.jsxs)(`div`,{className:`flex flex-row gap-1 items-center`,children:[f,(0,G.jsx)(`input`,{type:`checkbox`,name:`chartPosition`,"data-testid":`chartPosition`,onClick:d,defaultChecked:p,className:`h-3 cursor-pointer`})]}),e[4]=p,e[5]=d,e[6]=h):h=e[6];let g;e[7]===a?g=e[8]:(g=(0,G.jsx)(A,{dataTestId:`clear-traces-button`,onClick:a}),e[7]=a,e[8]=g);let _;e[9]!==h||e[10]!==g?(_=(0,G.jsxs)(`div`,{className:`flex flex-row justify-start gap-3`,children:[h,g]}),e[9]=h,e[10]=g,e[11]=_):_=e[11];let v;if(e[12]!==s||e[13]!==i||e[14]!==t||e[15]!==r||e[16]!==o){let n;e[18]!==s||e[19]!==i||e[20]!==r||e[21]!==o?(n=(e,t)=>{let n=r.get(e);return n?(0,G.jsx)(J,{run:n,isExpanded:i.get(n.runId),isMostRecentRun:t===0,chartPosition:s,theme:o},n.runId):null},e[18]=s,e[19]=i,e[20]=r,e[21]=o,e[22]=n):n=e[22],v=t.map(n),e[12]=s,e[13]=i,e[14]=t,e[15]=r,e[16]=o,e[17]=v}else v=e[17];let b;e[23]===v?b=e[24]:(b=(0,G.jsx)(`div`,{className:`flex flex-col gap-3`,children:v}),e[23]=v,e[24]=b);let x;e[25]!==_||e[26]!==b?(x=(0,G.jsxs)(`div`,{className:`py-1 px-2 overflow-y-scroll h-full`,children:[_,b]}),e[25]=_,e[26]=b,e[27]=x):x=e[27];let S=x;if(l===`sidebar`)return S;let C;e[28]===S?C=e[29]:(C=(0,G.jsx)(E,{defaultSize:50,minSize:30,maxSize:80,children:S}),e[28]=S,e[29]=C);let D;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,G.jsx)(T,{className:`w-1 bg-border hover:bg-primary/50 transition-colors`}),e[30]=D):D=e[30];let N;e[31]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,G.jsx)(E,{defaultSize:50,children:(0,G.jsx)(`div`,{})}),e[31]=N):N=e[31];let I;return e[32]===C?I=e[33]:(I=(0,G.jsxs)(w,{direction:`horizontal`,className:`h-full`,children:[C,D,N]}),e[32]=C,e[33]=I),I},J=e=>{let t=(0,F.c)(22),{run:n,isMostRecentRun:i,chartPosition:a,isExpanded:o,theme:s}=e,l=o,u=r(K);l??=i;let d;t[0]!==l||t[1]!==n.runId||t[2]!==u?(d=()=>{u(e=>{let t=new Map(e);return t.set(n.runId,!l),t})},t[0]=l,t[1]=n.runId,t[2]=u,t[3]=d):d=t[3];let f=d,p=l?h:g,m;t[4]===p?m=t[5]:(m=(0,G.jsx)(p,{height:16,className:`inline`}),t[4]=p,t[5]=m);let _=m,v;t[6]===n.runStartTime?v=t[7]:(v=c(n.runStartTime),t[6]=n.runStartTime,t[7]=v);let y;t[8]!==_||t[9]!==f||t[10]!==v?(y=(0,G.jsxs)(`span`,{className:`text-sm cursor-pointer`,onClick:f,children:[`Run - `,v,_]}),t[8]=_,t[9]=f,t[10]=v,t[11]=y):y=t[11];let b=y;if(!l){let e;t[12]===b?e=t[13]:(e=(0,G.jsx)(`pre`,{className:`font-mono font-semibold`,children:b}),t[12]=b,t[13]=e);let r;return t[14]!==n.runId||t[15]!==e?(r=(0,G.jsx)(`div`,{className:`flex flex-col`,children:e},n.runId),t[14]=n.runId,t[15]=e,t[16]=r):r=t[16],r}let x;return t[17]!==a||t[18]!==n||t[19]!==s||t[20]!==b?(x=(0,G.jsx)(Y,{run:n,chartPosition:a,theme:s,title:b},n.runId),t[17]=a,t[18]=n,t[19]=s,t[20]=b,t[21]=x):x=t[21],x},Y=e=>{let t=(0,F.c)(40),{run:n,chartPosition:r,theme:i,title:s}=e,[c,l]=(0,P.useState)(),u=(0,P.useRef)(null),{ref:d,width:f}=D(),p=f===void 0?300:f,m=a(),h,g;if(t[0]!==m||t[1]!==r||t[2]!==n.cellRuns||t[3]!==n.runId||t[4]!==i){let e=[...n.cellRuns.values()].map(e=>{let t=e.elapsedTime??0;return{cell:e.cellId,cellNum:m.inOrderIds.indexOf(e.cellId),startTimestamp:W(e.startTime),endTimestamp:W(e.startTime+t),elapsedTime:o(t*1e3),status:e.status}});h=`hiddenInputElement-${n.runId}`,g=x(U(e,h,r,i)),t[0]=m,t[1]=r,t[2]=n.cellRuns,t[3]=n.runId,t[4]=i,t[5]=h,t[6]=g}else h=t[5],g=t[6];let _=g.spec,v=i===`dark`?`dark`:void 0,y=p-50,b=r===`above`?120:100,C;t[7]!==v||t[8]!==y||t[9]!==b?(C={theme:v,width:y,height:b,actions:!1,mode:`vega`,renderer:`canvas`},t[7]=v,t[8]=y,t[9]=b,t[10]=C):C=t[10];let w;t[11]!==C||t[12]!==_?(w={ref:u,spec:_,options:C},t[11]=C,t[12]=_,t[13]=w):w=t[13];let T=S(w),E;t[14]===T?.view?E=t[15]:(E=()=>{let e=[{signalName:L,handler:(e,t)=>{let n=t.cell?.[0]??void 0;l(n??null)}}];return e.forEach(e=>{let{signalName:t,handler:n}=e;T?.view.addSignalListener(t,n)}),()=>{e.forEach(e=>{let{signalName:t,handler:n}=e;T?.view.removeSignalListener(t,n)})}},t[14]=T?.view,t[15]=E);let O;t[16]===T?O=t[17]:(O=[T],t[16]=T,t[17]=O),(0,P.useEffect)(E,O);let k;t[18]!==h||t[19]!==c||t[20]!==n?(k=(0,G.jsx)(X,{run:n,hoveredCellId:c,hiddenInputElementId:h}),t[18]=h,t[19]=c,t[20]=n,t[21]=k):k=t[21];let A=k,j=r===`sideBySide`?`-mt-0.5 flex-1`:``,M;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,G.jsx)(P.Suspense,{children:(0,G.jsx)(`div`,{ref:u})}),t[22]=M):M=t[22];let N;t[23]!==d||t[24]!==j?(N=(0,G.jsx)(`div`,{className:j,ref:d,children:M}),t[23]=d,t[24]=j,t[25]=N):N=t[25];let I=N;if(r===`above`){let e;t[26]!==I||t[27]!==s||t[28]!==A?(e=(0,G.jsxs)(`pre`,{className:`font-mono font-semibold`,children:[s,I,A]}),t[26]=I,t[27]=s,t[28]=A,t[29]=e):e=t[29];let r;return t[30]!==n.runId||t[31]!==e?(r=(0,G.jsx)(`div`,{className:`flex flex-col`,children:e},n.runId),t[30]=n.runId,t[31]=e,t[32]=r):r=t[32],r}let R;t[33]!==s||t[34]!==A?(R=(0,G.jsxs)(`pre`,{className:`font-mono font-semibold`,children:[s,A]}),t[33]=s,t[34]=A,t[35]=R):R=t[35];let z;return t[36]!==I||t[37]!==n.runId||t[38]!==R?(z=(0,G.jsxs)(`div`,{className:`flex flex-row`,children:[R,I]},n.runId),t[36]=I,t[37]=n.runId,t[38]=R,t[39]=z):z=t[39],z},X=e=>{let t=(0,F.c)(12),{run:n,hoveredCellId:r,hiddenInputElementId:i}=e,a=(0,P.useRef)(null),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=e=>{a.current&&(a.current.value=String(e),a.current.dispatchEvent(new Event(`input`,{bubbles:!0})))},t[0]=o):o=t[0];let s=o,c=r||``,l;t[1]!==i||t[2]!==c?(l=(0,G.jsx)(`input`,{type:`text`,id:i,defaultValue:c,hidden:!0,ref:a}),t[1]=i,t[2]=c,t[3]=l):l=t[3];let u;t[4]===n.cellRuns?u=t[5]:(u=[...n.cellRuns.values()],t[4]=n.cellRuns,t[5]=u);let d;t[6]!==r||t[7]!==u?(d=u.map(e=>(0,G.jsx)(Q,{cellRun:e,hovered:e.cellId===r,dispatchHoverEvent:s},e.cellId)),t[6]=r,t[7]=u,t[8]=d):d=t[8];let f;return t[9]!==l||t[10]!==d?(f=(0,G.jsxs)(`div`,{className:`text-xs mt-0.5 ml-3 flex flex-col gap-0.5`,children:[l,d]}),t[9]=l,t[10]=d,t[11]=f):f=t[11],f},Z={success:(0,G.jsx)(_,{color:`green`,size:14}),running:(0,G.jsx)(v,{color:`var(--blue-10)`,size:14}),error:(0,G.jsx)(s,{color:`red`,size:14}),queued:(0,G.jsx)(N,{color:`grey`,size:14})},Q=e=>{let t=(0,F.c)(39),{cellRun:n,hovered:r,dispatchHoverEvent:i}=e,a;t[0]===n.elapsedTime?a=t[1]:(a=n.elapsedTime?o(n.elapsedTime*1e3):`-`,t[0]=n.elapsedTime,t[1]=a);let s=a,l;t[2]!==n.elapsedTime||t[3]!==s?(l=n.elapsedTime?(0,G.jsxs)(`span`,{children:[`This cell took `,(0,G.jsx)(b,{elapsedTime:s}),` to run`]}):(0,G.jsx)(`span`,{children:`This cell has not been run`}),t[2]=n.elapsedTime,t[3]=s,t[4]=l):l=t[4];let d=l,p;t[5]!==n.cellId||t[6]!==i?(p=()=>{i(n.cellId)},t[5]=n.cellId,t[6]=i,t[7]=p):p=t[7];let m=p,h;t[8]===i?h=t[9]:(h=()=>{i(null)},t[8]=i,t[9]=h);let g=h,_=r&&`bg-(--gray-3) opacity-100`,v;t[10]===_?v=t[11]:(v=u(`flex flex-row gap-2 py-1 px-1 opacity-70 hover:bg-(--gray-3) hover:opacity-100`,_),t[10]=_,t[11]=v);let y;t[12]===n.startTime?y=t[13]:(y=c(n.startTime),t[12]=n.startTime,t[13]=y);let x;t[14]===y?x=t[15]:(x=(0,G.jsxs)(`span`,{className:`text-(--gray-10) dark:text-(--gray-11)`,children:[`[`,y,`]`]}),t[14]=y,t[15]=x);let S;t[16]===n.cellId?S=t[17]:(S=(0,G.jsxs)(`span`,{className:`text-(--gray-10) w-16 overflow-hidden`,children:[`(`,(0,G.jsx)(C,{cellId:n.cellId}),`)`]}),t[16]=n.cellId,t[17]=S);let w;t[18]===n.code?w=t[19]:(w=(0,G.jsx)(`span`,{className:`w-40 truncate -ml-1`,children:n.code}),t[18]=n.code,t[19]=w);let T;t[20]===s?T=t[21]:(T=(0,G.jsx)(`span`,{className:`text-(--gray-10) dark:text-(--gray-11)`,children:s}),t[20]=s,t[21]=T);let E;t[22]!==d||t[23]!==T?(E=(0,G.jsx)(f,{content:d,children:T}),t[22]=d,t[23]=T,t[24]=E):E=t[24];let D=Z[n.status],O;t[25]!==n.status||t[26]!==D?(O=(0,G.jsx)(f,{content:n.status,children:D}),t[25]=n.status,t[26]=D,t[27]=O):O=t[27];let k;t[28]!==E||t[29]!==O?(k=(0,G.jsxs)(`div`,{className:`flex flex-row gap-1 w-16 justify-end -ml-2`,children:[E,O]}),t[28]=E,t[29]=O,t[30]=k):k=t[30];let A;return t[31]!==m||t[32]!==g||t[33]!==w||t[34]!==k||t[35]!==v||t[36]!==x||t[37]!==S?(A=(0,G.jsxs)(`div`,{className:v,onMouseEnter:m,onMouseLeave:g,children:[x,S,w,k]}),t[31]=m,t[32]=g,t[33]=w,t[34]=k,t[35]=v,t[36]=x,t[37]=S,t[38]=A):A=t[38],A};export{q as Tracing};
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{f as t,l as n,u as r}from"./useEvent-Dfcbgjhg.js";import{t as i}from"./react-DVplv7_D.js";import{M as a,dr as o,oo as s,q as c}from"./cells-D73Y_xmw.js";import{t as l}from"./compiler-runtime-BrajqUja.js";import{t as u}from"./cn-ldLVeaqm.js";import{t as d}from"./jsx-runtime-B74pBk57.js";import{t as f}from"./tooltip-C9TuY18o.js";import{t as p}from"./createLucideIcon-DfJ2oMlA.js";import{o as m}from"./paths-bkIFVj8h.js";import{a as h}from"./useNumberFormatter-D7O_26UI.js";import{t as g}from"./chevron-right-eAtVhbNZ.js";import{t as _}from"./circle-check-BCurAHEb.js";import{t as v}from"./circle-play-CYIb0qT6.js";import{r as y}from"./useTheme-COhSHkCj.js";import{n as b}from"./CellStatus-B4z-D5H1.js";import{r as x,t as S}from"./react-vega-C3rYGtP6.js";import{t as C}from"./cell-link-BI2FitQ_.js";import{n as w,r as T,t as E}from"./react-resizable-panels.browser.esm-Dbe0MrFr.js";import{t as D}from"./bundle.esm-D3tw5rqW.js";import{t as O}from"./empty-state-BaCKb7o3.js";import{r as k}from"./panel-context-C2QXpKfx.js";import{t as A}from"./clear-button-p6YcvzLy.js";import{n as j,t as M}from"./runs-BLp5jezv.js";var N=p(`circle-ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M17 12h.01`,key:`1m0b6t`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M7 12h.01`,key:`eqddd0`}]]),P=e(i(),1),F=l(),I=`hoveredCellId`,L=`cellHover`,R=`cellNum`,z=`cell`,B=`startTimestamp`,V=`endTimestamp`,H=`status`;function U(e,t,n,r){let i=`hoursminutessecondsmilliseconds`;return{$schema:`https://vega.github.io/schema/vega-lite/v6.json`,background:r===`dark`?`black`:void 0,mark:{type:`bar`,cornerRadius:2},params:[{name:I,bind:{element:`#${t}`}},{name:L,select:{type:`point`,on:`mouseover`,fields:[z],clear:`mouseout`}}],height:{step:n===`sideBySide`?26:21},encoding:{y:{field:R,scale:{paddingInner:.2},sort:{field:`sortPriority`},title:`cell`,axis:n===`sideBySide`?null:void 0},x:{field:B,type:`temporal`,axis:{orient:`top`,title:null}},x2:{field:V,type:`temporal`},tooltip:[{field:B,type:`temporal`,timeUnit:i,title:`Start`},{field:V,type:`temporal`,timeUnit:i,title:`End`}],size:{value:{expr:`${I} == toString(datum.${z}) ? 19.5 : 18`}},color:{field:H,scale:{domain:[`success`,`error`],range:[`#37BE5F`,`red`]},legend:null}},data:{values:e},transform:[{calculate:`datum.${H} === 'queued' ? 9999999999999 : datum.${B}`,as:`sortPriority`}],config:{view:{stroke:`transparent`}}}}function W(e){try{let t=new Date(e*1e3);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}:${String(t.getSeconds()).padStart(2,`0`)}.${String(t.getMilliseconds()).padStart(3,`0`)}`}catch{return``}}var G=d(),K=t(new Map),q=()=>{let e=(0,F.c)(34),{runIds:t,runMap:r}=n(M),i=n(K),{clearRuns:a}=j(),{theme:o}=y(),[s,c]=(0,P.useState)(`above`),l=k(),u;e[0]===s?u=e[1]:(u=()=>{c(s===`above`?`sideBySide`:`above`)},e[0]=s,e[1]=u);let d=u;if(t.length===0){let t;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsx)(O,{title:`No traces`,description:(0,G.jsx)(`span`,{children:`Cells that have ran will appear here.`}),icon:(0,G.jsx)(m,{})}),e[2]=t):t=e[2],t}let f;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,G.jsx)(`label`,{htmlFor:`chartPosition`,className:`text-xs`,children:`Inline chart`}),e[3]=f):f=e[3];let p=s===`sideBySide`,h;e[4]!==p||e[5]!==d?(h=(0,G.jsxs)(`div`,{className:`flex flex-row gap-1 items-center`,children:[f,(0,G.jsx)(`input`,{type:`checkbox`,name:`chartPosition`,"data-testid":`chartPosition`,onClick:d,defaultChecked:p,className:`h-3 cursor-pointer`})]}),e[4]=p,e[5]=d,e[6]=h):h=e[6];let g;e[7]===a?g=e[8]:(g=(0,G.jsx)(A,{dataTestId:`clear-traces-button`,onClick:a}),e[7]=a,e[8]=g);let _;e[9]!==h||e[10]!==g?(_=(0,G.jsxs)(`div`,{className:`flex flex-row justify-start gap-3`,children:[h,g]}),e[9]=h,e[10]=g,e[11]=_):_=e[11];let v;if(e[12]!==s||e[13]!==i||e[14]!==t||e[15]!==r||e[16]!==o){let n;e[18]!==s||e[19]!==i||e[20]!==r||e[21]!==o?(n=(e,t)=>{let n=r.get(e);return n?(0,G.jsx)(J,{run:n,isExpanded:i.get(n.runId),isMostRecentRun:t===0,chartPosition:s,theme:o},n.runId):null},e[18]=s,e[19]=i,e[20]=r,e[21]=o,e[22]=n):n=e[22],v=t.map(n),e[12]=s,e[13]=i,e[14]=t,e[15]=r,e[16]=o,e[17]=v}else v=e[17];let b;e[23]===v?b=e[24]:(b=(0,G.jsx)(`div`,{className:`flex flex-col gap-3`,children:v}),e[23]=v,e[24]=b);let x;e[25]!==_||e[26]!==b?(x=(0,G.jsxs)(`div`,{className:`py-1 px-2 overflow-y-scroll h-full`,children:[_,b]}),e[25]=_,e[26]=b,e[27]=x):x=e[27];let S=x;if(l===`sidebar`)return S;let C;e[28]===S?C=e[29]:(C=(0,G.jsx)(E,{defaultSize:50,minSize:30,maxSize:80,children:S}),e[28]=S,e[29]=C);let D;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,G.jsx)(T,{className:`w-1 bg-border hover:bg-primary/50 transition-colors`}),e[30]=D):D=e[30];let N;e[31]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,G.jsx)(E,{defaultSize:50,children:(0,G.jsx)(`div`,{})}),e[31]=N):N=e[31];let I;return e[32]===C?I=e[33]:(I=(0,G.jsxs)(w,{direction:`horizontal`,className:`h-full`,children:[C,D,N]}),e[32]=C,e[33]=I),I},J=e=>{let t=(0,F.c)(22),{run:n,isMostRecentRun:i,chartPosition:a,isExpanded:o,theme:s}=e,l=o,u=r(K);l??=i;let d;t[0]!==l||t[1]!==n.runId||t[2]!==u?(d=()=>{u(e=>{let t=new Map(e);return t.set(n.runId,!l),t})},t[0]=l,t[1]=n.runId,t[2]=u,t[3]=d):d=t[3];let f=d,p=l?h:g,m;t[4]===p?m=t[5]:(m=(0,G.jsx)(p,{height:16,className:`inline`}),t[4]=p,t[5]=m);let _=m,v;t[6]===n.runStartTime?v=t[7]:(v=c(n.runStartTime),t[6]=n.runStartTime,t[7]=v);let y;t[8]!==_||t[9]!==f||t[10]!==v?(y=(0,G.jsxs)(`span`,{className:`text-sm cursor-pointer`,onClick:f,children:[`Run - `,v,_]}),t[8]=_,t[9]=f,t[10]=v,t[11]=y):y=t[11];let b=y;if(!l){let e;t[12]===b?e=t[13]:(e=(0,G.jsx)(`pre`,{className:`font-mono font-semibold`,children:b}),t[12]=b,t[13]=e);let r;return t[14]!==n.runId||t[15]!==e?(r=(0,G.jsx)(`div`,{className:`flex flex-col`,children:e},n.runId),t[14]=n.runId,t[15]=e,t[16]=r):r=t[16],r}let x;return t[17]!==a||t[18]!==n||t[19]!==s||t[20]!==b?(x=(0,G.jsx)(Y,{run:n,chartPosition:a,theme:s,title:b},n.runId),t[17]=a,t[18]=n,t[19]=s,t[20]=b,t[21]=x):x=t[21],x},Y=e=>{let t=(0,F.c)(40),{run:n,chartPosition:r,theme:i,title:s}=e,[c,l]=(0,P.useState)(),u=(0,P.useRef)(null),{ref:d,width:f}=D(),p=f===void 0?300:f,m=a(),h,g;if(t[0]!==m||t[1]!==r||t[2]!==n.cellRuns||t[3]!==n.runId||t[4]!==i){let e=[...n.cellRuns.values()].map(e=>{let t=e.elapsedTime??0;return{cell:e.cellId,cellNum:m.inOrderIds.indexOf(e.cellId),startTimestamp:W(e.startTime),endTimestamp:W(e.startTime+t),elapsedTime:o(t*1e3),status:e.status}});h=`hiddenInputElement-${n.runId}`,g=x(U(e,h,r,i)),t[0]=m,t[1]=r,t[2]=n.cellRuns,t[3]=n.runId,t[4]=i,t[5]=h,t[6]=g}else h=t[5],g=t[6];let _=g.spec,v=i===`dark`?`dark`:void 0,y=p-50,b=r===`above`?120:100,C;t[7]!==v||t[8]!==y||t[9]!==b?(C={theme:v,width:y,height:b,actions:!1,mode:`vega`,renderer:`canvas`},t[7]=v,t[8]=y,t[9]=b,t[10]=C):C=t[10];let w;t[11]!==C||t[12]!==_?(w={ref:u,spec:_,options:C},t[11]=C,t[12]=_,t[13]=w):w=t[13];let T=S(w),E;t[14]===T?.view?E=t[15]:(E=()=>{let e=[{signalName:L,handler:(e,t)=>{let n=t.cell?.[0]??void 0;l(n??null)}}];return e.forEach(e=>{let{signalName:t,handler:n}=e;T?.view.addSignalListener(t,n)}),()=>{e.forEach(e=>{let{signalName:t,handler:n}=e;T?.view.removeSignalListener(t,n)})}},t[14]=T?.view,t[15]=E);let O;t[16]===T?O=t[17]:(O=[T],t[16]=T,t[17]=O),(0,P.useEffect)(E,O);let k;t[18]!==h||t[19]!==c||t[20]!==n?(k=(0,G.jsx)(X,{run:n,hoveredCellId:c,hiddenInputElementId:h}),t[18]=h,t[19]=c,t[20]=n,t[21]=k):k=t[21];let A=k,j=r===`sideBySide`?`-mt-0.5 flex-1`:``,M;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,G.jsx)(P.Suspense,{children:(0,G.jsx)(`div`,{ref:u})}),t[22]=M):M=t[22];let N;t[23]!==d||t[24]!==j?(N=(0,G.jsx)(`div`,{className:j,ref:d,children:M}),t[23]=d,t[24]=j,t[25]=N):N=t[25];let I=N;if(r===`above`){let e;t[26]!==I||t[27]!==s||t[28]!==A?(e=(0,G.jsxs)(`pre`,{className:`font-mono font-semibold`,children:[s,I,A]}),t[26]=I,t[27]=s,t[28]=A,t[29]=e):e=t[29];let r;return t[30]!==n.runId||t[31]!==e?(r=(0,G.jsx)(`div`,{className:`flex flex-col`,children:e},n.runId),t[30]=n.runId,t[31]=e,t[32]=r):r=t[32],r}let R;t[33]!==s||t[34]!==A?(R=(0,G.jsxs)(`pre`,{className:`font-mono font-semibold`,children:[s,A]}),t[33]=s,t[34]=A,t[35]=R):R=t[35];let z;return t[36]!==I||t[37]!==n.runId||t[38]!==R?(z=(0,G.jsxs)(`div`,{className:`flex flex-row`,children:[R,I]},n.runId),t[36]=I,t[37]=n.runId,t[38]=R,t[39]=z):z=t[39],z},X=e=>{let t=(0,F.c)(12),{run:n,hoveredCellId:r,hiddenInputElementId:i}=e,a=(0,P.useRef)(null),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=e=>{a.current&&(a.current.value=String(e),a.current.dispatchEvent(new Event(`input`,{bubbles:!0})))},t[0]=o):o=t[0];let s=o,c=r||``,l;t[1]!==i||t[2]!==c?(l=(0,G.jsx)(`input`,{type:`text`,id:i,defaultValue:c,hidden:!0,ref:a}),t[1]=i,t[2]=c,t[3]=l):l=t[3];let u;t[4]===n.cellRuns?u=t[5]:(u=[...n.cellRuns.values()],t[4]=n.cellRuns,t[5]=u);let d;t[6]!==r||t[7]!==u?(d=u.map(e=>(0,G.jsx)(Q,{cellRun:e,hovered:e.cellId===r,dispatchHoverEvent:s},e.cellId)),t[6]=r,t[7]=u,t[8]=d):d=t[8];let f;return t[9]!==l||t[10]!==d?(f=(0,G.jsxs)(`div`,{className:`text-xs mt-0.5 ml-3 flex flex-col gap-0.5`,children:[l,d]}),t[9]=l,t[10]=d,t[11]=f):f=t[11],f},Z={success:(0,G.jsx)(_,{color:`green`,size:14}),running:(0,G.jsx)(v,{color:`var(--blue-10)`,size:14}),error:(0,G.jsx)(s,{color:`red`,size:14}),queued:(0,G.jsx)(N,{color:`grey`,size:14})},Q=e=>{let t=(0,F.c)(39),{cellRun:n,hovered:r,dispatchHoverEvent:i}=e,a;t[0]===n.elapsedTime?a=t[1]:(a=n.elapsedTime?o(n.elapsedTime*1e3):`-`,t[0]=n.elapsedTime,t[1]=a);let s=a,l;t[2]!==n.elapsedTime||t[3]!==s?(l=n.elapsedTime?(0,G.jsxs)(`span`,{children:[`This cell took `,(0,G.jsx)(b,{elapsedTime:s}),` to run`]}):(0,G.jsx)(`span`,{children:`This cell has not been run`}),t[2]=n.elapsedTime,t[3]=s,t[4]=l):l=t[4];let d=l,p;t[5]!==n.cellId||t[6]!==i?(p=()=>{i(n.cellId)},t[5]=n.cellId,t[6]=i,t[7]=p):p=t[7];let m=p,h;t[8]===i?h=t[9]:(h=()=>{i(null)},t[8]=i,t[9]=h);let g=h,_=r&&`bg-(--gray-3) opacity-100`,v;t[10]===_?v=t[11]:(v=u(`flex flex-row gap-2 py-1 px-1 opacity-70 hover:bg-(--gray-3) hover:opacity-100`,_),t[10]=_,t[11]=v);let y;t[12]===n.startTime?y=t[13]:(y=c(n.startTime),t[12]=n.startTime,t[13]=y);let x;t[14]===y?x=t[15]:(x=(0,G.jsxs)(`span`,{className:`text-(--gray-10) dark:text-(--gray-11)`,children:[`[`,y,`]`]}),t[14]=y,t[15]=x);let S;t[16]===n.cellId?S=t[17]:(S=(0,G.jsxs)(`span`,{className:`text-(--gray-10) w-16 overflow-hidden`,children:[`(`,(0,G.jsx)(C,{cellId:n.cellId}),`)`]}),t[16]=n.cellId,t[17]=S);let w;t[18]===n.code?w=t[19]:(w=(0,G.jsx)(`span`,{className:`w-40 truncate -ml-1`,children:n.code}),t[18]=n.code,t[19]=w);let T;t[20]===s?T=t[21]:(T=(0,G.jsx)(`span`,{className:`text-(--gray-10) dark:text-(--gray-11)`,children:s}),t[20]=s,t[21]=T);let E;t[22]!==d||t[23]!==T?(E=(0,G.jsx)(f,{content:d,children:T}),t[22]=d,t[23]=T,t[24]=E):E=t[24];let D=Z[n.status],O;t[25]!==n.status||t[26]!==D?(O=(0,G.jsx)(f,{content:n.status,children:D}),t[25]=n.status,t[26]=D,t[27]=O):O=t[27];let k;t[28]!==E||t[29]!==O?(k=(0,G.jsxs)(`div`,{className:`flex flex-row gap-1 w-16 justify-end -ml-2`,children:[E,O]}),t[28]=E,t[29]=O,t[30]=k):k=t[30];let A;return t[31]!==m||t[32]!==g||t[33]!==w||t[34]!==k||t[35]!==v||t[36]!==x||t[37]!==S?(A=(0,G.jsxs)(`div`,{className:v,onMouseEnter:m,onMouseLeave:g,children:[x,S,w,k]}),t[31]=m,t[32]=g,t[33]=w,t[34]=k,t[35]=v,t[36]=x,t[37]=S,t[38]=A):A=t[38],A};export{q as Tracing};
|
|
@@ -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-DVplv7_D.js";import{t as n}from"./compiler-runtime-BrajqUja.js";import{t as r}from"./jsx-runtime-B74pBk57.js";import{t as i}from"./spinner-DyNE-o8o.js";import{t as a}from"./preload-helper-uBIymjUX.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-De9k9D6u.js","./rolldown-runtime-B0Z9INg1.js","./useEvent-Dfcbgjhg.js","./react-DVplv7_D.js","./compiler-runtime-BrajqUja.js","./cells-D73Y_xmw.js","./react-dom-_LrxgvjW.js","./schemas-Dv42wLFq.js","./debounce-aFmHgJZY.js","./isObject-BCaOs5rp.js","./now-Cmx0b_zA.js","./isSymbol-oX0TOjjx.js","./config-VPSq73n8.js","./_baseMerge-CQpUq7ep.js","./isArrayLikeObject-DnwgSs_Z.js","./useEventListener-D9cftcHj.js","./objects-snlMn4yk.js","./invariant-Ci2dTZ72.js","./utils-B4K466FK.js","./session-DqoWmb7X.js","./config-DX8Y2WbJ.js","./Deferred-CrTnjj37.js","./cn-ldLVeaqm.js","./clsx-DB0hHKMi.js","./jsx-runtime-B74pBk57.js","./fullscreen-B9tHcfpV.js","./dist-iaThVDkA.js","./menu-items-BrwnTgyK.js","./use-restore-focus-BxEGwIbk.js","./circle-DXf-VWZG.js","./createLucideIcon-DfJ2oMlA.js","./select-DTBn5eTb.js","./button-COI-NGrx.js","./check-BQNapYaf.js","./useNumberFormatter-D7O_26UI.js","./I18nProvider-Cg2I_s1_.js","./toast-BGzLGnvw.js","./tooltip-C9TuY18o.js","./paths-bkIFVj8h.js","./useLifecycle-Mq4gc5kS.js","./toDate-DaZHg4Of.js","./database-zap-B_PMVg8T.js","./write-secret-modal-DzKAInL2.js","./alert-dialog-BaPGzeOK.js","./input-BoBxR50a.js","./numbers-Mk3-CcoU.js","./once-Haz_uxEL.js","./arrays-BqUx5USx.js","./useDebounce-B_ccBZTp.js","./use-toast-Wu434mLr.js","./requests-lt0JK8Jt.js","./uuid-k9DpjH68.js","./plus-C5silF6g.js","./trash-2-DcgaW8fn.js","./preload-helper-uBIymjUX.js","./dist-Cny7_yZb.js","./dist-DBMV4gqt.js","./capabilities-BJvf-MD4.js","./cjs-C49f7GXV.js","./createReducer-DgRODTW6.js","./dist-qhAY4L2r.js","./marked.esm-B_3iMIUq.js","./strings-B2vv-ENv.js","./dist-BOfh4hMd.js","./badge-crT3E0Rm.js","./dist-LSsCJjA3.js","./dist-1tmpVXyz.js","./dist-DtH-7lot.js","./dist-BmExfiwX.js","./dist-DusFODSa.js","./stex-Dc5bKD4z.js","./useTheme-COhSHkCj.js","./useAsyncData-C7aJJz0Y.js","./purify.es--06brOip.js","./cells-0PFKL3SH.css","./chevron-right-eAtVhbNZ.js","./circle-check-BCurAHEb.js","./circle-play-CYIb0qT6.js","./CellStatus-B4z-D5H1.js","./ban-YzvUro5I.js","./ellipsis-63DyBLHQ.js","./refresh-cw-Qw1f8Jhy.js","./workflow-cw-0b9g5.js","./useDateFormatter-DA-62E-Y.js","./en-US-BxZyFbza.js","./multi-icon-DL465pPF.js","./multi-icon-D129IBvu.css","./CellStatus-2Psjnl5F.css","./react-vega-C3rYGtP6.js","./vega-loader.browser-CLRkNgm7.js","./precisionRound-Bq_nmf5u.js","./defaultLocale-CNPGWpMu.js","./defaultLocale-D5bOh7g6.js","./linear-0eij_aAG.js","./init-ZlXS9mIS.js","./cubic-DELhj3Tx.js","./ordinal-BdBDtYTt.js","./time-MgToa8VM.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-BI2FitQ_.js","./react-resizable-panels.browser.esm-Dbe0MrFr.js","./bundle.esm-D3tw5rqW.js","./empty-state-BaCKb7o3.js","./panel-context-C2QXpKfx.js","./clear-button-p6YcvzLy.js","./runs-BLp5jezv.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-DVplv7_D.js";import{t as n}from"./compiler-runtime-BrajqUja.js";import{t as r}from"./jsx-runtime-B74pBk57.js";import{t as i}from"./spinner-DyNE-o8o.js";import{t as a}from"./preload-helper-uBIymjUX.js";var o=n(),s=e(t(),1),c=r(),l=s.lazy(()=>a(()=>import(`./tracing-De9k9D6u.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-DVplv7_D.js";import{ro as n}from"./cells-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-DVplv7_D.js";import{ro as n}from"./cells-D73Y_xmw.js";import{t as r}from"./compiler-runtime-BrajqUja.js";import{g as i}from"./useEventListener-D9cftcHj.js";import{t as a}from"./cn-ldLVeaqm.js";import{t as o}from"./jsx-runtime-B74pBk57.js";import{t as s}from"./tooltip-C9TuY18o.js";import{t as c}from"./button-COI-NGrx.js";import{t as l}from"./createLucideIcon-DfJ2oMlA.js";import{t as u}from"./chevron-right-eAtVhbNZ.js";import{n as d,t as f}from"./eye-off-CxVozGAC.js";import{t as p}from"./refresh-cw-Qw1f8Jhy.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-Dfcbgjhg.js";import{D as t,Rt as n,zt as r}from"./cells-
|
|
1
|
+
import{l as e}from"./useEvent-Dfcbgjhg.js";import{D as t,Rt as n,zt as r}from"./cells-D73Y_xmw.js";import{t as i}from"./compiler-runtime-BrajqUja.js";import{s as a}from"./config-VPSq73n8.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-Dfcbgjhg.js";import{Bt as n,Co as ee,D as te,ii as ne,io as re,oo as ie,qa as ae,ri as oe,ro as se,so as r,v as ce,vi as le,vt as i}from"./cells-
|
|
1
|
+
import{l as e,u as t}from"./useEvent-Dfcbgjhg.js";import{Bt as n,Co as ee,D as te,ii as ne,io as re,oo as ie,qa as ae,ri as oe,ro as se,so as r,v as ce,vi as le,vt as i}from"./cells-D73Y_xmw.js";import{t as a}from"./compiler-runtime-BrajqUja.js";import{o as ue,r as de,s as fe}from"./config-VPSq73n8.js";import{m as pe}from"./session-DqoWmb7X.js";import{t as o}from"./jsx-runtime-B74pBk57.js";import{d as me}from"./select-DTBn5eTb.js";import{i as he,p as ge}from"./download-CEG5vQri.js";import{t as s}from"./createLucideIcon-DfJ2oMlA.js";import{i as _e}from"./paths-bkIFVj8h.js";import{a as ve,i as c}from"./useNumberFormatter-D7O_26UI.js";import{t as ye}from"./chevron-right-eAtVhbNZ.js";import{t as be}from"./code-xml-SQaZqvcO.js";import{t as xe}from"./eye-off-CxVozGAC.js";import{t as Se}from"./image-wZvTj8WY.js";import{b as Ce}from"./write-secret-modal-DzKAInL2.js";import{t as we}from"./link-NuFVR7G9.js";import{i as Te,t as Ee}from"./useDeleteCell-8ByYNceO.js";import{Qt as De,Yt as Oe,tn as ke}from"./input-BoBxR50a.js";import{t as Ae}from"./trash-2-DcgaW8fn.js";import{n as je}from"./copy-D8O_CYCG.js";import{t as Me}from"./use-toast-Wu434mLr.js";import{r as Ne}from"./requests-lt0JK8Jt.js";import{i as Pe}from"./useRunCells-BVoQp_ne.js";import{n as Fe}from"./state-ENE4B_JH.js";import{n as Ie,t as Le}from"./icons-CiZ_8zS-.js";import{n as l}from"./name-cell-input-DXf9tZ25.js";import{t as u}from"./multi-icon-DL465pPF.js";import{t as Re}from"./useSplitCell-Ba_Zm0ID.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(ce),j=Ee(),{openModal:M}=Ce(),N=t(Fe),P=e(de),F=e(fe),Ge=e(pe),I=e(ue),{saveCellConfig:L}=Ne();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===ee,X;o[12]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,v.jsx)(Te,{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)(ae,{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)(be,{size:13,strokeWidth:1.5}),label:`Format`,hotkey:`cell.format`,handle:()=>{let e=B();e&&le({[R]:e})}},{icon:z.hide_code?(0,v.jsx)(se,{size:13,strokeWidth:1.5}):(0,v.jsx)(xe,{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&&(n({autoInstantiate:F,createNewCell:y}),i(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},oe(B())===`sql`?{icon:(0,v.jsx)(Ie,{}),label:`View as Python`,hotkey:`cell.viewAsSQL`,handle:()=>{let e=B();e&&ne(e,`python`,{force:!0})},hidden:Y}:{icon:(0,v.jsx)(_e,{size:13,strokeWidth:1.5}),label:`Convert to SQL`,hotkey:`cell.viewAsSQL`,handle:()=>{let e=B();e&&(n({autoInstantiate:F,createNewCell:y}),i(e,{language:`sql`,keepCodeAsIs:!1}))},hidden:Y}],[{icon:(0,v.jsxs)(u,{children:[(0,v.jsx)(r,{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)(r,{size:13,strokeWidth:1.5}),(0,v.jsx)(ve,{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)(ve,{size:13,strokeWidth:1.5}),label:`Move cell down`,hotkey:`cell.moveDown`,handle:()=>S({cellId:R,before:!1}),hidden:Y},{icon:(0,v.jsx)(ge,{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)(ye,{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)(re,{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)(Se,{size:13,strokeWidth:1.5}),label:`Export output as PNG`,hidden:!H,handle:()=>he(R,`result`)},{icon:(0,v.jsx)(ie,{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)(Oe,{children:[(0,v.jsx)(De,{children:(0,v.jsx)(ke,{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)(we,{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 je(Ve(V)),Me({description:`Link copied to clipboard`})}}],[{label:`Delete`,hidden:!A,variant:`danger`,icon:(0,v.jsx)(Ae,{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-Dfcbgjhg.js";import{D as n,b as r,v as i}from"./cells-
|
|
1
|
+
import{r as e,t}from"./useEvent-Dfcbgjhg.js";import{D as n,b as r,v as i}from"./cells-D73Y_xmw.js";import{t as a}from"./compiler-runtime-BrajqUja.js";import{t as o}from"./useEventListener-D9cftcHj.js";import{t as s}from"./jsx-runtime-B74pBk57.js";import{t as c}from"./button-COI-NGrx.js";import{t as l}from"./createLucideIcon-DfJ2oMlA.js";import{t as u}from"./use-toast-Wu434mLr.js";import{r as d}from"./requests-lt0JK8Jt.js";import{n as f}from"./renderShortcut-BkVJQ_Zh.js";var p=l(`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}=d(),l;return a[0]!==o||a[1]!==c||a[2]!==s?(l=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}=u({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]=l):l=a[3],t(l)}function v(){let r=(0,m.c)(4),{deleteCell:a,undoDeleteCell:o}=n(),{sendDeleteCell:s}=d(),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}=u({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-Dfcbgjhg.js";import{t as o}from"./react-DVplv7_D.js";import{Cn as s,Fn as c,K as ee,Pt as l,_n as u,cn as d,dn as f,fn as p,gn as m,hn as h,mn as g,un 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-Dfcbgjhg.js";import{t as o}from"./react-DVplv7_D.js";import{Cn as s,Fn as c,K as ee,Pt as l,_n as u,cn as d,dn as f,fn as p,gn as m,hn as h,mn as g,un as _,yn as v}from"./cells-D73Y_xmw.js";import{t as y}from"./compiler-runtime-BrajqUja.js";import{t as b}from"./cn-ldLVeaqm.js";import{t as x}from"./jsx-runtime-B74pBk57.js";import{t as te}from"./use-restore-focus-BxEGwIbk.js";import{a as ne,n as re,o as ie,t as ae}from"./tooltip-C9TuY18o.js";import{t as oe}from"./useCellActionButton-CWhycKft.js";import{a as se,i as ce}from"./renderShortcut-BkVJQ_Zh.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,l=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=()=>{ee(()=>{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=_,z=p,B=c(o.cellId),V;n[6]===B?V=n[7]:(V=(0,w.jsx)(m,{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)(g,{children:`No results`}),n[8]=U):U=n[8];let W=j.map((e,t)=>(0,w.jsxs)(C.Fragment,{children:[(0,w.jsx)(h,{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)(u,{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)(v,{})]},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(!l){let e;n[21]===r?e=n[22]:(e=(0,w.jsx)(f,{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)(d,{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)(f,{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)(d,{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=l(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{c as t,f as n,l as r,u as i}from"./useEvent-Dfcbgjhg.js";import{t as a}from"./react-DVplv7_D.js";import{D as o,E as s,Hr as c,Jr as l,Ka as u,Kr as d,Mt as f,Xr as p,Zr as m,_ as h,ai as g,an as _,co as v,er as y,h as b,in as x,oo as S,qa as C,qr as w,ra as T,ro as E,t as ee,xo as D,yt as te}from"./cells-B6il7NvU.js";import{S as O,_ as k,j as A}from"./schemas-Dv42wLFq.js";import{t as j}from"./compiler-runtime-BrajqUja.js";import{C as M,n as N}from"./config-VPSq73n8.js";import{E as ne,h as P,n as F,r as re}from"./ai-model-dropdown-CB0zKJVn.js";import{g as I}from"./useEventListener-D9cftcHj.js";import{t as L}from"./objects-snlMn4yk.js";import{n as R,r as z}from"./utils-B4K466FK.js";import{_ as B,g as V,h as H,m as ie,s as ae,v as oe}from"./session-DqoWmb7X.js";import{M as se,O as ce}from"./config-DX8Y2WbJ.js";import{t as U}from"./cn-ldLVeaqm.js";import{t as le}from"./jsx-runtime-B74pBk57.js";import{$ as ue,It as de,Lt as fe}from"./JsonOutput-vAkP2zUe.js";import{a as pe,c as me,i as he,n as ge,r as _e,s as ve,t as W}from"./select-DTBn5eTb.js";import{a as ye,c as be,d as G,o as xe,t as Se}from"./download-DKJ7bLP9.js";import{t as Ce}from"./switch-CTaiAjrz.js";import{i as we,n as Te,r as Ee,t as De}from"./tabs-BuQlZFbt.js";import{n as Oe,t as K}from"./button-COI-NGrx.js";import{t as q}from"./createLucideIcon-DfJ2oMlA.js";import{a as ke,i as Ae,n as je,r as Me,t as Ne}from"./paths-bkIFVj8h.js";import{F as Pe,I as Fe,L as Ie,c as Le,t as Re}from"./layout-D7t0uMv2.js";import{t as ze}from"./check-BQNapYaf.js";import{r as Be}from"./useCellActionButton-9U0UBP8q.js";import{s as Ve}from"./tree-actions-6YzAxpKB.js";import{f as He,n as Ue}from"./markdown-renderer-BGhL7GlA.js";import{t as We}from"./code-BEiQP4pS.js";import{t as Ge}from"./eye-off-CxVozGAC.js";import{t as Ke}from"./external-link-UrX9KO36.js";import{t as qe}from"./file-BPBVl9pl.js";import{t as Je}from"./globe-UdPdIbF7.js";import{n as Ye,r as Xe,t as Ze}from"./youtube-CbJhsgLy.js";import{n as Qe}from"./components-CP_UoFtT.js";import{t as $e}from"./house-CpsMWsLL.js";import{t as et}from"./image-wZvTj8WY.js";import{b as tt}from"./write-secret-modal-DzKAInL2.js";import{t as nt}from"./link-NuFVR7G9.js";import{t as rt}from"./spinner-DyNE-o8o.js";import{c as it,l as at,u as ot}from"./readonly-python-code-D61HNA9A.js";import{Qt as st,Xt as ct,Yt as lt,Zt as ut,tn as dt}from"./input-BoBxR50a.js";import{t as ft}from"./settings-BpdQZRgT.js";import{t as pt}from"./square-BPmgQFnh.js";import{n as mt}from"./copy-D8O_CYCG.js";import{t as ht}from"./use-toast-Wu434mLr.js";import{t as gt}from"./copy-icon-BIiRXh_3.js";import{i as _t,r as vt,t as yt}from"./strings-B2vv-ENv.js";import{r as J}from"./requests-lt0JK8Jt.js";import{t as bt}from"./shell-Fj8a65ii.js";import{n as xt}from"./useAsyncData-C7aJJz0Y.js";import{r as St}from"./useRunCells-BpLdDZbV.js";import{s as Ct}from"./useInstallPackage-iX1eufdl.js";import{t as wt}from"./share-BZW3tzEX.js";import{n as Tt,r as Et}from"./markdown-export-DzhB1FrN.js";import{n as Dt,t as Ot}from"./alert-DTaqCu_d.js";import{a as kt}from"./cell-link-DbRcdG3a.js";import{t as At}from"./icons-CiZ_8zS-.js";import{n as jt}from"./feedback-button-C_PtEG12.js";import{i as Mt,n as Nt,r as Pt}from"./add-connection-dialog-C05Sy6Em.js";import{t as Ft}from"./github-DQZhN3La.js";import{n as It}from"./marimo-icons-CqliHyTr.js";import{t as Lt}from"./links-DkkL9DVa.js";import{r as Rt,t as zt}from"./hooks-CpM5Nux7.js";var Bt=q(`circle-chevron-down`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 10-4 4-4-4`,key:`894hmk`}]]),Vt=q(`circle-chevron-right`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m10 8 4 4-4 4`,key:`1wy4r4`}]]),Ht=q(`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`}]]),Ut=q(`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`}]]),Wt=q(`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`}]]),Gt=q(`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`}]]),Kt=q(`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`}]]),qt=q(`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`}]]),Jt=q(`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`}]]),Yt=q(`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`}]]),Xt=q(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),Zt=q(`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`}]]),Qt=q(`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`}]]),$t=q(`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`}]]),en=q(`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`}]]),Y=e(a(),1),X=j();async function tn(e,t){let n=new Blob([t],{type:`text/html`});if(n.size>104857600)throw Error(`File is too large. Maximum size is 100 MB.`);let r=await fetch(`${z.molab}/api/artifacts/pending`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({fileName:e,fileSize:n.size})});if(!r.ok){let e=await r.json().catch(()=>null);throw Error(e?.error??(r.status===429?`Too many uploads, try again later`:`Failed to prepare the upload`))}let{presignedUrl:i,claimUrl:a}=await r.json();if(!(await fetch(i,{method:`PUT`,body:n})).ok)throw Error(`Failed to upload the notebook export`);return a}var Z=le(),nn=e=>{let t=(0,X.c)(33),{onClose:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={kind:`idle`},t[0]=r):r=t[0];let[i,a]=(0,Y.useState)(r),{exportAsHTML:o}=J(),s;t[1]===o?s=t[2]:(s=async()=>{a({kind:`publishing`});try{let{contents:e,filename:t}=await o({download:!1,includeCode:!0,files:Le.INSTANCE.filenames(),layout:await Re(),assetUrl:`https://cdn.jsdelivr.net/npm/@marimo-team/frontend@{version}/dist`}),n=await tn(t,e);window.open(n,`_blank`,`noopener,noreferrer`),a({kind:`staged`,claimUrl:n})}catch(e){let t=e;a({kind:`failed`,message:t instanceof Error?t.message:`Something went wrong`})}},t[1]=o,t[2]=s);let c=s;if(i.kind===`staged`){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(st,{children:[(0,Z.jsx)(dt,{children:`Finish publishing`}),(0,Z.jsx)(ct,{children:`If the confirmation page didn't open in a new tab, open it below.`})]}),t[3]=e):e=t[3];let r;t[4]===n?r=t[5]:(r=(0,Z.jsx)(K,{"data-testid":`done-share-static-notebook-button`,variant:`secondary`,onClick:n,children:`Done`}),t[4]=n,t[5]=r);let a;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(Ke,{size:14,strokeWidth:1.5,className:`mr-2`}),t[6]=a):a=t[6];let o;t[7]===i.claimUrl?o=t[8]:(o=(0,Z.jsx)(K,{asChild:!0,variant:`default`,children:(0,Z.jsxs)(`a`,{"data-testid":`open-claim-page-link`,href:i.claimUrl,target:`_blank`,rel:`noopener noreferrer`,children:[a,`Open confirmation page`]})}),t[7]=i.claimUrl,t[8]=o);let s;return t[9]!==r||t[10]!==o?(s=(0,Z.jsxs)(lt,{className:`sm:max-w-[480px]`,children:[e,(0,Z.jsxs)(ut,{children:[r,o]})]}),t[9]=r,t[10]=o,t[11]=s):s=t[11],s}let l=i.kind===`publishing`,u;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(dt,{children:`Publish HTML to web`}),t[12]=u):u=t[12];let d;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsxs)(st,{children:[u,(0,Z.jsxs)(ct,{children:[`Publish a static snapshot of this notebook to`,` `,(0,Z.jsx)(`a`,{href:z.molab,target:`_blank`,rel:`noopener noreferrer`,className:`underline`,children:`molab`}),`. Snapshots can be viewed by anyone on the internet.`]})]}),t[13]=d):d=t[13];let f;t[14]!==i.kind||t[15]!==i.message?(f=i.kind===`failed`&&(0,Z.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,"data-testid":`share-static-notebook-error`,children:[`Publish failed: `,i.message]}),t[14]=i.kind,t[15]=i.message,t[16]=f):f=t[16];let p;t[17]!==l||t[18]!==n?(p=(0,Z.jsx)(K,{"data-testid":`cancel-share-static-notebook-button`,variant:`secondary`,onClick:n,disabled:l,children:`Cancel`}),t[17]=l,t[18]=n,t[19]=p):p=t[19];let m;t[20]!==l||t[21]!==i.kind?(m=l?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(rt,{className:`mr-2`,size:`small`}),`Snapshotting notebook ...`]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Ke,{size:14,strokeWidth:1.5,className:`mr-2`}),i.kind===`failed`?`Try again`:`Publish`]}),t[20]=l,t[21]=i.kind,t[22]=m):m=t[22];let h;t[23]!==c||t[24]!==l||t[25]!==m?(h=(0,Z.jsx)(K,{"data-testid":`share-static-notebook-button`,variant:`default`,disabled:l,onClick:c,children:m}),t[23]=c,t[24]=l,t[25]=m,t[26]=h):h=t[26];let g;t[27]!==p||t[28]!==h?(g=(0,Z.jsxs)(ut,{children:[p,h]}),t[27]=p,t[28]=h,t[29]=g):g=t[29];let _;return t[30]!==f||t[31]!==g?(_=(0,Z.jsxs)(lt,{className:`sm:max-w-[480px]`,children:[d,f,g]}),t[30]=f,t[31]=g,t[32]=_):_=t[32],_};function rn(){let e=document.getElementsByClassName(R.outputArea);for(let t of e){let e=t.getBoundingClientRect();if(e.bottom>0&&e.top<window.innerHeight){let e=D.findElement(t);if(!e){I.warn(`Could not find HTMLCellId for visible output area`,t);continue}return{cellId:D.parse(e.id)}}}return I.warn(`No visible output area found for scroll anchor`),null}function an(e){if(!e){I.warn(`No scroll anchor provided to restore scroll position`);return}let t=document.getElementById(D.create(e.cellId));if(!t){I.warn(`Could not find cell element to restore scroll position`,e.cellId);return}if(!t.querySelector(`.${R.outputArea}`)){I.warn(`Could not find output area to restore scroll position`,e.cellId);return}t.scrollIntoView({block:`start`,behavior:`auto`})}function on(){let e=(0,X.c)(2),t=i(oe),n;return e[0]===t?n=e[1]:(n=()=>{let e=rn();t(t=>({mode:V(t.mode),cellAnchor:e?.cellId??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{an(e)})})},e[0]=t,e[1]=n),n}var sn=n(!1),cn=()=>{let e=(0,X.c)(7),{selectedLayout:t}=at(),{setLayoutView:n}=it();if(se()&&!g(`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,Z.jsx)(ve,{className:`min-w-[110px] border-border bg-background`,"data-testid":`layout-select`,children:(0,Z.jsx)(me,{placeholder:`Select a view`})}),e[2]=i):i=e[2];let a;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(ge,{children:(0,Z.jsxs)(_e,{children:[(0,Z.jsx)(pe,{children:`View as`}),ot.map(fn)]})}),e[3]=a):a=e[3];let o;return e[4]!==t||e[5]!==r?(o=(0,Z.jsxs)(W,{"data-testid":`layout-select`,value:t,onValueChange:r,children:[i,a]}),e[4]=t,e[5]=r,e[6]=o):o=e[6],o};function ln(e){let t=un(e);return(0,Z.jsx)(t,{className:`h-4 w-4`})}function un(e){switch(e){case`vertical`:return qt;case`grid`:return Xe;case`slides`:return Zt;default:return _t(e),pt}}function dn(e){return yt.startCase(e)}function fn(e){return(0,Z.jsx)(he,{value:e,children:(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5 leading-5`,children:[ln(e),(0,Z.jsx)(`span`,{children:dn(e)})]})},e)}var pn=[`html`,`markdown`,`ipynb`,`pdf`,`script`,`png`],mn=[`pymdown`,`qmd`,`mystmd`,`mdx`],hn=[`topological`,`top-down`],gn=[`document`,`slides`],_n=[`source`,`flat`];function vn(e){return typeof e==`string`&&pn.some(t=>t===e)}var Q={html:{includeCode:!0},markdown:{flavor:null},ipynb:{sortMode:`topological`,includeOutputs:!1},pdf:{preset:`document`,includeInputs:!0,includeOutputs:!0,webpdf:!0},script:{type:`source`}};function $(e,t){return e.default(t).catch(t)}function yn(e){return A(e).optional().catch(void 0)}var bn=A({html:yn({includeCode:$(O(),Q.html.includeCode)}),markdown:yn({flavor:$(k(mn).nullable(),Q.markdown.flavor)}),ipynb:yn({sortMode:$(k(hn),Q.ipynb.sortMode),includeOutputs:$(O(),Q.ipynb.includeOutputs)}),pdf:yn({preset:$(k(gn),Q.pdf.preset),includeInputs:$(O(),Q.pdf.includeInputs),includeOutputs:$(O(),Q.pdf.includeOutputs),webpdf:$(O(),Q.pdf.webpdf)}),script:yn({type:$(k(_n),Q.script.type)})}).catch({});function xn(e,t){let n={...e},r=r=>{n[r]={...e[r],...t[r]}};for(let e of Object.keys(t))r(e);return n}function Sn(e){return xn(Q,bn.parse(e))}var Cn=m({toSerializable:e=>e,fromSerializable:Sn}),wn=ce(`marimo:export:options:v1`,Q,Cn,{getOnInit:!0}),Tn=ce(`marimo:export:last-format:v1`,`html`,m({toSerializable:e=>e,fromSerializable:e=>vn(e)?e:`html`}),{getOnInit:!0}),En={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 Dn(e,t){return e===`wasm`&&t===`pdf`}function On({format:e,options:t,runtime:n,filename:r,availability:i}){let a=e===`script`&&t.script.type===`source`?{...En.script,requiresNamedNotebookOnServer:!0}:En[e],o=Dn(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 kn(e,t){return e.map(e=>({value:e,...t[e]}))}var An=kn([`automatic`,...mn],{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.`}}),jn=kn(hn,{"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.`}}),Mn=kn(gn,{document:{label:`Document`,description:`Creates pages for reading or printing.`},slides:{label:`Slides`,description:`Creates presentation slides from the notebook.`}}),Nn=kn([`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.`}}),Pn=kn(_n,{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.`}}),Fn={html:{label:`HTML`,actionLabel:`Export HTML`,description:`Save the current notebook as an HTML page.`,Icon:Je,Options:In},markdown:{label:`Markdown`,actionLabel:`Export Markdown`,description:`Save code and text in a Markdown-based file. Cell outputs are not included.`,Icon:Me,Options:Ln},ipynb:{label:`Jupyter`,actionLabel:`Export Jupyter notebook`,description:`Open the notebook in Jupyter and other compatible tools.`,Icon:Yt,Options:Rn},pdf:{label:`PDF`,actionLabel:`Export PDF`,description:`Save the notebook as a PDF for printing or sharing.`,Icon:qe,Options:zn},script:{label:`Python`,actionLabel:`Export flat script`,description:`Save the notebook as a Python file.`,Icon:We,Options:Bn},png:{label:`PNG`,actionLabel:`Export PNG`,description:`Capture the current app view as an image.`,Icon:et,Options:Vn}};function In(e){let t=(0,X.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,Z.jsx)(Hn,{children:(0,Z.jsx)(Un,{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 Ln(e){let t=(0,X.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,Z.jsx)(Hn,{children:(0,Z.jsx)(Kn,{label:`Format`,value:a,disabled:i,onValueChange:o,options:An})}),t[2]=i,t[3]=a,t[4]=o,t[5]=s):s=t[5],s}function Rn(e){let t=(0,X.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,Z.jsx)(Wn,{label:`Cell order`,value:n.ipynb.sortMode,disabled:i,onValueChange:a,options:jn}),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,Z.jsx)(Un,{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,Z.jsxs)(Hn,{children:[o,l]}),t[13]=o,t[14]=l,t[15]=u):u=t[15],u}function zn(e){let t=(0,X.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,Z.jsx)(Wn,{label:`Layout`,value:n.pdf.preset,disabled:i,onValueChange:a,options:Mn}),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,Z.jsx)(Un,{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,Z.jsx)(Un,{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,Z.jsx)(Wn,{label:`Method`,value:n.pdf.webpdf?`browser`:`latex`,disabled:i,onValueChange:e=>r(`pdf`,{webpdf:e===`browser`}),options:Nn}):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,Z.jsxs)(Hn,{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 Bn(e){let t=(0,X.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,Z.jsx)(Hn,{children:(0,Z.jsx)(Wn,{label:`Format`,value:n.script.type,disabled:i,onValueChange:a,options:Pn})}),t[2]=i,t[3]=n.script.type,t[4]=a,t[5]=o):o=t[5],o}function Vn(){return null}function Hn(e){let t=(0,X.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(`div`,{className:`divide-y rounded-md border`,children:n}),t[0]=n,t[1]=r),r}function Un(e){let t=(0,X.c)(26),{label:n,descriptions:r,descriptionOverride:i,checked:a,disabled:o,onCheckedChange:s}=e,c=(0,Y.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,Z.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,Z.jsx)(Yn,{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,Z.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,Z.jsx)(Ce,{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,Z.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 Wn(e){let t=(0,X.c)(31),{label:n,value:r,disabled:i,onValueChange:a,options:o}=e,s=(0,Y.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,Z.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(Gn),t[5]=o,t[6]=p);let m;t[7]!==c||t[8]!==f||t[9]!==p?(m=(0,Z.jsx)(Yn,{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,Z.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 v;if(t[16]!==s||t[17]!==o){let e;t[19]===s?e=t[20]:(e=(e,t)=>{let n=`${s}-${t}`;return(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(_,{id:n,value:e.value}),(0,Z.jsx)(`label`,{htmlFor:n,className:`text-sm`,children:e.label})]},e.value)},t[19]=s,t[20]=e),v=o.map(e),t[16]=s,t[17]=o,t[18]=v}else v=t[18];let y;t[21]!==c||t[22]!==i||t[23]!==n||t[24]!==g||t[25]!==v||t[26]!==r?(y=(0,Z.jsx)(x,{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:v}),t[21]=c,t[22]=i,t[23]=n,t[24]=g,t[25]=v,t[26]=r,t[27]=y):y=t[27];let b;return t[28]!==h||t[29]!==y?(b=(0,Z.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,y]}),t[28]=h,t[29]=y,t[30]=b):b=t[30],b}function Gn(e){return e.description}function Kn(e){let t=(0,X.c)(34),{label:n,value:r,disabled:i,onValueChange:a,options:o}=e,s=(0,Y.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,Z.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(Jn),t[6]=o,t[7]=p);let m;t[8]!==c||t[9]!==f||t[10]!==p?(m=(0,Z.jsx)(Yn,{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,Z.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,Z.jsx)(me,{}),t[17]=_):_=t[17];let v;t[18]!==c||t[19]!==s?(v=(0,Z.jsx)(ve,{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(qn),t[21]=o,t[22]=y);let b;t[23]===y?b=t[24]:(b=(0,Z.jsx)(ge,{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,Z.jsxs)(W,{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,Z.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 qn(e){return(0,Z.jsx)(he,{value:e.value,children:e.label},e.value)}function Jn(e){return e.description}function Yn(e){let t=(0,X.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,Z.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(Xn),t[10]=c,t[11]=u);let d;return t[12]!==l||t[13]!==u?(d=(0,Z.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 Xn(e){return(0,Z.jsx)(`p`,{"aria-hidden":!0,className:`invisible col-start-1 row-start-1`,children:e},e)}var Zn={"playwright-chromium":{description:`PDF export requires Playwright Chromium.`}};function Qn(e){let t=(0,X.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,Z.jsxs)(`span`,{className:`ml-auto flex shrink-0`,children:[(0,Z.jsx)(rt,{size:`small`,className:`size-3`}),(0,Z.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=U(`size-3`,i),t[1]=i,t[2]=a);let o;t[3]===a?o=t[4]:(o=(0,Z.jsx)(v,{className:a}),t[3]=a,t[4]=o);let s;t[5]===r?s=t[6]:(s=(0,Z.jsx)(`span`,{className:`sr-only`,children:r}),t[5]=r,t[6]=s);let c;return t[7]!==o||t[8]!==s?(c=(0,Z.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 $n(e){let t=(0,X.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,Z.jsx)(`div`,{className:`mb-2.5`,children:(0,Z.jsx)(er,{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,Z.jsx)(`div`,{className:`mb-2.5`,children:(0,Z.jsx)(tr,{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 er(e){let t=(0,X.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,Z.jsx)(v,{className:`size-4 shrink-0`}),t[0]=o):o=t[0];let s;t[1]===n?s=t[2]:(s=(0,Z.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,Z.jsxs)(K,{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,Z.jsx)(rt,{size:`small`,className:`mr-1.5 size-3.5`}):(0,Z.jsx)(Ht,{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,Z.jsxs)(Ot,{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,Z.jsxs)(Dt,{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 tr(e){let t=(0,X.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,Z.jsx)(rt,{className:`size-4 shrink-0`,size:`small`}),t[0]=e):e=t[0];let n;return t[1]===r?n=t[2]:(n=(0,Z.jsxs)(Ot,{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,Z.jsxs)(Dt,{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,Z.jsx)(er,{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,Z.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,Z.jsxs)(er,{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(rr).join(` `):(0,Z.jsx)(`span`,{className:`block min-w-0`,children:i.requirements.map(nr)}),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,Z.jsx)(er,{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,Z.jsx)(er,{children:e}),t[20]=e,t[21]=r),r}default:vt(i)}}function nr(e){let t=Zn[e.name];return(0,Z.jsxs)(`span`,{className:`block`,children:[t.description,(0,Z.jsx)(`code`,{className:`mt-1 block break-all font-mono`,children:e.command})]},e.name)}function rr(e){return Zn[e.name].description}function ir(e){return e.endsWith(`.myst.md`)?`mystmd`:e.endsWith(`.qmd`)?`qmd`:e.endsWith(`.mdx`)?`mdx`:`pymdown`}function ar(e,t){let n=t??ir(e),r=Tt[n],i=Et.find(t=>e.endsWith(t)),a=G.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 or(e){return Object.entries(e).flatMap(([e,t])=>t===null?[]:t===!0?[`--${e}`]:t===!1?[`--no-${e}`]:[`--${e}=${t}`])}function sr(e){return e.preset===`document`?e.webpdf:null}var cr={html:{subcommand:`html`,flags:({html:e})=>({"include-code":e.includeCode}),outputFilename:e=>G.toHTML(e)},markdown:{subcommand:`md`,flags:({markdown:e})=>({flavor:e.flavor}),outputFilename:(e,{markdown:t})=>ar(e,t.flavor)},ipynb:{subcommand:`ipynb`,flags:({ipynb:e})=>({sort:e.sortMode,"include-outputs":e.includeOutputs}),outputFilename:e=>G.toIPYNB(e)},pdf:{subcommand:`pdf`,flags:({pdf:e})=>({as:e.preset,"include-inputs":e.includeInputs,"include-outputs":e.includeOutputs,webpdf:sr(e)}),outputFilename:e=>G.toPDF(e)},script:{subcommand:`script`,flags:()=>({}),outputFilename:e=>`${G.withoutExtension(e)}.script.py`}};function lr({format:e,filename:t,options:n}){if(e===`png`||e===`script`&&n.script.type===`source`||!t)return null;let r=cr[e];return[`marimo`,`export`,r.subcommand,bt(t),...or(r.flags(n)),`-o`,bt(r.outputFilename(t,n))].join(` `)}async function ur(e){let{exportOptions:t,captureOutputs:n,downloadPDF:r}=e;t.includeOutputs&&await n(),await r(t)}async function dr({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 ur({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:vt(e)}}var fr={source:{actionLabel:`Export notebook source`,progressLabel:`notebook source`},flat:{actionLabel:`Export flat script`,progressLabel:`flat script`}};function pr(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 mr(e,t){return e===`server`&&t?je.basename(t):G.toPY(document.title)}function hr({usesBrowserPrint:e,hasCommand:t,format:n,isNotebookSource:r}){return e?`Uses the browser's print settings for page size and filename.`:t?`Uses the current session state. The copied command exports the saved notebook.`:n!==`png`&&!r?`Save the notebook to copy an equivalent shell command.`:null}function gr(e){let n=kt(),[r,i]=t(wn),[a,o]=t(Tn),[s,c]=(0,Y.useState)(e??a),l=se()?`wasm`:`server`,u=J(),d=B(),[f,p]=(0,Y.useState)(!1),m=xt(async()=>l===`wasm`?null:u.getExportAvailability(),[l,u]),h=pr(l,m),g=e=>On({format:e,options:r,runtime:l,filename:n,availability:h}),_=g(s),v=d&&(_.reason?.type===`missing-packages`||_.reason?.type===`missing-setup`),y=pn.map(e=>({format:e,status:g(e)})),b=Dn(l,s),x=Fn[s],S=s===`script`&&r.script.type===`source`,{actionLabel:C,progressLabel:w}=s===`script`?fr[r.script.type]:{actionLabel:x.actionLabel,progressLabel:x.label},T=b?null:lr({format:s,filename:n,options:r}),E=hr({usesBrowserPrint:b,hasCommand:!!T,format:s,isNotebookSource:S});return(0,Y.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:mr(l,n),available:_.available,usesBrowserPrint:b,progressLabel:w},selectFormat:e=>{vn(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 _r(e){let t=document.getElementById(`App`);if(!t){let e=`The current app view could not be captured.`;throw ht({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 xe({element:t,filename:document.title,prepare:()=>{let t=Se();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 vr(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=J(),c=Rt(),[l,u]=(0,Y.useState)(!1),d=(0,Y.useRef)(null),f=(0,Y.useRef)(!0);(0,Y.useEffect)(()=>(f.current=!0,()=>{f.current=!1}),[]);let p=async e=>{await zt({takeScreenshots:()=>c({progress:e}),updateCellOutputs:s.updateCellOutputs})},m=async()=>{await H(()=>_r(d.current?.parentElement??null))};return{dialogRef:d,isExporting:l,submit:async()=>{if(!(!r||l)){if(i){vr(o);return}u(!0);try{await be(`Exporting ${a}…`,async r=>{await dr({format:e,options:t,requests:s,sourceFilename:n,htmlFiles:Le.INSTANCE.filenames(),getLayout:Re,captureOutputs:()=>p(r),capturePNG:m,downloadFile:ye})}),f.current&&o()}catch(e){I.error(`Export failed`,e)}finally{f.current&&u(!1)}}}}}function br(e){let t=(0,X.c)(15),{initialFormat:n,onClose:r}=e,i=gr(n),a,o,s;t[0]===i?(a=t[1],o=t[2],s=t[3]):({exportRequest:a,selectFormat:o,...s}=i,t[0]=i,t[1]=a,t[2]=o,t[3]=s);let c;t[4]!==a||t[5]!==r?(c={...a,onClose:r},t[4]=a,t[5]=r,t[6]=c):c=t[6];let l=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 xr=`(min-width: 640px)`,Sr=e=>{let t=(0,X.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}=br(a),_=s||c,v=ue(xr),{format:y,status:b,usesBrowserPrint:x,actionLabel:S,command:C,footerDescription:w}=f,T=Fn[y],E=T.Options,ee;t[3]===i?ee=t[4]:(ee=i?{onCloseAutoFocus:e=>{e.preventDefault(),i.current?.focus()}}:{},t[3]=i,t[4]=ee);let D=ee,te;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,Z.jsxs)(st,{className:`border-b px-5 py-4 pr-12`,children:[(0,Z.jsx)(dt,{children:`Export notebook`}),(0,Z.jsx)(ct,{children:`Choose a format and adjust its options.`})]}),t[5]=te):te=t[5];let O=v?`vertical`:`horizontal`,k;if(t[6]!==u||t[7]!==_){let e;t[9]===_?e=t[10]:(e=e=>{let{format:t,status:n}=e,r=Fn[t];return(0,Z.jsxs)(we,{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,Z.jsx)(r.Icon,{className:`size-3.5 shrink-0`,strokeWidth:1.5}),(0,Z.jsx)(`span`,{className:`truncate`,children:r.label}),(0,Z.jsx)(Qn,{status:n})]},t)},t[9]=_,t[10]=e),k=u.map(e),t[6]=u,t[7]=_,t[8]=k}else k=t[8];let A;t[11]===k?A=t[12]:(A=(0,Z.jsx)(Ee,{"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:k}),t[11]=k,t[12]=A);let j;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,Z.jsxs)(Te,{value:t,className:`mt-0 min-h-0 min-w-0 overflow-y-auto px-4 py-3`,children:[(0,Z.jsxs)(`div`,{className:`mb-3`,children:[(0,Z.jsx)(`h3`,{className:`text-base font-semibold`,children:T.label}),(0,Z.jsx)(`p`,{className:`mt-0.5 text-sm text-muted-foreground`,children:T.description})]}),(0,Z.jsx)($n,{format:y,formatLabel:T.label,status:b,onInstall:l?h:void 0,isInstalling:c}),x?null:(0,Z.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],j=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]=j}else j=t[26];let M;t[40]!==y||t[41]!==p||t[42]!==O||t[43]!==A||t[44]!==j?(M=(0,Z.jsxs)(De,{value:y,onValueChange:p,orientation:O,className:`flex min-h-0 min-w-0 flex-col overflow-hidden sm:grid sm:grid-cols-[168px_minmax(0,1fr)]`,children:[A,j]}),t[40]=y,t[41]=p,t[42]=O,t[43]=A,t[44]=j,t[45]=M):M=t[45];let N;t[46]===C?N=t[47]:(N=C?(0,Z.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,Z.jsx)(`span`,{className:`select-none text-muted-foreground`,"aria-hidden":!0,children:`$`}),(0,Z.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,Z.jsx)(gt,{value:C,className:`size-3.5`,buttonClassName:U(Oe({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]=N);let ne=C&&`mt-3`,P;t[48]===ne?P=t[49]:(P=U(`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,ne),t[48]=ne,t[49]=P);let F;t[50]===w?F=t[51]:(F=w?(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:w}):null,t[50]=w,t[51]=F);let re=!b.available||_,I=!w&&`sm:ml-auto`,L;t[52]===I?L=t[53]:(L=U(`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)`,I),t[52]=I,t[53]=L);let R;t[54]===s?R=t[55]:(R=s&&(0,Z.jsx)(rt,{size:`small`,className:`mr-2`,"aria-hidden":!0}),t[54]=s,t[55]=R);let z=x?`Print to PDF`:S,B;t[56]!==s||t[57]!==g||t[58]!==re||t[59]!==L||t[60]!==R||t[61]!==z?(B=(0,Z.jsxs)(K,{type:`button`,disabled:re,"aria-busy":s,onClick:g,className:L,"data-testid":`export-submit`,children:[R,z]}),t[56]=s,t[57]=g,t[58]=re,t[59]=L,t[60]=R,t[61]=z,t[62]=B):B=t[62];let V;t[63]!==P||t[64]!==F||t[65]!==B?(V=(0,Z.jsxs)(`div`,{className:P,children:[F,B]}),t[63]=P,t[64]=F,t[65]=B,t[66]=V):V=t[66];let H;t[67]!==V||t[68]!==N?(H=(0,Z.jsxs)(`footer`,{className:`min-w-0 border-t bg-muted/20 px-4 py-3`,children:[N,V]}),t[67]=V,t[68]=N,t[69]=H):H=t[69];let ie;return t[70]!==o||t[71]!==D||t[72]!==H||t[73]!==M?(ie=(0,Z.jsxs)(lt,{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`,...D,children:[te,M,H]}),t[70]=o,t[71]=D,t[72]=H,t[73]=M,t[74]=ie):ie=t[74],ie};function Cr(e){let t=(0,X.c)(5),{openPrompt:n,closeModal:r}=tt(),{sendCopy:i}=J(),a;return t[0]!==r||t[1]!==n||t[2]!==i||t[3]!==e?(a=()=>{if(!e)return null;let t=Ne.guessDeliminator(e),a=je.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(je.dirname(e),n);i({source:e,destination:a}).then(()=>{r(),ht({title:`Notebook copied`,description:`A copy of the notebook has been created.`}),Lt(a)})}})},t[0]=r,t[1]=n,t[2]=i,t[3]=e,t[4]=a):a=t[4],a}var wr=new y,Tr=e=>wr.isSupported(e)?`markdown`:`code`,Er=()=>{let e=(0,X.c)(3),{updateCellConfig:t}=o(),{saveCellConfig:n}=J(),r;return e[0]!==n||e[1]!==t?(r=async(e,r)=>{let i=b(),a={};for(let t of i.cellIds.inOrderIds){let n=i.cellData[t];n!==void 0&&n.config.hide_code!==e&&Tr(n.code)===r&&(a[t]={hide_code:e})}let o=L.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};function Dr(e,t){let n={};for(let r of e.cellIds.inOrderIds){let i=e.cellData[r];i!==void 0&&(i.config.expand_output??!1)!==t&&(Ue(e.cellRuntime[r]?.output)||(n[r]={expand_output:t}))}return n}var Or=()=>{let e=(0,X.c)(3),{updateCellConfig:t}=o(),{saveCellConfig:n}=J(),r;return e[0]!==n||e[1]!==t?(r=async e=>{let r=Dr(b(),e),i=L.entries(r);if(i.length!==0){await n({configs:r});for(let[e,n]of i)t({cellId:e,config:n})}},e[0]=n,e[1]=t,e[2]=r):r=e[2],r},kr=e=>{e?.preventDefault(),e?.stopPropagation()};function Ar(e){let n=(0,X.c)(44),a;n[0]===e?a=n[1]:(a=e===void 0?{}:e,n[0]=e,n[1]=a);let{exportDialogReturnFocusRef:m}=a,g=kt(),{openModal:_,closeModal:v}=tt(),{toggleApplication:y}=d(),{selectedPanel:x}=w(),[D]=t(oe),O=r(ie),k=Er(),A=Or(),[j]=M(),I=r(c),R=r(N),{updateCellConfig:B,undoDeleteCell:V,clearAllCellOutputs:H,addSetupCellIfDoesntExist:ae,collapseAllCells:ce,expandAllCells:U}=o(),le=Ct(),ue=St(),pe=Cr(g),me=i(sn),he=i(F),{handleClick:ge}=re(),_e=i(ne),ve=i(wn),{readCode:W,saveCellConfig:ye}=J(),be=te(`database`),G=te(`storage`),xe=f(),Se=r(h),Ce=r(ee),we=r(s),{selectedLayout:Te}=at(),{setLayoutView:Ee}=it(),De=on(),Oe=j.sharing?.html??!0,K=j.sharing?.wasm??!0,q=j.sharing?.molab??!0,je=Te===`slides`,Ne;if(n[2]!==xe||n[3]!==ae||n[4]!==R||n[5]!==Ce||n[6]!==I||n[7]!==H||n[8]!==v||n[9]!==ce||n[10]!==pe||n[11]!==be||n[12]!==G||n[13]!==U||n[14]!==m||n[15]!==g||n[16]!==Se||n[17]!==je||n[18]!==O||n[19]!==_||n[20]!==ge||n[21]!==W||n[22]!==le||n[23]!==ue||n[24]!==ye||n[25]!==Te||n[26]!==x||n[27]!==k||n[28]!==me||n[29]!==ve||n[30]!==_e||n[31]!==Ee||n[32]!==A||n[33]!==he||n[34]!==Oe||n[35]!==q||n[36]!==K||n[37]!==y||n[38]!==De||n[39]!==V||n[40]!==we||n[41]!==B||n[42]!==D.mode){let e=[`db`,`sql`,...Mt],t=[`bucket`,`object storage`,...Pt],r=Gr,i=(e,t)=>{t&&ve(e=>xn(e,t)),_((0,Z.jsx)(Sr,{initialFormat:e,onClose:v,returnFocusRef:m}))};Ne=[{icon:(0,Z.jsx)(de,{size:14,strokeWidth:1.5}),label:`Export…`,additionalKeywords:[`download`,`html`,`markdown`,`ipynb`,`pdf`,`script`,`png`],handle:()=>i()},{icon:(0,Z.jsx)(de,{size:14,strokeWidth:1.5}),label:`Download`,redundant:!0,handle:kr,dropdown:[{icon:(0,Z.jsx)(Ie,{size:14,strokeWidth:1.5}),label:`Download as HTML`,handle:()=>i(`html`,{html:{includeCode:!0}})},{icon:(0,Z.jsx)(Ie,{size:14,strokeWidth:1.5}),label:`Download as HTML (exclude code)`,handle:()=>i(`html`,{html:{includeCode:!1}})},{icon:(0,Z.jsx)(At,{strokeWidth:1.5,style:{width:14,height:14}}),label:`Download as Markdown`,handle:()=>i(`markdown`)},{icon:(0,Z.jsx)(Yt,{size:14,strokeWidth:1.5}),label:`Download as ipynb`,handle:()=>i(`ipynb`)},{icon:(0,Z.jsx)(We,{size:14,strokeWidth:1.5}),label:`Download notebook source`,handle:()=>i(`script`,{script:{type:`source`}})},{icon:(0,Z.jsx)(We,{size:14,strokeWidth:1.5}),label:`Download flat script`,handle:()=>i(`script`,{script:{type:`flat`}})},{divider:!0,icon:(0,Z.jsx)(et,{size:14,strokeWidth:1.5}),label:`Download as PNG`,handle:()=>i(`png`)},je?{divider:!0,icon:(0,Z.jsx)(qe,{size:14,strokeWidth:1.5}),label:`Download as PDF`,handle:kr,dropdown:[{icon:(0,Z.jsx)(qe,{size:14,strokeWidth:1.5}),label:`Document Layout`,handle:()=>i(`pdf`,{pdf:{preset:`document`}})},{icon:(0,Z.jsx)(qe,{size:14,strokeWidth:1.5}),label:`Slides Layout`,hidden:se(),rightElement:(0,Z.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,Z.jsx)(qe,{size:14,strokeWidth:1.5}),label:`Download as PDF`,handle:()=>i(`pdf`,{pdf:{preset:`document`}})}]},{icon:(0,Z.jsx)(C,{size:14,strokeWidth:1.5}),label:`Connect your agent`,hidden:se(),handle:async()=>{_((0,Z.jsx)(P,{onClose:v}))},additionalKeywords:[`connect`]},{icon:(0,Z.jsx)(Qt,{size:14,strokeWidth:1.5}),label:`Share`,handle:kr,hidden:!Oe&&!K&&!q,dropdown:[{icon:(0,Z.jsx)(Je,{size:14,strokeWidth:1.5}),label:`Publish HTML to web`,hidden:!Oe,handle:async()=>{_((0,Z.jsx)(nn,{onClose:v}))}},{icon:(0,Z.jsx)(nt,{size:14,strokeWidth:1.5}),label:`Create WebAssembly link`,hidden:!K,handle:async()=>{let e=await W(),t=wt({code:e.contents});await mt(t),ht({title:`Copied`,description:`Link copied to clipboard.`})}},{icon:(0,Z.jsx)(It,{size:14,strokeWidth:1.5}),label:`Create molab notebook`,hidden:!q,handle:async()=>{let e=await W(),t=wt({code:e.contents,baseUrl:`${z.molab}/new`});window.open(t,`_blank`)}}]},{icon:(0,Z.jsx)(Xt,{size:14,strokeWidth:1.5}),label:`Helper panel`,redundant:!0,handle:kr,dropdown:l.flatMap(e=>{let t=e.type===`ai`&&!R;if(p({panel:e,capabilities:I,aiEnabled:R})&&!t)return[];let{type:n,Icon:i,additionalKeywords:a}=e;return{label:yt.startCase(n),rightElement:r(x===n),icon:(0,Z.jsx)(i,{size:14,strokeWidth:1.5}),handle:()=>{if(t){ge(`ai`,`ai-features`);return}y(n)},additionalKeywords:a}})},{icon:(0,Z.jsx)(Zt,{size:14,strokeWidth:1.5}),label:`Present as`,handle:kr,dropdown:[{icon:D.mode===`present`?(0,Z.jsx)(u,{size:14,strokeWidth:1.5}):(0,Z.jsx)(Pe,{size:14,strokeWidth:1.5}),label:`Toggle app view`,hotkey:`global.hideCode`,handle:()=>{De()}},...ot.map((e,t)=>{let n=un(e);return{divider:t===0,label:dn(e),icon:(0,Z.jsx)(n,{size:14,strokeWidth:1.5}),rightElement:(0,Z.jsx)(`div`,{className:`w-8 flex justify-end`,children:Te===e&&(0,Z.jsx)(ze,{size:14})}),handle:()=>{Ee(e),D.mode===`edit`&&De()}}})]},{icon:(0,Z.jsx)(Kt,{size:14,strokeWidth:1.5}),label:`Duplicate notebook`,hidden:!g||se(),handle:pe},{icon:(0,Z.jsx)(fe,{size:14,strokeWidth:1.5}),label:`Copy code to clipboard`,hidden:!g,handle:async()=>{let e=await W();await mt(e.contents),ht({title:`Copied`,description:`Code copied to clipboard.`})}},{icon:(0,Z.jsx)(Be,{size:14,strokeWidth:1.5}),label:`Enable all cells`,hidden:!Se||O,handle:async()=>{let e=b(),t=T(e),n=L.fromEntries(t.map(Wr));await ye({configs:n});for(let e of t)B({cellId:e,config:{disabled:!1}})}},{divider:!0,icon:(0,Z.jsx)(Wt,{size:14,strokeWidth:1.5}),label:`Add setup cell`,handle:()=>{ae({})}},{icon:(0,Z.jsx)(Ae,{size:14,strokeWidth:1.5}),label:`Add database connection`,additionalKeywords:e,handle:()=>{_((0,Z.jsx)(Nt,{onClose:v}))},dropdown:be.length===0?void 0:[...be.map(e=>({icon:(0,Z.jsx)(C,{size:14,strokeWidth:1.5}),label:`Add ${e.displayName}`,description:`Detected in your environment`,handle:()=>xe(e)})),{divider:!0,icon:(0,Z.jsx)(Ae,{size:14,strokeWidth:1.5}),label:`Browse all connections`,additionalKeywords:e,handle:()=>{_((0,Z.jsx)(Nt,{onClose:v}))}}]},{icon:(0,Z.jsx)(Qe,{size:14,strokeWidth:1.5}),label:`Add remote storage`,additionalKeywords:t,handle:()=>{_((0,Z.jsx)(Nt,{defaultTab:`storage`,onClose:v}))},dropdown:G.length===0?void 0:[...G.map(e=>({icon:(0,Z.jsx)(C,{size:14,strokeWidth:1.5}),label:`Add ${e.displayName}`,description:`Detected in your environment`,handle:()=>xe(e)})),{divider:!0,icon:(0,Z.jsx)(Qe,{size:14,strokeWidth:1.5}),label:`Browse all connections`,additionalKeywords:t,handle:()=>{_((0,Z.jsx)(Nt,{defaultTab:`storage`,onClose:v}))}}]},{icon:(0,Z.jsx)(en,{size:14,strokeWidth:1.5}),label:we,hidden:!Ce||O,handle:()=>{V()}},{icon:(0,Z.jsx)($t,{size:14,strokeWidth:1.5}),label:`Restart kernel`,variant:`danger`,handle:le,additionalKeywords:[`reset`,`reload`,`restart`]},{icon:(0,Z.jsx)(Gt,{size:14,strokeWidth:1.5}),label:`Re-run all cells`,redundant:!0,hotkey:`global.runAll`,handle:async()=>{ue()}},{icon:(0,Z.jsx)(S,{size:14,strokeWidth:1.5}),label:`Clear all outputs`,redundant:!0,handle:()=>{H()}},{icon:(0,Z.jsx)(E,{size:14,strokeWidth:1.5}),label:`Show all code`,hotkey:`global.showAllCode`,handle:()=>k(!1,`code`),redundant:!0},{icon:(0,Z.jsx)(Ge,{size:14,strokeWidth:1.5}),label:`Hide all code`,hotkey:`global.hideAllCode`,handle:()=>k(!0,`code`),redundant:!0},{icon:(0,Z.jsx)(E,{size:14,strokeWidth:1.5}),label:`Show all markdown code`,hotkey:`global.showAllMarkdownCode`,handle:()=>k(!1,`markdown`),redundant:!0},{icon:(0,Z.jsx)(Ge,{size:14,strokeWidth:1.5}),label:`Hide all markdown code`,hotkey:`global.hideAllMarkdownCode`,handle:()=>k(!0,`markdown`),redundant:!0},{icon:(0,Z.jsx)(He,{size:14,strokeWidth:1.5}),label:`Expand all outputs`,hotkey:`global.expandAllOutputs`,hidden:D.mode!==`edit`,handle:()=>A(!0),redundant:!0},{icon:(0,Z.jsx)(Ve,{size:14,strokeWidth:1.5}),label:`Clamp all outputs`,hotkey:`global.clampAllOutputs`,hidden:D.mode!==`edit`,handle:()=>A(!1),redundant:!0},{icon:(0,Z.jsx)(Vt,{size:14,strokeWidth:1.5}),label:`Collapse all sections`,hotkey:`global.collapseAllSections`,handle:ce,redundant:!0},{icon:(0,Z.jsx)(Bt,{size:14,strokeWidth:1.5}),label:`Expand all sections`,hotkey:`global.expandAllSections`,handle:U,redundant:!0},{divider:!0,icon:(0,Z.jsx)(Ut,{size:14,strokeWidth:1.5}),label:`Command palette`,hotkey:`global.commandPalette`,handle:()=>me(Ur)},{icon:(0,Z.jsx)(Fe,{size:14,strokeWidth:1.5}),label:`Keyboard shortcuts`,hotkey:`global.showHelp`,handle:()=>_e(Hr)},{icon:(0,Z.jsx)(ft,{size:14,strokeWidth:1.5}),label:`User settings`,handle:()=>he(Vr),redundant:!0,additionalKeywords:[`preferences`,`options`,`configuration`]},{icon:(0,Z.jsx)(Jt,{size:14,strokeWidth:1.5}),label:`Report an issue`,additionalKeywords:[`feedback`,`bug`,`issue`,`report`,`diagnostics`],handle:()=>_((0,Z.jsx)(jt,{onClose:v}))},{icon:(0,Z.jsx)(Ke,{size:14,strokeWidth:1.5}),label:`Resources`,handle:kr,dropdown:[{icon:(0,Z.jsx)(ke,{size:14,strokeWidth:1.5}),label:`Documentation`,handle:Br},{icon:(0,Z.jsx)(Ft,{className:`h-3.5 w-3.5`}),label:`GitHub`,handle:zr},{icon:(0,Z.jsx)(Ye,{size:14,strokeWidth:1.5}),label:`Discord Community`,handle:Rr},{icon:(0,Z.jsx)(Ze,{className:`h-3.5 w-3.5`}),label:`YouTube`,handle:Lr},{icon:(0,Z.jsx)(Me,{size:14,strokeWidth:1.5}),label:`Changelog`,handle:Ir}]},{divider:!0,icon:(0,Z.jsx)($e,{size:14,strokeWidth:1.5}),label:`Open home`,hidden:!location.search.includes(`file`),handle:Fr},{icon:(0,Z.jsx)(It,{size:14,strokeWidth:1.5}),label:`New notebook`,hidden:!location.search.includes(`file`),handle:Pr}].filter(Nr).map(jr),n[2]=xe,n[3]=ae,n[4]=R,n[5]=Ce,n[6]=I,n[7]=H,n[8]=v,n[9]=ce,n[10]=pe,n[11]=be,n[12]=G,n[13]=U,n[14]=m,n[15]=g,n[16]=Se,n[17]=je,n[18]=O,n[19]=_,n[20]=ge,n[21]=W,n[22]=le,n[23]=ue,n[24]=ye,n[25]=Te,n[26]=x,n[27]=k,n[28]=me,n[29]=ve,n[30]=_e,n[31]=Ee,n[32]=A,n[33]=he,n[34]=Oe,n[35]=q,n[36]=K,n[37]=y,n[38]=De,n[39]=V,n[40]=we,n[41]=B,n[42]=D.mode,n[43]=Ne}else Ne=n[43];return Ne}function jr(e){return e.dropdown?{...e,dropdown:e.dropdown.filter(Mr)}:e}function Mr(e){return!e.hidden}function Nr(e){return!e.hidden}function Pr(){let e=ae();window.open(e,`_blank`)}function Fr(){let e=document.baseURI.split(`?`)[0];window.open(e,`_blank`,`noopener`)}function Ir(){window.open(z.releasesPage,`_blank`)}function Lr(){window.open(z.youtube,`_blank`)}function Rr(){window.open(z.discordLink,`_blank`)}function zr(){window.open(z.githubPage,`_blank`)}function Br(){window.open(z.docsPage,`_blank`)}function Vr(e){return!e}function Hr(e){return!e}function Ur(e){return!e}function Wr(e){return[e,{disabled:!1}]}function Gr(e){return(0,Z.jsx)(`div`,{className:`w-8 flex justify-end`,children:e&&(0,Z.jsx)(ze,{size:14})})}export{sn as a,Jt as c,Ht as d,cn as i,Wt as l,Or as n,on as o,Er as r,en as s,Ar as t,Ut as u};
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,f as n,l as r,u as i}from"./useEvent-Dfcbgjhg.js";import{t as a}from"./react-DVplv7_D.js";import{D as o,E as s,Hr as c,Jr as l,Ka as u,Kr as d,Mt as f,Xr as p,Zr as m,_ as h,ai as g,an as _,co as v,er as y,h as b,in as x,oo as S,qa as C,qr as w,ra as T,ro as E,t as ee,xo as D,yt as te}from"./cells-D73Y_xmw.js";import{S as O,_ as k,j as A}from"./schemas-Dv42wLFq.js";import{t as j}from"./compiler-runtime-BrajqUja.js";import{C as M,n as N}from"./config-VPSq73n8.js";import{E as ne,h as P,n as F,r as re}from"./ai-model-dropdown-BKQARUae.js";import{g as I}from"./useEventListener-D9cftcHj.js";import{t as L}from"./objects-snlMn4yk.js";import{n as R,r as z}from"./utils-B4K466FK.js";import{_ as B,g as V,h as H,m as ie,s as ae,v as oe}from"./session-DqoWmb7X.js";import{M as se,O as ce}from"./config-DX8Y2WbJ.js";import{t as U}from"./cn-ldLVeaqm.js";import{t as le}from"./jsx-runtime-B74pBk57.js";import{$ as ue,It as de,Lt as fe}from"./JsonOutput-BeLVZDXh.js";import{a as pe,c as me,i as he,n as ge,r as _e,s as ve,t as W}from"./select-DTBn5eTb.js";import{a as ye,c as be,d as G,o as xe,t as Se}from"./download-CEG5vQri.js";import{t as Ce}from"./switch-CTaiAjrz.js";import{i as we,n as Te,r as Ee,t as De}from"./tabs-BuQlZFbt.js";import{n as Oe,t as K}from"./button-COI-NGrx.js";import{t as q}from"./createLucideIcon-DfJ2oMlA.js";import{a as ke,i as Ae,n as je,r as Me,t as Ne}from"./paths-bkIFVj8h.js";import{F as Pe,I as Fe,L as Ie,c as Le,t as Re}from"./layout-B5DZz9ah.js";import{t as ze}from"./check-BQNapYaf.js";import{r as Be}from"./useCellActionButton-CWhycKft.js";import{s as Ve}from"./tree-actions-D5HC2yfb.js";import{f as He,n as Ue}from"./markdown-renderer-CErbddaa.js";import{t as We}from"./code-BEiQP4pS.js";import{t as Ge}from"./eye-off-CxVozGAC.js";import{t as Ke}from"./external-link-UrX9KO36.js";import{t as qe}from"./file-BPBVl9pl.js";import{t as Je}from"./globe-UdPdIbF7.js";import{n as Ye,r as Xe,t as Ze}from"./youtube-CbJhsgLy.js";import{n as Qe}from"./components-CP_UoFtT.js";import{t as $e}from"./house-CpsMWsLL.js";import{t as et}from"./image-wZvTj8WY.js";import{b as tt}from"./write-secret-modal-DzKAInL2.js";import{t as nt}from"./link-NuFVR7G9.js";import{t as rt}from"./spinner-DyNE-o8o.js";import{c as it,l as at,u as ot}from"./readonly-python-code-CTbOf95g.js";import{Qt as st,Xt as ct,Yt as lt,Zt as ut,tn as dt}from"./input-BoBxR50a.js";import{t as ft}from"./settings-BpdQZRgT.js";import{t as pt}from"./square-BPmgQFnh.js";import{n as mt}from"./copy-D8O_CYCG.js";import{t as ht}from"./use-toast-Wu434mLr.js";import{t as gt}from"./copy-icon-BIiRXh_3.js";import{i as _t,r as vt,t as yt}from"./strings-B2vv-ENv.js";import{r as J}from"./requests-lt0JK8Jt.js";import{t as bt}from"./shell-Fj8a65ii.js";import{n as xt}from"./useAsyncData-C7aJJz0Y.js";import{r as St}from"./useRunCells-BVoQp_ne.js";import{s as Ct}from"./useInstallPackage-iX1eufdl.js";import{t as wt}from"./share-BZW3tzEX.js";import{n as Tt,r as Et}from"./markdown-export-DzhB1FrN.js";import{n as Dt,t as Ot}from"./alert-DTaqCu_d.js";import{a as kt}from"./cell-link-BI2FitQ_.js";import{t as At}from"./icons-CiZ_8zS-.js";import{n as jt}from"./feedback-button-DALE40Cq.js";import{i as Mt,n as Nt,r as Pt}from"./add-connection-dialog-C82vMzr5.js";import{t as Ft}from"./github-DQZhN3La.js";import{n as It}from"./marimo-icons-CqliHyTr.js";import{t as Lt}from"./links-DkkL9DVa.js";import{r as Rt,t as zt}from"./hooks-B7y2bbmR.js";var Bt=q(`circle-chevron-down`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 10-4 4-4-4`,key:`894hmk`}]]),Vt=q(`circle-chevron-right`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m10 8 4 4-4 4`,key:`1wy4r4`}]]),Ht=q(`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`}]]),Ut=q(`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`}]]),Wt=q(`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`}]]),Gt=q(`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`}]]),Kt=q(`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`}]]),qt=q(`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`}]]),Jt=q(`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`}]]),Yt=q(`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`}]]),Xt=q(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),Zt=q(`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`}]]),Qt=q(`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`}]]),$t=q(`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`}]]),en=q(`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`}]]),Y=e(a(),1),X=j();async function tn(e,t){let n=new Blob([t],{type:`text/html`});if(n.size>104857600)throw Error(`File is too large. Maximum size is 100 MB.`);let r=await fetch(`${z.molab}/api/artifacts/pending`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({fileName:e,fileSize:n.size})});if(!r.ok){let e=await r.json().catch(()=>null);throw Error(e?.error??(r.status===429?`Too many uploads, try again later`:`Failed to prepare the upload`))}let{presignedUrl:i,claimUrl:a}=await r.json();if(!(await fetch(i,{method:`PUT`,body:n})).ok)throw Error(`Failed to upload the notebook export`);return a}var Z=le(),nn=e=>{let t=(0,X.c)(33),{onClose:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={kind:`idle`},t[0]=r):r=t[0];let[i,a]=(0,Y.useState)(r),{exportAsHTML:o}=J(),s;t[1]===o?s=t[2]:(s=async()=>{a({kind:`publishing`});try{let{contents:e,filename:t}=await o({download:!1,includeCode:!0,files:Le.INSTANCE.filenames(),layout:await Re(),assetUrl:`https://cdn.jsdelivr.net/npm/@marimo-team/frontend@{version}/dist`}),n=await tn(t,e);window.open(n,`_blank`,`noopener,noreferrer`),a({kind:`staged`,claimUrl:n})}catch(e){let t=e;a({kind:`failed`,message:t instanceof Error?t.message:`Something went wrong`})}},t[1]=o,t[2]=s);let c=s;if(i.kind===`staged`){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(st,{children:[(0,Z.jsx)(dt,{children:`Finish publishing`}),(0,Z.jsx)(ct,{children:`If the confirmation page didn't open in a new tab, open it below.`})]}),t[3]=e):e=t[3];let r;t[4]===n?r=t[5]:(r=(0,Z.jsx)(K,{"data-testid":`done-share-static-notebook-button`,variant:`secondary`,onClick:n,children:`Done`}),t[4]=n,t[5]=r);let a;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(Ke,{size:14,strokeWidth:1.5,className:`mr-2`}),t[6]=a):a=t[6];let o;t[7]===i.claimUrl?o=t[8]:(o=(0,Z.jsx)(K,{asChild:!0,variant:`default`,children:(0,Z.jsxs)(`a`,{"data-testid":`open-claim-page-link`,href:i.claimUrl,target:`_blank`,rel:`noopener noreferrer`,children:[a,`Open confirmation page`]})}),t[7]=i.claimUrl,t[8]=o);let s;return t[9]!==r||t[10]!==o?(s=(0,Z.jsxs)(lt,{className:`sm:max-w-[480px]`,children:[e,(0,Z.jsxs)(ut,{children:[r,o]})]}),t[9]=r,t[10]=o,t[11]=s):s=t[11],s}let l=i.kind===`publishing`,u;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(dt,{children:`Publish HTML to web`}),t[12]=u):u=t[12];let d;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsxs)(st,{children:[u,(0,Z.jsxs)(ct,{children:[`Publish a static snapshot of this notebook to`,` `,(0,Z.jsx)(`a`,{href:z.molab,target:`_blank`,rel:`noopener noreferrer`,className:`underline`,children:`molab`}),`. Snapshots can be viewed by anyone on the internet.`]})]}),t[13]=d):d=t[13];let f;t[14]!==i.kind||t[15]!==i.message?(f=i.kind===`failed`&&(0,Z.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,"data-testid":`share-static-notebook-error`,children:[`Publish failed: `,i.message]}),t[14]=i.kind,t[15]=i.message,t[16]=f):f=t[16];let p;t[17]!==l||t[18]!==n?(p=(0,Z.jsx)(K,{"data-testid":`cancel-share-static-notebook-button`,variant:`secondary`,onClick:n,disabled:l,children:`Cancel`}),t[17]=l,t[18]=n,t[19]=p):p=t[19];let m;t[20]!==l||t[21]!==i.kind?(m=l?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(rt,{className:`mr-2`,size:`small`}),`Snapshotting notebook ...`]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Ke,{size:14,strokeWidth:1.5,className:`mr-2`}),i.kind===`failed`?`Try again`:`Publish`]}),t[20]=l,t[21]=i.kind,t[22]=m):m=t[22];let h;t[23]!==c||t[24]!==l||t[25]!==m?(h=(0,Z.jsx)(K,{"data-testid":`share-static-notebook-button`,variant:`default`,disabled:l,onClick:c,children:m}),t[23]=c,t[24]=l,t[25]=m,t[26]=h):h=t[26];let g;t[27]!==p||t[28]!==h?(g=(0,Z.jsxs)(ut,{children:[p,h]}),t[27]=p,t[28]=h,t[29]=g):g=t[29];let _;return t[30]!==f||t[31]!==g?(_=(0,Z.jsxs)(lt,{className:`sm:max-w-[480px]`,children:[d,f,g]}),t[30]=f,t[31]=g,t[32]=_):_=t[32],_};function rn(){let e=document.getElementsByClassName(R.outputArea);for(let t of e){let e=t.getBoundingClientRect();if(e.bottom>0&&e.top<window.innerHeight){let e=D.findElement(t);if(!e){I.warn(`Could not find HTMLCellId for visible output area`,t);continue}return{cellId:D.parse(e.id)}}}return I.warn(`No visible output area found for scroll anchor`),null}function an(e){if(!e){I.warn(`No scroll anchor provided to restore scroll position`);return}let t=document.getElementById(D.create(e.cellId));if(!t){I.warn(`Could not find cell element to restore scroll position`,e.cellId);return}if(!t.querySelector(`.${R.outputArea}`)){I.warn(`Could not find output area to restore scroll position`,e.cellId);return}t.scrollIntoView({block:`start`,behavior:`auto`})}function on(){let e=(0,X.c)(2),t=i(oe),n;return e[0]===t?n=e[1]:(n=()=>{let e=rn();t(t=>({mode:V(t.mode),cellAnchor:e?.cellId??null})),requestAnimationFrame(()=>{requestAnimationFrame(()=>{an(e)})})},e[0]=t,e[1]=n),n}var sn=n(!1),cn=()=>{let e=(0,X.c)(7),{selectedLayout:t}=at(),{setLayoutView:n}=it();if(se()&&!g(`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,Z.jsx)(ve,{className:`min-w-[110px] border-border bg-background`,"data-testid":`layout-select`,children:(0,Z.jsx)(me,{placeholder:`Select a view`})}),e[2]=i):i=e[2];let a;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(ge,{children:(0,Z.jsxs)(_e,{children:[(0,Z.jsx)(pe,{children:`View as`}),ot.map(fn)]})}),e[3]=a):a=e[3];let o;return e[4]!==t||e[5]!==r?(o=(0,Z.jsxs)(W,{"data-testid":`layout-select`,value:t,onValueChange:r,children:[i,a]}),e[4]=t,e[5]=r,e[6]=o):o=e[6],o};function ln(e){let t=un(e);return(0,Z.jsx)(t,{className:`h-4 w-4`})}function un(e){switch(e){case`vertical`:return qt;case`grid`:return Xe;case`slides`:return Zt;default:return _t(e),pt}}function dn(e){return yt.startCase(e)}function fn(e){return(0,Z.jsx)(he,{value:e,children:(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5 leading-5`,children:[ln(e),(0,Z.jsx)(`span`,{children:dn(e)})]})},e)}var pn=[`html`,`markdown`,`ipynb`,`pdf`,`script`,`png`],mn=[`pymdown`,`qmd`,`mystmd`,`mdx`],hn=[`topological`,`top-down`],gn=[`document`,`slides`],_n=[`source`,`flat`];function vn(e){return typeof e==`string`&&pn.some(t=>t===e)}var Q={html:{includeCode:!0},markdown:{flavor:null},ipynb:{sortMode:`topological`,includeOutputs:!1},pdf:{preset:`document`,includeInputs:!0,includeOutputs:!0,webpdf:!0},script:{type:`source`}};function $(e,t){return e.default(t).catch(t)}function yn(e){return A(e).optional().catch(void 0)}var bn=A({html:yn({includeCode:$(O(),Q.html.includeCode)}),markdown:yn({flavor:$(k(mn).nullable(),Q.markdown.flavor)}),ipynb:yn({sortMode:$(k(hn),Q.ipynb.sortMode),includeOutputs:$(O(),Q.ipynb.includeOutputs)}),pdf:yn({preset:$(k(gn),Q.pdf.preset),includeInputs:$(O(),Q.pdf.includeInputs),includeOutputs:$(O(),Q.pdf.includeOutputs),webpdf:$(O(),Q.pdf.webpdf)}),script:yn({type:$(k(_n),Q.script.type)})}).catch({});function xn(e,t){let n={...e},r=r=>{n[r]={...e[r],...t[r]}};for(let e of Object.keys(t))r(e);return n}function Sn(e){return xn(Q,bn.parse(e))}var Cn=m({toSerializable:e=>e,fromSerializable:Sn}),wn=ce(`marimo:export:options:v1`,Q,Cn,{getOnInit:!0}),Tn=ce(`marimo:export:last-format:v1`,`html`,m({toSerializable:e=>e,fromSerializable:e=>vn(e)?e:`html`}),{getOnInit:!0}),En={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 Dn(e,t){return e===`wasm`&&t===`pdf`}function On({format:e,options:t,runtime:n,filename:r,availability:i}){let a=e===`script`&&t.script.type===`source`?{...En.script,requiresNamedNotebookOnServer:!0}:En[e],o=Dn(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 kn(e,t){return e.map(e=>({value:e,...t[e]}))}var An=kn([`automatic`,...mn],{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.`}}),jn=kn(hn,{"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.`}}),Mn=kn(gn,{document:{label:`Document`,description:`Creates pages for reading or printing.`},slides:{label:`Slides`,description:`Creates presentation slides from the notebook.`}}),Nn=kn([`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.`}}),Pn=kn(_n,{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.`}}),Fn={html:{label:`HTML`,actionLabel:`Export HTML`,description:`Save the current notebook as an HTML page.`,Icon:Je,Options:In},markdown:{label:`Markdown`,actionLabel:`Export Markdown`,description:`Save code and text in a Markdown-based file. Cell outputs are not included.`,Icon:Me,Options:Ln},ipynb:{label:`Jupyter`,actionLabel:`Export Jupyter notebook`,description:`Open the notebook in Jupyter and other compatible tools.`,Icon:Yt,Options:Rn},pdf:{label:`PDF`,actionLabel:`Export PDF`,description:`Save the notebook as a PDF for printing or sharing.`,Icon:qe,Options:zn},script:{label:`Python`,actionLabel:`Export flat script`,description:`Save the notebook as a Python file.`,Icon:We,Options:Bn},png:{label:`PNG`,actionLabel:`Export PNG`,description:`Capture the current app view as an image.`,Icon:et,Options:Vn}};function In(e){let t=(0,X.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,Z.jsx)(Hn,{children:(0,Z.jsx)(Un,{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 Ln(e){let t=(0,X.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,Z.jsx)(Hn,{children:(0,Z.jsx)(Kn,{label:`Format`,value:a,disabled:i,onValueChange:o,options:An})}),t[2]=i,t[3]=a,t[4]=o,t[5]=s):s=t[5],s}function Rn(e){let t=(0,X.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,Z.jsx)(Wn,{label:`Cell order`,value:n.ipynb.sortMode,disabled:i,onValueChange:a,options:jn}),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,Z.jsx)(Un,{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,Z.jsxs)(Hn,{children:[o,l]}),t[13]=o,t[14]=l,t[15]=u):u=t[15],u}function zn(e){let t=(0,X.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,Z.jsx)(Wn,{label:`Layout`,value:n.pdf.preset,disabled:i,onValueChange:a,options:Mn}),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,Z.jsx)(Un,{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,Z.jsx)(Un,{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,Z.jsx)(Wn,{label:`Method`,value:n.pdf.webpdf?`browser`:`latex`,disabled:i,onValueChange:e=>r(`pdf`,{webpdf:e===`browser`}),options:Nn}):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,Z.jsxs)(Hn,{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 Bn(e){let t=(0,X.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,Z.jsx)(Hn,{children:(0,Z.jsx)(Wn,{label:`Format`,value:n.script.type,disabled:i,onValueChange:a,options:Pn})}),t[2]=i,t[3]=n.script.type,t[4]=a,t[5]=o):o=t[5],o}function Vn(){return null}function Hn(e){let t=(0,X.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(`div`,{className:`divide-y rounded-md border`,children:n}),t[0]=n,t[1]=r),r}function Un(e){let t=(0,X.c)(26),{label:n,descriptions:r,descriptionOverride:i,checked:a,disabled:o,onCheckedChange:s}=e,c=(0,Y.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,Z.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,Z.jsx)(Yn,{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,Z.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,Z.jsx)(Ce,{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,Z.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 Wn(e){let t=(0,X.c)(31),{label:n,value:r,disabled:i,onValueChange:a,options:o}=e,s=(0,Y.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,Z.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(Gn),t[5]=o,t[6]=p);let m;t[7]!==c||t[8]!==f||t[9]!==p?(m=(0,Z.jsx)(Yn,{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,Z.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 v;if(t[16]!==s||t[17]!==o){let e;t[19]===s?e=t[20]:(e=(e,t)=>{let n=`${s}-${t}`;return(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(_,{id:n,value:e.value}),(0,Z.jsx)(`label`,{htmlFor:n,className:`text-sm`,children:e.label})]},e.value)},t[19]=s,t[20]=e),v=o.map(e),t[16]=s,t[17]=o,t[18]=v}else v=t[18];let y;t[21]!==c||t[22]!==i||t[23]!==n||t[24]!==g||t[25]!==v||t[26]!==r?(y=(0,Z.jsx)(x,{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:v}),t[21]=c,t[22]=i,t[23]=n,t[24]=g,t[25]=v,t[26]=r,t[27]=y):y=t[27];let b;return t[28]!==h||t[29]!==y?(b=(0,Z.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,y]}),t[28]=h,t[29]=y,t[30]=b):b=t[30],b}function Gn(e){return e.description}function Kn(e){let t=(0,X.c)(34),{label:n,value:r,disabled:i,onValueChange:a,options:o}=e,s=(0,Y.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,Z.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(Jn),t[6]=o,t[7]=p);let m;t[8]!==c||t[9]!==f||t[10]!==p?(m=(0,Z.jsx)(Yn,{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,Z.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,Z.jsx)(me,{}),t[17]=_):_=t[17];let v;t[18]!==c||t[19]!==s?(v=(0,Z.jsx)(ve,{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(qn),t[21]=o,t[22]=y);let b;t[23]===y?b=t[24]:(b=(0,Z.jsx)(ge,{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,Z.jsxs)(W,{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,Z.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 qn(e){return(0,Z.jsx)(he,{value:e.value,children:e.label},e.value)}function Jn(e){return e.description}function Yn(e){let t=(0,X.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,Z.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(Xn),t[10]=c,t[11]=u);let d;return t[12]!==l||t[13]!==u?(d=(0,Z.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 Xn(e){return(0,Z.jsx)(`p`,{"aria-hidden":!0,className:`invisible col-start-1 row-start-1`,children:e},e)}var Zn={"playwright-chromium":{description:`PDF export requires Playwright Chromium.`}};function Qn(e){let t=(0,X.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,Z.jsxs)(`span`,{className:`ml-auto flex shrink-0`,children:[(0,Z.jsx)(rt,{size:`small`,className:`size-3`}),(0,Z.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=U(`size-3`,i),t[1]=i,t[2]=a);let o;t[3]===a?o=t[4]:(o=(0,Z.jsx)(v,{className:a}),t[3]=a,t[4]=o);let s;t[5]===r?s=t[6]:(s=(0,Z.jsx)(`span`,{className:`sr-only`,children:r}),t[5]=r,t[6]=s);let c;return t[7]!==o||t[8]!==s?(c=(0,Z.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 $n(e){let t=(0,X.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,Z.jsx)(`div`,{className:`mb-2.5`,children:(0,Z.jsx)(er,{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,Z.jsx)(`div`,{className:`mb-2.5`,children:(0,Z.jsx)(tr,{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 er(e){let t=(0,X.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,Z.jsx)(v,{className:`size-4 shrink-0`}),t[0]=o):o=t[0];let s;t[1]===n?s=t[2]:(s=(0,Z.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,Z.jsxs)(K,{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,Z.jsx)(rt,{size:`small`,className:`mr-1.5 size-3.5`}):(0,Z.jsx)(Ht,{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,Z.jsxs)(Ot,{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,Z.jsxs)(Dt,{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 tr(e){let t=(0,X.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,Z.jsx)(rt,{className:`size-4 shrink-0`,size:`small`}),t[0]=e):e=t[0];let n;return t[1]===r?n=t[2]:(n=(0,Z.jsxs)(Ot,{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,Z.jsxs)(Dt,{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,Z.jsx)(er,{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,Z.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,Z.jsxs)(er,{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(rr).join(` `):(0,Z.jsx)(`span`,{className:`block min-w-0`,children:i.requirements.map(nr)}),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,Z.jsx)(er,{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,Z.jsx)(er,{children:e}),t[20]=e,t[21]=r),r}default:vt(i)}}function nr(e){let t=Zn[e.name];return(0,Z.jsxs)(`span`,{className:`block`,children:[t.description,(0,Z.jsx)(`code`,{className:`mt-1 block break-all font-mono`,children:e.command})]},e.name)}function rr(e){return Zn[e.name].description}function ir(e){return e.endsWith(`.myst.md`)?`mystmd`:e.endsWith(`.qmd`)?`qmd`:e.endsWith(`.mdx`)?`mdx`:`pymdown`}function ar(e,t){let n=t??ir(e),r=Tt[n],i=Et.find(t=>e.endsWith(t)),a=G.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 or(e){return Object.entries(e).flatMap(([e,t])=>t===null?[]:t===!0?[`--${e}`]:t===!1?[`--no-${e}`]:[`--${e}=${t}`])}function sr(e){return e.preset===`document`?e.webpdf:null}var cr={html:{subcommand:`html`,flags:({html:e})=>({"include-code":e.includeCode}),outputFilename:e=>G.toHTML(e)},markdown:{subcommand:`md`,flags:({markdown:e})=>({flavor:e.flavor}),outputFilename:(e,{markdown:t})=>ar(e,t.flavor)},ipynb:{subcommand:`ipynb`,flags:({ipynb:e})=>({sort:e.sortMode,"include-outputs":e.includeOutputs}),outputFilename:e=>G.toIPYNB(e)},pdf:{subcommand:`pdf`,flags:({pdf:e})=>({as:e.preset,"include-inputs":e.includeInputs,"include-outputs":e.includeOutputs,webpdf:sr(e)}),outputFilename:e=>G.toPDF(e)},script:{subcommand:`script`,flags:()=>({}),outputFilename:e=>`${G.withoutExtension(e)}.script.py`}};function lr({format:e,filename:t,options:n}){if(e===`png`||e===`script`&&n.script.type===`source`||!t)return null;let r=cr[e];return[`marimo`,`export`,r.subcommand,bt(t),...or(r.flags(n)),`-o`,bt(r.outputFilename(t,n))].join(` `)}async function ur(e){let{exportOptions:t,captureOutputs:n,downloadPDF:r}=e;t.includeOutputs&&await n(),await r(t)}async function dr({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 ur({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:vt(e)}}var fr={source:{actionLabel:`Export notebook source`,progressLabel:`notebook source`},flat:{actionLabel:`Export flat script`,progressLabel:`flat script`}};function pr(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 mr(e,t){return e===`server`&&t?je.basename(t):G.toPY(document.title)}function hr({usesBrowserPrint:e,hasCommand:t,format:n,isNotebookSource:r}){return e?`Uses the browser's print settings for page size and filename.`:t?`Uses the current session state. The copied command exports the saved notebook.`:n!==`png`&&!r?`Save the notebook to copy an equivalent shell command.`:null}function gr(e){let n=kt(),[r,i]=t(wn),[a,o]=t(Tn),[s,c]=(0,Y.useState)(e??a),l=se()?`wasm`:`server`,u=J(),d=B(),[f,p]=(0,Y.useState)(!1),m=xt(async()=>l===`wasm`?null:u.getExportAvailability(),[l,u]),h=pr(l,m),g=e=>On({format:e,options:r,runtime:l,filename:n,availability:h}),_=g(s),v=d&&(_.reason?.type===`missing-packages`||_.reason?.type===`missing-setup`),y=pn.map(e=>({format:e,status:g(e)})),b=Dn(l,s),x=Fn[s],S=s===`script`&&r.script.type===`source`,{actionLabel:C,progressLabel:w}=s===`script`?fr[r.script.type]:{actionLabel:x.actionLabel,progressLabel:x.label},T=b?null:lr({format:s,filename:n,options:r}),E=hr({usesBrowserPrint:b,hasCommand:!!T,format:s,isNotebookSource:S});return(0,Y.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:mr(l,n),available:_.available,usesBrowserPrint:b,progressLabel:w},selectFormat:e=>{vn(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 _r(e){let t=document.getElementById(`App`);if(!t){let e=`The current app view could not be captured.`;throw ht({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 xe({element:t,filename:document.title,prepare:()=>{let t=Se();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 vr(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=J(),c=Rt(),[l,u]=(0,Y.useState)(!1),d=(0,Y.useRef)(null),f=(0,Y.useRef)(!0);(0,Y.useEffect)(()=>(f.current=!0,()=>{f.current=!1}),[]);let p=async e=>{await zt({takeScreenshots:()=>c({progress:e}),updateCellOutputs:s.updateCellOutputs})},m=async()=>{await H(()=>_r(d.current?.parentElement??null))};return{dialogRef:d,isExporting:l,submit:async()=>{if(!(!r||l)){if(i){vr(o);return}u(!0);try{await be(`Exporting ${a}…`,async r=>{await dr({format:e,options:t,requests:s,sourceFilename:n,htmlFiles:Le.INSTANCE.filenames(),getLayout:Re,captureOutputs:()=>p(r),capturePNG:m,downloadFile:ye})}),f.current&&o()}catch(e){I.error(`Export failed`,e)}finally{f.current&&u(!1)}}}}}function br(e){let t=(0,X.c)(15),{initialFormat:n,onClose:r}=e,i=gr(n),a,o,s;t[0]===i?(a=t[1],o=t[2],s=t[3]):({exportRequest:a,selectFormat:o,...s}=i,t[0]=i,t[1]=a,t[2]=o,t[3]=s);let c;t[4]!==a||t[5]!==r?(c={...a,onClose:r},t[4]=a,t[5]=r,t[6]=c):c=t[6];let l=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 xr=`(min-width: 640px)`,Sr=e=>{let t=(0,X.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}=br(a),_=s||c,v=ue(xr),{format:y,status:b,usesBrowserPrint:x,actionLabel:S,command:C,footerDescription:w}=f,T=Fn[y],E=T.Options,ee;t[3]===i?ee=t[4]:(ee=i?{onCloseAutoFocus:e=>{e.preventDefault(),i.current?.focus()}}:{},t[3]=i,t[4]=ee);let D=ee,te;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,Z.jsxs)(st,{className:`border-b px-5 py-4 pr-12`,children:[(0,Z.jsx)(dt,{children:`Export notebook`}),(0,Z.jsx)(ct,{children:`Choose a format and adjust its options.`})]}),t[5]=te):te=t[5];let O=v?`vertical`:`horizontal`,k;if(t[6]!==u||t[7]!==_){let e;t[9]===_?e=t[10]:(e=e=>{let{format:t,status:n}=e,r=Fn[t];return(0,Z.jsxs)(we,{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,Z.jsx)(r.Icon,{className:`size-3.5 shrink-0`,strokeWidth:1.5}),(0,Z.jsx)(`span`,{className:`truncate`,children:r.label}),(0,Z.jsx)(Qn,{status:n})]},t)},t[9]=_,t[10]=e),k=u.map(e),t[6]=u,t[7]=_,t[8]=k}else k=t[8];let A;t[11]===k?A=t[12]:(A=(0,Z.jsx)(Ee,{"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:k}),t[11]=k,t[12]=A);let j;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,Z.jsxs)(Te,{value:t,className:`mt-0 min-h-0 min-w-0 overflow-y-auto px-4 py-3`,children:[(0,Z.jsxs)(`div`,{className:`mb-3`,children:[(0,Z.jsx)(`h3`,{className:`text-base font-semibold`,children:T.label}),(0,Z.jsx)(`p`,{className:`mt-0.5 text-sm text-muted-foreground`,children:T.description})]}),(0,Z.jsx)($n,{format:y,formatLabel:T.label,status:b,onInstall:l?h:void 0,isInstalling:c}),x?null:(0,Z.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],j=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]=j}else j=t[26];let M;t[40]!==y||t[41]!==p||t[42]!==O||t[43]!==A||t[44]!==j?(M=(0,Z.jsxs)(De,{value:y,onValueChange:p,orientation:O,className:`flex min-h-0 min-w-0 flex-col overflow-hidden sm:grid sm:grid-cols-[168px_minmax(0,1fr)]`,children:[A,j]}),t[40]=y,t[41]=p,t[42]=O,t[43]=A,t[44]=j,t[45]=M):M=t[45];let N;t[46]===C?N=t[47]:(N=C?(0,Z.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,Z.jsx)(`span`,{className:`select-none text-muted-foreground`,"aria-hidden":!0,children:`$`}),(0,Z.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,Z.jsx)(gt,{value:C,className:`size-3.5`,buttonClassName:U(Oe({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]=N);let ne=C&&`mt-3`,P;t[48]===ne?P=t[49]:(P=U(`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,ne),t[48]=ne,t[49]=P);let F;t[50]===w?F=t[51]:(F=w?(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:w}):null,t[50]=w,t[51]=F);let re=!b.available||_,I=!w&&`sm:ml-auto`,L;t[52]===I?L=t[53]:(L=U(`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)`,I),t[52]=I,t[53]=L);let R;t[54]===s?R=t[55]:(R=s&&(0,Z.jsx)(rt,{size:`small`,className:`mr-2`,"aria-hidden":!0}),t[54]=s,t[55]=R);let z=x?`Print to PDF`:S,B;t[56]!==s||t[57]!==g||t[58]!==re||t[59]!==L||t[60]!==R||t[61]!==z?(B=(0,Z.jsxs)(K,{type:`button`,disabled:re,"aria-busy":s,onClick:g,className:L,"data-testid":`export-submit`,children:[R,z]}),t[56]=s,t[57]=g,t[58]=re,t[59]=L,t[60]=R,t[61]=z,t[62]=B):B=t[62];let V;t[63]!==P||t[64]!==F||t[65]!==B?(V=(0,Z.jsxs)(`div`,{className:P,children:[F,B]}),t[63]=P,t[64]=F,t[65]=B,t[66]=V):V=t[66];let H;t[67]!==V||t[68]!==N?(H=(0,Z.jsxs)(`footer`,{className:`min-w-0 border-t bg-muted/20 px-4 py-3`,children:[N,V]}),t[67]=V,t[68]=N,t[69]=H):H=t[69];let ie;return t[70]!==o||t[71]!==D||t[72]!==H||t[73]!==M?(ie=(0,Z.jsxs)(lt,{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`,...D,children:[te,M,H]}),t[70]=o,t[71]=D,t[72]=H,t[73]=M,t[74]=ie):ie=t[74],ie};function Cr(e){let t=(0,X.c)(5),{openPrompt:n,closeModal:r}=tt(),{sendCopy:i}=J(),a;return t[0]!==r||t[1]!==n||t[2]!==i||t[3]!==e?(a=()=>{if(!e)return null;let t=Ne.guessDeliminator(e),a=je.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(je.dirname(e),n);i({source:e,destination:a}).then(()=>{r(),ht({title:`Notebook copied`,description:`A copy of the notebook has been created.`}),Lt(a)})}})},t[0]=r,t[1]=n,t[2]=i,t[3]=e,t[4]=a):a=t[4],a}var wr=new y,Tr=e=>wr.isSupported(e)?`markdown`:`code`,Er=()=>{let e=(0,X.c)(3),{updateCellConfig:t}=o(),{saveCellConfig:n}=J(),r;return e[0]!==n||e[1]!==t?(r=async(e,r)=>{let i=b(),a={};for(let t of i.cellIds.inOrderIds){let n=i.cellData[t];n!==void 0&&n.config.hide_code!==e&&Tr(n.code)===r&&(a[t]={hide_code:e})}let o=L.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};function Dr(e,t){let n={};for(let r of e.cellIds.inOrderIds){let i=e.cellData[r];i!==void 0&&(i.config.expand_output??!1)!==t&&(Ue(e.cellRuntime[r]?.output)||(n[r]={expand_output:t}))}return n}var Or=()=>{let e=(0,X.c)(3),{updateCellConfig:t}=o(),{saveCellConfig:n}=J(),r;return e[0]!==n||e[1]!==t?(r=async e=>{let r=Dr(b(),e),i=L.entries(r);if(i.length!==0){await n({configs:r});for(let[e,n]of i)t({cellId:e,config:n})}},e[0]=n,e[1]=t,e[2]=r):r=e[2],r},kr=e=>{e?.preventDefault(),e?.stopPropagation()};function Ar(e){let n=(0,X.c)(44),a;n[0]===e?a=n[1]:(a=e===void 0?{}:e,n[0]=e,n[1]=a);let{exportDialogReturnFocusRef:m}=a,g=kt(),{openModal:_,closeModal:v}=tt(),{toggleApplication:y}=d(),{selectedPanel:x}=w(),[D]=t(oe),O=r(ie),k=Er(),A=Or(),[j]=M(),I=r(c),R=r(N),{updateCellConfig:B,undoDeleteCell:V,clearAllCellOutputs:H,addSetupCellIfDoesntExist:ae,collapseAllCells:ce,expandAllCells:U}=o(),le=Ct(),ue=St(),pe=Cr(g),me=i(sn),he=i(F),{handleClick:ge}=re(),_e=i(ne),ve=i(wn),{readCode:W,saveCellConfig:ye}=J(),be=te(`database`),G=te(`storage`),xe=f(),Se=r(h),Ce=r(ee),we=r(s),{selectedLayout:Te}=at(),{setLayoutView:Ee}=it(),De=on(),Oe=j.sharing?.html??!0,K=j.sharing?.wasm??!0,q=j.sharing?.molab??!0,je=Te===`slides`,Ne;if(n[2]!==xe||n[3]!==ae||n[4]!==R||n[5]!==Ce||n[6]!==I||n[7]!==H||n[8]!==v||n[9]!==ce||n[10]!==pe||n[11]!==be||n[12]!==G||n[13]!==U||n[14]!==m||n[15]!==g||n[16]!==Se||n[17]!==je||n[18]!==O||n[19]!==_||n[20]!==ge||n[21]!==W||n[22]!==le||n[23]!==ue||n[24]!==ye||n[25]!==Te||n[26]!==x||n[27]!==k||n[28]!==me||n[29]!==ve||n[30]!==_e||n[31]!==Ee||n[32]!==A||n[33]!==he||n[34]!==Oe||n[35]!==q||n[36]!==K||n[37]!==y||n[38]!==De||n[39]!==V||n[40]!==we||n[41]!==B||n[42]!==D.mode){let e=[`db`,`sql`,...Mt],t=[`bucket`,`object storage`,...Pt],r=Gr,i=(e,t)=>{t&&ve(e=>xn(e,t)),_((0,Z.jsx)(Sr,{initialFormat:e,onClose:v,returnFocusRef:m}))};Ne=[{icon:(0,Z.jsx)(de,{size:14,strokeWidth:1.5}),label:`Export…`,additionalKeywords:[`download`,`html`,`markdown`,`ipynb`,`pdf`,`script`,`png`],handle:()=>i()},{icon:(0,Z.jsx)(de,{size:14,strokeWidth:1.5}),label:`Download`,redundant:!0,handle:kr,dropdown:[{icon:(0,Z.jsx)(Ie,{size:14,strokeWidth:1.5}),label:`Download as HTML`,handle:()=>i(`html`,{html:{includeCode:!0}})},{icon:(0,Z.jsx)(Ie,{size:14,strokeWidth:1.5}),label:`Download as HTML (exclude code)`,handle:()=>i(`html`,{html:{includeCode:!1}})},{icon:(0,Z.jsx)(At,{strokeWidth:1.5,style:{width:14,height:14}}),label:`Download as Markdown`,handle:()=>i(`markdown`)},{icon:(0,Z.jsx)(Yt,{size:14,strokeWidth:1.5}),label:`Download as ipynb`,handle:()=>i(`ipynb`)},{icon:(0,Z.jsx)(We,{size:14,strokeWidth:1.5}),label:`Download notebook source`,handle:()=>i(`script`,{script:{type:`source`}})},{icon:(0,Z.jsx)(We,{size:14,strokeWidth:1.5}),label:`Download flat script`,handle:()=>i(`script`,{script:{type:`flat`}})},{divider:!0,icon:(0,Z.jsx)(et,{size:14,strokeWidth:1.5}),label:`Download as PNG`,handle:()=>i(`png`)},je?{divider:!0,icon:(0,Z.jsx)(qe,{size:14,strokeWidth:1.5}),label:`Download as PDF`,handle:kr,dropdown:[{icon:(0,Z.jsx)(qe,{size:14,strokeWidth:1.5}),label:`Document Layout`,handle:()=>i(`pdf`,{pdf:{preset:`document`}})},{icon:(0,Z.jsx)(qe,{size:14,strokeWidth:1.5}),label:`Slides Layout`,hidden:se(),rightElement:(0,Z.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,Z.jsx)(qe,{size:14,strokeWidth:1.5}),label:`Download as PDF`,handle:()=>i(`pdf`,{pdf:{preset:`document`}})}]},{icon:(0,Z.jsx)(C,{size:14,strokeWidth:1.5}),label:`Connect your agent`,hidden:se(),handle:async()=>{_((0,Z.jsx)(P,{onClose:v}))},additionalKeywords:[`connect`]},{icon:(0,Z.jsx)(Qt,{size:14,strokeWidth:1.5}),label:`Share`,handle:kr,hidden:!Oe&&!K&&!q,dropdown:[{icon:(0,Z.jsx)(Je,{size:14,strokeWidth:1.5}),label:`Publish HTML to web`,hidden:!Oe,handle:async()=>{_((0,Z.jsx)(nn,{onClose:v}))}},{icon:(0,Z.jsx)(nt,{size:14,strokeWidth:1.5}),label:`Create WebAssembly link`,hidden:!K,handle:async()=>{let e=await W(),t=wt({code:e.contents});await mt(t),ht({title:`Copied`,description:`Link copied to clipboard.`})}},{icon:(0,Z.jsx)(It,{size:14,strokeWidth:1.5}),label:`Create molab notebook`,hidden:!q,handle:async()=>{let e=await W(),t=wt({code:e.contents,baseUrl:`${z.molab}/new`});window.open(t,`_blank`)}}]},{icon:(0,Z.jsx)(Xt,{size:14,strokeWidth:1.5}),label:`Helper panel`,redundant:!0,handle:kr,dropdown:l.flatMap(e=>{let t=e.type===`ai`&&!R;if(p({panel:e,capabilities:I,aiEnabled:R})&&!t)return[];let{type:n,Icon:i,additionalKeywords:a}=e;return{label:yt.startCase(n),rightElement:r(x===n),icon:(0,Z.jsx)(i,{size:14,strokeWidth:1.5}),handle:()=>{if(t){ge(`ai`,`ai-features`);return}y(n)},additionalKeywords:a}})},{icon:(0,Z.jsx)(Zt,{size:14,strokeWidth:1.5}),label:`Present as`,handle:kr,dropdown:[{icon:D.mode===`present`?(0,Z.jsx)(u,{size:14,strokeWidth:1.5}):(0,Z.jsx)(Pe,{size:14,strokeWidth:1.5}),label:`Toggle app view`,hotkey:`global.hideCode`,handle:()=>{De()}},...ot.map((e,t)=>{let n=un(e);return{divider:t===0,label:dn(e),icon:(0,Z.jsx)(n,{size:14,strokeWidth:1.5}),rightElement:(0,Z.jsx)(`div`,{className:`w-8 flex justify-end`,children:Te===e&&(0,Z.jsx)(ze,{size:14})}),handle:()=>{Ee(e),D.mode===`edit`&&De()}}})]},{icon:(0,Z.jsx)(Kt,{size:14,strokeWidth:1.5}),label:`Duplicate notebook`,hidden:!g||se(),handle:pe},{icon:(0,Z.jsx)(fe,{size:14,strokeWidth:1.5}),label:`Copy code to clipboard`,hidden:!g,handle:async()=>{let e=await W();await mt(e.contents),ht({title:`Copied`,description:`Code copied to clipboard.`})}},{icon:(0,Z.jsx)(Be,{size:14,strokeWidth:1.5}),label:`Enable all cells`,hidden:!Se||O,handle:async()=>{let e=b(),t=T(e),n=L.fromEntries(t.map(Wr));await ye({configs:n});for(let e of t)B({cellId:e,config:{disabled:!1}})}},{divider:!0,icon:(0,Z.jsx)(Wt,{size:14,strokeWidth:1.5}),label:`Add setup cell`,handle:()=>{ae({})}},{icon:(0,Z.jsx)(Ae,{size:14,strokeWidth:1.5}),label:`Add database connection`,additionalKeywords:e,handle:()=>{_((0,Z.jsx)(Nt,{onClose:v}))},dropdown:be.length===0?void 0:[...be.map(e=>({icon:(0,Z.jsx)(C,{size:14,strokeWidth:1.5}),label:`Add ${e.displayName}`,description:`Detected in your environment`,handle:()=>xe(e)})),{divider:!0,icon:(0,Z.jsx)(Ae,{size:14,strokeWidth:1.5}),label:`Browse all connections`,additionalKeywords:e,handle:()=>{_((0,Z.jsx)(Nt,{onClose:v}))}}]},{icon:(0,Z.jsx)(Qe,{size:14,strokeWidth:1.5}),label:`Add remote storage`,additionalKeywords:t,handle:()=>{_((0,Z.jsx)(Nt,{defaultTab:`storage`,onClose:v}))},dropdown:G.length===0?void 0:[...G.map(e=>({icon:(0,Z.jsx)(C,{size:14,strokeWidth:1.5}),label:`Add ${e.displayName}`,description:`Detected in your environment`,handle:()=>xe(e)})),{divider:!0,icon:(0,Z.jsx)(Qe,{size:14,strokeWidth:1.5}),label:`Browse all connections`,additionalKeywords:t,handle:()=>{_((0,Z.jsx)(Nt,{defaultTab:`storage`,onClose:v}))}}]},{icon:(0,Z.jsx)(en,{size:14,strokeWidth:1.5}),label:we,hidden:!Ce||O,handle:()=>{V()}},{icon:(0,Z.jsx)($t,{size:14,strokeWidth:1.5}),label:`Restart kernel`,variant:`danger`,handle:le,additionalKeywords:[`reset`,`reload`,`restart`]},{icon:(0,Z.jsx)(Gt,{size:14,strokeWidth:1.5}),label:`Re-run all cells`,redundant:!0,hotkey:`global.runAll`,handle:async()=>{ue()}},{icon:(0,Z.jsx)(S,{size:14,strokeWidth:1.5}),label:`Clear all outputs`,redundant:!0,handle:()=>{H()}},{icon:(0,Z.jsx)(E,{size:14,strokeWidth:1.5}),label:`Show all code`,hotkey:`global.showAllCode`,handle:()=>k(!1,`code`),redundant:!0},{icon:(0,Z.jsx)(Ge,{size:14,strokeWidth:1.5}),label:`Hide all code`,hotkey:`global.hideAllCode`,handle:()=>k(!0,`code`),redundant:!0},{icon:(0,Z.jsx)(E,{size:14,strokeWidth:1.5}),label:`Show all markdown code`,hotkey:`global.showAllMarkdownCode`,handle:()=>k(!1,`markdown`),redundant:!0},{icon:(0,Z.jsx)(Ge,{size:14,strokeWidth:1.5}),label:`Hide all markdown code`,hotkey:`global.hideAllMarkdownCode`,handle:()=>k(!0,`markdown`),redundant:!0},{icon:(0,Z.jsx)(He,{size:14,strokeWidth:1.5}),label:`Expand all outputs`,hotkey:`global.expandAllOutputs`,hidden:D.mode!==`edit`,handle:()=>A(!0),redundant:!0},{icon:(0,Z.jsx)(Ve,{size:14,strokeWidth:1.5}),label:`Clamp all outputs`,hotkey:`global.clampAllOutputs`,hidden:D.mode!==`edit`,handle:()=>A(!1),redundant:!0},{icon:(0,Z.jsx)(Vt,{size:14,strokeWidth:1.5}),label:`Collapse all sections`,hotkey:`global.collapseAllSections`,handle:ce,redundant:!0},{icon:(0,Z.jsx)(Bt,{size:14,strokeWidth:1.5}),label:`Expand all sections`,hotkey:`global.expandAllSections`,handle:U,redundant:!0},{divider:!0,icon:(0,Z.jsx)(Ut,{size:14,strokeWidth:1.5}),label:`Command palette`,hotkey:`global.commandPalette`,handle:()=>me(Ur)},{icon:(0,Z.jsx)(Fe,{size:14,strokeWidth:1.5}),label:`Keyboard shortcuts`,hotkey:`global.showHelp`,handle:()=>_e(Hr)},{icon:(0,Z.jsx)(ft,{size:14,strokeWidth:1.5}),label:`User settings`,handle:()=>he(Vr),redundant:!0,additionalKeywords:[`preferences`,`options`,`configuration`]},{icon:(0,Z.jsx)(Jt,{size:14,strokeWidth:1.5}),label:`Report an issue`,additionalKeywords:[`feedback`,`bug`,`issue`,`report`,`diagnostics`],handle:()=>_((0,Z.jsx)(jt,{onClose:v}))},{icon:(0,Z.jsx)(Ke,{size:14,strokeWidth:1.5}),label:`Resources`,handle:kr,dropdown:[{icon:(0,Z.jsx)(ke,{size:14,strokeWidth:1.5}),label:`Documentation`,handle:Br},{icon:(0,Z.jsx)(Ft,{className:`h-3.5 w-3.5`}),label:`GitHub`,handle:zr},{icon:(0,Z.jsx)(Ye,{size:14,strokeWidth:1.5}),label:`Discord Community`,handle:Rr},{icon:(0,Z.jsx)(Ze,{className:`h-3.5 w-3.5`}),label:`YouTube`,handle:Lr},{icon:(0,Z.jsx)(Me,{size:14,strokeWidth:1.5}),label:`Changelog`,handle:Ir}]},{divider:!0,icon:(0,Z.jsx)($e,{size:14,strokeWidth:1.5}),label:`Open home`,hidden:!location.search.includes(`file`),handle:Fr},{icon:(0,Z.jsx)(It,{size:14,strokeWidth:1.5}),label:`New notebook`,hidden:!location.search.includes(`file`),handle:Pr}].filter(Nr).map(jr),n[2]=xe,n[3]=ae,n[4]=R,n[5]=Ce,n[6]=I,n[7]=H,n[8]=v,n[9]=ce,n[10]=pe,n[11]=be,n[12]=G,n[13]=U,n[14]=m,n[15]=g,n[16]=Se,n[17]=je,n[18]=O,n[19]=_,n[20]=ge,n[21]=W,n[22]=le,n[23]=ue,n[24]=ye,n[25]=Te,n[26]=x,n[27]=k,n[28]=me,n[29]=ve,n[30]=_e,n[31]=Ee,n[32]=A,n[33]=he,n[34]=Oe,n[35]=q,n[36]=K,n[37]=y,n[38]=De,n[39]=V,n[40]=we,n[41]=B,n[42]=D.mode,n[43]=Ne}else Ne=n[43];return Ne}function jr(e){return e.dropdown?{...e,dropdown:e.dropdown.filter(Mr)}:e}function Mr(e){return!e.hidden}function Nr(e){return!e.hidden}function Pr(){let e=ae();window.open(e,`_blank`)}function Fr(){let e=document.baseURI.split(`?`)[0];window.open(e,`_blank`,`noopener`)}function Ir(){window.open(z.releasesPage,`_blank`)}function Lr(){window.open(z.youtube,`_blank`)}function Rr(){window.open(z.discordLink,`_blank`)}function zr(){window.open(z.githubPage,`_blank`)}function Br(){window.open(z.docsPage,`_blank`)}function Vr(e){return!e}function Hr(e){return!e}function Ur(e){return!e}function Wr(e){return[e,{disabled:!1}]}function Gr(e){return(0,Z.jsx)(`div`,{className:`w-8 flex justify-end`,children:e&&(0,Z.jsx)(ze,{size:14})})}export{sn as a,Jt as c,Ht as d,cn as i,Wt as l,Or as n,on as o,Er as r,en as s,Ar as t,Ut as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e,t,u as n}from"./useEvent-Dfcbgjhg.js";import{D as r,da as i,dt as a,h as o,ia as s,ri as c}from"./cells-
|
|
1
|
+
import{f as e,t,u as n}from"./useEvent-Dfcbgjhg.js";import{D as r,da as i,dt as a,h as o,ia as s,ri as c}from"./cells-D73Y_xmw.js";import{t as l}from"./compiler-runtime-BrajqUja.js";import{g as u}from"./useEventListener-D9cftcHj.js";import{o as d}from"./dist-qhAY4L2r.js";import{r as f}from"./requests-lt0JK8Jt.js";var p=l(),m=e(!1);function h(){let e=(0,p.c)(2),n=v(),r;return e[0]===n?r=e[1]:(r=()=>n(i(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(s(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:o}=r,s=[];for(let t of e){let e=i[t]?.current?.editorView,r;e?(c(e)!==`markdown`&&d(e),r=a(e)):r=o[t]?.code||``,s.push(r),n({cellId:t})}await t({cellIds:e,codes:s}).catch(e=>{u.error(e)})}export{v as a,g as i,y as n,h as o,_ as r,m as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./useEvent-Dfcbgjhg.js";import{D as t,dt as n,f as r}from"./cells-
|
|
1
|
+
import{t as e}from"./useEvent-Dfcbgjhg.js";import{D as t,dt as n,f as r}from"./cells-D73Y_xmw.js";import{t as i}from"./compiler-runtime-BrajqUja.js";import{t as a}from"./jsx-runtime-B74pBk57.js";import{r as o}from"./useDeleteCell-8ByYNceO.js";import{t as s}from"./use-toast-Wu434mLr.js";var c=i(),l=a();function u(){let i=(0,c.c)(3),{splitCell:a,undoSplitCell:u}=t(),d;return i[0]!==a||i[1]!==u?(d=e=>{let t=r(e.cellId);if(!t)return;let i=n(t);a(e);let{dismiss:c}=s({title:`Cell split`,action:(0,l.jsx)(o,{"data-testid":`undo-split-button`,size:`sm`,variant:`outline`,onClick:()=>{u({...e,snapshot:i}),d()},children:`Undo`})}),d=c},i[0]=a,i[1]=u,i[2]=d):d=i[2],e(d)}export{u as t};
|