@marimo-team/frontend 0.24.1-dev59 → 0.24.1-dev60

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 (113) hide show
  1. package/dist/assets/{CellStatus-D6_pLs0B.js → CellStatus-DeTZJKkI.js} +1 -1
  2. package/dist/assets/{ConnectedDataExplorerComponent-DZnvpjue.js → ConnectedDataExplorerComponent-CsYDGDdB.js} +1 -1
  3. package/dist/assets/{JsonOutput-D0JlHn1Z.js → JsonOutput-CucHb-Xd.js} +11 -11
  4. package/dist/assets/{MarimoErrorOutput-CYOWXi9k.js → MarimoErrorOutput-9BDdSrft.js} +2 -2
  5. package/dist/assets/{RenderHTML-qnAqp9Q0.js → RenderHTML-9AmE10az.js} +1 -1
  6. package/dist/assets/{RunButton-BDkLTxbY.js → RunButton-B1OO4yPE.js} +1 -1
  7. package/dist/assets/{merge-DxlVKwwO.js → _baseMerge-DLqSVasz.js} +1 -1
  8. package/dist/assets/{add-cell-with-ai-DVGZNNUv.js → add-cell-with-ai-B382kx-8.js} +8 -8
  9. package/dist/assets/{add-connection-dialog-CnRoNzHS.js → add-connection-dialog-CCgzVaXE.js} +1 -1
  10. package/dist/assets/{agent-panel-BTY3oeHD.js → agent-panel-tC3KSuFA.js} +1 -1
  11. package/dist/assets/ai-model-dropdown-BwTphSMd.js +3 -0
  12. package/dist/assets/{app-config-button-CB6s4qUy.js → app-config-button-C3LicTtk.js} +1 -1
  13. package/dist/assets/{blob-Dza7uUlT.js → blob-EfjbJ__b.js} +1 -1
  14. package/dist/assets/{cell-editor-D3YsOG7a.js → cell-editor-CR6poe2J.js} +7 -7
  15. package/dist/assets/{cell-link-DqJmxVu3.js → cell-link-q2lv7md_.js} +1 -1
  16. package/dist/assets/{cells-DfJw5iuV.js → cells-v0dAmt79.js} +18 -18
  17. package/dist/assets/{chat-display-NTNQQyoE.js → chat-display-C-KzQ4Sl.js} +1 -1
  18. package/dist/assets/{chat-panel-Bow0QKrA.js → chat-panel-BM8a5kkg.js} +3 -3
  19. package/dist/assets/{chat-ui-Cg69zAqt.js → chat-ui-B10QUDuE.js} +1 -1
  20. package/dist/assets/{chunk-5RXB4S5H-DHd0BPMu.js → chunk-5RXB4S5H-CUU6y4KG.js} +1 -1
  21. package/dist/assets/{chunk-GF5L2VYU-DidcU72l.js → chunk-GF5L2VYU-sioILS_d.js} +1 -1
  22. package/dist/assets/{chunk-J7OUQ5F2-BYO9AUEf.js → chunk-J7OUQ5F2-CO4p8tJJ.js} +2 -2
  23. package/dist/assets/{chunk-JQJVKLGR-BO9dy1YE.js → chunk-JQJVKLGR-BVs0Ec6r.js} +1 -1
  24. package/dist/assets/{classDiagram-JCYQIIEL-DXciwtwD.js → classDiagram-JCYQIIEL-DoI0wWRt.js} +1 -1
  25. package/dist/assets/{classDiagram-v2-OCEON4UE-DXciwtwD.js → classDiagram-v2-OCEON4UE-DoI0wWRt.js} +1 -1
  26. package/dist/assets/{column-preview-BdNXfBsJ.js → column-preview-DahZx7i3.js} +1 -1
  27. package/dist/assets/command-palette-DLDqpso1.js +1 -0
  28. package/dist/assets/{common-D_BAMDHd.js → common-C-hdr6As.js} +1 -1
  29. package/dist/assets/{components-D3x9DfK0.js → components-Cnt-rCdC.js} +1 -1
  30. package/dist/assets/{components-DwH_Yb1N.js → components-ib4asSo7.js} +1 -1
  31. package/dist/assets/config-Cl3eMWxb.js +1 -0
  32. package/dist/assets/{config-CUBl5qBg.js → config-DaNyNpZL.js} +1 -1
  33. package/dist/assets/dagre-B79OegKz.js +1 -0
  34. package/dist/assets/{dagre-VZM6K2ZE-Bztx5p0h.js → dagre-VZM6K2ZE-Bp1Dxcme.js} +1 -1
  35. package/dist/assets/{datasource-B9lSU_L0.js → datasource-Bq9EwG3Q.js} +1 -1
  36. package/dist/assets/{dependency-graph-panel-3-8ygeBR.js → dependency-graph-panel-DLgUYv2G.js} +1 -1
  37. package/dist/assets/{documentation-panel-BzJcTCN3.js → documentation-panel-BIqV8dCY.js} +1 -1
  38. package/dist/assets/{download-4OuOU5F0.js → download-D-WORhyV.js} +1 -1
  39. package/dist/assets/{edit-page-ds4edlkF.js → edit-page-rjLWDywQ.js} +6 -6
  40. package/dist/assets/{erDiagram-JOGREHBK-D7AqNG0H.js → erDiagram-JOGREHBK-L1YPulwW.js} +1 -1
  41. package/dist/assets/{error-entries-BCuZmxgk.js → error-entries-DOcZqCs5.js} +1 -1
  42. package/dist/assets/{error-panel-Dk-wFymb.js → error-panel-xPtHRph4.js} +1 -1
  43. package/dist/assets/{file-explorer-panel-Bprnrp3k.js → file-explorer-panel-YhKO1Kb8.js} +1 -1
  44. package/dist/assets/{file-icons-BnE-lUIr.js → file-icons-BI3Xijjz.js} +1 -1
  45. package/dist/assets/{file-name-input-B-KJyr-U.js → file-name-input-B0v9VVzS.js} +1 -1
  46. package/dist/assets/{floating-outline-BebYvSvL.js → floating-outline-fI7KiW7l.js} +1 -1
  47. package/dist/assets/{flowDiagram-UKHOOZJN-uIR0bHjt.js → flowDiagram-UKHOOZJN-dULvoGtY.js} +1 -1
  48. package/dist/assets/{glide-data-editor-BQNVc0zc.js → glide-data-editor-CSrQxrfb.js} +1 -1
  49. package/dist/assets/{home-page-zNwFmOPQ.js → home-page-BMzFHuuq.js} +1 -1
  50. package/dist/assets/{index-B36dhEV6.js → index-B2a_xizI.js} +8 -8
  51. package/dist/assets/{kiosk-mode-B2WU6CYc.js → kiosk-mode-CjT3sqy8.js} +1 -1
  52. package/dist/assets/{layout-iNJ-1JI2.js → layout-Dqce0OL2.js} +5 -5
  53. package/dist/assets/{logs-panel-CXu4QQwD.js → logs-panel-BlKmgk9O.js} +1 -1
  54. package/dist/assets/{markdown-renderer-BUBFaUWx.js → markdown-renderer-BHFj8yJ6.js} +1 -1
  55. package/dist/assets/{mermaid-CwvTqKGz.js → mermaid-BmbD1i8H.js} +3 -3
  56. package/dist/assets/{mindmap-definition-FAOFIHXS-DhzRwTNz.js → mindmap-definition-FAOFIHXS-aLgvJUwH.js} +1 -1
  57. package/dist/assets/{name-cell-input-DbRrAlCe.js → name-cell-input-9y9cdffD.js} +1 -1
  58. package/dist/assets/{outline-panel-16ugwsMh.js → outline-panel-BkyU6F0r.js} +1 -1
  59. package/dist/assets/{packages-panel-8OASpr5S.js → packages-panel-DGuBWpad.js} +1 -1
  60. package/dist/assets/{pair-with-agent-modal-CBIL9_6g.js → pair-with-agent-modal-TbFSfxnC.js} +1 -1
  61. package/dist/assets/{panel-accordion-state-786YBa3I.js → panel-accordion-state-C2vAFKpP.js} +1 -1
  62. package/dist/assets/panels-ZCSZ8vcg.js +4 -0
  63. package/dist/assets/{process-output-NwNkpkfY.js → process-output-DmEilKB6.js} +1 -1
  64. package/dist/assets/{readonly-code-display-Ce9Vb5Wf.js → readonly-code-display-2N0THiJK.js} +1 -1
  65. package/dist/assets/{readonly-python-code-CQd3Bopx.js → readonly-python-code-DyB_sdtx.js} +1 -1
  66. package/dist/assets/{renderShortcut-D9XYVNe3.js → renderShortcut-CS4ccH3x.js} +1 -1
  67. package/dist/assets/{requirementDiagram-LRYGKXZP-DcON47aG.js → requirementDiagram-LRYGKXZP-BOaR1V0o.js} +1 -1
  68. package/dist/assets/{reveal-component-C4pF9OE7.js → reveal-component-DmwU8_uO.js} +3 -3
  69. package/dist/assets/{run-page-Bo57bjbp.js → run-page-C-fKIihG.js} +1 -1
  70. package/dist/assets/{scratchpad-panel-vBIq9BfA.js → scratchpad-panel-D_0HEFCV.js} +1 -1
  71. package/dist/assets/{session-panel-BdXUO63q.js → session-panel-BAqFjL9-.js} +1 -1
  72. package/dist/assets/{skeleton-B5iAa5n_.js → skeleton-BUOlBrWg.js} +1 -1
  73. package/dist/assets/{snippets-panel-BI6SMTkf.js → snippets-panel-C4dcsNOG.js} +1 -1
  74. package/dist/assets/{state-DmlDv6kf.js → state-C8pDImyF.js} +3 -3
  75. package/dist/assets/{state-CZxxcsV7.js → state-Du63Xg9M.js} +1 -1
  76. package/dist/assets/{stateDiagram-OKZ733FA-CdIMP-aE.js → stateDiagram-OKZ733FA-BZg2y6qd.js} +1 -1
  77. package/dist/assets/{stateDiagram-v2-UEYNNEHI-DaZnzLJO.js → stateDiagram-v2-UEYNNEHI-C1g5a4e0.js} +1 -1
  78. package/dist/assets/{swimlanesDiagram-ULZ7WXOC-DHUJK_QJ.js → swimlanesDiagram-ULZ7WXOC-Cbwe8OlR.js} +1 -1
  79. package/dist/assets/{switch-CBR-ykv3.js → switch-27TbonxF.js} +1 -1
  80. package/dist/assets/{terminal-OC_FnEas.js → terminal-DOqqA9Ha.js} +1 -1
  81. package/dist/assets/{tracing-Bs9V1VRy.js → tracing-DPTkPFxO.js} +1 -1
  82. package/dist/assets/tracing-panel-3SQN2w-o.js +2 -0
  83. package/dist/assets/{tree-actions-A2eVufTn.js → tree-actions-Bn9POqng.js} +1 -1
  84. package/dist/assets/{useAddCell-BBv-60Hs.js → useAddCell-DtdPi8nq.js} +1 -1
  85. package/dist/assets/{useBoolean-DfDMEVCI.js → useBoolean-DWBCpKfT.js} +1 -1
  86. package/dist/assets/{useCellActionButton-DgA6C9_m.js → useCellActionButton-BS300A54.js} +1 -1
  87. package/dist/assets/{useDeleteCell-CqYCNkza.js → useDeleteCell-Ha8ut0yy.js} +1 -1
  88. package/dist/assets/{useDependencyPanelTab-DhGw5Y2R.js → useDependencyPanelTab-DsrUeu8t.js} +1 -1
  89. package/dist/assets/useNotebookActions-DdgIE9oe.js +10 -0
  90. package/dist/assets/{useRunCells-BwYUZxV6.js → useRunCells-CIALOcRX.js} +1 -1
  91. package/dist/assets/{useSplitCell-D0ws6n0g.js → useSplitCell-dEuZjk85.js} +1 -1
  92. package/dist/assets/{useTheme-BRnykVDX.js → useTheme-D3zvxdF3.js} +1 -1
  93. package/dist/assets/utils-CUZQNAWJ.js +1 -0
  94. package/dist/assets/{vega-component-CzgE5HEs.js → vega-component-DCOCpf2B.js} +1 -1
  95. package/dist/index.html +29 -29
  96. package/package.json +1 -1
  97. package/src/components/ai/__tests__/ai-utils.test.ts +64 -66
  98. package/src/components/ai/ai-model-dropdown.tsx +5 -1
  99. package/src/components/ai/ai-utils.ts +37 -21
  100. package/src/components/app-config/ai-config.tsx +86 -24
  101. package/src/components/app-config/user-config-form.tsx +2 -3
  102. package/src/core/ai/config.ts +2 -3
  103. package/src/core/config/__tests__/config-schema.test.ts +31 -0
  104. package/src/core/config/config-schema.ts +1 -0
  105. package/src/core/config/config.ts +15 -2
  106. package/dist/assets/ai-model-dropdown-D2q0Cm0R.js +0 -3
  107. package/dist/assets/command-palette-QFmIvDcT.js +0 -1
  108. package/dist/assets/config-DcB2swfZ.js +0 -1
  109. package/dist/assets/dagre-Bv00Sosz.js +0 -1
  110. package/dist/assets/panels-BbkuRtEi.js +0 -4
  111. package/dist/assets/tracing-panel-CMnYFlDr.js +0 -2
  112. package/dist/assets/useNotebookActions-DGuDG0Px.js +0 -10
  113. package/dist/assets/utils-R_pHe-RB.js +0 -1
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CBDbhulC.js";import{hr as n,mr as r}from"./cells-DfJw5iuV.js";import{t as i}from"./compiler-runtime-CYIjoINj.js";import{g as a}from"./useEventListener-D27Dii_l.js";import{t as o}from"./jsx-runtime-B74pBk57.js";import{t as s}from"./tooltip-D7dq6bnc.js";import{t as c}from"./ban-CwXfMsC1.js";import{c as l,l as u,n as d,t as f}from"./toDate-hGYJX0Ha.js";import{t as p}from"./ellipsis-Dfik_tuW.js";import{t as m}from"./refresh-cw-Bf-rx_aV.js";import{t as h}from"./workflow-SJ9KZapt.js";import{t as g}from"./useDateFormatter-BiqAQ-zI.js";import{i as _,n as v,r as y,t as b}from"./en-US-yTIMUO13.js";import{t as x}from"./multi-icon-COhkNiC1.js";function S(e,t){let n=f(e)-+f(t);return n<0?-1:n>0?1:n}function C(e){return d(e,Date.now())}function w(e,t,n){let[r,i]=v(n?.in,e,t),a=r.getFullYear()-i.getFullYear(),o=r.getMonth()-i.getMonth();return a*12+o}function T(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function E(e,t){return f(e)-+f(t)}function D(e,t){let n=f(e,t?.in);return n.setHours(23,59,59,999),n}function O(e,t){let n=f(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function k(e,t){let n=f(e,t?.in);return+D(n,t)==+O(n,t)}function A(e,t,n){let[r,i,a]=v(n?.in,e,e,t),o=S(i,a),s=Math.abs(w(i,a));if(s<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-o*s);let c=S(i,a)===-o;k(r)&&s===1&&S(r,a)===1&&(c=!1);let l=o*(s-+c);return l===0?0:l}function j(e,t,n){let r=E(e,t)/1e3;return T(n?.roundingMethod)(r)}function M(e,t,n){let r=_(),i=n?.locale??r.locale??b,a=S(e,t);if(isNaN(a))throw RangeError(`Invalid time value`);let o=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),[s,c]=v(n?.in,...a>0?[t,e]:[e,t]),d=j(c,s),f=(y(c)-y(s))/1e3,p=Math.round((d-f)/60),m;if(p<2)return n?.includeSeconds?d<5?i.formatDistance(`lessThanXSeconds`,5,o):d<10?i.formatDistance(`lessThanXSeconds`,10,o):d<20?i.formatDistance(`lessThanXSeconds`,20,o):d<40?i.formatDistance(`halfAMinute`,0,o):d<60?i.formatDistance(`lessThanXMinutes`,1,o):i.formatDistance(`xMinutes`,1,o):p===0?i.formatDistance(`lessThanXMinutes`,1,o):i.formatDistance(`xMinutes`,p,o);if(p<45)return i.formatDistance(`xMinutes`,p,o);if(p<90)return i.formatDistance(`aboutXHours`,1,o);if(p<1440){let e=Math.round(p/60);return i.formatDistance(`aboutXHours`,e,o)}if(p<2520)return i.formatDistance(`xDays`,1,o);if(p<43200){let e=Math.round(p/l);return i.formatDistance(`xDays`,e,o)}if(p<86400)return m=Math.round(p/u),i.formatDistance(`aboutXMonths`,m,o);if(m=A(c,s),m<12){let e=Math.round(p/u);return i.formatDistance(`xMonths`,e,o)}{let e=m%12,t=Math.trunc(m/12);return e<3?i.formatDistance(`aboutXYears`,t,o):e<9?i.formatDistance(`overXYears`,t,o):i.formatDistance(`almostXYears`,t+1,o)}}function N(e,t){return M(e,C(e),t)}var P=i(),F=e(t(),1);function I(e){let t=(0,F.useRef)(e),[n,i]=(0,F.useState)(e);return(0,F.useEffect)(()=>{let e=setInterval(()=>{i(r.now().toMilliseconds())},17);return()=>clearInterval(e)},[]),n-t.current}var L=o(),R=e=>{let t=(0,P.c)(79),{editing:i,status:o,disabled:l,staleInputs:u,edited:d,interrupted:f,elapsedTime:g,runStartTimestamp:_,lastRunStartTimestamp:v,uninstantiated:y}=e;if(!i)return null;let b=_??v,S;t[0]===b?S=t[1]:(S=b?(0,L.jsx)(B,{lastRanTime:b}):null,t[0]=b,t[1]=S);let C=S;if(l&&o===`running`)return a.error(`CellStatusComponent: disabled and running`),null;if(l&&u){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(`span`,{children:`This cell is stale, but it's disabled and can't be run`}),t[2]=e):e=t[2];let n;t[3]===C?n=t[4]:(n=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e,C]}),t[3]=C,t[4]=n);let r;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,L.jsx)(`div`,{className:`cell-status-icon cell-status-stale`,"data-testid":`cell-status`,"data-status":`stale`,children:(0,L.jsxs)(x,{children:[(0,L.jsx)(c,{className:`h-5 w-5`,strokeWidth:1.5}),(0,L.jsx)(m,{className:`h-3 w-3`,strokeWidth:2.5})]})}),t[5]=r):r=t[5];let i;return t[6]===n?i=t[7]:(i=(0,L.jsx)(s,{content:n,usePortal:!0,children:r}),t[6]=n,t[7]=i),i}if(l){let e;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(`span`,{children:`This cell is disabled`}),t[8]=e):e=t[8];let n;t[9]===C?n=t[10]:(n=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e,C]}),t[9]=C,t[10]=n);let r;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,L.jsx)(`div`,{className:`cell-status-icon cell-status-disabled`,"data-testid":`cell-status`,"data-status":`disabled`,children:(0,L.jsx)(c,{className:`h-5 w-5`,strokeWidth:1.5})}),t[11]=r):r=t[11];let i;return t[12]===n?i=t[13]:(i=(0,L.jsx)(s,{content:n,usePortal:!0,children:r}),t[12]=n,t[13]=i),i}if(!u&&o===`disabled-transitively`){let e;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(`span`,{children:`An ancestor of this cell is disabled, so it can't be run`}),t[14]=e):e=t[14];let n;t[15]===C?n=t[16]:(n=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e,C]}),t[15]=C,t[16]=n);let r;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,L.jsx)(`div`,{className:`cell-status-icon cell-status-stale`,"data-testid":`cell-status`,"data-status":`disabled-transitively`,children:(0,L.jsxs)(x,{layerTop:!0,children:[(0,L.jsx)(h,{className:`h-5 w-5`,strokeWidth:1.5}),(0,L.jsx)(c,{className:`h-3 w-3`,strokeWidth:2.5})]})}),t[17]=r):r=t[17];let i;return t[18]===n?i=t[19]:(i=(0,L.jsx)(s,{content:n,usePortal:!0,children:r}),t[18]=n,t[19]=i),i}if(u&&o===`disabled-transitively`){let e;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(`span`,{children:`This cell is stale, but an ancestor is disabled so it can't be run`}),t[20]=e):e=t[20];let n;t[21]===C?n=t[22]:(n=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e,C]}),t[21]=C,t[22]=n);let r;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,L.jsx)(`div`,{className:`cell-status-icon cell-status-stale`,"data-testid":`cell-status`,"data-status":`stale`,children:(0,L.jsxs)(x,{children:[(0,L.jsx)(m,{className:`h-5 w-5`,strokeWidth:1}),(0,L.jsx)(c,{className:`h-3 w-3`,strokeWidth:2.5})]})}),t[23]=r):r=t[23];let i;return t[24]===n?i=t[25]:(i=(0,L.jsx)(s,{content:n,usePortal:!0,children:r}),t[24]=n,t[25]=i),i}if(o===`running`){let e;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(`span`,{children:`This cell is running`}),t[26]=e):e=t[26];let n;t[27]===C?n=t[28]:(n=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e,C]}),t[27]=C,t[28]=n);let i;t[29]===_?i=t[30]:(i=r.fromSeconds(_)||r.now(),t[29]=_,t[30]=i);let a;t[31]===i?a=t[32]:(a=(0,L.jsx)(`div`,{className:`cell-status-icon elapsed-time running`,"data-testid":`cell-status`,"data-status":`running`,children:(0,L.jsx)(V,{startTime:i})}),t[31]=i,t[32]=a);let o;return t[33]!==n||t[34]!==a?(o=(0,L.jsx)(s,{content:n,usePortal:!0,children:a}),t[33]=n,t[34]=a,t[35]=o):o=t[35],o}if(o===`queued`){let e;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(`span`,{children:`This cell is queued to run`}),t[36]=e):e=t[36];let n;t[37]===C?n=t[38]:(n=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e,C]}),t[37]=C,t[38]=n);let r;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,L.jsx)(`div`,{className:`cell-status-icon cell-status-queued`,"data-testid":`cell-status`,"data-status":`queued`,children:(0,L.jsx)(p,{className:`h-5 w-5`,strokeWidth:1.5})}),t[39]=r):r=t[39];let i;return t[40]===n?i=t[41]:(i=(0,L.jsx)(s,{content:n,usePortal:!0,children:r}),t[40]=n,t[41]=i),i}if(d||f||u||y){let e;t[42]===g?e=t[43]:(e=n(g),t[42]=g,t[43]=e);let r=e,i;t[44]!==g||t[45]!==r?(i=g?(0,L.jsx)(z,{elapsedTime:r}):null,t[44]=g,t[45]=r,t[46]=i):i=t[46];let a=i,o,c=``;if(y)o=`This cell has not yet been run`;else if(f){o=`This cell was interrupted when it was last run`;let e;t[47]===a?e=t[48]:(e=(0,L.jsxs)(`span`,{children:[`This cell ran for `,a,` before being interrupted`]}),t[47]=a,t[48]=e),c=e}else if(d){o=`This cell has been modified since it was last run`;let e;t[49]===a?e=t[50]:(e=(0,L.jsxs)(`span`,{children:[`This cell took `,a,` to run`]}),t[49]=a,t[50]=e),c=e}else{o=`This cell has not been run with the latest inputs`;let e;t[51]===a?e=t[52]:(e=(0,L.jsxs)(`span`,{children:[`This cell took `,a,` to run`]}),t[51]=a,t[52]=e),c=e}let l;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,L.jsx)(`div`,{className:`cell-status-stale`,"data-testid":`cell-status`,"data-status":`outdated`,children:(0,L.jsx)(m,{className:`h-5 w-5`,strokeWidth:1.5})}),t[53]=l):l=t[53];let u;t[54]===o?u=t[55]:(u=(0,L.jsx)(s,{content:o,usePortal:!0,children:l}),t[54]=o,t[55]=u);let p;t[56]!==g||t[57]!==r||t[58]!==C||t[59]!==c?(p=g&&(0,L.jsx)(s,{content:(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[c,C]}),usePortal:!0,children:(0,L.jsx)(`div`,{className:`elapsed-time hover-action`,"data-testid":`cell-status`,"data-status":`outdated`,children:(0,L.jsx)(`span`,{children:r})})}),t[56]=g,t[57]=r,t[58]=C,t[59]=c,t[60]=p):p=t[60];let h;return t[61]!==u||t[62]!==p?(h=(0,L.jsxs)(`div`,{className:`cell-status-icon flex items-center gap-2`,children:[u,p]}),t[61]=u,t[62]=p,t[63]=h):h=t[63],h}if(g!==null){let e;t[64]===g?e=t[65]:(e=n(g),t[64]=g,t[65]=e);let r=e,i;t[66]!==g||t[67]!==r?(i=g?(0,L.jsx)(z,{elapsedTime:r}):null,t[66]=g,t[67]=r,t[68]=i):i=t[68];let a=i,o;t[69]===a?o=t[70]:(o=(0,L.jsxs)(`span`,{children:[`This cell took `,a,` to run`]}),t[69]=a,t[70]=o);let c;t[71]!==C||t[72]!==o?(c=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[o,C]}),t[71]=C,t[72]=o,t[73]=c):c=t[73];let l;t[74]===r?l=t[75]:(l=(0,L.jsx)(`div`,{className:`cell-status-icon elapsed-time hover-action`,"data-testid":`cell-status`,"data-status":`idle`,children:(0,L.jsx)(`span`,{children:r})}),t[74]=r,t[75]=l);let u;return t[76]!==c||t[77]!==l?(u=(0,L.jsx)(s,{content:c,usePortal:!0,children:l}),t[76]=c,t[77]=l,t[78]=u):u=t[78],u}return null},z=e=>{let t=(0,P.c)(2),n;return t[0]===e.elapsedTime?n=t[1]:(n=(0,L.jsx)(`span`,{className:`tracking-wide font-semibold`,children:e.elapsedTime}),t[0]=e.elapsedTime,t[1]=n),n},B=e=>{let t=(0,P.c)(4),n=new Date(e.lastRanTime*1e3),r=new Date,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={hour:`numeric`,minute:`numeric`,second:`numeric`,fractionalSecondDigits:3,hour12:!0},t[0]=i):i=t[0];let a=g(i),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o={month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`,fractionalSecondDigits:3,hour12:!0},t[1]=o):o=t[1];let s=g(o),c=n.toDateString()===r.toDateString()?a:s,l=N(n),u;return t[2]===l?u=t[3]:(u=(0,L.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,l,` ago)`]}),t[2]=l,t[3]=u),(0,L.jsxs)(`span`,{children:[`Ran at`,` `,(0,L.jsx)(`strong`,{className:`tracking-wide font-semibold`,children:c.format(n)}),` `,u]})},V=e=>{let t=(0,P.c)(6),r;t[0]===e.startTime?r=t[1]:(r=e.startTime.toMilliseconds(),t[0]=e.startTime,t[1]=r);let i=I(r),a;t[2]===i?a=t[3]:(a=n(i),t[2]=i,t[3]=a);let o;return t[4]===a?o=t[5]:(o=(0,L.jsx)(`span`,{children:a}),t[4]=a,t[5]=o),o};export{z as n,R as t};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CBDbhulC.js";import{hr as n,mr as r}from"./cells-v0dAmt79.js";import{t as i}from"./compiler-runtime-CYIjoINj.js";import{g as a}from"./useEventListener-D27Dii_l.js";import{t as o}from"./jsx-runtime-B74pBk57.js";import{t as s}from"./tooltip-D7dq6bnc.js";import{t as c}from"./ban-CwXfMsC1.js";import{c as l,l as u,n as d,t as f}from"./toDate-hGYJX0Ha.js";import{t as p}from"./ellipsis-Dfik_tuW.js";import{t as m}from"./refresh-cw-Bf-rx_aV.js";import{t as h}from"./workflow-SJ9KZapt.js";import{t as g}from"./useDateFormatter-BiqAQ-zI.js";import{i as _,n as v,r as y,t as b}from"./en-US-yTIMUO13.js";import{t as x}from"./multi-icon-COhkNiC1.js";function S(e,t){let n=f(e)-+f(t);return n<0?-1:n>0?1:n}function C(e){return d(e,Date.now())}function w(e,t,n){let[r,i]=v(n?.in,e,t),a=r.getFullYear()-i.getFullYear(),o=r.getMonth()-i.getMonth();return a*12+o}function T(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function E(e,t){return f(e)-+f(t)}function D(e,t){let n=f(e,t?.in);return n.setHours(23,59,59,999),n}function O(e,t){let n=f(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function k(e,t){let n=f(e,t?.in);return+D(n,t)==+O(n,t)}function A(e,t,n){let[r,i,a]=v(n?.in,e,e,t),o=S(i,a),s=Math.abs(w(i,a));if(s<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-o*s);let c=S(i,a)===-o;k(r)&&s===1&&S(r,a)===1&&(c=!1);let l=o*(s-+c);return l===0?0:l}function j(e,t,n){let r=E(e,t)/1e3;return T(n?.roundingMethod)(r)}function M(e,t,n){let r=_(),i=n?.locale??r.locale??b,a=S(e,t);if(isNaN(a))throw RangeError(`Invalid time value`);let o=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),[s,c]=v(n?.in,...a>0?[t,e]:[e,t]),d=j(c,s),f=(y(c)-y(s))/1e3,p=Math.round((d-f)/60),m;if(p<2)return n?.includeSeconds?d<5?i.formatDistance(`lessThanXSeconds`,5,o):d<10?i.formatDistance(`lessThanXSeconds`,10,o):d<20?i.formatDistance(`lessThanXSeconds`,20,o):d<40?i.formatDistance(`halfAMinute`,0,o):d<60?i.formatDistance(`lessThanXMinutes`,1,o):i.formatDistance(`xMinutes`,1,o):p===0?i.formatDistance(`lessThanXMinutes`,1,o):i.formatDistance(`xMinutes`,p,o);if(p<45)return i.formatDistance(`xMinutes`,p,o);if(p<90)return i.formatDistance(`aboutXHours`,1,o);if(p<1440){let e=Math.round(p/60);return i.formatDistance(`aboutXHours`,e,o)}if(p<2520)return i.formatDistance(`xDays`,1,o);if(p<43200){let e=Math.round(p/l);return i.formatDistance(`xDays`,e,o)}if(p<86400)return m=Math.round(p/u),i.formatDistance(`aboutXMonths`,m,o);if(m=A(c,s),m<12){let e=Math.round(p/u);return i.formatDistance(`xMonths`,e,o)}{let e=m%12,t=Math.trunc(m/12);return e<3?i.formatDistance(`aboutXYears`,t,o):e<9?i.formatDistance(`overXYears`,t,o):i.formatDistance(`almostXYears`,t+1,o)}}function N(e,t){return M(e,C(e),t)}var P=i(),F=e(t(),1);function I(e){let t=(0,F.useRef)(e),[n,i]=(0,F.useState)(e);return(0,F.useEffect)(()=>{let e=setInterval(()=>{i(r.now().toMilliseconds())},17);return()=>clearInterval(e)},[]),n-t.current}var L=o(),R=e=>{let t=(0,P.c)(79),{editing:i,status:o,disabled:l,staleInputs:u,edited:d,interrupted:f,elapsedTime:g,runStartTimestamp:_,lastRunStartTimestamp:v,uninstantiated:y}=e;if(!i)return null;let b=_??v,S;t[0]===b?S=t[1]:(S=b?(0,L.jsx)(B,{lastRanTime:b}):null,t[0]=b,t[1]=S);let C=S;if(l&&o===`running`)return a.error(`CellStatusComponent: disabled and running`),null;if(l&&u){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(`span`,{children:`This cell is stale, but it's disabled and can't be run`}),t[2]=e):e=t[2];let n;t[3]===C?n=t[4]:(n=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e,C]}),t[3]=C,t[4]=n);let r;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,L.jsx)(`div`,{className:`cell-status-icon cell-status-stale`,"data-testid":`cell-status`,"data-status":`stale`,children:(0,L.jsxs)(x,{children:[(0,L.jsx)(c,{className:`h-5 w-5`,strokeWidth:1.5}),(0,L.jsx)(m,{className:`h-3 w-3`,strokeWidth:2.5})]})}),t[5]=r):r=t[5];let i;return t[6]===n?i=t[7]:(i=(0,L.jsx)(s,{content:n,usePortal:!0,children:r}),t[6]=n,t[7]=i),i}if(l){let e;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(`span`,{children:`This cell is disabled`}),t[8]=e):e=t[8];let n;t[9]===C?n=t[10]:(n=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e,C]}),t[9]=C,t[10]=n);let r;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,L.jsx)(`div`,{className:`cell-status-icon cell-status-disabled`,"data-testid":`cell-status`,"data-status":`disabled`,children:(0,L.jsx)(c,{className:`h-5 w-5`,strokeWidth:1.5})}),t[11]=r):r=t[11];let i;return t[12]===n?i=t[13]:(i=(0,L.jsx)(s,{content:n,usePortal:!0,children:r}),t[12]=n,t[13]=i),i}if(!u&&o===`disabled-transitively`){let e;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(`span`,{children:`An ancestor of this cell is disabled, so it can't be run`}),t[14]=e):e=t[14];let n;t[15]===C?n=t[16]:(n=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e,C]}),t[15]=C,t[16]=n);let r;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,L.jsx)(`div`,{className:`cell-status-icon cell-status-stale`,"data-testid":`cell-status`,"data-status":`disabled-transitively`,children:(0,L.jsxs)(x,{layerTop:!0,children:[(0,L.jsx)(h,{className:`h-5 w-5`,strokeWidth:1.5}),(0,L.jsx)(c,{className:`h-3 w-3`,strokeWidth:2.5})]})}),t[17]=r):r=t[17];let i;return t[18]===n?i=t[19]:(i=(0,L.jsx)(s,{content:n,usePortal:!0,children:r}),t[18]=n,t[19]=i),i}if(u&&o===`disabled-transitively`){let e;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(`span`,{children:`This cell is stale, but an ancestor is disabled so it can't be run`}),t[20]=e):e=t[20];let n;t[21]===C?n=t[22]:(n=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e,C]}),t[21]=C,t[22]=n);let r;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,L.jsx)(`div`,{className:`cell-status-icon cell-status-stale`,"data-testid":`cell-status`,"data-status":`stale`,children:(0,L.jsxs)(x,{children:[(0,L.jsx)(m,{className:`h-5 w-5`,strokeWidth:1}),(0,L.jsx)(c,{className:`h-3 w-3`,strokeWidth:2.5})]})}),t[23]=r):r=t[23];let i;return t[24]===n?i=t[25]:(i=(0,L.jsx)(s,{content:n,usePortal:!0,children:r}),t[24]=n,t[25]=i),i}if(o===`running`){let e;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(`span`,{children:`This cell is running`}),t[26]=e):e=t[26];let n;t[27]===C?n=t[28]:(n=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e,C]}),t[27]=C,t[28]=n);let i;t[29]===_?i=t[30]:(i=r.fromSeconds(_)||r.now(),t[29]=_,t[30]=i);let a;t[31]===i?a=t[32]:(a=(0,L.jsx)(`div`,{className:`cell-status-icon elapsed-time running`,"data-testid":`cell-status`,"data-status":`running`,children:(0,L.jsx)(V,{startTime:i})}),t[31]=i,t[32]=a);let o;return t[33]!==n||t[34]!==a?(o=(0,L.jsx)(s,{content:n,usePortal:!0,children:a}),t[33]=n,t[34]=a,t[35]=o):o=t[35],o}if(o===`queued`){let e;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,L.jsx)(`span`,{children:`This cell is queued to run`}),t[36]=e):e=t[36];let n;t[37]===C?n=t[38]:(n=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[e,C]}),t[37]=C,t[38]=n);let r;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,L.jsx)(`div`,{className:`cell-status-icon cell-status-queued`,"data-testid":`cell-status`,"data-status":`queued`,children:(0,L.jsx)(p,{className:`h-5 w-5`,strokeWidth:1.5})}),t[39]=r):r=t[39];let i;return t[40]===n?i=t[41]:(i=(0,L.jsx)(s,{content:n,usePortal:!0,children:r}),t[40]=n,t[41]=i),i}if(d||f||u||y){let e;t[42]===g?e=t[43]:(e=n(g),t[42]=g,t[43]=e);let r=e,i;t[44]!==g||t[45]!==r?(i=g?(0,L.jsx)(z,{elapsedTime:r}):null,t[44]=g,t[45]=r,t[46]=i):i=t[46];let a=i,o,c=``;if(y)o=`This cell has not yet been run`;else if(f){o=`This cell was interrupted when it was last run`;let e;t[47]===a?e=t[48]:(e=(0,L.jsxs)(`span`,{children:[`This cell ran for `,a,` before being interrupted`]}),t[47]=a,t[48]=e),c=e}else if(d){o=`This cell has been modified since it was last run`;let e;t[49]===a?e=t[50]:(e=(0,L.jsxs)(`span`,{children:[`This cell took `,a,` to run`]}),t[49]=a,t[50]=e),c=e}else{o=`This cell has not been run with the latest inputs`;let e;t[51]===a?e=t[52]:(e=(0,L.jsxs)(`span`,{children:[`This cell took `,a,` to run`]}),t[51]=a,t[52]=e),c=e}let l;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,L.jsx)(`div`,{className:`cell-status-stale`,"data-testid":`cell-status`,"data-status":`outdated`,children:(0,L.jsx)(m,{className:`h-5 w-5`,strokeWidth:1.5})}),t[53]=l):l=t[53];let u;t[54]===o?u=t[55]:(u=(0,L.jsx)(s,{content:o,usePortal:!0,children:l}),t[54]=o,t[55]=u);let p;t[56]!==g||t[57]!==r||t[58]!==C||t[59]!==c?(p=g&&(0,L.jsx)(s,{content:(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[c,C]}),usePortal:!0,children:(0,L.jsx)(`div`,{className:`elapsed-time hover-action`,"data-testid":`cell-status`,"data-status":`outdated`,children:(0,L.jsx)(`span`,{children:r})})}),t[56]=g,t[57]=r,t[58]=C,t[59]=c,t[60]=p):p=t[60];let h;return t[61]!==u||t[62]!==p?(h=(0,L.jsxs)(`div`,{className:`cell-status-icon flex items-center gap-2`,children:[u,p]}),t[61]=u,t[62]=p,t[63]=h):h=t[63],h}if(g!==null){let e;t[64]===g?e=t[65]:(e=n(g),t[64]=g,t[65]=e);let r=e,i;t[66]!==g||t[67]!==r?(i=g?(0,L.jsx)(z,{elapsedTime:r}):null,t[66]=g,t[67]=r,t[68]=i):i=t[68];let a=i,o;t[69]===a?o=t[70]:(o=(0,L.jsxs)(`span`,{children:[`This cell took `,a,` to run`]}),t[69]=a,t[70]=o);let c;t[71]!==C||t[72]!==o?(c=(0,L.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[o,C]}),t[71]=C,t[72]=o,t[73]=c):c=t[73];let l;t[74]===r?l=t[75]:(l=(0,L.jsx)(`div`,{className:`cell-status-icon elapsed-time hover-action`,"data-testid":`cell-status`,"data-status":`idle`,children:(0,L.jsx)(`span`,{children:r})}),t[74]=r,t[75]=l);let u;return t[76]!==c||t[77]!==l?(u=(0,L.jsx)(s,{content:c,usePortal:!0,children:l}),t[76]=c,t[77]=l,t[78]=u):u=t[78],u}return null},z=e=>{let t=(0,P.c)(2),n;return t[0]===e.elapsedTime?n=t[1]:(n=(0,L.jsx)(`span`,{className:`tracking-wide font-semibold`,children:e.elapsedTime}),t[0]=e.elapsedTime,t[1]=n),n},B=e=>{let t=(0,P.c)(4),n=new Date(e.lastRanTime*1e3),r=new Date,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={hour:`numeric`,minute:`numeric`,second:`numeric`,fractionalSecondDigits:3,hour12:!0},t[0]=i):i=t[0];let a=g(i),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o={month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`,fractionalSecondDigits:3,hour12:!0},t[1]=o):o=t[1];let s=g(o),c=n.toDateString()===r.toDateString()?a:s,l=N(n),u;return t[2]===l?u=t[3]:(u=(0,L.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,l,` ago)`]}),t[2]=l,t[3]=u),(0,L.jsxs)(`span`,{children:[`Ran at`,` `,(0,L.jsx)(`strong`,{className:`tracking-wide font-semibold`,children:c.format(n)}),` `,u]})},V=e=>{let t=(0,P.c)(6),r;t[0]===e.startTime?r=t[1]:(r=e.startTime.toMilliseconds(),t[0]=e.startTime,t[1]=r);let i=I(r),a;t[2]===i?a=t[3]:(a=n(i),t[2]=i,t[3]=a);let o;return t[4]===a?o=t[5]:(o=(0,L.jsx)(`span`,{children:a}),t[4]=a,t[5]=o),o};export{z as n,R as t};