@marimo-team/frontend 0.23.13-dev0 → 0.23.13-dev2
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-xkT4Dvj4.js → CellStatus-B43aF1fe.js} +1 -1
- package/dist/assets/{JsonOutput-FFLZqPUK.js → JsonOutput-DTeVFctC.js} +4 -4
- package/dist/assets/{MarimoErrorOutput-BQt_FXJL.js → MarimoErrorOutput-DcImOp4r.js} +2 -2
- package/dist/assets/{RenderHTML-Cq4mwWYz.js → RenderHTML-BLBwT24G.js} +1 -1
- package/dist/assets/{RunButton-DdQ4s_KP.js → RunButton-CYnmbljZ.js} +1 -1
- package/dist/assets/{add-cell-with-ai-wdY7HT-D.js → add-cell-with-ai-8yk94rYa.js} +8 -8
- package/dist/assets/{add-connection-dialog-C41ThK2T.js → add-connection-dialog-CXW90r_2.js} +1 -1
- package/dist/assets/{agent-panel-q5ey8yNH.js → agent-panel-DjJhOAu6.js} +2 -2
- package/dist/assets/{ai-model-dropdown-DQb_CyMN.js → ai-model-dropdown-CQOgbiDG.js} +3 -3
- package/dist/assets/{app-config-button-8FXNdkBs.js → app-config-button-BzGthL1g.js} +1 -1
- package/dist/assets/cell-editor-IrwQ6wV6.js +27 -0
- package/dist/assets/{cell-link-DgWTiCtG.js → cell-link-LArpBcY-.js} +1 -1
- package/dist/assets/{cells-06TDmJ8V.js → cells-DQ5n6Zef.js} +37 -37
- package/dist/assets/{chat-display-DO7nc_uY.js → chat-display-CJa1DlwN.js} +1 -1
- package/dist/assets/{chat-panel-DmUkj42a.js → chat-panel-BY4ctHmZ.js} +1 -1
- package/dist/assets/{chat-ui-Bf7t-NAW.js → chat-ui-BieByIci.js} +1 -1
- package/dist/assets/{column-preview-oHsVFerC.js → column-preview-VcOeHtkt.js} +1 -1
- package/dist/assets/{command-palette-Bvl7fQ8h.js → command-palette-DtV4W1aF.js} +1 -1
- package/dist/assets/{common-cKvfH0fD.js → common-XGVukwY0.js} +1 -1
- package/dist/assets/{components-BhmX9dcm.js → components-C2HqGrL_.js} +1 -1
- package/dist/assets/{datasource-mVfTJz3V.js → datasource-BT-L2LDD.js} +2 -2
- package/dist/assets/{dependency-graph-panel-D9C_hBQw.js → dependency-graph-panel-DGDP7vz5.js} +1 -1
- package/dist/assets/{documentation-panel-C0uXzYri.js → documentation-panel-ODnRqsmJ.js} +1 -1
- package/dist/assets/{download-VxqV5OSK.js → download-rKGlekSQ.js} +4 -4
- package/dist/assets/{edit-page-CInfJ1ps.js → edit-page-DeFAhK8V.js} +6 -6
- package/dist/assets/{error-panel-D2WmJDnT.js → error-panel-BjCDBUEW.js} +1 -1
- package/dist/assets/{file-explorer-panel-nn5I1oLj.js → file-explorer-panel-UL0ND-sz.js} +3 -3
- package/dist/assets/{file-icons-BeJWUbBH.js → file-icons-DBMviz_K.js} +1 -1
- package/dist/assets/{file-name-input-Slq_KVFS.js → file-name-input-C1PsBoII.js} +1 -1
- package/dist/assets/{floating-outline-3UBj62S1.js → floating-outline-CPTvLHMl.js} +1 -1
- package/dist/assets/{focus-DqhVePQT.js → focus-Dol5ybck.js} +1 -1
- package/dist/assets/{form-pEJO4Mq_.js → form-B9I9mpZy.js} +1 -1
- package/dist/assets/{home-page-CFgoMQu4.js → home-page-D05XGteH.js} +2 -2
- package/dist/assets/{hooks-NssnE3R8.js → hooks-CO3SDGZ2.js} +1 -1
- package/dist/assets/{html-to-image-CbQeOjEJ.js → html-to-image-CmK-WSPG.js} +1 -1
- package/dist/assets/{index-BjsskD4V.js → index-iAj2M3os.js} +9 -9
- package/dist/assets/{kiosk-mode-CyYnV3_y.js → kiosk-mode-CAa5-suK.js} +1 -1
- package/dist/assets/{layout-ChW1-odP.js → layout-BANwNeHe.js} +4 -4
- package/dist/assets/{logs-panel-CiP_30S4.js → logs-panel-DJyCkydj.js} +1 -1
- package/dist/assets/{markdown-renderer-C1yypOYF.js → markdown-renderer-f3mfGw8u.js} +1 -1
- package/dist/assets/{name-cell-input-CIkFEB6-.js → name-cell-input-DteS1CD8.js} +1 -1
- package/dist/assets/{outline-panel-BfysapqU.js → outline-panel-FvxWzBOw.js} +1 -1
- package/dist/assets/{packages-panel-BYm2thcs.js → packages-panel-wjIUaBYs.js} +1 -1
- package/dist/assets/{panels-hLpsLawB.js → panels-BQOW0GWX.js} +1 -1
- package/dist/assets/{process-output-BIlXY0iE.js → process-output-Ll90qx0s.js} +1 -1
- package/dist/assets/{radio-group-BaOG2bSA.js → radio-group-D7RG9Px_.js} +1 -1
- package/dist/assets/{readonly-python-code-CNyK8G1T.js → readonly-python-code-DHJTIc4H.js} +1 -1
- package/dist/assets/{reveal-component-D0boNLsp.js → reveal-component-CfuKjozU.js} +1 -1
- package/dist/assets/{run-page-B0OR2l0l.js → run-page-DFWelrro.js} +1 -1
- package/dist/assets/{scratchpad-panel-Di7uCP6T.js → scratchpad-panel-BN-eTAIv.js} +1 -1
- package/dist/assets/{session-panel-D6GA7GoC.js → session-panel-Dywriyca.js} +1 -1
- package/dist/assets/{snippets-panel-DV2ir7q8.js → snippets-panel-Ee_wUGYF.js} +1 -1
- package/dist/assets/{state-DD6m9X2h.js → state-D7fu7IC3.js} +3 -3
- package/dist/assets/state-VxOqftwq.js +1 -0
- package/dist/assets/{textarea-BM7hAwR3.js → textarea-DD5BwHTh.js} +1 -1
- package/dist/assets/{tracing-DwjgsPkU.js → tracing-Ckq9673r.js} +1 -1
- package/dist/assets/{tracing-panel-BS9eUNK_.js → tracing-panel-7UPP4OM8.js} +2 -2
- package/dist/assets/{tree-actions-lVyJAYy7.js → tree-actions-CjikjOBA.js} +1 -1
- package/dist/assets/{useCellActionButton-B88iHApv.js → useCellActionButton-TRa0-mam.js} +1 -1
- package/dist/assets/{useDeleteCell-CXc93le9.js → useDeleteCell-CICC5IPM.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-9Vnr8-OR.js → useDependencyPanelTab-DUmpfdwT.js} +1 -1
- package/dist/assets/{useNotebookActions-DSfevQ7S.js → useNotebookActions-Z9M92mue.js} +1 -1
- package/dist/assets/useRunCells-bcK6jTD2.js +1 -0
- package/dist/assets/{useSplitCell-IsXuVcLF.js → useSplitCell-CqcM6MQ1.js} +1 -1
- package/dist/index.html +22 -22
- package/package.json +1 -1
- package/src/components/editor/cell/code/cell-editor.tsx +33 -1
- package/src/core/codemirror/cells/state.ts +5 -0
- package/src/core/codemirror/misc/__tests__/paste.test.ts +190 -1
- package/src/core/codemirror/misc/paste.ts +130 -114
- package/dist/assets/cell-editor-CFq9iL3S.js +0 -24
- package/dist/assets/state-B3ypjIx-.js +0 -1
- package/dist/assets/useRunCells-DNaOKKqW.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as $}from"./chunk-LvLJmgfZ.js";import{t as O}from"./react-Bj1aDYRI.js";import{mt as F}from"./cells-06TDmJ8V.js";import{t as z}from"./compiler-runtime-B3qBwwSJ.js";import{_ as B}from"./useEventListener-BakX-tnw.js";import{t as L}from"./jsx-runtime-PbYoItBR.js";import{t as _}from"./tooltip-CgQpRVyN.js";import{t as k}from"./ban-CttLZK8l.js";import{c as V,l as A,n as G,t as M}from"./toDate-DCE7d2fN.js";import{t as J}from"./ellipsis-D0iYysLh.js";import{t as R}from"./refresh-cw-DcEasnos.js";import{t as K}from"./workflow-ClrYl5m7.js";import{i as Q,n as Y,r as C,t as U}from"./en-US-DZwIjHwu.js";import{t as E}from"./useDateFormatter-CANi6nSX.js";import{t as I}from"./multi-icon-CGXdgpE4.js";function X(n,e){let t=M(n)-+M(e);return t<0?-1:t>0?1:t}function Z(n){return G(n,Date.now())}function ee(n,e,t){let[d,l]=Y(t==null?void 0:t.in,n,e),h=d.getFullYear()-l.getFullYear(),o=d.getMonth()-l.getMonth();return h*12+o}function te(n){return e=>{let t=(n?Math[n]:Math.trunc)(e);return t===0?0:t}}function se(n,e){return M(n)-+M(e)}function ae(n,e){let t=M(n,e==null?void 0:e.in);return t.setHours(23,59,59,999),t}function le(n,e){let t=M(n,e==null?void 0:e.in),d=t.getMonth();return t.setFullYear(t.getFullYear(),d+1,0),t.setHours(23,59,59,999),t}function ne(n,e){let t=M(n,e==null?void 0:e.in);return+ae(t,e)==+le(t,e)}function re(n,e,t){let[d,l,h]=Y(t==null?void 0:t.in,n,n,e),o=X(l,h),b=Math.abs(ee(l,h));if(b<1)return 0;l.getMonth()===1&&l.getDate()>27&&l.setDate(30),l.setMonth(l.getMonth()-o*b);let m=X(l,h)===-o;ne(d)&&b===1&&X(d,h)===1&&(m=!1);let x=o*(b-+m);return x===0?0:x}function ie(n,e,t){let d=se(n,e)/1e3;return te(t==null?void 0:t.roundingMethod)(d)}function ce(n,e,t){let d=Q(),l=(t==null?void 0:t.locale)??d.locale??U,h=X(n,e);if(isNaN(h))throw RangeError("Invalid time value");let o=Object.assign({},t,{addSuffix:t==null?void 0:t.addSuffix,comparison:h}),[b,m]=Y(t==null?void 0:t.in,...h>0?[e,n]:[n,e]),x=ie(m,b),D=(C(m)-C(b))/1e3,j=Math.round((x-D)/60),T;if(j<2)return t!=null&&t.includeSeconds?x<5?l.formatDistance("lessThanXSeconds",5,o):x<10?l.formatDistance("lessThanXSeconds",10,o):x<20?l.formatDistance("lessThanXSeconds",20,o):x<40?l.formatDistance("halfAMinute",0,o):x<60?l.formatDistance("lessThanXMinutes",1,o):l.formatDistance("xMinutes",1,o):j===0?l.formatDistance("lessThanXMinutes",1,o):l.formatDistance("xMinutes",j,o);if(j<45)return l.formatDistance("xMinutes",j,o);if(j<90)return l.formatDistance("aboutXHours",1,o);if(j<1440){let g=Math.round(j/60);return l.formatDistance("aboutXHours",g,o)}else{if(j<2520)return l.formatDistance("xDays",1,o);if(j<43200){let g=Math.round(j/V);return l.formatDistance("xDays",g,o)}else if(j<43200*2)return T=Math.round(j/A),l.formatDistance("aboutXMonths",T,o)}if(T=re(m,b),T<12){let g=Math.round(j/A);return l.formatDistance("xMonths",g,o)}else{let g=T%12,u=Math.trunc(T/12);return g<3?l.formatDistance("aboutXYears",u,o):g<9?l.formatDistance("overXYears",u,o):l.formatDistance("almostXYears",u+1,o)}}function oe(n,e){return ce(n,Z(n),e)}var q=$(O(),1);function ue(n){let e=(0,q.useRef)(n),[t,d]=(0,q.useState)(n);return(0,q.useEffect)(()=>{let l=setInterval(()=>{d(F.now().toMilliseconds())},17);return()=>clearInterval(l)},[]),t-e.current}var P=z(),s=$(L(),1);const de=n=>{let e=(0,P.c)(79),{editing:t,status:d,disabled:l,staleInputs:h,edited:o,interrupted:b,elapsedTime:m,runStartTimestamp:x,lastRunStartTimestamp:D,uninstantiated:j}=n;if(!t)return null;let T=x??D,g;e[0]===T?g=e[1]:(g=T?(0,s.jsx)(me,{lastRanTime:T}):null,e[0]=T,e[1]=g);let u=g;if(l&&d==="running")return B.error("CellStatusComponent: disabled and running"),null;if(l&&h){let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)("span",{children:"This cell is stale, but it's disabled and can't be run"}),e[2]=c):c=e[2];let a;e[3]===u?a=e[4]:(a=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[c,u]}),e[3]=u,e[4]=a);let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)("div",{className:"cell-status-icon cell-status-stale","data-testid":"cell-status","data-status":"stale",children:(0,s.jsxs)(I,{children:[(0,s.jsx)(k,{className:"h-5 w-5",strokeWidth:1.5}),(0,s.jsx)(R,{className:"h-3 w-3",strokeWidth:2.5})]})}),e[5]=i):i=e[5];let r;return e[6]===a?r=e[7]:(r=(0,s.jsx)(_,{content:a,usePortal:!0,children:i}),e[6]=a,e[7]=r),r}if(l){let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)("span",{children:"This cell is disabled"}),e[8]=c):c=e[8];let a;e[9]===u?a=e[10]:(a=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[c,u]}),e[9]=u,e[10]=a);let i;e[11]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)("div",{className:"cell-status-icon cell-status-disabled","data-testid":"cell-status","data-status":"disabled",children:(0,s.jsx)(k,{className:"h-5 w-5",strokeWidth:1.5})}),e[11]=i):i=e[11];let r;return e[12]===a?r=e[13]:(r=(0,s.jsx)(_,{content:a,usePortal:!0,children:i}),e[12]=a,e[13]=r),r}if(!h&&d==="disabled-transitively"){let c;e[14]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)("span",{children:"An ancestor of this cell is disabled, so it can't be run"}),e[14]=c):c=e[14];let a;e[15]===u?a=e[16]:(a=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[c,u]}),e[15]=u,e[16]=a);let i;e[17]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)("div",{className:"cell-status-icon cell-status-stale","data-testid":"cell-status","data-status":"disabled-transitively",children:(0,s.jsxs)(I,{layerTop:!0,children:[(0,s.jsx)(K,{className:"h-5 w-5",strokeWidth:1.5}),(0,s.jsx)(k,{className:"h-3 w-3",strokeWidth:2.5})]})}),e[17]=i):i=e[17];let r;return e[18]===a?r=e[19]:(r=(0,s.jsx)(_,{content:a,usePortal:!0,children:i}),e[18]=a,e[19]=r),r}if(h&&d==="disabled-transitively"){let c;e[20]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)("span",{children:"This cell is stale, but an ancestor is disabled so it can't be run"}),e[20]=c):c=e[20];let a;e[21]===u?a=e[22]:(a=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[c,u]}),e[21]=u,e[22]=a);let i;e[23]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)("div",{className:"cell-status-icon cell-status-stale","data-testid":"cell-status","data-status":"stale",children:(0,s.jsxs)(I,{children:[(0,s.jsx)(R,{className:"h-5 w-5",strokeWidth:1}),(0,s.jsx)(k,{className:"h-3 w-3",strokeWidth:2.5})]})}),e[23]=i):i=e[23];let r;return e[24]===a?r=e[25]:(r=(0,s.jsx)(_,{content:a,usePortal:!0,children:i}),e[24]=a,e[25]=r),r}if(d==="running"){let c;e[26]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)("span",{children:"This cell is running"}),e[26]=c):c=e[26];let a;e[27]===u?a=e[28]:(a=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[c,u]}),e[27]=u,e[28]=a);let i;e[29]===x?i=e[30]:(i=F.fromSeconds(x)||F.now(),e[29]=x,e[30]=i);let r;e[31]===i?r=e[32]:(r=(0,s.jsx)("div",{className:"cell-status-icon elapsed-time running","data-testid":"cell-status","data-status":"running",children:(0,s.jsx)(he,{startTime:i})}),e[31]=i,e[32]=r);let f;return e[33]!==a||e[34]!==r?(f=(0,s.jsx)(_,{content:a,usePortal:!0,children:r}),e[33]=a,e[34]=r,e[35]=f):f=e[35],f}if(d==="queued"){let c;e[36]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)("span",{children:"This cell is queued to run"}),e[36]=c):c=e[36];let a;e[37]===u?a=e[38]:(a=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[c,u]}),e[37]=u,e[38]=a);let i;e[39]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)("div",{className:"cell-status-icon cell-status-queued","data-testid":"cell-status","data-status":"queued",children:(0,s.jsx)(J,{className:"h-5 w-5",strokeWidth:1.5})}),e[39]=i):i=e[39];let r;return e[40]===a?r=e[41]:(r=(0,s.jsx)(_,{content:a,usePortal:!0,children:i}),e[40]=a,e[41]=r),r}if(o||b||h||j){let c;e[42]===m?c=e[43]:(c=W(m),e[42]=m,e[43]=c);let a=c,i;e[44]!==m||e[45]!==a?(i=m?(0,s.jsx)(H,{elapsedTime:a}):null,e[44]=m,e[45]=a,e[46]=i):i=e[46];let r=i,f,v="";if(j)f="This cell has not yet been run";else if(b){f="This cell was interrupted when it was last run";let p;e[47]===r?p=e[48]:(p=(0,s.jsxs)("span",{children:["This cell ran for ",r," before being interrupted"]}),e[47]=r,e[48]=p),v=p}else if(o){f="This cell has been modified since it was last run";let p;e[49]===r?p=e[50]:(p=(0,s.jsxs)("span",{children:["This cell took ",r," to run"]}),e[49]=r,e[50]=p),v=p}else{f="This cell has not been run with the latest inputs";let p;e[51]===r?p=e[52]:(p=(0,s.jsxs)("span",{children:["This cell took ",r," to run"]}),e[51]=r,e[52]=p),v=p}let N;e[53]===Symbol.for("react.memo_cache_sentinel")?(N=(0,s.jsx)("div",{className:"cell-status-stale","data-testid":"cell-status","data-status":"outdated",children:(0,s.jsx)(R,{className:"h-5 w-5",strokeWidth:1.5})}),e[53]=N):N=e[53];let S;e[54]===f?S=e[55]:(S=(0,s.jsx)(_,{content:f,usePortal:!0,children:N}),e[54]=f,e[55]=S);let y;e[56]!==m||e[57]!==a||e[58]!==u||e[59]!==v?(y=m&&(0,s.jsx)(_,{content:(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[v,u]}),usePortal:!0,children:(0,s.jsx)("div",{className:"elapsed-time hover-action","data-testid":"cell-status","data-status":"outdated",children:(0,s.jsx)("span",{children:a})})}),e[56]=m,e[57]=a,e[58]=u,e[59]=v,e[60]=y):y=e[60];let w;return e[61]!==S||e[62]!==y?(w=(0,s.jsxs)("div",{className:"cell-status-icon flex items-center gap-2",children:[S,y]}),e[61]=S,e[62]=y,e[63]=w):w=e[63],w}if(m!==null){let c;e[64]===m?c=e[65]:(c=W(m),e[64]=m,e[65]=c);let a=c,i;e[66]!==m||e[67]!==a?(i=m?(0,s.jsx)(H,{elapsedTime:a}):null,e[66]=m,e[67]=a,e[68]=i):i=e[68];let r=i,f;e[69]===r?f=e[70]:(f=(0,s.jsxs)("span",{children:["This cell took ",r," to run"]}),e[69]=r,e[70]=f);let v;e[71]!==u||e[72]!==f?(v=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[f,u]}),e[71]=u,e[72]=f,e[73]=v):v=e[73];let N;e[74]===a?N=e[75]:(N=(0,s.jsx)("div",{className:"cell-status-icon elapsed-time hover-action","data-testid":"cell-status","data-status":"idle",children:(0,s.jsx)("span",{children:a})}),e[74]=a,e[75]=N);let S;return e[76]!==v||e[77]!==N?(S=(0,s.jsx)(_,{content:v,usePortal:!0,children:N}),e[76]=v,e[77]=N,e[78]=S):S=e[78],S}return null},H=n=>{let e=(0,P.c)(2),t;return e[0]===n.elapsedTime?t=e[1]:(t=(0,s.jsx)("span",{className:"tracking-wide font-semibold",children:n.elapsedTime}),e[0]=n.elapsedTime,e[1]=t),t};var me=n=>{let e=(0,P.c)(4),t=new Date(n.lastRanTime*1e3),d=new Date,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={hour:"numeric",minute:"numeric",second:"numeric",fractionalSecondDigits:3,hour12:!0},e[0]=l):l=e[0];let h=E(l),o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",fractionalSecondDigits:3,hour12:!0},e[1]=o):o=e[1];let b=E(o),m=t.toDateString()===d.toDateString()?h:b,x=oe(t),D;return e[2]===x?D=e[3]:(D=(0,s.jsxs)("span",{className:"text-muted-foreground",children:["(",x," ago)"]}),e[2]=x,e[3]=D),(0,s.jsxs)("span",{children:["Ran at"," ",(0,s.jsx)("strong",{className:"tracking-wide font-semibold",children:m.format(t)})," ",D]})};function W(n){if(n===null)return"";let e=n,t=e/1e3;return t>=60?`${Math.floor(t/60)}m${Math.floor(t%60)}s`:t>=1?`${t.toFixed(2).toString()}s`:`${e.toFixed(0).toString()}ms`}var he=n=>{let e=(0,P.c)(6),t;e[0]===n.startTime?t=e[1]:(t=n.startTime.toMilliseconds(),e[0]=n.startTime,e[1]=t);let d=ue(t),l;e[2]===d?l=e[3]:(l=W(d),e[2]=d,e[3]=l);let h;return e[4]===l?h=e[5]:(h=(0,s.jsx)("span",{children:l}),e[4]=l,e[5]=h),h};export{H as n,W as r,de as t};
|
|
1
|
+
import{s as $}from"./chunk-LvLJmgfZ.js";import{t as O}from"./react-Bj1aDYRI.js";import{mt as F}from"./cells-DQ5n6Zef.js";import{t as z}from"./compiler-runtime-B3qBwwSJ.js";import{_ as B}from"./useEventListener-BakX-tnw.js";import{t as L}from"./jsx-runtime-PbYoItBR.js";import{t as _}from"./tooltip-CgQpRVyN.js";import{t as k}from"./ban-CttLZK8l.js";import{c as V,l as A,n as G,t as M}from"./toDate-DCE7d2fN.js";import{t as J}from"./ellipsis-D0iYysLh.js";import{t as R}from"./refresh-cw-DcEasnos.js";import{t as K}from"./workflow-ClrYl5m7.js";import{i as Q,n as Y,r as C,t as U}from"./en-US-DZwIjHwu.js";import{t as E}from"./useDateFormatter-CANi6nSX.js";import{t as I}from"./multi-icon-CGXdgpE4.js";function X(n,e){let t=M(n)-+M(e);return t<0?-1:t>0?1:t}function Z(n){return G(n,Date.now())}function ee(n,e,t){let[d,l]=Y(t==null?void 0:t.in,n,e),h=d.getFullYear()-l.getFullYear(),o=d.getMonth()-l.getMonth();return h*12+o}function te(n){return e=>{let t=(n?Math[n]:Math.trunc)(e);return t===0?0:t}}function se(n,e){return M(n)-+M(e)}function ae(n,e){let t=M(n,e==null?void 0:e.in);return t.setHours(23,59,59,999),t}function le(n,e){let t=M(n,e==null?void 0:e.in),d=t.getMonth();return t.setFullYear(t.getFullYear(),d+1,0),t.setHours(23,59,59,999),t}function ne(n,e){let t=M(n,e==null?void 0:e.in);return+ae(t,e)==+le(t,e)}function re(n,e,t){let[d,l,h]=Y(t==null?void 0:t.in,n,n,e),o=X(l,h),b=Math.abs(ee(l,h));if(b<1)return 0;l.getMonth()===1&&l.getDate()>27&&l.setDate(30),l.setMonth(l.getMonth()-o*b);let m=X(l,h)===-o;ne(d)&&b===1&&X(d,h)===1&&(m=!1);let x=o*(b-+m);return x===0?0:x}function ie(n,e,t){let d=se(n,e)/1e3;return te(t==null?void 0:t.roundingMethod)(d)}function ce(n,e,t){let d=Q(),l=(t==null?void 0:t.locale)??d.locale??U,h=X(n,e);if(isNaN(h))throw RangeError("Invalid time value");let o=Object.assign({},t,{addSuffix:t==null?void 0:t.addSuffix,comparison:h}),[b,m]=Y(t==null?void 0:t.in,...h>0?[e,n]:[n,e]),x=ie(m,b),D=(C(m)-C(b))/1e3,j=Math.round((x-D)/60),T;if(j<2)return t!=null&&t.includeSeconds?x<5?l.formatDistance("lessThanXSeconds",5,o):x<10?l.formatDistance("lessThanXSeconds",10,o):x<20?l.formatDistance("lessThanXSeconds",20,o):x<40?l.formatDistance("halfAMinute",0,o):x<60?l.formatDistance("lessThanXMinutes",1,o):l.formatDistance("xMinutes",1,o):j===0?l.formatDistance("lessThanXMinutes",1,o):l.formatDistance("xMinutes",j,o);if(j<45)return l.formatDistance("xMinutes",j,o);if(j<90)return l.formatDistance("aboutXHours",1,o);if(j<1440){let g=Math.round(j/60);return l.formatDistance("aboutXHours",g,o)}else{if(j<2520)return l.formatDistance("xDays",1,o);if(j<43200){let g=Math.round(j/V);return l.formatDistance("xDays",g,o)}else if(j<43200*2)return T=Math.round(j/A),l.formatDistance("aboutXMonths",T,o)}if(T=re(m,b),T<12){let g=Math.round(j/A);return l.formatDistance("xMonths",g,o)}else{let g=T%12,u=Math.trunc(T/12);return g<3?l.formatDistance("aboutXYears",u,o):g<9?l.formatDistance("overXYears",u,o):l.formatDistance("almostXYears",u+1,o)}}function oe(n,e){return ce(n,Z(n),e)}var q=$(O(),1);function ue(n){let e=(0,q.useRef)(n),[t,d]=(0,q.useState)(n);return(0,q.useEffect)(()=>{let l=setInterval(()=>{d(F.now().toMilliseconds())},17);return()=>clearInterval(l)},[]),t-e.current}var P=z(),s=$(L(),1);const de=n=>{let e=(0,P.c)(79),{editing:t,status:d,disabled:l,staleInputs:h,edited:o,interrupted:b,elapsedTime:m,runStartTimestamp:x,lastRunStartTimestamp:D,uninstantiated:j}=n;if(!t)return null;let T=x??D,g;e[0]===T?g=e[1]:(g=T?(0,s.jsx)(me,{lastRanTime:T}):null,e[0]=T,e[1]=g);let u=g;if(l&&d==="running")return B.error("CellStatusComponent: disabled and running"),null;if(l&&h){let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)("span",{children:"This cell is stale, but it's disabled and can't be run"}),e[2]=c):c=e[2];let a;e[3]===u?a=e[4]:(a=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[c,u]}),e[3]=u,e[4]=a);let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)("div",{className:"cell-status-icon cell-status-stale","data-testid":"cell-status","data-status":"stale",children:(0,s.jsxs)(I,{children:[(0,s.jsx)(k,{className:"h-5 w-5",strokeWidth:1.5}),(0,s.jsx)(R,{className:"h-3 w-3",strokeWidth:2.5})]})}),e[5]=i):i=e[5];let r;return e[6]===a?r=e[7]:(r=(0,s.jsx)(_,{content:a,usePortal:!0,children:i}),e[6]=a,e[7]=r),r}if(l){let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)("span",{children:"This cell is disabled"}),e[8]=c):c=e[8];let a;e[9]===u?a=e[10]:(a=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[c,u]}),e[9]=u,e[10]=a);let i;e[11]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)("div",{className:"cell-status-icon cell-status-disabled","data-testid":"cell-status","data-status":"disabled",children:(0,s.jsx)(k,{className:"h-5 w-5",strokeWidth:1.5})}),e[11]=i):i=e[11];let r;return e[12]===a?r=e[13]:(r=(0,s.jsx)(_,{content:a,usePortal:!0,children:i}),e[12]=a,e[13]=r),r}if(!h&&d==="disabled-transitively"){let c;e[14]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)("span",{children:"An ancestor of this cell is disabled, so it can't be run"}),e[14]=c):c=e[14];let a;e[15]===u?a=e[16]:(a=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[c,u]}),e[15]=u,e[16]=a);let i;e[17]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)("div",{className:"cell-status-icon cell-status-stale","data-testid":"cell-status","data-status":"disabled-transitively",children:(0,s.jsxs)(I,{layerTop:!0,children:[(0,s.jsx)(K,{className:"h-5 w-5",strokeWidth:1.5}),(0,s.jsx)(k,{className:"h-3 w-3",strokeWidth:2.5})]})}),e[17]=i):i=e[17];let r;return e[18]===a?r=e[19]:(r=(0,s.jsx)(_,{content:a,usePortal:!0,children:i}),e[18]=a,e[19]=r),r}if(h&&d==="disabled-transitively"){let c;e[20]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)("span",{children:"This cell is stale, but an ancestor is disabled so it can't be run"}),e[20]=c):c=e[20];let a;e[21]===u?a=e[22]:(a=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[c,u]}),e[21]=u,e[22]=a);let i;e[23]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)("div",{className:"cell-status-icon cell-status-stale","data-testid":"cell-status","data-status":"stale",children:(0,s.jsxs)(I,{children:[(0,s.jsx)(R,{className:"h-5 w-5",strokeWidth:1}),(0,s.jsx)(k,{className:"h-3 w-3",strokeWidth:2.5})]})}),e[23]=i):i=e[23];let r;return e[24]===a?r=e[25]:(r=(0,s.jsx)(_,{content:a,usePortal:!0,children:i}),e[24]=a,e[25]=r),r}if(d==="running"){let c;e[26]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)("span",{children:"This cell is running"}),e[26]=c):c=e[26];let a;e[27]===u?a=e[28]:(a=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[c,u]}),e[27]=u,e[28]=a);let i;e[29]===x?i=e[30]:(i=F.fromSeconds(x)||F.now(),e[29]=x,e[30]=i);let r;e[31]===i?r=e[32]:(r=(0,s.jsx)("div",{className:"cell-status-icon elapsed-time running","data-testid":"cell-status","data-status":"running",children:(0,s.jsx)(he,{startTime:i})}),e[31]=i,e[32]=r);let f;return e[33]!==a||e[34]!==r?(f=(0,s.jsx)(_,{content:a,usePortal:!0,children:r}),e[33]=a,e[34]=r,e[35]=f):f=e[35],f}if(d==="queued"){let c;e[36]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)("span",{children:"This cell is queued to run"}),e[36]=c):c=e[36];let a;e[37]===u?a=e[38]:(a=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[c,u]}),e[37]=u,e[38]=a);let i;e[39]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)("div",{className:"cell-status-icon cell-status-queued","data-testid":"cell-status","data-status":"queued",children:(0,s.jsx)(J,{className:"h-5 w-5",strokeWidth:1.5})}),e[39]=i):i=e[39];let r;return e[40]===a?r=e[41]:(r=(0,s.jsx)(_,{content:a,usePortal:!0,children:i}),e[40]=a,e[41]=r),r}if(o||b||h||j){let c;e[42]===m?c=e[43]:(c=W(m),e[42]=m,e[43]=c);let a=c,i;e[44]!==m||e[45]!==a?(i=m?(0,s.jsx)(H,{elapsedTime:a}):null,e[44]=m,e[45]=a,e[46]=i):i=e[46];let r=i,f,v="";if(j)f="This cell has not yet been run";else if(b){f="This cell was interrupted when it was last run";let p;e[47]===r?p=e[48]:(p=(0,s.jsxs)("span",{children:["This cell ran for ",r," before being interrupted"]}),e[47]=r,e[48]=p),v=p}else if(o){f="This cell has been modified since it was last run";let p;e[49]===r?p=e[50]:(p=(0,s.jsxs)("span",{children:["This cell took ",r," to run"]}),e[49]=r,e[50]=p),v=p}else{f="This cell has not been run with the latest inputs";let p;e[51]===r?p=e[52]:(p=(0,s.jsxs)("span",{children:["This cell took ",r," to run"]}),e[51]=r,e[52]=p),v=p}let N;e[53]===Symbol.for("react.memo_cache_sentinel")?(N=(0,s.jsx)("div",{className:"cell-status-stale","data-testid":"cell-status","data-status":"outdated",children:(0,s.jsx)(R,{className:"h-5 w-5",strokeWidth:1.5})}),e[53]=N):N=e[53];let S;e[54]===f?S=e[55]:(S=(0,s.jsx)(_,{content:f,usePortal:!0,children:N}),e[54]=f,e[55]=S);let y;e[56]!==m||e[57]!==a||e[58]!==u||e[59]!==v?(y=m&&(0,s.jsx)(_,{content:(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[v,u]}),usePortal:!0,children:(0,s.jsx)("div",{className:"elapsed-time hover-action","data-testid":"cell-status","data-status":"outdated",children:(0,s.jsx)("span",{children:a})})}),e[56]=m,e[57]=a,e[58]=u,e[59]=v,e[60]=y):y=e[60];let w;return e[61]!==S||e[62]!==y?(w=(0,s.jsxs)("div",{className:"cell-status-icon flex items-center gap-2",children:[S,y]}),e[61]=S,e[62]=y,e[63]=w):w=e[63],w}if(m!==null){let c;e[64]===m?c=e[65]:(c=W(m),e[64]=m,e[65]=c);let a=c,i;e[66]!==m||e[67]!==a?(i=m?(0,s.jsx)(H,{elapsedTime:a}):null,e[66]=m,e[67]=a,e[68]=i):i=e[68];let r=i,f;e[69]===r?f=e[70]:(f=(0,s.jsxs)("span",{children:["This cell took ",r," to run"]}),e[69]=r,e[70]=f);let v;e[71]!==u||e[72]!==f?(v=(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[f,u]}),e[71]=u,e[72]=f,e[73]=v):v=e[73];let N;e[74]===a?N=e[75]:(N=(0,s.jsx)("div",{className:"cell-status-icon elapsed-time hover-action","data-testid":"cell-status","data-status":"idle",children:(0,s.jsx)("span",{children:a})}),e[74]=a,e[75]=N);let S;return e[76]!==v||e[77]!==N?(S=(0,s.jsx)(_,{content:v,usePortal:!0,children:N}),e[76]=v,e[77]=N,e[78]=S):S=e[78],S}return null},H=n=>{let e=(0,P.c)(2),t;return e[0]===n.elapsedTime?t=e[1]:(t=(0,s.jsx)("span",{className:"tracking-wide font-semibold",children:n.elapsedTime}),e[0]=n.elapsedTime,e[1]=t),t};var me=n=>{let e=(0,P.c)(4),t=new Date(n.lastRanTime*1e3),d=new Date,l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={hour:"numeric",minute:"numeric",second:"numeric",fractionalSecondDigits:3,hour12:!0},e[0]=l):l=e[0];let h=E(l),o;e[1]===Symbol.for("react.memo_cache_sentinel")?(o={month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",fractionalSecondDigits:3,hour12:!0},e[1]=o):o=e[1];let b=E(o),m=t.toDateString()===d.toDateString()?h:b,x=oe(t),D;return e[2]===x?D=e[3]:(D=(0,s.jsxs)("span",{className:"text-muted-foreground",children:["(",x," ago)"]}),e[2]=x,e[3]=D),(0,s.jsxs)("span",{children:["Ran at"," ",(0,s.jsx)("strong",{className:"tracking-wide font-semibold",children:m.format(t)})," ",D]})};function W(n){if(n===null)return"";let e=n,t=e/1e3;return t>=60?`${Math.floor(t/60)}m${Math.floor(t%60)}s`:t>=1?`${t.toFixed(2).toString()}s`:`${e.toFixed(0).toString()}ms`}var he=n=>{let e=(0,P.c)(6),t;e[0]===n.startTime?t=e[1]:(t=n.startTime.toMilliseconds(),e[0]=n.startTime,e[1]=t);let d=ue(t),l;e[2]===d?l=e[3]:(l=W(d),e[2]=d,e[3]=l);let h;return e[4]===l?h=e[5]:(h=(0,s.jsx)("span",{children:l}),e[4]=l,e[5]=h),h};export{H as n,W as r,de as t};
|