@marimo-team/frontend 0.18.5-dev168 → 0.18.5-dev169

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/assets/{CellStatus-C5QfWAQj.js → CellStatus-DlwC0A_k.js} +1 -1
  2. package/dist/assets/{ConnectedDataExplorerComponent-B0tKPs5t.js → ConnectedDataExplorerComponent-C3aK452q.js} +1 -1
  3. package/dist/assets/{JsonOutput-NOfbbuUx.js → JsonOutput-C7Jn2Hoy.js} +9 -9
  4. package/dist/assets/{MarimoErrorOutput-usFICLUe.js → MarimoErrorOutput-Dtk0CQJu.js} +2 -2
  5. package/dist/assets/{RenderHTML-LxV1eecf.js → RenderHTML-DfrA7ZTv.js} +1 -1
  6. package/dist/assets/{add-cell-with-ai-CEKGThxQ.js → add-cell-with-ai-BYCrNUOQ.js} +12 -12
  7. package/dist/assets/{add-database-form-DQyrphh9.js → add-database-form-D-BVTDCT.js} +1 -1
  8. package/dist/assets/{agent-panel-CnTn12AW.js → agent-panel-CNIKszsQ.js} +6 -6
  9. package/dist/assets/{ai-model-dropdown-CxRols0L.js → ai-model-dropdown-CAhqhkRJ.js} +1 -1
  10. package/dist/assets/{app-config-button-DtMP2_j5.js → app-config-button-BhKhGiaG.js} +1 -1
  11. package/dist/assets/{cell-actions-DCZqhhwF.js → cell-actions-C8VD1BFf.js} +1 -1
  12. package/dist/assets/{cell-editor-DJ1tY3mU.js → cell-editor-bDu_ShRz.js} +7 -7
  13. package/dist/assets/cell-link-NwzNlJhp.js +1 -0
  14. package/dist/assets/{cells-DAR6V-0d.js → cells-xPjoZY0S.js} +46 -46
  15. package/dist/assets/{chat-components-CyY2c7cG.js → chat-components-CQFXyizy.js} +1 -1
  16. package/dist/assets/{chat-display-BgCCmGdz.js → chat-display-DqUXDG-o.js} +1 -1
  17. package/dist/assets/{chat-panel-ByuXM3gc.js → chat-panel-8iT2Wjh6.js} +2 -2
  18. package/dist/assets/client-Cbyg6uhC.js +4 -0
  19. package/dist/assets/{column-preview-DBqi4KCj.js → column-preview-BuNifqxS.js} +1 -1
  20. package/dist/assets/{command-BXWdrTY9.js → command-DIcQwElH.js} +1 -1
  21. package/dist/assets/command-palette-D_boTGwg.js +1 -0
  22. package/dist/assets/{common-D10A9aix.js → common-C6NCeVE8.js} +1 -1
  23. package/dist/assets/{config-D3ojpe3F.js → config-DWMmQmTt.js} +1 -1
  24. package/dist/assets/{datasource-CW2RMV2e.js → datasource-CyWtxjKq.js} +2 -2
  25. package/dist/assets/{dependency-graph-panel-CtlDdK0s.js → dependency-graph-panel-C01bMyQK.js} +3 -3
  26. package/dist/assets/{documentation-panel-Cup0ghBs.js → documentation-panel-BPUF-dp2.js} +1 -1
  27. package/dist/assets/{download-D3Uujsn_.js → download-B9UlWvRO.js} +1 -1
  28. package/dist/assets/edit-page-DFkV0LWx.js +13 -0
  29. package/dist/assets/{error-panel-DcRvXIwA.js → error-panel-ClGt4y8j.js} +1 -1
  30. package/dist/assets/{es-DCqUUmrq.js → es-1yDP0Xdp.js} +1 -1
  31. package/dist/assets/{file-explorer-panel-9Bt20tRi.js → file-explorer-panel-3SHWDl17.js} +1 -1
  32. package/dist/assets/{floating-outline-BTc4L5BF.js → floating-outline-C5wKHGsD.js} +1 -1
  33. package/dist/assets/{focus-6-St0ai2.js → focus-DPgrnlZ1.js} +1 -1
  34. package/dist/assets/{form-1WOcPtE8.js → form-B2Db87Zc.js} +2 -2
  35. package/dist/assets/{glide-data-editor-EdMWe-iv.js → glide-data-editor-CwVQm3Mn.js} +1 -1
  36. package/dist/assets/{globals-CJb4gcmW.js → globals-CC2GcyGk.js} +1 -1
  37. package/dist/assets/{home-page-Lqy9A89-.js → home-page-BdK-6xZH.js} +2 -2
  38. package/dist/assets/{index-CIoUDThG.js → index-CEHA_rtG.js} +9 -9
  39. package/dist/assets/index-G6ss-VDT.css +2 -0
  40. package/dist/assets/{kiosk-mode-C3lS9kUL.js → kiosk-mode-CsuyIDk3.js} +1 -1
  41. package/dist/assets/{layout-F63rlsGg.js → layout-DlHn_emH.js} +3 -3
  42. package/dist/assets/links-DR-r1Edb.js +1 -0
  43. package/dist/assets/{logs-panel-fnMYUf4-.js → logs-panel-BIW4BIAP.js} +1 -1
  44. package/dist/assets/{markdown-renderer-B9gYLzJX.js → markdown-renderer-B0tsGAgw.js} +1 -1
  45. package/dist/assets/{mermaid-BUMgiGGr.js → mermaid-BcA-uOhi.js} +1 -1
  46. package/dist/assets/{mode-D4GlAyEq.js → mode-Ii-fBazZ.js} +1 -1
  47. package/dist/assets/{name-cell-input-BMtblyo6.js → name-cell-input-03mNaWsC.js} +1 -1
  48. package/dist/assets/outline-panel-D2OKWKZx.js +1 -0
  49. package/dist/assets/{packages-panel-DyC7zUxG.js → packages-panel-CzdZ8dRE.js} +1 -1
  50. package/dist/assets/{panels-wYHy1fpG.js → panels-DTuGqWrW.js} +1 -1
  51. package/dist/assets/{process-output-D1GR6Ero.js → process-output-Dsqg6AQn.js} +1 -1
  52. package/dist/assets/{readonly-python-code-CGnOB_RP.js → readonly-python-code-CEN7uCAn.js} +1 -1
  53. package/dist/assets/{renderShortcut-CV_tqoEI.js → renderShortcut-DolwKyOI.js} +1 -1
  54. package/dist/assets/{run-page-BLnJcKtg.js → run-page-Bv4-nptx.js} +1 -1
  55. package/dist/assets/{scratchpad-panel-CTJDEy90.js → scratchpad-panel-CwWN2smX.js} +1 -1
  56. package/dist/assets/{session-panel-C3rDPyig.js → session-panel-C35Uxsn7.js} +1 -1
  57. package/dist/assets/{snippets-panel-s0p4CCoa.js → snippets-panel-VLyEWSgW.js} +1 -1
  58. package/dist/assets/{state-BK5o1KAL.js → state-CLVMeQ5K.js} +1 -1
  59. package/dist/assets/{state-DwSzcmzL.js → state-DfW1MJsR.js} +1 -1
  60. package/dist/assets/{switch-C8yab1pC.js → switch-DXLifdeN.js} +1 -1
  61. package/dist/assets/{terminal-CA6CqpuO.js → terminal-O_0qSqHX.js} +1 -1
  62. package/dist/assets/{textarea-DBFtOima.js → textarea-BibopRh1.js} +1 -1
  63. package/dist/assets/tracing-kd2E6r4-.js +1 -0
  64. package/dist/assets/{tracing-panel-C-o1Db4W.js → tracing-panel-CingJf_V.js} +2 -2
  65. package/dist/assets/{types-Bt3U-XJV.js → types-B_DyfI3j.js} +1 -1
  66. package/dist/assets/{useAddCell-CNI3pgez.js → useAddCell-CuNdAB3f.js} +1 -1
  67. package/dist/assets/{useBoolean-C_vQizET.js → useBoolean-DWRpatKF.js} +1 -1
  68. package/dist/assets/{useCellActionButton-BbfiHu5s.js → useCellActionButton-CLGSFvWy.js} +1 -1
  69. package/dist/assets/{useDeleteCell-B_jFiS1Y.js → useDeleteCell-DAgP4oYp.js} +1 -1
  70. package/dist/assets/{useNotebookActions-BeM5fet2.js → useNotebookActions-CLAi2J0h.js} +1 -1
  71. package/dist/assets/useRunCells-BHhExio0.js +1 -0
  72. package/dist/assets/{useSplitCell-COPg5dJw.js → useSplitCell-CF_E2d8x.js} +1 -1
  73. package/dist/assets/{useTheme-CuOCKnyR.js → useTheme-CrojuouA.js} +1 -1
  74. package/dist/assets/{utilities.esm-B7XtzwiJ.js → utilities.esm-lV-KjYEM.js} +2 -2
  75. package/dist/assets/{utils-Cxqw03y3.js → utils-B_xHF0y2.js} +1 -1
  76. package/dist/assets/{vega-component-arPQXQS8.js → vega-component-DTFVCfi1.js} +1 -1
  77. package/dist/index.html +37 -37
  78. package/package.json +1 -1
  79. package/src/components/editor/actions/useNotebookActions.tsx +1 -1
  80. package/src/components/editor/chrome/state.ts +30 -15
  81. package/src/components/editor/chrome/types.ts +67 -77
  82. package/src/components/editor/chrome/wrapper/app-chrome.tsx +148 -84
  83. package/src/components/editor/chrome/wrapper/sidebar.tsx +76 -43
  84. package/src/components/ui/reorderable-list.tsx +190 -31
  85. package/dist/assets/cell-link-DjST51KF.js +0 -1
  86. package/dist/assets/client-BQowSjqE.js +0 -4
  87. package/dist/assets/command-palette-CjFiCjws.js +0 -1
  88. package/dist/assets/edit-page-fJ4hHm67.js +0 -13
  89. package/dist/assets/index-D-BWugLn.css +0 -2
  90. package/dist/assets/links-ZVVAwqm7.js +0 -1
  91. package/dist/assets/outline-panel-Blq76m9b.js +0 -1
  92. package/dist/assets/tracing-VZVj-gEo.js +0 -1
  93. package/dist/assets/useRunCells-oeY0TrS1.js +0 -1
@@ -1 +1 @@
1
- import{s as $}from"./chunk-LvLJmgfZ.js";import{t as z}from"./react-BGmjiNul.js";import{X as F}from"./cells-DAR6V-0d.js";import{t as O}from"./compiler-runtime-DeeZ7FnK.js";import{u as B}from"./hotkeys-D3ICc8RW.js";import{t as L}from"./jsx-runtime-DN_bIXfG.js";import{t as V}from"./createLucideIcon-CW2xpJ57.js";import{c as G,l as A,n as J,t as _}from"./toDate-5JckKRQn.js";import{t as K}from"./ellipsis-DwHM80y-.js";import{t as R}from"./refresh-cw-Din9uFKE.js";import{t as Q}from"./workflow-ZGK5flRg.js";import{t as D}from"./tooltip-CvjcEpZC.js";import{i as U,n as Y,r as C,t as Z}from"./en-US-DhMN8sxe.js";import{t as E}from"./useDateFormatter-CV0QXb5P.js";import{t as H}from"./multi-icon-BOYRpNB_.js";var k=V("ban",[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);function X(n,e){let t=_(n)-+_(e);return t<0?-1:t>0?1:t}function ee(n){return J(n,Date.now())}function te(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 se(n){return e=>{let t=(n?Math[n]:Math.trunc)(e);return t===0?0:t}}function ae(n,e){return _(n)-+_(e)}function le(n,e){let t=_(n,e==null?void 0:e.in);return t.setHours(23,59,59,999),t}function ne(n,e){let t=_(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 re(n,e){let t=_(n,e==null?void 0:e.in);return+le(t,e)==+ne(t,e)}function ie(n,e,t){let[d,l,h]=Y(t==null?void 0:t.in,n,n,e),o=X(l,h),b=Math.abs(te(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;re(d)&&b===1&&X(d,h)===1&&(m=!1);let x=o*(b-+m);return x===0?0:x}function ce(n,e,t){let d=ae(n,e)/1e3;return se(t==null?void 0:t.roundingMethod)(d)}function oe(n,e,t){let d=U(),l=(t==null?void 0:t.locale)??d.locale??Z,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=ce(m,b),M=(C(m)-C(b))/1e3,p=Math.round((x-M)/60),T;if(p<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):p===0?l.formatDistance("lessThanXMinutes",1,o):l.formatDistance("xMinutes",p,o);if(p<45)return l.formatDistance("xMinutes",p,o);if(p<90)return l.formatDistance("aboutXHours",1,o);if(p<1440){let g=Math.round(p/60);return l.formatDistance("aboutXHours",g,o)}else{if(p<2520)return l.formatDistance("xDays",1,o);if(p<43200){let g=Math.round(p/G);return l.formatDistance("xDays",g,o)}else if(p<43200*2)return T=Math.round(p/A),l.formatDistance("aboutXMonths",T,o)}if(T=ie(m,b),T<12){let g=Math.round(p/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 ue(n,e){return oe(n,ee(n),e)}var I=$(z(),1);function de(n){let e=(0,I.useRef)(n),[t,d]=(0,I.useState)(n);return(0,I.useEffect)(()=>{let l=setInterval(()=>{d(F.now().toMilliseconds())},17);return()=>clearInterval(l)},[]),t-e.current}var P=O(),s=$(L(),1);const me=n=>{let e=(0,P.c)(79),{editing:t,status:d,disabled:l,staleInputs:h,edited:o,interrupted:b,elapsedTime:m,runStartTimestamp:x,lastRunStartTimestamp:M,uninstantiated:p}=n;if(!t)return null;let T=x??M,g;e[0]===T?g=e[1]:(g=T?(0,s.jsx)(he,{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)(H,{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)(D,{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)(D,{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)(H,{layerTop:!0,children:[(0,s.jsx)(Q,{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)(D,{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)(H,{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)(D,{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)(fe,{startTime:i})}),e[31]=i,e[32]=r);let f;return e[33]!==a||e[34]!==r?(f=(0,s.jsx)(D,{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)(K,{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)(D,{content:a,usePortal:!0,children:i}),e[40]=a,e[41]=r),r}if(o||b||h||p){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)(q,{elapsedTime:a}):null,e[44]=m,e[45]=a,e[46]=i):i=e[46];let r=i,f,v="";if(p)f="This cell has not yet been run";else if(b){f="This cell was interrupted when it was last run";let j;e[47]===r?j=e[48]:(j=(0,s.jsxs)("span",{children:["This cell ran for ",r," before being interrupted"]}),e[47]=r,e[48]=j),v=j}else if(o){f="This cell has been modified since it was last run";let j;e[49]===r?j=e[50]:(j=(0,s.jsxs)("span",{children:["This cell took ",r," to run"]}),e[49]=r,e[50]=j),v=j}else{f="This cell has not been run with the latest inputs";let j;e[51]===r?j=e[52]:(j=(0,s.jsxs)("span",{children:["This cell took ",r," to run"]}),e[51]=r,e[52]=j),v=j}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)(D,{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)(D,{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)(q,{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)(D,{content:v,usePortal:!0,children:N}),e[76]=v,e[77]=N,e[78]=S):S=e[78],S}return null},q=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 he=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=ue(t),M;return e[2]===x?M=e[3]:(M=(0,s.jsxs)("span",{className:"text-muted-foreground",children:["(",x," ago)"]}),e[2]=x,e[3]=M),(0,s.jsxs)("span",{children:["Ran at"," ",(0,s.jsx)("strong",{className:"tracking-wide font-semibold",children:m.format(t)})," ",M]})};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 fe=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=de(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{q as n,W as r,me as t};
1
+ import{s as $}from"./chunk-LvLJmgfZ.js";import{t as z}from"./react-BGmjiNul.js";import{X as F}from"./cells-xPjoZY0S.js";import{t as O}from"./compiler-runtime-DeeZ7FnK.js";import{u as B}from"./hotkeys-D3ICc8RW.js";import{t as L}from"./jsx-runtime-DN_bIXfG.js";import{t as V}from"./createLucideIcon-CW2xpJ57.js";import{c as G,l as A,n as J,t as _}from"./toDate-5JckKRQn.js";import{t as K}from"./ellipsis-DwHM80y-.js";import{t as R}from"./refresh-cw-Din9uFKE.js";import{t as Q}from"./workflow-ZGK5flRg.js";import{t as D}from"./tooltip-CvjcEpZC.js";import{i as U,n as Y,r as C,t as Z}from"./en-US-DhMN8sxe.js";import{t as E}from"./useDateFormatter-CV0QXb5P.js";import{t as H}from"./multi-icon-BOYRpNB_.js";var k=V("ban",[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);function X(n,e){let t=_(n)-+_(e);return t<0?-1:t>0?1:t}function ee(n){return J(n,Date.now())}function te(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 se(n){return e=>{let t=(n?Math[n]:Math.trunc)(e);return t===0?0:t}}function ae(n,e){return _(n)-+_(e)}function le(n,e){let t=_(n,e==null?void 0:e.in);return t.setHours(23,59,59,999),t}function ne(n,e){let t=_(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 re(n,e){let t=_(n,e==null?void 0:e.in);return+le(t,e)==+ne(t,e)}function ie(n,e,t){let[d,l,h]=Y(t==null?void 0:t.in,n,n,e),o=X(l,h),b=Math.abs(te(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;re(d)&&b===1&&X(d,h)===1&&(m=!1);let x=o*(b-+m);return x===0?0:x}function ce(n,e,t){let d=ae(n,e)/1e3;return se(t==null?void 0:t.roundingMethod)(d)}function oe(n,e,t){let d=U(),l=(t==null?void 0:t.locale)??d.locale??Z,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=ce(m,b),M=(C(m)-C(b))/1e3,p=Math.round((x-M)/60),T;if(p<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):p===0?l.formatDistance("lessThanXMinutes",1,o):l.formatDistance("xMinutes",p,o);if(p<45)return l.formatDistance("xMinutes",p,o);if(p<90)return l.formatDistance("aboutXHours",1,o);if(p<1440){let g=Math.round(p/60);return l.formatDistance("aboutXHours",g,o)}else{if(p<2520)return l.formatDistance("xDays",1,o);if(p<43200){let g=Math.round(p/G);return l.formatDistance("xDays",g,o)}else if(p<43200*2)return T=Math.round(p/A),l.formatDistance("aboutXMonths",T,o)}if(T=ie(m,b),T<12){let g=Math.round(p/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 ue(n,e){return oe(n,ee(n),e)}var I=$(z(),1);function de(n){let e=(0,I.useRef)(n),[t,d]=(0,I.useState)(n);return(0,I.useEffect)(()=>{let l=setInterval(()=>{d(F.now().toMilliseconds())},17);return()=>clearInterval(l)},[]),t-e.current}var P=O(),s=$(L(),1);const me=n=>{let e=(0,P.c)(79),{editing:t,status:d,disabled:l,staleInputs:h,edited:o,interrupted:b,elapsedTime:m,runStartTimestamp:x,lastRunStartTimestamp:M,uninstantiated:p}=n;if(!t)return null;let T=x??M,g;e[0]===T?g=e[1]:(g=T?(0,s.jsx)(he,{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)(H,{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)(D,{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)(D,{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)(H,{layerTop:!0,children:[(0,s.jsx)(Q,{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)(D,{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)(H,{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)(D,{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)(fe,{startTime:i})}),e[31]=i,e[32]=r);let f;return e[33]!==a||e[34]!==r?(f=(0,s.jsx)(D,{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)(K,{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)(D,{content:a,usePortal:!0,children:i}),e[40]=a,e[41]=r),r}if(o||b||h||p){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)(q,{elapsedTime:a}):null,e[44]=m,e[45]=a,e[46]=i):i=e[46];let r=i,f,v="";if(p)f="This cell has not yet been run";else if(b){f="This cell was interrupted when it was last run";let j;e[47]===r?j=e[48]:(j=(0,s.jsxs)("span",{children:["This cell ran for ",r," before being interrupted"]}),e[47]=r,e[48]=j),v=j}else if(o){f="This cell has been modified since it was last run";let j;e[49]===r?j=e[50]:(j=(0,s.jsxs)("span",{children:["This cell took ",r," to run"]}),e[49]=r,e[50]=j),v=j}else{f="This cell has not been run with the latest inputs";let j;e[51]===r?j=e[52]:(j=(0,s.jsxs)("span",{children:["This cell took ",r," to run"]}),e[51]=r,e[52]=j),v=j}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)(D,{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)(D,{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)(q,{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)(D,{content:v,usePortal:!0,children:N}),e[76]=v,e[77]=N,e[78]=S):S=e[78],S}return null},q=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 he=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=ue(t),M;return e[2]===x?M=e[3]:(M=(0,s.jsxs)("span",{className:"text-muted-foreground",children:["(",x," ago)"]}),e[2]=x,e[3]=M),(0,s.jsxs)("span",{children:["Ran at"," ",(0,s.jsx)("strong",{className:"tracking-wide font-semibold",children:m.format(t)})," ",M]})};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 fe=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=de(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{q as n,W as r,me as t};